@openrig/cli 0.6.13 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -9
- 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 +11 -4
- package/daemon/assets/plugins/openrig-core/hooks/codex.json +6 -6
- package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +13 -1
- package/daemon/assets/plugins/openrig-core/hooks/scripts/codex-hook-trust.cjs +49 -0
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +26 -5
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +9 -2
- package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +3 -2
- package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +24 -0
- package/daemon/assets/plugins/openrig-core/skills/openrig-skills/SKILL.md +2 -2
- package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +39 -21
- package/daemon/assets/plugins/openrig-core/skills/queue-handoff/SKILL.md +10 -4
- package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +12 -32
- package/daemon/assets/skills/rigs/SKILL.md +24 -5
- package/daemon/context-packs/help/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +18 -8
- package/daemon/context-packs/reference/getting-started.md +178 -35
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +1 -1
- package/daemon/context-packs/reference/whats-new.md +126 -100
- 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/SKILL.md +9 -2
- 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/SKILL.md +24 -0
- 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/SKILL.md +2 -2
- 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/SKILL.md +11 -5
- 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/SKILL.md +3 -2
- 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 +39 -21
- 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/SKILL.md +2 -0
- package/daemon/context-packs/skills/pods/development-team/manifest.yaml +3 -1
- package/daemon/context-packs/skills/pods/development-team/references/refactoring.md +11 -0
- 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/SKILL.md +46 -96
- 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/SKILL.md +17 -80
- package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +5 -3
- package/daemon/context-packs/skills/process/verification-before-completion/references/performance-claims.md +12 -0
- package/daemon/context-packs/skills/queue-handoff/SKILL.md +10 -4
- 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 +12 -32
- 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 +6 -2
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +33 -6
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/codex-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-resume.js +2 -7
- package/daemon/dist/adapters/codex-resume.js.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts +68 -2
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +371 -60
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/compose-services-adapter.d.ts +16 -0
- package/daemon/dist/adapters/compose-services-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/compose-services-adapter.js +52 -9
- package/daemon/dist/adapters/compose-services-adapter.js.map +1 -1
- package/daemon/dist/adapters/kernel-authority.d.ts.map +1 -1
- package/daemon/dist/adapters/kernel-authority.js +9 -5
- package/daemon/dist/adapters/kernel-authority.js.map +1 -1
- package/daemon/dist/adapters/pi-runner.d.ts +2 -0
- package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.js +5 -0
- package/daemon/dist/adapters/pi-runner.js.map +1 -1
- package/daemon/dist/adapters/runtime-probe-exec.d.ts +11 -0
- package/daemon/dist/adapters/runtime-probe-exec.d.ts.map +1 -0
- package/daemon/dist/adapters/runtime-probe-exec.js +25 -0
- package/daemon/dist/adapters/runtime-probe-exec.js.map +1 -0
- package/daemon/dist/adapters/stub-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/stub-runner.js +2 -0
- package/daemon/dist/adapters/stub-runner.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +21 -1
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +101 -14
- 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 +12 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/116_queue_item_wake_input_box.d.ts +3 -0
- package/daemon/dist/db/migrations/116_queue_item_wake_input_box.d.ts.map +1 -0
- package/daemon/dist/db/migrations/116_queue_item_wake_input_box.js +8 -0
- package/daemon/dist/db/migrations/116_queue_item_wake_input_box.js.map +1 -0
- package/daemon/dist/db/migrations/118_human_quiet_windows.d.ts +3 -0
- package/daemon/dist/db/migrations/118_human_quiet_windows.d.ts.map +1 -0
- package/daemon/dist/db/migrations/118_human_quiet_windows.js +30 -0
- package/daemon/dist/db/migrations/118_human_quiet_windows.js.map +1 -0
- package/daemon/dist/db/migrations/119_seat_identity_pane_pid.d.ts +3 -0
- package/daemon/dist/db/migrations/119_seat_identity_pane_pid.d.ts.map +1 -0
- package/daemon/dist/db/migrations/119_seat_identity_pane_pid.js +7 -0
- package/daemon/dist/db/migrations/119_seat_identity_pane_pid.js.map +1 -0
- package/daemon/dist/db/migrations/121_rig_startup_layers.d.ts +13 -0
- package/daemon/dist/db/migrations/121_rig_startup_layers.d.ts.map +1 -0
- package/daemon/dist/db/migrations/121_rig_startup_layers.js +17 -0
- package/daemon/dist/db/migrations/121_rig_startup_layers.js.map +1 -0
- package/daemon/dist/db/migrations/122_human_operating_modes.d.ts +3 -0
- package/daemon/dist/db/migrations/122_human_operating_modes.d.ts.map +1 -0
- package/daemon/dist/db/migrations/122_human_operating_modes.js +55 -0
- package/daemon/dist/db/migrations/122_human_operating_modes.js.map +1 -0
- package/daemon/dist/db/migrations/123_queue_delegated_decision.d.ts +3 -0
- package/daemon/dist/db/migrations/123_queue_delegated_decision.d.ts.map +1 -0
- package/daemon/dist/db/migrations/123_queue_delegated_decision.js +10 -0
- package/daemon/dist/db/migrations/123_queue_delegated_decision.js.map +1 -0
- package/daemon/dist/domain/active-occupant.d.ts +5 -3
- package/daemon/dist/domain/active-occupant.d.ts.map +1 -1
- package/daemon/dist/domain/active-occupant.js +2 -2
- package/daemon/dist/domain/active-occupant.js.map +1 -1
- package/daemon/dist/domain/activity-taxonomy.d.ts +16 -1
- package/daemon/dist/domain/activity-taxonomy.d.ts.map +1 -1
- package/daemon/dist/domain/activity-taxonomy.js +21 -0
- package/daemon/dist/domain/activity-taxonomy.js.map +1 -1
- package/daemon/dist/domain/agent-activity-store.d.ts +20 -0
- package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
- package/daemon/dist/domain/agent-activity-store.js +41 -5
- package/daemon/dist/domain/agent-activity-store.js.map +1 -1
- package/daemon/dist/domain/agent-images/evidence-guard.js +3 -3
- package/daemon/dist/domain/agent-images/evidence-guard.js.map +1 -1
- package/daemon/dist/domain/agent-images/resume-token-discovery.d.ts.map +1 -1
- package/daemon/dist/domain/agent-images/resume-token-discovery.js +2 -10
- package/daemon/dist/domain/agent-images/resume-token-discovery.js.map +1 -1
- package/daemon/dist/domain/ask-service.d.ts +1 -0
- package/daemon/dist/domain/ask-service.d.ts.map +1 -1
- package/daemon/dist/domain/ask-service.js +7 -1
- package/daemon/dist/domain/ask-service.js.map +1 -1
- package/daemon/dist/domain/bootstrap-orchestrator.d.ts +2 -0
- package/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/bootstrap-orchestrator.js +5 -6
- package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
- package/daemon/dist/domain/claim-service.d.ts +10 -19
- package/daemon/dist/domain/claim-service.d.ts.map +1 -1
- package/daemon/dist/domain/claim-service.js +90 -0
- package/daemon/dist/domain/claim-service.js.map +1 -1
- package/daemon/dist/domain/classification-sources.d.ts.map +1 -1
- package/daemon/dist/domain/classification-sources.js +2 -0
- package/daemon/dist/domain/classification-sources.js.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +19 -6
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +108 -38
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/claude-core-plugin-env.d.ts +11 -0
- package/daemon/dist/domain/claude-core-plugin-env.d.ts.map +1 -1
- package/daemon/dist/domain/claude-core-plugin-env.js +15 -0
- package/daemon/dist/domain/claude-core-plugin-env.js.map +1 -1
- package/daemon/dist/domain/codex-core-plugin-install.d.ts +41 -0
- package/daemon/dist/domain/codex-core-plugin-install.d.ts.map +1 -0
- package/daemon/dist/domain/codex-core-plugin-install.js +126 -0
- package/daemon/dist/domain/codex-core-plugin-install.js.map +1 -0
- package/daemon/dist/domain/codex-thread-id.d.ts +23 -1
- package/daemon/dist/domain/codex-thread-id.d.ts.map +1 -1
- package/daemon/dist/domain/codex-thread-id.js +58 -17
- package/daemon/dist/domain/codex-thread-id.js.map +1 -1
- package/daemon/dist/domain/context-monitor.d.ts +13 -5
- package/daemon/dist/domain/context-monitor.d.ts.map +1 -1
- package/daemon/dist/domain/context-monitor.js +47 -13
- package/daemon/dist/domain/context-monitor.js.map +1 -1
- package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
- package/daemon/dist/domain/context-usage-store.js +3 -0
- package/daemon/dist/domain/context-usage-store.js.map +1 -1
- package/daemon/dist/domain/current-work.d.ts +18 -0
- package/daemon/dist/domain/current-work.d.ts.map +1 -1
- package/daemon/dist/domain/current-work.js +17 -3
- package/daemon/dist/domain/current-work.js.map +1 -1
- package/daemon/dist/domain/draft-aware-delivery.d.ts +7 -7
- package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/draft-aware-delivery.js +61 -82
- package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
- package/daemon/dist/domain/execution-view.d.ts.map +1 -1
- package/daemon/dist/domain/execution-view.js +2 -1
- package/daemon/dist/domain/execution-view.js.map +1 -1
- package/daemon/dist/domain/existing-rig-restore.d.ts +110 -0
- package/daemon/dist/domain/existing-rig-restore.d.ts.map +1 -0
- package/daemon/dist/domain/existing-rig-restore.js +254 -0
- package/daemon/dist/domain/existing-rig-restore.js.map +1 -0
- package/daemon/dist/domain/fresh-occupant-relation.d.ts.map +1 -1
- package/daemon/dist/domain/fresh-occupant-relation.js +11 -3
- package/daemon/dist/domain/fresh-occupant-relation.js.map +1 -1
- package/daemon/dist/domain/gateway/channel-operations.d.ts +3 -4
- package/daemon/dist/domain/gateway/channel-operations.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/channel-operations.js.map +1 -1
- package/daemon/dist/domain/gateway/connections-projection.d.ts +0 -5
- package/daemon/dist/domain/gateway/connections-projection.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/connections-projection.js +3 -46
- package/daemon/dist/domain/gateway/connections-projection.js.map +1 -1
- package/daemon/dist/domain/gateway/delivery-rules-engine.d.ts +11 -1
- package/daemon/dist/domain/gateway/delivery-rules-engine.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/delivery-rules-engine.js +12 -2
- package/daemon/dist/domain/gateway/delivery-rules-engine.js.map +1 -1
- package/daemon/dist/domain/gateway/dispatch-buffer.d.ts +4 -0
- package/daemon/dist/domain/gateway/dispatch-buffer.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/dispatch-buffer.js +18 -0
- package/daemon/dist/domain/gateway/dispatch-buffer.js.map +1 -1
- package/daemon/dist/domain/gateway/human-mode-account.d.ts +61 -0
- package/daemon/dist/domain/gateway/human-mode-account.d.ts.map +1 -0
- package/daemon/dist/domain/gateway/human-mode-account.js +112 -0
- package/daemon/dist/domain/gateway/human-mode-account.js.map +1 -0
- package/daemon/dist/domain/gateway/human-operating-modes.d.ts +171 -0
- package/daemon/dist/domain/gateway/human-operating-modes.d.ts.map +1 -0
- package/daemon/dist/domain/gateway/human-operating-modes.js +422 -0
- package/daemon/dist/domain/gateway/human-operating-modes.js.map +1 -0
- package/daemon/dist/domain/gateway/human-quiet-windows.d.ts +121 -0
- package/daemon/dist/domain/gateway/human-quiet-windows.d.ts.map +1 -0
- package/daemon/dist/domain/gateway/human-quiet-windows.js +217 -0
- package/daemon/dist/domain/gateway/human-quiet-windows.js.map +1 -0
- package/daemon/dist/domain/gateway/human-registry.d.ts +23 -2
- package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/human-registry.js +67 -5
- package/daemon/dist/domain/gateway/human-registry.js.map +1 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.js +9 -0
- package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.d.ts +10 -2
- package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.js +24 -2
- package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +1 -0
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +5 -1
- package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts +9 -3
- package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/outbound-driver.js +40 -6
- package/daemon/dist/domain/gateway/slack/outbound-driver.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +19 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.js +128 -41
- package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts +3 -2
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js +268 -50
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
- package/daemon/dist/domain/health-passive-ceremony.d.ts +4 -0
- package/daemon/dist/domain/health-passive-ceremony.d.ts.map +1 -1
- package/daemon/dist/domain/health-passive-ceremony.js +34 -4
- package/daemon/dist/domain/health-passive-ceremony.js.map +1 -1
- package/daemon/dist/domain/hosts/hosts-registry-reader.d.ts +3 -1
- package/daemon/dist/domain/hosts/hosts-registry-reader.d.ts.map +1 -1
- package/daemon/dist/domain/hosts/hosts-registry-reader.js +9 -9
- package/daemon/dist/domain/hosts/hosts-registry-reader.js.map +1 -1
- package/daemon/dist/domain/hosts/learned-host-bindings.d.ts +28 -0
- package/daemon/dist/domain/hosts/learned-host-bindings.d.ts.map +1 -0
- package/daemon/dist/domain/hosts/learned-host-bindings.js +77 -0
- package/daemon/dist/domain/hosts/learned-host-bindings.js.map +1 -0
- package/daemon/dist/domain/hot-potato-enforcer.d.ts +7 -5
- package/daemon/dist/domain/hot-potato-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/hot-potato-enforcer.js +19 -10
- package/daemon/dist/domain/hot-potato-enforcer.js.map +1 -1
- package/daemon/dist/domain/human-questions.d.ts +8 -1
- package/daemon/dist/domain/human-questions.d.ts.map +1 -1
- package/daemon/dist/domain/human-questions.js.map +1 -1
- package/daemon/dist/domain/kernel-boot-tracker.d.ts +17 -1
- package/daemon/dist/domain/kernel-boot-tracker.d.ts.map +1 -1
- package/daemon/dist/domain/kernel-boot-tracker.js +44 -3
- package/daemon/dist/domain/kernel-boot-tracker.js.map +1 -1
- package/daemon/dist/domain/kernel-boot.d.ts +21 -0
- package/daemon/dist/domain/kernel-boot.d.ts.map +1 -1
- package/daemon/dist/domain/kernel-boot.js +57 -2
- package/daemon/dist/domain/kernel-boot.js.map +1 -1
- package/daemon/dist/domain/model-divergence/current-generation-record.d.ts +2 -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 +8 -3
- package/daemon/dist/domain/model-divergence/current-generation-record.js.map +1 -1
- package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
- package/daemon/dist/domain/native-process-lineage.js +43 -15
- package/daemon/dist/domain/native-process-lineage.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +26 -12
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/node-launcher.d.ts +5 -3
- package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/node-launcher.js +29 -25
- package/daemon/dist/domain/node-launcher.js.map +1 -1
- package/daemon/dist/domain/outbox-handler.d.ts +3 -5
- package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
- package/daemon/dist/domain/outbox-handler.js +9 -19
- package/daemon/dist/domain/outbox-handler.js.map +1 -1
- package/daemon/dist/domain/park-wake-text.d.ts +11 -0
- package/daemon/dist/domain/park-wake-text.d.ts.map +1 -0
- package/daemon/dist/domain/park-wake-text.js +26 -0
- package/daemon/dist/domain/park-wake-text.js.map +1 -0
- package/daemon/dist/domain/plugin-vendor-service.d.ts +4 -0
- package/daemon/dist/domain/plugin-vendor-service.d.ts.map +1 -1
- package/daemon/dist/domain/plugin-vendor-service.js +29 -6
- package/daemon/dist/domain/plugin-vendor-service.js.map +1 -1
- package/daemon/dist/domain/policies/delivery-digest-flush.d.ts +1 -0
- package/daemon/dist/domain/policies/delivery-digest-flush.d.ts.map +1 -1
- package/daemon/dist/domain/policies/delivery-digest-flush.js +25 -4
- package/daemon/dist/domain/policies/delivery-digest-flush.js.map +1 -1
- package/daemon/dist/domain/policies/mode-scheduled-end.d.ts +37 -0
- package/daemon/dist/domain/policies/mode-scheduled-end.d.ts.map +1 -0
- package/daemon/dist/domain/policies/mode-scheduled-end.js +161 -0
- package/daemon/dist/domain/policies/mode-scheduled-end.js.map +1 -0
- package/daemon/dist/domain/policies/parked-owner-consumer.d.ts +11 -7
- package/daemon/dist/domain/policies/parked-owner-consumer.d.ts.map +1 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.js +82 -113
- package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
- package/daemon/dist/domain/policies/quiet-release.d.ts +109 -0
- package/daemon/dist/domain/policies/quiet-release.d.ts.map +1 -0
- package/daemon/dist/domain/policies/quiet-release.js +213 -0
- package/daemon/dist/domain/policies/quiet-release.js.map +1 -0
- package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
- package/daemon/dist/domain/profile-resolver.js +8 -3
- package/daemon/dist/domain/profile-resolver.js.map +1 -1
- package/daemon/dist/domain/proof/source-watch.js +2 -2
- package/daemon/dist/domain/proof/source-watch.js.map +1 -1
- package/daemon/dist/domain/queue-destination-check.d.ts +6 -0
- package/daemon/dist/domain/queue-destination-check.d.ts.map +1 -0
- package/daemon/dist/domain/queue-destination-check.js +35 -0
- package/daemon/dist/domain/queue-destination-check.js.map +1 -0
- package/daemon/dist/domain/queue-owner.d.ts.map +1 -1
- package/daemon/dist/domain/queue-owner.js +2 -1
- package/daemon/dist/domain/queue-owner.js.map +1 -1
- package/daemon/dist/domain/queue-recovery.d.ts +1 -1
- package/daemon/dist/domain/queue-recovery.d.ts.map +1 -1
- package/daemon/dist/domain/queue-recovery.js +3 -2
- package/daemon/dist/domain/queue-recovery.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +108 -67
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +316 -140
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts +13 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +95 -13
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/queue-transition-log.d.ts +5 -0
- package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
- package/daemon/dist/domain/queue-transition-log.js +25 -8
- package/daemon/dist/domain/queue-transition-log.js.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.d.ts +2 -0
- package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +94 -11
- package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
- package/daemon/dist/domain/quiet-hold-custody.d.ts +24 -0
- package/daemon/dist/domain/quiet-hold-custody.d.ts.map +1 -0
- package/daemon/dist/domain/quiet-hold-custody.js +85 -0
- package/daemon/dist/domain/quiet-hold-custody.js.map +1 -0
- package/daemon/dist/domain/rehydrate-eligibility.d.ts +12 -1
- package/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
- package/daemon/dist/domain/rehydrate-eligibility.js +47 -9
- package/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +11 -0
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +144 -15
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.d.ts +3 -1
- package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.js +30 -13
- package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
- package/daemon/dist/domain/review/gather.d.ts.map +1 -1
- package/daemon/dist/domain/review/gather.js +8 -5
- package/daemon/dist/domain/review/gather.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 +3 -1
- package/daemon/dist/domain/rig-mode/operating-posture.js.map +1 -1
- package/daemon/dist/domain/rig-repository.d.ts +11 -1
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +27 -3
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
- package/daemon/dist/domain/rig-teardown.js +31 -4
- package/daemon/dist/domain/rig-teardown.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts +9 -0
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +59 -28
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-schema.d.ts +5 -0
- package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-schema.js +30 -0
- package/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/daemon/dist/domain/runtime-adapter.d.ts +27 -2
- 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-activity-service.d.ts +18 -3
- package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-activity-service.js +124 -57
- package/daemon/dist/domain/seat-activity-service.js.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.d.ts +8 -1
- package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.js +3 -1
- package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.js +21 -5
- package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts +2 -2
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +28 -2
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.js +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-identity-store.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-store.js +5 -2
- package/daemon/dist/domain/seat-identity-store.js.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.js +17 -1
- package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +4 -0
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.d.ts +33 -14
- package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.js +102 -30
- package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
- package/daemon/dist/domain/self-attach-service.d.ts +3 -2
- package/daemon/dist/domain/self-attach-service.d.ts.map +1 -1
- package/daemon/dist/domain/self-attach-service.js +18 -1
- package/daemon/dist/domain/self-attach-service.js.map +1 -1
- package/daemon/dist/domain/services-readiness.d.ts.map +1 -1
- package/daemon/dist/domain/services-readiness.js +14 -3
- package/daemon/dist/domain/services-readiness.js.map +1 -1
- package/daemon/dist/domain/session-registry.d.ts +45 -0
- package/daemon/dist/domain/session-registry.d.ts.map +1 -1
- package/daemon/dist/domain/session-registry.js +124 -0
- package/daemon/dist/domain/session-registry.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +24 -6
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +58 -41
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/skill-discovery.d.ts +7 -1
- package/daemon/dist/domain/skill-discovery.d.ts.map +1 -1
- package/daemon/dist/domain/skill-discovery.js +41 -7
- package/daemon/dist/domain/skill-discovery.js.map +1 -1
- package/daemon/dist/domain/snapshot-repository.d.ts +1 -0
- package/daemon/dist/domain/snapshot-repository.d.ts.map +1 -1
- package/daemon/dist/domain/snapshot-repository.js +23 -10
- package/daemon/dist/domain/snapshot-repository.js.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.d.ts +21 -3
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +66 -16
- package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/daemon/dist/domain/startup-submission-evidence.d.ts +4 -11
- package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
- package/daemon/dist/domain/startup-submission-evidence.js +11 -17
- package/daemon/dist/domain/startup-submission-evidence.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts +2 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +3 -1
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.js +22 -4
- package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
- package/daemon/dist/domain/topology-converge.d.ts +1 -0
- package/daemon/dist/domain/topology-converge.d.ts.map +1 -1
- package/daemon/dist/domain/topology-converge.js +1 -0
- package/daemon/dist/domain/topology-converge.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +15 -4
- 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 +2 -0
- package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.js +37 -7
- package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
- package/daemon/dist/domain/wake-resolve-service.d.ts +1 -0
- package/daemon/dist/domain/wake-resolve-service.d.ts.map +1 -1
- package/daemon/dist/domain/wake-resolve-service.js +10 -0
- package/daemon/dist/domain/wake-resolve-service.js.map +1 -1
- package/daemon/dist/domain/wake-resolver.d.ts.map +1 -1
- package/daemon/dist/domain/wake-resolver.js +7 -0
- package/daemon/dist/domain/wake-resolver.js.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.d.ts +3 -23
- package/daemon/dist/domain/watchdog-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.js +12 -89
- package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
- package/daemon/dist/domain/watchdog-history-log.d.ts +5 -2
- package/daemon/dist/domain/watchdog-history-log.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-history-log.js.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts +2 -2
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.js +4 -0
- package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts +16 -24
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +44 -43
- package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
- package/daemon/dist/domain/whoami-service.d.ts +2 -0
- package/daemon/dist/domain/whoami-service.d.ts.map +1 -1
- package/daemon/dist/domain/whoami-service.js +23 -6
- package/daemon/dist/domain/whoami-service.js.map +1 -1
- package/daemon/dist/domain/workflow-boot-sweep.d.ts +2 -1
- package/daemon/dist/domain/workflow-boot-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-boot-sweep.js +11 -5
- package/daemon/dist/domain/workflow-boot-sweep.js.map +1 -1
- package/daemon/dist/domain/workflow-exception-escalation.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-exception-escalation.js +2 -1
- package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -1
- package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +5 -2
- package/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-role-context.js +2 -2
- package/daemon/dist/domain/workflow-role-context.js.map +1 -1
- package/daemon/dist/domain/workflow-runtime.d.ts +1 -1
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +2 -0
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/routes/activity.d.ts +13 -1
- package/daemon/dist/routes/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +67 -2
- package/daemon/dist/routes/activity.js.map +1 -1
- package/daemon/dist/routes/agent-images.d.ts.map +1 -1
- package/daemon/dist/routes/agent-images.js +2 -0
- package/daemon/dist/routes/agent-images.js.map +1 -1
- package/daemon/dist/routes/compaction.d.ts.map +1 -1
- package/daemon/dist/routes/compaction.js +8 -3
- package/daemon/dist/routes/compaction.js.map +1 -1
- package/daemon/dist/routes/discovery.js +3 -0
- package/daemon/dist/routes/discovery.js.map +1 -1
- package/daemon/dist/routes/down.js +9 -1
- package/daemon/dist/routes/down.js.map +1 -1
- package/daemon/dist/routes/gateway.d.ts +2 -0
- package/daemon/dist/routes/gateway.d.ts.map +1 -1
- package/daemon/dist/routes/gateway.js +181 -1
- package/daemon/dist/routes/gateway.js.map +1 -1
- package/daemon/dist/routes/kernel-status.js +6 -1
- package/daemon/dist/routes/kernel-status.js.map +1 -1
- package/daemon/dist/routes/provider.d.ts.map +1 -1
- package/daemon/dist/routes/provider.js +0 -73
- package/daemon/dist/routes/provider.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +73 -13
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/rigs.d.ts.map +1 -1
- package/daemon/dist/routes/rigs.js +29 -10
- package/daemon/dist/routes/rigs.js.map +1 -1
- package/daemon/dist/routes/rigspec.js +2 -3
- package/daemon/dist/routes/rigspec.js.map +1 -1
- package/daemon/dist/routes/seat.js +2 -2
- package/daemon/dist/routes/seat.js.map +1 -1
- package/daemon/dist/routes/sessions.js +35 -0
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/skills.js +2 -2
- package/daemon/dist/routes/skills.js.map +1 -1
- package/daemon/dist/routes/transcripts.d.ts.map +1 -1
- package/daemon/dist/routes/transcripts.js +7 -3
- package/daemon/dist/routes/transcripts.js.map +1 -1
- package/daemon/dist/routes/transport.js +1 -1
- package/daemon/dist/routes/transport.js.map +1 -1
- package/daemon/dist/routes/up.js +36 -52
- package/daemon/dist/routes/up.js.map +1 -1
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +6 -4
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +104 -65
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/agent-state-taxonomy.md +17 -2
- package/daemon/docs/reference/getting-started.md +178 -35
- package/daemon/docs/reference/quickstart.md +200 -0
- package/daemon/docs/reference/refocus-channel.md +9 -3
- package/daemon/docs/reference/rig-spec.md +1 -1
- package/daemon/docs/reference/seat-delivery.md +57 -18
- package/daemon/docs/reference/slack-app-setup.md +49 -2
- package/daemon/docs/reference/whats-new.md +126 -100
- package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +24 -0
- package/daemon/specs/agents/shared/skills/core/openrig-skills/SKILL.md +2 -2
- package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +11 -5
- package/daemon/specs/agents/shared/skills/pods/development-team/SKILL.md +2 -0
- package/daemon/specs/agents/shared/skills/pods/development-team/references/refactoring.md +11 -0
- package/daemon/specs/agents/shared/skills/pods/review-team/SKILL.md +46 -96
- package/daemon/specs/agents/shared/skills/process/verification-before-completion/SKILL.md +17 -80
- package/daemon/specs/agents/shared/skills/process/verification-before-completion/references/performance-claims.md +12 -0
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +93 -14
- package/dist/build-info.js +3 -3
- package/dist/cli-error.d.ts +4 -0
- package/dist/cli-error.d.ts.map +1 -1
- package/dist/cli-error.js +6 -0
- package/dist/cli-error.js.map +1 -1
- package/dist/client.d.ts +7 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +28 -0
- package/dist/client.js.map +1 -1
- package/dist/commands/agent-image.d.ts.map +1 -1
- package/dist/commands/agent-image.js +15 -7
- package/dist/commands/agent-image.js.map +1 -1
- package/dist/commands/archive.d.ts.map +1 -1
- package/dist/commands/archive.js +17 -3
- package/dist/commands/archive.js.map +1 -1
- package/dist/commands/ask.d.ts.map +1 -1
- package/dist/commands/ask.js +13 -3
- package/dist/commands/ask.js.map +1 -1
- package/dist/commands/attach.d.ts.map +1 -1
- package/dist/commands/attach.js +6 -4
- package/dist/commands/attach.js.map +1 -1
- package/dist/commands/broadcast.js +2 -0
- package/dist/commands/broadcast.js.map +1 -1
- package/dist/commands/chatroom.d.ts.map +1 -1
- package/dist/commands/chatroom.js +1 -0
- package/dist/commands/chatroom.js.map +1 -1
- package/dist/commands/community-harness.d.ts.map +1 -1
- package/dist/commands/community-harness.js +2 -1
- package/dist/commands/community-harness.js.map +1 -1
- package/dist/commands/compact-plan.d.ts.map +1 -1
- package/dist/commands/compact-plan.js +2 -1
- package/dist/commands/compact-plan.js.map +1 -1
- package/dist/commands/compact.d.ts.map +1 -1
- package/dist/commands/compact.js +15 -7
- package/dist/commands/compact.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +11 -2
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +16 -9
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/doctor.d.ts +3 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +39 -16
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/expand.d.ts.map +1 -1
- package/dist/commands/expand.js +16 -2
- package/dist/commands/expand.js.map +1 -1
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +9 -2
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/fork.d.ts.map +1 -1
- package/dist/commands/fork.js +3 -1
- package/dist/commands/fork.js.map +1 -1
- package/dist/commands/gateway.d.ts +39 -0
- package/dist/commands/gateway.d.ts.map +1 -1
- package/dist/commands/gateway.js +310 -3
- package/dist/commands/gateway.js.map +1 -1
- package/dist/commands/health.js +3 -2
- package/dist/commands/health.js.map +1 -1
- package/dist/commands/host.d.ts +1 -1
- package/dist/commands/host.d.ts.map +1 -1
- package/dist/commands/host.js +2 -2
- package/dist/commands/host.js.map +1 -1
- package/dist/commands/launch.d.ts.map +1 -1
- package/dist/commands/launch.js +9 -2
- package/dist/commands/launch.js.map +1 -1
- package/dist/commands/plugin.d.ts.map +1 -1
- package/dist/commands/plugin.js +2 -1
- package/dist/commands/plugin.js.map +1 -1
- package/dist/commands/provider.d.ts.map +1 -1
- package/dist/commands/provider.js +0 -73
- package/dist/commands/provider.js.map +1 -1
- package/dist/commands/ps.d.ts +4 -0
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +95 -5
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.d.ts +4 -0
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +78 -3
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/reconcile-session.d.ts.map +1 -1
- package/dist/commands/reconcile-session.js +25 -4
- package/dist/commands/reconcile-session.js.map +1 -1
- package/dist/commands/release.d.ts.map +1 -1
- package/dist/commands/release.js +16 -2
- package/dist/commands/release.js.map +1 -1
- package/dist/commands/restore-check.d.ts.map +1 -1
- package/dist/commands/restore-check.js +2 -1
- package/dist/commands/restore-check.js.map +1 -1
- package/dist/commands/restore-packet.d.ts.map +1 -1
- package/dist/commands/restore-packet.js +2 -1
- package/dist/commands/restore-packet.js.map +1 -1
- package/dist/commands/restore.d.ts.map +1 -1
- package/dist/commands/restore.js +23 -6
- package/dist/commands/restore.js.map +1 -1
- package/dist/commands/scope.d.ts.map +1 -1
- package/dist/commands/scope.js +5 -2
- package/dist/commands/scope.js.map +1 -1
- package/dist/commands/seat.js +0 -4
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +27 -3
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/setup.d.ts +3 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +29 -9
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/shrink.d.ts.map +1 -1
- package/dist/commands/shrink.js +16 -2
- package/dist/commands/shrink.js.map +1 -1
- package/dist/commands/slack.d.ts.map +1 -1
- package/dist/commands/slack.js +11 -24
- package/dist/commands/slack.js.map +1 -1
- package/dist/commands/snapshot.d.ts.map +1 -1
- package/dist/commands/snapshot.js +36 -10
- package/dist/commands/snapshot.js.map +1 -1
- package/dist/commands/specs.d.ts.map +1 -1
- package/dist/commands/specs.js +11 -5
- package/dist/commands/specs.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +36 -10
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +4 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/transcript.d.ts.map +1 -1
- package/dist/commands/transcript.js +12 -7
- package/dist/commands/transcript.js.map +1 -1
- package/dist/commands/ui.d.ts.map +1 -1
- package/dist/commands/ui.js +8 -1
- package/dist/commands/ui.js.map +1 -1
- package/dist/commands/unarchive.d.ts.map +1 -1
- package/dist/commands/unarchive.js +16 -2
- package/dist/commands/unarchive.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +33 -7
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/walk.d.ts.map +1 -1
- package/dist/commands/walk.js +2 -1
- package/dist/commands/walk.js.map +1 -1
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +3 -0
- package/dist/commands/whoami.js.map +1 -1
- package/dist/config-store.d.ts +5 -2
- package/dist/config-store.d.ts.map +1 -1
- package/dist/config-store.js +39 -7
- package/dist/config-store.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts +9 -4
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +38 -12
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/daemon-reachability.d.ts +13 -0
- package/dist/daemon-reachability.d.ts.map +1 -1
- package/dist/daemon-reachability.js +28 -0
- package/dist/daemon-reachability.js.map +1 -1
- package/dist/fetch-with-timeout.d.ts.map +1 -1
- package/dist/fetch-with-timeout.js +19 -16
- package/dist/fetch-with-timeout.js.map +1 -1
- package/dist/front-door.d.ts.map +1 -1
- package/dist/front-door.js +3 -1
- package/dist/front-door.js.map +1 -1
- package/dist/host-bindings.d.ts +6 -0
- package/dist/host-bindings.d.ts.map +1 -1
- package/dist/host-bindings.js +7 -4
- package/dist/host-bindings.js.map +1 -1
- package/dist/lib/bundle-check.d.ts.map +1 -1
- package/dist/lib/bundle-check.js +13 -5
- package/dist/lib/bundle-check.js.map +1 -1
- package/dist/local-daemon-owner.d.ts +28 -0
- package/dist/local-daemon-owner.d.ts.map +1 -0
- package/dist/local-daemon-owner.js +98 -0
- package/dist/local-daemon-owner.js.map +1 -0
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +57 -14
- package/dist/mcp-server.js.map +1 -1
- package/dist/rig-handle.d.ts +18 -1
- package/dist/rig-handle.d.ts.map +1 -1
- package/dist/rig-handle.js +19 -2
- package/dist/rig-handle.js.map +1 -1
- package/package.json +1 -1
- package/tui/dist/config/config-model.js +1 -1
- package/tui/dist/config/config-model.js.map +1 -1
- package/tui/dist/connections/connections-model.d.ts +0 -5
- package/tui/dist/connections/connections-model.d.ts.map +1 -1
- package/tui/dist/connections/connections-model.js +1 -1
- package/tui/dist/connections/connections-model.js.map +1 -1
- package/tui/dist/daemon-client.d.ts +2 -0
- package/tui/dist/daemon-client.d.ts.map +1 -1
- package/tui/dist/daemon-client.js +23 -0
- package/tui/dist/daemon-client.js.map +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +13 -1
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/live.d.ts +10 -1
- package/tui/dist/live.d.ts.map +1 -1
- package/tui/dist/live.js +56 -7
- package/tui/dist/live.js.map +1 -1
- package/tui/dist/main.js +35 -2
- package/tui/dist/main.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +111 -7
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/types.d.ts +53 -0
- package/tui/dist/types.d.ts.map +1 -1
- package/tui/dist/version-skew.d.ts +24 -0
- package/tui/dist/version-skew.d.ts.map +1 -0
- package/tui/dist/version-skew.js +37 -0
- package/tui/dist/version-skew.js.map +1 -0
- package/daemon/dist/domain/provider/subscription-moves.d.ts +0 -77
- package/daemon/dist/domain/provider/subscription-moves.d.ts.map +0 -1
- package/daemon/dist/domain/provider/subscription-moves.js +0 -140
- package/daemon/dist/domain/provider/subscription-moves.js.map +0 -1
|
@@ -2,6 +2,8 @@ import { operationalLaunchArg } from "./kernel-authority.js";
|
|
|
2
2
|
import nodePath from "node:path";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
|
+
import { execFile } from "node:child_process";
|
|
6
|
+
import { createRequire } from "node:module";
|
|
5
7
|
import os from "node:os";
|
|
6
8
|
import { parse as parseToml } from "smol-toml";
|
|
7
9
|
import { codexPostureArg } from "./yolo-mode.js";
|
|
@@ -16,9 +18,25 @@ import { mergeManagedBlock } from "../domain/managed-blocks.js";
|
|
|
16
18
|
import { excludeNewGeneratedFiles } from "../domain/generated-file-hygiene.js";
|
|
17
19
|
import { codexQueueStateRoot, codexTeamWorkspaceArg } from "../domain/codex-team-workspace.js";
|
|
18
20
|
import { shellQuote } from "./shell-quote.js";
|
|
19
|
-
import {
|
|
21
|
+
import { execRuntimeProbe } from "./runtime-probe-exec.js";
|
|
20
22
|
import { resolveReadinessTimeoutMs } from "../domain/readiness-timeout.js";
|
|
23
|
+
import { CODEX_CORE_MARKETPLACE, CODEX_CORE_PLUGIN, CODEX_CORE_PLUGIN_KEY, CODEX_MARKETPLACE_MANIFEST_PATH, codexCoreMarketplaceManifest, codexCorePluginEnablement, codexReadableConfigLayers, recordedMarketplaceSource, userLayerEnablesCorePlugin, } from "../domain/codex-core-plugin-install.js";
|
|
24
|
+
const defaultCodexCli = (args, env) => new Promise((resolve) => {
|
|
25
|
+
execFile("codex", args, { env, timeout: 120_000, maxBuffer: 4 * 1024 * 1024 }, (error, stdout, stderr) => {
|
|
26
|
+
const status = error ? (typeof error.code === "number" ? error.code : null) : 0;
|
|
27
|
+
// A spawn failure (ENOENT, EACCES) has no exit code and empty output: keep its message as the reason.
|
|
28
|
+
const err = String(stderr ?? "");
|
|
29
|
+
resolve({ status, stdout: String(stdout ?? ""), stderr: err.trim() || !error ? err : error.message });
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
// Codex's hook trust recipe (the key and hash Codex records for a trusted hook), kept in one script.
|
|
33
|
+
const codexHookTrust = createRequire(import.meta.url)("../../assets/plugins/openrig-core/hooks/scripts/codex-hook-trust.cjs");
|
|
21
34
|
import { listNativeProcesses, observeCodexPaneProcess, observeCodexForkProcess, verifyPaneIdleShell } from "../domain/native-process-lineage.js";
|
|
35
|
+
// The managed resume check's poll window: a quick phase, then an extended one for a slow boot.
|
|
36
|
+
const RESUME_QUICK_ATTEMPTS = 6;
|
|
37
|
+
const RESUME_EXTENDED_ATTEMPTS = 24;
|
|
38
|
+
const RESUME_QUICK_SLEEP_MS = 200;
|
|
39
|
+
const RESUME_EXTENDED_SLEEP_MS = 500;
|
|
22
40
|
/**
|
|
23
41
|
* Codex runtime adapter. Projects resources to .agents/ targets (preserving
|
|
24
42
|
* existing Codex filesystem contract) and delivers startup files.
|
|
@@ -30,6 +48,8 @@ export class CodexRuntimeAdapter {
|
|
|
30
48
|
fs;
|
|
31
49
|
listProcesses;
|
|
32
50
|
readThreadIdByPid;
|
|
51
|
+
readResumeEvidence;
|
|
52
|
+
resumeProofWindowMs;
|
|
33
53
|
readinessSettings;
|
|
34
54
|
sleep;
|
|
35
55
|
resolveHomeDirByPid;
|
|
@@ -59,7 +79,20 @@ export class CodexRuntimeAdapter {
|
|
|
59
79
|
// (FR-A) to write config-layer [hooks] command entries that are cwd-independent and
|
|
60
80
|
// version-matched to the running daemon (NOT ${PLUGIN_ROOT}, NOT a per-cwd copy).
|
|
61
81
|
activityRelayPath;
|
|
82
|
+
// The vendored openrig-core plugin directory, resolved when the install step runs (vendoring happens at startup).
|
|
83
|
+
resolveCorePluginDir;
|
|
84
|
+
// Whether a node's resolved plugin selection includes openrig-core (the test that also gives it OPENRIG_SEAT_PROJECT_DIR).
|
|
85
|
+
resolveCorePluginSelected;
|
|
86
|
+
runCodexCli;
|
|
87
|
+
// One Codex config.toml per adapter: launches, the boot step and resume all write it (and Codex's install writes it too),
|
|
88
|
+
// so each of those runs its whole setup under this one lock, one after another.
|
|
89
|
+
configLock = Promise.resolve();
|
|
90
|
+
codexSystemConfigDir;
|
|
62
91
|
constructor(deps) {
|
|
92
|
+
this.resolveCorePluginDir = deps.resolveCorePluginDir;
|
|
93
|
+
this.resolveCorePluginSelected = deps.resolveCorePluginSelected;
|
|
94
|
+
this.runCodexCli = deps.runCodexCli ?? defaultCodexCli;
|
|
95
|
+
this.codexSystemConfigDir = deps.codexSystemConfigDir ?? "/etc/codex";
|
|
63
96
|
this.tmux = deps.tmux;
|
|
64
97
|
this.resolveManagedConfigSettings = deps.resolveManagedConfigSettings;
|
|
65
98
|
this.resolveHooksEnabled = deps.resolveHooksEnabled;
|
|
@@ -80,6 +113,18 @@ export class CodexRuntimeAdapter {
|
|
|
80
113
|
});
|
|
81
114
|
this.readThreadIdByPid = deps.readThreadIdByPid ?? ((pid, identity) => identity === undefined
|
|
82
115
|
? this.readThreadIdFromLogs(pid) : threadIdResolver.resolveForkChild(pid, identity));
|
|
116
|
+
// A just-launched resume may log only inside its start second, so this reads like a fork child's ("by-process").
|
|
117
|
+
this.readResumeEvidence = deps.readResumeEvidence ?? (deps.readThreadIdByPid
|
|
118
|
+
? async (pid, identity) => {
|
|
119
|
+
const threadId = (await deps.readThreadIdByPid(pid, identity))?.trim();
|
|
120
|
+
return threadId ? { threadId } : { reason: "no_log_row" };
|
|
121
|
+
}
|
|
122
|
+
: async (pid, identity) => {
|
|
123
|
+
let reason;
|
|
124
|
+
const threadId = (await threadIdResolver.resolveForkChild(pid, identity, (d) => { reason = d.reason; }))?.trim();
|
|
125
|
+
return threadId ? { threadId } : { reason: reason ?? "no_log_row" };
|
|
126
|
+
});
|
|
127
|
+
this.resumeProofWindowMs = deps.resumeProofWindowMs ?? RESUME_QUICK_ATTEMPTS * RESUME_QUICK_SLEEP_MS + RESUME_EXTENDED_ATTEMPTS * RESUME_EXTENDED_SLEEP_MS;
|
|
83
128
|
this.readinessSettings = deps.readinessSettings;
|
|
84
129
|
this.sleep = deps.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
85
130
|
this.verifyProfilePreflight = deps.verifyProfilePreflight
|
|
@@ -93,8 +138,17 @@ export class CodexRuntimeAdapter {
|
|
|
93
138
|
* not block the launch.
|
|
94
139
|
*/
|
|
95
140
|
async ensureManagedConfig() {
|
|
141
|
+
return this.withConfigLock(() => this.applyManagedConfig());
|
|
142
|
+
}
|
|
143
|
+
/** Run `task` after every earlier config setup on this adapter has finished, whatever its outcome. */
|
|
144
|
+
withConfigLock(task) {
|
|
145
|
+
const run = this.configLock.then(task, task);
|
|
146
|
+
this.configLock = run.catch(() => undefined);
|
|
147
|
+
return run;
|
|
148
|
+
}
|
|
149
|
+
async applyManagedConfig() {
|
|
96
150
|
if (!this.resolveManagedConfigSettings)
|
|
97
|
-
return;
|
|
151
|
+
return undefined;
|
|
98
152
|
try {
|
|
99
153
|
const { enabled, codexVersion } = await this.resolveManagedConfigSettings();
|
|
100
154
|
this.ensureCodexFeatureFlag(enabled, { codexVersion });
|
|
@@ -102,11 +156,162 @@ export class CodexRuntimeAdapter {
|
|
|
102
156
|
this.ensureCodexActivityHooks();
|
|
103
157
|
else
|
|
104
158
|
this.removeCodexActivityHooks();
|
|
159
|
+
return { hooksEnabled: enabled };
|
|
105
160
|
}
|
|
106
161
|
catch (err) {
|
|
107
162
|
console.error(`[openrig] runtime setup warning: ${err.message}`);
|
|
163
|
+
return undefined;
|
|
108
164
|
}
|
|
109
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Boot step, run after the plugin is vendored: install openrig-core into Codex only when hooks are enabled and some
|
|
168
|
+
* Codex seat's resolved selection includes it. A daemon whose Codex seats didn't select it never installs it.
|
|
169
|
+
*/
|
|
170
|
+
async ensureCodexCorePluginAtBoot(anySeatSelected) {
|
|
171
|
+
if (!anySeatSelected || !this.resolveHooksEnabled)
|
|
172
|
+
return;
|
|
173
|
+
const resolveHooksEnabled = this.resolveHooksEnabled;
|
|
174
|
+
await this.withConfigLock(async () => {
|
|
175
|
+
try {
|
|
176
|
+
if (await resolveHooksEnabled())
|
|
177
|
+
await this.ensureCodexCorePlugin();
|
|
178
|
+
}
|
|
179
|
+
catch (err) {
|
|
180
|
+
console.error(`[openrig] runtime setup warning: ${err.message}`);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Install the vendored openrig-core plugin into Codex through Codex's own commands, so a seat that selected it gets its
|
|
186
|
+
* refocus and skills, trusting only exact shipped hooks on its first install. It runs only when the person's config
|
|
187
|
+
* doesn't disable the plugin (codexCorePluginEnablement), and only when the installed version differs from the vendored
|
|
188
|
+
* one. Codex owns its plugin cache; OpenRig writes the marketplace manifest and first-install exact-hook trust.
|
|
189
|
+
*/
|
|
190
|
+
async ensureCodexCorePlugin() {
|
|
191
|
+
const report = (outcome, reason) => {
|
|
192
|
+
if (outcome !== "current")
|
|
193
|
+
console.error(`[openrig] codex core plugin ${outcome}: ${reason}`);
|
|
194
|
+
return { outcome, reason };
|
|
195
|
+
};
|
|
196
|
+
const pluginDir = this.resolveCorePluginDir?.();
|
|
197
|
+
if (!pluginDir)
|
|
198
|
+
return { outcome: "skipped", reason: "the openrig-core plugin isn't vendored" };
|
|
199
|
+
let version;
|
|
200
|
+
try {
|
|
201
|
+
version = JSON.parse(this.fs.readFile(nodePath.join(pluginDir, ".codex-plugin", "plugin.json"))).version;
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
return report("skipped", "the vendored plugin has no readable Codex manifest");
|
|
205
|
+
}
|
|
206
|
+
if (typeof version !== "string" || !/^[0-9A-Za-z._-]+$/.test(version))
|
|
207
|
+
return report("skipped", "the vendored plugin's Codex manifest has no usable version");
|
|
208
|
+
const shipped = nodePath.resolve(import.meta.dirname, "../../assets/plugins/openrig-core");
|
|
209
|
+
const ownFiles = [];
|
|
210
|
+
const collect = (dir, relative = "hooks") => {
|
|
211
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
212
|
+
const child = nodePath.join(relative, entry.name);
|
|
213
|
+
if (entry.isDirectory())
|
|
214
|
+
collect(nodePath.join(dir, entry.name), child);
|
|
215
|
+
else
|
|
216
|
+
ownFiles.push(child);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
collect(nodePath.join(shipped, "hooks"));
|
|
220
|
+
ownFiles.push(".codex-plugin/plugin.json");
|
|
221
|
+
const matchesShipped = (dir) => ownFiles.every(relative => {
|
|
222
|
+
try {
|
|
223
|
+
return fs.readFileSync(nodePath.join(dir, relative)).equals(fs.readFileSync(nodePath.join(shipped, relative)));
|
|
224
|
+
}
|
|
225
|
+
catch {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
if (!matchesShipped(pluginDir))
|
|
230
|
+
return report("skipped", "vendored hook files differ from this daemon's shipped plugin; existing choices are left alone");
|
|
231
|
+
const codexHome = nodePath.dirname(this.resolveCodexConfigPath());
|
|
232
|
+
const layers = codexReadableConfigLayers(codexHome, this.codexSystemConfigDir).map((layer) => {
|
|
233
|
+
if (!this.fs.exists(layer.path))
|
|
234
|
+
return { ...layer, state: "absent" };
|
|
235
|
+
try {
|
|
236
|
+
return { ...layer, state: "read", content: this.fs.readFile(layer.path) };
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
return { ...layer, state: "unreadable", reason: error.message };
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
const enablement = codexCorePluginEnablement(layers);
|
|
243
|
+
if (enablement.decision !== "allow")
|
|
244
|
+
return report("skipped", enablement.reason);
|
|
245
|
+
const pluginsDir = nodePath.dirname(pluginDir);
|
|
246
|
+
const userLayer = layers.find((layer) => layer.name === "user config");
|
|
247
|
+
const userConfig = userLayer?.state === "read" ? userLayer.content : null;
|
|
248
|
+
const recorded = recordedMarketplaceSource(userConfig);
|
|
249
|
+
// Compared as real paths, so a marketplace recorded through a symlink to the plugins folder is the same source.
|
|
250
|
+
const canonical = (p) => { try {
|
|
251
|
+
return fs.realpathSync.native(nodePath.resolve(p));
|
|
252
|
+
}
|
|
253
|
+
catch {
|
|
254
|
+
return nodePath.resolve(p);
|
|
255
|
+
} };
|
|
256
|
+
if (recorded !== undefined && (recorded === null || canonical(recorded) !== canonical(pluginsDir))) {
|
|
257
|
+
return report("skipped", `a marketplace named ${CODEX_CORE_MARKETPLACE} is already configured with another source; it's left alone`);
|
|
258
|
+
}
|
|
259
|
+
// Current only when Codex would load it: the vendored version is in its store AND the user config still registers it
|
|
260
|
+
// (our marketplace, and an explicit enabled = true, which Codex's install writes). Codex loads only configured
|
|
261
|
+
// plugins, so a cache left behind after the entry or the marketplace was removed is installed again.
|
|
262
|
+
const cacheRoot = nodePath.join(codexHome, "plugins", "cache", CODEX_CORE_MARKETPLACE, CODEX_CORE_PLUGIN);
|
|
263
|
+
const cachedDir = nodePath.join(cacheRoot, version);
|
|
264
|
+
const cached = this.fs.exists(cachedDir);
|
|
265
|
+
// Codex's "continue without trusting" choice writes no state. An existing install/configuration may therefore be a
|
|
266
|
+
// decline even with no hooks.state entry. Only the very first installation earns automatic trust; reinstalls and
|
|
267
|
+
// upgrades retain whatever native choices already exist, including an unrecorded decline.
|
|
268
|
+
const firstInstall = !this.fs.exists(cacheRoot) && !layers.some(layer => layer.state === "read"
|
|
269
|
+
&& Object.hasOwn((parseToml(layer.content).plugins ?? {}), CODEX_CORE_PLUGIN_KEY));
|
|
270
|
+
if (cached && recorded !== undefined && userLayerEnablesCorePlugin(userConfig)) {
|
|
271
|
+
return report("current", `${CODEX_CORE_PLUGIN_KEY} ${version} is installed and registered`);
|
|
272
|
+
}
|
|
273
|
+
const manifestPath = nodePath.join(pluginsDir, CODEX_MARKETPLACE_MANIFEST_PATH);
|
|
274
|
+
const manifest = codexCoreMarketplaceManifest();
|
|
275
|
+
if (!this.fs.exists(manifestPath) || this.fs.readFile(manifestPath) !== manifest) {
|
|
276
|
+
this.fs.mkdirp(nodePath.dirname(manifestPath));
|
|
277
|
+
this.fs.writeFile(manifestPath, manifest);
|
|
278
|
+
}
|
|
279
|
+
const env = { ...process.env, CODEX_HOME: codexHome, ...(this.launchPath ? { PATH: this.launchPath } : {}) };
|
|
280
|
+
if (recorded === undefined) {
|
|
281
|
+
const added = await this.runCodexCli(["plugin", "marketplace", "add", pluginsDir], env);
|
|
282
|
+
if (added.status !== 0)
|
|
283
|
+
return report("skipped", `codex plugin marketplace add failed: ${(added.stderr || added.stdout).trim() || `exit ${added.status}`}`);
|
|
284
|
+
}
|
|
285
|
+
const installed = await this.runCodexCli(["plugin", "add", CODEX_CORE_PLUGIN_KEY], env);
|
|
286
|
+
if (installed.status !== 0)
|
|
287
|
+
return report("skipped", `codex plugin add failed: ${(installed.stderr || installed.stdout).trim() || `exit ${installed.status}`}`);
|
|
288
|
+
// Trust is over normalized definitions, not script contents. Byte equality is an additional pre-grant check;
|
|
289
|
+
// Codex remains responsible for later native review if definitions change. No cache files are rewritten here.
|
|
290
|
+
if (firstInstall && matchesShipped(cachedDir)) {
|
|
291
|
+
let content = this.fs.readFile(this.resolveCodexConfigPath());
|
|
292
|
+
const hookManifest = JSON.parse(fs.readFileSync(nodePath.join(shipped, "hooks/codex.json"), "utf8"));
|
|
293
|
+
for (const [event, groups] of Object.entries(hookManifest.hooks)) {
|
|
294
|
+
groups.forEach((group, groupIndex) => group.hooks.forEach((handler, handlerIndex) => {
|
|
295
|
+
const { key, hash } = codexHookTrust.computeCodexHookTrust(event, {
|
|
296
|
+
...handler, timeoutSec: handler.timeout, matcher: group.matcher,
|
|
297
|
+
keySource: `${CODEX_CORE_PLUGIN_KEY}:hooks/codex.json`, groupIndex, handlerIndex,
|
|
298
|
+
});
|
|
299
|
+
// Any existing choice in any readable layer/profile wins; never overwrite enabled=false or an old hash.
|
|
300
|
+
const hasChoice = (doc) => {
|
|
301
|
+
if (!doc || typeof doc !== "object")
|
|
302
|
+
return false;
|
|
303
|
+
const value = doc;
|
|
304
|
+
return Object.hasOwn(value.hooks?.state ?? {}, key) || Object.values(doc).some(hasChoice);
|
|
305
|
+
};
|
|
306
|
+
if (!hasChoice(parseToml(content)) && !layers.some(layer => layer.state === "read" && hasChoice(parseToml(layer.content)))) {
|
|
307
|
+
content = upsertCodexHookTrust(content, key, hash);
|
|
308
|
+
}
|
|
309
|
+
}));
|
|
310
|
+
}
|
|
311
|
+
this.fs.writeFile(this.resolveCodexConfigPath(), content);
|
|
312
|
+
}
|
|
313
|
+
return report("installed", `${CODEX_CORE_PLUGIN_KEY} ${version} through Codex's own install (${enablement.reason})`);
|
|
314
|
+
}
|
|
110
315
|
/**
|
|
111
316
|
* Boot step for a daemon without Codex seats: when runtime.codex.hooks_enabled is false,
|
|
112
317
|
* strip OpenRig's managed hooks block, as every boot did before. Removal writes only when
|
|
@@ -339,7 +544,8 @@ export class CodexRuntimeAdapter {
|
|
|
339
544
|
return { ok: false, error: "resumeToken and forkSource are mutually exclusive — pick one" };
|
|
340
545
|
}
|
|
341
546
|
const updatePrompt = { handled: false };
|
|
342
|
-
|
|
547
|
+
// Only a launch that starts a conversation may install the core plugin; a resume never does.
|
|
548
|
+
const prepared = await this.prepareLaunch(binding, opts.name, undefined, { installCorePlugin: !opts.resumeToken });
|
|
343
549
|
if (!prepared.ok)
|
|
344
550
|
return prepared;
|
|
345
551
|
const { modelArg, effortArg, appliedLaunch, postureArg, queueStateDirArg, daemonArg, networkArg } = prepared;
|
|
@@ -415,7 +621,8 @@ export class CodexRuntimeAdapter {
|
|
|
415
621
|
const verification = await this.verifyResumeLaunch(binding.tmuxSession, updatePrompt, { resumeToken: opts.resumeToken });
|
|
416
622
|
if (!verification.ok)
|
|
417
623
|
return verification;
|
|
418
|
-
return { ok: true, resumeToken: opts.resumeToken, resumeType: "codex_id", appliedLaunch
|
|
624
|
+
return { ok: true, resumeToken: opts.resumeToken, resumeType: "codex_id", appliedLaunch,
|
|
625
|
+
...(verification.resumedProcess ? { resumedProcess: verification.resumedProcess } : {}) };
|
|
419
626
|
}
|
|
420
627
|
const threadId = await this.captureFreshThreadId(binding, updatePrompt);
|
|
421
628
|
if (updatePrompt.failure)
|
|
@@ -430,7 +637,8 @@ export class CodexRuntimeAdapter {
|
|
|
430
637
|
async buildResumeCommand(binding, opts) {
|
|
431
638
|
if (!binding.tmuxSession)
|
|
432
639
|
return { ok: false, error: "No tmux session bound — cannot build a Codex resume command" };
|
|
433
|
-
|
|
640
|
+
// Building a resume command (the in-place restart's) never installs the core plugin.
|
|
641
|
+
const prepared = await this.prepareLaunch(binding, opts.name, opts.running, { installCorePlugin: false });
|
|
434
642
|
if (!prepared.ok)
|
|
435
643
|
return prepared;
|
|
436
644
|
const core = this.resumeCore(prepared, opts.resumeToken, binding);
|
|
@@ -455,8 +663,20 @@ export class CodexRuntimeAdapter {
|
|
|
455
663
|
}
|
|
456
664
|
/** Launch flags shared by fresh, fork and resume, decided once per launch. With `running`, the probed and
|
|
457
665
|
* prepared parts come from the running Codex instead, and no Codex process is started to decide them. */
|
|
458
|
-
async prepareLaunch(binding, name, running) {
|
|
459
|
-
|
|
666
|
+
async prepareLaunch(binding, name, running, opts) {
|
|
667
|
+
// The config write and, for a seat that selected openrig-core, its install run as one step under the config lock, so
|
|
668
|
+
// concurrent launches never interleave them. An unselected seat's launch never installs.
|
|
669
|
+
await this.withConfigLock(async () => {
|
|
670
|
+
const managed = await this.applyManagedConfig();
|
|
671
|
+
if (opts.installCorePlugin && managed?.hooksEnabled && this.resolveCorePluginSelected?.(binding.nodeId)) {
|
|
672
|
+
try {
|
|
673
|
+
await this.ensureCodexCorePlugin();
|
|
674
|
+
}
|
|
675
|
+
catch (err) {
|
|
676
|
+
console.error(`[openrig] runtime setup warning: ${err.message}`);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
});
|
|
460
680
|
const model = binding.model?.trim();
|
|
461
681
|
const modelArg = model ? ` -m ${shellQuote(model)}` : "";
|
|
462
682
|
const effort = binding.effort?.trim();
|
|
@@ -904,11 +1124,88 @@ export class CodexRuntimeAdapter {
|
|
|
904
1124
|
}
|
|
905
1125
|
return undefined;
|
|
906
1126
|
}
|
|
1127
|
+
/**
|
|
1128
|
+
* #1524 (b): whether the pane's resumed Codex process is proven to hold `resumeToken`. Codex's own records for that
|
|
1129
|
+
* exact process (pid and start time) must name the token, read before `deadline`, with the same process observed
|
|
1130
|
+
* before and after the read, so a reused pid or a replaced pane proves nothing. A different conversation is a
|
|
1131
|
+
* mismatch; anything unread is unknown, never a mismatch or a match.
|
|
1132
|
+
*/
|
|
1133
|
+
/** #1524 (b): `work` under the resume check's deadline. It isn't started at or after the deadline, it races the
|
|
1134
|
+
* deadline, and a value that arrives at or after it is not used (null). It cancels nothing: work already started
|
|
1135
|
+
* runs to its end (an async step may go on to its next read, and synchronous work such as the default record
|
|
1136
|
+
* reader's SQLite queries can't be interrupted at all), so the check can return after the deadline. */
|
|
1137
|
+
async beforeResumeDeadline(work, deadline) {
|
|
1138
|
+
if (Date.now() >= deadline)
|
|
1139
|
+
return null;
|
|
1140
|
+
const value = await this.withinDeadline(Promise.resolve().then(work), deadline);
|
|
1141
|
+
return Date.now() >= deadline ? null : value;
|
|
1142
|
+
}
|
|
1143
|
+
async proveResumedProcess(tmuxSession, resumeToken, deadline) {
|
|
1144
|
+
if (!this.tmux.getPanePid)
|
|
1145
|
+
return { kind: "unknown", reason: "the pane's process can't be read" };
|
|
1146
|
+
if (Date.now() >= deadline)
|
|
1147
|
+
return { kind: "unknown", reason: "the resume window ended", windowEnded: true };
|
|
1148
|
+
const input = { target: tmuxSession, tmux: this.tmux,
|
|
1149
|
+
listProcesses: this.listProcesses, expectedToken: resumeToken, requireResume: true };
|
|
1150
|
+
const before = await this.beforeResumeDeadline(() => observeCodexPaneProcess(input), deadline);
|
|
1151
|
+
if (!before && Date.now() >= deadline)
|
|
1152
|
+
return { kind: "unknown", reason: "the resume window ended", windowEnded: true };
|
|
1153
|
+
if (!before)
|
|
1154
|
+
return { kind: "unknown", reason: "no single Codex process resuming this conversation was observed in the pane" };
|
|
1155
|
+
if (lstartToMinTs(before.process.startedAt) === undefined) {
|
|
1156
|
+
return { kind: "unknown", reason: "the resumed Codex process has no readable start time" };
|
|
1157
|
+
}
|
|
1158
|
+
let evidence;
|
|
1159
|
+
try {
|
|
1160
|
+
evidence = await this.beforeResumeDeadline(() => this.readResumeEvidence(before.process.pid, before.process.startedAt), deadline);
|
|
1161
|
+
}
|
|
1162
|
+
catch (err) {
|
|
1163
|
+
return { kind: "unknown", reason: `Codex's records couldn't be read (${err.message})` };
|
|
1164
|
+
}
|
|
1165
|
+
if (!evidence)
|
|
1166
|
+
return { kind: "unknown", reason: "reading Codex's records didn't finish inside the resume window", windowEnded: true };
|
|
1167
|
+
const after = await this.beforeResumeDeadline(() => observeCodexPaneProcess(input), deadline);
|
|
1168
|
+
if (!after && Date.now() >= deadline)
|
|
1169
|
+
return { kind: "unknown", reason: "the resume window ended", windowEnded: true };
|
|
1170
|
+
if (after?.fingerprint !== before.fingerprint) {
|
|
1171
|
+
return { kind: "unknown", reason: "the resumed Codex process changed during the check" };
|
|
1172
|
+
}
|
|
1173
|
+
if (!evidence.threadId)
|
|
1174
|
+
return { kind: "unknown", reason: evidence.reason ?? "no_log_row" };
|
|
1175
|
+
// A decision is only as current as its last observation: at or past the deadline it decides nothing.
|
|
1176
|
+
if (Date.now() >= deadline)
|
|
1177
|
+
return { kind: "unknown", reason: "the resume window ended", windowEnded: true };
|
|
1178
|
+
return evidence.threadId === resumeToken
|
|
1179
|
+
? { kind: "match", process: { pid: before.process.pid, startedAt: before.process.startedAt } }
|
|
1180
|
+
: { kind: "mismatch", threadId: evidence.threadId };
|
|
1181
|
+
}
|
|
907
1182
|
async verifyResumeLaunch(tmuxSession, updatePrompt, opts) {
|
|
908
|
-
const quickAttempts =
|
|
909
|
-
const extendedAttempts =
|
|
910
|
-
const quickSleepMs =
|
|
911
|
-
const extendedSleepMs =
|
|
1183
|
+
const quickAttempts = RESUME_QUICK_ATTEMPTS;
|
|
1184
|
+
const extendedAttempts = RESUME_EXTENDED_ATTEMPTS;
|
|
1185
|
+
const quickSleepMs = RESUME_QUICK_SLEEP_MS;
|
|
1186
|
+
const extendedSleepMs = RESUME_EXTENDED_SLEEP_MS;
|
|
1187
|
+
// #1524 (b): a managed resume of a known conversation is proven from Codex's own records, inside one wall-clock
|
|
1188
|
+
// deadline for the whole existing window. Why it is still unproven, for the attention text at the bound.
|
|
1189
|
+
// With a conversation to prove, the deadline prevents acceptance of late wrapped poll or proof values, or of a late
|
|
1190
|
+
// match or mismatch. Ordinary poll sleeps request at most the remaining time. Work already started is not cancelled,
|
|
1191
|
+
// and scheduling or synchronous work can delay return. The existing update-prompt helper has its own reads,
|
|
1192
|
+
// reporting and guarded one-key behaviour outside this deadline.
|
|
1193
|
+
const resumeToken = opts?.resumeToken;
|
|
1194
|
+
const deadline = Date.now() + this.resumeProofWindowMs;
|
|
1195
|
+
let unproven = null;
|
|
1196
|
+
// Ordinary poll sleeps request at most the remaining time; scheduling can delay their completion. False once no time
|
|
1197
|
+
// is left.
|
|
1198
|
+
const pause = async (ms) => {
|
|
1199
|
+
if (!resumeToken) {
|
|
1200
|
+
await this.sleep(ms);
|
|
1201
|
+
return true;
|
|
1202
|
+
}
|
|
1203
|
+
const left = deadline - Date.now();
|
|
1204
|
+
if (left <= 0)
|
|
1205
|
+
return false;
|
|
1206
|
+
await this.sleep(Math.min(ms, left));
|
|
1207
|
+
return Date.now() < deadline;
|
|
1208
|
+
};
|
|
912
1209
|
// OPR.0.3.3.21 (FR-2): process-alive is NOT proof of a restored
|
|
913
1210
|
// conversation. verifyResumeLaunch must NOT return ok:true unless the probe
|
|
914
1211
|
// proves `resumed`. Unresolved operator-action gates (update/trust/model)
|
|
@@ -939,8 +1236,21 @@ export class CodexRuntimeAdapter {
|
|
|
939
1236
|
if (attempt >= quickAttempts && (sawRealGate || lastUnresolved?.code !== "awaiting_runtime")) {
|
|
940
1237
|
break;
|
|
941
1238
|
}
|
|
942
|
-
|
|
943
|
-
|
|
1239
|
+
// #1524 (b): with a conversation to prove, no capture starts at or after the deadline, and one that ends after it
|
|
1240
|
+
// isn't used (a capture already started isn't cancelled: its second read may still run, its value discarded).
|
|
1241
|
+
let paneCommand;
|
|
1242
|
+
let paneContent;
|
|
1243
|
+
if (resumeToken) {
|
|
1244
|
+
const captured = await this.beforeResumeDeadline(async () => ({ command: await this.tmux.getPaneCommand(tmuxSession), content: await this.captureProbeScreen(tmuxSession) }), deadline);
|
|
1245
|
+
if (!captured)
|
|
1246
|
+
break;
|
|
1247
|
+
paneCommand = captured.command;
|
|
1248
|
+
paneContent = captured.content;
|
|
1249
|
+
}
|
|
1250
|
+
else {
|
|
1251
|
+
paneCommand = await this.tmux.getPaneCommand(tmuxSession);
|
|
1252
|
+
paneContent = await this.captureProbeScreen(tmuxSession);
|
|
1253
|
+
}
|
|
944
1254
|
lastPaneContent = paneContent;
|
|
945
1255
|
let probe = assessNativeResumeProbe({
|
|
946
1256
|
runtime: "codex",
|
|
@@ -976,12 +1286,35 @@ export class CodexRuntimeAdapter {
|
|
|
976
1286
|
evidence: paneContent.split("\n").slice(-12).join("\n"),
|
|
977
1287
|
};
|
|
978
1288
|
}
|
|
979
|
-
if (probe.status === "resumed") {
|
|
980
|
-
return {
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
1289
|
+
if (probe.status === "resumed" && !resumeToken) {
|
|
1290
|
+
return { ok: true, resumeToken: undefined, resumeType: undefined };
|
|
1291
|
+
}
|
|
1292
|
+
if (probe.status === "resumed" && resumeToken) {
|
|
1293
|
+
const proof = await this.proveResumedProcess(tmuxSession, resumeToken, deadline);
|
|
1294
|
+
if (proof.kind === "match")
|
|
1295
|
+
return { ok: true, resumeToken, resumeType: "codex_id", resumedProcess: proof.process };
|
|
1296
|
+
if (proof.kind === "mismatch") {
|
|
1297
|
+
return {
|
|
1298
|
+
ok: false,
|
|
1299
|
+
error: `Codex resume opened a different conversation: the resumed process's records name ${proof.threadId}, not the requested ${resumeToken}. The session was preserved; nothing was restarted.`,
|
|
1300
|
+
recovery: "attention_required",
|
|
1301
|
+
resumeMismatch: { opened: proof.threadId },
|
|
1302
|
+
verifierInput: verifierInput(),
|
|
1303
|
+
evidence: paneContent.split("\n").slice(-12).join("\n"),
|
|
1304
|
+
};
|
|
1305
|
+
}
|
|
1306
|
+
// Unknown is not a failure yet: keep polling inside the window, as a boot still in progress does. The
|
|
1307
|
+
// window ending says nothing new, so it doesn't replace the last reason a read gave.
|
|
1308
|
+
if (!("windowEnded" in proof) || !unproven)
|
|
1309
|
+
unproven = proof.reason;
|
|
1310
|
+
lastUnresolved = { status: "inconclusive", code: "awaiting_runtime", detail: `Codex resume not yet proven: ${proof.reason}.` };
|
|
1311
|
+
report = { probe, paneContent };
|
|
1312
|
+
if (Date.now() >= deadline)
|
|
1313
|
+
break;
|
|
1314
|
+
const sleepMs = attempt < quickAttempts ? quickSleepMs : extendedSleepMs;
|
|
1315
|
+
if (attempt < totalAttempts - 1 && !(await pause(sleepMs)))
|
|
1316
|
+
break;
|
|
1317
|
+
continue;
|
|
985
1318
|
}
|
|
986
1319
|
report = { probe, paneContent }; // resumed returned above, so this screen is unresolved
|
|
987
1320
|
if (probe.code === "update_gate") {
|
|
@@ -997,8 +1330,8 @@ export class CodexRuntimeAdapter {
|
|
|
997
1330
|
lastUnresolved = null;
|
|
998
1331
|
sawRealGate = false;
|
|
999
1332
|
const sleepMs = attempt < quickAttempts ? quickSleepMs : extendedSleepMs;
|
|
1000
|
-
if (attempt < totalAttempts - 1)
|
|
1001
|
-
|
|
1333
|
+
if (attempt < totalAttempts - 1 && !(await pause(sleepMs)))
|
|
1334
|
+
break;
|
|
1002
1335
|
continue;
|
|
1003
1336
|
}
|
|
1004
1337
|
lastUnresolved = probe;
|
|
@@ -1011,13 +1344,16 @@ export class CodexRuntimeAdapter {
|
|
|
1011
1344
|
}
|
|
1012
1345
|
}
|
|
1013
1346
|
const sleepMs = attempt < quickAttempts ? quickSleepMs : extendedSleepMs;
|
|
1014
|
-
if (attempt < totalAttempts - 1)
|
|
1015
|
-
|
|
1347
|
+
if (attempt < totalAttempts - 1 && !(await pause(sleepMs)))
|
|
1348
|
+
break;
|
|
1016
1349
|
}
|
|
1017
1350
|
// Report the newest screen observed; a resumed or booting one names no gate. The loop's own decisions above used
|
|
1018
1351
|
// lastUnresolved. The text follows the newest screen too, so an older gate's text never stands for a newer screen.
|
|
1019
1352
|
const shown = report && report.probe.status !== "resumed" && report.probe.code !== "awaiting_runtime" ? report : null;
|
|
1020
|
-
const
|
|
1353
|
+
const unprovenText = unproven && report?.probe.status === "resumed"
|
|
1354
|
+
? `Codex resume could not be proven within the resume window: ${unproven}. The session was preserved; nothing was restarted.`
|
|
1355
|
+
: null;
|
|
1356
|
+
const newestText = unprovenText ? unprovenText : shown ? shown.probe.detail
|
|
1021
1357
|
: report?.probe.status === "resumed" ? "Codex resume could not be confirmed: the last screen observed looked ready, but the resume check ended before proving a restored conversation."
|
|
1022
1358
|
: report ? report.probe.detail
|
|
1023
1359
|
: lastUnresolved?.detail;
|
|
@@ -1029,6 +1365,9 @@ export class CodexRuntimeAdapter {
|
|
|
1029
1365
|
// The gate on that screen, if any. A boot still in progress names no gate.
|
|
1030
1366
|
...(shown ? gateFields(shown.probe, shown.paneContent) : {}),
|
|
1031
1367
|
...(shown?.beforeInput ? { screenBeforeInput: true } : {}),
|
|
1368
|
+
// With a conversation to prove and no gate on the newest screen, the end is "not proven": whatever the last frame
|
|
1369
|
+
// was (a boot, a ready screen, or no capture at all before the deadline), the resumed Codex may be running.
|
|
1370
|
+
...(resumeToken && !shown ? { resumeUnproven: true } : {}),
|
|
1032
1371
|
verifierInput: verifierInput(),
|
|
1033
1372
|
evidence: (report?.paneContent ?? lastPaneContent).split("\n").slice(-12).join("\n"),
|
|
1034
1373
|
};
|
|
@@ -1120,19 +1459,6 @@ function upsertCodexProjectTrust(content, projectPath) {
|
|
|
1120
1459
|
// CONFIDENCE: the HASH is fully deterministic from the open source (JSON+sha256) — HIGH.
|
|
1121
1460
|
// The KEY's exact key_source canonical form + the positional indices are what the VM
|
|
1122
1461
|
// read-back must confirm — PROVISIONAL until then.
|
|
1123
|
-
/** Recursively sort object keys (mirrors codex-rs fingerprint.rs `canonical_json`). */
|
|
1124
|
-
function canonicalizeJsonValue(value) {
|
|
1125
|
-
if (Array.isArray(value))
|
|
1126
|
-
return value.map(canonicalizeJsonValue);
|
|
1127
|
-
if (value !== null && typeof value === "object") {
|
|
1128
|
-
const src = value;
|
|
1129
|
-
const out = {};
|
|
1130
|
-
for (const key of Object.keys(src).sort())
|
|
1131
|
-
out[key] = canonicalizeJsonValue(src[key]);
|
|
1132
|
-
return out;
|
|
1133
|
-
}
|
|
1134
|
-
return value;
|
|
1135
|
-
}
|
|
1136
1462
|
const CODEX_HOOK_EVENT_KEY_LABEL = {
|
|
1137
1463
|
SessionStart: "session_start",
|
|
1138
1464
|
UserPromptSubmit: "user_prompt_submit",
|
|
@@ -1149,28 +1475,16 @@ export function computeCodexHookTrust(event, input) {
|
|
|
1149
1475
|
const groupIndex = input.groupIndex ?? 0;
|
|
1150
1476
|
const handlerIndex = input.handlerIndex ?? 0;
|
|
1151
1477
|
const key = `${input.keySource}:${label}:${groupIndex}:${handlerIndex}`;
|
|
1152
|
-
//
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
command: input.command,
|
|
1156
|
-
timeout: input.timeoutSec,
|
|
1157
|
-
async: false,
|
|
1158
|
-
};
|
|
1159
|
-
if (input.statusMessage != null)
|
|
1160
|
-
handler.statusMessage = input.statusMessage;
|
|
1161
|
-
const identity = { event_name: label, hooks: [handler] };
|
|
1162
|
-
if (input.matcher != null)
|
|
1163
|
-
identity.matcher = input.matcher;
|
|
1164
|
-
const serialized = JSON.stringify(canonicalizeJsonValue(identity));
|
|
1165
|
-
const hex = createHash("sha256").update(serialized, "utf8").digest("hex");
|
|
1166
|
-
return { key, hash: `sha256:${hex}` };
|
|
1478
|
+
// NormalizedHookIdentity exactly as `TomlValue::try_from` would build it (None fields dropped), hashed by the shared
|
|
1479
|
+
// recipe in codex-hook-trust.cjs.
|
|
1480
|
+
return { key, hash: codexHookTrust.codexHookHash(label, input) };
|
|
1167
1481
|
}
|
|
1168
1482
|
/**
|
|
1169
1483
|
* OPR.0.4.3.33 — idempotent, non-clobbering, section-scoped writer for a single
|
|
1170
1484
|
* `[hooks.state."<key>"] trusted_hash = "<hash>"` record. Mirrors upsertCodexProjectTrust:
|
|
1171
1485
|
* find/create the exact table header, splice ONLY its `trusted_hash` line, leave every other
|
|
1172
1486
|
* `[hooks.state]` / `[projects]` entry and the managed hook block byte-identical. Same key+hash
|
|
1173
|
-
* ⇒ no-op. Only
|
|
1487
|
+
* ⇒ no-op. Only called for our authored inline or exact first-install plugin keys (never blanket trust).
|
|
1174
1488
|
*/
|
|
1175
1489
|
export function upsertCodexHookTrust(content, key, hash) {
|
|
1176
1490
|
const header = `[hooks.state.${JSON.stringify(key)}]`;
|
|
@@ -1574,15 +1888,12 @@ function escapeRegExp(value) {
|
|
|
1574
1888
|
}
|
|
1575
1889
|
// Module-private (P1 pin — NEVER exported). The REAL Codex profile-LOAD probe,
|
|
1576
1890
|
// extracted verbatim from launchHarness: dynamic imports keep it lazy for
|
|
1577
|
-
// production, execFn runs the real `codex -p <profile> mcp list`
|
|
1578
|
-
// (utf-8,
|
|
1579
|
-
// verifyProfilePreflight; tests substitute a controlled stub.
|
|
1891
|
+
// production, execFn runs the real `codex -p <profile> mcp list` through
|
|
1892
|
+
// execRuntimeProbe (utf-8, 10s bound, off the event loop). Injected as the
|
|
1893
|
+
// adapter's default verifyProfilePreflight; tests substitute a controlled stub.
|
|
1580
1894
|
async function defaultProfilePreflight(profile, selected) {
|
|
1581
1895
|
const { verifyCodexProfileLoads } = await import("../domain/codex-profile-preflight.js");
|
|
1582
|
-
const {
|
|
1583
|
-
const execFn = async (cmd) => runSyncSite("codex.runtime.profile_preflight", () => execSync(cmd, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 10_000,
|
|
1584
|
-
...(selected ? { cwd: selected.cwd, env: { ...process.env, CODEX_HOME: selected.codexHome, ...(selected.launchPath ? { PATH: selected.launchPath } : {}) } } : {}),
|
|
1585
|
-
}));
|
|
1896
|
+
const execFn = (cmd) => execRuntimeProbe("codex.runtime.profile_preflight", cmd, selected ? { cwd: selected.cwd, env: { ...process.env, CODEX_HOME: selected.codexHome, ...(selected.launchPath ? { PATH: selected.launchPath } : {}) } } : {});
|
|
1586
1897
|
return verifyCodexProfileLoads(profile, execFn, undefined, selected?.codexHome);
|
|
1587
1898
|
}
|
|
1588
1899
|
// Exported for unit test (B12-T): the REAL async sampling path — the anti-vacuity test drives
|