@cuna_labs/cli 0.1.0
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/LICENSE +201 -0
- package/NOTICE +9 -0
- package/README.md +169 -0
- package/THIRD_PARTY_NOTICES.md +29 -0
- package/dist/api/capability-evidence.d.ts +19 -0
- package/dist/api/capability-evidence.d.ts.map +1 -0
- package/dist/api/capability-evidence.js +38 -0
- package/dist/api/capability-evidence.js.map +1 -0
- package/dist/api/client.d.ts +167 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +937 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/contracts.d.ts +345 -0
- package/dist/api/contracts.d.ts.map +1 -0
- package/dist/api/contracts.js +976 -0
- package/dist/api/contracts.js.map +1 -0
- package/dist/api/execution-workspaces.d.ts +17 -0
- package/dist/api/execution-workspaces.d.ts.map +1 -0
- package/dist/api/execution-workspaces.js +46 -0
- package/dist/api/execution-workspaces.js.map +1 -0
- package/dist/api/http.d.ts +76 -0
- package/dist/api/http.d.ts.map +1 -0
- package/dist/api/http.js +838 -0
- package/dist/api/http.js.map +1 -0
- package/dist/api/managed-executions.d.ts +37 -0
- package/dist/api/managed-executions.d.ts.map +1 -0
- package/dist/api/managed-executions.js +80 -0
- package/dist/api/managed-executions.js.map +1 -0
- package/dist/api/observer-v2-schema.d.ts +206 -0
- package/dist/api/observer-v2-schema.d.ts.map +1 -0
- package/dist/api/observer-v2-schema.js +264 -0
- package/dist/api/observer-v2-schema.js.map +1 -0
- package/dist/api/observer-v2.d.ts +33 -0
- package/dist/api/observer-v2.d.ts.map +1 -0
- package/dist/api/observer-v2.js +60 -0
- package/dist/api/observer-v2.js.map +1 -0
- package/dist/api/owner-observe-grants-v2-schema.d.ts +678 -0
- package/dist/api/owner-observe-grants-v2-schema.d.ts.map +1 -0
- package/dist/api/owner-observe-grants-v2-schema.js +887 -0
- package/dist/api/owner-observe-grants-v2-schema.js.map +1 -0
- package/dist/api/owner-observe-grants-v2.d.ts +268 -0
- package/dist/api/owner-observe-grants-v2.d.ts.map +1 -0
- package/dist/api/owner-observe-grants-v2.js +604 -0
- package/dist/api/owner-observe-grants-v2.js.map +1 -0
- package/dist/api/provider-v2-schema.d.ts +293 -0
- package/dist/api/provider-v2-schema.d.ts.map +1 -0
- package/dist/api/provider-v2-schema.js +381 -0
- package/dist/api/provider-v2-schema.js.map +1 -0
- package/dist/api/provider-v2.d.ts +55 -0
- package/dist/api/provider-v2.d.ts.map +1 -0
- package/dist/api/provider-v2.js +54 -0
- package/dist/api/provider-v2.js.map +1 -0
- package/dist/api/remote-workspace.d.ts +29 -0
- package/dist/api/remote-workspace.d.ts.map +1 -0
- package/dist/api/remote-workspace.js +62 -0
- package/dist/api/remote-workspace.js.map +1 -0
- package/dist/api/supervisor-live-update.d.ts +248 -0
- package/dist/api/supervisor-live-update.d.ts.map +1 -0
- package/dist/api/supervisor-live-update.js +434 -0
- package/dist/api/supervisor-live-update.js.map +1 -0
- package/dist/api/terminal-reason.d.ts +5 -0
- package/dist/api/terminal-reason.d.ts.map +1 -0
- package/dist/api/terminal-reason.js +12 -0
- package/dist/api/terminal-reason.js.map +1 -0
- package/dist/auth/browser-handoff.d.ts +59 -0
- package/dist/auth/browser-handoff.d.ts.map +1 -0
- package/dist/auth/browser-handoff.js +33 -0
- package/dist/auth/browser-handoff.js.map +1 -0
- package/dist/auth/browser.d.ts +11 -0
- package/dist/auth/browser.d.ts.map +1 -0
- package/dist/auth/browser.js +47 -0
- package/dist/auth/browser.js.map +1 -0
- package/dist/auth/human-client.d.ts +39 -0
- package/dist/auth/human-client.d.ts.map +1 -0
- package/dist/auth/human-client.js +66 -0
- package/dist/auth/human-client.js.map +1 -0
- package/dist/auth/human-contracts.d.ts +52 -0
- package/dist/auth/human-contracts.d.ts.map +1 -0
- package/dist/auth/human-contracts.js +229 -0
- package/dist/auth/human-contracts.js.map +1 -0
- package/dist/auth/human-session.d.ts +48 -0
- package/dist/auth/human-session.d.ts.map +1 -0
- package/dist/auth/human-session.js +902 -0
- package/dist/auth/human-session.js.map +1 -0
- package/dist/auth/onboarding-state.d.ts +31 -0
- package/dist/auth/onboarding-state.d.ts.map +1 -0
- package/dist/auth/onboarding-state.js +52 -0
- package/dist/auth/onboarding-state.js.map +1 -0
- package/dist/auth/pkce.d.ts +15 -0
- package/dist/auth/pkce.d.ts.map +1 -0
- package/dist/auth/pkce.js +19 -0
- package/dist/auth/pkce.js.map +1 -0
- package/dist/bin/cuna.d.ts +3 -0
- package/dist/bin/cuna.d.ts.map +1 -0
- package/dist/bin/cuna.js +4 -0
- package/dist/bin/cuna.js.map +1 -0
- package/dist/build-identity.d.ts +20 -0
- package/dist/build-identity.d.ts.map +1 -0
- package/dist/build-identity.js +77 -0
- package/dist/build-identity.js.map +1 -0
- package/dist/cli/command-help.d.ts +9 -0
- package/dist/cli/command-help.d.ts.map +1 -0
- package/dist/cli/command-help.js +324 -0
- package/dist/cli/command-help.js.map +1 -0
- package/dist/cli/help.d.ts +40 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +256 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/output.d.ts +28 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +95 -0
- package/dist/cli/output.js.map +1 -0
- package/dist/cli/parser.d.ts +65 -0
- package/dist/cli/parser.d.ts.map +1 -0
- package/dist/cli/parser.js +294 -0
- package/dist/cli/parser.js.map +1 -0
- package/dist/cli/process-entrypoint.d.ts +18 -0
- package/dist/cli/process-entrypoint.d.ts.map +1 -0
- package/dist/cli/process-entrypoint.js +26 -0
- package/dist/cli/process-entrypoint.js.map +1 -0
- package/dist/cli/run.d.ts +114 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +1969 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/commands/commands.d.ts +74 -0
- package/dist/commands/commands.d.ts.map +1 -0
- package/dist/commands/commands.js +2814 -0
- package/dist/commands/commands.js.map +1 -0
- package/dist/config/config.d.ts +86 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/config.js +323 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/infra-contract-witness.d.ts +29 -0
- package/dist/config/infra-contract-witness.d.ts.map +1 -0
- package/dist/config/infra-contract-witness.js +30 -0
- package/dist/config/infra-contract-witness.js.map +1 -0
- package/dist/core/browser-url.d.ts +2 -0
- package/dist/core/browser-url.d.ts.map +1 -0
- package/dist/core/browser-url.js +20 -0
- package/dist/core/browser-url.js.map +1 -0
- package/dist/core/deployed-wire-compatibility.d.ts +15 -0
- package/dist/core/deployed-wire-compatibility.d.ts.map +1 -0
- package/dist/core/deployed-wire-compatibility.js +15 -0
- package/dist/core/deployed-wire-compatibility.js.map +1 -0
- package/dist/core/errors.d.ts +59 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +82 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/exit-codes.d.ts +68 -0
- package/dist/core/exit-codes.d.ts.map +1 -0
- package/dist/core/exit-codes.js +84 -0
- package/dist/core/exit-codes.js.map +1 -0
- package/dist/core/instant.d.ts +60 -0
- package/dist/core/instant.d.ts.map +1 -0
- package/dist/core/instant.js +90 -0
- package/dist/core/instant.js.map +1 -0
- package/dist/core/namespace.d.ts +171 -0
- package/dist/core/namespace.d.ts.map +1 -0
- package/dist/core/namespace.js +227 -0
- package/dist/core/namespace.js.map +1 -0
- package/dist/core/observation-budget.d.ts +185 -0
- package/dist/core/observation-budget.d.ts.map +1 -0
- package/dist/core/observation-budget.js +209 -0
- package/dist/core/observation-budget.js.map +1 -0
- package/dist/core/product-web.d.ts +81 -0
- package/dist/core/product-web.d.ts.map +1 -0
- package/dist/core/product-web.js +87 -0
- package/dist/core/product-web.js.map +1 -0
- package/dist/core/validation.d.ts +90 -0
- package/dist/core/validation.d.ts.map +1 -0
- package/dist/core/validation.js +199 -0
- package/dist/core/validation.js.map +1 -0
- package/dist/credentials/contracts.d.ts +82 -0
- package/dist/credentials/contracts.d.ts.map +1 -0
- package/dist/credentials/contracts.js +2 -0
- package/dist/credentials/contracts.js.map +1 -0
- package/dist/credentials/errors.d.ts +19 -0
- package/dist/credentials/errors.d.ts.map +1 -0
- package/dist/credentials/errors.js +16 -0
- package/dist/credentials/errors.js.map +1 -0
- package/dist/credentials/index.d.ts +6 -0
- package/dist/credentials/index.d.ts.map +1 -0
- package/dist/credentials/index.js +6 -0
- package/dist/credentials/index.js.map +1 -0
- package/dist/credentials/local-session.d.ts +101 -0
- package/dist/credentials/local-session.d.ts.map +1 -0
- package/dist/credentials/local-session.js +839 -0
- package/dist/credentials/local-session.js.map +1 -0
- package/dist/credentials/secret-material.d.ts +17 -0
- package/dist/credentials/secret-material.d.ts.map +1 -0
- package/dist/credentials/secret-material.js +49 -0
- package/dist/credentials/secret-material.js.map +1 -0
- package/dist/credentials/vault.d.ts +41 -0
- package/dist/credentials/vault.d.ts.map +1 -0
- package/dist/credentials/vault.js +719 -0
- package/dist/credentials/vault.js.map +1 -0
- package/dist/daemon/endpoint.d.ts +29 -0
- package/dist/daemon/endpoint.d.ts.map +1 -0
- package/dist/daemon/endpoint.js +66 -0
- package/dist/daemon/endpoint.js.map +1 -0
- package/dist/daemon/journal.d.ts +62 -0
- package/dist/daemon/journal.d.ts.map +1 -0
- package/dist/daemon/journal.js +299 -0
- package/dist/daemon/journal.js.map +1 -0
- package/dist/daemon/lease.d.ts +25 -0
- package/dist/daemon/lease.d.ts.map +1 -0
- package/dist/daemon/lease.js +94 -0
- package/dist/daemon/lease.js.map +1 -0
- package/dist/daemon/lifecycle.d.ts +14 -0
- package/dist/daemon/lifecycle.d.ts.map +1 -0
- package/dist/daemon/lifecycle.js +29 -0
- package/dist/daemon/lifecycle.js.map +1 -0
- package/dist/daemon/protocol.d.ts +65 -0
- package/dist/daemon/protocol.d.ts.map +1 -0
- package/dist/daemon/protocol.js +194 -0
- package/dist/daemon/protocol.js.map +1 -0
- package/dist/daemon/supervisor.d.ts +29 -0
- package/dist/daemon/supervisor.d.ts.map +1 -0
- package/dist/daemon/supervisor.js +87 -0
- package/dist/daemon/supervisor.js.map +1 -0
- package/dist/daemon/views.d.ts +31 -0
- package/dist/daemon/views.d.ts.map +1 -0
- package/dist/daemon/views.js +86 -0
- package/dist/daemon/views.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/journey/api-effects.d.ts +59 -0
- package/dist/journey/api-effects.d.ts.map +1 -0
- package/dist/journey/api-effects.js +386 -0
- package/dist/journey/api-effects.js.map +1 -0
- package/dist/journey/derived-identity.d.ts +91 -0
- package/dist/journey/derived-identity.d.ts.map +1 -0
- package/dist/journey/derived-identity.js +123 -0
- package/dist/journey/derived-identity.js.map +1 -0
- package/dist/journey/index.d.ts +6 -0
- package/dist/journey/index.d.ts.map +1 -0
- package/dist/journey/index.js +6 -0
- package/dist/journey/index.js.map +1 -0
- package/dist/journey/intent.d.ts +36 -0
- package/dist/journey/intent.d.ts.map +1 -0
- package/dist/journey/intent.js +191 -0
- package/dist/journey/intent.js.map +1 -0
- package/dist/journey/orchestrator.d.ts +140 -0
- package/dist/journey/orchestrator.d.ts.map +1 -0
- package/dist/journey/orchestrator.js +415 -0
- package/dist/journey/orchestrator.js.map +1 -0
- package/dist/journey/provider-launch-intent.d.ts +12 -0
- package/dist/journey/provider-launch-intent.d.ts.map +1 -0
- package/dist/journey/provider-launch-intent.js +40 -0
- package/dist/journey/provider-launch-intent.js.map +1 -0
- package/dist/journey/remote-workspace.d.ts +34 -0
- package/dist/journey/remote-workspace.d.ts.map +1 -0
- package/dist/journey/remote-workspace.js +91 -0
- package/dist/journey/remote-workspace.js.map +1 -0
- package/dist/journey/root-entry.d.ts +56 -0
- package/dist/journey/root-entry.d.ts.map +1 -0
- package/dist/journey/root-entry.js +19 -0
- package/dist/journey/root-entry.js.map +1 -0
- package/dist/journey/selection.d.ts +165 -0
- package/dist/journey/selection.d.ts.map +1 -0
- package/dist/journey/selection.js +565 -0
- package/dist/journey/selection.js.map +1 -0
- package/dist/journey/session-failure.d.ts +4 -0
- package/dist/journey/session-failure.d.ts.map +1 -0
- package/dist/journey/session-failure.js +28 -0
- package/dist/journey/session-failure.js.map +1 -0
- package/dist/journey/workspace-effects.d.ts +30 -0
- package/dist/journey/workspace-effects.d.ts.map +1 -0
- package/dist/journey/workspace-effects.js +348 -0
- package/dist/journey/workspace-effects.js.map +1 -0
- package/dist/local-actions/broker.d.ts +32 -0
- package/dist/local-actions/broker.d.ts.map +1 -0
- package/dist/local-actions/broker.js +400 -0
- package/dist/local-actions/broker.js.map +1 -0
- package/dist/local-actions/browser-action.d.ts +78 -0
- package/dist/local-actions/browser-action.d.ts.map +1 -0
- package/dist/local-actions/browser-action.js +307 -0
- package/dist/local-actions/browser-action.js.map +1 -0
- package/dist/local-actions/callback-relay.d.ts +45 -0
- package/dist/local-actions/callback-relay.d.ts.map +1 -0
- package/dist/local-actions/callback-relay.js +265 -0
- package/dist/local-actions/callback-relay.js.map +1 -0
- package/dist/local-actions/clipboard.d.ts +3 -0
- package/dist/local-actions/clipboard.d.ts.map +1 -0
- package/dist/local-actions/clipboard.js +18 -0
- package/dist/local-actions/clipboard.js.map +1 -0
- package/dist/local-actions/contracts.d.ts +63 -0
- package/dist/local-actions/contracts.d.ts.map +1 -0
- package/dist/local-actions/contracts.js +18 -0
- package/dist/local-actions/contracts.js.map +1 -0
- package/dist/local-actions/desktop-presentation.d.ts +141 -0
- package/dist/local-actions/desktop-presentation.d.ts.map +1 -0
- package/dist/local-actions/desktop-presentation.js +253 -0
- package/dist/local-actions/desktop-presentation.js.map +1 -0
- package/dist/local-actions/device-selection.d.ts +43 -0
- package/dist/local-actions/device-selection.d.ts.map +1 -0
- package/dist/local-actions/device-selection.js +154 -0
- package/dist/local-actions/device-selection.js.map +1 -0
- package/dist/local-actions/executor.d.ts +49 -0
- package/dist/local-actions/executor.d.ts.map +1 -0
- package/dist/local-actions/executor.js +329 -0
- package/dist/local-actions/executor.js.map +1 -0
- package/dist/local-actions/file-transfers.d.ts +141 -0
- package/dist/local-actions/file-transfers.d.ts.map +1 -0
- package/dist/local-actions/file-transfers.js +446 -0
- package/dist/local-actions/file-transfers.js.map +1 -0
- package/dist/local-actions/foreground-notifications.d.ts +45 -0
- package/dist/local-actions/foreground-notifications.d.ts.map +1 -0
- package/dist/local-actions/foreground-notifications.js +163 -0
- package/dist/local-actions/foreground-notifications.js.map +1 -0
- package/dist/local-actions/git-signing.d.ts +39 -0
- package/dist/local-actions/git-signing.d.ts.map +1 -0
- package/dist/local-actions/git-signing.js +135 -0
- package/dist/local-actions/git-signing.js.map +1 -0
- package/dist/local-actions/index.d.ts +19 -0
- package/dist/local-actions/index.d.ts.map +1 -0
- package/dist/local-actions/index.js +19 -0
- package/dist/local-actions/index.js.map +1 -0
- package/dist/local-actions/local-service-actions.d.ts +87 -0
- package/dist/local-actions/local-service-actions.d.ts.map +1 -0
- package/dist/local-actions/local-service-actions.js +347 -0
- package/dist/local-actions/local-service-actions.js.map +1 -0
- package/dist/local-actions/loopback.d.ts +5 -0
- package/dist/local-actions/loopback.d.ts.map +1 -0
- package/dist/local-actions/loopback.js +15 -0
- package/dist/local-actions/loopback.js.map +1 -0
- package/dist/local-actions/policy-store.d.ts +7 -0
- package/dist/local-actions/policy-store.d.ts.map +1 -0
- package/dist/local-actions/policy-store.js +70 -0
- package/dist/local-actions/policy-store.js.map +1 -0
- package/dist/local-actions/policy.d.ts +21 -0
- package/dist/local-actions/policy.d.ts.map +1 -0
- package/dist/local-actions/policy.js +43 -0
- package/dist/local-actions/policy.js.map +1 -0
- package/dist/local-actions/private-port-forward.d.ts +36 -0
- package/dist/local-actions/private-port-forward.d.ts.map +1 -0
- package/dist/local-actions/private-port-forward.js +154 -0
- package/dist/local-actions/private-port-forward.js.map +1 -0
- package/dist/local-actions/provider-mcp-config.d.ts +101 -0
- package/dist/local-actions/provider-mcp-config.d.ts.map +1 -0
- package/dist/local-actions/provider-mcp-config.js +166 -0
- package/dist/local-actions/provider-mcp-config.js.map +1 -0
- package/dist/local-actions/providers.d.ts +12 -0
- package/dist/local-actions/providers.d.ts.map +1 -0
- package/dist/local-actions/providers.js +42 -0
- package/dist/local-actions/providers.js.map +1 -0
- package/dist/local-actions/schemas.d.ts +4 -0
- package/dist/local-actions/schemas.d.ts.map +1 -0
- package/dist/local-actions/schemas.js +314 -0
- package/dist/local-actions/schemas.js.map +1 -0
- package/dist/local-actions/sensitive-consent.d.ts +32 -0
- package/dist/local-actions/sensitive-consent.d.ts.map +1 -0
- package/dist/local-actions/sensitive-consent.js +47 -0
- package/dist/local-actions/sensitive-consent.js.map +1 -0
- package/dist/machines/command-launch.d.ts +17 -0
- package/dist/machines/command-launch.d.ts.map +1 -0
- package/dist/machines/command-launch.js +52 -0
- package/dist/machines/command-launch.js.map +1 -0
- package/dist/machines/execution-receipt.d.ts +18 -0
- package/dist/machines/execution-receipt.d.ts.map +1 -0
- package/dist/machines/execution-receipt.js +87 -0
- package/dist/machines/execution-receipt.js.map +1 -0
- package/dist/machines/executions-screen.d.ts +6 -0
- package/dist/machines/executions-screen.d.ts.map +1 -0
- package/dist/machines/executions-screen.js +410 -0
- package/dist/machines/executions-screen.js.map +1 -0
- package/dist/machines/explorer.d.ts +75 -0
- package/dist/machines/explorer.d.ts.map +1 -0
- package/dist/machines/explorer.js +1726 -0
- package/dist/machines/explorer.js.map +1 -0
- package/dist/machines/live-supervisor-update.d.ts +325 -0
- package/dist/machines/live-supervisor-update.d.ts.map +1 -0
- package/dist/machines/live-supervisor-update.js +513 -0
- package/dist/machines/live-supervisor-update.js.map +1 -0
- package/dist/machines/machine-first.d.ts +123 -0
- package/dist/machines/machine-first.d.ts.map +1 -0
- package/dist/machines/machine-first.js +119 -0
- package/dist/machines/machine-first.js.map +1 -0
- package/dist/machines/opencode-supervisor.d.ts +51 -0
- package/dist/machines/opencode-supervisor.d.ts.map +1 -0
- package/dist/machines/opencode-supervisor.js +124 -0
- package/dist/machines/opencode-supervisor.js.map +1 -0
- package/dist/machines/pagination.d.ts +4 -0
- package/dist/machines/pagination.d.ts.map +1 -0
- package/dist/machines/pagination.js +7 -0
- package/dist/machines/pagination.js.map +1 -0
- package/dist/machines/provider-availability.d.ts +42 -0
- package/dist/machines/provider-availability.d.ts.map +1 -0
- package/dist/machines/provider-availability.js +82 -0
- package/dist/machines/provider-availability.js.map +1 -0
- package/dist/machines/provider-screen.d.ts +12 -0
- package/dist/machines/provider-screen.d.ts.map +1 -0
- package/dist/machines/provider-screen.js +129 -0
- package/dist/machines/provider-screen.js.map +1 -0
- package/dist/machines/session-actionability.d.ts +86 -0
- package/dist/machines/session-actionability.d.ts.map +1 -0
- package/dist/machines/session-actionability.js +125 -0
- package/dist/machines/session-actionability.js.map +1 -0
- package/dist/machines/session-visibility.d.ts +139 -0
- package/dist/machines/session-visibility.d.ts.map +1 -0
- package/dist/machines/session-visibility.js +109 -0
- package/dist/machines/session-visibility.js.map +1 -0
- package/dist/platform/adapter.d.ts +62 -0
- package/dist/platform/adapter.d.ts.map +1 -0
- package/dist/platform/adapter.js +240 -0
- package/dist/platform/adapter.js.map +1 -0
- package/dist/platform/support.d.ts +12 -0
- package/dist/platform/support.d.ts.map +1 -0
- package/dist/platform/support.js +25 -0
- package/dist/platform/support.js.map +1 -0
- package/dist/pty/contracts.d.ts +45 -0
- package/dist/pty/contracts.d.ts.map +1 -0
- package/dist/pty/contracts.js +2 -0
- package/dist/pty/contracts.js.map +1 -0
- package/dist/pty/evidence-gate.d.ts +14 -0
- package/dist/pty/evidence-gate.d.ts.map +1 -0
- package/dist/pty/evidence-gate.js +35 -0
- package/dist/pty/evidence-gate.js.map +1 -0
- package/dist/pty/index.d.ts +5 -0
- package/dist/pty/index.d.ts.map +1 -0
- package/dist/pty/index.js +5 -0
- package/dist/pty/index.js.map +1 -0
- package/dist/pty/node-host-terminal.d.ts +14 -0
- package/dist/pty/node-host-terminal.d.ts.map +1 -0
- package/dist/pty/node-host-terminal.js +173 -0
- package/dist/pty/node-host-terminal.js.map +1 -0
- package/dist/pty/node-process.d.ts +26 -0
- package/dist/pty/node-process.d.ts.map +1 -0
- package/dist/pty/node-process.js +102 -0
- package/dist/pty/node-process.js.map +1 -0
- package/dist/runtime/api-terminal-control-plane.d.ts +7 -0
- package/dist/runtime/api-terminal-control-plane.d.ts.map +1 -0
- package/dist/runtime/api-terminal-control-plane.js +95 -0
- package/dist/runtime/api-terminal-control-plane.js.map +1 -0
- package/dist/runtime/backoff.d.ts +17 -0
- package/dist/runtime/backoff.d.ts.map +1 -0
- package/dist/runtime/backoff.js +61 -0
- package/dist/runtime/backoff.js.map +1 -0
- package/dist/runtime/boundary.d.ts +171 -0
- package/dist/runtime/boundary.d.ts.map +1 -0
- package/dist/runtime/boundary.js +1858 -0
- package/dist/runtime/boundary.js.map +1 -0
- package/dist/runtime/capability-gate.d.ts +25 -0
- package/dist/runtime/capability-gate.d.ts.map +1 -0
- package/dist/runtime/capability-gate.js +77 -0
- package/dist/runtime/capability-gate.js.map +1 -0
- package/dist/runtime/contracts.d.ts +25 -0
- package/dist/runtime/contracts.d.ts.map +1 -0
- package/dist/runtime/contracts.js +66 -0
- package/dist/runtime/contracts.js.map +1 -0
- package/dist/runtime/errors.d.ts +20 -0
- package/dist/runtime/errors.d.ts.map +1 -0
- package/dist/runtime/errors.js +22 -0
- package/dist/runtime/errors.js.map +1 -0
- package/dist/runtime/index.d.ts +9 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +9 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/node-foreground-session.d.ts +50 -0
- package/dist/runtime/node-foreground-session.d.ts.map +1 -0
- package/dist/runtime/node-foreground-session.js +431 -0
- package/dist/runtime/node-foreground-session.js.map +1 -0
- package/dist/runtime/node-websocket-connector.d.ts +6 -0
- package/dist/runtime/node-websocket-connector.d.ts.map +1 -0
- package/dist/runtime/node-websocket-connector.js +344 -0
- package/dist/runtime/node-websocket-connector.js.map +1 -0
- package/dist/runtime/observer-screen.d.ts +6 -0
- package/dist/runtime/observer-screen.d.ts.map +1 -0
- package/dist/runtime/observer-screen.js +144 -0
- package/dist/runtime/observer-screen.js.map +1 -0
- package/dist/runtime/owner-grant-operations.d.ts +136 -0
- package/dist/runtime/owner-grant-operations.d.ts.map +1 -0
- package/dist/runtime/owner-grant-operations.js +216 -0
- package/dist/runtime/owner-grant-operations.js.map +1 -0
- package/dist/runtime/owner-grants-screen.d.ts +40 -0
- package/dist/runtime/owner-grants-screen.d.ts.map +1 -0
- package/dist/runtime/owner-grants-screen.js +987 -0
- package/dist/runtime/owner-grants-screen.js.map +1 -0
- package/dist/runtime/terminal-transport.d.ts +85 -0
- package/dist/runtime/terminal-transport.d.ts.map +1 -0
- package/dist/runtime/terminal-transport.js +152 -0
- package/dist/runtime/terminal-transport.js.map +1 -0
- package/dist/sync/continuous-sync-supervisor.d.ts +107 -0
- package/dist/sync/continuous-sync-supervisor.d.ts.map +1 -0
- package/dist/sync/continuous-sync-supervisor.js +1117 -0
- package/dist/sync/continuous-sync-supervisor.js.map +1 -0
- package/dist/sync/index.d.ts +9 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +9 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/journal.d.ts +57 -0
- package/dist/sync/journal.d.ts.map +1 -0
- package/dist/sync/journal.js +685 -0
- package/dist/sync/journal.js.map +1 -0
- package/dist/sync/revisions.d.ts +118 -0
- package/dist/sync/revisions.d.ts.map +1 -0
- package/dist/sync/revisions.js +364 -0
- package/dist/sync/revisions.js.map +1 -0
- package/dist/sync/supervisor.d.ts +107 -0
- package/dist/sync/supervisor.d.ts.map +1 -0
- package/dist/sync/supervisor.js +246 -0
- package/dist/sync/supervisor.js.map +1 -0
- package/dist/sync/workspace-sync-client.d.ts +18 -0
- package/dist/sync/workspace-sync-client.d.ts.map +1 -0
- package/dist/sync/workspace-sync-client.js +150 -0
- package/dist/sync/workspace-sync-client.js.map +1 -0
- package/dist/sync/workspace-sync-coordinator.d.ts +76 -0
- package/dist/sync/workspace-sync-coordinator.d.ts.map +1 -0
- package/dist/sync/workspace-sync-coordinator.js +621 -0
- package/dist/sync/workspace-sync-coordinator.js.map +1 -0
- package/dist/sync/workspace-sync-product-service.d.ts +79 -0
- package/dist/sync/workspace-sync-product-service.d.ts.map +1 -0
- package/dist/sync/workspace-sync-product-service.js +398 -0
- package/dist/sync/workspace-sync-product-service.js.map +1 -0
- package/dist/sync/workspace-sync-protocol.d.ts +145 -0
- package/dist/sync/workspace-sync-protocol.d.ts.map +1 -0
- package/dist/sync/workspace-sync-protocol.js +347 -0
- package/dist/sync/workspace-sync-protocol.js.map +1 -0
- package/dist/terminal/appbar.d.ts +40 -0
- package/dist/terminal/appbar.d.ts.map +1 -0
- package/dist/terminal/appbar.js +55 -0
- package/dist/terminal/appbar.js.map +1 -0
- package/dist/terminal/cell-width.d.ts +3 -0
- package/dist/terminal/cell-width.d.ts.map +1 -0
- package/dist/terminal/cell-width.js +53 -0
- package/dist/terminal/cell-width.js.map +1 -0
- package/dist/terminal/codec.d.ts +107 -0
- package/dist/terminal/codec.d.ts.map +1 -0
- package/dist/terminal/codec.js +538 -0
- package/dist/terminal/codec.js.map +1 -0
- package/dist/terminal/foreground.d.ts +135 -0
- package/dist/terminal/foreground.d.ts.map +1 -0
- package/dist/terminal/foreground.js +2097 -0
- package/dist/terminal/foreground.js.map +1 -0
- package/dist/terminal/generated/terminal-wire-v1.d.ts +26 -0
- package/dist/terminal/generated/terminal-wire-v1.d.ts.map +1 -0
- package/dist/terminal/generated/terminal-wire-v1.js +27 -0
- package/dist/terminal/generated/terminal-wire-v1.js.map +1 -0
- package/dist/terminal/mode.d.ts +33 -0
- package/dist/terminal/mode.d.ts.map +1 -0
- package/dist/terminal/mode.js +99 -0
- package/dist/terminal/mode.js.map +1 -0
- package/dist/terminal/passthrough.d.ts +47 -0
- package/dist/terminal/passthrough.d.ts.map +1 -0
- package/dist/terminal/passthrough.js +666 -0
- package/dist/terminal/passthrough.js.map +1 -0
- package/dist/terminal/resume.d.ts +58 -0
- package/dist/terminal/resume.d.ts.map +1 -0
- package/dist/terminal/resume.js +185 -0
- package/dist/terminal/resume.js.map +1 -0
- package/dist/terminal/viewport.d.ts +93 -0
- package/dist/terminal/viewport.d.ts.map +1 -0
- package/dist/terminal/viewport.js +266 -0
- package/dist/terminal/viewport.js.map +1 -0
- package/dist/terminal/workbench.d.ts +32 -0
- package/dist/terminal/workbench.d.ts.map +1 -0
- package/dist/terminal/workbench.js +316 -0
- package/dist/terminal/workbench.js.map +1 -0
- package/dist/terminal/xterm-vte.d.ts +49 -0
- package/dist/terminal/xterm-vte.d.ts.map +1 -0
- package/dist/terminal/xterm-vte.js +602 -0
- package/dist/terminal/xterm-vte.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/dist/workspace/binding-path.d.ts +17 -0
- package/dist/workspace/binding-path.d.ts.map +1 -0
- package/dist/workspace/binding-path.js +91 -0
- package/dist/workspace/binding-path.js.map +1 -0
- package/dist/workspace/binding-store.d.ts +107 -0
- package/dist/workspace/binding-store.d.ts.map +1 -0
- package/dist/workspace/binding-store.js +783 -0
- package/dist/workspace/binding-store.js.map +1 -0
- package/dist/workspace/binding.d.ts +35 -0
- package/dist/workspace/binding.d.ts.map +1 -0
- package/dist/workspace/binding.js +70 -0
- package/dist/workspace/binding.js.map +1 -0
- package/dist/workspace/errors.d.ts +4 -0
- package/dist/workspace/errors.d.ts.map +1 -0
- package/dist/workspace/errors.js +19 -0
- package/dist/workspace/errors.js.map +1 -0
- package/dist/workspace/exclusion.d.ts +21 -0
- package/dist/workspace/exclusion.d.ts.map +1 -0
- package/dist/workspace/exclusion.js +243 -0
- package/dist/workspace/exclusion.js.map +1 -0
- package/dist/workspace/index.d.ts +8 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/dist/workspace/index.js +8 -0
- package/dist/workspace/index.js.map +1 -0
- package/dist/workspace/lifecycle.d.ts +56 -0
- package/dist/workspace/lifecycle.d.ts.map +1 -0
- package/dist/workspace/lifecycle.js +94 -0
- package/dist/workspace/lifecycle.js.map +1 -0
- package/dist/workspace/manifest.d.ts +47 -0
- package/dist/workspace/manifest.d.ts.map +1 -0
- package/dist/workspace/manifest.js +243 -0
- package/dist/workspace/manifest.js.map +1 -0
- package/dist/workspace/paths.d.ts +14 -0
- package/dist/workspace/paths.d.ts.map +1 -0
- package/dist/workspace/paths.js +67 -0
- package/dist/workspace/paths.js.map +1 -0
- package/dist/workspace/schema.d.ts +15 -0
- package/dist/workspace/schema.d.ts.map +1 -0
- package/dist/workspace/schema.js +33 -0
- package/dist/workspace/schema.js.map +1 -0
- package/dist/workspace/selection-screen.d.ts +4 -0
- package/dist/workspace/selection-screen.d.ts.map +1 -0
- package/dist/workspace/selection-screen.js +216 -0
- package/dist/workspace/selection-screen.js.map +1 -0
- package/dist/workspace/selection-service.d.ts +16 -0
- package/dist/workspace/selection-service.d.ts.map +1 -0
- package/dist/workspace/selection-service.js +65 -0
- package/dist/workspace/selection-service.js.map +1 -0
- package/node_modules/@xterm/headless/README.md +31 -0
- package/node_modules/@xterm/headless/lib-headless/xterm-headless.js +2 -0
- package/node_modules/@xterm/headless/lib-headless/xterm-headless.js.map +1 -0
- package/node_modules/@xterm/headless/lib-headless/xterm-headless.mjs +46 -0
- package/node_modules/@xterm/headless/lib-headless/xterm-headless.mjs.map +7 -0
- package/node_modules/@xterm/headless/package.json +29 -0
- package/node_modules/@xterm/headless/typings/xterm-headless.d.ts +1385 -0
- package/package.json +75 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one authority in this CLI for reading a timestamp another system wrote.
|
|
3
|
+
*
|
|
4
|
+
* This file exists because the same defect was found four times on 2026-08-18,
|
|
5
|
+
* in three languages, and each one was first fixed locally as if it were a typo:
|
|
6
|
+
*
|
|
7
|
+
* infra edge/src/supervisor-attachment-authority.ts ticket.expires_at !== expiresAt
|
|
8
|
+
* infra assets/agent-session-supervisor.py value.endswith("Z")
|
|
9
|
+
* cuna-cli src/workspace/binding-store.ts new Date(t).toISOString() !== t
|
|
10
|
+
* cuna-cli src/runtime/terminal-transport.ts /\.[0-9]{3}Z$/
|
|
11
|
+
*
|
|
12
|
+
* Every one compares an ENCODING where it means to compare an INSTANT, and every
|
|
13
|
+
* one is correct wherever a single process both writes and reads the value —
|
|
14
|
+
* which is exactly why they survived review. Nothing in the code separated "we
|
|
15
|
+
* minted this" from "they minted this", so one idiom was harmless in one file
|
|
16
|
+
* and fatal in the next.
|
|
17
|
+
*
|
|
18
|
+
* The two encodings, both measured against production 2026-08-18:
|
|
19
|
+
*
|
|
20
|
+
* JavaScript toISOString() 2026-08-18T21:00:00.000Z 3 digits, `Z`
|
|
21
|
+
* PostgREST over timestamptz 2026-08-18T20:49:24.458909+00:00 up to 6, `+00:00`
|
|
22
|
+
*
|
|
23
|
+
* They are never string-equal. The API contract settles which is correct: 36
|
|
24
|
+
* properties carry `format: "date-time"`, which in OpenAPI 3.1 is RFC 3339 §5.6
|
|
25
|
+
* and admits both, at any fractional precision. So neither renderer was wrong;
|
|
26
|
+
* every one of those comparisons was NARROWER THAN THE CONTRACT it implements.
|
|
27
|
+
*
|
|
28
|
+
* `infra` carries the mirror of this module at `edge/src/instant.ts`. Two copies
|
|
29
|
+
* of one rule is itself the shape this workspace keeps closing, and it is
|
|
30
|
+
* accepted here only because the CLI ships as a standalone npm package with no
|
|
31
|
+
* dependency on the service repository. If a shared package ever exists, this is
|
|
32
|
+
* one of the first things that should move into it.
|
|
33
|
+
*
|
|
34
|
+
* What this module is NOT for: a value this CLI minted itself. Where the CLI is
|
|
35
|
+
* both writer and reader — `src/auth/human-session.ts`, whose stored
|
|
36
|
+
* `login_code_expires_at` is normalized to canonical form by
|
|
37
|
+
* `src/auth/human-contracts.ts` before it is ever written — an exact-encoding
|
|
38
|
+
* check is a correct integrity check on our own file, and widening it would
|
|
39
|
+
* weaken it for nothing.
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* RFC 3339 §5.6 `date-time`: any fractional precision, and an explicit offset —
|
|
43
|
+
* `Z` or `+hh:mm`/`-hh:mm`.
|
|
44
|
+
*
|
|
45
|
+
* The one thing it refuses is the one thing that is genuinely ambiguous. A value
|
|
46
|
+
* with NO offset is not an instant: `Date.parse` reads it in the HOST's local
|
|
47
|
+
* zone, so the same bytes name different moments on two machines in different
|
|
48
|
+
* regions and each is certain it is right. Measured on this host,
|
|
49
|
+
* `2026-08-18T20:49:24.458909` parses six hours away from the same digits with
|
|
50
|
+
* `+00:00`. Refused, never guessed.
|
|
51
|
+
*
|
|
52
|
+
* It is otherwise exactly as wide as the contract, on purpose. `infra`'s mirror
|
|
53
|
+
* at `edge/src/instant.ts` restricts the offset to zero (`Z` or `±00:00`), which
|
|
54
|
+
* is narrower than `format: "date-time"` admits — the same class of narrowing
|
|
55
|
+
* this module exists to repair, merely one step further out. Nothing produces a
|
|
56
|
+
* non-zero offset today, and "nothing produces it today" is the reasoning that
|
|
57
|
+
* put four of these in the tree. This regex is character-identical to the
|
|
58
|
+
* `RFC3339` already in `src/auth/human-contracts.ts`, which is the other place
|
|
59
|
+
* this repo reads a service-rendered instant.
|
|
60
|
+
*/
|
|
61
|
+
const RFC3339 = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/u;
|
|
62
|
+
/**
|
|
63
|
+
* The epoch milliseconds of an RFC 3339 instant, or `null` if the value is not
|
|
64
|
+
* one.
|
|
65
|
+
*
|
|
66
|
+
* Note the deliberate lossiness: `Date.parse` truncates below the millisecond,
|
|
67
|
+
* so `…458909+00:00` and `…458+00:00` are the same number here. That is the
|
|
68
|
+
* right resolution for these call sites — each is checking that a store echoed
|
|
69
|
+
* back a moment, and the sub-millisecond digits are the store's own precision,
|
|
70
|
+
* never information the CLI supplied. A caller that genuinely needs exact bytes
|
|
71
|
+
* should compare bytes and say why.
|
|
72
|
+
*/
|
|
73
|
+
export function instantOrNull(value) {
|
|
74
|
+
if (typeof value !== "string" || !RFC3339.test(value))
|
|
75
|
+
return null;
|
|
76
|
+
const parsed = Date.parse(value);
|
|
77
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* True when both arguments name the same moment, whatever rendered them.
|
|
81
|
+
*
|
|
82
|
+
* `false` whenever either side is not an RFC 3339 instant, so an unparseable
|
|
83
|
+
* value never compares equal to anything, including itself.
|
|
84
|
+
*/
|
|
85
|
+
export function sameInstant(left, right) {
|
|
86
|
+
const a = instantOrNull(left);
|
|
87
|
+
const b = instantOrNull(right);
|
|
88
|
+
return a !== null && b !== null && a === b;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=instant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instant.js","sourceRoot":"","sources":["../../src/core/instant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,GAAG,uEAAuE,CAAC;AAExF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACnE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,IAAa,EAAE,KAAc;IACvD,MAAM,CAAC,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAC/B,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single authority on every namespace this CLI accepts.
|
|
3
|
+
*
|
|
4
|
+
* A namespace is minted by the service and accepted by the client. When the two
|
|
5
|
+
* are written independently, a rename lands on one side only and the client
|
|
6
|
+
* starts rejecting values the service still issues — with no compile error and
|
|
7
|
+
* no test failure. That is exactly how the CLI came to reject every issued
|
|
8
|
+
* `runa_sk_` API key, throw on every stored key row, and silently discard every
|
|
9
|
+
* Problem document minted at `api.runacode.io`.
|
|
10
|
+
*
|
|
11
|
+
* Every accepted brand, credential family, service origin and configuration
|
|
12
|
+
* environment-variable name is therefore enumerated here exactly once, and
|
|
13
|
+
* every call site tests through a predicate exported from this module. Widening
|
|
14
|
+
* the product's acceptance is a one-line edit in this file; a one-sided edit
|
|
15
|
+
* somewhere else is no longer expressible.
|
|
16
|
+
*
|
|
17
|
+
* These lists may only ever GROW. Removing a brand, a family infix, or an
|
|
18
|
+
* origin silently rejects credentials and documents that are still live in
|
|
19
|
+
* production, and for the secret detector it silently starts uploading material
|
|
20
|
+
* that is blocked today.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Every brand the product has minted credentials under. `cuna` is the current
|
|
24
|
+
* mint; `runa` predates the rename and remains valid indefinitely because keys
|
|
25
|
+
* issued under it were never revoked.
|
|
26
|
+
*/
|
|
27
|
+
export declare const CREDENTIAL_BRANDS: readonly ["cuna", "runa"];
|
|
28
|
+
export type CredentialBrand = (typeof CREDENTIAL_BRANDS)[number];
|
|
29
|
+
/**
|
|
30
|
+
* Configuration names are Cuna-only except for `RUNA_API_KEY`, the published
|
|
31
|
+
* automation alias from the earlier CLI. The canonical name is first so its
|
|
32
|
+
* presence always wins, including when its value is empty or malformed; a
|
|
33
|
+
* broken canonical credential must never fall through to stale legacy
|
|
34
|
+
* authority. No other earlier-brand configuration name is admitted.
|
|
35
|
+
*/
|
|
36
|
+
export declare function brandedEnvironmentNames(suffix: string): readonly string[];
|
|
37
|
+
/** One environment read, carrying the name that actually supplied the value. */
|
|
38
|
+
export interface BrandedEnvironmentValue {
|
|
39
|
+
readonly name: string;
|
|
40
|
+
readonly value: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The value of `suffix` under the highest-precedence brand that sets it, with
|
|
44
|
+
* the variable name that supplied it. The name is returned rather than
|
|
45
|
+
* discarded so a diagnostic can tell the user which of the accepted spellings
|
|
46
|
+
* it actually read — with two live names, "correct your configuration" without
|
|
47
|
+
* a name is not actionable.
|
|
48
|
+
*/
|
|
49
|
+
export declare function readBrandedEnvironment(environment: Readonly<Record<string, string | undefined>>, suffix: string): BrandedEnvironmentValue | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Every credential family infix the product has ever issued. Families without a
|
|
52
|
+
* wire validator below still belong here: the workspace secret detector is a
|
|
53
|
+
* denylist and must recognize all of them.
|
|
54
|
+
*/
|
|
55
|
+
export declare const CREDENTIAL_FAMILY_INFIXES: readonly ["sk", "at", "rt", "ct", "tc", "se", "sc", "cb", "cr", "login"];
|
|
56
|
+
export type CredentialFamilyInfix = (typeof CREDENTIAL_FAMILY_INFIXES)[number];
|
|
57
|
+
/**
|
|
58
|
+
* Every origin the service has minted absolute URLs under. `api.runacode.io` is
|
|
59
|
+
* what production mints today; `api.getcuna.com` is the renamed origin the
|
|
60
|
+
* contract declares. Both must decode.
|
|
61
|
+
*/
|
|
62
|
+
export declare const API_ORIGINS: readonly ["https://api.getcuna.com", "https://api.runacode.io"];
|
|
63
|
+
export type ApiOrigin = (typeof API_ORIGINS)[number];
|
|
64
|
+
/** The same origins as WebSocket authorities, for stream URLs. */
|
|
65
|
+
export declare const API_WEBSOCKET_ORIGINS: readonly string[];
|
|
66
|
+
/**
|
|
67
|
+
* Wire grammar per validated family. The infix is drawn from
|
|
68
|
+
* `CREDENTIAL_FAMILY_INFIXES` so a family can never be validated under a
|
|
69
|
+
* spelling the detector does not also recognize.
|
|
70
|
+
*/
|
|
71
|
+
declare const CREDENTIAL_GRAMMAR: Readonly<{
|
|
72
|
+
secretKey: Readonly<{
|
|
73
|
+
infix: "sk";
|
|
74
|
+
suffix: "[A-Za-z0-9_-]{16,256}";
|
|
75
|
+
}>;
|
|
76
|
+
accessToken: Readonly<{
|
|
77
|
+
infix: "at";
|
|
78
|
+
suffix: "[A-Za-z0-9_-]{43}";
|
|
79
|
+
}>;
|
|
80
|
+
loginCode: Readonly<{
|
|
81
|
+
infix: "login";
|
|
82
|
+
suffix: "[A-Za-z0-9_-]{43}";
|
|
83
|
+
}>;
|
|
84
|
+
terminalConnect: Readonly<{
|
|
85
|
+
infix: "tc";
|
|
86
|
+
suffix: "[A-Za-z0-9_-]{43}";
|
|
87
|
+
}>;
|
|
88
|
+
browserCallbackNonce: Readonly<{
|
|
89
|
+
infix: "cb";
|
|
90
|
+
suffix: "[A-Za-z0-9_-]{43}";
|
|
91
|
+
}>;
|
|
92
|
+
browserResumeHandle: Readonly<{
|
|
93
|
+
infix: "cr";
|
|
94
|
+
suffix: "[A-Za-z0-9_-]{43}";
|
|
95
|
+
}>;
|
|
96
|
+
supervisorControl: Readonly<{
|
|
97
|
+
infix: "sc";
|
|
98
|
+
suffix: "[A-Za-z0-9_-]{43}";
|
|
99
|
+
}>;
|
|
100
|
+
}>;
|
|
101
|
+
export type CredentialFamily = keyof typeof CREDENTIAL_GRAMMAR;
|
|
102
|
+
/**
|
|
103
|
+
* Families that are minted but have no wire grammar here yet. This list is the
|
|
104
|
+
* reason the hand-rolled copies existed: `cb` was in the infix list with no
|
|
105
|
+
* grammar entry, so a call site that needed to validate a callback nonce had
|
|
106
|
+
* nothing to import and wrote its own regex. Every entry here is therefore a
|
|
107
|
+
* standing invitation to repeat that, and the accompanying test forces a family
|
|
108
|
+
* to be either validated or explicitly listed — never silently absent.
|
|
109
|
+
*
|
|
110
|
+
* `se` remains here because its minted suffix shape has not been observed. Do
|
|
111
|
+
* not guess one: a grammar narrower than the mint rejects live credentials.
|
|
112
|
+
*/
|
|
113
|
+
export declare const CREDENTIAL_FAMILIES_WITHOUT_WIRE_GRAMMAR: readonly ["rt", "ct", "se"];
|
|
114
|
+
/**
|
|
115
|
+
* Unanchored source matching the brand and family opening of any credential the
|
|
116
|
+
* product issues. Exported for the workspace secret detector, which needs its
|
|
117
|
+
* own boundary guard around this fragment.
|
|
118
|
+
*/
|
|
119
|
+
export declare const CREDENTIAL_OPENING_SOURCE: string;
|
|
120
|
+
/** A programmatic API key as the service mints it, in any brand. */
|
|
121
|
+
export declare function isSecretApiKey(value: string): boolean;
|
|
122
|
+
/** The non-secret `*_sk_` display prefix carried by a stored API key row. */
|
|
123
|
+
export declare function isApiKeyDisplayPrefix(value: string): boolean;
|
|
124
|
+
/** Any credential the HTTP transport may present as a bearer. */
|
|
125
|
+
export declare function isTransportCredential(value: string): boolean;
|
|
126
|
+
/** An interactive CLI access token. */
|
|
127
|
+
export declare function isAccessToken(value: string): boolean;
|
|
128
|
+
/** Durable browser-issued CLI login credential; never a product API bearer. */
|
|
129
|
+
export declare function isLoginCode(value: string): boolean;
|
|
130
|
+
/** A one-use terminal connection token. */
|
|
131
|
+
export declare function isTerminalConnectToken(value: string): boolean;
|
|
132
|
+
/** The nonce the browser carries back from a human sign-in handoff. */
|
|
133
|
+
export declare function isBrowserCallbackNonce(value: string): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* The validator for one family infix, or `undefined` when that family has no
|
|
136
|
+
* wire grammar yet. Prefer the named predicates above at fixed call sites; this
|
|
137
|
+
* exists so a test can prove every minted family is either validated here or
|
|
138
|
+
* explicitly recorded as unvalidated.
|
|
139
|
+
*/
|
|
140
|
+
export declare function credentialFamilyValidator(infix: string): ((value: string) => boolean) | undefined;
|
|
141
|
+
/**
|
|
142
|
+
* Unanchored source matching a complete credential value of ANY brand and ANY
|
|
143
|
+
* family, with the shortest suffix a leaked secret could plausibly carry.
|
|
144
|
+
*
|
|
145
|
+
* This is the denylist half of the authority. It exists because the public
|
|
146
|
+
* response decoder previously carried its own hand-written copy of the family
|
|
147
|
+
* list that had gone stale at five of eight families — it did not know `se`,
|
|
148
|
+
* `sc` or `cb`, so an audit summary containing a live `runa_sc_…` supervisor
|
|
149
|
+
* bearer decoded cleanly and was printed to the operator's terminal and, under
|
|
150
|
+
* `--json`, into CI logs. A denylist assembled anywhere but here is the same
|
|
151
|
+
* bug waiting for the next family.
|
|
152
|
+
*/
|
|
153
|
+
export declare const CREDENTIAL_VALUE_SOURCE: string;
|
|
154
|
+
/**
|
|
155
|
+
* Whether `value` contains a credential of any brand and any family, anywhere
|
|
156
|
+
* inside it. Use this — never a local regex — before printing, forwarding or
|
|
157
|
+
* persisting a string the service controls.
|
|
158
|
+
*/
|
|
159
|
+
export declare function containsCredentialValue(value: string): boolean;
|
|
160
|
+
/**
|
|
161
|
+
* A canonical Problem `type` URI under any origin the service mints. A miss
|
|
162
|
+
* here discards `code`, `request_id` and `retryable` from a server error, so
|
|
163
|
+
* retry and backoff degrade with no signal — never narrow it.
|
|
164
|
+
*/
|
|
165
|
+
export declare function isProblemType(value: string): boolean;
|
|
166
|
+
/** The Problem `type` URI that exactly names `code`, under any minted origin. */
|
|
167
|
+
export declare function isProblemTypeForCode(value: string, code: string): boolean;
|
|
168
|
+
/** The terminal stream URL for `terminalSessionId`, under any minted origin. */
|
|
169
|
+
export declare function isTerminalStreamUrl(value: string, terminalSessionId: string): boolean;
|
|
170
|
+
export {};
|
|
171
|
+
//# sourceMappingURL=namespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../src/core/namespace.ts"],"names":[],"mappings":"AAEA;;;;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OAAO,CAErD;AAED,6EAA6E;AAC7E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED,iEAAiE;AACjE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED,uCAAuC;AACvC,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,2CAA2C;AAC3C,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,uEAAuE;AACvE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE7D;AAOD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,SAAS,CAGjG;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,QAAmD,CAAC;AAIxF;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE9D;AAUD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,iFAAiF;AACjF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzE;AAED,gFAAgF;AAChF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAIrF"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { DEPLOYED_WIRE_COMPATIBILITY } from "./deployed-wire-compatibility.js";
|
|
2
|
+
/**
|
|
3
|
+
* The single authority on every namespace this CLI accepts.
|
|
4
|
+
*
|
|
5
|
+
* A namespace is minted by the service and accepted by the client. When the two
|
|
6
|
+
* are written independently, a rename lands on one side only and the client
|
|
7
|
+
* starts rejecting values the service still issues — with no compile error and
|
|
8
|
+
* no test failure. That is exactly how the CLI came to reject every issued
|
|
9
|
+
* `runa_sk_` API key, throw on every stored key row, and silently discard every
|
|
10
|
+
* Problem document minted at `api.runacode.io`.
|
|
11
|
+
*
|
|
12
|
+
* Every accepted brand, credential family, service origin and configuration
|
|
13
|
+
* environment-variable name is therefore enumerated here exactly once, and
|
|
14
|
+
* every call site tests through a predicate exported from this module. Widening
|
|
15
|
+
* the product's acceptance is a one-line edit in this file; a one-sided edit
|
|
16
|
+
* somewhere else is no longer expressible.
|
|
17
|
+
*
|
|
18
|
+
* These lists may only ever GROW. Removing a brand, a family infix, or an
|
|
19
|
+
* origin silently rejects credentials and documents that are still live in
|
|
20
|
+
* production, and for the secret detector it silently starts uploading material
|
|
21
|
+
* that is blocked today.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Every brand the product has minted credentials under. `cuna` is the current
|
|
25
|
+
* mint; `runa` predates the rename and remains valid indefinitely because keys
|
|
26
|
+
* issued under it were never revoked.
|
|
27
|
+
*/
|
|
28
|
+
export const CREDENTIAL_BRANDS = Object.freeze(["cuna", DEPLOYED_WIRE_COMPATIBILITY.credentialBrand]);
|
|
29
|
+
/**
|
|
30
|
+
* Configuration names are Cuna-only except for `RUNA_API_KEY`, the published
|
|
31
|
+
* automation alias from the earlier CLI. The canonical name is first so its
|
|
32
|
+
* presence always wins, including when its value is empty or malformed; a
|
|
33
|
+
* broken canonical credential must never fall through to stale legacy
|
|
34
|
+
* authority. No other earlier-brand configuration name is admitted.
|
|
35
|
+
*/
|
|
36
|
+
export function brandedEnvironmentNames(suffix) {
|
|
37
|
+
return suffix === "API_KEY"
|
|
38
|
+
? Object.freeze(["CUNA_API_KEY", DEPLOYED_WIRE_COMPATIBILITY.apiKeyEnvironment])
|
|
39
|
+
: Object.freeze([`CUNA_${suffix}`]);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The value of `suffix` under the highest-precedence brand that sets it, with
|
|
43
|
+
* the variable name that supplied it. The name is returned rather than
|
|
44
|
+
* discarded so a diagnostic can tell the user which of the accepted spellings
|
|
45
|
+
* it actually read — with two live names, "correct your configuration" without
|
|
46
|
+
* a name is not actionable.
|
|
47
|
+
*/
|
|
48
|
+
export function readBrandedEnvironment(environment, suffix) {
|
|
49
|
+
for (const name of brandedEnvironmentNames(suffix)) {
|
|
50
|
+
const value = environment[name];
|
|
51
|
+
if (value !== undefined)
|
|
52
|
+
return Object.freeze({ name, value });
|
|
53
|
+
}
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Every credential family infix the product has ever issued. Families without a
|
|
58
|
+
* wire validator below still belong here: the workspace secret detector is a
|
|
59
|
+
* denylist and must recognize all of them.
|
|
60
|
+
*/
|
|
61
|
+
export const CREDENTIAL_FAMILY_INFIXES = Object.freeze([
|
|
62
|
+
// sk secret key · at access token · rt refresh token · ct continuation
|
|
63
|
+
// tc terminal connect · se/sc session credentials · cb browser callback nonce
|
|
64
|
+
// cr browser continuation resume handle
|
|
65
|
+
//
|
|
66
|
+
// `cb` was absent while the service minted `cuna_cb_…` for every human
|
|
67
|
+
// sign-in, so the workspace secret detector uploaded it instead of blocking
|
|
68
|
+
// it — exactly the failure this module's header warns about.
|
|
69
|
+
//
|
|
70
|
+
// `cr` repeated that failure one family later, in a repository this module
|
|
71
|
+
// does not reach: the console mints `cuna_cr_…` from 32 random bytes as a
|
|
72
|
+
// continuation resume handle and puts it in localStorage, a BroadcastChannel
|
|
73
|
+
// name and a URL fragment. It is a bearer capability, so a resume link pasted
|
|
74
|
+
// into a synced workspace was uploaded rather than blocked.
|
|
75
|
+
"sk", "at", "rt", "ct", "tc", "se", "sc", "cb", "cr", "login",
|
|
76
|
+
]);
|
|
77
|
+
/**
|
|
78
|
+
* Every origin the service has minted absolute URLs under. `api.runacode.io` is
|
|
79
|
+
* what production mints today; `api.getcuna.com` is the renamed origin the
|
|
80
|
+
* contract declares. Both must decode.
|
|
81
|
+
*/
|
|
82
|
+
export const API_ORIGINS = Object.freeze([
|
|
83
|
+
"https://api.getcuna.com",
|
|
84
|
+
DEPLOYED_WIRE_COMPATIBILITY.apiOrigin,
|
|
85
|
+
]);
|
|
86
|
+
/** The same origins as WebSocket authorities, for stream URLs. */
|
|
87
|
+
export const API_WEBSOCKET_ORIGINS = Object.freeze(API_ORIGINS.map((origin) => `wss://${new URL(origin).host}`));
|
|
88
|
+
/** Opaque suffix of every 32-byte base64url secret the service mints. */
|
|
89
|
+
const OPAQUE_SECRET = "[A-Za-z0-9_-]{43}";
|
|
90
|
+
/**
|
|
91
|
+
* Wire grammar per validated family. The infix is drawn from
|
|
92
|
+
* `CREDENTIAL_FAMILY_INFIXES` so a family can never be validated under a
|
|
93
|
+
* spelling the detector does not also recognize.
|
|
94
|
+
*/
|
|
95
|
+
const CREDENTIAL_GRAMMAR = Object.freeze({
|
|
96
|
+
secretKey: Object.freeze({ infix: "sk", suffix: "[A-Za-z0-9_-]{16,256}" }),
|
|
97
|
+
accessToken: Object.freeze({ infix: "at", suffix: OPAQUE_SECRET }),
|
|
98
|
+
loginCode: Object.freeze({ infix: "login", suffix: OPAQUE_SECRET }),
|
|
99
|
+
terminalConnect: Object.freeze({ infix: "tc", suffix: OPAQUE_SECRET }),
|
|
100
|
+
browserCallbackNonce: Object.freeze({ infix: "cb", suffix: OPAQUE_SECRET }),
|
|
101
|
+
browserResumeHandle: Object.freeze({ infix: "cr", suffix: OPAQUE_SECRET }),
|
|
102
|
+
supervisorControl: Object.freeze({ infix: "sc", suffix: OPAQUE_SECRET }),
|
|
103
|
+
});
|
|
104
|
+
/**
|
|
105
|
+
* Families that are minted but have no wire grammar here yet. This list is the
|
|
106
|
+
* reason the hand-rolled copies existed: `cb` was in the infix list with no
|
|
107
|
+
* grammar entry, so a call site that needed to validate a callback nonce had
|
|
108
|
+
* nothing to import and wrote its own regex. Every entry here is therefore a
|
|
109
|
+
* standing invitation to repeat that, and the accompanying test forces a family
|
|
110
|
+
* to be either validated or explicitly listed — never silently absent.
|
|
111
|
+
*
|
|
112
|
+
* `se` remains here because its minted suffix shape has not been observed. Do
|
|
113
|
+
* not guess one: a grammar narrower than the mint rejects live credentials.
|
|
114
|
+
*/
|
|
115
|
+
// `ct` remains a denylist-only historical family: detecting a leaked former
|
|
116
|
+
// continuation credential is necessary, but this CLI no longer authenticates
|
|
117
|
+
// or transports one.
|
|
118
|
+
export const CREDENTIAL_FAMILIES_WITHOUT_WIRE_GRAMMAR = Object.freeze(["rt", "ct", "se"]);
|
|
119
|
+
const BRAND_GROUP = `(?:${CREDENTIAL_BRANDS.join("|")})`;
|
|
120
|
+
/**
|
|
121
|
+
* Unanchored source matching the brand and family opening of any credential the
|
|
122
|
+
* product issues. Exported for the workspace secret detector, which needs its
|
|
123
|
+
* own boundary guard around this fragment.
|
|
124
|
+
*/
|
|
125
|
+
export const CREDENTIAL_OPENING_SOURCE = `${BRAND_GROUP}_(?:${CREDENTIAL_FAMILY_INFIXES.join("|")})`;
|
|
126
|
+
function credentialPattern(...families) {
|
|
127
|
+
const alternatives = families
|
|
128
|
+
.map((family) => `${CREDENTIAL_GRAMMAR[family].infix}_${CREDENTIAL_GRAMMAR[family].suffix}`)
|
|
129
|
+
.join("|");
|
|
130
|
+
return new RegExp(`^${BRAND_GROUP}_(?:${alternatives})$`, "u");
|
|
131
|
+
}
|
|
132
|
+
const SECRET_API_KEY = credentialPattern("secretKey");
|
|
133
|
+
const TRANSPORT_CREDENTIAL = credentialPattern("secretKey", "accessToken");
|
|
134
|
+
const ACCESS_TOKEN = credentialPattern("accessToken");
|
|
135
|
+
const LOGIN_CODE = credentialPattern("loginCode");
|
|
136
|
+
const TERMINAL_CONNECT_TOKEN = credentialPattern("terminalConnect");
|
|
137
|
+
const BROWSER_CALLBACK_NONCE = credentialPattern("browserCallbackNonce");
|
|
138
|
+
/**
|
|
139
|
+
* The non-secret display prefix stored on an API key row and returned by
|
|
140
|
+
* `key list`. Pre-rename rows carry `runa_sk_`; both spellings are live.
|
|
141
|
+
*/
|
|
142
|
+
const API_KEY_DISPLAY_PREFIX = new RegExp(`^${BRAND_GROUP}_${CREDENTIAL_GRAMMAR.secretKey.infix}_[A-Za-z0-9_-]{0,12}$`, "u");
|
|
143
|
+
/** A programmatic API key as the service mints it, in any brand. */
|
|
144
|
+
export function isSecretApiKey(value) {
|
|
145
|
+
return SECRET_API_KEY.test(value);
|
|
146
|
+
}
|
|
147
|
+
/** The non-secret `*_sk_` display prefix carried by a stored API key row. */
|
|
148
|
+
export function isApiKeyDisplayPrefix(value) {
|
|
149
|
+
return API_KEY_DISPLAY_PREFIX.test(value);
|
|
150
|
+
}
|
|
151
|
+
/** Any credential the HTTP transport may present as a bearer. */
|
|
152
|
+
export function isTransportCredential(value) {
|
|
153
|
+
return TRANSPORT_CREDENTIAL.test(value);
|
|
154
|
+
}
|
|
155
|
+
/** An interactive CLI access token. */
|
|
156
|
+
export function isAccessToken(value) {
|
|
157
|
+
return ACCESS_TOKEN.test(value);
|
|
158
|
+
}
|
|
159
|
+
/** Durable browser-issued CLI login credential; never a product API bearer. */
|
|
160
|
+
export function isLoginCode(value) {
|
|
161
|
+
return LOGIN_CODE.test(value) && value.startsWith("cuna_login_");
|
|
162
|
+
}
|
|
163
|
+
/** A one-use terminal connection token. */
|
|
164
|
+
export function isTerminalConnectToken(value) {
|
|
165
|
+
return TERMINAL_CONNECT_TOKEN.test(value);
|
|
166
|
+
}
|
|
167
|
+
/** The nonce the browser carries back from a human sign-in handoff. */
|
|
168
|
+
export function isBrowserCallbackNonce(value) {
|
|
169
|
+
return BROWSER_CALLBACK_NONCE.test(value) && value.startsWith("cuna_cb_");
|
|
170
|
+
}
|
|
171
|
+
const FAMILY_VALIDATORS = new Map(Object.keys(CREDENTIAL_GRAMMAR)
|
|
172
|
+
.map((family) => [CREDENTIAL_GRAMMAR[family].infix, credentialPattern(family)]));
|
|
173
|
+
/**
|
|
174
|
+
* The validator for one family infix, or `undefined` when that family has no
|
|
175
|
+
* wire grammar yet. Prefer the named predicates above at fixed call sites; this
|
|
176
|
+
* exists so a test can prove every minted family is either validated here or
|
|
177
|
+
* explicitly recorded as unvalidated.
|
|
178
|
+
*/
|
|
179
|
+
export function credentialFamilyValidator(infix) {
|
|
180
|
+
const pattern = FAMILY_VALIDATORS.get(infix);
|
|
181
|
+
return pattern === undefined ? undefined : (value) => pattern.test(value);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Unanchored source matching a complete credential value of ANY brand and ANY
|
|
185
|
+
* family, with the shortest suffix a leaked secret could plausibly carry.
|
|
186
|
+
*
|
|
187
|
+
* This is the denylist half of the authority. It exists because the public
|
|
188
|
+
* response decoder previously carried its own hand-written copy of the family
|
|
189
|
+
* list that had gone stale at five of eight families — it did not know `se`,
|
|
190
|
+
* `sc` or `cb`, so an audit summary containing a live `runa_sc_…` supervisor
|
|
191
|
+
* bearer decoded cleanly and was printed to the operator's terminal and, under
|
|
192
|
+
* `--json`, into CI logs. A denylist assembled anywhere but here is the same
|
|
193
|
+
* bug waiting for the next family.
|
|
194
|
+
*/
|
|
195
|
+
export const CREDENTIAL_VALUE_SOURCE = `${CREDENTIAL_OPENING_SOURCE}_[A-Za-z0-9_-]{8,}`;
|
|
196
|
+
const CREDENTIAL_VALUE = new RegExp(CREDENTIAL_VALUE_SOURCE, "u");
|
|
197
|
+
/**
|
|
198
|
+
* Whether `value` contains a credential of any brand and any family, anywhere
|
|
199
|
+
* inside it. Use this — never a local regex — before printing, forwarding or
|
|
200
|
+
* persisting a string the service controls.
|
|
201
|
+
*/
|
|
202
|
+
export function containsCredentialValue(value) {
|
|
203
|
+
return CREDENTIAL_VALUE.test(value);
|
|
204
|
+
}
|
|
205
|
+
function escapeRegExp(value) {
|
|
206
|
+
return value.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
|
|
207
|
+
}
|
|
208
|
+
const ORIGIN_GROUP = `(?:${API_ORIGINS.map(escapeRegExp).join("|")})`;
|
|
209
|
+
const PROBLEM_CODE_SOURCE = "[a-z][a-z0-9_]{2,63}";
|
|
210
|
+
const PROBLEM_TYPE = new RegExp(`^${ORIGIN_GROUP}/problems/${PROBLEM_CODE_SOURCE}$`, "u");
|
|
211
|
+
/**
|
|
212
|
+
* A canonical Problem `type` URI under any origin the service mints. A miss
|
|
213
|
+
* here discards `code`, `request_id` and `retryable` from a server error, so
|
|
214
|
+
* retry and backoff degrade with no signal — never narrow it.
|
|
215
|
+
*/
|
|
216
|
+
export function isProblemType(value) {
|
|
217
|
+
return PROBLEM_TYPE.test(value);
|
|
218
|
+
}
|
|
219
|
+
/** The Problem `type` URI that exactly names `code`, under any minted origin. */
|
|
220
|
+
export function isProblemTypeForCode(value, code) {
|
|
221
|
+
return API_ORIGINS.some((origin) => value === `${origin}/problems/${code}`);
|
|
222
|
+
}
|
|
223
|
+
/** The terminal stream URL for `terminalSessionId`, under any minted origin. */
|
|
224
|
+
export function isTerminalStreamUrl(value, terminalSessionId) {
|
|
225
|
+
return API_WEBSOCKET_ORIGINS.some((origin) => value === `${origin}/v1/terminal-connections/${terminalSessionId}/stream`);
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=namespace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace.js","sourceRoot":"","sources":["../../src/core/namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,2BAA2B,CAAC,eAAe,CAAU,CAAC,CAAC;AAI/G;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,OAAO,MAAM,KAAK,SAAS;QACzB,CAAC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