@openrig/cli 0.6.14 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -12
- package/daemon/assets/claude-statusline-context.cjs +13 -3
- package/daemon/assets/guidance/openrig-seat-skills.md +1 -0
- package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/README.md +11 -4
- package/daemon/assets/plugins/openrig-core/hooks/claude.json +11 -11
- package/daemon/assets/plugins/openrig-core/hooks/codex.json +6 -6
- package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +22 -9
- package/daemon/assets/plugins/openrig-core/hooks/scripts/codex-hook-trust.cjs +49 -0
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus-health.cjs +2 -2
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +35 -11
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +9 -2
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +1 -1
- package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +16 -10
- package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +43 -4
- package/daemon/assets/plugins/openrig-core/skills/openrig-skills/SKILL.md +2 -2
- package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +192 -61
- package/daemon/assets/plugins/openrig-core/skills/queue-handoff/SKILL.md +10 -4
- package/daemon/assets/skills/rigs/SKILL.md +26 -6
- package/daemon/context-packs/help/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +209 -33
- package/daemon/context-packs/reference/getting-started.md +148 -23
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +83 -3
- package/daemon/context-packs/reference/whats-new.md +173 -69
- package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
- package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
- package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
- package/daemon/context-packs/skills/claude-compaction-restore/SKILL.md +9 -2
- package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/claude-compaction-restore/scripts/precompact-hook.mjs +1 -1
- package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +43 -4
- package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-herdr/SKILL.md +3 -0
- package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-skills/SKILL.md +2 -2
- package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-software-factory/references/worked-example.md +2 -2
- package/daemon/context-packs/skills/core/openrig-upgrade/SKILL.md +11 -5
- package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
- package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/SKILL.md +16 -10
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
- package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-user/SKILL.md +192 -61
- package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/development-team/SKILL.md +2 -0
- package/daemon/context-packs/skills/pods/development-team/manifest.yaml +3 -1
- package/daemon/context-packs/skills/pods/development-team/references/refactoring.md +11 -0
- package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/review-team/SKILL.md +46 -96
- package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/verification-before-completion/SKILL.md +17 -80
- package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +5 -3
- package/daemon/context-packs/skills/process/verification-before-completion/references/performance-claims.md +12 -0
- package/daemon/context-packs/skills/queue-handoff/SKILL.md +10 -4
- package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
- package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
- package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
- package/daemon/context-packs/world-example/manifest.yaml +1 -1
- package/daemon/context-packs/world-public/manifest.yaml +1 -1
- package/daemon/dist/adapters/claude-code-adapter.d.ts +6 -2
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +127 -32
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/claude-resume.d.ts +2 -1
- package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-resume.js +10 -3
- package/daemon/dist/adapters/claude-resume.js.map +1 -1
- package/daemon/dist/adapters/codex-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-resume.js +2 -7
- package/daemon/dist/adapters/codex-resume.js.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts +75 -3
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +592 -91
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts +21 -2
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.js +90 -8
- package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/compose-services-adapter.d.ts +16 -0
- package/daemon/dist/adapters/compose-services-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/compose-services-adapter.js +52 -9
- package/daemon/dist/adapters/compose-services-adapter.js.map +1 -1
- package/daemon/dist/adapters/kernel-authority.d.ts.map +1 -1
- package/daemon/dist/adapters/kernel-authority.js +9 -5
- package/daemon/dist/adapters/kernel-authority.js.map +1 -1
- package/daemon/dist/adapters/pi-runner.d.ts +13 -0
- package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.js +64 -16
- package/daemon/dist/adapters/pi-runner.js.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.js +9 -6
- package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/runtime-probe-exec.d.ts +11 -0
- package/daemon/dist/adapters/runtime-probe-exec.d.ts.map +1 -0
- package/daemon/dist/adapters/runtime-probe-exec.js +25 -0
- package/daemon/dist/adapters/runtime-probe-exec.js.map +1 -0
- package/daemon/dist/adapters/stub-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/stub-runner.js +2 -0
- package/daemon/dist/adapters/stub-runner.js.map +1 -1
- package/daemon/dist/adapters/stub-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/stub-runtime-adapter.js +9 -5
- package/daemon/dist/adapters/stub-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +36 -5
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +162 -33
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/attention-surface.d.ts +14 -0
- package/daemon/dist/attention-surface.d.ts.map +1 -1
- package/daemon/dist/attention-surface.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/daemon-db-path.d.ts +6 -0
- package/daemon/dist/daemon-db-path.d.ts.map +1 -1
- package/daemon/dist/daemon-db-path.js +65 -1
- package/daemon/dist/daemon-db-path.js.map +1 -1
- package/daemon/dist/daemon-shutdown.d.ts.map +1 -1
- package/daemon/dist/daemon-shutdown.js +4 -2
- package/daemon/dist/daemon-shutdown.js.map +1 -1
- package/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +28 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/116_queue_item_wake_input_box.d.ts +3 -0
- package/daemon/dist/db/migrations/116_queue_item_wake_input_box.d.ts.map +1 -0
- package/daemon/dist/db/migrations/116_queue_item_wake_input_box.js +8 -0
- package/daemon/dist/db/migrations/116_queue_item_wake_input_box.js.map +1 -0
- package/daemon/dist/db/migrations/118_human_quiet_windows.d.ts +3 -0
- package/daemon/dist/db/migrations/118_human_quiet_windows.d.ts.map +1 -0
- package/daemon/dist/db/migrations/118_human_quiet_windows.js +30 -0
- package/daemon/dist/db/migrations/118_human_quiet_windows.js.map +1 -0
- package/daemon/dist/db/migrations/119_seat_identity_pane_pid.d.ts +3 -0
- package/daemon/dist/db/migrations/119_seat_identity_pane_pid.d.ts.map +1 -0
- package/daemon/dist/db/migrations/119_seat_identity_pane_pid.js +7 -0
- package/daemon/dist/db/migrations/119_seat_identity_pane_pid.js.map +1 -0
- package/daemon/dist/db/migrations/121_rig_startup_layers.d.ts +13 -0
- package/daemon/dist/db/migrations/121_rig_startup_layers.d.ts.map +1 -0
- package/daemon/dist/db/migrations/121_rig_startup_layers.js +17 -0
- package/daemon/dist/db/migrations/121_rig_startup_layers.js.map +1 -0
- package/daemon/dist/db/migrations/122_human_operating_modes.d.ts +3 -0
- package/daemon/dist/db/migrations/122_human_operating_modes.d.ts.map +1 -0
- package/daemon/dist/db/migrations/122_human_operating_modes.js +55 -0
- package/daemon/dist/db/migrations/122_human_operating_modes.js.map +1 -0
- package/daemon/dist/db/migrations/123_queue_delegated_decision.d.ts +3 -0
- package/daemon/dist/db/migrations/123_queue_delegated_decision.d.ts.map +1 -0
- package/daemon/dist/db/migrations/123_queue_delegated_decision.js +10 -0
- package/daemon/dist/db/migrations/123_queue_delegated_decision.js.map +1 -0
- package/daemon/dist/db/migrations/124_context_usage_watchdog_units.d.ts +4 -0
- package/daemon/dist/db/migrations/124_context_usage_watchdog_units.d.ts.map +1 -0
- package/daemon/dist/db/migrations/124_context_usage_watchdog_units.js +9 -0
- package/daemon/dist/db/migrations/124_context_usage_watchdog_units.js.map +1 -0
- package/daemon/dist/db/migrations/125_node_advisor.d.ts +3 -0
- package/daemon/dist/db/migrations/125_node_advisor.d.ts.map +1 -0
- package/daemon/dist/db/migrations/125_node_advisor.js +8 -0
- package/daemon/dist/db/migrations/125_node_advisor.js.map +1 -0
- package/daemon/dist/db/migrations/127_operation_correlation.d.ts +3 -0
- package/daemon/dist/db/migrations/127_operation_correlation.d.ts.map +1 -0
- package/daemon/dist/db/migrations/127_operation_correlation.js +10 -0
- package/daemon/dist/db/migrations/127_operation_correlation.js.map +1 -0
- package/daemon/dist/db/migrations/128_terminal_policy.d.ts +3 -0
- package/daemon/dist/db/migrations/128_terminal_policy.d.ts.map +1 -0
- package/daemon/dist/db/migrations/128_terminal_policy.js +37 -0
- package/daemon/dist/db/migrations/128_terminal_policy.js.map +1 -0
- package/daemon/dist/db/migrations/129_stream_dispositions.d.ts +10 -0
- package/daemon/dist/db/migrations/129_stream_dispositions.d.ts.map +1 -0
- package/daemon/dist/db/migrations/129_stream_dispositions.js +35 -0
- package/daemon/dist/db/migrations/129_stream_dispositions.js.map +1 -0
- package/daemon/dist/db/migrations/130_stream_subscriptions.d.ts +11 -0
- package/daemon/dist/db/migrations/130_stream_subscriptions.d.ts.map +1 -0
- package/daemon/dist/db/migrations/130_stream_subscriptions.js +33 -0
- package/daemon/dist/db/migrations/130_stream_subscriptions.js.map +1 -0
- package/daemon/dist/db/migrations/131_stream_retention_floor.d.ts +8 -0
- package/daemon/dist/db/migrations/131_stream_retention_floor.d.ts.map +1 -0
- package/daemon/dist/db/migrations/131_stream_retention_floor.js +20 -0
- package/daemon/dist/db/migrations/131_stream_retention_floor.js.map +1 -0
- package/daemon/dist/db/migrations/135_seat_identity_process_evidence.d.ts +3 -0
- package/daemon/dist/db/migrations/135_seat_identity_process_evidence.d.ts.map +1 -0
- package/daemon/dist/db/migrations/135_seat_identity_process_evidence.js +16 -0
- package/daemon/dist/db/migrations/135_seat_identity_process_evidence.js.map +1 -0
- package/daemon/dist/domain/active-occupant.d.ts +8 -3
- package/daemon/dist/domain/active-occupant.d.ts.map +1 -1
- package/daemon/dist/domain/active-occupant.js +8 -4
- package/daemon/dist/domain/active-occupant.js.map +1 -1
- package/daemon/dist/domain/activity-taxonomy.d.ts +19 -1
- package/daemon/dist/domain/activity-taxonomy.d.ts.map +1 -1
- package/daemon/dist/domain/activity-taxonomy.js +21 -0
- package/daemon/dist/domain/activity-taxonomy.js.map +1 -1
- package/daemon/dist/domain/agent-activity-store.d.ts +24 -0
- package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
- package/daemon/dist/domain/agent-activity-store.js +50 -5
- package/daemon/dist/domain/agent-activity-store.js.map +1 -1
- package/daemon/dist/domain/agent-images/evidence-guard.js +3 -3
- package/daemon/dist/domain/agent-images/evidence-guard.js.map +1 -1
- package/daemon/dist/domain/agent-images/resume-token-discovery.d.ts.map +1 -1
- package/daemon/dist/domain/agent-images/resume-token-discovery.js +2 -10
- package/daemon/dist/domain/agent-images/resume-token-discovery.js.map +1 -1
- package/daemon/dist/domain/agent-manifest.d.ts.map +1 -1
- package/daemon/dist/domain/agent-manifest.js +14 -2
- package/daemon/dist/domain/agent-manifest.js.map +1 -1
- package/daemon/dist/domain/ask-service.d.ts +1 -0
- package/daemon/dist/domain/ask-service.d.ts.map +1 -1
- package/daemon/dist/domain/ask-service.js +7 -1
- package/daemon/dist/domain/ask-service.js.map +1 -1
- package/daemon/dist/domain/bootstrap-orchestrator.d.ts +5 -0
- package/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/bootstrap-orchestrator.js +25 -12
- package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
- package/daemon/dist/domain/builtin-startup-files.d.ts.map +1 -1
- package/daemon/dist/domain/builtin-startup-files.js +2 -0
- package/daemon/dist/domain/builtin-startup-files.js.map +1 -1
- package/daemon/dist/domain/bundle-behaviour.d.ts.map +1 -1
- package/daemon/dist/domain/bundle-behaviour.js +28 -1
- package/daemon/dist/domain/bundle-behaviour.js.map +1 -1
- package/daemon/dist/domain/claim-service.d.ts +20 -2
- package/daemon/dist/domain/claim-service.d.ts.map +1 -1
- package/daemon/dist/domain/claim-service.js +74 -19
- package/daemon/dist/domain/claim-service.js.map +1 -1
- package/daemon/dist/domain/classification-attempts.d.ts +4 -1
- package/daemon/dist/domain/classification-attempts.d.ts.map +1 -1
- package/daemon/dist/domain/classification-attempts.js +10 -1
- package/daemon/dist/domain/classification-attempts.js.map +1 -1
- package/daemon/dist/domain/classification-sources.d.ts +38 -0
- package/daemon/dist/domain/classification-sources.d.ts.map +1 -1
- package/daemon/dist/domain/classification-sources.js +26 -1
- package/daemon/dist/domain/classification-sources.js.map +1 -1
- package/daemon/dist/domain/claude-activity-hooks.d.ts +2 -2
- package/daemon/dist/domain/claude-activity-hooks.d.ts.map +1 -1
- package/daemon/dist/domain/claude-activity-hooks.js +8 -7
- package/daemon/dist/domain/claude-activity-hooks.js.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +126 -11
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +527 -68
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/claude-core-plugin-env.d.ts +14 -0
- package/daemon/dist/domain/claude-core-plugin-env.d.ts.map +1 -1
- package/daemon/dist/domain/claude-core-plugin-env.js +37 -11
- package/daemon/dist/domain/claude-core-plugin-env.js.map +1 -1
- package/daemon/dist/domain/claude-managed-launch.d.ts +1 -1
- package/daemon/dist/domain/claude-managed-launch.d.ts.map +1 -1
- package/daemon/dist/domain/claude-managed-launch.js +33 -15
- package/daemon/dist/domain/claude-managed-launch.js.map +1 -1
- package/daemon/dist/domain/codex-core-plugin-install.d.ts +41 -0
- package/daemon/dist/domain/codex-core-plugin-install.d.ts.map +1 -0
- package/daemon/dist/domain/codex-core-plugin-install.js +126 -0
- package/daemon/dist/domain/codex-core-plugin-install.js.map +1 -0
- package/daemon/dist/domain/codex-owned-plugin-trust.d.ts +26 -0
- package/daemon/dist/domain/codex-owned-plugin-trust.d.ts.map +1 -0
- package/daemon/dist/domain/codex-owned-plugin-trust.js +187 -0
- package/daemon/dist/domain/codex-owned-plugin-trust.js.map +1 -0
- package/daemon/dist/domain/codex-rebuild-permissions.d.ts +54 -0
- package/daemon/dist/domain/codex-rebuild-permissions.d.ts.map +1 -0
- package/daemon/dist/domain/codex-rebuild-permissions.js +134 -0
- package/daemon/dist/domain/codex-rebuild-permissions.js.map +1 -0
- package/daemon/dist/domain/codex-thread-id.d.ts +23 -1
- package/daemon/dist/domain/codex-thread-id.d.ts.map +1 -1
- package/daemon/dist/domain/codex-thread-id.js +58 -17
- package/daemon/dist/domain/codex-thread-id.js.map +1 -1
- package/daemon/dist/domain/community-harness-launch-result.d.ts +33 -0
- package/daemon/dist/domain/community-harness-launch-result.d.ts.map +1 -0
- package/daemon/dist/domain/community-harness-launch-result.js +93 -0
- package/daemon/dist/domain/community-harness-launch-result.js.map +1 -0
- package/daemon/dist/domain/community-harness-presets.d.ts +27 -2
- package/daemon/dist/domain/community-harness-presets.d.ts.map +1 -1
- package/daemon/dist/domain/community-harness-presets.js +49 -5
- package/daemon/dist/domain/community-harness-presets.js.map +1 -1
- package/daemon/dist/domain/composer-prompts.d.ts +5 -2
- package/daemon/dist/domain/composer-prompts.d.ts.map +1 -1
- package/daemon/dist/domain/composer-prompts.js +2 -2
- package/daemon/dist/domain/composer-prompts.js.map +1 -1
- package/daemon/dist/domain/context-monitor.d.ts +13 -5
- package/daemon/dist/domain/context-monitor.d.ts.map +1 -1
- package/daemon/dist/domain/context-monitor.js +49 -14
- package/daemon/dist/domain/context-monitor.js.map +1 -1
- package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
- package/daemon/dist/domain/context-usage-store.js +3 -0
- package/daemon/dist/domain/context-usage-store.js.map +1 -1
- package/daemon/dist/domain/continuity-policy-materializer.d.ts +1 -0
- package/daemon/dist/domain/continuity-policy-materializer.d.ts.map +1 -1
- package/daemon/dist/domain/continuity-policy-materializer.js +2 -0
- package/daemon/dist/domain/continuity-policy-materializer.js.map +1 -1
- package/daemon/dist/domain/current-work.d.ts +18 -0
- package/daemon/dist/domain/current-work.d.ts.map +1 -1
- package/daemon/dist/domain/current-work.js +17 -3
- package/daemon/dist/domain/current-work.js.map +1 -1
- package/daemon/dist/domain/draft-aware-delivery.d.ts +7 -7
- package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/draft-aware-delivery.js +61 -82
- package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
- package/daemon/dist/domain/execution-view.d.ts.map +1 -1
- package/daemon/dist/domain/execution-view.js +9 -7
- package/daemon/dist/domain/execution-view.js.map +1 -1
- package/daemon/dist/domain/existing-rig-restore.d.ts +110 -0
- package/daemon/dist/domain/existing-rig-restore.d.ts.map +1 -0
- package/daemon/dist/domain/existing-rig-restore.js +254 -0
- package/daemon/dist/domain/existing-rig-restore.js.map +1 -0
- package/daemon/dist/domain/footprint-choice.d.ts +41 -0
- package/daemon/dist/domain/footprint-choice.d.ts.map +1 -0
- package/daemon/dist/domain/footprint-choice.js +42 -0
- package/daemon/dist/domain/footprint-choice.js.map +1 -0
- package/daemon/dist/domain/fresh-occupant-relation.d.ts.map +1 -1
- package/daemon/dist/domain/fresh-occupant-relation.js +9 -2
- package/daemon/dist/domain/fresh-occupant-relation.js.map +1 -1
- package/daemon/dist/domain/gateway/channel-operations.d.ts +3 -4
- package/daemon/dist/domain/gateway/channel-operations.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/channel-operations.js.map +1 -1
- package/daemon/dist/domain/gateway/connections-projection.d.ts +0 -5
- package/daemon/dist/domain/gateway/connections-projection.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/connections-projection.js +3 -46
- package/daemon/dist/domain/gateway/connections-projection.js.map +1 -1
- package/daemon/dist/domain/gateway/delivery-rules-engine.d.ts +14 -1
- package/daemon/dist/domain/gateway/delivery-rules-engine.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/delivery-rules-engine.js +13 -3
- package/daemon/dist/domain/gateway/delivery-rules-engine.js.map +1 -1
- package/daemon/dist/domain/gateway/dispatch-buffer.d.ts +4 -0
- package/daemon/dist/domain/gateway/dispatch-buffer.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/dispatch-buffer.js +18 -0
- package/daemon/dist/domain/gateway/dispatch-buffer.js.map +1 -1
- package/daemon/dist/domain/gateway/human-mode-account.d.ts +61 -0
- package/daemon/dist/domain/gateway/human-mode-account.d.ts.map +1 -0
- package/daemon/dist/domain/gateway/human-mode-account.js +112 -0
- package/daemon/dist/domain/gateway/human-mode-account.js.map +1 -0
- package/daemon/dist/domain/gateway/human-operating-modes.d.ts +171 -0
- package/daemon/dist/domain/gateway/human-operating-modes.d.ts.map +1 -0
- package/daemon/dist/domain/gateway/human-operating-modes.js +422 -0
- package/daemon/dist/domain/gateway/human-operating-modes.js.map +1 -0
- package/daemon/dist/domain/gateway/human-quiet-windows.d.ts +121 -0
- package/daemon/dist/domain/gateway/human-quiet-windows.d.ts.map +1 -0
- package/daemon/dist/domain/gateway/human-quiet-windows.js +217 -0
- package/daemon/dist/domain/gateway/human-quiet-windows.js.map +1 -0
- package/daemon/dist/domain/gateway/human-registry.d.ts +55 -2
- package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/human-registry.js +137 -8
- package/daemon/dist/domain/gateway/human-registry.js.map +1 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.js +9 -0
- package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.d.ts +10 -2
- package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.js +76 -6
- package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +4 -0
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +13 -2
- package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts +9 -3
- package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/outbound-driver.js +40 -6
- package/daemon/dist/domain/gateway/slack/outbound-driver.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts +7 -0
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.js +14 -2
- package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +17 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.js +143 -56
- package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts +3 -2
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js +266 -51
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
- package/daemon/dist/domain/generated-file-hygiene.js +1 -1
- package/daemon/dist/domain/generated-file-hygiene.js.map +1 -1
- package/daemon/dist/domain/graph-projection.d.ts +3 -0
- package/daemon/dist/domain/graph-projection.d.ts.map +1 -1
- package/daemon/dist/domain/graph-projection.js +2 -0
- package/daemon/dist/domain/graph-projection.js.map +1 -1
- package/daemon/dist/domain/health-diagnosis.d.ts.map +1 -1
- package/daemon/dist/domain/health-diagnosis.js +14 -6
- package/daemon/dist/domain/health-diagnosis.js.map +1 -1
- package/daemon/dist/domain/health-passive-ceremony.d.ts +4 -0
- package/daemon/dist/domain/health-passive-ceremony.d.ts.map +1 -1
- package/daemon/dist/domain/health-passive-ceremony.js +34 -4
- package/daemon/dist/domain/health-passive-ceremony.js.map +1 -1
- package/daemon/dist/domain/hosts/hosts-registry-reader.d.ts +3 -1
- package/daemon/dist/domain/hosts/hosts-registry-reader.d.ts.map +1 -1
- package/daemon/dist/domain/hosts/hosts-registry-reader.js +9 -9
- package/daemon/dist/domain/hosts/hosts-registry-reader.js.map +1 -1
- package/daemon/dist/domain/hosts/learned-host-bindings.d.ts +28 -0
- package/daemon/dist/domain/hosts/learned-host-bindings.d.ts.map +1 -0
- package/daemon/dist/domain/hosts/learned-host-bindings.js +77 -0
- package/daemon/dist/domain/hosts/learned-host-bindings.js.map +1 -0
- package/daemon/dist/domain/hot-potato-enforcer.d.ts +7 -5
- package/daemon/dist/domain/hot-potato-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/hot-potato-enforcer.js +19 -10
- package/daemon/dist/domain/hot-potato-enforcer.js.map +1 -1
- package/daemon/dist/domain/human-questions.d.ts +10 -1
- package/daemon/dist/domain/human-questions.d.ts.map +1 -1
- package/daemon/dist/domain/human-questions.js +5 -0
- package/daemon/dist/domain/human-questions.js.map +1 -1
- package/daemon/dist/domain/kernel-boot-tracker.d.ts +17 -1
- package/daemon/dist/domain/kernel-boot-tracker.d.ts.map +1 -1
- package/daemon/dist/domain/kernel-boot-tracker.js +44 -3
- package/daemon/dist/domain/kernel-boot-tracker.js.map +1 -1
- package/daemon/dist/domain/kernel-boot.d.ts +26 -1
- package/daemon/dist/domain/kernel-boot.d.ts.map +1 -1
- package/daemon/dist/domain/kernel-boot.js +91 -6
- package/daemon/dist/domain/kernel-boot.js.map +1 -1
- package/daemon/dist/domain/managed-blocks.d.ts +32 -1
- package/daemon/dist/domain/managed-blocks.d.ts.map +1 -1
- package/daemon/dist/domain/managed-blocks.js +109 -11
- package/daemon/dist/domain/managed-blocks.js.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts +1 -1
- package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-action-log.js +3 -0
- package/daemon/dist/domain/mission-control/mission-control-action-log.js.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +21 -0
- package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js +110 -0
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
- package/daemon/dist/domain/model-divergence/current-generation-record.d.ts +2 -1
- package/daemon/dist/domain/model-divergence/current-generation-record.d.ts.map +1 -1
- package/daemon/dist/domain/model-divergence/current-generation-record.js +8 -3
- package/daemon/dist/domain/model-divergence/current-generation-record.js.map +1 -1
- package/daemon/dist/domain/model-divergence/current-model-reader.d.ts +2 -0
- package/daemon/dist/domain/model-divergence/current-model-reader.d.ts.map +1 -1
- package/daemon/dist/domain/model-divergence/current-model-reader.js +7 -0
- package/daemon/dist/domain/model-divergence/current-model-reader.js.map +1 -1
- package/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts +10 -1
- package/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts.map +1 -1
- package/daemon/dist/domain/model-divergence/model-divergence-monitor.js +24 -5
- package/daemon/dist/domain/model-divergence/model-divergence-monitor.js.map +1 -1
- package/daemon/dist/domain/native-process-lineage.d.ts +3 -0
- package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
- package/daemon/dist/domain/native-process-lineage.js +103 -17
- package/daemon/dist/domain/native-process-lineage.js.map +1 -1
- package/daemon/dist/domain/native-resume-probe-evidence.d.ts +19 -0
- package/daemon/dist/domain/native-resume-probe-evidence.d.ts.map +1 -0
- package/daemon/dist/domain/native-resume-probe-evidence.js +37 -0
- package/daemon/dist/domain/native-resume-probe-evidence.js.map +1 -0
- package/daemon/dist/domain/native-resume-probe.d.ts +7 -0
- package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
- package/daemon/dist/domain/native-resume-probe.js +12 -9
- package/daemon/dist/domain/native-resume-probe.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts +49 -1
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +145 -57
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/node-launcher.d.ts +5 -3
- package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/node-launcher.js +36 -26
- package/daemon/dist/domain/node-launcher.js.map +1 -1
- package/daemon/dist/domain/occupant-invalidator.d.ts +16 -4
- package/daemon/dist/domain/occupant-invalidator.d.ts.map +1 -1
- package/daemon/dist/domain/occupant-invalidator.js +25 -5
- package/daemon/dist/domain/occupant-invalidator.js.map +1 -1
- package/daemon/dist/domain/operation-correlation.d.ts +78 -0
- package/daemon/dist/domain/operation-correlation.d.ts.map +1 -0
- package/daemon/dist/domain/operation-correlation.js +54 -0
- package/daemon/dist/domain/operation-correlation.js.map +1 -0
- package/daemon/dist/domain/outbox-handler.d.ts +3 -5
- package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
- package/daemon/dist/domain/outbox-handler.js +9 -19
- package/daemon/dist/domain/outbox-handler.js.map +1 -1
- package/daemon/dist/domain/park-wake-text.d.ts +11 -0
- package/daemon/dist/domain/park-wake-text.d.ts.map +1 -0
- package/daemon/dist/domain/park-wake-text.js +26 -0
- package/daemon/dist/domain/park-wake-text.js.map +1 -0
- package/daemon/dist/domain/permission-account.d.ts +28 -0
- package/daemon/dist/domain/permission-account.d.ts.map +1 -0
- package/daemon/dist/domain/permission-account.js +102 -0
- package/daemon/dist/domain/permission-account.js.map +1 -0
- package/daemon/dist/domain/permission-drift.d.ts.map +1 -1
- package/daemon/dist/domain/permission-drift.js +11 -7
- package/daemon/dist/domain/permission-drift.js.map +1 -1
- package/daemon/dist/domain/plugin-vendor-service.d.ts +4 -0
- package/daemon/dist/domain/plugin-vendor-service.d.ts.map +1 -1
- package/daemon/dist/domain/plugin-vendor-service.js +29 -6
- package/daemon/dist/domain/plugin-vendor-service.js.map +1 -1
- package/daemon/dist/domain/pod-bundle-assembler.d.ts +1 -0
- package/daemon/dist/domain/pod-bundle-assembler.d.ts.map +1 -1
- package/daemon/dist/domain/pod-bundle-assembler.js +25 -0
- package/daemon/dist/domain/pod-bundle-assembler.js.map +1 -1
- package/daemon/dist/domain/policies/artifact-pool-helpers.d.ts +7 -0
- package/daemon/dist/domain/policies/artifact-pool-helpers.d.ts.map +1 -1
- package/daemon/dist/domain/policies/artifact-pool-helpers.js +8 -4
- package/daemon/dist/domain/policies/artifact-pool-helpers.js.map +1 -1
- package/daemon/dist/domain/policies/context-usage-threshold.d.ts.map +1 -1
- package/daemon/dist/domain/policies/context-usage-threshold.js +109 -21
- package/daemon/dist/domain/policies/context-usage-threshold.js.map +1 -1
- package/daemon/dist/domain/policies/delivery-digest-flush.d.ts +1 -0
- package/daemon/dist/domain/policies/delivery-digest-flush.d.ts.map +1 -1
- package/daemon/dist/domain/policies/delivery-digest-flush.js +25 -4
- package/daemon/dist/domain/policies/delivery-digest-flush.js.map +1 -1
- package/daemon/dist/domain/policies/edge-artifact-required.d.ts +6 -1
- package/daemon/dist/domain/policies/edge-artifact-required.d.ts.map +1 -1
- package/daemon/dist/domain/policies/edge-artifact-required.js +18 -13
- package/daemon/dist/domain/policies/edge-artifact-required.js.map +1 -1
- package/daemon/dist/domain/policies/mode-scheduled-end.d.ts +39 -0
- package/daemon/dist/domain/policies/mode-scheduled-end.d.ts.map +1 -0
- package/daemon/dist/domain/policies/mode-scheduled-end.js +165 -0
- package/daemon/dist/domain/policies/mode-scheduled-end.js.map +1 -0
- package/daemon/dist/domain/policies/parked-owner-consumer.d.ts +11 -7
- package/daemon/dist/domain/policies/parked-owner-consumer.d.ts.map +1 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.js +82 -113
- package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
- package/daemon/dist/domain/policies/periodic-reminder.d.ts +10 -0
- package/daemon/dist/domain/policies/periodic-reminder.d.ts.map +1 -1
- package/daemon/dist/domain/policies/periodic-reminder.js +11 -6
- package/daemon/dist/domain/policies/periodic-reminder.js.map +1 -1
- package/daemon/dist/domain/policies/quiet-release.d.ts +109 -0
- package/daemon/dist/domain/policies/quiet-release.d.ts.map +1 -0
- package/daemon/dist/domain/policies/quiet-release.js +213 -0
- package/daemon/dist/domain/policies/quiet-release.js.map +1 -0
- package/daemon/dist/domain/policies/types.d.ts +25 -0
- package/daemon/dist/domain/policies/types.d.ts.map +1 -1
- package/daemon/dist/domain/policies/workflow-keepalive.d.ts +6 -1
- package/daemon/dist/domain/policies/workflow-keepalive.d.ts.map +1 -1
- package/daemon/dist/domain/policies/workflow-keepalive.js +11 -5
- package/daemon/dist/domain/policies/workflow-keepalive.js.map +1 -1
- package/daemon/dist/domain/profile-resolution-worker.d.ts +7 -0
- package/daemon/dist/domain/profile-resolution-worker.d.ts.map +1 -0
- package/daemon/dist/domain/profile-resolution-worker.js +83 -0
- package/daemon/dist/domain/profile-resolution-worker.js.map +1 -0
- package/daemon/dist/domain/profile-resolver.d.ts +6 -0
- package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
- package/daemon/dist/domain/profile-resolver.js +20 -3
- package/daemon/dist/domain/profile-resolver.js.map +1 -1
- package/daemon/dist/domain/project-classifier.d.ts +7 -0
- package/daemon/dist/domain/project-classifier.d.ts.map +1 -1
- package/daemon/dist/domain/project-classifier.js +26 -0
- package/daemon/dist/domain/project-classifier.js.map +1 -1
- package/daemon/dist/domain/proof/source-watch.js +2 -2
- package/daemon/dist/domain/proof/source-watch.js.map +1 -1
- package/daemon/dist/domain/provider/subscription-move-report.d.ts +86 -0
- package/daemon/dist/domain/provider/subscription-move-report.d.ts.map +1 -0
- package/daemon/dist/domain/provider/subscription-move-report.js +227 -0
- package/daemon/dist/domain/provider/subscription-move-report.js.map +1 -0
- package/daemon/dist/domain/ps-projection.d.ts +6 -35
- package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
- package/daemon/dist/domain/ps-projection.js +14 -55
- package/daemon/dist/domain/ps-projection.js.map +1 -1
- package/daemon/dist/domain/queue-destination-check.d.ts +6 -0
- package/daemon/dist/domain/queue-destination-check.d.ts.map +1 -0
- package/daemon/dist/domain/queue-destination-check.js +35 -0
- package/daemon/dist/domain/queue-destination-check.js.map +1 -0
- package/daemon/dist/domain/queue-owner.d.ts +6 -3
- package/daemon/dist/domain/queue-owner.d.ts.map +1 -1
- package/daemon/dist/domain/queue-owner.js +12 -6
- package/daemon/dist/domain/queue-owner.js.map +1 -1
- package/daemon/dist/domain/queue-pickup.d.ts +5 -2
- package/daemon/dist/domain/queue-pickup.d.ts.map +1 -1
- package/daemon/dist/domain/queue-pickup.js +19 -2
- package/daemon/dist/domain/queue-pickup.js.map +1 -1
- package/daemon/dist/domain/queue-recovery.d.ts +1 -1
- package/daemon/dist/domain/queue-recovery.d.ts.map +1 -1
- package/daemon/dist/domain/queue-recovery.js +3 -2
- package/daemon/dist/domain/queue-recovery.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +146 -72
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +505 -169
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-retention.d.ts +18 -0
- package/daemon/dist/domain/queue-retention.d.ts.map +1 -1
- package/daemon/dist/domain/queue-retention.js +74 -0
- package/daemon/dist/domain/queue-retention.js.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts +15 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +132 -16
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/queue-transition-log.d.ts +5 -0
- package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
- package/daemon/dist/domain/queue-transition-log.js +25 -8
- package/daemon/dist/domain/queue-transition-log.js.map +1 -1
- package/daemon/dist/domain/queue-wait-backoff.d.ts +3 -0
- package/daemon/dist/domain/queue-wait-backoff.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wait-backoff.js +9 -0
- package/daemon/dist/domain/queue-wait-backoff.js.map +1 -1
- package/daemon/dist/domain/queue-waiting.d.ts +2 -0
- package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
- package/daemon/dist/domain/queue-waiting.js.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.d.ts +2 -0
- package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +112 -17
- package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
- package/daemon/dist/domain/quiet-hold-custody.d.ts +24 -0
- package/daemon/dist/domain/quiet-hold-custody.d.ts.map +1 -0
- package/daemon/dist/domain/quiet-hold-custody.js +85 -0
- package/daemon/dist/domain/quiet-hold-custody.js.map +1 -0
- package/daemon/dist/domain/reconciler.d.ts +23 -0
- package/daemon/dist/domain/reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/reconciler.js +44 -1
- package/daemon/dist/domain/reconciler.js.map +1 -1
- package/daemon/dist/domain/rehydrate-eligibility.d.ts +12 -1
- package/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
- package/daemon/dist/domain/rehydrate-eligibility.js +47 -10
- package/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
- package/daemon/dist/domain/restore-guidance.d.ts +7 -0
- package/daemon/dist/domain/restore-guidance.d.ts.map +1 -1
- package/daemon/dist/domain/restore-guidance.js +20 -8
- package/daemon/dist/domain/restore-guidance.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +24 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +295 -41
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.d.ts +10 -3
- package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.js +56 -18
- package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
- package/daemon/dist/domain/restore-policy.d.ts +4 -0
- package/daemon/dist/domain/restore-policy.d.ts.map +1 -1
- package/daemon/dist/domain/restore-policy.js +11 -0
- package/daemon/dist/domain/restore-policy.js.map +1 -1
- package/daemon/dist/domain/review/gather.d.ts.map +1 -1
- package/daemon/dist/domain/review/gather.js +8 -5
- package/daemon/dist/domain/review/gather.js.map +1 -1
- package/daemon/dist/domain/rig-edge-ops.d.ts +58 -0
- package/daemon/dist/domain/rig-edge-ops.d.ts.map +1 -0
- package/daemon/dist/domain/rig-edge-ops.js +113 -0
- package/daemon/dist/domain/rig-edge-ops.js.map +1 -0
- package/daemon/dist/domain/rig-mode/operating-posture.d.ts.map +1 -1
- package/daemon/dist/domain/rig-mode/operating-posture.js +3 -1
- package/daemon/dist/domain/rig-mode/operating-posture.js.map +1 -1
- package/daemon/dist/domain/rig-name-override.d.ts +14 -0
- package/daemon/dist/domain/rig-name-override.d.ts.map +1 -0
- package/daemon/dist/domain/rig-name-override.js +38 -0
- package/daemon/dist/domain/rig-name-override.js.map +1 -0
- package/daemon/dist/domain/rig-repository.d.ts +19 -1
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +41 -3
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rig-status-compose.d.ts +1 -1
- package/daemon/dist/domain/rig-status-compose.d.ts.map +1 -1
- package/daemon/dist/domain/rig-status-compose.js +3 -1
- package/daemon/dist/domain/rig-status-compose.js.map +1 -1
- package/daemon/dist/domain/rig-teardown.d.ts +19 -0
- package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
- package/daemon/dist/domain/rig-teardown.js +109 -12
- package/daemon/dist/domain/rig-teardown.js.map +1 -1
- package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-codec.js +10 -0
- package/daemon/dist/domain/rigspec-codec.js.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.d.ts +3 -0
- package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.js +22 -0
- package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts +39 -2
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +319 -73
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.js +15 -2
- package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
- package/daemon/dist/domain/rigspec-schema.d.ts +8 -0
- package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-schema.js +97 -3
- package/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/daemon/dist/domain/runtime-adapter.d.ts +47 -3
- package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-adapter.js +5 -1
- package/daemon/dist/domain/runtime-adapter.js.map +1 -1
- package/daemon/dist/domain/scope/scope-view-projection.d.ts +6 -0
- package/daemon/dist/domain/scope/scope-view-projection.d.ts.map +1 -1
- package/daemon/dist/domain/scope/scope-view-projection.js +26 -10
- package/daemon/dist/domain/scope/scope-view-projection.js.map +1 -1
- package/daemon/dist/domain/seat-activity-service.d.ts +22 -5
- package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-activity-service.js +137 -62
- package/daemon/dist/domain/seat-activity-service.js.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.d.ts +27 -1
- package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.js +63 -7
- package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.d.ts +20 -1
- package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.js +87 -16
- package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts +10 -2
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +100 -4
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.js +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-identity-store.d.ts +11 -1
- package/daemon/dist/domain/seat-identity-store.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-store.js +32 -4
- package/daemon/dist/domain/seat-identity-store.js.map +1 -1
- package/daemon/dist/domain/seat-launch-additions.d.ts +115 -0
- package/daemon/dist/domain/seat-launch-additions.d.ts.map +1 -0
- package/daemon/dist/domain/seat-launch-additions.js +439 -0
- package/daemon/dist/domain/seat-launch-additions.js.map +1 -0
- package/daemon/dist/domain/seat-launch-environment.d.ts +1 -1
- package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.js +18 -2
- package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +83 -4
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +202 -12
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.d.ts +33 -14
- package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.js +102 -30
- package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
- package/daemon/dist/domain/seat-skill-apply.d.ts +139 -0
- package/daemon/dist/domain/seat-skill-apply.d.ts.map +1 -0
- package/daemon/dist/domain/seat-skill-apply.js +221 -0
- package/daemon/dist/domain/seat-skill-apply.js.map +1 -0
- package/daemon/dist/domain/seat-skill-storage.d.ts +295 -0
- package/daemon/dist/domain/seat-skill-storage.d.ts.map +1 -0
- package/daemon/dist/domain/seat-skill-storage.js +850 -0
- package/daemon/dist/domain/seat-skill-storage.js.map +1 -0
- package/daemon/dist/domain/seat-status-service.d.ts +9 -0
- package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-status-service.js +15 -3
- package/daemon/dist/domain/seat-status-service.js.map +1 -1
- package/daemon/dist/domain/self-attach-service.d.ts +3 -2
- package/daemon/dist/domain/self-attach-service.d.ts.map +1 -1
- package/daemon/dist/domain/self-attach-service.js +18 -1
- package/daemon/dist/domain/self-attach-service.js.map +1 -1
- package/daemon/dist/domain/services-readiness.d.ts.map +1 -1
- package/daemon/dist/domain/services-readiness.js +14 -3
- package/daemon/dist/domain/services-readiness.js.map +1 -1
- package/daemon/dist/domain/session-registry.d.ts +49 -0
- package/daemon/dist/domain/session-registry.d.ts.map +1 -1
- package/daemon/dist/domain/session-registry.js +137 -0
- package/daemon/dist/domain/session-registry.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +76 -27
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +202 -82
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/skill-catalog.d.ts +16 -0
- package/daemon/dist/domain/skill-catalog.d.ts.map +1 -1
- package/daemon/dist/domain/skill-catalog.js +15 -6
- package/daemon/dist/domain/skill-catalog.js.map +1 -1
- package/daemon/dist/domain/skill-discovery.d.ts +24 -3
- package/daemon/dist/domain/skill-discovery.d.ts.map +1 -1
- package/daemon/dist/domain/skill-discovery.js +85 -12
- package/daemon/dist/domain/skill-discovery.js.map +1 -1
- package/daemon/dist/domain/snapshot-repository.d.ts +1 -0
- package/daemon/dist/domain/snapshot-repository.d.ts.map +1 -1
- package/daemon/dist/domain/snapshot-repository.js +23 -10
- package/daemon/dist/domain/snapshot-repository.js.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.d.ts +47 -5
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +291 -29
- package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/daemon/dist/domain/startup-submission-evidence.d.ts +4 -11
- package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
- package/daemon/dist/domain/startup-submission-evidence.js +11 -17
- package/daemon/dist/domain/startup-submission-evidence.js.map +1 -1
- package/daemon/dist/domain/stream-dispositions.d.ts +51 -0
- package/daemon/dist/domain/stream-dispositions.d.ts.map +1 -0
- package/daemon/dist/domain/stream-dispositions.js +112 -0
- package/daemon/dist/domain/stream-dispositions.js.map +1 -0
- package/daemon/dist/domain/stream-store.d.ts +22 -0
- package/daemon/dist/domain/stream-store.d.ts.map +1 -1
- package/daemon/dist/domain/stream-store.js +49 -6
- package/daemon/dist/domain/stream-store.js.map +1 -1
- package/daemon/dist/domain/stream-subscriptions.d.ts +94 -0
- package/daemon/dist/domain/stream-subscriptions.d.ts.map +1 -0
- package/daemon/dist/domain/stream-subscriptions.js +160 -0
- package/daemon/dist/domain/stream-subscriptions.js.map +1 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts +8 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +6 -1
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts +3 -1
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.js +125 -4
- package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-sessions.d.ts +9 -0
- package/daemon/dist/domain/terminal/herdr-sessions.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/herdr-sessions.js +23 -0
- package/daemon/dist/domain/terminal/herdr-sessions.js.map +1 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts +4 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.d.ts +12 -3
- package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.js +42 -17
- package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
- package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/view-composer.js +1 -0
- package/daemon/dist/domain/terminal/view-composer.js.map +1 -1
- package/daemon/dist/domain/terminal-policy.d.ts +80 -0
- package/daemon/dist/domain/terminal-policy.d.ts.map +1 -0
- package/daemon/dist/domain/terminal-policy.js +117 -0
- package/daemon/dist/domain/terminal-policy.js.map +1 -0
- package/daemon/dist/domain/terminal-seat.d.ts +9 -0
- package/daemon/dist/domain/terminal-seat.d.ts.map +1 -0
- package/daemon/dist/domain/terminal-seat.js +37 -0
- package/daemon/dist/domain/terminal-seat.js.map +1 -0
- package/daemon/dist/domain/topology-converge.d.ts +25 -2
- package/daemon/dist/domain/topology-converge.d.ts.map +1 -1
- package/daemon/dist/domain/topology-converge.js +14 -1
- package/daemon/dist/domain/topology-converge.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +73 -6
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/urgent-line.d.ts +4 -0
- package/daemon/dist/domain/urgent-line.d.ts.map +1 -0
- package/daemon/dist/domain/urgent-line.js +7 -0
- package/daemon/dist/domain/urgent-line.js.map +1 -0
- package/daemon/dist/domain/usage-series.d.ts.map +1 -1
- package/daemon/dist/domain/usage-series.js +6 -2
- package/daemon/dist/domain/usage-series.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-browser.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-browser.js +4 -2
- package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts +3 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.js +106 -8
- package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
- package/daemon/dist/domain/view-projector.d.ts.map +1 -1
- package/daemon/dist/domain/view-projector.js +2 -1
- package/daemon/dist/domain/view-projector.js.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.d.ts +3 -23
- package/daemon/dist/domain/watchdog-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.js +12 -89
- package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
- package/daemon/dist/domain/watchdog-history-log.d.ts +5 -2
- package/daemon/dist/domain/watchdog-history-log.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-history-log.js.map +1 -1
- package/daemon/dist/domain/watchdog-job-update.d.ts +21 -0
- package/daemon/dist/domain/watchdog-job-update.d.ts.map +1 -0
- package/daemon/dist/domain/watchdog-job-update.js +143 -0
- package/daemon/dist/domain/watchdog-job-update.js.map +1 -0
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts +65 -9
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.js +194 -21
- package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts +39 -24
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +89 -55
- package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
- package/daemon/dist/domain/whoami-service.d.ts +2 -0
- package/daemon/dist/domain/whoami-service.d.ts.map +1 -1
- package/daemon/dist/domain/whoami-service.js +23 -6
- package/daemon/dist/domain/whoami-service.js.map +1 -1
- package/daemon/dist/domain/workflow-boot-sweep.d.ts +2 -1
- package/daemon/dist/domain/workflow-boot-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-boot-sweep.js +11 -5
- package/daemon/dist/domain/workflow-boot-sweep.js.map +1 -1
- package/daemon/dist/domain/workflow-exception-escalation.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-exception-escalation.js +9 -4
- package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -1
- package/daemon/dist/domain/workflow-projector.d.ts +5 -2
- package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +21 -9
- package/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-role-context.js +2 -2
- package/daemon/dist/domain/workflow-role-context.js.map +1 -1
- package/daemon/dist/domain/workflow-runtime.d.ts +8 -2
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +32 -7
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/domain/workspace/project-read.d.ts +2 -0
- package/daemon/dist/domain/workspace/project-read.d.ts.map +1 -1
- package/daemon/dist/domain/workspace/project-read.js +10 -1
- package/daemon/dist/domain/workspace/project-read.js.map +1 -1
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +2 -0
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/router-line-surface.d.ts +2 -0
- package/daemon/dist/router-line-surface.d.ts.map +1 -0
- package/daemon/dist/router-line-surface.js +3 -0
- package/daemon/dist/router-line-surface.js.map +1 -0
- package/daemon/dist/routes/activity.d.ts +13 -1
- package/daemon/dist/routes/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +70 -2
- package/daemon/dist/routes/activity.js.map +1 -1
- package/daemon/dist/routes/agent-images.d.ts.map +1 -1
- package/daemon/dist/routes/agent-images.js +12 -2
- package/daemon/dist/routes/agent-images.js.map +1 -1
- package/daemon/dist/routes/attention.d.ts.map +1 -1
- package/daemon/dist/routes/attention.js +30 -3
- package/daemon/dist/routes/attention.js.map +1 -1
- package/daemon/dist/routes/bootstrap-failure-response.js +2 -2
- package/daemon/dist/routes/bootstrap-failure-response.js.map +1 -1
- package/daemon/dist/routes/bundles.js +1 -1
- package/daemon/dist/routes/bundles.js.map +1 -1
- package/daemon/dist/routes/compaction.d.ts.map +1 -1
- package/daemon/dist/routes/compaction.js +38 -12
- package/daemon/dist/routes/compaction.js.map +1 -1
- package/daemon/dist/routes/discovery.js +3 -0
- package/daemon/dist/routes/discovery.js.map +1 -1
- package/daemon/dist/routes/down.js +9 -1
- package/daemon/dist/routes/down.js.map +1 -1
- package/daemon/dist/routes/gateway.d.ts +2 -0
- package/daemon/dist/routes/gateway.d.ts.map +1 -1
- package/daemon/dist/routes/gateway.js +181 -1
- package/daemon/dist/routes/gateway.js.map +1 -1
- package/daemon/dist/routes/hosts.d.ts.map +1 -1
- package/daemon/dist/routes/hosts.js +2 -0
- package/daemon/dist/routes/hosts.js.map +1 -1
- package/daemon/dist/routes/kernel-status.js +6 -1
- package/daemon/dist/routes/kernel-status.js.map +1 -1
- package/daemon/dist/routes/mission-control.d.ts.map +1 -1
- package/daemon/dist/routes/mission-control.js +5 -1
- package/daemon/dist/routes/mission-control.js.map +1 -1
- package/daemon/dist/routes/projects.d.ts.map +1 -1
- package/daemon/dist/routes/projects.js +59 -12
- package/daemon/dist/routes/projects.js.map +1 -1
- package/daemon/dist/routes/proof.js +2 -2
- package/daemon/dist/routes/proof.js.map +1 -1
- package/daemon/dist/routes/provider.d.ts.map +1 -1
- package/daemon/dist/routes/provider.js +87 -73
- package/daemon/dist/routes/provider.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +125 -16
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/rigs.d.ts.map +1 -1
- package/daemon/dist/routes/rigs.js +104 -20
- package/daemon/dist/routes/rigs.js.map +1 -1
- package/daemon/dist/routes/rigspec.d.ts.map +1 -1
- package/daemon/dist/routes/rigspec.js +40 -15
- package/daemon/dist/routes/rigspec.js.map +1 -1
- package/daemon/dist/routes/scopes.d.ts.map +1 -1
- package/daemon/dist/routes/scopes.js +30 -7
- package/daemon/dist/routes/scopes.js.map +1 -1
- package/daemon/dist/routes/seat.d.ts.map +1 -1
- package/daemon/dist/routes/seat.js +21 -5
- package/daemon/dist/routes/seat.js.map +1 -1
- package/daemon/dist/routes/sessions.js +5 -0
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/skills.d.ts.map +1 -1
- package/daemon/dist/routes/skills.js +55 -2
- package/daemon/dist/routes/skills.js.map +1 -1
- package/daemon/dist/routes/stream.d.ts.map +1 -1
- package/daemon/dist/routes/stream.js +62 -13
- package/daemon/dist/routes/stream.js.map +1 -1
- package/daemon/dist/routes/terminal.d.ts.map +1 -1
- package/daemon/dist/routes/terminal.js +20 -11
- package/daemon/dist/routes/terminal.js.map +1 -1
- package/daemon/dist/routes/transcripts.d.ts.map +1 -1
- package/daemon/dist/routes/transcripts.js +7 -3
- package/daemon/dist/routes/transcripts.js.map +1 -1
- package/daemon/dist/routes/transport.d.ts.map +1 -1
- package/daemon/dist/routes/transport.js +25 -3
- package/daemon/dist/routes/transport.js.map +1 -1
- package/daemon/dist/routes/up.js +41 -52
- package/daemon/dist/routes/up.js.map +1 -1
- package/daemon/dist/routes/watchdog.d.ts +1 -0
- package/daemon/dist/routes/watchdog.d.ts.map +1 -1
- package/daemon/dist/routes/watchdog.js +52 -3
- package/daemon/dist/routes/watchdog.js.map +1 -1
- package/daemon/dist/routes/workflow.d.ts.map +1 -1
- package/daemon/dist/routes/workflow.js +24 -13
- package/daemon/dist/routes/workflow.js.map +1 -1
- package/daemon/dist/server.d.ts +2 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +4 -1
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/skill-loadout-surface.d.ts +2 -0
- package/daemon/dist/skill-loadout-surface.d.ts.map +1 -1
- package/daemon/dist/skill-loadout-surface.js +2 -0
- package/daemon/dist/skill-loadout-surface.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +156 -81
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/dist/terminal/TerminalSessionBroker.d.ts.map +1 -1
- package/daemon/dist/terminal/TerminalSessionBroker.js +9 -2
- package/daemon/dist/terminal/TerminalSessionBroker.js.map +1 -1
- package/daemon/docs/reference/a2a-agents.md +343 -0
- package/daemon/docs/reference/acp-agents.md +77 -0
- package/daemon/docs/reference/agent-spec.md +7 -5
- package/daemon/docs/reference/agent-startup-guide.md +46 -0
- package/daemon/docs/reference/agent-state-taxonomy.md +43 -3
- package/daemon/docs/reference/checked-seat-stop.md +11 -0
- package/daemon/docs/reference/community-harness-examples/cursor/cursor.yaml +13 -0
- package/daemon/docs/reference/community-harness-examples/cursor/openrig-cursor-launch +61 -0
- package/daemon/docs/reference/community-harness-examples/hermes/config.yaml.example +18 -0
- package/daemon/docs/reference/community-harness-examples/hermes/hermes.yaml +12 -0
- package/daemon/docs/reference/community-harness-examples/hermes/openrig-hermes-launch +34 -0
- package/daemon/docs/reference/community-harness-examples/openclaw/openclaw.yaml +13 -0
- package/daemon/docs/reference/community-harness-examples/openclaw/openrig-openclaw-launch +38 -0
- package/daemon/docs/reference/community-harness-presets.md +179 -0
- package/daemon/docs/reference/getting-started.md +148 -23
- package/daemon/docs/reference/operation-correlation.md +9 -0
- package/daemon/docs/reference/project-workspace.md +6 -0
- package/daemon/docs/reference/quickstart.md +33 -20
- package/daemon/docs/reference/refocus-channel.md +11 -3
- package/daemon/docs/reference/rig-spec.md +83 -3
- package/daemon/docs/reference/seat-delivery.md +130 -20
- package/daemon/docs/reference/slack-app-setup.md +52 -3
- package/daemon/docs/reference/stream-classifier-worker.md +28 -0
- package/daemon/docs/reference/telemetry.md +3 -0
- package/daemon/docs/reference/terminal-sessions.md +90 -0
- package/daemon/docs/reference/topology-naming.md +1 -1
- package/daemon/docs/reference/whats-new.md +173 -69
- package/daemon/specs/agents/shared/runtime/claude-settings.fragment.json +0 -3
- package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +43 -4
- package/daemon/specs/agents/shared/skills/core/openrig-herdr/SKILL.md +3 -0
- package/daemon/specs/agents/shared/skills/core/openrig-skills/SKILL.md +2 -2
- package/daemon/specs/agents/shared/skills/core/openrig-software-factory/references/worked-example.md +2 -2
- package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +11 -5
- package/daemon/specs/agents/shared/skills/pods/development-team/SKILL.md +2 -0
- package/daemon/specs/agents/shared/skills/pods/development-team/references/refactoring.md +11 -0
- package/daemon/specs/agents/shared/skills/pods/review-team/SKILL.md +46 -96
- package/daemon/specs/agents/shared/skills/process/verification-before-completion/SKILL.md +17 -80
- package/daemon/specs/agents/shared/skills/process/verification-before-completion/references/performance-claims.md +12 -0
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +129 -24
- package/daemon/specs/rigs/launch/kernel/agents/queue/worker/guidance/role.md +11 -0
- package/daemon/specs/rigs/launch/kernel/agents/queue/worker/startup/context.md +3 -1
- package/daemon/specs/rigs/launch/secrets-manager/secrets-manager.compose.yaml +1 -1
- package/dist/acp/connector.d.ts +72 -0
- package/dist/acp/connector.d.ts.map +1 -0
- package/dist/acp/connector.js +218 -0
- package/dist/acp/connector.js.map +1 -0
- package/dist/acp/json-rpc-stdio.d.ts +53 -0
- package/dist/acp/json-rpc-stdio.d.ts.map +1 -0
- package/dist/acp/json-rpc-stdio.js +141 -0
- package/dist/acp/json-rpc-stdio.js.map +1 -0
- package/dist/acp/run-processes.d.ts +10 -0
- package/dist/acp/run-processes.d.ts.map +1 -0
- package/dist/acp/run-processes.js +33 -0
- package/dist/acp/run-processes.js.map +1 -0
- package/dist/build-info.js +3 -3
- package/dist/cli-error.d.ts +4 -0
- package/dist/cli-error.d.ts.map +1 -1
- package/dist/cli-error.js +6 -0
- package/dist/cli-error.js.map +1 -1
- package/dist/client.d.ts +7 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +14 -7
- package/dist/client.js.map +1 -1
- package/dist/commands/acp.d.ts +11 -0
- package/dist/commands/acp.d.ts.map +1 -0
- package/dist/commands/acp.js +198 -0
- package/dist/commands/acp.js.map +1 -0
- package/dist/commands/agent-image.d.ts.map +1 -1
- package/dist/commands/agent-image.js +15 -7
- package/dist/commands/agent-image.js.map +1 -1
- package/dist/commands/archive.d.ts.map +1 -1
- package/dist/commands/archive.js +17 -3
- package/dist/commands/archive.js.map +1 -1
- package/dist/commands/attach.d.ts.map +1 -1
- package/dist/commands/attach.js +7 -5
- package/dist/commands/attach.js.map +1 -1
- package/dist/commands/auth.d.ts +3 -0
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +39 -10
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/broadcast.js +2 -0
- package/dist/commands/broadcast.js.map +1 -1
- package/dist/commands/community-harness.d.ts.map +1 -1
- package/dist/commands/community-harness.js +2 -1
- package/dist/commands/community-harness.js.map +1 -1
- package/dist/commands/compact-plan.d.ts +2 -0
- package/dist/commands/compact-plan.d.ts.map +1 -1
- package/dist/commands/compact-plan.js +40 -4
- package/dist/commands/compact-plan.js.map +1 -1
- package/dist/commands/compact.d.ts.map +1 -1
- package/dist/commands/compact.js +11 -4
- package/dist/commands/compact.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +17 -3
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +16 -9
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/create.js +2 -2
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +2 -0
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/down.d.ts +5 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +87 -3
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/edge.d.ts +4 -0
- package/dist/commands/edge.d.ts.map +1 -0
- package/dist/commands/edge.js +135 -0
- package/dist/commands/edge.js.map +1 -0
- package/dist/commands/expand.d.ts.map +1 -1
- package/dist/commands/expand.js +16 -2
- package/dist/commands/expand.js.map +1 -1
- package/dist/commands/export.d.ts +1 -0
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +60 -2
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/fork.d.ts.map +1 -1
- package/dist/commands/fork.js +22 -3
- package/dist/commands/fork.js.map +1 -1
- package/dist/commands/gateway.d.ts +39 -0
- package/dist/commands/gateway.d.ts.map +1 -1
- package/dist/commands/gateway.js +311 -3
- package/dist/commands/gateway.js.map +1 -1
- package/dist/commands/grow.js +2 -2
- package/dist/commands/grow.js.map +1 -1
- package/dist/commands/health.js +3 -2
- package/dist/commands/health.js.map +1 -1
- package/dist/commands/host.d.ts +1 -1
- package/dist/commands/host.d.ts.map +1 -1
- package/dist/commands/host.js +2 -2
- package/dist/commands/host.js.map +1 -1
- package/dist/commands/launch.d.ts.map +1 -1
- package/dist/commands/launch.js +10 -3
- package/dist/commands/launch.js.map +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +113 -1
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/plugin.d.ts.map +1 -1
- package/dist/commands/plugin.js +2 -1
- package/dist/commands/plugin.js.map +1 -1
- package/dist/commands/project-worker.d.ts +25 -1
- package/dist/commands/project-worker.d.ts.map +1 -1
- package/dist/commands/project-worker.js +9 -7
- package/dist/commands/project-worker.js.map +1 -1
- package/dist/commands/project.d.ts +2 -0
- package/dist/commands/project.d.ts.map +1 -1
- package/dist/commands/project.js +64 -1
- package/dist/commands/project.js.map +1 -1
- package/dist/commands/provider.d.ts.map +1 -1
- package/dist/commands/provider.js +72 -44
- package/dist/commands/provider.js.map +1 -1
- package/dist/commands/ps.d.ts +16 -1
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +145 -52
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.d.ts +7 -1
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +97 -13
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/reconcile-session.d.ts.map +1 -1
- package/dist/commands/reconcile-session.js +6 -0
- package/dist/commands/reconcile-session.js.map +1 -1
- package/dist/commands/release.d.ts.map +1 -1
- package/dist/commands/release.js +16 -2
- package/dist/commands/release.js.map +1 -1
- package/dist/commands/restore-check.d.ts.map +1 -1
- package/dist/commands/restore-check.js +2 -1
- package/dist/commands/restore-check.js.map +1 -1
- package/dist/commands/restore-packet.d.ts.map +1 -1
- package/dist/commands/restore-packet.js +2 -1
- package/dist/commands/restore-packet.js.map +1 -1
- package/dist/commands/restore.d.ts.map +1 -1
- package/dist/commands/restore.js +23 -6
- package/dist/commands/restore.js.map +1 -1
- package/dist/commands/scope.d.ts.map +1 -1
- package/dist/commands/scope.js +5 -2
- package/dist/commands/scope.js.map +1 -1
- package/dist/commands/seat.d.ts +2 -0
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +124 -10
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +87 -56
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/setup.d.ts +27 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +189 -16
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/shrink.d.ts.map +1 -1
- package/dist/commands/shrink.js +16 -2
- package/dist/commands/shrink.js.map +1 -1
- package/dist/commands/skill.d.ts.map +1 -1
- package/dist/commands/skill.js +116 -3
- package/dist/commands/skill.js.map +1 -1
- package/dist/commands/slack.d.ts.map +1 -1
- package/dist/commands/slack.js +11 -24
- package/dist/commands/slack.js.map +1 -1
- package/dist/commands/snapshot.d.ts.map +1 -1
- package/dist/commands/snapshot.js +36 -10
- package/dist/commands/snapshot.js.map +1 -1
- package/dist/commands/specs.d.ts.map +1 -1
- package/dist/commands/specs.js +11 -5
- package/dist/commands/specs.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +54 -35
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +8 -2
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/stream-outcome.d.ts +157 -0
- package/dist/commands/stream-outcome.d.ts.map +1 -0
- package/dist/commands/stream-outcome.js +81 -0
- package/dist/commands/stream-outcome.js.map +1 -0
- package/dist/commands/stream.d.ts.map +1 -1
- package/dist/commands/stream.js +64 -2
- package/dist/commands/stream.js.map +1 -1
- package/dist/commands/terminal.d.ts +1 -0
- package/dist/commands/terminal.d.ts.map +1 -1
- package/dist/commands/terminal.js +35 -6
- package/dist/commands/terminal.js.map +1 -1
- package/dist/commands/topology-default-agent.d.ts +2 -2
- package/dist/commands/topology-default-agent.d.ts.map +1 -1
- package/dist/commands/topology-default-agent.js +5 -3
- package/dist/commands/topology-default-agent.js.map +1 -1
- package/dist/commands/transcript.d.ts.map +1 -1
- package/dist/commands/transcript.js +12 -7
- package/dist/commands/transcript.js.map +1 -1
- package/dist/commands/unarchive.d.ts.map +1 -1
- package/dist/commands/unarchive.js +16 -2
- package/dist/commands/unarchive.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +106 -35
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/walk.d.ts.map +1 -1
- package/dist/commands/walk.js +2 -1
- package/dist/commands/walk.js.map +1 -1
- package/dist/commands/watchdog.d.ts.map +1 -1
- package/dist/commands/watchdog.js +80 -5
- package/dist/commands/watchdog.js.map +1 -1
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +3 -0
- package/dist/commands/whoami.js.map +1 -1
- package/dist/commands/workflow-errors.js +1 -1
- package/dist/commands/workflow-errors.js.map +1 -1
- package/dist/commands/workflow-render.js +4 -4
- package/dist/commands/workflow-render.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +34 -15
- package/dist/commands/workflow.js.map +1 -1
- package/dist/config-store.d.ts +18 -2
- package/dist/config-store.d.ts.map +1 -1
- package/dist/config-store.js +120 -11
- package/dist/config-store.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts +13 -4
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +100 -30
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/daemon-reachability.d.ts +13 -0
- package/dist/daemon-reachability.d.ts.map +1 -1
- package/dist/daemon-reachability.js +28 -0
- package/dist/daemon-reachability.js.map +1 -1
- package/dist/decisions/decisions.d.ts +203 -0
- package/dist/decisions/decisions.d.ts.map +1 -0
- package/dist/decisions/decisions.js +374 -0
- package/dist/decisions/decisions.js.map +1 -0
- package/dist/decisions/stream-consumer.d.ts +255 -0
- package/dist/decisions/stream-consumer.d.ts.map +1 -0
- package/dist/decisions/stream-consumer.js +282 -0
- package/dist/decisions/stream-consumer.js.map +1 -0
- package/dist/decisions/templates.d.ts +8 -0
- package/dist/decisions/templates.d.ts.map +1 -0
- package/dist/decisions/templates.js +34 -0
- package/dist/decisions/templates.js.map +1 -0
- package/dist/fetch-with-timeout.d.ts.map +1 -1
- package/dist/fetch-with-timeout.js +19 -16
- package/dist/fetch-with-timeout.js.map +1 -1
- package/dist/fresh-seat-command.d.ts +18 -0
- package/dist/fresh-seat-command.d.ts.map +1 -0
- package/dist/fresh-seat-command.js +36 -0
- package/dist/fresh-seat-command.js.map +1 -0
- package/dist/front-door.d.ts +4 -0
- package/dist/front-door.d.ts.map +1 -1
- package/dist/front-door.js +8 -4
- package/dist/front-door.js.map +1 -1
- package/dist/host-bindings.d.ts +6 -0
- package/dist/host-bindings.d.ts.map +1 -1
- package/dist/host-bindings.js +23 -13
- package/dist/host-bindings.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lazy-program.d.ts.map +1 -1
- package/dist/lazy-program.js +2 -0
- package/dist/lazy-program.js.map +1 -1
- package/dist/lib/bundle-check.d.ts.map +1 -1
- package/dist/lib/bundle-check.js +13 -5
- package/dist/lib/bundle-check.js.map +1 -1
- package/dist/lib/run-on-host.d.ts +29 -0
- package/dist/lib/run-on-host.d.ts.map +1 -0
- package/dist/lib/run-on-host.js +69 -0
- package/dist/lib/run-on-host.js.map +1 -0
- package/dist/lib/seat-activity.d.ts +17 -0
- package/dist/lib/seat-activity.d.ts.map +1 -0
- package/dist/lib/seat-activity.js +29 -0
- package/dist/lib/seat-activity.js.map +1 -0
- package/dist/local-daemon-owner.d.ts +4 -0
- package/dist/local-daemon-owner.d.ts.map +1 -1
- package/dist/local-daemon-owner.js +1 -1
- package/dist/local-daemon-owner.js.map +1 -1
- package/dist/mcp-http.d.ts +42 -0
- package/dist/mcp-http.d.ts.map +1 -0
- package/dist/mcp-http.js +232 -0
- package/dist/mcp-http.js.map +1 -0
- package/dist/mcp-server.d.ts +30 -2
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +1126 -407
- package/dist/mcp-server.js.map +1 -1
- package/dist/rig-handle.d.ts +18 -1
- package/dist/rig-handle.d.ts.map +1 -1
- package/dist/rig-handle.js +19 -2
- package/dist/rig-handle.js.map +1 -1
- package/dist/seat-launch-additions-lines.d.ts +11 -0
- package/dist/seat-launch-additions-lines.d.ts.map +1 -0
- package/dist/seat-launch-additions-lines.js +14 -0
- package/dist/seat-launch-additions-lines.js.map +1 -0
- package/dist/terminal-window.d.ts +1 -1
- package/dist/terminal-window.d.ts.map +1 -1
- package/dist/terminal-window.js +50 -22
- package/dist/terminal-window.js.map +1 -1
- package/package.json +1 -1
- package/tui/dist/attention/attention-model.d.ts +3 -1
- package/tui/dist/attention/attention-model.d.ts.map +1 -1
- package/tui/dist/attention/attention-model.js +68 -1
- package/tui/dist/attention/attention-model.js.map +1 -1
- package/tui/dist/commands/registry.d.ts.map +1 -1
- package/tui/dist/commands/registry.js +2 -0
- package/tui/dist/commands/registry.js.map +1 -1
- package/tui/dist/config/config-model.d.ts.map +1 -1
- package/tui/dist/config/config-model.js +3 -1
- package/tui/dist/config/config-model.js.map +1 -1
- package/tui/dist/connections/connections-model.d.ts +0 -5
- package/tui/dist/connections/connections-model.d.ts.map +1 -1
- package/tui/dist/connections/connections-model.js +1 -1
- package/tui/dist/connections/connections-model.js.map +1 -1
- package/tui/dist/daemon-client.d.ts +20 -0
- package/tui/dist/daemon-client.d.ts.map +1 -1
- package/tui/dist/daemon-client.js +27 -0
- package/tui/dist/daemon-client.js.map +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +22 -7
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/live.d.ts +10 -1
- package/tui/dist/live.d.ts.map +1 -1
- package/tui/dist/live.js +56 -7
- package/tui/dist/live.js.map +1 -1
- package/tui/dist/main.js +50 -3
- package/tui/dist/main.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +121 -10
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/topology/fixture.js +1 -1
- package/tui/dist/topology/fixture.js.map +1 -1
- package/tui/dist/topology/glyphs.js +1 -1
- package/tui/dist/topology/glyphs.js.map +1 -1
- package/tui/dist/topology/graph-types.d.ts +1 -0
- package/tui/dist/topology/graph-types.d.ts.map +1 -1
- package/tui/dist/types.d.ts +78 -0
- package/tui/dist/types.d.ts.map +1 -1
- package/tui/dist/version-skew.d.ts +24 -0
- package/tui/dist/version-skew.d.ts.map +1 -0
- package/tui/dist/version-skew.js +37 -0
- package/tui/dist/version-skew.js.map +1 -0
- package/ui/dist/assets/{index-CVgod3Pm.js → index-Blg-p32B.js} +92 -92
- package/ui/dist/index.html +1 -1
- package/daemon/dist/domain/provider/subscription-moves.d.ts +0 -77
- package/daemon/dist/domain/provider/subscription-moves.d.ts.map +0 -1
- package/daemon/dist/domain/provider/subscription-moves.js +0 -140
- package/daemon/dist/domain/provider/subscription-moves.js.map +0 -1
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { readWakeLadderBackstop } from "./queue-wake-ladder.js";
|
|
1
|
+
import { PROMPT_ALERT_TAG, readWakeLadderBackstop } from "./queue-wake-ladder.js";
|
|
2
|
+
import { withUrgentLine } from "./urgent-line.js";
|
|
3
|
+
import { quietCustodyBackstop, quietHoldCustody } from "./quiet-hold-custody.js";
|
|
2
4
|
import { createHash } from "node:crypto";
|
|
3
|
-
import { loadHumanRegistry, resolveRegisteredHumanAddress } from "./gateway/human-registry.js";
|
|
5
|
+
import { loadHumanRegistry, resolveRegisteredHumanAddress, slackSubscriptionFor, withHumanAlertTag } from "./gateway/human-registry.js";
|
|
4
6
|
import { resolveExternal } from "./gateway/external-admission.js";
|
|
5
7
|
import { QueueTransitionLog } from "./queue-transition-log.js";
|
|
6
8
|
import { WAKE_INTENT_PREFIX } from "./outbox-handler.js";
|
|
7
9
|
import { derivePickup } from "./queue-pickup.js";
|
|
8
10
|
import { lastMeaningfulTransition, readWaitingView } from "./queue-waiting.js";
|
|
9
11
|
import { wrapPaneEnvelope } from "../lib/pane-envelope.js";
|
|
12
|
+
import { isBoundTerminalSeat } from "./terminal-seat.js";
|
|
10
13
|
import { renderQueueHandoffNudge } from "./queue-nudge-text.js";
|
|
11
14
|
import { getSelfHostId } from "./hosts/fanout-contract.js";
|
|
12
15
|
import { parseSessionName, isHumanSeatSessionRef } from "./session-name.js";
|
|
13
16
|
import { parseReplyToChoice, formatReplyToChoice, describeReplyToFallback, REPLY_TO_CHOICE_ACTOR } from "./reply-to-choice.js";
|
|
14
17
|
import { classifyDestination } from "./gateway/destination-resolver.js";
|
|
18
|
+
import { effectiveGateRoles } from "./gate-predicate.js";
|
|
15
19
|
import { computeClosureRequiredAt, validateClosure, } from "./hot-potato-enforcer.js";
|
|
16
20
|
import { isHumanSeatSession, validateHumanPark, validateHumanRoute } from "./human-route-enforcer.js";
|
|
17
21
|
import { QueueWakeRepository, USAGE_LIMIT_BLOCKER_TAG, } from "./queue-wake-repository.js";
|
|
@@ -61,6 +65,10 @@ export function hasLiveHumanGate(item) {
|
|
|
61
65
|
return isBlockerLive(item.state) && isHumanSeatSessionRef(item.destinationSession);
|
|
62
66
|
}
|
|
63
67
|
const AUTO_UNPARK_WAKE_TAG = "queue:auto-unpark:blocker";
|
|
68
|
+
/** A durable wake OpenRig's own scheduling triggered (an auto-unpark, a row OpenRig creates), not an agent's create or
|
|
69
|
+
* handoff: it keeps that source when it's replayed later. Send, broadcast, queue create and the cross-host forward never
|
|
70
|
+
* set it from a request; the trusted local outbox recorder (/api/queue/outbox/record) accepts caller tags by design. */
|
|
71
|
+
const WAKE_TRIGGER_OPENRIG_TAG = "queue:wake-trigger:openrig";
|
|
64
72
|
const AUTO_UNPARK_BLOCKER_TAG_PREFIX = "queue:auto-unpark:blocker-ref:";
|
|
65
73
|
/** The actor on the transition routeToFallback writes; the row's own history is how a later reroute finds the line it wrote. */
|
|
66
74
|
const FALLBACK_ACTOR = "system:queue-fallback";
|
|
@@ -123,6 +131,17 @@ export function classifyNudgeFailure(lastNudgeResult) {
|
|
|
123
131
|
return "unknown";
|
|
124
132
|
}
|
|
125
133
|
export const QUEUE_PRIORITIES = ["routine", "urgent", "critical"];
|
|
134
|
+
/** Adds the handoff-successor and updated-since filters both list paths share. */
|
|
135
|
+
function pushFollowThroughFilters(opts, conditions, params) {
|
|
136
|
+
if (opts?.handedOffFrom) {
|
|
137
|
+
conditions.push("handed_off_from = ?");
|
|
138
|
+
params.push(opts.handedOffFrom);
|
|
139
|
+
}
|
|
140
|
+
if (opts?.updatedSince) {
|
|
141
|
+
conditions.push("ts_updated >= ?");
|
|
142
|
+
params.push(opts.updatedSince);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
126
145
|
/** The message a `--wake-after` park timer carries when its owner gives none. */
|
|
127
146
|
export function defaultParkWakeMessage(qitemId) {
|
|
128
147
|
return `Wake timer fired for parked qitem ${qitemId}. Resume the recorded continuation and update the row.`;
|
|
@@ -260,7 +279,7 @@ function detectTable(db, tableName) {
|
|
|
260
279
|
// the compact projection is one thing: present text is shown, and what isn't selected is left out
|
|
261
280
|
// and named in fieldsElided, never backfilled as empty.
|
|
262
281
|
const COMPACT_ELIDED_FIELDS = [
|
|
263
|
-
"body", "evidenceRef", "humanDetail", "waiting", "chainOfRecord", "replyTo", "humanQuestions", "humanAnswers",
|
|
282
|
+
"body", "evidenceRef", "humanDetail", "waiting", "chainOfRecord", "replyTo", "humanQuestions", "humanAnswers", "delegatedDecision",
|
|
264
283
|
];
|
|
265
284
|
function compactRow(item) {
|
|
266
285
|
const row = { ...item, fieldsElided: [...COMPACT_ELIDED_FIELDS] };
|
|
@@ -406,6 +425,7 @@ export class QueueRepository {
|
|
|
406
425
|
* fallback real code rather than a promise in a comment). */
|
|
407
426
|
outbox;
|
|
408
427
|
resolveOccupantGeneration;
|
|
428
|
+
resolveSessionAddresses;
|
|
409
429
|
wakeRepo;
|
|
410
430
|
watchdogJobsRepo;
|
|
411
431
|
/** PL-007 Workspace Primitive — true when migration 038 has applied the
|
|
@@ -418,6 +438,7 @@ export class QueueRepository {
|
|
|
418
438
|
hasHumanIntentColumn;
|
|
419
439
|
hasReplyToColumn;
|
|
420
440
|
hasHumanQuestionsColumn;
|
|
441
|
+
hasDelegatedDecisionColumn;
|
|
421
442
|
hasEvidenceRefColumn;
|
|
422
443
|
hasMintingGenColumn;
|
|
423
444
|
hasClaimedGenColumn;
|
|
@@ -439,12 +460,14 @@ export class QueueRepository {
|
|
|
439
460
|
this.attachTransport(opts.transport);
|
|
440
461
|
this.workflowFrontierPredicate = opts?.workflowFrontierPredicate;
|
|
441
462
|
this.resolveOccupantGeneration = opts?.resolveOccupantGeneration;
|
|
463
|
+
this.resolveSessionAddresses = opts?.resolveSessionAddresses ?? ((name) => [name]);
|
|
442
464
|
this.loadHumanRegistryFn = opts?.loadHumanRegistry ?? (() => loadHumanRegistry());
|
|
443
465
|
this.hasTargetRepoColumn = detectQueueColumn(db, "target_repo");
|
|
444
466
|
this.hasSummaryColumn = detectQueueColumn(db, "summary");
|
|
445
467
|
this.hasHumanIntentColumn = detectQueueColumn(db, "human_intent");
|
|
446
468
|
this.hasReplyToColumn = detectQueueColumn(db, "reply_to");
|
|
447
469
|
this.hasHumanQuestionsColumn = detectQueueColumn(db, "human_questions");
|
|
470
|
+
this.hasDelegatedDecisionColumn = detectQueueColumn(db, "delegated_decision");
|
|
448
471
|
this.hasEvidenceRefColumn = detectQueueColumn(db, "evidence_ref");
|
|
449
472
|
this.hasQueueTransitionsTable = detectTable(db, "queue_transitions");
|
|
450
473
|
const transitionColumns = this.hasQueueTransitionsTable
|
|
@@ -508,8 +531,8 @@ export class QueueRepository {
|
|
|
508
531
|
}));
|
|
509
532
|
}
|
|
510
533
|
currentWakeIntent(entry) {
|
|
511
|
-
const row = entry.auditPointer ? this.db.prepare("SELECT state FROM queue_items WHERE qitem_id=?").get(entry.auditPointer) : undefined;
|
|
512
|
-
if (row?.state !== "pending")
|
|
534
|
+
const row = entry.auditPointer ? this.db.prepare("SELECT state, destination_session FROM queue_items WHERE qitem_id=?").get(entry.auditPointer) : undefined;
|
|
535
|
+
if (row?.state !== "pending" || row.destination_session !== entry.destinationSession)
|
|
513
536
|
return false;
|
|
514
537
|
const prefix = `${WAKE_INTENT_PREFIX}blocker-`;
|
|
515
538
|
if (!entry.outboxId.startsWith(prefix))
|
|
@@ -522,14 +545,27 @@ export class QueueRepository {
|
|
|
522
545
|
.get(entry.auditPointer);
|
|
523
546
|
return expected === latest?.transition_id;
|
|
524
547
|
}
|
|
548
|
+
/** A wake's source and urgency at the seat's level: the trigger decides the source; the row's priority (urgent or
|
|
549
|
+
* critical) makes it urgent, marked by whoever created the row. */
|
|
550
|
+
wakeAdmission(qitemId, trigger) {
|
|
551
|
+
const row = this.getById(qitemId);
|
|
552
|
+
const urgent = row?.priority === "urgent" || row?.priority === "critical";
|
|
553
|
+
// OpenRig's own row is marked urgent by OpenRig, not by the person whose obligation it's about.
|
|
554
|
+
return { source: trigger, urgent, ...(urgent && row ? { urgentBy: trigger === "openrig" ? "OpenRig" : row.sourceSession } : {}) };
|
|
555
|
+
}
|
|
525
556
|
classifyWakeResult(res) {
|
|
557
|
+
// Held by the seat's hold or interruption level (on purpose; a retry is held again) is the typing guard's; any other
|
|
558
|
+
// retention is the draft-aware delivery's (a draft, an unreadable input, a native prompt), which can clear.
|
|
526
559
|
if (res.outcome === "retained")
|
|
527
|
-
return { classified: "retained", nudgeResult: res.reason
|
|
528
|
-
? "retained:
|
|
560
|
+
return { classified: "retained", nudgeResult: res.reason === "typing_guard_enabled"
|
|
561
|
+
? "retained:typing_guard" : "retained:draft_aware" };
|
|
529
562
|
if (res.ok)
|
|
530
563
|
return res.verified ? { classified: "verified", nudgeResult: "verified" } : { classified: "indeterminate", nudgeResult: "delivered-ack-pending" };
|
|
531
564
|
const detail = res.error ?? res.reason ?? "unknown";
|
|
532
|
-
|
|
565
|
+
// Input evidence survives receipt removal: an issued paste or uncertain Enter is never an unsent failure.
|
|
566
|
+
const inputUncertain = res.sent === true || res.inputPhase === "attempted" || res.inputPhase === "written"
|
|
567
|
+
|| (res.sent !== false && res.inputPhase !== "not_reached" && (res.reason === "delivery_indeterminate" || res.reason === "submit_failed"));
|
|
568
|
+
if (inputUncertain || isWakeTimeoutSignal(res.reason) || isWakeTimeoutSignal(res.error)) {
|
|
533
569
|
return { classified: "indeterminate", nudgeResult: `indeterminate:${detail}` };
|
|
534
570
|
}
|
|
535
571
|
return { classified: "failed", nudgeResult: `failed:${detail}` };
|
|
@@ -566,9 +602,13 @@ export class QueueRepository {
|
|
|
566
602
|
return { kind: "human-required", level: "ALERT" };
|
|
567
603
|
const destinationHuman = resolveRegisteredHumanAddress(input.destinationSession, registry.entities);
|
|
568
604
|
if (input.action === "create" && destinationHuman !== null) {
|
|
605
|
+
// The person's Slack subscription decides: `every-ask` (the default) posts every ask (ALERT); `urgent-only` posts only
|
|
606
|
+
// one marked --alert, and a plain ask lands on Steering and the TUI (RECORD: below the posting dial, so no post is owed).
|
|
607
|
+
const person = registry.entities.find((entity) => entity.address === destinationHuman);
|
|
608
|
+
const posts = input.humanAlert === true || slackSubscriptionFor(person).preset === "every-ask";
|
|
569
609
|
return input.humanIntent === "update"
|
|
570
610
|
? { kind: "human-update", level: "NOTICE" }
|
|
571
|
-
: { kind: "human-required", level: "ALERT" };
|
|
611
|
+
: { kind: "human-required", level: posts ? "ALERT" : "RECORD" };
|
|
572
612
|
}
|
|
573
613
|
return null;
|
|
574
614
|
}
|
|
@@ -590,7 +630,7 @@ export class QueueRepository {
|
|
|
590
630
|
* `nudge:false` intends no wake ⇒ no intent. A missing outbox is enforced by the
|
|
591
631
|
* guard (fail-closed, MF2), not silently skipped here.
|
|
592
632
|
*/
|
|
593
|
-
stageWakeIntent(successorQitemId, fromSession, toSession, identityProvenance, nudge) {
|
|
633
|
+
stageWakeIntent(successorQitemId, fromSession, toSession, identityProvenance, nudge, trigger = "agent") {
|
|
594
634
|
// No wake intended (nudge:false) ⇒ no durable intent to make durable. The
|
|
595
635
|
// W1-c guard is nudge-aware for the same reason: absence of an intent is a
|
|
596
636
|
// defect only when a wake WAS intended.
|
|
@@ -606,7 +646,9 @@ export class QueueRepository {
|
|
|
606
646
|
toSession,
|
|
607
647
|
identityProvenance,
|
|
608
648
|
bareBody: renderQueueHandoffNudge(successorQitemId, successor?.summary),
|
|
609
|
-
tags: successor?.handedOffFrom
|
|
649
|
+
tags: successor?.handedOffFrom || trigger === "openrig"
|
|
650
|
+
? [...(successor?.handedOffFrom ? [`queue:return:${successor.handedOffFrom}`] : []), ...(trigger === "openrig" ? [WAKE_TRIGGER_OPENRIG_TAG] : [])]
|
|
651
|
+
: undefined,
|
|
610
652
|
});
|
|
611
653
|
}
|
|
612
654
|
recordWakeIntent(input) {
|
|
@@ -617,11 +659,15 @@ export class QueueRepository {
|
|
|
617
659
|
const stampISO = new Date().toISOString();
|
|
618
660
|
const genUuid = this.resolveOccupantGeneration?.(input.fromSession) ?? undefined;
|
|
619
661
|
const frozenEnvelope = wrapPaneEnvelope(input.fromSession, input.toSession, input.bareBody, { stampISO, genUuid });
|
|
662
|
+
const admission = this.wakeAdmission(input.auditPointer, input.tags?.includes(WAKE_TRIGGER_OPENRIG_TAG) ? "openrig" : "agent");
|
|
663
|
+
// An urgent wake's frozen body carries the line naming who marked it, so a person reading it held sees it too; the
|
|
664
|
+
// transport won't add it a second time when it's delivered.
|
|
620
665
|
const record = {
|
|
621
666
|
outboxId: input.outboxId, senderSession: input.fromSession, destinationSession: input.toSession,
|
|
622
|
-
body: frozenEnvelope, tags: input.tags, auditPointer: input.auditPointer, identityProvenance: input.identityProvenance,
|
|
667
|
+
body: admission.urgentBy ? withUrgentLine(frozenEnvelope, admission.urgentBy) : frozenEnvelope, tags: input.tags, auditPointer: input.auditPointer, identityProvenance: input.identityProvenance,
|
|
668
|
+
...(admission.urgent ? { urgency: "urgent" } : {}),
|
|
623
669
|
};
|
|
624
|
-
const target = this.transport?.retentionTarget?.(input.toSession);
|
|
670
|
+
const target = this.transport?.retentionTarget?.(input.toSession, admission);
|
|
625
671
|
if (target)
|
|
626
672
|
this.outbox.retain(record, target);
|
|
627
673
|
else {
|
|
@@ -646,7 +692,7 @@ export class QueueRepository {
|
|
|
646
692
|
toSession: input.destinationSession,
|
|
647
693
|
identityProvenance: input.identityProvenance,
|
|
648
694
|
bareBody: `Blocker ${input.blockerQitemId} resolved; parked qitem ${input.qitemId} is pending. Resume the recorded continuation and update the row.`,
|
|
649
|
-
tags: [AUTO_UNPARK_WAKE_TAG, `${AUTO_UNPARK_BLOCKER_TAG_PREFIX}${input.blockerQitemId}`, `queue:return:${input.blockerQitemId}`],
|
|
695
|
+
tags: [AUTO_UNPARK_WAKE_TAG, WAKE_TRIGGER_OPENRIG_TAG, `${AUTO_UNPARK_BLOCKER_TAG_PREFIX}${input.blockerQitemId}`, `queue:return:${input.blockerQitemId}`],
|
|
650
696
|
});
|
|
651
697
|
}
|
|
652
698
|
deliverWakeIntentAfterCommit(outboxId) {
|
|
@@ -690,34 +736,31 @@ export class QueueRepository {
|
|
|
690
736
|
}
|
|
691
737
|
}
|
|
692
738
|
/**
|
|
693
|
-
*
|
|
694
|
-
*
|
|
695
|
-
*
|
|
696
|
-
* second drain of an already-claimed/resolved intent skips. Returns what
|
|
697
|
-
* happened for the drain's tally.
|
|
698
|
-
*
|
|
699
|
-
* verified → delivered
|
|
700
|
-
* ok, unverified → indeterminate (ambiguous; never silently delivered/failed)
|
|
701
|
-
* timeout (MF6) → indeterminate (may have landed — not a hard failure)
|
|
702
|
-
* other not-ok/throw→ failed (visible terminal state)
|
|
739
|
+
* Attempt a current committed notification. A live claim, known success or manual
|
|
740
|
+
* hold is left alone; failed/uncertain history permits another attempt. A recovery
|
|
741
|
+
* pass tracks its coalesced members only in memory so each is attempted once per pass.
|
|
703
742
|
*/
|
|
704
|
-
async deliverWakeIntent(outboxId) {
|
|
743
|
+
async deliverWakeIntent(outboxId, attempted = new Set()) {
|
|
705
744
|
if (!this.outbox)
|
|
706
745
|
return "skipped";
|
|
707
746
|
if (!this.transport)
|
|
708
747
|
return "skipped"; // no transport → stays pending for a later drain
|
|
748
|
+
if (attempted.has(outboxId))
|
|
749
|
+
return "skipped";
|
|
709
750
|
const alreadyHeld = this.outbox.getById(outboxId);
|
|
710
751
|
if (alreadyHeld?.deliveryState === "retained" || alreadyHeld?.deliveryState === "retired") {
|
|
711
752
|
if (alreadyHeld.auditPointer)
|
|
712
753
|
this.recordNudgeAttempt(alreadyHeld.auditPointer, "retained:typing_guard");
|
|
713
754
|
return "retained";
|
|
714
755
|
}
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
756
|
+
let recovering = false;
|
|
757
|
+
const claim = (entry) => {
|
|
758
|
+
if (attempted.has(entry.outboxId) || !this.outbox.claimForDelivery(entry.outboxId))
|
|
759
|
+
return false;
|
|
760
|
+
attempted.add(entry.outboxId);
|
|
761
|
+
recovering ||= entry.deliveryState !== "pending";
|
|
762
|
+
return true;
|
|
763
|
+
};
|
|
721
764
|
let superseded = false;
|
|
722
765
|
const actionable = (entry) => {
|
|
723
766
|
const current = this.currentWakeIntent(entry);
|
|
@@ -733,21 +776,35 @@ export class QueueRepository {
|
|
|
733
776
|
};
|
|
734
777
|
const group = this.db.transaction(() => {
|
|
735
778
|
const candidate = this.outbox.getById(outboxId);
|
|
736
|
-
if (!candidate ||
|
|
779
|
+
if (!candidate || !["pending", "failed", "indeterminate"].includes(candidate.deliveryState) || !actionable(candidate))
|
|
737
780
|
return [];
|
|
738
|
-
if (!
|
|
781
|
+
if (!claim(candidate))
|
|
739
782
|
return [];
|
|
740
|
-
const first =
|
|
783
|
+
const first = candidate; // Keep each member's pre-claim uncertainty.
|
|
741
784
|
const intents = [first];
|
|
742
785
|
const correlation = first.tags?.find(tag => tag.startsWith("queue:return:"));
|
|
786
|
+
// Group by outcome at the seat's current level: each member is admitted with its own source and urgency, and only
|
|
787
|
+
// members with the first one's outcome (typed or held) go together. With no level (off, draft-aware), everything is
|
|
788
|
+
// admitted, so a returned result and its resume still go as one send. At a level, a routine wake never rides in on
|
|
789
|
+
// an urgent one, nor an urgent one under a routine one's hold; any other member waits for its own delivery.
|
|
790
|
+
const outcome = (entry) => {
|
|
791
|
+
const trigger = entry.tags?.includes(WAKE_TRIGGER_OPENRIG_TAG) ? "openrig" : "agent";
|
|
792
|
+
const admission = entry.auditPointer ? this.wakeAdmission(entry.auditPointer, trigger) : { source: trigger, urgent: false };
|
|
793
|
+
return this.transport?.retentionTarget?.(entry.destinationSession, { source: admission.source, urgent: admission.urgent }) ? "held" : "typed";
|
|
794
|
+
};
|
|
795
|
+
const firstOutcome = outcome(first);
|
|
743
796
|
if (correlation) {
|
|
744
797
|
const peers = this.db.prepare(`SELECT outbox_id FROM outbox_entries
|
|
745
|
-
WHERE delivery_state
|
|
798
|
+
WHERE delivery_state IN ('pending','failed','indeterminate') AND destination_session = ? AND substr(outbox_id, 1, ?) = ?
|
|
746
799
|
AND EXISTS (SELECT 1 FROM json_each(outbox_entries.tags) WHERE value = ?)
|
|
747
800
|
ORDER BY outbox_id`).all(first.destinationSession, WAKE_INTENT_PREFIX.length, WAKE_INTENT_PREFIX, correlation);
|
|
748
|
-
for (const peer of peers)
|
|
749
|
-
|
|
750
|
-
|
|
801
|
+
for (const peer of peers) {
|
|
802
|
+
const entry = this.outbox.getById(peer.outbox_id);
|
|
803
|
+
if (outcome(entry) !== firstOutcome)
|
|
804
|
+
continue;
|
|
805
|
+
if (actionable(entry) && claim(entry))
|
|
806
|
+
intents.push(entry);
|
|
807
|
+
}
|
|
751
808
|
}
|
|
752
809
|
return intents;
|
|
753
810
|
})();
|
|
@@ -763,11 +820,42 @@ export class QueueRepository {
|
|
|
763
820
|
return "failed";
|
|
764
821
|
}
|
|
765
822
|
const qitemId = intent.auditPointer ?? outboxId;
|
|
766
|
-
//
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
823
|
+
// Preserve the original envelope/source generation; add context without rewriting its stored bytes.
|
|
824
|
+
const recoveryNotice = recovering ? "Recovered queue notification: delivery may repeat after an earlier unconfirmed attempt.\n" : "";
|
|
825
|
+
// The group was formed on the first member's outcome, so its own source and urgency reach that same outcome at the
|
|
826
|
+
// send; the other members' bodies keep their own frozen urgent lines.
|
|
827
|
+
const trigger = group[0].tags?.includes(WAKE_TRIGGER_OPENRIG_TAG) ? "openrig" : "agent";
|
|
828
|
+
// The level can change while this send waits for the seat's lease. Under the lease, each member is admitted again with
|
|
829
|
+
// its own source and urgency; only those with the first member's outcome go with this send, and the others go back
|
|
830
|
+
// to their state before this claim (never marked delivered, held or failed) for their own delivery.
|
|
831
|
+
const released = [];
|
|
832
|
+
const recheckMembers = group.length < 2 ? undefined : (holds, held) => {
|
|
833
|
+
const keep = group.filter((entry, i) => {
|
|
834
|
+
if (i === 0)
|
|
835
|
+
return true;
|
|
836
|
+
const memberTrigger = entry.tags?.includes(WAKE_TRIGGER_OPENRIG_TAG) ? "openrig" : "agent";
|
|
837
|
+
const admission = this.wakeAdmission(entry.auditPointer, memberTrigger);
|
|
838
|
+
return holds({ source: admission.source, urgent: admission.urgent }) === held;
|
|
839
|
+
});
|
|
840
|
+
for (const entry of group) {
|
|
841
|
+
if (keep.includes(entry))
|
|
842
|
+
continue;
|
|
843
|
+
this.db.prepare("UPDATE outbox_entries SET delivery_state = ? WHERE outbox_id = ? AND delivery_state = 'sending'").run(entry.deliveryState, entry.outboxId);
|
|
844
|
+
released.push(entry);
|
|
845
|
+
}
|
|
846
|
+
return { text: recoveryNotice + keep.map(entry => entry.body).join("\n"), outboxIds: keep.map(entry => entry.outboxId) };
|
|
847
|
+
};
|
|
848
|
+
const outcome = await this.performWakeSend(qitemId, intent.destinationSession, intent.senderSession, undefined, recoveryNotice + group.map(entry => entry.body).join("\n"), group.map(entry => entry.outboxId), trigger, recheckMembers);
|
|
849
|
+
let reportedState = outcome.classified === "verified" ? "delivered" : outcome.classified;
|
|
850
|
+
for (const intent of group) {
|
|
851
|
+
if (released.includes(intent))
|
|
852
|
+
continue;
|
|
853
|
+
// A no-write retry cannot settle whether an earlier attempt landed.
|
|
854
|
+
const earlierUnknown = intent.deliveryState === "indeterminate" && outcome.classified === "failed";
|
|
855
|
+
const finalState = earlierUnknown ? "indeterminate" : outcome.classified === "verified" ? "delivered" : outcome.classified;
|
|
856
|
+
const nudgeResult = earlierUnknown ? `indeterminate:earlier delivery unconfirmed; retry ${outcome.nudgeResult}` : outcome.nudgeResult;
|
|
857
|
+
if (earlierUnknown)
|
|
858
|
+
reportedState = "indeterminate";
|
|
771
859
|
const qitemId = intent.auditPointer;
|
|
772
860
|
const blockerRef = intent.tags?.includes(AUTO_UNPARK_WAKE_TAG)
|
|
773
861
|
? intent.tags
|
|
@@ -775,7 +863,7 @@ export class QueueRepository {
|
|
|
775
863
|
?.slice(AUTO_UNPARK_BLOCKER_TAG_PREFIX.length)
|
|
776
864
|
: undefined;
|
|
777
865
|
const wakeEvent = this.db.transaction(() => {
|
|
778
|
-
this.recordNudgeAttempt(qitemId,
|
|
866
|
+
this.recordNudgeAttempt(qitemId, nudgeResult);
|
|
779
867
|
this.outbox.finalizeDelivery(intent.outboxId, finalState);
|
|
780
868
|
if (!blockerRef)
|
|
781
869
|
return null;
|
|
@@ -784,7 +872,7 @@ export class QueueRepository {
|
|
|
784
872
|
qitemId,
|
|
785
873
|
state: item.state,
|
|
786
874
|
actorSession: "queue@system",
|
|
787
|
-
transitionNote: `blocker ${blockerRef} wake attempted; delivery=${
|
|
875
|
+
transitionNote: `blocker ${blockerRef} wake attempted; delivery=${nudgeResult}`,
|
|
788
876
|
});
|
|
789
877
|
this.wakeRepo.record({
|
|
790
878
|
transitionId: transition.transitionId,
|
|
@@ -792,7 +880,7 @@ export class QueueRepository {
|
|
|
792
880
|
phase: "fired",
|
|
793
881
|
kind: "blocker",
|
|
794
882
|
ref: blockerRef,
|
|
795
|
-
deliveryStatus:
|
|
883
|
+
deliveryStatus: nudgeResult,
|
|
796
884
|
});
|
|
797
885
|
return this.eventBus.persistWithinTransaction({
|
|
798
886
|
type: "queue.updated",
|
|
@@ -808,32 +896,18 @@ export class QueueRepository {
|
|
|
808
896
|
if (wakeEvent)
|
|
809
897
|
this.eventBus.notifySubscribers(wakeEvent);
|
|
810
898
|
}
|
|
811
|
-
|
|
899
|
+
// Each released member is delivered on its own now, so this drain finishes only once every member has its outcome.
|
|
900
|
+
// One attempt per member for the whole pass: they inherit this pass's history, less themselves (released before any
|
|
901
|
+
// send, so never attempted), so nothing already sent here is regrouped, and each released member gets one attempt.
|
|
902
|
+
for (const entry of released)
|
|
903
|
+
attempted.delete(entry.outboxId);
|
|
904
|
+
for (const entry of released) {
|
|
905
|
+
await this.deliverWakeIntent(entry.outboxId, attempted).catch((err) => console.error(`Queue wake delivery failed for ${entry.outboxId}:`, err));
|
|
906
|
+
}
|
|
907
|
+
return reportedState;
|
|
812
908
|
}
|
|
813
|
-
/**
|
|
814
|
-
*
|
|
815
|
-
* staged-intent delivery path. When the durable intent store is present
|
|
816
|
-
* (production), deliver the just-committed intent — which CLAIMS and FINALIZES
|
|
817
|
-
* the row, so a later recovery sweep cannot send it a second time. When it is
|
|
818
|
-
* absent (test/bootstrap), fall back to the pre-W1 best-effort nudge so behavior
|
|
819
|
-
* is unchanged where there is no intent to make durable. Called AFTER the
|
|
820
|
-
* terminal transaction commits (reversed-never: a pane write must not join the
|
|
821
|
-
* db transaction).
|
|
822
|
-
*
|
|
823
|
-
* PUBLIC as of P34: every terminal-closing writer that stages an intent must
|
|
824
|
-
* deliver through THIS path rather than {@link maybeNudge}. `maybeNudge` sends
|
|
825
|
-
* WITHOUT claiming or finalizing, so a staged intent would remain `pending` and
|
|
826
|
-
* the startup recovery sweep would deliver the same wake AGAIN. One staged
|
|
827
|
-
* intent, one delivery, one finalized row.
|
|
828
|
-
*
|
|
829
|
-
* P34 correction: the no-outbox fallback above was documented here but never
|
|
830
|
-
* implemented — `deliverWakeIntent` simply returns "skipped" with no outbox
|
|
831
|
-
* attached, so the nudge vanished SILENTLY (a skip is not an error, so nothing
|
|
832
|
-
* surfaced it). The pre-W1 callers reached this path only after the MF2 guard
|
|
833
|
-
* had already proven an outbox was attached, which is why it never showed. P34
|
|
834
|
-
* routes writers here whose harnesses attach no outbox, so the fallback is now
|
|
835
|
-
* real code rather than a promise in a comment.
|
|
836
|
-
*/
|
|
909
|
+
/** Deliver after the queue transaction commits, never from inside it. The shared
|
|
910
|
+
* intent path owns claims and outcomes; without an intent store use the legacy nudge. */
|
|
837
911
|
async deliverWakeForSuccessor(successorQitemId, destinationSession, nudge, sourceSession) {
|
|
838
912
|
if (nudge === false)
|
|
839
913
|
return;
|
|
@@ -846,69 +920,45 @@ export class QueueRepository {
|
|
|
846
920
|
}
|
|
847
921
|
await this.deliverWakeIntent(`${WAKE_INTENT_PREFIX}${successorQitemId}`);
|
|
848
922
|
}
|
|
849
|
-
/**
|
|
850
|
-
*
|
|
851
|
-
* committed-but-undelivered (the terminal txn committed, the process died
|
|
852
|
-
* before the post-commit deliver). Pages in bounded batches and TERMINATES on
|
|
853
|
-
* a served short batch or on a no-progress round (a flapping transport marks
|
|
854
|
-
* rows failed = visible, so it still progresses) — never a silent cap, never a
|
|
855
|
-
* spin.
|
|
856
|
-
*
|
|
857
|
-
* MF6 (honest retry policy): the sweep retries ONLY `pending` rows — i.e. wake
|
|
858
|
-
* intents a crash left committed-but-undelivered. Terminal `failed` and
|
|
859
|
-
* `indeterminate` rows are NOT re-driven: a failed row would risk resurrecting
|
|
860
|
-
* a dead wake and an indeterminate one may already have landed (double-send).
|
|
861
|
-
* Both are left in a VISIBLE terminal state for out-of-band reconciliation. No
|
|
862
|
-
* periodic timer (out of scope, ruled); a bounded retry of failed rows is the
|
|
863
|
-
* NAMED residue, not a silent guarantee.
|
|
864
|
-
*/
|
|
865
|
-
/**
|
|
866
|
-
* BLOCKING 1 (guard re-seal): the recovery-boundary reconciliation, called ONCE
|
|
867
|
-
* at startup (NOT inside the drain, which can be invoked concurrently). Moves any
|
|
868
|
-
* abandoned `sending` wake intents — a prior crashed process's claims — to
|
|
869
|
-
* `indeterminate`, WITHOUT re-sending: a claim left `sending` is ambiguous (the
|
|
870
|
-
* send may or may not have landed). Kept SEPARATE from drainPendingWakeIntents so
|
|
871
|
-
* an overlapping drain can never reconcile another drain's in-flight claim.
|
|
872
|
-
* Returns the count reconciled.
|
|
873
|
-
*/
|
|
923
|
+
/** Once at startup, mark abandoned live claims unknown before recovery makes a
|
|
924
|
+
* new attempt. Never run inside a drain: another drain may still own a live send. */
|
|
874
925
|
reconcileAbandonedWakeIntents() {
|
|
875
926
|
if (!this.outbox)
|
|
876
927
|
return 0;
|
|
877
928
|
return this.outbox.reconcileAbandonedSending(WAKE_INTENT_PREFIX);
|
|
878
929
|
}
|
|
930
|
+
/** Recover current notifications once per pass. A snapshot horizon and seek cursor
|
|
931
|
+
* prevent new arrivals or persistent failures from making this pass unbounded. */
|
|
879
932
|
async drainPendingWakeIntents() {
|
|
880
933
|
const tally = { delivered: 0, indeterminate: 0, failed: 0, retained: 0 };
|
|
881
934
|
if (!this.outbox || !this.transport)
|
|
882
935
|
return tally;
|
|
883
936
|
const BATCH = 200;
|
|
937
|
+
const horizon = this.db.prepare("SELECT COALESCE(MAX(rowid),0) AS id FROM outbox_entries").get().id;
|
|
938
|
+
// Retire never-attempted obsolete notifications without materializing historical intents.
|
|
939
|
+
tally.failed += this.db.prepare(`UPDATE outbox_entries AS o SET delivery_state = 'failed',
|
|
940
|
+
tags = json_insert(COALESCE(tags, '[]'), '$[#]', 'queue:wake-superseded')
|
|
941
|
+
WHERE delivery_state = 'pending' AND rowid <= ? AND substr(outbox_id, 1, ?) = ?
|
|
942
|
+
AND NOT EXISTS (SELECT 1 FROM queue_items q WHERE q.qitem_id = o.audit_pointer
|
|
943
|
+
AND q.state = 'pending' AND q.destination_session = o.destination_session)`)
|
|
944
|
+
.run(horizon, WAKE_INTENT_PREFIX.length, WAKE_INTENT_PREFIX).changes;
|
|
945
|
+
const attempted = new Set();
|
|
946
|
+
let cursor = 0;
|
|
884
947
|
for (;;) {
|
|
885
|
-
const pending = this.
|
|
948
|
+
const pending = this.db.prepare(`SELECT o.rowid AS id, o.outbox_id FROM outbox_entries o
|
|
949
|
+
JOIN queue_items q ON q.qitem_id = o.audit_pointer AND q.state = 'pending'
|
|
950
|
+
AND q.destination_session = o.destination_session
|
|
951
|
+
WHERE o.rowid > ? AND o.rowid <= ? AND substr(o.outbox_id, 1, ?) = ?
|
|
952
|
+
AND o.delivery_state IN ('pending','failed','indeterminate') ORDER BY o.rowid LIMIT ?`)
|
|
953
|
+
.all(cursor, horizon, WAKE_INTENT_PREFIX.length, WAKE_INTENT_PREFIX, BATCH);
|
|
886
954
|
if (pending.length === 0)
|
|
887
955
|
break;
|
|
888
|
-
let progressed = 0;
|
|
889
956
|
for (const intent of pending) {
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
}
|
|
895
|
-
else if (outcome === "indeterminate") {
|
|
896
|
-
tally.indeterminate++;
|
|
897
|
-
progressed++;
|
|
898
|
-
}
|
|
899
|
-
else if (outcome === "failed") {
|
|
900
|
-
tally.failed++;
|
|
901
|
-
progressed++;
|
|
902
|
-
}
|
|
903
|
-
else if (outcome === "retained") {
|
|
904
|
-
tally.retained++;
|
|
905
|
-
progressed++;
|
|
906
|
-
}
|
|
957
|
+
cursor = intent.id;
|
|
958
|
+
const outcome = await this.deliverWakeIntent(intent.outbox_id, attempted);
|
|
959
|
+
if (outcome !== "skipped")
|
|
960
|
+
tally[outcome]++;
|
|
907
961
|
}
|
|
908
|
-
// Nothing left pending changed state this round (e.g. transport gone
|
|
909
|
-
// mid-sweep) — stop rather than spin; the next daemon start retries.
|
|
910
|
-
if (progressed === 0)
|
|
911
|
-
break;
|
|
912
962
|
if (pending.length < BATCH)
|
|
913
963
|
break; // served short batch ⇒ drained
|
|
914
964
|
}
|
|
@@ -936,14 +986,23 @@ export class QueueRepository {
|
|
|
936
986
|
* copies were deleted, refused at the seat boundary instead); this
|
|
937
987
|
* site holds no copy of its own.
|
|
938
988
|
*/
|
|
939
|
-
async maybeNudge(qitemId, destinationSession, nudgeOpt, sourceSession, bodyOverride) {
|
|
989
|
+
async maybeNudge(qitemId, destinationSession, nudgeOpt, sourceSession, bodyOverride, trigger = "agent") {
|
|
940
990
|
if (nudgeOpt === false)
|
|
941
991
|
return;
|
|
942
992
|
if (!this.transport)
|
|
943
993
|
return;
|
|
944
|
-
const outcome = await this.performWakeSend(qitemId, destinationSession, sourceSession, bodyOverride);
|
|
994
|
+
const outcome = await this.performWakeSend(qitemId, destinationSession, sourceSession, bodyOverride, undefined, undefined, trigger);
|
|
945
995
|
this.recordNudgeAttempt(qitemId, outcome.nudgeResult);
|
|
946
996
|
}
|
|
997
|
+
/** The following startup intent drain owns durable pending wakes. Legacy packets
|
|
998
|
+
* and overdue claimed work (not eligible for that drain) still use the nudge path. */
|
|
999
|
+
async recoverLostNudge(qitemId, destinationSession, sourceSession) {
|
|
1000
|
+
const outboxId = `${WAKE_INTENT_PREFIX}${qitemId}`;
|
|
1001
|
+
if (this.outbox?.getById(outboxId) && this.getById(qitemId)?.state === "pending")
|
|
1002
|
+
return;
|
|
1003
|
+
// Boot recovery is OpenRig's own scheduling, whoever created the row.
|
|
1004
|
+
await this.maybeNudge(qitemId, destinationSession, undefined, sourceSession, undefined, "openrig");
|
|
1005
|
+
}
|
|
947
1006
|
/**
|
|
948
1007
|
* W1 (transactional closure): the shared wake-send CORE. Builds the pane
|
|
949
1008
|
* envelope, sends with verify, and CLASSIFIES the transport result into the W1
|
|
@@ -957,7 +1016,7 @@ export class QueueRepository {
|
|
|
957
1016
|
* (the "delivered-ack-pending" nudge literal). It is never promoted to
|
|
958
1017
|
* delivered nor demoted to failed.
|
|
959
1018
|
*/
|
|
960
|
-
async performWakeSend(qitemId, destinationSession, sourceSession, bodyOverride, prebuiltText, committedOutboxIds) {
|
|
1019
|
+
async performWakeSend(qitemId, destinationSession, sourceSession, bodyOverride, prebuiltText, committedOutboxIds, trigger = "agent", recheckMembers) {
|
|
961
1020
|
// DEFECT FIX qitem-20260827065907-b9ae334c (S1-class, 3 live specimens): a virtual
|
|
962
1021
|
// @external destination has NO pane — the queue row ITSELF is the gateway
|
|
963
1022
|
// subsystem's input (the Slack connector polls human-destined rows and its own
|
|
@@ -987,6 +1046,16 @@ export class QueueRepository {
|
|
|
987
1046
|
if (destClass.class === "unroutable") {
|
|
988
1047
|
return { classified: "failed", nudgeResult: destClass.teaching };
|
|
989
1048
|
}
|
|
1049
|
+
// A terminal seat runs a shell or a TUI, not an agent. Typed wake text would run there as a
|
|
1050
|
+
// command line (it carries the row's summary), and nothing there can claim the row. So nothing
|
|
1051
|
+
// is typed; the row stays queued and visible. `failed:` keeps it on the wake ladder, whose
|
|
1052
|
+
// retries come back here and type nothing before it escalates.
|
|
1053
|
+
if (isBoundTerminalSeat(this.db, destinationSession)) {
|
|
1054
|
+
return {
|
|
1055
|
+
classified: "failed",
|
|
1056
|
+
nudgeResult: `failed:terminal-seat: '${destinationSession}' is a terminal seat (runtime: terminal), not an agent, so no wake was typed into it and nothing there can claim this row. The row stays queued; route it to an agent seat.`,
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
990
1059
|
const stampISO = new Date().toISOString();
|
|
991
1060
|
let text;
|
|
992
1061
|
if (prebuiltText !== undefined) {
|
|
@@ -1016,7 +1085,11 @@ export class QueueRepository {
|
|
|
1016
1085
|
text = held.body;
|
|
1017
1086
|
}
|
|
1018
1087
|
try {
|
|
1019
|
-
const
|
|
1088
|
+
const admission = this.wakeAdmission(qitemId, trigger);
|
|
1089
|
+
const res = await this.transport.send(destinationSession, text, { verify: true, stampISO, actorSession: sourceSession, committedOutboxIds,
|
|
1090
|
+
deliveryId: committedOutboxIds ? undefined : deliveryId, auditPointer: qitemId, queueWake: true,
|
|
1091
|
+
...(trigger === "openrig" ? { openrigNotice: true } : {}), ...(admission.urgentBy ? { urgent: { by: admission.urgentBy } } : {}),
|
|
1092
|
+
...(recheckMembers ? { recheckMembers } : {}) });
|
|
1020
1093
|
// OPR.0.3.2.21.FR-4(c) — wording rename: the prior literal
|
|
1021
1094
|
// "sent-unverified" read as a failure even in the common case
|
|
1022
1095
|
// (delivery confirmed but the synchronous ack window expired,
|
|
@@ -1039,6 +1112,30 @@ export class QueueRepository {
|
|
|
1039
1112
|
return { classified: "failed", nudgeResult: `failed:${msg}` };
|
|
1040
1113
|
}
|
|
1041
1114
|
}
|
|
1115
|
+
/** First committed return of a direct ask, including pre-shared-ID Slack replies. */
|
|
1116
|
+
getHumanAnswer(qitemId, actorSession) {
|
|
1117
|
+
const ask = this.getById(qitemId);
|
|
1118
|
+
if (!this.hasReplyToColumn || !ask || ask.destinationSession !== actorSession
|
|
1119
|
+
|| ask.humanIntent === "update" || !this.isPersonAddress(actorSession))
|
|
1120
|
+
return null;
|
|
1121
|
+
const row = this.db.prepare(`SELECT qitem_id FROM queue_items
|
|
1122
|
+
WHERE reply_to = ? AND source_session = ? AND destination_session = ?
|
|
1123
|
+
AND (EXISTS (SELECT 1 FROM json_each(queue_items.tags) WHERE value = 'human-answer')
|
|
1124
|
+
OR (qitem_id LIKE 'qitem-slack-inbound-%' AND COALESCE(summary, '') NOT LIKE '[Recovered after gap] %'))
|
|
1125
|
+
ORDER BY ts_created, rowid LIMIT 1`).get(qitemId, actorSession, ask.sourceSession);
|
|
1126
|
+
return row ? this.getById(row.qitem_id) : null;
|
|
1127
|
+
}
|
|
1128
|
+
/** The lookup and create's insert run synchronously before its first delivery await.
|
|
1129
|
+
* Every new surface uses the same ID; old IDs and their original bodies remain intact. */
|
|
1130
|
+
async createHumanAnswer(input) {
|
|
1131
|
+
const existing = this.getHumanAnswer(input.inboundReplyTo, input.sourceSession);
|
|
1132
|
+
if (existing)
|
|
1133
|
+
return existing;
|
|
1134
|
+
return this.create({ ...input,
|
|
1135
|
+
qitemId: `qitem-human-answer-${createHash("sha256").update(input.inboundReplyTo).digest("hex").slice(0, 20)}`,
|
|
1136
|
+
tags: [...new Set([...(input.tags ?? []), "human-answer"])],
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1042
1139
|
async create(input) {
|
|
1043
1140
|
// FOUNDER ROOT INVARIANT (2026-08-27, supersedes 51-09 incr 4 / ruling cb19867f Q2):
|
|
1044
1141
|
// a LOCAL write stores the bare transport identity — no self-host suffix inside one
|
|
@@ -1055,7 +1152,7 @@ export class QueueRepository {
|
|
|
1055
1152
|
try {
|
|
1056
1153
|
// A savepoint removes any partial intent when staging fails, while
|
|
1057
1154
|
// preserving ordinary create's existing acceptance of the task.
|
|
1058
|
-
this.db.transaction(() => this.stageWakeIntent(created.qitemId, input.sourceSession, input.destinationSession, input.identityProvenance ?? null, input.nudge))();
|
|
1155
|
+
this.db.transaction(() => this.stageWakeIntent(created.qitemId, input.sourceSession, input.destinationSession, input.identityProvenance ?? null, input.nudge, input.wakeTrigger))();
|
|
1059
1156
|
wakeStaged = true;
|
|
1060
1157
|
}
|
|
1061
1158
|
catch (err) {
|
|
@@ -1116,7 +1213,7 @@ export class QueueRepository {
|
|
|
1116
1213
|
this.deliverWakeIntentAfterCommit(`${WAKE_INTENT_PREFIX}${id}`);
|
|
1117
1214
|
}
|
|
1118
1215
|
else {
|
|
1119
|
-
await this.maybeNudge(id, input.destinationSession, input.nudge, input.sourceSession);
|
|
1216
|
+
await this.maybeNudge(id, input.destinationSession, input.nudge, input.sourceSession, undefined, input.wakeTrigger);
|
|
1120
1217
|
}
|
|
1121
1218
|
return this.getByIdOrThrow(id);
|
|
1122
1219
|
}
|
|
@@ -1207,11 +1304,13 @@ export class QueueRepository {
|
|
|
1207
1304
|
throw new QueueRepositoryError("invalid_human_questions", "humanQuestions require the current queue schema; they were not saved.");
|
|
1208
1305
|
humanQuestions = parsed.questions;
|
|
1209
1306
|
}
|
|
1307
|
+
this.assertHumanAlert(input.humanAlert, input.destinationSession, input.humanIntent);
|
|
1210
1308
|
const id = input.qitemId ?? newQitemId();
|
|
1211
1309
|
const ts = new Date().toISOString();
|
|
1212
1310
|
const priority = input.priority ?? "routine";
|
|
1213
1311
|
const tier = input.tier ?? null;
|
|
1214
|
-
const
|
|
1312
|
+
const taggedAsk = withHumanAlertTag(input.tags, input.humanAlert);
|
|
1313
|
+
const tags = taggedAsk ? JSON.stringify(taggedAsk) : null;
|
|
1215
1314
|
const chain = input.chainOfRecord ? JSON.stringify(input.chainOfRecord) : null;
|
|
1216
1315
|
const expiresAt = input.expiresAt ?? null;
|
|
1217
1316
|
const targetRepo = input.targetRepo ?? null;
|
|
@@ -1251,6 +1350,7 @@ export class QueueRepository {
|
|
|
1251
1350
|
const notification = this.classifyOwnerNotification({
|
|
1252
1351
|
action: "create",
|
|
1253
1352
|
humanIntent: input.humanIntent,
|
|
1353
|
+
humanAlert: input.humanAlert,
|
|
1254
1354
|
destinationSession: input.destinationSession,
|
|
1255
1355
|
nextState: "pending",
|
|
1256
1356
|
});
|
|
@@ -1274,6 +1374,25 @@ export class QueueRepository {
|
|
|
1274
1374
|
});
|
|
1275
1375
|
return { qitemId: id, persistedEvent };
|
|
1276
1376
|
}
|
|
1377
|
+
/** humanAlert marks an ask to a person: a person by address or by the registry (a registered person may be addressed as
|
|
1378
|
+
* their seat), as the classifier reads it, and never an update. */
|
|
1379
|
+
assertHumanAlert(humanAlert, destination, humanIntent) {
|
|
1380
|
+
if (humanAlert != null && typeof humanAlert !== "boolean") {
|
|
1381
|
+
throw new QueueRepositoryError("invalid_human_notification", "humanAlert is true or false.");
|
|
1382
|
+
}
|
|
1383
|
+
if (humanAlert !== true)
|
|
1384
|
+
return;
|
|
1385
|
+
if (!this.isPersonAddress(destination) || humanIntent === "update") {
|
|
1386
|
+
throw new QueueRepositoryError("invalid_human_notification", "humanAlert marks an ask to a person as alert-worthy: it needs a human destination, and an update isn't an ask.");
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
/** A person by address or by the registry: a registered person may be addressed as their seat or an alias. */
|
|
1390
|
+
isPersonAddress(destination) {
|
|
1391
|
+
if (isHumanSeatSessionRef(destination))
|
|
1392
|
+
return true;
|
|
1393
|
+
const registry = this.loadHumanRegistryFn();
|
|
1394
|
+
return registry.ok && resolveRegisteredHumanAddress(destination, registry.entities) !== null;
|
|
1395
|
+
}
|
|
1277
1396
|
validateReplyTo(replyTo, humanIntent) {
|
|
1278
1397
|
if (humanIntent !== "update") {
|
|
1279
1398
|
throw new QueueRepositoryError("reply_to_requires_update", "replyTo is accepted only with humanIntent update; a decision keeps its own thread so its reply stays unambiguous.");
|
|
@@ -1301,12 +1420,14 @@ export class QueueRepository {
|
|
|
1301
1420
|
if (!this.validateRig(input.toSession)) {
|
|
1302
1421
|
throw destinationValidationError("to_session", input.toSession, this.loadHumanRegistryFn);
|
|
1303
1422
|
}
|
|
1423
|
+
this.assertHumanAlert(input.humanAlert, input.toSession);
|
|
1304
1424
|
const newId = newQitemId();
|
|
1305
1425
|
const ts = new Date().toISOString();
|
|
1306
1426
|
const body = input.body ?? source.body;
|
|
1307
1427
|
const priority = input.priority ?? source.priority;
|
|
1308
1428
|
const tier = input.tier ?? source.tier;
|
|
1309
|
-
const
|
|
1429
|
+
const handedTags = withHumanAlertTag(input.tags ?? source.tags, input.humanAlert);
|
|
1430
|
+
const tags = handedTags ? JSON.stringify(handedTags) : null;
|
|
1310
1431
|
const chain = JSON.stringify([...(source.chainOfRecord ?? []), source.qitemId]);
|
|
1311
1432
|
const targetRepo = input.targetRepo === undefined ? source.targetRepo : input.targetRepo;
|
|
1312
1433
|
// OPR.0.4.4.19 FR-4/FR-5 — the handoff authors a NEW qitem; when that
|
|
@@ -1369,6 +1490,7 @@ export class QueueRepository {
|
|
|
1369
1490
|
const successorNotification = this.classifyOwnerNotification({
|
|
1370
1491
|
action: "create",
|
|
1371
1492
|
destinationSession: input.toSession,
|
|
1493
|
+
humanAlert: input.humanAlert,
|
|
1372
1494
|
nextState: "pending",
|
|
1373
1495
|
});
|
|
1374
1496
|
this.transitionLog.append({
|
|
@@ -1450,12 +1572,14 @@ export class QueueRepository {
|
|
|
1450
1572
|
if (!this.validateRig(input.toSession)) {
|
|
1451
1573
|
throw destinationValidationError("to_session", input.toSession, this.loadHumanRegistryFn);
|
|
1452
1574
|
}
|
|
1575
|
+
this.assertHumanAlert(input.humanAlert, input.toSession);
|
|
1453
1576
|
const newId = newQitemId();
|
|
1454
1577
|
const ts = new Date().toISOString();
|
|
1455
1578
|
const body = input.body ?? source.body;
|
|
1456
1579
|
const priority = input.priority ?? source.priority;
|
|
1457
1580
|
const tier = input.tier ?? source.tier;
|
|
1458
|
-
const
|
|
1581
|
+
const handedTags = withHumanAlertTag(input.tags ?? source.tags, input.humanAlert);
|
|
1582
|
+
const tags = handedTags ? JSON.stringify(handedTags) : null;
|
|
1459
1583
|
const chain = JSON.stringify([...(source.chainOfRecord ?? []), source.qitemId]);
|
|
1460
1584
|
const targetRepo = input.targetRepo === undefined ? source.targetRepo : input.targetRepo;
|
|
1461
1585
|
// OPR.0.4.4.19 FR-4/FR-5 — same new-item enforcement as handoff().
|
|
@@ -1515,6 +1639,7 @@ export class QueueRepository {
|
|
|
1515
1639
|
const successorNotification = this.classifyOwnerNotification({
|
|
1516
1640
|
action: "create",
|
|
1517
1641
|
destinationSession: input.toSession,
|
|
1642
|
+
humanAlert: input.humanAlert,
|
|
1518
1643
|
nextState: "pending",
|
|
1519
1644
|
});
|
|
1520
1645
|
this.transitionLog.append({
|
|
@@ -1679,23 +1804,25 @@ export class QueueRepository {
|
|
|
1679
1804
|
* Per PL-004 Phase A § Routes: GET /api/queue/whoami.
|
|
1680
1805
|
*/
|
|
1681
1806
|
whoami(session, opts) {
|
|
1807
|
+
const addresses = this.resolveSessionAddresses(session);
|
|
1808
|
+
const slots = addresses.map(() => "?").join(",");
|
|
1682
1809
|
const limit = Math.max(1, Math.min(opts?.recentLimit ?? 25, 200));
|
|
1683
1810
|
const countByState = (state) => {
|
|
1684
1811
|
const row = this.db
|
|
1685
|
-
.prepare(`SELECT COUNT(*) AS n FROM queue_items WHERE destination_session
|
|
1686
|
-
.get(
|
|
1812
|
+
.prepare(`SELECT COUNT(*) AS n FROM queue_items WHERE destination_session IN (${slots}) AND state = ?`)
|
|
1813
|
+
.get(...addresses, state);
|
|
1687
1814
|
return row.n;
|
|
1688
1815
|
};
|
|
1689
1816
|
const recent = this.db
|
|
1690
1817
|
.prepare(`SELECT * FROM queue_items
|
|
1691
|
-
WHERE destination_session
|
|
1818
|
+
WHERE destination_session IN (${slots})
|
|
1692
1819
|
AND state IN ('pending','in-progress','blocked')
|
|
1693
1820
|
ORDER BY ts_updated DESC
|
|
1694
1821
|
LIMIT ?`)
|
|
1695
|
-
.all(
|
|
1822
|
+
.all(...addresses, limit);
|
|
1696
1823
|
const sourceTotalRow = this.db
|
|
1697
|
-
.prepare(`SELECT COUNT(*) AS n FROM queue_items WHERE source_session
|
|
1698
|
-
.get(
|
|
1824
|
+
.prepare(`SELECT COUNT(*) AS n FROM queue_items WHERE source_session IN (${slots})`)
|
|
1825
|
+
.get(...addresses);
|
|
1699
1826
|
return {
|
|
1700
1827
|
session,
|
|
1701
1828
|
asDestination: {
|
|
@@ -1717,9 +1844,11 @@ export class QueueRepository {
|
|
|
1717
1844
|
* silently degrades into a confident answer. This is that authoritative input.
|
|
1718
1845
|
*/
|
|
1719
1846
|
listInProgressForDestination(session) {
|
|
1847
|
+
const addresses = this.resolveSessionAddresses(session);
|
|
1848
|
+
const slots = addresses.map(() => "?").join(",");
|
|
1720
1849
|
const rows = this.db
|
|
1721
|
-
.prepare(`SELECT * FROM queue_items WHERE destination_session
|
|
1722
|
-
.all(
|
|
1850
|
+
.prepare(`SELECT * FROM queue_items WHERE destination_session IN (${slots}) AND state = 'in-progress'`)
|
|
1851
|
+
.all(...addresses);
|
|
1723
1852
|
return rows.map((r) => this.rowToItem(r));
|
|
1724
1853
|
}
|
|
1725
1854
|
/**
|
|
@@ -1730,7 +1859,7 @@ export class QueueRepository {
|
|
|
1730
1859
|
if (!qitem) {
|
|
1731
1860
|
throw new QueueRepositoryError("qitem_not_found", `qitem ${input.qitemId} not found`);
|
|
1732
1861
|
}
|
|
1733
|
-
if (
|
|
1862
|
+
if (!this.resolveSessionAddresses(input.destinationSession).includes(qitem.destinationSession)) {
|
|
1734
1863
|
throw new QueueRepositoryError("claim_destination_mismatch", `qitem ${input.qitemId} destination is ${qitem.destinationSession}, not ${input.destinationSession}`);
|
|
1735
1864
|
}
|
|
1736
1865
|
if (qitem.state !== "pending" && qitem.state !== "blocked") {
|
|
@@ -1874,6 +2003,11 @@ export class QueueRepository {
|
|
|
1874
2003
|
const result = this.updateInTransactionalContext(input);
|
|
1875
2004
|
return { qitemId: input.qitemId, ...result };
|
|
1876
2005
|
}
|
|
2006
|
+
/** Notify subscribers of events persisted inside a caller's own transaction (updateWithinTransaction), after it commits. */
|
|
2007
|
+
notifyCommitted(events) {
|
|
2008
|
+
for (const event of events)
|
|
2009
|
+
this.eventBus.notifySubscribers(event);
|
|
2010
|
+
}
|
|
1877
2011
|
/** Internal read-only audit pointer for non-state receipts. Never search past a state write. */
|
|
1878
2012
|
retainedClaimBlocker(qitemId) {
|
|
1879
2013
|
const latest = this.transitionLog.listForQitem(qitemId).at(-1);
|
|
@@ -1916,6 +2050,19 @@ export class QueueRepository {
|
|
|
1916
2050
|
|| (input.state !== undefined && input.summary != null)
|
|
1917
2051
|
|| (input.summary != null && !hasValidSummary);
|
|
1918
2052
|
if (disallowed) {
|
|
2053
|
+
// Keep the terminal-park correction visible even when the row is already done.
|
|
2054
|
+
if (input.state === "done" && input.closureReason === "blocked_on") {
|
|
2055
|
+
const validation = validateClosure({
|
|
2056
|
+
state: input.state,
|
|
2057
|
+
closureReason: input.closureReason,
|
|
2058
|
+
closureTarget: input.closureTarget,
|
|
2059
|
+
});
|
|
2060
|
+
if (!validation.ok) {
|
|
2061
|
+
throw new QueueRepositoryError(validation.code, validation.message, {
|
|
2062
|
+
validReasons: validation.validReasons,
|
|
2063
|
+
});
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
1919
2066
|
throw new QueueRepositoryError("note_append_fields_not_admitted", "a state-preserving note append accepts only --note (and an optional same --state); state-write fields were supplied, so nothing was written");
|
|
1920
2067
|
}
|
|
1921
2068
|
if (hasValidSummary) {
|
|
@@ -2030,6 +2177,8 @@ export class QueueRepository {
|
|
|
2030
2177
|
throw new QueueRepositoryError("invalid_human_notification", "An informational delivery cannot become a human approval park; author a separate decision request.");
|
|
2031
2178
|
}
|
|
2032
2179
|
const isHumanPark = input.state === "blocked" && isHumanSeatSession(effectiveBlockedOn);
|
|
2180
|
+
// A done close can also store the artifact the work produced, so the finished row carries its link.
|
|
2181
|
+
const isDoneClose = input.state === "done";
|
|
2033
2182
|
// OPR.0.5.1 slice-51-06 D2 — summary/evidence_ref are persist-able ONLY at a human-seat park
|
|
2034
2183
|
// (see the FR-6 note below). Silently ignoring them on any other transition is a data-loss trap
|
|
2035
2184
|
// (the operator believes the metadata was saved). HARD-REJECT before ANY UPDATE/log/event so the
|
|
@@ -2039,11 +2188,14 @@ export class QueueRepository {
|
|
|
2039
2188
|
const invalidFields = [];
|
|
2040
2189
|
if (input.summary != null)
|
|
2041
2190
|
invalidFields.push("summary");
|
|
2042
|
-
if (input.evidenceRef != null)
|
|
2191
|
+
if (input.evidenceRef != null && !isDoneClose)
|
|
2043
2192
|
invalidFields.push("evidenceRef");
|
|
2044
2193
|
if (invalidFields.length > 0) {
|
|
2045
2194
|
const flags = invalidFields.map((f) => (f === "summary" ? "--summary" : "--evidence-ref")).join(" / ");
|
|
2046
|
-
|
|
2195
|
+
const where = invalidFields.map((f) => f === "summary"
|
|
2196
|
+
? "summary persists on a human-seat park, or on its own (rig queue update <id> --summary … with no --state)"
|
|
2197
|
+
: "evidenceRef persists on a human-seat park or a done close").join("; ");
|
|
2198
|
+
throw new QueueRepositoryError("summary_evidence_not_persistable", `${where}; the '${input.state}' transition cannot store ${invalidFields.length > 1 ? "them" : "it"}. Remove ${flags}, or use one of those.`, { invalidFields });
|
|
2047
2199
|
}
|
|
2048
2200
|
}
|
|
2049
2201
|
// SWEEP-a (shape f2576102) — closure/blocked-field COHERENCE, beside the reference
|
|
@@ -2211,11 +2363,14 @@ export class QueueRepository {
|
|
|
2211
2363
|
.run(input.state, ts, validation.closureReason, validation.closureTarget, input.handedOffTo ?? null, nextBlockedOn, nextResolution, input.qitemId);
|
|
2212
2364
|
// FR-6: park-time summary/evidence_ref are PERSISTED onto the existing
|
|
2213
2365
|
// item (not merely validated-then-dropped) — visible to the attention
|
|
2214
|
-
// query and to Packet 2.
|
|
2366
|
+
// query and to Packet 2. A done close writes evidence_ref the same way.
|
|
2215
2367
|
if (isHumanPark) {
|
|
2216
2368
|
this.persistSummary(input.qitemId, input.summary ?? null);
|
|
2217
2369
|
this.persistEvidenceRef(input.qitemId, input.evidenceRef ?? null);
|
|
2218
2370
|
}
|
|
2371
|
+
else if (isDoneClose) {
|
|
2372
|
+
this.persistEvidenceRef(input.qitemId, input.evidenceRef ?? null);
|
|
2373
|
+
}
|
|
2219
2374
|
const transition = this.transitionLog.append({
|
|
2220
2375
|
qitemId: input.qitemId,
|
|
2221
2376
|
state: input.state,
|
|
@@ -2459,7 +2614,8 @@ export class QueueRepository {
|
|
|
2459
2614
|
/** The parked row an ordinary due park timer reminds about, when its reminder may share one message with other
|
|
2460
2615
|
* reminders due for the same seat in the same scheduler pass: a one-shot `--wake-after` timer serving exactly one
|
|
2461
2616
|
* live parked row, carrying its default message. Null keeps the reminder's own send: a custom message, a shared
|
|
2462
|
-
* or attached watchdog, a repeating wait and a provider-limit timer each deliver as before.
|
|
2617
|
+
* or attached watchdog, a repeating wait and a provider-limit timer each deliver as before. The entry carries the
|
|
2618
|
+
* current park's recorded continuation, or null, for the wake's preview. */
|
|
2463
2619
|
parkReminderDigestEntry(jobId, message) {
|
|
2464
2620
|
const generated = this.wakeRepo.findCurrentQitemsByGeneratedTimer(jobId);
|
|
2465
2621
|
const bound = this.wakeRepo.findBlockedQitemsByWatchdog(jobId, true);
|
|
@@ -2473,7 +2629,7 @@ export class QueueRepository {
|
|
|
2473
2629
|
return null;
|
|
2474
2630
|
if (message !== defaultParkWakeMessage(row.qitemId))
|
|
2475
2631
|
return null;
|
|
2476
|
-
return { qitemId: row.qitemId, summary: row.summary ?? null };
|
|
2632
|
+
return { qitemId: row.qitemId, summary: row.summary ?? null, continuation: this.currentParkContinuation(row.qitemId) };
|
|
2477
2633
|
}
|
|
2478
2634
|
/** Called by the watchdog engine after the delivery attempt is durably
|
|
2479
2635
|
* audited. The queue transition records that attempt independently of
|
|
@@ -2567,7 +2723,7 @@ export class QueueRepository {
|
|
|
2567
2723
|
const item = this.getById(input.qitemId);
|
|
2568
2724
|
if (item?.state !== "pending" || item.humanIntent === "update"
|
|
2569
2725
|
|| item.destinationSession !== input.actorSession
|
|
2570
|
-
||
|
|
2726
|
+
|| !this.isPersonAddress(item.destinationSession))
|
|
2571
2727
|
return null;
|
|
2572
2728
|
const text = input.decision.trim();
|
|
2573
2729
|
const unanswered = this.hasHumanQuestionsColumn && text && text !== "[file reply]"
|
|
@@ -2617,7 +2773,11 @@ export class QueueRepository {
|
|
|
2617
2773
|
if (item.state !== "pending") {
|
|
2618
2774
|
// Slack can redeliver the click that closed it. Only to the asked human, say whether this answer is on record.
|
|
2619
2775
|
const onRecord = item.destinationSession === input.actorSession && item.humanAnswers?.[input.questionId] === input.optionId;
|
|
2620
|
-
|
|
2776
|
+
const delegated = item.destinationSession === input.actorSession ? item.delegatedDecision : null;
|
|
2777
|
+
const decidedForThem = delegated ? { decidedBy: delegated.decidedBy, modeName: delegated.modeName, reversible: delegated.reversible,
|
|
2778
|
+
chose: delegated.choices.map((c) => c.options.find((o) => o.id === c.chosen)?.label ?? c.chosen).join(", ") } : null;
|
|
2779
|
+
return { status: "not-applicable", reason: `state-${item.state}`, ...(onRecord ? { answerOnRecord: true } : {}),
|
|
2780
|
+
...(decidedForThem ? { decidedForThem } : {}) };
|
|
2621
2781
|
}
|
|
2622
2782
|
if (item.destinationSession !== input.actorSession)
|
|
2623
2783
|
return { status: "not-applicable", reason: "not-the-asked-human" };
|
|
@@ -2634,6 +2794,101 @@ export class QueueRepository {
|
|
|
2634
2794
|
return { status: "recorded", answers, complete, questions: item.humanQuestions };
|
|
2635
2795
|
})();
|
|
2636
2796
|
}
|
|
2797
|
+
/**
|
|
2798
|
+
* Record a decision made on the person's behalf, inside their mode's decision room, on the ask's own row. Only the
|
|
2799
|
+
* agent that asked may record it, only on a pending decision to that person, and only while their mode has a stated
|
|
2800
|
+
* decision room, read in the same transaction. A permission prompt or approval gate is never decided this way. It never writes humanAnswers or a
|
|
2801
|
+
* human-decision-resolved notice: the person didn't answer. The ask is closed (done, no follow-on) so it isn't posted
|
|
2802
|
+
* or re-offered, and the asking agent carries on with its choice.
|
|
2803
|
+
*/
|
|
2804
|
+
recordDelegatedDecision(input) {
|
|
2805
|
+
const refuse = (reason, message) => ({ status: "refused", reason, message });
|
|
2806
|
+
if (!this.hasDelegatedDecisionColumn)
|
|
2807
|
+
return refuse("schema", "this daemon's queue schema has no place for a delegated decision");
|
|
2808
|
+
const result = this.db.transaction(() => {
|
|
2809
|
+
const item = this.getById(input.qitemId);
|
|
2810
|
+
if (!item)
|
|
2811
|
+
return refuse("not-found", `qitem ${input.qitemId} not found`);
|
|
2812
|
+
if (item.state !== "pending")
|
|
2813
|
+
return refuse("not-pending", `${input.qitemId} is ${item.state}; only a pending ask can be decided`);
|
|
2814
|
+
const person = parseSessionName(item.destinationSession);
|
|
2815
|
+
if (person.kind !== "external" || item.humanIntent === "update")
|
|
2816
|
+
return refuse("not-a-decision", `${input.qitemId} isn't a decision asked of a person`);
|
|
2817
|
+
// A permission prompt (the wake ladder's prompt alert) or an approval gate (gate work for the human role) is never delegated.
|
|
2818
|
+
if (item.tags?.includes(PROMPT_ALERT_TAG) || effectiveGateRoles({ tags: item.tags, tier: item.tier }).includes("human")) {
|
|
2819
|
+
return refuse("permission-prompt", "a permission prompt or approval gate is never decided on the person's behalf");
|
|
2820
|
+
}
|
|
2821
|
+
// A click keeps a multi-question ask pending until every question is answered: once the person has started, it's theirs.
|
|
2822
|
+
if (item.humanAnswers && Object.keys(item.humanAnswers).length > 0) {
|
|
2823
|
+
return refuse("person-answering", "they've started answering; their answer stands");
|
|
2824
|
+
}
|
|
2825
|
+
if (item.sourceSession !== input.actorSession) {
|
|
2826
|
+
return refuse("not-the-asking-agent", `only the agent that asked (${item.sourceSession}) can record a decision on this ask`);
|
|
2827
|
+
}
|
|
2828
|
+
const app = input.currentApplication(person.local);
|
|
2829
|
+
if (!app)
|
|
2830
|
+
return refuse("no-active-mode", `${person.local} has no mode on, so nothing can be decided for them`);
|
|
2831
|
+
if (app.entityId !== person.local)
|
|
2832
|
+
return refuse("not-the-persons-mode", `that mode is ${app.entityId}'s, not ${person.local}'s`);
|
|
2833
|
+
if (!app.decisionRoom)
|
|
2834
|
+
return refuse("no-decision-room", `${person.local}'s ${app.modeName} has no decision room, so nothing can be decided for them`);
|
|
2835
|
+
if (app.applicationId !== input.expectedApplicationId) {
|
|
2836
|
+
return refuse("mode-changed", "their mode changed since you read the room; read it again");
|
|
2837
|
+
}
|
|
2838
|
+
if (!input.reason.trim())
|
|
2839
|
+
return refuse("invalid-choice", "say why this choice was made");
|
|
2840
|
+
let choices;
|
|
2841
|
+
const questions = item.humanQuestions ?? [];
|
|
2842
|
+
if (questions.length > 0) {
|
|
2843
|
+
const picked = new Map(input.choices.map((c) => [c.questionId ?? "", c.chosen]));
|
|
2844
|
+
if (picked.size !== input.choices.length || questions.some((q) => !picked.has(q.id)) || [...picked.keys()].some((id) => !questions.some((q) => q.id === id))) {
|
|
2845
|
+
return refuse("invalid-choice", `choose one option for each question: ${questions.map((q) => q.id).join(", ")}`);
|
|
2846
|
+
}
|
|
2847
|
+
choices = [];
|
|
2848
|
+
for (const q of questions) {
|
|
2849
|
+
const chosen = picked.get(q.id);
|
|
2850
|
+
if (!q.options.some((o) => o.id === chosen))
|
|
2851
|
+
return refuse("invalid-choice", `"${chosen}" isn't an option of ${q.id}`);
|
|
2852
|
+
choices.push({ questionId: q.id, question: q.question, options: q.options.map((o) => ({ id: o.id, label: o.label })), chosen });
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2855
|
+
else {
|
|
2856
|
+
const chosen = input.choices.length === 1 && !input.choices[0].questionId ? input.choices[0].chosen.trim() : "";
|
|
2857
|
+
if (!chosen)
|
|
2858
|
+
return refuse("invalid-choice", "this ask has no structured questions: give one choice, in words");
|
|
2859
|
+
choices = [{ questionId: null, question: item.summary ?? item.body.slice(0, 200), options: [], chosen }];
|
|
2860
|
+
}
|
|
2861
|
+
const record = {
|
|
2862
|
+
applicationId: app.applicationId, modeName: app.modeName, decisionRoom: app.decisionRoom, decidedBy: input.actorSession,
|
|
2863
|
+
decidedAt: (input.now ?? new Date()).toISOString(), choices, reason: input.reason.trim(), reversible: input.reversible,
|
|
2864
|
+
};
|
|
2865
|
+
this.db.prepare("UPDATE queue_items SET delegated_decision = ? WHERE qitem_id = ?").run(JSON.stringify(record), input.qitemId);
|
|
2866
|
+
const chose = choices.map((c) => `${c.questionId ?? "choice"}=${c.chosen}`).join(", ");
|
|
2867
|
+
const closed = this.updateInTransactionalContext({
|
|
2868
|
+
qitemId: input.qitemId,
|
|
2869
|
+
actorSession: input.actorSession,
|
|
2870
|
+
state: "done",
|
|
2871
|
+
closureReason: "no-follow-on",
|
|
2872
|
+
transitionNote: `delegated-decision application=${app.applicationId} mode=${app.modeName} reversible=${input.reversible} `
|
|
2873
|
+
+ `chose ${chose}: decided on ${person.local}'s behalf by ${input.actorSession}, not answered by them`,
|
|
2874
|
+
});
|
|
2875
|
+
return { status: "closed", events: closed.persistedEvents };
|
|
2876
|
+
})();
|
|
2877
|
+
if (result.status === "refused")
|
|
2878
|
+
return result;
|
|
2879
|
+
for (const event of result.events)
|
|
2880
|
+
this.eventBus.notifySubscribers(event);
|
|
2881
|
+
return { status: "recorded", item: this.getById(input.qitemId) };
|
|
2882
|
+
}
|
|
2883
|
+
/** The decisions made on a person's behalf under one mode application, oldest first: for the account when they're back. */
|
|
2884
|
+
delegatedDecisionsFor(applicationId) {
|
|
2885
|
+
if (!this.hasDelegatedDecisionColumn)
|
|
2886
|
+
return [];
|
|
2887
|
+
const rows = this.db.prepare(`SELECT * FROM queue_items WHERE delegated_decision IS NOT NULL
|
|
2888
|
+
AND json_extract(delegated_decision, '$.applicationId') = ?
|
|
2889
|
+
ORDER BY json_extract(delegated_decision, '$.decidedAt'), qitem_id`).all(applicationId);
|
|
2890
|
+
return rows.map((row) => this.rowToItem(row));
|
|
2891
|
+
}
|
|
2637
2892
|
getById(qitemId) {
|
|
2638
2893
|
const row = this.db
|
|
2639
2894
|
.prepare("SELECT * FROM queue_items WHERE qitem_id = ?")
|
|
@@ -2702,9 +2957,11 @@ export class QueueRepository {
|
|
|
2702
2957
|
/** The parked query's obligation face: open rows to one destination, newest first, without the per-row
|
|
2703
2958
|
* projections list() derives (pickup, waiting view, delivery ledger), which this read never uses. */
|
|
2704
2959
|
listOpenObligations(destinationSession, limit) {
|
|
2960
|
+
const addresses = this.resolveSessionAddresses(destinationSession);
|
|
2961
|
+
const slots = addresses.map(() => "?").join(",");
|
|
2705
2962
|
const rows = this.db.prepare(`SELECT qitem_id, state${this.hasSummaryColumn ? ", summary" : ""} FROM queue_items
|
|
2706
|
-
WHERE destination_session
|
|
2707
|
-
ORDER BY ts_created DESC LIMIT ?`).all(
|
|
2963
|
+
WHERE destination_session IN (${slots}) AND state IN ('pending', 'in-progress', 'blocked')
|
|
2964
|
+
ORDER BY ts_created DESC LIMIT ?`).all(...addresses, limit);
|
|
2708
2965
|
return rows.map((r) => ({ qitemId: r.qitem_id, state: r.state, summary: r.summary ?? null }));
|
|
2709
2966
|
}
|
|
2710
2967
|
list(opts) {
|
|
@@ -2721,19 +2978,23 @@ export class QueueRepository {
|
|
|
2721
2978
|
params.push(`%@${escaped}`, `%@${escaped}`);
|
|
2722
2979
|
}
|
|
2723
2980
|
if (opts?.asSession) {
|
|
2724
|
-
|
|
2725
|
-
|
|
2981
|
+
const addresses = this.resolveSessionAddresses(opts.asSession);
|
|
2982
|
+
const slots = addresses.map(() => "?").join(",");
|
|
2983
|
+
conditions.push(`(destination_session IN (${slots}) OR source_session IN (${slots}))`);
|
|
2984
|
+
params.push(...addresses, ...addresses);
|
|
2726
2985
|
}
|
|
2727
2986
|
if (opts?.activeOnly && !opts?.state) {
|
|
2728
2987
|
conditions.push("state IN ('pending', 'in-progress', 'blocked')");
|
|
2729
2988
|
}
|
|
2730
2989
|
if (opts?.destinationSession) {
|
|
2731
|
-
|
|
2732
|
-
|
|
2990
|
+
const addresses = this.resolveSessionAddresses(opts.destinationSession);
|
|
2991
|
+
conditions.push(`destination_session IN (${addresses.map(() => "?").join(",")})`);
|
|
2992
|
+
params.push(...addresses);
|
|
2733
2993
|
}
|
|
2734
2994
|
if (opts?.sourceSession) {
|
|
2735
|
-
|
|
2736
|
-
|
|
2995
|
+
const addresses = this.resolveSessionAddresses(opts.sourceSession);
|
|
2996
|
+
conditions.push(`source_session IN (${addresses.map(() => "?").join(",")})`);
|
|
2997
|
+
params.push(...addresses);
|
|
2737
2998
|
}
|
|
2738
2999
|
if (opts?.state) {
|
|
2739
3000
|
const states = Array.isArray(opts.state) ? opts.state : [opts.state];
|
|
@@ -2745,6 +3006,7 @@ export class QueueRepository {
|
|
|
2745
3006
|
conditions.push("target_repo = ?");
|
|
2746
3007
|
params.push(opts.targetRepo);
|
|
2747
3008
|
}
|
|
3009
|
+
pushFollowThroughFilters(opts, conditions, params);
|
|
2748
3010
|
const where = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
|
|
2749
3011
|
const columns = opts?.compact ? this.compactColumns() : "*";
|
|
2750
3012
|
const useActiveFirst = !!(opts?.rig || opts?.asSession || opts?.activeOnly);
|
|
@@ -2851,28 +3113,42 @@ export class QueueRepository {
|
|
|
2851
3113
|
// clause: a qitem parked as state=blocked on a HUMAN-seat blocker is a
|
|
2852
3114
|
// decision the human owes. Blocking on another qitem (today's shipped
|
|
2853
3115
|
// usage) does NOT match — is_human_seat_session rejects qitem ids.
|
|
3116
|
+
// An ask to a person lands here by its classification (isCurrentHumanAsk), alerted or not, so one to a registered
|
|
3117
|
+
// person addressed as a seat or an alias is on Steering too; a reroute ends that.
|
|
3118
|
+
const quietAsk = this.hasOwnerNotificationColumns ? `
|
|
3119
|
+
OR EXISTS (SELECT 1 FROM queue_transitions ask
|
|
3120
|
+
WHERE ask.qitem_id = queue_items.qitem_id AND ask.state = 'pending'
|
|
3121
|
+
AND ask.owner_notification_kind = 'human-required'
|
|
3122
|
+
AND ask.transition_id = (SELECT MAX(latest.transition_id) FROM queue_transitions latest
|
|
3123
|
+
WHERE latest.qitem_id = queue_items.qitem_id AND latest.owner_notification_level IS NOT NULL
|
|
3124
|
+
AND latest.owner_notification_kind <> 'human-decision-resolved')
|
|
3125
|
+
AND NOT EXISTS (SELECT 1 FROM queue_transitions moved WHERE moved.qitem_id = ask.qitem_id
|
|
3126
|
+
AND moved.transition_id > ask.transition_id AND moved.transition_note LIKE 'fallback-routed:%'))` : "";
|
|
2854
3127
|
const conditions = [
|
|
2855
3128
|
`state IN (${statePlaceholders})`,
|
|
2856
3129
|
`(
|
|
2857
3130
|
is_human_seat_session(destination_session) = 1
|
|
2858
|
-
OR (state = 'blocked' AND is_human_seat_session(blocked_on) = 1)
|
|
3131
|
+
OR (state = 'blocked' AND is_human_seat_session(blocked_on) = 1)${quietAsk}
|
|
2859
3132
|
)`,
|
|
2860
3133
|
];
|
|
2861
3134
|
if (this.hasHumanIntentColumn)
|
|
2862
3135
|
conditions.push("COALESCE(human_intent, 'decision') <> 'update'");
|
|
2863
3136
|
const params = [...states];
|
|
2864
3137
|
if (opts?.destinationSession) {
|
|
2865
|
-
|
|
2866
|
-
|
|
3138
|
+
const addresses = this.resolveSessionAddresses(opts.destinationSession);
|
|
3139
|
+
conditions.push(`destination_session IN (${addresses.map(() => "?").join(",")})`);
|
|
3140
|
+
params.push(...addresses);
|
|
2867
3141
|
}
|
|
2868
3142
|
if (opts?.sourceSession) {
|
|
2869
|
-
|
|
2870
|
-
|
|
3143
|
+
const addresses = this.resolveSessionAddresses(opts.sourceSession);
|
|
3144
|
+
conditions.push(`source_session IN (${addresses.map(() => "?").join(",")})`);
|
|
3145
|
+
params.push(...addresses);
|
|
2871
3146
|
}
|
|
2872
3147
|
if (opts?.targetRepo && this.hasTargetRepoColumn) {
|
|
2873
3148
|
conditions.push("target_repo = ?");
|
|
2874
3149
|
params.push(opts.targetRepo);
|
|
2875
3150
|
}
|
|
3151
|
+
pushFollowThroughFilters(opts, conditions, params);
|
|
2876
3152
|
params.push(limit);
|
|
2877
3153
|
const sql = `
|
|
2878
3154
|
SELECT * FROM queue_items
|
|
@@ -3121,8 +3397,11 @@ export class QueueRepository {
|
|
|
3121
3397
|
: item.state === "blocked"
|
|
3122
3398
|
? resolveRegisteredHumanAddress(item.blockedOn, registry.entities)
|
|
3123
3399
|
: resolveRegisteredHumanAddress(item.destinationSession, registry.entities);
|
|
3400
|
+
// An ask placed on Steering without an alert (RECORD) owes no post: its ledger reports a real receipt (a posting
|
|
3401
|
+
// dial set to RECORD posts it) and never a missing one.
|
|
3124
3402
|
return humanAddress
|
|
3125
|
-
? { notificationKey: `${item.qitemId}:${transition.transitionId}`, startedAt: transition.ts
|
|
3403
|
+
? { notificationKey: `${item.qitemId}:${transition.transitionId}`, startedAt: transition.ts,
|
|
3404
|
+
...(transition.ownerNotificationLevel === "RECORD" ? { quiet: true } : {}) }
|
|
3126
3405
|
: "inactive";
|
|
3127
3406
|
}
|
|
3128
3407
|
/** OPR.0.5.6.14 — derive the current episode's delivery ledger. Receipt
|
|
@@ -3140,21 +3419,46 @@ export class QueueRepository {
|
|
|
3140
3419
|
humanNotificationPostedThisEpisode(qitemId, listed) {
|
|
3141
3420
|
if (!this.hasQueueTransitionsTable)
|
|
3142
3421
|
return false;
|
|
3143
|
-
// Only the ask's own notification binds a recipient: create writes it in state pending, to the destination of
|
|
3144
|
-
// that moment. A park notice (its recipient is not retained), a resolution notice, or a later destination change
|
|
3145
|
-
// (routeToFallback opens no new episode) cannot establish that the current destination received this ask.
|
|
3146
3422
|
const owners = listed?.owners ?? this.transitionLog.ownerNotificationsForQitems([qitemId]).get(qitemId) ?? [];
|
|
3423
|
+
const owner = this.currentAskNotification(qitemId, owners);
|
|
3424
|
+
if (!owner)
|
|
3425
|
+
return false;
|
|
3426
|
+
// The ledger's episode exists only when the destination resolves to a registered human (aliases included).
|
|
3427
|
+
const ledger = listed ? listed.ledger : this.deliveryLedger(qitemId, owners);
|
|
3428
|
+
return ledger !== null && ledger.outcome === "posted" && ledger.episode?.notificationKey === `${qitemId}:${owner.transitionId}`;
|
|
3429
|
+
}
|
|
3430
|
+
/** The ask's own notification while it still binds its recipient. Only that notification does: create writes it in
|
|
3431
|
+
* state pending, to the destination of that moment. A park notice (its recipient is not retained), a resolution notice,
|
|
3432
|
+
* or a later destination change (routeToFallback opens no new episode) can't establish who has the ask now. */
|
|
3433
|
+
currentAskNotification(qitemId, owners) {
|
|
3147
3434
|
const owner = owners[0];
|
|
3148
3435
|
if (!owner || owner.state !== "pending")
|
|
3149
|
-
return
|
|
3436
|
+
return null;
|
|
3150
3437
|
if (owner.ownerNotificationKind !== "human-required" && owner.ownerNotificationKind !== "human-update")
|
|
3151
|
-
return
|
|
3438
|
+
return null;
|
|
3152
3439
|
const rerouted = this.db.prepare("SELECT 1 FROM queue_transitions WHERE qitem_id = ? AND transition_id > ? AND transition_note LIKE 'fallback-routed:%' LIMIT 1").get(qitemId, owner.transitionId);
|
|
3153
|
-
|
|
3440
|
+
return rerouted ? null : owner;
|
|
3441
|
+
}
|
|
3442
|
+
/** True when this row is an ask to a person that's still theirs: its own create-time human-required notification, at
|
|
3443
|
+
* any level, not rerouted since. Every attention reader (listAttention, the list route, the Feed) uses this one
|
|
3444
|
+
* membership, whatever happened to its Slack post. */
|
|
3445
|
+
isCurrentHumanAsk(qitemId, listed) {
|
|
3446
|
+
if (!this.hasQueueTransitionsTable)
|
|
3154
3447
|
return false;
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3448
|
+
const owners = listed?.owners ?? this.transitionLog.ownerNotificationsForQitems([qitemId]).get(qitemId) ?? [];
|
|
3449
|
+
return this.currentAskNotification(qitemId, owners)?.ownerNotificationKind === "human-required";
|
|
3450
|
+
}
|
|
3451
|
+
/** True when this row's current ask was placed on Steering without a Slack alert (human-required at RECORD) and is still
|
|
3452
|
+
* with that person (not rerouted): it waits on them there by design, like a posted ask, so it isn't stuck and nothing
|
|
3453
|
+
* re-offers it. */
|
|
3454
|
+
humanAskWithoutAlert(qitemId, listed) {
|
|
3455
|
+
if (!this.hasQueueTransitionsTable)
|
|
3456
|
+
return false;
|
|
3457
|
+
const owners = listed?.owners ?? this.transitionLog.ownerNotificationsForQitems([qitemId]).get(qitemId) ?? [];
|
|
3458
|
+
const owner = this.currentAskNotification(qitemId, owners);
|
|
3459
|
+
// Slack never posts a quiet ask; one that was posted anyway is a posted ask, reported by its receipt.
|
|
3460
|
+
return owner?.ownerNotificationKind === "human-required" && owner.ownerNotificationLevel === "RECORD"
|
|
3461
|
+
&& !this.humanNotificationPostedThisEpisode(qitemId, listed);
|
|
3158
3462
|
}
|
|
3159
3463
|
/** owners: the row's owner notifications as ownerNotificationsForQitems gives them, when the caller read them. */
|
|
3160
3464
|
deliveryLedger(qitemId, owners) {
|
|
@@ -3226,6 +3530,8 @@ export class QueueRepository {
|
|
|
3226
3530
|
const failed = currentNotes.find((note) => note.startsWith("slack-owner-notification-transport-failed "));
|
|
3227
3531
|
if (failed)
|
|
3228
3532
|
return { outcome: "transport-failed", detail: failed, episode };
|
|
3533
|
+
if (episode?.quiet)
|
|
3534
|
+
return null;
|
|
3229
3535
|
const startedAt = episode?.startedAt ?? item.tsCreated;
|
|
3230
3536
|
const gatewayRouted = episode !== null || item.lastNudgeResult?.startsWith("gateway-owned") === true;
|
|
3231
3537
|
if (gatewayRouted) {
|
|
@@ -3240,6 +3546,7 @@ export class QueueRepository {
|
|
|
3240
3546
|
/** The grace window before a receiptless gateway-routed row honestly reads
|
|
3241
3547
|
* never-posted (the connector sweep cadence bounds normal posting latency). */
|
|
3242
3548
|
static NEVER_POSTED_WINDOW_MS = 120_000;
|
|
3549
|
+
/** Record one wake attempt. */
|
|
3243
3550
|
recordNudgeAttempt(qitemId, result) {
|
|
3244
3551
|
const ts = new Date().toISOString();
|
|
3245
3552
|
this.db
|
|
@@ -3461,9 +3768,19 @@ export class QueueRepository {
|
|
|
3461
3768
|
if (view && ["pending", "in-progress"].includes(view.state)) {
|
|
3462
3769
|
// #514 — the unclaimed sweep skips a pending ask already posted to its human in the current
|
|
3463
3770
|
// episode (same predicate as runStuckSweep), so the view must not promise that sweep.
|
|
3464
|
-
const
|
|
3771
|
+
const posted = view.state === "pending" && this.humanNotificationPostedThisEpisode(qitemId, listed);
|
|
3772
|
+
const onSteering = !posted && view.state === "pending" && this.humanAskWithoutAlert(qitemId, listed);
|
|
3773
|
+
const awaitingHuman = posted || onSteering;
|
|
3465
3774
|
if (awaitingHuman) {
|
|
3466
|
-
view.nextBackstop = { owner: view.owner, mechanism:
|
|
3775
|
+
view.nextBackstop = { owner: view.owner, mechanism: onSteering
|
|
3776
|
+
? "none (on Steering for the human, with no Slack alert; awaiting their decision)"
|
|
3777
|
+
: "none (posted to the human; awaiting their decision)", dueAt: null, intervalSeconds: null };
|
|
3778
|
+
}
|
|
3779
|
+
// Quiet hours: a held ask is owned by its window's release job until it posts.
|
|
3780
|
+
const quiet = awaitingHuman ? null : quietCustodyBackstop(view.owner, quietHoldCustody(this.db, qitemId));
|
|
3781
|
+
if (quiet) {
|
|
3782
|
+
view.nextBackstop = quiet;
|
|
3783
|
+
return view;
|
|
3467
3784
|
}
|
|
3468
3785
|
const recovery = readWakeLadderBackstop(this.db, qitemId);
|
|
3469
3786
|
if (recovery) {
|
|
@@ -3471,6 +3788,23 @@ export class QueueRepository {
|
|
|
3471
3788
|
view.laterBackstop = { ...view.nextBackstop, note: "Conditional safety net; current delivery/recovery ownership is evaluated first." };
|
|
3472
3789
|
view.nextBackstop = recovery;
|
|
3473
3790
|
}
|
|
3791
|
+
else if (!awaitingHuman && view.state === "pending" && this.db.prepare("SELECT last_nudge_result FROM queue_items WHERE qitem_id = ?")
|
|
3792
|
+
.get(qitemId)?.last_nudge_result === "retained:typing_guard") {
|
|
3793
|
+
// Held at the seat on purpose: not stuck, and not picked up. Nothing replays it; reading or delivering it is a
|
|
3794
|
+
// deliberate step.
|
|
3795
|
+
view.nextBackstop = { owner: view.owner, mechanism: "held by the seat's typing guard", dueAt: null, intervalSeconds: null, held: true,
|
|
3796
|
+
note: `Nothing was typed into ${view.owner}. Read it with rig seat held-messages ${view.owner}; changing the seat's level doesn't replay it.` };
|
|
3797
|
+
}
|
|
3798
|
+
}
|
|
3799
|
+
if (view?.state === "blocked") {
|
|
3800
|
+
// A row parked on a person carries that person's notification, which quiet hours can hold. Its quiet custody is the
|
|
3801
|
+
// next step; the row's blocker is unchanged, and its own timer or wait notice stays as the later backstop.
|
|
3802
|
+
const quiet = quietCustodyBackstop(view.owner, quietHoldCustody(this.db, qitemId));
|
|
3803
|
+
if (quiet) {
|
|
3804
|
+
if (/^(watchdog:|unconsumed wait notice)/.test(view.nextBackstop.mechanism))
|
|
3805
|
+
view.laterBackstop = view.nextBackstop;
|
|
3806
|
+
view.nextBackstop = quiet;
|
|
3807
|
+
}
|
|
3474
3808
|
}
|
|
3475
3809
|
return view;
|
|
3476
3810
|
}
|
|
@@ -3511,6 +3845,7 @@ export class QueueRepository {
|
|
|
3511
3845
|
lastMeaningfulAt: meaningful?.at,
|
|
3512
3846
|
activity: activity?.activity,
|
|
3513
3847
|
needsInput: activity?.needsInput.count,
|
|
3848
|
+
needsInputReason: activity?.needsInput.reason,
|
|
3514
3849
|
claimedAt: row.claimed_at,
|
|
3515
3850
|
lastHeartbeat: row.last_heartbeat,
|
|
3516
3851
|
postClaimMotionCount: 0, // this reader supplies the current meaningful timestamp
|
|
@@ -3546,6 +3881,7 @@ export class QueueRepository {
|
|
|
3546
3881
|
replyTo: row.reply_to ?? null,
|
|
3547
3882
|
humanQuestions: row.human_questions ? JSON.parse(row.human_questions) : null,
|
|
3548
3883
|
humanAnswers: row.human_answers ? JSON.parse(row.human_answers) : null,
|
|
3884
|
+
delegatedDecision: row.delegated_decision ? JSON.parse(row.delegated_decision) : null,
|
|
3549
3885
|
closureReason: row.closure_reason,
|
|
3550
3886
|
closureTarget: row.closure_target,
|
|
3551
3887
|
closureRequiredAt: row.closure_required_at,
|