@isaacriehm/cairn 0.1.0
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/LICENSE +21 -0
- package/README.md +37 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/backprop/id.d.ts +14 -0
- package/dist/backprop/id.js +40 -0
- package/dist/backprop/id.js.map +1 -0
- package/dist/backprop/index.d.ts +23 -0
- package/dist/backprop/index.js +21 -0
- package/dist/backprop/index.js.map +1 -0
- package/dist/backprop/prompt.d.ts +16 -0
- package/dist/backprop/prompt.js +101 -0
- package/dist/backprop/prompt.js.map +1 -0
- package/dist/backprop/runner.d.ts +18 -0
- package/dist/backprop/runner.js +95 -0
- package/dist/backprop/runner.js.map +1 -0
- package/dist/backprop/schema.d.ts +61 -0
- package/dist/backprop/schema.js +55 -0
- package/dist/backprop/schema.js.map +1 -0
- package/dist/backprop/types.d.ts +101 -0
- package/dist/backprop/types.js +24 -0
- package/dist/backprop/types.js.map +1 -0
- package/dist/backprop/writer.d.ts +27 -0
- package/dist/backprop/writer.js +301 -0
- package/dist/backprop/writer.js.map +1 -0
- package/dist/claude/error.d.ts +33 -0
- package/dist/claude/error.js +58 -0
- package/dist/claude/error.js.map +1 -0
- package/dist/claude/index.d.ts +3 -0
- package/dist/claude/index.js +3 -0
- package/dist/claude/index.js.map +1 -0
- package/dist/claude/runner.d.ts +11 -0
- package/dist/claude/runner.js +132 -0
- package/dist/claude/runner.js.map +1 -0
- package/dist/claude/types.d.ts +52 -0
- package/dist/claude/types.js +14 -0
- package/dist/claude/types.js.map +1 -0
- package/dist/cli/attention.d.ts +11 -0
- package/dist/cli/attention.js +234 -0
- package/dist/cli/attention.js.map +1 -0
- package/dist/cli/daemon.d.ts +54 -0
- package/dist/cli/daemon.js +351 -0
- package/dist/cli/daemon.js.map +1 -0
- package/dist/cli/doctor.d.ts +8 -0
- package/dist/cli/doctor.js +116 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/gc.d.ts +15 -0
- package/dist/cli/gc.js +139 -0
- package/dist/cli/gc.js.map +1 -0
- package/dist/cli/hook.d.ts +18 -0
- package/dist/cli/hook.js +57 -0
- package/dist/cli/hook.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +127 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +1 -0
- package/dist/cli/init.js +77 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/install.d.ts +52 -0
- package/dist/cli/install.js +308 -0
- package/dist/cli/install.js.map +1 -0
- package/dist/cli/join.d.ts +1 -0
- package/dist/cli/join.js +84 -0
- package/dist/cli/join.js.map +1 -0
- package/dist/cli/mcp.d.ts +1 -0
- package/dist/cli/mcp.js +62 -0
- package/dist/cli/mcp.js.map +1 -0
- package/dist/cli/mirror.d.ts +1 -0
- package/dist/cli/mirror.js +97 -0
- package/dist/cli/mirror.js.map +1 -0
- package/dist/cli/run.d.ts +1 -0
- package/dist/cli/run.js +174 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/scope.d.ts +8 -0
- package/dist/cli/scope.js +65 -0
- package/dist/cli/scope.js.map +1 -0
- package/dist/cli/task.d.ts +18 -0
- package/dist/cli/task.js +137 -0
- package/dist/cli/task.js.map +1 -0
- package/dist/cli/watch.d.ts +1 -0
- package/dist/cli/watch.js +73 -0
- package/dist/cli/watch.js.map +1 -0
- package/dist/decision-capture/capture.d.ts +57 -0
- package/dist/decision-capture/capture.js +186 -0
- package/dist/decision-capture/capture.js.map +1 -0
- package/dist/decision-capture/extractor.d.ts +20 -0
- package/dist/decision-capture/extractor.js +103 -0
- package/dist/decision-capture/extractor.js.map +1 -0
- package/dist/decision-capture/id.d.ts +14 -0
- package/dist/decision-capture/id.js +44 -0
- package/dist/decision-capture/id.js.map +1 -0
- package/dist/decision-capture/index.d.ts +25 -0
- package/dist/decision-capture/index.js +21 -0
- package/dist/decision-capture/index.js.map +1 -0
- package/dist/decision-capture/prompt.d.ts +15 -0
- package/dist/decision-capture/prompt.js +68 -0
- package/dist/decision-capture/prompt.js.map +1 -0
- package/dist/decision-capture/refinement-prompt.d.ts +25 -0
- package/dist/decision-capture/refinement-prompt.js +146 -0
- package/dist/decision-capture/refinement-prompt.js.map +1 -0
- package/dist/decision-capture/refinement-schema.d.ts +52 -0
- package/dist/decision-capture/refinement-schema.js +61 -0
- package/dist/decision-capture/refinement-schema.js.map +1 -0
- package/dist/decision-capture/refinement.d.ts +60 -0
- package/dist/decision-capture/refinement.js +439 -0
- package/dist/decision-capture/refinement.js.map +1 -0
- package/dist/decision-capture/schema.d.ts +70 -0
- package/dist/decision-capture/schema.js +71 -0
- package/dist/decision-capture/schema.js.map +1 -0
- package/dist/decision-capture/types.d.ts +201 -0
- package/dist/decision-capture/types.js +20 -0
- package/dist/decision-capture/types.js.map +1 -0
- package/dist/decision-capture/writer.d.ts +90 -0
- package/dist/decision-capture/writer.js +267 -0
- package/dist/decision-capture/writer.js.map +1 -0
- package/dist/frontend/discord/acl.d.ts +6 -0
- package/dist/frontend/discord/acl.js +19 -0
- package/dist/frontend/discord/acl.js.map +1 -0
- package/dist/frontend/discord/channels.d.ts +29 -0
- package/dist/frontend/discord/channels.js +58 -0
- package/dist/frontend/discord/channels.js.map +1 -0
- package/dist/frontend/discord/classifier.d.ts +16 -0
- package/dist/frontend/discord/classifier.js +29 -0
- package/dist/frontend/discord/classifier.js.map +1 -0
- package/dist/frontend/discord/index.d.ts +118 -0
- package/dist/frontend/discord/index.js +1104 -0
- package/dist/frontend/discord/index.js.map +1 -0
- package/dist/frontend/discord/slash.d.ts +18 -0
- package/dist/frontend/discord/slash.js +90 -0
- package/dist/frontend/discord/slash.js.map +1 -0
- package/dist/frontend/inbox.d.ts +17 -0
- package/dist/frontend/inbox.js +30 -0
- package/dist/frontend/inbox.js.map +1 -0
- package/dist/frontend/index.d.ts +8 -0
- package/dist/frontend/index.js +6 -0
- package/dist/frontend/index.js.map +1 -0
- package/dist/frontend/stub/index.d.ts +58 -0
- package/dist/frontend/stub/index.js +144 -0
- package/dist/frontend/stub/index.js.map +1 -0
- package/dist/frontend/types.d.ts +247 -0
- package/dist/frontend/types.js +15 -0
- package/dist/frontend/types.js.map +1 -0
- package/dist/gc/apply.d.ts +26 -0
- package/dist/gc/apply.js +48 -0
- package/dist/gc/apply.js.map +1 -0
- package/dist/gc/canary.d.ts +42 -0
- package/dist/gc/canary.js +134 -0
- package/dist/gc/canary.js.map +1 -0
- package/dist/gc/classify.d.ts +25 -0
- package/dist/gc/classify.js +89 -0
- package/dist/gc/classify.js.map +1 -0
- package/dist/gc/doc-gardening.d.ts +29 -0
- package/dist/gc/doc-gardening.js +146 -0
- package/dist/gc/doc-gardening.js.map +1 -0
- package/dist/gc/frontmatter.d.ts +35 -0
- package/dist/gc/frontmatter.js +111 -0
- package/dist/gc/frontmatter.js.map +1 -0
- package/dist/gc/generator-drift.d.ts +28 -0
- package/dist/gc/generator-drift.js +53 -0
- package/dist/gc/generator-drift.js.map +1 -0
- package/dist/gc/index.d.ts +35 -0
- package/dist/gc/index.js +26 -0
- package/dist/gc/index.js.map +1 -0
- package/dist/gc/quality-update.d.ts +23 -0
- package/dist/gc/quality-update.js +69 -0
- package/dist/gc/quality-update.js.map +1 -0
- package/dist/gc/stub-hits.d.ts +31 -0
- package/dist/gc/stub-hits.js +125 -0
- package/dist/gc/stub-hits.js.map +1 -0
- package/dist/gc/sweep.d.ts +56 -0
- package/dist/gc/sweep.js +178 -0
- package/dist/gc/sweep.js.map +1 -0
- package/dist/gc/types.d.ts +129 -0
- package/dist/gc/types.js +26 -0
- package/dist/gc/types.js.map +1 -0
- package/dist/ground/drift.d.ts +8 -0
- package/dist/ground/drift.js +23 -0
- package/dist/ground/drift.js.map +1 -0
- package/dist/ground/frontmatter.d.ts +20 -0
- package/dist/ground/frontmatter.js +49 -0
- package/dist/ground/frontmatter.js.map +1 -0
- package/dist/ground/glob.d.ts +10 -0
- package/dist/ground/glob.js +46 -0
- package/dist/ground/glob.js.map +1 -0
- package/dist/ground/index.d.ts +14 -0
- package/dist/ground/index.js +10 -0
- package/dist/ground/index.js.map +1 -0
- package/dist/ground/ledgers.d.ts +18 -0
- package/dist/ground/ledgers.js +103 -0
- package/dist/ground/ledgers.js.map +1 -0
- package/dist/ground/manifest.d.ts +10 -0
- package/dist/ground/manifest.js +88 -0
- package/dist/ground/manifest.js.map +1 -0
- package/dist/ground/paths.d.ts +20 -0
- package/dist/ground/paths.js +61 -0
- package/dist/ground/paths.js.map +1 -0
- package/dist/ground/quality-grades.d.ts +11 -0
- package/dist/ground/quality-grades.js +98 -0
- package/dist/ground/quality-grades.js.map +1 -0
- package/dist/ground/schemas.d.ts +306 -0
- package/dist/ground/schemas.js +188 -0
- package/dist/ground/schemas.js.map +1 -0
- package/dist/ground/walk.d.ts +7 -0
- package/dist/ground/walk.js +53 -0
- package/dist/ground/walk.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/init/detect.d.ts +25 -0
- package/dist/init/detect.js +336 -0
- package/dist/init/detect.js.map +1 -0
- package/dist/init/index.d.ts +14 -0
- package/dist/init/index.js +9 -0
- package/dist/init/index.js.map +1 -0
- package/dist/init/init.d.ts +68 -0
- package/dist/init/init.js +673 -0
- package/dist/init/init.js.map +1 -0
- package/dist/init/mapper.d.ts +160 -0
- package/dist/init/mapper.js +248 -0
- package/dist/init/mapper.js.map +1 -0
- package/dist/init/prompts.d.ts +70 -0
- package/dist/init/prompts.js +80 -0
- package/dist/init/prompts.js.map +1 -0
- package/dist/init/secrets.d.ts +18 -0
- package/dist/init/secrets.js +76 -0
- package/dist/init/secrets.js.map +1 -0
- package/dist/init/seed.d.ts +21 -0
- package/dist/init/seed.js +75 -0
- package/dist/init/seed.js.map +1 -0
- package/dist/init/setup-runners.d.ts +17 -0
- package/dist/init/setup-runners.js +70 -0
- package/dist/init/setup-runners.js.map +1 -0
- package/dist/init/types.d.ts +59 -0
- package/dist/init/types.js +10 -0
- package/dist/init/types.js.map +1 -0
- package/dist/init/walker.d.ts +53 -0
- package/dist/init/walker.js +460 -0
- package/dist/init/walker.js.map +1 -0
- package/dist/init/workflow-block.d.ts +34 -0
- package/dist/init/workflow-block.js +110 -0
- package/dist/init/workflow-block.js.map +1 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.js +23 -0
- package/dist/logger.js.map +1 -0
- package/dist/mcp/context.d.ts +16 -0
- package/dist/mcp/context.js +8 -0
- package/dist/mcp/context.js.map +1 -0
- package/dist/mcp/errors.d.ts +17 -0
- package/dist/mcp/errors.js +23 -0
- package/dist/mcp/errors.js.map +1 -0
- package/dist/mcp/index.d.ts +10 -0
- package/dist/mcp/index.js +7 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/path-allowlist.d.ts +25 -0
- package/dist/mcp/path-allowlist.js +66 -0
- package/dist/mcp/path-allowlist.js.map +1 -0
- package/dist/mcp/result.d.ts +8 -0
- package/dist/mcp/result.js +18 -0
- package/dist/mcp/result.js.map +1 -0
- package/dist/mcp/schemas.d.ts +153 -0
- package/dist/mcp/schemas.js +135 -0
- package/dist/mcp/schemas.js.map +1 -0
- package/dist/mcp/server.d.ts +11 -0
- package/dist/mcp/server.js +58 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/telemetry.d.ts +15 -0
- package/dist/mcp/telemetry.js +13 -0
- package/dist/mcp/telemetry.js.map +1 -0
- package/dist/mcp/tools/append.d.ts +8 -0
- package/dist/mcp/tools/append.js +33 -0
- package/dist/mcp/tools/append.js.map +1 -0
- package/dist/mcp/tools/archive.d.ts +8 -0
- package/dist/mcp/tools/archive.js +49 -0
- package/dist/mcp/tools/archive.js.map +1 -0
- package/dist/mcp/tools/ask-operator.d.ts +34 -0
- package/dist/mcp/tools/ask-operator.js +93 -0
- package/dist/mcp/tools/ask-operator.js.map +1 -0
- package/dist/mcp/tools/canonical-for-topic.d.ts +6 -0
- package/dist/mcp/tools/canonical-for-topic.js +40 -0
- package/dist/mcp/tools/canonical-for-topic.js.map +1 -0
- package/dist/mcp/tools/decision-get.d.ts +6 -0
- package/dist/mcp/tools/decision-get.js +49 -0
- package/dist/mcp/tools/decision-get.js.map +1 -0
- package/dist/mcp/tools/decisions-for-symbol.d.ts +7 -0
- package/dist/mcp/tools/decisions-for-symbol.js +42 -0
- package/dist/mcp/tools/decisions-for-symbol.js.map +1 -0
- package/dist/mcp/tools/decisions-in-scope.d.ts +7 -0
- package/dist/mcp/tools/decisions-in-scope.js +47 -0
- package/dist/mcp/tools/decisions-in-scope.js.map +1 -0
- package/dist/mcp/tools/drop-task.d.ts +12 -0
- package/dist/mcp/tools/drop-task.js +47 -0
- package/dist/mcp/tools/drop-task.js.map +1 -0
- package/dist/mcp/tools/get-full.d.ts +7 -0
- package/dist/mcp/tools/get-full.js +46 -0
- package/dist/mcp/tools/get-full.js.map +1 -0
- package/dist/mcp/tools/ground-get.d.ts +7 -0
- package/dist/mcp/tools/ground-get.js +80 -0
- package/dist/mcp/tools/ground-get.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +3 -0
- package/dist/mcp/tools/index.js +44 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/invariant-get.d.ts +6 -0
- package/dist/mcp/tools/invariant-get.js +49 -0
- package/dist/mcp/tools/invariant-get.js.map +1 -0
- package/dist/mcp/tools/invariants-in-scope.d.ts +7 -0
- package/dist/mcp/tools/invariants-in-scope.js +65 -0
- package/dist/mcp/tools/invariants-in-scope.js.map +1 -0
- package/dist/mcp/tools/query-history.d.ts +9 -0
- package/dist/mcp/tools/query-history.js +33 -0
- package/dist/mcp/tools/query-history.js.map +1 -0
- package/dist/mcp/tools/record-decision.d.ts +14 -0
- package/dist/mcp/tools/record-decision.js +101 -0
- package/dist/mcp/tools/record-decision.js.map +1 -0
- package/dist/mcp/tools/record-run-event.d.ts +10 -0
- package/dist/mcp/tools/record-run-event.js +28 -0
- package/dist/mcp/tools/record-run-event.js.map +1 -0
- package/dist/mcp/tools/search.d.ts +9 -0
- package/dist/mcp/tools/search.js +165 -0
- package/dist/mcp/tools/search.js.map +1 -0
- package/dist/mcp/tools/supersedes-chain.d.ts +6 -0
- package/dist/mcp/tools/supersedes-chain.js +66 -0
- package/dist/mcp/tools/supersedes-chain.js.map +1 -0
- package/dist/mcp/tools/timeline.d.ts +9 -0
- package/dist/mcp/tools/timeline.js +65 -0
- package/dist/mcp/tools/timeline.js.map +1 -0
- package/dist/mcp/tools/types.d.ts +9 -0
- package/dist/mcp/tools/types.js +2 -0
- package/dist/mcp/tools/types.js.map +1 -0
- package/dist/mirror/clone.d.ts +6 -0
- package/dist/mirror/clone.js +48 -0
- package/dist/mirror/clone.js.map +1 -0
- package/dist/mirror/dirty-overlap.d.ts +13 -0
- package/dist/mirror/dirty-overlap.js +77 -0
- package/dist/mirror/dirty-overlap.js.map +1 -0
- package/dist/mirror/index.d.ts +7 -0
- package/dist/mirror/index.js +7 -0
- package/dist/mirror/index.js.map +1 -0
- package/dist/mirror/paths.d.ts +18 -0
- package/dist/mirror/paths.js +45 -0
- package/dist/mirror/paths.js.map +1 -0
- package/dist/mirror/push.d.ts +9 -0
- package/dist/mirror/push.js +27 -0
- package/dist/mirror/push.js.map +1 -0
- package/dist/mirror/state.d.ts +4 -0
- package/dist/mirror/state.js +36 -0
- package/dist/mirror/state.js.map +1 -0
- package/dist/mirror/sync.d.ts +9 -0
- package/dist/mirror/sync.js +33 -0
- package/dist/mirror/sync.js.map +1 -0
- package/dist/mirror/types.d.ts +77 -0
- package/dist/mirror/types.js +2 -0
- package/dist/mirror/types.js.map +1 -0
- package/dist/orchestrator/activity-summarizer.d.ts +33 -0
- package/dist/orchestrator/activity-summarizer.js +120 -0
- package/dist/orchestrator/activity-summarizer.js.map +1 -0
- package/dist/orchestrator/inbox.d.ts +78 -0
- package/dist/orchestrator/inbox.js +115 -0
- package/dist/orchestrator/inbox.js.map +1 -0
- package/dist/orchestrator/index.d.ts +9 -0
- package/dist/orchestrator/index.js +7 -0
- package/dist/orchestrator/index.js.map +1 -0
- package/dist/orchestrator/orchestrator.d.ts +154 -0
- package/dist/orchestrator/orchestrator.js +2437 -0
- package/dist/orchestrator/orchestrator.js.map +1 -0
- package/dist/orchestrator/prompt.d.ts +19 -0
- package/dist/orchestrator/prompt.js +50 -0
- package/dist/orchestrator/prompt.js.map +1 -0
- package/dist/orchestrator/queue.d.ts +21 -0
- package/dist/orchestrator/queue.js +80 -0
- package/dist/orchestrator/queue.js.map +1 -0
- package/dist/orchestrator/run-log.d.ts +53 -0
- package/dist/orchestrator/run-log.js +92 -0
- package/dist/orchestrator/run-log.js.map +1 -0
- package/dist/orchestrator/runner.d.ts +56 -0
- package/dist/orchestrator/runner.js +172 -0
- package/dist/orchestrator/runner.js.map +1 -0
- package/dist/orchestrator/tool-digest.d.ts +35 -0
- package/dist/orchestrator/tool-digest.js +116 -0
- package/dist/orchestrator/tool-digest.js.map +1 -0
- package/dist/orchestrator/types.d.ts +263 -0
- package/dist/orchestrator/types.js +2 -0
- package/dist/orchestrator/types.js.map +1 -0
- package/dist/orchestrator/workspace.d.ts +21 -0
- package/dist/orchestrator/workspace.js +31 -0
- package/dist/orchestrator/workspace.js.map +1 -0
- package/dist/profiles/index.d.ts +3 -0
- package/dist/profiles/index.js +3 -0
- package/dist/profiles/index.js.map +1 -0
- package/dist/profiles/registry.d.ts +5 -0
- package/dist/profiles/registry.js +31 -0
- package/dist/profiles/registry.js.map +1 -0
- package/dist/profiles/types.d.ts +48 -0
- package/dist/profiles/types.js +11 -0
- package/dist/profiles/types.js.map +1 -0
- package/dist/profiles/unknown.d.ts +9 -0
- package/dist/profiles/unknown.js +17 -0
- package/dist/profiles/unknown.js.map +1 -0
- package/dist/reviewer/index.d.ts +6 -0
- package/dist/reviewer/index.js +5 -0
- package/dist/reviewer/index.js.map +1 -0
- package/dist/reviewer/prompt.d.ts +11 -0
- package/dist/reviewer/prompt.js +132 -0
- package/dist/reviewer/prompt.js.map +1 -0
- package/dist/reviewer/remediation.d.ts +15 -0
- package/dist/reviewer/remediation.js +61 -0
- package/dist/reviewer/remediation.js.map +1 -0
- package/dist/reviewer/reviewer.d.ts +9 -0
- package/dist/reviewer/reviewer.js +89 -0
- package/dist/reviewer/reviewer.js.map +1 -0
- package/dist/reviewer/schema.d.ts +45 -0
- package/dist/reviewer/schema.js +43 -0
- package/dist/reviewer/schema.js.map +1 -0
- package/dist/reviewer/types.d.ts +74 -0
- package/dist/reviewer/types.js +14 -0
- package/dist/reviewer/types.js.map +1 -0
- package/dist/sensors/attestation.d.ts +44 -0
- package/dist/sensors/attestation.js +262 -0
- package/dist/sensors/attestation.js.map +1 -0
- package/dist/sensors/catalog.d.ts +41 -0
- package/dist/sensors/catalog.js +123 -0
- package/dist/sensors/catalog.js.map +1 -0
- package/dist/sensors/decisions.d.ts +30 -0
- package/dist/sensors/decisions.js +393 -0
- package/dist/sensors/decisions.js.map +1 -0
- package/dist/sensors/diff.d.ts +27 -0
- package/dist/sensors/diff.js +148 -0
- package/dist/sensors/diff.js.map +1 -0
- package/dist/sensors/index.d.ts +13 -0
- package/dist/sensors/index.js +9 -0
- package/dist/sensors/index.js.map +1 -0
- package/dist/sensors/remediation.d.ts +20 -0
- package/dist/sensors/remediation.js +65 -0
- package/dist/sensors/remediation.js.map +1 -0
- package/dist/sensors/runner.d.ts +44 -0
- package/dist/sensors/runner.js +95 -0
- package/dist/sensors/runner.js.map +1 -0
- package/dist/sensors/structural.d.ts +30 -0
- package/dist/sensors/structural.js +204 -0
- package/dist/sensors/structural.js.map +1 -0
- package/dist/sensors/stub-catalog.d.ts +39 -0
- package/dist/sensors/stub-catalog.js +115 -0
- package/dist/sensors/stub-catalog.js.map +1 -0
- package/dist/sensors/types.d.ts +135 -0
- package/dist/sensors/types.js +14 -0
- package/dist/sensors/types.js.map +1 -0
- package/dist/tier0/classify.d.ts +5 -0
- package/dist/tier0/classify.js +91 -0
- package/dist/tier0/classify.js.map +1 -0
- package/dist/tier0/index.d.ts +3 -0
- package/dist/tier0/index.js +3 -0
- package/dist/tier0/index.js.map +1 -0
- package/dist/tier0/ollama.d.ts +22 -0
- package/dist/tier0/ollama.js +63 -0
- package/dist/tier0/ollama.js.map +1 -0
- package/dist/tier0/types.d.ts +24 -0
- package/dist/tier0/types.js +7 -0
- package/dist/tier0/types.js.map +1 -0
- package/dist/tightener/index.d.ts +4 -0
- package/dist/tightener/index.js +4 -0
- package/dist/tightener/index.js.map +1 -0
- package/dist/tightener/prompt.d.ts +3 -0
- package/dist/tightener/prompt.js +67 -0
- package/dist/tightener/prompt.js.map +1 -0
- package/dist/tightener/schema.d.ts +68 -0
- package/dist/tightener/schema.js +44 -0
- package/dist/tightener/schema.js.map +1 -0
- package/dist/tightener/tighten.d.ts +2 -0
- package/dist/tightener/tighten.js +66 -0
- package/dist/tightener/tighten.js.map +1 -0
- package/dist/tightener/types.d.ts +74 -0
- package/dist/tightener/types.js +6 -0
- package/dist/tightener/types.js.map +1 -0
- package/dist/uat/bundle.d.ts +68 -0
- package/dist/uat/bundle.js +168 -0
- package/dist/uat/bundle.js.map +1 -0
- package/dist/uat/index.d.ts +15 -0
- package/dist/uat/index.js +10 -0
- package/dist/uat/index.js.map +1 -0
- package/dist/uat/persistent.d.ts +64 -0
- package/dist/uat/persistent.js +206 -0
- package/dist/uat/persistent.js.map +1 -0
- package/dist/uat/probes/cli.d.ts +11 -0
- package/dist/uat/probes/cli.js +107 -0
- package/dist/uat/probes/cli.js.map +1 -0
- package/dist/uat/probes/http.d.ts +12 -0
- package/dist/uat/probes/http.js +139 -0
- package/dist/uat/probes/http.js.map +1 -0
- package/dist/uat/probes/index.d.ts +21 -0
- package/dist/uat/probes/index.js +30 -0
- package/dist/uat/probes/index.js.map +1 -0
- package/dist/uat/probes/integration.d.ts +18 -0
- package/dist/uat/probes/integration.js +188 -0
- package/dist/uat/probes/integration.js.map +1 -0
- package/dist/uat/probes/sql/config.d.ts +14 -0
- package/dist/uat/probes/sql/config.js +57 -0
- package/dist/uat/probes/sql/config.js.map +1 -0
- package/dist/uat/probes/sql/index.d.ts +29 -0
- package/dist/uat/probes/sql/index.js +43 -0
- package/dist/uat/probes/sql/index.js.map +1 -0
- package/dist/uat/probes/sql/mysql.d.ts +12 -0
- package/dist/uat/probes/sql/mysql.js +96 -0
- package/dist/uat/probes/sql/mysql.js.map +1 -0
- package/dist/uat/probes/sql/pg.d.ts +20 -0
- package/dist/uat/probes/sql/pg.js +102 -0
- package/dist/uat/probes/sql/pg.js.map +1 -0
- package/dist/uat/probes/sql/sqlite.d.ts +9 -0
- package/dist/uat/probes/sql/sqlite.js +58 -0
- package/dist/uat/probes/sql/sqlite.js.map +1 -0
- package/dist/uat/probes/sql/types.d.ts +46 -0
- package/dist/uat/probes/sql/types.js +10 -0
- package/dist/uat/probes/sql/types.js.map +1 -0
- package/dist/uat/probes/sql.d.ts +9 -0
- package/dist/uat/probes/sql.js +119 -0
- package/dist/uat/probes/sql.js.map +1 -0
- package/dist/uat/probes/ui.d.ts +19 -0
- package/dist/uat/probes/ui.js +244 -0
- package/dist/uat/probes/ui.js.map +1 -0
- package/dist/uat/prompt.d.ts +10 -0
- package/dist/uat/prompt.js +85 -0
- package/dist/uat/prompt.js.map +1 -0
- package/dist/uat/question.d.ts +50 -0
- package/dist/uat/question.js +139 -0
- package/dist/uat/question.js.map +1 -0
- package/dist/uat/rejection.d.ts +58 -0
- package/dist/uat/rejection.js +163 -0
- package/dist/uat/rejection.js.map +1 -0
- package/dist/uat/runner.d.ts +6 -0
- package/dist/uat/runner.js +96 -0
- package/dist/uat/runner.js.map +1 -0
- package/dist/uat/schema.d.ts +322 -0
- package/dist/uat/schema.js +189 -0
- package/dist/uat/schema.js.map +1 -0
- package/dist/uat/types.d.ts +268 -0
- package/dist/uat/types.js +18 -0
- package/dist/uat/types.js.map +1 -0
- package/dist/uat/uat.d.ts +89 -0
- package/dist/uat/uat.js +256 -0
- package/dist/uat/uat.js.map +1 -0
- package/dist/voice/index.d.ts +4 -0
- package/dist/voice/index.js +4 -0
- package/dist/voice/index.js.map +1 -0
- package/dist/voice/model.d.ts +23 -0
- package/dist/voice/model.js +46 -0
- package/dist/voice/model.js.map +1 -0
- package/dist/voice/pipe.d.ts +9 -0
- package/dist/voice/pipe.js +47 -0
- package/dist/voice/pipe.js.map +1 -0
- package/dist/voice/transcribe.d.ts +3 -0
- package/dist/voice/transcribe.js +43 -0
- package/dist/voice/transcribe.js.map +1 -0
- package/dist/voice/types.d.ts +26 -0
- package/dist/voice/types.js +9 -0
- package/dist/voice/types.js.map +1 -0
- package/dist/watch/daemon.d.ts +21 -0
- package/dist/watch/daemon.js +143 -0
- package/dist/watch/daemon.js.map +1 -0
- package/dist/watch/index.d.ts +4 -0
- package/dist/watch/index.js +3 -0
- package/dist/watch/index.js.map +1 -0
- package/dist/watch/regenerate.d.ts +25 -0
- package/dist/watch/regenerate.js +51 -0
- package/dist/watch/regenerate.js.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/mcp/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,MAAM,UAAU,aAAa,CAAC,IAA0C;IACtE,OAAO;QACL,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;QAChC,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC3D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error envelope per MCP_SURFACE §"Failure modes".
|
|
3
|
+
*
|
|
4
|
+
* Tools NEVER throw. They return either a success payload or an error envelope
|
|
5
|
+
* shaped as { error: { code, message, details? } }. The envelope is wrapped in
|
|
6
|
+
* the MCP `CallToolResult` content text.
|
|
7
|
+
*/
|
|
8
|
+
export type McpErrorCode = "VALIDATION_FAILED" | "TOOL_NOT_FOUND" | "PATH_OUTSIDE_REPO" | "PATH_HISTORICAL_USE_QUERY_HISTORY" | "PATH_NOT_ALLOWED" | "FILE_NOT_FOUND" | "DAEMON_UNAVAILABLE" | "OPERATION_TIMEOUT" | "DECISION_NOT_FOUND" | "DECISION_ID_TAKEN" | "INVALID_ASSERTION_KIND" | "SUPERSEDES_NOT_FOUND" | "INVARIANT_NOT_FOUND" | "TOPIC_NOT_REGISTERED" | "RUN_NOT_FOUND" | "TASK_NOT_FOUND" | "NOT_ALLOWED" | "NOT_IMPLEMENTED";
|
|
9
|
+
export interface McpErrorPayload {
|
|
10
|
+
error: {
|
|
11
|
+
code: McpErrorCode;
|
|
12
|
+
message: string;
|
|
13
|
+
details?: unknown;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare function mcpError(code: McpErrorCode, message: string, details?: unknown): McpErrorPayload;
|
|
17
|
+
export declare function isMcpError(payload: unknown): payload is McpErrorPayload;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error envelope per MCP_SURFACE §"Failure modes".
|
|
3
|
+
*
|
|
4
|
+
* Tools NEVER throw. They return either a success payload or an error envelope
|
|
5
|
+
* shaped as { error: { code, message, details? } }. The envelope is wrapped in
|
|
6
|
+
* the MCP `CallToolResult` content text.
|
|
7
|
+
*/
|
|
8
|
+
export function mcpError(code, message, details) {
|
|
9
|
+
return {
|
|
10
|
+
error: {
|
|
11
|
+
code,
|
|
12
|
+
message,
|
|
13
|
+
...(details !== undefined ? { details } : {}),
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function isMcpError(payload) {
|
|
18
|
+
return (typeof payload === "object" &&
|
|
19
|
+
payload !== null &&
|
|
20
|
+
"error" in payload &&
|
|
21
|
+
typeof payload.error === "object");
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/mcp/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA8BH,MAAM,UAAU,QAAQ,CACtB,IAAkB,EAClB,OAAe,EACf,OAAiB;IAEjB,OAAO;QACL,KAAK,EAAE;YACL,IAAI;YACJ,OAAO;YACP,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC9C;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,OAAO,IAAI,OAAO;QAClB,OAAQ,OAA8B,CAAC,KAAK,KAAK,QAAQ,CAC1D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { startMcpServer } from "./server.js";
|
|
2
|
+
export type { StartServerOptions } from "./server.js";
|
|
3
|
+
export { createContext } from "./context.js";
|
|
4
|
+
export type { McpContext } from "./context.js";
|
|
5
|
+
export { allTools } from "./tools/index.js";
|
|
6
|
+
export type { ToolDef } from "./tools/types.js";
|
|
7
|
+
export { mcpError, isMcpError } from "./errors.js";
|
|
8
|
+
export type { McpErrorCode, McpErrorPayload } from "./errors.js";
|
|
9
|
+
export { asMcpResult } from "./result.js";
|
|
10
|
+
export { APPEND_ALLOWLIST, ARCHIVE_DENY, HISTORICAL_ZONE, isAppendAllowed, isArchiveDenied, isHistorical, safeJoin, } from "./path-allowlist.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { startMcpServer } from "./server.js";
|
|
2
|
+
export { createContext } from "./context.js";
|
|
3
|
+
export { allTools } from "./tools/index.js";
|
|
4
|
+
export { mcpError, isMcpError } from "./errors.js";
|
|
5
|
+
export { asMcpResult } from "./result.js";
|
|
6
|
+
export { APPEND_ALLOWLIST, ARCHIVE_DENY, HISTORICAL_ZONE, isAppendAllowed, isArchiveDenied, isHistorical, safeJoin, } from "./path-allowlist.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,eAAe,EACf,YAAY,EACZ,QAAQ,GACT,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type McpErrorPayload } from "./errors.js";
|
|
2
|
+
/**
|
|
3
|
+
* Append-write allowlist. Server-side, NOT agent-controllable.
|
|
4
|
+
*
|
|
5
|
+
* Per MCP_SURFACE.md §"Write tools — append-only":
|
|
6
|
+
* - .harness/runs/active/<run-id>/events.jsonl
|
|
7
|
+
* - .harness/runs/active/<run-id>/commands.jsonl
|
|
8
|
+
* - .harness/staleness/log.jsonl
|
|
9
|
+
* - .harness/inbox/** (system-only; rarely used by agents)
|
|
10
|
+
*/
|
|
11
|
+
export declare const APPEND_ALLOWLIST: readonly string[];
|
|
12
|
+
/**
|
|
13
|
+
* Paths agents may NOT archive. AGENTS.md, CLAUDE.md, brand guidelines, and
|
|
14
|
+
* decisions/ are all sacred ground.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ARCHIVE_DENY: readonly string[];
|
|
17
|
+
/** Historical-zone globs — read tools refuse these; query_history is the ONE escape. */
|
|
18
|
+
export declare const HISTORICAL_ZONE: readonly string[];
|
|
19
|
+
/** Resolves a relative path against repoRoot and rejects escapes. */
|
|
20
|
+
export declare function safeJoin(repoRoot: string, rel: string): string | McpErrorPayload;
|
|
21
|
+
/** Returns repo-relative POSIX-style path for a path already inside repoRoot. */
|
|
22
|
+
export declare function relPosix(repoRoot: string, abs: string): string;
|
|
23
|
+
export declare function isAppendAllowed(repoRelPath: string): boolean;
|
|
24
|
+
export declare function isArchiveDenied(repoRelPath: string): boolean;
|
|
25
|
+
export declare function isHistorical(repoRelPath: string): boolean;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { isAbsolute, normalize, relative, resolve } from "node:path";
|
|
2
|
+
import { matchAnyGlob } from "../ground/glob.js";
|
|
3
|
+
import { mcpError } from "./errors.js";
|
|
4
|
+
/**
|
|
5
|
+
* Append-write allowlist. Server-side, NOT agent-controllable.
|
|
6
|
+
*
|
|
7
|
+
* Per MCP_SURFACE.md §"Write tools — append-only":
|
|
8
|
+
* - .harness/runs/active/<run-id>/events.jsonl
|
|
9
|
+
* - .harness/runs/active/<run-id>/commands.jsonl
|
|
10
|
+
* - .harness/staleness/log.jsonl
|
|
11
|
+
* - .harness/inbox/** (system-only; rarely used by agents)
|
|
12
|
+
*/
|
|
13
|
+
export const APPEND_ALLOWLIST = [
|
|
14
|
+
".harness/runs/active/*/events.jsonl",
|
|
15
|
+
".harness/runs/active/*/commands.jsonl",
|
|
16
|
+
".harness/staleness/log.jsonl",
|
|
17
|
+
".harness/inbox/**",
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* Paths agents may NOT archive. AGENTS.md, CLAUDE.md, brand guidelines, and
|
|
21
|
+
* decisions/ are all sacred ground.
|
|
22
|
+
*/
|
|
23
|
+
export const ARCHIVE_DENY = [
|
|
24
|
+
"AGENTS.md",
|
|
25
|
+
"CLAUDE.md",
|
|
26
|
+
".claude/**",
|
|
27
|
+
"docs/decisions/**",
|
|
28
|
+
".harness/ground/decisions/**",
|
|
29
|
+
".harness/ground/invariants/**",
|
|
30
|
+
".harness/config/**",
|
|
31
|
+
"docs/design/brand/**",
|
|
32
|
+
];
|
|
33
|
+
/** Historical-zone globs — read tools refuse these; query_history is the ONE escape. */
|
|
34
|
+
export const HISTORICAL_ZONE = [
|
|
35
|
+
".archive/**",
|
|
36
|
+
".harness/runs/terminal/**",
|
|
37
|
+
".harness/tasks/done/**",
|
|
38
|
+
".harness/tasks/archived/**",
|
|
39
|
+
".harness/ground/decisions/_inbox/**",
|
|
40
|
+
];
|
|
41
|
+
/** Resolves a relative path against repoRoot and rejects escapes. */
|
|
42
|
+
export function safeJoin(repoRoot, rel) {
|
|
43
|
+
if (isAbsolute(rel)) {
|
|
44
|
+
return mcpError("PATH_OUTSIDE_REPO", `Absolute paths not accepted: ${rel}`);
|
|
45
|
+
}
|
|
46
|
+
const abs = resolve(repoRoot, rel);
|
|
47
|
+
const back = relative(repoRoot, abs);
|
|
48
|
+
if (back.startsWith("..") || isAbsolute(back)) {
|
|
49
|
+
return mcpError("PATH_OUTSIDE_REPO", `Path resolves outside repo: ${rel}`);
|
|
50
|
+
}
|
|
51
|
+
return abs;
|
|
52
|
+
}
|
|
53
|
+
/** Returns repo-relative POSIX-style path for a path already inside repoRoot. */
|
|
54
|
+
export function relPosix(repoRoot, abs) {
|
|
55
|
+
return normalize(relative(repoRoot, abs)).replace(/\\/g, "/");
|
|
56
|
+
}
|
|
57
|
+
export function isAppendAllowed(repoRelPath) {
|
|
58
|
+
return matchAnyGlob(repoRelPath, APPEND_ALLOWLIST);
|
|
59
|
+
}
|
|
60
|
+
export function isArchiveDenied(repoRelPath) {
|
|
61
|
+
return matchAnyGlob(repoRelPath, ARCHIVE_DENY);
|
|
62
|
+
}
|
|
63
|
+
export function isHistorical(repoRelPath) {
|
|
64
|
+
return matchAnyGlob(repoRelPath, HISTORICAL_ZONE);
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=path-allowlist.js.map
|
|
@@ -0,0 +1 @@
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O,GAAG,CAAC;AACb,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,QAAQ,CAAC,QAAgB,EAAE,GAAW;IACpD,OAAO,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,WAAmB;IACjD,OAAO,YAAY,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,WAAmB;IACjD,OAAO,YAAY,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,WAAmB;IAC9C,OAAO,YAAY,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { McpErrorPayload } from "./errors.js";
|
|
3
|
+
/**
|
|
4
|
+
* Wraps a tool's payload (success object OR error envelope) as the MCP
|
|
5
|
+
* CallToolResult shape: { content: [{ type: "text", text: <json> }], isError? }.
|
|
6
|
+
*/
|
|
7
|
+
export declare function asMcpResult(payload: unknown): CallToolResult;
|
|
8
|
+
export type { McpErrorPayload };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isMcpError } from "./errors.js";
|
|
2
|
+
/**
|
|
3
|
+
* Wraps a tool's payload (success object OR error envelope) as the MCP
|
|
4
|
+
* CallToolResult shape: { content: [{ type: "text", text: <json> }], isError? }.
|
|
5
|
+
*/
|
|
6
|
+
export function asMcpResult(payload) {
|
|
7
|
+
const isError = isMcpError(payload);
|
|
8
|
+
return {
|
|
9
|
+
content: [
|
|
10
|
+
{
|
|
11
|
+
type: "text",
|
|
12
|
+
text: JSON.stringify(payload, null, 2),
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
isError,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../src/mcp/result.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;aACvC;SACF;QACD,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const decisionGetInput: {
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
};
|
|
5
|
+
export declare const decisionsInScopeInput: {
|
|
6
|
+
path_globs: z.ZodArray<z.ZodString>;
|
|
7
|
+
status: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
8
|
+
draft: "draft";
|
|
9
|
+
accepted: "accepted";
|
|
10
|
+
superseded: "superseded";
|
|
11
|
+
archived: "archived";
|
|
12
|
+
}>>>;
|
|
13
|
+
};
|
|
14
|
+
export declare const decisionsForSymbolInput: {
|
|
15
|
+
file: z.ZodString;
|
|
16
|
+
symbol: z.ZodString;
|
|
17
|
+
};
|
|
18
|
+
export declare const canonicalForTopicInput: {
|
|
19
|
+
topic: z.ZodString;
|
|
20
|
+
};
|
|
21
|
+
export declare const groundGetInput: {
|
|
22
|
+
category: z.ZodEnum<{
|
|
23
|
+
schema: "schema";
|
|
24
|
+
routes: "routes";
|
|
25
|
+
events: "events";
|
|
26
|
+
quality_grades: "quality_grades";
|
|
27
|
+
glossary: "glossary";
|
|
28
|
+
manifest: "manifest";
|
|
29
|
+
}>;
|
|
30
|
+
key: z.ZodOptional<z.ZodString>;
|
|
31
|
+
};
|
|
32
|
+
export declare const supersedesChainInput: {
|
|
33
|
+
decision_id: z.ZodString;
|
|
34
|
+
};
|
|
35
|
+
export declare const invariantGetInput: {
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
};
|
|
38
|
+
export declare const invariantsInScopeInput: {
|
|
39
|
+
path_globs: z.ZodArray<z.ZodString>;
|
|
40
|
+
status: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
41
|
+
superseded: "superseded";
|
|
42
|
+
active: "active";
|
|
43
|
+
}>>>;
|
|
44
|
+
};
|
|
45
|
+
export declare const searchInput: {
|
|
46
|
+
query: z.ZodString;
|
|
47
|
+
scope: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
48
|
+
kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
49
|
+
manifest: "manifest";
|
|
50
|
+
decision: "decision";
|
|
51
|
+
invariant: "invariant";
|
|
52
|
+
task: "task";
|
|
53
|
+
run: "run";
|
|
54
|
+
doc: "doc";
|
|
55
|
+
}>>>;
|
|
56
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
};
|
|
58
|
+
export declare const timelineInput: {
|
|
59
|
+
scope: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
60
|
+
since: z.ZodOptional<z.ZodString>;
|
|
61
|
+
until: z.ZodOptional<z.ZodString>;
|
|
62
|
+
kinds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
63
|
+
};
|
|
64
|
+
export declare const getFullInput: {
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
kind: z.ZodEnum<{
|
|
67
|
+
decision: "decision";
|
|
68
|
+
invariant: "invariant";
|
|
69
|
+
task: "task";
|
|
70
|
+
run: "run";
|
|
71
|
+
}>;
|
|
72
|
+
};
|
|
73
|
+
export declare const queryHistoryInput: {
|
|
74
|
+
scope: z.ZodString;
|
|
75
|
+
path_hint: z.ZodOptional<z.ZodString>;
|
|
76
|
+
since: z.ZodOptional<z.ZodString>;
|
|
77
|
+
until: z.ZodOptional<z.ZodString>;
|
|
78
|
+
};
|
|
79
|
+
export declare const appendInput: {
|
|
80
|
+
path: z.ZodString;
|
|
81
|
+
content: z.ZodString;
|
|
82
|
+
newline_separator: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
};
|
|
84
|
+
export declare const recordDecisionInput: {
|
|
85
|
+
id: z.ZodOptional<z.ZodString>;
|
|
86
|
+
title: z.ZodString;
|
|
87
|
+
summary: z.ZodString;
|
|
88
|
+
scope_globs: z.ZodArray<z.ZodString>;
|
|
89
|
+
supersedes: z.ZodOptional<z.ZodString>;
|
|
90
|
+
assertions: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
91
|
+
human_review_hint: z.ZodOptional<z.ZodString>;
|
|
92
|
+
body_markdown: z.ZodOptional<z.ZodString>;
|
|
93
|
+
target: z.ZodOptional<z.ZodEnum<{
|
|
94
|
+
accepted: "accepted";
|
|
95
|
+
inbox: "inbox";
|
|
96
|
+
}>>;
|
|
97
|
+
};
|
|
98
|
+
export declare const recordRunEventInput: {
|
|
99
|
+
run_id: z.ZodString;
|
|
100
|
+
event: z.ZodObject<{
|
|
101
|
+
kind: z.ZodString;
|
|
102
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
};
|
|
105
|
+
export declare const dropTaskInput: {
|
|
106
|
+
title: z.ZodString;
|
|
107
|
+
body: z.ZodString;
|
|
108
|
+
intent: z.ZodEnum<{
|
|
109
|
+
unknown: "unknown";
|
|
110
|
+
run_pilot: "run_pilot";
|
|
111
|
+
review_module: "review_module";
|
|
112
|
+
fix_issue: "fix_issue";
|
|
113
|
+
eval: "eval";
|
|
114
|
+
staleness_scan: "staleness_scan";
|
|
115
|
+
}>;
|
|
116
|
+
target_path_globs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
117
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
parent_task_id: z.ZodOptional<z.ZodString>;
|
|
119
|
+
source: z.ZodOptional<z.ZodString>;
|
|
120
|
+
};
|
|
121
|
+
export declare const archiveInput: {
|
|
122
|
+
path: z.ZodString;
|
|
123
|
+
reason: z.ZodString;
|
|
124
|
+
archive_dir: z.ZodOptional<z.ZodString>;
|
|
125
|
+
};
|
|
126
|
+
export declare const askOperatorInput: {
|
|
127
|
+
/** The agent's run id — files land under runs/active/<run_id>/questions/. */
|
|
128
|
+
run_id: z.ZodString;
|
|
129
|
+
/** The question text shown to the operator. */
|
|
130
|
+
question: z.ZodString;
|
|
131
|
+
/**
|
|
132
|
+
* Optional A/B/C/D candidate resolutions. When present the operator
|
|
133
|
+
* dialog uses buttons; when empty the operator must reply free-form
|
|
134
|
+
* (the orchestrator falls back to a follow-up message handler).
|
|
135
|
+
*/
|
|
136
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
137
|
+
/**
|
|
138
|
+
* Why the agent needs the operator's input. One of:
|
|
139
|
+
* "ambiguity" — spec is genuinely vague / multiple valid paths
|
|
140
|
+
* "permission" — about to take a non-recoverable action (delete,
|
|
141
|
+
* force-push, etc.)
|
|
142
|
+
* "stuck" — couldn't make progress without external info
|
|
143
|
+
* "verify" — operator should confirm the agent's interpretation
|
|
144
|
+
*/
|
|
145
|
+
category: z.ZodOptional<z.ZodEnum<{
|
|
146
|
+
ambiguity: "ambiguity";
|
|
147
|
+
permission: "permission";
|
|
148
|
+
stuck: "stuck";
|
|
149
|
+
verify: "verify";
|
|
150
|
+
}>>;
|
|
151
|
+
/** Per-call timeout. Default 10 minutes. */
|
|
152
|
+
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// Each constant below is the input zod RAW SHAPE the MCP SDK accepts directly
|
|
3
|
+
// in `registerTool({ inputSchema: ... })`. Keeping them as raw shapes (not
|
|
4
|
+
// pre-built objects) lets the SDK convert to JSON Schema for tool listings.
|
|
5
|
+
// ── Read tools — graph traversal ───────────────────────────────────────────
|
|
6
|
+
export const decisionGetInput = {
|
|
7
|
+
id: z.string().regex(/^DEC-\d{4,}$/, "decision id must match DEC-NNNN"),
|
|
8
|
+
};
|
|
9
|
+
export const decisionsInScopeInput = {
|
|
10
|
+
path_globs: z.array(z.string()).min(1),
|
|
11
|
+
status: z.array(z.enum(["draft", "accepted", "superseded", "archived"])).optional(),
|
|
12
|
+
};
|
|
13
|
+
export const decisionsForSymbolInput = {
|
|
14
|
+
file: z.string().min(1),
|
|
15
|
+
symbol: z.string().min(1),
|
|
16
|
+
};
|
|
17
|
+
export const canonicalForTopicInput = {
|
|
18
|
+
topic: z.string().min(1),
|
|
19
|
+
};
|
|
20
|
+
export const groundGetInput = {
|
|
21
|
+
category: z.enum([
|
|
22
|
+
"schema",
|
|
23
|
+
"routes",
|
|
24
|
+
"events",
|
|
25
|
+
"quality_grades",
|
|
26
|
+
"glossary",
|
|
27
|
+
"manifest",
|
|
28
|
+
]),
|
|
29
|
+
key: z.string().optional(),
|
|
30
|
+
};
|
|
31
|
+
export const supersedesChainInput = {
|
|
32
|
+
decision_id: z.string().min(1),
|
|
33
|
+
};
|
|
34
|
+
export const invariantGetInput = {
|
|
35
|
+
id: z.string().regex(/^V\d{4,}$/, "invariant id must match V<NNNN>"),
|
|
36
|
+
};
|
|
37
|
+
export const invariantsInScopeInput = {
|
|
38
|
+
path_globs: z.array(z.string()).min(1),
|
|
39
|
+
status: z.array(z.enum(["active", "superseded"])).optional(),
|
|
40
|
+
};
|
|
41
|
+
// ── Read tools — 3-layer progressive retrieval ─────────────────────────────
|
|
42
|
+
export const searchInput = {
|
|
43
|
+
query: z.string().min(1),
|
|
44
|
+
scope: z.array(z.string()).optional(),
|
|
45
|
+
kinds: z.array(z.enum(["decision", "invariant", "task", "run", "doc", "manifest"])).optional(),
|
|
46
|
+
limit: z.number().int().positive().max(50).optional(),
|
|
47
|
+
};
|
|
48
|
+
export const timelineInput = {
|
|
49
|
+
scope: z.array(z.string()).optional(),
|
|
50
|
+
since: z.string().optional(),
|
|
51
|
+
until: z.string().optional(),
|
|
52
|
+
kinds: z.array(z.string()).optional(),
|
|
53
|
+
};
|
|
54
|
+
export const getFullInput = {
|
|
55
|
+
id: z.string().min(1),
|
|
56
|
+
kind: z.enum(["decision", "invariant", "task", "run"]),
|
|
57
|
+
};
|
|
58
|
+
// ── Read tools — historical zone (gated) ───────────────────────────────────
|
|
59
|
+
export const queryHistoryInput = {
|
|
60
|
+
scope: z.string().min(1),
|
|
61
|
+
path_hint: z.string().optional(),
|
|
62
|
+
since: z.string().optional(),
|
|
63
|
+
until: z.string().optional(),
|
|
64
|
+
};
|
|
65
|
+
// ── Write tools ────────────────────────────────────────────────────────────
|
|
66
|
+
export const appendInput = {
|
|
67
|
+
path: z.string().min(1),
|
|
68
|
+
content: z.string(),
|
|
69
|
+
newline_separator: z.boolean().optional(),
|
|
70
|
+
};
|
|
71
|
+
export const recordDecisionInput = {
|
|
72
|
+
id: z.string().regex(/^DEC-\d{4,}$/).optional(),
|
|
73
|
+
title: z.string().min(1),
|
|
74
|
+
summary: z.string().min(1),
|
|
75
|
+
scope_globs: z.array(z.string()).min(1),
|
|
76
|
+
supersedes: z.string().optional(),
|
|
77
|
+
assertions: z.array(z.unknown()).optional(),
|
|
78
|
+
human_review_hint: z.string().optional(),
|
|
79
|
+
body_markdown: z.string().optional(),
|
|
80
|
+
target: z.enum(["inbox", "accepted"]).optional(),
|
|
81
|
+
};
|
|
82
|
+
export const recordRunEventInput = {
|
|
83
|
+
run_id: z.string().min(1),
|
|
84
|
+
event: z.object({
|
|
85
|
+
kind: z.string().min(1),
|
|
86
|
+
payload: z.unknown().optional(),
|
|
87
|
+
}),
|
|
88
|
+
};
|
|
89
|
+
export const dropTaskInput = {
|
|
90
|
+
title: z.string().min(1),
|
|
91
|
+
body: z.string().min(1),
|
|
92
|
+
intent: z.enum([
|
|
93
|
+
"run_pilot",
|
|
94
|
+
"review_module",
|
|
95
|
+
"fix_issue",
|
|
96
|
+
"eval",
|
|
97
|
+
"staleness_scan",
|
|
98
|
+
"unknown",
|
|
99
|
+
]),
|
|
100
|
+
target_path_globs: z.array(z.string()).optional(),
|
|
101
|
+
priority: z.number().int().min(1).max(10).optional(),
|
|
102
|
+
parent_task_id: z.string().optional(),
|
|
103
|
+
source: z.string().optional(),
|
|
104
|
+
};
|
|
105
|
+
export const archiveInput = {
|
|
106
|
+
path: z.string().min(1),
|
|
107
|
+
reason: z.string().min(1),
|
|
108
|
+
archive_dir: z.string().optional(),
|
|
109
|
+
};
|
|
110
|
+
export const askOperatorInput = {
|
|
111
|
+
/** The agent's run id — files land under runs/active/<run_id>/questions/. */
|
|
112
|
+
run_id: z.string().min(1),
|
|
113
|
+
/** The question text shown to the operator. */
|
|
114
|
+
question: z.string().min(1),
|
|
115
|
+
/**
|
|
116
|
+
* Optional A/B/C/D candidate resolutions. When present the operator
|
|
117
|
+
* dialog uses buttons; when empty the operator must reply free-form
|
|
118
|
+
* (the orchestrator falls back to a follow-up message handler).
|
|
119
|
+
*/
|
|
120
|
+
options: z.array(z.string().min(1)).max(4).optional(),
|
|
121
|
+
/**
|
|
122
|
+
* Why the agent needs the operator's input. One of:
|
|
123
|
+
* "ambiguity" — spec is genuinely vague / multiple valid paths
|
|
124
|
+
* "permission" — about to take a non-recoverable action (delete,
|
|
125
|
+
* force-push, etc.)
|
|
126
|
+
* "stuck" — couldn't make progress without external info
|
|
127
|
+
* "verify" — operator should confirm the agent's interpretation
|
|
128
|
+
*/
|
|
129
|
+
category: z
|
|
130
|
+
.enum(["ambiguity", "permission", "stuck", "verify"])
|
|
131
|
+
.optional(),
|
|
132
|
+
/** Per-call timeout. Default 10 minutes. */
|
|
133
|
+
timeout_ms: z.number().int().min(1000).max(86_400_000).optional(),
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=schemas.js.map
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
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type { McpContext } from "./context.js";
|
|
3
|
+
export interface StartServerOptions {
|
|
4
|
+
ctx: McpContext;
|
|
5
|
+
/** When true, do not connect to stdio — caller wires its own transport. */
|
|
6
|
+
noConnect?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function startMcpServer(opts: StartServerOptions): Promise<{
|
|
9
|
+
server: McpServer;
|
|
10
|
+
close: () => Promise<void>;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { logger } from "../logger.js";
|
|
4
|
+
import { VERSION } from "../index.js";
|
|
5
|
+
import { isMcpError, mcpError } from "./errors.js";
|
|
6
|
+
import { asMcpResult } from "./result.js";
|
|
7
|
+
import { recordCall } from "./telemetry.js";
|
|
8
|
+
import { allTools } from "./tools/index.js";
|
|
9
|
+
const log = logger("mcp.server");
|
|
10
|
+
export async function startMcpServer(opts) {
|
|
11
|
+
const { ctx } = opts;
|
|
12
|
+
const server = new McpServer({ name: "harness-mcp", version: VERSION });
|
|
13
|
+
for (const tool of allTools) {
|
|
14
|
+
server.registerTool(tool.name, {
|
|
15
|
+
description: tool.description,
|
|
16
|
+
inputSchema: tool.inputSchema,
|
|
17
|
+
}, async (rawInput) => {
|
|
18
|
+
const start = process.hrtime.bigint();
|
|
19
|
+
let payload;
|
|
20
|
+
try {
|
|
21
|
+
payload = await tool.handler(ctx, rawInput);
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
payload = mcpError("OPERATION_TIMEOUT", err instanceof Error ? err.message : "tool handler threw");
|
|
25
|
+
log.error({ tool: tool.name, err: String(err) }, "tool handler threw");
|
|
26
|
+
}
|
|
27
|
+
const durationMs = Number(process.hrtime.bigint() - start) / 1_000_000;
|
|
28
|
+
const result = asMcpResult(payload);
|
|
29
|
+
const resultSize = result.content?.[0]?.type === "text" ? result.content[0].text.length : 0;
|
|
30
|
+
try {
|
|
31
|
+
recordCall(ctx, {
|
|
32
|
+
ts: new Date().toISOString(),
|
|
33
|
+
tool: tool.name,
|
|
34
|
+
args: rawInput ?? {},
|
|
35
|
+
result_kind: isMcpError(payload) ? "error" : "ok",
|
|
36
|
+
result_size: resultSize,
|
|
37
|
+
duration_ms: Math.round(durationMs * 100) / 100,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// telemetry must not break tool calls
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if (opts.noConnect !== true) {
|
|
47
|
+
const transport = new StdioServerTransport();
|
|
48
|
+
await server.connect(transport);
|
|
49
|
+
log.info({ tools: allTools.length, repoRoot: ctx.repoRoot }, "MCP server listening on stdio");
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
server,
|
|
53
|
+
close: async () => {
|
|
54
|
+
await server.close();
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAA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|
4
|
+
* - .harness/runs/active/<runId>/mcp-calls.jsonl when ctx.runId set
|
|
5
|
+
* - .harness/staleness/mcp-calls.jsonl otherwise
|
|
6
|
+
*/
|
|
7
|
+
export interface TelemetryRow {
|
|
8
|
+
ts: string;
|
|
9
|
+
tool: string;
|
|
10
|
+
args: unknown;
|
|
11
|
+
result_kind: "ok" | "error";
|
|
12
|
+
result_size: number;
|
|
13
|
+
duration_ms: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function recordCall(ctx: McpContext, row: TelemetryRow): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { appendFileSync, existsSync, mkdirSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
export function recordCall(ctx, row) {
|
|
4
|
+
const path = ctx.runId !== undefined
|
|
5
|
+
? join(ctx.repoRoot, ".harness", "runs", "active", ctx.runId, "mcp-calls.jsonl")
|
|
6
|
+
: join(ctx.repoRoot, ".harness", "staleness", "mcp-calls.jsonl");
|
|
7
|
+
const dir = dirname(path);
|
|
8
|
+
if (!existsSync(dir)) {
|
|
9
|
+
mkdirSync(dir, { recursive: true });
|
|
10
|
+
}
|
|
11
|
+
appendFileSync(path, `${JSON.stringify(row)}\n`, "utf8");
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=telemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/mcp/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAiB1C,MAAM,UAAU,UAAU,CAAC,GAAe,EAAE,GAAiB;IAC3D,MAAM,IAAI,GACR,GAAG,CAAC,KAAK,KAAK,SAAS;QACrB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,KAAK,EAAE,iBAAiB,CAAC;QAChF,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACrB,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,cAAc,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC3D,CAAC"}
|