looply-cli 0.0.0-stage → 0.3.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 +137 -3
- package/dist/.src-hash +1 -0
- package/dist/acceptance-observe.d.ts +108 -0
- package/dist/acceptance-observe.d.ts.map +1 -0
- package/dist/acceptance-observe.js +152 -0
- package/dist/acceptance-observe.js.map +1 -0
- package/dist/agent-cmd.d.ts +131 -0
- package/dist/agent-cmd.d.ts.map +1 -0
- package/dist/agent-cmd.js +154 -0
- package/dist/agent-cmd.js.map +1 -0
- package/dist/agent-contained.d.ts +114 -0
- package/dist/agent-contained.d.ts.map +1 -0
- package/dist/agent-contained.js +292 -0
- package/dist/agent-contained.js.map +1 -0
- package/dist/agent-driver.d.ts +130 -0
- package/dist/agent-driver.d.ts.map +1 -0
- package/dist/agent-driver.js +170 -0
- package/dist/agent-driver.js.map +1 -0
- package/dist/agent-envelope.d.ts +94 -0
- package/dist/agent-envelope.d.ts.map +1 -0
- package/dist/agent-envelope.js +214 -0
- package/dist/agent-envelope.js.map +1 -0
- package/dist/agent-exec.d.ts +182 -0
- package/dist/agent-exec.d.ts.map +1 -0
- package/dist/agent-exec.js +125 -0
- package/dist/agent-exec.js.map +1 -0
- package/dist/agent-runtime.d.ts +23 -0
- package/dist/agent-runtime.d.ts.map +1 -0
- package/dist/agent-runtime.js +143 -0
- package/dist/agent-runtime.js.map +1 -0
- package/dist/approval-gate-read.d.ts +66 -0
- package/dist/approval-gate-read.d.ts.map +1 -0
- package/dist/approval-gate-read.js +138 -0
- package/dist/approval-gate-read.js.map +1 -0
- package/dist/approval-resolution.d.ts +87 -0
- package/dist/approval-resolution.d.ts.map +1 -0
- package/dist/approval-resolution.js +100 -0
- package/dist/approval-resolution.js.map +1 -0
- package/dist/approval-resumes.d.ts +102 -0
- package/dist/approval-resumes.d.ts.map +1 -0
- package/dist/approval-resumes.js +167 -0
- package/dist/approval-resumes.js.map +1 -0
- package/dist/ask-brain.d.ts +167 -0
- package/dist/ask-brain.d.ts.map +1 -0
- package/dist/ask-brain.js +355 -0
- package/dist/ask-brain.js.map +1 -0
- package/dist/autonomy-authority.d.ts +80 -0
- package/dist/autonomy-authority.d.ts.map +1 -0
- package/dist/autonomy-authority.js +82 -0
- package/dist/autonomy-authority.js.map +1 -0
- package/dist/autonomy-controller.d.ts +321 -0
- package/dist/autonomy-controller.d.ts.map +1 -0
- package/dist/autonomy-controller.js +517 -0
- package/dist/autonomy-controller.js.map +1 -0
- package/dist/autonomy-store.d.ts +327 -0
- package/dist/autonomy-store.d.ts.map +1 -0
- package/dist/autonomy-store.js +581 -0
- package/dist/autonomy-store.js.map +1 -0
- package/dist/autonomy-tick.d.ts +257 -0
- package/dist/autonomy-tick.d.ts.map +1 -0
- package/dist/autonomy-tick.js +616 -0
- package/dist/autonomy-tick.js.map +1 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +2727 -0
- package/dist/bin.js.map +1 -0
- package/dist/brain-advice.d.ts +21 -0
- package/dist/brain-advice.d.ts.map +1 -0
- package/dist/brain-advice.js +51 -0
- package/dist/brain-advice.js.map +1 -0
- package/dist/candidate-replay-runtime.d.ts +125 -0
- package/dist/candidate-replay-runtime.d.ts.map +1 -0
- package/dist/candidate-replay-runtime.js +188 -0
- package/dist/candidate-replay-runtime.js.map +1 -0
- package/dist/checkout-carry.d.ts +76 -0
- package/dist/checkout-carry.d.ts.map +1 -0
- package/dist/checkout-carry.js +125 -0
- package/dist/checkout-carry.js.map +1 -0
- package/dist/citation-readers.d.ts +26 -0
- package/dist/citation-readers.d.ts.map +1 -0
- package/dist/citation-readers.js +102 -0
- package/dist/citation-readers.js.map +1 -0
- package/dist/command-receipts.d.ts +79 -0
- package/dist/command-receipts.d.ts.map +1 -0
- package/dist/command-receipts.js +143 -0
- package/dist/command-receipts.js.map +1 -0
- package/dist/command-runner.d.ts +32 -0
- package/dist/command-runner.d.ts.map +1 -0
- package/dist/command-runner.js +108 -0
- package/dist/command-runner.js.map +1 -0
- package/dist/compatible-sets.d.ts +67 -0
- package/dist/compatible-sets.d.ts.map +1 -0
- package/dist/compatible-sets.js +81 -0
- package/dist/compatible-sets.js.map +1 -0
- package/dist/compile-check.d.ts +31 -0
- package/dist/compile-check.d.ts.map +1 -0
- package/dist/compile-check.js +34 -0
- package/dist/compile-check.js.map +1 -0
- package/dist/compile-store.d.ts +16 -0
- package/dist/compile-store.d.ts.map +1 -0
- package/dist/compile-store.js +21 -0
- package/dist/compile-store.js.map +1 -0
- package/dist/completion.d.ts +106 -0
- package/dist/completion.d.ts.map +1 -0
- package/dist/completion.js +131 -0
- package/dist/completion.js.map +1 -0
- package/dist/config.d.ts +549 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +763 -0
- package/dist/config.js.map +1 -0
- package/dist/control-file.d.ts +142 -0
- package/dist/control-file.d.ts.map +1 -0
- package/dist/control-file.js +144 -0
- package/dist/control-file.js.map +1 -0
- package/dist/coordinator-state.d.ts +131 -0
- package/dist/coordinator-state.d.ts.map +1 -0
- package/dist/coordinator-state.js +380 -0
- package/dist/coordinator-state.js.map +1 -0
- package/dist/coordinator.d.ts +95 -0
- package/dist/coordinator.d.ts.map +1 -0
- package/dist/coordinator.js +97 -0
- package/dist/coordinator.js.map +1 -0
- package/dist/cursor-store.d.ts +53 -0
- package/dist/cursor-store.d.ts.map +1 -0
- package/dist/cursor-store.js +98 -0
- package/dist/cursor-store.js.map +1 -0
- package/dist/daemon-cmd.d.ts +239 -0
- package/dist/daemon-cmd.d.ts.map +1 -0
- package/dist/daemon-cmd.js +1751 -0
- package/dist/daemon-cmd.js.map +1 -0
- package/dist/daemon-lock.d.ts +140 -0
- package/dist/daemon-lock.d.ts.map +1 -0
- package/dist/daemon-lock.js +352 -0
- package/dist/daemon-lock.js.map +1 -0
- package/dist/daemon-recovery.d.ts +78 -0
- package/dist/daemon-recovery.d.ts.map +1 -0
- package/dist/daemon-recovery.js +161 -0
- package/dist/daemon-recovery.js.map +1 -0
- package/dist/daemon.d.ts +368 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js +601 -0
- package/dist/daemon.js.map +1 -0
- package/dist/declared-response-shape.d.ts +93 -0
- package/dist/declared-response-shape.d.ts.map +1 -0
- package/dist/declared-response-shape.js +200 -0
- package/dist/declared-response-shape.js.map +1 -0
- package/dist/declared-surfaces.d.ts +16 -0
- package/dist/declared-surfaces.d.ts.map +1 -0
- package/dist/declared-surfaces.js +19 -0
- package/dist/declared-surfaces.js.map +1 -0
- package/dist/depends-review.d.ts +113 -0
- package/dist/depends-review.d.ts.map +1 -0
- package/dist/depends-review.js +110 -0
- package/dist/depends-review.js.map +1 -0
- package/dist/doctor.d.ts +91 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +71 -0
- package/dist/doctor.js.map +1 -0
- package/dist/edge-approval.d.ts +105 -0
- package/dist/edge-approval.d.ts.map +1 -0
- package/dist/edge-approval.js +100 -0
- package/dist/edge-approval.js.map +1 -0
- package/dist/evidence-cache.d.ts +45 -0
- package/dist/evidence-cache.d.ts.map +1 -0
- package/dist/evidence-cache.js +90 -0
- package/dist/evidence-cache.js.map +1 -0
- package/dist/evidence-cmd.d.ts +133 -0
- package/dist/evidence-cmd.d.ts.map +1 -0
- package/dist/evidence-cmd.js +347 -0
- package/dist/evidence-cmd.js.map +1 -0
- package/dist/evidence-facts.d.ts +40 -0
- package/dist/evidence-facts.d.ts.map +1 -0
- package/dist/evidence-facts.js +114 -0
- package/dist/evidence-facts.js.map +1 -0
- package/dist/exclusive-lock.d.ts +52 -0
- package/dist/exclusive-lock.d.ts.map +1 -0
- package/dist/exclusive-lock.js +150 -0
- package/dist/exclusive-lock.js.map +1 -0
- package/dist/exec-domains.d.ts +140 -0
- package/dist/exec-domains.d.ts.map +1 -0
- package/dist/exec-domains.js +287 -0
- package/dist/exec-domains.js.map +1 -0
- package/dist/exemption-store.d.ts +197 -0
- package/dist/exemption-store.d.ts.map +1 -0
- package/dist/exemption-store.js +266 -0
- package/dist/exemption-store.js.map +1 -0
- package/dist/explicit-start-gate.d.ts +96 -0
- package/dist/explicit-start-gate.d.ts.map +1 -0
- package/dist/explicit-start-gate.js +103 -0
- package/dist/explicit-start-gate.js.map +1 -0
- package/dist/fs-trouble.d.ts +70 -0
- package/dist/fs-trouble.d.ts.map +1 -0
- package/dist/fs-trouble.js +98 -0
- package/dist/fs-trouble.js.map +1 -0
- package/dist/gate.d.ts +278 -0
- package/dist/gate.d.ts.map +1 -0
- package/dist/gate.js +278 -0
- package/dist/gate.js.map +1 -0
- package/dist/git-driver.d.ts +519 -0
- package/dist/git-driver.d.ts.map +1 -0
- package/dist/git-driver.js +900 -0
- package/dist/git-driver.js.map +1 -0
- package/dist/git-push-executor.d.ts +41 -0
- package/dist/git-push-executor.d.ts.map +1 -0
- package/dist/git-push-executor.js +142 -0
- package/dist/git-push-executor.js.map +1 -0
- package/dist/glob.d.ts +26 -0
- package/dist/glob.d.ts.map +1 -0
- package/dist/glob.js +93 -0
- package/dist/glob.js.map +1 -0
- package/dist/goal-adaptive.d.ts +295 -0
- package/dist/goal-adaptive.d.ts.map +1 -0
- package/dist/goal-adaptive.js +393 -0
- package/dist/goal-adaptive.js.map +1 -0
- package/dist/goal-compile.d.ts +342 -0
- package/dist/goal-compile.d.ts.map +1 -0
- package/dist/goal-compile.js +444 -0
- package/dist/goal-compile.js.map +1 -0
- package/dist/goal-depends-executor.d.ts +55 -0
- package/dist/goal-depends-executor.d.ts.map +1 -0
- package/dist/goal-depends-executor.js +202 -0
- package/dist/goal-depends-executor.js.map +1 -0
- package/dist/goal-execution-evidence.d.ts +135 -0
- package/dist/goal-execution-evidence.d.ts.map +1 -0
- package/dist/goal-execution-evidence.js +159 -0
- package/dist/goal-execution-evidence.js.map +1 -0
- package/dist/goal-gap.d.ts +140 -0
- package/dist/goal-gap.d.ts.map +1 -0
- package/dist/goal-gap.js +197 -0
- package/dist/goal-gap.js.map +1 -0
- package/dist/goal-met-target.d.ts +98 -0
- package/dist/goal-met-target.d.ts.map +1 -0
- package/dist/goal-met-target.js +92 -0
- package/dist/goal-met-target.js.map +1 -0
- package/dist/goal-ownership.d.ts +416 -0
- package/dist/goal-ownership.d.ts.map +1 -0
- package/dist/goal-ownership.js +576 -0
- package/dist/goal-ownership.js.map +1 -0
- package/dist/goal-runs.d.ts +82 -0
- package/dist/goal-runs.d.ts.map +1 -0
- package/dist/goal-runs.js +120 -0
- package/dist/goal-runs.js.map +1 -0
- package/dist/goal-store.d.ts +146 -0
- package/dist/goal-store.d.ts.map +1 -0
- package/dist/goal-store.js +294 -0
- package/dist/goal-store.js.map +1 -0
- package/dist/goal-view.d.ts +156 -0
- package/dist/goal-view.d.ts.map +1 -0
- package/dist/goal-view.js +499 -0
- package/dist/goal-view.js.map +1 -0
- package/dist/governed-approvals.d.ts +152 -0
- package/dist/governed-approvals.d.ts.map +1 -0
- package/dist/governed-approvals.js +246 -0
- package/dist/governed-approvals.js.map +1 -0
- package/dist/governed-broker.d.ts +169 -0
- package/dist/governed-broker.d.ts.map +1 -0
- package/dist/governed-broker.js +196 -0
- package/dist/governed-broker.js.map +1 -0
- package/dist/governed-run.d.ts +220 -0
- package/dist/governed-run.d.ts.map +1 -0
- package/dist/governed-run.js +406 -0
- package/dist/governed-run.js.map +1 -0
- package/dist/grant-reconcile.d.ts +63 -0
- package/dist/grant-reconcile.d.ts.map +1 -0
- package/dist/grant-reconcile.js +121 -0
- package/dist/grant-reconcile.js.map +1 -0
- package/dist/index-for-head.d.ts +56 -0
- package/dist/index-for-head.d.ts.map +1 -0
- package/dist/index-for-head.js +103 -0
- package/dist/index-for-head.js.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/init-detect.d.ts +39 -0
- package/dist/init-detect.d.ts.map +1 -0
- package/dist/init-detect.js +188 -0
- package/dist/init-detect.js.map +1 -0
- package/dist/integration-deps.d.ts +62 -0
- package/dist/integration-deps.d.ts.map +1 -0
- package/dist/integration-deps.js +251 -0
- package/dist/integration-deps.js.map +1 -0
- package/dist/integration-runtime.d.ts +458 -0
- package/dist/integration-runtime.d.ts.map +1 -0
- package/dist/integration-runtime.js +681 -0
- package/dist/integration-runtime.js.map +1 -0
- package/dist/integration.d.ts +45 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +87 -0
- package/dist/integration.js.map +1 -0
- package/dist/integrator.d.ts +84 -0
- package/dist/integrator.d.ts.map +1 -0
- package/dist/integrator.js +193 -0
- package/dist/integrator.js.map +1 -0
- package/dist/lane-claims.d.ts +174 -0
- package/dist/lane-claims.d.ts.map +1 -0
- package/dist/lane-claims.js +218 -0
- package/dist/lane-claims.js.map +1 -0
- package/dist/lane-coverage.d.ts +87 -0
- package/dist/lane-coverage.d.ts.map +1 -0
- package/dist/lane-coverage.js +129 -0
- package/dist/lane-coverage.js.map +1 -0
- package/dist/ledger-replay.d.ts +115 -0
- package/dist/ledger-replay.d.ts.map +1 -0
- package/dist/ledger-replay.js +155 -0
- package/dist/ledger-replay.js.map +1 -0
- package/dist/ledger-store.d.ts +68 -0
- package/dist/ledger-store.d.ts.map +1 -0
- package/dist/ledger-store.js +111 -0
- package/dist/ledger-store.js.map +1 -0
- package/dist/loop-safety-observer.d.ts +132 -0
- package/dist/loop-safety-observer.d.ts.map +1 -0
- package/dist/loop-safety-observer.js +76 -0
- package/dist/loop-safety-observer.js.map +1 -0
- package/dist/loop-safety-store.d.ts +339 -0
- package/dist/loop-safety-store.d.ts.map +1 -0
- package/dist/loop-safety-store.js +800 -0
- package/dist/loop-safety-store.js.map +1 -0
- package/dist/machine-store.d.ts +54 -0
- package/dist/machine-store.d.ts.map +1 -0
- package/dist/machine-store.js +149 -0
- package/dist/machine-store.js.map +1 -0
- package/dist/mcp-main.d.ts +2 -0
- package/dist/mcp-main.d.ts.map +1 -0
- package/dist/mcp-main.js +116 -0
- package/dist/mcp-main.js.map +1 -0
- package/dist/mcp-server.d.ts +72 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +259 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/model-routing.d.ts +75 -0
- package/dist/model-routing.d.ts.map +1 -0
- package/dist/model-routing.js +108 -0
- package/dist/model-routing.js.map +1 -0
- package/dist/model-transport.d.ts +188 -0
- package/dist/model-transport.d.ts.map +1 -0
- package/dist/model-transport.js +625 -0
- package/dist/model-transport.js.map +1 -0
- package/dist/notify-cadence.d.ts +55 -0
- package/dist/notify-cadence.d.ts.map +1 -0
- package/dist/notify-cadence.js +68 -0
- package/dist/notify-cadence.js.map +1 -0
- package/dist/notify-channel.d.ts +69 -0
- package/dist/notify-channel.d.ts.map +1 -0
- package/dist/notify-channel.js +151 -0
- package/dist/notify-channel.js.map +1 -0
- package/dist/notify.d.ts +71 -0
- package/dist/notify.d.ts.map +1 -0
- package/dist/notify.js +125 -0
- package/dist/notify.js.map +1 -0
- package/dist/observation-inventory.d.ts +65 -0
- package/dist/observation-inventory.d.ts.map +1 -0
- package/dist/observation-inventory.js +139 -0
- package/dist/observation-inventory.js.map +1 -0
- package/dist/owned-children.d.ts +45 -0
- package/dist/owned-children.d.ts.map +1 -0
- package/dist/owned-children.js +64 -0
- package/dist/owned-children.js.map +1 -0
- package/dist/packet-for-goal.d.ts +19 -0
- package/dist/packet-for-goal.d.ts.map +1 -0
- package/dist/packet-for-goal.js +32 -0
- package/dist/packet-for-goal.js.map +1 -0
- package/dist/pair-cmd.d.ts +85 -0
- package/dist/pair-cmd.d.ts.map +1 -0
- package/dist/pair-cmd.js +205 -0
- package/dist/pair-cmd.js.map +1 -0
- package/dist/partial-asker.d.ts +96 -0
- package/dist/partial-asker.d.ts.map +1 -0
- package/dist/partial-asker.js +117 -0
- package/dist/partial-asker.js.map +1 -0
- package/dist/pdf-text-lines.d.ts +17 -0
- package/dist/pdf-text-lines.d.ts.map +1 -0
- package/dist/pdf-text-lines.js +70 -0
- package/dist/pdf-text-lines.js.map +1 -0
- package/dist/pdf-text-worker.d.ts +2 -0
- package/dist/pdf-text-worker.d.ts.map +1 -0
- package/dist/pdf-text-worker.js +81 -0
- package/dist/pdf-text-worker.js.map +1 -0
- package/dist/pdf-text.d.ts +56 -0
- package/dist/pdf-text.d.ts.map +1 -0
- package/dist/pdf-text.js +64 -0
- package/dist/pdf-text.js.map +1 -0
- package/dist/pending-action.d.ts +154 -0
- package/dist/pending-action.d.ts.map +1 -0
- package/dist/pending-action.js +148 -0
- package/dist/pending-action.js.map +1 -0
- package/dist/preemptor.d.ts +40 -0
- package/dist/preemptor.d.ts.map +1 -0
- package/dist/preemptor.js +49 -0
- package/dist/preemptor.js.map +1 -0
- package/dist/programme-mode.d.ts +29 -0
- package/dist/programme-mode.d.ts.map +1 -0
- package/dist/programme-mode.js +50 -0
- package/dist/programme-mode.js.map +1 -0
- package/dist/progress-view.d.ts +14 -0
- package/dist/progress-view.d.ts.map +1 -0
- package/dist/progress-view.js +114 -0
- package/dist/progress-view.js.map +1 -0
- package/dist/project-graph-builder.d.ts +81 -0
- package/dist/project-graph-builder.d.ts.map +1 -0
- package/dist/project-graph-builder.js +246 -0
- package/dist/project-graph-builder.js.map +1 -0
- package/dist/project-graph-runtime.d.ts +86 -0
- package/dist/project-graph-runtime.d.ts.map +1 -0
- package/dist/project-graph-runtime.js +112 -0
- package/dist/project-graph-runtime.js.map +1 -0
- package/dist/project-index-builder.d.ts +96 -0
- package/dist/project-index-builder.d.ts.map +1 -0
- package/dist/project-index-builder.js +298 -0
- package/dist/project-index-builder.js.map +1 -0
- package/dist/project-index-facts.d.ts +51 -0
- package/dist/project-index-facts.d.ts.map +1 -0
- package/dist/project-index-facts.js +117 -0
- package/dist/project-index-facts.js.map +1 -0
- package/dist/project-index-store.d.ts +97 -0
- package/dist/project-index-store.d.ts.map +1 -0
- package/dist/project-index-store.js +140 -0
- package/dist/project-index-store.js.map +1 -0
- package/dist/project-memory-store.d.ts +127 -0
- package/dist/project-memory-store.d.ts.map +1 -0
- package/dist/project-memory-store.js +302 -0
- package/dist/project-memory-store.js.map +1 -0
- package/dist/proposal-store.d.ts +14 -0
- package/dist/proposal-store.d.ts.map +1 -0
- package/dist/proposal-store.js +19 -0
- package/dist/proposal-store.js.map +1 -0
- package/dist/prover.d.ts +80 -0
- package/dist/prover.d.ts.map +1 -0
- package/dist/prover.js +137 -0
- package/dist/prover.js.map +1 -0
- package/dist/provider-identity-store.d.ts +34 -0
- package/dist/provider-identity-store.d.ts.map +1 -0
- package/dist/provider-identity-store.js +72 -0
- package/dist/provider-identity-store.js.map +1 -0
- package/dist/provider-identity.d.ts +104 -0
- package/dist/provider-identity.d.ts.map +1 -0
- package/dist/provider-identity.js +167 -0
- package/dist/provider-identity.js.map +1 -0
- package/dist/provider-limit.d.ts +79 -0
- package/dist/provider-limit.d.ts.map +1 -0
- package/dist/provider-limit.js +148 -0
- package/dist/provider-limit.js.map +1 -0
- package/dist/provider-preflight.d.ts +171 -0
- package/dist/provider-preflight.d.ts.map +1 -0
- package/dist/provider-preflight.js +395 -0
- package/dist/provider-preflight.js.map +1 -0
- package/dist/provider-state.d.ts +120 -0
- package/dist/provider-state.d.ts.map +1 -0
- package/dist/provider-state.js +182 -0
- package/dist/provider-state.js.map +1 -0
- package/dist/providers.d.ts +132 -0
- package/dist/providers.d.ts.map +1 -0
- package/dist/providers.js +161 -0
- package/dist/providers.js.map +1 -0
- package/dist/publication-recorder.d.ts +117 -0
- package/dist/publication-recorder.d.ts.map +1 -0
- package/dist/publication-recorder.js +124 -0
- package/dist/publication-recorder.js.map +1 -0
- package/dist/pursuit-delivery.d.ts +24 -0
- package/dist/pursuit-delivery.d.ts.map +1 -0
- package/dist/pursuit-delivery.js +38 -0
- package/dist/pursuit-delivery.js.map +1 -0
- package/dist/queue-store.d.ts +132 -0
- package/dist/queue-store.d.ts.map +1 -0
- package/dist/queue-store.js +185 -0
- package/dist/queue-store.js.map +1 -0
- package/dist/queue-summary.d.ts +14 -0
- package/dist/queue-summary.d.ts.map +1 -0
- package/dist/queue-summary.js +82 -0
- package/dist/queue-summary.js.map +1 -0
- package/dist/queue-view.d.ts +20 -0
- package/dist/queue-view.d.ts.map +1 -0
- package/dist/queue-view.js +163 -0
- package/dist/queue-view.js.map +1 -0
- package/dist/queue-write-lease.d.ts +106 -0
- package/dist/queue-write-lease.d.ts.map +1 -0
- package/dist/queue-write-lease.js +282 -0
- package/dist/queue-write-lease.js.map +1 -0
- package/dist/rails-home.d.ts +162 -0
- package/dist/rails-home.d.ts.map +1 -0
- package/dist/rails-home.js +452 -0
- package/dist/rails-home.js.map +1 -0
- package/dist/rails-migrations.d.ts +75 -0
- package/dist/rails-migrations.d.ts.map +1 -0
- package/dist/rails-migrations.js +199 -0
- package/dist/rails-migrations.js.map +1 -0
- package/dist/rails-stores.d.ts +49 -0
- package/dist/rails-stores.d.ts.map +1 -0
- package/dist/rails-stores.js +100 -0
- package/dist/rails-stores.js.map +1 -0
- package/dist/reaper.d.ts +69 -0
- package/dist/reaper.d.ts.map +1 -0
- package/dist/reaper.js +152 -0
- package/dist/reaper.js.map +1 -0
- package/dist/record-store.d.ts +36 -0
- package/dist/record-store.d.ts.map +1 -0
- package/dist/record-store.js +78 -0
- package/dist/record-store.js.map +1 -0
- package/dist/recovery-io.d.ts +50 -0
- package/dist/recovery-io.d.ts.map +1 -0
- package/dist/recovery-io.js +122 -0
- package/dist/recovery-io.js.map +1 -0
- package/dist/recovery.d.ts +146 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +110 -0
- package/dist/recovery.js.map +1 -0
- package/dist/redraw.d.ts +34 -0
- package/dist/redraw.d.ts.map +1 -0
- package/dist/redraw.js +62 -0
- package/dist/redraw.js.map +1 -0
- package/dist/rejected-evidence.d.ts +255 -0
- package/dist/rejected-evidence.d.ts.map +1 -0
- package/dist/rejected-evidence.js +324 -0
- package/dist/rejected-evidence.js.map +1 -0
- package/dist/report-cmd.d.ts +32 -0
- package/dist/report-cmd.d.ts.map +1 -0
- package/dist/report-cmd.js +201 -0
- package/dist/report-cmd.js.map +1 -0
- package/dist/repos-cmd.d.ts +80 -0
- package/dist/repos-cmd.d.ts.map +1 -0
- package/dist/repos-cmd.js +240 -0
- package/dist/repos-cmd.js.map +1 -0
- package/dist/request-body-shape.d.ts +93 -0
- package/dist/request-body-shape.d.ts.map +1 -0
- package/dist/request-body-shape.js +407 -0
- package/dist/request-body-shape.js.map +1 -0
- package/dist/requirement-claims.d.ts +89 -0
- package/dist/requirement-claims.d.ts.map +1 -0
- package/dist/requirement-claims.js +92 -0
- package/dist/requirement-claims.js.map +1 -0
- package/dist/retention-apply-runtime.d.ts +105 -0
- package/dist/retention-apply-runtime.d.ts.map +1 -0
- package/dist/retention-apply-runtime.js +269 -0
- package/dist/retention-apply-runtime.js.map +1 -0
- package/dist/reverify.d.ts +41 -0
- package/dist/reverify.d.ts.map +1 -0
- package/dist/reverify.js +69 -0
- package/dist/reverify.js.map +1 -0
- package/dist/round-records.d.ts +65 -0
- package/dist/round-records.d.ts.map +1 -0
- package/dist/round-records.js +61 -0
- package/dist/round-records.js.map +1 -0
- package/dist/round-runner.d.ts +924 -0
- package/dist/round-runner.d.ts.map +1 -0
- package/dist/round-runner.js +1693 -0
- package/dist/round-runner.js.map +1 -0
- package/dist/run-approval.d.ts +180 -0
- package/dist/run-approval.d.ts.map +1 -0
- package/dist/run-approval.js +199 -0
- package/dist/run-approval.js.map +1 -0
- package/dist/run-cmd.d.ts +359 -0
- package/dist/run-cmd.d.ts.map +1 -0
- package/dist/run-cmd.js +4418 -0
- package/dist/run-cmd.js.map +1 -0
- package/dist/run-delivery.d.ts +71 -0
- package/dist/run-delivery.d.ts.map +1 -0
- package/dist/run-delivery.js +104 -0
- package/dist/run-delivery.js.map +1 -0
- package/dist/run-ended.d.ts +75 -0
- package/dist/run-ended.d.ts.map +1 -0
- package/dist/run-ended.js +27 -0
- package/dist/run-ended.js.map +1 -0
- package/dist/run-ending-locator.d.ts +125 -0
- package/dist/run-ending-locator.d.ts.map +1 -0
- package/dist/run-ending-locator.js +133 -0
- package/dist/run-ending-locator.js.map +1 -0
- package/dist/run-launcher.d.ts +459 -0
- package/dist/run-launcher.d.ts.map +1 -0
- package/dist/run-launcher.js +652 -0
- package/dist/run-launcher.js.map +1 -0
- package/dist/run-lease.d.ts +208 -0
- package/dist/run-lease.d.ts.map +1 -0
- package/dist/run-lease.js +301 -0
- package/dist/run-lease.js.map +1 -0
- package/dist/run-refusal-marks.d.ts +189 -0
- package/dist/run-refusal-marks.d.ts.map +1 -0
- package/dist/run-refusal-marks.js +249 -0
- package/dist/run-refusal-marks.js.map +1 -0
- package/dist/run-start-marks.d.ts +153 -0
- package/dist/run-start-marks.d.ts.map +1 -0
- package/dist/run-start-marks.js +269 -0
- package/dist/run-start-marks.js.map +1 -0
- package/dist/scan-cmd.d.ts +14 -0
- package/dist/scan-cmd.d.ts.map +1 -0
- package/dist/scan-cmd.js +270 -0
- package/dist/scan-cmd.js.map +1 -0
- package/dist/scan-events.d.ts +50 -0
- package/dist/scan-events.d.ts.map +1 -0
- package/dist/scan-events.js +91 -0
- package/dist/scan-events.js.map +1 -0
- package/dist/scan.d.ts +191 -0
- package/dist/scan.d.ts.map +1 -0
- package/dist/scan.js +417 -0
- package/dist/scan.js.map +1 -0
- package/dist/scope-rule.d.ts +148 -0
- package/dist/scope-rule.d.ts.map +1 -0
- package/dist/scope-rule.js +121 -0
- package/dist/scope-rule.js.map +1 -0
- package/dist/self-repo-id.d.ts +18 -0
- package/dist/self-repo-id.d.ts.map +1 -0
- package/dist/self-repo-id.js +70 -0
- package/dist/self-repo-id.js.map +1 -0
- package/dist/serve-cmd.d.ts +115 -0
- package/dist/serve-cmd.d.ts.map +1 -0
- package/dist/serve-cmd.js +505 -0
- package/dist/serve-cmd.js.map +1 -0
- package/dist/serve.d.ts +167 -0
- package/dist/serve.d.ts.map +1 -0
- package/dist/serve.js +336 -0
- package/dist/serve.js.map +1 -0
- package/dist/server-client.d.ts +766 -0
- package/dist/server-client.d.ts.map +1 -0
- package/dist/server-client.js +475 -0
- package/dist/server-client.js.map +1 -0
- package/dist/session-adapter-runtime.d.ts +195 -0
- package/dist/session-adapter-runtime.d.ts.map +1 -0
- package/dist/session-adapter-runtime.js +373 -0
- package/dist/session-adapter-runtime.js.map +1 -0
- package/dist/session-checkpoint-runtime.d.ts +62 -0
- package/dist/session-checkpoint-runtime.d.ts.map +1 -0
- package/dist/session-checkpoint-runtime.js +268 -0
- package/dist/session-checkpoint-runtime.js.map +1 -0
- package/dist/session-control-transport.d.ts +106 -0
- package/dist/session-control-transport.d.ts.map +1 -0
- package/dist/session-control-transport.js +232 -0
- package/dist/session-control-transport.js.map +1 -0
- package/dist/session-observation-store.d.ts +98 -0
- package/dist/session-observation-store.d.ts.map +1 -0
- package/dist/session-observation-store.js +155 -0
- package/dist/session-observation-store.js.map +1 -0
- package/dist/session-observe-runtime.d.ts +123 -0
- package/dist/session-observe-runtime.d.ts.map +1 -0
- package/dist/session-observe-runtime.js +317 -0
- package/dist/session-observe-runtime.js.map +1 -0
- package/dist/session-store.d.ts +98 -0
- package/dist/session-store.d.ts.map +1 -0
- package/dist/session-store.js +116 -0
- package/dist/session-store.js.map +1 -0
- package/dist/sessions-cmd.d.ts +202 -0
- package/dist/sessions-cmd.d.ts.map +1 -0
- package/dist/sessions-cmd.js +609 -0
- package/dist/sessions-cmd.js.map +1 -0
- package/dist/settings-overlay.d.ts +53 -0
- package/dist/settings-overlay.d.ts.map +1 -0
- package/dist/settings-overlay.js +175 -0
- package/dist/settings-overlay.js.map +1 -0
- package/dist/setup-prompt.d.ts +34 -0
- package/dist/setup-prompt.d.ts.map +1 -0
- package/dist/setup-prompt.js +92 -0
- package/dist/setup-prompt.js.map +1 -0
- package/dist/setup.d.ts +103 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +283 -0
- package/dist/setup.js.map +1 -0
- package/dist/shared-grants.d.ts +164 -0
- package/dist/shared-grants.d.ts.map +1 -0
- package/dist/shared-grants.js +242 -0
- package/dist/shared-grants.js.map +1 -0
- package/dist/signals.d.ts +55 -0
- package/dist/signals.d.ts.map +1 -0
- package/dist/signals.js +85 -0
- package/dist/signals.js.map +1 -0
- package/dist/source-cmd.d.ts +201 -0
- package/dist/source-cmd.d.ts.map +1 -0
- package/dist/source-cmd.js +684 -0
- package/dist/source-cmd.js.map +1 -0
- package/dist/source-verdict.d.ts +99 -0
- package/dist/source-verdict.d.ts.map +1 -0
- package/dist/source-verdict.js +182 -0
- package/dist/source-verdict.js.map +1 -0
- package/dist/spend-ledger.d.ts +350 -0
- package/dist/spend-ledger.d.ts.map +1 -0
- package/dist/spend-ledger.js +546 -0
- package/dist/spend-ledger.js.map +1 -0
- package/dist/stale-run-sweep.d.ts +79 -0
- package/dist/stale-run-sweep.d.ts.map +1 -0
- package/dist/stale-run-sweep.js +116 -0
- package/dist/stale-run-sweep.js.map +1 -0
- package/dist/start-attempts.d.ts +385 -0
- package/dist/start-attempts.d.ts.map +1 -0
- package/dist/start-attempts.js +613 -0
- package/dist/start-attempts.js.map +1 -0
- package/dist/status-cmd.d.ts +28 -0
- package/dist/status-cmd.d.ts.map +1 -0
- package/dist/status-cmd.js +116 -0
- package/dist/status-cmd.js.map +1 -0
- package/dist/stop-follow-up.d.ts +107 -0
- package/dist/stop-follow-up.d.ts.map +1 -0
- package/dist/stop-follow-up.js +172 -0
- package/dist/stop-follow-up.js.map +1 -0
- package/dist/surface-lease.d.ts +118 -0
- package/dist/surface-lease.d.ts.map +1 -0
- package/dist/surface-lease.js +485 -0
- package/dist/surface-lease.js.map +1 -0
- package/dist/sync.d.ts +54 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +93 -0
- package/dist/sync.js.map +1 -0
- package/dist/syncing-ledger.d.ts +45 -0
- package/dist/syncing-ledger.d.ts.map +1 -0
- package/dist/syncing-ledger.js +53 -0
- package/dist/syncing-ledger.js.map +1 -0
- package/dist/temp-fixtures.d.ts +68 -0
- package/dist/temp-fixtures.d.ts.map +1 -0
- package/dist/temp-fixtures.js +38 -0
- package/dist/temp-fixtures.js.map +1 -0
- package/dist/token-window.d.ts +84 -0
- package/dist/token-window.d.ts.map +1 -0
- package/dist/token-window.js +143 -0
- package/dist/token-window.js.map +1 -0
- package/dist/tool-bridge.d.ts +177 -0
- package/dist/tool-bridge.d.ts.map +1 -0
- package/dist/tool-bridge.js +329 -0
- package/dist/tool-bridge.js.map +1 -0
- package/dist/tool-call-record.d.ts +197 -0
- package/dist/tool-call-record.d.ts.map +1 -0
- package/dist/tool-call-record.js +276 -0
- package/dist/tool-call-record.js.map +1 -0
- package/dist/tool-protocol.d.ts +135 -0
- package/dist/tool-protocol.d.ts.map +1 -0
- package/dist/tool-protocol.js +104 -0
- package/dist/tool-protocol.js.map +1 -0
- package/dist/tool-worker.d.ts +3 -0
- package/dist/tool-worker.d.ts.map +1 -0
- package/dist/tool-worker.js +478 -0
- package/dist/tool-worker.js.map +1 -0
- package/dist/toolchain-mirror.d.ts +86 -0
- package/dist/toolchain-mirror.d.ts.map +1 -0
- package/dist/toolchain-mirror.js +307 -0
- package/dist/toolchain-mirror.js.map +1 -0
- package/dist/trusted-git.d.ts +243 -0
- package/dist/trusted-git.d.ts.map +1 -0
- package/dist/trusted-git.js +920 -0
- package/dist/trusted-git.js.map +1 -0
- package/dist/ui.d.ts +76 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +118 -0
- package/dist/ui.js.map +1 -0
- package/dist/untrusted-exec.d.ts +275 -0
- package/dist/untrusted-exec.d.ts.map +1 -0
- package/dist/untrusted-exec.js +479 -0
- package/dist/untrusted-exec.js.map +1 -0
- package/dist/untrusted-gate.d.ts +73 -0
- package/dist/untrusted-gate.d.ts.map +1 -0
- package/dist/untrusted-gate.js +226 -0
- package/dist/untrusted-gate.js.map +1 -0
- package/dist/uploader.d.ts +153 -0
- package/dist/uploader.d.ts.map +1 -0
- package/dist/uploader.js +204 -0
- package/dist/uploader.js.map +1 -0
- package/dist/verifier.d.ts +66 -0
- package/dist/verifier.d.ts.map +1 -0
- package/dist/verifier.js +170 -0
- package/dist/verifier.js.map +1 -0
- package/dist/verify-apply.d.ts +26 -0
- package/dist/verify-apply.d.ts.map +1 -0
- package/dist/verify-apply.js +36 -0
- package/dist/verify-apply.js.map +1 -0
- package/dist/verify-cmd.d.ts +44 -0
- package/dist/verify-cmd.d.ts.map +1 -0
- package/dist/verify-cmd.js +125 -0
- package/dist/verify-cmd.js.map +1 -0
- package/dist/verify-pass.d.ts +73 -0
- package/dist/verify-pass.d.ts.map +1 -0
- package/dist/verify-pass.js +103 -0
- package/dist/verify-pass.js.map +1 -0
- package/dist/welcome.d.ts +43 -0
- package/dist/welcome.d.ts.map +1 -0
- package/dist/welcome.js +116 -0
- package/dist/welcome.js.map +1 -0
- package/dist/workspace-provisioner.d.ts +65 -0
- package/dist/workspace-provisioner.d.ts.map +1 -0
- package/dist/workspace-provisioner.js +66 -0
- package/dist/workspace-provisioner.js.map +1 -0
- package/dist/workspace-quarantine.d.ts +64 -0
- package/dist/workspace-quarantine.d.ts.map +1 -0
- package/dist/workspace-quarantine.js +156 -0
- package/dist/workspace-quarantine.js.map +1 -0
- package/dist/workspace-residue-sweep.d.ts +113 -0
- package/dist/workspace-residue-sweep.d.ts.map +1 -0
- package/dist/workspace-residue-sweep.js +158 -0
- package/dist/workspace-residue-sweep.js.map +1 -0
- package/dist/workspace.d.ts +639 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +2026 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +52 -4
- package/win/CredProbe.cs +64 -0
- package/win/FakeClaude.cs +56 -0
- package/win/HandleProbe.cs +116 -0
- package/win/TokenProbe.cs +53 -0
- package/win/appcontainer.ps1 +500 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MAX_MCP_LINE_CHARS = exports.MCP_SERVER_NAME = exports.MCP_PROTOCOL_VERSION = void 0;
|
|
4
|
+
exports.qualifiedToolName = qualifiedToolName;
|
|
5
|
+
exports.makeMcpServer = makeMcpServer;
|
|
6
|
+
exports.lineSplitter = lineSplitter;
|
|
7
|
+
const tool_protocol_1 = require("./tool-protocol");
|
|
8
|
+
const core_1 = require("@looply/core");
|
|
9
|
+
/**
|
|
10
|
+
* THE PROTOCOL THE PROVIDER ALREADY SPEAKS.
|
|
11
|
+
*
|
|
12
|
+
* The provider transport runs outside the container and holds the model; the
|
|
13
|
+
* tools it may call are served from here, over its own MCP client. That choice
|
|
14
|
+
* is what keeps ONE provider invocation one provider invocation: the model can
|
|
15
|
+
* call twenty tools inside a single session, and none of them costs another
|
|
16
|
+
* model call.
|
|
17
|
+
*
|
|
18
|
+
* The alternative — ask the model for one tool request, kill it, run the tool,
|
|
19
|
+
* ask again — would multiply provider calls, change what a round costs and
|
|
20
|
+
* break the Phase-6 assumption that a round's budget counts invocations.
|
|
21
|
+
*
|
|
22
|
+
* JSON-RPC 2.0, newline-delimited, over stdio. No port, no listener, no
|
|
23
|
+
* ambient IPC anyone else on this machine could reach: the server lives and
|
|
24
|
+
* dies with the pipe the provider handed it.
|
|
25
|
+
*
|
|
26
|
+
* IMPLEMENTED HERE RATHER THAN TAKEN AS A DEPENDENCY. The surface actually
|
|
27
|
+
* needed is `initialize`, `tools/list` and `tools/call`, and adding a package
|
|
28
|
+
* to the tree to get three methods would be a supply-chain decision taken for
|
|
29
|
+
* convenience.
|
|
30
|
+
*/
|
|
31
|
+
exports.MCP_PROTOCOL_VERSION = '2024-11-05';
|
|
32
|
+
exports.MCP_SERVER_NAME = 'looply';
|
|
33
|
+
/** How the provider will name these tools once it has them. */
|
|
34
|
+
function qualifiedToolName(tool) {
|
|
35
|
+
return `mcp__${exports.MCP_SERVER_NAME}__${tool}`;
|
|
36
|
+
}
|
|
37
|
+
const SCHEMAS = {
|
|
38
|
+
read: {
|
|
39
|
+
description: 'Read a UTF-8 text file from the project. Paths are project-relative. Large files come back truncated.',
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: 'object',
|
|
42
|
+
properties: {
|
|
43
|
+
path: { type: 'string', description: 'Project-relative path.' },
|
|
44
|
+
fromLine: { type: 'integer', minimum: 1, description: 'First line, 1-based and inclusive.' },
|
|
45
|
+
toLine: { type: 'integer', minimum: 1, description: 'Last line, 1-based and inclusive.' },
|
|
46
|
+
},
|
|
47
|
+
required: ['path'],
|
|
48
|
+
additionalProperties: false,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
glob: {
|
|
52
|
+
description: 'List project files matching a glob such as "src/**/*.ts". Paths are project-relative.',
|
|
53
|
+
inputSchema: {
|
|
54
|
+
type: 'object',
|
|
55
|
+
properties: {
|
|
56
|
+
pattern: { type: 'string' },
|
|
57
|
+
under: { type: 'string', description: 'Project-relative subdirectory to search under.' },
|
|
58
|
+
},
|
|
59
|
+
required: ['pattern'],
|
|
60
|
+
additionalProperties: false,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
grep: {
|
|
64
|
+
description: 'Search project files for a regular expression. Returns "path:line:text", bounded in number.',
|
|
65
|
+
inputSchema: {
|
|
66
|
+
type: 'object',
|
|
67
|
+
properties: {
|
|
68
|
+
pattern: { type: 'string', description: 'A JavaScript regular expression.' },
|
|
69
|
+
include: { type: 'string', description: 'Only search paths matching this glob.' },
|
|
70
|
+
under: { type: 'string' },
|
|
71
|
+
ignoreCase: { type: 'boolean' },
|
|
72
|
+
},
|
|
73
|
+
required: ['pattern'],
|
|
74
|
+
additionalProperties: false,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
edit: {
|
|
78
|
+
description: 'Replace exact text in a project file. The edit states how many occurrences it expects and fails if the file does not match, so re-applying it is safe.',
|
|
79
|
+
inputSchema: {
|
|
80
|
+
type: 'object',
|
|
81
|
+
properties: {
|
|
82
|
+
path: { type: 'string' },
|
|
83
|
+
oldText: { type: 'string', description: 'The exact text as it is now.' },
|
|
84
|
+
newText: { type: 'string' },
|
|
85
|
+
expected: { type: 'integer', minimum: 1, description: 'Occurrences expected. Defaults to 1.' },
|
|
86
|
+
},
|
|
87
|
+
required: ['path', 'oldText', 'newText'],
|
|
88
|
+
additionalProperties: false,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
write: {
|
|
92
|
+
description: 'Write a whole UTF-8 text file in the project. "create" refuses to overwrite; "overwrite" requires the file to exist.',
|
|
93
|
+
inputSchema: {
|
|
94
|
+
type: 'object',
|
|
95
|
+
properties: {
|
|
96
|
+
path: { type: 'string' },
|
|
97
|
+
contents: { type: 'string', maxLength: tool_protocol_1.LIMITS.writeBytes },
|
|
98
|
+
intent: { type: 'string', enum: ['create', 'overwrite'] },
|
|
99
|
+
},
|
|
100
|
+
required: ['path', 'contents', 'intent'],
|
|
101
|
+
additionalProperties: false,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* One MCP session over a line-oriented transport.
|
|
107
|
+
*
|
|
108
|
+
* `handleLine` is deliberately the whole surface: it takes one JSON-RPC message
|
|
109
|
+
* and produces whatever should be sent back, which makes the protocol testable
|
|
110
|
+
* without a process, a pipe or a provider.
|
|
111
|
+
*/
|
|
112
|
+
function makeMcpServer(bridge, policy, deps) {
|
|
113
|
+
const reply = (id, result) => {
|
|
114
|
+
deps.send(JSON.stringify({ jsonrpc: '2.0', id, result }));
|
|
115
|
+
};
|
|
116
|
+
const replyError = (id, code, message) => {
|
|
117
|
+
deps.send(JSON.stringify({ jsonrpc: '2.0', id, error: { code, message } }));
|
|
118
|
+
};
|
|
119
|
+
const handleLine = async (line) => {
|
|
120
|
+
const trimmed = line.trim();
|
|
121
|
+
if (trimmed.length === 0)
|
|
122
|
+
return;
|
|
123
|
+
let msg;
|
|
124
|
+
try {
|
|
125
|
+
msg = JSON.parse(trimmed);
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
// No id to answer against, so there is nobody to tell. Dropping a
|
|
129
|
+
// malformed frame is the only thing JSON-RPC allows here.
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const id = msg.id ?? null;
|
|
133
|
+
const method = msg.method ?? '';
|
|
134
|
+
if (method === 'initialize') {
|
|
135
|
+
reply(id, {
|
|
136
|
+
protocolVersion: exports.MCP_PROTOCOL_VERSION,
|
|
137
|
+
capabilities: { tools: {} },
|
|
138
|
+
serverInfo: { name: exports.MCP_SERVER_NAME, version: '1.0.0' },
|
|
139
|
+
});
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
// Notifications carry no id and get no answer, by the specification.
|
|
143
|
+
if (method.startsWith('notifications/'))
|
|
144
|
+
return;
|
|
145
|
+
if (method === 'tools/list') {
|
|
146
|
+
reply(id, {
|
|
147
|
+
tools: tool_protocol_1.TOOL_NAMES.filter((t) => policy.tools.includes(t)).map((t) => ({
|
|
148
|
+
name: t,
|
|
149
|
+
description: SCHEMAS[t].description,
|
|
150
|
+
inputSchema: SCHEMAS[t].inputSchema,
|
|
151
|
+
})),
|
|
152
|
+
});
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (method === 'tools/call') {
|
|
156
|
+
const params = msg.params ?? {};
|
|
157
|
+
const name = String(params['name'] ?? '');
|
|
158
|
+
const args = (params['arguments'] ?? {});
|
|
159
|
+
// The tool name is a MODEL-SUPPLIED STRING. It selects among the tools
|
|
160
|
+
// this role has, and nothing else: it cannot name an executable, a root,
|
|
161
|
+
// or a tool the policy withheld.
|
|
162
|
+
const out = await bridge.call({ ...args, tool: name });
|
|
163
|
+
if (out.ok) {
|
|
164
|
+
/**
|
|
165
|
+
* THE LAST TRUSTED POINT BEFORE THE MODEL, which is why the note is added
|
|
166
|
+
* here and not in the worker — the worker runs inside the container.
|
|
167
|
+
*
|
|
168
|
+
* Two things the transport does not say (the audit’s A-09): whose words
|
|
169
|
+
* these are, and whether they were cut short. `truncated` was computed by
|
|
170
|
+
* the worker for every result that can overrun a limit and then dropped on
|
|
171
|
+
* this line, so a file that stopped at the limit read exactly like a file
|
|
172
|
+
* that ended.
|
|
173
|
+
*
|
|
174
|
+
* ⚠️ The record M7-2 keeps is written from the RESPONSE, upstream of this,
|
|
175
|
+
* so it still reports what the file served rather than what the note added.
|
|
176
|
+
*/
|
|
177
|
+
reply(id, {
|
|
178
|
+
content: [{ type: 'text', text: (0, core_1.servedText)(out) }],
|
|
179
|
+
isError: false,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
// A REFUSAL IS A RESULT, not a transport error. The model is meant to
|
|
184
|
+
// be told "no" and carry on; a JSON-RPC error would end the session
|
|
185
|
+
// instead, and an agent that cannot be refused is an agent that must
|
|
186
|
+
// never be wrong.
|
|
187
|
+
reply(id, {
|
|
188
|
+
content: [{ type: 'text', text: `${out.code}: ${out.because}` }],
|
|
189
|
+
isError: true,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (id !== null)
|
|
195
|
+
replyError(id, -32601, `no such method: ${method}`);
|
|
196
|
+
};
|
|
197
|
+
return { handleLine };
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* How long one protocol line may get before it is refused.
|
|
201
|
+
*
|
|
202
|
+
* 🔴 THE BUFFER WAS UNBOUNDED, AND THE PEER IS THE UNCONTAINED PROVIDER.
|
|
203
|
+
*
|
|
204
|
+
* `held` grew with every chunk and was only ever drained by a newline, so a
|
|
205
|
+
* peer that sends bytes and never a newline grows the TRUSTED bridge's heap
|
|
206
|
+
* until it dies. Everything else about this transport is careful — the model
|
|
207
|
+
* gets no host tools, every tool call executes inside a container — and none of
|
|
208
|
+
* that helps against a peer that simply never stops talking.
|
|
209
|
+
*
|
|
210
|
+
* A megabyte, from the shape of the traffic rather than from taste: a line here
|
|
211
|
+
* is one JSON-RPC message, and the largest real one is a tool RESULT carrying
|
|
212
|
+
* at most `LIMITS.readBytes` (256 KB) of file content plus its envelope. Four
|
|
213
|
+
* times the largest legitimate message.
|
|
214
|
+
*/
|
|
215
|
+
exports.MAX_MCP_LINE_CHARS = 1024 * 1024;
|
|
216
|
+
/**
|
|
217
|
+
* Split a growing buffer into complete lines, keeping the remainder.
|
|
218
|
+
*
|
|
219
|
+
* 🔴 A LINE OVER THE BOUND IS DISCARDED, NOT TRUNCATED AND NOT FATAL.
|
|
220
|
+
*
|
|
221
|
+
* Truncating would hand the parser half a JSON message, which is a different
|
|
222
|
+
* message rather than a shorter one. Throwing would let a peer kill the bridge
|
|
223
|
+
* by sending one long line — trading a memory exhaustion for a denial of
|
|
224
|
+
* service. So the splitter drops the oversized line, RESYNCHRONISES at the next
|
|
225
|
+
* newline, and says it happened; the peer's other messages keep working.
|
|
226
|
+
*/
|
|
227
|
+
function lineSplitter(maxChars = exports.MAX_MCP_LINE_CHARS, onOverflow) {
|
|
228
|
+
let held = '';
|
|
229
|
+
// True while discarding the remainder of a line that already went over.
|
|
230
|
+
let skipping = false;
|
|
231
|
+
return (chunk) => {
|
|
232
|
+
held += chunk;
|
|
233
|
+
const out = [];
|
|
234
|
+
for (;;) {
|
|
235
|
+
const nl = held.indexOf(String.fromCharCode(10));
|
|
236
|
+
if (nl === -1)
|
|
237
|
+
break;
|
|
238
|
+
const line = held.slice(0, nl);
|
|
239
|
+
held = held.slice(nl + 1);
|
|
240
|
+
if (skipping) {
|
|
241
|
+
// The tail of an oversized line. Its start is already gone, so the rest
|
|
242
|
+
// is not a message and must not be handed on as one.
|
|
243
|
+
skipping = false;
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
out.push(line);
|
|
247
|
+
}
|
|
248
|
+
if (held.length > maxChars) {
|
|
249
|
+
// No newline in sight and already over: drop what is held and keep
|
|
250
|
+
// dropping until one arrives.
|
|
251
|
+
if (!skipping)
|
|
252
|
+
onOverflow?.(held.length);
|
|
253
|
+
skipping = true;
|
|
254
|
+
held = '';
|
|
255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AE,MAAM;YACrB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC/B,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;YAC1B,IAAI,QAAQ,EAAE,CAAC;gBACb,wEAAwE;gBACxE,qDAAqD;gBACrD,QAAQ,GAAG,KAAK,CAAC;gBACjB,SAAS;YACX,CAAC;YACD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,GAAG,QAAQ,EAAE,CAAC;YAC3B,mEAAmE;YACnE,8BAA8B;YAC9B,IAAI,CAAC,QAAQ;gBAAE,UAAU,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACzC,QAAQ,GAAG,IAAI,CAAC;YAChB,IAAI,GAAG,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WHICH MODEL EACH ROLE RUNS, AND HOW HARD.
|
|
3
|
+
*
|
|
4
|
+
* Four roles drive a model: the implementer writes the change, the verifier
|
|
5
|
+
* checks an item against the code, the scanner fills the queue, and the brain
|
|
6
|
+
* plans — compiling a goal, judging a goal gap. Until this existed every one of
|
|
7
|
+
* them ran whatever the provider's own default happened to be: `claudeMediatedArgv`
|
|
8
|
+
* passed no `--model` at all, so a configuration file had no way to say that a
|
|
9
|
+
* round's three agents and the planner should be different models, or that a
|
|
10
|
+
* round should think as hard as it can.
|
|
11
|
+
*
|
|
12
|
+
* ⚠️ THE BUILT-IN PROVIDER ONLY. These become `--model` and `--effort` on the
|
|
13
|
+
* mediated Claude Code invocation. A configured `agent.command` is somebody
|
|
14
|
+
* else's binary and looply cannot guess the flag it takes for a model — exactly
|
|
15
|
+
* the reason `agent.no_host_tools` has to be declared rather than inferred — so
|
|
16
|
+
* for that branch this is documented as ignored, the way `agent.executable` is.
|
|
17
|
+
*
|
|
18
|
+
* 🔴 FABLE IS THE BRAIN, NEVER AN AGENT. The operator's standing rule, and a
|
|
19
|
+
* cost rule with a shape: the brain runs rarely and is where the most capable
|
|
20
|
+
* model earns its price; an agent turn runs every round of a 400-round night,
|
|
21
|
+
* and Fable bills at twice Opus per token. A file that names a Fable model for
|
|
22
|
+
* `default`, `implementer`, `verifier` or `scanner` is refused at config-load
|
|
23
|
+
* time, before a run starts, with the reason — not at round one after the first
|
|
24
|
+
* call has been paid for.
|
|
25
|
+
*/
|
|
26
|
+
/** The roles that drive a model, in the order a round meets them. */
|
|
27
|
+
export declare const MODEL_ROLES: readonly ["implementer", "verifier", "scanner", "brain"];
|
|
28
|
+
export type ModelRole = (typeof MODEL_ROLES)[number];
|
|
29
|
+
/** The keys `agent.models` may carry: every role, plus the one that covers the rest. */
|
|
30
|
+
export declare const MODEL_KEYS: readonly ["default", "implementer", "verifier", "scanner", "brain"];
|
|
31
|
+
export type ModelKey = (typeof MODEL_KEYS)[number];
|
|
32
|
+
/** `--effort`, as Claude Code spells it. Checked against `claude --help` on 2026-09-13. */
|
|
33
|
+
export declare const EFFORT_LEVELS: readonly ["low", "medium", "high", "xhigh", "max"];
|
|
34
|
+
export type Effort = (typeof EFFORT_LEVELS)[number];
|
|
35
|
+
/**
|
|
36
|
+
* Role → model id. `default` covers any role not named; a role named here wins.
|
|
37
|
+
* Every value is one model id, passed as one argument — never a flag string.
|
|
38
|
+
*/
|
|
39
|
+
export type RoleModels = Partial<Record<ModelKey, string>>;
|
|
40
|
+
/**
|
|
41
|
+
* Which model ids may only be the brain's.
|
|
42
|
+
*
|
|
43
|
+
* Matched on the family name rather than pinned to one id, so a later Fable
|
|
44
|
+
* release is covered the day it ships rather than the day somebody remembers
|
|
45
|
+
* this list. Case-insensitive because a model id is not, and a person typing
|
|
46
|
+
* one should not be able to step around a cost rule with a capital letter.
|
|
47
|
+
*/
|
|
48
|
+
export declare function isBrainOnlyModel(model: string): boolean;
|
|
49
|
+
/** The model a role runs under this configuration, or undefined to leave it to the provider. */
|
|
50
|
+
export declare function modelFor(role: ModelRole, models: RoleModels | undefined): string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* The arguments that put a role on its model, ready to splice into a Claude
|
|
53
|
+
* Code command line. Empty when nothing is configured, so a project that says
|
|
54
|
+
* nothing about models produces the byte-identical invocation it did before.
|
|
55
|
+
*/
|
|
56
|
+
export declare function modelArgs(role: ModelRole, spec: {
|
|
57
|
+
models?: RoleModels;
|
|
58
|
+
effort?: Effort;
|
|
59
|
+
}): string[];
|
|
60
|
+
export type RoleModelsCheck = {
|
|
61
|
+
ok: true;
|
|
62
|
+
} | {
|
|
63
|
+
ok: false;
|
|
64
|
+
key: string;
|
|
65
|
+
because: string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Is this `agent.models` block one looply will drive?
|
|
69
|
+
*
|
|
70
|
+
* Pure, so `parseConfig` can refuse the file and `looply doctor` can name the
|
|
71
|
+
* key, from one rule. Each refusal names the exact key, because "invalid
|
|
72
|
+
* agent.models" is a sentence nobody can act on.
|
|
73
|
+
*/
|
|
74
|
+
export declare function checkRoleModels(models: RoleModels): RoleModelsCheck;
|
|
75
|
+
//# sourceMappingURL=model-routing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-routing.d.ts","sourceRoot":"","sources":["../src/model-routing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,qEAAqE;AACrE,eAAO,MAAM,WAAW,0DAA2D,CAAC;AACpF,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,wFAAwF;AACxF,eAAO,MAAM,UAAU,qEAAuC,CAAC;AAC/D,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,2FAA2F;AAC3F,eAAO,MAAM,aAAa,oDAAqD,CAAC;AAChF,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAE3D;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,gGAAgG;AAChG,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAE5F;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,SAAS,EACf,IAAI,EAAE;IAAE,MAAM,CAAC,EAAE,UAAU,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7C,MAAM,EAAE,CAMV;AAED,MAAM,MAAM,eAAe,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzF;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,eAAe,CAiCnE"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* WHICH MODEL EACH ROLE RUNS, AND HOW HARD.
|
|
4
|
+
*
|
|
5
|
+
* Four roles drive a model: the implementer writes the change, the verifier
|
|
6
|
+
* checks an item against the code, the scanner fills the queue, and the brain
|
|
7
|
+
* plans — compiling a goal, judging a goal gap. Until this existed every one of
|
|
8
|
+
* them ran whatever the provider's own default happened to be: `claudeMediatedArgv`
|
|
9
|
+
* passed no `--model` at all, so a configuration file had no way to say that a
|
|
10
|
+
* round's three agents and the planner should be different models, or that a
|
|
11
|
+
* round should think as hard as it can.
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ THE BUILT-IN PROVIDER ONLY. These become `--model` and `--effort` on the
|
|
14
|
+
* mediated Claude Code invocation. A configured `agent.command` is somebody
|
|
15
|
+
* else's binary and looply cannot guess the flag it takes for a model — exactly
|
|
16
|
+
* the reason `agent.no_host_tools` has to be declared rather than inferred — so
|
|
17
|
+
* for that branch this is documented as ignored, the way `agent.executable` is.
|
|
18
|
+
*
|
|
19
|
+
* 🔴 FABLE IS THE BRAIN, NEVER AN AGENT. The operator's standing rule, and a
|
|
20
|
+
* cost rule with a shape: the brain runs rarely and is where the most capable
|
|
21
|
+
* model earns its price; an agent turn runs every round of a 400-round night,
|
|
22
|
+
* and Fable bills at twice Opus per token. A file that names a Fable model for
|
|
23
|
+
* `default`, `implementer`, `verifier` or `scanner` is refused at config-load
|
|
24
|
+
* time, before a run starts, with the reason — not at round one after the first
|
|
25
|
+
* call has been paid for.
|
|
26
|
+
*/
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.EFFORT_LEVELS = exports.MODEL_KEYS = exports.MODEL_ROLES = void 0;
|
|
29
|
+
exports.isBrainOnlyModel = isBrainOnlyModel;
|
|
30
|
+
exports.modelFor = modelFor;
|
|
31
|
+
exports.modelArgs = modelArgs;
|
|
32
|
+
exports.checkRoleModels = checkRoleModels;
|
|
33
|
+
/** The roles that drive a model, in the order a round meets them. */
|
|
34
|
+
exports.MODEL_ROLES = ['implementer', 'verifier', 'scanner', 'brain'];
|
|
35
|
+
/** The keys `agent.models` may carry: every role, plus the one that covers the rest. */
|
|
36
|
+
exports.MODEL_KEYS = ['default', ...exports.MODEL_ROLES];
|
|
37
|
+
/** `--effort`, as Claude Code spells it. Checked against `claude --help` on 2026-09-13. */
|
|
38
|
+
exports.EFFORT_LEVELS = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
39
|
+
/**
|
|
40
|
+
* Which model ids may only be the brain's.
|
|
41
|
+
*
|
|
42
|
+
* Matched on the family name rather than pinned to one id, so a later Fable
|
|
43
|
+
* release is covered the day it ships rather than the day somebody remembers
|
|
44
|
+
* this list. Case-insensitive because a model id is not, and a person typing
|
|
45
|
+
* one should not be able to step around a cost rule with a capital letter.
|
|
46
|
+
*/
|
|
47
|
+
function isBrainOnlyModel(model) {
|
|
48
|
+
return /fable/i.test(model);
|
|
49
|
+
}
|
|
50
|
+
/** The model a role runs under this configuration, or undefined to leave it to the provider. */
|
|
51
|
+
function modelFor(role, models) {
|
|
52
|
+
return models?.[role] ?? models?.default;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The arguments that put a role on its model, ready to splice into a Claude
|
|
56
|
+
* Code command line. Empty when nothing is configured, so a project that says
|
|
57
|
+
* nothing about models produces the byte-identical invocation it did before.
|
|
58
|
+
*/
|
|
59
|
+
function modelArgs(role, spec) {
|
|
60
|
+
const out = [];
|
|
61
|
+
const model = modelFor(role, spec.models);
|
|
62
|
+
if (model !== undefined)
|
|
63
|
+
out.push('--model', model);
|
|
64
|
+
if (spec.effort !== undefined)
|
|
65
|
+
out.push('--effort', spec.effort);
|
|
66
|
+
return out;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Is this `agent.models` block one looply will drive?
|
|
70
|
+
*
|
|
71
|
+
* Pure, so `parseConfig` can refuse the file and `looply doctor` can name the
|
|
72
|
+
* key, from one rule. Each refusal names the exact key, because "invalid
|
|
73
|
+
* agent.models" is a sentence nobody can act on.
|
|
74
|
+
*/
|
|
75
|
+
function checkRoleModels(models) {
|
|
76
|
+
for (const [key, model] of Object.entries(models)) {
|
|
77
|
+
if (!exports.MODEL_KEYS.includes(key)) {
|
|
78
|
+
return {
|
|
79
|
+
ok: false,
|
|
80
|
+
key: `agent.models.${key}`,
|
|
81
|
+
because: `unknown role "${key}" — one of ${exports.MODEL_KEYS.join(', ')}`,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
if (typeof model !== 'string' || model.trim() === '') {
|
|
85
|
+
return { ok: false, key: `agent.models.${key}`, because: 'must be a model id' };
|
|
86
|
+
}
|
|
87
|
+
// One argument. A value with a space in it is a flag string somebody hoped
|
|
88
|
+
// would be split, and `spawn` does not split.
|
|
89
|
+
if (/\s/.test(model)) {
|
|
90
|
+
return {
|
|
91
|
+
ok: false,
|
|
92
|
+
key: `agent.models.${key}`,
|
|
93
|
+
because: `must be a single model id, not "${model}" — it is passed as one argument`,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
if (key !== 'brain' && isBrainOnlyModel(model)) {
|
|
97
|
+
return {
|
|
98
|
+
ok: false,
|
|
99
|
+
key: `agent.models.${key}`,
|
|
100
|
+
because: `names ${model}, which looply runs only as the brain. ` +
|
|
101
|
+
'An agent turn runs every round; the brain plans, rarely, and is where that model ' +
|
|
102
|
+
'earns its price. Name it under agent.models.brain and give the agents an Opus-tier model.',
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return { ok: true };
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=model-routing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-routing.js","sourceRoot":"","sources":["../src/model-routing.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;AA4BH,4CAEC;AAGD,4BAEC;AAOD,8BASC;AAWD,0CAiCC;AA7FD,qEAAqE;AACxD,QAAA,WAAW,GAAG,CAAC,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,CAAU,CAAC;AAGpF,wFAAwF;AAC3E,QAAA,UAAU,GAAG,CAAC,SAAS,EAAE,GAAG,mBAAW,CAAU,CAAC;AAG/D,2FAA2F;AAC9E,QAAA,aAAa,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAU,CAAC;AAShF;;;;;;;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E,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC;QAClF,CAAC;QACD,2EAA2E;QAC3E,8CAA8C;QAC9C,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,GAAG,EAAE,gBAAgB,GAAG,EAAE;gBAC1B,OAAO,EAAE,mCAAmC,KAAK,kCAAkC;aACpF,CAAC;QACJ,CAAC;QACD,IAAI,GAAG,KAAK,OAAO,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/C,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,GAAG,EAAE,gBAAgB,GAAG,EAAE;gBAC1B,OAAO,EACL,SAAS,KAAK,yCAAyC;oBACvD,mFAAmF;oBACnF,2FAA2F;aAC9F,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { type AgentInvoke, type AgentSpec } from './agent-exec';
|
|
3
|
+
import { checkProviderAuth } from './provider-state';
|
|
4
|
+
import { type ToolRole } from './tool-bridge';
|
|
5
|
+
import type { OwnedChildren } from './owned-children';
|
|
6
|
+
/**
|
|
7
|
+
* THE MODEL RUNS HERE; THE MODEL'S TOOLS DO NOT.
|
|
8
|
+
*
|
|
9
|
+
* Two phases of work established that the packaged provider cannot run inside
|
|
10
|
+
* an AppContainer — it spawns a child with piped stdio during startup, libuv
|
|
11
|
+
* implements that as a named pipe, and a container cannot create one — and that
|
|
12
|
+
* a restricted token cannot withhold the user's own files. So the provider
|
|
13
|
+
* process runs as the daemon user, and the boundary moves off the process and
|
|
14
|
+
* onto the CAPABILITY:
|
|
15
|
+
*
|
|
16
|
+
* the model gets no host tools at all. Every capability it can call is a
|
|
17
|
+
* Looply MCP tool, and each of those executes inside the container.
|
|
18
|
+
*
|
|
19
|
+
* WHAT THIS DOES AND DOES NOT CLAIM. It does not claim the provider binary is
|
|
20
|
+
* sandboxed — it is not, and a hostile provider executable could read what the
|
|
21
|
+
* user can read. That is supply-chain containment and belongs to a later phase.
|
|
22
|
+
* What is true here is narrower and is the Phase-7 property: model-callable
|
|
23
|
+
* authority is mediated, and Looply hands the transport no governed credential
|
|
24
|
+
* through its environment, arguments, configuration, working directory, or tool
|
|
25
|
+
* surface.
|
|
26
|
+
*
|
|
27
|
+
* THE FIVE CHANNELS. Those are the five ways authority could leak from Looply
|
|
28
|
+
* into the transport, and each is closed deliberately here: the environment is
|
|
29
|
+
* built up rather than inherited, the arguments carry no secret, the MCP config
|
|
30
|
+
* names only our own bridge, the working directory is sterile, and the provider
|
|
31
|
+
* state is a credential copy and nothing else.
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* How much of the transport's own output the daemon will hold.
|
|
35
|
+
*
|
|
36
|
+
* 🔴 THE PROVIDER IS THE UNCONTAINED PROCESS, AND THIS WAS UNBOUNDED. Every
|
|
37
|
+
* chunk of its stdout and stderr was appended to one string with no ceiling, so
|
|
38
|
+
* the process this phase is ABOUT could exhaust the daemon's memory by talking.
|
|
39
|
+
* The container bounds what a contained child hands back; nothing bounded this,
|
|
40
|
+
* and this is the one that is not contained.
|
|
41
|
+
*
|
|
42
|
+
* ⚠️ THE TAIL IS WHAT MATTERS HERE, WHICH IS THE OPPOSITE OF THE CONTAINED CASE.
|
|
43
|
+
* A provider's answer is its LAST line — the JSON envelope readers parse with
|
|
44
|
+
* `.filter(startsWith('{')).pop()` — so dropping the front preserves the answer
|
|
45
|
+
* and dropping the back would destroy it. A gate step is the other way round,
|
|
46
|
+
* and `untrusted-exec.ts` keeps both ends for that reason.
|
|
47
|
+
*/
|
|
48
|
+
export declare const MAX_TRANSPORT_OUTPUT_CHARS: number;
|
|
49
|
+
/** How the model's tool calls reach Looply. */
|
|
50
|
+
export interface McpLaunch {
|
|
51
|
+
/** The server name the provider will qualify tool names with. */
|
|
52
|
+
name: string;
|
|
53
|
+
command: string;
|
|
54
|
+
args: readonly string[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The provider's working directory: somewhere with nothing in it.
|
|
58
|
+
*
|
|
59
|
+
* NOT THE PROJECT, and this is load-bearing rather than tidy. Even with every
|
|
60
|
+
* built-in tool disabled, a coding CLI discovers things about the directory it
|
|
61
|
+
* starts in — configuration, ignore files, repository state. The transport is
|
|
62
|
+
* meant to learn about the project through the prompt and through tool results,
|
|
63
|
+
* and through nothing else, so it is started somewhere that has no project in
|
|
64
|
+
* it to discover.
|
|
65
|
+
*
|
|
66
|
+
* Per project and per role, so two sessions never share provider state.
|
|
67
|
+
*/
|
|
68
|
+
export declare function providerSessionDir(projectDir: string, role: ToolRole, home?: string): string;
|
|
69
|
+
/** The MCP configuration the provider is given: exactly one server, ours. */
|
|
70
|
+
export declare function mcpConfigJson(launch: McpLaunch): string;
|
|
71
|
+
/**
|
|
72
|
+
* Where the bridge entry point lives.
|
|
73
|
+
*
|
|
74
|
+
* Beside this file once compiled. Under the test runner this module is loaded
|
|
75
|
+
* from `src`, where there is no compiled entry — and it must be the compiled
|
|
76
|
+
* one either way, since that is what the provider will actually spawn. Falling
|
|
77
|
+
* back to the sibling `dist` keeps the tests driving production's artefact.
|
|
78
|
+
*/
|
|
79
|
+
export declare function mcpMainPath(deps?: ModelTransportDeps): string;
|
|
80
|
+
export interface ModelTransportDeps {
|
|
81
|
+
/**
|
|
82
|
+
* The run these invocations belong to, so its budget reservation can be
|
|
83
|
+
* settled at what it ACTUALLY cost rather than left to expire at an estimate.
|
|
84
|
+
*
|
|
85
|
+
* Absent for a `scan` or a `verify`, which are charged as themselves.
|
|
86
|
+
*/
|
|
87
|
+
runId?: string;
|
|
88
|
+
/** Overridable so tests can drive a fake MCP-capable provider. */
|
|
89
|
+
packageDir?: string | null;
|
|
90
|
+
mcpMain?: string;
|
|
91
|
+
/** The node that runs the trusted bridge. Defaults to the daemon's own. */
|
|
92
|
+
bridgeNode?: string;
|
|
93
|
+
home?: string;
|
|
94
|
+
format?: 'text' | 'json';
|
|
95
|
+
now?: () => number;
|
|
96
|
+
spawnFn?: typeof spawn;
|
|
97
|
+
/** Overridable so a test can drive the built-in branch without a real provider login. */
|
|
98
|
+
checkAuth?: typeof checkProviderAuth;
|
|
99
|
+
/** Overridable for tests; production reads the platform's own shell. */
|
|
100
|
+
shell?: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The command line for one mediated turn.
|
|
104
|
+
*
|
|
105
|
+
* `--tools ""` is the mechanism that matters, and it was read off the installed
|
|
106
|
+
* CLI rather than assumed: it takes the list of available tools FROM THE
|
|
107
|
+
* BUILT-IN SET, and an empty value disables all of them. Without it the model
|
|
108
|
+
* would keep its own Read, Write, Edit, Glob, Grep and Bash, every one of which
|
|
109
|
+
* runs as the daemon, and the entire bridge would be decoration beside them.
|
|
110
|
+
*
|
|
111
|
+
* `--strict-mcp-config` then makes the supplied configuration the only one, so
|
|
112
|
+
* no server from the user's profile or a plugin becomes a capability by
|
|
113
|
+
* accident.
|
|
114
|
+
*/
|
|
115
|
+
/**
|
|
116
|
+
* Whether `spec` names the built-in provider — the one whose `--output-format
|
|
117
|
+
* json` envelope is written by the CLI around the model's text, rather than a
|
|
118
|
+
* configured command whose whole stdout is the model's to write. Only the
|
|
119
|
+
* former's envelope is read for cost, and only the former's is unwrapped by the
|
|
120
|
+
* round; a configured provider is driven exactly as it always was.
|
|
121
|
+
*/
|
|
122
|
+
export declare function isBuiltInProvider(spec: AgentSpec): boolean;
|
|
123
|
+
export declare function claudeMediatedArgv(launch: McpLaunch, format: 'text' | 'json'): string[];
|
|
124
|
+
/**
|
|
125
|
+
* Names the model is allowed to call, spelled the way the provider spells them.
|
|
126
|
+
*
|
|
127
|
+
* Belt and braces beside `--tools ""`: if a future version changed what an
|
|
128
|
+
* empty built-in set means, this still names the only acceptable surface.
|
|
129
|
+
*/
|
|
130
|
+
export declare function allowedToolArgs(role: ToolRole, launch: McpLaunch): string[];
|
|
131
|
+
/**
|
|
132
|
+
* What the BUILT-IN provider is told about how it may load its tools.
|
|
133
|
+
*
|
|
134
|
+
* 🔴 WITHOUT THIS THE MODEL HAD NO TOOLS, AND SAID SO WITH FABRICATIONS.
|
|
135
|
+
* Claude Code can DEFER MCP tool schemas behind its own built-in `ToolSearch`
|
|
136
|
+
* tool, loading them only when the model asks. Looply passes `--tools ""`,
|
|
137
|
+
* which removes every built-in — `ToolSearch` with them — so a deferred
|
|
138
|
+
* `mcp__looply__read` was listed and could never be called. The switch is
|
|
139
|
+
* remote: the provider's cached flag `tengu_deferred_stub_tool` flipped on
|
|
140
|
+
* under an UNCHANGED 2.1.208 binary and an unchanged argv.
|
|
141
|
+
*
|
|
142
|
+
* MEASURED, LIVE, 2026-09-24: across 95 provider sessions on this profile,
|
|
143
|
+
* every tool-using session was from 2026-09-15; today three verifier turns in
|
|
144
|
+
* a row called nothing. Two narrated a tool call as text ("⚡ Tool use:
|
|
145
|
+
* Bash", then a fabricated `<system-reminder>`) and returned no verdict; the
|
|
146
|
+
* third, run straight into the binary with the seam out of the path, answered
|
|
147
|
+
* `stale` citing `src/split.ts:1` — a file that does not exist anywhere in
|
|
148
|
+
* the tree. A verifier that invents its evidence is worse than one that fails.
|
|
149
|
+
*
|
|
150
|
+
* `ENABLE_TOOL_SEARCH=false` is the binary's own switch back to "standard":
|
|
151
|
+
* MCP tools loaded up front, as they were. It adds NO host tool — the
|
|
152
|
+
* alternative, letting `ToolSearch` through `--tools`, would be the first
|
|
153
|
+
* built-in the mediated provider was ever allowed.
|
|
154
|
+
*
|
|
155
|
+
* ⚠️ BUILT-IN ONLY. A configured provider is somebody else's binary; it
|
|
156
|
+
* declares how its own tools are turned off (`no_host_tools`) and is told
|
|
157
|
+
* nothing it did not ask for.
|
|
158
|
+
*/
|
|
159
|
+
export declare const BUILT_IN_PROVIDER_ENV: Readonly<Record<string, string>>;
|
|
160
|
+
/**
|
|
161
|
+
* An {@link AgentInvoke} that runs the model outside the container and its
|
|
162
|
+
* tools inside one.
|
|
163
|
+
*
|
|
164
|
+
* Fails closed in every direction it can: no provider runtime, no run; no
|
|
165
|
+
* bridge, no run; a configured provider that cannot speak the tool protocol,
|
|
166
|
+
* no run. None of them ever falls back to letting the model touch the host
|
|
167
|
+
* directly, which is the outcome this whole arc exists to prevent.
|
|
168
|
+
*/
|
|
169
|
+
export declare function makeMediatedAgentRunner(projectDir: string, role: ToolRole, spec?: AgentSpec, deps?: ModelTransportDeps,
|
|
170
|
+
/**
|
|
171
|
+
* The registry that stops this outliving the run that started it.
|
|
172
|
+
*
|
|
173
|
+
* 🔴 THE LIVE PROVIDER WAS NOT OWNED. The timeout below reaps it, and that
|
|
174
|
+
* covers a transport that hangs — but not a run that ENDS while one is in
|
|
175
|
+
* flight. `OwnedChildren` exists for exactly that, its docblock claims "a
|
|
176
|
+
* Ctrl-C, a `looply stop`" among what it covers, and the one process it most
|
|
177
|
+
* needed to hold was never adopted into it.
|
|
178
|
+
*
|
|
179
|
+
* The hazard is already recorded a few lines below, in `killTree`'s own
|
|
180
|
+
* docblock: stopping a round mid-turn "left a live stub and a live bridge
|
|
181
|
+
* behind, still holding a project, for as long as the machine stayed up".
|
|
182
|
+
* That was observed. This is the half that was missing.
|
|
183
|
+
*
|
|
184
|
+
* Optional, so every existing caller and fixture keeps working — but the
|
|
185
|
+
* production one passes it.
|
|
186
|
+
*/
|
|
187
|
+
owned?: OwnedChildren): AgentInvoke;
|
|
188
|
+
//# sourceMappingURL=model-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-transport.d.ts","sourceRoot":"","sources":["../src/model-transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAK3C,OAAO,EAAiB,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAS/E,OAAO,EAAyB,iBAAi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