@openrig/cli 0.7.15 → 0.7.16
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 +5 -5
- package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/README.md +26 -7
- package/daemon/assets/plugins/openrig/plugin.json +1 -1
- 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/skills/claude-compaction-restore/SKILL.md +4 -1
- package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +1 -1
- package/daemon/assets/skills/rigs/SKILL.md +105 -30
- 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 +92 -17
- package/daemon/context-packs/reference/getting-started.md +9 -8
- package/daemon/context-packs/reference/manifest.yaml +4 -1
- package/daemon/context-packs/reference/product-journey-sdlc.md +348 -0
- package/daemon/context-packs/reference/rig-spec.md +92 -4
- package/daemon/context-packs/reference/whats-new.md +210 -5
- 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 +4 -1
- package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
- package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
- package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/seat-continuity-and-handover/SKILL.md +1 -1
- package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
- package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
- package/daemon/context-packs/world-example/manifest.yaml +1 -1
- package/daemon/context-packs/world-public/manifest.yaml +1 -1
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +6 -3
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/codex-resume.d.ts +2 -0
- package/daemon/dist/adapters/codex-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-resume.js +28 -11
- package/daemon/dist/adapters/codex-resume.js.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts +15 -0
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +75 -28
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +3 -0
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +16 -2
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +4 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/167_seat_handover_attempts.d.ts +14 -0
- package/daemon/dist/db/migrations/167_seat_handover_attempts.d.ts.map +1 -0
- package/daemon/dist/db/migrations/167_seat_handover_attempts.js +54 -0
- package/daemon/dist/db/migrations/167_seat_handover_attempts.js.map +1 -0
- package/daemon/dist/db/migrations/169_seat_runtime_home_records.d.ts +5 -0
- package/daemon/dist/db/migrations/169_seat_runtime_home_records.d.ts.map +1 -0
- package/daemon/dist/db/migrations/169_seat_runtime_home_records.js +25 -0
- package/daemon/dist/db/migrations/169_seat_runtime_home_records.js.map +1 -0
- package/daemon/dist/domain/claim-service.d.ts +1 -3
- package/daemon/dist/domain/claim-service.d.ts.map +1 -1
- package/daemon/dist/domain/claim-service.js +3 -1
- package/daemon/dist/domain/claim-service.js.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +11 -0
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +83 -36
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/codex-filesystem-preflight.d.ts +33 -0
- package/daemon/dist/domain/codex-filesystem-preflight.d.ts.map +1 -0
- package/daemon/dist/domain/codex-filesystem-preflight.js +255 -0
- package/daemon/dist/domain/codex-filesystem-preflight.js.map +1 -0
- package/daemon/dist/domain/codex-member-permissions.d.ts +23 -2
- package/daemon/dist/domain/codex-member-permissions.d.ts.map +1 -1
- package/daemon/dist/domain/codex-member-permissions.js +55 -9
- package/daemon/dist/domain/codex-member-permissions.js.map +1 -1
- package/daemon/dist/domain/codex-network-default.d.ts +13 -0
- package/daemon/dist/domain/codex-network-default.d.ts.map +1 -1
- package/daemon/dist/domain/codex-network-default.js +37 -30
- package/daemon/dist/domain/codex-network-default.js.map +1 -1
- package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
- package/daemon/dist/domain/compaction-restore-notice.js +59 -13
- package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
- package/daemon/dist/domain/destination-successor.d.ts +3 -0
- package/daemon/dist/domain/destination-successor.d.ts.map +1 -0
- package/daemon/dist/domain/destination-successor.js +49 -0
- package/daemon/dist/domain/destination-successor.js.map +1 -0
- package/daemon/dist/domain/health-passive-ceremony.d.ts +3 -0
- package/daemon/dist/domain/health-passive-ceremony.d.ts.map +1 -1
- package/daemon/dist/domain/health-passive-ceremony.js +45 -4
- package/daemon/dist/domain/health-passive-ceremony.js.map +1 -1
- package/daemon/dist/domain/hosts/fleet-scopes.d.ts +111 -0
- package/daemon/dist/domain/hosts/fleet-scopes.d.ts.map +1 -0
- package/daemon/dist/domain/hosts/fleet-scopes.js +231 -0
- package/daemon/dist/domain/hosts/fleet-scopes.js.map +1 -0
- package/daemon/dist/domain/hosts/read-through.d.ts +1 -1
- package/daemon/dist/domain/hosts/read-through.d.ts.map +1 -1
- package/daemon/dist/domain/hosts/read-through.js +4 -0
- package/daemon/dist/domain/hosts/read-through.js.map +1 -1
- package/daemon/dist/domain/native-permission-store.d.ts.map +1 -1
- package/daemon/dist/domain/native-permission-store.js +12 -5
- package/daemon/dist/domain/native-permission-store.js.map +1 -1
- package/daemon/dist/domain/native-process-lineage.d.ts +11 -1
- package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
- package/daemon/dist/domain/native-process-lineage.js +25 -4
- package/daemon/dist/domain/native-process-lineage.js.map +1 -1
- package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
- package/daemon/dist/domain/native-resume-probe.js +31 -15
- package/daemon/dist/domain/native-resume-probe.js.map +1 -1
- package/daemon/dist/domain/node-launcher.d.ts +3 -0
- package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/node-launcher.js +6 -0
- package/daemon/dist/domain/node-launcher.js.map +1 -1
- package/daemon/dist/domain/permission-account.d.ts.map +1 -1
- package/daemon/dist/domain/permission-account.js +8 -6
- package/daemon/dist/domain/permission-account.js.map +1 -1
- package/daemon/dist/domain/permission-drift.d.ts.map +1 -1
- package/daemon/dist/domain/permission-drift.js +1 -1
- package/daemon/dist/domain/permission-drift.js.map +1 -1
- package/daemon/dist/domain/queue-destination-check.d.ts +2 -0
- package/daemon/dist/domain/queue-destination-check.d.ts.map +1 -1
- package/daemon/dist/domain/queue-destination-check.js +8 -11
- package/daemon/dist/domain/queue-destination-check.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +20 -15
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +37 -49
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-transition-log.d.ts +6 -0
- package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
- package/daemon/dist/domain/queue-transition-log.js +9 -0
- package/daemon/dist/domain/queue-transition-log.js.map +1 -1
- package/daemon/dist/domain/queue-waiting.d.ts +4 -4
- package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
- package/daemon/dist/domain/queue-waiting.js +30 -16
- package/daemon/dist/domain/queue-waiting.js.map +1 -1
- package/daemon/dist/domain/receiver-context.js +1 -1
- package/daemon/dist/domain/receiver-context.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +40 -18
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.d.ts +17 -4
- package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.js +60 -14
- package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
- package/daemon/dist/domain/resume-token-capture.d.ts +6 -0
- package/daemon/dist/domain/resume-token-capture.d.ts.map +1 -1
- package/daemon/dist/domain/resume-token-capture.js +14 -8
- package/daemon/dist/domain/resume-token-capture.js.map +1 -1
- package/daemon/dist/domain/rig-edge-ops.js +1 -1
- package/daemon/dist/domain/rig-edge-ops.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +6 -2
- 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 +21 -1
- package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
- package/daemon/dist/domain/rosters.d.ts +19 -0
- package/daemon/dist/domain/rosters.d.ts.map +1 -1
- package/daemon/dist/domain/rosters.js +69 -12
- package/daemon/dist/domain/rosters.js.map +1 -1
- package/daemon/dist/domain/runtime-adapter.d.ts +15 -0
- package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-adapter.js.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.d.ts +8 -2
- package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.js +38 -3
- package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
- package/daemon/dist/domain/seat-handover-attempts.d.ts +50 -0
- package/daemon/dist/domain/seat-handover-attempts.d.ts.map +1 -0
- package/daemon/dist/domain/seat-handover-attempts.js +75 -0
- package/daemon/dist/domain/seat-handover-attempts.js.map +1 -0
- package/daemon/dist/domain/seat-handover-service.d.ts +64 -1
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +437 -28
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +47 -2
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +48 -2
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-runtime-home-record-types.d.ts +16 -0
- package/daemon/dist/domain/seat-runtime-home-record-types.d.ts.map +1 -0
- package/daemon/dist/domain/seat-runtime-home-record-types.js +2 -0
- package/daemon/dist/domain/seat-runtime-home-record-types.js.map +1 -0
- package/daemon/dist/domain/seat-runtime-home-record.d.ts +173 -0
- package/daemon/dist/domain/seat-runtime-home-record.d.ts.map +1 -0
- package/daemon/dist/domain/seat-runtime-home-record.js +317 -0
- package/daemon/dist/domain/seat-runtime-home-record.js.map +1 -0
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts +7 -0
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.js +47 -2
- package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
- package/daemon/dist/domain/seat-skill-storage.d.ts +16 -1
- package/daemon/dist/domain/seat-skill-storage.d.ts.map +1 -1
- package/daemon/dist/domain/seat-skill-storage.js +178 -1
- package/daemon/dist/domain/seat-skill-storage.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +1 -0
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +6 -2
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/skill-catalog.d.ts +3 -0
- package/daemon/dist/domain/skill-catalog.d.ts.map +1 -1
- package/daemon/dist/domain/skill-catalog.js +7 -3
- package/daemon/dist/domain/skill-catalog.js.map +1 -1
- package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
- package/daemon/dist/domain/snapshot-capture.js +5 -0
- package/daemon/dist/domain/snapshot-capture.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts +16 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +70 -38
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +34 -1
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-browser.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-browser.js +3 -1
- package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
- package/daemon/dist/domain/workflow-exception-escalation.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-exception-escalation.js +13 -8
- package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -1
- package/daemon/dist/domain/workflow-instance-store.d.ts +11 -0
- package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-instance-store.js +35 -0
- package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
- package/daemon/dist/domain/workflow-projector.d.ts +7 -0
- package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +202 -91
- package/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-runtime.d.ts +7 -1
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +116 -26
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
- package/daemon/dist/lib/pane-envelope.js +12 -7
- package/daemon/dist/lib/pane-envelope.js.map +1 -1
- package/daemon/dist/routes/compaction.d.ts.map +1 -1
- package/daemon/dist/routes/compaction.js +6 -3
- package/daemon/dist/routes/compaction.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +44 -27
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/scopes.d.ts.map +1 -1
- package/daemon/dist/routes/scopes.js +102 -19
- 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 +50 -2
- package/daemon/dist/routes/seat.js.map +1 -1
- package/daemon/dist/routes/sessions.d.ts.map +1 -1
- package/daemon/dist/routes/sessions.js +54 -10
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/startup.d.ts.map +1 -1
- package/daemon/dist/routes/startup.js +116 -18
- package/daemon/dist/routes/startup.js.map +1 -1
- package/daemon/dist/routes/transport.d.ts.map +1 -1
- package/daemon/dist/routes/transport.js +36 -2
- package/daemon/dist/routes/transport.js.map +1 -1
- package/daemon/dist/routes/watchdog.d.ts.map +1 -1
- package/daemon/dist/routes/watchdog.js +7 -1
- 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 +22 -4
- package/daemon/dist/routes/workflow.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +105 -37
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/agent-startup-guide.md +87 -0
- package/daemon/docs/reference/daemon-http-clients.md +1 -0
- package/daemon/docs/reference/developing.md +1 -1
- package/daemon/docs/reference/gateway-participants.md +5 -3
- package/daemon/docs/reference/getting-started.md +9 -8
- package/daemon/docs/reference/quickstart.md +2 -2
- package/daemon/docs/reference/rig-spec.md +92 -4
- package/daemon/docs/reference/rosters.md +26 -0
- package/daemon/docs/reference/seat-delivery.md +7 -1
- package/daemon/docs/reference/whats-new.md +210 -5
- package/dist/build-info.js +3 -3
- package/dist/client.d.ts +7 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +11 -2
- package/dist/client.js.map +1 -1
- package/dist/commands/launch.d.ts.map +1 -1
- package/dist/commands/launch.js +8 -0
- package/dist/commands/launch.js.map +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +18 -1
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +11 -5
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +6 -2
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/roster.d.ts +4 -2
- package/dist/commands/roster.d.ts.map +1 -1
- package/dist/commands/roster.js +2 -2
- package/dist/commands/roster.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 +198 -11
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +31 -6
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/walk.d.ts.map +1 -1
- package/dist/commands/walk.js +4 -0
- package/dist/commands/walk.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +25 -1
- package/dist/commands/workflow.js.map +1 -1
- package/dist/mcp-http.d.ts +3 -0
- package/dist/mcp-http.d.ts.map +1 -1
- package/dist/mcp-http.js +13 -0
- package/dist/mcp-http.js.map +1 -1
- package/dist/mcp-server.d.ts +9 -2
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +243 -64
- package/dist/mcp-server.js.map +1 -1
- package/package.json +1 -1
- package/tui/dist/commands/registry.d.ts.map +1 -1
- package/tui/dist/commands/registry.js +1 -0
- package/tui/dist/commands/registry.js.map +1 -1
- package/tui/dist/crash-cart/start-daemon.d.ts.map +1 -1
- package/tui/dist/crash-cart/start-daemon.js +4 -2
- package/tui/dist/crash-cart/start-daemon.js.map +1 -1
- package/tui/dist/daemon-client.d.ts +9 -0
- package/tui/dist/daemon-client.d.ts.map +1 -1
- package/tui/dist/daemon-client.js +40 -0
- package/tui/dist/daemon-client.js.map +1 -1
- package/tui/dist/hydrate.d.ts +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +12 -0
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/main.js +3 -0
- package/tui/dist/main.js.map +1 -1
- package/tui/dist/page-read.d.ts.map +1 -1
- package/tui/dist/page-read.js +2 -1
- package/tui/dist/page-read.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +4 -1
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/scopes/fleet-scopes-model.d.ts +73 -0
- package/tui/dist/scopes/fleet-scopes-model.d.ts.map +1 -0
- package/tui/dist/scopes/fleet-scopes-model.js +102 -0
- package/tui/dist/scopes/fleet-scopes-model.js.map +1 -0
- package/tui/dist/scopes/scopes-model.d.ts +2 -0
- package/tui/dist/scopes/scopes-model.d.ts.map +1 -1
- package/tui/dist/scopes/scopes-model.js +7 -4
- package/tui/dist/scopes/scopes-model.js.map +1 -1
- package/tui/dist/sections.d.ts.map +1 -1
- package/tui/dist/sections.js +5 -0
- package/tui/dist/sections.js.map +1 -1
- package/tui/dist/startup.d.ts +5 -0
- package/tui/dist/startup.d.ts.map +1 -1
- package/tui/dist/startup.js +12 -0
- package/tui/dist/startup.js.map +1 -1
- package/tui/dist/state.d.ts.map +1 -1
- package/tui/dist/state.js +12 -5
- package/tui/dist/state.js.map +1 -1
- package/tui/dist/types.d.ts +16 -1
- package/tui/dist/types.d.ts.map +1 -1
|
@@ -28,7 +28,7 @@ import { selectRoleSeat } from "./workflow-role-resolver.js";
|
|
|
28
28
|
import { roleResolutionContext, tryResolveRoleByCapability, } from "./workflow-role-context.js";
|
|
29
29
|
import { packetScopeTags } from "./workflow-scope.js";
|
|
30
30
|
import { classifyFailureOccurrence, classifyGateTrip, workflowExceptionTags } from "./workflow-exception.js";
|
|
31
|
-
import { newQitemId, QueueRepositoryError } from "./queue-repository.js";
|
|
31
|
+
import { isTerminalState, newQitemId, QueueRepositoryError } from "./queue-repository.js";
|
|
32
32
|
import { resolveExceptionRoute } from "./workflow-exception-router.js";
|
|
33
33
|
import { workflowHumanDestination } from "./workflow-human-destination.js";
|
|
34
34
|
import { disarmWorkflowKeepalive, ensureWorkflowKeepaliveArmed, } from "./workflow-keepalive-arming.js";
|
|
@@ -106,6 +106,39 @@ export class WorkflowProjectorError extends Error {
|
|
|
106
106
|
this.name = "WorkflowProjectorError";
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
+
/** The projector's own trail record for a projection whose frontier packet the queue had already closed (an ordinary
|
|
110
|
+
* queue handoff moved the work on): the caller's whole intent, the queue state found and the next packets. The exit and
|
|
111
|
+
* next hop were recorded on the workflow, and the queue row wasn't written. project() never stores a caller's value
|
|
112
|
+
* for this key, so only the projector writes it. */
|
|
113
|
+
const QUEUE_ROW_ALREADY_CLOSED = "queue_row_already_closed";
|
|
114
|
+
function alreadyClosedRecord(input, state, nextQitemIds, nextStepIds) {
|
|
115
|
+
return { state, exit: input.exit, actor: input.actorSession, result_note: input.resultNote ?? null,
|
|
116
|
+
blocked_on: input.blockedOn ?? null, next_owner: input.nextOwnerSession ?? null, evidence: input.closureEvidence ?? null,
|
|
117
|
+
next_qitem_ids: nextQitemIds, next_step_ids: nextStepIds };
|
|
118
|
+
}
|
|
119
|
+
/** The record, when the trail evidence holds a well-formed one; anything else reads as none. */
|
|
120
|
+
function readAlreadyClosedRecord(evidence) {
|
|
121
|
+
const value = evidence?.[QUEUE_ROW_ALREADY_CLOSED];
|
|
122
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
123
|
+
return null;
|
|
124
|
+
const r = value;
|
|
125
|
+
const text = (v) => typeof v === "string";
|
|
126
|
+
const textOrNull = (v) => v === null || text(v);
|
|
127
|
+
const ids = (v) => Array.isArray(v) && v.every(text);
|
|
128
|
+
const objectOrNull = (v) => v === null || (typeof v === "object" && !Array.isArray(v));
|
|
129
|
+
return text(r.state) && isTerminalState(r.state) && text(r.exit) && text(r.actor) && textOrNull(r.result_note)
|
|
130
|
+
&& textOrNull(r.blocked_on) && textOrNull(r.next_owner) && objectOrNull(r.evidence) && ids(r.next_qitem_ids)
|
|
131
|
+
&& ids(r.next_step_ids) ? r : null;
|
|
132
|
+
}
|
|
133
|
+
/** The caller repeats the recorded projection exactly: the same exit, actor, result note, blocker, next owner and evidence. */
|
|
134
|
+
function sameIntent(record, input) {
|
|
135
|
+
return record.exit === input.exit && record.actor === input.actorSession && record.result_note === (input.resultNote ?? null)
|
|
136
|
+
&& record.blocked_on === (input.blockedOn ?? null) && record.next_owner === (input.nextOwnerSession ?? null)
|
|
137
|
+
&& isDeepEqual(record.evidence, input.closureEvidence ?? null);
|
|
138
|
+
}
|
|
139
|
+
function alreadyClosedNotice(packetId, state, exit) {
|
|
140
|
+
return `packet ${packetId} was already ${state} in the queue, so the ${exit} exit was recorded on the workflow without writing its queue row`;
|
|
141
|
+
}
|
|
109
142
|
export class WorkflowProjector {
|
|
110
143
|
db;
|
|
111
144
|
eventBus;
|
|
@@ -146,7 +179,21 @@ export class WorkflowProjector {
|
|
|
146
179
|
* call site.
|
|
147
180
|
*/
|
|
148
181
|
async project(input) {
|
|
182
|
+
// The already-closed record's key is the projector's own: a value a caller supplies for it isn't stored or trusted.
|
|
183
|
+
const evidence = input.closureEvidence;
|
|
184
|
+
if (!evidence || !(QUEUE_ROW_ALREADY_CLOSED in evidence))
|
|
185
|
+
return this.projectStep(input);
|
|
186
|
+
const { [QUEUE_ROW_ALREADY_CLOSED]: _reserved, ...callerEvidence } = evidence;
|
|
187
|
+
const result = await this.projectStep({ ...input, closureEvidence: callerEvidence });
|
|
188
|
+
return { ...result, advisories: [...(result.advisories ?? []),
|
|
189
|
+
`closure evidence key ${QUEUE_ROW_ALREADY_CLOSED} is the projector's own, so the value supplied for it wasn't stored`] };
|
|
190
|
+
}
|
|
191
|
+
async projectStep(input) {
|
|
149
192
|
const instance = this.instanceStore.getByIdOrThrow(input.instanceId);
|
|
193
|
+
// The same whole intent again on a packet that was already closed when it was projected: report that projection.
|
|
194
|
+
const replay = this.alreadyClosedReplay(instance, input);
|
|
195
|
+
if (replay)
|
|
196
|
+
return replay;
|
|
150
197
|
if (instance.status !== "active" && instance.status !== "waiting") {
|
|
151
198
|
throw new WorkflowProjectorError("instance_not_active", `workflow instance ${instance.instanceId} has status ${instance.status}; only active|waiting instances accept project`, { instanceId: instance.instanceId, status: instance.status });
|
|
152
199
|
}
|
|
@@ -202,6 +249,9 @@ export class WorkflowProjector {
|
|
|
202
249
|
}
|
|
203
250
|
}
|
|
204
251
|
validateAcceptance(currentStep, input, instance);
|
|
252
|
+
// A frontier packet an ordinary queue handoff already closed: the queue refuses closing it again, and its history
|
|
253
|
+
// stays as recorded. The exit and next hop are still recorded on the workflow; only this row isn't written.
|
|
254
|
+
const alreadyClosed = isTerminalState(currentPacket.state) ? currentPacket.state : null;
|
|
205
255
|
const unansweredHumanGate = (input.exit === "done" || input.exit === "handoff") &&
|
|
206
256
|
currentStep.gate && isHumanSeatSession(currentStep.gate.target) &&
|
|
207
257
|
currentPacket.state === "blocked" && currentPacket.blockedOn === currentStep.gate.target
|
|
@@ -221,6 +271,7 @@ export class WorkflowProjector {
|
|
|
221
271
|
packetBinding,
|
|
222
272
|
currentOwnerSession: currentPacket.destinationSession,
|
|
223
273
|
unansweredHumanGate,
|
|
274
|
+
alreadyClosed,
|
|
224
275
|
});
|
|
225
276
|
}
|
|
226
277
|
// Determine next step (one-hop default; multi-hop is graduation).
|
|
@@ -366,40 +417,44 @@ export class WorkflowProjector {
|
|
|
366
417
|
resolvedNextOwner = owner;
|
|
367
418
|
}
|
|
368
419
|
}
|
|
420
|
+
if (resolvedNextOwner)
|
|
421
|
+
assertBoundWorkflowTarget(resolvedNextOwner, this.queueRepo);
|
|
369
422
|
// 2. R1 fix (guard blocker 1): close the current packet via Phase A's
|
|
370
423
|
// QueueRepository.updateWithinTransaction. This validates closure
|
|
371
424
|
// (Phase A hot-potato strict-rejection invariants), persists closure
|
|
372
425
|
// metadata (closure_reason, closure_target, handed_off_to / blocked_on),
|
|
373
426
|
// appends queue_transitions, and emits queue.updated — all inside this
|
|
374
427
|
// outer transaction. The Phase A closure authority is preserved.
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
428
|
+
if (!alreadyClosed) {
|
|
429
|
+
const closure = workflowExitToQueueClosure({ ...input, exit: effectiveExit, resultNote: effectiveResultNote }, resolvedNextOwner);
|
|
430
|
+
const queueUpdate = this.queueRepo.updateWithinTransaction({
|
|
431
|
+
qitemId: input.currentPacketId,
|
|
432
|
+
actorSession: input.actorSession,
|
|
433
|
+
identityProvenance: input.identityProvenance ?? null,
|
|
434
|
+
viaWorkflowVerb: true,
|
|
435
|
+
state: closure.state,
|
|
436
|
+
closureReason: closure.closureReason,
|
|
437
|
+
closureTarget: closure.closureTarget ?? undefined,
|
|
438
|
+
handedOffTo: closure.handedOffTo,
|
|
439
|
+
blockedOn: closure.blockedOn,
|
|
440
|
+
transitionNote: [closure.transitionNote, unansweredHumanGate].filter(Boolean).join("; "),
|
|
441
|
+
wakeMaxSeconds: effectiveExit === "waiting" && !routes ? currentStep.re_present_max_seconds : undefined,
|
|
442
|
+
wakeProgressEvidence: input.closureEvidence,
|
|
443
|
+
wakeAfterSeconds: effectiveExit === "waiting" && !routes
|
|
444
|
+
? currentStep.re_present_after_seconds
|
|
445
|
+
: undefined,
|
|
446
|
+
wakeMessage: effectiveExit === "waiting" && !routes && currentStep.re_present_after_seconds !== undefined
|
|
447
|
+
? workflowWaitWakeMessage({
|
|
448
|
+
spec,
|
|
449
|
+
instance,
|
|
450
|
+
step: currentStep,
|
|
451
|
+
packetId: input.currentPacketId,
|
|
452
|
+
ownerSession: currentPacket.destinationSession,
|
|
453
|
+
})
|
|
454
|
+
: undefined,
|
|
455
|
+
});
|
|
456
|
+
registerEvent(queueUpdate.persistedEvent);
|
|
457
|
+
}
|
|
403
458
|
// 3. If this close routes (structural handoff OR branch-mapped
|
|
404
459
|
// exit): create the next-step qitem in the same txn. A gated
|
|
405
460
|
// target compiles to the gate item (FR-5) — the SHIPPED write
|
|
@@ -519,6 +574,9 @@ export class WorkflowProjector {
|
|
|
519
574
|
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, holdMs);
|
|
520
575
|
}
|
|
521
576
|
// 4. Append step trail entry (prior + next ids).
|
|
577
|
+
if (alreadyClosed) {
|
|
578
|
+
effectiveClosureEvidence = { ...(effectiveClosureEvidence ?? {}), [QUEUE_ROW_ALREADY_CLOSED]: alreadyClosedRecord(input, alreadyClosed, nextQitemId ? [nextQitemId] : [], nextStepId ? [nextStepId] : []) };
|
|
579
|
+
}
|
|
522
580
|
this.trailLog.record({
|
|
523
581
|
instanceId: instance.instanceId,
|
|
524
582
|
stepId: currentStep.id,
|
|
@@ -716,7 +774,33 @@ export class WorkflowProjector {
|
|
|
716
774
|
nextOwnerSession,
|
|
717
775
|
nextStepId,
|
|
718
776
|
emittedEventTypes: persistedEvents.map((e) => e.type),
|
|
719
|
-
...(unansweredHumanGate ?
|
|
777
|
+
...withAdvisories([unansweredHumanGate, alreadyClosed ? alreadyClosedNotice(input.currentPacketId, alreadyClosed, input.exit) : undefined]),
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
/** A repeat, with the same whole intent, of the latest projection recorded on a packet the queue had already closed
|
|
781
|
+
* (and still has): the same result, read from that projection's trail record, with nothing written. Otherwise null. */
|
|
782
|
+
alreadyClosedReplay(instance, input) {
|
|
783
|
+
const packet = this.queueRepo.getById(input.currentPacketId);
|
|
784
|
+
if (!packet || !isTerminalState(packet.state))
|
|
785
|
+
return null;
|
|
786
|
+
const entry = this.trailLog.listForInstanceInAppendOrder(instance.instanceId)
|
|
787
|
+
.filter((candidate) => candidate.priorQitemId === input.currentPacketId).at(-1);
|
|
788
|
+
const recorded = readAlreadyClosedRecord(entry?.closureEvidence);
|
|
789
|
+
if (!entry || !recorded || !sameIntent(recorded, input))
|
|
790
|
+
return null;
|
|
791
|
+
const nextQitemId = recorded.next_qitem_ids[0] ?? null;
|
|
792
|
+
return {
|
|
793
|
+
instance,
|
|
794
|
+
closurePriorPacketId: input.currentPacketId,
|
|
795
|
+
closureReason: entry.closureReason,
|
|
796
|
+
nextQitemId,
|
|
797
|
+
nextOwnerSession: nextQitemId ? this.queueRepo.getById(nextQitemId)?.destinationSession ?? null : null,
|
|
798
|
+
nextStepId: recorded.next_step_ids[0] ?? null,
|
|
799
|
+
nextQitemIds: recorded.next_qitem_ids,
|
|
800
|
+
nextStepIds: recorded.next_step_ids,
|
|
801
|
+
emittedEventTypes: [],
|
|
802
|
+
absorbedReplay: true,
|
|
803
|
+
advisories: [alreadyClosedNotice(input.currentPacketId, recorded.state, input.exit)],
|
|
720
804
|
};
|
|
721
805
|
}
|
|
722
806
|
/** Failure, owning task and wake commit together on both executor paths.
|
|
@@ -750,37 +834,45 @@ export class WorkflowProjector {
|
|
|
750
834
|
`evidence: ${evidenceRef}\n` +
|
|
751
835
|
`resolve: diagnose via the trace above, then \`rig workflow resume ${instance.instanceId}${occurrenceId ? ` --occurrence ${occurrenceId}` : ""} [--decision <text>]\` re-drives from this step (completed steps never re-run).`;
|
|
752
836
|
// Routed to the person, a failed workflow step is an approval whose wait costs now: alert them.
|
|
753
|
-
const createExceptionItem = (destination, tier, toPerson) =>
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
837
|
+
const createExceptionItem = (destination, tier, toPerson) => {
|
|
838
|
+
assertBoundWorkflowTarget(destination, this.queueRepo);
|
|
839
|
+
return this.queueRepo.createWithinTransaction({
|
|
840
|
+
sourceSession: input.actorSession,
|
|
841
|
+
identityProvenance: input.identityProvenance ?? null,
|
|
842
|
+
destinationSession: destination,
|
|
843
|
+
body: itemBody,
|
|
844
|
+
priority: "urgent",
|
|
845
|
+
tier,
|
|
846
|
+
tags: [...workflowExceptionTags(exception.identity), ...packetScopeTags(instance, currentStep.id)],
|
|
847
|
+
summary: exception.reason,
|
|
848
|
+
evidenceRef,
|
|
849
|
+
chainOfRecord: [input.currentPacketId],
|
|
850
|
+
...(toPerson ? { humanAlert: true } : {}),
|
|
851
|
+
});
|
|
852
|
+
};
|
|
766
853
|
let createdException;
|
|
767
|
-
|
|
768
|
-
createdException = createExceptionItem(route.destinationSession, route.tier, route.humanRouted === true);
|
|
769
|
-
}
|
|
770
|
-
catch (error) {
|
|
771
|
-
if (!(error instanceof QueueRepositoryError) || error.code !== "unknown_destination_rig" || route.humanRouted)
|
|
772
|
-
throw error;
|
|
773
|
-
// Only an unavailable agent rig invokes human selection. Other
|
|
774
|
-
// admission/storage failures propagate unchanged and roll back the
|
|
775
|
-
// close, retaining the failure+attention-item atomic contract.
|
|
854
|
+
if (!route.humanRouted && !this.queueRepo.acceptsDestination(route.destinationSession)) {
|
|
776
855
|
createdException = createExceptionItem(workflowHumanDestination(this.exceptionDial?.humanFallbackSeat), "human-gate", true);
|
|
777
856
|
}
|
|
857
|
+
else {
|
|
858
|
+
try {
|
|
859
|
+
createdException = createExceptionItem(route.destinationSession, route.tier, route.humanRouted === true);
|
|
860
|
+
}
|
|
861
|
+
catch (error) {
|
|
862
|
+
if (!(error instanceof QueueRepositoryError) || error.code !== "unknown_destination_rig" || route.humanRouted)
|
|
863
|
+
throw error;
|
|
864
|
+
// Only an unavailable agent rig invokes human selection. Other
|
|
865
|
+
// admission/storage failures propagate unchanged and roll back the
|
|
866
|
+
// close, retaining the failure+attention-item atomic contract.
|
|
867
|
+
createdException = createExceptionItem(workflowHumanDestination(this.exceptionDial?.humanFallbackSeat), "human-gate", true);
|
|
868
|
+
}
|
|
869
|
+
}
|
|
778
870
|
registerEvent(createdException.persistedEvent);
|
|
779
871
|
this.queueRepo.stageHandoffWake(createdException.qitemId, input.actorSession, createdException.destinationSession, input.identityProvenance ?? null, createdException.nudge);
|
|
780
872
|
return { qitemId: createdException.qitemId, destinationSession: createdException.destinationSession, nudge: createdException.nudge };
|
|
781
873
|
}
|
|
782
874
|
async projectDependencyGraph(args) {
|
|
783
|
-
const { input, instance, spec, currentStep, packetBinding, currentOwnerSession, unansweredHumanGate } = args;
|
|
875
|
+
const { input, instance, spec, currentStep, packetBinding, currentOwnerSession, unansweredHumanGate, alreadyClosed } = args;
|
|
784
876
|
if (input.exit === "waiting" && instance.status === "waiting" && matchesStoredWaitingDecision(instance, input, currentStep.id, this.trailLog)) {
|
|
785
877
|
return {
|
|
786
878
|
instance,
|
|
@@ -880,44 +972,47 @@ export class WorkflowProjector {
|
|
|
880
972
|
if (!owner) {
|
|
881
973
|
throw new WorkflowProjectorError("next_owner_unresolved", `cannot resolve next owner for dependency step "${step.id}"`, { instanceId: instance.instanceId, stepId: step.id });
|
|
882
974
|
}
|
|
975
|
+
assertBoundWorkflowTarget(owner, this.queueRepo);
|
|
883
976
|
return { step, gate, owner, packetId: newQitemId() };
|
|
884
977
|
});
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
978
|
+
if (!alreadyClosed) {
|
|
979
|
+
const closureOwner = ownerPlans.length === 1 ? ownerPlans[0].owner : null;
|
|
980
|
+
const closure = effectiveExit === "handoff" && ownerPlans.length !== 1
|
|
981
|
+
? {
|
|
982
|
+
state: "done",
|
|
983
|
+
closureReason: "no-follow-on",
|
|
984
|
+
closureTarget: null,
|
|
985
|
+
transitionNote: `workflow graph: ${input.actorSession} completed ${currentStep.id}; ${ownerPlans.length} successors projected transactionally`,
|
|
986
|
+
}
|
|
987
|
+
: workflowExitToQueueClosure({ ...input, exit: effectiveExit, resultNote: effectiveResultNote }, closureOwner);
|
|
988
|
+
const updated = this.queueRepo.updateWithinTransaction({
|
|
989
|
+
qitemId: input.currentPacketId,
|
|
990
|
+
actorSession: input.actorSession,
|
|
991
|
+
identityProvenance: input.identityProvenance ?? null,
|
|
992
|
+
viaWorkflowVerb: true,
|
|
993
|
+
state: closure.state,
|
|
994
|
+
closureReason: closure.closureReason,
|
|
995
|
+
closureTarget: closure.closureTarget ?? undefined,
|
|
996
|
+
handedOffTo: closure.handedOffTo,
|
|
997
|
+
blockedOn: closure.blockedOn,
|
|
998
|
+
transitionNote: [closure.transitionNote, unansweredHumanGate].filter(Boolean).join("; "),
|
|
999
|
+
wakeMaxSeconds: effectiveExit === "waiting" && ownerPlans.length === 0 ? currentStep.re_present_max_seconds : undefined,
|
|
1000
|
+
wakeProgressEvidence: input.closureEvidence,
|
|
1001
|
+
wakeAfterSeconds: effectiveExit === "waiting" && ownerPlans.length === 0
|
|
1002
|
+
? currentStep.re_present_after_seconds
|
|
1003
|
+
: undefined,
|
|
1004
|
+
wakeMessage: effectiveExit === "waiting" && ownerPlans.length === 0 && currentStep.re_present_after_seconds !== undefined
|
|
1005
|
+
? workflowWaitWakeMessage({
|
|
1006
|
+
spec,
|
|
1007
|
+
instance,
|
|
1008
|
+
step: currentStep,
|
|
1009
|
+
packetId: input.currentPacketId,
|
|
1010
|
+
ownerSession: currentOwnerSession,
|
|
1011
|
+
})
|
|
1012
|
+
: undefined,
|
|
1013
|
+
});
|
|
1014
|
+
addEvent(updated.persistedEvent);
|
|
1015
|
+
}
|
|
921
1016
|
if (effectiveExit !== "waiting") {
|
|
922
1017
|
this.instanceStore.removeFrontierBinding(instance.instanceId, input.currentPacketId);
|
|
923
1018
|
if (this.watchdogJobsRepo) {
|
|
@@ -1025,7 +1120,11 @@ export class WorkflowProjector {
|
|
|
1025
1120
|
stepRole: currentStep.actor_role,
|
|
1026
1121
|
closedAt: evaluatedAt,
|
|
1027
1122
|
closureReason: effectiveExit,
|
|
1028
|
-
closureEvidence: {
|
|
1123
|
+
closureEvidence: {
|
|
1124
|
+
...(effectiveClosureEvidence ?? {}),
|
|
1125
|
+
next_qitem_ids: createdPackets.map((packet) => packet.qitemId),
|
|
1126
|
+
...(alreadyClosed ? { [QUEUE_ROW_ALREADY_CLOSED]: alreadyClosedRecord(input, alreadyClosed, createdPackets.map((packet) => packet.qitemId), createdPackets.map((packet) => packet.step.id)) } : {}),
|
|
1127
|
+
},
|
|
1029
1128
|
actorSession: input.actorSession,
|
|
1030
1129
|
nextQitemId: createdPackets[0]?.qitemId ?? null,
|
|
1031
1130
|
priorQitemId: input.currentPacketId,
|
|
@@ -1056,7 +1155,7 @@ export class WorkflowProjector {
|
|
|
1056
1155
|
nextQitemIds: createdPackets.map((packet) => packet.qitemId),
|
|
1057
1156
|
nextStepIds: createdPackets.map((packet) => packet.step.id),
|
|
1058
1157
|
emittedEventTypes: emitted.map((event) => event.type),
|
|
1059
|
-
...(unansweredHumanGate ?
|
|
1158
|
+
...withAdvisories([unansweredHumanGate, alreadyClosed ? alreadyClosedNotice(input.currentPacketId, alreadyClosed, input.exit) : undefined]),
|
|
1060
1159
|
};
|
|
1061
1160
|
}
|
|
1062
1161
|
}
|
|
@@ -1101,6 +1200,10 @@ function matchesStoredWaitingDecision(instance, input, currentStepId, trailLog)
|
|
|
1101
1200
|
return false;
|
|
1102
1201
|
return isDeepEqual(storedRow.closureEvidence ?? null, input.closureEvidence ?? null);
|
|
1103
1202
|
}
|
|
1203
|
+
function withAdvisories(notices) {
|
|
1204
|
+
const advisories = notices.filter((notice) => Boolean(notice));
|
|
1205
|
+
return advisories.length ? { advisories } : {};
|
|
1206
|
+
}
|
|
1104
1207
|
function isDeepEqual(a, b) {
|
|
1105
1208
|
if (a === b)
|
|
1106
1209
|
return true;
|
|
@@ -1213,6 +1316,14 @@ function resolveRoleOnBoundRig(roleName, harness, roleCtx, stepId) {
|
|
|
1213
1316
|
candidates: result.disqualified,
|
|
1214
1317
|
});
|
|
1215
1318
|
}
|
|
1319
|
+
/** Preserve the old topology gate for template-looking rig names. Registered
|
|
1320
|
+
* literal names, including archived rigs, remain recordable as on main. */
|
|
1321
|
+
export function assertBoundWorkflowTarget(target, queue) {
|
|
1322
|
+
const at = target.indexOf("@");
|
|
1323
|
+
if (at >= 0 && target.slice(at + 1).includes("{rig}") && !queue.acceptsDestination(target)) {
|
|
1324
|
+
throw new QueueRepositoryError("unknown_destination_rig", `Workflow target ${target} has an unregistered rig name containing {rig}. Bind a rig with --rig <name>, or use a concrete registered destination.`, { destinationSession: target });
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1216
1327
|
/**
|
|
1217
1328
|
* Resolve a default owner for a step. v1 picks the first declared
|
|
1218
1329
|
* preferred_target. OPR.0.4.6.WF2 FR-2: a step with a `harness:` pin
|