@undefineds.co/xpod 0.4.32 → 0.4.34

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.
Files changed (108) hide show
  1. package/dist/api/auth/SolidTokenAuthenticator.d.ts +4 -1
  2. package/dist/api/auth/SolidTokenAuthenticator.js +43 -25
  3. package/dist/api/container/common.js +1 -0
  4. package/dist/api/container/index.js +1 -0
  5. package/dist/api/container/types.d.ts +2 -0
  6. package/dist/http/SubgraphSparqlHttpHandler.d.ts +32 -0
  7. package/dist/http/SubgraphSparqlHttpHandler.js +448 -1
  8. package/dist/http/SubgraphSparqlHttpHandler.jsonld +36 -0
  9. package/dist/storage/rdf/QleverSparqlEngine.d.ts +15 -0
  10. package/dist/storage/rdf/QleverSparqlEngine.js +40 -0
  11. package/dist/storage/rdf/QleverSparqlEngine.jsonld +8 -0
  12. package/dist/storage/rdf/RdfAccessScope.d.ts +12 -0
  13. package/dist/storage/rdf/RdfAccessScope.js +63 -3
  14. package/dist/storage/rdf/RdfQuerySparqlEngine.d.ts +7 -0
  15. package/dist/storage/rdf/RdfQuerySparqlEngine.js +30 -0
  16. package/dist/storage/rdf/RdfQuerySparqlEngine.jsonld +8 -0
  17. package/dist/storage/rdf/index.d.ts +1 -1
  18. package/dist/storage/rdf/index.js +6 -2
  19. package/dist/storage/sparql/SubgraphQueryEngine.d.ts +5 -0
  20. package/dist/storage/sparql/SubgraphQueryEngine.js +9 -0
  21. package/dist/storage/sparql/SubgraphQueryEngine.jsonld +16 -0
  22. package/node_modules/@undefineds.co/ai-connections/dist/AiBuiltinProvidersSection.d.ts +32 -0
  23. package/node_modules/@undefineds.co/ai-connections/dist/AiBuiltinProvidersSection.js +8 -0
  24. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.js +35 -1
  25. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.d.ts +9 -1
  26. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.js +32 -6
  27. package/node_modules/@undefineds.co/ai-connections/dist/index.d.ts +1 -0
  28. package/node_modules/@undefineds.co/ai-connections/dist/index.js +1 -0
  29. package/node_modules/@undefineds.co/ai-connections/package.json +2 -2
  30. package/node_modules/@undefineds.co/ai-connections-runtime/dist/contract/ai-connections-client.d.ts +1 -1
  31. package/node_modules/@undefineds.co/ai-connections-runtime/dist/contract/client/normalize.d.ts +16 -1
  32. package/node_modules/@undefineds.co/ai-connections-runtime/dist/contract/client/normalize.js +80 -2
  33. package/node_modules/@undefineds.co/ai-connections-runtime/dist/contract/client/request.js +19 -1
  34. package/node_modules/@undefineds.co/ai-connections-runtime/dist/contract/client/types.d.ts +31 -0
  35. package/node_modules/@undefineds.co/ai-connections-runtime/dist/materials/build-provenance.json +4 -4
  36. package/node_modules/@undefineds.co/ai-connections-runtime/dist/materials/index.json +15 -15
  37. package/node_modules/@undefineds.co/ai-connections-runtime/dist/materials/javascript/provider-catalog/index.json +2 -2
  38. package/node_modules/@undefineds.co/ai-connections-runtime/dist/materials/javascript/service-access-resources/index.json +2 -2
  39. package/node_modules/@undefineds.co/ai-connections-runtime/dist/materials/source/package.json +1 -1
  40. package/node_modules/@undefineds.co/ai-connections-runtime/dist/materials/source-inventory.json +11 -11
  41. package/node_modules/@undefineds.co/ai-connections-runtime/dist/provider-catalog-inputs.json +1 -1
  42. package/node_modules/@undefineds.co/ai-connections-runtime/dist/service-access-resources-inputs.json +1 -1
  43. package/node_modules/@undefineds.co/ai-connections-runtime/package.json +1 -1
  44. package/node_modules/@undefineds.co/extension-host-contracts/dist/materials/build-provenance.json +1 -1
  45. package/node_modules/@undefineds.co/extension-host-contracts/dist/materials/index.json +3 -3
  46. package/node_modules/@undefineds.co/extension-host-contracts/dist/materials/source-inventory.json +1 -1
  47. package/node_modules/@undefineds.co/xpod-afs/dist/licenses/cli-producer-original-binding.json +1 -1
  48. package/node_modules/@undefineds.co/xpod-cli/dist/producer-materials/index.json +1 -1
  49. package/package.json +4 -4
  50. package/static/dashboard/assets/{AccountAuthBoundary-D2peXpst.js → AccountAuthBoundary-DXBGmvsI.js} +1 -1
  51. package/static/dashboard/assets/{DesktopOidcCallback-DXWArav6.js → DesktopOidcCallback-p24MYq1P.js} +1 -1
  52. package/static/dashboard/assets/{DevicePages-BULFk95K.js → DevicePages-DbvhTnse.js} +1 -1
  53. package/static/dashboard/assets/ModelsPage-UMDnRyLA.js +12 -0
  54. package/static/dashboard/assets/{PaneListHeader-BSfEbecP.js → PaneListHeader-DkEH0TT_.js} +1 -1
  55. package/static/dashboard/assets/{PodDeletionAuthorizationPanel-CH-Sx18g.js → PodDeletionAuthorizationPanel-CzrI8Pgw.js} +3 -3
  56. package/static/dashboard/assets/{PodPage-BMpejIra.js → PodPage-TaiWqMBx.js} +1 -1
  57. package/static/dashboard/assets/{SystemSettingsPage-H_Jj6WfF.js → SystemSettingsPage-D4gQjDt1.js} +1 -1
  58. package/static/dashboard/assets/{TasksPage-CTDxlQra.js → TasksPage-CmkiMYil.js} +1 -1
  59. package/static/dashboard/assets/{WebDesktopEntry-Ch7-0C9a.js → WebDesktopEntry-D9kEfhbz.js} +1 -1
  60. package/static/dashboard/assets/{XpodAiConnectionsPodStore-ggRE9fmE.js → XpodAiConnectionsPodStore-orY8vQFl.js} +2 -2
  61. package/static/dashboard/assets/{XpodShellApp-Bwf9UmeJ.js → XpodShellApp-DR65DMOb.js} +4 -4
  62. package/static/dashboard/assets/{account-session-CVzooxS2.js → account-session-BZ2ttIdq.js} +1 -1
  63. package/static/dashboard/assets/{button-DGh2QVt2.js → button-_rwfCMMH.js} +1 -1
  64. package/static/dashboard/assets/{collection-runtime-DwV_9rt2.js → collection-runtime-C74icLtf.js} +1 -1
  65. package/static/dashboard/assets/{createLucideIcon-yLhAxnfL.js → createLucideIcon-DrgScGhc.js} +1 -1
  66. package/static/dashboard/assets/{dashboard-xbXlitKr.js → dashboard--DWjqkYt.js} +2 -2
  67. package/static/dashboard/assets/{index-CMigfjqD.js → index-D6dB-UNq.js} +1 -1
  68. package/static/dashboard/assets/{index-BSiKqEdo.js → index-dx5sc4rE.js} +1 -1
  69. package/static/dashboard/assets/{label-CrDv_y1q.js → label-D02Jpvm9.js} +1 -1
  70. package/static/dashboard/assets/{list-BJM0nqti.js → list-DpFAisnq.js} +1 -1
  71. package/static/dashboard/assets/{nav-item-style-CQbGyYLb.js → nav-item-style-B1-0JkON.js} +1 -1
  72. package/static/dashboard/assets/{safe-continuation-ZTBQTFWB.js → safe-continuation-DUTIOFe5.js} +1 -1
  73. package/static/dashboard/assets/{section-header-CWHRWGXl.js → section-header-CtBnllbG.js} +1 -1
  74. package/static/dashboard/assets/{setting-row-qWtxYGK1.js → setting-row-D_JPuHAJ.js} +1 -1
  75. package/static/dashboard/assets/{xpod-remembered-login-DPMxurVN.js → xpod-remembered-login-CtmMI8xG.js} +3 -3
  76. package/static/dashboard/dashboard.html +1 -1
  77. package/static/settings/assets/{AccountAuthBoundary-4Ywjpb8o.js → AccountAuthBoundary-njIhHpLf.js} +1 -1
  78. package/static/settings/assets/{DesktopOidcCallback-CAmwMT_J.js → DesktopOidcCallback-BjjNwTxc.js} +1 -1
  79. package/static/settings/assets/{DevicePages-DvuHyfHo.js → DevicePages-FFJMu_zL.js} +1 -1
  80. package/static/settings/assets/ModelsPage-6567dZKQ.js +12 -0
  81. package/static/settings/assets/{PaneListHeader-CuFgIbhe.js → PaneListHeader-CuPah5aC.js} +1 -1
  82. package/static/settings/assets/{PodDeletionAuthorizationPanel-DdNgDHH5.js → PodDeletionAuthorizationPanel-aJCKasGz.js} +3 -3
  83. package/static/settings/assets/{PodPage-DnWCNGTO.js → PodPage-BA0DQ3AB.js} +1 -1
  84. package/static/settings/assets/{SystemSettingsPage-k9P_wQcl.js → SystemSettingsPage-BNPH4VWf.js} +1 -1
  85. package/static/settings/assets/{TasksPage-Dk7gUH3J.js → TasksPage-B5m82wjD.js} +1 -1
  86. package/static/settings/assets/{WebDesktopEntry-DJwPVVnU.js → WebDesktopEntry-DgwwIUhg.js} +1 -1
  87. package/static/settings/assets/{XpodAiConnectionsPodStore-BtJQiJsx.js → XpodAiConnectionsPodStore-BJm-rFPs.js} +2 -2
  88. package/static/settings/assets/{XpodShellApp-B47vEQJp.js → XpodShellApp-BwvekJJR.js} +4 -4
  89. package/static/settings/assets/{XpodThemeProvider-Ciuwo_yl.js → XpodThemeProvider-DyX0rUID.js} +2 -2
  90. package/static/settings/assets/{account-session-CMc10iEj.js → account-session-D6vibAra.js} +1 -1
  91. package/static/settings/assets/auth-callback-DXxmF0-p.js +1 -0
  92. package/static/settings/assets/{button-D1dGKY1f.js → button-CV4KJ59A.js} +1 -1
  93. package/static/settings/assets/{collection-runtime-hK37-47o.js → collection-runtime-CARp4Cii.js} +1 -1
  94. package/static/settings/assets/{createLucideIcon-nEiQH43b.js → createLucideIcon-BIwq0vQx.js} +1 -1
  95. package/static/settings/assets/{index-DNdvma6J.js → index-D-LgcKAb.js} +1 -1
  96. package/static/settings/assets/{label-C3EGk_2E.js → label-CFTl2bC_.js} +1 -1
  97. package/static/settings/assets/{list-BensBGZp.js → list-D2aO7Nu-.js} +1 -1
  98. package/static/settings/assets/{nav-item-style-BOKCPNz8.js → nav-item-style-BKpK5_1m.js} +1 -1
  99. package/static/settings/assets/{safe-continuation-BPwW6jdq.js → safe-continuation-DRRY_t4F.js} +1 -1
  100. package/static/settings/assets/{section-header-DOSj5RvJ.js → section-header-COECjyL5.js} +1 -1
  101. package/static/settings/assets/{setting-row-C9k4cGNM.js → setting-row-cGgL78vR.js} +1 -1
  102. package/static/settings/assets/{settings-DtP5C8hi.js → settings-Bvrm5N-k.js} +1 -1
  103. package/static/settings/assets/{xpod-remembered-login-DKFG-zi3.js → xpod-remembered-login-YAmn8ZiP.js} +3 -3
  104. package/static/settings/auth-callback.html +2 -2
  105. package/static/settings/settings.html +2 -2
  106. package/static/dashboard/assets/ModelsPage-xvsVzhGZ.js +0 -12
  107. package/static/settings/assets/ModelsPage-BDXqetwk.js +0 -12
  108. package/static/settings/assets/auth-callback-fcOBaX2w.js +0 -1
@@ -11,6 +11,7 @@ import { xpodProtocolEndpoints } from './gateway-endpoints.js';
11
11
  import { XPOD_AVATAR } from './provider-visuals.js';
12
12
  import { AiGatewayKeyRow } from './AiGatewayKeyRow.js';
13
13
  import { AiGatewayModelsSection } from './AiGatewayModelsSection.js';
14
+ import { AiBuiltinProvidersSection } from './AiBuiltinProvidersSection.js';
14
15
  const DEFAULT_KEY_NAME = '我的 Xpod 密钥';
15
16
  const CREATED_NOTIFICATION = 'Xpod 密钥 已创建,请复制或应用到客户端。';
16
17
  const UNPERSISTED_COPY_MESSAGE = '这个 Xpod 密钥 只在创建时可见:请销毁它,然后重新创建并立即复制或应用。';
@@ -25,8 +26,19 @@ const XPOD_CREDENTIAL_NOTE = '密钥允许客户端以你的 WebID 访问整个
25
26
  * over `AiModelCatalog`), and the same endpoint list (`AiEndpointList`) that the
26
27
  * provider pages use for their offerings' protocols.
27
28
  */
28
- export function AiGatewayKeysSection({ client, onAuthorizeService, clientConfigurationBridge, gatewayModels, modelSelection, liveRevision = 0, }) {
29
+ export function AiGatewayKeysSection({ client, onAuthorizeService, clientConfigurationBridge, gatewayModels, modelSelection, liveRevision = 0, builtinDirectory, }) {
29
30
  const bridge = clientConfigurationBridge?.available === false ? undefined : clientConfigurationBridge;
31
+ /**
32
+ * Whether this client can manage keys at all.
33
+ *
34
+ * A client built without the Account client-credentials capability declares
35
+ * `gatewayKeyManagement: false`; every key call it exposes throws
36
+ * `account_client_credentials_unavailable`. That is a declared absence of the
37
+ * surface, so the page says so instead of issuing a request it knows fails.
38
+ * `undefined` is a client that predates the declaration and is still probed,
39
+ * so an older host keeps its real behaviour.
40
+ */
41
+ const keyManagementUnsupported = client.gatewayKeyManagement === false;
30
42
  const [busyKeyId, setBusyKeyId] = useState();
31
43
  const operation = useRef(false);
32
44
  const verificationGeneration = useRef(0);
@@ -122,6 +134,18 @@ export function AiGatewayKeysSection({ client, onAuthorizeService, clientConfigu
122
134
  // The wrapper cache belongs to the session that created the keys; a new
123
135
  // client means a new session and no copy may survive it.
124
136
  plaintexts.current.clear();
137
+ // A declared-absent capability is not a failure to report: the page renders
138
+ // its own statement and there is no list to read.
139
+ if (keyManagementUnsupported) {
140
+ setKeys([]);
141
+ setLoadError(undefined);
142
+ setLoading(false);
143
+ return () => {
144
+ active = false;
145
+ if (notification.current)
146
+ dismissToast(notification.current);
147
+ };
148
+ }
125
149
  void client.listGatewayKeys()
126
150
  .then((records) => {
127
151
  if (active)
@@ -140,7 +164,7 @@ export function AiGatewayKeysSection({ client, onAuthorizeService, clientConfigu
140
164
  if (notification.current)
141
165
  dismissToast(notification.current);
142
166
  };
143
- }, [client, notifyError, adoptRecords]);
167
+ }, [client, notifyError, adoptRecords, keyManagementUnsupported]);
144
168
  // The keys themselves are Account-owned and load without any Pod permission,
145
169
  // but a key is only usable while Xpod may read the Pod, so the page still
146
170
  // says so instead of letting an unusable list look healthy.
@@ -160,7 +184,7 @@ export function AiGatewayKeysSection({ client, onAuthorizeService, clientConfigu
160
184
  // A change made elsewhere only needs new rows: it must not drop the wrapper
161
185
  // copies this session is still showing, nor flash the loading state.
162
186
  useEffect(() => {
163
- if (liveRevision === 0)
187
+ if (liveRevision === 0 || keyManagementUnsupported)
164
188
  return;
165
189
  let active = true;
166
190
  void client.listGatewayKeys()
@@ -172,7 +196,7 @@ export function AiGatewayKeysSection({ client, onAuthorizeService, clientConfigu
172
196
  return () => {
173
197
  active = false;
174
198
  };
175
- }, [client, liveRevision, adoptRecords]);
199
+ }, [client, liveRevision, adoptRecords, keyManagementUnsupported]);
176
200
  const authorize = async () => {
177
201
  if (!onAuthorizeService || authorizing)
178
202
  return;
@@ -375,7 +399,7 @@ export function AiGatewayKeysSection({ client, onAuthorizeService, clientConfigu
375
399
  }
376
400
  };
377
401
  return (_jsx(TooltipProvider, { children: _jsx(Dialog, { open: showCreate, onOpenChange: (open) => { if (!open && (creating || applying))
378
- return; setShowCreate(open); }, children: _jsxs("section", { className: "space-y-8", "aria-label": "Xpod \u5BC6\u94A5", children: [_jsx(AiProviderHeader, { name: "Xpod", mark: "XP", avatar: XPOD_AVATAR, infoLabel: "Xpod \u8BF4\u660E", infoLines: [XPOD_DESCRIPTION, XPOD_CREDENTIAL_NOTE], link: { href: client.apiBase, label: '访问 Xpod' }, badge: (_jsx(Badge, { variant: keys.length > 0 ? 'default' : 'secondary', children: keys.length > 0 ? `已签发 ${keys.length} 个` : '未配置' })) }), _jsxs("section", { className: "space-y-3", "aria-label": "\u5F53\u524D\u8FDE\u63A5", children: [_jsx(SectionHeader, { level: 3, title: _jsxs(_Fragment, { children: [_jsx(Settings2, { "aria-hidden": "true", className: "h-4 w-4 text-primary" }), "\u5F53\u524D\u8FDE\u63A5"] }), titleClassName: "flex items-center gap-2 font-medium text-foreground/90", actions: (_jsx(DialogTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", size: "sm", className: "h-8 gap-1.5 text-xs", "aria-label": "\u65B0\u5EFA Xpod \u5BC6\u94A5", disabled: creating || loading, onClick: openCreate, children: [_jsx(Plus, { "aria-hidden": "true", className: "h-3.5 w-3.5" }), "Xpod \u5BC6\u94A5"] }) })) }), loadError || serviceAccessMissing ? _jsx(InlineNotice, { tone: "destructive", role: "alert", action: serviceAccessMissing && onAuthorizeService ? _jsx(Button, { size: "sm", disabled: authorizing, onClick: () => void authorize(), children: authorizing ? '正在授权…' : '允许 Xpod 访问' }) : undefined, children: loadError ?? 'Xpod 尚未获准访问这个 Pod' }) : null, loading ? (_jsxs("div", { className: "flex items-center gap-2 py-6 text-sm text-muted-foreground", children: [_jsx(Loader2, { "aria-hidden": "true", className: "h-4 w-4 animate-spin" }), "\u6B63\u5728\u8BFB\u53D6 Xpod \u5BC6\u94A5"] })) : loadError ? null : keys.length === 0 ? (_jsx("p", { className: "py-2 text-xs text-muted-foreground", children: "\u5C1A\u672A\u7B7E\u53D1 Xpod \u5BC6\u94A5" })) : (_jsx(ListSurface, { asChild: true, className: "divide-y-0 border-border/70 bg-transparent", children: _jsx("ul", { "aria-label": "Xpod \u5BC6\u94A5 \u5217\u8868", children: keys.map((record) => (_jsx(AiGatewayKeyRow, { record: record, busy: Boolean(busyKeyId), confirming: confirmingKeyId === record.id, configurationStatus: record.appliedTo && AI_CONNECTIONS_CLIENTS.includes(record.appliedTo)
402
+ return; setShowCreate(open); }, children: _jsxs("section", { className: "space-y-8", "aria-label": "Xpod \u5BC6\u94A5", children: [_jsx(AiProviderHeader, { name: "Xpod", mark: "XP", avatar: XPOD_AVATAR, infoLabel: "Xpod \u8BF4\u660E", infoLines: [XPOD_DESCRIPTION, XPOD_CREDENTIAL_NOTE], link: { href: client.apiBase, label: '访问 Xpod' }, badge: (_jsx(Badge, { variant: keys.length > 0 ? 'default' : 'secondary', children: keys.length > 0 ? `已签发 ${keys.length} 个` : '未配置' })) }), _jsxs("section", { className: "space-y-3", "aria-label": "\u5F53\u524D\u8FDE\u63A5", children: [_jsx(SectionHeader, { level: 3, title: _jsxs(_Fragment, { children: [_jsx(Settings2, { "aria-hidden": "true", className: "h-4 w-4 text-primary" }), "\u5F53\u524D\u8FDE\u63A5"] }), titleClassName: "flex items-center gap-2 font-medium text-foreground/90", actions: keyManagementUnsupported ? undefined : (_jsx(DialogTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", size: "sm", className: "h-8 gap-1.5 text-xs", "aria-label": "\u65B0\u5EFA Xpod \u5BC6\u94A5", disabled: creating || loading, onClick: openCreate, children: [_jsx(Plus, { "aria-hidden": "true", className: "h-3.5 w-3.5" }), "Xpod \u5BC6\u94A5"] }) })) }), keyManagementUnsupported ? (_jsx(InlineNotice, { tone: "info", children: "\u5F53\u524D\u5BA2\u6237\u7AEF\u6CA1\u6709 Account \u5BA2\u6237\u7AEF\u51ED\u636E\u80FD\u529B\uFF0C\u56E0\u6B64\u8FD9\u91CC\u4E0D\u63D0\u4F9B Xpod \u5BC6\u94A5\u7BA1\u7406\u3002\u5DF2\u53D1\u5E03\u7684\u6A21\u578B\u4ECD\u7136\u53EF\u7528\u3002" })) : null, loadError || serviceAccessMissing ? _jsx(InlineNotice, { tone: "destructive", role: "alert", action: serviceAccessMissing && onAuthorizeService ? _jsx(Button, { size: "sm", disabled: authorizing, onClick: () => void authorize(), children: authorizing ? '正在授权…' : '允许 Xpod 访问' }) : undefined, children: loadError ?? 'Xpod 尚未获准访问这个 Pod' }) : null, keyManagementUnsupported ? null : loading ? (_jsxs("div", { className: "flex items-center gap-2 py-6 text-sm text-muted-foreground", children: [_jsx(Loader2, { "aria-hidden": "true", className: "h-4 w-4 animate-spin" }), "\u6B63\u5728\u8BFB\u53D6 Xpod \u5BC6\u94A5"] })) : loadError ? null : keys.length === 0 ? (_jsx("p", { className: "py-2 text-xs text-muted-foreground", children: "\u5C1A\u672A\u7B7E\u53D1 Xpod \u5BC6\u94A5" })) : (_jsx(ListSurface, { asChild: true, className: "divide-y-0 border-border/70 bg-transparent", children: _jsx("ul", { "aria-label": "Xpod \u5BC6\u94A5 \u5217\u8868", children: keys.map((record) => (_jsx(AiGatewayKeyRow, { record: record, busy: Boolean(busyKeyId), confirming: confirmingKeyId === record.id, configurationStatus: record.appliedTo && AI_CONNECTIONS_CLIENTS.includes(record.appliedTo)
379
403
  ? clientStatuses[record.appliedTo] : undefined, onTest: verificationPlan(record) ? () => void testConfiguration(record) : undefined, testing: testingKeyId === record.id, onReissue: () => {
380
404
  beginAnother();
381
405
  setName(record.name ?? DEFAULT_KEY_NAME);
@@ -384,7 +408,9 @@ export function AiGatewayKeysSection({ client, onAuthorizeService, clientConfigu
384
408
  }, onRequestDestroy: () => setConfirmingKeyId(record.id), onCancelDestroy: () => setConfirmingKeyId((current) => (current === record.id ? undefined : current)), onDestroy: () => {
385
409
  setConfirmingKeyId(undefined);
386
410
  void destroy(record);
387
- } }, record.id))) }) }))] }), _jsx(AiGatewayModelsSection, { models: gatewayModels, selection: modelSelection }), _jsxs(DialogContent, { className: "sm:max-w-md", "aria-describedby": undefined, children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: issued ? 'Xpod 密钥 已签发' : '新建 Xpod 密钥' }) }), issued ? (_jsxs("div", { className: "space-y-5", children: [_jsxs("div", { className: "space-y-1.5", children: [_jsxs("p", { className: "text-sm", children: ["\u5DF2\u7B7E\u53D1\u300C", issued.name || '未命名 Xpod 密钥', "\u300D\uFF0C\u7528\u9014\uFF1A", issuedClient ? AI_CLIENT_LABELS[issuedClient] : '只复制', "\u3002"] }), _jsx("p", { className: "text-xs text-muted-foreground", children: "\u5BC6\u94A5\u53EA\u663E\u793A\u8FD9\u4E00\u6B21\uFF0C\u8BF7\u7ACB\u5373\u590D\u5236\u3002\u8303\u56F4\uFF1A\u6574\u4E2A Pod\u3002" })] }), issued.maskedHint ? (_jsx("code", { className: "block truncate rounded-md border border-border/60 bg-muted/30 px-3 py-2 font-mono text-xs text-muted-foreground", children: issued.maskedHint })) : null, _jsx(AiEndpointList, { endpoints: xpodProtocolEndpoints(client.apiBase), copy: true, display: "protocol" }), !bridge ? (_jsx("p", { className: "text-xs text-muted-foreground", children: "\u5F53\u524D Web \u73AF\u5883\u65E0\u6CD5\u81EA\u52A8\u5199\u5165\u5BA2\u6237\u7AEF\u914D\u7F6E\uFF0C\u8BF7\u590D\u5236\u540E\u624B\u52A8\u7C98\u8D34\uFF1B\u81EA\u52A8\u5E94\u7528\u9700\u8981\u672C\u673A\u8FDE\u63A5\u3002" })) : null, error ? _jsx("p", { role: "alert", className: "text-sm text-destructive", children: error }) : null, _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(AiCopyButton, { value: () => sessionPlaintext(issued, UNPERSISTED_COPY_MESSAGE), label: "Xpod \u5BC6\u94A5", text: "\u590D\u5236 Xpod \u5BC6\u94A5", disabled: applying, iconClassName: "mr-1.5 h-3.5 w-3.5", copiedIconClassName: "mr-1.5 h-3.5 w-3.5 text-emerald-600", onError: (cause) => setError(errorMessage(cause)) }), issuedClient ? _jsx(AiCopyButton, { value: () => manualConfigurationText(issuedClient, client.apiBase, sessionPlaintext(issued, UNPERSISTED_COPY_MESSAGE)), label: `${AI_CLIENT_LABELS[issuedClient]} 配置`, text: `复制 ${AI_CLIENT_LABELS[issuedClient]} 配置`, disabled: applying, iconClassName: "mr-1.5 h-3.5 w-3.5", copiedIconClassName: "mr-1.5 h-3.5 w-3.5 text-emerald-600", onError: (cause) => setError(errorMessage(cause)) }) : null, bridge && issuedClient ? (appliedClient ? (_jsxs("span", { role: "status", className: "inline-flex items-center gap-1 text-xs text-muted-foreground", children: [_jsx(Check, { "aria-hidden": "true", className: "h-3.5 w-3.5" }), "\u5DF2\u5E94\u7528\u5230 ", AI_CLIENT_LABELS[appliedClient]] })) : (_jsxs(Button, { type: "button", size: "sm", disabled: applying || clientStatuses[issuedClient]?.status === 'unavailable', "aria-label": `写入 ${AI_CLIENT_LABELS[issuedClient]}`, onClick: () => void apply(), children: [applying ? _jsx(Loader2, { "aria-hidden": "true", className: "mr-2 h-4 w-4 animate-spin" }) : null, applying ? '正在应用…' : `写入 ${AI_CLIENT_LABELS[issuedClient]}`] }))) : null] }), _jsxs(DialogFooter, { children: [_jsx(Button, { type: "button", variant: "ghost", disabled: applying, onClick: beginAnother, children: "\u518D\u5EFA\u4E00\u4E2A" }), _jsx(Button, { type: "button", variant: "outline", onClick: () => setShowCreate(false), children: "\u5B8C\u6210" })] })] })) : (_jsxs("form", { className: "space-y-5", onSubmit: (event) => { event.preventDefault(); if (!creating)
411
+ } }, record.id))) }) }))] }), _jsx(AiBuiltinProvidersSection, { state: builtinDirectory ?? (typeof client.listBuiltinProviders === 'function'
412
+ ? { status: 'loading' }
413
+ : { status: 'unsupported' }) }), _jsx(AiGatewayModelsSection, { models: gatewayModels, selection: modelSelection }), _jsxs(DialogContent, { className: "sm:max-w-md", "aria-describedby": undefined, children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: issued ? 'Xpod 密钥 已签发' : '新建 Xpod 密钥' }) }), issued ? (_jsxs("div", { className: "space-y-5", children: [_jsxs("div", { className: "space-y-1.5", children: [_jsxs("p", { className: "text-sm", children: ["\u5DF2\u7B7E\u53D1\u300C", issued.name || '未命名 Xpod 密钥', "\u300D\uFF0C\u7528\u9014\uFF1A", issuedClient ? AI_CLIENT_LABELS[issuedClient] : '只复制', "\u3002"] }), _jsx("p", { className: "text-xs text-muted-foreground", children: "\u5BC6\u94A5\u53EA\u663E\u793A\u8FD9\u4E00\u6B21\uFF0C\u8BF7\u7ACB\u5373\u590D\u5236\u3002\u8303\u56F4\uFF1A\u6574\u4E2A Pod\u3002" })] }), issued.maskedHint ? (_jsx("code", { className: "block truncate rounded-md border border-border/60 bg-muted/30 px-3 py-2 font-mono text-xs text-muted-foreground", children: issued.maskedHint })) : null, _jsx(AiEndpointList, { endpoints: xpodProtocolEndpoints(client.apiBase), copy: true, display: "protocol" }), !bridge ? (_jsx("p", { className: "text-xs text-muted-foreground", children: "\u5F53\u524D Web \u73AF\u5883\u65E0\u6CD5\u81EA\u52A8\u5199\u5165\u5BA2\u6237\u7AEF\u914D\u7F6E\uFF0C\u8BF7\u590D\u5236\u540E\u624B\u52A8\u7C98\u8D34\uFF1B\u81EA\u52A8\u5E94\u7528\u9700\u8981\u672C\u673A\u8FDE\u63A5\u3002" })) : null, error ? _jsx("p", { role: "alert", className: "text-sm text-destructive", children: error }) : null, _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(AiCopyButton, { value: () => sessionPlaintext(issued, UNPERSISTED_COPY_MESSAGE), label: "Xpod \u5BC6\u94A5", text: "\u590D\u5236 Xpod \u5BC6\u94A5", disabled: applying, iconClassName: "mr-1.5 h-3.5 w-3.5", copiedIconClassName: "mr-1.5 h-3.5 w-3.5 text-emerald-600", onError: (cause) => setError(errorMessage(cause)) }), issuedClient ? _jsx(AiCopyButton, { value: () => manualConfigurationText(issuedClient, client.apiBase, sessionPlaintext(issued, UNPERSISTED_COPY_MESSAGE)), label: `${AI_CLIENT_LABELS[issuedClient]} 配置`, text: `复制 ${AI_CLIENT_LABELS[issuedClient]} 配置`, disabled: applying, iconClassName: "mr-1.5 h-3.5 w-3.5", copiedIconClassName: "mr-1.5 h-3.5 w-3.5 text-emerald-600", onError: (cause) => setError(errorMessage(cause)) }) : null, bridge && issuedClient ? (appliedClient ? (_jsxs("span", { role: "status", className: "inline-flex items-center gap-1 text-xs text-muted-foreground", children: [_jsx(Check, { "aria-hidden": "true", className: "h-3.5 w-3.5" }), "\u5DF2\u5E94\u7528\u5230 ", AI_CLIENT_LABELS[appliedClient]] })) : (_jsxs(Button, { type: "button", size: "sm", disabled: applying || clientStatuses[issuedClient]?.status === 'unavailable', "aria-label": `写入 ${AI_CLIENT_LABELS[issuedClient]}`, onClick: () => void apply(), children: [applying ? _jsx(Loader2, { "aria-hidden": "true", className: "mr-2 h-4 w-4 animate-spin" }) : null, applying ? '正在应用…' : `写入 ${AI_CLIENT_LABELS[issuedClient]}`] }))) : null] }), _jsxs(DialogFooter, { children: [_jsx(Button, { type: "button", variant: "ghost", disabled: applying, onClick: beginAnother, children: "\u518D\u5EFA\u4E00\u4E2A" }), _jsx(Button, { type: "button", variant: "outline", onClick: () => setShowCreate(false), children: "\u5B8C\u6210" })] })] })) : (_jsxs("form", { className: "space-y-5", onSubmit: (event) => { event.preventDefault(); if (!creating)
388
414
  void create(); }, children: [_jsxs("label", { className: "block space-y-2", children: [_jsx("span", { className: "text-sm font-medium", children: "\u540D\u79F0" }), _jsx(Input, { autoFocus: true, "aria-label": "Xpod \u5BC6\u94A5 \u540D\u79F0", value: name, disabled: creating, onChange: (event) => setName(event.target.value) })] }), _jsxs("label", { className: "block space-y-2", children: [_jsx("span", { className: "text-sm font-medium", children: "\u7ED9\u54EA\u4E2A\u5BA2\u6237\u7AEF\u7528" }), _jsxs(NativeSelect, { "aria-label": "Xpod \u5BC6\u94A5 \u7528\u9014", value: purpose, disabled: creating, onChange: (event) => setPurpose(event.target.value), children: [_jsx("option", { value: "", children: "\u4E0D\u5199\u5165\uFF0C\u53EA\u590D\u5236" }), AI_CONNECTIONS_CLIENTS.map((clientId) => (_jsxs("option", { value: clientId, children: [AI_CLIENT_LABELS[clientId], bridge ? (clientStatuses[clientId]?.status === 'unavailable' ? ' · 未安装' : clientStatuses[clientId] ? ' · 可配置' : ' · 检测中') : ' · 只复制配置'] }, clientId)))] })] }), _jsx("p", { className: "text-xs leading-normal text-muted-foreground", children: "\u5BA2\u6237\u7AEF\u9ED8\u8BA4\u8DDF\u968F Pod \u7684\u667A\u80FD\u6A21\u578B\u3002" }), error ? _jsx("p", { role: "alert", className: "text-sm text-destructive", children: error }) : null, _jsxs(DialogFooter, { children: [_jsx(Button, { type: "button", variant: "outline", disabled: creating, onClick: () => setShowCreate(false), children: "\u53D6\u6D88" }), _jsxs(Button, { type: "submit", "aria-label": "\u521B\u5EFA Xpod \u5BC6\u94A5", disabled: creating || !name.trim(), children: [creating ? _jsx(Loader2, { "aria-hidden": "true", className: "mr-2 h-4 w-4 animate-spin" }) : null, creating ? '正在创建…' : '创建 Xpod 密钥'] })] })] }))] })] }) }) }));
389
415
  }
390
416
  function errorCode(error) {
@@ -4,6 +4,7 @@ export * from './AiClientConfigurationSection.js';
4
4
  export * from './AiConnectionsPanel.js';
5
5
  export * from './AiCopyButton.js';
6
6
  export * from './AiEndpointList.js';
7
+ export * from './AiBuiltinProvidersSection.js';
7
8
  export * from './AiGatewayKeysSection.js';
8
9
  export * from './AiInfoTooltip.js';
9
10
  export * from './AiProviderHeader.js';
@@ -10,6 +10,7 @@ export * from './AiClientConfigurationSection.js';
10
10
  export * from './AiConnectionsPanel.js';
11
11
  export * from './AiCopyButton.js';
12
12
  export * from './AiEndpointList.js';
13
+ export * from './AiBuiltinProvidersSection.js';
13
14
  export * from './AiGatewayKeysSection.js';
14
15
  export * from './AiInfoTooltip.js';
15
16
  export * from './AiProviderHeader.js';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@undefineds.co/ai-connections",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -51,7 +51,7 @@
51
51
  "@undefineds.co/pod-collections": "0.1.6",
52
52
  "@undefineds.co/shared-ui": "0.1.5",
53
53
  "lucide-react": "^0.525.0",
54
- "@undefineds.co/ai-connections-runtime": "0.1.5"
54
+ "@undefineds.co/ai-connections-runtime": "0.1.6"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "react": "^19.2.0"
@@ -12,7 +12,7 @@
12
12
  */
13
13
  export { AI_CONNECTIONS_PROVIDERS } from './client/types.js';
14
14
  export { PLATFORM_MODEL_ROLES, matchesPlatformModelRole } from './client/gateway-model-roles.js';
15
- export type { AiConnectAttempt, AiConnectionBeginOptions, AiConnectionsClient, AiConnectionsCredential, AiConnectionsMode, AiConnectionsProvider, AiConnectStatus, AiGatewayModel, AiGatewayCatalogModel, AiProviderAuthorizationMethod, AiProviderAuthorizationMethodId, AiProviderAuthorizationMethodsSummary, AiProviderConnectionSummary, AiProviderCredentialSummary, AiProviderOffering, AiProviderSummary, AiProviderSummaryStatus, AiQuotaSnapshot, AiQuotaWindow, CreateApiKeyCredentialInput, CreatedGatewayKey, CustomProviderModel, DiscoveredProviderModel, GatewayKeyRecord, ProviderModelDiscovery, TestProviderCredentialInput, UpdateProviderCredentialInput, } from './client/types.js';
15
+ export type { AiBuiltinProviderSummary, AiConnectAttempt, AiConnectionBeginOptions, AiConnectionsClient, AiConnectionsCredential, AiConnectionsMode, AiConnectionsProvider, AiConnectStatus, AiGatewayModel, AiGatewayCatalogModel, AiProviderAuthorizationMethod, AiProviderAuthorizationMethodId, AiProviderAuthorizationMethodsSummary, AiProviderConnectionSummary, AiProviderCredentialSummary, AiProviderOffering, AiProviderSummary, AiProviderSummaryStatus, AiQuotaSnapshot, AiQuotaWindow, CreateApiKeyCredentialInput, CreatedGatewayKey, CustomProviderModel, DiscoveredProviderModel, GatewayKeyRecord, ProviderModelDiscovery, TestProviderCredentialInput, UpdateProviderCredentialInput, } from './client/types.js';
16
16
  export { AiConnectionsRequestError, aiConnectionsErrorCode, normalizeProxyUrl, redactProxyUrl, } from './client/normalize.js';
17
17
  export { createAiConnectionsClient, resolveAiConnectionsApiBase } from './client/request.js';
18
18
  /**
@@ -1,4 +1,4 @@
1
- import type { AiConnectAttempt, AiConnectionsCredential, AiConnectionsProvider, AiGatewayModel, AiGatewayCatalogModel, AiProviderAuthorizationMethodsSummary, AiProviderCredentialSummary, AiProviderSummary, CustomProviderModel, ProviderModelDiscovery } from './types.js';
1
+ import type { AiBuiltinProviderSummary, AiConnectAttempt, AiConnectionsCredential, AiConnectionsProvider, AiGatewayModel, AiGatewayCatalogModel, AiProviderAuthorizationMethodsSummary, AiProviderCredentialSummary, AiProviderSummary, CustomProviderModel, ProviderModelDiscovery } from './types.js';
2
2
  /**
3
3
  * Everything that turns untrusted API payloads, user input and failures into the
4
4
  * shapes the rest of the app can rely on: proxy/pod URL normalising, error text,
@@ -42,6 +42,21 @@ export declare function parseCustomModelList(value: unknown): CustomProviderMode
42
42
  export declare function parseGatewayModel(value: unknown): AiGatewayModel | undefined;
43
43
  export declare function parseGatewayCatalogModel(value: unknown): AiGatewayCatalogModel | undefined;
44
44
  export declare function parseProviderSummaries(values: unknown[]): AiProviderSummary[];
45
+ /**
46
+ * The deployment-owned providers the server declares about itself.
47
+ *
48
+ * This is the counterpart of `parseGatewayModel`'s Pod filter, not a widening of
49
+ * it: a row qualifies only when the server says `builtin: true` AND
50
+ * `readOnly: true`, and the id it carries is then trusted as a bare deployment
51
+ * id. Nothing here enters `AI_CONNECTIONS_PROVIDERS`, so a declared id cannot
52
+ * become a connectable provider, and a Pod row that merely names itself after
53
+ * one is still rejected by the Pod parsers above.
54
+ *
55
+ * The models are projected as catalog entries rather than `AiGatewayModel`s on
56
+ * purpose: their owner is a deployment id, which is not an `AiConnectionsProvider`,
57
+ * and mixing the two vocabularies is what made the row disappear.
58
+ */
59
+ export declare function parseBuiltinProviderSummaries(values: unknown[]): AiBuiltinProviderSummary[];
45
60
  export declare function parseAuthorizationMethodsSummary(value: unknown): AiProviderAuthorizationMethodsSummary | undefined;
46
61
  export declare function parseProviderCredentialSummary(value: unknown): AiProviderCredentialSummary | undefined;
47
62
  export declare function sanitizePublicObject(value: unknown): Record<string, unknown>;
@@ -135,8 +135,9 @@ export function parseGatewayModel(value) {
135
135
  ?? providerValue(value.providerId)
136
136
  ?? providerValue(value.owned_by);
137
137
  // Only WITHOUT such an owner is a platform-role id the Gateway's own routing
138
- // entry (or a genuine `xpod-builtin` row, whose owner is not a Pod provider),
139
- // and only then must it stay out of the Pod model list.
138
+ // entry, and only then must it stay out of the Pod model list. A row owned by
139
+ // a provider outside this list (a deployment built-in) is not a Pod model
140
+ // either; `parseBuiltinProviderSummaries` reads those from the declaration.
140
141
  if (!explicitProvider && isPlatformModelId(value.id))
141
142
  return undefined;
142
143
  const provider = explicitProvider ?? providerFromModelId(value.id);
@@ -245,8 +246,20 @@ export function parseProviderSummaries(values) {
245
246
  return [...grouped.values()];
246
247
  }
247
248
  function parseProviderSummary(value) {
249
+ // A row the server declares as a read-only directory entry is never a
250
+ // connectable personal connection, whatever id it happens to carry. This is
251
+ // the generic half of the invariant: the same declaration that makes
252
+ // `listBuiltinProviders` accept the row is what makes the mutable surface
253
+ // reject it, so an opaque deployment id that collides with a vocabulary id
254
+ // cannot smuggle itself in as an editable provider.
255
+ if (isDeclaredReadOnlyDirectoryRow(value))
256
+ return undefined;
248
257
  return parseGroupedProviderSummary(value) ?? parseLegacyProviderSummary(value);
249
258
  }
259
+ /** The declaration `builtin: true` + `readOnly: true`, or either half claiming it. */
260
+ function isDeclaredReadOnlyDirectoryRow(value) {
261
+ return isRecord(value) && (value.builtin === true || value.readOnly === true);
262
+ }
250
263
  function parseLegacyProviderSummary(value) {
251
264
  if (!isRecord(value)
252
265
  || typeof value.provider !== 'string'
@@ -288,6 +301,71 @@ function parseGroupedProviderSummary(value) {
288
301
  status: value.status,
289
302
  };
290
303
  }
304
+ /**
305
+ * The deployment-owned providers the server declares about itself.
306
+ *
307
+ * This is the counterpart of `parseGatewayModel`'s Pod filter, not a widening of
308
+ * it: a row qualifies only when the server says `builtin: true` AND
309
+ * `readOnly: true`, and the id it carries is then trusted as a bare deployment
310
+ * id. Nothing here enters `AI_CONNECTIONS_PROVIDERS`, so a declared id cannot
311
+ * become a connectable provider, and a Pod row that merely names itself after
312
+ * one is still rejected by the Pod parsers above.
313
+ *
314
+ * The models are projected as catalog entries rather than `AiGatewayModel`s on
315
+ * purpose: their owner is a deployment id, which is not an `AiConnectionsProvider`,
316
+ * and mixing the two vocabularies is what made the row disappear.
317
+ */
318
+ export function parseBuiltinProviderSummaries(values) {
319
+ const providers = [];
320
+ const seen = new Set();
321
+ for (const value of values) {
322
+ const provider = parseBuiltinProviderSummary(value);
323
+ if (!provider || seen.has(provider.id))
324
+ continue;
325
+ seen.add(provider.id);
326
+ providers.push(provider);
327
+ }
328
+ return providers;
329
+ }
330
+ function parseBuiltinProviderSummary(value) {
331
+ if (!isRecord(value)
332
+ || value.builtin !== true
333
+ || value.readOnly !== true
334
+ || typeof value.id !== 'string'
335
+ || !value.id.trim()
336
+ || !isProviderSummaryStatus(value.status)) {
337
+ return undefined;
338
+ }
339
+ const id = value.id.trim();
340
+ // A declared directory is models only: credentials, offerings and write
341
+ // actions would contradict `readOnly`, so a row claiming them is malformed
342
+ // rather than partially accepted.
343
+ if (!Array.isArray(value.offerings) || !Array.isArray(value.credentials))
344
+ return undefined;
345
+ if (value.offerings.length > 0 || value.credentials.length > 0)
346
+ return undefined;
347
+ const models = arrayValue(value.selectedModels, (item) => parseBuiltinProviderModel(item, id));
348
+ return {
349
+ id,
350
+ name: stringValue(value.name) ?? id,
351
+ status: value.status,
352
+ models,
353
+ };
354
+ }
355
+ function parseBuiltinProviderModel(value, providerId) {
356
+ if (!isRecord(value) || typeof value.id !== 'string' || !value.id.trim())
357
+ return undefined;
358
+ const owner = stringValue(value.provider) ?? stringValue(value.providerId) ?? stringValue(value.owned_by);
359
+ // The declaration and the row must agree on who owns the model; a row naming
360
+ // another provider is that provider's entry, not this one's.
361
+ if (owner !== undefined && owner !== providerId)
362
+ return undefined;
363
+ return compactObject({
364
+ id: value.id.trim(),
365
+ displayName: stringValue(value.displayName) ?? stringValue(value.display_name) ?? stringValue(value.name),
366
+ provider: providerId,
367
+ });
368
+ }
291
369
  function parseProviderOffering(value) {
292
370
  if (!isRecord(value) || typeof value.id !== 'string' || !value.id)
293
371
  return undefined;
@@ -1,5 +1,5 @@
1
1
  import { apiKeyFingerprint } from './fingerprint.js';
2
- import { AiConnectionsRequestError, assertProvider, compactObject, isDefined, isRecord, parseAuthorizationMethodsSummary, parseConnectAttempt, parseCredential, parseCustomModelList, parseGatewayModel, parseGatewayCatalogModel, parseModelDiscovery, parseProviderCredentialSummary, parseProviderSummaries, readJson, sanitizePublicObject, } from './normalize.js';
2
+ import { AiConnectionsRequestError, assertProvider, compactObject, isDefined, isRecord, parseAuthorizationMethodsSummary, parseBuiltinProviderSummaries, parseConnectAttempt, parseCredential, parseCustomModelList, parseGatewayModel, parseGatewayCatalogModel, parseModelDiscovery, parseProviderCredentialSummary, parseProviderSummaries, readJson, sanitizePublicObject, } from './normalize.js';
3
3
  /**
4
4
  * The HTTP client itself: one factory over the Pod base URL and an authenticated
5
5
  * fetch, with every response normalised by `normalize.ts`.
@@ -108,6 +108,12 @@ export function createAiConnectionsClient({ webId, podBaseUrl, authenticatedFetc
108
108
  // request Pod can never differ. Only this property is pinned; the rest of
109
109
  // the client stays a normal, extensible object (decoration and spies work).
110
110
  get podBaseUrl() { return podBinding; },
111
+ /**
112
+ * Key management exists only when the host assembled this client with the
113
+ * Account capability. Declaring it is what lets the page say "unsupported"
114
+ * instead of issuing a request it already knows must fail.
115
+ */
116
+ gatewayKeyManagement: Boolean(clientCredentials),
111
117
  getServiceAccess() {
112
118
  return request('/api/applets/service-access/ai-connections', 'GET');
113
119
  },
@@ -115,6 +121,18 @@ export function createAiConnectionsClient({ webId, podBaseUrl, authenticatedFetc
115
121
  const payload = await request('/api/ai/providers', 'GET');
116
122
  return Array.isArray(payload.data) ? parseProviderSummaries(payload.data) : [];
117
123
  },
124
+ /**
125
+ * The deployment's own read-only directory from the same response.
126
+ *
127
+ * `listProviders` must keep answering strictly in the Pod vocabulary, so the
128
+ * declared rows are read here, where a deployment id is expected. The two
129
+ * lists are independent on purpose: whichever one fails or is empty, the
130
+ * other still describes what it owns.
131
+ */
132
+ async listBuiltinProviders() {
133
+ const payload = await request('/api/ai/providers', 'GET');
134
+ return Array.isArray(payload.data) ? parseBuiltinProviderSummaries(payload.data) : [];
135
+ },
118
136
  async listAuthorizationMethods() {
119
137
  const response = await authenticatedFetch(`${apiBase}/api/ai/connections/authorization-methods`, {
120
138
  method: 'GET',
@@ -130,6 +130,24 @@ export interface AiGatewayCatalogModel {
130
130
  displayName?: string;
131
131
  provider?: string;
132
132
  }
133
+ /**
134
+ * A deployment-owned, read-only provider the server declares about itself.
135
+ *
136
+ * The row says it is not a Pod connection (`builtin: true` + `readOnly: true`)
137
+ * and carries the deployment's own provider id. That id is deliberately NOT
138
+ * part of `AI_CONNECTIONS_PROVIDERS`: that list names what a user may connect,
139
+ * while this directory names what the deployment already runs. Keeping them
140
+ * apart is what lets an arbitrary deployment id be listed without widening
141
+ * every write path to accept it.
142
+ */
143
+ export interface AiBuiltinProviderSummary {
144
+ /** Deployment-owned id, whatever the deployment calls itself. */
145
+ id: string;
146
+ name: string;
147
+ status: AiProviderSummary['status'];
148
+ /** Models the deployment declares for this provider, under the same owner id. */
149
+ models: AiGatewayCatalogModel[];
150
+ }
133
151
  /**
134
152
  * What the provider's own model list said a model is.
135
153
  *
@@ -306,6 +324,13 @@ export interface AiConnectionsClient {
306
324
  readonly podBaseUrl: string;
307
325
  getServiceAccess(): Promise<unknown>;
308
326
  listProviders(): Promise<AiProviderSummary[]>;
327
+ /**
328
+ * Deployment-owned read-only providers declared by the server itself
329
+ * (`builtin: true` + `readOnly: true`), independent of the Pod provider
330
+ * catalogue. This is the only surface that carries those ids, which is why
331
+ * the credential and connect calls below never accept them.
332
+ */
333
+ listBuiltinProviders?(): Promise<AiBuiltinProviderSummary[]>;
309
334
  listAuthorizationMethods?(): Promise<AiProviderAuthorizationMethodsSummary[]>;
310
335
  listModels(): Promise<AiGatewayModel[]>;
311
336
  /** Active Gateway routing projection, independent of a host's Pod catalog. */
@@ -320,7 +345,13 @@ export interface AiConnectionsClient {
320
345
  * There is deliberately no enable/disable call - the Account has no such
321
346
  * capability - and no reveal call: the `sk-` wrapper exists only in the create
322
347
  * response and in `plaintexts` for the session that issued it.
348
+ *
349
+ * `gatewayKeyManagement` declares whether this client was assembled with that
350
+ * capability. A client that says `false` will fail every one of these calls,
351
+ * so a surface must present the operation as unsupported instead of probing
352
+ * it.
323
353
  */
354
+ readonly gatewayKeyManagement?: boolean;
324
355
  listGatewayKeys(): Promise<GatewayKeyRecord[]>;
325
356
  createGatewayKey(input: {
326
357
  name: string;
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "sourceAuthority": {
4
- "sourceCommit": "326cdab7c29a107ce566bdc6ea543c5abaf88b6b",
4
+ "sourceCommit": "1147fecfec4aea4b75cacbe779713f09e92dafac",
5
5
  "tracked": true,
6
6
  "dirty": false,
7
- "snapshotSHA256": "85f739d81735baf4e1263e55c2542335233393872ee761179ff0b9fa4411879e",
7
+ "snapshotSHA256": "ae0a4e3f57abd69441e473bce58221eba61e0c1cdab02a1352cd8651687ef6d7",
8
8
  "missingTrackedSourceCount": 0,
9
9
  "scope": "canonical package source and actual shared material collector"
10
10
  },
@@ -28,7 +28,7 @@
28
28
  "payload": "dist/contract/provider-catalog.cjs",
29
29
  "payloadSHA256": "4f6a8c98146fbd94519058274d0e49e9c0c840a1f1ee4236cc82540c4a0d0064",
30
30
  "metafile": "dist/provider-catalog-inputs.json",
31
- "metafileSHA256": "cb6e4a6c2a0efe3931c2d35667866ba5f3a70151843c414e505c459e68bdc289",
31
+ "metafileSHA256": "ad5077988c891c3f922190711e3777306f2a64ac1554c2b9cebc30a07a0a7855",
32
32
  "generatedProfile": "index"
33
33
  },
34
34
  {
@@ -36,7 +36,7 @@
36
36
  "payload": "dist/service-access-resources.cjs",
37
37
  "payloadSHA256": "0803a6cb7e4a7530fce8bae62cae7827775246799464607ab9507a7bb920aaa6",
38
38
  "metafile": "dist/service-access-resources-inputs.json",
39
- "metafileSHA256": "73c1da41071ce21fce3ab8637a3332d4805a7fc3a659d7548abcd4b2f230113b",
39
+ "metafileSHA256": "aace3a1717592c0a1e372062460c5bf91cc8b2507ba525141fec1a22a99e761a",
40
40
  "generatedProfile": "index"
41
41
  }
42
42
  ]
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "sourceAuthority": {
4
- "sourceCommit": "326cdab7c29a107ce566bdc6ea543c5abaf88b6b",
4
+ "sourceCommit": "1147fecfec4aea4b75cacbe779713f09e92dafac",
5
5
  "tracked": true,
6
6
  "dirty": false,
7
- "snapshotSHA256": "85f739d81735baf4e1263e55c2542335233393872ee761179ff0b9fa4411879e",
7
+ "snapshotSHA256": "ae0a4e3f57abd69441e473bce58221eba61e0c1cdab02a1352cd8651687ef6d7",
8
8
  "missingTrackedSourceCount": 0,
9
9
  "scope": "canonical package source and actual shared material collector"
10
10
  },
@@ -12,7 +12,7 @@
12
12
  {
13
13
  "path": "build-provenance.json",
14
14
  "bytes": 1727,
15
- "sha256": "dee7e8e0129abe6b67a3848d8bc0413e6db0ea9bdcefa3589933d0e4a6e89e0b"
15
+ "sha256": "c5dc8b39510cdb7532e69049384414679783ec075525227383a39b199ae76652"
16
16
  },
17
17
  {
18
18
  "path": "generated/provider-catalog/index.json",
@@ -127,7 +127,7 @@
127
127
  {
128
128
  "path": "javascript/provider-catalog/index.json",
129
129
  "bytes": 14922,
130
- "sha256": "b03ed4dae7bdc3bc6265b5796e1180c49744996f8c1bd075cd016cf961da238d"
130
+ "sha256": "d46e2b545aeba8b16828068b14771eb463da77f1fb4c804a81ac8021b2353ed0"
131
131
  },
132
132
  {
133
133
  "path": "javascript/provider-catalog/objects/02644972b775ee7bc4ed4b088808a3ea34ac6922ec52f897b7ea76b9f0ed92c4.txt",
@@ -167,7 +167,7 @@
167
167
  {
168
168
  "path": "javascript/service-access-resources/index.json",
169
169
  "bytes": 15148,
170
- "sha256": "f596b309111312cbed6b4e9416e453db09234d46cd5024c0d8e3b96edc3a89e0"
170
+ "sha256": "c6ed55ff5c970e90f9f8d7b260af14e4a47d0e8a30e78c9d596e0de116614908"
171
171
  },
172
172
  {
173
173
  "path": "javascript/service-access-resources/objects/02644972b775ee7bc4ed4b088808a3ea34ac6922ec52f897b7ea76b9f0ed92c4.txt",
@@ -222,12 +222,12 @@
222
222
  {
223
223
  "path": "source/package.json",
224
224
  "bytes": 3404,
225
- "sha256": "f9c72637124b3510120a20c3b6b93ff33eebcf7796d314eeee3374e5cbfbfd20"
225
+ "sha256": "d6af8eecb871be684616ddf691d0d0b38a4be66c741748afa9445d94a0f1b86a"
226
226
  },
227
227
  {
228
228
  "path": "source/src/contract/ai-connections-client.ts",
229
- "bytes": 2403,
230
- "sha256": "a14daecf2da2572e1c7b88c3ed38dab22540313c9a6a9396343af3755ee4790a"
229
+ "bytes": 2431,
230
+ "sha256": "617044bb2c8d081b9b1169202c4c51f0b5b8c14af097aa6a7626b3dc350fbe43"
231
231
  },
232
232
  {
233
233
  "path": "source/src/contract/client/fingerprint.ts",
@@ -241,18 +241,18 @@
241
241
  },
242
242
  {
243
243
  "path": "source/src/contract/client/normalize.ts",
244
- "bytes": 30113,
245
- "sha256": "87d8aaa519ec1261524ac0f258dfdd6007b641100df078e658241b122dc98d44"
244
+ "bytes": 33775,
245
+ "sha256": "407ce39c16a58f488e03f36ce4cfc10334b334da84d4870cf068a6e132a35c96"
246
246
  },
247
247
  {
248
248
  "path": "source/src/contract/client/request.ts",
249
- "bytes": 16162,
250
- "sha256": "b866489109434e1cf8e84ff2d76232420a1deb6cd380214307714dc020b418f7"
249
+ "bytes": 17087,
250
+ "sha256": "779d5a03303b0496ce520663d1b1cc285b3bb4e26c735f9efeaed5f2c23785f8"
251
251
  },
252
252
  {
253
253
  "path": "source/src/contract/client/types.ts",
254
- "bytes": 15463,
255
- "sha256": "1ce11260368535b7e1eed8b5e3be7f355b1b30bb3cf786399064608621d00429"
254
+ "bytes": 16932,
255
+ "sha256": "82b1f6079bc14041f992191349eea48b3c30e17754da42687677a9a9b39ab1e4"
256
256
  },
257
257
  {
258
258
  "path": "source/src/contract/client-config/base-adapter.ts",
@@ -322,7 +322,7 @@
322
322
  {
323
323
  "path": "source-inventory.json",
324
324
  "bytes": 4713,
325
- "sha256": "70c3db163597a7e5b6d3f5aaadbc58cc089c4156cbd60625b7abff008af55a8e"
325
+ "sha256": "cd34d7ed0c52ec52de04129be5e390eada5cb5bf3bacba78e804b96c3eb1e06a"
326
326
  }
327
327
  ]
328
328
  }
@@ -299,8 +299,8 @@
299
299
  "inputs": [
300
300
  {
301
301
  "path": "src/contract/client/types.ts",
302
- "sha256": "1ce11260368535b7e1eed8b5e3be7f355b1b30bb3cf786399064608621d00429",
303
- "bytes": 15463,
302
+ "sha256": "82b1f6079bc14041f992191349eea48b3c30e17754da42687677a9a9b39ab1e4",
303
+ "bytes": 16932,
304
304
  "bytesInOutput": 134
305
305
  },
306
306
  {
@@ -299,8 +299,8 @@
299
299
  "inputs": [
300
300
  {
301
301
  "path": "src/contract/client/types.ts",
302
- "sha256": "1ce11260368535b7e1eed8b5e3be7f355b1b30bb3cf786399064608621d00429",
303
- "bytes": 15463,
302
+ "sha256": "82b1f6079bc14041f992191349eea48b3c30e17754da42687677a9a9b39ab1e4",
303
+ "bytes": 16932,
304
304
  "bytesInOutput": 134
305
305
  },
306
306
  {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@undefineds.co/ai-connections-runtime",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "sourceAuthority": {
4
- "sourceCommit": "326cdab7c29a107ce566bdc6ea543c5abaf88b6b",
4
+ "sourceCommit": "1147fecfec4aea4b75cacbe779713f09e92dafac",
5
5
  "tracked": true,
6
6
  "dirty": false,
7
- "snapshotSHA256": "85f739d81735baf4e1263e55c2542335233393872ee761179ff0b9fa4411879e",
7
+ "snapshotSHA256": "ae0a4e3f57abd69441e473bce58221eba61e0c1cdab02a1352cd8651687ef6d7",
8
8
  "missingTrackedSourceCount": 0,
9
9
  "scope": "canonical package source and actual shared material collector"
10
10
  },
@@ -24,13 +24,13 @@
24
24
  {
25
25
  "path": "package.json",
26
26
  "bytes": 3404,
27
- "sha256": "f9c72637124b3510120a20c3b6b93ff33eebcf7796d314eeee3374e5cbfbfd20",
27
+ "sha256": "d6af8eecb871be684616ddf691d0d0b38a4be66c741748afa9445d94a0f1b86a",
28
28
  "tracked": true
29
29
  },
30
30
  {
31
31
  "path": "src/contract/ai-connections-client.ts",
32
- "bytes": 2403,
33
- "sha256": "a14daecf2da2572e1c7b88c3ed38dab22540313c9a6a9396343af3755ee4790a",
32
+ "bytes": 2431,
33
+ "sha256": "617044bb2c8d081b9b1169202c4c51f0b5b8c14af097aa6a7626b3dc350fbe43",
34
34
  "tracked": true
35
35
  },
36
36
  {
@@ -89,20 +89,20 @@
89
89
  },
90
90
  {
91
91
  "path": "src/contract/client/normalize.ts",
92
- "bytes": 30113,
93
- "sha256": "87d8aaa519ec1261524ac0f258dfdd6007b641100df078e658241b122dc98d44",
92
+ "bytes": 33775,
93
+ "sha256": "407ce39c16a58f488e03f36ce4cfc10334b334da84d4870cf068a6e132a35c96",
94
94
  "tracked": true
95
95
  },
96
96
  {
97
97
  "path": "src/contract/client/request.ts",
98
- "bytes": 16162,
99
- "sha256": "b866489109434e1cf8e84ff2d76232420a1deb6cd380214307714dc020b418f7",
98
+ "bytes": 17087,
99
+ "sha256": "779d5a03303b0496ce520663d1b1cc285b3bb4e26c735f9efeaed5f2c23785f8",
100
100
  "tracked": true
101
101
  },
102
102
  {
103
103
  "path": "src/contract/client/types.ts",
104
- "bytes": 15463,
105
- "sha256": "1ce11260368535b7e1eed8b5e3be7f355b1b30bb3cf786399064608621d00429",
104
+ "bytes": 16932,
105
+ "sha256": "82b1f6079bc14041f992191349eea48b3c30e17754da42687677a9a9b39ab1e4",
106
106
  "tracked": true
107
107
  },
108
108
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "inputs": {
3
3
  "src/contract/client/types.ts": {
4
- "bytes": 15463,
4
+ "bytes": 16932,
5
5
  "format": "esm",
6
6
  "imports": []
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "inputs": {
3
3
  "src/contract/client/types.ts": {
4
- "bytes": 15463,
4
+ "bytes": 16932,
5
5
  "format": "esm",
6
6
  "imports": []
7
7
  },