@undefineds.co/xpod 0.3.58 → 0.3.61
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/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 +32 -12
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidFsMetaNotes.js","sourceRoot":"","sources":["../../src/solidfs/SolidFsMetaNotes.ts"],"names":[],"mappings":";;AAiCA,sDAmBC;AAED,0DAkBC;AA9CD,MAAM,QAAQ,GAAG,iJAAiJ,CAAC;AACnK,MAAM,gBAAgB,GAAG,4BAA4B,CAAC;AACtD,MAAM,YAAY,GAAG,2BAA2B,CAAC;AACjD,MAAM,wBAAwB,GAAG,2BAA2B,CAAC;AAC7D,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAC5C,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AAErD,SAAgB,qBAAqB,CAAC,KAA4B;IAChE,MAAM,KAAK,GAAG;QACZ,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB;QACtC,gBAAgB,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI;QACrC,eAAe,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI;QACvC,qBAAqB,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI;QACnD,mCAAmC;KACpC,CAAC;IACF,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;QACpB,KAAK,CAAC,IAAI,CAAC,oBAAoB,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC;IACD,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,mBAAmB,yBAAyB,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3F,CAAC;IACD,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;QACtB,KAAK,CAAC,IAAI,CAAC,sBAAsB,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC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SAAS,YAAY,CAAC,KAAa;IACjC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAC;IAC3E,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,CAAC,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACtF,CAAC;AAED,SAAS,eAAe,CAAC,IAAY;IACnC,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AAC9E,CAAC","sourcesContent":["export type SolidFsMaterializationClass = 'byline-local' | 'placeholder-r2' | 'hydrated-r2';\nexport type SolidFsReaderCoverageStatus = 'none' | 'partial' | 'complete' | 'stale' | 'failed';\n\nexport interface FileMetadataNoteInput {\n subject: string;\n about: string;\n title: string;\n description: string;\n mediaType?: string;\n byteSize?: number;\n contentHash?: string;\n materializationClass: SolidFsMaterializationClass;\n}\n\nexport interface ReaderCoverageNoteInput {\n subject: string;\n about: string;\n readerKind: string;\n readerVersion: string;\n coverageUnit: 'page' | 'line' | 'byte' | 'section' | 'symbol' | 'rdf-resource';\n coveredRange: string;\n readUnits: number;\n totalUnits?: number;\n status: SolidFsReaderCoverageStatus;\n}\n\nconst PREFIXES = '@prefix dct: <http://purl.org/dc/terms/> .\\n@prefix sioc: <http://rdfs.org/sioc/ns#> .\\n@prefix udfs: <https://vocab.undefineds.co/udfs#> .\\n\\n';\nconst BLANK_NODE_LABEL = /^_:[A-Za-z][A-Za-z0-9_-]*$/;\nconst ABSOLUTE_IRI = /^[A-Za-z][A-Za-z0-9+.-]*:/;\nconst IRIREF_REQUIRES_ENCODING = /[\\u0000-\\u0020<>\"{}|^`\\\\]/;\nconst IRIREF_UNSAFE_CHARS = /[<>\"{}|^`\\\\]/g;\nconst INVALID_PERCENT_ESCAPE = /%(?![0-9A-Fa-f]{2})/;\n\nexport function buildFileMetadataNote(input: FileMetadataNoteInput): string {\n const lines = [\n `${term(input.subject)} a udfs:Note ;`,\n ` sioc:about ${term(input.about)} ;`,\n ` dct:title ${literal(input.title)} ;`,\n ` dct:description ${literal(input.description)} ;`,\n ' udfs:noteKind \"file-metadata\" ;',\n ];\n if (input.mediaType) {\n lines.push(` udfs:mediaType ${literal(input.mediaType)} ;`);\n }\n if (input.byteSize !== undefined) {\n lines.push(` udfs:byteSize ${nonNegativeIntegerLiteral('byteSize', input.byteSize)} ;`);\n }\n if (input.contentHash) {\n lines.push(` udfs:contentHash ${literal(input.contentHash)} ;`);\n }\n lines.push(` udfs:materializationClass ${literal(input.materializationClass)} .`);\n return `${PREFIXES}${lines.join('\\n')}\\n`;\n}\n\nexport function buildReaderCoverageNote(input: ReaderCoverageNoteInput): string {\n const lines = [\n `${term(input.subject)} a udfs:Note ;`,\n ` sioc:about ${term(input.about)} ;`,\n ' dct:title \"Reader coverage\" ;',\n ` dct:description ${literal(`Read ${input.coveredRange}.`)} ;`,\n ' udfs:noteKind \"reader-coverage\" ;',\n ` udfs:readerKind ${literal(input.readerKind)} ;`,\n ` udfs:readerVersion ${literal(input.readerVersion)} ;`,\n ` udfs:coverageUnit ${literal(input.coverageUnit)} ;`,\n ` udfs:coveredRange ${literal(input.coveredRange)} ;`,\n ` udfs:readUnits ${nonNegativeIntegerLiteral('readUnits', input.readUnits)} ;`,\n ];\n if (input.totalUnits !== undefined) {\n lines.push(` udfs:totalUnits ${nonNegativeIntegerLiteral('totalUnits', input.totalUnits)} ;`);\n }\n lines.push(` udfs:status ${literal(input.status)} .`);\n return `${PREFIXES}${lines.join('\\n')}\\n`;\n}\n\nfunction term(value: string): string {\n if (value.startsWith('<')) {\n if (!value.endsWith('>')) {\n throw new Error(`Invalid Turtle IRI term: ${value}`);\n }\n const innerValue = value.slice(1, -1);\n if (!isLegalIriRef(innerValue)) {\n throw new Error(`Invalid Turtle IRI term: ${value}`);\n }\n return `<${innerValue}>`;\n }\n\n if (value.startsWith('_:')) {\n if (!BLANK_NODE_LABEL.test(value)) {\n throw new Error(`Invalid Turtle blank node label: ${value}`);\n }\n return value;\n }\n\n if (ABSOLUTE_IRI.test(value) && isLegalIriRef(value)) {\n return `<${value}>`;\n }\n\n return `<${encodeIriRef(value)}>`;\n}\n\nfunction literal(value: string): string {\n return JSON.stringify(value) ?? '\"\"';\n}\n\nfunction nonNegativeIntegerLiteral(field: string, value: number): string {\n if (!Number.isSafeInteger(value) || value < 0) {\n throw new RangeError(`${field} must be a non-negative safe integer`);\n }\n return String(value);\n}\n\nfunction encodeIriRef(value: string): string {\n if (value.includes('>')) {\n throw new Error(`Invalid Turtle IRI term: ${value}`);\n }\n\n let encoded: string;\n try {\n encoded = encodeURI(value).replace(IRIREF_UNSAFE_CHARS, encodeAsciiChar);\n } catch {\n throw new Error(`Invalid Turtle IRI term: ${value}`);\n }\n\n if (encoded.includes('>')) {\n throw new Error(`Invalid Turtle IRI term: ${value}`);\n }\n return encoded;\n}\n\nfunction isLegalIriRef(value: string): boolean {\n return !IRIREF_REQUIRES_ENCODING.test(value) && !INVALID_PERCENT_ESCAPE.test(value);\n}\n\nfunction encodeAsciiChar(char: string): string {\n return `%${char.charCodeAt(0).toString(16).toUpperCase().padStart(2, '0')}`;\n}\n"]}
|
|
@@ -92,7 +92,7 @@ export declare class JournaledSolidFsSyncer implements SolidFsSyncer {
|
|
|
92
92
|
constructor(options: JournaledSolidFsSyncerOptions);
|
|
93
93
|
shouldTrack(input: SolidFsPrepareInput): boolean;
|
|
94
94
|
shouldTrackPath(relativePath: string): boolean;
|
|
95
|
-
sync(change: SolidFsChange, workspace: SolidFsManifest, context?: unknown): Promise<void>;
|
|
95
|
+
sync(change: SolidFsChange, workspace: SolidFsManifest, context?: unknown, txId?: string): Promise<void>;
|
|
96
96
|
replayPending(context?: unknown): Promise<SolidFsJournalReplayResult>;
|
|
97
97
|
compact(): Promise<SolidFsJournalCompactResult>;
|
|
98
98
|
bootstrapWorkspace(input: Omit<SolidFsJournalBootstrapInput, 'shouldTrackPath'> & {
|
|
@@ -107,7 +107,7 @@ export declare class WorkspaceJournaledSolidFsSyncer implements SolidFsSyncer {
|
|
|
107
107
|
shouldTrack(input: SolidFsPrepareInput): boolean;
|
|
108
108
|
shouldTrackPath(relativePath: string): boolean;
|
|
109
109
|
initializeWorkspace(workspace: SolidFsManifest, context?: unknown): Promise<void>;
|
|
110
|
-
sync(change: SolidFsChange, workspace: SolidFsManifest, context?: unknown): Promise<void>;
|
|
110
|
+
sync(change: SolidFsChange, workspace: SolidFsManifest, context?: unknown, txId?: string): Promise<void>;
|
|
111
111
|
replayPending(workspace: SolidFsManifest, context?: unknown): Promise<SolidFsJournalReplayResult>;
|
|
112
112
|
compact(workspace: SolidFsManifest): Promise<SolidFsJournalCompactResult>;
|
|
113
113
|
journalPathFor(workspace: SolidFsManifest): string;
|
|
@@ -382,8 +382,8 @@ class JournaledSolidFsSyncer {
|
|
|
382
382
|
shouldTrackPath(relativePath) {
|
|
383
383
|
return this.syncer.shouldTrackPath?.(relativePath) ?? (0, RdfContentTypes_1.isLineAddressableRdfPath)(relativePath);
|
|
384
384
|
}
|
|
385
|
-
async sync(change, workspace, context) {
|
|
386
|
-
const op = await this.journal.recordLocalCommitted(change, workspace);
|
|
385
|
+
async sync(change, workspace, context, txId) {
|
|
386
|
+
const op = await this.journal.recordLocalCommitted(change, workspace, txId);
|
|
387
387
|
if (op.stage === 'done') {
|
|
388
388
|
return;
|
|
389
389
|
}
|
|
@@ -434,9 +434,9 @@ class WorkspaceJournaledSolidFsSyncer {
|
|
|
434
434
|
await journal.replayPending(this.syncer, context);
|
|
435
435
|
await journal.compact();
|
|
436
436
|
}
|
|
437
|
-
async sync(change, workspace, context) {
|
|
437
|
+
async sync(change, workspace, context, txId) {
|
|
438
438
|
const journal = this.journalFor(workspace);
|
|
439
|
-
const op = await journal.recordLocalCommitted(change, workspace);
|
|
439
|
+
const op = await journal.recordLocalCommitted(change, workspace, txId);
|
|
440
440
|
if (op.stage === 'done') {
|
|
441
441
|
return;
|
|
442
442
|
}
|
|
@@ -521,6 +521,7 @@ function normalizeChange(change) {
|
|
|
521
521
|
return {
|
|
522
522
|
...change,
|
|
523
523
|
path: change.path.split(/[\\/]+/u).join(node_path_1.default.sep),
|
|
524
|
+
previousPath: change.previousPath?.split(/[\\/]+/u).join(node_path_1.default.sep),
|
|
524
525
|
};
|
|
525
526
|
}
|
|
526
527
|
function operationId(workspace, change, afterHash) {
|
|
@@ -528,8 +529,12 @@ function operationId(workspace, change, afterHash) {
|
|
|
528
529
|
.update(JSON.stringify({
|
|
529
530
|
workspace,
|
|
530
531
|
path: change.path,
|
|
532
|
+
previousPath: change.previousPath,
|
|
533
|
+
prefix: change.prefix,
|
|
534
|
+
previousPrefix: change.previousPrefix,
|
|
531
535
|
type: change.type,
|
|
532
536
|
resource: change.resource,
|
|
537
|
+
previousResource: change.previousResource,
|
|
533
538
|
source: change.source,
|
|
534
539
|
sourcePath: change.sourcePath,
|
|
535
540
|
projection: change.projection,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidFsSyncJournal.js","sourceRoot":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AAS,CAAC,CAAC,IAAI,CAAC,mBAAI,CAAC,GAAG,CAAC;KAClD,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,SAAiB,EAAE,MAAqB,EAAE,SAAkB;IAC/E,MAAM,MAAM,GAAG,IAAA,wBAAU,EAAC,QAAQ,CAAC;SAChC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;QACrB,SAAS;QACT,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,SAAS;KACV,CAAC,CAAC;SACF,MAAM,CAAC,KAAK,CAAC;SACb,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChB,OAAO,QAAQ,MAAM,EAAE,CAAC;AAC1B,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa;IACvC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACnE,OAAO,IAAI,IAAI,WAAW,CAAC;AAC7B,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC","sourcesContent":["import { createHash } from 'node:crypto';\nimport path from 'node:path';\n\nimport { getSqliteRuntime, type SqliteDatabase } from '../storage/SqliteRuntime';\nimport type {\n SolidFsChange,\n SolidFsEntrySource,\n SolidFsManifest,\n SolidFsPrepareInput,\n SolidFsProjection,\n SolidFsSyncer,\n} from './types';\nimport {\n isLineAddressableRdfPath,\n} from '../storage/rdf/RdfContentTypes';\nimport {\n contentTypeForPath,\n maybeFileVersion,\n resolveWorkspaceResource,\n snapshotDirectory,\n sourceForProjection,\n} from './SolidFsPathUtils';\n\nconst DAY_MS = 24 * 60 * 60 * 1000;\nconst DEFAULT_DONE_RETENTION_MS = 7 * DAY_MS;\nconst DEFAULT_TOMBSTONE_RETENTION_MS = 30 * DAY_MS;\nconst DEFAULT_FAILED_PERMANENT_RETENTION_MS = 30 * DAY_MS;\n\nexport type SolidFsSyncJournalStage =\n | 'local_committed'\n | 'failed_retryable'\n | 'failed_permanent'\n | 'reconcile_required'\n | 'done';\n\nexport interface SolidFsSyncJournalOptions {\n path: string;\n now?: () => number;\n doneRetentionMs?: number;\n tombstoneRetentionMs?: number;\n failedPermanentRetentionMs?: number;\n}\n\nexport interface SolidFsSyncJournalOperation {\n id: string;\n txId?: string;\n workspace: SolidFsManifest;\n change: SolidFsChange;\n stage: SolidFsSyncJournalStage;\n afterHash?: string;\n retryCount: number;\n lastError?: string;\n createdAt: number;\n updatedAt: number;\n doneAt?: number;\n}\n\nexport interface SolidFsJournalBootstrapInput {\n workspace: string;\n cwd: string;\n projection?: SolidFsProjection;\n source?: SolidFsEntrySource;\n shouldTrackPath?: (relativePath: string) => boolean;\n}\n\nexport interface SolidFsJournalBootstrapResult {\n scanned: number;\n enqueued: number;\n skipped: number;\n}\n\nexport interface SolidFsJournalReplayResult {\n attempted: number;\n completed: number;\n failed: number;\n reconcileRequired: number;\n}\n\nexport interface SolidFsJournalCompactResult {\n deletedOps: number;\n}\n\ninterface SyncOpRow {\n id: string;\n tx_id: string | null;\n workspace_json: string;\n change_json: string;\n stage: SolidFsSyncJournalStage;\n after_hash: string | null;\n retry_count: number;\n last_error: string | null;\n created_at: number;\n updated_at: number;\n done_at: number | null;\n}\n\ninterface CheckpointRow {\n source_version: string | null;\n deleted_at: number | null;\n}\n\n/**\n * Per-Pod SolidFS recovery journal.\n *\n * This is an outbox for derived work after the authority file is already\n * committed. It stores enough metadata to replay index/remote refreshes, but\n * never stores file bodies.\n */\nexport class SqliteSolidFsSyncJournal {\n private readonly db: SqliteDatabase;\n private readonly now: () => number;\n private readonly doneRetentionMs: number;\n private readonly tombstoneRetentionMs: number;\n private readonly failedPermanentRetentionMs: number;\n\n public constructor(options: SolidFsSyncJournalOptions) {\n this.now = options.now ?? Date.now;\n this.doneRetentionMs = options.doneRetentionMs ?? DEFAULT_DONE_RETENTION_MS;\n this.tombstoneRetentionMs = options.tombstoneRetentionMs ?? DEFAULT_TOMBSTONE_RETENTION_MS;\n this.failedPermanentRetentionMs = options.failedPermanentRetentionMs ?? DEFAULT_FAILED_PERMANENT_RETENTION_MS;\n this.db = getSqliteRuntime().openDatabase(options.path);\n this.db.pragma('journal_mode = WAL');\n this.db.pragma('busy_timeout = 5000');\n this.initializeSchema();\n }\n\n public close(): void {\n this.db.close();\n }\n\n public async recordLocalCommitted(\n change: SolidFsChange,\n workspace: SolidFsManifest,\n txId?: string,\n ): Promise<SolidFsSyncJournalOperation> {\n const normalizedChange = normalizeChange(change);\n const afterHash = normalizedChange.type === 'deleted'\n ? undefined\n : await maybeFileVersion(normalizedChange.sourcePath);\n const opId = operationId(workspace.workspace, normalizedChange, afterHash);\n const now = this.now();\n\n const existing = this.getOperation(opId);\n if (existing) {\n return existing;\n }\n\n const journalWorkspace = journalWorkspaceSnapshot(workspace);\n this.db.prepare(`\n INSERT INTO sync_ops (\n id,\n tx_id,\n workspace,\n path,\n op_type,\n stage,\n source_path,\n resource,\n content_type,\n source,\n projection,\n source_version,\n after_hash,\n workspace_json,\n change_json,\n retry_count,\n created_at,\n updated_at\n )\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, ?, ?)\n `).run(\n opId,\n txId ?? null,\n workspace.workspace,\n normalizedChange.path,\n normalizedChange.type,\n 'local_committed',\n normalizedChange.sourcePath,\n normalizedChange.resource ?? null,\n normalizedChange.contentType ?? null,\n normalizedChange.source,\n normalizedChange.projection,\n normalizedChange.sourceVersion ?? null,\n afterHash ?? null,\n JSON.stringify(journalWorkspace),\n JSON.stringify(normalizedChange),\n now,\n now,\n );\n\n return this.getOperation(opId)!;\n }\n\n public getOperation(id: string): SolidFsSyncJournalOperation | undefined {\n const row = this.db.prepare<SyncOpRow>(`\n SELECT id, tx_id, workspace_json, change_json, stage, after_hash, retry_count,\n last_error, created_at, updated_at, done_at\n FROM sync_ops\n WHERE id = ?\n `).get(id);\n return row ? rowToOperation(row) : undefined;\n }\n\n public listOperations(stages?: SolidFsSyncJournalStage[]): SolidFsSyncJournalOperation[] {\n const rows = stages && stages.length > 0\n ? this.db.prepare<SyncOpRow>(`\n SELECT id, tx_id, workspace_json, change_json, stage, after_hash, retry_count,\n last_error, created_at, updated_at, done_at\n FROM sync_ops\n WHERE stage IN (${stages.map(() => '?').join(', ')})\n ORDER BY created_at ASC, id ASC\n `).all(...stages)\n : this.db.prepare<SyncOpRow>(`\n SELECT id, tx_id, workspace_json, change_json, stage, after_hash, retry_count,\n last_error, created_at, updated_at, done_at\n FROM sync_ops\n ORDER BY created_at ASC, id ASC\n `).all();\n return rows.map(rowToOperation);\n }\n\n public listPending(): SolidFsSyncJournalOperation[] {\n return this.listOperations(['local_committed', 'failed_retryable']);\n }\n\n public async markDone(id: string): Promise<void> {\n const op = this.getOperation(id);\n if (!op) {\n return;\n }\n\n const now = this.now();\n this.db.transaction(() => {\n this.db.prepare(`\n UPDATE sync_ops\n SET stage = 'done',\n last_error = NULL,\n done_at = ?,\n updated_at = ?,\n tombstone_confirmed_at = CASE WHEN op_type = 'deleted' THEN ? ELSE tombstone_confirmed_at END\n WHERE id = ?\n `).run(now, now, now, id);\n\n this.upsertCheckpoint(op, now);\n })();\n }\n\n public async markRetryableFailure(id: string, error: unknown): Promise<void> {\n const now = this.now();\n this.db.prepare(`\n UPDATE sync_ops\n SET stage = 'failed_retryable',\n retry_count = retry_count + 1,\n last_error = ?,\n updated_at = ?\n WHERE id = ?\n `).run(errorMessage(error), now, id);\n }\n\n public async markReconcileRequired(id: string, reason: string): Promise<void> {\n const now = this.now();\n this.db.prepare(`\n UPDATE sync_ops\n SET stage = 'reconcile_required',\n last_error = ?,\n updated_at = ?\n WHERE id = ?\n `).run(reason, now, id);\n }\n\n public async markFailedPermanent(id: string, error: unknown): Promise<void> {\n const now = this.now();\n this.db.prepare(`\n UPDATE sync_ops\n SET stage = 'failed_permanent',\n last_error = ?,\n updated_at = ?\n WHERE id = ?\n `).run(errorMessage(error), now, id);\n }\n\n public async replayPending(syncer: SolidFsSyncer, context?: unknown): Promise<SolidFsJournalReplayResult> {\n const result: SolidFsJournalReplayResult = {\n attempted: 0,\n completed: 0,\n failed: 0,\n reconcileRequired: 0,\n };\n\n for (const op of this.listPending()) {\n result.attempted += 1;\n const validation = await this.validateOperationForReplay(op);\n if (validation) {\n await this.markReconcileRequired(op.id, validation);\n result.reconcileRequired += 1;\n continue;\n }\n\n try {\n await syncer.sync(op.change, op.workspace, context);\n await this.markDone(op.id);\n result.completed += 1;\n } catch (error) {\n await this.markRetryableFailure(op.id, error);\n result.failed += 1;\n }\n }\n\n return result;\n }\n\n public async bootstrapWorkspace(input: SolidFsJournalBootstrapInput): Promise<SolidFsJournalBootstrapResult> {\n const projection = input.projection ?? 'direct';\n const source = input.source ?? sourceForProjection(projection, input.workspace);\n const manifest: SolidFsManifest = {\n workspace: input.workspace,\n cwd: input.cwd,\n projection,\n entries: [],\n };\n\n const snapshots = await snapshotDirectory(input.cwd, input.shouldTrackPath);\n const currentPaths = new Set(snapshots.map((snapshot) => snapshot.relativePath));\n const result: SolidFsJournalBootstrapResult = {\n scanned: snapshots.length,\n enqueued: 0,\n skipped: 0,\n };\n\n for (const snapshot of snapshots) {\n const checkpoint = this.getCheckpoint(input.workspace, snapshot.relativePath);\n if (checkpoint?.source_version === snapshot.version && !checkpoint.deleted_at) {\n result.skipped += 1;\n continue;\n }\n\n const op = await this.recordLocalCommitted({\n path: snapshot.relativePath,\n resource: resolveWorkspaceResource(input.workspace, snapshot.relativePath),\n source,\n sourcePath: snapshot.absolutePath,\n contentType: contentTypeForPath(snapshot.relativePath),\n projection,\n type: 'created',\n }, manifest);\n result.enqueued += op.stage === 'done' ? 0 : 1;\n }\n\n const checkpoints = this.listCheckpoints(input.workspace);\n for (const checkpoint of checkpoints) {\n if (currentPaths.has(checkpoint.path) || checkpoint.deleted_at) {\n continue;\n }\n const op = await this.recordLocalCommitted({\n path: checkpoint.path,\n resource: resolveWorkspaceResource(input.workspace, checkpoint.path),\n source,\n sourcePath: path.join(input.cwd, checkpoint.path),\n contentType: contentTypeForPath(checkpoint.path),\n projection,\n type: 'deleted',\n sourceVersion: checkpoint.source_version ?? undefined,\n }, manifest);\n result.enqueued += op.stage === 'done' ? 0 : 1;\n }\n\n return result;\n }\n\n public async compact(): Promise<SolidFsJournalCompactResult> {\n const now = this.now();\n const rows = this.db.prepare<{\n id: string;\n workspace: string;\n path: string;\n op_type: SolidFsChange['type'];\n after_hash: string | null;\n stage: SolidFsSyncJournalStage;\n done_at: number | null;\n updated_at: number;\n tombstone_confirmed_at: number | null;\n }>(`\n SELECT id, workspace, path, op_type, after_hash, stage, done_at, updated_at, tombstone_confirmed_at\n FROM sync_ops\n WHERE stage IN ('done', 'failed_permanent')\n ORDER BY created_at ASC\n `).all();\n\n const deletable: string[] = [];\n for (const row of rows) {\n if (row.stage === 'failed_permanent') {\n if (row.updated_at <= now - this.failedPermanentRetentionMs) {\n deletable.push(row.id);\n }\n continue;\n }\n\n if (!row.done_at) {\n continue;\n }\n const checkpoint = this.getCheckpoint(row.workspace, row.path);\n if (!checkpoint) {\n continue;\n }\n if (row.op_type === 'deleted') {\n if (\n row.done_at <= now - this.tombstoneRetentionMs &&\n row.tombstone_confirmed_at &&\n checkpoint.deleted_at\n ) {\n deletable.push(row.id);\n }\n continue;\n }\n\n if (row.done_at <= now - this.doneRetentionMs && checkpoint.source_version === row.after_hash) {\n deletable.push(row.id);\n }\n }\n\n if (deletable.length === 0) {\n return { deletedOps: 0 };\n }\n\n this.db.transaction(() => {\n const deleteStatement = this.db.prepare('DELETE FROM sync_ops WHERE id = ?');\n for (const id of deletable) {\n deleteStatement.run(id);\n }\n })();\n\n return { deletedOps: deletable.length };\n }\n\n private async validateOperationForReplay(op: SolidFsSyncJournalOperation): Promise<string | undefined> {\n if (op.change.type === 'deleted') {\n return undefined;\n }\n\n const currentHash = await maybeFileVersion(op.change.sourcePath);\n if (!currentHash) {\n return `SolidFS journal source is missing: ${op.change.sourcePath}`;\n }\n if (op.afterHash && currentHash !== op.afterHash) {\n return `SolidFS journal source changed before replay: ${op.change.path}`;\n }\n return undefined;\n }\n\n private getCheckpoint(workspace: string, relativePath: string): CheckpointRow | undefined {\n return this.db.prepare<CheckpointRow>(`\n SELECT source_version, deleted_at\n FROM sync_checkpoints\n WHERE workspace = ? AND path = ?\n `).get(workspace, relativePath);\n }\n\n private listCheckpoints(workspace: string): Array<CheckpointRow & { path: string }> {\n return this.db.prepare<CheckpointRow & { path: string }>(`\n SELECT path, source_version, deleted_at\n FROM sync_checkpoints\n WHERE workspace = ?\n ORDER BY path ASC\n `).all(workspace);\n }\n\n private upsertCheckpoint(op: SolidFsSyncJournalOperation, now: number): void {\n if (op.change.type === 'deleted') {\n this.db.prepare(`\n INSERT INTO sync_checkpoints (workspace, path, source_version, deleted_at, updated_at, last_op_id)\n VALUES (?, ?, NULL, ?, ?, ?)\n ON CONFLICT(workspace, path) DO UPDATE SET\n source_version = NULL,\n deleted_at = excluded.deleted_at,\n updated_at = excluded.updated_at,\n last_op_id = excluded.last_op_id\n `).run(op.workspace.workspace, op.change.path, now, now, op.id);\n return;\n }\n\n this.db.prepare(`\n INSERT INTO sync_checkpoints (workspace, path, source_version, deleted_at, updated_at, last_op_id)\n VALUES (?, ?, ?, NULL, ?, ?)\n ON CONFLICT(workspace, path) DO UPDATE SET\n source_version = excluded.source_version,\n deleted_at = NULL,\n updated_at = excluded.updated_at,\n last_op_id = excluded.last_op_id\n `).run(op.workspace.workspace, op.change.path, op.afterHash ?? null, now, op.id);\n }\n\n private initializeSchema(): void {\n this.db.exec(`\n CREATE TABLE IF NOT EXISTS sync_ops (\n id TEXT PRIMARY KEY,\n tx_id TEXT,\n workspace TEXT NOT NULL,\n path TEXT NOT NULL,\n op_type TEXT NOT NULL,\n stage TEXT NOT NULL,\n source_path TEXT NOT NULL,\n resource TEXT,\n content_type TEXT,\n source TEXT NOT NULL,\n projection TEXT NOT NULL,\n source_version TEXT,\n after_hash TEXT,\n workspace_json TEXT NOT NULL,\n change_json TEXT NOT NULL,\n retry_count INTEGER NOT NULL DEFAULT 0,\n last_error TEXT,\n created_at INTEGER NOT NULL,\n updated_at INTEGER NOT NULL,\n done_at INTEGER,\n tombstone_confirmed_at INTEGER\n );\n\n CREATE INDEX IF NOT EXISTS sync_ops_stage_created_idx\n ON sync_ops(stage, created_at);\n CREATE INDEX IF NOT EXISTS sync_ops_workspace_path_idx\n ON sync_ops(workspace, path);\n\n CREATE TABLE IF NOT EXISTS sync_checkpoints (\n workspace TEXT NOT NULL,\n path TEXT NOT NULL,\n source_version TEXT,\n deleted_at INTEGER,\n updated_at INTEGER NOT NULL,\n last_op_id TEXT,\n PRIMARY KEY (workspace, path)\n );\n `);\n }\n}\n\nexport interface JournaledSolidFsSyncerOptions {\n syncer: SolidFsSyncer;\n journal: SqliteSolidFsSyncJournal;\n}\n\nexport interface WorkspaceJournaledSolidFsSyncerOptions {\n syncer: SolidFsSyncer;\n journalRoot?: string;\n resolveJournalPath?: (workspace: SolidFsManifest) => string;\n now?: () => number;\n doneRetentionMs?: number;\n tombstoneRetentionMs?: number;\n failedPermanentRetentionMs?: number;\n}\n\nexport class JournaledSolidFsSyncer implements SolidFsSyncer {\n private readonly syncer: SolidFsSyncer;\n private readonly journal: SqliteSolidFsSyncJournal;\n\n public constructor(options: JournaledSolidFsSyncerOptions) {\n this.syncer = options.syncer;\n this.journal = options.journal;\n }\n\n public shouldTrack(input: SolidFsPrepareInput): boolean {\n return this.syncer.shouldTrack?.(input) ?? true;\n }\n\n public shouldTrackPath(relativePath: string): boolean {\n return this.syncer.shouldTrackPath?.(relativePath) ?? isLineAddressableRdfPath(relativePath);\n }\n\n public async sync(change: SolidFsChange, workspace: SolidFsManifest, context?: unknown): Promise<void> {\n const op = await this.journal.recordLocalCommitted(change, workspace);\n if (op.stage === 'done') {\n return;\n }\n\n try {\n await this.syncer.sync(change, workspace, context);\n await this.journal.markDone(op.id);\n } catch (error) {\n await this.journal.markRetryableFailure(op.id, error);\n throw error;\n }\n }\n\n public async replayPending(context?: unknown): Promise<SolidFsJournalReplayResult> {\n return this.journal.replayPending(this.syncer, context);\n }\n\n public async compact(): Promise<SolidFsJournalCompactResult> {\n return this.journal.compact();\n }\n\n public async bootstrapWorkspace(\n input: Omit<SolidFsJournalBootstrapInput, 'shouldTrackPath'> & {\n shouldTrackPath?: (relativePath: string) => boolean;\n },\n ): Promise<SolidFsJournalBootstrapResult> {\n return this.journal.bootstrapWorkspace({\n ...input,\n shouldTrackPath: input.shouldTrackPath ?? this.shouldTrackPath.bind(this),\n });\n }\n}\n\nexport class WorkspaceJournaledSolidFsSyncer implements SolidFsSyncer {\n private readonly syncer: SolidFsSyncer;\n private readonly journals = new Map<string, SqliteSolidFsSyncJournal>();\n\n public constructor(private readonly options: WorkspaceJournaledSolidFsSyncerOptions) {\n this.syncer = options.syncer;\n }\n\n public shouldTrack(input: SolidFsPrepareInput): boolean {\n return this.syncer.shouldTrack?.(input) ?? true;\n }\n\n public shouldTrackPath(relativePath: string): boolean {\n return this.syncer.shouldTrackPath?.(relativePath) ?? isLineAddressableRdfPath(relativePath);\n }\n\n public async initializeWorkspace(workspace: SolidFsManifest, context?: unknown): Promise<void> {\n const journal = this.journalFor(workspace);\n await journal.bootstrapWorkspace({\n workspace: workspace.workspace,\n cwd: workspace.cwd,\n projection: workspace.projection,\n source: sourceForProjection(workspace.projection, workspace.workspace),\n shouldTrackPath: this.shouldTrackPath.bind(this),\n });\n await journal.replayPending(this.syncer, context);\n await journal.compact();\n }\n\n public async sync(change: SolidFsChange, workspace: SolidFsManifest, context?: unknown): Promise<void> {\n const journal = this.journalFor(workspace);\n const op = await journal.recordLocalCommitted(change, workspace);\n if (op.stage === 'done') {\n return;\n }\n\n try {\n await this.syncer.sync(change, workspace, context);\n await journal.markDone(op.id);\n } catch (error) {\n await journal.markRetryableFailure(op.id, error);\n throw error;\n }\n }\n\n public async replayPending(workspace: SolidFsManifest, context?: unknown): Promise<SolidFsJournalReplayResult> {\n return this.journalFor(workspace).replayPending(this.syncer, context);\n }\n\n public async compact(workspace: SolidFsManifest): Promise<SolidFsJournalCompactResult> {\n return this.journalFor(workspace).compact();\n }\n\n public journalPathFor(workspace: SolidFsManifest): string {\n return this.options.resolveJournalPath?.(workspace)\n ?? resolveSolidFsJournalPath(workspace, this.options.journalRoot ?? process.env.XPOD_SOLIDFS_JOURNAL_ROOT);\n }\n\n public close(): void {\n for (const journal of this.journals.values()) {\n journal.close();\n }\n this.journals.clear();\n }\n\n private journalFor(workspace: SolidFsManifest): SqliteSolidFsSyncJournal {\n const journalPath = this.journalPathFor(workspace);\n const existing = this.journals.get(journalPath);\n if (existing) {\n return existing;\n }\n\n const journal = new SqliteSolidFsSyncJournal({\n path: journalPath,\n now: this.options.now,\n doneRetentionMs: this.options.doneRetentionMs,\n tombstoneRetentionMs: this.options.tombstoneRetentionMs,\n failedPermanentRetentionMs: this.options.failedPermanentRetentionMs,\n });\n this.journals.set(journalPath, journal);\n return journal;\n }\n}\n\nexport function resolveSolidFsJournalPath(workspace: SolidFsManifest, journalRoot?: string): string {\n const root = journalRoot\n ? path.resolve(journalRoot)\n : path.join(path.dirname(path.resolve(workspace.cwd)), '.xpod-control', 'solidfs-journals');\n const basename = safeJournalSegment(path.basename(workspace.cwd) || 'workspace');\n const key = createHash('sha256')\n .update(workspace.workspace)\n .digest('hex')\n .slice(0, 16);\n return path.join(root, `${basename}-${key}`, 'sync-journal.sqlite');\n}\n\nfunction rowToOperation(row: SyncOpRow): SolidFsSyncJournalOperation {\n return {\n id: row.id,\n txId: row.tx_id ?? undefined,\n workspace: JSON.parse(row.workspace_json) as SolidFsManifest,\n change: JSON.parse(row.change_json) as SolidFsChange,\n stage: row.stage,\n afterHash: row.after_hash ?? undefined,\n retryCount: row.retry_count,\n lastError: row.last_error ?? undefined,\n createdAt: row.created_at,\n updatedAt: row.updated_at,\n doneAt: row.done_at ?? undefined,\n };\n}\n\nfunction journalWorkspaceSnapshot(workspace: SolidFsManifest): SolidFsManifest {\n return {\n workspace: workspace.workspace,\n cwd: workspace.cwd,\n projection: workspace.projection,\n entries: [],\n };\n}\n\nfunction normalizeChange(change: SolidFsChange): SolidFsChange {\n return {\n ...change,\n path: change.path.split(/[\\\\/]+/u).join(path.sep),\n };\n}\n\nfunction operationId(workspace: string, change: SolidFsChange, afterHash?: string): string {\n const digest = createHash('sha256')\n .update(JSON.stringify({\n workspace,\n path: change.path,\n type: change.type,\n resource: change.resource,\n source: change.source,\n sourcePath: change.sourcePath,\n projection: change.projection,\n sourceVersion: change.sourceVersion,\n afterHash,\n }))\n .digest('hex')\n .slice(0, 32);\n return `sync_${digest}`;\n}\n\nfunction safeJournalSegment(value: string): string {\n const safe = value.replace(/[^a-zA-Z0-9._-]+/gu, '_').slice(0, 64);\n return safe || 'workspace';\n}\n\nfunction errorMessage(error: unknown): string {\n if (error instanceof Error) {\n return error.message;\n }\n return String(error);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SolidFsSyncJournal.js","sourceRoot":"","sources":["../../src/solidfs/SolidFsSyncJournal.ts"],"names":[],"mappings":";;;;;;AA8qBA,8DAUC;AAxrBD,6CAAyC;AACzC,0DAA6B;AAE7B,4DAAiF;AASjF,oEAEwC;AACxC,yDAM4B;AAE5B,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACnC,MAAM,yBAAyB,GAAG,CAAC,GAAG,MAA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iB,EAAE,MAAqB,EAAE,SAAkB;IAC/E,MAAM,MAAM,GAAG,IAAA,wBAAU,EAAC,QAAQ,CAAC;SAChC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;QACrB,SAAS;QACT,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;QACzC,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,SAAS;KACV,CAAC,CAAC;SACF,MAAM,CAAC,KAAK,CAAC;SACb,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChB,OAAO,QAAQ,MAAM,EAAE,CAAC;AAC1B,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa;IACvC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACnE,OAAO,IAAI,IAAI,WAAW,CAAC;AAC7B,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC","sourcesContent":["import { createHash } from 'node:crypto';\nimport path from 'node:path';\n\nimport { getSqliteRuntime, type SqliteDatabase } from '../storage/SqliteRuntime';\nimport type {\n SolidFsChange,\n SolidFsEntrySource,\n SolidFsManifest,\n SolidFsPrepareInput,\n SolidFsProjection,\n SolidFsSyncer,\n} from './types';\nimport {\n isLineAddressableRdfPath,\n} from '../storage/rdf/RdfContentTypes';\nimport {\n contentTypeForPath,\n maybeFileVersion,\n resolveWorkspaceResource,\n snapshotDirectory,\n sourceForProjection,\n} from './SolidFsPathUtils';\n\nconst DAY_MS = 24 * 60 * 60 * 1000;\nconst DEFAULT_DONE_RETENTION_MS = 7 * DAY_MS;\nconst DEFAULT_TOMBSTONE_RETENTION_MS = 30 * DAY_MS;\nconst DEFAULT_FAILED_PERMANENT_RETENTION_MS = 30 * DAY_MS;\n\nexport type SolidFsSyncJournalStage =\n | 'local_committed'\n | 'failed_retryable'\n | 'failed_permanent'\n | 'reconcile_required'\n | 'done';\n\nexport interface SolidFsSyncJournalOptions {\n path: string;\n now?: () => number;\n doneRetentionMs?: number;\n tombstoneRetentionMs?: number;\n failedPermanentRetentionMs?: number;\n}\n\nexport interface SolidFsSyncJournalOperation {\n id: string;\n txId?: string;\n workspace: SolidFsManifest;\n change: SolidFsChange;\n stage: SolidFsSyncJournalStage;\n afterHash?: string;\n retryCount: number;\n lastError?: string;\n createdAt: number;\n updatedAt: number;\n doneAt?: number;\n}\n\nexport interface SolidFsJournalBootstrapInput {\n workspace: string;\n cwd: string;\n projection?: SolidFsProjection;\n source?: SolidFsEntrySource;\n shouldTrackPath?: (relativePath: string) => boolean;\n}\n\nexport interface SolidFsJournalBootstrapResult {\n scanned: number;\n enqueued: number;\n skipped: number;\n}\n\nexport interface SolidFsJournalReplayResult {\n attempted: number;\n completed: number;\n failed: number;\n reconcileRequired: number;\n}\n\nexport interface SolidFsJournalCompactResult {\n deletedOps: number;\n}\n\ninterface SyncOpRow {\n id: string;\n tx_id: string | null;\n workspace_json: string;\n change_json: string;\n stage: SolidFsSyncJournalStage;\n after_hash: string | null;\n retry_count: number;\n last_error: string | null;\n created_at: number;\n updated_at: number;\n done_at: number | null;\n}\n\ninterface CheckpointRow {\n source_version: string | null;\n deleted_at: number | null;\n}\n\n/**\n * Per-Pod SolidFS recovery journal.\n *\n * This is an outbox for derived work after the authority file is already\n * committed. It stores enough metadata to replay index/remote refreshes, but\n * never stores file bodies.\n */\nexport class SqliteSolidFsSyncJournal {\n private readonly db: SqliteDatabase;\n private readonly now: () => number;\n private readonly doneRetentionMs: number;\n private readonly tombstoneRetentionMs: number;\n private readonly failedPermanentRetentionMs: number;\n\n public constructor(options: SolidFsSyncJournalOptions) {\n this.now = options.now ?? Date.now;\n this.doneRetentionMs = options.doneRetentionMs ?? DEFAULT_DONE_RETENTION_MS;\n this.tombstoneRetentionMs = options.tombstoneRetentionMs ?? DEFAULT_TOMBSTONE_RETENTION_MS;\n this.failedPermanentRetentionMs = options.failedPermanentRetentionMs ?? DEFAULT_FAILED_PERMANENT_RETENTION_MS;\n this.db = getSqliteRuntime().openDatabase(options.path);\n this.db.pragma('journal_mode = WAL');\n this.db.pragma('busy_timeout = 5000');\n this.initializeSchema();\n }\n\n public close(): void {\n this.db.close();\n }\n\n public async recordLocalCommitted(\n change: SolidFsChange,\n workspace: SolidFsManifest,\n txId?: string,\n ): Promise<SolidFsSyncJournalOperation> {\n const normalizedChange = normalizeChange(change);\n const afterHash = normalizedChange.type === 'deleted'\n ? undefined\n : await maybeFileVersion(normalizedChange.sourcePath);\n const opId = operationId(workspace.workspace, normalizedChange, afterHash);\n const now = this.now();\n\n const existing = this.getOperation(opId);\n if (existing) {\n return existing;\n }\n\n const journalWorkspace = journalWorkspaceSnapshot(workspace);\n this.db.prepare(`\n INSERT INTO sync_ops (\n id,\n tx_id,\n workspace,\n path,\n op_type,\n stage,\n source_path,\n resource,\n content_type,\n source,\n projection,\n source_version,\n after_hash,\n workspace_json,\n change_json,\n retry_count,\n created_at,\n updated_at\n )\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, ?, ?)\n `).run(\n opId,\n txId ?? null,\n workspace.workspace,\n normalizedChange.path,\n normalizedChange.type,\n 'local_committed',\n normalizedChange.sourcePath,\n normalizedChange.resource ?? null,\n normalizedChange.contentType ?? null,\n normalizedChange.source,\n normalizedChange.projection,\n normalizedChange.sourceVersion ?? null,\n afterHash ?? null,\n JSON.stringify(journalWorkspace),\n JSON.stringify(normalizedChange),\n now,\n now,\n );\n\n return this.getOperation(opId)!;\n }\n\n public getOperation(id: string): SolidFsSyncJournalOperation | undefined {\n const row = this.db.prepare<SyncOpRow>(`\n SELECT id, tx_id, workspace_json, change_json, stage, after_hash, retry_count,\n last_error, created_at, updated_at, done_at\n FROM sync_ops\n WHERE id = ?\n `).get(id);\n return row ? rowToOperation(row) : undefined;\n }\n\n public listOperations(stages?: SolidFsSyncJournalStage[]): SolidFsSyncJournalOperation[] {\n const rows = stages && stages.length > 0\n ? this.db.prepare<SyncOpRow>(`\n SELECT id, tx_id, workspace_json, change_json, stage, after_hash, retry_count,\n last_error, created_at, updated_at, done_at\n FROM sync_ops\n WHERE stage IN (${stages.map(() => '?').join(', ')})\n ORDER BY created_at ASC, id ASC\n `).all(...stages)\n : this.db.prepare<SyncOpRow>(`\n SELECT id, tx_id, workspace_json, change_json, stage, after_hash, retry_count,\n last_error, created_at, updated_at, done_at\n FROM sync_ops\n ORDER BY created_at ASC, id ASC\n `).all();\n return rows.map(rowToOperation);\n }\n\n public listPending(): SolidFsSyncJournalOperation[] {\n return this.listOperations(['local_committed', 'failed_retryable']);\n }\n\n public async markDone(id: string): Promise<void> {\n const op = this.getOperation(id);\n if (!op) {\n return;\n }\n\n const now = this.now();\n this.db.transaction(() => {\n this.db.prepare(`\n UPDATE sync_ops\n SET stage = 'done',\n last_error = NULL,\n done_at = ?,\n updated_at = ?,\n tombstone_confirmed_at = CASE WHEN op_type = 'deleted' THEN ? ELSE tombstone_confirmed_at END\n WHERE id = ?\n `).run(now, now, now, id);\n\n this.upsertCheckpoint(op, now);\n })();\n }\n\n public async markRetryableFailure(id: string, error: unknown): Promise<void> {\n const now = this.now();\n this.db.prepare(`\n UPDATE sync_ops\n SET stage = 'failed_retryable',\n retry_count = retry_count + 1,\n last_error = ?,\n updated_at = ?\n WHERE id = ?\n `).run(errorMessage(error), now, id);\n }\n\n public async markReconcileRequired(id: string, reason: string): Promise<void> {\n const now = this.now();\n this.db.prepare(`\n UPDATE sync_ops\n SET stage = 'reconcile_required',\n last_error = ?,\n updated_at = ?\n WHERE id = ?\n `).run(reason, now, id);\n }\n\n public async markFailedPermanent(id: string, error: unknown): Promise<void> {\n const now = this.now();\n this.db.prepare(`\n UPDATE sync_ops\n SET stage = 'failed_permanent',\n last_error = ?,\n updated_at = ?\n WHERE id = ?\n `).run(errorMessage(error), now, id);\n }\n\n public async replayPending(syncer: SolidFsSyncer, context?: unknown): Promise<SolidFsJournalReplayResult> {\n const result: SolidFsJournalReplayResult = {\n attempted: 0,\n completed: 0,\n failed: 0,\n reconcileRequired: 0,\n };\n\n for (const op of this.listPending()) {\n result.attempted += 1;\n const validation = await this.validateOperationForReplay(op);\n if (validation) {\n await this.markReconcileRequired(op.id, validation);\n result.reconcileRequired += 1;\n continue;\n }\n\n try {\n await syncer.sync(op.change, op.workspace, context);\n await this.markDone(op.id);\n result.completed += 1;\n } catch (error) {\n await this.markRetryableFailure(op.id, error);\n result.failed += 1;\n }\n }\n\n return result;\n }\n\n public async bootstrapWorkspace(input: SolidFsJournalBootstrapInput): Promise<SolidFsJournalBootstrapResult> {\n const projection = input.projection ?? 'direct';\n const source = input.source ?? sourceForProjection(projection, input.workspace);\n const manifest: SolidFsManifest = {\n workspace: input.workspace,\n cwd: input.cwd,\n projection,\n entries: [],\n };\n\n const snapshots = await snapshotDirectory(input.cwd, input.shouldTrackPath);\n const currentPaths = new Set(snapshots.map((snapshot) => snapshot.relativePath));\n const result: SolidFsJournalBootstrapResult = {\n scanned: snapshots.length,\n enqueued: 0,\n skipped: 0,\n };\n\n for (const snapshot of snapshots) {\n const checkpoint = this.getCheckpoint(input.workspace, snapshot.relativePath);\n if (checkpoint?.source_version === snapshot.version && !checkpoint.deleted_at) {\n result.skipped += 1;\n continue;\n }\n\n const op = await this.recordLocalCommitted({\n path: snapshot.relativePath,\n resource: resolveWorkspaceResource(input.workspace, snapshot.relativePath),\n source,\n sourcePath: snapshot.absolutePath,\n contentType: contentTypeForPath(snapshot.relativePath),\n projection,\n type: 'created',\n }, manifest);\n result.enqueued += op.stage === 'done' ? 0 : 1;\n }\n\n const checkpoints = this.listCheckpoints(input.workspace);\n for (const checkpoint of checkpoints) {\n if (currentPaths.has(checkpoint.path) || checkpoint.deleted_at) {\n continue;\n }\n const op = await this.recordLocalCommitted({\n path: checkpoint.path,\n resource: resolveWorkspaceResource(input.workspace, checkpoint.path),\n source,\n sourcePath: path.join(input.cwd, checkpoint.path),\n contentType: contentTypeForPath(checkpoint.path),\n projection,\n type: 'deleted',\n sourceVersion: checkpoint.source_version ?? undefined,\n }, manifest);\n result.enqueued += op.stage === 'done' ? 0 : 1;\n }\n\n return result;\n }\n\n public async compact(): Promise<SolidFsJournalCompactResult> {\n const now = this.now();\n const rows = this.db.prepare<{\n id: string;\n workspace: string;\n path: string;\n op_type: SolidFsChange['type'];\n after_hash: string | null;\n stage: SolidFsSyncJournalStage;\n done_at: number | null;\n updated_at: number;\n tombstone_confirmed_at: number | null;\n }>(`\n SELECT id, workspace, path, op_type, after_hash, stage, done_at, updated_at, tombstone_confirmed_at\n FROM sync_ops\n WHERE stage IN ('done', 'failed_permanent')\n ORDER BY created_at ASC\n `).all();\n\n const deletable: string[] = [];\n for (const row of rows) {\n if (row.stage === 'failed_permanent') {\n if (row.updated_at <= now - this.failedPermanentRetentionMs) {\n deletable.push(row.id);\n }\n continue;\n }\n\n if (!row.done_at) {\n continue;\n }\n const checkpoint = this.getCheckpoint(row.workspace, row.path);\n if (!checkpoint) {\n continue;\n }\n if (row.op_type === 'deleted') {\n if (\n row.done_at <= now - this.tombstoneRetentionMs &&\n row.tombstone_confirmed_at &&\n checkpoint.deleted_at\n ) {\n deletable.push(row.id);\n }\n continue;\n }\n\n if (row.done_at <= now - this.doneRetentionMs && checkpoint.source_version === row.after_hash) {\n deletable.push(row.id);\n }\n }\n\n if (deletable.length === 0) {\n return { deletedOps: 0 };\n }\n\n this.db.transaction(() => {\n const deleteStatement = this.db.prepare('DELETE FROM sync_ops WHERE id = ?');\n for (const id of deletable) {\n deleteStatement.run(id);\n }\n })();\n\n return { deletedOps: deletable.length };\n }\n\n private async validateOperationForReplay(op: SolidFsSyncJournalOperation): Promise<string | undefined> {\n if (op.change.type === 'deleted') {\n return undefined;\n }\n\n const currentHash = await maybeFileVersion(op.change.sourcePath);\n if (!currentHash) {\n return `SolidFS journal source is missing: ${op.change.sourcePath}`;\n }\n if (op.afterHash && currentHash !== op.afterHash) {\n return `SolidFS journal source changed before replay: ${op.change.path}`;\n }\n return undefined;\n }\n\n private getCheckpoint(workspace: string, relativePath: string): CheckpointRow | undefined {\n return this.db.prepare<CheckpointRow>(`\n SELECT source_version, deleted_at\n FROM sync_checkpoints\n WHERE workspace = ? AND path = ?\n `).get(workspace, relativePath);\n }\n\n private listCheckpoints(workspace: string): Array<CheckpointRow & { path: string }> {\n return this.db.prepare<CheckpointRow & { path: string }>(`\n SELECT path, source_version, deleted_at\n FROM sync_checkpoints\n WHERE workspace = ?\n ORDER BY path ASC\n `).all(workspace);\n }\n\n private upsertCheckpoint(op: SolidFsSyncJournalOperation, now: number): void {\n if (op.change.type === 'deleted') {\n this.db.prepare(`\n INSERT INTO sync_checkpoints (workspace, path, source_version, deleted_at, updated_at, last_op_id)\n VALUES (?, ?, NULL, ?, ?, ?)\n ON CONFLICT(workspace, path) DO UPDATE SET\n source_version = NULL,\n deleted_at = excluded.deleted_at,\n updated_at = excluded.updated_at,\n last_op_id = excluded.last_op_id\n `).run(op.workspace.workspace, op.change.path, now, now, op.id);\n return;\n }\n\n this.db.prepare(`\n INSERT INTO sync_checkpoints (workspace, path, source_version, deleted_at, updated_at, last_op_id)\n VALUES (?, ?, ?, NULL, ?, ?)\n ON CONFLICT(workspace, path) DO UPDATE SET\n source_version = excluded.source_version,\n deleted_at = NULL,\n updated_at = excluded.updated_at,\n last_op_id = excluded.last_op_id\n `).run(op.workspace.workspace, op.change.path, op.afterHash ?? null, now, op.id);\n }\n\n private initializeSchema(): void {\n this.db.exec(`\n CREATE TABLE IF NOT EXISTS sync_ops (\n id TEXT PRIMARY KEY,\n tx_id TEXT,\n workspace TEXT NOT NULL,\n path TEXT NOT NULL,\n op_type TEXT NOT NULL,\n stage TEXT NOT NULL,\n source_path TEXT NOT NULL,\n resource TEXT,\n content_type TEXT,\n source TEXT NOT NULL,\n projection TEXT NOT NULL,\n source_version TEXT,\n after_hash TEXT,\n workspace_json TEXT NOT NULL,\n change_json TEXT NOT NULL,\n retry_count INTEGER NOT NULL DEFAULT 0,\n last_error TEXT,\n created_at INTEGER NOT NULL,\n updated_at INTEGER NOT NULL,\n done_at INTEGER,\n tombstone_confirmed_at INTEGER\n );\n\n CREATE INDEX IF NOT EXISTS sync_ops_stage_created_idx\n ON sync_ops(stage, created_at);\n CREATE INDEX IF NOT EXISTS sync_ops_workspace_path_idx\n ON sync_ops(workspace, path);\n\n CREATE TABLE IF NOT EXISTS sync_checkpoints (\n workspace TEXT NOT NULL,\n path TEXT NOT NULL,\n source_version TEXT,\n deleted_at INTEGER,\n updated_at INTEGER NOT NULL,\n last_op_id TEXT,\n PRIMARY KEY (workspace, path)\n );\n `);\n }\n}\n\nexport interface JournaledSolidFsSyncerOptions {\n syncer: SolidFsSyncer;\n journal: SqliteSolidFsSyncJournal;\n}\n\nexport interface WorkspaceJournaledSolidFsSyncerOptions {\n syncer: SolidFsSyncer;\n journalRoot?: string;\n resolveJournalPath?: (workspace: SolidFsManifest) => string;\n now?: () => number;\n doneRetentionMs?: number;\n tombstoneRetentionMs?: number;\n failedPermanentRetentionMs?: number;\n}\n\nexport class JournaledSolidFsSyncer implements SolidFsSyncer {\n private readonly syncer: SolidFsSyncer;\n private readonly journal: SqliteSolidFsSyncJournal;\n\n public constructor(options: JournaledSolidFsSyncerOptions) {\n this.syncer = options.syncer;\n this.journal = options.journal;\n }\n\n public shouldTrack(input: SolidFsPrepareInput): boolean {\n return this.syncer.shouldTrack?.(input) ?? true;\n }\n\n public shouldTrackPath(relativePath: string): boolean {\n return this.syncer.shouldTrackPath?.(relativePath) ?? isLineAddressableRdfPath(relativePath);\n }\n\n public async sync(change: SolidFsChange, workspace: SolidFsManifest, context?: unknown, txId?: string): Promise<void> {\n const op = await this.journal.recordLocalCommitted(change, workspace, txId);\n if (op.stage === 'done') {\n return;\n }\n\n try {\n await this.syncer.sync(change, workspace, context);\n await this.journal.markDone(op.id);\n } catch (error) {\n await this.journal.markRetryableFailure(op.id, error);\n throw error;\n }\n }\n\n public async replayPending(context?: unknown): Promise<SolidFsJournalReplayResult> {\n return this.journal.replayPending(this.syncer, context);\n }\n\n public async compact(): Promise<SolidFsJournalCompactResult> {\n return this.journal.compact();\n }\n\n public async bootstrapWorkspace(\n input: Omit<SolidFsJournalBootstrapInput, 'shouldTrackPath'> & {\n shouldTrackPath?: (relativePath: string) => boolean;\n },\n ): Promise<SolidFsJournalBootstrapResult> {\n return this.journal.bootstrapWorkspace({\n ...input,\n shouldTrackPath: input.shouldTrackPath ?? this.shouldTrackPath.bind(this),\n });\n }\n}\n\nexport class WorkspaceJournaledSolidFsSyncer implements SolidFsSyncer {\n private readonly syncer: SolidFsSyncer;\n private readonly journals = new Map<string, SqliteSolidFsSyncJournal>();\n\n public constructor(private readonly options: WorkspaceJournaledSolidFsSyncerOptions) {\n this.syncer = options.syncer;\n }\n\n public shouldTrack(input: SolidFsPrepareInput): boolean {\n return this.syncer.shouldTrack?.(input) ?? true;\n }\n\n public shouldTrackPath(relativePath: string): boolean {\n return this.syncer.shouldTrackPath?.(relativePath) ?? isLineAddressableRdfPath(relativePath);\n }\n\n public async initializeWorkspace(workspace: SolidFsManifest, context?: unknown): Promise<void> {\n const journal = this.journalFor(workspace);\n await journal.bootstrapWorkspace({\n workspace: workspace.workspace,\n cwd: workspace.cwd,\n projection: workspace.projection,\n source: sourceForProjection(workspace.projection, workspace.workspace),\n shouldTrackPath: this.shouldTrackPath.bind(this),\n });\n await journal.replayPending(this.syncer, context);\n await journal.compact();\n }\n\n public async sync(change: SolidFsChange, workspace: SolidFsManifest, context?: unknown, txId?: string): Promise<void> {\n const journal = this.journalFor(workspace);\n const op = await journal.recordLocalCommitted(change, workspace, txId);\n if (op.stage === 'done') {\n return;\n }\n\n try {\n await this.syncer.sync(change, workspace, context);\n await journal.markDone(op.id);\n } catch (error) {\n await journal.markRetryableFailure(op.id, error);\n throw error;\n }\n }\n\n public async replayPending(workspace: SolidFsManifest, context?: unknown): Promise<SolidFsJournalReplayResult> {\n return this.journalFor(workspace).replayPending(this.syncer, context);\n }\n\n public async compact(workspace: SolidFsManifest): Promise<SolidFsJournalCompactResult> {\n return this.journalFor(workspace).compact();\n }\n\n public journalPathFor(workspace: SolidFsManifest): string {\n return this.options.resolveJournalPath?.(workspace)\n ?? resolveSolidFsJournalPath(workspace, this.options.journalRoot ?? process.env.XPOD_SOLIDFS_JOURNAL_ROOT);\n }\n\n public close(): void {\n for (const journal of this.journals.values()) {\n journal.close();\n }\n this.journals.clear();\n }\n\n private journalFor(workspace: SolidFsManifest): SqliteSolidFsSyncJournal {\n const journalPath = this.journalPathFor(workspace);\n const existing = this.journals.get(journalPath);\n if (existing) {\n return existing;\n }\n\n const journal = new SqliteSolidFsSyncJournal({\n path: journalPath,\n now: this.options.now,\n doneRetentionMs: this.options.doneRetentionMs,\n tombstoneRetentionMs: this.options.tombstoneRetentionMs,\n failedPermanentRetentionMs: this.options.failedPermanentRetentionMs,\n });\n this.journals.set(journalPath, journal);\n return journal;\n }\n}\n\nexport function resolveSolidFsJournalPath(workspace: SolidFsManifest, journalRoot?: string): string {\n const root = journalRoot\n ? path.resolve(journalRoot)\n : path.join(path.dirname(path.resolve(workspace.cwd)), '.xpod-control', 'solidfs-journals');\n const basename = safeJournalSegment(path.basename(workspace.cwd) || 'workspace');\n const key = createHash('sha256')\n .update(workspace.workspace)\n .digest('hex')\n .slice(0, 16);\n return path.join(root, `${basename}-${key}`, 'sync-journal.sqlite');\n}\n\nfunction rowToOperation(row: SyncOpRow): SolidFsSyncJournalOperation {\n return {\n id: row.id,\n txId: row.tx_id ?? undefined,\n workspace: JSON.parse(row.workspace_json) as SolidFsManifest,\n change: JSON.parse(row.change_json) as SolidFsChange,\n stage: row.stage,\n afterHash: row.after_hash ?? undefined,\n retryCount: row.retry_count,\n lastError: row.last_error ?? undefined,\n createdAt: row.created_at,\n updatedAt: row.updated_at,\n doneAt: row.done_at ?? undefined,\n };\n}\n\nfunction journalWorkspaceSnapshot(workspace: SolidFsManifest): SolidFsManifest {\n return {\n workspace: workspace.workspace,\n cwd: workspace.cwd,\n projection: workspace.projection,\n entries: [],\n };\n}\n\nfunction normalizeChange(change: SolidFsChange): SolidFsChange {\n return {\n ...change,\n path: change.path.split(/[\\\\/]+/u).join(path.sep),\n previousPath: change.previousPath?.split(/[\\\\/]+/u).join(path.sep),\n };\n}\n\nfunction operationId(workspace: string, change: SolidFsChange, afterHash?: string): string {\n const digest = createHash('sha256')\n .update(JSON.stringify({\n workspace,\n path: change.path,\n previousPath: change.previousPath,\n prefix: change.prefix,\n previousPrefix: change.previousPrefix,\n type: change.type,\n resource: change.resource,\n previousResource: change.previousResource,\n source: change.source,\n sourcePath: change.sourcePath,\n projection: change.projection,\n sourceVersion: change.sourceVersion,\n afterHash,\n }))\n .digest('hex')\n .slice(0, 32);\n return `sync_${digest}`;\n}\n\nfunction safeJournalSegment(value: string): string {\n const safe = value.replace(/[^a-zA-Z0-9._-]+/gu, '_').slice(0, 64);\n return safe || 'workspace';\n}\n\nfunction errorMessage(error: unknown): string {\n if (error instanceof Error) {\n return error.message;\n }\n return String(error);\n}\n"]}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@undefineds.co/xpod/^0.0.0/components/context.jsonld"
|
|
4
|
+
],
|
|
5
|
+
"@id": "npmd:@undefineds.co/xpod",
|
|
6
|
+
"components": [
|
|
7
|
+
{
|
|
8
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal",
|
|
9
|
+
"@type": "Class",
|
|
10
|
+
"requireElement": "SqliteSolidFsSyncJournal",
|
|
11
|
+
"comment": "Per-Pod SolidFS recovery journal. This is an outbox for derived work after the authority file is already committed. It stores enough metadata to replay index/remote refreshes, but never stores file bodies.",
|
|
12
|
+
"parameters": [
|
|
13
|
+
{
|
|
14
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal_options",
|
|
15
|
+
"range": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SolidFsSyncJournalOptions"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"memberFields": [
|
|
19
|
+
{
|
|
20
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_db",
|
|
21
|
+
"memberFieldName": "db"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_now",
|
|
25
|
+
"memberFieldName": "now"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_doneRetentionMs",
|
|
29
|
+
"memberFieldName": "doneRetentionMs"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_tombstoneRetentionMs",
|
|
33
|
+
"memberFieldName": "tombstoneRetentionMs"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_failedPermanentRetentionMs",
|
|
37
|
+
"memberFieldName": "failedPermanentRetentionMs"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_constructor",
|
|
41
|
+
"memberFieldName": "constructor"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_close",
|
|
45
|
+
"memberFieldName": "close"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_recordLocalCommitted",
|
|
49
|
+
"memberFieldName": "recordLocalCommitted"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_getOperation",
|
|
53
|
+
"memberFieldName": "getOperation"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_listOperations",
|
|
57
|
+
"memberFieldName": "listOperations"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_listPending",
|
|
61
|
+
"memberFieldName": "listPending"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_markDone",
|
|
65
|
+
"memberFieldName": "markDone"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_markRetryableFailure",
|
|
69
|
+
"memberFieldName": "markRetryableFailure"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_markReconcileRequired",
|
|
73
|
+
"memberFieldName": "markReconcileRequired"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_markFailedPermanent",
|
|
77
|
+
"memberFieldName": "markFailedPermanent"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_replayPending",
|
|
81
|
+
"memberFieldName": "replayPending"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_bootstrapWorkspace",
|
|
85
|
+
"memberFieldName": "bootstrapWorkspace"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_compact",
|
|
89
|
+
"memberFieldName": "compact"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_validateOperationForReplay",
|
|
93
|
+
"memberFieldName": "validateOperationForReplay"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_getCheckpoint",
|
|
97
|
+
"memberFieldName": "getCheckpoint"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_listCheckpoints",
|
|
101
|
+
"memberFieldName": "listCheckpoints"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_upsertCheckpoint",
|
|
105
|
+
"memberFieldName": "upsertCheckpoint"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal__member_initializeSchema",
|
|
109
|
+
"memberFieldName": "initializeSchema"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"constructorArguments": [
|
|
113
|
+
{
|
|
114
|
+
"@id": "undefineds:dist/solidfs/SolidFsSyncJournal.jsonld#SqliteSolidFsSyncJournal_options"
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface WorkspaceSummaryPromptInput {
|
|
2
|
+
root: string;
|
|
3
|
+
authority: 'local-filesystem' | 'cloud-object-store';
|
|
4
|
+
files: number;
|
|
5
|
+
bylineLocalFiles: number;
|
|
6
|
+
remotePlaceholders: number;
|
|
7
|
+
hydratedRemoteObjects: number;
|
|
8
|
+
freeLocalCacheBytes?: number;
|
|
9
|
+
maxHydrateBytesWithoutConfirmation?: number;
|
|
10
|
+
tools: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function buildWorkspaceSemanticsPrompt(): string;
|
|
13
|
+
export declare function buildWorkspaceSummaryPrompt(input: WorkspaceSummaryPromptInput): string;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildWorkspaceSemanticsPrompt = buildWorkspaceSemanticsPrompt;
|
|
4
|
+
exports.buildWorkspaceSummaryPrompt = buildWorkspaceSummaryPrompt;
|
|
5
|
+
function buildWorkspaceSemanticsPrompt() {
|
|
6
|
+
return `## Workspace Semantics
|
|
7
|
+
|
|
8
|
+
You are operating inside an Xpod SolidFS materialized workspace.
|
|
9
|
+
|
|
10
|
+
- Directory entries are complete: \`ls\` and \`find\` show the workspace tree.
|
|
11
|
+
- Text/by-line files are materialized locally and can be read with normal tools.
|
|
12
|
+
- Large binary/media/remote-object files may appear as placeholders.
|
|
13
|
+
- Placeholder metadata is available through \`.meta\` and workspace tools.
|
|
14
|
+
- Do not assume placeholder bytes are the real content.
|
|
15
|
+
- Hydration has cost; inspect metadata before choosing metadata, thumbnail, range-read, or full hydration.
|
|
16
|
+
- Writes are tracked by the SolidFS journal and must be committed or rolled back by runtime.
|
|
17
|
+
- Search/vector/index artifacts are internal; use search/reader tools rather than looking for index files.
|
|
18
|
+
`;
|
|
19
|
+
}
|
|
20
|
+
function buildWorkspaceSummaryPrompt(input) {
|
|
21
|
+
return [
|
|
22
|
+
'## Current Workspace',
|
|
23
|
+
'',
|
|
24
|
+
`Root: ${promptValue(input.root)}`,
|
|
25
|
+
`Authority: ${input.authority}`,
|
|
26
|
+
`Files: ${input.files}`,
|
|
27
|
+
`Text/by-line local files: ${input.bylineLocalFiles}`,
|
|
28
|
+
`Remote placeholders: ${input.remotePlaceholders}`,
|
|
29
|
+
`Hydrated remote objects: ${input.hydratedRemoteObjects}`,
|
|
30
|
+
input.freeLocalCacheBytes === undefined ? undefined : `Free local cache bytes: ${input.freeLocalCacheBytes}`,
|
|
31
|
+
input.maxHydrateBytesWithoutConfirmation === undefined ? undefined : `Max hydrate bytes without confirmation: ${input.maxHydrateBytesWithoutConfirmation}`,
|
|
32
|
+
`Available tools: ${input.tools.map(promptValue).join(', ')}`,
|
|
33
|
+
'',
|
|
34
|
+
].filter((line) => line !== undefined).join('\n');
|
|
35
|
+
}
|
|
36
|
+
function promptValue(value) {
|
|
37
|
+
return (JSON.stringify(value) ?? '""').replace(/[\u0085\u2028\u2029]/g, escapeLogicalLineSeparator);
|
|
38
|
+
}
|
|
39
|
+
function escapeLogicalLineSeparator(char) {
|
|
40
|
+
return `\\u${char.charCodeAt(0).toString(16).toUpperCase().padStart(4, '0')}`;
|
|
41
|
+
}
|
|
42
|
+
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IAAY;IAC9C,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AAChF,CAAC","sourcesContent":["export interface WorkspaceSummaryPromptInput {\n root: string;\n authority: 'local-filesystem' | 'cloud-object-store';\n files: number;\n bylineLocalFiles: number;\n remotePlaceholders: number;\n hydratedRemoteObjects: number;\n freeLocalCacheBytes?: number;\n maxHydrateBytesWithoutConfirmation?: number;\n tools: string[];\n}\n\nexport function buildWorkspaceSemanticsPrompt(): string {\n return `## Workspace Semantics\n\nYou are operating inside an Xpod SolidFS materialized workspace.\n\n- Directory entries are complete: \\`ls\\` and \\`find\\` show the workspace tree.\n- Text/by-line files are materialized locally and can be read with normal tools.\n- Large binary/media/remote-object files may appear as placeholders.\n- Placeholder metadata is available through \\`.meta\\` and workspace tools.\n- Do not assume placeholder bytes are the real content.\n- Hydration has cost; inspect metadata before choosing metadata, thumbnail, range-read, or full hydration.\n- Writes are tracked by the SolidFS journal and must be committed or rolled back by runtime.\n- Search/vector/index artifacts are internal; use search/reader tools rather than looking for index files.\n`;\n}\n\nexport function buildWorkspaceSummaryPrompt(input: WorkspaceSummaryPromptInput): string {\n return [\n '## Current Workspace',\n '',\n `Root: ${promptValue(input.root)}`,\n `Authority: ${input.authority}`,\n `Files: ${input.files}`,\n `Text/by-line local files: ${input.bylineLocalFiles}`,\n `Remote placeholders: ${input.remotePlaceholders}`,\n `Hydrated remote objects: ${input.hydratedRemoteObjects}`,\n input.freeLocalCacheBytes === undefined ? undefined : `Free local cache bytes: ${input.freeLocalCacheBytes}`,\n input.maxHydrateBytesWithoutConfirmation === undefined ? undefined : `Max hydrate bytes without confirmation: ${input.maxHydrateBytesWithoutConfirmation}`,\n `Available tools: ${input.tools.map(promptValue).join(', ')}`,\n '',\n ].filter((line): line is string => line !== undefined).join('\\n');\n}\n\nfunction promptValue(value: string): string {\n return (JSON.stringify(value) ?? '\"\"').replace(/[\\u0085\\u2028\\u2029]/g, escapeLogicalLineSeparator);\n}\n\nfunction escapeLogicalLineSeparator(char: string): string {\n return `\\\\u${char.charCodeAt(0).toString(16).toUpperCase().padStart(4, '0')}`;\n}\n"]}
|
package/dist/solidfs/index.d.ts
CHANGED
|
@@ -4,5 +4,8 @@ export * from './PodSolidFsHttpClient';
|
|
|
4
4
|
export * from './PodSolidFsHydrator';
|
|
5
5
|
export * from './RdfIndexSolidFsSyncer';
|
|
6
6
|
export * from './PodSolidFsSyncer';
|
|
7
|
+
export * from './CompositeSolidFsSyncer';
|
|
7
8
|
export * from './LocalFirstRdfRepresentationResolver';
|
|
8
9
|
export * from './SolidFsSyncJournal';
|
|
10
|
+
export * from './SolidFsMetaNotes';
|
|
11
|
+
export * from './WorkspacePrompt';
|
package/dist/solidfs/index.js
CHANGED
|
@@ -20,6 +20,9 @@ __exportStar(require("./PodSolidFsHttpClient"), exports);
|
|
|
20
20
|
__exportStar(require("./PodSolidFsHydrator"), exports);
|
|
21
21
|
__exportStar(require("./RdfIndexSolidFsSyncer"), exports);
|
|
22
22
|
__exportStar(require("./PodSolidFsSyncer"), exports);
|
|
23
|
+
__exportStar(require("./CompositeSolidFsSyncer"), exports);
|
|
23
24
|
__exportStar(require("./LocalFirstRdfRepresentationResolver"), exports);
|
|
24
25
|
__exportStar(require("./SolidFsSyncJournal"), exports);
|
|
26
|
+
__exportStar(require("./SolidFsMetaNotes"), exports);
|
|
27
|
+
__exportStar(require("./WorkspacePrompt"), exports);
|
|
25
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/solidfs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,iDAA+B;AAC/B,yDAAuC;AACvC,uDAAqC;AACrC,0DAAwC;AACxC,qDAAmC;AACnC,wEAAsD;AACtD,uDAAqC","sourcesContent":["export * from './types';\nexport * from './LocalSolidFS';\nexport * from './PodSolidFsHttpClient';\nexport * from './PodSolidFsHydrator';\nexport * from './RdfIndexSolidFsSyncer';\nexport * from './PodSolidFsSyncer';\nexport * from './LocalFirstRdfRepresentationResolver';\nexport * from './SolidFsSyncJournal';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/solidfs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,iDAA+B;AAC/B,yDAAuC;AACvC,uDAAqC;AACrC,0DAAwC;AACxC,qDAAmC;AACnC,2DAAyC;AACzC,wEAAsD;AACtD,uDAAqC;AACrC,qDAAmC;AACnC,oDAAkC","sourcesContent":["export * from './types';\nexport * from './LocalSolidFS';\nexport * from './PodSolidFsHttpClient';\nexport * from './PodSolidFsHydrator';\nexport * from './RdfIndexSolidFsSyncer';\nexport * from './PodSolidFsSyncer';\nexport * from './CompositeSolidFsSyncer';\nexport * from './LocalFirstRdfRepresentationResolver';\nexport * from './SolidFsSyncJournal';\nexport * from './SolidFsMetaNotes';\nexport * from './WorkspacePrompt';\n"]}
|
package/dist/solidfs/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type SolidFsProjection = 'direct' | 'copy' | 'hydrated-object';
|
|
2
2
|
export type SolidFsEntrySource = 'filesystem' | 'pod-http' | 'object';
|
|
3
3
|
export type SolidFsEntryState = 'clean' | 'dirty' | 'committed' | 'conflict';
|
|
4
|
-
export type SolidFsChangeType = 'created' | 'updated' | 'deleted';
|
|
4
|
+
export type SolidFsChangeType = 'created' | 'updated' | 'deleted' | 'moved' | 'moved_prefix';
|
|
5
5
|
export interface SolidFsRunRef {
|
|
6
6
|
id?: string;
|
|
7
7
|
workspace?: string;
|
|
@@ -46,12 +46,22 @@ export interface SolidFsManifestEntry {
|
|
|
46
46
|
export interface SolidFsChange {
|
|
47
47
|
path: string;
|
|
48
48
|
resource?: string;
|
|
49
|
+
/** Previous local path for move operations. */
|
|
50
|
+
previousPath?: string;
|
|
51
|
+
/** Previous Solid resource URI for move operations. */
|
|
52
|
+
previousResource?: string;
|
|
53
|
+
/** Prefix source for moved_prefix operations. P1 only; P0 writers should not emit it. */
|
|
54
|
+
previousPrefix?: string;
|
|
55
|
+
/** Prefix target for moved_prefix operations. P1 only; P0 writers should not emit it. */
|
|
56
|
+
prefix?: string;
|
|
49
57
|
source: SolidFsEntrySource;
|
|
50
58
|
sourcePath: string;
|
|
51
59
|
contentType?: string;
|
|
52
60
|
projection: SolidFsProjection;
|
|
53
61
|
type: SolidFsChangeType;
|
|
54
62
|
sourceVersion?: string;
|
|
63
|
+
contentHash?: string;
|
|
64
|
+
projectionHints?: Record<string, unknown>;
|
|
55
65
|
}
|
|
56
66
|
export interface SolidFsManifest {
|
|
57
67
|
workspace: string;
|
|
@@ -97,7 +107,7 @@ export interface SolidFsSyncer {
|
|
|
97
107
|
shouldTrack?(input: SolidFsPrepareInput): boolean;
|
|
98
108
|
shouldTrackPath?(relativePath: string): boolean;
|
|
99
109
|
initializeWorkspace?(workspace: SolidFsManifest, context?: unknown): Promise<void>;
|
|
100
|
-
sync(change: SolidFsChange, workspace: SolidFsManifest, context?: unknown): Promise<void>;
|
|
110
|
+
sync(change: SolidFsChange, workspace: SolidFsManifest, context?: unknown, txId?: string): Promise<void>;
|
|
101
111
|
}
|
|
102
112
|
export interface SolidFsHydrateInput {
|
|
103
113
|
path: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/solidfs/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/solidfs/types.ts"],"names":[],"mappings":";;;AAuFA,MAAa,oBAAqB,SAAQ,KAAK;IAG7C,YAAmB,SAA4B;QAC7C,KAAK,CAAC,4BAA4B,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC3F,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CACF;AARD,oDAQC;AAED,MAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAmB,OAAe;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AALD,oDAKC","sourcesContent":["export type SolidFsProjection = 'direct' | 'copy' | 'hydrated-object';\nexport type SolidFsEntrySource = 'filesystem' | 'pod-http' | 'object';\n\nexport type SolidFsEntryState = 'clean' | 'dirty' | 'committed' | 'conflict';\nexport type SolidFsChangeType = 'created' | 'updated' | 'deleted' | 'moved' | 'moved_prefix';\n\nexport interface SolidFsRunRef {\n id?: string;\n workspace?: string;\n}\n\nexport interface SolidFsPrepareInput {\n run?: SolidFsRunRef;\n workspace: string;\n /**\n * Adapter-provided local source path for workspaces that are resolved by\n * the runner before SolidFS materializes them, such as Pod HTTPS containers.\n */\n sourcePath?: string;\n projection?: SolidFsProjection;\n /**\n * Opaque request/runtime context used by adapter syncers. SolidFS itself must\n * not inspect or persist this value because it can contain credentials.\n */\n context?: unknown;\n}\n\nexport interface SolidFsManifestEntry {\n path: string;\n resource?: string;\n source: SolidFsEntrySource;\n sourcePath: string;\n contentType?: string;\n projection: SolidFsProjection;\n /**\n * Opaque authority-side version token, such as an ETag, object version, RDF\n * revision, or filesystem hash. For local filesystem projections this can be\n * the same value used for dirty detection.\n */\n sourceVersion?: string;\n /**\n * Local working-copy version captured when the entry was materialized. This\n * lets hydrated objects keep an authority ETag in sourceVersion while still\n * detecting local edits by hashing the working file.\n */\n workingVersion?: string;\n lastAccessedAt?: number;\n state: SolidFsEntryState;\n}\n\nexport interface SolidFsChange {\n path: string;\n resource?: string;\n /** Previous local path for move operations. */\n previousPath?: string;\n /** Previous Solid resource URI for move operations. */\n previousResource?: string;\n /** Prefix source for moved_prefix operations. P1 only; P0 writers should not emit it. */\n previousPrefix?: string;\n /** Prefix target for moved_prefix operations. P1 only; P0 writers should not emit it. */\n prefix?: string;\n source: SolidFsEntrySource;\n sourcePath: string;\n contentType?: string;\n projection: SolidFsProjection;\n type: SolidFsChangeType;\n sourceVersion?: string;\n contentHash?: string;\n projectionHints?: Record<string, unknown>;\n}\n\nexport interface SolidFsManifest {\n workspace: string;\n cwd: string;\n projection: SolidFsProjection;\n entries: SolidFsManifestEntry[];\n changes?: SolidFsChange[];\n}\n\nexport interface SolidFsConflict {\n path: string;\n sourcePath: string;\n expectedVersion?: string;\n actualVersion?: string;\n message: string;\n}\n\nexport class SolidFsConflictError extends Error {\n public readonly conflicts: SolidFsConflict[];\n\n public constructor(conflicts: SolidFsConflict[]) {\n super(`SolidFS commit conflict: ${conflicts.map((conflict) => conflict.path).join(', ')}`);\n this.name = 'SolidFsConflictError';\n this.conflicts = conflicts;\n }\n}\n\nexport class SolidFsNotFoundError extends Error {\n public constructor(message: string) {\n super(message);\n this.name = 'SolidFsNotFoundError';\n }\n}\n\nexport interface MaterializedWorkspace {\n cwd: string;\n manifest: SolidFsManifest;\n /**\n * Materialize one object-backed resource into the real cwd. Implementations\n * without object hydration support can leave this undefined.\n */\n hydrate?(relativePath: string): Promise<SolidFsManifestEntry>;\n /**\n * Remove clean hydrated working copies that are no longer needed. Dirty files\n * must never be pruned.\n */\n prune?(options?: SolidFsPruneOptions): Promise<SolidFsManifest>;\n commit(): Promise<SolidFsManifest>;\n rollback(): Promise<void>;\n}\n\nexport interface SolidFS {\n prepare(input: SolidFsPrepareInput): Promise<MaterializedWorkspace>;\n}\n\nexport interface SolidFsSyncer {\n shouldTrack?(input: SolidFsPrepareInput): boolean;\n shouldTrackPath?(relativePath: string): boolean;\n initializeWorkspace?(workspace: SolidFsManifest, context?: unknown): Promise<void>;\n sync(change: SolidFsChange, workspace: SolidFsManifest, context?: unknown, txId?: string): Promise<void>;\n}\n\nexport interface SolidFsHydrateInput {\n path: string;\n targetPath: string;\n workspace: SolidFsManifest;\n context?: unknown;\n}\n\nexport interface SolidFsHydrateResult {\n contentType?: string;\n sourceVersion?: string;\n}\n\nexport interface SolidFsCommitHydratedInput {\n change: SolidFsChange;\n workspace: SolidFsManifest;\n context?: unknown;\n}\n\nexport interface SolidFsCommitHydratedResult {\n sourceVersion?: string;\n}\n\nexport interface SolidFsHydrator {\n hydrate(input: SolidFsHydrateInput): Promise<SolidFsHydrateResult | void>;\n commit(input: SolidFsCommitHydratedInput): Promise<SolidFsCommitHydratedResult | void>;\n delete?(input: SolidFsCommitHydratedInput): Promise<void>;\n}\n\nexport interface SolidFsPruneOptions {\n /**\n * Prune clean hydrated files not accessed for at least this many ms.\n * Defaults to 0, meaning any clean hydrated file is eligible.\n */\n olderThanMs?: number;\n now?: number;\n}\n"]}
|