@openrig/cli 0.7.14 → 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 +28 -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 +8 -5
- package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +13 -4
- package/daemon/assets/plugins/openrig-core/skills/orienting-to-an-inherited-seat/CHANGELOG.md +10 -0
- package/daemon/assets/plugins/openrig-core/skills/orienting-to-an-inherited-seat/SKILL.md +12 -13
- 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 +127 -16
- package/daemon/context-packs/reference/getting-started.md +17 -15
- 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 +355 -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 +8 -5
- package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +13 -4
- 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/CHANGELOG.md +10 -0
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/SKILL.md +12 -13
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +3 -3
- 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 +88 -31
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts +2 -0
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.js +93 -36
- package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/pi-resume.d.ts +3 -0
- package/daemon/dist/adapters/pi-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-resume.js +99 -51
- package/daemon/dist/adapters/pi-resume.js.map +1 -1
- package/daemon/dist/adapters/pi-runner.d.ts +2 -1
- package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.js +15 -9
- package/daemon/dist/adapters/pi-runner.js.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts +4 -0
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.js +133 -75
- package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +10 -0
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +42 -7
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/daemon-shutdown.d.ts +3 -0
- package/daemon/dist/daemon-shutdown.d.ts.map +1 -1
- package/daemon/dist/daemon-shutdown.js +6 -0
- package/daemon/dist/daemon-shutdown.js.map +1 -1
- package/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +6 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/165_run_bound_activity_grants.d.ts +4 -0
- package/daemon/dist/db/migrations/165_run_bound_activity_grants.d.ts.map +1 -0
- package/daemon/dist/db/migrations/165_run_bound_activity_grants.js +14 -0
- package/daemon/dist/db/migrations/165_run_bound_activity_grants.js.map +1 -0
- 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/activity-grants.d.ts +36 -3
- package/daemon/dist/domain/activity-grants.d.ts.map +1 -1
- package/daemon/dist/domain/activity-grants.js +188 -7
- package/daemon/dist/domain/activity-grants.js.map +1 -1
- package/daemon/dist/domain/applied-launch-observation-store.d.ts +2 -0
- package/daemon/dist/domain/applied-launch-observation-store.d.ts.map +1 -1
- package/daemon/dist/domain/applied-launch-observation-store.js +27 -16
- package/daemon/dist/domain/applied-launch-observation-store.js.map +1 -1
- 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 +85 -38
- 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 +25 -2
- package/daemon/dist/domain/codex-member-permissions.d.ts.map +1 -1
- package/daemon/dist/domain/codex-member-permissions.js +72 -18
- 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/codex-owned-plugin-trust.d.ts +6 -1
- package/daemon/dist/domain/codex-owned-plugin-trust.d.ts.map +1 -1
- package/daemon/dist/domain/codex-owned-plugin-trust.js +30 -9
- package/daemon/dist/domain/codex-owned-plugin-trust.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/execution-candidate-reader.d.ts +15 -5
- package/daemon/dist/domain/execution-candidate-reader.d.ts.map +1 -1
- package/daemon/dist/domain/execution-candidate-reader.js +36 -25
- package/daemon/dist/domain/execution-candidate-reader.js.map +1 -1
- package/daemon/dist/domain/execution-view.d.ts.map +1 -1
- package/daemon/dist/domain/execution-view.js +34 -11
- package/daemon/dist/domain/execution-view.js.map +1 -1
- package/daemon/dist/domain/gateway/destination-resolver.js +3 -3
- package/daemon/dist/domain/gateway/destination-resolver.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/config.d.ts +2 -0
- package/daemon/dist/domain/gateway/slack/config.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/config.js +4 -0
- package/daemon/dist/domain/gateway/slack/config.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.d.ts +11 -0
- package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.js +3 -0
- package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-api.d.ts +2 -0
- package/daemon/dist/domain/gateway/slack/slack-api.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-api.js +4 -0
- package/daemon/dist/domain/gateway/slack/slack-api.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +2 -0
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.js +2 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js +36 -2
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/thread-routing.d.ts +5 -0
- package/daemon/dist/domain/gateway/slack/thread-routing.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/thread-routing.js +1 -1
- package/daemon/dist/domain/gateway/slack/thread-routing.js.map +1 -1
- 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 +58 -11
- 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 +40 -0
- package/daemon/dist/domain/native-permission-store.d.ts.map +1 -1
- package/daemon/dist/domain/native-permission-store.js +115 -29
- 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 +33 -1
- package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
- package/daemon/dist/domain/native-resume-probe.js +143 -4
- 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 +214 -30
- 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/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 +2 -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/permission-policy/persisted-restore-posture.d.ts +62 -0
- package/daemon/dist/domain/permission-policy/persisted-restore-posture.d.ts.map +1 -0
- package/daemon/dist/domain/permission-policy/persisted-restore-posture.js +117 -0
- package/daemon/dist/domain/permission-policy/persisted-restore-posture.js.map +1 -0
- package/daemon/dist/domain/policies/context-usage-threshold.d.ts.map +1 -1
- package/daemon/dist/domain/policies/context-usage-threshold.js +5 -1
- package/daemon/dist/domain/policies/context-usage-threshold.js.map +1 -1
- package/daemon/dist/domain/policies/types.d.ts +2 -0
- package/daemon/dist/domain/policies/types.d.ts.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 +29 -16
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +61 -55
- 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/queue-wake-ladder.d.ts +12 -0
- package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +27 -7
- package/daemon/dist/domain/queue-wake-ladder.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/rehydrate-eligibility.d.ts.map +1 -1
- package/daemon/dist/domain/rehydrate-eligibility.js +3 -2
- package/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
- package/daemon/dist/domain/reply-to-choice.d.ts +10 -0
- package/daemon/dist/domain/reply-to-choice.d.ts.map +1 -1
- package/daemon/dist/domain/reply-to-choice.js +23 -0
- package/daemon/dist/domain/reply-to-choice.js.map +1 -1
- package/daemon/dist/domain/restore-check-service.d.ts +5 -0
- package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
- package/daemon/dist/domain/restore-check-service.js +31 -6
- package/daemon/dist/domain/restore-check-service.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +88 -98
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/restore-preconditions.d.ts +2 -0
- package/daemon/dist/domain/restore-preconditions.d.ts.map +1 -1
- package/daemon/dist/domain/restore-preconditions.js +6 -0
- package/daemon/dist/domain/restore-preconditions.js.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.d.ts +21 -4
- package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.js +65 -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 +8 -3
- 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/runner-grant-launch.d.ts +16 -0
- package/daemon/dist/domain/runner-grant-launch.d.ts.map +1 -0
- package/daemon/dist/domain/runner-grant-launch.js +86 -0
- package/daemon/dist/domain/runner-grant-launch.js.map +1 -0
- package/daemon/dist/domain/runtime-adapter.d.ts +17 -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 +21 -3
- package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.js +91 -4
- 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 +450 -35
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.d.ts +3 -0
- package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.js +34 -2
- package/daemon/dist/domain/seat-identity-reconciler.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 +53 -3
- 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 +62 -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-registry.d.ts +2 -0
- package/daemon/dist/domain/session-registry.d.ts.map +1 -1
- package/daemon/dist/domain/session-registry.js +16 -0
- package/daemon/dist/domain/session-registry.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 +7 -3
- 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/skill-discovery.d.ts.map +1 -1
- package/daemon/dist/domain/skill-discovery.js +2 -1
- package/daemon/dist/domain/skill-discovery.js.map +1 -1
- package/daemon/dist/domain/slow-op-recorder.d.ts +3 -0
- package/daemon/dist/domain/slow-op-recorder.d.ts.map +1 -1
- package/daemon/dist/domain/slow-op-recorder.js +5 -0
- package/daemon/dist/domain/slow-op-recorder.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/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +9 -0
- package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts +19 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +81 -39
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/sync-site-wrap.d.ts +13 -1
- package/daemon/dist/domain/sync-site-wrap.d.ts.map +1 -1
- package/daemon/dist/domain/sync-site-wrap.js +38 -0
- package/daemon/dist/domain/sync-site-wrap.js.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.d.ts +3 -1
- package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.js +17 -12
- package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +37 -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/watchdog-policy-engine.d.ts +5 -0
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +4 -0
- package/daemon/dist/domain/watchdog-policy-engine.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 +8 -2
- 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/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +34 -2
- package/daemon/dist/routes/activity.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 +63 -16
- 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 +132 -46
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/agent-startup-guide.md +88 -1
- package/daemon/docs/reference/bundle-formats.md +6 -4
- package/daemon/docs/reference/daemon-http-clients.md +3 -1
- package/daemon/docs/reference/developing.md +1 -1
- package/daemon/docs/reference/gateway-participants.md +5 -3
- package/daemon/docs/reference/getting-started.md +17 -15
- package/daemon/docs/reference/harness-runner-contract.md +27 -1
- package/daemon/docs/reference/health-diagnosis.md +5 -3
- package/daemon/docs/reference/keeping-a-watch.md +14 -9
- 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/slack-app-setup.md +4 -0
- package/daemon/docs/reference/whats-new.md +355 -5
- package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +13 -4
- 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/down.d.ts.map +1 -1
- package/dist/commands/down.js +2 -1
- package/dist/commands/down.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 +1 -0
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +13 -6
- 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/slack.d.ts.map +1 -1
- package/dist/commands/slack.js +2 -0
- package/dist/commands/slack.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/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +10 -5
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/lib/work-install.d.ts.map +1 -1
- package/dist/lib/work-install.js +7 -3
- package/dist/lib/work-install.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 +269 -76
- 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/connected-assistants.js +1 -1
- package/tui/dist/connected-assistants.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 +7 -3
- 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 +8 -2
- 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/ui/dist/assets/index-BX8TUZ0E.css +32 -0
- package/ui/dist/assets/{index-BOYrLyfQ.js → index-BvUEh33d.js} +1 -1
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-DqSRu4OY.css +0 -32
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) {
|
|
@@ -552,18 +571,52 @@ export const MEMBER_WORKFLOW = [
|
|
|
552
571
|
].join(" ");
|
|
553
572
|
// Short guidance a client may show the model (the server's MCP instructions). An external caller's connection asks the
|
|
554
573
|
// team for work and isn't one of its members, so it isn't given the member workflow.
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
574
|
+
/** The paragraphs every seat's connection shares, naming a tool only where `has` says the connection offers it. A local or
|
|
575
|
+
* authenticated member is offered every tool named here; an external grant is offered only the ones its grant names. */
|
|
576
|
+
function sharedInstructions(has) {
|
|
577
|
+
const finding = [has("rig_whoami") ? "rig_whoami shows which, and whether the caller is authenticated" : "",
|
|
578
|
+
has("rig_team") ? "rig_team shows a rig's seats and its lead" : ""].filter(Boolean).join("; ");
|
|
579
|
+
const showing = "rig_queue_show, which names the next item when the work was handed on";
|
|
580
|
+
const handing = has("rig_queue_create")
|
|
581
|
+
? `To hand work to a seat, use rig_queue_create and keep its qitemId${has("rig_queue_show") ? `; read the answer later with ${showing}` : ""}. `
|
|
582
|
+
: has("rig_queue_show") ? `Read an item's answer with ${showing}. ` : "";
|
|
583
|
+
return [
|
|
584
|
+
`This server reaches an OpenRig team as one seat: the one named by OPENRIG_SESSION_NAME where the server was configured, or, over authenticated HTTP, the seat of the caller's grant${finding ? ` (${finding})` : ""}. The daemon attributes this server's writes to that seat.`,
|
|
585
|
+
`${handing}${has("rig_queue_handoff") ? "To pass on work this seat holds, use rig_queue_handoff rather than closing it and creating another, so the work stays one chain. " : ""}Queue items are durable: they outlive this conversation and this server.`,
|
|
586
|
+
"Tools marked read-only change nothing. A seat whose activity is unknown is not idle, and an accepted request (a restore's attemptId) is not a finished one.",
|
|
587
|
+
`A question reserved for a person is theirs to answer: don't answer it on their behalf.${has("rig_queue_decide") ? " rig_queue_decide records a decision only inside the decision room of the mode they have on, beside their answers and never as one." : ""}`,
|
|
588
|
+
];
|
|
589
|
+
}
|
|
590
|
+
const SHARED_INSTRUCTIONS = sharedInstructions(() => true);
|
|
561
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
|
+
}
|
|
562
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
|
|
563
615
|
* that works its inbox. The team's questions to it are the person's to answer. */
|
|
564
|
-
export const FRONT_DOOR_WORKFLOW_VERSION = "front-door/
|
|
616
|
+
export const FRONT_DOOR_WORKFLOW_VERSION = "front-door/v3";
|
|
565
617
|
export const FRONT_DOOR_WORKFLOW = [
|
|
566
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),
|
|
567
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.",
|
|
568
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.",
|
|
569
622
|
"Nothing wakes this conversation when the team finishes: check your work and your items when the person asks or comes back.",
|
|
@@ -589,16 +642,22 @@ const EXTERNAL_PERSON_INSTRUCTIONS = [
|
|
|
589
642
|
...EXTERNAL_HOW,
|
|
590
643
|
"To answer one, show the person the question and its options as rig_question_list gives them. Then pass rig_question_answer its qitemId, the revision you showed, and either the options they chose or exactly what they typed, with no label or words of your own. If the question changed, show them the new one; if it was already answered or closed, say so. It's recorded as their answer, given through this connection. A question reserved for a person is theirs to answer, never yours.",
|
|
591
644
|
].join("\n");
|
|
592
|
-
/** For an external grant that names claim and update: how it works the items addressed to it, messages included.
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
645
|
+
/** For an external grant that names claim and update: how it works the items addressed to it, messages included. It names
|
|
646
|
+
* only the tools that grant offers. */
|
|
647
|
+
function externalInboxInstructions(tools) {
|
|
648
|
+
return [...sharedInstructions((tool) => tools.has(tool)),
|
|
649
|
+
`Items addressed to your seat are yours${tools.has("rig_queue_list") ? ": rig_queue_list with owned set lists them" : ""}. For each, claim it (rig_queue_claim), do it, then close it done with closure reason no-follow-on and the answer in resolution (rig_queue_update); the sender reads that answer on the same item. A message is an item too: read it and close it done, with your reply in resolution when it needs one; its sender reads that reply on the same item. Nothing promises to wake you, so check your items again.`,
|
|
650
|
+
].join("\n");
|
|
651
|
+
}
|
|
596
652
|
function instructionsFor(access, frontDoor = false) {
|
|
597
653
|
if (!access?.external)
|
|
598
654
|
return frontDoor ? FRONT_DOOR_INSTRUCTIONS : INSTRUCTIONS;
|
|
599
655
|
const tools = externalTools(access.external);
|
|
600
|
-
const
|
|
656
|
+
const workflow = tools.has("rig_queue_claim") && tools.has("rig_queue_update") ? externalInboxInstructions(tools)
|
|
601
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;
|
|
602
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;
|
|
603
662
|
}
|
|
604
663
|
/** The seats of `rigName` that `name` names, each as its actual session: its node's canonical session, or the
|
|
@@ -719,10 +778,65 @@ export function createMcpServer(client, options = {}) {
|
|
|
719
778
|
version: CLI_VERSION,
|
|
720
779
|
}, { instructions: instructionsFor(options.access, options.frontDoor === true) });
|
|
721
780
|
const { access } = options;
|
|
722
|
-
const
|
|
723
|
-
const
|
|
781
|
+
const clientFactory = options.clientFactory ?? ((url) => new DaemonClient(url));
|
|
782
|
+
const hostRegistryLoader = options.hostRegistryLoader ?? loadHostRegistry;
|
|
783
|
+
const hostBindingsLoader = options.hostBindingsLoader ?? loadHostBindings;
|
|
724
784
|
// The seat this server acts as: the authenticated caller's, else OPENRIG_SESSION_NAME where it was configured.
|
|
725
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());
|
|
726
840
|
// With no seat (none configured, or one an app left unfilled), messages, new tasks and chat still go through, as an
|
|
727
841
|
// unknown sender. Its label is this server's own and no seat's, so two unknown callers never count as one author (a
|
|
728
842
|
// delegated decision compares authors). Its note says only what is known: why there's no seat, and how the client
|
|
@@ -851,12 +965,17 @@ export function createMcpServer(client, options = {}) {
|
|
|
851
965
|
// 3. rig_ps — list running rigs
|
|
852
966
|
if (offered("rig_ps"))
|
|
853
967
|
server.registerTool("rig_ps", {
|
|
854
|
-
description: "List rigs and their status",
|
|
855
|
-
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
|
+
}),
|
|
856
972
|
annotations: READ_ONLY,
|
|
857
|
-
}, async () => {
|
|
973
|
+
}, async ({ host }) => {
|
|
858
974
|
try {
|
|
859
|
-
const
|
|
975
|
+
const target = hostTarget(host);
|
|
976
|
+
if ("content" in target)
|
|
977
|
+
return target;
|
|
978
|
+
const res = await hostGet(target, "/api/ps");
|
|
860
979
|
if (scope && res.status < 400 && Array.isArray(res.data))
|
|
861
980
|
return mapResult({ ...res, data: res.data.filter((entry) => scope.rig(entry.name)) });
|
|
862
981
|
return mapResult(res);
|
|
@@ -1097,17 +1216,21 @@ export function createMcpServer(client, options = {}) {
|
|
|
1097
1216
|
// 14. rig_send — send message to agent session
|
|
1098
1217
|
if (offered("rig_send"))
|
|
1099
1218
|
server.registerTool("rig_send", {
|
|
1100
|
-
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.",
|
|
1101
1220
|
inputSchema: z.object({
|
|
1102
1221
|
session: z.string().describe("Target session name (e.g. dev-impl@my-rig)"),
|
|
1103
1222
|
text: z.string().describe("Message text to send"),
|
|
1104
1223
|
verify: z.boolean().optional().describe("Verify delivery by checking pane content"),
|
|
1105
1224
|
force: z.boolean().optional().describe("Send even if target appears mid-task"),
|
|
1106
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"),
|
|
1107
1227
|
}),
|
|
1108
1228
|
annotations: DESTRUCTIVE,
|
|
1109
|
-
}, async ({ session, text, verify, force, waitForIdleSeconds }) => {
|
|
1229
|
+
}, async ({ session, text, verify, force, waitForIdleSeconds, host }) => {
|
|
1110
1230
|
try {
|
|
1231
|
+
const target = hostTarget(host);
|
|
1232
|
+
if ("content" in target)
|
|
1233
|
+
return target;
|
|
1111
1234
|
if (force && waitForIdleSeconds !== undefined) {
|
|
1112
1235
|
const message = "waitForIdleSeconds cannot be combined with force";
|
|
1113
1236
|
return errorResult(JSON.stringify({ ok: false, error: message }), "invalid_arguments", message);
|
|
@@ -1117,13 +1240,13 @@ export function createMcpServer(client, options = {}) {
|
|
|
1117
1240
|
const waitForIdleMs = waitForIdleSeconds === undefined ? undefined : Math.ceil(waitForIdleSeconds * 1000);
|
|
1118
1241
|
// Unsigned, as before (the transport names it "<unknown sender>"); the note tells the recipient what is known.
|
|
1119
1242
|
const note = unknownSenderNote("message");
|
|
1120
|
-
const res = await
|
|
1243
|
+
const res = await hostPost(target, "/api/transport/send", {
|
|
1121
1244
|
session,
|
|
1122
1245
|
text: note ? `${note}\n${text}` : text,
|
|
1123
1246
|
verify,
|
|
1124
1247
|
force,
|
|
1125
1248
|
waitForIdleMs,
|
|
1126
|
-
},
|
|
1249
|
+
}, waitForIdleRequestOptions(waitForIdleMs));
|
|
1127
1250
|
return mapResult(res);
|
|
1128
1251
|
}
|
|
1129
1252
|
catch (err) {
|
|
@@ -1133,16 +1256,20 @@ export function createMcpServer(client, options = {}) {
|
|
|
1133
1256
|
// 15. rig_capture — capture terminal output from agent session
|
|
1134
1257
|
if (offered("rig_capture"))
|
|
1135
1258
|
server.registerTool("rig_capture", {
|
|
1136
|
-
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.",
|
|
1137
1260
|
inputSchema: z.object({
|
|
1138
1261
|
session: z.string().optional().describe("Session name (omit for multi-target with rig/pod)"),
|
|
1139
1262
|
rig: z.string().optional().describe("Capture all sessions in a rig"),
|
|
1140
1263
|
pod: z.string().optional().describe("Capture all sessions in a pod"),
|
|
1141
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"),
|
|
1142
1266
|
}),
|
|
1143
1267
|
annotations: READ_ONLY,
|
|
1144
|
-
}, async ({ session, rig, pod, lines }) => {
|
|
1268
|
+
}, async ({ session, rig, pod, lines, host }) => {
|
|
1145
1269
|
try {
|
|
1270
|
+
const target = hostTarget(host);
|
|
1271
|
+
if ("content" in target)
|
|
1272
|
+
return target;
|
|
1146
1273
|
let rigName = rig;
|
|
1147
1274
|
if (scope) {
|
|
1148
1275
|
if (session && !scope.session(session))
|
|
@@ -1168,7 +1295,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1168
1295
|
if (lines)
|
|
1169
1296
|
body.lines = lines;
|
|
1170
1297
|
body.inputBox = true; // what the live input box holds, in the result's inputBox
|
|
1171
|
-
const res = await
|
|
1298
|
+
const res = await hostPost(target, "/api/transport/capture", body);
|
|
1172
1299
|
return mapResult(res);
|
|
1173
1300
|
}
|
|
1174
1301
|
catch (err) {
|
|
@@ -1277,7 +1404,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1277
1404
|
// 19. rig_queue_create — hand a task to a seat
|
|
1278
1405
|
if (offered("rig_queue_create"))
|
|
1279
1406
|
server.registerTool("rig_queue_create", {
|
|
1280
|
-
...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),
|
|
1281
1408
|
inputSchema: z.object({
|
|
1282
1409
|
destination: access?.external
|
|
1283
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")
|
|
@@ -1290,8 +1417,12 @@ export function createMcpServer(client, options = {}) {
|
|
|
1290
1417
|
qitemId: z.string().optional().describe("Request id to reuse when retrying the same create (default: a new id)"),
|
|
1291
1418
|
revises: z.string().optional().describe("The qitemId of the work this asks to revise"),
|
|
1292
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"),
|
|
1293
1421
|
}),
|
|
1294
|
-
}, 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;
|
|
1295
1426
|
// The server's one receiver counts for this connection only when its grant reaches it. Then a refused destination
|
|
1296
1427
|
// says how to reach it, so the assistant retries instead of telling the person the connection lacks access. It
|
|
1297
1428
|
// never names the receiver.
|
|
@@ -1360,7 +1491,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1360
1491
|
let lineage;
|
|
1361
1492
|
if (revises) {
|
|
1362
1493
|
try {
|
|
1363
|
-
const original = await
|
|
1494
|
+
const original = await hostGet(target, `/api/queue/${encodeURIComponent(revises)}`);
|
|
1364
1495
|
if (original.status >= 400)
|
|
1365
1496
|
return mapResult(original);
|
|
1366
1497
|
if (scope && !scope.item(original.data))
|
|
@@ -1395,7 +1526,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1395
1526
|
// With no seat, the task goes to its destination as from the unknown sender, with the note at the top of its body.
|
|
1396
1527
|
const note = unknownSenderNote("task");
|
|
1397
1528
|
try {
|
|
1398
|
-
const res = await
|
|
1529
|
+
const res = await hostPost(target, "/api/queue/create", {
|
|
1399
1530
|
qitemId: id, destinationSession: destination, body: note ? `${note}\n\n${lineage?.body ?? body}` : lineage?.body ?? body,
|
|
1400
1531
|
...(note ? { sourceSession: unknownSender } : {}), summary, priority, tier,
|
|
1401
1532
|
tags: access?.external ? tags?.filter((tag) => !OPENRIG_PROVENANCE_TAG.test(tag)) : tags,
|
|
@@ -1413,37 +1544,41 @@ export function createMcpServer(client, options = {}) {
|
|
|
1413
1544
|
const view = externalView(scope);
|
|
1414
1545
|
// An unknown sender has no return address, so it says how to follow the task.
|
|
1415
1546
|
const sent = note && res.status < 400 && res.data && typeof res.data === "object" ? { ...res, data: { ...res.data,
|
|
1416
|
-
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;
|
|
1417
1548
|
return mapResult(view && sent.status < 400 ? { ...sent, data: projectForExternal(sent.data, view) } : sent, undefined, { structured: true });
|
|
1418
1549
|
}
|
|
1419
1550
|
catch (err) {
|
|
1420
1551
|
const failure = caught(err);
|
|
1421
|
-
const text = `${err.message} The outcome is unknown: check rig_queue_show with qitemId ${id} before retrying, and retry only with that same qitemId.`;
|
|
1422
|
-
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 } : {}) } };
|
|
1423
1554
|
}
|
|
1424
1555
|
});
|
|
1425
1556
|
// 20. rig_queue_show — one item with its transitions: a delegated task's answer is its own record
|
|
1426
1557
|
if (offered("rig_queue_show"))
|
|
1427
1558
|
server.registerTool("rig_queue_show", {
|
|
1428
|
-
...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),
|
|
1429
1560
|
inputSchema: z.object({
|
|
1430
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"),
|
|
1431
1563
|
}),
|
|
1432
|
-
}, async ({ qitemId }) => {
|
|
1564
|
+
}, async ({ qitemId, host }) => {
|
|
1433
1565
|
try {
|
|
1566
|
+
const target = hostTarget(host);
|
|
1567
|
+
if ("content" in target)
|
|
1568
|
+
return target;
|
|
1434
1569
|
const id = encodeURIComponent(qitemId);
|
|
1435
|
-
const item = await
|
|
1570
|
+
const item = await hostGet(target, `/api/queue/${id}`);
|
|
1436
1571
|
if (item.status >= 400)
|
|
1437
1572
|
return mapResult(item);
|
|
1438
1573
|
if (scope && !scope.item(item.data))
|
|
1439
1574
|
return outOfScope(`Item ${qitemId}`);
|
|
1440
|
-
const transitions = await
|
|
1575
|
+
const transitions = await hostGet(target, `/api/queue/${id}/transitions`);
|
|
1441
1576
|
if (transitions.status >= 400)
|
|
1442
1577
|
return mapResult(transitions);
|
|
1443
1578
|
const row = (item.data ?? {});
|
|
1444
1579
|
const handedOn = row.state === "handed-off" || row.closureReason === "handed_off_to";
|
|
1445
1580
|
const view = externalView(scope);
|
|
1446
|
-
let successor = handedOn ? await successorOf(
|
|
1581
|
+
let successor = handedOn ? await successorOf((path) => hostGet(target, path), qitemId, row.closureTarget, view ? scope.item : undefined) : undefined;
|
|
1447
1582
|
if (scope && !view && successor && "destinationSession" in successor && !scope.successor(successor.destinationSession))
|
|
1448
1583
|
successor = { unknown: true, code: "out_of_scope" };
|
|
1449
1584
|
const shownItem = scope ? withoutDaemonLinkedRows(item.data) : item.data;
|
|
@@ -1459,7 +1594,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1459
1594
|
// 21. rig_queue_list — list queue items
|
|
1460
1595
|
if (offered("rig_queue_list"))
|
|
1461
1596
|
server.registerTool("rig_queue_list", {
|
|
1462
|
-
...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),
|
|
1463
1598
|
inputSchema: z.object({
|
|
1464
1599
|
owned: z.boolean().optional().describe("Only items assigned to this seat: its whole inbox (overrides destination)"),
|
|
1465
1600
|
mine: z.boolean().optional().describe("Items this seat sent or owns"),
|
|
@@ -1473,9 +1608,13 @@ export function createMcpServer(client, options = {}) {
|
|
|
1473
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"),
|
|
1474
1609
|
handedOffFrom: z.string().optional().describe("The items handed on from this qitemId, in any state and any rig"),
|
|
1475
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"),
|
|
1476
1612
|
}),
|
|
1477
|
-
}, 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 }) => {
|
|
1478
1614
|
try {
|
|
1615
|
+
const target = hostTarget(host);
|
|
1616
|
+
if ("content" in target)
|
|
1617
|
+
return target;
|
|
1479
1618
|
if ([...(requestedTags ?? []), ...(mission === undefined ? [] : [mission]), ...(slice === undefined ? [] : [slice])]
|
|
1480
1619
|
.some((value) => value.trim().length === 0)) {
|
|
1481
1620
|
const message = "tag filters cannot be blank";
|
|
@@ -1526,7 +1665,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1526
1665
|
if (handedOffFrom)
|
|
1527
1666
|
params.set("handedOffFrom", handedOffFrom);
|
|
1528
1667
|
params.set("limit", String(limit ?? 100));
|
|
1529
|
-
const res = await
|
|
1668
|
+
const res = await hostGet(target, `/api/queue/list?${params.toString()}`);
|
|
1530
1669
|
const ignored = res.status < 400 ? ignoredFilter(res.data, { since, handedOffFrom, tags }) : null;
|
|
1531
1670
|
if (ignored) {
|
|
1532
1671
|
const message = `The daemon didn't apply ${ignored}, so this list isn't filtered by it; it needs a newer daemon.`;
|
|
@@ -1536,7 +1675,16 @@ export function createMcpServer(client, options = {}) {
|
|
|
1536
1675
|
if (scope && res.status < 400 && Array.isArray(res.data)) {
|
|
1537
1676
|
const view = externalView(scope);
|
|
1538
1677
|
const rows = res.data.filter((row) => scope.item(row));
|
|
1539
|
-
|
|
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 } };
|
|
1540
1688
|
}
|
|
1541
1689
|
return mapResult(res, undefined, { structured: true });
|
|
1542
1690
|
}
|
|
@@ -1566,7 +1714,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1566
1714
|
// 23. rig_queue_update — record progress, block, or close with the answer
|
|
1567
1715
|
if (offered("rig_queue_update"))
|
|
1568
1716
|
server.registerTool("rig_queue_update", {
|
|
1569
|
-
...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),
|
|
1570
1718
|
inputSchema: z.object({
|
|
1571
1719
|
qitemId: z.string().describe("The queue item to update"),
|
|
1572
1720
|
state: z.string().optional().describe("New state (e.g. in-progress, blocked, done)"),
|
|
@@ -1576,12 +1724,16 @@ export function createMcpServer(client, options = {}) {
|
|
|
1576
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)"),
|
|
1577
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)"),
|
|
1578
1726
|
summary: z.string().optional().describe("Replace the one-line summary"),
|
|
1579
|
-
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"),
|
|
1580
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)"),
|
|
1581
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"),
|
|
1582
1731
|
}),
|
|
1583
|
-
}, 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 }) => {
|
|
1584
1733
|
try {
|
|
1734
|
+
const target = hostTarget(host);
|
|
1735
|
+
if ("content" in target)
|
|
1736
|
+
return target;
|
|
1585
1737
|
const denied = await itemOutOfScope(qitemId, "owner");
|
|
1586
1738
|
if (denied)
|
|
1587
1739
|
return denied;
|
|
@@ -1592,7 +1744,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1592
1744
|
if (!blocker || blocker.status >= 400 || !scope?.item(blocker.data))
|
|
1593
1745
|
return outOfScope(`Blocker ${blockedOn ?? "(none named)"}`);
|
|
1594
1746
|
}
|
|
1595
|
-
const res = await
|
|
1747
|
+
const res = await hostPost(target, `/api/queue/${encodeURIComponent(qitemId)}/update`, {
|
|
1596
1748
|
state, closureReason, closureTarget, summary, evidenceRef, blockedOn, wakeAfterSeconds, transitionNote: note, resolution, reopen,
|
|
1597
1749
|
});
|
|
1598
1750
|
// An external caller's updated item goes through the same projection as show and list.
|
|
@@ -1724,9 +1876,9 @@ export function createMcpServer(client, options = {}) {
|
|
|
1724
1876
|
// 27. rig_team — a rig's seats and its lead
|
|
1725
1877
|
if (offered("rig_team"))
|
|
1726
1878
|
server.registerTool("rig_team", {
|
|
1727
|
-
...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),
|
|
1728
1880
|
inputSchema: z.object({
|
|
1729
|
-
rigId: z.string().optional().describe("Rig name or
|
|
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."),
|
|
1730
1882
|
}),
|
|
1731
1883
|
}, async ({ rigId }) => {
|
|
1732
1884
|
try {
|
|
@@ -1744,7 +1896,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
1744
1896
|
}
|
|
1745
1897
|
// An external caller names one of its grant's rigs, so a lookup never answers about another workspace's rig.
|
|
1746
1898
|
if (access?.external && !scope?.rig(rigId))
|
|
1747
|
-
return outOfScope(`Rig ${rigId}
|
|
1899
|
+
return outOfScope(`Rig ${rigId}`, "Leave rigId out to see this connection's own team.");
|
|
1748
1900
|
const rig = await rigIdFor(client, rigId);
|
|
1749
1901
|
if ("content" in rig)
|
|
1750
1902
|
return rig;
|
|
@@ -1765,8 +1917,15 @@ export function createMcpServer(client, options = {}) {
|
|
|
1765
1917
|
const rigName = (detail.data ?? {}).rig?.name ?? "";
|
|
1766
1918
|
const inventory = Array.isArray(nodes.data) ? nodes.data : [];
|
|
1767
1919
|
// A node is a seat whether or not it has a session yet: its address derives from its logical id (pod.member).
|
|
1768
|
-
const
|
|
1769
|
-
|
|
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"));
|
|
1770
1929
|
// One read of the daemon's check-ins serves every member in this answer.
|
|
1771
1930
|
let checkIns;
|
|
1772
1931
|
const checkInOf = async (seat) => {
|
|
@@ -1784,14 +1943,44 @@ export function createMcpServer(client, options = {}) {
|
|
|
1784
1943
|
};
|
|
1785
1944
|
const hosted = await hostedMembersOf(rostersFolder(), rigName, nodeSeats, async () => inventory.find((seat) => typeof seat.hostSelfId === "string")?.hostSelfId
|
|
1786
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;
|
|
1787
1949
|
const rows = await client.get(`/api/queue/list?${new URLSearchParams({ destinationSession: seat, compact: "1", limit: String(PRESENCE_ROWS) }).toString()}`)
|
|
1788
1950
|
.then((res) => (res.status < 400 ? res.data : null), () => null);
|
|
1789
1951
|
// An external caller sees a ring only on an item it may read, so another pair's item isn't named.
|
|
1790
1952
|
const visible = access?.external && Array.isArray(rows) ? rows.filter((row) => scope?.item(row)) : rows;
|
|
1791
1953
|
return { lastCallAt: readPresence(presenceFile())[seat]?.lastCallAt ?? null, lastWake: newestWake(visible, seat),
|
|
1792
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;
|
|
1793
1977
|
});
|
|
1794
|
-
|
|
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 });
|
|
1795
1984
|
}
|
|
1796
1985
|
catch (err) {
|
|
1797
1986
|
return caught(err);
|
|
@@ -2229,7 +2418,7 @@ export function createMcpServer(client, options = {}) {
|
|
|
2229
2418
|
// 35. rig_queue_handoff — pass an item on to the next seat in one step, the route `rig queue handoff` uses
|
|
2230
2419
|
if (offered("rig_queue_handoff"))
|
|
2231
2420
|
server.registerTool("rig_queue_handoff", {
|
|
2232
|
-
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.",
|
|
2233
2422
|
inputSchema: z.object({
|
|
2234
2423
|
qitemId: z.string().describe("The queue item to pass on"),
|
|
2235
2424
|
to: z.string().describe("The next seat (e.g. qa@my-rig)"),
|
|
@@ -2239,9 +2428,13 @@ export function createMcpServer(client, options = {}) {
|
|
|
2239
2428
|
tags: z.array(z.string()).optional().describe("Tags for the new item (default: the item's own)"),
|
|
2240
2429
|
priority: z.string().optional().describe("Priority for the new item (default: the item's own)"),
|
|
2241
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"),
|
|
2242
2432
|
}),
|
|
2243
2433
|
annotations: DESTRUCTIVE,
|
|
2244
|
-
}, 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;
|
|
2245
2438
|
if (scope && !scope.session(to))
|
|
2246
2439
|
return outOfScope(`Destination ${to}`);
|
|
2247
2440
|
try {
|
|
@@ -2253,14 +2446,14 @@ export function createMcpServer(client, options = {}) {
|
|
|
2253
2446
|
return caught(err);
|
|
2254
2447
|
}
|
|
2255
2448
|
try {
|
|
2256
|
-
return mapResult(await
|
|
2449
|
+
return mapResult(await hostPost(target, `/api/queue/${encodeURIComponent(qitemId)}/handoff`, {
|
|
2257
2450
|
toSession: to, body, transitionNote: note, summary, tags, priority, evidenceRef,
|
|
2258
2451
|
}), undefined, { structured: true });
|
|
2259
2452
|
}
|
|
2260
2453
|
catch (err) {
|
|
2261
2454
|
const failure = caught(err);
|
|
2262
|
-
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.`;
|
|
2263
|
-
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 } : {}) } };
|
|
2264
2457
|
}
|
|
2265
2458
|
});
|
|
2266
2459
|
// 36. rig_queue_unclaim — put back an item this seat claimed and won't finish
|