@openrig/cli 0.7.22 → 0.7.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/daemon/assets/onboarding/01-world-and-purpose.md +2 -1
- package/daemon/assets/onboarding/02-self-and-competent-action.md +6 -0
- package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +13 -0
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +4 -0
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +31 -5
- package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +1 -1
- package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +32 -6
- package/daemon/assets/skills/rigs/SKILL.md +14 -5
- package/daemon/context-packs/help/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +15 -6
- package/daemon/context-packs/reference/acp-agents.md +2 -1
- package/daemon/context-packs/reference/getting-started.md +119 -12
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +193 -3
- package/daemon/context-packs/reference/tmux-servers.md +27 -2
- package/daemon/context-packs/reference/whats-new.md +92 -12
- package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
- package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
- package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
- package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/claude-compaction-restore/scripts/precompact-hook.mjs +4 -0
- package/daemon/context-packs/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +31 -5
- package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +1 -1
- package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +3 -3
- package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
- package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +32 -6
- package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
- package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
- package/daemon/context-packs/world-example/manifest.yaml +1 -1
- package/daemon/context-packs/world-public/manifest.yaml +1 -1
- package/daemon/dist/adapters/claude-code-adapter.d.ts +14 -1
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +86 -17
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-resume.js +8 -4
- package/daemon/dist/adapters/claude-resume.js.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.js +19 -4
- package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/seat-slice.d.ts +19 -0
- package/daemon/dist/adapters/seat-slice.d.ts.map +1 -0
- package/daemon/dist/adapters/seat-slice.js +29 -0
- package/daemon/dist/adapters/seat-slice.js.map +1 -0
- package/daemon/dist/adapters/shell-quote.d.ts +1 -0
- package/daemon/dist/adapters/shell-quote.d.ts.map +1 -1
- package/daemon/dist/adapters/shell-quote.js +6 -0
- package/daemon/dist/adapters/shell-quote.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +32 -8
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +253 -59
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/daemon-shutdown.d.ts +5 -0
- package/daemon/dist/daemon-shutdown.d.ts.map +1 -1
- package/daemon/dist/daemon-shutdown.js +10 -2
- package/daemon/dist/daemon-shutdown.js.map +1 -1
- package/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +24 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrate.d.ts +15 -1
- package/daemon/dist/db/migrate.d.ts.map +1 -1
- package/daemon/dist/db/migrate.js +41 -6
- package/daemon/dist/db/migrate.js.map +1 -1
- package/daemon/dist/db/migrations/179_remote_control_observations.d.ts +10 -0
- package/daemon/dist/db/migrations/179_remote_control_observations.d.ts.map +1 -0
- package/daemon/dist/db/migrations/179_remote_control_observations.js +20 -0
- package/daemon/dist/db/migrations/179_remote_control_observations.js.map +1 -0
- package/daemon/dist/db/migrations/180_session_stop_attempt.d.ts +5 -0
- package/daemon/dist/db/migrations/180_session_stop_attempt.d.ts.map +1 -0
- package/daemon/dist/db/migrations/180_session_stop_attempt.js +7 -0
- package/daemon/dist/db/migrations/180_session_stop_attempt.js.map +1 -0
- package/daemon/dist/db/migrations/181_node_keep_alive.d.ts +8 -0
- package/daemon/dist/db/migrations/181_node_keep_alive.d.ts.map +1 -0
- package/daemon/dist/db/migrations/181_node_keep_alive.js +26 -0
- package/daemon/dist/db/migrations/181_node_keep_alive.js.map +1 -0
- package/daemon/dist/db/migrations/182_queue_items_blocked_on_index.d.ts +7 -0
- package/daemon/dist/db/migrations/182_queue_items_blocked_on_index.d.ts.map +1 -0
- package/daemon/dist/db/migrations/182_queue_items_blocked_on_index.js +11 -0
- package/daemon/dist/db/migrations/182_queue_items_blocked_on_index.js.map +1 -0
- package/daemon/dist/db/migrations/183_queue_items_scan_indexes.d.ts +8 -0
- package/daemon/dist/db/migrations/183_queue_items_scan_indexes.d.ts.map +1 -0
- package/daemon/dist/db/migrations/183_queue_items_scan_indexes.js +13 -0
- package/daemon/dist/db/migrations/183_queue_items_scan_indexes.js.map +1 -0
- package/daemon/dist/db/migrations/184_network_requests.d.ts +11 -0
- package/daemon/dist/db/migrations/184_network_requests.d.ts.map +1 -0
- package/daemon/dist/db/migrations/184_network_requests.js +32 -0
- package/daemon/dist/db/migrations/184_network_requests.js.map +1 -0
- package/daemon/dist/db/migrations/185_seat_cold_starts.d.ts +9 -0
- package/daemon/dist/db/migrations/185_seat_cold_starts.d.ts.map +1 -0
- package/daemon/dist/db/migrations/185_seat_cold_starts.js +19 -0
- package/daemon/dist/db/migrations/185_seat_cold_starts.js.map +1 -0
- package/daemon/dist/db/migrations/186_queue_relayed_answers.d.ts +3 -0
- package/daemon/dist/db/migrations/186_queue_relayed_answers.d.ts.map +1 -0
- package/daemon/dist/db/migrations/186_queue_relayed_answers.js +5 -0
- package/daemon/dist/db/migrations/186_queue_relayed_answers.js.map +1 -0
- package/daemon/dist/db/migrations/189_rig_seat_slice.d.ts +5 -0
- package/daemon/dist/db/migrations/189_rig_seat_slice.d.ts.map +1 -0
- package/daemon/dist/db/migrations/189_rig_seat_slice.js +7 -0
- package/daemon/dist/db/migrations/189_rig_seat_slice.js.map +1 -0
- package/daemon/dist/db/migrations/190_queue_transfer_staging.d.ts +3 -0
- package/daemon/dist/db/migrations/190_queue_transfer_staging.d.ts.map +1 -0
- package/daemon/dist/db/migrations/190_queue_transfer_staging.js +20 -0
- package/daemon/dist/db/migrations/190_queue_transfer_staging.js.map +1 -0
- package/daemon/dist/db/migrations/191_network_binding_providers.d.ts +3 -0
- package/daemon/dist/db/migrations/191_network_binding_providers.d.ts.map +1 -0
- package/daemon/dist/db/migrations/191_network_binding_providers.js +27 -0
- package/daemon/dist/db/migrations/191_network_binding_providers.js.map +1 -0
- package/daemon/dist/db/migrations/194_workflow_run_title.d.ts +4 -0
- package/daemon/dist/db/migrations/194_workflow_run_title.d.ts.map +1 -0
- package/daemon/dist/db/migrations/194_workflow_run_title.js +6 -0
- package/daemon/dist/db/migrations/194_workflow_run_title.js.map +1 -0
- package/daemon/dist/domain/activity-taxonomy.d.ts +3 -0
- package/daemon/dist/domain/activity-taxonomy.d.ts.map +1 -1
- package/daemon/dist/domain/activity-taxonomy.js.map +1 -1
- package/daemon/dist/domain/agent-activity-store.d.ts +17 -0
- package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
- package/daemon/dist/domain/agent-activity-store.js +101 -45
- package/daemon/dist/domain/agent-activity-store.js.map +1 -1
- package/daemon/dist/domain/agent-manifest.d.ts.map +1 -1
- package/daemon/dist/domain/agent-manifest.js +6 -0
- package/daemon/dist/domain/agent-manifest.js.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +30 -2
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +53 -12
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/compaction-restore-notice.d.ts +12 -1
- package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
- package/daemon/dist/domain/compaction-restore-notice.js +130 -2
- package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
- package/daemon/dist/domain/continuity-policy-materializer.d.ts.map +1 -1
- package/daemon/dist/domain/continuity-policy-materializer.js +11 -3
- package/daemon/dist/domain/continuity-policy-materializer.js.map +1 -1
- package/daemon/dist/domain/core-app-job.d.ts +4 -4
- package/daemon/dist/domain/core-app-job.d.ts.map +1 -1
- package/daemon/dist/domain/core-app-job.js +4 -59
- package/daemon/dist/domain/core-app-job.js.map +1 -1
- package/daemon/dist/domain/current-work.d.ts +12 -0
- package/daemon/dist/domain/current-work.d.ts.map +1 -1
- package/daemon/dist/domain/current-work.js +4 -0
- package/daemon/dist/domain/current-work.js.map +1 -1
- package/daemon/dist/domain/escalation-owner.d.ts +3 -0
- package/daemon/dist/domain/escalation-owner.d.ts.map +1 -1
- package/daemon/dist/domain/escalation-owner.js +9 -3
- package/daemon/dist/domain/escalation-owner.js.map +1 -1
- package/daemon/dist/domain/execution-candidate-reader.d.ts +3 -0
- package/daemon/dist/domain/execution-candidate-reader.d.ts.map +1 -1
- package/daemon/dist/domain/execution-candidate-reader.js +8 -2
- package/daemon/dist/domain/execution-candidate-reader.js.map +1 -1
- package/daemon/dist/domain/existing-rig-restore.d.ts +2 -0
- package/daemon/dist/domain/existing-rig-restore.d.ts.map +1 -1
- package/daemon/dist/domain/existing-rig-restore.js +11 -1
- package/daemon/dist/domain/existing-rig-restore.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.js +49 -8
- package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +1 -4
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +17 -5
- package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts +7 -1
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.js +1 -0
- package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/settled-asks.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/settled-asks.js +15 -2
- package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +0 -17
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.js +10 -40
- package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
- package/daemon/dist/domain/harness-not-started-notice.d.ts +5 -2
- package/daemon/dist/domain/harness-not-started-notice.d.ts.map +1 -1
- package/daemon/dist/domain/harness-not-started-notice.js +46 -15
- package/daemon/dist/domain/harness-not-started-notice.js.map +1 -1
- package/daemon/dist/domain/hosts/read-through.d.ts +1 -1
- package/daemon/dist/domain/hosts/read-through.d.ts.map +1 -1
- package/daemon/dist/domain/hosts/read-through.js +3 -2
- package/daemon/dist/domain/hosts/read-through.js.map +1 -1
- package/daemon/dist/domain/hot-potato-enforcer.d.ts +3 -3
- package/daemon/dist/domain/hot-potato-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/hot-potato-enforcer.js +2 -2
- package/daemon/dist/domain/hot-potato-enforcer.js.map +1 -1
- package/daemon/dist/domain/human-questions.d.ts +1 -1
- package/daemon/dist/domain/human-questions.d.ts.map +1 -1
- package/daemon/dist/domain/human-questions.js +2 -0
- package/daemon/dist/domain/human-questions.js.map +1 -1
- package/daemon/dist/domain/input-read-diagnostic.js +1 -1
- package/daemon/dist/domain/input-read-diagnostic.js.map +1 -1
- package/daemon/dist/domain/keep-alive-supervisor.d.ts +178 -0
- package/daemon/dist/domain/keep-alive-supervisor.d.ts.map +1 -0
- package/daemon/dist/domain/keep-alive-supervisor.js +523 -0
- package/daemon/dist/domain/keep-alive-supervisor.js.map +1 -0
- package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.d.ts +6 -0
- package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.js +38 -9
- package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.js.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js +29 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
- package/daemon/dist/domain/mutation-trace.d.ts +28 -0
- package/daemon/dist/domain/mutation-trace.d.ts.map +1 -0
- package/daemon/dist/domain/mutation-trace.js +38 -0
- package/daemon/dist/domain/mutation-trace.js.map +1 -0
- package/daemon/dist/domain/native-resume-probe.d.ts +13 -3
- package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
- package/daemon/dist/domain/native-resume-probe.js +54 -17
- package/daemon/dist/domain/native-resume-probe.js.map +1 -1
- package/daemon/dist/domain/network/hub-client.d.ts +30 -1
- package/daemon/dist/domain/network/hub-client.d.ts.map +1 -1
- package/daemon/dist/domain/network/hub-client.js +62 -9
- package/daemon/dist/domain/network/hub-client.js.map +1 -1
- package/daemon/dist/domain/network/network-bindings.d.ts +52 -2
- package/daemon/dist/domain/network/network-bindings.d.ts.map +1 -1
- package/daemon/dist/domain/network/network-bindings.js +217 -23
- package/daemon/dist/domain/network/network-bindings.js.map +1 -1
- package/daemon/dist/domain/network/network-connector.d.ts +9 -1
- package/daemon/dist/domain/network/network-connector.d.ts.map +1 -1
- package/daemon/dist/domain/network/network-connector.js +95 -7
- package/daemon/dist/domain/network/network-connector.js.map +1 -1
- package/daemon/dist/domain/network/network-installations.d.ts.map +1 -1
- package/daemon/dist/domain/network/network-installations.js +22 -7
- package/daemon/dist/domain/network/network-installations.js.map +1 -1
- package/daemon/dist/domain/network/network-provider-removal.d.ts +9 -0
- package/daemon/dist/domain/network/network-provider-removal.d.ts.map +1 -0
- package/daemon/dist/domain/network/network-provider-removal.js +75 -0
- package/daemon/dist/domain/network/network-provider-removal.js.map +1 -0
- package/daemon/dist/domain/network/network-requests.d.ts +59 -0
- package/daemon/dist/domain/network/network-requests.d.ts.map +1 -0
- package/daemon/dist/domain/network/network-requests.js +476 -0
- package/daemon/dist/domain/network/network-requests.js.map +1 -0
- package/daemon/dist/domain/node-inventory.d.ts +26 -0
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +87 -7
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/occupant-invalidator.d.ts +1 -1
- package/daemon/dist/domain/occupant-invalidator.d.ts.map +1 -1
- package/daemon/dist/domain/occupant-invalidator.js +1 -1
- package/daemon/dist/domain/occupant-invalidator.js.map +1 -1
- package/daemon/dist/domain/outbox-handler.d.ts +11 -0
- package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
- package/daemon/dist/domain/outbox-handler.js +20 -0
- package/daemon/dist/domain/outbox-handler.js.map +1 -1
- package/daemon/dist/domain/parked-query.d.ts +6 -0
- package/daemon/dist/domain/parked-query.d.ts.map +1 -1
- package/daemon/dist/domain/parked-query.js +14 -4
- package/daemon/dist/domain/parked-query.js.map +1 -1
- package/daemon/dist/domain/policies/seat-pool.d.ts +13 -0
- package/daemon/dist/domain/policies/seat-pool.d.ts.map +1 -1
- package/daemon/dist/domain/policies/seat-pool.js +18 -3
- package/daemon/dist/domain/policies/seat-pool.js.map +1 -1
- package/daemon/dist/domain/profile-resolver.d.ts +7 -1
- package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
- package/daemon/dist/domain/profile-resolver.js +7 -0
- package/daemon/dist/domain/profile-resolver.js.map +1 -1
- package/daemon/dist/domain/progress/progress-indexer.d.ts.map +1 -1
- package/daemon/dist/domain/progress/progress-indexer.js +11 -0
- package/daemon/dist/domain/progress/progress-indexer.js.map +1 -1
- package/daemon/dist/domain/project-lifecycle-compiler.d.ts.map +1 -1
- package/daemon/dist/domain/project-lifecycle-compiler.js +4 -1
- package/daemon/dist/domain/project-lifecycle-compiler.js.map +1 -1
- package/daemon/dist/domain/proof/judgments.d.ts +3 -0
- package/daemon/dist/domain/proof/judgments.d.ts.map +1 -1
- package/daemon/dist/domain/proof/judgments.js +13 -3
- package/daemon/dist/domain/proof/judgments.js.map +1 -1
- package/daemon/dist/domain/proof/source-watch.js +4 -4
- package/daemon/dist/domain/proof/source-watch.js.map +1 -1
- package/daemon/dist/domain/provider/claude-interruption.d.ts +6 -0
- package/daemon/dist/domain/provider/claude-interruption.d.ts.map +1 -1
- package/daemon/dist/domain/provider/claude-interruption.js +18 -0
- package/daemon/dist/domain/provider/claude-interruption.js.map +1 -1
- package/daemon/dist/domain/ps-projection.d.ts +8 -1
- package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
- package/daemon/dist/domain/ps-projection.js +11 -3
- package/daemon/dist/domain/ps-projection.js.map +1 -1
- package/daemon/dist/domain/queue-erasure.d.ts +3 -0
- package/daemon/dist/domain/queue-erasure.d.ts.map +1 -1
- package/daemon/dist/domain/queue-erasure.js +2 -2
- package/daemon/dist/domain/queue-erasure.js.map +1 -1
- package/daemon/dist/domain/queue-owner.d.ts +5 -0
- package/daemon/dist/domain/queue-owner.d.ts.map +1 -1
- package/daemon/dist/domain/queue-owner.js +16 -8
- package/daemon/dist/domain/queue-owner.js.map +1 -1
- package/daemon/dist/domain/queue-recorded-graph.d.ts +32 -0
- package/daemon/dist/domain/queue-recorded-graph.d.ts.map +1 -0
- package/daemon/dist/domain/queue-recorded-graph.js +84 -0
- package/daemon/dist/domain/queue-recorded-graph.js.map +1 -0
- package/daemon/dist/domain/queue-repository.d.ts +74 -4
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +398 -25
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-retention.d.ts +1 -1
- package/daemon/dist/domain/queue-retention.d.ts.map +1 -1
- package/daemon/dist/domain/queue-retention.js +4 -0
- package/daemon/dist/domain/queue-retention.js.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +43 -9
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/queue-transfer-export.d.ts +75 -0
- package/daemon/dist/domain/queue-transfer-export.d.ts.map +1 -0
- package/daemon/dist/domain/queue-transfer-export.js +156 -0
- package/daemon/dist/domain/queue-transfer-export.js.map +1 -0
- package/daemon/dist/domain/queue-transfer-format.d.ts +15 -0
- package/daemon/dist/domain/queue-transfer-format.d.ts.map +1 -0
- package/daemon/dist/domain/queue-transfer-format.js +32 -0
- package/daemon/dist/domain/queue-transfer-format.js.map +1 -0
- package/daemon/dist/domain/queue-transfer-parse.d.ts +40 -0
- package/daemon/dist/domain/queue-transfer-parse.d.ts.map +1 -0
- package/daemon/dist/domain/queue-transfer-parse.js +131 -0
- package/daemon/dist/domain/queue-transfer-parse.js.map +1 -0
- package/daemon/dist/domain/queue-transfer-review.d.ts +22 -0
- package/daemon/dist/domain/queue-transfer-review.d.ts.map +1 -0
- package/daemon/dist/domain/queue-transfer-review.js +81 -0
- package/daemon/dist/domain/queue-transfer-review.js.map +1 -0
- package/daemon/dist/domain/queue-transfer-staging.d.ts +79 -0
- package/daemon/dist/domain/queue-transfer-staging.d.ts.map +1 -0
- package/daemon/dist/domain/queue-transfer-staging.js +67 -0
- package/daemon/dist/domain/queue-transfer-staging.js.map +1 -0
- package/daemon/dist/domain/queue-wake-ladder.d.ts +4 -0
- package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +161 -20
- package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
- package/daemon/dist/domain/reconciler.d.ts +27 -2
- package/daemon/dist/domain/reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/reconciler.js +184 -16
- package/daemon/dist/domain/reconciler.js.map +1 -1
- package/daemon/dist/domain/refusal-trace.d.ts +15 -0
- package/daemon/dist/domain/refusal-trace.d.ts.map +1 -0
- package/daemon/dist/domain/refusal-trace.js +23 -0
- package/daemon/dist/domain/refusal-trace.js.map +1 -0
- package/daemon/dist/domain/relayed-answers.d.ts +80 -0
- package/daemon/dist/domain/relayed-answers.d.ts.map +1 -0
- package/daemon/dist/domain/relayed-answers.js +8 -0
- package/daemon/dist/domain/relayed-answers.js.map +1 -0
- package/daemon/dist/domain/remote-control-observations.d.ts +50 -0
- package/daemon/dist/domain/remote-control-observations.d.ts.map +1 -0
- package/daemon/dist/domain/remote-control-observations.js +72 -0
- package/daemon/dist/domain/remote-control-observations.js.map +1 -0
- package/daemon/dist/domain/restore-attempt-receipt.d.ts.map +1 -1
- package/daemon/dist/domain/restore-attempt-receipt.js +8 -2
- package/daemon/dist/domain/restore-attempt-receipt.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +67 -6
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +345 -51
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/rig-lifecycle-service.js +4 -1
- package/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/rig-repository.d.ts +21 -3
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +67 -2
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rig-teardown.d.ts +22 -7
- package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
- package/daemon/dist/domain/rig-teardown.js +108 -24
- package/daemon/dist/domain/rig-teardown.js.map +1 -1
- package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-codec.js +12 -0
- package/daemon/dist/domain/rigspec-codec.js.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.d.ts +14 -0
- package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.js +56 -14
- package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts +32 -3
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +121 -23
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-schema.js +30 -4
- package/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/daemon/dist/domain/rosters.d.ts +1 -0
- package/daemon/dist/domain/rosters.d.ts.map +1 -1
- package/daemon/dist/domain/rosters.js +5 -4
- package/daemon/dist/domain/rosters.js.map +1 -1
- package/daemon/dist/domain/seat-activity-service.d.ts +4 -0
- package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-activity-service.js +24 -5
- package/daemon/dist/domain/seat-activity-service.js.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.d.ts +7 -0
- package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.js +149 -65
- package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-cold-start.d.ts +150 -0
- package/daemon/dist/domain/seat-cold-start.d.ts.map +1 -0
- package/daemon/dist/domain/seat-cold-start.js +371 -0
- package/daemon/dist/domain/seat-cold-start.js.map +1 -0
- package/daemon/dist/domain/seat-delivery-guard.d.ts +11 -2
- package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.js +34 -6
- package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.d.ts +13 -0
- package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.js +63 -23
- package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-identity-store.d.ts +5 -3
- package/daemon/dist/domain/seat-identity-store.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-store.js +7 -3
- package/daemon/dist/domain/seat-identity-store.js.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.d.ts +2 -0
- package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.js +9 -1
- package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +17 -0
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +176 -22
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-pool-executor.d.ts +116 -0
- package/daemon/dist/domain/seat-pool-executor.d.ts.map +1 -0
- package/daemon/dist/domain/seat-pool-executor.js +565 -0
- package/daemon/dist/domain/seat-pool-executor.js.map +1 -0
- package/daemon/dist/domain/seat-pool-registration.d.ts +93 -0
- package/daemon/dist/domain/seat-pool-registration.d.ts.map +1 -0
- package/daemon/dist/domain/seat-pool-registration.js +149 -0
- package/daemon/dist/domain/seat-pool-registration.js.map +1 -0
- package/daemon/dist/domain/seat-pool-slots.d.ts +42 -0
- package/daemon/dist/domain/seat-pool-slots.d.ts.map +1 -1
- package/daemon/dist/domain/seat-pool-slots.js +51 -0
- package/daemon/dist/domain/seat-pool-slots.js.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.d.ts +15 -0
- package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.js +54 -2
- package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
- package/daemon/dist/domain/seat-runtime-home-record.d.ts +8 -0
- package/daemon/dist/domain/seat-runtime-home-record.d.ts.map +1 -1
- package/daemon/dist/domain/seat-runtime-home-record.js +1 -1
- package/daemon/dist/domain/seat-runtime-home-record.js.map +1 -1
- package/daemon/dist/domain/session-registry.d.ts +22 -3
- package/daemon/dist/domain/session-registry.d.ts.map +1 -1
- package/daemon/dist/domain/session-registry.js +38 -6
- package/daemon/dist/domain/session-registry.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +18 -2
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +65 -38
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/slices/slice-indexer.d.ts +55 -0
- package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -1
- package/daemon/dist/domain/slices/slice-indexer.js +259 -50
- package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.d.ts +1 -1
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +75 -23
- package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/daemon/dist/domain/startup-proof.d.ts +6 -0
- package/daemon/dist/domain/startup-proof.d.ts.map +1 -1
- package/daemon/dist/domain/startup-proof.js +11 -0
- package/daemon/dist/domain/startup-proof.js.map +1 -1
- package/daemon/dist/domain/startup-submission-evidence.d.ts +2 -0
- package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
- package/daemon/dist/domain/startup-submission-evidence.js +31 -3
- package/daemon/dist/domain/startup-submission-evidence.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts +2 -0
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.js +2 -0
- package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
- package/daemon/dist/domain/terminal/scope-task-terminal-view.d.ts +2 -1
- package/daemon/dist/domain/terminal/scope-task-terminal-view.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/scope-task-terminal-view.js +80 -38
- package/daemon/dist/domain/terminal/scope-task-terminal-view.js.map +1 -1
- package/daemon/dist/domain/terminal/terminal-provider.d.ts +2 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.d.ts +3 -0
- package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.js +30 -26
- package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
- package/daemon/dist/domain/terminal/tile-attach.d.ts +22 -0
- package/daemon/dist/domain/terminal/tile-attach.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/tile-attach.js +71 -0
- package/daemon/dist/domain/terminal/tile-attach.js.map +1 -1
- package/daemon/dist/domain/terminal/view-composer.d.ts +2 -0
- package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/view-composer.js +4 -2
- package/daemon/dist/domain/terminal/view-composer.js.map +1 -1
- package/daemon/dist/domain/topology-trace.d.ts +40 -0
- package/daemon/dist/domain/topology-trace.d.ts.map +1 -0
- package/daemon/dist/domain/topology-trace.js +106 -0
- package/daemon/dist/domain/topology-trace.js.map +1 -0
- package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
- package/daemon/dist/domain/transcript-store.js +12 -1
- package/daemon/dist/domain/transcript-store.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +104 -8
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js +3 -2
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-browser.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-browser.js +2 -0
- package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.js +13 -0
- package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts +5 -3
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.js +6 -1
- package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts +8 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +6 -2
- package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
- package/daemon/dist/domain/workflow-instance-store.d.ts +2 -0
- package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-instance-store.js +11 -2
- package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
- package/daemon/dist/domain/workflow-projector.d.ts +3 -1
- package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +58 -10
- package/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-run-title.d.ts +4 -0
- package/daemon/dist/domain/workflow-run-title.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-run-title.js +5 -0
- package/daemon/dist/domain/workflow-run-title.js.map +1 -0
- package/daemon/dist/domain/workflow-runtime.d.ts +1 -0
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +3 -1
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/domain/workflow-spec-cache.d.ts +2 -2
- package/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-spec-cache.js +20 -1
- package/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
- package/daemon/dist/domain/workflow-types.d.ts +15 -0
- package/daemon/dist/domain/workflow-types.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-types.js +4 -0
- package/daemon/dist/domain/workflow-types.js.map +1 -1
- package/daemon/dist/domain/workspace/project-read.d.ts +10 -0
- package/daemon/dist/domain/workspace/project-read.d.ts.map +1 -1
- package/daemon/dist/domain/workspace/project-read.js +34 -2
- package/daemon/dist/domain/workspace/project-read.js.map +1 -1
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +7 -1
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/queue-transfer-export-surface.d.ts +33 -0
- package/daemon/dist/queue-transfer-export-surface.d.ts.map +1 -0
- package/daemon/dist/queue-transfer-export-surface.js +13 -0
- package/daemon/dist/queue-transfer-export-surface.js.map +1 -0
- package/daemon/dist/queue-transfer-staging-surface.d.ts +86 -0
- package/daemon/dist/queue-transfer-staging-surface.d.ts.map +1 -0
- package/daemon/dist/queue-transfer-staging-surface.js +91 -0
- package/daemon/dist/queue-transfer-staging-surface.js.map +1 -0
- package/daemon/dist/routes/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +46 -0
- package/daemon/dist/routes/activity.js.map +1 -1
- package/daemon/dist/routes/compaction.d.ts.map +1 -1
- package/daemon/dist/routes/compaction.js +7 -2
- package/daemon/dist/routes/compaction.js.map +1 -1
- package/daemon/dist/routes/context-packs.d.ts.map +1 -1
- package/daemon/dist/routes/context-packs.js +23 -1
- package/daemon/dist/routes/context-packs.js.map +1 -1
- package/daemon/dist/routes/events.js +7 -4
- package/daemon/dist/routes/events.js.map +1 -1
- package/daemon/dist/routes/network.d.ts +2 -0
- package/daemon/dist/routes/network.d.ts.map +1 -1
- package/daemon/dist/routes/network.js +62 -1
- package/daemon/dist/routes/network.js.map +1 -1
- package/daemon/dist/routes/ps.js +12 -1
- package/daemon/dist/routes/ps.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +155 -52
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/require-sender-identity.d.ts.map +1 -1
- package/daemon/dist/routes/require-sender-identity.js +6 -3
- package/daemon/dist/routes/require-sender-identity.js.map +1 -1
- package/daemon/dist/routes/rigs.js +2 -0
- package/daemon/dist/routes/rigs.js.map +1 -1
- package/daemon/dist/routes/seat.d.ts.map +1 -1
- package/daemon/dist/routes/seat.js +12 -5
- package/daemon/dist/routes/seat.js.map +1 -1
- package/daemon/dist/routes/sessions.d.ts.map +1 -1
- package/daemon/dist/routes/sessions.js +14 -0
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/slices.d.ts.map +1 -1
- package/daemon/dist/routes/slices.js +16 -7
- package/daemon/dist/routes/slices.js.map +1 -1
- package/daemon/dist/routes/startup.d.ts.map +1 -1
- package/daemon/dist/routes/startup.js +49 -4
- package/daemon/dist/routes/startup.js.map +1 -1
- package/daemon/dist/routes/terminal-ws.js +28 -2
- package/daemon/dist/routes/terminal-ws.js.map +1 -1
- package/daemon/dist/routes/terminal.d.ts.map +1 -1
- package/daemon/dist/routes/terminal.js +3 -2
- package/daemon/dist/routes/terminal.js.map +1 -1
- package/daemon/dist/routes/transport.d.ts.map +1 -1
- package/daemon/dist/routes/transport.js +14 -2
- package/daemon/dist/routes/transport.js.map +1 -1
- package/daemon/dist/routes/up.js +2 -0
- package/daemon/dist/routes/up.js.map +1 -1
- package/daemon/dist/routes/workflow.d.ts.map +1 -1
- package/daemon/dist/routes/workflow.js +9 -3
- package/daemon/dist/routes/workflow.js.map +1 -1
- package/daemon/dist/server.d.ts +7 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +8 -0
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts +3 -0
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +133 -7
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/dist/terminal/TerminalSessionBroker.d.ts +10 -0
- package/daemon/dist/terminal/TerminalSessionBroker.d.ts.map +1 -1
- package/daemon/dist/terminal/TerminalSessionBroker.js +63 -4
- package/daemon/dist/terminal/TerminalSessionBroker.js.map +1 -1
- package/daemon/dist/topology-trace-surface.d.ts +2 -0
- package/daemon/dist/topology-trace-surface.d.ts.map +1 -0
- package/daemon/dist/topology-trace-surface.js +2 -0
- package/daemon/dist/topology-trace-surface.js.map +1 -0
- package/daemon/docs/reference/acp-agents.md +2 -1
- package/daemon/docs/reference/agent-spec.md +3 -1
- package/daemon/docs/reference/agent-startup-guide.md +3 -1
- package/daemon/docs/reference/agent-state-taxonomy.md +35 -1
- package/daemon/docs/reference/checked-seat-stop.md +11 -1
- package/daemon/docs/reference/claude-status-line.md +7 -0
- package/daemon/docs/reference/daemon-http-clients.md +120 -18
- package/daemon/docs/reference/gateway-participants.md +6 -0
- package/daemon/docs/reference/getting-started.md +119 -12
- package/daemon/docs/reference/hosted-members.md +114 -0
- package/daemon/docs/reference/inventory-request-diagnostics.md +22 -0
- package/daemon/docs/reference/network-connector.md +112 -4
- package/daemon/docs/reference/project-workspace.md +11 -2
- package/daemon/docs/reference/queue-erasure.md +1 -1
- package/daemon/docs/reference/queue-transfer-export.md +38 -0
- package/daemon/docs/reference/queue-transfer-staging.md +39 -0
- package/daemon/docs/reference/quickstart.md +4 -4
- package/daemon/docs/reference/refocus-channel.md +5 -2
- package/daemon/docs/reference/rig-spec.md +193 -3
- package/daemon/docs/reference/rosters.md +18 -3
- package/daemon/docs/reference/sdlc-conventions.md +1 -1
- package/daemon/docs/reference/seat-delivery.md +21 -4
- package/daemon/docs/reference/seat-pools.md +116 -0
- package/daemon/docs/reference/terminal-sessions.md +57 -11
- package/daemon/docs/reference/tmux-servers.md +27 -2
- package/daemon/docs/reference/whats-new.md +92 -12
- package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +1 -1
- package/dist/build-info.js +3 -3
- package/dist/client.d.ts +2 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/commands/broadcast.d.ts.map +1 -1
- package/dist/commands/broadcast.js +87 -8
- package/dist/commands/broadcast.js.map +1 -1
- package/dist/commands/chatroom.d.ts +3 -0
- package/dist/commands/chatroom.d.ts.map +1 -1
- package/dist/commands/chatroom.js +7 -1
- package/dist/commands/chatroom.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +2 -1
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +18 -15
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/exec.d.ts.map +1 -1
- package/dist/commands/exec.js +22 -13
- package/dist/commands/exec.js.map +1 -1
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +5 -1
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/gateway.d.ts +4 -0
- package/dist/commands/gateway.d.ts.map +1 -1
- package/dist/commands/gateway.js +37 -0
- package/dist/commands/gateway.js.map +1 -1
- package/dist/commands/network.d.ts.map +1 -1
- package/dist/commands/network.js +54 -1
- package/dist/commands/network.js.map +1 -1
- package/dist/commands/parked.d.ts.map +1 -1
- package/dist/commands/parked.js +12 -6
- package/dist/commands/parked.js.map +1 -1
- package/dist/commands/provider.d.ts.map +1 -1
- package/dist/commands/provider.js +3 -2
- package/dist/commands/provider.js.map +1 -1
- package/dist/commands/ps.d.ts +12 -1
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +43 -10
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue-export.d.ts +3 -0
- package/dist/commands/queue-export.d.ts.map +1 -0
- package/dist/commands/queue-export.js +67 -0
- package/dist/commands/queue-export.js.map +1 -0
- package/dist/commands/queue-import.d.ts +4 -0
- package/dist/commands/queue-import.d.ts.map +1 -0
- package/dist/commands/queue-import.js +47 -0
- package/dist/commands/queue-import.js.map +1 -0
- package/dist/commands/queue.d.ts +1 -1
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +50 -1
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/roster.js +1 -1
- package/dist/commands/roster.js.map +1 -1
- package/dist/commands/scope.d.ts.map +1 -1
- package/dist/commands/scope.js +30 -18
- package/dist/commands/scope.js.map +1 -1
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +20 -2
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +15 -3
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/start.d.ts +14 -0
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +54 -5
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +4 -0
- package/dist/commands/workflow.js.map +1 -1
- package/dist/config-store.d.ts +2 -1
- package/dist/config-store.d.ts.map +1 -1
- package/dist/config-store.js +14 -1
- package/dist/config-store.js.map +1 -1
- package/dist/cross-host-executor.d.ts +3 -0
- package/dist/cross-host-executor.d.ts.map +1 -1
- package/dist/cross-host-executor.js +5 -0
- package/dist/cross-host-executor.js.map +1 -1
- package/dist/daemon-auto-start.d.ts.map +1 -1
- package/dist/daemon-auto-start.js +1 -0
- package/dist/daemon-auto-start.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts +6 -1
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +90 -30
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/daemon-start-lock.d.ts +38 -3
- package/dist/daemon-start-lock.d.ts.map +1 -1
- package/dist/daemon-start-lock.js +201 -48
- package/dist/daemon-start-lock.js.map +1 -1
- package/dist/lib/scope/progress-edit.d.ts.map +1 -1
- package/dist/lib/scope/progress-edit.js +10 -0
- package/dist/lib/scope/progress-edit.js.map +1 -1
- package/dist/lib/topology-trace.d.ts +3 -34
- package/dist/lib/topology-trace.d.ts.map +1 -1
- package/dist/lib/topology-trace.js +3 -97
- package/dist/lib/topology-trace.js.map +1 -1
- package/dist/local-db.d.ts +2 -0
- package/dist/local-db.d.ts.map +1 -1
- package/dist/local-db.js +14 -11
- package/dist/local-db.js.map +1 -1
- package/dist/mcp-caller-resolver.d.ts +36 -0
- package/dist/mcp-caller-resolver.d.ts.map +1 -0
- package/dist/mcp-caller-resolver.js +82 -0
- package/dist/mcp-caller-resolver.js.map +1 -0
- package/dist/mcp-http.d.ts +43 -2
- package/dist/mcp-http.d.ts.map +1 -1
- package/dist/mcp-http.js +223 -46
- package/dist/mcp-http.js.map +1 -1
- package/dist/mcp-server.d.ts +23 -0
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +108 -39
- package/dist/mcp-server.js.map +1 -1
- package/dist/mcp-surface.d.ts +3 -2
- package/dist/mcp-surface.d.ts.map +1 -1
- package/dist/node-support.d.ts.map +1 -1
- package/dist/node-support.js +10 -0
- package/dist/node-support.js.map +1 -1
- package/dist/remote-host-ops.d.ts +3 -0
- package/dist/remote-host-ops.d.ts.map +1 -1
- package/dist/remote-host-ops.js +15 -1
- package/dist/remote-host-ops.js.map +1 -1
- package/package.json +3 -3
- package/scripts/check-abi.mjs +15 -0
- package/tui/dist/attention/attention-model.d.ts.map +1 -1
- package/tui/dist/attention/attention-model.js +8 -4
- package/tui/dist/attention/attention-model.js.map +1 -1
- package/tui/dist/crash-cart/start-daemon.d.ts +20 -0
- package/tui/dist/crash-cart/start-daemon.d.ts.map +1 -1
- package/tui/dist/crash-cart/start-daemon.js +56 -0
- package/tui/dist/crash-cart/start-daemon.js.map +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +4 -2
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/main.js +24 -8
- package/tui/dist/main.js.map +1 -1
- package/tui/dist/render.d.ts +2 -0
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +41 -9
- package/tui/dist/render.js.map +1 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type Database from "better-sqlite3";
|
|
2
|
+
import type { PolicyJob } from "./policies/types.js";
|
|
3
|
+
import type { RigRepository } from "./rig-repository.js";
|
|
4
|
+
import { type SeatPoolSpec } from "./seat-pool-spec.js";
|
|
5
|
+
import { type EnsureAutoRegistrationInput, type WatchdogJob, type WatchdogJobsRepository } from "./watchdog-jobs-repository.js";
|
|
6
|
+
/** Who registers the job. */
|
|
7
|
+
export declare const SEAT_POOL_REGISTRAR = "daemon@kernel";
|
|
8
|
+
/** How often the job is evaluated once armed, in seconds. */
|
|
9
|
+
export declare const SEAT_POOL_INTERVAL_SECONDS = 60;
|
|
10
|
+
export interface SeatPoolRegistrationDeps {
|
|
11
|
+
db: Database.Database;
|
|
12
|
+
rigRepo: Pick<RigRepository, "getNodePool">;
|
|
13
|
+
jobsRepo: WatchdogJobsRepository;
|
|
14
|
+
/** Where the start loop reports a node it could not ensure; console.warn by default. */
|
|
15
|
+
warn?: (message: string) => void;
|
|
16
|
+
}
|
|
17
|
+
/** The model member a job is for: its node, its canonical session and that session's aliases. */
|
|
18
|
+
export interface SeatPoolModel {
|
|
19
|
+
nodeId: string;
|
|
20
|
+
rigName: string;
|
|
21
|
+
sessionName: string;
|
|
22
|
+
aliases: string[];
|
|
23
|
+
}
|
|
24
|
+
export type SeatPoolEnsureResult = {
|
|
25
|
+
outcome: "active";
|
|
26
|
+
job: WatchdogJob;
|
|
27
|
+
} | {
|
|
28
|
+
outcome: "stopped";
|
|
29
|
+
job: WatchdogJob;
|
|
30
|
+
} | {
|
|
31
|
+
outcome: "registered";
|
|
32
|
+
job: WatchdogJob;
|
|
33
|
+
replaced: "none" | "terminal";
|
|
34
|
+
} | {
|
|
35
|
+
outcome: "ambiguous";
|
|
36
|
+
code: "auto_registration_ambiguous" | "auto_registration_state_invalid";
|
|
37
|
+
message: string;
|
|
38
|
+
details?: Record<string, unknown>;
|
|
39
|
+
};
|
|
40
|
+
export type SeatPoolReconcileResult = ({
|
|
41
|
+
nodeId: string;
|
|
42
|
+
} & SeatPoolEnsureResult) | {
|
|
43
|
+
nodeId: string;
|
|
44
|
+
outcome: "no_block";
|
|
45
|
+
} | {
|
|
46
|
+
nodeId: string;
|
|
47
|
+
outcome: "unusable";
|
|
48
|
+
error: string;
|
|
49
|
+
} | {
|
|
50
|
+
nodeId: string;
|
|
51
|
+
outcome: "no_model_session";
|
|
52
|
+
} | {
|
|
53
|
+
nodeId: string;
|
|
54
|
+
outcome: "failed";
|
|
55
|
+
message: string;
|
|
56
|
+
};
|
|
57
|
+
/** The model member's canonical session and aliases, or null when the node is gone or has no pod-aware name. */
|
|
58
|
+
export declare function resolveSeatPoolModel(db: Database.Database, nodeId: string): SeatPoolModel | null;
|
|
59
|
+
/** The model a job acts for, or why it has none. */
|
|
60
|
+
export type SeatPoolJobModel = {
|
|
61
|
+
found: true;
|
|
62
|
+
modelNodeId: string;
|
|
63
|
+
rigId: string;
|
|
64
|
+
model: SeatPoolModel;
|
|
65
|
+
}
|
|
66
|
+
/** The job's spec names no model node; `modelNodeId` is the spec's value as written (null when absent). */
|
|
67
|
+
| {
|
|
68
|
+
found: false;
|
|
69
|
+
modelNodeId: unknown;
|
|
70
|
+
cause: "no_model_node_id";
|
|
71
|
+
} | {
|
|
72
|
+
found: false;
|
|
73
|
+
modelNodeId: string;
|
|
74
|
+
cause: "node_gone" | "no_canonical_session";
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* The model a seat-pool job acts for: the node named by its spec's `context.model_node_id`, resolved the way the
|
|
78
|
+
* ensure resolves it (resolveSeatPoolModel). The executor finds the model only through this, never by reading the spec
|
|
79
|
+
* or the job's target itself.
|
|
80
|
+
*/
|
|
81
|
+
export declare function seatPoolModelOfJob(db: Database.Database, job: Pick<PolicyJob, "context">): SeatPoolJobModel;
|
|
82
|
+
/** The ensure input for a model's job: its identity, cadence and spec. */
|
|
83
|
+
export declare function seatPoolJobInput(model: SeatPoolModel, spec: SeatPoolSpec): EnsureAutoRegistrationInput;
|
|
84
|
+
/** Ensure one job for a model with a usable block. Throws only what is not an ambiguous or invalid job state. */
|
|
85
|
+
export declare function ensureSeatPoolJob(deps: Pick<SeatPoolRegistrationDeps, "jobsRepo">, model: SeatPoolModel, spec: SeatPoolSpec): SeatPoolEnsureResult;
|
|
86
|
+
/** Reconcile one model node to its stored block. A node with no block, or a block that can't be read, is left alone. */
|
|
87
|
+
export declare function reconcileSeatPoolNode(deps: SeatPoolRegistrationDeps, nodeId: string): SeatPoolReconcileResult;
|
|
88
|
+
/**
|
|
89
|
+
* The daemon-start loop: every node with a stored block, one at a time, each in its own try/catch, so one node that
|
|
90
|
+
* throws never stops the others. A failure and an ambiguous job state are warned with the node and the reason.
|
|
91
|
+
*/
|
|
92
|
+
export declare function reconcileSeatPoolsAtStartup(deps: SeatPoolRegistrationDeps): SeatPoolReconcileResult[];
|
|
93
|
+
//# sourceMappingURL=seat-pool-registration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-pool-registration.d.ts","sourceRoot":"","sources":["../../src/domain/seat-pool-registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAG3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EAEL,KAAK,2BAA2B,EAChC,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC5B,MAAM,+BAA+B,CAAC;AAqBvC,6BAA6B;AAC7B,eA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,IAAI,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,GAAG,uBAAuB,CAO7G;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,wBAAwB,GAAG,uBAAuB,EAAE,CA4BrG"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { stringify as stringifyYaml } from "yaml";
|
|
2
|
+
import { SEAT_POOL_POLICY_NAME } from "./policies/seat-pool.js";
|
|
3
|
+
import { deriveCanonicalSessionName, parseSessionName, validateSessionName } from "./session-name.js";
|
|
4
|
+
import { serializePoolBlock } from "./seat-pool-spec.js";
|
|
5
|
+
import { formatWatchdogRegistrationError } from "./watchdog-auto-registration.js";
|
|
6
|
+
import { WatchdogJobsError, } from "./watchdog-jobs-repository.js";
|
|
7
|
+
// #3395 (Piece 1): registering the `seat-pool` watchdog job, one per model member that has a `pool` block.
|
|
8
|
+
//
|
|
9
|
+
// Only the seat-pool executor calls this module, through `seatPoolModelOfJob`; nothing calls the ensure yet: the job
|
|
10
|
+
// stays unarmed until the activation change, which calls the ensure on launch and re-apply and the start loop at daemon
|
|
11
|
+
// start, and hands the policy to the watchdog engine.
|
|
12
|
+
//
|
|
13
|
+
// The job's identity is the model's canonical session, with no generation, registered by `daemon@kernel`; the
|
|
14
|
+
// model's other canonical session names in the same rig are passed as aliases, as the idle-gate registration passes
|
|
15
|
+
// them. Its spec carries the model node id, which is how the job (and any replacement) finds the pool's agents, and
|
|
16
|
+
// the pool block it was ensured with.
|
|
17
|
+
//
|
|
18
|
+
// Outcomes of the ensure:
|
|
19
|
+
// - an `active` job is refreshed with the new spec and keeps running;
|
|
20
|
+
// - a `stopped` job gets the new spec and stays stopped (an operator's stop is never undone here);
|
|
21
|
+
// - only a `terminal` job, or no job, means one new job;
|
|
22
|
+
// - an ambiguous or invalid state is reported and no job is picked: nothing is registered or retired.
|
|
23
|
+
// A node with no block never gets a job, and a stored block that can't be read leaves the job as it is.
|
|
24
|
+
// Stopping the job while the pool has agents is allowed: the agents stay plain members.
|
|
25
|
+
/** Who registers the job. */
|
|
26
|
+
export const SEAT_POOL_REGISTRAR = "daemon@kernel";
|
|
27
|
+
/** How often the job is evaluated once armed, in seconds. */
|
|
28
|
+
export const SEAT_POOL_INTERVAL_SECONDS = 60;
|
|
29
|
+
/** The model member's canonical session and aliases, or null when the node is gone or has no pod-aware name. */
|
|
30
|
+
export function resolveSeatPoolModel(db, nodeId) {
|
|
31
|
+
const row = db.prepare(`SELECT n.id AS node_id, n.logical_id AS logical_id, n.pod_id AS pod_id, r.name AS rig_name
|
|
32
|
+
FROM nodes n LEFT JOIN rigs r ON r.id = n.rig_id
|
|
33
|
+
WHERE n.id = ?`).get(nodeId);
|
|
34
|
+
if (!row || row.rig_name === null || row.pod_id === null)
|
|
35
|
+
return null;
|
|
36
|
+
const dot = row.logical_id.indexOf(".");
|
|
37
|
+
if (dot <= 0 || dot === row.logical_id.length - 1)
|
|
38
|
+
return null;
|
|
39
|
+
const sessionName = deriveCanonicalSessionName(row.logical_id.slice(0, dot), row.logical_id.slice(dot + 1), row.rig_name);
|
|
40
|
+
if (!isCanonicalInRig(sessionName, row.rig_name))
|
|
41
|
+
return null;
|
|
42
|
+
const recorded = db.prepare(`SELECT session_name FROM sessions WHERE node_id = ? ORDER BY created_at ASC, id ASC`).all(nodeId);
|
|
43
|
+
const aliases = [...new Set([...recorded.map((r) => r.session_name), sessionName])]
|
|
44
|
+
.filter((candidate) => isCanonicalInRig(candidate, row.rig_name));
|
|
45
|
+
return { nodeId: row.node_id, rigName: row.rig_name, sessionName, aliases };
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The model a seat-pool job acts for: the node named by its spec's `context.model_node_id`, resolved the way the
|
|
49
|
+
* ensure resolves it (resolveSeatPoolModel). The executor finds the model only through this, never by reading the spec
|
|
50
|
+
* or the job's target itself.
|
|
51
|
+
*/
|
|
52
|
+
export function seatPoolModelOfJob(db, job) {
|
|
53
|
+
const id = job.context["model_node_id"];
|
|
54
|
+
if (typeof id !== "string" || id === "")
|
|
55
|
+
return { found: false, modelNodeId: id ?? null, cause: "no_model_node_id" };
|
|
56
|
+
const node = db.prepare("SELECT rig_id FROM nodes WHERE id = ?").get(id);
|
|
57
|
+
if (!node)
|
|
58
|
+
return { found: false, modelNodeId: id, cause: "node_gone" };
|
|
59
|
+
const model = resolveSeatPoolModel(db, id);
|
|
60
|
+
if (!model)
|
|
61
|
+
return { found: false, modelNodeId: id, cause: "no_canonical_session" };
|
|
62
|
+
return { found: true, modelNodeId: id, rigId: node.rig_id, model };
|
|
63
|
+
}
|
|
64
|
+
function isCanonicalInRig(sessionName, rigName) {
|
|
65
|
+
if (!validateSessionName(sessionName))
|
|
66
|
+
return false;
|
|
67
|
+
const parsed = parseSessionName(sessionName);
|
|
68
|
+
return parsed.kind === "canonical" && parsed.rig === rigName;
|
|
69
|
+
}
|
|
70
|
+
/** The ensure input for a model's job: its identity, cadence and spec. */
|
|
71
|
+
export function seatPoolJobInput(model, spec) {
|
|
72
|
+
return {
|
|
73
|
+
policy: SEAT_POOL_POLICY_NAME,
|
|
74
|
+
targetSession: model.sessionName,
|
|
75
|
+
targetGenerationUuid: null,
|
|
76
|
+
registeredBySession: SEAT_POOL_REGISTRAR,
|
|
77
|
+
intervalSeconds: SEAT_POOL_INTERVAL_SECONDS,
|
|
78
|
+
activeWakeIntervalSeconds: null,
|
|
79
|
+
scanIntervalSeconds: null,
|
|
80
|
+
specYaml: stringifyYaml({
|
|
81
|
+
policy: SEAT_POOL_POLICY_NAME,
|
|
82
|
+
target: { session: model.sessionName },
|
|
83
|
+
context: { model_node_id: model.nodeId, pool: serializePoolBlock(spec) },
|
|
84
|
+
}),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/** Ensure one job for a model with a usable block. Throws only what is not an ambiguous or invalid job state. */
|
|
88
|
+
export function ensureSeatPoolJob(deps, model, spec) {
|
|
89
|
+
try {
|
|
90
|
+
const before = deps.jobsRepo.findAutoRegistration(SEAT_POOL_POLICY_NAME, model.sessionName, null, model.aliases);
|
|
91
|
+
const job = deps.jobsRepo.ensureAutoRegistration(seatPoolJobInput(model, spec), model.aliases);
|
|
92
|
+
if (before)
|
|
93
|
+
return { outcome: job.state === "stopped" ? "stopped" : "active", job };
|
|
94
|
+
const ended = model.aliases.some((alias) => deps.jobsRepo.listExactTuple(SEAT_POOL_POLICY_NAME, alias, null).some((row) => row.state === "terminal"));
|
|
95
|
+
return { outcome: "registered", job, replaced: ended ? "terminal" : "none" };
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
if (error instanceof WatchdogJobsError
|
|
99
|
+
&& (error.code === "auto_registration_ambiguous" || error.code === "auto_registration_state_invalid")) {
|
|
100
|
+
return { outcome: "ambiguous", code: error.code, message: error.message, ...(error.details ? { details: error.details } : {}) };
|
|
101
|
+
}
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** Reconcile one model node to its stored block. A node with no block, or a block that can't be read, is left alone. */
|
|
106
|
+
export function reconcileSeatPoolNode(deps, nodeId) {
|
|
107
|
+
const stored = deps.rigRepo.getNodePool(nodeId);
|
|
108
|
+
if (stored === undefined)
|
|
109
|
+
return { nodeId, outcome: "no_block" };
|
|
110
|
+
if (!("spec" in stored))
|
|
111
|
+
return { nodeId, outcome: "unusable", error: stored.error };
|
|
112
|
+
const model = resolveSeatPoolModel(deps.db, nodeId);
|
|
113
|
+
if (!model)
|
|
114
|
+
return { nodeId, outcome: "no_model_session" };
|
|
115
|
+
return { nodeId, ...ensureSeatPoolJob(deps, model, stored.spec) };
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The daemon-start loop: every node with a stored block, one at a time, each in its own try/catch, so one node that
|
|
119
|
+
* throws never stops the others. A failure and an ambiguous job state are warned with the node and the reason.
|
|
120
|
+
*/
|
|
121
|
+
export function reconcileSeatPoolsAtStartup(deps) {
|
|
122
|
+
const warn = deps.warn ?? ((message) => console.warn(message));
|
|
123
|
+
const nodes = deps.db.prepare(`SELECT n.id AS id FROM nodes n JOIN rigs r ON r.id = n.rig_id
|
|
124
|
+
WHERE n.pool IS NOT NULL
|
|
125
|
+
ORDER BY r.name, n.logical_id, n.id`).all();
|
|
126
|
+
const results = [];
|
|
127
|
+
for (const { id } of nodes) {
|
|
128
|
+
let result;
|
|
129
|
+
try {
|
|
130
|
+
result = reconcileSeatPoolNode(deps, id);
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
result = { nodeId: id, outcome: "failed", message: formatWatchdogRegistrationError(error) };
|
|
134
|
+
}
|
|
135
|
+
if (result.outcome === "failed") {
|
|
136
|
+
warn(`[seat-pool] daemon start could not ensure the seat-pool job for node_id="${id}" and continued: ${result.message}`);
|
|
137
|
+
}
|
|
138
|
+
else if (result.outcome === "no_model_session") {
|
|
139
|
+
warn(`[seat-pool] node_id="${id}" has a pool block but no canonical pod member session; no seat-pool job ensured`);
|
|
140
|
+
}
|
|
141
|
+
else if (result.outcome === "ambiguous") {
|
|
142
|
+
warn(`[seat-pool] node_id="${id}" has an ambiguous seat-pool job state (${result.code}); no job picked: ${result.message}`
|
|
143
|
+
+ (result.details ? `; details=${JSON.stringify(result.details)}` : ""));
|
|
144
|
+
}
|
|
145
|
+
results.push(result);
|
|
146
|
+
}
|
|
147
|
+
return results;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=seat-pool-registration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-pool-registration.js","sourceRoot":"","sources":["../../src/domain/seat-pool-registration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAqB,MAAM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AAO,EAAE,+BAA+B,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9F,CAAC;QACD,IAAI,MAAM,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YAChC,IAAI,CAAC,4EAA4E,EAAE,oBAAoB,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QAC3H,CAAC;aAAM,IAAI,MAAM,CAAC,OAAO,KAAK,kBAAkB,EAAE,CAAC;YACjD,IAAI,CAAC,wBAAwB,EAAE,kFAAkF,CAAC,CAAC;QACrH,CAAC;aAAM,IAAI,MAAM,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;YAC1C,IAAI,CACF,wBAAwB,EAAE,2CAA2C,MAAM,CAAC,IAAI,qBAAqB,MAAM,CAAC,OAAO,EAAE;kBACnH,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CACxE,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type Database from "better-sqlite3";
|
|
2
2
|
export type SeatPoolSlotPhase = "adding" | "live" | "draining" | "drained";
|
|
3
|
+
export type SeatPoolSlotAttemptKind = "add" | "comeback";
|
|
4
|
+
export type SeatPoolSlotAttemptState = "reserved" | "issued" | "settled";
|
|
3
5
|
export interface SeatPoolSlot {
|
|
4
6
|
slotId: string;
|
|
5
7
|
modelNodeId: string;
|
|
@@ -9,6 +11,17 @@ export interface SeatPoolSlot {
|
|
|
9
11
|
nodeId: string | null;
|
|
10
12
|
phase: SeatPoolSlotPhase;
|
|
11
13
|
phaseChangedAt: string;
|
|
14
|
+
/** The slot's latest attempt; null when it has none. The add's id is its operation id. */
|
|
15
|
+
attemptId: string | null;
|
|
16
|
+
attemptKind: SeatPoolSlotAttemptKind | null;
|
|
17
|
+
attemptState: SeatPoolSlotAttemptState | null;
|
|
18
|
+
/** JSON: what the attempt was issued on. */
|
|
19
|
+
attemptBasis: string | null;
|
|
20
|
+
/** JSON: the attempt's outcome as the call returned it. */
|
|
21
|
+
attemptOutcome: string | null;
|
|
22
|
+
/** JSON: `{ nodeId, sessionId }` of the session the attempt settled with. */
|
|
23
|
+
attemptResult: string | null;
|
|
24
|
+
reuseHold: string | null;
|
|
12
25
|
createdAt: string;
|
|
13
26
|
}
|
|
14
27
|
export declare class SeatPoolSlotsRepository {
|
|
@@ -31,9 +44,38 @@ export declare class SeatPoolSlotsRepository {
|
|
|
31
44
|
phase: SeatPoolSlotPhase;
|
|
32
45
|
at: string;
|
|
33
46
|
}): SeatPoolSlot;
|
|
47
|
+
/**
|
|
48
|
+
* An add's reservation, in one transaction: the next number (nextSlot) and its row in `adding`, with a reserved add
|
|
49
|
+
* attempt under `attemptId` and no node yet.
|
|
50
|
+
*/
|
|
51
|
+
reserveAdd(input: {
|
|
52
|
+
modelNodeId: string;
|
|
53
|
+
attemptId: string;
|
|
54
|
+
at: string;
|
|
55
|
+
}): {
|
|
56
|
+
slot: SeatPoolSlot;
|
|
57
|
+
logicalId: string;
|
|
58
|
+
};
|
|
59
|
+
/** A reserved attempt becomes issued, with what it was issued on. False when the row no longer holds that reserved
|
|
60
|
+
* attempt. */
|
|
61
|
+
issueAttempt(slotId: string, attemptId: string, basis: string): boolean;
|
|
62
|
+
/** The node an attempt created, written in the transaction that creates it. */
|
|
63
|
+
recordAttemptNode(slotId: string, attemptId: string, nodeId: string): void;
|
|
64
|
+
/** An issued add that runs: settled, with its outcome and the session it settled with, and the slot `live`. */
|
|
65
|
+
settleAdd(slotId: string, attemptId: string, input: {
|
|
66
|
+
outcome: string;
|
|
67
|
+
result: string;
|
|
68
|
+
at: string;
|
|
69
|
+
}): boolean;
|
|
70
|
+
/** An issued attempt's outcome, kept while the attempt stays issued. */
|
|
71
|
+
recordAttemptOutcome(slotId: string, attemptId: string, outcome: string): boolean;
|
|
72
|
+
/** An add that ended with no node: its row goes, which frees its number. Only the row of that attempt, with no node. */
|
|
73
|
+
removeAddWithoutNode(slotId: string, attemptId: string): boolean;
|
|
34
74
|
get(slotId: string): SeatPoolSlot | undefined;
|
|
35
75
|
/** A model's slots, lowest number first. */
|
|
36
76
|
forModel(modelNodeId: string): SeatPoolSlot[];
|
|
77
|
+
/** Whether the node is a pool agent the pool drained: restore keeps it down until the pool brings it back. */
|
|
78
|
+
isDrainedPoolNode(nodeId: string): boolean;
|
|
37
79
|
/** The nodes of every pool agent in a rig, in every phase (`drained` included). */
|
|
38
80
|
poolAgentNodeIds(rigId: string): string[];
|
|
39
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seat-pool-slots.d.ts","sourceRoot":"","sources":["../../src/domain/seat-pool-slots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"seat-pool-slots.d.ts","sourceRoot":"","sources":["../../src/domain/seat-pool-slots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAU3C,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAC3E,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG,UAAU,CAAC;AACzD,MAAM,MAAM,wBAAwB,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzE,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,iBAAiB,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,0FAA0F;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AE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAM1E,+GAA+G;IAC/G,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO;IAO7G,wEAAwE;IACxE,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO;IAKjF,wHAAwH;IACxH,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO;IAMhE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAK7C,4CAA4C;IAC5C,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,EAAE;IAK7C,8GAA8G;IAC9G,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAI1C,mFAAmF;IACnF,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;CAM1C"}
|
|
@@ -6,6 +6,13 @@ const fromRow = (row) => ({
|
|
|
6
6
|
nodeId: row.node_id,
|
|
7
7
|
phase: row.phase,
|
|
8
8
|
phaseChangedAt: row.phase_changed_at,
|
|
9
|
+
attemptId: row.attempt_id,
|
|
10
|
+
attemptKind: row.attempt_kind,
|
|
11
|
+
attemptState: row.attempt_state,
|
|
12
|
+
attemptBasis: row.attempt_basis,
|
|
13
|
+
attemptOutcome: row.attempt_outcome,
|
|
14
|
+
attemptResult: row.attempt_result,
|
|
15
|
+
reuseHold: row.reuse_hold,
|
|
9
16
|
createdAt: row.created_at,
|
|
10
17
|
});
|
|
11
18
|
export class SeatPoolSlotsRepository {
|
|
@@ -53,6 +60,46 @@ export class SeatPoolSlotsRepository {
|
|
|
53
60
|
VALUES (?, ?, ?, ?, ?, ?, ?)`).run(slotId, input.modelNodeId, input.slotNumber, input.nodeId, input.phase, input.at, input.at);
|
|
54
61
|
return this.get(slotId);
|
|
55
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* An add's reservation, in one transaction: the next number (nextSlot) and its row in `adding`, with a reserved add
|
|
65
|
+
* attempt under `attemptId` and no node yet.
|
|
66
|
+
*/
|
|
67
|
+
reserveAdd(input) {
|
|
68
|
+
return this.db.transaction(() => {
|
|
69
|
+
const next = this.nextSlot(input.modelNodeId);
|
|
70
|
+
const slotId = ulid();
|
|
71
|
+
this.db.prepare(`INSERT INTO seat_pool_slots (slot_id, model_node_id, slot_number, node_id, phase, phase_changed_at, attempt_id, attempt_kind,
|
|
72
|
+
attempt_state, created_at)
|
|
73
|
+
VALUES (?, ?, ?, NULL, 'adding', ?, ?, 'add', 'reserved', ?)`).run(slotId, input.modelNodeId, next.slotNumber, input.at, input.attemptId, input.at);
|
|
74
|
+
return { slot: this.get(slotId), logicalId: next.logicalId };
|
|
75
|
+
})();
|
|
76
|
+
}
|
|
77
|
+
/** A reserved attempt becomes issued, with what it was issued on. False when the row no longer holds that reserved
|
|
78
|
+
* attempt. */
|
|
79
|
+
issueAttempt(slotId, attemptId, basis) {
|
|
80
|
+
return this.db.prepare("UPDATE seat_pool_slots SET attempt_state = 'issued', attempt_basis = ? WHERE slot_id = ? AND attempt_id = ? AND attempt_state = 'reserved'").run(basis, slotId, attemptId).changes === 1;
|
|
81
|
+
}
|
|
82
|
+
/** The node an attempt created, written in the transaction that creates it. */
|
|
83
|
+
recordAttemptNode(slotId, attemptId, nodeId) {
|
|
84
|
+
const changed = this.db.prepare("UPDATE seat_pool_slots SET node_id = ? WHERE slot_id = ? AND attempt_id = ? AND node_id IS NULL")
|
|
85
|
+
.run(nodeId, slotId, attemptId).changes;
|
|
86
|
+
if (changed !== 1)
|
|
87
|
+
throw new Error(`seat pool: slot ${slotId} no longer waits for the node of attempt ${attemptId}`);
|
|
88
|
+
}
|
|
89
|
+
/** An issued add that runs: settled, with its outcome and the session it settled with, and the slot `live`. */
|
|
90
|
+
settleAdd(slotId, attemptId, input) {
|
|
91
|
+
return this.db.prepare(`UPDATE seat_pool_slots SET attempt_state = 'settled', attempt_outcome = ?, attempt_result = ?, phase = 'live', phase_changed_at = ?
|
|
92
|
+
WHERE slot_id = ? AND attempt_id = ? AND attempt_state = 'issued'`).run(input.outcome, input.result, input.at, slotId, attemptId).changes === 1;
|
|
93
|
+
}
|
|
94
|
+
/** An issued attempt's outcome, kept while the attempt stays issued. */
|
|
95
|
+
recordAttemptOutcome(slotId, attemptId, outcome) {
|
|
96
|
+
return this.db.prepare("UPDATE seat_pool_slots SET attempt_outcome = ? WHERE slot_id = ? AND attempt_id = ? AND attempt_state = 'issued'")
|
|
97
|
+
.run(outcome, slotId, attemptId).changes === 1;
|
|
98
|
+
}
|
|
99
|
+
/** An add that ended with no node: its row goes, which frees its number. Only the row of that attempt, with no node. */
|
|
100
|
+
removeAddWithoutNode(slotId, attemptId) {
|
|
101
|
+
return this.db.prepare("DELETE FROM seat_pool_slots WHERE slot_id = ? AND attempt_id = ? AND attempt_kind = 'add' AND phase = 'adding' AND node_id IS NULL").run(slotId, attemptId).changes === 1;
|
|
102
|
+
}
|
|
56
103
|
get(slotId) {
|
|
57
104
|
const row = this.db.prepare("SELECT * FROM seat_pool_slots WHERE slot_id = ?").get(slotId);
|
|
58
105
|
return row ? fromRow(row) : undefined;
|
|
@@ -62,6 +109,10 @@ export class SeatPoolSlotsRepository {
|
|
|
62
109
|
return this.db.prepare("SELECT * FROM seat_pool_slots WHERE model_node_id = ? ORDER BY slot_number").all(modelNodeId)
|
|
63
110
|
.map(fromRow);
|
|
64
111
|
}
|
|
112
|
+
/** Whether the node is a pool agent the pool drained: restore keeps it down until the pool brings it back. */
|
|
113
|
+
isDrainedPoolNode(nodeId) {
|
|
114
|
+
return this.db.prepare("SELECT 1 FROM seat_pool_slots WHERE node_id = ? AND phase = 'drained'").get(nodeId) !== undefined;
|
|
115
|
+
}
|
|
65
116
|
/** The nodes of every pool agent in a rig, in every phase (`drained` included). */
|
|
66
117
|
poolAgentNodeIds(rigId) {
|
|
67
118
|
return this.db.prepare(`SELECT s.node_id FROM seat_pool_slots s JOIN nodes m ON m.id = s.model_node_id
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seat-pool-slots.js","sourceRoot":"","sources":["../../src/domain/seat-pool-slots.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"seat-pool-slots.js","sourceRoot":"","sources":["../../src/domain/seat-pool-slots.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAqD5B,MAAM,OAAO,GAAG,CAAC,GAAY,EAAgB,EAAE,CAAC,CAAC;IAC/C,MAAM,EAAE,GAAG,CAAC,OAAO;IACnB,WAAW,EAAE,GAAG,CAAC,aAAa;IAC9B,UAAU,EAAE,GAAG,CAAC,WAAW;IAC3B,MAAM,EAAE,GAAG,CAAC,OAAO;IACnB,KAAK,EAAE,GAAG,CAAC,KAAK;IAChB,cAAc,EAAE,GAAG,CAAC,gBAAgB;IACpC,SAAS,EAAE,GAAG,CAAC,UAAU;IACzB,WAAW,EAAE,GAAG,CAAC,YAAY;IAC7B,YAAY,EAAE,GAAG,CAAC,aAAa;IAC/B,YAAY,EAAE,GAAG,CAAC,aAAa;IAC/B,cAAc,EAAE,GAAG,CAAC,eAAe;IACnC,aAAa,EAAE,GAAG,CAAC,cAAc;IACjC,SAAS,EAAE,GAAG,CAAC,UAAU;IACzB,SAAS,EAAE,GAAG,CAAC,UAAU;CAC1B,CAAC,CAAC;AAEH,MAAM,OAAO,uBAAuB;IACL;IAA7B,YAA6B,EAAqB;QAArB,OAAE,GAAF,EAAE,CAAmB;IAAG,CAAC;IAEtD;;;OAGG;IACH,QAAQ,CAAC,WAAmB;QAC1B,MAAM,KAAK,GAAG,I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AoB,CAAC,MAAc,EAAE,SAAiB;QACpD,OAAO,IAAI,CAAC,EAAE,CAAC,OAAO,CACpB,oIAAoI,CACrI,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,GAAG,CAAC,MAAc;QAChB,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,iDAAiD,CAAC,CAAC,GAAG,CAAC,MAAM,CAAwB,CAAC;QAClH,OAAO,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACxC,CAAC;IAED,4CAA4C;IAC5C,QAAQ,CAAC,WAAmB;QAC1B,OAAQ,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,4EAA4E,CAAC,CAAC,GAAG,CAAC,WAAW,CAAe;aACjI,GAAG,CAAC,OAAO,CAAC,CAAC;IAClB,CAAC;IAED,8GAA8G;IAC9G,iBAAiB,CAAC,MAAc;QAC9B,OAAO,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,uEAAuE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,SAAS,CAAC;IAC5H,CAAC;IAED,mFAAmF;IACnF,gBAAgB,CAAC,KAAa;QAC5B,OAAQ,IAAI,CAAC,EAAE,CAAC,OAAO,CACrB;6FACuF,CACxF,CAAC,GAAG,CAAC,KAAK,CAAgC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACxE,CAAC;CACF"}
|
|
@@ -348,6 +348,21 @@ export declare function accountTextMark(capture: {
|
|
|
348
348
|
export declare function accountLineNames(line: string, expected: string): boolean;
|
|
349
349
|
/** argv from a /proc/<pid>/cmdline read: NUL-terminated words, each kept exactly (spaces and empty words included). */
|
|
350
350
|
export declare function procCmdlineArgv(raw: Buffer | string): string[] | null;
|
|
351
|
+
/** The OS reads behind macOS process facts; tests inject them. */
|
|
352
|
+
export interface DarwinProcessReads {
|
|
353
|
+
/** The exact launch argv and environment from KERN_PROCARGS2 (readNativeProcessLaunch); null when unreadable. */
|
|
354
|
+
launch(pid: number): Promise<{
|
|
355
|
+
argv: string[];
|
|
356
|
+
env: Record<string, string>;
|
|
357
|
+
} | null>;
|
|
358
|
+
/** `lsof -a -p <pid> -d cwd,txt -Ffn` output, run in a UTF-8 locale. */
|
|
359
|
+
lsof(pid: number): Promise<string>;
|
|
360
|
+
isDirectory(path: string): boolean;
|
|
361
|
+
}
|
|
362
|
+
/** macOS has no /proc. The exact argv and environment are the process's own launch record (KERN_PROCARGS2, the same read
|
|
363
|
+
* #2212's identity checks use), kept to CODEX_HOME and HOME; the cwd and the executable (the first txt file) come from
|
|
364
|
+
* lsof. Null when the launch record can't be read; a cwd or executable lsof can't give is null. */
|
|
365
|
+
export declare function darwinProcessFacts(pid: number, reads?: DarwinProcessReads): Promise<ProcessFacts | null>;
|
|
351
366
|
export declare function defaultInPlaceRestartIo(): InPlaceRestartIo;
|
|
352
367
|
export {};
|
|
353
368
|
//# sourceMappingURL=seat-restart-in-place.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seat-restart-in-place.d.ts","sourceRoot":"","sources":["../../src/domain/seat-restart-in-place.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"seat-restart-in-place.d.ts","sourceRoot":"","sources":["../../src/domain/seat-restart-in-place.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,aAAa,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAwD,KAAK,uBAAuB,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC3I,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7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CAAC;CAChC;AAOD;;yFAEyF;AACzF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAS5E;AAED;;;sGAGsG;AACtG,wBAAgB,eAAe,CAAC,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAAG,eAAe,GAAG,IAAI,CAcxG;AAED;4FAC4F;AAC5F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAKxE;AAED,uHAAuH;AACvH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAIrE;AAED,kEAAkE;AAClE,MAAM,WAAW,kBAAkB;IACjC,iHAAiH;IACjH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;IACrF,wEAAwE;IACxE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACnC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACpC;AAcD;;oGAEoG;AACpG,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,GAAE,kBAAgC,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAkB3H;AAED,wBAAgB,uBAAuB,IAAI,gBAAgB,CAwE1D"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
1
2
|
import { createHash } from "node:crypto";
|
|
2
3
|
import fs from "node:fs";
|
|
3
4
|
import nodePath from "node:path";
|
|
5
|
+
import { promisify } from "node:util";
|
|
4
6
|
import Database from "better-sqlite3";
|
|
5
7
|
import { isStagedSendScriptPath, noticeLine, notAppliedNotice } from "../adapters/tmux.js";
|
|
6
8
|
import { codexProcessArgv, codexProcessResumeToken, listNativeProcesses, processArgv, verifyCodexPaneProcess, } from "./native-process-lineage.js";
|
|
@@ -11,6 +13,8 @@ import { rebindAndVerifyPaneIdentity } from "./seat-attention-reconciler.js";
|
|
|
11
13
|
import { emittedEffortFromArgv } from "./seat-effort.js";
|
|
12
14
|
import { CODEX_NETWORK_DEFAULT_OVERRIDE } from "./codex-network-default.js";
|
|
13
15
|
import { CODEX_NON_LOGIN_SHELL_OVERRIDE } from "./native-resume-probe.js";
|
|
16
|
+
import { readNativeProcessLaunch } from "./native-process-arguments.js";
|
|
17
|
+
const execFileAsync = promisify(execFile);
|
|
14
18
|
const RESTART_STARTED = "seat.restart_in_place_started";
|
|
15
19
|
const RESTART_FINISHED = "seat.restart_in_place_finished";
|
|
16
20
|
const BILLING_ROUTE_FOR_OLDER_CLIS = { state: "unknown", detail: "Not reported." };
|
|
@@ -164,7 +168,8 @@ export class CodexInPlaceRestart {
|
|
|
164
168
|
return this.afterFailedStop(target, report, observed, held, recoveryCommand, terminated.message, progress);
|
|
165
169
|
// Respawn the dead pane WITHOUT -k (scrollback stays) with the resume command as its own command.
|
|
166
170
|
progress.stage = "respawn";
|
|
167
|
-
const respawned = await this.deps.tmux.respawnPane(pane, relaunch.command, { cwd,
|
|
171
|
+
const respawned = await this.deps.tmux.respawnPane(pane, relaunch.command, { cwd, groupSeatOf: target.seat.nodeId,
|
|
172
|
+
...(keepPlan?.keep ? { keepLimitOf: target.seat.nodeId, processLimitsMode: "recovery" } : {}) });
|
|
168
173
|
if (!respawned.ok) {
|
|
169
174
|
return this.afterFailedStop(target, report, observed, held, recoveryCommand, `the pane could not be respawned: ${respawned.message}`, progress);
|
|
170
175
|
}
|
|
@@ -263,7 +268,7 @@ export class CodexInPlaceRestart {
|
|
|
263
268
|
const startedAt = process.startedAt ?? null;
|
|
264
269
|
const facts = await this.io.readProcess(process.pid);
|
|
265
270
|
if (!facts)
|
|
266
|
-
return { ok: false, code: "settings_unverified", message: "The running Codex's working directory and Codex home could not be read (
|
|
271
|
+
return { ok: false, code: "settings_unverified", message: "The running Codex's working directory and Codex home could not be read from the OS (Linux reads /proc; macOS reads the process's launch record and lsof; other platforms aren't supported). Nothing was stopped." };
|
|
267
272
|
const codexHome = facts.env.CODEX_HOME ?? (facts.env.HOME ? nodePath.join(facts.env.HOME, ".codex") : null);
|
|
268
273
|
if (!codexHome)
|
|
269
274
|
return { ok: false, code: "settings_unverified", message: "The running Codex's home could not be determined (no CODEX_HOME or HOME). Nothing was stopped." };
|
|
@@ -1072,9 +1077,56 @@ export function procCmdlineArgv(raw) {
|
|
|
1072
1077
|
words.pop();
|
|
1073
1078
|
return words.length > 0 ? words : null;
|
|
1074
1079
|
}
|
|
1080
|
+
// lsof prints only what isprint(3)/iswprint(3) call printable in its own locale, and escapes the rest (`\xc3\xa9` for é).
|
|
1081
|
+
// A daemon started with no locale (launchd, a supervisor, a CI runner) would escape every accented name, so lsof is given
|
|
1082
|
+
// a UTF-8 locale of its own: en_US.UTF-8 ships with every macOS.
|
|
1083
|
+
const darwinReads = {
|
|
1084
|
+
launch: readNativeProcessLaunch,
|
|
1085
|
+
async lsof(pid) {
|
|
1086
|
+
return (await execFileAsync("/usr/sbin/lsof", ["-a", "-p", String(pid), "-d", "cwd,txt", "-Ffn"], { timeout: 2000, maxBuffer: 64 * 1024, env: { ...process.env, LC_ALL: "en_US.UTF-8" } })).stdout;
|
|
1087
|
+
},
|
|
1088
|
+
isDirectory(path) { try {
|
|
1089
|
+
return fs.statSync(path).isDirectory();
|
|
1090
|
+
}
|
|
1091
|
+
catch {
|
|
1092
|
+
return false;
|
|
1093
|
+
} },
|
|
1094
|
+
};
|
|
1095
|
+
/** macOS has no /proc. The exact argv and environment are the process's own launch record (KERN_PROCARGS2, the same read
|
|
1096
|
+
* #2212's identity checks use), kept to CODEX_HOME and HOME; the cwd and the executable (the first txt file) come from
|
|
1097
|
+
* lsof. Null when the launch record can't be read; a cwd or executable lsof can't give is null. */
|
|
1098
|
+
export async function darwinProcessFacts(pid, reads = darwinReads) {
|
|
1099
|
+
const launch = await reads.launch(pid);
|
|
1100
|
+
if (!launch)
|
|
1101
|
+
return null;
|
|
1102
|
+
const env = {};
|
|
1103
|
+
for (const key of ["CODEX_HOME", "HOME"])
|
|
1104
|
+
if (launch.env[key] !== undefined)
|
|
1105
|
+
env[key] = launch.env[key];
|
|
1106
|
+
let cwd = null, exe = null;
|
|
1107
|
+
try {
|
|
1108
|
+
let fd = "";
|
|
1109
|
+
for (const line of (await reads.lsof(pid)).split("\n")) {
|
|
1110
|
+
if (line.startsWith("f"))
|
|
1111
|
+
fd = line.slice(1);
|
|
1112
|
+
else if (line.startsWith("n") && fd === "cwd" && cwd === null)
|
|
1113
|
+
cwd = line.slice(1);
|
|
1114
|
+
else if (line.startsWith("n") && fd === "txt" && exe === null)
|
|
1115
|
+
exe = line.slice(1);
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
catch { /* unknown: the restart refuses where it needs the cwd */ }
|
|
1119
|
+
// lsof still escapes a name that isn't printable UTF-8 (a control character, an invalid byte), so only a path that is
|
|
1120
|
+
// that directory is the cwd.
|
|
1121
|
+
if (cwd !== null && !reads.isDirectory(cwd))
|
|
1122
|
+
cwd = null;
|
|
1123
|
+
return { cwd, exe, env, argv: launch.argv };
|
|
1124
|
+
}
|
|
1075
1125
|
export function defaultInPlaceRestartIo() {
|
|
1076
1126
|
return {
|
|
1077
1127
|
async readProcess(pid) {
|
|
1128
|
+
if (process.platform === "darwin")
|
|
1129
|
+
return darwinProcessFacts(pid);
|
|
1078
1130
|
try {
|
|
1079
1131
|
const environ = fs.readFileSync(`/proc/${pid}/environ`);
|
|
1080
1132
|
const env = {};
|