@undefineds.co/xpod 0.4.11 → 0.4.13

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 (429) hide show
  1. package/config/components-ignore.json +5 -1
  2. package/config/notifications.json +68 -0
  3. package/config/xpod.base.json +9 -11
  4. package/dist/acceptance/QleverSemanticConformance.js +7 -0
  5. package/dist/ai/service/AiCredentialSecret.d.ts +30 -0
  6. package/dist/ai/service/AiCredentialSecret.js +120 -0
  7. package/dist/ai/service/CredentialReaderImpl.d.ts +18 -0
  8. package/dist/ai/service/CredentialReaderImpl.js +81 -5
  9. package/dist/ai/service/CredentialReaderImpl.jsonld +42 -2
  10. package/dist/ai/service/EmbeddingModelPolicy.d.ts +79 -0
  11. package/dist/ai/service/EmbeddingModelPolicy.js +134 -0
  12. package/dist/ai/service/EmbeddingProviderError.js +6 -0
  13. package/dist/ai/service/EmbeddingServiceImpl.d.ts +13 -1
  14. package/dist/ai/service/EmbeddingServiceImpl.js +18 -5
  15. package/dist/ai/service/EmbeddingServiceImpl.jsonld +35 -0
  16. package/dist/ai/service/index.d.ts +2 -0
  17. package/dist/ai/service/index.js +2 -0
  18. package/dist/api/ai-gateway/connect/index.d.ts +20 -2
  19. package/dist/api/ai-gateway/connect/index.js +162 -16
  20. package/dist/api/ai-gateway/credentials/AiCredentialSecretDecoder.d.ts +12 -0
  21. package/dist/api/ai-gateway/credentials/AiCredentialSecretDecoder.js +30 -0
  22. package/dist/api/ai-gateway/errors.d.ts +1 -1
  23. package/dist/api/ai-gateway/models/GatewayEmbeddingModelCatalog.d.ts +11 -0
  24. package/dist/api/ai-gateway/models/GatewayEmbeddingModelCatalog.js +31 -0
  25. package/dist/api/ai-gateway/models/PodModelSelectionRepository.js +7 -3
  26. package/dist/api/ai-gateway/models/ProviderCustomModelsService.d.ts +18 -0
  27. package/dist/api/ai-gateway/models/ProviderCustomModelsService.js +23 -0
  28. package/dist/api/ai-gateway/models/ProviderModelDiscoveryAdapters.d.ts +3 -1
  29. package/dist/api/ai-gateway/models/ProviderModelDiscoveryAdapters.js +2 -45
  30. package/dist/api/ai-gateway/models/ProviderModelSelectionService.d.ts +10 -0
  31. package/dist/api/ai-gateway/models/ProviderModelSelectionService.js +57 -20
  32. package/dist/api/ai-gateway/models/ProviderModelType.d.ts +28 -0
  33. package/dist/api/ai-gateway/models/ProviderModelType.js +34 -0
  34. package/dist/api/ai-gateway/models/ProviderModelsAdapter.d.ts +10 -0
  35. package/dist/api/ai-gateway/models/ProviderModelsAdapter.js +3 -4
  36. package/dist/api/ai-gateway/models/index.d.ts +1 -0
  37. package/dist/api/ai-gateway/models/index.js +3 -1
  38. package/dist/api/ai-gateway/providers/CustomRuntimeAdapter.d.ts +7 -0
  39. package/dist/api/ai-gateway/providers/CustomRuntimeAdapter.js +9 -2
  40. package/dist/api/ai-gateway/providers/ModelsDevCatalog.d.ts +7 -1
  41. package/dist/api/ai-gateway/providers/ModelsDevCatalog.js +4 -10
  42. package/dist/api/ai-gateway/providers/OfferingAuthorization.d.ts +6 -1
  43. package/dist/api/ai-gateway/providers/OfferingAuthorization.js +0 -3
  44. package/dist/api/ai-gateway/providers/ProviderRegistry.d.ts +107 -0
  45. package/dist/api/ai-gateway/providers/ProviderRegistry.js +246 -23
  46. package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.d.ts +5 -0
  47. package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.js +5 -1
  48. package/dist/api/ai-gateway/quota/SubscriptionQuotaAdapters.d.ts +12 -4
  49. package/dist/api/ai-gateway/quota/SubscriptionQuotaAdapters.js +11 -11
  50. package/dist/api/ai-gateway/routing/ModelRouter.d.ts +14 -0
  51. package/dist/api/ai-gateway/routing/ModelRouter.js +43 -4
  52. package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.d.ts +9 -1
  53. package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.js +3 -27
  54. package/dist/api/chatkit/pod-store.d.ts +31 -0
  55. package/dist/api/chatkit/pod-store.js +132 -8
  56. package/dist/api/container/common.js +24 -4
  57. package/dist/api/container/routes.js +17 -2
  58. package/dist/api/container/types.d.ts +3 -1
  59. package/dist/api/handlers/AdminHandler.d.ts +13 -0
  60. package/dist/api/handlers/AdminHandler.js +47 -18
  61. package/dist/api/handlers/AiConfigHandler.d.ts +6 -0
  62. package/dist/api/handlers/AiConfigHandler.js +28 -0
  63. package/dist/api/handlers/AiGatewayManagementHandler.js +36 -0
  64. package/dist/api/runs/RdfRunContextRetriever.d.ts +14 -0
  65. package/dist/api/runs/RdfRunContextRetriever.js +41 -5
  66. package/dist/api/runtime.js +2 -1
  67. package/dist/api/service/AiClientConfigurationService.d.ts +1 -1
  68. package/dist/api/service/AiClientConfigurationService.js +1 -1
  69. package/dist/cli/commands/secret.d.ts +1 -0
  70. package/dist/cli/commands/secret.js +25 -7
  71. package/dist/components/components.jsonld +3 -1
  72. package/dist/components/context.jsonld +53 -1
  73. package/dist/http/SubgraphSparqlHttpHandler.d.ts +59 -2
  74. package/dist/http/SubgraphSparqlHttpHandler.js +145 -13
  75. package/dist/http/SubgraphSparqlHttpHandler.jsonld +37 -0
  76. package/dist/identity/drizzle/EdgeNodeRepository.d.ts +0 -12
  77. package/dist/identity/drizzle/EdgeNodeRepository.js +5 -13
  78. package/dist/index.d.ts +2 -1
  79. package/dist/index.js +7 -3
  80. package/dist/logging/log-file.d.ts +17 -0
  81. package/dist/logging/log-file.js +69 -0
  82. package/dist/main.js +2 -1
  83. package/dist/notifications/NotificationChannelSweeper.d.ts +50 -0
  84. package/dist/notifications/NotificationChannelSweeper.js +131 -0
  85. package/dist/notifications/NotificationChannelSweeper.jsonld +136 -0
  86. package/dist/notifications/ReclaimingWebSocket2023Storer.d.ts +25 -0
  87. package/dist/notifications/ReclaimingWebSocket2023Storer.js +56 -0
  88. package/dist/notifications/ReclaimingWebSocket2023Storer.jsonld +77 -0
  89. package/dist/notifications/index.d.ts +2 -0
  90. package/dist/notifications/index.js +2 -0
  91. package/dist/runtime/Proxy.d.ts +37 -0
  92. package/dist/runtime/Proxy.js +88 -16
  93. package/dist/runtime/bootstrap.js +2 -1
  94. package/dist/runtime/upgrade/BunNativeUpgradeRelay.d.ts +116 -0
  95. package/dist/runtime/upgrade/BunNativeUpgradeRelay.js +423 -0
  96. package/dist/runtime/upgrade/UpgradeHandshake.d.ts +63 -0
  97. package/dist/runtime/upgrade/UpgradeHandshake.js +199 -0
  98. package/dist/runtime/upgrade/WebSocketFrames.d.ts +67 -0
  99. package/dist/runtime/upgrade/WebSocketFrames.js +224 -0
  100. package/dist/storage/rdf/PostgresRdfEngine.js +10 -4
  101. package/dist/storage/rdf/RdfAccessScope.js +15 -1
  102. package/dist/storage/rdf/RdfEngineRdfJsSource.js +10 -2
  103. package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.d.ts +1 -1
  104. package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.js +9 -2
  105. package/node_modules/@undefineds.co/ai-connections/dist/AiAuthorizationActions.d.ts +12 -3
  106. package/node_modules/@undefineds.co/ai-connections/dist/AiAuthorizationActions.js +27 -10
  107. package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.d.ts +7 -0
  108. package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.js +15 -13
  109. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectDialog.d.ts +1 -1
  110. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectDialog.js +1 -1
  111. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsList.js +10 -6
  112. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMain.d.ts +15 -0
  113. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMain.js +29 -3
  114. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMainHeader.js +18 -3
  115. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.d.ts +17 -2
  116. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.js +94 -22
  117. package/node_modules/@undefineds.co/ai-connections/dist/AiCopyButton.d.ts +35 -0
  118. package/node_modules/@undefineds.co/ai-connections/dist/AiCopyButton.js +45 -0
  119. package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialPoolSection.d.ts +1 -1
  120. package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialPoolSection.js +71 -11
  121. package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialRow.d.ts +1 -1
  122. package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialRow.js +9 -7
  123. package/node_modules/@undefineds.co/ai-connections/dist/AiCustomProviderDialog.d.ts +1 -1
  124. package/node_modules/@undefineds.co/ai-connections/dist/AiEndpointList.d.ts +23 -0
  125. package/node_modules/@undefineds.co/ai-connections/dist/AiEndpointList.js +24 -0
  126. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeyRow.d.ts +1 -1
  127. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.d.ts +14 -5
  128. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.js +35 -38
  129. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayModelsSection.d.ts +21 -0
  130. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayModelsSection.js +51 -0
  131. package/node_modules/@undefineds.co/ai-connections/dist/AiInfoTooltip.d.ts +15 -0
  132. package/node_modules/@undefineds.co/ai-connections/dist/AiInfoTooltip.js +16 -0
  133. package/node_modules/@undefineds.co/ai-connections/dist/AiModelCatalog.d.ts +175 -0
  134. package/node_modules/@undefineds.co/ai-connections/dist/AiModelCatalog.js +133 -0
  135. package/node_modules/@undefineds.co/ai-connections/dist/AiOfferingDetails.d.ts +1 -1
  136. package/node_modules/@undefineds.co/ai-connections/dist/AiOfferingDetails.js +2 -2
  137. package/node_modules/@undefineds.co/ai-connections/dist/AiProviderCard.d.ts +1 -1
  138. package/node_modules/@undefineds.co/ai-connections/dist/AiProviderCard.js +13 -64
  139. package/node_modules/@undefineds.co/ai-connections/dist/AiProviderHeader.d.ts +21 -0
  140. package/node_modules/@undefineds.co/ai-connections/dist/AiProviderHeader.js +12 -0
  141. package/node_modules/@undefineds.co/ai-connections/dist/AiQuotaCard.d.ts +1 -1
  142. package/node_modules/@undefineds.co/ai-connections/dist/AiRowAction.d.ts +15 -0
  143. package/node_modules/@undefineds.co/ai-connections/dist/AiRowAction.js +12 -0
  144. package/node_modules/@undefineds.co/ai-connections/dist/AiSortableCredentialList.d.ts +1 -1
  145. package/node_modules/@undefineds.co/ai-connections/dist/AiSortableCredentialList.js +2 -1
  146. package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.d.ts +39 -6
  147. package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.js +57 -11
  148. package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.d.ts +46 -0
  149. package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.js +231 -0
  150. package/node_modules/@undefineds.co/ai-connections/dist/collections.d.ts +119 -0
  151. package/node_modules/@undefineds.co/ai-connections/dist/collections.js +173 -0
  152. package/node_modules/@undefineds.co/ai-connections/dist/controller.d.ts +71 -5
  153. package/node_modules/@undefineds.co/ai-connections/dist/controller.js +288 -18
  154. package/node_modules/@undefineds.co/ai-connections/dist/credential-labels.d.ts +6 -1
  155. package/node_modules/@undefineds.co/ai-connections/dist/credential-labels.js +8 -3
  156. package/node_modules/@undefineds.co/ai-connections/dist/display-wording.d.ts +20 -0
  157. package/node_modules/@undefineds.co/ai-connections/dist/display-wording.js +73 -0
  158. package/node_modules/@undefineds.co/ai-connections/dist/error-wording.d.ts +24 -0
  159. package/node_modules/@undefineds.co/ai-connections/dist/error-wording.js +253 -0
  160. package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.d.ts +14 -0
  161. package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.js +20 -0
  162. package/node_modules/@undefineds.co/ai-connections/dist/index.d.ts +8 -1
  163. package/node_modules/@undefineds.co/ai-connections/dist/index.js +8 -1
  164. package/node_modules/@undefineds.co/ai-connections/dist/manifest.js +1 -1
  165. package/node_modules/@undefineds.co/ai-connections/dist/offering-endpoints.d.ts +15 -1
  166. package/node_modules/@undefineds.co/ai-connections/dist/offering-endpoints.js +17 -0
  167. package/node_modules/@undefineds.co/ai-connections/dist/offering-label.d.ts +1 -1
  168. package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.d.ts +6 -1
  169. package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.js +5 -0
  170. package/node_modules/@undefineds.co/ai-connections/dist/service-access.js +2 -27
  171. package/node_modules/@undefineds.co/ai-connections/dist/useAiConnectDialog.d.ts +1 -1
  172. package/node_modules/@undefineds.co/ai-connections/package.json +2 -24
  173. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/ai-connections-client.d.ts +12 -3
  174. package/node_modules/@undefineds.co/ai-connections-core/dist/ai-connections-client.js +21 -0
  175. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/normalize.d.ts +17 -7
  176. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/normalize.js +48 -216
  177. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/request.js +3 -3
  178. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/types.d.ts +31 -2
  179. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/base-adapter.d.ts +1 -3
  180. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/base-adapter.js +3 -7
  181. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/index.cjs +9 -7
  182. package/node_modules/@undefineds.co/ai-connections-core/dist/credential-storage.d.ts +59 -0
  183. package/node_modules/@undefineds.co/ai-connections-core/dist/credential-storage.js +131 -0
  184. package/node_modules/@undefineds.co/ai-connections-core/dist/endpoint-urls.d.ts +15 -0
  185. package/node_modules/@undefineds.co/ai-connections-core/dist/endpoint-urls.js +20 -0
  186. package/node_modules/@undefineds.co/ai-connections-core/dist/index.d.ts +9 -0
  187. package/node_modules/@undefineds.co/ai-connections-core/dist/index.js +9 -0
  188. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/provider-catalog.cjs +68 -24
  189. package/node_modules/@undefineds.co/ai-connections-core/dist/provider-catalog.d.ts +84 -0
  190. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/provider-catalog.js +121 -22
  191. package/node_modules/@undefineds.co/ai-connections-core/package.json +61 -0
  192. package/node_modules/@undefineds.co/extension-sdk/dist/manifest.d.ts +1 -1
  193. package/node_modules/@undefineds.co/extension-sdk/dist/manifest.js +2 -0
  194. package/node_modules/@undefineds.co/extension-sdk/dist/web.d.ts +150 -0
  195. package/node_modules/@undefineds.co/extension-sdk/package.json +2 -1
  196. package/node_modules/@undefineds.co/models/README.md +1 -1
  197. package/node_modules/@undefineds.co/models/dist/ai-config/index.d.ts +3 -3
  198. package/node_modules/@undefineds.co/models/dist/ai-gateway.schema.d.ts +5 -0
  199. package/node_modules/@undefineds.co/models/dist/ai-gateway.schema.js +9 -0
  200. package/node_modules/@undefineds.co/models/dist/ai-runtime.repository.d.ts +1 -1
  201. package/node_modules/@undefineds.co/models/dist/approval.repository.d.ts +2 -2
  202. package/node_modules/@undefineds.co/models/dist/audit.presentation.d.ts +2 -2
  203. package/node_modules/@undefineds.co/models/dist/capture.repository.d.ts +1 -1
  204. package/node_modules/@undefineds.co/models/dist/chat-project.repository.d.ts +1 -1
  205. package/node_modules/@undefineds.co/models/dist/chat.repository.d.ts +2 -2
  206. package/node_modules/@undefineds.co/models/dist/control-request.repository.d.ts +2 -2
  207. package/node_modules/@undefineds.co/models/dist/conversation-share.repository.d.ts +1 -1
  208. package/node_modules/@undefineds.co/models/dist/credential.schema.d.ts +12 -0
  209. package/node_modules/@undefineds.co/models/dist/credential.schema.js +15 -1
  210. package/node_modules/@undefineds.co/models/dist/discovery/index.d.ts +2 -2
  211. package/node_modules/@undefineds.co/models/dist/discovery/providers.json +248 -7
  212. package/node_modules/@undefineds.co/models/dist/discovery/types.d.ts +31 -0
  213. package/node_modules/@undefineds.co/models/dist/extension/index.d.ts +1 -1
  214. package/node_modules/@undefineds.co/models/dist/favorite/index.d.ts +2 -2
  215. package/node_modules/@undefineds.co/models/dist/fixtures/contracts-chat-contact.d.ts +5 -5
  216. package/node_modules/@undefineds.co/models/dist/import/index.d.ts +1 -1
  217. package/node_modules/@undefineds.co/models/dist/index.d.ts +73 -73
  218. package/node_modules/@undefineds.co/models/dist/index.js +1 -1
  219. package/node_modules/@undefineds.co/models/dist/input-request.repository.d.ts +2 -2
  220. package/node_modules/@undefineds.co/models/dist/knowledge/index.d.ts +1 -1
  221. package/node_modules/@undefineds.co/models/dist/message.repository.d.ts +1 -1
  222. package/node_modules/@undefineds.co/models/dist/namespaces.js +5 -0
  223. package/node_modules/@undefineds.co/models/dist/pod-storage-descriptor.d.ts +4815 -26
  224. package/node_modules/@undefineds.co/models/dist/pod-storage-descriptor.js +482 -132
  225. package/node_modules/@undefineds.co/models/dist/schema.d.ts +4 -0
  226. package/node_modules/@undefineds.co/models/dist/session/index.d.ts +1 -1
  227. package/node_modules/@undefineds.co/models/dist/settings/index.d.ts +1 -1
  228. package/node_modules/@undefineds.co/models/dist/sidecar/persistence-mapping.d.ts +5 -5
  229. package/node_modules/@undefineds.co/models/dist/thread.repository.d.ts +2 -2
  230. package/node_modules/@undefineds.co/models/dist/types/message-block.d.ts +1 -1
  231. package/node_modules/@undefineds.co/models/dist/vocab/_namespaces.d.ts +1 -1
  232. package/node_modules/@undefineds.co/models/dist/vocab/index.d.ts +10 -10
  233. package/node_modules/@undefineds.co/models/dist/vocab/sidecar.vocab.d.ts +1 -0
  234. package/node_modules/@undefineds.co/models/dist/vocab/sidecar.vocab.js +1 -0
  235. package/node_modules/@undefineds.co/models/package.json +4 -2
  236. package/node_modules/@undefineds.co/pod-collections/README.md +71 -0
  237. package/node_modules/@undefineds.co/pod-collections/dist/diff.d.ts +85 -0
  238. package/node_modules/@undefineds.co/pod-collections/dist/diff.js +166 -0
  239. package/node_modules/@undefineds.co/pod-collections/dist/feed.d.ts +17 -0
  240. package/node_modules/@undefineds.co/pod-collections/dist/feed.js +27 -0
  241. package/node_modules/@undefineds.co/pod-collections/dist/index.cjs +1042 -0
  242. package/node_modules/@undefineds.co/pod-collections/dist/index.d.ts +37 -0
  243. package/node_modules/@undefineds.co/pod-collections/dist/index.js +89 -0
  244. package/node_modules/@undefineds.co/pod-collections/dist/layout.d.ts +75 -0
  245. package/node_modules/@undefineds.co/pod-collections/dist/layout.js +173 -0
  246. package/node_modules/@undefineds.co/pod-collections/dist/mapping.d.ts +78 -0
  247. package/node_modules/@undefineds.co/pod-collections/dist/mapping.js +287 -0
  248. package/node_modules/@undefineds.co/pod-collections/dist/mutations.d.ts +83 -0
  249. package/node_modules/@undefineds.co/pod-collections/dist/mutations.js +273 -0
  250. package/node_modules/@undefineds.co/pod-collections/dist/react.d.ts +21 -0
  251. package/node_modules/@undefineds.co/pod-collections/dist/react.js +22 -0
  252. package/node_modules/@undefineds.co/pod-collections/dist/read.d.ts +65 -0
  253. package/node_modules/@undefineds.co/pod-collections/dist/read.js +31 -0
  254. package/node_modules/@undefineds.co/pod-collections/dist/sync.d.ts +66 -0
  255. package/node_modules/@undefineds.co/pod-collections/dist/sync.js +260 -0
  256. package/node_modules/@undefineds.co/pod-collections/dist/types.d.ts +155 -0
  257. package/node_modules/@undefineds.co/pod-collections/dist/types.js +9 -0
  258. package/node_modules/@undefineds.co/pod-collections/package.json +42 -0
  259. package/node_modules/@undefineds.co/shared-ui/dist/index.d.ts +4 -2
  260. package/node_modules/@undefineds.co/shared-ui/dist/index.js +4 -2
  261. package/node_modules/@undefineds.co/shared-ui/dist/login/LoginModal.d.ts +4 -1
  262. package/node_modules/@undefineds.co/shared-ui/dist/login/LoginModal.js +12 -6
  263. package/node_modules/@undefineds.co/shared-ui/dist/login/LoginView.d.ts +1 -1
  264. package/node_modules/@undefineds.co/shared-ui/dist/login/host-types.d.ts +7 -1
  265. package/node_modules/@undefineds.co/shared-ui/dist/login/login-branding.d.ts +6 -0
  266. package/node_modules/@undefineds.co/shared-ui/dist/login/login-branding.js +18 -0
  267. package/node_modules/@undefineds.co/shared-ui/dist/user-facing-errors.d.ts +14 -2
  268. package/node_modules/@undefineds.co/shared-ui/dist/user-facing-errors.js +26 -17
  269. package/node_modules/@undefineds.co/solid-sdk/dist/login-store.d.ts +3 -3
  270. package/node_modules/@undefineds.co/solid-sdk/dist/login-store.js +3 -3
  271. package/package.json +17 -7
  272. package/static/app/assets/main.css +1 -1
  273. package/static/auth-callback/assets/AiConfigContext-DlFyEWy9.js +1 -0
  274. package/static/auth-callback/assets/AiConfigPage-CkYk-SFW.js +1 -0
  275. package/static/auth-callback/assets/DocumentProcessingPanel-CqIr3JqN.js +1 -0
  276. package/static/auth-callback/assets/IndexLifecyclePanel-C1GKV3Vx.js +1 -0
  277. package/static/auth-callback/assets/{IndexSubjectPanel-BbUqop4b.js → IndexSubjectPanel-ro9lC6XW.js} +1 -1
  278. package/static/auth-callback/assets/ModelAssignmentsPanel-DxNdyKRJ.js +1 -0
  279. package/static/auth-callback/assets/ModelsPage-BVtWSPBU.js +11 -0
  280. package/static/auth-callback/assets/{NetworkPage-Vp2PrMxs.js → NetworkPage-cEvxRMAl.js} +2 -2
  281. package/static/auth-callback/assets/{PaneListHeader-DY7baSFl.js → PaneListHeader-ByKw8ada.js} +1 -1
  282. package/static/auth-callback/assets/SearchIndexingPanel-CulBKcYT.js +1 -0
  283. package/static/auth-callback/assets/{StatusSubjectPanel-ArIS-TxT.js → StatusSubjectPanel-VOcfrt8o.js} +1 -1
  284. package/static/{settings/assets/StatusWorkspace-CoMFRXoV.js → auth-callback/assets/StatusWorkspace-Jsz6hAdE.js} +1 -1
  285. package/static/auth-callback/assets/{SystemSettingsPage-BDvT1NUz.js → SystemSettingsPage-BFNvGAle.js} +1 -1
  286. package/static/{dashboard/assets/SystemSettingsSubjectPanel-WaE8mTQi.js → auth-callback/assets/SystemSettingsSubjectPanel-DFRdrSfK.js} +5 -5
  287. package/static/auth-callback/assets/XpodAiConnectionsPodStore-C6KpvHVg.js +3 -0
  288. package/static/auth-callback/assets/{activity-D1Dsfa_0.js → activity-DnTlb9iM.js} +1 -1
  289. package/static/auth-callback/assets/ai-connections-C6yaE6WQ.js +1 -0
  290. package/static/auth-callback/assets/auth-callback-Cx9D_1qj.css +1 -0
  291. package/static/auth-callback/assets/{auth-callback-Cmf4hXVZ.js → auth-callback-D2UkK5Xj.js} +6 -6
  292. package/static/auth-callback/assets/{badge-CZsHq3Ih.js → badge-D7IJuuTM.js} +1 -1
  293. package/static/auth-callback/assets/collection-runtime-wT1n4GS2.js +1 -0
  294. package/static/auth-callback/assets/dialog-DickLu5z.js +1 -0
  295. package/static/auth-callback/assets/{download-DU9ntlHw.js → download-kn8WnRu3.js} +1 -1
  296. package/static/auth-callback/assets/{external-link-BfzaaZDx.js → external-link-B6B8jfSn.js} +1 -1
  297. package/static/auth-callback/assets/index-Cu0EguPo.js +4 -0
  298. package/static/auth-callback/assets/index-DHF97YLP.js +41 -0
  299. package/static/auth-callback/assets/index-Dz83EEHD.js +1 -0
  300. package/static/auth-callback/assets/{index-browser-BNFqqC74.js → index-browser-CSghinyi.js} +1 -1
  301. package/static/auth-callback/assets/{key-round-BwP3DBWo.js → key-round-ChkOx3E1.js} +1 -1
  302. package/static/auth-callback/assets/layout-DB3pMyTl.js +1 -0
  303. package/static/auth-callback/assets/pod-collections-host-KnnGFZHL.js +8 -0
  304. package/static/auth-callback/assets/{rotate-ccw-VMwnmyab.js → rotate-ccw-B3hE-nyd.js} +1 -1
  305. package/static/auth-callback/assets/{skeleton-CoD55rBT.js → skeleton-kEqR7tpI.js} +1 -1
  306. package/static/auth-callback/assets/{waypoints-DRo_1Ca7.js → waypoints-D6Jo-SZa.js} +1 -1
  307. package/static/auth-callback/assets/{workspace-layout--mcXl3My.js → workspace-layout-BHwT_cHd.js} +1 -1
  308. package/static/auth-callback/auth-callback.html +2 -2
  309. package/static/dashboard/assets/AiConfigContext-BfC3v-x2.js +1 -0
  310. package/static/dashboard/assets/AiConfigPage-QNS3u7Ff.js +1 -0
  311. package/static/dashboard/assets/DocumentProcessingPanel-Dr4XLeT4.js +1 -0
  312. package/static/dashboard/assets/IndexLifecyclePanel-KtM_gpeO.js +1 -0
  313. package/static/dashboard/assets/{IndexSubjectPanel-B2cXwl8X.js → IndexSubjectPanel-DLaiKdLc.js} +1 -1
  314. package/static/dashboard/assets/ModelAssignmentsPanel-Bk7TvQRq.js +1 -0
  315. package/static/dashboard/assets/ModelsPage-Cci3vlos.js +11 -0
  316. package/static/dashboard/assets/{NetworkPage-DV2V0qWO.js → NetworkPage-Ot4G2dX5.js} +2 -2
  317. package/static/dashboard/assets/{PaneListHeader-D0c1yCFH.js → PaneListHeader-qHME_s08.js} +1 -1
  318. package/static/dashboard/assets/SearchIndexingPanel-HZPKj8H9.js +1 -0
  319. package/static/dashboard/assets/{StatusSubjectPanel-oPSECj7i.js → StatusSubjectPanel-ij7IpI8d.js} +1 -1
  320. package/static/dashboard/assets/{StatusWorkspace-PdovQPKa.js → StatusWorkspace-Cp02JcaN.js} +1 -1
  321. package/static/dashboard/assets/{SystemSettingsPage-CtNDklkx.js → SystemSettingsPage-BSeuvb8X.js} +1 -1
  322. package/static/{settings/assets/SystemSettingsSubjectPanel-DExjDo_v.js → dashboard/assets/SystemSettingsSubjectPanel-CP4_luGS.js} +5 -5
  323. package/static/dashboard/assets/XpodAiConnectionsPodStore-urO6zaHL.js +18 -0
  324. package/static/dashboard/assets/{activity-B9ylSoyr.js → activity-DxjgQNvr.js} +1 -1
  325. package/static/dashboard/assets/ai-connections-CXp5gd1J.js +1 -0
  326. package/static/dashboard/assets/{badge-BNbFbpIb.js → badge-53qCrRbl.js} +1 -1
  327. package/static/dashboard/assets/collection-runtime-BPAmHG46.js +1 -0
  328. package/static/dashboard/assets/{dashboard-CD-FFVRD.js → dashboard-BcT2ByXw.js} +4 -4
  329. package/static/dashboard/assets/dashboard-Cx9D_1qj.css +1 -0
  330. package/static/dashboard/assets/dialog-B28YtNhS.js +1 -0
  331. package/static/dashboard/assets/{download-nOP38LtW.js → download-DkLNceJ4.js} +1 -1
  332. package/static/dashboard/assets/{external-link-Bh2ewN9E.js → external-link-D3TXnlo3.js} +1 -1
  333. package/static/dashboard/assets/index-CFIenkeK.js +41 -0
  334. package/static/dashboard/assets/index-CIiBu9mr.js +1 -0
  335. package/static/dashboard/assets/index-Gp3cLolR.js +4 -0
  336. package/static/dashboard/assets/{key-round-bGmguBLv.js → key-round-B5ccp6nx.js} +1 -1
  337. package/static/dashboard/assets/layout-DB3pMyTl.js +1 -0
  338. package/static/dashboard/assets/pod-collections-host-KnnGFZHL.js +8 -0
  339. package/static/dashboard/assets/{rotate-ccw-D2x__ODW.js → rotate-ccw-DUpfkNnk.js} +1 -1
  340. package/static/dashboard/assets/{skeleton-VOqft8WS.js → skeleton-BRe19fO0.js} +1 -1
  341. package/static/dashboard/assets/{waypoints-fgRqm4oH.js → waypoints-BKDMxEvu.js} +1 -1
  342. package/static/dashboard/assets/{workspace-layout-DV4dgeHX.js → workspace-layout-ZTF7C16h.js} +1 -1
  343. package/static/dashboard/dashboard.html +2 -2
  344. package/static/settings/assets/AiConfigContext-DsyWgu2i.js +1 -0
  345. package/static/settings/assets/AiConfigPage-CSCBckKo.js +1 -0
  346. package/static/settings/assets/DocumentProcessingPanel-w9yQDbBe.js +1 -0
  347. package/static/settings/assets/IndexLifecyclePanel-CUUXI8mP.js +1 -0
  348. package/static/settings/assets/{IndexSubjectPanel-BgbI9c-a.js → IndexSubjectPanel-BypAU5TJ.js} +1 -1
  349. package/static/settings/assets/ModelAssignmentsPanel-BetgXw1G.js +1 -0
  350. package/static/settings/assets/ModelsPage-DZpTlTZ3.js +11 -0
  351. package/static/settings/assets/{NetworkPage-C8OA9Mtp.js → NetworkPage-BVkasFGM.js} +2 -2
  352. package/static/settings/assets/{PaneListHeader-COvlPJWj.js → PaneListHeader-BGOqGec4.js} +1 -1
  353. package/static/settings/assets/SearchIndexingPanel-DYAbpZ_9.js +1 -0
  354. package/static/settings/assets/{StatusSubjectPanel-BuLml7qn.js → StatusSubjectPanel-CFgzeQ8Q.js} +1 -1
  355. package/static/settings/assets/StatusWorkspace-4Z6g4Jvv.js +1 -0
  356. package/static/settings/assets/{SystemSettingsPage-DlzmaWV-.js → SystemSettingsPage-C1tlrgvI.js} +1 -1
  357. package/static/{auth-callback/assets/SystemSettingsSubjectPanel-CDqRuC4t.js → settings/assets/SystemSettingsSubjectPanel-CcURI-1L.js} +5 -5
  358. package/static/settings/assets/XpodAiConnectionsPodStore-owBQc5nY.js +3 -0
  359. package/static/settings/assets/{activity-TLerXgMs.js → activity-CtBc9cNy.js} +1 -1
  360. package/static/settings/assets/ai-connections-C6yaE6WQ.js +1 -0
  361. package/static/settings/assets/{badge-Bcs8iWrH.js → badge--r-FDIhU.js} +1 -1
  362. package/static/settings/assets/collection-runtime-CnhPmwAM.js +1 -0
  363. package/static/settings/assets/dialog-B7ZRsjN7.js +1 -0
  364. package/static/settings/assets/{download-Ct3QmHPt.js → download-DgQ1F8QR.js} +1 -1
  365. package/static/settings/assets/{external-link-C8KiHbss.js → external-link-Bz7NckNO.js} +1 -1
  366. package/static/settings/assets/index-BdXwm8nh.js +4 -0
  367. package/static/settings/assets/index-CkGda_Pg.js +41 -0
  368. package/static/settings/assets/index-Vv-8Vslg.js +1 -0
  369. package/static/settings/assets/{index-browser-CazX1pc2.js → index-browser-Dq7omlpY.js} +1 -1
  370. package/static/settings/assets/{key-round-B19YD1GA.js → key-round-CvuhloKV.js} +1 -1
  371. package/static/settings/assets/layout-DB3pMyTl.js +1 -0
  372. package/static/settings/assets/pod-collections-host-KnnGFZHL.js +8 -0
  373. package/static/settings/assets/{rotate-ccw-AQm2kMgU.js → rotate-ccw-DgFKDaz7.js} +1 -1
  374. package/static/settings/assets/{settings-C-VBtt9r.js → settings-BvqY7K96.js} +5 -5
  375. package/static/settings/assets/settings-Cx9D_1qj.css +1 -0
  376. package/static/settings/assets/{skeleton-DyZ1OBYf.js → skeleton-D3OeFDF6.js} +1 -1
  377. package/static/settings/assets/{waypoints-CC3wq-SU.js → waypoints-C4WbspTb.js} +1 -1
  378. package/static/settings/assets/{workspace-layout-BxXNKgf9.js → workspace-layout-B9H1Tqrk.js} +1 -1
  379. package/static/settings/settings.html +2 -2
  380. package/node_modules/@undefineds.co/ai-connections/dist/ai-connections-client.js +0 -13
  381. package/node_modules/@undefineds.co/ai-connections/dist/provider-catalog.d.ts +0 -9
  382. package/static/auth-callback/assets/AiConfigContext-DqWRSm7n.js +0 -1
  383. package/static/auth-callback/assets/AiConfigPage-C5YYyvzl.js +0 -1
  384. package/static/auth-callback/assets/DocumentProcessingPanel-DZCiacBz.js +0 -1
  385. package/static/auth-callback/assets/IndexLifecyclePanel-CCLeOljB.js +0 -1
  386. package/static/auth-callback/assets/ModelAssignmentsPanel-jUUTDKuh.js +0 -1
  387. package/static/auth-callback/assets/ModelsPage-B08zdtff.js +0 -10
  388. package/static/auth-callback/assets/SearchIndexingPanel-D4YRg1-8.js +0 -1
  389. package/static/auth-callback/assets/StatusWorkspace-Cp5LQ9Yx.js +0 -1
  390. package/static/auth-callback/assets/ai-connections-CHNTKemd.js +0 -1
  391. package/static/auth-callback/assets/auth-callback-DWMMiFjh.css +0 -1
  392. package/static/auth-callback/assets/index-DSNnLUbU.js +0 -4
  393. package/static/auth-callback/assets/index-FHhHoKgp.js +0 -41
  394. package/static/dashboard/assets/AiConfigContext-BpPDKSzI.js +0 -1
  395. package/static/dashboard/assets/AiConfigPage-wsqEZDIX.js +0 -1
  396. package/static/dashboard/assets/DocumentProcessingPanel-CDSy3juc.js +0 -1
  397. package/static/dashboard/assets/IndexLifecyclePanel-CVd6vQCX.js +0 -1
  398. package/static/dashboard/assets/ModelAssignmentsPanel-BeBZhnQd.js +0 -1
  399. package/static/dashboard/assets/ModelsPage-B6McSCJw.js +0 -25
  400. package/static/dashboard/assets/SearchIndexingPanel-CGs0OZ12.js +0 -1
  401. package/static/dashboard/assets/ai-connections-CHNTKemd.js +0 -1
  402. package/static/dashboard/assets/dashboard-DWMMiFjh.css +0 -1
  403. package/static/dashboard/assets/index-PgS-Bt7X.js +0 -41
  404. package/static/dashboard/assets/index-QN2QgEwr.js +0 -4
  405. package/static/settings/assets/AiConfigContext-zKQYdfai.js +0 -1
  406. package/static/settings/assets/AiConfigPage-Bs1EE3Ei.js +0 -1
  407. package/static/settings/assets/DocumentProcessingPanel-CSFfdOXS.js +0 -1
  408. package/static/settings/assets/IndexLifecyclePanel-BR9Su49B.js +0 -1
  409. package/static/settings/assets/ModelAssignmentsPanel-C0BE7nbk.js +0 -1
  410. package/static/settings/assets/ModelsPage-CU-YQ8_7.js +0 -10
  411. package/static/settings/assets/SearchIndexingPanel-Bdd46mIV.js +0 -1
  412. package/static/settings/assets/ai-connections-CHNTKemd.js +0 -1
  413. package/static/settings/assets/index-1Q2cRjZd.js +0 -41
  414. package/static/settings/assets/index-DBO_Vq0P.js +0 -4
  415. package/static/settings/assets/settings-DWMMiFjh.css +0 -1
  416. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/request.d.ts +0 -0
  417. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/types.js +0 -0
  418. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/codex.d.ts +0 -0
  419. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/codex.js +0 -0
  420. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/index.d.ts +0 -0
  421. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/index.js +0 -0
  422. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/json-env-adapter.d.ts +0 -0
  423. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/json-env-adapter.js +0 -0
  424. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/pi.d.ts +0 -0
  425. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/pi.js +0 -0
  426. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/transaction.d.ts +0 -0
  427. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/transaction.js +0 -0
  428. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/types.d.ts +0 -0
  429. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/types.js +0 -0
@@ -8,7 +8,6 @@ import type { AiConnectAttempt, AiConnectionsCredential, AiConnectionsProvider,
8
8
  * within this module family. The published surface is the explicit list in
9
9
  * `ai-connections-client.ts`, not this file.
10
10
  */
11
- export declare const AI_CONNECTIONS_GENERIC_ERROR_MESSAGE = "AI Connection request failed. Please try again.";
12
11
  /**
13
12
  * Validate and normalize a user supplied upstream proxy URL. Proxy credentials
14
13
  * are intentionally rejected because proxy auth is not stored in the Pod
@@ -16,16 +15,27 @@ export declare const AI_CONNECTIONS_GENERIC_ERROR_MESSAGE = "AI Connection reque
16
15
  */
17
16
  export declare function normalizeProxyUrl(value: string | undefined | null): string | undefined;
18
17
  export declare function redactProxyUrl(value: string | undefined | null): string | undefined;
18
+ /**
19
+ * A failed AI Connection request.
20
+ *
21
+ * It carries the facts a caller needs to decide what to say - the wire code, the
22
+ * upstream status, the payload itself - and a diagnostic message that names the
23
+ * code. The sentence a user reads is the applet's (`error-wording.ts`): a shared
24
+ * client must not pick the wording for whoever happens to render it.
25
+ */
19
26
  export declare class AiConnectionsRequestError extends Error {
20
27
  readonly code?: string;
28
+ readonly status: number;
21
29
  readonly providerStatus?: number;
22
- constructor(message: string, payload: unknown);
30
+ readonly payload: unknown;
31
+ readonly provider?: string;
32
+ readonly authMode?: string;
33
+ constructor(payload: unknown, status: number, context?: {
34
+ provider?: string;
35
+ authMode?: string;
36
+ });
23
37
  }
24
- export declare function normalizeAiConnectionsThrownError(error: unknown): string;
25
- export declare function normalizeAiConnectionsErrorMessage(payload: unknown, status: number, context?: {
26
- provider?: AiConnectionsProvider;
27
- authMode?: 'apiKey' | 'deviceCodeOAuth' | 'local';
28
- }): string;
38
+ export declare function aiConnectionsErrorCode(payload: unknown): string | undefined;
29
39
  export declare function readJson(response: Response): Promise<unknown>;
30
40
  export declare function assertProvider(provider: string): asserts provider is AiConnectionsProvider;
31
41
  export declare function parseGatewayKeyRecord(value: unknown): GatewayKeyRecord | undefined;
@@ -8,7 +8,6 @@ import { AI_CONNECTIONS_PROVIDERS } from './types.js';
8
8
  * within this module family. The published surface is the explicit list in
9
9
  * `ai-connections-client.ts`, not this file.
10
10
  */
11
- export const AI_CONNECTIONS_GENERIC_ERROR_MESSAGE = 'AI Connection request failed. Please try again.';
12
11
  /**
13
12
  * Validate and normalize a user supplied upstream proxy URL. Proxy credentials
14
13
  * are intentionally rejected because proxy auth is not stored in the Pod
@@ -49,109 +48,29 @@ export function redactProxyUrl(value) {
49
48
  parsed.hash = '';
50
49
  return parsed.href.replace(/\/$/u, '');
51
50
  }
51
+ /**
52
+ * A failed AI Connection request.
53
+ *
54
+ * It carries the facts a caller needs to decide what to say - the wire code, the
55
+ * upstream status, the payload itself - and a diagnostic message that names the
56
+ * code. The sentence a user reads is the applet's (`error-wording.ts`): a shared
57
+ * client must not pick the wording for whoever happens to render it.
58
+ */
52
59
  export class AiConnectionsRequestError extends Error {
53
- constructor(message, payload) {
54
- super(message);
60
+ constructor(payload, status, context = {}) {
61
+ const code = aiConnectionsErrorCode(payload);
62
+ super(code ? `AI Connection request failed: ${code}` : `AI Connection request failed (HTTP ${status})`);
55
63
  this.name = 'AiConnectionsRequestError';
56
- this.code = errorCodeFromPayload(payload);
64
+ this.code = code;
65
+ this.status = status;
57
66
  this.providerStatus = isRecord(payload) && typeof payload.providerStatus === 'number'
58
67
  ? payload.providerStatus : undefined;
68
+ this.payload = payload;
69
+ this.provider = context.provider;
70
+ this.authMode = context.authMode;
59
71
  }
60
72
  }
61
- export function normalizeAiConnectionsThrownError(error) {
62
- if (error instanceof Error) {
63
- return normalizeAiConnectionsErrorText(error.message);
64
- }
65
- return normalizeAiConnectionsErrorText(String(error));
66
- }
67
- export function normalizeAiConnectionsErrorMessage(payload, status, context = {}) {
68
- const code = errorCodeFromPayload(payload);
69
- if (code === 'provider_models_response_error') {
70
- const message = isRecord(payload) && typeof payload.message === 'string'
71
- ? sanitizeProviderResponseMessage(payload.message)
72
- : undefined;
73
- if (message)
74
- return message;
75
- return '模型列表获取失败。请检查密钥、服务地址或网络后重试。';
76
- }
77
- if (code === 'provider_models_fetch_failed') {
78
- const providerStatus = isRecord(payload) && typeof payload.providerStatus === 'number'
79
- ? payload.providerStatus
80
- : undefined;
81
- const providerMessage = isRecord(payload) && typeof payload.providerMessage === 'string'
82
- ? payload.providerMessage.trim()
83
- : undefined;
84
- return withProviderMessage(modelDiscoveryErrorMessage(providerStatus, context.authMode), providerMessage);
85
- }
86
- const coded = code ? messageForSafeErrorCode(code, context.provider) : undefined;
87
- if (coded)
88
- return coded;
89
- const text = isRecord(payload) && typeof payload.error === 'string'
90
- ? payload.error
91
- : undefined;
92
- if (text) {
93
- const exact = messageForSafeErrorCode(text, context.provider);
94
- if (exact)
95
- return exact;
96
- if (text === 'AI Connection service identity is unavailable') {
97
- return text;
98
- }
99
- if (text === 'Provider credential not found for current identity') {
100
- return '当前身份没有可用的额度凭证。';
101
- }
102
- if (text === 'Provider quota adapter not found' || text === 'Provider quota lookup failed') {
103
- return '该接入方式不支持查询官方额度。';
104
- }
105
- }
106
- if (status === 401)
107
- return 'Please sign in again to continue.';
108
- if (status === 403)
109
- return 'AI Connection permission was denied.';
110
- if (status === 404 && context.provider) {
111
- return `${providerLabel(context.provider)} connection is not configured.`;
112
- }
113
- if (status === 429)
114
- return 'AI Connection is rate limited. Please try again later.';
115
- if (status === 503)
116
- return 'AI Connection service is unavailable.';
117
- return AI_CONNECTIONS_GENERIC_ERROR_MESSAGE;
118
- }
119
- const LOCAL_SESSION_REFRESH_FAILED_MESSAGE = '订阅登录态自动刷新失败,请稍后重试。';
120
- const LOCAL_SESSION_REAUTH_REQUIRED_MESSAGE = '订阅登录态已失效,请在原客户端重新登录后重读,或使用设备码登录。';
121
- const OAUTH_MODEL_AUTH_FAILED_MESSAGE = '订阅登录态不可用,请重读登录态或重新登录后再同步模型。';
122
- const MODEL_DISCOVERY_SAFE_MESSAGES = new Set([
123
- OAUTH_MODEL_AUTH_FAILED_MESSAGE,
124
- LOCAL_SESSION_REFRESH_FAILED_MESSAGE,
125
- LOCAL_SESSION_REAUTH_REQUIRED_MESSAGE,
126
- '密钥不可用。请检查密钥是否填写正确,或换一个密钥后重试。',
127
- '模型服务地址不正确。请检查服务地址后重试。',
128
- '请求太频繁。请稍等一会儿再试。',
129
- '模型服务暂时没有响应。请稍后重试。',
130
- '模型列表获取失败。请检查密钥、服务地址或网络后重试。',
131
- ]);
132
- function normalizeAiConnectionsErrorText(message) {
133
- if (message.startsWith('provider_models_response_error:')) {
134
- return sanitizeProviderResponseMessage(message.slice('provider_models_response_error:'.length))
135
- ?? '模型列表获取失败。请检查密钥、服务地址或网络后重试。';
136
- }
137
- const exact = messageForSafeErrorCode(message);
138
- if (exact)
139
- return exact;
140
- const prefix = message.split(':', 1)[0]?.trim();
141
- const prefixed = prefix ? messageForSafeErrorCode(prefix) : undefined;
142
- if (prefixed)
143
- return prefixed;
144
- if (message === 'AI Connection service identity is unavailable')
145
- return message;
146
- if (MODEL_DISCOVERY_SAFE_MESSAGES.has(message))
147
- return message;
148
- if (isModelDiscoveryMessageWithProviderDetail(message))
149
- return message;
150
- if (message.startsWith('invalid_'))
151
- return 'AI Connection returned an invalid response.';
152
- return AI_CONNECTIONS_GENERIC_ERROR_MESSAGE;
153
- }
154
- function errorCodeFromPayload(payload) {
73
+ export function aiConnectionsErrorCode(payload) {
155
74
  if (!isRecord(payload))
156
75
  return undefined;
157
76
  if (typeof payload.code === 'string')
@@ -163,107 +82,6 @@ function errorCodeFromPayload(payload) {
163
82
  }
164
83
  return undefined;
165
84
  }
166
- function messageForSafeErrorCode(code, provider) {
167
- switch (code.trim().toLowerCase().replace(/-/g, '_')) {
168
- case 'not_configured':
169
- case 'notconfigured':
170
- return provider
171
- ? `${providerLabel(provider)} connection is not configured.`
172
- : 'AI provider connection is not configured.';
173
- case 'unsupported':
174
- return provider
175
- ? `${providerLabel(provider)} does not support this operation.`
176
- : 'This AI Connection operation is not supported.';
177
- case 'service_identity_unavailable':
178
- return 'AI Connection service identity is unavailable';
179
- case 'unauthorized':
180
- return 'Please sign in again to continue.';
181
- case 'forbidden':
182
- case 'permission_denied':
183
- return 'AI Connection permission was denied.';
184
- case 'rate_limited':
185
- return 'AI Connection is rate limited. Please try again later.';
186
- case 'service_unavailable':
187
- return 'AI Connection service is unavailable.';
188
- case 'unsafe_provider_base_url':
189
- return '该服务地址指向 Xpod 不允许访问的网络,请改用公网 HTTPS 地址。';
190
- case 'invalid_proxy_url':
191
- return '代理地址必须是无账号密码的 HTTP 或 HTTPS 地址。';
192
- case 'oauth_refresh_failed':
193
- case 'oauth_refresh_unavailable':
194
- case 'local_session_refresh_failed':
195
- return LOCAL_SESSION_REFRESH_FAILED_MESSAGE;
196
- case 'oauth_session_reauth_required':
197
- case 'oauth_refresh_token_required':
198
- case 'local_session_reauth_required':
199
- case 'local_session_missing_refresh_token':
200
- return LOCAL_SESSION_REAUTH_REQUIRED_MESSAGE;
201
- case 'models_persistence_failed':
202
- return '模型已获取,但保存到 Pod 失败。请重试同步模型。';
203
- case 'quota_credential_not_found':
204
- return '当前身份没有可用的额度凭证。';
205
- case 'credential_secret_unavailable':
206
- return '当前凭证密钥不可用,请重新保存后再查询额度。';
207
- case 'gateway_api_key_plaintext_unavailable':
208
- return 'Pod 中未找到此 API Key 的原文,无法复制配置。请创建新的 Key,更新客户端后再删除旧 Key。';
209
- case 'quota_adapter_not_found':
210
- return '该接入方式不支持查询官方额度。';
211
- default:
212
- return undefined;
213
- }
214
- }
215
- function modelDiscoveryErrorMessage(providerStatus, authMode) {
216
- if (providerStatus === 401 || providerStatus === 403) {
217
- if (authMode === 'deviceCodeOAuth')
218
- return OAUTH_MODEL_AUTH_FAILED_MESSAGE;
219
- return '密钥不可用。请检查密钥是否填写正确,或换一个密钥后重试。';
220
- }
221
- if (providerStatus === 404) {
222
- return '模型服务地址不正确。请检查服务地址后重试。';
223
- }
224
- if (providerStatus === 429) {
225
- return '请求太频繁。请稍等一会儿再试。';
226
- }
227
- if (providerStatus !== undefined && providerStatus >= 500) {
228
- return '模型服务暂时没有响应。请稍后重试。';
229
- }
230
- return '模型列表获取失败。请检查密钥、服务地址或网络后重试。';
231
- }
232
- function withProviderMessage(message, providerMessage) {
233
- const sanitized = providerMessage ? sanitizeProviderResponseMessage(providerMessage) : undefined;
234
- if (!sanitized)
235
- return message;
236
- return `${message} 上游返回:${sanitized}`;
237
- }
238
- function isModelDiscoveryMessageWithProviderDetail(message) {
239
- const marker = ' 上游返回:';
240
- const index = message.indexOf(marker);
241
- if (index <= 0)
242
- return false;
243
- return MODEL_DISCOVERY_SAFE_MESSAGES.has(message.slice(0, index));
244
- }
245
- function sanitizeProviderResponseMessage(value) {
246
- const sanitized = value
247
- .replace(/[\u0000-\u001f\u007f]/gu, ' ')
248
- .replace(/\bBearer\s+[^\s,;]+/giu, 'Bearer [REDACTED]')
249
- .replace(/(?:sk|id)[._-][A-Za-z0-9._-]{8,}/gu, '[REDACTED]')
250
- .replace(/https?:\/\/[^\s]+/giu, '[URL]')
251
- .trim()
252
- .slice(0, 240);
253
- return sanitized || undefined;
254
- }
255
- function providerLabel(provider) {
256
- switch (provider) {
257
- case 'openai': return 'OpenAI';
258
- case 'anthropic': return 'Anthropic';
259
- case 'kimi': return 'Kimi';
260
- case 'bailian': return 'Bailian';
261
- case 'deepseek': return 'DeepSeek';
262
- case 'zhipu': return 'Zhipu';
263
- case 'ollama': return 'Ollama';
264
- case 'custom': return 'Custom';
265
- }
266
- }
267
85
  export async function readJson(response) {
268
86
  const text = await response.text();
269
87
  if (!text)
@@ -386,10 +204,21 @@ function modelCapabilitiesFromWire(value) {
386
204
  const capabilities = [];
387
205
  if (value.capabilities.imageInput === true)
388
206
  capabilities.push('image');
207
+ // Only what a model can do for the caller earns a mark. `parallelToolCalls`
208
+ // refines tool calling and `promptCaching` is a transport optimisation, so
209
+ // neither becomes a marker of its own.
389
210
  if (value.capabilities.toolCalls === true)
390
211
  capabilities.push('tool_call');
391
212
  if (value.capabilities.reasoningEffort === true)
392
213
  capabilities.push('reasoning');
214
+ // A curated tier marker, not a measurement: the catalog has no latency data,
215
+ // so a model is only "fast" because the catalog says so.
216
+ if (value.capabilities.fast === true)
217
+ capabilities.push('fast');
218
+ // Catalog-provided embedding models carry the capability as an object flag, the
219
+ // same way the AI Config embedding assignment reads them.
220
+ if (value.capabilities.embedding === true)
221
+ capabilities.push('embedding');
393
222
  return capabilities.length > 0 ? capabilities : undefined;
394
223
  }
395
224
  function isPlatformModelId(modelId) {
@@ -524,7 +353,7 @@ function parseAuthorizationMethod(value) {
524
353
  id: value.id,
525
354
  authMode,
526
355
  connectMode,
527
- label: stringValue(value.label) ?? authorizationMethodFallbackLabel(value.id, authMode),
356
+ label: stringValue(value.label),
528
357
  lifecycle,
529
358
  reason: stringValue(value.reason),
530
359
  });
@@ -532,19 +361,6 @@ function parseAuthorizationMethod(value) {
532
361
  function authorizationMethodLifecycleValue(value) {
533
362
  return value === 'active' || value === 'unavailable' ? value : undefined;
534
363
  }
535
- function authorizationMethodFallbackLabel(id, authMode) {
536
- if (id === 'device-code')
537
- return '设备码登录';
538
- if (id === 'local-session-import')
539
- return '已有登录态';
540
- if (id === 'local-service')
541
- return '本地服务';
542
- if (id === 'api-key' || authMode === 'apiKey')
543
- return 'API Key';
544
- if (authMode === 'local')
545
- return '本地服务';
546
- return '浏览器登录';
547
- }
548
364
  function offeringLifecycleValue(value) {
549
365
  return value === 'active' || value === 'legacy' || value === 'unavailable'
550
366
  ? value
@@ -835,12 +651,18 @@ export function parseModelDiscovery(value, expectedProvider) {
835
651
  .map((item) => {
836
652
  if (!isRecord(item) || typeof item.id !== 'string' || !item.id)
837
653
  return undefined;
654
+ const capabilities = Array.isArray(item.capabilities)
655
+ ? item.capabilities.filter((cap) => typeof cap === 'string')
656
+ : undefined;
657
+ const modelType = discoveredModelType(item.modelType);
838
658
  return compactObject({
839
659
  id: item.id,
840
660
  displayName: stringValue(item.displayName),
841
- capabilities: Array.isArray(item.capabilities)
842
- ? item.capabilities.filter((cap) => typeof cap === 'string')
843
- : undefined,
661
+ // A provider that declares capabilities sends them; otherwise the type
662
+ // is the only evidence a row has, and an embedding model without it is
663
+ // listed as if it were a chat model.
664
+ capabilities: capabilities ?? (modelType === 'embedding' ? ['embedding'] : undefined),
665
+ modelType,
844
666
  });
845
667
  })
846
668
  .filter(isDefined);
@@ -855,6 +677,16 @@ export function parseModelDiscovery(value, expectedProvider) {
855
677
  export function compactObject(value) {
856
678
  return Object.fromEntries(Object.entries(value).filter(([, item]) => item !== undefined));
857
679
  }
680
+ /**
681
+ * Only the two classes the Pod stores survive the wire.
682
+ *
683
+ * A server that sends anything else (an older release, a provider's own
684
+ * vocabulary) leaves the row untyped, which reads as a chat model - never as a
685
+ * value the AI config write would reject.
686
+ */
687
+ function discoveredModelType(value) {
688
+ return value === 'chat' || value === 'embedding' ? value : undefined;
689
+ }
858
690
  function stringValue(value) {
859
691
  return typeof value === 'string' ? value : undefined;
860
692
  }
@@ -1,4 +1,4 @@
1
- import { AiConnectionsRequestError, assertProvider, compactObject, isDefined, isRecord, normalizeAiConnectionsErrorMessage, parseAuthorizationMethodsSummary, parseConnectAttempt, parseCredential, parseCustomModelList, parseGatewayKeyRecord, parseGatewayModel, parseModelDiscovery, parseProviderCredentialSummary, parseProviderSummaries, readJson, sanitizePublicObject, } from './normalize.js';
1
+ import { AiConnectionsRequestError, assertProvider, compactObject, isDefined, isRecord, parseAuthorizationMethodsSummary, parseConnectAttempt, parseCredential, parseCustomModelList, parseGatewayKeyRecord, parseGatewayModel, parseModelDiscovery, parseProviderCredentialSummary, parseProviderSummaries, readJson, sanitizePublicObject, } from './normalize.js';
2
2
  /**
3
3
  * The HTTP client itself: one factory over the Pod base URL and an authenticated
4
4
  * fetch, with every response normalised by `normalize.ts`.
@@ -25,7 +25,7 @@ export function createAiConnectionsClient({ webId, podBaseUrl, authenticatedFetc
25
25
  });
26
26
  const payload = await readJson(response);
27
27
  if (!response.ok) {
28
- throw new AiConnectionsRequestError(normalizeAiConnectionsErrorMessage(payload, response.status, context), payload);
28
+ throw new AiConnectionsRequestError(payload, response.status, context);
29
29
  }
30
30
  return payload;
31
31
  };
@@ -64,7 +64,7 @@ export function createAiConnectionsClient({ webId, podBaseUrl, authenticatedFetc
64
64
  return [];
65
65
  const payload = await readJson(response);
66
66
  if (!response.ok) {
67
- throw new Error(normalizeAiConnectionsErrorMessage(payload, response.status));
67
+ throw new AiConnectionsRequestError(payload, response.status);
68
68
  }
69
69
  return isRecord(payload) && Array.isArray(payload.data)
70
70
  ? payload.data.map(parseAuthorizationMethodsSummary).filter(isDefined)
@@ -85,6 +85,13 @@ export interface CreatedGatewayKey {
85
85
  }
86
86
  export interface AiGatewayModel extends AiConnectionsModelSelection {
87
87
  provider: AiConnectionsProvider;
88
+ /**
89
+ * What kind of model this row is, when the Pod or the provider catalog knows.
90
+ *
91
+ * Rows read from the Pod carry it as their own column; the settings list shows
92
+ * it as the same capability mark the Gateway projection uses.
93
+ */
94
+ modelType?: DiscoveredProviderModelType;
88
95
  /** Owning credential for providers that allow multiple independent custom endpoints. */
89
96
  credentialId?: string;
90
97
  displayName?: string;
@@ -96,10 +103,21 @@ export interface AiGatewayModel extends AiConnectionsModelSelection {
96
103
  outputModalities?: string[];
97
104
  capabilities?: string[];
98
105
  }
106
+ /**
107
+ * What the provider's own model list said a model is.
108
+ *
109
+ * Two values only, because that is the distinction the product acts on and the
110
+ * only one the Pod can store: the server infers it
111
+ * (`ProviderModelType.inferProviderModelType`) and the Pod row keeps it, so an
112
+ * embedding model stays selectable for embedding instead of being stored as an
113
+ * ordinary chat model.
114
+ */
115
+ export type DiscoveredProviderModelType = 'chat' | 'embedding';
99
116
  export interface DiscoveredProviderModel {
100
117
  id: string;
101
118
  displayName?: string;
102
119
  capabilities?: string[];
120
+ modelType?: DiscoveredProviderModelType;
103
121
  }
104
122
  export interface CustomProviderModel {
105
123
  id: string;
@@ -117,12 +135,23 @@ export interface ProviderModelDiscovery {
117
135
  observedAt: string;
118
136
  source: string;
119
137
  }
120
- export type AiProviderAuthorizationMethodId = 'device-code' | 'local-session-import' | 'api-key' | 'local-service' | string;
138
+ export type AiProviderAuthorizationMethodId = 'device-code' | 'local-session-import' | 'api-key' | 'local-service'
139
+ /** Opens the provider console to sign in and mint the key the entry then stores. */
140
+ | 'browser-login'
141
+ /** Starts an authorization-code browser sign-in and waits for the local callback. */
142
+ | 'browser-oauth' | string;
121
143
  export interface AiProviderAuthorizationMethod {
122
144
  id: AiProviderAuthorizationMethodId;
123
145
  authMode: 'oauth' | 'deviceCode' | 'local' | 'apiKey';
124
146
  connectMode?: AiConnectionsMode;
125
- label: string;
147
+ /**
148
+ * The wording the entry is shown under. Optional on purpose: the shared core
149
+ * names the action by `id` and the applet supplies the wording, so a payload
150
+ * carrying none is still a complete contract. A provider the user configured
151
+ * may declare its own wording here, which is what keeps a custom entry from
152
+ * rendering under a built-in name.
153
+ */
154
+ label?: string;
126
155
  lifecycle: 'active' | 'unavailable';
127
156
  reason?: string;
128
157
  }
@@ -20,8 +20,7 @@ interface OwnershipState {
20
20
  export declare function hashWebId(webId: string): string;
21
21
  declare function contentHash(value: string): string;
22
22
  export declare const contentFingerprint: typeof contentHash;
23
- export declare function normalizeV1Endpoint(endpoint: string): string;
24
- export declare function normalizeMessagesEndpoint(endpoint: string): string;
23
+ export { normalizeMessagesEndpoint, normalizeV1Endpoint } from '../endpoint-urls';
25
24
  export declare function parseJsonObject(content: string | undefined, label: string): Record<string, unknown>;
26
25
  export declare function stringifyJson(value: unknown): string;
27
26
  export declare function looksLikePreviousXpodValue(value: unknown): boolean;
@@ -68,4 +67,3 @@ export declare abstract class BaseAiClientConfigAdapter implements AiClientConfi
68
67
  private exists;
69
68
  private isExecutableOnPath;
70
69
  }
71
- export {};
@@ -17,13 +17,9 @@ function contentHash(value) {
17
17
  return crypto.createHash('sha256').update(value, 'utf8').digest('hex');
18
18
  }
19
19
  export const contentFingerprint = contentHash;
20
- export function normalizeV1Endpoint(endpoint) {
21
- const normalized = endpoint.trim().replace(/\/+$/, '');
22
- return normalized.endsWith('/v1') ? normalized : `${normalized}/v1`;
23
- }
24
- export function normalizeMessagesEndpoint(endpoint) {
25
- return endpoint.trim().replace(/\/+$/, '').replace(/\/v1$/, '');
26
- }
20
+ // The base-URL rules are shared with the UI (see src/endpoint-urls.ts); they are
21
+ // re-exported here so adapters keep importing them from one place.
22
+ export { normalizeMessagesEndpoint, normalizeV1Endpoint } from '../endpoint-urls.js';
27
23
  export function parseJsonObject(content, label) {
28
24
  if (!content?.trim())
29
25
  return {};
@@ -269,6 +269,15 @@ class AiClientConfigTransaction {
269
269
  }
270
270
  }
271
271
 
272
+ // src/endpoint-urls.ts
273
+ function normalizeV1Endpoint(endpoint) {
274
+ const normalized = endpoint.trim().replace(/\/+$/, "");
275
+ return normalized.endsWith("/v1") ? normalized : `${normalized}/v1`;
276
+ }
277
+ function normalizeMessagesEndpoint(endpoint) {
278
+ return endpoint.trim().replace(/\/+$/, "").replace(/\/v1$/, "");
279
+ }
280
+
272
281
  // src/client-config/base-adapter.ts
273
282
  class AiClientConfigError extends Error {
274
283
  code;
@@ -285,13 +294,6 @@ function contentHash(value) {
285
294
  return crypto2.createHash("sha256").update(value, "utf8").digest("hex");
286
295
  }
287
296
  var contentFingerprint = contentHash;
288
- function normalizeV1Endpoint(endpoint) {
289
- const normalized = endpoint.trim().replace(/\/+$/, "");
290
- return normalized.endsWith("/v1") ? normalized : `${normalized}/v1`;
291
- }
292
- function normalizeMessagesEndpoint(endpoint) {
293
- return endpoint.trim().replace(/\/+$/, "").replace(/\/v1$/, "");
294
- }
295
297
  function parseJsonObject(content, label) {
296
298
  if (!content?.trim())
297
299
  return {};
@@ -0,0 +1,59 @@
1
+ export interface CredentialSecretEnvelopeInput {
2
+ webId: string;
3
+ provider: string;
4
+ /** The credential's resource IRI (`credentialResource.buildIri(podUrl, { id })`). */
5
+ credentialIri: string;
6
+ secret: Record<string, unknown>;
7
+ }
8
+ /**
9
+ * The `encryptedSecret` payload for a credential row.
10
+ *
11
+ * `PLAINTEXT` means "not encrypted at rest yet", not "no envelope": the read
12
+ * side verifies the envelope's owner (`webId`), provider and credential IRI
13
+ * before handing the secret to a provider request, so a row copied between
14
+ * credentials (or between accounts) never yields a usable secret.
15
+ */
16
+ export declare function credentialSecretEnvelope(input: CredentialSecretEnvelopeInput): string;
17
+ export interface CredentialSecretReadInput {
18
+ webId: string;
19
+ provider: string;
20
+ credentialIri: string;
21
+ envelope: unknown;
22
+ }
23
+ /** `undefined` unless the envelope belongs to this account, provider and credential. */
24
+ export declare function decodeCredentialSecret(input: CredentialSecretReadInput): Record<string, unknown> | undefined;
25
+ /**
26
+ * The provider relation a catalog credential declares (`provider`):
27
+ * `providers/openai.ttl` in resource terms, `openai.ttl` as the stored value.
28
+ *
29
+ * A custom instance owns its own provider document, so there the relation is
30
+ * derived from the credential's own id.
31
+ */
32
+ export declare function credentialProviderRelation(provider: string): string;
33
+ export declare function customCredentialProviderRelation(credentialId: string): string;
34
+ /**
35
+ * The row key of a new credential: the `{id}` slot of the descriptor's
36
+ * `resourceIdPattern`, which is the credential's identity (never a display
37
+ * name).
38
+ *
39
+ * Two writers create credential rows - `XpodAiConnectionsPodStore` for a plain
40
+ * page, and the collection layer when a live collection creates the row
41
+ * optimistically - and a row key that differed between them would produce two
42
+ * credentials where the user asked for one, so the shape is declared once here.
43
+ */
44
+ export declare function credentialRowKeyFor(provider: string, authMode: 'apiKey' | 'local'): string;
45
+ /**
46
+ * The provider a credential row key declares, for rows whose `provider` relation
47
+ * is missing: a credential is keyed `<provider>-<uuid>` (see
48
+ * {@link credentialRowKeyFor}), and a custom instance is keyed `custom-…`.
49
+ *
50
+ * A key reaches us in either of two shapes - the bare `resourceIdPattern` slot
51
+ * (`openai-<uuid>`) or a full resource id (`custom-instance-abc.ttl#this`). The
52
+ * provider lives in the document segment in both, never in the fragment, so the
53
+ * fragment must not be the part that gets inspected.
54
+ */
55
+ export declare function providerOfCredentialKey(key: string): string | undefined;
56
+ /** `providers/openai.ttl#this` → `openai.ttl#this` (document-relative reference). */
57
+ export declare function providerResourceReference(value: string | undefined): string | undefined;
58
+ /** `providers/openai.ttl#this` → `openai` (the document name minus `.ttl`). */
59
+ export declare function providerResourceKey(value: string | undefined): string | undefined;