@openrig/cli 0.7.16 → 0.7.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/daemon/assets/onboarding/02-self-and-competent-action.md +5 -41
- package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/skills/working-with-an-openrig-team/SKILL.md +22 -6
- package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +5 -0
- package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +23 -0
- package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +11 -0
- package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +25 -5
- package/daemon/assets/skills/rigs/SKILL.md +95 -42
- package/daemon/assets/skills/rigs/references/installing-for-someone.md +47 -0
- package/daemon/context-packs/help/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +123 -35
- package/daemon/context-packs/reference/getting-started.md +8 -8
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +166 -0
- package/daemon/context-packs/reference/whats-new.md +294 -6
- package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
- package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
- package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
- package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +23 -0
- package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-software-factory/references/worked-example.md +1 -1
- package/daemon/context-packs/skills/core/openrig-upgrade/SKILL.md +2 -0
- package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/working-with-an-openrig-team/SKILL.md +22 -6
- package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
- package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-user/SKILL.md +11 -0
- package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +25 -5
- package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
- package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
- package/daemon/context-packs/world-example/manifest.yaml +1 -1
- package/daemon/context-packs/world-public/manifest.yaml +1 -1
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +52 -8
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/claude-resume.d.ts +2 -1
- package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-resume.js +17 -7
- package/daemon/dist/adapters/claude-resume.js.map +1 -1
- package/daemon/dist/adapters/kernel-authority.d.ts +1 -1
- package/daemon/dist/adapters/kernel-authority.d.ts.map +1 -1
- package/daemon/dist/adapters/kernel-authority.js +22 -10
- package/daemon/dist/adapters/kernel-authority.js.map +1 -1
- package/daemon/dist/adapters/openshell-driver.d.ts +1 -0
- package/daemon/dist/adapters/openshell-driver.d.ts.map +1 -1
- package/daemon/dist/adapters/openshell-driver.js +3 -0
- package/daemon/dist/adapters/openshell-driver.js.map +1 -1
- package/daemon/dist/adapters/openshell-podman-observer.d.ts +9 -7
- package/daemon/dist/adapters/openshell-podman-observer.d.ts.map +1 -1
- package/daemon/dist/adapters/openshell-podman-observer.js +20 -3
- package/daemon/dist/adapters/openshell-podman-observer.js.map +1 -1
- package/daemon/dist/adapters/pi-runner-protocol.d.ts +43 -0
- package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner-protocol.js.map +1 -1
- package/daemon/dist/adapters/pi-runner.d.ts +88 -5
- package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.js +707 -43
- package/daemon/dist/adapters/pi-runner.js.map +1 -1
- package/daemon/dist/adapters/tmux-credential-env.d.ts +4 -0
- package/daemon/dist/adapters/tmux-credential-env.d.ts.map +1 -0
- package/daemon/dist/adapters/tmux-credential-env.js +14 -0
- package/daemon/dist/adapters/tmux-credential-env.js.map +1 -0
- package/daemon/dist/adapters/tmux-exec.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux-exec.js +4 -3
- package/daemon/dist/adapters/tmux-exec.js.map +1 -1
- package/daemon/dist/adapters/tmux-server.d.ts +2 -2
- package/daemon/dist/adapters/tmux-server.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux-server.js +12 -4
- package/daemon/dist/adapters/tmux-server.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +223 -12
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +836 -30
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/attention-surface.d.ts +4 -1
- package/daemon/dist/attention-surface.d.ts.map +1 -1
- package/daemon/dist/attention-surface.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +12 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/168_context_usage_occupant_generation.d.ts +6 -0
- package/daemon/dist/db/migrations/168_context_usage_occupant_generation.d.ts.map +1 -0
- package/daemon/dist/db/migrations/168_context_usage_occupant_generation.js +10 -0
- package/daemon/dist/db/migrations/168_context_usage_occupant_generation.js.map +1 -0
- package/daemon/dist/db/migrations/170_rig_delivery_drains.d.ts +3 -0
- package/daemon/dist/db/migrations/170_rig_delivery_drains.d.ts.map +1 -0
- package/daemon/dist/db/migrations/170_rig_delivery_drains.js +21 -0
- package/daemon/dist/db/migrations/170_rig_delivery_drains.js.map +1 -0
- package/daemon/dist/db/migrations/171_claude_auto_mode.d.ts +4 -0
- package/daemon/dist/db/migrations/171_claude_auto_mode.d.ts.map +1 -0
- package/daemon/dist/db/migrations/171_claude_auto_mode.js +9 -0
- package/daemon/dist/db/migrations/171_claude_auto_mode.js.map +1 -0
- package/daemon/dist/db/migrations/171_node_input_route.d.ts +4 -0
- package/daemon/dist/db/migrations/171_node_input_route.d.ts.map +1 -0
- package/daemon/dist/db/migrations/171_node_input_route.js +6 -0
- package/daemon/dist/db/migrations/171_node_input_route.js.map +1 -0
- package/daemon/dist/db/migrations/172_queue_return_route.d.ts +3 -0
- package/daemon/dist/db/migrations/172_queue_return_route.d.ts.map +1 -0
- package/daemon/dist/db/migrations/172_queue_return_route.js +13 -0
- package/daemon/dist/db/migrations/172_queue_return_route.js.map +1 -0
- package/daemon/dist/db/migrations/173_node_process_limits.d.ts +4 -0
- package/daemon/dist/db/migrations/173_node_process_limits.d.ts.map +1 -0
- package/daemon/dist/db/migrations/173_node_process_limits.js +6 -0
- package/daemon/dist/db/migrations/173_node_process_limits.js.map +1 -0
- package/daemon/dist/domain/activity-grants.d.ts.map +1 -1
- package/daemon/dist/domain/activity-grants.js +2 -0
- package/daemon/dist/domain/activity-grants.js.map +1 -1
- package/daemon/dist/domain/agent-activity-store.d.ts +36 -1
- package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
- package/daemon/dist/domain/agent-activity-store.js +192 -3
- package/daemon/dist/domain/agent-activity-store.js.map +1 -1
- package/daemon/dist/domain/agent-images/resume-token-discovery.d.ts +10 -0
- package/daemon/dist/domain/agent-images/resume-token-discovery.d.ts.map +1 -1
- package/daemon/dist/domain/agent-images/resume-token-discovery.js +21 -0
- package/daemon/dist/domain/agent-images/resume-token-discovery.js.map +1 -1
- package/daemon/dist/domain/applied-launch-observation-store.d.ts +5 -0
- package/daemon/dist/domain/applied-launch-observation-store.d.ts.map +1 -1
- package/daemon/dist/domain/applied-launch-observation-store.js +57 -21
- package/daemon/dist/domain/applied-launch-observation-store.js.map +1 -1
- package/daemon/dist/domain/builtin-startup-files.d.ts +26 -12
- package/daemon/dist/domain/builtin-startup-files.d.ts.map +1 -1
- package/daemon/dist/domain/builtin-startup-files.js +73 -34
- package/daemon/dist/domain/builtin-startup-files.js.map +1 -1
- package/daemon/dist/domain/claude-auto-mode.d.ts +64 -0
- package/daemon/dist/domain/claude-auto-mode.d.ts.map +1 -0
- package/daemon/dist/domain/claude-auto-mode.js +114 -0
- package/daemon/dist/domain/claude-auto-mode.js.map +1 -0
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +2 -0
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +11 -4
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/claude-continuation-launch.d.ts +5 -1
- package/daemon/dist/domain/claude-continuation-launch.d.ts.map +1 -1
- package/daemon/dist/domain/claude-continuation-launch.js +51 -2
- package/daemon/dist/domain/claude-continuation-launch.js.map +1 -1
- package/daemon/dist/domain/claude-core-plugin-env.d.ts +7 -3
- package/daemon/dist/domain/claude-core-plugin-env.d.ts.map +1 -1
- package/daemon/dist/domain/claude-core-plugin-env.js +11 -8
- package/daemon/dist/domain/claude-core-plugin-env.js.map +1 -1
- package/daemon/dist/domain/codex-daemon-support.d.ts.map +1 -1
- package/daemon/dist/domain/codex-daemon-support.js +6 -1
- package/daemon/dist/domain/codex-daemon-support.js.map +1 -1
- package/daemon/dist/domain/codex-thread-id.d.ts +13 -0
- package/daemon/dist/domain/codex-thread-id.d.ts.map +1 -1
- package/daemon/dist/domain/codex-thread-id.js +132 -9
- package/daemon/dist/domain/codex-thread-id.js.map +1 -1
- package/daemon/dist/domain/community-harness-launch-result.d.ts +2 -0
- package/daemon/dist/domain/community-harness-launch-result.d.ts.map +1 -1
- package/daemon/dist/domain/community-harness-launch-result.js +5 -1
- package/daemon/dist/domain/community-harness-launch-result.js.map +1 -1
- package/daemon/dist/domain/connection-contract.d.ts +91 -0
- package/daemon/dist/domain/connection-contract.d.ts.map +1 -1
- package/daemon/dist/domain/connection-contract.js +75 -1
- package/daemon/dist/domain/connection-contract.js.map +1 -1
- package/daemon/dist/domain/context-usage-store.d.ts +16 -2
- package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
- package/daemon/dist/domain/context-usage-store.js +70 -15
- package/daemon/dist/domain/context-usage-store.js.map +1 -1
- package/daemon/dist/domain/current-work.d.ts +11 -1
- package/daemon/dist/domain/current-work.d.ts.map +1 -1
- package/daemon/dist/domain/current-work.js +107 -12
- package/daemon/dist/domain/current-work.js.map +1 -1
- package/daemon/dist/domain/cwd-resolution.d.ts +2 -0
- package/daemon/dist/domain/cwd-resolution.d.ts.map +1 -1
- package/daemon/dist/domain/cwd-resolution.js +7 -2
- package/daemon/dist/domain/cwd-resolution.js.map +1 -1
- package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/draft-aware-delivery.js +5 -1
- package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
- package/daemon/dist/domain/environment-lifecycle.d.ts +15 -0
- package/daemon/dist/domain/environment-lifecycle.d.ts.map +1 -1
- package/daemon/dist/domain/environment-lifecycle.js +22 -4
- package/daemon/dist/domain/environment-lifecycle.js.map +1 -1
- package/daemon/dist/domain/errors.d.ts +4 -0
- package/daemon/dist/domain/errors.d.ts.map +1 -1
- package/daemon/dist/domain/errors.js +7 -0
- package/daemon/dist/domain/errors.js.map +1 -1
- package/daemon/dist/domain/execution-view.d.ts.map +1 -1
- package/daemon/dist/domain/execution-view.js +8 -1
- package/daemon/dist/domain/execution-view.js.map +1 -1
- package/daemon/dist/domain/existing-rig-restore.d.ts +2 -0
- package/daemon/dist/domain/existing-rig-restore.d.ts.map +1 -1
- package/daemon/dist/domain/existing-rig-restore.js +1 -0
- package/daemon/dist/domain/existing-rig-restore.js.map +1 -1
- package/daemon/dist/domain/expected-conversation.d.ts.map +1 -1
- package/daemon/dist/domain/expected-conversation.js +26 -11
- package/daemon/dist/domain/expected-conversation.js.map +1 -1
- package/daemon/dist/domain/gateway/destination-resolver.d.ts +4 -0
- package/daemon/dist/domain/gateway/destination-resolver.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/destination-resolver.js +10 -3
- package/daemon/dist/domain/gateway/destination-resolver.js.map +1 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts +3 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.js +120 -6
- package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/capabilities.d.ts +9 -1
- package/daemon/dist/domain/gateway/slack/capabilities.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/capabilities.js +6 -1
- package/daemon/dist/domain/gateway/slack/capabilities.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound-admission.js +1 -1
- package/daemon/dist/domain/gateway/slack/inbound-admission.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.d.ts +4 -0
- package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.js +15 -1
- package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/manifest.d.ts +5 -1
- package/daemon/dist/domain/gateway/slack/manifest.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/manifest.js +12 -3
- package/daemon/dist/domain/gateway/slack/manifest.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +1 -0
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +4 -1
- package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts +2 -0
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.js +1 -0
- package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/settled-asks.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/settled-asks.js +6 -5
- package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-api.d.ts +1 -0
- package/daemon/dist/domain/gateway/slack/slack-api.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-api.js +7 -2
- package/daemon/dist/domain/gateway/slack/slack-api.js.map +1 -1
- package/daemon/dist/domain/harness-not-started-notice.d.ts +36 -0
- package/daemon/dist/domain/harness-not-started-notice.d.ts.map +1 -0
- package/daemon/dist/domain/harness-not-started-notice.js +81 -0
- package/daemon/dist/domain/harness-not-started-notice.js.map +1 -0
- package/daemon/dist/domain/health-diagnosis.d.ts.map +1 -1
- package/daemon/dist/domain/health-diagnosis.js +4 -0
- package/daemon/dist/domain/health-diagnosis.js.map +1 -1
- package/daemon/dist/domain/hot-potato-enforcer.d.ts +1 -1
- package/daemon/dist/domain/input-read-diagnostic.js +1 -1
- package/daemon/dist/domain/input-read-diagnostic.js.map +1 -1
- package/daemon/dist/domain/instance-initialization.d.ts +2 -0
- package/daemon/dist/domain/instance-initialization.d.ts.map +1 -1
- package/daemon/dist/domain/instance-initialization.js +2 -1
- package/daemon/dist/domain/instance-initialization.js.map +1 -1
- package/daemon/dist/domain/member-connection.d.ts +14 -0
- package/daemon/dist/domain/member-connection.d.ts.map +1 -0
- package/daemon/dist/domain/member-connection.js +34 -0
- package/daemon/dist/domain/member-connection.js.map +1 -0
- package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
- package/daemon/dist/domain/model-divergence/current-model-reader.d.ts +3 -1
- package/daemon/dist/domain/model-divergence/current-model-reader.d.ts.map +1 -1
- package/daemon/dist/domain/model-divergence/current-model-reader.js +32 -7
- package/daemon/dist/domain/model-divergence/current-model-reader.js.map +1 -1
- package/daemon/dist/domain/native-model-picker.d.ts +2 -0
- package/daemon/dist/domain/native-model-picker.d.ts.map +1 -1
- package/daemon/dist/domain/native-model-picker.js +8 -2
- package/daemon/dist/domain/native-model-picker.js.map +1 -1
- package/daemon/dist/domain/native-permission-store.d.ts +6 -2
- package/daemon/dist/domain/native-permission-store.d.ts.map +1 -1
- package/daemon/dist/domain/native-permission-store.js +12 -5
- package/daemon/dist/domain/native-permission-store.js.map +1 -1
- package/daemon/dist/domain/native-resume-probe.d.ts +5 -0
- package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
- package/daemon/dist/domain/native-resume-probe.js +172 -21
- package/daemon/dist/domain/native-resume-probe.js.map +1 -1
- package/daemon/dist/domain/network/network-connector.d.ts.map +1 -1
- package/daemon/dist/domain/network/network-connector.js +16 -5
- package/daemon/dist/domain/network/network-connector.js.map +1 -1
- package/daemon/dist/domain/network/network-installations.d.ts +5 -4
- package/daemon/dist/domain/network/network-installations.d.ts.map +1 -1
- package/daemon/dist/domain/network/network-installations.js +42 -11
- package/daemon/dist/domain/network/network-installations.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +28 -0
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/node-launcher.d.ts +11 -0
- package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/node-launcher.js +23 -7
- package/daemon/dist/domain/node-launcher.js.map +1 -1
- package/daemon/dist/domain/occupant-invalidator.d.ts +4 -1
- package/daemon/dist/domain/occupant-invalidator.d.ts.map +1 -1
- package/daemon/dist/domain/occupant-invalidator.js +10 -2
- package/daemon/dist/domain/occupant-invalidator.js.map +1 -1
- package/daemon/dist/domain/operation-correlation.d.ts +1 -1
- package/daemon/dist/domain/operation-correlation.d.ts.map +1 -1
- package/daemon/dist/domain/operation-correlation.js +1 -1
- package/daemon/dist/domain/operation-correlation.js.map +1 -1
- package/daemon/dist/domain/outbox-handler.d.ts +50 -0
- package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
- package/daemon/dist/domain/outbox-handler.js +255 -1
- package/daemon/dist/domain/outbox-handler.js.map +1 -1
- package/daemon/dist/domain/parked-query.d.ts.map +1 -1
- package/daemon/dist/domain/parked-query.js +3 -1
- package/daemon/dist/domain/parked-query.js.map +1 -1
- package/daemon/dist/domain/permission-account.d.ts +28 -1
- package/daemon/dist/domain/permission-account.d.ts.map +1 -1
- package/daemon/dist/domain/permission-account.js +55 -11
- package/daemon/dist/domain/permission-account.js.map +1 -1
- package/daemon/dist/domain/permission-drift.d.ts +2 -0
- package/daemon/dist/domain/permission-drift.d.ts.map +1 -1
- package/daemon/dist/domain/permission-drift.js.map +1 -1
- package/daemon/dist/domain/pi-compaction-request-store.d.ts +16 -0
- package/daemon/dist/domain/pi-compaction-request-store.d.ts.map +1 -0
- package/daemon/dist/domain/pi-compaction-request-store.js +40 -0
- package/daemon/dist/domain/pi-compaction-request-store.js.map +1 -0
- package/daemon/dist/domain/pi-compaction-service.d.ts +82 -0
- package/daemon/dist/domain/pi-compaction-service.d.ts.map +1 -0
- package/daemon/dist/domain/pi-compaction-service.js +229 -0
- package/daemon/dist/domain/pi-compaction-service.js.map +1 -0
- package/daemon/dist/domain/process-limits.d.ts +37 -0
- package/daemon/dist/domain/process-limits.d.ts.map +1 -0
- package/daemon/dist/domain/process-limits.js +69 -0
- package/daemon/dist/domain/process-limits.js.map +1 -0
- package/daemon/dist/domain/process-table.d.ts +9 -0
- package/daemon/dist/domain/process-table.d.ts.map +1 -1
- package/daemon/dist/domain/process-table.js +21 -4
- package/daemon/dist/domain/process-table.js.map +1 -1
- package/daemon/dist/domain/proof/judgments.d.ts +7 -0
- package/daemon/dist/domain/proof/judgments.d.ts.map +1 -1
- package/daemon/dist/domain/proof/judgments.js +27 -1
- package/daemon/dist/domain/proof/judgments.js.map +1 -1
- package/daemon/dist/domain/ps-projection.d.ts +2 -1
- package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
- package/daemon/dist/domain/ps-projection.js +6 -1
- package/daemon/dist/domain/ps-projection.js.map +1 -1
- package/daemon/dist/domain/queue-erasure.d.ts +18 -7
- package/daemon/dist/domain/queue-erasure.d.ts.map +1 -1
- package/daemon/dist/domain/queue-erasure.js +270 -41
- package/daemon/dist/domain/queue-erasure.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +81 -16
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +325 -76
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts +3 -0
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +90 -30
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/queue-transition-log.d.ts +5 -3
- package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
- package/daemon/dist/domain/queue-transition-log.js +9 -6
- package/daemon/dist/domain/queue-transition-log.js.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.d.ts +8 -0
- package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +245 -41
- package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.d.ts +2 -1
- package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.js +31 -4
- package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
- package/daemon/dist/domain/restore-check-service.d.ts +23 -0
- package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
- package/daemon/dist/domain/restore-check-service.js +198 -12
- package/daemon/dist/domain/restore-check-service.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +64 -3
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +335 -82
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.d.ts +28 -1
- package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.js +17 -5
- package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
- package/daemon/dist/domain/restore-preconditions.d.ts +26 -0
- package/daemon/dist/domain/restore-preconditions.d.ts.map +1 -1
- package/daemon/dist/domain/restore-preconditions.js +63 -1
- package/daemon/dist/domain/restore-preconditions.js.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.js +4 -1
- package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
- package/daemon/dist/domain/resume-token-validation.d.ts +3 -1
- package/daemon/dist/domain/resume-token-validation.d.ts.map +1 -1
- package/daemon/dist/domain/resume-token-validation.js +6 -3
- package/daemon/dist/domain/resume-token-validation.js.map +1 -1
- package/daemon/dist/domain/return-route.d.ts +73 -0
- package/daemon/dist/domain/return-route.d.ts.map +1 -0
- package/daemon/dist/domain/return-route.js +124 -0
- package/daemon/dist/domain/return-route.js.map +1 -0
- package/daemon/dist/domain/rig-delivery-drain.d.ts +46 -0
- package/daemon/dist/domain/rig-delivery-drain.d.ts.map +1 -0
- package/daemon/dist/domain/rig-delivery-drain.js +128 -0
- package/daemon/dist/domain/rig-delivery-drain.js.map +1 -0
- package/daemon/dist/domain/rig-expansion-service.js +1 -1
- package/daemon/dist/domain/rig-expansion-service.js.map +1 -1
- package/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/rig-lifecycle-service.js +4 -1
- package/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/rig-repository.d.ts +12 -0
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +73 -0
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rig-teardown.d.ts +22 -3
- package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
- package/daemon/dist/domain/rig-teardown.js +99 -20
- package/daemon/dist/domain/rig-teardown.js.map +1 -1
- package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-codec.js +9 -0
- package/daemon/dist/domain/rigspec-codec.js.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.d.ts +6 -0
- package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.js +30 -0
- package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts +22 -2
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +82 -23
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.d.ts +1 -1
- package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.js +16 -1
- package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
- package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-schema.js +44 -1
- package/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/daemon/dist/domain/rosters.d.ts +12 -0
- package/daemon/dist/domain/rosters.d.ts.map +1 -1
- package/daemon/dist/domain/rosters.js +17 -4
- package/daemon/dist/domain/rosters.js.map +1 -1
- package/daemon/dist/domain/runner-channel.d.ts +33 -0
- package/daemon/dist/domain/runner-channel.d.ts.map +1 -0
- package/daemon/dist/domain/runner-channel.js +179 -0
- package/daemon/dist/domain/runner-channel.js.map +1 -0
- package/daemon/dist/domain/runner-grant-launch.js +2 -2
- package/daemon/dist/domain/runtime-adapter.d.ts +2 -0
- package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-adapter.js.map +1 -1
- package/daemon/dist/domain/runtime-switch-materials.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-switch-materials.js +4 -3
- package/daemon/dist/domain/runtime-switch-materials.js.map +1 -1
- package/daemon/dist/domain/scope/scope-audit.d.ts.map +1 -1
- package/daemon/dist/domain/scope/scope-audit.js +55 -3
- package/daemon/dist/domain/scope/scope-audit.js.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.d.ts +6 -4
- package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.js +17 -10
- package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.js +2 -1
- package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts +27 -4
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +209 -64
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.d.ts +8 -1
- package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.js +52 -12
- package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.d.ts +3 -2
- package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.js +16 -4
- package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +21 -4
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +68 -2
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.d.ts +9 -2
- package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.js +34 -2
- package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts +4 -0
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.js +9 -3
- package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
- package/daemon/dist/domain/seat-status-service.d.ts +4 -0
- package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-status-service.js +31 -6
- package/daemon/dist/domain/seat-status-service.js.map +1 -1
- package/daemon/dist/domain/session-name.d.ts +13 -0
- package/daemon/dist/domain/session-name.d.ts.map +1 -1
- package/daemon/dist/domain/session-name.js +77 -0
- package/daemon/dist/domain/session-name.js.map +1 -1
- package/daemon/dist/domain/session-registry.d.ts +7 -1
- package/daemon/dist/domain/session-registry.d.ts.map +1 -1
- package/daemon/dist/domain/session-registry.js +7 -4
- package/daemon/dist/domain/session-registry.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +16 -3
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +161 -16
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/shared-conversation.d.ts +58 -0
- package/daemon/dist/domain/shared-conversation.d.ts.map +1 -0
- package/daemon/dist/domain/shared-conversation.js +98 -0
- package/daemon/dist/domain/shared-conversation.js.map +1 -0
- package/daemon/dist/domain/shared-history-selection.d.ts +1 -0
- package/daemon/dist/domain/shared-history-selection.d.ts.map +1 -1
- package/daemon/dist/domain/shared-history-selection.js +3 -1
- package/daemon/dist/domain/shared-history-selection.js.map +1 -1
- package/daemon/dist/domain/snapshot-capture.d.ts +4 -1
- package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
- package/daemon/dist/domain/snapshot-capture.js +19 -12
- package/daemon/dist/domain/snapshot-capture.js.map +1 -1
- package/daemon/dist/domain/startup-phase-timing.d.ts +19 -0
- package/daemon/dist/domain/startup-phase-timing.d.ts.map +1 -0
- package/daemon/dist/domain/startup-phase-timing.js +23 -0
- package/daemon/dist/domain/startup-phase-timing.js.map +1 -0
- package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
- package/daemon/dist/domain/startup-submission-evidence.js +3 -2
- package/daemon/dist/domain/startup-submission-evidence.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts +9 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +24 -7
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/team-operations.d.ts +6 -6
- package/daemon/dist/domain/team-operations.d.ts.map +1 -1
- package/daemon/dist/domain/team-operations.js +2 -4
- package/daemon/dist/domain/team-operations.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-app-provider.d.ts +6 -0
- package/daemon/dist/domain/terminal/herdr-app-provider.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-app-provider.js +23 -1
- package/daemon/dist/domain/terminal/herdr-app-provider.js.map +1 -1
- package/daemon/dist/domain/terminal-policy.js +1 -1
- package/daemon/dist/domain/terminal-policy.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +91 -6
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.js +6 -0
- package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.d.ts +1 -1
- package/daemon/dist/domain/watchdog-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.js +6 -3
- package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.js +1 -0
- package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts +9 -0
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +42 -5
- package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
- package/daemon/dist/domain/workflow-instance-store.d.ts +3 -2
- package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-instance-store.js +6 -4
- package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
- package/daemon/dist/domain/workflow-projector.d.ts +48 -0
- package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +160 -90
- package/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-reconciliation.d.ts +7 -1
- package/daemon/dist/domain/workflow-reconciliation.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-reconciliation.js +51 -13
- package/daemon/dist/domain/workflow-reconciliation.js.map +1 -1
- package/daemon/dist/domain/workflow-runtime.d.ts +5 -3
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +48 -22
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts +7 -1
- package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
- package/daemon/dist/domain/workspace/default-workspace-scaffold.js +35 -7
- package/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
- package/daemon/dist/gateway-slack-surface.d.ts +2 -2
- package/daemon/dist/gateway-slack-surface.d.ts.map +1 -1
- package/daemon/dist/gateway-slack-surface.js +1 -1
- package/daemon/dist/gateway-slack-surface.js.map +1 -1
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +13 -2
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/routes/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +105 -2
- package/daemon/dist/routes/activity.js.map +1 -1
- package/daemon/dist/routes/agent-images.d.ts.map +1 -1
- package/daemon/dist/routes/agent-images.js +6 -1
- package/daemon/dist/routes/agent-images.js.map +1 -1
- package/daemon/dist/routes/attention.d.ts.map +1 -1
- package/daemon/dist/routes/attention.js +2 -1
- package/daemon/dist/routes/attention.js.map +1 -1
- package/daemon/dist/routes/compaction.d.ts.map +1 -1
- package/daemon/dist/routes/compaction.js +46 -7
- package/daemon/dist/routes/compaction.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts +4 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +266 -38
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/require-sender-identity.d.ts +4 -3
- package/daemon/dist/routes/require-sender-identity.d.ts.map +1 -1
- package/daemon/dist/routes/require-sender-identity.js.map +1 -1
- package/daemon/dist/routes/restore-check.d.ts.map +1 -1
- package/daemon/dist/routes/restore-check.js +18 -0
- package/daemon/dist/routes/restore-check.js.map +1 -1
- package/daemon/dist/routes/rig-delivery-drain.d.ts +3 -0
- package/daemon/dist/routes/rig-delivery-drain.d.ts.map +1 -0
- package/daemon/dist/routes/rig-delivery-drain.js +46 -0
- package/daemon/dist/routes/rig-delivery-drain.js.map +1 -0
- package/daemon/dist/routes/rigspec.d.ts.map +1 -1
- package/daemon/dist/routes/rigspec.js +24 -4
- package/daemon/dist/routes/rigspec.js.map +1 -1
- package/daemon/dist/routes/seat.d.ts.map +1 -1
- package/daemon/dist/routes/seat.js +107 -6
- package/daemon/dist/routes/seat.js.map +1 -1
- package/daemon/dist/routes/sessions.js +14 -3
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/startup.d.ts.map +1 -1
- package/daemon/dist/routes/startup.js +127 -29
- package/daemon/dist/routes/startup.js.map +1 -1
- package/daemon/dist/routes/up.d.ts.map +1 -1
- package/daemon/dist/routes/up.js +16 -4
- package/daemon/dist/routes/up.js.map +1 -1
- package/daemon/dist/routes/watchdog.d.ts.map +1 -1
- package/daemon/dist/routes/watchdog.js +18 -1
- package/daemon/dist/routes/watchdog.js.map +1 -1
- package/daemon/dist/routes/workflow.js +1 -1
- package/daemon/dist/routes/workflow.js.map +1 -1
- package/daemon/dist/server.d.ts +3 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +13 -0
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +57 -16
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/agent-startup-guide.md +5 -3
- package/daemon/docs/reference/community-harness-examples/dsh/README.md +8 -0
- package/daemon/docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs +139 -5
- package/daemon/docs/reference/community-harness-presets.md +2 -0
- package/daemon/docs/reference/daemon-http-clients.md +123 -6
- package/daemon/docs/reference/getting-started.md +8 -8
- package/daemon/docs/reference/harness-runner-contract.md +91 -1
- package/daemon/docs/reference/herdr-app.md +6 -0
- package/daemon/docs/reference/hosted-members.md +4 -2
- package/daemon/docs/reference/network-connector.md +4 -3
- package/daemon/docs/reference/queue-erasure.md +16 -1
- package/daemon/docs/reference/quickstart.md +2 -2
- package/daemon/docs/reference/rig-spec.md +166 -0
- package/daemon/docs/reference/rosters.md +9 -0
- package/daemon/docs/reference/sdlc-conventions.md +5 -1
- package/daemon/docs/reference/slack-app-setup.md +39 -21
- package/daemon/docs/reference/whats-new.md +294 -6
- package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +23 -0
- package/daemon/specs/agents/shared/skills/core/openrig-software-factory/references/worked-example.md +1 -1
- package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +2 -0
- package/daemon/specs/agents/shared/skills/core/working-with-an-openrig-team/SKILL.md +22 -6
- package/daemon/specs/rigs/launch/factory/guidance/lead-first-move.md +26 -5
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +92 -18
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/startup/context.md +9 -6
- package/daemon/specs/rigs/launch/kernel/culture/CULTURE.md +12 -0
- package/daemon/specs/rigs/launch/starter/guidance/lead-first-move.md +26 -5
- package/dist/acp/connector.js +1 -1
- package/dist/acp/connector.js.map +1 -1
- package/dist/build-info.js +3 -3
- package/dist/cli-error.d.ts.map +1 -1
- package/dist/cli-error.js +7 -1
- package/dist/cli-error.js.map +1 -1
- package/dist/client.d.ts +2 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -2
- package/dist/client.js.map +1 -1
- package/dist/commands/ask.d.ts.map +1 -1
- package/dist/commands/ask.js +92 -11
- package/dist/commands/ask.js.map +1 -1
- package/dist/commands/broadcast.js +9 -5
- package/dist/commands/broadcast.js.map +1 -1
- package/dist/commands/compact.d.ts +3 -4
- package/dist/commands/compact.d.ts.map +1 -1
- package/dist/commands/compact.js +76 -16
- package/dist/commands/compact.js.map +1 -1
- package/dist/commands/config-init-workspace.d.ts.map +1 -1
- package/dist/commands/config-init-workspace.js +3 -0
- package/dist/commands/config-init-workspace.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +2 -0
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +7 -1
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/environment.js +1 -1
- package/dist/commands/environment.js.map +1 -1
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +2 -1
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/fork.d.ts.map +1 -1
- package/dist/commands/fork.js +2 -0
- package/dist/commands/fork.js.map +1 -1
- package/dist/commands/launch.d.ts.map +1 -1
- package/dist/commands/launch.js +11 -3
- package/dist/commands/launch.js.map +1 -1
- package/dist/commands/network.d.ts +2 -0
- package/dist/commands/network.d.ts.map +1 -1
- package/dist/commands/network.js +14 -1
- package/dist/commands/network.js.map +1 -1
- package/dist/commands/ps.d.ts +28 -0
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +76 -2
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.d.ts +1 -1
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +350 -29
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/restore.d.ts.map +1 -1
- package/dist/commands/restore.js +6 -1
- package/dist/commands/restore.js.map +1 -1
- package/dist/commands/rig.d.ts +2 -0
- package/dist/commands/rig.d.ts.map +1 -1
- package/dist/commands/rig.js +36 -2
- package/dist/commands/rig.js.map +1 -1
- package/dist/commands/roster.d.ts +3 -0
- package/dist/commands/roster.d.ts.map +1 -1
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +128 -9
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +47 -6
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +5 -3
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/slack.d.ts +2 -1
- package/dist/commands/slack.d.ts.map +1 -1
- package/dist/commands/slack.js +38 -2
- package/dist/commands/slack.js.map +1 -1
- package/dist/commands/terminal.d.ts.map +1 -1
- package/dist/commands/terminal.js +5 -5
- package/dist/commands/terminal.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +10 -0
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +10 -4
- package/dist/commands/workflow.js.map +1 -1
- package/dist/config-store.d.ts +3 -1
- package/dist/config-store.d.ts.map +1 -1
- package/dist/config-store.js +5 -0
- package/dist/config-store.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +1 -0
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/lib/bundle-check.d.ts.map +1 -1
- package/dist/lib/bundle-check.js +33 -3
- package/dist/lib/bundle-check.js.map +1 -1
- package/dist/lib/model-observation.d.ts.map +1 -1
- package/dist/lib/model-observation.js +9 -3
- package/dist/lib/model-observation.js.map +1 -1
- package/dist/lib/scope/scope-audit.d.ts.map +1 -1
- package/dist/lib/scope/scope-audit.js +55 -3
- package/dist/lib/scope/scope-audit.js.map +1 -1
- package/dist/local-db.d.ts +5 -0
- package/dist/local-db.d.ts.map +1 -0
- package/dist/local-db.js +23 -0
- package/dist/local-db.js.map +1 -0
- package/dist/local-origin.d.ts.map +1 -1
- package/dist/local-origin.js +2 -17
- package/dist/local-origin.js.map +1 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +170 -27
- package/dist/mcp-server.js.map +1 -1
- package/dist/person-registration-offer.d.ts.map +1 -1
- package/dist/person-registration-offer.js +2 -1
- package/dist/person-registration-offer.js.map +1 -1
- package/dist/sender-identity.d.ts +18 -6
- package/dist/sender-identity.d.ts.map +1 -1
- package/dist/sender-identity.js +67 -7
- package/dist/sender-identity.js.map +1 -1
- package/dist/terminal-window-rex.d.ts +1 -1
- package/dist/terminal-window-rex.d.ts.map +1 -1
- package/dist/terminal-window-rex.js +3 -2
- package/dist/terminal-window-rex.js.map +1 -1
- package/dist/terminal-window.js +3 -3
- package/dist/terminal-window.js.map +1 -1
- package/package.json +2 -2
- package/tui/dist/config/config-model.js +1 -1
- package/tui/dist/config/config-model.js.map +1 -1
- package/tui/dist/daemon-client.d.ts +3 -1
- package/tui/dist/daemon-client.d.ts.map +1 -1
- package/tui/dist/daemon-client.js +6 -3
- package/tui/dist/daemon-client.js.map +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +31 -1
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +106 -15
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/types.d.ts +2 -0
- package/tui/dist/types.d.ts.map +1 -1
- package/ui/dist/assets/{index-BvUEh33d.js → index-1O1f3A7K.js} +55 -55
- package/ui/dist/index.html +1 -1
|
@@ -124,11 +124,22 @@ export function composeLayout(text, width, caret = text.length) {
|
|
|
124
124
|
place();
|
|
125
125
|
return { rows: row + 1, caretRow, caretColumn };
|
|
126
126
|
}
|
|
127
|
+
export function paneStyles(enabled) {
|
|
128
|
+
const sgr = (open) => (text) => (enabled ? `\u001b[${open}m${text}\u001b[0m` : text);
|
|
129
|
+
return { bold: sgr("1"), dim: sgr("2"), commit: sgr("1;36"), failed: sgr("1;31") };
|
|
130
|
+
}
|
|
131
|
+
const STYLE = paneStyles(process.stdout.isTTY === true && !process.env.NO_COLOR);
|
|
127
132
|
export function createPaneCompositor(out) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
let
|
|
133
|
+
/** The seat's own status row (`model · thinking:… · state`), and the pinned diagnostic
|
|
134
|
+
* below it. They are independent: a turn clears the pin and keeps the seat row. */
|
|
135
|
+
let seat = null;
|
|
136
|
+
let pinned = null;
|
|
137
|
+
/** The status rows actually on screen, clipped when they were painted. A resize must
|
|
138
|
+
* size the region from these, not from the longer text they were set with. */
|
|
139
|
+
let paintedSeat = null;
|
|
140
|
+
let paintedPinned = null;
|
|
141
|
+
/** The unfinished streamed line, as displayed above the status rows (null when it is not). */
|
|
142
|
+
let paintedHeld = null;
|
|
132
143
|
let readInput = null;
|
|
133
144
|
let redrawLine = null;
|
|
134
145
|
let held = "";
|
|
@@ -164,19 +175,71 @@ export function createPaneCompositor(out) {
|
|
|
164
175
|
if (sequence)
|
|
165
176
|
out.write(sequence);
|
|
166
177
|
};
|
|
178
|
+
/** The visible tail of the held streamed line: at most the pane's spare rows, so a
|
|
179
|
+
* newline-free paragraph longer than the viewport never scrolls its own repaint —
|
|
180
|
+
* what scrolls stays in history, and the whole line is committed once when it ends. */
|
|
181
|
+
const heldTail = (text) => {
|
|
182
|
+
const height = typeof out.rows === "number" && out.rows > 0 ? out.rows : 24;
|
|
183
|
+
const budget = Math.max(1, height - 2
|
|
184
|
+
- (seat !== null ? 1 : 0) - (pinned !== null ? 1 : 0) - composeRows());
|
|
185
|
+
if (composeLayout(text, out.columns).rows <= budget)
|
|
186
|
+
return text;
|
|
187
|
+
// Bound by the final wrapped layout, ellipsis included: at an odd width a two-cell
|
|
188
|
+
// character can't fill the last column, so a cell-count bound would overflow the
|
|
189
|
+
// region. A shorter suffix never wraps to more rows, so bisect on its start.
|
|
190
|
+
const graphemes = [...graphemesOf(text)];
|
|
191
|
+
const fits = (start) => composeLayout(`\u2026${graphemes.slice(start).join("")}`, out.columns).rows <= budget;
|
|
192
|
+
let low = 0;
|
|
193
|
+
let high = graphemes.length; // the ellipsis alone fits any budget
|
|
194
|
+
while (low < high) {
|
|
195
|
+
const mid = Math.floor((low + high) / 2);
|
|
196
|
+
if (fits(mid))
|
|
197
|
+
high = mid;
|
|
198
|
+
else
|
|
199
|
+
low = mid + 1;
|
|
200
|
+
}
|
|
201
|
+
return `\u2026${graphemes.slice(low).join("")}`;
|
|
202
|
+
};
|
|
167
203
|
/** Rows this compositor has on screen, recorded when it painted them. Readline never writes
|
|
168
204
|
* to the terminal, so nothing else can change these rows behind the compositor's back —
|
|
169
205
|
* except a reflow, which the resize handler owns. */
|
|
170
206
|
const paint = () => {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
207
|
+
// Without a width nothing can be placed, erased or measured; the status text is kept
|
|
208
|
+
// and painted once a width is known (a resize or the next write calls back here).
|
|
209
|
+
if (!widthKnown()) {
|
|
210
|
+
paintedSeat = null;
|
|
211
|
+
paintedPinned = null;
|
|
212
|
+
paintedHeld = null;
|
|
213
|
+
screenRows = 0;
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
// A transcript line a verbatim write left open must not be spliced by the region:
|
|
217
|
+
// close it first, so the region starts on its own row and the line stays whole.
|
|
218
|
+
if (openLine && (seat !== null || pinned !== null || composeRows() > 0)) {
|
|
219
|
+
out.write("\n");
|
|
220
|
+
openLine = false;
|
|
221
|
+
}
|
|
222
|
+
paintedSeat = seat !== null ? clip(seat) : null;
|
|
223
|
+
paintedPinned = pinned !== null ? clip(pinned) : null;
|
|
224
|
+
const statusRows = [paintedSeat, paintedPinned].filter((text) => text !== null);
|
|
225
|
+
// An in-progress streamed line stays visible as the region's first row while a status
|
|
226
|
+
// row is painted — bounded to the pane's spare rows so its own repaint never scrolls;
|
|
227
|
+
// without one the pane keeps its verbatim fallback and the line is held until it ends.
|
|
228
|
+
paintedHeld = statusRows.length > 0 && held.length > 0 ? heldTail(held) : null;
|
|
229
|
+
let heldRows = 0;
|
|
230
|
+
if (paintedHeld !== null) {
|
|
231
|
+
out.write(paintedHeld);
|
|
232
|
+
out.write("\n");
|
|
233
|
+
heldRows = Math.max(1, composeLayout(paintedHeld, out.columns).rows);
|
|
234
|
+
}
|
|
235
|
+
for (const text of statusRows) {
|
|
236
|
+
out.write(text);
|
|
174
237
|
out.write("\n");
|
|
175
238
|
}
|
|
176
239
|
const rows = composeRows();
|
|
177
240
|
if (rows)
|
|
178
241
|
redrawLine?.();
|
|
179
|
-
screenRows =
|
|
242
|
+
screenRows = heldRows + statusRows.length + (rows || (heldRows + statusRows.length > 0 ? 1 : 0));
|
|
180
243
|
// Only a painted region closes an open transcript line. With nothing painted the
|
|
181
244
|
// cursor still sits on the line a flush left open, and the next keystroke belongs
|
|
182
245
|
// to that line's context, not to a fresh one.
|
|
@@ -221,16 +284,28 @@ export function createPaneCompositor(out) {
|
|
|
221
284
|
screenRows = 0;
|
|
222
285
|
return;
|
|
223
286
|
}
|
|
287
|
+
if (screenRows === 0) {
|
|
288
|
+
// Nothing painted: nothing to erase. A line a verbatim write left open is closed
|
|
289
|
+
// so the retained region starts on its own row instead of splicing into it.
|
|
290
|
+
if (openLine) {
|
|
291
|
+
out.write("\n");
|
|
292
|
+
openLine = false;
|
|
293
|
+
}
|
|
294
|
+
paint();
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
224
297
|
const draft = composeText();
|
|
225
298
|
const layout = draft ? composeLayout(draft, out.columns, readCaretIndex ? readCaretIndex() : draft.length) : null;
|
|
226
299
|
const draftRows = layout ? layout.rows : 0;
|
|
227
|
-
const statusLines =
|
|
300
|
+
const statusLines = [paintedSeat, paintedPinned].reduce((sum, text) => text !== null ? sum + Math.max(1, Math.ceil(stringWidth(text) / out.columns)) : sum, 0);
|
|
301
|
+
// The held streamed row reflowed at the new width: a long partial line wraps here too.
|
|
302
|
+
const heldLines = paintedHeld !== null ? composeLayout(paintedHeld, out.columns).rows : 0;
|
|
228
303
|
const down = layout ? layout.rows - 1 - layout.caretRow : 0;
|
|
229
304
|
if (down > 0)
|
|
230
305
|
out.write(`\u001b[${down}B`);
|
|
231
|
-
//
|
|
306
|
+
// Status and held rows without a draft also own the blank row their trailing newline
|
|
232
307
|
// left the cursor on — the same row paint() counts into screenRows.
|
|
233
|
-
eraseLines(statusLines + (draftRows || (
|
|
308
|
+
eraseLines(heldLines + statusLines + (draftRows || (heldLines + statusLines > 0 ? 1 : 0)));
|
|
234
309
|
screenRows = 0;
|
|
235
310
|
paint();
|
|
236
311
|
};
|
|
@@ -249,6 +324,12 @@ export function createPaneCompositor(out) {
|
|
|
249
324
|
redrawLine = null;
|
|
250
325
|
readCaretUp = null;
|
|
251
326
|
readCaretIndex = null;
|
|
327
|
+
// The region is gone; nothing of it may be repainted after the pane falls back.
|
|
328
|
+
seat = null;
|
|
329
|
+
pinned = null;
|
|
330
|
+
paintedSeat = null;
|
|
331
|
+
paintedPinned = null;
|
|
332
|
+
paintedHeld = null;
|
|
252
333
|
openLine = false;
|
|
253
334
|
screenRows = 0;
|
|
254
335
|
},
|
|
@@ -256,7 +337,7 @@ export function createPaneCompositor(out) {
|
|
|
256
337
|
eraseScreen();
|
|
257
338
|
// With no region left, an unfinished streamed line goes out verbatim so the
|
|
258
339
|
// next delta continues it on the same row instead of splitting mid-word.
|
|
259
|
-
if (held &&
|
|
340
|
+
if (held && (!widthKnown() || (pinned === null && seat === null)) && !composeText()) {
|
|
260
341
|
writeVerbatim(held);
|
|
261
342
|
held = "";
|
|
262
343
|
}
|
|
@@ -265,7 +346,7 @@ export function createPaneCompositor(out) {
|
|
|
265
346
|
transcript(text) {
|
|
266
347
|
if (!text)
|
|
267
348
|
return;
|
|
268
|
-
if (
|
|
349
|
+
if (!widthKnown() || (pinned === null && seat === null && composeRows() === 0 && screenRows === 0)) {
|
|
269
350
|
if (held) {
|
|
270
351
|
writeVerbatim(held);
|
|
271
352
|
held = "";
|
|
@@ -274,13 +355,25 @@ export function createPaneCompositor(out) {
|
|
|
274
355
|
return;
|
|
275
356
|
}
|
|
276
357
|
held += text;
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
358
|
+
const first = held.indexOf("\n");
|
|
359
|
+
if (first < 0) {
|
|
360
|
+
// A delta with no newline yet must still show as it streams: repaint the region
|
|
361
|
+
// (the painted tail is bounded) while a status row is painted.
|
|
362
|
+
if (seat !== null || pinned !== null) {
|
|
363
|
+
eraseScreen();
|
|
364
|
+
paint();
|
|
365
|
+
}
|
|
366
|
+
return;
|
|
283
367
|
}
|
|
368
|
+
// Drain every complete line in one batch: erase once, write them above in order,
|
|
369
|
+
// then repaint. Painting the remainder between lines would scroll a long chunk.
|
|
370
|
+
const last = held.lastIndexOf("\n");
|
|
371
|
+
const complete = held.slice(0, last + 1);
|
|
372
|
+
held = held.slice(last + 1);
|
|
373
|
+
eraseScreen();
|
|
374
|
+
out.write(complete);
|
|
375
|
+
openLine = false;
|
|
376
|
+
paint();
|
|
284
377
|
},
|
|
285
378
|
line(text) {
|
|
286
379
|
pane.transcript(`${text}\n`);
|
|
@@ -301,14 +394,29 @@ export function createPaneCompositor(out) {
|
|
|
301
394
|
openLine = false;
|
|
302
395
|
}
|
|
303
396
|
eraseScreen();
|
|
304
|
-
|
|
397
|
+
pinned = text;
|
|
305
398
|
paint();
|
|
306
399
|
},
|
|
307
400
|
clearStatus() {
|
|
308
|
-
if (
|
|
401
|
+
if (pinned === null)
|
|
402
|
+
return;
|
|
403
|
+
eraseScreen();
|
|
404
|
+
pinned = null;
|
|
405
|
+
paint();
|
|
406
|
+
},
|
|
407
|
+
status(text) {
|
|
408
|
+
const next = text ? text : null;
|
|
409
|
+
if (next === seat)
|
|
410
|
+
return;
|
|
411
|
+
// Without a width nothing is painted or measured, but the text is kept: the next
|
|
412
|
+
// resize (or paint with a width) shows the state it named, instead of dropping it
|
|
413
|
+
// until some later state change.
|
|
414
|
+
if (!widthKnown()) {
|
|
415
|
+
seat = next;
|
|
309
416
|
return;
|
|
417
|
+
}
|
|
310
418
|
eraseScreen();
|
|
311
|
-
|
|
419
|
+
seat = next;
|
|
312
420
|
paint();
|
|
313
421
|
},
|
|
314
422
|
beforeSubmit() {
|
|
@@ -486,7 +594,7 @@ export function createRunnerInput(input, output, onSubmit, pane) {
|
|
|
486
594
|
}
|
|
487
595
|
pane?.refresh();
|
|
488
596
|
};
|
|
489
|
-
const wasRaw = input.isRaw;
|
|
597
|
+
const wasRaw = input.isRaw ?? false;
|
|
490
598
|
const end = () => editor.close();
|
|
491
599
|
input.setRawMode(true);
|
|
492
600
|
output.write("\u001b[?2004h");
|
|
@@ -529,6 +637,11 @@ function diagnosticText(details) {
|
|
|
529
637
|
? stripVTControlCharacters(detail).replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/gu, " ").replace(/\s+/g, " ").trim()
|
|
530
638
|
: "").find(Boolean) ?? "";
|
|
531
639
|
}
|
|
640
|
+
/** A runner-owned label for the pane (a configured model or effort): painted as given, so
|
|
641
|
+
* terminal controls and bidi/format characters are neutralized first, as diagnostics are. */
|
|
642
|
+
function paneLabel(text) {
|
|
643
|
+
return stripVTControlCharacters(text).replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/gu, " ").replace(/\s+/g, " ").trim();
|
|
644
|
+
}
|
|
532
645
|
function errorNotice(details, runtime) {
|
|
533
646
|
const text = diagnosticText(details);
|
|
534
647
|
const marker = runtime === "omp" ? "[omp-runner] ERROR" : PI_RUNNER_ERROR_MARKER;
|
|
@@ -549,7 +662,7 @@ function modelErrorNotice(event, runtime) {
|
|
|
549
662
|
}
|
|
550
663
|
return {};
|
|
551
664
|
}
|
|
552
|
-
export function mapPiEvent(event, runtime = "pi") {
|
|
665
|
+
export function mapPiEvent(event, runtime = "pi", style = STYLE) {
|
|
553
666
|
const type = typeof event.type === "string" ? event.type : "";
|
|
554
667
|
switch (type) {
|
|
555
668
|
case "agent_start":
|
|
@@ -591,12 +704,12 @@ export function mapPiEvent(event, runtime = "pi") {
|
|
|
591
704
|
return { mirrorLines: [""], ...modelErrorNotice(event, runtime) };
|
|
592
705
|
case "tool_execution_start": {
|
|
593
706
|
const tool = typeof event.toolName === "string" ? event.toolName : (typeof event.name === "string" ? event.name : "tool");
|
|
594
|
-
return { mirrorLines: [`
|
|
707
|
+
return { mirrorLines: [` ${style.dim(`⚙ ${tool} …`)}`], activity: { hookEvent: "PreToolUse", subtype: tool } };
|
|
595
708
|
}
|
|
596
709
|
case "tool_execution_end": {
|
|
597
710
|
const tool = typeof event.toolName === "string" ? event.toolName : (typeof event.name === "string" ? event.name : "tool");
|
|
598
711
|
const failed = event.isError === true || event.error != null;
|
|
599
|
-
return { mirrorLines: [`
|
|
712
|
+
return { mirrorLines: [` ${style.dim(`⚙ ${tool}`)} ${failed ? style.failed("FAILED") : "done"}`] };
|
|
600
713
|
}
|
|
601
714
|
case "queue_update":
|
|
602
715
|
return { mirrorLines: [] };
|
|
@@ -607,7 +720,8 @@ export function mapPiEvent(event, runtime = "pi") {
|
|
|
607
720
|
// summary (Pi's docs/rpc.md). An end that names neither is done.
|
|
608
721
|
const failure = diagnosticText([event.errorMessage]).slice(0, 400);
|
|
609
722
|
return { mirrorLines: [event.aborted === true ? `[${runtime}] compaction cancelled`
|
|
610
|
-
: failure ? `[${runtime}] compaction failed: ${failure}` : `[${runtime}] compaction done`]
|
|
723
|
+
: failure ? `[${runtime}] compaction failed: ${failure}` : `[${runtime}] compaction done`],
|
|
724
|
+
...(runtime === "pi" ? { activity: { hookEvent: "Stop", subtype: "compaction" } } : {}) };
|
|
611
725
|
}
|
|
612
726
|
// OMP names its automatic compaction separately. Pi keeps main's mapping
|
|
613
727
|
// (unmapped), so an idle Pi seat never reads as running after one.
|
|
@@ -631,7 +745,15 @@ export function mapPiEvent(event, runtime = "pi") {
|
|
|
631
745
|
return { mirrorLines: [] };
|
|
632
746
|
}
|
|
633
747
|
}
|
|
748
|
+
export function writePiRunnerSidecar(path, state) {
|
|
749
|
+
const temporary = `${path}.${process.pid}.tmp`;
|
|
750
|
+
fs.writeFileSync(temporary, JSON.stringify(state), { mode: 0o600 });
|
|
751
|
+
fs.renameSync(temporary, path);
|
|
752
|
+
}
|
|
634
753
|
const GET_STATE_ID = "pi-runner-get-state";
|
|
754
|
+
/** The reserved manual-compaction input carries its attempt id in the RPC id, so a
|
|
755
|
+
* reply and the sidecar record can name exactly the request OpenRig made. */
|
|
756
|
+
const COMPACT_ID = "pi-runner-compact:";
|
|
635
757
|
const CATCH_UP_ID = "pi-runner-catch-up";
|
|
636
758
|
const CURSOR_REFRESH_ID = "pi-runner-cursor-refresh";
|
|
637
759
|
const NEGOTIATE_ID = "omp-runner-negotiate";
|
|
@@ -708,7 +830,33 @@ export class RunnerCore {
|
|
|
708
830
|
io;
|
|
709
831
|
identity;
|
|
710
832
|
opts;
|
|
833
|
+
compaction;
|
|
834
|
+
/** The last attempt-stamped record, kept beside `compaction` so a later
|
|
835
|
+
* automatic run cannot erase a requested attempt's result. */
|
|
836
|
+
requestedCompaction;
|
|
837
|
+
/** The attempt a `/openrig-compact <id>` input named, awaiting its compaction_start. */
|
|
838
|
+
pendingCompactAttemptId = null;
|
|
839
|
+
/** Durable copy of that pending attempt: written before the compact RPC, so a
|
|
840
|
+
* restarted daemon reads the newest request as uncertain, not as an older run. */
|
|
841
|
+
pendingCompaction;
|
|
842
|
+
managed = new Map();
|
|
843
|
+
managedQueue = [];
|
|
844
|
+
managedRpc = new Map();
|
|
845
|
+
managedWake = null;
|
|
846
|
+
managedQuarantined = false;
|
|
847
|
+
pendingManagedStart = false;
|
|
848
|
+
personPreflights = new Set();
|
|
849
|
+
promptRevision = 0;
|
|
850
|
+
idleRevision = -1;
|
|
851
|
+
idleQuery = null;
|
|
852
|
+
nativeQueueStateAvailable = false;
|
|
711
853
|
streaming = false;
|
|
854
|
+
/** The child is gone; the status row says exited, never idle. */
|
|
855
|
+
paneExited = false;
|
|
856
|
+
/** A failure is known and no new turn has started: the status row says error, not idle. */
|
|
857
|
+
paneError = false;
|
|
858
|
+
/** A runtime-reported automatic retry is in flight; the row says retrying until it ends. */
|
|
859
|
+
paneRetrying = false;
|
|
712
860
|
/** Pi runs this runner has opened, each posted as an accepted turn (contract section 4): the working beat names it. */
|
|
713
861
|
turn = 0;
|
|
714
862
|
sessionFile;
|
|
@@ -765,6 +913,9 @@ export class RunnerCore {
|
|
|
765
913
|
}
|
|
766
914
|
/** Runner readiness is the sidecar's acknowledged get_state, not RPC transport ready. */
|
|
767
915
|
isReady() { return this.ready; }
|
|
916
|
+
/** A permanent reporting-authority refusal fences new managed dispatch, not person input or native work already in flight. */
|
|
917
|
+
quarantineManagedChannel() { this.managedQuarantined = true; }
|
|
918
|
+
nativeChannelCapabilities() { return { input: this.ready && !this.managedQuarantined && this.runtime === "pi", wake: this.ready && !this.managedQuarantined && this.nativeQueueStateAvailable && this.runtime === "pi", cancel: false }; }
|
|
768
919
|
/** Kick off identity capture. Called once pi's RPC stream is up; for OMP, with its `ready` frame. */
|
|
769
920
|
start(ready) {
|
|
770
921
|
// K4: the first credential observation, before Pi can make any request of this runner's.
|
|
@@ -792,6 +943,7 @@ export class RunnerCore {
|
|
|
792
943
|
// are live-only signals.
|
|
793
944
|
this.io.sendRpc({ type: "get_entries", since: this.opts.catchUpSince, id: CATCH_UP_ID });
|
|
794
945
|
}
|
|
946
|
+
this.refreshPaneStatus();
|
|
795
947
|
}
|
|
796
948
|
/** One LF-delimited JSONL record from pi stdout. */
|
|
797
949
|
handlePiLine(rawLine) {
|
|
@@ -848,8 +1000,125 @@ export class RunnerCore {
|
|
|
848
1000
|
this.diag(`[omp-runner] ERROR rpc frame: ${reason}; the chunked frame was dropped`);
|
|
849
1001
|
}
|
|
850
1002
|
get runtime() { return this.opts.runtime ?? "pi"; }
|
|
1003
|
+
async acceptRunnerRequest(frame) {
|
|
1004
|
+
if (!this.ready || this.runtime !== "pi" || !this.io.postRunner || frame.version !== 1 || frame.runId !== this.identity.runId
|
|
1005
|
+
|| !Number.isSafeInteger(frame.sequence) || frame.sequence < 1 || typeof frame.requestId !== "string"
|
|
1006
|
+
|| !["input", "wake"].includes(frame.kind) || typeof (frame.kind === "wake" ? frame.payload?.question : frame.payload?.text) !== "string")
|
|
1007
|
+
return;
|
|
1008
|
+
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 } };
|
|
1010
|
+
if ([...this.managed.values()].some(entry => entry.frame.sequence === frame.sequence && entry.frame.requestId !== frame.requestId))
|
|
1011
|
+
throw new Error("Conflicting native sequence");
|
|
1012
|
+
const old = this.managed.get(frame.requestId);
|
|
1013
|
+
if (old) {
|
|
1014
|
+
if (JSON.stringify(old.frame) !== JSON.stringify(frame))
|
|
1015
|
+
throw new Error("Conflicting native request identity");
|
|
1016
|
+
await old.acceptance;
|
|
1017
|
+
return;
|
|
1018
|
+
}
|
|
1019
|
+
const entry = { frame, state: "accepting", reports: Promise.resolve() };
|
|
1020
|
+
this.managed.set(frame.requestId, entry);
|
|
1021
|
+
entry.acceptance = (async () => {
|
|
1022
|
+
const accepted = await this.io.postRunner({ type: "ack", runId: frame.runId, requestId: frame.requestId, sequence: frame.sequence, state: "accepted" });
|
|
1023
|
+
if (!accepted) {
|
|
1024
|
+
entry.state = "unavailable";
|
|
1025
|
+
this.pumpManaged();
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
entry.state = "queued";
|
|
1029
|
+
this.managedQueue.push(entry);
|
|
1030
|
+
this.managedQueue.sort((a, b) => a.frame.sequence - b.frame.sequence);
|
|
1031
|
+
this.pumpManaged();
|
|
1032
|
+
})();
|
|
1033
|
+
await entry.acceptance;
|
|
1034
|
+
}
|
|
1035
|
+
reportManaged(entry, type, result) {
|
|
1036
|
+
const f = entry.frame;
|
|
1037
|
+
if (type !== "submitted" && result)
|
|
1038
|
+
entry.terminalResult = result;
|
|
1039
|
+
entry.reports = entry.reports.then(() => this.io.postRunner?.({ type, runId: f.runId, requestId: f.requestId, sequence: f.sequence,
|
|
1040
|
+
...(f.kind === "wake" ? { nativeTurnId: `pi-wake-${f.requestId}` } : {}), ...(result ? { result } : {}) })).catch(() => { });
|
|
1041
|
+
}
|
|
1042
|
+
pumpManaged() {
|
|
1043
|
+
if (!this.ready || this.managedQuarantined || this.managedWake || this.pendingManagedStart && !this.streaming)
|
|
1044
|
+
return;
|
|
1045
|
+
const entry = this.managedQueue[0];
|
|
1046
|
+
if (!entry || this.personPreflights.size || [...this.managed.values()].some(prior => prior.state === "accepting" && prior.frame.sequence < entry.frame.sequence)
|
|
1047
|
+
|| entry.frame.kind === "wake" && (this.streaming || this.pendingManagedStart))
|
|
1048
|
+
return;
|
|
1049
|
+
if (entry.frame.kind === "wake" && this.idleRevision !== this.promptRevision) {
|
|
1050
|
+
if (!this.idleQuery) {
|
|
1051
|
+
this.idleQuery = { id: `openrig-native-idle-${this.promptRevision}`, revision: this.promptRevision };
|
|
1052
|
+
this.io.sendRpc({ type: "get_state", id: this.idleQuery.id });
|
|
1053
|
+
}
|
|
1054
|
+
return;
|
|
1055
|
+
}
|
|
1056
|
+
this.promptRevision += 1;
|
|
1057
|
+
this.managedQueue.shift();
|
|
1058
|
+
entry.state = "writing";
|
|
1059
|
+
if (entry.frame.kind === "wake") {
|
|
1060
|
+
this.managedWake = entry;
|
|
1061
|
+
entry.answer = [];
|
|
1062
|
+
}
|
|
1063
|
+
if (!this.streaming)
|
|
1064
|
+
this.pendingManagedStart = true;
|
|
1065
|
+
const id = `openrig-native-${entry.frame.requestId}`;
|
|
1066
|
+
this.managedRpc.set(id, entry);
|
|
1067
|
+
this.io.sendRpc({ id, type: "prompt", message: entry.frame.kind === "wake" ? entry.frame.payload.question : entry.frame.payload.text, streamingBehavior: "steer" });
|
|
1068
|
+
this.acceptIntoOpenRun();
|
|
1069
|
+
// Ordinary busy messages may steer; the next queued wake waits for agent_end, not this RPC response.
|
|
1070
|
+
this.pumpManaged();
|
|
1071
|
+
}
|
|
1072
|
+
finishManagedWake(entry, forced) {
|
|
1073
|
+
// Pi reports started before agent.prompt, but awaits extension handlers before handled.
|
|
1074
|
+
// Events before that authoritative disposition cannot establish this invocation's ownership.
|
|
1075
|
+
if (!forced && entry.disposition === undefined)
|
|
1076
|
+
return;
|
|
1077
|
+
const ownershipUnknown = !["started", "handled"].includes(entry.disposition ?? "") || entry.preDispositionEvents === true;
|
|
1078
|
+
if (ownershipUnknown)
|
|
1079
|
+
this.managedQuarantined = true;
|
|
1080
|
+
const completion = ownershipUnknown || forced && !entry.nativeAccepted ? "unknown" : forced ?? (entry.contaminated || !entry.wakeOpened ? "unknown"
|
|
1081
|
+
: entry.stopReason === "stop" && entry.answer?.some(text => text.length > 0) ? "completed" : entry.stopReason === "aborted" ? "interrupted" : entry.stopReason === "error" ? "failed" : "unknown");
|
|
1082
|
+
entry.state = "terminal";
|
|
1083
|
+
entry.terminalResult = { kind: "wake", nativeTurnId: `pi-wake-${entry.frame.requestId}`,
|
|
1084
|
+
completion, answer: completion === "completed" ? entry.answer?.join("\n") ?? "" : null,
|
|
1085
|
+
...(ownershipUnknown ? { ownershipUnknown: true } : {}),
|
|
1086
|
+
...(forced && !entry.nativeAccepted ? { submissionUnknown: true } : {}) };
|
|
1087
|
+
if (entry.nativeAccepted || forced)
|
|
1088
|
+
this.reportManaged(entry, "result", entry.terminalResult);
|
|
1089
|
+
if (this.managedWake === entry)
|
|
1090
|
+
this.managedWake = null;
|
|
1091
|
+
}
|
|
1092
|
+
personPrompt(command) {
|
|
1093
|
+
if (this.runtime !== "pi" || !this.io.postRunner) {
|
|
1094
|
+
this.io.sendRpc(command);
|
|
1095
|
+
return;
|
|
1096
|
+
}
|
|
1097
|
+
const id = `openrig-person-${++this.promptRevision}`;
|
|
1098
|
+
this.personPreflights.add(id);
|
|
1099
|
+
if (!this.streaming)
|
|
1100
|
+
this.pendingManagedStart = true;
|
|
1101
|
+
this.io.sendRpc({ ...command, id });
|
|
1102
|
+
}
|
|
851
1103
|
/** One aggregated paste block from pane stdin. */
|
|
852
1104
|
handleUserBlock(block) {
|
|
1105
|
+
const compact = /^\/openrig-compact ([\w-]+)$/.exec(block);
|
|
1106
|
+
if (this.runtime === "pi" && compact) {
|
|
1107
|
+
const attemptId = compact[1];
|
|
1108
|
+
if (this.pendingCompactAttemptId || (this.compaction?.startedAt && !this.compaction.endedAt)) {
|
|
1109
|
+
this.diag("[pi-runner] compact already in progress; request not sent");
|
|
1110
|
+
return;
|
|
1111
|
+
}
|
|
1112
|
+
this.pendingCompactAttemptId = attemptId;
|
|
1113
|
+
this.pendingCompaction = { attemptId, requestedAt: this.io.now() };
|
|
1114
|
+
// Persist the request before the RPC leaves: the id survives a daemon
|
|
1115
|
+
// restart, so the newest attempt reads uncertain, never an older result.
|
|
1116
|
+
this.writeSidecar({});
|
|
1117
|
+
this.io.sendRpc({ type: "compact", id: COMPACT_ID + attemptId });
|
|
1118
|
+
return;
|
|
1119
|
+
}
|
|
1120
|
+
if (this.managedWake)
|
|
1121
|
+
this.managedWake.contaminated = true;
|
|
853
1122
|
if (block === "/abort") {
|
|
854
1123
|
this.io.sendRpc({ type: "abort" });
|
|
855
1124
|
this.diag("[pi-runner] abort sent");
|
|
@@ -857,8 +1126,8 @@ export class RunnerCore {
|
|
|
857
1126
|
}
|
|
858
1127
|
if (block.startsWith("/followup ")) {
|
|
859
1128
|
const message = block.slice("/followup ".length);
|
|
860
|
-
this.
|
|
861
|
-
this.io.mirrorLine(
|
|
1129
|
+
this.personPrompt({ type: "follow_up", message });
|
|
1130
|
+
this.io.mirrorLine(`${this.style.commit("you (follow-up) ▸")} ${message}`);
|
|
862
1131
|
this.acceptIntoOpenRun();
|
|
863
1132
|
return;
|
|
864
1133
|
}
|
|
@@ -866,8 +1135,8 @@ export class RunnerCore {
|
|
|
866
1135
|
// while busy, queue it as a steer, delivered after the current turn's tool calls and before the next model call.
|
|
867
1136
|
// The runner's `streaming` starts only at agent_start, so it can't tell when a turn is about to start (#1932) or
|
|
868
1137
|
// when a prompt was consumed locally and started none. It labels the mirror line only.
|
|
869
|
-
this.
|
|
870
|
-
this.io.mirrorLine(this.streaming ?
|
|
1138
|
+
this.personPrompt({ type: "prompt", message: block, streamingBehavior: "steer" });
|
|
1139
|
+
this.io.mirrorLine(this.streaming ? `${this.style.commit("you (steer) ▸")} ${block}` : `${this.style.commit("you ▸")} ${block}`);
|
|
871
1140
|
this.acceptIntoOpenRun();
|
|
872
1141
|
}
|
|
873
1142
|
/** A working beat counts only for the latest accepted turn, and each prompt the runner gives the agent is accepted with
|
|
@@ -883,12 +1152,84 @@ export class RunnerCore {
|
|
|
883
1152
|
/** Child process exit — honest, loud, durable. */
|
|
884
1153
|
handlePiExit(code) {
|
|
885
1154
|
this.ready = false;
|
|
1155
|
+
this.paneExited = true;
|
|
1156
|
+
if (this.managedWake)
|
|
1157
|
+
this.finishManagedWake(this.managedWake, "failed");
|
|
886
1158
|
this.reportDroppedFrame(this.frameDecoder?.incomplete());
|
|
887
1159
|
this.io.mirrorLine(`[${this.runtime}-runner] EXITED ${this.runtime} exited (code ${code ?? "unknown"})`);
|
|
888
1160
|
this.writeSidecar({ exited: { code, at: this.io.now() } });
|
|
889
1161
|
this.io.postActivity(this.activityPayload("Stop", `${this.runtime}_exited`));
|
|
1162
|
+
this.refreshPaneStatus();
|
|
890
1163
|
}
|
|
891
1164
|
handleResponse(record) {
|
|
1165
|
+
if (this.idleQuery && record.id === this.idleQuery.id) {
|
|
1166
|
+
const query = this.idleQuery;
|
|
1167
|
+
this.idleQuery = null;
|
|
1168
|
+
const data = record.data;
|
|
1169
|
+
if (record.success === true && data?.isStreaming === false && data.pendingMessageCount === 0 && query.revision === this.promptRevision) {
|
|
1170
|
+
this.idleRevision = query.revision;
|
|
1171
|
+
this.pumpManaged();
|
|
1172
|
+
}
|
|
1173
|
+
else if (record.success === true && typeof data?.isStreaming === "boolean" && Number.isSafeInteger(data.pendingMessageCount) && Number(data.pendingMessageCount) >= 0) {
|
|
1174
|
+
setTimeout(() => this.pumpManaged(), 250).unref();
|
|
1175
|
+
}
|
|
1176
|
+
else {
|
|
1177
|
+
const next = this.managedQueue.shift();
|
|
1178
|
+
if (next) {
|
|
1179
|
+
next.state = "terminal";
|
|
1180
|
+
this.reportManaged(next, "rejected", { kind: next.frame.kind, reason: "native_idle_state_unavailable" });
|
|
1181
|
+
}
|
|
1182
|
+
this.pumpManaged();
|
|
1183
|
+
}
|
|
1184
|
+
return;
|
|
1185
|
+
}
|
|
1186
|
+
if (typeof record.id === "string" && this.personPreflights.delete(record.id)) {
|
|
1187
|
+
if (record.success !== true || record.data?.disposition === "handled")
|
|
1188
|
+
this.pendingManagedStart = false;
|
|
1189
|
+
this.pumpManaged();
|
|
1190
|
+
if (record.success !== false && record.error == null)
|
|
1191
|
+
return;
|
|
1192
|
+
}
|
|
1193
|
+
const managed = typeof record.id === "string" ? this.managedRpc.get(record.id) : undefined;
|
|
1194
|
+
if (managed) {
|
|
1195
|
+
this.managedRpc.delete(String(record.id));
|
|
1196
|
+
if (record.success === true) {
|
|
1197
|
+
managed.nativeAccepted = true;
|
|
1198
|
+
managed.state = "submitted";
|
|
1199
|
+
this.reportManaged(managed, "submitted");
|
|
1200
|
+
if (managed.frame.kind === "wake") {
|
|
1201
|
+
const disposition = record.data?.disposition;
|
|
1202
|
+
managed.disposition = typeof disposition === "string" ? disposition : "unknown";
|
|
1203
|
+
if (!["started", "handled"].includes(managed.disposition) || managed.preDispositionEvents)
|
|
1204
|
+
this.managedQuarantined = true;
|
|
1205
|
+
if (managed.nativeTerminal || managed.disposition !== "started" && !this.streaming)
|
|
1206
|
+
this.finishManagedWake(managed);
|
|
1207
|
+
else if (managed.terminalResult)
|
|
1208
|
+
this.reportManaged(managed, "result", managed.terminalResult);
|
|
1209
|
+
if (this.managedWake !== managed && !this.streaming) {
|
|
1210
|
+
this.pendingManagedStart = false;
|
|
1211
|
+
this.pumpManaged();
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
else {
|
|
1215
|
+
managed.state = "terminal";
|
|
1216
|
+
this.reportManaged(managed, "result", { kind: "input", accepted: true });
|
|
1217
|
+
if (record.data?.disposition === "handled") {
|
|
1218
|
+
this.pendingManagedStart = false;
|
|
1219
|
+
this.pumpManaged();
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
else {
|
|
1224
|
+
managed.state = "terminal";
|
|
1225
|
+
this.pendingManagedStart = false;
|
|
1226
|
+
this.reportManaged(managed, "rejected", { kind: managed.frame.kind, reason: "native_prompt_rejected" });
|
|
1227
|
+
if (this.managedWake === managed)
|
|
1228
|
+
this.managedWake = null;
|
|
1229
|
+
this.pumpManaged();
|
|
1230
|
+
}
|
|
1231
|
+
return;
|
|
1232
|
+
}
|
|
892
1233
|
if (record.id === NEGOTIATE_ID && this.v2Limit !== null) {
|
|
893
1234
|
if (record.success === true) {
|
|
894
1235
|
this.frameDecoder = new OmpFrameDecoder(this.v2Limit);
|
|
@@ -900,13 +1241,49 @@ export class RunnerCore {
|
|
|
900
1241
|
}
|
|
901
1242
|
return;
|
|
902
1243
|
}
|
|
1244
|
+
if (this.runtime === "pi" && record.success === true && record.error == null
|
|
1245
|
+
&& typeof record.id === "string" && record.id.startsWith(COMPACT_ID)) {
|
|
1246
|
+
const attemptId = record.id.slice(COMPACT_ID.length);
|
|
1247
|
+
if (this.pendingCompactAttemptId === attemptId)
|
|
1248
|
+
this.pendingCompactAttemptId = null;
|
|
1249
|
+
if (this.pendingCompaction?.attemptId === attemptId)
|
|
1250
|
+
this.pendingCompaction = undefined;
|
|
1251
|
+
this.writeSidecar({});
|
|
1252
|
+
return;
|
|
1253
|
+
}
|
|
903
1254
|
if (record.success === false || record.error != null) {
|
|
904
1255
|
const detail = typeof record.error === "string" ? record.error : "request failed";
|
|
905
1256
|
const message = detail + (this.runtime === "pi" ? piCredentialHint(detail) : "");
|
|
1257
|
+
const compactId = this.runtime === "pi" && typeof record.id === "string" && record.id.startsWith(COMPACT_ID)
|
|
1258
|
+
? record.id : null;
|
|
1259
|
+
if (compactId) {
|
|
1260
|
+
const attemptId = compactId.slice(COMPACT_ID.length);
|
|
1261
|
+
const unsupported = /unknown command|unsupported|not supported/i.test(detail);
|
|
1262
|
+
this.io.mirrorLine(`[pi-runner] ERROR rpc compact${unsupported ? " unsupported" : " failed"}: ${message}`);
|
|
1263
|
+
// A failure with no start replaces any older record: this attempt is the answer.
|
|
1264
|
+
const prior = this.compaction?.attemptId === attemptId ? this.compaction : undefined;
|
|
1265
|
+
const wasPending = this.pendingCompactAttemptId === attemptId;
|
|
1266
|
+
if (this.pendingCompactAttemptId === attemptId)
|
|
1267
|
+
this.pendingCompactAttemptId = null;
|
|
1268
|
+
if (this.pendingCompaction?.attemptId === attemptId)
|
|
1269
|
+
this.pendingCompaction = undefined;
|
|
1270
|
+
const failed = { attemptId, reason: prior?.reason ?? "manual",
|
|
1271
|
+
...(prior?.requestId ? { requestId: prior.requestId } : {}),
|
|
1272
|
+
...(prior?.startedAt ? { startedAt: prior.startedAt } : {}),
|
|
1273
|
+
endedAt: prior?.endedAt ?? this.io.now(), errorMessage: detail };
|
|
1274
|
+
if (wasPending || !this.compaction?.attemptId || this.compaction.attemptId === attemptId)
|
|
1275
|
+
this.compaction = failed;
|
|
1276
|
+
if (wasPending || !this.requestedCompaction || this.requestedCompaction.attemptId === attemptId)
|
|
1277
|
+
this.requestedCompaction = failed;
|
|
1278
|
+
this.writeSidecar({});
|
|
1279
|
+
return;
|
|
1280
|
+
}
|
|
906
1281
|
if (record.id === GET_STATE_ID) {
|
|
907
1282
|
this.ready = false;
|
|
1283
|
+
this.paneError = true;
|
|
908
1284
|
this.writeSidecar({});
|
|
909
1285
|
this.diag(this.runtime === "omp" ? `[omp-runner] ERROR rpc get_state: ${message}` : `${PI_RUNNER_ERROR_MARKER} rpc: ${message}`);
|
|
1286
|
+
this.refreshPaneStatus();
|
|
910
1287
|
// OMP cannot provide a resume token without get_state; stop it so the
|
|
911
1288
|
// launch fails now instead of waiting out readiness.
|
|
912
1289
|
if (this.runtime === "omp")
|
|
@@ -935,7 +1312,10 @@ export class RunnerCore {
|
|
|
935
1312
|
this.sessionFile = sessionFile ?? this.sessionFile;
|
|
936
1313
|
this.sessionId = sessionId ?? this.sessionId;
|
|
937
1314
|
const wasReady = this.ready;
|
|
1315
|
+
this.nativeQueueStateAvailable = typeof data.isStreaming === "boolean" && Number.isSafeInteger(data.pendingMessageCount) && Number(data.pendingMessageCount) >= 0;
|
|
938
1316
|
this.ready = this.runtime === "pi" || !!this.sessionFile;
|
|
1317
|
+
if (this.ready)
|
|
1318
|
+
this.pumpManaged();
|
|
939
1319
|
if (!this.ready) {
|
|
940
1320
|
if (this.runtime === "omp") {
|
|
941
1321
|
this.diag("[omp-runner] ERROR rpc get_state returned no session file; cannot provide a resume token");
|
|
@@ -945,6 +1325,8 @@ export class RunnerCore {
|
|
|
945
1325
|
// For custom protocol: pi-rpc community harnesses, reporting no session file
|
|
946
1326
|
// reads as needing attention rather than stopping the child process.
|
|
947
1327
|
this.diag(`[${this.runtime}-runner] ERROR rpc get_state returned no session file; cannot provide a resume token`);
|
|
1328
|
+
this.paneError = true;
|
|
1329
|
+
this.refreshPaneStatus();
|
|
948
1330
|
this.raiseAttention("runtime_error");
|
|
949
1331
|
return;
|
|
950
1332
|
}
|
|
@@ -953,6 +1335,8 @@ export class RunnerCore {
|
|
|
953
1335
|
// The sidecar names the reported file, so the launch refuses it at once; the identity isn't posted (below), and the
|
|
954
1336
|
// seat asks for attention rather than beating idle on a session nothing records.
|
|
955
1337
|
this.io.mirrorLine(`[${this.runtime}-runner] ERROR resume: get_state reports ${this.sessionFile}, not the requested ${this.opts.requestedSessionFile}; its identity isn't reported`);
|
|
1338
|
+
this.paneError = true;
|
|
1339
|
+
this.refreshPaneStatus();
|
|
956
1340
|
this.raiseAttention("runtime_error");
|
|
957
1341
|
return;
|
|
958
1342
|
}
|
|
@@ -961,6 +1345,8 @@ export class RunnerCore {
|
|
|
961
1345
|
// Subsequent get_state evaluations confirm liveness silently to avoid
|
|
962
1346
|
// terminal output spam while preserving state updates.
|
|
963
1347
|
this.io.mirrorLine(`${this.runtime === "omp" ? "[omp-runner] READY" : PI_RUNNER_READY_MARKER} session=${this.sessionFile ?? "unknown"}`);
|
|
1348
|
+
this.paneError = false;
|
|
1349
|
+
this.refreshPaneStatus();
|
|
964
1350
|
}
|
|
965
1351
|
// Re-post session identity on every successful get_state reply so the
|
|
966
1352
|
// daemon can discover replacement runners and keep session records current.
|
|
@@ -1068,6 +1454,7 @@ export class RunnerCore {
|
|
|
1068
1454
|
this.attention = next;
|
|
1069
1455
|
this.attentionIsLatest = true;
|
|
1070
1456
|
this.io.postActivity(this.activityPayload("Notification", next === "transient_turn_error" ? "runtime_error" : next));
|
|
1457
|
+
this.refreshPaneStatus();
|
|
1071
1458
|
}
|
|
1072
1459
|
/** Idle and streaming heartbeat. A Pi runner only reports at turn and tool boundaries, and the
|
|
1073
1460
|
* daemon reads any hook older than its freshness window as `unknown` (`stale_runtime_hook`): an
|
|
@@ -1111,6 +1498,7 @@ export class RunnerCore {
|
|
|
1111
1498
|
clearAttention() {
|
|
1112
1499
|
this.attention = null;
|
|
1113
1500
|
this.attentionIsLatest = false;
|
|
1501
|
+
this.refreshPaneStatus();
|
|
1114
1502
|
}
|
|
1115
1503
|
/** A diagnostic stays in the transcript — the readiness probe and the operator both read
|
|
1116
1504
|
* it there; a pane with a status line pins the latest one as a convenience copy. */
|
|
@@ -1118,7 +1506,84 @@ export class RunnerCore {
|
|
|
1118
1506
|
this.io.mirrorLine(text);
|
|
1119
1507
|
this.io.diagnostic?.(text);
|
|
1120
1508
|
}
|
|
1509
|
+
/** The pane's status row: what this seat runs, and the state the runner observed.
|
|
1510
|
+
* Only what is known is shown — a model or effort the launch did not name is omitted,
|
|
1511
|
+
* and a seat that is not ready yet, waiting on the operator, or failed never reads as
|
|
1512
|
+
* idle. Plain text; the pane owns clipping and repainting. */
|
|
1513
|
+
refreshPaneStatus() {
|
|
1514
|
+
if (!this.io.status)
|
|
1515
|
+
return;
|
|
1516
|
+
const parts = [];
|
|
1517
|
+
// The labels are runner-owned text painted as given: neutralize terminal controls so a
|
|
1518
|
+
// configured value cannot act on the terminal, exactly as diagnostics are treated.
|
|
1519
|
+
if (this.opts.model)
|
|
1520
|
+
parts.push(paneLabel(this.opts.model));
|
|
1521
|
+
if (this.opts.thinking)
|
|
1522
|
+
parts.push(`thinking:${paneLabel(this.opts.thinking)}`);
|
|
1523
|
+
parts.push(this.paneState());
|
|
1524
|
+
this.io.status(parts.join(" \u00b7 "));
|
|
1525
|
+
}
|
|
1526
|
+
paneState() {
|
|
1527
|
+
if (this.paneExited)
|
|
1528
|
+
return "exited";
|
|
1529
|
+
if (!this.ready)
|
|
1530
|
+
return this.paneError ? "error" : "starting";
|
|
1531
|
+
if (this.attention === "permission_prompt")
|
|
1532
|
+
return "waiting for input";
|
|
1533
|
+
if (this.attention === "runtime_error")
|
|
1534
|
+
return "error";
|
|
1535
|
+
if (this.attention === "transient_turn_error")
|
|
1536
|
+
return "retrying";
|
|
1537
|
+
// A known failure outranks an open turn, and an observed retry outranks "working".
|
|
1538
|
+
if (this.paneError)
|
|
1539
|
+
return "error";
|
|
1540
|
+
if (this.paneRetrying)
|
|
1541
|
+
return "retrying";
|
|
1542
|
+
if (this.streaming)
|
|
1543
|
+
return "working";
|
|
1544
|
+
return "idle";
|
|
1545
|
+
}
|
|
1546
|
+
/** Emphasis for the lines the runner writes itself; model output stays plain. */
|
|
1547
|
+
get style() { return this.opts.style ?? STYLE; }
|
|
1121
1548
|
handleEvent(event) {
|
|
1549
|
+
if (this.runtime === "pi" && (event.type === "compaction_start" || event.type === "compaction_end")) {
|
|
1550
|
+
const identity = {
|
|
1551
|
+
...(typeof event.requestId === "string" ? { requestId: event.requestId } : {}),
|
|
1552
|
+
...(typeof event.reason === "string" ? { reason: event.reason } : {}),
|
|
1553
|
+
};
|
|
1554
|
+
// The attempt id OpenRig's reserved input named rides the runner's native
|
|
1555
|
+
// compact command and returns here. An automatic run (threshold/overflow)
|
|
1556
|
+
// never takes it, so its result cannot answer a requested attempt.
|
|
1557
|
+
const manualReason = typeof event.reason !== "string" || event.reason === "manual";
|
|
1558
|
+
if (event.type === "compaction_start") {
|
|
1559
|
+
const attemptId = manualReason ? this.pendingCompactAttemptId ?? undefined : undefined;
|
|
1560
|
+
if (attemptId) {
|
|
1561
|
+
this.pendingCompactAttemptId = null;
|
|
1562
|
+
this.pendingCompaction = undefined;
|
|
1563
|
+
}
|
|
1564
|
+
this.compaction = { ...(attemptId ? { attemptId } : {}), ...identity, startedAt: this.io.now() };
|
|
1565
|
+
}
|
|
1566
|
+
else {
|
|
1567
|
+
const result = event.result;
|
|
1568
|
+
const summary = result !== null && typeof result === "object" ? Object.fromEntries(Object.entries(result).filter(([key, value]) => (["summary", "firstKeptEntryId"].includes(key) && typeof value === "string") ||
|
|
1569
|
+
(["tokensBefore", "estimatedTokensAfter"].includes(key) && typeof value === "number"))) : undefined;
|
|
1570
|
+
const attemptId = this.compaction?.attemptId
|
|
1571
|
+
?? (manualReason ? this.pendingCompactAttemptId ?? undefined : undefined);
|
|
1572
|
+
if (attemptId && this.pendingCompactAttemptId === attemptId)
|
|
1573
|
+
this.pendingCompactAttemptId = null;
|
|
1574
|
+
this.compaction = { ...this.compaction, ...(attemptId ? { attemptId } : {}), ...identity, endedAt: this.io.now(),
|
|
1575
|
+
...(result === null ? { result: null } : summary ? { result: summary } : {}),
|
|
1576
|
+
...(typeof event.aborted === "boolean" ? { aborted: event.aborted } : {}),
|
|
1577
|
+
...(typeof event.willRetry === "boolean" ? { willRetry: event.willRetry } : {}),
|
|
1578
|
+
...(typeof event.errorMessage === "string" ? { errorMessage: event.errorMessage } : {}),
|
|
1579
|
+
};
|
|
1580
|
+
// Keep the attempt-stamped record beside `compaction`: a later automatic
|
|
1581
|
+
// run replaces that field, and this request must still read completed.
|
|
1582
|
+
if (this.compaction.attemptId)
|
|
1583
|
+
this.requestedCompaction = this.compaction;
|
|
1584
|
+
}
|
|
1585
|
+
this.writeSidecar({});
|
|
1586
|
+
}
|
|
1122
1587
|
if (event.type === "extension_ui_request") {
|
|
1123
1588
|
const method = event.method;
|
|
1124
1589
|
const dialog = method === "select" || method === "confirm" || method === "input" || method === "editor";
|
|
@@ -1145,6 +1610,11 @@ export class RunnerCore {
|
|
|
1145
1610
|
const message = event.message;
|
|
1146
1611
|
if (event.type === "agent_start" || (event.type === "message_start" && message?.role === "assistant")) {
|
|
1147
1612
|
this.assistantErrorShown = false;
|
|
1613
|
+
// A new assistant message supersedes the failed one it follows, even in the same turn.
|
|
1614
|
+
if (event.type === "message_start" && this.paneError) {
|
|
1615
|
+
this.paneError = false;
|
|
1616
|
+
this.refreshPaneStatus();
|
|
1617
|
+
}
|
|
1148
1618
|
}
|
|
1149
1619
|
// Durable cursor: any event carrying a session-entry id advances it. A Pi event's own `id` isn't one (Pi's
|
|
1150
1620
|
// history ids reach the cursor through get_entries), so on Pi only an explicit `entryId` counts.
|
|
@@ -1157,6 +1627,31 @@ export class RunnerCore {
|
|
|
1157
1627
|
if (event.type === "agent_start") {
|
|
1158
1628
|
this.clearAttention();
|
|
1159
1629
|
this.io.clearStatus?.();
|
|
1630
|
+
this.paneError = false;
|
|
1631
|
+
this.paneRetrying = false;
|
|
1632
|
+
this.refreshPaneStatus();
|
|
1633
|
+
}
|
|
1634
|
+
// A retry replaces the failed attempt it retries, so the row follows the attempt until
|
|
1635
|
+
// its matching end, exit or a superseding turn.
|
|
1636
|
+
if (event.type === "auto_retry_start") {
|
|
1637
|
+
this.paneError = false;
|
|
1638
|
+
this.paneRetrying = true;
|
|
1639
|
+
this.refreshPaneStatus();
|
|
1640
|
+
}
|
|
1641
|
+
if (event.type === "auto_retry_end") {
|
|
1642
|
+
this.paneRetrying = false;
|
|
1643
|
+
this.refreshPaneStatus();
|
|
1644
|
+
}
|
|
1645
|
+
// A turn's opening supersedes the previous turn's failure — on either runtime, since
|
|
1646
|
+
// both can open a turn with turn_start alone. omp's attention policy is untouched.
|
|
1647
|
+
if (event.type === "turn_start") {
|
|
1648
|
+
this.paneError = false;
|
|
1649
|
+
this.paneRetrying = false;
|
|
1650
|
+
if (this.runtime === "omp" && !this.streaming) {
|
|
1651
|
+
// A turn the runtime opened itself is work in flight; agent_end still closes it.
|
|
1652
|
+
this.streaming = true;
|
|
1653
|
+
}
|
|
1654
|
+
this.refreshPaneStatus();
|
|
1160
1655
|
}
|
|
1161
1656
|
if (this.runtime === "omp") {
|
|
1162
1657
|
if (event.type === "agent_start" || event.type === "turn_start"
|
|
@@ -1175,14 +1670,34 @@ export class RunnerCore {
|
|
|
1175
1670
|
if (event.type === "turn_start")
|
|
1176
1671
|
this.assistantErrorShown = false;
|
|
1177
1672
|
}
|
|
1178
|
-
const
|
|
1673
|
+
const wake = this.managedWake;
|
|
1674
|
+
if (wake && wake.disposition === undefined && ["agent_start", "message_end", "agent_end"].includes(String(event.type)))
|
|
1675
|
+
wake.preDispositionEvents = true;
|
|
1676
|
+
if (event.type === "agent_start" && wake) {
|
|
1677
|
+
if (wake.wakeOpened)
|
|
1678
|
+
wake.contaminated = true;
|
|
1679
|
+
wake.wakeOpened = true;
|
|
1680
|
+
}
|
|
1681
|
+
if (event.type === "message_end" && wake && wake.disposition === "started" && !wake.preDispositionEvents && wake.wakeOpened) {
|
|
1682
|
+
const assistant = event.message;
|
|
1683
|
+
if (assistant?.role === "assistant") {
|
|
1684
|
+
wake.answer.push(...(Array.isArray(assistant.content) ? assistant.content : []).filter(part => part.type === "text" && typeof part.text === "string").map(part => part.text));
|
|
1685
|
+
wake.stopReason = assistant.stopReason;
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
const mapped = mapPiEvent(event, this.runtime, this.style);
|
|
1179
1689
|
// A working beat counts only for the latest accepted turn. Pi's runs start from this runner's prompts, so the run
|
|
1180
1690
|
// that opens is posted as one, before its first event; a prompt Pi handles without a run opens none. A prompt sent
|
|
1181
1691
|
// into an open run is accepted as it's sent (acceptIntoOpenRun).
|
|
1182
1692
|
const opening = this.runtime !== "omp" && mapped.streaming === true && !this.streaming;
|
|
1183
|
-
if (mapped.streaming !== undefined)
|
|
1693
|
+
if (mapped.streaming !== undefined) {
|
|
1694
|
+
const changed = this.streaming !== mapped.streaming;
|
|
1184
1695
|
this.streaming = mapped.streaming;
|
|
1696
|
+
if (changed)
|
|
1697
|
+
this.refreshPaneStatus();
|
|
1698
|
+
}
|
|
1185
1699
|
if (opening) {
|
|
1700
|
+
setImmediate(() => this.pumpManaged());
|
|
1186
1701
|
this.turn += 1;
|
|
1187
1702
|
this.io.postActivity(this.activityPayload("UserPromptSubmit", "accepted", { turnId: String(this.turn) }));
|
|
1188
1703
|
}
|
|
@@ -1191,6 +1706,18 @@ export class RunnerCore {
|
|
|
1191
1706
|
if (event.type === "agent_end" && this.runtime === "omp")
|
|
1192
1707
|
this.postSessionIdentity();
|
|
1193
1708
|
if (event.type === "agent_end") {
|
|
1709
|
+
// A retry that never reported its end must not outlive the turn it belonged to.
|
|
1710
|
+
if (this.paneRetrying) {
|
|
1711
|
+
this.paneRetrying = false;
|
|
1712
|
+
this.refreshPaneStatus();
|
|
1713
|
+
}
|
|
1714
|
+
this.idleRevision = -1;
|
|
1715
|
+
this.pendingManagedStart = false;
|
|
1716
|
+
if (wake) {
|
|
1717
|
+
wake.nativeTerminal = true;
|
|
1718
|
+
this.finishManagedWake(wake);
|
|
1719
|
+
}
|
|
1720
|
+
setImmediate(() => this.pumpManaged());
|
|
1194
1721
|
// QA RED fold: live events do not reliably carry
|
|
1195
1722
|
// session-entry ids, so the durable cursor starved (lastEntryId stayed
|
|
1196
1723
|
// null in real runs). Refresh it from the source of truth after every
|
|
@@ -1211,6 +1738,9 @@ export class RunnerCore {
|
|
|
1211
1738
|
this.diag(mapped.errorNotice);
|
|
1212
1739
|
}
|
|
1213
1740
|
this.assistantErrorShown = true;
|
|
1741
|
+
// The failure is known: the row says so until a new turn starts, never idle.
|
|
1742
|
+
this.paneError = true;
|
|
1743
|
+
this.refreshPaneStatus();
|
|
1214
1744
|
// Only typed, explicitly transient HTTP failures may release the send
|
|
1215
1745
|
// guard at agent_end. Unknown/auth/configuration failures stay attention;
|
|
1216
1746
|
// diagnostic prose is never used to decide whether a retry is safe.
|
|
@@ -1242,15 +1772,25 @@ export class RunnerCore {
|
|
|
1242
1772
|
return;
|
|
1243
1773
|
if (event.type === "agent_end" && this.attention === "transient_turn_error")
|
|
1244
1774
|
this.clearAttention();
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1775
|
+
const compactionBeat = this.runtime === "pi" && mapped.activity.subtype === "compaction";
|
|
1776
|
+
try {
|
|
1777
|
+
if (mapped.activity.hookEvent === "Stop" && this.attention) {
|
|
1778
|
+
// The turn ended, but the operator still has to act. Drop the Stop; if
|
|
1779
|
+
// later activity replaced the attention, restore it as the final state.
|
|
1780
|
+
if (!this.attentionIsLatest)
|
|
1781
|
+
this.raiseAttention(this.attention);
|
|
1782
|
+
}
|
|
1783
|
+
else {
|
|
1784
|
+
this.attentionIsLatest = false;
|
|
1785
|
+
this.io.postActivity(this.activityPayload(mapped.activity.hookEvent, mapped.activity.subtype, compactionBeat ? { requestId: this.compaction?.requestId, reason: this.compaction?.reason,
|
|
1786
|
+
...(event.type === "compaction_end" ? { endedAt: this.compaction?.endedAt } : {}) } : {}));
|
|
1787
|
+
}
|
|
1250
1788
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1789
|
+
finally {
|
|
1790
|
+
if (compactionBeat && event.type === "compaction_end") {
|
|
1791
|
+
this.lastPostedHook = null;
|
|
1792
|
+
this.lastHeartbeatMs = null;
|
|
1793
|
+
}
|
|
1254
1794
|
}
|
|
1255
1795
|
}
|
|
1256
1796
|
/** Re-deliver OMP or managed run identity until the daemon confirms the resume token.
|
|
@@ -1322,6 +1862,11 @@ export class RunnerCore {
|
|
|
1322
1862
|
sessionFile: this.sessionFile,
|
|
1323
1863
|
sessionId: this.sessionId,
|
|
1324
1864
|
lastEntryId: this.lastEntryId,
|
|
1865
|
+
...(this.runtime === "pi" ? {
|
|
1866
|
+
compaction: this.compaction,
|
|
1867
|
+
requestedCompaction: this.requestedCompaction,
|
|
1868
|
+
pendingCompaction: this.pendingCompaction,
|
|
1869
|
+
} : {}),
|
|
1325
1870
|
updatedAt: this.io.now(),
|
|
1326
1871
|
...patch,
|
|
1327
1872
|
});
|
|
@@ -1588,6 +2133,115 @@ export function piLaunchCapabilityError(command, trust, line, readVersion) {
|
|
|
1588
2133
|
catch { /* diagnostics only; never changes the child's outcome */ }
|
|
1589
2134
|
return `Pi invoked as ${command} (${version}; exact executable path unknown) rejects the managed --name/--${trust} flags. Install the current @earendil-works/pi-coding-agent (npm install -g @earendil-works/pi-coding-agent) and check 'command -v pi' in this pane; an older Pi installation may be shadowing it.`;
|
|
1590
2135
|
}
|
|
2136
|
+
function isPermanentPiRunRefusal(status, code) {
|
|
2137
|
+
if (![401, 403, 404, 409, 410].includes(status) || ["runner_hello_required", "runner_grant_pending", "runner_grant_unverified"].includes(code ?? ""))
|
|
2138
|
+
return false;
|
|
2139
|
+
return status === 401 || status === 403 || ["runner_grant_required", "runner_grant_revoked", "runner_grant_stale"].includes(code ?? "");
|
|
2140
|
+
}
|
|
2141
|
+
function runnerFrameBound(buffer) {
|
|
2142
|
+
const overhead = 64 * 1024;
|
|
2143
|
+
const fallback = { limit: 6 * 1024 * 1024 + overhead };
|
|
2144
|
+
if (!buffer.startsWith(": runner-frame-chars=") || !buffer.includes("\n"))
|
|
2145
|
+
return fallback;
|
|
2146
|
+
const header = /^: runner-frame-chars=([0-9]+)\n/.exec(buffer);
|
|
2147
|
+
const chars = header ? Number(header[1]) : NaN;
|
|
2148
|
+
if (!Number.isSafeInteger(chars) || chars < 1 || chars > Number.MAX_SAFE_INTEGER - overhead)
|
|
2149
|
+
throw new Error("Invalid channel frame size");
|
|
2150
|
+
return { limit: chars + overhead, chars };
|
|
2151
|
+
}
|
|
2152
|
+
/** Pi's HTTP/SSE wire loop; it owns no native executor or durable receiver journal. */
|
|
2153
|
+
export async function connectPiRunnerChannel(core, endpoint, runId, signal) {
|
|
2154
|
+
let retained = false, cursor = 0;
|
|
2155
|
+
while (!signal.aborted) {
|
|
2156
|
+
try {
|
|
2157
|
+
if (!core.isReady()) {
|
|
2158
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
2159
|
+
continue;
|
|
2160
|
+
}
|
|
2161
|
+
const hello = await fetch(new URL("/api/activity/runner-channel", endpoint.baseUrl), { method: "POST", signal: AbortSignal.any([signal, AbortSignal.timeout(3000)]),
|
|
2162
|
+
headers: { authorization: `Bearer ${endpoint.token}`, "content-type": "application/json" },
|
|
2163
|
+
body: JSON.stringify({ type: "hello", version: 1, runId, retained, capabilities: core.nativeChannelCapabilities() }) });
|
|
2164
|
+
if (!hello.ok) {
|
|
2165
|
+
const failure = await hello.json().catch(() => null);
|
|
2166
|
+
if (isPermanentPiRunRefusal(hello.status, failure?.code)) {
|
|
2167
|
+
core.quarantineManagedChannel();
|
|
2168
|
+
return;
|
|
2169
|
+
}
|
|
2170
|
+
throw new Error("Channel handshake unavailable");
|
|
2171
|
+
}
|
|
2172
|
+
retained = true;
|
|
2173
|
+
const response = await fetch(new URL("/api/activity/runner-channel", endpoint.baseUrl), { signal,
|
|
2174
|
+
headers: { authorization: `Bearer ${endpoint.token}`, "Last-Event-ID": String(cursor) } });
|
|
2175
|
+
if (!response.ok) {
|
|
2176
|
+
const failure = await response.json().catch(() => null);
|
|
2177
|
+
if (isPermanentPiRunRefusal(response.status, failure?.code)) {
|
|
2178
|
+
core.quarantineManagedChannel();
|
|
2179
|
+
return;
|
|
2180
|
+
}
|
|
2181
|
+
throw new Error("Channel subscription unavailable");
|
|
2182
|
+
}
|
|
2183
|
+
if (!response.body)
|
|
2184
|
+
throw new Error("Channel subscription unavailable");
|
|
2185
|
+
const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
|
|
2186
|
+
let buffer = "";
|
|
2187
|
+
try {
|
|
2188
|
+
for (;;) {
|
|
2189
|
+
const chunk = await reader.read();
|
|
2190
|
+
if (chunk.done)
|
|
2191
|
+
break;
|
|
2192
|
+
buffer += chunk.value.replace(/\r/g, "");
|
|
2193
|
+
let end;
|
|
2194
|
+
while ((end = buffer.indexOf("\n\n")) >= 0) {
|
|
2195
|
+
const bound = runnerFrameBound(buffer);
|
|
2196
|
+
if (end > bound.limit)
|
|
2197
|
+
throw new Error("Channel frame too large");
|
|
2198
|
+
const block = buffer.slice(0, end);
|
|
2199
|
+
buffer = buffer.slice(end + 2);
|
|
2200
|
+
const data = block.split("\n").filter(line => line.startsWith("data: ")).map(line => line.slice(6)).join("\n");
|
|
2201
|
+
if (bound.chars !== undefined && data.length !== bound.chars)
|
|
2202
|
+
throw new Error("Channel frame size mismatch");
|
|
2203
|
+
if (!data)
|
|
2204
|
+
continue;
|
|
2205
|
+
const frame = JSON.parse(data);
|
|
2206
|
+
if (frame.runId !== runId || !Number.isSafeInteger(frame.sequence) || frame.sequence < 1)
|
|
2207
|
+
throw new Error("Invalid channel frame");
|
|
2208
|
+
cursor = Math.max(cursor, frame.sequence);
|
|
2209
|
+
// Do not block reconnection on an ack whose response was lost; the core retains its acceptance promise.
|
|
2210
|
+
void core.acceptRunnerRequest(frame).catch(() => { });
|
|
2211
|
+
}
|
|
2212
|
+
if (buffer.length > runnerFrameBound(buffer).limit)
|
|
2213
|
+
throw new Error("Channel frame too large");
|
|
2214
|
+
}
|
|
2215
|
+
}
|
|
2216
|
+
finally {
|
|
2217
|
+
await reader.cancel().catch(() => { });
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
catch { /* Same live process/map reconnects; native writes never replay here. */ }
|
|
2221
|
+
if (!signal.aborted)
|
|
2222
|
+
await new Promise(resolve => setTimeout(resolve, 250));
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
async function postPiRunnerChannel(endpoint, body, signal, onPermanentRunRefusal) {
|
|
2226
|
+
while (!signal.aborted) {
|
|
2227
|
+
try {
|
|
2228
|
+
const response = await fetch(new URL("/api/activity/runner-channel", endpoint.baseUrl), { method: "POST",
|
|
2229
|
+
signal: AbortSignal.any([signal, AbortSignal.timeout(3000)]), headers: { authorization: `Bearer ${endpoint.token}`, "content-type": "application/json" }, body: JSON.stringify(body) });
|
|
2230
|
+
if (response.ok)
|
|
2231
|
+
return true;
|
|
2232
|
+
const failure = await response.json().catch(() => null);
|
|
2233
|
+
if ([401, 403, 404, 409, 410].includes(response.status) && !["runner_hello_required", "runner_grant_pending", "runner_grant_unverified"].includes(failure?.code ?? "")) {
|
|
2234
|
+
if (isPermanentPiRunRefusal(response.status, failure?.code))
|
|
2235
|
+
onPermanentRunRefusal();
|
|
2236
|
+
return false;
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
catch { /* A lost response retries the saved receipt, never the native operation. */ }
|
|
2240
|
+
if (!signal.aborted)
|
|
2241
|
+
await new Promise(resolve => setTimeout(resolve, 250));
|
|
2242
|
+
}
|
|
2243
|
+
return false;
|
|
2244
|
+
}
|
|
1591
2245
|
export async function main(argv = process.argv.slice(2)) {
|
|
1592
2246
|
let args;
|
|
1593
2247
|
try {
|
|
@@ -1772,7 +2426,11 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1772
2426
|
.catch(() => null)
|
|
1773
2427
|
.finally(() => clearTimeout(timeout));
|
|
1774
2428
|
});
|
|
2429
|
+
const nativePosts = new AbortController(), nativeStream = new AbortController();
|
|
2430
|
+
child.once("exit", () => { nativeStream.abort(); setTimeout(() => nativePosts.abort(), 2000).unref(); });
|
|
2431
|
+
child.once("error", () => { nativeStream.abort(); nativePosts.abort(); });
|
|
1775
2432
|
const io = {
|
|
2433
|
+
...(runtime === "pi" && endpoint && runId ? { postRunner: (body) => postPiRunnerChannel(endpoint, body, nativePosts.signal, () => core.quarantineManagedChannel()) } : {}),
|
|
1776
2434
|
sendRpc: (cmd) => {
|
|
1777
2435
|
try {
|
|
1778
2436
|
child.stdin.write(`${JSON.stringify(cmd)}\n`);
|
|
@@ -1782,6 +2440,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1782
2440
|
mirrorLine: (line) => pane.line(line),
|
|
1783
2441
|
mirrorAppend: (text) => pane.transcript(text),
|
|
1784
2442
|
diagnostic: (text) => pane.diagnostic(text),
|
|
2443
|
+
status: (text) => pane.status(text),
|
|
1785
2444
|
clearStatus: () => pane.clearStatus(),
|
|
1786
2445
|
postActivity: (payload) => {
|
|
1787
2446
|
if (!endpoint || typeof fetch !== "function")
|
|
@@ -1794,7 +2453,10 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1794
2453
|
},
|
|
1795
2454
|
writeSidecar: (state) => {
|
|
1796
2455
|
try {
|
|
1797
|
-
|
|
2456
|
+
if (runtime === "pi")
|
|
2457
|
+
writePiRunnerSidecar(paths.runnerStatePath, state);
|
|
2458
|
+
else
|
|
2459
|
+
fs.writeFileSync(paths.runnerStatePath, JSON.stringify(state));
|
|
1798
2460
|
}
|
|
1799
2461
|
catch { /* best-effort; adapter falls back to pane markers */ }
|
|
1800
2462
|
},
|
|
@@ -1848,7 +2510,9 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1848
2510
|
generation: process.env.OPENRIG_OCCUPANT_GENERATION,
|
|
1849
2511
|
runId: runId,
|
|
1850
2512
|
}, { catchUpSince, runtime, usageFacts: args.usageFacts === true, openRouterCharge: args.openRouterCharge === true, launchCredentialEvidence,
|
|
1851
|
-
requestedSessionFile: args.sessionFile });
|
|
2513
|
+
requestedSessionFile: args.sessionFile, model: args.model, thinking: args.thinking });
|
|
2514
|
+
if (runtime === "pi" && endpoint && runId)
|
|
2515
|
+
void connectPiRunnerChannel(core, endpoint, runId, nativeStream.signal);
|
|
1852
2516
|
let transportUp = runtime !== "omp";
|
|
1853
2517
|
readline.createInterface({ input: child.stdout }).on("line", (line) => {
|
|
1854
2518
|
if (runtime === "omp" && !core.isReady()) {
|