looply-cli 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +137 -3
- package/dist/.src-hash +1 -0
- package/dist/acceptance-observe.d.ts +108 -0
- package/dist/acceptance-observe.d.ts.map +1 -0
- package/dist/acceptance-observe.js +152 -0
- package/dist/acceptance-observe.js.map +1 -0
- package/dist/agent-cmd.d.ts +131 -0
- package/dist/agent-cmd.d.ts.map +1 -0
- package/dist/agent-cmd.js +154 -0
- package/dist/agent-cmd.js.map +1 -0
- package/dist/agent-contained.d.ts +114 -0
- package/dist/agent-contained.d.ts.map +1 -0
- package/dist/agent-contained.js +292 -0
- package/dist/agent-contained.js.map +1 -0
- package/dist/agent-driver.d.ts +130 -0
- package/dist/agent-driver.d.ts.map +1 -0
- package/dist/agent-driver.js +170 -0
- package/dist/agent-driver.js.map +1 -0
- package/dist/agent-envelope.d.ts +94 -0
- package/dist/agent-envelope.d.ts.map +1 -0
- package/dist/agent-envelope.js +214 -0
- package/dist/agent-envelope.js.map +1 -0
- package/dist/agent-exec.d.ts +182 -0
- package/dist/agent-exec.d.ts.map +1 -0
- package/dist/agent-exec.js +125 -0
- package/dist/agent-exec.js.map +1 -0
- package/dist/agent-runtime.d.ts +23 -0
- package/dist/agent-runtime.d.ts.map +1 -0
- package/dist/agent-runtime.js +143 -0
- package/dist/agent-runtime.js.map +1 -0
- package/dist/approval-gate-read.d.ts +66 -0
- package/dist/approval-gate-read.d.ts.map +1 -0
- package/dist/approval-gate-read.js +138 -0
- package/dist/approval-gate-read.js.map +1 -0
- package/dist/approval-resolution.d.ts +87 -0
- package/dist/approval-resolution.d.ts.map +1 -0
- package/dist/approval-resolution.js +100 -0
- package/dist/approval-resolution.js.map +1 -0
- package/dist/approval-resumes.d.ts +102 -0
- package/dist/approval-resumes.d.ts.map +1 -0
- package/dist/approval-resumes.js +167 -0
- package/dist/approval-resumes.js.map +1 -0
- package/dist/ask-brain.d.ts +167 -0
- package/dist/ask-brain.d.ts.map +1 -0
- package/dist/ask-brain.js +355 -0
- package/dist/ask-brain.js.map +1 -0
- package/dist/autonomy-authority.d.ts +80 -0
- package/dist/autonomy-authority.d.ts.map +1 -0
- package/dist/autonomy-authority.js +82 -0
- package/dist/autonomy-authority.js.map +1 -0
- package/dist/autonomy-controller.d.ts +321 -0
- package/dist/autonomy-controller.d.ts.map +1 -0
- package/dist/autonomy-controller.js +517 -0
- package/dist/autonomy-controller.js.map +1 -0
- package/dist/autonomy-store.d.ts +327 -0
- package/dist/autonomy-store.d.ts.map +1 -0
- package/dist/autonomy-store.js +581 -0
- package/dist/autonomy-store.js.map +1 -0
- package/dist/autonomy-tick.d.ts +257 -0
- package/dist/autonomy-tick.d.ts.map +1 -0
- package/dist/autonomy-tick.js +616 -0
- package/dist/autonomy-tick.js.map +1 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +2727 -0
- package/dist/bin.js.map +1 -0
- package/dist/brain-advice.d.ts +21 -0
- package/dist/brain-advice.d.ts.map +1 -0
- package/dist/brain-advice.js +51 -0
- package/dist/brain-advice.js.map +1 -0
- package/dist/candidate-replay-runtime.d.ts +125 -0
- package/dist/candidate-replay-runtime.d.ts.map +1 -0
- package/dist/candidate-replay-runtime.js +188 -0
- package/dist/candidate-replay-runtime.js.map +1 -0
- package/dist/checkout-carry.d.ts +76 -0
- package/dist/checkout-carry.d.ts.map +1 -0
- package/dist/checkout-carry.js +125 -0
- package/dist/checkout-carry.js.map +1 -0
- package/dist/citation-readers.d.ts +26 -0
- package/dist/citation-readers.d.ts.map +1 -0
- package/dist/citation-readers.js +102 -0
- package/dist/citation-readers.js.map +1 -0
- package/dist/command-receipts.d.ts +79 -0
- package/dist/command-receipts.d.ts.map +1 -0
- package/dist/command-receipts.js +143 -0
- package/dist/command-receipts.js.map +1 -0
- package/dist/command-runner.d.ts +32 -0
- package/dist/command-runner.d.ts.map +1 -0
- package/dist/command-runner.js +108 -0
- package/dist/command-runner.js.map +1 -0
- package/dist/compatible-sets.d.ts +67 -0
- package/dist/compatible-sets.d.ts.map +1 -0
- package/dist/compatible-sets.js +81 -0
- package/dist/compatible-sets.js.map +1 -0
- package/dist/compile-check.d.ts +31 -0
- package/dist/compile-check.d.ts.map +1 -0
- package/dist/compile-check.js +34 -0
- package/dist/compile-check.js.map +1 -0
- package/dist/compile-store.d.ts +16 -0
- package/dist/compile-store.d.ts.map +1 -0
- package/dist/compile-store.js +21 -0
- package/dist/compile-store.js.map +1 -0
- package/dist/completion.d.ts +106 -0
- package/dist/completion.d.ts.map +1 -0
- package/dist/completion.js +131 -0
- package/dist/completion.js.map +1 -0
- package/dist/config.d.ts +549 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +763 -0
- package/dist/config.js.map +1 -0
- package/dist/control-file.d.ts +142 -0
- package/dist/control-file.d.ts.map +1 -0
- package/dist/control-file.js +144 -0
- package/dist/control-file.js.map +1 -0
- package/dist/coordinator-state.d.ts +131 -0
- package/dist/coordinator-state.d.ts.map +1 -0
- package/dist/coordinator-state.js +380 -0
- package/dist/coordinator-state.js.map +1 -0
- package/dist/coordinator.d.ts +95 -0
- package/dist/coordinator.d.ts.map +1 -0
- package/dist/coordinator.js +97 -0
- package/dist/coordinator.js.map +1 -0
- package/dist/cursor-store.d.ts +53 -0
- package/dist/cursor-store.d.ts.map +1 -0
- package/dist/cursor-store.js +98 -0
- package/dist/cursor-store.js.map +1 -0
- package/dist/daemon-cmd.d.ts +239 -0
- package/dist/daemon-cmd.d.ts.map +1 -0
- package/dist/daemon-cmd.js +1751 -0
- package/dist/daemon-cmd.js.map +1 -0
- package/dist/daemon-lock.d.ts +140 -0
- package/dist/daemon-lock.d.ts.map +1 -0
- package/dist/daemon-lock.js +352 -0
- package/dist/daemon-lock.js.map +1 -0
- package/dist/daemon-recovery.d.ts +78 -0
- package/dist/daemon-recovery.d.ts.map +1 -0
- package/dist/daemon-recovery.js +161 -0
- package/dist/daemon-recovery.js.map +1 -0
- package/dist/daemon.d.ts +368 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js +601 -0
- package/dist/daemon.js.map +1 -0
- package/dist/declared-response-shape.d.ts +93 -0
- package/dist/declared-response-shape.d.ts.map +1 -0
- package/dist/declared-response-shape.js +200 -0
- package/dist/declared-response-shape.js.map +1 -0
- package/dist/declared-surfaces.d.ts +16 -0
- package/dist/declared-surfaces.d.ts.map +1 -0
- package/dist/declared-surfaces.js +19 -0
- package/dist/declared-surfaces.js.map +1 -0
- package/dist/depends-review.d.ts +113 -0
- package/dist/depends-review.d.ts.map +1 -0
- package/dist/depends-review.js +110 -0
- package/dist/depends-review.js.map +1 -0
- package/dist/doctor.d.ts +91 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +71 -0
- package/dist/doctor.js.map +1 -0
- package/dist/edge-approval.d.ts +105 -0
- package/dist/edge-approval.d.ts.map +1 -0
- package/dist/edge-approval.js +100 -0
- package/dist/edge-approval.js.map +1 -0
- package/dist/evidence-cache.d.ts +45 -0
- package/dist/evidence-cache.d.ts.map +1 -0
- package/dist/evidence-cache.js +90 -0
- package/dist/evidence-cache.js.map +1 -0
- package/dist/evidence-cmd.d.ts +133 -0
- package/dist/evidence-cmd.d.ts.map +1 -0
- package/dist/evidence-cmd.js +347 -0
- package/dist/evidence-cmd.js.map +1 -0
- package/dist/evidence-facts.d.ts +40 -0
- package/dist/evidence-facts.d.ts.map +1 -0
- package/dist/evidence-facts.js +114 -0
- package/dist/evidence-facts.js.map +1 -0
- package/dist/exclusive-lock.d.ts +52 -0
- package/dist/exclusive-lock.d.ts.map +1 -0
- package/dist/exclusive-lock.js +150 -0
- package/dist/exclusive-lock.js.map +1 -0
- package/dist/exec-domains.d.ts +140 -0
- package/dist/exec-domains.d.ts.map +1 -0
- package/dist/exec-domains.js +287 -0
- package/dist/exec-domains.js.map +1 -0
- package/dist/exemption-store.d.ts +197 -0
- package/dist/exemption-store.d.ts.map +1 -0
- package/dist/exemption-store.js +266 -0
- package/dist/exemption-store.js.map +1 -0
- package/dist/explicit-start-gate.d.ts +96 -0
- package/dist/explicit-start-gate.d.ts.map +1 -0
- package/dist/explicit-start-gate.js +103 -0
- package/dist/explicit-start-gate.js.map +1 -0
- package/dist/fs-trouble.d.ts +70 -0
- package/dist/fs-trouble.d.ts.map +1 -0
- package/dist/fs-trouble.js +98 -0
- package/dist/fs-trouble.js.map +1 -0
- package/dist/gate.d.ts +278 -0
- package/dist/gate.d.ts.map +1 -0
- package/dist/gate.js +278 -0
- package/dist/gate.js.map +1 -0
- package/dist/git-driver.d.ts +519 -0
- package/dist/git-driver.d.ts.map +1 -0
- package/dist/git-driver.js +900 -0
- package/dist/git-driver.js.map +1 -0
- package/dist/git-push-executor.d.ts +41 -0
- package/dist/git-push-executor.d.ts.map +1 -0
- package/dist/git-push-executor.js +142 -0
- package/dist/git-push-executor.js.map +1 -0
- package/dist/glob.d.ts +26 -0
- package/dist/glob.d.ts.map +1 -0
- package/dist/glob.js +93 -0
- package/dist/glob.js.map +1 -0
- package/dist/goal-adaptive.d.ts +295 -0
- package/dist/goal-adaptive.d.ts.map +1 -0
- package/dist/goal-adaptive.js +393 -0
- package/dist/goal-adaptive.js.map +1 -0
- package/dist/goal-compile.d.ts +342 -0
- package/dist/goal-compile.d.ts.map +1 -0
- package/dist/goal-compile.js +444 -0
- package/dist/goal-compile.js.map +1 -0
- package/dist/goal-depends-executor.d.ts +55 -0
- package/dist/goal-depends-executor.d.ts.map +1 -0
- package/dist/goal-depends-executor.js +202 -0
- package/dist/goal-depends-executor.js.map +1 -0
- package/dist/goal-execution-evidence.d.ts +135 -0
- package/dist/goal-execution-evidence.d.ts.map +1 -0
- package/dist/goal-execution-evidence.js +159 -0
- package/dist/goal-execution-evidence.js.map +1 -0
- package/dist/goal-gap.d.ts +140 -0
- package/dist/goal-gap.d.ts.map +1 -0
- package/dist/goal-gap.js +197 -0
- package/dist/goal-gap.js.map +1 -0
- package/dist/goal-met-target.d.ts +98 -0
- package/dist/goal-met-target.d.ts.map +1 -0
- package/dist/goal-met-target.js +92 -0
- package/dist/goal-met-target.js.map +1 -0
- package/dist/goal-ownership.d.ts +416 -0
- package/dist/goal-ownership.d.ts.map +1 -0
- package/dist/goal-ownership.js +576 -0
- package/dist/goal-ownership.js.map +1 -0
- package/dist/goal-runs.d.ts +82 -0
- package/dist/goal-runs.d.ts.map +1 -0
- package/dist/goal-runs.js +120 -0
- package/dist/goal-runs.js.map +1 -0
- package/dist/goal-store.d.ts +146 -0
- package/dist/goal-store.d.ts.map +1 -0
- package/dist/goal-store.js +294 -0
- package/dist/goal-store.js.map +1 -0
- package/dist/goal-view.d.ts +156 -0
- package/dist/goal-view.d.ts.map +1 -0
- package/dist/goal-view.js +499 -0
- package/dist/goal-view.js.map +1 -0
- package/dist/governed-approvals.d.ts +152 -0
- package/dist/governed-approvals.d.ts.map +1 -0
- package/dist/governed-approvals.js +246 -0
- package/dist/governed-approvals.js.map +1 -0
- package/dist/governed-broker.d.ts +169 -0
- package/dist/governed-broker.d.ts.map +1 -0
- package/dist/governed-broker.js +196 -0
- package/dist/governed-broker.js.map +1 -0
- package/dist/governed-run.d.ts +220 -0
- package/dist/governed-run.d.ts.map +1 -0
- package/dist/governed-run.js +406 -0
- package/dist/governed-run.js.map +1 -0
- package/dist/grant-reconcile.d.ts +63 -0
- package/dist/grant-reconcile.d.ts.map +1 -0
- package/dist/grant-reconcile.js +121 -0
- package/dist/grant-reconcile.js.map +1 -0
- package/dist/index-for-head.d.ts +56 -0
- package/dist/index-for-head.d.ts.map +1 -0
- package/dist/index-for-head.js +103 -0
- package/dist/index-for-head.js.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/init-detect.d.ts +39 -0
- package/dist/init-detect.d.ts.map +1 -0
- package/dist/init-detect.js +188 -0
- package/dist/init-detect.js.map +1 -0
- package/dist/integration-deps.d.ts +62 -0
- package/dist/integration-deps.d.ts.map +1 -0
- package/dist/integration-deps.js +251 -0
- package/dist/integration-deps.js.map +1 -0
- package/dist/integration-runtime.d.ts +458 -0
- package/dist/integration-runtime.d.ts.map +1 -0
- package/dist/integration-runtime.js +681 -0
- package/dist/integration-runtime.js.map +1 -0
- package/dist/integration.d.ts +45 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +87 -0
- package/dist/integration.js.map +1 -0
- package/dist/integrator.d.ts +84 -0
- package/dist/integrator.d.ts.map +1 -0
- package/dist/integrator.js +193 -0
- package/dist/integrator.js.map +1 -0
- package/dist/lane-claims.d.ts +174 -0
- package/dist/lane-claims.d.ts.map +1 -0
- package/dist/lane-claims.js +218 -0
- package/dist/lane-claims.js.map +1 -0
- package/dist/lane-coverage.d.ts +87 -0
- package/dist/lane-coverage.d.ts.map +1 -0
- package/dist/lane-coverage.js +129 -0
- package/dist/lane-coverage.js.map +1 -0
- package/dist/ledger-replay.d.ts +115 -0
- package/dist/ledger-replay.d.ts.map +1 -0
- package/dist/ledger-replay.js +155 -0
- package/dist/ledger-replay.js.map +1 -0
- package/dist/ledger-store.d.ts +68 -0
- package/dist/ledger-store.d.ts.map +1 -0
- package/dist/ledger-store.js +111 -0
- package/dist/ledger-store.js.map +1 -0
- package/dist/loop-safety-observer.d.ts +132 -0
- package/dist/loop-safety-observer.d.ts.map +1 -0
- package/dist/loop-safety-observer.js +76 -0
- package/dist/loop-safety-observer.js.map +1 -0
- package/dist/loop-safety-store.d.ts +339 -0
- package/dist/loop-safety-store.d.ts.map +1 -0
- package/dist/loop-safety-store.js +800 -0
- package/dist/loop-safety-store.js.map +1 -0
- package/dist/machine-store.d.ts +54 -0
- package/dist/machine-store.d.ts.map +1 -0
- package/dist/machine-store.js +149 -0
- package/dist/machine-store.js.map +1 -0
- package/dist/mcp-main.d.ts +2 -0
- package/dist/mcp-main.d.ts.map +1 -0
- package/dist/mcp-main.js +116 -0
- package/dist/mcp-main.js.map +1 -0
- package/dist/mcp-server.d.ts +72 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +259 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/model-routing.d.ts +75 -0
- package/dist/model-routing.d.ts.map +1 -0
- package/dist/model-routing.js +108 -0
- package/dist/model-routing.js.map +1 -0
- package/dist/model-transport.d.ts +188 -0
- package/dist/model-transport.d.ts.map +1 -0
- package/dist/model-transport.js +625 -0
- package/dist/model-transport.js.map +1 -0
- package/dist/notify-cadence.d.ts +55 -0
- package/dist/notify-cadence.d.ts.map +1 -0
- package/dist/notify-cadence.js +68 -0
- package/dist/notify-cadence.js.map +1 -0
- package/dist/notify-channel.d.ts +69 -0
- package/dist/notify-channel.d.ts.map +1 -0
- package/dist/notify-channel.js +151 -0
- package/dist/notify-channel.js.map +1 -0
- package/dist/notify.d.ts +71 -0
- package/dist/notify.d.ts.map +1 -0
- package/dist/notify.js +125 -0
- package/dist/notify.js.map +1 -0
- package/dist/observation-inventory.d.ts +65 -0
- package/dist/observation-inventory.d.ts.map +1 -0
- package/dist/observation-inventory.js +139 -0
- package/dist/observation-inventory.js.map +1 -0
- package/dist/owned-children.d.ts +45 -0
- package/dist/owned-children.d.ts.map +1 -0
- package/dist/owned-children.js +64 -0
- package/dist/owned-children.js.map +1 -0
- package/dist/packet-for-goal.d.ts +19 -0
- package/dist/packet-for-goal.d.ts.map +1 -0
- package/dist/packet-for-goal.js +32 -0
- package/dist/packet-for-goal.js.map +1 -0
- package/dist/pair-cmd.d.ts +85 -0
- package/dist/pair-cmd.d.ts.map +1 -0
- package/dist/pair-cmd.js +205 -0
- package/dist/pair-cmd.js.map +1 -0
- package/dist/partial-asker.d.ts +96 -0
- package/dist/partial-asker.d.ts.map +1 -0
- package/dist/partial-asker.js +117 -0
- package/dist/partial-asker.js.map +1 -0
- package/dist/pdf-text-lines.d.ts +17 -0
- package/dist/pdf-text-lines.d.ts.map +1 -0
- package/dist/pdf-text-lines.js +70 -0
- package/dist/pdf-text-lines.js.map +1 -0
- package/dist/pdf-text-worker.d.ts +2 -0
- package/dist/pdf-text-worker.d.ts.map +1 -0
- package/dist/pdf-text-worker.js +81 -0
- package/dist/pdf-text-worker.js.map +1 -0
- package/dist/pdf-text.d.ts +56 -0
- package/dist/pdf-text.d.ts.map +1 -0
- package/dist/pdf-text.js +64 -0
- package/dist/pdf-text.js.map +1 -0
- package/dist/pending-action.d.ts +154 -0
- package/dist/pending-action.d.ts.map +1 -0
- package/dist/pending-action.js +148 -0
- package/dist/pending-action.js.map +1 -0
- package/dist/preemptor.d.ts +40 -0
- package/dist/preemptor.d.ts.map +1 -0
- package/dist/preemptor.js +49 -0
- package/dist/preemptor.js.map +1 -0
- package/dist/programme-mode.d.ts +29 -0
- package/dist/programme-mode.d.ts.map +1 -0
- package/dist/programme-mode.js +50 -0
- package/dist/programme-mode.js.map +1 -0
- package/dist/progress-view.d.ts +14 -0
- package/dist/progress-view.d.ts.map +1 -0
- package/dist/progress-view.js +114 -0
- package/dist/progress-view.js.map +1 -0
- package/dist/project-graph-builder.d.ts +81 -0
- package/dist/project-graph-builder.d.ts.map +1 -0
- package/dist/project-graph-builder.js +246 -0
- package/dist/project-graph-builder.js.map +1 -0
- package/dist/project-graph-runtime.d.ts +86 -0
- package/dist/project-graph-runtime.d.ts.map +1 -0
- package/dist/project-graph-runtime.js +112 -0
- package/dist/project-graph-runtime.js.map +1 -0
- package/dist/project-index-builder.d.ts +96 -0
- package/dist/project-index-builder.d.ts.map +1 -0
- package/dist/project-index-builder.js +298 -0
- package/dist/project-index-builder.js.map +1 -0
- package/dist/project-index-facts.d.ts +51 -0
- package/dist/project-index-facts.d.ts.map +1 -0
- package/dist/project-index-facts.js +117 -0
- package/dist/project-index-facts.js.map +1 -0
- package/dist/project-index-store.d.ts +97 -0
- package/dist/project-index-store.d.ts.map +1 -0
- package/dist/project-index-store.js +140 -0
- package/dist/project-index-store.js.map +1 -0
- package/dist/project-memory-store.d.ts +127 -0
- package/dist/project-memory-store.d.ts.map +1 -0
- package/dist/project-memory-store.js +302 -0
- package/dist/project-memory-store.js.map +1 -0
- package/dist/proposal-store.d.ts +14 -0
- package/dist/proposal-store.d.ts.map +1 -0
- package/dist/proposal-store.js +19 -0
- package/dist/proposal-store.js.map +1 -0
- package/dist/prover.d.ts +80 -0
- package/dist/prover.d.ts.map +1 -0
- package/dist/prover.js +137 -0
- package/dist/prover.js.map +1 -0
- package/dist/provider-identity-store.d.ts +34 -0
- package/dist/provider-identity-store.d.ts.map +1 -0
- package/dist/provider-identity-store.js +72 -0
- package/dist/provider-identity-store.js.map +1 -0
- package/dist/provider-identity.d.ts +104 -0
- package/dist/provider-identity.d.ts.map +1 -0
- package/dist/provider-identity.js +167 -0
- package/dist/provider-identity.js.map +1 -0
- package/dist/provider-limit.d.ts +79 -0
- package/dist/provider-limit.d.ts.map +1 -0
- package/dist/provider-limit.js +148 -0
- package/dist/provider-limit.js.map +1 -0
- package/dist/provider-preflight.d.ts +171 -0
- package/dist/provider-preflight.d.ts.map +1 -0
- package/dist/provider-preflight.js +395 -0
- package/dist/provider-preflight.js.map +1 -0
- package/dist/provider-state.d.ts +120 -0
- package/dist/provider-state.d.ts.map +1 -0
- package/dist/provider-state.js +182 -0
- package/dist/provider-state.js.map +1 -0
- package/dist/providers.d.ts +132 -0
- package/dist/providers.d.ts.map +1 -0
- package/dist/providers.js +161 -0
- package/dist/providers.js.map +1 -0
- package/dist/publication-recorder.d.ts +117 -0
- package/dist/publication-recorder.d.ts.map +1 -0
- package/dist/publication-recorder.js +124 -0
- package/dist/publication-recorder.js.map +1 -0
- package/dist/pursuit-delivery.d.ts +24 -0
- package/dist/pursuit-delivery.d.ts.map +1 -0
- package/dist/pursuit-delivery.js +38 -0
- package/dist/pursuit-delivery.js.map +1 -0
- package/dist/queue-store.d.ts +132 -0
- package/dist/queue-store.d.ts.map +1 -0
- package/dist/queue-store.js +185 -0
- package/dist/queue-store.js.map +1 -0
- package/dist/queue-summary.d.ts +14 -0
- package/dist/queue-summary.d.ts.map +1 -0
- package/dist/queue-summary.js +82 -0
- package/dist/queue-summary.js.map +1 -0
- package/dist/queue-view.d.ts +20 -0
- package/dist/queue-view.d.ts.map +1 -0
- package/dist/queue-view.js +163 -0
- package/dist/queue-view.js.map +1 -0
- package/dist/queue-write-lease.d.ts +106 -0
- package/dist/queue-write-lease.d.ts.map +1 -0
- package/dist/queue-write-lease.js +282 -0
- package/dist/queue-write-lease.js.map +1 -0
- package/dist/rails-home.d.ts +162 -0
- package/dist/rails-home.d.ts.map +1 -0
- package/dist/rails-home.js +452 -0
- package/dist/rails-home.js.map +1 -0
- package/dist/rails-migrations.d.ts +75 -0
- package/dist/rails-migrations.d.ts.map +1 -0
- package/dist/rails-migrations.js +199 -0
- package/dist/rails-migrations.js.map +1 -0
- package/dist/rails-stores.d.ts +49 -0
- package/dist/rails-stores.d.ts.map +1 -0
- package/dist/rails-stores.js +100 -0
- package/dist/rails-stores.js.map +1 -0
- package/dist/reaper.d.ts +69 -0
- package/dist/reaper.d.ts.map +1 -0
- package/dist/reaper.js +152 -0
- package/dist/reaper.js.map +1 -0
- package/dist/record-store.d.ts +36 -0
- package/dist/record-store.d.ts.map +1 -0
- package/dist/record-store.js +78 -0
- package/dist/record-store.js.map +1 -0
- package/dist/recovery-io.d.ts +50 -0
- package/dist/recovery-io.d.ts.map +1 -0
- package/dist/recovery-io.js +122 -0
- package/dist/recovery-io.js.map +1 -0
- package/dist/recovery.d.ts +146 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +110 -0
- package/dist/recovery.js.map +1 -0
- package/dist/redraw.d.ts +34 -0
- package/dist/redraw.d.ts.map +1 -0
- package/dist/redraw.js +62 -0
- package/dist/redraw.js.map +1 -0
- package/dist/rejected-evidence.d.ts +255 -0
- package/dist/rejected-evidence.d.ts.map +1 -0
- package/dist/rejected-evidence.js +324 -0
- package/dist/rejected-evidence.js.map +1 -0
- package/dist/report-cmd.d.ts +32 -0
- package/dist/report-cmd.d.ts.map +1 -0
- package/dist/report-cmd.js +201 -0
- package/dist/report-cmd.js.map +1 -0
- package/dist/repos-cmd.d.ts +80 -0
- package/dist/repos-cmd.d.ts.map +1 -0
- package/dist/repos-cmd.js +240 -0
- package/dist/repos-cmd.js.map +1 -0
- package/dist/request-body-shape.d.ts +93 -0
- package/dist/request-body-shape.d.ts.map +1 -0
- package/dist/request-body-shape.js +407 -0
- package/dist/request-body-shape.js.map +1 -0
- package/dist/requirement-claims.d.ts +89 -0
- package/dist/requirement-claims.d.ts.map +1 -0
- package/dist/requirement-claims.js +92 -0
- package/dist/requirement-claims.js.map +1 -0
- package/dist/retention-apply-runtime.d.ts +105 -0
- package/dist/retention-apply-runtime.d.ts.map +1 -0
- package/dist/retention-apply-runtime.js +269 -0
- package/dist/retention-apply-runtime.js.map +1 -0
- package/dist/reverify.d.ts +41 -0
- package/dist/reverify.d.ts.map +1 -0
- package/dist/reverify.js +69 -0
- package/dist/reverify.js.map +1 -0
- package/dist/round-records.d.ts +65 -0
- package/dist/round-records.d.ts.map +1 -0
- package/dist/round-records.js +61 -0
- package/dist/round-records.js.map +1 -0
- package/dist/round-runner.d.ts +924 -0
- package/dist/round-runner.d.ts.map +1 -0
- package/dist/round-runner.js +1693 -0
- package/dist/round-runner.js.map +1 -0
- package/dist/run-approval.d.ts +180 -0
- package/dist/run-approval.d.ts.map +1 -0
- package/dist/run-approval.js +199 -0
- package/dist/run-approval.js.map +1 -0
- package/dist/run-cmd.d.ts +359 -0
- package/dist/run-cmd.d.ts.map +1 -0
- package/dist/run-cmd.js +4418 -0
- package/dist/run-cmd.js.map +1 -0
- package/dist/run-delivery.d.ts +71 -0
- package/dist/run-delivery.d.ts.map +1 -0
- package/dist/run-delivery.js +104 -0
- package/dist/run-delivery.js.map +1 -0
- package/dist/run-ended.d.ts +75 -0
- package/dist/run-ended.d.ts.map +1 -0
- package/dist/run-ended.js +27 -0
- package/dist/run-ended.js.map +1 -0
- package/dist/run-ending-locator.d.ts +125 -0
- package/dist/run-ending-locator.d.ts.map +1 -0
- package/dist/run-ending-locator.js +133 -0
- package/dist/run-ending-locator.js.map +1 -0
- package/dist/run-launcher.d.ts +459 -0
- package/dist/run-launcher.d.ts.map +1 -0
- package/dist/run-launcher.js +652 -0
- package/dist/run-launcher.js.map +1 -0
- package/dist/run-lease.d.ts +208 -0
- package/dist/run-lease.d.ts.map +1 -0
- package/dist/run-lease.js +301 -0
- package/dist/run-lease.js.map +1 -0
- package/dist/run-refusal-marks.d.ts +189 -0
- package/dist/run-refusal-marks.d.ts.map +1 -0
- package/dist/run-refusal-marks.js +249 -0
- package/dist/run-refusal-marks.js.map +1 -0
- package/dist/run-start-marks.d.ts +153 -0
- package/dist/run-start-marks.d.ts.map +1 -0
- package/dist/run-start-marks.js +269 -0
- package/dist/run-start-marks.js.map +1 -0
- package/dist/scan-cmd.d.ts +14 -0
- package/dist/scan-cmd.d.ts.map +1 -0
- package/dist/scan-cmd.js +270 -0
- package/dist/scan-cmd.js.map +1 -0
- package/dist/scan-events.d.ts +50 -0
- package/dist/scan-events.d.ts.map +1 -0
- package/dist/scan-events.js +91 -0
- package/dist/scan-events.js.map +1 -0
- package/dist/scan.d.ts +191 -0
- package/dist/scan.d.ts.map +1 -0
- package/dist/scan.js +417 -0
- package/dist/scan.js.map +1 -0
- package/dist/scope-rule.d.ts +148 -0
- package/dist/scope-rule.d.ts.map +1 -0
- package/dist/scope-rule.js +121 -0
- package/dist/scope-rule.js.map +1 -0
- package/dist/self-repo-id.d.ts +18 -0
- package/dist/self-repo-id.d.ts.map +1 -0
- package/dist/self-repo-id.js +70 -0
- package/dist/self-repo-id.js.map +1 -0
- package/dist/serve-cmd.d.ts +115 -0
- package/dist/serve-cmd.d.ts.map +1 -0
- package/dist/serve-cmd.js +505 -0
- package/dist/serve-cmd.js.map +1 -0
- package/dist/serve.d.ts +167 -0
- package/dist/serve.d.ts.map +1 -0
- package/dist/serve.js +336 -0
- package/dist/serve.js.map +1 -0
- package/dist/server-client.d.ts +766 -0
- package/dist/server-client.d.ts.map +1 -0
- package/dist/server-client.js +475 -0
- package/dist/server-client.js.map +1 -0
- package/dist/session-adapter-runtime.d.ts +195 -0
- package/dist/session-adapter-runtime.d.ts.map +1 -0
- package/dist/session-adapter-runtime.js +373 -0
- package/dist/session-adapter-runtime.js.map +1 -0
- package/dist/session-checkpoint-runtime.d.ts +62 -0
- package/dist/session-checkpoint-runtime.d.ts.map +1 -0
- package/dist/session-checkpoint-runtime.js +268 -0
- package/dist/session-checkpoint-runtime.js.map +1 -0
- package/dist/session-control-transport.d.ts +106 -0
- package/dist/session-control-transport.d.ts.map +1 -0
- package/dist/session-control-transport.js +232 -0
- package/dist/session-control-transport.js.map +1 -0
- package/dist/session-observation-store.d.ts +98 -0
- package/dist/session-observation-store.d.ts.map +1 -0
- package/dist/session-observation-store.js +155 -0
- package/dist/session-observation-store.js.map +1 -0
- package/dist/session-observe-runtime.d.ts +123 -0
- package/dist/session-observe-runtime.d.ts.map +1 -0
- package/dist/session-observe-runtime.js +317 -0
- package/dist/session-observe-runtime.js.map +1 -0
- package/dist/session-store.d.ts +98 -0
- package/dist/session-store.d.ts.map +1 -0
- package/dist/session-store.js +116 -0
- package/dist/session-store.js.map +1 -0
- package/dist/sessions-cmd.d.ts +202 -0
- package/dist/sessions-cmd.d.ts.map +1 -0
- package/dist/sessions-cmd.js +609 -0
- package/dist/sessions-cmd.js.map +1 -0
- package/dist/settings-overlay.d.ts +53 -0
- package/dist/settings-overlay.d.ts.map +1 -0
- package/dist/settings-overlay.js +175 -0
- package/dist/settings-overlay.js.map +1 -0
- package/dist/setup-prompt.d.ts +34 -0
- package/dist/setup-prompt.d.ts.map +1 -0
- package/dist/setup-prompt.js +92 -0
- package/dist/setup-prompt.js.map +1 -0
- package/dist/setup.d.ts +103 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +283 -0
- package/dist/setup.js.map +1 -0
- package/dist/shared-grants.d.ts +164 -0
- package/dist/shared-grants.d.ts.map +1 -0
- package/dist/shared-grants.js +242 -0
- package/dist/shared-grants.js.map +1 -0
- package/dist/signals.d.ts +55 -0
- package/dist/signals.d.ts.map +1 -0
- package/dist/signals.js +85 -0
- package/dist/signals.js.map +1 -0
- package/dist/source-cmd.d.ts +201 -0
- package/dist/source-cmd.d.ts.map +1 -0
- package/dist/source-cmd.js +684 -0
- package/dist/source-cmd.js.map +1 -0
- package/dist/source-verdict.d.ts +99 -0
- package/dist/source-verdict.d.ts.map +1 -0
- package/dist/source-verdict.js +182 -0
- package/dist/source-verdict.js.map +1 -0
- package/dist/spend-ledger.d.ts +350 -0
- package/dist/spend-ledger.d.ts.map +1 -0
- package/dist/spend-ledger.js +546 -0
- package/dist/spend-ledger.js.map +1 -0
- package/dist/stale-run-sweep.d.ts +79 -0
- package/dist/stale-run-sweep.d.ts.map +1 -0
- package/dist/stale-run-sweep.js +116 -0
- package/dist/stale-run-sweep.js.map +1 -0
- package/dist/start-attempts.d.ts +385 -0
- package/dist/start-attempts.d.ts.map +1 -0
- package/dist/start-attempts.js +613 -0
- package/dist/start-attempts.js.map +1 -0
- package/dist/status-cmd.d.ts +28 -0
- package/dist/status-cmd.d.ts.map +1 -0
- package/dist/status-cmd.js +116 -0
- package/dist/status-cmd.js.map +1 -0
- package/dist/stop-follow-up.d.ts +107 -0
- package/dist/stop-follow-up.d.ts.map +1 -0
- package/dist/stop-follow-up.js +172 -0
- package/dist/stop-follow-up.js.map +1 -0
- package/dist/surface-lease.d.ts +118 -0
- package/dist/surface-lease.d.ts.map +1 -0
- package/dist/surface-lease.js +485 -0
- package/dist/surface-lease.js.map +1 -0
- package/dist/sync.d.ts +54 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +93 -0
- package/dist/sync.js.map +1 -0
- package/dist/syncing-ledger.d.ts +45 -0
- package/dist/syncing-ledger.d.ts.map +1 -0
- package/dist/syncing-ledger.js +53 -0
- package/dist/syncing-ledger.js.map +1 -0
- package/dist/temp-fixtures.d.ts +68 -0
- package/dist/temp-fixtures.d.ts.map +1 -0
- package/dist/temp-fixtures.js +38 -0
- package/dist/temp-fixtures.js.map +1 -0
- package/dist/token-window.d.ts +84 -0
- package/dist/token-window.d.ts.map +1 -0
- package/dist/token-window.js +143 -0
- package/dist/token-window.js.map +1 -0
- package/dist/tool-bridge.d.ts +177 -0
- package/dist/tool-bridge.d.ts.map +1 -0
- package/dist/tool-bridge.js +329 -0
- package/dist/tool-bridge.js.map +1 -0
- package/dist/tool-call-record.d.ts +197 -0
- package/dist/tool-call-record.d.ts.map +1 -0
- package/dist/tool-call-record.js +276 -0
- package/dist/tool-call-record.js.map +1 -0
- package/dist/tool-protocol.d.ts +135 -0
- package/dist/tool-protocol.d.ts.map +1 -0
- package/dist/tool-protocol.js +104 -0
- package/dist/tool-protocol.js.map +1 -0
- package/dist/tool-worker.d.ts +3 -0
- package/dist/tool-worker.d.ts.map +1 -0
- package/dist/tool-worker.js +478 -0
- package/dist/tool-worker.js.map +1 -0
- package/dist/toolchain-mirror.d.ts +86 -0
- package/dist/toolchain-mirror.d.ts.map +1 -0
- package/dist/toolchain-mirror.js +307 -0
- package/dist/toolchain-mirror.js.map +1 -0
- package/dist/trusted-git.d.ts +243 -0
- package/dist/trusted-git.d.ts.map +1 -0
- package/dist/trusted-git.js +920 -0
- package/dist/trusted-git.js.map +1 -0
- package/dist/ui.d.ts +76 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +118 -0
- package/dist/ui.js.map +1 -0
- package/dist/untrusted-exec.d.ts +275 -0
- package/dist/untrusted-exec.d.ts.map +1 -0
- package/dist/untrusted-exec.js +479 -0
- package/dist/untrusted-exec.js.map +1 -0
- package/dist/untrusted-gate.d.ts +73 -0
- package/dist/untrusted-gate.d.ts.map +1 -0
- package/dist/untrusted-gate.js +226 -0
- package/dist/untrusted-gate.js.map +1 -0
- package/dist/uploader.d.ts +153 -0
- package/dist/uploader.d.ts.map +1 -0
- package/dist/uploader.js +204 -0
- package/dist/uploader.js.map +1 -0
- package/dist/verifier.d.ts +66 -0
- package/dist/verifier.d.ts.map +1 -0
- package/dist/verifier.js +170 -0
- package/dist/verifier.js.map +1 -0
- package/dist/verify-apply.d.ts +26 -0
- package/dist/verify-apply.d.ts.map +1 -0
- package/dist/verify-apply.js +36 -0
- package/dist/verify-apply.js.map +1 -0
- package/dist/verify-cmd.d.ts +44 -0
- package/dist/verify-cmd.d.ts.map +1 -0
- package/dist/verify-cmd.js +125 -0
- package/dist/verify-cmd.js.map +1 -0
- package/dist/verify-pass.d.ts +73 -0
- package/dist/verify-pass.d.ts.map +1 -0
- package/dist/verify-pass.js +103 -0
- package/dist/verify-pass.js.map +1 -0
- package/dist/welcome.d.ts +43 -0
- package/dist/welcome.d.ts.map +1 -0
- package/dist/welcome.js +116 -0
- package/dist/welcome.js.map +1 -0
- package/dist/workspace-provisioner.d.ts +65 -0
- package/dist/workspace-provisioner.d.ts.map +1 -0
- package/dist/workspace-provisioner.js +66 -0
- package/dist/workspace-provisioner.js.map +1 -0
- package/dist/workspace-quarantine.d.ts +64 -0
- package/dist/workspace-quarantine.d.ts.map +1 -0
- package/dist/workspace-quarantine.js +156 -0
- package/dist/workspace-quarantine.js.map +1 -0
- package/dist/workspace-residue-sweep.d.ts +113 -0
- package/dist/workspace-residue-sweep.d.ts.map +1 -0
- package/dist/workspace-residue-sweep.js +158 -0
- package/dist/workspace-residue-sweep.js.map +1 -0
- package/dist/workspace.d.ts +639 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +2026 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +52 -4
- package/win/CredProbe.cs +64 -0
- package/win/FakeClaude.cs +56 -0
- package/win/HandleProbe.cs +116 -0
- package/win/TokenProbe.cs +53 -0
- package/win/appcontainer.ps1 +500 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.quarantineDir = quarantineDir;
|
|
4
|
+
exports.quarantine = quarantine;
|
|
5
|
+
exports.quarantineOf = quarantineOf;
|
|
6
|
+
exports.listQuarantined = listQuarantined;
|
|
7
|
+
exports.clearQuarantine = clearQuarantine;
|
|
8
|
+
const node_crypto_1 = require("node:crypto");
|
|
9
|
+
const node_fs_1 = require("node:fs");
|
|
10
|
+
const node_path_1 = require("node:path");
|
|
11
|
+
const git_driver_1 = require("./git-driver");
|
|
12
|
+
/**
|
|
13
|
+
* ⚠️ THE DOORWAY, IN THE MANNER `RunRegistry.list` APPLIES TO A RECORD'S PATHS.
|
|
14
|
+
*
|
|
15
|
+
* A quarantine is filed under a name derived from the workspace directory, and
|
|
16
|
+
* that name becomes a filename. A workspace called `../../queue` would make this
|
|
17
|
+
* a write primitive pointed at the project's own state — which is exactly the
|
|
18
|
+
* hole Phase 1 closed for run records, measured end to end. So the name is
|
|
19
|
+
* validated where it enters, and anything that is not a plain segment is
|
|
20
|
+
* refused rather than sanitised: a name looply had to alter is a name it cannot
|
|
21
|
+
* later match against the directory it came from.
|
|
22
|
+
*/
|
|
23
|
+
const SAFE = /^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/;
|
|
24
|
+
function quarantineDir(cwd) {
|
|
25
|
+
return (0, node_path_1.join)((0, git_driver_1.projectStateDir)(cwd), 'quarantine');
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 🔴 AN UNSAFE NAME IS THE CASE THAT MOST NEEDS QUARANTINING, AND IT WAS THE
|
|
29
|
+
* ONE CASE THAT COULD NOT BE.
|
|
30
|
+
*
|
|
31
|
+
* `fileFor` answered null when the basename failed `SAFE`, and both
|
|
32
|
+
* `quarantine()` and `quarantineOf()` returned null on that — so a checkout
|
|
33
|
+
* whose name looply distrusts could not be marked, and then read back as NOT
|
|
34
|
+
* quarantined. Fails open, in the direction of touching a directory nobody
|
|
35
|
+
* vouched for. MEASURED: a workspace named `..bad name` answered null from
|
|
36
|
+
* both.
|
|
37
|
+
*
|
|
38
|
+
* ⚠️ THE NAME IS STILL NOT SANITISED — it is HASHED. The original rule was
|
|
39
|
+
* right that a name looply had to alter is a name it cannot match back to its
|
|
40
|
+
* directory; a hash of the resolved path has no such problem, because the path
|
|
41
|
+
* is what the record already carries. A safe name keeps its readable filename
|
|
42
|
+
* so a person can still find the file by eye.
|
|
43
|
+
*/
|
|
44
|
+
function fileFor(cwd, workspace) {
|
|
45
|
+
const full = (0, node_path_1.resolve)(workspace);
|
|
46
|
+
const name = (0, node_path_1.basename)(full);
|
|
47
|
+
const key = SAFE.test(name)
|
|
48
|
+
? name
|
|
49
|
+
: `unsafe-${(0, node_crypto_1.createHash)('sha256').update(full.toLowerCase(), 'utf8').digest('hex').slice(0, 16)}`;
|
|
50
|
+
return (0, node_path_1.join)(quarantineDir(cwd), `${key}.json`);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Record that looply must not touch this checkout.
|
|
54
|
+
*
|
|
55
|
+
* ⚠️ THE FIRST DECISION STANDS. A later refusal for a different reason does not
|
|
56
|
+
* overwrite the first: the reason a person needs is the one that started it,
|
|
57
|
+
* and a record that kept changing would make the history unreadable at exactly
|
|
58
|
+
* the moment somebody is trying to understand what happened.
|
|
59
|
+
*/
|
|
60
|
+
function quarantine(cwd, workspace, because, noticedBy, now = () => Date.now()) {
|
|
61
|
+
const path = fileFor(cwd, workspace);
|
|
62
|
+
const already = quarantineOf(cwd, workspace);
|
|
63
|
+
if (already !== null)
|
|
64
|
+
return already;
|
|
65
|
+
const record = {
|
|
66
|
+
workspace: (0, node_path_1.resolve)(workspace),
|
|
67
|
+
because,
|
|
68
|
+
noticedBy,
|
|
69
|
+
at: new Date(now()).toISOString(),
|
|
70
|
+
};
|
|
71
|
+
try {
|
|
72
|
+
(0, node_fs_1.mkdirSync)(quarantineDir(cwd), { recursive: true });
|
|
73
|
+
// Written whole, not appended: there is exactly one of these per workspace
|
|
74
|
+
// and the first one wins, so there is no concurrent-append problem to have.
|
|
75
|
+
(0, node_fs_1.writeFileSync)(path, `${JSON.stringify(record, null, 2)}\n`, 'utf8');
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
/**
|
|
79
|
+
* ⚠️ A QUARANTINE THAT COULD NOT BE WRITTEN IS NOT A REASON TO PROCEED —
|
|
80
|
+
* but it is also not this function's decision. The caller refuses on the
|
|
81
|
+
* condition that prompted the quarantine, not on whether the note was
|
|
82
|
+
* filed, so a read-only project state directory costs a person the record
|
|
83
|
+
* and never costs them their files.
|
|
84
|
+
*/
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
return record;
|
|
88
|
+
}
|
|
89
|
+
/** The quarantine on this workspace, or null. Unreadable counts as quarantined. */
|
|
90
|
+
function quarantineOf(cwd, workspace) {
|
|
91
|
+
const path = fileFor(cwd, workspace);
|
|
92
|
+
if (!(0, node_fs_1.existsSync)(path))
|
|
93
|
+
return null;
|
|
94
|
+
try {
|
|
95
|
+
const parsed = JSON.parse((0, node_fs_1.readFileSync)(path, 'utf8'));
|
|
96
|
+
if (typeof parsed.because !== 'string' || typeof parsed.workspace !== 'string') {
|
|
97
|
+
return unreadable(path, workspace);
|
|
98
|
+
}
|
|
99
|
+
return parsed;
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return unreadable(path, workspace);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* 🔴 FAILS CLOSED. A quarantine file that will not parse is still a file
|
|
107
|
+
* somebody's machine wrote to say "do not touch this", and reading it as
|
|
108
|
+
* "nothing is wrong" would let the reaper remove the very checkout it was
|
|
109
|
+
* written to protect. Deny is the direction every rail in this codebase
|
|
110
|
+
* defaults to.
|
|
111
|
+
*/
|
|
112
|
+
function unreadable(path, workspace) {
|
|
113
|
+
return {
|
|
114
|
+
workspace: (0, node_path_1.resolve)(workspace),
|
|
115
|
+
because: `a quarantine record exists at ${path} and could not be read, so this is treated as quarantined`,
|
|
116
|
+
noticedBy: 'quarantine-read',
|
|
117
|
+
at: '',
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/** Every quarantined workspace this project knows about. */
|
|
121
|
+
function listQuarantined(cwd) {
|
|
122
|
+
let names;
|
|
123
|
+
try {
|
|
124
|
+
names = (0, node_fs_1.readdirSync)(quarantineDir(cwd)).filter((n) => n.endsWith('.json'));
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
const out = [];
|
|
130
|
+
for (const name of names) {
|
|
131
|
+
const q = quarantineOf(cwd, (0, node_path_1.join)(quarantineDir(cwd), name.replace(/\.json$/, '')));
|
|
132
|
+
if (q !== null)
|
|
133
|
+
out.push(q);
|
|
134
|
+
}
|
|
135
|
+
return out.sort((a, b) => (a.workspace < b.workspace ? -1 : 1));
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* A person says the checkout is theirs to deal with now.
|
|
139
|
+
*
|
|
140
|
+
* ⚠️ THE ONLY THING THAT CLEARS ONE, and it removes the RECORD, never the
|
|
141
|
+
* directory. Whatever made looply refuse is still there; what changed is that
|
|
142
|
+
* a person has looked at it.
|
|
143
|
+
*/
|
|
144
|
+
function clearQuarantine(cwd, workspace) {
|
|
145
|
+
const path = fileFor(cwd, workspace);
|
|
146
|
+
if (path === null)
|
|
147
|
+
return false;
|
|
148
|
+
try {
|
|
149
|
+
(0, node_fs_1.unlinkSync)(path);
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=workspace-quarantine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-quarantine.js","sourceRoot":"","sources":["../src/workspace-quarantine.ts"],"names":[],"mappings":";;AA4DA,sCAEC;AAoCD,gCAiCC;AAGD,oCAYC;AAmBD,0CAaC;AASD,0CASC;AApMD,6CAAyC;AACzC,qCAAsG;A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AAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { type ReleaseOutcome } from './shared-grants';
|
|
2
|
+
/**
|
|
3
|
+
* WHAT AN EXECUTION LEAVES OUTSIDE ITS OWN CHECKOUT, AND WHO CLEARS IT.
|
|
4
|
+
*
|
|
5
|
+
* 🔴 A REAP REMOVED THE CHECKOUT AND NOTHING ELSE, AND ONE OF THE THINGS IT
|
|
6
|
+
* LEFT BEHIND HOLDS A COPY OF THE PROVIDER CREDENTIAL.
|
|
7
|
+
*
|
|
8
|
+
* Phase 1 gave every execution its own workspace, and three identity functions
|
|
9
|
+
* follow the workspace path rather than the project:
|
|
10
|
+
*
|
|
11
|
+
* `providerSessionDir(cwd, role)` ~/.looply/provider-sessions/<role>-<hex>
|
|
12
|
+
* `containedRoot(kind, cwd)` %TEMP%/looply-contained/<kind>-<hex>
|
|
13
|
+
* `containerName(kind, cwd)` an AppContainer profile — an OS object
|
|
14
|
+
*
|
|
15
|
+
* That is right: two executions must not share provider state or a container.
|
|
16
|
+
* What was missing is the other end. `reapWorkspace` removes the checkout, the
|
|
17
|
+
* registry record and the slot; it has never removed any of these three. So
|
|
18
|
+
* every workspace a person ever cut leaves a permanent directory named for a
|
|
19
|
+
* checkout that no longer exists — and the provider session directory is the
|
|
20
|
+
* transport's HOME, which is where the provider writes its credential.
|
|
21
|
+
*
|
|
22
|
+
* ⚠️ THIS IS CREDENTIAL DESTRUCTION, NOT TIDYING, and it is written that way.
|
|
23
|
+
* It runs only after `reapVerdict` has agreed the holder is dead and the
|
|
24
|
+
* checkout is not busy, so no live transport can be using the directory; it
|
|
25
|
+
* names the exact paths it removed so a person can see what went; and a failure
|
|
26
|
+
* is never the reap's verdict, because a directory that would not delete is a
|
|
27
|
+
* smaller problem than a workspace that cannot be retired.
|
|
28
|
+
*
|
|
29
|
+
* ⚠️ THE APPCONTAINER PROFILE IS DELIBERATELY NOT TOUCHED. Its only removal
|
|
30
|
+
* path is `AppContainerBackend.remove()`, which is documented as test-only, is
|
|
31
|
+
* async, and goes through a PowerShell round trip with a 60-second ceiling.
|
|
32
|
+
* Making a reap depend on that is a worse trade than leaving the profile, and
|
|
33
|
+
* ACL saturation is already recorded as the capacity phase's first problem.
|
|
34
|
+
*/
|
|
35
|
+
export interface SweepResult {
|
|
36
|
+
readonly removed: readonly string[];
|
|
37
|
+
readonly kept: readonly {
|
|
38
|
+
path: string;
|
|
39
|
+
because: string;
|
|
40
|
+
}[];
|
|
41
|
+
/** Shared-path grants given back, and the ones that must be retried. */
|
|
42
|
+
readonly grantsReleased?: readonly {
|
|
43
|
+
path: string;
|
|
44
|
+
sid: string;
|
|
45
|
+
}[];
|
|
46
|
+
readonly grantsPending?: readonly {
|
|
47
|
+
path: string;
|
|
48
|
+
sid: string;
|
|
49
|
+
because: string;
|
|
50
|
+
}[];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Whether this workspace's container identities may be retired at all.
|
|
54
|
+
*
|
|
55
|
+
* 🔴 UNKNOWN IS NOT DEAD. The registry classifies a record `active`, `unknown`
|
|
56
|
+
* or gone, and `unknown` means the probe could not answer — a machine under
|
|
57
|
+
* load, a pid it may not query. Treating that as "nobody is using it" is how a
|
|
58
|
+
* cleanup revokes access from a live execution, so it counts as IN USE here and
|
|
59
|
+
* the grants stay. A grant kept too long costs a DACL entry; a grant removed too
|
|
60
|
+
* early breaks a running gate.
|
|
61
|
+
*
|
|
62
|
+
* ⚠️ AND THE PARENT'S RECORD IS NOT THE WHOLE ANSWER. A run can exit while a
|
|
63
|
+
* contained child it spawned is still running, so this asks the registry about
|
|
64
|
+
* the WORKSPACE rather than about one runId — any live record naming this
|
|
65
|
+
* workspace keeps its identities.
|
|
66
|
+
*/
|
|
67
|
+
export type Liveness = 'retirable' | 'in-use' | 'unknown';
|
|
68
|
+
export interface RetirementDeps {
|
|
69
|
+
home?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Records that still name this workspace, from the durable registry. An
|
|
72
|
+
* EMPTY array means "asked and nobody does"; `null` means "could not ask",
|
|
73
|
+
* which is the unknown case and is never treated as empty.
|
|
74
|
+
*/
|
|
75
|
+
usersOf?: (workspace: string) => readonly string[] | null;
|
|
76
|
+
release?: (names: readonly string[], home: string) => ReleaseOutcome;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The residue paths as THUNKS, so naming one cannot lose the others.
|
|
80
|
+
*
|
|
81
|
+
* ⚠️ NAMING IS NOT FREE HERE: `providerSessionDir` and `containedRoot` both
|
|
82
|
+
* `mkdirSync` as a side effect of being called. That is why an eager array was
|
|
83
|
+
* a hazard rather than a convenience.
|
|
84
|
+
*/
|
|
85
|
+
export declare function residueNames(workspace: string, home?: string): (() => string)[];
|
|
86
|
+
/** Every machine-level directory keyed to one workspace path. */
|
|
87
|
+
export declare function residueOf(workspace: string, home?: string): string[];
|
|
88
|
+
/**
|
|
89
|
+
* Remove what an execution left outside its checkout.
|
|
90
|
+
*
|
|
91
|
+
* Best effort by construction: every failure is reported and none is thrown.
|
|
92
|
+
*/
|
|
93
|
+
/**
|
|
94
|
+
* Give back the shared-path grants this workspace's identities hold.
|
|
95
|
+
*
|
|
96
|
+
* 🔴 THE INTERLOCK IS HERE, BEFORE ANY ACL WORK. Liveness is asked once, from
|
|
97
|
+
* the durable registry, and anything other than a definite "nobody" leaves every
|
|
98
|
+
* grant in place. The ACL write itself then happens under the shared-grant lock,
|
|
99
|
+
* which is the SAME lock a launch takes to add one — locking only the cleanup
|
|
100
|
+
* would leave the add/remove race open on every launch.
|
|
101
|
+
*
|
|
102
|
+
* ⚠️ A NEW CLAIM CANNOT ARRIVE BEHIND THIS. Workspace paths are minted per run
|
|
103
|
+
* (`ws-<stamp>-<rand>`), and by the time a sweep runs the checkout is gone and
|
|
104
|
+
* the registry record released, so the identity derived from that path can never
|
|
105
|
+
* be claimed again. This is the existing lifecycle doing the fencing, not a
|
|
106
|
+
* second mechanism.
|
|
107
|
+
*/
|
|
108
|
+
export declare function retireWorkspaceGrants(workspace: string, deps?: RetirementDeps): {
|
|
109
|
+
liveness: Liveness;
|
|
110
|
+
outcome: ReleaseOutcome;
|
|
111
|
+
};
|
|
112
|
+
export declare function sweepWorkspaceResidue(workspace: string, home?: string, deps?: RetirementDeps): SweepResult;
|
|
113
|
+
//# sourceMappingURL=workspace-residue-sweep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-residue-sweep.d.ts","sourceRoot":"","sources":["../src/workspace-residue-sweep.ts"],"names":[],"mappings":"AAMA,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5D,wEAAwE;IACxE,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnE,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACpF;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE1D,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAC1D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,KAAK,cAAc,CAAC;CACtE;AAID;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,GAAE,MAAkB,GAAG,CAAC,MAAM,MAAM,CAAC,EAAE,CAM1F;AAED,iEAAiE;AACjE,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,GAAE,MAAkB,GAAG,MAAM,EAAE,CAY/E;AAED;;;;GAIG;AACH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,cAAmB,GACxB;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,cAAc,CAAA;CAAE,CAYjD;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,MAAkB,EACxB,IAAI,GAAE,cAAmB,GACxB,WAAW,CAgFb"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.residueNames = residueNames;
|
|
4
|
+
exports.residueOf = residueOf;
|
|
5
|
+
exports.retireWorkspaceGrants = retireWorkspaceGrants;
|
|
6
|
+
exports.sweepWorkspaceResidue = sweepWorkspaceResidue;
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
const node_os_1 = require("node:os");
|
|
9
|
+
const exec_domains_1 = require("./exec-domains");
|
|
10
|
+
const model_transport_1 = require("./model-transport");
|
|
11
|
+
const tool_bridge_1 = require("./tool-bridge");
|
|
12
|
+
const untrusted_exec_1 = require("./untrusted-exec");
|
|
13
|
+
const shared_grants_1 = require("./shared-grants");
|
|
14
|
+
const KINDS = ['gate', 'agent', 'fixture'];
|
|
15
|
+
/**
|
|
16
|
+
* The residue paths as THUNKS, so naming one cannot lose the others.
|
|
17
|
+
*
|
|
18
|
+
* ⚠️ NAMING IS NOT FREE HERE: `providerSessionDir` and `containedRoot` both
|
|
19
|
+
* `mkdirSync` as a side effect of being called. That is why an eager array was
|
|
20
|
+
* a hazard rather than a convenience.
|
|
21
|
+
*/
|
|
22
|
+
function residueNames(workspace, home = (0, node_os_1.homedir)()) {
|
|
23
|
+
const roles = Object.keys(tool_bridge_1.TOOL_POLICIES);
|
|
24
|
+
return [
|
|
25
|
+
...roles.map((role) => () => (0, model_transport_1.providerSessionDir)(workspace, role, home)),
|
|
26
|
+
...KINDS.map((kind) => () => (0, exec_domains_1.containedRoot)(kind, workspace)),
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
/** Every machine-level directory keyed to one workspace path. */
|
|
30
|
+
function residueOf(workspace, home = (0, node_os_1.homedir)()) {
|
|
31
|
+
const roles = Object.keys(tool_bridge_1.TOOL_POLICIES);
|
|
32
|
+
return [
|
|
33
|
+
/**
|
|
34
|
+
* ⚠️ THESE FUNCTIONS CREATE THE DIRECTORY AS A SIDE EFFECT of naming it.
|
|
35
|
+
* Calling them to compute a path to DELETE therefore makes the path first —
|
|
36
|
+
* harmless (an empty directory removed immediately) and worth knowing,
|
|
37
|
+
* because it means this never reports "nothing was there".
|
|
38
|
+
*/
|
|
39
|
+
...roles.map((role) => (0, model_transport_1.providerSessionDir)(workspace, role, home)),
|
|
40
|
+
...KINDS.map((kind) => (0, exec_domains_1.containedRoot)(kind, workspace)),
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Remove what an execution left outside its checkout.
|
|
45
|
+
*
|
|
46
|
+
* Best effort by construction: every failure is reported and none is thrown.
|
|
47
|
+
*/
|
|
48
|
+
/**
|
|
49
|
+
* Give back the shared-path grants this workspace's identities hold.
|
|
50
|
+
*
|
|
51
|
+
* 🔴 THE INTERLOCK IS HERE, BEFORE ANY ACL WORK. Liveness is asked once, from
|
|
52
|
+
* the durable registry, and anything other than a definite "nobody" leaves every
|
|
53
|
+
* grant in place. The ACL write itself then happens under the shared-grant lock,
|
|
54
|
+
* which is the SAME lock a launch takes to add one — locking only the cleanup
|
|
55
|
+
* would leave the add/remove race open on every launch.
|
|
56
|
+
*
|
|
57
|
+
* ⚠️ A NEW CLAIM CANNOT ARRIVE BEHIND THIS. Workspace paths are minted per run
|
|
58
|
+
* (`ws-<stamp>-<rand>`), and by the time a sweep runs the checkout is gone and
|
|
59
|
+
* the registry record released, so the identity derived from that path can never
|
|
60
|
+
* be claimed again. This is the existing lifecycle doing the fencing, not a
|
|
61
|
+
* second mechanism.
|
|
62
|
+
*/
|
|
63
|
+
function retireWorkspaceGrants(workspace, deps = {}) {
|
|
64
|
+
const home = deps.home ?? (0, node_os_1.homedir)();
|
|
65
|
+
const users = deps.usersOf === undefined ? [] : deps.usersOf(workspace);
|
|
66
|
+
if (users === null) {
|
|
67
|
+
return { liveness: 'unknown', outcome: { released: [], pending: [] } };
|
|
68
|
+
}
|
|
69
|
+
if (users.length > 0) {
|
|
70
|
+
return { liveness: 'in-use', outcome: { released: [], pending: [] } };
|
|
71
|
+
}
|
|
72
|
+
const names = KINDS.map((kind) => (0, untrusted_exec_1.containerName)(kind, workspace));
|
|
73
|
+
const release = deps.release ?? ((n, h) => (0, shared_grants_1.releaseSharedGrants)(n, { home: h }));
|
|
74
|
+
return { liveness: 'retirable', outcome: release(names, home) };
|
|
75
|
+
}
|
|
76
|
+
function sweepWorkspaceResidue(workspace, home = (0, node_os_1.homedir)(), deps = {}) {
|
|
77
|
+
const removed = [];
|
|
78
|
+
const kept = [];
|
|
79
|
+
/**
|
|
80
|
+
* GRANTS FIRST, DIRECTORIES SECOND. A profile deleted before its ACEs are
|
|
81
|
+
* purged strands entries whose SID no longer resolves to a name, and they
|
|
82
|
+
* still count against the DACL cap. The numeric SID in the ledger is what
|
|
83
|
+
* makes the purge work either way, but the order costs nothing and keeps the
|
|
84
|
+
* readable case readable.
|
|
85
|
+
*/
|
|
86
|
+
const grants = retireWorkspaceGrants(workspace, { ...deps, home });
|
|
87
|
+
/**
|
|
88
|
+
* 🔴 `residueOf` IS INSIDE THE TRY, AND IT WAS THE for-of SUBJECT.
|
|
89
|
+
*
|
|
90
|
+
* It looks like a pure name computation and is not: `providerSessionDir` and
|
|
91
|
+
* `containedRoot` both `mkdirSync` as a side effect of being called, fifteen
|
|
92
|
+
* directories in all, under `$HOME` and `%TEMP%`. Any one of them throwing —
|
|
93
|
+
* ENOSPC, EACCES on a locked-down profile, EPERM from a scanner, ENOTDIR from
|
|
94
|
+
* a stale file where a directory should be — threw straight out of this
|
|
95
|
+
* function, past the try that was meant to make it best-effort, and out of
|
|
96
|
+
* the `--reap` loop.
|
|
97
|
+
*
|
|
98
|
+
* MEASURED: with one plain file planted at `%TEMP%/looply-contained`,
|
|
99
|
+
* `looply runs --reap` destroyed the FIRST orphan's checkout, record and slot,
|
|
100
|
+
* then exited 1 with a bare `ENOTDIR` and never printed a word about what it
|
|
101
|
+
* had already done — and never touched the second orphan, or any orphan,
|
|
102
|
+
* again. No attacker needed; `%TEMP%` being world-writable is the same fact
|
|
103
|
+
* this phase cites as the reason `noHooksDir` had to change.
|
|
104
|
+
*/
|
|
105
|
+
/**
|
|
106
|
+
* 🔴 ONE NAME AT A TIME, BECAUSE THE ARRAY WAS BUILT EAGERLY AND ONE THROW
|
|
107
|
+
* DISCARDED EVERY PATH ALREADY IN IT.
|
|
108
|
+
*
|
|
109
|
+
* The previous repair put `residueOf(...)` inside a try, which stopped the
|
|
110
|
+
* uncaught throw — and traded a loud abort for a silent leak. `residueOf`
|
|
111
|
+
* builds `[...roles.map(providerSessionDir), ...KINDS.map(containedRoot)]`,
|
|
112
|
+
* so the FIRST `containedRoot` failure threw out of the whole call and the
|
|
113
|
+
* three provider-session paths named a moment earlier were never swept.
|
|
114
|
+
*
|
|
115
|
+
* MEASURED: one plain file at world-writable `%TEMP%/looply-contained` made
|
|
116
|
+
* `--reap` report `retired`, exit 0, and leave 3 of 3 provider credentials on
|
|
117
|
+
* disk — quieter than the crash it replaced, and therefore worse, because
|
|
118
|
+
* nobody ever learns the sweep has stopped working.
|
|
119
|
+
*
|
|
120
|
+
* Each name is now computed and removed on its own. A directory this cannot
|
|
121
|
+
* even name is reported as kept, exactly like one it cannot remove.
|
|
122
|
+
*/
|
|
123
|
+
for (const name of residueNames(workspace, home)) {
|
|
124
|
+
let path;
|
|
125
|
+
try {
|
|
126
|
+
path = name();
|
|
127
|
+
}
|
|
128
|
+
catch (e) {
|
|
129
|
+
kept.push({ path: '(a residue path that could not be named)', because: e.message });
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
try {
|
|
133
|
+
(0, node_fs_1.rmSync)(path, { recursive: true, force: true });
|
|
134
|
+
removed.push(path);
|
|
135
|
+
}
|
|
136
|
+
catch (e) {
|
|
137
|
+
kept.push({ path, because: e.message });
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
removed,
|
|
142
|
+
kept,
|
|
143
|
+
grantsReleased: grants.outcome.released,
|
|
144
|
+
// A pending row is the truthful cleanup-pending state: the ledger still says
|
|
145
|
+
// `granted`, so the next sweep finds it and tries again. Nothing here ever
|
|
146
|
+
// reports cleanup it did not do.
|
|
147
|
+
grantsPending: grants.liveness === 'retirable'
|
|
148
|
+
? grants.outcome.pending
|
|
149
|
+
: [
|
|
150
|
+
{
|
|
151
|
+
path: '(shared grants)',
|
|
152
|
+
sid: '(all)',
|
|
153
|
+
because: `deferred: this workspace's identities are ${grants.liveness}`,
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=workspace-residue-sweep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-residue-sweep.js","sourceRoot":"","sources":["../src/workspace-residue-sweep.ts"],"names":[],"mappings":";;AAsFA,oCAMC;AAGD,8BAYC;AAsBD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