@ouro.bot/cli 0.1.0-alpha.1469 → 0.1.0-alpha.1470
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 +1 -1
- package/changelog.json +6 -2
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/desk.lock.json +8 -0
- package/dist/heart/identity.js +27 -1
- package/dist/mind/desk-section.js +33 -43
- package/dist/repertoire/desk-mcp.js +140 -0
- package/dist/repertoire/mcp-manager.js +22 -0
- package/dist/repertoire/mcp-tools.js +11 -7
- package/npm-shrinkwrap.json +2 -2
- package/package.json +4 -1
- package/vendor/desk/.claude-plugin/plugin.json +35 -0
- package/vendor/desk/.mcp.claude-codex.json +28 -0
- package/vendor/desk/.mcp.copilot.json +16 -0
- package/vendor/desk/.ouro-desk.json +6 -0
- package/vendor/desk/CHANGELOG.md +7004 -0
- package/vendor/desk/README.md +195 -0
- package/vendor/desk/activation/README.md +98 -0
- package/vendor/desk/activation/copilot-root.flattened-bundle.json +38 -0
- package/vendor/desk/activation/desk.activation.json +251 -0
- package/vendor/desk/activation/host-capability-evidence.md +46 -0
- package/vendor/desk/activation/support-matrix.json +84 -0
- package/vendor/desk/agency.json +20 -0
- package/vendor/desk/agents/observer.agent.md +26 -0
- package/vendor/desk/agents/observer.md +29 -0
- package/vendor/desk/agents/worker.agent.md +32 -0
- package/vendor/desk/agents/worker.md +40 -0
- package/vendor/desk/artifacts/tombstones/tombstone.schema.json +53 -0
- package/vendor/desk/artifacts/tombstones/tombstones.jsonl +1 -0
- package/vendor/desk/changelog.d/README.md +12 -0
- package/vendor/desk/docs/agent-files.md +104 -0
- package/vendor/desk/docs/agentic-engineering-v2-rfc.md +206 -0
- package/vendor/desk/docs/agentic-engineering-v3-rfc.md +109 -0
- package/vendor/desk/docs/browser-remote-desktops.md +69 -0
- package/vendor/desk/docs/dependency-activation-stories-and-criteria.md +500 -0
- package/vendor/desk/docs/evaluation-packet.md +363 -0
- package/vendor/desk/docs/factory-local-capture.md +651 -0
- package/vendor/desk/docs/factory-store-playbook.md +927 -0
- package/vendor/desk/docs/images/factory-site.png +0 -0
- package/vendor/desk/docs/issue-drains.md +79 -0
- package/vendor/desk/docs/lfs-inspection.md +55 -0
- package/vendor/desk/docs/preview-diagnostics.md +11 -0
- package/vendor/desk/docs/relays.md +88 -0
- package/vendor/desk/docs/schedules.md +69 -0
- package/vendor/desk/docs/search-recovery.md +22 -0
- package/vendor/desk/docs/session-labels.md +157 -0
- package/vendor/desk/docs/session-retention.md +125 -0
- package/vendor/desk/docs/sessions.md +17 -0
- package/vendor/desk/docs/stalled-nudges.md +54 -0
- package/vendor/desk/docs/webhooks.md +80 -0
- package/vendor/desk/docs/workspace-tidy.md +74 -0
- package/vendor/desk/hooks/boot-checks.cjs +7 -0
- package/vendor/desk/hooks/claude-session-start.cjs +123 -0
- package/vendor/desk/hooks/compatible-node.cjs +97 -0
- package/vendor/desk/hooks/copilot-boot-prompt.cjs +69 -0
- package/vendor/desk/hooks/copilot-durable-files.cjs +8 -0
- package/vendor/desk/hooks/copilot-hooks.json +61 -0
- package/vendor/desk/hooks/copilot-intake-context.cjs +5 -0
- package/vendor/desk/hooks/copilot-lane-model.cjs +8 -0
- package/vendor/desk/hooks/copilot-session-start.cjs +264 -0
- package/vendor/desk/hooks/copilot-skill-current.cjs +28 -0
- package/vendor/desk/hooks/factory-end.cjs +5 -0
- package/vendor/desk/hooks/factory-start.cjs +27 -0
- package/vendor/desk/hooks/hooks.json +40 -0
- package/vendor/desk/hooks/lib/boot-checks.cjs +643 -0
- package/vendor/desk/hooks/lib/child-agent.cjs +14 -0
- package/vendor/desk/hooks/lib/copilot-intake-context.cjs +73 -0
- package/vendor/desk/hooks/lib/current-release.cjs +162 -0
- package/vendor/desk/hooks/lib/delivery-stop.cjs +326 -0
- package/vendor/desk/hooks/lib/detach-worker.cjs +43 -0
- package/vendor/desk/hooks/lib/durable-files.cjs +102 -0
- package/vendor/desk/hooks/lib/factory-end.cjs +327 -0
- package/vendor/desk/hooks/lib/lane-model.cjs +82 -0
- package/vendor/desk/hooks/lib/node-required.cjs +56 -0
- package/vendor/desk/hooks/lib/orca-session-title.cjs +60 -0
- package/vendor/desk/hooks/lib/session-end.cjs +30 -0
- package/vendor/desk/hooks/lib/sync-end.cjs +89 -0
- package/vendor/desk/hooks/loop-start.cjs +105 -0
- package/vendor/desk/hooks/node-missing.sh +78 -0
- package/vendor/desk/hooks/orca-session-title.cjs +8 -0
- package/vendor/desk/hooks/session-end.cjs +8 -0
- package/vendor/desk/mcp/README.md +269 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/support-matrix.json +72 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/README.md +25 -0
- package/vendor/desk/mcp/bootstrap.cjs +761 -0
- package/vendor/desk/mcp/docs/private-feedback.md +13 -0
- package/vendor/desk/mcp/idle-proxy.cjs +423 -0
- package/vendor/desk/mcp/index.js +813 -0
- package/vendor/desk/mcp/package-lock.json +3717 -0
- package/vendor/desk/mcp/package.json +44 -0
- package/vendor/desk/mcp/scripts/agency-desk-channel.js +7 -0
- package/vendor/desk/mcp/scripts/build-runtime-deps-pack.js +5 -0
- package/vendor/desk/mcp/scripts/crew.js +89 -0
- package/vendor/desk/mcp/scripts/drains-launcher.mjs +329 -0
- package/vendor/desk/mcp/scripts/drains.js +5 -0
- package/vendor/desk/mcp/scripts/factory.js +657 -0
- package/vendor/desk/mcp/scripts/file-desk-problem.js +9 -0
- package/vendor/desk/mcp/scripts/finish-commit.js +7 -0
- package/vendor/desk/mcp/scripts/lfs.js +37 -0
- package/vendor/desk/mcp/scripts/local-recovery.js +363 -0
- package/vendor/desk/mcp/scripts/migrations.js +11 -0
- package/vendor/desk/mcp/scripts/private-view.js +177 -0
- package/vendor/desk/mcp/scripts/resolve-desk-root.js +106 -0
- package/vendor/desk/mcp/scripts/session-boot.js +22 -0
- package/vendor/desk/mcp/scripts/session-retention.js +5 -0
- package/vendor/desk/mcp/scripts/session-sync.js +10 -0
- package/vendor/desk/mcp/scripts/sessions.js +5 -0
- package/vendor/desk/mcp/scripts/sync-push.js +13 -0
- package/vendor/desk/mcp/scripts/tidy-status.js +8 -0
- package/vendor/desk/mcp/scripts/verify-runtime-deps-pack.js +5 -0
- package/vendor/desk/mcp/src/actions/desk-read.actions.mts +73 -0
- package/vendor/desk/mcp/src/actions/desk-session.actions.mts +42 -0
- package/vendor/desk/mcp/src/actions/desk-web.actions.mts +52 -0
- package/vendor/desk/mcp/src/actions/desk.actions.mts +5 -0
- package/vendor/desk/mcp/src/actions/generated/desk/OuroActions.swift +649 -0
- package/vendor/desk/mcp/src/actions/generated/desk/OuroActionsReins.swift +61 -0
- package/vendor/desk/mcp/src/actions/generated/desk/actions.json +280 -0
- package/vendor/desk/mcp/src/actions/generated/desk/commands.json +145 -0
- package/vendor/desk/mcp/src/actions/generated/desk/mcp.json +256 -0
- package/vendor/desk/mcp/src/actions/generated/desk/web.ts +59 -0
- package/vendor/desk/mcp/src/actions/generated/desk/webmcp.json +250 -0
- package/vendor/desk/mcp/src/actions/generated/desk-web/OuroActions.swift +241 -0
- package/vendor/desk/mcp/src/actions/generated/desk-web/OuroActionsReins.swift +25 -0
- package/vendor/desk/mcp/src/actions/generated/desk-web/actions.json +73 -0
- package/vendor/desk/mcp/src/actions/generated/desk-web/commands.json +53 -0
- package/vendor/desk/mcp/src/actions/generated/desk-web/mcp.json +83 -0
- package/vendor/desk/mcp/src/actions/generated/desk-web/web.ts +47 -0
- package/vendor/desk/mcp/src/actions/generated/desk-web/webmcp.json +81 -0
- package/vendor/desk/mcp/src/actions/served.js +5 -0
- package/vendor/desk/mcp/src/activation/admit.js +77 -0
- package/vendor/desk/mcp/src/activation/failures.js +65 -0
- package/vendor/desk/mcp/src/activation/readiness-policy.js +102 -0
- package/vendor/desk/mcp/src/activation/schema.js +17 -0
- package/vendor/desk/mcp/src/activation/superpowers-context.js +265 -0
- package/vendor/desk/mcp/src/activation/validate.js +540 -0
- package/vendor/desk/mcp/src/artifacts/tombstones.js +61 -0
- package/vendor/desk/mcp/src/crew/initiative.js +287 -0
- package/vendor/desk/mcp/src/crew/workspace.js +1259 -0
- package/vendor/desk/mcp/src/db/init.js +75 -0
- package/vendor/desk/mcp/src/db/schema.sql +83 -0
- package/vendor/desk/mcp/src/desk/active-tasks.js +408 -0
- package/vendor/desk/mcp/src/desk/card-commit-guard.js +281 -0
- package/vendor/desk/mcp/src/desk/cleanup-index.js +53 -0
- package/vendor/desk/mcp/src/desk/content-home.js +246 -0
- package/vendor/desk/mcp/src/desk/crew-config.js +102 -0
- package/vendor/desk/mcp/src/desk/crew-member.js +196 -0
- package/vendor/desk/mcp/src/desk/crew-roster.js +151 -0
- package/vendor/desk/mcp/src/desk/frontmatter-lite.js +228 -0
- package/vendor/desk/mcp/src/desk/gh-logins.js +109 -0
- package/vendor/desk/mcp/src/desk/handles.js +123 -0
- package/vendor/desk/mcp/src/desk/handoff-reference.js +35 -0
- package/vendor/desk/mcp/src/desk/improvement-authority.js +3 -0
- package/vendor/desk/mcp/src/desk/improvement-cards.js +704 -0
- package/vendor/desk/mcp/src/desk/improvement-person.js +51 -0
- package/vendor/desk/mcp/src/desk/lifecycle.js +16 -0
- package/vendor/desk/mcp/src/desk/machine-desks.js +119 -0
- package/vendor/desk/mcp/src/desk/naming.js +333 -0
- package/vendor/desk/mcp/src/desk/organization.js +592 -0
- package/vendor/desk/mcp/src/desk/resources.js +274 -0
- package/vendor/desk/mcp/src/desk/runtime-resolver.js +30 -0
- package/vendor/desk/mcp/src/desk/scratch-paths.js +44 -0
- package/vendor/desk/mcp/src/desk/step-delivery.js +140 -0
- package/vendor/desk/mcp/src/desk/steps.js +263 -0
- package/vendor/desk/mcp/src/desk/tidy.js +930 -0
- package/vendor/desk/mcp/src/desk/unsigned-deliveries.js +359 -0
- package/vendor/desk/mcp/src/factory/agent-types.js +45 -0
- package/vendor/desk/mcp/src/factory/andon-watch.js +109 -0
- package/vendor/desk/mcp/src/factory/binding.js +612 -0
- package/vendor/desk/mcp/src/factory/boot-check.js +645 -0
- package/vendor/desk/mcp/src/factory/capture-classify.js +158 -0
- package/vendor/desk/mcp/src/factory/capture-count.js +183 -0
- package/vendor/desk/mcp/src/factory/capture-flush.js +268 -0
- package/vendor/desk/mcp/src/factory/capture-publish.js +141 -0
- package/vendor/desk/mcp/src/factory/capture-schema.js +193 -0
- package/vendor/desk/mcp/src/factory/capture-sweep.js +239 -0
- package/vendor/desk/mcp/src/factory/catch-point.js +60 -0
- package/vendor/desk/mcp/src/factory/commit-resolve.js +94 -0
- package/vendor/desk/mcp/src/factory/consent-answer.js +37 -0
- package/vendor/desk/mcp/src/factory/context-capability.js +15 -0
- package/vendor/desk/mcp/src/factory/context-outbox.js +885 -0
- package/vendor/desk/mcp/src/factory/context-run.js +386 -0
- package/vendor/desk/mcp/src/factory/context-schema.js +249 -0
- package/vendor/desk/mcp/src/factory/copilot-turn-index.js +93 -0
- package/vendor/desk/mcp/src/factory/copilot-usage.js +148 -0
- package/vendor/desk/mcp/src/factory/credential.js +45 -0
- package/vendor/desk/mcp/src/factory/derive-claude.js +960 -0
- package/vendor/desk/mcp/src/factory/derive-codex.js +734 -0
- package/vendor/desk/mcp/src/factory/derive-common.js +279 -0
- package/vendor/desk/mcp/src/factory/derive-copilot.js +1057 -0
- package/vendor/desk/mcp/src/factory/derive-run.js +807 -0
- package/vendor/desk/mcp/src/factory/desk-problem-file.js +310 -0
- package/vendor/desk/mcp/src/factory/desk-problem-fingerprint.js +70 -0
- package/vendor/desk/mcp/src/factory/desk-problem-known.js +246 -0
- package/vendor/desk/mcp/src/factory/desk-problem-template.js +107 -0
- package/vendor/desk/mcp/src/factory/desk-repo.js +1223 -0
- package/vendor/desk/mcp/src/factory/desk-task-line.js +28 -0
- package/vendor/desk/mcp/src/factory/desk-visibility.js +48 -0
- package/vendor/desk/mcp/src/factory/end-hook.js +14 -0
- package/vendor/desk/mcp/src/factory/evaluate-kick.js +164 -0
- package/vendor/desk/mcp/src/factory/evaluate-run.js +678 -0
- package/vendor/desk/mcp/src/factory/evaluator-step.js +484 -0
- package/vendor/desk/mcp/src/factory/filer-launch.js +79 -0
- package/vendor/desk/mcp/src/factory/flush-health.js +26 -0
- package/vendor/desk/mcp/src/factory/flush.js +1758 -0
- package/vendor/desk/mcp/src/factory/focus.js +326 -0
- package/vendor/desk/mcp/src/factory/headless-flag.cjs +32 -0
- package/vendor/desk/mcp/src/factory/headless-flag.js +25 -0
- package/vendor/desk/mcp/src/factory/headless-ledger.js +743 -0
- package/vendor/desk/mcp/src/factory/headless.js +567 -0
- package/vendor/desk/mcp/src/factory/held-route.js +93 -0
- package/vendor/desk/mcp/src/factory/host-flags.js +36 -0
- package/vendor/desk/mcp/src/factory/improvement-verify.js +429 -0
- package/vendor/desk/mcp/src/factory/kaizen-file.js +231 -0
- package/vendor/desk/mcp/src/factory/label-binding.js +90 -0
- package/vendor/desk/mcp/src/factory/label-schema.js +426 -0
- package/vendor/desk/mcp/src/factory/local-status.js +368 -0
- package/vendor/desk/mcp/src/factory/loop-conditions.js +121 -0
- package/vendor/desk/mcp/src/factory/loop-health.js +500 -0
- package/vendor/desk/mcp/src/factory/loop-slot.js +90 -0
- package/vendor/desk/mcp/src/factory/loop-status.js +100 -0
- package/vendor/desk/mcp/src/factory/loop-switch.cjs +14 -0
- package/vendor/desk/mcp/src/factory/loop-worker-state.js +96 -0
- package/vendor/desk/mcp/src/factory/loop-worker.js +290 -0
- package/vendor/desk/mcp/src/factory/marker.js +61 -0
- package/vendor/desk/mcp/src/factory/mirror-step.js +145 -0
- package/vendor/desk/mcp/src/factory/os-protect.js +243 -0
- package/vendor/desk/mcp/src/factory/outbox.js +2231 -0
- package/vendor/desk/mcp/src/factory/outcome.js +431 -0
- package/vendor/desk/mcp/src/factory/pipeline/andon.js +319 -0
- package/vendor/desk/mcp/src/factory/pipeline/attention-rollup.js +158 -0
- package/vendor/desk/mcp/src/factory/pipeline/attention.js +146 -0
- package/vendor/desk/mcp/src/factory/pipeline/build.js +299 -0
- package/vendor/desk/mcp/src/factory/pipeline/compare.js +148 -0
- package/vendor/desk/mcp/src/factory/pipeline/formulas.js +652 -0
- package/vendor/desk/mcp/src/factory/pipeline/kaizen.js +387 -0
- package/vendor/desk/mcp/src/factory/pipeline/lifecycle-clocks.js +345 -0
- package/vendor/desk/mcp/src/factory/pipeline/normalize.js +73 -0
- package/vendor/desk/mcp/src/factory/pipeline/number-states.js +154 -0
- package/vendor/desk/mcp/src/factory/pipeline/outcomes.js +268 -0
- package/vendor/desk/mcp/src/factory/pipeline/report.js +737 -0
- package/vendor/desk/mcp/src/factory/pipeline/rollups.js +883 -0
- package/vendor/desk/mcp/src/factory/pipeline/stretches.js +523 -0
- package/vendor/desk/mcp/src/factory/pipeline/timeline.js +199 -0
- package/vendor/desk/mcp/src/factory/pipeline/validate-pr.js +238 -0
- package/vendor/desk/mcp/src/factory/pipeline/versions.js +42 -0
- package/vendor/desk/mcp/src/factory/pipeline/walk.js +1177 -0
- package/vendor/desk/mcp/src/factory/plugin-registry.js +72 -0
- package/vendor/desk/mcp/src/factory/plugin-sources.cjs +249 -0
- package/vendor/desk/mcp/src/factory/pr-green.js +77 -0
- package/vendor/desk/mcp/src/factory/process-lock.js +142 -0
- package/vendor/desk/mcp/src/factory/proof-session.js +75 -0
- package/vendor/desk/mcp/src/factory/publish.js +637 -0
- package/vendor/desk/mcp/src/factory/published-schema.js +648 -0
- package/vendor/desk/mcp/src/factory/reconcile-reasons.js +22 -0
- package/vendor/desk/mcp/src/factory/reconcile-step.js +251 -0
- package/vendor/desk/mcp/src/factory/reconcile.js +808 -0
- package/vendor/desk/mcp/src/factory/release-version.js +134 -0
- package/vendor/desk/mcp/src/factory/repo-name.js +13 -0
- package/vendor/desk/mcp/src/factory/retention.js +60 -0
- package/vendor/desk/mcp/src/factory/route-desk.js +40 -0
- package/vendor/desk/mcp/src/factory/route-issues.js +251 -0
- package/vendor/desk/mcp/src/factory/route-local.js +264 -0
- package/vendor/desk/mcp/src/factory/schema.js +957 -0
- package/vendor/desk/mcp/src/factory/session-kind.js +16 -0
- package/vendor/desk/mcp/src/factory/session-lifetime.js +56 -0
- package/vendor/desk/mcp/src/factory/session-route.js +183 -0
- package/vendor/desk/mcp/src/factory/shell-git.js +500 -0
- package/vendor/desk/mcp/src/factory/store-issues.js +143 -0
- package/vendor/desk/mcp/src/factory/store-route.js +208 -0
- package/vendor/desk/mcp/src/factory/test-state-guard.js +103 -0
- package/vendor/desk/mcp/src/factory/time.js +36 -0
- package/vendor/desk/mcp/src/factory/tool-issue-file.js +84 -0
- package/vendor/desk/mcp/src/factory/tool-kinds.js +87 -0
- package/vendor/desk/mcp/src/factory/triage-schema.js +233 -0
- package/vendor/desk/mcp/src/factory/windows-acl.js +679 -0
- package/vendor/desk/mcp/src/indexer/chunk.js +232 -0
- package/vendor/desk/mcp/src/indexer/discover.js +434 -0
- package/vendor/desk/mcp/src/indexer/exclusions.js +247 -0
- package/vendor/desk/mcp/src/indexer/index.js +167 -0
- package/vendor/desk/mcp/src/indexer/refs.js +0 -0
- package/vendor/desk/mcp/src/indexer/text-hash.js +18 -0
- package/vendor/desk/mcp/src/lib/ouro-actions/actions.claims.json +75 -0
- package/vendor/desk/mcp/src/lib/ouro-actions/dist-manifest.json +70 -0
- package/vendor/desk/mcp/src/lib/ouro-actions/ouro-actions.mts +1416 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/LICENSE +21 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/ax-claims.ts +190 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/ax-command.ts +1020 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/checks.ts +343 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/cli.ts +240 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/component.ts +430 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/dev-commands.ts +204 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/doctor.ts +126 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/effects.ts +68 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/exit-codes.ts +75 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/help.ts +220 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/mcp.ts +268 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/outcome.ts +265 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/output.ts +67 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/precise-copy.ts +235 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/problem.ts +124 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/surfaces.kit.mts +8 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/surfaces.ts +568 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/terminal.ts +245 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/voice.ts +136 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/wait.ts +226 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/work-event.ts +181 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/xray.kit.mts +18 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/xray.ts +2072 -0
- package/vendor/desk/mcp/src/package-metadata.js +20 -0
- package/vendor/desk/mcp/src/protected/legacy-ledger.js +55 -0
- package/vendor/desk/mcp/src/readiness/leftovers.js +75 -0
- package/vendor/desk/mcp/src/readiness/process-start.js +149 -0
- package/vendor/desk/mcp/src/runtime/admission-worker.js +194 -0
- package/vendor/desk/mcp/src/runtime/admission.js +177 -0
- package/vendor/desk/mcp/src/runtime/agency-desk-channel.js +342 -0
- package/vendor/desk/mcp/src/runtime/agents-md.js +62 -0
- package/vendor/desk/mcp/src/runtime/append-lane.js +68 -0
- package/vendor/desk/mcp/src/runtime/argv-safe-reason.js +55 -0
- package/vendor/desk/mcp/src/runtime/boot-dependencies.js +75 -0
- package/vendor/desk/mcp/src/runtime/boot-text.js +504 -0
- package/vendor/desk/mcp/src/runtime/boot.js +1677 -0
- package/vendor/desk/mcp/src/runtime/bootstrap.js +1455 -0
- package/vendor/desk/mcp/src/runtime/chunked-import.js +102 -0
- package/vendor/desk/mcp/src/runtime/copilot-commit-trailer.js +133 -0
- package/vendor/desk/mcp/src/runtime/copilot-session.js +155 -0
- package/vendor/desk/mcp/src/runtime/deliver.js +469 -0
- package/vendor/desk/mcp/src/runtime/desk-channel.js +86 -0
- package/vendor/desk/mcp/src/runtime/desk-failure.js +26 -0
- package/vendor/desk/mcp/src/runtime/desk-health.js +168 -0
- package/vendor/desk/mcp/src/runtime/desk-session.js +1451 -0
- package/vendor/desk/mcp/src/runtime/diagnostic-server.js +72 -0
- package/vendor/desk/mcp/src/runtime/diagnostics.js +241 -0
- package/vendor/desk/mcp/src/runtime/drains-cli.js +187 -0
- package/vendor/desk/mcp/src/runtime/drains.js +781 -0
- package/vendor/desk/mcp/src/runtime/elsewhere-note.js +9 -0
- package/vendor/desk/mcp/src/runtime/failure-evidence.js +21 -0
- package/vendor/desk/mcp/src/runtime/fast-refs.js +209 -0
- package/vendor/desk/mcp/src/runtime/filer-throttle.js +66 -0
- package/vendor/desk/mcp/src/runtime/focused-card.js +147 -0
- package/vendor/desk/mcp/src/runtime/front-door.js +204 -0
- package/vendor/desk/mcp/src/runtime/gate-wait.js +2 -0
- package/vendor/desk/mcp/src/runtime/git-inspection.js +201 -0
- package/vendor/desk/mcp/src/runtime/git-read-worker.js +157 -0
- package/vendor/desk/mcp/src/runtime/health.js +50 -0
- package/vendor/desk/mcp/src/runtime/hooks.js +353 -0
- package/vendor/desk/mcp/src/runtime/hosted.js +163 -0
- package/vendor/desk/mcp/src/runtime/inbox.js +102 -0
- package/vendor/desk/mcp/src/runtime/index-drift.js +118 -0
- package/vendor/desk/mcp/src/runtime/last-start.js +133 -0
- package/vendor/desk/mcp/src/runtime/lesson-section.js +92 -0
- package/vendor/desk/mcp/src/runtime/lessons-shelf.js +100 -0
- package/vendor/desk/mcp/src/runtime/lfs.js +319 -0
- package/vendor/desk/mcp/src/runtime/native-path.js +12 -0
- package/vendor/desk/mcp/src/runtime/newest-release.js +197 -0
- package/vendor/desk/mcp/src/runtime/node-selection.js +233 -0
- package/vendor/desk/mcp/src/runtime/orca-session-title.js +225 -0
- package/vendor/desk/mcp/src/runtime/other-sessions.js +183 -0
- package/vendor/desk/mcp/src/runtime/pending-migrations.js +653 -0
- package/vendor/desk/mcp/src/runtime/plugin-update.js +215 -0
- package/vendor/desk/mcp/src/runtime/pluginless-runtimes.js +34 -0
- package/vendor/desk/mcp/src/runtime/pr-publication.js +226 -0
- package/vendor/desk/mcp/src/runtime/preview-snapshot.js +23 -0
- package/vendor/desk/mcp/src/runtime/publication-mode.js +19 -0
- package/vendor/desk/mcp/src/runtime/relays.js +974 -0
- package/vendor/desk/mcp/src/runtime/release-alert.js +148 -0
- package/vendor/desk/mcp/src/runtime/remote-identity.js +140 -0
- package/vendor/desk/mcp/src/runtime/resolve-here.js +4 -0
- package/vendor/desk/mcp/src/runtime/runtime-deps-cli.js +65 -0
- package/vendor/desk/mcp/src/runtime/runtime-deps.js +1109 -0
- package/vendor/desk/mcp/src/runtime/runtime-identity.js +22 -0
- package/vendor/desk/mcp/src/runtime/runtime-swap.js +101 -0
- package/vendor/desk/mcp/src/runtime/schedules.js +235 -0
- package/vendor/desk/mcp/src/runtime/session-activity.js +190 -0
- package/vendor/desk/mcp/src/runtime/session-label.js +30 -0
- package/vendor/desk/mcp/src/runtime/session-retention.js +662 -0
- package/vendor/desk/mcp/src/runtime/session-sync.js +333 -0
- package/vendor/desk/mcp/src/runtime/session-trailer.js +126 -0
- package/vendor/desk/mcp/src/runtime/sessions-cli.js +301 -0
- package/vendor/desk/mcp/src/runtime/signoff-listed.js +81 -0
- package/vendor/desk/mcp/src/runtime/skills.js +76 -0
- package/vendor/desk/mcp/src/runtime/stale-card-lead.js +52 -0
- package/vendor/desk/mcp/src/runtime/stale-desk-refresh.js +198 -0
- package/vendor/desk/mcp/src/runtime/stale-desk.js +219 -0
- package/vendor/desk/mcp/src/runtime/stalled.js +255 -0
- package/vendor/desk/mcp/src/runtime/standing-authority.js +79 -0
- package/vendor/desk/mcp/src/runtime/startup-boot.js +341 -0
- package/vendor/desk/mcp/src/runtime/startup-resolve.js +140 -0
- package/vendor/desk/mcp/src/runtime/state-branch.js +203 -0
- package/vendor/desk/mcp/src/runtime/status-compact.js +165 -0
- package/vendor/desk/mcp/src/runtime/status-inspection-child.js +26 -0
- package/vendor/desk/mcp/src/runtime/status-inspection.js +147 -0
- package/vendor/desk/mcp/src/runtime/status-root.js +39 -0
- package/vendor/desk/mcp/src/runtime/sync-worker.js +911 -0
- package/vendor/desk/mcp/src/runtime/test-state-guard.js +107 -0
- package/vendor/desk/mcp/src/runtime/unmerged-saves.js +247 -0
- package/vendor/desk/mcp/src/runtime/workspace-claim.js +53 -0
- package/vendor/desk/mcp/src/runtime/workspace-evidence.js +96 -0
- package/vendor/desk/mcp/src/runtime/workspace-tidy.js +509 -0
- package/vendor/desk/mcp/src/search/direct-lexical.js +54 -0
- package/vendor/desk/mcp/src/search/embedder.js +108 -0
- package/vendor/desk/mcp/src/search/engine.js +406 -0
- package/vendor/desk/mcp/src/search/files-router.js +22 -0
- package/vendor/desk/mcp/src/search/old-index.js +46 -0
- package/vendor/desk/mcp/src/search/vectors.js +60 -0
- package/vendor/desk/mcp/src/server.js +389 -0
- package/vendor/desk/mcp/src/tool-names.js +73 -0
- package/vendor/desk/mcp/src/tool-refusal.cjs +35 -0
- package/vendor/desk/mcp/src/tool-schema-parts.js +12 -0
- package/vendor/desk/mcp/src/tool-schemas.js +325 -0
- package/vendor/desk/mcp/src/tools/_card-commit.js +148 -0
- package/vendor/desk/mcp/src/tools/archive-links.js +185 -0
- package/vendor/desk/mcp/src/tools/archive-move.js +18 -0
- package/vendor/desk/mcp/src/tools/archive-native-session.js +728 -0
- package/vendor/desk/mcp/src/tools/archive-state.js +513 -0
- package/vendor/desk/mcp/src/tools/delivery-gate.js +251 -0
- package/vendor/desk/mcp/src/tools/desk-save.js +444 -0
- package/vendor/desk/mcp/src/tools/doctor.js +122 -0
- package/vendor/desk/mcp/src/tools/done-evidence.js +260 -0
- package/vendor/desk/mcp/src/tools/factory-context.js +204 -0
- package/vendor/desk/mcp/src/tools/friction.js +332 -0
- package/vendor/desk/mcp/src/tools/improvement.js +156 -0
- package/vendor/desk/mcp/src/tools/lesson-lines.js +22 -0
- package/vendor/desk/mcp/src/tools/lesson-owners.js +137 -0
- package/vendor/desk/mcp/src/tools/lesson-team.js +169 -0
- package/vendor/desk/mcp/src/tools/lesson.js +254 -0
- package/vendor/desk/mcp/src/tools/local-only.js +151 -0
- package/vendor/desk/mcp/src/tools/move.js +794 -0
- package/vendor/desk/mcp/src/tools/native-stage-context.js +32 -0
- package/vendor/desk/mcp/src/tools/note.js +267 -0
- package/vendor/desk/mcp/src/tools/search.js +634 -0
- package/vendor/desk/mcp/src/tools/shared-write.js +196 -0
- package/vendor/desk/mcp/src/tools/sibling-desk.js +37 -0
- package/vendor/desk/mcp/src/tools/status.js +233 -0
- package/vendor/desk/mcp/src/tools/task-archive-due.js +9 -0
- package/vendor/desk/mcp/src/tools/task-archived-resource.js +53 -0
- package/vendor/desk/mcp/src/tools/task-body.js +141 -0
- package/vendor/desk/mcp/src/tools/task-focus.js +164 -0
- package/vendor/desk/mcp/src/tools/task-log.js +76 -0
- package/vendor/desk/mcp/src/tools/task-signoff.js +155 -0
- package/vendor/desk/mcp/src/tools/task.js +1768 -0
- package/vendor/desk/mcp/src/tools/track-row.js +89 -0
- package/vendor/desk/mcp/src/tools/track.js +240 -0
- package/vendor/desk/mcp/src/util/agency-session.cjs +29 -0
- package/vendor/desk/mcp/src/util/archive-links.js +105 -0
- package/vendor/desk/mcp/src/util/bash.js +36 -0
- package/vendor/desk/mcp/src/util/capture-record.js +73 -0
- package/vendor/desk/mcp/src/util/cas-commit.js +252 -0
- package/vendor/desk/mcp/src/util/created-dirs.js +71 -0
- package/vendor/desk/mcp/src/util/deferred-tools.js +51 -0
- package/vendor/desk/mcp/src/util/desk-owner.js +99 -0
- package/vendor/desk/mcp/src/util/env-value.js +13 -0
- package/vendor/desk/mcp/src/util/file-identity.js +40 -0
- package/vendor/desk/mcp/src/util/finish-commit.js +145 -0
- package/vendor/desk/mcp/src/util/fm.js +410 -0
- package/vendor/desk/mcp/src/util/git-config-file.js +85 -0
- package/vendor/desk/mcp/src/util/git-stage.js +440 -0
- package/vendor/desk/mcp/src/util/main-publish.js +240 -0
- package/vendor/desk/mcp/src/util/markdown-links.cjs +555 -0
- package/vendor/desk/mcp/src/util/object-input.js +59 -0
- package/vendor/desk/mcp/src/util/paths.js +647 -0
- package/vendor/desk/mcp/src/util/rank.js +189 -0
- package/vendor/desk/mcp/src/util/redact.js +92 -0
- package/vendor/desk/mcp/src/util/remove-retry.js +35 -0
- package/vendor/desk/mcp/src/util/rename-retry.js +73 -0
- package/vendor/desk/mcp/src/util/route-around.js +265 -0
- package/vendor/desk/mcp/src/util/shell-quote.js +18 -0
- package/vendor/desk/mcp/src/util/startup-direction.js +124 -0
- package/vendor/desk/mcp/src/util/state-ignore.js +33 -0
- package/vendor/desk/mcp/src/util/tool-commits.js +64 -0
- package/vendor/desk/mcp/src/util/unicode-16/LICENSE-MIT.txt +7 -0
- package/vendor/desk/mcp/src/util/unicode-16/README.md +9 -0
- package/vendor/desk/mcp/src/util/unicode-16/letter.cjs +1 -0
- package/vendor/desk/mcp/src/util/unicode-16/mark.cjs +1 -0
- package/vendor/desk/mcp/src/util/unicode-16/number.cjs +1 -0
- package/vendor/desk/mcp/web-auth.cjs +1897 -0
- package/vendor/desk/mcp/web-browser-discovery.cjs +53 -0
- package/vendor/desk/mcp/web-catalog.json +34 -0
- package/vendor/desk/mcp/web-launch.cjs +101 -0
- package/vendor/desk/mcp/web.cjs +1239 -0
- package/vendor/desk/migrations/01-move-to-ourostack-desk.md +188 -0
- package/vendor/desk/migrations/02-tidy-desk.md +87 -0
- package/vendor/desk/migrations/03-desk-release-channel.md +38 -0
- package/vendor/desk/optional/session-label/consumer.mjs +237 -0
- package/vendor/desk/optional/session-label/extension.mjs +32 -0
- package/vendor/desk/plugin.json +54 -0
- package/vendor/desk/settings.json +3 -0
- package/vendor/desk/skills/add-workspace-mcp/SKILL.md +180 -0
- package/vendor/desk/skills/adopt-inflight-work/SKILL.md +212 -0
- package/vendor/desk/skills/archive-workflow/SKILL.md +132 -0
- package/vendor/desk/skills/content-routing/SKILL.md +95 -0
- package/vendor/desk/skills/core-meeting-capture/SKILL.md +47 -0
- package/vendor/desk/skills/core-meeting-capture/references/capture-contract.md +175 -0
- package/vendor/desk/skills/curator/SKILL.md +103 -0
- package/vendor/desk/skills/delightful-decks/SKILL.md +67 -0
- package/vendor/desk/skills/desk-problem/SKILL.md +87 -0
- package/vendor/desk/skills/directory-structure/SKILL.md +169 -0
- package/vendor/desk/skills/doc-review-rigor/SKILL.md +63 -0
- package/vendor/desk/skills/draining-issues/SKILL.md +62 -0
- package/vendor/desk/skills/evaluate-release/SKILL.md +96 -0
- package/vendor/desk/skills/evidence-discipline/SKILL.md +150 -0
- package/vendor/desk/skills/factory-evaluator/SKILL.md +122 -0
- package/vendor/desk/skills/factory-task-context/SKILL.md +116 -0
- package/vendor/desk/skills/factory-work/SKILL.md +16 -0
- package/vendor/desk/skills/fast-honest-ci/SKILL.md +70 -0
- package/vendor/desk/skills/fast-honest-ci/examples.md +49 -0
- package/vendor/desk/skills/first-run-bootstrap/SKILL.md +95 -0
- package/vendor/desk/skills/friction-management/SKILL.md +98 -0
- package/vendor/desk/skills/git-hygiene/SKILL.md +253 -0
- package/vendor/desk/skills/independent-review/SKILL.md +34 -0
- package/vendor/desk/skills/interaction-style/SKILL.md +239 -0
- package/vendor/desk/skills/lesson-capture/SKILL.md +85 -0
- package/vendor/desk/skills/lesson-capture/agents-md-budget.mjs +61 -0
- package/vendor/desk/skills/online-evaluation/SKILL.md +81 -0
- package/vendor/desk/skills/operator-voice-comments/LICENSE-humanize +21 -0
- package/vendor/desk/skills/operator-voice-comments/SKILL.md +90 -0
- package/vendor/desk/skills/operator-voice-comments/human-voice.md +43 -0
- package/vendor/desk/skills/peer-pr-review/SKILL.md +104 -0
- package/vendor/desk/skills/pr-feedback-on-own-pr/SKILL.md +145 -0
- package/vendor/desk/skills/pr-review-interrogation/SKILL.md +121 -0
- package/vendor/desk/skills/pr-reviewer-audit/SKILL.md +68 -0
- package/vendor/desk/skills/pr-reviewer-audit/helpers/audit.py +335 -0
- package/vendor/desk/skills/pr-reviewer-audit/helpers/test_audit.py +486 -0
- package/vendor/desk/skills/pr-self-review/SKILL.md +86 -0
- package/vendor/desk/skills/pr-surface-hygiene/SKILL.md +105 -0
- package/vendor/desk/skills/pr-surface-hygiene/check-visual-proof.cjs +99 -0
- package/vendor/desk/skills/pr-surface-hygiene/repository-setup.md +19 -0
- package/vendor/desk/skills/pr-surface-hygiene/resources/pr-visual-proof.yml +29 -0
- package/vendor/desk/skills/pr-surface-hygiene/resources/pull-request-template.md +5 -0
- package/vendor/desk/skills/preflight-actions/SKILL.md +60 -0
- package/vendor/desk/skills/preview-feedback/SKILL.md +70 -0
- package/vendor/desk/skills/repo-handling/SKILL.md +67 -0
- package/vendor/desk/skills/rnd-lab/SKILL.md +52 -0
- package/vendor/desk/skills/runtime-symptom-investigation/SKILL.md +106 -0
- package/vendor/desk/skills/session-resumption/SKILL.md +126 -0
- package/vendor/desk/skills/session-start/SKILL.md +54 -0
- package/vendor/desk/skills/session-start/details.md +150 -0
- package/vendor/desk/skills/session-start-migrations/README.md +71 -0
- package/vendor/desk/skills/session-start-migrations/SKILL.md +108 -0
- package/vendor/desk/skills/start-task/SKILL.md +88 -0
- package/vendor/desk/skills/task-card-format/SKILL.md +198 -0
- package/vendor/desk/skills/task-lifecycle/SKILL.md +217 -0
- package/vendor/desk/skills/track-card-format/SKILL.md +90 -0
- package/vendor/desk/skills/using-desk/SKILL.md +58 -0
- package/vendor/desk/skills/using-superpowers-with-desk/SKILL.md +156 -0
- package/vendor/desk/skills/work-orchestration/SKILL.md +162 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
// desk MCP server registration.
|
|
2
|
+
//
|
|
3
|
+
// Registers every tool in tool-names.js as stdio MCP handlers. Units 3 + 5 wire every
|
|
4
|
+
// tool to a real implementation:
|
|
5
|
+
// - Unit 3: task_create, task_update, task_archive, track_create,
|
|
6
|
+
// track_update, friction_add, lesson_add
|
|
7
|
+
// - Crew teammate notes: note
|
|
8
|
+
// - M4-2 (cheap moves): task_update with a move, track_update with a rename
|
|
9
|
+
// - M4-6 Part 2: desk_save (commits hand-written files the same way every
|
|
10
|
+
// other write tool commits its own)
|
|
11
|
+
// - Unit 5: desk_search (also the newest-first listing), desk_recall
|
|
12
|
+
// - Index mgmt: desk_doctor `reindex` (re-reads the desk into this session's search engine)
|
|
13
|
+
// - Health/status: desk_status and desk_doctor (session-start-safe, non-mutating)
|
|
14
|
+
//
|
|
15
|
+
// There is no qualitative feedback tool here. Preview feedback a participant
|
|
16
|
+
// chooses to offer is written as Markdown in their own desk
|
|
17
|
+
// (`_meta/preview-feedback.md`); the private store under src/feedback/ stays a
|
|
18
|
+
// protected-storage primitive for records that already exist, with no route
|
|
19
|
+
// from this server and none to be added without its own approval.
|
|
20
|
+
|
|
21
|
+
import { withStuckSaves } from "./runtime/unmerged-saves.js"
|
|
22
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js"
|
|
23
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
24
|
+
import { types } from "node:util"
|
|
25
|
+
import {
|
|
26
|
+
CallToolRequestSchema,
|
|
27
|
+
ListToolsRequestSchema,
|
|
28
|
+
} from "@modelcontextprotocol/sdk/types.js"
|
|
29
|
+
|
|
30
|
+
import { TOOL_NAMES, TOOL_DESCRIPTIONS, TOOL_ANNOTATIONS } from "./tool-names.js"
|
|
31
|
+
import { unknownToolMessage } from "./tool-refusal.cjs"
|
|
32
|
+
import { TOOL_INPUT_SCHEMAS } from "./tool-schemas.js"
|
|
33
|
+
import { ACTION_TOOLS } from "./actions/served.js"
|
|
34
|
+
import { deskVersion } from "./package-metadata.js"
|
|
35
|
+
import {
|
|
36
|
+
task_create,
|
|
37
|
+
task_update,
|
|
38
|
+
task_archive,
|
|
39
|
+
} from "./tools/task.js"
|
|
40
|
+
import { taskFocus } from "./tools/task-focus.js"
|
|
41
|
+
import { taskSignoff } from "./tools/task-signoff.js"
|
|
42
|
+
import { track_create, track_update } from "./tools/track.js"
|
|
43
|
+
import { taskMoveRequested, moveTaskAlone, trackRenameRequested, renameTrackAlone } from "./tools/move.js"
|
|
44
|
+
import { friction_add } from "./tools/friction.js"
|
|
45
|
+
import { improvement_open, improvement_next, improvement_update } from "./tools/improvement.js"
|
|
46
|
+
import { lesson_add } from "./tools/lesson.js"
|
|
47
|
+
import { desk_save } from "./tools/desk-save.js"
|
|
48
|
+
import { note } from "./tools/note.js"
|
|
49
|
+
import {
|
|
50
|
+
desk_search,
|
|
51
|
+
desk_recall,
|
|
52
|
+
} from "./tools/search.js"
|
|
53
|
+
import { deskSkill } from "./runtime/skills.js"
|
|
54
|
+
import { desk_status } from "./tools/status.js"
|
|
55
|
+
export { waitForStatusInspection } from "./tools/status.js"
|
|
56
|
+
import { doctorRuntime } from "./tools/doctor.js"
|
|
57
|
+
import { SIBLING_DESK_TOOLS, resolveSiblingDesk } from "./tools/sibling-desk.js"
|
|
58
|
+
export { createSearchEngine } from "./search/engine.js"
|
|
59
|
+
import { searchRouter } from "./search/files-router.js"
|
|
60
|
+
import { headlessRefusal } from "./factory/headless-flag.js"
|
|
61
|
+
import { NATIVE_STAGES, NATIVE_STAGE_MAX_US, nativeStageTraceEnabled, runWithNativeStageScope } from "./tools/native-stage-context.js"
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
// Map tool name → implementation. Every tool now has a real body.
|
|
65
|
+
// Exported so tests can register a probe impl to assert dispatch threading.
|
|
66
|
+
export const TOOL_IMPLS = {
|
|
67
|
+
task_create,
|
|
68
|
+
task_update: (args) => (taskMoveRequested(args.input) ? moveTaskAlone(args) : task_update(args)),
|
|
69
|
+
task_archive,
|
|
70
|
+
task_focus: taskFocus,
|
|
71
|
+
task_signoff: taskSignoff,
|
|
72
|
+
track_create,
|
|
73
|
+
track_update: (args) => (trackRenameRequested(args.input) ? renameTrackAlone(args) : track_update(args)),
|
|
74
|
+
friction_add,
|
|
75
|
+
lesson_add,
|
|
76
|
+
desk_save,
|
|
77
|
+
note,
|
|
78
|
+
desk_search,
|
|
79
|
+
desk_recall,
|
|
80
|
+
desk_status,
|
|
81
|
+
desk_doctor: doctorRuntime,
|
|
82
|
+
desk_skill: ({ input }) => deskSkill(input),
|
|
83
|
+
improvement_open,
|
|
84
|
+
improvement_next,
|
|
85
|
+
improvement_update,
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const TRACE_PREFIX = "DESK_NATIVE_RECEIPT_V1 "
|
|
89
|
+
const TRACE_FRAME_BYTES = 65536
|
|
90
|
+
const TRACE_MISSING = Symbol("missing")
|
|
91
|
+
const TRACE_EVENTS = new Set(["native_spawn", "capture_requested", "native_captured", "admission_requested", "native_ready",
|
|
92
|
+
"callback_started", "callback_completed", "GO_attempted", "native_result", "close_requested", "native_exit", "native_close", "session_settled"])
|
|
93
|
+
const TRACE_ISSUES = new Set(["events_oversized", "invalid_or_unexpected_protocol", "stdin_error", "spawn_error", "stdout_error",
|
|
94
|
+
"stderr_error", "stdout_oversized", "stderr_oversized", "stderr_nonempty", "malformed_json", "unterminated_output", "closed_before_requested_stage"])
|
|
95
|
+
const TRACE_SIGNALS = new Set(["SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", "SIGABRT", "SIGIOT", "SIGBUS", "SIGFPE",
|
|
96
|
+
"SIGKILL", "SIGUSR1", "SIGSEGV", "SIGUSR2", "SIGPIPE", "SIGALRM", "SIGTERM", "SIGCHLD", "SIGCONT", "SIGSTOP", "SIGTSTP",
|
|
97
|
+
"SIGTTIN", "SIGTTOU", "SIGURG", "SIGXCPU", "SIGXFSZ", "SIGVTALRM", "SIGPROF", "SIGWINCH", "SIGIO", "SIGPOLL",
|
|
98
|
+
"SIGPWR", "SIGSYS", "SIGBREAK", "SIGINFO", "SIGEMT", "SIGLOST", "SIGUNUSED"])
|
|
99
|
+
|
|
100
|
+
function traceObject(value) {
|
|
101
|
+
if (value === null || (typeof value !== "object" && typeof value !== "function") || types.isProxy(value)) throw new Error("unavailable")
|
|
102
|
+
return value
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function traceData(value, key) {
|
|
106
|
+
traceObject(value)
|
|
107
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key)
|
|
108
|
+
if (!descriptor) return TRACE_MISSING
|
|
109
|
+
if (!Object.hasOwn(descriptor, "value")) throw new Error("unavailable")
|
|
110
|
+
return descriptor.value
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function nativeReceiptTraceEnabled(env) {
|
|
114
|
+
try {
|
|
115
|
+
return traceData(env, "CI") === "true" && traceData(env, "GITHUB_ACTIONS") === "true" &&
|
|
116
|
+
traceData(env, "DESK_BLACKBOX_NATIVE_RECEIPT_TRACE") === "1"
|
|
117
|
+
} catch { return false }
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function nativeReceiptRequestId(extra) {
|
|
121
|
+
try {
|
|
122
|
+
const id = traceData(extra, "requestId")
|
|
123
|
+
return Number.isSafeInteger(id) && id >= 0 ? id : null
|
|
124
|
+
} catch { return null }
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** Untrusted structural observations only; never used for archive admission or verdicts. */
|
|
128
|
+
export function projectNativeReceipt(error) {
|
|
129
|
+
const unavailable = () => ({ schemaVersion: 1, observationalOnly: true, tool: "task_archive", status: "unavailable", code: "receipt_unavailable", incomplete: true })
|
|
130
|
+
try {
|
|
131
|
+
const receipt = traceData(error, "handleReceipt")
|
|
132
|
+
const scope = traceData(receipt, "scope")
|
|
133
|
+
if (typeof scope !== "string" || scope.length !== "archive_native_preadmission_session".length || scope !== "archive_native_preadmission_session") return unavailable()
|
|
134
|
+
const out = { schemaVersion: 1, observationalOnly: true, tool: "task_archive", status: "available", scope: "archive_native_preadmission_session",
|
|
135
|
+
incomplete: false, truncated: false, originComplete: false, fieldStatus: {} }
|
|
136
|
+
const primitive = (object, key, label, valid) => {
|
|
137
|
+
const value = traceData(object, key)
|
|
138
|
+
const status = value === TRACE_MISSING ? "absent" : value === null ? "unknown" : valid(value) ? "present" : "invalid"
|
|
139
|
+
out.fieldStatus[label] = status
|
|
140
|
+
if (status !== "present") out.incomplete = true
|
|
141
|
+
return status === "present" ? value : null
|
|
142
|
+
}
|
|
143
|
+
const integer = value => Number.isSafeInteger(value) && value >= 0
|
|
144
|
+
const boolean = value => typeof value === "boolean"
|
|
145
|
+
const member = (object, key) => {
|
|
146
|
+
const value = traceData(object, key)
|
|
147
|
+
if (value === TRACE_MISSING || value === null) {
|
|
148
|
+
out.fieldStatus[key] = value === TRACE_MISSING ? "absent" : "unknown"
|
|
149
|
+
out.incomplete = true
|
|
150
|
+
return {}
|
|
151
|
+
}
|
|
152
|
+
return traceObject(value)
|
|
153
|
+
}
|
|
154
|
+
const array = (key, max) => {
|
|
155
|
+
const value = traceData(receipt, key)
|
|
156
|
+
if (value === TRACE_MISSING || value === null) {
|
|
157
|
+
out.fieldStatus[key] = value === TRACE_MISSING ? "absent" : "unknown"
|
|
158
|
+
out.incomplete = true
|
|
159
|
+
return []
|
|
160
|
+
}
|
|
161
|
+
traceObject(value)
|
|
162
|
+
if (!Array.isArray(value)) throw new Error("unavailable")
|
|
163
|
+
const length = traceData(value, "length")
|
|
164
|
+
out.fieldStatus[key] = length > max ? "truncated" : "present"
|
|
165
|
+
if (length > max) { out.truncated = true; out.incomplete = true }
|
|
166
|
+
const selected = []
|
|
167
|
+
for (let i = 0; i < Math.min(length, max); i++) selected.push(traceData(value, `${i}`))
|
|
168
|
+
return selected
|
|
169
|
+
}
|
|
170
|
+
for (const key of ["helperSha256", "programSha256", "executedProgramSha256"])
|
|
171
|
+
out[key] = primitive(receipt, key, key, value => typeof value === "string" && value.length === 64 && /^[a-f0-9]{64}$/u.test(value))
|
|
172
|
+
for (const key of ["capturedValidated", "admissionValidated", "operationFailure", "cleanupFailure", "cleanupConfirmed", "uncertain", "settled"])
|
|
173
|
+
out[key] = primitive(receipt, key, key, boolean)
|
|
174
|
+
for (const key of ["droppedEvents", "stdoutBytes", "stderrBytes"]) out[key] = primitive(receipt, key, key, integer)
|
|
175
|
+
const bounds = member(receipt, "bounds")
|
|
176
|
+
out.bounds = {}
|
|
177
|
+
for (const key of ["readinessMs", "ackAndCloseMs", "closeGraceMs", "retirementMs", "stdoutBytes", "stderrBytes", "events"])
|
|
178
|
+
out.bounds[key] = primitive(bounds, key, `bounds.${key}`, integer)
|
|
179
|
+
const handles = member(receipt, "handles")
|
|
180
|
+
out.handles = {}
|
|
181
|
+
for (const key of ["opened", "closeAttempts", "closed"]) out.handles[key] = primitive(handles, key, `handles.${key}`, integer)
|
|
182
|
+
out.handles.confirmedDisposed = primitive(handles, "confirmedDisposed", "handles.confirmedDisposed", boolean)
|
|
183
|
+
const move = member(receipt, "archiveMove")
|
|
184
|
+
out.archiveMove = {}
|
|
185
|
+
for (const key of ["released", "closed", "forced"]) out.archiveMove[key] = primitive(move, key, `archiveMove.${key}`, boolean)
|
|
186
|
+
for (const [key, choices] of [["movement", ["not_released", "confirmed", "refused", "unconfirmed"]], ["retirement", ["unconfirmed", "forced", "confirmed"]]])
|
|
187
|
+
out.archiveMove[key] = primitive(move, key, `archiveMove.${key}`, value => typeof value === "string" && value.length <= 32 && choices.includes(value))
|
|
188
|
+
for (const key of ["exit", "close"]) {
|
|
189
|
+
const value = traceData(receipt, key)
|
|
190
|
+
const observed = value !== TRACE_MISSING && value !== null
|
|
191
|
+
out.fieldStatus[key] = value === TRACE_MISSING ? "absent" : value === null ? "unknown" : "present"
|
|
192
|
+
if (!observed) out.incomplete = true
|
|
193
|
+
out[key] = { observed, code: null, signal: null }
|
|
194
|
+
if (observed) {
|
|
195
|
+
out[key].code = primitive(value, "code", `${key}.code`, code => Number.isSafeInteger(code) && code >= -2147483648 && code <= 2147483647)
|
|
196
|
+
out[key].signal = primitive(value, "signal", `${key}.signal`, signal => typeof signal === "string" && signal.length <= 16 && TRACE_SIGNALS.has(signal))
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
let origin = null, previousTime = null, previousSequence = 0
|
|
200
|
+
out.events = array("events", 128).map((event, index) => {
|
|
201
|
+
traceObject(event)
|
|
202
|
+
const type = primitive(event, "type", `events.${index}.type`, value => typeof value === "string" && value.length <= 32 && TRACE_EVENTS.has(value))
|
|
203
|
+
const sequence = primitive(event, "sequence", `events.${index}.sequence`, value => integer(value) && value > previousSequence)
|
|
204
|
+
if (sequence !== null) previousSequence = sequence
|
|
205
|
+
const time = traceData(event, "monotonicNs")
|
|
206
|
+
let qualified = null
|
|
207
|
+
if (typeof time === "string" && time.length >= 1 && time.length <= 30 && /^[0-9]+$/u.test(time)) qualified = BigInt(time)
|
|
208
|
+
if (index === 0 && qualified !== null) { origin = qualified; out.originComplete = true }
|
|
209
|
+
let elapsedMs = null
|
|
210
|
+
if (qualified !== null && origin !== null && qualified >= origin && (previousTime === null || qualified >= previousTime)) {
|
|
211
|
+
const delta = qualified - origin
|
|
212
|
+
if (delta <= 900000000000n) elapsedMs = Number(delta) / 1000000
|
|
213
|
+
}
|
|
214
|
+
if (qualified !== null && (previousTime === null || qualified >= previousTime)) previousTime = qualified
|
|
215
|
+
if (elapsedMs === null) out.incomplete = true
|
|
216
|
+
return { type, sequence, elapsedMs, timeStatus: elapsedMs === null ? "unavailable" : "present",
|
|
217
|
+
sequenceStatus: out.fieldStatus[`events.${index}.sequence`] }
|
|
218
|
+
})
|
|
219
|
+
if (!out.events.length) out.incomplete = true
|
|
220
|
+
out.protocolIssues = []
|
|
221
|
+
for (const code of array("protocolIssues", 16)) {
|
|
222
|
+
if (typeof code === "string" && code.length <= 40 && TRACE_ISSUES.has(code)) out.protocolIssues.push(code)
|
|
223
|
+
else { out.incomplete = true; out.fieldStatus.protocolIssues = "invalid" }
|
|
224
|
+
}
|
|
225
|
+
if (traceData(receipt, "programVariant") !== TRACE_MISSING) {
|
|
226
|
+
out.programVariant = primitive(receipt, "programVariant", "programVariant", value => value === "stage_diag")
|
|
227
|
+
out.nativeStages = []
|
|
228
|
+
let previous = null
|
|
229
|
+
for (const [index, entry] of array("nativeStages", NATIVE_STAGES.length).entries()) {
|
|
230
|
+
traceObject(entry)
|
|
231
|
+
const stage = traceData(entry, "stage"), nativeUs = traceData(entry, "nativeUs"), wrapperUs = traceData(entry, "wrapperUs")
|
|
232
|
+
const bounded = value => integer(value) && value <= NATIVE_STAGE_MAX_US
|
|
233
|
+
if (stage !== NATIVE_STAGES[index] || !bounded(nativeUs) || !bounded(wrapperUs) ||
|
|
234
|
+
previous && (nativeUs < previous.nativeUs || wrapperUs < previous.wrapperUs)) {
|
|
235
|
+
out.incomplete = true
|
|
236
|
+
out.fieldStatus.nativeStages = "invalid"
|
|
237
|
+
break
|
|
238
|
+
}
|
|
239
|
+
previous = { stage, nativeUs, wrapperUs }
|
|
240
|
+
out.nativeStages.push(previous)
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return out
|
|
244
|
+
} catch { return unavailable() }
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export function writeBoundedDiagnosticFrame(serializedFrame, sink) {
|
|
248
|
+
if (typeof serializedFrame !== "string" || typeof sink !== "function" || serializedFrame.length > TRACE_FRAME_BYTES) return false
|
|
249
|
+
if (Buffer.byteLength(serializedFrame, "utf8") > TRACE_FRAME_BYTES) return false
|
|
250
|
+
try {
|
|
251
|
+
sink(serializedFrame)
|
|
252
|
+
return true // Invocation is not confirmed channel delivery.
|
|
253
|
+
} catch { return false }
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function emitNativeReceipt(error, requestId, write) {
|
|
257
|
+
if (!Number.isSafeInteger(requestId) || requestId < 0) return
|
|
258
|
+
const line = `${TRACE_PREFIX}${JSON.stringify({ requestId, receipt: projectNativeReceipt(error) })}\n`
|
|
259
|
+
writeBoundedDiagnosticFrame(line, write)
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// Success margins use the same frame and projector, scoped to this request by the call's own async context.
|
|
263
|
+
function emitNativeStageSummary(summary, requestId, write) {
|
|
264
|
+
emitNativeReceipt({ handleReceipt: summary }, requestId, write)
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Dispatch a single MCP call. Pulled out from startServer so tests can
|
|
270
|
+
* exercise the dispatch table directly (no stdio transport needed).
|
|
271
|
+
*/
|
|
272
|
+
export async function callTool({ deskRoot, name, input, person = null, statusContext = {}, signal, env = process.env,
|
|
273
|
+
traceRequestId = null, traceWrite = line => process.stderr.write(line, () => {}) }) {
|
|
274
|
+
if (!TOOL_NAMES.includes(name)) {
|
|
275
|
+
return {
|
|
276
|
+
content: [{ type: "text", text: unknownToolMessage(name, TOOL_NAMES, "Desk's") }],
|
|
277
|
+
structuredContent: { code: "unknown_door" },
|
|
278
|
+
isError: true,
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
const refused = headlessRefusal(name, env)
|
|
282
|
+
if (refused) return { content: [{ type: "text", text: JSON.stringify(refused) }], isError: true }
|
|
283
|
+
const impl = TOOL_IMPLS[name]
|
|
284
|
+
if (!impl) {
|
|
285
|
+
// Every tool wired; this branch only fires if a name exists in
|
|
286
|
+
// TOOL_NAMES but is missing from TOOL_IMPLS — i.e. a wiring bug.
|
|
287
|
+
// Return a structured payload that points at the cause.
|
|
288
|
+
return {
|
|
289
|
+
content: [
|
|
290
|
+
{
|
|
291
|
+
type: "text",
|
|
292
|
+
text: JSON.stringify({
|
|
293
|
+
status: "not_implemented",
|
|
294
|
+
tool: name,
|
|
295
|
+
note: `tool registered in TOOL_NAMES but missing from TOOL_IMPLS (wiring bug). desk root = ${deskRoot}`,
|
|
296
|
+
}),
|
|
297
|
+
},
|
|
298
|
+
],
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
try {
|
|
302
|
+
// The session's search engine (src/search/engine.js), once admission has started it: writes tell it what they changed, and searches use it.
|
|
303
|
+
let target = { deskRoot, input: input ?? {}, statusContext, search: statusContext.search ?? null }
|
|
304
|
+
// `desk` points a card tool at another desk registered on this machine. That desk has its own search index and focus, so the call takes neither of this session's.
|
|
305
|
+
if (SIBLING_DESK_TOOLS.includes(name) && target.input.desk !== undefined) {
|
|
306
|
+
const { desk, ...rest } = target.input
|
|
307
|
+
target = { deskRoot: resolveSiblingDesk({ tool: name, desk, boundRoot: deskRoot, person, env }).deskRoot, input: rest, statusContext: {}, search: null }
|
|
308
|
+
}
|
|
309
|
+
const invoke = () => impl({
|
|
310
|
+
deskRoot: target.deskRoot, input: target.input, person, statusContext: target.statusContext, search: target.search,
|
|
311
|
+
queryRouter: searchRouter(target.search), signal,
|
|
312
|
+
})
|
|
313
|
+
let stageStore = null
|
|
314
|
+
let result = name === "task_archive" && nativeStageTraceEnabled(env)
|
|
315
|
+
? await runWithNativeStageScope(store => { stageStore = store; return invoke() })
|
|
316
|
+
: await invoke()
|
|
317
|
+
if (target.deskRoot !== deskRoot && result !== null && typeof result === "object") result = { ...result, desk_root: target.deskRoot }
|
|
318
|
+
if (stageStore?.summaries.length === 1) emitNativeStageSummary(stageStore.summaries[0], traceRequestId, traceWrite)
|
|
319
|
+
// desk_skill answers with the skill's own text: its result is already an MCP answer.
|
|
320
|
+
if (name === "desk_skill" && Array.isArray(result?.content)) return result
|
|
321
|
+
// A save that has waited past ten minutes in an unmerged publication PR is named in every reply of every session on this desk.
|
|
322
|
+
return {
|
|
323
|
+
content: [{ type: "text", text: JSON.stringify(withStuckSaves(result, { root: deskRoot, env, now: Date.now })) }],
|
|
324
|
+
}
|
|
325
|
+
} catch (err) {
|
|
326
|
+
if (name === "task_archive" && nativeReceiptTraceEnabled(env)) emitNativeReceipt(err, traceRequestId, traceWrite)
|
|
327
|
+
return {
|
|
328
|
+
content: [
|
|
329
|
+
{
|
|
330
|
+
type: "text",
|
|
331
|
+
text: JSON.stringify({
|
|
332
|
+
status: "error",
|
|
333
|
+
tool: name,
|
|
334
|
+
message: err?.message ?? String(err),
|
|
335
|
+
// The error's stable code (see the tools' errors), so an agent can branch on the failure without parsing prose.
|
|
336
|
+
...(typeof err?.code === "string" ? { code: err.code } : {}),
|
|
337
|
+
}),
|
|
338
|
+
},
|
|
339
|
+
],
|
|
340
|
+
isError: true,
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export function createMcpServer() {
|
|
346
|
+
return new Server(
|
|
347
|
+
{
|
|
348
|
+
name: "desk-mcp",
|
|
349
|
+
version: deskVersion() ?? "0.0.0",
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
capabilities: { tools: {} },
|
|
353
|
+
},
|
|
354
|
+
)
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export function createMcpTransport() {
|
|
358
|
+
return new StdioServerTransport()
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export async function startServer({
|
|
362
|
+
deskRoot,
|
|
363
|
+
person = null,
|
|
364
|
+
statusContext = {},
|
|
365
|
+
server,
|
|
366
|
+
transport,
|
|
367
|
+
createServer = createMcpServer,
|
|
368
|
+
createTransport = createMcpTransport,
|
|
369
|
+
}) {
|
|
370
|
+
const activeServer = server ?? createServer()
|
|
371
|
+
const activeTransport = transport ?? createTransport()
|
|
372
|
+
activeServer.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
373
|
+
tools: TOOL_NAMES.map((name) => ({
|
|
374
|
+
name,
|
|
375
|
+
description: TOOL_DESCRIPTIONS[name],
|
|
376
|
+
inputSchema: TOOL_INPUT_SCHEMAS[name],
|
|
377
|
+
...(ACTION_TOOLS[name] ? { title: ACTION_TOOLS[name].title, annotations: TOOL_ANNOTATIONS[name] } : {}),
|
|
378
|
+
})),
|
|
379
|
+
}))
|
|
380
|
+
|
|
381
|
+
activeServer.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
382
|
+
const name = request.params?.name
|
|
383
|
+
const input = request.params?.arguments ?? {}
|
|
384
|
+
const traceRequestId = nativeReceiptTraceEnabled(process.env) ? nativeReceiptRequestId(extra) : null
|
|
385
|
+
return callTool({ deskRoot, name, input, person, statusContext, signal: extra?.signal, traceRequestId })
|
|
386
|
+
})
|
|
387
|
+
|
|
388
|
+
await activeServer.connect(activeTransport)
|
|
389
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Single source of truth for the MCP tools desk-mcp exposes.
|
|
2
|
+
//
|
|
3
|
+
// Imported by both server.js (registers them) and the tests (asserts the
|
|
4
|
+
// list is canonical). Kept in a no-deps file so tests can import without
|
|
5
|
+
// the @modelcontextprotocol/sdk dep being installed.
|
|
6
|
+
|
|
7
|
+
import { ACTION_TOOLS } from "./actions/served.js"
|
|
8
|
+
|
|
9
|
+
export const TOOL_NAMES = [
|
|
10
|
+
// Runtime CRUD (Unit 3)
|
|
11
|
+
"task_create",
|
|
12
|
+
"task_update",
|
|
13
|
+
"task_archive",
|
|
14
|
+
"task_focus",
|
|
15
|
+
"task_signoff",
|
|
16
|
+
"track_create",
|
|
17
|
+
"track_update",
|
|
18
|
+
"friction_add",
|
|
19
|
+
"lesson_add",
|
|
20
|
+
"desk_save",
|
|
21
|
+
// Teammate notes (Crew)
|
|
22
|
+
"note",
|
|
23
|
+
// Search
|
|
24
|
+
"desk_search",
|
|
25
|
+
"desk_recall",
|
|
26
|
+
// Health/status
|
|
27
|
+
"desk_status",
|
|
28
|
+
"desk_doctor",
|
|
29
|
+
// Skills, for a client that cannot load them as plugin skills
|
|
30
|
+
"desk_skill",
|
|
31
|
+
// Improvement cards
|
|
32
|
+
"improvement_open",
|
|
33
|
+
"improvement_next",
|
|
34
|
+
"improvement_update",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
const HAND_WRITTEN_DESCRIPTIONS = {
|
|
38
|
+
task_create:
|
|
39
|
+
"Use when new work needs its own card: create a task card at <track>/<slug>/task.md. `slug` must be an outcome name: 1-6 lowercase kebab-case words, at most 48 characters, not prompt-like or credential-like; a rejection says what to fix.",
|
|
40
|
+
task_update:
|
|
41
|
+
"Use when an existing task card changes (direct edits are denied). Merge `frontmatter`, record progress with `note` and `next_step`, put rulings and evidence pointers in `log` (a dated entry in log.md beside the card; cheap, rapid entries share one commit), or change `step`, `resource` or a section. A move to `done` needs `evidence`; a done/cancelled result carries archive_due: the owning main agent calls task_archive. To move or rename, pass `to_track`, `to_slug`, `unarchive` or `into_task` alone.",
|
|
42
|
+
task_archive:
|
|
43
|
+
"Use when a task's work is finished or cancelled: move <track>/<slug>/ to <track>/_archive/<slug>/. A task not yet done or cancelled needs `evidence` or `outcome: \"cancelled\"`. Returns archive_pending with the retained path and next_action when publication is unproven; that is not completed publication. Repeating an archived task is safe.",
|
|
44
|
+
task_signoff:
|
|
45
|
+
"Record the operator's answer to a delivered task: accepted or refused. Call it only after the operator has answered, in a turn after the one that delivered the work. A refusal needs `reason` (theirs) and `return_reason` (your own reading) and puts the task back to processing. Desk records any call as the operator's answer without checking which agent made it, so it is the main agent's tool: a subagent has not heard the answer.",
|
|
46
|
+
task_focus:
|
|
47
|
+
"Declare the task this session is working on, so its time is credited to it. Pass `track` and `slug` of an existing card (live or archived), or `clear: true` for a side conversation. Main agent only; a subagent never calls it. Writes nothing. Returns `task_status`, `recent_progress`, `next_step`, any `shelved_lessons` to read before you act, and `archive_due` for a done/cancelled card. `task_create` with `focus: true` does the same for a new task.",
|
|
48
|
+
track_create:
|
|
49
|
+
"Use when new work needs its own track: create a track at <slug>/track.md. `slug` must be an outcome name (1-6 lowercase kebab-case words, at most 48 characters) and `scope` is required: one line, at most 240 characters, \"<what belongs>; not <what doesn't>\". A rejection says what to fix. On a Git desk it stages and commits the new track.md; a commit failure keeps the written file and is reported in a `commit` field.",
|
|
50
|
+
track_update:
|
|
51
|
+
"Merge frontmatter or append to the body of an existing track.md. `frontmatter.scope`, if set, is validated as track_create validates it. On a Git desk it stages and commits the track.md when that file held no unstaged changes before the write; if it did (another session's edit, say), the write lands unstaged and uncommitted and the reply has no `commit` field; a commit failure keeps the written file and is reported in a `commit` field. To rename the track, pass `rename_to` alone; the input schema has the rest.",
|
|
52
|
+
friction_add:
|
|
53
|
+
"Use when something got in your way and should be recorded: append a friction entry to _meta/friction.md, or under <track>/_friction/ when `track` is given. `about` is \"setup\" (default, kept on the desk) or \"system\" (Desk, its skills or the factory); system friction needs a one-line `title` and opens an improvement card. Read `improvement` in the result: opened, duplicate or reopened means the card exists. `error_code` reports a Desk failure with its evidence (friction-management has the rest).",
|
|
54
|
+
lesson_add:
|
|
55
|
+
"Record a correction where something loads it, and read `in_effect` and `message` in the reply before you tell anyone the lesson is kept. `scope` \"personal\" adds a one-line rule to this person's AGENTS.md; \"desk\" is for how Desk's tools or a plugin's skills behave: it needs `owner` and opens an improvement card; \"team\" adds a line to a shared repository's AGENTS.md through a pull request: it needs `source`.",
|
|
56
|
+
note:
|
|
57
|
+
"In a Crew shared workspace, leave another member a dated note that their session start lists until they acknowledge it (`to`, `subject`, `body`), or acknowledge one a teammate left you (`ack`). `body` is your own explanation in your own voice: what someone else thinks goes in as your understanding of it, not quoted in their words. Everyone in the workspace can read it, so put nothing private in it. A note is left only when the reply says `merged`.",
|
|
58
|
+
desk_save:
|
|
59
|
+
"After you write a file with Write or Edit (a planning doc, a spec, a report), call this with its path to commit it. `paths` are relative to the desk root, inside this session's write prefix (desks/<alias>/ in a shared workspace). Stages and commits exactly `paths` with `message`. A task card is refused: use the task tools. `tidy: true` commits a desk tidy or its undo. A client with no filesystem passes `files` ({ path, content } text) with or instead of `paths`.",
|
|
60
|
+
improvement_open:
|
|
61
|
+
"Use when a case needs an improvement card: open one on the desk, find it already open, or reopen a closed one. `source` and `id` name the case (the card key is <source>:<id>). Desk builds every title, and a passed `title` is refused as `title_not_allowed`.",
|
|
62
|
+
improvement_update:
|
|
63
|
+
"Use when you ship, release or close a card you hold the claim on, with its `key` and `claim_id`: ship it (`countermeasure` is the pull request URL; `state` \"shipped\" or omitted), release it (`state` \"open\") or close it (`state` \"closed_unverified\" with `close_reason`).",
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const TOOL_DESCRIPTIONS = Object.freeze({
|
|
67
|
+
...HAND_WRITTEN_DESCRIPTIONS,
|
|
68
|
+
...Object.fromEntries(Object.entries(ACTION_TOOLS).map(([name, tool]) => [name, tool.description])),
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
// The MCP annotations tools/list serves with each tool (readOnlyHint and the rest), by tool name: today the ones the
|
|
72
|
+
// declarations in actions/ generate. The Ouro AX census reads a tool's read-only evidence here (ax/walkers/mcp.mts).
|
|
73
|
+
export const TOOL_ANNOTATIONS = Object.freeze(Object.fromEntries(Object.entries(ACTION_TOOLS).map(([name, tool]) => [name, tool.annotations])))
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// The refusal for a tool name that a server does not serve. It names the tools the server does serve, and the one served
|
|
4
|
+
// name that is a near match, so an agent that misremembers a name can retry without listing tools again.
|
|
5
|
+
|
|
6
|
+
const NEAR_DISTANCE = 3;
|
|
7
|
+
|
|
8
|
+
function editDistance(a, b) {
|
|
9
|
+
let previous = Array.from({ length: b.length + 1 }, (_, j) => j);
|
|
10
|
+
for (let i = 1; i <= a.length; i++) {
|
|
11
|
+
const row = [i];
|
|
12
|
+
for (let j = 1; j <= b.length; j++) {
|
|
13
|
+
row[j] = Math.min(previous[j] + 1, row[j - 1] + 1, previous[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
|
|
14
|
+
}
|
|
15
|
+
previous = row;
|
|
16
|
+
}
|
|
17
|
+
return previous[b.length];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// A name within three edits, or one that contains a served name (or sits inside one) once it is at least three characters long.
|
|
21
|
+
function isNear(requested, served) {
|
|
22
|
+
if (editDistance(requested, served) <= NEAR_DISTANCE) return true;
|
|
23
|
+
return requested.length >= 3 && (requested.includes(served) || served.includes(requested));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function unknownToolMessage(name, served, toolsLabel) {
|
|
27
|
+
const requested = String(name);
|
|
28
|
+
const near = served
|
|
29
|
+
.filter((tool) => isNear(requested, tool))
|
|
30
|
+
.sort((a, b) => editDistance(requested, a) - editDistance(requested, b))[0];
|
|
31
|
+
const hint = near ? ` Did you mean ${near}?` : "";
|
|
32
|
+
return `unknown tool: ${requested}. ${toolsLabel} tools: ${served.join(", ")}.${hint}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
module.exports = { unknownToolMessage };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// The building blocks of the tool input schemas (tool-schemas.js).
|
|
2
|
+
// Dependency-free, like the schemas themselves.
|
|
3
|
+
|
|
4
|
+
export const text = (description) => ({ type: "string", description })
|
|
5
|
+
export const flag = (description) => ({ type: "boolean", description })
|
|
6
|
+
export const integer = (description) => ({ type: "integer", minimum: 1, description })
|
|
7
|
+
export const list = (description) => ({ type: "array", items: { type: "string" }, description })
|
|
8
|
+
export const oneOf = (options, description) => ({ anyOf: options, description })
|
|
9
|
+
|
|
10
|
+
export function schema(properties, required = []) {
|
|
11
|
+
return Object.freeze({ type: "object", properties, required, additionalProperties: false })
|
|
12
|
+
}
|