@openrig/cli 0.5.6 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/daemon/assets/plugins/openrig-core/README.md +1 -1
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +25 -2
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +95 -8
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +9 -1
- package/daemon/assets/plugins/openrig-core/skills/loading-addressable-markdown/SKILL.md +34 -0
- package/daemon/assets/plugins/openrig-core/skills/loading-addressable-markdown/scripts/resolve-markdown.mjs +170 -0
- package/daemon/assets/plugins/openrig-core/skills/openrig-skills/SKILL.md +1 -4
- package/daemon/assets/plugins/openrig-core/skills/retiring-and-inheriting-a-seat/SKILL.md +3 -3
- package/daemon/assets/plugins/openrig-core/skills/software-for-agents/SKILL.md +4 -9
- package/daemon/assets/vm-preview-fixtures/workflows/sample-basic-loop.yaml +3 -3
- package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +40 -15
- package/daemon/context-packs/skills/applying-a-permission-policy/SKILL.md +120 -0
- package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +10 -0
- package/daemon/context-packs/skills/claude-compaction-restore/SKILL.md +166 -0
- package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +18 -0
- package/daemon/context-packs/skills/claude-compaction-restore/scripts/precompact-hook.mjs +261 -0
- package/daemon/context-packs/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +495 -0
- package/daemon/context-packs/skills/claude-compaction-restore/templates/compact-instruction.md +1 -0
- package/daemon/context-packs/skills/claude-compaction-restore/templates/post-compact-restore-instruction.md +1 -0
- package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/SKILL.md +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/SKILL.md +1 -4
- package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-upgrade/SKILL.md +120 -355
- package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +9 -3
- package/daemon/context-packs/skills/core/openrig-upgrade/scripts/backup-sqlite.mjs +62 -0
- package/daemon/context-packs/skills/core/openrig-upgrade/scripts/inspect-upgrade.mjs +40 -0
- package/daemon/context-packs/skills/core/openrig-upgrade/scripts/refresh-managed-plugin.mjs +151 -0
- 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/SKILL.md +43 -0
- package/daemon/context-packs/skills/delegating-work/manifest.yaml +10 -0
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/SKILL.md +318 -0
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +10 -0
- package/daemon/context-packs/skills/loading-addressable-markdown/SKILL.md +34 -0
- package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +12 -0
- package/daemon/context-packs/skills/loading-addressable-markdown/scripts/resolve-markdown.mjs +170 -0
- package/daemon/context-packs/skills/mission-slice-sop/SKILL.md +94 -0
- package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +10 -0
- package/daemon/context-packs/skills/openrig-operating-model/SKILL.md +397 -0
- package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +30 -0
- package/daemon/context-packs/skills/openrig-operating-model/scripts/compose.py +572 -0
- package/daemon/context-packs/skills/openrig-operating-model/scripts/scaffold.sh +34 -0
- package/daemon/context-packs/skills/openrig-operating-model/scripts/trace-due.sh +32 -0
- package/daemon/context-packs/skills/openrig-operating-model/scripts/trace-stamp.sh +5 -0
- package/daemon/context-packs/skills/openrig-operating-model/scripts/trunk-diff.sh +18 -0
- package/daemon/context-packs/skills/openrig-operating-model/templates/LEARNED.md +40 -0
- package/daemon/context-packs/skills/openrig-operating-model/templates/NOTES.md +9 -0
- package/daemon/context-packs/skills/openrig-operating-model/templates/PLAYBOOK.md +5 -0
- package/daemon/context-packs/skills/openrig-operating-model/templates/SOP.md +24 -0
- package/daemon/context-packs/skills/openrig-operating-model/templates/SPEC.md +54 -0
- package/daemon/context-packs/skills/openrig-user/SKILL.md +1374 -0
- package/daemon/context-packs/skills/openrig-user/manifest.yaml +10 -0
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/CHANGELOG.md +64 -0
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/SKILL.md +250 -0
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +12 -0
- 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/SKILL.md +21 -15
- package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +3 -3
- 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/SKILL.md +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/SKILL.md +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/SKILL.md +192 -0
- package/daemon/context-packs/skills/queue-handoff/manifest.yaml +10 -0
- package/daemon/context-packs/skills/refocusing/SKILL.md +31 -0
- package/daemon/context-packs/skills/refocusing/manifest.yaml +14 -0
- package/daemon/context-packs/skills/refocusing/references/refocus.md +22 -0
- package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +264 -0
- package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/CHANGELOG.md +48 -0
- package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/SKILL.md +231 -0
- package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +12 -0
- package/daemon/context-packs/skills/seat-continuity-and-handover/SKILL.md +151 -0
- package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +16 -0
- package/daemon/context-packs/skills/seat-continuity-and-handover/references/apprentice-evidence-toolkit.md +32 -0
- package/daemon/context-packs/skills/seat-continuity-and-handover/references/apprentice-successor-seat-cutover.md +256 -0
- package/daemon/context-packs/skills/seat-continuity-and-handover/references/orchestrator-role.md +40 -0
- package/daemon/context-packs/skills/session-compaction-and-restore/SKILL.md +163 -0
- package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +10 -0
- package/daemon/context-packs/skills/software-for-agents/SKILL.md +187 -0
- package/daemon/context-packs/skills/software-for-agents/manifest.yaml +10 -0
- package/daemon/context-packs/world-example/manifest.yaml +1 -1
- package/daemon/context-packs/world-public/manifest.yaml +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +249 -2
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +6 -5
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +29 -12
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/builtins/workflow-specs/basic-loop.yaml +3 -3
- package/daemon/dist/builtins/workflow-specs/conveyor.yaml +1 -1
- package/daemon/dist/builtins/workflow-specs/factory-rsi.yaml +1 -1
- package/daemon/dist/db/all-migrations.d.ts +1 -1
- package/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +6 -2
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/077_node_session_source.d.ts +4 -0
- package/daemon/dist/db/migrations/077_node_session_source.d.ts.map +1 -0
- package/daemon/dist/db/migrations/077_node_session_source.js +6 -0
- package/daemon/dist/db/migrations/077_node_session_source.js.map +1 -0
- package/daemon/dist/db/migrations/078_idle_gate_fired_condition.d.ts +17 -0
- package/daemon/dist/db/migrations/078_idle_gate_fired_condition.d.ts.map +1 -0
- package/daemon/dist/db/migrations/078_idle_gate_fired_condition.js +21 -0
- package/daemon/dist/db/migrations/078_idle_gate_fired_condition.js.map +1 -0
- package/daemon/dist/domain/active-occupant.d.ts +6 -0
- package/daemon/dist/domain/active-occupant.d.ts.map +1 -1
- package/daemon/dist/domain/active-occupant.js +14 -0
- package/daemon/dist/domain/active-occupant.js.map +1 -1
- package/daemon/dist/domain/context-packs/manifest-parser.d.ts.map +1 -1
- package/daemon/dist/domain/context-packs/manifest-parser.js +5 -6
- package/daemon/dist/domain/context-packs/manifest-parser.js.map +1 -1
- package/daemon/dist/domain/context-packs/profile-composer.d.ts +1 -1
- package/daemon/dist/domain/context-packs/profile-composer.d.ts.map +1 -1
- package/daemon/dist/domain/context-packs/profile-composer.js +2 -2
- package/daemon/dist/domain/context-packs/profile-composer.js.map +1 -1
- package/daemon/dist/domain/context-packs/profile-source-resolver.d.ts +3 -1
- package/daemon/dist/domain/context-packs/profile-source-resolver.d.ts.map +1 -1
- package/daemon/dist/domain/context-packs/profile-source-resolver.js +3 -2
- package/daemon/dist/domain/context-packs/profile-source-resolver.js.map +1 -1
- package/daemon/dist/domain/current-work.d.ts +73 -0
- package/daemon/dist/domain/current-work.d.ts.map +1 -0
- package/daemon/dist/domain/current-work.js +225 -0
- package/daemon/dist/domain/current-work.js.map +1 -0
- package/daemon/dist/domain/execution-view.d.ts.map +1 -1
- package/daemon/dist/domain/execution-view.js +215 -13
- package/daemon/dist/domain/execution-view.js.map +1 -1
- package/daemon/dist/domain/gateway/human-registry.d.ts +3 -2
- package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/human-registry.js +113 -18
- package/daemon/dist/domain/gateway/human-registry.js.map +1 -1
- package/daemon/dist/domain/model-divergence/effective-model-readers.d.ts +3 -2
- package/daemon/dist/domain/model-divergence/effective-model-readers.d.ts.map +1 -1
- package/daemon/dist/domain/model-divergence/effective-model-readers.js +7 -5
- package/daemon/dist/domain/model-divergence/effective-model-readers.js.map +1 -1
- package/daemon/dist/domain/policies/idle-gate-qitem.d.ts +5 -5
- package/daemon/dist/domain/policies/idle-gate-qitem.d.ts.map +1 -1
- package/daemon/dist/domain/policies/idle-gate-qitem.js +130 -22
- package/daemon/dist/domain/policies/idle-gate-qitem.js.map +1 -1
- package/daemon/dist/domain/policies/types.d.ts +12 -0
- package/daemon/dist/domain/policies/types.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +37 -2
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +171 -16
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.d.ts +19 -0
- package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.js +33 -0
- package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
- package/daemon/dist/domain/reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/reconciler.js +4 -1
- package/daemon/dist/domain/reconciler.js.map +1 -1
- package/daemon/dist/domain/rehydrate-eligibility.d.ts +11 -1
- package/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
- package/daemon/dist/domain/rehydrate-eligibility.js +34 -0
- package/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +9 -0
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +32 -0
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.js +2 -2
- package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
- package/daemon/dist/domain/rig-lifecycle-service.d.ts +24 -4
- package/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/rig-lifecycle-service.js +116 -6
- package/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/rig-repository.d.ts +2 -1
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +7 -0
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.js +4 -0
- package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts +15 -9
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +68 -83
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-schema.d.ts +5 -1
- package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-schema.js +41 -2
- package/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.d.ts +32 -1
- package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.js +183 -4
- package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +5 -0
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +33 -7
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
- package/daemon/dist/domain/snapshot-capture.js +4 -2
- package/daemon/dist/domain/snapshot-capture.js.map +1 -1
- package/daemon/dist/domain/topology-defaults-installer.d.ts +4 -2
- package/daemon/dist/domain/topology-defaults-installer.d.ts.map +1 -1
- package/daemon/dist/domain/topology-defaults-installer.js +27 -0
- package/daemon/dist/domain/topology-defaults-installer.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +3 -1
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/up-command-router.d.ts.map +1 -1
- package/daemon/dist/domain/up-command-router.js +19 -0
- package/daemon/dist/domain/up-command-router.js.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts +9 -0
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.js +15 -2
- package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts +7 -0
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +47 -0
- package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
- package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
- package/daemon/dist/domain/workspace/default-workspace-scaffold.js +37 -2
- package/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
- package/daemon/dist/routes/context-packs.d.ts.map +1 -1
- package/daemon/dist/routes/context-packs.js +146 -6
- package/daemon/dist/routes/context-packs.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +31 -10
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/rigs.js +17 -6
- package/daemon/dist/routes/rigs.js.map +1 -1
- package/daemon/dist/routes/rigspec.d.ts.map +1 -1
- package/daemon/dist/routes/rigspec.js +37 -0
- package/daemon/dist/routes/rigspec.js.map +1 -1
- package/daemon/dist/routes/sessions.js +7 -3
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/up.js +10 -3
- package/daemon/dist/routes/up.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +19 -7
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/agent-spec.md +34 -1
- package/daemon/docs/reference/chain-file-convention.md +17 -12
- package/daemon/docs/reference/mission-install.md +23 -2
- package/daemon/docs/reference/product-journey-sdlc.md +305 -0
- package/daemon/docs/reference/release-boundary.md +29 -5
- package/daemon/docs/reference/sdlc-conventions.md +15 -2
- package/daemon/specs/agents/apps/vault-specialist/agent.yaml +1 -1
- package/daemon/specs/agents/apps/vault-specialist/guidance/role.md +0 -1
- package/daemon/specs/agents/conveyor/builder/agent.yaml +1 -1
- package/daemon/specs/agents/conveyor/builder/guidance/role.md +0 -1
- package/daemon/specs/agents/conveyor/lead/agent.yaml +1 -1
- package/daemon/specs/agents/conveyor/lead/guidance/role.md +0 -3
- package/daemon/specs/agents/conveyor/planner/agent.yaml +1 -1
- package/daemon/specs/agents/conveyor/planner/guidance/role.md +0 -1
- package/daemon/specs/agents/design/product-designer/agent.yaml +3 -4
- package/daemon/specs/agents/design/product-designer/guidance/role.md +0 -3
- package/daemon/specs/agents/development/implementer/agent.yaml +3 -4
- package/daemon/specs/agents/development/implementer/guidance/role.md +0 -3
- package/daemon/specs/agents/development/qa/agent.yaml +4 -4
- package/daemon/specs/agents/development/qa/guidance/role.md +1 -4
- package/daemon/specs/agents/factory-rsi/dogfood/agent.yaml +1 -1
- package/daemon/specs/agents/factory-rsi/release-manager/agent.yaml +1 -1
- package/daemon/specs/agents/orchestration/orchestrator/agent.yaml +3 -4
- package/daemon/specs/agents/orchestration/orchestrator/guidance/role.md +0 -4
- package/daemon/specs/agents/review/independent-reviewer/agent.yaml +3 -4
- package/daemon/specs/agents/review/independent-reviewer/guidance/role.md +0 -3
- package/daemon/specs/agents/shared/agent.yaml +2 -10
- package/daemon/specs/agents/shared/skills/core/agent-startup-and-context-ingestion/SKILL.md +1 -1
- package/daemon/specs/agents/shared/skills/core/openrig-skills/SKILL.md +1 -4
- package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +120 -355
- package/daemon/specs/agents/shared/skills/core/openrig-upgrade/scripts/backup-sqlite.mjs +62 -0
- package/daemon/specs/agents/shared/skills/core/openrig-upgrade/scripts/inspect-upgrade.mjs +40 -0
- package/daemon/specs/agents/shared/skills/core/openrig-upgrade/scripts/refresh-managed-plugin.mjs +151 -0
- package/daemon/specs/agents/shared/skills/pm/requirements-writer/SKILL.md +21 -15
- package/daemon/specs/agents/shared/skills/pods/orchestration-team/SKILL.md +1 -1
- package/daemon/specs/agents/shared/skills/pods/review-team/SKILL.md +1 -1
- package/daemon/specs/rigs/launch/kernel/agents/advisor/lead/agent.yaml +1 -1
- package/daemon/specs/rigs/launch/kernel/agents/advisor/lead/guidance/role.md +2 -3
- package/daemon/specs/rigs/preview/product-team/topology/instance/CRAFT.md +4 -4
- package/daemon/specs/rigs/preview/product-team/topology/rig/ORCHESTRATION-CRAFT.md +3 -3
- package/dist/build-info.js +3 -3
- package/dist/commands/config-init-workspace.d.ts.map +1 -1
- package/dist/commands/config-init-workspace.js +38 -3
- package/dist/commands/config-init-workspace.js.map +1 -1
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +90 -7
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/create.d.ts +4 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +84 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/grow.d.ts +4 -0
- package/dist/commands/grow.d.ts.map +1 -0
- package/dist/commands/grow.js +182 -0
- package/dist/commands/grow.js.map +1 -0
- package/dist/commands/import.d.ts.map +1 -1
- package/dist/commands/import.js +27 -1
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/remove.d.ts.map +1 -1
- package/dist/commands/remove.js +9 -1
- package/dist/commands/remove.js.map +1 -1
- package/dist/commands/rig.d.ts.map +1 -1
- package/dist/commands/rig.js +48 -1
- package/dist/commands/rig.js.map +1 -1
- package/dist/commands/scope.d.ts.map +1 -1
- package/dist/commands/scope.js +21 -2
- package/dist/commands/scope.js.map +1 -1
- package/dist/commands/shrink.d.ts.map +1 -1
- package/dist/commands/shrink.js +6 -1
- package/dist/commands/shrink.js.map +1 -1
- package/dist/commands/topology-default-agent.d.ts +4 -0
- package/dist/commands/topology-default-agent.d.ts.map +1 -0
- package/dist/commands/topology-default-agent.js +13 -0
- package/dist/commands/topology-default-agent.js.map +1 -0
- package/dist/commands/walk.d.ts.map +1 -1
- package/dist/commands/walk.js +3 -0
- package/dist/commands/walk.js.map +1 -1
- package/dist/commands/watchdog.d.ts.map +1 -1
- package/dist/commands/watchdog.js +51 -3
- package/dist/commands/watchdog.js.map +1 -1
- package/dist/front-door.d.ts.map +1 -1
- package/dist/front-door.js +16 -4
- package/dist/front-door.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/topology-trace.d.ts +3 -2
- package/dist/lib/topology-trace.d.ts.map +1 -1
- package/dist/lib/topology-trace.js +12 -2
- package/dist/lib/topology-trace.js.map +1 -1
- package/dist/lib/work-install.d.ts +39 -0
- package/dist/lib/work-install.d.ts.map +1 -0
- package/dist/lib/work-install.js +312 -0
- package/dist/lib/work-install.js.map +1 -0
- package/node_modules/@openrig/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/adapters/codex-runtime-adapter.js +249 -2
- package/node_modules/@openrig/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/adapters/tmux.d.ts +6 -5
- package/node_modules/@openrig/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/adapters/tmux.js +29 -12
- package/node_modules/@openrig/daemon/dist/adapters/tmux.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/build-info.js +3 -3
- package/node_modules/@openrig/daemon/dist/builtins/workflow-specs/basic-loop.yaml +3 -3
- package/node_modules/@openrig/daemon/dist/builtins/workflow-specs/conveyor.yaml +1 -1
- package/node_modules/@openrig/daemon/dist/builtins/workflow-specs/factory-rsi.yaml +1 -1
- package/node_modules/@openrig/daemon/dist/db/all-migrations.d.ts +1 -1
- package/node_modules/@openrig/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/db/all-migrations.js +6 -2
- package/node_modules/@openrig/daemon/dist/db/all-migrations.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/db/migrations/077_node_session_source.d.ts +4 -0
- package/node_modules/@openrig/daemon/dist/db/migrations/077_node_session_source.d.ts.map +1 -0
- package/node_modules/@openrig/daemon/dist/db/migrations/077_node_session_source.js +6 -0
- package/node_modules/@openrig/daemon/dist/db/migrations/077_node_session_source.js.map +1 -0
- package/node_modules/@openrig/daemon/dist/db/migrations/078_idle_gate_fired_condition.d.ts +17 -0
- package/node_modules/@openrig/daemon/dist/db/migrations/078_idle_gate_fired_condition.d.ts.map +1 -0
- package/node_modules/@openrig/daemon/dist/db/migrations/078_idle_gate_fired_condition.js +21 -0
- package/node_modules/@openrig/daemon/dist/db/migrations/078_idle_gate_fired_condition.js.map +1 -0
- package/node_modules/@openrig/daemon/dist/domain/active-occupant.d.ts +6 -0
- package/node_modules/@openrig/daemon/dist/domain/active-occupant.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/active-occupant.js +14 -0
- package/node_modules/@openrig/daemon/dist/domain/active-occupant.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.js +5 -6
- package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.d.ts +1 -1
- package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.js +2 -2
- package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-source-resolver.d.ts +3 -1
- package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-source-resolver.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-source-resolver.js +3 -2
- package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-source-resolver.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/current-work.d.ts +73 -0
- package/node_modules/@openrig/daemon/dist/domain/current-work.d.ts.map +1 -0
- package/node_modules/@openrig/daemon/dist/domain/current-work.js +225 -0
- package/node_modules/@openrig/daemon/dist/domain/current-work.js.map +1 -0
- package/node_modules/@openrig/daemon/dist/domain/execution-view.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/execution-view.js +215 -13
- package/node_modules/@openrig/daemon/dist/domain/execution-view.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.d.ts +3 -2
- package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.js +113 -18
- package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/model-divergence/effective-model-readers.d.ts +3 -2
- package/node_modules/@openrig/daemon/dist/domain/model-divergence/effective-model-readers.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/model-divergence/effective-model-readers.js +7 -5
- package/node_modules/@openrig/daemon/dist/domain/model-divergence/effective-model-readers.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/policies/idle-gate-qitem.d.ts +5 -5
- package/node_modules/@openrig/daemon/dist/domain/policies/idle-gate-qitem.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/policies/idle-gate-qitem.js +130 -22
- package/node_modules/@openrig/daemon/dist/domain/policies/idle-gate-qitem.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/policies/types.d.ts +12 -0
- package/node_modules/@openrig/daemon/dist/domain/policies/types.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/queue-repository.d.ts +37 -2
- package/node_modules/@openrig/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/queue-repository.js +171 -16
- package/node_modules/@openrig/daemon/dist/domain/queue-repository.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/queue-wake-repository.d.ts +19 -0
- package/node_modules/@openrig/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/queue-wake-repository.js +33 -0
- package/node_modules/@openrig/daemon/dist/domain/queue-wake-repository.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/reconciler.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/reconciler.js +4 -1
- package/node_modules/@openrig/daemon/dist/domain/reconciler.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/rehydrate-eligibility.d.ts +11 -1
- package/node_modules/@openrig/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/rehydrate-eligibility.js +34 -0
- package/node_modules/@openrig/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.d.ts +9 -0
- package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.js +32 -0
- package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/restore-plan-preview.js +2 -2
- package/node_modules/@openrig/daemon/dist/domain/restore-plan-preview.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/rig-lifecycle-service.d.ts +24 -4
- package/node_modules/@openrig/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/rig-lifecycle-service.js +116 -6
- package/node_modules/@openrig/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/rig-repository.d.ts +2 -1
- package/node_modules/@openrig/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/rig-repository.js +7 -0
- package/node_modules/@openrig/daemon/dist/domain/rig-repository.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/rigspec-exporter.js +4 -0
- package/node_modules/@openrig/daemon/dist/domain/rigspec-exporter.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.d.ts +15 -9
- package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.js +68 -83
- package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.d.ts +5 -1
- package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.js +41 -2
- package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.d.ts +32 -1
- package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.js +183 -4
- package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/session-transport.d.ts +5 -0
- package/node_modules/@openrig/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/session-transport.js +33 -7
- package/node_modules/@openrig/daemon/dist/domain/session-transport.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.js +4 -2
- package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.d.ts +4 -2
- package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.js +27 -0
- package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/types.d.ts +3 -1
- package/node_modules/@openrig/daemon/dist/domain/types.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/types.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/up-command-router.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/up-command-router.js +19 -0
- package/node_modules/@openrig/daemon/dist/domain/up-command-router.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/watchdog-jobs-repository.d.ts +9 -0
- package/node_modules/@openrig/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/watchdog-jobs-repository.js +15 -2
- package/node_modules/@openrig/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.d.ts +7 -0
- package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.js +47 -0
- package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/workspace/default-workspace-scaffold.js +37 -2
- package/node_modules/@openrig/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/context-packs.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/context-packs.js +146 -6
- package/node_modules/@openrig/daemon/dist/routes/context-packs.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/queue.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/queue.js +31 -10
- package/node_modules/@openrig/daemon/dist/routes/queue.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/rigs.js +17 -6
- package/node_modules/@openrig/daemon/dist/routes/rigs.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/rigspec.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/rigspec.js +37 -0
- package/node_modules/@openrig/daemon/dist/routes/rigspec.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/sessions.js +7 -3
- package/node_modules/@openrig/daemon/dist/routes/sessions.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/up.js +10 -3
- package/node_modules/@openrig/daemon/dist/routes/up.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/startup.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/startup.js +19 -7
- package/node_modules/@openrig/daemon/dist/startup.js.map +1 -1
- package/node_modules/@openrig/daemon/package.json +1 -1
- package/package.json +2 -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 +4 -0
- package/tui/dist/daemon-client.js.map +1 -1
- package/tui/dist/execution/execution-model.d.ts +19 -0
- package/tui/dist/execution/execution-model.d.ts.map +1 -0
- package/tui/dist/execution/execution-model.js +518 -0
- package/tui/dist/execution/execution-model.js.map +1 -0
- package/tui/dist/hydrate.d.ts +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +6 -2
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/input.d.ts +7 -0
- package/tui/dist/input.d.ts.map +1 -1
- package/tui/dist/input.js +13 -0
- package/tui/dist/input.js.map +1 -1
- package/tui/dist/live.d.ts +10 -0
- package/tui/dist/live.d.ts.map +1 -1
- package/tui/dist/live.js +34 -1
- package/tui/dist/live.js.map +1 -1
- package/tui/dist/main.js +22 -3
- package/tui/dist/main.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +13 -2
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/scopes/scopes-model.d.ts +1 -0
- package/tui/dist/scopes/scopes-model.d.ts.map +1 -1
- package/tui/dist/scopes/scopes-model.js +4 -2
- package/tui/dist/scopes/scopes-model.js.map +1 -1
- package/tui/dist/sections.js +2 -2
- package/tui/dist/sections.js.map +1 -1
- package/tui/dist/state.d.ts.map +1 -1
- package/tui/dist/state.js +15 -2
- package/tui/dist/state.js.map +1 -1
- package/tui/dist/stylize.js +2 -2
- package/tui/dist/stylize.js.map +1 -1
- package/tui/dist/types.d.ts +20 -0
- package/tui/dist/types.d.ts.map +1 -1
- package/daemon/context-packs/skills/process/brainstorming/OPENRIG.md +0 -48
- package/daemon/context-packs/skills/process/brainstorming/SKILL.md +0 -107
- package/daemon/context-packs/skills/process/brainstorming/manifest.yaml +0 -12
- package/daemon/context-packs/skills/process/executing-plans/OPENRIG.md +0 -56
- package/daemon/context-packs/skills/process/executing-plans/SKILL.md +0 -94
- package/daemon/context-packs/skills/process/executing-plans/manifest.yaml +0 -12
- package/daemon/context-packs/skills/process/using-superpowers/OPENRIG.md +0 -48
- package/daemon/context-packs/skills/process/using-superpowers/SKILL.md +0 -106
- package/daemon/context-packs/skills/process/using-superpowers/manifest.yaml +0 -12
- package/daemon/context-packs/skills/process/writing-plans/OPENRIG.md +0 -52
- package/daemon/context-packs/skills/process/writing-plans/SKILL.md +0 -126
- package/daemon/context-packs/skills/process/writing-plans/manifest.yaml +0 -12
- package/daemon/specs/agents/shared/skills/process/brainstorming/OPENRIG.md +0 -48
- package/daemon/specs/agents/shared/skills/process/brainstorming/SKILL.md +0 -107
- package/daemon/specs/agents/shared/skills/process/executing-plans/OPENRIG.md +0 -56
- package/daemon/specs/agents/shared/skills/process/executing-plans/SKILL.md +0 -94
- package/daemon/specs/agents/shared/skills/process/using-superpowers/OPENRIG.md +0 -48
- package/daemon/specs/agents/shared/skills/process/using-superpowers/SKILL.md +0 -106
- package/daemon/specs/agents/shared/skills/process/writing-plans/OPENRIG.md +0 -52
- package/daemon/specs/agents/shared/skills/process/writing-plans/SKILL.md +0 -126
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
|
|
7
|
+
const skillRoot = path.resolve(new URL("..", import.meta.url).pathname);
|
|
8
|
+
const restoreScript = path.join(skillRoot, "scripts", "restore-from-jsonl.mjs");
|
|
9
|
+
// P6(C) injectable output-root: the packet base defaults to the shared
|
|
10
|
+
// /tmp/claude-compaction-restore (production), but becomes per-run isolated when the
|
|
11
|
+
// hermetic env-var OPENRIG_COMPACTION_OUT_ROOT is set — so concurrent writers with the
|
|
12
|
+
// same injected clock + sessionId no longer collide on the same `${sessionId}-${stamp}`
|
|
13
|
+
// dir. Mirrors the injectable-clock seam (OPENRIG_TEST_CLOCK_NOW). Empty/absent = /tmp.
|
|
14
|
+
const outRoot = process.env.OPENRIG_COMPACTION_OUT_ROOT || "/tmp/claude-compaction-restore";
|
|
15
|
+
const defaultRestoreInstruction =
|
|
16
|
+
"Read the claude-compaction-restore skill and follow its \"If You Just Compacted\" protocol.";
|
|
17
|
+
|
|
18
|
+
function emit(payload) {
|
|
19
|
+
process.stdout.write(`${JSON.stringify(payload)}\n`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function readHookInput() {
|
|
23
|
+
const raw = fs.readFileSync(0, "utf8").trim();
|
|
24
|
+
if (!raw) return {};
|
|
25
|
+
return JSON.parse(raw);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function getOpenRigHome() {
|
|
29
|
+
return process.env.OPENRIG_HOME || process.env.RIGGED_HOME || path.join(os.homedir(), ".openrig");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// A3-R3 injectable clock (slice 51-01): marker.createdAt defaults to real wall-clock,
|
|
33
|
+
// but becomes deterministic when the shared hermetic env-var OPENRIG_TEST_CLOCK_NOW is
|
|
34
|
+
// set (an ISO instant). Empty/absent = production real-time.
|
|
35
|
+
function nowIso() {
|
|
36
|
+
const injected = process.env.OPENRIG_TEST_CLOCK_NOW;
|
|
37
|
+
return typeof injected === "string" && injected.trim().length > 0 ? injected : new Date().toISOString();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function expandInstructionPath(filePath) {
|
|
41
|
+
if (filePath.startsWith("~/")) return path.join(os.homedir(), filePath.slice(2));
|
|
42
|
+
if (filePath.startsWith("${OPENRIG_HOME}/")) {
|
|
43
|
+
return path.join(getOpenRigHome(), filePath.slice("${OPENRIG_HOME}/".length));
|
|
44
|
+
}
|
|
45
|
+
if (filePath.startsWith("$OPENRIG_HOME/")) {
|
|
46
|
+
return path.join(getOpenRigHome(), filePath.slice("$OPENRIG_HOME/".length));
|
|
47
|
+
}
|
|
48
|
+
return filePath;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function readInstructionFile(filePath) {
|
|
52
|
+
const expanded = expandInstructionPath(filePath);
|
|
53
|
+
if (!fs.existsSync(expanded)) return "";
|
|
54
|
+
return fs.readFileSync(expanded, "utf8");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// OPR.0.4.1.09 / R5 marker-lifecycle (foreign-content-in-marker face): the hook
|
|
58
|
+
// path must apply the SAME seat-check the daemon enforcer's resolvePostCompactExtra
|
|
59
|
+
// applies (rev1-r2 dcd95bd9), or a FOREIGN seat's global messageFilePath leaks into
|
|
60
|
+
// THIS seat's marker. Parse a WELL-FORMED leading `---` frontmatter for a declared
|
|
61
|
+
// seat (target_seat / seat / session); body text is never scanned; a broken/absent
|
|
62
|
+
// fence is GENERIC (valid for any seat). Byte-mirrors the enforcer regexes.
|
|
63
|
+
function declaredSeatOf(content) {
|
|
64
|
+
const fm = /^\s*---\s*\n([\s\S]*?)\n---/.exec(content);
|
|
65
|
+
if (!fm) return null;
|
|
66
|
+
const m = /^[ \t]*(?:target[_-]?seat|seat|session(?:[_-]?name)?)[ \t]*:[ \t]*["']?([^"'\n#]+?)["']?[ \t]*$/im.exec(fm[1]);
|
|
67
|
+
return m ? m[1].trim() : null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function sanitizeSeat(value) {
|
|
71
|
+
return value.replace(/[^a-zA-Z0-9_.@-]/g, "_");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Resolve the post-compaction extra FOR THIS SEAT (mirror of the enforcer): (1) prefer
|
|
75
|
+
// a per-seat compaction/post-compact-extra/<seat>.md — no cross-seat contamination
|
|
76
|
+
// possible; (2) fall back to the global ONLY when it does not declare a DIFFERENT seat
|
|
77
|
+
// (a wrong-seat global is REFUSED). Generic/undeclared/configured-but-absent stay
|
|
78
|
+
// allowed. Returns the path to read, or null when nothing valid for this seat.
|
|
79
|
+
function resolveSeatSafeExtraPath(globalFilePathRaw) {
|
|
80
|
+
const rawSeat = process.env.OPENRIG_SESSION_NAME || process.env.RIGGED_SESSION_NAME || "";
|
|
81
|
+
const seatKey = rawSeat ? sanitizeSeat(rawSeat) : "";
|
|
82
|
+
if (seatKey) {
|
|
83
|
+
const perSeatPath = path.join(getOpenRigHome(), "compaction", "post-compact-extra", `${seatKey}.md`);
|
|
84
|
+
if (fs.existsSync(perSeatPath)) {
|
|
85
|
+
const declared = declaredSeatOf(fs.readFileSync(perSeatPath, "utf8"));
|
|
86
|
+
if (declared && sanitizeSeat(declared) !== seatKey) return null; // wrong-seat per-seat file
|
|
87
|
+
return perSeatPath;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const trimmed = (globalFilePathRaw || "").trim();
|
|
91
|
+
if (!trimmed) return null;
|
|
92
|
+
const expanded = expandInstructionPath(trimmed);
|
|
93
|
+
// configured-but-absent: keep the path (an absent file cannot be a wrong-seat leak;
|
|
94
|
+
// readInstructionFile returns "" so nothing is appended).
|
|
95
|
+
if (!fs.existsSync(expanded)) return trimmed;
|
|
96
|
+
const declared = declaredSeatOf(fs.readFileSync(expanded, "utf8"));
|
|
97
|
+
if (declared && sanitizeSeat(declared) !== seatKey) return null; // foreign-seat global REFUSED
|
|
98
|
+
return trimmed;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function sessionKey(input) {
|
|
102
|
+
const raw = [
|
|
103
|
+
process.env.OPENRIG_SESSION_NAME,
|
|
104
|
+
process.env.RIGGED_SESSION_NAME,
|
|
105
|
+
input.session_id,
|
|
106
|
+
input.sessionId,
|
|
107
|
+
input.session_name,
|
|
108
|
+
input.sessionName,
|
|
109
|
+
input.transcript_path ? path.basename(input.transcript_path, ".jsonl") : "",
|
|
110
|
+
].find((value) => typeof value === "string" && value.trim().length > 0) || "unknown-session";
|
|
111
|
+
return raw.replace(/[^a-zA-Z0-9_.@-]/g, "_");
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function pendingMarkerPath(input) {
|
|
115
|
+
return path.join(getOpenRigHome(), "compaction", "restore-pending", `${sessionKey(input)}.json`);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// R5 absent-when-needed: drop a lightweight EXPECTED sentinel FIRST (before the packet is
|
|
119
|
+
// generated + the marker is written), carrying the SAME identity binding the marker gets.
|
|
120
|
+
// Its presence-without-a-marker is what lets the bridge be LOUD about a missing packet
|
|
121
|
+
// (hook died partway / write failed); policy off = no hook = no sentinel = silent.
|
|
122
|
+
function writeExpectedSentinel(input) {
|
|
123
|
+
const p = path.join(getOpenRigHome(), "compaction", "restore-pending", `${sessionKey(input)}.expected.json`);
|
|
124
|
+
fs.mkdirSync(path.dirname(p), { recursive: true });
|
|
125
|
+
fs.writeFileSync(p, `${JSON.stringify({
|
|
126
|
+
version: 1,
|
|
127
|
+
sessionName: process.env.OPENRIG_SESSION_NAME || process.env.RIGGED_SESSION_NAME || null,
|
|
128
|
+
sessionId: input.session_id || input.sessionId || null,
|
|
129
|
+
transcriptPath: input.transcript_path || null,
|
|
130
|
+
createdAt: nowIso(),
|
|
131
|
+
}, null, 2)}\n`, "utf8");
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function writePendingRestoreMarker(input, parsed, restoreInstruction, customMessage) {
|
|
135
|
+
const markerPath = pendingMarkerPath(input);
|
|
136
|
+
fs.mkdirSync(path.dirname(markerPath), { recursive: true });
|
|
137
|
+
const payload = {
|
|
138
|
+
version: 1,
|
|
139
|
+
createdAt: nowIso(),
|
|
140
|
+
sessionName: process.env.OPENRIG_SESSION_NAME || process.env.RIGGED_SESSION_NAME || null,
|
|
141
|
+
sessionId: input.session_id || input.sessionId || null,
|
|
142
|
+
transcriptPath: input.transcript_path || null,
|
|
143
|
+
cwd: input.cwd || null,
|
|
144
|
+
outputDir: parsed.outputDir,
|
|
145
|
+
restoreInstruction,
|
|
146
|
+
postCompactInstruction: customMessage || "",
|
|
147
|
+
expectedAck: "restored from packet at <path>; resumed at step <X>",
|
|
148
|
+
deliveredAt: null,
|
|
149
|
+
deliveryCount: 0,
|
|
150
|
+
};
|
|
151
|
+
fs.writeFileSync(markerPath, `${JSON.stringify(payload, null, 2)}\n`, "utf8");
|
|
152
|
+
return markerPath;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Slice 27 — read the OpenRig config directly (no daemon HTTP dependency
|
|
156
|
+
// so the hook still works when the daemon isn't running or isn't
|
|
157
|
+
// reachable from this process). Returns "" for either field when the
|
|
158
|
+
// config is missing, malformed, or the policy isn't set. If the policy is
|
|
159
|
+
// enabled but restore text has not been written yet, use OpenRig's default
|
|
160
|
+
// instruction to load the canonical restore skill. Inline instructions and
|
|
161
|
+
// file-path content are both included when both are configured.
|
|
162
|
+
function readClaudeCompactionMessage() {
|
|
163
|
+
const configPath = path.join(getOpenRigHome(), "config.json");
|
|
164
|
+
let inline = "";
|
|
165
|
+
let filePath = "";
|
|
166
|
+
let inlineConfigured = false;
|
|
167
|
+
let filePathConfigured = false;
|
|
168
|
+
let policyEnabled = false;
|
|
169
|
+
try {
|
|
170
|
+
if (!fs.existsSync(configPath)) return "";
|
|
171
|
+
const raw = fs.readFileSync(configPath, "utf8");
|
|
172
|
+
const parsed = JSON.parse(raw);
|
|
173
|
+
const policy = parsed?.policies?.claudeCompaction;
|
|
174
|
+
if (policy && typeof policy === "object") {
|
|
175
|
+
policyEnabled = policy.enabled === true;
|
|
176
|
+
if (typeof policy.messageInline === "string") {
|
|
177
|
+
inlineConfigured = true;
|
|
178
|
+
inline = policy.messageInline;
|
|
179
|
+
}
|
|
180
|
+
if (typeof policy.messageFilePath === "string") {
|
|
181
|
+
filePathConfigured = true;
|
|
182
|
+
filePath = policy.messageFilePath;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
} catch {
|
|
186
|
+
return "";
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const parts = [];
|
|
190
|
+
if (inline && inline.length > 0) {
|
|
191
|
+
parts.push(`Inline restore instruction:\n${inline}`);
|
|
192
|
+
}
|
|
193
|
+
if (filePath && filePath.length > 0) {
|
|
194
|
+
// R5 seat-check: resolve to the per-seat extra or a seat-safe global; a
|
|
195
|
+
// foreign-seat global resolves to null and is never injected into this marker.
|
|
196
|
+
const resolved = resolveSeatSafeExtraPath(filePath);
|
|
197
|
+
if (resolved) {
|
|
198
|
+
try {
|
|
199
|
+
const fileText = readInstructionFile(resolved);
|
|
200
|
+
if (fileText) {
|
|
201
|
+
parts.push(`Additional restore instruction file (${resolved}):\n${fileText}`);
|
|
202
|
+
}
|
|
203
|
+
} catch {
|
|
204
|
+
// Keep any inline instruction; unreadable extra files degrade quietly.
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (parts.length > 0) return parts.join("\n\n");
|
|
209
|
+
if (policyEnabled && !inlineConfigured && !filePathConfigured) {
|
|
210
|
+
return defaultRestoreInstruction;
|
|
211
|
+
}
|
|
212
|
+
return "";
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function buildSystemMessage(restoreInstruction, customMessage) {
|
|
216
|
+
if (!customMessage) return restoreInstruction;
|
|
217
|
+
return `${restoreInstruction}\n\n--- Operator-configured post-compaction restore instruction ---\n${customMessage}`;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
try {
|
|
221
|
+
// Slice 51-01 RIDER (leak-visibility, review-r1 escalation): OPENRIG_TEST_CLOCK_NOW is
|
|
222
|
+
// read by nowIso() to make createdAt deterministic in tests — but a LEAKED var in a
|
|
223
|
+
// real seat would silently FREEZE production createdAt. Announce loudly on stderr when
|
|
224
|
+
// active so any leak is visible in seat logs; absence stays silent (production path).
|
|
225
|
+
// MUST stay byte-identical to STUB_CLOCK_ANNOUNCEMENT in stub-runner.ts.
|
|
226
|
+
if (typeof process.env.OPENRIG_TEST_CLOCK_NOW === "string" && process.env.OPENRIG_TEST_CLOCK_NOW.trim().length > 0) {
|
|
227
|
+
process.stderr.write("OPENRIG_TEST_CLOCK_NOW active — timestamps are injected\n");
|
|
228
|
+
}
|
|
229
|
+
const input = readHookInput();
|
|
230
|
+
writeExpectedSentinel(input); // R5: sentinel FIRST, before the packet + marker (catches hook-died-partway)
|
|
231
|
+
const args = [restoreScript, "--out", outRoot, "--json"];
|
|
232
|
+
if (input.cwd) args.push("--cwd", input.cwd);
|
|
233
|
+
if (input.transcript_path && input.transcript_path.endsWith(".jsonl") && fs.existsSync(input.transcript_path)) {
|
|
234
|
+
args.push(input.transcript_path);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const customMessage = readClaudeCompactionMessage();
|
|
238
|
+
|
|
239
|
+
const result = spawnSync("node", args, { encoding: "utf8" });
|
|
240
|
+
if (result.status !== 0) {
|
|
241
|
+
const baseFailure = `Claude compaction restore packet generation failed: ${(result.stderr || result.stdout || "unknown error").trim()}. After compaction, load the claude-compaction-restore skill and run restore-from-jsonl manually.`;
|
|
242
|
+
emit({
|
|
243
|
+
continue: true,
|
|
244
|
+
systemMessage: buildSystemMessage(baseFailure, customMessage),
|
|
245
|
+
});
|
|
246
|
+
process.exit(0);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const parsed = JSON.parse(result.stdout);
|
|
250
|
+
const baseRestore = `Pre-compaction restore seed packet prepared at ${parsed.outputDir}. This hook output is informational. After compaction, OpenRig may send a later normal user message asking you to restore from this packet; treat that later normal user message as the action request. The restore protocol is: load/read the claude-compaction-restore skill, run "node ~/.claude/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs --out /tmp/claude-compaction-restore --json" yourself when needed, read the generated restore-instructions.md, read the generated touched-files.md, identify remembered important files, read those files in full, read root/as-built/codemap docs before real work, then reply with "restored from packet at <path>; resumed at step <X>" with the files you read in full. If any step fails, report the failure explicitly.`;
|
|
251
|
+
const markerPath = writePendingRestoreMarker(input, parsed, baseRestore, customMessage);
|
|
252
|
+
emit({
|
|
253
|
+
continue: true,
|
|
254
|
+
systemMessage: buildSystemMessage(`${baseRestore} OpenRig also wrote a pending restore marker at ${markerPath}.`, customMessage),
|
|
255
|
+
});
|
|
256
|
+
} catch (error) {
|
|
257
|
+
emit({
|
|
258
|
+
continue: true,
|
|
259
|
+
systemMessage: `Claude compaction restore hook errored: ${error.message}. After compaction, load the claude-compaction-restore skill and run restore-from-jsonl manually.`,
|
|
260
|
+
});
|
|
261
|
+
}
|