@openrig/cli 0.7.12 → 0.7.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/daemon/assets/plugins/openrig/.claude-plugin/icon.png +0 -0
- package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +2 -2
- package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +4 -2
- package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/plugin.json +2 -2
- package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +2 -2
- package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +5 -3
- package/daemon/assets/plugins/openrig-core/README.md +6 -0
- package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +125 -0
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +24 -1
- package/daemon/assets/skills/rigs/SKILL.md +7 -3
- 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 +28 -7
- package/daemon/context-packs/reference/getting-started.md +25 -13
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +14 -0
- package/daemon/context-packs/reference/tmux-servers.md +4 -1
- package/daemon/context-packs/reference/whats-new.md +164 -179
- package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
- package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
- package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
- package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/watchdog/SKILL.md +5 -0
- package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
- package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
- package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/seat-continuity-and-handover/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/pi-runner.d.ts +49 -1
- package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.js +343 -28
- package/daemon/dist/adapters/pi-runner.js.map +1 -1
- package/daemon/dist/adapters/tmux-server.d.ts +9 -1
- package/daemon/dist/adapters/tmux-server.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux-server.js +36 -4
- package/daemon/dist/adapters/tmux-server.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/connection-contract-surface.d.ts +2 -0
- package/daemon/dist/connection-contract-surface.d.ts.map +1 -0
- package/daemon/dist/connection-contract-surface.js +4 -0
- package/daemon/dist/connection-contract-surface.js.map +1 -0
- package/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +6 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/160_network_bindings.d.ts +7 -0
- package/daemon/dist/db/migrations/160_network_bindings.d.ts.map +1 -0
- package/daemon/dist/db/migrations/160_network_bindings.js +26 -0
- package/daemon/dist/db/migrations/160_network_bindings.js.map +1 -0
- package/daemon/dist/db/migrations/161_network_receipts.d.ts +8 -0
- package/daemon/dist/db/migrations/161_network_receipts.d.ts.map +1 -0
- package/daemon/dist/db/migrations/161_network_receipts.js +25 -0
- package/daemon/dist/db/migrations/161_network_receipts.js.map +1 -0
- package/daemon/dist/db/migrations/162_session_address_read_indexes.d.ts +5 -0
- package/daemon/dist/db/migrations/162_session_address_read_indexes.d.ts.map +1 -0
- package/daemon/dist/db/migrations/162_session_address_read_indexes.js +12 -0
- package/daemon/dist/db/migrations/162_session_address_read_indexes.js.map +1 -0
- package/daemon/dist/domain/agent-activity-store.d.ts +8 -0
- package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
- package/daemon/dist/domain/agent-activity-store.js +14 -0
- package/daemon/dist/domain/agent-activity-store.js.map +1 -1
- package/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/bootstrap-orchestrator.js +5 -0
- package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
- package/daemon/dist/domain/connection-contract.d.ts +111 -0
- package/daemon/dist/domain/connection-contract.d.ts.map +1 -0
- package/daemon/dist/domain/connection-contract.js +113 -0
- package/daemon/dist/domain/connection-contract.js.map +1 -0
- package/daemon/dist/domain/execution-view.js +2 -2
- package/daemon/dist/domain/execution-view.js.map +1 -1
- package/daemon/dist/domain/install-engine.d.ts +5 -0
- package/daemon/dist/domain/install-engine.d.ts.map +1 -1
- package/daemon/dist/domain/install-engine.js +28 -26
- package/daemon/dist/domain/install-engine.js.map +1 -1
- package/daemon/dist/domain/install-verifier.d.ts +5 -1
- package/daemon/dist/domain/install-verifier.d.ts.map +1 -1
- package/daemon/dist/domain/install-verifier.js +12 -1
- package/daemon/dist/domain/install-verifier.js.map +1 -1
- package/daemon/dist/domain/managed-block-records.d.ts +9 -3
- package/daemon/dist/domain/managed-block-records.d.ts.map +1 -1
- package/daemon/dist/domain/managed-block-records.js +43 -8
- package/daemon/dist/domain/managed-block-records.js.map +1 -1
- package/daemon/dist/domain/managed-blocks.d.ts +40 -3
- package/daemon/dist/domain/managed-blocks.d.ts.map +1 -1
- package/daemon/dist/domain/managed-blocks.js +151 -39
- package/daemon/dist/domain/managed-blocks.js.map +1 -1
- 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 +3 -2
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
- package/daemon/dist/domain/network/hub-client.d.ts +40 -0
- package/daemon/dist/domain/network/hub-client.d.ts.map +1 -0
- package/daemon/dist/domain/network/hub-client.js +102 -0
- package/daemon/dist/domain/network/hub-client.js.map +1 -0
- package/daemon/dist/domain/network/network-bindings.d.ts +74 -0
- package/daemon/dist/domain/network/network-bindings.d.ts.map +1 -0
- package/daemon/dist/domain/network/network-bindings.js +235 -0
- package/daemon/dist/domain/network/network-bindings.js.map +1 -0
- package/daemon/dist/domain/network/network-connector.d.ts +77 -0
- package/daemon/dist/domain/network/network-connector.d.ts.map +1 -0
- package/daemon/dist/domain/network/network-connector.js +380 -0
- package/daemon/dist/domain/network/network-connector.js.map +1 -0
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +6 -5
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/package-install-service.d.ts +1 -0
- package/daemon/dist/domain/package-install-service.d.ts.map +1 -1
- package/daemon/dist/domain/package-install-service.js +2 -1
- package/daemon/dist/domain/package-install-service.js.map +1 -1
- package/daemon/dist/domain/plugin-vendor-service.d.ts +9 -0
- package/daemon/dist/domain/plugin-vendor-service.d.ts.map +1 -1
- package/daemon/dist/domain/plugin-vendor-service.js +50 -8
- package/daemon/dist/domain/plugin-vendor-service.js.map +1 -1
- package/daemon/dist/domain/proof/judgments.d.ts +12 -13
- package/daemon/dist/domain/proof/judgments.d.ts.map +1 -1
- package/daemon/dist/domain/proof/judgments.js +14 -0
- package/daemon/dist/domain/proof/judgments.js.map +1 -1
- package/daemon/dist/domain/proof/source-watch.d.ts +1 -1
- package/daemon/dist/domain/proof/source-watch.d.ts.map +1 -1
- package/daemon/dist/domain/proof/source-watch.js +45 -22
- package/daemon/dist/domain/proof/source-watch.js.map +1 -1
- package/daemon/dist/domain/provider/claude-usage-reader.d.ts +3 -3
- package/daemon/dist/domain/provider/claude-usage-reader.d.ts.map +1 -1
- package/daemon/dist/domain/provider/claude-usage-reader.js +16 -5
- package/daemon/dist/domain/provider/claude-usage-reader.js.map +1 -1
- package/daemon/dist/domain/provider/codex-limit-banner.d.ts.map +1 -1
- package/daemon/dist/domain/provider/codex-limit-banner.js +2 -1
- package/daemon/dist/domain/provider/codex-limit-banner.js.map +1 -1
- package/daemon/dist/domain/provider/provider-signals.d.ts +6 -0
- package/daemon/dist/domain/provider/provider-signals.d.ts.map +1 -1
- package/daemon/dist/domain/provider/provider-signals.js +9 -3
- package/daemon/dist/domain/provider/provider-signals.js.map +1 -1
- package/daemon/dist/domain/provider/reactive-tap.d.ts.map +1 -1
- package/daemon/dist/domain/provider/reactive-tap.js +6 -0
- package/daemon/dist/domain/provider/reactive-tap.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +16 -1
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +55 -2
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +75 -20
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +45 -27
- package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.d.ts +3 -0
- package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.js +6 -0
- package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
- package/daemon/dist/domain/receiver-context.d.ts +9 -0
- package/daemon/dist/domain/receiver-context.d.ts.map +1 -0
- package/daemon/dist/domain/receiver-context.js +24 -0
- package/daemon/dist/domain/receiver-context.js.map +1 -0
- package/daemon/dist/domain/reconciler.d.ts +15 -6
- package/daemon/dist/domain/reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/reconciler.js +26 -26
- package/daemon/dist/domain/reconciler.js.map +1 -1
- package/daemon/dist/domain/restore-guidance.d.ts +6 -4
- package/daemon/dist/domain/restore-guidance.d.ts.map +1 -1
- package/daemon/dist/domain/restore-guidance.js +38 -27
- package/daemon/dist/domain/restore-guidance.js.map +1 -1
- package/daemon/dist/domain/rosters.d.ts +11 -0
- package/daemon/dist/domain/rosters.d.ts.map +1 -1
- package/daemon/dist/domain/rosters.js +24 -1
- package/daemon/dist/domain/rosters.js.map +1 -1
- package/daemon/dist/domain/runner-permissions.d.ts.map +1 -1
- package/daemon/dist/domain/runner-permissions.js +9 -2
- package/daemon/dist/domain/runner-permissions.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts +9 -1
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +55 -7
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.d.ts +4 -0
- package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.js +18 -2
- package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +13 -8
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +46 -26
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-structural-activity-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-structural-activity-service.js +7 -4
- package/daemon/dist/domain/seat-structural-activity-service.js.map +1 -1
- package/daemon/dist/domain/session-registry.d.ts.map +1 -1
- package/daemon/dist/domain/session-registry.js +16 -5
- package/daemon/dist/domain/session-registry.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +2 -0
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +7 -4
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/slices/slice-indexer.d.ts +5 -2
- package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -1
- package/daemon/dist/domain/slices/slice-indexer.js +60 -16
- package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
- package/daemon/dist/domain/slow-op-recorder.d.ts +0 -3
- package/daemon/dist/domain/slow-op-recorder.d.ts.map +1 -1
- package/daemon/dist/domain/slow-op-recorder.js +5 -34
- package/daemon/dist/domain/slow-op-recorder.js.map +1 -1
- package/daemon/dist/domain/spec-library-workflow-scanner.d.ts +2 -0
- package/daemon/dist/domain/spec-library-workflow-scanner.d.ts.map +1 -1
- package/daemon/dist/domain/spec-library-workflow-scanner.js +22 -13
- package/daemon/dist/domain/spec-library-workflow-scanner.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts +5 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +11 -6
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/tmux-option-defaults.d.ts +4 -4
- package/daemon/dist/domain/tmux-option-defaults.d.ts.map +1 -1
- package/daemon/dist/domain/tmux-option-defaults.js +25 -12
- package/daemon/dist/domain/tmux-option-defaults.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +3 -0
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/watchdog-delivery-receipts.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-delivery-receipts.js +8 -3
- package/daemon/dist/domain/watchdog-delivery-receipts.js.map +1 -1
- package/daemon/dist/domain/workflow-spec-cache.d.ts +8 -0
- package/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-spec-cache.js +34 -10
- package/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +2 -0
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/routes/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +12 -0
- package/daemon/dist/routes/activity.js.map +1 -1
- package/daemon/dist/routes/hosts.d.ts.map +1 -1
- package/daemon/dist/routes/hosts.js +8 -33
- package/daemon/dist/routes/hosts.js.map +1 -1
- package/daemon/dist/routes/network.d.ts +9 -0
- package/daemon/dist/routes/network.d.ts.map +1 -0
- package/daemon/dist/routes/network.js +58 -0
- package/daemon/dist/routes/network.js.map +1 -0
- package/daemon/dist/routes/packages.js +3 -1
- package/daemon/dist/routes/packages.js.map +1 -1
- package/daemon/dist/routes/proof.d.ts.map +1 -1
- package/daemon/dist/routes/proof.js +6 -4
- package/daemon/dist/routes/proof.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +4 -0
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/slices.d.ts +1 -0
- package/daemon/dist/routes/slices.d.ts.map +1 -1
- package/daemon/dist/routes/slices.js +66 -16
- package/daemon/dist/routes/slices.js.map +1 -1
- package/daemon/dist/routes/spec-library.d.ts.map +1 -1
- package/daemon/dist/routes/spec-library.js +7 -3
- package/daemon/dist/routes/spec-library.js.map +1 -1
- package/daemon/dist/server.d.ts +2 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +5 -0
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +16 -26
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/agent-startup-guide.md +21 -13
- package/daemon/docs/reference/claude-status-line.md +25 -9
- package/daemon/docs/reference/getting-started.md +25 -13
- package/daemon/docs/reference/herdr-app.md +3 -2
- package/daemon/docs/reference/hosted-members.md +32 -2
- package/daemon/docs/reference/keeping-a-watch.md +28 -0
- package/daemon/docs/reference/network-connector.md +114 -0
- package/daemon/docs/reference/quickstart.md +4 -4
- package/daemon/docs/reference/rig-spec.md +14 -0
- package/daemon/docs/reference/rosters.md +5 -0
- package/daemon/docs/reference/tmux-servers.md +4 -1
- package/daemon/docs/reference/whats-new.md +164 -179
- package/daemon/specs/agents/shared/skills/core/watchdog/SKILL.md +5 -0
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +42 -16
- package/dist/build-info.js +3 -3
- package/dist/commands/daemon.d.ts +8 -2
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +46 -4
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/host.d.ts +4 -10
- package/dist/commands/host.d.ts.map +1 -1
- package/dist/commands/host.js +7 -34
- package/dist/commands/host.js.map +1 -1
- package/dist/commands/network.d.ts +12 -0
- package/dist/commands/network.d.ts.map +1 -0
- package/dist/commands/network.js +95 -0
- package/dist/commands/network.js.map +1 -0
- package/dist/commands/package.d.ts.map +1 -1
- package/dist/commands/package.js +5 -0
- package/dist/commands/package.js.map +1 -1
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +7 -0
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/roster.d.ts +17 -0
- package/dist/commands/roster.d.ts.map +1 -1
- package/dist/commands/roster.js +47 -2
- package/dist/commands/roster.js.map +1 -1
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +4 -3
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/watchdog.d.ts.map +1 -1
- package/dist/commands/watchdog.js +22 -2
- package/dist/commands/watchdog.js.map +1 -1
- package/dist/cross-host-executor.d.ts.map +1 -1
- package/dist/cross-host-executor.js +6 -1
- package/dist/cross-host-executor.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts +11 -0
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +61 -9
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/daemon-reachability.js +1 -1
- package/dist/daemon-reachability.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lazy-program.d.ts.map +1 -1
- package/dist/lazy-program.js +1 -0
- package/dist/lazy-program.js.map +1 -1
- package/package.json +1 -1
- package/tui/dist/attention/attention-model.d.ts.map +1 -1
- package/tui/dist/attention/attention-model.js +10 -5
- package/tui/dist/attention/attention-model.js.map +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +8 -4
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/navigator.js +1 -1
- package/tui/dist/navigator.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +44 -29
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/state.js +2 -2
- package/tui/dist/state.js.map +1 -1
- package/tui/dist/stylize.d.ts.map +1 -1
- package/tui/dist/stylize.js +4 -0
- package/tui/dist/stylize.js.map +1 -1
- package/tui/dist/topology/host-label.d.ts +2 -0
- package/tui/dist/topology/host-label.d.ts.map +1 -1
- package/tui/dist/topology/host-label.js +7 -1
- package/tui/dist/topology/host-label.js.map +1 -1
- package/tui/dist/types.d.ts +2 -1
- package/tui/dist/types.d.ts.map +1 -1
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
import fs from "node:fs";
|
|
21
21
|
import nodePath from "node:path";
|
|
22
22
|
import readline from "node:readline";
|
|
23
|
-
import { PassThrough } from "node:stream";
|
|
23
|
+
import { PassThrough, Writable } from "node:stream";
|
|
24
|
+
import stringWidth from "string-width";
|
|
24
25
|
import { StringDecoder } from "node:string_decoder";
|
|
25
26
|
import { execFileSync, spawn, spawnSync } from "node:child_process";
|
|
26
27
|
import { pathToFileURL } from "node:url";
|
|
@@ -66,8 +67,274 @@ export function preparePiAccount(agentDir, accountHome) {
|
|
|
66
67
|
// Canonical TTY buffers can overflow before Node sees even the paste terminator.
|
|
67
68
|
// Use Node's line editor in raw mode, with only paste framing handled here.
|
|
68
69
|
export const MAX_PI_INPUT_BYTES = 1024 * 1024;
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
const SEGMENTER = (() => {
|
|
71
|
+
try {
|
|
72
|
+
return new Intl.Segmenter(undefined, { granularity: "grapheme" });
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
})();
|
|
78
|
+
/** Grapheme clusters: what a terminal lays out. A ZWJ family emoji is one cluster
|
|
79
|
+
* taking two cells where its code points would sum to six; a combining mark adds none. */
|
|
80
|
+
export function* graphemesOf(text) {
|
|
81
|
+
if (SEGMENTER) {
|
|
82
|
+
for (const part of SEGMENTER.segment(text))
|
|
83
|
+
yield part.segment;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
for (const character of text)
|
|
87
|
+
yield character;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const TAB_WIDTH = 8;
|
|
91
|
+
export function composeLayout(text, width, caret = text.length) {
|
|
92
|
+
if (!text)
|
|
93
|
+
return { rows: 0, caretRow: 0, caretColumn: 0 };
|
|
94
|
+
if (width <= 0)
|
|
95
|
+
return { rows: text.split("\n").length, caretRow: 0, caretColumn: 0 };
|
|
96
|
+
let row = 0;
|
|
97
|
+
let column = 0;
|
|
98
|
+
let caretRow = 0;
|
|
99
|
+
let caretColumn = 0;
|
|
100
|
+
let index = 0;
|
|
101
|
+
const place = () => { caretRow = row; caretColumn = column; };
|
|
102
|
+
for (const segment of graphemesOf(text)) {
|
|
103
|
+
if (index === caret)
|
|
104
|
+
place();
|
|
105
|
+
if (segment === "\n") {
|
|
106
|
+
row += 1;
|
|
107
|
+
column = 0;
|
|
108
|
+
}
|
|
109
|
+
else if (segment === "\t") {
|
|
110
|
+
// A tab advances to the next ordinary tab stop, clamped to the last column.
|
|
111
|
+
column = Math.min((Math.floor(column / TAB_WIDTH) + 1) * TAB_WIDTH, width - 1);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
const cells = Math.max(0, stringWidth(segment));
|
|
115
|
+
if (column + cells > width) {
|
|
116
|
+
row += 1;
|
|
117
|
+
column = 0;
|
|
118
|
+
}
|
|
119
|
+
column += cells;
|
|
120
|
+
}
|
|
121
|
+
index += segment.length;
|
|
122
|
+
}
|
|
123
|
+
if (index === caret)
|
|
124
|
+
place();
|
|
125
|
+
return { rows: row + 1, caretRow, caretColumn };
|
|
126
|
+
}
|
|
127
|
+
export function createPaneCompositor(out) {
|
|
128
|
+
let status = null;
|
|
129
|
+
/** The status text actually on screen: clipped when it was painted. A resize must
|
|
130
|
+
* size the region from this, not from the longer text it was pinned with. */
|
|
131
|
+
let paintedStatus = null;
|
|
132
|
+
let readInput = null;
|
|
133
|
+
let redrawLine = null;
|
|
134
|
+
let held = "";
|
|
135
|
+
let openLine = false;
|
|
136
|
+
let screenRows = 0;
|
|
137
|
+
let readCaretUp = null;
|
|
138
|
+
let readCaretIndex = null;
|
|
139
|
+
const widthKnown = () => typeof out.columns === "number" && out.columns > 0;
|
|
140
|
+
const composeText = () => (readInput && redrawLine ? readInput() : "");
|
|
141
|
+
const composeRows = () => {
|
|
142
|
+
const text = composeText();
|
|
143
|
+
return text && widthKnown() ? composeLayout(text, out.columns).rows : 0;
|
|
144
|
+
};
|
|
145
|
+
const clip = (text) => {
|
|
146
|
+
const flat = text.replace(/[\r\n\t]+/g, " ").trimEnd();
|
|
147
|
+
if (!widthKnown() || stringWidth(flat) < out.columns)
|
|
148
|
+
return flat;
|
|
149
|
+
let used = 0;
|
|
150
|
+
let clipped = "";
|
|
151
|
+
for (const segment of graphemesOf(flat)) {
|
|
152
|
+
const cells = Math.max(0, stringWidth(segment));
|
|
153
|
+
if (used + cells > out.columns - 1)
|
|
154
|
+
break;
|
|
155
|
+
clipped += segment;
|
|
156
|
+
used += cells;
|
|
157
|
+
}
|
|
158
|
+
return `${clipped}\u2026`;
|
|
159
|
+
};
|
|
160
|
+
const eraseLines = (lines) => {
|
|
161
|
+
let sequence = "";
|
|
162
|
+
for (let index = 0; index < lines; index += 1)
|
|
163
|
+
sequence += index === 0 ? "\r\u001b[2K" : "\u001b[1A\r\u001b[2K";
|
|
164
|
+
if (sequence)
|
|
165
|
+
out.write(sequence);
|
|
166
|
+
};
|
|
167
|
+
/** Rows this compositor has on screen, recorded when it painted them. Readline never writes
|
|
168
|
+
* to the terminal, so nothing else can change these rows behind the compositor's back —
|
|
169
|
+
* except a reflow, which the resize handler owns. */
|
|
170
|
+
const paint = () => {
|
|
171
|
+
paintedStatus = status !== null ? clip(status) : null;
|
|
172
|
+
if (paintedStatus !== null) {
|
|
173
|
+
out.write(paintedStatus);
|
|
174
|
+
out.write("\n");
|
|
175
|
+
}
|
|
176
|
+
const rows = composeRows();
|
|
177
|
+
if (rows)
|
|
178
|
+
redrawLine?.();
|
|
179
|
+
screenRows = (status !== null ? 1 : 0) + (rows || (status !== null ? 1 : 0));
|
|
180
|
+
// Only a painted region closes an open transcript line. With nothing painted the
|
|
181
|
+
// cursor still sits on the line a flush left open, and the next keystroke belongs
|
|
182
|
+
// to that line's context, not to a fresh one.
|
|
183
|
+
if (screenRows > 0)
|
|
184
|
+
openLine = false;
|
|
185
|
+
};
|
|
186
|
+
const eraseScreen = () => {
|
|
187
|
+
// Nothing painted: there is no region to erase, and stepping down from a stale
|
|
188
|
+
// caret count would move the cursor off the transcript line it is still on.
|
|
189
|
+
if (screenRows === 0)
|
|
190
|
+
return;
|
|
191
|
+
const down = readCaretUp ? readCaretUp() : 0;
|
|
192
|
+
if (down > 0)
|
|
193
|
+
out.write(`\u001b[${down}B`);
|
|
194
|
+
eraseLines(screenRows);
|
|
195
|
+
screenRows = 0;
|
|
196
|
+
};
|
|
197
|
+
const flushHeld = () => {
|
|
198
|
+
if (!held)
|
|
199
|
+
return;
|
|
200
|
+
out.write(held.endsWith("\n") ? held : `${held}\n`);
|
|
201
|
+
held = "";
|
|
202
|
+
openLine = false;
|
|
203
|
+
};
|
|
204
|
+
const writeVerbatim = (text) => {
|
|
205
|
+
out.write(text);
|
|
206
|
+
openLine = !text.endsWith("\n");
|
|
207
|
+
};
|
|
208
|
+
const writeAbove = (text) => {
|
|
209
|
+
eraseScreen();
|
|
210
|
+
out.write(text.endsWith("\n") ? text : `${text}\n`);
|
|
211
|
+
paint();
|
|
212
|
+
};
|
|
213
|
+
// A tile attaching or detaching reflows the pane, and the terminal keeps the cursor on
|
|
214
|
+
// its character. So the old paint now occupies exactly what the new width says it does:
|
|
215
|
+
// the pinned status wraps to ceil(cells/columns) rows, the draft to its layout rows.
|
|
216
|
+
// Move down to the region's last row — past the lines below the caret — erase exactly
|
|
217
|
+
// that many rows, and repaint at the new width. No max(): under-erasing leaves a stale
|
|
218
|
+
// copy of a wrapped status, over-erasing drops a transcript line off the screen.
|
|
219
|
+
const onResize = () => {
|
|
220
|
+
if (!widthKnown()) {
|
|
221
|
+
screenRows = 0;
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
const draft = composeText();
|
|
225
|
+
const layout = draft ? composeLayout(draft, out.columns, readCaretIndex ? readCaretIndex() : draft.length) : null;
|
|
226
|
+
const draftRows = layout ? layout.rows : 0;
|
|
227
|
+
const statusLines = paintedStatus !== null ? Math.max(1, Math.ceil(stringWidth(paintedStatus) / out.columns)) : 0;
|
|
228
|
+
const down = layout ? layout.rows - 1 - layout.caretRow : 0;
|
|
229
|
+
if (down > 0)
|
|
230
|
+
out.write(`\u001b[${down}B`);
|
|
231
|
+
// A pinned status without a draft also owns the blank row its trailing newline
|
|
232
|
+
// left the cursor on — the same row paint() counts into screenRows.
|
|
233
|
+
eraseLines(statusLines + (draftRows || (status !== null ? 1 : 0)));
|
|
234
|
+
screenRows = 0;
|
|
235
|
+
paint();
|
|
236
|
+
};
|
|
237
|
+
out.on("resize", onResize);
|
|
238
|
+
const pane = {
|
|
239
|
+
attach(read, redraw, caretUp, readCursor) {
|
|
240
|
+
readInput = read;
|
|
241
|
+
redrawLine = redraw;
|
|
242
|
+
readCaretUp = caretUp ?? null;
|
|
243
|
+
readCaretIndex = readCursor ?? null;
|
|
244
|
+
},
|
|
245
|
+
detach() {
|
|
246
|
+
eraseScreen();
|
|
247
|
+
flushHeld();
|
|
248
|
+
readInput = null;
|
|
249
|
+
redrawLine = null;
|
|
250
|
+
readCaretUp = null;
|
|
251
|
+
readCaretIndex = null;
|
|
252
|
+
openLine = false;
|
|
253
|
+
screenRows = 0;
|
|
254
|
+
},
|
|
255
|
+
refresh() {
|
|
256
|
+
eraseScreen();
|
|
257
|
+
// With no region left, an unfinished streamed line goes out verbatim so the
|
|
258
|
+
// next delta continues it on the same row instead of splitting mid-word.
|
|
259
|
+
if (held && status === null && !composeText()) {
|
|
260
|
+
writeVerbatim(held);
|
|
261
|
+
held = "";
|
|
262
|
+
}
|
|
263
|
+
paint();
|
|
264
|
+
},
|
|
265
|
+
transcript(text) {
|
|
266
|
+
if (!text)
|
|
267
|
+
return;
|
|
268
|
+
if (status === null && composeRows() === 0 && screenRows === 0) {
|
|
269
|
+
if (held) {
|
|
270
|
+
writeVerbatim(held);
|
|
271
|
+
held = "";
|
|
272
|
+
}
|
|
273
|
+
writeVerbatim(text);
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
held += text;
|
|
277
|
+
let newline = held.indexOf("\n");
|
|
278
|
+
while (newline >= 0) {
|
|
279
|
+
const line = held.slice(0, newline + 1);
|
|
280
|
+
held = held.slice(newline + 1);
|
|
281
|
+
writeAbove(line);
|
|
282
|
+
newline = held.indexOf("\n");
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
line(text) {
|
|
286
|
+
pane.transcript(`${text}\n`);
|
|
287
|
+
},
|
|
288
|
+
beforeInput() {
|
|
289
|
+
if (!openLine)
|
|
290
|
+
return;
|
|
291
|
+
out.write("\n");
|
|
292
|
+
openLine = false;
|
|
293
|
+
},
|
|
294
|
+
diagnostic(text) {
|
|
295
|
+
// Without a known width there is no region to pin into. Callers already wrote
|
|
296
|
+
// the transcript copy; printing here would duplicate it.
|
|
297
|
+
if (!widthKnown())
|
|
298
|
+
return;
|
|
299
|
+
if (openLine) {
|
|
300
|
+
out.write("\n");
|
|
301
|
+
openLine = false;
|
|
302
|
+
}
|
|
303
|
+
eraseScreen();
|
|
304
|
+
status = clip(text);
|
|
305
|
+
paint();
|
|
306
|
+
},
|
|
307
|
+
clearStatus() {
|
|
308
|
+
if (status === null)
|
|
309
|
+
return;
|
|
310
|
+
eraseScreen();
|
|
311
|
+
status = null;
|
|
312
|
+
paint();
|
|
313
|
+
},
|
|
314
|
+
beforeSubmit() {
|
|
315
|
+
eraseScreen();
|
|
316
|
+
openLine = false;
|
|
317
|
+
flushHeld();
|
|
318
|
+
},
|
|
319
|
+
repaint() {
|
|
320
|
+
paint();
|
|
321
|
+
},
|
|
322
|
+
};
|
|
323
|
+
return pane;
|
|
324
|
+
}
|
|
325
|
+
export function createRunnerInput(input, output, onSubmit, pane) {
|
|
326
|
+
const say = (text) => {
|
|
327
|
+
if (pane) {
|
|
328
|
+
pane.line(text);
|
|
329
|
+
pane.diagnostic(text);
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
output.write(`${text}\n`);
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
const reject = () => {
|
|
336
|
+
say("[pi-runner] input rejected: maximum 1048576 UTF-8 bytes; send a smaller message. Ctrl-C clears unfinished input.");
|
|
337
|
+
};
|
|
71
338
|
const submit = (block) => {
|
|
72
339
|
if (Buffer.byteLength(block) > MAX_PI_INPUT_BYTES)
|
|
73
340
|
reject();
|
|
@@ -84,8 +351,33 @@ export function createRunnerInput(input, output, onSubmit) {
|
|
|
84
351
|
|| (major === 25 && (minor === 0 || (minor === 1 && patch === 0)));
|
|
85
352
|
const keys = new PassThrough();
|
|
86
353
|
const editorInput = batchText ? new PassThrough() : keys;
|
|
354
|
+
// Readline edits against a discard sink: it must never draw on the terminal, because
|
|
355
|
+
// _refreshLine does moveCursor(0, -prevRows) + clearScreenDown(), which erases whatever the
|
|
356
|
+
// compositor put above the draft. The compositor owns every terminal byte instead.
|
|
357
|
+
const sink = new Writable({ write(_chunk, _encoding, callback) { callback(); } });
|
|
358
|
+
// Readline wraps its edit against output.columns; carry the terminal's geometry onto the sink.
|
|
359
|
+
Object.assign(sink, { columns: output.columns, rows: output.rows });
|
|
360
|
+
let caretUp = 0;
|
|
361
|
+
const renderCompose = () => {
|
|
362
|
+
const text = `${editor.line ?? ""}`;
|
|
363
|
+
if (!text)
|
|
364
|
+
return;
|
|
365
|
+
const width = typeof output.columns === "number" && output.columns > 0 ? output.columns : 0;
|
|
366
|
+
output.write(text);
|
|
367
|
+
if (!width)
|
|
368
|
+
return;
|
|
369
|
+
const cursor = Math.max(0, Math.min(Number(editor.cursor) || 0, text.length));
|
|
370
|
+
const layout = composeLayout(text, width, cursor);
|
|
371
|
+
caretUp = layout.rows - 1 - layout.caretRow;
|
|
372
|
+
if (caretUp > 0)
|
|
373
|
+
output.write(`\u001b[${caretUp}A`);
|
|
374
|
+
output.write("\r");
|
|
375
|
+
if (layout.caretColumn > 0)
|
|
376
|
+
output.write(`\u001b[${layout.caretColumn}C`);
|
|
377
|
+
};
|
|
378
|
+
pane?.attach(() => `${editor.line ?? ""}`, renderCompose, () => caretUp, () => Math.max(0, Math.min(Number(editor.cursor) || 0, `${editor.line ?? ""}`.length)));
|
|
87
379
|
const editor = readline.createInterface({
|
|
88
|
-
input: editorInput, output, terminal: true, prompt: "", historySize: 0, crlfDelay: Infinity,
|
|
380
|
+
input: editorInput, output: sink, terminal: true, prompt: "", historySize: 0, crlfDelay: Infinity,
|
|
89
381
|
});
|
|
90
382
|
// Node forces dumb-terminal mode without editing if TERM=dumb. When terminal: true
|
|
91
383
|
// was requested, remove the dumb-mode override so VT100 line editing is preserved.
|
|
@@ -101,7 +393,7 @@ export function createRunnerInput(input, output, onSubmit) {
|
|
|
101
393
|
// Node documents changing rl.line together with rl.cursor. The installed
|
|
102
394
|
// typings mark them readonly, so assign this pair through one explicit seam.
|
|
103
395
|
Object.assign(editor, { line, cursor });
|
|
104
|
-
|
|
396
|
+
pane?.refresh();
|
|
105
397
|
};
|
|
106
398
|
const clear = () => setLine("", 0);
|
|
107
399
|
// Node 22.21–22.22.0 (also some 24/25 releases) appends batched text after
|
|
@@ -129,6 +421,7 @@ export function createRunnerInput(input, output, onSubmit) {
|
|
|
129
421
|
}
|
|
130
422
|
const consume = (text) => {
|
|
131
423
|
if (paste === null) {
|
|
424
|
+
pane?.beforeInput();
|
|
132
425
|
keys.write(text);
|
|
133
426
|
if (batchText)
|
|
134
427
|
flushTyped();
|
|
@@ -167,7 +460,7 @@ export function createRunnerInput(input, output, onSubmit) {
|
|
|
167
460
|
paste = null;
|
|
168
461
|
discarded = false;
|
|
169
462
|
clear();
|
|
170
|
-
|
|
463
|
+
say("[pi-runner] input cleared");
|
|
171
464
|
onSubmit("/abort");
|
|
172
465
|
}
|
|
173
466
|
else if (paste === null) {
|
|
@@ -191,6 +484,7 @@ export function createRunnerInput(input, output, onSubmit) {
|
|
|
191
484
|
paste = null;
|
|
192
485
|
}
|
|
193
486
|
}
|
|
487
|
+
pane?.refresh();
|
|
194
488
|
};
|
|
195
489
|
const wasRaw = input.isRaw;
|
|
196
490
|
const end = () => editor.close();
|
|
@@ -198,7 +492,10 @@ export function createRunnerInput(input, output, onSubmit) {
|
|
|
198
492
|
output.write("\u001b[?2004h");
|
|
199
493
|
input.on("data", receive);
|
|
200
494
|
input.once("end", end);
|
|
201
|
-
editor.on("line",
|
|
495
|
+
editor.on("line", (line) => {
|
|
496
|
+
pane?.beforeSubmit();
|
|
497
|
+
submit(line);
|
|
498
|
+
});
|
|
202
499
|
editor.once("close", () => {
|
|
203
500
|
input.removeListener("data", receive);
|
|
204
501
|
input.removeListener("end", end);
|
|
@@ -206,6 +503,7 @@ export function createRunnerInput(input, output, onSubmit) {
|
|
|
206
503
|
input.pause();
|
|
207
504
|
keys.removeListener("keypress", keypress);
|
|
208
505
|
keys.destroy();
|
|
506
|
+
pane?.detach();
|
|
209
507
|
if (editorInput !== keys)
|
|
210
508
|
editorInput.destroy();
|
|
211
509
|
output.write("\u001b[?2004l");
|
|
@@ -547,14 +845,14 @@ export class RunnerCore {
|
|
|
547
845
|
/** A frame that can't be reassembled is lost, and said so. If it was a get_entries reply, the cursor stays where it was. */
|
|
548
846
|
reportDroppedFrame(reason) {
|
|
549
847
|
if (reason)
|
|
550
|
-
this.
|
|
848
|
+
this.diag(`[omp-runner] ERROR rpc frame: ${reason}; the chunked frame was dropped`);
|
|
551
849
|
}
|
|
552
850
|
get runtime() { return this.opts.runtime ?? "pi"; }
|
|
553
851
|
/** One aggregated paste block from pane stdin. */
|
|
554
852
|
handleUserBlock(block) {
|
|
555
853
|
if (block === "/abort") {
|
|
556
854
|
this.io.sendRpc({ type: "abort" });
|
|
557
|
-
this.
|
|
855
|
+
this.diag("[pi-runner] abort sent");
|
|
558
856
|
return;
|
|
559
857
|
}
|
|
560
858
|
if (block.startsWith("/followup ")) {
|
|
@@ -598,7 +896,7 @@ export class RunnerCore {
|
|
|
598
896
|
else {
|
|
599
897
|
// Advertised but refused: v1 as before, so a reply over 1 MiB still fails, visibly.
|
|
600
898
|
const detail = typeof record.error === "string" ? record.error : "refused";
|
|
601
|
-
this.
|
|
899
|
+
this.diag(`[omp-runner] RPC protocol v2 not negotiated (${detail}); replies over 1 MiB will fail`);
|
|
602
900
|
}
|
|
603
901
|
return;
|
|
604
902
|
}
|
|
@@ -608,7 +906,7 @@ export class RunnerCore {
|
|
|
608
906
|
if (record.id === GET_STATE_ID) {
|
|
609
907
|
this.ready = false;
|
|
610
908
|
this.writeSidecar({});
|
|
611
|
-
this.
|
|
909
|
+
this.diag(this.runtime === "omp" ? `[omp-runner] ERROR rpc get_state: ${message}` : `${PI_RUNNER_ERROR_MARKER} rpc: ${message}`);
|
|
612
910
|
// OMP cannot provide a resume token without get_state; stop it so the
|
|
613
911
|
// launch fails now instead of waiting out readiness.
|
|
614
912
|
if (this.runtime === "omp")
|
|
@@ -618,11 +916,11 @@ export class RunnerCore {
|
|
|
618
916
|
if (record.id === CATCH_UP_ID && this.runtime === "pi") {
|
|
619
917
|
// A refused catch-up (a saved cursor this session's history doesn't hold, such as an older runner's UI-event
|
|
620
918
|
// id) is history sync, not the seat's resume: say so, and take a confirmed cursor from the history's tail.
|
|
621
|
-
this.
|
|
919
|
+
this.diag(`[pi-runner] History catch-up didn't run (${message}). That's history sync, separate from the seat's resume; reading the history cursor again.`);
|
|
622
920
|
this.io.sendRpc({ type: "get_entries", id: CURSOR_REFRESH_ID });
|
|
623
921
|
return;
|
|
624
922
|
}
|
|
625
|
-
this.
|
|
923
|
+
this.diag(`[${this.runtime}-runner] ERROR rpc: ${message}`);
|
|
626
924
|
// Only a rejected input means the seat cannot do the requested work.
|
|
627
925
|
// A mistimed /abort (or any control command) leaves the seat idle.
|
|
628
926
|
if (this.runtime === "omp" && typeof record.command === "string" && Object.hasOwn(INPUT_COMMANDS, record.command)) {
|
|
@@ -640,13 +938,13 @@ export class RunnerCore {
|
|
|
640
938
|
this.ready = this.runtime === "pi" || !!this.sessionFile;
|
|
641
939
|
if (!this.ready) {
|
|
642
940
|
if (this.runtime === "omp") {
|
|
643
|
-
this.
|
|
941
|
+
this.diag("[omp-runner] ERROR rpc get_state returned no session file; cannot provide a resume token");
|
|
644
942
|
this.io.stopChild?.();
|
|
645
943
|
return;
|
|
646
944
|
}
|
|
647
945
|
// For custom protocol: pi-rpc community harnesses, reporting no session file
|
|
648
946
|
// reads as needing attention rather than stopping the child process.
|
|
649
|
-
this.
|
|
947
|
+
this.diag(`[${this.runtime}-runner] ERROR rpc get_state returned no session file; cannot provide a resume token`);
|
|
650
948
|
this.raiseAttention("runtime_error");
|
|
651
949
|
return;
|
|
652
950
|
}
|
|
@@ -814,6 +1112,12 @@ export class RunnerCore {
|
|
|
814
1112
|
this.attention = null;
|
|
815
1113
|
this.attentionIsLatest = false;
|
|
816
1114
|
}
|
|
1115
|
+
/** A diagnostic stays in the transcript — the readiness probe and the operator both read
|
|
1116
|
+
* it there; a pane with a status line pins the latest one as a convenience copy. */
|
|
1117
|
+
diag(text) {
|
|
1118
|
+
this.io.mirrorLine(text);
|
|
1119
|
+
this.io.diagnostic?.(text);
|
|
1120
|
+
}
|
|
817
1121
|
handleEvent(event) {
|
|
818
1122
|
if (event.type === "extension_ui_request") {
|
|
819
1123
|
const method = event.method;
|
|
@@ -822,7 +1126,7 @@ export class RunnerCore {
|
|
|
822
1126
|
.map(stripVTControlCharacters).join(" — ").replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/gu, " ").slice(0, 400);
|
|
823
1127
|
if (this.runtime !== "omp" && !dialog) {
|
|
824
1128
|
if (method === "notify")
|
|
825
|
-
this.
|
|
1129
|
+
this.diag(`[${this.runtime}-runner] ${detail}`);
|
|
826
1130
|
return; // Pi notifications and other fire-and-forget UI requests expect no answer.
|
|
827
1131
|
}
|
|
828
1132
|
// RPC does not mount an interactive UI. Reply at once; otherwise the
|
|
@@ -831,7 +1135,7 @@ export class RunnerCore {
|
|
|
831
1135
|
this.io.sendRpc({ type: "extension_ui_response", id: event.id, cancelled: true });
|
|
832
1136
|
}
|
|
833
1137
|
if (dialog) {
|
|
834
|
-
this.
|
|
1138
|
+
this.diag(this.runtime !== "omp"
|
|
835
1139
|
? `[${this.runtime}-runner] Extension ${method}: ${detail}; cancelled because the managed RPC pane cannot answer it. Operator action required: review the cancelled request and re-send an instruction the extension can complete without a dialog.`
|
|
836
1140
|
: "[omp-runner] Approval/input requested; cancelled because the managed RPC pane cannot answer it. Operator action required: review the denied action and re-send a safe instruction, or change the seat permission policy explicitly.");
|
|
837
1141
|
this.raiseAttention("permission_prompt");
|
|
@@ -850,8 +1154,10 @@ export class RunnerCore {
|
|
|
850
1154
|
this.lastEntryId = entryId;
|
|
851
1155
|
this.writeSidecar({});
|
|
852
1156
|
}
|
|
853
|
-
if (event.type === "agent_start")
|
|
1157
|
+
if (event.type === "agent_start") {
|
|
854
1158
|
this.clearAttention();
|
|
1159
|
+
this.io.clearStatus?.();
|
|
1160
|
+
}
|
|
855
1161
|
if (this.runtime === "omp") {
|
|
856
1162
|
if (event.type === "agent_start" || event.type === "turn_start"
|
|
857
1163
|
|| (event.type === "message_start" && message?.role === "assistant")
|
|
@@ -902,7 +1208,7 @@ export class RunnerCore {
|
|
|
902
1208
|
// the repeat lacks it, then reset at the next assistant message/agent
|
|
903
1209
|
// turn, not at agent_end.
|
|
904
1210
|
if (event.type === "message_end" || !this.assistantErrorShown) {
|
|
905
|
-
this.
|
|
1211
|
+
this.diag(mapped.errorNotice);
|
|
906
1212
|
}
|
|
907
1213
|
this.assistantErrorShown = true;
|
|
908
1214
|
// Only typed, explicitly transient HTTP failures may release the send
|
|
@@ -1417,6 +1723,13 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1417
1723
|
});
|
|
1418
1724
|
// The child may close its pipe before the first RPC write completes.
|
|
1419
1725
|
child.stdin.on("error", () => { });
|
|
1726
|
+
const pane = createPaneCompositor(process.stdout);
|
|
1727
|
+
// Diagnostics stay in the transcript — the pane's readiness probe greps it, and people
|
|
1728
|
+
// and agents read the history there; the status line only pins the latest copy.
|
|
1729
|
+
const paneDiag = (text) => {
|
|
1730
|
+
pane.line(text);
|
|
1731
|
+
pane.diagnostic(text);
|
|
1732
|
+
};
|
|
1420
1733
|
const chargeLookup = new OpenRouterChargeLookup({
|
|
1421
1734
|
fetchGeneration: openRouterGenerationFetcher(() => childEnv["OPENROUTER_API_KEY"]),
|
|
1422
1735
|
postCharges: async (piSessionId, charges) => {
|
|
@@ -1437,7 +1750,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1437
1750
|
}, () => false).finally(() => clearTimeout(timeout));
|
|
1438
1751
|
},
|
|
1439
1752
|
schedule: (fn, ms) => { setTimeout(fn, ms).unref(); },
|
|
1440
|
-
notice: (line) => {
|
|
1753
|
+
notice: (line) => { paneDiag(line); },
|
|
1441
1754
|
});
|
|
1442
1755
|
// One activity post at a time: the daemon reads its newest record by arrival, so a beat still in flight when a turn
|
|
1443
1756
|
// starts must not land after the turn's first post. Each post's own 1.5 s timeout bounds the wait behind it.
|
|
@@ -1461,8 +1774,10 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1461
1774
|
}
|
|
1462
1775
|
catch { /* exit handler reports */ }
|
|
1463
1776
|
},
|
|
1464
|
-
mirrorLine: (line) =>
|
|
1465
|
-
mirrorAppend: (text) =>
|
|
1777
|
+
mirrorLine: (line) => pane.line(line),
|
|
1778
|
+
mirrorAppend: (text) => pane.transcript(text),
|
|
1779
|
+
diagnostic: (text) => pane.diagnostic(text),
|
|
1780
|
+
clearStatus: () => pane.clearStatus(),
|
|
1466
1781
|
postActivity: (payload) => {
|
|
1467
1782
|
if (!endpoint || typeof fetch !== "function")
|
|
1468
1783
|
return;
|
|
@@ -1553,7 +1868,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1553
1868
|
readline.createInterface({ input: child.stderr }).on("line", (line) => {
|
|
1554
1869
|
if (!line.trim())
|
|
1555
1870
|
return;
|
|
1556
|
-
|
|
1871
|
+
paneDiag(`[${runtime}:err] ${line}`);
|
|
1557
1872
|
stderrTail.push(line.length > OMP_STDERR_TAIL_CHARS ? `${line.slice(0, OMP_STDERR_TAIL_CHARS)}...` : line);
|
|
1558
1873
|
if (stderrTail.length > OMP_STDERR_TAIL_LINES)
|
|
1559
1874
|
stderrTail.shift();
|
|
@@ -1570,14 +1885,14 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1570
1885
|
});
|
|
1571
1886
|
if (detail) {
|
|
1572
1887
|
reportedPiCapability = true;
|
|
1573
|
-
|
|
1888
|
+
paneDiag(`[pi-runner] ${detail}`);
|
|
1574
1889
|
}
|
|
1575
1890
|
}
|
|
1576
1891
|
});
|
|
1577
|
-
const input = createRunnerInput(process.stdin, process.stdout, (block) => core.handleUserBlock(block));
|
|
1892
|
+
const input = createRunnerInput(process.stdin, process.stdout, (block) => core.handleUserBlock(block), pane);
|
|
1578
1893
|
if (runtime !== "omp") {
|
|
1579
1894
|
child.on("error", (err) => {
|
|
1580
|
-
|
|
1895
|
+
paneDiag(`${PI_RUNNER_ERROR_MARKER} failed to spawn ${args.launchWrapper?.length ? `launch_wrapper (${spawnFile})` : (args.command ?? "pi")}: ${err.message}`);
|
|
1581
1896
|
const code = err.code === "ENOENT" ? 127 : 1;
|
|
1582
1897
|
core.handlePiExit(code);
|
|
1583
1898
|
input.close();
|
|
@@ -1604,7 +1919,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1604
1919
|
if (!core.isReady()) {
|
|
1605
1920
|
const how = signal ? `signal ${signal}` : `exit code ${code ?? "unknown"}`;
|
|
1606
1921
|
const output = stderrTail.length > 0 ? ` Its last output: ${stderrTail.join(" | ")}` : " It printed nothing on stderr.";
|
|
1607
|
-
|
|
1922
|
+
paneDiag(transportUp
|
|
1608
1923
|
? "[omp-runner] ERROR OMP did not establish a resumable RPC session. Authenticate this isolated seat using HOME=<seat-root> PI_CODING_AGENT_DIR=<seat-root>/agent omp and /login, or provide its declared model provider key in the OpenRig daemon environment. Default OMP credentials are not shared."
|
|
1609
1924
|
: `[omp-runner] ERROR OMP exited during startup, before its RPC transport started (${command}, ${how}).${output}`);
|
|
1610
1925
|
}
|
|
@@ -1613,7 +1928,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1613
1928
|
process.exitCode = code ?? 1;
|
|
1614
1929
|
};
|
|
1615
1930
|
child.on("error", (err) => {
|
|
1616
|
-
|
|
1931
|
+
paneDiag(`[omp-runner] ERROR failed to spawn omp: ${err.message}`);
|
|
1617
1932
|
recordExit(null);
|
|
1618
1933
|
});
|
|
1619
1934
|
// "close" fires once OMP's stdio is drained, so its stderr is in the tail
|