@openrig/cli 0.7.6 → 0.7.8
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 +5 -5
- package/daemon/assets/openshell/Dockerfile +15 -0
- package/daemon/assets/openshell/README.md +137 -0
- package/daemon/assets/openshell/agents/coordinator/agent.yaml +20 -0
- package/daemon/assets/openshell/agents/coordinator/role.md +1 -0
- package/daemon/assets/openshell/agents/worker/agent.yaml +20 -0
- package/daemon/assets/openshell/agents/worker/role.md +3 -0
- package/daemon/assets/openshell/claude-code-provider.yaml +55 -0
- package/daemon/assets/openshell/driver-v1.schema.json +81 -0
- package/daemon/assets/openshell/guest.py +306 -0
- package/daemon/assets/openshell/policy.yaml +33 -0
- package/daemon/assets/openshell/preset.yaml +12 -0
- package/daemon/assets/openshell/rig.yaml +20 -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/skills/seat-continuity-and-handover/SKILL.md +1 -1
- 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 +16 -6
- package/daemon/context-packs/reference/getting-started.md +8 -3
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +69 -12
- package/daemon/context-packs/reference/whats-new.md +162 -10
- 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/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/manifest.yaml +1 -1
- 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/delegating-work/manifest.yaml +1 -1
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
- package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
- package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/seat-continuity-and-handover/SKILL.md +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.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +37 -6
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/claude-resume.d.ts +2 -1
- package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-resume.js +6 -3
- package/daemon/dist/adapters/claude-resume.js.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts +4 -7
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +86 -33
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts +13 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.js +28 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/openshell-driver.d.ts +39 -0
- package/daemon/dist/adapters/openshell-driver.d.ts.map +1 -0
- package/daemon/dist/adapters/openshell-driver.js +139 -0
- package/daemon/dist/adapters/openshell-driver.js.map +1 -0
- package/daemon/dist/adapters/openshell-podman-observer.d.ts +30 -0
- package/daemon/dist/adapters/openshell-podman-observer.d.ts.map +1 -0
- package/daemon/dist/adapters/openshell-podman-observer.js +94 -0
- package/daemon/dist/adapters/openshell-podman-observer.js.map +1 -0
- package/daemon/dist/adapters/pi-openrouter-charge.d.ts +1 -0
- package/daemon/dist/adapters/pi-openrouter-charge.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-openrouter-charge.js +17 -3
- package/daemon/dist/adapters/pi-openrouter-charge.js.map +1 -1
- package/daemon/dist/adapters/tmux-control.d.ts +12 -6
- package/daemon/dist/adapters/tmux-control.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux-control.js +42 -21
- package/daemon/dist/adapters/tmux-control.js.map +1 -1
- package/daemon/dist/adapters/tmux-server.d.ts +6 -3
- package/daemon/dist/adapters/tmux-server.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux-server.js +13 -8
- package/daemon/dist/adapters/tmux-server.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +8 -2
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +38 -11
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +8 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/142_node_claude_mcp.d.ts +3 -0
- package/daemon/dist/db/migrations/142_node_claude_mcp.d.ts.map +1 -0
- package/daemon/dist/db/migrations/142_node_claude_mcp.js +5 -0
- package/daemon/dist/db/migrations/142_node_claude_mcp.js.map +1 -0
- package/daemon/dist/db/migrations/143_activity_grants.d.ts +8 -0
- package/daemon/dist/db/migrations/143_activity_grants.d.ts.map +1 -0
- package/daemon/dist/db/migrations/143_activity_grants.js +22 -0
- package/daemon/dist/db/migrations/143_activity_grants.js.map +1 -0
- package/daemon/dist/db/migrations/144_environment_bindings.d.ts +4 -0
- package/daemon/dist/db/migrations/144_environment_bindings.d.ts.map +1 -0
- package/daemon/dist/db/migrations/144_environment_bindings.js +31 -0
- package/daemon/dist/db/migrations/144_environment_bindings.js.map +1 -0
- package/daemon/dist/db/migrations/145_node_permissions_to.d.ts +5 -0
- package/daemon/dist/db/migrations/145_node_permissions_to.d.ts.map +1 -0
- package/daemon/dist/db/migrations/145_node_permissions_to.js +7 -0
- package/daemon/dist/db/migrations/145_node_permissions_to.js.map +1 -0
- package/daemon/dist/domain/active-occupant.d.ts +2 -0
- package/daemon/dist/domain/active-occupant.d.ts.map +1 -1
- package/daemon/dist/domain/active-occupant.js +9 -1
- package/daemon/dist/domain/active-occupant.js.map +1 -1
- package/daemon/dist/domain/activity-grants.d.ts +63 -0
- package/daemon/dist/domain/activity-grants.d.ts.map +1 -0
- package/daemon/dist/domain/activity-grants.js +106 -0
- package/daemon/dist/domain/activity-grants.js.map +1 -0
- package/daemon/dist/domain/agent-images/agent-image-library-service.d.ts.map +1 -1
- package/daemon/dist/domain/agent-images/agent-image-library-service.js +5 -2
- package/daemon/dist/domain/agent-images/agent-image-library-service.js.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +11 -4
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +36 -11
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/claude-mcp.d.ts +10 -0
- package/daemon/dist/domain/claude-mcp.d.ts.map +1 -0
- package/daemon/dist/domain/claude-mcp.js +19 -0
- package/daemon/dist/domain/claude-mcp.js.map +1 -0
- package/daemon/dist/domain/codex-owned-plugin-trust.d.ts.map +1 -1
- package/daemon/dist/domain/codex-owned-plugin-trust.js +2 -1
- package/daemon/dist/domain/codex-owned-plugin-trust.js.map +1 -1
- package/daemon/dist/domain/community-harness-presets.d.ts +2 -1
- package/daemon/dist/domain/community-harness-presets.d.ts.map +1 -1
- package/daemon/dist/domain/community-harness-presets.js +3 -2
- package/daemon/dist/domain/community-harness-presets.js.map +1 -1
- package/daemon/dist/domain/context-monitor.d.ts +2 -2
- package/daemon/dist/domain/context-monitor.d.ts.map +1 -1
- package/daemon/dist/domain/context-monitor.js +8 -2
- package/daemon/dist/domain/context-monitor.js.map +1 -1
- package/daemon/dist/domain/desired-claude-activity-hooks.d.ts +21 -0
- package/daemon/dist/domain/desired-claude-activity-hooks.d.ts.map +1 -0
- package/daemon/dist/domain/desired-claude-activity-hooks.js +30 -0
- package/daemon/dist/domain/desired-claude-activity-hooks.js.map +1 -0
- package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/draft-aware-delivery.js +6 -2
- package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
- package/daemon/dist/domain/environment-artifacts.d.ts +49 -0
- package/daemon/dist/domain/environment-artifacts.d.ts.map +1 -0
- package/daemon/dist/domain/environment-artifacts.js +158 -0
- package/daemon/dist/domain/environment-artifacts.js.map +1 -0
- package/daemon/dist/domain/environment-lifecycle.d.ts +119 -0
- package/daemon/dist/domain/environment-lifecycle.d.ts.map +1 -0
- package/daemon/dist/domain/environment-lifecycle.js +461 -0
- package/daemon/dist/domain/environment-lifecycle.js.map +1 -0
- package/daemon/dist/domain/environment-platform.d.ts +121 -0
- package/daemon/dist/domain/environment-platform.d.ts.map +1 -0
- package/daemon/dist/domain/environment-platform.js +280 -0
- package/daemon/dist/domain/environment-platform.js.map +1 -0
- package/daemon/dist/domain/environment-startup.d.ts +41 -0
- package/daemon/dist/domain/environment-startup.d.ts.map +1 -0
- package/daemon/dist/domain/environment-startup.js +281 -0
- package/daemon/dist/domain/environment-startup.js.map +1 -0
- package/daemon/dist/domain/expected-conversation.d.ts +20 -0
- package/daemon/dist/domain/expected-conversation.d.ts.map +1 -0
- package/daemon/dist/domain/expected-conversation.js +101 -0
- package/daemon/dist/domain/expected-conversation.js.map +1 -0
- package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts +8 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.js +61 -4
- package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.d.ts +2 -0
- package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.js +40 -8
- package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +16 -0
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +216 -7
- package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts +14 -0
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.js +9 -1
- package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.js +9 -4
- package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts +2 -0
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js +6 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
- package/daemon/dist/domain/hosts/hosts-registry-writer.d.ts +22 -0
- package/daemon/dist/domain/hosts/hosts-registry-writer.d.ts.map +1 -1
- package/daemon/dist/domain/hosts/hosts-registry-writer.js +116 -0
- package/daemon/dist/domain/hosts/hosts-registry-writer.js.map +1 -1
- package/daemon/dist/domain/kernel-hook-review.d.ts +16 -0
- package/daemon/dist/domain/kernel-hook-review.d.ts.map +1 -0
- package/daemon/dist/domain/kernel-hook-review.js +49 -0
- package/daemon/dist/domain/kernel-hook-review.js.map +1 -0
- package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +3 -0
- 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 +20 -5
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
- package/daemon/dist/domain/model-divergence/current-generation-record.d.ts.map +1 -1
- package/daemon/dist/domain/model-divergence/current-generation-record.js +10 -6
- package/daemon/dist/domain/model-divergence/current-generation-record.js.map +1 -1
- package/daemon/dist/domain/native-process-lineage.d.ts +3 -0
- package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
- package/daemon/dist/domain/native-process-lineage.js +51 -2
- package/daemon/dist/domain/native-process-lineage.js.map +1 -1
- package/daemon/dist/domain/native-resume-probe.d.ts +2 -1
- package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
- package/daemon/dist/domain/native-resume-probe.js +4 -2
- package/daemon/dist/domain/native-resume-probe.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +18 -8
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/node-launcher.d.ts +3 -0
- package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/node-launcher.js +6 -0
- package/daemon/dist/domain/node-launcher.js.map +1 -1
- package/daemon/dist/domain/outbox-handler.d.ts +12 -0
- package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
- package/daemon/dist/domain/outbox-handler.js +32 -3
- package/daemon/dist/domain/outbox-handler.js.map +1 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.d.ts +10 -0
- package/daemon/dist/domain/policies/parked-owner-consumer.d.ts.map +1 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.js +60 -4
- package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
- package/daemon/dist/domain/provider/claude-seat-switch.d.ts +9 -3
- package/daemon/dist/domain/provider/claude-seat-switch.d.ts.map +1 -1
- package/daemon/dist/domain/provider/claude-seat-switch.js +100 -17
- package/daemon/dist/domain/provider/claude-seat-switch.js.map +1 -1
- package/daemon/dist/domain/provider/provider-service-impl.js +1 -1
- package/daemon/dist/domain/provider/provider-service-impl.js.map +1 -1
- package/daemon/dist/domain/provider/provider-service.d.ts +32 -2
- package/daemon/dist/domain/provider/provider-service.d.ts.map +1 -1
- package/daemon/dist/domain/provider/provider-types.d.ts +1 -1
- package/daemon/dist/domain/provider/provider-types.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +36 -5
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +155 -37
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +31 -0
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.d.ts +3 -0
- package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +124 -25
- package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
- package/daemon/dist/domain/restore-check-service.d.ts +2 -7
- package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
- package/daemon/dist/domain/restore-check-service.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +35 -3
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +166 -21
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.d.ts +2 -1
- package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.js +20 -6
- package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
- package/daemon/dist/domain/rig-expansion-service.js +1 -1
- package/daemon/dist/domain/rig-expansion-service.js.map +1 -1
- package/daemon/dist/domain/rig-repository.d.ts +10 -0
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +37 -0
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-codec.js +4 -0
- package/daemon/dist/domain/rigspec-codec.js.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.d.ts +8 -0
- package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.js +60 -2
- package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +19 -4
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-schema.js +24 -1
- package/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/daemon/dist/domain/runner-permissions.d.ts +135 -0
- package/daemon/dist/domain/runner-permissions.d.ts.map +1 -0
- package/daemon/dist/domain/runner-permissions.js +318 -0
- package/daemon/dist/domain/runner-permissions.js.map +1 -0
- package/daemon/dist/domain/runtime-adapter.d.ts +10 -0
- package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-adapter.js.map +1 -1
- package/daemon/dist/domain/seat-effort.d.ts +6 -0
- package/daemon/dist/domain/seat-effort.d.ts.map +1 -1
- package/daemon/dist/domain/seat-effort.js +0 -2
- package/daemon/dist/domain/seat-effort.js.map +1 -1
- package/daemon/dist/domain/seat-handover-planner.js +1 -1
- package/daemon/dist/domain/seat-handover-planner.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts +2 -0
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +45 -28
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +24 -2
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +62 -1
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.js +6 -1
- package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.js +4 -0
- package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
- package/daemon/dist/domain/seat-skill-storage.d.ts +6 -4
- package/daemon/dist/domain/seat-skill-storage.d.ts.map +1 -1
- package/daemon/dist/domain/seat-skill-storage.js +25 -5
- package/daemon/dist/domain/seat-skill-storage.js.map +1 -1
- package/daemon/dist/domain/seat-status-service.d.ts +5 -0
- package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-status-service.js +9 -0
- package/daemon/dist/domain/seat-status-service.js.map +1 -1
- package/daemon/dist/domain/self-attach-service.d.ts +8 -1
- package/daemon/dist/domain/self-attach-service.d.ts.map +1 -1
- package/daemon/dist/domain/self-attach-service.js +26 -0
- package/daemon/dist/domain/self-attach-service.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +12 -0
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +127 -11
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
- package/daemon/dist/domain/snapshot-capture.js +14 -0
- package/daemon/dist/domain/snapshot-capture.js.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +32 -1
- package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts +1 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +1 -0
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-follow-view.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-follow-view.js +22 -4
- package/daemon/dist/domain/terminal/herdr-follow-view.js.map +1 -1
- package/daemon/dist/domain/terminal/scope-task-terminal-view.d.ts +12 -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 +120 -18
- package/daemon/dist/domain/terminal/scope-task-terminal-view.js.map +1 -1
- package/daemon/dist/domain/terminal/terminal-following.js +1 -1
- package/daemon/dist/domain/terminal/terminal-following.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 -2
- package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.js +18 -27
- package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
- package/daemon/dist/domain/terminal/view-composer.d.ts +6 -3
- package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/view-composer.js +15 -5
- package/daemon/dist/domain/terminal/view-composer.js.map +1 -1
- package/daemon/dist/domain/tmux-server-selection.d.ts +47 -0
- package/daemon/dist/domain/tmux-server-selection.d.ts.map +1 -0
- package/daemon/dist/domain/tmux-server-selection.js +220 -0
- package/daemon/dist/domain/tmux-server-selection.js.map +1 -0
- package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
- package/daemon/dist/domain/transcript-store.js +8 -5
- package/daemon/dist/domain/transcript-store.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +38 -0
- package/daemon/dist/domain/types.d.ts.map +1 -1
- 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 +3 -1
- 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 +9 -0
- package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.d.ts +1 -0
- package/daemon/dist/domain/watchdog-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.js +15 -3
- package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts +2 -0
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +3 -1
- package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
- package/daemon/dist/domain/workflow-runtime.d.ts +1 -1
- package/daemon/dist/index.d.ts +4 -0
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +14 -0
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/routes/activity.d.ts +4 -0
- package/daemon/dist/routes/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +275 -18
- package/daemon/dist/routes/activity.js.map +1 -1
- package/daemon/dist/routes/compaction.js +8 -2
- package/daemon/dist/routes/compaction.js.map +1 -1
- package/daemon/dist/routes/environments.d.ts +3 -0
- package/daemon/dist/routes/environments.d.ts.map +1 -0
- package/daemon/dist/routes/environments.js +104 -0
- package/daemon/dist/routes/environments.js.map +1 -0
- package/daemon/dist/routes/hosts.d.ts.map +1 -1
- package/daemon/dist/routes/hosts.js +80 -4
- package/daemon/dist/routes/hosts.js.map +1 -1
- package/daemon/dist/routes/provider.d.ts.map +1 -1
- package/daemon/dist/routes/provider.js +53 -7
- package/daemon/dist/routes/provider.js.map +1 -1
- package/daemon/dist/routes/restore-check.d.ts.map +1 -1
- package/daemon/dist/routes/restore-check.js +5 -19
- package/daemon/dist/routes/restore-check.js.map +1 -1
- package/daemon/dist/routes/rigs.js +3 -0
- package/daemon/dist/routes/rigs.js.map +1 -1
- package/daemon/dist/routes/rigspec.d.ts.map +1 -1
- package/daemon/dist/routes/rigspec.js +8 -3
- package/daemon/dist/routes/rigspec.js.map +1 -1
- package/daemon/dist/routes/seat.d.ts.map +1 -1
- package/daemon/dist/routes/seat.js +29 -2
- 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 +66 -20
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/transport.d.ts.map +1 -1
- package/daemon/dist/routes/transport.js +23 -2
- package/daemon/dist/routes/transport.js.map +1 -1
- package/daemon/dist/server.d.ts +6 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +56 -1
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts +2 -0
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +61 -26
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/agent-startup-guide.md +4 -0
- package/daemon/docs/reference/author-contracts.md +6 -6
- package/daemon/docs/reference/community-harness-examples/dsh/README.md +71 -0
- package/daemon/docs/reference/community-harness-examples/dsh/dsh.yaml +20 -0
- package/daemon/docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs +543 -0
- package/daemon/docs/reference/community-harness-examples/openshell/README.md +5 -0
- package/daemon/docs/reference/community-harness-presets.md +25 -1
- package/daemon/docs/reference/execution-platform-contract.md +1 -1
- package/daemon/docs/reference/getting-started.md +8 -3
- package/daemon/docs/reference/harness-runner-contract.md +151 -16
- package/daemon/docs/reference/pi-tool-selection-recovery.md +83 -0
- package/daemon/docs/reference/quickstart.md +1 -1
- package/daemon/docs/reference/rig-spec.md +69 -12
- package/daemon/docs/reference/runner-conformance/README.md +75 -0
- package/daemon/docs/reference/runner-conformance/check-runner.mjs +698 -0
- package/daemon/docs/reference/runner-conformance/fake-acp-agent.mjs +143 -0
- package/daemon/docs/reference/terminal-sessions.md +85 -9
- package/daemon/docs/reference/tmux-servers.md +166 -0
- package/daemon/docs/reference/whats-new.md +162 -10
- package/dist/acp/connector.d.ts.map +1 -1
- package/dist/acp/connector.js +6 -1
- package/dist/acp/connector.js.map +1 -1
- package/dist/build-info.js +3 -3
- package/dist/client.d.ts +3 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +28 -0
- package/dist/client.js.map +1 -1
- package/dist/commands/attach.d.ts +1 -0
- package/dist/commands/attach.d.ts.map +1 -1
- package/dist/commands/attach.js +8 -2
- package/dist/commands/attach.js.map +1 -1
- package/dist/commands/compact.d.ts.map +1 -1
- package/dist/commands/compact.js +7 -4
- package/dist/commands/compact.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +8 -3
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +7 -1
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/destroy.d.ts.map +1 -1
- package/dist/commands/destroy.js +2 -0
- package/dist/commands/destroy.js.map +1 -1
- package/dist/commands/doctor.d.ts +8 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +79 -5
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/env.js +1 -1
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/environment.d.ts +8 -0
- package/dist/commands/environment.d.ts.map +1 -0
- package/dist/commands/environment.js +194 -0
- package/dist/commands/environment.js.map +1 -0
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +5 -2
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/host.d.ts.map +1 -1
- package/dist/commands/host.js +77 -7
- package/dist/commands/host.js.map +1 -1
- package/dist/commands/provider.d.ts.map +1 -1
- package/dist/commands/provider.js +2 -0
- package/dist/commands/provider.js.map +1 -1
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +12 -2
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +54 -4
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +18 -0
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/terminal.d.ts +2 -0
- package/dist/commands/terminal.d.ts.map +1 -1
- package/dist/commands/terminal.js +31 -2
- package/dist/commands/terminal.js.map +1 -1
- package/dist/commands/tui.d.ts +3 -2
- package/dist/commands/tui.d.ts.map +1 -1
- package/dist/commands/tui.js.map +1 -1
- package/dist/config-store.d.ts +3 -1
- package/dist/config-store.d.ts.map +1 -1
- package/dist/config-store.js +10 -0
- package/dist/config-store.js.map +1 -1
- package/dist/cross-host-target.d.ts.map +1 -1
- package/dist/cross-host-target.js +3 -1
- package/dist/cross-host-target.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts +6 -0
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +66 -4
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/daemon-reachability.d.ts +2 -1
- package/dist/daemon-reachability.d.ts.map +1 -1
- package/dist/daemon-reachability.js +3 -2
- package/dist/daemon-reachability.js.map +1 -1
- package/dist/destroy-helpers.d.ts +3 -2
- package/dist/destroy-helpers.d.ts.map +1 -1
- package/dist/destroy-helpers.js +6 -3
- package/dist/destroy-helpers.js.map +1 -1
- package/dist/host-bindings.js +1 -1
- package/dist/host-bindings.js.map +1 -1
- package/dist/host-registry.d.ts +22 -0
- package/dist/host-registry.d.ts.map +1 -1
- package/dist/host-registry.js +121 -0
- package/dist/host-registry.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lazy-program.d.ts.map +1 -1
- package/dist/lazy-program.js +1 -0
- package/dist/lazy-program.js.map +1 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +36 -2
- package/dist/mcp-server.js.map +1 -1
- package/dist/openrig-compat.d.ts +1 -1
- package/dist/openrig-compat.d.ts.map +1 -1
- package/dist/openrig-compat.js +2 -2
- package/dist/openrig-compat.js.map +1 -1
- package/dist/shared-tui.d.ts +4 -2
- package/dist/shared-tui.d.ts.map +1 -1
- package/dist/shared-tui.js +4 -11
- package/dist/shared-tui.js.map +1 -1
- package/dist/terminal-window.d.ts.map +1 -1
- package/dist/terminal-window.js +34 -29
- package/dist/terminal-window.js.map +1 -1
- package/dist/tmux-attachment.d.ts +17 -0
- package/dist/tmux-attachment.d.ts.map +1 -0
- package/dist/tmux-attachment.js +89 -0
- package/dist/tmux-attachment.js.map +1 -0
- package/package.json +2 -2
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +8 -3
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +7 -1
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/terminals/terminal-model.d.ts.map +1 -1
- package/tui/dist/terminals/terminal-model.js +2 -1
- package/tui/dist/terminals/terminal-model.js.map +1 -1
- package/ui/dist/assets/{index-CMBgYrS7.js → index-Ch6UxNld.js} +88 -88
- package/ui/dist/index.html +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type AutomaticSeatReplacement } from "./existing-rig-restore.js";
|
|
2
|
+
import { type LaunchEffortSelection } from "./seat-effort.js";
|
|
2
3
|
import type Database from "better-sqlite3";
|
|
3
4
|
import type { RigRepository } from "./rig-repository.js";
|
|
4
5
|
import { type SessionRegistry } from "./session-registry.js";
|
|
@@ -6,7 +7,7 @@ import type { EventBus } from "./event-bus.js";
|
|
|
6
7
|
import type { SnapshotRepository } from "./snapshot-repository.js";
|
|
7
8
|
import type { SnapshotCapture } from "./snapshot-capture.js";
|
|
8
9
|
import type { CheckpointStore } from "./checkpoint-store.js";
|
|
9
|
-
import type
|
|
10
|
+
import { type NodeLauncher } from "./node-launcher.js";
|
|
10
11
|
import type { TmuxAdapter } from "../adapters/tmux.js";
|
|
11
12
|
import type { ClaudeResumeAdapter } from "../adapters/claude-resume.js";
|
|
12
13
|
import type { CodexResumeAdapter } from "../adapters/codex-resume.js";
|
|
@@ -14,8 +15,9 @@ import type { PiResumeAdapter } from "../adapters/pi-resume.js";
|
|
|
14
15
|
import type { OmpResumeAdapter } from "../adapters/omp-resume.js";
|
|
15
16
|
import type { TranscriptStore } from "./transcript-store.js";
|
|
16
17
|
import { type NativeResumeProbeEvidence } from "./native-resume-probe-evidence.js";
|
|
18
|
+
import type { DesiredClaudeActivityHooks } from "./desired-claude-activity-hooks.js";
|
|
17
19
|
import { SettingsStore } from "./user-settings/settings-store.js";
|
|
18
|
-
import type { RestoreOutcome, RestoreRigResult, RestoreNodeResult, SnapshotData, RestoreSnapshotSelection } from "./types.js";
|
|
20
|
+
import type { RestoreOutcome, RestoreRigResult, RestoreNodeResult, SnapshotData, Session, RestoreSnapshotSelection } from "./types.js";
|
|
19
21
|
export type ReconcileNodeResult = {
|
|
20
22
|
ok: true;
|
|
21
23
|
attemptId: number;
|
|
@@ -54,6 +56,9 @@ export declare const NON_RUNNING_LAUNCH_STATUSES: ReadonlySet<string>;
|
|
|
54
56
|
/** True when a restore/launch status means a session is actually running (a real
|
|
55
57
|
* successful launch): resumed / rebuilt / fresh / fresh-primed / operator_recovered. */
|
|
56
58
|
export declare function launchStatusIsRunning(status: string): boolean;
|
|
59
|
+
/** Whether an automatic periodic carry is still the seat's current resumable session when `rig launch` uses it: capture-time
|
|
60
|
+
* eligibility can have expired without another tick, and a conversation a fresh launch retired is never resumed. */
|
|
61
|
+
export declare function periodicCarryIsCurrent(db: Database.Database, rigSessions: readonly Session[], rigId: string, nodeId: string, carried: Session, liveRuntime: string | null | undefined, savedRuntime: string | null | undefined): boolean;
|
|
57
62
|
/** What `rig launch` does for this node from this snapshot without --fresh, read as the restore path reads it: the
|
|
58
63
|
* occupant, then the pre-launch stop-and-ask check, then the resume decision (restoreNodeWithCompensation and the
|
|
59
64
|
* resume step after it). An exited agent's message offers stop-then-launch as a resume only when this says so. */
|
|
@@ -134,6 +139,11 @@ interface RestoreOrchestratorDeps {
|
|
|
134
139
|
freshLaunchAvailable?: (rigId: string, nodeId: string) => boolean;
|
|
135
140
|
/** Where the person's seat-skills line answer is read (default: the OpenRig settings). */
|
|
136
141
|
routerLineSettings?: Pick<SettingsStore, "resolveOne">;
|
|
142
|
+
/** Read-only current authored selection for Claude activity hooks (the
|
|
143
|
+
* restore-check precedent, shared via desired-claude-activity-hooks).
|
|
144
|
+
* Absent in older wiring/tests: the current selection is unknown, so a
|
|
145
|
+
* missing saved marker is reported, never guessed. */
|
|
146
|
+
getDesiredClaudeActivityHooks?: (nodeId: string) => DesiredClaudeActivityHooks;
|
|
137
147
|
}
|
|
138
148
|
export declare class RestoreOrchestrator {
|
|
139
149
|
readonly db: Database.Database;
|
|
@@ -155,6 +165,7 @@ export declare class RestoreOrchestrator {
|
|
|
155
165
|
private freshLaunch;
|
|
156
166
|
private freshLaunchAvailable;
|
|
157
167
|
private routerLineSettings;
|
|
168
|
+
private getDesiredClaudeActivityHooks;
|
|
158
169
|
private appliedLaunchStore;
|
|
159
170
|
constructor(deps: RestoreOrchestratorDeps);
|
|
160
171
|
/** Read-only structural adapter check for a recorded native resume identity.
|
|
@@ -208,7 +219,10 @@ export declare class RestoreOrchestrator {
|
|
|
208
219
|
nonTargetMode?: "unchanged" | "detach_and_hold";
|
|
209
220
|
}): NarrowLaunchResult;
|
|
210
221
|
/** `keepPane`: the seat is running and is relaunched in its own pane (its process ended in place, the pane and scrollback
|
|
211
|
-
* kept) instead of a new session; nothing checks whether it is live first, since that is the point.
|
|
222
|
+
* kept) instead of a new session; nothing checks whether it is live first, since that is the point. `keepEffort`, with
|
|
223
|
+
* `keepPane`: launch with that effort (the running process's own, kept by a provider switch) in place of the seat's
|
|
224
|
+
* saved one, unless the seat has an explicit choice when the launch reads it; it isn't saved as the seat's choice.
|
|
225
|
+
* `onLaunchEffort`, with `keepPane`, hears the effort the launch selected and why, whether or not one was kept. */
|
|
212
226
|
launchSingleNode(rigId: string, logicalId: string, opts?: {
|
|
213
227
|
adapters?: Record<string, import("./runtime-adapter.js").RuntimeAdapter>;
|
|
214
228
|
fsOps?: {
|
|
@@ -216,6 +230,8 @@ export declare class RestoreOrchestrator {
|
|
|
216
230
|
};
|
|
217
231
|
snapshotId?: string;
|
|
218
232
|
keepPane?: boolean;
|
|
233
|
+
keepEffort?: string;
|
|
234
|
+
onLaunchEffort?: (selected: LaunchEffortSelection) => void;
|
|
219
235
|
selectedHistory?: SelectedRestoreHistory;
|
|
220
236
|
}): Promise<NarrowLaunchResult>;
|
|
221
237
|
private launchNodeTargets;
|
|
@@ -239,6 +255,20 @@ export declare class RestoreOrchestrator {
|
|
|
239
255
|
*/
|
|
240
256
|
private restoreNodeWithCompensation;
|
|
241
257
|
private claudeContinuationExecutable;
|
|
258
|
+
/** #1530 — the saved startup context has no `claude_activity_hooks` entry.
|
|
259
|
+
* Re-apply the CURRENT selection as a marker when the current spec selects
|
|
260
|
+
* it. A healed re-apply and an unknown selection are warnings only; a
|
|
261
|
+
* restore gap is recorded only when a known-selected re-apply was skipped,
|
|
262
|
+
* failed, or threw. The marker is presence-only: the adapter reconciles
|
|
263
|
+
* hooks off the entry's existence and reads none of its paths, so no
|
|
264
|
+
* install path is fabricated and the saved context is never rewritten.
|
|
265
|
+
* Unknown selections are warned about, never guessed at. Never blocks
|
|
266
|
+
* the resume. Only absolute `path:` agent refs resolve here; `local:` and
|
|
267
|
+
* `builtin:` refs resolve to unknown (warn, no gap) because no
|
|
268
|
+
* authoritative launch root is retained at restore time. A known selection
|
|
269
|
+
* with no Claude runtime adapter is a gap: the hooks were skipped, not
|
|
270
|
+
* re-applied, and the skip must be reported rather than silent. */
|
|
271
|
+
private restoreCurrentActivityHooks;
|
|
242
272
|
/** A seat that came back running should also have its role, culture and SOP guidance. If its
|
|
243
273
|
* guidance file still lacks a managed block it should hold, the seat keeps its true status (a
|
|
244
274
|
* live resumed session is still running) and the gap is disclosed on the node and in the
|
|
@@ -258,6 +288,8 @@ export declare class RestoreOrchestrator {
|
|
|
258
288
|
private retireProvisionalSession;
|
|
259
289
|
/** The one-seat command a restore reason names for a seat left awaiting a decision. */
|
|
260
290
|
private freshSeatCommand;
|
|
291
|
+
/** The stop a restore reason names first when the rollback kept the seat's pane, so its session is still there. */
|
|
292
|
+
private stopSeatCommand;
|
|
261
293
|
/** Replay the preflight-selected source after launch, keeping native identity and startup checks. */
|
|
262
294
|
private postLaunchRestore;
|
|
263
295
|
/** A native resume is only a full success after the restored terminal is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restore-orchestrator.d.ts","sourceRoot":"","sources":["../../src/domain/restore-orchestrator.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,KAAK,wBAAwB,EAAE,MAAM,2BAA2B,CAAC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C,qFAAqF;YACvE,qBAAqB;IAkCnC,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,gBAAgB;IA2BxB,OAAO,CAAC,kBAAkB;IAiF1B;;;OAGG;YACW,2BAA2B;YA6T3B,4BAA4B;IAc1C;;;;;;;;;;;;wEAYoE;YACtD,2BAA2B;IAmEzC;;;mFAG+E;IAC/E,iGAAiG;IACjG,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,qBAAqB;IA+B7B;;;;;iDAK6C;YAC/B,qBAAqB;IAyBnC;6EACyE;YAC3D,wBAAwB;IAuBtC,uFAAuF;IACvF,OAAO,CAAC,gBAAgB;IAIxB,mHAAmH;IACnH,OAAO,CAAC,eAAe;IAIvB,qGAAqG;YACvF,iBAAiB;IAyjB/B;iFAC6E;YAC/D,kBAAkB;IAoFhC,OAAO,CAAC,oCAAoC;IAa5C;;;;;;;;;;;;OAYG;IACH,6EAA6E;IAC7E,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,aAAa,GAAG,MAAM;IAoDtF;;0GAEsG;IACtG,OAAO,CAAC,SAAS;IASjB;;4DAEwD;IACxD,OAAO,CAAC,gBAAgB;YASV,aAAa;IA2J3B;;;;;;;;;;;;OAYG;IACG,yBAAyB,CAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,mBAAmB,CAAC;IAuK/B,OAAO,CAAC,mBAAmB;CAyB5B"}
|
|
@@ -10,8 +10,10 @@ import { accessSync, constants, existsSync, mkdirSync, readFileSync, realpathSyn
|
|
|
10
10
|
import { isAbsolute, join } from "node:path";
|
|
11
11
|
import { ensureSeatSkillPlugin, hasSeatSkillRecords, rehydrateSeatSkills, seatSkillPaths, seatSkillPathsForNode, seatCatalogKeptNote, seatSkillReplay, writeSeatSkillCatalog, writeSeatSkillRouter, seatRouterKeptNote } from "./seat-skill-storage.js";
|
|
12
12
|
import { NativePermissionStore } from "./native-permission-store.js";
|
|
13
|
+
import { readSeatClaudeMcp } from "./claude-mcp.js";
|
|
13
14
|
import { resolvePermissionPolicyAttachment } from "./permission-policy/policy-ref.js";
|
|
14
15
|
import { claudeResumeRotation } from "./session-registry.js";
|
|
16
|
+
import { NOTHING_STOPPED_LAUNCH_CODES } from "./node-launcher.js";
|
|
15
17
|
import { seatRuntimeHome } from "./seat-runtime-home.js";
|
|
16
18
|
import { readFreshOccupantRelations } from "./fresh-occupant-relation.js";
|
|
17
19
|
import { assessNativeResumeProbe } from "./native-resume-probe.js";
|
|
@@ -34,7 +36,7 @@ const LAUNCH_DEPENDENCY_KINDS = new Set(["delegates_to", "spawned_by"]);
|
|
|
34
36
|
// in the pure leaf module active-occupant.ts, shared with preview, snapshot
|
|
35
37
|
// usability, and lifecycle projection. Imported and re-exported here so the
|
|
36
38
|
// existing export surface and the execution call sites below are unchanged.
|
|
37
|
-
import { resolveActiveSnapshotSession, activeOccupantAmbiguityError, absentSeatResumeHistory, absentSeatResumeHistoryError, freshSeatLaunchCommand } from "./active-occupant.js";
|
|
39
|
+
import { resolveActiveSnapshotSession, activeOccupantAmbiguityError, absentSeatResumeHistory, absentSeatResumeHistoryError, freshSeatLaunchCommand, seatStopCommand } from "./active-occupant.js";
|
|
38
40
|
import { effectiveRestorePolicy, isOrdinaryTerminalSeat, communityLaunchOnlyRestoreReason } from "./restore-policy.js";
|
|
39
41
|
import { communityHarnessOf } from "./built-in-runtimes.js";
|
|
40
42
|
import { communityHarnessStopsRestore } from "./community-harness-presets.js";
|
|
@@ -56,6 +58,10 @@ export function rollupRestoreRigResult(nodes) {
|
|
|
56
58
|
// A seat running without part of its guidance keeps its own status; the rig isn't fully restored.
|
|
57
59
|
if (nodes.some((node) => (node.guidanceGaps?.length ?? 0) > 0))
|
|
58
60
|
return "partially_restored";
|
|
61
|
+
// Same for an unhealed restore gap (e.g. a current-selection re-apply
|
|
62
|
+
// that was skipped, failed, or threw): the seat runs, but the restore was not whole.
|
|
63
|
+
if (nodes.some((node) => (node.restoreGaps?.length ?? 0) > 0))
|
|
64
|
+
return "partially_restored";
|
|
59
65
|
// A fresh launch loses a seat's conversation, except for a terminal seat, which has none.
|
|
60
66
|
const lostConversation = (node) => (node.status === "fresh" || node.status === "fresh-primed") && !node.noConversation;
|
|
61
67
|
if (nodes.some((node) => lostConversation(node) || node.status === "awaiting-decision" || node.status === "failed" || node.status === "attention_required")) {
|
|
@@ -82,6 +88,18 @@ export function launchStatusIsRunning(status) {
|
|
|
82
88
|
function seatFacts(data, nodeId, savedRuntime, currentRuntime) {
|
|
83
89
|
return { savedRuntime, currentRuntime, recordedSessions: data.sessions.filter((session) => session.nodeId === nodeId) };
|
|
84
90
|
}
|
|
91
|
+
/** Whether an automatic periodic carry is still the seat's current resumable session when `rig launch` uses it: capture-time
|
|
92
|
+
* eligibility can have expired without another tick, and a conversation a fresh launch retired is never resumed. */
|
|
93
|
+
export function periodicCarryIsCurrent(db, rigSessions, rigId, nodeId, carried, liveRuntime, savedRuntime) {
|
|
94
|
+
const newest = rigSessions.filter(row => row.nodeId === nodeId)
|
|
95
|
+
.reduce((latest, row) => !latest || row.id > latest.id ? row : latest, null);
|
|
96
|
+
const fresh = readFreshOccupantRelations(db, rigId);
|
|
97
|
+
return !(!absentSeatResumeHistory([carried], nodeId) || !newest || newest.id !== carried.id
|
|
98
|
+
|| newest.restorePolicy !== "resume_if_possible" || newest.status === "superseded"
|
|
99
|
+
|| liveRuntime !== savedRuntime
|
|
100
|
+
|| (!!newest.resumeToken?.trim() && (newest.resumeToken !== carried.resumeToken || newest.resumeType !== carried.resumeType))
|
|
101
|
+
|| (Object.hasOwn(fresh, nodeId) && fresh[nodeId] !== carried.id));
|
|
102
|
+
}
|
|
85
103
|
/** What `rig launch` does for this node from this snapshot without --fresh, read as the restore path reads it: the
|
|
86
104
|
* occupant, then the pre-launch stop-and-ask check, then the resume decision (restoreNodeWithCompensation and the
|
|
87
105
|
* resume step after it). An exited agent's message offers stop-then-launch as a resume only when this says so. */
|
|
@@ -135,6 +153,7 @@ export class RestoreOrchestrator {
|
|
|
135
153
|
freshLaunch;
|
|
136
154
|
freshLaunchAvailable;
|
|
137
155
|
routerLineSettings;
|
|
156
|
+
getDesiredClaudeActivityHooks;
|
|
138
157
|
appliedLaunchStore;
|
|
139
158
|
constructor(deps) {
|
|
140
159
|
if (deps.db !== deps.rigRepo.db) {
|
|
@@ -175,6 +194,7 @@ export class RestoreOrchestrator {
|
|
|
175
194
|
this.listProcesses = deps.listProcesses;
|
|
176
195
|
this.freshLaunch = deps.freshLaunch;
|
|
177
196
|
this.freshLaunchAvailable = deps.freshLaunchAvailable;
|
|
197
|
+
this.getDesiredClaudeActivityHooks = deps.getDesiredClaudeActivityHooks;
|
|
178
198
|
this.routerLineSettings = deps.routerLineSettings;
|
|
179
199
|
this.appliedLaunchStore = new AppliedLaunchObservationStore(deps.db);
|
|
180
200
|
}
|
|
@@ -183,6 +203,8 @@ export class RestoreOrchestrator {
|
|
|
183
203
|
canAttemptRecordedResume(runtime, resumeType, resumeToken) {
|
|
184
204
|
if (typeof resumeToken !== "string" || !resumeToken.trim())
|
|
185
205
|
return false;
|
|
206
|
+
if (runtime === "openshell-claude")
|
|
207
|
+
return resumeType === "community:openshell-claude";
|
|
186
208
|
if (runtime === "codex")
|
|
187
209
|
return resumeType === "codex_id" && this.codexResume.canResume(resumeType, resumeToken);
|
|
188
210
|
if (runtime === "claude-code")
|
|
@@ -426,7 +448,10 @@ export class RestoreOrchestrator {
|
|
|
426
448
|
};
|
|
427
449
|
}
|
|
428
450
|
/** `keepPane`: the seat is running and is relaunched in its own pane (its process ended in place, the pane and scrollback
|
|
429
|
-
* kept) instead of a new session; nothing checks whether it is live first, since that is the point.
|
|
451
|
+
* kept) instead of a new session; nothing checks whether it is live first, since that is the point. `keepEffort`, with
|
|
452
|
+
* `keepPane`: launch with that effort (the running process's own, kept by a provider switch) in place of the seat's
|
|
453
|
+
* saved one, unless the seat has an explicit choice when the launch reads it; it isn't saved as the seat's choice.
|
|
454
|
+
* `onLaunchEffort`, with `keepPane`, hears the effort the launch selected and why, whether or not one was kept. */
|
|
430
455
|
async launchSingleNode(rigId, logicalId, opts) {
|
|
431
456
|
return this.launchNodeTargets(rigId, [logicalId], { ...opts, namedAgent: true, nonTargetMode: "unchanged" });
|
|
432
457
|
}
|
|
@@ -478,7 +503,8 @@ export class RestoreOrchestrator {
|
|
|
478
503
|
return { ok: false, code: "selection_changed", message: "The selected history or seat changed. Refresh the review." };
|
|
479
504
|
}
|
|
480
505
|
if (opts.keepPane) {
|
|
481
|
-
launched.push(await this.restoreNodeWithCompensation({ node }, rigId, snapshot.id, snapshot.data, { adapters: opts.adapters, fsOps: opts.fsOps, keepPane: true, resumePeriodicCarry
|
|
506
|
+
launched.push(await this.restoreNodeWithCompensation({ node }, rigId, snapshot.id, snapshot.data, { adapters: opts.adapters, fsOps: opts.fsOps, keepPane: true, resumePeriodicCarry,
|
|
507
|
+
...(opts.keepEffort ? { keepEffort: opts.keepEffort } : {}), ...(opts.onLaunchEffort ? { onLaunchEffort: opts.onLaunchEffort } : {}) }, subsetWarnings));
|
|
482
508
|
continue;
|
|
483
509
|
}
|
|
484
510
|
// An external CLI's claim has no tmux session to probe; restoreNodeWithCompensation leaves it attached.
|
|
@@ -847,6 +873,9 @@ export class RestoreOrchestrator {
|
|
|
847
873
|
async restoreNodeWithCompensation(entry, rigId, snapshotId, data, opts, warnings, preserveStoppedCurrent = false) {
|
|
848
874
|
// Compare against the live logical target without changing saved post-launch inputs.
|
|
849
875
|
const node = entry.node;
|
|
876
|
+
// Activity-hook restore gaps (#1530) are collected out-of-band: postLaunchRestore
|
|
877
|
+
// has many return points, so they ride alongside `warnings` and are attached below.
|
|
878
|
+
const activityHookGaps = [];
|
|
850
879
|
const liveNode = this.rigRepo.getRig(rigId)?.nodes.find(current => current.logicalId === node.logicalId
|
|
851
880
|
&& (!opts?.selectedHistory || current.id === node.id));
|
|
852
881
|
const nodeId = node.id;
|
|
@@ -891,14 +920,7 @@ export class RestoreOrchestrator {
|
|
|
891
920
|
// The launch lifecycle lease is held here, before any stale-state cleanup
|
|
892
921
|
// or destination registration. Capture-time eligibility can have expired
|
|
893
922
|
// without another tick; never resume a conversation a fresh launch retired.
|
|
894
|
-
|
|
895
|
-
.reduce((latest, row) => !latest || row.id > latest.id ? row : latest, null);
|
|
896
|
-
const fresh = readFreshOccupantRelations(this.db, rigId);
|
|
897
|
-
if (!absentSeatResumeHistory([carried], nodeId) || !newest || newest.id !== carried.id
|
|
898
|
-
|| newest.restorePolicy !== "resume_if_possible" || newest.status === "superseded"
|
|
899
|
-
|| liveNode?.runtime !== node.runtime
|
|
900
|
-
|| (!!newest.resumeToken?.trim() && (newest.resumeToken !== carried.resumeToken || newest.resumeType !== carried.resumeType))
|
|
901
|
-
|| (Object.hasOwn(fresh, nodeId) && fresh[nodeId] !== carried.id)) {
|
|
923
|
+
if (!periodicCarryIsCurrent(this.db, this.sessionRegistry.getSessionsForRig(rigId), rigId, nodeId, carried, liveNode?.runtime, node.runtime)) {
|
|
902
924
|
return { nodeId, logicalId: node.logicalId, status: "awaiting-decision",
|
|
903
925
|
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." };
|
|
904
926
|
}
|
|
@@ -1131,6 +1153,7 @@ export class RestoreOrchestrator {
|
|
|
1131
1153
|
logicalId: node.logicalId,
|
|
1132
1154
|
status: selectedHistory && launchResult.code === "selection_changed_after_creation" ? "attention_required" : "failed",
|
|
1133
1155
|
error: launchResult.message,
|
|
1156
|
+
...(keptPane && NOTHING_STOPPED_LAUNCH_CODES.has(launchResult.code) ? { nothingStopped: true } : {}),
|
|
1134
1157
|
};
|
|
1135
1158
|
}
|
|
1136
1159
|
// Launch succeeded — do NOT compensate on post-launch failures
|
|
@@ -1139,8 +1162,9 @@ export class RestoreOrchestrator {
|
|
|
1139
1162
|
if (launchResult.warnings?.length) {
|
|
1140
1163
|
warnings?.push(...launchResult.warnings);
|
|
1141
1164
|
}
|
|
1142
|
-
const restored = await this.postLaunchRestore(entry, rigId, data, launchResult.sessionName, launchResult, { ...opts, ...(claudeExecutable ? { claudeExecutable } : {}) }, warnings, priorState, seatRehydration, resumeSession);
|
|
1165
|
+
const restored = await this.postLaunchRestore(entry, rigId, data, launchResult.sessionName, launchResult, { ...opts, ...(claudeExecutable ? { claudeExecutable } : {}) }, warnings, priorState, seatRehydration, resumeSession, activityHookGaps);
|
|
1143
1166
|
const checked = { ...this.checkRestoredGuidance(restored, entry.node, rigId, data, warnings),
|
|
1167
|
+
...(activityHookGaps.length > 0 ? { restoreGaps: activityHookGaps } : {}),
|
|
1144
1168
|
...(keptPane ? { launchStarted: true } : {}) };
|
|
1145
1169
|
return selectedHistory ? { ...checked, sourceSessionId: selectedHistory.historySessionId, resultSessionId: launchResult.session.id } : checked;
|
|
1146
1170
|
}
|
|
@@ -1162,6 +1186,82 @@ export class RestoreOrchestrator {
|
|
|
1162
1186
|
return undefined;
|
|
1163
1187
|
}
|
|
1164
1188
|
}
|
|
1189
|
+
/** #1530 — the saved startup context has no `claude_activity_hooks` entry.
|
|
1190
|
+
* Re-apply the CURRENT selection as a marker when the current spec selects
|
|
1191
|
+
* it. A healed re-apply and an unknown selection are warnings only; a
|
|
1192
|
+
* restore gap is recorded only when a known-selected re-apply was skipped,
|
|
1193
|
+
* failed, or threw. The marker is presence-only: the adapter reconciles
|
|
1194
|
+
* hooks off the entry's existence and reads none of its paths, so no
|
|
1195
|
+
* install path is fabricated and the saved context is never rewritten.
|
|
1196
|
+
* Unknown selections are warned about, never guessed at. Never blocks
|
|
1197
|
+
* the resume. Only absolute `path:` agent refs resolve here; `local:` and
|
|
1198
|
+
* `builtin:` refs resolve to unknown (warn, no gap) because no
|
|
1199
|
+
* authoritative launch root is retained at restore time. A known selection
|
|
1200
|
+
* with no Claude runtime adapter is a gap: the hooks were skipped, not
|
|
1201
|
+
* re-applied, and the skip must be reported rather than silent. */
|
|
1202
|
+
async restoreCurrentActivityHooks(node, activityAdapter, launchResult, warnings, activityHookGaps) {
|
|
1203
|
+
let desired;
|
|
1204
|
+
try {
|
|
1205
|
+
desired = this.getDesiredClaudeActivityHooks
|
|
1206
|
+
? this.getDesiredClaudeActivityHooks(node.id)
|
|
1207
|
+
: { status: "unknown", evidence: "Current desired selection metadata is unavailable" };
|
|
1208
|
+
}
|
|
1209
|
+
catch (err) {
|
|
1210
|
+
desired = { status: "unknown", evidence: `Current desired selection metadata could not be read: ${err.message}` };
|
|
1211
|
+
}
|
|
1212
|
+
if (desired.status === "unknown") {
|
|
1213
|
+
const detail = `the current Claude activity-hook selection could not be determined (${desired.evidence}); no hooks were re-applied.`;
|
|
1214
|
+
warnings?.push(`Restore activity hooks: ${node.logicalId}: ${detail}`);
|
|
1215
|
+
// Unknown is a warning only: nothing is known to be missing, so it
|
|
1216
|
+
// must not downgrade the rig to partially_restored.
|
|
1217
|
+
return;
|
|
1218
|
+
}
|
|
1219
|
+
if (!desired.selected)
|
|
1220
|
+
return;
|
|
1221
|
+
if (!activityAdapter) {
|
|
1222
|
+
// The selection was resolved before requiring the adapter: a known
|
|
1223
|
+
// selection with no adapter to project it is a skipped re-apply.
|
|
1224
|
+
const gap = `claude_activity_hooks: the current selection could not be re-applied: no Claude runtime adapter was available.`;
|
|
1225
|
+
warnings?.push(`Restore activity hooks: ${node.logicalId}: the current selection could not be re-applied: no Claude runtime adapter was available.`);
|
|
1226
|
+
activityHookGaps?.push(gap);
|
|
1227
|
+
return;
|
|
1228
|
+
}
|
|
1229
|
+
// Marker-only entry, reconstructed from the current selection: the
|
|
1230
|
+
// adapter ignores every path field for this resource type.
|
|
1231
|
+
const marker = {
|
|
1232
|
+
category: "runtime_resource", resourceType: "claude_activity_hooks", effectiveId: "claude_activity_hooks",
|
|
1233
|
+
sourceSpec: "current-selection", sourcePath: "", resourcePath: "", absolutePath: "",
|
|
1234
|
+
classification: "safe_projection",
|
|
1235
|
+
};
|
|
1236
|
+
try {
|
|
1237
|
+
const result = await activityAdapter.project({
|
|
1238
|
+
runtime: "claude-code", cwd: node.cwd ?? ".", entries: [marker],
|
|
1239
|
+
startup: { files: [], actions: [] }, conflicts: [], noOps: [], diagnostics: [],
|
|
1240
|
+
}, { ...launchResult.binding, cwd: node.cwd ?? "." });
|
|
1241
|
+
warnings?.push(...(result.warnings ?? []));
|
|
1242
|
+
if (result.projected.includes(marker.effectiveId)) {
|
|
1243
|
+
const detail = "saved startup context had no Claude activity-hook selection; the current seat specification selects it, so the current marker was re-applied without replaying startup content.";
|
|
1244
|
+
warnings?.push(`Restore activity hooks: ${detail}`);
|
|
1245
|
+
// A healed re-apply is a warning only: the agent now has its hooks,
|
|
1246
|
+
// so it must not downgrade the rig to partially_restored. A restore
|
|
1247
|
+
// gap is recorded only when the re-apply was skipped, failed, or threw.
|
|
1248
|
+
return;
|
|
1249
|
+
}
|
|
1250
|
+
const detail = [
|
|
1251
|
+
...result.skipped.map((skipped) => `skipped ${skipped}`),
|
|
1252
|
+
...result.failed.map((failure) => failure.error),
|
|
1253
|
+
].join("; ") || "the projection was not reported";
|
|
1254
|
+
const gap = `claude_activity_hooks: the current selection could not be re-applied: ${detail}.`;
|
|
1255
|
+
warnings?.push(`Restore activity hooks: the current selection could not be re-applied: ${detail}.`);
|
|
1256
|
+
activityHookGaps?.push(gap);
|
|
1257
|
+
}
|
|
1258
|
+
catch (error) {
|
|
1259
|
+
// Activity delivery remains best-effort, as on an ordinary fresh launch.
|
|
1260
|
+
const gap = `claude_activity_hooks: the current selection could not be re-applied: ${error.message}.`;
|
|
1261
|
+
warnings?.push(`Restore activity hooks: the current selection could not be re-applied: ${error.message}.`);
|
|
1262
|
+
activityHookGaps?.push(gap);
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1165
1265
|
/** A seat that came back running should also have its role, culture and SOP guidance. If its
|
|
1166
1266
|
* guidance file still lacks a managed block it should hold, the seat keeps its true status (a
|
|
1167
1267
|
* live resumed session is still running) and the gap is disclosed on the node and in the
|
|
@@ -1251,15 +1351,35 @@ export class RestoreOrchestrator {
|
|
|
1251
1351
|
}
|
|
1252
1352
|
catch { /* best-effort */ }
|
|
1253
1353
|
}
|
|
1354
|
+
// The stop awaited. Clear only the binding this lease still holds: a seat another operation rebound meanwhile keeps
|
|
1355
|
+
// its binding. Then rebind the lease to the cleared seat, with no await between, so the fresh launch that follows
|
|
1356
|
+
// under this lease owns it.
|
|
1357
|
+
const guard = this.tmuxAdapter.deliveryGuard;
|
|
1358
|
+
let leased;
|
|
1359
|
+
try {
|
|
1360
|
+
leased = !!guard?.ownsLifecycle(nodeId);
|
|
1361
|
+
}
|
|
1362
|
+
catch (error) {
|
|
1363
|
+
return { ok: false, error: `could not retire provisional session: ${error.message}` };
|
|
1364
|
+
}
|
|
1254
1365
|
this.sessionRegistry.clearBinding(nodeId);
|
|
1366
|
+
if (leased)
|
|
1367
|
+
guard.rebindLifecycle(nodeId);
|
|
1255
1368
|
return { ok: true };
|
|
1256
1369
|
}
|
|
1257
1370
|
/** The one-seat command a restore reason names for a seat left awaiting a decision. */
|
|
1258
1371
|
freshSeatCommand(rigId, data, logicalId) {
|
|
1259
1372
|
return freshSeatLaunchCommand(logicalId, this.rigRepo.getRig(rigId)?.rig.name ?? data.rig.name);
|
|
1260
1373
|
}
|
|
1374
|
+
/** The stop a restore reason names first when the rollback kept the seat's pane, so its session is still there. */
|
|
1375
|
+
stopSeatCommand(rigId, data, logicalId) {
|
|
1376
|
+
return seatStopCommand(logicalId, this.rigRepo.getRig(rigId)?.rig.name ?? data.rig.name);
|
|
1377
|
+
}
|
|
1261
1378
|
/** Replay the preflight-selected source after launch, keeping native identity and startup checks. */
|
|
1262
|
-
async postLaunchRestore(entry, rigId, data, sessionName, launchResult, opts, warnings, priorState, seatRehydration, resumeSource
|
|
1379
|
+
async postLaunchRestore(entry, rigId, data, sessionName, launchResult, opts, warnings, priorState, seatRehydration, resumeSource,
|
|
1380
|
+
/** Collected out-of-band (this method has many return points): activity-hook
|
|
1381
|
+
* restore gaps the caller attaches to the node result as `restoreGaps`. */
|
|
1382
|
+
activityHookGaps) {
|
|
1263
1383
|
const node = entry.node;
|
|
1264
1384
|
// OPR.0.7.0.7: what this restore launches with when the seat has a saved effort choice is decided by the one
|
|
1265
1385
|
// precedence seam (latest wins), which also says so when the snapshot held another value.
|
|
@@ -1271,10 +1391,15 @@ export class RestoreOrchestrator {
|
|
|
1271
1391
|
const liveRow = this.db.prepare(selected
|
|
1272
1392
|
? "SELECT id FROM nodes WHERE id = ? AND rig_id = ? AND logical_id = ?"
|
|
1273
1393
|
: "SELECT id FROM nodes WHERE rig_id = ? AND logical_id = ?").get(...(selected ? [node.id, rigId, node.logicalId] : [rigId, node.logicalId]));
|
|
1274
|
-
const
|
|
1394
|
+
const live = readSeatEffort(this.db, liveRow?.id ?? node.id);
|
|
1395
|
+
// A provider switch's relaunch keeps the effort its seat was running with, unless the seat has an explicit choice
|
|
1396
|
+
// by now: read here, at launch, the latest choice wins. A kept effort isn't saved as the seat's choice.
|
|
1397
|
+
const kept = opts?.keepEffort && !live?.choice ? opts.keepEffort : undefined;
|
|
1398
|
+
const decided = kept ? { effort: kept } : effortPrecedence.restoreLaunchEffort({ snapshot: node, live });
|
|
1275
1399
|
if (decided.warning)
|
|
1276
1400
|
warnings?.push(`Restore: ${node.logicalId}: ${decided.warning}`);
|
|
1277
1401
|
restoreEffort = decided;
|
|
1402
|
+
opts?.onLaunchEffort?.({ effort: decided.effort, source: kept !== undefined ? "kept" : live?.choice ? "seat_choice" : "saved" });
|
|
1278
1403
|
}
|
|
1279
1404
|
return restoreEffort.effort;
|
|
1280
1405
|
};
|
|
@@ -1338,11 +1463,17 @@ export class RestoreOrchestrator {
|
|
|
1338
1463
|
// Restore only the saved activity selection before either native resume path.
|
|
1339
1464
|
// This also heals settings stripped by older restores. The entry is a marker:
|
|
1340
1465
|
// the adapter uses its current relay/manifest, not the old install's path.
|
|
1341
|
-
//
|
|
1466
|
+
// #1530: when the saved context has NO hooks entry, the seat may still
|
|
1467
|
+
// select them now — a context saved before the selection existed says
|
|
1468
|
+
// nothing about the current spec. In that case only, consult the current
|
|
1469
|
+
// selection (the restore-check reader, injected; unknown when absent) and
|
|
1470
|
+
// re-apply the CURRENT marker, marker-only: no profile-wide resolution,
|
|
1471
|
+
// no guidance, skills or startup replay, and the saved context is never
|
|
1472
|
+
// rewritten. A seat whose current spec does not select hooks stays silent.
|
|
1342
1473
|
const activityAdapter = opts?.adapters?.["claude-code"];
|
|
1343
|
-
if (resumeRequested && resumeToken && launchResult && startupCtx?.runtime === "claude-code"
|
|
1474
|
+
if (resumeRequested && resumeToken && launchResult && startupCtx?.runtime === "claude-code") {
|
|
1344
1475
|
const entries = startupCtx.projectionEntries.filter(e => e.category === "runtime_resource" && e.resourceType === "claude_activity_hooks");
|
|
1345
|
-
if (entries.length > 0)
|
|
1476
|
+
if (entries.length > 0 && activityAdapter)
|
|
1346
1477
|
try {
|
|
1347
1478
|
const result = await activityAdapter.project({
|
|
1348
1479
|
runtime: "claude-code", cwd: node.cwd ?? ".",
|
|
@@ -1360,6 +1491,9 @@ export class RestoreOrchestrator {
|
|
|
1360
1491
|
// Activity delivery remains best-effort, as on an ordinary fresh launch.
|
|
1361
1492
|
warnings?.push(`Restore activity hooks: ${error.message}`);
|
|
1362
1493
|
}
|
|
1494
|
+
else if (entries.length === 0) {
|
|
1495
|
+
await this.restoreCurrentActivityHooks(node, activityAdapter, launchResult, warnings, activityHookGaps);
|
|
1496
|
+
}
|
|
1363
1497
|
}
|
|
1364
1498
|
// A narrow exception to the replay containment below: before either native resume path
|
|
1365
1499
|
// starts the harness, put back only the MISSING managed guidance blocks from the saved
|
|
@@ -1518,6 +1652,8 @@ export class RestoreOrchestrator {
|
|
|
1518
1652
|
const replayContained = resumeRequested && !!resumeToken;
|
|
1519
1653
|
const startupRuntime = startupCtx?.runtime ?? node.runtime ?? null;
|
|
1520
1654
|
const startupAdapter = seatAdapter(opts?.adapters, startupRuntime, session?.communityHarness);
|
|
1655
|
+
// New compute has no retained context filesystem. Restore the saved file selection, never conversation actions.
|
|
1656
|
+
const restoreEnvironmentContext = replayContained && !!startupAdapter?.environment && !!data.environmentBindingsByNode?.[node.id];
|
|
1521
1657
|
// A new pod-aware agent needs a startup context to run StartupOrchestrator.
|
|
1522
1658
|
// Do not report a healthy fresh-primed result when that context or adapter
|
|
1523
1659
|
// is missing; the pane would contain only a shell with no runtime process.
|
|
@@ -1584,9 +1720,9 @@ export class RestoreOrchestrator {
|
|
|
1584
1720
|
if (adapter) {
|
|
1585
1721
|
// Prefilter: check which files/entries still exist
|
|
1586
1722
|
const existsFn = opts.fsOps?.exists ?? (() => true);
|
|
1587
|
-
const sourceEntries = replayContained ? [] : startupCtx.projectionEntries.map((e) => reanchorShippedProjectionEntry(e, undefined, existsFn));
|
|
1723
|
+
const sourceEntries = replayContained && !restoreEnvironmentContext ? [] : startupCtx.projectionEntries.map((e) => reanchorShippedProjectionEntry(e, undefined, existsFn));
|
|
1588
1724
|
// #261: recognized built-in startup files follow the running install.
|
|
1589
|
-
const sourceFiles = replayContained ? [] : startupCtx.resolvedStartupFiles.map((f) => reanchorBuiltinStartupFile(f, undefined, undefined, existsFn));
|
|
1725
|
+
const sourceFiles = replayContained && !restoreEnvironmentContext ? [] : startupCtx.resolvedStartupFiles.map((f) => reanchorBuiltinStartupFile(f, undefined, undefined, existsFn));
|
|
1590
1726
|
const sourceActions = replayContained ? [] : startupCtx.startupActions;
|
|
1591
1727
|
const filteredEntries = sourceEntries.filter((e) => {
|
|
1592
1728
|
if (!existsFn(e.absolutePath)) {
|
|
@@ -1641,6 +1777,7 @@ export class RestoreOrchestrator {
|
|
|
1641
1777
|
};
|
|
1642
1778
|
const binding = {
|
|
1643
1779
|
...launchResult.binding,
|
|
1780
|
+
...(data.environmentBindingsByNode?.[node.id] ? { environmentRestore: data.environmentBindingsByNode[node.id] } : {}),
|
|
1644
1781
|
...(opts?.claudeExecutable ? { claudeExecutable: opts.claudeExecutable } : {}),
|
|
1645
1782
|
cwd: node.cwd ?? ".",
|
|
1646
1783
|
codexConfigProfile: this.liveCodexProfile(rigId, node, selected?.nodeId) ?? undefined,
|
|
@@ -1737,11 +1874,16 @@ export class RestoreOrchestrator {
|
|
|
1737
1874
|
if (startupResult.missingConversation) {
|
|
1738
1875
|
if (!await rollbackOwnBlank())
|
|
1739
1876
|
return changedDuringRollback();
|
|
1877
|
+
// The records can't tell a seat that was never used from one whose conversation is elsewhere (a moved
|
|
1878
|
+
// account or folder), so the seat waits for the person who knows, with the steps that start it fresh. A kept
|
|
1879
|
+
// pane leaves the seat's own tmux session at a shell, which the fresh launch won't replace until it's stopped.
|
|
1880
|
+
const fresh = this.freshSeatCommand(rigId, data, node.logicalId);
|
|
1881
|
+
const steps = opts?.keepPane ? `in two steps: ${this.stopSeatCommand(rigId, data, node.logicalId)}, then ${fresh}` : `in one step: ${fresh}`;
|
|
1740
1882
|
return {
|
|
1741
1883
|
nodeId: node.id,
|
|
1742
1884
|
logicalId: node.logicalId,
|
|
1743
1885
|
status: "awaiting-decision",
|
|
1744
|
-
error: `Original session unresumable: ${startupResult.errors.join("; ")}. The blank session was rolled back; no session is running.
|
|
1886
|
+
error: `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.`,
|
|
1745
1887
|
};
|
|
1746
1888
|
}
|
|
1747
1889
|
return {
|
|
@@ -1990,6 +2132,7 @@ export class RestoreOrchestrator {
|
|
|
1990
2132
|
let kernelAuthority = false;
|
|
1991
2133
|
let teamPermissionDefault = false;
|
|
1992
2134
|
let claudePermissions;
|
|
2135
|
+
let claudeMcp;
|
|
1993
2136
|
let codexPermissions;
|
|
1994
2137
|
let permissionMode;
|
|
1995
2138
|
try {
|
|
@@ -1999,6 +2142,7 @@ export class RestoreOrchestrator {
|
|
|
1999
2142
|
kernelAuthority = override.kernelAuthority === true;
|
|
2000
2143
|
teamPermissionDefault = override.teamPermissionDefault === true;
|
|
2001
2144
|
claudePermissions = override.claudePermissions;
|
|
2145
|
+
claudeMcp = runtime === "claude-code" ? readSeatClaudeMcp(this.db, nodeId) : undefined;
|
|
2002
2146
|
codexPermissions = override.codexPermissions;
|
|
2003
2147
|
resolvedPosture = override.launchPosture ?? resolvedPosture;
|
|
2004
2148
|
permissionMode = override.permissionMode ?? (resolvedPosture === "auto" && runtime === "claude-code" ? "auto" : undefined);
|
|
@@ -2024,9 +2168,10 @@ export class RestoreOrchestrator {
|
|
|
2024
2168
|
: launch.additions ? [...claudeTail, ...Array(5 - claudeTail.length).fill(undefined), launch.additions] : claudeTail;
|
|
2025
2169
|
const guardedTail = beforeNative || claudeExecutable ? [...tail, ...Array(Math.max(0, 7 - tail.length)).fill(undefined), beforeNative,
|
|
2026
2170
|
...(claudeExecutable ? [claudeExecutable] : [])] : tail;
|
|
2171
|
+
const mcpTail = claudeMcp === undefined ? guardedTail : [...guardedTail, ...Array(Math.max(0, 9 - guardedTail.length)).fill(undefined), claudeMcp];
|
|
2027
2172
|
if (beforeNative && !beforeNative())
|
|
2028
2173
|
return { kind: "attention_required", message: "The selected seat, settings or history changed during native preparation; resume was not dispatched." };
|
|
2029
|
-
const result = await this.claudeResume.resume(sessionName, resumeType, resumeToken, cwd, resolvedPosture, model, permissionMode, nodeId, ...
|
|
2174
|
+
const result = await this.claudeResume.resume(sessionName, resumeType, resumeToken, cwd, resolvedPosture, model, permissionMode, nodeId, ...mcpTail);
|
|
2030
2175
|
if (result.ok) {
|
|
2031
2176
|
// OPR.0.7.0.9: the resumed conversation's own start, as on the pod-aware path.
|
|
2032
2177
|
const promptNote = launch.additions?.appendSystemPromptFile && nodeId && resumeToken ? systemPromptPendingNoteForNode(this.db, nodeId, resumeToken) : undefined;
|