@undefineds.co/xpod 0.3.58 → 0.3.62
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/README.md +3 -0
- package/config/cli.json +88 -0
- package/config/cloud.json +32 -1
- package/config/components-ignore.json +3 -0
- package/config/extensions.local.initializer.json +44 -0
- package/config/resolver.json +86 -0
- package/config/xpod.base.json +4 -0
- package/dist/agents/AgentExecutorFactory.d.ts +3 -3
- package/dist/agents/AgentExecutorFactory.js +28 -15
- package/dist/agents/AgentExecutorFactory.js.map +1 -1
- package/dist/agents/BaseAgentExecutor.d.ts +2 -1
- package/dist/agents/BaseAgentExecutor.js +1 -0
- package/dist/agents/BaseAgentExecutor.js.map +1 -1
- package/dist/agents/ClaudeExecutor.d.ts +3 -1
- package/dist/agents/ClaudeExecutor.js +18 -12
- package/dist/agents/ClaudeExecutor.js.map +1 -1
- package/dist/agents/config/resolve.js +0 -21
- package/dist/agents/config/resolve.js.map +1 -1
- package/dist/agents/config/types.d.ts +2 -7
- package/dist/agents/config/types.js +2 -1
- package/dist/agents/config/types.js.map +1 -1
- package/dist/agents/types.d.ts +18 -0
- package/dist/agents/types.js.map +1 -1
- package/dist/ai/schema/types.d.ts +2 -1
- package/dist/ai/schema/types.js +1 -0
- package/dist/ai/schema/types.js.map +1 -1
- package/dist/ai/service/CredentialReader.d.ts +3 -1
- package/dist/ai/service/CredentialReader.js.map +1 -1
- package/dist/ai/service/CredentialReaderImpl.d.ts +3 -1
- package/dist/ai/service/CredentialReaderImpl.js +24 -2
- package/dist/ai/service/CredentialReaderImpl.js.map +1 -1
- package/dist/ai/service/EmbeddingServiceImpl.js +13 -2
- package/dist/ai/service/EmbeddingServiceImpl.js.map +1 -1
- package/dist/ai/service/ProviderRegistry.d.ts +4 -0
- package/dist/ai/service/ProviderRegistry.js.map +1 -1
- package/dist/ai/service/ProviderRegistry.jsonld +4 -0
- package/dist/ai/service/ProviderRegistryImpl.d.ts +4 -1
- package/dist/ai/service/ProviderRegistryImpl.js +26 -4
- package/dist/ai/service/ProviderRegistryImpl.js.map +1 -1
- package/dist/ai/service/ProviderRegistryImpl.jsonld +12 -0
- package/dist/ai/service/defaultEmbeddingProfile.d.ts +5 -0
- package/dist/ai/service/defaultEmbeddingProfile.js +31 -0
- package/dist/ai/service/defaultEmbeddingProfile.js.map +1 -0
- package/dist/ai/service/index.d.ts +1 -0
- package/dist/ai/service/index.js +1 -0
- package/dist/ai/service/index.js.map +1 -1
- package/dist/ai/service/types.d.ts +1 -0
- package/dist/ai/service/types.js.map +1 -1
- package/dist/api/ApiServer.js +17 -2
- package/dist/api/ApiServer.js.map +1 -1
- package/dist/api/ai-gateway/AiGatewayService.d.ts +106 -0
- package/dist/api/ai-gateway/AiGatewayService.js +527 -0
- package/dist/api/ai-gateway/AiGatewayService.js.map +1 -0
- package/dist/api/ai-gateway/auth/AiConnectionInvocationKeyIssuer.d.ts +38 -0
- package/dist/api/ai-gateway/auth/AiConnectionInvocationKeyIssuer.js +128 -0
- package/dist/api/ai-gateway/auth/AiConnectionInvocationKeyIssuer.js.map +1 -0
- package/dist/api/ai-gateway/auth/ClientCredentialsInternalPodAccessTokenProvider.d.ts +25 -0
- package/dist/api/ai-gateway/auth/ClientCredentialsInternalPodAccessTokenProvider.js +91 -0
- package/dist/api/ai-gateway/auth/ClientCredentialsInternalPodAccessTokenProvider.js.map +1 -0
- package/dist/api/ai-gateway/auth/GatewayApiKey.d.ts +28 -0
- package/dist/api/ai-gateway/auth/GatewayApiKey.js +162 -0
- package/dist/api/ai-gateway/auth/GatewayApiKey.js.map +1 -0
- package/dist/api/ai-gateway/auth/GatewayApiKeyAuthenticator.d.ts +56 -0
- package/dist/api/ai-gateway/auth/GatewayApiKeyAuthenticator.js +143 -0
- package/dist/api/ai-gateway/auth/GatewayApiKeyAuthenticator.js.map +1 -0
- package/dist/api/ai-gateway/auth/GatewayKeyLocatorCodec.d.ts +26 -0
- package/dist/api/ai-gateway/auth/GatewayKeyLocatorCodec.js +97 -0
- package/dist/api/ai-gateway/auth/GatewayKeyLocatorCodec.js.map +1 -0
- package/dist/api/ai-gateway/auth/GatewayPrincipal.d.ts +20 -0
- package/dist/api/ai-gateway/auth/GatewayPrincipal.js +37 -0
- package/dist/api/ai-gateway/auth/GatewayPrincipal.js.map +1 -0
- package/dist/api/ai-gateway/auth/InvocationTokenCodec.d.ts +41 -0
- package/dist/api/ai-gateway/auth/InvocationTokenCodec.js +221 -0
- package/dist/api/ai-gateway/auth/InvocationTokenCodec.js.map +1 -0
- package/dist/api/ai-gateway/auth/PodGatewayAccessKeyRepository.d.ts +54 -0
- package/dist/api/ai-gateway/auth/PodGatewayAccessKeyRepository.js +152 -0
- package/dist/api/ai-gateway/auth/PodGatewayAccessKeyRepository.js.map +1 -0
- package/dist/api/ai-gateway/connect/index.d.ts +367 -0
- package/dist/api/ai-gateway/connect/index.js +1061 -0
- package/dist/api/ai-gateway/connect/index.js.map +1 -0
- package/dist/api/ai-gateway/credentials/CloudKmsWrapper.d.ts +40 -0
- package/dist/api/ai-gateway/credentials/CloudKmsWrapper.js +59 -0
- package/dist/api/ai-gateway/credentials/CloudKmsWrapper.js.map +1 -0
- package/dist/api/ai-gateway/credentials/CredentialVault.d.ts +14 -0
- package/dist/api/ai-gateway/credentials/CredentialVault.js +11 -0
- package/dist/api/ai-gateway/credentials/CredentialVault.js.map +1 -0
- package/dist/api/ai-gateway/credentials/KeyWrapper.d.ts +27 -0
- package/dist/api/ai-gateway/credentials/KeyWrapper.js +3 -0
- package/dist/api/ai-gateway/credentials/KeyWrapper.js.map +1 -0
- package/dist/api/ai-gateway/credentials/LocalKeychainWrapper.d.ts +27 -0
- package/dist/api/ai-gateway/credentials/LocalKeychainWrapper.js +145 -0
- package/dist/api/ai-gateway/credentials/LocalKeychainWrapper.js.map +1 -0
- package/dist/api/ai-gateway/credentials/SecretCellCredentialVault.d.ts +13 -0
- package/dist/api/ai-gateway/credentials/SecretCellCredentialVault.js +133 -0
- package/dist/api/ai-gateway/credentials/SecretCellCredentialVault.js.map +1 -0
- package/dist/api/ai-gateway/credentials/SecretCellKeyWrapper.d.ts +23 -0
- package/dist/api/ai-gateway/credentials/SecretCellKeyWrapper.js +62 -0
- package/dist/api/ai-gateway/credentials/SecretCellKeyWrapper.js.map +1 -0
- package/dist/api/ai-gateway/credentials/WebCryptoCredentialVault.d.ts +23 -0
- package/dist/api/ai-gateway/credentials/WebCryptoCredentialVault.js +173 -0
- package/dist/api/ai-gateway/credentials/WebCryptoCredentialVault.js.map +1 -0
- package/dist/api/ai-gateway/errors.d.ts +21 -0
- package/dist/api/ai-gateway/errors.js +50 -0
- package/dist/api/ai-gateway/errors.js.map +1 -0
- package/dist/api/ai-gateway/protocol/ChatCompletionsFrontend.d.ts +6 -0
- package/dist/api/ai-gateway/protocol/ChatCompletionsFrontend.js +111 -0
- package/dist/api/ai-gateway/protocol/ChatCompletionsFrontend.js.map +1 -0
- package/dist/api/ai-gateway/protocol/MessagesFrontend.d.ts +6 -0
- package/dist/api/ai-gateway/protocol/MessagesFrontend.js +99 -0
- package/dist/api/ai-gateway/protocol/MessagesFrontend.js.map +1 -0
- package/dist/api/ai-gateway/protocol/ResponsesFrontend.d.ts +6 -0
- package/dist/api/ai-gateway/protocol/ResponsesFrontend.js +232 -0
- package/dist/api/ai-gateway/protocol/ResponsesFrontend.js.map +1 -0
- package/dist/api/ai-gateway/protocol/index.d.ts +3 -0
- package/dist/api/ai-gateway/protocol/index.js +10 -0
- package/dist/api/ai-gateway/protocol/index.js.map +1 -0
- package/dist/api/ai-gateway/providers/AnthropicRuntimeAdapter.d.ts +7 -0
- package/dist/api/ai-gateway/providers/AnthropicRuntimeAdapter.js +37 -0
- package/dist/api/ai-gateway/providers/AnthropicRuntimeAdapter.js.map +1 -0
- package/dist/api/ai-gateway/providers/BailianRuntimeAdapter.d.ts +9 -0
- package/dist/api/ai-gateway/providers/BailianRuntimeAdapter.js +127 -0
- package/dist/api/ai-gateway/providers/BailianRuntimeAdapter.js.map +1 -0
- package/dist/api/ai-gateway/providers/DeepSeekRuntimeAdapter.d.ts +8 -0
- package/dist/api/ai-gateway/providers/DeepSeekRuntimeAdapter.js +47 -0
- package/dist/api/ai-gateway/providers/DeepSeekRuntimeAdapter.js.map +1 -0
- package/dist/api/ai-gateway/providers/KimiRuntimeAdapter.d.ts +8 -0
- package/dist/api/ai-gateway/providers/KimiRuntimeAdapter.js +57 -0
- package/dist/api/ai-gateway/providers/KimiRuntimeAdapter.js.map +1 -0
- package/dist/api/ai-gateway/providers/OpenAiCompatibleRuntimeAdapter.d.ts +1 -0
- package/dist/api/ai-gateway/providers/OpenAiCompatibleRuntimeAdapter.js +6 -0
- package/dist/api/ai-gateway/providers/OpenAiCompatibleRuntimeAdapter.js.map +1 -0
- package/dist/api/ai-gateway/providers/OpenAiRuntimeAdapter.d.ts +13 -0
- package/dist/api/ai-gateway/providers/OpenAiRuntimeAdapter.js +34 -0
- package/dist/api/ai-gateway/providers/OpenAiRuntimeAdapter.js.map +1 -0
- package/dist/api/ai-gateway/providers/ProviderRegistry.d.ts +68 -0
- package/dist/api/ai-gateway/providers/ProviderRegistry.js +288 -0
- package/dist/api/ai-gateway/providers/ProviderRegistry.js.map +1 -0
- package/dist/api/ai-gateway/providers/ProviderRuntimeAdapter.d.ts +88 -0
- package/dist/api/ai-gateway/providers/ProviderRuntimeAdapter.js +645 -0
- package/dist/api/ai-gateway/providers/ProviderRuntimeAdapter.js.map +1 -0
- package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.d.ts +13 -0
- package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.js +48 -0
- package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.js.map +1 -0
- package/dist/api/ai-gateway/providers/index.d.ts +9 -0
- package/dist/api/ai-gateway/providers/index.js +26 -0
- package/dist/api/ai-gateway/providers/index.js.map +1 -0
- package/dist/api/ai-gateway/quota/AnthropicQuotaAdapter.d.ts +5 -0
- package/dist/api/ai-gateway/quota/AnthropicQuotaAdapter.js +21 -0
- package/dist/api/ai-gateway/quota/AnthropicQuotaAdapter.js.map +1 -0
- package/dist/api/ai-gateway/quota/BailianQuotaAdapter.d.ts +5 -0
- package/dist/api/ai-gateway/quota/BailianQuotaAdapter.js +21 -0
- package/dist/api/ai-gateway/quota/BailianQuotaAdapter.js.map +1 -0
- package/dist/api/ai-gateway/quota/DeepSeekQuotaAdapter.d.ts +10 -0
- package/dist/api/ai-gateway/quota/DeepSeekQuotaAdapter.js +83 -0
- package/dist/api/ai-gateway/quota/DeepSeekQuotaAdapter.js.map +1 -0
- package/dist/api/ai-gateway/quota/KimiQuotaAdapter.d.ts +10 -0
- package/dist/api/ai-gateway/quota/KimiQuotaAdapter.js +70 -0
- package/dist/api/ai-gateway/quota/KimiQuotaAdapter.js.map +1 -0
- package/dist/api/ai-gateway/quota/OpenAiQuotaAdapter.d.ts +5 -0
- package/dist/api/ai-gateway/quota/OpenAiQuotaAdapter.js +21 -0
- package/dist/api/ai-gateway/quota/OpenAiQuotaAdapter.js.map +1 -0
- package/dist/api/ai-gateway/quota/ProviderQuotaAdapter.d.ts +214 -0
- package/dist/api/ai-gateway/quota/ProviderQuotaAdapter.js +511 -0
- package/dist/api/ai-gateway/quota/ProviderQuotaAdapter.js.map +1 -0
- package/dist/api/ai-gateway/quota/index.d.ts +6 -0
- package/dist/api/ai-gateway/quota/index.js +23 -0
- package/dist/api/ai-gateway/quota/index.js.map +1 -0
- package/dist/api/ai-gateway/routing/InMemorySessionAffinityStore.d.ts +26 -0
- package/dist/api/ai-gateway/routing/InMemorySessionAffinityStore.js +67 -0
- package/dist/api/ai-gateway/routing/InMemorySessionAffinityStore.js.map +1 -0
- package/dist/api/ai-gateway/routing/ModelRouter.d.ts +84 -0
- package/dist/api/ai-gateway/routing/ModelRouter.js +274 -0
- package/dist/api/ai-gateway/routing/ModelRouter.js.map +1 -0
- package/dist/api/ai-gateway/routing/RedisSessionAffinityStore.d.ts +39 -0
- package/dist/api/ai-gateway/routing/RedisSessionAffinityStore.js +122 -0
- package/dist/api/ai-gateway/routing/RedisSessionAffinityStore.js.map +1 -0
- package/dist/api/ai-gateway/routing/SessionAffinityStore.d.ts +49 -0
- package/dist/api/ai-gateway/routing/SessionAffinityStore.js +66 -0
- package/dist/api/ai-gateway/routing/SessionAffinityStore.js.map +1 -0
- package/dist/api/ai-gateway/service-access/AiConnectionServiceAccess.d.ts +25 -0
- package/dist/api/ai-gateway/service-access/AiConnectionServiceAccess.js +50 -0
- package/dist/api/ai-gateway/service-access/AiConnectionServiceAccess.js.map +1 -0
- package/dist/api/ai-gateway/types.d.ts +112 -0
- package/dist/api/ai-gateway/types.js +305 -0
- package/dist/api/ai-gateway/types.js.map +1 -0
- package/dist/api/auth/AuthContext.d.ts +18 -3
- package/dist/api/auth/AuthContext.js +13 -2
- package/dist/api/auth/AuthContext.js.map +1 -1
- package/dist/api/auth/Authenticator.d.ts +3 -0
- package/dist/api/auth/Authenticator.js.map +1 -1
- package/dist/api/auth/ClientCredentialsAuthenticator.d.ts +2 -6
- package/dist/api/auth/ClientCredentialsAuthenticator.js +12 -30
- package/dist/api/auth/ClientCredentialsAuthenticator.js.map +1 -1
- package/dist/api/auth/SolidTokenAuthenticator.d.ts +2 -0
- package/dist/api/auth/SolidTokenAuthenticator.js +88 -2
- package/dist/api/auth/SolidTokenAuthenticator.js.map +1 -1
- package/dist/api/auth/TokenIdentity.d.ts +6 -0
- package/dist/api/auth/TokenIdentity.js +31 -0
- package/dist/api/auth/TokenIdentity.js.map +1 -0
- package/dist/api/chatkit/ai-provider.d.ts +9 -23
- package/dist/api/chatkit/ai-provider.js +30 -153
- package/dist/api/chatkit/ai-provider.js.map +1 -1
- package/dist/api/chatkit/default-agent.d.ts +24 -15
- package/dist/api/chatkit/default-agent.js +24 -83
- package/dist/api/chatkit/default-agent.js.map +1 -1
- package/dist/api/chatkit/index.d.ts +2 -1
- package/dist/api/chatkit/index.js +3 -1
- package/dist/api/chatkit/index.js.map +1 -1
- package/dist/api/chatkit/pod-store.d.ts +13 -1
- package/dist/api/chatkit/pod-store.js +127 -7
- package/dist/api/chatkit/pod-store.js.map +1 -1
- package/dist/api/chatkit/runtime/AcpAgentRuntime.d.ts +0 -1
- package/dist/api/chatkit/runtime/AcpAgentRuntime.js +14 -51
- package/dist/api/chatkit/runtime/AcpAgentRuntime.js.map +1 -1
- package/dist/api/chatkit/runtime/AcpRunner.js +2 -1
- package/dist/api/chatkit/runtime/AcpRunner.js.map +1 -1
- package/dist/api/chatkit/runtime/CodexRuntimeProjector.d.ts +15 -1
- package/dist/api/chatkit/runtime/CodexRuntimeProjector.js +52 -34
- package/dist/api/chatkit/runtime/CodexRuntimeProjector.js.map +1 -1
- package/dist/api/chatkit/service.d.ts +8 -1
- package/dist/api/chatkit/service.js +46 -5
- package/dist/api/chatkit/service.js.map +1 -1
- package/dist/api/chatkit/store.d.ts +23 -1
- package/dist/api/chatkit/store.js +56 -0
- package/dist/api/chatkit/store.js.map +1 -1
- package/dist/api/chatkit/types.d.ts +1 -0
- package/dist/api/chatkit/types.js.map +1 -1
- package/dist/api/container/common.js +286 -13
- package/dist/api/container/common.js.map +1 -1
- package/dist/api/container/index.js +126 -6
- package/dist/api/container/index.js.map +1 -1
- package/dist/api/container/local.js +50 -6
- package/dist/api/container/local.js.map +1 -1
- package/dist/api/container/rdf.d.ts +15 -0
- package/dist/api/container/rdf.js +90 -0
- package/dist/api/container/rdf.js.map +1 -0
- package/dist/api/container/routes.js +151 -11
- package/dist/api/container/routes.js.map +1 -1
- package/dist/api/container/types.d.ts +96 -0
- package/dist/api/container/types.js.map +1 -1
- package/dist/api/handlers/AdminHandler.d.ts +25 -2
- package/dist/api/handlers/AdminHandler.js +60 -10
- package/dist/api/handlers/AdminHandler.js.map +1 -1
- package/dist/api/handlers/AiClientConfigurationHandler.d.ts +7 -0
- package/dist/api/handlers/AiClientConfigurationHandler.js +202 -0
- package/dist/api/handlers/AiClientConfigurationHandler.js.map +1 -0
- package/dist/api/handlers/AiGatewayHandler.d.ts +23 -0
- package/dist/api/handlers/AiGatewayHandler.js +231 -0
- package/dist/api/handlers/AiGatewayHandler.js.map +1 -0
- package/dist/api/handlers/AiGatewayManagementHandler.d.ts +24 -0
- package/dist/api/handlers/AiGatewayManagementHandler.js +503 -0
- package/dist/api/handlers/AiGatewayManagementHandler.js.map +1 -0
- package/dist/api/handlers/ChatHandler.d.ts +11 -12
- package/dist/api/handlers/ChatHandler.js +12 -219
- package/dist/api/handlers/ChatHandler.js.map +1 -1
- package/dist/api/handlers/DashboardHandler.js +22 -116
- package/dist/api/handlers/DashboardHandler.js.map +1 -1
- package/dist/api/handlers/NetworkSettingsHandler.d.ts +97 -0
- package/dist/api/handlers/NetworkSettingsHandler.js +511 -0
- package/dist/api/handlers/NetworkSettingsHandler.js.map +1 -0
- package/dist/api/handlers/PodSettingsHandler.d.ts +79 -0
- package/dist/api/handlers/PodSettingsHandler.js +162 -0
- package/dist/api/handlers/PodSettingsHandler.js.map +1 -0
- package/dist/api/handlers/ProvisionHandler.d.ts +3 -1
- package/dist/api/handlers/ProvisionHandler.js +22 -87
- package/dist/api/handlers/ProvisionHandler.js.map +1 -1
- package/dist/api/handlers/RdfStatsHandler.d.ts +6 -0
- package/dist/api/handlers/RdfStatsHandler.js +85 -0
- package/dist/api/handlers/RdfStatsHandler.js.map +1 -0
- package/dist/api/handlers/SettingsHandler.d.ts +5 -0
- package/dist/api/handlers/SettingsHandler.js +13 -0
- package/dist/api/handlers/SettingsHandler.js.map +1 -0
- package/dist/api/handlers/StaticSpaHandler.d.ts +8 -0
- package/dist/api/handlers/StaticSpaHandler.js +102 -0
- package/dist/api/handlers/StaticSpaHandler.js.map +1 -0
- package/dist/api/handlers/index.d.ts +1 -0
- package/dist/api/handlers/index.js +1 -0
- package/dist/api/handlers/index.js.map +1 -1
- package/dist/api/http/readBoundedJsonBody.d.ts +14 -0
- package/dist/api/http/readBoundedJsonBody.js +58 -0
- package/dist/api/http/readBoundedJsonBody.js.map +1 -0
- package/dist/api/middleware/AuthMiddleware.d.ts +1 -0
- package/dist/api/middleware/AuthMiddleware.js +33 -4
- package/dist/api/middleware/AuthMiddleware.js.map +1 -1
- package/dist/api/runs/AgentRuntimeTypes.d.ts +18 -3
- package/dist/api/runs/AgentRuntimeTypes.js +61 -0
- package/dist/api/runs/AgentRuntimeTypes.js.map +1 -1
- package/dist/api/runs/InngestRunExecutionBackend.d.ts +28 -3
- package/dist/api/runs/InngestRunExecutionBackend.js +26 -3
- package/dist/api/runs/InngestRunExecutionBackend.js.map +1 -1
- package/dist/api/runs/ManagedRunWorker.d.ts +4 -1
- package/dist/api/runs/ManagedRunWorker.js +39 -8
- package/dist/api/runs/ManagedRunWorker.js.map +1 -1
- package/dist/api/runs/PiAgentRuntimeDriver.d.ts +5 -1
- package/dist/api/runs/PiAgentRuntimeDriver.js +94 -57
- package/dist/api/runs/PiAgentRuntimeDriver.js.map +1 -1
- package/dist/api/runs/RdfRunContextRetriever.d.ts +46 -0
- package/dist/api/runs/RdfRunContextRetriever.js +277 -0
- package/dist/api/runs/RdfRunContextRetriever.js.map +1 -0
- package/dist/api/runs/RunExecutionBackend.d.ts +38 -0
- package/dist/api/runs/RunExecutionBackend.js.map +1 -1
- package/dist/api/runs/RunStateCenter.d.ts +18 -3
- package/dist/api/runs/RunStateCenter.js +85 -24
- package/dist/api/runs/RunStateCenter.js.map +1 -1
- package/dist/api/runtime.js +163 -3
- package/dist/api/runtime.js.map +1 -1
- package/dist/api/service/AiClientConfigurationService.d.ts +97 -0
- package/dist/api/service/AiClientConfigurationService.js +379 -0
- package/dist/api/service/AiClientConfigurationService.js.map +1 -0
- package/dist/api/service/RdfBenchmarkReportCatalog.d.ts +86 -0
- package/dist/api/service/RdfBenchmarkReportCatalog.js +349 -0
- package/dist/api/service/RdfBenchmarkReportCatalog.js.map +1 -0
- package/dist/api/service/RdfBenchmarkReportGate.d.ts +78 -0
- package/dist/api/service/RdfBenchmarkReportGate.js +197 -0
- package/dist/api/service/RdfBenchmarkReportGate.js.map +1 -0
- package/dist/api/service/RdfSearchIndexingService.d.ts +113 -0
- package/dist/api/service/RdfSearchIndexingService.js +272 -0
- package/dist/api/service/RdfSearchIndexingService.js.map +1 -0
- package/dist/api/service/RdfSearchIndexingSolidFsSyncer.d.ts +27 -0
- package/dist/api/service/RdfSearchIndexingSolidFsSyncer.js +90 -0
- package/dist/api/service/RdfSearchIndexingSolidFsSyncer.js.map +1 -0
- package/dist/api/service/RdfStorageStatsService.d.ts +31 -0
- package/dist/api/service/RdfStorageStatsService.js +97 -0
- package/dist/api/service/RdfStorageStatsService.js.map +1 -0
- package/dist/api/service/VectorStoreService.d.ts +2 -0
- package/dist/api/service/VectorStoreService.js +70 -2
- package/dist/api/service/VectorStoreService.js.map +1 -1
- package/dist/api/service/VercelChatService.d.ts +27 -38
- package/dist/api/service/VercelChatService.js +153 -505
- package/dist/api/service/VercelChatService.js.map +1 -1
- package/dist/api/service/provider-http-transport.d.ts +21 -0
- package/dist/api/service/provider-http-transport.js +108 -2
- package/dist/api/service/provider-http-transport.js.map +1 -1
- package/dist/api/service/provider-registry.d.ts +5 -7
- package/dist/api/service/provider-registry.js +81 -64
- package/dist/api/service/provider-registry.js.map +1 -1
- package/dist/api/tasks/InngestTaskScheduler.d.ts +44 -4
- package/dist/api/tasks/TaskMaterializer.d.ts +10 -1
- package/dist/api/tasks/TaskMaterializer.js +39 -4
- package/dist/api/tasks/TaskMaterializer.js.map +1 -1
- package/dist/api/tasks/TaskService.d.ts +5 -1
- package/dist/api/tasks/TaskService.js +3 -0
- package/dist/api/tasks/TaskService.js.map +1 -1
- package/dist/cli/commands/rdf.d.ts +9 -0
- package/dist/cli/commands/rdf.js +66 -1
- package/dist/cli/commands/rdf.js.map +1 -1
- package/dist/cli/commands/start.js +3 -0
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/lib/solid-auth.d.ts +3 -3
- package/dist/cli/lib/solid-auth.js +4 -4
- package/dist/cli/lib/solid-auth.js.map +1 -1
- package/dist/components/components.jsonld +16 -0
- package/dist/components/context.jsonld +815 -28
- package/dist/document/Chunker.jsonld +110 -0
- package/dist/document/{DocumentParser.d.ts → DocumentReader.d.ts} +23 -11
- package/dist/document/{DocumentParser.js → DocumentReader.js} +2 -2
- package/dist/document/DocumentReader.js.map +1 -0
- package/dist/document/DocumentReader.jsonld +82 -0
- package/dist/document/HeadingChunker.jsonld +41 -0
- package/dist/document/{JinaDocumentParser.d.ts → JinaReader.d.ts} +7 -7
- package/dist/document/{JinaDocumentParser.js → JinaReader.js} +12 -12
- package/dist/document/JinaReader.js.map +1 -0
- package/dist/document/JinaReader.jsonld +133 -0
- package/dist/document/L0SourceSummary.d.ts +103 -0
- package/dist/document/L0SourceSummary.js +157 -0
- package/dist/document/L0SourceSummary.js.map +1 -0
- package/dist/document/L0SourceSummary.jsonld +326 -0
- package/dist/document/PaddleOcrReader.d.ts +40 -0
- package/dist/document/PaddleOcrReader.js +53 -0
- package/dist/document/PaddleOcrReader.js.map +1 -0
- package/dist/document/PaddleOcrReader.jsonld +234 -0
- package/dist/document/ReaderAiConfig.d.ts +50 -0
- package/dist/document/ReaderAiConfig.js +109 -0
- package/dist/document/ReaderAiConfig.js.map +1 -0
- package/dist/document/ReaderAiConfig.jsonld +185 -0
- package/dist/document/ReaderPolicy.d.ts +89 -0
- package/dist/document/ReaderPolicy.js +158 -0
- package/dist/document/ReaderPolicy.js.map +1 -0
- package/dist/document/ReaderPolicy.jsonld +218 -0
- package/dist/document/index.d.ts +6 -2
- package/dist/document/index.js +6 -2
- package/dist/document/index.js.map +1 -1
- package/dist/edge/DdnsManager.d.ts +1 -1
- package/dist/edge/DdnsManager.js.map +1 -1
- package/dist/edge/EdgeNodeAgent.d.ts +4 -0
- package/dist/edge/EdgeNodeAgent.js +6 -0
- package/dist/edge/EdgeNodeAgent.js.map +1 -1
- package/dist/edge/EdgeNodeAgent.jsonld +8 -0
- package/dist/edge/EdgeNodeAgentInitializer.d.ts +16 -0
- package/dist/edge/EdgeNodeAgentInitializer.js +51 -0
- package/dist/edge/EdgeNodeAgentInitializer.js.map +1 -1
- package/dist/edge/EdgeNodeAgentInitializer.jsonld +250 -0
- package/dist/edge/EdgeNodeCertificateCapabilityBridge.d.ts +34 -0
- package/dist/edge/EdgeNodeCertificateCapabilityBridge.js +111 -0
- package/dist/edge/EdgeNodeCertificateCapabilityBridge.js.map +1 -0
- package/dist/edge/acme/AcmeCertificateManager.d.ts +14 -1
- package/dist/edge/acme/AcmeCertificateManager.js +67 -7
- package/dist/edge/acme/AcmeCertificateManager.js.map +1 -1
- package/dist/edge/acme/AcmeCertificateManager.jsonld +22 -2
- package/dist/edge/acme/ClusterCertificateManager.d.ts +12 -0
- package/dist/edge/acme/ClusterCertificateManager.js +38 -0
- package/dist/edge/acme/ClusterCertificateManager.js.map +1 -1
- package/dist/extensions/ExtensionRuntime.d.ts +17 -0
- package/dist/extensions/ExtensionRuntime.js +171 -0
- package/dist/extensions/ExtensionRuntime.js.map +1 -0
- package/dist/extensions/PodCredentialResolver.d.ts +23 -0
- package/dist/extensions/PodCredentialResolver.js +139 -0
- package/dist/extensions/PodCredentialResolver.js.map +1 -0
- package/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/index.js +20 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/types.d.ts +73 -0
- package/dist/extensions/types.js +3 -0
- package/dist/extensions/types.js.map +1 -0
- package/dist/http/SubgraphSparqlHttpHandler.d.ts +20 -1
- package/dist/http/SubgraphSparqlHttpHandler.js +324 -43
- package/dist/http/SubgraphSparqlHttpHandler.js.map +1 -1
- package/dist/http/SubgraphSparqlHttpHandler.jsonld +87 -0
- package/dist/identity/drizzle/EdgeNodeRepository.js +3 -2
- package/dist/identity/drizzle/EdgeNodeRepository.js.map +1 -1
- package/dist/identity/drizzle/schema.pg.js +1 -1
- package/dist/identity/drizzle/schema.pg.js.map +1 -1
- package/dist/identity/drizzle/schema.sqlite.js +1 -1
- package/dist/identity/drizzle/schema.sqlite.js.map +1 -1
- package/dist/identity/oidc/ScopedPickWebIdHandler.js +5 -5
- package/dist/identity/oidc/ScopedPickWebIdHandler.js.map +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/main.js +3 -0
- package/dist/main.js.map +1 -1
- package/dist/provision/LocalProvisionState.d.ts +28 -0
- package/dist/provision/LocalProvisionState.js +124 -0
- package/dist/provision/LocalProvisionState.js.map +1 -0
- package/dist/provision/ProvisionCodeCodec.d.ts +7 -3
- package/dist/provision/ProvisionCodeCodec.js +10 -3
- package/dist/provision/ProvisionCodeCodec.js.map +1 -1
- package/dist/provision/ProvisionPodCreator.d.ts +15 -1
- package/dist/provision/ProvisionPodCreator.js +68 -1
- package/dist/provision/ProvisionPodCreator.js.map +1 -1
- package/dist/provision/ProvisionPodCreator.jsonld +31 -0
- package/dist/provision/ServiceAccessTokenCodec.d.ts +45 -0
- package/dist/provision/ServiceAccessTokenCodec.js +86 -0
- package/dist/provision/ServiceAccessTokenCodec.js.map +1 -0
- package/dist/runtime/GatewayAdminProxyAuth.d.ts +29 -0
- package/dist/runtime/GatewayAdminProxyAuth.js +108 -0
- package/dist/runtime/GatewayAdminProxyAuth.js.map +1 -0
- package/dist/runtime/Proxy.d.ts +10 -0
- package/dist/runtime/Proxy.js +64 -6
- package/dist/runtime/Proxy.js.map +1 -1
- package/dist/runtime/XpodRuntime.js +1 -0
- package/dist/runtime/XpodRuntime.js.map +1 -1
- package/dist/runtime/bootstrap.d.ts +1 -0
- package/dist/runtime/bootstrap.js +29 -0
- package/dist/runtime/bootstrap.js.map +1 -1
- package/dist/runtime/css-process.d.ts +1 -0
- package/dist/runtime/css-process.js +1 -0
- package/dist/runtime/css-process.js.map +1 -1
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.js +3 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/lifecycle.d.ts +3 -1
- package/dist/runtime/lifecycle.js +3 -1
- package/dist/runtime/lifecycle.js.map +1 -1
- package/dist/runtime/runner/node/NodeGatewayRuntimeRunner.js +2 -0
- package/dist/runtime/runner/node/NodeGatewayRuntimeRunner.js.map +1 -1
- package/dist/runtime/runner/types.d.ts +3 -0
- package/dist/runtime/runner/types.js.map +1 -1
- package/dist/runtime/runtime-types.d.ts +2 -0
- package/dist/runtime/runtime-types.js.map +1 -1
- package/dist/runtime/safe-env.d.ts +15 -0
- package/dist/runtime/safe-env.js +109 -0
- package/dist/runtime/safe-env.js.map +1 -0
- package/dist/security/index.d.ts +1 -0
- package/dist/security/index.js +18 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/secret-cell/DeploymentRootKeyProvider.d.ts +17 -0
- package/dist/security/secret-cell/DeploymentRootKeyProvider.js +61 -0
- package/dist/security/secret-cell/DeploymentRootKeyProvider.js.map +1 -0
- package/dist/security/secret-cell/DeploymentRootKeyProvider.jsonld +124 -0
- package/dist/security/secret-cell/SecretCellVault.d.ts +55 -0
- package/dist/security/secret-cell/SecretCellVault.js +242 -0
- package/dist/security/secret-cell/SecretCellVault.js.map +1 -0
- package/dist/security/secret-cell/SecretCellVault.jsonld +207 -0
- package/dist/security/secret-cell/index.d.ts +2 -0
- package/dist/security/secret-cell/index.js +11 -0
- package/dist/security/secret-cell/index.js.map +1 -0
- package/dist/solidfs/CompositeSolidFsSyncer.d.ts +18 -0
- package/dist/solidfs/CompositeSolidFsSyncer.js +32 -0
- package/dist/solidfs/CompositeSolidFsSyncer.js.map +1 -0
- package/dist/solidfs/LocalSolidFS.js +25 -1
- package/dist/solidfs/LocalSolidFS.js.map +1 -1
- package/dist/solidfs/RdfIndexSolidFsSyncer.d.ts +41 -2
- package/dist/solidfs/RdfIndexSolidFsSyncer.js +331 -21
- package/dist/solidfs/RdfIndexSolidFsSyncer.js.map +1 -1
- package/dist/solidfs/SolidFsMetaNotes.d.ts +25 -0
- package/dist/solidfs/SolidFsMetaNotes.js +103 -0
- package/dist/solidfs/SolidFsMetaNotes.js.map +1 -0
- package/dist/solidfs/SolidFsSyncJournal.d.ts +2 -2
- package/dist/solidfs/SolidFsSyncJournal.js +9 -4
- package/dist/solidfs/SolidFsSyncJournal.js.map +1 -1
- package/dist/solidfs/SolidFsSyncJournal.jsonld +119 -0
- package/dist/solidfs/WorkspacePrompt.d.ts +13 -0
- package/dist/solidfs/WorkspacePrompt.js +42 -0
- package/dist/solidfs/WorkspacePrompt.js.map +1 -0
- package/dist/solidfs/index.d.ts +3 -0
- package/dist/solidfs/index.js +3 -0
- package/dist/solidfs/index.js.map +1 -1
- package/dist/solidfs/types.d.ts +12 -2
- package/dist/solidfs/types.js.map +1 -1
- package/dist/storage/accessors/MixDataAccessor.d.ts +36 -4
- package/dist/storage/accessors/MixDataAccessor.js +222 -23
- package/dist/storage/accessors/MixDataAccessor.js.map +1 -1
- package/dist/storage/accessors/MixDataAccessor.jsonld +89 -0
- package/dist/storage/accessors/SolidRdfDataAccessor.d.ts +6 -1
- package/dist/storage/accessors/SolidRdfDataAccessor.js +35 -0
- package/dist/storage/accessors/SolidRdfDataAccessor.js.map +1 -1
- package/dist/storage/accessors/SolidRdfDataAccessor.jsonld +20 -0
- package/dist/storage/database/PostgresPoolManager.d.ts +1 -0
- package/dist/storage/database/PostgresPoolManager.js +2 -2
- package/dist/storage/database/PostgresPoolManager.js.map +1 -1
- package/dist/storage/locking/UrlAwareRedisLocker.d.ts +2 -0
- package/dist/storage/locking/UrlAwareRedisLocker.js +65 -0
- package/dist/storage/locking/UrlAwareRedisLocker.js.map +1 -1
- package/dist/storage/locking/UrlAwareRedisLocker.jsonld +19 -0
- package/dist/storage/rdf/PostgresRdfEngine.d.ts +286 -9
- package/dist/storage/rdf/PostgresRdfEngine.js +10773 -2084
- package/dist/storage/rdf/PostgresRdfEngine.js.map +1 -1
- package/dist/storage/rdf/PostgresRdfEngine.jsonld +1693 -89
- package/dist/storage/rdf/PostgresRdfSqlExecutor.d.ts +24 -0
- package/dist/storage/rdf/PostgresRdfSqlExecutor.js +131 -0
- package/dist/storage/rdf/PostgresRdfSqlExecutor.js.map +1 -0
- package/dist/storage/rdf/PostgresRdfTextIndex.d.ts +54 -0
- package/dist/storage/rdf/PostgresRdfTextIndex.js +1255 -0
- package/dist/storage/rdf/PostgresRdfTextIndex.js.map +1 -0
- package/dist/storage/rdf/PostgresRdfTextIndex.jsonld +487 -0
- package/dist/storage/rdf/PostgresRdfVectorIndex.d.ts +46 -0
- package/dist/storage/rdf/PostgresRdfVectorIndex.js +1165 -0
- package/dist/storage/rdf/PostgresRdfVectorIndex.js.map +1 -0
- package/dist/storage/rdf/PostgresRdfVectorIndex.jsonld +423 -0
- package/dist/storage/rdf/Rdf3xIndex.d.ts +14 -1
- package/dist/storage/rdf/Rdf3xIndex.js +286 -2
- package/dist/storage/rdf/Rdf3xIndex.js.map +1 -1
- package/dist/storage/rdf/Rdf3xIndex.jsonld +36 -0
- package/dist/storage/rdf/Rdf3xSchema.d.ts +5 -1
- package/dist/storage/rdf/Rdf3xSchema.js +17 -3
- package/dist/storage/rdf/Rdf3xSchema.js.map +1 -1
- package/dist/storage/rdf/RdfAccessScope.d.ts +22 -0
- package/dist/storage/rdf/RdfAccessScope.js +345 -0
- package/dist/storage/rdf/RdfAccessScope.js.map +1 -0
- package/dist/storage/rdf/RdfAccessScope.jsonld +45 -0
- package/dist/storage/rdf/RdfFusionRankPlan.d.ts +2 -0
- package/dist/storage/rdf/RdfFusionRankPlan.js +186 -0
- package/dist/storage/rdf/RdfFusionRankPlan.js.map +1 -0
- package/dist/storage/rdf/RdfJoinShape.d.ts +8 -0
- package/dist/storage/rdf/RdfJoinShape.js +31 -0
- package/dist/storage/rdf/RdfJoinShape.js.map +1 -0
- package/dist/storage/rdf/RdfQuadIndex.d.ts +5 -2
- package/dist/storage/rdf/RdfQuadIndex.js +94 -6
- package/dist/storage/rdf/RdfQuadIndex.js.map +1 -1
- package/dist/storage/rdf/RdfQuadIndex.jsonld +12 -0
- package/dist/storage/rdf/RdfQueryExecutor.d.ts +3 -4
- package/dist/storage/rdf/RdfQueryExecutor.js +235 -8
- package/dist/storage/rdf/RdfQueryExecutor.js.map +1 -1
- package/dist/storage/rdf/RdfSearchSourceFilter.d.ts +10 -0
- package/dist/storage/rdf/RdfSearchSourceFilter.js +83 -0
- package/dist/storage/rdf/RdfSearchSourceFilter.js.map +1 -0
- package/dist/storage/rdf/RdfSparqlAdapter.d.ts +27 -1
- package/dist/storage/rdf/RdfSparqlAdapter.js +265 -3
- package/dist/storage/rdf/RdfSparqlAdapter.js.map +1 -1
- package/dist/storage/rdf/RdfSparqlAdapter.jsonld +8 -0
- package/dist/storage/rdf/RdfTermDictionary.d.ts +7 -1
- package/dist/storage/rdf/RdfTermDictionary.js +139 -0
- package/dist/storage/rdf/RdfTermDictionary.js.map +1 -1
- package/dist/storage/rdf/RdfTermDictionary.jsonld +4 -0
- package/dist/storage/rdf/RdfTextIndex.d.ts +45 -2
- package/dist/storage/rdf/RdfTextIndex.js +810 -114
- package/dist/storage/rdf/RdfTextIndex.js.map +1 -1
- package/dist/storage/rdf/RdfTextIndex.jsonld +193 -0
- package/dist/storage/rdf/RdfTextProjection.d.ts +10 -0
- package/dist/storage/rdf/RdfTextProjection.js +258 -0
- package/dist/storage/rdf/RdfTextProjection.js.map +1 -0
- package/dist/storage/rdf/RdfVectorIndex.d.ts +30 -2
- package/dist/storage/rdf/RdfVectorIndex.js +461 -38
- package/dist/storage/rdf/RdfVectorIndex.js.map +1 -1
- package/dist/storage/rdf/RdfVectorIndex.jsonld +163 -0
- package/dist/storage/rdf/SolidRdfEngine.d.ts +12 -9
- package/dist/storage/rdf/SolidRdfEngine.js +48 -22
- package/dist/storage/rdf/SolidRdfEngine.js.map +1 -1
- package/dist/storage/rdf/SolidRdfEngine.jsonld +33 -43
- package/dist/storage/rdf/SolidRdfSparqlEngine.d.ts +19 -8
- package/dist/storage/rdf/SolidRdfSparqlEngine.js +674 -44
- package/dist/storage/rdf/SolidRdfSparqlEngine.js.map +1 -1
- package/dist/storage/rdf/SolidRdfSparqlEngine.jsonld +51 -0
- package/dist/storage/rdf/index.d.ts +9 -5
- package/dist/storage/rdf/index.js +42 -1
- package/dist/storage/rdf/index.js.map +1 -1
- package/dist/storage/rdf/models-benchmark.d.ts +264 -2
- package/dist/storage/rdf/models-benchmark.js +4207 -155
- package/dist/storage/rdf/models-benchmark.js.map +1 -1
- package/dist/storage/rdf/types.d.ts +833 -4
- package/dist/storage/rdf/types.js.map +1 -1
- package/dist/storage/rdf/types.jsonld +348 -0
- package/dist/storage/sparql/CompatibilitySparqlEngine.d.ts +14 -13
- package/dist/storage/sparql/CompatibilitySparqlEngine.js +24 -24
- package/dist/storage/sparql/CompatibilitySparqlEngine.js.map +1 -1
- package/dist/storage/sparql/CompatibilitySparqlEngineImpl.d.ts +14 -13
- package/dist/storage/sparql/CompatibilitySparqlEngineImpl.js +30 -18
- package/dist/storage/sparql/CompatibilitySparqlEngineImpl.js.map +1 -1
- package/dist/storage/sparql/SubgraphQueryEngine.d.ts +21 -12
- package/dist/storage/sparql/SubgraphQueryEngine.js +12 -12
- package/dist/storage/sparql/SubgraphQueryEngine.js.map +1 -1
- package/dist/terminal/sandbox/MacOSSandbox.js +2 -1
- package/dist/terminal/sandbox/MacOSSandbox.js.map +1 -1
- package/dist/terminal/sandbox/index.js +2 -1
- package/dist/terminal/sandbox/index.js.map +1 -1
- package/dist/test-utils/no-auth-xpod.js +3 -0
- package/dist/test-utils/no-auth-xpod.js.map +1 -1
- package/dist/tunnel/LocalTunnelProvider.d.ts +3 -0
- package/dist/tunnel/LocalTunnelProvider.js +17 -1
- package/dist/tunnel/LocalTunnelProvider.js.map +1 -1
- package/dist/tunnel/LocalTunnelProvider.jsonld +23 -0
- package/dist/tunnel/SakuraFrpTunnelProvider.d.ts +3 -0
- package/dist/tunnel/SakuraFrpTunnelProvider.js +18 -2
- package/dist/tunnel/SakuraFrpTunnelProvider.js.map +1 -1
- package/dist/tunnel/TunnelProfiles.d.ts +22 -0
- package/dist/tunnel/TunnelProfiles.js +208 -0
- package/dist/tunnel/TunnelProfiles.js.map +1 -0
- package/dist/tunnel/index.d.ts +2 -0
- package/dist/tunnel/index.js +4 -1
- package/dist/tunnel/index.js.map +1 -1
- package/dist/util/identifiers/ClusterIdentifierStrategy.d.ts +3 -0
- package/dist/util/identifiers/ClusterIdentifierStrategy.js +18 -2
- package/dist/util/identifiers/ClusterIdentifierStrategy.js.map +1 -1
- package/dist/util/identifiers/ClusterIdentifierStrategy.jsonld +5 -1
- package/node_modules/@undefineds.co/ai-connection/dist/AiClientConfigurationSection.d.ts +55 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiClientConfigurationSection.js +167 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionHeader.d.ts +3 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionHeader.js +8 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionList.d.ts +4 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionList.js +36 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionMain.d.ts +4 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionMain.js +37 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionMainHeader.d.ts +3 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionMainHeader.js +7 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionPanel.d.ts +14 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionPanel.js +333 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiProviderCard.d.ts +22 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiProviderCard.js +43 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiQuotaCard.d.ts +8 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiQuotaCard.js +6 -0
- package/node_modules/@undefineds.co/ai-connection/dist/ai-connection-client.d.ts +120 -0
- package/node_modules/@undefineds.co/ai-connection/dist/ai-connection-client.js +414 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/base-adapter.d.ts +32 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/base-adapter.js +212 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/codex.d.ts +14 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/codex.js +90 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/index.cjs +668 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/index.d.ts +6 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/index.js +6 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/json-env-adapter.d.ts +21 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/json-env-adapter.js +82 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/pi.d.ts +13 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/pi.js +83 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/transaction.d.ts +17 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/transaction.js +153 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/types.d.ts +40 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/types.js +1 -0
- package/node_modules/@undefineds.co/ai-connection/dist/controller.d.ts +42 -0
- package/node_modules/@undefineds.co/ai-connection/dist/controller.js +289 -0
- package/node_modules/@undefineds.co/ai-connection/dist/index.d.ts +16 -0
- package/node_modules/@undefineds.co/ai-connection/dist/index.js +41 -0
- package/node_modules/@undefineds.co/ai-connection/dist/manifest.d.ts +1 -0
- package/node_modules/@undefineds.co/ai-connection/dist/manifest.js +18 -0
- package/node_modules/@undefineds.co/ai-connection/dist/service-access.d.ts +3 -0
- package/node_modules/@undefineds.co/ai-connection/dist/service-access.js +133 -0
- package/node_modules/@undefineds.co/ai-connection/package.json +50 -0
- package/node_modules/@undefineds.co/extension-sdk/README.md +299 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/index.d.ts +5 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/index.js +5 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/layout.d.ts +16 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/layout.js +36 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/manifest.d.ts +27 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/manifest.js +79 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react/app-layout.d.ts +7 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react/app-layout.js +8 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react/auth-boundary.d.ts +27 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react/auth-boundary.js +49 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react/layout-context.d.ts +11 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react/layout-context.js +9 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react/workspace-layout.d.ts +38 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react/workspace-layout.js +132 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react.d.ts +12 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react.js +19 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/testing.d.ts +7 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/testing.js +27 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/web.d.ts +225 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/web.js +142 -0
- package/node_modules/@undefineds.co/extension-sdk/package.json +49 -0
- package/node_modules/@undefineds.co/extensions/README.md +101 -0
- package/node_modules/@undefineds.co/extensions/dist/adapters/langchain.d.ts +25 -0
- package/node_modules/@undefineds.co/extensions/dist/adapters/langchain.d.ts.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/adapters/langchain.js +45 -0
- package/node_modules/@undefineds.co/extensions/dist/adapters/langchain.js.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/adapters/llamaindex.d.ts +31 -0
- package/node_modules/@undefineds.co/extensions/dist/adapters/llamaindex.d.ts.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/adapters/llamaindex.js +50 -0
- package/node_modules/@undefineds.co/extensions/dist/adapters/llamaindex.js.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/index.d.ts +7 -0
- package/node_modules/@undefineds.co/extensions/dist/index.d.ts.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/index.js +7 -0
- package/node_modules/@undefineds.co/extensions/dist/index.js.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/paddleocr.d.ts +16 -0
- package/node_modules/@undefineds.co/extensions/dist/paddleocr.d.ts.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/paddleocr.js +267 -0
- package/node_modules/@undefineds.co/extensions/dist/paddleocr.js.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/reader.d.ts +18 -0
- package/node_modules/@undefineds.co/extensions/dist/reader.d.ts.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/reader.js +39 -0
- package/node_modules/@undefineds.co/extensions/dist/reader.js.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/registry.d.ts +16 -0
- package/node_modules/@undefineds.co/extensions/dist/registry.d.ts.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/registry.js +97 -0
- package/node_modules/@undefineds.co/extensions/dist/registry.js.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/types.d.ts +141 -0
- package/node_modules/@undefineds.co/extensions/dist/types.d.ts.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/types.js +2 -0
- package/node_modules/@undefineds.co/extensions/dist/types.js.map +1 -0
- package/node_modules/@undefineds.co/extensions/package.json +38 -0
- package/node_modules/@undefineds.co/shared-ui/dist/badge.d.ts +8 -0
- package/node_modules/@undefineds.co/shared-ui/dist/badge.js +17 -0
- package/node_modules/@undefineds.co/shared-ui/dist/button.d.ts +10 -0
- package/node_modules/@undefineds.co/shared-ui/dist/button.js +30 -0
- package/node_modules/@undefineds.co/shared-ui/dist/card.d.ts +7 -0
- package/node_modules/@undefineds.co/shared-ui/dist/card.js +15 -0
- package/node_modules/@undefineds.co/shared-ui/dist/index.d.ts +6 -0
- package/node_modules/@undefineds.co/shared-ui/dist/index.js +6 -0
- package/node_modules/@undefineds.co/shared-ui/dist/input.d.ts +4 -0
- package/node_modules/@undefineds.co/shared-ui/dist/input.js +5 -0
- package/node_modules/@undefineds.co/shared-ui/dist/theme.css +121 -0
- package/node_modules/@undefineds.co/shared-ui/dist/utils.d.ts +2 -0
- package/node_modules/@undefineds.co/shared-ui/dist/utils.js +5 -0
- package/node_modules/@undefineds.co/shared-ui/dist/workspace.d.ts +23 -0
- package/node_modules/@undefineds.co/shared-ui/dist/workspace.js +38 -0
- package/node_modules/@undefineds.co/shared-ui/package.json +39 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/index.d.ts +3 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/index.js +3 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/pod-runtime.d.ts +45 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/pod-runtime.js +147 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/react.d.ts +15 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/react.js +15 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/session.d.ts +42 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/session.js +127 -0
- package/node_modules/@undefineds.co/solid-sdk/package.json +45 -0
- package/package.json +31 -13
- package/static/app/assets/index-BoYHJ6si.js +230 -0
- package/static/app/assets/inrupt-smoke.js +2 -2
- package/static/app/assets/main.css +1 -1
- package/static/app/assets/main.js +9 -9
- package/static/dashboard/assets/NetworkPage-Brt79fuQ.js +2 -0
- package/static/dashboard/assets/PaneListHeader-57nvMwH6.js +1 -0
- package/static/dashboard/assets/PodPage-CM6do1vB.js +2 -0
- package/static/dashboard/assets/ServicesPage-BUNxGJRz.js +1 -0
- package/static/dashboard/assets/card-B9Zjf_2p.js +1 -0
- package/static/dashboard/assets/dashboard-8C6o666W.js +305 -0
- package/static/dashboard/assets/dashboard-CSdewNeA.css +1 -0
- package/static/dashboard/assets/database-DPh9wDY9.js +1 -0
- package/static/dashboard/assets/external-link-VbMQvVMz.js +1 -0
- package/static/dashboard/assets/index-RfiFckzb.js +51 -0
- package/static/dashboard/assets/refresh-cw-BxVxNxNr.js +1 -0
- package/static/dashboard/assets/services-status-context-DKmJ7ISr.js +1 -0
- package/static/dashboard/dashboard.html +2 -2
- package/static/settings/assets/ModelsPage-D_IH7AH3.js +1 -0
- package/static/settings/assets/PaneListHeader-Bgaze006.js +1 -0
- package/static/settings/assets/PodPage-Cy1VNObw.js +2 -0
- package/static/settings/assets/ServicesPage-BsFaxVWC.js +1 -0
- package/static/settings/assets/SettingsPage-UafNWE_p.js +48 -0
- package/static/settings/assets/card-B_bXSIn-.js +1 -0
- package/static/settings/assets/services-status-context-DiX-AbrP.js +1 -0
- package/static/settings/assets/settings-B30oMfZq.js +305 -0
- package/static/settings/assets/settings-CSdewNeA.css +1 -0
- package/static/settings/assets/workspace-layout-Dv1Yn9Ci.js +1 -0
- package/static/settings/auth.html +21 -0
- package/static/settings/reachability.html +221 -0
- package/static/settings/reachability.svg +7 -0
- package/static/settings/reachability.webmanifest +18 -0
- package/static/settings/settings.html +13 -0
- package/static/settings/signal-pod.html +293 -0
- package/static/settings/vite.svg +1 -0
- package/dist/api/service/ai-gateway-transport.d.ts +0 -25
- package/dist/api/service/ai-gateway-transport.js +0 -136
- package/dist/api/service/ai-gateway-transport.js.map +0 -1
- package/dist/api/service/chat-protocol-adapters.d.ts +0 -5
- package/dist/api/service/chat-protocol-adapters.js +0 -146
- package/dist/api/service/chat-protocol-adapters.js.map +0 -1
- package/dist/api/service/chat-routing.d.ts +0 -8
- package/dist/api/service/chat-routing.js +0 -16
- package/dist/api/service/chat-routing.js.map +0 -1
- package/dist/api/service/platform-ai-config.d.ts +0 -10
- package/dist/api/service/platform-ai-config.js +0 -76
- package/dist/api/service/platform-ai-config.js.map +0 -1
- package/dist/document/DocumentParser.js.map +0 -1
- package/dist/document/JinaDocumentParser.js.map +0 -1
- package/static/app/assets/index-C1yksyT4.js +0 -171
- package/static/dashboard/assets/dashboard-BssaVKTn.css +0 -1
- package/static/dashboard/assets/dashboard-Ckuadl3C.js +0 -54
|
@@ -2,12 +2,89 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SolidRdfSparqlEngine = void 0;
|
|
4
4
|
const asynciterator_1 = require("asynciterator");
|
|
5
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
6
|
const rdf_data_factory_1 = require("rdf-data-factory");
|
|
6
7
|
const n3_1 = require("n3");
|
|
7
8
|
const RdfSparqlAdapter_1 = require("./RdfSparqlAdapter");
|
|
9
|
+
const RdfAccessScope_1 = require("./RdfAccessScope");
|
|
8
10
|
const rdfDataFactory = new rdf_data_factory_1.DataFactory();
|
|
11
|
+
const RDF_TYPE = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type';
|
|
12
|
+
const DCT_CREATED = 'http://purl.org/dc/terms/created';
|
|
13
|
+
const DCT_TITLE = 'http://purl.org/dc/terms/title';
|
|
14
|
+
const SIOC_HAS_CONTAINER = 'http://rdfs.org/sioc/ns#has_container';
|
|
15
|
+
const SIOC_HAS_MEMBER = 'http://rdfs.org/sioc/ns#has_member';
|
|
16
|
+
const SIOC_HAS_PARENT = 'http://rdfs.org/sioc/ns#has_parent';
|
|
17
|
+
const SIOC_THREAD = 'http://rdfs.org/sioc/ns#Thread';
|
|
18
|
+
const MEETING_MESSAGE = 'http://www.w3.org/ns/pim/meeting#Message';
|
|
19
|
+
const MEETING_LONG_CHAT = 'http://www.w3.org/ns/pim/meeting#LongChat';
|
|
20
|
+
const FOAF_AGENT = 'http://xmlns.com/foaf/0.1/Agent';
|
|
21
|
+
const VCARD_INDIVIDUAL = 'http://www.w3.org/2006/vcard/ns#Individual';
|
|
22
|
+
const SCHEMA_CREATIVE_WORK = 'http://schema.org/CreativeWork';
|
|
23
|
+
const SCHEMA_PROPERTY_VALUE = 'http://schema.org/PropertyValue';
|
|
24
|
+
const UDFS_TASK = 'https://undefineds.co/ns#Task';
|
|
25
|
+
const UDFS_RUN = 'https://undefineds.co/ns#Run';
|
|
26
|
+
const UDFS_RUN_STEP = 'https://undefineds.co/ns#RunStep';
|
|
27
|
+
const UDFS_SCHEDULE = 'https://undefineds.co/ns#Schedule';
|
|
28
|
+
const UDFS_SESSION = 'https://undefineds.co/ns#Session';
|
|
29
|
+
const UDFS_ISSUE = 'https://undefineds.co/ns#Issue';
|
|
30
|
+
const UDFS_LAST_MESSAGE = 'https://undefineds.co/ns#lastMessage';
|
|
31
|
+
const UDFS_STATUS = 'https://undefineds.co/ns#status';
|
|
32
|
+
const UDFS_MESSAGE_STATUS = 'https://undefineds.co/ns#messageStatus';
|
|
33
|
+
const UDFS_WORKSPACE = 'https://undefineds.co/ns#workspace';
|
|
34
|
+
const UDFS_RUN_RELATION = 'https://undefineds.co/ns#run';
|
|
35
|
+
const UDFS_TASK_RELATION = 'https://undefineds.co/ns#task';
|
|
36
|
+
const UDFS_IN_THREAD = 'https://undefineds.co/ns#inThread';
|
|
37
|
+
const UDFS_NEXT_RUN_AT = 'https://undefineds.co/ns#nextRunAt';
|
|
38
|
+
const UDFS_LEASE_OWNER = 'https://undefineds.co/ns#leaseOwner';
|
|
39
|
+
const UDFS_SESSION_STATUS = 'https://undefineds.co/ns#sessionStatus';
|
|
40
|
+
const UDFS_CONVERSATION = 'https://undefineds.co/ns#conversation';
|
|
41
|
+
const UDFS_TOKEN_USAGE = 'https://undefineds.co/ns#tokenUsage';
|
|
42
|
+
const UDFS_PRIORITY = 'https://undefineds.co/ns#priority';
|
|
43
|
+
const UDFS_SCORE = 'https://undefineds.co/ns#score';
|
|
44
|
+
const XPOD_AI_PROVIDER = 'https://vocab.xpod.dev/ai#Provider';
|
|
45
|
+
const XPOD_AI_MODEL = 'https://vocab.xpod.dev/ai#Model';
|
|
46
|
+
const XPOD_AI_IS_PROVIDED_BY = 'https://vocab.xpod.dev/ai#isProvidedBy';
|
|
47
|
+
const XPOD_CREDENTIAL = 'https://vocab.xpod.dev/credential#Credential';
|
|
48
|
+
const XPOD_CREDENTIAL_PROVIDER = 'https://vocab.xpod.dev/credential#provider';
|
|
49
|
+
const XPOD_CREDENTIAL_FAIL_COUNT = 'https://vocab.xpod.dev/credential#failCount';
|
|
50
|
+
const PRODUCT_VIEW_MATERIALIZED_VERSION = 'v1';
|
|
51
|
+
const SETTINGS_RESOURCE_TYPE_VIEWS = new Map([
|
|
52
|
+
[XPOD_AI_PROVIDER, 'ai-providers'],
|
|
53
|
+
[XPOD_AI_MODEL, 'ai-models'],
|
|
54
|
+
[XPOD_CREDENTIAL, 'credentials'],
|
|
55
|
+
]);
|
|
56
|
+
const PRODUCT_RESOURCE_TYPE_VIEWS = new Map([
|
|
57
|
+
[MEETING_LONG_CHAT, 'chats'],
|
|
58
|
+
[MEETING_MESSAGE, 'messages'],
|
|
59
|
+
[SIOC_THREAD, 'threads'],
|
|
60
|
+
[UDFS_TASK, 'tasks'],
|
|
61
|
+
[UDFS_RUN, 'runs'],
|
|
62
|
+
[UDFS_RUN_STEP, 'run-steps'],
|
|
63
|
+
[UDFS_SCHEDULE, 'schedules'],
|
|
64
|
+
[UDFS_SESSION, 'sessions'],
|
|
65
|
+
[UDFS_ISSUE, 'issues'],
|
|
66
|
+
[FOAF_AGENT, 'agents'],
|
|
67
|
+
[VCARD_INDIVIDUAL, 'contacts'],
|
|
68
|
+
[SCHEMA_CREATIVE_WORK, 'favorites'],
|
|
69
|
+
[SCHEMA_PROPERTY_VALUE, 'settings'],
|
|
70
|
+
]);
|
|
71
|
+
const PRODUCT_RELATION_PREDICATE_VIEWS = new Map([
|
|
72
|
+
[DCT_CREATED, 'created-timeline'],
|
|
73
|
+
[DCT_TITLE, 'title-hydration'],
|
|
74
|
+
[SIOC_HAS_PARENT, 'threads-by-chat'],
|
|
75
|
+
[UDFS_LAST_MESSAGE, 'chat-latest-message'],
|
|
76
|
+
[UDFS_STATUS, 'status-index'],
|
|
77
|
+
[UDFS_MESSAGE_STATUS, 'message-status-index'],
|
|
78
|
+
[UDFS_WORKSPACE, 'runs-by-workspace'],
|
|
79
|
+
[UDFS_RUN_RELATION, 'steps-by-run'],
|
|
80
|
+
[UDFS_TASK_RELATION, 'runs-by-task'],
|
|
81
|
+
[UDFS_IN_THREAD, 'runs-by-thread'],
|
|
82
|
+
[UDFS_NEXT_RUN_AT, 'schedules-by-due-time'],
|
|
83
|
+
[UDFS_LEASE_OWNER, 'runs-by-lease-owner'],
|
|
84
|
+
[UDFS_SESSION_STATUS, 'sessions-by-status'],
|
|
85
|
+
]);
|
|
9
86
|
class SolidRdfSparqlEngine {
|
|
10
|
-
constructor(rdfEngine, fallback, shadowStore, enablePrimary = true, onFallback) {
|
|
87
|
+
constructor(rdfEngine, fallback, shadowStore, enablePrimary = true, onFallback, autoMaterializeProductViews = true) {
|
|
11
88
|
this.adapter = new RdfSparqlAdapter_1.RdfSparqlAdapter();
|
|
12
89
|
this.operationCounts = new Map();
|
|
13
90
|
this.rdfEngine = rdfEngine;
|
|
@@ -15,19 +92,25 @@ class SolidRdfSparqlEngine {
|
|
|
15
92
|
this.shadowStore = shadowStore;
|
|
16
93
|
this.enablePrimary = enablePrimary;
|
|
17
94
|
this.onFallback = onFallback;
|
|
95
|
+
this.autoMaterializeProductViews = autoMaterializeProductViews;
|
|
18
96
|
}
|
|
19
|
-
async queryBindings(query, basePath) {
|
|
97
|
+
async queryBindings(query, basePath, accessScope) {
|
|
20
98
|
await this.ensureReady();
|
|
21
99
|
if (!this.enablePrimary) {
|
|
22
|
-
return this.fallbackWith('queryBindings', 'primary disabled', (fallback) => fallback.queryBindings(query, basePath));
|
|
100
|
+
return this.fallbackWith('queryBindings', 'primary disabled', (fallback) => fallback.queryBindings(query, basePath, accessScope), accessScope);
|
|
23
101
|
}
|
|
24
102
|
const start = Date.now();
|
|
25
103
|
try {
|
|
104
|
+
const native = await this.executeNativeSelectPrimary(query, basePath, 'queryBindings', start, accessScope);
|
|
105
|
+
if (native) {
|
|
106
|
+
return this.bindingsStream(native.result, native.variables);
|
|
107
|
+
}
|
|
26
108
|
const compiled = this.adapter.compile(query, basePath);
|
|
27
109
|
if (compiled.queryType !== 'SELECT') {
|
|
28
|
-
return this.fallbackWith('queryBindings', `compiled ${compiled.queryType} cannot produce bindings`, (fallback) => fallback.queryBindings(query, basePath));
|
|
110
|
+
return this.fallbackWith('queryBindings', `compiled ${compiled.queryType} cannot produce bindings`, (fallback) => fallback.queryBindings(query, basePath, accessScope), accessScope);
|
|
29
111
|
}
|
|
30
|
-
const
|
|
112
|
+
const selectedQuery = this.applyMaterializedQuerySelector('queryBindings', compiled.query);
|
|
113
|
+
const result = await this.rdfEngine.query((0, RdfAccessScope_1.applyRdfAccessScope)(selectedQuery, accessScope));
|
|
31
114
|
this.recordPrimary('queryBindings', start, result);
|
|
32
115
|
return this.bindingsStream(result, compiled.variables);
|
|
33
116
|
}
|
|
@@ -35,21 +118,26 @@ class SolidRdfSparqlEngine {
|
|
|
35
118
|
if (error instanceof RdfSparqlAdapter_1.DisabledSparqlFeatureError) {
|
|
36
119
|
throw error;
|
|
37
120
|
}
|
|
38
|
-
return this.fallbackWith('queryBindings', fallbackReason(error), (fallback) => fallback.queryBindings(query, basePath));
|
|
121
|
+
return this.fallbackWith('queryBindings', fallbackReason(error), (fallback) => fallback.queryBindings(query, basePath, accessScope), accessScope, error);
|
|
39
122
|
}
|
|
40
123
|
}
|
|
41
|
-
async queryBoolean(query, basePath) {
|
|
124
|
+
async queryBoolean(query, basePath, accessScope) {
|
|
42
125
|
await this.ensureReady();
|
|
43
126
|
if (!this.enablePrimary) {
|
|
44
|
-
return this.fallbackWith('queryBoolean', 'primary disabled', (fallback) => fallback.queryBoolean(query, basePath));
|
|
127
|
+
return this.fallbackWith('queryBoolean', 'primary disabled', (fallback) => fallback.queryBoolean(query, basePath, accessScope), accessScope);
|
|
45
128
|
}
|
|
46
129
|
const start = Date.now();
|
|
47
130
|
try {
|
|
131
|
+
const native = await this.executeNativeBooleanPrimary(query, basePath, 'queryBoolean', start, accessScope);
|
|
132
|
+
if (native !== undefined) {
|
|
133
|
+
return native;
|
|
134
|
+
}
|
|
48
135
|
const compiled = this.adapter.compile(query, basePath);
|
|
49
136
|
if (compiled.queryType !== 'ASK') {
|
|
50
|
-
return this.fallbackWith('queryBoolean', `compiled ${compiled.queryType} cannot produce boolean`, (fallback) => fallback.queryBoolean(query, basePath));
|
|
137
|
+
return this.fallbackWith('queryBoolean', `compiled ${compiled.queryType} cannot produce boolean`, (fallback) => fallback.queryBoolean(query, basePath, accessScope), accessScope);
|
|
51
138
|
}
|
|
52
|
-
const
|
|
139
|
+
const selectedQuery = this.applyMaterializedQuerySelector('queryBoolean', compiled.query);
|
|
140
|
+
const result = await this.rdfEngine.query((0, RdfAccessScope_1.applyRdfAccessScope)(selectedQuery, accessScope));
|
|
53
141
|
this.recordPrimary('queryBoolean', start, result);
|
|
54
142
|
return result.bindings.length > 0;
|
|
55
143
|
}
|
|
@@ -57,33 +145,37 @@ class SolidRdfSparqlEngine {
|
|
|
57
145
|
if (error instanceof RdfSparqlAdapter_1.DisabledSparqlFeatureError) {
|
|
58
146
|
throw error;
|
|
59
147
|
}
|
|
60
|
-
return this.fallbackWith('queryBoolean', fallbackReason(error), (fallback) => fallback.queryBoolean(query, basePath));
|
|
148
|
+
return this.fallbackWith('queryBoolean', fallbackReason(error), (fallback) => fallback.queryBoolean(query, basePath, accessScope), accessScope, error);
|
|
61
149
|
}
|
|
62
150
|
}
|
|
63
|
-
async queryQuads(query, basePath) {
|
|
151
|
+
async queryQuads(query, basePath, accessScope) {
|
|
64
152
|
await this.ensureReady();
|
|
65
153
|
if (!this.enablePrimary) {
|
|
66
|
-
return this.fallbackWith('queryQuads', 'primary disabled', (fallback) => fallback.queryQuads(query, basePath));
|
|
154
|
+
return this.fallbackWith('queryQuads', 'primary disabled', (fallback) => fallback.queryQuads(query, basePath, accessScope), accessScope);
|
|
67
155
|
}
|
|
68
156
|
const start = Date.now();
|
|
69
157
|
try {
|
|
70
|
-
const quads = await this.executeQuadsPrimary(query, basePath, 'queryQuads', start);
|
|
158
|
+
const quads = await this.executeQuadsPrimary(query, basePath, 'queryQuads', start, accessScope);
|
|
71
159
|
return new asynciterator_1.ArrayIterator(quads);
|
|
72
160
|
}
|
|
73
161
|
catch (error) {
|
|
74
162
|
if (error instanceof RdfSparqlAdapter_1.DisabledSparqlFeatureError) {
|
|
75
163
|
throw error;
|
|
76
164
|
}
|
|
77
|
-
return this.fallbackWith('queryQuads', fallbackReason(error), (fallback) => fallback.queryQuads(query, basePath));
|
|
165
|
+
return this.fallbackWith('queryQuads', fallbackReason(error), (fallback) => fallback.queryQuads(query, basePath, accessScope), accessScope, error);
|
|
78
166
|
}
|
|
79
167
|
}
|
|
80
|
-
async queryVoid(query, basePath) {
|
|
168
|
+
async queryVoid(query, basePath, accessScope, options) {
|
|
81
169
|
await this.ensureReady();
|
|
82
170
|
if (!this.enablePrimary) {
|
|
83
|
-
return this.fallbackWith('queryVoid', 'primary disabled', (fallback) => fallback.queryVoid(query, basePath));
|
|
171
|
+
return this.fallbackWith('queryVoid', 'primary disabled', (fallback) => fallback.queryVoid(query, basePath, accessScope, options), accessScope);
|
|
84
172
|
}
|
|
85
173
|
const start = Date.now();
|
|
86
174
|
try {
|
|
175
|
+
const native = await this.executeNativeVoidPrimary(query, basePath, 'queryVoid', start, accessScope, options);
|
|
176
|
+
if (native) {
|
|
177
|
+
return undefined;
|
|
178
|
+
}
|
|
87
179
|
const delta = this.adapter.compileUpdateDelta(query, basePath, {
|
|
88
180
|
defaultGraph: implicitUpdateDefaultGraph(basePath),
|
|
89
181
|
});
|
|
@@ -92,28 +184,33 @@ class SolidRdfSparqlEngine {
|
|
|
92
184
|
let computedInserts = 0;
|
|
93
185
|
for (const operation of delta.operations) {
|
|
94
186
|
if (operation.type === 'delete') {
|
|
187
|
+
this.assertUpdateQuadsAllowedByAccessScope(operation.quads, basePath, accessScope);
|
|
95
188
|
deletedRows += (await this.rdfEngine.applyDelta(operation.quads.map(quadToPattern), [])).deletedRows;
|
|
96
189
|
}
|
|
97
190
|
else if (operation.type === 'insert') {
|
|
191
|
+
this.assertUpdateQuadsAllowedByAccessScope(operation.quads, basePath, accessScope);
|
|
98
192
|
await this.rdfEngine.applyDelta([], operation.quads);
|
|
99
193
|
}
|
|
100
194
|
else if (operation.type === 'insertDeleteWhere') {
|
|
101
|
-
const result = await this.rdfEngine.query(operation.query);
|
|
195
|
+
const result = await this.rdfEngine.query((0, RdfAccessScope_1.applyRdfAccessScope)(operation.query, accessScope));
|
|
102
196
|
const deletes = this.adapter.materializeDeleteWhere(operation.deletes, result.bindings);
|
|
103
197
|
const inserts = this.adapter.materializeDeleteWhere(operation.inserts, result.bindings);
|
|
198
|
+
this.assertUpdateQuadsAllowedByAccessScope([...deletes, ...inserts], basePath, accessScope);
|
|
104
199
|
computedDeletes += deletes.length;
|
|
105
200
|
computedInserts += inserts.length;
|
|
106
201
|
deletedRows += (await this.rdfEngine.applyDelta(deletes.map(quadToPattern), inserts)).deletedRows;
|
|
107
202
|
}
|
|
108
203
|
else if (operation.type === 'insertWhere') {
|
|
109
|
-
const result = await this.rdfEngine.query(operation.query);
|
|
204
|
+
const result = await this.rdfEngine.query((0, RdfAccessScope_1.applyRdfAccessScope)(operation.query, accessScope));
|
|
110
205
|
const inserts = this.adapter.materializeDeleteWhere(operation.inserts, result.bindings);
|
|
206
|
+
this.assertUpdateQuadsAllowedByAccessScope(inserts, basePath, accessScope);
|
|
111
207
|
computedInserts += inserts.length;
|
|
112
208
|
await this.rdfEngine.applyDelta([], inserts);
|
|
113
209
|
}
|
|
114
210
|
else {
|
|
115
|
-
const result = await this.rdfEngine.query(operation.query);
|
|
211
|
+
const result = await this.rdfEngine.query((0, RdfAccessScope_1.applyRdfAccessScope)(operation.query, accessScope));
|
|
116
212
|
const quads = this.adapter.materializeDeleteWhere(operation.template, result.bindings);
|
|
213
|
+
this.assertUpdateQuadsAllowedByAccessScope(quads, basePath, accessScope);
|
|
117
214
|
computedDeletes += quads.length;
|
|
118
215
|
deletedRows += (await this.rdfEngine.applyDelta(quads.map(quadToPattern), [])).deletedRows;
|
|
119
216
|
}
|
|
@@ -138,15 +235,15 @@ class SolidRdfSparqlEngine {
|
|
|
138
235
|
if (error instanceof RdfSparqlAdapter_1.DisabledSparqlFeatureError) {
|
|
139
236
|
throw error;
|
|
140
237
|
}
|
|
141
|
-
return this.fallbackWith('queryVoid', fallbackReason(error), (fallback) => fallback.queryVoid(query, basePath));
|
|
238
|
+
return this.fallbackWith('queryVoid', fallbackReason(error), (fallback) => fallback.queryVoid(query, basePath, accessScope, options), accessScope, error);
|
|
142
239
|
}
|
|
143
240
|
}
|
|
144
|
-
async constructGraph(graph, basePath) {
|
|
241
|
+
async constructGraph(graph, basePath, accessScope) {
|
|
145
242
|
await this.ensureReady();
|
|
146
243
|
if (!this.enablePrimary) {
|
|
147
|
-
return this.fallbackWith('constructGraph', 'primary disabled', (fallback) => fallback.constructGraph(graph, basePath));
|
|
244
|
+
return this.fallbackWith('constructGraph', 'primary disabled', (fallback) => fallback.constructGraph(graph, basePath, accessScope), accessScope);
|
|
148
245
|
}
|
|
149
|
-
if (!graph.startsWith(basePath)) {
|
|
246
|
+
if (!graph.startsWith(basePath) || (accessScope && !(0, RdfAccessScope_1.rdfAccessGraphAllowed)(graph, accessScope))) {
|
|
150
247
|
return new asynciterator_1.ArrayIterator([]);
|
|
151
248
|
}
|
|
152
249
|
const start = Date.now();
|
|
@@ -154,26 +251,26 @@ class SolidRdfSparqlEngine {
|
|
|
154
251
|
const quads = await this.executeConstructPrimary(`
|
|
155
252
|
CONSTRUCT { ?s ?p ?o }
|
|
156
253
|
WHERE { GRAPH <${escapeIri(graph)}> { ?s ?p ?o } }
|
|
157
|
-
`, basePath, 'constructGraph', start);
|
|
254
|
+
`, basePath, 'constructGraph', start, accessScope);
|
|
158
255
|
return new asynciterator_1.ArrayIterator(quads);
|
|
159
256
|
}
|
|
160
257
|
catch (error) {
|
|
161
258
|
if (error instanceof RdfSparqlAdapter_1.DisabledSparqlFeatureError) {
|
|
162
259
|
throw error;
|
|
163
260
|
}
|
|
164
|
-
return this.fallbackWith('constructGraph', fallbackReason(error), (fallback) => fallback.constructGraph(graph, basePath));
|
|
261
|
+
return this.fallbackWith('constructGraph', fallbackReason(error), (fallback) => fallback.constructGraph(graph, basePath, accessScope), accessScope, error);
|
|
165
262
|
}
|
|
166
263
|
}
|
|
167
|
-
async listGraphs(basePath) {
|
|
264
|
+
async listGraphs(basePath, accessScope) {
|
|
168
265
|
await this.ensureReady();
|
|
169
266
|
if (!this.enablePrimary) {
|
|
170
|
-
return this.fallbackWith('listGraphs', 'primary disabled', (fallback) => fallback.listGraphs(basePath));
|
|
267
|
+
return this.fallbackWith('listGraphs', 'primary disabled', (fallback) => fallback.listGraphs(basePath, accessScope), accessScope);
|
|
171
268
|
}
|
|
172
269
|
const start = Date.now();
|
|
173
270
|
try {
|
|
174
271
|
const result = await this.executeSelectPrimary(`
|
|
175
272
|
SELECT DISTINCT ?g WHERE { GRAPH ?g { ?s ?p ?o } }
|
|
176
|
-
`, basePath, 'listGraphs', start);
|
|
273
|
+
`, basePath, 'listGraphs', start, accessScope);
|
|
177
274
|
const graphs = new Set();
|
|
178
275
|
for (const binding of result.bindings) {
|
|
179
276
|
const graph = binding.g;
|
|
@@ -181,13 +278,13 @@ class SolidRdfSparqlEngine {
|
|
|
181
278
|
graphs.add(graph.value);
|
|
182
279
|
}
|
|
183
280
|
}
|
|
184
|
-
return graphs;
|
|
281
|
+
return (0, RdfAccessScope_1.filterRdfAccessGraphs)(graphs, accessScope);
|
|
185
282
|
}
|
|
186
283
|
catch (error) {
|
|
187
284
|
if (error instanceof RdfSparqlAdapter_1.DisabledSparqlFeatureError) {
|
|
188
285
|
throw error;
|
|
189
286
|
}
|
|
190
|
-
return this.fallbackWith('listGraphs', fallbackReason(error), (fallback) => fallback.listGraphs(basePath));
|
|
287
|
+
return this.fallbackWith('listGraphs', fallbackReason(error), (fallback) => fallback.listGraphs(basePath, accessScope), accessScope, error);
|
|
191
288
|
}
|
|
192
289
|
}
|
|
193
290
|
async close() {
|
|
@@ -246,6 +343,22 @@ class SolidRdfSparqlEngine {
|
|
|
246
343
|
});
|
|
247
344
|
return iterator;
|
|
248
345
|
}
|
|
346
|
+
applyMaterializedQuerySelector(operation, query) {
|
|
347
|
+
if (query.cache?.materialized || !this.autoMaterializeProductViews) {
|
|
348
|
+
return query;
|
|
349
|
+
}
|
|
350
|
+
const materialized = defaultMaterializedQuerySelector(operation, query);
|
|
351
|
+
if (!materialized) {
|
|
352
|
+
return query;
|
|
353
|
+
}
|
|
354
|
+
return {
|
|
355
|
+
...query,
|
|
356
|
+
cache: {
|
|
357
|
+
...query.cache,
|
|
358
|
+
materialized,
|
|
359
|
+
},
|
|
360
|
+
};
|
|
361
|
+
}
|
|
249
362
|
bindings(binding, variables) {
|
|
250
363
|
const entries = variables
|
|
251
364
|
.map((variableName) => {
|
|
@@ -255,9 +368,24 @@ class SolidRdfSparqlEngine {
|
|
|
255
368
|
.filter((entry) => entry !== null);
|
|
256
369
|
return new RdfBindings(entries);
|
|
257
370
|
}
|
|
258
|
-
async fallbackWith(operation, reason, run) {
|
|
371
|
+
async fallbackWith(operation, reason, run, accessScope, cause) {
|
|
372
|
+
const embeddedReason = embeddedUnsupportedReason(reason);
|
|
373
|
+
if (cause instanceof RdfSparqlAdapter_1.NativeSparqlExecutionError) {
|
|
374
|
+
throw cause;
|
|
375
|
+
}
|
|
376
|
+
const inherited = cause instanceof RdfSparqlAdapter_1.UnsupportedSparqlQueryError
|
|
377
|
+
? {
|
|
378
|
+
code: cause.code,
|
|
379
|
+
capability: cause.capability,
|
|
380
|
+
hint: cause.hint,
|
|
381
|
+
correction: cause.correction,
|
|
382
|
+
}
|
|
383
|
+
: undefined;
|
|
384
|
+
if ((0, RdfAccessScope_1.isRestrictiveRdfAccessScope)(accessScope)) {
|
|
385
|
+
throw new RdfSparqlAdapter_1.UnsupportedSparqlQueryError(`Embedded SPARQL engine cannot execute ${operation} inside ACL/ACR-restricted scope: ${embeddedReason}`, inherited);
|
|
386
|
+
}
|
|
259
387
|
if (!this.fallback) {
|
|
260
|
-
throw new RdfSparqlAdapter_1.UnsupportedSparqlQueryError(`
|
|
388
|
+
throw new RdfSparqlAdapter_1.UnsupportedSparqlQueryError(`Embedded SPARQL engine cannot execute ${operation}: ${embeddedReason}`, inherited);
|
|
261
389
|
}
|
|
262
390
|
this.onFallback?.({ operation, reason });
|
|
263
391
|
const start = Date.now();
|
|
@@ -273,21 +401,43 @@ class SolidRdfSparqlEngine {
|
|
|
273
401
|
await this.shadowStore.open();
|
|
274
402
|
}
|
|
275
403
|
}
|
|
276
|
-
async executeSelectPrimary(query, basePath, operation, start) {
|
|
404
|
+
async executeSelectPrimary(query, basePath, operation, start, accessScope) {
|
|
405
|
+
const native = await this.executeNativeSelectPrimary(query, basePath, operation, start, accessScope);
|
|
406
|
+
if (native) {
|
|
407
|
+
return native.result;
|
|
408
|
+
}
|
|
277
409
|
const compiled = this.adapter.compile(query, basePath);
|
|
278
410
|
if (compiled.queryType !== 'SELECT') {
|
|
279
411
|
throw new RdfSparqlAdapter_1.UnsupportedSparqlQueryError(`compiled ${compiled.queryType} cannot produce bindings`);
|
|
280
412
|
}
|
|
281
|
-
const result = await this.rdfEngine.query(compiled.query);
|
|
413
|
+
const result = await this.rdfEngine.query((0, RdfAccessScope_1.applyRdfAccessScope)(compiled.query, accessScope));
|
|
282
414
|
this.recordPrimary(operation, start, result);
|
|
283
415
|
return result;
|
|
284
416
|
}
|
|
285
|
-
|
|
417
|
+
assertUpdateQuadsAllowedByAccessScope(quads, basePath, accessScope) {
|
|
418
|
+
if (!isWriteAccessScope(accessScope) || !(0, RdfAccessScope_1.isRestrictiveRdfAccessScope)(accessScope)) {
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
for (const quad of quads) {
|
|
422
|
+
const graph = quad.graph.termType === 'DefaultGraph' ? basePath : quad.graph.value;
|
|
423
|
+
if (!(0, RdfAccessScope_1.rdfAccessGraphAllowed)(graph, accessScope)) {
|
|
424
|
+
throw new RdfSparqlAdapter_1.UnsupportedSparqlQueryError(`Embedded SPARQL engine cannot execute queryVoid: update target graph is outside the authorized RDF access scope: ${graph}`, {
|
|
425
|
+
capability: 'sparql.update.access_scope',
|
|
426
|
+
hint: 'Authorize the target graph for this write, or split the update so each write target is inside the granted graph scope.',
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
async executeConstructPrimary(query, basePath, operation, start, accessScope) {
|
|
432
|
+
const native = await this.executeNativeGraphPrimary(query, basePath, operation, start, accessScope);
|
|
433
|
+
if (native) {
|
|
434
|
+
return native;
|
|
435
|
+
}
|
|
286
436
|
const compiled = this.adapter.compile(query, basePath);
|
|
287
437
|
if (compiled.queryType !== 'CONSTRUCT' || !compiled.constructTemplate) {
|
|
288
438
|
throw new RdfSparqlAdapter_1.UnsupportedSparqlQueryError(`compiled ${compiled.queryType} cannot produce quads`);
|
|
289
439
|
}
|
|
290
|
-
const result = await this.rdfEngine.query(compiled.query);
|
|
440
|
+
const result = await this.rdfEngine.query((0, RdfAccessScope_1.applyRdfAccessScope)(compiled.query, accessScope));
|
|
291
441
|
const quads = this.adapter.materializeConstruct(compiled.constructTemplate, result.bindings, rdfDataFactory.defaultGraph());
|
|
292
442
|
this.recordPrimary(operation, start, {
|
|
293
443
|
...result,
|
|
@@ -300,10 +450,14 @@ class SolidRdfSparqlEngine {
|
|
|
300
450
|
});
|
|
301
451
|
return quads;
|
|
302
452
|
}
|
|
303
|
-
async executeQuadsPrimary(query, basePath, operation, start) {
|
|
453
|
+
async executeQuadsPrimary(query, basePath, operation, start, accessScope) {
|
|
454
|
+
const native = await this.executeNativeGraphPrimary(query, basePath, operation, start, accessScope);
|
|
455
|
+
if (native) {
|
|
456
|
+
return native;
|
|
457
|
+
}
|
|
304
458
|
const compiled = this.adapter.compile(query, basePath);
|
|
305
459
|
if (compiled.queryType === 'CONSTRUCT' && compiled.constructTemplate) {
|
|
306
|
-
const result = await this.rdfEngine.query(compiled.query);
|
|
460
|
+
const result = await this.rdfEngine.query((0, RdfAccessScope_1.applyRdfAccessScope)(compiled.query, accessScope));
|
|
307
461
|
const quads = this.adapter.materializeConstruct(compiled.constructTemplate, result.bindings, rdfDataFactory.defaultGraph());
|
|
308
462
|
this.recordPrimary(operation, start, {
|
|
309
463
|
...result,
|
|
@@ -317,12 +471,12 @@ class SolidRdfSparqlEngine {
|
|
|
317
471
|
return quads;
|
|
318
472
|
}
|
|
319
473
|
if (compiled.queryType === 'DESCRIBE' && compiled.describeTargets) {
|
|
320
|
-
return this.executeDescribePrimary(compiled.query, compiled.describeTargets, basePath, operation, start);
|
|
474
|
+
return this.executeDescribePrimary(compiled.query, compiled.describeTargets, basePath, operation, start, accessScope);
|
|
321
475
|
}
|
|
322
476
|
throw new RdfSparqlAdapter_1.UnsupportedSparqlQueryError(`compiled ${compiled.queryType} cannot produce quads`);
|
|
323
477
|
}
|
|
324
|
-
async executeDescribePrimary(query, targets, basePath, operation, start) {
|
|
325
|
-
const seed = await this.rdfEngine.query(query);
|
|
478
|
+
async executeDescribePrimary(query, targets, basePath, operation, start, accessScope) {
|
|
479
|
+
const seed = await this.rdfEngine.query((0, RdfAccessScope_1.applyRdfAccessScope)(query, accessScope));
|
|
326
480
|
const quads = [];
|
|
327
481
|
const seen = new Set();
|
|
328
482
|
for (const target of targets) {
|
|
@@ -331,7 +485,7 @@ class SolidRdfSparqlEngine {
|
|
|
331
485
|
if (!subject || subject.termType !== 'NamedNode') {
|
|
332
486
|
continue;
|
|
333
487
|
}
|
|
334
|
-
const describe = await this.rdfEngine.query({
|
|
488
|
+
const describe = await this.rdfEngine.query((0, RdfAccessScope_1.applyRdfAccessScope)({
|
|
335
489
|
patterns: [
|
|
336
490
|
{
|
|
337
491
|
subject,
|
|
@@ -341,7 +495,7 @@ class SolidRdfSparqlEngine {
|
|
|
341
495
|
},
|
|
342
496
|
],
|
|
343
497
|
select: ['p', 'o'],
|
|
344
|
-
});
|
|
498
|
+
}, accessScope));
|
|
345
499
|
for (const row of describe.bindings) {
|
|
346
500
|
const predicate = row.p;
|
|
347
501
|
const object = row.o;
|
|
@@ -367,6 +521,83 @@ class SolidRdfSparqlEngine {
|
|
|
367
521
|
});
|
|
368
522
|
return quads;
|
|
369
523
|
}
|
|
524
|
+
async executeNativeVoidPrimary(query, basePath, operation, start, accessScope, options) {
|
|
525
|
+
const envelope = await this.runNativeSparql(query, basePath, operation, 'application/sparql-results+json', accessScope, options);
|
|
526
|
+
if (!envelope) {
|
|
527
|
+
return false;
|
|
528
|
+
}
|
|
529
|
+
this.recordPrimary(operation, start, {
|
|
530
|
+
bindings: [],
|
|
531
|
+
metrics: nativeSparqlMetrics(envelope, 0, Date.now() - start),
|
|
532
|
+
});
|
|
533
|
+
return true;
|
|
534
|
+
}
|
|
535
|
+
async executeNativeSelectPrimary(query, basePath, operation, start, accessScope) {
|
|
536
|
+
const envelope = await this.runNativeSparql(query, basePath, operation, 'application/sparql-results+json', accessScope);
|
|
537
|
+
if (!envelope) {
|
|
538
|
+
return undefined;
|
|
539
|
+
}
|
|
540
|
+
const parsed = parseNativeSparqlJsonResult(envelope, Date.now() - start);
|
|
541
|
+
if (!parsed.result) {
|
|
542
|
+
throw new RdfSparqlAdapter_1.UnsupportedSparqlQueryError('native SPARQL result did not contain SELECT bindings');
|
|
543
|
+
}
|
|
544
|
+
this.recordPrimary(operation, start, parsed.result);
|
|
545
|
+
return {
|
|
546
|
+
result: parsed.result,
|
|
547
|
+
variables: parsed.variables,
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
async executeNativeBooleanPrimary(query, basePath, operation, start, accessScope) {
|
|
551
|
+
const envelope = await this.runNativeSparql(query, basePath, operation, 'application/sparql-results+json', accessScope);
|
|
552
|
+
if (!envelope) {
|
|
553
|
+
return undefined;
|
|
554
|
+
}
|
|
555
|
+
const parsed = parseNativeSparqlJsonResult(envelope, Date.now() - start);
|
|
556
|
+
if (parsed.boolean === undefined) {
|
|
557
|
+
throw new RdfSparqlAdapter_1.UnsupportedSparqlQueryError('native SPARQL result did not contain ASK boolean');
|
|
558
|
+
}
|
|
559
|
+
const result = {
|
|
560
|
+
bindings: parsed.boolean ? [{}] : [],
|
|
561
|
+
metrics: nativeSparqlMetrics(envelope, parsed.boolean ? 1 : 0, Date.now() - start),
|
|
562
|
+
};
|
|
563
|
+
this.recordPrimary(operation, start, result);
|
|
564
|
+
return parsed.boolean;
|
|
565
|
+
}
|
|
566
|
+
async executeNativeGraphPrimary(query, basePath, operation, start, accessScope) {
|
|
567
|
+
const envelope = await this.runNativeSparql(query, basePath, operation, 'application/n-triples', accessScope);
|
|
568
|
+
if (!envelope) {
|
|
569
|
+
return undefined;
|
|
570
|
+
}
|
|
571
|
+
const quads = parseNativeGraphResult(envelope);
|
|
572
|
+
this.recordPrimary(operation, start, {
|
|
573
|
+
bindings: [],
|
|
574
|
+
metrics: nativeSparqlMetrics(envelope, quads.length, Date.now() - start),
|
|
575
|
+
});
|
|
576
|
+
return quads;
|
|
577
|
+
}
|
|
578
|
+
async runNativeSparql(query, basePath, operation, acceptMediaType, accessScope, options) {
|
|
579
|
+
if (typeof this.rdfEngine.sparqlQuery !== 'function') {
|
|
580
|
+
return undefined;
|
|
581
|
+
}
|
|
582
|
+
this.adapter.assertServerOwnedNativeQuery(query, basePath);
|
|
583
|
+
const result = await this.rdfEngine.sparqlQuery(query, {
|
|
584
|
+
basePath,
|
|
585
|
+
operation,
|
|
586
|
+
acceptMediaType,
|
|
587
|
+
accessScope,
|
|
588
|
+
...(options?.loadDocument ? { loadDocument: options.loadDocument } : {}),
|
|
589
|
+
});
|
|
590
|
+
if (result.status === 'ok') {
|
|
591
|
+
return result;
|
|
592
|
+
}
|
|
593
|
+
if (result.status === 'error') {
|
|
594
|
+
throw new RdfSparqlAdapter_1.NativeSparqlExecutionError(result.error || 'native SPARQL engine returned error status');
|
|
595
|
+
}
|
|
596
|
+
throw new RdfSparqlAdapter_1.UnsupportedSparqlQueryError(`native SPARQL engine returned ${result.status}${result.error ? `: ${result.error}` : ''}`, {
|
|
597
|
+
capability: 'sparql.native',
|
|
598
|
+
hint: 'Run the query through a native SPARQL engine that can access the current Pod scope, or disable the native SPARQL path for this engine.',
|
|
599
|
+
});
|
|
600
|
+
}
|
|
370
601
|
recordPrimary(operation, start, result) {
|
|
371
602
|
const durationMs = Date.now() - start;
|
|
372
603
|
const counts = this.countsFor(operation);
|
|
@@ -379,6 +610,7 @@ class SolidRdfSparqlEngine {
|
|
|
379
610
|
returnedRows: result.metrics.returnedRows,
|
|
380
611
|
plan: result.metrics.plan,
|
|
381
612
|
indexChoices: result.metrics.indexChoices,
|
|
613
|
+
nativeProfile: result.metrics.nativeProfile,
|
|
382
614
|
};
|
|
383
615
|
}
|
|
384
616
|
recordFallback(operation, reason, durationMs) {
|
|
@@ -407,6 +639,92 @@ class SolidRdfSparqlEngine {
|
|
|
407
639
|
}
|
|
408
640
|
}
|
|
409
641
|
exports.SolidRdfSparqlEngine = SolidRdfSparqlEngine;
|
|
642
|
+
function parseNativeSparqlJsonResult(envelope, durationMs) {
|
|
643
|
+
const payload = JSON.parse(envelope.body);
|
|
644
|
+
const variables = payload.head?.vars ?? [];
|
|
645
|
+
if (typeof payload.boolean === 'boolean') {
|
|
646
|
+
return { variables, boolean: payload.boolean };
|
|
647
|
+
}
|
|
648
|
+
const bindings = (payload.results?.bindings ?? []).map((row) => nativeSparqlBindingRow(row));
|
|
649
|
+
return {
|
|
650
|
+
variables,
|
|
651
|
+
result: {
|
|
652
|
+
bindings,
|
|
653
|
+
metrics: nativeSparqlMetrics(envelope, bindings.length, durationMs),
|
|
654
|
+
},
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
function nativeSparqlBindingRow(row) {
|
|
658
|
+
const binding = {};
|
|
659
|
+
for (const [variable, value] of Object.entries(row)) {
|
|
660
|
+
const term = nativeSparqlJsonTerm(value);
|
|
661
|
+
if (term) {
|
|
662
|
+
binding[variable] = term;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
return binding;
|
|
666
|
+
}
|
|
667
|
+
function nativeSparqlJsonTerm(value) {
|
|
668
|
+
if (!value || typeof value !== 'object') {
|
|
669
|
+
return undefined;
|
|
670
|
+
}
|
|
671
|
+
const term = value;
|
|
672
|
+
if (typeof term.value !== 'string') {
|
|
673
|
+
return undefined;
|
|
674
|
+
}
|
|
675
|
+
if (term.type === 'uri') {
|
|
676
|
+
return rdfDataFactory.namedNode(term.value);
|
|
677
|
+
}
|
|
678
|
+
if (term.type === 'bnode') {
|
|
679
|
+
return rdfDataFactory.blankNode(term.value);
|
|
680
|
+
}
|
|
681
|
+
if (term.type === 'literal' || term.type === 'typed-literal') {
|
|
682
|
+
if (term['xml:lang']) {
|
|
683
|
+
return rdfDataFactory.literal(term.value, term['xml:lang']);
|
|
684
|
+
}
|
|
685
|
+
if (term.datatype) {
|
|
686
|
+
return rdfDataFactory.literal(term.value, rdfDataFactory.namedNode(term.datatype));
|
|
687
|
+
}
|
|
688
|
+
return rdfDataFactory.literal(term.value);
|
|
689
|
+
}
|
|
690
|
+
return undefined;
|
|
691
|
+
}
|
|
692
|
+
function parseNativeGraphResult(envelope) {
|
|
693
|
+
const mediaType = envelope.mediaType.toLowerCase();
|
|
694
|
+
const parser = new n3_1.Parser({
|
|
695
|
+
format: mediaType.includes('n-quads')
|
|
696
|
+
? 'N-Quads'
|
|
697
|
+
: mediaType.includes('turtle')
|
|
698
|
+
? 'Turtle'
|
|
699
|
+
: 'N-Triples',
|
|
700
|
+
});
|
|
701
|
+
return parser.parse(envelope.body);
|
|
702
|
+
}
|
|
703
|
+
function nativeSparqlMetrics(envelope, returnedRows, durationMs) {
|
|
704
|
+
const profile = envelope.profile && typeof envelope.profile === 'object'
|
|
705
|
+
? envelope.profile
|
|
706
|
+
: undefined;
|
|
707
|
+
const root = profile?.root && typeof profile.root === 'object'
|
|
708
|
+
? profile.root
|
|
709
|
+
: undefined;
|
|
710
|
+
const rootKind = typeof root?.kind === 'string' ? root.kind : undefined;
|
|
711
|
+
const descriptor = typeof root?.descriptor === 'string' ? root.descriptor : undefined;
|
|
712
|
+
const profiledRows = typeof root?.outputRows === 'number' && Number.isFinite(root.outputRows)
|
|
713
|
+
? root.outputRows
|
|
714
|
+
: returnedRows;
|
|
715
|
+
return {
|
|
716
|
+
engine: 'solid-rdf',
|
|
717
|
+
plan: ['NativeSparql', envelope.mediaType, ...(rootKind ? [`Native:${rootKind}`] : [])],
|
|
718
|
+
nativeProfile: envelope.profile,
|
|
719
|
+
scannedRows: profiledRows,
|
|
720
|
+
joinedRows: returnedRows,
|
|
721
|
+
returnedRows,
|
|
722
|
+
durationMs,
|
|
723
|
+
indexChoices: ['native-sparql', ...(descriptor ? [descriptor] : [])],
|
|
724
|
+
filtersApplied: 0,
|
|
725
|
+
filtersPushedDown: 0,
|
|
726
|
+
};
|
|
727
|
+
}
|
|
410
728
|
class RdfBindings extends Map {
|
|
411
729
|
constructor(entries) {
|
|
412
730
|
super(entries);
|
|
@@ -449,6 +767,12 @@ function isQuadObjectTerm(term) {
|
|
|
449
767
|
&& term.termType !== 'DefaultGraph'
|
|
450
768
|
&& term.termType !== 'Quad');
|
|
451
769
|
}
|
|
770
|
+
function isWriteAccessScope(scope) {
|
|
771
|
+
return Boolean(scope
|
|
772
|
+
&& (scope.mode === RdfAccessScope_1.RdfAccessMode.APPEND
|
|
773
|
+
|| scope.mode === RdfAccessScope_1.RdfAccessMode.DELETE
|
|
774
|
+
|| scope.mode === RdfAccessScope_1.RdfAccessMode.WRITE));
|
|
775
|
+
}
|
|
452
776
|
function fallbackReason(error) {
|
|
453
777
|
if (error instanceof RdfSparqlAdapter_1.UnsupportedSparqlQueryError) {
|
|
454
778
|
return error.message;
|
|
@@ -458,6 +782,11 @@ function fallbackReason(error) {
|
|
|
458
782
|
}
|
|
459
783
|
return String(error);
|
|
460
784
|
}
|
|
785
|
+
function embeddedUnsupportedReason(reason) {
|
|
786
|
+
return reason
|
|
787
|
+
.replace(/\s+fallback to compatibility engine\b/gi, ' is not supported by the embedded RDF engine')
|
|
788
|
+
.replace(/\bis handled by the compatibility engine\b/gi, 'is not supported by the embedded RDF engine');
|
|
789
|
+
}
|
|
461
790
|
function operationCountSnapshot(operation, counts) {
|
|
462
791
|
const totalCount = counts.primaryCount + counts.fallbackCount;
|
|
463
792
|
return {
|
|
@@ -473,6 +802,307 @@ function operationCountSnapshot(operation, counts) {
|
|
|
473
802
|
function ratio(numerator, denominator) {
|
|
474
803
|
return denominator === 0 ? 0 : numerator / denominator;
|
|
475
804
|
}
|
|
805
|
+
function defaultMaterializedQuerySelector(operation, query) {
|
|
806
|
+
if (operation !== 'queryBindings') {
|
|
807
|
+
return undefined;
|
|
808
|
+
}
|
|
809
|
+
if (hasSearchSources(query)) {
|
|
810
|
+
return undefined;
|
|
811
|
+
}
|
|
812
|
+
return statsProductViewMaterializedResult(query)
|
|
813
|
+
?? threadHistoryMaterializedResult(query)
|
|
814
|
+
?? settingsProductViewMaterializedResult(query)
|
|
815
|
+
?? agentContextMaterializedResult(query)
|
|
816
|
+
?? stableProductViewMaterializedResult(query);
|
|
817
|
+
}
|
|
818
|
+
function statsProductViewMaterializedResult(query) {
|
|
819
|
+
const view = statsProductView(query);
|
|
820
|
+
if (!view) {
|
|
821
|
+
return undefined;
|
|
822
|
+
}
|
|
823
|
+
return {
|
|
824
|
+
key: `models/stats/${view}/${shortHash(stableQueryFingerprint(query))}`,
|
|
825
|
+
version: PRODUCT_VIEW_MATERIALIZED_VERSION,
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
function statsProductView(query) {
|
|
829
|
+
if (!hasStatsShape(query) || !hasProductGraphScope(query)) {
|
|
830
|
+
return undefined;
|
|
831
|
+
}
|
|
832
|
+
const predicates = new Set();
|
|
833
|
+
const hasType = new Set();
|
|
834
|
+
for (const pattern of query.patterns) {
|
|
835
|
+
const predicate = namedNodeValue(pattern.predicate);
|
|
836
|
+
if (!predicate) {
|
|
837
|
+
continue;
|
|
838
|
+
}
|
|
839
|
+
predicates.add(predicate);
|
|
840
|
+
if (predicate === RDF_TYPE) {
|
|
841
|
+
const type = namedNodeValue(pattern.object);
|
|
842
|
+
if (type) {
|
|
843
|
+
hasType.add(type);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
if (predicates.has(XPOD_AI_IS_PROVIDED_BY) && predicates.has(XPOD_CREDENTIAL_PROVIDER)) {
|
|
848
|
+
return predicates.has(XPOD_CREDENTIAL_FAIL_COUNT)
|
|
849
|
+
? 'provider-credential-failures'
|
|
850
|
+
: 'provider-credential-counts';
|
|
851
|
+
}
|
|
852
|
+
if (predicates.has(SIOC_HAS_CONTAINER) || predicates.has(SIOC_HAS_MEMBER)) {
|
|
853
|
+
return predicates.has(UDFS_SCORE)
|
|
854
|
+
? 'message-score-by-thread'
|
|
855
|
+
: 'message-count-by-thread';
|
|
856
|
+
}
|
|
857
|
+
if (predicates.has(UDFS_STATUS) && predicates.has(UDFS_PRIORITY)) {
|
|
858
|
+
return 'run-priority-summary';
|
|
859
|
+
}
|
|
860
|
+
const views = new Set();
|
|
861
|
+
for (const type of hasType) {
|
|
862
|
+
const view = SETTINGS_RESOURCE_TYPE_VIEWS.get(type) ?? PRODUCT_RESOURCE_TYPE_VIEWS.get(type);
|
|
863
|
+
if (view) {
|
|
864
|
+
views.add(view);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
for (const predicate of predicates) {
|
|
868
|
+
const view = PRODUCT_RELATION_PREDICATE_VIEWS.get(predicate);
|
|
869
|
+
if (view) {
|
|
870
|
+
views.add(view);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
if (views.size === 0) {
|
|
874
|
+
return undefined;
|
|
875
|
+
}
|
|
876
|
+
return `${[...views].sort().join('+')}-${statsAggregateKind(query)}`;
|
|
877
|
+
}
|
|
878
|
+
function hasStatsShape(query) {
|
|
879
|
+
return queryAggregates(query).length > 0
|
|
880
|
+
|| (query.groupBy?.length ?? 0) > 0
|
|
881
|
+
|| (query.having?.length ?? 0) > 0;
|
|
882
|
+
}
|
|
883
|
+
function statsAggregateKind(query) {
|
|
884
|
+
const aggregates = queryAggregates(query);
|
|
885
|
+
const aggregateKind = aggregates.every((aggregate) => aggregate.type === 'count')
|
|
886
|
+
? 'counts'
|
|
887
|
+
: 'numeric-summary';
|
|
888
|
+
return (query.groupBy?.length ?? 0) > 0 ? `grouped-${aggregateKind}` : aggregateKind;
|
|
889
|
+
}
|
|
890
|
+
function queryAggregates(query) {
|
|
891
|
+
return query.aggregates && query.aggregates.length > 0
|
|
892
|
+
? query.aggregates
|
|
893
|
+
: query.aggregate
|
|
894
|
+
? [query.aggregate]
|
|
895
|
+
: [];
|
|
896
|
+
}
|
|
897
|
+
function threadHistoryMaterializedResult(query) {
|
|
898
|
+
const threadIri = threadHistoryQueryThreadIri(query);
|
|
899
|
+
if (!threadIri) {
|
|
900
|
+
return undefined;
|
|
901
|
+
}
|
|
902
|
+
return {
|
|
903
|
+
key: `chatkit/thread-history/${shortHash(threadIri)}/${shortHash(stableQueryFingerprint(query))}`,
|
|
904
|
+
version: PRODUCT_VIEW_MATERIALIZED_VERSION,
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
function threadHistoryQueryThreadIri(query) {
|
|
908
|
+
for (const pattern of query.patterns) {
|
|
909
|
+
const predicate = namedNodeValue(pattern.predicate);
|
|
910
|
+
if (predicate !== SIOC_HAS_CONTAINER && predicate !== SIOC_HAS_MEMBER) {
|
|
911
|
+
continue;
|
|
912
|
+
}
|
|
913
|
+
const object = namedNodeValue(pattern.object);
|
|
914
|
+
if (object) {
|
|
915
|
+
return object;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
return undefined;
|
|
919
|
+
}
|
|
920
|
+
function settingsProductViewMaterializedResult(query) {
|
|
921
|
+
const view = settingsProductView(query);
|
|
922
|
+
if (!view) {
|
|
923
|
+
return undefined;
|
|
924
|
+
}
|
|
925
|
+
return {
|
|
926
|
+
key: `models/settings/${view}/${shortHash(stableQueryFingerprint(query))}`,
|
|
927
|
+
version: PRODUCT_VIEW_MATERIALIZED_VERSION,
|
|
928
|
+
};
|
|
929
|
+
}
|
|
930
|
+
function settingsProductView(query) {
|
|
931
|
+
const typeViews = new Set();
|
|
932
|
+
let hasModelProviderLink = false;
|
|
933
|
+
let hasCredentialProviderLink = false;
|
|
934
|
+
for (const pattern of query.patterns) {
|
|
935
|
+
const predicate = namedNodeValue(pattern.predicate);
|
|
936
|
+
if (predicate === RDF_TYPE) {
|
|
937
|
+
const typeView = SETTINGS_RESOURCE_TYPE_VIEWS.get(namedNodeValue(pattern.object) ?? '');
|
|
938
|
+
if (typeView) {
|
|
939
|
+
typeViews.add(typeView);
|
|
940
|
+
}
|
|
941
|
+
continue;
|
|
942
|
+
}
|
|
943
|
+
if (predicate === XPOD_AI_IS_PROVIDED_BY) {
|
|
944
|
+
hasModelProviderLink = true;
|
|
945
|
+
continue;
|
|
946
|
+
}
|
|
947
|
+
if (predicate === XPOD_CREDENTIAL_PROVIDER) {
|
|
948
|
+
hasCredentialProviderLink = true;
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
if (hasModelProviderLink && hasCredentialProviderLink) {
|
|
952
|
+
return 'provider-model-credentials';
|
|
953
|
+
}
|
|
954
|
+
if (typeViews.size === 0) {
|
|
955
|
+
return undefined;
|
|
956
|
+
}
|
|
957
|
+
return [...typeViews].sort().join('+');
|
|
958
|
+
}
|
|
959
|
+
function agentContextMaterializedResult(query) {
|
|
960
|
+
const view = agentContextProductView(query);
|
|
961
|
+
if (!view) {
|
|
962
|
+
return undefined;
|
|
963
|
+
}
|
|
964
|
+
return {
|
|
965
|
+
key: `models/agent-context/${view}/${shortHash(stableQueryFingerprint(query))}`,
|
|
966
|
+
version: PRODUCT_VIEW_MATERIALIZED_VERSION,
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
function agentContextProductView(query) {
|
|
970
|
+
if (!query.patterns.some(isProductGraphScoped)) {
|
|
971
|
+
return undefined;
|
|
972
|
+
}
|
|
973
|
+
const types = new Set();
|
|
974
|
+
const predicates = new Set();
|
|
975
|
+
for (const pattern of query.patterns) {
|
|
976
|
+
const predicate = namedNodeValue(pattern.predicate);
|
|
977
|
+
if (!predicate) {
|
|
978
|
+
continue;
|
|
979
|
+
}
|
|
980
|
+
predicates.add(predicate);
|
|
981
|
+
if (predicate === RDF_TYPE) {
|
|
982
|
+
const type = namedNodeValue(pattern.object);
|
|
983
|
+
if (type) {
|
|
984
|
+
types.add(type);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
if (types.has(UDFS_SESSION)
|
|
989
|
+
&& types.has(MEETING_LONG_CHAT)
|
|
990
|
+
&& types.has(SIOC_THREAD)
|
|
991
|
+
&& predicates.has(UDFS_SESSION_STATUS)
|
|
992
|
+
&& predicates.has(UDFS_CONVERSATION)
|
|
993
|
+
&& predicates.has(UDFS_IN_THREAD)) {
|
|
994
|
+
return predicates.has(UDFS_TOKEN_USAGE)
|
|
995
|
+
? 'active-session-thread-usage'
|
|
996
|
+
: 'active-session-thread-hydration';
|
|
997
|
+
}
|
|
998
|
+
return undefined;
|
|
999
|
+
}
|
|
1000
|
+
function stableProductViewMaterializedResult(query) {
|
|
1001
|
+
const view = stableProductView(query);
|
|
1002
|
+
if (!view) {
|
|
1003
|
+
return undefined;
|
|
1004
|
+
}
|
|
1005
|
+
return {
|
|
1006
|
+
key: `models/product-views/${view}/${shortHash(stableQueryFingerprint(query))}`,
|
|
1007
|
+
version: PRODUCT_VIEW_MATERIALIZED_VERSION,
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
function stableProductView(query) {
|
|
1011
|
+
const views = new Set();
|
|
1012
|
+
for (const pattern of query.patterns) {
|
|
1013
|
+
const predicate = namedNodeValue(pattern.predicate);
|
|
1014
|
+
if (predicate === RDF_TYPE) {
|
|
1015
|
+
const typeView = PRODUCT_RESOURCE_TYPE_VIEWS.get(namedNodeValue(pattern.object) ?? '');
|
|
1016
|
+
if (typeView) {
|
|
1017
|
+
views.add(typeView);
|
|
1018
|
+
}
|
|
1019
|
+
continue;
|
|
1020
|
+
}
|
|
1021
|
+
const predicateView = isProductGraphScoped(pattern)
|
|
1022
|
+
? PRODUCT_RELATION_PREDICATE_VIEWS.get(predicate ?? '')
|
|
1023
|
+
: undefined;
|
|
1024
|
+
if (predicateView) {
|
|
1025
|
+
views.add(predicateView);
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
if (views.size === 0) {
|
|
1029
|
+
return undefined;
|
|
1030
|
+
}
|
|
1031
|
+
return [...views].sort().join('+');
|
|
1032
|
+
}
|
|
1033
|
+
function hasSearchSources(query) {
|
|
1034
|
+
return (query.textSearch?.length ?? 0) > 0
|
|
1035
|
+
|| (query.vectorSearch?.length ?? 0) > 0;
|
|
1036
|
+
}
|
|
1037
|
+
function isProductGraphScoped(pattern) {
|
|
1038
|
+
const graph = namedNodeValue(pattern.graph) ?? graphPrefixValue(pattern.graph);
|
|
1039
|
+
return Boolean(graph && isProductGraphPath(graph));
|
|
1040
|
+
}
|
|
1041
|
+
function hasProductGraphScope(query) {
|
|
1042
|
+
if (query.patterns.some(isProductGraphScoped)) {
|
|
1043
|
+
return true;
|
|
1044
|
+
}
|
|
1045
|
+
const graphVariables = new Set(query.patterns
|
|
1046
|
+
.map((pattern) => variableValue(pattern.graph))
|
|
1047
|
+
.filter((variable) => Boolean(variable)));
|
|
1048
|
+
if (graphVariables.size === 0) {
|
|
1049
|
+
return false;
|
|
1050
|
+
}
|
|
1051
|
+
return (query.filters ?? []).some((filter) => (graphVariables.has(filter.variable)
|
|
1052
|
+
&& filter.operator === '$startsWith'
|
|
1053
|
+
&& filter.operand === 'stringValue'
|
|
1054
|
+
&& typeof filter.value === 'string'
|
|
1055
|
+
&& isProductGraphPath(filter.value)));
|
|
1056
|
+
}
|
|
1057
|
+
function isProductGraphPath(graph) {
|
|
1058
|
+
return graph.includes('/.data/chat/')
|
|
1059
|
+
|| graph.includes('/.data/task/')
|
|
1060
|
+
|| graph.includes('/.data/sessions/')
|
|
1061
|
+
|| graph.includes('/.data/agents/')
|
|
1062
|
+
|| graph.includes('/.data/approvals/')
|
|
1063
|
+
|| graph.includes('/.data/audits/')
|
|
1064
|
+
|| graph.includes('/.data/issues/')
|
|
1065
|
+
|| graph.includes('/settings/');
|
|
1066
|
+
}
|
|
1067
|
+
function graphPrefixValue(term) {
|
|
1068
|
+
if (!term || typeof term !== 'object' || 'variable' in term || 'termType' in term) {
|
|
1069
|
+
return undefined;
|
|
1070
|
+
}
|
|
1071
|
+
return '$startsWith' in term && typeof term.$startsWith === 'string'
|
|
1072
|
+
? term.$startsWith
|
|
1073
|
+
: undefined;
|
|
1074
|
+
}
|
|
1075
|
+
function namedNodeValue(term) {
|
|
1076
|
+
if (!term || typeof term !== 'object' || 'variable' in term || !('termType' in term)) {
|
|
1077
|
+
return undefined;
|
|
1078
|
+
}
|
|
1079
|
+
return term.termType === 'NamedNode' ? term.value : undefined;
|
|
1080
|
+
}
|
|
1081
|
+
function variableValue(term) {
|
|
1082
|
+
if (!term || typeof term !== 'object' || !('variable' in term)) {
|
|
1083
|
+
return undefined;
|
|
1084
|
+
}
|
|
1085
|
+
return term.variable;
|
|
1086
|
+
}
|
|
1087
|
+
function stableQueryFingerprint(query) {
|
|
1088
|
+
const { cache: _cache, ...rest } = query;
|
|
1089
|
+
return stableStringify(rest);
|
|
1090
|
+
}
|
|
1091
|
+
function stableStringify(value) {
|
|
1092
|
+
if (value === null || typeof value !== 'object') {
|
|
1093
|
+
return JSON.stringify(value);
|
|
1094
|
+
}
|
|
1095
|
+
if (Array.isArray(value)) {
|
|
1096
|
+
return `[${value.map((entry) => stableStringify(entry)).join(',')}]`;
|
|
1097
|
+
}
|
|
1098
|
+
const entries = Object.entries(value)
|
|
1099
|
+
.filter(([, entry]) => typeof entry !== 'function' && entry !== undefined)
|
|
1100
|
+
.sort(([left], [right]) => left.localeCompare(right));
|
|
1101
|
+
return `{${entries.map(([key, entry]) => `${JSON.stringify(key)}:${stableStringify(entry)}`).join(',')}}`;
|
|
1102
|
+
}
|
|
1103
|
+
function shortHash(value) {
|
|
1104
|
+
return (0, node_crypto_1.createHash)('sha256').update(value).digest('hex').slice(0, 16);
|
|
1105
|
+
}
|
|
476
1106
|
function implicitUpdateDefaultGraph(basePath) {
|
|
477
1107
|
return basePath.endsWith('/') ? undefined : basePath;
|
|
478
1108
|
}
|