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,350 @@
|
|
|
1
|
+
import { type Envelope, type Spend } from '@looply/core';
|
|
2
|
+
import type { InvocationCost } from './gate';
|
|
3
|
+
/**
|
|
4
|
+
* WHAT THE MACHINE HAS ACTUALLY SPENT, WRITTEN DOWN.
|
|
5
|
+
*
|
|
6
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
7
|
+
* 🔴 `withinEnvelope` HAD NO SOURCE OF TRUTH, so a dollar ceiling was a number
|
|
8
|
+
* in a config file with nothing on the other side of the comparison.
|
|
9
|
+
*
|
|
10
|
+
* `envelope.ts` opens by saying a budget over numbers nobody counts is theatre,
|
|
11
|
+
* and it was right about its own tree: `parseAgentEnvelope` read
|
|
12
|
+
* `total_cost_usd`, `unwrapEnvelope` dropped it, and nothing anywhere appended
|
|
13
|
+
* a spend record. This is the missing half — the counter the ceiling reads.
|
|
14
|
+
*
|
|
15
|
+
* ⚠️ MACHINE-LEVEL, NOT PROJECT-LEVEL. The envelope bounds what THIS MACHINE
|
|
16
|
+
* may spend, and a per-project ledger would let ten projects each stay inside a
|
|
17
|
+
* ceiling that was written once. It lives beside the rails ledgers, which are
|
|
18
|
+
* machine-level for the same reason.
|
|
19
|
+
*
|
|
20
|
+
* ⚠️ AND IT IS HONEST ABOUT WHAT IT CANNOT SEE. The round runs its agent with
|
|
21
|
+
* `--output-format text` and receives no envelope, so the most expensive path
|
|
22
|
+
* in the system reports NO cost. That is recorded as an unmeasured invocation
|
|
23
|
+
* rather than a free one, and `spendInWindow` reports `usd: null` the moment
|
|
24
|
+
* one is in the window — which `withinEnvelope` refuses on. A ceiling that
|
|
25
|
+
* silently ignored the rounds would be the same theatre by a shorter route.
|
|
26
|
+
*/
|
|
27
|
+
export interface SpendRecord {
|
|
28
|
+
/** ISO 8601. */
|
|
29
|
+
readonly at: string;
|
|
30
|
+
/** What ran: `scan`, `compile`, `gap`, `round`. A label, not a key. */
|
|
31
|
+
readonly what: string;
|
|
32
|
+
/** Dollars, when the provider said. ABSENT MEANS UNMEASURED. */
|
|
33
|
+
readonly usd?: number;
|
|
34
|
+
readonly turns?: number;
|
|
35
|
+
readonly inputTokens?: number;
|
|
36
|
+
readonly outputTokens?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Context served from the provider's cache, and context written into it.
|
|
39
|
+
* ABSENT MEANS UNMEASURED, like every figure here. See `AgentEnvelope.cost`.
|
|
40
|
+
*/
|
|
41
|
+
readonly cacheReadTokens?: number;
|
|
42
|
+
readonly cacheWriteTokens?: number;
|
|
43
|
+
/**
|
|
44
|
+
* The provider's own session identifier for the invocation, when it said.
|
|
45
|
+
* Metadata, not money: it is what ties a ledger row back to the provider's
|
|
46
|
+
* record of the same turn, and it is kept apart from the model's text.
|
|
47
|
+
*/
|
|
48
|
+
readonly sessionId?: string;
|
|
49
|
+
/** Wall clock of the invocation, which is always measurable. */
|
|
50
|
+
readonly ms: number;
|
|
51
|
+
/**
|
|
52
|
+
* WHAT KIND OF ROW THIS IS.
|
|
53
|
+
*
|
|
54
|
+
* 🔴 A LEDGER OF WHAT WAS ALREADY SPENT CANNOT BOUND WHAT IS ABOUT TO BE.
|
|
55
|
+
*
|
|
56
|
+
* The cost of a Run is not known until it ends, which is hours after the
|
|
57
|
+
* decision to start it. A ceiling checked against completed rows alone
|
|
58
|
+
* therefore admits every concurrent start at once: ten daemons on one machine
|
|
59
|
+
* each read $0 spent, each decide they are under a $25 ceiling, and each
|
|
60
|
+
* launch. The ceiling was never wrong about the past; it simply had nothing
|
|
61
|
+
* to say about the future, which is the only thing an admission check is
|
|
62
|
+
* about.
|
|
63
|
+
*
|
|
64
|
+
* So a start writes a RESERVATION before it launches, and settles it to the
|
|
65
|
+
* real cost when the provider reports one. `spendInWindow` counts an open
|
|
66
|
+
* reservation at its estimate, so the second daemon reads the first one's
|
|
67
|
+
* intent rather than its silence.
|
|
68
|
+
*
|
|
69
|
+
* ⚠️ ABSENT MEANS `spend`, so every row an older build wrote still counts as
|
|
70
|
+
* exactly what it was.
|
|
71
|
+
*/
|
|
72
|
+
readonly kind?: 'spend' | 'reservation' | 'settlement' | 'cancellation';
|
|
73
|
+
/**
|
|
74
|
+
* Ties a settlement or a cancellation to its reservation.
|
|
75
|
+
*
|
|
76
|
+
* ⚠️ APPEND-ONLY, LIKE EVERY LEDGER HERE. A reservation is never rewritten or
|
|
77
|
+
* removed — closing one appends a row that names it. A torn write then costs
|
|
78
|
+
* one record rather than corrupting a running total.
|
|
79
|
+
*/
|
|
80
|
+
readonly id?: string;
|
|
81
|
+
/** What a reservation expects to cost. Absent means "cannot estimate". */
|
|
82
|
+
readonly estimateUsd?: number;
|
|
83
|
+
/**
|
|
84
|
+
* WHEN A RESERVATION STOPS COUNTING, AND WHY IT HAS TO.
|
|
85
|
+
*
|
|
86
|
+
* 🔴 THE PROCESS THAT ADMITS A RUN NEVER SEES IT END. The daemon spawns a
|
|
87
|
+
* detached child and returns; the run lives for hours in another process. So
|
|
88
|
+
* there is nobody to settle a reservation at the real number, and a
|
|
89
|
+
* reservation held open for ever would charge an estimate against the window
|
|
90
|
+
* long after the run it described had finished and recorded its own costs.
|
|
91
|
+
*
|
|
92
|
+
* A hold is therefore short and it EXPIRES. What it buys is the only thing an
|
|
93
|
+
* admission check needs and the only thing the ledger could not otherwise
|
|
94
|
+
* provide: concurrent starts SEE EACH OTHER, instead of each reading a
|
|
95
|
+
* machine that has spent nothing yet and all launching at once. Once the run
|
|
96
|
+
* is genuinely under way its own invocations are being recorded by the
|
|
97
|
+
* transport, and those are the real number — so the hold has done its job and
|
|
98
|
+
* gets out of the way rather than double-counting itself.
|
|
99
|
+
*
|
|
100
|
+
* ⚠️ IT IS NOT A BUDGET FOR THE RUN. Nothing here claims to know what a Run
|
|
101
|
+
* will cost, and this deliberately does not pretend to: it bounds the RATE at
|
|
102
|
+
* which runs may be admitted, and `maxWallClockMs` and `maxConcurrentRuns`
|
|
103
|
+
* bound the rest.
|
|
104
|
+
*/
|
|
105
|
+
readonly holdUntil?: string;
|
|
106
|
+
/**
|
|
107
|
+
* WHICH RUN SPENT THIS.
|
|
108
|
+
*
|
|
109
|
+
* 🔴 WITHOUT IT A RESERVATION CAN NEVER BE RECONCILED. Admission holds an
|
|
110
|
+
* ESTIMATE; what the run actually costs is written by the transport, row by
|
|
111
|
+
* row, over hours. Tying those rows to the run is the only way to settle the
|
|
112
|
+
* reservation at the real number instead of letting the hold silently expire
|
|
113
|
+
* and hoping the rows land before the ceiling is next consulted.
|
|
114
|
+
*
|
|
115
|
+
* Absent on rows written outside a run — a `scan`, a `verify` — which are
|
|
116
|
+
* charged as themselves and settle nothing.
|
|
117
|
+
*/
|
|
118
|
+
readonly runId?: string;
|
|
119
|
+
/**
|
|
120
|
+
* ON A SETTLEMENT: THE LAST OF ITS RUN'S ROWS THAT IT ACTUALLY SUMMED.
|
|
121
|
+
*
|
|
122
|
+
* 🔴 A SETTLEMENT REPLACES ROWS, SO WHICH ROWS MUST NOT BE A GUESS. The
|
|
123
|
+
* pairing was inferred from wall clock — "rows written before the settlement"
|
|
124
|
+
* — which is true of production and NOT true of anything with a fixed clock,
|
|
125
|
+
* and is one skewed timestamp away from being untrue in production too.
|
|
126
|
+
* MEASURED under a frozen clock: three real $1 invocations settled at $3, and
|
|
127
|
+
* the window read $6, because not one of the three sorted before the
|
|
128
|
+
* settlement that was computed from them.
|
|
129
|
+
*
|
|
130
|
+
* This is written from the rows the settlement actually saw, so the set it
|
|
131
|
+
* replaces is exact and needs no clock to agree with it. A straggler landing
|
|
132
|
+
* afterwards sorts past this mark and is charged on top, which is right: it
|
|
133
|
+
* is money the settlement never counted.
|
|
134
|
+
*/
|
|
135
|
+
readonly coversUpTo?: string;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* How long an admission hold counts against the window.
|
|
139
|
+
*
|
|
140
|
+
* Long enough to cover the gap between admitting a run and that run's first
|
|
141
|
+
* recorded invocation — a spawn, a git clone, a queue load, a first model call.
|
|
142
|
+
* Short enough that a hold left behind by a crashed daemon costs one window's
|
|
143
|
+
* arithmetic rather than a night.
|
|
144
|
+
*/
|
|
145
|
+
export declare const ADMISSION_HOLD_MS: number;
|
|
146
|
+
/**
|
|
147
|
+
* How long a reservation actually counts for: THE WINDOW THE CEILING IS
|
|
148
|
+
* WRITTEN OVER, never less than the floor above.
|
|
149
|
+
*
|
|
150
|
+
* 🔴 A FIVE-MINUTE HOLD ON A FORTY-FIVE-MINUTE TURN IS NOT A CEILING.
|
|
151
|
+
*
|
|
152
|
+
* MEASURED: a $10 ceiling, a $2 estimate, and runs whose first invocation had
|
|
153
|
+
* not yet returned — the ordinary case, because an implementer turn takes
|
|
154
|
+
* tens of minutes and records its cost only at the end. Every hold expired at
|
|
155
|
+
* five minutes; every later start re-read a machine that had spent $0; TWENTY
|
|
156
|
+
* were admitted against a ceiling of five. The window was never wrong about
|
|
157
|
+
* completed work. It simply forgot the work in progress.
|
|
158
|
+
*
|
|
159
|
+
* The window is the right horizon because it is the one the operator wrote: a
|
|
160
|
+
* reservation counts until it settles, or until it falls out of the window it
|
|
161
|
+
* was made in — at which point it cannot affect that window's arithmetic
|
|
162
|
+
* anyway. A hold abandoned by a crashed daemon therefore costs one window, the
|
|
163
|
+
* tolerance the floor above was chosen for, and it errs toward REFUSING starts
|
|
164
|
+
* rather than admitting unbounded ones. For a budget that is the only
|
|
165
|
+
* survivable direction to be wrong in.
|
|
166
|
+
*/
|
|
167
|
+
export declare function admissionHoldMs(windowMs: number): number;
|
|
168
|
+
/**
|
|
169
|
+
* ⚠️ ONE PATH PER MACHINE, AND NOT DERIVED FROM `cwd`.
|
|
170
|
+
*
|
|
171
|
+
* The rails ledgers next door are keyed by repository identity, which is right
|
|
172
|
+
* for them and wrong here: the envelope bounds what this MACHINE may spend, and
|
|
173
|
+
* a per-project ledger would let ten projects each stay comfortably inside a
|
|
174
|
+
* ceiling that was written once. Deriving it from `process.cwd()` would have
|
|
175
|
+
* been worse still — the same machine would keep several ledgers depending on
|
|
176
|
+
* where the command was typed.
|
|
177
|
+
*/
|
|
178
|
+
export declare function spendLedgerPath(home?: string): string;
|
|
179
|
+
/**
|
|
180
|
+
* The mutex that makes an admission decision authoritative.
|
|
181
|
+
*
|
|
182
|
+
* Machine-level, beside the ledger it serialises, because the ledger is what it
|
|
183
|
+
* protects and the ceiling is a machine's. See `exclusive-lock`.
|
|
184
|
+
*/
|
|
185
|
+
export declare function spendLockPath(home?: string): string;
|
|
186
|
+
/**
|
|
187
|
+
* Append one invocation's cost.
|
|
188
|
+
*
|
|
189
|
+
* 🔴 THE RETURN VALUE IS NOT DECORATION. Unlike the schedule log, a spend
|
|
190
|
+
* record that fails to write makes the machine look CHEAPER than it is, and the
|
|
191
|
+
* next ceiling check passes on a number that is missing a term. The caller is
|
|
192
|
+
* told so it can record the invocation as unmeasured instead of as absent.
|
|
193
|
+
*
|
|
194
|
+
* ⚠️ LED BY A NEWLINE, for the reason `coordinator.recordActions` wrote down: a
|
|
195
|
+
* torn write must cost one record, not two.
|
|
196
|
+
*/
|
|
197
|
+
export declare function recordSpend(record: SpendRecord, home?: string): boolean;
|
|
198
|
+
export type SpendRead = {
|
|
199
|
+
readonly ok: true;
|
|
200
|
+
readonly records: SpendRecord[];
|
|
201
|
+
} | {
|
|
202
|
+
readonly ok: false;
|
|
203
|
+
readonly because: string;
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Every parseable record, or why the ledger could not be read.
|
|
207
|
+
*
|
|
208
|
+
* 🔴 AN UNREADABLE LEDGER USED TO READ AS AN EMPTY ONE. Both answered `[]`, so
|
|
209
|
+
* a permissions change, a full disk or a corrupt file made a $250 night pass a
|
|
210
|
+
* $5 ceiling — the ceiling comparing against a number it had no basis for.
|
|
211
|
+
*
|
|
212
|
+
* ⚠️ ENOENT IS THE ONE ERROR THAT IS AN ANSWER. A ledger that does not exist is
|
|
213
|
+
* a machine that has spent nothing, which is true and is different from a
|
|
214
|
+
* machine that cannot say.
|
|
215
|
+
*
|
|
216
|
+
* ⚠️ AND A TORN FRAGMENT IS STILL SKIPPED ALONE rather than failing the read —
|
|
217
|
+
* that is what the leading newline buys, and a fragment is a record lost, not a
|
|
218
|
+
* total that cannot be trusted.
|
|
219
|
+
*/
|
|
220
|
+
export declare function readSpend(home?: string): SpendRead;
|
|
221
|
+
/**
|
|
222
|
+
* The `Spend` the envelope compares against, for the window ending now.
|
|
223
|
+
*
|
|
224
|
+
* 🔴 ONE UNMEASURED INVOCATION IN THE WINDOW MAKES THE WHOLE SUM UNMEASURED.
|
|
225
|
+
*
|
|
226
|
+
* The alternative is to add up the ones that reported and call it the total,
|
|
227
|
+
* which is a number that looks like a measurement and is not one. Against a
|
|
228
|
+
* ceiling it fails in the one direction that spends somebody's money: a night
|
|
229
|
+
* of rounds — none of which report a cost — would total $0.00 and sail under
|
|
230
|
+
* any limit. `null` means "cannot say", and `withinEnvelope` refuses on it.
|
|
231
|
+
*/
|
|
232
|
+
export type SpendView = {
|
|
233
|
+
readonly ok: true;
|
|
234
|
+
readonly spend: Spend;
|
|
235
|
+
} | {
|
|
236
|
+
readonly ok: false;
|
|
237
|
+
readonly because: string;
|
|
238
|
+
};
|
|
239
|
+
export declare function spendInWindow(now: number, windowMs: number, runsInFlight: number, home?: string,
|
|
240
|
+
/**
|
|
241
|
+
* What to charge an invocation that reported no cost.
|
|
242
|
+
*
|
|
243
|
+
* Absent keeps the strict reading — an unmeasured row makes the window
|
|
244
|
+
* unmeasurable — which is right for a caller that has no estimate to stand
|
|
245
|
+
* in with. See the charging loop.
|
|
246
|
+
*/
|
|
247
|
+
assumedUsd?: number): SpendView;
|
|
248
|
+
/**
|
|
249
|
+
* ADMISSION: MAY ONE MORE CONSEQUENTIAL INVOCATION START?
|
|
250
|
+
*
|
|
251
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
252
|
+
* 🔴 RESERVE FIRST, THEN VERIFY — CHECKING FIRST IS THE RACE.
|
|
253
|
+
*
|
|
254
|
+
* `withinEnvelope` is a pure comparison against a moment. Two machines, or two
|
|
255
|
+
* projects' daemons on one machine, both read the same moment and both admit:
|
|
256
|
+
* the ceiling is not wrong, it is simply answering a question about the past
|
|
257
|
+
* while the caller is asking one about the future.
|
|
258
|
+
*
|
|
259
|
+
* So this writes its intent BEFORE it decides, then re-reads and checks whether
|
|
260
|
+
* it is still inside. If somebody else's reservation got there first, the total
|
|
261
|
+
* now includes theirs and this one refuses and withdraws. It is the same
|
|
262
|
+
* compare-after-claim the surface lease and the queue-write lock both settled
|
|
263
|
+
* on, applied to a number instead of a directory.
|
|
264
|
+
*
|
|
265
|
+
* ⚠️ AND THE ESTIMATE IS AN ESTIMATE, WHICH IS SAID RATHER THAN HIDDEN. Nothing
|
|
266
|
+
* can know what a Run will cost before it runs. What a reservation buys is that
|
|
267
|
+
* concurrent starts SEE EACH OTHER; the settlement is what makes the number
|
|
268
|
+
* true afterwards. An estimate that is absent makes the window unmeasurable —
|
|
269
|
+
* which refuses — rather than free.
|
|
270
|
+
*/
|
|
271
|
+
export interface Admission {
|
|
272
|
+
/** Call when the invocation ends, with what it actually cost. */
|
|
273
|
+
settle(actualUsd: number | undefined, ms: number): void;
|
|
274
|
+
/** Call when it never happened. */
|
|
275
|
+
cancel(): void;
|
|
276
|
+
}
|
|
277
|
+
export type AdmissionResult = {
|
|
278
|
+
readonly ok: true;
|
|
279
|
+
readonly admission: Admission;
|
|
280
|
+
} | {
|
|
281
|
+
readonly ok: false;
|
|
282
|
+
readonly because: string;
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* What one run has ACTUALLY cost so far, from its own rows.
|
|
286
|
+
*
|
|
287
|
+
* 🔴 THIS IS THE OTHER HALF OF ADMISSION. A reservation is a promise; this is
|
|
288
|
+
* the receipt. Settling with it turns "we held $2.50 for this run" into "this
|
|
289
|
+
* run cost $1.87", which is what the next admission must compare against.
|
|
290
|
+
*
|
|
291
|
+
* ⚠️ NULL WHEN ANY OF ITS ROWS IS UNMEASURED, for the same reason the window
|
|
292
|
+
* total is: the round path reports no cost at all, so a run that did rounds has
|
|
293
|
+
* spent an amount nobody can state. Settling at a number would be inventing
|
|
294
|
+
* one; settling at `null` keeps the window unmeasurable, which the ceiling
|
|
295
|
+
* refuses on.
|
|
296
|
+
*/
|
|
297
|
+
export declare function spentByRun(runId: string, home?: string): number | null;
|
|
298
|
+
/**
|
|
299
|
+
* WOULD ADMISSION REFUSE RIGHT NOW? — READ ONLY, RESERVING NOTHING.
|
|
300
|
+
*
|
|
301
|
+
* 🔴 A SECOND READER OF ONE POLICY, NEVER A SECOND POLICY. It calls exactly the
|
|
302
|
+
* same `withinEnvelope` over exactly the same window that `admitSpend` does; the
|
|
303
|
+
* only difference is that it writes nothing.
|
|
304
|
+
*
|
|
305
|
+
* ⚠️ AND IT IS ADVISORY, WHICH IS THE WHOLE POINT. The autonomy tick uses it so
|
|
306
|
+
* a start already obviously over the ceiling costs no spawn, no workspace and
|
|
307
|
+
* none of a small number of attempts. It must NOT reserve: the canonical
|
|
308
|
+
* admission is `runLoop`'s, and a reservation taken here would be held again
|
|
309
|
+
* there — one start holding twice its estimate, and a machine refusing itself
|
|
310
|
+
* at half its ceiling.
|
|
311
|
+
*
|
|
312
|
+
* ⚠️ A PASS HERE PROMISES NOTHING. The window moves between this and the run's
|
|
313
|
+
* own admission, and the run's is the one that decides. That is the correct
|
|
314
|
+
* direction for an optimisation: it can only ever refuse something the gate
|
|
315
|
+
* would also have refused.
|
|
316
|
+
*/
|
|
317
|
+
export declare function peekEnvelope(env: Envelope, runsInFlight: number, now: number, home?: string,
|
|
318
|
+
/** What an unmeasured invocation is assumed to have cost. See `spendInWindow`. */
|
|
319
|
+
estimateUsd?: number): {
|
|
320
|
+
readonly ok: true;
|
|
321
|
+
} | {
|
|
322
|
+
readonly ok: false;
|
|
323
|
+
readonly because: string;
|
|
324
|
+
};
|
|
325
|
+
export declare function admitSpend(env: Envelope, what: string, estimateUsd: number | undefined, runsInFlight: number, now?: () => number, home?: string,
|
|
326
|
+
/**
|
|
327
|
+
* WHICH RUN THIS HOLD IS FOR, so its settlement can REPLACE that run's rows.
|
|
328
|
+
*
|
|
329
|
+
* 🔴 WITHOUT IT EVERY RECONCILED RUN WAS CHARGED TWICE. The settlement's
|
|
330
|
+
* amount is computed BY SUMMING the run's own rows — and with nothing tying
|
|
331
|
+
* it to them, `spendInWindow` added it to the very rows it came from.
|
|
332
|
+
* MEASURED: three real invocations of $1 settled at $3, and the window read
|
|
333
|
+
* $6. A ceiling fed twice its truth refuses at half its value.
|
|
334
|
+
*/
|
|
335
|
+
runId?: string): AdmissionResult;
|
|
336
|
+
/**
|
|
337
|
+
* Wrap an agent invocation so its cost is recorded.
|
|
338
|
+
*
|
|
339
|
+
* ⚠️ AT THE INVOCATION, NOT AT THE PARSE. `unwrapEnvelope` is pure and stays
|
|
340
|
+
* pure — a parser that wrote a file would be impossible to use in a test and
|
|
341
|
+
* would record a cost every time somebody re-read a transcript. This wraps the
|
|
342
|
+
* one place where an invocation actually happens.
|
|
343
|
+
*/
|
|
344
|
+
export declare function recordingSpend(what: string, now: () => number, home?: string,
|
|
345
|
+
/** Which run this invocation belongs to, so its reservation can be settled. */
|
|
346
|
+
runId?: string): (r: {
|
|
347
|
+
ms: number;
|
|
348
|
+
cost?: InvocationCost;
|
|
349
|
+
}) => void;
|
|
350
|
+
//# sourceMappingURL=spend-ledger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spend-ledger.d.ts","sourceRoot":"","sources":["../src/spend-ledger.ts"],"names":[],"mappings":"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"}
|