@openrig/cli 0.7.22 → 0.7.24
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/claude-hook-bridge.cjs +575 -6
- package/daemon/assets/claude-hook-bridge.d.cts +5 -0
- package/daemon/assets/claude-permission-policies.cjs +4 -3
- package/daemon/assets/guidance/openrig-context-entry.md +1 -0
- 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 +4 -3
- package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +3 -2
- package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/README.md +64 -9
- package/daemon/assets/plugins/openrig/hooks/claude.json +39 -0
- package/daemon/assets/plugins/openrig/hooks/codex.json +27 -0
- package/daemon/assets/plugins/openrig/hooks/scripts/claude-hook-bridge.cjs +715 -0
- package/daemon/assets/plugins/openrig/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/scripts/run-rig.cjs +30 -0
- package/daemon/assets/plugins/openrig/skills/working-with-an-openrig-team/SKILL.md +71 -9
- package/daemon/assets/plugins/openrig-codex/.agents/plugins/marketplace.json +15 -0
- package/daemon/assets/plugins/openrig-codex/.codex-plugin/plugin.json +42 -0
- package/daemon/assets/plugins/openrig-codex/LICENSE +200 -0
- package/daemon/assets/plugins/openrig-codex/assets/logo.svg +1 -0
- package/daemon/assets/plugins/openrig-codex/hooks/codex.json +27 -0
- package/daemon/assets/plugins/openrig-codex/hooks/scripts/claude-hook-bridge.cjs +715 -0
- package/daemon/assets/plugins/openrig-codex/skills/working-with-an-openrig-team/SKILL.md +175 -0
- 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/README.md +10 -2
- package/daemon/assets/plugins/openrig-core/hooks/claude.json +9 -0
- package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +50 -0
- package/daemon/assets/plugins/openrig-core/hooks/scripts/compaction-restore-bridge.cjs +3 -1
- package/daemon/assets/plugins/openrig-core/hooks/scripts/permission-answer.cjs +270 -0
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +24 -6
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +11 -8
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +76 -10
- package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +1 -1
- package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +4 -2
- package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +191 -25
- package/daemon/assets/skills/rigs/SKILL.md +136 -26
- 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 +128 -18
- package/daemon/context-packs/reference/acp-agents.md +11 -3
- package/daemon/context-packs/reference/getting-started.md +144 -13
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +201 -3
- package/daemon/context-packs/reference/tmux-servers.md +43 -2
- package/daemon/context-packs/reference/whats-new.md +186 -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 +11 -8
- package/daemon/context-packs/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +76 -10
- 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/SKILL.md +71 -9
- 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/SKILL.md +4 -2
- 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 +191 -25
- 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 +24 -2
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +312 -45
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/claude-resume-launch.d.ts +3 -0
- package/daemon/dist/adapters/claude-resume-launch.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-resume-launch.js +5 -0
- package/daemon/dist/adapters/claude-resume-launch.js.map +1 -1
- package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-resume.js +66 -24
- package/daemon/dist/adapters/claude-resume.js.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts +22 -0
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.js +72 -20
- package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/pi-community-runtime-adapter.d.ts +9 -0
- package/daemon/dist/adapters/pi-community-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-community-runtime-adapter.js +6 -0
- package/daemon/dist/adapters/pi-community-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts +3 -0
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.js +9 -3
- package/daemon/dist/adapters/pi-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 +84 -17
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +355 -78
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/conversation-key-surface.d.ts +2 -0
- package/daemon/dist/conversation-key-surface.d.ts.map +1 -0
- package/daemon/dist/conversation-key-surface.js +5 -0
- package/daemon/dist/conversation-key-surface.js.map +1 -0
- package/daemon/dist/daemon-shutdown.d.ts +8 -0
- package/daemon/dist/daemon-shutdown.d.ts.map +1 -1
- package/daemon/dist/daemon-shutdown.js +15 -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 +32 -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_community_harness_runtime_switches.d.ts +14 -0
- package/daemon/dist/db/migrations/179_community_harness_runtime_switches.d.ts.map +1 -0
- package/daemon/dist/db/migrations/179_community_harness_runtime_switches.js +54 -0
- package/daemon/dist/db/migrations/179_community_harness_runtime_switches.js.map +1 -0
- 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/db/migrations/195_workflow_start_operations.d.ts +4 -0
- package/daemon/dist/db/migrations/195_workflow_start_operations.d.ts.map +1 -0
- package/daemon/dist/db/migrations/195_workflow_start_operations.js +13 -0
- package/daemon/dist/db/migrations/195_workflow_start_operations.js.map +1 -0
- package/daemon/dist/db/migrations/196_queue_item_evidence_ref_roots.d.ts +5 -0
- package/daemon/dist/db/migrations/196_queue_item_evidence_ref_roots.d.ts.map +1 -0
- package/daemon/dist/db/migrations/196_queue_item_evidence_ref_roots.js +7 -0
- package/daemon/dist/db/migrations/196_queue_item_evidence_ref_roots.js.map +1 -0
- package/daemon/dist/db/migrations/199_queue_items_native_permission_index.d.ts +9 -0
- package/daemon/dist/db/migrations/199_queue_items_native_permission_index.d.ts.map +1 -0
- package/daemon/dist/db/migrations/199_queue_items_native_permission_index.js +14 -0
- package/daemon/dist/db/migrations/199_queue_items_native_permission_index.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 +14 -0
- package/daemon/dist/domain/agent-manifest.js.map +1 -1
- package/daemon/dist/domain/background-process-evidence.d.ts +23 -0
- package/daemon/dist/domain/background-process-evidence.d.ts.map +1 -0
- package/daemon/dist/domain/background-process-evidence.js +81 -0
- package/daemon/dist/domain/background-process-evidence.js.map +1 -0
- package/daemon/dist/domain/chat-repository.d.ts +1 -1
- package/daemon/dist/domain/chat-repository.d.ts.map +1 -1
- package/daemon/dist/domain/chat-repository.js +2 -2
- package/daemon/dist/domain/chat-repository.js.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +46 -8
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +66 -20
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/codex-member-permissions.d.ts +35 -0
- package/daemon/dist/domain/codex-member-permissions.d.ts.map +1 -1
- package/daemon/dist/domain/codex-member-permissions.js +106 -1
- package/daemon/dist/domain/codex-member-permissions.js.map +1 -1
- package/daemon/dist/domain/community-harness-presets.d.ts +9 -0
- package/daemon/dist/domain/community-harness-presets.d.ts.map +1 -1
- package/daemon/dist/domain/community-harness-presets.js +25 -1
- package/daemon/dist/domain/community-harness-presets.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 +43 -4
- package/daemon/dist/domain/current-work.d.ts.map +1 -1
- package/daemon/dist/domain/current-work.js +52 -3
- 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/feed/attention-aggregator.d.ts +5 -5
- package/daemon/dist/domain/feed/attention-aggregator.d.ts.map +1 -1
- package/daemon/dist/domain/feed/attention-aggregator.js +10 -4
- package/daemon/dist/domain/feed/attention-aggregator.js.map +1 -1
- package/daemon/dist/domain/files/path-safety.d.ts +7 -0
- package/daemon/dist/domain/files/path-safety.d.ts.map +1 -1
- package/daemon/dist/domain/files/path-safety.js +23 -0
- package/daemon/dist/domain/files/path-safety.js.map +1 -1
- package/daemon/dist/domain/frontmatter.d.ts.map +1 -1
- package/daemon/dist/domain/frontmatter.js +4 -2
- package/daemon/dist/domain/frontmatter.js.map +1 -1
- package/daemon/dist/domain/gateway/destination-resolver.d.ts +3 -0
- package/daemon/dist/domain/gateway/destination-resolver.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/destination-resolver.js +9 -0
- package/daemon/dist/domain/gateway/destination-resolver.js.map +1 -1
- package/daemon/dist/domain/gateway/human-quiet-windows.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/human-quiet-windows.js +2 -1
- package/daemon/dist/domain/gateway/human-quiet-windows.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.d.ts +6 -1
- package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.js +53 -9
- package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +4 -4
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +20 -7
- package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts +4 -0
- package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/outbound-driver.js +1 -0
- package/daemon/dist/domain/gateway/slack/outbound-driver.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts +9 -1
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.js +2 -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 +10 -19
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.js +64 -40
- package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts +3 -13
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js +70 -22
- package/daemon/dist/domain/gateway/slack/slack-subsystem.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/health-detectors.d.ts +4 -0
- package/daemon/dist/domain/health-detectors.d.ts.map +1 -1
- package/daemon/dist/domain/health-detectors.js +4 -1
- package/daemon/dist/domain/health-detectors.js.map +1 -1
- package/daemon/dist/domain/health-diagnosis.d.ts.map +1 -1
- package/daemon/dist/domain/health-diagnosis.js +14 -9
- package/daemon/dist/domain/health-diagnosis.js.map +1 -1
- package/daemon/dist/domain/health-passive-ceremony.d.ts +2 -0
- package/daemon/dist/domain/health-passive-ceremony.d.ts.map +1 -1
- package/daemon/dist/domain/health-passive-ceremony.js +71 -13
- package/daemon/dist/domain/health-passive-ceremony.js.map +1 -1
- package/daemon/dist/domain/history-query.d.ts +1 -1
- package/daemon/dist/domain/history-query.d.ts.map +1 -1
- package/daemon/dist/domain/history-query.js +1 -2
- package/daemon/dist/domain/history-query.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 +9 -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/managed-restore-read-access.d.ts +18 -0
- package/daemon/dist/domain/managed-restore-read-access.d.ts.map +1 -1
- package/daemon/dist/domain/managed-restore-read-access.js +41 -1
- package/daemon/dist/domain/managed-restore-read-access.js.map +1 -1
- package/daemon/dist/domain/mission-control/audit-browse.d.ts +1 -1
- package/daemon/dist/domain/mission-control/audit-browse.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/audit-browse.js +3 -6
- package/daemon/dist/domain/mission-control/audit-browse.js.map +1 -1
- 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 +50 -5
- 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 +35 -3
- package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
- package/daemon/dist/domain/native-resume-probe.js +84 -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 +60 -0
- package/daemon/dist/domain/network/network-requests.d.ts.map +1 -0
- package/daemon/dist/domain/network/network-requests.js +502 -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/node-launcher.d.ts +2 -2
- package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/node-launcher.js +9 -7
- package/daemon/dist/domain/node-launcher.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/pane-cutover.d.ts +36 -9
- package/daemon/dist/domain/pane-cutover.d.ts.map +1 -1
- package/daemon/dist/domain/pane-cutover.js +82 -13
- package/daemon/dist/domain/pane-cutover.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/projection-planner.d.ts +17 -3
- package/daemon/dist/domain/projection-planner.d.ts.map +1 -1
- package/daemon/dist/domain/projection-planner.js +9 -1
- package/daemon/dist/domain/projection-planner.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-destination-check.d.ts +8 -0
- package/daemon/dist/domain/queue-destination-check.d.ts.map +1 -1
- package/daemon/dist/domain/queue-destination-check.js +17 -4
- package/daemon/dist/domain/queue-destination-check.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 +94 -5
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +491 -39
- 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 +23 -3
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +661 -22
- 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 +158 -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-transition-log.d.ts +6 -0
- package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
- package/daemon/dist/domain/queue-transition-log.js +1 -1
- package/daemon/dist/domain/queue-transition-log.js.map +1 -1
- package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
- package/daemon/dist/domain/queue-waiting.js +7 -0
- package/daemon/dist/domain/queue-waiting.js.map +1 -1
- 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 +181 -24
- 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/rehydrate-eligibility.d.ts +8 -0
- package/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
- package/daemon/dist/domain/rehydrate-eligibility.js +61 -9
- package/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
- 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-check-service.d.ts.map +1 -1
- package/daemon/dist/domain/restore-check-service.js +5 -2
- package/daemon/dist/domain/restore-check-service.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +70 -6
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +387 -51
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/return-route.d.ts +13 -2
- package/daemon/dist/domain/return-route.d.ts.map +1 -1
- package/daemon/dist/domain/return-route.js +30 -1
- package/daemon/dist/domain/return-route.js.map +1 -1
- package/daemon/dist/domain/rig-lifecycle-service.d.ts +1 -0
- package/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/rig-lifecycle-service.js +27 -3
- package/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/rig-mode/operating-posture.d.ts.map +1 -1
- package/daemon/dist/domain/rig-mode/operating-posture.js +23 -4
- package/daemon/dist/domain/rig-mode/operating-posture.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 +52 -9
- package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
- package/daemon/dist/domain/rig-teardown.js +184 -32
- 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 +34 -3
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +195 -40
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.js +26 -3
- package/daemon/dist/domain/rigspec-preflight.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/roster-ready-notice.d.ts +11 -0
- package/daemon/dist/domain/roster-ready-notice.d.ts.map +1 -0
- package/daemon/dist/domain/roster-ready-notice.js +35 -0
- package/daemon/dist/domain/roster-ready-notice.js.map +1 -0
- 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/runner-permissions.d.ts +140 -5
- package/daemon/dist/domain/runner-permissions.d.ts.map +1 -1
- package/daemon/dist/domain/runner-permissions.js +593 -16
- package/daemon/dist/domain/runner-permissions.js.map +1 -1
- package/daemon/dist/domain/runtime-adapter.d.ts +3 -1
- package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-exit.d.ts +79 -0
- package/daemon/dist/domain/runtime-exit.d.ts.map +1 -0
- package/daemon/dist/domain/runtime-exit.js +301 -0
- package/daemon/dist/domain/runtime-exit.js.map +1 -0
- package/daemon/dist/domain/runtime-switch-materials.d.ts +4 -1
- package/daemon/dist/domain/runtime-switch-materials.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-switch-materials.js +66 -13
- package/daemon/dist/domain/runtime-switch-materials.js.map +1 -1
- package/daemon/dist/domain/scope/attestation-lineage.generated.js +2 -2
- package/daemon/dist/domain/scope/attestation-lineage.generated.js.map +1 -1
- package/daemon/dist/domain/scope/logical-checkbox.d.ts.map +1 -1
- package/daemon/dist/domain/scope/logical-checkbox.js +18 -0
- package/daemon/dist/domain/scope/logical-checkbox.js.map +1 -1
- package/daemon/dist/domain/scope/scaffold-placeholder.js +2 -2
- package/daemon/dist/domain/scope/scaffold-placeholder.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 +152 -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-handover-service.d.ts +5 -2
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +30 -6
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.d.ts +31 -0
- package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.js +218 -29
- 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 +8 -0
- package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.js +37 -5
- package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +54 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +220 -30
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-pool-executor.d.ts +174 -0
- package/daemon/dist/domain/seat-pool-executor.d.ts.map +1 -0
- package/daemon/dist/domain/seat-pool-executor.js +1241 -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 +66 -0
- package/daemon/dist/domain/seat-pool-slots.d.ts.map +1 -1
- package/daemon/dist/domain/seat-pool-slots.js +101 -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/seat-runtime-switch-service.d.ts +2 -1
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.js +68 -20
- package/daemon/dist/domain/seat-runtime-switch-service.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 +73 -39
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/skill-catalog.d.ts.map +1 -1
- package/daemon/dist/domain/skill-catalog.js +24 -10
- package/daemon/dist/domain/skill-catalog.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 +6 -2
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +118 -30
- 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 +3 -0
- package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
- package/daemon/dist/domain/startup-submission-evidence.js +36 -3
- package/daemon/dist/domain/startup-submission-evidence.js.map +1 -1
- package/daemon/dist/domain/stream-reader-actions.d.ts +23 -0
- package/daemon/dist/domain/stream-reader-actions.d.ts.map +1 -1
- package/daemon/dist/domain/stream-reader-actions.js +43 -0
- package/daemon/dist/domain/stream-reader-actions.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts +24 -3
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +54 -23
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/terminal/earlier-tile-attach-0723.d.ts +2 -0
- package/daemon/dist/domain/terminal/earlier-tile-attach-0723.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/earlier-tile-attach-0723.js +48 -0
- package/daemon/dist/domain/terminal/earlier-tile-attach-0723.js.map +1 -0
- 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/rex-agent-status.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/rex-agent-status.js +5 -2
- package/daemon/dist/domain/terminal/rex-agent-status.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 +31 -3
- package/daemon/dist/domain/terminal/tile-attach.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/tile-attach.js +95 -4
- 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-redaction.d.ts +10 -8
- package/daemon/dist/domain/transcript-redaction.d.ts.map +1 -1
- package/daemon/dist/domain/transcript-redaction.js +51 -22
- package/daemon/dist/domain/transcript-redaction.js.map +1 -1
- 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 +111 -9
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js +6 -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/whoami-service.d.ts +11 -0
- package/daemon/dist/domain/whoami-service.d.ts.map +1 -1
- package/daemon/dist/domain/whoami-service.js +13 -0
- package/daemon/dist/domain/whoami-service.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-reconciliation.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-reconciliation.js +9 -0
- package/daemon/dist/domain/workflow-reconciliation.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 +3 -0
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +48 -3
- 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 +105 -2
- 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 +33 -11
- 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 +219 -77
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/require-sender-identity.d.ts +15 -0
- package/daemon/dist/routes/require-sender-identity.d.ts.map +1 -1
- package/daemon/dist/routes/require-sender-identity.js +57 -8
- 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 +18 -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/stream.d.ts.map +1 -1
- package/daemon/dist/routes/stream.js +28 -1
- package/daemon/dist/routes/stream.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 +57 -44
- 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 +25 -1
- 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 +166 -12
- 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/dist/transcript-redaction-surface.d.ts +2 -0
- package/daemon/dist/transcript-redaction-surface.d.ts.map +1 -0
- package/daemon/dist/transcript-redaction-surface.js +2 -0
- package/daemon/dist/transcript-redaction-surface.js.map +1 -0
- package/daemon/docs/reference/acp-agents.md +11 -3
- package/daemon/docs/reference/agent-spec.md +25 -2
- package/daemon/docs/reference/agent-startup-guide.md +13 -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/community-harness-examples/cursor/cursor.yaml +3 -1
- package/daemon/docs/reference/community-harness-presets.md +27 -2
- package/daemon/docs/reference/daemon-http-clients.md +177 -18
- package/daemon/docs/reference/developing.md +3 -2
- package/daemon/docs/reference/gateway-participants.md +6 -0
- package/daemon/docs/reference/getting-started.md +144 -13
- package/daemon/docs/reference/harness-runner-contract.md +72 -0
- package/daemon/docs/reference/hosted-members.md +133 -0
- package/daemon/docs/reference/inventory-request-diagnostics.md +22 -0
- package/daemon/docs/reference/network-connector.md +141 -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 +53 -2
- package/daemon/docs/reference/rig-bundle.md +11 -1
- package/daemon/docs/reference/rig-spec.md +201 -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-node-targeting.md +10 -0
- package/daemon/docs/reference/seat-pools.md +182 -0
- package/daemon/docs/reference/slack-app-setup.md +15 -0
- package/daemon/docs/reference/terminal-sessions.md +127 -13
- package/daemon/docs/reference/tmux-servers.md +43 -2
- package/daemon/docs/reference/whats-new.md +186 -12
- package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +1 -1
- package/daemon/specs/agents/shared/skills/core/working-with-an-openrig-team/SKILL.md +71 -9
- package/daemon/specs/rigs/launch/factory/guidance/lead-first-move.md +4 -1
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +2 -1
- package/daemon/specs/rigs/launch/starter/guidance/lead-first-move.md +4 -1
- package/dist/bin-wrapper.d.ts.map +1 -1
- package/dist/bin-wrapper.js +24 -5
- package/dist/bin-wrapper.js.map +1 -1
- package/dist/build-info.js +3 -3
- package/dist/client.d.ts +6 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +7 -1
- package/dist/client.js.map +1 -1
- package/dist/commands/add.js +1 -1
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/agent.js +1 -1
- package/dist/commands/agent.js.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/bundle.d.ts.map +1 -1
- package/dist/commands/bundle.js +18 -4
- package/dist/commands/bundle.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/create.d.ts.map +1 -1
- package/dist/commands/create.js +6 -2
- package/dist/commands/create.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/down.d.ts.map +1 -1
- package/dist/commands/down.js +12 -1
- package/dist/commands/down.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/expand.js +1 -1
- package/dist/commands/expand.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/fork.js +1 -1
- package/dist/commands/fork.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/grow.d.ts.map +1 -1
- package/dist/commands/grow.js +9 -4
- package/dist/commands/grow.js.map +1 -1
- package/dist/commands/import.js +1 -1
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +57 -22
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/network.d.ts +2 -3
- package/dist/commands/network.d.ts.map +1 -1
- package/dist/commands/network.js +102 -4
- 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 +13 -1
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +65 -29
- 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 +3 -1
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +79 -7
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/reconcile-session.js +1 -1
- package/dist/commands/reconcile-session.js.map +1 -1
- package/dist/commands/restore.js +1 -1
- package/dist/commands/restore.js.map +1 -1
- package/dist/commands/rig.js +2 -2
- package/dist/commands/rig.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 +75 -18
- 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/skill.js +1 -1
- package/dist/commands/skill.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 +57 -7
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/terminal.d.ts.map +1 -1
- package/dist/commands/terminal.js +20 -4
- package/dist/commands/terminal.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +2 -1
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +6 -0
- package/dist/commands/whoami.js.map +1 -1
- package/dist/commands/workflow-follow.d.ts.map +1 -1
- package/dist/commands/workflow-follow.js +37 -34
- package/dist/commands/workflow-follow.js.map +1 -1
- package/dist/commands/workflow-render.d.ts +1 -1
- package/dist/commands/workflow-render.d.ts.map +1 -1
- package/dist/commands/workflow-render.js +2 -7
- package/dist/commands/workflow-render.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +26 -2
- 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 +30 -1
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +135 -38
- 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/bundle-source.d.ts +4 -0
- package/dist/lib/bundle-source.d.ts.map +1 -1
- package/dist/lib/bundle-source.js +14 -2
- package/dist/lib/bundle-source.js.map +1 -1
- package/dist/lib/context-git.js +2 -2
- package/dist/lib/context-git.js.map +1 -1
- package/dist/lib/frontmatter.d.ts.map +1 -1
- package/dist/lib/frontmatter.js +4 -2
- package/dist/lib/frontmatter.js.map +1 -1
- package/dist/lib/scope/attestation-lineage.js +2 -2
- package/dist/lib/scope/attestation-lineage.js.map +1 -1
- package/dist/lib/scope/logical-checkbox.d.ts.map +1 -1
- package/dist/lib/scope/logical-checkbox.js +18 -0
- package/dist/lib/scope/logical-checkbox.js.map +1 -1
- package/dist/lib/scope/progress-edit.d.ts.map +1 -1
- package/dist/lib/scope/progress-edit.js +11 -1
- package/dist/lib/scope/progress-edit.js.map +1 -1
- package/dist/lib/scope/scaffold-placeholder.js +2 -2
- package/dist/lib/scope/scaffold-placeholder.js.map +1 -1
- package/dist/lib/terminal-cell.d.ts +5 -0
- package/dist/lib/terminal-cell.d.ts.map +1 -0
- package/dist/lib/terminal-cell.js +22 -0
- package/dist/lib/terminal-cell.js.map +1 -0
- 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 +44 -3
- package/dist/mcp-http.d.ts.map +1 -1
- package/dist/mcp-http.js +228 -48
- package/dist/mcp-http.js.map +1 -1
- package/dist/mcp-server.d.ts +28 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +219 -52
- 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/release-surface/extract-surface.d.ts.map +1 -1
- package/dist/release-surface/extract-surface.js +38 -20
- package/dist/release-surface/extract-surface.js.map +1 -1
- package/dist/release-surface/generate.d.ts.map +1 -1
- package/dist/release-surface/generate.js +3 -0
- package/dist/release-surface/generate.js.map +1 -1
- package/dist/release-surface/surface-diff.d.ts +1 -0
- package/dist/release-surface/surface-diff.d.ts.map +1 -1
- package/dist/release-surface/surface-diff.js +19 -18
- package/dist/release-surface/surface-diff.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/dist/restore-packet/redaction.d.ts +4 -26
- package/dist/restore-packet/redaction.d.ts.map +1 -1
- package/dist/restore-packet/redaction.js +19 -63
- package/dist/restore-packet/redaction.js.map +1 -1
- package/dist/terminal-orca.d.ts +7 -0
- package/dist/terminal-orca.d.ts.map +1 -0
- package/dist/terminal-orca.js +239 -0
- package/dist/terminal-orca.js.map +1 -0
- 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/connected-assistants.d.ts +1 -1
- package/tui/dist/connected-assistants.d.ts.map +1 -1
- package/tui/dist/connected-assistants.js +3 -1
- package/tui/dist/connected-assistants.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/daemon-client.d.ts +4 -0
- package/tui/dist/daemon-client.d.ts.map +1 -1
- package/tui/dist/daemon-client.js +12 -8
- package/tui/dist/daemon-client.js.map +1 -1
- package/tui/dist/health/health-model.d.ts.map +1 -1
- package/tui/dist/health/health-model.js +2 -0
- package/tui/dist/health/health-model.js.map +1 -1
- package/tui/dist/hydrate.d.ts +3 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +44 -27
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/live.d.ts +5 -1
- package/tui/dist/live.d.ts.map +1 -1
- package/tui/dist/live.js +20 -2
- package/tui/dist/live.js.map +1 -1
- package/tui/dist/main.js +29 -10
- package/tui/dist/main.js.map +1 -1
- package/tui/dist/pulse/pulse-model.d.ts.map +1 -1
- package/tui/dist/pulse/pulse-model.js +3 -2
- package/tui/dist/pulse/pulse-model.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 +47 -14
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/types.d.ts +10 -4
- package/tui/dist/types.d.ts.map +1 -1
- package/ui/dist/assets/index-Chh-NS8Z.css +32 -0
- package/ui/dist/assets/index-DG_7XFcL.js +628 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-B-sMy02c.js +0 -623
- package/ui/dist/assets/index-DiN7RwWg.css +0 -32
|
@@ -49,6 +49,8 @@ const SNAPSHOT_SEAT_CHANGED = "A snapshot seat was removed or recreated. Select
|
|
|
49
49
|
// usability, and lifecycle projection. Imported and re-exported here so the
|
|
50
50
|
// existing export surface and the execution call sites below are unchanged.
|
|
51
51
|
import { resolveActiveSnapshotSession, activeOccupantAmbiguityError, absentSeatResumeHistory, absentSeatResumeHistoryError, freshSeatLaunchCommand, seatStopCommand } from "./active-occupant.js";
|
|
52
|
+
import { shellWord } from "../adapters/shell-quote.js";
|
|
53
|
+
import { resumeTypeForRuntime } from "./resume-token-validation.js";
|
|
52
54
|
import { effectiveRestorePolicy, isOrdinaryTerminalSeat, communityLaunchOnlyRestoreReason } from "./restore-policy.js";
|
|
53
55
|
import { communityHarnessOf } from "./built-in-runtimes.js";
|
|
54
56
|
import { communityHarnessStopsRestore } from "./community-harness-presets.js";
|
|
@@ -56,7 +58,10 @@ import { seatAdapter } from "../adapters/community-harness-runtime-adapter.js";
|
|
|
56
58
|
import { pluginPathsOf } from "./claude-core-plugin-env.js";
|
|
57
59
|
import { seatLaunchAdditionsForLaunch, systemPromptPendingNoteForNode } from "./seat-launch-additions.js";
|
|
58
60
|
import { resolveSeatKind, seatProcessOwner } from "./seat-kinds.js";
|
|
61
|
+
import { SeatPoolSlotsRepository } from "./seat-pool-slots.js";
|
|
59
62
|
export { resolveActiveSnapshotSession } from "./active-occupant.js";
|
|
63
|
+
/** Restore outcomes that leave a session running (or parked on a prompt), the seats whose continuity notice is armed again. */
|
|
64
|
+
const CONTINUITY_ARMED_STATUSES = new Set(["resumed", "rebuilt", "fresh-primed", "attention_required", "operator_recovered"]);
|
|
60
65
|
export function rollupRestoreRigResult(nodes) {
|
|
61
66
|
if (nodes.length === 0)
|
|
62
67
|
return "failed";
|
|
@@ -178,6 +183,8 @@ export class RestoreOrchestrator {
|
|
|
178
183
|
freshLaunch;
|
|
179
184
|
freshLaunchAvailable;
|
|
180
185
|
seatSkillSelection;
|
|
186
|
+
resolveClaudeFragments;
|
|
187
|
+
armContinuity;
|
|
181
188
|
routerLineSettings;
|
|
182
189
|
getDesiredClaudeActivityHooks;
|
|
183
190
|
appliedLaunchStore;
|
|
@@ -222,6 +229,8 @@ export class RestoreOrchestrator {
|
|
|
222
229
|
this.freshLaunch = deps.freshLaunch;
|
|
223
230
|
this.freshLaunchAvailable = deps.freshLaunchAvailable;
|
|
224
231
|
this.seatSkillSelection = deps.seatSkillSelection;
|
|
232
|
+
this.resolveClaudeFragments = deps.resolveClaudeFragments;
|
|
233
|
+
this.armContinuity = deps.armContinuity;
|
|
225
234
|
this.getDesiredClaudeActivityHooks = deps.getDesiredClaudeActivityHooks;
|
|
226
235
|
this.harnessNotStartedNotice = deps.harnessNotStartedNotice;
|
|
227
236
|
this.routerLineSettings = deps.routerLineSettings;
|
|
@@ -300,7 +309,32 @@ export class RestoreOrchestrator {
|
|
|
300
309
|
// detached is not "running" in one warning and "detached" in the other (the maintainer's 3rd review of #3250).
|
|
301
310
|
// The sessions the classification above already found stale are named detached, the status this restore gives them.
|
|
302
311
|
const observed = this.observeConversationRecords(rigId, snapshot.data, opts?.freshLogicalIds, currentRuntimes, classification.stale);
|
|
303
|
-
|
|
312
|
+
// #3395: a seat pool agent the pool drained stays down. Restore doesn't start it and names it in `keptDown`, outside
|
|
313
|
+
// the node results, so the rig's result is the rest of the rig's. Restore launches a seat by its logical id, so the
|
|
314
|
+
// match is by logical id: a snapshot that saved the seat under an earlier node id still keeps it down.
|
|
315
|
+
// The pool read runs on every restore, pool or not: a seat whose read fails is restored as an ordinary seat and named
|
|
316
|
+
// in a warning, so that read alone doesn't fail the restore. Every other read here still fails it.
|
|
317
|
+
const slots = new SeatPoolSlotsRepository(this.db);
|
|
318
|
+
const drainedByLogicalId = new Map();
|
|
319
|
+
const poolUnknown = [];
|
|
320
|
+
let poolReadError = "";
|
|
321
|
+
for (const current of this.rigRepo.getRig(rigId)?.nodes ?? []) {
|
|
322
|
+
let drained;
|
|
323
|
+
try {
|
|
324
|
+
drained = slots.isDrainedPoolNode(current.id);
|
|
325
|
+
}
|
|
326
|
+
catch (err) {
|
|
327
|
+
poolUnknown.push(current.logicalId);
|
|
328
|
+
poolReadError = err instanceof Error ? err.message : String(err);
|
|
329
|
+
continue;
|
|
330
|
+
}
|
|
331
|
+
if (drained)
|
|
332
|
+
drainedByLogicalId.set(current.logicalId, current.id);
|
|
333
|
+
}
|
|
334
|
+
const poolWarnings = poolUnknown.length === 0 ? [] : [`Restore: the seat pool read failed for ${poolUnknown.join(", ")} `
|
|
335
|
+
+ `(${poolReadError}); restore treats ${poolUnknown.length === 1 ? "it" : "them"} as ordinary seats.`];
|
|
336
|
+
const drainedLogicalIds = [...drainedByLogicalId.keys()];
|
|
337
|
+
const checked = validatePreRestore(snapshot.data, {
|
|
304
338
|
fsOps: opts?.fsOps,
|
|
305
339
|
servicesRecord: this.rigRepo.getServicesRecord(rigId),
|
|
306
340
|
freshLogicalIds: opts?.freshLogicalIds,
|
|
@@ -310,8 +344,16 @@ export class RestoreOrchestrator {
|
|
|
310
344
|
.map((current) => [current.logicalId, current.codexConfigProfile])),
|
|
311
345
|
...(opts?.cwdOverride ? { cwdOverride: opts.cwdOverride } : {}),
|
|
312
346
|
currentStatuses: observed.currentStatuses,
|
|
313
|
-
|
|
347
|
+
// A kept-down agent is not among the seats this restore resumes; it is compared as an agent outside it.
|
|
348
|
+
attachedLogicalIds: [...observed.attachedLogicalIds, ...drainedLogicalIds],
|
|
314
349
|
});
|
|
350
|
+
// A seat this restore keeps down doesn't block the restore: its blocker is a caveat, as for any seat restore leaves.
|
|
351
|
+
const drainedSaved = new Set(snapshot.data.nodes.filter((node) => drainedByLogicalId.has(node.logicalId)).map((node) => node.id));
|
|
352
|
+
const keptBlocker = (blocker) => (!!blocker.nodeId && drainedSaved.has(blocker.nodeId)) || (!!blocker.logicalId && drainedByLogicalId.has(blocker.logicalId));
|
|
353
|
+
const validation = {
|
|
354
|
+
blockers: checked.blockers.filter((blocker) => !keptBlocker(blocker)),
|
|
355
|
+
warnings: [...poolWarnings, ...checked.warnings, ...checked.blockers.filter(keptBlocker).map((blocker) => `${blocker.code}: ${blocker.message} (restore keeps ${blocker.logicalId ?? "this drained pool agent"} down, so this doesn't block a restore)`)],
|
|
356
|
+
};
|
|
315
357
|
const topology = resolveSnapshotRestoreTopology(snapshot.data);
|
|
316
358
|
// A seat that is still a node of this rig but isn't in the snapshot's intended roster isn't started by this restore:
|
|
317
359
|
// one claimed with rig bind or rig attach after the rig's topology was recorded, or one added or claimed after this
|
|
@@ -324,13 +366,24 @@ export class RestoreOrchestrator {
|
|
|
324
366
|
const intendedLiveIds = new Set(liveNodes.filter(current => topology.intendedRoster.some(intended => intended.logicalId === current.logicalId))
|
|
325
367
|
.map(current => current.id));
|
|
326
368
|
const narrowedRoster = snapshot.data.topologyRoster?.source === "operator_explicit";
|
|
327
|
-
|
|
369
|
+
// A kept-down agent this restore would otherwise name as skipped is kept down the same way.
|
|
370
|
+
const skippedDrained = (excluded) => excluded.reason === "current_seat_not_in_intended_roster" && drainedByLogicalId.get(excluded.logicalId) === excluded.nodeId;
|
|
371
|
+
const notIntended = [
|
|
328
372
|
...topology.excludedNodes.map((excluded) => !narrowedRoster && liveNodeIds.has(excluded.nodeId)
|
|
329
373
|
? { ...excluded, reason: "current_seat_not_in_intended_roster" } : excluded),
|
|
330
374
|
...(narrowedRoster ? [] : liveNodes.filter((current) => !snapshotNodeIds.has(current.id) && !intendedLiveIds.has(current.id)).map((current) => ({
|
|
331
375
|
nodeId: current.id, logicalId: current.logicalId, reason: "current_seat_not_in_intended_roster",
|
|
332
376
|
}))),
|
|
333
377
|
];
|
|
378
|
+
const excludedNodes = notIntended.filter((excluded) => !skippedDrained(excluded));
|
|
379
|
+
const planned = this.computeRestorePlan(snapshot.data).filter(entry => !replacements.length || selectedIds.has(entry.node.id));
|
|
380
|
+
const keptDownIds = new Set([
|
|
381
|
+
...notIntended.filter(skippedDrained).map((excluded) => excluded.nodeId),
|
|
382
|
+
...planned.flatMap((entry) => drainedByLogicalId.get(entry.node.logicalId) ?? []),
|
|
383
|
+
]);
|
|
384
|
+
const keptDown = liveNodes.filter((current) => keptDownIds.has(current.id))
|
|
385
|
+
.map((current) => ({ nodeId: current.id, logicalId: current.logicalId, reason: "drained pool agent, not started" }));
|
|
386
|
+
const withKeptDown = keptDown.length > 0 ? { keptDown } : {};
|
|
334
387
|
const skippedSeats = excludedNodes.filter((excluded) => excluded.reason === "current_seat_not_in_intended_roster");
|
|
335
388
|
// A required startup file that is missing holds only its own seat. That seat isn't launched, because it would start
|
|
336
389
|
// without its startup content; it's reported failed with the reason, and the rest of the rig restores. Any other
|
|
@@ -345,9 +398,12 @@ export class RestoreOrchestrator {
|
|
|
345
398
|
const reason = `${blocker.message} ${blocker.remediation}`;
|
|
346
399
|
heldForStartup.set(blocker.nodeId, heldForStartup.has(blocker.nodeId) ? `${heldForStartup.get(blocker.nodeId)} ${reason}` : reason);
|
|
347
400
|
}
|
|
348
|
-
const planIds =
|
|
401
|
+
const planIds = planned.filter(entry => !drainedByLogicalId.has(entry.node.logicalId)).map(entry => entry.node.id);
|
|
349
402
|
const rigWide = validation.blockers.some((blocker) => !SEAT_STARTUP_BLOCKERS.has(blocker.code) || !blocker.nodeId);
|
|
350
|
-
|
|
403
|
+
// A selection whose every seat is kept down has nothing to launch: not a validation failure, but a restore that
|
|
404
|
+
// keeps them down (below). A rig-wide blocker still fails it first.
|
|
405
|
+
const nothingToLaunch = planIds.length === 0 && keptDown.length > 0;
|
|
406
|
+
if (rigWide || (!nothingToLaunch && planIds.every((id) => heldForStartup.has(id)))) {
|
|
351
407
|
const result = {
|
|
352
408
|
snapshotId,
|
|
353
409
|
preRestoreSnapshotId: null,
|
|
@@ -358,6 +414,7 @@ export class RestoreOrchestrator {
|
|
|
358
414
|
snapshotSelection,
|
|
359
415
|
intendedRoster: topology.intendedRoster,
|
|
360
416
|
excludedNodes,
|
|
417
|
+
...withKeptDown,
|
|
361
418
|
};
|
|
362
419
|
return {
|
|
363
420
|
ok: false,
|
|
@@ -413,6 +470,7 @@ export class RestoreOrchestrator {
|
|
|
413
470
|
snapshotSelection,
|
|
414
471
|
intendedRoster: topology.intendedRoster,
|
|
415
472
|
excludedNodes,
|
|
473
|
+
...withKeptDown,
|
|
416
474
|
},
|
|
417
475
|
});
|
|
418
476
|
return { ok: false, code: "service_boot_failed", message: `Service boot failed before agent restore: ${bootResult.error}` };
|
|
@@ -426,12 +484,14 @@ export class RestoreOrchestrator {
|
|
|
426
484
|
const nodeResults = [];
|
|
427
485
|
const restoreWarnings = [...validation.warnings];
|
|
428
486
|
const heldLogicalIds = snapshot.data.nodes.filter((node) => heldForStartup.has(node.id)).map((node) => node.logicalId);
|
|
429
|
-
restoreWarnings.push(...this.conversationPartners(rigId, snapshot.data, observed, opts?.freshLogicalIds, currentRuntimes, heldLogicalIds));
|
|
487
|
+
restoreWarnings.push(...this.conversationPartners(rigId, snapshot.data, observed, opts?.freshLogicalIds, currentRuntimes, [...heldLogicalIds, ...drainedLogicalIds]));
|
|
430
488
|
if (this.rigRepo.getRigNonInterruptive(rigId))
|
|
431
489
|
restoreWarnings.push(nonInterruptiveSummary(true));
|
|
432
490
|
else if (opts?.nonInterruptive === false)
|
|
433
491
|
restoreWarnings.push(nonInterruptiveSummary(false));
|
|
434
492
|
for (const entry of plan) {
|
|
493
|
+
if (drainedByLogicalId.has(entry.node.logicalId))
|
|
494
|
+
continue;
|
|
435
495
|
const held = heldForStartup.get(entry.node.id);
|
|
436
496
|
if (held) {
|
|
437
497
|
nodeResults.push({ nodeId: entry.node.id, logicalId: entry.node.logicalId, status: "failed", error: `Not launched: ${held}` });
|
|
@@ -447,7 +507,14 @@ export class RestoreOrchestrator {
|
|
|
447
507
|
for (const skipped of skippedSeats) {
|
|
448
508
|
restoreWarnings.push(`Restore: ${skipped.logicalId} was skipped: it's a seat of this rig but not in this snapshot's intended roster (it was added or claimed after that roster was recorded), so restore didn't start it.`);
|
|
449
509
|
}
|
|
450
|
-
|
|
510
|
+
// Nothing launched because every selected seat is kept down: the rig is as the pool wants it, not a failed restore
|
|
511
|
+
// (the empty rollup is `failed`).
|
|
512
|
+
if (nothingToLaunch) {
|
|
513
|
+
restoreWarnings.push(`Restore: nothing to launch: ${keptDown.map((kept) => kept.logicalId).join(", ")} `
|
|
514
|
+
+ `${keptDown.length === 1 ? "is a drained seat pool agent" : "are drained seat pool agents"}, kept down until the pool brings `
|
|
515
|
+
+ `${keptDown.length === 1 ? "it" : "them"} back.`);
|
|
516
|
+
}
|
|
517
|
+
const rolledUp = nothingToLaunch ? "fully_restored" : rollupRestoreRigResult(nodeResults);
|
|
451
518
|
const restoreResult = {
|
|
452
519
|
snapshotId,
|
|
453
520
|
preRestoreSnapshotId: preRestoreSnapshot.id,
|
|
@@ -457,6 +524,7 @@ export class RestoreOrchestrator {
|
|
|
457
524
|
snapshotSelection,
|
|
458
525
|
intendedRoster: topology.intendedRoster,
|
|
459
526
|
excludedNodes,
|
|
527
|
+
...withKeptDown,
|
|
460
528
|
};
|
|
461
529
|
const notice = await this.noticeBareShells(rigId, `restore attempt ${attemptId}`, nodeResults, restoreWarnings);
|
|
462
530
|
if (notice)
|
|
@@ -528,12 +596,26 @@ export class RestoreOrchestrator {
|
|
|
528
596
|
nonTargetEffects,
|
|
529
597
|
};
|
|
530
598
|
}
|
|
599
|
+
/** Whether a whole-rig restore of this rig is running in this daemon (#2940: the keep_alive supervisor waits for it). */
|
|
600
|
+
restoreInProgress(rigId) {
|
|
601
|
+
return this.activeRestores.has(rigId);
|
|
602
|
+
}
|
|
531
603
|
/** `keepPane`: the seat is running and is relaunched in its own pane (its process ended in place, the pane and scrollback
|
|
532
604
|
* kept) instead of a new session; nothing checks whether it is live first, since that is the point. `keepEffort`, with
|
|
533
605
|
* `keepPane`: launch with that effort (the running process's own, kept by a provider switch) in place of the seat's
|
|
534
606
|
* saved one, unless the seat has an explicit choice when the launch reads it; it isn't saved as the seat's choice.
|
|
535
607
|
* `keepClaudeLaunch`, for a token-only provider switch, captures current arguments/environment before stopping.
|
|
536
|
-
* `onLaunchEffort`, with `keepPane`, hears the effort the launch selected and why, whether or not one was kept.
|
|
608
|
+
* `onLaunchEffort`, with `keepPane`, hears the effort the launch selected and why, whether or not one was kept.
|
|
609
|
+
* `keepAlive` (#2940): the keep_alive supervisor's relaunch of a fallen seat. Under the seat's lifecycle lease and
|
|
610
|
+
* before any effect, it refuses with `stop_requested` when the seat's latest session carries a stop request or the
|
|
611
|
+
* seat no longer declares keep_alive, so a seat stop or a rig down racing the relaunch wins. With `shouldContinue`,
|
|
612
|
+
* also read there, again just before the launch's first effect and its shell, and again just before the native dispatch
|
|
613
|
+
* into that shell, a false answer (the daemon began shutting down while the launch waited for the lease or prepared)
|
|
614
|
+
* refuses with `shutting_down`, so no recovery starts once shutdown has begun. A refusal after the shell exists rolls
|
|
615
|
+
* that shell back. The refusal carries the seat's own result in `launched`: `notStarted` when it stopped before its
|
|
616
|
+
* first effect, `compensated` when every shell it started was stopped (tmux confirmed it) and the seat's prior state
|
|
617
|
+
* was put back. Without either, its shell may still be running: that result names it, left in place with its session
|
|
618
|
+
* record and binding. It asks for nothing fresh: the seat comes back as any launch would bring it back. */
|
|
537
619
|
async launchSingleNode(rigId, logicalId, opts) {
|
|
538
620
|
return this.launchNodeTargets(rigId, [logicalId], { ...opts, namedAgent: true, nonTargetMode: "unchanged" });
|
|
539
621
|
}
|
|
@@ -576,6 +658,24 @@ export class RestoreOrchestrator {
|
|
|
576
658
|
if (guard && (targetIds.some(id => !guard.ownsLifecycle(id)) || recordedIds.some(id => !guard.ownsCustody(id)))) {
|
|
577
659
|
return guard.lifecycle(targetIds, () => this.launchNodeTargets(rigId, logicalIds, opts), recordedIds);
|
|
578
660
|
}
|
|
661
|
+
const shouldContinue = opts.keepAlive && typeof opts.keepAlive === "object" ? opts.keepAlive.shouldContinue : undefined;
|
|
662
|
+
const shuttingDown = { ok: false, code: "shutting_down", message: "The daemon is shutting down; the seat wasn't relaunched." };
|
|
663
|
+
// Read again just before the launch's first effect and its dispatch: the probes and preparation after this gate wait
|
|
664
|
+
// on tmux and the filesystem, and shutdown can begin meanwhile.
|
|
665
|
+
let refusedForShutdown = false;
|
|
666
|
+
const beforeDispatch = shouldContinue
|
|
667
|
+
? () => { if (shouldContinue())
|
|
668
|
+
return true; refusedForShutdown = true; return false; }
|
|
669
|
+
: undefined;
|
|
670
|
+
if (opts.keepAlive) {
|
|
671
|
+
if (shouldContinue && !shouldContinue())
|
|
672
|
+
return shuttingDown;
|
|
673
|
+
for (const node of targetNodes) {
|
|
674
|
+
const refusal = this.keepAliveRefusal(node.id, node.logicalId);
|
|
675
|
+
if (refusal)
|
|
676
|
+
return { ok: false, code: "stop_requested", message: refusal };
|
|
677
|
+
}
|
|
678
|
+
}
|
|
579
679
|
// Per-target tmux-liveness classification (runtime truth, fail-closed)
|
|
580
680
|
const launched = [];
|
|
581
681
|
const alreadyRunning = [];
|
|
@@ -590,7 +690,11 @@ export class RestoreOrchestrator {
|
|
|
590
690
|
}
|
|
591
691
|
if (opts.keepPane) {
|
|
592
692
|
launched.push(await this.restoreNodeWithCompensation({ node }, rigId, snapshot.id, snapshot.data, { adapters: opts.adapters, fsOps: opts.fsOps, keepPane: true, keepClaudeLaunch: opts.keepClaudeLaunch, resumePeriodicCarry,
|
|
593
|
-
...(opts.keepEffort ? { keepEffort: opts.keepEffort } : {}), ...(opts.onLaunchEffort ? { onLaunchEffort: opts.onLaunchEffort } : {})
|
|
693
|
+
...(opts.keepEffort ? { keepEffort: opts.keepEffort } : {}), ...(opts.onLaunchEffort ? { onLaunchEffort: opts.onLaunchEffort } : {}),
|
|
694
|
+
...(beforeDispatch ? { beforeDispatch } : {}) }, subsetWarnings));
|
|
695
|
+
// The seat's own result goes with the refusal: it says whether the relaunch left anything behind.
|
|
696
|
+
if (refusedForShutdown)
|
|
697
|
+
return { ...shuttingDown, launched };
|
|
594
698
|
continue;
|
|
595
699
|
}
|
|
596
700
|
// An external CLI's claim has no tmux session to probe; restoreNodeWithCompensation leaves it attached.
|
|
@@ -689,8 +793,12 @@ export class RestoreOrchestrator {
|
|
|
689
793
|
const currentEffort = liveChoice ? readSeatEffort(this.db, liveChoice.id) : null;
|
|
690
794
|
const planEntry = { node: liveChoice ? { ...node, cwd: liveChoice.cwd, model: liveChoice.model,
|
|
691
795
|
effort: currentEffort?.effective ?? null, effortChoice: currentEffort?.choice ?? null } : node };
|
|
692
|
-
const result = await this.restoreNodeWithCompensation(planEntry, rigId, snapshot.id, snapshot.data, { adapters: opts?.adapters, fsOps: opts?.fsOps, selectedHistory: opts.selectedHistory, resumePeriodicCarry
|
|
796
|
+
const result = await this.restoreNodeWithCompensation(planEntry, rigId, snapshot.id, snapshot.data, { adapters: opts?.adapters, fsOps: opts?.fsOps, selectedHistory: opts.selectedHistory, resumePeriodicCarry, requireCurrentOccupant: opts.requireCurrentOccupant,
|
|
797
|
+
...(beforeDispatch ? { beforeDispatch } : {}) }, subsetWarnings);
|
|
693
798
|
launched.push(result);
|
|
799
|
+
// The seat's own result goes with the refusal: it says whether the relaunch left anything behind.
|
|
800
|
+
if (refusedForShutdown)
|
|
801
|
+
return { ...shuttingDown, launched };
|
|
694
802
|
}
|
|
695
803
|
// Emit restore.subset_completed for launched targets only
|
|
696
804
|
let harnessNotStarted;
|
|
@@ -762,6 +870,19 @@ export class RestoreOrchestrator {
|
|
|
762
870
|
},
|
|
763
871
|
};
|
|
764
872
|
}
|
|
873
|
+
/** Why a keep_alive relaunch of this seat must not happen now (#2940), read under its lifecycle lease: the latest session
|
|
874
|
+
* records a stop request (a seat stop or a rig down, pending or confirmed), or the seat no longer declares keep_alive.
|
|
875
|
+
* Null when the relaunch may go on. */
|
|
876
|
+
keepAliveRefusal(nodeId, logicalId) {
|
|
877
|
+
const declared = this.db.prepare("SELECT keep_alive FROM nodes WHERE id = ?").get(nodeId)
|
|
878
|
+
?.keep_alive === 1;
|
|
879
|
+
if (!declared)
|
|
880
|
+
return `'${logicalId}' no longer declares keep_alive; it wasn't relaunched.`;
|
|
881
|
+
const latest = this.db.prepare("SELECT intentionally_stopped AS flag FROM sessions WHERE node_id = ? ORDER BY created_at DESC, id DESC LIMIT 1").get(nodeId);
|
|
882
|
+
if (latest?.flag === 1)
|
|
883
|
+
return `'${logicalId}' was asked to stop; it wasn't relaunched.`;
|
|
884
|
+
return null;
|
|
885
|
+
}
|
|
765
886
|
captureNodeState(nodeId, rigId) {
|
|
766
887
|
const binding = this.sessionRegistry.getBindingForNode(nodeId);
|
|
767
888
|
const sessions = this.sessionRegistry.getSessionsForRig(rigId)
|
|
@@ -1042,7 +1163,24 @@ export class RestoreOrchestrator {
|
|
|
1042
1163
|
* Restore one planned seat, checking continuity before launching its occupant.
|
|
1043
1164
|
* Preserve prior state so a failed launch or resume can be compensated.
|
|
1044
1165
|
*/
|
|
1045
|
-
|
|
1166
|
+
/** Restore one seat, then arm its continuity notice when a session is running again. Every restore path (the whole rig, a
|
|
1167
|
+
* subset, a kept pane, a selected history) goes through here, so the notice is armed the same way for all of them. */
|
|
1168
|
+
async restoreNodeWithCompensation(...args) {
|
|
1169
|
+
const result = await this.restoreNodeCore(...args);
|
|
1170
|
+
if (this.armContinuity && CONTINUITY_ARMED_STATUSES.has(result.status)) {
|
|
1171
|
+
try {
|
|
1172
|
+
const problem = await this.armContinuity(args[1], result.nodeId);
|
|
1173
|
+
if (problem)
|
|
1174
|
+
args[5]?.push(problem);
|
|
1175
|
+
}
|
|
1176
|
+
catch (error) {
|
|
1177
|
+
args[5]?.push(`continuity policy was not armed for ${result.logicalId}: ${error.message}`);
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
return result;
|
|
1181
|
+
}
|
|
1182
|
+
/** @internal The restore of one seat; call `restoreNodeWithCompensation`, which also arms its continuity notice. */
|
|
1183
|
+
async restoreNodeCore(entry, rigId, snapshotId, data, opts, warnings, preserveStoppedCurrent = false) {
|
|
1046
1184
|
// `--cwd`: the seat launches, resumes and gets its guidance and checkpoint in the given directory, for this run only.
|
|
1047
1185
|
if (opts?.cwdOverride)
|
|
1048
1186
|
entry = { ...entry, node: { ...entry.node, cwd: opts.cwdOverride } };
|
|
@@ -1054,6 +1192,9 @@ export class RestoreOrchestrator {
|
|
|
1054
1192
|
const liveNode = this.rigRepo.getRig(rigId)?.nodes.find(current => current.logicalId === node.logicalId
|
|
1055
1193
|
&& (!opts?.selectedHistory || current.id === node.id));
|
|
1056
1194
|
const nodeId = node.id;
|
|
1195
|
+
// The seat's live state (its binding and sessions) is on the node the launcher uses, found by logical id: a seat
|
|
1196
|
+
// recreated after the snapshot runs under a new id. The snapshot's id stays the key for the snapshot's own data.
|
|
1197
|
+
const seatNodeId = liveNode?.id ?? nodeId;
|
|
1057
1198
|
const selectedHistory = opts?.selectedHistory;
|
|
1058
1199
|
if (selectedHistory && (!liveNode || selectedHistory.nodeId !== nodeId || !selectedHistory.beforeEffect())) {
|
|
1059
1200
|
return { nodeId, logicalId: node.logicalId, status: "failed", error: "The selected seat or history changed before launch.", notStarted: true };
|
|
@@ -1061,7 +1202,7 @@ export class RestoreOrchestrator {
|
|
|
1061
1202
|
// A selected restore that returns before its launch says so, as a known fact for the startup that selected it.
|
|
1062
1203
|
const notStarted = selectedHistory ? { notStarted: true } : {};
|
|
1063
1204
|
// A seat joined with `rig attach` as an external CLI keeps its attachment: launching here would replace it.
|
|
1064
|
-
const external = this.sessionRegistry.getBindingForNode(
|
|
1205
|
+
const external = this.sessionRegistry.getBindingForNode(seatNodeId);
|
|
1065
1206
|
if (external && seatProcessOwner(resolveSeatKind(external.attachmentType)) === "external") {
|
|
1066
1207
|
return { nodeId, logicalId: node.logicalId, status: "left_attached", error: leftAttachedReason(external.externalSessionName ?? node.logicalId), ...notStarted };
|
|
1067
1208
|
}
|
|
@@ -1097,6 +1238,19 @@ export class RestoreOrchestrator {
|
|
|
1097
1238
|
};
|
|
1098
1239
|
}
|
|
1099
1240
|
const freshRequested = opts?.freshLogicalIds?.includes(node.logicalId) ?? false;
|
|
1241
|
+
// R2 (#2829 review): a stale snapshot must never silently replace the seat's current
|
|
1242
|
+
// conversation. If the snapshot's occupant is not the agent's latest session, park for a
|
|
1243
|
+
// decision (an explicit history selection or --fresh deliberately overrides this).
|
|
1244
|
+
if (opts?.requireCurrentOccupant && occupantResolution.kind === "resolved" && !selectedHistory && !freshRequested) {
|
|
1245
|
+
const latestLive = this.sessionRegistry.getSessionsForRig(rigId)
|
|
1246
|
+
.filter(row => row.nodeId === nodeId)
|
|
1247
|
+
.reduce((latest, row) => !latest || row.id > latest.id ? row : latest, null);
|
|
1248
|
+
if (latestLive && latestLive.id !== occupantResolution.session.id) {
|
|
1249
|
+
return { nodeId, logicalId: node.logicalId, status: "awaiting-decision",
|
|
1250
|
+
error: `The snapshot's occupant is no longer ${node.logicalId}'s current session. No session was started. Restore the original session manually, or deliberately start only this seat fresh: ${this.freshSeatCommand(rigId, data, node.logicalId)}.`,
|
|
1251
|
+
...notStarted };
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1100
1254
|
const carried = opts?.resumePeriodicCarry && !selectedHistory && !freshRequested
|
|
1101
1255
|
&& occupantResolution.kind === "none" && liveNode?.id === nodeId
|
|
1102
1256
|
? data.periodicResumeSourcesByNode?.[nodeId] : undefined;
|
|
@@ -1112,6 +1266,35 @@ export class RestoreOrchestrator {
|
|
|
1112
1266
|
error: "The periodic resume source is no longer this seat's current resumable session. No session was started. Review its history or deliberately start this seat fresh." };
|
|
1113
1267
|
}
|
|
1114
1268
|
}
|
|
1269
|
+
// R2b/C (#2829 review): the same protection for a snapshot that has no occupant for
|
|
1270
|
+
// the seat. Two ways a cold start would silently replace a conversation the seat had:
|
|
1271
|
+
// R2b — the seat started after the snapshot was taken, so a live session is newer
|
|
1272
|
+
// than everything the snapshot records; and
|
|
1273
|
+
// C — the snapshot explicitly recorded the occupant absent but retained the seat's
|
|
1274
|
+
// conversation history under resume_if_possible with no token, which the
|
|
1275
|
+
// resume-history guard skips. Both park for a decision instead of fresh-launching;
|
|
1276
|
+
// explicit history selection and --fresh deliberately override. An eligible selected
|
|
1277
|
+
// carry is validated above and resumes below, so both parks give way to it
|
|
1278
|
+
// (round 4: C must not park a valid periodic carry).
|
|
1279
|
+
if (opts?.requireCurrentOccupant && occupantResolution.kind === "none" && !selectedHistory
|
|
1280
|
+
&& !freshRequested && !carried) {
|
|
1281
|
+
const seatSessions = data.sessions.filter(row => row.nodeId === nodeId);
|
|
1282
|
+
const latestLive = this.sessionRegistry.getSessionsForRig(rigId)
|
|
1283
|
+
.filter(row => row.nodeId === nodeId)
|
|
1284
|
+
.reduce((latest, row) => !latest || row.id > latest.id ? row : latest, null);
|
|
1285
|
+
const newestSnapshotId = seatSessions.reduce((newest, row) => !newest || row.id > newest ? row.id : newest, null);
|
|
1286
|
+
const ranAfterSnapshot = latestLive !== null && (newestSnapshotId === null || latestLive.id > newestSnapshotId);
|
|
1287
|
+
const newestSnapshotRow = seatSessions.reduce((newest, row) => !newest || row.id > newest.id ? row : newest, null);
|
|
1288
|
+
const retainedResumeHistory = newestSnapshotRow?.restorePolicy === "resume_if_possible";
|
|
1289
|
+
if (ranAfterSnapshot || retainedResumeHistory) {
|
|
1290
|
+
const why = ranAfterSnapshot
|
|
1291
|
+
? `The seat has a session newer than the snapshot's, and the snapshot records no occupant for it.`
|
|
1292
|
+
: `The snapshot records no active occupant for the seat but retains its conversation history under resume_if_possible.`;
|
|
1293
|
+
return { nodeId, logicalId: node.logicalId, status: "awaiting-decision",
|
|
1294
|
+
error: `${why} No session was started. Restore the original session manually, or deliberately start only this seat fresh: ${this.freshSeatCommand(rigId, data, node.logicalId)}.`,
|
|
1295
|
+
...notStarted };
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1115
1298
|
const resumeSession = occupantResolution.kind === "resolved" ? occupantResolution.session : carried ?? null;
|
|
1116
1299
|
if (occupantResolution.kind === "none" && preserveStoppedCurrent && !freshRequested && !carried) {
|
|
1117
1300
|
return { nodeId, logicalId: node.logicalId, status: "awaiting-decision", error: stoppedSnapshotReason(node.logicalId, data.rig.name) };
|
|
@@ -1128,9 +1311,11 @@ export class RestoreOrchestrator {
|
|
|
1128
1311
|
if (priorWithToken) {
|
|
1129
1312
|
return { nodeId, logicalId: node.logicalId, status: "awaiting-decision", error: absentSeatResumeHistoryError(node.logicalId, priorWithToken.resumeType, this.rigRepo.getRig(rigId)?.rig.name ?? data.rig.name) };
|
|
1130
1313
|
}
|
|
1131
|
-
// Consult live continuity state BEFORE clearing stale state
|
|
1132
|
-
|
|
1133
|
-
|
|
1314
|
+
// Consult live continuity state BEFORE clearing stale state, keyed on the live seat and its pod: a pod recreated
|
|
1315
|
+
// after the snapshot runs under a new id too.
|
|
1316
|
+
const seatPodId = liveNode?.podId ?? node.podId;
|
|
1317
|
+
if (seatPodId) {
|
|
1318
|
+
const continuityRow = this.db.prepare("SELECT status FROM continuity_state WHERE pod_id = ? AND node_id = ?").get(seatPodId, seatNodeId);
|
|
1134
1319
|
if (continuityRow) {
|
|
1135
1320
|
if (continuityRow.status === "restoring") {
|
|
1136
1321
|
if (selectedHistory)
|
|
@@ -1180,6 +1365,23 @@ export class RestoreOrchestrator {
|
|
|
1180
1365
|
const sourceNote = resumeSourceRecorded
|
|
1181
1366
|
? `resume source '${snapSession?.resumeType}' recorded but no token available`
|
|
1182
1367
|
: `no resume token was captured for this seat`;
|
|
1368
|
+
// A fresh launch reads the seat's saved startup context and refuses without one (as restore-check says), so a seat
|
|
1369
|
+
// with neither isn't offered one. `rig seat set-resume-token <name>` records on the newest session under that name,
|
|
1370
|
+
// for a runtime it has a token type for (its route's own lookup and check), so the reason names it only when that
|
|
1371
|
+
// is this seat's session.
|
|
1372
|
+
if (!this.db.prepare("SELECT 1 FROM node_startup_context WHERE node_id = ? LIMIT 1").get(seatNodeId)) {
|
|
1373
|
+
const tokenTarget = this.sessionRegistry.findResumeContextByName(snapSession.sessionName);
|
|
1374
|
+
const recordToken = tokenTarget?.sessionId === snapSession.id && resumeTypeForRuntime(tokenTarget.runtime)
|
|
1375
|
+
? `; to record its resume token, pipe it to: rig seat set-resume-token ${shellWord(snapSession.sessionName)} --token-stdin --reason "<why>"`
|
|
1376
|
+
: "";
|
|
1377
|
+
return {
|
|
1378
|
+
nodeId,
|
|
1379
|
+
logicalId: node.logicalId,
|
|
1380
|
+
status: "awaiting-decision",
|
|
1381
|
+
noStartupContext: true,
|
|
1382
|
+
error: `Original session unresumable: ${sourceNote}. The seat has no saved startup context either, so it can't be started fresh. No session was started. Restore the original session manually${recordToken}.`,
|
|
1383
|
+
};
|
|
1384
|
+
}
|
|
1183
1385
|
return {
|
|
1184
1386
|
nodeId,
|
|
1185
1387
|
logicalId: node.logicalId,
|
|
@@ -1196,13 +1398,13 @@ export class RestoreOrchestrator {
|
|
|
1196
1398
|
return { nodeId, logicalId: node.logicalId, status: "failed", error };
|
|
1197
1399
|
}
|
|
1198
1400
|
// Capture prior state for compensation, including an exited replacement predecessor.
|
|
1199
|
-
const priorState = this.captureNodeState(
|
|
1401
|
+
const priorState = this.captureNodeState(seatNodeId, rigId);
|
|
1200
1402
|
const keptPane = opts?.keepPane ? priorState.binding?.tmuxPane ?? null : null;
|
|
1201
1403
|
if (opts?.keepPane && (!keptPane || !priorState.binding?.tmuxSession)) {
|
|
1202
1404
|
return { nodeId, logicalId: node.logicalId, status: "failed", error: `${node.logicalId} has no bound tmux pane to keep, so nothing was stopped.` };
|
|
1203
1405
|
}
|
|
1204
1406
|
// Read before takeover ends the process. An unavailable witness keeps normal launch resolution unchanged.
|
|
1205
|
-
const continuation = keptPane && node.runtime === "claude-code" ? await this.claudeContinuationExecutable(keptPane, opts?.keepClaudeLaunch, this.sessionRegistry.getBindingForNode(
|
|
1407
|
+
const continuation = keptPane && node.runtime === "claude-code" ? await this.claudeContinuationExecutable(keptPane, opts?.keepClaudeLaunch, this.sessionRegistry.getBindingForNode(seatNodeId)?.tmuxSession ?? undefined) : undefined;
|
|
1206
1408
|
const claudeExecutable = continuation?.executable, claudeLaunch = continuation?.launch;
|
|
1207
1409
|
if (opts?.keepClaudeLaunch && keptPane && node.runtime === "claude-code")
|
|
1208
1410
|
warnings?.push(...(claudeLaunch?.warnings ?? ["Running Claude launch capture unavailable; using ordinary launch settings."]));
|
|
@@ -1211,8 +1413,12 @@ export class RestoreOrchestrator {
|
|
|
1211
1413
|
if (selectedHistory && !selectedHistory.beforeEffect()) {
|
|
1212
1414
|
return { nodeId, logicalId: node.logicalId, status: "failed", error: "The selected seat or history changed before launch.", notStarted: true };
|
|
1213
1415
|
}
|
|
1214
|
-
|
|
1215
|
-
|
|
1416
|
+
// `beforeDispatch` (a keep_alive relaunch, #2940): a false answer here, before the first effect, starts nothing.
|
|
1417
|
+
if (opts?.beforeDispatch && !opts.beforeDispatch()) {
|
|
1418
|
+
return { nodeId, logicalId: node.logicalId, status: "failed", error: "The daemon is shutting down; the seat wasn't relaunched.", notStarted: true };
|
|
1419
|
+
}
|
|
1420
|
+
this.clearStaleState(seatNodeId, rigId, { keepBinding: keptPane !== null });
|
|
1421
|
+
this.tmuxAdapter.deliveryGuard?.rebindLifecycle(seatNodeId);
|
|
1216
1422
|
// Derive canonical session name for pod-aware nodes
|
|
1217
1423
|
const rig = this.rigRepo.getRig(rigId);
|
|
1218
1424
|
let launchOpts = node.cwd
|
|
@@ -1362,6 +1568,17 @@ export class RestoreOrchestrator {
|
|
|
1362
1568
|
// Preserve the snapshot's selected plugins and record the committed session before launch continues.
|
|
1363
1569
|
const savedStartup = data.nodeStartupContext?.[nodeId];
|
|
1364
1570
|
const onSessionLaunched = opts?.onSessionLaunched;
|
|
1571
|
+
// Asked again after the skills' preparation, just before dispatch; the stale state cleared above is put back.
|
|
1572
|
+
if (opts?.beforeDispatch && !opts.beforeDispatch()) {
|
|
1573
|
+
this.restoreNodeState(seatNodeId, priorState);
|
|
1574
|
+
return { nodeId, logicalId: node.logicalId, status: "failed", error: "The daemon is shutting down; the seat wasn't relaunched.", notStarted: true };
|
|
1575
|
+
}
|
|
1576
|
+
// And again just before the native dispatch, after the shell exists: a false answer there dispatches nothing.
|
|
1577
|
+
let refusedBeforeNative = false;
|
|
1578
|
+
const beforeNativeDispatch = opts?.beforeDispatch
|
|
1579
|
+
? () => { if (opts.beforeDispatch())
|
|
1580
|
+
return true; refusedBeforeNative = true; return false; }
|
|
1581
|
+
: undefined;
|
|
1365
1582
|
// #3395: a launch from stored state reports the seat's stored pool block that can't be used, once for every restore
|
|
1366
1583
|
// path (resume, fresh, subset and single), read from the live node: a seat recreated after the snapshot launches there.
|
|
1367
1584
|
warnings?.push(...storedPoolAdvisories(node.logicalId, this.rigRepo.getNodePool(liveNode?.id ?? nodeId)));
|
|
@@ -1373,13 +1590,14 @@ export class RestoreOrchestrator {
|
|
|
1373
1590
|
...(selectedHistory ? { expectedNodeId: nodeId, beforeEffect: selectedHistory.beforeNative,
|
|
1374
1591
|
beforeRegistration: selectedHistory.beforeRegistration } : {}),
|
|
1375
1592
|
...(savedStartup ? { pluginPaths: pluginPathsOf(savedStartup.projectionEntries) } : {}),
|
|
1376
|
-
|
|
1593
|
+
// Reported on the node the session registers on: a recreated seat's keep_alive budget is its live node's.
|
|
1594
|
+
...(onSessionLaunched ? { onSessionRegistered: (sessionId) => onSessionLaunched(seatNodeId, sessionId) } : {}),
|
|
1377
1595
|
});
|
|
1378
1596
|
if (!launchResult.ok) {
|
|
1379
1597
|
// Launch failed — restore prior state (compensating action)
|
|
1380
1598
|
const compensate = !selectedHistory || (launchResult.code !== "selection_changed_after_creation" && selectedHistory.beforeRegistration());
|
|
1381
1599
|
if (compensate)
|
|
1382
|
-
this.restoreNodeState(
|
|
1600
|
+
this.restoreNodeState(seatNodeId, priorState);
|
|
1383
1601
|
// Known compensation needs a failure that left no terminal: one before its creation, or tmux reporting none was
|
|
1384
1602
|
// created. An unconfirmed creation, a failed write or a later failure isn't known to have left nothing.
|
|
1385
1603
|
const compensated = compensate && NO_TERMINAL_LAUNCH_CODES.has(launchResult.code);
|
|
@@ -1413,7 +1631,20 @@ export class RestoreOrchestrator {
|
|
|
1413
1631
|
const givenStartedIn = givenMissing ? await this.boundPaneFolder(launchResult.sessionName, launchResult.binding.tmuxPane) : null;
|
|
1414
1632
|
// A selected launch's own blank rolled back after the shell started (postLaunchRestore has many return points).
|
|
1415
1633
|
const compensation = { ran: false };
|
|
1416
|
-
|
|
1634
|
+
// A fresh replacement refused for a shutdown undoes its own shells, and says how here.
|
|
1635
|
+
const shutdownRollback = {};
|
|
1636
|
+
const restored = await this.postLaunchRestore(entry, rigId, data, launchResult.sessionName, launchResult, { ...opts, ...(claudeExecutable ? { claudeExecutable } : {}), ...(claudeLaunch ? { claudeLaunch } : {}), compensation,
|
|
1637
|
+
...(beforeNativeDispatch ? { beforeNativeDispatch, shutdownRollback } : {}) }, warnings, priorState, seatRehydration, resumeSession, activityHookGaps, restoredSkillCatalog);
|
|
1638
|
+
if (refusedBeforeNative) {
|
|
1639
|
+
// Shutdown began after the shell was created: nothing was dispatched into it, so it is rolled back as a blank one
|
|
1640
|
+
// is, and the seat is left as it was. A fresh replacement that retired this shell has already done that.
|
|
1641
|
+
let outcome = shutdownRollback.outcome;
|
|
1642
|
+
if (!outcome) {
|
|
1643
|
+
const { rolledBack, terminalStopped, stopUnconfirmed } = await this.rollbackToZeroSession(launchResult.session.nodeId, launchResult.sessionName, launchResult.session.id, priorState, undefined, keptPane !== null);
|
|
1644
|
+
outcome = { compensated: rolledBack && terminalStopped, ...(stopUnconfirmed ? { unconfirmed: launchResult.sessionName } : {}) };
|
|
1645
|
+
}
|
|
1646
|
+
return this.shutdownRefusal(rigId, data, nodeId, node.logicalId, outcome);
|
|
1647
|
+
}
|
|
1417
1648
|
// Whether it's still missing is decided once the launch has run: a fresh launch creates it, and a restore doesn't, so the
|
|
1418
1649
|
// seat's terminal started in tmux's fallback folder.
|
|
1419
1650
|
if (givenMissing && warnings && !folderPresent(givenMissing)) {
|
|
@@ -1682,26 +1913,39 @@ export class RestoreOrchestrator {
|
|
|
1682
1913
|
}
|
|
1683
1914
|
return { rolledBack: true, terminalStopped };
|
|
1684
1915
|
}
|
|
1685
|
-
/**
|
|
1686
|
-
*
|
|
1687
|
-
*
|
|
1916
|
+
/** #2940: the result of a keep_alive relaunch refused because the daemon began shutting down after its shell existed.
|
|
1917
|
+
* `compensated` only when every shell it started was stopped (tmux confirmed it) and the seat's prior state was put
|
|
1918
|
+
* back. A shell whose stop wasn't confirmed may still be running: the result names it, left in place with its session
|
|
1919
|
+
* record and binding, and says how to check and stop it. */
|
|
1920
|
+
shutdownRefusal(rigId, data, nodeId, logicalId, outcome) {
|
|
1921
|
+
if (outcome.unconfirmed) {
|
|
1922
|
+
const name = outcome.unconfirmed;
|
|
1923
|
+
return { nodeId, logicalId, status: "attention_required",
|
|
1924
|
+
error: `The daemon is shutting down, so the seat wasn't relaunched, but the session '${name}' this launch started couldn't be confirmed stopped: it may still be running, so its session record and binding were left in place. Check it with rig capture ${name}, and stop it with ${this.stopSeatCommand(rigId, data, logicalId)}.` };
|
|
1925
|
+
}
|
|
1926
|
+
return { nodeId, logicalId, status: "failed", error: "The daemon is shutting down; the seat wasn't relaunched.",
|
|
1927
|
+
...(outcome.compensated ? { compensated: true } : {}) };
|
|
1928
|
+
}
|
|
1929
|
+
/** The notice for the seats an attempt positively left with no agent running, each with its own cause: a bare shell, or
|
|
1930
|
+
* a failed resume whose blank session was rolled back. Its warnings join the attempt's, and a failure to send it is a
|
|
1931
|
+
* warning too: it never changes or blocks the attempt's own result. Other seats stay in the roll call. */
|
|
1688
1932
|
async noticeBareShells(rigId, attempt, results, warnings) {
|
|
1689
|
-
const shells = results.filter((n) => n.stage === "harness_not_started");
|
|
1933
|
+
const shells = results.filter((n) => n.stage === "harness_not_started" || n.stage === "resume_rolled_back");
|
|
1690
1934
|
if (shells.length === 0 || !this.harnessNotStartedNotice)
|
|
1691
1935
|
return undefined;
|
|
1692
1936
|
try {
|
|
1693
1937
|
// The launcher finds a seat by its logical id in the live rig, so a seat recreated since the snapshot was launched
|
|
1694
1938
|
// under its live node, while its result keeps the snapshot's node id: the notice reads the node the shell is on.
|
|
1695
1939
|
const liveNodes = this.rigRepo.getRig(rigId)?.nodes ?? [];
|
|
1696
|
-
const seats = shells.map(({ nodeId, logicalId, error }) => ({ nodeId: liveNodes.find((node) => node.logicalId === logicalId)?.id ?? nodeId,
|
|
1697
|
-
logicalId, ...(error ? { cause: error } : {}) }));
|
|
1940
|
+
const seats = shells.map(({ nodeId, logicalId, error, stage }) => ({ nodeId: liveNodes.find((node) => node.logicalId === logicalId)?.id ?? nodeId,
|
|
1941
|
+
logicalId, ...(error ? { cause: error } : {}), ...(stage === "resume_rolled_back" ? { rolledBack: true } : {}) }));
|
|
1698
1942
|
const report = await this.harnessNotStartedNotice({ rigId, attempt, seats });
|
|
1699
1943
|
for (const warning of report.warnings ?? [])
|
|
1700
1944
|
warnings.push(`Restore: ${warning}`);
|
|
1701
1945
|
return report;
|
|
1702
1946
|
}
|
|
1703
1947
|
catch (err) {
|
|
1704
|
-
warnings.push(`Restore: the notice for the seats left
|
|
1948
|
+
warnings.push(`Restore: the notice for the seats left with no agent running wasn't recorded (${err instanceof Error ? err.message : String(err)}).`);
|
|
1705
1949
|
return undefined;
|
|
1706
1950
|
}
|
|
1707
1951
|
}
|
|
@@ -1810,9 +2054,15 @@ export class RestoreOrchestrator {
|
|
|
1810
2054
|
// row ordering (cite site 2 of 2; "latest = max id" was the incident's
|
|
1811
2055
|
// defect: a superseded row with a newer ULID defeated the real occupant).
|
|
1812
2056
|
const selected = opts?.selectedHistory;
|
|
2057
|
+
// #2940: a keep_alive relaunch asks too, just before each native dispatch, whether the daemon is still running.
|
|
2058
|
+
const nativeAllowed = opts?.beforeNativeDispatch;
|
|
2059
|
+
const beforeNative = selected || nativeAllowed
|
|
2060
|
+
? (sessionId, bindingId) => (!selected || selected.beforeNative(sessionId, bindingId)) && (!nativeAllowed || nativeAllowed())
|
|
2061
|
+
: undefined;
|
|
1813
2062
|
/** Rolls this restore's blank session back; null when it did, else the result the restore reports instead. */
|
|
1814
2063
|
const rollbackOwnBlank = async () => {
|
|
1815
|
-
|
|
2064
|
+
// The launched session's node: a seat recreated after the snapshot holds its new binding there.
|
|
2065
|
+
const { rolledBack, terminalStopped, stopUnconfirmed } = await this.rollbackToZeroSession(launchResult?.session.nodeId ?? node.id, sessionName, launchResult?.session.id, priorState, selected ? () => selected.beforeNative(launchResult?.session.id, launchResult?.binding.id) : undefined, opts?.keepPane);
|
|
1816
2066
|
// Known compensation: tmux confirmed the terminal stopped, and the earlier state was put back.
|
|
1817
2067
|
if (rolledBack && terminalStopped && priorState && !opts?.keepPane && opts?.compensation)
|
|
1818
2068
|
opts.compensation.ran = true;
|
|
@@ -1894,6 +2144,25 @@ export class RestoreOrchestrator {
|
|
|
1894
2144
|
const recoveryRuntime = startupCtx?.runtime
|
|
1895
2145
|
?? (!isPodAware && liveRuntime === node.runtime ? node.runtime : null);
|
|
1896
2146
|
if (resumeRequested && resumeToken && launchResult && recoveryRuntime === "claude-code") {
|
|
2147
|
+
if (this.resolveClaudeFragments && activityAdapter?.refreshRuntimeFragments && !activityAdapter.environment) {
|
|
2148
|
+
const today = await this.resolveClaudeFragments(rigId, launchResult.session.nodeId)
|
|
2149
|
+
.catch(() => ({ ok: false, reason: "could not resolve today's selection" }));
|
|
2150
|
+
if (today.ok) {
|
|
2151
|
+
const following = today.entries.filter(entry => entry.onRestore === "follow_source");
|
|
2152
|
+
if (following.length) {
|
|
2153
|
+
try {
|
|
2154
|
+
const refresh = activityAdapter.refreshRuntimeFragments(following, { ...launchResult.binding, cwd: launchCwd });
|
|
2155
|
+
warnings?.push(...(refresh.warnings ?? []));
|
|
2156
|
+
}
|
|
2157
|
+
catch {
|
|
2158
|
+
warnings?.push(`Restore: Claude fragments ${following.map(entry => entry.effectiveId).join(", ")} could not be refreshed.`);
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2162
|
+
else if (!today.missingRecipe || startupCtx?.projectionEntries.some(entry => entry.category === "runtime_resource" && entry.onRestore === "follow_source")) {
|
|
2163
|
+
warnings?.push("Restore: Today's Claude fragment selection couldn't be resolved. Check the seat's agent spec and launch recipe before the next restore.");
|
|
2164
|
+
}
|
|
2165
|
+
}
|
|
1897
2166
|
// The saved hooks resource ships under the install's specs: read it from the running install, as replay does.
|
|
1898
2167
|
const entries = (startupCtx?.projectionEntries ?? []).filter(e => e.category === "runtime_resource" && e.resourceType === "claude_activity_hooks")
|
|
1899
2168
|
.map((e) => reanchorShippedProjectionEntry(e, undefined, opts?.fsOps?.exists ?? (() => true)));
|
|
@@ -2047,9 +2316,12 @@ export class RestoreOrchestrator {
|
|
|
2047
2316
|
}
|
|
2048
2317
|
catch { /* best-effort: without it a rotation stays unproved, as before */ }
|
|
2049
2318
|
}
|
|
2050
|
-
if (
|
|
2319
|
+
if (beforeNative && !beforeNative(launchedSessionId, launchResult?.binding.id))
|
|
2051
2320
|
return { nodeId: node.id, logicalId: node.logicalId, status: "attention_required", error: "The selected seat, settings or history changed after shell creation; native resume was not dispatched." };
|
|
2052
|
-
|
|
2321
|
+
// The seat's own settings (permissions, envelope, wrapper, homes, tenure) are read from the node the launcher
|
|
2322
|
+
// registered: a seat recreated after the snapshot runs under a new id, which its launch stamps as OPENRIG_NODE_ID.
|
|
2323
|
+
const seatNodeId = launchResult?.session.nodeId ?? node.id;
|
|
2324
|
+
const resumeOutcome = await this.attemptResume(seatNodeId, sessionName, resumeType, resumeToken, launchCwd, this.liveCodexProfile(rigId, node, selected?.nodeId), modelForRestore(), this.resolveRestorePosture(seatNodeId, rigId), effortForRestore(), warnings, node.advisor, beforeNative ? () => beforeNative(launchedSessionId, launchResult?.binding.id) : undefined, opts?.claudeExecutable, opts?.claudeLaunch);
|
|
2053
2325
|
if (resumeOutcome.kind === "resumed") {
|
|
2054
2326
|
baseStatus = "resumed";
|
|
2055
2327
|
if (launchedSessionId && this.claudeResume.canResume(resumeType, resumeToken)) {
|
|
@@ -2086,7 +2358,7 @@ export class RestoreOrchestrator {
|
|
|
2086
2358
|
if (kept)
|
|
2087
2359
|
return kept;
|
|
2088
2360
|
}
|
|
2089
|
-
return { nodeId: node.id, logicalId: node.logicalId, status: "awaiting-decision", error: `Original session unresumable: resume attempted but failed. The blank session was rolled back; no session is running. Check the harness state manually, or deliberately start only this seat fresh: ${this.freshSeatCommand(rigId, data, node.logicalId)}.` };
|
|
2361
|
+
return { nodeId: node.id, logicalId: node.logicalId, status: "awaiting-decision", stage: "resume_rolled_back", error: `Original session unresumable: resume attempted but failed. The blank session was rolled back; no session is running. Check the harness state manually, or deliberately start only this seat fresh: ${this.freshSeatCommand(rigId, data, node.logicalId)}.` };
|
|
2090
2362
|
}
|
|
2091
2363
|
}
|
|
2092
2364
|
}
|
|
@@ -2195,13 +2467,16 @@ export class RestoreOrchestrator {
|
|
|
2195
2467
|
// Keep the usable provisional shell when the callback exists but its
|
|
2196
2468
|
// recipe/member inputs are unavailable. A callback being present alone
|
|
2197
2469
|
// is not proof that a fresh launch can actually be attempted.
|
|
2198
|
-
if (this.freshLaunchAvailable && !this.freshLaunchAvailable(rigId,
|
|
2470
|
+
if (this.freshLaunchAvailable && !this.freshLaunchAvailable(rigId, launchResult.session.nodeId)) {
|
|
2199
2471
|
const error = `Harness not started: no usable persisted launch recipe for ${node.logicalId}.`;
|
|
2200
2472
|
warnings?.push(`Restore: ${error}`);
|
|
2201
2473
|
this.markHarnessNotStarted(rigId, launchResult.session.nodeId, launchResult.session.id, error);
|
|
2202
2474
|
return { nodeId: node.id, logicalId: node.logicalId, status: "attention_required", error, stage: "harness_not_started" };
|
|
2203
2475
|
}
|
|
2204
|
-
|
|
2476
|
+
if (nativeAllowed && !nativeAllowed()) {
|
|
2477
|
+
return { nodeId: node.id, logicalId: node.logicalId, status: "failed", error: "The daemon is shutting down; the seat wasn't relaunched." };
|
|
2478
|
+
}
|
|
2479
|
+
const retired = await this.retireProvisionalSession(launchResult.session.nodeId, sessionName, launchResult.session.id);
|
|
2205
2480
|
if (!retired.ok) {
|
|
2206
2481
|
warnings?.push(`Restore: ${retired.error}`);
|
|
2207
2482
|
return { nodeId: node.id, logicalId: node.logicalId, status: "attention_required", error: retired.error };
|
|
@@ -2214,14 +2489,57 @@ export class RestoreOrchestrator {
|
|
|
2214
2489
|
if (stale >= 0)
|
|
2215
2490
|
warnings.splice(stale, 1);
|
|
2216
2491
|
const replacementExists = () => this.sessionRegistry.getSessionsForRig(rigId)
|
|
2217
|
-
.some((candidate) => candidate.nodeId ===
|
|
2492
|
+
.some((candidate) => candidate.nodeId === launchResult.session.nodeId
|
|
2218
2493
|
&& candidate.status === "running"
|
|
2219
2494
|
&& candidate.id !== launchResult.session.id);
|
|
2495
|
+
// Asked again after the retire's await, right before the replacement's native start: a shutdown that began
|
|
2496
|
+
// meanwhile wins, and the seat goes back to where it was (the retired shell can't be rolled back any more).
|
|
2497
|
+
if (nativeAllowed && !nativeAllowed()) {
|
|
2498
|
+
const putBack = !!priorState && !replacementExists();
|
|
2499
|
+
if (putBack)
|
|
2500
|
+
this.restoreNodeState(launchResult.session.nodeId, priorState);
|
|
2501
|
+
// The retire's stop was confirmed: with the prior state put back, nothing this launch started is left.
|
|
2502
|
+
if (opts?.shutdownRollback)
|
|
2503
|
+
opts.shutdownRollback.outcome = { compensated: putBack };
|
|
2504
|
+
return { nodeId: node.id, logicalId: node.logicalId, status: "failed", error: "The daemon is shutting down; the seat wasn't relaunched." };
|
|
2505
|
+
}
|
|
2506
|
+
// The same read once more inside the replacement launch, just before its native dispatch: configuration, its
|
|
2507
|
+
// shell and its startup preparation are awaited after the read above, and a shutdown that begins meanwhile wins.
|
|
2508
|
+
let refusedInLaunch = false;
|
|
2509
|
+
const replacementNativeAllowed = nativeAllowed
|
|
2510
|
+
? () => { if (nativeAllowed())
|
|
2511
|
+
return true; refusedInLaunch = true; return false; }
|
|
2512
|
+
: undefined;
|
|
2513
|
+
// Nothing was dispatched into the replacement's shell: it is rolled back as any shell refused before its native
|
|
2514
|
+
// dispatch is, and the seat goes back to where it was. Its stop counts only when tmux confirms it.
|
|
2515
|
+
const rollBackRefusedReplacement = async () => {
|
|
2516
|
+
const replacement = this.sessionRegistry.getSessionsForRig(rigId)
|
|
2517
|
+
.filter((candidate) => candidate.nodeId === launchResult.session.nodeId && candidate.status === "running" && candidate.id !== launchResult.session.id)
|
|
2518
|
+
.at(-1);
|
|
2519
|
+
let outcome;
|
|
2520
|
+
if (replacement) {
|
|
2521
|
+
const { rolledBack, terminalStopped, stopUnconfirmed } = await this.rollbackToZeroSession(launchResult.session.nodeId, replacement.sessionName, replacement.id, priorState);
|
|
2522
|
+
outcome = { compensated: rolledBack && terminalStopped && !!priorState,
|
|
2523
|
+
...(stopUnconfirmed ? { unconfirmed: replacement.sessionName } : {}) };
|
|
2524
|
+
}
|
|
2525
|
+
else {
|
|
2526
|
+
if (priorState)
|
|
2527
|
+
this.restoreNodeState(launchResult.session.nodeId, priorState);
|
|
2528
|
+
outcome = { compensated: !!priorState };
|
|
2529
|
+
}
|
|
2530
|
+
if (opts?.shutdownRollback)
|
|
2531
|
+
opts.shutdownRollback.outcome = outcome;
|
|
2532
|
+
};
|
|
2533
|
+
// The replacement's own session, when this restore follows the sessions it launches (daemon start's automatic
|
|
2534
|
+
// restore adopts it into a keep_alive incident).
|
|
2535
|
+
const onSessionLaunched = opts?.onSessionLaunched;
|
|
2220
2536
|
try {
|
|
2221
2537
|
// #3253: this replaces the provisional shell of a restore, so it is a recovery too: a limit that can't be
|
|
2222
2538
|
// applied doesn't stop the seat, and its notice is the node's. The replacement launches where the provisional
|
|
2223
2539
|
// shell did: this run's `--cwd`, else the saved folder.
|
|
2224
|
-
const fresh = await this.freshLaunch(rigId,
|
|
2540
|
+
const fresh = await this.freshLaunch(rigId, launchResult.session.nodeId, { processLimitsMode: "recovery", ...(opts?.cwdOverride ? { cwdOverride: opts.cwdOverride } : {}),
|
|
2541
|
+
...(replacementNativeAllowed ? { beforeNativeDispatch: replacementNativeAllowed } : {}),
|
|
2542
|
+
...(onSessionLaunched ? { onSessionRegistered: (sessionId) => onSessionLaunched(launchResult.session.nodeId, sessionId) } : {}) });
|
|
2225
2543
|
if (fresh.warnings?.length)
|
|
2226
2544
|
warnings?.push(...fresh.warnings);
|
|
2227
2545
|
// The replacement's own outcome, also when it applied the limit (no notice): the retired provisional shell's
|
|
@@ -2230,13 +2548,22 @@ export class RestoreOrchestrator {
|
|
|
2230
2548
|
if (fresh.status === "launched") {
|
|
2231
2549
|
return { nodeId: node.id, logicalId: node.logicalId, status: "fresh-primed", ...limits };
|
|
2232
2550
|
}
|
|
2551
|
+
if (refusedInLaunch) {
|
|
2552
|
+
await rollBackRefusedReplacement();
|
|
2553
|
+
return { nodeId: node.id, logicalId: node.logicalId, status: "failed", error: "The daemon is shutting down; the seat wasn't relaunched.", ...limits };
|
|
2554
|
+
}
|
|
2233
2555
|
if (priorState && !replacementExists())
|
|
2234
|
-
this.restoreNodeState(
|
|
2556
|
+
this.restoreNodeState(launchResult.session.nodeId, priorState);
|
|
2235
2557
|
return { nodeId: node.id, logicalId: node.logicalId, status: fresh.status, error: fresh.error, ...limits };
|
|
2236
2558
|
}
|
|
2237
2559
|
catch (err) {
|
|
2560
|
+
if (refusedInLaunch) {
|
|
2561
|
+
await rollBackRefusedReplacement();
|
|
2562
|
+
return { nodeId: node.id, logicalId: node.logicalId, status: "failed", error: "The daemon is shutting down; the seat wasn't relaunched.",
|
|
2563
|
+
processLimits: undefined };
|
|
2564
|
+
}
|
|
2238
2565
|
if (priorState && !replacementExists())
|
|
2239
|
-
this.restoreNodeState(
|
|
2566
|
+
this.restoreNodeState(launchResult.session.nodeId, priorState);
|
|
2240
2567
|
return {
|
|
2241
2568
|
nodeId: node.id,
|
|
2242
2569
|
logicalId: node.logicalId,
|
|
@@ -2298,7 +2625,7 @@ export class RestoreOrchestrator {
|
|
|
2298
2625
|
// it is, an edited one is named, and a missing one whose recorded source is gone or has changed is not put back
|
|
2299
2626
|
// with today's bytes. Only the rest is projected or installed. Nothing is re-resolved from today's spec. Native
|
|
2300
2627
|
// resume replays nothing (sourceEntries is empty). The whole selection stays in the saved startup context.
|
|
2301
|
-
const seatSkills = (replayCtx.runtime === "claude-code" || replayCtx.runtime === "codex") && !replayContained ? seatSkillPathsForNode(this.db,
|
|
2628
|
+
const seatSkills = (replayCtx.runtime === "claude-code" || replayCtx.runtime === "codex") && !replayContained ? seatSkillPathsForNode(this.db, launchResult.session.nodeId) : undefined;
|
|
2302
2629
|
let replaySkip;
|
|
2303
2630
|
if (seatSkills) {
|
|
2304
2631
|
const replay = seatSkillReplay({ entries: filteredEntries, files: filteredFiles, paths: seatSkills,
|
|
@@ -2334,7 +2661,7 @@ export class RestoreOrchestrator {
|
|
|
2334
2661
|
codexConfigProfile: this.liveCodexProfile(rigId, node, selected?.nodeId) ?? undefined,
|
|
2335
2662
|
// OPR.0.4.8.3 Seam B: the pod-aware restore path binds the restored posture too
|
|
2336
2663
|
// (both restore paths consume persisted provenance — preflight surface 3).
|
|
2337
|
-
launchPosture: this.resolveRestorePosture(
|
|
2664
|
+
launchPosture: this.resolveRestorePosture(launchResult.session.nodeId, rigId),
|
|
2338
2665
|
// OPR.0.4.6.PI1 VM leg finding: the restore binding dropped the
|
|
2339
2666
|
// node's model declaration, so a resumed Pi seat relaunched with
|
|
2340
2667
|
// no --model — and the runner's provider-key allowlist (keyed off
|
|
@@ -2348,12 +2675,14 @@ export class RestoreOrchestrator {
|
|
|
2348
2675
|
try {
|
|
2349
2676
|
const { StartupOrchestrator } = await import("./startup-orchestrator.js");
|
|
2350
2677
|
const startupOrch = new StartupOrchestrator({ db: this.db, sessionRegistry: this.sessionRegistry, eventBus: this.eventBus, tmuxAdapter: this.tmuxAdapter,
|
|
2678
|
+
...(this.resolveClaudeFragments ? { resolveClaudeFragments: this.resolveClaudeFragments } : {}),
|
|
2351
2679
|
...(this.listProcesses ? { listProcesses: this.listProcesses } : {}) });
|
|
2352
2680
|
const replayAsRestore = baseStatus !== "fresh-primed";
|
|
2353
2681
|
const shouldLaunchHarness = isPodAware;
|
|
2354
2682
|
const startupResult = await startupOrch.startNode({
|
|
2355
2683
|
rigId,
|
|
2356
|
-
|
|
2684
|
+
// The live node, where the launch registered this session; the replay inputs stay the snapshot's.
|
|
2685
|
+
nodeId: launchResult.session.nodeId,
|
|
2357
2686
|
sessionId: launchResult.session.id,
|
|
2358
2687
|
binding: binding,
|
|
2359
2688
|
adapter,
|
|
@@ -2361,6 +2690,7 @@ export class RestoreOrchestrator {
|
|
|
2361
2690
|
resolvedStartupFiles: filteredFiles,
|
|
2362
2691
|
startupActions: sourceActions,
|
|
2363
2692
|
isRestore: replayAsRestore,
|
|
2693
|
+
refreshClaudeFragments: !resumeRequested && (freshRequested || !replayAsRestore),
|
|
2364
2694
|
...(replaySkip ? { replaySkip } : {}),
|
|
2365
2695
|
preserveStartupContext: replayContained,
|
|
2366
2696
|
skipHarnessLaunch: !shouldLaunchHarness,
|
|
@@ -2368,7 +2698,7 @@ export class RestoreOrchestrator {
|
|
|
2368
2698
|
resumeType: (isPodAware && resumeRequested) ? resumeType ?? undefined : undefined,
|
|
2369
2699
|
sessionName: sessionName,
|
|
2370
2700
|
allowFreshFallback: !(isPodAware && resumeRequested),
|
|
2371
|
-
...(
|
|
2701
|
+
...(beforeNative ? { beforeNativeLaunch: () => beforeNative(launchResult.session.id, launchResult.binding.id) } : {}),
|
|
2372
2702
|
});
|
|
2373
2703
|
warnings?.push(...(startupResult.warnings ?? []));
|
|
2374
2704
|
// #3039: the blocks the resumed launch actually sent, by the adapter's own record, are the ones the check after the
|
|
@@ -2398,6 +2728,7 @@ export class RestoreOrchestrator {
|
|
|
2398
2728
|
nodeId: node.id,
|
|
2399
2729
|
logicalId: node.logicalId,
|
|
2400
2730
|
status: "awaiting-decision",
|
|
2731
|
+
stage: "resume_rolled_back",
|
|
2401
2732
|
error: resumeWithoutContext
|
|
2402
2733
|
? `Original session unresumable: resume attempted but the runtime reported fresh continuity. The blank session was rolled back; no session is running. ${noContextFresh}`
|
|
2403
2734
|
: `Original session unresumable: resume attempted but the runtime reported fresh continuity. The blank session was rolled back; no session is running. If that degradation is acceptable, start only this seat fresh: ${this.freshSeatCommand(rigId, data, node.logicalId)}.`,
|
|
@@ -2407,7 +2738,7 @@ export class RestoreOrchestrator {
|
|
|
2407
2738
|
? ((startupResult.continuityOutcome === "resumed" || nativeContinuityProved) ? "resumed" : baseStatus)
|
|
2408
2739
|
: baseStatus;
|
|
2409
2740
|
if (finalStatus === "resumed") {
|
|
2410
|
-
return this.finishJoinedResume(node, sessionName, resumeToken, launchResult?.session.id, isPodAware && node.runtime === "claude-code", startupResult.resumedProcess, selected ? () => selected.beforeNative(launchResult?.session.id, launchResult?.binding.id) : undefined);
|
|
2741
|
+
return this.finishJoinedResume(node, sessionName, resumeToken, launchResult?.session.id, isPodAware && node.runtime === "claude-code", startupResult.resumedProcess, selected ? () => selected.beforeNative(launchResult?.session.id, launchResult?.binding.id) : undefined, launchResult?.session.nodeId);
|
|
2411
2742
|
}
|
|
2412
2743
|
return { nodeId: node.id, logicalId: node.logicalId, status: finalStatus, ...(noConversation && finalStatus === "fresh-primed" ? { noConversation: true } : {}) };
|
|
2413
2744
|
}
|
|
@@ -2448,6 +2779,7 @@ export class RestoreOrchestrator {
|
|
|
2448
2779
|
nodeId: node.id,
|
|
2449
2780
|
logicalId: node.logicalId,
|
|
2450
2781
|
status: "awaiting-decision",
|
|
2782
|
+
stage: "resume_rolled_back",
|
|
2451
2783
|
error: resumeWithoutContext
|
|
2452
2784
|
? `Original session unresumable: ${startupResult.errors.join("; ")}. The blank session was rolled back; no session is running. ${noContextFresh} Restore the original session manually.`
|
|
2453
2785
|
: `Original session unresumable: ${startupResult.errors.join("; ")}. The blank session was rolled back; no session is running. OpenRig's records can't tell whether this conversation was ever used. If you know this seat was never used, nothing is lost by starting only this seat fresh, ${steps}. Otherwise restore the original session manually.`,
|
|
@@ -2498,7 +2830,7 @@ export class RestoreOrchestrator {
|
|
|
2498
2830
|
}
|
|
2499
2831
|
}
|
|
2500
2832
|
if (baseStatus === "resumed") {
|
|
2501
|
-
return this.finishJoinedResume(node, sessionName, resumeToken, launchResult?.session.id, false, undefined, selected ? () => selected.beforeNative(launchResult?.session.id, launchResult?.binding.id) : undefined);
|
|
2833
|
+
return this.finishJoinedResume(node, sessionName, resumeToken, launchResult?.session.id, false, undefined, selected ? () => selected.beforeNative(launchResult?.session.id, launchResult?.binding.id) : undefined, launchResult?.session.nodeId);
|
|
2502
2834
|
}
|
|
2503
2835
|
return { nodeId: node.id, logicalId: node.logicalId, status: baseStatus, ...(noConversation && !startupFailed && baseStatus === "fresh-primed" ? { noConversation: true } : {}) };
|
|
2504
2836
|
}
|
|
@@ -2506,14 +2838,18 @@ export class RestoreOrchestrator {
|
|
|
2506
2838
|
* rebound and its process identity agrees with the declared seat runtime. */
|
|
2507
2839
|
async finishJoinedResume(node, sessionName, resumeToken, sessionId, managedClaudeResume = false,
|
|
2508
2840
|
/** Codex (#1524): the process the adapter proved the resume on. The join must verify that same process. */
|
|
2509
|
-
provenCodexProcess, assertCurrent
|
|
2841
|
+
provenCodexProcess, assertCurrent,
|
|
2842
|
+
/** The node the launcher registered the session on; a seat recreated after the snapshot runs under a new id. The live
|
|
2843
|
+
* checks read it; the result keeps the snapshot's node, which the caller maps to the registered one. */
|
|
2844
|
+
liveNodeId) {
|
|
2845
|
+
const seatNodeId = liveNodeId ?? node.id;
|
|
2510
2846
|
if (assertCurrent && !assertCurrent())
|
|
2511
2847
|
return { nodeId: node.id, logicalId: node.logicalId, status: "attention_required", error: "Selected seat changed before joined native proof; outcome needs inspection." };
|
|
2512
2848
|
const identity = await rebindAndVerifyPaneIdentity({
|
|
2513
2849
|
db: this.db,
|
|
2514
2850
|
sessionRegistry: this.sessionRegistry,
|
|
2515
2851
|
tmux: this.tmuxAdapter,
|
|
2516
|
-
nodeId:
|
|
2852
|
+
nodeId: seatNodeId,
|
|
2517
2853
|
sessionName,
|
|
2518
2854
|
runtime: node.runtime ?? null,
|
|
2519
2855
|
expectedResumeToken: resumeToken,
|
|
@@ -2528,7 +2864,7 @@ export class RestoreOrchestrator {
|
|
|
2528
2864
|
return;
|
|
2529
2865
|
// The join awaits native observations. Only the exact launched row, still
|
|
2530
2866
|
// current and running, owns this readiness write after those awaits.
|
|
2531
|
-
const current = this.db.prepare("SELECT id, session_name, status FROM sessions WHERE node_id = ? ORDER BY created_at DESC, id DESC LIMIT 1").get(
|
|
2867
|
+
const current = this.db.prepare("SELECT id, session_name, status FROM sessions WHERE node_id = ? ORDER BY created_at DESC, id DESC LIMIT 1").get(seatNodeId);
|
|
2532
2868
|
if (current?.id === sessionId && current.session_name === sessionName && current.status === "running") {
|
|
2533
2869
|
this.sessionRegistry.updateStartupStatus(sessionId, "attention_required");
|
|
2534
2870
|
}
|
|
@@ -2550,7 +2886,7 @@ export class RestoreOrchestrator {
|
|
|
2550
2886
|
const joined = identity.nativeProcess;
|
|
2551
2887
|
if (!joined || joined.pid !== provenCodexProcess.pid || joined.startedAt !== provenCodexProcess.startedAt) {
|
|
2552
2888
|
const store = new SeatIdentityStore(this.db);
|
|
2553
|
-
const proof = store.getForNode(
|
|
2889
|
+
const proof = store.getForNode(seatNodeId);
|
|
2554
2890
|
if (proof)
|
|
2555
2891
|
store.upsert({ ...proof, verdict: "mismatch", reason: "process_identity_mismatch" });
|
|
2556
2892
|
return { nodeId: node.id, logicalId: node.logicalId, status: "attention_required",
|
|
@@ -2561,7 +2897,7 @@ export class RestoreOrchestrator {
|
|
|
2561
2897
|
// launched row's empty token after proof; never overwrite a hook/operator.
|
|
2562
2898
|
if ((node.runtime === "codex" || node.runtime === "claude-code") && sessionId && resumeToken) {
|
|
2563
2899
|
const current = this.db.prepare("SELECT node_id, session_name, status, resume_token FROM sessions WHERE id = ?").get(sessionId);
|
|
2564
|
-
const sameSession = current?.node_id ===
|
|
2900
|
+
const sameSession = current?.node_id === seatNodeId && current.session_name === sessionName && current.status === "running";
|
|
2565
2901
|
// Startup already retained the managed token. Recheck after the awaited
|
|
2566
2902
|
// join; a hook/operator may have changed it meanwhile. Never backfill here.
|
|
2567
2903
|
const retained = sameSession && (managedClaudeResume
|
|
@@ -2574,7 +2910,7 @@ export class RestoreOrchestrator {
|
|
|
2574
2910
|
if (!retained) {
|
|
2575
2911
|
markManagedResumeAttention();
|
|
2576
2912
|
const store = new SeatIdentityStore(this.db);
|
|
2577
|
-
const proof = store.getForNode(
|
|
2913
|
+
const proof = store.getForNode(seatNodeId);
|
|
2578
2914
|
if (proof)
|
|
2579
2915
|
store.upsert({ ...proof, verdict: "mismatch", reason: "process_identity_mismatch" });
|
|
2580
2916
|
return { nodeId: node.id, logicalId: node.logicalId, status: "attention_required",
|