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,55 @@
|
|
|
1
|
+
import type { RoundOutcome, RunTotals } from '@looply/core';
|
|
2
|
+
/**
|
|
3
|
+
* Notify cadence: when the run speaks, given `notify.every_min`.
|
|
4
|
+
*
|
|
5
|
+
* The round runner reports *that* things happened; this class decides *whether
|
|
6
|
+
* the phone hears about it*. Keeping the cadence out of the runner means the
|
|
7
|
+
* every_min rules are testable with no git, no queue and no rounds — and the
|
|
8
|
+
* runner stays ignorant of clocks-between-messages entirely.
|
|
9
|
+
*
|
|
10
|
+
* The one absolute rule (DESIGN §12 case 35): `every_min: 0` means silence.
|
|
11
|
+
* Not "fewer messages" — none, including the start and finish lines. A user who
|
|
12
|
+
* turned reporting off and still gets a 3am "looply started" SMS learns that
|
|
13
|
+
* the off switch is decorative, and stops trusting every other rail.
|
|
14
|
+
*/
|
|
15
|
+
export interface RunStartInfo {
|
|
16
|
+
minHours: number;
|
|
17
|
+
baseSha: string;
|
|
18
|
+
}
|
|
19
|
+
export interface RoundFinishInfo {
|
|
20
|
+
outcome: RoundOutcome;
|
|
21
|
+
itemTitle: string;
|
|
22
|
+
elapsedMs: number;
|
|
23
|
+
remainingMs: number;
|
|
24
|
+
}
|
|
25
|
+
export interface RunEndInfo {
|
|
26
|
+
totals: RunTotals;
|
|
27
|
+
elapsedMs: number;
|
|
28
|
+
branch: string;
|
|
29
|
+
stopReason: string;
|
|
30
|
+
}
|
|
31
|
+
/** The hook surface the round runner drives. Implementations must not throw. */
|
|
32
|
+
export interface RunProgressNotifier {
|
|
33
|
+
runStarted(info: RunStartInfo): Promise<void>;
|
|
34
|
+
roundFinished(info: RoundFinishInfo): Promise<void>;
|
|
35
|
+
runEnded(info: RunEndInfo): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
/** What delivery looks like from here: `ChannelDispatcher.send`, or a test double. */
|
|
38
|
+
export interface CadenceSender {
|
|
39
|
+
send(text: string): Promise<unknown>;
|
|
40
|
+
}
|
|
41
|
+
export declare class CadenceNotifier implements RunProgressNotifier {
|
|
42
|
+
private readonly everyMin;
|
|
43
|
+
private readonly sender;
|
|
44
|
+
private readonly now;
|
|
45
|
+
private readonly window;
|
|
46
|
+
private lastReportAt;
|
|
47
|
+
private lastItem;
|
|
48
|
+
constructor(everyMin: number, sender: CadenceSender, now: () => number);
|
|
49
|
+
private get silent();
|
|
50
|
+
runStarted(info: RunStartInfo): Promise<void>;
|
|
51
|
+
roundFinished(info: RoundFinishInfo): Promise<void>;
|
|
52
|
+
runEnded(info: RunEndInfo): Promise<void>;
|
|
53
|
+
private deliver;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=notify-cadence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify-cadence.d.ts","sourceRoot":"","sources":["../src/notify-cadence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG5D;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,gFAAgF;AAChF,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,aAAa,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C;AAED,sFAAsF;AACtF,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACtC;AAED,qBAAa,eAAgB,YAAW,mBAAmB;IAMvD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAPtB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAC7C,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,QAAQ,CAAuB;gBAGpB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,MAAM,MAAM;IAGpC,OAAO,KAAK,MAAM,GAEjB;IAEK,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ7C,aAAa,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBnD,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;YAajC,OAAO;CAStB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CadenceNotifier = void 0;
|
|
4
|
+
const notify_1 = require("./notify");
|
|
5
|
+
class CadenceNotifier {
|
|
6
|
+
everyMin;
|
|
7
|
+
sender;
|
|
8
|
+
now;
|
|
9
|
+
window = new notify_1.NotifyWindow();
|
|
10
|
+
lastReportAt = 0;
|
|
11
|
+
lastItem = null;
|
|
12
|
+
constructor(everyMin, sender, now) {
|
|
13
|
+
this.everyMin = everyMin;
|
|
14
|
+
this.sender = sender;
|
|
15
|
+
this.now = now;
|
|
16
|
+
}
|
|
17
|
+
get silent() {
|
|
18
|
+
return this.everyMin <= 0;
|
|
19
|
+
}
|
|
20
|
+
async runStarted(info) {
|
|
21
|
+
if (this.silent)
|
|
22
|
+
return;
|
|
23
|
+
// The start line counts as a report: the first window is measured from it,
|
|
24
|
+
// so a 30min cadence does not fire twice in the opening minute.
|
|
25
|
+
this.lastReportAt = this.now();
|
|
26
|
+
await this.deliver((0, notify_1.formatStartReport)({ minHours: info.minHours, baseSha: info.baseSha, everyMin: this.everyMin }));
|
|
27
|
+
}
|
|
28
|
+
async roundFinished(info) {
|
|
29
|
+
if (this.silent)
|
|
30
|
+
return;
|
|
31
|
+
this.window.record(info.outcome);
|
|
32
|
+
this.lastItem = info.itemTitle;
|
|
33
|
+
if (this.now() - this.lastReportAt < this.everyMin * 60_000)
|
|
34
|
+
return;
|
|
35
|
+
const text = (0, notify_1.formatWindowReport)({
|
|
36
|
+
counts: this.window.counts,
|
|
37
|
+
lastItem: this.lastItem,
|
|
38
|
+
elapsedMs: info.elapsedMs,
|
|
39
|
+
remainingMs: info.remainingMs,
|
|
40
|
+
});
|
|
41
|
+
this.lastReportAt = this.now();
|
|
42
|
+
this.window.reset();
|
|
43
|
+
await this.deliver(text);
|
|
44
|
+
}
|
|
45
|
+
async runEnded(info) {
|
|
46
|
+
if (this.silent)
|
|
47
|
+
return;
|
|
48
|
+
await this.deliver((0, notify_1.formatEndReport)({
|
|
49
|
+
counts: info.totals,
|
|
50
|
+
elapsedMs: info.elapsedMs,
|
|
51
|
+
rounds: info.totals.rounds,
|
|
52
|
+
branch: info.branch,
|
|
53
|
+
stopReason: info.stopReason,
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
async deliver(text) {
|
|
57
|
+
try {
|
|
58
|
+
await this.sender.send(text);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// ChannelDispatcher already resolves on every failure (§12 case 33), but
|
|
62
|
+
// this class is the last line between "reporting broke" and "the run
|
|
63
|
+
// died", so it does not rely on the sender honouring that contract.
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.CadenceNotifier = CadenceNotifier;
|
|
68
|
+
//# sourceMappingURL=notify-cadence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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,CAAC,MAAM;YAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACpB,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,IAAgB;QAC7B,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;QACxB,MAAM,IAAI,CAAC,OAAO,CAChB,IAAA,wBAAe,EAAC;YACd,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAC1B,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC,CACH,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,OAAO,CAAC,IAAY;QAChC,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;QAAC,MAAM,CAAC;YACP,yEAAyE;YACzE,qEAAqE;YACrE,oEAAoE;QACtE,CAAC;IACH,CAAC;CACF;AA7DD,0CA6DC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The channel dispatcher: the piece that actually delivers a notification.
|
|
3
|
+
*
|
|
4
|
+
* It shells out to `~/.looply/notify/<channel>.sh <text> [dest]` — outside the
|
|
5
|
+
* target repo, because the discard path runs `git clean -fd` and would otherwise
|
|
6
|
+
* delete it (DESIGN §3.2) — and maps the script's exit code onto the four
|
|
7
|
+
* outcomes of DESIGN §5.1: 0 sent, 1 config, 2 rejected, 3 network.
|
|
8
|
+
*
|
|
9
|
+
* The one property everything here serves: **no notifier failure may stop the
|
|
10
|
+
* run** (DESIGN §12 cases 33–34). `send` resolves on every path — rejection,
|
|
11
|
+
* missing script, spawn failure, hang — because the run is worth more than the
|
|
12
|
+
* reporting about it.
|
|
13
|
+
*/
|
|
14
|
+
export type NotifyOutcome = 'sent' | 'config' | 'rejected' | 'network';
|
|
15
|
+
export interface DispatchResult {
|
|
16
|
+
outcome: NotifyOutcome;
|
|
17
|
+
/** The script's raw exit code; null when it never exited on its own. */
|
|
18
|
+
code: number | null;
|
|
19
|
+
/** Why, on every outcome other than `sent`. */
|
|
20
|
+
detail: string | null;
|
|
21
|
+
}
|
|
22
|
+
/** What running the channel script produced, before any interpretation. */
|
|
23
|
+
export interface NotifyExecResult {
|
|
24
|
+
code: number | null;
|
|
25
|
+
timedOut: boolean;
|
|
26
|
+
/** Spawn-level failure message, when the script never ran at all. */
|
|
27
|
+
error?: string;
|
|
28
|
+
}
|
|
29
|
+
export type NotifyExec = (scriptPath: string, args: readonly string[], timeoutMs: number) => Promise<NotifyExecResult>;
|
|
30
|
+
export interface NotifyChannelDeps {
|
|
31
|
+
exec: NotifyExec;
|
|
32
|
+
fileExists(path: string): boolean;
|
|
33
|
+
/** Where preflight warnings and failed sends land; the only trace they leave. */
|
|
34
|
+
log(line: string): void;
|
|
35
|
+
homeDir: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A notification is quick or it is abandoned: a gateway that hangs for minutes
|
|
39
|
+
* must not stretch every round by that much, so the script gets a short leash
|
|
40
|
+
* and the same group-kill a hung gate step gets.
|
|
41
|
+
*/
|
|
42
|
+
export declare const NOTIFY_TIMEOUT_MS = 30000;
|
|
43
|
+
export declare function channelScriptPath(homeDir: string, channel: string): string;
|
|
44
|
+
/** Map one execution onto the four outcomes. Anything off-contract is `config`. */
|
|
45
|
+
export declare function outcomeForExec(r: NotifyExecResult): DispatchResult;
|
|
46
|
+
export declare class ChannelDispatcher {
|
|
47
|
+
private readonly deps;
|
|
48
|
+
private readonly channel;
|
|
49
|
+
private disabled;
|
|
50
|
+
private readonly scriptPath;
|
|
51
|
+
private readonly channelValid;
|
|
52
|
+
constructor(deps: NotifyChannelDeps, channel: string);
|
|
53
|
+
/**
|
|
54
|
+
* DESIGN §12 case 34: a missing notifier at preflight is a warning and a
|
|
55
|
+
* disabled channel, never a refusal to run. Returns true when the channel is
|
|
56
|
+
* usable.
|
|
57
|
+
*/
|
|
58
|
+
preflight(): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Deliver one message. Resolves on every path — a notifier failure is logged
|
|
61
|
+
* and returned, never thrown, because a dead gateway must not stop the loop
|
|
62
|
+
* (DESIGN §12 case 33).
|
|
63
|
+
*/
|
|
64
|
+
send(text: string, dest?: string): Promise<DispatchResult>;
|
|
65
|
+
}
|
|
66
|
+
/** The real exec: argv-array, no shell, so a message body with quotes or `$` in
|
|
67
|
+
* an item title arrives as one literal argument instead of shell syntax. */
|
|
68
|
+
export declare function nodeNotifyExec(scriptPath: string, args: readonly string[], timeoutMs: number): Promise<NotifyExecResult>;
|
|
69
|
+
//# sourceMappingURL=notify-channel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify-channel.d.ts","sourceRoot":"","sources":["../src/notify-channel.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAEvE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,aAAa,CAAC;IACvB,wEAAwE;IACxE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,2EAA2E;AAC3E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,q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
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChannelDispatcher = exports.NOTIFY_TIMEOUT_MS = void 0;
|
|
4
|
+
exports.channelScriptPath = channelScriptPath;
|
|
5
|
+
exports.outcomeForExec = outcomeForExec;
|
|
6
|
+
exports.nodeNotifyExec = nodeNotifyExec;
|
|
7
|
+
const exec_domains_1 = require("./exec-domains");
|
|
8
|
+
const node_child_process_1 = require("node:child_process");
|
|
9
|
+
const command_runner_1 = require("./command-runner");
|
|
10
|
+
const notify_1 = require("./notify");
|
|
11
|
+
/**
|
|
12
|
+
* A notification is quick or it is abandoned: a gateway that hangs for minutes
|
|
13
|
+
* must not stretch every round by that much, so the script gets a short leash
|
|
14
|
+
* and the same group-kill a hung gate step gets.
|
|
15
|
+
*/
|
|
16
|
+
exports.NOTIFY_TIMEOUT_MS = 30_000;
|
|
17
|
+
/**
|
|
18
|
+
* The channel name comes from user-editable config.yaml and is interpolated
|
|
19
|
+
* into a path, so it must be a bare name — `../../x` would execute an arbitrary
|
|
20
|
+
* script as the runner.
|
|
21
|
+
*/
|
|
22
|
+
const CHANNEL_NAME = /^[A-Za-z0-9_-]+$/;
|
|
23
|
+
function channelScriptPath(homeDir, channel) {
|
|
24
|
+
return `${homeDir}/.looply/notify/${channel}.sh`;
|
|
25
|
+
}
|
|
26
|
+
/** Map one execution onto the four outcomes. Anything off-contract is `config`. */
|
|
27
|
+
function outcomeForExec(r) {
|
|
28
|
+
if (r.error !== undefined) {
|
|
29
|
+
return { outcome: 'config', code: null, detail: `channel script failed to start: ${r.error}` };
|
|
30
|
+
}
|
|
31
|
+
if (r.timedOut) {
|
|
32
|
+
// A gateway that never answers is a network problem, not a config one — the
|
|
33
|
+
// script was fine yesterday and will be fine when the network returns.
|
|
34
|
+
return { outcome: 'network', code: null, detail: `channel script hung past ${exports.NOTIFY_TIMEOUT_MS}ms — killed` };
|
|
35
|
+
}
|
|
36
|
+
switch (r.code) {
|
|
37
|
+
case notify_1.NOTIFY_EXIT.sent:
|
|
38
|
+
return { outcome: 'sent', code: r.code, detail: null };
|
|
39
|
+
case notify_1.NOTIFY_EXIT.config:
|
|
40
|
+
return { outcome: 'config', code: r.code, detail: 'channel reports a configuration problem' };
|
|
41
|
+
case notify_1.NOTIFY_EXIT.rejected:
|
|
42
|
+
return { outcome: 'rejected', code: r.code, detail: 'gateway rejected the message' };
|
|
43
|
+
case notify_1.NOTIFY_EXIT.network:
|
|
44
|
+
return { outcome: 'network', code: r.code, detail: 'network failure reaching the gateway' };
|
|
45
|
+
default:
|
|
46
|
+
// An exit code outside the contract means the script is broken, and a
|
|
47
|
+
// broken script must never read as delivered.
|
|
48
|
+
return {
|
|
49
|
+
outcome: 'config',
|
|
50
|
+
code: r.code,
|
|
51
|
+
detail: r.code === null ? 'channel script died to a signal' : `unexpected exit code ${r.code}`,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
class ChannelDispatcher {
|
|
56
|
+
deps;
|
|
57
|
+
channel;
|
|
58
|
+
disabled = false;
|
|
59
|
+
scriptPath;
|
|
60
|
+
channelValid;
|
|
61
|
+
constructor(deps, channel) {
|
|
62
|
+
this.deps = deps;
|
|
63
|
+
this.channel = channel;
|
|
64
|
+
this.channelValid = CHANNEL_NAME.test(channel);
|
|
65
|
+
// An invalid name never reaches the filesystem, whether or not preflight ran.
|
|
66
|
+
this.scriptPath = this.channelValid ? channelScriptPath(deps.homeDir, channel) : '';
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* DESIGN §12 case 34: a missing notifier at preflight is a warning and a
|
|
70
|
+
* disabled channel, never a refusal to run. Returns true when the channel is
|
|
71
|
+
* usable.
|
|
72
|
+
*/
|
|
73
|
+
preflight() {
|
|
74
|
+
if (!this.channelValid) {
|
|
75
|
+
this.deps.log(`notify: channel name ${JSON.stringify(this.channel)} is not a bare name — channel disabled`);
|
|
76
|
+
this.disabled = true;
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
if (!this.deps.fileExists(this.scriptPath)) {
|
|
80
|
+
this.deps.log(`notify: ${this.scriptPath} not found — channel disabled, running anyway`);
|
|
81
|
+
this.disabled = true;
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Deliver one message. Resolves on every path — a notifier failure is logged
|
|
88
|
+
* and returned, never thrown, because a dead gateway must not stop the loop
|
|
89
|
+
* (DESIGN §12 case 33).
|
|
90
|
+
*/
|
|
91
|
+
async send(text, dest) {
|
|
92
|
+
if (this.disabled || !this.channelValid) {
|
|
93
|
+
// Not logged per send: preflight already warned once, and a disabled
|
|
94
|
+
// channel firing every window would fill the log with the same line.
|
|
95
|
+
return { outcome: 'config', code: null, detail: 'channel disabled' };
|
|
96
|
+
}
|
|
97
|
+
let r;
|
|
98
|
+
try {
|
|
99
|
+
r = await this.deps.exec(this.scriptPath, dest === undefined ? [text] : [text, dest], exports.NOTIFY_TIMEOUT_MS);
|
|
100
|
+
}
|
|
101
|
+
catch (e) {
|
|
102
|
+
r = { code: null, timedOut: false, error: e instanceof Error ? e.message : String(e) };
|
|
103
|
+
}
|
|
104
|
+
const result = outcomeForExec(r);
|
|
105
|
+
if (result.outcome !== 'sent') {
|
|
106
|
+
this.deps.log(`notify(${this.channel}): ${result.outcome} — ${result.detail ?? 'no detail'}`);
|
|
107
|
+
}
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
exports.ChannelDispatcher = ChannelDispatcher;
|
|
112
|
+
/** The real exec: argv-array, no shell, so a message body with quotes or `$` in
|
|
113
|
+
* an item title arrives as one literal argument instead of shell syntax. */
|
|
114
|
+
function nodeNotifyExec(scriptPath, args, timeoutMs) {
|
|
115
|
+
return new Promise((resolve) => {
|
|
116
|
+
let settled = false;
|
|
117
|
+
let timer;
|
|
118
|
+
const finish = (r) => {
|
|
119
|
+
if (settled)
|
|
120
|
+
return;
|
|
121
|
+
settled = true;
|
|
122
|
+
if (timer !== undefined)
|
|
123
|
+
clearTimeout(timer);
|
|
124
|
+
resolve(r);
|
|
125
|
+
};
|
|
126
|
+
const child = (0, node_child_process_1.spawn)(scriptPath, [...args], {
|
|
127
|
+
detached: process.platform !== 'win32',
|
|
128
|
+
stdio: 'ignore',
|
|
129
|
+
// NOT CONTAINED, and deliberately so: this script is the person's own,
|
|
130
|
+
// stored under their home directory, and running it is the product
|
|
131
|
+
// working. But it was inheriting the daemon's entire environment — the
|
|
132
|
+
// machine token included — to send a message. A notification has never
|
|
133
|
+
// needed a credential.
|
|
134
|
+
// Cast because a type in node_modules augments NodeJS.ProcessEnv with
|
|
135
|
+
// required members, so no explicit record satisfies it. The value is an
|
|
136
|
+
// ordinary environment; the assertion is about that declaration, not
|
|
137
|
+
// about the contents.
|
|
138
|
+
env: (0, exec_domains_1.buildNotifyEnv)(),
|
|
139
|
+
});
|
|
140
|
+
child.on('error', (err) => finish({ code: null, timedOut: false, error: err.message }));
|
|
141
|
+
child.on('exit', (code) => finish({ code, timedOut: false }));
|
|
142
|
+
timer = setTimeout(() => {
|
|
143
|
+
// Same rationale as the gate's runner: kill the group and resolve now — a
|
|
144
|
+
// script that survives the kill is exactly the hang being escaped.
|
|
145
|
+
if (child.pid !== undefined)
|
|
146
|
+
(0, command_runner_1.nodeKillTree)(child.pid);
|
|
147
|
+
finish({ code: null, timedOut: true });
|
|
148
|
+
}, timeoutMs);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=notify-channel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify-channel.js","sourceRoot":"","sources":["../src/notify-channel.ts"],"names":[],"mappings":";;;AAiEA,8CAEC;AAGD,wCA2BC;AA8DD,wCAqCC;AApMD,iDAAgD;AAChD,2DAA2C;AAC3C,qDAAgD;AAChD,qCAAuC;AAgDvC;;;;GAI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,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QACzC,CAAC,EAAE,SAAS,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/notify.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { RoundOutcome } from '@looply/core';
|
|
2
|
+
export declare function foldAscii(input: string): string;
|
|
3
|
+
export declare function truncate(text: string, cap: number): string;
|
|
4
|
+
/** Prepare a body for a channel: folded, single-line, capped. Never split. */
|
|
5
|
+
export declare function prepareBody(text: string, cap?: number): string;
|
|
6
|
+
export declare function formatDurationHm(ms: number): string;
|
|
7
|
+
/**
|
|
8
|
+
* Counters for one reporting window.
|
|
9
|
+
*
|
|
10
|
+
* Windowed rather than cumulative so each message describes its own interval —
|
|
11
|
+
* a cumulative tally makes a stalled hour look identical to a productive one.
|
|
12
|
+
*/
|
|
13
|
+
export declare class NotifyWindow {
|
|
14
|
+
private committed;
|
|
15
|
+
private abandoned;
|
|
16
|
+
private discarded;
|
|
17
|
+
private rounds;
|
|
18
|
+
record(outcome: RoundOutcome): void;
|
|
19
|
+
get counts(): {
|
|
20
|
+
committed: number;
|
|
21
|
+
abandoned: number;
|
|
22
|
+
discarded: number;
|
|
23
|
+
rounds: number;
|
|
24
|
+
};
|
|
25
|
+
reset(): void;
|
|
26
|
+
}
|
|
27
|
+
export interface WindowReport {
|
|
28
|
+
counts: {
|
|
29
|
+
committed: number;
|
|
30
|
+
abandoned: number;
|
|
31
|
+
discarded: number;
|
|
32
|
+
rounds: number;
|
|
33
|
+
};
|
|
34
|
+
lastItem: string | null;
|
|
35
|
+
elapsedMs: number;
|
|
36
|
+
remainingMs: number;
|
|
37
|
+
itemCap?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* One line of progress.
|
|
41
|
+
*
|
|
42
|
+
* A window in which nothing finished says so explicitly and names what it is still
|
|
43
|
+
* on — silence and slowness must not look the same.
|
|
44
|
+
*/
|
|
45
|
+
export declare function formatWindowReport(r: WindowReport): string;
|
|
46
|
+
export declare function formatStartReport(opts: {
|
|
47
|
+
minHours: number;
|
|
48
|
+
baseSha: string;
|
|
49
|
+
everyMin: number;
|
|
50
|
+
}): string;
|
|
51
|
+
export declare function formatEndReport(opts: {
|
|
52
|
+
counts: {
|
|
53
|
+
committed: number;
|
|
54
|
+
abandoned: number;
|
|
55
|
+
discarded: number;
|
|
56
|
+
};
|
|
57
|
+
elapsedMs: number;
|
|
58
|
+
rounds: number;
|
|
59
|
+
branch: string;
|
|
60
|
+
stopReason: string;
|
|
61
|
+
}): string;
|
|
62
|
+
/** Exit codes from a notifier channel. A dead gateway must never stop the loop. */
|
|
63
|
+
export declare const NOTIFY_EXIT: {
|
|
64
|
+
readonly sent: 0;
|
|
65
|
+
readonly config: 1;
|
|
66
|
+
readonly rejected: 2;
|
|
67
|
+
readonly network: 3;
|
|
68
|
+
};
|
|
69
|
+
export type NotifyExit = (typeof NOTIFY_EXIT)[keyof typeof NOTIFY_EXIT];
|
|
70
|
+
export declare function isFatalToLoop(_code: NotifyExit): boolean;
|
|
71
|
+
//# sourceMappingURL=notify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify.d.ts","sourceRoot":"","sources":["../src/notify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAgCjD,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAK/C;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAKnD;AAED;;;;;GAKG;AACH,qBAAa,YAAY;IACvB,OAAO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AM,WAAW;;;;;CAA2D,CAAC;AACpF,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAExE,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAExD"}
|
package/dist/notify.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NOTIFY_EXIT = exports.NotifyWindow = void 0;
|
|
4
|
+
exports.foldAscii = foldAscii;
|
|
5
|
+
exports.truncate = truncate;
|
|
6
|
+
exports.prepareBody = prepareBody;
|
|
7
|
+
exports.formatDurationHm = formatDurationHm;
|
|
8
|
+
exports.formatWindowReport = formatWindowReport;
|
|
9
|
+
exports.formatStartReport = formatStartReport;
|
|
10
|
+
exports.formatEndReport = formatEndReport;
|
|
11
|
+
exports.isFatalToLoop = isFatalToLoop;
|
|
12
|
+
/**
|
|
13
|
+
* Progress reporting.
|
|
14
|
+
*
|
|
15
|
+
* This lives in the runner rather than in a supervising agent session, because a
|
|
16
|
+
* run that goes quiet is the worst failure mode and reporting must survive the
|
|
17
|
+
* supervising terminal being closed. The message format is deliberately readable
|
|
18
|
+
* on a lock screen without opening anything.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Fold to ASCII.
|
|
22
|
+
*
|
|
23
|
+
* The SMS gateway rejects non-ASCII bodies outright, and item titles are full of
|
|
24
|
+
* em dashes and curly quotes. Each character is replaced individually and never
|
|
25
|
+
* via a character class: a byte-oriented replacement over a class would rewrite
|
|
26
|
+
* each of an em dash's three UTF-8 bytes and produce `---`.
|
|
27
|
+
*/
|
|
28
|
+
const FOLD = [
|
|
29
|
+
['—', '-'], // em dash
|
|
30
|
+
['–', '-'], // en dash
|
|
31
|
+
['‘', "'"], // left single quote
|
|
32
|
+
['’', "'"], // right single quote
|
|
33
|
+
['“', '"'], // left double quote
|
|
34
|
+
['”', '"'], // right double quote
|
|
35
|
+
['…', '...'], // ellipsis
|
|
36
|
+
[' ', ' '], // non-breaking space
|
|
37
|
+
['•', '*'], // bullet
|
|
38
|
+
['·', '-'], // middle dot
|
|
39
|
+
];
|
|
40
|
+
function foldAscii(input) {
|
|
41
|
+
let out = input;
|
|
42
|
+
for (const [from, to] of FOLD)
|
|
43
|
+
out = out.split(from).join(to);
|
|
44
|
+
// Anything left outside printable ASCII is dropped rather than mangled.
|
|
45
|
+
return out.replace(/[\r\n]+/g, ' ').replace(/[^\x20-\x7E]/g, '');
|
|
46
|
+
}
|
|
47
|
+
function truncate(text, cap) {
|
|
48
|
+
return text.length <= cap ? text : text.slice(0, cap);
|
|
49
|
+
}
|
|
50
|
+
/** Prepare a body for a channel: folded, single-line, capped. Never split. */
|
|
51
|
+
function prepareBody(text, cap = 280) {
|
|
52
|
+
return truncate(foldAscii(text).replace(/\s+/g, ' ').trim(), cap);
|
|
53
|
+
}
|
|
54
|
+
function formatDurationHm(ms) {
|
|
55
|
+
const total = Math.max(0, Math.floor(ms / 1000));
|
|
56
|
+
const h = Math.floor(total / 3600);
|
|
57
|
+
const m = Math.floor((total % 3600) / 60);
|
|
58
|
+
return `${h}h${String(m).padStart(2, '0')}m`;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Counters for one reporting window.
|
|
62
|
+
*
|
|
63
|
+
* Windowed rather than cumulative so each message describes its own interval —
|
|
64
|
+
* a cumulative tally makes a stalled hour look identical to a productive one.
|
|
65
|
+
*/
|
|
66
|
+
class NotifyWindow {
|
|
67
|
+
committed = 0;
|
|
68
|
+
abandoned = 0;
|
|
69
|
+
discarded = 0;
|
|
70
|
+
rounds = 0;
|
|
71
|
+
record(outcome) {
|
|
72
|
+
this.rounds += 1;
|
|
73
|
+
if (outcome === 'committed')
|
|
74
|
+
this.committed += 1;
|
|
75
|
+
else if (outcome === 'abandoned')
|
|
76
|
+
this.abandoned += 1;
|
|
77
|
+
else
|
|
78
|
+
this.discarded += 1;
|
|
79
|
+
}
|
|
80
|
+
get counts() {
|
|
81
|
+
return {
|
|
82
|
+
committed: this.committed,
|
|
83
|
+
abandoned: this.abandoned,
|
|
84
|
+
discarded: this.discarded,
|
|
85
|
+
rounds: this.rounds,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
reset() {
|
|
89
|
+
this.committed = 0;
|
|
90
|
+
this.abandoned = 0;
|
|
91
|
+
this.discarded = 0;
|
|
92
|
+
this.rounds = 0;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.NotifyWindow = NotifyWindow;
|
|
96
|
+
/**
|
|
97
|
+
* One line of progress.
|
|
98
|
+
*
|
|
99
|
+
* A window in which nothing finished says so explicitly and names what it is still
|
|
100
|
+
* on — silence and slowness must not look the same.
|
|
101
|
+
*/
|
|
102
|
+
function formatWindowReport(r) {
|
|
103
|
+
const { committed, abandoned, discarded, rounds } = r.counts;
|
|
104
|
+
const head = `[${committed}][${abandoned}][${discarded}]`;
|
|
105
|
+
const item = r.lastItem ? truncate(foldAscii(r.lastItem), r.itemCap ?? 60) : 'nothing yet';
|
|
106
|
+
const what = rounds === 0
|
|
107
|
+
? `no round finished this window, still on: ${item}`
|
|
108
|
+
: `${rounds} rounds, last: ${item}`;
|
|
109
|
+
const tail = `(${formatDurationHm(r.elapsedMs)} in, ${Math.max(0, Math.floor(r.remainingMs / 60000))}min left)`;
|
|
110
|
+
return prepareBody(`${head} - ${what} ${tail}`);
|
|
111
|
+
}
|
|
112
|
+
function formatStartReport(opts) {
|
|
113
|
+
return prepareBody(`[0][0][0] - looply started, ${opts.minHours}h min from ${opts.baseSha.slice(0, 7)}, reports every ${opts.everyMin}min`);
|
|
114
|
+
}
|
|
115
|
+
function formatEndReport(opts) {
|
|
116
|
+
const { committed, abandoned, discarded } = opts.counts;
|
|
117
|
+
return prepareBody(`[${committed}][${abandoned}][${discarded}] - looply DONE ${formatDurationHm(opts.elapsedMs)}, ` +
|
|
118
|
+
`${opts.rounds} rounds on ${opts.branch} (${opts.stopReason}), not pushed`);
|
|
119
|
+
}
|
|
120
|
+
/** Exit codes from a notifier channel. A dead gateway must never stop the loop. */
|
|
121
|
+
exports.NOTIFY_EXIT = { sent: 0, config: 1, rejected: 2, network: 3 };
|
|
122
|
+
function isFatalToLoop(_code) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=notify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify.js","sourceRoot":"","sources":["../src/notify.ts"],"names":[],"mappings":";;;AAgCA,8BAKC;AAED,4BAEC;AAGD,kCAEC;AAED,4CAKC;AAoDD,gDAUC;AAED,8CAIC;AAED,0CAYC;AAMD,sCAEC;AA7ID;;;;;;;GAOG;AAEH;;;;;;;GAOG;AACH,MAAM,IAAI,GAA6C;IACrD,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,UAAU;IACtB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,UAAU;IACtB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,oBAAoB;IAChC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,qBAAqB;IACjC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,oBAAoB;IAChC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,qBAAqB;IACjC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,WAAW;IACzB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,qBAAqB;IACjC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,SAAS;IACrB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,aAAa;CAC1B,CAAC;AAEF,SAAgB,SAAS,CAAC,KAAa;IACrC,IAAI,GAAG,GAAG,KAAK,CAAC;IAChB,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI;QAAE,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI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AQ,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,GAAG,KAAK,CAAC,CAAC,WAAW,CAAC;IAChH,OAAO,WAAW,CAAC,GAAG,IAAI,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;AAClD,CAAC;AAED,SAAgB,iBAAiB,CAAC,IAA6D;IAC7F,OAAO,WAAW,CAChB,+BAA+B,IAAI,CAAC,QAAQ,cAAc,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,mBAAmB,IAAI,CAAC,QAAQ,KAAK,CACxH,CAAC;AACJ,CAAC;AAED,SAAgB,eAAe,CAAC,IAM/B;IACC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;IACxD,OAAO,WAAW,CAChB,IAAI,SAAS,KAAK,SAAS,KAAK,SAAS,mBAAmB,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI;QAC9F,GAAG,IAAI,CAAC,MAAM,cAAc,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,UAAU,eAAe,CAC7E,CAAC;AACJ,CAAC;AAED,mFAAmF;AACtE,QAAA,WAAW,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAW,CAAC;AAGpF,SAAgB,aAAa,CAAC,KAAiB;IAC7C,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type Artifact, type ArtifactClass } from '@looply/core';
|
|
2
|
+
/**
|
|
3
|
+
* OBSERVATIONS, AS ARTIFACTS THE RETENTION POLICY CAN SEE.
|
|
4
|
+
*
|
|
5
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
6
|
+
* 🔴 THE ROOT EXISTED AND NOTHING WAS POINTED AT IT.
|
|
7
|
+
* `session-observation-store.ts` says so itself: *"its own root, one file per
|
|
8
|
+
* watch, and a root a retention policy can be pointed at — this product already
|
|
9
|
+
* decided how disposable artifacts are removed (D5), and an observation is
|
|
10
|
+
* exactly that kind of artifact."* `looply evidence` inventoried two folders and
|
|
11
|
+
* listed `observations/` under *uninventoried*. That is honest reporting of an
|
|
12
|
+
* unbounded store, and `OWNER_CHARTER.md` §5 D5 asks for more than honesty:
|
|
13
|
+
* *"Also cover the named compile/tool/rejected stores or report exact
|
|
14
|
+
* unclassified entries; do not claim complete retention from an inventory of
|
|
15
|
+
* only two folders."*
|
|
16
|
+
*
|
|
17
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
18
|
+
* ⚠️ THE UNIT IS ONE WATCH, NOT ONE SESSION. A session directory holds a file
|
|
19
|
+
* per watch, taken at different times and ending in different ways — a
|
|
20
|
+
* directory-level decision would either keep a year-old complete account
|
|
21
|
+
* because a recent watch sits beside it, or expire a record that is still
|
|
22
|
+
* running. So the artifact id is `<sessionId>/<file>`, which is also the path
|
|
23
|
+
* under the store, so `pathOf` resolves without a second convention.
|
|
24
|
+
*
|
|
25
|
+
* 🔴 AND NOTHING UNREADABLE BECOMES AN ARTIFACT. *"Missing/unreadable/unknown
|
|
26
|
+
* is never deletion permission."* A file that cannot be parsed, a link, a
|
|
27
|
+
* `coversFrom` that is not a time — each is NAMED here and left out of the
|
|
28
|
+
* plan, which is the only way a policy can be wrong about it in the safe
|
|
29
|
+
* direction.
|
|
30
|
+
*/
|
|
31
|
+
export declare const OBSERVATIONS_STORE = "observations";
|
|
32
|
+
export interface ObservationInventory {
|
|
33
|
+
/** What the policy may decide about. */
|
|
34
|
+
readonly artifacts: readonly Artifact[];
|
|
35
|
+
/** What it may not, with the reason. Reported, never planned over. */
|
|
36
|
+
readonly unreadable: readonly string[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Every watch on file, classified.
|
|
40
|
+
*
|
|
41
|
+
* ⚠️ `createdAtMs` IS `coversFrom`, NOT THE FILE'S MTIME. The record is written
|
|
42
|
+
* twice — once at attach and once at the close — so its mtime is the moment the
|
|
43
|
+
* watch ENDED, and a long watch would look hours younger than it is. What the
|
|
44
|
+
* age window is about is when the observation began.
|
|
45
|
+
*/
|
|
46
|
+
export declare function inventoryObservations(stateDir: string): ObservationInventory;
|
|
47
|
+
/**
|
|
48
|
+
* The re-check `--apply` makes immediately before removing one.
|
|
49
|
+
*
|
|
50
|
+
* 🔴 D5: *"check identity, ownership, current policy eligibility, pins,
|
|
51
|
+
* references and path boundaries AGAIN before removal."* The plan was made from
|
|
52
|
+
* a walk that may be minutes old; a watch that has since been re-opened, or a
|
|
53
|
+
* record replaced by something that is not one, must not be removed on the
|
|
54
|
+
* strength of what was true then.
|
|
55
|
+
*
|
|
56
|
+
* `null` means "this is not an observation this inventory owns" — an id that
|
|
57
|
+
* could leave the store, a session with no such file, a file that no longer
|
|
58
|
+
* parses. The caller must treat that as a refusal, never as permission.
|
|
59
|
+
*/
|
|
60
|
+
export declare function observationFacts(stateDir: string, id: string): {
|
|
61
|
+
owned: boolean;
|
|
62
|
+
pinned: boolean;
|
|
63
|
+
class: ArtifactClass;
|
|
64
|
+
} | null;
|
|
65
|
+
//# sourceMappingURL=observation-inventory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observation-inventory.d.ts","sourceRoot":"","sources":["../src/observation-inventory.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0B,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAGzF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAEjD,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,QAAQ,CAAC,SAAS,EAAE,SAAS,QAAQ,EAAE,CAAC;IACxC,sEAAsE;IACtE,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;AAcD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,CAkD5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,GACT;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,aAAa,CAAA;CAAE,GAAG,IAAI,CAYlE"}
|