@kortix/sdk 0.13.46 → 0.13.48
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 +67 -44
- package/dist/browser/session-sync/server-transcript-mirror.d.ts +1 -1
- package/dist/browser/session-sync/server-transcript-mirror.d.ts.map +1 -1
- package/dist/browser/session-sync/session-sync-registry.d.ts +1 -1
- package/dist/browser/session-sync/session-sync-registry.d.ts.map +1 -1
- package/dist/browser/session-sync/visibility.d.ts +0 -12
- package/dist/browser/session-sync/visibility.d.ts.map +1 -1
- package/dist/browser/session-sync/visibility.js +23 -2
- package/dist/browser/session-sync/visibility.js.map +1 -1
- package/dist/browser/stores/opencode-pending-store.d.ts +1 -1
- package/dist/browser/stores/opencode-pending-store.d.ts.map +1 -1
- package/dist/browser/stores/sandbox-connection-store.d.ts +8 -0
- package/dist/browser/stores/sandbox-connection-store.d.ts.map +1 -1
- package/dist/browser/stores/sandbox-connection-store.js +14 -0
- package/dist/browser/stores/sandbox-connection-store.js.map +1 -1
- package/dist/browser/stores/sync-store/reconcile-parts.d.ts +1 -1
- package/dist/browser/stores/sync-store/reconcile-parts.d.ts.map +1 -1
- package/dist/browser/stores/sync-store/types.d.ts +1 -1
- package/dist/browser/stores/sync-store/types.d.ts.map +1 -1
- package/dist/browser/stores/sync-store.d.ts +1 -1
- package/dist/browser/stores/sync-store.d.ts.map +1 -1
- package/dist/browser/stores/sync-store.js +79 -60
- package/dist/browser/stores/sync-store.js.map +1 -1
- package/dist/core/agents/composer-agents.d.ts +8 -6
- package/dist/core/agents/composer-agents.d.ts.map +1 -1
- package/dist/core/agents/composer-agents.js +3 -3
- package/dist/core/agents/composer-agents.js.map +1 -1
- package/dist/core/client/binding-types.d.ts +2 -0
- package/dist/core/client/binding-types.d.ts.map +1 -0
- package/dist/core/client/binding-types.js +2 -0
- package/dist/core/client/binding-types.js.map +1 -0
- package/dist/core/client/facade-accounts.d.ts +57 -0
- package/dist/core/client/facade-accounts.d.ts.map +1 -0
- package/dist/core/client/facade-accounts.js +59 -0
- package/dist/core/client/facade-accounts.js.map +1 -0
- package/dist/core/client/facade-catalog.d.ts +58 -0
- package/dist/core/client/facade-catalog.d.ts.map +1 -0
- package/dist/core/client/facade-catalog.js +70 -0
- package/dist/core/client/facade-catalog.js.map +1 -0
- package/dist/core/client/facade-commerce.d.ts +45 -0
- package/dist/core/client/facade-commerce.d.ts.map +1 -0
- package/dist/core/client/facade-commerce.js +53 -0
- package/dist/core/client/facade-commerce.js.map +1 -0
- package/dist/core/client/facade-iam.d.ts +54 -0
- package/dist/core/client/facade-iam.d.ts.map +1 -0
- package/dist/core/client/facade-iam.js +62 -0
- package/dist/core/client/facade-iam.js.map +1 -0
- package/dist/core/client/facade-identity.d.ts +104 -0
- package/dist/core/client/facade-identity.d.ts.map +1 -0
- package/dist/core/client/facade-identity.js +36 -0
- package/dist/core/client/facade-identity.js.map +1 -0
- package/dist/core/client/facade-preview.d.ts +4 -0
- package/dist/core/client/facade-preview.d.ts.map +1 -0
- package/dist/core/client/facade-preview.js +61 -0
- package/dist/core/client/facade-preview.js.map +1 -0
- package/dist/core/client/kortix.d.ts +662 -985
- package/dist/core/client/kortix.d.ts.map +1 -1
- package/dist/core/client/kortix.js +31 -1162
- package/dist/core/client/kortix.js.map +1 -1
- package/dist/core/client/project-access-resources.d.ts +38 -0
- package/dist/core/client/project-access-resources.d.ts.map +1 -0
- package/dist/core/client/project-access-resources.js +37 -0
- package/dist/core/client/project-access-resources.js.map +1 -0
- package/dist/core/client/project-access-security.d.ts +117 -0
- package/dist/core/client/project-access-security.d.ts.map +1 -0
- package/dist/core/client/project-access-security.js +41 -0
- package/dist/core/client/project-access-security.js.map +1 -0
- package/dist/core/client/project-connections.d.ts +34 -0
- package/dist/core/client/project-connections.d.ts.map +1 -0
- package/dist/core/client/project-connections.js +20 -0
- package/dist/core/client/project-connections.js.map +1 -0
- package/dist/core/client/project-connectors.d.ts +21 -0
- package/dist/core/client/project-connectors.d.ts.map +1 -0
- package/dist/core/client/project-connectors.js +20 -0
- package/dist/core/client/project-connectors.js.map +1 -0
- package/dist/core/client/project-core.d.ts +72 -0
- package/dist/core/client/project-core.d.ts.map +1 -0
- package/dist/core/client/project-core.js +24 -0
- package/dist/core/client/project-core.js.map +1 -0
- package/dist/core/client/project-membership.d.ts +64 -0
- package/dist/core/client/project-membership.d.ts.map +1 -0
- package/dist/core/client/project-membership.js +26 -0
- package/dist/core/client/project-membership.js.map +1 -0
- package/dist/core/client/project-operations-admin.d.ts +112 -0
- package/dist/core/client/project-operations-admin.d.ts.map +1 -0
- package/dist/core/client/project-operations-admin.js +24 -0
- package/dist/core/client/project-operations-admin.js.map +1 -0
- package/dist/core/client/project-operations-review.d.ts +44 -0
- package/dist/core/client/project-operations-review.d.ts.map +1 -0
- package/dist/core/client/project-operations-review.js +34 -0
- package/dist/core/client/project-operations-review.js.map +1 -0
- package/dist/core/client/project-operations-workspace.d.ts +91 -0
- package/dist/core/client/project-operations-workspace.d.ts.map +1 -0
- package/dist/core/client/project-operations-workspace.js +36 -0
- package/dist/core/client/project-operations-workspace.js.map +1 -0
- package/dist/core/client/project-operations.d.ts +225 -0
- package/dist/core/client/project-operations.d.ts.map +1 -0
- package/dist/core/client/project-operations.js +47 -0
- package/dist/core/client/project-operations.js.map +1 -0
- package/dist/core/client/project-platform-resources.d.ts +36 -0
- package/dist/core/client/project-platform-resources.d.ts.map +1 -0
- package/dist/core/client/project-platform-resources.js +29 -0
- package/dist/core/client/project-platform-resources.js.map +1 -0
- package/dist/core/client/project-platform-security.d.ts +83 -0
- package/dist/core/client/project-platform-security.d.ts.map +1 -0
- package/dist/core/client/project-platform-security.js +39 -0
- package/dist/core/client/project-platform-security.js.map +1 -0
- package/dist/core/client/project-platform-settings.d.ts +58 -0
- package/dist/core/client/project-platform-settings.d.ts.map +1 -0
- package/dist/core/client/project-platform-settings.js +28 -0
- package/dist/core/client/project-platform-settings.js.map +1 -0
- package/dist/core/client/session-actions-resources.d.ts +18 -0
- package/dist/core/client/session-actions-resources.d.ts.map +1 -0
- package/dist/core/client/session-actions-resources.js +31 -0
- package/dist/core/client/session-actions-resources.js.map +1 -0
- package/dist/core/client/session-actions-security.d.ts +31 -0
- package/dist/core/client/session-actions-security.d.ts.map +1 -0
- package/dist/core/client/session-actions-security.js +51 -0
- package/dist/core/client/session-actions-security.js.map +1 -0
- package/dist/core/client/session-actions-services.d.ts +64 -0
- package/dist/core/client/session-actions-services.d.ts.map +1 -0
- package/dist/core/client/session-actions-services.js +59 -0
- package/dist/core/client/session-actions-services.js.map +1 -0
- package/dist/core/client/session-context.d.ts +22 -0
- package/dist/core/client/session-context.d.ts.map +1 -0
- package/dist/core/client/session-context.js +2 -0
- package/dist/core/client/session-context.js.map +1 -0
- package/dist/core/client/session-defaults.d.ts +9 -0
- package/dist/core/client/session-defaults.d.ts.map +1 -0
- package/dist/core/client/session-defaults.js +45 -0
- package/dist/core/client/session-defaults.js.map +1 -0
- package/dist/core/client/session-files.d.ts +26 -0
- package/dist/core/client/session-files.d.ts.map +1 -0
- package/dist/core/client/session-files.js +24 -0
- package/dist/core/client/session-files.js.map +1 -0
- package/dist/core/client/session-handle.d.ts +186 -0
- package/dist/core/client/session-handle.d.ts.map +1 -0
- package/dist/core/client/session-handle.js +68 -0
- package/dist/core/client/session-handle.js.map +1 -0
- package/dist/core/client/session-lifecycle-resources.d.ts +67 -0
- package/dist/core/client/session-lifecycle-resources.d.ts.map +1 -0
- package/dist/core/client/session-lifecycle-resources.js +56 -0
- package/dist/core/client/session-lifecycle-resources.js.map +1 -0
- package/dist/core/client/session-lifecycle-security.d.ts +65 -0
- package/dist/core/client/session-lifecycle-security.d.ts.map +1 -0
- package/dist/core/client/session-lifecycle-security.js +54 -0
- package/dist/core/client/session-lifecycle-security.js.map +1 -0
- package/dist/core/client/session-preview.d.ts +26 -0
- package/dist/core/client/session-preview.d.ts.map +1 -0
- package/dist/core/client/session-preview.js +31 -0
- package/dist/core/client/session-preview.js.map +1 -0
- package/dist/core/client/session-readiness.d.ts +11 -0
- package/dist/core/client/session-readiness.d.ts.map +1 -0
- package/dist/core/client/session-readiness.js +77 -0
- package/dist/core/client/session-readiness.js.map +1 -0
- package/dist/core/client/session-runtime.d.ts +35 -0
- package/dist/core/client/session-runtime.d.ts.map +1 -0
- package/dist/core/client/session-runtime.js +30 -0
- package/dist/core/client/session-runtime.js.map +1 -0
- package/dist/core/client/session-shared.d.ts +46 -0
- package/dist/core/client/session-shared.d.ts.map +1 -0
- package/dist/core/client/session-shared.js +48 -0
- package/dist/core/client/session-shared.js.map +1 -0
- package/dist/core/client/session-start.d.ts +3 -0
- package/dist/core/client/session-start.d.ts.map +1 -0
- package/dist/core/client/session-start.js +60 -0
- package/dist/core/client/session-start.js.map +1 -0
- package/dist/core/files/client.d.ts.map +1 -1
- package/dist/core/files/client.js +29 -3
- package/dist/core/files/client.js.map +1 -1
- package/dist/core/http/api-client.d.ts.map +1 -1
- package/dist/core/http/api-client.js +2 -419
- package/dist/core/http/api-client.js.map +1 -1
- package/dist/core/http/config.d.ts +15 -0
- package/dist/core/http/config.d.ts.map +1 -1
- package/dist/core/http/config.js.map +1 -1
- package/dist/core/http/request.d.ts +3 -0
- package/dist/core/http/request.d.ts.map +1 -0
- package/dist/core/http/request.js +215 -0
- package/dist/core/http/request.js.map +1 -0
- package/dist/core/http/response-error.d.ts +3 -0
- package/dist/core/http/response-error.d.ts.map +1 -0
- package/dist/core/http/response-error.js +113 -0
- package/dist/core/http/response-error.js.map +1 -0
- package/dist/core/http/runtime-errors.d.ts +23 -0
- package/dist/core/http/runtime-errors.d.ts.map +1 -1
- package/dist/core/http/runtime-errors.js +39 -1
- package/dist/core/http/runtime-errors.js.map +1 -1
- package/dist/core/http/transport.d.ts +13 -1
- package/dist/core/http/transport.d.ts.map +1 -1
- package/dist/core/http/transport.js +25 -4
- package/dist/core/http/transport.js.map +1 -1
- package/dist/core/models/composer-model.d.ts +1 -1
- package/dist/core/models/composer-model.d.ts.map +1 -1
- package/dist/core/models/model-flatten.d.ts +8 -1
- package/dist/core/models/model-flatten.d.ts.map +1 -1
- package/dist/core/models/model-flatten.js +2 -0
- package/dist/core/models/model-flatten.js.map +1 -1
- package/dist/core/models/model-key.d.ts +11 -0
- package/dist/core/models/model-key.d.ts.map +1 -1
- package/dist/core/models/model-key.js +20 -0
- package/dist/core/models/model-key.js.map +1 -1
- package/dist/core/models/provider-selection.d.ts +1 -1
- package/dist/core/models/provider-selection.d.ts.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.d.ts +14 -19
- package/dist/core/rest/platform-client/host-boundary.d.ts.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.js +7 -38
- package/dist/core/rest/platform-client/host-boundary.js.map +1 -1
- package/dist/core/rest/projects-client/admin-providers.d.ts +64 -3
- package/dist/core/rest/projects-client/admin-providers.d.ts.map +1 -1
- package/dist/core/rest/projects-client/admin-providers.js.map +1 -1
- package/dist/core/rest/projects-client/agent-config.d.ts +8 -0
- package/dist/core/rest/projects-client/agent-config.d.ts.map +1 -1
- package/dist/core/rest/projects-client/agent-config.js.map +1 -1
- package/dist/core/rest/projects-client/apps.d.ts +30 -0
- package/dist/core/rest/projects-client/apps.d.ts.map +1 -1
- package/dist/core/rest/projects-client/apps.js +10 -0
- package/dist/core/rest/projects-client/apps.js.map +1 -1
- package/dist/core/rest/projects-client/audit-filter.d.ts +6 -0
- package/dist/core/rest/projects-client/audit-filter.d.ts.map +1 -0
- package/dist/core/rest/projects-client/audit-filter.js +11 -0
- package/dist/core/rest/projects-client/audit-filter.js.map +1 -0
- package/dist/core/rest/projects-client/audit.d.ts +6 -18
- package/dist/core/rest/projects-client/audit.d.ts.map +1 -1
- package/dist/core/rest/projects-client/audit.js +30 -108
- package/dist/core/rest/projects-client/audit.js.map +1 -1
- package/dist/core/rest/projects-client/channels.d.ts +19 -0
- package/dist/core/rest/projects-client/channels.d.ts.map +1 -1
- package/dist/core/rest/projects-client/channels.js.map +1 -1
- package/dist/core/rest/projects-client/connectors.d.ts +4 -3
- package/dist/core/rest/projects-client/connectors.d.ts.map +1 -1
- package/dist/core/rest/projects-client/connectors.js.map +1 -1
- package/dist/core/rest/projects-client/iam-roles.d.ts +5 -0
- package/dist/core/rest/projects-client/iam-roles.d.ts.map +1 -1
- package/dist/core/rest/projects-client/iam-roles.js +9 -0
- package/dist/core/rest/projects-client/iam-roles.js.map +1 -1
- package/dist/core/rest/projects-client/projects.d.ts +11 -6
- package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
- package/dist/core/rest/projects-client/projects.js +0 -2
- package/dist/core/rest/projects-client/projects.js.map +1 -1
- package/dist/core/rest/projects-client/secrets.d.ts +61 -8
- package/dist/core/rest/projects-client/secrets.d.ts.map +1 -1
- package/dist/core/rest/projects-client/secrets.js +52 -0
- package/dist/core/rest/projects-client/secrets.js.map +1 -1
- package/dist/core/rest/projects-client/session-sandbox.d.ts +6 -0
- package/dist/core/rest/projects-client/session-sandbox.d.ts.map +1 -1
- package/dist/core/rest/projects-client/session-sandbox.js.map +1 -1
- package/dist/core/rest/projects-client/sessions.d.ts +49 -24
- package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/sessions.js +33 -4
- package/dist/core/rest/projects-client/sessions.js.map +1 -1
- package/dist/core/rest/projects-client/triggers.d.ts +12 -0
- package/dist/core/rest/projects-client/triggers.d.ts.map +1 -1
- package/dist/core/rest/projects-client/triggers.js.map +1 -1
- package/dist/core/runtime/client.d.ts +12 -11
- package/dist/core/runtime/client.d.ts.map +1 -1
- package/dist/core/runtime/client.js +36 -5
- package/dist/core/runtime/client.js.map +1 -1
- package/dist/core/runtime/runtime-rest-client.d.ts +462 -0
- package/dist/core/runtime/runtime-rest-client.d.ts.map +1 -0
- package/dist/core/runtime/runtime-rest-client.js +309 -0
- package/dist/core/runtime/runtime-rest-client.js.map +1 -0
- package/dist/core/runtime/runtime-types.d.ts +1174 -0
- package/dist/core/runtime/runtime-types.d.ts.map +1 -0
- package/dist/core/runtime/runtime-types.js +2 -0
- package/dist/core/runtime/runtime-types.js.map +1 -0
- package/dist/core/runtime/transcript-types.d.ts +564 -0
- package/dist/core/runtime/transcript-types.d.ts.map +1 -0
- package/dist/core/runtime/transcript-types.js +57 -0
- package/dist/core/runtime/transcript-types.js.map +1 -0
- package/dist/core/session/health.d.ts +2 -1
- package/dist/core/session/health.d.ts.map +1 -1
- package/dist/core/session/health.js.map +1 -1
- package/dist/core/session/host-signals.d.ts +16 -0
- package/dist/core/session/host-signals.d.ts.map +1 -0
- package/dist/core/session/host-signals.js +20 -0
- package/dist/core/session/host-signals.js.map +1 -0
- package/dist/core/session/index.d.ts +3 -0
- package/dist/core/session/index.d.ts.map +1 -1
- package/dist/core/session/index.js +2 -0
- package/dist/core/session/index.js.map +1 -1
- package/dist/core/session/open-bundle.d.ts +16 -0
- package/dist/core/session/open-bundle.d.ts.map +1 -1
- package/dist/core/session/open-bundle.js +31 -0
- package/dist/core/session/open-bundle.js.map +1 -1
- package/dist/core/session/runtime-sessions.d.ts +26 -0
- package/dist/core/session/runtime-sessions.d.ts.map +1 -0
- package/dist/core/session/runtime-sessions.js +39 -0
- package/dist/core/session/runtime-sessions.js.map +1 -0
- package/dist/core/session/runtime-verbs.d.ts +55 -0
- package/dist/core/session/runtime-verbs.d.ts.map +1 -0
- package/dist/core/session/runtime-verbs.js +124 -0
- package/dist/core/session/runtime-verbs.js.map +1 -0
- package/dist/core/session/wake-escalation.d.ts +1 -1
- package/dist/core/session/wake-escalation.js +1 -1
- package/dist/core/session/wire-message-id.d.ts +55 -12
- package/dist/core/session/wire-message-id.d.ts.map +1 -1
- package/dist/core/session/wire-message-id.js +62 -12
- package/dist/core/session/wire-message-id.js.map +1 -1
- package/dist/core/session/working-evidence.d.ts +15 -0
- package/dist/core/session/working-evidence.d.ts.map +1 -0
- package/dist/core/session/working-evidence.js +27 -0
- package/dist/core/session/working-evidence.js.map +1 -0
- package/dist/core/session/working-project.d.ts +3 -0
- package/dist/core/session/working-project.d.ts.map +1 -0
- package/dist/core/session/working-project.js +187 -0
- package/dist/core/session/working-project.js.map +1 -0
- package/dist/core/session/working-runtime.d.ts +33 -0
- package/dist/core/session/working-runtime.d.ts.map +1 -0
- package/dist/core/session/working-runtime.js +46 -0
- package/dist/core/session/working-runtime.js.map +1 -0
- package/dist/core/session/working-time.d.ts +2 -0
- package/dist/core/session/working-time.d.ts.map +1 -0
- package/dist/core/session/working-time.js +7 -0
- package/dist/core/session/working-time.js.map +1 -0
- package/dist/core/session/working.d.ts.map +1 -1
- package/dist/core/session/working.js +2 -316
- package/dist/core/session/working.js.map +1 -1
- package/dist/core/session-sync/session-sync-controller.d.ts +1 -1
- package/dist/core/session-sync/session-sync-controller.d.ts.map +1 -1
- package/dist/core/stream/event-stream.d.ts +25 -6
- package/dist/core/stream/event-stream.d.ts.map +1 -1
- package/dist/core/stream/event-stream.js +63 -9
- package/dist/core/stream/event-stream.js.map +1 -1
- package/dist/core/turns/classify.d.ts +31 -2
- package/dist/core/turns/classify.d.ts.map +1 -1
- package/dist/core/turns/classify.js +94 -0
- package/dist/core/turns/classify.js.map +1 -1
- package/dist/core/turns/index.d.ts +1 -0
- package/dist/core/turns/index.d.ts.map +1 -1
- package/dist/core/turns/index.js +1 -0
- package/dist/core/turns/index.js.map +1 -1
- package/dist/core/turns/parts.d.ts +6 -1
- package/dist/core/turns/parts.d.ts.map +1 -1
- package/dist/core/turns/parts.js +57 -49
- package/dist/core/turns/parts.js.map +1 -1
- package/dist/core/turns/segments/narration.d.ts.map +1 -1
- package/dist/core/turns/segments/narration.js +40 -130
- package/dist/core/turns/segments/narration.js.map +1 -1
- package/dist/core/turns/segments/turn-busy-visibility.d.ts +1 -1
- package/dist/core/turns/segments/turn-busy-visibility.js +1 -1
- package/dist/core/turns/segments/working-turn.js +1 -1
- package/dist/core/turns/segments/working-turn.js.map +1 -1
- package/dist/core/turns/tool-kind.d.ts +15 -0
- package/dist/core/turns/tool-kind.d.ts.map +1 -0
- package/dist/core/turns/tool-kind.js +115 -0
- package/dist/core/turns/tool-kind.js.map +1 -0
- package/dist/core/turns/tool-registry.d.ts +6 -7
- package/dist/core/turns/tool-registry.d.ts.map +1 -1
- package/dist/core/turns/tool-registry.js +78 -73
- package/dist/core/turns/tool-registry.js.map +1 -1
- package/dist/core/turns/tools/tool-meta.d.ts +1 -0
- package/dist/core/turns/tools/tool-meta.d.ts.map +1 -1
- package/dist/core/turns/tools/tool-meta.js +7 -6
- package/dist/core/turns/tools/tool-meta.js.map +1 -1
- package/dist/core/turns/view-model.d.ts.map +1 -1
- package/dist/core/turns/view-model.js +19 -12
- package/dist/core/turns/view-model.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/kortix.esm.min.js +46 -45
- package/dist/kortix.global.js +46 -45
- package/dist/node/app-viewer.js +1 -1
- package/dist/node/app-viewer.js.map +1 -1
- package/dist/node/auth.js +1 -1
- package/dist/node/auth.js.map +1 -1
- package/dist/node/scoped-client.d.ts +20 -0
- package/dist/node/scoped-client.d.ts.map +1 -0
- package/dist/node/scoped-client.js +170 -0
- package/dist/node/scoped-client.js.map +1 -0
- package/dist/node/server.d.ts +2 -21
- package/dist/node/server.d.ts.map +1 -1
- package/dist/node/server.js +2 -170
- package/dist/node/server.js.map +1 -1
- package/dist/react/index.d.ts +4 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +3 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/prefetch-session-open.d.ts +13 -0
- package/dist/react/prefetch-session-open.d.ts.map +1 -1
- package/dist/react/prefetch-session-open.js +22 -1
- package/dist/react/prefetch-session-open.js.map +1 -1
- package/dist/react/query-keys.d.ts +3 -2
- package/dist/react/query-keys.d.ts.map +1 -1
- package/dist/react/query-keys.js +4 -4
- package/dist/react/query-keys.js.map +1 -1
- package/dist/react/sign-in-with-kortix.d.ts +8 -8
- package/dist/react/use-admin-providers.d.ts +18 -0
- package/dist/react/use-admin-providers.d.ts.map +1 -0
- package/dist/react/use-admin-providers.js +36 -0
- package/dist/react/use-admin-providers.js.map +1 -0
- package/dist/react/use-feature-flag.d.ts +2 -2
- package/dist/react/use-feature-flag.d.ts.map +1 -1
- package/dist/react/use-feature-flag.js +3 -2
- package/dist/react/use-feature-flag.js.map +1 -1
- package/dist/react/use-kortix-master.d.ts +1 -1
- package/dist/react/use-opencode-config.d.ts +7 -1
- package/dist/react/use-opencode-config.d.ts.map +1 -1
- package/dist/react/use-opencode-config.js +9 -1
- package/dist/react/use-opencode-config.js.map +1 -1
- package/dist/react/use-opencode-events/diagnostics.d.ts +1 -1
- package/dist/react/use-opencode-events/diagnostics.d.ts.map +1 -1
- package/dist/react/use-opencode-events/handle-event.d.ts +4 -6
- package/dist/react/use-opencode-events/handle-event.d.ts.map +1 -1
- package/dist/react/use-opencode-events/handle-event.js +43 -594
- package/dist/react/use-opencode-events/handle-event.js.map +1 -1
- package/dist/react/use-opencode-events/handle-interaction-event.d.ts +4 -0
- package/dist/react/use-opencode-events/handle-interaction-event.d.ts.map +1 -0
- package/dist/react/use-opencode-events/handle-interaction-event.js +42 -0
- package/dist/react/use-opencode-events/handle-interaction-event.js.map +1 -0
- package/dist/react/use-opencode-events/handle-message-event.d.ts +4 -0
- package/dist/react/use-opencode-events/handle-message-event.d.ts.map +1 -0
- package/dist/react/use-opencode-events/handle-message-event.js +33 -0
- package/dist/react/use-opencode-events/handle-message-event.js.map +1 -0
- package/dist/react/use-opencode-events/handle-session-event.d.ts +5 -0
- package/dist/react/use-opencode-events/handle-session-event.d.ts.map +1 -0
- package/dist/react/use-opencode-events/handle-session-event.js +243 -0
- package/dist/react/use-opencode-events/handle-session-event.js.map +1 -0
- package/dist/react/use-opencode-events/handle-workspace-event.d.ts +4 -0
- package/dist/react/use-opencode-events/handle-workspace-event.d.ts.map +1 -0
- package/dist/react/use-opencode-events/handle-workspace-event.js +113 -0
- package/dist/react/use-opencode-events/handle-workspace-event.js.map +1 -0
- package/dist/react/use-opencode-events/handler-context.d.ts +29 -0
- package/dist/react/use-opencode-events/handler-context.d.ts.map +1 -0
- package/dist/react/use-opencode-events/handler-context.js +2 -0
- package/dist/react/use-opencode-events/handler-context.js.map +1 -0
- package/dist/react/use-opencode-events/hydrate-core.d.ts +23 -0
- package/dist/react/use-opencode-events/hydrate-core.d.ts.map +1 -0
- package/dist/react/use-opencode-events/hydrate-core.js +126 -0
- package/dist/react/use-opencode-events/hydrate-core.js.map +1 -0
- package/dist/react/use-opencode-events/index.d.ts +1 -0
- package/dist/react/use-opencode-events/index.d.ts.map +1 -1
- package/dist/react/use-opencode-events/index.js +40 -143
- package/dist/react/use-opencode-events/index.js.map +1 -1
- package/dist/react/use-opencode-events/runtime-stream-signals.d.ts +45 -0
- package/dist/react/use-opencode-events/runtime-stream-signals.d.ts.map +1 -0
- package/dist/react/use-opencode-events/runtime-stream-signals.js +32 -0
- package/dist/react/use-opencode-events/runtime-stream-signals.js.map +1 -0
- package/dist/react/use-opencode-events/stream-revival.d.ts +0 -21
- package/dist/react/use-opencode-events/stream-revival.d.ts.map +1 -1
- package/dist/react/use-opencode-events/stream-revival.js +33 -2
- package/dist/react/use-opencode-events/stream-revival.js.map +1 -1
- package/dist/react/use-opencode-events/use-event-stream-refs.d.ts +1 -1
- package/dist/react/use-opencode-events/use-event-stream-refs.d.ts.map +1 -1
- package/dist/react/use-opencode-local.d.ts +1 -1
- package/dist/react/use-opencode-local.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/agents.d.ts +1 -1
- package/dist/react/use-opencode-sessions/agents.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/commands.d.ts +4 -1
- package/dist/react/use-opencode-sessions/commands.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/commands.js +6 -1
- package/dist/react/use-opencode-sessions/commands.js.map +1 -1
- package/dist/react/use-opencode-sessions/files.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/files.js +8 -33
- package/dist/react/use-opencode-sessions/files.js.map +1 -1
- package/dist/react/use-opencode-sessions/keys.d.ts +12 -1
- package/dist/react/use-opencode-sessions/keys.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/keys.js +10 -0
- package/dist/react/use-opencode-sessions/keys.js.map +1 -1
- package/dist/react/use-opencode-sessions/mcp.d.ts +1 -1
- package/dist/react/use-opencode-sessions/mcp.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/messages.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/messages.js +8 -2
- package/dist/react/use-opencode-sessions/messages.js.map +1 -1
- package/dist/react/use-opencode-sessions/parts.d.ts +2 -2
- package/dist/react/use-opencode-sessions/parts.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/projects.d.ts +1 -1
- package/dist/react/use-opencode-sessions/projects.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/providers.d.ts +1 -1
- package/dist/react/use-opencode-sessions/providers.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/providers.js +12 -2
- package/dist/react/use-opencode-sessions/providers.js.map +1 -1
- package/dist/react/use-opencode-sessions/sessions.d.ts +8 -3
- package/dist/react/use-opencode-sessions/sessions.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/sessions.js +9 -2
- package/dist/react/use-opencode-sessions/sessions.js.map +1 -1
- package/dist/react/use-opencode-sessions/shared.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/shared.js +6 -1
- package/dist/react/use-opencode-sessions/shared.js.map +1 -1
- package/dist/react/use-opencode-sessions/sharing.d.ts +1 -1
- package/dist/react/use-opencode-sessions/sharing.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/vcs.d.ts +1 -1
- package/dist/react/use-opencode-sessions/vcs.d.ts.map +1 -1
- package/dist/react/use-project-apps.d.ts +6 -0
- package/dist/react/use-project-apps.d.ts.map +1 -1
- package/dist/react/use-project-gateway.d.ts +28 -0
- package/dist/react/use-project-gateway.d.ts.map +1 -0
- package/dist/react/use-project-gateway.js +120 -0
- package/dist/react/use-project-gateway.js.map +1 -0
- package/dist/react/use-project-secrets.d.ts +6 -6
- package/dist/react/use-project-sessions.d.ts +1 -1
- package/dist/react/use-project-sessions.d.ts.map +1 -1
- package/dist/react/use-project-sessions.js +2 -3
- package/dist/react/use-project-sessions.js.map +1 -1
- package/dist/react/use-session-messages.d.ts +4 -2
- package/dist/react/use-session-messages.d.ts.map +1 -1
- package/dist/react/use-session-messages.js +1 -1
- package/dist/react/use-session-messages.js.map +1 -1
- package/dist/react/use-session-participants.d.ts +10 -0
- package/dist/react/use-session-participants.d.ts.map +1 -0
- package/dist/react/use-session-participants.js +19 -0
- package/dist/react/use-session-participants.js.map +1 -0
- package/dist/react/use-session-prompts.d.ts +6 -0
- package/dist/react/use-session-prompts.d.ts.map +1 -1
- package/dist/react/use-session-prompts.js +17 -1
- package/dist/react/use-session-prompts.js.map +1 -1
- package/dist/react/use-session-sync.d.ts +4 -5
- package/dist/react/use-session-sync.d.ts.map +1 -1
- package/dist/react/use-session-sync.js +4 -1
- package/dist/react/use-session-sync.js.map +1 -1
- package/dist/react/use-session-transcript-history.d.ts.map +1 -1
- package/dist/react/use-session-transcript-history.js +14 -5
- package/dist/react/use-session-transcript-history.js.map +1 -1
- package/dist/react/use-session-working.d.ts +1 -1
- package/dist/react/use-session-working.d.ts.map +1 -1
- package/dist/react/use-session.d.ts +21 -9
- package/dist/react/use-session.d.ts.map +1 -1
- package/dist/react/use-session.js +64 -17
- package/dist/react/use-session.js.map +1 -1
- package/dist/react/use-teams-installations.d.ts +14 -0
- package/dist/react/use-teams-installations.d.ts.map +1 -1
- package/dist/react/use-teams-installations.js.map +1 -1
- package/dist/react/use-tunnel.d.ts +9 -0
- package/dist/react/use-tunnel.d.ts.map +1 -1
- package/dist/react/use-tunnel.js +9 -3
- package/dist/react/use-tunnel.js.map +1 -1
- package/dist/react/use-visible-agents.d.ts +1 -1
- package/dist/react/use-visible-agents.d.ts.map +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transcript.d.ts.map +1 -1
- package/dist/workspace-search/client.d.ts +20 -0
- package/dist/workspace-search/client.d.ts.map +1 -0
- package/dist/workspace-search/client.js +235 -0
- package/dist/workspace-search/client.js.map +1 -0
- package/dist/workspace-search/core.d.ts +2 -2
- package/dist/workspace-search/core.d.ts.map +1 -1
- package/dist/workspace-search/core.js +44 -4
- package/dist/workspace-search/core.js.map +1 -1
- package/dist/workspace-search/index.d.ts +3 -0
- package/dist/workspace-search/index.d.ts.map +1 -0
- package/dist/workspace-search/index.js +3 -0
- package/dist/workspace-search/index.js.map +1 -0
- package/package.json +7 -5
- package/dist/core/runtime/opencode-v2-event-aliases.d.ts +0 -184
- package/dist/core/runtime/opencode-v2-event-aliases.d.ts.map +0 -1
- package/dist/core/runtime/opencode-v2-event-aliases.js +0 -2
- package/dist/core/runtime/opencode-v2-event-aliases.js.map +0 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { abortable, abortableDelay, createAbortError } from './abort.js';
|
|
2
|
+
import { ApiError, AuthError } from './api/errors.js';
|
|
3
|
+
import { platformConfig } from './config.js';
|
|
4
|
+
import { handleErrorResponse } from './response-error.js';
|
|
5
|
+
import { send } from './transport.js';
|
|
6
|
+
const getApiUrl = () => platformConfig().backendUrl || '';
|
|
7
|
+
/**
|
|
8
|
+
* HTTP statuses that represent a transient gateway / overload condition rather
|
|
9
|
+
* than a deterministic server-side failure: 502 (Bad Gateway), 503 (Service
|
|
10
|
+
* Unavailable), 504 (Gateway Timeout). These are produced by the load balancer
|
|
11
|
+
* / reverse proxy / the API's request-deadline net under momentary saturation,
|
|
12
|
+
* typically resolve within a few hundred ms, and are safe to retry on
|
|
13
|
+
* idempotent reads. A real 500 is NOT here — it's a deterministic bug and must
|
|
14
|
+
* surface on the first response.
|
|
15
|
+
*/
|
|
16
|
+
const TRANSIENT_GATEWAY_STATUSES = new Set([502, 503, 504]);
|
|
17
|
+
const isTransientGatewayStatus = (status) => TRANSIENT_GATEWAY_STATUSES.has(status);
|
|
18
|
+
/** Idempotent HTTP methods that are safe to transparently retry. GET/HEAD only
|
|
19
|
+
* — POST/PUT/PATCH/DELETE mutate state and must not be replayed by the client. */
|
|
20
|
+
const isIdempotentMethod = (method) => {
|
|
21
|
+
const m = (method ?? 'GET').toUpperCase();
|
|
22
|
+
return m === 'GET' || m === 'HEAD';
|
|
23
|
+
};
|
|
24
|
+
/** A DELETE that fails at the TRANSPORT layer (fetch throws, no HTTP response)
|
|
25
|
+
* never reached the server as a completed request, so replaying it is safe —
|
|
26
|
+
* the server never confirmed it applied the delete. Kortix DELETEs are
|
|
27
|
+
* idempotent by design (a soft-tombstone stamp, then 404 for an already-absent
|
|
28
|
+
* row), so a replay re-tombstones (a no-op) or 404s. This is retried ONLY on a
|
|
29
|
+
* transport failure, NEVER on a received response status, where the server may
|
|
30
|
+
* already have applied the delete. Regression: incident-20260922T210537Z (a
|
|
31
|
+
* `sessions rm` DELETE stalled once, got zero retries, and blew past the
|
|
32
|
+
* heartbeat runner's 120s wall; a fresh retry deleted the session in ~1.1s). */
|
|
33
|
+
const isRetryableOnTransportFailure = (method) => isIdempotentMethod(method) || (method ?? 'GET').toUpperCase() === 'DELETE';
|
|
34
|
+
const TRANSIENT_READ_RETRIES = 2;
|
|
35
|
+
const isAbortError = (error) => error?.name === 'AbortError' ||
|
|
36
|
+
error?.name === 'AbortSignal' ||
|
|
37
|
+
(error instanceof Error && error.message.includes('aborted'));
|
|
38
|
+
export async function makeRequest(url, options = {}) {
|
|
39
|
+
const { showErrors = true, errorContext, timeout = 30000, deadlineCoversBody = false, ...fetchOptions } = options;
|
|
40
|
+
const controller = new AbortController();
|
|
41
|
+
const state = {
|
|
42
|
+
activeController: controller,
|
|
43
|
+
timeoutId: null,
|
|
44
|
+
isAborted: false,
|
|
45
|
+
didTimeout: false,
|
|
46
|
+
};
|
|
47
|
+
const abortFromCaller = () => state.activeController.abort();
|
|
48
|
+
fetchOptions.signal?.addEventListener('abort', abortFromCaller, { once: true });
|
|
49
|
+
try {
|
|
50
|
+
return await executeRequest(url, fetchOptions, showErrors, errorContext, timeout, deadlineCoversBody, controller, state);
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
fetchOptions.signal?.removeEventListener('abort', abortFromCaller);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async function executeRequest(url, fetchOptions, showErrors, errorContext, timeout, deadlineCoversBody, controller, state) {
|
|
57
|
+
try {
|
|
58
|
+
if (fetchOptions.signal?.aborted)
|
|
59
|
+
throw createAbortError();
|
|
60
|
+
state.timeoutId = setTimeout(() => {
|
|
61
|
+
if (!state.isAborted && !controller.signal.aborted) {
|
|
62
|
+
state.isAborted = true;
|
|
63
|
+
state.didTimeout = true;
|
|
64
|
+
controller.abort();
|
|
65
|
+
}
|
|
66
|
+
}, timeout);
|
|
67
|
+
const headers = {
|
|
68
|
+
...(fetchOptions.body instanceof FormData ? {} : { 'Content-Type': 'application/json' }),
|
|
69
|
+
...fetchOptions.headers,
|
|
70
|
+
};
|
|
71
|
+
const response = await retryRequest(url, fetchOptions, headers, timeout, deadlineCoversBody, controller, state);
|
|
72
|
+
if (response instanceof AuthError)
|
|
73
|
+
return { error: response, success: false };
|
|
74
|
+
if (!response.ok) {
|
|
75
|
+
return await handleErrorResponse(response, state.activeController.signal, showErrors, errorContext);
|
|
76
|
+
}
|
|
77
|
+
let data;
|
|
78
|
+
const contentType = response.headers.get('content-type');
|
|
79
|
+
if (contentType?.includes('application/json')) {
|
|
80
|
+
data = await abortable(response.json(), state.activeController.signal);
|
|
81
|
+
}
|
|
82
|
+
else if (contentType?.includes('text/')) {
|
|
83
|
+
data = (await abortable(response.text(), state.activeController.signal));
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
data = (await abortable(response.blob(), state.activeController.signal));
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
data,
|
|
90
|
+
success: true,
|
|
91
|
+
headers: response.headers,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
return handleRequestFailure(error, url, fetchOptions.method, showErrors, errorContext, timeout, state);
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
clearDeadline(state);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function clearDeadline(state) {
|
|
102
|
+
if (state.timeoutId)
|
|
103
|
+
clearTimeout(state.timeoutId);
|
|
104
|
+
state.timeoutId = null;
|
|
105
|
+
}
|
|
106
|
+
async function discardRetryResponse(response, signal, state) {
|
|
107
|
+
try {
|
|
108
|
+
await abortable(response.arrayBuffer(), signal);
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
if (isAbortError(error))
|
|
112
|
+
throw error;
|
|
113
|
+
}
|
|
114
|
+
finally {
|
|
115
|
+
clearDeadline(state);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
async function retryRequest(url, fetchOptions, headers, timeout, deadlineCoversBody, controller, state) {
|
|
119
|
+
const retryableRead = isIdempotentMethod(fetchOptions.method);
|
|
120
|
+
const retryableTransport = isRetryableOnTransportFailure(fetchOptions.method);
|
|
121
|
+
const maxAttempts = retryableTransport ? TRANSIENT_READ_RETRIES + 1 : 1;
|
|
122
|
+
let response;
|
|
123
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
124
|
+
if (attempt > 0) {
|
|
125
|
+
await abortableDelay(250 * 2 ** (attempt - 1), fetchOptions.signal ?? undefined);
|
|
126
|
+
}
|
|
127
|
+
const attemptController = attempt === 0 ? controller : new AbortController();
|
|
128
|
+
state.activeController = attemptController;
|
|
129
|
+
if (fetchOptions.signal?.aborted)
|
|
130
|
+
attemptController.abort();
|
|
131
|
+
if (attempt > 0) {
|
|
132
|
+
state.timeoutId = setTimeout(() => {
|
|
133
|
+
state.didTimeout = true;
|
|
134
|
+
attemptController.abort();
|
|
135
|
+
}, timeout);
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
response = await abortable(send(url, {
|
|
139
|
+
...fetchOptions,
|
|
140
|
+
headers,
|
|
141
|
+
signal: attemptController.signal,
|
|
142
|
+
credentials: fetchOptions.credentials ?? 'omit',
|
|
143
|
+
}, { timeoutMs: null }), attemptController.signal);
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
if (state.timeoutId) {
|
|
147
|
+
clearTimeout(state.timeoutId);
|
|
148
|
+
state.timeoutId = null;
|
|
149
|
+
}
|
|
150
|
+
if (error instanceof AuthError) {
|
|
151
|
+
return new AuthError();
|
|
152
|
+
}
|
|
153
|
+
const selfTimedOut = state.didTimeout && isAbortError(error) && !fetchOptions.signal?.aborted;
|
|
154
|
+
if (selfTimedOut && retryableTransport && attempt < maxAttempts - 1) {
|
|
155
|
+
state.didTimeout = false;
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
if (isAbortError(error) || attempt === maxAttempts - 1) {
|
|
159
|
+
throw error;
|
|
160
|
+
}
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
if (!retryableRead ||
|
|
164
|
+
!isTransientGatewayStatus(response.status) ||
|
|
165
|
+
attempt === maxAttempts - 1) {
|
|
166
|
+
if (!deadlineCoversBody)
|
|
167
|
+
clearDeadline(state);
|
|
168
|
+
return response;
|
|
169
|
+
}
|
|
170
|
+
await discardRetryResponse(response, attemptController.signal, state);
|
|
171
|
+
}
|
|
172
|
+
return response;
|
|
173
|
+
}
|
|
174
|
+
function handleRequestFailure(error, url, method, showErrors, errorContext, timeout, state) {
|
|
175
|
+
clearDeadline(state);
|
|
176
|
+
const requestWasAborted = isAbortError(error);
|
|
177
|
+
if (requestWasAborted) {
|
|
178
|
+
state.isAborted = true;
|
|
179
|
+
}
|
|
180
|
+
let apiError;
|
|
181
|
+
if (requestWasAborted) {
|
|
182
|
+
if (!state.didTimeout) {
|
|
183
|
+
return {
|
|
184
|
+
error: new ApiError('Request aborted', {
|
|
185
|
+
name: 'AbortError',
|
|
186
|
+
code: 'ABORTED',
|
|
187
|
+
}),
|
|
188
|
+
success: false,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
const endpoint = url.replace(getApiUrl(), '') || url;
|
|
192
|
+
apiError = new ApiError(`Request timed out after ${Math.round(timeout / 1000)}s: ${endpoint}`, {
|
|
193
|
+
code: 'TIMEOUT',
|
|
194
|
+
url,
|
|
195
|
+
endpoint,
|
|
196
|
+
timeout,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
else if (error instanceof Error) {
|
|
200
|
+
apiError = new ApiError(method === 'POST' && error instanceof TypeError && error.message === 'Failed to fetch'
|
|
201
|
+
? `Failed to fetch: POST ${url.replace(getApiUrl(), '') || url}`
|
|
202
|
+
: error.message, { name: error.name || 'ApiError', stack: error.stack });
|
|
203
|
+
if (showErrors) {
|
|
204
|
+
platformConfig().onError?.(apiError, errorContext);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
apiError = new ApiError(String(error));
|
|
209
|
+
if (showErrors) {
|
|
210
|
+
platformConfig().onError?.(apiError, errorContext);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return { error: apiError, success: false };
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/core/http/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,cAAc,EAAE,CAAC,UAAU,IAAI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ErrorResponse<T>(response: Response, signal: AbortSignal, showErrors: boolean, errorContext?: ErrorContext): Promise<ApiResponse<T>>;
|
|
3
|
+
//# sourceMappingURL=response-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-error.d.ts","sourceRoot":"","sources":["../../../src/core/http/response-error.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AA4F9D,wBAAsB,mBAAmB,CAAC,CAAC,EACzC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,OAAO,EACnB,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAkCzB"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { abortable, createAbortError } from './abort.js';
|
|
2
|
+
import { ACCOUNTS_LIST_UNAVAILABLE_CODE, ANALYTICS_UNAVAILABLE_CODE, FEATURE_NOT_SUPPORTED_CODE, MODEL_NOT_SERVABLE_CODE, PROVISION_IN_FLIGHT_CODE, } from './api-client.js';
|
|
3
|
+
import { ApiError, RequestTooLargeError, parseBillingError } from './api/errors.js';
|
|
4
|
+
import { platformConfig } from './config.js';
|
|
5
|
+
const REQUEST_DEADLINE_CODE = 'request_deadline';
|
|
6
|
+
const LEGACY_REQUEST_DEADLINE_MESSAGE = /^Request exceeded the \d+s server processing deadline$/;
|
|
7
|
+
const isRequestDeadlineResponse = (status, errorData, message) => {
|
|
8
|
+
if (status !== 503)
|
|
9
|
+
return false;
|
|
10
|
+
const code = typeof errorData === 'object' && errorData !== null && 'code' in errorData
|
|
11
|
+
? errorData.code
|
|
12
|
+
: undefined;
|
|
13
|
+
return code === REQUEST_DEADLINE_CODE || LEGACY_REQUEST_DEADLINE_MESSAGE.test(message);
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Stable error code the platform API returns (HTTP 503) when a project's git
|
|
17
|
+
* mirror cold-clone/fetch fails for a TRANSIENT, retryable upstream reason
|
|
18
|
+
* (GitHub edge blip, a momentarily unusable private-mirror credential, a
|
|
19
|
+
* mid-transfer timeout). The API already classifies the cause out of its OWN
|
|
20
|
+
* Sentry (`apps/api/src/projects/git/mirror.ts`'s `isTransientGitMirrorError`)
|
|
21
|
+
* and answers a clean 503 + `Retry-After`; this is the frontend mirror.
|
|
22
|
+
*
|
|
23
|
+
* The 503 RESPONSE crosses the boundary: `makeRequest` extracts the message
|
|
24
|
+
* and calls `onError` → the web host's `handleApiError`, which captures every
|
|
25
|
+
* 5xx to the FRONTEND Sentry (app 2346967 — a SEPARATE app from the API's
|
|
26
|
+
* 2346961). That is exactly how Better Stack frontend pattern `b4d05df2…`
|
|
27
|
+
* (`ApiError: git mirror is temporarily unavailable`, on a session start that
|
|
28
|
+
* cold-clones the project mirror) reached the frontend telemetry. Treat it as
|
|
29
|
+
* SILENT here — skip the global `onError` (Sentry) capture — but still return
|
|
30
|
+
* the `ApiError` so callers can branch on `.code`. A genuine 503 with another
|
|
31
|
+
* message/code still reports.
|
|
32
|
+
*
|
|
33
|
+
* Must stay in sync with `GIT_MIRROR_UNAVAILABLE_CODE` in
|
|
34
|
+
* `apps/api/src/projects/git/mirror.ts`. `LEGACY_GIT_MIRROR_UNAVAILABLE_MESSAGE`
|
|
35
|
+
* covers a response from an API deployed before the typed code (the same
|
|
36
|
+
* rollout shim as `LEGACY_REQUEST_DEADLINE_MESSAGE`).
|
|
37
|
+
*/
|
|
38
|
+
const GIT_MIRROR_UNAVAILABLE_CODE = 'git_mirror_unavailable';
|
|
39
|
+
const LEGACY_GIT_MIRROR_UNAVAILABLE_MESSAGE = /^git mirror is temporarily unavailable$/;
|
|
40
|
+
const isGitMirrorUnavailableResponse = (status, errorData, message) => {
|
|
41
|
+
if (status !== 503)
|
|
42
|
+
return false;
|
|
43
|
+
const code = typeof errorData === 'object' && errorData !== null && 'code' in errorData
|
|
44
|
+
? errorData.code
|
|
45
|
+
: undefined;
|
|
46
|
+
return (code === GIT_MIRROR_UNAVAILABLE_CODE || LEGACY_GIT_MIRROR_UNAVAILABLE_MESSAGE.test(message));
|
|
47
|
+
};
|
|
48
|
+
async function readErrorBody(response, signal) {
|
|
49
|
+
let message = `HTTP ${response.status}: ${response.statusText}`;
|
|
50
|
+
let data = null;
|
|
51
|
+
try {
|
|
52
|
+
data = await abortable(response.json(), signal);
|
|
53
|
+
// Human-readable prose wins over machine reason slugs.
|
|
54
|
+
if (typeof data.message === 'string')
|
|
55
|
+
message = data.message;
|
|
56
|
+
else if (data.error && typeof data.error === 'string')
|
|
57
|
+
message = data.error;
|
|
58
|
+
else if (typeof data.detail === 'string')
|
|
59
|
+
message = data.detail;
|
|
60
|
+
else if (typeof data.detail?.message === 'string')
|
|
61
|
+
message = data.detail.message;
|
|
62
|
+
else if (typeof data.reason === 'string')
|
|
63
|
+
message = data.reason;
|
|
64
|
+
}
|
|
65
|
+
catch { }
|
|
66
|
+
if (signal.aborted)
|
|
67
|
+
throw createAbortError();
|
|
68
|
+
return { message, data };
|
|
69
|
+
}
|
|
70
|
+
function isExpectedResponse(status, data, message) {
|
|
71
|
+
return (isRequestDeadlineResponse(status, data, message) ||
|
|
72
|
+
isGitMirrorUnavailableResponse(status, data, message) ||
|
|
73
|
+
(status === 501 && data?.code === FEATURE_NOT_SUPPORTED_CODE) ||
|
|
74
|
+
(status === 409 &&
|
|
75
|
+
(data?.code === MODEL_NOT_SERVABLE_CODE || data?.code === PROVISION_IN_FLIGHT_CODE)) ||
|
|
76
|
+
(status === 503 &&
|
|
77
|
+
(data?.code === ANALYTICS_UNAVAILABLE_CODE || data?.code === ACCOUNTS_LIST_UNAVAILABLE_CODE)));
|
|
78
|
+
}
|
|
79
|
+
export async function handleErrorResponse(response, signal, showErrors, errorContext) {
|
|
80
|
+
const { message, data } = await readErrorBody(response, signal);
|
|
81
|
+
let error = new ApiError(message, {
|
|
82
|
+
status: response.status,
|
|
83
|
+
response,
|
|
84
|
+
details: data || undefined,
|
|
85
|
+
data,
|
|
86
|
+
detail: data?.detail,
|
|
87
|
+
code: isRequestDeadlineResponse(response.status, data, message)
|
|
88
|
+
? REQUEST_DEADLINE_CODE
|
|
89
|
+
: data?.code || data?.error_code || data?.detail?.error_code || response.status.toString(),
|
|
90
|
+
});
|
|
91
|
+
if (response.status === 402)
|
|
92
|
+
error = parseBillingError(error);
|
|
93
|
+
if (response.status === 403 &&
|
|
94
|
+
data?.code === 'account_mfa_required' &&
|
|
95
|
+
typeof window !== 'undefined' &&
|
|
96
|
+
typeof window.dispatchEvent === 'function') {
|
|
97
|
+
try {
|
|
98
|
+
window.dispatchEvent(new CustomEvent('kortix:mfa-required'));
|
|
99
|
+
}
|
|
100
|
+
catch { }
|
|
101
|
+
}
|
|
102
|
+
if (response.status === 431) {
|
|
103
|
+
error = new RequestTooLargeError(431, {
|
|
104
|
+
message: 'Request is too large to process',
|
|
105
|
+
suggestion: 'Try uploading files one at a time, or reduce the number of files attached to your message.',
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
if (showErrors && !isExpectedResponse(response.status, data, message)) {
|
|
109
|
+
platformConfig().onError?.(error, errorContext);
|
|
110
|
+
}
|
|
111
|
+
return { error, success: false };
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=response-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-error.js","sourceRoot":"","sources":["../../../src/core/http/response-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EACL,8BAA8B,EAC9B,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;A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ACR,4FAA4F;SAC/F,CAAC,CAAC;IACL,CAAC;IACD,IAAI,UAAU,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;QACtE,cAAc,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -23,6 +23,22 @@ export declare const getOpenCodeConfigInvalidError: typeof getRuntimeConfigInval
|
|
|
23
23
|
export declare function isRuntimeConfigInvalidError(error: unknown): boolean;
|
|
24
24
|
/** @deprecated Renamed to `isRuntimeConfigInvalidError`. Removed in the next major. */
|
|
25
25
|
export declare const isOpenCodeConfigInvalidError: typeof isRuntimeConfigInvalidError;
|
|
26
|
+
/**
|
|
27
|
+
* Every spelling of the daemon's 503 while the session runtime cannot take a
|
|
28
|
+
* request, as lower-case substrings: the `code` a W6 daemon sends on both
|
|
29
|
+
* harnesses, then the two `error` texts of a daemon without the code (pi and
|
|
30
|
+
* OpenCode's boot steps; the OpenCode process itself). For a host that needs
|
|
31
|
+
* a string list (a telemetry ignore list); a predicate should call
|
|
32
|
+
* `isRuntimeNotReadyResponse`.
|
|
33
|
+
*/
|
|
34
|
+
export declare const RUNTIME_NOT_READY_MARKERS: readonly ["runtime_not_ready", "sandbox runtime not ready", "opencode not ready"];
|
|
35
|
+
/**
|
|
36
|
+
* True when the daemon refused a request because the session runtime is not up
|
|
37
|
+
* yet. The request was not forwarded: nothing reached the agent, and a retry is
|
|
38
|
+
* safe. Narrower than `isSandboxNotReadyError`, which also covers a sandbox
|
|
39
|
+
* that is stopped or parked.
|
|
40
|
+
*/
|
|
41
|
+
export declare function isRuntimeNotReadyResponse(error: unknown): boolean;
|
|
26
42
|
/**
|
|
27
43
|
* True when an error means "the sandbox is still starting / parked", i.e. a
|
|
28
44
|
* readiness state the control plane reports on purpose. A UI must render this
|
|
@@ -30,6 +46,13 @@ export declare const isOpenCodeConfigInvalidError: typeof isRuntimeConfigInvalid
|
|
|
30
46
|
* Accepts an `Error`, the raw message string, or a JSON body containing one.
|
|
31
47
|
*/
|
|
32
48
|
export declare function isSandboxNotReadyError(error: unknown): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* True for every "the session runtime is still starting" error a render path
|
|
51
|
+
* can meet: the runtime URL is not pinned yet, or the sandbox or its daemon
|
|
52
|
+
* answered not-ready. All of them clear on their own, so a boundary retries
|
|
53
|
+
* instead of showing a crash.
|
|
54
|
+
*/
|
|
55
|
+
export declare function isRuntimeStartingError(error: unknown): boolean;
|
|
33
56
|
/**
|
|
34
57
|
* A message read (or any runtime read) that failed because the sandbox is
|
|
35
58
|
* still provisioning, resuming, or parked — the readiness state the control
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-errors.d.ts","sourceRoot":"","sources":["../../../src/core/http/runtime-errors.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,4GAA4G;AAC5G,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,kBAAkB,EAAE,CAAC;KAC/B,CAAC;CACH;AAED,8EAA8E;AAC9E,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AACrD,qFAAqF;AACrF,MAAM,MAAM,0BAA0B,GAAG,yBAAyB,CAAC;AAenE,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAsBhE;AAED,oFAAoF;AACpF,eAAO,MAAM,yBAAyB,iCAA2B,CAAC;AAElE,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,OAAO,GAAG,y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AAO,CAEjE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAI9D;AAMD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE9D;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,MAAM,CAAC,EAAE,MAAM;CAW5B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CA6CA;AAED,8EAA8E;AAC9E,eAAO,MAAM,0BAA0B,2BAAqB,CAAC"}
|
|
@@ -66,6 +66,8 @@ export const isOpenCodeConfigInvalidError = isRuntimeConfigInvalidError;
|
|
|
66
66
|
// Deliberately NOT here: `sandbox port unreachable` — that is emitted only
|
|
67
67
|
// after the box reported active and the port still failed to answer, which is
|
|
68
68
|
// a genuine failure, not parking.
|
|
69
|
+
// - `runtime_not_ready` (code), `sandbox runtime not ready`, `opencode not
|
|
70
|
+
// ready` → the daemon's own 503, `RUNTIME_NOT_READY_MARKERS` below
|
|
69
71
|
const SANDBOX_NOT_READY_PATTERNS = [
|
|
70
72
|
/sandbox not ready/i,
|
|
71
73
|
/sandbox is not (?:ready|running)/i,
|
|
@@ -73,6 +75,30 @@ const SANDBOX_NOT_READY_PATTERNS = [
|
|
|
73
75
|
/\bsandbox_not_ready\b/,
|
|
74
76
|
/\bsandbox_lifecycle_unavailable\b/,
|
|
75
77
|
];
|
|
78
|
+
/**
|
|
79
|
+
* Every spelling of the daemon's 503 while the session runtime cannot take a
|
|
80
|
+
* request, as lower-case substrings: the `code` a W6 daemon sends on both
|
|
81
|
+
* harnesses, then the two `error` texts of a daemon without the code (pi and
|
|
82
|
+
* OpenCode's boot steps; the OpenCode process itself). For a host that needs
|
|
83
|
+
* a string list (a telemetry ignore list); a predicate should call
|
|
84
|
+
* `isRuntimeNotReadyResponse`.
|
|
85
|
+
*/
|
|
86
|
+
export const RUNTIME_NOT_READY_MARKERS = [
|
|
87
|
+
'runtime_not_ready',
|
|
88
|
+
'sandbox runtime not ready',
|
|
89
|
+
'opencode not ready',
|
|
90
|
+
];
|
|
91
|
+
// `\b` keeps the API's `runtime_not_ready_timeout` park reason out.
|
|
92
|
+
const RUNTIME_NOT_READY_PATTERN = /\bruntime_not_ready\b|sandbox runtime not ready|opencode not ready/i;
|
|
93
|
+
/**
|
|
94
|
+
* True when the daemon refused a request because the session runtime is not up
|
|
95
|
+
* yet. The request was not forwarded: nothing reached the agent, and a retry is
|
|
96
|
+
* safe. Narrower than `isSandboxNotReadyError`, which also covers a sandbox
|
|
97
|
+
* that is stopped or parked.
|
|
98
|
+
*/
|
|
99
|
+
export function isRuntimeNotReadyResponse(error) {
|
|
100
|
+
return RUNTIME_NOT_READY_PATTERN.test(rawErrorMessage(error));
|
|
101
|
+
}
|
|
76
102
|
/**
|
|
77
103
|
* True when an error means "the sandbox is still starting / parked", i.e. a
|
|
78
104
|
* readiness state the control plane reports on purpose. A UI must render this
|
|
@@ -83,7 +109,19 @@ export function isSandboxNotReadyError(error) {
|
|
|
83
109
|
const raw = rawErrorMessage(error);
|
|
84
110
|
if (!raw)
|
|
85
111
|
return false;
|
|
86
|
-
return SANDBOX_NOT_READY_PATTERNS.some((pattern) => pattern.test(raw));
|
|
112
|
+
return isRuntimeNotReadyResponse(raw) || SANDBOX_NOT_READY_PATTERNS.some((pattern) => pattern.test(raw));
|
|
113
|
+
}
|
|
114
|
+
// `getClient()` and the env and pty guards throw this wording for the ~1 s
|
|
115
|
+
// before a new or switched session's runtime URL is pinned.
|
|
116
|
+
const RUNTIME_URL_NOT_PINNED = /server url not ready|sandbox is still loading/i;
|
|
117
|
+
/**
|
|
118
|
+
* True for every "the session runtime is still starting" error a render path
|
|
119
|
+
* can meet: the runtime URL is not pinned yet, or the sandbox or its daemon
|
|
120
|
+
* answered not-ready. All of them clear on their own, so a boundary retries
|
|
121
|
+
* instead of showing a crash.
|
|
122
|
+
*/
|
|
123
|
+
export function isRuntimeStartingError(error) {
|
|
124
|
+
return RUNTIME_URL_NOT_PINNED.test(rawErrorMessage(error)) || isSandboxNotReadyError(error);
|
|
87
125
|
}
|
|
88
126
|
/**
|
|
89
127
|
* A message read (or any runtime read) that failed because the sandbox is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-errors.js","sourceRoot":"","sources":["../../../src/core/http/runtime-errors.ts"],"names":[],"mappings":"AAmBA,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,KAAK,YAAY,KAAK;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAc;IACrD,MAAM,GAAG,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1C,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IAEtB,MAAM,UAAU,GAAG;QACjB,GAAG;QACH,GAAG,CAAC,OAAO,CAAC,gCAAgC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;KACzD,CAAC;IAEF,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,WAAW,IAAI,CAAC;QAAE,UAAU,CAAC,I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C9E,4EAA4E;IAC5E,wDAAwD;IACxD,IAAI,sBAAsB,CAAC,GAAG,CAAC,EAAE,CAAC;QAChC,OAAO;YACL,KAAK,EAAE,sBAAsB;YAC7B,OAAO,EACL,qGAAqG;SACxG,CAAC;IACJ,CAAC;IAED,OAAO;QACL,KAAK,EAAE,oCAAoC;QAC3C,OAAO,EAAE,GAAG,IAAI,4DAA4D;KAC7E,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,MAAM,CAAC,MAAM,0BAA0B,GAAG,kBAAkB,CAAC"}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* send, so a retry after a 401 replay starts from the fresh token. There
|
|
7
7
|
* is no token option: the 401 replay asks `getToken()` again, so a
|
|
8
8
|
* caller-resolved token would be swapped for the host's identity;
|
|
9
|
-
* - the header policy: bearer, admin read bypass,
|
|
9
|
+
* - the header policy: bearer, `X-Kortix-Client-Version`, admin read bypass,
|
|
10
|
+
* act-as;
|
|
10
11
|
* - the default deadline, composed with the caller's signal;
|
|
11
12
|
* - the one 401 replay with a fresh token, from a copy of the request taken
|
|
12
13
|
* BEFORE the first send (a `Request` body is consumed by the first send).
|
|
@@ -40,6 +41,17 @@ export interface SendOptions {
|
|
|
40
41
|
}
|
|
41
42
|
export declare function setAdminBypass(enabled: boolean): void;
|
|
42
43
|
export declare function isAdminBypassEnabled(): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* `send()`'s token and header policy for a request the configured `fetch` does
|
|
46
|
+
* not carry: one connection of the live event stream on a host with its own
|
|
47
|
+
* `eventStreamTransport`. Throws `AuthError` without a token. `rejected()`
|
|
48
|
+
* reports that the server answered 401, so the next connection asks the host
|
|
49
|
+
* for a fresh token.
|
|
50
|
+
*/
|
|
51
|
+
export declare function platformRequestHeaders(url: string, base?: HeadersInit): Promise<{
|
|
52
|
+
headers: Headers;
|
|
53
|
+
rejected: () => void;
|
|
54
|
+
}>;
|
|
43
55
|
/** Send one request to the Kortix backend. See the module comment for the contract. */
|
|
44
56
|
export declare function send(input: RequestInfo | URL, init?: RequestInit, options?: SendOptions): Promise<Response>;
|
|
45
57
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/core/http/transport.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/core/http/transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAYH,KAAK,KAAK,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEjF,MAAM,WAAW,WAAW;IAC1B,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,uFAAuF;IACvF,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAUD,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAErD;AAED,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAkDD;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC,CAOrD;AA+BD,uFAAuF;AACvF,wBAAsB,IAAI,CACxB,KAAK,EAAE,WAAW,GAAG,GAAG,EACxB,IAAI,GAAE,WAAgB,EACtB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,QAAQ,CAAC,CAuBnB"}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* send, so a retry after a 401 replay starts from the fresh token. There
|
|
7
7
|
* is no token option: the 401 replay asks `getToken()` again, so a
|
|
8
8
|
* caller-resolved token would be swapped for the host's identity;
|
|
9
|
-
* - the header policy: bearer, admin read bypass,
|
|
9
|
+
* - the header policy: bearer, `X-Kortix-Client-Version`, admin read bypass,
|
|
10
|
+
* act-as;
|
|
10
11
|
* - the default deadline, composed with the caller's signal;
|
|
11
12
|
* - the one 401 replay with a fresh token, from a copy of the request taken
|
|
12
13
|
* BEFORE the first send (a `Request` body is consumed by the first send).
|
|
@@ -74,12 +75,16 @@ function callerHeaders(input, init) {
|
|
|
74
75
|
}
|
|
75
76
|
/**
|
|
76
77
|
* The caller's headers plus the platform policy. A caller's own
|
|
77
|
-
* `Authorization` wins. Admin bypass and act-as
|
|
78
|
-
* the caller's value, so a call site cannot drop them; the admin
|
|
79
|
-
* never impersonated (see `shouldAttachImpersonation`).
|
|
78
|
+
* `Authorization` or `X-Kortix-Client-Version` wins. Admin bypass and act-as
|
|
79
|
+
* replace the caller's value, so a call site cannot drop them; the admin
|
|
80
|
+
* console is never impersonated (see `shouldAttachImpersonation`).
|
|
80
81
|
*/
|
|
81
82
|
function withPlatformHeaders(url, base, token) {
|
|
82
83
|
const headers = { ...base };
|
|
84
|
+
const clientVersion = platformConfig().clientVersion?.trim();
|
|
85
|
+
if (clientVersion && !hasHeader(headers, 'x-kortix-client-version')) {
|
|
86
|
+
setHeader(headers, 'X-Kortix-Client-Version', clientVersion);
|
|
87
|
+
}
|
|
83
88
|
if (adminBypassEnabled)
|
|
84
89
|
setHeader(headers, 'x-kortix-admin-bypass', '1');
|
|
85
90
|
for (const [name, value] of Object.entries(impersonationHeaders(url)))
|
|
@@ -88,6 +93,22 @@ function withPlatformHeaders(url, base, token) {
|
|
|
88
93
|
setHeader(headers, 'Authorization', `Bearer ${token}`);
|
|
89
94
|
return headers;
|
|
90
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* `send()`'s token and header policy for a request the configured `fetch` does
|
|
98
|
+
* not carry: one connection of the live event stream on a host with its own
|
|
99
|
+
* `eventStreamTransport`. Throws `AuthError` without a token. `rejected()`
|
|
100
|
+
* reports that the server answered 401, so the next connection asks the host
|
|
101
|
+
* for a fresh token.
|
|
102
|
+
*/
|
|
103
|
+
export async function platformRequestHeaders(url, base) {
|
|
104
|
+
const token = await currentToken();
|
|
105
|
+
if (!token)
|
|
106
|
+
throw new AuthError();
|
|
107
|
+
return {
|
|
108
|
+
headers: new Headers(withPlatformHeaders(url, callerHeaders(url, { headers: base }), token)),
|
|
109
|
+
rejected: () => platformConfig().getToken.invalidate?.(token),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
91
112
|
// ── Send ────────────────────────────────────────────────────────────────────
|
|
92
113
|
/** A `ReadableStream` request body can be read once, so it cannot be resent. */
|
|
93
114
|
function hasOneShotBody(init) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/core/http/transport.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/core/http/transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAiBvD,+EAA+E;AAE/E,+EAA+E;AAC/E,+EAA+E;AAC/E,4EAA4E;AAC5E,kEAAkE;AAClE,IAAI,kBAAkB,GAAG,KAAK,CAAC;AAE/B,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,kBAAkB,GAAG,OAAO,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,kBAAkB,CAAC;AAC5B,CAA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AI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACvE,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAE1D,cAAc,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;IACpE,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,QAAQ,CAAC;IAC/C,OAAO,QAAQ,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ProviderListResponse } from '
|
|
1
|
+
import type { ProviderListResponse } from '../runtime/runtime-types.js';
|
|
2
2
|
import type { ModelDefaultsResponse } from '../rest/projects-client/model-defaults.js';
|
|
3
3
|
import { type FlatModel } from './model-flatten.js';
|
|
4
4
|
import { type ModelKey } from './model-key.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composer-model.d.ts","sourceRoot":"","sources":["../../../src/core/models/composer-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"composer-model.d.ts","sourceRoot":"","sources":["../../../src/core/models/composer-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAEpF,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,aAAa,CAAC;AAE5D;;;GAGG;AAEH;;;;GAIG;AACH,wBA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