@undefineds.co/xpod 0.3.58 → 0.3.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/config/cli.json +88 -0
- package/config/cloud.json +32 -1
- package/config/components-ignore.json +3 -0
- package/config/extensions.local.initializer.json +44 -0
- package/config/resolver.json +86 -0
- package/config/xpod.base.json +4 -0
- package/dist/agents/AgentExecutorFactory.d.ts +3 -3
- package/dist/agents/AgentExecutorFactory.js +28 -15
- package/dist/agents/AgentExecutorFactory.js.map +1 -1
- package/dist/agents/BaseAgentExecutor.d.ts +2 -1
- package/dist/agents/BaseAgentExecutor.js +1 -0
- package/dist/agents/BaseAgentExecutor.js.map +1 -1
- package/dist/agents/ClaudeExecutor.d.ts +3 -1
- package/dist/agents/ClaudeExecutor.js +18 -12
- package/dist/agents/ClaudeExecutor.js.map +1 -1
- package/dist/agents/config/resolve.js +0 -21
- package/dist/agents/config/resolve.js.map +1 -1
- package/dist/agents/config/types.d.ts +2 -7
- package/dist/agents/config/types.js +2 -1
- package/dist/agents/config/types.js.map +1 -1
- package/dist/agents/types.d.ts +18 -0
- package/dist/agents/types.js.map +1 -1
- package/dist/ai/schema/types.d.ts +2 -1
- package/dist/ai/schema/types.js +1 -0
- package/dist/ai/schema/types.js.map +1 -1
- package/dist/ai/service/CredentialReader.d.ts +3 -1
- package/dist/ai/service/CredentialReader.js.map +1 -1
- package/dist/ai/service/CredentialReaderImpl.d.ts +3 -1
- package/dist/ai/service/CredentialReaderImpl.js +24 -2
- package/dist/ai/service/CredentialReaderImpl.js.map +1 -1
- package/dist/ai/service/EmbeddingServiceImpl.js +13 -2
- package/dist/ai/service/EmbeddingServiceImpl.js.map +1 -1
- package/dist/ai/service/ProviderRegistry.d.ts +4 -0
- package/dist/ai/service/ProviderRegistry.js.map +1 -1
- package/dist/ai/service/ProviderRegistry.jsonld +4 -0
- package/dist/ai/service/ProviderRegistryImpl.d.ts +4 -1
- package/dist/ai/service/ProviderRegistryImpl.js +26 -4
- package/dist/ai/service/ProviderRegistryImpl.js.map +1 -1
- package/dist/ai/service/ProviderRegistryImpl.jsonld +12 -0
- package/dist/ai/service/defaultEmbeddingProfile.d.ts +5 -0
- package/dist/ai/service/defaultEmbeddingProfile.js +31 -0
- package/dist/ai/service/defaultEmbeddingProfile.js.map +1 -0
- package/dist/ai/service/index.d.ts +1 -0
- package/dist/ai/service/index.js +1 -0
- package/dist/ai/service/index.js.map +1 -1
- package/dist/ai/service/types.d.ts +1 -0
- package/dist/ai/service/types.js.map +1 -1
- package/dist/api/ApiServer.js +17 -2
- package/dist/api/ApiServer.js.map +1 -1
- package/dist/api/ai-gateway/AiGatewayService.d.ts +106 -0
- package/dist/api/ai-gateway/AiGatewayService.js +527 -0
- package/dist/api/ai-gateway/AiGatewayService.js.map +1 -0
- package/dist/api/ai-gateway/auth/AiConnectionInvocationKeyIssuer.d.ts +38 -0
- package/dist/api/ai-gateway/auth/AiConnectionInvocationKeyIssuer.js +128 -0
- package/dist/api/ai-gateway/auth/AiConnectionInvocationKeyIssuer.js.map +1 -0
- package/dist/api/ai-gateway/auth/ClientCredentialsInternalPodAccessTokenProvider.d.ts +25 -0
- package/dist/api/ai-gateway/auth/ClientCredentialsInternalPodAccessTokenProvider.js +91 -0
- package/dist/api/ai-gateway/auth/ClientCredentialsInternalPodAccessTokenProvider.js.map +1 -0
- package/dist/api/ai-gateway/auth/GatewayApiKey.d.ts +28 -0
- package/dist/api/ai-gateway/auth/GatewayApiKey.js +162 -0
- package/dist/api/ai-gateway/auth/GatewayApiKey.js.map +1 -0
- package/dist/api/ai-gateway/auth/GatewayApiKeyAuthenticator.d.ts +56 -0
- package/dist/api/ai-gateway/auth/GatewayApiKeyAuthenticator.js +143 -0
- package/dist/api/ai-gateway/auth/GatewayApiKeyAuthenticator.js.map +1 -0
- package/dist/api/ai-gateway/auth/GatewayKeyLocatorCodec.d.ts +26 -0
- package/dist/api/ai-gateway/auth/GatewayKeyLocatorCodec.js +97 -0
- package/dist/api/ai-gateway/auth/GatewayKeyLocatorCodec.js.map +1 -0
- package/dist/api/ai-gateway/auth/GatewayPrincipal.d.ts +20 -0
- package/dist/api/ai-gateway/auth/GatewayPrincipal.js +37 -0
- package/dist/api/ai-gateway/auth/GatewayPrincipal.js.map +1 -0
- package/dist/api/ai-gateway/auth/InvocationTokenCodec.d.ts +41 -0
- package/dist/api/ai-gateway/auth/InvocationTokenCodec.js +221 -0
- package/dist/api/ai-gateway/auth/InvocationTokenCodec.js.map +1 -0
- package/dist/api/ai-gateway/auth/PodGatewayAccessKeyRepository.d.ts +54 -0
- package/dist/api/ai-gateway/auth/PodGatewayAccessKeyRepository.js +152 -0
- package/dist/api/ai-gateway/auth/PodGatewayAccessKeyRepository.js.map +1 -0
- package/dist/api/ai-gateway/connect/index.d.ts +367 -0
- package/dist/api/ai-gateway/connect/index.js +1061 -0
- package/dist/api/ai-gateway/connect/index.js.map +1 -0
- package/dist/api/ai-gateway/credentials/CloudKmsWrapper.d.ts +40 -0
- package/dist/api/ai-gateway/credentials/CloudKmsWrapper.js +59 -0
- package/dist/api/ai-gateway/credentials/CloudKmsWrapper.js.map +1 -0
- package/dist/api/ai-gateway/credentials/CredentialVault.d.ts +14 -0
- package/dist/api/ai-gateway/credentials/CredentialVault.js +11 -0
- package/dist/api/ai-gateway/credentials/CredentialVault.js.map +1 -0
- package/dist/api/ai-gateway/credentials/KeyWrapper.d.ts +27 -0
- package/dist/api/ai-gateway/credentials/KeyWrapper.js +3 -0
- package/dist/api/ai-gateway/credentials/KeyWrapper.js.map +1 -0
- package/dist/api/ai-gateway/credentials/LocalKeychainWrapper.d.ts +27 -0
- package/dist/api/ai-gateway/credentials/LocalKeychainWrapper.js +145 -0
- package/dist/api/ai-gateway/credentials/LocalKeychainWrapper.js.map +1 -0
- package/dist/api/ai-gateway/credentials/SecretCellCredentialVault.d.ts +13 -0
- package/dist/api/ai-gateway/credentials/SecretCellCredentialVault.js +133 -0
- package/dist/api/ai-gateway/credentials/SecretCellCredentialVault.js.map +1 -0
- package/dist/api/ai-gateway/credentials/SecretCellKeyWrapper.d.ts +23 -0
- package/dist/api/ai-gateway/credentials/SecretCellKeyWrapper.js +62 -0
- package/dist/api/ai-gateway/credentials/SecretCellKeyWrapper.js.map +1 -0
- package/dist/api/ai-gateway/credentials/WebCryptoCredentialVault.d.ts +23 -0
- package/dist/api/ai-gateway/credentials/WebCryptoCredentialVault.js +173 -0
- package/dist/api/ai-gateway/credentials/WebCryptoCredentialVault.js.map +1 -0
- package/dist/api/ai-gateway/errors.d.ts +21 -0
- package/dist/api/ai-gateway/errors.js +50 -0
- package/dist/api/ai-gateway/errors.js.map +1 -0
- package/dist/api/ai-gateway/protocol/ChatCompletionsFrontend.d.ts +6 -0
- package/dist/api/ai-gateway/protocol/ChatCompletionsFrontend.js +111 -0
- package/dist/api/ai-gateway/protocol/ChatCompletionsFrontend.js.map +1 -0
- package/dist/api/ai-gateway/protocol/MessagesFrontend.d.ts +6 -0
- package/dist/api/ai-gateway/protocol/MessagesFrontend.js +99 -0
- package/dist/api/ai-gateway/protocol/MessagesFrontend.js.map +1 -0
- package/dist/api/ai-gateway/protocol/ResponsesFrontend.d.ts +6 -0
- package/dist/api/ai-gateway/protocol/ResponsesFrontend.js +232 -0
- package/dist/api/ai-gateway/protocol/ResponsesFrontend.js.map +1 -0
- package/dist/api/ai-gateway/protocol/index.d.ts +3 -0
- package/dist/api/ai-gateway/protocol/index.js +10 -0
- package/dist/api/ai-gateway/protocol/index.js.map +1 -0
- package/dist/api/ai-gateway/providers/AnthropicRuntimeAdapter.d.ts +7 -0
- package/dist/api/ai-gateway/providers/AnthropicRuntimeAdapter.js +37 -0
- package/dist/api/ai-gateway/providers/AnthropicRuntimeAdapter.js.map +1 -0
- package/dist/api/ai-gateway/providers/BailianRuntimeAdapter.d.ts +9 -0
- package/dist/api/ai-gateway/providers/BailianRuntimeAdapter.js +127 -0
- package/dist/api/ai-gateway/providers/BailianRuntimeAdapter.js.map +1 -0
- package/dist/api/ai-gateway/providers/DeepSeekRuntimeAdapter.d.ts +8 -0
- package/dist/api/ai-gateway/providers/DeepSeekRuntimeAdapter.js +47 -0
- package/dist/api/ai-gateway/providers/DeepSeekRuntimeAdapter.js.map +1 -0
- package/dist/api/ai-gateway/providers/KimiRuntimeAdapter.d.ts +8 -0
- package/dist/api/ai-gateway/providers/KimiRuntimeAdapter.js +57 -0
- package/dist/api/ai-gateway/providers/KimiRuntimeAdapter.js.map +1 -0
- package/dist/api/ai-gateway/providers/OpenAiCompatibleRuntimeAdapter.d.ts +1 -0
- package/dist/api/ai-gateway/providers/OpenAiCompatibleRuntimeAdapter.js +6 -0
- package/dist/api/ai-gateway/providers/OpenAiCompatibleRuntimeAdapter.js.map +1 -0
- package/dist/api/ai-gateway/providers/OpenAiRuntimeAdapter.d.ts +13 -0
- package/dist/api/ai-gateway/providers/OpenAiRuntimeAdapter.js +34 -0
- package/dist/api/ai-gateway/providers/OpenAiRuntimeAdapter.js.map +1 -0
- package/dist/api/ai-gateway/providers/ProviderRegistry.d.ts +68 -0
- package/dist/api/ai-gateway/providers/ProviderRegistry.js +288 -0
- package/dist/api/ai-gateway/providers/ProviderRegistry.js.map +1 -0
- package/dist/api/ai-gateway/providers/ProviderRuntimeAdapter.d.ts +88 -0
- package/dist/api/ai-gateway/providers/ProviderRuntimeAdapter.js +645 -0
- package/dist/api/ai-gateway/providers/ProviderRuntimeAdapter.js.map +1 -0
- package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.d.ts +13 -0
- package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.js +48 -0
- package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.js.map +1 -0
- package/dist/api/ai-gateway/providers/index.d.ts +9 -0
- package/dist/api/ai-gateway/providers/index.js +26 -0
- package/dist/api/ai-gateway/providers/index.js.map +1 -0
- package/dist/api/ai-gateway/quota/AnthropicQuotaAdapter.d.ts +5 -0
- package/dist/api/ai-gateway/quota/AnthropicQuotaAdapter.js +21 -0
- package/dist/api/ai-gateway/quota/AnthropicQuotaAdapter.js.map +1 -0
- package/dist/api/ai-gateway/quota/BailianQuotaAdapter.d.ts +5 -0
- package/dist/api/ai-gateway/quota/BailianQuotaAdapter.js +21 -0
- package/dist/api/ai-gateway/quota/BailianQuotaAdapter.js.map +1 -0
- package/dist/api/ai-gateway/quota/DeepSeekQuotaAdapter.d.ts +10 -0
- package/dist/api/ai-gateway/quota/DeepSeekQuotaAdapter.js +83 -0
- package/dist/api/ai-gateway/quota/DeepSeekQuotaAdapter.js.map +1 -0
- package/dist/api/ai-gateway/quota/KimiQuotaAdapter.d.ts +10 -0
- package/dist/api/ai-gateway/quota/KimiQuotaAdapter.js +70 -0
- package/dist/api/ai-gateway/quota/KimiQuotaAdapter.js.map +1 -0
- package/dist/api/ai-gateway/quota/OpenAiQuotaAdapter.d.ts +5 -0
- package/dist/api/ai-gateway/quota/OpenAiQuotaAdapter.js +21 -0
- package/dist/api/ai-gateway/quota/OpenAiQuotaAdapter.js.map +1 -0
- package/dist/api/ai-gateway/quota/ProviderQuotaAdapter.d.ts +214 -0
- package/dist/api/ai-gateway/quota/ProviderQuotaAdapter.js +511 -0
- package/dist/api/ai-gateway/quota/ProviderQuotaAdapter.js.map +1 -0
- package/dist/api/ai-gateway/quota/index.d.ts +6 -0
- package/dist/api/ai-gateway/quota/index.js +23 -0
- package/dist/api/ai-gateway/quota/index.js.map +1 -0
- package/dist/api/ai-gateway/routing/InMemorySessionAffinityStore.d.ts +26 -0
- package/dist/api/ai-gateway/routing/InMemorySessionAffinityStore.js +67 -0
- package/dist/api/ai-gateway/routing/InMemorySessionAffinityStore.js.map +1 -0
- package/dist/api/ai-gateway/routing/ModelRouter.d.ts +84 -0
- package/dist/api/ai-gateway/routing/ModelRouter.js +274 -0
- package/dist/api/ai-gateway/routing/ModelRouter.js.map +1 -0
- package/dist/api/ai-gateway/routing/RedisSessionAffinityStore.d.ts +39 -0
- package/dist/api/ai-gateway/routing/RedisSessionAffinityStore.js +122 -0
- package/dist/api/ai-gateway/routing/RedisSessionAffinityStore.js.map +1 -0
- package/dist/api/ai-gateway/routing/SessionAffinityStore.d.ts +49 -0
- package/dist/api/ai-gateway/routing/SessionAffinityStore.js +66 -0
- package/dist/api/ai-gateway/routing/SessionAffinityStore.js.map +1 -0
- package/dist/api/ai-gateway/service-access/AiConnectionServiceAccess.d.ts +25 -0
- package/dist/api/ai-gateway/service-access/AiConnectionServiceAccess.js +50 -0
- package/dist/api/ai-gateway/service-access/AiConnectionServiceAccess.js.map +1 -0
- package/dist/api/ai-gateway/types.d.ts +112 -0
- package/dist/api/ai-gateway/types.js +305 -0
- package/dist/api/ai-gateway/types.js.map +1 -0
- package/dist/api/auth/AuthContext.d.ts +18 -3
- package/dist/api/auth/AuthContext.js +13 -2
- package/dist/api/auth/AuthContext.js.map +1 -1
- package/dist/api/auth/Authenticator.d.ts +3 -0
- package/dist/api/auth/Authenticator.js.map +1 -1
- package/dist/api/auth/ClientCredentialsAuthenticator.d.ts +2 -6
- package/dist/api/auth/ClientCredentialsAuthenticator.js +12 -30
- package/dist/api/auth/ClientCredentialsAuthenticator.js.map +1 -1
- package/dist/api/auth/SolidTokenAuthenticator.d.ts +2 -0
- package/dist/api/auth/SolidTokenAuthenticator.js +88 -2
- package/dist/api/auth/SolidTokenAuthenticator.js.map +1 -1
- package/dist/api/auth/TokenIdentity.d.ts +6 -0
- package/dist/api/auth/TokenIdentity.js +31 -0
- package/dist/api/auth/TokenIdentity.js.map +1 -0
- package/dist/api/chatkit/ai-provider.d.ts +9 -23
- package/dist/api/chatkit/ai-provider.js +30 -153
- package/dist/api/chatkit/ai-provider.js.map +1 -1
- package/dist/api/chatkit/default-agent.d.ts +24 -15
- package/dist/api/chatkit/default-agent.js +24 -83
- package/dist/api/chatkit/default-agent.js.map +1 -1
- package/dist/api/chatkit/index.d.ts +2 -1
- package/dist/api/chatkit/index.js +3 -1
- package/dist/api/chatkit/index.js.map +1 -1
- package/dist/api/chatkit/pod-store.d.ts +13 -1
- package/dist/api/chatkit/pod-store.js +127 -7
- package/dist/api/chatkit/pod-store.js.map +1 -1
- package/dist/api/chatkit/runtime/AcpAgentRuntime.d.ts +0 -1
- package/dist/api/chatkit/runtime/AcpAgentRuntime.js +14 -51
- package/dist/api/chatkit/runtime/AcpAgentRuntime.js.map +1 -1
- package/dist/api/chatkit/runtime/AcpRunner.js +2 -1
- package/dist/api/chatkit/runtime/AcpRunner.js.map +1 -1
- package/dist/api/chatkit/runtime/CodexRuntimeProjector.d.ts +15 -1
- package/dist/api/chatkit/runtime/CodexRuntimeProjector.js +52 -34
- package/dist/api/chatkit/runtime/CodexRuntimeProjector.js.map +1 -1
- package/dist/api/chatkit/service.d.ts +8 -1
- package/dist/api/chatkit/service.js +46 -5
- package/dist/api/chatkit/service.js.map +1 -1
- package/dist/api/chatkit/store.d.ts +23 -1
- package/dist/api/chatkit/store.js +56 -0
- package/dist/api/chatkit/store.js.map +1 -1
- package/dist/api/chatkit/types.d.ts +1 -0
- package/dist/api/chatkit/types.js.map +1 -1
- package/dist/api/container/common.js +286 -13
- package/dist/api/container/common.js.map +1 -1
- package/dist/api/container/index.js +126 -6
- package/dist/api/container/index.js.map +1 -1
- package/dist/api/container/local.js +50 -6
- package/dist/api/container/local.js.map +1 -1
- package/dist/api/container/rdf.d.ts +15 -0
- package/dist/api/container/rdf.js +90 -0
- package/dist/api/container/rdf.js.map +1 -0
- package/dist/api/container/routes.js +151 -11
- package/dist/api/container/routes.js.map +1 -1
- package/dist/api/container/types.d.ts +96 -0
- package/dist/api/container/types.js.map +1 -1
- package/dist/api/handlers/AdminHandler.d.ts +25 -2
- package/dist/api/handlers/AdminHandler.js +60 -10
- package/dist/api/handlers/AdminHandler.js.map +1 -1
- package/dist/api/handlers/AiClientConfigurationHandler.d.ts +7 -0
- package/dist/api/handlers/AiClientConfigurationHandler.js +202 -0
- package/dist/api/handlers/AiClientConfigurationHandler.js.map +1 -0
- package/dist/api/handlers/AiGatewayHandler.d.ts +23 -0
- package/dist/api/handlers/AiGatewayHandler.js +231 -0
- package/dist/api/handlers/AiGatewayHandler.js.map +1 -0
- package/dist/api/handlers/AiGatewayManagementHandler.d.ts +24 -0
- package/dist/api/handlers/AiGatewayManagementHandler.js +503 -0
- package/dist/api/handlers/AiGatewayManagementHandler.js.map +1 -0
- package/dist/api/handlers/ChatHandler.d.ts +11 -12
- package/dist/api/handlers/ChatHandler.js +12 -219
- package/dist/api/handlers/ChatHandler.js.map +1 -1
- package/dist/api/handlers/DashboardHandler.js +22 -116
- package/dist/api/handlers/DashboardHandler.js.map +1 -1
- package/dist/api/handlers/NetworkSettingsHandler.d.ts +97 -0
- package/dist/api/handlers/NetworkSettingsHandler.js +511 -0
- package/dist/api/handlers/NetworkSettingsHandler.js.map +1 -0
- package/dist/api/handlers/PodSettingsHandler.d.ts +79 -0
- package/dist/api/handlers/PodSettingsHandler.js +162 -0
- package/dist/api/handlers/PodSettingsHandler.js.map +1 -0
- package/dist/api/handlers/ProvisionHandler.d.ts +3 -1
- package/dist/api/handlers/ProvisionHandler.js +22 -87
- package/dist/api/handlers/ProvisionHandler.js.map +1 -1
- package/dist/api/handlers/RdfStatsHandler.d.ts +6 -0
- package/dist/api/handlers/RdfStatsHandler.js +85 -0
- package/dist/api/handlers/RdfStatsHandler.js.map +1 -0
- package/dist/api/handlers/SettingsHandler.d.ts +5 -0
- package/dist/api/handlers/SettingsHandler.js +13 -0
- package/dist/api/handlers/SettingsHandler.js.map +1 -0
- package/dist/api/handlers/StaticSpaHandler.d.ts +8 -0
- package/dist/api/handlers/StaticSpaHandler.js +102 -0
- package/dist/api/handlers/StaticSpaHandler.js.map +1 -0
- package/dist/api/handlers/index.d.ts +1 -0
- package/dist/api/handlers/index.js +1 -0
- package/dist/api/handlers/index.js.map +1 -1
- package/dist/api/http/readBoundedJsonBody.d.ts +14 -0
- package/dist/api/http/readBoundedJsonBody.js +58 -0
- package/dist/api/http/readBoundedJsonBody.js.map +1 -0
- package/dist/api/middleware/AuthMiddleware.d.ts +1 -0
- package/dist/api/middleware/AuthMiddleware.js +33 -4
- package/dist/api/middleware/AuthMiddleware.js.map +1 -1
- package/dist/api/runs/AgentRuntimeTypes.d.ts +18 -3
- package/dist/api/runs/AgentRuntimeTypes.js +61 -0
- package/dist/api/runs/AgentRuntimeTypes.js.map +1 -1
- package/dist/api/runs/InngestRunExecutionBackend.d.ts +28 -3
- package/dist/api/runs/InngestRunExecutionBackend.js +26 -3
- package/dist/api/runs/InngestRunExecutionBackend.js.map +1 -1
- package/dist/api/runs/ManagedRunWorker.d.ts +4 -1
- package/dist/api/runs/ManagedRunWorker.js +39 -8
- package/dist/api/runs/ManagedRunWorker.js.map +1 -1
- package/dist/api/runs/PiAgentRuntimeDriver.d.ts +5 -1
- package/dist/api/runs/PiAgentRuntimeDriver.js +94 -57
- package/dist/api/runs/PiAgentRuntimeDriver.js.map +1 -1
- package/dist/api/runs/RdfRunContextRetriever.d.ts +46 -0
- package/dist/api/runs/RdfRunContextRetriever.js +277 -0
- package/dist/api/runs/RdfRunContextRetriever.js.map +1 -0
- package/dist/api/runs/RunExecutionBackend.d.ts +38 -0
- package/dist/api/runs/RunExecutionBackend.js.map +1 -1
- package/dist/api/runs/RunStateCenter.d.ts +18 -3
- package/dist/api/runs/RunStateCenter.js +85 -24
- package/dist/api/runs/RunStateCenter.js.map +1 -1
- package/dist/api/runtime.js +163 -3
- package/dist/api/runtime.js.map +1 -1
- package/dist/api/service/AiClientConfigurationService.d.ts +97 -0
- package/dist/api/service/AiClientConfigurationService.js +379 -0
- package/dist/api/service/AiClientConfigurationService.js.map +1 -0
- package/dist/api/service/RdfBenchmarkReportCatalog.d.ts +86 -0
- package/dist/api/service/RdfBenchmarkReportCatalog.js +349 -0
- package/dist/api/service/RdfBenchmarkReportCatalog.js.map +1 -0
- package/dist/api/service/RdfBenchmarkReportGate.d.ts +78 -0
- package/dist/api/service/RdfBenchmarkReportGate.js +197 -0
- package/dist/api/service/RdfBenchmarkReportGate.js.map +1 -0
- package/dist/api/service/RdfSearchIndexingService.d.ts +113 -0
- package/dist/api/service/RdfSearchIndexingService.js +272 -0
- package/dist/api/service/RdfSearchIndexingService.js.map +1 -0
- package/dist/api/service/RdfSearchIndexingSolidFsSyncer.d.ts +27 -0
- package/dist/api/service/RdfSearchIndexingSolidFsSyncer.js +90 -0
- package/dist/api/service/RdfSearchIndexingSolidFsSyncer.js.map +1 -0
- package/dist/api/service/RdfStorageStatsService.d.ts +31 -0
- package/dist/api/service/RdfStorageStatsService.js +97 -0
- package/dist/api/service/RdfStorageStatsService.js.map +1 -0
- package/dist/api/service/VectorStoreService.d.ts +2 -0
- package/dist/api/service/VectorStoreService.js +70 -2
- package/dist/api/service/VectorStoreService.js.map +1 -1
- package/dist/api/service/VercelChatService.d.ts +27 -38
- package/dist/api/service/VercelChatService.js +153 -505
- package/dist/api/service/VercelChatService.js.map +1 -1
- package/dist/api/service/provider-http-transport.d.ts +21 -0
- package/dist/api/service/provider-http-transport.js +108 -2
- package/dist/api/service/provider-http-transport.js.map +1 -1
- package/dist/api/service/provider-registry.d.ts +5 -7
- package/dist/api/service/provider-registry.js +81 -64
- package/dist/api/service/provider-registry.js.map +1 -1
- package/dist/api/tasks/InngestTaskScheduler.d.ts +44 -4
- package/dist/api/tasks/TaskMaterializer.d.ts +10 -1
- package/dist/api/tasks/TaskMaterializer.js +39 -4
- package/dist/api/tasks/TaskMaterializer.js.map +1 -1
- package/dist/api/tasks/TaskService.d.ts +5 -1
- package/dist/api/tasks/TaskService.js +3 -0
- package/dist/api/tasks/TaskService.js.map +1 -1
- package/dist/cli/commands/rdf.d.ts +9 -0
- package/dist/cli/commands/rdf.js +66 -1
- package/dist/cli/commands/rdf.js.map +1 -1
- package/dist/cli/commands/start.js +3 -0
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/lib/solid-auth.d.ts +3 -3
- package/dist/cli/lib/solid-auth.js +4 -4
- package/dist/cli/lib/solid-auth.js.map +1 -1
- package/dist/components/components.jsonld +16 -0
- package/dist/components/context.jsonld +815 -28
- package/dist/document/Chunker.jsonld +110 -0
- package/dist/document/{DocumentParser.d.ts → DocumentReader.d.ts} +23 -11
- package/dist/document/{DocumentParser.js → DocumentReader.js} +2 -2
- package/dist/document/DocumentReader.js.map +1 -0
- package/dist/document/DocumentReader.jsonld +82 -0
- package/dist/document/HeadingChunker.jsonld +41 -0
- package/dist/document/{JinaDocumentParser.d.ts → JinaReader.d.ts} +7 -7
- package/dist/document/{JinaDocumentParser.js → JinaReader.js} +12 -12
- package/dist/document/JinaReader.js.map +1 -0
- package/dist/document/JinaReader.jsonld +133 -0
- package/dist/document/L0SourceSummary.d.ts +103 -0
- package/dist/document/L0SourceSummary.js +157 -0
- package/dist/document/L0SourceSummary.js.map +1 -0
- package/dist/document/L0SourceSummary.jsonld +326 -0
- package/dist/document/PaddleOcrReader.d.ts +40 -0
- package/dist/document/PaddleOcrReader.js +53 -0
- package/dist/document/PaddleOcrReader.js.map +1 -0
- package/dist/document/PaddleOcrReader.jsonld +234 -0
- package/dist/document/ReaderAiConfig.d.ts +50 -0
- package/dist/document/ReaderAiConfig.js +109 -0
- package/dist/document/ReaderAiConfig.js.map +1 -0
- package/dist/document/ReaderAiConfig.jsonld +185 -0
- package/dist/document/ReaderPolicy.d.ts +89 -0
- package/dist/document/ReaderPolicy.js +158 -0
- package/dist/document/ReaderPolicy.js.map +1 -0
- package/dist/document/ReaderPolicy.jsonld +218 -0
- package/dist/document/index.d.ts +6 -2
- package/dist/document/index.js +6 -2
- package/dist/document/index.js.map +1 -1
- package/dist/edge/DdnsManager.d.ts +1 -1
- package/dist/edge/DdnsManager.js.map +1 -1
- package/dist/edge/EdgeNodeAgent.d.ts +4 -0
- package/dist/edge/EdgeNodeAgent.js +6 -0
- package/dist/edge/EdgeNodeAgent.js.map +1 -1
- package/dist/edge/EdgeNodeAgent.jsonld +8 -0
- package/dist/edge/EdgeNodeAgentInitializer.d.ts +16 -0
- package/dist/edge/EdgeNodeAgentInitializer.js +51 -0
- package/dist/edge/EdgeNodeAgentInitializer.js.map +1 -1
- package/dist/edge/EdgeNodeAgentInitializer.jsonld +250 -0
- package/dist/edge/EdgeNodeCertificateCapabilityBridge.d.ts +34 -0
- package/dist/edge/EdgeNodeCertificateCapabilityBridge.js +111 -0
- package/dist/edge/EdgeNodeCertificateCapabilityBridge.js.map +1 -0
- package/dist/edge/acme/AcmeCertificateManager.d.ts +14 -1
- package/dist/edge/acme/AcmeCertificateManager.js +67 -7
- package/dist/edge/acme/AcmeCertificateManager.js.map +1 -1
- package/dist/edge/acme/AcmeCertificateManager.jsonld +22 -2
- package/dist/edge/acme/ClusterCertificateManager.d.ts +12 -0
- package/dist/edge/acme/ClusterCertificateManager.js +38 -0
- package/dist/edge/acme/ClusterCertificateManager.js.map +1 -1
- package/dist/extensions/ExtensionRuntime.d.ts +17 -0
- package/dist/extensions/ExtensionRuntime.js +171 -0
- package/dist/extensions/ExtensionRuntime.js.map +1 -0
- package/dist/extensions/PodCredentialResolver.d.ts +23 -0
- package/dist/extensions/PodCredentialResolver.js +139 -0
- package/dist/extensions/PodCredentialResolver.js.map +1 -0
- package/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/index.js +20 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/types.d.ts +73 -0
- package/dist/extensions/types.js +3 -0
- package/dist/extensions/types.js.map +1 -0
- package/dist/http/SubgraphSparqlHttpHandler.d.ts +20 -1
- package/dist/http/SubgraphSparqlHttpHandler.js +324 -43
- package/dist/http/SubgraphSparqlHttpHandler.js.map +1 -1
- package/dist/http/SubgraphSparqlHttpHandler.jsonld +87 -0
- package/dist/identity/drizzle/EdgeNodeRepository.js +3 -2
- package/dist/identity/drizzle/EdgeNodeRepository.js.map +1 -1
- package/dist/identity/drizzle/schema.pg.js +1 -1
- package/dist/identity/drizzle/schema.pg.js.map +1 -1
- package/dist/identity/drizzle/schema.sqlite.js +1 -1
- package/dist/identity/drizzle/schema.sqlite.js.map +1 -1
- package/dist/identity/oidc/ScopedPickWebIdHandler.js +5 -5
- package/dist/identity/oidc/ScopedPickWebIdHandler.js.map +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/main.js +3 -0
- package/dist/main.js.map +1 -1
- package/dist/provision/LocalProvisionState.d.ts +28 -0
- package/dist/provision/LocalProvisionState.js +124 -0
- package/dist/provision/LocalProvisionState.js.map +1 -0
- package/dist/provision/ProvisionCodeCodec.d.ts +7 -3
- package/dist/provision/ProvisionCodeCodec.js +10 -3
- package/dist/provision/ProvisionCodeCodec.js.map +1 -1
- package/dist/provision/ProvisionPodCreator.d.ts +15 -1
- package/dist/provision/ProvisionPodCreator.js +68 -1
- package/dist/provision/ProvisionPodCreator.js.map +1 -1
- package/dist/provision/ProvisionPodCreator.jsonld +31 -0
- package/dist/provision/ServiceAccessTokenCodec.d.ts +45 -0
- package/dist/provision/ServiceAccessTokenCodec.js +86 -0
- package/dist/provision/ServiceAccessTokenCodec.js.map +1 -0
- package/dist/runtime/GatewayAdminProxyAuth.d.ts +29 -0
- package/dist/runtime/GatewayAdminProxyAuth.js +108 -0
- package/dist/runtime/GatewayAdminProxyAuth.js.map +1 -0
- package/dist/runtime/Proxy.d.ts +10 -0
- package/dist/runtime/Proxy.js +64 -6
- package/dist/runtime/Proxy.js.map +1 -1
- package/dist/runtime/XpodRuntime.js +1 -0
- package/dist/runtime/XpodRuntime.js.map +1 -1
- package/dist/runtime/bootstrap.d.ts +1 -0
- package/dist/runtime/bootstrap.js +29 -0
- package/dist/runtime/bootstrap.js.map +1 -1
- package/dist/runtime/css-process.d.ts +1 -0
- package/dist/runtime/css-process.js +1 -0
- package/dist/runtime/css-process.js.map +1 -1
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.js +3 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/lifecycle.d.ts +3 -1
- package/dist/runtime/lifecycle.js +3 -1
- package/dist/runtime/lifecycle.js.map +1 -1
- package/dist/runtime/runner/node/NodeGatewayRuntimeRunner.js +2 -0
- package/dist/runtime/runner/node/NodeGatewayRuntimeRunner.js.map +1 -1
- package/dist/runtime/runner/types.d.ts +3 -0
- package/dist/runtime/runner/types.js.map +1 -1
- package/dist/runtime/runtime-types.d.ts +2 -0
- package/dist/runtime/runtime-types.js.map +1 -1
- package/dist/runtime/safe-env.d.ts +15 -0
- package/dist/runtime/safe-env.js +109 -0
- package/dist/runtime/safe-env.js.map +1 -0
- package/dist/security/index.d.ts +1 -0
- package/dist/security/index.js +18 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/secret-cell/DeploymentRootKeyProvider.d.ts +17 -0
- package/dist/security/secret-cell/DeploymentRootKeyProvider.js +61 -0
- package/dist/security/secret-cell/DeploymentRootKeyProvider.js.map +1 -0
- package/dist/security/secret-cell/DeploymentRootKeyProvider.jsonld +124 -0
- package/dist/security/secret-cell/SecretCellVault.d.ts +55 -0
- package/dist/security/secret-cell/SecretCellVault.js +242 -0
- package/dist/security/secret-cell/SecretCellVault.js.map +1 -0
- package/dist/security/secret-cell/SecretCellVault.jsonld +207 -0
- package/dist/security/secret-cell/index.d.ts +2 -0
- package/dist/security/secret-cell/index.js +11 -0
- package/dist/security/secret-cell/index.js.map +1 -0
- package/dist/solidfs/CompositeSolidFsSyncer.d.ts +18 -0
- package/dist/solidfs/CompositeSolidFsSyncer.js +32 -0
- package/dist/solidfs/CompositeSolidFsSyncer.js.map +1 -0
- package/dist/solidfs/LocalSolidFS.js +25 -1
- package/dist/solidfs/LocalSolidFS.js.map +1 -1
- package/dist/solidfs/RdfIndexSolidFsSyncer.d.ts +41 -2
- package/dist/solidfs/RdfIndexSolidFsSyncer.js +331 -21
- package/dist/solidfs/RdfIndexSolidFsSyncer.js.map +1 -1
- package/dist/solidfs/SolidFsMetaNotes.d.ts +25 -0
- package/dist/solidfs/SolidFsMetaNotes.js +103 -0
- package/dist/solidfs/SolidFsMetaNotes.js.map +1 -0
- package/dist/solidfs/SolidFsSyncJournal.d.ts +2 -2
- package/dist/solidfs/SolidFsSyncJournal.js +9 -4
- package/dist/solidfs/SolidFsSyncJournal.js.map +1 -1
- package/dist/solidfs/SolidFsSyncJournal.jsonld +119 -0
- package/dist/solidfs/WorkspacePrompt.d.ts +13 -0
- package/dist/solidfs/WorkspacePrompt.js +42 -0
- package/dist/solidfs/WorkspacePrompt.js.map +1 -0
- package/dist/solidfs/index.d.ts +3 -0
- package/dist/solidfs/index.js +3 -0
- package/dist/solidfs/index.js.map +1 -1
- package/dist/solidfs/types.d.ts +12 -2
- package/dist/solidfs/types.js.map +1 -1
- package/dist/storage/accessors/MixDataAccessor.d.ts +36 -4
- package/dist/storage/accessors/MixDataAccessor.js +222 -23
- package/dist/storage/accessors/MixDataAccessor.js.map +1 -1
- package/dist/storage/accessors/MixDataAccessor.jsonld +89 -0
- package/dist/storage/accessors/SolidRdfDataAccessor.d.ts +6 -1
- package/dist/storage/accessors/SolidRdfDataAccessor.js +35 -0
- package/dist/storage/accessors/SolidRdfDataAccessor.js.map +1 -1
- package/dist/storage/accessors/SolidRdfDataAccessor.jsonld +20 -0
- package/dist/storage/database/PostgresPoolManager.d.ts +1 -0
- package/dist/storage/database/PostgresPoolManager.js +2 -2
- package/dist/storage/database/PostgresPoolManager.js.map +1 -1
- package/dist/storage/locking/UrlAwareRedisLocker.d.ts +2 -0
- package/dist/storage/locking/UrlAwareRedisLocker.js +65 -0
- package/dist/storage/locking/UrlAwareRedisLocker.js.map +1 -1
- package/dist/storage/locking/UrlAwareRedisLocker.jsonld +19 -0
- package/dist/storage/rdf/PostgresRdfEngine.d.ts +286 -9
- package/dist/storage/rdf/PostgresRdfEngine.js +10773 -2084
- package/dist/storage/rdf/PostgresRdfEngine.js.map +1 -1
- package/dist/storage/rdf/PostgresRdfEngine.jsonld +1693 -89
- package/dist/storage/rdf/PostgresRdfSqlExecutor.d.ts +24 -0
- package/dist/storage/rdf/PostgresRdfSqlExecutor.js +131 -0
- package/dist/storage/rdf/PostgresRdfSqlExecutor.js.map +1 -0
- package/dist/storage/rdf/PostgresRdfTextIndex.d.ts +54 -0
- package/dist/storage/rdf/PostgresRdfTextIndex.js +1255 -0
- package/dist/storage/rdf/PostgresRdfTextIndex.js.map +1 -0
- package/dist/storage/rdf/PostgresRdfTextIndex.jsonld +487 -0
- package/dist/storage/rdf/PostgresRdfVectorIndex.d.ts +46 -0
- package/dist/storage/rdf/PostgresRdfVectorIndex.js +1165 -0
- package/dist/storage/rdf/PostgresRdfVectorIndex.js.map +1 -0
- package/dist/storage/rdf/PostgresRdfVectorIndex.jsonld +423 -0
- package/dist/storage/rdf/Rdf3xIndex.d.ts +14 -1
- package/dist/storage/rdf/Rdf3xIndex.js +286 -2
- package/dist/storage/rdf/Rdf3xIndex.js.map +1 -1
- package/dist/storage/rdf/Rdf3xIndex.jsonld +36 -0
- package/dist/storage/rdf/Rdf3xSchema.d.ts +5 -1
- package/dist/storage/rdf/Rdf3xSchema.js +17 -3
- package/dist/storage/rdf/Rdf3xSchema.js.map +1 -1
- package/dist/storage/rdf/RdfAccessScope.d.ts +22 -0
- package/dist/storage/rdf/RdfAccessScope.js +345 -0
- package/dist/storage/rdf/RdfAccessScope.js.map +1 -0
- package/dist/storage/rdf/RdfAccessScope.jsonld +45 -0
- package/dist/storage/rdf/RdfFusionRankPlan.d.ts +2 -0
- package/dist/storage/rdf/RdfFusionRankPlan.js +186 -0
- package/dist/storage/rdf/RdfFusionRankPlan.js.map +1 -0
- package/dist/storage/rdf/RdfJoinShape.d.ts +8 -0
- package/dist/storage/rdf/RdfJoinShape.js +31 -0
- package/dist/storage/rdf/RdfJoinShape.js.map +1 -0
- package/dist/storage/rdf/RdfQuadIndex.d.ts +5 -2
- package/dist/storage/rdf/RdfQuadIndex.js +94 -6
- package/dist/storage/rdf/RdfQuadIndex.js.map +1 -1
- package/dist/storage/rdf/RdfQuadIndex.jsonld +12 -0
- package/dist/storage/rdf/RdfQueryExecutor.d.ts +3 -4
- package/dist/storage/rdf/RdfQueryExecutor.js +235 -8
- package/dist/storage/rdf/RdfQueryExecutor.js.map +1 -1
- package/dist/storage/rdf/RdfSearchSourceFilter.d.ts +10 -0
- package/dist/storage/rdf/RdfSearchSourceFilter.js +83 -0
- package/dist/storage/rdf/RdfSearchSourceFilter.js.map +1 -0
- package/dist/storage/rdf/RdfSparqlAdapter.d.ts +27 -1
- package/dist/storage/rdf/RdfSparqlAdapter.js +265 -3
- package/dist/storage/rdf/RdfSparqlAdapter.js.map +1 -1
- package/dist/storage/rdf/RdfSparqlAdapter.jsonld +8 -0
- package/dist/storage/rdf/RdfTermDictionary.d.ts +7 -1
- package/dist/storage/rdf/RdfTermDictionary.js +139 -0
- package/dist/storage/rdf/RdfTermDictionary.js.map +1 -1
- package/dist/storage/rdf/RdfTermDictionary.jsonld +4 -0
- package/dist/storage/rdf/RdfTextIndex.d.ts +45 -2
- package/dist/storage/rdf/RdfTextIndex.js +810 -114
- package/dist/storage/rdf/RdfTextIndex.js.map +1 -1
- package/dist/storage/rdf/RdfTextIndex.jsonld +193 -0
- package/dist/storage/rdf/RdfTextProjection.d.ts +10 -0
- package/dist/storage/rdf/RdfTextProjection.js +258 -0
- package/dist/storage/rdf/RdfTextProjection.js.map +1 -0
- package/dist/storage/rdf/RdfVectorIndex.d.ts +30 -2
- package/dist/storage/rdf/RdfVectorIndex.js +461 -38
- package/dist/storage/rdf/RdfVectorIndex.js.map +1 -1
- package/dist/storage/rdf/RdfVectorIndex.jsonld +163 -0
- package/dist/storage/rdf/SolidRdfEngine.d.ts +12 -9
- package/dist/storage/rdf/SolidRdfEngine.js +48 -22
- package/dist/storage/rdf/SolidRdfEngine.js.map +1 -1
- package/dist/storage/rdf/SolidRdfEngine.jsonld +33 -43
- package/dist/storage/rdf/SolidRdfSparqlEngine.d.ts +19 -8
- package/dist/storage/rdf/SolidRdfSparqlEngine.js +674 -44
- package/dist/storage/rdf/SolidRdfSparqlEngine.js.map +1 -1
- package/dist/storage/rdf/SolidRdfSparqlEngine.jsonld +51 -0
- package/dist/storage/rdf/index.d.ts +9 -5
- package/dist/storage/rdf/index.js +42 -1
- package/dist/storage/rdf/index.js.map +1 -1
- package/dist/storage/rdf/models-benchmark.d.ts +264 -2
- package/dist/storage/rdf/models-benchmark.js +4207 -155
- package/dist/storage/rdf/models-benchmark.js.map +1 -1
- package/dist/storage/rdf/types.d.ts +833 -4
- package/dist/storage/rdf/types.js.map +1 -1
- package/dist/storage/rdf/types.jsonld +348 -0
- package/dist/storage/sparql/CompatibilitySparqlEngine.d.ts +14 -13
- package/dist/storage/sparql/CompatibilitySparqlEngine.js +24 -24
- package/dist/storage/sparql/CompatibilitySparqlEngine.js.map +1 -1
- package/dist/storage/sparql/CompatibilitySparqlEngineImpl.d.ts +14 -13
- package/dist/storage/sparql/CompatibilitySparqlEngineImpl.js +30 -18
- package/dist/storage/sparql/CompatibilitySparqlEngineImpl.js.map +1 -1
- package/dist/storage/sparql/SubgraphQueryEngine.d.ts +21 -12
- package/dist/storage/sparql/SubgraphQueryEngine.js +12 -12
- package/dist/storage/sparql/SubgraphQueryEngine.js.map +1 -1
- package/dist/terminal/sandbox/MacOSSandbox.js +2 -1
- package/dist/terminal/sandbox/MacOSSandbox.js.map +1 -1
- package/dist/terminal/sandbox/index.js +2 -1
- package/dist/terminal/sandbox/index.js.map +1 -1
- package/dist/test-utils/no-auth-xpod.js +3 -0
- package/dist/test-utils/no-auth-xpod.js.map +1 -1
- package/dist/tunnel/LocalTunnelProvider.d.ts +3 -0
- package/dist/tunnel/LocalTunnelProvider.js +17 -1
- package/dist/tunnel/LocalTunnelProvider.js.map +1 -1
- package/dist/tunnel/LocalTunnelProvider.jsonld +23 -0
- package/dist/tunnel/SakuraFrpTunnelProvider.d.ts +3 -0
- package/dist/tunnel/SakuraFrpTunnelProvider.js +18 -2
- package/dist/tunnel/SakuraFrpTunnelProvider.js.map +1 -1
- package/dist/tunnel/TunnelProfiles.d.ts +22 -0
- package/dist/tunnel/TunnelProfiles.js +208 -0
- package/dist/tunnel/TunnelProfiles.js.map +1 -0
- package/dist/tunnel/index.d.ts +2 -0
- package/dist/tunnel/index.js +4 -1
- package/dist/tunnel/index.js.map +1 -1
- package/dist/util/identifiers/ClusterIdentifierStrategy.d.ts +3 -0
- package/dist/util/identifiers/ClusterIdentifierStrategy.js +18 -2
- package/dist/util/identifiers/ClusterIdentifierStrategy.js.map +1 -1
- package/dist/util/identifiers/ClusterIdentifierStrategy.jsonld +5 -1
- package/node_modules/@undefineds.co/ai-connection/dist/AiClientConfigurationSection.d.ts +55 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiClientConfigurationSection.js +167 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionHeader.d.ts +3 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionHeader.js +8 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionList.d.ts +4 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionList.js +36 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionMain.d.ts +4 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionMain.js +37 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionMainHeader.d.ts +3 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionMainHeader.js +7 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionPanel.d.ts +14 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionPanel.js +333 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiProviderCard.d.ts +22 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiProviderCard.js +43 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiQuotaCard.d.ts +8 -0
- package/node_modules/@undefineds.co/ai-connection/dist/AiQuotaCard.js +6 -0
- package/node_modules/@undefineds.co/ai-connection/dist/ai-connection-client.d.ts +120 -0
- package/node_modules/@undefineds.co/ai-connection/dist/ai-connection-client.js +414 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/base-adapter.d.ts +32 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/base-adapter.js +212 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/codex.d.ts +14 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/codex.js +90 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/index.cjs +668 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/index.d.ts +6 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/index.js +6 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/json-env-adapter.d.ts +21 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/json-env-adapter.js +82 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/pi.d.ts +13 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/pi.js +83 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/transaction.d.ts +17 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/transaction.js +153 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/types.d.ts +40 -0
- package/node_modules/@undefineds.co/ai-connection/dist/client-config/types.js +1 -0
- package/node_modules/@undefineds.co/ai-connection/dist/controller.d.ts +42 -0
- package/node_modules/@undefineds.co/ai-connection/dist/controller.js +289 -0
- package/node_modules/@undefineds.co/ai-connection/dist/index.d.ts +16 -0
- package/node_modules/@undefineds.co/ai-connection/dist/index.js +41 -0
- package/node_modules/@undefineds.co/ai-connection/dist/manifest.d.ts +1 -0
- package/node_modules/@undefineds.co/ai-connection/dist/manifest.js +18 -0
- package/node_modules/@undefineds.co/ai-connection/dist/service-access.d.ts +3 -0
- package/node_modules/@undefineds.co/ai-connection/dist/service-access.js +133 -0
- package/node_modules/@undefineds.co/ai-connection/package.json +50 -0
- package/node_modules/@undefineds.co/extension-sdk/README.md +299 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/index.d.ts +5 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/index.js +5 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/layout.d.ts +16 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/layout.js +36 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/manifest.d.ts +27 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/manifest.js +79 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react/app-layout.d.ts +7 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react/app-layout.js +8 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react/auth-boundary.d.ts +27 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react/auth-boundary.js +49 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react/layout-context.d.ts +11 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react/layout-context.js +9 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react/workspace-layout.d.ts +38 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react/workspace-layout.js +132 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react.d.ts +12 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/react.js +19 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/testing.d.ts +7 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/testing.js +27 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/web.d.ts +225 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/web.js +142 -0
- package/node_modules/@undefineds.co/extension-sdk/package.json +49 -0
- package/node_modules/@undefineds.co/extensions/README.md +101 -0
- package/node_modules/@undefineds.co/extensions/dist/adapters/langchain.d.ts +25 -0
- package/node_modules/@undefineds.co/extensions/dist/adapters/langchain.d.ts.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/adapters/langchain.js +45 -0
- package/node_modules/@undefineds.co/extensions/dist/adapters/langchain.js.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/adapters/llamaindex.d.ts +31 -0
- package/node_modules/@undefineds.co/extensions/dist/adapters/llamaindex.d.ts.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/adapters/llamaindex.js +50 -0
- package/node_modules/@undefineds.co/extensions/dist/adapters/llamaindex.js.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/index.d.ts +7 -0
- package/node_modules/@undefineds.co/extensions/dist/index.d.ts.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/index.js +7 -0
- package/node_modules/@undefineds.co/extensions/dist/index.js.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/paddleocr.d.ts +16 -0
- package/node_modules/@undefineds.co/extensions/dist/paddleocr.d.ts.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/paddleocr.js +267 -0
- package/node_modules/@undefineds.co/extensions/dist/paddleocr.js.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/reader.d.ts +18 -0
- package/node_modules/@undefineds.co/extensions/dist/reader.d.ts.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/reader.js +39 -0
- package/node_modules/@undefineds.co/extensions/dist/reader.js.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/registry.d.ts +16 -0
- package/node_modules/@undefineds.co/extensions/dist/registry.d.ts.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/registry.js +97 -0
- package/node_modules/@undefineds.co/extensions/dist/registry.js.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/types.d.ts +141 -0
- package/node_modules/@undefineds.co/extensions/dist/types.d.ts.map +1 -0
- package/node_modules/@undefineds.co/extensions/dist/types.js +2 -0
- package/node_modules/@undefineds.co/extensions/dist/types.js.map +1 -0
- package/node_modules/@undefineds.co/extensions/package.json +38 -0
- package/node_modules/@undefineds.co/shared-ui/dist/badge.d.ts +8 -0
- package/node_modules/@undefineds.co/shared-ui/dist/badge.js +17 -0
- package/node_modules/@undefineds.co/shared-ui/dist/button.d.ts +10 -0
- package/node_modules/@undefineds.co/shared-ui/dist/button.js +30 -0
- package/node_modules/@undefineds.co/shared-ui/dist/card.d.ts +7 -0
- package/node_modules/@undefineds.co/shared-ui/dist/card.js +15 -0
- package/node_modules/@undefineds.co/shared-ui/dist/index.d.ts +6 -0
- package/node_modules/@undefineds.co/shared-ui/dist/index.js +6 -0
- package/node_modules/@undefineds.co/shared-ui/dist/input.d.ts +4 -0
- package/node_modules/@undefineds.co/shared-ui/dist/input.js +5 -0
- package/node_modules/@undefineds.co/shared-ui/dist/theme.css +121 -0
- package/node_modules/@undefineds.co/shared-ui/dist/utils.d.ts +2 -0
- package/node_modules/@undefineds.co/shared-ui/dist/utils.js +5 -0
- package/node_modules/@undefineds.co/shared-ui/dist/workspace.d.ts +23 -0
- package/node_modules/@undefineds.co/shared-ui/dist/workspace.js +38 -0
- package/node_modules/@undefineds.co/shared-ui/package.json +39 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/index.d.ts +3 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/index.js +3 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/pod-runtime.d.ts +45 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/pod-runtime.js +147 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/react.d.ts +15 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/react.js +15 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/session.d.ts +42 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/session.js +127 -0
- package/node_modules/@undefineds.co/solid-sdk/package.json +45 -0
- package/package.json +31 -13
- package/static/app/assets/index-BoYHJ6si.js +230 -0
- package/static/app/assets/inrupt-smoke.js +2 -2
- package/static/app/assets/main.css +1 -1
- package/static/app/assets/main.js +9 -9
- package/static/dashboard/assets/NetworkPage-Brt79fuQ.js +2 -0
- package/static/dashboard/assets/PaneListHeader-57nvMwH6.js +1 -0
- package/static/dashboard/assets/PodPage-CM6do1vB.js +2 -0
- package/static/dashboard/assets/ServicesPage-BUNxGJRz.js +1 -0
- package/static/dashboard/assets/card-B9Zjf_2p.js +1 -0
- package/static/dashboard/assets/dashboard-8C6o666W.js +305 -0
- package/static/dashboard/assets/dashboard-CSdewNeA.css +1 -0
- package/static/dashboard/assets/database-DPh9wDY9.js +1 -0
- package/static/dashboard/assets/external-link-VbMQvVMz.js +1 -0
- package/static/dashboard/assets/index-RfiFckzb.js +51 -0
- package/static/dashboard/assets/refresh-cw-BxVxNxNr.js +1 -0
- package/static/dashboard/assets/services-status-context-DKmJ7ISr.js +1 -0
- package/static/dashboard/dashboard.html +2 -2
- package/static/settings/assets/ModelsPage-D_IH7AH3.js +1 -0
- package/static/settings/assets/PaneListHeader-Bgaze006.js +1 -0
- package/static/settings/assets/PodPage-Cy1VNObw.js +2 -0
- package/static/settings/assets/ServicesPage-BsFaxVWC.js +1 -0
- package/static/settings/assets/SettingsPage-UafNWE_p.js +48 -0
- package/static/settings/assets/card-B_bXSIn-.js +1 -0
- package/static/settings/assets/services-status-context-DiX-AbrP.js +1 -0
- package/static/settings/assets/settings-B30oMfZq.js +305 -0
- package/static/settings/assets/settings-CSdewNeA.css +1 -0
- package/static/settings/assets/workspace-layout-Dv1Yn9Ci.js +1 -0
- package/static/settings/auth.html +21 -0
- package/static/settings/reachability.html +221 -0
- package/static/settings/reachability.svg +7 -0
- package/static/settings/reachability.webmanifest +18 -0
- package/static/settings/settings.html +13 -0
- package/static/settings/signal-pod.html +293 -0
- package/static/settings/vite.svg +1 -0
- package/dist/api/service/ai-gateway-transport.d.ts +0 -25
- package/dist/api/service/ai-gateway-transport.js +0 -136
- package/dist/api/service/ai-gateway-transport.js.map +0 -1
- package/dist/api/service/chat-protocol-adapters.d.ts +0 -5
- package/dist/api/service/chat-protocol-adapters.js +0 -146
- package/dist/api/service/chat-protocol-adapters.js.map +0 -1
- package/dist/api/service/chat-routing.d.ts +0 -8
- package/dist/api/service/chat-routing.js +0 -16
- package/dist/api/service/chat-routing.js.map +0 -1
- package/dist/api/service/platform-ai-config.d.ts +0 -10
- package/dist/api/service/platform-ai-config.js +0 -76
- package/dist/api/service/platform-ai-config.js.map +0 -1
- package/dist/document/DocumentParser.js.map +0 -1
- package/dist/document/JinaDocumentParser.js.map +0 -1
- package/static/app/assets/index-C1yksyT4.js +0 -171
- package/static/dashboard/assets/dashboard-BssaVKTn.css +0 -1
- package/static/dashboard/assets/dashboard-Ckuadl3C.js +0 -54
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Input, } from '@undefineds.co/shared-ui';
|
|
4
|
+
import { normalizeAiConnectionThrownError, } from './ai-connection-client.js';
|
|
5
|
+
import { PROVIDERS, } from './controller.js';
|
|
6
|
+
import { Check, Copy, KeyRound, Loader2, Trash2, } from 'lucide-react';
|
|
7
|
+
import { AI_CLIENT_LABELS, AiClientConfigurationSection, } from './AiClientConfigurationSection.js';
|
|
8
|
+
import { AiProviderCard, } from './AiProviderCard.js';
|
|
9
|
+
const EMPTY_PROVIDER_SUMMARIES = {};
|
|
10
|
+
export function AiConnectionPanel({ client, openExternal = openExternalUrl, clientConfigurationBridge, selectedProvider, providerSummaries: providerSummariesInput = EMPTY_PROVIDER_SUMMARIES, providerLoadError, serviceAccessGranted = false, onProviderStateChange, }) {
|
|
11
|
+
const [keys, setKeys] = useState([]);
|
|
12
|
+
const [keysLoading, setKeysLoading] = useState(true);
|
|
13
|
+
const [keyName, setKeyName] = useState('');
|
|
14
|
+
const [creatingKey, setCreatingKey] = useState(false);
|
|
15
|
+
const [oneTimeKey, setOneTimeKey] = useState();
|
|
16
|
+
const [keyError, setKeyError] = useState();
|
|
17
|
+
const [connectionStates, setConnectionStates] = useState({});
|
|
18
|
+
const [models, setModels] = useState([]);
|
|
19
|
+
const [attempts, setAttempts] = useState({});
|
|
20
|
+
const [apiKeyInputs, setApiKeyInputs] = useState({});
|
|
21
|
+
const [busyProviders, setBusyProviders] = useState({});
|
|
22
|
+
const [providerErrors, setProviderErrors] = useState({});
|
|
23
|
+
const [quotas, setQuotas] = useState({});
|
|
24
|
+
const [copied, setCopied] = useState(false);
|
|
25
|
+
const pollingGeneration = useRef(0);
|
|
26
|
+
const updateConnectionState = useCallback((provider, state) => {
|
|
27
|
+
setConnectionStates((current) => ({ ...current, [provider]: state }));
|
|
28
|
+
onProviderStateChange?.(provider, productStateFromConnection(state));
|
|
29
|
+
}, [onProviderStateChange]);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setConnectionStates(Object.fromEntries(Object.values(providerSummariesInput).filter(isDefined).map((summary) => [
|
|
32
|
+
summary.provider,
|
|
33
|
+
summary.status === 'connected' && summary.authMode === 'browserAssistedApiKey'
|
|
34
|
+
? 'configured'
|
|
35
|
+
: summary.status,
|
|
36
|
+
])));
|
|
37
|
+
}, [providerSummariesInput]);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
let active = true;
|
|
40
|
+
setKeysLoading(true);
|
|
41
|
+
void client.listGatewayKeys()
|
|
42
|
+
.then((records) => {
|
|
43
|
+
if (active)
|
|
44
|
+
setKeys(records);
|
|
45
|
+
})
|
|
46
|
+
.catch((error) => {
|
|
47
|
+
if (active)
|
|
48
|
+
setKeyError(errorMessage(error));
|
|
49
|
+
})
|
|
50
|
+
.finally(() => {
|
|
51
|
+
if (active)
|
|
52
|
+
setKeysLoading(false);
|
|
53
|
+
});
|
|
54
|
+
void client.listModels()
|
|
55
|
+
.then((availableModels) => {
|
|
56
|
+
if (active)
|
|
57
|
+
setModels(availableModels);
|
|
58
|
+
})
|
|
59
|
+
.catch((error) => {
|
|
60
|
+
if (active)
|
|
61
|
+
setKeyError(errorMessage(error));
|
|
62
|
+
});
|
|
63
|
+
return () => {
|
|
64
|
+
active = false;
|
|
65
|
+
pollingGeneration.current += 1;
|
|
66
|
+
};
|
|
67
|
+
}, [client]);
|
|
68
|
+
const setBusy = (provider, value) => {
|
|
69
|
+
setBusyProviders((current) => ({ ...current, [provider]: value }));
|
|
70
|
+
};
|
|
71
|
+
const setProviderError = (provider, value) => {
|
|
72
|
+
setProviderErrors((current) => ({ ...current, [provider]: value }));
|
|
73
|
+
};
|
|
74
|
+
const openAttemptUrl = useCallback(async (attempt) => {
|
|
75
|
+
const target = attempt.verificationUriComplete
|
|
76
|
+
?? attempt.authorizationUrl
|
|
77
|
+
?? attempt.verificationUri;
|
|
78
|
+
if (target)
|
|
79
|
+
await openExternal(target);
|
|
80
|
+
}, [openExternal]);
|
|
81
|
+
const beginApiKey = async (provider) => {
|
|
82
|
+
if (!serviceAccessGranted)
|
|
83
|
+
return;
|
|
84
|
+
setBusy(provider, true);
|
|
85
|
+
setProviderError(provider);
|
|
86
|
+
try {
|
|
87
|
+
const attempt = await client.beginConnect(provider, 'browserAssistedApiKey');
|
|
88
|
+
setAttempts((current) => ({ ...current, [provider]: attempt }));
|
|
89
|
+
const pending = isPendingAttempt(attempt.status);
|
|
90
|
+
updateConnectionState(provider, pending ? 'pending' : attempt.status === 'completed' ? 'configured' : 'failed');
|
|
91
|
+
if (!pending && attempt.status !== 'completed') {
|
|
92
|
+
setProviderError(provider, attempt.message ?? connectFailureMessage(attempt.status));
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
await openAttemptUrl(attempt);
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
updateConnectionState(provider, 'failed');
|
|
99
|
+
setProviderError(provider, errorMessage(error));
|
|
100
|
+
}
|
|
101
|
+
finally {
|
|
102
|
+
setBusy(provider, false);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const beginBrowserConnect = async (definition) => {
|
|
106
|
+
if (!serviceAccessGranted)
|
|
107
|
+
return;
|
|
108
|
+
if (definition.browserMode === 'connectUnsupported')
|
|
109
|
+
return;
|
|
110
|
+
if (definition.browserMode === 'browserAssistedApiKey') {
|
|
111
|
+
await beginApiKey(definition.id);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
setBusy(definition.id, true);
|
|
115
|
+
setProviderError(definition.id);
|
|
116
|
+
const generation = pollingGeneration.current + 1;
|
|
117
|
+
pollingGeneration.current = generation;
|
|
118
|
+
try {
|
|
119
|
+
const attempt = await client.beginConnect(definition.id, definition.browserMode);
|
|
120
|
+
setAttempts((current) => ({ ...current, [definition.id]: attempt }));
|
|
121
|
+
if (!isPendingAttempt(attempt.status)) {
|
|
122
|
+
const connected = attempt.status === 'completed';
|
|
123
|
+
updateConnectionState(definition.id, connected ? 'connected' : 'failed');
|
|
124
|
+
if (!connected) {
|
|
125
|
+
setProviderError(definition.id, attempt.message ?? connectFailureMessage(attempt.status));
|
|
126
|
+
}
|
|
127
|
+
setBusy(definition.id, false);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
updateConnectionState(definition.id, 'pending');
|
|
131
|
+
await openAttemptUrl(attempt);
|
|
132
|
+
void pollDeviceConnect(client, definition.id, attempt, generation, pollingGeneration, {
|
|
133
|
+
onAttempt: (next) => setAttempts((current) => ({ ...current, [definition.id]: next })),
|
|
134
|
+
onConnected: () => updateConnectionState(definition.id, 'connected'),
|
|
135
|
+
onFailed: (message) => {
|
|
136
|
+
updateConnectionState(definition.id, 'failed');
|
|
137
|
+
setProviderError(definition.id, message);
|
|
138
|
+
},
|
|
139
|
+
onFinished: () => setBusy(definition.id, false),
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
updateConnectionState(definition.id, 'failed');
|
|
144
|
+
setProviderError(definition.id, errorMessage(error));
|
|
145
|
+
setBusy(definition.id, false);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
const saveApiKey = async (definition) => {
|
|
149
|
+
if (!serviceAccessGranted)
|
|
150
|
+
return;
|
|
151
|
+
const apiKey = apiKeyInputs[definition.id]?.trim();
|
|
152
|
+
const attempt = attempts[definition.id];
|
|
153
|
+
if (!apiKey || !attempt)
|
|
154
|
+
return;
|
|
155
|
+
setBusy(definition.id, true);
|
|
156
|
+
setProviderError(definition.id);
|
|
157
|
+
try {
|
|
158
|
+
const result = await client.completeApiKey(definition.id, attempt, apiKey);
|
|
159
|
+
setAttempts((current) => ({ ...current, [definition.id]: result }));
|
|
160
|
+
setApiKeyInputs((current) => ({ ...current, [definition.id]: '' }));
|
|
161
|
+
updateConnectionState(definition.id, 'configured');
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
setProviderError(definition.id, errorMessage(error));
|
|
165
|
+
updateConnectionState(definition.id, 'failed');
|
|
166
|
+
}
|
|
167
|
+
finally {
|
|
168
|
+
setBusy(definition.id, false);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
const disconnect = async (provider) => {
|
|
172
|
+
if (!serviceAccessGranted)
|
|
173
|
+
return;
|
|
174
|
+
setBusy(provider, true);
|
|
175
|
+
setProviderError(provider);
|
|
176
|
+
try {
|
|
177
|
+
await client.disconnect(provider);
|
|
178
|
+
setAttempts((current) => ({ ...current, [provider]: undefined }));
|
|
179
|
+
setQuotas((current) => ({ ...current, [provider]: undefined }));
|
|
180
|
+
updateConnectionState(provider, 'disconnected');
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
setProviderError(provider, errorMessage(error));
|
|
184
|
+
}
|
|
185
|
+
finally {
|
|
186
|
+
setBusy(provider, false);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
const refreshQuota = async (provider) => {
|
|
190
|
+
setBusy(provider, true);
|
|
191
|
+
setProviderError(provider);
|
|
192
|
+
try {
|
|
193
|
+
const quota = await client.quota(provider, true);
|
|
194
|
+
setQuotas((current) => ({ ...current, [provider]: quota }));
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
setProviderError(provider, errorMessage(error));
|
|
198
|
+
}
|
|
199
|
+
finally {
|
|
200
|
+
setBusy(provider, false);
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
const createKey = async () => {
|
|
204
|
+
if (!serviceAccessGranted)
|
|
205
|
+
return;
|
|
206
|
+
setCreatingKey(true);
|
|
207
|
+
setKeyError(undefined);
|
|
208
|
+
setOneTimeKey(undefined);
|
|
209
|
+
try {
|
|
210
|
+
const created = await client.createGatewayKey({
|
|
211
|
+
...(keyName.trim() ? { name: keyName.trim() } : {}),
|
|
212
|
+
});
|
|
213
|
+
setOneTimeKey(created.plaintext);
|
|
214
|
+
setKeys((current) => [created.record, ...current]);
|
|
215
|
+
setKeyName('');
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
setKeyError(errorMessage(error));
|
|
219
|
+
}
|
|
220
|
+
finally {
|
|
221
|
+
setCreatingKey(false);
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
const revokeKey = async (keyId) => {
|
|
225
|
+
if (!serviceAccessGranted)
|
|
226
|
+
return;
|
|
227
|
+
setKeyError(undefined);
|
|
228
|
+
try {
|
|
229
|
+
const record = await client.revokeGatewayKey(keyId);
|
|
230
|
+
setKeys((current) => current.map((item) => item.id === keyId
|
|
231
|
+
? (record ?? { ...item, revokedAt: new Date().toISOString() })
|
|
232
|
+
: item));
|
|
233
|
+
}
|
|
234
|
+
catch (error) {
|
|
235
|
+
setKeyError(errorMessage(error));
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
const copyOneTimeKey = async () => {
|
|
239
|
+
if (!oneTimeKey)
|
|
240
|
+
return;
|
|
241
|
+
await navigator.clipboard?.writeText(oneTimeKey);
|
|
242
|
+
setCopied(true);
|
|
243
|
+
};
|
|
244
|
+
const createManagedGatewayKey = useCallback(async (targetClient) => {
|
|
245
|
+
if (!serviceAccessGranted) {
|
|
246
|
+
throw new Error('AI Connection service access is not granted');
|
|
247
|
+
}
|
|
248
|
+
const created = await client.createGatewayKey({
|
|
249
|
+
name: `AI Connection · ${AI_CLIENT_LABELS[targetClient]}`,
|
|
250
|
+
});
|
|
251
|
+
setKeys((current) => [
|
|
252
|
+
created.record,
|
|
253
|
+
...current.filter((record) => record.id !== created.record.id),
|
|
254
|
+
]);
|
|
255
|
+
return {
|
|
256
|
+
gatewayKey: created.plaintext,
|
|
257
|
+
revoke: async () => {
|
|
258
|
+
await client.revokeGatewayKey(created.record.id);
|
|
259
|
+
setKeys((current) => current.map((record) => record.id === created.record.id
|
|
260
|
+
? { ...record, revokedAt: new Date().toISOString() }
|
|
261
|
+
: record));
|
|
262
|
+
},
|
|
263
|
+
};
|
|
264
|
+
}, [client, serviceAccessGranted]);
|
|
265
|
+
return (_jsxs("div", { className: "mx-auto w-full max-w-3xl px-6 py-6", children: [_jsxs("section", { children: [providerLoadError ? (_jsxs("p", { className: "mb-4 rounded-md border border-destructive/30 px-3 py-2 text-sm text-destructive", children: ["Provider \u72B6\u6001\u8BFB\u53D6\u5931\u8D25\uFF1A", providerLoadError] })) : null, PROVIDERS.filter((definition) => definition.id === (selectedProvider ?? 'openai')).map((definition) => (_jsx(AiProviderCard, { definition: definition, status: connectionStates[definition.id] ?? 'unknown', accountLabel: providerSummariesInput[definition.id]?.accountLabel, attempt: attempts[definition.id], apiKey: apiKeyInputs[definition.id] ?? '', busy: Boolean(busyProviders[definition.id]), disabled: !serviceAccessGranted, error: providerErrors[definition.id], quota: quotas[definition.id], models: models.filter((model) => model.provider === definition.id), onApiKeyChange: (value) => setApiKeyInputs((current) => ({
|
|
266
|
+
...current,
|
|
267
|
+
[definition.id]: value,
|
|
268
|
+
})), onBeginApiKey: () => void beginApiKey(definition.id), onBeginBrowser: () => void beginBrowserConnect(definition), onSaveApiKey: () => void saveApiKey(definition), onDisconnect: () => void disconnect(definition.id), onRefreshQuota: () => void refreshQuota(definition.id) }, definition.id)))] }), _jsxs("details", { className: "border-t border-border/60 py-5", children: [_jsx("summary", { className: "cursor-pointer list-none text-sm font-medium", children: "\u5BA2\u6237\u7AEF\u63A5\u5165" }), _jsxs("div", { className: "mt-4 space-y-6", children: [_jsx(AiClientConfigurationSection, { bridge: clientConfigurationBridge, endpoint: client.apiBase, createGatewayKey: createManagedGatewayKey }), _jsxs("details", { className: "border-t border-border/60 pt-4", children: [_jsx("summary", { className: "cursor-pointer text-sm font-medium text-muted-foreground", children: "\u9AD8\u7EA7\uFF1AGateway Keys" }), _jsx("div", { className: "mt-3", children: _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs(CardTitle, { className: "flex items-center gap-2 text-base", children: [_jsx(KeyRound, { className: "h-4 w-4" }), "Gateway Keys"] }), _jsx(CardDescription, { children: "\u7F16\u7801\u5BA2\u6237\u7AEF\u53EA\u4F7F\u7528 Gateway Key\uFF1B\u65B0\u5BC6\u94A5\u660E\u6587\u4EC5\u5728\u521B\u5EFA\u540E\u663E\u793A\u4E00\u6B21\u3002" })] }), _jsxs(CardContent, { className: "space-y-4", children: [_jsxs("div", { className: "flex gap-2", children: [_jsx(Input, { "aria-label": "Gateway Key \u540D\u79F0", placeholder: "\u540D\u79F0\uFF0C\u4F8B\u5982 Codex", value: keyName, onChange: (event) => setKeyName(event.target.value) }), _jsxs(Button, { onClick: () => void createKey(), disabled: creatingKey || !serviceAccessGranted, children: [creatingKey ? _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }) : _jsx(KeyRound, { className: "mr-2 h-4 w-4" }), "\u521B\u5EFA Gateway Key"] })] }), oneTimeKey ? (_jsxs("div", { className: "space-y-3 rounded-lg border border-amber-500/30 bg-amber-500/5 p-4", children: [_jsx("p", { className: "text-sm font-medium", children: "\u8BF7\u7ACB\u5373\u4FDD\u5B58\uFF1B\u5173\u95ED\u540E\u65E0\u6CD5\u518D\u6B21\u67E5\u770B\u3002" }), _jsx("code", { className: "block overflow-x-auto rounded bg-background p-3 text-xs", children: oneTimeKey }), _jsxs("div", { className: "flex flex-wrap gap-2", children: [_jsxs(Button, { variant: "outline", size: "sm", onClick: () => void copyOneTimeKey(), children: [copied ? _jsx(Check, { className: "mr-2 h-4 w-4" }) : _jsx(Copy, { className: "mr-2 h-4 w-4" }), copied ? '已复制' : '复制'] }), _jsx(Button, { size: "sm", onClick: () => {
|
|
269
|
+
setOneTimeKey(undefined);
|
|
270
|
+
setCopied(false);
|
|
271
|
+
}, children: "\u6211\u5DF2\u4FDD\u5B58\uFF0C\u9690\u85CF\u5BC6\u94A5" })] })] })) : null, keyError ? _jsx("p", { className: "text-sm text-destructive", children: keyError }) : null, keysLoading ? (_jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [_jsx(Loader2, { className: "h-4 w-4 animate-spin" }), "\u6B63\u5728\u8BFB\u53D6 Gateway Keys"] })) : keys.length === 0 ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "\u5C1A\u672A\u521B\u5EFA Gateway Key\u3002" })) : (_jsx("div", { className: "space-y-2", children: keys.map((key) => (_jsxs("div", { className: "flex items-center justify-between gap-3 rounded-lg border p-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "truncate text-sm font-medium", children: key.name || key.id }), _jsxs("div", { className: "mt-1 text-xs text-muted-foreground", children: [key.scopes.join(' · '), key.revokedAt ? ' · 已撤销' : ''] })] }), _jsx(Button, { variant: "ghost", size: "icon", "aria-label": `撤销 ${key.name || key.id}`, disabled: Boolean(key.revokedAt) || !serviceAccessGranted, onClick: () => void revokeKey(key.id), children: _jsx(Trash2, { className: "h-4 w-4" }) })] }, key.id))) }))] })] }) })] })] })] })] }));
|
|
272
|
+
}
|
|
273
|
+
async function pollDeviceConnect(client, provider, initial, generation, generationRef, callbacks) {
|
|
274
|
+
let attempt = initial;
|
|
275
|
+
try {
|
|
276
|
+
while (generationRef.current === generation && isPendingAttempt(attempt.status)) {
|
|
277
|
+
await delay(Math.max(1, attempt.intervalSeconds ?? 2) * 1000);
|
|
278
|
+
if (generationRef.current !== generation)
|
|
279
|
+
return;
|
|
280
|
+
attempt = await client.pollDevice(provider, attempt);
|
|
281
|
+
callbacks.onAttempt(attempt);
|
|
282
|
+
}
|
|
283
|
+
if (attempt.status === 'completed') {
|
|
284
|
+
callbacks.onConnected();
|
|
285
|
+
}
|
|
286
|
+
else if (generationRef.current === generation) {
|
|
287
|
+
callbacks.onFailed(attempt.message || `连接${attempt.status === 'expired' ? '已过期' : '失败'}`);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
catch (error) {
|
|
291
|
+
if (generationRef.current === generation)
|
|
292
|
+
callbacks.onFailed(errorMessage(error));
|
|
293
|
+
}
|
|
294
|
+
finally {
|
|
295
|
+
if (generationRef.current === generation)
|
|
296
|
+
callbacks.onFinished();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
function isPendingAttempt(status) {
|
|
300
|
+
return status === 'pending' || status === 'authorization_pending' || status === 'slow_down';
|
|
301
|
+
}
|
|
302
|
+
function connectFailureMessage(status) {
|
|
303
|
+
if (status === 'expired')
|
|
304
|
+
return '连接已过期,请重新开始';
|
|
305
|
+
if (status === 'cancelled')
|
|
306
|
+
return '连接已取消';
|
|
307
|
+
if (status === 'unsupported')
|
|
308
|
+
return '当前 Provider 不支持此连接方式';
|
|
309
|
+
return '连接失败';
|
|
310
|
+
}
|
|
311
|
+
function productStateFromConnection(state) {
|
|
312
|
+
if (state === 'configured')
|
|
313
|
+
return 'configured';
|
|
314
|
+
if (state === 'connected')
|
|
315
|
+
return 'connected';
|
|
316
|
+
if (state === 'failed' || state === 'reauthRequired')
|
|
317
|
+
return 'attention';
|
|
318
|
+
if (state === 'pending')
|
|
319
|
+
return 'loading';
|
|
320
|
+
return 'unconfigured';
|
|
321
|
+
}
|
|
322
|
+
function openExternalUrl(url) {
|
|
323
|
+
window.open(url, '_blank', 'noopener,noreferrer');
|
|
324
|
+
}
|
|
325
|
+
function delay(milliseconds) {
|
|
326
|
+
return new Promise((resolve) => window.setTimeout(resolve, milliseconds));
|
|
327
|
+
}
|
|
328
|
+
function errorMessage(error) {
|
|
329
|
+
return normalizeAiConnectionThrownError(error);
|
|
330
|
+
}
|
|
331
|
+
function isDefined(value) {
|
|
332
|
+
return value !== undefined;
|
|
333
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AiConnectAttempt, AiGatewayModel, AiQuotaSnapshot } from './ai-connection-client';
|
|
2
|
+
export type { AiProviderDefinition } from './controller';
|
|
3
|
+
import type { AiProviderDefinition } from './controller';
|
|
4
|
+
export type ProviderConnectionState = 'unknown' | 'pending' | 'configured' | 'connected' | 'disconnected' | 'reauthRequired' | 'failed';
|
|
5
|
+
export declare function AiProviderCard({ definition, status, accountLabel, attempt, apiKey, busy, disabled, error, quota, models, onApiKeyChange, onBeginApiKey, onBeginBrowser, onSaveApiKey, onDisconnect, onRefreshQuota, }: {
|
|
6
|
+
definition: AiProviderDefinition;
|
|
7
|
+
status: ProviderConnectionState;
|
|
8
|
+
accountLabel?: string;
|
|
9
|
+
attempt?: AiConnectAttempt;
|
|
10
|
+
apiKey: string;
|
|
11
|
+
busy: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
error?: string;
|
|
14
|
+
quota?: AiQuotaSnapshot;
|
|
15
|
+
models: AiGatewayModel[];
|
|
16
|
+
onApiKeyChange: (value: string) => void;
|
|
17
|
+
onBeginApiKey: () => void;
|
|
18
|
+
onBeginBrowser: () => void;
|
|
19
|
+
onSaveApiKey: () => void;
|
|
20
|
+
onDisconnect: () => void;
|
|
21
|
+
onRefreshQuota: () => void;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Badge, Button, Input, } from '@undefineds.co/shared-ui';
|
|
3
|
+
import { ExternalLink, KeyRound, Loader2, LogOut, RotateCw, } from 'lucide-react';
|
|
4
|
+
import { AiQuotaCard } from './AiQuotaCard.js';
|
|
5
|
+
export function AiProviderCard({ definition, status, accountLabel, attempt, apiKey, busy, disabled = false, error, quota, models, onApiKeyChange, onBeginApiKey, onBeginBrowser, onSaveApiKey, onDisconnect, onRefreshQuota, }) {
|
|
6
|
+
const apiKeyAttempt = attempt?.mode === 'browserAssistedApiKey' && attempt.status === 'pending';
|
|
7
|
+
const isConfigured = status === 'configured';
|
|
8
|
+
const isConnected = status === 'connected';
|
|
9
|
+
return (_jsxs("div", { children: [_jsxs("header", { className: "flex items-start justify-between gap-4 pb-5", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("h2", { className: "text-lg font-semibold text-foreground", children: definition.name }), _jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: providerDescription(definition.id) })] }), _jsx(Badge, { variant: isConnected || isConfigured ? 'default' : 'secondary', children: connectionStatusLabel(status) })] }), _jsxs("section", { className: "border-t border-border/60 py-5", "aria-label": "\u5F53\u524D\u8FDE\u63A5", children: [_jsxs("div", { className: "mb-4", children: [_jsx("h3", { className: "text-sm font-medium", children: "\u5F53\u524D\u8FDE\u63A5" }), accountLabel ? (_jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: maskAccountLabel(accountLabel) })) : (_jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: "Provider \u51ED\u8BC1\u52A0\u5BC6\u4FDD\u5B58\u5728\u5F53\u524D Pod\u3002" }))] }), attempt?.userCode ? (_jsxs("div", { className: "mb-4 border-l-2 border-primary bg-muted/30 px-3 py-2 text-sm", children: ["\u9A8C\u8BC1\u7801\uFF1A", _jsx("strong", { className: "font-mono", children: attempt.userCode })] })) : null, _jsx("div", { className: "flex flex-wrap gap-2", children: isConnected ? (_jsxs(_Fragment, { children: [_jsxs(Button, { variant: "outline", size: "sm", disabled: busy || disabled, onClick: onBeginBrowser, children: [busy ? _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }) : _jsx(RotateCw, { className: "mr-2 h-4 w-4" }), "\u91CD\u65B0\u8FDE\u63A5"] }), _jsxs(Button, { variant: "ghost", size: "sm", disabled: busy || disabled, onClick: onDisconnect, children: [_jsx(LogOut, { className: "mr-2 h-4 w-4" }), "\u65AD\u5F00\u8FDE\u63A5"] })] })) : isConfigured ? (_jsxs(_Fragment, { children: [_jsxs(Button, { variant: "outline", size: "sm", "aria-label": "\u66F4\u65B0 API Key", disabled: busy || disabled, onClick: onBeginApiKey, children: [_jsx(KeyRound, { className: "mr-2 h-4 w-4" }), "\u66F4\u65B0 API Key"] }), _jsx(Button, { variant: "ghost", size: "sm", disabled: busy || disabled, onClick: onDisconnect, children: "\u79FB\u9664\u914D\u7F6E" })] })) : (_jsxs(_Fragment, { children: [_jsxs(Button, { variant: "outline", size: "sm", disabled: busy || disabled || definition.browserMode === 'connectUnsupported', onClick: onBeginBrowser, children: [busy ? _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }) : _jsx(ExternalLink, { className: "mr-2 h-4 w-4" }), definition.browserLabel] }), _jsxs(Button, { variant: "outline", size: "sm", "aria-label": `${definition.name} API Key`, disabled: busy || disabled, onClick: onBeginApiKey, children: [_jsx(KeyRound, { className: "mr-2 h-4 w-4" }), "\u914D\u7F6E API Key"] })] })) }), apiKeyAttempt ? (_jsxs("div", { className: "mt-4 space-y-2", children: [_jsx(Input, { type: "password", autoComplete: "off", "aria-label": `${definition.name} API Key 输入`, placeholder: "\u4ECE\u5B98\u65B9\u63A7\u5236\u53F0\u590D\u5236 API Key", value: apiKey, onChange: (event) => onApiKeyChange(event.target.value) }), _jsx(Button, { size: "sm", "aria-label": `保存 ${definition.name} API Key`, disabled: !apiKey.trim() || busy || disabled, onClick: onSaveApiKey, children: "\u4FDD\u5B58 API Key" })] })) : null, error ? _jsx("p", { className: "mt-3 text-sm text-destructive", children: error }) : null] }), _jsx("section", { className: "border-t border-border/60 py-5", children: _jsx(AiQuotaCard, { providerName: definition.name, quota: quota, busy: busy, disabled: disabled, onRefresh: onRefreshQuota }) }), _jsxs("section", { className: "border-t border-border/60 py-5", children: [_jsx("h3", { className: "text-sm font-medium", children: "\u53EF\u7528\u6A21\u578B" }), models.length === 0 ? (_jsx("p", { className: "mt-2 text-xs text-muted-foreground", children: "\u5F53\u524D\u8EAB\u4EFD\u6682\u65E0\u53EF\u7528\u6A21\u578B" })) : (_jsx("ul", { className: "mt-3 divide-y divide-border/50 text-sm", children: models.map((model) => (_jsxs("li", { className: "flex items-center justify-between gap-4 py-2.5", children: [_jsx("span", { children: model.displayName ?? model.id }), model.displayName ? (_jsx("span", { className: "truncate font-mono text-xs text-muted-foreground", children: model.id })) : null] }, model.id))) }))] })] }));
|
|
10
|
+
}
|
|
11
|
+
function providerDescription(provider) {
|
|
12
|
+
switch (provider) {
|
|
13
|
+
case 'openai': return 'OpenAI 模型与编码能力';
|
|
14
|
+
case 'anthropic': return 'Claude 模型与编码能力';
|
|
15
|
+
case 'kimi': return 'Moonshot AI 模型服务';
|
|
16
|
+
case 'bailian': return '阿里云百炼模型服务';
|
|
17
|
+
case 'deepseek': return 'DeepSeek 模型服务';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function connectionStatusLabel(status) {
|
|
21
|
+
switch (status) {
|
|
22
|
+
case 'pending': return '连接中';
|
|
23
|
+
case 'configured': return '已配置';
|
|
24
|
+
case 'connected': return '已连接';
|
|
25
|
+
case 'disconnected': return '未设置';
|
|
26
|
+
case 'reauthRequired': return '需要重新鉴权';
|
|
27
|
+
case 'failed': return '连接失败';
|
|
28
|
+
default: return '未检查';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function maskAccountLabel(value) {
|
|
32
|
+
const at = value.indexOf('@');
|
|
33
|
+
if (at > 0) {
|
|
34
|
+
const accountName = value.slice(0, at);
|
|
35
|
+
const visible = accountName.length > 1
|
|
36
|
+
? `${accountName[0]}***${accountName[accountName.length - 1]}`
|
|
37
|
+
: `${accountName[0]}***`;
|
|
38
|
+
return `${visible}${value.slice(at)}`;
|
|
39
|
+
}
|
|
40
|
+
if (value.length <= 2)
|
|
41
|
+
return `${value[0] ?? ''}***`;
|
|
42
|
+
return `${value[0]}***${value[value.length - 1]}`;
|
|
43
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AiQuotaSnapshot } from './ai-connection-client';
|
|
2
|
+
export declare function AiQuotaCard({ providerName, quota, busy, disabled, onRefresh, }: {
|
|
3
|
+
providerName: string;
|
|
4
|
+
quota?: AiQuotaSnapshot;
|
|
5
|
+
busy: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
onRefresh: () => void;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '@undefineds.co/shared-ui';
|
|
3
|
+
import { RefreshCcw } from 'lucide-react';
|
|
4
|
+
export function AiQuotaCard({ providerName, quota, busy, disabled = false, onRefresh, }) {
|
|
5
|
+
return (_jsxs("div", { className: "space-y-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("div", { className: "text-sm font-medium", children: "\u5269\u4F59\u989D\u5EA6" }), _jsxs(Button, { variant: "ghost", size: "sm", "aria-label": `刷新 ${providerName} 额度`, disabled: busy || disabled, onClick: onRefresh, children: [_jsx(RefreshCcw, { className: "mr-2 h-3.5 w-3.5" }), "\u5237\u65B0"] })] }), !quota ? (_jsx("p", { className: "text-xs text-muted-foreground", children: "\u5C1A\u672A\u68C0\u67E5" })) : quota.status === 'unsupported' ? (_jsxs(_Fragment, { children: [_jsx("p", { className: "text-sm", children: "\u5B98\u65B9\u989D\u5EA6\u63A5\u53E3\u4E0D\u652F\u6301" }), _jsxs("p", { className: "text-xs text-muted-foreground", children: ["\u6765\u6E90\uFF1A", quota.source] })] })) : quota.status === 'error' ? (_jsx("p", { className: "text-sm text-destructive", children: "\u989D\u5EA6\u67E5\u8BE2\u5931\u8D25" })) : (_jsxs("div", { className: "space-y-1 text-sm", children: [typeof quota.balance === 'number' ? _jsxs("div", { children: ["\u4F59\u989D\uFF1A", quota.balance] }) : null, quota.windows.map((window, index) => (_jsxs("div", { children: [window.name ? `${window.name}:` : '', typeof window.remaining === 'number' ? `剩余 ${window.remaining}` : '官方数据可用'] }, `${String(window.name)}-${index}`))), _jsxs("p", { className: "text-xs text-muted-foreground", children: ["\u6765\u6E90\uFF1A", quota.source, quota.stale ? ' · 数据可能已过期' : ''] })] }))] }));
|
|
6
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export declare const AI_CONNECTION_PROVIDERS: readonly ["openai", "anthropic", "kimi", "bailian", "deepseek"];
|
|
2
|
+
export type AiConnectionProvider = (typeof AI_CONNECTION_PROVIDERS)[number];
|
|
3
|
+
export type AiConnectionMode = 'browserAssistedApiKey' | 'deviceCodeOAuth' | 'connectUnsupported';
|
|
4
|
+
export type AiConnectStatus = 'pending' | 'authorization_pending' | 'slow_down' | 'completed' | 'expired' | 'cancelled' | 'unsupported';
|
|
5
|
+
export interface AiConnectAttempt {
|
|
6
|
+
mode: AiConnectionMode;
|
|
7
|
+
status: AiConnectStatus;
|
|
8
|
+
provider: AiConnectionProvider;
|
|
9
|
+
attemptId?: string;
|
|
10
|
+
state?: string;
|
|
11
|
+
signature?: string;
|
|
12
|
+
expiresAt?: string;
|
|
13
|
+
authorizationUrl?: string;
|
|
14
|
+
userCode?: string;
|
|
15
|
+
verificationUri?: string;
|
|
16
|
+
verificationUriComplete?: string;
|
|
17
|
+
intervalSeconds?: number;
|
|
18
|
+
apiKeyManagementSupported?: boolean;
|
|
19
|
+
credentialId?: string;
|
|
20
|
+
message?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface AiConnectionCredential {
|
|
23
|
+
id: string;
|
|
24
|
+
credentialIri: string;
|
|
25
|
+
webId: string;
|
|
26
|
+
provider: AiConnectionProvider;
|
|
27
|
+
authMode: string;
|
|
28
|
+
status: string;
|
|
29
|
+
accountLabel?: string;
|
|
30
|
+
expiresAt?: string;
|
|
31
|
+
version?: number;
|
|
32
|
+
reauthRequired?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface AiQuotaWindow {
|
|
35
|
+
name?: string;
|
|
36
|
+
limit?: number;
|
|
37
|
+
used?: number;
|
|
38
|
+
remaining?: number;
|
|
39
|
+
resetsAt?: string;
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}
|
|
42
|
+
export interface AiQuotaSnapshot {
|
|
43
|
+
credential: string;
|
|
44
|
+
status: 'available' | 'unsupported' | 'error';
|
|
45
|
+
balance?: number;
|
|
46
|
+
windows: AiQuotaWindow[];
|
|
47
|
+
observedAt: string;
|
|
48
|
+
expiresAt: string;
|
|
49
|
+
source: string;
|
|
50
|
+
stale?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface GatewayKeyRecord {
|
|
53
|
+
id: string;
|
|
54
|
+
owner: string;
|
|
55
|
+
scopes: string[];
|
|
56
|
+
createdAt: string;
|
|
57
|
+
expiresAt?: string;
|
|
58
|
+
lastUsedAt?: string;
|
|
59
|
+
revokedAt?: string;
|
|
60
|
+
name?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface AiGatewayModel {
|
|
63
|
+
id: string;
|
|
64
|
+
provider: AiConnectionProvider;
|
|
65
|
+
displayName?: string;
|
|
66
|
+
contextWindow?: number;
|
|
67
|
+
protocols?: string[];
|
|
68
|
+
}
|
|
69
|
+
export interface CreatedGatewayKey {
|
|
70
|
+
plaintext: string;
|
|
71
|
+
record: GatewayKeyRecord;
|
|
72
|
+
}
|
|
73
|
+
export interface AiProviderConnectionSummary {
|
|
74
|
+
provider: AiConnectionProvider;
|
|
75
|
+
status: 'connected' | 'disconnected' | 'reauthRequired';
|
|
76
|
+
authMode?: string;
|
|
77
|
+
accountLabel?: string;
|
|
78
|
+
expiresAt?: string;
|
|
79
|
+
reauthRequired?: boolean;
|
|
80
|
+
credentialIri?: string;
|
|
81
|
+
version?: number;
|
|
82
|
+
connect: {
|
|
83
|
+
modes: AiConnectionMode[];
|
|
84
|
+
configured: boolean;
|
|
85
|
+
message?: string;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export interface AiConnectionClient {
|
|
89
|
+
readonly webId: string;
|
|
90
|
+
readonly apiBase: string;
|
|
91
|
+
getServiceAccess(): Promise<unknown>;
|
|
92
|
+
listProviders(): Promise<AiProviderConnectionSummary[]>;
|
|
93
|
+
listModels(): Promise<AiGatewayModel[]>;
|
|
94
|
+
listGatewayKeys(): Promise<GatewayKeyRecord[]>;
|
|
95
|
+
createGatewayKey(input: {
|
|
96
|
+
name?: string;
|
|
97
|
+
scopes?: string[];
|
|
98
|
+
expiresAt?: string;
|
|
99
|
+
}): Promise<CreatedGatewayKey>;
|
|
100
|
+
revokeGatewayKey(keyId: string): Promise<GatewayKeyRecord | undefined>;
|
|
101
|
+
beginConnect(provider: AiConnectionProvider, mode: AiConnectionMode): Promise<AiConnectAttempt>;
|
|
102
|
+
connectStatus(provider: AiConnectionProvider, attempt: Pick<AiConnectAttempt, 'attemptId' | 'state' | 'signature'>): Promise<AiConnectAttempt>;
|
|
103
|
+
completeApiKey(provider: AiConnectionProvider, attempt: Pick<AiConnectAttempt, 'attemptId' | 'state' | 'signature'>, apiKey: string, accountLabel?: string): Promise<AiConnectAttempt>;
|
|
104
|
+
pollDevice(provider: AiConnectionProvider, attempt: Pick<AiConnectAttempt, 'attemptId' | 'state' | 'signature'>): Promise<AiConnectAttempt>;
|
|
105
|
+
disconnect(provider: AiConnectionProvider): Promise<AiConnectionCredential | undefined>;
|
|
106
|
+
quota(provider: AiConnectionProvider, refresh?: boolean): Promise<AiQuotaSnapshot>;
|
|
107
|
+
}
|
|
108
|
+
export declare const AI_CONNECTION_GENERIC_ERROR_MESSAGE = "AI Connection request failed. Please try again.";
|
|
109
|
+
interface CreateAiConnectionClientInput {
|
|
110
|
+
webId: string;
|
|
111
|
+
podBaseUrl: string;
|
|
112
|
+
authenticatedFetch: typeof fetch;
|
|
113
|
+
}
|
|
114
|
+
export declare function resolveAiConnectionApiBase(podBaseUrl: string): string;
|
|
115
|
+
export declare function createAiConnectionClient({ webId, podBaseUrl, authenticatedFetch, }: CreateAiConnectionClientInput): AiConnectionClient;
|
|
116
|
+
export declare function normalizeAiConnectionThrownError(error: unknown): string;
|
|
117
|
+
export declare function normalizeAiConnectionErrorMessage(payload: unknown, status: number, context?: {
|
|
118
|
+
provider?: AiConnectionProvider;
|
|
119
|
+
}): string;
|
|
120
|
+
export {};
|