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
package/dist/setup.js
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GATES_ARE_TOOLCHAIN = exports.DEFAULT_ANSWERS = exports.QUESTIONS = void 0;
|
|
4
|
+
exports.suggestRails = suggestRails;
|
|
5
|
+
exports.parseAnswer = parseAnswer;
|
|
6
|
+
exports.renderConfig = renderConfig;
|
|
7
|
+
exports.summarise = summarise;
|
|
8
|
+
/**
|
|
9
|
+
* Guesses for the rails, by ecosystem.
|
|
10
|
+
*
|
|
11
|
+
* Offered rather than applied. A wrong guess that is presented as a suggestion
|
|
12
|
+
* costs a keystroke; a wrong guess applied silently costs a schema.
|
|
13
|
+
*/
|
|
14
|
+
function suggestRails(profile) {
|
|
15
|
+
const guesses = [];
|
|
16
|
+
const has = (p) => profile.workspaces.some((w) => w.includes(p)) || profile.name.includes(p);
|
|
17
|
+
// Anything that migrates a database, moves money, or decides who you are.
|
|
18
|
+
const candidates = [
|
|
19
|
+
'prisma/',
|
|
20
|
+
'migrations/',
|
|
21
|
+
'src/common/guards/',
|
|
22
|
+
'src/modules/payments/',
|
|
23
|
+
'src/modules/billing/',
|
|
24
|
+
'src/auth/',
|
|
25
|
+
'infra/',
|
|
26
|
+
'.github/workflows/',
|
|
27
|
+
];
|
|
28
|
+
for (const c of candidates)
|
|
29
|
+
guesses.push(c);
|
|
30
|
+
if (has('api'))
|
|
31
|
+
guesses.push('api/prisma/');
|
|
32
|
+
return [...new Set(guesses)];
|
|
33
|
+
}
|
|
34
|
+
exports.QUESTIONS = [
|
|
35
|
+
{
|
|
36
|
+
key: 'rails',
|
|
37
|
+
ask: 'Which paths must looply never touch?',
|
|
38
|
+
why: 'Schema, migrations, auth and anything that moves money. It will report what it finds there and refuse to change it. This is the one answer worth taking a minute over.',
|
|
39
|
+
kind: 'paths',
|
|
40
|
+
default: '',
|
|
41
|
+
suggest: suggestRails,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
key: 'prodDb',
|
|
45
|
+
ask: 'Can this machine reach a production database?',
|
|
46
|
+
why: 'If yes, looply refuses to start whenever it sees a live connection string — a loop that can write to production is not a loop, it is an incident.',
|
|
47
|
+
kind: 'confirm',
|
|
48
|
+
default: 'no',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
key: 'push',
|
|
52
|
+
ask: 'May looply publish anything?',
|
|
53
|
+
why: 'Nothing leaves your machine unless you say so. Most people want the default.',
|
|
54
|
+
kind: 'choice',
|
|
55
|
+
default: 'never',
|
|
56
|
+
choices: [
|
|
57
|
+
{ value: 'never', label: 'never', hint: 'commits stay on a local branch' },
|
|
58
|
+
{ value: 'on-approval', label: 'on approval', hint: 'push once you approve, from the app' },
|
|
59
|
+
{ value: 'manual', label: 'manual', hint: 'you push, by hand, as usual' },
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
key: 'scope',
|
|
64
|
+
ask: 'What kind of work should it do?',
|
|
65
|
+
why: 'Improving what exists produces work you can review. Inventing new surface produces work nobody asked for, which is how an overnight run turns into a morning of reverting.',
|
|
66
|
+
kind: 'choice',
|
|
67
|
+
default: 'improve',
|
|
68
|
+
choices: [
|
|
69
|
+
{ value: 'improve', label: 'improve what is there', hint: 'fixes, tests, missing states' },
|
|
70
|
+
{ value: 'anything', label: 'anything', hint: 'including new screens and flows' },
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
key: 'hours',
|
|
75
|
+
ask: 'How long should a run go by default?',
|
|
76
|
+
why: 'It finishes the round it is on rather than cutting it off, so this is a floor and not a deadline.',
|
|
77
|
+
kind: 'number',
|
|
78
|
+
default: '4',
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
exports.DEFAULT_ANSWERS = {
|
|
82
|
+
rails: [],
|
|
83
|
+
prodDb: false,
|
|
84
|
+
push: 'never',
|
|
85
|
+
scope: 'improve',
|
|
86
|
+
hours: 4,
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Turn one raw answer into a value, or say why it cannot be.
|
|
90
|
+
*
|
|
91
|
+
* A blank answer always means the default — a setup that punishes pressing enter
|
|
92
|
+
* is a setup people abandon halfway.
|
|
93
|
+
*/
|
|
94
|
+
function parseAnswer(question, raw) {
|
|
95
|
+
const text = raw.trim();
|
|
96
|
+
// Blank is resolved here rather than by re-entering with the default: a
|
|
97
|
+
// question whose default is itself blank (rails, where "none" is the sane
|
|
98
|
+
// answer) recursed forever, which hung the CLI on the very first enter.
|
|
99
|
+
if (!text)
|
|
100
|
+
return { ok: true, value: emptyAnswer(question) };
|
|
101
|
+
switch (question.kind) {
|
|
102
|
+
case 'confirm': {
|
|
103
|
+
const yes = /^(y|yes|true)$/i.test(text);
|
|
104
|
+
const no = /^(n|no|false)$/i.test(text);
|
|
105
|
+
if (!yes && !no)
|
|
106
|
+
return { ok: false, error: 'answer yes or no' };
|
|
107
|
+
return { ok: true, value: yes };
|
|
108
|
+
}
|
|
109
|
+
case 'choice': {
|
|
110
|
+
const match = question.choices?.find((c) => c.value === text.toLowerCase() || c.label.toLowerCase() === text.toLowerCase());
|
|
111
|
+
// A number is accepted too, since the choices are printed numbered.
|
|
112
|
+
const asIndex = Number(text);
|
|
113
|
+
if (!match && Number.isInteger(asIndex) && question.choices?.[asIndex - 1]) {
|
|
114
|
+
return { ok: true, value: question.choices[asIndex - 1].value };
|
|
115
|
+
}
|
|
116
|
+
if (!match) {
|
|
117
|
+
return { ok: false, error: `pick one of: ${question.choices?.map((c) => c.value).join(', ')}` };
|
|
118
|
+
}
|
|
119
|
+
return { ok: true, value: match.value };
|
|
120
|
+
}
|
|
121
|
+
case 'number': {
|
|
122
|
+
const n = Number(text);
|
|
123
|
+
if (!Number.isFinite(n) || n <= 0)
|
|
124
|
+
return { ok: false, error: 'give a positive number of hours' };
|
|
125
|
+
if (n > 24)
|
|
126
|
+
return { ok: false, error: 'a run longer than 24 hours is almost certainly a mistake' };
|
|
127
|
+
return { ok: true, value: n };
|
|
128
|
+
}
|
|
129
|
+
case 'paths': {
|
|
130
|
+
const paths = text
|
|
131
|
+
.split(/[,\s]+/)
|
|
132
|
+
.map((p) => p.trim())
|
|
133
|
+
.filter(Boolean);
|
|
134
|
+
const bad = paths.find((p) => p.startsWith('/') || p.includes('..'));
|
|
135
|
+
if (bad) {
|
|
136
|
+
// An absolute or climbing path would either match nothing or match
|
|
137
|
+
// outside the repository, and both fail quietly at exactly the wrong time.
|
|
138
|
+
return { ok: false, error: `${bad} must be a path inside this repository` };
|
|
139
|
+
}
|
|
140
|
+
return { ok: true, value: paths };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/** What pressing enter means, per kind. Always a value, never another prompt. */
|
|
145
|
+
function emptyAnswer(q) {
|
|
146
|
+
switch (q.kind) {
|
|
147
|
+
case 'paths':
|
|
148
|
+
return q.default ? q.default.split(/[,\s]+/).filter(Boolean) : [];
|
|
149
|
+
case 'confirm':
|
|
150
|
+
return /^(y|yes|true)$/i.test(q.default);
|
|
151
|
+
case 'number':
|
|
152
|
+
return Number(q.default) || 0;
|
|
153
|
+
case 'choice':
|
|
154
|
+
return q.default;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* The config file, written from what was detected and what was answered.
|
|
159
|
+
*
|
|
160
|
+
* Commented throughout, because this file is meant to be read and edited after
|
|
161
|
+
* setup rather than treated as generated output nobody opens.
|
|
162
|
+
*/
|
|
163
|
+
/**
|
|
164
|
+
* What detection could see, said in the file it wrote.
|
|
165
|
+
*
|
|
166
|
+
* 🔴 THIS MODULE'S OWN RULE, APPLIED TO THE ONE THING IT SKIPPED (the audit's
|
|
167
|
+
* B-01). The docblock at the top of this file draws the line precisely:
|
|
168
|
+
* detection covers what the repository can tell you, and *"it cannot tell you
|
|
169
|
+
* the things that are expensive to get wrong… So those are asked."* Three are
|
|
170
|
+
* asked — forbidden paths, a reachable production database, whether anything
|
|
171
|
+
* may be published.
|
|
172
|
+
*
|
|
173
|
+
* `gates` is the most expensive thing in this file to get wrong, and it is the
|
|
174
|
+
* one that is **neither asked nor defaulted**: it is DETECTED, from the
|
|
175
|
+
* lockfile, `package.json` scripts and `tsconfig` — the toolchain, and nothing
|
|
176
|
+
* else. A person handed a populated list has no way to know that contracts,
|
|
177
|
+
* data and migrations were never candidates.
|
|
178
|
+
*
|
|
179
|
+
* ⚠️ AND THE FILE ALREADY KNEW HOW TO SAY IT — IN ONE BRANCH ONLY. When nothing
|
|
180
|
+
* is detected the list reads *"none detected — add at least one, or a green
|
|
181
|
+
* round proves nothing"*, which is exactly the right sentence. It appears only
|
|
182
|
+
* when the list is EMPTY, and *"a green round proves nothing about your
|
|
183
|
+
* migrations"* is just as true when it is full.
|
|
184
|
+
*
|
|
185
|
+
* ⚠️ IT CLAIMS NOTHING ABOUT THIS REPOSITORY. Not that migrations exist, not
|
|
186
|
+
* that a contract is unchecked, not that the gates are insufficient. It says
|
|
187
|
+
* what was looked for, which is the only thing detection can honestly report.
|
|
188
|
+
*/
|
|
189
|
+
exports.GATES_ARE_TOOLCHAIN = [
|
|
190
|
+
'# Detected from the toolchain: the lockfile, package.json scripts and tsconfig.',
|
|
191
|
+
'# Contracts, data and migrations are not looked for — so a green round says',
|
|
192
|
+
'# nothing about them. Add a gate for anything here that has to hold.',
|
|
193
|
+
].join('\n');
|
|
194
|
+
function renderConfig(profile, answers) {
|
|
195
|
+
const gates = [
|
|
196
|
+
profile.typecheck ? ` - { name: "${profile.typecheck.name}", run: "${profile.typecheck.run}", timeout_s: 300 }` : null,
|
|
197
|
+
profile.testRunner
|
|
198
|
+
? ` - { name: "${profile.testRunner.name}", run: "${profile.testRunner.run}", timeout_s: 900, required: true }`
|
|
199
|
+
: null,
|
|
200
|
+
].filter(Boolean);
|
|
201
|
+
// An empty list must be written as `[]`, not as a comment where a value
|
|
202
|
+
// belongs: YAML reads a key with only comments under it as null, and the
|
|
203
|
+
// config parser then rejects the very file setup just produced.
|
|
204
|
+
const rails = answers.rails.length
|
|
205
|
+
? '\n' + answers.rails.map((p) => ` - "${p}"`).join('\n')
|
|
206
|
+
: ' [] # nothing is off limits until you list something here';
|
|
207
|
+
// Where work may happen. Detected workspaces become the free scope; without
|
|
208
|
+
// any, the whole repository is free, because a scope of nothing means a run
|
|
209
|
+
// that can never touch a file.
|
|
210
|
+
const free = profile.workspaces.length
|
|
211
|
+
? profile.workspaces.map((w) => `${w}/**`)
|
|
212
|
+
: ['**'];
|
|
213
|
+
const additive = answers.scope === 'improve' ? free : [];
|
|
214
|
+
return `# .looply/config.yaml
|
|
215
|
+
#
|
|
216
|
+
# Written by \`looply init\`. Meant to be read and edited — every value here is
|
|
217
|
+
# a decision, and the comments say what each one costs.
|
|
218
|
+
|
|
219
|
+
project:
|
|
220
|
+
name: "${profile.name}"
|
|
221
|
+
|
|
222
|
+
# Checks that decide whether a round's work is kept. Cheapest first: a broken
|
|
223
|
+
# typecheck should not wait on a full test suite.
|
|
224
|
+
#
|
|
225
|
+
${exports.GATES_ARE_TOOLCHAIN}
|
|
226
|
+
gates:
|
|
227
|
+
${gates.length ? gates.join('\n') : ' # none detected — add at least one, or a green round proves nothing'}
|
|
228
|
+
|
|
229
|
+
rails:
|
|
230
|
+
# looply reports what it finds in these and refuses to change them. A task
|
|
231
|
+
# that needs one becomes a question for you rather than an edit.
|
|
232
|
+
forbidden_paths:${rails}
|
|
233
|
+
${answers.prodDb
|
|
234
|
+
? ` # This machine can reach production, so a live connection string aborts the
|
|
235
|
+
# run before any check executes.
|
|
236
|
+
prod_patterns: [herokuapp, amazonaws, ".render.com", "supabase.co", ".neon.tech"]`
|
|
237
|
+
: ` prod_patterns: [herokuapp, amazonaws, ".render.com", "supabase.co", ".neon.tech"]`}
|
|
238
|
+
exemptions: ask # it may ask to cross a rail once, for one file. "never" to refuse outright.
|
|
239
|
+
|
|
240
|
+
run:
|
|
241
|
+
min_hours: ${answers.hours}
|
|
242
|
+
max_rounds: 400
|
|
243
|
+
cooldown_s: 5
|
|
244
|
+
|
|
245
|
+
proof:
|
|
246
|
+
# A second agent, which did not write the code, checks the change against the
|
|
247
|
+
# task before it is kept. Turning this off means work is kept on a passing
|
|
248
|
+
# build alone — which proves it compiles, not that it was worth doing.
|
|
249
|
+
enabled: true
|
|
250
|
+
on_partial: ask
|
|
251
|
+
|
|
252
|
+
queue:
|
|
253
|
+
topup_threshold: 5
|
|
254
|
+
topup_size: 10
|
|
255
|
+
# Caps near-identical chores in one batch. Without it a self-written queue
|
|
256
|
+
# drifts into seven versions of the same small fix.
|
|
257
|
+
max_same_shape: 3
|
|
258
|
+
|
|
259
|
+
scope:
|
|
260
|
+
# ${answers.scope === 'improve' ? 'Improve what exists: fixes, tests, missing states. No new flows.' : 'Anything, including new screens and flows.'}
|
|
261
|
+
free: [${free.map((p) => `"${p}"`).join(', ')}]
|
|
262
|
+
# Paths where only new files may be added, never existing ones edited.
|
|
263
|
+
additive: [${additive.map((p) => `"${p}"`).join(', ')}]
|
|
264
|
+
|
|
265
|
+
publish:
|
|
266
|
+
policy: ${answers.push}
|
|
267
|
+
|
|
268
|
+
notify:
|
|
269
|
+
channel: push
|
|
270
|
+
every_min: 30
|
|
271
|
+
`;
|
|
272
|
+
}
|
|
273
|
+
/** A short account of what was decided, shown when setup finishes. */
|
|
274
|
+
function summarise(answers, profile) {
|
|
275
|
+
return [
|
|
276
|
+
`project ${profile.name}`,
|
|
277
|
+
`checks ${[profile.typecheck?.name, profile.testRunner?.name].filter(Boolean).join(', ') || 'none detected'}`,
|
|
278
|
+
`rails ${answers.rails.length ? answers.rails.join(', ') : 'none — nothing is off limits'}`,
|
|
279
|
+
`publish ${answers.push}`,
|
|
280
|
+
`run ${answers.hours}h by default`,
|
|
281
|
+
];
|
|
282
|
+
}
|
|
283
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":";;;AA2CA,oCAkBC;AAwED,kCAuDC;AAsDD,oCAmFC;AAGD,8BAQC;AA3SD;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,OAAoB;IAC/C,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ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C,IAAI,CAAC,CAAC,CAAC,CAAC,8BAA8B,EAAE;QAChG,cAAc,OAAO,CAAC,IAAI,EAAE;QAC5B,cAAc,OAAO,CAAC,KAAK,cAAc;KAC1C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WHO MAY READ THE SHARED DIRECTORIES, AND WHEN THAT STOPS BEING TRUE.
|
|
3
|
+
*
|
|
4
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
* 🔴 THE MEASUREMENT THIS EXISTS FOR. Two directories are shared by every
|
|
6
|
+
* workspace on the machine — the toolchain mirror and the tool-worker directory
|
|
7
|
+
* — and each contained execution added an inheritable ACE for its own container
|
|
8
|
+
* SID. Nothing ever removed one. Measured on a real machine before this module:
|
|
9
|
+
*
|
|
10
|
+
* %TEMP%\looply-toolworker\<digest> 512 ACEs, 509 of them container SIDs
|
|
11
|
+
* ~\.looply\toolchains\node-v20.19.4-<h> 266 ACEs, 262 of them container SIDs
|
|
12
|
+
*
|
|
13
|
+
* A Windows DACL is capped at about 64 KB. At the cap `Set-Acl` throws, the
|
|
14
|
+
* helper reports `stage: 'grant'`, and every contained run on the machine stops
|
|
15
|
+
* — it fails CLOSED, which is the only good thing about it.
|
|
16
|
+
*
|
|
17
|
+
* ⚠️ THE PROFILE COUNT IS NOT THE ACE COUNT. A previous note reasoned from
|
|
18
|
+
* "1,921 container profiles" to saturation. Those numbers are unrelated: the
|
|
19
|
+
* grant lands on the toolchain and worker CHILD directories, not their roots,
|
|
20
|
+
* and the roots carry zero container ACEs. Both figures above were read off the
|
|
21
|
+
* actual DACLs.
|
|
22
|
+
*
|
|
23
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
24
|
+
* WHY A LEDGER, AND NOT JUST THE SID.
|
|
25
|
+
*
|
|
26
|
+
* A workspace-derived SID names the PRINCIPAL. It does not enumerate where that
|
|
27
|
+
* principal was ever granted. The toolchain directory is versioned — a node
|
|
28
|
+
* upgrade moves the mirror to a new path — so a SID granted on
|
|
29
|
+
* `node-v20.19.4-<h>` cannot be cleaned up by looking at wherever the mirror
|
|
30
|
+
* lives today. The ledger records the path that was actually granted.
|
|
31
|
+
*
|
|
32
|
+
* ⚠️ AND IT RECORDS THE NUMERIC SID. After a profile is deleted, a friendly
|
|
33
|
+
* name no longer resolves; the numeric identity still does, and `icacls` takes
|
|
34
|
+
* it directly. Recording the container name too costs nothing and keeps the
|
|
35
|
+
* rows readable.
|
|
36
|
+
*
|
|
37
|
+
* ⚠️ INTENT IS RECORDED BEFORE THE GRANT, NOT AFTER. A crash between the two
|
|
38
|
+
* would otherwise leave an ACE nothing remembers — the exact shape of the leak
|
|
39
|
+
* this module removes. A record whose grant never landed is harmless: the purge
|
|
40
|
+
* is idempotent and removing an ACE that is not there succeeds.
|
|
41
|
+
*
|
|
42
|
+
* Append-only, with a LEADING newline per record, so a torn write costs one row
|
|
43
|
+
* rather than corrupting the row beside it.
|
|
44
|
+
*/
|
|
45
|
+
export interface SharedGrantRecord {
|
|
46
|
+
/** The container profile name — derivable from (kind, workspace), and readable. */
|
|
47
|
+
name: string;
|
|
48
|
+
/** NUMERIC. The identity that still resolves after the profile is gone. */
|
|
49
|
+
sid: string;
|
|
50
|
+
/** The exact directory granted, which a later mirror move would otherwise lose. */
|
|
51
|
+
path: string;
|
|
52
|
+
at: string;
|
|
53
|
+
state: 'granted' | 'released';
|
|
54
|
+
}
|
|
55
|
+
export declare function sharedGrantsPath(home?: string): string;
|
|
56
|
+
/**
|
|
57
|
+
* F43: HOW LONG ONE GRANT WAITS FOR ANOTHER — longer than an ACL write takes.
|
|
58
|
+
*
|
|
59
|
+
* `icacls /grant (OI)(CI)` rewrites the entry on every file under the toolchain
|
|
60
|
+
* mirror, and the time grows with the list: 8–11 s on 09-15, 26–29 s on 09-26
|
|
61
|
+
* at ~1,230 entries. The shared mutex's default wait (5 s) is sized for
|
|
62
|
+
* check-and-claims that take microseconds, so a second identity arriving during
|
|
63
|
+
* a grant was refused ("could not be serialised") — a gate step or a tool call
|
|
64
|
+
* that did not run, and in the lane an inconclusive check nobody re-offers.
|
|
65
|
+
* A holder that dies is still broken at once (`withExclusiveLock`); this only
|
|
66
|
+
* bounds how long a LIVE holder is waited for.
|
|
67
|
+
*/
|
|
68
|
+
export declare const SHARED_GRANT_LOCK_WAIT_MS = 300000;
|
|
69
|
+
/** Every row, oldest first. A row that will not parse is skipped, never fatal. */
|
|
70
|
+
export declare function readSharedGrants(home?: string): SharedGrantRecord[];
|
|
71
|
+
/**
|
|
72
|
+
* What is still granted: the last state wins, per (sid, path).
|
|
73
|
+
*
|
|
74
|
+
* Folded rather than filtered, because a path can legitimately be granted,
|
|
75
|
+
* released, and granted again when a workspace identity is reused.
|
|
76
|
+
*/
|
|
77
|
+
export declare function liveSharedGrants(home?: string): SharedGrantRecord[];
|
|
78
|
+
export interface AclResult {
|
|
79
|
+
ok: boolean;
|
|
80
|
+
because?: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Add one inheritable read-and-execute ACE for a container SID.
|
|
84
|
+
*
|
|
85
|
+
* READ AND EXECUTE ONLY, on both shared paths, because both hold Looply's own
|
|
86
|
+
* artefacts: a container that could replace `node.exe` or the tool worker would
|
|
87
|
+
* be choosing what every later execution runs.
|
|
88
|
+
*/
|
|
89
|
+
export declare function grantAce(path: string, sid: string): AclResult;
|
|
90
|
+
/**
|
|
91
|
+
* Remove every granted ACE for one SID from one path, and nothing else.
|
|
92
|
+
*
|
|
93
|
+
* `/remove:g` names a single principal. It cannot touch another SID's entry, an
|
|
94
|
+
* inherited entry, or the owner's own rights — which is what "without changing
|
|
95
|
+
* unrelated user permissions" has to mean in practice.
|
|
96
|
+
*/
|
|
97
|
+
export declare function removeAce(path: string, sid: string): AclResult;
|
|
98
|
+
export interface SharedGrantDeps {
|
|
99
|
+
home?: string;
|
|
100
|
+
/** Overridable so tests drive the ledger and the lock without touching ACLs. */
|
|
101
|
+
grant?: (path: string, sid: string) => AclResult;
|
|
102
|
+
remove?: (path: string, sid: string) => AclResult;
|
|
103
|
+
now?: () => Date;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Make sure this identity may read a shared path, recording that it now may.
|
|
107
|
+
*
|
|
108
|
+
* 🔴 THE SAME LOCK AS THE REMOVAL, WHICH IS THE POINT. `Set-Acl` and `icacls`
|
|
109
|
+
* are both read-modify-write over one DACL, so an addition racing a removal
|
|
110
|
+
* loses whichever entry it did not see. Locking only the cleanup would leave
|
|
111
|
+
* exactly that race open on every launch.
|
|
112
|
+
*
|
|
113
|
+
* ⚠️ THE CRITICAL SECTION IS THE ACL WRITE, AND NOTHING MORE. The lock is taken
|
|
114
|
+
* here and released before the caller launches anything: it is never held
|
|
115
|
+
* across a provider invocation or a gate step.
|
|
116
|
+
*
|
|
117
|
+
* Idempotent: an identity already recorded as holding this path does no ACL work
|
|
118
|
+
* at all, so the cost is paid once per identity rather than once per launch.
|
|
119
|
+
*/
|
|
120
|
+
export declare function ensureSharedGrant(name: string, sid: string, path: string, deps?: SharedGrantDeps): AclResult;
|
|
121
|
+
/** The narrow slice of the containment backend this needs: a SID lookup. */
|
|
122
|
+
export interface SidSource {
|
|
123
|
+
call(req: {
|
|
124
|
+
action: string;
|
|
125
|
+
profile: string;
|
|
126
|
+
}): Promise<{
|
|
127
|
+
ok: boolean;
|
|
128
|
+
sid?: string;
|
|
129
|
+
error?: string;
|
|
130
|
+
}>;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Ensure one container identity may read the shared paths, before it launches.
|
|
134
|
+
*
|
|
135
|
+
* ⚠️ THE COMMON CASE COSTS NOTHING. An identity whose rows are already in the
|
|
136
|
+
* ledger takes no lock, makes no probe and touches no ACL — so the extra round
|
|
137
|
+
* trip is paid once per identity, not once per launch.
|
|
138
|
+
*/
|
|
139
|
+
export declare function ensureSharedAccess(backend: SidSource | null, name: string, paths: readonly string[], deps?: SharedGrantDeps): Promise<AclResult>;
|
|
140
|
+
export interface ReleaseOutcome {
|
|
141
|
+
released: {
|
|
142
|
+
path: string;
|
|
143
|
+
sid: string;
|
|
144
|
+
}[];
|
|
145
|
+
pending: {
|
|
146
|
+
path: string;
|
|
147
|
+
sid: string;
|
|
148
|
+
because: string;
|
|
149
|
+
}[];
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Give back every shared-path grant held by these identities.
|
|
153
|
+
*
|
|
154
|
+
* 🔴 CALLED ONLY FOR AN IDENTITY WHOSE WORKSPACE IS BEING RETIRED, and the
|
|
155
|
+
* caller establishes that. This function does not decide liveness; it does the
|
|
156
|
+
* ACL work for a decision already made, so a caller that skips the check cannot
|
|
157
|
+
* be rescued here.
|
|
158
|
+
*
|
|
159
|
+
* ⚠️ A FAILURE LEAVES THE ROW `granted`, DELIBERATELY. That is the truthful
|
|
160
|
+
* cleanup-pending state: the next retirement sweep finds the row and tries
|
|
161
|
+
* again, and nothing ever reports cleanup it did not do.
|
|
162
|
+
*/
|
|
163
|
+
export declare function releaseSharedGrants(names: readonly string[], deps?: SharedGrantDeps): ReleaseOutcome;
|
|
164
|
+
//# sourceMappingURL=shared-grants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-grants.d.ts","sourceRoot":"","sources":["../src/shared-grants.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,WAAW,iBAAiB;IAChC,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,GAAG,EAAE,MAAM,CAAC;IACZ,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,GAAG,UAAU,CAAC;CAC/B;AAED,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,MAAkB,GAAG,MAAM,CAEjE;AAED;;;;;;;;;;;GAWG;AACH,eAAO,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