@openrig/cli 0.7.23 → 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/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 +37 -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 +7 -8
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +45 -5
- 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 +163 -23
- package/daemon/assets/skills/rigs/SKILL.md +122 -21
- 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 +113 -12
- package/daemon/context-packs/reference/acp-agents.md +9 -2
- package/daemon/context-packs/reference/getting-started.md +31 -7
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +8 -0
- package/daemon/context-packs/reference/tmux-servers.md +16 -0
- package/daemon/context-packs/reference/whats-new.md +106 -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 +7 -8
- package/daemon/context-packs/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +45 -5
- package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/messaging-the-human/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/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 +163 -23
- 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 +10 -1
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +231 -33
- 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 +59 -21
- 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 +53 -16
- 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/tmux.d.ts +52 -9
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +102 -19
- 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 +3 -0
- package/daemon/dist/daemon-shutdown.d.ts.map +1 -1
- package/daemon/dist/daemon-shutdown.js +5 -0
- 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 +8 -0
- package/daemon/dist/db/all-migrations.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/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/agent-manifest.d.ts.map +1 -1
- package/daemon/dist/domain/agent-manifest.js +8 -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 +16 -6
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +13 -8
- 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/current-work.d.ts +31 -4
- package/daemon/dist/domain/current-work.d.ts.map +1 -1
- package/daemon/dist/domain/current-work.js +48 -3
- package/daemon/dist/domain/current-work.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 +4 -1
- package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +3 -0
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +3 -2
- 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 +2 -0
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.js +1 -0
- package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +10 -2
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.js +60 -6
- 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/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.map +1 -1
- package/daemon/dist/domain/hosts/read-through.js +6 -0
- package/daemon/dist/domain/hosts/read-through.js.map +1 -1
- 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-write-contract.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js +21 -4
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
- package/daemon/dist/domain/native-resume-probe.d.ts +22 -0
- package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
- package/daemon/dist/domain/native-resume-probe.js +30 -0
- package/daemon/dist/domain/native-resume-probe.js.map +1 -1
- package/daemon/dist/domain/network/network-requests.d.ts +3 -2
- package/daemon/dist/domain/network/network-requests.d.ts.map +1 -1
- package/daemon/dist/domain/network/network-requests.js +34 -8
- package/daemon/dist/domain/network/network-requests.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/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/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/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.js +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +20 -1
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +93 -14
- package/daemon/dist/domain/queue-repository.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 +618 -13
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/queue-transfer-export.d.ts +1 -1
- package/daemon/dist/domain/queue-transfer-export.d.ts.map +1 -1
- package/daemon/dist/domain/queue-transfer-export.js +3 -1
- package/daemon/dist/domain/queue-transfer-export.js.map +1 -1
- 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.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +20 -4
- package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
- 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/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 +3 -0
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +42 -0
- 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 +23 -2
- 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-teardown.d.ts +30 -2
- package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
- package/daemon/dist/domain/rig-teardown.js +76 -8
- package/daemon/dist/domain/rig-teardown.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts +11 -9
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +100 -43
- 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/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/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-attention-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.js +5 -2
- package/daemon/dist/domain/seat-attention-reconciler.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 +18 -0
- package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.js +155 -6
- package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.d.ts +6 -0
- package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.js +28 -4
- package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +37 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +44 -8
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-pool-executor.d.ts +61 -3
- package/daemon/dist/domain/seat-pool-executor.d.ts.map +1 -1
- package/daemon/dist/domain/seat-pool-executor.js +735 -59
- package/daemon/dist/domain/seat-pool-executor.js.map +1 -1
- package/daemon/dist/domain/seat-pool-slots.d.ts +24 -0
- package/daemon/dist/domain/seat-pool-slots.d.ts.map +1 -1
- package/daemon/dist/domain/seat-pool-slots.js +50 -0
- package/daemon/dist/domain/seat-pool-slots.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-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +9 -2
- 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/startup-orchestrator.d.ts +5 -1
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +43 -7
- package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/daemon/dist/domain/startup-submission-evidence.d.ts +1 -0
- package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
- package/daemon/dist/domain/startup-submission-evidence.js +5 -0
- 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/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/tile-attach.d.ts +11 -5
- package/daemon/dist/domain/terminal/tile-attach.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/tile-attach.js +32 -12
- package/daemon/dist/domain/terminal/tile-attach.js.map +1 -1
- 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/types.d.ts +7 -1
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js +3 -0
- package/daemon/dist/domain/types.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-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-runtime.d.ts +2 -0
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +45 -2
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/routes/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +59 -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 +26 -9
- package/daemon/dist/routes/compaction.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +64 -25
- 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 +51 -5
- package/daemon/dist/routes/require-sender-identity.js.map +1 -1
- package/daemon/dist/routes/seat.js +6 -0
- package/daemon/dist/routes/seat.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/workflow.d.ts.map +1 -1
- package/daemon/dist/routes/workflow.js +48 -41
- package/daemon/dist/routes/workflow.js.map +1 -1
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +17 -1
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +34 -6
- package/daemon/dist/startup.js.map +1 -1
- 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 +9 -2
- package/daemon/docs/reference/agent-spec.md +22 -1
- package/daemon/docs/reference/agent-startup-guide.md +10 -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 +57 -0
- package/daemon/docs/reference/developing.md +3 -2
- package/daemon/docs/reference/getting-started.md +31 -7
- package/daemon/docs/reference/harness-runner-contract.md +72 -0
- package/daemon/docs/reference/hosted-members.md +21 -2
- package/daemon/docs/reference/network-connector.md +32 -3
- package/daemon/docs/reference/quickstart.md +4 -4
- package/daemon/docs/reference/refocus-channel.md +48 -0
- package/daemon/docs/reference/rig-bundle.md +11 -1
- package/daemon/docs/reference/rig-spec.md +8 -0
- package/daemon/docs/reference/seat-node-targeting.md +10 -0
- package/daemon/docs/reference/seat-pools.md +76 -10
- package/daemon/docs/reference/slack-app-setup.md +15 -0
- package/daemon/docs/reference/terminal-sessions.md +71 -3
- package/daemon/docs/reference/tmux-servers.md +16 -0
- package/daemon/docs/reference/whats-new.md +106 -12
- 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 +4 -0
- 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/bundle.d.ts.map +1 -1
- package/dist/commands/bundle.js +18 -4
- package/dist/commands/bundle.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/down.d.ts.map +1 -1
- package/dist/commands/down.js +12 -1
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/expand.js +1 -1
- package/dist/commands/expand.js.map +1 -1
- package/dist/commands/fork.js +1 -1
- package/dist/commands/fork.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 +54 -9
- package/dist/commands/network.js.map +1 -1
- package/dist/commands/ps.d.ts +1 -0
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +22 -19
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.d.ts +2 -0
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +29 -6
- 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/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +55 -16
- package/dist/commands/seat.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.map +1 -1
- package/dist/commands/start.js +3 -2
- 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 +22 -2
- package/dist/commands/workflow.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts +24 -0
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +45 -8
- package/dist/daemon-lifecycle.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.js +1 -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/mcp-http.d.ts +1 -1
- package/dist/mcp-http.d.ts.map +1 -1
- package/dist/mcp-http.js +6 -3
- package/dist/mcp-http.js.map +1 -1
- package/dist/mcp-server.d.ts +5 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +111 -13
- package/dist/mcp-server.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/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 +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/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 +40 -25
- 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 +5 -2
- 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.map +1 -1
- package/tui/dist/render.js +6 -5
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { continuationChoiceNotes, resumedClaudeArguments, sentClaudeAutoMode } from "../domain/claude-continuation-launch.js";
|
|
2
|
-
import { withManagedRestoreReads } from "../domain/managed-restore-read-access.js";
|
|
2
|
+
import { compactionPacketLaunchEnv, withManagedRestoreReads } from "../domain/managed-restore-read-access.js";
|
|
3
3
|
import { operationalLaunchArgs } from "./kernel-authority.js";
|
|
4
4
|
import { transportClaudeSettings } from "./claude-settings-transport.js";
|
|
5
5
|
import { claudeMcpArgs } from "../domain/claude-mcp.js";
|
|
@@ -10,16 +10,16 @@ import { createHash, randomUUID } from "node:crypto";
|
|
|
10
10
|
import { WRAPPED_CLAUDE_LOOKUP_REFUSAL } from "../domain/seat-launch-environment.js";
|
|
11
11
|
import { claudePostureFlag, claudeClassicRendererEnvPrefix } from "./yolo-mode.js";
|
|
12
12
|
import { resolveConcreteHint } from "../domain/runtime-adapter.js";
|
|
13
|
-
import { assessNativeResumeProbe, CLAUDE_PROCESS_ONLY_RESUME, claudeTrustPromptDrawing, claudeTrustPromptFocus, hasClaudeDrawnInput } from "../domain/native-resume-probe.js";
|
|
13
|
+
import { assessNativeResumeProbe, CLAUDE_PROCESS_ONLY_RESUME, claudeTrustPromptDrawing, claudeTrustPromptFocus, hasClaudeDrawnInput, noConversationFoundOwner } from "../domain/native-resume-probe.js";
|
|
14
14
|
import { resumeProbeEvidence } from "../domain/native-resume-probe-evidence.js";
|
|
15
15
|
import { resolveReadinessTimeoutMs } from "../domain/readiness-timeout.js";
|
|
16
16
|
import { subtreeNamesClaudeExecutable, claudeCommandSessionToken, listNativeProcesses, listNativeProcessesOrThrow, observeClaudeDelivery, observeClaudePaneProcess, observeClaudePaneRuntime, observeCodexPaneProcess, verifyClaudePaneProcess, verifyCodexPaneProcess, verifyPaneIdleShell } from "../domain/native-process-lineage.js";
|
|
17
17
|
import { isPerSeatRoleGuidance, perSeatRoleSkipWarning, DEFAULT_CLAUDE_MANAGED_BLOCK_FILE } from "../domain/managed-blocks.js";
|
|
18
18
|
import { writeManagedGuidanceBlock } from "../domain/managed-block-records.js";
|
|
19
|
-
import { claudeResumeLaunchEnv, claudeResumeLaunchPrefix } from "./claude-resume-launch.js";
|
|
19
|
+
import { claudeResumeLaunchEnv, claudeResumeLaunchPrefix, commandEnvPrefix } from "./claude-resume-launch.js";
|
|
20
20
|
import { shellQuote, shellWord } from "./shell-quote.js";
|
|
21
21
|
import { validateClaudeActivityHookDelivery, claudeActivityRelayPath, managedClaudeNodeCommand } from "../domain/claude-activity-hooks.js";
|
|
22
|
-
import { isOwnedCollectorCommand, stripOwnedRelayHooks } from "../domain/claude-owned-settings.js";
|
|
22
|
+
import { isOwnedCollectorCommand, removeOwnedClaudeSettings, stripOwnedRelayHooks } from "../domain/claude-owned-settings.js";
|
|
23
23
|
import { throttledStatusLineForLaunch } from "../domain/claude-statusline-throttle.js";
|
|
24
24
|
import { insideMissingFolder, isFilesystemRoot } from "../domain/cwd-resolution.js";
|
|
25
25
|
import { claudeStrictTrustRoot } from "../domain/claude-git-trust-root.js";
|
|
@@ -114,6 +114,7 @@ export class ClaudeCodeAdapter {
|
|
|
114
114
|
/** P20 — called after a projected file is written to a target, so the manifest
|
|
115
115
|
* records what we last wrote (→ operator-vs-stale discrimination). No-op by default. */
|
|
116
116
|
recordProjection;
|
|
117
|
+
readProjectionHash;
|
|
117
118
|
/** #2456: OpenRig's record of what it last wrote in each managed guidance block (startup wires the daemon's). */
|
|
118
119
|
managedBlockRecords;
|
|
119
120
|
constructor(deps) {
|
|
@@ -135,6 +136,7 @@ export class ClaudeCodeAdapter {
|
|
|
135
136
|
this.activityRelayPath = deps.activityRelayPath ?? null;
|
|
136
137
|
this.claudeHooksManifestPath = deps.claudeHooksManifestPath ?? null;
|
|
137
138
|
this.recordProjection = deps.recordProjection ?? (() => { });
|
|
139
|
+
this.readProjectionHash = deps.readProjectionHash ?? (() => null);
|
|
138
140
|
this.managedBlockRecords = deps.managedBlockRecords;
|
|
139
141
|
}
|
|
140
142
|
async listInstalled(binding) {
|
|
@@ -161,7 +163,7 @@ export class ClaudeCodeAdapter {
|
|
|
161
163
|
skipped.push(entry.effectiveId);
|
|
162
164
|
continue;
|
|
163
165
|
}
|
|
164
|
-
const didProject = this.projectEntry(entry, binding
|
|
166
|
+
const didProject = this.projectEntry(entry, binding, warnings, plan.skipUnavailableClaudeFragmentSources);
|
|
165
167
|
if (didProject) {
|
|
166
168
|
projected.push(entry.effectiveId);
|
|
167
169
|
}
|
|
@@ -209,6 +211,87 @@ export class ClaudeCodeAdapter {
|
|
|
209
211
|
}
|
|
210
212
|
return { projected, skipped, failed, ...(warnings.length ? { warnings } : {}) };
|
|
211
213
|
}
|
|
214
|
+
/** Stage every fragment for a target before writing it once. A source that fails must not leave a partial merge. */
|
|
215
|
+
refreshRuntimeFragments(entries, binding) {
|
|
216
|
+
const projected = [];
|
|
217
|
+
const skipped = [];
|
|
218
|
+
const warnings = [];
|
|
219
|
+
for (const type of ["claude_mcp_fragment", "claude_settings_fragment"]) {
|
|
220
|
+
const group = entries.filter(entry => entry.resourceType === type);
|
|
221
|
+
if (group.length === 0)
|
|
222
|
+
continue;
|
|
223
|
+
const ids = group.map(entry => entry.effectiveId);
|
|
224
|
+
const target = claudeFragmentTarget(binding.cwd, type);
|
|
225
|
+
const keep = (why, nextStep = "") => {
|
|
226
|
+
skipped.push(...ids);
|
|
227
|
+
warnings.push(`Claude fragments ${ids.join(", ")} were skipped for ${target}: ${why}. The file was left intact.${nextStep}`);
|
|
228
|
+
};
|
|
229
|
+
if (insideMissingFolder(target, binding.cwd, this.folderPresent)) {
|
|
230
|
+
keep("the seat's working folder is missing");
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
let fragments;
|
|
234
|
+
try {
|
|
235
|
+
fragments = group.map(entry => this.readJsonObjectStrict(entry.absolutePath));
|
|
236
|
+
}
|
|
237
|
+
catch {
|
|
238
|
+
keep("a source was not a readable JSON object");
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
let previous;
|
|
242
|
+
let existing;
|
|
243
|
+
try {
|
|
244
|
+
previous = this.fs.exists(target) ? this.fs.readFile(target) : null;
|
|
245
|
+
const parsed = previous?.trim() ? JSON.parse(previous) : {};
|
|
246
|
+
if (!isPlainObject(parsed))
|
|
247
|
+
throw new Error("Invalid target");
|
|
248
|
+
existing = parsed;
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
keep("the target was not a readable JSON object");
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
const merged = fragments.reduce(mergeJsonObjects, existing);
|
|
255
|
+
const before = fragmentRecordContent(type, existing);
|
|
256
|
+
const after = fragmentRecordContent(type, merged);
|
|
257
|
+
if (previous !== null && before === after) {
|
|
258
|
+
projected.push(...ids);
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
let lastHash;
|
|
262
|
+
try {
|
|
263
|
+
lastHash = this.readProjectionHash(target);
|
|
264
|
+
}
|
|
265
|
+
catch {
|
|
266
|
+
keep("the last projection record couldn't be read");
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
const edited = lastHash !== null && (previous === null || lastHash !== hashContent(before));
|
|
270
|
+
if (edited) {
|
|
271
|
+
keep("local edits differ from the last OpenRig projection");
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
if (lastHash === null && !keepsExistingJson(existing, merged)) {
|
|
275
|
+
keep("OpenRig has no write record and the refresh would replace existing values", " Review the target and source. To apply the spec values, start the seat fresh.");
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
try {
|
|
279
|
+
this.fs.mkdirp(nodePath.dirname(target));
|
|
280
|
+
const content = JSON.stringify(merged, null, 2);
|
|
281
|
+
if (this.fs.replaceFragment)
|
|
282
|
+
this.fs.replaceFragment(target, content, previous, binding.cwd);
|
|
283
|
+
else
|
|
284
|
+
this.fs.writeFile(target, content);
|
|
285
|
+
}
|
|
286
|
+
catch {
|
|
287
|
+
keep("the replacement file couldn't be written safely");
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
projected.push(...ids);
|
|
291
|
+
this.recordFragmentProjection(target, after, warnings);
|
|
292
|
+
}
|
|
293
|
+
return { projected, skipped, failed: [], ...(warnings.length ? { warnings } : {}) };
|
|
294
|
+
}
|
|
212
295
|
async deliverStartup(files, binding, sendInteractiveText) {
|
|
213
296
|
try {
|
|
214
297
|
this.ensureManagedBootstrap(binding);
|
|
@@ -448,14 +531,16 @@ export class ClaudeCodeAdapter {
|
|
|
448
531
|
return { ok: false, error: "claude-code fork: forkSource.value is required (parent native_id)" };
|
|
449
532
|
}
|
|
450
533
|
const forkSessionId = this.sessionIdFactory();
|
|
451
|
-
const
|
|
534
|
+
const forkArgs = permissionArgs(forkSessionId);
|
|
535
|
+
const packetEnv = compactionPacketLaunchEnv(forkArgs, { openrigHome: this.stateDir, nativeSessionId: forkSessionId });
|
|
536
|
+
const launchArgs = transportClaudeSettings(forkArgs, settingsSeat, tokenWarnings, binding.claudeLaunch?.args);
|
|
452
537
|
const permissionMode = permissionArg(launchArgs);
|
|
453
538
|
const cmd = managed ? managed.command(["--permission-mode", binding.permissionMode, ...launchArgs, ...(model ? ["--model", model] : []), ...(effort ? ["--effort", effort] : []), ...(advisor ? ["--advisor", advisor] : []), ...mcpArgs, ...additionArgs,
|
|
454
|
-
"--resume", parentId, "--fork-session", "--session-id", forkSessionId, "--name", opts.name])
|
|
539
|
+
"--resume", parentId, "--fork-session", "--session-id", forkSessionId, "--name", opts.name], packetEnv)
|
|
455
540
|
// The non-managed command text is parsed by the pane shell, so the
|
|
456
541
|
// parent id needs the same quoting as --model/--effort above (and as
|
|
457
542
|
// the codex fork path) — a hostile id must not leave --resume.
|
|
458
|
-
: `${rendererPrefix}${claudeCommand} ${permissionMode}${modelArg}${effortArg}${advisorArg}${mcpArg}${additionArg} --resume ${shellQuote(parentId)} --fork-session --session-id ${forkSessionId} --name ${shellWord(opts.name)}`;
|
|
543
|
+
: `${commandEnvPrefix(packetEnv)}${rendererPrefix}${claudeCommand} ${permissionMode}${modelArg}${effortArg}${advisorArg}${mcpArg}${additionArg} --resume ${shellQuote(parentId)} --fork-session --session-id ${forkSessionId} --name ${shellWord(opts.name)}`;
|
|
459
544
|
const textResult = managed ? await this.tmux.sendShellCommand(binding.tmuxSession, cmd, managed.assertCurrent)
|
|
460
545
|
: await sendClassic(cmd);
|
|
461
546
|
if (!textResult.ok) {
|
|
@@ -474,17 +559,19 @@ export class ClaudeCodeAdapter {
|
|
|
474
559
|
let nativeArgs = resumedClaudeArguments(opts.resumeToken ? binding.claudeLaunch : undefined, ["--permission-mode", binding.permissionMode, ...launchArgs, ...(model ? ["--model", model] : []), ...(effort ? ["--effort", effort] : []), ...(advisor ? ["--advisor", advisor] : []), ...mcpArgs, ...additionArgs,
|
|
475
560
|
...(opts.resumeToken ? ["--resume", opts.resumeToken] : ["--session-id", generatedSessionId]), "--name", opts.name], opts.resumeToken ?? generatedSessionId, effort, posture, autoMode.block ?? null, settingsSeat);
|
|
476
561
|
const sentNative = !!managed || !!(opts.resumeToken && binding.claudeLaunch?.args && binding.claudeExecutable);
|
|
562
|
+
// The packet variable follows the grant this launch sends: a continuation sends the running Claude's arguments.
|
|
563
|
+
const packetEnv = compactionPacketLaunchEnv(sentNative ? nativeArgs : launchArgs, { openrigHome: this.stateDir, nativeSessionId: opts.resumeToken ?? generatedSessionId });
|
|
477
564
|
if (sentNative)
|
|
478
565
|
nativeArgs = transportClaudeSettings(nativeArgs, settingsSeat, tokenWarnings, binding.claudeLaunch?.args);
|
|
479
566
|
else
|
|
480
567
|
launchArgs = transportClaudeSettings(launchArgs, settingsSeat, tokenWarnings, binding.claudeLaunch?.args);
|
|
481
568
|
const permissionMode = permissionArg(launchArgs);
|
|
482
|
-
const cmd = managed ? managed.command(nativeArgs, opts.resumeToken ? claudeResumeLaunchEnv(opts.resumeToken) :
|
|
483
|
-
? `${claudeResumeLaunchPrefix(opts.resumeToken)}${rendererPrefix}${claudeCommand} ${permissionMode}${modelArg}${effortArg}${advisorArg}${mcpArg}${additionArg} --resume ${shellQuote(opts.resumeToken)} --name ${shellWord(opts.name)}`
|
|
484
|
-
: `${rendererPrefix}${claudeCommand} ${permissionMode}${modelArg}${effortArg}${advisorArg}${mcpArg}${additionArg} --session-id ${generatedSessionId} --name ${shellWord(opts.name)}`;
|
|
569
|
+
const cmd = managed ? managed.command(nativeArgs, { ...(opts.resumeToken ? claudeResumeLaunchEnv(opts.resumeToken) : {}), ...packetEnv }) : opts.resumeToken
|
|
570
|
+
? `${claudeResumeLaunchPrefix(opts.resumeToken)}${commandEnvPrefix(packetEnv)}${rendererPrefix}${claudeCommand} ${permissionMode}${modelArg}${effortArg}${advisorArg}${mcpArg}${additionArg} --resume ${shellQuote(opts.resumeToken)} --name ${shellWord(opts.name)}`
|
|
571
|
+
: `${commandEnvPrefix(packetEnv)}${rendererPrefix}${claudeCommand} ${permissionMode}${modelArg}${effortArg}${advisorArg}${mcpArg}${additionArg} --session-id ${generatedSessionId} --name ${shellWord(opts.name)}`;
|
|
485
572
|
const configPrefix = binding.claudeLaunch?.configDir != null && this.seatLaunchEnvironment ? `CLAUDE_CONFIG_DIR=${shellQuote(binding.claudeLaunch.configDir)} ` : "";
|
|
486
573
|
const classicCommand = configPrefix + (opts.resumeToken && binding.claudeLaunch?.args && binding.claudeExecutable
|
|
487
|
-
? `${claudeResumeLaunchPrefix(opts.resumeToken)}exec ${wrapperPrefix}${shellQuote(binding.claudeExecutable)} ${nativeArgs.map(shellQuote).join(" ")}` : cmd);
|
|
574
|
+
? `${claudeResumeLaunchPrefix(opts.resumeToken)}${commandEnvPrefix(packetEnv)}exec ${wrapperPrefix}${shellQuote(binding.claudeExecutable)} ${nativeArgs.map(shellQuote).join(" ")}` : cmd);
|
|
488
575
|
if (!managed && binding.claudeLaunch?.configDir !== undefined && !configPrefix)
|
|
489
576
|
tokenWarnings.push("This classic launch cannot privately apply the captured config selector; ordinary pane selection is used.");
|
|
490
577
|
tokenWarnings.push(...continuationChoiceNotes(binding.claudeLaunch, posture, model));
|
|
@@ -511,7 +598,10 @@ export class ClaudeCodeAdapter {
|
|
|
511
598
|
scriptLaunch: managed?.executableIsScript };
|
|
512
599
|
this.autoLaunches.set(binding.nodeId, launch);
|
|
513
600
|
if (opts.resumeToken) {
|
|
514
|
-
|
|
601
|
+
// A launch sent through sendShellCommand (managed, or classic with the seat's launch environment) went as a staged
|
|
602
|
+
// script, run by the line it typed; that line marks this launch in the pane. One typed inline has none.
|
|
603
|
+
const launchLine = managed || this.seatLaunchEnvironment ? this.tmux.stagedLaunchTypedLine?.(binding.tmuxSession) : undefined;
|
|
604
|
+
const verification = await this.verifyResumeLaunch(binding, launchLine);
|
|
515
605
|
// The process readiness pinned first, if it observed one: the caller records it, not a later read.
|
|
516
606
|
const launchedProcess = launch.process ? { launchedProcess: { ...launch.process } } : {};
|
|
517
607
|
if (!verification.ok)
|
|
@@ -538,7 +628,17 @@ export class ClaudeCodeAdapter {
|
|
|
538
628
|
const listProcesses = options?.observationPass
|
|
539
629
|
? options.observationPass.lister(this.listProcesses ?? listNativeProcessesOrThrow, this.listProcesses ?? listNativeProcesses)
|
|
540
630
|
: this.listProcesses;
|
|
541
|
-
|
|
631
|
+
let historyProbe = await this.assessManagedProbe(binding, paneCommand, paneContent, options, listProcesses);
|
|
632
|
+
// A "No conversation found" above the line that ran the pane's current launch is an earlier launch's (the rule both
|
|
633
|
+
// resume verifiers use), so readiness judges what this launch drew below that line. The tmux adapter keeps that line
|
|
634
|
+
// for whichever adapter staged the launch; with none (an inline launch, or a daemon restart since), the report stands.
|
|
635
|
+
const typedLine = historyProbe.code === "no_conversation_found" ? this.tmux.stagedLaunchTypedLine?.(binding.tmuxSession) : undefined;
|
|
636
|
+
if (typedLine) {
|
|
637
|
+
const report = noConversationFoundOwner(paneContent, { typedLine, unread: this.tmux.stagedLaunchUnread?.(binding.tmuxSession) === true });
|
|
638
|
+
if (report.owner === "earlier" && report.since !== undefined) {
|
|
639
|
+
historyProbe = await this.assessManagedProbe(binding, paneCommand, report.since, options, listProcesses);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
542
642
|
const probe = await this.assessFreshInPlaceProbe(binding, historyProbe);
|
|
543
643
|
// A script-launched Claude reads as `sh` until the script hands over the foreground, so the label alone
|
|
544
644
|
// is not a return to a shell. Say so only for a proven idle shell (the rule Codex's checkReady uses).
|
|
@@ -734,6 +834,10 @@ export class ClaudeCodeAdapter {
|
|
|
734
834
|
async paneReturnedToShell(binding, paneCommand) {
|
|
735
835
|
if (!paneCommand || !SHELL_COMMANDS.has(paneCommand))
|
|
736
836
|
return false;
|
|
837
|
+
// A shell that hasn't read the launch yet (a new pane's shell still running its startup files) holds the terminal
|
|
838
|
+
// with nothing under it exactly as one Claude returned to does. The launch's own script, still there, tells them apart.
|
|
839
|
+
if (binding.tmuxSession && this.tmux.stagedLaunchUnread?.(binding.tmuxSession))
|
|
840
|
+
return false;
|
|
737
841
|
if (!binding.tmuxPane)
|
|
738
842
|
return true;
|
|
739
843
|
const observed = await observeClaudeDelivery({ target: binding.tmuxPane, tmux: this.tmux, listProcesses: this.listProcesses }, { unknownKeepsIdle: false });
|
|
@@ -781,7 +885,7 @@ export class ClaudeCodeAdapter {
|
|
|
781
885
|
return panePid && rows.some(row => row.pid === panePid) && !subtreeNamesClaudeExecutable(rows, panePid)
|
|
782
886
|
? "absent" : "unknown";
|
|
783
887
|
}
|
|
784
|
-
async verifyResumeLaunch(binding) {
|
|
888
|
+
async verifyResumeLaunch(binding, launchLine) {
|
|
785
889
|
const tmuxSession = binding.tmuxSession;
|
|
786
890
|
// A quick window, then a longer one only while the boot is still in progress, as the Codex adapter does it.
|
|
787
891
|
// The longer one is the readiness setting less the quick window, as a number of polls counted from here; it is per
|
|
@@ -796,11 +900,17 @@ export class ClaudeCodeAdapter {
|
|
|
796
900
|
// was confirmed (once: a frame drawn before Claude took the Enter still shows the prompt).
|
|
797
901
|
let trustMoved = false;
|
|
798
902
|
let trustEntered = false;
|
|
903
|
+
// Only a "No conversation found" below this launch's typed line is this launch's (noConversationFoundOwner). An earlier
|
|
904
|
+
// launch's is set aside, and the screen this launch has drawn below that line is judged instead. One that can't be
|
|
905
|
+
// placed (any, while the launch is unread; one whose typed line isn't in view) keeps the wait going like a start in
|
|
906
|
+
// progress, bounded as before.
|
|
907
|
+
const notFoundOwner = (content) => noConversationFoundOwner(content, { typedLine: launchLine, unread: this.tmux.stagedLaunchUnread?.(tmuxSession) === true });
|
|
799
908
|
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
800
909
|
const paneCommand = await this.tmux.getPaneCommand(tmuxSession);
|
|
801
910
|
const paneContent = (await this.tmux.capturePaneContent(tmuxSession, 40)) ?? "";
|
|
802
|
-
|
|
803
|
-
|
|
911
|
+
let probe = await this.assessManagedProbe(binding, paneCommand, paneContent);
|
|
912
|
+
const report = probe.code === "no_conversation_found" ? notFoundOwner(paneContent) : undefined;
|
|
913
|
+
if (report?.owner === "this") {
|
|
804
914
|
return {
|
|
805
915
|
ok: false,
|
|
806
916
|
probe: await resumeProbeEvidence(probe, paneContent, this.tmux, tmuxSession),
|
|
@@ -809,6 +919,11 @@ export class ClaudeCodeAdapter {
|
|
|
809
919
|
missingConversation: true,
|
|
810
920
|
};
|
|
811
921
|
}
|
|
922
|
+
const drawn = report?.owner === "earlier" ? report.since : undefined;
|
|
923
|
+
const screen = drawn ?? paneContent;
|
|
924
|
+
if (drawn !== undefined)
|
|
925
|
+
probe = await this.assessManagedProbe(binding, paneCommand, drawn);
|
|
926
|
+
const heldReport = probe.code === "no_conversation_found";
|
|
812
927
|
// A foreground Claude alone is a running process, not a resumed conversation: keep polling for its screen or its
|
|
813
928
|
// "No conversation found" through the window (and a longer wait, below), and accept it at the final read if that's
|
|
814
929
|
// still all there is.
|
|
@@ -839,11 +954,11 @@ export class ClaudeCodeAdapter {
|
|
|
839
954
|
// On "No, exit" the selection moves down once (the two options wrap: a second Down would go back) and the next
|
|
840
955
|
// polls wait to see the focus on "Yes". A screen with no key to send (another option set, no cursor, a focus
|
|
841
956
|
// that never reaches "Yes") gets no confirmation; in the longer wait it ends at once, as without the auto-drive.
|
|
842
|
-
const focus = claudeTrustPromptFocus(
|
|
957
|
+
const focus = claudeTrustPromptFocus(screen);
|
|
843
958
|
const key = focus === "yes" && !trustEntered ? "Enter" : focus === "no" && !trustMoved ? "Down" : null;
|
|
844
959
|
if (!key) {
|
|
845
960
|
// A prompt still being drawn (its heading, no options yet) keeps the wait, as the gated-grants backstop's does.
|
|
846
|
-
if (slowStart && !trustMoved && !trustEntered && !claudeTrustPromptDrawing(
|
|
961
|
+
if (slowStart && !trustMoved && !trustEntered && !claudeTrustPromptDrawing(screen)) {
|
|
847
962
|
slowStart = false;
|
|
848
963
|
break;
|
|
849
964
|
}
|
|
@@ -864,7 +979,7 @@ export class ClaudeCodeAdapter {
|
|
|
864
979
|
}
|
|
865
980
|
// Only a boot in progress (no verdict, no gate, a label that proves nothing) is worth waiting for; a real
|
|
866
981
|
// gate (login, trust or MCP approval, auto-mode identity) won't clear itself.
|
|
867
|
-
const booting = probe.code === "awaiting_runtime" || probe.code === "returned_to_shell";
|
|
982
|
+
const booting = heldReport || probe.code === "awaiting_runtime" || probe.code === "returned_to_shell";
|
|
868
983
|
// A foreground Claude alone keeps the longer wait going too, to its end, as in the quick window: a resume of a
|
|
869
984
|
// missing conversation is one until it reports that and exits. It isn't a boot for the checks below, so its process
|
|
870
985
|
// label never reads as a ready screen there.
|
|
@@ -875,7 +990,7 @@ export class ClaudeCodeAdapter {
|
|
|
875
990
|
// A start in progress can't have drawn Claude's ready screen. One that has, with its lineage unproven, keeps
|
|
876
991
|
// main's result whenever it draws: at the window's end, or at any poll of the longer wait.
|
|
877
992
|
const looksReady = (attempt === windowAttempts - 1 || slowStart) && booting
|
|
878
|
-
&& assessNativeResumeProbe({ runtime: "claude-code", paneCommand, paneContent,
|
|
993
|
+
&& assessNativeResumeProbe({ runtime: "claude-code", paneCommand, paneContent: screen,
|
|
879
994
|
claudeAutoIdentityVerified: true, claudeResumeIdentityVerified: true }).status === "resumed";
|
|
880
995
|
if (slowStart && looksReady && await this.paneOccupant(binding, true) === "another") {
|
|
881
996
|
slowStart = false;
|
|
@@ -914,7 +1029,13 @@ export class ClaudeCodeAdapter {
|
|
|
914
1029
|
}
|
|
915
1030
|
const finalCommand = await this.tmux.getPaneCommand(tmuxSession);
|
|
916
1031
|
const finalContent = (await this.tmux.capturePaneContent(tmuxSession, 40)) ?? "";
|
|
917
|
-
|
|
1032
|
+
let finalProbe = await this.assessManagedProbe(binding, finalCommand, finalContent);
|
|
1033
|
+
// The last read places a missing-conversation report as the loop does.
|
|
1034
|
+
const finalReport = finalProbe.code === "no_conversation_found" ? notFoundOwner(finalContent) : undefined;
|
|
1035
|
+
const finalDrawn = finalReport?.owner === "earlier" ? finalReport.since : undefined;
|
|
1036
|
+
const finalScreen = finalDrawn ?? finalContent;
|
|
1037
|
+
if (finalDrawn !== undefined)
|
|
1038
|
+
finalProbe = await this.assessManagedProbe(binding, finalCommand, finalDrawn);
|
|
918
1039
|
if (finalProbe.status === "resumed") {
|
|
919
1040
|
return finalProbe.foregroundOnly ? { ok: true, warnings: [CLAUDE_PROCESS_ONLY_RESUME] } : { ok: true };
|
|
920
1041
|
}
|
|
@@ -935,8 +1056,8 @@ export class ClaudeCodeAdapter {
|
|
|
935
1056
|
evidence: finalContent.split("\n").slice(-12).join("\n"),
|
|
936
1057
|
};
|
|
937
1058
|
}
|
|
938
|
-
// The wait can end on the read that first shows
|
|
939
|
-
if (
|
|
1059
|
+
// The wait can end on the read that first shows this launch's missing-conversation report.
|
|
1060
|
+
if (finalReport?.owner === "this") {
|
|
940
1061
|
return {
|
|
941
1062
|
ok: false,
|
|
942
1063
|
probe: probeEvidence,
|
|
@@ -961,8 +1082,9 @@ export class ClaudeCodeAdapter {
|
|
|
961
1082
|
}
|
|
962
1083
|
// The occupant can change after the last check in the loop, so the end of the wait looks once more, with the screen
|
|
963
1084
|
// judged as in the loop: a different occupant (or a ready-looking screen on a readable list) keeps main's result.
|
|
964
|
-
|
|
965
|
-
|
|
1085
|
+
// A report it couldn't place is judged as a start in progress, as in the loop.
|
|
1086
|
+
if (slowStart && (finalProbe.code === "no_conversation_found" || finalProbe.code === "awaiting_runtime" || finalProbe.code === "returned_to_shell")
|
|
1087
|
+
&& await this.paneOccupant(binding, assessNativeResumeProbe({ runtime: "claude-code", paneCommand: finalCommand, paneContent: finalScreen,
|
|
966
1088
|
claudeAutoIdentityVerified: true, claudeResumeIdentityVerified: true }).status === "resumed") !== "another") {
|
|
967
1089
|
// Claude, or the script about to start it, may still be coming up. Keep the launch and its resume token for
|
|
968
1090
|
// a person (or the reconciler) rather than failing a seat that may be running. Never `resumed` from this.
|
|
@@ -979,7 +1101,8 @@ export class ClaudeCodeAdapter {
|
|
|
979
1101
|
/** Copy one selected resource, preserving source modes and recording owned seat-skill files after writing. */
|
|
980
1102
|
/** A folder reads as present unless the filesystem can say it isn't (insideMissingFolder). */
|
|
981
1103
|
folderPresent = (path) => this.fs.folderPresent?.(path) ?? true;
|
|
982
|
-
projectEntry(entry,
|
|
1104
|
+
projectEntry(entry, binding, warnings, skipUnavailableFragmentSource = false) {
|
|
1105
|
+
const { cwd, claudeManagedBlockFile: managedBlockFile = DEFAULT_CLAUDE_MANAGED_BLOCK_FILE, seatSkillsRoot, seatSkillsRefused } = binding;
|
|
983
1106
|
// A seat folder this machine doesn't have isn't recreated to project into it (insideMissingFolder). A skill in the
|
|
984
1107
|
// seat's own skill storage lies outside it and still goes. Activity hooks are reconciled (and reported) by project().
|
|
985
1108
|
if (!(entry.category === "runtime_resource" && entry.resourceType === "claude_activity_hooks")) {
|
|
@@ -991,7 +1114,7 @@ export class ClaudeCodeAdapter {
|
|
|
991
1114
|
}
|
|
992
1115
|
}
|
|
993
1116
|
// A skipped fragment is reported skipped; it never falls through to the generic extensions copy.
|
|
994
|
-
const handled = entry.category === "runtime_resource" ? this.applyRuntimeResource(entry, cwd, warnings) : false;
|
|
1117
|
+
const handled = entry.category === "runtime_resource" ? this.applyRuntimeResource(entry, cwd, warnings, skipUnavailableFragmentSource) : false;
|
|
995
1118
|
if (handled)
|
|
996
1119
|
return handled === true;
|
|
997
1120
|
if (entry.category === "guidance" && entry.mergeStrategy === "managed_block") {
|
|
@@ -1133,12 +1256,11 @@ export class ClaudeCodeAdapter {
|
|
|
1133
1256
|
}
|
|
1134
1257
|
}
|
|
1135
1258
|
/** true when applied, "skipped" when handled but not applied, false when this isn't a resource it handles. */
|
|
1136
|
-
applyRuntimeResource(entry, cwd, warnings) {
|
|
1259
|
+
applyRuntimeResource(entry, cwd, warnings, skipUnavailableFragmentSource) {
|
|
1137
1260
|
switch (entry.resourceType) {
|
|
1138
1261
|
case "claude_settings_fragment":
|
|
1139
|
-
return this.mergeJsonFragment(entry.absolutePath, nodePath.join(cwd, ".claude", "settings.local.json"), warnings) || "skipped";
|
|
1140
1262
|
case "claude_mcp_fragment":
|
|
1141
|
-
return this.mergeJsonFragment(entry.absolutePath,
|
|
1263
|
+
return this.mergeJsonFragment(entry.absolutePath, claudeFragmentTarget(cwd, entry.resourceType), entry.resourceType, warnings, skipUnavailableFragmentSource) || "skipped";
|
|
1142
1264
|
case "claude_activity_hooks":
|
|
1143
1265
|
// Handled (no generic .claude/extensions copy): the relay asset is
|
|
1144
1266
|
// delivered + the settings hooks reconciled by reconcileClaudeActivityHooks
|
|
@@ -1151,8 +1273,17 @@ export class ClaudeCodeAdapter {
|
|
|
1151
1273
|
/** Merge a JSON fragment into a project file. An existing target that can't be read, or isn't a JSON object (it
|
|
1152
1274
|
* doesn't parse, or it holds an array or a single value), belongs to its owner: it's left as it is, nothing is
|
|
1153
1275
|
* merged, and a warning says so. Returns whether the fragment was applied. */
|
|
1154
|
-
mergeJsonFragment(sourcePath, targetPath, warnings) {
|
|
1155
|
-
|
|
1276
|
+
mergeJsonFragment(sourcePath, targetPath, type, warnings, skipUnavailableSource) {
|
|
1277
|
+
let fragment;
|
|
1278
|
+
try {
|
|
1279
|
+
fragment = this.readJsonObjectStrict(sourcePath);
|
|
1280
|
+
}
|
|
1281
|
+
catch (error) {
|
|
1282
|
+
if (!skipUnavailableSource)
|
|
1283
|
+
throw error;
|
|
1284
|
+
warnings.push(`Kept ${targetPath} as it is. The saved Claude fragment source at ${sourcePath} was not a readable JSON object.`);
|
|
1285
|
+
return false;
|
|
1286
|
+
}
|
|
1156
1287
|
// The reasons are fixed text: a parser message can quote the file's content.
|
|
1157
1288
|
const leave = (reason) => {
|
|
1158
1289
|
warnings.push(`Left ${targetPath} as it is: ${reason}. The fragment ${sourcePath} wasn't applied; once the file is fixed, the next fresh launch applies it (resuming or restoring the session doesn't).`);
|
|
@@ -1184,8 +1315,17 @@ export class ClaudeCodeAdapter {
|
|
|
1184
1315
|
const merged = mergeJsonObjects(existing, fragment);
|
|
1185
1316
|
this.fs.mkdirp(nodePath.dirname(targetPath));
|
|
1186
1317
|
this.fs.writeFile(targetPath, JSON.stringify(merged, null, 2));
|
|
1318
|
+
this.recordFragmentProjection(targetPath, fragmentRecordContent(type, merged), warnings);
|
|
1187
1319
|
return true;
|
|
1188
1320
|
}
|
|
1321
|
+
recordFragmentProjection(target, content, warnings) {
|
|
1322
|
+
try {
|
|
1323
|
+
this.recordProjection(target, content);
|
|
1324
|
+
}
|
|
1325
|
+
catch {
|
|
1326
|
+
warnings.push(`Claude fragments for ${target}: OpenRig couldn't save the projection record for the next refresh.`);
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1189
1329
|
/**
|
|
1190
1330
|
* Merge a managed block into the target guidance file. Returns `true` when
|
|
1191
1331
|
* the merge happened, `false` when intentionally skipped (currently only the
|
|
@@ -1519,6 +1659,64 @@ export class ClaudeCodeAdapter {
|
|
|
1519
1659
|
function hashContent(content) {
|
|
1520
1660
|
return createHash("sha256").update(content).digest("hex");
|
|
1521
1661
|
}
|
|
1662
|
+
function claudeFragmentTarget(cwd, type) {
|
|
1663
|
+
return nodePath.resolve(cwd, type === "claude_mcp_fragment" ? ".mcp.json" : ".claude/settings.local.json");
|
|
1664
|
+
}
|
|
1665
|
+
/** Leave the old bytes intact if preparing the replacement fails or the target changed while we prepared it. */
|
|
1666
|
+
export function replaceClaudeFragment(path, content, previous, cwd) {
|
|
1667
|
+
const directory = fs.realpathSync.native(nodePath.dirname(path));
|
|
1668
|
+
const relative = nodePath.relative(fs.realpathSync.native(cwd), directory);
|
|
1669
|
+
if (relative === ".." || relative.startsWith(`..${nodePath.sep}`) || nodePath.isAbsolute(relative)) {
|
|
1670
|
+
throw new Error("Fragment target is outside the seat's working folder");
|
|
1671
|
+
}
|
|
1672
|
+
const target = nodePath.join(directory, nodePath.basename(path));
|
|
1673
|
+
const previousFile = fs.lstatSync(target, { throwIfNoEntry: false });
|
|
1674
|
+
if (previousFile && (!previousFile.isFile() || previousFile.nlink !== 1))
|
|
1675
|
+
throw new Error("Fragment target is not a private regular file");
|
|
1676
|
+
const temporary = nodePath.join(directory, `.openrig-fragment-${randomUUID()}`);
|
|
1677
|
+
const fd = fs.openSync(temporary, "wx", 0o600);
|
|
1678
|
+
try {
|
|
1679
|
+
try {
|
|
1680
|
+
fs.writeFileSync(fd, content, "utf8");
|
|
1681
|
+
if (previousFile)
|
|
1682
|
+
fs.fchmodSync(fd, previousFile.mode & 0o777);
|
|
1683
|
+
}
|
|
1684
|
+
finally {
|
|
1685
|
+
fs.closeSync(fd);
|
|
1686
|
+
}
|
|
1687
|
+
const current = fs.lstatSync(target, { throwIfNoEntry: false });
|
|
1688
|
+
if (previousFile?.dev !== current?.dev || previousFile?.ino !== current?.ino
|
|
1689
|
+
|| (current ? fs.readFileSync(target, "utf8") : null) !== previous) {
|
|
1690
|
+
throw new Error("Fragment target changed before replacement");
|
|
1691
|
+
}
|
|
1692
|
+
// The check and rename are separate operations. An external edit between them can be overwritten.
|
|
1693
|
+
fs.renameSync(temporary, target);
|
|
1694
|
+
}
|
|
1695
|
+
catch (error) {
|
|
1696
|
+
try {
|
|
1697
|
+
fs.rmSync(temporary, { force: true });
|
|
1698
|
+
}
|
|
1699
|
+
catch { /* The original error explains why the refresh failed. */ }
|
|
1700
|
+
throw error;
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
/** These settings are reconciled by launch and removed by down, independently of fragment projection. */
|
|
1704
|
+
function fragmentRecordContent(type, value) {
|
|
1705
|
+
const content = type === "claude_settings_fragment" ? structuredClone(value) : value;
|
|
1706
|
+
if (type === "claude_settings_fragment")
|
|
1707
|
+
removeOwnedClaudeSettings(content);
|
|
1708
|
+
return JSON.stringify(content, (_key, item) => isPlainObject(item) ? Object.fromEntries(Object.keys(item).sort().map(key => [key, item[key]])) : item);
|
|
1709
|
+
}
|
|
1710
|
+
/** With no recorded projection, only add values. An overlapping value is the user's until proven otherwise. */
|
|
1711
|
+
function keepsExistingJson(existing, next) {
|
|
1712
|
+
if (isPlainObject(existing) && isPlainObject(next)) {
|
|
1713
|
+
return Object.entries(existing).every(([key, value]) => Object.hasOwn(next, key) && keepsExistingJson(value, next[key]));
|
|
1714
|
+
}
|
|
1715
|
+
if (Array.isArray(existing) && Array.isArray(next)) {
|
|
1716
|
+
return existing.length <= next.length && existing.every((value, index) => keepsExistingJson(value, next[index]));
|
|
1717
|
+
}
|
|
1718
|
+
return Object.is(existing, next);
|
|
1719
|
+
}
|
|
1522
1720
|
function mergeJsonObjects(base, fragment) {
|
|
1523
1721
|
const merged = { ...base };
|
|
1524
1722
|
for (const [key, value] of Object.entries(fragment)) {
|