@shipfox/client-agent 22.0.2 → 23.0.0
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/.storybook/preview.tsx +2 -2
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +28 -0
- package/dist/components/form-errors.d.ts.map +1 -1
- package/dist/components/form-errors.js +3 -0
- package/dist/components/form-errors.js.map +1 -1
- package/dist/components/harness-availability.d.ts +2 -2
- package/dist/components/harness-availability.d.ts.map +1 -1
- package/dist/components/harness-availability.js +4 -3
- package/dist/components/harness-availability.js.map +1 -1
- package/dist/components/harnesses-section.d.ts.map +1 -1
- package/dist/components/harnesses-section.js +4 -2
- package/dist/components/harnesses-section.js.map +1 -1
- package/dist/components/model-provider-usage-modal.d.ts.map +1 -1
- package/dist/components/model-provider-usage-modal.js +23 -5
- package/dist/components/model-provider-usage-modal.js.map +1 -1
- package/dist/components/model-provider-usage-target.d.ts +6 -6
- package/dist/components/model-provider-usage-target.d.ts.map +1 -1
- package/dist/components/model-provider-usage-target.js +3 -1
- package/dist/components/model-provider-usage-target.js.map +1 -1
- package/dist/components/model-providers-section.d.ts.map +1 -1
- package/dist/components/model-providers-section.js +277 -170
- package/dist/components/model-providers-section.js.map +1 -1
- package/dist/components/model-providers-section.stories.d.ts +2 -1
- package/dist/components/model-providers-section.stories.d.ts.map +1 -1
- package/dist/components/model-providers-section.stories.js +45 -1
- package/dist/components/model-providers-section.stories.js.map +1 -1
- package/dist/core/harness-policy.d.ts +5 -2
- package/dist/core/harness-policy.d.ts.map +1 -1
- package/dist/core/harness-policy.js +7 -1
- package/dist/core/harness-policy.js.map +1 -1
- package/dist/core/models.d.ts +3 -0
- package/dist/core/models.d.ts.map +1 -1
- package/dist/core/models.js.map +1 -1
- package/dist/core/provider-policy.d.ts +3 -1
- package/dist/core/provider-policy.d.ts.map +1 -1
- package/dist/core/provider-policy.js +7 -0
- package/dist/core/provider-policy.js.map +1 -1
- package/dist/hooks/api/model-provider-mapper.d.ts.map +1 -1
- package/dist/hooks/api/model-provider-mapper.js +5 -1
- package/dist/hooks/api/model-provider-mapper.js.map +1 -1
- package/dist/pages/model-provider-onboarding-page.d.ts +1 -1
- package/dist/pages/model-provider-onboarding-page.d.ts.map +1 -1
- package/dist/pages/model-provider-onboarding-page.js +58 -44
- package/dist/pages/model-provider-onboarding-page.js.map +1 -1
- package/dist/pages/model-provider-onboarding-page.stories.d.ts.map +1 -1
- package/dist/pages/model-provider-onboarding-page.stories.js +5 -17
- package/dist/pages/model-provider-onboarding-page.stories.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/components/form-errors.test.ts +9 -0
- package/src/components/form-errors.ts +3 -0
- package/src/components/harness-availability.test.ts +49 -2
- package/src/components/harness-availability.ts +18 -3
- package/src/components/harnesses-section.test.tsx +51 -9
- package/src/components/harnesses-section.tsx +4 -1
- package/src/components/model-provider-usage-modal.test.tsx +23 -0
- package/src/components/model-provider-usage-modal.tsx +32 -6
- package/src/components/model-provider-usage-target.ts +9 -3
- package/src/components/model-providers-section.stories.tsx +33 -1
- package/src/components/model-providers-section.test.tsx +41 -0
- package/src/components/model-providers-section.tsx +264 -155
- package/src/core/harness-policy.ts +21 -1
- package/src/core/models.ts +3 -0
- package/src/core/provider-policy.ts +12 -0
- package/src/hooks/api/model-provider-mapper.test.ts +18 -0
- package/src/hooks/api/model-provider-mapper.ts +6 -1
- package/src/hooks/api/model-providers.test.ts +11 -0
- package/src/pages/model-provider-onboarding-page.stories.tsx +10 -14
- package/src/pages/model-provider-onboarding-page.test.tsx +133 -24
- package/src/pages/model-provider-onboarding-page.tsx +47 -34
- package/test/fixtures/model-providers.ts +22 -1
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -10,10 +10,10 @@ import { Panel, PanelBody, PanelRow } from '@shipfox/react-ui/panel';
|
|
|
10
10
|
import { Skeleton } from '@shipfox/react-ui/skeleton';
|
|
11
11
|
import { toast } from '@shipfox/react-ui/toast';
|
|
12
12
|
import { Tooltip, TooltipContent, TooltipTrigger } from '@shipfox/react-ui/tooltip';
|
|
13
|
-
import { Header, Text } from '@shipfox/react-ui/typography';
|
|
13
|
+
import { Code, Header, Text } from '@shipfox/react-ui/typography';
|
|
14
14
|
import { useEffect, useMemo, useReducer, useRef, useState } from 'react';
|
|
15
15
|
import { managementModalReducer } from '#core/model-provider-management-reducer.js';
|
|
16
|
-
import { customProviderCardMatchesSearch, isSupportedProvider, availableProviders as selectAvailableProviders } from '#core/provider-policy.js';
|
|
16
|
+
import { customProviderCardMatchesSearch, isManagedOnlyCatalog, isSupportedProvider, managedProviderFromCatalog, 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
19
|
import { AvailableProvidersGrid } from './available-providers-grid.js';
|
|
@@ -25,6 +25,93 @@ import { ModelProviderUsageModal } from './model-provider-usage-modal.js';
|
|
|
25
25
|
import { usageTargetFromCatalogEntry, usageTargetFromCustomConfig } from './model-provider-usage-target.js';
|
|
26
26
|
import { ModelProviderTestAndSaveForm } from './test-and-save-form.js';
|
|
27
27
|
const USAGE_MODAL_OPEN_DELAY_MS = 250;
|
|
28
|
+
function ManagedProviderSection({ provider, onShowUsage }) {
|
|
29
|
+
return /*#__PURE__*/ _jsxs("section", {
|
|
30
|
+
className: "flex flex-col gap-group",
|
|
31
|
+
"aria-label": "Managed provider",
|
|
32
|
+
children: [
|
|
33
|
+
/*#__PURE__*/ _jsx("div", {
|
|
34
|
+
className: "flex flex-col gap-tight",
|
|
35
|
+
children: /*#__PURE__*/ _jsx(Header, {
|
|
36
|
+
variant: "h3",
|
|
37
|
+
children: "Managed provider"
|
|
38
|
+
})
|
|
39
|
+
}),
|
|
40
|
+
provider ? /*#__PURE__*/ _jsx(Panel, {
|
|
41
|
+
children: /*#__PURE__*/ _jsxs(PanelBody, {
|
|
42
|
+
className: "gap-group p-panel",
|
|
43
|
+
children: [
|
|
44
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
45
|
+
className: "flex min-w-0 flex-col gap-tight",
|
|
46
|
+
children: [
|
|
47
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
48
|
+
size: "md",
|
|
49
|
+
bold: true,
|
|
50
|
+
children: provider.label
|
|
51
|
+
}),
|
|
52
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
53
|
+
size: "sm",
|
|
54
|
+
className: "text-foreground-neutral-muted",
|
|
55
|
+
children: "Managed by this instance. No workspace credentials are required."
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
}),
|
|
59
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
60
|
+
className: "flex flex-col gap-inline",
|
|
61
|
+
children: [
|
|
62
|
+
/*#__PURE__*/ _jsxs(Text, {
|
|
63
|
+
size: "sm",
|
|
64
|
+
bold: true,
|
|
65
|
+
children: [
|
|
66
|
+
"Available models (",
|
|
67
|
+
provider.models.length,
|
|
68
|
+
")"
|
|
69
|
+
]
|
|
70
|
+
}),
|
|
71
|
+
/*#__PURE__*/ _jsx("ul", {
|
|
72
|
+
"aria-label": `${provider.label} models`,
|
|
73
|
+
className: "rounded-8 border border-border-neutral-base",
|
|
74
|
+
children: provider.models.map((model)=>/*#__PURE__*/ _jsxs("li", {
|
|
75
|
+
className: "flex min-w-0 items-center justify-between gap-inline border-b border-border-neutral-base px-row py-row last:border-b-0",
|
|
76
|
+
children: [
|
|
77
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
78
|
+
as: "span",
|
|
79
|
+
size: "sm",
|
|
80
|
+
bold: true,
|
|
81
|
+
className: "min-w-0 truncate",
|
|
82
|
+
children: model.label
|
|
83
|
+
}),
|
|
84
|
+
/*#__PURE__*/ _jsx(Code, {
|
|
85
|
+
as: "span",
|
|
86
|
+
variant: "label",
|
|
87
|
+
className: "min-w-0 truncate text-foreground-neutral-muted",
|
|
88
|
+
children: model.id
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
}, model.id))
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
}),
|
|
95
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
96
|
+
type: "button",
|
|
97
|
+
size: "sm",
|
|
98
|
+
variant: "secondary",
|
|
99
|
+
onClick: onShowUsage,
|
|
100
|
+
children: "Use in a workflow"
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
})
|
|
104
|
+
}) : /*#__PURE__*/ _jsx(Panel, {
|
|
105
|
+
children: /*#__PURE__*/ _jsx(EmptyState, {
|
|
106
|
+
icon: "errorWarningLine",
|
|
107
|
+
title: "Managed provider unavailable",
|
|
108
|
+
description: "This instance is configured without workspace providers, but no managed provider was returned.",
|
|
109
|
+
variant: "panel"
|
|
110
|
+
})
|
|
111
|
+
})
|
|
112
|
+
]
|
|
113
|
+
});
|
|
114
|
+
}
|
|
28
115
|
export function WorkspaceModelProvidersSection({ workspaceId }) {
|
|
29
116
|
const catalogQuery = useModelProviderCatalogQuery();
|
|
30
117
|
const configsQuery = useModelProviderConfigsQuery(workspaceId);
|
|
@@ -37,6 +124,8 @@ export function WorkspaceModelProvidersSection({ workspaceId }) {
|
|
|
37
124
|
const configs = configsQuery.data?.configs ?? [];
|
|
38
125
|
const configsLoaded = configsQuery.data !== undefined;
|
|
39
126
|
const defaultProviderId = configsQuery.data?.defaultProviderId ?? null;
|
|
127
|
+
const managedOnly = isManagedOnlyCatalog(catalogQuery.data);
|
|
128
|
+
const managedProvider = managedProviderFromCatalog(catalogQuery.data);
|
|
40
129
|
const providerById = useMemo(()=>new Map(providers.map((provider)=>[
|
|
41
130
|
provider.id,
|
|
42
131
|
provider
|
|
@@ -66,193 +155,211 @@ export function WorkspaceModelProvidersSection({ workspaceId }) {
|
|
|
66
155
|
const config = configs.find((item)=>item.providerId === modal.providerId);
|
|
67
156
|
if (config?.kind === 'custom') return usageTargetFromCustomConfig(config);
|
|
68
157
|
const entry = providerById.get(modal.providerId);
|
|
69
|
-
return entry && isSupportedProvider(entry) ? usageTargetFromCatalogEntry(entry
|
|
158
|
+
return entry && isSupportedProvider(entry) ? usageTargetFromCatalogEntry(entry, {
|
|
159
|
+
isManaged: managedOnly
|
|
160
|
+
}) : null;
|
|
70
161
|
}, [
|
|
71
162
|
configs,
|
|
163
|
+
managedOnly,
|
|
72
164
|
modal,
|
|
73
165
|
providerById
|
|
74
166
|
]);
|
|
75
167
|
return /*#__PURE__*/ _jsxs("div", {
|
|
76
168
|
className: "flex min-w-0 flex-col gap-region",
|
|
77
169
|
children: [
|
|
78
|
-
/*#__PURE__*/
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
170
|
+
managedOnly ? /*#__PURE__*/ _jsx(ManagedProviderSection, {
|
|
171
|
+
provider: managedProvider,
|
|
172
|
+
onShowUsage: ()=>{
|
|
173
|
+
if (!managedProvider) return;
|
|
174
|
+
dispatchModal({
|
|
175
|
+
type: 'show-usage',
|
|
176
|
+
providerId: managedProvider.id,
|
|
177
|
+
initialModel: managedProvider.defaultModel,
|
|
178
|
+
restoreFocusToConfiguredProviders: false
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}) : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
83
182
|
children: [
|
|
84
|
-
/*#__PURE__*/
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
children: /*#__PURE__*/ _jsx(QueryLoadError, {
|
|
96
|
-
query: configsQuery,
|
|
97
|
-
subject: "model provider configs",
|
|
98
|
-
variant: "panel"
|
|
99
|
-
})
|
|
100
|
-
}) : null,
|
|
101
|
-
configsQuery.data !== undefined && configs.length === 0 ? /*#__PURE__*/ _jsx(Panel, {
|
|
102
|
-
children: /*#__PURE__*/ _jsx(EmptyState, {
|
|
103
|
-
icon: "key2Line",
|
|
104
|
-
title: "No providers configured",
|
|
105
|
-
description: "Configure a provider below to run agent steps with workspace-managed credentials.",
|
|
106
|
-
variant: "panel"
|
|
107
|
-
})
|
|
108
|
-
}) : null,
|
|
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);
|
|
183
|
+
/*#__PURE__*/ _jsxs("section", {
|
|
184
|
+
ref: configuredProvidersRegionRef,
|
|
185
|
+
className: "flex flex-col gap-group outline-none",
|
|
186
|
+
"aria-label": "Configured providers",
|
|
187
|
+
tabIndex: -1,
|
|
188
|
+
children: [
|
|
189
|
+
/*#__PURE__*/ _jsx("div", {
|
|
190
|
+
className: "flex flex-col gap-tight",
|
|
191
|
+
children: /*#__PURE__*/ _jsx(Header, {
|
|
192
|
+
variant: "h3",
|
|
193
|
+
children: "Configured providers"
|
|
164
194
|
})
|
|
165
|
-
})
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
195
|
+
}),
|
|
196
|
+
configsQuery.isPending ? /*#__PURE__*/ _jsx(ModelProviderRowsSkeleton, {
|
|
197
|
+
label: "Loading configured providers"
|
|
198
|
+
}) : null,
|
|
199
|
+
configsQuery.isError && configsQuery.data === undefined ? /*#__PURE__*/ _jsx(Panel, {
|
|
200
|
+
children: /*#__PURE__*/ _jsx(QueryLoadError, {
|
|
201
|
+
query: configsQuery,
|
|
202
|
+
subject: "model provider configs",
|
|
203
|
+
variant: "panel"
|
|
204
|
+
})
|
|
205
|
+
}) : null,
|
|
206
|
+
configsQuery.data !== undefined && configs.length === 0 ? /*#__PURE__*/ _jsx(Panel, {
|
|
207
|
+
children: /*#__PURE__*/ _jsx(EmptyState, {
|
|
208
|
+
icon: "key2Line",
|
|
209
|
+
title: "No providers configured",
|
|
210
|
+
description: "Configure a provider below to run agent steps with workspace-managed credentials.",
|
|
211
|
+
variant: "panel"
|
|
212
|
+
})
|
|
213
|
+
}) : null,
|
|
214
|
+
configs.length > 0 ? /*#__PURE__*/ _jsx(Panel, {
|
|
215
|
+
children: /*#__PURE__*/ _jsx(PanelBody, {
|
|
216
|
+
asChild: true,
|
|
217
|
+
children: /*#__PURE__*/ _jsx("ul", {
|
|
218
|
+
children: configs.map((config)=>{
|
|
219
|
+
const catalogEntry = providerById.get(config.providerId);
|
|
220
|
+
const entry = catalogEntry && isSupportedProvider(catalogEntry) ? catalogEntry : undefined;
|
|
221
|
+
const builtinConfig = isBuiltinModelProviderConfig(config) ? config : undefined;
|
|
222
|
+
const customConfig = isCustomModelProviderConfig(config) ? config : undefined;
|
|
223
|
+
return /*#__PURE__*/ _jsx(ConfiguredProviderRow, {
|
|
224
|
+
workspaceId: workspaceId,
|
|
225
|
+
config: config,
|
|
226
|
+
entry: entry,
|
|
227
|
+
isDefault: config.providerId === defaultProviderId,
|
|
228
|
+
onEdit: ()=>{
|
|
229
|
+
if (entry && builtinConfig) {
|
|
230
|
+
dispatchModal({
|
|
231
|
+
type: 'edit-builtin',
|
|
232
|
+
provider: entry,
|
|
233
|
+
config: builtinConfig
|
|
234
|
+
});
|
|
235
|
+
} else if (customConfig) {
|
|
236
|
+
dispatchModal({
|
|
237
|
+
type: 'edit-custom',
|
|
238
|
+
config: customConfig
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
onChangeDefaultModel: ()=>{
|
|
243
|
+
if (entry && builtinConfig) dispatchModal({
|
|
244
|
+
type: 'change-default-model',
|
|
245
|
+
provider: entry,
|
|
246
|
+
config: builtinConfig
|
|
247
|
+
});
|
|
248
|
+
},
|
|
249
|
+
onShowUsage: ()=>{
|
|
250
|
+
if (entry && builtinConfig) {
|
|
251
|
+
setPendingUsageTarget(null);
|
|
252
|
+
dispatchModal({
|
|
253
|
+
type: 'show-usage',
|
|
254
|
+
providerId: entry.id,
|
|
255
|
+
initialModel: builtinConfig.defaultModel,
|
|
256
|
+
restoreFocusToConfiguredProviders: false
|
|
257
|
+
});
|
|
258
|
+
} else if (customConfig) {
|
|
259
|
+
setPendingUsageTarget(null);
|
|
260
|
+
dispatchModal({
|
|
261
|
+
type: 'show-usage',
|
|
262
|
+
providerId: customConfig.providerId,
|
|
263
|
+
initialModel: customConfig.defaultModel,
|
|
264
|
+
restoreFocusToConfiguredProviders: false
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}, config.providerId);
|
|
269
|
+
})
|
|
270
|
+
})
|
|
271
|
+
})
|
|
272
|
+
}) : null
|
|
273
|
+
]
|
|
180
274
|
}),
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
configsLoaded ? /*#__PURE__*/ _jsx(AvailableProvidersGrid, {
|
|
192
|
-
entries: availableProviders,
|
|
193
|
-
onSelect: (entry)=>dispatchModal({
|
|
194
|
-
type: 'configure-builtin',
|
|
195
|
-
provider: entry
|
|
275
|
+
/*#__PURE__*/ _jsxs("section", {
|
|
276
|
+
className: "flex flex-col gap-group",
|
|
277
|
+
"aria-label": "Available providers",
|
|
278
|
+
children: [
|
|
279
|
+
/*#__PURE__*/ _jsx("div", {
|
|
280
|
+
className: "flex flex-col gap-tight",
|
|
281
|
+
children: /*#__PURE__*/ _jsx(Header, {
|
|
282
|
+
variant: "h3",
|
|
283
|
+
children: "Available providers"
|
|
284
|
+
})
|
|
196
285
|
}),
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
286
|
+
catalogQuery.isPending || configsQuery.isPending ? /*#__PURE__*/ _jsx(ModelProviderGridSkeleton, {
|
|
287
|
+
label: "Loading available providers"
|
|
288
|
+
}) : null,
|
|
289
|
+
catalogQuery.isError && catalogQuery.data === undefined ? /*#__PURE__*/ _jsx(Panel, {
|
|
290
|
+
children: /*#__PURE__*/ _jsx(QueryLoadError, {
|
|
291
|
+
query: catalogQuery,
|
|
292
|
+
subject: "model provider catalog",
|
|
293
|
+
variant: "panel"
|
|
200
294
|
})
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
295
|
+
}) : null,
|
|
296
|
+
configsLoaded ? /*#__PURE__*/ _jsx(AvailableProvidersGrid, {
|
|
297
|
+
entries: availableProviders,
|
|
298
|
+
onSelect: (entry)=>dispatchModal({
|
|
299
|
+
type: 'configure-builtin',
|
|
300
|
+
provider: entry
|
|
301
|
+
}),
|
|
302
|
+
trailingCard: /*#__PURE__*/ _jsx(AddCustomProviderCard, {
|
|
303
|
+
onConfigure: ()=>dispatchModal({
|
|
304
|
+
type: 'create-custom'
|
|
305
|
+
})
|
|
306
|
+
}),
|
|
307
|
+
trailingCardMatchesSearch: customProviderCardMatchesSearch
|
|
308
|
+
}) : null
|
|
309
|
+
]
|
|
216
310
|
}),
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
311
|
+
/*#__PURE__*/ _jsxs("section", {
|
|
312
|
+
className: "flex flex-col gap-group",
|
|
313
|
+
"aria-label": "Unsupported providers",
|
|
314
|
+
children: [
|
|
315
|
+
/*#__PURE__*/ _jsx("div", {
|
|
316
|
+
className: "flex flex-col gap-tight",
|
|
317
|
+
children: /*#__PURE__*/ _jsx(Header, {
|
|
318
|
+
variant: "h3",
|
|
319
|
+
children: "Unsupported providers"
|
|
320
|
+
})
|
|
321
|
+
}),
|
|
322
|
+
catalogQuery.isPending ? /*#__PURE__*/ _jsx(ModelProviderRowsSkeleton, {
|
|
323
|
+
label: "Loading unsupported providers"
|
|
324
|
+
}) : null,
|
|
325
|
+
unsupportedProviders.length > 0 ? /*#__PURE__*/ _jsx(Panel, {
|
|
326
|
+
children: /*#__PURE__*/ _jsx(PanelBody, {
|
|
327
|
+
asChild: true,
|
|
328
|
+
children: /*#__PURE__*/ _jsx("ul", {
|
|
329
|
+
children: unsupportedProviders.map((entry)=>/*#__PURE__*/ _jsx(PanelRow, {
|
|
330
|
+
asChild: true,
|
|
331
|
+
className: "items-start justify-start gap-cluster opacity-70 hover:bg-background-neutral-base",
|
|
332
|
+
children: /*#__PURE__*/ _jsxs("li", {
|
|
236
333
|
children: [
|
|
237
|
-
/*#__PURE__*/ _jsx(
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
children: entry.label
|
|
334
|
+
/*#__PURE__*/ _jsx(Icon, {
|
|
335
|
+
name: "forbid2Line",
|
|
336
|
+
className: "mt-[2px] size-18 shrink-0 text-foreground-neutral-muted",
|
|
337
|
+
"aria-hidden": true
|
|
242
338
|
}),
|
|
243
|
-
/*#__PURE__*/
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
339
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
340
|
+
className: "flex min-w-0 flex-1 flex-col gap-tight",
|
|
341
|
+
children: [
|
|
342
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
343
|
+
size: "md",
|
|
344
|
+
bold: true,
|
|
345
|
+
className: "truncate",
|
|
346
|
+
children: entry.label
|
|
347
|
+
}),
|
|
348
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
349
|
+
size: "sm",
|
|
350
|
+
className: "text-foreground-neutral-muted",
|
|
351
|
+
children: entry.unsupportedReason
|
|
352
|
+
})
|
|
353
|
+
]
|
|
247
354
|
})
|
|
248
355
|
]
|
|
249
356
|
})
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
})
|
|
254
|
-
|
|
255
|
-
})
|
|
357
|
+
}, entry.id))
|
|
358
|
+
})
|
|
359
|
+
})
|
|
360
|
+
}) : null
|
|
361
|
+
]
|
|
362
|
+
})
|
|
256
363
|
]
|
|
257
364
|
}),
|
|
258
365
|
/*#__PURE__*/ _jsx(Modal, {
|