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,479 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppContainerBackend = exports.HELPER_TIMEOUT_MS = exports.HELPER_SETUP_CEILING_MS = exports.HELPER_KILL_GRACE_MS = exports.PLATFORM_BASE = exports.MAX_CONTAINED_OUTPUT_BYTES = void 0;
|
|
4
|
+
exports.containerName = containerName;
|
|
5
|
+
exports.windowsCommandLine = windowsCommandLine;
|
|
6
|
+
exports.systemEnv = systemEnv;
|
|
7
|
+
exports.systemRoot = systemRoot;
|
|
8
|
+
exports.helperCeilingMs = helperCeilingMs;
|
|
9
|
+
exports.windowsPowerShellEnv = windowsPowerShellEnv;
|
|
10
|
+
const node_child_process_1 = require("node:child_process");
|
|
11
|
+
const node_crypto_1 = require("node:crypto");
|
|
12
|
+
const node_fs_1 = require("node:fs");
|
|
13
|
+
const node_os_1 = require("node:os");
|
|
14
|
+
const node_path_1 = require("node:path");
|
|
15
|
+
/**
|
|
16
|
+
* How much of a contained child's output crosses back into the daemon.
|
|
17
|
+
*
|
|
18
|
+
* 🔴 IT WAS UNBOUNDED. `readFileSync(path, 'utf8')` pulled the whole file into
|
|
19
|
+
* the daemon's heap, so a contained process — project-controlled code, which is
|
|
20
|
+
* the entire premise of this file — could exhaust the daemon's memory simply by
|
|
21
|
+
* writing to stdout. The boundary held on authority and leaked on VOLUME.
|
|
22
|
+
*
|
|
23
|
+
* Two megabytes, and the derivation rather than the taste: the largest thing a
|
|
24
|
+
* legitimate gate step produces here is a verbose test run, which is tens of
|
|
25
|
+
* kilobytes; `tool-protocol.ts` already caps a single file READ at 256 KB; and
|
|
26
|
+
* this must stay comfortably below the point where a handful of concurrent runs
|
|
27
|
+
* matters. Generous by two orders of magnitude for real use, and finite.
|
|
28
|
+
*/
|
|
29
|
+
exports.MAX_CONTAINED_OUTPUT_BYTES = 2 * 1024 * 1024;
|
|
30
|
+
/**
|
|
31
|
+
* A container identity for one project and one trust domain.
|
|
32
|
+
*
|
|
33
|
+
* Deterministic so a restart reuses the profile rather than leaking a new one,
|
|
34
|
+
* and hashed so no part of a path — which the user chose and which may contain
|
|
35
|
+
* anything — reaches a Windows profile name.
|
|
36
|
+
*/
|
|
37
|
+
function containerName(kind, projectKey) {
|
|
38
|
+
const digest = (0, node_crypto_1.createHash)('sha256').update(projectKey, 'utf8').digest('hex').slice(0, 24);
|
|
39
|
+
const domain = kind.charAt(0).toUpperCase() + kind.slice(1);
|
|
40
|
+
return `Looply.${domain}.${digest}`;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* One Windows command line from an executable and its arguments.
|
|
44
|
+
*
|
|
45
|
+
* CreateProcess takes a single string, so the arguments have to be joined — and
|
|
46
|
+
* that join is the place a filename with a space or a quote in it turns into a
|
|
47
|
+
* second argument. The rules are the ones the C runtime parses back.
|
|
48
|
+
*/
|
|
49
|
+
function windowsCommandLine(exe, argv) {
|
|
50
|
+
const quote = (s) => {
|
|
51
|
+
if (s.length > 0 && !/[ \t"]/.test(s))
|
|
52
|
+
return s;
|
|
53
|
+
let out = '"';
|
|
54
|
+
let slashes = 0;
|
|
55
|
+
for (const ch of s) {
|
|
56
|
+
if (ch === '\\') {
|
|
57
|
+
slashes += 1;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (ch === '"') {
|
|
61
|
+
out += '\\'.repeat(slashes * 2 + 1) + '"';
|
|
62
|
+
slashes = 0;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
out += '\\'.repeat(slashes) + ch;
|
|
66
|
+
slashes = 0;
|
|
67
|
+
}
|
|
68
|
+
return `${out}${'\\'.repeat(slashes * 2)}"`;
|
|
69
|
+
};
|
|
70
|
+
return [exe, ...argv].map(quote).join(' ');
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The caller's environment, plus the one variable Windows cannot start without.
|
|
74
|
+
*
|
|
75
|
+
* A custom environment block that omits `SystemRoot` makes CreateProcess fail
|
|
76
|
+
* with ERROR_ENVVAR_NOT_FOUND (203) — the loader resolves system libraries
|
|
77
|
+
* through it, so a child without it cannot start at all. That is not a policy
|
|
78
|
+
* choice a caller should be able to get wrong: it is not a secret, it names a
|
|
79
|
+
* directory every process on the machine can already see, and the failure it
|
|
80
|
+
* causes names an environment variable without saying which one.
|
|
81
|
+
*/
|
|
82
|
+
function systemEnv(env) {
|
|
83
|
+
const out = {};
|
|
84
|
+
for (const name of exports.PLATFORM_BASE) {
|
|
85
|
+
const v = process.env[name];
|
|
86
|
+
if (typeof v === 'string' && v.length > 0)
|
|
87
|
+
out[name] = v;
|
|
88
|
+
}
|
|
89
|
+
// The caller's own variables win, so a domain builder can narrow or replace
|
|
90
|
+
// any of these deliberately.
|
|
91
|
+
for (const [k, v] of Object.entries(env)) {
|
|
92
|
+
if (typeof v === 'string' && v.length > 0)
|
|
93
|
+
out[k] = v;
|
|
94
|
+
}
|
|
95
|
+
return out;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* What Windows needs before a contained process can start at all.
|
|
99
|
+
*
|
|
100
|
+
* Found by bisection, not by taste. A block with only `SystemRoot` fails, and
|
|
101
|
+
* so does one with `SystemRoot`, `windir`, `SystemDrive`, `PATH`, `PATHEXT` and
|
|
102
|
+
* `ComSpec` — CreateProcess answers ERROR_ENVVAR_NOT_FOUND (203), which says a
|
|
103
|
+
* required variable is missing without saying which. Adding the profile and
|
|
104
|
+
* AppData roots is what makes it launch: an AppContainer REDIRECTS AppData, so
|
|
105
|
+
* the loader needs those roots to resolve the container's own storage.
|
|
106
|
+
*
|
|
107
|
+
* None of these is a secret. They name directories every process on the machine
|
|
108
|
+
* can already see, and none of them carries a credential — which is the whole
|
|
109
|
+
* distinction this file is built on. Anything that does carry one is supplied
|
|
110
|
+
* per-domain by the caller, or not at all.
|
|
111
|
+
*/
|
|
112
|
+
exports.PLATFORM_BASE = [
|
|
113
|
+
'SystemRoot',
|
|
114
|
+
'windir',
|
|
115
|
+
'SystemDrive',
|
|
116
|
+
'PATH',
|
|
117
|
+
'PATHEXT',
|
|
118
|
+
'ComSpec',
|
|
119
|
+
'NUMBER_OF_PROCESSORS',
|
|
120
|
+
'PROCESSOR_ARCHITECTURE',
|
|
121
|
+
'OS',
|
|
122
|
+
'USERPROFILE',
|
|
123
|
+
'APPDATA',
|
|
124
|
+
'LOCALAPPDATA',
|
|
125
|
+
'ALLUSERSPROFILE',
|
|
126
|
+
'ProgramData',
|
|
127
|
+
'ProgramFiles',
|
|
128
|
+
'TEMP',
|
|
129
|
+
'TMP',
|
|
130
|
+
];
|
|
131
|
+
/** Where the source-controlled helper lives, relative to the built CLI. */
|
|
132
|
+
/**
|
|
133
|
+
* The Windows system root, as an ABSOLUTE path or not at all.
|
|
134
|
+
*
|
|
135
|
+
* ⚠️ `?? 'C:\Windows'` WAS NOT ENOUGH, TWICE OVER.
|
|
136
|
+
*
|
|
137
|
+
* First: in a single-quoted TypeScript string `\W` is not an escape, so
|
|
138
|
+
* `'C:\Windows'` is the RELATIVE path `C:Windows` — `join` then yields
|
|
139
|
+
* `C:Windows\System32\…`, resolved against whatever the working directory
|
|
140
|
+
* happens to be. Measured, not assumed: `path.isAbsolute('C:\Windows')` is
|
|
141
|
+
* false. That is why the fallback here is spelled with `join`, not a literal.
|
|
142
|
+
*
|
|
143
|
+
* Second, and still open until this existed: `??` falls through on `undefined`
|
|
144
|
+
* and `null` ONLY. An EMPTY `SystemRoot` — `SystemRoot=` in the environment, or
|
|
145
|
+
* an allowlist that copied the name but not the value — passed straight
|
|
146
|
+
* through, and `join('', 'System32')` is `System32`: relative again, and this
|
|
147
|
+
* time resolved against the CHILD's working directory, which for a contained
|
|
148
|
+
* agent is the project worktree. A `System32\taskkill.exe` planted there would
|
|
149
|
+
* be found first. It is the `gitBinary` hole spelled with an environment
|
|
150
|
+
* variable instead of a bare command name.
|
|
151
|
+
*
|
|
152
|
+
* ⚠️ SO IT CHECKS THE VALUE, NOT ITS PRESENCE. A system root that is not
|
|
153
|
+
* absolute is not a system root, whatever the environment says. Five call
|
|
154
|
+
* sites used to spell this two different ways; they all ask here now.
|
|
155
|
+
*
|
|
156
|
+
* 🔴 ABSOLUTE BY WINDOWS' RULES, NOT THE HOST'S. `isAbsolute` from `node:path`
|
|
157
|
+
* answers for the platform the process is on, and on a POSIX host it reports
|
|
158
|
+
* `D:\Windows` — and the `C:\Windows` fallback itself — as RELATIVE. So every
|
|
159
|
+
* value failed the guard and the fallback was returned in a spelling that then
|
|
160
|
+
* failed its own test. The value this function deals in is a Windows path
|
|
161
|
+
* whatever host is asking about it, so it is judged and built with `win32`,
|
|
162
|
+
* which answers the same on both platforms. Still not a literal, for the
|
|
163
|
+
* escaping reason above.
|
|
164
|
+
*/
|
|
165
|
+
function systemRoot(env = process.env) {
|
|
166
|
+
const declared = env['SystemRoot'];
|
|
167
|
+
return declared !== undefined && declared !== '' && node_path_1.win32.isAbsolute(declared)
|
|
168
|
+
? declared
|
|
169
|
+
: node_path_1.win32.join('C:', 'Windows');
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* The interpreter, by absolute path rather than by PATH lookup.
|
|
173
|
+
*
|
|
174
|
+
* PowerShell lives in a SUBDIRECTORY of System32, so a process whose PATH was
|
|
175
|
+
* deliberately narrowed — which is every process Looply builds an environment
|
|
176
|
+
* for — cannot resolve the bare name. The tool bridge is exactly that case: it
|
|
177
|
+
* is trusted code, but it is launched by the provider transport and inherits
|
|
178
|
+
* the transport's minimal PATH, and the failure it produced was an unreadable
|
|
179
|
+
* "containment unavailable" rather than anything about containment.
|
|
180
|
+
*/
|
|
181
|
+
function powershellPath() {
|
|
182
|
+
const win = systemRoot();
|
|
183
|
+
return (0, node_path_1.join)(win, 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe');
|
|
184
|
+
}
|
|
185
|
+
function helperPath() {
|
|
186
|
+
// `dist/` sits beside `win/` in the published package and in the workspace.
|
|
187
|
+
return (0, node_path_1.join)(__dirname, '..', 'win', 'appcontainer.ps1');
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* How long the containment helper may take to answer, in total.
|
|
191
|
+
*
|
|
192
|
+
* Generous on purpose. The helper's slow parts are real work, not hangs: a cold
|
|
193
|
+
* PowerShell start, an `Add-Type` C# compilation, and an inheritable-ACL
|
|
194
|
+
* propagation that was measured at ~6 s when the 166 MB toolchain mirror is in
|
|
195
|
+
* the grant set. This is a floor under a wedge, not a performance budget, and a
|
|
196
|
+
* ceiling that fired during ordinary work would be worse than none.
|
|
197
|
+
*/
|
|
198
|
+
/** How long a killed helper gets to actually die before the answer is sent. */
|
|
199
|
+
exports.HELPER_KILL_GRACE_MS = 5_000;
|
|
200
|
+
exports.HELPER_SETUP_CEILING_MS = 60_000;
|
|
201
|
+
/**
|
|
202
|
+
* The flat ceiling, for calls that run no contained child.
|
|
203
|
+
*
|
|
204
|
+
* `probe` and `remove` do profile work only, so a constant is right for them.
|
|
205
|
+
* `run` MUST NOT use it — see {@link AppContainerBackend.call}.
|
|
206
|
+
*/
|
|
207
|
+
exports.HELPER_TIMEOUT_MS = exports.HELPER_SETUP_CEILING_MS;
|
|
208
|
+
/**
|
|
209
|
+
* The ceiling for one helper call, given the child budget that call carries.
|
|
210
|
+
*
|
|
211
|
+
* Exported as a pure function because the timer itself has no test seam:
|
|
212
|
+
* `AppContainerDeps.invoke` short-circuits before the timer is ever created, so
|
|
213
|
+
* every injected backend bypasses it. This is the part worth pinning — that the
|
|
214
|
+
* ceiling lands ABOVE `spec.timeoutMs` and never underneath it.
|
|
215
|
+
*/
|
|
216
|
+
function helperCeilingMs(childTimeoutMs = 0) {
|
|
217
|
+
return exports.HELPER_SETUP_CEILING_MS + childTimeoutMs;
|
|
218
|
+
}
|
|
219
|
+
class AppContainerBackend {
|
|
220
|
+
deps;
|
|
221
|
+
constructor(deps = {}) {
|
|
222
|
+
this.deps = deps;
|
|
223
|
+
}
|
|
224
|
+
call(request, childTimeoutMs = 0) {
|
|
225
|
+
if (this.deps.invoke)
|
|
226
|
+
return this.deps.invoke(request);
|
|
227
|
+
const script = this.deps.helper ?? helperPath();
|
|
228
|
+
/**
|
|
229
|
+
* 🔴 THE CEILING SITS ABOVE `spec.timeoutMs`, NEVER UNDERNEATH IT.
|
|
230
|
+
*
|
|
231
|
+
* The helper's own `WaitForSingleObject(pi.hProcess, timeoutMs)` happens
|
|
232
|
+
* INSIDE this one call, so a flat constant here silently becomes the real
|
|
233
|
+
* gate-step budget. The first version of this was 120 s flat, and this
|
|
234
|
+
* repository's own gate declares `jest` at 900 s and takes 140 s — so
|
|
235
|
+
* every full test run would have been killed and reported as
|
|
236
|
+
* "a container could not be made", on a machine where nothing was wrong.
|
|
237
|
+
* `DEFAULT_TIMEOUT_S` is 600. A ceiling that fires during ordinary work is
|
|
238
|
+
* worse than no ceiling, and that one did.
|
|
239
|
+
*
|
|
240
|
+
* So the ceiling is the caller's own child budget PLUS a floor for the
|
|
241
|
+
* work that budget does not cover: PowerShell startup, the `Add-Type`
|
|
242
|
+
* compilation, the ACL grant loop (~6.5 s measured for the 166 MB
|
|
243
|
+
* toolchain mirror) and the protect loop.
|
|
244
|
+
*/
|
|
245
|
+
const ceilingMs = helperCeilingMs(childTimeoutMs);
|
|
246
|
+
let settled = false;
|
|
247
|
+
return new Promise((resolve) => {
|
|
248
|
+
// argv, never a shell string: nothing the agent writes can become a
|
|
249
|
+
// command, because there is no shell to interpret one.
|
|
250
|
+
const child = (0, node_child_process_1.spawn)(powershellPath(), ['-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-File', script], { stdio: ['pipe', 'pipe', 'pipe'], env: windowsPowerShellEnv() });
|
|
251
|
+
const settle = (reply) => {
|
|
252
|
+
if (settled)
|
|
253
|
+
return;
|
|
254
|
+
settled = true;
|
|
255
|
+
clearTimeout(giveUp);
|
|
256
|
+
resolve(reply);
|
|
257
|
+
};
|
|
258
|
+
const timedOut = {
|
|
259
|
+
ok: false,
|
|
260
|
+
stage: 'helper',
|
|
261
|
+
error: `the containment helper did not answer within ${ceilingMs} ms ` +
|
|
262
|
+
`(it was killed; the machine may be unable to make a container)`,
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* ⚠️ KILL, THEN WAIT FOR `close` — never resolve straight from the timer.
|
|
266
|
+
*
|
|
267
|
+
* The contained child inherits the helper's stdout/stderr handles, so
|
|
268
|
+
* returning the instant PowerShell is signalled races the child's exit:
|
|
269
|
+
* `run()`'s `rmSync(box)` then THROWS (`ENOTEMPTY`/`EBUSY`; `force` does
|
|
270
|
+
* not suppress it, it only ignores a path that is not there), and that
|
|
271
|
+
* throw escapes every try in the round loop. Giving the tree a moment to
|
|
272
|
+
* actually die is the difference between a bounded containment failure
|
|
273
|
+
* and a run that ends with no `run.ended` and a stranded item.
|
|
274
|
+
*/
|
|
275
|
+
const giveUp = setTimeout(() => {
|
|
276
|
+
if (settled)
|
|
277
|
+
return;
|
|
278
|
+
try {
|
|
279
|
+
child.kill();
|
|
280
|
+
}
|
|
281
|
+
catch {
|
|
282
|
+
// Already gone, or unkillable. The grace timer still answers.
|
|
283
|
+
}
|
|
284
|
+
const grace = setTimeout(() => {
|
|
285
|
+
if (settled)
|
|
286
|
+
return;
|
|
287
|
+
settled = true;
|
|
288
|
+
resolve(timedOut);
|
|
289
|
+
}, exports.HELPER_KILL_GRACE_MS);
|
|
290
|
+
child.once('close', () => {
|
|
291
|
+
clearTimeout(grace);
|
|
292
|
+
if (settled)
|
|
293
|
+
return;
|
|
294
|
+
settled = true;
|
|
295
|
+
resolve(timedOut);
|
|
296
|
+
});
|
|
297
|
+
}, ceilingMs);
|
|
298
|
+
const out = [];
|
|
299
|
+
const err = [];
|
|
300
|
+
child.stdout.on('data', (d) => out.push(d.toString('utf8')));
|
|
301
|
+
child.stderr.on('data', (d) => err.push(d.toString('utf8')));
|
|
302
|
+
child.on('error', (e) => settle({ ok: false, stage: 'helper', error: `the containment helper could not start (${e.message})` }));
|
|
303
|
+
child.on('close', () => {
|
|
304
|
+
const text = out.join('').trim();
|
|
305
|
+
try {
|
|
306
|
+
settle(JSON.parse(text));
|
|
307
|
+
}
|
|
308
|
+
catch {
|
|
309
|
+
settle({
|
|
310
|
+
ok: false,
|
|
311
|
+
stage: 'helper',
|
|
312
|
+
error: `the containment helper answered nothing readable (${err.join('').trim().slice(0, 300)})`,
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
child.stdin.end(JSON.stringify(request));
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
async probe() {
|
|
320
|
+
if (process.platform !== 'win32') {
|
|
321
|
+
return { available: false, backend: 'appcontainer', because: 'AppContainer is a Windows boundary' };
|
|
322
|
+
}
|
|
323
|
+
const reply = await this.call({ action: 'probe', profile: containerName('fixture', 'probe') });
|
|
324
|
+
return reply.ok
|
|
325
|
+
? { available: true, backend: 'appcontainer' }
|
|
326
|
+
: { available: false, backend: 'appcontainer', because: reply.error ?? 'unavailable' };
|
|
327
|
+
}
|
|
328
|
+
async run(spec) {
|
|
329
|
+
if (process.platform !== 'win32') {
|
|
330
|
+
return {
|
|
331
|
+
ok: false,
|
|
332
|
+
reason: 'containment_unavailable',
|
|
333
|
+
stage: 'platform',
|
|
334
|
+
because: 'no untrusted-execution boundary is implemented for this platform',
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
// Output travels on handles WE open and the child inherits, so the files
|
|
338
|
+
// never have to be granted to the container — the transport cannot widen
|
|
339
|
+
// the filesystem policy.
|
|
340
|
+
const box = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'looply-ue-'));
|
|
341
|
+
try {
|
|
342
|
+
const stdoutPath = (0, node_path_1.join)(box, 'out');
|
|
343
|
+
const stderrPath = (0, node_path_1.join)(box, 'err');
|
|
344
|
+
let stdinPath = '';
|
|
345
|
+
if (spec.stdin !== undefined) {
|
|
346
|
+
stdinPath = (0, node_path_1.join)(box, 'in');
|
|
347
|
+
(0, node_fs_1.writeFileSync)(stdinPath, spec.stdin, 'utf8');
|
|
348
|
+
}
|
|
349
|
+
const reply = await this.call({
|
|
350
|
+
action: 'run',
|
|
351
|
+
profile: containerName(spec.kind, spec.projectKey),
|
|
352
|
+
env: systemEnv(spec.env),
|
|
353
|
+
executable: spec.executable,
|
|
354
|
+
commandLine: spec.rawCommandLine ?? windowsCommandLine(spec.executable, spec.argv),
|
|
355
|
+
cwd: spec.cwd,
|
|
356
|
+
grants: spec.grants.map((g) => ({ path: g.path, write: g.write === true })),
|
|
357
|
+
protect: spec.protect ?? [],
|
|
358
|
+
network: spec.network,
|
|
359
|
+
stdoutPath,
|
|
360
|
+
stderrPath,
|
|
361
|
+
stdinPath,
|
|
362
|
+
timeoutMs: spec.timeoutMs,
|
|
363
|
+
},
|
|
364
|
+
// The child's own budget, so the ceiling above lands ABOVE it.
|
|
365
|
+
spec.timeoutMs);
|
|
366
|
+
if (!reply.ok) {
|
|
367
|
+
const stage = reply.stage ?? 'unknown';
|
|
368
|
+
return {
|
|
369
|
+
ok: false,
|
|
370
|
+
reason: stage === 'profile' || stage === 'helper' || stage === 'compile' || stage === 'protect'
|
|
371
|
+
? 'containment_unavailable'
|
|
372
|
+
: 'containment_launch_failed',
|
|
373
|
+
stage,
|
|
374
|
+
because: reply.error ?? 'the contained process could not start',
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
const read = (p) => {
|
|
378
|
+
try {
|
|
379
|
+
const size = (0, node_fs_1.statSync)(p).size;
|
|
380
|
+
if (size <= exports.MAX_CONTAINED_OUTPUT_BYTES) {
|
|
381
|
+
const whole = Buffer.alloc(size);
|
|
382
|
+
const fd = (0, node_fs_1.openSync)(p, 'r');
|
|
383
|
+
try {
|
|
384
|
+
(0, node_fs_1.readSync)(fd, whole, 0, size, 0);
|
|
385
|
+
}
|
|
386
|
+
finally {
|
|
387
|
+
(0, node_fs_1.closeSync)(fd);
|
|
388
|
+
}
|
|
389
|
+
return whole.toString('utf8');
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Over the bound: keep the head and the tail, and SAY what was
|
|
393
|
+
* dropped. A silent truncation reads as output that simply ended,
|
|
394
|
+
* which is exactly how a reader concludes the wrong thing about a
|
|
395
|
+
* command that produced far more than it should have.
|
|
396
|
+
*/
|
|
397
|
+
const half = Math.floor(exports.MAX_CONTAINED_OUTPUT_BYTES / 2);
|
|
398
|
+
const head = Buffer.alloc(half);
|
|
399
|
+
const tail = Buffer.alloc(half);
|
|
400
|
+
const fd = (0, node_fs_1.openSync)(p, 'r');
|
|
401
|
+
try {
|
|
402
|
+
(0, node_fs_1.readSync)(fd, head, 0, half, 0);
|
|
403
|
+
(0, node_fs_1.readSync)(fd, tail, 0, half, size - half);
|
|
404
|
+
}
|
|
405
|
+
finally {
|
|
406
|
+
(0, node_fs_1.closeSync)(fd);
|
|
407
|
+
}
|
|
408
|
+
const dropped = size - half * 2;
|
|
409
|
+
return `${head.toString('utf8')}\n… ${dropped} bytes of output dropped: this command produced ${size} bytes, over the ${exports.MAX_CONTAINED_OUTPUT_BYTES}-byte bound …\n${tail.toString('utf8')}`;
|
|
410
|
+
}
|
|
411
|
+
catch {
|
|
412
|
+
return '';
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
return {
|
|
416
|
+
ok: true,
|
|
417
|
+
exitCode: reply.exitCode ?? 1,
|
|
418
|
+
stdout: read(stdoutPath),
|
|
419
|
+
stderr: read(stderrPath),
|
|
420
|
+
timedOut: reply.timedOut === true,
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
finally {
|
|
424
|
+
/**
|
|
425
|
+
* NON-FATAL, AND RETRIED. A contained child that outlived its helper
|
|
426
|
+
* still holds the inherited handles on `out`/`err`, and Windows then
|
|
427
|
+
* refuses the directory — `force` does not help, it only ignores a path
|
|
428
|
+
* that does not exist. A leaked temp directory is a mess; a throw here
|
|
429
|
+
* escapes every try in the round loop and ends the run with no
|
|
430
|
+
* `run.ended` and a stranded item.
|
|
431
|
+
*/
|
|
432
|
+
try {
|
|
433
|
+
(0, node_fs_1.rmSync)(box, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 });
|
|
434
|
+
}
|
|
435
|
+
catch {
|
|
436
|
+
// Left behind on purpose rather than taking the caller down with it.
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
/** Remove a container profile. Used by tests; production profiles persist. */
|
|
441
|
+
async remove(kind, projectKey) {
|
|
442
|
+
const reply = await this.call({ action: 'remove', profile: containerName(kind, projectKey) });
|
|
443
|
+
return reply.ok;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
exports.AppContainerBackend = AppContainerBackend;
|
|
447
|
+
/**
|
|
448
|
+
* The environment Windows PowerShell 5.1 needs, rather than the one it inherited.
|
|
449
|
+
*
|
|
450
|
+
* 🔴 POWERSHELL 7 POISONS `PSModulePath` FOR POWERSHELL 5.1. When the daemon is
|
|
451
|
+
* started from a `pwsh` session, `PSModulePath` carries
|
|
452
|
+
* `…\PowerShell\7\Modules`, and 5.1 then loads SEVEN's
|
|
453
|
+
* `Microsoft.PowerShell.Security` on top of its own. The extended type data
|
|
454
|
+
* collides — "The member AuditToString is already present" — the module fails to
|
|
455
|
+
* load, `Get-Acl` cannot resolve, and every containment request is refused.
|
|
456
|
+
*
|
|
457
|
+
* ⚠️ IT FAILS CLOSED, WHICH IS WHY IT WENT UNNOTICED. Containment refuses rather
|
|
458
|
+
* than running uncontained, so nothing unsafe happens; the run simply cannot
|
|
459
|
+
* start, with a message about a PowerShell module that says nothing about
|
|
460
|
+
* PowerShell versions. Reproduced by launching the same suite from `pwsh`
|
|
461
|
+
* (5 of 5 red) and from bash (5 of 5 green) on one machine, one commit.
|
|
462
|
+
*
|
|
463
|
+
* The variable is REPLACED with 5.1's own default rather than deleted: deleting
|
|
464
|
+
* it makes 5.1 fall back to a built-in default that omits the machine-wide
|
|
465
|
+
* module directory, which is a different breakage for anyone relying on it.
|
|
466
|
+
*/
|
|
467
|
+
function windowsPowerShellEnv() {
|
|
468
|
+
const win = systemRoot();
|
|
469
|
+
const home = process.env['USERPROFILE'];
|
|
470
|
+
const psModulePath = [
|
|
471
|
+
home ? (0, node_path_1.join)(home, 'Documents', 'WindowsPowerShell', 'Modules') : null,
|
|
472
|
+
(0, node_path_1.join)('C:', 'Program Files', 'WindowsPowerShell', 'Modules'),
|
|
473
|
+
(0, node_path_1.join)(win, 'System32', 'WindowsPowerShell', 'v1.0', 'Modules'),
|
|
474
|
+
]
|
|
475
|
+
.filter((p) => p !== null)
|
|
476
|
+
.join(';');
|
|
477
|
+
return { ...process.env, PSModulePath: psModulePath };
|
|
478
|
+
}
|
|
479
|
+
//# sourceMappingURL=untrusted-exec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"untrusted-exec.js","sourceRoot":"","sources":["../src/untrusted-exec.ts"],"names":[],"mappings":";;;AA8IA,sCAIC;AASD,gDAqBC;AAYD,8BAYC;AAgFD,gCAKC;AA0DD,0CAEC;AAsPD,oDAWC;AA1lBD,2DAA2C;AAC3C,6CAAyC;AACzC,qCAAsG;AACtG,qCAAiC;AACjC,yCAAwC;AA8BxC;;;;;;;;;;;;;GAaG;AACU,QAAA,0BAA0B,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAuF1D;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,IAAmB,EAAE,UAAkB;IACnE,MAAM,MAAM,GAAG,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1F,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5D,OAAO,UAAU,MAAM,IAAI,MAAM,EAAE,CAAC;AACtC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAAC,GAAW,EAAE,IAAuB;IACrE,MAAM,KAAK,GAAG,CAAC,CAAS,EAAU,EAAE;QAClC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;QAChD,IAAI,GAAG,GAAG,GAAG,CAAC;QACd,IAAI,OAAO,GAAG,CAAC,CAA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AAC,KAAK,IAAI,CAAC;SACtC,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,OAAO,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type ToolchainResult } from './toolchain-mirror';
|
|
2
|
+
import type { CommandResult, CommandRunner } from './gate';
|
|
3
|
+
import { type UntrustedExecutionBackend } from './untrusted-exec';
|
|
4
|
+
/**
|
|
5
|
+
* THE GATE RUNS THE PROJECT'S CODE, SO IT RUNS INSIDE THE BOUNDARY.
|
|
6
|
+
*
|
|
7
|
+
* A gate step is `npm test`, and npm is not the point — the tests underneath it
|
|
8
|
+
* are, and the coding agent wrote them. Until now they ran as the daemon, with
|
|
9
|
+
* its environment, able to read `~/.looply/machine.json` and to edit the state
|
|
10
|
+
* directory that decides whether the machine may keep working.
|
|
11
|
+
*
|
|
12
|
+
* The step keeps its shape. It is still a shell line from `config.yaml`, still
|
|
13
|
+
* measured by the same timeout, still reported by the same `CommandResult` —
|
|
14
|
+
* because the shell is no longer the thing being defended against. It runs
|
|
15
|
+
* inside an AppContainer that was granted the worktree and nothing else, so
|
|
16
|
+
* what the line says matters much less than where it can reach.
|
|
17
|
+
*
|
|
18
|
+
* NO FALLBACK. If the container cannot be made, the step FAILS. A gate that
|
|
19
|
+
* quietly ran as the daemon because containment was unavailable would be worse
|
|
20
|
+
* than one that did not run at all: the round would go green having proved
|
|
21
|
+
* something about a different machine than the one it claimed.
|
|
22
|
+
*/
|
|
23
|
+
export interface UntrustedGateDeps {
|
|
24
|
+
backend?: UntrustedExecutionBackend;
|
|
25
|
+
/** Overridable so tests never build against the real toolchain. */
|
|
26
|
+
toolchain?: () => ToolchainResult;
|
|
27
|
+
/** Overridable for tests; production reads the platform's own shell. */
|
|
28
|
+
shell?: string;
|
|
29
|
+
now?: () => number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A {@link CommandRunner} that runs each step contained.
|
|
33
|
+
*
|
|
34
|
+
* `projectDir` is both the worktree granted to the container and the cwd the
|
|
35
|
+
* step runs in, so a step can never be executed against a directory other than
|
|
36
|
+
* the one it was written for.
|
|
37
|
+
*/
|
|
38
|
+
export declare function makeUntrustedGateRunner(projectDir: string, deps?: UntrustedGateDeps): CommandRunner;
|
|
39
|
+
/**
|
|
40
|
+
* The step a containment preflight runs.
|
|
41
|
+
*
|
|
42
|
+
* A `rem` is cmd.exe's comment: it starts, does nothing and exits 0. What is
|
|
43
|
+
* being measured is not the command — it is whether a container could be made
|
|
44
|
+
* to run one in at all.
|
|
45
|
+
*/
|
|
46
|
+
export declare const CONTAINMENT_PREFLIGHT_STEP = "rem looply-containment-preflight";
|
|
47
|
+
/**
|
|
48
|
+
* ASK WHETHER A CONTAINER CAN ACTUALLY BE MADE, BEFORE PAYING FOR A MODEL TURN.
|
|
49
|
+
*
|
|
50
|
+
* `AppContainerBackend.probe()` answers a strictly earlier question. It returns
|
|
51
|
+
* as soon as a profile can be created or derived, and never reaches the grant,
|
|
52
|
+
* protect or launch stages — measured on one machine in one script: `probe`
|
|
53
|
+
* returned ok while a real `run` failed at `grant`, and again at `launch`.
|
|
54
|
+
* So a green probe does not mean a gate step can run.
|
|
55
|
+
*
|
|
56
|
+
* This runs the real thing through the real runner: same backend, same `gate`
|
|
57
|
+
* profile, same `unavailable` flag, same classification. There is no new
|
|
58
|
+
* vocabulary and no second code path to keep honest.
|
|
59
|
+
*
|
|
60
|
+
* ⚠️ THE GRANT SET IS DELIBERATELY SMALL, and this is not a shortcut. Granting
|
|
61
|
+
* the toolchain mirror propagates an inheritable ACE across 166 MB — measured at
|
|
62
|
+
* ~6.5 s against ~0.57 s for the project directory alone — and it proves nothing
|
|
63
|
+
* the small grant does not. Anyone "making the preflight faithful" by reusing
|
|
64
|
+
* `untrustedGrants` buys a 10x cost for no signal.
|
|
65
|
+
*
|
|
66
|
+
* ⚠️ IT COVERS THE `gate` PROFILE ONLY. The tool bridge uses `kind:'agent'`, a
|
|
67
|
+
* different profile from a different `CreateAppContainerProfile` call. A machine
|
|
68
|
+
* that can make neither is caught; one that can make the gate's and not the
|
|
69
|
+
* agent's is not. Closing that needs a second preflight through the bridge's own
|
|
70
|
+
* backend seam, and it is not this change.
|
|
71
|
+
*/
|
|
72
|
+
export declare function makeContainmentPreflight(projectDir: string, deps?: UntrustedGateDeps): () => Promise<CommandResult>;
|
|
73
|
+
//# sourceMappingURL=untrusted-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"untrusted-gate.d.ts","sourceRoot":"","sources":["../src/untrusted-gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEjF,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAQ3D,OAAO,EAGL,KAAK,yBAAyB,EAE/B,MAAM,kBAAkB,CAAC;AAG1B;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,eAAe,CAAC;IAClC,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,iBAAsB,GAC3B,aAAa,CA8Ff;AAED;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,qCAAqC,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,iBAAsB,GAC3B,MAAM,OAAO,CAAC,aAAa,CAAC,CA0F9B"}
|