@openrig/cli 0.7.16 → 0.7.18
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 +9 -9
- package/daemon/assets/onboarding/02-self-and-competent-action.md +5 -41
- package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/skills/working-with-an-openrig-team/SKILL.md +22 -6
- 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/hooks/scripts/refocus.cjs +5 -0
- package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +23 -0
- package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +11 -0
- package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +25 -5
- package/daemon/assets/skills/rigs/SKILL.md +95 -42
- package/daemon/assets/skills/rigs/references/installing-for-someone.md +47 -0
- 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 +123 -35
- package/daemon/context-packs/reference/getting-started.md +8 -8
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +166 -0
- package/daemon/context-packs/reference/whats-new.md +294 -6
- package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
- package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
- package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
- package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +23 -0
- package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-skills/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 +1 -1
- package/daemon/context-packs/skills/core/openrig-upgrade/SKILL.md +2 -0
- package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/working-with-an-openrig-team/SKILL.md +22 -6
- package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
- package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-user/SKILL.md +11 -0
- package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +25 -5
- 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.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +52 -8
- 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 +17 -7
- package/daemon/dist/adapters/claude-resume.js.map +1 -1
- package/daemon/dist/adapters/kernel-authority.d.ts +1 -1
- package/daemon/dist/adapters/kernel-authority.d.ts.map +1 -1
- package/daemon/dist/adapters/kernel-authority.js +22 -10
- package/daemon/dist/adapters/kernel-authority.js.map +1 -1
- package/daemon/dist/adapters/openshell-driver.d.ts +1 -0
- package/daemon/dist/adapters/openshell-driver.d.ts.map +1 -1
- package/daemon/dist/adapters/openshell-driver.js +3 -0
- package/daemon/dist/adapters/openshell-driver.js.map +1 -1
- package/daemon/dist/adapters/openshell-podman-observer.d.ts +9 -7
- package/daemon/dist/adapters/openshell-podman-observer.d.ts.map +1 -1
- package/daemon/dist/adapters/openshell-podman-observer.js +20 -3
- package/daemon/dist/adapters/openshell-podman-observer.js.map +1 -1
- package/daemon/dist/adapters/pi-runner-protocol.d.ts +43 -0
- package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner-protocol.js.map +1 -1
- package/daemon/dist/adapters/pi-runner.d.ts +88 -5
- package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.js +707 -43
- package/daemon/dist/adapters/pi-runner.js.map +1 -1
- package/daemon/dist/adapters/tmux-credential-env.d.ts +4 -0
- package/daemon/dist/adapters/tmux-credential-env.d.ts.map +1 -0
- package/daemon/dist/adapters/tmux-credential-env.js +14 -0
- package/daemon/dist/adapters/tmux-credential-env.js.map +1 -0
- package/daemon/dist/adapters/tmux-exec.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux-exec.js +4 -3
- package/daemon/dist/adapters/tmux-exec.js.map +1 -1
- package/daemon/dist/adapters/tmux-server.d.ts +2 -2
- package/daemon/dist/adapters/tmux-server.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux-server.js +12 -4
- package/daemon/dist/adapters/tmux-server.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +223 -12
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +836 -30
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/attention-surface.d.ts +4 -1
- 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/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +12 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/168_context_usage_occupant_generation.d.ts +6 -0
- package/daemon/dist/db/migrations/168_context_usage_occupant_generation.d.ts.map +1 -0
- package/daemon/dist/db/migrations/168_context_usage_occupant_generation.js +10 -0
- package/daemon/dist/db/migrations/168_context_usage_occupant_generation.js.map +1 -0
- package/daemon/dist/db/migrations/170_rig_delivery_drains.d.ts +3 -0
- package/daemon/dist/db/migrations/170_rig_delivery_drains.d.ts.map +1 -0
- package/daemon/dist/db/migrations/170_rig_delivery_drains.js +21 -0
- package/daemon/dist/db/migrations/170_rig_delivery_drains.js.map +1 -0
- package/daemon/dist/db/migrations/171_claude_auto_mode.d.ts +4 -0
- package/daemon/dist/db/migrations/171_claude_auto_mode.d.ts.map +1 -0
- package/daemon/dist/db/migrations/171_claude_auto_mode.js +9 -0
- package/daemon/dist/db/migrations/171_claude_auto_mode.js.map +1 -0
- package/daemon/dist/db/migrations/171_node_input_route.d.ts +4 -0
- package/daemon/dist/db/migrations/171_node_input_route.d.ts.map +1 -0
- package/daemon/dist/db/migrations/171_node_input_route.js +6 -0
- package/daemon/dist/db/migrations/171_node_input_route.js.map +1 -0
- package/daemon/dist/db/migrations/172_queue_return_route.d.ts +3 -0
- package/daemon/dist/db/migrations/172_queue_return_route.d.ts.map +1 -0
- package/daemon/dist/db/migrations/172_queue_return_route.js +13 -0
- package/daemon/dist/db/migrations/172_queue_return_route.js.map +1 -0
- package/daemon/dist/db/migrations/173_node_process_limits.d.ts +4 -0
- package/daemon/dist/db/migrations/173_node_process_limits.d.ts.map +1 -0
- package/daemon/dist/db/migrations/173_node_process_limits.js +6 -0
- package/daemon/dist/db/migrations/173_node_process_limits.js.map +1 -0
- package/daemon/dist/domain/activity-grants.d.ts.map +1 -1
- package/daemon/dist/domain/activity-grants.js +2 -0
- package/daemon/dist/domain/activity-grants.js.map +1 -1
- package/daemon/dist/domain/agent-activity-store.d.ts +36 -1
- package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
- package/daemon/dist/domain/agent-activity-store.js +192 -3
- package/daemon/dist/domain/agent-activity-store.js.map +1 -1
- package/daemon/dist/domain/agent-images/resume-token-discovery.d.ts +10 -0
- package/daemon/dist/domain/agent-images/resume-token-discovery.d.ts.map +1 -1
- package/daemon/dist/domain/agent-images/resume-token-discovery.js +21 -0
- package/daemon/dist/domain/agent-images/resume-token-discovery.js.map +1 -1
- package/daemon/dist/domain/applied-launch-observation-store.d.ts +5 -0
- package/daemon/dist/domain/applied-launch-observation-store.d.ts.map +1 -1
- package/daemon/dist/domain/applied-launch-observation-store.js +57 -21
- package/daemon/dist/domain/applied-launch-observation-store.js.map +1 -1
- package/daemon/dist/domain/builtin-startup-files.d.ts +26 -12
- package/daemon/dist/domain/builtin-startup-files.d.ts.map +1 -1
- package/daemon/dist/domain/builtin-startup-files.js +73 -34
- package/daemon/dist/domain/builtin-startup-files.js.map +1 -1
- package/daemon/dist/domain/claude-auto-mode.d.ts +64 -0
- package/daemon/dist/domain/claude-auto-mode.d.ts.map +1 -0
- package/daemon/dist/domain/claude-auto-mode.js +114 -0
- package/daemon/dist/domain/claude-auto-mode.js.map +1 -0
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +2 -0
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +11 -4
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/claude-continuation-launch.d.ts +5 -1
- package/daemon/dist/domain/claude-continuation-launch.d.ts.map +1 -1
- package/daemon/dist/domain/claude-continuation-launch.js +51 -2
- package/daemon/dist/domain/claude-continuation-launch.js.map +1 -1
- package/daemon/dist/domain/claude-core-plugin-env.d.ts +7 -3
- package/daemon/dist/domain/claude-core-plugin-env.d.ts.map +1 -1
- package/daemon/dist/domain/claude-core-plugin-env.js +11 -8
- package/daemon/dist/domain/claude-core-plugin-env.js.map +1 -1
- package/daemon/dist/domain/codex-daemon-support.d.ts.map +1 -1
- package/daemon/dist/domain/codex-daemon-support.js +6 -1
- package/daemon/dist/domain/codex-daemon-support.js.map +1 -1
- package/daemon/dist/domain/codex-thread-id.d.ts +13 -0
- package/daemon/dist/domain/codex-thread-id.d.ts.map +1 -1
- package/daemon/dist/domain/codex-thread-id.js +132 -9
- package/daemon/dist/domain/codex-thread-id.js.map +1 -1
- package/daemon/dist/domain/community-harness-launch-result.d.ts +2 -0
- package/daemon/dist/domain/community-harness-launch-result.d.ts.map +1 -1
- package/daemon/dist/domain/community-harness-launch-result.js +5 -1
- package/daemon/dist/domain/community-harness-launch-result.js.map +1 -1
- package/daemon/dist/domain/connection-contract.d.ts +91 -0
- package/daemon/dist/domain/connection-contract.d.ts.map +1 -1
- package/daemon/dist/domain/connection-contract.js +75 -1
- package/daemon/dist/domain/connection-contract.js.map +1 -1
- package/daemon/dist/domain/context-usage-store.d.ts +16 -2
- package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
- package/daemon/dist/domain/context-usage-store.js +70 -15
- package/daemon/dist/domain/context-usage-store.js.map +1 -1
- package/daemon/dist/domain/current-work.d.ts +11 -1
- package/daemon/dist/domain/current-work.d.ts.map +1 -1
- package/daemon/dist/domain/current-work.js +107 -12
- package/daemon/dist/domain/current-work.js.map +1 -1
- package/daemon/dist/domain/cwd-resolution.d.ts +2 -0
- package/daemon/dist/domain/cwd-resolution.d.ts.map +1 -1
- package/daemon/dist/domain/cwd-resolution.js +7 -2
- package/daemon/dist/domain/cwd-resolution.js.map +1 -1
- package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/draft-aware-delivery.js +5 -1
- package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
- package/daemon/dist/domain/environment-lifecycle.d.ts +15 -0
- package/daemon/dist/domain/environment-lifecycle.d.ts.map +1 -1
- package/daemon/dist/domain/environment-lifecycle.js +22 -4
- package/daemon/dist/domain/environment-lifecycle.js.map +1 -1
- package/daemon/dist/domain/errors.d.ts +4 -0
- package/daemon/dist/domain/errors.d.ts.map +1 -1
- package/daemon/dist/domain/errors.js +7 -0
- package/daemon/dist/domain/errors.js.map +1 -1
- package/daemon/dist/domain/execution-view.d.ts.map +1 -1
- package/daemon/dist/domain/execution-view.js +8 -1
- package/daemon/dist/domain/execution-view.js.map +1 -1
- package/daemon/dist/domain/existing-rig-restore.d.ts +2 -0
- package/daemon/dist/domain/existing-rig-restore.d.ts.map +1 -1
- package/daemon/dist/domain/existing-rig-restore.js +1 -0
- package/daemon/dist/domain/existing-rig-restore.js.map +1 -1
- package/daemon/dist/domain/expected-conversation.d.ts.map +1 -1
- package/daemon/dist/domain/expected-conversation.js +26 -11
- package/daemon/dist/domain/expected-conversation.js.map +1 -1
- package/daemon/dist/domain/gateway/destination-resolver.d.ts +4 -0
- package/daemon/dist/domain/gateway/destination-resolver.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/destination-resolver.js +10 -3
- package/daemon/dist/domain/gateway/destination-resolver.js.map +1 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts +3 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.js +120 -6
- package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/capabilities.d.ts +9 -1
- package/daemon/dist/domain/gateway/slack/capabilities.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/capabilities.js +6 -1
- package/daemon/dist/domain/gateway/slack/capabilities.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound-admission.js +1 -1
- package/daemon/dist/domain/gateway/slack/inbound-admission.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.d.ts +4 -0
- package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.js +15 -1
- package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/manifest.d.ts +5 -1
- package/daemon/dist/domain/gateway/slack/manifest.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/manifest.js +12 -3
- package/daemon/dist/domain/gateway/slack/manifest.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +1 -0
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +4 -1
- package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts +2 -0
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.js +1 -0
- package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/settled-asks.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/settled-asks.js +6 -5
- package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-api.d.ts +1 -0
- package/daemon/dist/domain/gateway/slack/slack-api.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-api.js +7 -2
- package/daemon/dist/domain/gateway/slack/slack-api.js.map +1 -1
- package/daemon/dist/domain/harness-not-started-notice.d.ts +36 -0
- package/daemon/dist/domain/harness-not-started-notice.d.ts.map +1 -0
- package/daemon/dist/domain/harness-not-started-notice.js +81 -0
- package/daemon/dist/domain/harness-not-started-notice.js.map +1 -0
- package/daemon/dist/domain/health-diagnosis.d.ts.map +1 -1
- package/daemon/dist/domain/health-diagnosis.js +4 -0
- package/daemon/dist/domain/health-diagnosis.js.map +1 -1
- package/daemon/dist/domain/hot-potato-enforcer.d.ts +1 -1
- package/daemon/dist/domain/input-read-diagnostic.js +1 -1
- package/daemon/dist/domain/input-read-diagnostic.js.map +1 -1
- package/daemon/dist/domain/instance-initialization.d.ts +2 -0
- package/daemon/dist/domain/instance-initialization.d.ts.map +1 -1
- package/daemon/dist/domain/instance-initialization.js +2 -1
- package/daemon/dist/domain/instance-initialization.js.map +1 -1
- package/daemon/dist/domain/member-connection.d.ts +14 -0
- package/daemon/dist/domain/member-connection.d.ts.map +1 -0
- package/daemon/dist/domain/member-connection.js +34 -0
- package/daemon/dist/domain/member-connection.js.map +1 -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 +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
- package/daemon/dist/domain/model-divergence/current-model-reader.d.ts +3 -1
- package/daemon/dist/domain/model-divergence/current-model-reader.d.ts.map +1 -1
- package/daemon/dist/domain/model-divergence/current-model-reader.js +32 -7
- package/daemon/dist/domain/model-divergence/current-model-reader.js.map +1 -1
- package/daemon/dist/domain/native-model-picker.d.ts +2 -0
- package/daemon/dist/domain/native-model-picker.d.ts.map +1 -1
- package/daemon/dist/domain/native-model-picker.js +8 -2
- package/daemon/dist/domain/native-model-picker.js.map +1 -1
- package/daemon/dist/domain/native-permission-store.d.ts +6 -2
- package/daemon/dist/domain/native-permission-store.d.ts.map +1 -1
- package/daemon/dist/domain/native-permission-store.js +12 -5
- package/daemon/dist/domain/native-permission-store.js.map +1 -1
- package/daemon/dist/domain/native-resume-probe.d.ts +5 -0
- package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
- package/daemon/dist/domain/native-resume-probe.js +172 -21
- package/daemon/dist/domain/native-resume-probe.js.map +1 -1
- package/daemon/dist/domain/network/network-connector.d.ts.map +1 -1
- package/daemon/dist/domain/network/network-connector.js +16 -5
- package/daemon/dist/domain/network/network-connector.js.map +1 -1
- package/daemon/dist/domain/network/network-installations.d.ts +5 -4
- package/daemon/dist/domain/network/network-installations.d.ts.map +1 -1
- package/daemon/dist/domain/network/network-installations.js +42 -11
- package/daemon/dist/domain/network/network-installations.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +28 -0
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/node-launcher.d.ts +11 -0
- package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/node-launcher.js +23 -7
- package/daemon/dist/domain/node-launcher.js.map +1 -1
- package/daemon/dist/domain/occupant-invalidator.d.ts +4 -1
- package/daemon/dist/domain/occupant-invalidator.d.ts.map +1 -1
- package/daemon/dist/domain/occupant-invalidator.js +10 -2
- package/daemon/dist/domain/occupant-invalidator.js.map +1 -1
- package/daemon/dist/domain/operation-correlation.d.ts +1 -1
- package/daemon/dist/domain/operation-correlation.d.ts.map +1 -1
- package/daemon/dist/domain/operation-correlation.js +1 -1
- package/daemon/dist/domain/operation-correlation.js.map +1 -1
- package/daemon/dist/domain/outbox-handler.d.ts +50 -0
- package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
- package/daemon/dist/domain/outbox-handler.js +255 -1
- package/daemon/dist/domain/outbox-handler.js.map +1 -1
- package/daemon/dist/domain/parked-query.d.ts.map +1 -1
- package/daemon/dist/domain/parked-query.js +3 -1
- package/daemon/dist/domain/parked-query.js.map +1 -1
- package/daemon/dist/domain/permission-account.d.ts +28 -1
- package/daemon/dist/domain/permission-account.d.ts.map +1 -1
- package/daemon/dist/domain/permission-account.js +55 -11
- package/daemon/dist/domain/permission-account.js.map +1 -1
- package/daemon/dist/domain/permission-drift.d.ts +2 -0
- package/daemon/dist/domain/permission-drift.d.ts.map +1 -1
- package/daemon/dist/domain/permission-drift.js.map +1 -1
- package/daemon/dist/domain/pi-compaction-request-store.d.ts +16 -0
- package/daemon/dist/domain/pi-compaction-request-store.d.ts.map +1 -0
- package/daemon/dist/domain/pi-compaction-request-store.js +40 -0
- package/daemon/dist/domain/pi-compaction-request-store.js.map +1 -0
- package/daemon/dist/domain/pi-compaction-service.d.ts +82 -0
- package/daemon/dist/domain/pi-compaction-service.d.ts.map +1 -0
- package/daemon/dist/domain/pi-compaction-service.js +229 -0
- package/daemon/dist/domain/pi-compaction-service.js.map +1 -0
- package/daemon/dist/domain/process-limits.d.ts +37 -0
- package/daemon/dist/domain/process-limits.d.ts.map +1 -0
- package/daemon/dist/domain/process-limits.js +69 -0
- package/daemon/dist/domain/process-limits.js.map +1 -0
- package/daemon/dist/domain/process-table.d.ts +9 -0
- package/daemon/dist/domain/process-table.d.ts.map +1 -1
- package/daemon/dist/domain/process-table.js +21 -4
- package/daemon/dist/domain/process-table.js.map +1 -1
- package/daemon/dist/domain/proof/judgments.d.ts +7 -0
- package/daemon/dist/domain/proof/judgments.d.ts.map +1 -1
- package/daemon/dist/domain/proof/judgments.js +27 -1
- package/daemon/dist/domain/proof/judgments.js.map +1 -1
- package/daemon/dist/domain/ps-projection.d.ts +2 -1
- package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
- package/daemon/dist/domain/ps-projection.js +6 -1
- package/daemon/dist/domain/ps-projection.js.map +1 -1
- package/daemon/dist/domain/queue-erasure.d.ts +18 -7
- package/daemon/dist/domain/queue-erasure.d.ts.map +1 -1
- package/daemon/dist/domain/queue-erasure.js +270 -41
- package/daemon/dist/domain/queue-erasure.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +81 -16
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +325 -76
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts +3 -0
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +90 -30
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/queue-transition-log.d.ts +5 -3
- package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
- package/daemon/dist/domain/queue-transition-log.js +9 -6
- package/daemon/dist/domain/queue-transition-log.js.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.d.ts +8 -0
- package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +245 -41
- package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.d.ts +2 -1
- package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.js +31 -4
- package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
- package/daemon/dist/domain/restore-check-service.d.ts +23 -0
- package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
- package/daemon/dist/domain/restore-check-service.js +198 -12
- package/daemon/dist/domain/restore-check-service.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +64 -3
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +335 -82
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.d.ts +28 -1
- package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.js +17 -5
- package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
- package/daemon/dist/domain/restore-preconditions.d.ts +26 -0
- package/daemon/dist/domain/restore-preconditions.d.ts.map +1 -1
- package/daemon/dist/domain/restore-preconditions.js +63 -1
- package/daemon/dist/domain/restore-preconditions.js.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.js +4 -1
- package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
- package/daemon/dist/domain/resume-token-validation.d.ts +3 -1
- package/daemon/dist/domain/resume-token-validation.d.ts.map +1 -1
- package/daemon/dist/domain/resume-token-validation.js +6 -3
- package/daemon/dist/domain/resume-token-validation.js.map +1 -1
- package/daemon/dist/domain/return-route.d.ts +73 -0
- package/daemon/dist/domain/return-route.d.ts.map +1 -0
- package/daemon/dist/domain/return-route.js +124 -0
- package/daemon/dist/domain/return-route.js.map +1 -0
- package/daemon/dist/domain/rig-delivery-drain.d.ts +46 -0
- package/daemon/dist/domain/rig-delivery-drain.d.ts.map +1 -0
- package/daemon/dist/domain/rig-delivery-drain.js +128 -0
- package/daemon/dist/domain/rig-delivery-drain.js.map +1 -0
- package/daemon/dist/domain/rig-expansion-service.js +1 -1
- package/daemon/dist/domain/rig-expansion-service.js.map +1 -1
- package/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/rig-lifecycle-service.js +4 -1
- package/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/rig-repository.d.ts +12 -0
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +73 -0
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rig-teardown.d.ts +22 -3
- package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
- package/daemon/dist/domain/rig-teardown.js +99 -20
- 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 +9 -0
- package/daemon/dist/domain/rigspec-codec.js.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.d.ts +6 -0
- package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.js +30 -0
- package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts +22 -2
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +82 -23
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.d.ts +1 -1
- package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.js +16 -1
- package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
- package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-schema.js +44 -1
- package/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/daemon/dist/domain/rosters.d.ts +12 -0
- package/daemon/dist/domain/rosters.d.ts.map +1 -1
- package/daemon/dist/domain/rosters.js +17 -4
- package/daemon/dist/domain/rosters.js.map +1 -1
- package/daemon/dist/domain/runner-channel.d.ts +33 -0
- package/daemon/dist/domain/runner-channel.d.ts.map +1 -0
- package/daemon/dist/domain/runner-channel.js +179 -0
- package/daemon/dist/domain/runner-channel.js.map +1 -0
- package/daemon/dist/domain/runner-grant-launch.js +2 -2
- package/daemon/dist/domain/runtime-adapter.d.ts +2 -0
- package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-adapter.js.map +1 -1
- package/daemon/dist/domain/runtime-switch-materials.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-switch-materials.js +4 -3
- package/daemon/dist/domain/runtime-switch-materials.js.map +1 -1
- package/daemon/dist/domain/scope/scope-audit.d.ts.map +1 -1
- package/daemon/dist/domain/scope/scope-audit.js +55 -3
- package/daemon/dist/domain/scope/scope-audit.js.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.d.ts +6 -4
- package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.js +17 -10
- package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.js +2 -1
- package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts +27 -4
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +209 -64
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.d.ts +8 -1
- package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.js +52 -12
- package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.d.ts +3 -2
- package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.js +16 -4
- package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +21 -4
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +68 -2
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.d.ts +9 -2
- package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.js +34 -2
- package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts +4 -0
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.js +9 -3
- package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
- package/daemon/dist/domain/seat-status-service.d.ts +4 -0
- package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-status-service.js +31 -6
- package/daemon/dist/domain/seat-status-service.js.map +1 -1
- package/daemon/dist/domain/session-name.d.ts +13 -0
- package/daemon/dist/domain/session-name.d.ts.map +1 -1
- package/daemon/dist/domain/session-name.js +77 -0
- package/daemon/dist/domain/session-name.js.map +1 -1
- package/daemon/dist/domain/session-registry.d.ts +7 -1
- package/daemon/dist/domain/session-registry.d.ts.map +1 -1
- package/daemon/dist/domain/session-registry.js +7 -4
- package/daemon/dist/domain/session-registry.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +16 -3
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +161 -16
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/shared-conversation.d.ts +58 -0
- package/daemon/dist/domain/shared-conversation.d.ts.map +1 -0
- package/daemon/dist/domain/shared-conversation.js +98 -0
- package/daemon/dist/domain/shared-conversation.js.map +1 -0
- package/daemon/dist/domain/shared-history-selection.d.ts +1 -0
- package/daemon/dist/domain/shared-history-selection.d.ts.map +1 -1
- package/daemon/dist/domain/shared-history-selection.js +3 -1
- package/daemon/dist/domain/shared-history-selection.js.map +1 -1
- package/daemon/dist/domain/snapshot-capture.d.ts +4 -1
- package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
- package/daemon/dist/domain/snapshot-capture.js +19 -12
- package/daemon/dist/domain/snapshot-capture.js.map +1 -1
- package/daemon/dist/domain/startup-phase-timing.d.ts +19 -0
- package/daemon/dist/domain/startup-phase-timing.d.ts.map +1 -0
- package/daemon/dist/domain/startup-phase-timing.js +23 -0
- package/daemon/dist/domain/startup-phase-timing.js.map +1 -0
- package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
- package/daemon/dist/domain/startup-submission-evidence.js +3 -2
- package/daemon/dist/domain/startup-submission-evidence.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts +9 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +24 -7
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/team-operations.d.ts +6 -6
- package/daemon/dist/domain/team-operations.d.ts.map +1 -1
- package/daemon/dist/domain/team-operations.js +2 -4
- package/daemon/dist/domain/team-operations.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-app-provider.d.ts +6 -0
- package/daemon/dist/domain/terminal/herdr-app-provider.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-app-provider.js +23 -1
- package/daemon/dist/domain/terminal/herdr-app-provider.js.map +1 -1
- package/daemon/dist/domain/terminal-policy.js +1 -1
- package/daemon/dist/domain/terminal-policy.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +91 -6
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.js +6 -0
- package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.d.ts +1 -1
- package/daemon/dist/domain/watchdog-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.js +6 -3
- package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.js +1 -0
- package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts +9 -0
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +42 -5
- package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
- package/daemon/dist/domain/workflow-instance-store.d.ts +3 -2
- package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-instance-store.js +6 -4
- package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
- package/daemon/dist/domain/workflow-projector.d.ts +48 -0
- package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +160 -90
- package/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-reconciliation.d.ts +7 -1
- package/daemon/dist/domain/workflow-reconciliation.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-reconciliation.js +51 -13
- package/daemon/dist/domain/workflow-reconciliation.js.map +1 -1
- package/daemon/dist/domain/workflow-runtime.d.ts +5 -3
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +48 -22
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts +7 -1
- package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
- package/daemon/dist/domain/workspace/default-workspace-scaffold.js +35 -7
- package/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
- package/daemon/dist/gateway-slack-surface.d.ts +2 -2
- package/daemon/dist/gateway-slack-surface.d.ts.map +1 -1
- package/daemon/dist/gateway-slack-surface.js +1 -1
- package/daemon/dist/gateway-slack-surface.js.map +1 -1
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +13 -2
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/routes/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +105 -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 +6 -1
- 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 +2 -1
- package/daemon/dist/routes/attention.js.map +1 -1
- package/daemon/dist/routes/compaction.d.ts.map +1 -1
- package/daemon/dist/routes/compaction.js +46 -7
- package/daemon/dist/routes/compaction.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts +4 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +266 -38
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/require-sender-identity.d.ts +4 -3
- package/daemon/dist/routes/require-sender-identity.d.ts.map +1 -1
- package/daemon/dist/routes/require-sender-identity.js.map +1 -1
- package/daemon/dist/routes/restore-check.d.ts.map +1 -1
- package/daemon/dist/routes/restore-check.js +18 -0
- package/daemon/dist/routes/restore-check.js.map +1 -1
- package/daemon/dist/routes/rig-delivery-drain.d.ts +3 -0
- package/daemon/dist/routes/rig-delivery-drain.d.ts.map +1 -0
- package/daemon/dist/routes/rig-delivery-drain.js +46 -0
- package/daemon/dist/routes/rig-delivery-drain.js.map +1 -0
- package/daemon/dist/routes/rigspec.d.ts.map +1 -1
- package/daemon/dist/routes/rigspec.js +24 -4
- package/daemon/dist/routes/rigspec.js.map +1 -1
- package/daemon/dist/routes/seat.d.ts.map +1 -1
- package/daemon/dist/routes/seat.js +107 -6
- package/daemon/dist/routes/seat.js.map +1 -1
- package/daemon/dist/routes/sessions.js +14 -3
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/startup.d.ts.map +1 -1
- package/daemon/dist/routes/startup.js +127 -29
- package/daemon/dist/routes/startup.js.map +1 -1
- package/daemon/dist/routes/up.d.ts.map +1 -1
- package/daemon/dist/routes/up.js +16 -4
- package/daemon/dist/routes/up.js.map +1 -1
- package/daemon/dist/routes/watchdog.d.ts.map +1 -1
- package/daemon/dist/routes/watchdog.js +18 -1
- package/daemon/dist/routes/watchdog.js.map +1 -1
- package/daemon/dist/routes/workflow.js +1 -1
- package/daemon/dist/routes/workflow.js.map +1 -1
- package/daemon/dist/server.d.ts +3 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +13 -0
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +57 -16
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/agent-startup-guide.md +5 -3
- package/daemon/docs/reference/community-harness-examples/dsh/README.md +8 -0
- package/daemon/docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs +139 -5
- package/daemon/docs/reference/community-harness-presets.md +2 -0
- package/daemon/docs/reference/daemon-http-clients.md +123 -6
- package/daemon/docs/reference/getting-started.md +8 -8
- package/daemon/docs/reference/harness-runner-contract.md +91 -1
- package/daemon/docs/reference/herdr-app.md +6 -0
- package/daemon/docs/reference/hosted-members.md +4 -2
- package/daemon/docs/reference/network-connector.md +4 -3
- package/daemon/docs/reference/queue-erasure.md +16 -1
- package/daemon/docs/reference/quickstart.md +2 -2
- package/daemon/docs/reference/rig-spec.md +166 -0
- package/daemon/docs/reference/rosters.md +9 -0
- package/daemon/docs/reference/sdlc-conventions.md +5 -1
- package/daemon/docs/reference/slack-app-setup.md +39 -21
- package/daemon/docs/reference/whats-new.md +294 -6
- package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +23 -0
- package/daemon/specs/agents/shared/skills/core/openrig-software-factory/references/worked-example.md +1 -1
- package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +2 -0
- package/daemon/specs/agents/shared/skills/core/working-with-an-openrig-team/SKILL.md +22 -6
- package/daemon/specs/rigs/launch/factory/guidance/lead-first-move.md +26 -5
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +92 -18
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/startup/context.md +9 -6
- package/daemon/specs/rigs/launch/kernel/culture/CULTURE.md +12 -0
- package/daemon/specs/rigs/launch/starter/guidance/lead-first-move.md +26 -5
- package/dist/acp/connector.js +1 -1
- package/dist/acp/connector.js.map +1 -1
- package/dist/build-info.js +3 -3
- package/dist/cli-error.d.ts.map +1 -1
- package/dist/cli-error.js +7 -1
- package/dist/cli-error.js.map +1 -1
- package/dist/client.d.ts +2 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -2
- package/dist/client.js.map +1 -1
- package/dist/commands/ask.d.ts.map +1 -1
- package/dist/commands/ask.js +92 -11
- package/dist/commands/ask.js.map +1 -1
- package/dist/commands/broadcast.js +9 -5
- package/dist/commands/broadcast.js.map +1 -1
- package/dist/commands/compact.d.ts +3 -4
- package/dist/commands/compact.d.ts.map +1 -1
- package/dist/commands/compact.js +76 -16
- package/dist/commands/compact.js.map +1 -1
- package/dist/commands/config-init-workspace.d.ts.map +1 -1
- package/dist/commands/config-init-workspace.js +3 -0
- package/dist/commands/config-init-workspace.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +2 -0
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +7 -1
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/environment.js +1 -1
- package/dist/commands/environment.js.map +1 -1
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +2 -1
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/fork.d.ts.map +1 -1
- package/dist/commands/fork.js +2 -0
- package/dist/commands/fork.js.map +1 -1
- package/dist/commands/launch.d.ts.map +1 -1
- package/dist/commands/launch.js +11 -3
- package/dist/commands/launch.js.map +1 -1
- package/dist/commands/network.d.ts +2 -0
- package/dist/commands/network.d.ts.map +1 -1
- package/dist/commands/network.js +14 -1
- package/dist/commands/network.js.map +1 -1
- package/dist/commands/ps.d.ts +28 -0
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +76 -2
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.d.ts +1 -1
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +350 -29
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/restore.d.ts.map +1 -1
- package/dist/commands/restore.js +6 -1
- package/dist/commands/restore.js.map +1 -1
- package/dist/commands/rig.d.ts +2 -0
- package/dist/commands/rig.d.ts.map +1 -1
- package/dist/commands/rig.js +36 -2
- package/dist/commands/rig.js.map +1 -1
- package/dist/commands/roster.d.ts +3 -0
- package/dist/commands/roster.d.ts.map +1 -1
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +128 -9
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +47 -6
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +5 -3
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/slack.d.ts +2 -1
- package/dist/commands/slack.d.ts.map +1 -1
- package/dist/commands/slack.js +38 -2
- package/dist/commands/slack.js.map +1 -1
- package/dist/commands/terminal.d.ts.map +1 -1
- package/dist/commands/terminal.js +5 -5
- package/dist/commands/terminal.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +10 -0
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +10 -4
- package/dist/commands/workflow.js.map +1 -1
- package/dist/config-store.d.ts +3 -1
- package/dist/config-store.d.ts.map +1 -1
- package/dist/config-store.js +5 -0
- package/dist/config-store.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +1 -0
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/lib/bundle-check.d.ts.map +1 -1
- package/dist/lib/bundle-check.js +33 -3
- package/dist/lib/bundle-check.js.map +1 -1
- package/dist/lib/model-observation.d.ts.map +1 -1
- package/dist/lib/model-observation.js +9 -3
- package/dist/lib/model-observation.js.map +1 -1
- package/dist/lib/scope/scope-audit.d.ts.map +1 -1
- package/dist/lib/scope/scope-audit.js +55 -3
- package/dist/lib/scope/scope-audit.js.map +1 -1
- package/dist/local-db.d.ts +5 -0
- package/dist/local-db.d.ts.map +1 -0
- package/dist/local-db.js +23 -0
- package/dist/local-db.js.map +1 -0
- package/dist/local-origin.d.ts.map +1 -1
- package/dist/local-origin.js +2 -17
- package/dist/local-origin.js.map +1 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +170 -27
- package/dist/mcp-server.js.map +1 -1
- package/dist/person-registration-offer.d.ts.map +1 -1
- package/dist/person-registration-offer.js +2 -1
- package/dist/person-registration-offer.js.map +1 -1
- package/dist/sender-identity.d.ts +18 -6
- package/dist/sender-identity.d.ts.map +1 -1
- package/dist/sender-identity.js +67 -7
- package/dist/sender-identity.js.map +1 -1
- package/dist/terminal-window-rex.d.ts +1 -1
- package/dist/terminal-window-rex.d.ts.map +1 -1
- package/dist/terminal-window-rex.js +3 -2
- package/dist/terminal-window-rex.js.map +1 -1
- package/dist/terminal-window.js +3 -3
- package/dist/terminal-window.js.map +1 -1
- package/package.json +2 -2
- package/tui/dist/config/config-model.js +1 -1
- package/tui/dist/config/config-model.js.map +1 -1
- package/tui/dist/daemon-client.d.ts +3 -1
- package/tui/dist/daemon-client.d.ts.map +1 -1
- package/tui/dist/daemon-client.js +6 -3
- package/tui/dist/daemon-client.js.map +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +31 -1
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +106 -15
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/types.d.ts +2 -0
- package/tui/dist/types.d.ts.map +1 -1
- package/ui/dist/assets/{index-BvUEh33d.js → index-1O1f3A7K.js} +55 -55
- package/ui/dist/index.html +1 -1
|
@@ -7,6 +7,8 @@ import { quietHoldCustody } from "./quiet-hold-custody.js";
|
|
|
7
7
|
import { latestHookMovedOn, latestHookPermissionPending, latestHookWaitsOnPerson } from "./agent-activity-store.js";
|
|
8
8
|
import { openPromptRefusals, CLOSE_PREFIX, PARKED_OWNER_POLICY_NAME, REFUSED_PREFIX } from "./policies/parked-owner-consumer.js";
|
|
9
9
|
import { findQueueRecovery, recoveryTag } from "./queue-recovery.js";
|
|
10
|
+
import { PROMPT_ROUTED_WORK_PREFIX, RELAY_CLAIMED_PREFIX, RELAY_FOR_PREFIX, RELAY_KEY_PREFIX, RETURN_ROUTE_NOTE_PREFIX, isEpisodeRelay, promptKindFromReason, resolveEscalationReturnRoute, routeOnThisHost } from "./return-route.js";
|
|
11
|
+
import { isTypedGateBlocker } from "./queue-blocker.js";
|
|
10
12
|
import { lastMeaningfulTransition } from "./queue-waiting.js";
|
|
11
13
|
import { readWakeOutcome } from "./connection-contract.js";
|
|
12
14
|
import { runSyncSite } from "./sync-site-wrap.js";
|
|
@@ -169,7 +171,9 @@ function readLadder(db, qitemId, after = lastMeaningfulTransition(db, qitemId)?.
|
|
|
169
171
|
// (injected legacy ports) keeps the any-following-note shape.
|
|
170
172
|
if (note.startsWith("slack-owner-notification-posted ") ||
|
|
171
173
|
note.startsWith(`${RELAY_OWNER_NOTIFICATION_ACCEPTED_PREFIX} `) ||
|
|
172
|
-
note.startsWith("delivery-termination:")
|
|
174
|
+
note.startsWith("delivery-termination:") ||
|
|
175
|
+
// A relay task's pickup at the goal's return route (return-route.ts).
|
|
176
|
+
note.startsWith(`${RELAY_CLAIMED_PREFIX} `)) {
|
|
173
177
|
if (view.opEngineKey === null || note.split(/\s+/).includes(`notification_key=${view.opEngineKey}`)) {
|
|
174
178
|
view.opOutcomeResolved = true;
|
|
175
179
|
}
|
|
@@ -226,7 +230,9 @@ function hasPickupEvidence(db, row) {
|
|
|
226
230
|
note.startsWith("delivery-deferral-") ||
|
|
227
231
|
// Quiet hours: holding an ask and releasing it are delivery machinery too, never someone picking it up.
|
|
228
232
|
note.startsWith("delivery-decision: quiet-hold ") ||
|
|
229
|
-
note.startsWith("quiet-release-")
|
|
233
|
+
note.startsWith("quiet-release-") ||
|
|
234
|
+
// The return route's records: a relay's pickup, a conflict or another host's route (return-route.ts).
|
|
235
|
+
note.startsWith(RETURN_ROUTE_NOTE_PREFIX))
|
|
230
236
|
continue;
|
|
231
237
|
return true;
|
|
232
238
|
}
|
|
@@ -429,7 +435,13 @@ export function readWakeLadderBackstop(db, qitemId, acceptsDestination) {
|
|
|
429
435
|
: { note: "Earliest eligibility; the next scheduler pass rechecks provider state, custody and the shared destination budget." }),
|
|
430
436
|
};
|
|
431
437
|
}
|
|
432
|
-
function
|
|
438
|
+
function deliveryHeld(repo, row) {
|
|
439
|
+
return repo.deliveryDrains.holds(row.destinationSession);
|
|
440
|
+
}
|
|
441
|
+
function appendMarker(repo, row, note, admittedOutcome = false) {
|
|
442
|
+
// A new drain defers admission, not the durable outcome of an attempt already admitted.
|
|
443
|
+
if (!admittedOutcome && deliveryHeld(repo, row))
|
|
444
|
+
return;
|
|
433
445
|
repo.transitionLog.append({
|
|
434
446
|
qitemId: row.qitemId,
|
|
435
447
|
state: row.state,
|
|
@@ -521,7 +533,7 @@ export async function runWakeLadderTick(deps) {
|
|
|
521
533
|
const resolveOrch = deps.resolveOrchestrator ?? ((session) => {
|
|
522
534
|
return resolveEscalationOwner(deps.db, session, target => deps.queueRepo.acceptsDestination(target)).owner;
|
|
523
535
|
});
|
|
524
|
-
const
|
|
536
|
+
const sendWake = deps.attemptWake ??
|
|
525
537
|
(async (qitemId, target) => {
|
|
526
538
|
// A ladder retry is OpenRig's own scheduling on the row, whoever created it.
|
|
527
539
|
// It is sent as OpenRig (daemon@kernel); the row's original source stays visible in the body.
|
|
@@ -530,6 +542,12 @@ export async function runWakeLadderTick(deps) {
|
|
|
530
542
|
await deps.queueRepo.maybeNudge(qitemId, target, true, OPENRIG_SENDER, bodyOverride, "openrig");
|
|
531
543
|
return deps.queueRepo.getById(qitemId)?.lastNudgeWireResult ?? "indeterminate:no transport available";
|
|
532
544
|
});
|
|
545
|
+
const attemptWake = async (id, target) => {
|
|
546
|
+
const row = deps.queueRepo.getById(id);
|
|
547
|
+
if ((row && deliveryHeld(deps.queueRepo, row)) || deps.queueRepo.deliveryDrains.holds(target))
|
|
548
|
+
return "deferred:rig_delivery_drain";
|
|
549
|
+
return sendWake(id, target);
|
|
550
|
+
};
|
|
533
551
|
const actions = [];
|
|
534
552
|
try {
|
|
535
553
|
await advancePromptRefusals(deps, now, intervalS, graceS, resolveOrch, attemptWake, actions);
|
|
@@ -601,7 +619,7 @@ export async function runWakeLadderTick(deps) {
|
|
|
601
619
|
};
|
|
602
620
|
for (const { qitem_id } of [...batonRows, ...parkedOwnerFailureRows]) {
|
|
603
621
|
const row = deps.queueRepo.getById(qitem_id);
|
|
604
|
-
if (!row || recoversEscalationNotice(deps, row))
|
|
622
|
+
if (!row || deliveryHeld(deps.queueRepo, row) || recoversEscalationNotice(deps, row))
|
|
605
623
|
continue;
|
|
606
624
|
const usagePool = usagePoolBySeat.get(row.destinationSession);
|
|
607
625
|
// OPR.0.5.6.24: the usage-limit PARK mutation applies only to pending
|
|
@@ -613,6 +631,8 @@ export async function runWakeLadderTick(deps) {
|
|
|
613
631
|
blocker = await ensureUsageLimitBlocker(deps, usagePool, now, deps.usageLimitJitterSeconds ?? drawUsageLimitJitterSeconds());
|
|
614
632
|
blockerByPool.set(usagePool.poolKey, blocker);
|
|
615
633
|
}
|
|
634
|
+
if (deliveryHeld(deps.queueRepo, row))
|
|
635
|
+
continue;
|
|
616
636
|
deps.queueRepo.update({
|
|
617
637
|
qitemId: row.qitemId,
|
|
618
638
|
actorSession: LADDER_ACTOR,
|
|
@@ -682,9 +702,11 @@ export async function runWakeLadderTick(deps) {
|
|
|
682
702
|
}
|
|
683
703
|
if (budgetFor(row.destinationSession) >= cap)
|
|
684
704
|
continue; // destination-bounded (F3)
|
|
685
|
-
windowBudget.set(row.destinationSession, budgetFor(row.destinationSession) + 1);
|
|
686
705
|
const outcome = await attemptWake(row.qitemId, row.destinationSession);
|
|
687
|
-
|
|
706
|
+
if (outcome === "deferred:rig_delivery_drain")
|
|
707
|
+
continue;
|
|
708
|
+
windowBudget.set(row.destinationSession, budgetFor(row.destinationSession) + 1);
|
|
709
|
+
appendMarker(deps.queueRepo, row, `${LADDER_ATTEMPT_PREFIX} ${view.attempts + 1}/${cap} outcome=${outcome}`, true);
|
|
688
710
|
actions.push({ qitemId: row.qitemId, action: "retry", target: row.destinationSession });
|
|
689
711
|
continue;
|
|
690
712
|
}
|
|
@@ -706,10 +728,18 @@ export async function runWakeLadderTick(deps) {
|
|
|
706
728
|
continue;
|
|
707
729
|
const consumedReason = `${reason}; escalates_to one-hop delivery already used; existing fallback retained`;
|
|
708
730
|
// Keep this recovery visible without sharing the ordinary destination aggregate or forwarding another hop.
|
|
709
|
-
await ensureEscalationRow(deps, row.destinationSession, humanAlertCarrier(deps, row.destinationSession, row.sourceSession), [{ row, reason: consumedReason }], consumedReason, `consumed-hop:${row.qitemId}`, [ESCALATION_HOP_TAG]);
|
|
731
|
+
const escalation = await ensureEscalationRow(deps, row.destinationSession, humanAlertCarrier(deps, row.destinationSession, row.sourceSession), [{ row, reason: consumedReason }], consumedReason, `consumed-hop:${row.qitemId}`, [ESCALATION_HOP_TAG]);
|
|
732
|
+
if (!escalation)
|
|
733
|
+
continue;
|
|
734
|
+
const carrierDeferred = () => {
|
|
735
|
+
const carrier = deps.queueRepo.getById(escalation.qitemId);
|
|
736
|
+
return !!carrier && deliveryHeld(deps.queueRepo, carrier);
|
|
737
|
+
};
|
|
738
|
+
if (deliveryHeld(deps.queueRepo, row) || carrierDeferred())
|
|
739
|
+
continue;
|
|
710
740
|
if (!view.orchRung)
|
|
711
741
|
appendMarker(deps.queueRepo, row, `${LADDER_RUNG_PREFIX} orchestrator self-skip reason=${consumedReason}`);
|
|
712
|
-
if (await operatorRung(deps, row, consumedReason, actions, view)) {
|
|
742
|
+
if (await operatorRung(deps, row, consumedReason, actions, view, true, carrierDeferred)) {
|
|
713
743
|
appendExhausted(deps.queueRepo, row, "consumed escalation hop reached operator fallback");
|
|
714
744
|
exhaustedThisTick += 1;
|
|
715
745
|
}
|
|
@@ -723,6 +753,8 @@ export async function runWakeLadderTick(deps) {
|
|
|
723
753
|
// F3 — per-destination aggregation: ONE escalation carrying the row list, refreshed
|
|
724
754
|
// not duplicated (the S02 idempotency shape), and rung markers on every member baton.
|
|
725
755
|
for (const [dest, members] of escalating) {
|
|
756
|
+
if (members.some(m => deliveryHeld(deps.queueRepo, m.row)))
|
|
757
|
+
continue;
|
|
726
758
|
const orch = openEscalationOwner(deps, escalationDedupTag(dest)) ?? resolveOrch(dest);
|
|
727
759
|
const route = !deps.resolveOrchestrator
|
|
728
760
|
? resolveEscalationOwner(deps.db, dest, target => deps.queueRepo.acceptsDestination(target)) : null;
|
|
@@ -733,6 +765,8 @@ export async function runWakeLadderTick(deps) {
|
|
|
733
765
|
// F3 — the aggregate refresh is detection-gated (the S02 idempotency shape): a
|
|
734
766
|
// live escalation group refreshes its one open row every pass, no wake attached.
|
|
735
767
|
await refreshEscalationRowIfExists(deps, dest, members);
|
|
768
|
+
if (members.some(m => deliveryHeld(deps.queueRepo, m.row)))
|
|
769
|
+
continue;
|
|
736
770
|
const actionable = members.filter((m) => m.due && !m.suspended);
|
|
737
771
|
const needsOrchRung = actionable.filter((m) => !m.view.orchRung);
|
|
738
772
|
const reason = needsOrchRung[0]?.reason ?? members[0].reason;
|
|
@@ -745,10 +779,18 @@ export async function runWakeLadderTick(deps) {
|
|
|
745
779
|
// escalations view and the health count
|
|
746
780
|
// expose it — it stays open past the batons' exhaustion.
|
|
747
781
|
const floorDest = humanAlertCarrier(deps, dest, needsOrchRung[0].row.sourceSession);
|
|
748
|
-
await ensureEscalationRow(deps, dest, floorDest, needsOrchRung, reason);
|
|
782
|
+
const escalation = await ensureEscalationRow(deps, dest, floorDest, needsOrchRung, reason);
|
|
783
|
+
if (!escalation)
|
|
784
|
+
continue;
|
|
785
|
+
const carrierDeferred = () => {
|
|
786
|
+
const carrier = deps.queueRepo.getById(escalation.qitemId);
|
|
787
|
+
return !!carrier && deliveryHeld(deps.queueRepo, carrier);
|
|
788
|
+
};
|
|
789
|
+
if (members.some(m => deliveryHeld(deps.queueRepo, m.row)) || carrierDeferred())
|
|
790
|
+
continue;
|
|
749
791
|
for (const m of needsOrchRung) {
|
|
750
792
|
appendMarker(deps.queueRepo, m.row, `${LADDER_RUNG_PREFIX} orchestrator self-skip (resolves to ${orch === null ? "no orchestrator" : "destination"}) reason=${m.reason}`);
|
|
751
|
-
if (await operatorRung(deps, m.row, m.reason, actions, m.view)) {
|
|
793
|
+
if (await operatorRung(deps, m.row, m.reason, actions, m.view, true, carrierDeferred)) {
|
|
752
794
|
appendExhausted(deps.queueRepo, m.row, "operator rung resolved");
|
|
753
795
|
exhaustedThisTick += 1;
|
|
754
796
|
}
|
|
@@ -757,15 +799,19 @@ export async function runWakeLadderTick(deps) {
|
|
|
757
799
|
else {
|
|
758
800
|
const escRow = await ensureEscalationRow(deps, dest, orch, members, reason);
|
|
759
801
|
// An already-open recovery retains its owner, including a claim made before topology changed.
|
|
802
|
+
if (!escRow || members.some(m => deliveryHeld(deps.queueRepo, m.row)))
|
|
803
|
+
continue;
|
|
760
804
|
const recoveryOwner = deps.queueRepo.getById(escRow.qitemId)?.destinationSession ?? orch;
|
|
761
805
|
const outcome = await attemptWake(escRow.qitemId, recoveryOwner);
|
|
806
|
+
if (outcome === "deferred:rig_delivery_drain")
|
|
807
|
+
continue;
|
|
762
808
|
for (const m of needsOrchRung) {
|
|
763
|
-
appendMarker(deps.queueRepo, m.row, `${LADDER_RUNG_PREFIX} orchestrator -> ${recoveryOwner} outcome=${outcome} reason=${m.reason}
|
|
809
|
+
appendMarker(deps.queueRepo, m.row, `${LADDER_RUNG_PREFIX} orchestrator -> ${recoveryOwner} outcome=${outcome} reason=${m.reason}`, true);
|
|
764
810
|
actions.push({ qitemId: m.row.qitemId, action: "escalate-orchestrator", target: recoveryOwner });
|
|
765
811
|
if (!outcome.startsWith("failed:")) {
|
|
766
812
|
// Delivered (or durable-unconfirmed — the aggregate row itself is now the
|
|
767
813
|
// orchestrator's durable obligation; S02 nets it if it sits unclaimed).
|
|
768
|
-
appendExhausted(deps.queueRepo, m.row, `escalated to orchestrator (${outcome === "verified" ? "delivered" : outcome})
|
|
814
|
+
appendExhausted(deps.queueRepo, m.row, `escalated to orchestrator (${outcome === "verified" ? "delivered" : outcome})`, true);
|
|
769
815
|
exhaustedThisTick += 1;
|
|
770
816
|
}
|
|
771
817
|
}
|
|
@@ -774,8 +820,12 @@ export async function runWakeLadderTick(deps) {
|
|
|
774
820
|
}
|
|
775
821
|
// Orchestrator rung recorded and failed → advance to the operator rung.
|
|
776
822
|
for (const m of actionable) {
|
|
777
|
-
|
|
778
|
-
|
|
823
|
+
// A self-skip whose readiness was deferred still owes its first operator rung.
|
|
824
|
+
if (m.view.orchRung && (m.view.orchRungFailed || !m.view.opRung || m.view.opUnresolved !== null) && !m.view.opEngineDispatched) {
|
|
825
|
+
if (await operatorRung(deps, m.row, m.reason, actions, m.view, true, () => {
|
|
826
|
+
const carrier = openEscalationOwner(deps, escalationDedupTag(dest));
|
|
827
|
+
return !!carrier && deps.queueRepo.deliveryDrains.holds(carrier);
|
|
828
|
+
})) {
|
|
779
829
|
appendExhausted(deps.queueRepo, m.row, "operator rung resolved");
|
|
780
830
|
exhaustedThisTick += 1;
|
|
781
831
|
}
|
|
@@ -820,6 +870,14 @@ export function classifyPromptAfterRefusal(state, refusedAt) {
|
|
|
820
870
|
return "unknown";
|
|
821
871
|
return Date.parse(evidence.observedAt) > Date.parse(refusedAt) ? "clear" : "unknown";
|
|
822
872
|
}
|
|
873
|
+
/** The production prompt-kind read: the seat's cached needs-input reason (selection or permission), and "unknown" otherwise. */
|
|
874
|
+
export function makePromptKindReader(deps) {
|
|
875
|
+
return destination => {
|
|
876
|
+
const nodeId = resolveSessionNodeId(deps.db, destination);
|
|
877
|
+
const state = nodeId ? deps.getSeatState?.(nodeId) : null;
|
|
878
|
+
return state && state.needsInput.count > 0 ? promptKindFromReason(state.needsInput.reason) : "unknown";
|
|
879
|
+
};
|
|
880
|
+
}
|
|
823
881
|
/** The production prompt read for a refused destination. The activity oracle answers first; when it has no
|
|
824
882
|
* evidence, the ladder reads the same retained runtime hook the send gate refused on, so a held wake still
|
|
825
883
|
* escalates after the activity service is rebuilt, or when the oracle does not yet trust the hook source
|
|
@@ -1038,7 +1096,7 @@ async function advancePromptRefusals(deps, now, intervalS, graceS, resolveOrch,
|
|
|
1038
1096
|
};
|
|
1039
1097
|
for (const { qitem_id, destination_session } of candidates) {
|
|
1040
1098
|
const primary = readCandidate(qitem_id, destination_session);
|
|
1041
|
-
if (!primary || recoversEscalationNotice(deps, primary))
|
|
1099
|
+
if (!primary || deliveryHeld(deps.queueRepo, primary) || recoversEscalationNotice(deps, primary))
|
|
1042
1100
|
continue;
|
|
1043
1101
|
// The shared no-route change is prospective, never a revival of old ladders.
|
|
1044
1102
|
if (readLadder(deps.db, qitem_id).exhausted)
|
|
@@ -1096,6 +1154,8 @@ async function advancePromptRefusals(deps, now, intervalS, graceS, resolveOrch,
|
|
|
1096
1154
|
return clearedAlerts.get(dest);
|
|
1097
1155
|
};
|
|
1098
1156
|
for (const job of refusedWatchdogJobs(deps.db, clearedAlert, readAt)) {
|
|
1157
|
+
if (deps.queueRepo.deliveryDrains.holds(job.dest, job.jobId))
|
|
1158
|
+
continue;
|
|
1099
1159
|
const tag = `${PROMPT_EPISODE_TAG}${job.key}`;
|
|
1100
1160
|
if (closedEpisode(tag))
|
|
1101
1161
|
continue;
|
|
@@ -1125,7 +1185,7 @@ async function advancePromptRefusals(deps, now, intervalS, graceS, resolveOrch,
|
|
|
1125
1185
|
if (deps.readHookReviews) {
|
|
1126
1186
|
try {
|
|
1127
1187
|
for (const observation of await deps.readHookReviews()) {
|
|
1128
|
-
if (!freshHook(observation))
|
|
1188
|
+
if (!freshHook(observation) || deps.queueRepo.deliveryDrains.holds(observation.destination))
|
|
1129
1189
|
continue;
|
|
1130
1190
|
hookObservations.set(observation.destination, observation);
|
|
1131
1191
|
const key = `${PROMPT_EPISODE_TAG}${observation.destination}|hook-review:${observation.episode}|after:${clearedAlert(observation.destination)?.qitemId ?? "start"}`;
|
|
@@ -1148,6 +1208,44 @@ async function advancePromptRefusals(deps, now, intervalS, graceS, resolveOrch,
|
|
|
1148
1208
|
}
|
|
1149
1209
|
catch { /* No new evidence; existing hook episodes remain unresolved below. */ }
|
|
1150
1210
|
}
|
|
1211
|
+
// Work handed over with a return route that's stuck at a seat's prompt: held by that seat, or waiting on it (blocked on the
|
|
1212
|
+
// seat, or on a row the seat holds). The person who chose that route is the one to answer, so this raises the seat's prompt
|
|
1213
|
+
// alert even though no wake was refused. Work without a route is unchanged. Only a positive needs-input reading starts an
|
|
1214
|
+
// episode; it ends when the seat's prompt reads clear, and a prompt after that is a new one.
|
|
1215
|
+
for (const work of routedPromptWork(deps.db)) {
|
|
1216
|
+
const dest = work.subject;
|
|
1217
|
+
if (deps.queueRepo.deliveryDrains.holds(dest) || readAt(dest, now.toISOString()) !== "blocked")
|
|
1218
|
+
continue;
|
|
1219
|
+
const key = `${PROMPT_EPISODE_TAG}${dest}|routed-work:${work.qitemId}|after:${clearedAlert(dest)?.qitemId ?? "start"}`;
|
|
1220
|
+
if (closedEpisode(key))
|
|
1221
|
+
continue;
|
|
1222
|
+
const row = readCandidate(work.qitemId, dest);
|
|
1223
|
+
if (!row || !["pending", "in-progress", "blocked"].includes(row.state) || deliveryHeld(deps.queueRepo, row))
|
|
1224
|
+
continue;
|
|
1225
|
+
let group = groups.get(dest);
|
|
1226
|
+
if (!group) {
|
|
1227
|
+
group = { keys: [], rowKeys: new Map(), jobKeys: new Set(), rows: new Map(), jobs: new Map(), refusedAt: now.toISOString() };
|
|
1228
|
+
groups.set(dest, group);
|
|
1229
|
+
}
|
|
1230
|
+
if (!group.keys.includes(key))
|
|
1231
|
+
group.keys.push(key);
|
|
1232
|
+
(group.waiterKeys ??= new Set()).add(key);
|
|
1233
|
+
(group.waiters ??= new Map()).set(row.qitemId, row);
|
|
1234
|
+
// The kind the seat's activity reports. A choice prompt keeps the choice route and its setting, and a permission prompt
|
|
1235
|
+
// the permission route; a kind it doesn't report marks neither, so it's never taken for a positively identified one.
|
|
1236
|
+
let kind = "unknown";
|
|
1237
|
+
try {
|
|
1238
|
+
kind = deps.readPromptKind?.(dest) ?? "unknown";
|
|
1239
|
+
}
|
|
1240
|
+
catch { /* unknown */ }
|
|
1241
|
+
if (kind === "choice") {
|
|
1242
|
+
group.choice = true;
|
|
1243
|
+
if (group.refusedAt === now.toISOString())
|
|
1244
|
+
group.latestChoice = true;
|
|
1245
|
+
}
|
|
1246
|
+
else if (kind === "permission")
|
|
1247
|
+
group.other = true;
|
|
1248
|
+
}
|
|
1151
1249
|
// A recovery returned to the blocked seat inherits only its source row's episodes.
|
|
1152
1250
|
// Reconstruct this membership before retirement, even when the recovery has no refusal of its own.
|
|
1153
1251
|
for (const [dest, group] of groups) {
|
|
@@ -1218,6 +1316,8 @@ async function advancePromptRefusals(deps, now, intervalS, graceS, resolveOrch,
|
|
|
1218
1316
|
&& t.transitionNote === PROMPT_CLEARED_NOTE && Date.parse(t.ts) >= Date.parse(group?.refusedAt ?? aggregate.tsCreated))) {
|
|
1219
1317
|
appendMarker(deps.queueRepo, aggregate, PROMPT_CLEARED_NOTE);
|
|
1220
1318
|
}
|
|
1319
|
+
if (cleared)
|
|
1320
|
+
await supersedeRelays(deps, aggregate.qitemId, `${dest}'s prompt read clear`);
|
|
1221
1321
|
// Missing work/episode membership says nothing about the seat's prompt. Keep an explicit owner's hold
|
|
1222
1322
|
// (including its wake) even on a positive clear; only its owner can dispose of that custody.
|
|
1223
1323
|
const retained = cleared && aggregate.state === "blocked"
|
|
@@ -1236,6 +1336,8 @@ async function advancePromptRefusals(deps, now, intervalS, graceS, resolveOrch,
|
|
|
1236
1336
|
}
|
|
1237
1337
|
}
|
|
1238
1338
|
for (const [dest, group] of groups) {
|
|
1339
|
+
if (deps.queueRepo.deliveryDrains.holds(dest) || [...group.rows.values()].some(row => deliveryHeld(deps.queueRepo, row)))
|
|
1340
|
+
continue;
|
|
1239
1341
|
if (unreadableDestinations.has(dest))
|
|
1240
1342
|
continue;
|
|
1241
1343
|
const state = promptState(dest);
|
|
@@ -1289,6 +1391,8 @@ async function advancePromptRefusals(deps, now, intervalS, graceS, resolveOrch,
|
|
|
1289
1391
|
const promptTags = choiceOnly ? [PROMPT_ALERT_TAG, PROMPT_CHOICE_TAG, `consumed-prompt-destination:${dest}`,
|
|
1290
1392
|
...(group.rowKeys.get(member.row.qitemId) ?? [])] : [];
|
|
1291
1393
|
const continuation = await ensureEscalationRow(deps, dest, humanAlertCarrier(deps, dest, member.row.sourceSession), [{ row: member.row, reason }], reason, `consumed-hop:${member.row.qitemId}`, [ESCALATION_HOP_TAG, ...promptTags]);
|
|
1394
|
+
if (!continuation || deliveryHeld(deps.queueRepo, member.row))
|
|
1395
|
+
continue;
|
|
1292
1396
|
if (!view.orchRung)
|
|
1293
1397
|
appendMarker(deps.queueRepo, member.row, `${LADDER_RUNG_PREFIX} orchestrator self-skip reason=${reason}`);
|
|
1294
1398
|
// A choice alert's tags and dispatch marker must live on the same durable row the shared gate reads.
|
|
@@ -1308,7 +1412,7 @@ async function advancePromptRefusals(deps, now, intervalS, graceS, resolveOrch,
|
|
|
1308
1412
|
members.splice(i, 1);
|
|
1309
1413
|
continue;
|
|
1310
1414
|
}
|
|
1311
|
-
if (await operatorRung(deps, operatorRow, reason, actions, operatorView, choiceOnly)) {
|
|
1415
|
+
if (await operatorRung(deps, operatorRow, reason, actions, operatorView, choiceOnly, () => deps.queueRepo.deliveryDrains.holds(dest) || deliveryHeld(deps.queueRepo, member.row))) {
|
|
1312
1416
|
// Choice custody stays on the alert until it closes; exhausting its source now would retire the alert next tick.
|
|
1313
1417
|
if (!choiceOnly)
|
|
1314
1418
|
appendExhausted(deps.queueRepo, member.row, "consumed escalation hop reached operator fallback");
|
|
@@ -1318,10 +1422,16 @@ async function advancePromptRefusals(deps, now, intervalS, graceS, resolveOrch,
|
|
|
1318
1422
|
}
|
|
1319
1423
|
members.splice(i, 1);
|
|
1320
1424
|
}
|
|
1321
|
-
if (!members.length && !group.jobs.size && !group.hookReview)
|
|
1425
|
+
if (!members.length && !group.jobs.size && !group.hookReview && !group.waiters?.size)
|
|
1322
1426
|
continue;
|
|
1323
1427
|
const orch = openEscalationOwner(deps, `prompt-destination:${dest}`) ?? resolveOrch(dest);
|
|
1324
|
-
const
|
|
1428
|
+
const waiterTags = [...(group.waiters?.keys() ?? [])].map(id => `${PROMPT_ROUTED_WORK_PREFIX}${id}`);
|
|
1429
|
+
// A seat's prompt in work handed over with a return route goes to that conversation through the operator rung, not to the
|
|
1430
|
+
// seat's orchestrator: only the person can answer it, and they chose to answer there. A choice prompt keeps its route, and
|
|
1431
|
+
// so does a route on another host, which this daemon doesn't deliver to: the seat's lead is woken as usual.
|
|
1432
|
+
const resolution = resolveEscalationReturnRoute(deps.db, { qitemId: "", tags: [...members.map(m => recoveryTag(m.row.qitemId)), ...waiterTags] });
|
|
1433
|
+
const routed = !(group.choice && !group.other) && resolution.kind === "route" && routeOnThisHost(resolution.route) !== null;
|
|
1434
|
+
const toOperator = orch === null || orch === dest || routed;
|
|
1325
1435
|
const route = !deps.resolveOrchestrator
|
|
1326
1436
|
? resolveEscalationOwner(deps.db, dest, target => deps.queueRepo.acceptsDestination(target)) : null;
|
|
1327
1437
|
const reason = (group.hookReview
|
|
@@ -1332,15 +1442,25 @@ async function advancePromptRefusals(deps, now, intervalS, graceS, resolveOrch,
|
|
|
1332
1442
|
// prompt keeps the permission-prompt route.
|
|
1333
1443
|
const choiceOnly = Boolean(group.choice && !group.other);
|
|
1334
1444
|
const kindTags = choiceOnly ? [PROMPT_CHOICE_TAG] : [];
|
|
1335
|
-
const keys = group.keys.filter(key => key === group.hookReview || group.jobKeys.has(key) ||
|
|
1336
|
-
|
|
1445
|
+
const keys = group.keys.filter(key => key === group.hookReview || group.jobKeys.has(key) || group.waiterKeys?.has(key)
|
|
1446
|
+
|| members.some(m => group.rowKeys.get(m.row.qitemId)?.has(key)));
|
|
1447
|
+
const waiting = [...(group.waiters?.values() ?? [])];
|
|
1448
|
+
const aggregate = await ensureEscalationRow(deps, dest, toOperator ? humanAlertCarrier(deps, dest, members[0]?.row.sourceSession ?? [...group.jobs.values()][0] ?? waiting[0]?.sourceSession) : orch, members, reason, `prompt-destination:${dest}`, [PROMPT_ALERT_TAG, ...kindTags, ...keys, ...waiterTags], group.jobs, waiting);
|
|
1449
|
+
if (!aggregate || deps.queueRepo.deliveryDrains.holds(dest) || members.some(m => deliveryHeld(deps.queueRepo, m.row)))
|
|
1450
|
+
continue;
|
|
1337
1451
|
const row = deps.queueRepo.getById(aggregate.qitemId);
|
|
1338
1452
|
if (!row || row.state === "blocked")
|
|
1339
1453
|
continue; // The explicit owner hold owns its next wake and disposition.
|
|
1340
|
-
const addedKeys = keys.filter(key => !row.tags?.includes(key));
|
|
1454
|
+
const addedKeys = [...keys, ...waiterTags].filter(key => !row.tags?.includes(key));
|
|
1341
1455
|
// A reminder's run keeps its key while its latest refusal changes kind, so the kind is recomputed on its own too.
|
|
1342
1456
|
const kindChanged = choiceOnly !== Boolean(row.tags?.includes(PROMPT_CHOICE_TAG));
|
|
1343
|
-
|
|
1457
|
+
// Routed work that left the group (finished, handed on, no longer waiting) leaves the alert too, or the engine's route
|
|
1458
|
+
// lookup still reads its route. Only while no operator delivery has gone out: an episode already dispatched, or one the
|
|
1459
|
+
// engine already holds, keeps its record and its custody.
|
|
1460
|
+
const departedWaiters = (row.tags ?? []).filter(t => t.startsWith(PROMPT_ROUTED_WORK_PREFIX) && !waiterTags.includes(t));
|
|
1461
|
+
const pruneDeparted = departedWaiters.length > 0 && !readLadder(deps.db, row.qitemId, 0).opEngineDispatched
|
|
1462
|
+
&& !(deps.deliveryEngine?.hasAcceptedEscalation?.(row) ?? false);
|
|
1463
|
+
if (addedKeys.length || kindChanged || pruneDeparted) {
|
|
1344
1464
|
const events = deps.db.transaction(() => {
|
|
1345
1465
|
// The original body and its delivery receipt stay immutable. Publish newly
|
|
1346
1466
|
// observed hook guidance on this same readable record before any exhausted
|
|
@@ -1349,8 +1469,11 @@ async function advancePromptRefusals(deps, now, intervalS, graceS, resolveOrch,
|
|
|
1349
1469
|
? deps.queueRepo.updateWithinTransaction({ qitemId: row.qitemId, actorSession: LADDER_ACTOR,
|
|
1350
1470
|
summary: reason, transitionNote: `hook-review observed: ${reason}` }).persistedEvents
|
|
1351
1471
|
: [];
|
|
1352
|
-
|
|
1353
|
-
|
|
1472
|
+
const nextTags = [...(row.tags ?? []).filter(t => t !== PROMPT_CHOICE_TAG && !(pruneDeparted && departedWaiters.includes(t))),
|
|
1473
|
+
...kindTags, ...addedKeys];
|
|
1474
|
+
deps.db.prepare("UPDATE queue_items SET tags = ? WHERE qitem_id = ?").run(JSON.stringify(nextTags), row.qitemId);
|
|
1475
|
+
// The rungs below read this row: routed work that just joined must reach the engine's route lookup.
|
|
1476
|
+
row.tags = nextTags;
|
|
1354
1477
|
return events;
|
|
1355
1478
|
})();
|
|
1356
1479
|
deps.queueRepo.notifyCommitted(events);
|
|
@@ -1374,7 +1497,11 @@ async function advancePromptRefusals(deps, now, intervalS, graceS, resolveOrch,
|
|
|
1374
1497
|
// joined it), the permission leg still runs; accepted or deferred delivery stays exactly-once.
|
|
1375
1498
|
const floorOnly = view.exhausted && !view.opEngineDispatched
|
|
1376
1499
|
&& view.exhaustedNote === `${LADDER_EXHAUSTED_PREFIX} ${PROMPT_FLOOR_EXHAUSTED}`;
|
|
1377
|
-
|
|
1500
|
+
// The seat's lead was woken before routed work joined this alert, and no operator delivery has gone out: that work's
|
|
1501
|
+
// conversation still gets its relay. Once one has, the exactly-once rule below keeps it.
|
|
1502
|
+
const routedAfterOrchestrator = routed && view.exhausted && !view.opEngineDispatched
|
|
1503
|
+
&& (view.exhaustedNote?.startsWith(`${LADDER_EXHAUSTED_PREFIX} escalated to orchestrator`) ?? false);
|
|
1504
|
+
if (view.exhausted && !(floorOnly && !choiceOnly) && !routedAfterOrchestrator)
|
|
1378
1505
|
continue;
|
|
1379
1506
|
if (view.opEngineDispatched) {
|
|
1380
1507
|
if (view.opOutcomeResolved)
|
|
@@ -1390,19 +1517,23 @@ async function advancePromptRefusals(deps, now, intervalS, graceS, resolveOrch,
|
|
|
1390
1517
|
|| current.episode !== hookObservations.get(dest)?.episode)
|
|
1391
1518
|
continue;
|
|
1392
1519
|
}
|
|
1520
|
+
if (deps.queueRepo.deliveryDrains.holds(dest) || members.some(m => deliveryHeld(deps.queueRepo, m.row)))
|
|
1521
|
+
continue;
|
|
1393
1522
|
if (promptState(dest) !== "blocked")
|
|
1394
1523
|
continue;
|
|
1395
1524
|
const freshMembers = members.map(m => readCandidate(m.row.qitemId, dest));
|
|
1396
|
-
if (unreadableDestinations.has(dest) || (!group.jobs.size && !group.hookReview && !freshMembers.some(fresh => fresh && fresh.destinationSession === dest && ["pending", "in-progress", "blocked"].includes(fresh.state))))
|
|
1525
|
+
if (unreadableDestinations.has(dest) || (!group.jobs.size && !group.hookReview && !group.waiters?.size && !freshMembers.some(fresh => fresh && fresh.destinationSession === dest && ["pending", "in-progress", "blocked"].includes(fresh.state))))
|
|
1397
1526
|
continue;
|
|
1398
1527
|
if (!view.orchRung) {
|
|
1399
1528
|
if (!toOperator) {
|
|
1400
1529
|
const recoveryOwner = row.destinationSession;
|
|
1401
1530
|
const outcome = await attemptWake(row.qitemId, recoveryOwner);
|
|
1402
|
-
|
|
1531
|
+
if (outcome === "deferred:rig_delivery_drain")
|
|
1532
|
+
continue;
|
|
1533
|
+
appendMarker(deps.queueRepo, row, `${LADDER_RUNG_PREFIX} orchestrator -> ${recoveryOwner} outcome=${outcome} reason=${reason}`, true);
|
|
1403
1534
|
actions.push({ qitemId: row.qitemId, action: "escalate-orchestrator", target: recoveryOwner });
|
|
1404
1535
|
if (!outcome.startsWith("failed:"))
|
|
1405
|
-
appendExhausted(deps.queueRepo, row, `escalated to orchestrator (${outcome})
|
|
1536
|
+
appendExhausted(deps.queueRepo, row, `escalated to orchestrator (${outcome})`, true);
|
|
1406
1537
|
continue;
|
|
1407
1538
|
}
|
|
1408
1539
|
appendMarker(deps.queueRepo, row, `${LADDER_RUNG_PREFIX} orchestrator self-skip reason=${reason}`);
|
|
@@ -1412,12 +1543,60 @@ async function advancePromptRefusals(deps, now, intervalS, graceS, resolveOrch,
|
|
|
1412
1543
|
// A permission prompt, which only a person can approve, never waits behind it.
|
|
1413
1544
|
if (waitsOnPostedPromptAlert(deps, row, choiceOnly))
|
|
1414
1545
|
continue;
|
|
1415
|
-
if (await operatorRung(deps, row, reason, actions, view, choiceOnly)) {
|
|
1546
|
+
if (await operatorRung(deps, row, reason, actions, view, choiceOnly, () => deps.queueRepo.deliveryDrains.holds(dest) || members.some(m => deliveryHeld(deps.queueRepo, m.row)))) {
|
|
1416
1547
|
const floor = deps.queueRepo.listTransitions(row.qitemId).at(-1)?.transitionNote?.includes("human rung explicit-only");
|
|
1417
1548
|
appendExhausted(deps.queueRepo, row, floor ? PROMPT_FLOOR_EXHAUSTED : "operator rung resolved");
|
|
1418
1549
|
}
|
|
1419
1550
|
}
|
|
1420
1551
|
}
|
|
1552
|
+
/** Open rows with a return route and the seat each is stuck on: its own holder, or for a blocked row the seat it's blocked on,
|
|
1553
|
+
* directly or through a row that seat holds. */
|
|
1554
|
+
function routedPromptWork(db) {
|
|
1555
|
+
if (!db.prepare("SELECT 1 FROM pragma_table_info('queue_items') WHERE name = 'return_route'").get())
|
|
1556
|
+
return [];
|
|
1557
|
+
const rows = db.prepare(`SELECT w.qitem_id, w.state, w.destination_session, w.blocked_on, b.destination_session AS blocker_owner, b.state AS blocker_state
|
|
1558
|
+
FROM queue_items w LEFT JOIN queue_items b ON b.qitem_id = w.blocked_on
|
|
1559
|
+
WHERE w.state IN ('pending','in-progress','blocked') AND w.return_route IS NOT NULL`)
|
|
1560
|
+
.all();
|
|
1561
|
+
return rows.flatMap(row => {
|
|
1562
|
+
if (row.state !== "blocked")
|
|
1563
|
+
return [{ qitemId: row.qitem_id, subject: row.destination_session }];
|
|
1564
|
+
if (!row.blocked_on)
|
|
1565
|
+
return [];
|
|
1566
|
+
const subject = row.blocker_owner !== null
|
|
1567
|
+
? (["pending", "in-progress", "blocked"].includes(row.blocker_state ?? "") ? row.blocker_owner : null)
|
|
1568
|
+
: !isTypedGateBlocker(row.blocked_on) && parseSessionName(row.blocked_on).kind === "canonical" ? row.blocked_on : null;
|
|
1569
|
+
return subject ? [{ qitemId: row.qitem_id, subject }] : [];
|
|
1570
|
+
});
|
|
1571
|
+
}
|
|
1572
|
+
/** Relay tasks still open for a prompt alert whose prompt read clear: an answer for that prompt must not be sent. One no agent
|
|
1573
|
+
* has picked up is closed as canceled, so it leaves the conversation's list; one an agent holds keeps its custody and gets the
|
|
1574
|
+
* note. A relay that can't be updated is logged and left as it is; it never stops the prompt pass. */
|
|
1575
|
+
async function supersedeRelays(deps, alertId, why) {
|
|
1576
|
+
const open = deps.db.prepare(`SELECT qitem_id FROM queue_items WHERE state IN ('pending','in-progress','blocked')
|
|
1577
|
+
AND json_valid(tags) AND EXISTS (SELECT 1 FROM json_each(tags) WHERE value = ?)`).all(`${RELAY_FOR_PREFIX}${alertId}`);
|
|
1578
|
+
for (const { qitem_id } of open) {
|
|
1579
|
+
try {
|
|
1580
|
+
const relay = deps.queueRepo.getById(qitem_id);
|
|
1581
|
+
// Only the episode's own relay (its id, OpenRig as source, its tags); another row that carries the tag is left as it is.
|
|
1582
|
+
const key = relay?.tags?.find(t => t.startsWith(RELAY_KEY_PREFIX))?.slice(RELAY_KEY_PREFIX.length);
|
|
1583
|
+
if (!relay || !key || !isEpisodeRelay(relay, alertId, key, OPENRIG_SENDER))
|
|
1584
|
+
continue;
|
|
1585
|
+
const note = `${RETURN_ROUTE_NOTE_PREFIX}superseded: ${why}, so don't send an answer for that prompt. A new prompt gets a new task.`;
|
|
1586
|
+
if (deps.queueRepo.listTransitions(qitem_id).some(t => t.transitionNote === note))
|
|
1587
|
+
continue;
|
|
1588
|
+
if (relay.state === "pending") {
|
|
1589
|
+
await deps.queueRepo.update({ qitemId: qitem_id, actorSession: relay.sourceSession, state: "done", closureReason: "canceled",
|
|
1590
|
+
closureTarget: "prompt-cleared", transitionNote: note });
|
|
1591
|
+
}
|
|
1592
|
+
else
|
|
1593
|
+
appendMarker(deps.queueRepo, relay, note);
|
|
1594
|
+
}
|
|
1595
|
+
catch (err) {
|
|
1596
|
+
(deps.log ?? console.error)(`[wake-ladder] relay ${qitem_id} not superseded: ${err instanceof Error ? err.message : String(err)}`);
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1421
1600
|
/** Whether a destination is a person, decided as the gateway destination resolver
|
|
1422
1601
|
* decides it: every `@external` address is person-facing, registered or not (a one-off
|
|
1423
1602
|
* such as slack:U012AB3CD@external is never in the registry), and any other address is
|
|
@@ -1440,8 +1619,11 @@ function addressedToPerson(deps, destination) {
|
|
|
1440
1619
|
* Returns true when the ladder may append its exhausted marker now. */
|
|
1441
1620
|
async function operatorRung(deps, row, reason, actions, view,
|
|
1442
1621
|
/** False for a seat at a permission prompt, which only a person can approve. A choice-prompt alert follows the setting. */
|
|
1443
|
-
humanRungSettingApplies = true) {
|
|
1622
|
+
humanRungSettingApplies = true, originatingDeliveryDeferred) {
|
|
1444
1623
|
const repo = deps.queueRepo;
|
|
1624
|
+
const deliveryDeferred = () => deliveryHeld(repo, row) || originatingDeliveryDeferred?.() === true;
|
|
1625
|
+
if (deliveryDeferred())
|
|
1626
|
+
return false;
|
|
1445
1627
|
if (!deps.deliveryEngine) {
|
|
1446
1628
|
appendMarker(repo, row, `${LADDER_RUNG_PREFIX} operator floor=escalation view + daemon-health (delivery engine not wired) reason=${reason}`);
|
|
1447
1629
|
actions.push({ qitemId: row.qitemId, action: "escalate-operator" });
|
|
@@ -1461,7 +1643,9 @@ humanRungSettingApplies = true) {
|
|
|
1461
1643
|
// Exactly-once per episode: never re-dispatch; the resolution pass decides advance.
|
|
1462
1644
|
return view.opOutcomeResolved;
|
|
1463
1645
|
}
|
|
1464
|
-
const outcome = await deps.deliveryEngine.dispatchEscalation(row, reason);
|
|
1646
|
+
const outcome = await deps.deliveryEngine.dispatchEscalation(row, reason, deliveryDeferred);
|
|
1647
|
+
if (outcome.decision === "deferred:rig_delivery_drain")
|
|
1648
|
+
return false;
|
|
1465
1649
|
if (outcome.dispatched === false) {
|
|
1466
1650
|
// A real policy change: no route used to exhaust. Re-resolution is silent
|
|
1467
1651
|
// while the reason is unchanged; the scheduler supplies the retry cadence.
|
|
@@ -1471,12 +1655,12 @@ humanRungSettingApplies = true) {
|
|
|
1471
1655
|
}
|
|
1472
1656
|
return false;
|
|
1473
1657
|
}
|
|
1474
|
-
appendMarker(repo, row, `${LADDER_RUNG_PREFIX} operator dispatched-to-engine decision=${outcome.decision} resolved=${outcome.resolved}${outcome.notificationKey ? ` notification_key=${outcome.notificationKey}` : ""}${outcome.decisionId ? ` decision_id=${outcome.decisionId}` : ""} reason=${reason}
|
|
1658
|
+
appendMarker(repo, row, `${LADDER_RUNG_PREFIX} operator dispatched-to-engine decision=${outcome.decision} resolved=${outcome.resolved}${outcome.notificationKey ? ` notification_key=${outcome.notificationKey}` : ""}${outcome.decisionId ? ` decision_id=${outcome.decisionId}` : ""} reason=${reason}`, true);
|
|
1475
1659
|
actions.push({ qitemId: row.qitemId, action: "escalate-operator" });
|
|
1476
1660
|
return outcome.resolved;
|
|
1477
1661
|
}
|
|
1478
|
-
function appendExhausted(repo, row, why) {
|
|
1479
|
-
appendMarker(repo, row, `${LADDER_EXHAUSTED_PREFIX} ${why}
|
|
1662
|
+
function appendExhausted(repo, row, why, admittedOutcome = false) {
|
|
1663
|
+
appendMarker(repo, row, `${LADDER_EXHAUSTED_PREFIX} ${why}`, admittedOutcome);
|
|
1480
1664
|
}
|
|
1481
1665
|
/** Ensure the per-destination aggregate escalation row (F3): one open row, deduped by
|
|
1482
1666
|
* tag, refreshed on re-detection — never one row per baton. The row is a NEW durable
|
|
@@ -1485,6 +1669,8 @@ function appendExhausted(repo, row, why) {
|
|
|
1485
1669
|
* detection-pass note naming the current member list; creation stays with the rung
|
|
1486
1670
|
* action so a row never exists before its first delivery attempt. */
|
|
1487
1671
|
async function refreshEscalationRowIfExists(deps, dest, members, dedupTag = escalationDedupTag(dest)) {
|
|
1672
|
+
if (deps.queueRepo.deliveryDrains.holds(dest) || members.some(m => deliveryHeld(deps.queueRepo, m.row)))
|
|
1673
|
+
return;
|
|
1488
1674
|
const existing = deps.db
|
|
1489
1675
|
.prepare(`SELECT qitem_id FROM queue_items
|
|
1490
1676
|
WHERE state IN ('pending','in-progress','blocked') AND tags LIKE ? LIMIT 1`)
|
|
@@ -1514,7 +1700,12 @@ function openEscalationOwner(deps, dedupTag) {
|
|
|
1514
1700
|
}
|
|
1515
1701
|
async function ensureEscalationRow(deps, dest, orch, members, reason, dedupTag = escalationDedupTag(dest), extraTags = [],
|
|
1516
1702
|
/** Watchdog reminders refused at this seat's prompt: job id to the session that registered it. */
|
|
1517
|
-
jobs = new Map()
|
|
1703
|
+
jobs = new Map(),
|
|
1704
|
+
/** Routed work stuck at this seat's prompt (return-route.ts). Named, never taken over: their owners keep them. */
|
|
1705
|
+
waiting = []) {
|
|
1706
|
+
if (deps.queueRepo.deliveryDrains.holds(dest) || deps.queueRepo.deliveryDrains.holds(orch)
|
|
1707
|
+
|| members.some(m => deliveryHeld(deps.queueRepo, m.row)))
|
|
1708
|
+
return null;
|
|
1518
1709
|
const existing = deps.db
|
|
1519
1710
|
.prepare(`SELECT qitem_id FROM queue_items
|
|
1520
1711
|
WHERE state IN ('pending','in-progress','blocked') AND tags LIKE ? LIMIT 1`)
|
|
@@ -1528,12 +1719,25 @@ jobs = new Map()) {
|
|
|
1528
1719
|
await refreshEscalationRowIfExists(deps, dest, members, dedupTag);
|
|
1529
1720
|
return { qitemId: existing.qitem_id };
|
|
1530
1721
|
}
|
|
1722
|
+
// The summary counts what the alert is about, routed goals waiting on the seat included, each row once: a routed goal
|
|
1723
|
+
// whose wake was also refused counts as a routed goal (the body still lists it under both). A count of none is left out
|
|
1724
|
+
// (a routed goal alone used to read "0 baton(s) stuck").
|
|
1725
|
+
const routed = new Set(waiting.map(w => w.qitemId));
|
|
1726
|
+
const batons = members.filter(m => !routed.has(m.row.qitemId)).length;
|
|
1727
|
+
const stuck = [
|
|
1728
|
+
...(batons ? [`${batons} baton(s)`] : []),
|
|
1729
|
+
...(jobs.size ? [`${jobs.size} watchdog reminder(s)`] : []),
|
|
1730
|
+
].join(" and ");
|
|
1731
|
+
const counted = [
|
|
1732
|
+
...(stuck ? [`${stuck} stuck at ${dest}`] : []),
|
|
1733
|
+
...(waiting.length ? [`${waiting.length} routed goal(s) waiting on ${stuck ? "it" : dest}`] : []),
|
|
1734
|
+
].join(" and ");
|
|
1531
1735
|
const body = `WAKE ESCALATION (aggregated per destination)\n` +
|
|
1532
1736
|
`destination: ${dest}\n` +
|
|
1533
|
-
`reason: ${reason}
|
|
1534
|
-
|
|
1535
|
-
members.map((m) => `- ${m.row.qitemId}: ${m.row.summary ?? "outstanding work"} (${m.reason})`).join("\n") +
|
|
1737
|
+
`reason: ${reason}` +
|
|
1738
|
+
(members.length ? `\nstuck batons (${members.length}):\n${members.map((m) => `- ${m.row.qitemId}: ${m.row.summary ?? "outstanding work"} (${m.reason})`).join("\n")}` : "") +
|
|
1536
1739
|
(jobs.size ? `\nwatchdog reminders refused at its prompt (${jobs.size}):\n${[...jobs.keys()].map(id => `- ${id}`).join("\n")}` : "") +
|
|
1740
|
+
(waiting.length ? `\nwork handed over with a return route, stuck at its prompt (${waiting.length}):\n${waiting.map(w => `- ${w.qitemId}: ${w.summary ?? "routed work"}`).join("\n")}` : "") +
|
|
1537
1741
|
`\nThe rows above still carry their obligations exactly-once; this escalation is the wake, not the content.`;
|
|
1538
1742
|
const route = !deps.resolveOrchestrator
|
|
1539
1743
|
? resolveEscalationOwner(deps.db, dest, target => deps.queueRepo.acceptsDestination(target)) : null;
|
|
@@ -1542,7 +1746,7 @@ jobs = new Map()) {
|
|
|
1542
1746
|
sourceSession: OPENRIG_SENDER,
|
|
1543
1747
|
destinationSession: orch,
|
|
1544
1748
|
body,
|
|
1545
|
-
summary: `Wake escalation: ${
|
|
1749
|
+
summary: `Wake escalation: ${counted || dest} — ${reason}`,
|
|
1546
1750
|
tags: [WAKE_ESCALATION_TAG, dedupTag,
|
|
1547
1751
|
...(oneHop ? [ESCALATION_HOP_TAG] : []), ...extraTags, ...members.map(m => recoveryTag(m.row.qitemId))],
|
|
1548
1752
|
nudge: false, // delivery is the ladder's own rung attempt, recorded with its outcome
|