@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
@@ -1,24 +1,42 @@
1
- import type { WebExtensionHost } from '@undefineds.co/extension-sdk/web';
2
- import { type AiConnectionsClient, type AiConnectionsMode, type AiConnectionsProvider, type AiProviderConnectionSummary, type AiProviderSummary } from './ai-connections-client';
1
+ import type { SolidLiveUpdateState, WebExtensionHost } from '@undefineds.co/extension-sdk/web';
2
+ import { type AiConnectionsClient, type AiConnectionsProvider, type AiProviderConnectionSummary, type AiProviderSummary } from '@undefineds.co/ai-connections-core/client';
3
3
  import type { AiClientConfigurationBridge } from './AiClientConfigurationSection';
4
+ import { type CredentialRow } from './collections';
5
+ import type { PodCollection } from '@undefineds.co/pod-collections';
4
6
  export interface AiProviderDefinition {
5
7
  id: AiConnectionsProvider;
6
8
  name: string;
7
- browserMode: AiConnectionsMode;
8
- browserLabel: string;
9
9
  description: string;
10
10
  homeUrl: string;
11
11
  apiKeyUrl?: string;
12
12
  apiKeyPlaceholder?: string;
13
13
  defaultBaseUrl?: string;
14
14
  }
15
+ /**
16
+ * Provider pages explain themselves through the header's ⓘ tooltip, so each
17
+ * description is one line of the same shape — where the models come from and how
18
+ * this deployment can be authorized — instead of a restatement of the name.
19
+ *
20
+ * Connect actions are deliberately absent here: which ways in exist is offering
21
+ * data (`authorizationMethods`), derived by the server per offering, and a
22
+ * provider-level label is exactly how a page could offer a 「登录」 no offering
23
+ * declares.
24
+ */
15
25
  export declare const PROVIDERS: AiProviderDefinition[];
16
26
  export type ProviderProductState = 'loading' | 'unconfigured' | 'configured' | 'connected' | 'attention';
17
27
  export declare const AI_CONNECTIONS_PINNED_SECTIONS: readonly [{
18
28
  readonly id: "keys";
19
- readonly label: "API Keys";
29
+ readonly label: "Xpod";
20
30
  readonly title: "API KEYS";
21
31
  }];
32
+ /**
33
+ * Coalescing window for Pod change signals.
34
+ *
35
+ * A notification only says "this document changed", so a burst of writes must
36
+ * cost one re-read, not one per write; the first signal arms a fixed window and
37
+ * everything arriving inside it is absorbed.
38
+ */
39
+ export declare const TABLE_CHANGE_COALESCE_MS = 75;
22
40
  export type AiConnectionsPinnedSection = typeof AI_CONNECTIONS_PINNED_SECTIONS[number]['id'];
23
41
  export type AiConnectionsWorkspaceSection = AiConnectionsPinnedSection | 'provider';
24
42
  export interface AiConnectionsController {
@@ -32,12 +50,47 @@ export interface AiConnectionsController {
32
50
  readonly providerStates: Partial<Record<AiConnectionsProvider, ProviderProductState>>;
33
51
  readonly providerSummaries: Partial<Record<AiConnectionsProvider, AiProviderSummary>>;
34
52
  readonly providerLoadError?: string;
53
+ /**
54
+ * Whether the Pod table documents this page renders are pushing changes.
55
+ *
56
+ * `unavailable` also covers a host that offers no live-update capability at
57
+ * all; either way the page keeps working from explicit reads.
58
+ */
59
+ readonly liveUpdates: SolidLiveUpdateState;
60
+ /**
61
+ * The live credentials table (`settings/credentials.ttl`), when the host
62
+ * exposes `podCollections` and the lazily loaded collection layer has landed.
63
+ * The page renders its rows; the controller's own live-revision refresh does
64
+ * not watch that document while this is present.
65
+ */
66
+ readonly credentialsCollection?: PodCollection<CredentialRow>;
67
+ /**
68
+ * The collection's rows as its own change feed reports them, or `undefined`
69
+ * while the layer is still loading, when the host offers no collection, or
70
+ * after a failed first read. This is what the credentials list renders (and
71
+ * what makes every credential write optimistic).
72
+ */
73
+ readonly credentialRows?: readonly CredentialRow[];
74
+ /**
75
+ * Advances once per coalesced burst of changes to those documents. Pages
76
+ * re-read through the loaders they already have when it changes.
77
+ */
78
+ readonly liveRevision: number;
35
79
  selectSection(section: AiConnectionsPinnedSection): void;
36
80
  selectProvider(provider: AiConnectionsProvider, credentialId?: string): void;
37
81
  selectFirstUnconfiguredProvider(): void;
38
82
  setSearchQuery(value: string): void;
39
83
  setProviderState(provider: AiConnectionsProvider, state: ProviderProductState): void;
40
84
  loadProviders(): Promise<void>;
85
+ /**
86
+ * Watches the table documents the open page renders: the credentials table
87
+ * plus the open provider's document.
88
+ *
89
+ * Re-entrant and idempotent, so React StrictMode's setup/cleanup/setup cycle
90
+ * stays harmless; releasing the last hold leaves no channel and no socket
91
+ * behind for this page.
92
+ */
93
+ watchPageTables(): () => void;
41
94
  cancelProviderLoads(): void;
42
95
  subscribe(listener: () => void): () => void;
43
96
  }
@@ -48,5 +101,18 @@ export declare function useSelectedCredentialId(controller: AiConnectionsControl
48
101
  export declare function useProviderSearch(controller: AiConnectionsController): string;
49
102
  export declare function useProviderStates(controller: AiConnectionsController): Partial<Record<AiConnectionsProvider, ProviderProductState>>;
50
103
  export declare function useProviderSummaries(controller: AiConnectionsController): Partial<Record<AiConnectionsProvider, AiProviderConnectionSummary>>;
104
+ /**
105
+ * Providers this deployment offers, as reported by the server.
106
+ *
107
+ * Cloud answers with the operator-designated providers only (no self-hosted
108
+ * `custom`, no local daemon), so the settings surface cannot offer a provider the
109
+ * deployment does not provide. Before the first successful load this is
110
+ * `undefined`, which keeps every provider visible (Local behavior).
111
+ */
112
+ export declare function useAvailableProviders(controller: AiConnectionsController): AiConnectionsProvider[] | undefined;
51
113
  export declare function useProviderProducts(controller: AiConnectionsController): Partial<Record<AiConnectionsProvider, AiProviderSummary>>;
52
114
  export declare function useProviderLoadError(controller: AiConnectionsController): string | undefined;
115
+ /** Whether live Pod updates are on, for a status affordance that stays small. */
116
+ export declare function useLiveUpdates(controller: AiConnectionsController): SolidLiveUpdateState;
117
+ /** Advances once per coalesced burst of Pod changes; drives page re-reads. */
118
+ export declare function useLiveRevision(controller: AiConnectionsController): number;
@@ -1,18 +1,38 @@
1
1
  import { useSyncExternalStore } from 'react';
2
- import { AI_CONNECTIONS_PROVIDERS, AiConnectionsRequestError, createAiConnectionsClient, normalizeAiConnectionsThrownError, } from './ai-connections-client.js';
2
+ import { AI_CONNECTIONS_PROVIDERS, AiConnectionsRequestError, createAiConnectionsClient, } from '@undefineds.co/ai-connections-core/client';
3
+ import { aiConnectionsErrorMessage } from './error-wording.js';
4
+ import { credentialCollectionRuntime, } from './collections.js';
5
+ /**
6
+ * Provider pages explain themselves through the header's ⓘ tooltip, so each
7
+ * description is one line of the same shape — where the models come from and how
8
+ * this deployment can be authorized — instead of a restatement of the name.
9
+ *
10
+ * Connect actions are deliberately absent here: which ways in exist is offering
11
+ * data (`authorizationMethods`), derived by the server per offering, and a
12
+ * provider-level label is exactly how a page could offer a 「登录」 no offering
13
+ * declares.
14
+ */
3
15
  export const PROVIDERS = [
4
- { id: 'openai', name: 'OpenAI', browserMode: 'browserAssistedApiKey', browserLabel: '登录', description: 'OpenAI 模型与编码能力', homeUrl: 'https://openai.com', apiKeyUrl: 'https://platform.openai.com/api-keys', apiKeyPlaceholder: 'sk-...', defaultBaseUrl: 'https://api.openai.com/v1' },
5
- { id: 'anthropic', name: 'Anthropic', browserMode: 'browserAssistedApiKey', browserLabel: '登录', description: 'Claude 模型与编码能力', homeUrl: 'https://www.anthropic.com', apiKeyUrl: 'https://console.anthropic.com/settings/keys', apiKeyPlaceholder: 'sk-ant-...', defaultBaseUrl: 'https://api.anthropic.com' },
6
- { id: 'kimi', name: 'Kimi', browserMode: 'browserAssistedApiKey', browserLabel: '登录', description: 'Moonshot AI 模型服务', homeUrl: 'https://www.moonshot.cn', apiKeyUrl: 'https://platform.moonshot.cn/console/api-keys', apiKeyPlaceholder: 'sk-...', defaultBaseUrl: 'https://api.moonshot.cn/v1' },
7
- { id: 'bailian', name: '百炼', browserMode: 'browserAssistedApiKey', browserLabel: '登录', description: '阿里云百炼模型服务', homeUrl: 'https://www.aliyun.com/product/bailian', apiKeyUrl: 'https://bailian.console.aliyun.com/#/api-key', apiKeyPlaceholder: 'sk-...', defaultBaseUrl: 'https://dashscope.aliyuncs.com/compatible-mode/v1' },
8
- { id: 'deepseek', name: 'DeepSeek', browserMode: 'connectUnsupported', browserLabel: '不支持登录', description: 'DeepSeek 模型服务', homeUrl: 'https://www.deepseek.com', apiKeyUrl: 'https://platform.deepseek.com/api_keys', apiKeyPlaceholder: 'sk-...', defaultBaseUrl: 'https://api.deepseek.com/v1' },
9
- { id: 'zhipu', name: '智谱 AI', browserMode: 'browserAssistedApiKey', browserLabel: '登录', description: '智谱 AI / GLM 模型服务', homeUrl: 'https://open.bigmodel.cn', apiKeyUrl: 'https://open.bigmodel.cn/usercenter/apikeys', apiKeyPlaceholder: 'id.secret-...', defaultBaseUrl: 'https://open.bigmodel.cn/api/paas/v4' },
10
- { id: 'ollama', name: 'Ollama', browserMode: 'connectUnsupported', browserLabel: '本地服务', description: '本地 Ollama 模型服务', homeUrl: 'https://ollama.com', defaultBaseUrl: 'http://localhost:11434/v1' },
11
- { id: 'custom', name: 'Custom', browserMode: 'browserAssistedApiKey', browserLabel: '配置', description: 'OpenAI / Anthropic 兼容的自定义模型服务', homeUrl: 'https://undefineds.co', apiKeyPlaceholder: 'sk-...', defaultBaseUrl: 'https://example.com/v1' },
16
+ { id: 'openai', name: 'OpenAI', description: 'OpenAI 官方 GPT 与推理模型,支持 API Key 与订阅导入。', homeUrl: 'https://openai.com', apiKeyUrl: 'https://platform.openai.com/api-keys', apiKeyPlaceholder: 'sk-...', defaultBaseUrl: 'https://api.openai.com/v1' },
17
+ { id: 'anthropic', name: 'Anthropic', description: 'Anthropic 官方 Claude 模型,支持 API Key 与订阅导入。', homeUrl: 'https://www.anthropic.com', apiKeyUrl: 'https://console.anthropic.com/settings/keys', apiKeyPlaceholder: 'sk-ant-...', defaultBaseUrl: 'https://api.anthropic.com' },
18
+ { id: 'kimi', name: 'Kimi', description: '月之暗面 Kimi 模型,支持账号订阅、编码套餐与开放平台。', homeUrl: 'https://www.moonshot.cn', apiKeyUrl: 'https://platform.moonshot.cn/console/api-keys', apiKeyPlaceholder: 'sk-...', defaultBaseUrl: 'https://api.moonshot.cn/v1' },
19
+ { id: 'bailian', name: '百炼', description: '阿里云百炼的通义千问等模型,提供按量与多种套餐。', homeUrl: 'https://www.aliyun.com/product/bailian', apiKeyUrl: 'https://bailian.console.aliyun.com/#/api-key', apiKeyPlaceholder: 'sk-...', defaultBaseUrl: 'https://dashscope.aliyuncs.com/compatible-mode/v1' },
20
+ { id: 'deepseek', name: 'DeepSeek', description: 'DeepSeek 官方模型,API Key 接入,接口兼容 OpenAI。', homeUrl: 'https://www.deepseek.com', apiKeyUrl: 'https://platform.deepseek.com/api_keys', apiKeyPlaceholder: 'sk-...', defaultBaseUrl: 'https://api.deepseek.com/v1' },
21
+ { id: 'zhipu', name: '智谱 AI', description: '智谱 GLM 系列模型,支持 API Key 与 GLM 编码套餐。', homeUrl: 'https://open.bigmodel.cn', apiKeyUrl: 'https://open.bigmodel.cn/usercenter/apikeys', apiKeyPlaceholder: 'id.secret-...', defaultBaseUrl: 'https://open.bigmodel.cn/api/paas/v4' },
22
+ { id: 'ollama', name: 'Ollama', description: '运行在本机的 Ollama 模型,无需 API Key,仅本机可达。', homeUrl: 'https://ollama.com', defaultBaseUrl: 'http://localhost:11434/v1' },
23
+ { id: 'custom', name: 'Custom', description: '任意 OpenAI 或 Anthropic 兼容服务,自填地址与 API Key。', homeUrl: 'https://undefineds.co', apiKeyPlaceholder: 'sk-...', defaultBaseUrl: 'https://example.com/v1' },
12
24
  ];
13
25
  export const AI_CONNECTIONS_PINNED_SECTIONS = [
14
- { id: 'keys', label: 'API Keys', title: 'API KEYS' },
26
+ { id: 'keys', label: 'Xpod', title: 'API KEYS' },
15
27
  ];
28
+ /**
29
+ * Coalescing window for Pod change signals.
30
+ *
31
+ * A notification only says "this document changed", so a burst of writes must
32
+ * cost one re-read, not one per write; the first signal arms a fixed window and
33
+ * everything arriving inside it is absorbed.
34
+ */
35
+ export const TABLE_CHANGE_COALESCE_MS = 75;
16
36
  if (PROVIDERS.map((provider) => provider.id).join(',') !== AI_CONNECTIONS_PROVIDERS.join(',')) {
17
37
  throw new Error('AI Connection provider UI is out of sync with the client catalog');
18
38
  }
@@ -24,6 +44,28 @@ export function createAiConnectionsController(host) {
24
44
  const readyPod = pod?.status === 'ready' ? pod : undefined;
25
45
  const authenticated = sessionSnapshot.status === 'authenticated'
26
46
  && readyPod !== undefined;
47
+ /**
48
+ * The live credentials table, when the host offers one.
49
+ *
50
+ * Declaring it here (and not in a page) is what keeps one table to one
51
+ * collection: the page reads the same instance the client writes through.
52
+ *
53
+ * It is declared *asynchronously* and lands in `credentials` (+ `credentialRows`
54
+ * and `credentialMutations`): the collection layer is loaded on demand through
55
+ * `collections.credentialCollectionRuntime()` - the table declaration, the row
56
+ * read and the credential writes all live in that chunk - so the applet renders
57
+ * from the store first and upgrades to live rows when the collection's first
58
+ * read is back. When the host offers no `podCollections` capability at all the
59
+ * collection never lands and the controller behaves exactly as before
60
+ * (`docs/pod-collections.md` §8.9).
61
+ */
62
+ let credentials;
63
+ let credentialRows;
64
+ let credentialMutations;
65
+ const liveCredentials = {
66
+ collection: () => credentials,
67
+ mutations: () => credentialMutations,
68
+ };
27
69
  let providerLoadGeneration = 0;
28
70
  let providerLoadPromise;
29
71
  let providerLoadOperation;
@@ -81,7 +123,7 @@ export function createAiConnectionsController(host) {
81
123
  webId: sessionSnapshot.webId,
82
124
  podBaseUrl: readyPod.current.podUrl,
83
125
  authenticatedFetch: host.solid.session.fetch,
84
- }), host.capabilities.aiClientCredentials), host.capabilities.aiConnectionsPodStore, beginProviderLoad)
126
+ }), host.capabilities.aiClientCredentials), host.capabilities.aiConnectionsPodStore, liveCredentials, beginProviderLoad)
85
127
  : null;
86
128
  let selectedSection = 'keys';
87
129
  let selectedProvider = 'openai';
@@ -92,10 +134,164 @@ export function createAiConnectionsController(host) {
92
134
  let providerLoadError;
93
135
  const listeners = new Set();
94
136
  const notify = () => listeners.forEach((listener) => listener());
137
+ const notifications = host.capabilities.solidNotifications;
138
+ const podStore = host.capabilities.aiConnectionsPodStore;
139
+ /** Release function per watched topic document; one entry per document. */
140
+ const tableSubscriptions = new Map();
141
+ let pageTableHolds = 0;
142
+ let liveUpdates = currentLiveUpdates();
143
+ let liveRevision = 0;
144
+ let coalesceTimer;
145
+ function scheduleLiveRefresh() {
146
+ if (coalesceTimer !== undefined)
147
+ return;
148
+ coalesceTimer = setTimeout(() => {
149
+ coalesceTimer = undefined;
150
+ liveRevision += 1;
151
+ notify();
152
+ }, TABLE_CHANGE_COALESCE_MS);
153
+ }
154
+ /**
155
+ * The documents the open page renders *and* this controller refreshes; a table
156
+ * is one document, never a row.
157
+ *
158
+ * One table has exactly one refresh path. The credentials table is owned by
159
+ * the collection when the host exposes one - the collection subscribes to the
160
+ * same notification primitive with the same document - so it is left out here;
161
+ * without a collection it stays on this path, exactly as before. The open
162
+ * provider's document is always this path's (P4 moves it).
163
+ */
164
+ function pageTableDocuments() {
165
+ if (!podStore)
166
+ return [];
167
+ const documents = new Set();
168
+ const credentialsDocument = credentials ? undefined : podStore.credentialsTableDocument?.();
169
+ if (credentialsDocument)
170
+ documents.add(credentialsDocument);
171
+ if (selectedSection === 'provider') {
172
+ const provider = podStore.providerTableDocument?.(selectedProvider, selectedCredentialId);
173
+ if (provider)
174
+ documents.add(provider);
175
+ }
176
+ return [...documents];
177
+ }
178
+ function releaseTableSubscriptions() {
179
+ for (const [document, release] of tableSubscriptions) {
180
+ tableSubscriptions.delete(document);
181
+ release();
182
+ }
183
+ }
184
+ function syncTableSubscriptions() {
185
+ if (!notifications || pageTableHolds === 0)
186
+ return;
187
+ const wanted = new Set(pageTableDocuments());
188
+ for (const [document, release] of tableSubscriptions) {
189
+ if (wanted.has(document))
190
+ continue;
191
+ tableSubscriptions.delete(document);
192
+ release();
193
+ }
194
+ for (const document of wanted) {
195
+ if (tableSubscriptions.has(document))
196
+ continue;
197
+ tableSubscriptions.set(document, notifications.watch(document, scheduleLiveRefresh));
198
+ }
199
+ }
200
+ /**
201
+ * The availability signal the page shows.
202
+ *
203
+ * With a live collection the page's truth is the *collection's* sync state,
204
+ * not the transport's global state: `live` only when the table's own feed is
205
+ * established and the transport is actually pushing. Without one, this is the
206
+ * transport's state, exactly as before.
207
+ */
208
+ function currentLiveUpdates() {
209
+ const transport = notifications ? notifications.getState() : 'unavailable';
210
+ if (!credentials || !host.capabilities.podCollections)
211
+ return transport;
212
+ const sync = host.capabilities.podCollections.syncState(credentials.collection);
213
+ if (sync === 'unavailable' || sync === 'degraded' || transport === 'unavailable') {
214
+ return 'unavailable';
215
+ }
216
+ return sync === 'live' && transport === 'live' ? 'live' : 'idle';
217
+ }
218
+ notifications?.subscribeState(() => {
219
+ const next = currentLiveUpdates();
220
+ if (next === liveUpdates)
221
+ return;
222
+ liveUpdates = next;
223
+ notify();
224
+ });
225
+ host.capabilities.podCollections?.subscribeSyncState(() => {
226
+ const next = currentLiveUpdates();
227
+ if (next === liveUpdates)
228
+ return;
229
+ liveUpdates = next;
230
+ notify();
231
+ });
232
+ /**
233
+ * The page's live rows: re-read from the collection when it changes, and
234
+ * `undefined` until its first read lands (or forever, when there is no
235
+ * collection). One snapshot object per change keeps `useSyncExternalStore`
236
+ * stable between reads.
237
+ */
238
+ function publishCredentialRows() {
239
+ const collection = credentials?.collection;
240
+ const next = collection?.isReady()
241
+ ? collection.toArray
242
+ : undefined;
243
+ if (next === credentialRows)
244
+ return;
245
+ credentialRows = next;
246
+ notify();
247
+ }
248
+ /**
249
+ * Adopt the host's credentials collection once the lazy layer has it.
250
+ *
251
+ * Three things change at once, and they have to change together: the rows the
252
+ * page renders (from the collection's own change feed and status), the
253
+ * credential mutations (the client dispatches to them from now on), and the
254
+ * fallback table watch - the credentials document leaves the controller's
255
+ * `liveRevision` path because the collection now owns that table, which has to
256
+ * happen by releasing the subscription the controller opened before the
257
+ * collection arrived.
258
+ */
259
+ function adoptCredentials(loaded, mutations) {
260
+ credentials = loaded;
261
+ credentialMutations = mutations;
262
+ const collection = loaded.collection;
263
+ // The collection is owned by the host capability and lives as long as the
264
+ // session; these two subscriptions live with it rather than with the page.
265
+ collection.subscribeChanges(() => publishCredentialRows());
266
+ collection.on('status:change', () => publishCredentialRows());
267
+ publishCredentialRows();
268
+ syncTableSubscriptions();
269
+ notify();
270
+ }
271
+ // A host that offers no collection never fetches the layer: the capability is
272
+ // checked before the dynamic import, not inside it.
273
+ if (authenticated && sessionSnapshot.webId && host.capabilities.podCollections) {
274
+ void credentialCollectionRuntime()
275
+ .then(async (runtime) => {
276
+ const loaded = await runtime.openCredentialCollection(host);
277
+ if (!loaded || !podStore)
278
+ return;
279
+ adoptCredentials(loaded, runtime.collectionCredentialMutations(loaded, podStore));
280
+ })
281
+ // No collection layer (chunk unavailable, layout underivable, table
282
+ // undefined): the page keeps the store's own reads, as before.
283
+ .catch(() => undefined);
284
+ }
95
285
  const controller = {
96
286
  client,
97
287
  openExternal: host.navigation.openExternal,
98
288
  clientConfigurationBridge: host.capabilities.aiClientConfiguration,
289
+ get credentialsCollection() {
290
+ return credentials?.collection;
291
+ },
292
+ get credentialRows() {
293
+ return credentialRows;
294
+ },
99
295
  get selectedSection() {
100
296
  return selectedSection;
101
297
  },
@@ -117,10 +313,32 @@ export function createAiConnectionsController(host) {
117
313
  get providerLoadError() {
118
314
  return providerLoadError;
119
315
  },
316
+ get liveUpdates() {
317
+ return liveUpdates;
318
+ },
319
+ get liveRevision() {
320
+ return liveRevision;
321
+ },
322
+ watchPageTables() {
323
+ pageTableHolds += 1;
324
+ syncTableSubscriptions();
325
+ let released = false;
326
+ return () => {
327
+ if (released)
328
+ return;
329
+ released = true;
330
+ pageTableHolds -= 1;
331
+ if (pageTableHolds > 0)
332
+ return;
333
+ pageTableHolds = 0;
334
+ releaseTableSubscriptions();
335
+ };
336
+ },
120
337
  selectSection(section) {
121
338
  if (selectedSection === section)
122
339
  return;
123
340
  selectedSection = section;
341
+ syncTableSubscriptions();
124
342
  notify();
125
343
  },
126
344
  selectProvider(provider, credentialId) {
@@ -132,6 +350,7 @@ export function createAiConnectionsController(host) {
132
350
  selectedSection = 'provider';
133
351
  selectedProvider = provider;
134
352
  selectedCredentialId = nextCredentialId;
353
+ syncTableSubscriptions();
135
354
  notify();
136
355
  },
137
356
  selectFirstUnconfiguredProvider() {
@@ -255,7 +474,7 @@ function withAccountClientCredentials(client, credentials) {
255
474
  },
256
475
  };
257
476
  }
258
- function createInteractiveAiConnectionsClient(operationsClient, podStore, beginProviderLoad) {
477
+ function createInteractiveAiConnectionsClient(operationsClient, podStore, live, beginProviderLoad) {
259
478
  const listProviders = async () => {
260
479
  const guard = beginProviderLoad();
261
480
  try {
@@ -327,7 +546,7 @@ function createInteractiveAiConnectionsClient(operationsClient, podStore, beginP
327
546
  }
328
547
  return { credential, secret, didRefresh };
329
548
  };
330
- return {
549
+ const storeClient = {
331
550
  ...operationsClient,
332
551
  listProviders,
333
552
  listModels: podStore.listModels
@@ -556,6 +775,35 @@ function createInteractiveAiConnectionsClient(operationsClient, podStore, beginP
556
775
  ? async (provider, modelIds, credentialId) => podStore.saveModelSelection(provider, modelIds, credentialId)
557
776
  : operationsClient.saveModelSelection,
558
777
  };
778
+ /**
779
+ * With a live credentials collection, credential writes go through it: the
780
+ * page sees them immediately, they roll back on rejection, and the document's
781
+ * own echo reconciles instead of overwriting.
782
+ *
783
+ * The collection may not be there yet (the layer loads lazily) and may never
784
+ * be (a host without the capability), so this dispatches per call: until the
785
+ * table lands, every write is the store's own, exactly as before.
786
+ *
787
+ * Reads of credentials stay in `listProviders` for now (it also carries
788
+ * providers and models); the page renders the credential lists from the
789
+ * collection's rows, and the store's summary of the same row is only the
790
+ * enrichment for attributes the descriptor cannot project.
791
+ */
792
+ const credentialStore = {
793
+ createApiKeyCredential: (provider, input) => live.mutations()?.createApiKeyCredential(provider, input)
794
+ ?? storeClient.createApiKeyCredential(provider, input),
795
+ // Two local-connection flows are account/Gateway operations, not Pod rows.
796
+ createLocalCredential: (provider, input) => (input.authorizationMethodId === 'local-session-import'
797
+ || (!input.authorizationMethodId && input.offeringId === 'official-subscription')
798
+ ? storeClient.createLocalCredential(provider, input)
799
+ : live.mutations()?.createLocalCredential(provider, input)
800
+ ?? storeClient.createLocalCredential(provider, input)),
801
+ updateProviderCredential: (provider, credentialId, input) => live.mutations()?.updateProviderCredential(provider, credentialId, input)
802
+ ?? storeClient.updateProviderCredential(provider, credentialId, input),
803
+ deleteProviderCredential: (provider, credentialId) => live.mutations()?.deleteProviderCredential(provider, credentialId)
804
+ ?? storeClient.deleteProviderCredential(provider, credentialId),
805
+ };
806
+ return { ...storeClient, ...credentialStore };
559
807
  }
560
808
  export function useSelectedSection(controller) {
561
809
  return useSyncExternalStore(controller.subscribe, () => controller.selectedSection ?? 'provider', () => controller.selectedSection ?? 'provider');
@@ -575,12 +823,33 @@ export function useProviderStates(controller) {
575
823
  export function useProviderSummaries(controller) {
576
824
  return useSyncExternalStore(controller.subscribe, () => legacySummariesFor(controller.providerSummaries), () => legacySummariesFor(controller.providerSummaries));
577
825
  }
826
+ /**
827
+ * Providers this deployment offers, as reported by the server.
828
+ *
829
+ * Cloud answers with the operator-designated providers only (no self-hosted
830
+ * `custom`, no local daemon), so the settings surface cannot offer a provider the
831
+ * deployment does not provide. Before the first successful load this is
832
+ * `undefined`, which keeps every provider visible (Local behavior).
833
+ */
834
+ export function useAvailableProviders(controller) {
835
+ const summaries = useProviderSummaries(controller);
836
+ const ids = Object.keys(summaries);
837
+ return ids.length > 0 ? ids : undefined;
838
+ }
578
839
  export function useProviderProducts(controller) {
579
840
  return useSyncExternalStore(controller.subscribe, () => controller.providerSummaries, () => controller.providerSummaries);
580
841
  }
581
842
  export function useProviderLoadError(controller) {
582
843
  return useSyncExternalStore(controller.subscribe, () => controller.providerLoadError, () => controller.providerLoadError);
583
844
  }
845
+ /** Whether live Pod updates are on, for a status affordance that stays small. */
846
+ export function useLiveUpdates(controller) {
847
+ return useSyncExternalStore(controller.subscribe, () => controller.liveUpdates, () => controller.liveUpdates);
848
+ }
849
+ /** Advances once per coalesced burst of Pod changes; drives page re-reads. */
850
+ export function useLiveRevision(controller) {
851
+ return useSyncExternalStore(controller.subscribe, () => controller.liveRevision, () => controller.liveRevision);
852
+ }
584
853
  function productStateFromProvider(product) {
585
854
  if (!product || product.status === 'unconfigured' || product.status === 'unavailable') {
586
855
  return 'unconfigured';
@@ -660,14 +929,15 @@ function mergeAuthorizationMethodsIntoProviders(providers, methods) {
660
929
  const capability = methodsByOffering.get(`${provider.id}:${offering.id}`);
661
930
  if (!capability)
662
931
  return offering;
932
+ // The server's list is authoritative, an empty one included: it omits a
933
+ // connect entry this build has not implemented, and that omission has to
934
+ // survive the merge rather than fall back to deriving one from `authModes`.
663
935
  const authorizationMethods = capability.authorizationMethods;
664
936
  return {
665
937
  ...offering,
666
938
  ...(capability.endpoints ? { endpoints: capability.endpoints } : {}),
667
- ...(authorizationMethods.length ? {
668
- authorizationMethods,
669
- authModes: mergeAuthModes(offering.authModes, authorizationMethods.map((method) => method.authMode)),
670
- } : {}),
939
+ authorizationMethods,
940
+ authModes: mergeAuthModes(offering.authModes, authorizationMethods.map((method) => method.authMode)),
671
941
  };
672
942
  }),
673
943
  }));
@@ -745,7 +1015,7 @@ function isDefined(value) {
745
1015
  return value !== undefined;
746
1016
  }
747
1017
  function errorMessage(error) {
748
- return normalizeAiConnectionsThrownError(error);
1018
+ return aiConnectionsErrorMessage(error);
749
1019
  }
750
1020
  /** The wrapper carries the OIDC client id; parsing it needs no stored secret. */
751
1021
  function clientIdFromApiKey(apiKey) {
@@ -1,10 +1,15 @@
1
- import type { AiProviderCredentialSummary } from './ai-connections-client';
1
+ import type { AiProviderCredentialSummary } from '@undefineds.co/ai-connections-core/client';
2
2
  /** Highest priority first: a new credential joins the end of the pool. */
3
3
  export declare function nextCredentialPriority(credentials: AiProviderCredentialSummary[]): number;
4
4
  export declare function credentialDisplayLabel(credential: AiProviderCredentialSummary): string;
5
5
  /** Account names are shown inside a pool; only the domain stays readable. */
6
6
  export declare function maskAccountLabel(value: string): string;
7
7
  export declare function healthLabel(health: AiProviderCredentialSummary['health']): string;
8
+ /**
9
+ * Tone of one credential row: the tint the row carries and the colour of its
10
+ * health dot. The row's border and dividers belong to the list container now, so
11
+ * the tone is a background rather than a box.
12
+ */
8
13
  export declare function healthTone(health: AiProviderCredentialSummary['health']): {
9
14
  row: string;
10
15
  dot: string;
@@ -36,12 +36,17 @@ export function healthLabel(health) {
36
36
  return '已过期';
37
37
  return '错误';
38
38
  }
39
+ /**
40
+ * Tone of one credential row: the tint the row carries and the colour of its
41
+ * health dot. The row's border and dividers belong to the list container now, so
42
+ * the tone is a background rather than a box.
43
+ */
39
44
  export function healthTone(health) {
40
45
  if (health === 'healthy') {
41
- return { row: 'border-emerald-500/40 bg-emerald-500/5', dot: 'bg-emerald-500' };
46
+ return { row: 'bg-emerald-500/5', dot: 'bg-emerald-500' };
42
47
  }
43
48
  if (health === 'unknown') {
44
- return { row: 'border-border/50 bg-background', dot: 'bg-muted-foreground/50' };
49
+ return { row: 'bg-background', dot: 'bg-muted-foreground/50' };
45
50
  }
46
- return { row: 'border-destructive/40 bg-destructive/5', dot: 'bg-destructive' };
51
+ return { row: 'bg-destructive/5', dot: 'bg-destructive' };
47
52
  }
@@ -0,0 +1,20 @@
1
+ import type { AiConnectionsProvider, AiProviderAuthorizationMethod } from '@undefineds.co/ai-connections-core/client';
2
+ /**
3
+ * Wording for one connect entry.
4
+ *
5
+ * A payload that declares its own wording keeps it: the entry's own name is the
6
+ * more specific statement, and it is how a provider the user configured names
7
+ * its entry, and how one offering renames a shared action for its context. The
8
+ * table only fills the gap the shared core deliberately leaves - it names the
9
+ * action by `id` and no longer writes the button.
10
+ */
11
+ export declare function authorizationMethodLabel(method: AiProviderAuthorizationMethod): string | undefined;
12
+ /** Fills in the wording of every entry that has one. */
13
+ export declare function withAuthorizationMethodLabels(methods: readonly AiProviderAuthorizationMethod[]): AiProviderAuthorizationMethod[];
14
+ /**
15
+ * The name this applet shows for a provider. English for the providers whose
16
+ * product name is English, Chinese where the product is known by its Chinese
17
+ * name - a display decision, so it lives with the display layer instead of
18
+ * travelling in every payload.
19
+ */
20
+ export declare function providerDisplayName(provider: AiConnectionsProvider): string;
@@ -0,0 +1,73 @@
1
+ /**
2
+ * The wording this applet shows, in one place.
3
+ *
4
+ * The shared core carries what a provider *is* and how to talk to it - ids,
5
+ * auth modes, connect modes, endpoints - and deliberately carries no user-facing
6
+ * wording. A connect entry's wording is a property of the entry's id, so it
7
+ * belongs here, where it is rendered, rather than in the catalog, in the
8
+ * payload the server sends, and in this applet's own fallback derivation, which
9
+ * is where the same button used to be named three different ways.
10
+ *
11
+ * An id this table does not know keeps whatever wording its payload declared:
12
+ * a provider the user configured themselves can still name its own entry, and an
13
+ * entry that names nothing stays unrendered, which is how "the offering did not
14
+ * ask for this button" has always been expressed.
15
+ *
16
+ * The table lists only the ids the shared core stopped naming - the four connect
17
+ * actions plus the browser authorization-code entry. A declared wording always
18
+ * wins (see `authorizationMethodLabel`); this is the fallback that keeps a
19
+ * payload naming nothing renderable under the action's own name.
20
+ */
21
+ const AUTHORIZATION_METHOD_LABEL_BY_ID = {
22
+ 'api-key': '添加 API Key',
23
+ 'browser-login': '浏览器登录',
24
+ 'browser-oauth': '浏览器登录',
25
+ 'device-code': '设备码登录',
26
+ 'local-session-import': '已有登录态',
27
+ 'local-service': '本地服务',
28
+ };
29
+ /**
30
+ * Wording for one connect entry.
31
+ *
32
+ * A payload that declares its own wording keeps it: the entry's own name is the
33
+ * more specific statement, and it is how a provider the user configured names
34
+ * its entry, and how one offering renames a shared action for its context. The
35
+ * table only fills the gap the shared core deliberately leaves - it names the
36
+ * action by `id` and no longer writes the button.
37
+ */
38
+ export function authorizationMethodLabel(method) {
39
+ return method.label ?? AUTHORIZATION_METHOD_LABEL_BY_ID[method.id];
40
+ }
41
+ /** Fills in the wording of every entry that has one. */
42
+ export function withAuthorizationMethodLabels(methods) {
43
+ return methods.map((method) => {
44
+ const label = authorizationMethodLabel(method);
45
+ return label === method.label ? method : { ...method, label };
46
+ });
47
+ }
48
+ /**
49
+ * The name this applet shows for a provider. English for the providers whose
50
+ * product name is English, Chinese where the product is known by its Chinese
51
+ * name - a display decision, so it lives with the display layer instead of
52
+ * travelling in every payload.
53
+ */
54
+ export function providerDisplayName(provider) {
55
+ switch (provider) {
56
+ case 'openai':
57
+ return 'OpenAI';
58
+ case 'anthropic':
59
+ return 'Anthropic';
60
+ case 'kimi':
61
+ return 'Kimi';
62
+ case 'bailian':
63
+ return '百炼';
64
+ case 'deepseek':
65
+ return 'DeepSeek';
66
+ case 'zhipu':
67
+ return '智谱 AI';
68
+ case 'ollama':
69
+ return 'Ollama';
70
+ case 'custom':
71
+ return 'Custom';
72
+ }
73
+ }