@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 @@
|
|
|
1
|
+
{"version":3,"file":"provider-screen.js","sourceRoot":"","sources":["../../src/machines/provider-screen.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gCAAgC,EAAE,MAAM,8BAA8B,CAAC;AAEhF,OAAO,EAA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OAAO;QAAA,CAAC;QAAA,IAAG,IAAI,KAAG,GAAG;YAAC,KAAK,IAAI,EAAE,CAAC;QAAA,IAAG,CAAC,IAAI,KAAG,EAAE,IAAE,IAAI,KAAG,EAAE,CAAC,IAAE,CAAC,IAAI,IAAE,IAAI,CAAC,IAAI,KAAG,QAAQ,IAAE,KAAK,CAAC,KAAK,CAAC;YAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAAA,CAAC,CAAA,CAAC,CAAC,CAAC;IAC5sB,MAAM,MAAM,GAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAAA,MAAM,OAAO,GAAC,GAAE,EAAE,CAAA,KAAK,EAAE,CAAC;IAAA,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAC,OAAO,EAAC,EAAC,IAAI,EAAC,IAAI,EAAC,CAAC,CAAC;IAAA,IAAG,MAAM,EAAE,OAAO;QAAC,KAAK,EAAE,CAAC;;QAAK,KAAK,IAAI,EAAE,CAAC;IAC/J,IAAG,CAAC;QAAA,OAAO,MAAM,IAAI,CAAC;IAAA,CAAC;YAAO,CAAC;QAAA,KAAK,EAAE,CAAC;QAAA,MAAM,EAAE,CAAC;QAAA,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAC,OAAO,CAAC,CAAC;QAAA,IAAG,KAAK;YAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAAA,MAAM,MAAM,CAAC;QAAA,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;IAAA,CAAC;AAC/J,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { AgentSession, AgentSessionAuthState, AgentSessionProcessObservation, Machine } from "../api/contracts.js";
|
|
2
|
+
export type SessionBaseState = "attachable" | "starting" | "login-required" | "stale" | "failed" | "terminated" | "unsupported";
|
|
3
|
+
export type SessionRefreshStatus = "idle" | "pending";
|
|
4
|
+
export type SessionRecoveryAction = "attach" | "wait" | "authenticate" | "refresh" | "show-failure" | "none";
|
|
5
|
+
/**
|
|
6
|
+
* `runtime_lease_current` and `runtime_lease_expired` were `runtime_evidence_*`.
|
|
7
|
+
*
|
|
8
|
+
* The word was wrong in a way that mattered. What this classifier tests at the
|
|
9
|
+
* end is the runtime LEASE window, and a lease renewal that carries no fresh
|
|
10
|
+
* observation moves it on its own. Calling the result "evidence current" told a
|
|
11
|
+
* reader that something had recently observed the process, which the row does
|
|
12
|
+
* not say, and the timestamps beside it now let a caller see the difference
|
|
13
|
+
* instead of inferring it from a name.
|
|
14
|
+
*
|
|
15
|
+
* `runtime_evidence_missing` and `runtime_evidence_invalid` keep their names:
|
|
16
|
+
* they really are about the evidence fields, not about the window.
|
|
17
|
+
*/
|
|
18
|
+
export type SessionActionReasonCode = "runtime_lease_current"
|
|
19
|
+
/**
|
|
20
|
+
* The lease is open AND the producer says nobody established the process
|
|
21
|
+
* state for this epoch. Two codes rather than one, because the producer
|
|
22
|
+
* distinguishes the causes: a lease renewal that settled without observing
|
|
23
|
+
* the child, and no provenance recorded at all.
|
|
24
|
+
*
|
|
25
|
+
* Both keep the base state `attachable`. The lease is still what decides
|
|
26
|
+
* whether attaching is worth attempting, and narrowing the action here would
|
|
27
|
+
* withhold the one thing that can actually answer the question — a lease is
|
|
28
|
+
* not an observation, but neither is a refusal to try.
|
|
29
|
+
*/
|
|
30
|
+
| "runtime_lease_current_observation_unproven" | "runtime_lease_current_observation_unknown" | "launch_pending" | "provider_authentication_required" | "runtime_evidence_missing" | "runtime_evidence_invalid" | "runtime_lease_expired" | "session_failed" | "termination_intended" | "machine_not_running" | "provider_unavailable" | "provider_mismatch";
|
|
31
|
+
export interface SessionActionability {
|
|
32
|
+
readonly baseState: SessionBaseState;
|
|
33
|
+
readonly refreshStatus: SessionRefreshStatus;
|
|
34
|
+
readonly recoveryAction: SessionRecoveryAction;
|
|
35
|
+
readonly reasonCode: SessionActionReasonCode;
|
|
36
|
+
readonly observationRevision: number;
|
|
37
|
+
readonly canAttach: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Who established `processState`, carried on every result with absence folded
|
|
40
|
+
* into `unknown` by `session-visibility.ts`. It travels beside the base state
|
|
41
|
+
* rather than inside it: a caller that renders one without the other is how
|
|
42
|
+
* a moving lease came to print the same word as a real observation.
|
|
43
|
+
*/
|
|
44
|
+
readonly processObservation: AgentSessionProcessObservation;
|
|
45
|
+
/**
|
|
46
|
+
* When the producer last observed this process, and how old that is at `now`.
|
|
47
|
+
* Present only once the runtime timestamps parse. Reported so a caller can
|
|
48
|
+
* show "last seen 4 h ago" beside an open lease; NO threshold is applied to
|
|
49
|
+
* it here, because no producer contract publishes one.
|
|
50
|
+
*/
|
|
51
|
+
readonly lastObservedAt?: string;
|
|
52
|
+
readonly observationAgeMs?: number;
|
|
53
|
+
/** The lease window's end. Distinct from the observation above. */
|
|
54
|
+
readonly leaseExpiresAt?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface SessionActionabilityInput {
|
|
57
|
+
readonly session: AgentSession;
|
|
58
|
+
readonly machine?: Pick<Machine, "id" | "agent" | "state">;
|
|
59
|
+
readonly authState?: AgentSessionAuthState;
|
|
60
|
+
readonly now: number;
|
|
61
|
+
readonly refreshStatus?: SessionRefreshStatus;
|
|
62
|
+
}
|
|
63
|
+
export declare function classifySessionActionability(input: SessionActionabilityInput): SessionActionability;
|
|
64
|
+
/**
|
|
65
|
+
* The one line every list, tree and explorer row prints for a session.
|
|
66
|
+
*
|
|
67
|
+
* Both qualifiers are suffixes and neither can become or replace a base state:
|
|
68
|
+
* `checking` is presentation only, and the observation note is a fact about
|
|
69
|
+
* `processState`'s provenance, not a fourth lifecycle.
|
|
70
|
+
*
|
|
71
|
+
* Why the note is here at all. `attachable` was derived from the runtime lease
|
|
72
|
+
* alone, so a row whose lease kept moving while nothing observed the child
|
|
73
|
+
* printed the byte-identical line to one a supervisor had just looked at. The
|
|
74
|
+
* note is attached only to `attachable`, because that is the only base state
|
|
75
|
+
* whose word a reader takes as "this process is up"; `stale`, `starting`,
|
|
76
|
+
* `failed`, `terminated` and `unsupported` already say the opposite or say
|
|
77
|
+
* nothing, and a provenance note on them would blur three different answers.
|
|
78
|
+
*/
|
|
79
|
+
export declare function displaySessionActionability(value: SessionActionability): string;
|
|
80
|
+
/** Missing, equal, or lower revisions cannot replace the confirmed state. */
|
|
81
|
+
export declare function mergeSessionActionabilityObservation(input: Readonly<{
|
|
82
|
+
readonly confirmed: SessionActionability;
|
|
83
|
+
readonly candidate?: SessionActionability;
|
|
84
|
+
readonly refreshStatus: SessionRefreshStatus;
|
|
85
|
+
}>): SessionActionability;
|
|
86
|
+
//# sourceMappingURL=session-actionability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-actionability.d.ts","sourceRoot":"","sources":["../../src/machines/session-actionability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EACrB,8BAA8B,EAC9B,OAAO,EACR,MAAM,qBAAqB,CAAC;AAS7B,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,UAAU,GAAG,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,GAAG,aAAa,CAAC;AAChI,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,SAAS,CAAC;AACtD,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,MAAM,GAAG,cAAc,GAAG,SAAS,GAAG,cAAc,GAAG,MAAM,CAAC;AAC7G;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,uBAAuB,GAC/B,uBAAuB;AACzB;;;;;;;;;;GAUG;GACD,4CAA4C,GAC5C,2CAA2C,GAC3C,gBAAgB,GAChB,kCAAkC,GAClC,0BAA0B,GAC1B,0BAA0B,GAC1B,uBAAuB,GACvB,gBAAgB,GAChB,sBAAsB,GACtB,qBAAqB,GACrB,sBAAsB,GACtB,mBAAmB,CAAC;AAExB,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,EAAE,gBA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AMxB"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { machineProviderAvailability } from "./provider-availability.js";
|
|
2
|
+
import { agentSessionProcessObservation, AGENT_SESSION_OBSERVATION_NOTE, isAgentSessionIntendedActive, readRuntimeWindow, } from "./session-visibility.js";
|
|
3
|
+
export function classifySessionActionability(input) {
|
|
4
|
+
const classified = classifyBase(input);
|
|
5
|
+
// Carried on every result, not only the attachable one: a `stale` row is
|
|
6
|
+
// exactly where "when was it last seen" is the question being asked.
|
|
7
|
+
const runtimeWindow = readRuntimeWindow(input.session, input.now);
|
|
8
|
+
return Object.freeze({
|
|
9
|
+
...classified,
|
|
10
|
+
refreshStatus: input.refreshStatus ?? "idle",
|
|
11
|
+
recoveryAction: recoveryFor(classified.baseState),
|
|
12
|
+
observationRevision: input.session.rowVersion,
|
|
13
|
+
canAttach: classified.baseState === "attachable",
|
|
14
|
+
processObservation: agentSessionProcessObservation(input.session),
|
|
15
|
+
...(runtimeWindow.lastObservedAt === undefined ? {} : { lastObservedAt: runtimeWindow.lastObservedAt }),
|
|
16
|
+
...(runtimeWindow.observationAgeMs === undefined ? {} : { observationAgeMs: runtimeWindow.observationAgeMs }),
|
|
17
|
+
...(runtimeWindow.leaseExpiresAt === undefined ? {} : { leaseExpiresAt: runtimeWindow.leaseExpiresAt }),
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The one line every list, tree and explorer row prints for a session.
|
|
22
|
+
*
|
|
23
|
+
* Both qualifiers are suffixes and neither can become or replace a base state:
|
|
24
|
+
* `checking` is presentation only, and the observation note is a fact about
|
|
25
|
+
* `processState`'s provenance, not a fourth lifecycle.
|
|
26
|
+
*
|
|
27
|
+
* Why the note is here at all. `attachable` was derived from the runtime lease
|
|
28
|
+
* alone, so a row whose lease kept moving while nothing observed the child
|
|
29
|
+
* printed the byte-identical line to one a supervisor had just looked at. The
|
|
30
|
+
* note is attached only to `attachable`, because that is the only base state
|
|
31
|
+
* whose word a reader takes as "this process is up"; `stale`, `starting`,
|
|
32
|
+
* `failed`, `terminated` and `unsupported` already say the opposite or say
|
|
33
|
+
* nothing, and a provenance note on them would blur three different answers.
|
|
34
|
+
*/
|
|
35
|
+
export function displaySessionActionability(value) {
|
|
36
|
+
const parts = [value.baseState];
|
|
37
|
+
const note = value.baseState === "attachable"
|
|
38
|
+
? AGENT_SESSION_OBSERVATION_NOTE[value.processObservation]
|
|
39
|
+
: undefined;
|
|
40
|
+
if (note !== undefined)
|
|
41
|
+
parts.push(note);
|
|
42
|
+
if (value.refreshStatus === "pending")
|
|
43
|
+
parts.push("checking");
|
|
44
|
+
return parts.join(" · ");
|
|
45
|
+
}
|
|
46
|
+
/** Missing, equal, or lower revisions cannot replace the confirmed state. */
|
|
47
|
+
export function mergeSessionActionabilityObservation(input) {
|
|
48
|
+
const accepted = input.candidate !== undefined &&
|
|
49
|
+
input.candidate.observationRevision > input.confirmed.observationRevision
|
|
50
|
+
? input.candidate
|
|
51
|
+
: input.confirmed;
|
|
52
|
+
return Object.freeze({ ...accepted, refreshStatus: input.refreshStatus });
|
|
53
|
+
}
|
|
54
|
+
function classifyBase(input) {
|
|
55
|
+
const { session, machine, authState, now } = input;
|
|
56
|
+
if (!isAgentSessionIntendedActive(session) || session.requestState === "terminal" ||
|
|
57
|
+
session.processState === "terminated" || session.processState === "terminating") {
|
|
58
|
+
return result("terminated", "termination_intended");
|
|
59
|
+
}
|
|
60
|
+
if (session.requestState === "failed" || session.processState === "failed" || session.processState === "exited") {
|
|
61
|
+
return result("failed", "session_failed");
|
|
62
|
+
}
|
|
63
|
+
if (machine !== undefined) {
|
|
64
|
+
if (machine.state !== "running")
|
|
65
|
+
return result("unsupported", "machine_not_running");
|
|
66
|
+
const provider = machineProviderAvailability(machine);
|
|
67
|
+
if (!provider.actionable)
|
|
68
|
+
return result("unsupported", "provider_unavailable");
|
|
69
|
+
if (provider.agent !== session.agent)
|
|
70
|
+
return result("unsupported", "provider_mismatch");
|
|
71
|
+
}
|
|
72
|
+
else if (session.agent !== "claude-code" && session.agent !== "codex" && session.agent !== "opencode") {
|
|
73
|
+
return result("unsupported", "provider_unavailable");
|
|
74
|
+
}
|
|
75
|
+
if (authState === "login_required")
|
|
76
|
+
return result("login-required", "provider_authentication_required");
|
|
77
|
+
if (authState === "unavailable")
|
|
78
|
+
return result("unsupported", "provider_unavailable");
|
|
79
|
+
if (session.requestState === "launch_pending" || session.requestState === "runtime_claimed" ||
|
|
80
|
+
session.processState === "unknown" || session.processState === "starting") {
|
|
81
|
+
return result("starting", "launch_pending");
|
|
82
|
+
}
|
|
83
|
+
if (session.processState !== "ready" && session.processState !== "running") {
|
|
84
|
+
return result("stale", "runtime_evidence_invalid");
|
|
85
|
+
}
|
|
86
|
+
if (session.processEpoch === undefined)
|
|
87
|
+
return result("stale", "runtime_evidence_missing");
|
|
88
|
+
// One parser for both timestamps, shared with `session-visibility.ts`.
|
|
89
|
+
const runtimeWindow = readRuntimeWindow(session, now);
|
|
90
|
+
if (runtimeWindow.kind === "missing")
|
|
91
|
+
return result("stale", "runtime_evidence_missing");
|
|
92
|
+
if (runtimeWindow.kind === "invalid")
|
|
93
|
+
return result("stale", "runtime_evidence_invalid");
|
|
94
|
+
// The lease decides whether attaching is worth attempting, exactly as before:
|
|
95
|
+
// the server's capability snapshot and terminal grant remain the authority
|
|
96
|
+
// that admits or refuses the attach, and nothing here is narrowed by the age
|
|
97
|
+
// of the observation carried alongside.
|
|
98
|
+
if (runtimeWindow.kind !== "lease_current")
|
|
99
|
+
return result("stale", "runtime_lease_expired");
|
|
100
|
+
// ...and the provenance of the state the lease covers is named rather than
|
|
101
|
+
// absorbed. `stale` would be wrong here: it means the lease lapsed and asks
|
|
102
|
+
// for a refresh, which answers nothing about a row whose lease is open and
|
|
103
|
+
// whose observation nobody established. So the base state, the action and the
|
|
104
|
+
// attach admission are untouched, and only the reason changes.
|
|
105
|
+
switch (agentSessionProcessObservation(session)) {
|
|
106
|
+
case "observed": return result("attachable", "runtime_lease_current");
|
|
107
|
+
case "unproven": return result("attachable", "runtime_lease_current_observation_unproven");
|
|
108
|
+
case "unknown": return result("attachable", "runtime_lease_current_observation_unknown");
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function result(baseState, reasonCode) {
|
|
112
|
+
return Object.freeze({ baseState, reasonCode });
|
|
113
|
+
}
|
|
114
|
+
function recoveryFor(state) {
|
|
115
|
+
switch (state) {
|
|
116
|
+
case "attachable": return "attach";
|
|
117
|
+
case "starting": return "wait";
|
|
118
|
+
case "login-required": return "authenticate";
|
|
119
|
+
case "stale": return "refresh";
|
|
120
|
+
case "failed": return "show-failure";
|
|
121
|
+
case "terminated":
|
|
122
|
+
case "unsupported": return "none";
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=session-actionability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-actionability.js","sourceRoot":"","sources":["../../src/machines/session-actionability.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC9B,4BAA4B,EAC5B,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAmFjC,MAAM,UAAU,4BAA4B,CAAC,KAAgC;IAC3E,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACvC,yEAAyE;IACzE,qEAAqE;IACrE,MAAM,aAAa,GAAG,iBAAiB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClE,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,GAAG,UAAU;QACb,aAAa,EAAE,KAAK,CAAC,aAAa,IAAI,MAAM;QAC5C,cAAc,EAAE,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC;QACjD,mBAAmB,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU;QAC7C,SAAS,EAAE,UAAU,CAAC,SAAS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AC5F,2EAA2E;IAC3E,4EAA4E;IAC5E,2EAA2E;IAC3E,8EAA8E;IAC9E,+DAA+D;IAC/D,QAAQ,8BAA8B,CAAC,OAAO,CAAC,EAAE,CAAC;QAChD,KAAK,UAAU,CAAC,CAAC,OAAO,MAAM,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAC;QACtE,KAAK,UAAU,CAAC,CAAC,OAAO,MAAM,CAAC,YAAY,EAAE,4CAA4C,CAAC,CAAC;QAC3F,KAAK,SAAS,CAAC,CAAC,OAAO,MAAM,CAAC,YAAY,EAAE,2CAA2C,CAAC,CAAC;IAC3F,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,SAA2B,EAAE,UAAmC;IAC9E,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,WAAW,CAAC,KAAuB;IAC1C,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,YAAY,CAAC,CAAC,OAAO,QAAQ,CAAC;QACnC,KAAK,UAAU,CAAC,CAAC,OAAO,MAAM,CAAC;QAC/B,KAAK,gBAAgB,CAAC,CAAC,OAAO,cAAc,CAAC;QAC7C,KAAK,OAAO,CAAC,CAAC,OAAO,SAAS,CAAC;QAC/B,KAAK,QAAQ,CAAC,CAAC,OAAO,cAAc,CAAC;QACrC,KAAK,YAAY,CAAC;QAClB,KAAK,aAAa,CAAC,CAAC,OAAO,MAAM,CAAC;IACpC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { AgentSession, AgentSessionProcessObservation } from "../api/contracts.js";
|
|
2
|
+
/**
|
|
3
|
+
* Whether a supervisor ESTABLISHED this row's process state for its CURRENT
|
|
4
|
+
* epoch, folding "the field is absent" into the one answer it is.
|
|
5
|
+
*
|
|
6
|
+
* Absence is `unknown`, not `observed`. A deployment older than the release that
|
|
7
|
+
* began recording provenance sends no field at all, and the producer's own
|
|
8
|
+
* description of `unknown` already covers exactly that case: "every observation
|
|
9
|
+
* older than the release that began recording it". Defaulting the other way is
|
|
10
|
+
* the single mistake this field exists to make impossible, so the fold happens
|
|
11
|
+
* once, here, and no renderer is left to decide it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function agentSessionProcessObservation(session: AgentSession): AgentSessionProcessObservation;
|
|
14
|
+
/**
|
|
15
|
+
* The words a human surface puts beside a state whose provenance is not
|
|
16
|
+
* `observed`, defined once so the session list, the Machine tree and the
|
|
17
|
+
* explorer cannot drift into three vocabularies for one producer field.
|
|
18
|
+
*
|
|
19
|
+
* `observed` has no word on purpose. It is what an unqualified "running"
|
|
20
|
+
* already means, and a qualifier on every healthy row is noise that teaches a
|
|
21
|
+
* reader to skip the two that matter.
|
|
22
|
+
*
|
|
23
|
+
* The other two are kept apart rather than folded into one "unverified",
|
|
24
|
+
* because the producer distinguishes them and the causes differ: `unproven` is
|
|
25
|
+
* a supervisor that settled a runtime-lease renewal without being able to
|
|
26
|
+
* observe the child, and `unknown` is no provenance recorded for this epoch at
|
|
27
|
+
* all — including every row from a deployment older than the release that
|
|
28
|
+
* began recording it. Neither says the process is stale, and neither may be
|
|
29
|
+
* rendered as a termination.
|
|
30
|
+
*/
|
|
31
|
+
export declare const AGENT_SESSION_OBSERVATION_NOTE: Readonly<Record<AgentSessionProcessObservation, string | undefined>>;
|
|
32
|
+
/**
|
|
33
|
+
* A still-running process is not an active session once termination has been
|
|
34
|
+
* requested. The machine overview is an operational view, not session history.
|
|
35
|
+
*/
|
|
36
|
+
export declare function isAgentSessionIntendedActive(session: AgentSession): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* What an AgentSession row supports about its runtime, as two separate facts.
|
|
39
|
+
*
|
|
40
|
+
* WHY THIS REPLACED `isAgentSessionRunningNow`. That predicate answered one
|
|
41
|
+
* boolean named "running now" from `process_state === "running"` plus
|
|
42
|
+
* `runtime_expires_at > now`, and it placed no bound at all on how old
|
|
43
|
+
* `runtime_observed_at` was. Those are two different things:
|
|
44
|
+
*
|
|
45
|
+
* `runtime_observed_at` a PAST fact — when the producer last observed this
|
|
46
|
+
* process. It can only ever say "was", never "is".
|
|
47
|
+
* `runtime_expires_at` a WINDOW — how long the runtime lease the supervisor
|
|
48
|
+
* renews remains valid. A renewal moves this forward
|
|
49
|
+
* and says nothing about the process.
|
|
50
|
+
*
|
|
51
|
+
* A lease renewal that carries no fresh observation therefore kept the old
|
|
52
|
+
* predicate answering `true` from an observation of any age, which is the exact
|
|
53
|
+
* shape of "the row asserts running while nothing observed it".
|
|
54
|
+
*
|
|
55
|
+
* WHAT THIS DELIBERATELY DOES NOT DO. It invents no freshness threshold. There
|
|
56
|
+
* is no interval after which this module declares an observation stale, because
|
|
57
|
+
* no producer contract publishes one and a number chosen here would be a
|
|
58
|
+
* fabricated liveness claim wearing a constant's clothes. The observation's age
|
|
59
|
+
* is REPORTED so a caller can show it or decide with it; it is never compared
|
|
60
|
+
* against anything.
|
|
61
|
+
*
|
|
62
|
+
* It also grants nothing. Attachment, control and observation authority stay
|
|
63
|
+
* exactly where they are — with the server's capability snapshot and the
|
|
64
|
+
* terminal grant — and no reading here substitutes for either.
|
|
65
|
+
*/
|
|
66
|
+
export type AgentSessionRuntimeEvidence =
|
|
67
|
+
/** Termination is intended or requested; the runtime fields do not matter. */
|
|
68
|
+
"not_intended_active"
|
|
69
|
+
/** The producer does not report this process as running or ready. */
|
|
70
|
+
| "not_reported_running"
|
|
71
|
+
/** One of the two runtime timestamps is absent. */
|
|
72
|
+
| "evidence_missing"
|
|
73
|
+
/** A timestamp does not parse, is in the future, or the window is inverted. */
|
|
74
|
+
| "evidence_invalid"
|
|
75
|
+
/** Last observed running, and the runtime lease has since lapsed. */
|
|
76
|
+
| "observed_running_lease_expired"
|
|
77
|
+
/**
|
|
78
|
+
* The row reports running, and the producer says nobody established that for
|
|
79
|
+
* this process epoch: a lease renewal settled without observing the child, or
|
|
80
|
+
* no provenance is recorded at all.
|
|
81
|
+
*
|
|
82
|
+
* It is deliberately its own value rather than a qualifier on the two
|
|
83
|
+
* `observed_*` ones. The word "observed" is a claim, and the whole reason the
|
|
84
|
+
* producer publishes `process_observation` is that a moving lease was making
|
|
85
|
+
* that claim on nobody's behalf. The lease is still reported in
|
|
86
|
+
* `leaseCurrent`, because it is still true — it is just not this.
|
|
87
|
+
*/
|
|
88
|
+
| "reported_running_observation_unproven"
|
|
89
|
+
/**
|
|
90
|
+
* The strongest thing an AgentSession row can support: a supervisor observed
|
|
91
|
+
* it running at `lastObservedAt` for this epoch, and the lease covering it is
|
|
92
|
+
* still open. It is NOT a statement that the process is alive at `now`.
|
|
93
|
+
*/
|
|
94
|
+
| "observed_running_lease_current";
|
|
95
|
+
export interface AgentSessionRuntimeReading {
|
|
96
|
+
readonly evidence: AgentSessionRuntimeEvidence;
|
|
97
|
+
/** The producer's own timestamp, forwarded verbatim. Absent when unusable. */
|
|
98
|
+
readonly lastObservedAt?: string;
|
|
99
|
+
/** How old that observation is at `now`. Reported; never thresholded here. */
|
|
100
|
+
readonly observationAgeMs?: number;
|
|
101
|
+
readonly leaseExpiresAt?: string;
|
|
102
|
+
/** The lease window alone. True says nothing about the process. */
|
|
103
|
+
readonly leaseCurrent: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* The producer's provenance for `processState`, with absence folded into
|
|
106
|
+
* `unknown`. Carried on every reading so a caller can never get a lease
|
|
107
|
+
* without also getting the answer to "did anybody look?".
|
|
108
|
+
*/
|
|
109
|
+
readonly processObservation: AgentSessionProcessObservation;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The two runtime timestamps, parsed once.
|
|
113
|
+
*
|
|
114
|
+
* `session-actionability.ts` used to parse the same pair with the same skew
|
|
115
|
+
* constant a few lines away from the copy here, and the two could drift into
|
|
116
|
+
* disagreeing about one row. There is one parser now, and it never decides what
|
|
117
|
+
* the pair MEANS — only what it says.
|
|
118
|
+
*/
|
|
119
|
+
export type RuntimeWindowKind = "missing" | "invalid" | "lease_current" | "lease_expired";
|
|
120
|
+
export interface RuntimeWindow {
|
|
121
|
+
readonly kind: RuntimeWindowKind;
|
|
122
|
+
readonly lastObservedAt?: string;
|
|
123
|
+
readonly observationAgeMs?: number;
|
|
124
|
+
readonly leaseExpiresAt?: string;
|
|
125
|
+
}
|
|
126
|
+
export declare function readRuntimeWindow(session: AgentSession, now: number): RuntimeWindow;
|
|
127
|
+
export declare function readAgentSessionRuntime(session: AgentSession, now: number): AgentSessionRuntimeReading;
|
|
128
|
+
/**
|
|
129
|
+
* The last thing a supervisor OBSERVED about the process, with no lease in it.
|
|
130
|
+
*
|
|
131
|
+
* Past tense in the name because it is past tense in the data: a caller that
|
|
132
|
+
* wants to say something about `now` needs more than this row. It is false when
|
|
133
|
+
* the producer says nobody established the state for this epoch, because then
|
|
134
|
+
* there is no observation to be past tense about.
|
|
135
|
+
*/
|
|
136
|
+
export declare function wasAgentSessionObservedRunning(session: AgentSession, now: number): boolean;
|
|
137
|
+
/** The runtime lease window alone. A renewal moves this and nothing else. */
|
|
138
|
+
export declare function hasCurrentAgentSessionRuntimeLease(session: AgentSession, now: number): boolean;
|
|
139
|
+
//# sourceMappingURL=session-visibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-visibility.d.ts","sourceRoot":"","sources":["../../src/machines/session-visibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AAIxF;;;;;;;;;;GAUG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,YAAY,GACpB,8BAA8B,CAEhC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CACnD,MAAM,CAAC,8BAA8B,EAAE,MAAM,GAAG,SAAS,CAAC,CAK1D,CAAC;AAEH;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAE3E;AAED;;;;;;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AY,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAG1F;AAED,6EAA6E;AAC7E,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAE9F"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
const MAX_FUTURE_SKEW_MS = 5_000;
|
|
2
|
+
/**
|
|
3
|
+
* Whether a supervisor ESTABLISHED this row's process state for its CURRENT
|
|
4
|
+
* epoch, folding "the field is absent" into the one answer it is.
|
|
5
|
+
*
|
|
6
|
+
* Absence is `unknown`, not `observed`. A deployment older than the release that
|
|
7
|
+
* began recording provenance sends no field at all, and the producer's own
|
|
8
|
+
* description of `unknown` already covers exactly that case: "every observation
|
|
9
|
+
* older than the release that began recording it". Defaulting the other way is
|
|
10
|
+
* the single mistake this field exists to make impossible, so the fold happens
|
|
11
|
+
* once, here, and no renderer is left to decide it.
|
|
12
|
+
*/
|
|
13
|
+
export function agentSessionProcessObservation(session) {
|
|
14
|
+
return session.processObservation ?? "unknown";
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The words a human surface puts beside a state whose provenance is not
|
|
18
|
+
* `observed`, defined once so the session list, the Machine tree and the
|
|
19
|
+
* explorer cannot drift into three vocabularies for one producer field.
|
|
20
|
+
*
|
|
21
|
+
* `observed` has no word on purpose. It is what an unqualified "running"
|
|
22
|
+
* already means, and a qualifier on every healthy row is noise that teaches a
|
|
23
|
+
* reader to skip the two that matter.
|
|
24
|
+
*
|
|
25
|
+
* The other two are kept apart rather than folded into one "unverified",
|
|
26
|
+
* because the producer distinguishes them and the causes differ: `unproven` is
|
|
27
|
+
* a supervisor that settled a runtime-lease renewal without being able to
|
|
28
|
+
* observe the child, and `unknown` is no provenance recorded for this epoch at
|
|
29
|
+
* all — including every row from a deployment older than the release that
|
|
30
|
+
* began recording it. Neither says the process is stale, and neither may be
|
|
31
|
+
* rendered as a termination.
|
|
32
|
+
*/
|
|
33
|
+
export const AGENT_SESSION_OBSERVATION_NOTE = Object.freeze({
|
|
34
|
+
observed: undefined,
|
|
35
|
+
unproven: "not observed",
|
|
36
|
+
unknown: "observation unknown",
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* A still-running process is not an active session once termination has been
|
|
40
|
+
* requested. The machine overview is an operational view, not session history.
|
|
41
|
+
*/
|
|
42
|
+
export function isAgentSessionIntendedActive(session) {
|
|
43
|
+
return session.desiredState === "running" && session.requestState !== "termination_pending";
|
|
44
|
+
}
|
|
45
|
+
export function readRuntimeWindow(session, now) {
|
|
46
|
+
if (session.runtimeObservedAt === undefined || session.runtimeExpiresAt === undefined) {
|
|
47
|
+
return Object.freeze({ kind: "missing" });
|
|
48
|
+
}
|
|
49
|
+
const observedAt = Date.parse(session.runtimeObservedAt);
|
|
50
|
+
const expiresAt = Date.parse(session.runtimeExpiresAt);
|
|
51
|
+
if (!Number.isFinite(observedAt) || !Number.isFinite(expiresAt) ||
|
|
52
|
+
observedAt > now + MAX_FUTURE_SKEW_MS || expiresAt <= observedAt) {
|
|
53
|
+
return Object.freeze({ kind: "invalid" });
|
|
54
|
+
}
|
|
55
|
+
const kind = expiresAt > now ? "lease_current" : "lease_expired";
|
|
56
|
+
return Object.freeze({
|
|
57
|
+
kind,
|
|
58
|
+
lastObservedAt: session.runtimeObservedAt,
|
|
59
|
+
observationAgeMs: now - observedAt,
|
|
60
|
+
leaseExpiresAt: session.runtimeExpiresAt,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function reading(evidence, processObservation, extra = { leaseCurrent: false }) {
|
|
64
|
+
return Object.freeze({ evidence, processObservation, ...extra });
|
|
65
|
+
}
|
|
66
|
+
export function readAgentSessionRuntime(session, now) {
|
|
67
|
+
const observation = agentSessionProcessObservation(session);
|
|
68
|
+
if (!isAgentSessionIntendedActive(session))
|
|
69
|
+
return reading("not_intended_active", observation);
|
|
70
|
+
if (session.processState !== "running")
|
|
71
|
+
return reading("not_reported_running", observation);
|
|
72
|
+
const runtimeWindow = readRuntimeWindow(session, now);
|
|
73
|
+
if (runtimeWindow.kind === "missing")
|
|
74
|
+
return reading("evidence_missing", observation);
|
|
75
|
+
if (runtimeWindow.kind === "invalid")
|
|
76
|
+
return reading("evidence_invalid", observation);
|
|
77
|
+
const leaseCurrent = runtimeWindow.kind === "lease_current";
|
|
78
|
+
const window = {
|
|
79
|
+
...(runtimeWindow.lastObservedAt === undefined ? {} : { lastObservedAt: runtimeWindow.lastObservedAt }),
|
|
80
|
+
...(runtimeWindow.observationAgeMs === undefined ? {} : { observationAgeMs: runtimeWindow.observationAgeMs }),
|
|
81
|
+
...(runtimeWindow.leaseExpiresAt === undefined ? {} : { leaseExpiresAt: runtimeWindow.leaseExpiresAt }),
|
|
82
|
+
leaseCurrent,
|
|
83
|
+
};
|
|
84
|
+
// The ordering that answers the requirement: a current lease is checked AFTER
|
|
85
|
+
// provenance, never instead of it. `unproven` with an open lease is the exact
|
|
86
|
+
// row this field was published for -- the lease moved and nothing observed the
|
|
87
|
+
// child -- and it must not render as a fresh observation.
|
|
88
|
+
if (observation !== "observed") {
|
|
89
|
+
return reading("reported_running_observation_unproven", observation, window);
|
|
90
|
+
}
|
|
91
|
+
return reading(leaseCurrent ? "observed_running_lease_current" : "observed_running_lease_expired", observation, window);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The last thing a supervisor OBSERVED about the process, with no lease in it.
|
|
95
|
+
*
|
|
96
|
+
* Past tense in the name because it is past tense in the data: a caller that
|
|
97
|
+
* wants to say something about `now` needs more than this row. It is false when
|
|
98
|
+
* the producer says nobody established the state for this epoch, because then
|
|
99
|
+
* there is no observation to be past tense about.
|
|
100
|
+
*/
|
|
101
|
+
export function wasAgentSessionObservedRunning(session, now) {
|
|
102
|
+
const value = readAgentSessionRuntime(session, now).evidence;
|
|
103
|
+
return value === "observed_running_lease_current" || value === "observed_running_lease_expired";
|
|
104
|
+
}
|
|
105
|
+
/** The runtime lease window alone. A renewal moves this and nothing else. */
|
|
106
|
+
export function hasCurrentAgentSessionRuntimeLease(session, now) {
|
|
107
|
+
return readAgentSessionRuntime(session, now).leaseCurrent;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=session-visibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-visibility.js","sourceRoot":"","sources":["../../src/machines/session-visibility.ts"],"names":[],"mappings":"AAEA,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAEjC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,8BAA8B,CAC5C,OAAqB;IAErB,OAAO,OAAO,CAAC,kBAAkB,IAAI,SAAS,CAAC;AACjD,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAEvC,MAAM,CAAC,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,cAAc;IACxB,OAAO,EAAE,qBAAqB;CAC/B,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,OAAqB;IAChE,OAAO,OAAO,CAAC,YAAY,KAAK,SAAS,IAAI,OAAO,CAAC,YAAY,KAAK,qBAAqB,CAAC;AAC9F,CAAC;AA+FD,MAAM,UAAU,iBAAiB,CAAC,OAAqB,EAAE,GAAW;IAClE,IAAI,OAAO,CAAC,iBAAiB,KAAK,SAAS,IAAI,OAAO,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACtF,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAkB,EAAE,CAAC,CAAC;IACrD,CAAC;IACD,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACzD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACvD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,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Y,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export type PlatformKind = "windows" | "macos" | "linux";
|
|
2
|
+
export interface PlatformPaths {
|
|
3
|
+
readonly configDirectory: string;
|
|
4
|
+
readonly stateDirectory: string;
|
|
5
|
+
readonly runtimeDirectory: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SafeFileSnapshot {
|
|
8
|
+
readonly exists: boolean;
|
|
9
|
+
readonly text?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface PlatformAdapter {
|
|
12
|
+
readonly kind: PlatformKind;
|
|
13
|
+
readonly paths: PlatformPaths;
|
|
14
|
+
readSafeConfig(path: string, maximumBytes: number): Promise<SafeFileSnapshot>;
|
|
15
|
+
/**
|
|
16
|
+
* Replace the configuration file's whole contents, owner-only and atomically.
|
|
17
|
+
*
|
|
18
|
+
* The read side is the standard: a file this refuses to read is a file it
|
|
19
|
+
* also refuses to overwrite, checked with the same ownership and permission
|
|
20
|
+
* predicates before the replacement begins. The write itself goes to a
|
|
21
|
+
* sibling temporary file, is fsynced, and is renamed over the target, so a
|
|
22
|
+
* crash or a concurrent reader observes either the previous bytes or the new
|
|
23
|
+
* ones — never a truncated file.
|
|
24
|
+
*
|
|
25
|
+
* The caller supplies the complete text. Merging belongs to the caller
|
|
26
|
+
* (`ensureProfileRecorded` in `config/config.ts`), which parses the current
|
|
27
|
+
* file and preserves every key it already holds.
|
|
28
|
+
*/
|
|
29
|
+
writeSafeConfig(path: string, text: string, maximumBytes: number): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Create the file only if the name is free, and answer which happened.
|
|
32
|
+
*
|
|
33
|
+
* `writeSafeConfig` is an atomic REPLACE: it opens a unique temporary sibling
|
|
34
|
+
* with `O_EXCL` and renames it over the target, so it never fails because the
|
|
35
|
+
* target exists. That is the right primitive for configuration, and the wrong
|
|
36
|
+
* one for a slot two processes contend for — a caller that reads, finds the
|
|
37
|
+
* slot free, and then writes is performing check-then-act, and two processes
|
|
38
|
+
* interleaved that way both believe they hold it. Measured: two real OS
|
|
39
|
+
* processes, one state directory, both reserved.
|
|
40
|
+
*
|
|
41
|
+
* This is the compare-and-swap that shape needs. The TARGET itself is opened
|
|
42
|
+
* with `O_CREAT|O_EXCL|O_NOFOLLOW`, which the kernel resolves atomically, so
|
|
43
|
+
* exactly one caller can win however the two are scheduled.
|
|
44
|
+
*
|
|
45
|
+
* Returns `true` when this call created the file and `false` when the name was
|
|
46
|
+
* already taken. `false` is an ordinary answer, not a fault: the caller owns
|
|
47
|
+
* the product sentence for "someone else holds this", and an errno is not it.
|
|
48
|
+
* Every other failure is the same typed configuration-file refusal
|
|
49
|
+
* `writeSafeConfig` raises.
|
|
50
|
+
*/
|
|
51
|
+
createExclusiveConfig(path: string, text: string, maximumBytes: number): Promise<boolean>;
|
|
52
|
+
}
|
|
53
|
+
export interface PlatformEnvironment {
|
|
54
|
+
readonly platform: NodeJS.Platform;
|
|
55
|
+
readonly env: NodeJS.ProcessEnv;
|
|
56
|
+
readonly homeDirectory: string;
|
|
57
|
+
readonly userId?: number;
|
|
58
|
+
}
|
|
59
|
+
export declare function resolvePlatformKind(platform: NodeJS.Platform): PlatformKind;
|
|
60
|
+
export declare function resolvePlatformPaths(input: PlatformEnvironment): PlatformPaths;
|
|
61
|
+
export declare function createPlatformAdapter(input?: Partial<PlatformEnvironment>): PlatformAdapter;
|
|
62
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/platform/adapter.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAEzD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;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