Skip to content

Commit d409825

Browse files
committed
cp dines
1 parent 8a5dcf0 commit d409825

8 files changed

Lines changed: 107 additions & 58 deletions

File tree

src/commands/gateway-config/get.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* Get gateway config command
2+
* Get gateway config command - supports lookup by ID or name
33
*/
44

5-
import { getClient } from "../../utils/client.js";
5+
import { getGatewayConfigByIdOrName } from "../../services/gatewayConfigService.js";
66
import { output, outputError } from "../../utils/output.js";
77

88
interface GetOptions {
@@ -12,9 +12,12 @@ interface GetOptions {
1212

1313
export async function getGatewayConfig(options: GetOptions) {
1414
try {
15-
const client = getClient();
15+
const config = await getGatewayConfigByIdOrName(options.id);
1616

17-
const config = await client.gatewayConfigs.retrieve(options.id);
17+
if (!config) {
18+
outputError(`Gateway config not found: ${options.id}`);
19+
return;
20+
}
1821

1922
output(config, { format: options.output, defaultFormat: "json" });
2023
} catch (error) {

src/commands/gateway-config/list.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ const ListGatewayConfigsUI = ({
209209
},
210210
{
211211
key: "edit",
212-
label: "Edit AI Gateway",
212+
label: "Edit AI Gateway Config",
213213
color: colors.warning,
214214
icon: figures.pointer,
215215
},
216216
{
217217
key: "delete",
218-
label: "Delete AI Gateway",
218+
label: "Delete AI Gateway Config",
219219
color: colors.error,
220220
icon: figures.cross,
221221
},
@@ -319,7 +319,7 @@ const ListGatewayConfigsUI = ({
319319
case "delete":
320320
await client.gatewayConfigs.delete(config.id);
321321
setOperationResult(
322-
`AI gateway "${config.name}" deleted successfully`,
322+
`AI gateway config "${config.name}" deleted successfully`,
323323
);
324324
break;
325325
}
@@ -481,11 +481,11 @@ const ListGatewayConfigsUI = ({
481481
if (showDeleteConfirm && selectedConfig) {
482482
return (
483483
<ConfirmationPrompt
484-
title="Delete AI Gateway"
484+
title="Delete AI Gateway Config"
485485
message={`Are you sure you want to delete "${selectedConfig.name}"?`}
486-
details="This action cannot be undone. Any devboxes using this AI gateway will no longer have access to it."
486+
details="This action cannot be undone. Any devboxes using this AI gateway config will no longer have access to it."
487487
breadcrumbItems={[
488-
{ label: "AI Gateways" },
488+
{ label: "AI Gateway Configs" },
489489
{ label: selectedConfig.name || selectedConfig.id },
490490
{ label: "Delete", active: true },
491491
]}
@@ -511,7 +511,7 @@ const ListGatewayConfigsUI = ({
511511
<>
512512
<Breadcrumb
513513
items={[
514-
{ label: "AI Gateways" },
514+
{ label: "AI Gateway Configs" },
515515
{
516516
label: selectedConfig?.name || selectedConfig?.id || "Config",
517517
},
@@ -534,13 +534,13 @@ const ListGatewayConfigsUI = ({
534534
operations.find((o) => o.key === executingOperation)?.label ||
535535
"Operation";
536536
const messages: Record<string, string> = {
537-
delete: "Deleting AI gateway...",
537+
delete: "Deleting AI gateway config...",
538538
};
539539
return (
540540
<>
541541
<Breadcrumb
542542
items={[
543-
{ label: "AI Gateways" },
543+
{ label: "AI Gateway Configs" },
544544
{ label: selectedConfig.name || selectedConfig.id },
545545
{ label: operationLabel, active: true },
546546
]}
@@ -589,8 +589,8 @@ const ListGatewayConfigsUI = ({
589589
if (loading && configs.length === 0) {
590590
return (
591591
<>
592-
<Breadcrumb items={[{ label: "AI Gateways", active: true }]} />
593-
<SpinnerComponent message="Loading AI gateways..." />
592+
<Breadcrumb items={[{ label: "AI Gateway Configs", active: true }]} />
593+
<SpinnerComponent message="Loading AI gateway configs..." />
594594
</>
595595
);
596596
}
@@ -599,16 +599,16 @@ const ListGatewayConfigsUI = ({
599599
if (error) {
600600
return (
601601
<>
602-
<Breadcrumb items={[{ label: "AI Gateways", active: true }]} />
603-
<ErrorMessage message="Failed to list AI gateways" error={error} />
602+
<Breadcrumb items={[{ label: "AI Gateway Configs", active: true }]} />
603+
<ErrorMessage message="Failed to list AI gateway configs" error={error} />
604604
</>
605605
);
606606
}
607607

608608
// Main list view
609609
return (
610610
<>
611-
<Breadcrumb items={[{ label: "AI Gateways", active: true }]} />
611+
<Breadcrumb items={[{ label: "AI Gateway Configs", active: true }]} />
612612

613613
{/* Search bar */}
614614
<SearchBar
@@ -618,7 +618,7 @@ const ListGatewayConfigsUI = ({
618618
resultCount={totalCount}
619619
onSearchChange={search.setSearchQuery}
620620
onSearchSubmit={search.submitSearch}
621-
placeholder="Search AI gateways..."
621+
placeholder="Search AI gateway configs..."
622622
/>
623623

624624
{/* Table - hide when popup is shown */}
@@ -631,7 +631,7 @@ const ListGatewayConfigsUI = ({
631631
columns={columns}
632632
emptyState={
633633
<Text color={colors.textDim}>
634-
{figures.info} No AI gateways found. Press [c] to create one.
634+
{figures.info} No AI gateway configs found. Press [c] to create one.
635635
</Text>
636636
}
637637
/>

src/components/DevboxCreatePage.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ export const DevboxCreatePage = ({
259259
},
260260
{
261261
key: "gateways",
262-
label: "AI Gateways (optional)",
262+
label: "AI Gateway Configs (optional)",
263263
type: "gateways",
264264
placeholder: "Configure API credential proxying...",
265265
},
@@ -1250,7 +1250,7 @@ export const DevboxCreatePage = ({
12501250
<ResourcePicker<GatewayConfig>
12511251
key="gateway-config-picker"
12521252
config={{
1253-
title: "Select AI Gateway",
1253+
title: "Select AI Gateway Config",
12541254
fetchPage: async (params) => {
12551255
const result = await listGatewayConfigs({
12561256
limit: params.limit,
@@ -1267,19 +1267,19 @@ export const DevboxCreatePage = ({
12671267
getItemLabel: (config) => config.name || config.id,
12681268
columns: buildGatewayColumns,
12691269
mode: "single",
1270-
emptyMessage: "No AI gateways found",
1271-
searchPlaceholder: "Search AI gateways...",
1270+
emptyMessage: "No AI gateway configs found",
1271+
searchPlaceholder: "Search AI gateway configs...",
12721272
breadcrumbItems: [
12731273
{ label: "Devboxes" },
12741274
{ label: "Create" },
1275-
{ label: "Attach AI Gateway" },
1275+
{ label: "Attach AI Gateway Config" },
12761276
{ label: "Select Config", active: true },
12771277
],
12781278
onCreateNew: () => {
12791279
setShowGatewayPicker(false);
12801280
setShowInlineGatewayConfigCreate(true);
12811281
},
1282-
createNewLabel: "Create AI gateway",
1282+
createNewLabel: "Create AI gateway config",
12831283
}}
12841284
onSelect={handleGatewaySelect}
12851285
onCancel={() => {
@@ -1389,7 +1389,7 @@ export const DevboxCreatePage = ({
13891389
breadcrumbItems: [
13901390
{ label: "Devboxes" },
13911391
{ label: "Create" },
1392-
{ label: "Attach AI Gateway" },
1392+
{ label: "Attach AI Gateway Config" },
13931393
{ label: "Select Secret", active: true },
13941394
],
13951395
onCreateNew: () => {
@@ -1833,7 +1833,7 @@ export const DevboxCreatePage = ({
18331833
marginBottom={1}
18341834
>
18351835
<Text color={colors.primary} bold>
1836-
{figures.hamburger} Configure AI Gateways for Devbox
1836+
{figures.hamburger} Configure AI Gateway Configs for Devbox
18371837
</Text>
18381838

18391839
{/* Attach form - shown when configuring a new gateway */}
@@ -1846,7 +1846,7 @@ export const DevboxCreatePage = ({
18461846
paddingX={1}
18471847
>
18481848
<Text color={colors.success} bold>
1849-
Attach AI Gateway
1849+
Attach AI Gateway Config
18501850
</Text>
18511851

18521852
{/* Attach button */}
@@ -1890,7 +1890,7 @@ export const DevboxCreatePage = ({
18901890
}
18911891
>
18921892
{gatewayFormField === "gateway" ? figures.pointer : " "}{" "}
1893-
AI Gateway:{" "}
1893+
AI Gateway Config:{" "}
18941894
</Text>
18951895
{pendingGateway ? (
18961896
<Text color={colors.success}>
@@ -2010,7 +2010,7 @@ export const DevboxCreatePage = ({
20102010
}
20112011
bold={selectedGatewayIndex === 0}
20122012
>
2013-
+ Attach AI gateway
2013+
+ Attach AI gateway config
20142014
</Text>
20152015
</Box>
20162016

@@ -2048,7 +2048,7 @@ export const DevboxCreatePage = ({
20482048
</Box>
20492049
<Box marginLeft={3} flexDirection="column">
20502050
<Text color={colors.textDim} dimColor>
2051-
AI Gateway: {gw.gatewayName} ({gw.gateway})
2051+
AI Gateway Config: {gw.gatewayName} ({gw.gateway})
20522052
</Text>
20532053
<Text color={colors.textDim} dimColor>
20542054
Secret: {gw.secretName} ({gw.secret})

src/components/GatewayConfigCreatePage.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const GatewayConfigCreatePage = ({
8888
}> = [
8989
{
9090
key: "create",
91-
label: isEditing ? "Update AI Gateway" : "Create AI Gateway",
91+
label: isEditing ? "Update AI Gateway Config" : "Create AI Gateway Config",
9292
type: "action",
9393
},
9494
{
@@ -297,12 +297,12 @@ export const GatewayConfigCreatePage = ({
297297
<>
298298
<Breadcrumb
299299
items={[
300-
{ label: "AI Gateways" },
300+
{ label: "AI Gateway Configs" },
301301
{ label: isEditing ? "Update" : "Create", active: true },
302302
]}
303303
/>
304304
<SuccessMessage
305-
message={`AI gateway ${isEditing ? "updated" : "created"} successfully!`}
305+
message={`AI gateway config ${isEditing ? "updated" : "created"} successfully!`}
306306
/>
307307
<Box marginLeft={2} flexDirection="column" marginTop={1}>
308308
<Box>
@@ -335,12 +335,12 @@ export const GatewayConfigCreatePage = ({
335335
<>
336336
<Breadcrumb
337337
items={[
338-
{ label: "AI Gateways" },
338+
{ label: "AI Gateway Configs" },
339339
{ label: isEditing ? "Update" : "Create", active: true },
340340
]}
341341
/>
342342
<ErrorMessage
343-
message={`Failed to ${isEditing ? "update" : "create"} AI gateway`}
343+
message={`Failed to ${isEditing ? "update" : "create"} AI gateway config`}
344344
error={error}
345345
/>
346346
<NavigationTips
@@ -359,12 +359,12 @@ export const GatewayConfigCreatePage = ({
359359
<>
360360
<Breadcrumb
361361
items={[
362-
{ label: "AI Gateways" },
362+
{ label: "AI Gateway Configs" },
363363
{ label: isEditing ? "Update" : "Create", active: true },
364364
]}
365365
/>
366366
<SpinnerComponent
367-
message={`${isEditing ? "Updating" : "Creating"} AI gateway...`}
367+
message={`${isEditing ? "Updating" : "Creating"} AI gateway config...`}
368368
/>
369369
</>
370370
);
@@ -375,7 +375,7 @@ export const GatewayConfigCreatePage = ({
375375
<>
376376
<Breadcrumb
377377
items={[
378-
{ label: "AI Gateways" },
378+
{ label: "AI Gateway Configs" },
379379
{ label: isEditing ? "Update" : "Create", active: true },
380380
]}
381381
/>

src/components/SettingsMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const settingsMenuItems: SettingsMenuItem[] = [
2424
},
2525
{
2626
key: "gateway-configs",
27-
label: "AI Gateways",
27+
label: "AI Gateway Configs",
2828
description: "Configure API credential proxying",
2929
icon: "⬡",
3030
color: colors.success,

0 commit comments

Comments
 (0)