@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
@@ -0,0 +1,24 @@
1
+ import type { AiConnectionsClient, AiConnectionsProvider } from '@undefineds.co/ai-connections-core/client';
2
+ /**
3
+ * The sentence to show for anything a request threw.
4
+ *
5
+ * A failed request carries the facts - the wire code, the upstream status, the
6
+ * request's provider and auth mode - so the sentence is chosen from those rather
7
+ * than parsed back out of a message. Anything that is not a request failure (a
8
+ * thrown string, an unexpected `Error`) still goes through the sanitiser, which
9
+ * is what keeps internals off the screen.
10
+ */
11
+ export declare function aiConnectionsErrorMessage(error: unknown): string;
12
+ export declare function aiConnectionsErrorMessageForPayload(payload: unknown, status: number, context?: {
13
+ provider?: AiConnectionsProvider;
14
+ authMode?: 'apiKey' | 'deviceCodeOAuth' | 'local';
15
+ }): string;
16
+ /**
17
+ * The shared client reports a failure by naming its code; the sentence a user
18
+ * reads is the applet's (`error-wording`). This app renders messages straight
19
+ * from the thrown error, so it relabels them once, at its own boundary, instead
20
+ * of letting a code reach the screen or teaching every call site to translate.
21
+ * The error object itself is rethrown unchanged, so callers that inspect it -
22
+ * `instanceof`, `code`, `providerStatus` - keep working.
23
+ */
24
+ export declare function withDisplayableErrors(client: AiConnectionsClient): AiConnectionsClient;
@@ -0,0 +1,253 @@
1
+ import { AiConnectionsRequestError, aiConnectionsErrorCode } from '@undefineds.co/ai-connections-core/client';
2
+ /**
3
+ * The wording a failed AI Connection request is shown under.
4
+ *
5
+ * This used to live in the shared core, which meant the published contract
6
+ * carried sentences: nine Chinese messages plus the English fallbacks, and every
7
+ * consumer of the client - the applet and the web app - displayed wording chosen
8
+ * by a package that has no idea who is rendering it. The core now classifies a
9
+ * failure and hands over its code; the sentence is chosen here, where it is read.
10
+ *
11
+ * The rules below are a move, not a rewrite: the same codes map to the same
12
+ * sentences as before, so nothing a user reads changes.
13
+ */
14
+ const AI_CONNECTIONS_GENERIC_ERROR_MESSAGE = 'AI Connection request failed. Please try again.';
15
+ function isRecord(value) {
16
+ return typeof value === 'object' && value !== null;
17
+ }
18
+ const LOCAL_SESSION_REFRESH_FAILED_MESSAGE = '订阅登录态自动刷新失败,请稍后重试。';
19
+ const LOCAL_SESSION_REAUTH_REQUIRED_MESSAGE = '订阅登录态已失效,请在原客户端重新登录后重读,或使用设备码登录。';
20
+ const OAUTH_MODEL_AUTH_FAILED_MESSAGE = '订阅登录态不可用,请重读登录态或重新登录后再同步模型。';
21
+ const MODEL_DISCOVERY_SAFE_MESSAGES = new Set([
22
+ OAUTH_MODEL_AUTH_FAILED_MESSAGE,
23
+ LOCAL_SESSION_REFRESH_FAILED_MESSAGE,
24
+ LOCAL_SESSION_REAUTH_REQUIRED_MESSAGE,
25
+ '密钥不可用。请检查密钥是否填写正确,或换一个密钥后重试。',
26
+ '模型服务地址不正确。请检查服务地址后重试。',
27
+ '请求太频繁。请稍等一会儿再试。',
28
+ '模型服务暂时没有响应。请稍后重试。',
29
+ '模型列表获取失败。请检查密钥、服务地址或网络后重试。',
30
+ ]);
31
+ function normalizeAiConnectionsErrorText(message) {
32
+ if (message.startsWith('provider_models_response_error:')) {
33
+ return sanitizeProviderResponseMessage(message.slice('provider_models_response_error:'.length))
34
+ ?? '模型列表获取失败。请检查密钥、服务地址或网络后重试。';
35
+ }
36
+ const exact = messageForSafeErrorCode(message);
37
+ if (exact)
38
+ return exact;
39
+ const prefix = message.split(':', 1)[0]?.trim();
40
+ const prefixed = prefix ? messageForSafeErrorCode(prefix) : undefined;
41
+ if (prefixed)
42
+ return prefixed;
43
+ if (message === 'AI Connection service identity is unavailable')
44
+ return message;
45
+ if (MODEL_DISCOVERY_SAFE_MESSAGES.has(message))
46
+ return message;
47
+ if (isModelDiscoveryMessageWithProviderDetail(message))
48
+ return message;
49
+ if (message.startsWith('invalid_'))
50
+ return 'AI Connection returned an invalid response.';
51
+ return AI_CONNECTIONS_GENERIC_ERROR_MESSAGE;
52
+ }
53
+ /**
54
+ * The sentence to show for anything a request threw.
55
+ *
56
+ * A failed request carries the facts - the wire code, the upstream status, the
57
+ * request's provider and auth mode - so the sentence is chosen from those rather
58
+ * than parsed back out of a message. Anything that is not a request failure (a
59
+ * thrown string, an unexpected `Error`) still goes through the sanitiser, which
60
+ * is what keeps internals off the screen.
61
+ */
62
+ export function aiConnectionsErrorMessage(error) {
63
+ if (error instanceof AiConnectionsRequestError) {
64
+ return aiConnectionsErrorMessageForPayload(error.payload, error.status, {
65
+ provider: error.provider,
66
+ authMode: error.authMode,
67
+ });
68
+ }
69
+ if (error instanceof Error) {
70
+ return normalizeAiConnectionsErrorText(error.message);
71
+ }
72
+ return normalizeAiConnectionsErrorText(String(error));
73
+ }
74
+ export function aiConnectionsErrorMessageForPayload(payload, status, context = {}) {
75
+ const code = aiConnectionsErrorCode(payload);
76
+ if (code === 'provider_models_response_error') {
77
+ const message = isRecord(payload) && typeof payload.message === 'string'
78
+ ? sanitizeProviderResponseMessage(payload.message)
79
+ : undefined;
80
+ if (message)
81
+ return message;
82
+ return '模型列表获取失败。请检查密钥、服务地址或网络后重试。';
83
+ }
84
+ if (code === 'provider_models_fetch_failed') {
85
+ const providerStatus = isRecord(payload) && typeof payload.providerStatus === 'number'
86
+ ? payload.providerStatus
87
+ : undefined;
88
+ const providerMessage = isRecord(payload) && typeof payload.providerMessage === 'string'
89
+ ? payload.providerMessage.trim()
90
+ : undefined;
91
+ return withProviderMessage(modelDiscoveryErrorMessage(providerStatus, context.authMode), providerMessage);
92
+ }
93
+ const coded = code ? messageForSafeErrorCode(code, context.provider) : undefined;
94
+ if (coded)
95
+ return coded;
96
+ const text = isRecord(payload) && typeof payload.error === 'string'
97
+ ? payload.error
98
+ : undefined;
99
+ if (text) {
100
+ const exact = messageForSafeErrorCode(text, context.provider);
101
+ if (exact)
102
+ return exact;
103
+ if (text === 'AI Connection service identity is unavailable') {
104
+ return text;
105
+ }
106
+ if (text === 'Provider credential not found for current identity') {
107
+ return '当前身份没有可用的额度凭证。';
108
+ }
109
+ if (text === 'Provider quota adapter not found' || text === 'Provider quota lookup failed') {
110
+ return '该接入方式不支持查询官方额度。';
111
+ }
112
+ }
113
+ if (status === 401)
114
+ return 'Please sign in again to continue.';
115
+ if (status === 403)
116
+ return 'AI Connection permission was denied.';
117
+ if (status === 404 && context.provider) {
118
+ return `${providerLabel(context.provider)} connection is not configured.`;
119
+ }
120
+ if (status === 429)
121
+ return 'AI Connection is rate limited. Please try again later.';
122
+ if (status === 503)
123
+ return 'AI Connection service is unavailable.';
124
+ return AI_CONNECTIONS_GENERIC_ERROR_MESSAGE;
125
+ }
126
+ function messageForSafeErrorCode(code, provider) {
127
+ switch (code.trim().toLowerCase().replace(/-/g, '_')) {
128
+ case 'not_configured':
129
+ case 'notconfigured':
130
+ return provider
131
+ ? `${providerLabel(provider)} connection is not configured.`
132
+ : 'AI provider connection is not configured.';
133
+ case 'unsupported':
134
+ return provider
135
+ ? `${providerLabel(provider)} does not support this operation.`
136
+ : 'This AI Connection operation is not supported.';
137
+ case 'service_identity_unavailable':
138
+ return 'AI Connection service identity is unavailable';
139
+ case 'unauthorized':
140
+ return 'Please sign in again to continue.';
141
+ case 'forbidden':
142
+ case 'permission_denied':
143
+ return 'AI Connection permission was denied.';
144
+ case 'rate_limited':
145
+ return 'AI Connection is rate limited. Please try again later.';
146
+ case 'service_unavailable':
147
+ return 'AI Connection service is unavailable.';
148
+ case 'unsafe_provider_base_url':
149
+ return '该服务地址指向 Xpod 不允许访问的网络,请改用公网 HTTPS 地址。';
150
+ case 'invalid_proxy_url':
151
+ return '代理地址必须是无账号密码的 HTTP 或 HTTPS 地址。';
152
+ case 'oauth_refresh_failed':
153
+ case 'oauth_refresh_unavailable':
154
+ case 'local_session_refresh_failed':
155
+ return LOCAL_SESSION_REFRESH_FAILED_MESSAGE;
156
+ case 'oauth_session_reauth_required':
157
+ case 'oauth_refresh_token_required':
158
+ case 'local_session_reauth_required':
159
+ case 'local_session_missing_refresh_token':
160
+ return LOCAL_SESSION_REAUTH_REQUIRED_MESSAGE;
161
+ case 'models_persistence_failed':
162
+ return '模型已获取,但保存到 Pod 失败。请重试同步模型。';
163
+ case 'quota_credential_not_found':
164
+ return '当前身份没有可用的额度凭证。';
165
+ case 'credential_secret_unavailable':
166
+ return '当前凭证密钥不可用,请重新保存后再查询额度。';
167
+ case 'gateway_api_key_plaintext_unavailable':
168
+ return 'Pod 中未找到此 API Key 的原文,无法复制配置。请创建新的 Key,更新客户端后再删除旧 Key。';
169
+ case 'quota_adapter_not_found':
170
+ return '该接入方式不支持查询官方额度。';
171
+ default:
172
+ return undefined;
173
+ }
174
+ }
175
+ function modelDiscoveryErrorMessage(providerStatus, authMode) {
176
+ if (providerStatus === 401 || providerStatus === 403) {
177
+ if (authMode === 'deviceCodeOAuth')
178
+ return OAUTH_MODEL_AUTH_FAILED_MESSAGE;
179
+ return '密钥不可用。请检查密钥是否填写正确,或换一个密钥后重试。';
180
+ }
181
+ if (providerStatus === 404) {
182
+ return '模型服务地址不正确。请检查服务地址后重试。';
183
+ }
184
+ if (providerStatus === 429) {
185
+ return '请求太频繁。请稍等一会儿再试。';
186
+ }
187
+ if (providerStatus !== undefined && providerStatus >= 500) {
188
+ return '模型服务暂时没有响应。请稍后重试。';
189
+ }
190
+ return '模型列表获取失败。请检查密钥、服务地址或网络后重试。';
191
+ }
192
+ function withProviderMessage(message, providerMessage) {
193
+ const sanitized = providerMessage ? sanitizeProviderResponseMessage(providerMessage) : undefined;
194
+ if (!sanitized)
195
+ return message;
196
+ return `${message} 上游返回:${sanitized}`;
197
+ }
198
+ function isModelDiscoveryMessageWithProviderDetail(message) {
199
+ const marker = ' 上游返回:';
200
+ const index = message.indexOf(marker);
201
+ if (index <= 0)
202
+ return false;
203
+ return MODEL_DISCOVERY_SAFE_MESSAGES.has(message.slice(0, index));
204
+ }
205
+ function sanitizeProviderResponseMessage(value) {
206
+ const sanitized = value
207
+ .replace(/[\u0000-\u001f\u007f]/gu, ' ')
208
+ .replace(/\bBearer\s+[^\s,;]+/giu, 'Bearer [REDACTED]')
209
+ .replace(/(?:sk|id)[._-][A-Za-z0-9._-]{8,}/gu, '[REDACTED]')
210
+ .replace(/https?:\/\/[^\s]+/giu, '[URL]')
211
+ .trim()
212
+ .slice(0, 240);
213
+ return sanitized || undefined;
214
+ }
215
+ function providerLabel(provider) {
216
+ switch (provider) {
217
+ case 'openai': return 'OpenAI';
218
+ case 'anthropic': return 'Anthropic';
219
+ case 'kimi': return 'Kimi';
220
+ case 'bailian': return 'Bailian';
221
+ case 'deepseek': return 'DeepSeek';
222
+ case 'zhipu': return 'Zhipu';
223
+ case 'ollama': return 'Ollama';
224
+ case 'custom': return 'Custom';
225
+ }
226
+ }
227
+ /**
228
+ * The shared client reports a failure by naming its code; the sentence a user
229
+ * reads is the applet's (`error-wording`). This app renders messages straight
230
+ * from the thrown error, so it relabels them once, at its own boundary, instead
231
+ * of letting a code reach the screen or teaching every call site to translate.
232
+ * The error object itself is rethrown unchanged, so callers that inspect it -
233
+ * `instanceof`, `code`, `providerStatus` - keep working.
234
+ */
235
+ export function withDisplayableErrors(client) {
236
+ const wrapped = { ...client };
237
+ for (const [key, value] of Object.entries(client)) {
238
+ if (typeof value !== 'function')
239
+ continue;
240
+ wrapped[key] = async (...args) => {
241
+ try {
242
+ return await value.apply(client, args);
243
+ }
244
+ catch (error) {
245
+ if (error instanceof AiConnectionsRequestError) {
246
+ error.message = aiConnectionsErrorMessage(error);
247
+ }
248
+ throw error;
249
+ }
250
+ };
251
+ }
252
+ return wrapped;
253
+ }
@@ -0,0 +1,14 @@
1
+ import type { AiEndpointEntry } from './offering-endpoints';
2
+ /**
3
+ * The protocols the Xpod gateway serves, as registered by
4
+ * `src/api/handlers/AiGatewayHandler.ts`:
5
+ *
6
+ * - `POST /v1/chat/completions` (OpenAI Chat Completions)
7
+ * - `POST /v1/responses` (OpenAI Responses)
8
+ * - `POST /v1/messages` (Anthropic Messages)
9
+ *
10
+ * Each base URL comes from the same rule the coding-client adapters use, so what
11
+ * this page advertises is exactly what `AiClientConfigurationService` writes into
12
+ * a client.
13
+ */
14
+ export declare function xpodProtocolEndpoints(apiBase: string): AiEndpointEntry[];
@@ -0,0 +1,20 @@
1
+ import { normalizeMessagesEndpoint, normalizeV1Endpoint } from '@undefineds.co/ai-connections-core/endpoint-urls';
2
+ /**
3
+ * The protocols the Xpod gateway serves, as registered by
4
+ * `src/api/handlers/AiGatewayHandler.ts`:
5
+ *
6
+ * - `POST /v1/chat/completions` (OpenAI Chat Completions)
7
+ * - `POST /v1/responses` (OpenAI Responses)
8
+ * - `POST /v1/messages` (Anthropic Messages)
9
+ *
10
+ * Each base URL comes from the same rule the coding-client adapters use, so what
11
+ * this page advertises is exactly what `AiClientConfigurationService` writes into
12
+ * a client.
13
+ */
14
+ export function xpodProtocolEndpoints(apiBase) {
15
+ return [
16
+ { protocol: 'chatCompletions', baseUrl: normalizeV1Endpoint(apiBase) },
17
+ { protocol: 'responses', baseUrl: normalizeV1Endpoint(apiBase) },
18
+ { protocol: 'anthropic', baseUrl: normalizeMessagesEndpoint(apiBase) },
19
+ ];
20
+ }
@@ -1,9 +1,12 @@
1
1
  import type { WebExtensionModule } from '@undefineds.co/extension-sdk/web';
2
2
  import { type AiConnectionsController } from './controller';
3
- export * from './ai-connections-client';
4
3
  export * from './AiClientConfigurationSection';
5
4
  export * from './AiConnectionsPanel';
5
+ export * from './AiCopyButton';
6
+ export * from './AiEndpointList';
6
7
  export * from './AiGatewayKeysSection';
8
+ export * from './AiInfoTooltip';
9
+ export * from './AiProviderHeader';
7
10
  export * from './AiConnectionsList';
8
11
  export * from './AiConnectionsMain';
9
12
  export * from './AiConnectionsHeader';
@@ -11,6 +14,10 @@ export * from './AiConnectionsMainHeader';
11
14
  export * from './AiCustomProviderDialog';
12
15
  export * from './AiModelEditorDialog';
13
16
  export * from './controller';
17
+ export * from './collections';
18
+ export * from './display-wording';
19
+ export * from './error-wording';
20
+ export * from './gateway-endpoints';
14
21
  export * from './AiProviderCard';
15
22
  export * from './AiCredentialPoolSection';
16
23
  export * from './offering-label';
@@ -6,10 +6,13 @@ import { AiConnectionsMainHeader } from './AiConnectionsMainHeader.js';
6
6
  import { createAiConnectionsController, } from './controller.js';
7
7
  import { aiConnectionManifest } from './manifest.js';
8
8
  import { createElement } from 'react';
9
- export * from './ai-connections-client.js';
10
9
  export * from './AiClientConfigurationSection.js';
11
10
  export * from './AiConnectionsPanel.js';
11
+ export * from './AiCopyButton.js';
12
+ export * from './AiEndpointList.js';
12
13
  export * from './AiGatewayKeysSection.js';
14
+ export * from './AiInfoTooltip.js';
15
+ export * from './AiProviderHeader.js';
13
16
  export * from './AiConnectionsList.js';
14
17
  export * from './AiConnectionsMain.js';
15
18
  export * from './AiConnectionsHeader.js';
@@ -17,6 +20,10 @@ export * from './AiConnectionsMainHeader.js';
17
20
  export * from './AiCustomProviderDialog.js';
18
21
  export * from './AiModelEditorDialog.js';
19
22
  export * from './controller.js';
23
+ export * from './collections.js';
24
+ export * from './display-wording.js';
25
+ export * from './error-wording.js';
26
+ export * from './gateway-endpoints.js';
20
27
  export * from './AiProviderCard.js';
21
28
  export * from './AiCredentialPoolSection.js';
22
29
  export * from './offering-label.js';
@@ -14,5 +14,5 @@ export const aiConnectionManifest = validateExtensionManifest({
14
14
  }],
15
15
  },
16
16
  dataModels: [],
17
- hostCapabilities: ['navigation.openExternal', 'aiClientConfiguration'],
17
+ hostCapabilities: ['navigation.openExternal', 'aiClientConfiguration', 'solidNotifications', 'podCollections'],
18
18
  });
@@ -1,5 +1,19 @@
1
- import type { AiProviderOffering } from './ai-connections-client';
1
+ import type { AiProviderOffering } from '@undefineds.co/ai-connections-core/client';
2
+ /** One protocol the user can point a client at: the `protocol → base URL` pair the UI lists. */
3
+ export interface AiEndpointEntry {
4
+ protocol: string;
5
+ baseUrl: string;
6
+ }
2
7
  /** Endpoint the offering actually talks to: the discovery protocol wins, first endpoint is the fallback. */
3
8
  export declare function offeringEndpoint(offering: AiProviderOffering): string | undefined;
4
9
  export declare function endpointDisplayValue(value: string): string;
10
+ /**
11
+ * How a provider's own endpoint is described: by the API it serves.
12
+ *
13
+ * Used where the reader is inspecting what an upstream offering speaks. Xpod's
14
+ * own endpoints are named by {@link compatibleProtocolLabel} instead, because a
15
+ * client arrives already speaking a protocol rather than asking what Xpod uses.
16
+ */
5
17
  export declare function endpointProtocolLabel(protocol: string): string;
18
+ /** The client protocols Xpod accepts, named the way the client's own docs name them. */
19
+ export declare function compatibleProtocolLabel(protocol: string): string;
@@ -13,6 +13,13 @@ export function endpointDisplayValue(value) {
13
13
  return value;
14
14
  }
15
15
  }
16
+ /**
17
+ * How a provider's own endpoint is described: by the API it serves.
18
+ *
19
+ * Used where the reader is inspecting what an upstream offering speaks. Xpod's
20
+ * own endpoints are named by {@link compatibleProtocolLabel} instead, because a
21
+ * client arrives already speaking a protocol rather than asking what Xpod uses.
22
+ */
16
23
  export function endpointProtocolLabel(protocol) {
17
24
  if (protocol === 'responses')
18
25
  return 'Responses API';
@@ -22,3 +29,13 @@ export function endpointProtocolLabel(protocol) {
22
29
  return 'Anthropic API';
23
30
  return protocol;
24
31
  }
32
+ /** The client protocols Xpod accepts, named the way the client's own docs name them. */
33
+ export function compatibleProtocolLabel(protocol) {
34
+ if (protocol === 'responses')
35
+ return 'OpenAI Responses 兼容';
36
+ if (protocol === 'chatCompletions')
37
+ return 'OpenAI Chat 兼容';
38
+ if (protocol === 'anthropic')
39
+ return 'Anthropic Messages 兼容';
40
+ return `${protocol} 兼容`;
41
+ }
@@ -1,4 +1,4 @@
1
- import type { AiProviderAuthorizationMethod, AiProviderOffering } from './ai-connections-client';
1
+ import type { AiProviderAuthorizationMethod, AiProviderOffering } from '@undefineds.co/ai-connections-core/client';
2
2
  export declare function offeringTitle(offering: AiProviderOffering): string;
3
3
  /** Name of the offering kind. Same taxonomy as the title fallback, so it reuses the one map. */
4
4
  export declare function offeringKindLabel(kind: string): string;
@@ -1,3 +1,8 @@
1
- import type { AiConnectionsProvider } from './ai-connections-client';
1
+ import type { AiConnectionsProvider } from '@undefineds.co/ai-connections-core/client';
2
+ /**
3
+ * The Xpod shield (`ui/src/assets/xpod-shield.svg`), inlined like the provider
4
+ * marks: from a coding client's point of view Xpod is just another provider.
5
+ */
6
+ export declare const XPOD_AVATAR = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgZmlsbD0ibm9uZSI+CiAgPHBhdGgKICAgIGQ9Ik0zMiA3IDUxIDE2LjV2MTMuOGMwIDEyLjQtNy40IDIxLjItMTkgMjcuNy0xMS42LTYuNS0xOS0xNS4zLTE5LTI3LjdWMTYuNUwzMiA3WiIKICAgIHN0cm9rZT0iIzhBNzJCRSIKICAgIHN0cm9rZS13aWR0aD0iNSIKICAgIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIKICAgIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgLz4KPC9zdmc+Cg==";
2
7
  export declare function getProviderAvatar(provider: AiConnectionsProvider | string): string | undefined;
3
8
  export declare function getProviderAvatarBackground(provider: AiConnectionsProvider | string): string | undefined;
@@ -7,6 +7,11 @@ const bailianAvatar = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAY
7
7
  const zhipuAvatar = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAYAAAA4qEECAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAABRxJREFUeAHtnaFTG0EUxh9MLQy1YK4KJMyAT1EoKAYDM23BgKIGFDOFwaFSBQamzIDBdFDgGoMCgQTVGNAM/AF0v8tee9lsQjbZt7m929/MJtcjaciXl7dvv+PuEQUCgYAxfdQBr6+vkbgriTEkRxF4EqOK0dfXd0uGtC20EBeCrovxRYyIik1VjJ9iHAvRq+08oS2hhcgQeJtk9N7f39P19TU9Pj7Sy8sLFYHh4WEaGBigqakpGh0dTXYjystC7J23nt9SaBnFv6iWJuj8/JxOT0/p7u6OigxEX1tbo7m5uWRXRYyvraK7qdBS5N9ijCNy19fX40gO/AeCHx0dxfdUSycTQuwn3WNbCQ2RSxB3eXm5MCnCFKSTw8NDGhsbwz8rQuiPusf163YKkb+LuxIiOYjcGmizsrKSpNOS0O6b7nENES1LN0RzNDMzE094gbdB+ri8vMQmUscHNYXoIvqTGBEmviBy+0Cr/f19bGJua4hqXUT/oRDNHYF8fXV1hc0nEdHv0z+ri2iZNiJMgEFkc5Cvb25usDkktfyHmjrGcYPFSKAzUmuMUnq/KnSEm1BldE4qE0Tp/arQQ8qDA4Y0C9J+CjghCO2IILQjgtCOeEeWgGWYsg3Z2dvbq7Nrl5aWaHp6mmyDUleu+LrCmtBY609OTpIL8MbTIsOM39zcJNug+oIVYQPvUkfKU4gZGRmh3d1d4gCvY6vU9U5o2LZpVldXE+PdKohkW9EMvBJajTDkZY55Qf3W2MAboWHWqCkDx+04wGE726tjL4SGyFtbW3X7cPgItqRt8GFyHBu1VnUgn0mL0CrPz88NbxyRzJGXOVJGgjWh8Uu6MKO4UgbMIHWitYlXk+Hg4GCcMjiwWcrp8EpozlLu5OSEOPFGaJRxKOdsw5mX03ghNGcpx50yErwQGktsjpSBdGFz9deKzAuNSOYwqxDFcABdkWmhOVMGZymnI9NC+1rK6cis0FyrP9UzcUUmhYaRz5EyEMWqZ+KKzAnti5FvSuaE9sXINyVTQvtk5JuSGaF9M/JNyYzQvhn5pmRCaB+NfFN6LrSvRr4pPRXaZyPflJ4K7bORb0rPhPbdyDelJ0Lnwcg3pSdC58HIN8W50Hkx8k1xKnSejHxTnApdlFJOhzOh82bkm+JE6Dwa+aawC51XI98UdqHzauSbwip0no18U9iEzruRb4q1v49WcWnk48JRHK+FD/Ph4YFswCK0KyM/mWi5zm/Ea9lKUdZTh0sjf2Njw9lJpN1iVWiXRj4+TI5TkrmwKrQrI59zouXCmtAujXyubw0nVoR2aeRzTbTcWKk6ZmdnWU5/wyUc0qs/fKDwTTjOZ9Rh8/1YEdpmGdQK1LRZ952bEa5A44ggtCOC0I4IQjtCFTq+5jGHQVMUmmmnFdrHOjUrpLSr69WiCl3BDWrVQGektKum99cJLdtbVNFnRDYHCBiABZXs0dLQfUg3GR7jZnFxkQJmwFSTHKs/0116Hpc2xuXnhxYWFgrf3KZdEM0XFxfYxDw3oTa/aYho2W0hbklULpdjjznQGsWH/6HrMNRWwxv0GcFFpAKNJCLL3GzW8EYyL8Yt/oOzs7P4qxGoBwUDtEkmQKpppsW4KdnBwYG1I8O+AmGVv1mpiDHfrE8WaLfN3ra4+0yyQUDSZg8HTIvSDwArPixGNG32doTA5beeb9I4MqJa1yH0Noyo2FSpVsKVW0Vxmm5aoaJnC+6L1AoVo9JuV85AIBDokr8WvnnavEglMwAAAABJRU5ErkJggg==';
8
8
  'data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%20200%20200%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27g%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%271%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%237A5CFF%27/%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%234A6CF7%27/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect%20width%3D%27200%27%20height%3D%27200%27%20fill%3D%27url%28%23g%29%27/%3E%3Cpath%20fill%3D%27%23FFFFFF%27%20fill-rule%3D%27evenodd%27%20d%3D%27M100%2036%20L156%2068%20L156%20132%20L100%20164%20L44%20132%20L44%2068%20Z%20M100%2064%20C102.5%2086%20114%2097.5%20136%20100%20C114%20102.5%20102.5%20114%20100%20136%20C97.5%20114%2086%20102.5%2064%20100%20C86%2097.5%2097.5%2086%20100%2064%20Z%27/%3E%3C/svg%3E';
9
9
  const ollamaAvatar = 'data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M16.361%2010.26a.894.894%200%200%200-.558.47l-.072.148.001.207c0%20.193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86%200%200%200%20.517-.436.752.752%200%200%200%20.08-.498c-.064-.453-.33-.782-.724-.897a1.06%201.06%200%200%200-.466%200zm-9.203.005c-.305.096-.533.32-.65.639a1.187%201.187%200%200%200-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894%200%200%200-.565-.472%201.02%201.02%200%200%200-.474.007Zm4.184%202c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365%200%200%200-.175-.48.394.394%200%200%200-.181-.033c-.126%200-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396%200%200%200-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589%201.226-1.787%202.114-.04.176-.045.234-.045.53%200%20.294.005.357.043.524.264%201.16%201.332%202.017%202.714%202.173.3.033%201.596.033%201.896%200%201.11-.125%202.064-.727%202.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523%200-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873%206.873%200%200%200-.855-.031zm.645.937a3.283%203.283%200%200%201%201.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115%203.115%200%200%201-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46%201.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653%201.653%200%200%200-.683.298C5.617.74%205.173%201.666%204.985%202.819c-.07.436-.119%201.04-.119%201.503%200%20.544.064%201.24.155%201.721.02.107.031.202.023.208a8.12%208.12%200%200%201-.187.152%205.324%205.324%200%200%200-.949%201.02%205.49%205.49%200%200%200-.94%202.339%206.625%206.625%200%200%200-.023%201.357c.091.78.325%201.438.727%202.04l.13.195-.037.064c-.269.452-.498%201.105-.605%201.732-.084.496-.095.629-.095%201.294%200%20.67.009.803.088%201.266.095.555.288%201.143.503%201.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405%207.405%200%200%200-.548%201.873c-.062.417-.071.552-.071.991%200%20.56.031.832.148%201.279L3.42%2024h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915%200%200%200-.194-.25%201.74%201.74%200%200%201-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787%200%200%200%20.223-.531c0-.195-.07-.355-.224-.522a3.136%203.136%200%200%201-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814%201.353-1.336%202.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467%201.352-.561.17-.035.25-.04.569-.04.319%200%20.398.005.569.04a4.07%204.07%200%200%201%201.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016%201.144.23%202.14%201.173%202.581%202.437.385%201.108.276%202.267-.296%203.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001%201.053.493.539.801%201.866.708%203.036-.062.772-.26%201.463-.533%201.854a2.096%202.096%200%200%201-.224.258.916.916%200%200%200-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498%201.295.253%201.008.231%202.01-.059%202.581a.845.845%200%200%200-.044.098c0%20.006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016%200-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378%200-1.628-.083-.645-.182-1.082-.348-1.525a6.083%206.083%200%200%200-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625%206.625%200%200%200-.024-1.358%205.512%205.512%200%200%200-.939-2.339%205.325%205.325%200%200%200-.95-1.02%208.097%208.097%200%200%201-.186-.152.692.692%200%200%201%20.023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8%201.205-2.116%203.01a6.805%206.805%200%200%200-.097.726c0%20.036-.007.066-.015.066a.96.96%200%200%201-.149-.078A4.857%204.857%200%200%200%2012%203.03c-.832%200-1.687.243-2.456.698a.958.958%200%200%201-.148.078c-.008%200-.015-.03-.015-.066a6.71%206.71%200%200%200-.097-.725C8.997%201.392%208.337.319%207.46.048a2.096%202.096%200%200%200-.585-.041Zm.293%201.402c.248.197.523.759.682%201.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102%201.24l.002.475-.12.175-.118.178h-.278c-.324%200-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438%208.438%200%200%201%20.016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36%202.028.212%203.145-.019.14-.024.151-.057.144l-.238-.06a3.693%203.693%200%200%200-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z%22/%3E%3C/svg%3E';
10
+ /**
11
+ * The Xpod shield (`ui/src/assets/xpod-shield.svg`), inlined like the provider
12
+ * marks: from a coding client's point of view Xpod is just another provider.
13
+ */
14
+ export const XPOD_AVATAR = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgZmlsbD0ibm9uZSI+CiAgPHBhdGgKICAgIGQ9Ik0zMiA3IDUxIDE2LjV2MTMuOGMwIDEyLjQtNy40IDIxLjItMTkgMjcuNy0xMS42LTYuNS0xOS0xNS4zLTE5LTI3LjdWMTYuNUwzMiA3WiIKICAgIHN0cm9rZT0iIzhBNzJCRSIKICAgIHN0cm9rZS13aWR0aD0iNSIKICAgIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIKICAgIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgLz4KPC9zdmc+Cg==';
10
15
  const providerAvatars = {
11
16
  openai: openaiAvatar,
12
17
  anthropic: anthropicAvatar,
@@ -1,3 +1,4 @@
1
+ import { AI_CONNECTIONS_PROVIDER_DOCUMENT_IDS } from '@undefineds.co/ai-connections-core/provider-catalog';
1
2
  export const AI_CONNECTIONS_APPLET_ID = 'co.undefineds.ai-connections';
2
3
  const KNOWN_RESOURCE_PATHS = {
3
4
  providerCredentials: 'settings/credentials.ttl',
@@ -5,33 +6,7 @@ const KNOWN_RESOURCE_PATHS = {
5
6
  gatewayAccessKeys: '.data/ai/gateway/access-keys.ttl',
6
7
  quotaSnapshots: '.data/ai/gateway/quota.ttl',
7
8
  };
8
- const PROVIDER_DOCUMENT_IDS = [
9
- 'openai',
10
- 'openai-official-subscription',
11
- 'openai-api-platform',
12
- 'anthropic',
13
- 'anthropic-official-subscription',
14
- 'anthropic-api-platform',
15
- 'kimi',
16
- 'kimi-subscription-key',
17
- 'kimi-api-platform',
18
- 'bailian',
19
- 'bailian-pay-as-you-go',
20
- 'bailian-token-plan',
21
- 'bailian-token-plan-team',
22
- 'bailian-coding-plan',
23
- 'deepseek',
24
- 'deepseek-api-platform',
25
- 'zhipu',
26
- 'zhipu-api-platform',
27
- 'zhipu-coding-plan',
28
- 'ollama',
29
- 'ollama-local',
30
- 'custom',
31
- 'custom-openai-compatible',
32
- 'custom-anthropic-compatible',
33
- ];
34
- const PROVIDER_DOCUMENT_ID_SET = new Set(PROVIDER_DOCUMENT_IDS);
9
+ const PROVIDER_DOCUMENT_ID_SET = new Set(AI_CONNECTIONS_PROVIDER_DOCUMENT_IDS);
35
10
  export function parseAiConnectionsServiceAccess(value, currentPodUrl) {
36
11
  if (!isRecord(value))
37
12
  throw new Error('invalid_descriptor');
@@ -1,4 +1,4 @@
1
- import type { AiConnectAttempt, AiConnectionsMode, AiProviderAuthorizationMethod, AiProviderCredentialSummary, AiProviderOffering } from './ai-connections-client';
1
+ import type { AiConnectAttempt, AiConnectionsMode, AiProviderAuthorizationMethod, AiProviderCredentialSummary, AiProviderOffering } from '@undefineds.co/ai-connections-core/client';
2
2
  /**
3
3
  * Lifecycle of the connect dialog: which offering is being connected, whether the
4
4
  * user is creating or editing, and the busy/error state the toolbar and the
@@ -13,30 +13,17 @@
13
13
  "types": "./dist/index.d.ts",
14
14
  "import": "./dist/index.js"
15
15
  },
16
- "./client": {
17
- "types": "./dist/ai-connections-client.d.ts",
18
- "import": "./dist/ai-connections-client.js"
19
- },
20
- "./provider-catalog": {
21
- "types": "./dist/provider-catalog.d.ts",
22
- "import": "./dist/provider-catalog.js",
23
- "require": "./dist/provider-catalog.cjs"
24
- },
25
16
  "./manifest": {
26
17
  "types": "./dist/manifest.d.ts",
27
18
  "import": "./dist/manifest.js"
28
- },
29
- "./client-config": {
30
- "types": "./dist/client-config/index.d.ts",
31
- "import": "./dist/client-config/index.js",
32
- "require": "./dist/client-config/index.cjs"
33
19
  }
34
20
  },
35
21
  "scripts": {
36
- "build": "rm -rf dist && tsc -p tsconfig.json && bun ../../scripts/fix-dist-js-imports.mjs dist && bun build src/client-config/index.ts --target=node --format=cjs --outfile=dist/client-config/index.cjs && bun build src/provider-catalog.ts --target=node --format=cjs --outfile=dist/provider-catalog.cjs",
22
+ "build": "rm -rf dist && tsc -p tsconfig.json && bun ../../scripts/fix-dist-js-imports.mjs dist",
37
23
  "test": "vitest run --config ../../vitest.packages.config.mts"
38
24
  },
39
25
  "dependencies": {
26
+ "@undefineds.co/models": "0.2.59",
40
27
  "lucide-react": "^0.525.0"
41
28
  },
42
29
  "peerDependencies": {
@@ -54,15 +41,6 @@
54
41
  },
55
42
  "typesVersions": {
56
43
  "*": {
57
- "provider-catalog": [
58
- "dist/provider-catalog.d.ts"
59
- ],
60
- "client": [
61
- "dist/ai-connections-client.d.ts"
62
- ],
63
- "client-config": [
64
- "dist/client-config/index.d.ts"
65
- ],
66
44
  "manifest": [
67
45
  "dist/manifest.d.ts"
68
46
  ]
@@ -1,6 +1,8 @@
1
1
  /**
2
- * Public entry point of the AI connections client
3
- * (`@undefineds.co/ai-connections/client`).
2
+ * Public entry point of the AI Connections client protocol. This package is
3
+ * the shared core: the gateway and the applet both consume it, and the applet
4
+ * (`@undefineds.co/ai-connections`) adds the components, artwork and wording.
5
+ * (`@undefineds.co/ai-connections-core/client`).
4
6
  *
5
7
  * The implementation lives in `./client`, split into wire types, payload
6
8
  * normalisation and the request factory. This file stays a barrel — importers
@@ -10,5 +12,12 @@
10
12
  */
11
13
  export { AI_CONNECTIONS_PROVIDERS } from './client/types';
12
14
  export type { AiConnectAttempt, AiConnectionBeginOptions, AiConnectionsClient, AiConnectionsCredential, AiConnectionsMode, AiConnectionsProvider, AiConnectStatus, AiGatewayModel, AiProviderAuthorizationMethod, AiProviderAuthorizationMethodId, AiProviderAuthorizationMethodsSummary, AiProviderConnectionSummary, AiProviderCredentialSummary, AiProviderOffering, AiProviderSummary, AiProviderSummaryStatus, AiQuotaSnapshot, AiQuotaWindow, CreateApiKeyCredentialInput, CreatedGatewayKey, CustomProviderModel, DiscoveredProviderModel, GatewayKeyRecord, ProviderModelDiscovery, TestProviderCredentialInput, UpdateProviderCredentialInput, } from './client/types';
13
- export { AI_CONNECTIONS_GENERIC_ERROR_MESSAGE, AiConnectionsRequestError, normalizeAiConnectionsErrorMessage, normalizeAiConnectionsThrownError, normalizeProxyUrl, redactProxyUrl, } from './client/normalize';
15
+ export { AiConnectionsRequestError, aiConnectionsErrorCode, normalizeProxyUrl, redactProxyUrl, } from './client/normalize';
14
16
  export { createAiConnectionsClient, resolveAiConnectionsApiBase } from './client/request';
17
+ /**
18
+ * Storage-shape rules for credential rows. They are shared with the Pod adapter
19
+ * (`ui/src/extensions/XpodAiConnectionsPodStore.ts`) and with the collection
20
+ * layer that writes the same rows: one envelope format, one provider relation.
21
+ */
22
+ export { credentialProviderRelation, credentialRowKeyFor, credentialSecretEnvelope, customCredentialProviderRelation, decodeCredentialSecret, providerOfCredentialKey, providerResourceKey, providerResourceReference, } from './credential-storage';
23
+ export type { CredentialSecretEnvelopeInput, CredentialSecretReadInput, } from './credential-storage';
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Public entry point of the AI Connections client protocol. This package is
3
+ * the shared core: the gateway and the applet both consume it, and the applet
4
+ * (`@undefineds.co/ai-connections`) adds the components, artwork and wording.
5
+ * (`@undefineds.co/ai-connections-core/client`).
6
+ *
7
+ * The implementation lives in `./client`, split into wire types, payload
8
+ * normalisation and the request factory. This file stays a barrel — importers
9
+ * keep using this path, so the published `./client` export is unchanged — and it
10
+ * lists the surface explicitly rather than re-exporting whole modules: the
11
+ * parsers under `./client` are internal, and `export *` would publish them.
12
+ */
13
+ export { AI_CONNECTIONS_PROVIDERS } from './client/types.js';
14
+ export { AiConnectionsRequestError, aiConnectionsErrorCode, normalizeProxyUrl, redactProxyUrl, } from './client/normalize.js';
15
+ export { createAiConnectionsClient, resolveAiConnectionsApiBase } from './client/request.js';
16
+ /**
17
+ * Storage-shape rules for credential rows. They are shared with the Pod adapter
18
+ * (`ui/src/extensions/XpodAiConnectionsPodStore.ts`) and with the collection
19
+ * layer that writes the same rows: one envelope format, one provider relation.
20
+ */
21
+ export { credentialProviderRelation, credentialRowKeyFor, credentialSecretEnvelope, customCredentialProviderRelation, decodeCredentialSecret, providerOfCredentialKey, providerResourceKey, providerResourceReference, } from './credential-storage.js';