@shipfox/client-agent 21.0.0 → 22.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +24 -0
- package/dist/components/add-custom-provider-card.d.ts.map +1 -1
- package/dist/components/add-custom-provider-card.js +11 -31
- package/dist/components/add-custom-provider-card.js.map +1 -1
- package/dist/components/available-provider-card.d.ts.map +1 -1
- package/dist/components/available-provider-card.js +11 -31
- package/dist/components/available-provider-card.js.map +1 -1
- package/dist/components/available-providers-grid.d.ts +0 -1
- package/dist/components/available-providers-grid.d.ts.map +1 -1
- package/dist/components/available-providers-grid.js +33 -27
- package/dist/components/available-providers-grid.js.map +1 -1
- package/dist/components/harnesses-section.d.ts.map +1 -1
- package/dist/components/harnesses-section.js +152 -146
- package/dist/components/harnesses-section.js.map +1 -1
- package/dist/components/model-provider-grid-skeleton.d.ts +4 -0
- package/dist/components/model-provider-grid-skeleton.d.ts.map +1 -0
- package/dist/components/model-provider-grid-skeleton.js +34 -0
- package/dist/components/model-provider-grid-skeleton.js.map +1 -0
- package/dist/components/model-providers-section.d.ts.map +1 -1
- package/dist/components/model-providers-section.js +268 -281
- package/dist/components/model-providers-section.js.map +1 -1
- package/dist/pages/model-provider-onboarding-page.d.ts.map +1 -1
- package/dist/pages/model-provider-onboarding-page.js +32 -64
- package/dist/pages/model-provider-onboarding-page.js.map +1 -1
- package/dist/routes/agents-settings.js +15 -5
- package/dist/routes/agents-settings.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/components/add-custom-provider-card.tsx +9 -23
- package/src/components/available-provider-card.tsx +9 -23
- package/src/components/available-providers-grid.tsx +36 -29
- package/src/components/harnesses-section.tsx +116 -109
- package/src/components/model-provider-grid-skeleton.tsx +21 -0
- package/src/components/model-providers-section.test.tsx +2 -2
- package/src/components/model-providers-section.tsx +208 -200
- package/src/pages/model-provider-onboarding-page.tsx +26 -54
- package/src/routes/agents-settings.tsx +7 -3
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -6,24 +6,24 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigge
|
|
|
6
6
|
import { EmptyState } from '@shipfox/react-ui/empty-state';
|
|
7
7
|
import { Icon } from '@shipfox/react-ui/icon';
|
|
8
8
|
import { Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, ModalTitle } from '@shipfox/react-ui/modal';
|
|
9
|
+
import { Panel, PanelBody, PanelRow } from '@shipfox/react-ui/panel';
|
|
9
10
|
import { Skeleton } from '@shipfox/react-ui/skeleton';
|
|
10
11
|
import { toast } from '@shipfox/react-ui/toast';
|
|
11
12
|
import { Tooltip, TooltipContent, TooltipTrigger } from '@shipfox/react-ui/tooltip';
|
|
12
13
|
import { Header, Text } from '@shipfox/react-ui/typography';
|
|
13
|
-
import { cn } from '@shipfox/react-ui/utils';
|
|
14
14
|
import { useEffect, useMemo, useReducer, useRef, useState } from 'react';
|
|
15
15
|
import { managementModalReducer } from '#core/model-provider-management-reducer.js';
|
|
16
16
|
import { customProviderCardMatchesSearch, isSupportedProvider, availableProviders as selectAvailableProviders } from '#core/provider-policy.js';
|
|
17
17
|
import { useDeleteModelProviderConfigMutation, useModelProviderCatalogQuery, useModelProviderConfigsQuery, useSetDefaultModelProviderMutation } from '#hooks/api/model-providers.js';
|
|
18
18
|
import { AddCustomProviderCard } from './add-custom-provider-card.js';
|
|
19
|
-
import { AvailableProvidersGrid
|
|
19
|
+
import { AvailableProvidersGrid } from './available-providers-grid.js';
|
|
20
20
|
import { ChangeDefaultModelForm } from './change-default-model-form.js';
|
|
21
21
|
import { CustomModelProviderForm } from './custom-model-provider-form.js';
|
|
22
22
|
import { modelProviderConfigErrorToFormError } from './form-errors.js';
|
|
23
|
+
import { ModelProviderGridSkeleton } from './model-provider-grid-skeleton.js';
|
|
23
24
|
import { ModelProviderUsageModal } from './model-provider-usage-modal.js';
|
|
24
25
|
import { usageTargetFromCatalogEntry, usageTargetFromCustomConfig } from './model-provider-usage-target.js';
|
|
25
26
|
import { ModelProviderTestAndSaveForm } from './test-and-save-form.js';
|
|
26
|
-
const SURFACE_CLASS = 'overflow-hidden rounded-8 border border-border-neutral-base bg-background-neutral-base';
|
|
27
27
|
const USAGE_MODAL_OPEN_DELAY_MS = 250;
|
|
28
28
|
export function WorkspaceModelProvidersSection({ workspaceId }) {
|
|
29
29
|
const catalogQuery = useModelProviderCatalogQuery();
|
|
@@ -81,91 +81,88 @@ export function WorkspaceModelProvidersSection({ workspaceId }) {
|
|
|
81
81
|
"aria-label": "Configured providers",
|
|
82
82
|
tabIndex: -1,
|
|
83
83
|
children: [
|
|
84
|
-
/*#__PURE__*/
|
|
84
|
+
/*#__PURE__*/ _jsx("div", {
|
|
85
85
|
className: "flex flex-col gap-tight",
|
|
86
|
-
children:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}),
|
|
91
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
92
|
-
size: "sm",
|
|
93
|
-
className: "text-foreground-neutral-muted",
|
|
94
|
-
children: "Workspace credentials available to agent steps."
|
|
95
|
-
})
|
|
96
|
-
]
|
|
86
|
+
children: /*#__PURE__*/ _jsx(Header, {
|
|
87
|
+
variant: "h3",
|
|
88
|
+
children: "Configured providers"
|
|
89
|
+
})
|
|
97
90
|
}),
|
|
98
91
|
configsQuery.isPending ? /*#__PURE__*/ _jsx(ModelProviderRowsSkeleton, {
|
|
99
92
|
label: "Loading configured providers"
|
|
100
93
|
}) : null,
|
|
101
|
-
configsQuery.isError && configsQuery.data === undefined ? /*#__PURE__*/ _jsx(
|
|
102
|
-
className: cn(SURFACE_CLASS, 'px-row'),
|
|
94
|
+
configsQuery.isError && configsQuery.data === undefined ? /*#__PURE__*/ _jsx(Panel, {
|
|
103
95
|
children: /*#__PURE__*/ _jsx(QueryLoadError, {
|
|
104
96
|
query: configsQuery,
|
|
105
|
-
subject: "model provider configs"
|
|
97
|
+
subject: "model provider configs",
|
|
98
|
+
variant: "panel"
|
|
106
99
|
})
|
|
107
100
|
}) : null,
|
|
108
|
-
configsQuery.data !== undefined && configs.length === 0 ? /*#__PURE__*/ _jsx(
|
|
109
|
-
className: cn(SURFACE_CLASS, 'px-row'),
|
|
101
|
+
configsQuery.data !== undefined && configs.length === 0 ? /*#__PURE__*/ _jsx(Panel, {
|
|
110
102
|
children: /*#__PURE__*/ _jsx(EmptyState, {
|
|
111
103
|
icon: "key2Line",
|
|
112
104
|
title: "No providers configured",
|
|
113
|
-
description: "Configure a provider below to run agent steps with workspace-managed credentials."
|
|
105
|
+
description: "Configure a provider below to run agent steps with workspace-managed credentials.",
|
|
106
|
+
variant: "panel"
|
|
114
107
|
})
|
|
115
108
|
}) : null,
|
|
116
|
-
configs.length > 0 ? /*#__PURE__*/ _jsx(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
109
|
+
configs.length > 0 ? /*#__PURE__*/ _jsx(Panel, {
|
|
110
|
+
children: /*#__PURE__*/ _jsx(PanelBody, {
|
|
111
|
+
asChild: true,
|
|
112
|
+
children: /*#__PURE__*/ _jsx("ul", {
|
|
113
|
+
children: configs.map((config)=>{
|
|
114
|
+
const catalogEntry = providerById.get(config.providerId);
|
|
115
|
+
const entry = catalogEntry && isSupportedProvider(catalogEntry) ? catalogEntry : undefined;
|
|
116
|
+
const builtinConfig = isBuiltinModelProviderConfig(config) ? config : undefined;
|
|
117
|
+
const customConfig = isCustomModelProviderConfig(config) ? config : undefined;
|
|
118
|
+
return /*#__PURE__*/ _jsx(ConfiguredProviderRow, {
|
|
119
|
+
workspaceId: workspaceId,
|
|
120
|
+
config: config,
|
|
121
|
+
entry: entry,
|
|
122
|
+
isDefault: config.providerId === defaultProviderId,
|
|
123
|
+
onEdit: ()=>{
|
|
124
|
+
if (entry && builtinConfig) {
|
|
125
|
+
dispatchModal({
|
|
126
|
+
type: 'edit-builtin',
|
|
127
|
+
provider: entry,
|
|
128
|
+
config: builtinConfig
|
|
129
|
+
});
|
|
130
|
+
} else if (customConfig) {
|
|
131
|
+
dispatchModal({
|
|
132
|
+
type: 'edit-custom',
|
|
133
|
+
config: customConfig
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
onChangeDefaultModel: ()=>{
|
|
138
|
+
if (entry && builtinConfig) dispatchModal({
|
|
139
|
+
type: 'change-default-model',
|
|
140
|
+
provider: entry,
|
|
141
|
+
config: builtinConfig
|
|
142
|
+
});
|
|
143
|
+
},
|
|
144
|
+
onShowUsage: ()=>{
|
|
145
|
+
if (entry && builtinConfig) {
|
|
146
|
+
setPendingUsageTarget(null);
|
|
147
|
+
dispatchModal({
|
|
148
|
+
type: 'show-usage',
|
|
149
|
+
providerId: entry.id,
|
|
150
|
+
initialModel: builtinConfig.defaultModel,
|
|
151
|
+
restoreFocusToConfiguredProviders: false
|
|
152
|
+
});
|
|
153
|
+
} else if (customConfig) {
|
|
154
|
+
setPendingUsageTarget(null);
|
|
155
|
+
dispatchModal({
|
|
156
|
+
type: 'show-usage',
|
|
157
|
+
providerId: customConfig.providerId,
|
|
158
|
+
initialModel: customConfig.defaultModel,
|
|
159
|
+
restoreFocusToConfiguredProviders: false
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}, config.providerId);
|
|
164
|
+
})
|
|
165
|
+
})
|
|
169
166
|
})
|
|
170
167
|
}) : null
|
|
171
168
|
]
|
|
@@ -174,26 +171,21 @@ export function WorkspaceModelProvidersSection({ workspaceId }) {
|
|
|
174
171
|
className: "flex flex-col gap-group",
|
|
175
172
|
"aria-label": "Available providers",
|
|
176
173
|
children: [
|
|
177
|
-
/*#__PURE__*/
|
|
174
|
+
/*#__PURE__*/ _jsx("div", {
|
|
178
175
|
className: "flex flex-col gap-tight",
|
|
179
|
-
children:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}),
|
|
184
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
185
|
-
size: "sm",
|
|
186
|
-
className: "text-foreground-neutral-muted",
|
|
187
|
-
children: "Providers that can be configured for agent steps in this workspace."
|
|
188
|
-
})
|
|
189
|
-
]
|
|
176
|
+
children: /*#__PURE__*/ _jsx(Header, {
|
|
177
|
+
variant: "h3",
|
|
178
|
+
children: "Available providers"
|
|
179
|
+
})
|
|
190
180
|
}),
|
|
191
|
-
catalogQuery.isPending || configsQuery.isPending ? /*#__PURE__*/ _jsx(ModelProviderGridSkeleton, {
|
|
192
|
-
|
|
193
|
-
|
|
181
|
+
catalogQuery.isPending || configsQuery.isPending ? /*#__PURE__*/ _jsx(ModelProviderGridSkeleton, {
|
|
182
|
+
label: "Loading available providers"
|
|
183
|
+
}) : null,
|
|
184
|
+
catalogQuery.isError && catalogQuery.data === undefined ? /*#__PURE__*/ _jsx(Panel, {
|
|
194
185
|
children: /*#__PURE__*/ _jsx(QueryLoadError, {
|
|
195
186
|
query: catalogQuery,
|
|
196
|
-
subject: "model provider catalog"
|
|
187
|
+
subject: "model provider catalog",
|
|
188
|
+
variant: "panel"
|
|
197
189
|
})
|
|
198
190
|
}) : null,
|
|
199
191
|
configsLoaded ? /*#__PURE__*/ _jsx(AvailableProvidersGrid, {
|
|
@@ -215,51 +207,51 @@ export function WorkspaceModelProvidersSection({ workspaceId }) {
|
|
|
215
207
|
className: "flex flex-col gap-group",
|
|
216
208
|
"aria-label": "Unsupported providers",
|
|
217
209
|
children: [
|
|
218
|
-
/*#__PURE__*/
|
|
210
|
+
/*#__PURE__*/ _jsx("div", {
|
|
219
211
|
className: "flex flex-col gap-tight",
|
|
220
|
-
children:
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}),
|
|
225
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
226
|
-
size: "sm",
|
|
227
|
-
className: "text-foreground-neutral-muted",
|
|
228
|
-
children: "Providers that cannot be configured in this workspace yet."
|
|
229
|
-
})
|
|
230
|
-
]
|
|
212
|
+
children: /*#__PURE__*/ _jsx(Header, {
|
|
213
|
+
variant: "h3",
|
|
214
|
+
children: "Unsupported providers"
|
|
215
|
+
})
|
|
231
216
|
}),
|
|
232
217
|
catalogQuery.isPending ? /*#__PURE__*/ _jsx(ModelProviderRowsSkeleton, {
|
|
233
218
|
label: "Loading unsupported providers"
|
|
234
219
|
}) : null,
|
|
235
|
-
unsupportedProviders.length > 0 ? /*#__PURE__*/ _jsx(
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
children:
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
220
|
+
unsupportedProviders.length > 0 ? /*#__PURE__*/ _jsx(Panel, {
|
|
221
|
+
children: /*#__PURE__*/ _jsx(PanelBody, {
|
|
222
|
+
asChild: true,
|
|
223
|
+
children: /*#__PURE__*/ _jsx("ul", {
|
|
224
|
+
children: unsupportedProviders.map((entry)=>/*#__PURE__*/ _jsx(PanelRow, {
|
|
225
|
+
asChild: true,
|
|
226
|
+
className: "items-start justify-start gap-cluster opacity-70 hover:bg-background-neutral-base",
|
|
227
|
+
children: /*#__PURE__*/ _jsxs("li", {
|
|
228
|
+
children: [
|
|
229
|
+
/*#__PURE__*/ _jsx(Icon, {
|
|
230
|
+
name: "forbid2Line",
|
|
231
|
+
className: "mt-[2px] size-18 shrink-0 text-foreground-neutral-muted",
|
|
232
|
+
"aria-hidden": true
|
|
233
|
+
}),
|
|
234
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
235
|
+
className: "flex min-w-0 flex-1 flex-col gap-tight",
|
|
236
|
+
children: [
|
|
237
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
238
|
+
size: "md",
|
|
239
|
+
bold: true,
|
|
240
|
+
className: "truncate",
|
|
241
|
+
children: entry.label
|
|
242
|
+
}),
|
|
243
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
244
|
+
size: "sm",
|
|
245
|
+
className: "text-foreground-neutral-muted",
|
|
246
|
+
children: entry.unsupportedReason
|
|
247
|
+
})
|
|
248
|
+
]
|
|
249
|
+
})
|
|
250
|
+
]
|
|
251
|
+
})
|
|
252
|
+
}, entry.id))
|
|
253
|
+
})
|
|
254
|
+
})
|
|
263
255
|
}) : null
|
|
264
256
|
]
|
|
265
257
|
}),
|
|
@@ -461,119 +453,122 @@ function ConfiguredProviderRow({ workspaceId, config, entry, isDefault, onEdit,
|
|
|
461
453
|
deleteConfig.reset();
|
|
462
454
|
}
|
|
463
455
|
}
|
|
464
|
-
return /*#__PURE__*/
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
children: /*#__PURE__*/ _jsx(
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
456
|
+
return /*#__PURE__*/ _jsx(PanelRow, {
|
|
457
|
+
asChild: true,
|
|
458
|
+
className: "flex-col items-stretch gap-inline",
|
|
459
|
+
children: /*#__PURE__*/ _jsxs("li", {
|
|
460
|
+
children: [
|
|
461
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
462
|
+
className: "flex items-center justify-between gap-cluster",
|
|
463
|
+
children: [
|
|
464
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
465
|
+
className: "flex min-w-0 items-center gap-inline",
|
|
466
|
+
children: [
|
|
467
|
+
isDefault ? /*#__PURE__*/ _jsxs(_Fragment, {
|
|
468
|
+
children: [
|
|
469
|
+
/*#__PURE__*/ _jsxs(Tooltip, {
|
|
470
|
+
children: [
|
|
471
|
+
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
472
|
+
asChild: true,
|
|
473
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
474
|
+
className: "inline-flex size-16 shrink-0 items-center justify-center",
|
|
475
|
+
children: /*#__PURE__*/ _jsx(Icon, {
|
|
476
|
+
name: "starLine",
|
|
477
|
+
className: "size-16 text-foreground-neutral-muted",
|
|
478
|
+
"aria-hidden": true
|
|
479
|
+
})
|
|
485
480
|
})
|
|
481
|
+
}),
|
|
482
|
+
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
483
|
+
children: "Default provider"
|
|
486
484
|
})
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
size: "md",
|
|
501
|
-
bold: true,
|
|
502
|
-
className: "truncate",
|
|
503
|
-
children: label
|
|
504
|
-
})
|
|
505
|
-
]
|
|
506
|
-
}),
|
|
507
|
-
/*#__PURE__*/ _jsxs(DropdownMenu, {
|
|
508
|
-
children: [
|
|
509
|
-
/*#__PURE__*/ _jsx(DropdownMenuTrigger, {
|
|
510
|
-
asChild: true,
|
|
511
|
-
children: /*#__PURE__*/ _jsx(IconButton, {
|
|
512
|
-
size: "sm",
|
|
513
|
-
variant: "transparent",
|
|
514
|
-
icon: "more2Line",
|
|
515
|
-
"aria-label": `Open ${label} provider actions`
|
|
485
|
+
]
|
|
486
|
+
}),
|
|
487
|
+
/*#__PURE__*/ _jsx("span", {
|
|
488
|
+
className: "sr-only",
|
|
489
|
+
children: "Default provider"
|
|
490
|
+
})
|
|
491
|
+
]
|
|
492
|
+
}) : null,
|
|
493
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
494
|
+
size: "md",
|
|
495
|
+
bold: true,
|
|
496
|
+
className: "truncate",
|
|
497
|
+
children: label
|
|
516
498
|
})
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
}) : null,
|
|
529
|
-
isBuiltinConfig ? /*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
530
|
-
icon: "settings3Line",
|
|
531
|
-
disabled: !entry,
|
|
532
|
-
onSelect: onChangeDefaultModel,
|
|
533
|
-
children: "Change default model"
|
|
534
|
-
}) : null,
|
|
535
|
-
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
536
|
-
icon: "bookOpenLine",
|
|
537
|
-
disabled: !canUse,
|
|
538
|
-
onSelect: onShowUsage,
|
|
539
|
-
children: "View workflow example"
|
|
540
|
-
}),
|
|
541
|
-
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
542
|
-
icon: "editLine",
|
|
543
|
-
disabled: !canEdit,
|
|
544
|
-
onSelect: onEdit,
|
|
545
|
-
children: customConfig ? 'Edit' : 'Edit credentials'
|
|
546
|
-
}),
|
|
547
|
-
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
548
|
-
icon: "deleteBinLine",
|
|
549
|
-
onSelect: ()=>{
|
|
550
|
-
setDeleteOpen(true);
|
|
551
|
-
},
|
|
552
|
-
children: "Delete"
|
|
499
|
+
]
|
|
500
|
+
}),
|
|
501
|
+
/*#__PURE__*/ _jsxs(DropdownMenu, {
|
|
502
|
+
children: [
|
|
503
|
+
/*#__PURE__*/ _jsx(DropdownMenuTrigger, {
|
|
504
|
+
asChild: true,
|
|
505
|
+
children: /*#__PURE__*/ _jsx(IconButton, {
|
|
506
|
+
size: "sm",
|
|
507
|
+
variant: "transparent",
|
|
508
|
+
icon: "more2Line",
|
|
509
|
+
"aria-label": `Open ${label} provider actions`
|
|
553
510
|
})
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
511
|
+
}),
|
|
512
|
+
/*#__PURE__*/ _jsxs(DropdownMenuContent, {
|
|
513
|
+
align: "end",
|
|
514
|
+
children: [
|
|
515
|
+
!isDefault ? /*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
516
|
+
icon: "starLine",
|
|
517
|
+
disabled: setDefault.isPending || !entry && !customConfig,
|
|
518
|
+
onSelect: ()=>{
|
|
519
|
+
void handleSetDefault();
|
|
520
|
+
},
|
|
521
|
+
children: "Set as default"
|
|
522
|
+
}) : null,
|
|
523
|
+
isBuiltinConfig ? /*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
524
|
+
icon: "settings3Line",
|
|
525
|
+
disabled: !entry,
|
|
526
|
+
onSelect: onChangeDefaultModel,
|
|
527
|
+
children: "Change default model"
|
|
528
|
+
}) : null,
|
|
529
|
+
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
530
|
+
icon: "bookOpenLine",
|
|
531
|
+
disabled: !canUse,
|
|
532
|
+
onSelect: onShowUsage,
|
|
533
|
+
children: "View workflow example"
|
|
534
|
+
}),
|
|
535
|
+
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
536
|
+
icon: "editLine",
|
|
537
|
+
disabled: !canEdit,
|
|
538
|
+
onSelect: onEdit,
|
|
539
|
+
children: customConfig ? 'Edit' : 'Edit credentials'
|
|
540
|
+
}),
|
|
541
|
+
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
542
|
+
icon: "deleteBinLine",
|
|
543
|
+
onSelect: ()=>{
|
|
544
|
+
setDeleteOpen(true);
|
|
545
|
+
},
|
|
546
|
+
children: "Delete"
|
|
547
|
+
})
|
|
548
|
+
]
|
|
549
|
+
})
|
|
550
|
+
]
|
|
551
|
+
})
|
|
552
|
+
]
|
|
553
|
+
}),
|
|
554
|
+
defaultError ? /*#__PURE__*/ _jsx(Callout, {
|
|
555
|
+
role: "alert",
|
|
556
|
+
type: "error",
|
|
557
|
+
children: /*#__PURE__*/ _jsx(Text, {
|
|
558
|
+
size: "sm",
|
|
559
|
+
children: defaultError
|
|
557
560
|
})
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
561
|
+
}) : null,
|
|
562
|
+
/*#__PURE__*/ _jsx(DeleteModelProviderDialog, {
|
|
563
|
+
open: deleteOpen,
|
|
564
|
+
onOpenChange: handleDeleteOpenChange,
|
|
565
|
+
label: label,
|
|
566
|
+
errorMessage: deleteError,
|
|
567
|
+
isLoading: deleteConfig.isPending,
|
|
568
|
+
onDelete: handleDelete
|
|
566
569
|
})
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
open: deleteOpen,
|
|
570
|
-
onOpenChange: handleDeleteOpenChange,
|
|
571
|
-
label: label,
|
|
572
|
-
errorMessage: deleteError,
|
|
573
|
-
isLoading: deleteConfig.isPending,
|
|
574
|
-
onDelete: handleDelete
|
|
575
|
-
})
|
|
576
|
-
]
|
|
570
|
+
]
|
|
571
|
+
})
|
|
577
572
|
});
|
|
578
573
|
}
|
|
579
574
|
function DeleteModelProviderDialog({ open, onOpenChange, label, errorMessage, isLoading, onDelete }) {
|
|
@@ -635,51 +630,43 @@ function DeleteModelProviderDialog({ open, onOpenChange, label, errorMessage, is
|
|
|
635
630
|
});
|
|
636
631
|
}
|
|
637
632
|
function ModelProviderRowsSkeleton({ label }) {
|
|
638
|
-
return /*#__PURE__*/ _jsx(
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
1,
|
|
645
|
-
2
|
|
646
|
-
].map((row)=>/*#__PURE__*/ _jsxs("li", {
|
|
647
|
-
className: "flex items-center gap-cluster px-row py-row",
|
|
633
|
+
return /*#__PURE__*/ _jsx(Panel, {
|
|
634
|
+
children: /*#__PURE__*/ _jsx(PanelBody, {
|
|
635
|
+
asChild: true,
|
|
636
|
+
children: /*#__PURE__*/ _jsx("ul", {
|
|
637
|
+
role: "status",
|
|
638
|
+
"aria-label": label,
|
|
648
639
|
children: [
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
3
|
|
680
|
-
].map((card)=>/*#__PURE__*/ _jsx(Skeleton, {
|
|
681
|
-
className: "h-136 w-full"
|
|
682
|
-
}, card))
|
|
640
|
+
0,
|
|
641
|
+
1,
|
|
642
|
+
2
|
|
643
|
+
].map((row)=>/*#__PURE__*/ _jsx(PanelRow, {
|
|
644
|
+
asChild: true,
|
|
645
|
+
className: "justify-start gap-cluster hover:bg-background-neutral-base",
|
|
646
|
+
children: /*#__PURE__*/ _jsxs("li", {
|
|
647
|
+
children: [
|
|
648
|
+
/*#__PURE__*/ _jsx(Skeleton, {
|
|
649
|
+
className: "size-32 shrink-0"
|
|
650
|
+
}),
|
|
651
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
652
|
+
className: "flex min-w-0 flex-1 flex-col gap-inline",
|
|
653
|
+
children: [
|
|
654
|
+
/*#__PURE__*/ _jsx(Skeleton, {
|
|
655
|
+
className: "h-16 w-120"
|
|
656
|
+
}),
|
|
657
|
+
/*#__PURE__*/ _jsx(Skeleton, {
|
|
658
|
+
className: "h-14 w-180"
|
|
659
|
+
})
|
|
660
|
+
]
|
|
661
|
+
}),
|
|
662
|
+
/*#__PURE__*/ _jsx(Skeleton, {
|
|
663
|
+
className: "h-28 w-96 shrink-0"
|
|
664
|
+
})
|
|
665
|
+
]
|
|
666
|
+
})
|
|
667
|
+
}, row))
|
|
668
|
+
})
|
|
669
|
+
})
|
|
683
670
|
});
|
|
684
671
|
}
|
|
685
672
|
|