looply-cli 0.0.0-stage → 0.2.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 +2719 -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/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 +54 -6
- 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,395 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PREFLIGHT_TIMEOUT_MS = exports.PREFLIGHT_PROMPT = exports.PREFLIGHT_TOKEN = void 0;
|
|
4
|
+
exports.preflightCommandLine = preflightCommandLine;
|
|
5
|
+
exports.preflightProvider = preflightProvider;
|
|
6
|
+
exports.preflightPasses = preflightPasses;
|
|
7
|
+
exports.preflightEnv = preflightEnv;
|
|
8
|
+
exports.nodePreflightDeps = nodePreflightDeps;
|
|
9
|
+
const exec_domains_1 = require("./exec-domains");
|
|
10
|
+
const model_transport_1 = require("./model-transport");
|
|
11
|
+
const agent_exec_1 = require("./agent-exec");
|
|
12
|
+
const command_runner_1 = require("./command-runner");
|
|
13
|
+
/**
|
|
14
|
+
* DOES THE CONFIGURED PROVIDER ACTUALLY ANSWER?
|
|
15
|
+
*
|
|
16
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
17
|
+
* 🔴 THIS IS THE ONLY THING THAT MAKES A PRESET TRUSTWORTHY.
|
|
18
|
+
*
|
|
19
|
+
* `providers.ts` ships command lines, and two of the three have never been run
|
|
20
|
+
* by anybody here — the binaries are not installed on the machine they were
|
|
21
|
+
* written on. No amount of care in a table fixes that. What fixes it is running
|
|
22
|
+
* the thing on the machine that HAS it and reporting what happened, which is
|
|
23
|
+
* what this does.
|
|
24
|
+
*
|
|
25
|
+
* ⚠️ `looply doctor` DELIBERATELY MAKES NO AGENT CALL — it exists to find a
|
|
26
|
+
* wrong `tsc` command in ninety seconds. That was the right decision for the
|
|
27
|
+
* gate and it left a hole either side of it: a wrong AGENT command was found at
|
|
28
|
+
* round 1 of an overnight run, by which point a person is asleep. This is the
|
|
29
|
+
* other half, and it is opt-in for the same reason doctor is fast: it spends a
|
|
30
|
+
* model call.
|
|
31
|
+
*
|
|
32
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
33
|
+
* 🔴 WHAT IT ASKS FOR, AND WHY THAT EXACT SHAPE
|
|
34
|
+
*
|
|
35
|
+
* A prompt with one instruction and a literal answer. Not "hello", which any
|
|
36
|
+
* process echoing its input would pass; not a code task, which spends real
|
|
37
|
+
* money and takes real time. A token the provider could only produce by having
|
|
38
|
+
* read the prompt and generated from it.
|
|
39
|
+
*
|
|
40
|
+
* ⚠️ IT STILL CANNOT PROVE THE MODEL IS ANY GOOD. It proves the process starts,
|
|
41
|
+
* accepts a prompt on stdin, and returns something derived from it. That is
|
|
42
|
+
* exactly the class of failure the flags cause, and no more.
|
|
43
|
+
*/
|
|
44
|
+
/** The word the probe asks for, chosen to be one nothing else would emit. */
|
|
45
|
+
exports.PREFLIGHT_TOKEN = 'looply-preflight-ok';
|
|
46
|
+
exports.PREFLIGHT_PROMPT = `Reply with exactly this word and nothing else: ${exports.PREFLIGHT_TOKEN}`;
|
|
47
|
+
/**
|
|
48
|
+
* How long to wait before calling it hung.
|
|
49
|
+
*
|
|
50
|
+
* 🔴 A HANG IS THE FAILURE THIS EXISTS TO CATCH, so the timeout is not a
|
|
51
|
+
* formality. An AppContainer that cannot create a named pipe returns EACCES and
|
|
52
|
+
* the spawn waits FOR EVER rather than failing — that is measured behaviour in
|
|
53
|
+
* this repository, and without a ceiling this check would inherit it.
|
|
54
|
+
*/
|
|
55
|
+
exports.PREFLIGHT_TIMEOUT_MS = 120_000;
|
|
56
|
+
/**
|
|
57
|
+
* The command line the preflight actually spawns.
|
|
58
|
+
*
|
|
59
|
+
* 🔴 THE BUILT-IN PROVIDER HAS TO BE SPAWNED BY ABSOLUTE PATH, BECAUSE THIS
|
|
60
|
+
* CHECK'S OWN ENVIRONMENT CANNOT FIND IT BY NAME. `buildProviderEnv` pins PATH
|
|
61
|
+
* to the system directories deliberately — "not the machine's toolchain
|
|
62
|
+
* directory, which on this machine also holds `claude`" — so the bare `claude`
|
|
63
|
+
* in `DEFAULT_AGENT.command` resolves to nothing and `cmd` answers "is not
|
|
64
|
+
* recognized as an internal or external command".
|
|
65
|
+
*
|
|
66
|
+
* MEASURED: `looply doctor --provider` returned `missing` in 18 ms on a machine
|
|
67
|
+
* where the provider was installed, logged in, and perfectly able to run —
|
|
68
|
+
* three lines after `checkProviderAuth` had resolved its absolute path and
|
|
69
|
+
* printed "logged in (claude.ai)". The check contradicted itself inside one
|
|
70
|
+
* command, and it contradicted the run: `model-transport` spawns
|
|
71
|
+
* `spec.executable ?? providerExecutableFor(pkg)` and never consults PATH.
|
|
72
|
+
*
|
|
73
|
+
* A check that REFUSES a configuration the run ACCEPTS is the mirror of the
|
|
74
|
+
* defect this file's own header warns about, and costs the same thing — a
|
|
75
|
+
* person is told the provider is missing and goes looking for an install that
|
|
76
|
+
* is already there.
|
|
77
|
+
*
|
|
78
|
+
* ⚠️ ONLY THE BUILT-IN IS REWRITTEN. A configured `agent.command` is the
|
|
79
|
+
* person's own line, and rewriting it would discard exactly the intent
|
|
80
|
+
* `resolveProvider` takes such care to keep. An explicit `agent.executable` is
|
|
81
|
+
* already absolute and the transport already prefers it.
|
|
82
|
+
*/
|
|
83
|
+
function preflightCommandLine(spec, executable) {
|
|
84
|
+
if (executable === null || spec.executable !== undefined || spec.command !== agent_exec_1.DEFAULT_AGENT.command) {
|
|
85
|
+
return (0, agent_exec_1.agentCommandLine)(spec, 'text');
|
|
86
|
+
}
|
|
87
|
+
const args = agent_exec_1.DEFAULT_AGENT.command.split(' ').slice(1);
|
|
88
|
+
// Quoted because the ordinary install path — `C:\Program Files\nodejs\…` —
|
|
89
|
+
// contains a space, and an unquoted one is two arguments to `cmd`.
|
|
90
|
+
return (0, agent_exec_1.agentCommandLine)({ ...spec, command: [`"${executable}"`, ...args].join(' ') }, 'text');
|
|
91
|
+
}
|
|
92
|
+
/** Enough to identify the failure, never enough to be a transcript. */
|
|
93
|
+
const MAX_DETAIL = 400;
|
|
94
|
+
function clip(s) {
|
|
95
|
+
const t = s.trim().replace(/\s+/g, ' ');
|
|
96
|
+
return t.length <= MAX_DETAIL ? t : `${t.slice(0, MAX_DETAIL)}…`;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* ⚠️ `missing` IS DETECTED FROM THE MESSAGE AS WELL AS THE EXIT CODE, and the
|
|
100
|
+
* message is still the weaker half. A provider refusing a FLAG also exits 1 on
|
|
101
|
+
* Windows `cmd`, so the code alone cannot separate "no such program" from "bad
|
|
102
|
+
* option" there — the wording is what separates them.
|
|
103
|
+
*
|
|
104
|
+
* 🔴 AND IT KNEW ONE POSIX SHELL'S WORDING, NOT THE ONE MOST HOSTS USE. bash
|
|
105
|
+
* says "command not found"; `/bin/sh` is dash on Debian and Ubuntu, and dash
|
|
106
|
+
* says `sh: 1: name: not found`. A missing binary was therefore classified
|
|
107
|
+
* `refused` on the commonest POSIX host — and the two have different fixes, one
|
|
108
|
+
* a name or a PATH and the other a flag, which is the whole reason this
|
|
109
|
+
* distinction exists. The advice it printed sent a person to look at their flags
|
|
110
|
+
* for a binary that was not installed.
|
|
111
|
+
*/
|
|
112
|
+
function looksMissing(text) {
|
|
113
|
+
return /not recognized as an internal or external command|command not found|: not found|ENOENT|No such file or directory|is not recognized/i.test(text);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Exit statuses that mean "no such program", whatever was printed.
|
|
117
|
+
*
|
|
118
|
+
* 127 is the POSIX shell's own convention for a command it could not find, and
|
|
119
|
+
* 9009 is `cmd.exe`'s. Both are narrow enough not to collide with a provider's
|
|
120
|
+
* own failure codes — a program that did start and then failed does not pick
|
|
121
|
+
* these — so they are a second, wording-independent way to tell the two problems
|
|
122
|
+
* apart.
|
|
123
|
+
*/
|
|
124
|
+
const MISSING_EXIT_CODES = [127, 9009];
|
|
125
|
+
async function preflightProvider(spec, deps) {
|
|
126
|
+
// The spec is NOT rewritten — the `no_host_tools` rule below asks about
|
|
127
|
+
// `spec.command`, and a resolved absolute path would read as a configured
|
|
128
|
+
// provider and demand a declaration the built-in does not need.
|
|
129
|
+
const commandLine = preflightCommandLine(spec, deps.executable ?? null);
|
|
130
|
+
const started = deps.now();
|
|
131
|
+
/**
|
|
132
|
+
* 🔴 A CHECK THAT PASSES A CONFIGURATION THE RUN REFUSES IS WORSE THAN NO
|
|
133
|
+
* CHECK, AND THAT IS EXACTLY WHAT THIS DID.
|
|
134
|
+
*
|
|
135
|
+
* MEASURED: `looply doctor --provider` — the documented way to confirm a
|
|
136
|
+
* provider — returned PASS, exit 0, on the very configuration where every
|
|
137
|
+
* `looply run` model call is refused for a missing `agent.no_host_tools`.
|
|
138
|
+
* A person ran the check looply told them to run, was told everything was
|
|
139
|
+
* fine, and then lost the first round of an overnight run to a refusal this
|
|
140
|
+
* command could have named in a millisecond.
|
|
141
|
+
*
|
|
142
|
+
* ⚠️ AND IT IS CHECKED BEFORE THE SPAWN, not after. There is nothing to
|
|
143
|
+
* learn from starting a provider that will not be started this way, and
|
|
144
|
+
* spawning one costs a model session.
|
|
145
|
+
*
|
|
146
|
+
* This mirrors `model-transport`'s rule rather than restating it: a
|
|
147
|
+
* configured provider — one whose command is not the built-in — must say how
|
|
148
|
+
* its own tools are turned off.
|
|
149
|
+
*/
|
|
150
|
+
if (spec.command !== agent_exec_1.DEFAULT_AGENT.command && (spec.noHostTools ?? []).length === 0) {
|
|
151
|
+
return {
|
|
152
|
+
verdict: 'refused',
|
|
153
|
+
ms: deps.now() - started,
|
|
154
|
+
detail: 'this project configures its own agent command but does not set `agent.no_host_tools`, ' +
|
|
155
|
+
'so every model call in a run is refused before the provider is started.',
|
|
156
|
+
advice: 'Set `agent.no_host_tools` to the arguments that turn this binary\'s own tools off. Looply ' +
|
|
157
|
+
'gives a model no host tools and cannot guess that argument for a binary it does not know — ' +
|
|
158
|
+
'a guessed flag that silently does nothing reads exactly like one that works.',
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
let out;
|
|
162
|
+
try {
|
|
163
|
+
out = await deps.run({
|
|
164
|
+
commandLine,
|
|
165
|
+
prompt: exports.PREFLIGHT_PROMPT,
|
|
166
|
+
timeoutMs: exports.PREFLIGHT_TIMEOUT_MS,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
catch (e) {
|
|
170
|
+
const message = clip(e?.message ?? String(e));
|
|
171
|
+
const missing = looksMissing(message);
|
|
172
|
+
return {
|
|
173
|
+
verdict: missing ? 'missing' : 'refused',
|
|
174
|
+
ms: deps.now() - started,
|
|
175
|
+
detail: message,
|
|
176
|
+
advice: missing
|
|
177
|
+
? `Looply could not start "${commandLine.split(' ')[0]}". Check the binary is installed and on PATH, then set agent.command if it is named differently here.`
|
|
178
|
+
: 'The provider could not be started. The message above is what the operating system said.',
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
const ms = deps.now() - started;
|
|
182
|
+
const combined = `${out.stdout}\n${out.stderr}`;
|
|
183
|
+
if (out.timedOut) {
|
|
184
|
+
return {
|
|
185
|
+
verdict: 'hung',
|
|
186
|
+
ms,
|
|
187
|
+
detail: clip(combined) || 'no output before the ceiling',
|
|
188
|
+
advice: 'The provider produced nothing and did not exit. This is what a wrong flag looks like when the binary waits for input it will never get, and it is the failure mode that costs a whole overnight run.',
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
if (looksMissing(combined) || (out.code !== null && MISSING_EXIT_CODES.includes(out.code))) {
|
|
192
|
+
return {
|
|
193
|
+
verdict: 'missing',
|
|
194
|
+
ms,
|
|
195
|
+
detail: clip(combined),
|
|
196
|
+
advice: `Looply could not start "${commandLine.split(' ')[0]}". Check the binary is installed and on PATH.`,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
if (out.code !== 0 && out.code !== null) {
|
|
200
|
+
return {
|
|
201
|
+
verdict: 'refused',
|
|
202
|
+
ms,
|
|
203
|
+
detail: clip(combined),
|
|
204
|
+
advice: 'The provider started and exited with an error, which usually means a flag it does not recognise. Compare agent.command against its own --help.',
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
// 🔴 THE TOKEN IS LOOKED FOR IN THE WHOLE OUTPUT, NOT AT THE END. Providers
|
|
208
|
+
// print banners, spinners and usage lines around an answer, and requiring it
|
|
209
|
+
// to be the entire response would fail every provider that is polite.
|
|
210
|
+
if (combined.includes(exports.PREFLIGHT_TOKEN)) {
|
|
211
|
+
return { verdict: 'answered', ms, detail: '', advice: '' };
|
|
212
|
+
}
|
|
213
|
+
return {
|
|
214
|
+
verdict: 'unrecognised',
|
|
215
|
+
ms,
|
|
216
|
+
detail: clip(combined),
|
|
217
|
+
advice: 'The provider ran and answered, but not with what was asked for. It may still work — or it may not be reading the prompt from stdin at all, which would look exactly like this. Compare the output above against what you expected.',
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
/** Whether a run should be allowed to start on this result. */
|
|
221
|
+
function preflightPasses(r) {
|
|
222
|
+
// ⚠️ `unrecognised` PASSES, DELIBERATELY. It means "answered, but not the way
|
|
223
|
+
// this probe hoped", and a provider that prefixes its output or declines the
|
|
224
|
+
// instruction is not a broken one. Blocking on it would make the check a
|
|
225
|
+
// gatekeeper for a prompt-following ability nobody promised.
|
|
226
|
+
return r.verdict === 'answered' || r.verdict === 'unrecognised';
|
|
227
|
+
}
|
|
228
|
+
/* ─────────────────────────────────────────────────────── real processes ── */
|
|
229
|
+
/**
|
|
230
|
+
* The real implementation, kept out of the module above so its logic stays
|
|
231
|
+
* drivable without spawning anything.
|
|
232
|
+
*
|
|
233
|
+
* 🔴 THE ENVIRONMENT HAD TO MATCH THE TRANSPORT'S, AND THE OLD DOCBLOCK
|
|
234
|
+
* CLAIMED IT ALREADY DID.
|
|
235
|
+
*
|
|
236
|
+
* It said "`shell: true` MATCHES HOW THE TRANSPORT STARTS THE PROVIDER", while
|
|
237
|
+
* the transport's own docblock says "NEVER `shell: true`" — and, far worse,
|
|
238
|
+
* this spawn passed no `env` at all, so the child inherited the OPERATOR'S
|
|
239
|
+
* ENTIRE AMBIENT ENVIRONMENT and their real HOME.
|
|
240
|
+
*
|
|
241
|
+
* MEASURED: the preflight child saw an injected marker variable and the
|
|
242
|
+
* operator's own home directory; the transport gives a scrubbed environment and
|
|
243
|
+
* a HOME redirected into `.looply/provider-sessions`. So a provider that
|
|
244
|
+
* authenticates from the operator's real home, or that is found on the
|
|
245
|
+
* operator's PATH rather than in `agent.runtime`, PASSED this check and then
|
|
246
|
+
* could not start in the run — precisely the failure the preflight exists to
|
|
247
|
+
* prevent, with the check itself supplying the credentials.
|
|
248
|
+
*
|
|
249
|
+
* ⚠️ THE SHELL STAYS, because the thing being checked IS a command line and
|
|
250
|
+
* the transport also reaches a configured provider through `cmd /c`. What
|
|
251
|
+
* changes is the environment that shell is given: `buildProviderEnv` over a
|
|
252
|
+
* session directory — the same function, and the same shape, the transport uses.
|
|
253
|
+
*/
|
|
254
|
+
/**
|
|
255
|
+
* The environment a preflight hands the provider, as a pure function of its three
|
|
256
|
+
* inputs — so a test can hold it against what the transport builds.
|
|
257
|
+
*
|
|
258
|
+
* 🔴 EXTRACTED BECAUSE THE DIVERGENCE WAS INVISIBLE. It lived inside the spawn
|
|
259
|
+
* closure, where nothing could observe it, and it quietly omitted
|
|
260
|
+
* `CLAUDE_CONFIG_DIR` while `model-transport` always set it. The result was a
|
|
261
|
+
* readiness check that reported `refused` for a provider the run would have
|
|
262
|
+
* authenticated, advising the operator to go and compare command-line flags.
|
|
263
|
+
*/
|
|
264
|
+
function preflightEnv(base, runtime, profile) {
|
|
265
|
+
const withPath = runtime.length === 0
|
|
266
|
+
? base
|
|
267
|
+
: { ...base, PATH: [...runtime, base['PATH'] ?? ''].filter((x) => x.length > 0).join(';') };
|
|
268
|
+
// The same provider-behaviour pin the transport sets, or the readiness check
|
|
269
|
+
// would ask a provider that cannot see its tools whether it is ready to work.
|
|
270
|
+
return profile === undefined ? withPath : { ...withPath, CLAUDE_CONFIG_DIR: profile, ...model_transport_1.BUILT_IN_PROVIDER_ENV };
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* @param runtime `agent.runtime`, prepended to PATH exactly as the transport does.
|
|
274
|
+
* @param profile The provider profile directory, set as `CLAUDE_CONFIG_DIR`.
|
|
275
|
+
*
|
|
276
|
+
* 🔴 THE PROFILE IS NOT OPTIONAL DECORATION. `buildProviderEnv` hands the provider
|
|
277
|
+
* an isolated HOME, so without `CLAUDE_CONFIG_DIR` the binary looks for its login
|
|
278
|
+
* in a directory nothing has ever logged into — and answers "Not logged in" for a
|
|
279
|
+
* profile the RUN never uses. Measured on a machine whose operator was logged in
|
|
280
|
+
* perfectly well: `doctor --provider` said `refused`, and advised checking flags.
|
|
281
|
+
*
|
|
282
|
+
* ⚠️ NO CREDENTIAL PASSES THROUGH HERE. This is a directory NAME. The provider owns
|
|
283
|
+
* its own login inside it; Looply names the place and holds nothing.
|
|
284
|
+
*/
|
|
285
|
+
function nodePreflightDeps(runtime = [], profile, executable) {
|
|
286
|
+
return {
|
|
287
|
+
now: () => Date.now(),
|
|
288
|
+
...(executable === undefined ? {} : { executable }),
|
|
289
|
+
run: ({ commandLine, prompt, timeoutMs }) => new Promise((resolve, reject) => {
|
|
290
|
+
// Required lazily so importing this module costs nothing in tests that
|
|
291
|
+
// only exercise the classifier.
|
|
292
|
+
const { spawn } = require('node:child_process');
|
|
293
|
+
const sessionDir = (0, model_transport_1.providerSessionDir)(process.cwd(), 'implementer');
|
|
294
|
+
const base = (0, exec_domains_1.buildProviderEnv)(sessionDir);
|
|
295
|
+
/**
|
|
296
|
+
* ⚠️ AND THE SAME RUNTIME PATHS, or this check becomes STRICTER than the
|
|
297
|
+
* run — the opposite error, and just as bad. The transport prepends
|
|
298
|
+
* `agent.runtime` to PATH for a configured provider; a preflight that
|
|
299
|
+
* did not would refuse a binary the run finds perfectly well.
|
|
300
|
+
*/
|
|
301
|
+
const env = preflightEnv(base, runtime, profile);
|
|
302
|
+
const child = spawn(commandLine, {
|
|
303
|
+
shell: true,
|
|
304
|
+
cwd: sessionDir,
|
|
305
|
+
env: env,
|
|
306
|
+
/**
|
|
307
|
+
* 🔴 ITS OWN PROCESS GROUP, OR THE KILL BELOW CANNOT REACH THE
|
|
308
|
+
* PROVIDER AT ALL.
|
|
309
|
+
*
|
|
310
|
+
* `shell: true` makes `child` the SHELL and the provider its
|
|
311
|
+
* grandchild — which the timer below already knows, and answers with
|
|
312
|
+
* `nodeKillTree`. But on POSIX that killer is `kill(-pid)`, a
|
|
313
|
+
* PROCESS GROUP signal, and a child spawned without this shares the
|
|
314
|
+
* group of whoever started looply. The group kill then fails, the
|
|
315
|
+
* fallback reaps the shell, and the provider survives the ceiling —
|
|
316
|
+
* the precise outcome the comment below says must not happen, still
|
|
317
|
+
* happening off Windows. `nodeSpawn` in `command-runner.ts` has set
|
|
318
|
+
* this for the same reason all along; this spawn was the one that did
|
|
319
|
+
* not.
|
|
320
|
+
*
|
|
321
|
+
* ⚠️ NOT ON WINDOWS, where it would open a new console instead and
|
|
322
|
+
* `taskkill /T` walks the tree by itself. Not `unref`'d either: the
|
|
323
|
+
* preflight is still waiting for this child.
|
|
324
|
+
*/
|
|
325
|
+
detached: process.platform !== 'win32',
|
|
326
|
+
});
|
|
327
|
+
let stdout = '';
|
|
328
|
+
let stderr = '';
|
|
329
|
+
let settled = false;
|
|
330
|
+
const timer = setTimeout(() => {
|
|
331
|
+
if (settled)
|
|
332
|
+
return;
|
|
333
|
+
settled = true;
|
|
334
|
+
// 🔴 THE TREE, NOT THE CHILD. `shell: true` on Windows runs
|
|
335
|
+
// `cmd.exe /d /s /c "<command>"`, so `child` is the SHELL and the
|
|
336
|
+
// provider is its grandchild. `child.kill()` reaps the shell and
|
|
337
|
+
// leaves the provider running — measured, not assumed: a test that
|
|
338
|
+
// waits for a survivor to write a marker file caught exactly this.
|
|
339
|
+
//
|
|
340
|
+
// A provider left alive after the ceiling is a process nobody is
|
|
341
|
+
// waiting for and nobody will reap, each holding a model session
|
|
342
|
+
// open. `nodeKillTree` is the repository's existing answer, used by
|
|
343
|
+
// the agent transport for the same reason.
|
|
344
|
+
void (0, command_runner_1.nodeKillTree)(child.pid ?? 0);
|
|
345
|
+
resolve({ stdout, stderr, code: null, timedOut: true });
|
|
346
|
+
}, timeoutMs);
|
|
347
|
+
child.stdout?.on('data', (d) => (stdout += d.toString('utf8')));
|
|
348
|
+
child.stderr?.on('data', (d) => (stderr += d.toString('utf8')));
|
|
349
|
+
child.on('error', (e) => {
|
|
350
|
+
if (settled)
|
|
351
|
+
return;
|
|
352
|
+
settled = true;
|
|
353
|
+
clearTimeout(timer);
|
|
354
|
+
reject(e);
|
|
355
|
+
});
|
|
356
|
+
child.on('close', (code) => {
|
|
357
|
+
if (settled)
|
|
358
|
+
return;
|
|
359
|
+
settled = true;
|
|
360
|
+
clearTimeout(timer);
|
|
361
|
+
resolve({ stdout, stderr, code, timedOut: false });
|
|
362
|
+
});
|
|
363
|
+
/**
|
|
364
|
+
* 🔴 A CHILD THAT NEVER READ THE PROMPT MUST NOT CRASH THE CHECK.
|
|
365
|
+
*
|
|
366
|
+
* A missing binary makes the shell exit immediately, so the pipe is gone
|
|
367
|
+
* before this write lands and Node raises `EPIPE` as an ERROR EVENT on
|
|
368
|
+
* `stdin` — not as a throw, so the try/catch below never saw it, and an
|
|
369
|
+
* unhandled stream error is an uncaught exception. The symptom was a
|
|
370
|
+
* `write EPIPE` escaping `looply doctor --provider` instead of the
|
|
371
|
+
* "missing — check the binary is installed and on PATH" it exists to
|
|
372
|
+
* print, on exactly the configuration it was run to diagnose. It is a
|
|
373
|
+
* race with the child's exit, which is why it showed up under load and
|
|
374
|
+
* not on a quiet machine.
|
|
375
|
+
*
|
|
376
|
+
* ⚠️ IGNORED, NOT REPORTED. The child's own `close` carries the exit
|
|
377
|
+
* status the classifier reads, and that is the better evidence: a pipe
|
|
378
|
+
* error means the provider was not listening, which is a fact about the
|
|
379
|
+
* provider and not about this write. A write that fails for any other
|
|
380
|
+
* reason leaves the child waiting on input it will never get, and the
|
|
381
|
+
* ceiling above reports that honestly as `hung`.
|
|
382
|
+
*/
|
|
383
|
+
child.stdin?.on('error', () => {
|
|
384
|
+
/* the child is gone or not reading; its exit is the answer */
|
|
385
|
+
});
|
|
386
|
+
try {
|
|
387
|
+
child.stdin?.end(prompt);
|
|
388
|
+
}
|
|
389
|
+
catch {
|
|
390
|
+
// Reported through the error listener above.
|
|
391
|
+
}
|
|
392
|
+
}),
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
//# sourceMappingURL=provider-preflight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-preflight.js","sourceRoot":"","sources":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,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;YACrD,CAAC,CAAC,CAAC;YAEH;;;;;;;;;;;;;;;;;;;eAmBG;YACH,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;gBAC5B,8DAA8D;YAChE,CAAC,CAAC,CAAC;YACH,IAAI,CAAC;gBACH,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;YAC3B,CAAC;YAAC,MAAM,CAAC;gBACP,6CAA6C;YAC/C,CAAC;QACH,CAAC,CAAC;KACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WHO OWNS THE PROVIDER'S CREDENTIAL. NOT LOOPLY.
|
|
3
|
+
*
|
|
4
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
* 🔴 THIS FILE USED TO COPY THE OPERATOR'S SUBSCRIPTION CREDENTIAL INTO EVERY
|
|
6
|
+
* RUN. `seedProviderState` read `~/.claude/.credentials.json` and wrote it into
|
|
7
|
+
* each run's sterile session directory, once per launch. It worked, and it was
|
|
8
|
+
* never approved as a design: Looply held a copy of a credential it does not
|
|
9
|
+
* own, in a directory it also sweeps as residue, once per execution. Nine such
|
|
10
|
+
* copies were found on this machine and disposed of.
|
|
11
|
+
*
|
|
12
|
+
* The provider owns its own credential now. Looply stores a PATH.
|
|
13
|
+
*
|
|
14
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
15
|
+
* HOW IT WORKS, AND WHY THIS PARTICULAR MECHANISM.
|
|
16
|
+
*
|
|
17
|
+
* `CLAUDE_CONFIG_DIR` relocates the provider's whole profile — where it looks
|
|
18
|
+
* for credentials and where it keeps project state. Verified against the
|
|
19
|
+
* installed 2.1.260 rather than assumed: pointed at an empty directory, `auth
|
|
20
|
+
* status` reported `loggedIn: false` and a `projectsDirectory` inside it. Both
|
|
21
|
+
* halves matter. It relocates, AND it starts clean rather than inheriting the
|
|
22
|
+
* operator's `~/.claude` login, settings, hooks, plugins or transcripts.
|
|
23
|
+
*
|
|
24
|
+
* ⚠️ THE PROFILE IS MACHINE STATE, NOT PROJECT STATE. It is resolved from the
|
|
25
|
+
* daemon's own home, never from `.looply/config.yaml` — that file is inside the
|
|
26
|
+
* worktree, which the model may edit. A worker that could name the provider
|
|
27
|
+
* profile could point it at a directory it had written.
|
|
28
|
+
*
|
|
29
|
+
* ⚠️ AND IT IS DELIBERATELY NOT UNDER `provider-sessions/`. That tree is
|
|
30
|
+
* residue: `workspace-residue-sweep` deletes it when a workspace is retired. A
|
|
31
|
+
* credential store inside a cleanup root is a credential store a reap destroys.
|
|
32
|
+
*
|
|
33
|
+
* ⚠️ WHAT THIS DOES NOT CLAIM. Not process confinement — the provider still runs
|
|
34
|
+
* with host-user authority and can read what the operator can read. Not separate
|
|
35
|
+
* account quotas, not logout independence on the account side, and not secure
|
|
36
|
+
* erasure of anything. It is narrower than all of those: Looply no longer copies
|
|
37
|
+
* or handles the credential, and the provider manages its own.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* The persistent, operator-controlled provider profile.
|
|
41
|
+
*
|
|
42
|
+
* One per machine, beside Looply's other machine state. The operator logs into
|
|
43
|
+
* it once with the provider's own flow; nothing here reads what lands there.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* The provider executable inside an installed Claude Code package.
|
|
47
|
+
*
|
|
48
|
+
* 🔴 ONE DEFINITION, BECAUSE TWO WOULD DRIFT. `model-transport` composes this
|
|
49
|
+
* path to launch the provider and `doctor` needs the identical one to ask whether
|
|
50
|
+
* that provider is logged in. A readiness check against a different binary is the
|
|
51
|
+
* same class of mistake as one against a different profile: it answers honestly
|
|
52
|
+
* about something nobody is going to run.
|
|
53
|
+
*
|
|
54
|
+
* `null` in, `null` out — no package, no executable, and the caller says so in
|
|
55
|
+
* its own words.
|
|
56
|
+
*/
|
|
57
|
+
export declare function providerExecutableFor(packageDir: string | null): string | null;
|
|
58
|
+
export declare function providerProfileDir(deps?: ProviderStateDeps): string;
|
|
59
|
+
export interface ProviderStateDeps {
|
|
60
|
+
/** The daemon's own home. Overridable so tests never touch the real one. */
|
|
61
|
+
home?: string;
|
|
62
|
+
/** Overridable so a test can drive a fake `auth status`. */
|
|
63
|
+
run?: (exe: string, argv: readonly string[], env: Record<string, string>, timeoutMs: number) => string;
|
|
64
|
+
timeoutMs?: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Why a launch cannot proceed, kept apart on purpose.
|
|
68
|
+
*
|
|
69
|
+
* 🔴 "PLEASE LOG IN" IS THE WRONG ANSWER TO FOUR OF THESE FIVE. A missing
|
|
70
|
+
* executable, an unparseable answer, a crashed subprocess and a timeout are all
|
|
71
|
+
* different problems with different fixes, and collapsing them into a login
|
|
72
|
+
* prompt sends somebody to re-authenticate an account that was never the
|
|
73
|
+
* trouble. Only `unauthenticated` means log in.
|
|
74
|
+
*/
|
|
75
|
+
export type ProviderAuthState = {
|
|
76
|
+
ok: true;
|
|
77
|
+
profile: string;
|
|
78
|
+
method: string;
|
|
79
|
+
} | {
|
|
80
|
+
ok: false;
|
|
81
|
+
reason: 'unauthenticated';
|
|
82
|
+
profile: string;
|
|
83
|
+
because: string;
|
|
84
|
+
} | {
|
|
85
|
+
ok: false;
|
|
86
|
+
reason: 'no_executable';
|
|
87
|
+
profile: string;
|
|
88
|
+
because: string;
|
|
89
|
+
} | {
|
|
90
|
+
ok: false;
|
|
91
|
+
reason: 'unreadable_status';
|
|
92
|
+
profile: string;
|
|
93
|
+
because: string;
|
|
94
|
+
} | {
|
|
95
|
+
ok: false;
|
|
96
|
+
reason: 'status_failed';
|
|
97
|
+
profile: string;
|
|
98
|
+
because: string;
|
|
99
|
+
} | {
|
|
100
|
+
ok: false;
|
|
101
|
+
reason: 'timed_out';
|
|
102
|
+
profile: string;
|
|
103
|
+
because: string;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Is the provider ready to authenticate itself, in the profile the run will use?
|
|
107
|
+
*
|
|
108
|
+
* ⚠️ NO MODEL IS INVOKED. `auth status` is a local command that prints the
|
|
109
|
+
* profile's own state as JSON. Checking whether a login exists must not cost a
|
|
110
|
+
* turn, and a check that did would be a check nobody could afford to run.
|
|
111
|
+
*
|
|
112
|
+
* ⚠️ AND IT ASKS IN THE SAME PROFILE THE RUN WILL USE. A readiness check against
|
|
113
|
+
* a different `CLAUDE_CONFIG_DIR` answers a different question, which is exactly
|
|
114
|
+
* the class of mistake `doctor --provider` was repaired for once already.
|
|
115
|
+
*
|
|
116
|
+
* Nothing here reads, parses, copies or transports a credential. The only thing
|
|
117
|
+
* consumed is a boolean and a method name.
|
|
118
|
+
*/
|
|
119
|
+
export declare function checkProviderAuth(executable: string, env: Record<string, string>, deps?: ProviderStateDeps): ProviderAuthState;
|
|
120
|
+
//# sourceMappingURL=provider-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-state.d.ts","sourceRoot":"","sources":["../src/provider-state.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH;;;;;GAKG;AACH;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAE9E;AAED,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,iBAAsB,GAAG,MAAM,CAEvE;AAED,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACvG,SAAS,CAAC,EAAE,MAAM,CAAC;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