@openrig/cli 0.6.14 → 0.7.1
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 +14 -12
- package/daemon/assets/claude-statusline-context.cjs +13 -3
- package/daemon/assets/guidance/openrig-seat-skills.md +1 -0
- package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/README.md +11 -4
- package/daemon/assets/plugins/openrig-core/hooks/claude.json +11 -11
- package/daemon/assets/plugins/openrig-core/hooks/codex.json +6 -6
- package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +22 -9
- package/daemon/assets/plugins/openrig-core/hooks/scripts/codex-hook-trust.cjs +49 -0
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus-health.cjs +2 -2
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +35 -11
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +9 -2
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +1 -1
- package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +16 -10
- package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +43 -4
- package/daemon/assets/plugins/openrig-core/skills/openrig-skills/SKILL.md +2 -2
- package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +192 -61
- package/daemon/assets/plugins/openrig-core/skills/queue-handoff/SKILL.md +10 -4
- package/daemon/assets/skills/rigs/SKILL.md +26 -6
- 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 +209 -33
- package/daemon/context-packs/reference/getting-started.md +148 -23
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +83 -3
- package/daemon/context-packs/reference/whats-new.md +173 -69
- 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/claude-compaction-restore/scripts/precompact-hook.mjs +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 +43 -4
- 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/SKILL.md +3 -0
- 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-software-factory/references/worked-example.md +2 -2
- 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 +16 -10
- 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 +192 -61
- 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/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 +127 -32
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/claude-resume.d.ts +2 -1
- package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-resume.js +10 -3
- package/daemon/dist/adapters/claude-resume.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 +75 -3
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +592 -91
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts +21 -2
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.js +90 -8
- package/daemon/dist/adapters/community-harness-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 +13 -0
- package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.js +64 -16
- package/daemon/dist/adapters/pi-runner.js.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.js +9 -6
- package/daemon/dist/adapters/pi-runtime-adapter.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/stub-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/stub-runtime-adapter.js +9 -5
- package/daemon/dist/adapters/stub-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +36 -5
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +162 -33
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/attention-surface.d.ts +14 -0
- package/daemon/dist/attention-surface.d.ts.map +1 -1
- package/daemon/dist/attention-surface.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/daemon-db-path.d.ts +6 -0
- package/daemon/dist/daemon-db-path.d.ts.map +1 -1
- package/daemon/dist/daemon-db-path.js +65 -1
- package/daemon/dist/daemon-db-path.js.map +1 -1
- package/daemon/dist/daemon-shutdown.d.ts.map +1 -1
- package/daemon/dist/daemon-shutdown.js +4 -2
- package/daemon/dist/daemon-shutdown.js.map +1 -1
- package/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +28 -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/db/migrations/124_context_usage_watchdog_units.d.ts +4 -0
- package/daemon/dist/db/migrations/124_context_usage_watchdog_units.d.ts.map +1 -0
- package/daemon/dist/db/migrations/124_context_usage_watchdog_units.js +9 -0
- package/daemon/dist/db/migrations/124_context_usage_watchdog_units.js.map +1 -0
- package/daemon/dist/db/migrations/125_node_advisor.d.ts +3 -0
- package/daemon/dist/db/migrations/125_node_advisor.d.ts.map +1 -0
- package/daemon/dist/db/migrations/125_node_advisor.js +8 -0
- package/daemon/dist/db/migrations/125_node_advisor.js.map +1 -0
- package/daemon/dist/db/migrations/127_operation_correlation.d.ts +3 -0
- package/daemon/dist/db/migrations/127_operation_correlation.d.ts.map +1 -0
- package/daemon/dist/db/migrations/127_operation_correlation.js +10 -0
- package/daemon/dist/db/migrations/127_operation_correlation.js.map +1 -0
- package/daemon/dist/db/migrations/128_terminal_policy.d.ts +3 -0
- package/daemon/dist/db/migrations/128_terminal_policy.d.ts.map +1 -0
- package/daemon/dist/db/migrations/128_terminal_policy.js +37 -0
- package/daemon/dist/db/migrations/128_terminal_policy.js.map +1 -0
- package/daemon/dist/db/migrations/129_stream_dispositions.d.ts +10 -0
- package/daemon/dist/db/migrations/129_stream_dispositions.d.ts.map +1 -0
- package/daemon/dist/db/migrations/129_stream_dispositions.js +35 -0
- package/daemon/dist/db/migrations/129_stream_dispositions.js.map +1 -0
- package/daemon/dist/db/migrations/130_stream_subscriptions.d.ts +11 -0
- package/daemon/dist/db/migrations/130_stream_subscriptions.d.ts.map +1 -0
- package/daemon/dist/db/migrations/130_stream_subscriptions.js +33 -0
- package/daemon/dist/db/migrations/130_stream_subscriptions.js.map +1 -0
- package/daemon/dist/db/migrations/131_stream_retention_floor.d.ts +8 -0
- package/daemon/dist/db/migrations/131_stream_retention_floor.d.ts.map +1 -0
- package/daemon/dist/db/migrations/131_stream_retention_floor.js +20 -0
- package/daemon/dist/db/migrations/131_stream_retention_floor.js.map +1 -0
- package/daemon/dist/db/migrations/135_seat_identity_process_evidence.d.ts +3 -0
- package/daemon/dist/db/migrations/135_seat_identity_process_evidence.d.ts.map +1 -0
- package/daemon/dist/db/migrations/135_seat_identity_process_evidence.js +16 -0
- package/daemon/dist/db/migrations/135_seat_identity_process_evidence.js.map +1 -0
- package/daemon/dist/domain/active-occupant.d.ts +8 -3
- package/daemon/dist/domain/active-occupant.d.ts.map +1 -1
- package/daemon/dist/domain/active-occupant.js +8 -4
- package/daemon/dist/domain/active-occupant.js.map +1 -1
- package/daemon/dist/domain/activity-taxonomy.d.ts +19 -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 +24 -0
- package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
- package/daemon/dist/domain/agent-activity-store.js +50 -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/agent-manifest.d.ts.map +1 -1
- package/daemon/dist/domain/agent-manifest.js +14 -2
- package/daemon/dist/domain/agent-manifest.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 +5 -0
- package/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/bootstrap-orchestrator.js +25 -12
- package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
- package/daemon/dist/domain/builtin-startup-files.d.ts.map +1 -1
- package/daemon/dist/domain/builtin-startup-files.js +2 -0
- package/daemon/dist/domain/builtin-startup-files.js.map +1 -1
- package/daemon/dist/domain/bundle-behaviour.d.ts.map +1 -1
- package/daemon/dist/domain/bundle-behaviour.js +28 -1
- package/daemon/dist/domain/bundle-behaviour.js.map +1 -1
- package/daemon/dist/domain/claim-service.d.ts +20 -2
- package/daemon/dist/domain/claim-service.d.ts.map +1 -1
- package/daemon/dist/domain/claim-service.js +74 -19
- package/daemon/dist/domain/claim-service.js.map +1 -1
- package/daemon/dist/domain/classification-attempts.d.ts +4 -1
- package/daemon/dist/domain/classification-attempts.d.ts.map +1 -1
- package/daemon/dist/domain/classification-attempts.js +10 -1
- package/daemon/dist/domain/classification-attempts.js.map +1 -1
- package/daemon/dist/domain/classification-sources.d.ts +38 -0
- package/daemon/dist/domain/classification-sources.d.ts.map +1 -1
- package/daemon/dist/domain/classification-sources.js +26 -1
- package/daemon/dist/domain/classification-sources.js.map +1 -1
- package/daemon/dist/domain/claude-activity-hooks.d.ts +2 -2
- package/daemon/dist/domain/claude-activity-hooks.d.ts.map +1 -1
- package/daemon/dist/domain/claude-activity-hooks.js +8 -7
- package/daemon/dist/domain/claude-activity-hooks.js.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +126 -11
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +527 -68
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/claude-core-plugin-env.d.ts +14 -0
- package/daemon/dist/domain/claude-core-plugin-env.d.ts.map +1 -1
- package/daemon/dist/domain/claude-core-plugin-env.js +37 -11
- package/daemon/dist/domain/claude-core-plugin-env.js.map +1 -1
- package/daemon/dist/domain/claude-managed-launch.d.ts +1 -1
- package/daemon/dist/domain/claude-managed-launch.d.ts.map +1 -1
- package/daemon/dist/domain/claude-managed-launch.js +33 -15
- package/daemon/dist/domain/claude-managed-launch.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-owned-plugin-trust.d.ts +26 -0
- package/daemon/dist/domain/codex-owned-plugin-trust.d.ts.map +1 -0
- package/daemon/dist/domain/codex-owned-plugin-trust.js +187 -0
- package/daemon/dist/domain/codex-owned-plugin-trust.js.map +1 -0
- package/daemon/dist/domain/codex-rebuild-permissions.d.ts +54 -0
- package/daemon/dist/domain/codex-rebuild-permissions.d.ts.map +1 -0
- package/daemon/dist/domain/codex-rebuild-permissions.js +134 -0
- package/daemon/dist/domain/codex-rebuild-permissions.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/community-harness-launch-result.d.ts +33 -0
- package/daemon/dist/domain/community-harness-launch-result.d.ts.map +1 -0
- package/daemon/dist/domain/community-harness-launch-result.js +93 -0
- package/daemon/dist/domain/community-harness-launch-result.js.map +1 -0
- package/daemon/dist/domain/community-harness-presets.d.ts +27 -2
- package/daemon/dist/domain/community-harness-presets.d.ts.map +1 -1
- package/daemon/dist/domain/community-harness-presets.js +49 -5
- package/daemon/dist/domain/community-harness-presets.js.map +1 -1
- package/daemon/dist/domain/composer-prompts.d.ts +5 -2
- package/daemon/dist/domain/composer-prompts.d.ts.map +1 -1
- package/daemon/dist/domain/composer-prompts.js +2 -2
- package/daemon/dist/domain/composer-prompts.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 +49 -14
- 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/continuity-policy-materializer.d.ts +1 -0
- package/daemon/dist/domain/continuity-policy-materializer.d.ts.map +1 -1
- package/daemon/dist/domain/continuity-policy-materializer.js +2 -0
- package/daemon/dist/domain/continuity-policy-materializer.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 +9 -7
- 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/footprint-choice.d.ts +41 -0
- package/daemon/dist/domain/footprint-choice.d.ts.map +1 -0
- package/daemon/dist/domain/footprint-choice.js +42 -0
- package/daemon/dist/domain/footprint-choice.js.map +1 -0
- package/daemon/dist/domain/fresh-occupant-relation.d.ts.map +1 -1
- package/daemon/dist/domain/fresh-occupant-relation.js +9 -2
- 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 +14 -1
- package/daemon/dist/domain/gateway/delivery-rules-engine.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/delivery-rules-engine.js +13 -3
- 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 +55 -2
- package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/human-registry.js +137 -8
- 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 +76 -6
- package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +4 -0
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +13 -2
- 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/queue-access.d.ts +7 -0
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.js +14 -2
- package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +17 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.js +143 -56
- 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 +266 -51
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
- package/daemon/dist/domain/generated-file-hygiene.js +1 -1
- package/daemon/dist/domain/generated-file-hygiene.js.map +1 -1
- package/daemon/dist/domain/graph-projection.d.ts +3 -0
- package/daemon/dist/domain/graph-projection.d.ts.map +1 -1
- package/daemon/dist/domain/graph-projection.js +2 -0
- package/daemon/dist/domain/graph-projection.js.map +1 -1
- package/daemon/dist/domain/health-diagnosis.d.ts.map +1 -1
- package/daemon/dist/domain/health-diagnosis.js +14 -6
- package/daemon/dist/domain/health-diagnosis.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 +10 -1
- package/daemon/dist/domain/human-questions.d.ts.map +1 -1
- package/daemon/dist/domain/human-questions.js +5 -0
- 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 +26 -1
- package/daemon/dist/domain/kernel-boot.d.ts.map +1 -1
- package/daemon/dist/domain/kernel-boot.js +91 -6
- package/daemon/dist/domain/kernel-boot.js.map +1 -1
- package/daemon/dist/domain/managed-blocks.d.ts +32 -1
- package/daemon/dist/domain/managed-blocks.d.ts.map +1 -1
- package/daemon/dist/domain/managed-blocks.js +109 -11
- package/daemon/dist/domain/managed-blocks.js.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts +1 -1
- package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-action-log.js +3 -0
- package/daemon/dist/domain/mission-control/mission-control-action-log.js.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +21 -0
- package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js +110 -0
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
- package/daemon/dist/domain/model-divergence/current-generation-record.d.ts +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/model-divergence/current-model-reader.d.ts +2 -0
- package/daemon/dist/domain/model-divergence/current-model-reader.d.ts.map +1 -1
- package/daemon/dist/domain/model-divergence/current-model-reader.js +7 -0
- package/daemon/dist/domain/model-divergence/current-model-reader.js.map +1 -1
- package/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts +10 -1
- package/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts.map +1 -1
- package/daemon/dist/domain/model-divergence/model-divergence-monitor.js +24 -5
- package/daemon/dist/domain/model-divergence/model-divergence-monitor.js.map +1 -1
- package/daemon/dist/domain/native-process-lineage.d.ts +3 -0
- package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
- package/daemon/dist/domain/native-process-lineage.js +103 -17
- package/daemon/dist/domain/native-process-lineage.js.map +1 -1
- package/daemon/dist/domain/native-resume-probe-evidence.d.ts +19 -0
- package/daemon/dist/domain/native-resume-probe-evidence.d.ts.map +1 -0
- package/daemon/dist/domain/native-resume-probe-evidence.js +37 -0
- package/daemon/dist/domain/native-resume-probe-evidence.js.map +1 -0
- package/daemon/dist/domain/native-resume-probe.d.ts +7 -0
- package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
- package/daemon/dist/domain/native-resume-probe.js +12 -9
- package/daemon/dist/domain/native-resume-probe.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts +49 -1
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +145 -57
- 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 +36 -26
- package/daemon/dist/domain/node-launcher.js.map +1 -1
- package/daemon/dist/domain/occupant-invalidator.d.ts +16 -4
- package/daemon/dist/domain/occupant-invalidator.d.ts.map +1 -1
- package/daemon/dist/domain/occupant-invalidator.js +25 -5
- package/daemon/dist/domain/occupant-invalidator.js.map +1 -1
- package/daemon/dist/domain/operation-correlation.d.ts +78 -0
- package/daemon/dist/domain/operation-correlation.d.ts.map +1 -0
- package/daemon/dist/domain/operation-correlation.js +54 -0
- package/daemon/dist/domain/operation-correlation.js.map +1 -0
- 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/permission-account.d.ts +28 -0
- package/daemon/dist/domain/permission-account.d.ts.map +1 -0
- package/daemon/dist/domain/permission-account.js +102 -0
- package/daemon/dist/domain/permission-account.js.map +1 -0
- package/daemon/dist/domain/permission-drift.d.ts.map +1 -1
- package/daemon/dist/domain/permission-drift.js +11 -7
- package/daemon/dist/domain/permission-drift.js.map +1 -1
- 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/pod-bundle-assembler.d.ts +1 -0
- package/daemon/dist/domain/pod-bundle-assembler.d.ts.map +1 -1
- package/daemon/dist/domain/pod-bundle-assembler.js +25 -0
- package/daemon/dist/domain/pod-bundle-assembler.js.map +1 -1
- package/daemon/dist/domain/policies/artifact-pool-helpers.d.ts +7 -0
- package/daemon/dist/domain/policies/artifact-pool-helpers.d.ts.map +1 -1
- package/daemon/dist/domain/policies/artifact-pool-helpers.js +8 -4
- package/daemon/dist/domain/policies/artifact-pool-helpers.js.map +1 -1
- package/daemon/dist/domain/policies/context-usage-threshold.d.ts.map +1 -1
- package/daemon/dist/domain/policies/context-usage-threshold.js +109 -21
- package/daemon/dist/domain/policies/context-usage-threshold.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/edge-artifact-required.d.ts +6 -1
- package/daemon/dist/domain/policies/edge-artifact-required.d.ts.map +1 -1
- package/daemon/dist/domain/policies/edge-artifact-required.js +18 -13
- package/daemon/dist/domain/policies/edge-artifact-required.js.map +1 -1
- package/daemon/dist/domain/policies/mode-scheduled-end.d.ts +39 -0
- package/daemon/dist/domain/policies/mode-scheduled-end.d.ts.map +1 -0
- package/daemon/dist/domain/policies/mode-scheduled-end.js +165 -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/periodic-reminder.d.ts +10 -0
- package/daemon/dist/domain/policies/periodic-reminder.d.ts.map +1 -1
- package/daemon/dist/domain/policies/periodic-reminder.js +11 -6
- package/daemon/dist/domain/policies/periodic-reminder.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/policies/types.d.ts +25 -0
- package/daemon/dist/domain/policies/types.d.ts.map +1 -1
- package/daemon/dist/domain/policies/workflow-keepalive.d.ts +6 -1
- package/daemon/dist/domain/policies/workflow-keepalive.d.ts.map +1 -1
- package/daemon/dist/domain/policies/workflow-keepalive.js +11 -5
- package/daemon/dist/domain/policies/workflow-keepalive.js.map +1 -1
- package/daemon/dist/domain/profile-resolution-worker.d.ts +7 -0
- package/daemon/dist/domain/profile-resolution-worker.d.ts.map +1 -0
- package/daemon/dist/domain/profile-resolution-worker.js +83 -0
- package/daemon/dist/domain/profile-resolution-worker.js.map +1 -0
- package/daemon/dist/domain/profile-resolver.d.ts +6 -0
- package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
- package/daemon/dist/domain/profile-resolver.js +20 -3
- package/daemon/dist/domain/profile-resolver.js.map +1 -1
- package/daemon/dist/domain/project-classifier.d.ts +7 -0
- package/daemon/dist/domain/project-classifier.d.ts.map +1 -1
- package/daemon/dist/domain/project-classifier.js +26 -0
- package/daemon/dist/domain/project-classifier.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/provider/subscription-move-report.d.ts +86 -0
- package/daemon/dist/domain/provider/subscription-move-report.d.ts.map +1 -0
- package/daemon/dist/domain/provider/subscription-move-report.js +227 -0
- package/daemon/dist/domain/provider/subscription-move-report.js.map +1 -0
- package/daemon/dist/domain/ps-projection.d.ts +6 -35
- package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
- package/daemon/dist/domain/ps-projection.js +14 -55
- package/daemon/dist/domain/ps-projection.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 +6 -3
- package/daemon/dist/domain/queue-owner.d.ts.map +1 -1
- package/daemon/dist/domain/queue-owner.js +12 -6
- package/daemon/dist/domain/queue-owner.js.map +1 -1
- package/daemon/dist/domain/queue-pickup.d.ts +5 -2
- package/daemon/dist/domain/queue-pickup.d.ts.map +1 -1
- package/daemon/dist/domain/queue-pickup.js +19 -2
- package/daemon/dist/domain/queue-pickup.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 +146 -72
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +505 -169
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-retention.d.ts +18 -0
- package/daemon/dist/domain/queue-retention.d.ts.map +1 -1
- package/daemon/dist/domain/queue-retention.js +74 -0
- package/daemon/dist/domain/queue-retention.js.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts +15 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +132 -16
- 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-wait-backoff.d.ts +3 -0
- package/daemon/dist/domain/queue-wait-backoff.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wait-backoff.js +9 -0
- package/daemon/dist/domain/queue-wait-backoff.js.map +1 -1
- package/daemon/dist/domain/queue-waiting.d.ts +2 -0
- package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
- package/daemon/dist/domain/queue-waiting.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 +112 -17
- 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/reconciler.d.ts +23 -0
- package/daemon/dist/domain/reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/reconciler.js +44 -1
- package/daemon/dist/domain/reconciler.js.map +1 -1
- 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 -10
- package/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
- package/daemon/dist/domain/restore-guidance.d.ts +7 -0
- package/daemon/dist/domain/restore-guidance.d.ts.map +1 -1
- package/daemon/dist/domain/restore-guidance.js +20 -8
- package/daemon/dist/domain/restore-guidance.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +24 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +295 -41
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.d.ts +10 -3
- package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.js +56 -18
- package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
- package/daemon/dist/domain/restore-policy.d.ts +4 -0
- package/daemon/dist/domain/restore-policy.d.ts.map +1 -1
- package/daemon/dist/domain/restore-policy.js +11 -0
- package/daemon/dist/domain/restore-policy.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-edge-ops.d.ts +58 -0
- package/daemon/dist/domain/rig-edge-ops.d.ts.map +1 -0
- package/daemon/dist/domain/rig-edge-ops.js +113 -0
- package/daemon/dist/domain/rig-edge-ops.js.map +1 -0
- 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-name-override.d.ts +14 -0
- package/daemon/dist/domain/rig-name-override.d.ts.map +1 -0
- package/daemon/dist/domain/rig-name-override.js +38 -0
- package/daemon/dist/domain/rig-name-override.js.map +1 -0
- package/daemon/dist/domain/rig-repository.d.ts +19 -1
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +41 -3
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rig-status-compose.d.ts +1 -1
- package/daemon/dist/domain/rig-status-compose.d.ts.map +1 -1
- package/daemon/dist/domain/rig-status-compose.js +3 -1
- package/daemon/dist/domain/rig-status-compose.js.map +1 -1
- package/daemon/dist/domain/rig-teardown.d.ts +19 -0
- package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
- package/daemon/dist/domain/rig-teardown.js +109 -12
- package/daemon/dist/domain/rig-teardown.js.map +1 -1
- package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-codec.js +10 -0
- package/daemon/dist/domain/rigspec-codec.js.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.d.ts +3 -0
- package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.js +22 -0
- package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts +39 -2
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +319 -73
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.js +15 -2
- package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
- package/daemon/dist/domain/rigspec-schema.d.ts +8 -0
- package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-schema.js +97 -3
- package/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/daemon/dist/domain/runtime-adapter.d.ts +47 -3
- package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-adapter.js +5 -1
- package/daemon/dist/domain/runtime-adapter.js.map +1 -1
- package/daemon/dist/domain/scope/scope-view-projection.d.ts +6 -0
- package/daemon/dist/domain/scope/scope-view-projection.d.ts.map +1 -1
- package/daemon/dist/domain/scope/scope-view-projection.js +26 -10
- package/daemon/dist/domain/scope/scope-view-projection.js.map +1 -1
- package/daemon/dist/domain/seat-activity-service.d.ts +22 -5
- package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-activity-service.js +137 -62
- package/daemon/dist/domain/seat-activity-service.js.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.d.ts +27 -1
- package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.js +63 -7
- package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.d.ts +20 -1
- package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.js +87 -16
- package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts +10 -2
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +100 -4
- 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 +11 -1
- package/daemon/dist/domain/seat-identity-store.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-store.js +32 -4
- package/daemon/dist/domain/seat-identity-store.js.map +1 -1
- package/daemon/dist/domain/seat-launch-additions.d.ts +115 -0
- package/daemon/dist/domain/seat-launch-additions.d.ts.map +1 -0
- package/daemon/dist/domain/seat-launch-additions.js +439 -0
- package/daemon/dist/domain/seat-launch-additions.js.map +1 -0
- package/daemon/dist/domain/seat-launch-environment.d.ts +1 -1
- package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.js +18 -2
- package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +83 -4
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +202 -12
- package/daemon/dist/domain/seat-lifecycle-service.js.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/seat-skill-apply.d.ts +139 -0
- package/daemon/dist/domain/seat-skill-apply.d.ts.map +1 -0
- package/daemon/dist/domain/seat-skill-apply.js +221 -0
- package/daemon/dist/domain/seat-skill-apply.js.map +1 -0
- package/daemon/dist/domain/seat-skill-storage.d.ts +295 -0
- package/daemon/dist/domain/seat-skill-storage.d.ts.map +1 -0
- package/daemon/dist/domain/seat-skill-storage.js +850 -0
- package/daemon/dist/domain/seat-skill-storage.js.map +1 -0
- package/daemon/dist/domain/seat-status-service.d.ts +9 -0
- package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-status-service.js +15 -3
- package/daemon/dist/domain/seat-status-service.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 +49 -0
- package/daemon/dist/domain/session-registry.d.ts.map +1 -1
- package/daemon/dist/domain/session-registry.js +137 -0
- package/daemon/dist/domain/session-registry.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +76 -27
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +202 -82
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/skill-catalog.d.ts +16 -0
- package/daemon/dist/domain/skill-catalog.d.ts.map +1 -1
- package/daemon/dist/domain/skill-catalog.js +15 -6
- package/daemon/dist/domain/skill-catalog.js.map +1 -1
- package/daemon/dist/domain/skill-discovery.d.ts +24 -3
- package/daemon/dist/domain/skill-discovery.d.ts.map +1 -1
- package/daemon/dist/domain/skill-discovery.js +85 -12
- 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 +47 -5
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +291 -29
- 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/stream-dispositions.d.ts +51 -0
- package/daemon/dist/domain/stream-dispositions.d.ts.map +1 -0
- package/daemon/dist/domain/stream-dispositions.js +112 -0
- package/daemon/dist/domain/stream-dispositions.js.map +1 -0
- package/daemon/dist/domain/stream-store.d.ts +22 -0
- package/daemon/dist/domain/stream-store.d.ts.map +1 -1
- package/daemon/dist/domain/stream-store.js +49 -6
- package/daemon/dist/domain/stream-store.js.map +1 -1
- package/daemon/dist/domain/stream-subscriptions.d.ts +94 -0
- package/daemon/dist/domain/stream-subscriptions.d.ts.map +1 -0
- package/daemon/dist/domain/stream-subscriptions.js +160 -0
- package/daemon/dist/domain/stream-subscriptions.js.map +1 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts +8 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +6 -1
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts +3 -1
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.js +125 -4
- package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-sessions.d.ts +9 -0
- package/daemon/dist/domain/terminal/herdr-sessions.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/herdr-sessions.js +23 -0
- package/daemon/dist/domain/terminal/herdr-sessions.js.map +1 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts +4 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.d.ts +12 -3
- package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.js +42 -17
- package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
- package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/view-composer.js +1 -0
- package/daemon/dist/domain/terminal/view-composer.js.map +1 -1
- package/daemon/dist/domain/terminal-policy.d.ts +80 -0
- package/daemon/dist/domain/terminal-policy.d.ts.map +1 -0
- package/daemon/dist/domain/terminal-policy.js +117 -0
- package/daemon/dist/domain/terminal-policy.js.map +1 -0
- package/daemon/dist/domain/terminal-seat.d.ts +9 -0
- package/daemon/dist/domain/terminal-seat.d.ts.map +1 -0
- package/daemon/dist/domain/terminal-seat.js +37 -0
- package/daemon/dist/domain/terminal-seat.js.map +1 -0
- package/daemon/dist/domain/topology-converge.d.ts +25 -2
- package/daemon/dist/domain/topology-converge.d.ts.map +1 -1
- package/daemon/dist/domain/topology-converge.js +14 -1
- package/daemon/dist/domain/topology-converge.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +73 -6
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/urgent-line.d.ts +4 -0
- package/daemon/dist/domain/urgent-line.d.ts.map +1 -0
- package/daemon/dist/domain/urgent-line.js +7 -0
- package/daemon/dist/domain/urgent-line.js.map +1 -0
- package/daemon/dist/domain/usage-series.d.ts.map +1 -1
- package/daemon/dist/domain/usage-series.js +6 -2
- package/daemon/dist/domain/usage-series.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 +4 -2
- package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts +3 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.js +106 -8
- package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
- package/daemon/dist/domain/view-projector.d.ts.map +1 -1
- package/daemon/dist/domain/view-projector.js +2 -1
- package/daemon/dist/domain/view-projector.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-job-update.d.ts +21 -0
- package/daemon/dist/domain/watchdog-job-update.d.ts.map +1 -0
- package/daemon/dist/domain/watchdog-job-update.js +143 -0
- package/daemon/dist/domain/watchdog-job-update.js.map +1 -0
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts +65 -9
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.js +194 -21
- package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts +39 -24
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +89 -55
- 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 +9 -4
- package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -1
- package/daemon/dist/domain/workflow-projector.d.ts +5 -2
- package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +21 -9
- 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 +8 -2
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +32 -7
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/domain/workspace/project-read.d.ts +2 -0
- package/daemon/dist/domain/workspace/project-read.d.ts.map +1 -1
- package/daemon/dist/domain/workspace/project-read.js +10 -1
- package/daemon/dist/domain/workspace/project-read.js.map +1 -1
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +2 -0
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/router-line-surface.d.ts +2 -0
- package/daemon/dist/router-line-surface.d.ts.map +1 -0
- package/daemon/dist/router-line-surface.js +3 -0
- package/daemon/dist/router-line-surface.js.map +1 -0
- 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 +70 -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 +12 -2
- package/daemon/dist/routes/agent-images.js.map +1 -1
- package/daemon/dist/routes/attention.d.ts.map +1 -1
- package/daemon/dist/routes/attention.js +30 -3
- package/daemon/dist/routes/attention.js.map +1 -1
- package/daemon/dist/routes/bootstrap-failure-response.js +2 -2
- package/daemon/dist/routes/bootstrap-failure-response.js.map +1 -1
- package/daemon/dist/routes/bundles.js +1 -1
- package/daemon/dist/routes/bundles.js.map +1 -1
- package/daemon/dist/routes/compaction.d.ts.map +1 -1
- package/daemon/dist/routes/compaction.js +38 -12
- 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/hosts.d.ts.map +1 -1
- package/daemon/dist/routes/hosts.js +2 -0
- package/daemon/dist/routes/hosts.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/mission-control.d.ts.map +1 -1
- package/daemon/dist/routes/mission-control.js +5 -1
- package/daemon/dist/routes/mission-control.js.map +1 -1
- package/daemon/dist/routes/projects.d.ts.map +1 -1
- package/daemon/dist/routes/projects.js +59 -12
- package/daemon/dist/routes/projects.js.map +1 -1
- package/daemon/dist/routes/proof.js +2 -2
- package/daemon/dist/routes/proof.js.map +1 -1
- package/daemon/dist/routes/provider.d.ts.map +1 -1
- package/daemon/dist/routes/provider.js +87 -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 +125 -16
- 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 +104 -20
- 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 +40 -15
- package/daemon/dist/routes/rigspec.js.map +1 -1
- package/daemon/dist/routes/scopes.d.ts.map +1 -1
- package/daemon/dist/routes/scopes.js +30 -7
- package/daemon/dist/routes/scopes.js.map +1 -1
- package/daemon/dist/routes/seat.d.ts.map +1 -1
- package/daemon/dist/routes/seat.js +21 -5
- package/daemon/dist/routes/seat.js.map +1 -1
- package/daemon/dist/routes/sessions.js +5 -0
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/skills.d.ts.map +1 -1
- package/daemon/dist/routes/skills.js +55 -2
- package/daemon/dist/routes/skills.js.map +1 -1
- package/daemon/dist/routes/stream.d.ts.map +1 -1
- package/daemon/dist/routes/stream.js +62 -13
- package/daemon/dist/routes/stream.js.map +1 -1
- package/daemon/dist/routes/terminal.d.ts.map +1 -1
- package/daemon/dist/routes/terminal.js +20 -11
- package/daemon/dist/routes/terminal.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.d.ts.map +1 -1
- package/daemon/dist/routes/transport.js +25 -3
- package/daemon/dist/routes/transport.js.map +1 -1
- package/daemon/dist/routes/up.js +41 -52
- package/daemon/dist/routes/up.js.map +1 -1
- package/daemon/dist/routes/watchdog.d.ts +1 -0
- package/daemon/dist/routes/watchdog.d.ts.map +1 -1
- package/daemon/dist/routes/watchdog.js +52 -3
- package/daemon/dist/routes/watchdog.js.map +1 -1
- package/daemon/dist/routes/workflow.d.ts.map +1 -1
- package/daemon/dist/routes/workflow.js +24 -13
- package/daemon/dist/routes/workflow.js.map +1 -1
- package/daemon/dist/server.d.ts +2 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +4 -1
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/skill-loadout-surface.d.ts +2 -0
- package/daemon/dist/skill-loadout-surface.d.ts.map +1 -1
- package/daemon/dist/skill-loadout-surface.js +2 -0
- package/daemon/dist/skill-loadout-surface.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +156 -81
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/dist/terminal/TerminalSessionBroker.d.ts.map +1 -1
- package/daemon/dist/terminal/TerminalSessionBroker.js +9 -2
- package/daemon/dist/terminal/TerminalSessionBroker.js.map +1 -1
- package/daemon/docs/reference/a2a-agents.md +343 -0
- package/daemon/docs/reference/acp-agents.md +77 -0
- package/daemon/docs/reference/agent-spec.md +7 -5
- package/daemon/docs/reference/agent-startup-guide.md +46 -0
- package/daemon/docs/reference/agent-state-taxonomy.md +43 -3
- package/daemon/docs/reference/checked-seat-stop.md +11 -0
- package/daemon/docs/reference/community-harness-examples/cursor/cursor.yaml +13 -0
- package/daemon/docs/reference/community-harness-examples/cursor/openrig-cursor-launch +61 -0
- package/daemon/docs/reference/community-harness-examples/hermes/config.yaml.example +18 -0
- package/daemon/docs/reference/community-harness-examples/hermes/hermes.yaml +12 -0
- package/daemon/docs/reference/community-harness-examples/hermes/openrig-hermes-launch +34 -0
- package/daemon/docs/reference/community-harness-examples/openclaw/openclaw.yaml +13 -0
- package/daemon/docs/reference/community-harness-examples/openclaw/openrig-openclaw-launch +38 -0
- package/daemon/docs/reference/community-harness-presets.md +179 -0
- package/daemon/docs/reference/getting-started.md +148 -23
- package/daemon/docs/reference/operation-correlation.md +9 -0
- package/daemon/docs/reference/project-workspace.md +6 -0
- package/daemon/docs/reference/quickstart.md +33 -20
- package/daemon/docs/reference/refocus-channel.md +11 -3
- package/daemon/docs/reference/rig-spec.md +83 -3
- package/daemon/docs/reference/seat-delivery.md +130 -20
- package/daemon/docs/reference/slack-app-setup.md +52 -3
- package/daemon/docs/reference/stream-classifier-worker.md +28 -0
- package/daemon/docs/reference/telemetry.md +3 -0
- package/daemon/docs/reference/terminal-sessions.md +90 -0
- package/daemon/docs/reference/topology-naming.md +1 -1
- package/daemon/docs/reference/whats-new.md +173 -69
- package/daemon/specs/agents/shared/runtime/claude-settings.fragment.json +0 -3
- package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +43 -4
- package/daemon/specs/agents/shared/skills/core/openrig-herdr/SKILL.md +3 -0
- package/daemon/specs/agents/shared/skills/core/openrig-skills/SKILL.md +2 -2
- package/daemon/specs/agents/shared/skills/core/openrig-software-factory/references/worked-example.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 +129 -24
- package/daemon/specs/rigs/launch/kernel/agents/queue/worker/guidance/role.md +11 -0
- package/daemon/specs/rigs/launch/kernel/agents/queue/worker/startup/context.md +3 -1
- package/daemon/specs/rigs/launch/secrets-manager/secrets-manager.compose.yaml +1 -1
- package/dist/acp/connector.d.ts +72 -0
- package/dist/acp/connector.d.ts.map +1 -0
- package/dist/acp/connector.js +218 -0
- package/dist/acp/connector.js.map +1 -0
- package/dist/acp/json-rpc-stdio.d.ts +53 -0
- package/dist/acp/json-rpc-stdio.d.ts.map +1 -0
- package/dist/acp/json-rpc-stdio.js +141 -0
- package/dist/acp/json-rpc-stdio.js.map +1 -0
- package/dist/acp/run-processes.d.ts +10 -0
- package/dist/acp/run-processes.d.ts.map +1 -0
- package/dist/acp/run-processes.js +33 -0
- package/dist/acp/run-processes.js.map +1 -0
- 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 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +14 -7
- package/dist/client.js.map +1 -1
- package/dist/commands/acp.d.ts +11 -0
- package/dist/commands/acp.d.ts.map +1 -0
- package/dist/commands/acp.js +198 -0
- package/dist/commands/acp.js.map +1 -0
- 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/attach.d.ts.map +1 -1
- package/dist/commands/attach.js +7 -5
- package/dist/commands/attach.js.map +1 -1
- package/dist/commands/auth.d.ts +3 -0
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +39 -10
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/broadcast.js +2 -0
- package/dist/commands/broadcast.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 +2 -0
- package/dist/commands/compact-plan.d.ts.map +1 -1
- package/dist/commands/compact-plan.js +40 -4
- package/dist/commands/compact-plan.js.map +1 -1
- package/dist/commands/compact.d.ts.map +1 -1
- package/dist/commands/compact.js +11 -4
- package/dist/commands/compact.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +17 -3
- 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/create.js +2 -2
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +2 -0
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/down.d.ts +5 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +87 -3
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/edge.d.ts +4 -0
- package/dist/commands/edge.d.ts.map +1 -0
- package/dist/commands/edge.js +135 -0
- package/dist/commands/edge.js.map +1 -0
- 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 +1 -0
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +60 -2
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/fork.d.ts.map +1 -1
- package/dist/commands/fork.js +22 -3
- 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 +311 -3
- package/dist/commands/gateway.js.map +1 -1
- package/dist/commands/grow.js +2 -2
- package/dist/commands/grow.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 +10 -3
- package/dist/commands/launch.js.map +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +113 -1
- package/dist/commands/mcp.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/project-worker.d.ts +25 -1
- package/dist/commands/project-worker.d.ts.map +1 -1
- package/dist/commands/project-worker.js +9 -7
- package/dist/commands/project-worker.js.map +1 -1
- package/dist/commands/project.d.ts +2 -0
- package/dist/commands/project.d.ts.map +1 -1
- package/dist/commands/project.js +64 -1
- package/dist/commands/project.js.map +1 -1
- package/dist/commands/provider.d.ts.map +1 -1
- package/dist/commands/provider.js +72 -44
- package/dist/commands/provider.js.map +1 -1
- package/dist/commands/ps.d.ts +16 -1
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +145 -52
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.d.ts +7 -1
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +97 -13
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/reconcile-session.d.ts.map +1 -1
- package/dist/commands/reconcile-session.js +6 -0
- 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.d.ts +2 -0
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +124 -10
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +87 -56
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/setup.d.ts +27 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +189 -16
- 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/skill.d.ts.map +1 -1
- package/dist/commands/skill.js +116 -3
- package/dist/commands/skill.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 +54 -35
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +8 -2
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/stream-outcome.d.ts +157 -0
- package/dist/commands/stream-outcome.d.ts.map +1 -0
- package/dist/commands/stream-outcome.js +81 -0
- package/dist/commands/stream-outcome.js.map +1 -0
- package/dist/commands/stream.d.ts.map +1 -1
- package/dist/commands/stream.js +64 -2
- package/dist/commands/stream.js.map +1 -1
- package/dist/commands/terminal.d.ts +1 -0
- package/dist/commands/terminal.d.ts.map +1 -1
- package/dist/commands/terminal.js +35 -6
- package/dist/commands/terminal.js.map +1 -1
- package/dist/commands/topology-default-agent.d.ts +2 -2
- package/dist/commands/topology-default-agent.d.ts.map +1 -1
- package/dist/commands/topology-default-agent.js +5 -3
- package/dist/commands/topology-default-agent.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/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 +106 -35
- 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/watchdog.d.ts.map +1 -1
- package/dist/commands/watchdog.js +80 -5
- package/dist/commands/watchdog.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/commands/workflow-errors.js +1 -1
- package/dist/commands/workflow-errors.js.map +1 -1
- package/dist/commands/workflow-render.js +4 -4
- package/dist/commands/workflow-render.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +34 -15
- package/dist/commands/workflow.js.map +1 -1
- package/dist/config-store.d.ts +18 -2
- package/dist/config-store.d.ts.map +1 -1
- package/dist/config-store.js +120 -11
- package/dist/config-store.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts +13 -4
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +100 -30
- 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/decisions/decisions.d.ts +203 -0
- package/dist/decisions/decisions.d.ts.map +1 -0
- package/dist/decisions/decisions.js +374 -0
- package/dist/decisions/decisions.js.map +1 -0
- package/dist/decisions/stream-consumer.d.ts +255 -0
- package/dist/decisions/stream-consumer.d.ts.map +1 -0
- package/dist/decisions/stream-consumer.js +282 -0
- package/dist/decisions/stream-consumer.js.map +1 -0
- package/dist/decisions/templates.d.ts +8 -0
- package/dist/decisions/templates.d.ts.map +1 -0
- package/dist/decisions/templates.js +34 -0
- package/dist/decisions/templates.js.map +1 -0
- 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/fresh-seat-command.d.ts +18 -0
- package/dist/fresh-seat-command.d.ts.map +1 -0
- package/dist/fresh-seat-command.js +36 -0
- package/dist/fresh-seat-command.js.map +1 -0
- package/dist/front-door.d.ts +4 -0
- package/dist/front-door.d.ts.map +1 -1
- package/dist/front-door.js +8 -4
- 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 +23 -13
- package/dist/host-bindings.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/lazy-program.d.ts.map +1 -1
- package/dist/lazy-program.js +2 -0
- package/dist/lazy-program.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/lib/run-on-host.d.ts +29 -0
- package/dist/lib/run-on-host.d.ts.map +1 -0
- package/dist/lib/run-on-host.js +69 -0
- package/dist/lib/run-on-host.js.map +1 -0
- package/dist/lib/seat-activity.d.ts +17 -0
- package/dist/lib/seat-activity.d.ts.map +1 -0
- package/dist/lib/seat-activity.js +29 -0
- package/dist/lib/seat-activity.js.map +1 -0
- package/dist/local-daemon-owner.d.ts +4 -0
- package/dist/local-daemon-owner.d.ts.map +1 -1
- package/dist/local-daemon-owner.js +1 -1
- package/dist/local-daemon-owner.js.map +1 -1
- package/dist/mcp-http.d.ts +42 -0
- package/dist/mcp-http.d.ts.map +1 -0
- package/dist/mcp-http.js +232 -0
- package/dist/mcp-http.js.map +1 -0
- package/dist/mcp-server.d.ts +30 -2
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +1126 -407
- 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/dist/seat-launch-additions-lines.d.ts +11 -0
- package/dist/seat-launch-additions-lines.d.ts.map +1 -0
- package/dist/seat-launch-additions-lines.js +14 -0
- package/dist/seat-launch-additions-lines.js.map +1 -0
- package/dist/terminal-window.d.ts +1 -1
- package/dist/terminal-window.d.ts.map +1 -1
- package/dist/terminal-window.js +50 -22
- package/dist/terminal-window.js.map +1 -1
- package/package.json +1 -1
- package/tui/dist/attention/attention-model.d.ts +3 -1
- package/tui/dist/attention/attention-model.d.ts.map +1 -1
- package/tui/dist/attention/attention-model.js +68 -1
- package/tui/dist/attention/attention-model.js.map +1 -1
- package/tui/dist/commands/registry.d.ts.map +1 -1
- package/tui/dist/commands/registry.js +2 -0
- package/tui/dist/commands/registry.js.map +1 -1
- package/tui/dist/config/config-model.d.ts.map +1 -1
- package/tui/dist/config/config-model.js +3 -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 +20 -0
- package/tui/dist/daemon-client.d.ts.map +1 -1
- package/tui/dist/daemon-client.js +27 -0
- package/tui/dist/daemon-client.js.map +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +22 -7
- 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 +50 -3
- package/tui/dist/main.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +121 -10
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/topology/fixture.js +1 -1
- package/tui/dist/topology/fixture.js.map +1 -1
- package/tui/dist/topology/glyphs.js +1 -1
- package/tui/dist/topology/glyphs.js.map +1 -1
- package/tui/dist/topology/graph-types.d.ts +1 -0
- package/tui/dist/topology/graph-types.d.ts.map +1 -1
- package/tui/dist/types.d.ts +78 -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/ui/dist/assets/{index-CVgod3Pm.js → index-Blg-p32B.js} +92 -92
- package/ui/dist/index.html +1 -1
- 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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TerminalPolicyRefusal } from "./terminal-policy.js";
|
|
1
2
|
import { DeliveryGuardError } from "./seat-delivery-guard.js";
|
|
2
3
|
import * as fs from "node:fs";
|
|
3
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -23,10 +24,19 @@ import * as path from "node:path";
|
|
|
23
24
|
* session must drop below threshold before another auto-compact can
|
|
24
25
|
* fire. The dedup window still blocks immediate flaps; the threshold
|
|
25
26
|
* crossing rule prevents one high-usage session from receiving
|
|
26
|
-
* /compact every 60s.
|
|
27
|
-
* restart resets
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* /compact every 60s. This window is intentionally NOT persisted; daemon
|
|
28
|
+
* restart resets it, which is the safer-failure direction (might
|
|
29
|
+
* re-compact once on restart in rare cases, won't lock out forever).
|
|
30
|
+
* - Restart: each attempt's record (COMPACTION-STATE.json, beside its map)
|
|
31
|
+
* says what the daemon last did for it, so a restarted daemon resumes an
|
|
32
|
+
* owed restore and waits on an open preparation instead of starting a
|
|
33
|
+
* second one (`recoverAfterRestart`). A prompt or /compact is marked in
|
|
34
|
+
* flight at its write, so a restart never sends it again. A restart between
|
|
35
|
+
* a post-compact stage's send and its record can send that one stage again.
|
|
36
|
+
* - A /compact whose outcome is unknown owes its restore steps, with or
|
|
37
|
+
* without a restart. Its text may wait unsubmitted in the input box, where
|
|
38
|
+
* any Enter would submit it, so each step goes only into an empty box and
|
|
39
|
+
* is held, visibly, while the box holds text or can't be read.
|
|
30
40
|
* - Definite pre-write prep failures retry at most three times. Uncertain
|
|
31
41
|
* delivery never replays. Unfinished preparation stops visibly until an
|
|
32
42
|
* explicit retry; it cannot arm a delayed compact after its deadline.
|
|
@@ -35,9 +45,8 @@ import * as path from "node:path";
|
|
|
35
45
|
* write an attempt-bound restore map. Existing polls send /compact only after
|
|
36
46
|
* atomic publication of that completed artifact, within the preparation deadline.
|
|
37
47
|
* - Post-compact restore: after a successful auto-compact, the enforcer
|
|
38
|
-
* first sends a turn-boundary handshake
|
|
39
|
-
*
|
|
40
|
-
* takes no turn after /compact never refreshes its sample), then sends the
|
|
48
|
+
* first sends a turn-boundary handshake when the pane is idle, independently
|
|
49
|
+
* of trigger usage (including stale or unknown samples), then sends the
|
|
41
50
|
* restore prompt on a later polling tick.
|
|
42
51
|
* This is intentionally active because Claude hooks can provide
|
|
43
52
|
* context, but they do not create a new assistant turn by themselves.
|
|
@@ -51,6 +60,9 @@ export const POST_COMPACT_RESTORE_COOLDOWN_MS_DEFAULT = 10 * 60_000;
|
|
|
51
60
|
export const MANUAL_PREP_WAIT_MS_DEFAULT = 180_000;
|
|
52
61
|
// Operational ceiling, not a measured optimum. Existing context polls advance auto preparation.
|
|
53
62
|
export const AUTO_PREP_WAIT_MS_DEFAULT = 25 * 60_000;
|
|
63
|
+
// How long a stopped attempt holds automatic compaction off for its seat before a fresh attempt may begin. Without it one
|
|
64
|
+
// failed preparation turned automatic compaction off for the seat until someone noticed. Operational, not measured.
|
|
65
|
+
export const AUTO_RETRY_AFTER_STOP_MS_DEFAULT = 10 * 60_000;
|
|
54
66
|
const PREP_SEND_ATTEMPTS_MAX = 3;
|
|
55
67
|
// Slices 13–14 fix — each post-compact back-half send (turn_boundary → restore →
|
|
56
68
|
// audit) is idle-gated so it cannot be injected into the busy pane right after
|
|
@@ -233,7 +245,8 @@ export function buildPostCompactRestorePrompt(input) {
|
|
|
233
245
|
// refused at the source. Tell the seat NOT to seek it out (it is not its state).
|
|
234
246
|
pieces.push("A post-compaction instruction file declaring a DIFFERENT seat was present and has been IGNORED — it is not yours; do NOT read or follow it. Rely on the per-seat marker and the JSONL transcript for restore.");
|
|
235
247
|
}
|
|
236
|
-
|
|
248
|
+
const restoreMap = input.attemptMapPath ? "this preparation attempt's restore map" : "your newest restore map";
|
|
249
|
+
pieces.push(`Load/read the claude-compaction-restore skill, follow the marker's restoreInstruction and postCompactInstruction when present, read ${restoreMap} and use the restore packet as a lookup, then reply with: restored from packet at <path>; resumed at step <X>.`);
|
|
237
250
|
pieces.push(`During this restore, read ${path.join(input.openrigHome, "plugins", "openrig-core", "skills", "refocusing", "SKILL.md")} and consume the current topology and work traces delivered with this restore request, if present; do not rerun Python just to duplicate a delivered trace. Missing trace delivery is a named gap. Read required notes and full sources with the native file-read tool; a pointer, compact summary or truncated extract is not a full source read. Name any missing source, the current user outcome, and your next action from the files you actually read, not from the compact summary.`);
|
|
238
251
|
return pieces.join(" ");
|
|
239
252
|
}
|
|
@@ -255,11 +268,49 @@ export function buildPostCompactTurnBoundaryPrompt() {
|
|
|
255
268
|
"Do not restore yet; the next normal user message will contain the restore instructions.",
|
|
256
269
|
].join(" ");
|
|
257
270
|
}
|
|
271
|
+
/** The file, beside an attempt's restore map, where the daemon records what it last did for that attempt. The agent
|
|
272
|
+
* never writes it. A restarted daemon reads it to pick the attempt up again. */
|
|
273
|
+
export const COMPACTION_RECORD_FILE = "COMPACTION-STATE.json";
|
|
274
|
+
/** How old a record may be for a restarted daemon to resume it. An older open record isn't resumed: it reads as
|
|
275
|
+
* stranded, so whoever reaches the seat is told its restore may still be owed. Operational, not measured. */
|
|
276
|
+
export const RESTART_RECOVERY_WINDOW_MS_DEFAULT = 6 * 60 * 60_000;
|
|
277
|
+
/** This daemon process. A record this process wrote is its own state, never something to recover. */
|
|
278
|
+
const DAEMON_PROCESS_ID = randomUUID();
|
|
279
|
+
const RECORD_PHASES = new Set(["preparing", "turn_boundary", "restore_prompt", "compliance_prompt", "compact_uncertain", "done", "ended"]);
|
|
280
|
+
const RECORD_DELIVERIES = new Set(["pending", "not_sent", "delivered", "uncertain"]);
|
|
281
|
+
/** A record only in the shape this daemon writes. Any other (a newer daemon's after a rollback, a damaged file) is ignored,
|
|
282
|
+
* so it can't hold up a seat's compaction. */
|
|
283
|
+
function readCompactionRecord(file) {
|
|
284
|
+
try {
|
|
285
|
+
const r = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
286
|
+
const text = (v) => typeof v === "string";
|
|
287
|
+
const textOrNull = (v) => v === null || typeof v === "string";
|
|
288
|
+
const carry = r.restoreCarry;
|
|
289
|
+
const valid = text(r.daemon) && text(r.attemptId) && text(r.session) && textOrNull(r.occupantGeneration)
|
|
290
|
+
&& (r.mode === "automatic" || r.mode === "manual") && RECORD_PHASES.has(r.phase) && RECORD_DELIVERIES.has(r.delivery)
|
|
291
|
+
&& (r.deadlineAt === null || Number.isFinite(r.deadlineAt)) && Number.isInteger(r.sends) && r.sends >= 0 && r.sends <= PREP_SEND_ATTEMPTS_MAX
|
|
292
|
+
&& text(r.mapPath) && text(r.marker) && text(r.compactInstruction) && textOrNull(r.preparationRoot) && Number.isFinite(r.updatedAt)
|
|
293
|
+
&& (r.operatorInitiated === undefined || typeof r.operatorInitiated === "boolean") && (r.compactSending === undefined || r.compactSending === true)
|
|
294
|
+
&& (r.uncertainCompact === undefined || r.uncertainCompact === true)
|
|
295
|
+
&& (carry === undefined || (typeof carry === "object" && carry !== null && textOrNull(carry.mapPath) && textOrNull(carry.compactInstruction)
|
|
296
|
+
&& (carry.skipMap === undefined || (text(carry.skipMap?.mapPath) && text(carry.skipMap?.marker)))));
|
|
297
|
+
return valid ? r : null;
|
|
298
|
+
}
|
|
299
|
+
catch {
|
|
300
|
+
return null;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
/** Input-box readings that hold nothing typed: an owed step after an uncertain /compact may go in. A harness suggestion isn't input. */
|
|
304
|
+
const INPUT_BOX_CLEAR = new Set(["empty", "likely-suggestion"]);
|
|
305
|
+
function strandedSummary(record) {
|
|
306
|
+
return { attemptId: record.attemptId, mapPath: record.mapPath, phase: record.phase, recordedAt: new Date(record.updatedAt).toISOString() };
|
|
307
|
+
}
|
|
258
308
|
export class ClaudeCompactionEnforcer {
|
|
259
309
|
settingsStore;
|
|
260
310
|
sessionTransport;
|
|
261
311
|
dedupWindowMs;
|
|
262
312
|
postCompactRestoreCooldownMs;
|
|
313
|
+
autoRetryAfterStopMs;
|
|
263
314
|
openrigHome;
|
|
264
315
|
// OPR.0.4.3.14 — max time to wait for the manual prep turn to complete (seat
|
|
265
316
|
// idle) before sending /compact. Bounds the two-phase wait-for-idle.
|
|
@@ -282,19 +333,37 @@ export class ClaudeCompactionEnforcer {
|
|
|
282
333
|
// unknown). At drain we compare it to the LIVE generation; a mismatch = a successor inheriting a
|
|
283
334
|
// retired-generation stage → refuse. Injected resolver (atom-B's currentOccupantTenure by session).
|
|
284
335
|
pendingStageGeneration = new Map();
|
|
336
|
+
/** Each seat's current attempt record, as last written beside its map. */
|
|
337
|
+
records = new Map();
|
|
338
|
+
/** Seats whose records this daemon has already looked for after starting. */
|
|
339
|
+
recovered = new Set();
|
|
340
|
+
/** Open records too old to resume: the seat's restore may still be owed. */
|
|
341
|
+
stranded = new Map();
|
|
342
|
+
/** Seats whose owed restore steps follow a /compact whose outcome is unknown: its text may wait unsubmitted in the input
|
|
343
|
+
* box, where any Enter would submit it, so each step goes only into an empty box. */
|
|
344
|
+
afterUncertainCompact = new Set();
|
|
345
|
+
/** What the input box last read for such a seat, before an owed step (absent until the first check). */
|
|
346
|
+
lastInputBox = new Map();
|
|
347
|
+
restartRecoveryWindowMs;
|
|
348
|
+
daemonInstance;
|
|
285
349
|
resolveOccupantGeneration;
|
|
286
350
|
onPostRestoreComplete;
|
|
351
|
+
terminalPolicies;
|
|
287
352
|
constructor(settingsStore, sessionTransport, opts) {
|
|
353
|
+
this.terminalPolicies = opts?.terminalPolicies;
|
|
288
354
|
this.settingsStore = settingsStore;
|
|
289
355
|
this.sessionTransport = sessionTransport;
|
|
290
356
|
this.dedupWindowMs = opts?.dedupWindowMs ?? DEDUP_WINDOW_MS_DEFAULT;
|
|
291
357
|
this.postCompactRestoreCooldownMs = opts?.postCompactRestoreCooldownMs ?? POST_COMPACT_RESTORE_COOLDOWN_MS_DEFAULT;
|
|
358
|
+
this.autoRetryAfterStopMs = opts?.autoRetryAfterStopMs ?? AUTO_RETRY_AFTER_STOP_MS_DEFAULT;
|
|
292
359
|
this.openrigHome = opts?.openrigHome ?? defaultOpenRigHome();
|
|
293
360
|
this.manualPrepWaitMs = opts?.manualPrepWaitMs ?? MANUAL_PREP_WAIT_MS_DEFAULT;
|
|
294
361
|
this.now = opts?.now ?? (() => Date.now());
|
|
295
362
|
this.sleep = opts?.sleep ?? (ms => new Promise(resolve => setTimeout(resolve, ms)));
|
|
296
363
|
this.postCompactSendWaitMs = opts?.postCompactSendWaitMs ?? POST_COMPACT_SEND_WAIT_MS_DEFAULT;
|
|
297
364
|
this.compactSendIdleWaitMs = opts?.compactSendIdleWaitMs ?? 1000;
|
|
365
|
+
this.restartRecoveryWindowMs = opts?.restartRecoveryWindowMs ?? RESTART_RECOVERY_WINDOW_MS_DEFAULT;
|
|
366
|
+
this.daemonInstance = opts?.daemonInstance ?? DAEMON_PROCESS_ID;
|
|
298
367
|
this.resolveOccupantGeneration = opts?.resolveOccupantGeneration;
|
|
299
368
|
this.onPostRestoreComplete = opts?.onPostRestoreComplete;
|
|
300
369
|
}
|
|
@@ -307,10 +376,78 @@ export class ClaudeCompactionEnforcer {
|
|
|
307
376
|
this.reconcilePreparations();
|
|
308
377
|
return this.withDeliveryGuard(input, () => this.maybeAutoCompactUnchecked(input));
|
|
309
378
|
}
|
|
310
|
-
/**
|
|
311
|
-
|
|
379
|
+
/**
|
|
380
|
+
* What this enforcer has recorded about a managed compaction of `sessionName`, for a sender's context, or null when
|
|
381
|
+
* none is under way. Read-only: it reports the enforcer's own state (the preparation attempt and the post-compact
|
|
382
|
+
* stage still owed), never whether the seat finished compacting or restoring.
|
|
383
|
+
*/
|
|
384
|
+
observedCompaction(sessionName) {
|
|
385
|
+
const owed = this.pendingPostCompactRestore.get(sessionName);
|
|
386
|
+
const held = this.getOwedRestore(sessionName);
|
|
387
|
+
if (held?.held)
|
|
388
|
+
return { stage: owed === "compliance_prompt" ? "restoring" : owed === "restore_prompt" ? "compacted" : "compacting", detail: held.detail };
|
|
389
|
+
if (owed === "compliance_prompt")
|
|
390
|
+
return { stage: "restoring", detail: "mid-restore: the restore request was sent and the post-restore audit is still owed" };
|
|
391
|
+
if (owed === "restore_prompt")
|
|
392
|
+
return { stage: "compacted", detail: "compacted, with its restore not yet requested" };
|
|
393
|
+
const attempt = this.pendingPreCompactPrep.get(sessionName);
|
|
394
|
+
if (owed === "turn_boundary") {
|
|
395
|
+
return { stage: "compacting", detail: attempt?.compact === "uncertain"
|
|
396
|
+
? "possibly being compacted: /compact may have been submitted (its result was lost) and the post-compaction steps haven't started"
|
|
397
|
+
: "being compacted: /compact was submitted and the post-compaction steps haven't started" };
|
|
398
|
+
}
|
|
399
|
+
if (attempt?.status === "sending" || attempt?.status === "waiting") {
|
|
400
|
+
return { stage: "preparing", detail: `preparing for a managed compaction: /compact hasn't been sent yet${attempt.supersedes
|
|
401
|
+
? `; it replaces a compaction from before an OpenRig restart whose restore steps may still have been owed (map ${attempt.supersedes.mapPath})` : ""}` };
|
|
402
|
+
}
|
|
403
|
+
if (attempt?.status === "compact-sent")
|
|
404
|
+
return { stage: "compacting", detail: "being compacted: /compact was submitted and the post-compaction steps haven't started" };
|
|
405
|
+
if (this.stranded.has(sessionName)) {
|
|
406
|
+
return { stage: "compacted", detail: "compacted before an OpenRig restart, with its restore steps possibly still owed: the record is too old for OpenRig to resume them" };
|
|
407
|
+
}
|
|
408
|
+
return null;
|
|
409
|
+
}
|
|
410
|
+
/** True while a post-compact stage (turn boundary, restore or audit) is still owed to this seat. Given the seat, a
|
|
411
|
+
* restarted daemon first picks up a stage its predecessor recorded (`recoverAfterRestart`). */
|
|
412
|
+
hasPendingPostCompactStage(sessionName, seat) {
|
|
413
|
+
if (seat)
|
|
414
|
+
this.recoverSeat({ sessionName, ...seat });
|
|
312
415
|
return this.pendingPostCompactRestore.has(sessionName);
|
|
313
416
|
}
|
|
417
|
+
/** The first time this daemon reaches a seat (a poll, a manual request, a state read): pick up its record from before a
|
|
418
|
+
* restart, with the policy's preparation root (`recoverAfterRestart`). */
|
|
419
|
+
recoverSeat(seat) {
|
|
420
|
+
if (seat.runtime !== "claude-code" || this.recovered.has(seat.sessionName))
|
|
421
|
+
return;
|
|
422
|
+
let preparationRoot = null;
|
|
423
|
+
try {
|
|
424
|
+
preparationRoot = this.settingsStore.resolveClaudeCompactionPolicy().preparationRoot || null;
|
|
425
|
+
}
|
|
426
|
+
catch { /* default roots */ }
|
|
427
|
+
this.recoverAfterRestart(seat, preparationRoot);
|
|
428
|
+
}
|
|
429
|
+
/** The restore step OpenRig owes this seat next, or null. After a /compact whose outcome is unknown (see
|
|
430
|
+
* `afterUncertainCompact`) it also gives what the input box last read (`not_checked` before the first check) and
|
|
431
|
+
* whether the step is held for it. */
|
|
432
|
+
getOwedRestore(sessionName) {
|
|
433
|
+
const stage = this.pendingPostCompactRestore.get(sessionName);
|
|
434
|
+
if (!stage)
|
|
435
|
+
return null;
|
|
436
|
+
const step = { turn_boundary: "post-compaction turn boundary", restore_prompt: "restore request", compliance_prompt: "post-restore audit" }[stage];
|
|
437
|
+
if (!this.afterUncertainCompact.has(sessionName)) {
|
|
438
|
+
return { stage, held: false, detail: `OpenRig owes this seat its ${step} next, sent on a poll once the pane is idle.` };
|
|
439
|
+
}
|
|
440
|
+
const inputBox = this.lastInputBox.get(sessionName) ?? "not_checked";
|
|
441
|
+
const held = inputBox !== "not_checked" && !INPUT_BOX_CLEAR.has(inputBox);
|
|
442
|
+
return { stage, held, inputBox, detail: held
|
|
443
|
+
? `held: OpenRig owes this seat its restore steps after a /compact whose result was lost, and waits while its input box isn't empty (it reads ${inputBox}). The seat may have /compact text waiting, which any Enter would submit, so check the pane. A seat whose own status line keeps the box unreadable stays held.`
|
|
444
|
+
: `OpenRig owes this seat its ${step} next, after a /compact whose result was lost. Each step goes only into an empty input box, sent on a poll once the pane is idle (the box last read ${inputBox}).` };
|
|
445
|
+
}
|
|
446
|
+
/** An open record from before a restart that was too old to resume, while no later attempt has replaced it. */
|
|
447
|
+
getStrandedCompaction(sessionName) {
|
|
448
|
+
const record = this.stranded.get(sessionName);
|
|
449
|
+
return record ? strandedSummary(record) : null;
|
|
450
|
+
}
|
|
314
451
|
/**
|
|
315
452
|
* Drain a post-compact stage that is already pending, without a usage sample. ContextMonitor
|
|
316
453
|
* calls this when the latest sample is stale or unknown. Such a sample never starts a
|
|
@@ -336,6 +473,23 @@ export class ClaudeCompactionEnforcer {
|
|
|
336
473
|
return (await this.drainPendingStage(unsampled, policy)) ?? { triggered: false, reason: "no_pending_stage" };
|
|
337
474
|
});
|
|
338
475
|
}
|
|
476
|
+
terminalPolicyReason(input, actor) {
|
|
477
|
+
const nodeId = input.nodeId ?? this.sessionTransport.deliveryGuard?.maybeTarget(input.sessionName)?.nodeId;
|
|
478
|
+
if (!this.terminalPolicies || !nodeId)
|
|
479
|
+
return null;
|
|
480
|
+
try {
|
|
481
|
+
this.terminalPolicies.check(nodeId, "compaction", actor);
|
|
482
|
+
return null;
|
|
483
|
+
}
|
|
484
|
+
catch (error) {
|
|
485
|
+
return error instanceof TerminalPolicyRefusal ? "terminal_policy_refused" : actor.source === "openrig" ? null : "terminal_policy_unavailable";
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
checkAttemptPolicy(input, attempt) {
|
|
489
|
+
const reason = this.terminalPolicyReason(input, attempt.policyActor ?? { source: "openrig" });
|
|
490
|
+
if (reason)
|
|
491
|
+
throw new DeliveryGuardError(reason, "This seat's terminal policy does not allow this managed compaction. Read rig seat status <seat> to see or change the explicit choice; the existing override path is unchanged.");
|
|
492
|
+
}
|
|
339
493
|
async withDeliveryGuard(input, run) {
|
|
340
494
|
const runIfCurrent = () => input.isObservationCurrent && !input.isObservationCurrent()
|
|
341
495
|
? Promise.resolve({ triggered: false, reason: "stale_observation" }) : run();
|
|
@@ -357,11 +511,20 @@ export class ClaudeCompactionEnforcer {
|
|
|
357
511
|
* is pending, so the sampled path can run its below-threshold bookkeeping.
|
|
358
512
|
*/
|
|
359
513
|
async drainPendingStage(input, policy) {
|
|
360
|
-
//
|
|
361
|
-
//
|
|
514
|
+
// A missing or still-high sample need not show that /compact has finished. The newest idle
|
|
515
|
+
// hook can predate it, so these drains require a live pane read to establish idle.
|
|
516
|
+
const pendingStage = this.pendingPostCompactRestore.get(input.sessionName);
|
|
517
|
+
const attempt = this.pendingPreCompactPrep.get(input.sessionName);
|
|
518
|
+
const isCurrent = () => this.pendingPostCompactRestore.get(input.sessionName) === pendingStage
|
|
519
|
+
&& this.pendingPreCompactPrep.get(input.sessionName) === attempt;
|
|
362
520
|
const sendOpts = {
|
|
521
|
+
openrigNotice: true,
|
|
522
|
+
beforeWrite: () => {
|
|
523
|
+
if (!isCurrent())
|
|
524
|
+
throw new DeliveryGuardError("compaction_cancelled", "Managed compaction was cancelled or replaced; no further input is authorized.");
|
|
525
|
+
},
|
|
363
526
|
waitForIdleMs: this.postCompactSendWaitMs,
|
|
364
|
-
...(input.usedPercentage == null ? { readinessFromPaneOnly: true } : {}),
|
|
527
|
+
...(input.usedPercentage == null || input.usedPercentage >= policy.thresholdPercent ? { readinessFromPaneOnly: true } : {}),
|
|
365
528
|
};
|
|
366
529
|
// GHOST-STAGE FIX (a) — gate the DRAIN by `enabled`. A disabled system drains NOTHING: the
|
|
367
530
|
// legacy compaction-stage defect (operator-confirmed ruling 05c174e0) proved that draining a
|
|
@@ -390,14 +553,27 @@ export class ClaudeCompactionEnforcer {
|
|
|
390
553
|
return { triggered: false, reason: "stale_generation" };
|
|
391
554
|
}
|
|
392
555
|
}
|
|
393
|
-
|
|
556
|
+
// After a /compact whose outcome is unknown, its text may still wait unsubmitted in the input box, and this step's Enter
|
|
557
|
+
// would submit it. So each step goes only into a box holding nothing typed (a harness suggestion isn't input); while it
|
|
558
|
+
// holds text or can't be read, the step waits for the next poll, and the notice and --state say why.
|
|
559
|
+
if (this.afterUncertainCompact.has(input.sessionName)) {
|
|
560
|
+
const box = await this.inputBoxStatus(input.sessionName);
|
|
561
|
+
if (!isCurrent())
|
|
562
|
+
return { triggered: false, reason: "preparation_stopped" };
|
|
563
|
+
this.lastInputBox.set(input.sessionName, box);
|
|
564
|
+
if (!INPUT_BOX_CLEAR.has(box))
|
|
565
|
+
return { triggered: false, reason: "input_box_not_empty" };
|
|
566
|
+
}
|
|
394
567
|
if (pendingStage === "turn_boundary") {
|
|
395
568
|
const boundary = await this.sessionTransport.send(input.sessionName, buildPostCompactTurnBoundaryPrompt(), sendOpts);
|
|
569
|
+
if (!isCurrent())
|
|
570
|
+
return { triggered: false, reason: "preparation_stopped" };
|
|
396
571
|
if (!boundary.ok || boundary.outcome === "retained") {
|
|
397
572
|
// Busy/never-idle → no delivery, no advance; the SAME stage retries next tick.
|
|
398
573
|
return { triggered: false, reason: "send_failed" };
|
|
399
574
|
}
|
|
400
575
|
this.pendingPostCompactRestore.set(input.sessionName, "restore_prompt");
|
|
576
|
+
this.persistStage(input.sessionName, "restore_prompt");
|
|
401
577
|
return { triggered: true };
|
|
402
578
|
}
|
|
403
579
|
if (pendingStage === "restore_prompt") {
|
|
@@ -415,6 +591,8 @@ export class ClaudeCompactionEnforcer {
|
|
|
415
591
|
postCompactInstructionFilePath: extra.filePath,
|
|
416
592
|
ignoredWrongSeatExtra: extra.ignoredWrongSeat,
|
|
417
593
|
}), sendOpts);
|
|
594
|
+
if (!isCurrent())
|
|
595
|
+
return { triggered: false, reason: "preparation_stopped" };
|
|
418
596
|
if (!restore.ok || restore.outcome === "retained") {
|
|
419
597
|
// Restore is exact-once + operator-authorized: if the seat is still busy
|
|
420
598
|
// (mid-compaction/boundary), do NOT advance to restore-sent on an
|
|
@@ -422,6 +600,7 @@ export class ClaudeCompactionEnforcer {
|
|
|
422
600
|
return { triggered: false, reason: "send_failed" };
|
|
423
601
|
}
|
|
424
602
|
this.pendingPostCompactRestore.set(input.sessionName, "compliance_prompt");
|
|
603
|
+
this.persistStage(input.sessionName, "compliance_prompt");
|
|
425
604
|
this.restoreCarry.delete(input.sessionName);
|
|
426
605
|
// OPR.0.4.3.14 — surface manual-trigger progress (no-op for auto seats).
|
|
427
606
|
this.advanceManualStage(input.sessionName, "compact-sent", "restore-sent");
|
|
@@ -429,6 +608,8 @@ export class ClaudeCompactionEnforcer {
|
|
|
429
608
|
}
|
|
430
609
|
if (pendingStage === "compliance_prompt") {
|
|
431
610
|
const compliance = await this.sessionTransport.send(input.sessionName, buildPostCompactCompliancePrompt(policy.postRestoreAuditInstruction), sendOpts);
|
|
611
|
+
if (!isCurrent())
|
|
612
|
+
return { triggered: false, reason: "preparation_stopped" };
|
|
432
613
|
if (!compliance.ok || compliance.outcome === "retained") {
|
|
433
614
|
// Audit cannot overtake restore: only advances once the restore turn is
|
|
434
615
|
// idle and this send delivers; a busy tick retries the SAME stage.
|
|
@@ -446,13 +627,24 @@ export class ClaudeCompactionEnforcer {
|
|
|
446
627
|
saturationBoundPercentage: policy.thresholdPercent,
|
|
447
628
|
});
|
|
448
629
|
}
|
|
630
|
+
if (!isCurrent())
|
|
631
|
+
return { triggered: false, reason: "preparation_stopped" };
|
|
449
632
|
this.pendingPostCompactRestore.delete(input.sessionName);
|
|
633
|
+
this.persistStage(input.sessionName, "done");
|
|
634
|
+
this.records.delete(input.sessionName);
|
|
635
|
+
this.afterUncertainCompact.delete(input.sessionName);
|
|
636
|
+
this.lastInputBox.delete(input.sessionName);
|
|
450
637
|
this.restoreCarry.delete(input.sessionName);
|
|
451
|
-
|
|
638
|
+
// The attempt is finished, including one stopped after a lost /compact result whose restore this was.
|
|
639
|
+
const finished = this.pendingPreCompactPrep.get(input.sessionName);
|
|
640
|
+
if (finished?.status === "compact-sent" || finished?.compact === "uncertain")
|
|
452
641
|
this.pendingPreCompactPrep.delete(input.sessionName);
|
|
453
642
|
this.pendingStageGeneration.delete(input.sessionName); // GHOST-STAGE (b): stage completed → drop its gen
|
|
454
643
|
this.postCompactRestoreCooldownUntil.set(input.sessionName, Date.now() + this.postCompactRestoreCooldownMs);
|
|
455
|
-
|
|
644
|
+
// A high sample may now finish the audit, but must not re-arm automatic compaction.
|
|
645
|
+
if (input.usedPercentage == null || input.usedPercentage < policy.thresholdPercent) {
|
|
646
|
+
this.triggeredAboveThreshold.delete(input.sessionName);
|
|
647
|
+
}
|
|
456
648
|
// OPR.0.4.3.14 — terminal manual-trigger stage (no-op for auto seats).
|
|
457
649
|
this.advanceManualStage(input.sessionName, "restore-sent", "audit-sent");
|
|
458
650
|
return { triggered: true };
|
|
@@ -477,10 +669,13 @@ export class ClaudeCompactionEnforcer {
|
|
|
477
669
|
if (!isValidThresholdPercent(policy.thresholdPercent)) {
|
|
478
670
|
return { triggered: false, reason: "invalid_policy" };
|
|
479
671
|
}
|
|
672
|
+
this.recoverAfterRestart(input, policy.preparationRoot || null);
|
|
673
|
+
// A trigger sample must not block work already owed to this occupant. Restore reads can
|
|
674
|
+
// themselves exceed a low threshold; keep the same stage, authorization and idle gates.
|
|
675
|
+
const drained = await this.drainPendingStage(input, policy);
|
|
676
|
+
if (drained)
|
|
677
|
+
return drained;
|
|
480
678
|
if (input.usedPercentage < policy.thresholdPercent) {
|
|
481
|
-
const drained = await this.drainPendingStage(input, policy);
|
|
482
|
-
if (drained)
|
|
483
|
-
return drained;
|
|
484
679
|
this.triggeredAboveThreshold.delete(input.sessionName);
|
|
485
680
|
const preparation = this.pendingPreCompactPrep.get(input.sessionName);
|
|
486
681
|
if (preparation?.status === "compact-sent")
|
|
@@ -489,15 +684,8 @@ export class ClaudeCompactionEnforcer {
|
|
|
489
684
|
// deadline so a later high sample can use its map without another prep.
|
|
490
685
|
return { triggered: false, reason: "below_threshold" };
|
|
491
686
|
}
|
|
492
|
-
//
|
|
493
|
-
//
|
|
494
|
-
// below-threshold back-half above now drains regardless of `enabled`,
|
|
495
|
-
// because it only advances an ALREADY-INITIATED guided sequence
|
|
496
|
-
// (`pendingPostCompactRestore` is set only after a /compact was sent — by
|
|
497
|
-
// auto above OR by the manual trigger). A disabled policy therefore still
|
|
498
|
-
// never STARTS a compaction (unchanged observable auto behavior for a
|
|
499
|
-
// constant policy), while a manual trigger's restore/audit half can finish
|
|
500
|
-
// via this single shared path even when auto-compaction is disabled.
|
|
687
|
+
// No new automatic compaction while disabled. An already-owed stage above uses
|
|
688
|
+
// drainPendingStage's existing operator-initiated manual exemption.
|
|
501
689
|
if (!policy.enabled) {
|
|
502
690
|
return { triggered: false, reason: "disabled" };
|
|
503
691
|
}
|
|
@@ -516,6 +704,13 @@ export class ClaudeCompactionEnforcer {
|
|
|
516
704
|
if (this.triggeredAboveThreshold.has(input.sessionName)) {
|
|
517
705
|
return { triggered: false, reason: "already_triggered_above_threshold" };
|
|
518
706
|
}
|
|
707
|
+
const policyRefusal = this.terminalPolicyReason(input, { source: "openrig" });
|
|
708
|
+
if (policyRefusal) {
|
|
709
|
+
const existing = this.pendingPreCompactPrep.get(input.sessionName);
|
|
710
|
+
if (existing?.mode === "automatic" && existing.compact === "not_sent")
|
|
711
|
+
this.stopPreparation(input.sessionName, policyRefusal, existing);
|
|
712
|
+
return { triggered: false, reason: policyRefusal };
|
|
713
|
+
}
|
|
519
714
|
// Before any preparation prompt or /compact copy: a protected seat with no recorded pane cannot take input.
|
|
520
715
|
// An attempt already under way stops as not sent; none is begun.
|
|
521
716
|
if (this.paneUnknownProtected(input.sessionName)) {
|
|
@@ -525,6 +720,14 @@ export class ClaudeCompactionEnforcer {
|
|
|
525
720
|
return { triggered: false, reason: "pane_unknown_protected" };
|
|
526
721
|
}
|
|
527
722
|
let attempt = this.pendingPreCompactPrep.get(input.sessionName);
|
|
723
|
+
// A stopped attempt, automatic or manual, gives way to a fresh automatic one once the retry cooldown has passed. The
|
|
724
|
+
// cooldown keeps a seat that can't finish a map from getting a preparation prompt on every poll. Never retried: an
|
|
725
|
+
// explicit cancel, and an attempt whose /compact may have been submitted (its receipt was lost), which is never replayed.
|
|
726
|
+
if (attempt?.status === "stopped" && attempt.stoppedAt !== undefined && !attempt.cancelled && attempt.compact === "not_sent"
|
|
727
|
+
&& this.now() - attempt.stoppedAt >= this.autoRetryAfterStopMs) {
|
|
728
|
+
this.pendingPreCompactPrep.delete(input.sessionName);
|
|
729
|
+
attempt = undefined;
|
|
730
|
+
}
|
|
528
731
|
if (attempt?.mode === "manual")
|
|
529
732
|
return { triggered: false, reason: "preparation_pending" };
|
|
530
733
|
if (attempt?.status === "stopped")
|
|
@@ -532,7 +735,7 @@ export class ClaudeCompactionEnforcer {
|
|
|
532
735
|
if (!attempt) {
|
|
533
736
|
attempt = this.beginPreparation(input, "automatic");
|
|
534
737
|
if (attempt.status === "stopped")
|
|
535
|
-
return { triggered: false, reason: "occupant_generation_unavailable" };
|
|
738
|
+
return { triggered: false, reason: attempt.reason === "preparation_directory_unavailable" ? attempt.reason : "occupant_generation_unavailable" };
|
|
536
739
|
}
|
|
537
740
|
if (attempt.status === "sending") {
|
|
538
741
|
await this.deliverPreparation(input, attempt);
|
|
@@ -571,6 +774,10 @@ export class ClaudeCompactionEnforcer {
|
|
|
571
774
|
return this.triggerManualCompactUnchecked(input, opts);
|
|
572
775
|
}
|
|
573
776
|
async triggerManualCompactUnchecked(input, opts) {
|
|
777
|
+
// The manual budget starts with the request. A request reaching a seat before the monitor's first poll after a restart
|
|
778
|
+
// finds its owed restore or open preparation first, so it neither prepares twice nor replaces the owed restore.
|
|
779
|
+
const requestedAt = this.now();
|
|
780
|
+
this.recoverSeat(input);
|
|
574
781
|
this.reconcilePreparations();
|
|
575
782
|
const active = this.pendingPreCompactPrep.get(input.sessionName);
|
|
576
783
|
const stage = this.manualCompactionState.get(input.sessionName)?.stage;
|
|
@@ -586,9 +793,13 @@ export class ClaudeCompactionEnforcer {
|
|
|
586
793
|
// The preparation prompt cannot be written to such a seat either, so the whole attempt is refused up front.
|
|
587
794
|
if (this.paneUnknownProtected(input.sessionName))
|
|
588
795
|
return this.recordManualFailure(input.sessionName, "pane_unknown_protected");
|
|
589
|
-
const
|
|
796
|
+
const actor = opts.actor ?? { source: "caller", session: null };
|
|
797
|
+
const policyRefusal = this.terminalPolicyReason(input, actor);
|
|
798
|
+
if (policyRefusal)
|
|
799
|
+
return this.recordManualFailure(input.sessionName, policyRefusal);
|
|
800
|
+
const attempt = this.beginPreparation(input, "manual", opts.skipMap === true, actor, requestedAt);
|
|
590
801
|
if (attempt.status === "stopped")
|
|
591
|
-
return this.recordManualFailure(input.sessionName, "occupant_generation_unavailable");
|
|
802
|
+
return this.recordManualFailure(input.sessionName, attempt.reason ?? "occupant_generation_unavailable");
|
|
592
803
|
const failed = (reason) => {
|
|
593
804
|
// A cancelled request may settle after an explicit retry. Its receipt must
|
|
594
805
|
// not stop or overwrite the successor attempt's state.
|
|
@@ -634,34 +845,51 @@ export class ClaudeCompactionEnforcer {
|
|
|
634
845
|
}
|
|
635
846
|
const compact = await this.sendPreparedCompact(input, attempt, opts.skipMap === true);
|
|
636
847
|
if (!compact.ok) {
|
|
637
|
-
|
|
848
|
+
const outcome = failed(compact.reason ?? "send_failed");
|
|
849
|
+
// A /compact whose result was lost still owes its restore steps, and this request authorizes them.
|
|
850
|
+
if (!this.pendingPostCompactRestore.has(input.sessionName) || this.pendingPreCompactPrep.get(input.sessionName) !== attempt)
|
|
851
|
+
return outcome;
|
|
852
|
+
this.setManualStage(input.sessionName, "compact-sent", outcome.reason, opts.operatorInitiated === true);
|
|
853
|
+
return { ...outcome, restoreOwed: true };
|
|
638
854
|
}
|
|
639
855
|
this.setManualStage(input.sessionName, "compact-sent", undefined, opts.operatorInitiated === true);
|
|
640
856
|
return { triggered: true, stage: "compact-sent" };
|
|
641
857
|
}
|
|
642
|
-
beginPreparation(input, mode, skipMap = false) {
|
|
858
|
+
beginPreparation(input, mode, skipMap = false, policyActor = { source: "openrig" }, startedAt = this.now()) {
|
|
643
859
|
const attemptId = randomUUID();
|
|
860
|
+
const policy = this.settingsStore.resolveClaudeCompactionPolicy();
|
|
861
|
+
const preparationRoot = policy.preparationRoot || null;
|
|
644
862
|
const fallbackMapPath = path.join(this.openrigHome, "compaction", "preparation", sanitizeSessionKey(input.sessionName), attemptId, "RESTORE-MAP.md");
|
|
645
863
|
const occupantGeneration = this.resolveOccupantGeneration?.(input.sessionName)
|
|
646
864
|
?? this.sessionTransport.deliveryGuard?.maybeTarget(input.sessionName)?.occupant ?? null;
|
|
647
865
|
const attempt = {
|
|
648
|
-
attemptId, occupantGeneration, mode, status: "sending", delivery: "pending", compact: "not_sent", sends: 0,
|
|
649
|
-
deadlineAt: mode === "manual" ?
|
|
650
|
-
mapPath: fallbackMapPath,
|
|
866
|
+
policyActor, attemptId, occupantGeneration, mode, status: "sending", delivery: "pending", compact: "not_sent", sends: 0,
|
|
867
|
+
deadlineAt: mode === "manual" ? startedAt + this.manualPrepWaitMs : null,
|
|
868
|
+
mapPath: preparationRoot ? path.join(preparationRoot, sanitizeSessionKey(input.sessionName), attemptId, "RESTORE-MAP.md") : fallbackMapPath,
|
|
651
869
|
marker: `<!-- openrig-compaction-complete ${JSON.stringify({ attemptId, session: input.sessionName, occupantGeneration })} -->`,
|
|
652
|
-
policyWasEnabled:
|
|
870
|
+
policyWasEnabled: policy.enabled,
|
|
871
|
+
preparationRoot,
|
|
653
872
|
controller: new AbortController(),
|
|
654
|
-
compactInstruction:
|
|
873
|
+
compactInstruction: policy.compactInstruction ?? "",
|
|
655
874
|
};
|
|
875
|
+
// A stranded record this attempt replaces stays visible on the attempt, not dropped quietly.
|
|
876
|
+
const stranded = this.stranded.get(input.sessionName);
|
|
877
|
+
if (stranded)
|
|
878
|
+
attempt.supersedes = strandedSummary(stranded);
|
|
656
879
|
this.pendingPreCompactPrep.set(input.sessionName, attempt);
|
|
880
|
+
this.stranded.delete(input.sessionName);
|
|
657
881
|
// A map cannot satisfy an unknown occupant. Keep the failed attempt visible and
|
|
658
882
|
// disarmed; explicit skip-map still bypasses only the artifact prerequisite.
|
|
659
883
|
if (occupantGeneration === null && !skipMap)
|
|
660
884
|
this.stopPreparation(input.sessionName, "occupant_generation_unavailable");
|
|
661
|
-
if (
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
885
|
+
if (skipMap && preparationRoot) {
|
|
886
|
+
this.startRecord(input.sessionName, attempt);
|
|
887
|
+
return attempt;
|
|
888
|
+
}
|
|
889
|
+
if (attempt.status !== "stopped" && (preparationRoot || (input.cwd && path.isAbsolute(input.cwd)))) {
|
|
890
|
+
// An explicit root can be outside a workspace denied by Claude file permissions.
|
|
891
|
+
// The daemon cannot prove those permissions; the operator grants access to this root.
|
|
892
|
+
const root = preparationRoot ?? path.join(input.cwd, ".openrig", "compaction");
|
|
665
893
|
try {
|
|
666
894
|
fs.mkdirSync(root, { recursive: true });
|
|
667
895
|
const ignorePath = path.join(root, ".gitignore");
|
|
@@ -685,12 +913,17 @@ export class ClaudeCompactionEnforcer {
|
|
|
685
913
|
fs.closeSync(fd);
|
|
686
914
|
}
|
|
687
915
|
}
|
|
688
|
-
const parent = path.join(root, "preparation", sanitizeSessionKey(input.sessionName), attemptId);
|
|
916
|
+
const parent = path.join(preparationRoot ?? path.join(root, "preparation"), sanitizeSessionKey(input.sessionName), attemptId);
|
|
689
917
|
fs.mkdirSync(parent, { recursive: true });
|
|
690
918
|
fs.accessSync(parent, fs.constants.W_OK | fs.constants.X_OK);
|
|
691
919
|
attempt.mapPath = path.join(parent, "RESTORE-MAP.md");
|
|
692
920
|
}
|
|
693
|
-
catch {
|
|
921
|
+
catch {
|
|
922
|
+
// An explicit location is a permission choice: never silently move it back into
|
|
923
|
+
// the denied workspace or instance home. Keep the selected path visible in --state.
|
|
924
|
+
if (preparationRoot)
|
|
925
|
+
this.stopPreparation(input.sessionName, "preparation_directory_unavailable");
|
|
926
|
+
}
|
|
694
927
|
}
|
|
695
928
|
if (attempt.status !== "stopped" && attempt.mapPath === fallbackMapPath) {
|
|
696
929
|
// The cwd path already creates its parent. Prepare the legacy fallback too;
|
|
@@ -700,6 +933,8 @@ export class ClaudeCompactionEnforcer {
|
|
|
700
933
|
}
|
|
701
934
|
catch { /* Retain the existing path and deadline if the directory cannot be prepared. */ }
|
|
702
935
|
}
|
|
936
|
+
if (attempt.status !== "stopped")
|
|
937
|
+
this.startRecord(input.sessionName, attempt);
|
|
703
938
|
return attempt;
|
|
704
939
|
}
|
|
705
940
|
mapReady(attempt, publish = false) {
|
|
@@ -741,23 +976,44 @@ export class ClaudeCompactionEnforcer {
|
|
|
741
976
|
attempt.status = "waiting";
|
|
742
977
|
const policy = this.settingsStore.resolveClaudeCompactionPolicy();
|
|
743
978
|
let prep;
|
|
979
|
+
let marked = false;
|
|
744
980
|
try {
|
|
745
981
|
const composed = composeManagedCompactCommand({ compactInstruction: attempt.compactInstruction, mapPath: attempt.mapPath });
|
|
746
982
|
prep = await this.sessionTransport.send(input.sessionName, buildPreCompactPrepPrompt({
|
|
747
983
|
overflowCompactInstruction: composed.instructionInCommand ? null : attempt.compactInstruction,
|
|
748
984
|
usedPercentage: input.usedPercentage, thresholdPercent: policy.thresholdPercent,
|
|
749
985
|
preCompactInstruction: policy.preCompactInstruction, preparation: attempt, constructedAt: this.now(),
|
|
750
|
-
}))
|
|
986
|
+
}), { openrigNotice: true, beforeWrite: () => {
|
|
987
|
+
this.reconcilePreparations();
|
|
988
|
+
if (this.pendingPreCompactPrep.get(input.sessionName) !== attempt || attempt.controller.signal.aborted || attempt.status === "stopped")
|
|
989
|
+
throw new DeliveryGuardError("preparation_stopped", "This compaction attempt ended before preparation input.");
|
|
990
|
+
this.checkAttemptPolicy(input, attempt);
|
|
991
|
+
// At the write, a retry included: from here a restart reads this prompt as possibly delivered and never resends it.
|
|
992
|
+
if (!marked) {
|
|
993
|
+
marked = true;
|
|
994
|
+
this.persist(input.sessionName, attempt.attemptId, { delivery: "pending", sends: attempt.sends });
|
|
995
|
+
}
|
|
996
|
+
} });
|
|
751
997
|
}
|
|
752
|
-
catch {
|
|
753
|
-
|
|
998
|
+
catch (error) {
|
|
999
|
+
if (error instanceof DeliveryGuardError) {
|
|
1000
|
+
const written = error.inputWritten === true;
|
|
1001
|
+
const attempted = error.inputAttempted === true;
|
|
1002
|
+
prep = { ok: false, sent: written, reason: error.code,
|
|
1003
|
+
inputPhase: written ? "written" : attempted ? "attempted" : "not_reached" };
|
|
1004
|
+
}
|
|
1005
|
+
else
|
|
1006
|
+
prep = null;
|
|
754
1007
|
}
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
|
|
1008
|
+
const writeAttempted = prep?.inputPhase === "attempted" || prep?.inputPhase === "written" || prep?.sent === true;
|
|
1009
|
+
// `not_reached` is a positive pre-input result: a guard refusal before any write, such as a draft hold.
|
|
1010
|
+
const notSent = !writeAttempted && (prep?.outcome === "retained" || prep?.inputPhase === "not_reached"
|
|
1011
|
+
|| ["preparation_stopped", "terminal_policy_refused", "terminal_policy_unavailable", "target_needs_input", "session_missing", "typing_guard_enabled", "mid_work", "tmux_unavailable"].includes(prep?.reason ?? "")
|
|
1012
|
+
|| (prep?.sent === false && ["target_runtime_not_running", "target_runtime_unverified", "target_runtime_conflict", "transport_unavailable"].includes(prep.reason ?? "")));
|
|
758
1013
|
// Record this attempt's effect even if cancellation/retry happened during the await.
|
|
759
1014
|
// Neither a failed response nor its loss proves no paste/Enter. Never replay uncertainty.
|
|
760
1015
|
attempt.delivery = prep?.ok && prep.outcome !== "retained" ? "delivered" : notSent ? "not_sent" : "uncertain";
|
|
1016
|
+
this.persist(input.sessionName, attempt.attemptId, { delivery: attempt.delivery, sends: attempt.sends });
|
|
761
1017
|
if (this.pendingPreCompactPrep.get(input.sessionName) !== attempt || attempt.controller.signal.aborted)
|
|
762
1018
|
return;
|
|
763
1019
|
if (notSent) {
|
|
@@ -768,23 +1024,43 @@ export class ClaudeCompactionEnforcer {
|
|
|
768
1024
|
}
|
|
769
1025
|
if (attempt.mode === "automatic")
|
|
770
1026
|
attempt.deadlineAt = this.now() + AUTO_PREP_WAIT_MS_DEFAULT;
|
|
1027
|
+
this.persist(input.sessionName, attempt.attemptId, { deadlineAt: attempt.deadlineAt });
|
|
771
1028
|
this.reconcilePreparations();
|
|
772
1029
|
}
|
|
773
1030
|
async sendPreparedCompact(input, attempt, skipMap) {
|
|
774
1031
|
const check = () => {
|
|
775
1032
|
this.reconcilePreparations();
|
|
1033
|
+
this.checkAttemptPolicy(input, attempt);
|
|
776
1034
|
if (this.pendingPreCompactPrep.get(input.sessionName) !== attempt || attempt.status !== "waiting" || attempt.controller.signal.aborted)
|
|
777
1035
|
throw new DeliveryGuardError(attempt.reason ?? "preparation_stopped", "Compaction preparation ended; no further input is authorized.");
|
|
778
1036
|
if (!skipMap && !this.mapReady(attempt, true))
|
|
779
1037
|
throw new DeliveryGuardError("preparation_incomplete", "This attempt's restore map is incomplete; /compact was not submitted.");
|
|
780
1038
|
};
|
|
781
1039
|
const composed = composeManagedCompactCommand({ compactInstruction: attempt.compactInstruction, mapPath: skipMap ? null : attempt.mapPath });
|
|
1040
|
+
// Whatever the command could not carry, the restore request carries instead. An explicitly
|
|
1041
|
+
// selected preparation root also keeps its exact map in that request, even when the command fit it.
|
|
1042
|
+
const carry = skipMap || attempt.preparationRoot !== null || !composed.mapPathInCommand || !composed.instructionInCommand ? {
|
|
1043
|
+
mapPath: !skipMap && (attempt.preparationRoot !== null || !composed.mapPathInCommand) ? attempt.mapPath : null,
|
|
1044
|
+
compactInstruction: composed.instructionInCommand ? null : attempt.compactInstruction,
|
|
1045
|
+
...(skipMap ? { skipMap: { mapPath: attempt.mapPath, marker: attempt.marker } } : {}),
|
|
1046
|
+
} : undefined;
|
|
1047
|
+
const operatorInitiated = this.manualCompactionState.get(input.sessionName)?.operatorInitiated;
|
|
1048
|
+
let marked = false;
|
|
1049
|
+
// At the write, after the final checks: from here a restart treats /compact as possibly sent, and keeps what its
|
|
1050
|
+
// restore request needs (the carried map and instruction, and a manual request's authority).
|
|
1051
|
+
const beforeWrite = () => {
|
|
1052
|
+
check();
|
|
1053
|
+
if (!marked) {
|
|
1054
|
+
marked = true;
|
|
1055
|
+
this.persist(input.sessionName, attempt.attemptId, { compactSending: true, restoreCarry: carry, operatorInitiated });
|
|
1056
|
+
}
|
|
1057
|
+
};
|
|
782
1058
|
const send = async () => {
|
|
783
1059
|
check();
|
|
784
1060
|
// Both paths send only to an idle seat, with the same idle wait, bounded by the attempt's existing
|
|
785
1061
|
// deadline. (The automatic path used to send into a seat still finishing its preparation turn.)
|
|
786
1062
|
// Idle comes from a live pane read: the newest hook can predate the rest of the preparation turn.
|
|
787
|
-
return this.sessionTransport.send(input.sessionName, composed.command, {
|
|
1063
|
+
return this.sessionTransport.send(input.sessionName, composed.command, { openrigNotice: true, beforeWrite, ...(attempt.deadlineAt !== null ? { waitForIdleMs: Math.max(1, Math.min(this.compactSendIdleWaitMs, attempt.deadlineAt - this.now())), readinessFromPaneOnly: true } : {}) });
|
|
788
1064
|
};
|
|
789
1065
|
let result;
|
|
790
1066
|
let guardRefused = false;
|
|
@@ -807,37 +1083,60 @@ export class ClaudeCompactionEnforcer {
|
|
|
807
1083
|
// Nothing sent: a guard refusal before input, a retained send, or the transport's explicit sent:false
|
|
808
1084
|
// for a send that never reached its write.
|
|
809
1085
|
const notSent = !writeAttempted && (guardRefused || result.outcome === "retained" || result.sent === false);
|
|
1086
|
+
if (notSent && marked)
|
|
1087
|
+
this.persist(input.sessionName, attempt.attemptId, { compactSending: undefined });
|
|
810
1088
|
// Only a known pre-input idle deferral keeps the automatic attempt armed for a later poll; the transport
|
|
811
1089
|
// marks those `not_reached`. reconcilePreparations still ends it at the deadline or on an occupant change.
|
|
812
|
-
|
|
1090
|
+
// A typing-guard draft hold (`draft_*`) is `not_reached` too, but it is a refusal, not an idle wait: it stops
|
|
1091
|
+
// as not sent, and a fresh attempt may begin after the retry cooldown.
|
|
1092
|
+
const draftHold = typeof result.reason === "string" && result.reason.startsWith("draft_");
|
|
1093
|
+
if (attempt.mode === "automatic" && notSent && phase === "not_reached" && !draftHold) {
|
|
813
1094
|
return { ok: false, reason: "waiting_for_idle" };
|
|
814
1095
|
}
|
|
815
1096
|
// A compact may have been sent despite a lost result. Never replay automatically.
|
|
816
1097
|
attempt.compact = notSent ? "not_sent" : "uncertain";
|
|
1098
|
+
// It may have run, so its restore steps are owed, as after a submitted /compact; the restore request tells a seat that
|
|
1099
|
+
// didn't compact to say so and skip. Not when the attempt was cancelled, stopped or replaced during the send.
|
|
1100
|
+
if (!notSent && !attempt.controller.signal.aborted && this.pendingPreCompactPrep.get(input.sessionName) === attempt) {
|
|
1101
|
+
this.owePostCompactRestore(input.sessionName, attempt, carry);
|
|
1102
|
+
this.afterUncertainCompact.add(input.sessionName);
|
|
1103
|
+
this.persist(input.sessionName, attempt.attemptId, { restoreCarry: carry, operatorInitiated, uncertainCompact: true });
|
|
1104
|
+
}
|
|
817
1105
|
const reason = attempt.reason ?? result.reason ?? "delivery_uncertain";
|
|
818
1106
|
this.stopPreparation(input.sessionName, reason, attempt);
|
|
819
1107
|
return { ok: false, reason };
|
|
820
1108
|
}
|
|
821
1109
|
attempt.compact = "submitted_unconfirmed";
|
|
822
|
-
// Whatever the command could not carry, the restore request carries instead.
|
|
823
|
-
if (skipMap || !composed.mapPathInCommand || !composed.instructionInCommand) {
|
|
824
|
-
this.restoreCarry.set(input.sessionName, {
|
|
825
|
-
mapPath: !skipMap && !composed.mapPathInCommand ? attempt.mapPath : null,
|
|
826
|
-
compactInstruction: composed.instructionInCommand ? null : attempt.compactInstruction,
|
|
827
|
-
...(skipMap ? { skipMap: { mapPath: attempt.mapPath, marker: attempt.marker } } : {}),
|
|
828
|
-
});
|
|
829
|
-
}
|
|
830
|
-
else
|
|
831
|
-
this.restoreCarry.delete(input.sessionName);
|
|
832
1110
|
if (attempt.controller.signal.aborted)
|
|
833
1111
|
return { ok: false, reason: attempt.reason };
|
|
834
1112
|
attempt.status = "compact-sent";
|
|
835
|
-
this.
|
|
836
|
-
this.
|
|
837
|
-
this.pendingPostCompactRestore.set(input.sessionName, "turn_boundary");
|
|
838
|
-
this.pendingStageGeneration.set(input.sessionName, attempt.occupantGeneration);
|
|
1113
|
+
this.owePostCompactRestore(input.sessionName, attempt, carry);
|
|
1114
|
+
this.persist(input.sessionName, attempt.attemptId, { phase: "turn_boundary", restoreCarry: carry, operatorInitiated });
|
|
839
1115
|
return { ok: true };
|
|
840
1116
|
}
|
|
1117
|
+
/** What the seat's input box holds now, as `rig capture --json` reads it (`empty`, `likely-suggestion`, `typed`, ...), or
|
|
1118
|
+
* why it couldn't be read. Never throws. */
|
|
1119
|
+
async inputBoxStatus(sessionName) {
|
|
1120
|
+
try {
|
|
1121
|
+
const capture = await this.sessionTransport.capture(sessionName, { inputBox: true });
|
|
1122
|
+
return capture.inputBox?.status ?? capture.reason ?? "unknown";
|
|
1123
|
+
}
|
|
1124
|
+
catch {
|
|
1125
|
+
return "unknown";
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
/** /compact was submitted, or may have been: its restore steps are owed next, and no new automatic compaction starts
|
|
1129
|
+
* until they finish. */
|
|
1130
|
+
owePostCompactRestore(sessionName, attempt, carry) {
|
|
1131
|
+
if (carry)
|
|
1132
|
+
this.restoreCarry.set(sessionName, carry);
|
|
1133
|
+
else
|
|
1134
|
+
this.restoreCarry.delete(sessionName);
|
|
1135
|
+
this.lastAutoCompactAt.set(sessionName, this.now());
|
|
1136
|
+
this.triggeredAboveThreshold.add(sessionName);
|
|
1137
|
+
this.pendingPostCompactRestore.set(sessionName, "turn_boundary");
|
|
1138
|
+
this.pendingStageGeneration.set(sessionName, attempt.occupantGeneration);
|
|
1139
|
+
}
|
|
841
1140
|
/** The map the restore request names. With --skip-map: a map the seat completed at the attempt path
|
|
842
1141
|
* anyway, or a plain statement that none was required. Nothing publishes the .tmp under --skip-map, so
|
|
843
1142
|
* the final path is checked first, then the .tmp, and whichever ends with the marker is named. */
|
|
@@ -876,18 +1175,173 @@ export class ClaudeCompactionEnforcer {
|
|
|
876
1175
|
attempt.policyWasEnabled = true;
|
|
877
1176
|
}
|
|
878
1177
|
}
|
|
1178
|
+
/** Start the record for a new attempt, beside its map. */
|
|
1179
|
+
startRecord(sessionName, attempt) {
|
|
1180
|
+
this.records.set(sessionName, { file: path.join(path.dirname(attempt.mapPath), COMPACTION_RECORD_FILE), record: {
|
|
1181
|
+
daemon: this.daemonInstance, attemptId: attempt.attemptId, session: sessionName, occupantGeneration: attempt.occupantGeneration, mode: attempt.mode,
|
|
1182
|
+
phase: "preparing", delivery: attempt.delivery, deadlineAt: attempt.deadlineAt, sends: attempt.sends,
|
|
1183
|
+
mapPath: attempt.mapPath, marker: attempt.marker, compactInstruction: attempt.compactInstruction,
|
|
1184
|
+
preparationRoot: attempt.preparationRoot, updatedAt: this.now(),
|
|
1185
|
+
} });
|
|
1186
|
+
this.persist(sessionName, attempt.attemptId, {});
|
|
1187
|
+
}
|
|
1188
|
+
/** Record what this daemon just did for the seat's current attempt. Best-effort: a record that can't be written
|
|
1189
|
+
* leaves the attempt as it was before records existed, not picked up after a restart. */
|
|
1190
|
+
persist(sessionName, attemptId, patch) {
|
|
1191
|
+
const current = this.records.get(sessionName);
|
|
1192
|
+
if (!current || current.record.attemptId !== attemptId)
|
|
1193
|
+
return;
|
|
1194
|
+
current.record = { ...current.record, ...patch, daemon: this.daemonInstance, updatedAt: this.now() };
|
|
1195
|
+
const temporary = `${current.file}.${process.pid}.tmp`;
|
|
1196
|
+
try {
|
|
1197
|
+
fs.writeFileSync(temporary, `${JSON.stringify(current.record)}\n`, { mode: 0o600 });
|
|
1198
|
+
fs.renameSync(temporary, current.file);
|
|
1199
|
+
}
|
|
1200
|
+
catch {
|
|
1201
|
+
try {
|
|
1202
|
+
fs.rmSync(temporary, { force: true });
|
|
1203
|
+
}
|
|
1204
|
+
catch { /* nothing to clean */ }
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
persistStage(sessionName, phase) {
|
|
1208
|
+
const current = this.records.get(sessionName);
|
|
1209
|
+
if (current)
|
|
1210
|
+
this.persist(sessionName, current.record.attemptId, { phase });
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* After a daemon restart, pick up the seat's managed compaction from the record beside its newest attempt, when an
|
|
1214
|
+
* earlier daemon process wrote it. This runs once per seat, and only when this daemon holds nothing for that seat.
|
|
1215
|
+
* - An owed post-compact stage (turn boundary, restore, audit) is resumed, and so is the restore after a /compact that
|
|
1216
|
+
* was being sent or whose outcome was lost.
|
|
1217
|
+
* - An automatic preparation is waited on rather than begun again. A prompt whose delivery wasn't recorded may have
|
|
1218
|
+
* reached the seat, so it is never sent again.
|
|
1219
|
+
* - A manual preparation stops, because its caller is gone.
|
|
1220
|
+
* A record of another occupant, or in any other shape (see `readCompactionRecord`), is left alone. An open post-compact
|
|
1221
|
+
* record older than the recovery window isn't resumed; it reads as stranded, at the stage it owes.
|
|
1222
|
+
*/
|
|
1223
|
+
recoverAfterRestart(input, preparationRoot) {
|
|
1224
|
+
const session = input.sessionName;
|
|
1225
|
+
if (input.runtime !== "claude-code" || this.recovered.has(session))
|
|
1226
|
+
return;
|
|
1227
|
+
this.recovered.add(session);
|
|
1228
|
+
if (this.pendingPreCompactPrep.has(session) || this.pendingPostCompactRestore.has(session))
|
|
1229
|
+
return;
|
|
1230
|
+
const key = sanitizeSessionKey(session);
|
|
1231
|
+
// The places beginPreparation puts an attempt: an explicit root, the seat's workspace, or the instance home.
|
|
1232
|
+
const dirs = new Set([
|
|
1233
|
+
...(preparationRoot ? [path.join(preparationRoot, key)] : []),
|
|
1234
|
+
...(input.cwd && path.isAbsolute(input.cwd) ? [path.join(input.cwd, ".openrig", "compaction", "preparation", key)] : []),
|
|
1235
|
+
path.join(this.openrigHome, "compaction", "preparation", key),
|
|
1236
|
+
]);
|
|
1237
|
+
let newest = null;
|
|
1238
|
+
for (const dir of dirs) {
|
|
1239
|
+
let entries;
|
|
1240
|
+
try {
|
|
1241
|
+
entries = fs.readdirSync(dir);
|
|
1242
|
+
}
|
|
1243
|
+
catch {
|
|
1244
|
+
continue;
|
|
1245
|
+
}
|
|
1246
|
+
for (const entry of entries) {
|
|
1247
|
+
const file = path.join(dir, entry, COMPACTION_RECORD_FILE);
|
|
1248
|
+
const record = readCompactionRecord(file);
|
|
1249
|
+
if (record && record.session === session && record.attemptId === entry && (!newest || record.updatedAt > newest.record.updatedAt)) {
|
|
1250
|
+
newest = { file, record };
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
if (!newest)
|
|
1255
|
+
return;
|
|
1256
|
+
const { record } = newest;
|
|
1257
|
+
// This process's own record (another enforcer in it) is live state, not a predecessor's.
|
|
1258
|
+
if (record.daemon === this.daemonInstance || record.phase === "done" || record.phase === "ended")
|
|
1259
|
+
return;
|
|
1260
|
+
const live = this.resolveOccupantGeneration?.(session) ?? this.sessionTransport.deliveryGuard?.maybeTarget(session)?.occupant ?? null;
|
|
1261
|
+
if (record.occupantGeneration !== null && live !== null && live !== record.occupantGeneration)
|
|
1262
|
+
return;
|
|
1263
|
+
const stale = this.now() - record.updatedAt > this.restartRecoveryWindowMs;
|
|
1264
|
+
// A /compact whose send had begun, or whose outcome was lost, is never sent again; its restore steps are owed in case it
|
|
1265
|
+
// ran, each only into an empty input box. The restore request tells a seat that didn't compact to say so and skip.
|
|
1266
|
+
const phase = (record.phase === "preparing" && record.compactSending) || record.phase === "compact_uncertain" ? "turn_boundary" : record.phase;
|
|
1267
|
+
const inFlight = phase !== record.phase;
|
|
1268
|
+
if (phase === "preparing") {
|
|
1269
|
+
if (stale)
|
|
1270
|
+
return; // Its preparation deadline passed long ago; a fresh attempt may begin.
|
|
1271
|
+
this.records.set(session, newest);
|
|
1272
|
+
this.pendingPreCompactPrep.set(session, {
|
|
1273
|
+
policyActor: { source: "openrig" }, attemptId: record.attemptId, occupantGeneration: record.occupantGeneration,
|
|
1274
|
+
mapPath: record.mapPath, marker: record.marker, mode: record.mode,
|
|
1275
|
+
status: record.delivery === "not_sent" ? "sending" : "waiting",
|
|
1276
|
+
delivery: record.delivery === "pending" ? "uncertain" : record.delivery,
|
|
1277
|
+
compact: "not_sent", sends: record.sends,
|
|
1278
|
+
deadlineAt: record.deadlineAt ?? (record.delivery === "not_sent" ? null : record.updatedAt + AUTO_PREP_WAIT_MS_DEFAULT),
|
|
1279
|
+
policyWasEnabled: true, preparationRoot: record.preparationRoot, controller: new AbortController(),
|
|
1280
|
+
compactInstruction: record.compactInstruction,
|
|
1281
|
+
});
|
|
1282
|
+
if (record.mode === "manual")
|
|
1283
|
+
this.stopPreparation(session, "daemon_restarted");
|
|
1284
|
+
return;
|
|
1285
|
+
}
|
|
1286
|
+
if (stale) {
|
|
1287
|
+
this.stranded.set(session, { ...record, phase });
|
|
1288
|
+
return;
|
|
1289
|
+
}
|
|
1290
|
+
this.records.set(session, newest);
|
|
1291
|
+
this.pendingPostCompactRestore.set(session, phase);
|
|
1292
|
+
this.pendingStageGeneration.set(session, record.occupantGeneration);
|
|
1293
|
+
if (inFlight || record.uncertainCompact) {
|
|
1294
|
+
this.afterUncertainCompact.add(session);
|
|
1295
|
+
this.persist(session, record.attemptId, { uncertainCompact: true });
|
|
1296
|
+
}
|
|
1297
|
+
if (record.restoreCarry)
|
|
1298
|
+
this.restoreCarry.set(session, record.restoreCarry);
|
|
1299
|
+
// As after a /compact this daemon sent: no new automatic compaction until the owed stages finish.
|
|
1300
|
+
this.lastAutoCompactAt.set(session, this.now());
|
|
1301
|
+
this.triggeredAboveThreshold.add(session);
|
|
1302
|
+
if (record.mode === "manual") {
|
|
1303
|
+
this.setManualStage(session, phase === "compliance_prompt" ? "restore-sent" : "compact-sent", undefined, record.operatorInitiated);
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
879
1306
|
stopPreparation(session, reason, expected) {
|
|
880
1307
|
const attempt = this.pendingPreCompactPrep.get(session);
|
|
881
1308
|
if ((expected && expected !== attempt) || !attempt || attempt.status === "stopped" || attempt.status === "compact-sent")
|
|
882
1309
|
return;
|
|
883
1310
|
attempt.status = "stopped";
|
|
884
1311
|
attempt.reason = reason;
|
|
1312
|
+
attempt.stoppedAt = this.now();
|
|
885
1313
|
attempt.controller.abort();
|
|
1314
|
+
this.persist(session, attempt.attemptId, { phase: attempt.compact === "uncertain" ? "compact_uncertain" : "ended" });
|
|
886
1315
|
if (attempt.mode === "manual")
|
|
887
1316
|
this.setManualStage(session, "skipped-or-failed", reason);
|
|
888
1317
|
}
|
|
889
1318
|
cancelPreparation(session) {
|
|
890
|
-
this.
|
|
1319
|
+
const attempt = this.pendingPreCompactPrep.get(session);
|
|
1320
|
+
if (attempt)
|
|
1321
|
+
attempt.cancelled = true;
|
|
1322
|
+
if (attempt?.status === "compact-sent" || this.pendingPostCompactRestore.has(session)) {
|
|
1323
|
+
// Abandon management, not the provider command: keep its unconfirmed receipt and map.
|
|
1324
|
+
// Do not clear automatic dedup/re-arm state or send any input. A later explicit retry
|
|
1325
|
+
// still requires a new preparation and the live-pane idle check before /compact.
|
|
1326
|
+
if (attempt) {
|
|
1327
|
+
attempt.status = "stopped";
|
|
1328
|
+
attempt.reason = "compaction_cancelled";
|
|
1329
|
+
attempt.controller.abort();
|
|
1330
|
+
}
|
|
1331
|
+
this.persistStage(session, "ended");
|
|
1332
|
+
this.pendingPostCompactRestore.delete(session);
|
|
1333
|
+
this.pendingStageGeneration.delete(session);
|
|
1334
|
+
this.restoreCarry.delete(session);
|
|
1335
|
+
this.afterUncertainCompact.delete(session);
|
|
1336
|
+
this.lastInputBox.delete(session);
|
|
1337
|
+
this.setManualStage(session, "cancelled", "compaction_cancelled");
|
|
1338
|
+
}
|
|
1339
|
+
else {
|
|
1340
|
+
this.stopPreparation(session, "preparation_cancelled");
|
|
1341
|
+
// A cancel also ends an uncertain /compact's owed restore, so a restart doesn't resume it.
|
|
1342
|
+
if (attempt?.compact === "uncertain")
|
|
1343
|
+
this.persistStage(session, "ended");
|
|
1344
|
+
}
|
|
891
1345
|
return this.getPreparationState(session);
|
|
892
1346
|
}
|
|
893
1347
|
getPreparationState(session) {
|
|
@@ -895,7 +1349,7 @@ export class ClaudeCompactionEnforcer {
|
|
|
895
1349
|
const attempt = this.pendingPreCompactPrep.get(session);
|
|
896
1350
|
if (!attempt)
|
|
897
1351
|
return null;
|
|
898
|
-
const { controller: _controller, sends: _sends, policyWasEnabled: _enabled, compactInstruction: _instruction, ...state } = attempt;
|
|
1352
|
+
const { controller: _controller, sends: _sends, policyWasEnabled: _enabled, preparationRoot: _preparationRoot, compactInstruction: _instruction, stoppedAt: _stoppedAt, cancelled: _cancelled, ...state } = attempt;
|
|
899
1353
|
return state;
|
|
900
1354
|
}
|
|
901
1355
|
/** OPR.0.4.3.14 — read the surfaced manual-trigger state for a seat (AC-3). */
|
|
@@ -912,6 +1366,11 @@ export class ClaudeCompactionEnforcer {
|
|
|
912
1366
|
*/
|
|
913
1367
|
invalidateOccupant(sessionName) {
|
|
914
1368
|
this.stopPreparation(sessionName, "stale_generation");
|
|
1369
|
+
this.persistStage(sessionName, "ended");
|
|
1370
|
+
this.records.delete(sessionName);
|
|
1371
|
+
this.stranded.delete(sessionName);
|
|
1372
|
+
this.afterUncertainCompact.delete(sessionName);
|
|
1373
|
+
this.lastInputBox.delete(sessionName);
|
|
915
1374
|
this.lastAutoCompactAt.delete(sessionName);
|
|
916
1375
|
this.postCompactRestoreCooldownUntil.delete(sessionName);
|
|
917
1376
|
this.triggeredAboveThreshold.delete(sessionName);
|