@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,235 @@
|
|
|
1
|
+
export { BARE_FAILURE, CAUSE_MARKER, checkFailureCopyAllow, FAILURE_KEYS, LEAD_FAILURE, NOT_A_CAUSE, NOT_BARE_LEADS, PRECISE_FAILURE_KEY, preciseFailureProblem, statesCause, VAGUE_CAUSE, VAGUE_FAILURE_PHRASES, vagueFailureIn, vagueFailuresIn };
|
|
2
|
+
export type { FailureCopyAllow, VagueFailureFinding, VagueFailuresOptions };
|
|
3
|
+
|
|
4
|
+
// The export list comes first because the shadcn CLI drops comments before a file's
|
|
5
|
+
// first statement, which would take the JSDoc below with it.
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A failure says what happened and precisely why (the system and its answer: "The mail service says this file was
|
|
9
|
+
* deleted"), who or what caused it where that is known, and the next step as a working action. "Couldn't show this
|
|
10
|
+
* picture" leaves the agent guessing at the cause and at what to tell the person. When the cause is unknown, the message
|
|
11
|
+
* says what was tried and what came back.
|
|
12
|
+
*
|
|
13
|
+
* Vague: "couldn't", "could not", "something went wrong", "unable to", "failed to load", "an error occurred", and a
|
|
14
|
+
* text that is only a bare "Error" or "Upload failed", unless the cause follows the phrase in the same sentence ("Couldn't send:
|
|
15
|
+
* you're offline. Try again when you're back online.", "… because …"; not "Couldn't send: try again"). A negation or an action before the word ("No errors", "Retry failed") passes. The source rules kit (ouro-source-rules) keeps the identical
|
|
16
|
+
* list for an app's UI copy; change both together. A text that is precise and still holds a phrase ("The card service
|
|
17
|
+
* says your card could not be charged. Use another card.") goes on an allow-list, each entry with its reason.
|
|
18
|
+
*
|
|
19
|
+
* @claim "A negation or an action before the word" registry/ouro/ax/precise-copy.test.mts verify:testExists(registry/ouro/ax/precise-copy.test.mts::finds each vague phrase and a bare failure, and lets precise copy and allowed text through)
|
|
20
|
+
* @claim "unless the cause follows the phrase" registry/ouro/ax/precise-copy.test.mts verify:testExists(registry/ouro/ax/precise-copy.test.mts::finds each vague phrase and a bare failure, and lets precise copy and allowed text through)
|
|
21
|
+
* @claim "goes on an allow-list, each entry with its reason" registry/ouro/ax/precise-copy.test.mts verify:testExists(registry/ouro/ax/precise-copy.test.mts::an allow-list needs a match and a reason in every entry)
|
|
22
|
+
* @claim "The source rules kit (ouro-source-rules) keeps the identical list" scripts/ax.test.mjs verify:testExists(scripts/ax.test.mjs::the precise-copy list keeps the source rules kit's phrases)
|
|
23
|
+
*/
|
|
24
|
+
interface FailureCopyAllow {
|
|
25
|
+
/** Part of the text, case-sensitive: a text that holds it passes. */
|
|
26
|
+
match: string;
|
|
27
|
+
/** Why this wording is precise. */
|
|
28
|
+
reason: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface VagueFailureFinding {
|
|
32
|
+
/** The phrase, by its name ("could not", "bare error"). */
|
|
33
|
+
phrase: string;
|
|
34
|
+
/** Where in the value, such as `error.message`; "" for a string on its own. */
|
|
35
|
+
where: string;
|
|
36
|
+
/** The whole message the phrase is in. */
|
|
37
|
+
text: string;
|
|
38
|
+
/** The allow-list entry that lets it through, or null. */
|
|
39
|
+
allowed: FailureCopyAllow | null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface VagueFailuresOptions {
|
|
43
|
+
/** Read only what speaks to the agent or the person ({@link FAILURE_KEYS}), as in a read's `--json`, whose other fields are the person's data. */
|
|
44
|
+
messagesOnly?: boolean;
|
|
45
|
+
allow?: readonly FailureCopyAllow[];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** A phrase's name, then its pattern. */
|
|
49
|
+
const VAGUE_FAILURE_PHRASES: readonly (readonly [string, RegExp])[] = Object.freeze([
|
|
50
|
+
["couldn't", /\bcouldn[’']?t\b/i],
|
|
51
|
+
["could not", /\bcould not\b/i],
|
|
52
|
+
["something went wrong", /\bsomething went wrong\b/i],
|
|
53
|
+
["unable to", /\bunable to\b/i],
|
|
54
|
+
["failed to load", /\bfailed to load\b/i],
|
|
55
|
+
["an error occurred", /\ban? (?:unknown |unexpected )?error (?:has )?occurred\b|\ban (?:unknown|unexpected) error\b/i],
|
|
56
|
+
] as const);
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* A bare failure: the whole text is "error" or "failed" (or "failure"), at most two words before it, or "Error:" with nothing after.
|
|
60
|
+
*
|
|
61
|
+
* @claim "at most two words before it" registry/ouro/ax/precise-copy.test.mts verify:testExists(registry/ouro/ax/precise-copy.test.mts::finds each vague phrase and a bare failure, and lets precise copy and allowed text through)
|
|
62
|
+
*/
|
|
63
|
+
const BARE_FAILURE = /^[^\p{L}\p{N}]*(?:(?:\p{L}[\p{L}'’-]*\s+){0,2}(?:error|errors|failed|failure)|error\s*:)[^\p{L}\p{N}]*$/iu;
|
|
64
|
+
|
|
65
|
+
/** What marks a failure's cause after the phrase, in the same sentence: a colon, a dash or "because". */
|
|
66
|
+
const CAUSE_MARKER = /:|\s[—–-]\s|\bbecause\b/iu;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* First words that make the words after a marker a next step ("try again") or a vague word ("error") in place of a cause.
|
|
70
|
+
*
|
|
71
|
+
* @claim "First words that make the words after a marker a next step" registry/ouro/ax/precise-copy.test.mts verify:testExists(registry/ouro/ax/precise-copy.test.mts::finds each vague phrase and a bare failure, and lets precise copy and allowed text through)
|
|
72
|
+
*/
|
|
73
|
+
const NOT_A_CAUSE: readonly string[] = Object.freeze(["try", "please", "retry", "contact", "see", "error", "errors", "unknown", "failed", "failure"]);
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* A cause that names nothing: the whole of it is "it broke", "it didn't work", "there was a problem", "an issue occurred"
|
|
77
|
+
* and the like, so it says neither what failed nor why. A cause that goes on ("it failed because the disk is full") names
|
|
78
|
+
* something and passes.
|
|
79
|
+
*
|
|
80
|
+
* @claim "A cause that names nothing" registry/ouro/ax/precise-copy.test.mts verify:testExists(registry/ouro/ax/precise-copy.test.mts::finds each vague phrase and a bare failure, and lets precise copy and allowed text through)
|
|
81
|
+
*/
|
|
82
|
+
const VAGUE_CAUSE = /^[^\p{L}\p{N}]*(?:(?:it|this|that|something)\s+(?:broke|failed|crashed|errored|stopped(?:\s+working)?|went\s+wrong|(?:didn[’']?t|did\s+not|doesn[’']?t|does\s+not)\s+work|(?:isn[’']?t|is\s+not)\s+working)|there\s+(?:was|is)\s+(?:an?\s+)?(?:problem|issue|error)|an?\s+(?:problem|issue|error)\s+(?:has\s+)?(?:occurred|happened))[^\p{L}\p{N}]*$/iu;
|
|
83
|
+
|
|
84
|
+
/** A failure that leads the text ("Error: …", "Upload failed - …"), held to the same test as a phrase; the group is the marker. */
|
|
85
|
+
const LEAD_FAILURE = /^[^\p{L}\p{N}]*(?:\p{L}[\p{L}'’-]*\s+){0,2}(?:error|errors|failed|failure)\s*(:|\s[—–-]\s)/iu;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Words before "error" or "failed" that make the text other than a failure: a negation ("No errors") or an action ("Retry failed").
|
|
89
|
+
*
|
|
90
|
+
* @claim "that make the text other than a failure" registry/ouro/ax/precise-copy.test.mts verify:testExists(registry/ouro/ax/precise-copy.test.mts::finds each vague phrase and a bare failure, and lets precise copy and allowed text through)
|
|
91
|
+
*/
|
|
92
|
+
const NOT_BARE_LEADS: readonly string[] = Object.freeze(["no", "nothing", "zero", "none", "show", "hide", "retry", "clear"]);
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The fields of an answer that speak to the agent or the person: a refusal's or an outcome's `error`, `human` (its
|
|
96
|
+
* `reason` and `resume`), next steps and fixes, and in an Ouro AX answer (one with an `ax` field: an outcome, a checks
|
|
97
|
+
* report) its `summary` and each finding's `detail`.
|
|
98
|
+
*
|
|
99
|
+
* @claim "each finding's `detail`" registry/ouro/ax/precise-copy.test.mts verify:testExists(registry/ouro/ax/precise-copy.test.mts::walks a value, reading an outcome's error, human reason and summary and a checks report's findings, not the person's data)
|
|
100
|
+
*/
|
|
101
|
+
const FAILURE_KEYS: ReadonlySet<string> = new Set(["error", "human", "reason", "next", "fix", "resume"]);
|
|
102
|
+
const AX_KEYS: ReadonlySet<string> = new Set(["summary", "detail"]);
|
|
103
|
+
/** The field on an outcome's `error` or `human`, or a checks row, that says why its short failure text is precise. */
|
|
104
|
+
const PRECISE_FAILURE_KEY = "preciseFailure";
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* What is wrong with a record's `preciseFailure`, or null when the field is absent or holds a reason. A blank or
|
|
108
|
+
* non-text value is skipped, so the detectors keep reading the record's text.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* preciseFailureProblem({ code: "x", preciseFailure: " " }); // "preciseFailure needs a reason in words"
|
|
112
|
+
*/
|
|
113
|
+
function preciseFailureProblem(record: Record<string, unknown>): string | null {
|
|
114
|
+
const reason = record[PRECISE_FAILURE_KEY];
|
|
115
|
+
return reason === undefined || (typeof reason === "string" && reason.trim().length > 0) ? null : "preciseFailure needs a reason in words";
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** A code or a status ("failed", "not_found"), not copy. */
|
|
119
|
+
const TOKEN = /^[a-z][\w.:-]*$/;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* The vague failure phrase in a message, by its name, or null when there is none or an allow-list entry lets it
|
|
123
|
+
* through. A text that is only "Error" or "Upload failed" is "bare error" or "bare failed".
|
|
124
|
+
*
|
|
125
|
+
* @claim "or null when there is none or an allow-list entry lets it through" registry/ouro/ax/precise-copy.test.mts verify:testExists(registry/ouro/ax/precise-copy.test.mts::finds each vague phrase and a bare failure, and lets precise copy and allowed text through)
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* vagueFailureIn("Couldn't show this picture"); // "couldn't"
|
|
129
|
+
* vagueFailureIn("The photo service says this picture was deleted. Ask its owner to share it again."); // null
|
|
130
|
+
*/
|
|
131
|
+
function vagueFailureIn(text: string, allow: readonly FailureCopyAllow[] = []): string | null {
|
|
132
|
+
const phrase = phraseIn(text);
|
|
133
|
+
return phrase && !allowedBy(text, allow) ? phrase : null;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const SENTENCE_END = /[.!?](?=\s|$)/u;
|
|
137
|
+
const WORD = /\p{L}[\p{L}\p{N}'’-]*/gu;
|
|
138
|
+
const wordsOf = (text: string) => text.toLowerCase().match(WORD) ?? [];
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Whether the text after a failure phrase states the cause in the same sentence: after a colon, a dash or "because", a
|
|
142
|
+
* substitution (`${…}`) or at least two words whose first is not in {@link NOT_A_CAUSE}, that are not a cause naming nothing
|
|
143
|
+
* ({@link VAGUE_CAUSE}), with no vague phrase in it.
|
|
144
|
+
*
|
|
145
|
+
* @claim "at least two words whose first is not in" registry/ouro/ax/precise-copy.test.mts verify:testExists(registry/ouro/ax/precise-copy.test.mts::finds each vague phrase and a bare failure, and lets precise copy and allowed text through)
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* statesCause(" send: you're offline. Try again later."); // true
|
|
149
|
+
* statesCause(" send: try again."); // false
|
|
150
|
+
*/
|
|
151
|
+
function statesCause(rest: string): boolean {
|
|
152
|
+
const sentence = rest.split(SENTENCE_END)[0]!;
|
|
153
|
+
const marker = CAUSE_MARKER.exec(sentence);
|
|
154
|
+
if (!marker) return false;
|
|
155
|
+
const cause = sentence.slice(marker.index + marker[0].length);
|
|
156
|
+
if (cause.includes("${…}")) return true;
|
|
157
|
+
const words = wordsOf(cause);
|
|
158
|
+
return words.length >= 2 && !NOT_A_CAUSE.includes(words[0]!) && !VAGUE_CAUSE.test(cause) && !VAGUE_FAILURE_PHRASES.some(([, pattern]) => pattern.test(cause));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function phraseIn(text: string): string | null {
|
|
162
|
+
const trimmed = text.trim();
|
|
163
|
+
if (TOKEN.test(trimmed)) return null;
|
|
164
|
+
const found = VAGUE_FAILURE_PHRASES.find(([, pattern]) =>
|
|
165
|
+
[...text.matchAll(new RegExp(pattern.source, `${pattern.flags}g`))].some((match) => !statesCause(text.slice(match.index + match[0].length))),
|
|
166
|
+
);
|
|
167
|
+
if (found) return found[0];
|
|
168
|
+
const word = (failure: string) => (/\berrors?\b/i.test(failure) ? "bare error" : "bare failed");
|
|
169
|
+
const lead = LEAD_FAILURE.exec(trimmed);
|
|
170
|
+
if (lead && !wordsOf(lead[0]).some((w) => NOT_BARE_LEADS.includes(w))) return statesCause(trimmed.slice(lead[0].length - lead[1]!.length)) ? null : word(lead[0]);
|
|
171
|
+
if (!BARE_FAILURE.test(trimmed)) return null;
|
|
172
|
+
if (wordsOf(trimmed).slice(0, -1).some((w) => NOT_BARE_LEADS.includes(w))) return null;
|
|
173
|
+
return word(trimmed);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const allowedBy = (text: string, allow: readonly FailureCopyAllow[]) => allow.find((entry) => text.includes(entry.match)) ?? null;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Every vague failure message in a value: a message, a `help --json`, an outcome, a refusal or a checks report. A
|
|
180
|
+
* finding an allow-list entry lets through carries the entry. With `messagesOnly`, only what is under
|
|
181
|
+
* {@link FAILURE_KEYS}, and an Ouro AX answer's `summary` and `detail`; a `code` is never read. A record with a
|
|
182
|
+
* `preciseFailure` reason (an outcome's `error` or `human`, a checks row) lets its own short texts, and a list of them, through, with
|
|
183
|
+
* the reason carried as the allow entry; the X-ray's `copy.precise-failure` reads the same list.
|
|
184
|
+
*
|
|
185
|
+
* @claim "a `code` is never read" registry/ouro/ax/precise-copy.test.mts verify:testExists(registry/ouro/ax/precise-copy.test.mts::walks a value, reading an outcome's error, human reason and summary and a checks report's findings, not the person's data)
|
|
186
|
+
* @claim "Every vague failure message in a value" registry/ouro/ax/precise-copy.test.mts verify:testExists(registry/ouro/ax/precise-copy.test.mts::walks a value, reading an outcome's error, human reason and summary and a checks report's findings, not the person's data)
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* vagueFailuresIn({ ax: "outcome/1", state: "failed", summary: "Not sent", error: { code: "send_failed", message: "Something went wrong" } }, { messagesOnly: true });
|
|
190
|
+
* // [{ phrase: "something went wrong", where: "error.message", text: "Something went wrong", allowed: null }]
|
|
191
|
+
*/
|
|
192
|
+
function vagueFailuresIn(value: unknown, options: VagueFailuresOptions = {}): VagueFailureFinding[] {
|
|
193
|
+
const out: VagueFailureFinding[] = [];
|
|
194
|
+
const visit = (v: unknown, where: string, speaks: boolean, ax: boolean, why: string | null = null): void => {
|
|
195
|
+
if (typeof v === "string") {
|
|
196
|
+
const phrase = speaks ? phraseIn(v) : null;
|
|
197
|
+
if (phrase) out.push({ phrase, where, text: v, allowed: why ? { match: v, reason: why } : allowedBy(v, options.allow ?? []) });
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
if (Array.isArray(v)) return v.forEach((x, i) => visit(x, `${where}[${i}]`, speaks, ax, why));
|
|
201
|
+
if (typeof v !== "object" || v === null) return;
|
|
202
|
+
const record = v as Record<string, unknown>;
|
|
203
|
+
const inAx = ax || typeof record["ax"] === "string";
|
|
204
|
+
const reason = record[PRECISE_FAILURE_KEY];
|
|
205
|
+
const own = typeof reason === "string" && reason.trim() ? reason.trim() : null;
|
|
206
|
+
for (const [k, x] of Object.entries(record)) {
|
|
207
|
+
if (k === "code" || k === PRECISE_FAILURE_KEY) continue;
|
|
208
|
+
visit(x, where ? `${where}.${k}` : k, speaks || FAILURE_KEYS.has(k) || (inAx && AX_KEYS.has(k)), inAx, own);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
visit(value, "", !options.messagesOnly, false);
|
|
212
|
+
return out;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* An allow-list read from JSON, checked: a list of `{ match, reason }`, each with a non-empty `match` and a `reason`.
|
|
217
|
+
* Throws naming each entry that is not one, with the fix.
|
|
218
|
+
*
|
|
219
|
+
* @claim "each with a non-empty `match` and a `reason`" registry/ouro/ax/precise-copy.test.mts verify:testExists(registry/ouro/ax/precise-copy.test.mts::an allow-list needs a match and a reason in every entry)
|
|
220
|
+
* @claim "Throws naming each entry that is not one" registry/ouro/ax/precise-copy.test.mts verify:testExists(registry/ouro/ax/precise-copy.test.mts::an allow-list needs a match and a reason in every entry)
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
* checkFailureCopyAllow([{ match: "could not be charged", reason: "names the card service and its answer" }]);
|
|
224
|
+
*/
|
|
225
|
+
function checkFailureCopyAllow(value: unknown): FailureCopyAllow[] {
|
|
226
|
+
const shape = '{ "match": "<part of the text>", "reason": "<why this wording is precise>" }';
|
|
227
|
+
if (!Array.isArray(value)) throw new Error(`the failure copy allow-list is a list. Fix: [${shape}].`);
|
|
228
|
+
const problems = value.flatMap((entry: unknown, i: number) => {
|
|
229
|
+
const e = entry as Partial<FailureCopyAllow> | null;
|
|
230
|
+
const ok = typeof e === "object" && e !== null && typeof e.match === "string" && e.match.length > 0 && typeof e.reason === "string" && e.reason.trim().length > 0;
|
|
231
|
+
return ok ? [] : [`entry ${i} ${JSON.stringify(entry)} needs a non-empty "match" and a "reason". Fix: ${shape}.`];
|
|
232
|
+
});
|
|
233
|
+
if (problems.length) throw new Error(`the failure copy allow-list has ${problems.length} problem${problems.length === 1 ? "" : "s"}:\n${problems.join("\n")}`);
|
|
234
|
+
return value as FailureCopyAllow[];
|
|
235
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
export { AxError, commandLine, didYouMean, errorJson, errorLine, errorMessage, isAxError, shellWord };
|
|
2
|
+
export type { AxErrorBody, AxErrorShape };
|
|
3
|
+
|
|
4
|
+
// The export list comes first because the shadcn CLI drops comments before a file's
|
|
5
|
+
// first statement, which would take the JSDoc below with it.
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* One error shape for every agent surface: the CLI's stderr line, its `--json` error and an MCP tool error all carry
|
|
9
|
+
* the same fields, so an agent learns one repair loop. The line mirrors Ouro HX's dev message format:
|
|
10
|
+
* `<tool>: <thing>: <what's wrong>. Fix: <exact code>.`
|
|
11
|
+
*
|
|
12
|
+
* @claim "tool error all carry" registry/ouro/ax/problem.test.mts verify:testExists(registry/ouro/ax/problem.test.mts::AxError carries the shape, its exit and the same message; errorJson adds the message)
|
|
13
|
+
*/
|
|
14
|
+
interface AxErrorShape {
|
|
15
|
+
/** A stable slug an agent can branch on, such as "unknown-flag", "missing-arg" or "needs-why". */
|
|
16
|
+
code: string;
|
|
17
|
+
/** The process exit code. */
|
|
18
|
+
exit: number;
|
|
19
|
+
/** What the error is about: a command ("send"), a flag ("send --why") or a tool. */
|
|
20
|
+
thing: string;
|
|
21
|
+
/** What's wrong, in the agent's words. */
|
|
22
|
+
problem: string;
|
|
23
|
+
/** The exact code to run instead, or null when nothing the agent runs can fix it. */
|
|
24
|
+
fix: string | null;
|
|
25
|
+
/** Why the problem text is precise though it is short or holds a vague phrase; the vague-failure check and the X-ray pass it with this reason. */
|
|
26
|
+
preciseFailure?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** The error the kit's primitives throw: its message is the one line, its shape the data. */
|
|
30
|
+
class AxError extends Error {
|
|
31
|
+
readonly shape: AxErrorShape;
|
|
32
|
+
constructor(shape: AxErrorShape) {
|
|
33
|
+
super(errorMessage(shape));
|
|
34
|
+
this.name = "AxError";
|
|
35
|
+
this.shape = shape;
|
|
36
|
+
}
|
|
37
|
+
get exit(): number {
|
|
38
|
+
return this.shape.exit;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function isAxError(value: unknown): value is AxError {
|
|
43
|
+
return value instanceof AxError;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const sentence = (text: string) => text.trim().replace(/[.\s]+$/, "");
|
|
47
|
+
|
|
48
|
+
/** `<thing>: <problem>. Fix: <fix>.`, without the tool's prefix (a CLI adds its own). */
|
|
49
|
+
function errorMessage(shape: Pick<AxErrorShape, "thing" | "problem" | "fix">): string {
|
|
50
|
+
const head = `${shape.thing}: ${sentence(shape.problem)}.`;
|
|
51
|
+
return shape.fix === null ? head : `${head} Fix: ${sentence(shape.fix)}.`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The one stderr line: `<tool>: <thing>: <problem>. Fix: <fix>.` Line breaks in any part become spaces. A thing that is
|
|
56
|
+
* the tool itself (a one-command CLI names its only command after the tool) is not said twice.
|
|
57
|
+
*/
|
|
58
|
+
function errorLine(tool: string, shape: Pick<AxErrorShape, "thing" | "problem" | "fix">): string {
|
|
59
|
+
const message = shape.thing === tool ? errorMessage({ ...shape, thing: "" }).replace(/^: /, "") : errorMessage(shape);
|
|
60
|
+
return `${tool}: ${message}`.replace(/\s*[\r\n]+\s*/g, " ");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The error as data: its shape plus the one-line message. Outcomes, `--json` and MCP all carry this.
|
|
65
|
+
*
|
|
66
|
+
* @claim "and MCP all carry this" registry/ouro/ax/outcome.test.mts verify:testExists(registry/ouro/ax/outcome.test.mts::outcome fills honest defaults: private, only you, nothing checked, no receipt; an error gets its message)
|
|
67
|
+
*/
|
|
68
|
+
type AxErrorBody = AxErrorShape & { message: string };
|
|
69
|
+
|
|
70
|
+
/** The `--json` and MCP form: `{ error: { code, exit, thing, problem, fix, message } }`. */
|
|
71
|
+
function errorJson(shape: AxErrorShape): { error: AxErrorBody } {
|
|
72
|
+
return { error: { ...shape, message: errorMessage(shape) } };
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Edits between two words, a swap of two letters side by side counting as one: "romos" is one edit from "rooms".
|
|
76
|
+
function distance(a: string, b: string): number {
|
|
77
|
+
const rows = Array.from({ length: a.length + 1 }, (_, i) => Array.from({ length: b.length + 1 }, (_, j) => (i === 0 ? j : j === 0 ? i : 0)));
|
|
78
|
+
for (let i = 1; i <= a.length; i++) {
|
|
79
|
+
for (let j = 1; j <= b.length; j++) {
|
|
80
|
+
const row = rows[i]!;
|
|
81
|
+
row[j] = Math.min(rows[i - 1]![j]! + 1, row[j - 1]! + 1, rows[i - 1]![j - 1]! + (a[i - 1] === b[j - 1] ? 0 : 1));
|
|
82
|
+
if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) row[j] = Math.min(row[j]!, rows[i - 2]![j - 2]! + 1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return rows[a.length]![b.length]!;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The candidate an agent most likely meant: the nearest within an edit for every three letters of the word (at least one,
|
|
90
|
+
* at most two), else a unique prefix; null when neither applies.
|
|
91
|
+
*
|
|
92
|
+
* @claim "the nearest within an edit for every three letters of the word" registry/ouro/ax/problem.test.mts verify:testExists(registry/ouro/ax/problem.test.mts::didYouMean: the nearest within a couple of edits, else a unique prefix, else null) verify:testExists(registry/ouro/ax/problem.test.mts::didYouMean: a short word suggests only a name an edit away, not one that changes half its letters)
|
|
93
|
+
*/
|
|
94
|
+
function didYouMean(word: string, candidates: readonly string[]): string | null {
|
|
95
|
+
if (word === "") return null;
|
|
96
|
+
let best: string | null = null;
|
|
97
|
+
// Scaled to the word: two edits in a four-letter word change half of it, which is a different word, not a typo (#1670).
|
|
98
|
+
let bestDistance = Math.min(2, Math.max(1, Math.floor(word.length / 3))) + 1;
|
|
99
|
+
for (const c of candidates) {
|
|
100
|
+
const d = distance(word, c);
|
|
101
|
+
if (d < bestDistance) {
|
|
102
|
+
best = c;
|
|
103
|
+
bestDistance = d;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (best) return best;
|
|
107
|
+
const prefixed = candidates.filter((c) => c.startsWith(word) || word.startsWith(c));
|
|
108
|
+
return prefixed.length === 1 ? prefixed[0]! : null;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Quotes a word for a POSIX shell only when it needs it, so a fix copies and runs as printed. */
|
|
112
|
+
function shellWord(word: string): string {
|
|
113
|
+
if (/^<[^>\s]+>$/.test(word) || /^[A-Za-z0-9_./:@#,=+-]+$/.test(word)) return word;
|
|
114
|
+
return `"${word.replace(/(["\\$`])/g, "\\$1")}"`;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* A command line from words, each quoted only when it needs it.
|
|
119
|
+
*
|
|
120
|
+
* @claim "each quoted only when" registry/ouro/ax/problem.test.mts verify:testExists(registry/ouro/ax/problem.test.mts::commandLine quotes only what a shell would split or expand)
|
|
121
|
+
*/
|
|
122
|
+
function commandLine(words: readonly string[]): string {
|
|
123
|
+
return words.map(shellWord).join(" ");
|
|
124
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { devCommandIn } from "#ouro-ax/dev-commands.ts";
|
|
2
|
+
export { FINDINGS_EXIT_CODE } from "#ouro-ax/exit-codes.ts";
|
|
3
|
+
export { errorMessage } from "#ouro-ax/problem.ts";
|
|
4
|
+
|
|
5
|
+
// The shared Ouro AX files surfaces.ts runs on, by the package's imports entry (#ouro-ax/*). They are named here, in an .mts
|
|
6
|
+
// file, because the shadcn CLI rewrites a # import in a .ts, .tsx, .js or .jsx file it installs to the app's own path
|
|
7
|
+
// alias (~/lib/ouro/ax/cli), which Node cannot resolve; it leaves an .mts file as it is. The export list comes first
|
|
8
|
+
// because the CLI drops comments before a file's first statement.
|