@openrig/cli 0.6.12 → 0.6.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 +19 -12
- package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/README.md +9 -2
- package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +25 -9
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +7 -4
- package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +5 -0
- package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +61 -16
- package/daemon/assets/skills/rigs/SKILL.md +8 -4
- 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 +60 -12
- package/daemon/context-packs/reference/getting-started.md +44 -14
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +5 -5
- package/daemon/context-packs/reference/whats-new.md +90 -163
- package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
- package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
- package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
- package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
- package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
- package/daemon/context-packs/skills/mission-slice-sop/SKILL.md +5 -0
- package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +61 -16
- package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
- package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
- package/daemon/context-packs/world-example/manifest.yaml +1 -1
- package/daemon/context-packs/world-public/manifest.yaml +1 -1
- package/daemon/dist/adapters/claude-code-adapter.d.ts +9 -1
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +110 -52
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +47 -6
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/pi-resume.d.ts +1 -1
- package/daemon/dist/adapters/pi-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-resume.js +4 -1
- package/daemon/dist/adapters/pi-resume.js.map +1 -1
- package/daemon/dist/adapters/pi-runner-protocol.d.ts +9 -0
- package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner-protocol.js +16 -0
- package/daemon/dist/adapters/pi-runner-protocol.js.map +1 -1
- package/daemon/dist/adapters/pi-runner.d.ts +5 -2
- package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.js +72 -15
- package/daemon/dist/adapters/pi-runner.js.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.js +2 -0
- package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/stub-compaction.d.ts +1 -0
- package/daemon/dist/adapters/stub-compaction.d.ts.map +1 -1
- package/daemon/dist/adapters/stub-compaction.js +2 -0
- package/daemon/dist/adapters/stub-compaction.js.map +1 -1
- package/daemon/dist/adapters/stub-refocus.d.ts +6 -0
- package/daemon/dist/adapters/stub-refocus.d.ts.map +1 -0
- package/daemon/dist/adapters/stub-refocus.js +22 -0
- package/daemon/dist/adapters/stub-refocus.js.map +1 -0
- package/daemon/dist/adapters/stub-runner.d.ts +6 -0
- package/daemon/dist/adapters/stub-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/stub-runner.js +18 -1
- package/daemon/dist/adapters/stub-runner.js.map +1 -1
- package/daemon/dist/adapters/stub-script.d.ts +2 -2
- package/daemon/dist/adapters/stub-script.d.ts.map +1 -1
- package/daemon/dist/adapters/stub-script.js +2 -2
- package/daemon/dist/adapters/stub-script.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 +2 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/117_provider_account_readings.d.ts +3 -0
- package/daemon/dist/db/migrations/117_provider_account_readings.d.ts.map +1 -0
- package/daemon/dist/db/migrations/117_provider_account_readings.js +32 -0
- package/daemon/dist/db/migrations/117_provider_account_readings.js.map +1 -0
- package/daemon/dist/domain/claude-activity-hooks.d.ts +6 -0
- package/daemon/dist/domain/claude-activity-hooks.d.ts.map +1 -1
- package/daemon/dist/domain/claude-activity-hooks.js +19 -1
- package/daemon/dist/domain/claude-activity-hooks.js.map +1 -1
- package/daemon/dist/domain/claude-core-plugin-env.d.ts +2 -0
- package/daemon/dist/domain/claude-core-plugin-env.d.ts.map +1 -1
- package/daemon/dist/domain/claude-core-plugin-env.js +6 -2
- package/daemon/dist/domain/claude-core-plugin-env.js.map +1 -1
- package/daemon/dist/domain/claude-managed-launch.d.ts +5 -0
- package/daemon/dist/domain/claude-managed-launch.d.ts.map +1 -1
- package/daemon/dist/domain/claude-managed-launch.js +48 -7
- package/daemon/dist/domain/claude-managed-launch.js.map +1 -1
- package/daemon/dist/domain/claude-mcp-menu.d.ts +5 -0
- package/daemon/dist/domain/claude-mcp-menu.d.ts.map +1 -0
- package/daemon/dist/domain/claude-mcp-menu.js +25 -0
- package/daemon/dist/domain/claude-mcp-menu.js.map +1 -0
- package/daemon/dist/domain/fresh-occupant-relation.d.ts +7 -0
- package/daemon/dist/domain/fresh-occupant-relation.d.ts.map +1 -1
- package/daemon/dist/domain/fresh-occupant-relation.js +44 -0
- package/daemon/dist/domain/fresh-occupant-relation.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/channel-recovery.d.ts +14 -2
- package/daemon/dist/domain/gateway/slack/channel-recovery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/channel-recovery.js +128 -89
- package/daemon/dist/domain/gateway/slack/channel-recovery.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 +5 -3
- package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/recovery-budget.d.ts +24 -0
- package/daemon/dist/domain/gateway/slack/recovery-budget.d.ts.map +1 -0
- package/daemon/dist/domain/gateway/slack/recovery-budget.js +18 -0
- package/daemon/dist/domain/gateway/slack/recovery-budget.js.map +1 -0
- package/daemon/dist/domain/gateway/slack/slack-recovery.d.ts +104 -0
- package/daemon/dist/domain/gateway/slack/slack-recovery.d.ts.map +1 -0
- package/daemon/dist/domain/gateway/slack/slack-recovery.js +236 -0
- package/daemon/dist/domain/gateway/slack/slack-recovery.js.map +1 -0
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js +29 -6
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/state-store.d.ts +34 -0
- package/daemon/dist/domain/gateway/slack/state-store.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/state-store.js +67 -0
- package/daemon/dist/domain/gateway/slack/state-store.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/thread-recovery.d.ts +37 -0
- package/daemon/dist/domain/gateway/slack/thread-recovery.d.ts.map +1 -0
- package/daemon/dist/domain/gateway/slack/thread-recovery.js +173 -0
- package/daemon/dist/domain/gateway/slack/thread-recovery.js.map +1 -0
- package/daemon/dist/domain/gateway/slack/thread-seat-map.d.ts +8 -0
- package/daemon/dist/domain/gateway/slack/thread-seat-map.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/thread-seat-map.js +11 -0
- package/daemon/dist/domain/gateway/slack/thread-seat-map.js.map +1 -1
- package/daemon/dist/domain/model-divergence/current-generation-record.d.ts +6 -1
- package/daemon/dist/domain/model-divergence/current-generation-record.d.ts.map +1 -1
- package/daemon/dist/domain/model-divergence/current-generation-record.js +4 -1
- package/daemon/dist/domain/model-divergence/current-generation-record.js.map +1 -1
- package/daemon/dist/domain/model-divergence/current-model-reader.d.ts +74 -0
- package/daemon/dist/domain/model-divergence/current-model-reader.d.ts.map +1 -0
- package/daemon/dist/domain/model-divergence/current-model-reader.js +246 -0
- package/daemon/dist/domain/model-divergence/current-model-reader.js.map +1 -0
- package/daemon/dist/domain/model-divergence/effective-model-readers.d.ts +18 -0
- package/daemon/dist/domain/model-divergence/effective-model-readers.d.ts.map +1 -1
- package/daemon/dist/domain/model-divergence/effective-model-readers.js +24 -8
- package/daemon/dist/domain/model-divergence/effective-model-readers.js.map +1 -1
- package/daemon/dist/domain/native-process-lineage.d.ts +8 -1
- package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
- package/daemon/dist/domain/native-process-lineage.js +40 -26
- package/daemon/dist/domain/native-process-lineage.js.map +1 -1
- package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
- package/daemon/dist/domain/native-resume-probe.js +34 -8
- package/daemon/dist/domain/native-resume-probe.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts +1 -1
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +84 -18
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/process-census.d.ts +1 -1
- package/daemon/dist/domain/process-census.d.ts.map +1 -1
- package/daemon/dist/domain/process-table.d.ts +26 -0
- package/daemon/dist/domain/process-table.d.ts.map +1 -0
- package/daemon/dist/domain/process-table.js +185 -0
- package/daemon/dist/domain/process-table.js.map +1 -0
- package/daemon/dist/domain/profile-resolver.d.ts +8 -0
- package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
- package/daemon/dist/domain/profile-resolver.js +11 -0
- package/daemon/dist/domain/profile-resolver.js.map +1 -1
- package/daemon/dist/domain/projection-planner.js +1 -1
- package/daemon/dist/domain/projection-planner.js.map +1 -1
- package/daemon/dist/domain/provider/claude-usage-windows.d.ts +3 -1
- package/daemon/dist/domain/provider/claude-usage-windows.d.ts.map +1 -1
- package/daemon/dist/domain/provider/claude-usage-windows.js +48 -3
- package/daemon/dist/domain/provider/claude-usage-windows.js.map +1 -1
- package/daemon/dist/domain/provider/codex-usage-reader.d.ts +4 -1
- package/daemon/dist/domain/provider/codex-usage-reader.d.ts.map +1 -1
- package/daemon/dist/domain/provider/codex-usage-reader.js +3 -0
- package/daemon/dist/domain/provider/codex-usage-reader.js.map +1 -1
- package/daemon/dist/domain/provider/codex-usage-windows.d.ts +3 -1
- package/daemon/dist/domain/provider/codex-usage-windows.d.ts.map +1 -1
- package/daemon/dist/domain/provider/codex-usage-windows.js +1 -0
- package/daemon/dist/domain/provider/codex-usage-windows.js.map +1 -1
- package/daemon/dist/domain/provider/provider-account-readings.d.ts +42 -0
- package/daemon/dist/domain/provider/provider-account-readings.d.ts.map +1 -0
- package/daemon/dist/domain/provider/provider-account-readings.js +132 -0
- package/daemon/dist/domain/provider/provider-account-readings.js.map +1 -0
- package/daemon/dist/domain/provider/provider-types.d.ts +29 -0
- package/daemon/dist/domain/provider/provider-types.d.ts.map +1 -1
- package/daemon/dist/domain/provider/usage-across-hosts.d.ts.map +1 -1
- package/daemon/dist/domain/provider/usage-across-hosts.js +6 -0
- package/daemon/dist/domain/provider/usage-across-hosts.js.map +1 -1
- package/daemon/dist/domain/provider/usage-windows.d.ts +25 -0
- package/daemon/dist/domain/provider/usage-windows.d.ts.map +1 -1
- package/daemon/dist/domain/provider/usage-windows.js +100 -4
- package/daemon/dist/domain/provider/usage-windows.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +23 -0
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +59 -1
- 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 +47 -4
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/restore-check-service.d.ts +10 -0
- package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
- package/daemon/dist/domain/restore-check-service.js +73 -10
- package/daemon/dist/domain/restore-check-service.js.map +1 -1
- package/daemon/dist/domain/restore-guidance.d.ts +6 -0
- package/daemon/dist/domain/restore-guidance.d.ts.map +1 -1
- package/daemon/dist/domain/restore-guidance.js +21 -5
- package/daemon/dist/domain/restore-guidance.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +1 -1
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.js +6 -29
- package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
- package/daemon/dist/domain/rig-repository.d.ts +3 -0
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +6 -0
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +4 -2
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.d.ts +4 -0
- package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.js +12 -2
- 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 +11 -0
- package/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/daemon/dist/domain/runtime-adapter.d.ts +13 -0
- package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-adapter.js.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.js +15 -1
- package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-cwd-preparation.d.ts +22 -0
- package/daemon/dist/domain/seat-cwd-preparation.d.ts.map +1 -0
- package/daemon/dist/domain/seat-cwd-preparation.js +107 -0
- package/daemon/dist/domain/seat-cwd-preparation.js.map +1 -0
- package/daemon/dist/domain/seat-effort.d.ts +4 -3
- package/daemon/dist/domain/seat-effort.d.ts.map +1 -1
- package/daemon/dist/domain/seat-effort.js +21 -3
- package/daemon/dist/domain/seat-effort.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +36 -2
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +206 -15
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.d.ts +14 -0
- package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.js +59 -3
- package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
- package/daemon/dist/domain/seat-status-service.d.ts +2 -0
- package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-status-service.js +1 -0
- package/daemon/dist/domain/seat-status-service.js.map +1 -1
- package/daemon/dist/domain/seat-structural-activity-service.d.ts +7 -1
- package/daemon/dist/domain/seat-structural-activity-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-structural-activity-service.js +9 -3
- package/daemon/dist/domain/seat-structural-activity-service.js.map +1 -1
- package/daemon/dist/domain/session-name.d.ts +8 -0
- package/daemon/dist/domain/session-name.d.ts.map +1 -1
- package/daemon/dist/domain/session-name.js +12 -0
- package/daemon/dist/domain/session-name.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +78 -3
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +306 -15
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +1 -1
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +14 -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.d.ts +29 -0
- package/daemon/dist/domain/watchdog-delivery.d.ts.map +1 -0
- package/daemon/dist/domain/watchdog-delivery.js +113 -0
- package/daemon/dist/domain/watchdog-delivery.js.map +1 -0
- package/daemon/dist/domain/watchdog-policy-engine.d.ts +60 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +154 -28
- package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
- package/daemon/dist/domain/watchdog-scheduler.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-scheduler.js +6 -1
- package/daemon/dist/domain/watchdog-scheduler.js.map +1 -1
- package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-instance-store.js +6 -2
- package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
- package/daemon/dist/routes/attention.d.ts.map +1 -1
- package/daemon/dist/routes/attention.js +41 -1
- package/daemon/dist/routes/attention.js.map +1 -1
- package/daemon/dist/routes/compaction.js +1 -1
- package/daemon/dist/routes/compaction.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +3 -1
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/restore-check.d.ts.map +1 -1
- package/daemon/dist/routes/restore-check.js +19 -1
- package/daemon/dist/routes/restore-check.js.map +1 -1
- package/daemon/dist/routes/seat.d.ts.map +1 -1
- package/daemon/dist/routes/seat.js +15 -2
- package/daemon/dist/routes/seat.js.map +1 -1
- package/daemon/dist/routes/sessions.d.ts.map +1 -1
- package/daemon/dist/routes/sessions.js +7 -1
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/transport.d.ts.map +1 -1
- package/daemon/dist/routes/transport.js +13 -2
- package/daemon/dist/routes/transport.js.map +1 -1
- package/daemon/dist/server.d.ts +1 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +1 -0
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +39 -113
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/agent-spec.md +1 -1
- package/daemon/docs/reference/agent-startup-guide.md +84 -0
- package/daemon/docs/reference/getting-started.md +44 -14
- package/daemon/docs/reference/publishing-a-rig-bundle.md +5 -2
- package/daemon/docs/reference/refocus-channel.md +11 -1
- package/daemon/docs/reference/rig-spec.md +5 -5
- package/daemon/docs/reference/rosters.md +29 -2
- package/daemon/docs/reference/slack-app-setup.md +47 -17
- package/daemon/docs/reference/whats-new.md +90 -163
- package/daemon/specs/agents/apps/vault-specialist/agent.yaml +1 -0
- package/daemon/specs/agents/conveyor/builder/agent.yaml +1 -0
- package/daemon/specs/agents/conveyor/lead/agent.yaml +1 -0
- package/daemon/specs/agents/conveyor/planner/agent.yaml +1 -0
- package/daemon/specs/agents/conveyor/reviewer/agent.yaml +1 -0
- package/daemon/specs/agents/design/product-designer/agent.yaml +1 -0
- package/daemon/specs/agents/development/implementer/agent.yaml +1 -0
- package/daemon/specs/agents/development/qa/agent.yaml +1 -0
- package/daemon/specs/agents/factory-rsi/dogfood/agent.yaml +1 -0
- package/daemon/specs/agents/factory-rsi/release-manager/agent.yaml +1 -0
- package/daemon/specs/agents/orchestration/orchestrator/agent.yaml +1 -0
- package/daemon/specs/agents/product-management/pm/agent.yaml +1 -0
- package/daemon/specs/agents/research/analyst/agent.yaml +1 -0
- package/daemon/specs/agents/research/synthesizer/agent.yaml +1 -0
- package/daemon/specs/agents/review/independent-reviewer/agent.yaml +1 -0
- package/dist/build-info.js +3 -3
- package/dist/commands/capture.d.ts.map +1 -1
- package/dist/commands/capture.js +14 -0
- package/dist/commands/capture.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +3 -2
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +8 -7
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/grow.d.ts.map +1 -1
- package/dist/commands/grow.js +24 -7
- package/dist/commands/grow.js.map +1 -1
- package/dist/commands/provider.d.ts.map +1 -1
- package/dist/commands/provider.js +43 -7
- package/dist/commands/provider.js.map +1 -1
- package/dist/commands/ps.d.ts +2 -0
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +12 -1
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/remove.d.ts.map +1 -1
- package/dist/commands/remove.js +20 -1
- package/dist/commands/remove.js.map +1 -1
- package/dist/commands/roster.d.ts +2 -1
- package/dist/commands/roster.d.ts.map +1 -1
- package/dist/commands/roster.js +10 -5
- package/dist/commands/roster.js.map +1 -1
- package/dist/commands/scope.js +1 -1
- package/dist/commands/scope.js.map +1 -1
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +75 -8
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/slack.d.ts.map +1 -1
- package/dist/commands/slack.js +14 -1
- package/dist/commands/slack.js.map +1 -1
- package/dist/commands/usage.d.ts.map +1 -1
- package/dist/commands/usage.js +4 -3
- package/dist/commands/usage.js.map +1 -1
- package/dist/lib/model-observation.d.ts +13 -0
- package/dist/lib/model-observation.d.ts.map +1 -0
- package/dist/lib/model-observation.js +25 -0
- package/dist/lib/model-observation.js.map +1 -0
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +1 -0
- package/dist/mcp-server.js.map +1 -1
- package/package.json +1 -1
- package/tui/dist/attention/attention-model.js +6 -5
- package/tui/dist/attention/attention-model.js.map +1 -1
- package/tui/dist/attention/source-continuity.d.ts.map +1 -1
- package/tui/dist/attention/source-continuity.js +2 -0
- package/tui/dist/attention/source-continuity.js.map +1 -1
- package/tui/dist/terminals/open-window.d.ts +11 -1
- package/tui/dist/terminals/open-window.d.ts.map +1 -1
- package/tui/dist/terminals/open-window.js +47 -2
- package/tui/dist/terminals/open-window.js.map +1 -1
- package/tui/dist/usage/usage-model.d.ts +2 -0
- package/tui/dist/usage/usage-model.d.ts.map +1 -1
- package/tui/dist/usage/usage-model.js +38 -3
- package/tui/dist/usage/usage-model.js.map +1 -1
- package/ui/dist/assets/{index-Cfbtfd9G.js → index-CVgod3Pm.js} +1 -1
- package/ui/dist/index.html +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { shellQuote } from "../adapters/shell-quote.js";
|
|
2
|
+
import { EFFORT_SHAPE, piThinkingValue } from "../adapters/pi-runner-protocol.js";
|
|
2
3
|
import { deriveCanonicalFromEntry, getNodeInventory } from "./node-inventory.js";
|
|
3
4
|
import { deriveSessionName, parseSessionName } from "./session-name.js";
|
|
4
5
|
import { resolveStartupProof } from "./startup-resolver.js";
|
|
@@ -8,13 +9,18 @@ import { observeSolePane } from "./pane-binding-observation.js";
|
|
|
8
9
|
import { createHash } from "node:crypto";
|
|
9
10
|
import { NativePermissionStore } from "./native-permission-store.js";
|
|
10
11
|
import { validateNativePermissionSelection, unresolvedClaudePermissionModes } from "./native-permission-selection.js";
|
|
12
|
+
import fs from "node:fs";
|
|
13
|
+
import path from "node:path";
|
|
14
|
+
import { resolveConcreteHint } from "./runtime-adapter.js";
|
|
15
|
+
import { ProjectionManifestStore } from "./projection-manifest-store.js";
|
|
16
|
+
import { planCwdPreparation } from "./seat-cwd-preparation.js";
|
|
11
17
|
import { resolvePermissionPolicyAttachment, validatePermissionPolicyRef } from "./permission-policy/policy-ref.js";
|
|
12
18
|
import { effortPrecedence, emittedEffortFromArgv, readNativeEffort, resolveSeatEffort, unknownLevelWarning, } from "./seat-effort.js";
|
|
13
19
|
import { claudeCommandSessionToken, codexCommandResumeToken, observeClaudePaneRuntime, observeCodexPaneProcess, processArgv, } from "./native-process-lineage.js";
|
|
14
20
|
import { defaultInPlaceRestartIo } from "./seat-restart-in-place.js";
|
|
15
21
|
import nodePath from "node:path";
|
|
16
22
|
import { CodexInPlaceRestart, } from "./seat-restart-in-place.js";
|
|
17
|
-
import { seatAdapter } from "../adapters/community-harness-runtime-adapter.js";
|
|
23
|
+
import { CommunityHarnessRuntimeAdapter, seatAdapter } from "../adapters/community-harness-runtime-adapter.js";
|
|
18
24
|
import { sessionCommunityHarnessSelect } from "./session-registry.js";
|
|
19
25
|
/**
|
|
20
26
|
* S5 (OPR.0.5.4.7) — the seat-lifecycle verb surface: set-model, single-seat stop,
|
|
@@ -49,6 +55,7 @@ export class SeatLifecycleService {
|
|
|
49
55
|
inPlaceRestartTiming;
|
|
50
56
|
inPlaceRestartDaemonStartedAt;
|
|
51
57
|
transcripts;
|
|
58
|
+
piRecords;
|
|
52
59
|
constructor(deps) {
|
|
53
60
|
if (deps.db !== deps.rigRepo.db)
|
|
54
61
|
throw new Error("SeatLifecycleService: rigRepo must share the same db handle");
|
|
@@ -71,6 +78,7 @@ export class SeatLifecycleService {
|
|
|
71
78
|
this.inPlaceRestartTiming = deps.inPlaceRestartTiming;
|
|
72
79
|
this.inPlaceRestartDaemonStartedAt = deps.inPlaceRestartDaemonStartedAt;
|
|
73
80
|
this.transcripts = deps.transcripts ?? null;
|
|
81
|
+
this.piRecords = deps.piRecords ?? null;
|
|
74
82
|
}
|
|
75
83
|
async setModel(input) {
|
|
76
84
|
const required = this.requireReason(input.reason);
|
|
@@ -108,6 +116,127 @@ export class SeatLifecycleService {
|
|
|
108
116
|
this.eventBus.notifySubscribers(persisted);
|
|
109
117
|
return { ok: true, seat, from, to: model, changed: true };
|
|
110
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Save an existing seat's launch directory for its next fresh launch or rebuild handover, keeping its identity,
|
|
121
|
+
* address, queue and history. Like set-model it validates, then persists the cwd and an audited event in one
|
|
122
|
+
* transaction. Before that, set-cwd's read-only preflight policy refuses the change when the new directory holds an
|
|
123
|
+
* operator-edited, unrecorded-and-different or doubly sourced copy that launch would place there. It creates the
|
|
124
|
+
* folder and writes no startup files: launch does that, as it does today. The running occupant keeps its directory
|
|
125
|
+
* until it's relaunched.
|
|
126
|
+
*/
|
|
127
|
+
async setCwd(input) {
|
|
128
|
+
const required = this.requireReason(input.reason);
|
|
129
|
+
if (required)
|
|
130
|
+
return required;
|
|
131
|
+
if (!input.cwd?.trim())
|
|
132
|
+
return { ok: false, code: "missing_cwd", message: "An absolute working directory is required (--cwd)." };
|
|
133
|
+
if (!path.isAbsolute(input.cwd) || input.cwd.includes("\0")) {
|
|
134
|
+
return { ok: false, code: "invalid_cwd", message: "The working directory must be an absolute path on the daemon's host." };
|
|
135
|
+
}
|
|
136
|
+
let to = path.resolve(input.cwd);
|
|
137
|
+
if (to === path.parse(to).root) {
|
|
138
|
+
return { ok: false, code: "invalid_cwd", message: "Choose a project directory, not a filesystem root, for managed startup files." };
|
|
139
|
+
}
|
|
140
|
+
const resolved = this.resolveSeat(input.seatRef);
|
|
141
|
+
if ("code" in resolved)
|
|
142
|
+
return resolved;
|
|
143
|
+
const seat = this.describe(resolved);
|
|
144
|
+
const node = this.rigRepo.getRig(seat.rigId)?.nodes.find(candidate => candidate.id === seat.nodeId);
|
|
145
|
+
if (!node)
|
|
146
|
+
return { ok: false, code: "seat_not_found", message: "The seat no longer exists.", guidance: SEAT_LOOKUP_GUIDANCE };
|
|
147
|
+
const from = node.cwd;
|
|
148
|
+
try {
|
|
149
|
+
fs.mkdirSync(to, { recursive: true });
|
|
150
|
+
to = fs.realpathSync(to);
|
|
151
|
+
if (to === path.parse(to).root || !fs.statSync(to).isDirectory())
|
|
152
|
+
throw new Error("Destination must be a project directory.");
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
return { ok: false, code: "invalid_cwd", message: `Cannot use the requested working directory: ${error.message}` };
|
|
156
|
+
}
|
|
157
|
+
const startup = this.readStartupContext(node.id, to);
|
|
158
|
+
if (!startup.ok)
|
|
159
|
+
return startup.refusal;
|
|
160
|
+
if (!node.runtime || startup.context.runtime !== node.runtime) {
|
|
161
|
+
return { ok: false, code: "startup_context_runtime_mismatch", message: "The saved startup context belongs to a different runtime." };
|
|
162
|
+
}
|
|
163
|
+
// Resolved as launch resolves it, so a recorded community harness finds its adapter too.
|
|
164
|
+
const adapter = seatAdapter(this.runtimeAdapters, node.runtime, this.latestSession(node.id)?.community_harness);
|
|
165
|
+
if (!adapter)
|
|
166
|
+
return { ok: false, code: "runtime_adapter_missing", message: "The configured runtime adapter is unavailable." };
|
|
167
|
+
const warnings = [];
|
|
168
|
+
// The filesystem startup files the next fresh launch would deliver (never send_text or actions), with legacy auto
|
|
169
|
+
// hints resolved, for the read-only destination check.
|
|
170
|
+
const files = [];
|
|
171
|
+
// A community harness takes no startup files at launch (its adapter delivers none), so there's nothing to check.
|
|
172
|
+
const takesStartupFiles = !(adapter instanceof CommunityHarnessRuntimeAdapter);
|
|
173
|
+
for (const file of takesStartupFiles ? startup.context.resolvedStartupFiles : []) {
|
|
174
|
+
if (!file.appliesOn.includes("fresh_start") || file.deliveryHint === "send_text")
|
|
175
|
+
continue;
|
|
176
|
+
try {
|
|
177
|
+
const hint = file.deliveryHint === "auto"
|
|
178
|
+
? resolveConcreteHint(file.path, fs.readFileSync(file.absolutePath, "utf8")) : file.deliveryHint;
|
|
179
|
+
if (hint !== "send_text")
|
|
180
|
+
files.push({ ...file, deliveryHint: hint });
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
const detail = `Startup file ${file.path}: ${error.message}`;
|
|
184
|
+
if (file.required)
|
|
185
|
+
return { ok: false, code: "cwd_check_failed", message: detail, warnings };
|
|
186
|
+
warnings.push(detail);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const oldBinding = this.sessionRegistry.getBindingForNode(node.id);
|
|
190
|
+
const binding = {
|
|
191
|
+
id: oldBinding?.id ?? `cwd:${node.id}`, nodeId: node.id,
|
|
192
|
+
attachmentType: oldBinding?.attachmentType ?? "tmux",
|
|
193
|
+
tmuxSession: oldBinding?.tmuxSession ?? deriveCanonicalFromEntry(resolved.entry),
|
|
194
|
+
tmuxWindow: null, tmuxPane: null, cmuxWorkspace: null, cmuxSurface: null,
|
|
195
|
+
updatedAt: oldBinding?.updatedAt ?? new Date().toISOString(), cwd: to,
|
|
196
|
+
};
|
|
197
|
+
const inspect = `Inspect the configured directory with: rig seat status ${input.seatRef}`;
|
|
198
|
+
try {
|
|
199
|
+
const check = planCwdPreparation({ ...startup.context.plan, cwd: to }, files, binding, adapter, new ProjectionManifestStore(this.db));
|
|
200
|
+
warnings.push(...check.warnings);
|
|
201
|
+
if (check.conflicts.length) {
|
|
202
|
+
warnings.push(...check.conflicts.map(copy => `Protected destination file: ${copy.targetPath}`));
|
|
203
|
+
return { ok: false, code: "cwd_destination_conflict", warnings,
|
|
204
|
+
message: "The new directory holds files set-cwd's preflight policy protects; no startup file was written and the cwd was not changed.",
|
|
205
|
+
guidance: "Use a clean destination, or inspect and move or merge the reported files before retrying." };
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
catch (error) {
|
|
209
|
+
return { ok: false, code: "cwd_check_failed", message: `The new directory couldn't be checked; the cwd was not changed: ${error.message}`, warnings };
|
|
210
|
+
}
|
|
211
|
+
let persisted = null;
|
|
212
|
+
const changed = from !== to;
|
|
213
|
+
try {
|
|
214
|
+
const refusal = this.db.transaction(() => {
|
|
215
|
+
// Another writer (an import, another connection) must not be silently overwritten.
|
|
216
|
+
const current = this.resolveSeat(input.seatRef);
|
|
217
|
+
const currentStartup = this.readStartupContext(node.id, to);
|
|
218
|
+
if ("code" in current || current.nodeId !== node.id || current.entry.cwd !== from
|
|
219
|
+
|| current.entry.runtime !== node.runtime || !currentStartup.ok || currentStartup.context.hash !== startup.context.hash) {
|
|
220
|
+
return { ok: false, code: "cwd_configuration_changed", message: "The seat's configuration changed while its new directory was checked; the cwd was not changed.", guidance: inspect };
|
|
221
|
+
}
|
|
222
|
+
if (changed) {
|
|
223
|
+
if (!this.rigRepo.setNodeCwd(node.id, to, from))
|
|
224
|
+
throw new Error("The seat's saved working directory changed.");
|
|
225
|
+
persisted = this.eventBus.persistWithinTransaction({ type: "node.cwd_changed", rigId: seat.rigId,
|
|
226
|
+
nodeId: node.id, logicalId: seat.logicalId, from, to, reason: input.reason.trim(), operator: input.operator ?? null });
|
|
227
|
+
}
|
|
228
|
+
return null;
|
|
229
|
+
})();
|
|
230
|
+
if (refusal)
|
|
231
|
+
return { ...refusal, warnings };
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
return { ok: false, code: "cwd_persistence_failed", message: `The working directory was not changed: ${error.message}`, guidance: inspect, warnings };
|
|
235
|
+
}
|
|
236
|
+
if (persisted)
|
|
237
|
+
this.eventBus.notifySubscribers(persisted);
|
|
238
|
+
return { ok: true, seat, from, to, changed, effect: "next_launch", warnings };
|
|
239
|
+
}
|
|
111
240
|
/** OPR.0.7.0.7 — save one seat's effort for its next managed continuation. Like set-model it
|
|
112
241
|
* validates, writes, and persists an audited event in the same transaction; it never restarts
|
|
113
242
|
* the seat or touches its peers, model or account. `effort: null` clears the explicit choice. */
|
|
@@ -120,7 +249,7 @@ export class SeatLifecycleService {
|
|
|
120
249
|
if (!requested)
|
|
121
250
|
return { ok: false, code: "missing_effort", message: "An effort level is required (--effort <level>), or pass --clear." };
|
|
122
251
|
// Levels are the runtime's own (they differ by model and client), so only the shape is checked here.
|
|
123
|
-
if (
|
|
252
|
+
if (!EFFORT_SHAPE.test(requested)) {
|
|
124
253
|
return { ok: false, code: "invalid_effort", message: `"${requested}" isn't an effort level: use the runtime's level name, such as low, medium or high.` };
|
|
125
254
|
}
|
|
126
255
|
}
|
|
@@ -129,8 +258,8 @@ export class SeatLifecycleService {
|
|
|
129
258
|
return resolved;
|
|
130
259
|
const seat = this.describe(resolved);
|
|
131
260
|
const runtime = resolved.entry.runtime ?? "unknown";
|
|
132
|
-
if (runtime !== "claude-code" && runtime !== "codex") {
|
|
133
|
-
return { ok: false, code: "effort_unsupported_runtime", message: `Seat "${input.seatRef}" runs ${runtime}; reasoning effort applies to claude-code and
|
|
261
|
+
if (runtime !== "claude-code" && runtime !== "codex" && runtime !== "pi") {
|
|
262
|
+
return { ok: false, code: "effort_unsupported_runtime", message: `Seat "${input.seatRef}" runs ${runtime}; reasoning effort applies to claude-code, codex and pi seats only.` };
|
|
134
263
|
}
|
|
135
264
|
const from = this.readEffort(seat.nodeId);
|
|
136
265
|
if (!from) {
|
|
@@ -180,8 +309,8 @@ export class SeatLifecycleService {
|
|
|
180
309
|
return resolved;
|
|
181
310
|
const seat = this.describe(resolved);
|
|
182
311
|
const runtime = resolved.entry.runtime ?? "unknown";
|
|
183
|
-
if (runtime !== "claude-code" && runtime !== "codex") {
|
|
184
|
-
return { ok: false, code: "effort_unsupported_runtime", message: `Seat "${seatRef}" runs ${runtime}; reasoning effort applies to claude-code and
|
|
312
|
+
if (runtime !== "claude-code" && runtime !== "codex" && runtime !== "pi") {
|
|
313
|
+
return { ok: false, code: "effort_unsupported_runtime", message: `Seat "${seatRef}" runs ${runtime}; reasoning effort applies to claude-code, codex and pi seats only.` };
|
|
185
314
|
}
|
|
186
315
|
const saved = this.readEffort(seat.nodeId);
|
|
187
316
|
if (!saved) {
|
|
@@ -198,6 +327,9 @@ export class SeatLifecycleService {
|
|
|
198
327
|
emitted = { state: "unknown", detail: "The seat has no running session, so no launch to read." };
|
|
199
328
|
observed = { state: "not_verified", detail: "The seat has no running session." };
|
|
200
329
|
}
|
|
330
|
+
else if (runtime === "pi") {
|
|
331
|
+
({ emitted, observed } = await this.piEffort(seat.nodeId, session.session_name, saved));
|
|
332
|
+
}
|
|
201
333
|
else {
|
|
202
334
|
const observe = runtime === "claude-code" ? observeClaudePaneRuntime : observeCodexPaneProcess;
|
|
203
335
|
const process = (await observe({ target, tmux: this.tmuxAdapter, ...(this.listProcesses ? { listProcesses: this.listProcesses } : {}) }))?.process;
|
|
@@ -216,7 +348,60 @@ export class SeatLifecycleService {
|
|
|
216
348
|
observed = native.state === "observed" ? { ...native, matchesEmitted: native.value === value } : native;
|
|
217
349
|
}
|
|
218
350
|
}
|
|
219
|
-
return { ok: true, seat, runtime, requested, saved, emitted, observed, precedence, summary: effortSummary(saved, emitted, observed) };
|
|
351
|
+
return { ok: true, seat, runtime, requested, saved, emitted, observed, precedence, summary: effortSummary(saved, emitted, observed, runtime) };
|
|
352
|
+
}
|
|
353
|
+
/** A Pi seat's launch flag and native level, both from the identity-verified current runner: its
|
|
354
|
+
* own command line, and the newest assistant record of this launch in its own session file. */
|
|
355
|
+
async piEffort(nodeId, sessionName, saved) {
|
|
356
|
+
if (!this.piRecords) {
|
|
357
|
+
return {
|
|
358
|
+
emitted: { state: "unknown", detail: "The seat's Pi runner can't be read here." },
|
|
359
|
+
observed: { state: "not_verified", detail: "The seat's Pi runner can't be read here, so no turn can be tied to its launch." },
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
let selection;
|
|
363
|
+
try {
|
|
364
|
+
selection = await this.piRecords.currentPiRecord(nodeId, sessionName);
|
|
365
|
+
}
|
|
366
|
+
catch {
|
|
367
|
+
selection = { ok: false, reason: "the pane's processes could not be read" };
|
|
368
|
+
}
|
|
369
|
+
if (!selection.ok) {
|
|
370
|
+
return {
|
|
371
|
+
emitted: { state: "unknown", detail: `No verified Pi runner for this seat: ${selection.reason}.` },
|
|
372
|
+
observed: { state: "not_verified", detail: `No verified Pi runner for this seat, so no turn can be tied to its launch: ${selection.reason}.` },
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
const tokens = processArgv(selection.command);
|
|
376
|
+
const flag = emittedEffortFromArgv("pi", tokens);
|
|
377
|
+
const value = flag.flag === "present" ? flag.value : null;
|
|
378
|
+
// ps joins argv with spaces: a bare word after the value may be the rest of a value with whitespace.
|
|
379
|
+
// Scanned as emittedEffortFromArgv does, so a value is never taken for the flag.
|
|
380
|
+
let after;
|
|
381
|
+
for (let index = 1; index < tokens.length; index += 1) {
|
|
382
|
+
if (tokens[index] === "--thinking") {
|
|
383
|
+
after = tokens[index + 2];
|
|
384
|
+
index += 1;
|
|
385
|
+
}
|
|
386
|
+
else if (tokens[index].startsWith("--thinking="))
|
|
387
|
+
after = tokens[index + 1];
|
|
388
|
+
}
|
|
389
|
+
const emitted = value !== null && after !== undefined && !after.startsWith("--")
|
|
390
|
+
? { state: "unknown", detail: "The launch command's --thinking value can't be read unambiguously (it contains whitespace)." }
|
|
391
|
+
// Compared with what the launch guard sends for the saved value, not the saved value itself.
|
|
392
|
+
: { state: "observed", value, pid: selection.pid, startedAt: selection.startedAt, matchesSaved: value === (piThinkingValue(saved.effective) ?? null) };
|
|
393
|
+
const read = selection.observation;
|
|
394
|
+
if (!read.ok)
|
|
395
|
+
return { emitted, observed: { state: "not_verified", detail: `No Pi turn from this launch can be read: ${read.reason}.` } };
|
|
396
|
+
if (!read.thinkingLevel) {
|
|
397
|
+
return { emitted, observed: { state: "not_verified", detail: "This Pi doesn't record the thinking level on its turns (Pi 0.99.0 and later do), so the level it ran at can't be shown." } };
|
|
398
|
+
}
|
|
399
|
+
// No flag sent: Pi's level comes from the model suffix or its default, so there is nothing to mismatch.
|
|
400
|
+
return { emitted, observed: {
|
|
401
|
+
state: "observed", value: read.thinkingLevel, at: read.observedAt ?? "unknown time", source: "Pi session (latest successful assistant turn; error and aborted turns are skipped)", outcome: "recorded",
|
|
402
|
+
detail: "Pi recorded this level with the turn's request: the session's level after Pi's own cap, not proof the provider applied it.",
|
|
403
|
+
...(emitted.state === "observed" && value !== null ? { matchesEmitted: read.thinkingLevel === value } : {}),
|
|
404
|
+
} };
|
|
220
405
|
}
|
|
221
406
|
lastRequestedEffort(nodeId) {
|
|
222
407
|
const row = this.db.prepare("SELECT payload, created_at FROM events WHERE node_id = ? AND type = 'node.effort_changed' ORDER BY seq DESC LIMIT 1")
|
|
@@ -1516,22 +1701,28 @@ function isStringArrayOf(value, allowed) {
|
|
|
1516
1701
|
return Array.isArray(value) && value.every((entry) => isOneOf(entry, allowed));
|
|
1517
1702
|
}
|
|
1518
1703
|
/** One line naming where the four values agree, and where they can't be seen. */
|
|
1519
|
-
function effortSummary(saved, emitted, observed) {
|
|
1704
|
+
function effortSummary(saved, emitted, observed, runtime) {
|
|
1520
1705
|
const savedText = saved.effective ? `${saved.effective} (${saved.source === "seat_choice" ? "seat choice" : "authored"})` : "no flag (the runtime's own default)";
|
|
1521
|
-
if (emitted.state !== "observed")
|
|
1522
|
-
|
|
1706
|
+
if (emitted.state !== "observed") {
|
|
1707
|
+
// Only a Pi launch value that can't be read back unambiguously leaves the native turn readable.
|
|
1708
|
+
const native = observed.state === "observed" ? `${observed.value} (${observed.source}, ${observed.at})` : "NOT VERIFIED";
|
|
1709
|
+
return `Saved: ${savedText}. Launch: unknown (${emitted.detail}) Native effort: ${native}.`;
|
|
1710
|
+
}
|
|
1523
1711
|
const launch = emitted.value ?? "no flag";
|
|
1524
|
-
|
|
1712
|
+
// A Pi saved value the launch guard leaves out never applies, so it isn't reported as pending.
|
|
1713
|
+
const launchNote = runtime === "pi" && saved.effective && !piThinkingValue(saved.effective) ? " The saved value isn't sent: it doesn't pass the check set-effort uses (a letter, then up to 31 letters, digits, - or _)."
|
|
1714
|
+
: emitted.matchesSaved ? "" : " This differs from the saved value: it applies at the seat's next managed continuation.";
|
|
1525
1715
|
if (observed.state !== "observed")
|
|
1526
1716
|
return `Saved: ${savedText}. Launch sent: ${launch}.${launchNote} Native effort: NOT VERIFIED (${observed.detail})`;
|
|
1527
|
-
const sent = observed.matchesEmitted
|
|
1528
|
-
? `${observed.value}, not the ${launch}
|
|
1529
|
-
|
|
1717
|
+
const sent = observed.matchesEmitted !== false ? observed.value
|
|
1718
|
+
: runtime === "pi" ? `${observed.value}, not the ${launch} sent at launch (Pi caps a level the model doesn't offer, ignores one it doesn't know, and the level can change inside the session)`
|
|
1719
|
+
: `${observed.value}, not the ${launch} the launch sent (changed or overridden inside the session)`;
|
|
1530
1720
|
const verdict = observed.outcome === "accepted" ? "accepted by the service for that turn"
|
|
1531
1721
|
: observed.outcome === "rejected" ? `REJECTED (${observed.detail})`
|
|
1532
1722
|
: observed.outcome === "failed" || observed.outcome === "interrupted" ? (observed.detail ?? "not judged").replace(/\.$/, "")
|
|
1533
1723
|
: observed.outcome === "pending" ? "its turn hasn't finished, so not yet known whether it was taken"
|
|
1534
|
-
: "applied level NOT VERIFIED (
|
|
1724
|
+
: runtime === "pi" ? "applied level NOT VERIFIED (Pi records the level it requested, not what the provider ran)"
|
|
1725
|
+
: "applied level NOT VERIFIED (whether this is after any model fallback isn't shown)";
|
|
1535
1726
|
return `Saved: ${savedText}. Launch sent: ${launch}.${launchNote} The session sent ${sent} with its latest turn (${observed.source}, ${observed.at}): ${verdict}.`;
|
|
1536
1727
|
}
|
|
1537
1728
|
//# sourceMappingURL=seat-lifecycle-service.js.map
|