@openrig/cli 0.7.15 → 0.7.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/README.md +26 -7
- package/daemon/assets/plugins/openrig/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +4 -1
- package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +1 -1
- package/daemon/assets/skills/rigs/SKILL.md +105 -30
- 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 +92 -17
- package/daemon/context-packs/reference/getting-started.md +9 -8
- package/daemon/context-packs/reference/manifest.yaml +4 -1
- package/daemon/context-packs/reference/product-journey-sdlc.md +348 -0
- package/daemon/context-packs/reference/rig-spec.md +92 -4
- package/daemon/context-packs/reference/whats-new.md +210 -5
- 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/SKILL.md +4 -1
- package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
- package/daemon/context-packs/skills/mission-slice-sop/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 +6 -3
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/codex-resume.d.ts +2 -0
- package/daemon/dist/adapters/codex-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-resume.js +28 -11
- package/daemon/dist/adapters/codex-resume.js.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts +15 -0
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +75 -28
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +3 -0
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +16 -2
- 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 +4 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/167_seat_handover_attempts.d.ts +14 -0
- package/daemon/dist/db/migrations/167_seat_handover_attempts.d.ts.map +1 -0
- package/daemon/dist/db/migrations/167_seat_handover_attempts.js +54 -0
- package/daemon/dist/db/migrations/167_seat_handover_attempts.js.map +1 -0
- package/daemon/dist/db/migrations/169_seat_runtime_home_records.d.ts +5 -0
- package/daemon/dist/db/migrations/169_seat_runtime_home_records.d.ts.map +1 -0
- package/daemon/dist/db/migrations/169_seat_runtime_home_records.js +25 -0
- package/daemon/dist/db/migrations/169_seat_runtime_home_records.js.map +1 -0
- package/daemon/dist/domain/claim-service.d.ts +1 -3
- package/daemon/dist/domain/claim-service.d.ts.map +1 -1
- package/daemon/dist/domain/claim-service.js +3 -1
- package/daemon/dist/domain/claim-service.js.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +11 -0
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +83 -36
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/codex-filesystem-preflight.d.ts +33 -0
- package/daemon/dist/domain/codex-filesystem-preflight.d.ts.map +1 -0
- package/daemon/dist/domain/codex-filesystem-preflight.js +255 -0
- package/daemon/dist/domain/codex-filesystem-preflight.js.map +1 -0
- package/daemon/dist/domain/codex-member-permissions.d.ts +23 -2
- package/daemon/dist/domain/codex-member-permissions.d.ts.map +1 -1
- package/daemon/dist/domain/codex-member-permissions.js +55 -9
- package/daemon/dist/domain/codex-member-permissions.js.map +1 -1
- package/daemon/dist/domain/codex-network-default.d.ts +13 -0
- package/daemon/dist/domain/codex-network-default.d.ts.map +1 -1
- package/daemon/dist/domain/codex-network-default.js +37 -30
- package/daemon/dist/domain/codex-network-default.js.map +1 -1
- package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
- package/daemon/dist/domain/compaction-restore-notice.js +59 -13
- package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
- package/daemon/dist/domain/destination-successor.d.ts +3 -0
- package/daemon/dist/domain/destination-successor.d.ts.map +1 -0
- package/daemon/dist/domain/destination-successor.js +49 -0
- package/daemon/dist/domain/destination-successor.js.map +1 -0
- package/daemon/dist/domain/health-passive-ceremony.d.ts +3 -0
- package/daemon/dist/domain/health-passive-ceremony.d.ts.map +1 -1
- package/daemon/dist/domain/health-passive-ceremony.js +45 -4
- package/daemon/dist/domain/health-passive-ceremony.js.map +1 -1
- package/daemon/dist/domain/hosts/fleet-scopes.d.ts +111 -0
- package/daemon/dist/domain/hosts/fleet-scopes.d.ts.map +1 -0
- package/daemon/dist/domain/hosts/fleet-scopes.js +231 -0
- package/daemon/dist/domain/hosts/fleet-scopes.js.map +1 -0
- package/daemon/dist/domain/hosts/read-through.d.ts +1 -1
- package/daemon/dist/domain/hosts/read-through.d.ts.map +1 -1
- package/daemon/dist/domain/hosts/read-through.js +4 -0
- package/daemon/dist/domain/hosts/read-through.js.map +1 -1
- package/daemon/dist/domain/native-permission-store.d.ts.map +1 -1
- package/daemon/dist/domain/native-permission-store.js +12 -5
- package/daemon/dist/domain/native-permission-store.js.map +1 -1
- package/daemon/dist/domain/native-process-lineage.d.ts +11 -1
- package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
- package/daemon/dist/domain/native-process-lineage.js +25 -4
- 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 +31 -15
- package/daemon/dist/domain/native-resume-probe.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/permission-account.d.ts.map +1 -1
- package/daemon/dist/domain/permission-account.js +8 -6
- package/daemon/dist/domain/permission-account.js.map +1 -1
- package/daemon/dist/domain/permission-drift.d.ts.map +1 -1
- package/daemon/dist/domain/permission-drift.js +1 -1
- package/daemon/dist/domain/permission-drift.js.map +1 -1
- package/daemon/dist/domain/queue-destination-check.d.ts +2 -0
- package/daemon/dist/domain/queue-destination-check.d.ts.map +1 -1
- package/daemon/dist/domain/queue-destination-check.js +8 -11
- package/daemon/dist/domain/queue-destination-check.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +20 -15
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +37 -49
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-transition-log.d.ts +6 -0
- package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
- package/daemon/dist/domain/queue-transition-log.js +9 -0
- package/daemon/dist/domain/queue-transition-log.js.map +1 -1
- package/daemon/dist/domain/queue-waiting.d.ts +4 -4
- package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
- package/daemon/dist/domain/queue-waiting.js +30 -16
- package/daemon/dist/domain/queue-waiting.js.map +1 -1
- package/daemon/dist/domain/receiver-context.js +1 -1
- package/daemon/dist/domain/receiver-context.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +40 -18
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.d.ts +17 -4
- package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.js +60 -14
- package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
- package/daemon/dist/domain/resume-token-capture.d.ts +6 -0
- package/daemon/dist/domain/resume-token-capture.d.ts.map +1 -1
- package/daemon/dist/domain/resume-token-capture.js +14 -8
- package/daemon/dist/domain/resume-token-capture.js.map +1 -1
- package/daemon/dist/domain/rig-edge-ops.js +1 -1
- package/daemon/dist/domain/rig-edge-ops.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +6 -2
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.js +21 -1
- package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
- package/daemon/dist/domain/rosters.d.ts +19 -0
- package/daemon/dist/domain/rosters.d.ts.map +1 -1
- package/daemon/dist/domain/rosters.js +69 -12
- package/daemon/dist/domain/rosters.js.map +1 -1
- package/daemon/dist/domain/runtime-adapter.d.ts +15 -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-delivery-guard.d.ts +8 -2
- package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.js +38 -3
- package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
- package/daemon/dist/domain/seat-handover-attempts.d.ts +50 -0
- package/daemon/dist/domain/seat-handover-attempts.d.ts.map +1 -0
- package/daemon/dist/domain/seat-handover-attempts.js +75 -0
- package/daemon/dist/domain/seat-handover-attempts.js.map +1 -0
- package/daemon/dist/domain/seat-handover-service.d.ts +64 -1
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +437 -28
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +47 -2
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +48 -2
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-runtime-home-record-types.d.ts +16 -0
- package/daemon/dist/domain/seat-runtime-home-record-types.d.ts.map +1 -0
- package/daemon/dist/domain/seat-runtime-home-record-types.js +2 -0
- package/daemon/dist/domain/seat-runtime-home-record-types.js.map +1 -0
- package/daemon/dist/domain/seat-runtime-home-record.d.ts +173 -0
- package/daemon/dist/domain/seat-runtime-home-record.d.ts.map +1 -0
- package/daemon/dist/domain/seat-runtime-home-record.js +317 -0
- package/daemon/dist/domain/seat-runtime-home-record.js.map +1 -0
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts +7 -0
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.js +47 -2
- package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
- package/daemon/dist/domain/seat-skill-storage.d.ts +16 -1
- package/daemon/dist/domain/seat-skill-storage.d.ts.map +1 -1
- package/daemon/dist/domain/seat-skill-storage.js +178 -1
- package/daemon/dist/domain/seat-skill-storage.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +1 -0
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +6 -2
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/skill-catalog.d.ts +3 -0
- package/daemon/dist/domain/skill-catalog.d.ts.map +1 -1
- package/daemon/dist/domain/skill-catalog.js +7 -3
- package/daemon/dist/domain/skill-catalog.js.map +1 -1
- package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
- package/daemon/dist/domain/snapshot-capture.js +5 -0
- package/daemon/dist/domain/snapshot-capture.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts +16 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +70 -38
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +34 -1
- 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/workflow-exception-escalation.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-exception-escalation.js +13 -8
- package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -1
- package/daemon/dist/domain/workflow-instance-store.d.ts +11 -0
- package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-instance-store.js +35 -0
- package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
- package/daemon/dist/domain/workflow-projector.d.ts +7 -0
- package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +202 -91
- package/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-runtime.d.ts +7 -1
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +116 -26
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
- package/daemon/dist/lib/pane-envelope.js +12 -7
- package/daemon/dist/lib/pane-envelope.js.map +1 -1
- package/daemon/dist/routes/compaction.d.ts.map +1 -1
- package/daemon/dist/routes/compaction.js +6 -3
- 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 +44 -27
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/scopes.d.ts.map +1 -1
- package/daemon/dist/routes/scopes.js +102 -19
- package/daemon/dist/routes/scopes.js.map +1 -1
- package/daemon/dist/routes/seat.d.ts.map +1 -1
- package/daemon/dist/routes/seat.js +50 -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 +54 -10
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/startup.d.ts.map +1 -1
- package/daemon/dist/routes/startup.js +116 -18
- package/daemon/dist/routes/startup.js.map +1 -1
- package/daemon/dist/routes/transport.d.ts.map +1 -1
- package/daemon/dist/routes/transport.js +36 -2
- package/daemon/dist/routes/transport.js.map +1 -1
- package/daemon/dist/routes/watchdog.d.ts.map +1 -1
- package/daemon/dist/routes/watchdog.js +7 -1
- package/daemon/dist/routes/watchdog.js.map +1 -1
- package/daemon/dist/routes/workflow.d.ts.map +1 -1
- package/daemon/dist/routes/workflow.js +22 -4
- package/daemon/dist/routes/workflow.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +105 -37
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/agent-startup-guide.md +87 -0
- package/daemon/docs/reference/daemon-http-clients.md +1 -0
- package/daemon/docs/reference/developing.md +1 -1
- package/daemon/docs/reference/gateway-participants.md +5 -3
- package/daemon/docs/reference/getting-started.md +9 -8
- package/daemon/docs/reference/quickstart.md +2 -2
- package/daemon/docs/reference/rig-spec.md +92 -4
- package/daemon/docs/reference/rosters.md +26 -0
- package/daemon/docs/reference/seat-delivery.md +7 -1
- package/daemon/docs/reference/whats-new.md +210 -5
- package/dist/build-info.js +3 -3
- package/dist/client.d.ts +7 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +11 -2
- package/dist/client.js.map +1 -1
- package/dist/commands/launch.d.ts.map +1 -1
- package/dist/commands/launch.js +8 -0
- package/dist/commands/launch.js.map +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +18 -1
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +11 -5
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +6 -2
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/roster.d.ts +4 -2
- package/dist/commands/roster.d.ts.map +1 -1
- package/dist/commands/roster.js +2 -2
- package/dist/commands/roster.js.map +1 -1
- package/dist/commands/seat.d.ts +2 -0
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +198 -11
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +31 -6
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/walk.d.ts.map +1 -1
- package/dist/commands/walk.js +4 -0
- package/dist/commands/walk.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +25 -1
- package/dist/commands/workflow.js.map +1 -1
- package/dist/mcp-http.d.ts +3 -0
- package/dist/mcp-http.d.ts.map +1 -1
- package/dist/mcp-http.js +13 -0
- package/dist/mcp-http.js.map +1 -1
- package/dist/mcp-server.d.ts +9 -2
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +243 -64
- package/dist/mcp-server.js.map +1 -1
- package/package.json +1 -1
- package/tui/dist/commands/registry.d.ts.map +1 -1
- package/tui/dist/commands/registry.js +1 -0
- package/tui/dist/commands/registry.js.map +1 -1
- package/tui/dist/crash-cart/start-daemon.d.ts.map +1 -1
- package/tui/dist/crash-cart/start-daemon.js +4 -2
- package/tui/dist/crash-cart/start-daemon.js.map +1 -1
- package/tui/dist/daemon-client.d.ts +9 -0
- package/tui/dist/daemon-client.d.ts.map +1 -1
- package/tui/dist/daemon-client.js +40 -0
- package/tui/dist/daemon-client.js.map +1 -1
- package/tui/dist/hydrate.d.ts +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +12 -0
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/main.js +3 -0
- package/tui/dist/main.js.map +1 -1
- package/tui/dist/page-read.d.ts.map +1 -1
- package/tui/dist/page-read.js +2 -1
- package/tui/dist/page-read.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +4 -1
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/scopes/fleet-scopes-model.d.ts +73 -0
- package/tui/dist/scopes/fleet-scopes-model.d.ts.map +1 -0
- package/tui/dist/scopes/fleet-scopes-model.js +102 -0
- package/tui/dist/scopes/fleet-scopes-model.js.map +1 -0
- package/tui/dist/scopes/scopes-model.d.ts +2 -0
- package/tui/dist/scopes/scopes-model.d.ts.map +1 -1
- package/tui/dist/scopes/scopes-model.js +7 -4
- package/tui/dist/scopes/scopes-model.js.map +1 -1
- package/tui/dist/sections.d.ts.map +1 -1
- package/tui/dist/sections.js +5 -0
- package/tui/dist/sections.js.map +1 -1
- package/tui/dist/startup.d.ts +5 -0
- package/tui/dist/startup.d.ts.map +1 -1
- package/tui/dist/startup.js +12 -0
- package/tui/dist/startup.js.map +1 -1
- package/tui/dist/state.d.ts.map +1 -1
- package/tui/dist/state.js +12 -5
- package/tui/dist/state.js.map +1 -1
- package/tui/dist/types.d.ts +16 -1
- package/tui/dist/types.d.ts.map +1 -1
package/dist/mcp-server.js
CHANGED
|
@@ -3,13 +3,16 @@ import { z } from "zod";
|
|
|
3
3
|
import { createHash, randomBytes } from "node:crypto";
|
|
4
4
|
import { statSync } from "node:fs";
|
|
5
5
|
import nodePath from "node:path";
|
|
6
|
-
import { DaemonConnectionError, DaemonTimeoutError, terminalAuthHeaders } from "./client.js";
|
|
6
|
+
import { DaemonClient, DaemonConnectionError, DaemonTimeoutError, remoteDaemonClient, terminalAuthHeaders } from "./client.js";
|
|
7
|
+
import { bearerAuthHeaders, loadHostRegistry, resolveHost, resolveRemoteBearer } from "./host-registry.js";
|
|
8
|
+
import { loadHostBindings } from "./host-bindings.js";
|
|
9
|
+
import { eligibleQueueBindings, ineligibleBindingDetail } from "../daemon/dist/learned-host-bindings-surface.js";
|
|
7
10
|
import { readOpenRigEnv } from "./openrig-compat.js";
|
|
8
11
|
import { resolveRigHandle } from "./rig-handle.js";
|
|
9
12
|
import { formatSeatActivity } from "./lib/seat-activity.js";
|
|
10
13
|
import { CLI_VERSION } from "./version.js";
|
|
11
14
|
import { ConfigStore } from "./config-store.js";
|
|
12
|
-
import { readRosters } from "./commands/roster.js";
|
|
15
|
+
import { readRosters, rosterTeamName, teamPhrase } from "./commands/roster.js";
|
|
13
16
|
import { mcpPresenceFilePath, readPresence } from "./mcp-presence.js";
|
|
14
17
|
import { codeResultOf, planItemArtifact } from "./queue-artifact.js";
|
|
15
18
|
const LONG_RUNNING_UP_TIMEOUT_MS = 120_000;
|
|
@@ -54,7 +57,7 @@ function structured(data) {
|
|
|
54
57
|
/** Where a handed-on item went. A cross-host handoff records the remote item as qitem-…@<host> in closureTarget (named, not
|
|
55
58
|
* fetched); a local successor is the item whose handedOffFrom is this one, the newest when there are several. null when
|
|
56
59
|
* none is found; { unknown: true, code } when the lookup failed or the daemon can't filter by handedOffFrom. */
|
|
57
|
-
async function successorOf(
|
|
60
|
+
async function successorOf(get, qitemId, closureTarget,
|
|
58
61
|
/** For an external caller: which successor rows it may see; a cross-host successor's parties are unknown here, so it
|
|
59
62
|
* can't. */
|
|
60
63
|
visible) {
|
|
@@ -62,7 +65,7 @@ visible) {
|
|
|
62
65
|
if (remote)
|
|
63
66
|
return visible ? { unknown: true, code: "out_of_scope" } : { qitemId: remote[1], host: remote[2] };
|
|
64
67
|
try {
|
|
65
|
-
const res = await
|
|
68
|
+
const res = await get(`/api/queue/list?${new URLSearchParams({ handedOffFrom: qitemId, compact: "1", limit: "5" }).toString()}`);
|
|
66
69
|
if (res.status >= 400)
|
|
67
70
|
return { unknown: true, code: mapResult(res).structuredContent.code };
|
|
68
71
|
if (!Array.isArray(res.data))
|
|
@@ -145,41 +148,57 @@ function newestWake(rows, seat) {
|
|
|
145
148
|
return newest;
|
|
146
149
|
}
|
|
147
150
|
const ROSTERS_INCOMPLETE = "Some rosters couldn't be read, so hosted members may be missing.";
|
|
148
|
-
/**
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
*
|
|
152
|
-
|
|
151
|
+
/** An external caller's answer also carries the roster entries of the team's seats, and loses those too. */
|
|
152
|
+
const ROSTERS_INCOMPLETE_EXTERNAL = "Some rosters couldn't be read, so hosted members, and the labels, caveats and presence they give the team's seats, may be missing.";
|
|
153
|
+
/** The roster members on this host whose seat is in this rig and marked hosted, that aren't one of its nodes. For an
|
|
154
|
+
* external caller, also the entries of its node seats (by seat) and each member's label (or why it isn't used): the names
|
|
155
|
+
* a person knows them by. An internal caller's answer is as it was. A roster folder that doesn't exist means none. One
|
|
156
|
+
* that can't be inspected or read, or a host id that isn't known yet, is said, never read as none. The note stays generic
|
|
157
|
+
* (a scoped caller doesn't see other rosters' names or errors); the detail goes to this server's log. presenceOf gives
|
|
158
|
+
* null for a seat whose presence isn't shown (an external caller's own), and that entry has none. */
|
|
159
|
+
async function hostedMembersOf(folder, rigName, nodeSeats, selfHostId, presenceOf, external) {
|
|
160
|
+
const incomplete = external ? ROSTERS_INCOMPLETE_EXTERNAL : ROSTERS_INCOMPLETE;
|
|
161
|
+
const seats = new Map();
|
|
153
162
|
try {
|
|
154
163
|
statSync(folder);
|
|
155
164
|
}
|
|
156
165
|
catch (error) {
|
|
157
166
|
if (error.code === "ENOENT")
|
|
158
|
-
return { members: [] };
|
|
167
|
+
return { members: [], seats };
|
|
159
168
|
console.error(`rig_team: the roster folder ${folder} can't be inspected: ${error.message}`);
|
|
160
|
-
return { members: [], note:
|
|
169
|
+
return { members: [], seats, note: incomplete };
|
|
161
170
|
}
|
|
162
171
|
const { rosters, warnings } = readRosters(folder);
|
|
163
172
|
if (warnings.length > 0)
|
|
164
173
|
console.error(`rig_team: ${warnings.join("; ")}`);
|
|
165
|
-
const unread = warnings.length > 0 ? { note:
|
|
174
|
+
const unread = warnings.length > 0 ? { note: incomplete } : {};
|
|
175
|
+
const hostedHere = (member) => member.hosted === true && member.seat.endsWith(`@${rigName}`);
|
|
166
176
|
const candidates = rosters.flatMap((roster) => roster.members
|
|
167
|
-
.filter((member) => member.
|
|
177
|
+
.filter((member) => external ? nodeSeats.has(member.seat) || hostedHere(member) : hostedHere(member) && !nodeSeats.has(member.seat))
|
|
168
178
|
.map((member) => ({ roster: roster.id, member })));
|
|
169
179
|
if (candidates.length === 0)
|
|
170
|
-
return { members: [], ...unread };
|
|
180
|
+
return { members: [], seats, ...unread };
|
|
171
181
|
const host = await selfHostId();
|
|
172
|
-
if (!host)
|
|
173
|
-
return { members: [], note:
|
|
182
|
+
if (!host) {
|
|
183
|
+
return { members: [], seats, note: external
|
|
184
|
+
? "This daemon's host id isn't known yet, so hosted members on its rosters, and the roster entries of the team's seats, can't be matched to it."
|
|
185
|
+
: "This daemon's host id isn't known yet, so hosted members on its rosters can't be matched to it." };
|
|
186
|
+
}
|
|
174
187
|
// A seat in two rosters is one member: the first roster (by file name) supplies its entry.
|
|
175
188
|
const members = new Map();
|
|
176
189
|
for (const { roster, member } of candidates) {
|
|
177
|
-
if (member.host !== host || members.has(member.seat))
|
|
190
|
+
if (member.host !== host || members.has(member.seat) || seats.has(member.seat))
|
|
178
191
|
continue;
|
|
179
|
-
|
|
180
|
-
|
|
192
|
+
// A label that can't be used says why, so it doesn't read as absent.
|
|
193
|
+
const named = !external ? {} : member.label ? { label: member.label } : member.label_problem ? { label_problem: member.label_problem } : {};
|
|
194
|
+
const entry = { ...named, roster, capabilities: member.capabilities, useWhen: member.use_when, caveat: member.caveat ?? null };
|
|
195
|
+
const presence = await presenceOf(member.seat);
|
|
196
|
+
if (nodeSeats.has(member.seat))
|
|
197
|
+
seats.set(member.seat, { ...entry, ...(presence ? { presence } : {}) });
|
|
198
|
+
else
|
|
199
|
+
members.set(member.seat, { session: member.seat, ...entry, pane: null, activity: "unknown", ...(presence ? { presence } : {}) });
|
|
181
200
|
}
|
|
182
|
-
return { members: [...members.values()], ...unread };
|
|
201
|
+
return { members: [...members.values()], seats, ...unread };
|
|
183
202
|
}
|
|
184
203
|
/** A slice's summary fields, without its paths and readiness detail. */
|
|
185
204
|
function sliceSummary(slice) {
|
|
@@ -570,11 +589,34 @@ function sharedInstructions(has) {
|
|
|
570
589
|
}
|
|
571
590
|
const SHARED_INSTRUCTIONS = sharedInstructions(() => true);
|
|
572
591
|
const INSTRUCTIONS = [...SHARED_INSTRUCTIONS, MEMBER_WORKFLOW].join("\n");
|
|
592
|
+
/** For a connection that relays a person's request to another assistant (an external caller, or the front door): which one
|
|
593
|
+
* they mean is theirs to say when more than one fits, never inferred from the agent's own history. The listing steps need
|
|
594
|
+
* rig_team, so a connection without it is told only to ask. Pickup is said only where it's true: another connected
|
|
595
|
+
* assistant waits for its person; on the front door, a running team seat is woken, and one sent to anyway waits until it's
|
|
596
|
+
* back. A member, which works items, isn't given it. */
|
|
597
|
+
function askWhichAssistant(canList, frontDoor) {
|
|
598
|
+
if (!canList) {
|
|
599
|
+
return "If more than one assistant could be the one your person means, ask which; don't pick from your own history or memory. If your person names one clearly, go ahead.";
|
|
600
|
+
}
|
|
601
|
+
return [
|
|
602
|
+
"Before sending a request to another assistant, list the team's members.",
|
|
603
|
+
"If more than one could be the one your person means, ask which, using their names from the list (like \"Sam's Claude\"); if the list shows only addresses, describe each in plain words from what the list says about it (like \"the Claude assistant\"), never reading the address out.",
|
|
604
|
+
"Don't pick from your own history or memory.",
|
|
605
|
+
"If the list shows the chosen one detached or stopped, or a connected assistant with no check-in yet or overdue, say so before sending and ask whether to send it anyway.",
|
|
606
|
+
"If the list says the chosen one's person was removed from the team, don't send; tell your person and ask whether to send it to someone else.",
|
|
607
|
+
...(frontDoor ? ["When you send to a running team seat, tell your person that seat will pick it up on its own."] : []),
|
|
608
|
+
"When you send to another connected assistant, tell your person it will be picked up the next time that assistant's person opens it, or on a schedule they've set up.",
|
|
609
|
+
...(frontDoor ? ["If you sent it anyway, tell your person it waits until that one is back."] : []),
|
|
610
|
+
"If your person names one clearly, or says to send it anyway to one that isn't connected, go ahead without asking again.",
|
|
611
|
+
"If your person still asks to send to one whose person was removed, tell them it can't be delivered: requests to a removed person's assistant are closed unanswered.",
|
|
612
|
+
].join(" ");
|
|
613
|
+
}
|
|
573
614
|
/** rig mcp serve --front-door: the seat is a person's agent in their own app, the front door to their team, not a member
|
|
574
615
|
* that works its inbox. The team's questions to it are the person's to answer. */
|
|
575
|
-
export const FRONT_DOOR_WORKFLOW_VERSION = "front-door/
|
|
616
|
+
export const FRONT_DOOR_WORKFLOW_VERSION = "front-door/v3";
|
|
576
617
|
export const FRONT_DOOR_WORKFLOW = [
|
|
577
618
|
`Front door (${FRONT_DOOR_WORKFLOW_VERSION}). This seat is a person's agent in their own app: you hand the team their work and bring back what it produced, and you aren't one of its members.`,
|
|
619
|
+
askWhichAssistant(true, true),
|
|
578
620
|
"Items addressed to your seat (rig_queue_list with owned set) are usually the team's questions about work you handed it. They're the person's to answer, not yours: show each to the person with the team's draft, and record only what the person tells you.",
|
|
579
621
|
"To record an answer, claim the item (rig_queue_claim), then close it done with closure reason no-follow-on and exactly what the person typed in resolution, with no label, quotation marks or words of your own (rig_queue_update). If the person isn't there, leave the item open and tell them it's waiting. Never choose an answer for them, and don't claim an item you can't close with their words.",
|
|
580
622
|
"Nothing wakes this conversation when the team finishes: check your work and your items when the person asks or comes back.",
|
|
@@ -611,8 +653,11 @@ function instructionsFor(access, frontDoor = false) {
|
|
|
611
653
|
if (!access?.external)
|
|
612
654
|
return frontDoor ? FRONT_DOOR_INSTRUCTIONS : INSTRUCTIONS;
|
|
613
655
|
const tools = externalTools(access.external);
|
|
614
|
-
const
|
|
656
|
+
const workflow = tools.has("rig_queue_claim") && tools.has("rig_queue_update") ? externalInboxInstructions(tools)
|
|
615
657
|
: tools.has("rig_question_list") || tools.has("rig_question_answer") ? EXTERNAL_PERSON_INSTRUCTIONS : EXTERNAL_INSTRUCTIONS;
|
|
658
|
+
// Only a grant with team/list may reach another connected assistant's seat, and it lists the team with rig_team.
|
|
659
|
+
const instructions = tools.has("rig_queue_create")
|
|
660
|
+
? `${workflow}\n${askWhichAssistant(tools.has("rig_team"), false)}` : workflow;
|
|
616
661
|
return tools.has("rig_team") ? `Discover the team this grant connects you to by calling rig_team without rigId. A sole granted rig is selected automatically; with several, it returns the granted names to choose from.\n${instructions}` : instructions;
|
|
617
662
|
}
|
|
618
663
|
/** The seats of `rigName` that `name` names, each as its actual session: its node's canonical session, or the
|
|
@@ -733,10 +778,65 @@ export function createMcpServer(client, options = {}) {
|
|
|
733
778
|
version: CLI_VERSION,
|
|
734
779
|
}, { instructions: instructionsFor(options.access, options.frontDoor === true) });
|
|
735
780
|
const { access } = options;
|
|
736
|
-
const
|
|
737
|
-
const
|
|
781
|
+
const clientFactory = options.clientFactory ?? ((url) => new DaemonClient(url));
|
|
782
|
+
const hostRegistryLoader = options.hostRegistryLoader ?? loadHostRegistry;
|
|
783
|
+
const hostBindingsLoader = options.hostBindingsLoader ?? loadHostBindings;
|
|
738
784
|
// The seat this server acts as: the authenticated caller's, else OPENRIG_SESSION_NAME where it was configured.
|
|
739
785
|
const seatOf = () => options.seat ?? readOpenRigEnv("OPENRIG_SESSION_NAME", "RIGGED_SESSION_NAME")?.trim();
|
|
786
|
+
/** A tool's optional `host`: that registered http host's client and bearer, or this server's own client when none is
|
|
787
|
+
* named. A granted connection (an authenticated non-owner) reaches only the daemon serving it, so it can't name one.
|
|
788
|
+
* The remote client is bound to this server's seat, so a write it makes there names the calling agent as its sender
|
|
789
|
+
* (principal headers stay local: only this host's daemon trusts them). */
|
|
790
|
+
const hostTarget = (host) => {
|
|
791
|
+
const name = host?.trim();
|
|
792
|
+
if (host !== undefined && !name) {
|
|
793
|
+
const message = "A host name can't be blank: omit host to act on this daemon, or name a registered host (rig host list shows them).";
|
|
794
|
+
return errorResult(message, "invalid_host", message);
|
|
795
|
+
}
|
|
796
|
+
if (!name || name === "local")
|
|
797
|
+
return { client, headers: {}, remote: false };
|
|
798
|
+
if (access && !access.owner) {
|
|
799
|
+
const message = "Naming a host needs the daemon's owner (the stdio server, an HTTP owner token, or unauthenticated loopback), not an ordinary scoped grant; a granted connection reaches only the daemon serving it.";
|
|
800
|
+
return errorResult(message, "host_not_available", message);
|
|
801
|
+
}
|
|
802
|
+
const registry = hostRegistryLoader();
|
|
803
|
+
if (!registry.ok) {
|
|
804
|
+
const message = `Host ${name} can't be reached: this CLI's host registry can't be read (${registry.error}).`;
|
|
805
|
+
return errorResult(message, "host_registry_unreadable", message);
|
|
806
|
+
}
|
|
807
|
+
const learned = hostBindingsLoader();
|
|
808
|
+
// Queue forwarding's one policy: a learned self-id routes only through a binding admitted by
|
|
809
|
+
// `eligibleQueueBindings`, so a stale, conflicted or SSH-declared binding never sends this call elsewhere.
|
|
810
|
+
const match = resolveHost(registry.registry, name, eligibleQueueBindings(registry.registry, learned));
|
|
811
|
+
if (!match.ok) {
|
|
812
|
+
const unused = ineligibleBindingDetail(registry.registry, learned, name);
|
|
813
|
+
const message = `Host ${name} isn't in this CLI's host registry. rig host list shows the registered hosts.${unused ? ` ${unused}` : ""}`;
|
|
814
|
+
return errorResult(message, "unknown_host", message);
|
|
815
|
+
}
|
|
816
|
+
if (match.host.transport !== "http") {
|
|
817
|
+
const message = `Host ${name} is registered over SSH, not as a daemon URL; MCP reaches http hosts only. Use rig <verb> --host ${name} for an SSH host.`;
|
|
818
|
+
return errorResult(message, "host_not_http", message);
|
|
819
|
+
}
|
|
820
|
+
const bearer = resolveRemoteBearer(match.host);
|
|
821
|
+
if (!bearer.ok)
|
|
822
|
+
return errorResult(bearer.error, "host_bearer_unavailable", bearer.error);
|
|
823
|
+
return { client: remoteDaemonClient(clientFactory, match.host.url, undefined, seatOf()), headers: bearerAuthHeaders(bearer.token), remote: true, name: match.host.id };
|
|
824
|
+
};
|
|
825
|
+
/** Request options for a host target: a remote call carries that host's bearer; a local one keeps the terminal token. */
|
|
826
|
+
const hostOptions = (target, timeout) => target.remote
|
|
827
|
+
? { ...(timeout ?? {}), ...(Object.keys(target.headers).length > 0 ? { headers: target.headers } : {}) }
|
|
828
|
+
: transportRequestOptions(timeout);
|
|
829
|
+
/** A call with no options stays a one-argument call (the request shape existing callers and tests expect). */
|
|
830
|
+
const hostGet = (target, path, timeout) => {
|
|
831
|
+
const options = hostOptions(target, timeout);
|
|
832
|
+
return options === undefined ? target.client.get(path) : target.client.get(path, options);
|
|
833
|
+
};
|
|
834
|
+
const hostPost = (target, path, body, timeout) => {
|
|
835
|
+
const options = hostOptions(target, timeout);
|
|
836
|
+
return options === undefined ? target.client.post(path, body) : target.client.post(path, body, options);
|
|
837
|
+
};
|
|
838
|
+
const rostersFolder = options.rostersFolder ?? (() => nodePath.join(new ConfigStore().get("workspace.root"), "rosters"));
|
|
839
|
+
const presenceFile = options.presenceFile ?? (() => mcpPresenceFilePath());
|
|
740
840
|
// With no seat (none configured, or one an app left unfilled), messages, new tasks and chat still go through, as an
|
|
741
841
|
// unknown sender. Its label is this server's own and no seat's, so two unknown callers never count as one author (a
|
|
742
842
|
// delegated decision compares authors). Its note says only what is known: why there's no seat, and how the client
|
|
@@ -865,12 +965,17 @@ export function createMcpServer(client, options = {}) {
|
|
|
865
965
|
// 3. rig_ps — list running rigs
|
|
866
966
|
if (offered("rig_ps"))
|
|
867
967
|
server.registerTool("rig_ps", {
|
|
868
|
-
description: "List rigs and their status",
|
|
869
|
-
inputSchema: z.object({
|
|
968
|
+
description: "List rigs and their status. host reads a registered remote host instead of this daemon; it needs the daemon's owner (the stdio server, an HTTP owner token, or unauthenticated loopback), not an ordinary scoped grant.",
|
|
969
|
+
inputSchema: z.object({
|
|
970
|
+
host: z.string().min(1).optional().describe("Act on a REGISTERED remote host's daemon instead of this one (rig host list shows the hosts; as --host on the matching rig verb); a write there names this server's seat (rig_whoami) as its sender, as a local write does"),
|
|
971
|
+
}),
|
|
870
972
|
annotations: READ_ONLY,
|
|
871
|
-
}, async () => {
|
|
973
|
+
}, async ({ host }) => {
|
|
872
974
|
try {
|
|
873
|
-
const
|
|
975
|
+
const target = hostTarget(host);
|
|
976
|
+
if ("content" in target)
|
|
977
|
+
return target;
|
|
978
|
+
const res = await hostGet(target, "/api/ps");
|
|
874
979
|
if (scope && res.status < 400 && Array.isArray(res.data))
|
|
875
980
|
return mapResult({ ...res, data: res.data.filter((entry) => scope.rig(entry.name)) });
|
|
876
981
|
return mapResult(res);
|
|
@@ -1111,17 +1216,21 @@ export function createMcpServer(client, options = {}) {
|
|
|
1111
1216
|
// 14. rig_send — send message to agent session
|
|
1112
1217
|
if (offered("rig_send"))
|
|
1113
1218
|
server.registerTool("rig_send", {
|
|
1114
|
-
description: "Send a message to an agent's terminal using reliable two-step send",
|
|
1219
|
+
description: "Send a message to an agent's terminal using reliable two-step send. host needs the daemon's owner (the stdio server, an HTTP owner token, or unauthenticated loopback), not an ordinary scoped grant.",
|
|
1115
1220
|
inputSchema: z.object({
|
|
1116
1221
|
session: z.string().describe("Target session name (e.g. dev-impl@my-rig)"),
|
|
1117
1222
|
text: z.string().describe("Message text to send"),
|
|
1118
1223
|
verify: z.boolean().optional().describe("Verify delivery by checking pane content"),
|
|
1119
1224
|
force: z.boolean().optional().describe("Send even if target appears mid-task"),
|
|
1120
1225
|
waitForIdleSeconds: z.number().positive().optional().describe("Wait until explicit idle evidence before sending. If the seat is still busy or its activity is unknown when the wait ends, nothing is sent and nothing is kept; separate work belongs in a queue row"),
|
|
1226
|
+
host: z.string().min(1).optional().describe("Act on a REGISTERED remote host's daemon instead of this one (rig host list shows the hosts; as --host on the matching rig verb); a write there names this server's seat (rig_whoami) as its sender, as a local write does"),
|
|
1121
1227
|
}),
|
|
1122
1228
|
annotations: DESTRUCTIVE,
|
|
1123
|
-
}, async ({ session, text, verify, force, waitForIdleSeconds }) => {
|
|
1229
|
+
}, async ({ session, text, verify, force, waitForIdleSeconds, host }) => {
|
|
1124
1230
|
try {
|
|
1231
|
+
const target = hostTarget(host);
|
|
1232
|
+
if ("content" in target)
|
|
1233
|
+
return target;
|
|
1125
1234
|
if (force && waitForIdleSeconds !== undefined) {
|
|
1126
1235
|
const message = "waitForIdleSeconds cannot be combined with force";
|
|
1127
1236
|
return errorResult(JSON.stringify({ ok: false, error: message }), "invalid_arguments", message);
|
|
@@ -1131,13 +1240,13 @@ export function createMcpServer(client, options = {}) {
|
|
|
1131
1240
|
const waitForIdleMs = waitForIdleSeconds === undefined ? undefined : Math.ceil(waitForIdleSeconds * 1000);
|
|
1132
1241
|
// Unsigned, as before (the transport names it "<unknown sender>"); the note tells the recipient what is known.
|
|
1133
1242
|
const note = unknownSenderNote("message");
|
|
1134
|
-
const res = await
|
|
1243
|
+
const res = await hostPost(target, "/api/transport/send", {
|
|
1135
1244
|
session,
|
|
1136
1245
|
text: note ? `${note}\n${text}` : text,
|
|
1137
1246
|
verify,
|
|
1138
1247
|
force,
|
|
1139
1248
|
waitForIdleMs,
|
|
1140
|
-
},
|
|
1249
|
+
}, waitForIdleRequestOptions(waitForIdleMs));
|
|
1141
1250
|
return mapResult(res);
|
|
1142
1251
|
}
|
|
1143
1252
|
catch (err) {
|
|
@@ -1147,16 +1256,20 @@ export function createMcpServer(client, options = {}) {
|
|
|
1147
1256
|
// 15. rig_capture — capture terminal output from agent session
|
|
1148
1257
|
if (offered("rig_capture"))
|
|
1149
1258
|
server.registerTool("rig_capture", {
|
|
1150
|
-
description: "Capture terminal output from an agent session",
|
|
1259
|
+
description: "Capture terminal output from an agent session. host needs the daemon's owner (the stdio server, an HTTP owner token, or unauthenticated loopback), not an ordinary scoped grant.",
|
|
1151
1260
|
inputSchema: z.object({
|
|
1152
1261
|
session: z.string().optional().describe("Session name (omit for multi-target with rig/pod)"),
|
|
1153
1262
|
rig: z.string().optional().describe("Capture all sessions in a rig"),
|
|
1154
1263
|
pod: z.string().optional().describe("Capture all sessions in a pod"),
|
|
1155
1264
|
lines: z.number().optional().describe("Number of lines to capture (default: 20)"),
|
|
1265
|
+
host: z.string().min(1).optional().describe("Act on a REGISTERED remote host's daemon instead of this one (rig host list shows the hosts; as --host on the matching rig verb); a write there names this server's seat (rig_whoami) as its sender, as a local write does"),
|
|
1156
1266
|
}),
|
|
1157
1267
|
annotations: READ_ONLY,
|
|
1158
|
-
}, async ({ session, rig, pod, lines }) => {
|
|
1268
|
+
}, async ({ session, rig, pod, lines, host }) => {
|
|
1159
1269
|
try {
|
|
1270
|
+
const target = hostTarget(host);
|
|
1271
|
+
if ("content" in target)
|
|
1272
|
+
return target;
|
|
1160
1273
|
let rigName = rig;
|
|
1161
1274
|
if (scope) {
|
|
1162
1275
|
if (session && !scope.session(session))
|
|
@@ -1182,7 +1295,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1182
1295
|
if (lines)
|
|
1183
1296
|
body.lines = lines;
|
|
1184
1297
|
body.inputBox = true; // what the live input box holds, in the result's inputBox
|
|
1185
|
-
const res = await
|
|
1298
|
+
const res = await hostPost(target, "/api/transport/capture", body);
|
|
1186
1299
|
return mapResult(res);
|
|
1187
1300
|
}
|
|
1188
1301
|
catch (err) {
|
|
@@ -1291,7 +1404,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1291
1404
|
// 19. rig_queue_create — hand a task to a seat
|
|
1292
1405
|
if (offered("rig_queue_create"))
|
|
1293
1406
|
server.registerTool("rig_queue_create", {
|
|
1294
|
-
...worded("rig_queue_create", "Hand a task to another seat as a durable queue item. Returns its qitemId: read the answer later with rig_queue_show. If the call times out, check rig_queue_show with the same qitemId before retrying; never retry with a new id. To ask for a revision of earlier work, name it in revises: the new item opens with 'Revision of <id>' and records it in its chainOfRecord.", ADDITIVE),
|
|
1407
|
+
...worded("rig_queue_create", "Hand a task to another seat as a durable queue item. Returns its qitemId: read the answer later with rig_queue_show. If the call times out, check rig_queue_show with the same qitemId before retrying; never retry with a new id. To ask for a revision of earlier work, name it in revises: the new item opens with 'Revision of <id>' and records it in its chainOfRecord. host needs the daemon's owner (the stdio server, an HTTP owner token, or unauthenticated loopback), not an ordinary scoped grant.", ADDITIVE),
|
|
1295
1408
|
inputSchema: z.object({
|
|
1296
1409
|
destination: access?.external
|
|
1297
1410
|
? z.string().optional().describe("Destination seat: member@rig, or its name alone as the team shows it (e.g. workshop-lead) within this connection's team; omit to use the connected team's configured receiver")
|
|
@@ -1304,8 +1417,12 @@ export function createMcpServer(client, options = {}) {
|
|
|
1304
1417
|
qitemId: z.string().optional().describe("Request id to reuse when retrying the same create (default: a new id)"),
|
|
1305
1418
|
revises: z.string().optional().describe("The qitemId of the work this asks to revise"),
|
|
1306
1419
|
alert: z.boolean().optional().describe("For an ask to a person that's urgent: something only they can do, or an approval whose wait costs now (as rig queue create --alert). It stands out in Slack. Without it the ask still posts to Slack unless the person's Slack subscription is urgent-only, in which case it waits on Steering and the TUI"),
|
|
1420
|
+
host: z.string().min(1).optional().describe("Act on a REGISTERED remote host's daemon instead of this one (rig host list shows the hosts; as --host on the matching rig verb); a write there names this server's seat (rig_whoami) as its sender, as a local write does"),
|
|
1307
1421
|
}),
|
|
1308
|
-
}, async ({ destination, body, summary, tags, priority, tier, qitemId, revises, alert }) => {
|
|
1422
|
+
}, async ({ destination, body, summary, tags, priority, tier, qitemId, revises, alert, host }) => {
|
|
1423
|
+
const target = hostTarget(host);
|
|
1424
|
+
if ("content" in target)
|
|
1425
|
+
return target;
|
|
1309
1426
|
// The server's one receiver counts for this connection only when its grant reaches it. Then a refused destination
|
|
1310
1427
|
// says how to reach it, so the assistant retries instead of telling the person the connection lacks access. It
|
|
1311
1428
|
// never names the receiver.
|
|
@@ -1374,7 +1491,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1374
1491
|
let lineage;
|
|
1375
1492
|
if (revises) {
|
|
1376
1493
|
try {
|
|
1377
|
-
const original = await
|
|
1494
|
+
const original = await hostGet(target, `/api/queue/${encodeURIComponent(revises)}`);
|
|
1378
1495
|
if (original.status >= 400)
|
|
1379
1496
|
return mapResult(original);
|
|
1380
1497
|
if (scope && !scope.item(original.data))
|
|
@@ -1409,7 +1526,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1409
1526
|
// With no seat, the task goes to its destination as from the unknown sender, with the note at the top of its body.
|
|
1410
1527
|
const note = unknownSenderNote("task");
|
|
1411
1528
|
try {
|
|
1412
|
-
const res = await
|
|
1529
|
+
const res = await hostPost(target, "/api/queue/create", {
|
|
1413
1530
|
qitemId: id, destinationSession: destination, body: note ? `${note}\n\n${lineage?.body ?? body}` : lineage?.body ?? body,
|
|
1414
1531
|
...(note ? { sourceSession: unknownSender } : {}), summary, priority, tier,
|
|
1415
1532
|
tags: access?.external ? tags?.filter((tag) => !OPENRIG_PROVENANCE_TAG.test(tag)) : tags,
|
|
@@ -1427,37 +1544,41 @@ export function createMcpServer(client, options = {}) {
|
|
|
1427
1544
|
const view = externalView(scope);
|
|
1428
1545
|
// An unknown sender has no return address, so it says how to follow the task.
|
|
1429
1546
|
const sent = note && res.status < 400 && res.data && typeof res.data === "object" ? { ...res, data: { ...res.data,
|
|
1430
|
-
unknownSender: { label: unknownSender, followUp: `No return address: read this task with rig_queue_show and qitemId ${id}.` } } } : res;
|
|
1547
|
+
unknownSender: { label: unknownSender, followUp: `No return address: read this task with rig_queue_show and qitemId ${id}${target.remote && target.name ? ` and host ${target.name}` : ""}.` } } } : res;
|
|
1431
1548
|
return mapResult(view && sent.status < 400 ? { ...sent, data: projectForExternal(sent.data, view) } : sent, undefined, { structured: true });
|
|
1432
1549
|
}
|
|
1433
1550
|
catch (err) {
|
|
1434
1551
|
const failure = caught(err);
|
|
1435
|
-
const text = `${err.message} The outcome is unknown: check rig_queue_show with qitemId ${id} before retrying, and retry only with that same qitemId.`;
|
|
1436
|
-
return { ...failure, content: [{ type: "text", text }], structuredContent: { ...failure.structuredContent, qitemId: id, outcome: "unknown" } };
|
|
1552
|
+
const text = `${err.message} The outcome is unknown: check rig_queue_show with qitemId ${id}${target.remote && target.name ? ` and host ${target.name}` : ""} before retrying, and retry only with that same qitemId.`;
|
|
1553
|
+
return { ...failure, content: [{ type: "text", text }], structuredContent: { ...failure.structuredContent, qitemId: id, outcome: "unknown", ...(target.remote && target.name ? { host: target.name } : {}) } };
|
|
1437
1554
|
}
|
|
1438
1555
|
});
|
|
1439
1556
|
// 20. rig_queue_show — one item with its transitions: a delegated task's answer is its own record
|
|
1440
1557
|
if (offered("rig_queue_show"))
|
|
1441
1558
|
server.registerTool("rig_queue_show", {
|
|
1442
|
-
...worded("rig_queue_show", "Read one queue item and its transitions. For a task you handed off, this is where its answer is: the state, the closure reason and target, the notes the assignee recorded, and evidenceRef when it names an artifact (read it with rig_artifact_read). When the item was handed on, successor names the next item (on another host: its id and host); follow it with rig_queue_show. null means none was found. A revision names the work it revises in chainOfRecord.", READ_ONLY),
|
|
1559
|
+
...worded("rig_queue_show", "Read one queue item and its transitions. For a task you handed off, this is where its answer is: the state, the closure reason and target, the notes the assignee recorded, and evidenceRef when it names an artifact (read it with rig_artifact_read). When the item was handed on, successor names the next item (on another host: its id and host); follow it with rig_queue_show. null means none was found. A revision names the work it revises in chainOfRecord. host needs the daemon's owner (the stdio server, an HTTP owner token, or unauthenticated loopback), not an ordinary scoped grant.", READ_ONLY),
|
|
1443
1560
|
inputSchema: z.object({
|
|
1444
1561
|
qitemId: z.string().describe("The qitemId returned by rig_queue_create (or any queue item)"),
|
|
1562
|
+
host: z.string().min(1).optional().describe("Act on a REGISTERED remote host's daemon instead of this one (rig host list shows the hosts; as --host on the matching rig verb); a write there names this server's seat (rig_whoami) as its sender, as a local write does"),
|
|
1445
1563
|
}),
|
|
1446
|
-
}, async ({ qitemId }) => {
|
|
1564
|
+
}, async ({ qitemId, host }) => {
|
|
1447
1565
|
try {
|
|
1566
|
+
const target = hostTarget(host);
|
|
1567
|
+
if ("content" in target)
|
|
1568
|
+
return target;
|
|
1448
1569
|
const id = encodeURIComponent(qitemId);
|
|
1449
|
-
const item = await
|
|
1570
|
+
const item = await hostGet(target, `/api/queue/${id}`);
|
|
1450
1571
|
if (item.status >= 400)
|
|
1451
1572
|
return mapResult(item);
|
|
1452
1573
|
if (scope && !scope.item(item.data))
|
|
1453
1574
|
return outOfScope(`Item ${qitemId}`);
|
|
1454
|
-
const transitions = await
|
|
1575
|
+
const transitions = await hostGet(target, `/api/queue/${id}/transitions`);
|
|
1455
1576
|
if (transitions.status >= 400)
|
|
1456
1577
|
return mapResult(transitions);
|
|
1457
1578
|
const row = (item.data ?? {});
|
|
1458
1579
|
const handedOn = row.state === "handed-off" || row.closureReason === "handed_off_to";
|
|
1459
1580
|
const view = externalView(scope);
|
|
1460
|
-
let successor = handedOn ? await successorOf(
|
|
1581
|
+
let successor = handedOn ? await successorOf((path) => hostGet(target, path), qitemId, row.closureTarget, view ? scope.item : undefined) : undefined;
|
|
1461
1582
|
if (scope && !view && successor && "destinationSession" in successor && !scope.successor(successor.destinationSession))
|
|
1462
1583
|
successor = { unknown: true, code: "out_of_scope" };
|
|
1463
1584
|
const shownItem = scope ? withoutDaemonLinkedRows(item.data) : item.data;
|
|
@@ -1473,7 +1594,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1473
1594
|
// 21. rig_queue_list — list queue items
|
|
1474
1595
|
if (offered("rig_queue_list"))
|
|
1475
1596
|
server.registerTool("rig_queue_list", {
|
|
1476
|
-
...worded("rig_queue_list", "List queue items. owned: assigned to this seat. mine: this seat is the source or the destination. Without a scope, this seat's rig. Without state, open items only (all adds closed ones); a state filter returns exactly those states, closed ones included. since finds work updated after a time; handedOffFrom finds where a handed-off item went. tags are exact, case-sensitive AND filters; mission and slice add their corresponding exact tags.", READ_ONLY),
|
|
1597
|
+
...worded("rig_queue_list", "List queue items. owned: assigned to this seat. mine: this seat is the source or the destination. Without a scope, this seat's rig. Without state, open items only (all adds closed ones); a state filter returns exactly those states, closed ones included. since finds work updated after a time; handedOffFrom finds where a handed-off item went. tags are exact, case-sensitive AND filters; mission and slice add their corresponding exact tags. host needs the daemon's owner (the stdio server, an HTTP owner token, or unauthenticated loopback), not an ordinary scoped grant.", READ_ONLY),
|
|
1477
1598
|
inputSchema: z.object({
|
|
1478
1599
|
owned: z.boolean().optional().describe("Only items assigned to this seat: its whole inbox (overrides destination)"),
|
|
1479
1600
|
mine: z.boolean().optional().describe("Items this seat sent or owns"),
|
|
@@ -1487,9 +1608,13 @@ export function createMcpServer(client, options = {}) {
|
|
|
1487
1608
|
since: z.string().optional().describe("Only items updated at or after this ISO-8601 time, e.g. done work since Monday: state done, since 2026-10-19"),
|
|
1488
1609
|
handedOffFrom: z.string().optional().describe("The items handed on from this qitemId, in any state and any rig"),
|
|
1489
1610
|
limit: z.number().int().positive().optional().describe("Result limit (default 100)"),
|
|
1611
|
+
host: z.string().min(1).optional().describe("Act on a REGISTERED remote host's daemon instead of this one (rig host list shows the hosts; as --host on the matching rig verb); a write there names this server's seat (rig_whoami) as its sender, as a local write does"),
|
|
1490
1612
|
}),
|
|
1491
|
-
}, async ({ owned, mine: mineAsked, destination, source, state, tags: requestedTags, mission, slice, all, since, handedOffFrom, limit }) => {
|
|
1613
|
+
}, async ({ owned, mine: mineAsked, destination, source, state, tags: requestedTags, mission, slice, all, since, handedOffFrom, limit, host }) => {
|
|
1492
1614
|
try {
|
|
1615
|
+
const target = hostTarget(host);
|
|
1616
|
+
if ("content" in target)
|
|
1617
|
+
return target;
|
|
1493
1618
|
if ([...(requestedTags ?? []), ...(mission === undefined ? [] : [mission]), ...(slice === undefined ? [] : [slice])]
|
|
1494
1619
|
.some((value) => value.trim().length === 0)) {
|
|
1495
1620
|
const message = "tag filters cannot be blank";
|
|
@@ -1540,7 +1665,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1540
1665
|
if (handedOffFrom)
|
|
1541
1666
|
params.set("handedOffFrom", handedOffFrom);
|
|
1542
1667
|
params.set("limit", String(limit ?? 100));
|
|
1543
|
-
const res = await
|
|
1668
|
+
const res = await hostGet(target, `/api/queue/list?${params.toString()}`);
|
|
1544
1669
|
const ignored = res.status < 400 ? ignoredFilter(res.data, { since, handedOffFrom, tags }) : null;
|
|
1545
1670
|
if (ignored) {
|
|
1546
1671
|
const message = `The daemon didn't apply ${ignored}, so this list isn't filtered by it; it needs a newer daemon.`;
|
|
@@ -1550,7 +1675,16 @@ export function createMcpServer(client, options = {}) {
|
|
|
1550
1675
|
if (scope && res.status < 400 && Array.isArray(res.data)) {
|
|
1551
1676
|
const view = externalView(scope);
|
|
1552
1677
|
const rows = res.data.filter((row) => scope.item(row));
|
|
1553
|
-
|
|
1678
|
+
const result = mapResult({ ...res, data: view ? rows.map((row) => projectForExternal(row, view)) : rows }, undefined, { structured: true });
|
|
1679
|
+
// An external caller's empty inbox says so in a line its assistant can repeat, naming the team as the person
|
|
1680
|
+
// knows it. The rows keep their shape; the line rides beside them, only when nothing narrowed the list. The
|
|
1681
|
+
// default list holds open items only, so its empty answer says no open requests, never none at all.
|
|
1682
|
+
const inbox = access?.external && (owned || mine) && !destination && !source && !state && tags.length === 0 && !since && !handedOffFrom;
|
|
1683
|
+
if (!inbox || rows.length > 0)
|
|
1684
|
+
return result;
|
|
1685
|
+
const team = teamPhrase(rosterTeamName(rostersFolder(), sessionName.split("@")[1] ?? "").name);
|
|
1686
|
+
const message = `No ${all ? "" : "open "}requests are addressed to you on ${team}.`;
|
|
1687
|
+
return { ...result, content: [...result.content, { type: "text", text: message }], structuredContent: { ...result.structuredContent, message } };
|
|
1554
1688
|
}
|
|
1555
1689
|
return mapResult(res, undefined, { structured: true });
|
|
1556
1690
|
}
|
|
@@ -1580,7 +1714,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1580
1714
|
// 23. rig_queue_update — record progress, block, or close with the answer
|
|
1581
1715
|
if (offered("rig_queue_update"))
|
|
1582
1716
|
server.registerTool("rig_queue_update", {
|
|
1583
|
-
...worded("rig_queue_update", "Update a queue item: add a note, block it, close it, or reopen a closed one. To answer a task, close it with state done, a closure reason and the answer in resolution, which the item keeps; note records why this transition happened.", DESTRUCTIVE),
|
|
1717
|
+
...worded("rig_queue_update", "Update a queue item: add a note, block it, close it, or reopen a closed one. To answer a task, close it with state done, a closure reason and the answer in resolution, which the item keeps; note records why this transition happened. host needs the daemon's owner (the stdio server, an HTTP owner token, or unauthenticated loopback), not an ordinary scoped grant.", DESTRUCTIVE),
|
|
1584
1718
|
inputSchema: z.object({
|
|
1585
1719
|
qitemId: z.string().describe("The queue item to update"),
|
|
1586
1720
|
state: z.string().optional().describe("New state (e.g. in-progress, blocked, done)"),
|
|
@@ -1590,12 +1724,16 @@ export function createMcpServer(client, options = {}) {
|
|
|
1590
1724
|
resolution: z.string().optional().describe("The outcome the item keeps, stored only by the update that closes an open item (as rig queue update --resolution)"),
|
|
1591
1725
|
reopen: z.boolean().optional().describe("Reopen a closed item: give an active state (pending, in-progress or blocked) and a note (as rig queue update --reopen)"),
|
|
1592
1726
|
summary: z.string().optional().describe("Replace the one-line summary"),
|
|
1593
|
-
evidenceRef: z.string().optional().describe("Pointer to the durable artifact, stored on the item
|
|
1727
|
+
evidenceRef: z.string().optional().describe("Pointer to the durable artifact, stored on the item with a state change (a park, a done close; a blank one isn't stored). For a code result, a JSON file of kind openrig.code-result/v1 with repo, base and revision (full commit ids) and paths lets a reader diff it exactly"),
|
|
1594
1728
|
blockedOn: z.string().optional().describe("What it waits on, when blocking: another qitemId (this item returns to pending when that one closes), or the address of the person this item came from, not a shared channel (they're asked with this item's summary, and their answer returns it to you in progress)"),
|
|
1595
1729
|
wakeAfterSeconds: z.number().int().positive().optional().describe("Wake this seat after this many seconds, when blocking. Delivered only to a seat with a terminal: an attached app can't receive it today, so the item just waits until it is checked."),
|
|
1730
|
+
host: z.string().min(1).optional().describe("Act on a REGISTERED remote host's daemon instead of this one (rig host list shows the hosts; as --host on the matching rig verb); a write there names this server's seat (rig_whoami) as its sender, as a local write does"),
|
|
1596
1731
|
}),
|
|
1597
|
-
}, async ({ qitemId, state, closureReason, closureTarget, note, resolution, reopen, summary, evidenceRef, blockedOn, wakeAfterSeconds }) => {
|
|
1732
|
+
}, async ({ qitemId, state, closureReason, closureTarget, note, resolution, reopen, summary, evidenceRef, blockedOn, wakeAfterSeconds, host }) => {
|
|
1598
1733
|
try {
|
|
1734
|
+
const target = hostTarget(host);
|
|
1735
|
+
if ("content" in target)
|
|
1736
|
+
return target;
|
|
1599
1737
|
const denied = await itemOutOfScope(qitemId, "owner");
|
|
1600
1738
|
if (denied)
|
|
1601
1739
|
return denied;
|
|
@@ -1606,7 +1744,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1606
1744
|
if (!blocker || blocker.status >= 400 || !scope?.item(blocker.data))
|
|
1607
1745
|
return outOfScope(`Blocker ${blockedOn ?? "(none named)"}`);
|
|
1608
1746
|
}
|
|
1609
|
-
const res = await
|
|
1747
|
+
const res = await hostPost(target, `/api/queue/${encodeURIComponent(qitemId)}/update`, {
|
|
1610
1748
|
state, closureReason, closureTarget, summary, evidenceRef, blockedOn, wakeAfterSeconds, transitionNote: note, resolution, reopen,
|
|
1611
1749
|
});
|
|
1612
1750
|
// An external caller's updated item goes through the same projection as show and list.
|
|
@@ -1738,7 +1876,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1738
1876
|
// 27. rig_team — a rig's seats and its lead
|
|
1739
1877
|
if (offered("rig_team"))
|
|
1740
1878
|
server.registerTool("rig_team", {
|
|
1741
|
-
...worded("rig_team", "Show a rig's team. For an external grant, omit rigId to use its sole rig or see its granted names to choose from. The answer includes its lead, the rig's one delegates_to root (the seat that delegates to others and that nothing delegates to: the seat to delegate to), and each seat's pod, role, runtime, delegation (reportsTo, delegatesTo) and activity as the daemon reports it. Activity the daemon doesn't know reads unknown, never idle. hostedMembers are the rig's members that live outside a terminal (roster entries marked hosted): their authored capabilities and limits, with no pane and activity unknown.", READ_ONLY),
|
|
1879
|
+
...worded("rig_team", "Show a rig's team. For an external grant, omit rigId to use its sole rig or see its granted names to choose from. The answer includes its lead, the rig's one delegates_to root (the seat that delegates to others and that nothing delegates to: the seat to delegate to), and each seat's pod, role, runtime, delegation (reportsTo, delegatesTo) and activity as the daemon reports it. Activity the daemon doesn't know reads unknown, never idle. hostedMembers are the rig's members that live outside a terminal (roster entries marked hosted): their authored capabilities and limits, with no pane and activity unknown. rig.displayName and a member's label, where a roster authors them, are the names the person knows them by.", READ_ONLY),
|
|
1742
1880
|
inputSchema: z.object({
|
|
1743
1881
|
rigId: z.string().optional().describe("Rig name or id. A connection from outside the rig (an external grant) usually leaves this out, and the tool finds its team; if it passes one, it must be the granted rig's name, never its id or the team's display name."),
|
|
1744
1882
|
}),
|
|
@@ -1779,8 +1917,15 @@ export function createMcpServer(client, options = {}) {
|
|
|
1779
1917
|
const rigName = (detail.data ?? {}).rig?.name ?? "";
|
|
1780
1918
|
const inventory = Array.isArray(nodes.data) ? nodes.data : [];
|
|
1781
1919
|
// A node is a seat whether or not it has a session yet: its address derives from its logical id (pod.member).
|
|
1782
|
-
const
|
|
1783
|
-
|
|
1920
|
+
const logicalAddress = (logicalId) => typeof logicalId === "string" ? `${logicalId.replace(".", "-")}@${rigName}` : null;
|
|
1921
|
+
const nodeSeats = new Set(inventory.flatMap((seat) => [seat.canonicalSessionName, logicalAddress(seat.logicalId)])
|
|
1922
|
+
.filter((name) => typeof name === "string"));
|
|
1923
|
+
// An external caller's own seat, under any name it's matched by: its session's name or its logical address, the
|
|
1924
|
+
// same mapping the roster match uses. Its node's other name is its too.
|
|
1925
|
+
const caller = access?.external ? seatOf() : undefined;
|
|
1926
|
+
const callerNode = caller ? inventory.find((seat) => seat.canonicalSessionName === caller || logicalAddress(seat.logicalId) === caller) : undefined;
|
|
1927
|
+
const ownNames = new Set([caller, callerNode?.canonicalSessionName, logicalAddress(callerNode?.logicalId)]
|
|
1928
|
+
.filter((name) => typeof name === "string"));
|
|
1784
1929
|
// One read of the daemon's check-ins serves every member in this answer.
|
|
1785
1930
|
let checkIns;
|
|
1786
1931
|
const checkInOf = async (seat) => {
|
|
@@ -1798,14 +1943,44 @@ export function createMcpServer(client, options = {}) {
|
|
|
1798
1943
|
};
|
|
1799
1944
|
const hosted = await hostedMembersOf(rostersFolder(), rigName, nodeSeats, async () => inventory.find((seat) => typeof seat.hostSelfId === "string")?.hostSelfId
|
|
1800
1945
|
?? await client.get("/healthz").then((res) => (res.status < 400 ? (res.data ?? {}).selfHostId ?? null : null), () => null), async (seat) => {
|
|
1946
|
+
// An external caller's own seat is listed so it can see its address, without a line about its own activity.
|
|
1947
|
+
if (ownNames.has(seat))
|
|
1948
|
+
return null;
|
|
1801
1949
|
const rows = await client.get(`/api/queue/list?${new URLSearchParams({ destinationSession: seat, compact: "1", limit: String(PRESENCE_ROWS) }).toString()}`)
|
|
1802
1950
|
.then((res) => (res.status < 400 ? res.data : null), () => null);
|
|
1803
1951
|
// An external caller sees a ring only on an item it may read, so another pair's item isn't named.
|
|
1804
1952
|
const visible = access?.external && Array.isArray(rows) ? rows.filter((row) => scope?.item(row)) : rows;
|
|
1805
1953
|
return { lastCallAt: readPresence(presenceFile())[seat]?.lastCallAt ?? null, lastWake: newestWake(visible, seat),
|
|
1806
1954
|
lastWakeScope: `the latest ring among its ${PRESENCE_ROWS} most recent rows`, checkIn: await checkInOf(seat) };
|
|
1955
|
+
}, !!access?.external);
|
|
1956
|
+
const note = hosted.note ? { hostedMembersNote: hosted.note } : {};
|
|
1957
|
+
// The names a person knows the team by are for a person's assistant on an external grant; an internal caller's
|
|
1958
|
+
// answer is as it was.
|
|
1959
|
+
if (!access?.external)
|
|
1960
|
+
return mapResult({ status: 200, data: { ...view, hostedMembers: hosted.members, ...note } }, undefined, { structured: true });
|
|
1961
|
+
// The caller's own entry keeps its address and identity, with no line about its own activity.
|
|
1962
|
+
// A node seat on a roster carries its authored entry and presence; a seat on none is as the daemon reports it.
|
|
1963
|
+
const seats = view.seats.map((seat) => {
|
|
1964
|
+
const address = logicalAddress(seat.logicalId);
|
|
1965
|
+
const entry = hosted.seats.get(seat.session) ?? (address ? hosted.seats.get(address) : undefined);
|
|
1966
|
+
const merged = entry ? { ...seat, ...entry } : seat;
|
|
1967
|
+
if (!ownNames.has(merged.session) && !(address && ownNames.has(address)))
|
|
1968
|
+
return merged;
|
|
1969
|
+
const { activity: _activity, sessionStatus: _status, ...identity } = merged;
|
|
1970
|
+
return identity;
|
|
1971
|
+
});
|
|
1972
|
+
const hostedMembers = hosted.members.map((member) => {
|
|
1973
|
+
if (!ownNames.has(member.session))
|
|
1974
|
+
return member;
|
|
1975
|
+
const { activity: _activity, ...identity } = member;
|
|
1976
|
+
return identity;
|
|
1807
1977
|
});
|
|
1808
|
-
|
|
1978
|
+
// The name the person knows the team by, where its network roster names it; otherwise the rig's own fields, and why
|
|
1979
|
+
// an authored name isn't shown.
|
|
1980
|
+
const team = rosterTeamName(rostersFolder(), rigName);
|
|
1981
|
+
const rigView = { ...view.rig, ...(team.name ? { displayName: team.name } : {}),
|
|
1982
|
+
...(team.problem ? { displayNameProblem: team.problem } : {}) };
|
|
1983
|
+
return mapResult({ status: 200, data: { ...view, rig: rigView, seats, hostedMembers, ...note } }, undefined, { structured: true });
|
|
1809
1984
|
}
|
|
1810
1985
|
catch (err) {
|
|
1811
1986
|
return caught(err);
|
|
@@ -2243,7 +2418,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
2243
2418
|
// 35. rig_queue_handoff — pass an item on to the next seat in one step, the route `rig queue handoff` uses
|
|
2244
2419
|
if (offered("rig_queue_handoff"))
|
|
2245
2420
|
server.registerTool("rig_queue_handoff", {
|
|
2246
|
-
description: "Pass a queue item this seat holds on to the next seat in one step: the item closes as handed off and a new item opens for that seat, carrying the work's lineage in chainOfRecord, so whoever follows the work reaches the new item from rig_queue_show. Without body the new item keeps the task's text. If the call times out, check rig_queue_show on this qitemId before retrying: when it reads handed off, its successor is the new item, so don't hand it off again.",
|
|
2421
|
+
description: "Pass a queue item this seat holds on to the next seat in one step: the item closes as handed off and a new item opens for that seat, carrying the work's lineage in chainOfRecord, so whoever follows the work reaches the new item from rig_queue_show. Without body the new item keeps the task's text. If the call times out, check rig_queue_show on this qitemId before retrying: when it reads handed off, its successor is the new item, so don't hand it off again. host needs the daemon's owner (the stdio server, an HTTP owner token, or unauthenticated loopback), not an ordinary scoped grant.",
|
|
2247
2422
|
inputSchema: z.object({
|
|
2248
2423
|
qitemId: z.string().describe("The queue item to pass on"),
|
|
2249
2424
|
to: z.string().describe("The next seat (e.g. qa@my-rig)"),
|
|
@@ -2253,9 +2428,13 @@ export function createMcpServer(client, options = {}) {
|
|
|
2253
2428
|
tags: z.array(z.string()).optional().describe("Tags for the new item (default: the item's own)"),
|
|
2254
2429
|
priority: z.string().optional().describe("Priority for the new item (default: the item's own)"),
|
|
2255
2430
|
evidenceRef: z.string().optional().describe("Pointer to the durable artifact, which a new item for a person needs"),
|
|
2431
|
+
host: z.string().min(1).optional().describe("Act on a REGISTERED remote host's daemon instead of this one (rig host list shows the hosts; as --host on the matching rig verb); a write there names this server's seat (rig_whoami) as its sender, as a local write does"),
|
|
2256
2432
|
}),
|
|
2257
2433
|
annotations: DESTRUCTIVE,
|
|
2258
|
-
}, async ({ qitemId, to, body, note, summary, tags, priority, evidenceRef }) => {
|
|
2434
|
+
}, async ({ qitemId, to, body, note, summary, tags, priority, evidenceRef, host }) => {
|
|
2435
|
+
const target = hostTarget(host);
|
|
2436
|
+
if ("content" in target)
|
|
2437
|
+
return target;
|
|
2259
2438
|
if (scope && !scope.session(to))
|
|
2260
2439
|
return outOfScope(`Destination ${to}`);
|
|
2261
2440
|
try {
|
|
@@ -2267,14 +2446,14 @@ export function createMcpServer(client, options = {}) {
|
|
|
2267
2446
|
return caught(err);
|
|
2268
2447
|
}
|
|
2269
2448
|
try {
|
|
2270
|
-
return mapResult(await
|
|
2449
|
+
return mapResult(await hostPost(target, `/api/queue/${encodeURIComponent(qitemId)}/handoff`, {
|
|
2271
2450
|
toSession: to, body, transitionNote: note, summary, tags, priority, evidenceRef,
|
|
2272
2451
|
}), undefined, { structured: true });
|
|
2273
2452
|
}
|
|
2274
2453
|
catch (err) {
|
|
2275
2454
|
const failure = caught(err);
|
|
2276
|
-
const text = `${err.message} The outcome is unknown: check rig_queue_show with qitemId ${qitemId} before retrying. If it reads handed off, its successor is the new item, so don't hand it off again.`;
|
|
2277
|
-
return { ...failure, content: [{ type: "text", text }], structuredContent: { ...failure.structuredContent, qitemId, outcome: "unknown" } };
|
|
2455
|
+
const text = `${err.message} The outcome is unknown: check rig_queue_show with qitemId ${qitemId}${target.remote && target.name ? ` and host ${target.name}` : ""} before retrying. If it reads handed off, its successor is the new item, so don't hand it off again.`;
|
|
2456
|
+
return { ...failure, content: [{ type: "text", text }], structuredContent: { ...failure.structuredContent, qitemId, outcome: "unknown", ...(target.remote && target.name ? { host: target.name } : {}) } };
|
|
2278
2457
|
}
|
|
2279
2458
|
});
|
|
2280
2459
|
// 36. rig_queue_unclaim — put back an item this seat claimed and won't finish
|