@openrig/cli 0.7.7 → 0.7.8
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/openshell/Dockerfile +15 -0
- package/daemon/assets/openshell/README.md +137 -0
- package/daemon/assets/openshell/agents/coordinator/agent.yaml +20 -0
- package/daemon/assets/openshell/agents/coordinator/role.md +1 -0
- package/daemon/assets/openshell/agents/worker/agent.yaml +20 -0
- package/daemon/assets/openshell/agents/worker/role.md +3 -0
- package/daemon/assets/openshell/claude-code-provider.yaml +55 -0
- package/daemon/assets/openshell/driver-v1.schema.json +81 -0
- package/daemon/assets/openshell/guest.py +306 -0
- package/daemon/assets/openshell/policy.yaml +33 -0
- package/daemon/assets/openshell/preset.yaml +12 -0
- package/daemon/assets/openshell/rig.yaml +20 -0
- package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +1 -1
- package/daemon/context-packs/help/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +16 -6
- package/daemon/context-packs/reference/getting-started.md +8 -3
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +69 -12
- package/daemon/context-packs/reference/whats-new.md +119 -15
- 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/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
- package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/seat-continuity-and-handover/SKILL.md +1 -1
- package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
- package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
- package/daemon/context-packs/world-example/manifest.yaml +1 -1
- package/daemon/context-packs/world-public/manifest.yaml +1 -1
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +37 -6
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/claude-resume.d.ts +2 -1
- package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-resume.js +6 -3
- package/daemon/dist/adapters/claude-resume.js.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts +4 -7
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +86 -33
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts +13 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.js +28 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/openshell-driver.d.ts +39 -0
- package/daemon/dist/adapters/openshell-driver.d.ts.map +1 -0
- package/daemon/dist/adapters/openshell-driver.js +139 -0
- package/daemon/dist/adapters/openshell-driver.js.map +1 -0
- package/daemon/dist/adapters/openshell-podman-observer.d.ts +30 -0
- package/daemon/dist/adapters/openshell-podman-observer.d.ts.map +1 -0
- package/daemon/dist/adapters/openshell-podman-observer.js +94 -0
- package/daemon/dist/adapters/openshell-podman-observer.js.map +1 -0
- package/daemon/dist/adapters/pi-openrouter-charge.d.ts +1 -0
- package/daemon/dist/adapters/pi-openrouter-charge.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-openrouter-charge.js +17 -3
- package/daemon/dist/adapters/pi-openrouter-charge.js.map +1 -1
- package/daemon/dist/adapters/tmux-control.d.ts +12 -6
- package/daemon/dist/adapters/tmux-control.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux-control.js +42 -21
- package/daemon/dist/adapters/tmux-control.js.map +1 -1
- package/daemon/dist/adapters/tmux-server.d.ts +6 -3
- package/daemon/dist/adapters/tmux-server.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux-server.js +13 -8
- package/daemon/dist/adapters/tmux-server.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +8 -2
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +38 -11
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +8 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/142_node_claude_mcp.d.ts +3 -0
- package/daemon/dist/db/migrations/142_node_claude_mcp.d.ts.map +1 -0
- package/daemon/dist/db/migrations/142_node_claude_mcp.js +5 -0
- package/daemon/dist/db/migrations/142_node_claude_mcp.js.map +1 -0
- package/daemon/dist/db/migrations/143_activity_grants.d.ts +8 -0
- package/daemon/dist/db/migrations/143_activity_grants.d.ts.map +1 -0
- package/daemon/dist/db/migrations/143_activity_grants.js +22 -0
- package/daemon/dist/db/migrations/143_activity_grants.js.map +1 -0
- package/daemon/dist/db/migrations/144_environment_bindings.d.ts +4 -0
- package/daemon/dist/db/migrations/144_environment_bindings.d.ts.map +1 -0
- package/daemon/dist/db/migrations/144_environment_bindings.js +31 -0
- package/daemon/dist/db/migrations/144_environment_bindings.js.map +1 -0
- package/daemon/dist/db/migrations/145_node_permissions_to.d.ts +5 -0
- package/daemon/dist/db/migrations/145_node_permissions_to.d.ts.map +1 -0
- package/daemon/dist/db/migrations/145_node_permissions_to.js +7 -0
- package/daemon/dist/db/migrations/145_node_permissions_to.js.map +1 -0
- package/daemon/dist/domain/active-occupant.d.ts +2 -0
- package/daemon/dist/domain/active-occupant.d.ts.map +1 -1
- package/daemon/dist/domain/active-occupant.js +9 -1
- package/daemon/dist/domain/active-occupant.js.map +1 -1
- package/daemon/dist/domain/activity-grants.d.ts +63 -0
- package/daemon/dist/domain/activity-grants.d.ts.map +1 -0
- package/daemon/dist/domain/activity-grants.js +106 -0
- package/daemon/dist/domain/activity-grants.js.map +1 -0
- package/daemon/dist/domain/agent-images/agent-image-library-service.d.ts.map +1 -1
- package/daemon/dist/domain/agent-images/agent-image-library-service.js +5 -2
- package/daemon/dist/domain/agent-images/agent-image-library-service.js.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +11 -4
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +34 -10
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/claude-mcp.d.ts +10 -0
- package/daemon/dist/domain/claude-mcp.d.ts.map +1 -0
- package/daemon/dist/domain/claude-mcp.js +19 -0
- package/daemon/dist/domain/claude-mcp.js.map +1 -0
- package/daemon/dist/domain/codex-owned-plugin-trust.d.ts.map +1 -1
- package/daemon/dist/domain/codex-owned-plugin-trust.js +2 -1
- package/daemon/dist/domain/codex-owned-plugin-trust.js.map +1 -1
- package/daemon/dist/domain/community-harness-presets.d.ts +2 -1
- package/daemon/dist/domain/community-harness-presets.d.ts.map +1 -1
- package/daemon/dist/domain/community-harness-presets.js +3 -2
- package/daemon/dist/domain/community-harness-presets.js.map +1 -1
- package/daemon/dist/domain/context-monitor.d.ts +2 -2
- package/daemon/dist/domain/context-monitor.d.ts.map +1 -1
- package/daemon/dist/domain/context-monitor.js +8 -2
- package/daemon/dist/domain/context-monitor.js.map +1 -1
- package/daemon/dist/domain/desired-claude-activity-hooks.d.ts +21 -0
- package/daemon/dist/domain/desired-claude-activity-hooks.d.ts.map +1 -0
- package/daemon/dist/domain/desired-claude-activity-hooks.js +30 -0
- package/daemon/dist/domain/desired-claude-activity-hooks.js.map +1 -0
- package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/draft-aware-delivery.js +6 -2
- package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
- package/daemon/dist/domain/environment-artifacts.d.ts +49 -0
- package/daemon/dist/domain/environment-artifacts.d.ts.map +1 -0
- package/daemon/dist/domain/environment-artifacts.js +158 -0
- package/daemon/dist/domain/environment-artifacts.js.map +1 -0
- package/daemon/dist/domain/environment-lifecycle.d.ts +119 -0
- package/daemon/dist/domain/environment-lifecycle.d.ts.map +1 -0
- package/daemon/dist/domain/environment-lifecycle.js +461 -0
- package/daemon/dist/domain/environment-lifecycle.js.map +1 -0
- package/daemon/dist/domain/environment-platform.d.ts +121 -0
- package/daemon/dist/domain/environment-platform.d.ts.map +1 -0
- package/daemon/dist/domain/environment-platform.js +280 -0
- package/daemon/dist/domain/environment-platform.js.map +1 -0
- package/daemon/dist/domain/environment-startup.d.ts +41 -0
- package/daemon/dist/domain/environment-startup.d.ts.map +1 -0
- package/daemon/dist/domain/environment-startup.js +281 -0
- package/daemon/dist/domain/environment-startup.js.map +1 -0
- package/daemon/dist/domain/expected-conversation.d.ts +20 -0
- package/daemon/dist/domain/expected-conversation.d.ts.map +1 -0
- package/daemon/dist/domain/expected-conversation.js +101 -0
- package/daemon/dist/domain/expected-conversation.js.map +1 -0
- package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts +8 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.js +61 -4
- package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.d.ts +2 -0
- package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.js +40 -8
- package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +16 -0
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +216 -7
- package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts +14 -0
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.js +9 -1
- package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.js +9 -4
- package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts +2 -0
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js +6 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
- package/daemon/dist/domain/hosts/hosts-registry-writer.d.ts +22 -0
- package/daemon/dist/domain/hosts/hosts-registry-writer.d.ts.map +1 -1
- package/daemon/dist/domain/hosts/hosts-registry-writer.js +116 -0
- package/daemon/dist/domain/hosts/hosts-registry-writer.js.map +1 -1
- package/daemon/dist/domain/kernel-hook-review.d.ts +16 -0
- package/daemon/dist/domain/kernel-hook-review.d.ts.map +1 -0
- package/daemon/dist/domain/kernel-hook-review.js +49 -0
- package/daemon/dist/domain/kernel-hook-review.js.map +1 -0
- package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +3 -0
- package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js +20 -5
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -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 +10 -6
- package/daemon/dist/domain/model-divergence/current-generation-record.js.map +1 -1
- package/daemon/dist/domain/native-process-lineage.d.ts +3 -0
- package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
- package/daemon/dist/domain/native-process-lineage.js +34 -1
- package/daemon/dist/domain/native-process-lineage.js.map +1 -1
- package/daemon/dist/domain/native-resume-probe.d.ts +2 -1
- package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
- package/daemon/dist/domain/native-resume-probe.js +4 -2
- package/daemon/dist/domain/native-resume-probe.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +18 -8
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/node-launcher.d.ts +3 -0
- package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/node-launcher.js +6 -0
- package/daemon/dist/domain/node-launcher.js.map +1 -1
- package/daemon/dist/domain/outbox-handler.d.ts +12 -0
- package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
- package/daemon/dist/domain/outbox-handler.js +32 -3
- package/daemon/dist/domain/outbox-handler.js.map +1 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.d.ts +10 -0
- package/daemon/dist/domain/policies/parked-owner-consumer.d.ts.map +1 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.js +60 -4
- package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
- package/daemon/dist/domain/provider/claude-seat-switch.d.ts +9 -3
- package/daemon/dist/domain/provider/claude-seat-switch.d.ts.map +1 -1
- package/daemon/dist/domain/provider/claude-seat-switch.js +100 -17
- package/daemon/dist/domain/provider/claude-seat-switch.js.map +1 -1
- package/daemon/dist/domain/provider/provider-service-impl.js +1 -1
- package/daemon/dist/domain/provider/provider-service-impl.js.map +1 -1
- package/daemon/dist/domain/provider/provider-service.d.ts +32 -2
- package/daemon/dist/domain/provider/provider-service.d.ts.map +1 -1
- package/daemon/dist/domain/provider/provider-types.d.ts +1 -1
- package/daemon/dist/domain/provider/provider-types.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +36 -5
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +155 -37
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +31 -0
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.d.ts +3 -0
- package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +124 -25
- package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
- package/daemon/dist/domain/restore-check-service.d.ts +2 -7
- package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
- package/daemon/dist/domain/restore-check-service.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +35 -3
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +166 -21
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.d.ts +2 -1
- package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.js +20 -6
- package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
- package/daemon/dist/domain/rig-expansion-service.js +1 -1
- package/daemon/dist/domain/rig-expansion-service.js.map +1 -1
- package/daemon/dist/domain/rig-repository.d.ts +10 -0
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +37 -0
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-codec.js +4 -0
- package/daemon/dist/domain/rigspec-codec.js.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.d.ts +8 -0
- package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.js +60 -2
- package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +19 -4
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-schema.js +24 -1
- package/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/daemon/dist/domain/runner-permissions.d.ts +135 -0
- package/daemon/dist/domain/runner-permissions.d.ts.map +1 -0
- package/daemon/dist/domain/runner-permissions.js +318 -0
- package/daemon/dist/domain/runner-permissions.js.map +1 -0
- package/daemon/dist/domain/runtime-adapter.d.ts +10 -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-effort.d.ts +6 -0
- package/daemon/dist/domain/seat-effort.d.ts.map +1 -1
- package/daemon/dist/domain/seat-effort.js +0 -2
- package/daemon/dist/domain/seat-effort.js.map +1 -1
- package/daemon/dist/domain/seat-handover-planner.js +1 -1
- package/daemon/dist/domain/seat-handover-planner.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts +2 -0
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +45 -28
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +24 -2
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +62 -1
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.js +6 -1
- package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.js +4 -0
- package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
- package/daemon/dist/domain/seat-skill-storage.d.ts +6 -4
- package/daemon/dist/domain/seat-skill-storage.d.ts.map +1 -1
- package/daemon/dist/domain/seat-skill-storage.js +25 -5
- package/daemon/dist/domain/seat-skill-storage.js.map +1 -1
- package/daemon/dist/domain/seat-status-service.d.ts +5 -0
- package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-status-service.js +9 -0
- package/daemon/dist/domain/seat-status-service.js.map +1 -1
- package/daemon/dist/domain/self-attach-service.d.ts +8 -1
- package/daemon/dist/domain/self-attach-service.d.ts.map +1 -1
- package/daemon/dist/domain/self-attach-service.js +26 -0
- package/daemon/dist/domain/self-attach-service.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +10 -0
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +112 -10
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
- package/daemon/dist/domain/snapshot-capture.js +14 -0
- package/daemon/dist/domain/snapshot-capture.js.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +32 -1
- package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts +1 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +1 -0
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-follow-view.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-follow-view.js +22 -4
- package/daemon/dist/domain/terminal/herdr-follow-view.js.map +1 -1
- package/daemon/dist/domain/terminal/scope-task-terminal-view.d.ts +12 -1
- package/daemon/dist/domain/terminal/scope-task-terminal-view.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/scope-task-terminal-view.js +120 -18
- package/daemon/dist/domain/terminal/scope-task-terminal-view.js.map +1 -1
- package/daemon/dist/domain/terminal/terminal-following.js +1 -1
- package/daemon/dist/domain/terminal/terminal-following.js.map +1 -1
- package/daemon/dist/domain/terminal/terminal-provider.d.ts +2 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.d.ts +3 -2
- package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.js +18 -27
- package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
- package/daemon/dist/domain/terminal/view-composer.d.ts +6 -3
- package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/view-composer.js +15 -5
- package/daemon/dist/domain/terminal/view-composer.js.map +1 -1
- package/daemon/dist/domain/tmux-server-selection.d.ts +47 -0
- package/daemon/dist/domain/tmux-server-selection.d.ts.map +1 -0
- package/daemon/dist/domain/tmux-server-selection.js +220 -0
- package/daemon/dist/domain/tmux-server-selection.js.map +1 -0
- package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
- package/daemon/dist/domain/transcript-store.js +8 -5
- package/daemon/dist/domain/transcript-store.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +38 -0
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-browser.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-browser.js +3 -1
- package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.js +9 -0
- package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.d.ts +1 -0
- package/daemon/dist/domain/watchdog-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.js +15 -3
- package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts +2 -0
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +3 -1
- package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
- package/daemon/dist/domain/workflow-runtime.d.ts +1 -1
- package/daemon/dist/index.d.ts +4 -0
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +14 -0
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/routes/activity.d.ts +4 -0
- package/daemon/dist/routes/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +258 -18
- package/daemon/dist/routes/activity.js.map +1 -1
- package/daemon/dist/routes/compaction.js +4 -2
- package/daemon/dist/routes/compaction.js.map +1 -1
- package/daemon/dist/routes/environments.d.ts +3 -0
- package/daemon/dist/routes/environments.d.ts.map +1 -0
- package/daemon/dist/routes/environments.js +104 -0
- package/daemon/dist/routes/environments.js.map +1 -0
- package/daemon/dist/routes/hosts.d.ts.map +1 -1
- package/daemon/dist/routes/hosts.js +80 -4
- package/daemon/dist/routes/hosts.js.map +1 -1
- package/daemon/dist/routes/provider.d.ts.map +1 -1
- package/daemon/dist/routes/provider.js +53 -7
- package/daemon/dist/routes/provider.js.map +1 -1
- package/daemon/dist/routes/restore-check.d.ts.map +1 -1
- package/daemon/dist/routes/restore-check.js +5 -19
- package/daemon/dist/routes/restore-check.js.map +1 -1
- package/daemon/dist/routes/rigs.js +3 -0
- package/daemon/dist/routes/rigs.js.map +1 -1
- package/daemon/dist/routes/rigspec.d.ts.map +1 -1
- package/daemon/dist/routes/rigspec.js +8 -3
- package/daemon/dist/routes/rigspec.js.map +1 -1
- package/daemon/dist/routes/seat.d.ts.map +1 -1
- package/daemon/dist/routes/seat.js +29 -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 +66 -20
- 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 +23 -2
- package/daemon/dist/routes/transport.js.map +1 -1
- package/daemon/dist/server.d.ts +6 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +56 -1
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts +2 -0
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +61 -26
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/agent-startup-guide.md +4 -0
- package/daemon/docs/reference/author-contracts.md +6 -6
- package/daemon/docs/reference/community-harness-examples/dsh/README.md +71 -0
- package/daemon/docs/reference/community-harness-examples/dsh/dsh.yaml +20 -0
- package/daemon/docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs +543 -0
- package/daemon/docs/reference/community-harness-examples/openshell/README.md +5 -0
- package/daemon/docs/reference/community-harness-presets.md +25 -1
- package/daemon/docs/reference/execution-platform-contract.md +1 -1
- package/daemon/docs/reference/getting-started.md +8 -3
- package/daemon/docs/reference/harness-runner-contract.md +151 -16
- package/daemon/docs/reference/pi-tool-selection-recovery.md +83 -0
- package/daemon/docs/reference/quickstart.md +1 -1
- package/daemon/docs/reference/rig-spec.md +69 -12
- package/daemon/docs/reference/runner-conformance/README.md +75 -0
- package/daemon/docs/reference/runner-conformance/check-runner.mjs +698 -0
- package/daemon/docs/reference/runner-conformance/fake-acp-agent.mjs +143 -0
- package/daemon/docs/reference/terminal-sessions.md +85 -9
- package/daemon/docs/reference/tmux-servers.md +166 -0
- package/daemon/docs/reference/whats-new.md +119 -15
- package/dist/acp/connector.d.ts.map +1 -1
- package/dist/acp/connector.js +6 -1
- package/dist/acp/connector.js.map +1 -1
- package/dist/build-info.js +3 -3
- package/dist/client.d.ts +3 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +28 -0
- package/dist/client.js.map +1 -1
- package/dist/commands/attach.d.ts +1 -0
- package/dist/commands/attach.d.ts.map +1 -1
- package/dist/commands/attach.js +8 -2
- package/dist/commands/attach.js.map +1 -1
- package/dist/commands/compact.d.ts.map +1 -1
- package/dist/commands/compact.js +7 -4
- package/dist/commands/compact.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +8 -3
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +7 -1
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/destroy.d.ts.map +1 -1
- package/dist/commands/destroy.js +2 -0
- package/dist/commands/destroy.js.map +1 -1
- package/dist/commands/doctor.d.ts +8 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +79 -5
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/env.js +1 -1
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/environment.d.ts +8 -0
- package/dist/commands/environment.d.ts.map +1 -0
- package/dist/commands/environment.js +194 -0
- package/dist/commands/environment.js.map +1 -0
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +5 -2
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/host.d.ts.map +1 -1
- package/dist/commands/host.js +77 -7
- package/dist/commands/host.js.map +1 -1
- package/dist/commands/provider.d.ts.map +1 -1
- package/dist/commands/provider.js +2 -0
- package/dist/commands/provider.js.map +1 -1
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +12 -2
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +54 -4
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +18 -0
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/terminal.d.ts +2 -0
- package/dist/commands/terminal.d.ts.map +1 -1
- package/dist/commands/terminal.js +31 -2
- package/dist/commands/terminal.js.map +1 -1
- package/dist/commands/tui.d.ts +3 -2
- package/dist/commands/tui.d.ts.map +1 -1
- package/dist/commands/tui.js.map +1 -1
- package/dist/config-store.d.ts +3 -1
- package/dist/config-store.d.ts.map +1 -1
- package/dist/config-store.js +10 -0
- package/dist/config-store.js.map +1 -1
- package/dist/cross-host-target.d.ts.map +1 -1
- package/dist/cross-host-target.js +3 -1
- package/dist/cross-host-target.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts +6 -0
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +66 -4
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/daemon-reachability.d.ts +2 -1
- package/dist/daemon-reachability.d.ts.map +1 -1
- package/dist/daemon-reachability.js +3 -2
- package/dist/daemon-reachability.js.map +1 -1
- package/dist/destroy-helpers.d.ts +3 -2
- package/dist/destroy-helpers.d.ts.map +1 -1
- package/dist/destroy-helpers.js +6 -3
- package/dist/destroy-helpers.js.map +1 -1
- package/dist/host-bindings.js +1 -1
- package/dist/host-bindings.js.map +1 -1
- package/dist/host-registry.d.ts +22 -0
- package/dist/host-registry.d.ts.map +1 -1
- package/dist/host-registry.js +121 -0
- package/dist/host-registry.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/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +36 -2
- package/dist/mcp-server.js.map +1 -1
- package/dist/openrig-compat.d.ts +1 -1
- package/dist/openrig-compat.d.ts.map +1 -1
- package/dist/openrig-compat.js +2 -2
- package/dist/openrig-compat.js.map +1 -1
- package/dist/shared-tui.d.ts +4 -2
- package/dist/shared-tui.d.ts.map +1 -1
- package/dist/shared-tui.js +4 -11
- package/dist/shared-tui.js.map +1 -1
- package/dist/terminal-window.d.ts.map +1 -1
- package/dist/terminal-window.js +34 -29
- package/dist/terminal-window.js.map +1 -1
- package/dist/tmux-attachment.d.ts +17 -0
- package/dist/tmux-attachment.d.ts.map +1 -0
- package/dist/tmux-attachment.js +89 -0
- package/dist/tmux-attachment.js.map +1 -0
- package/package.json +2 -2
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +8 -3
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +7 -1
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/terminals/terminal-model.d.ts.map +1 -1
- package/tui/dist/terminals/terminal-model.js +2 -1
- package/tui/dist/terminals/terminal-model.js.map +1 -1
- package/ui/dist/assets/{index-CMBgYrS7.js → index-Ch6UxNld.js} +88 -88
- package/ui/dist/index.html +1 -1
|
@@ -14,6 +14,7 @@ import { isBoundTerminalSeat } from "./terminal-seat.js";
|
|
|
14
14
|
import { renderQueueHandoffNudge } from "./queue-nudge-text.js";
|
|
15
15
|
import { getSelfHostId } from "./hosts/fanout-contract.js";
|
|
16
16
|
import { parseSessionName, isHumanSeatSessionRef } from "./session-name.js";
|
|
17
|
+
import { runnerPermissionOrigin } from "./runner-permissions.js";
|
|
17
18
|
import { parseReplyToChoice, parseReplyToThreadMissing, formatReplyToChoice, describeReplyToFallback, REPLY_TO_CHOICE_ACTOR } from "./reply-to-choice.js";
|
|
18
19
|
import { classifyDestination } from "./gateway/destination-resolver.js";
|
|
19
20
|
import { join } from "node:path";
|
|
@@ -28,6 +29,10 @@ import { WatchdogJobsRepository } from "./watchdog-jobs-repository.js";
|
|
|
28
29
|
import { armQueueWait, backOffQueueWait, refreshQueueWaits, evaluateQueueWait, retargetQueueWait, isQueueWait } from "./queue-wait-backoff.js";
|
|
29
30
|
import { parseHumanQuestions, unansweredQuestions, describeTypedReplyPlacement } from "./human-questions.js";
|
|
30
31
|
import { slackMicros } from "./gateway/slack/state-store.js";
|
|
32
|
+
/** A direct ask's answer row ID: from the ask, or from the ask and the park episode its answer belongs to. */
|
|
33
|
+
function humanAnswerId(askId, episodeKey) {
|
|
34
|
+
return `qitem-human-answer-${createHash("sha256").update(episodeKey ? `${askId}\n${episodeKey}` : askId).digest("hex").slice(0, 20)}`;
|
|
35
|
+
}
|
|
31
36
|
export const QUEUE_STATES = [
|
|
32
37
|
"pending",
|
|
33
38
|
"in-progress",
|
|
@@ -1263,7 +1268,7 @@ export class QueueRepository {
|
|
|
1263
1268
|
* primary user, who may answer anyone's ask. A shared channel's rows are correspondence, never an answer. */
|
|
1264
1269
|
getHumanAnswer(qitemId, actorSession, opts = {}) {
|
|
1265
1270
|
const ask = this.getById(qitemId);
|
|
1266
|
-
if (!this.hasReplyToColumn || !ask || this.isSharedChannel(actorSession) || (ask
|
|
1271
|
+
if (!this.hasReplyToColumn || !ask || this.isSharedChannel(actorSession) || (!this.answersAsk(ask, actorSession) && !opts.primaryUser)
|
|
1267
1272
|
|| ask.humanIntent === "update" || !this.isPersonAddress(ask.destinationSession))
|
|
1268
1273
|
return null;
|
|
1269
1274
|
const row = this.db.prepare(`SELECT qitem_id FROM queue_items
|
|
@@ -1274,15 +1279,38 @@ export class QueueRepository {
|
|
|
1274
1279
|
return row ? this.getById(row.qitem_id) : null;
|
|
1275
1280
|
}
|
|
1276
1281
|
/** The lookup and create's insert run synchronously before its first delivery await.
|
|
1277
|
-
* Every new surface uses the same ID; old IDs and their original bodies remain intact.
|
|
1282
|
+
* Every new surface uses the same ID; old IDs and their original bodies remain intact. An answer to a decision parked
|
|
1283
|
+
* on the person it asked belongs to that park's question (`episodeKey`): its ID includes it, and only that ID counts. */
|
|
1278
1284
|
async createHumanAnswer(input) {
|
|
1279
|
-
const
|
|
1285
|
+
const { episodeKey, ...create } = input;
|
|
1286
|
+
// A runner's permission request is answered in its ask, and the runner reads the answer back. No reply row: it
|
|
1287
|
+
// would wake the runner's terminal, where typed text reads as a prompt to its agent.
|
|
1288
|
+
const ask = this.getById(input.inboundReplyTo);
|
|
1289
|
+
if (ask && runnerPermissionOrigin(ask))
|
|
1290
|
+
return ask;
|
|
1291
|
+
const qitemId = humanAnswerId(input.inboundReplyTo, episodeKey);
|
|
1292
|
+
const existing = episodeKey ? this.getById(qitemId) : this.getHumanAnswer(input.inboundReplyTo, input.sourceSession);
|
|
1280
1293
|
if (existing)
|
|
1281
1294
|
return existing;
|
|
1282
|
-
return this.create({ ...input,
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1295
|
+
return this.create({ ...create, qitemId, tags: [...new Set([...(input.tags ?? []), "human-answer"])] });
|
|
1296
|
+
}
|
|
1297
|
+
/** Every answer this person returned to the ask (one per park), oldest first: after close, a replay finds the one its
|
|
1298
|
+
* event returned or was absorbed into, whichever park it answered. */
|
|
1299
|
+
listHumanAnswers(qitemId, actorSession) {
|
|
1300
|
+
const ask = this.getById(qitemId);
|
|
1301
|
+
if (!this.hasReplyToColumn || !ask || ask.destinationSession !== actorSession)
|
|
1302
|
+
return [];
|
|
1303
|
+
return this.db.prepare(`SELECT qitem_id, body FROM queue_items
|
|
1304
|
+
WHERE reply_to = ? AND source_session = ? AND destination_session = ?
|
|
1305
|
+
AND EXISTS (SELECT 1 FROM json_each(queue_items.tags) WHERE value = 'human-answer')
|
|
1306
|
+
ORDER BY ts_created, rowid`).all(qitemId, actorSession, ask.sourceSession)
|
|
1307
|
+
.map((row) => ({ qitemId: row.qitem_id, body: row.body ?? "" }));
|
|
1308
|
+
}
|
|
1309
|
+
/** This person's answer to the current question of a decision parked on them, if one was returned. */
|
|
1310
|
+
currentEpisodeAnswer(qitemId, actorSession) {
|
|
1311
|
+
const episode = this.currentHumanRequiredEpisode(qitemId);
|
|
1312
|
+
const row = episode ? this.getById(humanAnswerId(qitemId, episode.key)) : null;
|
|
1313
|
+
return row?.sourceSession === actorSession ? row : null;
|
|
1286
1314
|
}
|
|
1287
1315
|
async create(input) {
|
|
1288
1316
|
// FOUNDER ROOT INVARIANT (2026-08-27, supersedes 51-09 incr 4 / ruling cb19867f Q2):
|
|
@@ -1540,12 +1568,44 @@ export class QueueRepository {
|
|
|
1540
1568
|
}
|
|
1541
1569
|
}
|
|
1542
1570
|
/** A person by address or by the registry: a registered person may be addressed as their seat or an alias. */
|
|
1571
|
+
/** A runner's permission ask whose seat has since been relaunched can't be answered: its request died with the
|
|
1572
|
+
* occupant. Close it (canceled), so the person sees it isn't waiting, and return true. An unreadable ledger
|
|
1573
|
+
* closes nothing. */
|
|
1574
|
+
closeStaleRunnerPermission(qitemId) {
|
|
1575
|
+
const item = this.getById(qitemId);
|
|
1576
|
+
const origin = item?.state === "pending" ? runnerPermissionOrigin(item) : null;
|
|
1577
|
+
if (!item || !origin)
|
|
1578
|
+
return false;
|
|
1579
|
+
let current;
|
|
1580
|
+
try {
|
|
1581
|
+
current = this.db.prepare("SELECT generation_uuid FROM occupant_tenures WHERE node_id = ? ORDER BY generation_ordinal DESC LIMIT 1")
|
|
1582
|
+
.get(origin.nodeId)?.generation_uuid ?? null;
|
|
1583
|
+
}
|
|
1584
|
+
catch {
|
|
1585
|
+
return false;
|
|
1586
|
+
}
|
|
1587
|
+
if (current === origin.generation)
|
|
1588
|
+
return false;
|
|
1589
|
+
this.update({ qitemId, actorSession: item.sourceSession, state: "canceled",
|
|
1590
|
+
transitionNote: "runner-permission-stale reason=relaunched: a later occupant holds this seat, so any answer here is not sent." });
|
|
1591
|
+
return true;
|
|
1592
|
+
}
|
|
1543
1593
|
isPersonAddress(destination) {
|
|
1544
1594
|
if (isHumanSeatSessionRef(destination))
|
|
1545
1595
|
return true;
|
|
1546
1596
|
const registry = this.loadHumanRegistryFn();
|
|
1547
1597
|
return registry.ok && resolveRegisteredHumanAddress(destination, registry.entities) !== null;
|
|
1548
1598
|
}
|
|
1599
|
+
/** Who may answer an ask: the asked person; and on a runner's permission request, any registered person, since a
|
|
1600
|
+
* person's yes counts however it arrives there. A shared channel never answers. */
|
|
1601
|
+
answersAsk(item, actorSession) {
|
|
1602
|
+
if (item.destinationSession === actorSession)
|
|
1603
|
+
return true;
|
|
1604
|
+
if (!runnerPermissionOrigin(item) || this.isSharedChannel(actorSession))
|
|
1605
|
+
return false;
|
|
1606
|
+
const registry = this.loadHumanRegistryFn();
|
|
1607
|
+
return registry.ok && resolveRegisteredHumanAddress(actorSession, registry.entities) !== null;
|
|
1608
|
+
}
|
|
1549
1609
|
/** A registered shared channel. It takes correspondence, so it never answers, approves, resolves or denies (0.7.3). */
|
|
1550
1610
|
isSharedChannel(address) {
|
|
1551
1611
|
return !!address && this.sharedChannelsFn().some((channel) => channel.address === address);
|
|
@@ -1659,10 +1719,11 @@ export class QueueRepository {
|
|
|
1659
1719
|
this.persistSummary(newId, input.summary ?? null);
|
|
1660
1720
|
this.persistEvidenceRef(newId, input.evidenceRef ?? null);
|
|
1661
1721
|
this.persistMintingGeneration(newId, input.fromSession);
|
|
1722
|
+
const carried = this.carryPermissionQuestion(source, newId, input.toSession);
|
|
1662
1723
|
const successorNotification = this.classifyOwnerNotification({
|
|
1663
1724
|
action: "create",
|
|
1664
1725
|
destinationSession: input.toSession,
|
|
1665
|
-
humanAlert: input.humanAlert,
|
|
1726
|
+
humanAlert: input.humanAlert ?? (carried ? true : undefined), // a carried permission ask alerts, as Mission Control's does
|
|
1666
1727
|
nextState: "pending",
|
|
1667
1728
|
});
|
|
1668
1729
|
this.transitionLog.append({
|
|
@@ -1810,10 +1871,11 @@ export class QueueRepository {
|
|
|
1810
1871
|
this.persistSummary(newId, input.summary ?? null);
|
|
1811
1872
|
this.persistEvidenceRef(newId, input.evidenceRef ?? null);
|
|
1812
1873
|
this.persistMintingGeneration(newId, input.fromSession);
|
|
1874
|
+
const carried = this.carryPermissionQuestion(source, newId, input.toSession);
|
|
1813
1875
|
const successorNotification = this.classifyOwnerNotification({
|
|
1814
1876
|
action: "create",
|
|
1815
1877
|
destinationSession: input.toSession,
|
|
1816
|
-
humanAlert: input.humanAlert,
|
|
1878
|
+
humanAlert: input.humanAlert ?? (carried ? true : undefined), // a carried permission ask alerts, as Mission Control's does
|
|
1817
1879
|
nextState: "pending",
|
|
1818
1880
|
});
|
|
1819
1881
|
this.transitionLog.append({
|
|
@@ -2902,25 +2964,15 @@ export class QueueRepository {
|
|
|
2902
2964
|
const result = this.db.transaction(() => {
|
|
2903
2965
|
const item = this.getById(input.qitemId);
|
|
2904
2966
|
if (item?.state !== "pending" || item.humanIntent === "update"
|
|
2905
|
-
|| (item
|
|
2967
|
+
|| (!this.answersAsk(item, input.actorSession) && !input.primaryUser)
|
|
2906
2968
|
|| !this.isPersonAddress(item.destinationSession))
|
|
2907
2969
|
return null;
|
|
2908
|
-
const text = input.decision.trim();
|
|
2909
|
-
const unanswered = this.hasHumanQuestionsColumn && text && text !== "[file reply]"
|
|
2910
|
-
? unansweredQuestions(item.humanQuestions ?? [], item.humanAnswers ?? {})
|
|
2911
|
-
: [];
|
|
2912
|
-
const question = unanswered[0];
|
|
2913
2970
|
let transitionNote = item.destinationSession === input.actorSession ? "direct human reply received"
|
|
2914
|
-
: `reply from ${input.actorSession}, the primary user at the terminal, on ${item.destinationSession}'s ask; not answered by ${item.destinationSession}
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
}
|
|
2919
|
-
const answers = { ...item.humanAnswers, [question.id]: typedReply };
|
|
2920
|
-
this.db.prepare("UPDATE queue_items SET human_answers = ? WHERE qitem_id = ?")
|
|
2921
|
-
.run(JSON.stringify(answers), input.qitemId);
|
|
2922
|
-
transitionNote += `; ${describeTypedReplyPlacement(question, typedReply)}`;
|
|
2923
|
-
}
|
|
2971
|
+
: input.primaryUser ? `reply from ${input.actorSession}, the primary user at the terminal, on ${item.destinationSession}'s ask; not answered by ${item.destinationSession}`
|
|
2972
|
+
: `reply from ${input.actorSession}, a registered person, on the runner permission request asked of ${item.destinationSession}`;
|
|
2973
|
+
const placed = this.placeTypedReply(item, input.decision);
|
|
2974
|
+
if (placed)
|
|
2975
|
+
transitionNote += `; ${placed}`;
|
|
2924
2976
|
return this.updateInTransactionalContext({
|
|
2925
2977
|
qitemId: input.qitemId,
|
|
2926
2978
|
actorSession: input.actorSession,
|
|
@@ -2936,6 +2988,29 @@ export class QueueRepository {
|
|
|
2936
2988
|
this.eventBus.notifySubscribers(event);
|
|
2937
2989
|
return true;
|
|
2938
2990
|
}
|
|
2991
|
+
/** Store a typed reply under the first unanswered question, keeping earlier clicks; the placement note, or null. */
|
|
2992
|
+
placeTypedReply(item, decision) {
|
|
2993
|
+
const text = decision.trim();
|
|
2994
|
+
const unanswered = this.hasHumanQuestionsColumn && text && text !== "[file reply]"
|
|
2995
|
+
? unansweredQuestions(item.humanQuestions ?? [], item.humanAnswers ?? {})
|
|
2996
|
+
: [];
|
|
2997
|
+
const question = unanswered[0];
|
|
2998
|
+
if (!question)
|
|
2999
|
+
return null;
|
|
3000
|
+
const typedReply = {
|
|
3001
|
+
kind: "typed-reply", text, placement: "first-unanswered", unansweredCount: unanswered.length - 1,
|
|
3002
|
+
};
|
|
3003
|
+
const answers = { ...item.humanAnswers, [question.id]: typedReply };
|
|
3004
|
+
this.db.prepare("UPDATE queue_items SET human_answers = ? WHERE qitem_id = ?").run(JSON.stringify(answers), item.qitemId);
|
|
3005
|
+
return describeTypedReplyPlacement(question, typedReply);
|
|
3006
|
+
}
|
|
3007
|
+
/** A typed reply that resumes a decision parked on the person it asked is that decision's answer, as their click is.
|
|
3008
|
+
* The write contract's resolve runs it inside its own transaction, so the answer is stored exactly when the decision resumes. */
|
|
3009
|
+
recordParkedTypedReply(qitemId, decision) {
|
|
3010
|
+
const item = this.getById(qitemId);
|
|
3011
|
+
if (item)
|
|
3012
|
+
this.placeTypedReply(item, decision);
|
|
3013
|
+
}
|
|
2939
3014
|
/**
|
|
2940
3015
|
* #193 — record one clicked answer on a pending decision that carries structured questions.
|
|
2941
3016
|
* Only the decision's own human may answer, and only while it is pending. A click may change
|
|
@@ -2947,11 +3022,13 @@ export class QueueRepository {
|
|
|
2947
3022
|
recordHumanAnswer(input) {
|
|
2948
3023
|
if (!this.hasHumanQuestionsColumn)
|
|
2949
3024
|
return { status: "not-applicable", reason: "schema" };
|
|
3025
|
+
if (this.closeStaleRunnerPermission(input.qitemId))
|
|
3026
|
+
return { status: "not-applicable", reason: "state-canceled" };
|
|
2950
3027
|
return this.db.transaction(() => {
|
|
2951
3028
|
const item = this.getById(input.qitemId);
|
|
2952
3029
|
if (!item?.humanQuestions?.length)
|
|
2953
3030
|
return { status: "not-applicable", reason: "no-questions" };
|
|
2954
|
-
if (item.state !== "pending" && !this.
|
|
3031
|
+
if (item.state !== "pending" && !this.answersPark(item, input.actorSession, input.clickedTs)) {
|
|
2955
3032
|
// Slack can redeliver the click that closed it. Only to the asked human, say whether this answer is on record.
|
|
2956
3033
|
const onRecord = item.destinationSession === input.actorSession && item.humanAnswers?.[input.questionId] === input.optionId;
|
|
2957
3034
|
const delegated = item.destinationSession === input.actorSession ? item.delegatedDecision : null;
|
|
@@ -2960,7 +3037,7 @@ export class QueueRepository {
|
|
|
2960
3037
|
return { status: "not-applicable", reason: `state-${item.state}`, ...(onRecord ? { answerOnRecord: true } : {}),
|
|
2961
3038
|
...(decidedForThem ? { decidedForThem } : {}) };
|
|
2962
3039
|
}
|
|
2963
|
-
if (item
|
|
3040
|
+
if (!this.answersAsk(item, input.actorSession) && !input.primaryUser)
|
|
2964
3041
|
return { status: "not-applicable", reason: "not-the-asked-human" };
|
|
2965
3042
|
const question = item.humanQuestions.find((q) => q.id === input.questionId);
|
|
2966
3043
|
if (!question?.options.some((o) => o.id === input.optionId))
|
|
@@ -2975,16 +3052,16 @@ export class QueueRepository {
|
|
|
2975
3052
|
return { status: "recorded", answers, complete, questions: item.humanQuestions };
|
|
2976
3053
|
})();
|
|
2977
3054
|
}
|
|
2978
|
-
/** A decision parked on the person it asked takes that person's click
|
|
2979
|
-
* the park is on them by any of their addresses, and the
|
|
2980
|
-
|
|
3055
|
+
/** A decision parked on the person it asked takes that person's click or typed reply as its answer (makeHumanReplyResolver
|
|
3056
|
+
* resumes it): the park is on them by any of their addresses, and the answer came after its current question posted. */
|
|
3057
|
+
answersPark(item, actorSession, answeredTs) {
|
|
2981
3058
|
if (item.state !== "blocked" || !item.blockedOn || !this.isPersonAddress(item.blockedOn))
|
|
2982
3059
|
return false;
|
|
2983
3060
|
if (item.destinationSession !== actorSession || this.askedSomeoneElse(actorSession, item.blockedOn))
|
|
2984
3061
|
return false;
|
|
2985
3062
|
const posted = slackMicros(this.currentHumanRequiredEpisode(item.qitemId)?.receipt?.messageTs);
|
|
2986
|
-
const
|
|
2987
|
-
return posted !== null &&
|
|
3063
|
+
const answered = slackMicros(answeredTs);
|
|
3064
|
+
return posted !== null && answered !== null && answered > posted;
|
|
2988
3065
|
}
|
|
2989
3066
|
/** A park's current question: its latest human-required transition, and that notification's final post receipt, if any. */
|
|
2990
3067
|
currentHumanRequiredEpisode(qitemId) {
|
|
@@ -3228,7 +3305,7 @@ export class QueueRepository {
|
|
|
3228
3305
|
.prepare(`SELECT ${columns} FROM queue_items ${where} ORDER BY ${orderBy} LIMIT ?`)
|
|
3229
3306
|
.all(...params);
|
|
3230
3307
|
const owners = this.transitionLog.ownerNotificationsForQitems(rows.map((row) => row.qitem_id));
|
|
3231
|
-
const ledgers = this.deliveryOutcomesFor(rows, owners);
|
|
3308
|
+
const ledgers = this.deliveryOutcomesFor(rows, owners, true);
|
|
3232
3309
|
const items = rows.map((r) => {
|
|
3233
3310
|
const ledger = ledgers.get(r.qitem_id);
|
|
3234
3311
|
const item = this.rowToItem(r, !opts?.compact, { owners: owners.get(r.qitem_id) ?? [], ledger: ledger ?? null });
|
|
@@ -3533,6 +3610,22 @@ export class QueueRepository {
|
|
|
3533
3610
|
}
|
|
3534
3611
|
/** OPR.0.5.6.14 — the one destination-classification seam, as the wake path consults it.
|
|
3535
3612
|
* Public for the single-row read route; getById itself stays free of topology reads. */
|
|
3613
|
+
/** A local, unregistered human decision remains on the attention feed; it has no gateway wake to retry.
|
|
3614
|
+
* A broken registry, an external address or any configured person is not evidence of this case. */
|
|
3615
|
+
isLocalHumanDecisionWithoutGateway(row) {
|
|
3616
|
+
if (row.state !== "pending" || row.humanIntent === "update" || row.destinationSession !== "human@kernel"
|
|
3617
|
+
|| !row.lastNudgeResult?.startsWith("unroutable:"))
|
|
3618
|
+
return false;
|
|
3619
|
+
try {
|
|
3620
|
+
const registry = this.loadHumanRegistryFn();
|
|
3621
|
+
if (registry.ok ? registry.entities.length !== 0 : registry.noHumans !== true)
|
|
3622
|
+
return false;
|
|
3623
|
+
return this.classifyDestinationOf(row.destinationSession).class === "unroutable";
|
|
3624
|
+
}
|
|
3625
|
+
catch {
|
|
3626
|
+
return false;
|
|
3627
|
+
}
|
|
3628
|
+
}
|
|
3536
3629
|
classifyDestinationOf(destinationSession) {
|
|
3537
3630
|
return classifyDestination(destinationSession, {
|
|
3538
3631
|
entities: (() => {
|
|
@@ -3691,7 +3784,7 @@ export class QueueRepository {
|
|
|
3691
3784
|
/** The delivery ledger of each row, its reads batched: one read of the rows' owner notifications (unless the caller
|
|
3692
3785
|
* read them already), one of their receipts, the human registry loaded once at most. A single row's
|
|
3693
3786
|
* (deliveryOutcomeFor, show, the sweeps) is a batch of one. receiptsAfterEpisodes: read the receipts once the
|
|
3694
|
-
* episodes (and so the registry) are worked out
|
|
3787
|
+
* episodes (and so the registry) are worked out; listings and single-row projections use that ordering. */
|
|
3695
3788
|
deliveryOutcomesFor(rows, knownOwners, receiptsAfterEpisodes = false) {
|
|
3696
3789
|
const ledgers = new Map();
|
|
3697
3790
|
if (!this.hasQueueTransitionsTable || rows.length === 0)
|
|
@@ -3894,6 +3987,27 @@ export class QueueRepository {
|
|
|
3894
3987
|
* column) are unaffected; only writes when a value is present (NULL is the
|
|
3895
3988
|
* default and degrades in the Story consumer). Runs inside the caller's
|
|
3896
3989
|
* transaction (create / handoff / handoff-and-complete). */
|
|
3990
|
+
/** A runner's permission ask handed to a person: that person decides, so their row carries the agent's options, as
|
|
3991
|
+
* Mission Control's route and handoff give it. Any other row is handed on unchanged. */
|
|
3992
|
+
carryPermissionQuestion(source, successorId, toSession) {
|
|
3993
|
+
const questions = runnerPermissionOrigin(source) ? this.permissionQuestionsFor(source) : null;
|
|
3994
|
+
if (!questions || !this.hasHumanQuestionsColumn || !this.hasHumanIntentColumn || !this.isPersonAddress(toSession))
|
|
3995
|
+
return false;
|
|
3996
|
+
this.db.prepare("UPDATE queue_items SET human_questions = ?, human_intent = 'decision' WHERE qitem_id = ?")
|
|
3997
|
+
.run(JSON.stringify(questions), successorId);
|
|
3998
|
+
return true;
|
|
3999
|
+
}
|
|
4000
|
+
/** A runner permission ask's options: the row's own, or, when it came through a seat that got none (an agent seat),
|
|
4001
|
+
* the nearest earlier row's along handed_off_from. */
|
|
4002
|
+
permissionQuestionsFor(item) {
|
|
4003
|
+
let current = item;
|
|
4004
|
+
for (let hops = 0; current && runnerPermissionOrigin(current) && hops <= 10; hops++) {
|
|
4005
|
+
if (current.humanQuestions?.length)
|
|
4006
|
+
return current.humanQuestions;
|
|
4007
|
+
current = current.handedOffFrom ? this.getById(current.handedOffFrom) : null;
|
|
4008
|
+
}
|
|
4009
|
+
return null;
|
|
4010
|
+
}
|
|
3897
4011
|
persistSummary(qitemId, summary) {
|
|
3898
4012
|
if (this.hasSummaryColumn && summary !== null) {
|
|
3899
4013
|
this.db.prepare("UPDATE queue_items SET summary = ? WHERE qitem_id = ?").run(summary, qitemId);
|
|
@@ -4014,9 +4128,13 @@ export class QueueRepository {
|
|
|
4014
4128
|
// episode (same predicate as runStuckSweep), so the view must not promise that sweep.
|
|
4015
4129
|
const posted = view.state === "pending" && this.humanNotificationPostedThisEpisode(qitemId, listed);
|
|
4016
4130
|
const onSteering = !posted && view.state === "pending" && this.humanAskWithoutAlert(qitemId, listed);
|
|
4017
|
-
const
|
|
4131
|
+
const row = !posted && !onSteering ? this.db.prepare(`SELECT state, ${this.hasHumanIntentColumn ? "human_intent" : "NULL AS human_intent"}, destination_session, last_nudge_result FROM queue_items WHERE qitem_id = ?`).get(qitemId) : undefined;
|
|
4132
|
+
const noticeOutcome = listed ? listed.ledger?.outcome : this.deliveryOutcomeFor(qitemId)?.outcome;
|
|
4133
|
+
const localOnly = !!row && noticeOutcome !== "never-posted" && noticeOutcome !== "transport-failed"
|
|
4134
|
+
&& this.isLocalHumanDecisionWithoutGateway({ state: row.state, humanIntent: row.human_intent, destinationSession: row.destination_session, lastNudgeResult: row.last_nudge_result });
|
|
4135
|
+
const awaitingHuman = posted || onSteering || localOnly;
|
|
4018
4136
|
if (awaitingHuman) {
|
|
4019
|
-
view.nextBackstop = { owner: view.owner, mechanism: onSteering
|
|
4137
|
+
view.nextBackstop = { owner: view.owner, mechanism: localOnly ? "local attention feed (no registered human gateway)" : onSteering
|
|
4020
4138
|
? "none (on Steering for the human, with no Slack alert; awaiting their decision)"
|
|
4021
4139
|
: "none (posted to the human; awaiting their decision)", dueAt: null, intervalSeconds: null };
|
|
4022
4140
|
}
|
|
@@ -4027,7 +4145,7 @@ export class QueueRepository {
|
|
|
4027
4145
|
return view;
|
|
4028
4146
|
}
|
|
4029
4147
|
const recovery = readWakeLadderBackstop(this.db, qitemId, target => this.acceptsDestination(target));
|
|
4030
|
-
if (recovery) {
|
|
4148
|
+
if (recovery && !localOnly) {
|
|
4031
4149
|
if (!awaitingHuman)
|
|
4032
4150
|
view.laterBackstop = { ...view.nextBackstop, note: "Conditional safety net; current delivery/recovery ownership is evaluated first." };
|
|
4033
4151
|
view.nextBackstop = recovery;
|