@openrig/cli 0.7.18 → 0.7.19
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 +7 -6
- package/daemon/assets/claude-hook-bridge.cjs +146 -0
- package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-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 +1 -1
- package/daemon/assets/plugins/openrig-core/hooks/claude.json +14 -14
- package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +43 -22
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +1 -0
- package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +1 -1
- package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +70 -2
- package/daemon/assets/skills/rigs/SKILL.md +40 -19
- 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 +16 -7
- package/daemon/context-packs/reference/getting-started.md +9 -4
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +56 -26
- package/daemon/context-packs/reference/whats-new.md +82 -11
- package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
- package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
- package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
- package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/messaging-the-human/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/SKILL.md +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/refocusing/scripts/trace-to-root.py +70 -2
- 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 +9 -0
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +41 -4
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/claude-resume.d.ts +2 -0
- package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-resume.js +3 -1
- package/daemon/dist/adapters/claude-resume.js.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts +5 -0
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +45 -10
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/kernel-authority.d.ts +7 -0
- package/daemon/dist/adapters/kernel-authority.d.ts.map +1 -1
- package/daemon/dist/adapters/kernel-authority.js +24 -1
- package/daemon/dist/adapters/kernel-authority.js.map +1 -1
- package/daemon/dist/adapters/pi-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-resume.js +5 -7
- package/daemon/dist/adapters/pi-resume.js.map +1 -1
- package/daemon/dist/adapters/pi-runner-protocol.d.ts +5 -1
- package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.d.ts +34 -0
- package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.js +359 -26
- package/daemon/dist/adapters/pi-runner.js.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts +7 -1
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.js +29 -19
- package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +54 -34
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +183 -57
- 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 +6 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/171_seat_hook_bridge.d.ts +5 -0
- package/daemon/dist/db/migrations/171_seat_hook_bridge.d.ts.map +1 -0
- package/daemon/dist/db/migrations/171_seat_hook_bridge.js +25 -0
- package/daemon/dist/db/migrations/171_seat_hook_bridge.js.map +1 -0
- package/daemon/dist/db/migrations/174_session_launched_cwd.d.ts +6 -0
- package/daemon/dist/db/migrations/174_session_launched_cwd.d.ts.map +1 -0
- package/daemon/dist/db/migrations/174_session_launched_cwd.js +8 -0
- package/daemon/dist/db/migrations/174_session_launched_cwd.js.map +1 -0
- package/daemon/dist/db/migrations/175_core_app_access.d.ts +3 -0
- package/daemon/dist/db/migrations/175_core_app_access.d.ts.map +1 -0
- package/daemon/dist/db/migrations/175_core_app_access.js +26 -0
- package/daemon/dist/db/migrations/175_core_app_access.js.map +1 -0
- package/daemon/dist/domain/activity-grants.d.ts.map +1 -1
- package/daemon/dist/domain/activity-grants.js +6 -4
- package/daemon/dist/domain/activity-grants.js.map +1 -1
- package/daemon/dist/domain/agent-activity-store.d.ts +23 -0
- package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
- package/daemon/dist/domain/agent-activity-store.js +62 -5
- package/daemon/dist/domain/agent-activity-store.js.map +1 -1
- package/daemon/dist/domain/claude-activity-hooks.d.ts +4 -2
- package/daemon/dist/domain/claude-activity-hooks.d.ts.map +1 -1
- package/daemon/dist/domain/claude-activity-hooks.js +5 -3
- package/daemon/dist/domain/claude-activity-hooks.js.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +64 -3
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +203 -6
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/compaction-restore-notice.d.ts +3 -1
- package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
- package/daemon/dist/domain/compaction-restore-notice.js +22 -3
- package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
- package/daemon/dist/domain/configured-account.d.ts +3 -0
- package/daemon/dist/domain/configured-account.d.ts.map +1 -0
- package/daemon/dist/domain/configured-account.js +10 -0
- package/daemon/dist/domain/configured-account.js.map +1 -0
- package/daemon/dist/domain/core-app-access.d.ts +51 -0
- package/daemon/dist/domain/core-app-access.d.ts.map +1 -0
- package/daemon/dist/domain/core-app-access.js +107 -0
- package/daemon/dist/domain/core-app-access.js.map +1 -0
- package/daemon/dist/domain/core-app-job.d.ts +411 -0
- package/daemon/dist/domain/core-app-job.d.ts.map +1 -0
- package/daemon/dist/domain/core-app-job.js +537 -0
- package/daemon/dist/domain/core-app-job.js.map +1 -0
- package/daemon/dist/domain/current-park-arm.d.ts +4 -0
- package/daemon/dist/domain/current-park-arm.d.ts.map +1 -0
- package/daemon/dist/domain/current-park-arm.js +14 -0
- package/daemon/dist/domain/current-park-arm.js.map +1 -0
- package/daemon/dist/domain/cwd-resolution.d.ts +12 -0
- package/daemon/dist/domain/cwd-resolution.d.ts.map +1 -1
- package/daemon/dist/domain/cwd-resolution.js +21 -1
- package/daemon/dist/domain/cwd-resolution.js.map +1 -1
- package/daemon/dist/domain/execution-view.d.ts.map +1 -1
- package/daemon/dist/domain/execution-view.js +9 -3
- package/daemon/dist/domain/execution-view.js.map +1 -1
- package/daemon/dist/domain/gateway/participants.d.ts +2 -0
- package/daemon/dist/domain/gateway/participants.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/participants.js +5 -1
- package/daemon/dist/domain/gateway/participants.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +1 -0
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +37 -17
- package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/settled-asks.js +1 -1
- package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +1 -0
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.js +2 -0
- package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts +4 -0
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js +26 -2
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
- package/daemon/dist/domain/hook-bridge.d.ts +345 -0
- package/daemon/dist/domain/hook-bridge.d.ts.map +1 -0
- package/daemon/dist/domain/hook-bridge.js +547 -0
- package/daemon/dist/domain/hook-bridge.js.map +1 -0
- package/daemon/dist/domain/hosted-wake.d.ts +9 -0
- package/daemon/dist/domain/hosted-wake.d.ts.map +1 -1
- package/daemon/dist/domain/hosted-wake.js +45 -6
- package/daemon/dist/domain/hosted-wake.js.map +1 -1
- package/daemon/dist/domain/human-ask-attention.d.ts +10 -0
- package/daemon/dist/domain/human-ask-attention.d.ts.map +1 -0
- package/daemon/dist/domain/human-ask-attention.js +22 -0
- package/daemon/dist/domain/human-ask-attention.js.map +1 -0
- package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts +4 -0
- 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 +8 -1
- 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 +10 -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 +64 -12
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
- package/daemon/dist/domain/native-continuation-notice.d.ts +16 -0
- package/daemon/dist/domain/native-continuation-notice.d.ts.map +1 -0
- package/daemon/dist/domain/native-continuation-notice.js +79 -0
- package/daemon/dist/domain/native-continuation-notice.js.map +1 -0
- package/daemon/dist/domain/native-process-lineage.d.ts +16 -0
- package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
- package/daemon/dist/domain/native-process-lineage.js +48 -3
- package/daemon/dist/domain/native-process-lineage.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +27 -6
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/node-launcher.d.ts +6 -0
- package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/node-launcher.js +16 -2
- package/daemon/dist/domain/node-launcher.js.map +1 -1
- package/daemon/dist/domain/outbox-handler.d.ts +21 -3
- package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
- package/daemon/dist/domain/outbox-handler.js +88 -8
- package/daemon/dist/domain/outbox-handler.js.map +1 -1
- package/daemon/dist/domain/park-wake-text.d.ts +18 -0
- package/daemon/dist/domain/park-wake-text.d.ts.map +1 -1
- package/daemon/dist/domain/park-wake-text.js +44 -0
- package/daemon/dist/domain/park-wake-text.js.map +1 -1
- package/daemon/dist/domain/policies/idle-gate-qitem.d.ts +3 -0
- package/daemon/dist/domain/policies/idle-gate-qitem.d.ts.map +1 -1
- package/daemon/dist/domain/policies/idle-gate-qitem.js +15 -0
- package/daemon/dist/domain/policies/idle-gate-qitem.js.map +1 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.d.ts +6 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.d.ts.map +1 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.js +28 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
- package/daemon/dist/domain/process-limits.d.ts +21 -11
- package/daemon/dist/domain/process-limits.d.ts.map +1 -1
- package/daemon/dist/domain/process-limits.js +74 -20
- package/daemon/dist/domain/process-limits.js.map +1 -1
- package/daemon/dist/domain/process-table.d.ts +15 -0
- package/daemon/dist/domain/process-table.d.ts.map +1 -1
- package/daemon/dist/domain/process-table.js +39 -0
- package/daemon/dist/domain/process-table.js.map +1 -1
- package/daemon/dist/domain/queue-erasure.d.ts.map +1 -1
- package/daemon/dist/domain/queue-erasure.js +3 -0
- package/daemon/dist/domain/queue-erasure.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +60 -7
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +178 -36
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts +2 -0
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +29 -0
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
- package/daemon/dist/domain/queue-waiting.js +28 -3
- package/daemon/dist/domain/queue-waiting.js.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.d.ts +12 -0
- package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +115 -14
- package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.d.ts +8 -0
- package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.js +48 -8
- package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
- package/daemon/dist/domain/reconciler.d.ts +18 -2
- package/daemon/dist/domain/reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/reconciler.js +40 -0
- package/daemon/dist/domain/reconciler.js.map +1 -1
- package/daemon/dist/domain/restore-attempt-receipt.d.ts.map +1 -1
- package/daemon/dist/domain/restore-attempt-receipt.js +3 -2
- package/daemon/dist/domain/restore-attempt-receipt.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +5 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +73 -8
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/restore-topology.d.ts +7 -1
- package/daemon/dist/domain/restore-topology.d.ts.map +1 -1
- package/daemon/dist/domain/restore-topology.js +21 -0
- package/daemon/dist/domain/restore-topology.js.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.d.ts +2 -3
- package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.js +6 -25
- package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +7 -6
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rig-teardown.d.ts +16 -3
- package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
- package/daemon/dist/domain/rig-teardown.js +73 -9
- package/daemon/dist/domain/rig-teardown.js.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.js +2 -2
- package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts +5 -0
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +17 -7
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rosters.d.ts +11 -0
- package/daemon/dist/domain/rosters.d.ts.map +1 -1
- package/daemon/dist/domain/rosters.js +21 -2
- package/daemon/dist/domain/rosters.js.map +1 -1
- package/daemon/dist/domain/runner-channel.d.ts +35 -3
- package/daemon/dist/domain/runner-channel.d.ts.map +1 -1
- package/daemon/dist/domain/runner-channel.js +177 -8
- package/daemon/dist/domain/runner-channel.js.map +1 -1
- package/daemon/dist/domain/runner-permissions.d.ts +26 -3
- package/daemon/dist/domain/runner-permissions.d.ts.map +1 -1
- package/daemon/dist/domain/runner-permissions.js +160 -39
- package/daemon/dist/domain/runner-permissions.js.map +1 -1
- package/daemon/dist/domain/scope/mission-parent.d.ts +19 -0
- package/daemon/dist/domain/scope/mission-parent.d.ts.map +1 -0
- package/daemon/dist/domain/scope/mission-parent.js +134 -0
- package/daemon/dist/domain/scope/mission-parent.js.map +1 -0
- package/daemon/dist/domain/scope/scope-audit.d.ts.map +1 -1
- package/daemon/dist/domain/scope/scope-audit.js +8 -0
- package/daemon/dist/domain/scope/scope-audit.js.map +1 -1
- package/daemon/dist/domain/scope/types.d.ts +3 -1
- package/daemon/dist/domain/scope/types.d.ts.map +1 -1
- package/daemon/dist/domain/scope/types.js +5 -1
- package/daemon/dist/domain/scope/types.js.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.d.ts +14 -2
- package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.js +53 -14
- package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +9 -4
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.d.ts +4 -3
- package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.js +40 -5
- package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +14 -6
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +104 -22
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.js +4 -1
- package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.js +2 -0
- package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
- package/daemon/dist/domain/seat-skill-apply.d.ts +1 -1
- package/daemon/dist/domain/seat-skill-apply.d.ts.map +1 -1
- package/daemon/dist/domain/seat-skill-apply.js +3 -2
- package/daemon/dist/domain/seat-skill-apply.js.map +1 -1
- package/daemon/dist/domain/session-registry.d.ts +5 -1
- package/daemon/dist/domain/session-registry.d.ts.map +1 -1
- package/daemon/dist/domain/session-registry.js +12 -1
- package/daemon/dist/domain/session-registry.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +40 -1
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +211 -10
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/shared-history-selection.d.ts.map +1 -1
- package/daemon/dist/domain/shared-history-selection.js +9 -5
- package/daemon/dist/domain/shared-history-selection.js.map +1 -1
- package/daemon/dist/domain/slices/slice-indexer.d.ts +1 -1
- package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -1
- package/daemon/dist/domain/slices/slice-indexer.js +4 -0
- package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.d.ts +1 -0
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +6 -4
- package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +10 -4
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts +35 -1
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.js +231 -33
- package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-sessions.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-sessions.js +2 -1
- package/daemon/dist/domain/terminal/herdr-sessions.js.map +1 -1
- package/daemon/dist/domain/terminal/rig-viewer-records.d.ts +59 -0
- package/daemon/dist/domain/terminal/rig-viewer-records.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/rig-viewer-records.js +210 -0
- package/daemon/dist/domain/terminal/rig-viewer-records.js.map +1 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts +2 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.d.ts +99 -4
- package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.js +556 -36
- package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
- package/daemon/dist/domain/terminal/tile-layout.js +1 -1
- package/daemon/dist/domain/terminal/tile-layout.js.map +1 -1
- package/daemon/dist/domain/terminal/tmux-viewer-guard.d.ts +25 -0
- package/daemon/dist/domain/terminal/tmux-viewer-guard.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/tmux-viewer-guard.js +70 -0
- package/daemon/dist/domain/terminal/tmux-viewer-guard.js.map +1 -0
- package/daemon/dist/domain/transcript-grep-worker.d.ts +2 -0
- package/daemon/dist/domain/transcript-grep-worker.d.ts.map +1 -0
- package/daemon/dist/domain/transcript-grep-worker.js +108 -0
- package/daemon/dist/domain/transcript-grep-worker.js.map +1 -0
- package/daemon/dist/domain/transcript-grep.d.ts +26 -0
- package/daemon/dist/domain/transcript-grep.d.ts.map +1 -0
- package/daemon/dist/domain/transcript-grep.js +90 -0
- package/daemon/dist/domain/transcript-grep.js.map +1 -0
- package/daemon/dist/domain/transcript-store.d.ts +8 -2
- package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
- package/daemon/dist/domain/transcript-store.js +10 -60
- package/daemon/dist/domain/transcript-store.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +69 -2
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/watchdog-delivery-receipts.d.ts +4 -0
- package/daemon/dist/domain/watchdog-delivery-receipts.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-delivery-receipts.js +35 -2
- package/daemon/dist/domain/watchdog-delivery-receipts.js.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.d.ts +44 -0
- package/daemon/dist/domain/watchdog-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.js +60 -2
- package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
- package/daemon/dist/domain/watchdog-history-log.d.ts +12 -0
- package/daemon/dist/domain/watchdog-history-log.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-history-log.js +19 -1
- package/daemon/dist/domain/watchdog-history-log.js.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts +32 -0
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.js +78 -0
- package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts +17 -3
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +19 -5
- package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +1 -1
- package/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-runtime.d.ts +12 -0
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +64 -7
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/domain/workflow-step-trail-log.d.ts +2 -2
- package/daemon/dist/domain/workflow-step-trail-log.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-step-trail-log.js.map +1 -1
- package/daemon/dist/domain/workflow-types.d.ts +3 -1
- package/daemon/dist/domain/workflow-types.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-types.js.map +1 -1
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +5 -1
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/lib/pane-envelope.d.ts +3 -0
- package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
- package/daemon/dist/lib/pane-envelope.js +3 -1
- package/daemon/dist/lib/pane-envelope.js.map +1 -1
- package/daemon/dist/mission-parent-surface.d.ts +2 -0
- package/daemon/dist/mission-parent-surface.d.ts.map +1 -0
- package/daemon/dist/mission-parent-surface.js +2 -0
- package/daemon/dist/mission-parent-surface.js.map +1 -0
- package/daemon/dist/routes/activity.d.ts +18 -1
- package/daemon/dist/routes/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +47 -9
- package/daemon/dist/routes/activity.js.map +1 -1
- package/daemon/dist/routes/attention.d.ts.map +1 -1
- package/daemon/dist/routes/attention.js +194 -177
- package/daemon/dist/routes/attention.js.map +1 -1
- package/daemon/dist/routes/core-app.d.ts +10 -0
- package/daemon/dist/routes/core-app.d.ts.map +1 -0
- package/daemon/dist/routes/core-app.js +175 -0
- package/daemon/dist/routes/core-app.js.map +1 -0
- package/daemon/dist/routes/hook-bridge.d.ts +3 -0
- package/daemon/dist/routes/hook-bridge.d.ts.map +1 -0
- package/daemon/dist/routes/hook-bridge.js +158 -0
- package/daemon/dist/routes/hook-bridge.js.map +1 -0
- package/daemon/dist/routes/missions.d.ts.map +1 -1
- package/daemon/dist/routes/missions.js +14 -2
- package/daemon/dist/routes/missions.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts +1 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +8 -5
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/rigspec.js +1 -1
- package/daemon/dist/routes/rigspec.js.map +1 -1
- package/daemon/dist/routes/scope-audit.d.ts.map +1 -1
- package/daemon/dist/routes/scope-audit.js +7 -1
- package/daemon/dist/routes/scope-audit.js.map +1 -1
- package/daemon/dist/routes/seat.d.ts.map +1 -1
- package/daemon/dist/routes/seat.js +30 -4
- package/daemon/dist/routes/seat.js.map +1 -1
- package/daemon/dist/routes/slices.d.ts.map +1 -1
- package/daemon/dist/routes/slices.js +21 -2
- package/daemon/dist/routes/slices.js.map +1 -1
- package/daemon/dist/routes/startup.js +2 -1
- package/daemon/dist/routes/startup.js.map +1 -1
- package/daemon/dist/routes/terminal.d.ts.map +1 -1
- package/daemon/dist/routes/terminal.js +47 -6
- 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 +16 -1
- package/daemon/dist/routes/transcripts.js.map +1 -1
- package/daemon/dist/routes/watchdog.d.ts.map +1 -1
- package/daemon/dist/routes/watchdog.js +3 -2
- 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 +5 -0
- 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 +11 -0
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +90 -33
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/dist/terminal-viewer-guard-surface.d.ts +2 -0
- package/daemon/dist/terminal-viewer-guard-surface.d.ts.map +1 -0
- package/daemon/dist/terminal-viewer-guard-surface.js +2 -0
- package/daemon/dist/terminal-viewer-guard-surface.js.map +1 -0
- package/daemon/docs/reference/agent-startup-guide.md +4 -1
- package/daemon/docs/reference/claude-status-line.md +3 -2
- package/daemon/docs/reference/community-harness-examples/cursor/openrig-cursor-launch +6 -0
- package/daemon/docs/reference/community-harness-examples/dsh/README.md +1 -1
- package/daemon/docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs +186 -30
- package/daemon/docs/reference/community-harness-examples/hermes/openrig-hermes-launch +6 -0
- package/daemon/docs/reference/community-harness-examples/openclaw/openrig-openclaw-launch +6 -0
- package/daemon/docs/reference/community-harness-examples/openshell/README.md +2 -0
- package/daemon/docs/reference/community-harness-examples/pi-tui/openrig-pi-tui-launch +6 -0
- package/daemon/docs/reference/community-harness-presets.md +6 -5
- package/daemon/docs/reference/core-app.md +212 -0
- package/daemon/docs/reference/daemon-http-clients.md +6 -0
- package/daemon/docs/reference/getting-started.md +9 -4
- package/daemon/docs/reference/harness-runner-contract.md +50 -4
- package/daemon/docs/reference/hosted-members.md +21 -1
- package/daemon/docs/reference/quickstart.md +4 -3
- package/daemon/docs/reference/rig-spec.md +56 -26
- package/daemon/docs/reference/rosters.md +8 -0
- package/daemon/docs/reference/sdlc-conventions.md +42 -5
- package/daemon/docs/reference/seat-delivery.md +87 -6
- package/daemon/docs/reference/terminal-sessions.md +99 -1
- package/daemon/docs/reference/whats-new.md +82 -11
- package/daemon/specs/rigs/launch/factory/guidance/lead-first-move.md +4 -3
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +13 -3
- package/daemon/specs/rigs/launch/starter/guidance/lead-first-move.md +4 -3
- package/dist/ask-wake.d.ts.map +1 -1
- package/dist/ask-wake.js +8 -1
- package/dist/ask-wake.js.map +1 -1
- package/dist/build-info.js +3 -3
- package/dist/commands/archive.js +1 -1
- package/dist/commands/archive.js.map +1 -1
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +7 -0
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +5 -0
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/ps.d.ts +2 -1
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +9 -4
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.js +4 -4
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/roster.d.ts +5 -0
- package/dist/commands/roster.d.ts.map +1 -1
- package/dist/commands/scope.d.ts.map +1 -1
- package/dist/commands/scope.js +346 -9
- package/dist/commands/scope.js.map +1 -1
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +90 -8
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/send.d.ts +2 -0
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +3 -1
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/terminal.d.ts +56 -0
- package/dist/commands/terminal.d.ts.map +1 -1
- package/dist/commands/terminal.js +194 -4
- package/dist/commands/terminal.js.map +1 -1
- package/dist/commands/transcript.js +1 -1
- package/dist/commands/transcript.js.map +1 -1
- package/dist/commands/unarchive.js +1 -1
- package/dist/commands/unarchive.js.map +1 -1
- package/dist/commands/workflow-follow.d.ts +3 -1
- package/dist/commands/workflow-follow.d.ts.map +1 -1
- package/dist/commands/workflow-follow.js +25 -6
- package/dist/commands/workflow-follow.js.map +1 -1
- package/dist/commands/workflow-render.d.ts.map +1 -1
- package/dist/commands/workflow-render.js +5 -1
- package/dist/commands/workflow-render.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +14 -4
- package/dist/commands/workflow.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +11 -0
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/lib/scope/mission-composition.d.ts +1 -0
- package/dist/lib/scope/mission-composition.d.ts.map +1 -1
- package/dist/lib/scope/mission-composition.js +14 -0
- package/dist/lib/scope/mission-composition.js.map +1 -1
- package/dist/lib/scope/scope-audit.d.ts.map +1 -1
- package/dist/lib/scope/scope-audit.js +8 -0
- package/dist/lib/scope/scope-audit.js.map +1 -1
- package/dist/lib/scope/scope-fs.d.ts +10 -0
- package/dist/lib/scope/scope-fs.d.ts.map +1 -1
- package/dist/lib/scope/scope-fs.js +60 -0
- package/dist/lib/scope/scope-fs.js.map +1 -1
- package/dist/lib/scope/types.d.ts +3 -1
- package/dist/lib/scope/types.d.ts.map +1 -1
- package/dist/lib/scope/types.js +5 -1
- package/dist/lib/scope/types.js.map +1 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +18 -8
- package/dist/mcp-server.js.map +1 -1
- package/dist/restore-packet/packet-writer.d.ts.map +1 -1
- package/dist/restore-packet/packet-writer.js +8 -5
- package/dist/restore-packet/packet-writer.js.map +1 -1
- package/dist/terminal-window.d.ts +2 -1
- package/dist/terminal-window.d.ts.map +1 -1
- package/dist/terminal-window.js +567 -41
- package/dist/terminal-window.js.map +1 -1
- package/package.json +1 -1
- package/tui/dist/daemon-client.d.ts +4 -0
- package/tui/dist/daemon-client.d.ts.map +1 -1
- package/tui/dist/daemon-client.js.map +1 -1
- package/tui/dist/execution/execution-model.d.ts.map +1 -1
- package/tui/dist/execution/execution-model.js +22 -5
- package/tui/dist/execution/execution-model.js.map +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +6 -3
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/navigator.d.ts +1 -1
- package/tui/dist/navigator.d.ts.map +1 -1
- package/tui/dist/navigator.js +4 -2
- package/tui/dist/navigator.js.map +1 -1
- package/tui/dist/pulse/render-pulse.d.ts.map +1 -1
- package/tui/dist/pulse/render-pulse.js +7 -14
- package/tui/dist/pulse/render-pulse.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +29 -21
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/stylize.d.ts.map +1 -1
- package/tui/dist/stylize.js +3 -3
- package/tui/dist/stylize.js.map +1 -1
- package/tui/dist/terminals/terminal-model.d.ts +1 -0
- package/tui/dist/terminals/terminal-model.d.ts.map +1 -1
- package/tui/dist/terminals/terminal-model.js +4 -2
- package/tui/dist/terminals/terminal-model.js.map +1 -1
- package/tui/dist/types.d.ts +1 -0
- package/tui/dist/types.d.ts.map +1 -1
- package/tui/dist/visual-layout.d.ts +3 -0
- package/tui/dist/visual-layout.d.ts.map +1 -1
- package/tui/dist/visual-layout.js +17 -0
- package/tui/dist/visual-layout.js.map +1 -1
- package/ui/dist/assets/{index-1O1f3A7K.js → index-B-sMy02c.js} +107 -107
- package/ui/dist/assets/{index-BX8TUZ0E.css → index-DiN7RwWg.css} +1 -1
- package/ui/dist/index.html +2 -2
|
@@ -857,6 +857,17 @@ export class RunnerCore {
|
|
|
857
857
|
paneError = false;
|
|
858
858
|
/** A runtime-reported automatic retry is in flight; the row says retrying until it ends. */
|
|
859
859
|
paneRetrying = false;
|
|
860
|
+
nativeEpoch = 0;
|
|
861
|
+
nativeTurn = null;
|
|
862
|
+
nativeTurnSequence = 0;
|
|
863
|
+
nativeTurnPosts = Promise.resolve();
|
|
864
|
+
cancellationFence = null;
|
|
865
|
+
cancellation = null;
|
|
866
|
+
nativeQueues = null;
|
|
867
|
+
epochSteers = new Set();
|
|
868
|
+
personSteers = new Set();
|
|
869
|
+
heldPersonPrompts = [];
|
|
870
|
+
pendingNativeInputs = new Set();
|
|
860
871
|
/** Pi runs this runner has opened, each posted as an accepted turn (contract section 4): the working beat names it. */
|
|
861
872
|
turn = 0;
|
|
862
873
|
sessionFile;
|
|
@@ -914,8 +925,46 @@ export class RunnerCore {
|
|
|
914
925
|
/** Runner readiness is the sidecar's acknowledged get_state, not RPC transport ready. */
|
|
915
926
|
isReady() { return this.ready; }
|
|
916
927
|
/** A permanent reporting-authority refusal fences new managed dispatch, not person input or native work already in flight. */
|
|
917
|
-
quarantineManagedChannel() {
|
|
918
|
-
|
|
928
|
+
quarantineManagedChannel() {
|
|
929
|
+
this.managedQuarantined = true;
|
|
930
|
+
if (this.cancellation && !this.cancellation.submitted)
|
|
931
|
+
this.rejectNativeCancellation(this.cancellation.entry, "runner_reporting_authority_lost");
|
|
932
|
+
}
|
|
933
|
+
nativeChannelCapabilities() { return { input: this.ready && !this.managedQuarantined, wake: this.ready && !this.managedQuarantined && this.nativeQueueStateAvailable && this.runtime === "pi", cancel: this.ready && !this.managedQuarantined && this.runtime === "pi" && !!this.io.withdrawNativeTurn }; }
|
|
934
|
+
/** Install the local preparation fence; this method alone submits no native operation. */
|
|
935
|
+
prepareNativeCancellation(target) {
|
|
936
|
+
if (this.runtime !== "pi" || !this.ready || this.managedQuarantined || !this.nativeTurn
|
|
937
|
+
|| !this.nativeTurn.owned || target.runId !== this.identity.runId || target.nativeTurnId !== this.nativeTurn.id
|
|
938
|
+
|| this.cancellationFence && this.cancellationFence !== target.nativeTurnId)
|
|
939
|
+
return false;
|
|
940
|
+
this.cancellationFence = target.nativeTurnId;
|
|
941
|
+
return true;
|
|
942
|
+
}
|
|
943
|
+
/** After withdrawal, retain E's fence if still live; release only a pre-submit mismatch. */
|
|
944
|
+
recheckNativeCancellation(target) {
|
|
945
|
+
if (target.runId !== this.identity.runId || this.cancellationFence !== target.nativeTurnId)
|
|
946
|
+
return false;
|
|
947
|
+
if (this.cancellation?.ended || this.nativeTurn?.id === target.nativeTurnId)
|
|
948
|
+
return true;
|
|
949
|
+
this.cancellationFence = null;
|
|
950
|
+
this.pumpPersonPrompts();
|
|
951
|
+
this.pumpManaged();
|
|
952
|
+
return false;
|
|
953
|
+
}
|
|
954
|
+
reportNativeTurn(state) {
|
|
955
|
+
if (!this.nativeTurn || !this.identity.runId || !this.io.postRunner || this.runtime !== "pi")
|
|
956
|
+
return;
|
|
957
|
+
const body = { type: "turn", runId: this.identity.runId, sequence: ++this.nativeTurnSequence,
|
|
958
|
+
nativeTurnId: this.nativeTurn.id, state, acceptedTurnIds: [...this.nativeTurn.accepted] };
|
|
959
|
+
this.nativeTurnPosts = this.nativeTurnPosts.then(() => this.io.postRunner(body)).catch(() => { });
|
|
960
|
+
}
|
|
961
|
+
pumpPersonPrompts() {
|
|
962
|
+
if (this.streaming || this.pendingManagedStart || !this.ready || this.cancellation?.submitted || this.cancellation?.ended)
|
|
963
|
+
return;
|
|
964
|
+
const command = this.heldPersonPrompts.shift();
|
|
965
|
+
if (command)
|
|
966
|
+
this.personPrompt(command.type === "follow_up" ? { type: "prompt", message: command.message, streamingBehavior: "steer" } : command);
|
|
967
|
+
}
|
|
919
968
|
/** Kick off identity capture. Called once pi's RPC stream is up; for OMP, with its `ready` frame. */
|
|
920
969
|
start(ready) {
|
|
921
970
|
// K4: the first credential observation, before Pi can make any request of this runner's.
|
|
@@ -1001,12 +1050,14 @@ export class RunnerCore {
|
|
|
1001
1050
|
}
|
|
1002
1051
|
get runtime() { return this.opts.runtime ?? "pi"; }
|
|
1003
1052
|
async acceptRunnerRequest(frame) {
|
|
1004
|
-
if (!this.ready || this.runtime !== "pi" || !this.io.postRunner || frame.version !== 1 || frame.runId !== this.identity.runId
|
|
1053
|
+
if (!this.ready || this.runtime !== "pi" && frame.kind !== "input" || !this.io.postRunner || frame.version !== 1 || frame.runId !== this.identity.runId
|
|
1005
1054
|
|| !Number.isSafeInteger(frame.sequence) || frame.sequence < 1 || typeof frame.requestId !== "string"
|
|
1006
|
-
|| !["input", "wake"].includes(frame.kind)
|
|
1055
|
+
|| !["input", "wake", "cancel"].includes(frame.kind)
|
|
1056
|
+
|| (frame.kind === "cancel" ? !frame.payload?.target || frame.payload.target.runId !== frame.runId || typeof frame.payload.target.nativeTurnId !== "string"
|
|
1057
|
+
: typeof (frame.kind === "wake" ? frame.payload?.question : frame.payload?.text) !== "string"))
|
|
1007
1058
|
return;
|
|
1008
1059
|
frame = { version: 1, runId: frame.runId, requestId: frame.requestId, sequence: frame.sequence, kind: frame.kind,
|
|
1009
|
-
payload: frame.kind === "wake" ? { question: frame.payload.question } : { text: frame.payload.text } };
|
|
1060
|
+
payload: frame.kind === "cancel" ? { target: { ...frame.payload.target } } : frame.kind === "wake" ? { question: frame.payload.question } : { text: frame.payload.text } };
|
|
1010
1061
|
if ([...this.managed.values()].some(entry => entry.frame.sequence === frame.sequence && entry.frame.requestId !== frame.requestId))
|
|
1011
1062
|
throw new Error("Conflicting native sequence");
|
|
1012
1063
|
const old = this.managed.get(frame.requestId);
|
|
@@ -1018,13 +1069,45 @@ export class RunnerCore {
|
|
|
1018
1069
|
}
|
|
1019
1070
|
const entry = { frame, state: "accepting", reports: Promise.resolve() };
|
|
1020
1071
|
this.managed.set(frame.requestId, entry);
|
|
1072
|
+
const named = frame.kind === "cancel" ? frame.payload.target : null;
|
|
1073
|
+
const prepared = named && !this.cancellation && this.prepareNativeCancellation(named);
|
|
1074
|
+
const operation = prepared ? { entry, target: named, submitted: false, acknowledged: false, ended: false, aborted: false, revision: this.promptRevision } : null;
|
|
1075
|
+
if (operation)
|
|
1076
|
+
this.cancellation = operation;
|
|
1021
1077
|
entry.acceptance = (async () => {
|
|
1022
1078
|
const accepted = await this.io.postRunner({ type: "ack", runId: frame.runId, requestId: frame.requestId, sequence: frame.sequence, state: "accepted" });
|
|
1023
1079
|
if (!accepted) {
|
|
1024
1080
|
entry.state = "unavailable";
|
|
1081
|
+
if (operation && this.cancellation === operation && !operation.submitted && !operation.ended) {
|
|
1082
|
+
this.cancellation = null;
|
|
1083
|
+
if (this.cancellationFence === operation.target.nativeTurnId)
|
|
1084
|
+
this.cancellationFence = null;
|
|
1085
|
+
this.pumpPersonPrompts();
|
|
1086
|
+
}
|
|
1025
1087
|
this.pumpManaged();
|
|
1026
1088
|
return;
|
|
1027
1089
|
}
|
|
1090
|
+
if (operation && this.cancellation !== operation)
|
|
1091
|
+
return;
|
|
1092
|
+
if (named) {
|
|
1093
|
+
entry.state = "queued";
|
|
1094
|
+
if (!prepared) {
|
|
1095
|
+
if (this.cancellation)
|
|
1096
|
+
this.rejectNativeCancellation(entry, "cancellation_in_progress");
|
|
1097
|
+
else if (this.nativeTurn && this.nativeTurn.id !== named.nativeTurnId) {
|
|
1098
|
+
entry.state = "terminal";
|
|
1099
|
+
this.reportManaged(entry, "result", { kind: "cancel", outcome: "not-this-turn", confirmed: false });
|
|
1100
|
+
}
|
|
1101
|
+
else
|
|
1102
|
+
this.rejectNativeCancellation(entry, "native_turn_ownership_unknown");
|
|
1103
|
+
}
|
|
1104
|
+
else
|
|
1105
|
+
void this.performNativeCancellation(operation).catch(() => {
|
|
1106
|
+
if (this.cancellation === operation && !operation.submitted)
|
|
1107
|
+
this.rejectNativeCancellation(entry, "preparation_failed");
|
|
1108
|
+
});
|
|
1109
|
+
return;
|
|
1110
|
+
}
|
|
1028
1111
|
entry.state = "queued";
|
|
1029
1112
|
this.managedQueue.push(entry);
|
|
1030
1113
|
this.managedQueue.sort((a, b) => a.frame.sequence - b.frame.sequence);
|
|
@@ -1036,11 +1119,122 @@ export class RunnerCore {
|
|
|
1036
1119
|
const f = entry.frame;
|
|
1037
1120
|
if (type !== "submitted" && result)
|
|
1038
1121
|
entry.terminalResult = result;
|
|
1039
|
-
entry.reports = entry.reports.then(() =>
|
|
1040
|
-
|
|
1122
|
+
entry.reports = entry.reports.then(async () => {
|
|
1123
|
+
await entry.acceptance;
|
|
1124
|
+
if (entry.state === "unavailable")
|
|
1125
|
+
return;
|
|
1126
|
+
return this.io.postRunner?.({ type, runId: f.runId, requestId: f.requestId, sequence: f.sequence,
|
|
1127
|
+
...(entry.nativeTurnId ? { nativeTurnId: entry.nativeTurnId } : {}),
|
|
1128
|
+
...(entry.acceptedTurnId ? { acceptedTurnId: entry.acceptedTurnId } : {}), ...(result ? { result } : {}) });
|
|
1129
|
+
}).catch(() => { });
|
|
1130
|
+
}
|
|
1131
|
+
async performNativeCancellation(operation) {
|
|
1132
|
+
const { entry, target } = operation;
|
|
1133
|
+
if (this.cancellation !== operation || operation.ended)
|
|
1134
|
+
return;
|
|
1135
|
+
if (!this.io.withdrawNativeTurn) {
|
|
1136
|
+
this.finishNativeCancellation("not-supported");
|
|
1137
|
+
return;
|
|
1138
|
+
}
|
|
1139
|
+
for (;;) {
|
|
1140
|
+
if (this.cancellation !== operation || operation.ended)
|
|
1141
|
+
return;
|
|
1142
|
+
const withdrawal = await this.io.withdrawNativeTurn({ type: "cancel-prepare", runId: entry.frame.runId, requestId: entry.frame.requestId, sequence: entry.frame.sequence });
|
|
1143
|
+
if (this.cancellation !== operation || operation.ended)
|
|
1144
|
+
return;
|
|
1145
|
+
if (!withdrawal) {
|
|
1146
|
+
this.rejectNativeCancellation(entry, "preparation_failed");
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
if (operation.revision !== this.promptRevision) {
|
|
1150
|
+
this.rejectNativeCancellation(entry, "person_input_after_preparation");
|
|
1151
|
+
return;
|
|
1152
|
+
}
|
|
1153
|
+
if (!this.nativeTurn || this.nativeTurn.id !== target.nativeTurnId || withdrawal.notThisTurn) {
|
|
1154
|
+
this.finishNativeCancellation("not-this-turn");
|
|
1155
|
+
return;
|
|
1156
|
+
}
|
|
1157
|
+
if (withdrawal?.confirmed)
|
|
1158
|
+
break;
|
|
1159
|
+
if (!this.ready || this.cancellation !== operation)
|
|
1160
|
+
return;
|
|
1161
|
+
await new Promise(resolve => setTimeout(resolve, 250));
|
|
1162
|
+
}
|
|
1163
|
+
if (!this.ready || this.nativeTurn?.id !== target.nativeTurnId) {
|
|
1164
|
+
this.finishNativeCancellation("not-this-turn");
|
|
1165
|
+
return;
|
|
1166
|
+
}
|
|
1167
|
+
if (!this.nativeTurn.owned || this.managedQuarantined || !this.ownsNativeCancellationQueue()) {
|
|
1168
|
+
this.rejectNativeCancellation(entry, "native_queue_ownership_unknown");
|
|
1169
|
+
return;
|
|
1170
|
+
}
|
|
1171
|
+
// The state reply is correlated to this captured preparation. E is rechecked again after the await.
|
|
1172
|
+
this.io.sendRpc({ type: "get_state", id: `openrig-cancel-preflight-${entry.frame.requestId}` });
|
|
1173
|
+
}
|
|
1174
|
+
ownsNativeCancellationQueue(pending) {
|
|
1175
|
+
if (this.nativeQueues && (this.nativeQueues.followUp.length > 0 || this.nativeQueues.steering.some(text => this.personSteers.has(text) || !this.epochSteers.has(text))))
|
|
1176
|
+
return false;
|
|
1177
|
+
if (pending === undefined)
|
|
1178
|
+
return true;
|
|
1179
|
+
if (!Number.isSafeInteger(pending) || pending < 0)
|
|
1180
|
+
return false;
|
|
1181
|
+
return pending === 0 ? !this.nativeQueues || this.nativeQueues.steering.length === 0
|
|
1182
|
+
: !!this.nativeQueues && this.nativeQueues.steering.length === pending;
|
|
1183
|
+
}
|
|
1184
|
+
/** Only this local owner can establish that no native cancel was written. */
|
|
1185
|
+
rejectNativeCancellation(entry, reason) {
|
|
1186
|
+
if (this.cancellation?.entry === entry) {
|
|
1187
|
+
if (this.cancellation.submitted || this.cancellation.ended)
|
|
1188
|
+
return;
|
|
1189
|
+
this.cancellation = null;
|
|
1190
|
+
this.cancellationFence = null;
|
|
1191
|
+
}
|
|
1192
|
+
entry.state = "terminal";
|
|
1193
|
+
this.diag(`Cancellation ${JSON.stringify(entry.frame.requestId)} was not applied (${reason}); withdrawn approvals stay withdrawn. Person input remains available.`);
|
|
1194
|
+
this.reportManaged(entry, "rejected", { kind: "cancel", reason, applied: false });
|
|
1195
|
+
this.pumpPersonPrompts();
|
|
1196
|
+
this.pumpManaged();
|
|
1197
|
+
}
|
|
1198
|
+
finishNativeCancellation(outcome, detail) {
|
|
1199
|
+
const operation = this.cancellation;
|
|
1200
|
+
if (!operation)
|
|
1201
|
+
return;
|
|
1202
|
+
const unavailable = operation.entry.state === "unavailable";
|
|
1203
|
+
if (!unavailable)
|
|
1204
|
+
operation.entry.state = "terminal";
|
|
1205
|
+
const words = this.nativeQueues ? [...this.nativeQueues.steering, ...this.nativeQueues.followUp] : [];
|
|
1206
|
+
const inputRequestIds = [];
|
|
1207
|
+
let unmatchedCount = this.nativeQueues ? 0 : operation.pendingMessages ?? 0;
|
|
1208
|
+
for (const text of words) {
|
|
1209
|
+
const matches = [...this.managed.values()].filter(entry => entry.frame.kind === "input" && entry.nativeTurnId === operation.target.nativeTurnId && entry.frame.payload.text === text);
|
|
1210
|
+
if (matches.length === 1 && matches[0].frame.requestId.length > 0 && matches[0].frame.requestId.length <= 1024 && inputRequestIds.length < 100 && !inputRequestIds.includes(matches[0].frame.requestId))
|
|
1211
|
+
inputRequestIds.push(matches[0].frame.requestId);
|
|
1212
|
+
else
|
|
1213
|
+
unmatchedCount++;
|
|
1214
|
+
}
|
|
1215
|
+
if (!unavailable)
|
|
1216
|
+
this.reportManaged(operation.entry, "result", { kind: "cancel", outcome, confirmed: outcome === "cancelled", operationAccepted: operation.acknowledged, ...(detail ? { detail } : {}),
|
|
1217
|
+
...(operation.submitted && (words.length || unmatchedCount) ? { continuation: { inputRequestIds, pendingRequestIds: this.managedQueue.map(entry => entry.frame.requestId).filter(id => id.length > 0 && id.length <= 1024).slice(0, 100), unmatchedCount } } : {}) });
|
|
1218
|
+
this.cancellation = null;
|
|
1219
|
+
this.cancellationFence = null;
|
|
1220
|
+
this.pumpPersonPrompts();
|
|
1221
|
+
this.pumpManaged();
|
|
1222
|
+
}
|
|
1223
|
+
finishEndedNativeCancellation(settled = false) {
|
|
1224
|
+
const operation = this.cancellation;
|
|
1225
|
+
if (!operation?.ended || !settled)
|
|
1226
|
+
return;
|
|
1227
|
+
if (!operation.submitted) {
|
|
1228
|
+
this.finishNativeCancellation("not-this-turn");
|
|
1229
|
+
return;
|
|
1230
|
+
}
|
|
1231
|
+
const queueEmpty = operation.pendingMessages === 0 && (!this.nativeQueues
|
|
1232
|
+
|| this.nativeQueues.steering.length === 0 && this.nativeQueues.followUp.length === 0);
|
|
1233
|
+
const confirmed = operation.aborted && queueEmpty && operation.revision === this.promptRevision;
|
|
1234
|
+
this.finishNativeCancellation(confirmed ? "cancelled" : "requested", confirmed ? undefined : "native_end_without_cancellation_proof");
|
|
1041
1235
|
}
|
|
1042
1236
|
pumpManaged() {
|
|
1043
|
-
if (!this.ready || this.managedQuarantined || this.managedWake || this.pendingManagedStart && !this.streaming)
|
|
1237
|
+
if (!this.ready || this.cancellationFence || this.managedQuarantined || this.managedWake || this.runtime === "pi" && this.pendingManagedStart && !this.streaming)
|
|
1044
1238
|
return;
|
|
1045
1239
|
const entry = this.managedQueue[0];
|
|
1046
1240
|
if (!entry || this.personPreflights.size || [...this.managed.values()].some(prior => prior.state === "accepting" && prior.frame.sequence < entry.frame.sequence)
|
|
@@ -1060,12 +1254,22 @@ export class RunnerCore {
|
|
|
1060
1254
|
this.managedWake = entry;
|
|
1061
1255
|
entry.answer = [];
|
|
1062
1256
|
}
|
|
1063
|
-
if (!this.streaming)
|
|
1257
|
+
if (this.runtime === "pi" && !this.streaming)
|
|
1064
1258
|
this.pendingManagedStart = true;
|
|
1065
1259
|
const id = `openrig-native-${entry.frame.requestId}`;
|
|
1066
1260
|
this.managedRpc.set(id, entry);
|
|
1261
|
+
if (this.runtime === "pi" && this.streaming && entry.frame.kind === "input")
|
|
1262
|
+
this.epochSteers.add(entry.frame.payload.text);
|
|
1067
1263
|
this.io.sendRpc({ id, type: "prompt", message: entry.frame.kind === "wake" ? entry.frame.payload.question : entry.frame.payload.text, streamingBehavior: "steer" });
|
|
1068
1264
|
this.acceptIntoOpenRun();
|
|
1265
|
+
if (this.runtime === "pi") {
|
|
1266
|
+
if (this.nativeTurn) {
|
|
1267
|
+
entry.nativeTurnId = this.nativeTurn.id;
|
|
1268
|
+
entry.acceptedTurnId = String(this.turn);
|
|
1269
|
+
}
|
|
1270
|
+
else
|
|
1271
|
+
this.pendingNativeInputs.add(entry);
|
|
1272
|
+
}
|
|
1069
1273
|
// Ordinary busy messages may steer; the next queued wake waits for agent_end, not this RPC response.
|
|
1070
1274
|
this.pumpManaged();
|
|
1071
1275
|
}
|
|
@@ -1080,7 +1284,7 @@ export class RunnerCore {
|
|
|
1080
1284
|
const completion = ownershipUnknown || forced && !entry.nativeAccepted ? "unknown" : forced ?? (entry.contaminated || !entry.wakeOpened ? "unknown"
|
|
1081
1285
|
: entry.stopReason === "stop" && entry.answer?.some(text => text.length > 0) ? "completed" : entry.stopReason === "aborted" ? "interrupted" : entry.stopReason === "error" ? "failed" : "unknown");
|
|
1082
1286
|
entry.state = "terminal";
|
|
1083
|
-
entry.terminalResult = { kind: "wake", nativeTurnId:
|
|
1287
|
+
entry.terminalResult = { kind: "wake", ...(entry.nativeTurnId ? { nativeTurnId: entry.nativeTurnId } : {}),
|
|
1084
1288
|
completion, answer: completion === "completed" ? entry.answer?.join("\n") ?? "" : null,
|
|
1085
1289
|
...(ownershipUnknown ? { ownershipUnknown: true } : {}),
|
|
1086
1290
|
...(forced && !entry.nativeAccepted ? { submissionUnknown: true } : {}) };
|
|
@@ -1094,14 +1298,23 @@ export class RunnerCore {
|
|
|
1094
1298
|
this.io.sendRpc(command);
|
|
1095
1299
|
return;
|
|
1096
1300
|
}
|
|
1301
|
+
if (this.cancellation?.submitted || this.cancellation?.ended || command.type === "follow_up" && (this.streaming || this.pendingManagedStart)) {
|
|
1302
|
+
this.heldPersonPrompts.push(command);
|
|
1303
|
+
return;
|
|
1304
|
+
}
|
|
1097
1305
|
const id = `openrig-person-${++this.promptRevision}`;
|
|
1098
1306
|
this.personPreflights.add(id);
|
|
1099
1307
|
if (!this.streaming)
|
|
1100
1308
|
this.pendingManagedStart = true;
|
|
1309
|
+
if (this.streaming && typeof command.message === "string")
|
|
1310
|
+
this.personSteers.add(command.message);
|
|
1101
1311
|
this.io.sendRpc({ ...command, id });
|
|
1312
|
+
this.acceptIntoOpenRun();
|
|
1102
1313
|
}
|
|
1103
1314
|
/** One aggregated paste block from pane stdin. */
|
|
1104
1315
|
handleUserBlock(block) {
|
|
1316
|
+
if (this.cancellation && !this.cancellation.submitted && !this.cancellation.ended)
|
|
1317
|
+
this.rejectNativeCancellation(this.cancellation.entry, "person_input_after_preparation");
|
|
1105
1318
|
const compact = /^\/openrig-compact ([\w-]+)$/.exec(block);
|
|
1106
1319
|
if (this.runtime === "pi" && compact) {
|
|
1107
1320
|
const attemptId = compact[1];
|
|
@@ -1128,7 +1341,8 @@ export class RunnerCore {
|
|
|
1128
1341
|
const message = block.slice("/followup ".length);
|
|
1129
1342
|
this.personPrompt({ type: "follow_up", message });
|
|
1130
1343
|
this.io.mirrorLine(`${this.style.commit("you (follow-up) ▸")} ${message}`);
|
|
1131
|
-
this.
|
|
1344
|
+
if (this.runtime !== "pi" || !this.io.postRunner)
|
|
1345
|
+
this.acceptIntoOpenRun();
|
|
1132
1346
|
return;
|
|
1133
1347
|
}
|
|
1134
1348
|
// The runtime decides, not the runner: with streamingBehavior "steer", Pi and OMP run the prompt when idle and,
|
|
@@ -1137,7 +1351,8 @@ export class RunnerCore {
|
|
|
1137
1351
|
// when a prompt was consumed locally and started none. It labels the mirror line only.
|
|
1138
1352
|
this.personPrompt({ type: "prompt", message: block, streamingBehavior: "steer" });
|
|
1139
1353
|
this.io.mirrorLine(this.streaming ? `${this.style.commit("you (steer) ▸")} ${block}` : `${this.style.commit("you ▸")} ${block}`);
|
|
1140
|
-
this.
|
|
1354
|
+
if (this.runtime !== "pi" || !this.io.postRunner)
|
|
1355
|
+
this.acceptIntoOpenRun();
|
|
1141
1356
|
}
|
|
1142
1357
|
/** A working beat counts only for the latest accepted turn, and each prompt the runner gives the agent is accepted with
|
|
1143
1358
|
* its own number (contract section 4). One sent while a Pi run is open is posted as it's sent, and the run's end
|
|
@@ -1147,12 +1362,18 @@ export class RunnerCore {
|
|
|
1147
1362
|
if (this.runtime === "omp" || !this.streaming)
|
|
1148
1363
|
return;
|
|
1149
1364
|
this.turn += 1;
|
|
1365
|
+
if (this.nativeTurn) {
|
|
1366
|
+
this.nativeTurn.accepted.push(String(this.turn));
|
|
1367
|
+
this.reportNativeTurn("opened");
|
|
1368
|
+
}
|
|
1150
1369
|
this.io.postActivity(this.activityPayload("UserPromptSubmit", "accepted", { turnId: String(this.turn) }));
|
|
1151
1370
|
}
|
|
1152
1371
|
/** Child process exit — honest, loud, durable. */
|
|
1153
1372
|
handlePiExit(code) {
|
|
1154
1373
|
this.ready = false;
|
|
1155
1374
|
this.paneExited = true;
|
|
1375
|
+
if (this.cancellation)
|
|
1376
|
+
this.finishNativeCancellation(this.cancellation.submitted ? "requested" : "not-this-turn", "native_process_exited");
|
|
1156
1377
|
if (this.managedWake)
|
|
1157
1378
|
this.finishManagedWake(this.managedWake, "failed");
|
|
1158
1379
|
this.reportDroppedFrame(this.frameDecoder?.incomplete());
|
|
@@ -1162,6 +1383,37 @@ export class RunnerCore {
|
|
|
1162
1383
|
this.refreshPaneStatus();
|
|
1163
1384
|
}
|
|
1164
1385
|
handleResponse(record) {
|
|
1386
|
+
const cancellation = this.cancellation;
|
|
1387
|
+
if (cancellation && !cancellation.submitted && record.id === `openrig-cancel-preflight-${cancellation.entry.frame.requestId}`) {
|
|
1388
|
+
if (cancellation.ended)
|
|
1389
|
+
return;
|
|
1390
|
+
const state = record.data;
|
|
1391
|
+
if (!this.ready || this.nativeTurn?.id !== cancellation.target.nativeTurnId || state?.isStreaming === false) {
|
|
1392
|
+
this.finishNativeCancellation("not-this-turn");
|
|
1393
|
+
return;
|
|
1394
|
+
}
|
|
1395
|
+
if (cancellation.revision !== this.promptRevision) {
|
|
1396
|
+
this.rejectNativeCancellation(cancellation.entry, "person_input_after_preparation");
|
|
1397
|
+
return;
|
|
1398
|
+
}
|
|
1399
|
+
if (record.success !== true || state?.isStreaming !== true || typeof state.pendingMessageCount !== "number"
|
|
1400
|
+
|| !this.nativeTurn.owned || this.managedQuarantined || !this.ownsNativeCancellationQueue(state.pendingMessageCount)) {
|
|
1401
|
+
this.rejectNativeCancellation(cancellation.entry, "native_queue_ownership_unknown");
|
|
1402
|
+
return;
|
|
1403
|
+
}
|
|
1404
|
+
cancellation.pendingMessages = state.pendingMessageCount;
|
|
1405
|
+
cancellation.submitted = true;
|
|
1406
|
+
cancellation.entry.state = "submitted";
|
|
1407
|
+
this.io.sendRpc({ type: "abort", id: `openrig-cancel-${cancellation.entry.frame.requestId}` });
|
|
1408
|
+
this.reportManaged(cancellation.entry, "submitted", { kind: "cancel", outcome: "requested", confirmed: false, operationAccepted: false });
|
|
1409
|
+
this.diag(`Cancellation ${JSON.stringify(cancellation.entry.frame.requestId)} for ${JSON.stringify(cancellation.target.nativeTurnId)} is requested, not confirmed. Managed inputs ${JSON.stringify(this.managedQueue.map(entry => entry.frame.requestId))} remain recorded for ${this.identity.sessionName}. Inspect rig seat status ${this.identity.sessionName} --json. The named invocation settling releases the cancellation hold; a wake still waits for native idle and an empty queue. Continue with a new plain prompt in this pane, without resending retained words. This is distinct from /abort or stopping the seat; continuation is not cancellation proof and never restores withdrawn approvals. Person's /abort remains available, or explicitly choose rig seat stop ${this.identity.sessionName} --reason <reason>. Nothing restarts or replays automatically.`);
|
|
1410
|
+
return;
|
|
1411
|
+
}
|
|
1412
|
+
if (cancellation && record.id === `openrig-cancel-${cancellation.entry.frame.requestId}`) {
|
|
1413
|
+
if (record.success === true)
|
|
1414
|
+
cancellation.acknowledged = true;
|
|
1415
|
+
return;
|
|
1416
|
+
}
|
|
1165
1417
|
if (this.idleQuery && record.id === this.idleQuery.id) {
|
|
1166
1418
|
const query = this.idleQuery;
|
|
1167
1419
|
this.idleQuery = null;
|
|
@@ -1186,6 +1438,7 @@ export class RunnerCore {
|
|
|
1186
1438
|
if (typeof record.id === "string" && this.personPreflights.delete(record.id)) {
|
|
1187
1439
|
if (record.success !== true || record.data?.disposition === "handled")
|
|
1188
1440
|
this.pendingManagedStart = false;
|
|
1441
|
+
this.pumpPersonPrompts();
|
|
1189
1442
|
this.pumpManaged();
|
|
1190
1443
|
if (record.success !== false && record.error == null)
|
|
1191
1444
|
return;
|
|
@@ -1197,8 +1450,9 @@ export class RunnerCore {
|
|
|
1197
1450
|
managed.nativeAccepted = true;
|
|
1198
1451
|
managed.state = "submitted";
|
|
1199
1452
|
this.reportManaged(managed, "submitted");
|
|
1453
|
+
const inputData = record.data;
|
|
1200
1454
|
if (managed.frame.kind === "wake") {
|
|
1201
|
-
const disposition =
|
|
1455
|
+
const disposition = inputData?.disposition;
|
|
1202
1456
|
managed.disposition = typeof disposition === "string" ? disposition : "unknown";
|
|
1203
1457
|
if (!["started", "handled"].includes(managed.disposition) || managed.preDispositionEvents)
|
|
1204
1458
|
this.managedQuarantined = true;
|
|
@@ -1208,24 +1462,44 @@ export class RunnerCore {
|
|
|
1208
1462
|
this.reportManaged(managed, "result", managed.terminalResult);
|
|
1209
1463
|
if (this.managedWake !== managed && !this.streaming) {
|
|
1210
1464
|
this.pendingManagedStart = false;
|
|
1465
|
+
this.pumpPersonPrompts();
|
|
1211
1466
|
this.pumpManaged();
|
|
1212
1467
|
}
|
|
1213
1468
|
}
|
|
1214
|
-
else {
|
|
1469
|
+
else if (this.runtime !== "pi") {
|
|
1470
|
+
// Input acceptance needs the correlated RPC response, not an invented native invocation.
|
|
1215
1471
|
managed.state = "terminal";
|
|
1216
1472
|
this.reportManaged(managed, "result", { kind: "input", accepted: true });
|
|
1217
|
-
|
|
1218
|
-
|
|
1473
|
+
}
|
|
1474
|
+
else {
|
|
1475
|
+
managed.disposition = inputData?.agentInvoked === false ? "handled" : typeof inputData?.disposition === "string" ? inputData.disposition : "unknown";
|
|
1476
|
+
if (managed.disposition === "handled") {
|
|
1477
|
+
this.pendingNativeInputs.delete(managed);
|
|
1478
|
+
delete managed.nativeTurnId;
|
|
1479
|
+
delete managed.acceptedTurnId;
|
|
1480
|
+
if (!this.streaming)
|
|
1481
|
+
this.pendingManagedStart = false;
|
|
1482
|
+
}
|
|
1483
|
+
// A started prompt's acknowledgement precedes agent_start. Wait for that actual scope before
|
|
1484
|
+
// committing its immutable terminal receipt; a handled local command has no native epoch.
|
|
1485
|
+
if (managed.disposition !== "started" || managed.nativeTurnId) {
|
|
1486
|
+
managed.state = "terminal";
|
|
1487
|
+
this.reportManaged(managed, "result", { kind: "input", accepted: true });
|
|
1488
|
+
}
|
|
1489
|
+
if (managed.disposition === "handled") {
|
|
1490
|
+
this.pumpPersonPrompts();
|
|
1219
1491
|
this.pumpManaged();
|
|
1220
1492
|
}
|
|
1221
1493
|
}
|
|
1222
1494
|
}
|
|
1223
1495
|
else {
|
|
1496
|
+
this.pendingNativeInputs.delete(managed);
|
|
1224
1497
|
managed.state = "terminal";
|
|
1225
1498
|
this.pendingManagedStart = false;
|
|
1226
1499
|
this.reportManaged(managed, "rejected", { kind: managed.frame.kind, reason: "native_prompt_rejected" });
|
|
1227
1500
|
if (this.managedWake === managed)
|
|
1228
1501
|
this.managedWake = null;
|
|
1502
|
+
this.pumpPersonPrompts();
|
|
1229
1503
|
this.pumpManaged();
|
|
1230
1504
|
}
|
|
1231
1505
|
return;
|
|
@@ -1584,6 +1858,25 @@ export class RunnerCore {
|
|
|
1584
1858
|
}
|
|
1585
1859
|
this.writeSidecar({});
|
|
1586
1860
|
}
|
|
1861
|
+
if (event.type === "queue_update") {
|
|
1862
|
+
if (this.cancellation?.submitted && (!Array.isArray(event.steering) || !event.steering.every(text => typeof text === "string") || !Array.isArray(event.followUp) || !event.followUp.every(text => typeof text === "string") || event.steering.length > 0 || event.followUp.length > 0))
|
|
1863
|
+
this.cancellation.pendingMessages = Math.max(1, this.cancellation.pendingMessages ?? 0);
|
|
1864
|
+
this.nativeQueues = Array.isArray(event.steering) && event.steering.every(text => typeof text === "string")
|
|
1865
|
+
&& Array.isArray(event.followUp) && event.followUp.every(text => typeof text === "string")
|
|
1866
|
+
? { steering: event.steering, followUp: event.followUp } : null;
|
|
1867
|
+
}
|
|
1868
|
+
if (event.type === "agent_settled" && this.cancellation?.ended) {
|
|
1869
|
+
if (typeof event.aborted === "boolean")
|
|
1870
|
+
this.cancellation.aborted = event.aborted;
|
|
1871
|
+
this.finishEndedNativeCancellation(true);
|
|
1872
|
+
}
|
|
1873
|
+
if (this.cancellation && this.nativeTurn?.id === this.cancellation.target.nativeTurnId) {
|
|
1874
|
+
const message = event.message;
|
|
1875
|
+
if (event.type === "message_end" && message?.role === "assistant" && message.stopReason === "aborted")
|
|
1876
|
+
this.cancellation.aborted = true;
|
|
1877
|
+
if (event.type === "agent_end")
|
|
1878
|
+
this.cancellation.ended = true;
|
|
1879
|
+
}
|
|
1587
1880
|
if (event.type === "extension_ui_request") {
|
|
1588
1881
|
const method = event.method;
|
|
1589
1882
|
const dialog = method === "select" || method === "confirm" || method === "input" || method === "editor";
|
|
@@ -1689,6 +1982,8 @@ export class RunnerCore {
|
|
|
1689
1982
|
// A working beat counts only for the latest accepted turn. Pi's runs start from this runner's prompts, so the run
|
|
1690
1983
|
// that opens is posted as one, before its first event; a prompt Pi handles without a run opens none. A prompt sent
|
|
1691
1984
|
// into an open run is accepted as it's sent (acceptIntoOpenRun).
|
|
1985
|
+
if (this.runtime === "pi" && event.type === "agent_start" && this.nativeTurn)
|
|
1986
|
+
this.managedQuarantined = true;
|
|
1692
1987
|
const opening = this.runtime !== "omp" && mapped.streaming === true && !this.streaming;
|
|
1693
1988
|
if (mapped.streaming !== undefined) {
|
|
1694
1989
|
const changed = this.streaming !== mapped.streaming;
|
|
@@ -1696,9 +1991,25 @@ export class RunnerCore {
|
|
|
1696
1991
|
if (changed)
|
|
1697
1992
|
this.refreshPaneStatus();
|
|
1698
1993
|
}
|
|
1994
|
+
if (this.cancellation && (this.cancellation.submitted || this.cancellation.ended) && (event.type === "agent_start" || opening))
|
|
1995
|
+
this.finishNativeCancellation(this.cancellation.submitted ? "requested" : "not-this-turn", "native_settlement_superseded");
|
|
1699
1996
|
if (opening) {
|
|
1700
1997
|
setImmediate(() => this.pumpManaged());
|
|
1701
1998
|
this.turn += 1;
|
|
1999
|
+
this.epochSteers.clear();
|
|
2000
|
+
this.personSteers.clear();
|
|
2001
|
+
this.nativeQueues = null;
|
|
2002
|
+
this.nativeTurn = { id: `pi-invocation-${++this.nativeEpoch}`, accepted: [String(this.turn)], owned: this.pendingManagedStart };
|
|
2003
|
+
this.reportNativeTurn("opened");
|
|
2004
|
+
for (const entry of this.pendingNativeInputs) {
|
|
2005
|
+
entry.nativeTurnId = this.nativeTurn.id;
|
|
2006
|
+
entry.acceptedTurnId = String(this.turn);
|
|
2007
|
+
if (entry.frame.kind === "input" && entry.nativeAccepted && entry.disposition === "started") {
|
|
2008
|
+
entry.state = "terminal";
|
|
2009
|
+
this.reportManaged(entry, "result", { kind: "input", accepted: true });
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
this.pendingNativeInputs.clear();
|
|
1702
2013
|
this.io.postActivity(this.activityPayload("UserPromptSubmit", "accepted", { turnId: String(this.turn) }));
|
|
1703
2014
|
}
|
|
1704
2015
|
// OMP writes its JSONL lazily; re-announce identity after each turn until
|
|
@@ -1713,11 +2024,14 @@ export class RunnerCore {
|
|
|
1713
2024
|
}
|
|
1714
2025
|
this.idleRevision = -1;
|
|
1715
2026
|
this.pendingManagedStart = false;
|
|
2027
|
+
this.reportNativeTurn("closed");
|
|
2028
|
+
this.nativeTurn = null;
|
|
2029
|
+
this.finishEndedNativeCancellation();
|
|
1716
2030
|
if (wake) {
|
|
1717
2031
|
wake.nativeTerminal = true;
|
|
1718
2032
|
this.finishManagedWake(wake);
|
|
1719
2033
|
}
|
|
1720
|
-
setImmediate(() => this.pumpManaged());
|
|
2034
|
+
setImmediate(() => { this.pumpPersonPrompts(); this.pumpManaged(); });
|
|
1721
2035
|
// QA RED fold: live events do not reliably carry
|
|
1722
2036
|
// session-entry ids, so the durable cursor starved (lastEntryId stayed
|
|
1723
2037
|
// null in real runs). Refresh it from the source of truth after every
|
|
@@ -2222,13 +2536,19 @@ export async function connectPiRunnerChannel(core, endpoint, runId, signal) {
|
|
|
2222
2536
|
await new Promise(resolve => setTimeout(resolve, 250));
|
|
2223
2537
|
}
|
|
2224
2538
|
}
|
|
2225
|
-
async function postPiRunnerChannel(endpoint, body, signal, onPermanentRunRefusal) {
|
|
2539
|
+
async function postPiRunnerChannel(endpoint, body, signal, onPermanentRunRefusal, onContinuation) {
|
|
2226
2540
|
while (!signal.aborted) {
|
|
2227
2541
|
try {
|
|
2228
2542
|
const response = await fetch(new URL("/api/activity/runner-channel", endpoint.baseUrl), { method: "POST",
|
|
2229
2543
|
signal: AbortSignal.any([signal, AbortSignal.timeout(3000)]), headers: { authorization: `Bearer ${endpoint.token}`, "content-type": "application/json" }, body: JSON.stringify(body) });
|
|
2230
|
-
if (response.ok)
|
|
2544
|
+
if (response.ok) {
|
|
2545
|
+
if (body.result?.continuation) {
|
|
2546
|
+
const reply = await response.json().catch(() => null);
|
|
2547
|
+
if (reply?.continuation)
|
|
2548
|
+
onContinuation?.(`Native continuation: ${JSON.stringify(reply.continuation)}`);
|
|
2549
|
+
}
|
|
2231
2550
|
return true;
|
|
2551
|
+
}
|
|
2232
2552
|
const failure = await response.json().catch(() => null);
|
|
2233
2553
|
if ([401, 403, 404, 409, 410].includes(response.status) && !["runner_hello_required", "runner_grant_pending", "runner_grant_unverified"].includes(failure?.code ?? "")) {
|
|
2234
2554
|
if (isPermanentPiRunRefusal(response.status, failure?.code))
|
|
@@ -2331,7 +2651,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
2331
2651
|
try {
|
|
2332
2652
|
const pending = parsePiRunnerState(fs.readFileSync(paths.runnerStatePath, "utf8"));
|
|
2333
2653
|
const exitedState = { ready: false, launchId: args.launchId, lastEntryId: pending?.lastEntryId, updatedAt: at, exited: { code: 127, at } };
|
|
2334
|
-
|
|
2654
|
+
writePiRunnerSidecar(paths.runnerStatePath, exitedState);
|
|
2335
2655
|
}
|
|
2336
2656
|
catch { /* the pane ERROR marker still fails readiness */ }
|
|
2337
2657
|
process.exitCode = 127;
|
|
@@ -2430,7 +2750,23 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
2430
2750
|
child.once("exit", () => { nativeStream.abort(); setTimeout(() => nativePosts.abort(), 2000).unref(); });
|
|
2431
2751
|
child.once("error", () => { nativeStream.abort(); nativePosts.abort(); });
|
|
2432
2752
|
const io = {
|
|
2433
|
-
...(
|
|
2753
|
+
...(endpoint && runId ? { postRunner: (body) => postPiRunnerChannel(endpoint, body, nativePosts.signal, () => core.quarantineManagedChannel(), paneDiag) } : {}),
|
|
2754
|
+
...(runtime === "pi" && endpoint && runId ? { withdrawNativeTurn: async (body) => {
|
|
2755
|
+
try {
|
|
2756
|
+
const response = await fetch(`${endpoint.baseUrl}/api/activity/runner-channel`, { method: "POST", signal: AbortSignal.timeout(3000),
|
|
2757
|
+
headers: { authorization: `Bearer ${endpoint.token}`, "content-type": "application/json" }, body: JSON.stringify(body) });
|
|
2758
|
+
if (!response.ok) {
|
|
2759
|
+
const failure = await response.json().catch(() => null);
|
|
2760
|
+
if (isPermanentPiRunRefusal(response.status, failure?.code))
|
|
2761
|
+
core.quarantineManagedChannel();
|
|
2762
|
+
return null;
|
|
2763
|
+
}
|
|
2764
|
+
return (await response.json()).withdrawal ?? null;
|
|
2765
|
+
}
|
|
2766
|
+
catch {
|
|
2767
|
+
return null;
|
|
2768
|
+
}
|
|
2769
|
+
} } : {}),
|
|
2434
2770
|
sendRpc: (cmd) => {
|
|
2435
2771
|
try {
|
|
2436
2772
|
child.stdin.write(`${JSON.stringify(cmd)}\n`);
|
|
@@ -2453,10 +2789,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
2453
2789
|
},
|
|
2454
2790
|
writeSidecar: (state) => {
|
|
2455
2791
|
try {
|
|
2456
|
-
|
|
2457
|
-
writePiRunnerSidecar(paths.runnerStatePath, state);
|
|
2458
|
-
else
|
|
2459
|
-
fs.writeFileSync(paths.runnerStatePath, JSON.stringify(state));
|
|
2792
|
+
writePiRunnerSidecar(paths.runnerStatePath, state);
|
|
2460
2793
|
}
|
|
2461
2794
|
catch { /* best-effort; adapter falls back to pane markers */ }
|
|
2462
2795
|
},
|
|
@@ -2511,7 +2844,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
2511
2844
|
runId: runId,
|
|
2512
2845
|
}, { catchUpSince, runtime, usageFacts: args.usageFacts === true, openRouterCharge: args.openRouterCharge === true, launchCredentialEvidence,
|
|
2513
2846
|
requestedSessionFile: args.sessionFile, model: args.model, thinking: args.thinking });
|
|
2514
|
-
if (
|
|
2847
|
+
if (endpoint && runId)
|
|
2515
2848
|
void connectPiRunnerChannel(core, endpoint, runId, nativeStream.signal);
|
|
2516
2849
|
let transportUp = runtime !== "omp";
|
|
2517
2850
|
readline.createInterface({ input: child.stdout }).on("line", (line) => {
|