@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,185 @@
|
|
|
1
|
+
import { CunaError, type SafeErrorDetails } from "./errors.js";
|
|
2
|
+
/**
|
|
3
|
+
* THE ONE PLACE THE CLI IS ALLOWED TO SAY "I STOPPED LOOKING".
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS FILE EXISTS. Measured 2026-08-19 against Fly release v93 from the
|
|
6
|
+
* installed `cuna 0.1.0`: `cuna machines create --yes` returned
|
|
7
|
+
* `cuna.network.timeout` with `retryable: false` while the machine reached
|
|
8
|
+
* `running` about five seconds later, and `cuna machines delete <id> --yes`
|
|
9
|
+
* returned `cuna.remote.postcondition_unverified` with
|
|
10
|
+
* `observed_state: "present"` while `cuna machines list` six seconds later
|
|
11
|
+
* showed the machine gone. Neither detector detected what its code named. The
|
|
12
|
+
* first detected THIS PROCESS'S OWN `setTimeout` firing — the network was fine.
|
|
13
|
+
* The second detected THIS PROCESS reading back once, immediately, before a
|
|
14
|
+
* durable accept could become visible — the postcondition was not unverifiable,
|
|
15
|
+
* it was unwaited.
|
|
16
|
+
*
|
|
17
|
+
* So the rule this file enforces is not "wait longer". Raising a default moves
|
|
18
|
+
* the boundary without naming it and the next slower operation reproduces the
|
|
19
|
+
* bug identically. The rule is: **a refusal caused by the client's own budget
|
|
20
|
+
* is a different KIND of answer from a refusal caused by the operation**, and it
|
|
21
|
+
* gets its own codes, its own retryability and its own sentence.
|
|
22
|
+
*
|
|
23
|
+
* THREE PROPERTIES, AND THEY ARE STRUCTURAL RATHER THAN CONVENTIONAL.
|
|
24
|
+
*
|
|
25
|
+
* 1. `retryable` is written `true` at exactly one site — below. A caller cannot
|
|
26
|
+
* mint a budget refusal that denies retry, because the field is not a
|
|
27
|
+
* parameter. `retryable: false` was the worst available answer: it told the
|
|
28
|
+
* user not to try again AND implied the mutation had not landed, and both
|
|
29
|
+
* halves were false.
|
|
30
|
+
* 2. The refusal names the read-only command that resolves the unknown. A
|
|
31
|
+
* refusal that says "unknown" and stops has handed the user a dead end,
|
|
32
|
+
* which is the specific failure this repository already closed on the
|
|
33
|
+
* credential path. `settleWith` is optional in the TYPE and never optional
|
|
34
|
+
* in practice for the commands that mutate: the alternative — a required
|
|
35
|
+
* field with a default — would put a confidently WRONG command in front of
|
|
36
|
+
* users of every operation that forgot to declare one, and a false
|
|
37
|
+
* instruction is worse than a general one. The declarations live beside the
|
|
38
|
+
* paths in `api/client.ts`, and `test/observation-budget.test.mjs` asserts
|
|
39
|
+
* the exact command for the two operations this was measured on.
|
|
40
|
+
* 3. The message never asserts the mutation did not apply, and `details`
|
|
41
|
+
* carries `remote_outcome: "unobserved"` so a machine reader sees the same
|
|
42
|
+
* limit the human sentence states.
|
|
43
|
+
*
|
|
44
|
+
* WHAT THIS FILE IS NOT. It is not a place for genuine remote failures. A
|
|
45
|
+
* connection that was refused, a TLS error or a DNS failure is a network fault
|
|
46
|
+
* and keeps `cuna.network.failed`, including its fail-closed retryability for
|
|
47
|
+
* mutations: there the network really did fail, and the CLI has no evidence the
|
|
48
|
+
* request was ever dispatched. A read-back that returns a value which CONTRADICTS
|
|
49
|
+
* the write — a rename that observed a different name, a create that observed a
|
|
50
|
+
* different id — is a real postcondition violation that no amount of waiting
|
|
51
|
+
* repairs, and keeps `cuna.remote.postcondition_unverified`. The discriminator
|
|
52
|
+
* is the one this file is named after: did the operation answer wrongly, or did
|
|
53
|
+
* we stop asking?
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* The per-request observation budget when the caller passes no `--timeout-ms`
|
|
57
|
+
* and the operation declares no budget of its own.
|
|
58
|
+
*
|
|
59
|
+
* This used to be the literal `15_000` written twice — once in `cli/run.ts` as
|
|
60
|
+
* the flag default and once in `api/http.ts` as the transport default — which is
|
|
61
|
+
* the one-concept-two-homes shape this repository keeps closing. It is read from
|
|
62
|
+
* here in both places now.
|
|
63
|
+
*/
|
|
64
|
+
export declare const DEFAULT_REQUEST_BUDGET_MS = 15000;
|
|
65
|
+
/**
|
|
66
|
+
* `POST /v1/sessions` waits for the provider, so it is not bounded by the same
|
|
67
|
+
* budget as a list.
|
|
68
|
+
*
|
|
69
|
+
* DERIVATION, because a constant without one cannot be confirmed or refuted.
|
|
70
|
+
* Measured 2026-08-19T00:17Z against Fly release v93: the CLI aborted at the
|
|
71
|
+
* 15 s default and the machine reached `state=running` roughly five seconds
|
|
72
|
+
* after a 24 s wall-clock invocation, so the server-side create is at least
|
|
73
|
+
* ~50 s [owner-measured, not re-measured here — re-measuring costs a real
|
|
74
|
+
* machine]. 90 000 ms is that duration with an 80% margin, and it stays inside
|
|
75
|
+
* the documented `--timeout-ms` ceiling of 120 000 so a user can still widen it
|
|
76
|
+
* by hand.
|
|
77
|
+
*
|
|
78
|
+
* This is deliberately NOT the global default. Raising the global default would
|
|
79
|
+
* make every unrelated failure take six times longer to surface.
|
|
80
|
+
*/
|
|
81
|
+
export declare const MACHINE_CREATE_REQUEST_BUDGET_MS = 90000;
|
|
82
|
+
/**
|
|
83
|
+
* `POST /v1/sessions/{id}/{start|resume}` boots a VM and waits for its
|
|
84
|
+
* supervisor to accept control before it answers, so it is not bounded by the
|
|
85
|
+
* same budget as a list either.
|
|
86
|
+
*
|
|
87
|
+
* DERIVATION. Measured 2026-09-02 against edge v148 on Machine fceaf633: the
|
|
88
|
+
* answer came at 24 s from `cuna machines start` (which the caller had widened
|
|
89
|
+
* by hand with `--timeout-ms`), while the same transition inside `cuna
|
|
90
|
+
* opencode` aborted at the 15 s default and told the user the operation "may
|
|
91
|
+
* have completed" — for the step the journey itself had just decided to take.
|
|
92
|
+
* 60 000 ms is that duration with a 150% margin; it stays well inside the
|
|
93
|
+
* `--timeout-ms` ceiling of 120 000, and it is deliberately lower than the
|
|
94
|
+
* create budget because starting an existing VM does not provision one.
|
|
95
|
+
*/
|
|
96
|
+
export declare const MACHINE_LIFECYCLE_REQUEST_BUDGET_MS = 60000;
|
|
97
|
+
/**
|
|
98
|
+
* `POST /v1/sessions/{id}/supervisor/live-update` replaces a RUNNING Machine's
|
|
99
|
+
* supervisor in place, and it does five bounded remote steps before it answers.
|
|
100
|
+
*
|
|
101
|
+
* DERIVATION, summed from the producer's own declared timeouts rather than from
|
|
102
|
+
* a wall-clock sample, because no live run of this operation has been observed
|
|
103
|
+
* from this CLI yet and a constant invented from nothing cannot be refuted:
|
|
104
|
+
*
|
|
105
|
+
* 30 s pre-install session-custody observation
|
|
106
|
+
* (`MACHINE_SUPERVISOR_LIVE_CONTINUITY_TIMEOUT_SECONDS`)
|
|
107
|
+
* 10 s exec-readiness probe (`MACHINE_SUPERVISOR_EXEC_READY_TIMEOUT_MS`)
|
|
108
|
+
* 90 s the installer itself, on the live-process path
|
|
109
|
+
* (`MACHINE_SUPERVISOR_LIVE_EXEC_TIMEOUT_SECONDS`)
|
|
110
|
+
* 15 s waiting for the exact new control to acknowledge
|
|
111
|
+
* (`MACHINE_SUPERVISOR_ACK_TIMEOUT_MS`)
|
|
112
|
+
* 30 s the post-install custody re-read, same bound as the first
|
|
113
|
+
* ----
|
|
114
|
+
* 175 s before the provider read, the Machine reads and the edge's own work.
|
|
115
|
+
*
|
|
116
|
+
* 240 000 ms is that sum with a ~37% margin. It is deliberately ABOVE the
|
|
117
|
+
* `--timeout-ms` ceiling of 120 000: a caller who passes that flag overrides
|
|
118
|
+
* this budget downward and will abort a dispatch that is still in flight, which
|
|
119
|
+
* this command must then report as an unknown outcome rather than a failure.
|
|
120
|
+
* That is why the budget lives here with its derivation instead of being the
|
|
121
|
+
* lifecycle constant reused one command too far.
|
|
122
|
+
*/
|
|
123
|
+
export declare const SUPERVISOR_LIVE_UPDATE_REQUEST_BUDGET_MS = 240000;
|
|
124
|
+
/**
|
|
125
|
+
* How long the CLI reads back before it stops judging a postcondition.
|
|
126
|
+
*
|
|
127
|
+
* DERIVATION. Measured 2026-08-19: a deleted machine was still `present` on an
|
|
128
|
+
* immediate read and absent from `cuna machines list` six seconds later. The
|
|
129
|
+
* pre-existing AgentSession termination budget in `commands/commands.ts` was
|
|
130
|
+
* 15 000 ms and was the only convergence budget in the tree. 30 000 ms is the
|
|
131
|
+
* larger of the two doubled, and one constant replaces both so the two cannot
|
|
132
|
+
* drift apart again.
|
|
133
|
+
*
|
|
134
|
+
* Re-measured 2026-09-02 on production: `agent-sessions terminate` was
|
|
135
|
+
* accepted and the row read `exited` about 36 s later, so a 30 s read-back
|
|
136
|
+
* reported a false failure (exit 5) for a termination that completed. The
|
|
137
|
+
* read-back is a cheap poll; 120 s covers a supervisor that has to fence and
|
|
138
|
+
* flush a live PTY without turning a completed operation into an error.
|
|
139
|
+
*/
|
|
140
|
+
export declare const REMOTE_CONVERGENCE_BUDGET_MS = 120000;
|
|
141
|
+
/** Interval between read-backs while converging. */
|
|
142
|
+
export declare const REMOTE_CONVERGENCE_POLL_INTERVAL_MS = 500;
|
|
143
|
+
/**
|
|
144
|
+
* Every error code the CLI can mint because ITS OWN budget elapsed.
|
|
145
|
+
*
|
|
146
|
+
* This record is the authority. Consumers that need to ask "is this refusal one
|
|
147
|
+
* of ours?" — the workspace sync retry policy, the journey's uncertain-dispatch
|
|
148
|
+
* recovery — read `isObservationBudgetCode` rather than comparing literals, so
|
|
149
|
+
* adding a third kind cannot leave a consumer behind.
|
|
150
|
+
*
|
|
151
|
+
* `test/observation-budget.test.mjs` holds a hand-written floor of these exact
|
|
152
|
+
* strings in both directions, so neither deleting an entry nor adding one
|
|
153
|
+
* silently is possible. A test parametrized over this record alone would narrow
|
|
154
|
+
* along with it.
|
|
155
|
+
*/
|
|
156
|
+
export declare const OBSERVATION_BUDGET_CODES: Readonly<{
|
|
157
|
+
/** The CLI stopped waiting for a single HTTP response. */
|
|
158
|
+
readonly response: "cuna.client.response_budget_elapsed";
|
|
159
|
+
/** The CLI stopped reading back before an accepted change became visible. */
|
|
160
|
+
readonly convergence: "cuna.client.convergence_budget_elapsed";
|
|
161
|
+
}>;
|
|
162
|
+
export type ObservationBudgetKind = keyof typeof OBSERVATION_BUDGET_CODES;
|
|
163
|
+
export declare function isObservationBudgetCode(code: string): boolean;
|
|
164
|
+
export interface ObservationBudgetElapsedInput {
|
|
165
|
+
readonly kind: ObservationBudgetKind;
|
|
166
|
+
/** What was being observed, e.g. `machine deletion` or `POST /v1/sessions`. */
|
|
167
|
+
readonly operation: string;
|
|
168
|
+
/** The read-only command that settles the question, e.g. `cuna machines list`. */
|
|
169
|
+
readonly settleWith?: string;
|
|
170
|
+
/** The budget that elapsed, in milliseconds. */
|
|
171
|
+
readonly budgetMs: number;
|
|
172
|
+
readonly details?: SafeErrorDetails;
|
|
173
|
+
readonly cause?: unknown;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Mint the refusal that says "the CLI stopped observing", and nothing stronger.
|
|
177
|
+
*
|
|
178
|
+
* The exit code is `network` (5), whose published meaning is already "no
|
|
179
|
+
* authoritative answer arrived", which is exactly this. It is deliberately NOT
|
|
180
|
+
* `conflict` (6): `conflict` means current state contradicts the change and
|
|
181
|
+
* repeating it unchanged repeats the answer, and telling a script that about an
|
|
182
|
+
* operation which probably succeeded is worse than saying nothing.
|
|
183
|
+
*/
|
|
184
|
+
export declare function observationBudgetElapsed(input: ObservationBudgetElapsedInput): CunaError;
|
|
185
|
+
//# sourceMappingURL=observation-budget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observation-budget.d.ts","sourceRoot":"","sources":["../../src/core/observation-budget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAMH;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAEhD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gCAAgC,QAAS,CAAC;AAEvD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mCAAmC,QAAS,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,wCAAwC,SAAU,CAAC;AAEhE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,4BAA4B,SAAU,CAAC;AAEpD,oDAAoD;AACpD,eAAO,MAAM,mCAAmC,MAAM,CAAC;AAMvD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,wBAAwB;IACnC,0DAA0D;;IAE1D,6EAA6E;;EAEpE,CAAC;AAEZ,MAAM,MAAM,qBAAqB,GAAG,MAAM,OAAO,wBAAwB,CAAC;AAM1E,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7D;AAMD,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC;IACrC,+EAA+E;IAC/E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,kFAAkF;IAClF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,GAAG,SAAS,CA2BxF"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { EXIT_CODES, CunaError } from "./errors.js";
|
|
2
|
+
/**
|
|
3
|
+
* THE ONE PLACE THE CLI IS ALLOWED TO SAY "I STOPPED LOOKING".
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS FILE EXISTS. Measured 2026-08-19 against Fly release v93 from the
|
|
6
|
+
* installed `cuna 0.1.0`: `cuna machines create --yes` returned
|
|
7
|
+
* `cuna.network.timeout` with `retryable: false` while the machine reached
|
|
8
|
+
* `running` about five seconds later, and `cuna machines delete <id> --yes`
|
|
9
|
+
* returned `cuna.remote.postcondition_unverified` with
|
|
10
|
+
* `observed_state: "present"` while `cuna machines list` six seconds later
|
|
11
|
+
* showed the machine gone. Neither detector detected what its code named. The
|
|
12
|
+
* first detected THIS PROCESS'S OWN `setTimeout` firing — the network was fine.
|
|
13
|
+
* The second detected THIS PROCESS reading back once, immediately, before a
|
|
14
|
+
* durable accept could become visible — the postcondition was not unverifiable,
|
|
15
|
+
* it was unwaited.
|
|
16
|
+
*
|
|
17
|
+
* So the rule this file enforces is not "wait longer". Raising a default moves
|
|
18
|
+
* the boundary without naming it and the next slower operation reproduces the
|
|
19
|
+
* bug identically. The rule is: **a refusal caused by the client's own budget
|
|
20
|
+
* is a different KIND of answer from a refusal caused by the operation**, and it
|
|
21
|
+
* gets its own codes, its own retryability and its own sentence.
|
|
22
|
+
*
|
|
23
|
+
* THREE PROPERTIES, AND THEY ARE STRUCTURAL RATHER THAN CONVENTIONAL.
|
|
24
|
+
*
|
|
25
|
+
* 1. `retryable` is written `true` at exactly one site — below. A caller cannot
|
|
26
|
+
* mint a budget refusal that denies retry, because the field is not a
|
|
27
|
+
* parameter. `retryable: false` was the worst available answer: it told the
|
|
28
|
+
* user not to try again AND implied the mutation had not landed, and both
|
|
29
|
+
* halves were false.
|
|
30
|
+
* 2. The refusal names the read-only command that resolves the unknown. A
|
|
31
|
+
* refusal that says "unknown" and stops has handed the user a dead end,
|
|
32
|
+
* which is the specific failure this repository already closed on the
|
|
33
|
+
* credential path. `settleWith` is optional in the TYPE and never optional
|
|
34
|
+
* in practice for the commands that mutate: the alternative — a required
|
|
35
|
+
* field with a default — would put a confidently WRONG command in front of
|
|
36
|
+
* users of every operation that forgot to declare one, and a false
|
|
37
|
+
* instruction is worse than a general one. The declarations live beside the
|
|
38
|
+
* paths in `api/client.ts`, and `test/observation-budget.test.mjs` asserts
|
|
39
|
+
* the exact command for the two operations this was measured on.
|
|
40
|
+
* 3. The message never asserts the mutation did not apply, and `details`
|
|
41
|
+
* carries `remote_outcome: "unobserved"` so a machine reader sees the same
|
|
42
|
+
* limit the human sentence states.
|
|
43
|
+
*
|
|
44
|
+
* WHAT THIS FILE IS NOT. It is not a place for genuine remote failures. A
|
|
45
|
+
* connection that was refused, a TLS error or a DNS failure is a network fault
|
|
46
|
+
* and keeps `cuna.network.failed`, including its fail-closed retryability for
|
|
47
|
+
* mutations: there the network really did fail, and the CLI has no evidence the
|
|
48
|
+
* request was ever dispatched. A read-back that returns a value which CONTRADICTS
|
|
49
|
+
* the write — a rename that observed a different name, a create that observed a
|
|
50
|
+
* different id — is a real postcondition violation that no amount of waiting
|
|
51
|
+
* repairs, and keeps `cuna.remote.postcondition_unverified`. The discriminator
|
|
52
|
+
* is the one this file is named after: did the operation answer wrongly, or did
|
|
53
|
+
* we stop asking?
|
|
54
|
+
*/
|
|
55
|
+
/* -------------------------------------------------------------------------- */
|
|
56
|
+
/* Budgets */
|
|
57
|
+
/* -------------------------------------------------------------------------- */
|
|
58
|
+
/**
|
|
59
|
+
* The per-request observation budget when the caller passes no `--timeout-ms`
|
|
60
|
+
* and the operation declares no budget of its own.
|
|
61
|
+
*
|
|
62
|
+
* This used to be the literal `15_000` written twice — once in `cli/run.ts` as
|
|
63
|
+
* the flag default and once in `api/http.ts` as the transport default — which is
|
|
64
|
+
* the one-concept-two-homes shape this repository keeps closing. It is read from
|
|
65
|
+
* here in both places now.
|
|
66
|
+
*/
|
|
67
|
+
export const DEFAULT_REQUEST_BUDGET_MS = 15_000;
|
|
68
|
+
/**
|
|
69
|
+
* `POST /v1/sessions` waits for the provider, so it is not bounded by the same
|
|
70
|
+
* budget as a list.
|
|
71
|
+
*
|
|
72
|
+
* DERIVATION, because a constant without one cannot be confirmed or refuted.
|
|
73
|
+
* Measured 2026-08-19T00:17Z against Fly release v93: the CLI aborted at the
|
|
74
|
+
* 15 s default and the machine reached `state=running` roughly five seconds
|
|
75
|
+
* after a 24 s wall-clock invocation, so the server-side create is at least
|
|
76
|
+
* ~50 s [owner-measured, not re-measured here — re-measuring costs a real
|
|
77
|
+
* machine]. 90 000 ms is that duration with an 80% margin, and it stays inside
|
|
78
|
+
* the documented `--timeout-ms` ceiling of 120 000 so a user can still widen it
|
|
79
|
+
* by hand.
|
|
80
|
+
*
|
|
81
|
+
* This is deliberately NOT the global default. Raising the global default would
|
|
82
|
+
* make every unrelated failure take six times longer to surface.
|
|
83
|
+
*/
|
|
84
|
+
export const MACHINE_CREATE_REQUEST_BUDGET_MS = 90_000;
|
|
85
|
+
/**
|
|
86
|
+
* `POST /v1/sessions/{id}/{start|resume}` boots a VM and waits for its
|
|
87
|
+
* supervisor to accept control before it answers, so it is not bounded by the
|
|
88
|
+
* same budget as a list either.
|
|
89
|
+
*
|
|
90
|
+
* DERIVATION. Measured 2026-09-02 against edge v148 on Machine fceaf633: the
|
|
91
|
+
* answer came at 24 s from `cuna machines start` (which the caller had widened
|
|
92
|
+
* by hand with `--timeout-ms`), while the same transition inside `cuna
|
|
93
|
+
* opencode` aborted at the 15 s default and told the user the operation "may
|
|
94
|
+
* have completed" — for the step the journey itself had just decided to take.
|
|
95
|
+
* 60 000 ms is that duration with a 150% margin; it stays well inside the
|
|
96
|
+
* `--timeout-ms` ceiling of 120 000, and it is deliberately lower than the
|
|
97
|
+
* create budget because starting an existing VM does not provision one.
|
|
98
|
+
*/
|
|
99
|
+
export const MACHINE_LIFECYCLE_REQUEST_BUDGET_MS = 60_000;
|
|
100
|
+
/**
|
|
101
|
+
* `POST /v1/sessions/{id}/supervisor/live-update` replaces a RUNNING Machine's
|
|
102
|
+
* supervisor in place, and it does five bounded remote steps before it answers.
|
|
103
|
+
*
|
|
104
|
+
* DERIVATION, summed from the producer's own declared timeouts rather than from
|
|
105
|
+
* a wall-clock sample, because no live run of this operation has been observed
|
|
106
|
+
* from this CLI yet and a constant invented from nothing cannot be refuted:
|
|
107
|
+
*
|
|
108
|
+
* 30 s pre-install session-custody observation
|
|
109
|
+
* (`MACHINE_SUPERVISOR_LIVE_CONTINUITY_TIMEOUT_SECONDS`)
|
|
110
|
+
* 10 s exec-readiness probe (`MACHINE_SUPERVISOR_EXEC_READY_TIMEOUT_MS`)
|
|
111
|
+
* 90 s the installer itself, on the live-process path
|
|
112
|
+
* (`MACHINE_SUPERVISOR_LIVE_EXEC_TIMEOUT_SECONDS`)
|
|
113
|
+
* 15 s waiting for the exact new control to acknowledge
|
|
114
|
+
* (`MACHINE_SUPERVISOR_ACK_TIMEOUT_MS`)
|
|
115
|
+
* 30 s the post-install custody re-read, same bound as the first
|
|
116
|
+
* ----
|
|
117
|
+
* 175 s before the provider read, the Machine reads and the edge's own work.
|
|
118
|
+
*
|
|
119
|
+
* 240 000 ms is that sum with a ~37% margin. It is deliberately ABOVE the
|
|
120
|
+
* `--timeout-ms` ceiling of 120 000: a caller who passes that flag overrides
|
|
121
|
+
* this budget downward and will abort a dispatch that is still in flight, which
|
|
122
|
+
* this command must then report as an unknown outcome rather than a failure.
|
|
123
|
+
* That is why the budget lives here with its derivation instead of being the
|
|
124
|
+
* lifecycle constant reused one command too far.
|
|
125
|
+
*/
|
|
126
|
+
export const SUPERVISOR_LIVE_UPDATE_REQUEST_BUDGET_MS = 240_000;
|
|
127
|
+
/**
|
|
128
|
+
* How long the CLI reads back before it stops judging a postcondition.
|
|
129
|
+
*
|
|
130
|
+
* DERIVATION. Measured 2026-08-19: a deleted machine was still `present` on an
|
|
131
|
+
* immediate read and absent from `cuna machines list` six seconds later. The
|
|
132
|
+
* pre-existing AgentSession termination budget in `commands/commands.ts` was
|
|
133
|
+
* 15 000 ms and was the only convergence budget in the tree. 30 000 ms is the
|
|
134
|
+
* larger of the two doubled, and one constant replaces both so the two cannot
|
|
135
|
+
* drift apart again.
|
|
136
|
+
*
|
|
137
|
+
* Re-measured 2026-09-02 on production: `agent-sessions terminate` was
|
|
138
|
+
* accepted and the row read `exited` about 36 s later, so a 30 s read-back
|
|
139
|
+
* reported a false failure (exit 5) for a termination that completed. The
|
|
140
|
+
* read-back is a cheap poll; 120 s covers a supervisor that has to fence and
|
|
141
|
+
* flush a live PTY without turning a completed operation into an error.
|
|
142
|
+
*/
|
|
143
|
+
export const REMOTE_CONVERGENCE_BUDGET_MS = 120_000;
|
|
144
|
+
/** Interval between read-backs while converging. */
|
|
145
|
+
export const REMOTE_CONVERGENCE_POLL_INTERVAL_MS = 500;
|
|
146
|
+
/* -------------------------------------------------------------------------- */
|
|
147
|
+
/* The authority */
|
|
148
|
+
/* -------------------------------------------------------------------------- */
|
|
149
|
+
/**
|
|
150
|
+
* Every error code the CLI can mint because ITS OWN budget elapsed.
|
|
151
|
+
*
|
|
152
|
+
* This record is the authority. Consumers that need to ask "is this refusal one
|
|
153
|
+
* of ours?" — the workspace sync retry policy, the journey's uncertain-dispatch
|
|
154
|
+
* recovery — read `isObservationBudgetCode` rather than comparing literals, so
|
|
155
|
+
* adding a third kind cannot leave a consumer behind.
|
|
156
|
+
*
|
|
157
|
+
* `test/observation-budget.test.mjs` holds a hand-written floor of these exact
|
|
158
|
+
* strings in both directions, so neither deleting an entry nor adding one
|
|
159
|
+
* silently is possible. A test parametrized over this record alone would narrow
|
|
160
|
+
* along with it.
|
|
161
|
+
*/
|
|
162
|
+
export const OBSERVATION_BUDGET_CODES = Object.freeze({
|
|
163
|
+
/** The CLI stopped waiting for a single HTTP response. */
|
|
164
|
+
response: "cuna.client.response_budget_elapsed",
|
|
165
|
+
/** The CLI stopped reading back before an accepted change became visible. */
|
|
166
|
+
convergence: "cuna.client.convergence_budget_elapsed",
|
|
167
|
+
});
|
|
168
|
+
const OBSERVATION_BUDGET_CODE_SET = new Set(Object.values(OBSERVATION_BUDGET_CODES));
|
|
169
|
+
export function isObservationBudgetCode(code) {
|
|
170
|
+
return OBSERVATION_BUDGET_CODE_SET.has(code);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Mint the refusal that says "the CLI stopped observing", and nothing stronger.
|
|
174
|
+
*
|
|
175
|
+
* The exit code is `network` (5), whose published meaning is already "no
|
|
176
|
+
* authoritative answer arrived", which is exactly this. It is deliberately NOT
|
|
177
|
+
* `conflict` (6): `conflict` means current state contradicts the change and
|
|
178
|
+
* repeating it unchanged repeats the answer, and telling a script that about an
|
|
179
|
+
* operation which probably succeeded is worse than saying nothing.
|
|
180
|
+
*/
|
|
181
|
+
export function observationBudgetElapsed(input) {
|
|
182
|
+
const settle = input.settleWith === undefined
|
|
183
|
+
? "Re-read the resource with a read-only `cuna` command before re-issuing this mutation."
|
|
184
|
+
: `Run \`${input.settleWith}\` to see the current state.`;
|
|
185
|
+
return new CunaError({
|
|
186
|
+
code: OBSERVATION_BUDGET_CODES[input.kind],
|
|
187
|
+
message: input.kind === "response"
|
|
188
|
+
? `The CLI stopped waiting for Cuna to answer ${input.operation} after ${input.budgetMs} ms.`
|
|
189
|
+
: `Cuna accepted ${input.operation}; the CLI stopped reading back after ${input.budgetMs} ms, before the change became visible.`,
|
|
190
|
+
exitCode: EXIT_CODES.network,
|
|
191
|
+
hint: input.kind === "response"
|
|
192
|
+
? `This is the CLI's own limit, not a Cuna failure, and the operation may have completed. ${settle} Raise --timeout-ms to wait longer.`
|
|
193
|
+
: `This is the CLI's own limit, not a Cuna failure, and the change may still be settling. ${settle}`,
|
|
194
|
+
// Written once, here, and not reachable as a parameter. A budget refusal
|
|
195
|
+
// that denied retry is the defect this module exists to make unspellable.
|
|
196
|
+
retryable: true,
|
|
197
|
+
details: Object.freeze({
|
|
198
|
+
...input.details,
|
|
199
|
+
budget_ms: input.budgetMs,
|
|
200
|
+
...(input.settleWith === undefined ? {} : { settle_with: input.settleWith }),
|
|
201
|
+
// Stated for machine readers in the same record as the sentence: the CLI
|
|
202
|
+
// observed nothing, which is not the same as observing that nothing
|
|
203
|
+
// happened.
|
|
204
|
+
remote_outcome: "unobserved",
|
|
205
|
+
}),
|
|
206
|
+
...(input.cause === undefined ? {} : { cause: input.cause }),
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=observation-budget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observation-budget.js","sourceRoot":"","sources":["../../src/core/observation-budget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAyB,MAAM,aAAa,CAAC;AAE3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAEhD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,MAAM,CAAC;AAEvD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,MAAM,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAG,OAAO,CAAC;AAEhE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,OAAO,CAAC;AAEpD,oDAAoD;AACpD,MAAM,CAAC,MAAM,mCAAmC,GAAG,GAAG,CAAC;AAEvD,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,CAAC;IACpD,0DAA0D;IAC1D,QAAQ,EAAE,qCAAqC;IAC/C,6EAA6E;IAC7E,WAAW,EAAE,wCAAwC;CAC7C,CAAC,CAAC;AAIZ,MAAM,2BAA2B,GAAwB,IAAI,GAAG,CAC9D,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,CACxC,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,IAAY;IAClD,OAAO,2BAA2B,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC;AAkBD;;;;;;;;GAQG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAoC;IAC3E,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,KAAK,SAAS;QAC3C,CAAC,CAAC,uFAAuF;QACzF,CAAC,CAAC,SAAS,KAAK,CAAC,UAAU,8BAA8B,CAAC;IAC5D,OAAO,IAAI,SAAS,CAAC;QACnB,IAAI,EAAE,wBAAwB,CAAC,KAAK,CAAC,IAAI,CAAC;QAC1C,OAAO,EAAE,KAAK,CAAC,IAAI,KAAK,UAAU;YAChC,CAAC,CAAC,8CAA8C,KAAK,CAAC,SAAS,UAAU,KAAK,CAAC,QAAQ,MAAM;YAC7F,CAAC,CAAC,iBAAiB,KAAK,CAAC,SAAS,wCAAwC,KAAK,CAAC,QAAQ,wCAAwC;QAClI,QAAQ,EAAE,UAAU,CAAC,OAAO;QAC5B,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,UAAU;YAC7B,CAAC,CAAC,0FAA0F,MAAM,qCAAqC;YACvI,CAAC,CAAC,0FAA0F,MAAM,EAAE;QACtG,yEAAyE;QACzE,0EAA0E;QAC1E,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;YACrB,GAAG,KAAK,CAAC,OAAO;YAChB,SAAS,EAAE,KAAK,CAAC,QAAQ;YACzB,GAAG,CAAC,KAAK,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC;YAC5E,yEAAyE;YACzE,oEAAoE;YACpE,YAAY;YACZ,cAAc,EAAE,YAAY;SAC7B,CAAC;QACF,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;KAC7D,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The product's public web destinations, and the sentences that point at them.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS FILE EXISTS. Measured on the installed build: `cuna --help` contained
|
|
5
|
+
* ZERO matches for `https?://`, and the credential hint said "Set CUNA_API_KEY to
|
|
6
|
+
* a Cuna automation credential" without saying where a credential comes from.
|
|
7
|
+
* Both exits from the first-run wall were closed — `login` and `signup` fail on
|
|
8
|
+
* this platform, and the automation path named no source. A user who has never
|
|
9
|
+
* seen the console had nowhere to go.
|
|
10
|
+
*
|
|
11
|
+
* WHY IT IS ONE AUTHORITY AND NOT A STRING PER SITE. Four independent places
|
|
12
|
+
* already told the user about the automation credential:
|
|
13
|
+
*
|
|
14
|
+
* - `api/http.ts` "Replace CUNA_API_KEY with a valid automation credential."
|
|
15
|
+
* - `auth/human-session.ts` the `AUTOMATION_CREDENTIAL_HINT` constant
|
|
16
|
+
* - `commands/commands.ts` "Run `cuna login` … or set CUNA_API_KEY …"
|
|
17
|
+
* - `cli/help.ts` the Authentication block
|
|
18
|
+
*
|
|
19
|
+
* Four spellings of one fact, compared by nobody. That is the exact recurring
|
|
20
|
+
* defect this repository has closed four times in other namespaces: a value is
|
|
21
|
+
* minted in one place and repeated in another, one side is edited, and the two
|
|
22
|
+
* drift. Adding the URL to one of the four would have created a fifth variant
|
|
23
|
+
* rather than closing the hole, so the sentence itself moved here.
|
|
24
|
+
*
|
|
25
|
+
* WHAT IS DELIBERATELY NOT HERE. No marketing apex, no docs URL, no social
|
|
26
|
+
* link. A CLI that prints product URLs everywhere is its own defect; each
|
|
27
|
+
* destination below exists because a specific, measured message dead-ends
|
|
28
|
+
* without it, and for no other reason.
|
|
29
|
+
*/
|
|
30
|
+
/** The console origin. Verified 2026-08-10: 200 after its sign-in redirect. */
|
|
31
|
+
export declare const CONSOLE_ORIGIN: "https://app.getcuna.com";
|
|
32
|
+
/**
|
|
33
|
+
* Where an automation credential is created.
|
|
34
|
+
*
|
|
35
|
+
* Verified 2026-08-10 from this machine: `GET https://app.getcuna.com/api-keys`
|
|
36
|
+
* answers `307` to `https://getcuna.com/login?next=…%2Fapi-keys` when
|
|
37
|
+
* unauthenticated, and `200 text/html` after following it. That is a real page
|
|
38
|
+
* behind sign-in, not a 404 — which is the only property a hint may promise.
|
|
39
|
+
*/
|
|
40
|
+
export declare const API_KEYS_URL: "https://app.getcuna.com/api-keys";
|
|
41
|
+
/**
|
|
42
|
+
* Where "contact Cuna support" actually goes.
|
|
43
|
+
*
|
|
44
|
+
* Two shipped hints told the user to contact support and named no destination.
|
|
45
|
+
* This is the CLI's published `bugs.url`; `test/product-web.test.mjs` asserts it
|
|
46
|
+
* is byte-identical to `package.json`, so the two cannot drift.
|
|
47
|
+
*/
|
|
48
|
+
export declare const SUPPORT_URL: "https://github.com/Cuna-Labs/cuna-cli/issues";
|
|
49
|
+
/**
|
|
50
|
+
* The one sentence that tells a user how to authenticate without a browser.
|
|
51
|
+
*
|
|
52
|
+
* The variable name is read from `brandedEnvironmentNames`, the same authority
|
|
53
|
+
* the resolver reads, so a change to the accepted set cannot leave this
|
|
54
|
+
* sentence naming a variable nothing reads. The URL is a literal because it is
|
|
55
|
+
* not derived from anything in this tree — it is a fact about a deployed site,
|
|
56
|
+
* and `test/product-web.test.mjs` pins it with a literal oracle.
|
|
57
|
+
*/
|
|
58
|
+
export declare function automationCredentialHint(): string;
|
|
59
|
+
/**
|
|
60
|
+
* The one sentence for "the server answered, but not within its own contract".
|
|
61
|
+
*
|
|
62
|
+
* Deliberately not "retry". Nothing the caller can do locally changes the
|
|
63
|
+
* outcome — the deployed API is behind its published contract and the CLI is
|
|
64
|
+
* correct to refuse the body — so the honest remedy is to say that plainly and
|
|
65
|
+
* name a destination. Four mint sites emit this class
|
|
66
|
+
* (`api/client.ts`, `api/http.ts`, `auth/human-contracts.ts`,
|
|
67
|
+
* `commands/commands.ts`); they share this constant so they cannot drift into
|
|
68
|
+
* four different degrees of helpfulness, which is exactly what had happened to
|
|
69
|
+
* `details` before this change.
|
|
70
|
+
*/
|
|
71
|
+
export declare const OFF_CONTRACT_RESPONSE_HINT: string;
|
|
72
|
+
/**
|
|
73
|
+
* The one sentence for a guard that can only fire on a CLI bug.
|
|
74
|
+
*
|
|
75
|
+
* Four `cuna.internal.*` guards and the four request-encoding guards are
|
|
76
|
+
* unreachable from any invocation: they assert the CLI's own construction of a
|
|
77
|
+
* request. Shipping them with no hint told the user their command was at fault.
|
|
78
|
+
* Naming the CLI as the defective party is the actionable content.
|
|
79
|
+
*/
|
|
80
|
+
export declare const INTERNAL_DEFECT_HINT: string;
|
|
81
|
+
//# sourceMappingURL=product-web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-web.d.ts","sourceRoot":"","sources":["../../src/core/product-web.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,+EAA+E;AAC/E,eAAO,MAAM,cAAc,EAAG,yBAAkC,CAAC;AAEjE;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,oCAAwC,CAAC;AAElE;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAG,8CAAuD,CAAC;AAEnF;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAGjD;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,QAEgD,CAAC;AAExF;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,QAEgD,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { brandedEnvironmentNames } from "./namespace.js";
|
|
2
|
+
/**
|
|
3
|
+
* The product's public web destinations, and the sentences that point at them.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS FILE EXISTS. Measured on the installed build: `cuna --help` contained
|
|
6
|
+
* ZERO matches for `https?://`, and the credential hint said "Set CUNA_API_KEY to
|
|
7
|
+
* a Cuna automation credential" without saying where a credential comes from.
|
|
8
|
+
* Both exits from the first-run wall were closed — `login` and `signup` fail on
|
|
9
|
+
* this platform, and the automation path named no source. A user who has never
|
|
10
|
+
* seen the console had nowhere to go.
|
|
11
|
+
*
|
|
12
|
+
* WHY IT IS ONE AUTHORITY AND NOT A STRING PER SITE. Four independent places
|
|
13
|
+
* already told the user about the automation credential:
|
|
14
|
+
*
|
|
15
|
+
* - `api/http.ts` "Replace CUNA_API_KEY with a valid automation credential."
|
|
16
|
+
* - `auth/human-session.ts` the `AUTOMATION_CREDENTIAL_HINT` constant
|
|
17
|
+
* - `commands/commands.ts` "Run `cuna login` … or set CUNA_API_KEY …"
|
|
18
|
+
* - `cli/help.ts` the Authentication block
|
|
19
|
+
*
|
|
20
|
+
* Four spellings of one fact, compared by nobody. That is the exact recurring
|
|
21
|
+
* defect this repository has closed four times in other namespaces: a value is
|
|
22
|
+
* minted in one place and repeated in another, one side is edited, and the two
|
|
23
|
+
* drift. Adding the URL to one of the four would have created a fifth variant
|
|
24
|
+
* rather than closing the hole, so the sentence itself moved here.
|
|
25
|
+
*
|
|
26
|
+
* WHAT IS DELIBERATELY NOT HERE. No marketing apex, no docs URL, no social
|
|
27
|
+
* link. A CLI that prints product URLs everywhere is its own defect; each
|
|
28
|
+
* destination below exists because a specific, measured message dead-ends
|
|
29
|
+
* without it, and for no other reason.
|
|
30
|
+
*/
|
|
31
|
+
/** The console origin. Verified 2026-08-10: 200 after its sign-in redirect. */
|
|
32
|
+
export const CONSOLE_ORIGIN = "https://app.getcuna.com";
|
|
33
|
+
/**
|
|
34
|
+
* Where an automation credential is created.
|
|
35
|
+
*
|
|
36
|
+
* Verified 2026-08-10 from this machine: `GET https://app.getcuna.com/api-keys`
|
|
37
|
+
* answers `307` to `https://getcuna.com/login?next=…%2Fapi-keys` when
|
|
38
|
+
* unauthenticated, and `200 text/html` after following it. That is a real page
|
|
39
|
+
* behind sign-in, not a 404 — which is the only property a hint may promise.
|
|
40
|
+
*/
|
|
41
|
+
export const API_KEYS_URL = `${CONSOLE_ORIGIN}/api-keys`;
|
|
42
|
+
/**
|
|
43
|
+
* Where "contact Cuna support" actually goes.
|
|
44
|
+
*
|
|
45
|
+
* Two shipped hints told the user to contact support and named no destination.
|
|
46
|
+
* This is the CLI's published `bugs.url`; `test/product-web.test.mjs` asserts it
|
|
47
|
+
* is byte-identical to `package.json`, so the two cannot drift.
|
|
48
|
+
*/
|
|
49
|
+
export const SUPPORT_URL = "https://github.com/Cuna-Labs/cuna-cli/issues";
|
|
50
|
+
/**
|
|
51
|
+
* The one sentence that tells a user how to authenticate without a browser.
|
|
52
|
+
*
|
|
53
|
+
* The variable name is read from `brandedEnvironmentNames`, the same authority
|
|
54
|
+
* the resolver reads, so a change to the accepted set cannot leave this
|
|
55
|
+
* sentence naming a variable nothing reads. The URL is a literal because it is
|
|
56
|
+
* not derived from anything in this tree — it is a fact about a deployed site,
|
|
57
|
+
* and `test/product-web.test.mjs` pins it with a literal oracle.
|
|
58
|
+
*/
|
|
59
|
+
export function automationCredentialHint() {
|
|
60
|
+
const primary = brandedEnvironmentNames("API_KEY")[0];
|
|
61
|
+
return `Create an automation credential at ${API_KEYS_URL}, then set ${primary} to it.`;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The one sentence for "the server answered, but not within its own contract".
|
|
65
|
+
*
|
|
66
|
+
* Deliberately not "retry". Nothing the caller can do locally changes the
|
|
67
|
+
* outcome — the deployed API is behind its published contract and the CLI is
|
|
68
|
+
* correct to refuse the body — so the honest remedy is to say that plainly and
|
|
69
|
+
* name a destination. Four mint sites emit this class
|
|
70
|
+
* (`api/client.ts`, `api/http.ts`, `auth/human-contracts.ts`,
|
|
71
|
+
* `commands/commands.ts`); they share this constant so they cannot drift into
|
|
72
|
+
* four different degrees of helpfulness, which is exactly what had happened to
|
|
73
|
+
* `details` before this change.
|
|
74
|
+
*/
|
|
75
|
+
export const OFF_CONTRACT_RESPONSE_HINT = "The deployed Cuna API is behind its published contract, so this cannot be fixed from the CLI. " +
|
|
76
|
+
`Run \`cuna version --json\` and report it with the details above at ${SUPPORT_URL}.`;
|
|
77
|
+
/**
|
|
78
|
+
* The one sentence for a guard that can only fire on a CLI bug.
|
|
79
|
+
*
|
|
80
|
+
* Four `cuna.internal.*` guards and the four request-encoding guards are
|
|
81
|
+
* unreachable from any invocation: they assert the CLI's own construction of a
|
|
82
|
+
* request. Shipping them with no hint told the user their command was at fault.
|
|
83
|
+
* Naming the CLI as the defective party is the actionable content.
|
|
84
|
+
*/
|
|
85
|
+
export const INTERNAL_DEFECT_HINT = "This is a defect in the Cuna CLI, not in your invocation. " +
|
|
86
|
+
`Run \`cuna version --json\` and report it with that record at ${SUPPORT_URL}.`;
|
|
87
|
+
//# sourceMappingURL=product-web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-web.js","sourceRoot":"","sources":["../../src/core/product-web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,cAAc,GAAG,yBAAkC,CAAC;AAEjE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,cAAc,WAAoB,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,8CAAuD,CAAC;AAEnF;;;;;;;;GAQG;AACH,MAAM,UAAU,wBAAwB;IACtC,MAAM,OAAO,GAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,OAAO,sCAAsC,YAAY,cAAc,OAAO,SAAS,CAAC;AAC1F,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,0BAA0B,GACrC,gGAAgG;IAChG,uEAAuE,WAAW,GAAG,CAAC;AAExF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,4DAA4D;IAC5D,iEAAiE,WAAW,GAAG,CAAC"}
|