@undefineds.co/xpod 0.4.11 → 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.
- package/config/components-ignore.json +5 -1
- package/config/notifications.json +68 -0
- package/config/xpod.base.json +9 -11
- package/dist/ai/service/AiCredentialSecret.d.ts +30 -0
- package/dist/ai/service/AiCredentialSecret.js +120 -0
- package/dist/ai/service/CredentialReaderImpl.d.ts +18 -0
- package/dist/ai/service/CredentialReaderImpl.js +81 -5
- package/dist/ai/service/CredentialReaderImpl.jsonld +42 -2
- package/dist/ai/service/EmbeddingModelPolicy.d.ts +79 -0
- package/dist/ai/service/EmbeddingModelPolicy.js +134 -0
- package/dist/ai/service/EmbeddingProviderError.js +6 -0
- package/dist/ai/service/EmbeddingServiceImpl.d.ts +13 -1
- package/dist/ai/service/EmbeddingServiceImpl.js +18 -5
- package/dist/ai/service/EmbeddingServiceImpl.jsonld +35 -0
- package/dist/ai/service/index.d.ts +2 -0
- package/dist/ai/service/index.js +2 -0
- package/dist/api/ai-gateway/connect/index.d.ts +20 -2
- package/dist/api/ai-gateway/connect/index.js +162 -16
- package/dist/api/ai-gateway/credentials/AiCredentialSecretDecoder.d.ts +12 -0
- package/dist/api/ai-gateway/credentials/AiCredentialSecretDecoder.js +30 -0
- package/dist/api/ai-gateway/errors.d.ts +1 -1
- package/dist/api/ai-gateway/models/GatewayEmbeddingModelCatalog.d.ts +11 -0
- package/dist/api/ai-gateway/models/GatewayEmbeddingModelCatalog.js +31 -0
- package/dist/api/ai-gateway/models/PodModelSelectionRepository.js +7 -3
- package/dist/api/ai-gateway/models/ProviderCustomModelsService.d.ts +18 -0
- package/dist/api/ai-gateway/models/ProviderCustomModelsService.js +23 -0
- package/dist/api/ai-gateway/models/ProviderModelDiscoveryAdapters.d.ts +3 -1
- package/dist/api/ai-gateway/models/ProviderModelDiscoveryAdapters.js +2 -45
- package/dist/api/ai-gateway/models/ProviderModelSelectionService.d.ts +10 -0
- package/dist/api/ai-gateway/models/ProviderModelSelectionService.js +57 -20
- package/dist/api/ai-gateway/models/ProviderModelType.d.ts +28 -0
- package/dist/api/ai-gateway/models/ProviderModelType.js +34 -0
- package/dist/api/ai-gateway/models/ProviderModelsAdapter.d.ts +10 -0
- package/dist/api/ai-gateway/models/ProviderModelsAdapter.js +3 -4
- package/dist/api/ai-gateway/models/index.d.ts +1 -0
- package/dist/api/ai-gateway/models/index.js +3 -1
- package/dist/api/ai-gateway/providers/CustomRuntimeAdapter.d.ts +7 -0
- package/dist/api/ai-gateway/providers/CustomRuntimeAdapter.js +9 -2
- package/dist/api/ai-gateway/providers/ModelsDevCatalog.d.ts +7 -1
- package/dist/api/ai-gateway/providers/ModelsDevCatalog.js +4 -10
- package/dist/api/ai-gateway/providers/ProviderRegistry.d.ts +107 -0
- package/dist/api/ai-gateway/providers/ProviderRegistry.js +244 -21
- package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.d.ts +5 -0
- package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.js +5 -1
- package/dist/api/ai-gateway/quota/SubscriptionQuotaAdapters.d.ts +12 -4
- package/dist/api/ai-gateway/quota/SubscriptionQuotaAdapters.js +11 -11
- package/dist/api/ai-gateway/routing/ModelRouter.d.ts +14 -0
- package/dist/api/ai-gateway/routing/ModelRouter.js +43 -4
- package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.d.ts +9 -1
- package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.js +3 -27
- package/dist/api/chatkit/pod-store.d.ts +31 -0
- package/dist/api/chatkit/pod-store.js +132 -8
- package/dist/api/container/common.js +24 -4
- package/dist/api/container/routes.js +17 -2
- package/dist/api/container/types.d.ts +3 -1
- package/dist/api/handlers/AdminHandler.d.ts +13 -0
- package/dist/api/handlers/AdminHandler.js +47 -18
- package/dist/api/handlers/AiConfigHandler.d.ts +6 -0
- package/dist/api/handlers/AiConfigHandler.js +28 -0
- package/dist/api/handlers/AiGatewayManagementHandler.js +36 -0
- package/dist/api/runs/RdfRunContextRetriever.d.ts +14 -0
- package/dist/api/runs/RdfRunContextRetriever.js +41 -5
- package/dist/api/runtime.js +2 -1
- package/dist/cli/commands/secret.d.ts +1 -0
- package/dist/cli/commands/secret.js +25 -7
- package/dist/components/components.jsonld +3 -1
- package/dist/components/context.jsonld +53 -1
- package/dist/http/SubgraphSparqlHttpHandler.d.ts +59 -2
- package/dist/http/SubgraphSparqlHttpHandler.js +145 -13
- package/dist/http/SubgraphSparqlHttpHandler.jsonld +37 -0
- package/dist/identity/drizzle/EdgeNodeRepository.d.ts +0 -12
- package/dist/identity/drizzle/EdgeNodeRepository.js +5 -13
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7 -3
- package/dist/logging/log-file.d.ts +17 -0
- package/dist/logging/log-file.js +69 -0
- package/dist/main.js +2 -1
- package/dist/notifications/NotificationChannelSweeper.d.ts +50 -0
- package/dist/notifications/NotificationChannelSweeper.js +131 -0
- package/dist/notifications/NotificationChannelSweeper.jsonld +136 -0
- package/dist/notifications/ReclaimingWebSocket2023Storer.d.ts +25 -0
- package/dist/notifications/ReclaimingWebSocket2023Storer.js +56 -0
- package/dist/notifications/ReclaimingWebSocket2023Storer.jsonld +77 -0
- package/dist/notifications/index.d.ts +2 -0
- package/dist/notifications/index.js +2 -0
- package/dist/runtime/Proxy.d.ts +37 -0
- package/dist/runtime/Proxy.js +88 -16
- package/dist/runtime/bootstrap.js +2 -1
- package/dist/runtime/upgrade/BunNativeUpgradeRelay.d.ts +116 -0
- package/dist/runtime/upgrade/BunNativeUpgradeRelay.js +423 -0
- package/dist/runtime/upgrade/UpgradeHandshake.d.ts +63 -0
- package/dist/runtime/upgrade/UpgradeHandshake.js +199 -0
- package/dist/runtime/upgrade/WebSocketFrames.d.ts +67 -0
- package/dist/runtime/upgrade/WebSocketFrames.js +224 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.js +8 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiAuthorizationActions.d.ts +11 -2
- package/node_modules/@undefineds.co/ai-connections/dist/AiAuthorizationActions.js +27 -10
- package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.d.ts +7 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.js +13 -11
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectDialog.js +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsList.js +10 -6
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMain.d.ts +15 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMain.js +29 -3
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMainHeader.js +18 -3
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.d.ts +16 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.js +92 -20
- package/node_modules/@undefineds.co/ai-connections/dist/AiCopyButton.d.ts +35 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiCopyButton.js +45 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialPoolSection.js +71 -11
- package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialRow.js +9 -7
- package/node_modules/@undefineds.co/ai-connections/dist/AiEndpointList.d.ts +23 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiEndpointList.js +24 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.d.ts +13 -4
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.js +35 -38
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayModelsSection.d.ts +21 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayModelsSection.js +51 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiInfoTooltip.d.ts +15 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiInfoTooltip.js +16 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiModelCatalog.d.ts +175 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiModelCatalog.js +133 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiOfferingDetails.js +2 -2
- package/node_modules/@undefineds.co/ai-connections/dist/AiProviderCard.js +13 -64
- package/node_modules/@undefineds.co/ai-connections/dist/AiProviderHeader.d.ts +21 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiProviderHeader.js +12 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiRowAction.d.ts +15 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiRowAction.js +12 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiSortableCredentialList.js +2 -1
- package/node_modules/@undefineds.co/ai-connections/dist/ai-connections-client.d.ts +7 -0
- package/node_modules/@undefineds.co/ai-connections/dist/ai-connections-client.js +6 -0
- package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.d.ts +36 -5
- package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.js +52 -9
- package/node_modules/@undefineds.co/ai-connections/dist/client/normalize.js +30 -3
- package/node_modules/@undefineds.co/ai-connections/dist/client/types.d.ts +21 -1
- package/node_modules/@undefineds.co/ai-connections/dist/client-config/base-adapter.d.ts +1 -3
- package/node_modules/@undefineds.co/ai-connections/dist/client-config/base-adapter.js +3 -7
- package/node_modules/@undefineds.co/ai-connections/dist/client-config/index.cjs +9 -7
- package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.d.ts +46 -0
- package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.js +231 -0
- package/node_modules/@undefineds.co/ai-connections/dist/collections.d.ts +119 -0
- package/node_modules/@undefineds.co/ai-connections/dist/collections.js +173 -0
- package/node_modules/@undefineds.co/ai-connections/dist/controller.d.ts +71 -5
- package/node_modules/@undefineds.co/ai-connections/dist/controller.js +285 -16
- package/node_modules/@undefineds.co/ai-connections/dist/credential-labels.d.ts +5 -0
- package/node_modules/@undefineds.co/ai-connections/dist/credential-labels.js +8 -3
- package/node_modules/@undefineds.co/ai-connections/dist/credential-storage.d.ts +59 -0
- package/node_modules/@undefineds.co/ai-connections/dist/credential-storage.js +131 -0
- package/node_modules/@undefineds.co/ai-connections/dist/endpoint-urls.d.ts +15 -0
- package/node_modules/@undefineds.co/ai-connections/dist/endpoint-urls.js +20 -0
- package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.d.ts +14 -0
- package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.js +20 -0
- package/node_modules/@undefineds.co/ai-connections/dist/index.d.ts +8 -0
- package/node_modules/@undefineds.co/ai-connections/dist/index.js +8 -0
- package/node_modules/@undefineds.co/ai-connections/dist/manifest.js +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/offering-endpoints.d.ts +14 -0
- package/node_modules/@undefineds.co/ai-connections/dist/offering-endpoints.js +17 -0
- package/node_modules/@undefineds.co/ai-connections/dist/provider-catalog.cjs +68 -1
- package/node_modules/@undefineds.co/ai-connections/dist/provider-catalog.d.ts +75 -1
- package/node_modules/@undefineds.co/ai-connections/dist/provider-catalog.js +119 -0
- package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.d.ts +5 -0
- package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.js +5 -0
- package/node_modules/@undefineds.co/ai-connections/dist/service-access.js +2 -27
- package/node_modules/@undefineds.co/ai-connections/package.json +1 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/manifest.d.ts +1 -1
- package/node_modules/@undefineds.co/extension-sdk/dist/manifest.js +2 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/web.d.ts +150 -0
- package/node_modules/@undefineds.co/extension-sdk/package.json +2 -1
- package/node_modules/@undefineds.co/models/README.md +1 -1
- package/node_modules/@undefineds.co/models/dist/ai-config/index.d.ts +3 -3
- package/node_modules/@undefineds.co/models/dist/ai-gateway.schema.d.ts +5 -0
- package/node_modules/@undefineds.co/models/dist/ai-gateway.schema.js +9 -0
- package/node_modules/@undefineds.co/models/dist/ai-runtime.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/approval.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/audit.presentation.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/capture.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/chat-project.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/chat.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/control-request.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/conversation-share.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/credential.schema.d.ts +12 -0
- package/node_modules/@undefineds.co/models/dist/credential.schema.js +15 -1
- package/node_modules/@undefineds.co/models/dist/discovery/index.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/discovery/providers.json +248 -7
- package/node_modules/@undefineds.co/models/dist/discovery/types.d.ts +31 -0
- package/node_modules/@undefineds.co/models/dist/extension/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/favorite/index.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/fixtures/contracts-chat-contact.d.ts +5 -5
- package/node_modules/@undefineds.co/models/dist/import/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/index.d.ts +73 -73
- package/node_modules/@undefineds.co/models/dist/index.js +1 -1
- package/node_modules/@undefineds.co/models/dist/input-request.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/knowledge/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/message.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/namespaces.js +5 -0
- package/node_modules/@undefineds.co/models/dist/pod-storage-descriptor.d.ts +4815 -26
- package/node_modules/@undefineds.co/models/dist/pod-storage-descriptor.js +482 -132
- package/node_modules/@undefineds.co/models/dist/schema.d.ts +4 -0
- package/node_modules/@undefineds.co/models/dist/session/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/settings/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/sidecar/persistence-mapping.d.ts +5 -5
- package/node_modules/@undefineds.co/models/dist/thread.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/types/message-block.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/vocab/_namespaces.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/vocab/index.d.ts +10 -10
- package/node_modules/@undefineds.co/models/dist/vocab/sidecar.vocab.d.ts +1 -0
- package/node_modules/@undefineds.co/models/dist/vocab/sidecar.vocab.js +1 -0
- package/node_modules/@undefineds.co/models/package.json +4 -2
- package/node_modules/@undefineds.co/pod-collections/README.md +71 -0
- package/node_modules/@undefineds.co/pod-collections/dist/diff.d.ts +85 -0
- package/node_modules/@undefineds.co/pod-collections/dist/diff.js +166 -0
- package/node_modules/@undefineds.co/pod-collections/dist/feed.d.ts +17 -0
- package/node_modules/@undefineds.co/pod-collections/dist/feed.js +27 -0
- package/node_modules/@undefineds.co/pod-collections/dist/index.cjs +1042 -0
- package/node_modules/@undefineds.co/pod-collections/dist/index.d.ts +37 -0
- package/node_modules/@undefineds.co/pod-collections/dist/index.js +89 -0
- package/node_modules/@undefineds.co/pod-collections/dist/layout.d.ts +75 -0
- package/node_modules/@undefineds.co/pod-collections/dist/layout.js +173 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mapping.d.ts +78 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mapping.js +287 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mutations.d.ts +83 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mutations.js +273 -0
- package/node_modules/@undefineds.co/pod-collections/dist/react.d.ts +21 -0
- package/node_modules/@undefineds.co/pod-collections/dist/react.js +22 -0
- package/node_modules/@undefineds.co/pod-collections/dist/read.d.ts +65 -0
- package/node_modules/@undefineds.co/pod-collections/dist/read.js +31 -0
- package/node_modules/@undefineds.co/pod-collections/dist/sync.d.ts +66 -0
- package/node_modules/@undefineds.co/pod-collections/dist/sync.js +260 -0
- package/node_modules/@undefineds.co/pod-collections/dist/types.d.ts +155 -0
- package/node_modules/@undefineds.co/pod-collections/dist/types.js +9 -0
- package/node_modules/@undefineds.co/pod-collections/package.json +42 -0
- package/package.json +15 -7
- package/static/app/assets/main.css +1 -1
- package/static/auth-callback/assets/AiConfigContext-DnQs1ZpW.js +1 -0
- package/static/auth-callback/assets/AiConfigPage-DOtvlxH0.js +1 -0
- package/static/auth-callback/assets/DocumentProcessingPanel-BS2voQgL.js +1 -0
- package/static/auth-callback/assets/IndexLifecyclePanel-Cvt0cJtN.js +1 -0
- package/static/auth-callback/assets/{IndexSubjectPanel-BbUqop4b.js → IndexSubjectPanel-Dhf01GqF.js} +1 -1
- package/static/auth-callback/assets/ModelAssignmentsPanel-BJutWaAF.js +1 -0
- package/static/auth-callback/assets/ModelsPage-BRS0sje3.js +11 -0
- package/static/auth-callback/assets/{NetworkPage-Vp2PrMxs.js → NetworkPage-B3qBfANA.js} +2 -2
- package/static/auth-callback/assets/{PaneListHeader-DY7baSFl.js → PaneListHeader-QQeJGTp4.js} +1 -1
- package/static/auth-callback/assets/SearchIndexingPanel-MyNUSEwT.js +1 -0
- package/static/auth-callback/assets/{StatusSubjectPanel-ArIS-TxT.js → StatusSubjectPanel-DQkEVsFs.js} +1 -1
- package/static/{settings/assets/StatusWorkspace-CoMFRXoV.js → auth-callback/assets/StatusWorkspace-Dkv63Uwk.js} +1 -1
- package/static/auth-callback/assets/{SystemSettingsPage-BDvT1NUz.js → SystemSettingsPage-TIsUfX5d.js} +1 -1
- package/static/{dashboard/assets/SystemSettingsSubjectPanel-WaE8mTQi.js → auth-callback/assets/SystemSettingsSubjectPanel-BJWEt2-7.js} +5 -5
- package/static/auth-callback/assets/XpodAiConnectionsPodStore-BJiXm-PF.js +3 -0
- package/static/auth-callback/assets/{activity-D1Dsfa_0.js → activity-5hNeNKnL.js} +1 -1
- package/static/auth-callback/assets/ai-connections-CryuHGKW.js +1 -0
- package/static/auth-callback/assets/{auth-callback-Cmf4hXVZ.js → auth-callback-CAFZ3R0B.js} +6 -6
- package/static/auth-callback/assets/auth-callback-rk080mvG.css +1 -0
- package/static/auth-callback/assets/{badge-CZsHq3Ih.js → badge-CAIPI0CB.js} +1 -1
- package/static/auth-callback/assets/collection-runtime-D9s7h9YA.js +1 -0
- package/static/auth-callback/assets/dialog-BjA109aX.js +1 -0
- package/static/auth-callback/assets/{download-DU9ntlHw.js → download-B3Up5W2G.js} +1 -1
- package/static/auth-callback/assets/{external-link-BfzaaZDx.js → external-link-BTXgSPzB.js} +1 -1
- package/static/auth-callback/assets/index-BppXlxcp.js +41 -0
- package/static/auth-callback/assets/index-CirW4CJf.js +1 -0
- package/static/auth-callback/assets/index-DlLYWOhw.js +4 -0
- package/static/auth-callback/assets/{index-browser-BNFqqC74.js → index-browser-DtU38ni3.js} +1 -1
- package/static/auth-callback/assets/{key-round-BwP3DBWo.js → key-round-CQCOrZ7x.js} +1 -1
- package/static/auth-callback/assets/layout-DB3pMyTl.js +1 -0
- package/static/auth-callback/assets/pod-collections-host-KnnGFZHL.js +8 -0
- package/static/auth-callback/assets/{rotate-ccw-VMwnmyab.js → rotate-ccw-C1zM2KtS.js} +1 -1
- package/static/auth-callback/assets/{skeleton-CoD55rBT.js → skeleton-Cqp7_M9-.js} +1 -1
- package/static/auth-callback/assets/{waypoints-DRo_1Ca7.js → waypoints-Bj6gAUSQ.js} +1 -1
- package/static/auth-callback/assets/{workspace-layout--mcXl3My.js → workspace-layout-DK8mDzrY.js} +1 -1
- package/static/auth-callback/auth-callback.html +2 -2
- package/static/dashboard/assets/AiConfigContext-BsE7MqX8.js +1 -0
- package/static/dashboard/assets/AiConfigPage-DvM-lRXa.js +1 -0
- package/static/dashboard/assets/DocumentProcessingPanel-BPfdlfuf.js +1 -0
- package/static/dashboard/assets/IndexLifecyclePanel--m0AGxvh.js +1 -0
- package/static/dashboard/assets/{IndexSubjectPanel-B2cXwl8X.js → IndexSubjectPanel-Bb7m1k3d.js} +1 -1
- package/static/dashboard/assets/ModelAssignmentsPanel-BLi_zbMa.js +1 -0
- package/static/dashboard/assets/ModelsPage-CxdpgnfR.js +11 -0
- package/static/dashboard/assets/{NetworkPage-DV2V0qWO.js → NetworkPage-BAIPw-D_.js} +2 -2
- package/static/dashboard/assets/{PaneListHeader-D0c1yCFH.js → PaneListHeader-BBCMei0r.js} +1 -1
- package/static/dashboard/assets/SearchIndexingPanel-Ck4Y-xjR.js +1 -0
- package/static/dashboard/assets/{StatusSubjectPanel-oPSECj7i.js → StatusSubjectPanel-D1KWfAXE.js} +1 -1
- package/static/dashboard/assets/{StatusWorkspace-PdovQPKa.js → StatusWorkspace-JbA5gzXx.js} +1 -1
- package/static/dashboard/assets/{SystemSettingsPage-CtNDklkx.js → SystemSettingsPage-BbwQWsSR.js} +1 -1
- package/static/{settings/assets/SystemSettingsSubjectPanel-DExjDo_v.js → dashboard/assets/SystemSettingsSubjectPanel-N117nMt5.js} +5 -5
- package/static/dashboard/assets/XpodAiConnectionsPodStore-CdDOb4SV.js +18 -0
- package/static/dashboard/assets/{activity-B9ylSoyr.js → activity-DX1I96o_.js} +1 -1
- package/static/dashboard/assets/ai-connections-DwCRqOQa.js +1 -0
- package/static/dashboard/assets/{badge-BNbFbpIb.js → badge-k2vhtDqH.js} +1 -1
- package/static/dashboard/assets/collection-runtime-BFQ8teQJ.js +1 -0
- package/static/dashboard/assets/{dashboard-CD-FFVRD.js → dashboard-DWZ-fmCT.js} +4 -4
- package/static/dashboard/assets/dashboard-rk080mvG.css +1 -0
- package/static/dashboard/assets/dialog-1CCw-iHT.js +1 -0
- package/static/dashboard/assets/{download-nOP38LtW.js → download-C6-SNY1q.js} +1 -1
- package/static/dashboard/assets/{external-link-Bh2ewN9E.js → external-link-BgPcZ_j2.js} +1 -1
- package/static/dashboard/assets/index-6LcIUIYO.js +1 -0
- package/static/dashboard/assets/index-D7A8U6Pt.js +41 -0
- package/static/dashboard/assets/index-UD6QOE7H.js +4 -0
- package/static/dashboard/assets/{key-round-bGmguBLv.js → key-round-BOd7Jo0Q.js} +1 -1
- package/static/dashboard/assets/layout-DB3pMyTl.js +1 -0
- package/static/dashboard/assets/pod-collections-host-KnnGFZHL.js +8 -0
- package/static/dashboard/assets/{rotate-ccw-D2x__ODW.js → rotate-ccw-CCgJqsvx.js} +1 -1
- package/static/dashboard/assets/{skeleton-VOqft8WS.js → skeleton-Bc7abAn5.js} +1 -1
- package/static/dashboard/assets/{waypoints-fgRqm4oH.js → waypoints-s-opmJxx.js} +1 -1
- package/static/dashboard/assets/{workspace-layout-DV4dgeHX.js → workspace-layout-DqIQeTBV.js} +1 -1
- package/static/dashboard/dashboard.html +2 -2
- package/static/settings/assets/AiConfigContext-BB9KZySa.js +1 -0
- package/static/settings/assets/AiConfigPage-DGSXUkLs.js +1 -0
- package/static/settings/assets/DocumentProcessingPanel-Da2Re6Rg.js +1 -0
- package/static/settings/assets/IndexLifecyclePanel-BSZuIzgr.js +1 -0
- package/static/settings/assets/{IndexSubjectPanel-BgbI9c-a.js → IndexSubjectPanel-CFd0ay-r.js} +1 -1
- package/static/settings/assets/ModelAssignmentsPanel-CSAryvWJ.js +1 -0
- package/static/settings/assets/ModelsPage-BQwCwLHU.js +11 -0
- package/static/settings/assets/{NetworkPage-C8OA9Mtp.js → NetworkPage-BKymvsQc.js} +2 -2
- package/static/settings/assets/{PaneListHeader-COvlPJWj.js → PaneListHeader-Bjh3hRdQ.js} +1 -1
- package/static/settings/assets/SearchIndexingPanel-MjKL5QLU.js +1 -0
- package/static/settings/assets/{StatusSubjectPanel-BuLml7qn.js → StatusSubjectPanel-Bvl6K4mx.js} +1 -1
- package/static/settings/assets/StatusWorkspace-B0NzrP--.js +1 -0
- package/static/settings/assets/{SystemSettingsPage-DlzmaWV-.js → SystemSettingsPage-D2z6Z4FE.js} +1 -1
- package/static/{auth-callback/assets/SystemSettingsSubjectPanel-CDqRuC4t.js → settings/assets/SystemSettingsSubjectPanel-4sxma4X4.js} +5 -5
- package/static/settings/assets/XpodAiConnectionsPodStore-BkNQ8fZx.js +3 -0
- package/static/settings/assets/{activity-TLerXgMs.js → activity-CgJJGpjx.js} +1 -1
- package/static/settings/assets/ai-connections-CryuHGKW.js +1 -0
- package/static/settings/assets/{badge-Bcs8iWrH.js → badge-C4NypVyT.js} +1 -1
- package/static/settings/assets/collection-runtime-CTLCDxAi.js +1 -0
- package/static/settings/assets/dialog-Csq0vWUi.js +1 -0
- package/static/settings/assets/{download-Ct3QmHPt.js → download-DaLJJ-Wp.js} +1 -1
- package/static/settings/assets/{external-link-C8KiHbss.js → external-link--w_iW5Au.js} +1 -1
- package/static/settings/assets/index-B0mQa59b.js +4 -0
- package/static/settings/assets/index-BukHiu4y.js +1 -0
- package/static/settings/assets/index-COmVnZi2.js +41 -0
- package/static/settings/assets/{index-browser-CazX1pc2.js → index-browser-BGpvHwD0.js} +1 -1
- package/static/settings/assets/{key-round-B19YD1GA.js → key-round-Bk4YRjBu.js} +1 -1
- package/static/settings/assets/layout-DB3pMyTl.js +1 -0
- package/static/settings/assets/pod-collections-host-KnnGFZHL.js +8 -0
- package/static/settings/assets/{rotate-ccw-AQm2kMgU.js → rotate-ccw-TCabbqsr.js} +1 -1
- package/static/settings/assets/{settings-C-VBtt9r.js → settings-CJWpdbNC.js} +5 -5
- package/static/settings/assets/settings-rk080mvG.css +1 -0
- package/static/settings/assets/{skeleton-DyZ1OBYf.js → skeleton-JDHYVe7t.js} +1 -1
- package/static/settings/assets/{waypoints-CC3wq-SU.js → waypoints-DDvEl-MU.js} +1 -1
- package/static/settings/assets/{workspace-layout-BxXNKgf9.js → workspace-layout-DV5QU30U.js} +1 -1
- package/static/settings/settings.html +2 -2
- package/static/auth-callback/assets/AiConfigContext-DqWRSm7n.js +0 -1
- package/static/auth-callback/assets/AiConfigPage-C5YYyvzl.js +0 -1
- package/static/auth-callback/assets/DocumentProcessingPanel-DZCiacBz.js +0 -1
- package/static/auth-callback/assets/IndexLifecyclePanel-CCLeOljB.js +0 -1
- package/static/auth-callback/assets/ModelAssignmentsPanel-jUUTDKuh.js +0 -1
- package/static/auth-callback/assets/ModelsPage-B08zdtff.js +0 -10
- package/static/auth-callback/assets/SearchIndexingPanel-D4YRg1-8.js +0 -1
- package/static/auth-callback/assets/StatusWorkspace-Cp5LQ9Yx.js +0 -1
- package/static/auth-callback/assets/ai-connections-CHNTKemd.js +0 -1
- package/static/auth-callback/assets/auth-callback-DWMMiFjh.css +0 -1
- package/static/auth-callback/assets/index-DSNnLUbU.js +0 -4
- package/static/auth-callback/assets/index-FHhHoKgp.js +0 -41
- package/static/dashboard/assets/AiConfigContext-BpPDKSzI.js +0 -1
- package/static/dashboard/assets/AiConfigPage-wsqEZDIX.js +0 -1
- package/static/dashboard/assets/DocumentProcessingPanel-CDSy3juc.js +0 -1
- package/static/dashboard/assets/IndexLifecyclePanel-CVd6vQCX.js +0 -1
- package/static/dashboard/assets/ModelAssignmentsPanel-BeBZhnQd.js +0 -1
- package/static/dashboard/assets/ModelsPage-B6McSCJw.js +0 -25
- package/static/dashboard/assets/SearchIndexingPanel-CGs0OZ12.js +0 -1
- package/static/dashboard/assets/ai-connections-CHNTKemd.js +0 -1
- package/static/dashboard/assets/dashboard-DWMMiFjh.css +0 -1
- package/static/dashboard/assets/index-PgS-Bt7X.js +0 -41
- package/static/dashboard/assets/index-QN2QgEwr.js +0 -4
- package/static/settings/assets/AiConfigContext-zKQYdfai.js +0 -1
- package/static/settings/assets/AiConfigPage-Bs1EE3Ei.js +0 -1
- package/static/settings/assets/DocumentProcessingPanel-CSFfdOXS.js +0 -1
- package/static/settings/assets/IndexLifecyclePanel-BR9Su49B.js +0 -1
- package/static/settings/assets/ModelAssignmentsPanel-C0BE7nbk.js +0 -1
- package/static/settings/assets/ModelsPage-CU-YQ8_7.js +0 -10
- package/static/settings/assets/SearchIndexingPanel-Bdd46mIV.js +0 -1
- package/static/settings/assets/ai-connections-CHNTKemd.js +0 -1
- package/static/settings/assets/index-1Q2cRjZd.js +0 -41
- package/static/settings/assets/index-DBO_Vq0P.js +0 -4
- package/static/settings/assets/settings-DWMMiFjh.css +0 -1
|
@@ -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
|
-
//
|
|
558
|
-
|
|
559
|
-
|
|
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
|
-
//
|
|
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: '
|
|
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
|
-
//
|
|
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
|
|
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:
|
|
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
|
-
|
|
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
|
};
|
package/dist/api/runtime.js
CHANGED
|
@@ -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:
|
|
22
|
+
fileName: (0, log_file_1.resolveLogFilePattern)(),
|
|
22
23
|
showLocation: true,
|
|
23
24
|
});
|
|
24
25
|
(0, global_logger_factory_1.setGlobalLoggerFactory)(loggerFactory);
|
|
@@ -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
|
-
|
|
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.
|
|
141
|
-
`${subject} <${fields.
|
|
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
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpHandler } from '@solid/community-server';
|
|
2
2
|
import type { HttpHandlerInput, HttpRequest, HttpResponse } from '@solid/community-server';
|
|
3
|
-
import type { CredentialsExtractor, PermissionReader, Authorizer } from '@solid/community-server';
|
|
3
|
+
import type { ActivityEmitter, CredentialsExtractor, PermissionReader, Authorizer } from '@solid/community-server';
|
|
4
4
|
import { SubgraphQueryEngine } from '../storage/sparql/SubgraphQueryEngine';
|
|
5
5
|
import { MixDataAccessor } from '../storage/accessors/MixDataAccessor';
|
|
6
6
|
interface SubgraphSparqlHttpHandlerOptions {
|
|
@@ -41,9 +41,10 @@ export declare class SubgraphSparqlHttpHandler extends HttpHandler {
|
|
|
41
41
|
private readonly usageRepo?;
|
|
42
42
|
private readonly defaultBandwidthLimit?;
|
|
43
43
|
private readonly updateAuthority?;
|
|
44
|
+
private readonly emitter?;
|
|
44
45
|
private readonly generator;
|
|
45
46
|
private static readonly XSD_STRING;
|
|
46
|
-
constructor(queryEngine: SubgraphQueryEngine, credentialsExtractor: CredentialsExtractor, permissionReader: PermissionReader, authorizer: Authorizer, options?: SubgraphSparqlHttpHandlerOptions, updateAuthority?: MixDataAccessor);
|
|
47
|
+
constructor(queryEngine: SubgraphQueryEngine, credentialsExtractor: CredentialsExtractor, permissionReader: PermissionReader, authorizer: Authorizer, options?: SubgraphSparqlHttpHandlerOptions, updateAuthority?: MixDataAccessor, emitter?: ActivityEmitter);
|
|
47
48
|
canHandle({ request }: HttpHandlerInput): Promise<void>;
|
|
48
49
|
handle({ request, response }: HttpHandlerInput): Promise<void>;
|
|
49
50
|
/**
|
|
@@ -60,6 +61,55 @@ export declare class SubgraphSparqlHttpHandler extends HttpHandler {
|
|
|
60
61
|
private executeAsk;
|
|
61
62
|
private executeConstruct;
|
|
62
63
|
private executeUpdate;
|
|
64
|
+
/**
|
|
65
|
+
* Turns the write targets of an update access plan into the activities that should be emitted.
|
|
66
|
+
*
|
|
67
|
+
* Only documents actually written by the update (the plan's `writeTargets`) are considered:
|
|
68
|
+
* one activity per document, never per quad and never for an untouched resource.
|
|
69
|
+
*/
|
|
70
|
+
private resolvePendingActivities;
|
|
71
|
+
/**
|
|
72
|
+
* Maps the SPARQL update operation applied to one document to the ActivityStream term the
|
|
73
|
+
* CSS notification generators understand (`MonitoringStore` only forwards `as:Add|Create|Delete|Remove|Update`).
|
|
74
|
+
*
|
|
75
|
+
* Mapping (the closest faithful term for each operation):
|
|
76
|
+
* - `CREATE [SILENT] GRAPH` -> `as:Create` when the document did not exist yet;
|
|
77
|
+
* a `CREATE` on an existing graph is a silent no-op -> nothing.
|
|
78
|
+
* - `INSERT DATA` / `INSERT … WHERE` / `LOAD` /
|
|
79
|
+
* `ADD` / `COPY` target -> `as:Create` when the document did not exist yet, else `as:Update`
|
|
80
|
+
* (same `exists ? Update : Create` rule CSS uses for PUT).
|
|
81
|
+
* - `DELETE DATA` / `DELETE WHERE` /
|
|
82
|
+
* `INSERT … DELETE … WHERE` -> `as:Update` (partial removal; the document itself survives).
|
|
83
|
+
* - `CLEAR GRAPH` / `DROP GRAPH` / `MOVE` source -> `as:Update`: every triple is gone, but
|
|
84
|
+
`MixDataAccessor.executeSparqlUpdate` rewrites the graph into an *empty* document instead of
|
|
85
|
+
removing the resource, so a re-read returns 200-empty rather than 404. That observable result
|
|
86
|
+
equals a `DELETE DATA` which removes every triple, which maps to `Update`. `as:Delete` is
|
|
87
|
+
therefore deliberately unused: it becomes correct only once an accessor actually removes the
|
|
88
|
+
document (a re-read would then be 404).
|
|
89
|
+
* - delete-only update on a missing document -> nothing (SPARQL no-op).
|
|
90
|
+
* - `as:Add` / `as:Remove` are deliberately not used: those describe container membership changes
|
|
91
|
+
* (`DataAccessorBasedStore.addContainerActivity`), and the sidecar writes document graphs only.
|
|
92
|
+
*/
|
|
93
|
+
private resolveActivity;
|
|
94
|
+
/**
|
|
95
|
+
* Checks whether the document already exists before the update is applied.
|
|
96
|
+
*
|
|
97
|
+
* Uses the same accessor that performs the write, so the answer describes the storage the
|
|
98
|
+
* activity is about. Returns `undefined` when the answer cannot be determined; callers then
|
|
99
|
+
* fall back to the conservative `Update`/`Delete` terms instead of `Create`.
|
|
100
|
+
*/
|
|
101
|
+
private documentExistedBefore;
|
|
102
|
+
/**
|
|
103
|
+
* Emits the resolved activities on the injected {@link ActivityEmitter}.
|
|
104
|
+
*
|
|
105
|
+
* Mirrors `MonitoringStore.emitChanged`
|
|
106
|
+
* (node_modules/@solid/community-server/dist/storage/MonitoringStore.js:36-45): for every changed resource
|
|
107
|
+
* one `changed` event plus the ActivityStream-typed event, with the same metadata shape
|
|
108
|
+
* `DataAccessorBasedStore.addActivityMetadata` produces (an `urn:npm:solid:community-server:activity:` quad).
|
|
109
|
+
* `ListeningActivityHandler` (dist/server/notifications/ListeningActivityHandler.js:25) subscribes to `changed`
|
|
110
|
+
* and derives the notification state by re-reading the store, so no ETag has to be carried here.
|
|
111
|
+
*/
|
|
112
|
+
private emitActivities;
|
|
63
113
|
private sendPayload;
|
|
64
114
|
private streamWithLimit;
|
|
65
115
|
private resolveUsageContext;
|
|
@@ -79,6 +129,13 @@ export declare class SubgraphSparqlHttpHandler extends HttpHandler {
|
|
|
79
129
|
private inspectPatterns;
|
|
80
130
|
private assertGraphInScope;
|
|
81
131
|
private assertGraphTermInScope;
|
|
132
|
+
/**
|
|
133
|
+
* Registers a graph as written by the update and records which kind of change applies to it.
|
|
134
|
+
*
|
|
135
|
+
* Several operations can target the same graph in one request; the flags are accumulated so the graph
|
|
136
|
+
* still yields at most one activity. This is also the only place write targets are created, which keeps
|
|
137
|
+
* notification coverage tied to the same plan that drives authorization.
|
|
138
|
+
*/
|
|
82
139
|
private addWriteTarget;
|
|
83
140
|
private readLoadDocument;
|
|
84
141
|
private rewriteLoadUpdate;
|