@undefineds.co/xpod 0.4.11 → 0.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/components-ignore.json +5 -1
- package/config/notifications.json +68 -0
- package/config/xpod.base.json +9 -11
- package/dist/acceptance/QleverSemanticConformance.js +7 -0
- package/dist/ai/service/AiCredentialSecret.d.ts +30 -0
- package/dist/ai/service/AiCredentialSecret.js +120 -0
- package/dist/ai/service/CredentialReaderImpl.d.ts +18 -0
- package/dist/ai/service/CredentialReaderImpl.js +81 -5
- package/dist/ai/service/CredentialReaderImpl.jsonld +42 -2
- package/dist/ai/service/EmbeddingModelPolicy.d.ts +79 -0
- package/dist/ai/service/EmbeddingModelPolicy.js +134 -0
- package/dist/ai/service/EmbeddingProviderError.js +6 -0
- package/dist/ai/service/EmbeddingServiceImpl.d.ts +13 -1
- package/dist/ai/service/EmbeddingServiceImpl.js +18 -5
- package/dist/ai/service/EmbeddingServiceImpl.jsonld +35 -0
- package/dist/ai/service/index.d.ts +2 -0
- package/dist/ai/service/index.js +2 -0
- package/dist/api/ai-gateway/connect/index.d.ts +20 -2
- package/dist/api/ai-gateway/connect/index.js +162 -16
- package/dist/api/ai-gateway/credentials/AiCredentialSecretDecoder.d.ts +12 -0
- package/dist/api/ai-gateway/credentials/AiCredentialSecretDecoder.js +30 -0
- package/dist/api/ai-gateway/errors.d.ts +1 -1
- package/dist/api/ai-gateway/models/GatewayEmbeddingModelCatalog.d.ts +11 -0
- package/dist/api/ai-gateway/models/GatewayEmbeddingModelCatalog.js +31 -0
- package/dist/api/ai-gateway/models/PodModelSelectionRepository.js +7 -3
- package/dist/api/ai-gateway/models/ProviderCustomModelsService.d.ts +18 -0
- package/dist/api/ai-gateway/models/ProviderCustomModelsService.js +23 -0
- package/dist/api/ai-gateway/models/ProviderModelDiscoveryAdapters.d.ts +3 -1
- package/dist/api/ai-gateway/models/ProviderModelDiscoveryAdapters.js +2 -45
- package/dist/api/ai-gateway/models/ProviderModelSelectionService.d.ts +10 -0
- package/dist/api/ai-gateway/models/ProviderModelSelectionService.js +57 -20
- package/dist/api/ai-gateway/models/ProviderModelType.d.ts +28 -0
- package/dist/api/ai-gateway/models/ProviderModelType.js +34 -0
- package/dist/api/ai-gateway/models/ProviderModelsAdapter.d.ts +10 -0
- package/dist/api/ai-gateway/models/ProviderModelsAdapter.js +3 -4
- package/dist/api/ai-gateway/models/index.d.ts +1 -0
- package/dist/api/ai-gateway/models/index.js +3 -1
- package/dist/api/ai-gateway/providers/CustomRuntimeAdapter.d.ts +7 -0
- package/dist/api/ai-gateway/providers/CustomRuntimeAdapter.js +9 -2
- package/dist/api/ai-gateway/providers/ModelsDevCatalog.d.ts +7 -1
- package/dist/api/ai-gateway/providers/ModelsDevCatalog.js +4 -10
- package/dist/api/ai-gateway/providers/OfferingAuthorization.d.ts +6 -1
- package/dist/api/ai-gateway/providers/OfferingAuthorization.js +0 -3
- package/dist/api/ai-gateway/providers/ProviderRegistry.d.ts +107 -0
- package/dist/api/ai-gateway/providers/ProviderRegistry.js +246 -23
- package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.d.ts +5 -0
- package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.js +5 -1
- package/dist/api/ai-gateway/quota/SubscriptionQuotaAdapters.d.ts +12 -4
- package/dist/api/ai-gateway/quota/SubscriptionQuotaAdapters.js +11 -11
- package/dist/api/ai-gateway/routing/ModelRouter.d.ts +14 -0
- package/dist/api/ai-gateway/routing/ModelRouter.js +43 -4
- package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.d.ts +9 -1
- package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.js +3 -27
- package/dist/api/chatkit/pod-store.d.ts +31 -0
- package/dist/api/chatkit/pod-store.js +132 -8
- package/dist/api/container/common.js +24 -4
- package/dist/api/container/routes.js +17 -2
- package/dist/api/container/types.d.ts +3 -1
- package/dist/api/handlers/AdminHandler.d.ts +13 -0
- package/dist/api/handlers/AdminHandler.js +47 -18
- package/dist/api/handlers/AiConfigHandler.d.ts +6 -0
- package/dist/api/handlers/AiConfigHandler.js +28 -0
- package/dist/api/handlers/AiGatewayManagementHandler.js +36 -0
- package/dist/api/runs/RdfRunContextRetriever.d.ts +14 -0
- package/dist/api/runs/RdfRunContextRetriever.js +41 -5
- package/dist/api/runtime.js +2 -1
- package/dist/api/service/AiClientConfigurationService.d.ts +1 -1
- package/dist/api/service/AiClientConfigurationService.js +1 -1
- package/dist/cli/commands/secret.d.ts +1 -0
- package/dist/cli/commands/secret.js +25 -7
- package/dist/components/components.jsonld +3 -1
- package/dist/components/context.jsonld +53 -1
- package/dist/http/SubgraphSparqlHttpHandler.d.ts +59 -2
- package/dist/http/SubgraphSparqlHttpHandler.js +145 -13
- package/dist/http/SubgraphSparqlHttpHandler.jsonld +37 -0
- package/dist/identity/drizzle/EdgeNodeRepository.d.ts +0 -12
- package/dist/identity/drizzle/EdgeNodeRepository.js +5 -13
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7 -3
- package/dist/logging/log-file.d.ts +17 -0
- package/dist/logging/log-file.js +69 -0
- package/dist/main.js +2 -1
- package/dist/notifications/NotificationChannelSweeper.d.ts +50 -0
- package/dist/notifications/NotificationChannelSweeper.js +131 -0
- package/dist/notifications/NotificationChannelSweeper.jsonld +136 -0
- package/dist/notifications/ReclaimingWebSocket2023Storer.d.ts +25 -0
- package/dist/notifications/ReclaimingWebSocket2023Storer.js +56 -0
- package/dist/notifications/ReclaimingWebSocket2023Storer.jsonld +77 -0
- package/dist/notifications/index.d.ts +2 -0
- package/dist/notifications/index.js +2 -0
- package/dist/runtime/Proxy.d.ts +37 -0
- package/dist/runtime/Proxy.js +88 -16
- package/dist/runtime/bootstrap.js +2 -1
- package/dist/runtime/upgrade/BunNativeUpgradeRelay.d.ts +116 -0
- package/dist/runtime/upgrade/BunNativeUpgradeRelay.js +423 -0
- package/dist/runtime/upgrade/UpgradeHandshake.d.ts +63 -0
- package/dist/runtime/upgrade/UpgradeHandshake.js +199 -0
- package/dist/runtime/upgrade/WebSocketFrames.d.ts +67 -0
- package/dist/runtime/upgrade/WebSocketFrames.js +224 -0
- package/dist/storage/rdf/PostgresRdfEngine.js +10 -4
- package/dist/storage/rdf/RdfAccessScope.js +15 -1
- package/dist/storage/rdf/RdfEngineRdfJsSource.js +10 -2
- package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.js +9 -2
- package/node_modules/@undefineds.co/ai-connections/dist/AiAuthorizationActions.d.ts +12 -3
- package/node_modules/@undefineds.co/ai-connections/dist/AiAuthorizationActions.js +27 -10
- package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.d.ts +7 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.js +15 -13
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectDialog.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectDialog.js +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsList.js +10 -6
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMain.d.ts +15 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMain.js +29 -3
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMainHeader.js +18 -3
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.d.ts +17 -2
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.js +94 -22
- package/node_modules/@undefineds.co/ai-connections/dist/AiCopyButton.d.ts +35 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiCopyButton.js +45 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialPoolSection.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialPoolSection.js +71 -11
- package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialRow.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialRow.js +9 -7
- package/node_modules/@undefineds.co/ai-connections/dist/AiCustomProviderDialog.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiEndpointList.d.ts +23 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiEndpointList.js +24 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeyRow.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.d.ts +14 -5
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.js +35 -38
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayModelsSection.d.ts +21 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayModelsSection.js +51 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiInfoTooltip.d.ts +15 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiInfoTooltip.js +16 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiModelCatalog.d.ts +175 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiModelCatalog.js +133 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiOfferingDetails.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiOfferingDetails.js +2 -2
- package/node_modules/@undefineds.co/ai-connections/dist/AiProviderCard.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiProviderCard.js +13 -64
- package/node_modules/@undefineds.co/ai-connections/dist/AiProviderHeader.d.ts +21 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiProviderHeader.js +12 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiQuotaCard.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiRowAction.d.ts +15 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiRowAction.js +12 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiSortableCredentialList.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiSortableCredentialList.js +2 -1
- package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.d.ts +39 -6
- package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.js +57 -11
- package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.d.ts +46 -0
- package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.js +231 -0
- package/node_modules/@undefineds.co/ai-connections/dist/collections.d.ts +119 -0
- package/node_modules/@undefineds.co/ai-connections/dist/collections.js +173 -0
- package/node_modules/@undefineds.co/ai-connections/dist/controller.d.ts +71 -5
- package/node_modules/@undefineds.co/ai-connections/dist/controller.js +288 -18
- package/node_modules/@undefineds.co/ai-connections/dist/credential-labels.d.ts +6 -1
- package/node_modules/@undefineds.co/ai-connections/dist/credential-labels.js +8 -3
- package/node_modules/@undefineds.co/ai-connections/dist/display-wording.d.ts +20 -0
- package/node_modules/@undefineds.co/ai-connections/dist/display-wording.js +73 -0
- package/node_modules/@undefineds.co/ai-connections/dist/error-wording.d.ts +24 -0
- package/node_modules/@undefineds.co/ai-connections/dist/error-wording.js +253 -0
- package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.d.ts +14 -0
- package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.js +20 -0
- package/node_modules/@undefineds.co/ai-connections/dist/index.d.ts +8 -1
- package/node_modules/@undefineds.co/ai-connections/dist/index.js +8 -1
- package/node_modules/@undefineds.co/ai-connections/dist/manifest.js +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/offering-endpoints.d.ts +15 -1
- package/node_modules/@undefineds.co/ai-connections/dist/offering-endpoints.js +17 -0
- package/node_modules/@undefineds.co/ai-connections/dist/offering-label.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.d.ts +6 -1
- package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.js +5 -0
- package/node_modules/@undefineds.co/ai-connections/dist/service-access.js +2 -27
- package/node_modules/@undefineds.co/ai-connections/dist/useAiConnectDialog.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/package.json +2 -24
- package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/ai-connections-client.d.ts +12 -3
- package/node_modules/@undefineds.co/ai-connections-core/dist/ai-connections-client.js +21 -0
- package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/normalize.d.ts +17 -7
- package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/normalize.js +48 -216
- package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/request.js +3 -3
- package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/types.d.ts +31 -2
- package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/base-adapter.d.ts +1 -3
- package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/base-adapter.js +3 -7
- package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/index.cjs +9 -7
- package/node_modules/@undefineds.co/ai-connections-core/dist/credential-storage.d.ts +59 -0
- package/node_modules/@undefineds.co/ai-connections-core/dist/credential-storage.js +131 -0
- package/node_modules/@undefineds.co/ai-connections-core/dist/endpoint-urls.d.ts +15 -0
- package/node_modules/@undefineds.co/ai-connections-core/dist/endpoint-urls.js +20 -0
- package/node_modules/@undefineds.co/ai-connections-core/dist/index.d.ts +9 -0
- package/node_modules/@undefineds.co/ai-connections-core/dist/index.js +9 -0
- package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/provider-catalog.cjs +68 -24
- package/node_modules/@undefineds.co/ai-connections-core/dist/provider-catalog.d.ts +84 -0
- package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/provider-catalog.js +121 -22
- package/node_modules/@undefineds.co/ai-connections-core/package.json +61 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/manifest.d.ts +1 -1
- package/node_modules/@undefineds.co/extension-sdk/dist/manifest.js +2 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/web.d.ts +150 -0
- package/node_modules/@undefineds.co/extension-sdk/package.json +2 -1
- package/node_modules/@undefineds.co/models/README.md +1 -1
- package/node_modules/@undefineds.co/models/dist/ai-config/index.d.ts +3 -3
- package/node_modules/@undefineds.co/models/dist/ai-gateway.schema.d.ts +5 -0
- package/node_modules/@undefineds.co/models/dist/ai-gateway.schema.js +9 -0
- package/node_modules/@undefineds.co/models/dist/ai-runtime.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/approval.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/audit.presentation.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/capture.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/chat-project.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/chat.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/control-request.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/conversation-share.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/credential.schema.d.ts +12 -0
- package/node_modules/@undefineds.co/models/dist/credential.schema.js +15 -1
- package/node_modules/@undefineds.co/models/dist/discovery/index.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/discovery/providers.json +248 -7
- package/node_modules/@undefineds.co/models/dist/discovery/types.d.ts +31 -0
- package/node_modules/@undefineds.co/models/dist/extension/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/favorite/index.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/fixtures/contracts-chat-contact.d.ts +5 -5
- package/node_modules/@undefineds.co/models/dist/import/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/index.d.ts +73 -73
- package/node_modules/@undefineds.co/models/dist/index.js +1 -1
- package/node_modules/@undefineds.co/models/dist/input-request.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/knowledge/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/message.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/namespaces.js +5 -0
- package/node_modules/@undefineds.co/models/dist/pod-storage-descriptor.d.ts +4815 -26
- package/node_modules/@undefineds.co/models/dist/pod-storage-descriptor.js +482 -132
- package/node_modules/@undefineds.co/models/dist/schema.d.ts +4 -0
- package/node_modules/@undefineds.co/models/dist/session/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/settings/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/sidecar/persistence-mapping.d.ts +5 -5
- package/node_modules/@undefineds.co/models/dist/thread.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/types/message-block.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/vocab/_namespaces.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/vocab/index.d.ts +10 -10
- package/node_modules/@undefineds.co/models/dist/vocab/sidecar.vocab.d.ts +1 -0
- package/node_modules/@undefineds.co/models/dist/vocab/sidecar.vocab.js +1 -0
- package/node_modules/@undefineds.co/models/package.json +4 -2
- package/node_modules/@undefineds.co/pod-collections/README.md +71 -0
- package/node_modules/@undefineds.co/pod-collections/dist/diff.d.ts +85 -0
- package/node_modules/@undefineds.co/pod-collections/dist/diff.js +166 -0
- package/node_modules/@undefineds.co/pod-collections/dist/feed.d.ts +17 -0
- package/node_modules/@undefineds.co/pod-collections/dist/feed.js +27 -0
- package/node_modules/@undefineds.co/pod-collections/dist/index.cjs +1042 -0
- package/node_modules/@undefineds.co/pod-collections/dist/index.d.ts +37 -0
- package/node_modules/@undefineds.co/pod-collections/dist/index.js +89 -0
- package/node_modules/@undefineds.co/pod-collections/dist/layout.d.ts +75 -0
- package/node_modules/@undefineds.co/pod-collections/dist/layout.js +173 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mapping.d.ts +78 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mapping.js +287 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mutations.d.ts +83 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mutations.js +273 -0
- package/node_modules/@undefineds.co/pod-collections/dist/react.d.ts +21 -0
- package/node_modules/@undefineds.co/pod-collections/dist/react.js +22 -0
- package/node_modules/@undefineds.co/pod-collections/dist/read.d.ts +65 -0
- package/node_modules/@undefineds.co/pod-collections/dist/read.js +31 -0
- package/node_modules/@undefineds.co/pod-collections/dist/sync.d.ts +66 -0
- package/node_modules/@undefineds.co/pod-collections/dist/sync.js +260 -0
- package/node_modules/@undefineds.co/pod-collections/dist/types.d.ts +155 -0
- package/node_modules/@undefineds.co/pod-collections/dist/types.js +9 -0
- package/node_modules/@undefineds.co/pod-collections/package.json +42 -0
- package/node_modules/@undefineds.co/shared-ui/dist/index.d.ts +4 -2
- package/node_modules/@undefineds.co/shared-ui/dist/index.js +4 -2
- package/node_modules/@undefineds.co/shared-ui/dist/login/LoginModal.d.ts +4 -1
- package/node_modules/@undefineds.co/shared-ui/dist/login/LoginModal.js +12 -6
- package/node_modules/@undefineds.co/shared-ui/dist/login/LoginView.d.ts +1 -1
- package/node_modules/@undefineds.co/shared-ui/dist/login/host-types.d.ts +7 -1
- package/node_modules/@undefineds.co/shared-ui/dist/login/login-branding.d.ts +6 -0
- package/node_modules/@undefineds.co/shared-ui/dist/login/login-branding.js +18 -0
- package/node_modules/@undefineds.co/shared-ui/dist/user-facing-errors.d.ts +14 -2
- package/node_modules/@undefineds.co/shared-ui/dist/user-facing-errors.js +26 -17
- package/node_modules/@undefineds.co/solid-sdk/dist/login-store.d.ts +3 -3
- package/node_modules/@undefineds.co/solid-sdk/dist/login-store.js +3 -3
- package/package.json +17 -7
- package/static/app/assets/main.css +1 -1
- package/static/auth-callback/assets/AiConfigContext-DlFyEWy9.js +1 -0
- package/static/auth-callback/assets/AiConfigPage-CkYk-SFW.js +1 -0
- package/static/auth-callback/assets/DocumentProcessingPanel-CqIr3JqN.js +1 -0
- package/static/auth-callback/assets/IndexLifecyclePanel-C1GKV3Vx.js +1 -0
- package/static/auth-callback/assets/{IndexSubjectPanel-BbUqop4b.js → IndexSubjectPanel-ro9lC6XW.js} +1 -1
- package/static/auth-callback/assets/ModelAssignmentsPanel-DxNdyKRJ.js +1 -0
- package/static/auth-callback/assets/ModelsPage-BVtWSPBU.js +11 -0
- package/static/auth-callback/assets/{NetworkPage-Vp2PrMxs.js → NetworkPage-cEvxRMAl.js} +2 -2
- package/static/auth-callback/assets/{PaneListHeader-DY7baSFl.js → PaneListHeader-ByKw8ada.js} +1 -1
- package/static/auth-callback/assets/SearchIndexingPanel-CulBKcYT.js +1 -0
- package/static/auth-callback/assets/{StatusSubjectPanel-ArIS-TxT.js → StatusSubjectPanel-VOcfrt8o.js} +1 -1
- package/static/{settings/assets/StatusWorkspace-CoMFRXoV.js → auth-callback/assets/StatusWorkspace-Jsz6hAdE.js} +1 -1
- package/static/auth-callback/assets/{SystemSettingsPage-BDvT1NUz.js → SystemSettingsPage-BFNvGAle.js} +1 -1
- package/static/{dashboard/assets/SystemSettingsSubjectPanel-WaE8mTQi.js → auth-callback/assets/SystemSettingsSubjectPanel-DFRdrSfK.js} +5 -5
- package/static/auth-callback/assets/XpodAiConnectionsPodStore-C6KpvHVg.js +3 -0
- package/static/auth-callback/assets/{activity-D1Dsfa_0.js → activity-DnTlb9iM.js} +1 -1
- package/static/auth-callback/assets/ai-connections-C6yaE6WQ.js +1 -0
- package/static/auth-callback/assets/auth-callback-Cx9D_1qj.css +1 -0
- package/static/auth-callback/assets/{auth-callback-Cmf4hXVZ.js → auth-callback-D2UkK5Xj.js} +6 -6
- package/static/auth-callback/assets/{badge-CZsHq3Ih.js → badge-D7IJuuTM.js} +1 -1
- package/static/auth-callback/assets/collection-runtime-wT1n4GS2.js +1 -0
- package/static/auth-callback/assets/dialog-DickLu5z.js +1 -0
- package/static/auth-callback/assets/{download-DU9ntlHw.js → download-kn8WnRu3.js} +1 -1
- package/static/auth-callback/assets/{external-link-BfzaaZDx.js → external-link-B6B8jfSn.js} +1 -1
- package/static/auth-callback/assets/index-Cu0EguPo.js +4 -0
- package/static/auth-callback/assets/index-DHF97YLP.js +41 -0
- package/static/auth-callback/assets/index-Dz83EEHD.js +1 -0
- package/static/auth-callback/assets/{index-browser-BNFqqC74.js → index-browser-CSghinyi.js} +1 -1
- package/static/auth-callback/assets/{key-round-BwP3DBWo.js → key-round-ChkOx3E1.js} +1 -1
- package/static/auth-callback/assets/layout-DB3pMyTl.js +1 -0
- package/static/auth-callback/assets/pod-collections-host-KnnGFZHL.js +8 -0
- package/static/auth-callback/assets/{rotate-ccw-VMwnmyab.js → rotate-ccw-B3hE-nyd.js} +1 -1
- package/static/auth-callback/assets/{skeleton-CoD55rBT.js → skeleton-kEqR7tpI.js} +1 -1
- package/static/auth-callback/assets/{waypoints-DRo_1Ca7.js → waypoints-D6Jo-SZa.js} +1 -1
- package/static/auth-callback/assets/{workspace-layout--mcXl3My.js → workspace-layout-BHwT_cHd.js} +1 -1
- package/static/auth-callback/auth-callback.html +2 -2
- package/static/dashboard/assets/AiConfigContext-BfC3v-x2.js +1 -0
- package/static/dashboard/assets/AiConfigPage-QNS3u7Ff.js +1 -0
- package/static/dashboard/assets/DocumentProcessingPanel-Dr4XLeT4.js +1 -0
- package/static/dashboard/assets/IndexLifecyclePanel-KtM_gpeO.js +1 -0
- package/static/dashboard/assets/{IndexSubjectPanel-B2cXwl8X.js → IndexSubjectPanel-DLaiKdLc.js} +1 -1
- package/static/dashboard/assets/ModelAssignmentsPanel-Bk7TvQRq.js +1 -0
- package/static/dashboard/assets/ModelsPage-Cci3vlos.js +11 -0
- package/static/dashboard/assets/{NetworkPage-DV2V0qWO.js → NetworkPage-Ot4G2dX5.js} +2 -2
- package/static/dashboard/assets/{PaneListHeader-D0c1yCFH.js → PaneListHeader-qHME_s08.js} +1 -1
- package/static/dashboard/assets/SearchIndexingPanel-HZPKj8H9.js +1 -0
- package/static/dashboard/assets/{StatusSubjectPanel-oPSECj7i.js → StatusSubjectPanel-ij7IpI8d.js} +1 -1
- package/static/dashboard/assets/{StatusWorkspace-PdovQPKa.js → StatusWorkspace-Cp02JcaN.js} +1 -1
- package/static/dashboard/assets/{SystemSettingsPage-CtNDklkx.js → SystemSettingsPage-BSeuvb8X.js} +1 -1
- package/static/{settings/assets/SystemSettingsSubjectPanel-DExjDo_v.js → dashboard/assets/SystemSettingsSubjectPanel-CP4_luGS.js} +5 -5
- package/static/dashboard/assets/XpodAiConnectionsPodStore-urO6zaHL.js +18 -0
- package/static/dashboard/assets/{activity-B9ylSoyr.js → activity-DxjgQNvr.js} +1 -1
- package/static/dashboard/assets/ai-connections-CXp5gd1J.js +1 -0
- package/static/dashboard/assets/{badge-BNbFbpIb.js → badge-53qCrRbl.js} +1 -1
- package/static/dashboard/assets/collection-runtime-BPAmHG46.js +1 -0
- package/static/dashboard/assets/{dashboard-CD-FFVRD.js → dashboard-BcT2ByXw.js} +4 -4
- package/static/dashboard/assets/dashboard-Cx9D_1qj.css +1 -0
- package/static/dashboard/assets/dialog-B28YtNhS.js +1 -0
- package/static/dashboard/assets/{download-nOP38LtW.js → download-DkLNceJ4.js} +1 -1
- package/static/dashboard/assets/{external-link-Bh2ewN9E.js → external-link-D3TXnlo3.js} +1 -1
- package/static/dashboard/assets/index-CFIenkeK.js +41 -0
- package/static/dashboard/assets/index-CIiBu9mr.js +1 -0
- package/static/dashboard/assets/index-Gp3cLolR.js +4 -0
- package/static/dashboard/assets/{key-round-bGmguBLv.js → key-round-B5ccp6nx.js} +1 -1
- package/static/dashboard/assets/layout-DB3pMyTl.js +1 -0
- package/static/dashboard/assets/pod-collections-host-KnnGFZHL.js +8 -0
- package/static/dashboard/assets/{rotate-ccw-D2x__ODW.js → rotate-ccw-DUpfkNnk.js} +1 -1
- package/static/dashboard/assets/{skeleton-VOqft8WS.js → skeleton-BRe19fO0.js} +1 -1
- package/static/dashboard/assets/{waypoints-fgRqm4oH.js → waypoints-BKDMxEvu.js} +1 -1
- package/static/dashboard/assets/{workspace-layout-DV4dgeHX.js → workspace-layout-ZTF7C16h.js} +1 -1
- package/static/dashboard/dashboard.html +2 -2
- package/static/settings/assets/AiConfigContext-DsyWgu2i.js +1 -0
- package/static/settings/assets/AiConfigPage-CSCBckKo.js +1 -0
- package/static/settings/assets/DocumentProcessingPanel-w9yQDbBe.js +1 -0
- package/static/settings/assets/IndexLifecyclePanel-CUUXI8mP.js +1 -0
- package/static/settings/assets/{IndexSubjectPanel-BgbI9c-a.js → IndexSubjectPanel-BypAU5TJ.js} +1 -1
- package/static/settings/assets/ModelAssignmentsPanel-BetgXw1G.js +1 -0
- package/static/settings/assets/ModelsPage-DZpTlTZ3.js +11 -0
- package/static/settings/assets/{NetworkPage-C8OA9Mtp.js → NetworkPage-BVkasFGM.js} +2 -2
- package/static/settings/assets/{PaneListHeader-COvlPJWj.js → PaneListHeader-BGOqGec4.js} +1 -1
- package/static/settings/assets/SearchIndexingPanel-DYAbpZ_9.js +1 -0
- package/static/settings/assets/{StatusSubjectPanel-BuLml7qn.js → StatusSubjectPanel-CFgzeQ8Q.js} +1 -1
- package/static/settings/assets/StatusWorkspace-4Z6g4Jvv.js +1 -0
- package/static/settings/assets/{SystemSettingsPage-DlzmaWV-.js → SystemSettingsPage-C1tlrgvI.js} +1 -1
- package/static/{auth-callback/assets/SystemSettingsSubjectPanel-CDqRuC4t.js → settings/assets/SystemSettingsSubjectPanel-CcURI-1L.js} +5 -5
- package/static/settings/assets/XpodAiConnectionsPodStore-owBQc5nY.js +3 -0
- package/static/settings/assets/{activity-TLerXgMs.js → activity-CtBc9cNy.js} +1 -1
- package/static/settings/assets/ai-connections-C6yaE6WQ.js +1 -0
- package/static/settings/assets/{badge-Bcs8iWrH.js → badge--r-FDIhU.js} +1 -1
- package/static/settings/assets/collection-runtime-CnhPmwAM.js +1 -0
- package/static/settings/assets/dialog-B7ZRsjN7.js +1 -0
- package/static/settings/assets/{download-Ct3QmHPt.js → download-DgQ1F8QR.js} +1 -1
- package/static/settings/assets/{external-link-C8KiHbss.js → external-link-Bz7NckNO.js} +1 -1
- package/static/settings/assets/index-BdXwm8nh.js +4 -0
- package/static/settings/assets/index-CkGda_Pg.js +41 -0
- package/static/settings/assets/index-Vv-8Vslg.js +1 -0
- package/static/settings/assets/{index-browser-CazX1pc2.js → index-browser-Dq7omlpY.js} +1 -1
- package/static/settings/assets/{key-round-B19YD1GA.js → key-round-CvuhloKV.js} +1 -1
- package/static/settings/assets/layout-DB3pMyTl.js +1 -0
- package/static/settings/assets/pod-collections-host-KnnGFZHL.js +8 -0
- package/static/settings/assets/{rotate-ccw-AQm2kMgU.js → rotate-ccw-DgFKDaz7.js} +1 -1
- package/static/settings/assets/{settings-C-VBtt9r.js → settings-BvqY7K96.js} +5 -5
- package/static/settings/assets/settings-Cx9D_1qj.css +1 -0
- package/static/settings/assets/{skeleton-DyZ1OBYf.js → skeleton-D3OeFDF6.js} +1 -1
- package/static/settings/assets/{waypoints-CC3wq-SU.js → waypoints-C4WbspTb.js} +1 -1
- package/static/settings/assets/{workspace-layout-BxXNKgf9.js → workspace-layout-B9H1Tqrk.js} +1 -1
- package/static/settings/settings.html +2 -2
- package/node_modules/@undefineds.co/ai-connections/dist/ai-connections-client.js +0 -13
- package/node_modules/@undefineds.co/ai-connections/dist/provider-catalog.d.ts +0 -9
- package/static/auth-callback/assets/AiConfigContext-DqWRSm7n.js +0 -1
- package/static/auth-callback/assets/AiConfigPage-C5YYyvzl.js +0 -1
- package/static/auth-callback/assets/DocumentProcessingPanel-DZCiacBz.js +0 -1
- package/static/auth-callback/assets/IndexLifecyclePanel-CCLeOljB.js +0 -1
- package/static/auth-callback/assets/ModelAssignmentsPanel-jUUTDKuh.js +0 -1
- package/static/auth-callback/assets/ModelsPage-B08zdtff.js +0 -10
- package/static/auth-callback/assets/SearchIndexingPanel-D4YRg1-8.js +0 -1
- package/static/auth-callback/assets/StatusWorkspace-Cp5LQ9Yx.js +0 -1
- package/static/auth-callback/assets/ai-connections-CHNTKemd.js +0 -1
- package/static/auth-callback/assets/auth-callback-DWMMiFjh.css +0 -1
- package/static/auth-callback/assets/index-DSNnLUbU.js +0 -4
- package/static/auth-callback/assets/index-FHhHoKgp.js +0 -41
- package/static/dashboard/assets/AiConfigContext-BpPDKSzI.js +0 -1
- package/static/dashboard/assets/AiConfigPage-wsqEZDIX.js +0 -1
- package/static/dashboard/assets/DocumentProcessingPanel-CDSy3juc.js +0 -1
- package/static/dashboard/assets/IndexLifecyclePanel-CVd6vQCX.js +0 -1
- package/static/dashboard/assets/ModelAssignmentsPanel-BeBZhnQd.js +0 -1
- package/static/dashboard/assets/ModelsPage-B6McSCJw.js +0 -25
- package/static/dashboard/assets/SearchIndexingPanel-CGs0OZ12.js +0 -1
- package/static/dashboard/assets/ai-connections-CHNTKemd.js +0 -1
- package/static/dashboard/assets/dashboard-DWMMiFjh.css +0 -1
- package/static/dashboard/assets/index-PgS-Bt7X.js +0 -41
- package/static/dashboard/assets/index-QN2QgEwr.js +0 -4
- package/static/settings/assets/AiConfigContext-zKQYdfai.js +0 -1
- package/static/settings/assets/AiConfigPage-Bs1EE3Ei.js +0 -1
- package/static/settings/assets/DocumentProcessingPanel-CSFfdOXS.js +0 -1
- package/static/settings/assets/IndexLifecyclePanel-BR9Su49B.js +0 -1
- package/static/settings/assets/ModelAssignmentsPanel-C0BE7nbk.js +0 -1
- package/static/settings/assets/ModelsPage-CU-YQ8_7.js +0 -10
- package/static/settings/assets/SearchIndexingPanel-Bdd46mIV.js +0 -1
- package/static/settings/assets/ai-connections-CHNTKemd.js +0 -1
- package/static/settings/assets/index-1Q2cRjZd.js +0 -41
- package/static/settings/assets/index-DBO_Vq0P.js +0 -4
- package/static/settings/assets/settings-DWMMiFjh.css +0 -1
- /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/request.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/types.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/codex.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/codex.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/index.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/index.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/json-env-adapter.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/json-env-adapter.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/pi.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/pi.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/transaction.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/transaction.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/types.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/types.js +0 -0
|
@@ -8,7 +8,6 @@ import type { AiConnectAttempt, AiConnectionsCredential, AiConnectionsProvider,
|
|
|
8
8
|
* within this module family. The published surface is the explicit list in
|
|
9
9
|
* `ai-connections-client.ts`, not this file.
|
|
10
10
|
*/
|
|
11
|
-
export declare const AI_CONNECTIONS_GENERIC_ERROR_MESSAGE = "AI Connection request failed. Please try again.";
|
|
12
11
|
/**
|
|
13
12
|
* Validate and normalize a user supplied upstream proxy URL. Proxy credentials
|
|
14
13
|
* are intentionally rejected because proxy auth is not stored in the Pod
|
|
@@ -16,16 +15,27 @@ export declare const AI_CONNECTIONS_GENERIC_ERROR_MESSAGE = "AI Connection reque
|
|
|
16
15
|
*/
|
|
17
16
|
export declare function normalizeProxyUrl(value: string | undefined | null): string | undefined;
|
|
18
17
|
export declare function redactProxyUrl(value: string | undefined | null): string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* A failed AI Connection request.
|
|
20
|
+
*
|
|
21
|
+
* It carries the facts a caller needs to decide what to say - the wire code, the
|
|
22
|
+
* upstream status, the payload itself - and a diagnostic message that names the
|
|
23
|
+
* code. The sentence a user reads is the applet's (`error-wording.ts`): a shared
|
|
24
|
+
* client must not pick the wording for whoever happens to render it.
|
|
25
|
+
*/
|
|
19
26
|
export declare class AiConnectionsRequestError extends Error {
|
|
20
27
|
readonly code?: string;
|
|
28
|
+
readonly status: number;
|
|
21
29
|
readonly providerStatus?: number;
|
|
22
|
-
|
|
30
|
+
readonly payload: unknown;
|
|
31
|
+
readonly provider?: string;
|
|
32
|
+
readonly authMode?: string;
|
|
33
|
+
constructor(payload: unknown, status: number, context?: {
|
|
34
|
+
provider?: string;
|
|
35
|
+
authMode?: string;
|
|
36
|
+
});
|
|
23
37
|
}
|
|
24
|
-
export declare function
|
|
25
|
-
export declare function normalizeAiConnectionsErrorMessage(payload: unknown, status: number, context?: {
|
|
26
|
-
provider?: AiConnectionsProvider;
|
|
27
|
-
authMode?: 'apiKey' | 'deviceCodeOAuth' | 'local';
|
|
28
|
-
}): string;
|
|
38
|
+
export declare function aiConnectionsErrorCode(payload: unknown): string | undefined;
|
|
29
39
|
export declare function readJson(response: Response): Promise<unknown>;
|
|
30
40
|
export declare function assertProvider(provider: string): asserts provider is AiConnectionsProvider;
|
|
31
41
|
export declare function parseGatewayKeyRecord(value: unknown): GatewayKeyRecord | undefined;
|
package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/normalize.js
RENAMED
|
@@ -8,7 +8,6 @@ import { AI_CONNECTIONS_PROVIDERS } from './types.js';
|
|
|
8
8
|
* within this module family. The published surface is the explicit list in
|
|
9
9
|
* `ai-connections-client.ts`, not this file.
|
|
10
10
|
*/
|
|
11
|
-
export const AI_CONNECTIONS_GENERIC_ERROR_MESSAGE = 'AI Connection request failed. Please try again.';
|
|
12
11
|
/**
|
|
13
12
|
* Validate and normalize a user supplied upstream proxy URL. Proxy credentials
|
|
14
13
|
* are intentionally rejected because proxy auth is not stored in the Pod
|
|
@@ -49,109 +48,29 @@ export function redactProxyUrl(value) {
|
|
|
49
48
|
parsed.hash = '';
|
|
50
49
|
return parsed.href.replace(/\/$/u, '');
|
|
51
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* A failed AI Connection request.
|
|
53
|
+
*
|
|
54
|
+
* It carries the facts a caller needs to decide what to say - the wire code, the
|
|
55
|
+
* upstream status, the payload itself - and a diagnostic message that names the
|
|
56
|
+
* code. The sentence a user reads is the applet's (`error-wording.ts`): a shared
|
|
57
|
+
* client must not pick the wording for whoever happens to render it.
|
|
58
|
+
*/
|
|
52
59
|
export class AiConnectionsRequestError extends Error {
|
|
53
|
-
constructor(
|
|
54
|
-
|
|
60
|
+
constructor(payload, status, context = {}) {
|
|
61
|
+
const code = aiConnectionsErrorCode(payload);
|
|
62
|
+
super(code ? `AI Connection request failed: ${code}` : `AI Connection request failed (HTTP ${status})`);
|
|
55
63
|
this.name = 'AiConnectionsRequestError';
|
|
56
|
-
this.code =
|
|
64
|
+
this.code = code;
|
|
65
|
+
this.status = status;
|
|
57
66
|
this.providerStatus = isRecord(payload) && typeof payload.providerStatus === 'number'
|
|
58
67
|
? payload.providerStatus : undefined;
|
|
68
|
+
this.payload = payload;
|
|
69
|
+
this.provider = context.provider;
|
|
70
|
+
this.authMode = context.authMode;
|
|
59
71
|
}
|
|
60
72
|
}
|
|
61
|
-
export function
|
|
62
|
-
if (error instanceof Error) {
|
|
63
|
-
return normalizeAiConnectionsErrorText(error.message);
|
|
64
|
-
}
|
|
65
|
-
return normalizeAiConnectionsErrorText(String(error));
|
|
66
|
-
}
|
|
67
|
-
export function normalizeAiConnectionsErrorMessage(payload, status, context = {}) {
|
|
68
|
-
const code = errorCodeFromPayload(payload);
|
|
69
|
-
if (code === 'provider_models_response_error') {
|
|
70
|
-
const message = isRecord(payload) && typeof payload.message === 'string'
|
|
71
|
-
? sanitizeProviderResponseMessage(payload.message)
|
|
72
|
-
: undefined;
|
|
73
|
-
if (message)
|
|
74
|
-
return message;
|
|
75
|
-
return '模型列表获取失败。请检查密钥、服务地址或网络后重试。';
|
|
76
|
-
}
|
|
77
|
-
if (code === 'provider_models_fetch_failed') {
|
|
78
|
-
const providerStatus = isRecord(payload) && typeof payload.providerStatus === 'number'
|
|
79
|
-
? payload.providerStatus
|
|
80
|
-
: undefined;
|
|
81
|
-
const providerMessage = isRecord(payload) && typeof payload.providerMessage === 'string'
|
|
82
|
-
? payload.providerMessage.trim()
|
|
83
|
-
: undefined;
|
|
84
|
-
return withProviderMessage(modelDiscoveryErrorMessage(providerStatus, context.authMode), providerMessage);
|
|
85
|
-
}
|
|
86
|
-
const coded = code ? messageForSafeErrorCode(code, context.provider) : undefined;
|
|
87
|
-
if (coded)
|
|
88
|
-
return coded;
|
|
89
|
-
const text = isRecord(payload) && typeof payload.error === 'string'
|
|
90
|
-
? payload.error
|
|
91
|
-
: undefined;
|
|
92
|
-
if (text) {
|
|
93
|
-
const exact = messageForSafeErrorCode(text, context.provider);
|
|
94
|
-
if (exact)
|
|
95
|
-
return exact;
|
|
96
|
-
if (text === 'AI Connection service identity is unavailable') {
|
|
97
|
-
return text;
|
|
98
|
-
}
|
|
99
|
-
if (text === 'Provider credential not found for current identity') {
|
|
100
|
-
return '当前身份没有可用的额度凭证。';
|
|
101
|
-
}
|
|
102
|
-
if (text === 'Provider quota adapter not found' || text === 'Provider quota lookup failed') {
|
|
103
|
-
return '该接入方式不支持查询官方额度。';
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
if (status === 401)
|
|
107
|
-
return 'Please sign in again to continue.';
|
|
108
|
-
if (status === 403)
|
|
109
|
-
return 'AI Connection permission was denied.';
|
|
110
|
-
if (status === 404 && context.provider) {
|
|
111
|
-
return `${providerLabel(context.provider)} connection is not configured.`;
|
|
112
|
-
}
|
|
113
|
-
if (status === 429)
|
|
114
|
-
return 'AI Connection is rate limited. Please try again later.';
|
|
115
|
-
if (status === 503)
|
|
116
|
-
return 'AI Connection service is unavailable.';
|
|
117
|
-
return AI_CONNECTIONS_GENERIC_ERROR_MESSAGE;
|
|
118
|
-
}
|
|
119
|
-
const LOCAL_SESSION_REFRESH_FAILED_MESSAGE = '订阅登录态自动刷新失败,请稍后重试。';
|
|
120
|
-
const LOCAL_SESSION_REAUTH_REQUIRED_MESSAGE = '订阅登录态已失效,请在原客户端重新登录后重读,或使用设备码登录。';
|
|
121
|
-
const OAUTH_MODEL_AUTH_FAILED_MESSAGE = '订阅登录态不可用,请重读登录态或重新登录后再同步模型。';
|
|
122
|
-
const MODEL_DISCOVERY_SAFE_MESSAGES = new Set([
|
|
123
|
-
OAUTH_MODEL_AUTH_FAILED_MESSAGE,
|
|
124
|
-
LOCAL_SESSION_REFRESH_FAILED_MESSAGE,
|
|
125
|
-
LOCAL_SESSION_REAUTH_REQUIRED_MESSAGE,
|
|
126
|
-
'密钥不可用。请检查密钥是否填写正确,或换一个密钥后重试。',
|
|
127
|
-
'模型服务地址不正确。请检查服务地址后重试。',
|
|
128
|
-
'请求太频繁。请稍等一会儿再试。',
|
|
129
|
-
'模型服务暂时没有响应。请稍后重试。',
|
|
130
|
-
'模型列表获取失败。请检查密钥、服务地址或网络后重试。',
|
|
131
|
-
]);
|
|
132
|
-
function normalizeAiConnectionsErrorText(message) {
|
|
133
|
-
if (message.startsWith('provider_models_response_error:')) {
|
|
134
|
-
return sanitizeProviderResponseMessage(message.slice('provider_models_response_error:'.length))
|
|
135
|
-
?? '模型列表获取失败。请检查密钥、服务地址或网络后重试。';
|
|
136
|
-
}
|
|
137
|
-
const exact = messageForSafeErrorCode(message);
|
|
138
|
-
if (exact)
|
|
139
|
-
return exact;
|
|
140
|
-
const prefix = message.split(':', 1)[0]?.trim();
|
|
141
|
-
const prefixed = prefix ? messageForSafeErrorCode(prefix) : undefined;
|
|
142
|
-
if (prefixed)
|
|
143
|
-
return prefixed;
|
|
144
|
-
if (message === 'AI Connection service identity is unavailable')
|
|
145
|
-
return message;
|
|
146
|
-
if (MODEL_DISCOVERY_SAFE_MESSAGES.has(message))
|
|
147
|
-
return message;
|
|
148
|
-
if (isModelDiscoveryMessageWithProviderDetail(message))
|
|
149
|
-
return message;
|
|
150
|
-
if (message.startsWith('invalid_'))
|
|
151
|
-
return 'AI Connection returned an invalid response.';
|
|
152
|
-
return AI_CONNECTIONS_GENERIC_ERROR_MESSAGE;
|
|
153
|
-
}
|
|
154
|
-
function errorCodeFromPayload(payload) {
|
|
73
|
+
export function aiConnectionsErrorCode(payload) {
|
|
155
74
|
if (!isRecord(payload))
|
|
156
75
|
return undefined;
|
|
157
76
|
if (typeof payload.code === 'string')
|
|
@@ -163,107 +82,6 @@ function errorCodeFromPayload(payload) {
|
|
|
163
82
|
}
|
|
164
83
|
return undefined;
|
|
165
84
|
}
|
|
166
|
-
function messageForSafeErrorCode(code, provider) {
|
|
167
|
-
switch (code.trim().toLowerCase().replace(/-/g, '_')) {
|
|
168
|
-
case 'not_configured':
|
|
169
|
-
case 'notconfigured':
|
|
170
|
-
return provider
|
|
171
|
-
? `${providerLabel(provider)} connection is not configured.`
|
|
172
|
-
: 'AI provider connection is not configured.';
|
|
173
|
-
case 'unsupported':
|
|
174
|
-
return provider
|
|
175
|
-
? `${providerLabel(provider)} does not support this operation.`
|
|
176
|
-
: 'This AI Connection operation is not supported.';
|
|
177
|
-
case 'service_identity_unavailable':
|
|
178
|
-
return 'AI Connection service identity is unavailable';
|
|
179
|
-
case 'unauthorized':
|
|
180
|
-
return 'Please sign in again to continue.';
|
|
181
|
-
case 'forbidden':
|
|
182
|
-
case 'permission_denied':
|
|
183
|
-
return 'AI Connection permission was denied.';
|
|
184
|
-
case 'rate_limited':
|
|
185
|
-
return 'AI Connection is rate limited. Please try again later.';
|
|
186
|
-
case 'service_unavailable':
|
|
187
|
-
return 'AI Connection service is unavailable.';
|
|
188
|
-
case 'unsafe_provider_base_url':
|
|
189
|
-
return '该服务地址指向 Xpod 不允许访问的网络,请改用公网 HTTPS 地址。';
|
|
190
|
-
case 'invalid_proxy_url':
|
|
191
|
-
return '代理地址必须是无账号密码的 HTTP 或 HTTPS 地址。';
|
|
192
|
-
case 'oauth_refresh_failed':
|
|
193
|
-
case 'oauth_refresh_unavailable':
|
|
194
|
-
case 'local_session_refresh_failed':
|
|
195
|
-
return LOCAL_SESSION_REFRESH_FAILED_MESSAGE;
|
|
196
|
-
case 'oauth_session_reauth_required':
|
|
197
|
-
case 'oauth_refresh_token_required':
|
|
198
|
-
case 'local_session_reauth_required':
|
|
199
|
-
case 'local_session_missing_refresh_token':
|
|
200
|
-
return LOCAL_SESSION_REAUTH_REQUIRED_MESSAGE;
|
|
201
|
-
case 'models_persistence_failed':
|
|
202
|
-
return '模型已获取,但保存到 Pod 失败。请重试同步模型。';
|
|
203
|
-
case 'quota_credential_not_found':
|
|
204
|
-
return '当前身份没有可用的额度凭证。';
|
|
205
|
-
case 'credential_secret_unavailable':
|
|
206
|
-
return '当前凭证密钥不可用,请重新保存后再查询额度。';
|
|
207
|
-
case 'gateway_api_key_plaintext_unavailable':
|
|
208
|
-
return 'Pod 中未找到此 API Key 的原文,无法复制配置。请创建新的 Key,更新客户端后再删除旧 Key。';
|
|
209
|
-
case 'quota_adapter_not_found':
|
|
210
|
-
return '该接入方式不支持查询官方额度。';
|
|
211
|
-
default:
|
|
212
|
-
return undefined;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
function modelDiscoveryErrorMessage(providerStatus, authMode) {
|
|
216
|
-
if (providerStatus === 401 || providerStatus === 403) {
|
|
217
|
-
if (authMode === 'deviceCodeOAuth')
|
|
218
|
-
return OAUTH_MODEL_AUTH_FAILED_MESSAGE;
|
|
219
|
-
return '密钥不可用。请检查密钥是否填写正确,或换一个密钥后重试。';
|
|
220
|
-
}
|
|
221
|
-
if (providerStatus === 404) {
|
|
222
|
-
return '模型服务地址不正确。请检查服务地址后重试。';
|
|
223
|
-
}
|
|
224
|
-
if (providerStatus === 429) {
|
|
225
|
-
return '请求太频繁。请稍等一会儿再试。';
|
|
226
|
-
}
|
|
227
|
-
if (providerStatus !== undefined && providerStatus >= 500) {
|
|
228
|
-
return '模型服务暂时没有响应。请稍后重试。';
|
|
229
|
-
}
|
|
230
|
-
return '模型列表获取失败。请检查密钥、服务地址或网络后重试。';
|
|
231
|
-
}
|
|
232
|
-
function withProviderMessage(message, providerMessage) {
|
|
233
|
-
const sanitized = providerMessage ? sanitizeProviderResponseMessage(providerMessage) : undefined;
|
|
234
|
-
if (!sanitized)
|
|
235
|
-
return message;
|
|
236
|
-
return `${message} 上游返回:${sanitized}`;
|
|
237
|
-
}
|
|
238
|
-
function isModelDiscoveryMessageWithProviderDetail(message) {
|
|
239
|
-
const marker = ' 上游返回:';
|
|
240
|
-
const index = message.indexOf(marker);
|
|
241
|
-
if (index <= 0)
|
|
242
|
-
return false;
|
|
243
|
-
return MODEL_DISCOVERY_SAFE_MESSAGES.has(message.slice(0, index));
|
|
244
|
-
}
|
|
245
|
-
function sanitizeProviderResponseMessage(value) {
|
|
246
|
-
const sanitized = value
|
|
247
|
-
.replace(/[\u0000-\u001f\u007f]/gu, ' ')
|
|
248
|
-
.replace(/\bBearer\s+[^\s,;]+/giu, 'Bearer [REDACTED]')
|
|
249
|
-
.replace(/(?:sk|id)[._-][A-Za-z0-9._-]{8,}/gu, '[REDACTED]')
|
|
250
|
-
.replace(/https?:\/\/[^\s]+/giu, '[URL]')
|
|
251
|
-
.trim()
|
|
252
|
-
.slice(0, 240);
|
|
253
|
-
return sanitized || undefined;
|
|
254
|
-
}
|
|
255
|
-
function providerLabel(provider) {
|
|
256
|
-
switch (provider) {
|
|
257
|
-
case 'openai': return 'OpenAI';
|
|
258
|
-
case 'anthropic': return 'Anthropic';
|
|
259
|
-
case 'kimi': return 'Kimi';
|
|
260
|
-
case 'bailian': return 'Bailian';
|
|
261
|
-
case 'deepseek': return 'DeepSeek';
|
|
262
|
-
case 'zhipu': return 'Zhipu';
|
|
263
|
-
case 'ollama': return 'Ollama';
|
|
264
|
-
case 'custom': return 'Custom';
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
85
|
export async function readJson(response) {
|
|
268
86
|
const text = await response.text();
|
|
269
87
|
if (!text)
|
|
@@ -386,10 +204,21 @@ function modelCapabilitiesFromWire(value) {
|
|
|
386
204
|
const capabilities = [];
|
|
387
205
|
if (value.capabilities.imageInput === true)
|
|
388
206
|
capabilities.push('image');
|
|
207
|
+
// Only what a model can do for the caller earns a mark. `parallelToolCalls`
|
|
208
|
+
// refines tool calling and `promptCaching` is a transport optimisation, so
|
|
209
|
+
// neither becomes a marker of its own.
|
|
389
210
|
if (value.capabilities.toolCalls === true)
|
|
390
211
|
capabilities.push('tool_call');
|
|
391
212
|
if (value.capabilities.reasoningEffort === true)
|
|
392
213
|
capabilities.push('reasoning');
|
|
214
|
+
// A curated tier marker, not a measurement: the catalog has no latency data,
|
|
215
|
+
// so a model is only "fast" because the catalog says so.
|
|
216
|
+
if (value.capabilities.fast === true)
|
|
217
|
+
capabilities.push('fast');
|
|
218
|
+
// Catalog-provided embedding models carry the capability as an object flag, the
|
|
219
|
+
// same way the AI Config embedding assignment reads them.
|
|
220
|
+
if (value.capabilities.embedding === true)
|
|
221
|
+
capabilities.push('embedding');
|
|
393
222
|
return capabilities.length > 0 ? capabilities : undefined;
|
|
394
223
|
}
|
|
395
224
|
function isPlatformModelId(modelId) {
|
|
@@ -524,7 +353,7 @@ function parseAuthorizationMethod(value) {
|
|
|
524
353
|
id: value.id,
|
|
525
354
|
authMode,
|
|
526
355
|
connectMode,
|
|
527
|
-
label: stringValue(value.label)
|
|
356
|
+
label: stringValue(value.label),
|
|
528
357
|
lifecycle,
|
|
529
358
|
reason: stringValue(value.reason),
|
|
530
359
|
});
|
|
@@ -532,19 +361,6 @@ function parseAuthorizationMethod(value) {
|
|
|
532
361
|
function authorizationMethodLifecycleValue(value) {
|
|
533
362
|
return value === 'active' || value === 'unavailable' ? value : undefined;
|
|
534
363
|
}
|
|
535
|
-
function authorizationMethodFallbackLabel(id, authMode) {
|
|
536
|
-
if (id === 'device-code')
|
|
537
|
-
return '设备码登录';
|
|
538
|
-
if (id === 'local-session-import')
|
|
539
|
-
return '已有登录态';
|
|
540
|
-
if (id === 'local-service')
|
|
541
|
-
return '本地服务';
|
|
542
|
-
if (id === 'api-key' || authMode === 'apiKey')
|
|
543
|
-
return 'API Key';
|
|
544
|
-
if (authMode === 'local')
|
|
545
|
-
return '本地服务';
|
|
546
|
-
return '浏览器登录';
|
|
547
|
-
}
|
|
548
364
|
function offeringLifecycleValue(value) {
|
|
549
365
|
return value === 'active' || value === 'legacy' || value === 'unavailable'
|
|
550
366
|
? value
|
|
@@ -835,12 +651,18 @@ export function parseModelDiscovery(value, expectedProvider) {
|
|
|
835
651
|
.map((item) => {
|
|
836
652
|
if (!isRecord(item) || typeof item.id !== 'string' || !item.id)
|
|
837
653
|
return undefined;
|
|
654
|
+
const capabilities = Array.isArray(item.capabilities)
|
|
655
|
+
? item.capabilities.filter((cap) => typeof cap === 'string')
|
|
656
|
+
: undefined;
|
|
657
|
+
const modelType = discoveredModelType(item.modelType);
|
|
838
658
|
return compactObject({
|
|
839
659
|
id: item.id,
|
|
840
660
|
displayName: stringValue(item.displayName),
|
|
841
|
-
capabilities
|
|
842
|
-
|
|
843
|
-
|
|
661
|
+
// A provider that declares capabilities sends them; otherwise the type
|
|
662
|
+
// is the only evidence a row has, and an embedding model without it is
|
|
663
|
+
// listed as if it were a chat model.
|
|
664
|
+
capabilities: capabilities ?? (modelType === 'embedding' ? ['embedding'] : undefined),
|
|
665
|
+
modelType,
|
|
844
666
|
});
|
|
845
667
|
})
|
|
846
668
|
.filter(isDefined);
|
|
@@ -855,6 +677,16 @@ export function parseModelDiscovery(value, expectedProvider) {
|
|
|
855
677
|
export function compactObject(value) {
|
|
856
678
|
return Object.fromEntries(Object.entries(value).filter(([, item]) => item !== undefined));
|
|
857
679
|
}
|
|
680
|
+
/**
|
|
681
|
+
* Only the two classes the Pod stores survive the wire.
|
|
682
|
+
*
|
|
683
|
+
* A server that sends anything else (an older release, a provider's own
|
|
684
|
+
* vocabulary) leaves the row untyped, which reads as a chat model - never as a
|
|
685
|
+
* value the AI config write would reject.
|
|
686
|
+
*/
|
|
687
|
+
function discoveredModelType(value) {
|
|
688
|
+
return value === 'chat' || value === 'embedding' ? value : undefined;
|
|
689
|
+
}
|
|
858
690
|
function stringValue(value) {
|
|
859
691
|
return typeof value === 'string' ? value : undefined;
|
|
860
692
|
}
|
package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/request.js
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AiConnectionsRequestError, assertProvider, compactObject, isDefined, isRecord,
|
|
1
|
+
import { AiConnectionsRequestError, assertProvider, compactObject, isDefined, isRecord, parseAuthorizationMethodsSummary, parseConnectAttempt, parseCredential, parseCustomModelList, parseGatewayKeyRecord, parseGatewayModel, parseModelDiscovery, parseProviderCredentialSummary, parseProviderSummaries, readJson, sanitizePublicObject, } from './normalize.js';
|
|
2
2
|
/**
|
|
3
3
|
* The HTTP client itself: one factory over the Pod base URL and an authenticated
|
|
4
4
|
* fetch, with every response normalised by `normalize.ts`.
|
|
@@ -25,7 +25,7 @@ export function createAiConnectionsClient({ webId, podBaseUrl, authenticatedFetc
|
|
|
25
25
|
});
|
|
26
26
|
const payload = await readJson(response);
|
|
27
27
|
if (!response.ok) {
|
|
28
|
-
throw new AiConnectionsRequestError(
|
|
28
|
+
throw new AiConnectionsRequestError(payload, response.status, context);
|
|
29
29
|
}
|
|
30
30
|
return payload;
|
|
31
31
|
};
|
|
@@ -64,7 +64,7 @@ export function createAiConnectionsClient({ webId, podBaseUrl, authenticatedFetc
|
|
|
64
64
|
return [];
|
|
65
65
|
const payload = await readJson(response);
|
|
66
66
|
if (!response.ok) {
|
|
67
|
-
throw new
|
|
67
|
+
throw new AiConnectionsRequestError(payload, response.status);
|
|
68
68
|
}
|
|
69
69
|
return isRecord(payload) && Array.isArray(payload.data)
|
|
70
70
|
? payload.data.map(parseAuthorizationMethodsSummary).filter(isDefined)
|
package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/types.d.ts
RENAMED
|
@@ -85,6 +85,13 @@ export interface CreatedGatewayKey {
|
|
|
85
85
|
}
|
|
86
86
|
export interface AiGatewayModel extends AiConnectionsModelSelection {
|
|
87
87
|
provider: AiConnectionsProvider;
|
|
88
|
+
/**
|
|
89
|
+
* What kind of model this row is, when the Pod or the provider catalog knows.
|
|
90
|
+
*
|
|
91
|
+
* Rows read from the Pod carry it as their own column; the settings list shows
|
|
92
|
+
* it as the same capability mark the Gateway projection uses.
|
|
93
|
+
*/
|
|
94
|
+
modelType?: DiscoveredProviderModelType;
|
|
88
95
|
/** Owning credential for providers that allow multiple independent custom endpoints. */
|
|
89
96
|
credentialId?: string;
|
|
90
97
|
displayName?: string;
|
|
@@ -96,10 +103,21 @@ export interface AiGatewayModel extends AiConnectionsModelSelection {
|
|
|
96
103
|
outputModalities?: string[];
|
|
97
104
|
capabilities?: string[];
|
|
98
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* What the provider's own model list said a model is.
|
|
108
|
+
*
|
|
109
|
+
* Two values only, because that is the distinction the product acts on and the
|
|
110
|
+
* only one the Pod can store: the server infers it
|
|
111
|
+
* (`ProviderModelType.inferProviderModelType`) and the Pod row keeps it, so an
|
|
112
|
+
* embedding model stays selectable for embedding instead of being stored as an
|
|
113
|
+
* ordinary chat model.
|
|
114
|
+
*/
|
|
115
|
+
export type DiscoveredProviderModelType = 'chat' | 'embedding';
|
|
99
116
|
export interface DiscoveredProviderModel {
|
|
100
117
|
id: string;
|
|
101
118
|
displayName?: string;
|
|
102
119
|
capabilities?: string[];
|
|
120
|
+
modelType?: DiscoveredProviderModelType;
|
|
103
121
|
}
|
|
104
122
|
export interface CustomProviderModel {
|
|
105
123
|
id: string;
|
|
@@ -117,12 +135,23 @@ export interface ProviderModelDiscovery {
|
|
|
117
135
|
observedAt: string;
|
|
118
136
|
source: string;
|
|
119
137
|
}
|
|
120
|
-
export type AiProviderAuthorizationMethodId = 'device-code' | 'local-session-import' | 'api-key' | 'local-service'
|
|
138
|
+
export type AiProviderAuthorizationMethodId = 'device-code' | 'local-session-import' | 'api-key' | 'local-service'
|
|
139
|
+
/** Opens the provider console to sign in and mint the key the entry then stores. */
|
|
140
|
+
| 'browser-login'
|
|
141
|
+
/** Starts an authorization-code browser sign-in and waits for the local callback. */
|
|
142
|
+
| 'browser-oauth' | string;
|
|
121
143
|
export interface AiProviderAuthorizationMethod {
|
|
122
144
|
id: AiProviderAuthorizationMethodId;
|
|
123
145
|
authMode: 'oauth' | 'deviceCode' | 'local' | 'apiKey';
|
|
124
146
|
connectMode?: AiConnectionsMode;
|
|
125
|
-
|
|
147
|
+
/**
|
|
148
|
+
* The wording the entry is shown under. Optional on purpose: the shared core
|
|
149
|
+
* names the action by `id` and the applet supplies the wording, so a payload
|
|
150
|
+
* carrying none is still a complete contract. A provider the user configured
|
|
151
|
+
* may declare its own wording here, which is what keeps a custom entry from
|
|
152
|
+
* rendering under a built-in name.
|
|
153
|
+
*/
|
|
154
|
+
label?: string;
|
|
126
155
|
lifecycle: 'active' | 'unavailable';
|
|
127
156
|
reason?: string;
|
|
128
157
|
}
|
|
@@ -20,8 +20,7 @@ interface OwnershipState {
|
|
|
20
20
|
export declare function hashWebId(webId: string): string;
|
|
21
21
|
declare function contentHash(value: string): string;
|
|
22
22
|
export declare const contentFingerprint: typeof contentHash;
|
|
23
|
-
export
|
|
24
|
-
export declare function normalizeMessagesEndpoint(endpoint: string): string;
|
|
23
|
+
export { normalizeMessagesEndpoint, normalizeV1Endpoint } from '../endpoint-urls';
|
|
25
24
|
export declare function parseJsonObject(content: string | undefined, label: string): Record<string, unknown>;
|
|
26
25
|
export declare function stringifyJson(value: unknown): string;
|
|
27
26
|
export declare function looksLikePreviousXpodValue(value: unknown): boolean;
|
|
@@ -68,4 +67,3 @@ export declare abstract class BaseAiClientConfigAdapter implements AiClientConfi
|
|
|
68
67
|
private exists;
|
|
69
68
|
private isExecutableOnPath;
|
|
70
69
|
}
|
|
71
|
-
export {};
|
|
@@ -17,13 +17,9 @@ function contentHash(value) {
|
|
|
17
17
|
return crypto.createHash('sha256').update(value, 'utf8').digest('hex');
|
|
18
18
|
}
|
|
19
19
|
export const contentFingerprint = contentHash;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
export function normalizeMessagesEndpoint(endpoint) {
|
|
25
|
-
return endpoint.trim().replace(/\/+$/, '').replace(/\/v1$/, '');
|
|
26
|
-
}
|
|
20
|
+
// The base-URL rules are shared with the UI (see src/endpoint-urls.ts); they are
|
|
21
|
+
// re-exported here so adapters keep importing them from one place.
|
|
22
|
+
export { normalizeMessagesEndpoint, normalizeV1Endpoint } from '../endpoint-urls.js';
|
|
27
23
|
export function parseJsonObject(content, label) {
|
|
28
24
|
if (!content?.trim())
|
|
29
25
|
return {};
|
|
@@ -269,6 +269,15 @@ class AiClientConfigTransaction {
|
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
+
// src/endpoint-urls.ts
|
|
273
|
+
function normalizeV1Endpoint(endpoint) {
|
|
274
|
+
const normalized = endpoint.trim().replace(/\/+$/, "");
|
|
275
|
+
return normalized.endsWith("/v1") ? normalized : `${normalized}/v1`;
|
|
276
|
+
}
|
|
277
|
+
function normalizeMessagesEndpoint(endpoint) {
|
|
278
|
+
return endpoint.trim().replace(/\/+$/, "").replace(/\/v1$/, "");
|
|
279
|
+
}
|
|
280
|
+
|
|
272
281
|
// src/client-config/base-adapter.ts
|
|
273
282
|
class AiClientConfigError extends Error {
|
|
274
283
|
code;
|
|
@@ -285,13 +294,6 @@ function contentHash(value) {
|
|
|
285
294
|
return crypto2.createHash("sha256").update(value, "utf8").digest("hex");
|
|
286
295
|
}
|
|
287
296
|
var contentFingerprint = contentHash;
|
|
288
|
-
function normalizeV1Endpoint(endpoint) {
|
|
289
|
-
const normalized = endpoint.trim().replace(/\/+$/, "");
|
|
290
|
-
return normalized.endsWith("/v1") ? normalized : `${normalized}/v1`;
|
|
291
|
-
}
|
|
292
|
-
function normalizeMessagesEndpoint(endpoint) {
|
|
293
|
-
return endpoint.trim().replace(/\/+$/, "").replace(/\/v1$/, "");
|
|
294
|
-
}
|
|
295
297
|
function parseJsonObject(content, label) {
|
|
296
298
|
if (!content?.trim())
|
|
297
299
|
return {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export interface CredentialSecretEnvelopeInput {
|
|
2
|
+
webId: string;
|
|
3
|
+
provider: string;
|
|
4
|
+
/** The credential's resource IRI (`credentialResource.buildIri(podUrl, { id })`). */
|
|
5
|
+
credentialIri: string;
|
|
6
|
+
secret: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The `encryptedSecret` payload for a credential row.
|
|
10
|
+
*
|
|
11
|
+
* `PLAINTEXT` means "not encrypted at rest yet", not "no envelope": the read
|
|
12
|
+
* side verifies the envelope's owner (`webId`), provider and credential IRI
|
|
13
|
+
* before handing the secret to a provider request, so a row copied between
|
|
14
|
+
* credentials (or between accounts) never yields a usable secret.
|
|
15
|
+
*/
|
|
16
|
+
export declare function credentialSecretEnvelope(input: CredentialSecretEnvelopeInput): string;
|
|
17
|
+
export interface CredentialSecretReadInput {
|
|
18
|
+
webId: string;
|
|
19
|
+
provider: string;
|
|
20
|
+
credentialIri: string;
|
|
21
|
+
envelope: unknown;
|
|
22
|
+
}
|
|
23
|
+
/** `undefined` unless the envelope belongs to this account, provider and credential. */
|
|
24
|
+
export declare function decodeCredentialSecret(input: CredentialSecretReadInput): Record<string, unknown> | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The provider relation a catalog credential declares (`provider`):
|
|
27
|
+
* `providers/openai.ttl` in resource terms, `openai.ttl` as the stored value.
|
|
28
|
+
*
|
|
29
|
+
* A custom instance owns its own provider document, so there the relation is
|
|
30
|
+
* derived from the credential's own id.
|
|
31
|
+
*/
|
|
32
|
+
export declare function credentialProviderRelation(provider: string): string;
|
|
33
|
+
export declare function customCredentialProviderRelation(credentialId: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* The row key of a new credential: the `{id}` slot of the descriptor's
|
|
36
|
+
* `resourceIdPattern`, which is the credential's identity (never a display
|
|
37
|
+
* name).
|
|
38
|
+
*
|
|
39
|
+
* Two writers create credential rows - `XpodAiConnectionsPodStore` for a plain
|
|
40
|
+
* page, and the collection layer when a live collection creates the row
|
|
41
|
+
* optimistically - and a row key that differed between them would produce two
|
|
42
|
+
* credentials where the user asked for one, so the shape is declared once here.
|
|
43
|
+
*/
|
|
44
|
+
export declare function credentialRowKeyFor(provider: string, authMode: 'apiKey' | 'local'): string;
|
|
45
|
+
/**
|
|
46
|
+
* The provider a credential row key declares, for rows whose `provider` relation
|
|
47
|
+
* is missing: a credential is keyed `<provider>-<uuid>` (see
|
|
48
|
+
* {@link credentialRowKeyFor}), and a custom instance is keyed `custom-…`.
|
|
49
|
+
*
|
|
50
|
+
* A key reaches us in either of two shapes - the bare `resourceIdPattern` slot
|
|
51
|
+
* (`openai-<uuid>`) or a full resource id (`custom-instance-abc.ttl#this`). The
|
|
52
|
+
* provider lives in the document segment in both, never in the fragment, so the
|
|
53
|
+
* fragment must not be the part that gets inspected.
|
|
54
|
+
*/
|
|
55
|
+
export declare function providerOfCredentialKey(key: string): string | undefined;
|
|
56
|
+
/** `providers/openai.ttl#this` → `openai.ttl#this` (document-relative reference). */
|
|
57
|
+
export declare function providerResourceReference(value: string | undefined): string | undefined;
|
|
58
|
+
/** `providers/openai.ttl#this` → `openai` (the document name minus `.ttl`). */
|
|
59
|
+
export declare function providerResourceKey(value: string | undefined): string | undefined;
|