@undefineds.co/xpod 0.4.10 → 0.4.12

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 (402) 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/ai/service/AiCredentialSecret.d.ts +30 -0
  5. package/dist/ai/service/AiCredentialSecret.js +120 -0
  6. package/dist/ai/service/CredentialReaderImpl.d.ts +18 -0
  7. package/dist/ai/service/CredentialReaderImpl.js +81 -5
  8. package/dist/ai/service/CredentialReaderImpl.jsonld +42 -2
  9. package/dist/ai/service/EmbeddingModelPolicy.d.ts +79 -0
  10. package/dist/ai/service/EmbeddingModelPolicy.js +134 -0
  11. package/dist/ai/service/EmbeddingProviderError.js +6 -0
  12. package/dist/ai/service/EmbeddingServiceImpl.d.ts +13 -1
  13. package/dist/ai/service/EmbeddingServiceImpl.js +18 -5
  14. package/dist/ai/service/EmbeddingServiceImpl.jsonld +35 -0
  15. package/dist/ai/service/index.d.ts +2 -0
  16. package/dist/ai/service/index.js +2 -0
  17. package/dist/api/ai-gateway/connect/index.d.ts +20 -2
  18. package/dist/api/ai-gateway/connect/index.js +162 -16
  19. package/dist/api/ai-gateway/credentials/AiCredentialSecretDecoder.d.ts +12 -0
  20. package/dist/api/ai-gateway/credentials/AiCredentialSecretDecoder.js +30 -0
  21. package/dist/api/ai-gateway/errors.d.ts +1 -1
  22. package/dist/api/ai-gateway/models/GatewayEmbeddingModelCatalog.d.ts +11 -0
  23. package/dist/api/ai-gateway/models/GatewayEmbeddingModelCatalog.js +31 -0
  24. package/dist/api/ai-gateway/models/PodModelSelectionRepository.js +7 -3
  25. package/dist/api/ai-gateway/models/ProviderCustomModelsService.d.ts +18 -0
  26. package/dist/api/ai-gateway/models/ProviderCustomModelsService.js +23 -0
  27. package/dist/api/ai-gateway/models/ProviderModelDiscoveryAdapters.d.ts +3 -1
  28. package/dist/api/ai-gateway/models/ProviderModelDiscoveryAdapters.js +2 -45
  29. package/dist/api/ai-gateway/models/ProviderModelSelectionService.d.ts +10 -0
  30. package/dist/api/ai-gateway/models/ProviderModelSelectionService.js +57 -20
  31. package/dist/api/ai-gateway/models/ProviderModelType.d.ts +28 -0
  32. package/dist/api/ai-gateway/models/ProviderModelType.js +34 -0
  33. package/dist/api/ai-gateway/models/ProviderModelsAdapter.d.ts +10 -0
  34. package/dist/api/ai-gateway/models/ProviderModelsAdapter.js +3 -4
  35. package/dist/api/ai-gateway/models/index.d.ts +1 -0
  36. package/dist/api/ai-gateway/models/index.js +3 -1
  37. package/dist/api/ai-gateway/providers/CustomRuntimeAdapter.d.ts +7 -0
  38. package/dist/api/ai-gateway/providers/CustomRuntimeAdapter.js +9 -2
  39. package/dist/api/ai-gateway/providers/ModelsDevCatalog.d.ts +7 -1
  40. package/dist/api/ai-gateway/providers/ModelsDevCatalog.js +4 -10
  41. package/dist/api/ai-gateway/providers/ProviderRegistry.d.ts +107 -0
  42. package/dist/api/ai-gateway/providers/ProviderRegistry.js +244 -21
  43. package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.d.ts +5 -0
  44. package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.js +5 -1
  45. package/dist/api/ai-gateway/quota/SubscriptionQuotaAdapters.d.ts +12 -4
  46. package/dist/api/ai-gateway/quota/SubscriptionQuotaAdapters.js +11 -11
  47. package/dist/api/ai-gateway/routing/ModelRouter.d.ts +14 -0
  48. package/dist/api/ai-gateway/routing/ModelRouter.js +43 -4
  49. package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.d.ts +9 -1
  50. package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.js +3 -27
  51. package/dist/api/auth/ClientCredentialsAuthenticator.d.ts +0 -1
  52. package/dist/api/auth/ClientCredentialsAuthenticator.js +0 -3
  53. package/dist/api/auth/index.d.ts +1 -0
  54. package/dist/api/auth/index.js +1 -1
  55. package/dist/api/chatkit/pod-store.d.ts +31 -0
  56. package/dist/api/chatkit/pod-store.js +132 -8
  57. package/dist/api/container/common.js +24 -4
  58. package/dist/api/container/routes.js +17 -2
  59. package/dist/api/container/types.d.ts +3 -1
  60. package/dist/api/handlers/AdminHandler.d.ts +13 -0
  61. package/dist/api/handlers/AdminHandler.js +47 -18
  62. package/dist/api/handlers/AiConfigHandler.d.ts +6 -0
  63. package/dist/api/handlers/AiConfigHandler.js +28 -0
  64. package/dist/api/handlers/AiGatewayManagementHandler.js +36 -0
  65. package/dist/api/runs/RdfRunContextRetriever.d.ts +14 -0
  66. package/dist/api/runs/RdfRunContextRetriever.js +41 -5
  67. package/dist/api/runtime.js +2 -1
  68. package/dist/cli/commands/secret.d.ts +1 -0
  69. package/dist/cli/commands/secret.js +25 -7
  70. package/dist/components/components.jsonld +3 -1
  71. package/dist/components/context.jsonld +53 -1
  72. package/dist/http/SubgraphSparqlHttpHandler.d.ts +59 -2
  73. package/dist/http/SubgraphSparqlHttpHandler.js +145 -13
  74. package/dist/http/SubgraphSparqlHttpHandler.jsonld +37 -0
  75. package/dist/identity/drizzle/AccountRoleRepository.d.ts +30 -2
  76. package/dist/identity/drizzle/AccountRoleRepository.js +163 -15
  77. package/dist/identity/drizzle/EdgeNodeRepository.d.ts +0 -12
  78. package/dist/identity/drizzle/EdgeNodeRepository.js +5 -13
  79. package/dist/identity/drizzle/PodLookupRepository.d.ts +58 -4
  80. package/dist/identity/drizzle/PodLookupRepository.js +248 -105
  81. package/dist/identity/drizzle/db.d.ts +19 -0
  82. package/dist/identity/drizzle/db.js +39 -4
  83. package/dist/index.d.ts +2 -1
  84. package/dist/index.js +7 -3
  85. package/dist/logging/log-file.d.ts +17 -0
  86. package/dist/logging/log-file.js +69 -0
  87. package/dist/main.js +2 -1
  88. package/dist/notifications/NotificationChannelSweeper.d.ts +50 -0
  89. package/dist/notifications/NotificationChannelSweeper.js +131 -0
  90. package/dist/notifications/NotificationChannelSweeper.jsonld +136 -0
  91. package/dist/notifications/ReclaimingWebSocket2023Storer.d.ts +25 -0
  92. package/dist/notifications/ReclaimingWebSocket2023Storer.js +56 -0
  93. package/dist/notifications/ReclaimingWebSocket2023Storer.jsonld +77 -0
  94. package/dist/notifications/index.d.ts +2 -0
  95. package/dist/notifications/index.js +2 -0
  96. package/dist/runtime/Proxy.d.ts +37 -0
  97. package/dist/runtime/Proxy.js +88 -16
  98. package/dist/runtime/bootstrap.js +2 -1
  99. package/dist/runtime/upgrade/BunNativeUpgradeRelay.d.ts +116 -0
  100. package/dist/runtime/upgrade/BunNativeUpgradeRelay.js +423 -0
  101. package/dist/runtime/upgrade/UpgradeHandshake.d.ts +63 -0
  102. package/dist/runtime/upgrade/UpgradeHandshake.js +199 -0
  103. package/dist/runtime/upgrade/WebSocketFrames.d.ts +67 -0
  104. package/dist/runtime/upgrade/WebSocketFrames.js +224 -0
  105. package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.js +8 -1
  106. package/node_modules/@undefineds.co/ai-connections/dist/AiAuthorizationActions.d.ts +11 -2
  107. package/node_modules/@undefineds.co/ai-connections/dist/AiAuthorizationActions.js +27 -10
  108. package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.d.ts +7 -0
  109. package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.js +13 -11
  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 +16 -1
  116. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.js +92 -20
  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.js +71 -11
  120. package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialRow.js +9 -7
  121. package/node_modules/@undefineds.co/ai-connections/dist/AiEndpointList.d.ts +23 -0
  122. package/node_modules/@undefineds.co/ai-connections/dist/AiEndpointList.js +24 -0
  123. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.d.ts +13 -4
  124. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.js +35 -38
  125. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayModelsSection.d.ts +21 -0
  126. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayModelsSection.js +51 -0
  127. package/node_modules/@undefineds.co/ai-connections/dist/AiInfoTooltip.d.ts +15 -0
  128. package/node_modules/@undefineds.co/ai-connections/dist/AiInfoTooltip.js +16 -0
  129. package/node_modules/@undefineds.co/ai-connections/dist/AiModelCatalog.d.ts +175 -0
  130. package/node_modules/@undefineds.co/ai-connections/dist/AiModelCatalog.js +133 -0
  131. package/node_modules/@undefineds.co/ai-connections/dist/AiOfferingDetails.js +2 -2
  132. package/node_modules/@undefineds.co/ai-connections/dist/AiProviderCard.js +13 -64
  133. package/node_modules/@undefineds.co/ai-connections/dist/AiProviderHeader.d.ts +21 -0
  134. package/node_modules/@undefineds.co/ai-connections/dist/AiProviderHeader.js +12 -0
  135. package/node_modules/@undefineds.co/ai-connections/dist/AiRowAction.d.ts +15 -0
  136. package/node_modules/@undefineds.co/ai-connections/dist/AiRowAction.js +12 -0
  137. package/node_modules/@undefineds.co/ai-connections/dist/AiSortableCredentialList.js +2 -1
  138. package/node_modules/@undefineds.co/ai-connections/dist/ai-connections-client.d.ts +7 -0
  139. package/node_modules/@undefineds.co/ai-connections/dist/ai-connections-client.js +6 -0
  140. package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.d.ts +36 -5
  141. package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.js +52 -9
  142. package/node_modules/@undefineds.co/ai-connections/dist/client/normalize.js +30 -3
  143. package/node_modules/@undefineds.co/ai-connections/dist/client/types.d.ts +21 -1
  144. package/node_modules/@undefineds.co/ai-connections/dist/client-config/base-adapter.d.ts +1 -3
  145. package/node_modules/@undefineds.co/ai-connections/dist/client-config/base-adapter.js +3 -7
  146. package/node_modules/@undefineds.co/ai-connections/dist/client-config/index.cjs +9 -7
  147. package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.d.ts +46 -0
  148. package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.js +231 -0
  149. package/node_modules/@undefineds.co/ai-connections/dist/collections.d.ts +119 -0
  150. package/node_modules/@undefineds.co/ai-connections/dist/collections.js +173 -0
  151. package/node_modules/@undefineds.co/ai-connections/dist/controller.d.ts +71 -5
  152. package/node_modules/@undefineds.co/ai-connections/dist/controller.js +285 -16
  153. package/node_modules/@undefineds.co/ai-connections/dist/credential-labels.d.ts +5 -0
  154. package/node_modules/@undefineds.co/ai-connections/dist/credential-labels.js +8 -3
  155. package/node_modules/@undefineds.co/ai-connections/dist/credential-storage.d.ts +59 -0
  156. package/node_modules/@undefineds.co/ai-connections/dist/credential-storage.js +131 -0
  157. package/node_modules/@undefineds.co/ai-connections/dist/endpoint-urls.d.ts +15 -0
  158. package/node_modules/@undefineds.co/ai-connections/dist/endpoint-urls.js +20 -0
  159. package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.d.ts +14 -0
  160. package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.js +20 -0
  161. package/node_modules/@undefineds.co/ai-connections/dist/index.d.ts +8 -0
  162. package/node_modules/@undefineds.co/ai-connections/dist/index.js +8 -0
  163. package/node_modules/@undefineds.co/ai-connections/dist/manifest.js +1 -1
  164. package/node_modules/@undefineds.co/ai-connections/dist/offering-endpoints.d.ts +14 -0
  165. package/node_modules/@undefineds.co/ai-connections/dist/offering-endpoints.js +17 -0
  166. package/node_modules/@undefineds.co/ai-connections/dist/provider-catalog.cjs +68 -1
  167. package/node_modules/@undefineds.co/ai-connections/dist/provider-catalog.d.ts +75 -1
  168. package/node_modules/@undefineds.co/ai-connections/dist/provider-catalog.js +119 -0
  169. package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.d.ts +5 -0
  170. package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.js +5 -0
  171. package/node_modules/@undefineds.co/ai-connections/dist/service-access.js +2 -27
  172. package/node_modules/@undefineds.co/ai-connections/package.json +1 -0
  173. package/node_modules/@undefineds.co/extension-sdk/dist/manifest.d.ts +1 -1
  174. package/node_modules/@undefineds.co/extension-sdk/dist/manifest.js +2 -0
  175. package/node_modules/@undefineds.co/extension-sdk/dist/web.d.ts +150 -0
  176. package/node_modules/@undefineds.co/extension-sdk/package.json +2 -1
  177. package/node_modules/@undefineds.co/models/README.md +1 -1
  178. package/node_modules/@undefineds.co/models/dist/ai-config/index.d.ts +3 -3
  179. package/node_modules/@undefineds.co/models/dist/ai-gateway.schema.d.ts +5 -0
  180. package/node_modules/@undefineds.co/models/dist/ai-gateway.schema.js +9 -0
  181. package/node_modules/@undefineds.co/models/dist/ai-runtime.repository.d.ts +1 -1
  182. package/node_modules/@undefineds.co/models/dist/approval.repository.d.ts +2 -2
  183. package/node_modules/@undefineds.co/models/dist/audit.presentation.d.ts +2 -2
  184. package/node_modules/@undefineds.co/models/dist/capture.repository.d.ts +1 -1
  185. package/node_modules/@undefineds.co/models/dist/chat-project.repository.d.ts +1 -1
  186. package/node_modules/@undefineds.co/models/dist/chat.repository.d.ts +2 -2
  187. package/node_modules/@undefineds.co/models/dist/control-request.repository.d.ts +2 -2
  188. package/node_modules/@undefineds.co/models/dist/conversation-share.repository.d.ts +1 -1
  189. package/node_modules/@undefineds.co/models/dist/credential.schema.d.ts +12 -0
  190. package/node_modules/@undefineds.co/models/dist/credential.schema.js +15 -1
  191. package/node_modules/@undefineds.co/models/dist/discovery/index.d.ts +2 -2
  192. package/node_modules/@undefineds.co/models/dist/discovery/providers.json +248 -7
  193. package/node_modules/@undefineds.co/models/dist/discovery/types.d.ts +31 -0
  194. package/node_modules/@undefineds.co/models/dist/extension/index.d.ts +1 -1
  195. package/node_modules/@undefineds.co/models/dist/favorite/index.d.ts +2 -2
  196. package/node_modules/@undefineds.co/models/dist/fixtures/contracts-chat-contact.d.ts +5 -5
  197. package/node_modules/@undefineds.co/models/dist/import/index.d.ts +1 -1
  198. package/node_modules/@undefineds.co/models/dist/index.d.ts +73 -73
  199. package/node_modules/@undefineds.co/models/dist/index.js +1 -1
  200. package/node_modules/@undefineds.co/models/dist/input-request.repository.d.ts +2 -2
  201. package/node_modules/@undefineds.co/models/dist/knowledge/index.d.ts +1 -1
  202. package/node_modules/@undefineds.co/models/dist/message.repository.d.ts +1 -1
  203. package/node_modules/@undefineds.co/models/dist/namespaces.js +5 -0
  204. package/node_modules/@undefineds.co/models/dist/pod-storage-descriptor.d.ts +4815 -26
  205. package/node_modules/@undefineds.co/models/dist/pod-storage-descriptor.js +482 -132
  206. package/node_modules/@undefineds.co/models/dist/schema.d.ts +4 -0
  207. package/node_modules/@undefineds.co/models/dist/session/index.d.ts +1 -1
  208. package/node_modules/@undefineds.co/models/dist/settings/index.d.ts +1 -1
  209. package/node_modules/@undefineds.co/models/dist/sidecar/persistence-mapping.d.ts +5 -5
  210. package/node_modules/@undefineds.co/models/dist/thread.repository.d.ts +2 -2
  211. package/node_modules/@undefineds.co/models/dist/types/message-block.d.ts +1 -1
  212. package/node_modules/@undefineds.co/models/dist/vocab/_namespaces.d.ts +1 -1
  213. package/node_modules/@undefineds.co/models/dist/vocab/index.d.ts +10 -10
  214. package/node_modules/@undefineds.co/models/dist/vocab/sidecar.vocab.d.ts +1 -0
  215. package/node_modules/@undefineds.co/models/dist/vocab/sidecar.vocab.js +1 -0
  216. package/node_modules/@undefineds.co/models/package.json +4 -2
  217. package/node_modules/@undefineds.co/pod-collections/README.md +71 -0
  218. package/node_modules/@undefineds.co/pod-collections/dist/diff.d.ts +85 -0
  219. package/node_modules/@undefineds.co/pod-collections/dist/diff.js +166 -0
  220. package/node_modules/@undefineds.co/pod-collections/dist/feed.d.ts +17 -0
  221. package/node_modules/@undefineds.co/pod-collections/dist/feed.js +27 -0
  222. package/node_modules/@undefineds.co/pod-collections/dist/index.cjs +1042 -0
  223. package/node_modules/@undefineds.co/pod-collections/dist/index.d.ts +37 -0
  224. package/node_modules/@undefineds.co/pod-collections/dist/index.js +89 -0
  225. package/node_modules/@undefineds.co/pod-collections/dist/layout.d.ts +75 -0
  226. package/node_modules/@undefineds.co/pod-collections/dist/layout.js +173 -0
  227. package/node_modules/@undefineds.co/pod-collections/dist/mapping.d.ts +78 -0
  228. package/node_modules/@undefineds.co/pod-collections/dist/mapping.js +287 -0
  229. package/node_modules/@undefineds.co/pod-collections/dist/mutations.d.ts +83 -0
  230. package/node_modules/@undefineds.co/pod-collections/dist/mutations.js +273 -0
  231. package/node_modules/@undefineds.co/pod-collections/dist/react.d.ts +21 -0
  232. package/node_modules/@undefineds.co/pod-collections/dist/react.js +22 -0
  233. package/node_modules/@undefineds.co/pod-collections/dist/read.d.ts +65 -0
  234. package/node_modules/@undefineds.co/pod-collections/dist/read.js +31 -0
  235. package/node_modules/@undefineds.co/pod-collections/dist/sync.d.ts +66 -0
  236. package/node_modules/@undefineds.co/pod-collections/dist/sync.js +260 -0
  237. package/node_modules/@undefineds.co/pod-collections/dist/types.d.ts +155 -0
  238. package/node_modules/@undefineds.co/pod-collections/dist/types.js +9 -0
  239. package/node_modules/@undefineds.co/pod-collections/package.json +42 -0
  240. package/node_modules/@undefineds.co/shared-ui/dist/index.d.ts +0 -1
  241. package/node_modules/@undefineds.co/shared-ui/dist/index.js +0 -1
  242. package/package.json +15 -7
  243. package/static/app/assets/main.css +1 -1
  244. package/static/app/assets/main.js +12 -13
  245. package/static/auth-callback/assets/AiConfigContext-DnQs1ZpW.js +1 -0
  246. package/static/auth-callback/assets/AiConfigPage-DOtvlxH0.js +1 -0
  247. package/static/auth-callback/assets/DocumentProcessingPanel-BS2voQgL.js +1 -0
  248. package/static/auth-callback/assets/IndexLifecyclePanel-Cvt0cJtN.js +1 -0
  249. package/static/auth-callback/assets/{IndexSubjectPanel-C4YG0whI.js → IndexSubjectPanel-Dhf01GqF.js} +1 -1
  250. package/static/auth-callback/assets/ModelAssignmentsPanel-BJutWaAF.js +1 -0
  251. package/static/auth-callback/assets/ModelsPage-BRS0sje3.js +11 -0
  252. package/static/auth-callback/assets/{NetworkPage-Cbdn_P1e.js → NetworkPage-B3qBfANA.js} +2 -2
  253. package/static/auth-callback/assets/{PaneListHeader-jy70Q00L.js → PaneListHeader-QQeJGTp4.js} +1 -1
  254. package/static/auth-callback/assets/SearchIndexingPanel-MyNUSEwT.js +1 -0
  255. package/static/auth-callback/assets/{StatusSubjectPanel-hfjoB5aS.js → StatusSubjectPanel-DQkEVsFs.js} +1 -1
  256. package/static/{settings/assets/StatusWorkspace-CKD_Rzdr.js → auth-callback/assets/StatusWorkspace-Dkv63Uwk.js} +1 -1
  257. package/static/auth-callback/assets/SystemSettingsPage-TIsUfX5d.js +1 -0
  258. package/static/auth-callback/assets/SystemSettingsSubjectPanel-BJWEt2-7.js +33 -0
  259. package/static/auth-callback/assets/XpodAiConnectionsPodStore-BJiXm-PF.js +3 -0
  260. package/static/auth-callback/assets/{activity-BcsZZxxw.js → activity-5hNeNKnL.js} +1 -1
  261. package/static/auth-callback/assets/admin-C6qCRFiY.js +1 -0
  262. package/static/auth-callback/assets/ai-connections-CryuHGKW.js +1 -0
  263. package/static/auth-callback/assets/{auth-callback-atKg_oig.js → auth-callback-CAFZ3R0B.js} +80 -84
  264. package/static/auth-callback/assets/auth-callback-rk080mvG.css +1 -0
  265. package/static/auth-callback/assets/{badge-BWbRHThQ.js → badge-CAIPI0CB.js} +1 -1
  266. package/static/auth-callback/assets/collection-runtime-D9s7h9YA.js +1 -0
  267. package/static/auth-callback/assets/dialog-BjA109aX.js +1 -0
  268. package/static/auth-callback/assets/{download-BmvG1Vya.js → download-B3Up5W2G.js} +1 -1
  269. package/static/auth-callback/assets/{external-link-DZ34d3g3.js → external-link-BTXgSPzB.js} +1 -1
  270. package/static/auth-callback/assets/index-BppXlxcp.js +41 -0
  271. package/static/auth-callback/assets/index-CirW4CJf.js +1 -0
  272. package/static/auth-callback/assets/index-DlLYWOhw.js +4 -0
  273. package/static/auth-callback/assets/{index-browser-B9Z7GU-T.js → index-browser-DtU38ni3.js} +1 -1
  274. package/static/auth-callback/assets/{key-round-tjP76Se-.js → key-round-CQCOrZ7x.js} +1 -1
  275. package/static/auth-callback/assets/layout-DB3pMyTl.js +1 -0
  276. package/static/auth-callback/assets/pod-collections-host-KnnGFZHL.js +8 -0
  277. package/static/auth-callback/assets/{rotate-ccw-C_L5ZLx1.js → rotate-ccw-C1zM2KtS.js} +1 -1
  278. package/static/auth-callback/assets/settings-projection-CUkyprDQ.js +1 -0
  279. package/static/auth-callback/assets/{skeleton-C7tGDQIs.js → skeleton-Cqp7_M9-.js} +1 -1
  280. package/static/auth-callback/assets/{waypoints-VMNQlWdU.js → waypoints-Bj6gAUSQ.js} +1 -1
  281. package/static/auth-callback/assets/{workspace-layout-SAp6BtYK.js → workspace-layout-DK8mDzrY.js} +1 -1
  282. package/static/auth-callback/auth-callback.html +2 -2
  283. package/static/dashboard/assets/AiConfigContext-BsE7MqX8.js +1 -0
  284. package/static/dashboard/assets/AiConfigPage-DvM-lRXa.js +1 -0
  285. package/static/dashboard/assets/DocumentProcessingPanel-BPfdlfuf.js +1 -0
  286. package/static/dashboard/assets/IndexLifecyclePanel--m0AGxvh.js +1 -0
  287. package/static/dashboard/assets/{IndexSubjectPanel-DQFPP6-p.js → IndexSubjectPanel-Bb7m1k3d.js} +1 -1
  288. package/static/dashboard/assets/ModelAssignmentsPanel-BLi_zbMa.js +1 -0
  289. package/static/dashboard/assets/ModelsPage-CxdpgnfR.js +11 -0
  290. package/static/dashboard/assets/{NetworkPage-CHQ3YxIB.js → NetworkPage-BAIPw-D_.js} +2 -2
  291. package/static/dashboard/assets/{PaneListHeader-DsXemAdR.js → PaneListHeader-BBCMei0r.js} +1 -1
  292. package/static/dashboard/assets/SearchIndexingPanel-Ck4Y-xjR.js +1 -0
  293. package/static/dashboard/assets/{StatusSubjectPanel-D3PGEYT4.js → StatusSubjectPanel-D1KWfAXE.js} +1 -1
  294. package/static/dashboard/assets/{StatusWorkspace-BcpePYUW.js → StatusWorkspace-JbA5gzXx.js} +1 -1
  295. package/static/dashboard/assets/SystemSettingsPage-BbwQWsSR.js +1 -0
  296. package/static/dashboard/assets/SystemSettingsSubjectPanel-N117nMt5.js +33 -0
  297. package/static/dashboard/assets/XpodAiConnectionsPodStore-CdDOb4SV.js +18 -0
  298. package/static/dashboard/assets/{activity-j5zrznu-.js → activity-DX1I96o_.js} +1 -1
  299. package/static/dashboard/assets/admin-C6qCRFiY.js +1 -0
  300. package/static/dashboard/assets/ai-connections-DwCRqOQa.js +1 -0
  301. package/static/dashboard/assets/{badge-CzeBdG7h.js → badge-k2vhtDqH.js} +1 -1
  302. package/static/dashboard/assets/collection-runtime-BFQ8teQJ.js +1 -0
  303. package/static/dashboard/assets/{dashboard-D-xANHk1.js → dashboard-DWZ-fmCT.js} +105 -109
  304. package/static/dashboard/assets/dashboard-rk080mvG.css +1 -0
  305. package/static/dashboard/assets/dialog-1CCw-iHT.js +1 -0
  306. package/static/dashboard/assets/{download-IcNdEZWi.js → download-C6-SNY1q.js} +1 -1
  307. package/static/dashboard/assets/{external-link-DxBxK8Vu.js → external-link-BgPcZ_j2.js} +1 -1
  308. package/static/dashboard/assets/index-6LcIUIYO.js +1 -0
  309. package/static/dashboard/assets/index-D7A8U6Pt.js +41 -0
  310. package/static/dashboard/assets/index-UD6QOE7H.js +4 -0
  311. package/static/dashboard/assets/{key-round-D1K7warM.js → key-round-BOd7Jo0Q.js} +1 -1
  312. package/static/dashboard/assets/layout-DB3pMyTl.js +1 -0
  313. package/static/dashboard/assets/pod-collections-host-KnnGFZHL.js +8 -0
  314. package/static/dashboard/assets/{rotate-ccw-CcN1N6p9.js → rotate-ccw-CCgJqsvx.js} +1 -1
  315. package/static/dashboard/assets/settings-projection-CUkyprDQ.js +1 -0
  316. package/static/dashboard/assets/{skeleton-CKnmJMUH.js → skeleton-Bc7abAn5.js} +1 -1
  317. package/static/dashboard/assets/{waypoints-DuZPO_wu.js → waypoints-s-opmJxx.js} +1 -1
  318. package/static/dashboard/assets/{workspace-layout-BUj3wZ_m.js → workspace-layout-DqIQeTBV.js} +1 -1
  319. package/static/dashboard/dashboard.html +2 -2
  320. package/static/settings/assets/AiConfigContext-BB9KZySa.js +1 -0
  321. package/static/settings/assets/AiConfigPage-DGSXUkLs.js +1 -0
  322. package/static/settings/assets/DocumentProcessingPanel-Da2Re6Rg.js +1 -0
  323. package/static/settings/assets/IndexLifecyclePanel-BSZuIzgr.js +1 -0
  324. package/static/settings/assets/{IndexSubjectPanel-73sM16Ma.js → IndexSubjectPanel-CFd0ay-r.js} +1 -1
  325. package/static/settings/assets/ModelAssignmentsPanel-CSAryvWJ.js +1 -0
  326. package/static/settings/assets/ModelsPage-BQwCwLHU.js +11 -0
  327. package/static/settings/assets/{NetworkPage-i6j-M2RY.js → NetworkPage-BKymvsQc.js} +2 -2
  328. package/static/settings/assets/{PaneListHeader-DpqC0jd5.js → PaneListHeader-Bjh3hRdQ.js} +1 -1
  329. package/static/settings/assets/SearchIndexingPanel-MjKL5QLU.js +1 -0
  330. package/static/settings/assets/{StatusSubjectPanel-Dv4q3PGh.js → StatusSubjectPanel-Bvl6K4mx.js} +1 -1
  331. package/static/settings/assets/StatusWorkspace-B0NzrP--.js +1 -0
  332. package/static/settings/assets/SystemSettingsPage-D2z6Z4FE.js +1 -0
  333. package/static/settings/assets/SystemSettingsSubjectPanel-4sxma4X4.js +33 -0
  334. package/static/settings/assets/XpodAiConnectionsPodStore-BkNQ8fZx.js +3 -0
  335. package/static/settings/assets/{activity-DaFkk8f3.js → activity-CgJJGpjx.js} +1 -1
  336. package/static/settings/assets/admin-C6qCRFiY.js +1 -0
  337. package/static/settings/assets/ai-connections-CryuHGKW.js +1 -0
  338. package/static/settings/assets/{badge-d5SHdc-x.js → badge-C4NypVyT.js} +1 -1
  339. package/static/settings/assets/collection-runtime-CTLCDxAi.js +1 -0
  340. package/static/settings/assets/dialog-Csq0vWUi.js +1 -0
  341. package/static/settings/assets/{download-CpkwomDr.js → download-DaLJJ-Wp.js} +1 -1
  342. package/static/settings/assets/{external-link-_4YT42Mf.js → external-link--w_iW5Au.js} +1 -1
  343. package/static/settings/assets/index-B0mQa59b.js +4 -0
  344. package/static/settings/assets/index-BukHiu4y.js +1 -0
  345. package/static/settings/assets/index-COmVnZi2.js +41 -0
  346. package/static/settings/assets/{index-browser-B06xjBdZ.js → index-browser-BGpvHwD0.js} +1 -1
  347. package/static/settings/assets/{key-round-Dlqmp1Kq.js → key-round-Bk4YRjBu.js} +1 -1
  348. package/static/settings/assets/layout-DB3pMyTl.js +1 -0
  349. package/static/settings/assets/pod-collections-host-KnnGFZHL.js +8 -0
  350. package/static/settings/assets/{rotate-ccw-TAY65xWT.js → rotate-ccw-TCabbqsr.js} +1 -1
  351. package/static/settings/assets/{settings-ExBXGgbj.js → settings-CJWpdbNC.js} +105 -109
  352. package/static/settings/assets/settings-projection-CUkyprDQ.js +1 -0
  353. package/static/settings/assets/settings-rk080mvG.css +1 -0
  354. package/static/settings/assets/{skeleton-DKIWjNr9.js → skeleton-JDHYVe7t.js} +1 -1
  355. package/static/settings/assets/{waypoints-9erLIxyR.js → waypoints-DDvEl-MU.js} +1 -1
  356. package/static/settings/assets/{workspace-layout-CYXfYIa3.js → workspace-layout-DV5QU30U.js} +1 -1
  357. package/static/settings/settings.html +2 -2
  358. package/node_modules/@undefineds.co/shared-ui/dist/oidc-consent.d.ts +0 -54
  359. package/node_modules/@undefineds.co/shared-ui/dist/oidc-consent.js +0 -21
  360. package/static/auth-callback/assets/AiConfigContext-C81deMM9.js +0 -1
  361. package/static/auth-callback/assets/AiConfigPage-evWI8T56.js +0 -1
  362. package/static/auth-callback/assets/DocumentProcessingPanel-B9GrDEMe.js +0 -1
  363. package/static/auth-callback/assets/IndexLifecyclePanel-qCo8ABQZ.js +0 -1
  364. package/static/auth-callback/assets/ModelAssignmentsPanel-DG7Lxh3t.js +0 -1
  365. package/static/auth-callback/assets/ModelsPage-CgEuqE6p.js +0 -10
  366. package/static/auth-callback/assets/SearchIndexingPanel-ByU3u7kp.js +0 -1
  367. package/static/auth-callback/assets/StatusWorkspace-BZd617sV.js +0 -1
  368. package/static/auth-callback/assets/SystemSettingsPage-BirzWAQM.js +0 -1
  369. package/static/auth-callback/assets/SystemSettingsSubjectPanel-CmsVWNCx.js +0 -31
  370. package/static/auth-callback/assets/admin-BU4m6Ko2.js +0 -1
  371. package/static/auth-callback/assets/ai-connections-CHNTKemd.js +0 -1
  372. package/static/auth-callback/assets/auth-callback-C_7MUXJb.css +0 -1
  373. package/static/auth-callback/assets/index-BpV1hsqs.js +0 -4
  374. package/static/auth-callback/assets/index-D9oE6FXK.js +0 -41
  375. package/static/dashboard/assets/AiConfigContext-De-OtAWo.js +0 -1
  376. package/static/dashboard/assets/AiConfigPage-macP4Mop.js +0 -1
  377. package/static/dashboard/assets/DocumentProcessingPanel-C5ObvCCl.js +0 -1
  378. package/static/dashboard/assets/IndexLifecyclePanel-xVNa2l40.js +0 -1
  379. package/static/dashboard/assets/ModelAssignmentsPanel-DMOATFpQ.js +0 -1
  380. package/static/dashboard/assets/ModelsPage-91UbnETA.js +0 -25
  381. package/static/dashboard/assets/SearchIndexingPanel-Dh70PNFZ.js +0 -1
  382. package/static/dashboard/assets/SystemSettingsPage-BiN5GcKx.js +0 -1
  383. package/static/dashboard/assets/SystemSettingsSubjectPanel-B9QrSiFp.js +0 -31
  384. package/static/dashboard/assets/admin-BU4m6Ko2.js +0 -1
  385. package/static/dashboard/assets/ai-connections-CHNTKemd.js +0 -1
  386. package/static/dashboard/assets/dashboard-C_7MUXJb.css +0 -1
  387. package/static/dashboard/assets/index-FWZ-s52O.js +0 -41
  388. package/static/dashboard/assets/index-ZiQZ96oC.js +0 -4
  389. package/static/settings/assets/AiConfigContext-C0cQMPfG.js +0 -1
  390. package/static/settings/assets/AiConfigPage-CPhB4iFb.js +0 -1
  391. package/static/settings/assets/DocumentProcessingPanel-sYI7OpuH.js +0 -1
  392. package/static/settings/assets/IndexLifecyclePanel-yj8iyiT8.js +0 -1
  393. package/static/settings/assets/ModelAssignmentsPanel-BFIgUX5v.js +0 -1
  394. package/static/settings/assets/ModelsPage-BdppXl7E.js +0 -10
  395. package/static/settings/assets/SearchIndexingPanel-BlPnrkT3.js +0 -1
  396. package/static/settings/assets/SystemSettingsPage-CiOm2NzV.js +0 -1
  397. package/static/settings/assets/SystemSettingsSubjectPanel-Cd-GECon.js +0 -31
  398. package/static/settings/assets/admin-BU4m6Ko2.js +0 -1
  399. package/static/settings/assets/ai-connections-CHNTKemd.js +0 -1
  400. package/static/settings/assets/index-BFi9yn7_.js +0 -41
  401. package/static/settings/assets/index-BGgEhIUy.js +0 -4
  402. package/static/settings/assets/settings-C_7MUXJb.css +0 -1
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import type { ApiServer } from '../ApiServer';
6
6
  import type { AuthenticatedRequest } from '../middleware/AuthMiddleware';
7
+ import type { DdnsManager } from '../../edge/DdnsManager';
7
8
  interface EnvConfig {
8
9
  [key: string]: string;
9
10
  }
@@ -40,7 +41,19 @@ export declare function createAdminServicesCapabilities(req: AuthenticatedReques
40
41
  };
41
42
  export declare function readDurableAdminEnvironment(): Record<string, string>;
42
43
  export declare function writeDurableAdminEnvironmentPatch(input: Record<string, string>): void;
44
+ /**
45
+ * Why a coordinated public domain cannot be served, or `null` when nothing
46
+ * rules it out.
47
+ *
48
+ * A domain issued in tunnel mode is published by the configured tunnel, so a
49
+ * node that reports tunnel mode with no provider has a route that nothing
50
+ * serves. This is the one reachability fact the runtime can establish locally;
51
+ * everything else about a domain can only be confirmed from outside.
52
+ */
53
+ export declare function describeUnservedPublicRoute(ddnsManager?: Pick<DdnsManager, 'getStatus'>): string | null;
43
54
  export interface AdminRoutesOptions extends AdminAuthorizerOptions {
55
+ /** Reads the coordinated-public-route state without which reachability is unknowable. */
56
+ ddnsManager?: Pick<DdnsManager, 'getStatus'>;
44
57
  }
45
58
  export declare function registerAdminRoutes(server: ApiServer, options?: AdminRoutesOptions): void;
46
59
  export {};
@@ -16,6 +16,7 @@ exports.isAdminMutationAllowed = isAdminMutationAllowed;
16
16
  exports.createAdminServicesCapabilities = createAdminServicesCapabilities;
17
17
  exports.readDurableAdminEnvironment = readDurableAdminEnvironment;
18
18
  exports.writeDurableAdminEnvironmentPatch = writeDurableAdminEnvironmentPatch;
19
+ exports.describeUnservedPublicRoute = describeUnservedPublicRoute;
19
20
  exports.registerAdminRoutes = registerAdminRoutes;
20
21
  const node_crypto_1 = require("node:crypto");
21
22
  const fs_1 = __importDefault(require("fs"));
@@ -23,6 +24,7 @@ const path_1 = __importDefault(require("path"));
23
24
  const fs_2 = require("fs");
24
25
  const readline_1 = require("readline");
25
26
  const runtime_1 = require("../../runtime");
27
+ const log_file_1 = require("../../logging/log-file");
26
28
  const GatewayAdminProxyAuth_1 = require("../../runtime/GatewayAdminProxyAuth");
27
29
  const CONFIG_DIR = path_1.default.resolve(runtime_1.PACKAGE_ROOT, 'config');
28
30
  function getEnvFilePath() {
@@ -345,6 +347,29 @@ function parseJsonBody(req) {
345
347
  req.on('error', reject);
346
348
  });
347
349
  }
350
+ /**
351
+ * Why a coordinated public domain cannot be served, or `null` when nothing
352
+ * rules it out.
353
+ *
354
+ * A domain issued in tunnel mode is published by the configured tunnel, so a
355
+ * node that reports tunnel mode with no provider has a route that nothing
356
+ * serves. This is the one reachability fact the runtime can establish locally;
357
+ * everything else about a domain can only be confirmed from outside.
358
+ */
359
+ function describeUnservedPublicRoute(ddnsManager) {
360
+ let status;
361
+ try {
362
+ status = ddnsManager?.getStatus();
363
+ }
364
+ catch {
365
+ // An unreadable DDNS state must not turn into a reachability claim.
366
+ return null;
367
+ }
368
+ if (!status || status.mode !== 'tunnel' || (status.tunnelProvider && status.tunnelProvider !== 'none')) {
369
+ return null;
370
+ }
371
+ return '域名由隧道模式协调,但当前没有配置任何隧道提供商,公网入口无法提供服务。';
372
+ }
348
373
  function registerAdminRoutes(server, options = {}) {
349
374
  const logger = console;
350
375
  // GET /api/admin/status - Get xpod status
@@ -554,20 +579,9 @@ function registerAdminRoutes(server, options = {}) {
554
579
  const url = new URL(req.url || '', `http://${req.headers.host}`);
555
580
  const lines = parseInt(url.searchParams.get('lines') || '100', 10);
556
581
  const env = readEnvFile(getEnvFilePath());
557
- // Try common log file locations
558
- const logPaths = [
559
- path_1.default.resolve(process.cwd(), 'logs', 'combined.log'),
560
- path_1.default.resolve(process.cwd(), 'logs', 'error.log'),
561
- path_1.default.resolve(process.cwd(), 'xpod.log'),
562
- path_1.default.resolve(process.cwd(), 'combined.log'),
563
- ];
564
- let logPath = null;
565
- for (const p of logPaths) {
566
- if (fs_1.default.existsSync(p)) {
567
- logPath = p;
568
- break;
569
- }
570
- }
582
+ // The runtime writes one rotating file per day; resolve it through the
583
+ // same definition the writers use instead of guessing file names here.
584
+ const logPath = (0, log_file_1.resolveCurrentLogFile)();
571
585
  if (!logPath) {
572
586
  sendJson(res, 404, { error: 'No log file found' });
573
587
  return;
@@ -659,7 +673,20 @@ function registerAdminRoutes(server, options = {}) {
659
673
  });
660
674
  return;
661
675
  }
662
- // Domain name: we can only do best-effort.
676
+ // A domain cannot be verified from inside this process. What the runtime
677
+ // does know is whether the tunnel that publishes the domain runs at all,
678
+ // and returning `pass` from an address lookup alone contradicted that
679
+ // state: this endpoint used to call a dead public route reachable.
680
+ const unserved = describeUnservedPublicRoute(options.ddnsManager);
681
+ if (unserved) {
682
+ sendJson(res, 200, {
683
+ status: 'fail',
684
+ ipv4: ip,
685
+ baseUrl,
686
+ detail: unserved,
687
+ });
688
+ return;
689
+ }
663
690
  if (!ip) {
664
691
  sendJson(res, 200, {
665
692
  status: 'unknown',
@@ -670,10 +697,10 @@ function registerAdminRoutes(server, options = {}) {
670
697
  return;
671
698
  }
672
699
  sendJson(res, 200, {
673
- status: 'pass',
700
+ status: 'unknown',
674
701
  ipv4: ip,
675
702
  baseUrl,
676
- detail: '已配置域名,默认可直连(仍需确保端口映射/防火墙放行)。',
703
+ detail: '已配置域名,但本机无法验证公网可达性;请从外部网络访问该地址确认。',
677
704
  });
678
705
  }
679
706
  catch (error) {
@@ -681,7 +708,9 @@ function registerAdminRoutes(server, options = {}) {
681
708
  sendJson(res, 500, { error: 'Failed to detect public ip' });
682
709
  }
683
710
  };
684
- // Routes bypass general authentication and enforce the admin policy in each handler.
711
+ // Admin routes skip MultiAuthenticator (`public: true`) but enforce the admin
712
+ // policy themselves: loopback clients, or XPOD_ADMIN_TOKEN / signed gateway
713
+ // proxy headers for everything else.
685
714
  server.get('/api/admin/status', statusHandler, { public: true });
686
715
  server.get('/api/admin/config', getConfigHandler, { public: true });
687
716
  server.get('/api/admin/public-ip', ipv4Handler, { public: true });
@@ -1,6 +1,7 @@
1
1
  import type { ApiServer } from '../ApiServer';
2
2
  import type { SolidAuthContext } from '../auth/AuthContext';
3
3
  import type { PodLookupRepository } from '../../identity/drizzle/PodLookupRepository';
4
+ import { EmbeddingModelPolicy } from '../../ai/service/EmbeddingModelPolicy';
4
5
  export type AiConfigModelAssignment = 'chatModel' | 'ocrModel' | 'readerModel' | 'embeddingModel' | 'indexerModel' | 'rerankerModel';
5
6
  export interface AiConfigPolicy {
6
7
  schemaVersion: '1.0';
@@ -93,5 +94,10 @@ export interface AiConfigHandlerOptions {
93
94
  store: AiConfigPolicyStore;
94
95
  capabilities?: () => AiConfigCapabilities;
95
96
  lifecycle?: AiConfigLifecycleService;
97
+ /**
98
+ * Deployment policy for embedding assignments. Local runtimes allow any model;
99
+ * Cloud runtimes only accept models the ai-gateway catalog provides.
100
+ */
101
+ embeddingModelPolicy?: EmbeddingModelPolicy;
96
102
  }
97
103
  export declare function registerAiConfigRoutes(server: ApiServer, options: AiConfigHandlerOptions): void;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.registerAiConfigRoutes = registerAiConfigRoutes;
4
4
  const readBoundedJsonBody_1 = require("../http/readBoundedJsonBody");
5
5
  const GatewayPrincipal_1 = require("../ai-gateway/auth/GatewayPrincipal");
6
+ const EmbeddingModelPolicy_1 = require("../../ai/service/EmbeddingModelPolicy");
6
7
  function registerAiConfigRoutes(server, options) {
7
8
  server.get('/api/ai/config', async (request, response) => {
8
9
  const owner = await resolveOwner(request, response, options);
@@ -34,6 +35,15 @@ function registerAiConfigRoutes(server, options) {
34
35
  sendJson(response, 400, { error: 'Invalid AI Config update' });
35
36
  return;
36
37
  }
38
+ const rejected = rejectedEmbeddingAssignment(patch, options.embeddingModelPolicy);
39
+ if (rejected) {
40
+ sendJson(response, 400, {
41
+ error: EmbeddingModelPolicy_1.EMBEDDING_MODEL_NOT_ALLOWED,
42
+ message: 'This deployment only allows embedding models provided by the AI gateway',
43
+ ...rejected,
44
+ });
45
+ return;
46
+ }
37
47
  try {
38
48
  const config = await options.store.update({ ...owner, patch });
39
49
  sendJson(response, 200, {
@@ -94,6 +104,24 @@ async function resolveOwner(request, response, options) {
94
104
  }
95
105
  return { webId, podUrl, auth: request.auth };
96
106
  }
107
+ /**
108
+ * Returns the offending assignment when the deployment policy rejects it, so the
109
+ * caller can answer with a stable error instead of a generic 400.
110
+ */
111
+ function rejectedEmbeddingAssignment(patch, policy) {
112
+ if (!policy?.isEnforced() || !('models' in patch)) {
113
+ return undefined;
114
+ }
115
+ const assignment = patch.models?.embeddingModel;
116
+ if (assignment === undefined || assignment === null) {
117
+ return undefined;
118
+ }
119
+ const ref = (0, EmbeddingModelPolicy_1.parseEmbeddingModelRef)(assignment);
120
+ if (ref && policy.isAllowed(ref)) {
121
+ return undefined;
122
+ }
123
+ return ref ?? { model: assignment };
124
+ }
97
125
  function parsePolicyPatch(value) {
98
126
  if (!isRecord(value))
99
127
  return undefined;
@@ -9,6 +9,7 @@ const models_1 = require("../ai-gateway/models");
9
9
  const AiConnectionsServiceAccess_1 = require("../ai-gateway/service-access/AiConnectionsServiceAccess");
10
10
  const AiClientConfigurationService_1 = require("../service/AiClientConfigurationService");
11
11
  const errors_1 = require("../ai-gateway/errors");
12
+ const EmbeddingModelPolicy_1 = require("../../ai/service/EmbeddingModelPolicy");
12
13
  const provider_http_transport_1 = require("../service/provider-http-transport");
13
14
  const logger = (0, global_logger_factory_1.getLoggerFor)('AiGatewayManagementHandler');
14
15
  function registerAiGatewayManagementRoutes(server, options) {
@@ -1240,6 +1241,20 @@ function normalizeStringList(value) {
1240
1241
  }
1241
1242
  function sendCustomModelsError(response, error) {
1242
1243
  const message = error instanceof Error ? error.message : String(error);
1244
+ if (message === 'provider_not_available_in_deployment') {
1245
+ sendJson(response, 403, {
1246
+ error: 'provider_not_available_in_deployment',
1247
+ message: 'This deployment only offers the providers it provides',
1248
+ });
1249
+ return;
1250
+ }
1251
+ if ((0, EmbeddingModelPolicy_1.isEmbeddingModelNotAllowedError)(error)) {
1252
+ sendJson(response, 403, {
1253
+ error: EmbeddingModelPolicy_1.EMBEDDING_MODEL_NOT_ALLOWED,
1254
+ message: 'This deployment only allows embedding models provided by the AI gateway',
1255
+ });
1256
+ return;
1257
+ }
1243
1258
  if (message === 'models_credential_not_found') {
1244
1259
  sendJson(response, 404, { error: 'Provider credential not found for current identity' });
1245
1260
  return;
@@ -1275,6 +1290,20 @@ function sendCredentialPoolError(response, error) {
1275
1290
  return;
1276
1291
  }
1277
1292
  const message = error instanceof Error ? error.message : String(error);
1293
+ if (message === 'provider_endpoint_not_configurable_in_cloud') {
1294
+ sendJson(response, 403, {
1295
+ error: 'provider_endpoint_not_configurable_in_cloud',
1296
+ message: 'This deployment provides the provider endpoint; it cannot be set from a connection',
1297
+ });
1298
+ return;
1299
+ }
1300
+ if (message === 'provider_not_available_in_deployment') {
1301
+ sendJson(response, 403, {
1302
+ error: 'provider_not_available_in_deployment',
1303
+ message: 'This deployment only offers the providers it provides',
1304
+ });
1305
+ return;
1306
+ }
1278
1307
  if (message === 'local_session_reauth_required' || message === 'local_session_missing_refresh_token'
1279
1308
  || message === 'local_session_refresh_failed') {
1280
1309
  sendJson(response, message === 'local_session_refresh_failed' ? 502 : 409, { error: message });
@@ -1326,6 +1355,13 @@ function sendLegacyProviderConnectError(response, error) {
1326
1355
  return;
1327
1356
  }
1328
1357
  const message = error instanceof Error ? error.message : String(error);
1358
+ if (message === 'provider_endpoint_not_configurable_in_cloud') {
1359
+ sendJson(response, 403, {
1360
+ error: 'provider_endpoint_not_configurable_in_cloud',
1361
+ message: 'This deployment provides the provider endpoint; it cannot be set from a connection',
1362
+ });
1363
+ return;
1364
+ }
1329
1365
  if (/^OAuth refresh failed: (?:invalid_grant|invalid_token)$/u.test(message)) {
1330
1366
  sendJson(response, 409, { error: 'oauth_session_reauth_required' });
1331
1367
  return;
@@ -22,6 +22,13 @@ export interface RdfRunContextRetrieverOptions<TContext = StoreContext> {
22
22
  failOpen?: boolean;
23
23
  textWeight?: number;
24
24
  vectorWeight?: number;
25
+ /**
26
+ * Minimum vector similarity for the vector-only fallback. The fused query
27
+ * implicitly filters by "the text side matched"; a vector-only retry has no
28
+ * such filter, so without a floor every prompt would return its nearest (and
29
+ * possibly unrelated) chunks.
30
+ */
31
+ vectorFallbackThreshold?: number;
25
32
  vectorProvider?: string;
26
33
  vectorModel?: string;
27
34
  vectorModelVersion?: string;
@@ -44,6 +51,13 @@ export declare class RdfRunContextRetriever<TContext = StoreContext> implements
44
51
  private readonly options;
45
52
  constructor(options: RdfRunContextRetrieverOptions<TContext>);
46
53
  retrieve(input: RunContextRetrievalInput<TContext>): Promise<RunRetrievedContext | undefined>;
54
+ /**
55
+ * Retrieval is semantic first: the fused query joins text and vector hits, so a
56
+ * prompt the text index cannot match (CJK tokenisation, a paraphrase) would drop
57
+ * its vector hits and return nothing. Retry with the vector side alone when the
58
+ * fused query came back empty.
59
+ */
60
+ private vectorOnlyQuery;
47
61
  private buildDefaultQuery;
48
62
  private searchScope;
49
63
  private cacheScope;
@@ -4,6 +4,8 @@ exports.RdfRunContextRetriever = void 0;
4
4
  const n3_1 = require("n3");
5
5
  const RdfAccessScope_1 = require("../../storage/rdf/RdfAccessScope");
6
6
  const { literal } = n3_1.DataFactory;
7
+ /** Cosine similarity floor for the vector-only fallback. */
8
+ const DEFAULT_VECTOR_FALLBACK_THRESHOLD = 0.3;
7
9
  /**
8
10
  * Product-level Run context retriever backed by SolidRdfEngine/PostgresRdfEngine.
9
11
  *
@@ -26,7 +28,10 @@ class RdfRunContextRetriever {
26
28
  ? await this.options.buildQuery(input, embedding)
27
29
  : this.buildDefaultQuery(input, embedding);
28
30
  const result = await this.options.rdfEngine.query(this.withAccessScope(query, input));
29
- const items = result.bindings
31
+ const rows = result.bindings.length > 0 || !query.vectorSearch?.length
32
+ ? result
33
+ : await this.options.rdfEngine.query(this.withAccessScope(this.vectorOnlyQuery(query), input));
34
+ const items = rows.bindings
30
35
  .map((row) => this.bindingToContextItem(row))
31
36
  .filter((item) => item !== undefined)
32
37
  .slice(0, this.options.limit ?? 8);
@@ -37,7 +42,7 @@ class RdfRunContextRetriever {
37
42
  query: prompt,
38
43
  items,
39
44
  generatedAt: Math.floor(Date.now() / 1000),
40
- plan: result.metrics.plan,
45
+ plan: rows.metrics.plan,
41
46
  };
42
47
  }
43
48
  catch (error) {
@@ -47,6 +52,26 @@ class RdfRunContextRetriever {
47
52
  throw error;
48
53
  }
49
54
  }
55
+ /**
56
+ * Retrieval is semantic first: the fused query joins text and vector hits, so a
57
+ * prompt the text index cannot match (CJK tokenisation, a paraphrase) would drop
58
+ * its vector hits and return nothing. Retry with the vector side alone when the
59
+ * fused query came back empty.
60
+ */
61
+ vectorOnlyQuery(query) {
62
+ const threshold = this.options.vectorFallbackThreshold ?? DEFAULT_VECTOR_FALLBACK_THRESHOLD;
63
+ return {
64
+ ...query,
65
+ textSearch: undefined,
66
+ // The fusion score references the text score, which is unbound here.
67
+ binds: undefined,
68
+ orderBy: [{ variable: 'vectorScore', direction: 'desc' }],
69
+ vectorSearch: query.vectorSearch?.map((pattern) => ({
70
+ ...pattern,
71
+ threshold: pattern.threshold ?? threshold,
72
+ })),
73
+ };
74
+ }
50
75
  buildDefaultQuery(input, embedding) {
51
76
  const limit = this.options.limit ?? 8;
52
77
  const scope = this.searchScope(input);
@@ -111,6 +136,9 @@ class RdfRunContextRetriever {
111
136
  heading: 'vectorHeading',
112
137
  score: 'vectorScore',
113
138
  distance: 'vectorDistance',
139
+ workspace: 'vectorWorkspace',
140
+ localPath: 'vectorLocalPath',
141
+ contentType: 'vectorContentType',
114
142
  sourceKey: 'sourceKey',
115
143
  retrievalPoint: 'retrievalPointKey',
116
144
  provider: 'vectorProvider',
@@ -146,11 +174,17 @@ class RdfRunContextRetriever {
146
174
  ];
147
175
  query.select = [
148
176
  ...(query.select ?? []),
177
+ // The vector pattern binds its own source variable; a vector-only row has
178
+ // no text source, so it must be projected to map the row at all.
179
+ 'vectorSource',
149
180
  'vectorChunk',
150
181
  'vectorContent',
151
182
  'vectorHeading',
152
183
  'vectorScore',
153
184
  'vectorDistance',
185
+ 'vectorWorkspace',
186
+ 'vectorLocalPath',
187
+ 'vectorContentType',
154
188
  'vectorProvider',
155
189
  'vectorModel',
156
190
  'vectorModelVersion',
@@ -205,7 +239,9 @@ class RdfRunContextRetriever {
205
239
  }
206
240
  bindingToContextItem(row) {
207
241
  const text = termValue(row.textContent) || termValue(row.vectorContent);
208
- const source = termValue(row.source);
242
+ // The vector pattern binds its own source variable, so a vector-only row has
243
+ // no `source` binding at all.
244
+ const source = termValue(row.source) || termValue(row.vectorSource);
209
245
  if (!text || !source) {
210
246
  return undefined;
211
247
  }
@@ -243,8 +279,8 @@ class RdfRunContextRetriever {
243
279
  source,
244
280
  text,
245
281
  score: fusionScore ?? textScore ?? vectorScore,
246
- workspace: termValue(row.workspace),
247
- localPath: termValue(row.localPath),
282
+ workspace: termValue(row.workspace) || termValue(row.vectorWorkspace),
283
+ localPath: termValue(row.localPath) || termValue(row.vectorLocalPath),
248
284
  heading,
249
285
  metadata,
250
286
  };
@@ -5,6 +5,7 @@ exports.startApiService = startApiService;
5
5
  const awilix_1 = require("awilix");
6
6
  const global_logger_factory_1 = require("global-logger-factory");
7
7
  const ConfigurableLoggerFactory_1 = require("../logging/ConfigurableLoggerFactory");
8
+ const log_file_1 = require("../logging/log-file");
8
9
  const container_1 = require("./container");
9
10
  const routes_1 = require("./container/routes");
10
11
  const OpenAuthMiddleware_1 = require("./middleware/OpenAuthMiddleware");
@@ -18,7 +19,7 @@ function ensureTrailingSlash(url) {
18
19
  }
19
20
  function initApiLogger() {
20
21
  const loggerFactory = new ConfigurableLoggerFactory_1.ConfigurableLoggerFactory(process.env.CSS_LOGGING_LEVEL || 'info', {
21
- fileName: './logs/xpod-%DATE%.log',
22
+ fileName: (0, log_file_1.resolveLogFilePattern)(),
22
23
  showLocation: true,
23
24
  });
24
25
  (0, global_logger_factory_1.setGlobalLoggerFactory)(loggerFactory);
@@ -20,6 +20,7 @@ export interface SecretPlan {
20
20
  resourceKind: string;
21
21
  service: string;
22
22
  provider: string;
23
+ providerUri: string;
23
24
  kind: string;
24
25
  subject: string;
25
26
  resourceUrl: string;
@@ -80,18 +80,34 @@ function localId(input) {
80
80
  .join('-')
81
81
  .replace(/[^a-zA-Z0-9_.-]+/g, '-');
82
82
  }
83
+ /**
84
+ * models 0.2.57 dropped `secretType` and turned `providerId` into the `provider`
85
+ * relation, so a credential's classification lives in attributes and its id
86
+ * stays a pure layout key. The CLI keeps its `kind` vocabulary as the operator
87
+ * facing word and maps it onto the schema's `authMode`.
88
+ */
89
+ const AUTH_MODE_BY_KIND = {
90
+ 'api-key': 'apiKey',
91
+ 'tunnel-token': 'apiKey',
92
+ };
93
+ /** The provider document a credential points at, as the shared relation. */
94
+ function providerRelation(provider) {
95
+ return models_1.aiProviderResource.buildId({ id: provider });
96
+ }
83
97
  function buildSecretPlan(podRoot, input) {
84
98
  const service = input.service ?? 'ai';
85
99
  const storage = (0, models_1.createPodStorage)();
100
+ const authMode = AUTH_MODE_BY_KIND[input.kind];
86
101
  const validation = storage.validate({
87
102
  schemaUri: models_1.credentialDescriptor.uri,
88
103
  operation: 'upsert',
89
104
  match: {
90
- service,
91
- providerId: input.provider,
92
- secretType: input.kind,
105
+ id: localId(input),
93
106
  },
94
107
  set: {
108
+ service,
109
+ provider: providerRelation(input.provider),
110
+ ...(authMode ? { authMode } : {}),
95
111
  status: 'active',
96
112
  },
97
113
  });
@@ -105,6 +121,9 @@ function buildSecretPlan(podRoot, input) {
105
121
  resourceKind: models_1.credentialDescriptor.resourceKind,
106
122
  service,
107
123
  provider: input.provider,
124
+ // The relation is stored as `<provider>.ttl` and emitted as the absolute
125
+ // provider document IRI, which is the shape the Pod adapters write.
126
+ providerUri: models_1.aiProviderResource.buildIri(podRoot, { id: input.provider }),
108
127
  kind: input.kind,
109
128
  subject: resourceUrl,
110
129
  resourceUrl: resourceUrl.replace(/#.*$/u, ''),
@@ -114,10 +133,9 @@ function buildSecretPlan(podRoot, input) {
114
133
  function buildSecretUpsertSparql(plan, input) {
115
134
  const subject = `<${plan.subject}>`;
116
135
  const fields = models_1.credentialDescriptor.fields;
136
+ const authMode = AUTH_MODE_BY_KIND[plan.kind];
117
137
  const values = {
118
138
  service: plan.service,
119
- providerId: plan.provider,
120
- secretType: plan.kind,
121
139
  status: input.status ?? (input.revoke ? 'revoked' : 'active'),
122
140
  };
123
141
  if (input.label)
@@ -137,8 +155,8 @@ function buildSecretUpsertSparql(plan, input) {
137
155
  const insertTriples = [
138
156
  `${subject} a <${models_1.credentialDescriptor.class}>`,
139
157
  `${subject} <${fields.service.predicate}> ${escapeSparqlLiteral(values.service)}`,
140
- `${subject} <${fields.providerId.predicate}> ${escapeSparqlLiteral(values.providerId)}`,
141
- `${subject} <${fields.secretType.predicate}> ${escapeSparqlLiteral(values.secretType)}`,
158
+ `${subject} <${fields.provider.predicate}> <${plan.providerUri}>`,
159
+ ...(authMode ? [`${subject} <${fields.authMode.predicate}> ${escapeSparqlLiteral(authMode)}`] : []),
142
160
  `${subject} <${fields.status.predicate}> ${escapeSparqlLiteral(values.status)}`,
143
161
  ];
144
162
  if (values.label) {
@@ -144,6 +144,8 @@
144
144
  "undefineds:dist/edge/reachability/ManagedClientFetch.jsonld",
145
145
  "undefineds:dist/edge/reachability/ManagedClientP2PSmoke.jsonld",
146
146
  "undefineds:dist/edge/reachability/P2PRealnetAcceptance.jsonld",
147
- "undefineds:dist/notifications/device-notification-protocol.jsonld"
147
+ "undefineds:dist/notifications/device-notification-protocol.jsonld",
148
+ "undefineds:dist/notifications/NotificationChannelSweeper.jsonld",
149
+ "undefineds:dist/notifications/ReclaimingWebSocket2023Storer.jsonld"
148
150
  ]
149
151
  }
@@ -1076,6 +1076,9 @@
1076
1076
  "options_resourceSuffix": {
1077
1077
  "@id": "undefineds:dist/http/SubgraphSparqlHttpHandler.jsonld#SubgraphSparqlHttpHandler_options_resourceSuffix"
1078
1078
  },
1079
+ "emitter": {
1080
+ "@id": "undefineds:dist/http/SubgraphSparqlHttpHandler.jsonld#SubgraphSparqlHttpHandler_emitter"
1081
+ },
1079
1082
  "queryEngine": {
1080
1083
  "@id": "undefineds:dist/http/SubgraphSparqlHttpHandler.jsonld#SubgraphSparqlHttpHandler_queryEngine"
1081
1084
  },
@@ -2893,6 +2896,9 @@
2893
2896
  "@context": {
2894
2897
  "providerRegistry": {
2895
2898
  "@id": "undefineds:dist/ai/service/EmbeddingServiceImpl.jsonld#EmbeddingServiceImpl_providerRegistry"
2899
+ },
2900
+ "options_policy": {
2901
+ "@id": "undefineds:dist/ai/service/EmbeddingServiceImpl.jsonld#EmbeddingServiceImpl_options_policy"
2896
2902
  }
2897
2903
  }
2898
2904
  },
@@ -2904,7 +2910,11 @@
2904
2910
  "CredentialReaderImpl": {
2905
2911
  "@id": "undefineds:dist/ai/service/CredentialReaderImpl.jsonld#CredentialReaderImpl",
2906
2912
  "@prefix": true,
2907
- "@context": {}
2913
+ "@context": {
2914
+ "options_secretDecoder": {
2915
+ "@id": "undefineds:dist/ai/service/CredentialReaderImpl.jsonld#CredentialReaderImpl_options_secretDecoder"
2916
+ }
2917
+ }
2908
2918
  },
2909
2919
  "CloudflareTunnelProvider": {
2910
2920
  "@id": "undefineds:dist/tunnel/CloudflareTunnelProvider.jsonld#CloudflareTunnelProvider",
@@ -4237,6 +4247,48 @@
4237
4247
  "@id": "undefineds:dist/notifications/device-notification-protocol.jsonld#ParseClientFrameOptions",
4238
4248
  "@prefix": true,
4239
4249
  "@context": {}
4250
+ },
4251
+ "NotificationChannelSweeper": {
4252
+ "@id": "undefineds:dist/notifications/NotificationChannelSweeper.jsonld#NotificationChannelSweeper",
4253
+ "@prefix": true,
4254
+ "@context": {
4255
+ "baseUrl": {
4256
+ "@id": "undefineds:dist/notifications/NotificationChannelSweeper.jsonld#NotificationChannelSweeper_baseUrl"
4257
+ },
4258
+ "intervalMinutes": {
4259
+ "@id": "undefineds:dist/notifications/NotificationChannelSweeper.jsonld#NotificationChannelSweeper_intervalMinutes"
4260
+ },
4261
+ "storage": {
4262
+ "@id": "undefineds:dist/notifications/NotificationChannelSweeper.jsonld#NotificationChannelSweeper_storage"
4263
+ },
4264
+ "socketMap": {
4265
+ "@id": "undefineds:dist/notifications/NotificationChannelSweeper.jsonld#NotificationChannelSweeper_socketMap"
4266
+ },
4267
+ "channelIndex": {
4268
+ "@id": "undefineds:dist/notifications/NotificationChannelSweeper.jsonld#NotificationChannelSweeper_channelIndex"
4269
+ },
4270
+ "es": {
4271
+ "@id": "undefineds:dist/notifications/NotificationChannelSweeper.jsonld#NotificationChannelSweeper_intervalMinutes"
4272
+ }
4273
+ }
4274
+ },
4275
+ "ReclaimingWebSocket2023Storer": {
4276
+ "@id": "undefineds:dist/notifications/ReclaimingWebSocket2023Storer.jsonld#ReclaimingWebSocket2023Storer",
4277
+ "@prefix": true,
4278
+ "@context": {
4279
+ "cleanupTimer": {
4280
+ "@id": "undefineds:dist/notifications/ReclaimingWebSocket2023Storer.jsonld#ReclaimingWebSocket2023Storer_cleanupTimer"
4281
+ },
4282
+ "storage": {
4283
+ "@id": "undefineds:dist/notifications/ReclaimingWebSocket2023Storer.jsonld#ReclaimingWebSocket2023Storer_storage"
4284
+ },
4285
+ "socketMap": {
4286
+ "@id": "undefineds:dist/notifications/ReclaimingWebSocket2023Storer.jsonld#ReclaimingWebSocket2023Storer_socketMap"
4287
+ },
4288
+ "er": {
4289
+ "@id": "undefineds:dist/notifications/ReclaimingWebSocket2023Storer.jsonld#ReclaimingWebSocket2023Storer_cleanupTimer"
4290
+ }
4291
+ }
4240
4292
  }
4241
4293
  }
4242
4294
  ]