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,96 @@
|
|
|
1
|
+
import { type AnsweredQuestionView, type PartialAnswer, type PartialQuestionBody } from '@looply/core';
|
|
2
|
+
/**
|
|
3
|
+
* ASKING A PERSON WHAT TO DO WITH WORK THE CHECKER COULD NOT JUDGE.
|
|
4
|
+
*
|
|
5
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
6
|
+
* 🔴 `proof.on_partial` IS `ask` BY DEFAULT AND NOTHING COULD ASK. `config.ts`
|
|
7
|
+
* has warned about it since M6-20 — *"a partial proof will be discarded"* — and
|
|
8
|
+
* said what it was waiting for: *"Making it really ask is a change to the round
|
|
9
|
+
* protocol and the owner's decision."* `OWNER_CHARTER.md` §6.C is that decision.
|
|
10
|
+
*
|
|
11
|
+
* ⚠️ AN UNPAIRED MACHINE BEHAVES EXACTLY AS IT DID. No project, no server, no
|
|
12
|
+
* question: the same two lines and the same `discard`. Everything below is what
|
|
13
|
+
* happens INSTEAD of that, and only when there is somebody to ask.
|
|
14
|
+
*
|
|
15
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
16
|
+
* 🔴 EVERY WAY OUT OF HERE IS `discard` EXCEPT A RECORDED `keep`.
|
|
17
|
+
*
|
|
18
|
+
* A round cannot be left open, so this function must return an answer however
|
|
19
|
+
* it fails — and the safe half is the one a run already takes. What it must
|
|
20
|
+
* never do is return `keep` on anything other than an answer that was written
|
|
21
|
+
* down, about this run and this item, and read back off the server.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* ⚠️ AFTER THE DEADLINE, TWO MINUTES FOR THE SERVER'S SWEEP — not for the
|
|
25
|
+
* person. `DEADLINE_SWEEP_INTERVAL_MS` is how often the server answers overdue
|
|
26
|
+
* questions with their own default, so the row is briefly still open once the
|
|
27
|
+
* deadline has passed. Acting before it closes would let the record say `keep`
|
|
28
|
+
* about work this round had already discarded.
|
|
29
|
+
*/
|
|
30
|
+
export declare const PARTIAL_ASK_GRACE_MS: number;
|
|
31
|
+
/** How often the answer is looked for. Cheap: one bounded read of one row. */
|
|
32
|
+
export declare const PARTIAL_ASK_POLL_MS = 15000;
|
|
33
|
+
/**
|
|
34
|
+
* Somebody to ask, or nothing at all.
|
|
35
|
+
*
|
|
36
|
+
* 🔴 ONE FIELD, NOT THREE THAT HAVE TO AGREE. The first version carried a
|
|
37
|
+
* nullable `projectId` beside an `ask` and a `read` that meant nothing without
|
|
38
|
+
* it — so the caller had to throw when handed the impossible combination, and
|
|
39
|
+
* `run-hold-release.spec.ts` caught that in the same hour: a bare `throw` in
|
|
40
|
+
* `run-cmd.ts` that no `releaseHold()` covers is how a run leaks its lease, its
|
|
41
|
+
* registry entry and its slot. The guard was right, and the answer was not to
|
|
42
|
+
* move the throw somewhere quieter. Unpaired is the ABSENCE of this object.
|
|
43
|
+
*/
|
|
44
|
+
export interface PartialQuestionServer {
|
|
45
|
+
readonly projectId: string;
|
|
46
|
+
/** `POST /v1/questions`. Returns the row, whose id is the only way back to it. */
|
|
47
|
+
readonly ask: (body: PartialQuestionBody & {
|
|
48
|
+
projectId: string;
|
|
49
|
+
}) => Promise<{
|
|
50
|
+
id: string;
|
|
51
|
+
}>;
|
|
52
|
+
/** `GET /v1/projects/:id/questions/:questionId`. Null when it could not be read. */
|
|
53
|
+
readonly read: (projectId: string, questionId: string) => Promise<AnsweredQuestionView | null>;
|
|
54
|
+
}
|
|
55
|
+
export interface PartialAskerDeps {
|
|
56
|
+
/** Null when this machine is not paired, or the project is not registered. */
|
|
57
|
+
readonly server: PartialQuestionServer | null;
|
|
58
|
+
readonly runId: string;
|
|
59
|
+
readonly now: () => number;
|
|
60
|
+
readonly sleep: (ms: number) => Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* 🔴 HOW LONG THE ROUND WAITS, AND THE DEADLINE IT WRITES ON THE QUESTION ARE
|
|
63
|
+
* THE SAME NUMBER. §6.C asks to *"keep independent work moving"*; a round is
|
|
64
|
+
* the loop's only thread, so waiting IS the cost and it has to be bounded.
|
|
65
|
+
*/
|
|
66
|
+
readonly windowMs: number;
|
|
67
|
+
/**
|
|
68
|
+
* ⚠️ AFTER THE DEADLINE, A LITTLE LONGER — for the SERVER'S sweep, not for
|
|
69
|
+
* the person. The sweep answers an overdue question with its own default, as
|
|
70
|
+
* `system`, and until it has, the row is still open. Acting before then would
|
|
71
|
+
* leave the record able to disagree with what the round did: a person who
|
|
72
|
+
* answers `keep` a second after our deadline would be recorded as having
|
|
73
|
+
* saved work this round had already thrown away.
|
|
74
|
+
*/
|
|
75
|
+
readonly graceMs: number;
|
|
76
|
+
readonly pollMs: number;
|
|
77
|
+
readonly log: (line: string) => void;
|
|
78
|
+
}
|
|
79
|
+
export interface PartialSubject {
|
|
80
|
+
readonly id: string;
|
|
81
|
+
readonly title: string;
|
|
82
|
+
}
|
|
83
|
+
export interface PartialProof {
|
|
84
|
+
readonly reason: string;
|
|
85
|
+
readonly confidence?: number;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The `resolvePartial` a run installs.
|
|
89
|
+
*
|
|
90
|
+
* Returns `keep` only for an answer that was recorded, is about this run and
|
|
91
|
+
* this item, and says `keep`. Everything else — an unpaired machine, a server
|
|
92
|
+
* that refused, a question nobody answered, an answer that does not belong to
|
|
93
|
+
* this round — is `discard`, with a line saying which.
|
|
94
|
+
*/
|
|
95
|
+
export declare function makePartialAsker(deps: PartialAskerDeps): (item: PartialSubject, proof: PartialProof) => Promise<PartialAnswer>;
|
|
96
|
+
//# sourceMappingURL=partial-asker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partial-asker.d.ts","sourceRoot":"","sources":["../src/partial-asker.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACzB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAAa,CAAC;AAE/C,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,kFAAkF;IAClF,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,mBAAmB,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,C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= exports.PARTIAL_ASK_GRACE_MS = void 0;
|
|
4
|
+
exports.makePartialAsker = makePartialAsker;
|
|
5
|
+
const core_1 = require("@looply/core");
|
|
6
|
+
/**
|
|
7
|
+
* ASKING A PERSON WHAT TO DO WITH WORK THE CHECKER COULD NOT JUDGE.
|
|
8
|
+
*
|
|
9
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
10
|
+
* 🔴 `proof.on_partial` IS `ask` BY DEFAULT AND NOTHING COULD ASK. `config.ts`
|
|
11
|
+
* has warned about it since M6-20 — *"a partial proof will be discarded"* — and
|
|
12
|
+
* said what it was waiting for: *"Making it really ask is a change to the round
|
|
13
|
+
* protocol and the owner's decision."* `OWNER_CHARTER.md` §6.C is that decision.
|
|
14
|
+
*
|
|
15
|
+
* ⚠️ AN UNPAIRED MACHINE BEHAVES EXACTLY AS IT DID. No project, no server, no
|
|
16
|
+
* question: the same two lines and the same `discard`. Everything below is what
|
|
17
|
+
* happens INSTEAD of that, and only when there is somebody to ask.
|
|
18
|
+
*
|
|
19
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
20
|
+
* 🔴 EVERY WAY OUT OF HERE IS `discard` EXCEPT A RECORDED `keep`.
|
|
21
|
+
*
|
|
22
|
+
* A round cannot be left open, so this function must return an answer however
|
|
23
|
+
* it fails — and the safe half is the one a run already takes. What it must
|
|
24
|
+
* never do is return `keep` on anything other than an answer that was written
|
|
25
|
+
* down, about this run and this item, and read back off the server.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* ⚠️ AFTER THE DEADLINE, TWO MINUTES FOR THE SERVER'S SWEEP — not for the
|
|
29
|
+
* person. `DEADLINE_SWEEP_INTERVAL_MS` is how often the server answers overdue
|
|
30
|
+
* questions with their own default, so the row is briefly still open once the
|
|
31
|
+
* deadline has passed. Acting before it closes would let the record say `keep`
|
|
32
|
+
* about work this round had already discarded.
|
|
33
|
+
*/
|
|
34
|
+
exports.PARTIAL_ASK_GRACE_MS = 2 * 60_000;
|
|
35
|
+
/** How often the answer is looked for. Cheap: one bounded read of one row. */
|
|
36
|
+
exports.PARTIAL_ASK_POLL_MS = 15_000;
|
|
37
|
+
/**
|
|
38
|
+
* The `resolvePartial` a run installs.
|
|
39
|
+
*
|
|
40
|
+
* Returns `keep` only for an answer that was recorded, is about this run and
|
|
41
|
+
* this item, and says `keep`. Everything else — an unpaired machine, a server
|
|
42
|
+
* that refused, a question nobody answered, an answer that does not belong to
|
|
43
|
+
* this round — is `discard`, with a line saying which.
|
|
44
|
+
*/
|
|
45
|
+
function makePartialAsker(deps) {
|
|
46
|
+
return async (item, proof) => {
|
|
47
|
+
deps.log(`round: proof was partial on "${item.title}" — ${proof.reason}`);
|
|
48
|
+
const server = deps.server;
|
|
49
|
+
if (server === null) {
|
|
50
|
+
// Word for word what a run has said since M6-20, because nothing about
|
|
51
|
+
// this case has changed.
|
|
52
|
+
deps.log('round: nobody to ask from a terminal run, so discarding. Pair a device to be asked.');
|
|
53
|
+
return 'discard';
|
|
54
|
+
}
|
|
55
|
+
const askedAtMs = deps.now();
|
|
56
|
+
const body = (0, core_1.partialQuestion)({
|
|
57
|
+
runId: deps.runId,
|
|
58
|
+
itemId: item.id,
|
|
59
|
+
itemTitle: item.title,
|
|
60
|
+
reason: proof.reason,
|
|
61
|
+
...(proof.confidence === undefined ? {} : { confidence: proof.confidence }),
|
|
62
|
+
askedAtMs,
|
|
63
|
+
windowMs: deps.windowMs,
|
|
64
|
+
});
|
|
65
|
+
let questionId;
|
|
66
|
+
try {
|
|
67
|
+
questionId = (await server.ask({ ...body, projectId: server.projectId })).id;
|
|
68
|
+
}
|
|
69
|
+
catch (e) {
|
|
70
|
+
/**
|
|
71
|
+
* 🔴 A SERVER THAT COULD NOT BE ASKED IS NOT A PERSON SAYING KEEP. The
|
|
72
|
+
* round takes the safe half and says why — a run that treated an
|
|
73
|
+
* unreachable server as permission would keep work nothing judged.
|
|
74
|
+
*/
|
|
75
|
+
deps.log(`round: could not ask — ${e.message}. Discarding, as an unasked question would.`);
|
|
76
|
+
return 'discard';
|
|
77
|
+
}
|
|
78
|
+
deps.log(`round: asked ${questionId} — keep or discard "${item.title}"? Answer on your phone before ${body.deadline}.`);
|
|
79
|
+
const ctx = { questionId, runId: deps.runId, itemId: item.id };
|
|
80
|
+
const until = askedAtMs + deps.windowMs + deps.graceMs;
|
|
81
|
+
for (;;) {
|
|
82
|
+
let view;
|
|
83
|
+
try {
|
|
84
|
+
view = await server.read(server.projectId, questionId);
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
// A read that failed establishes nothing. Try again while there is
|
|
88
|
+
// time; the loop's own bound is what stops this.
|
|
89
|
+
view = null;
|
|
90
|
+
}
|
|
91
|
+
if (view !== null) {
|
|
92
|
+
const r = (0, core_1.resolutionFrom)(view, ctx);
|
|
93
|
+
if (r.kind === 'answered') {
|
|
94
|
+
deps.log(`round: ${r.by ?? 'somebody'} answered ${r.answer}.`);
|
|
95
|
+
return r.answer;
|
|
96
|
+
}
|
|
97
|
+
if (r.kind === 'unusable') {
|
|
98
|
+
/**
|
|
99
|
+
* 🔴 LOUD, AND STILL `discard`. The fold's own words: an unusable
|
|
100
|
+
* answer is a defect to look at, not a silent default. A round has
|
|
101
|
+
* nothing else it can do, so the noise is the whole remedy — and the
|
|
102
|
+
* work is thrown away rather than kept on an answer nobody can
|
|
103
|
+
* attach to this round.
|
|
104
|
+
*/
|
|
105
|
+
deps.log(`round: the answer to ${questionId} cannot be used — ${r.because}. Discarding.`);
|
|
106
|
+
return 'discard';
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (deps.now() >= until) {
|
|
110
|
+
deps.log(`round: ${questionId} is still unanswered and its deadline has passed — discarding, which is its default.`);
|
|
111
|
+
return 'discard';
|
|
112
|
+
}
|
|
113
|
+
await deps.sleep(deps.pollMs);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=partial-asker.js.map
|
|
@@ -0,0 +1 @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BAC1B;;;;;;uBAMG;oBACH,IAAI,CAAC,GAAG,CAAC,wBAAwB,UAAU,qBAAqB,CAAC,CAAC,OAAO,eAAe,CAAC,CAAC;oBAC1F,OAAO,SAAS,CAAC;gBACnB,CAAC;YACH,CAAC;YAED,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,KAAK,EAAE,CAAC;gBACxB,IAAI,CAAC,GAAG,CACN,UAAU,UAAU,sFAAsF,CAC3G,CAAC;gBACF,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LINES FROM POSITIONED RUNS — the pure half of the PDF reader.
|
|
3
|
+
*
|
|
4
|
+
* A PDF carries text as positioned glyph runs, not as lines. Runs whose
|
|
5
|
+
* baseline rounds to the same value are one line, ordered left to right.
|
|
6
|
+
* Within a line, a run that starts clearly past the end of the previous one
|
|
7
|
+
* gets a space; one that abuts it does not (pdf.js splits words at font
|
|
8
|
+
* changes and kerning boundaries). Between lines, the smallest positive
|
|
9
|
+
* baseline gap on the page is taken as the leading, and a gap of k leadings
|
|
10
|
+
* yields k−1 blank lines — the same shape the author's layout had, so a
|
|
11
|
+
* paragraph break survives into the plain text core reads.
|
|
12
|
+
*
|
|
13
|
+
* Pure, so it is unit-tested without a PDF; the worker feeds it what pdf.js
|
|
14
|
+
* returns from `getTextContent()`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function linesFromRuns(items: unknown[]): string[];
|
|
17
|
+
//# sourceMappingURL=pdf-text-lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdf-text-lines.d.ts","sourceRoot":"","sources":["../src/pdf-text-lines.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAeH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,EAAE,CA2CxD"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* LINES FROM POSITIONED RUNS — the pure half of the PDF reader.
|
|
4
|
+
*
|
|
5
|
+
* A PDF carries text as positioned glyph runs, not as lines. Runs whose
|
|
6
|
+
* baseline rounds to the same value are one line, ordered left to right.
|
|
7
|
+
* Within a line, a run that starts clearly past the end of the previous one
|
|
8
|
+
* gets a space; one that abuts it does not (pdf.js splits words at font
|
|
9
|
+
* changes and kerning boundaries). Between lines, the smallest positive
|
|
10
|
+
* baseline gap on the page is taken as the leading, and a gap of k leadings
|
|
11
|
+
* yields k−1 blank lines — the same shape the author's layout had, so a
|
|
12
|
+
* paragraph break survives into the plain text core reads.
|
|
13
|
+
*
|
|
14
|
+
* Pure, so it is unit-tested without a PDF; the worker feeds it what pdf.js
|
|
15
|
+
* returns from `getTextContent()`.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.linesFromRuns = linesFromRuns;
|
|
19
|
+
const isRun = (x) => typeof x === 'object' &&
|
|
20
|
+
x !== null &&
|
|
21
|
+
typeof x.str === 'string' &&
|
|
22
|
+
Array.isArray(x.transform);
|
|
23
|
+
function linesFromRuns(items) {
|
|
24
|
+
const runs = items.filter(isRun).filter((r) => r.str.length > 0);
|
|
25
|
+
if (runs.length === 0)
|
|
26
|
+
return [];
|
|
27
|
+
const byLine = new Map();
|
|
28
|
+
for (const r of runs) {
|
|
29
|
+
const y = Math.round(r.transform[5] ?? 0);
|
|
30
|
+
const line = byLine.get(y);
|
|
31
|
+
if (line)
|
|
32
|
+
line.push(r);
|
|
33
|
+
else
|
|
34
|
+
byLine.set(y, [r]);
|
|
35
|
+
}
|
|
36
|
+
const ys = [...byLine.keys()].sort((a, b) => b - a); // top of the page first
|
|
37
|
+
const texts = ys.map((y) => {
|
|
38
|
+
const line = (byLine.get(y) ?? []).sort((a, b) => (a.transform[4] ?? 0) - (b.transform[4] ?? 0));
|
|
39
|
+
let out = '';
|
|
40
|
+
let end = Number.NEGATIVE_INFINITY;
|
|
41
|
+
for (const r of line) {
|
|
42
|
+
const x = r.transform[4] ?? 0;
|
|
43
|
+
const gap = x - end;
|
|
44
|
+
const threshold = Math.max(1, (r.height || 0) * 0.25);
|
|
45
|
+
if (out.length > 0 && gap > threshold && !out.endsWith(' ') && !r.str.startsWith(' '))
|
|
46
|
+
out += ' ';
|
|
47
|
+
out += r.str;
|
|
48
|
+
end = x + (r.width || 0);
|
|
49
|
+
}
|
|
50
|
+
return out.replace(/\s+$/, '');
|
|
51
|
+
});
|
|
52
|
+
let leading = Number.POSITIVE_INFINITY;
|
|
53
|
+
for (let i = 1; i < ys.length; i += 1) {
|
|
54
|
+
const gap = (ys[i - 1] ?? 0) - (ys[i] ?? 0);
|
|
55
|
+
if (gap > 0 && gap < leading)
|
|
56
|
+
leading = gap;
|
|
57
|
+
}
|
|
58
|
+
const out = [];
|
|
59
|
+
ys.forEach((y, i) => {
|
|
60
|
+
if (i > 0 && Number.isFinite(leading) && leading > 0) {
|
|
61
|
+
const gap = (ys[i - 1] ?? 0) - y;
|
|
62
|
+
const blanks = Math.max(0, Math.round(gap / leading) - 1);
|
|
63
|
+
for (let b = 0; b < Math.min(blanks, 50); b += 1)
|
|
64
|
+
out.push('');
|
|
65
|
+
}
|
|
66
|
+
out.push(texts[i] ?? '');
|
|
67
|
+
});
|
|
68
|
+
return out;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=pdf-text-lines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdf-text-lines.js","sourceRoot":"","sources":["../src/pdf-text-lines.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAeH,sCA2CC;AAjDD,MAAM,KAAK,GAAG,CAAC,CAAU,EAAgB,EAAE,CACzC,OAAO,CAAC,KAAK,QAA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AAC;QAC5C,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,OAAO;YAAE,OAAO,GAAG,GAAG,CAAC;IAC9C,CAAC;IACD,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAClB,IAAI,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;YACrD,MAAM,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;YACjC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;YAC1D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;gBAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdf-text-worker.d.ts","sourceRoot":"","sources":["../src/pdf-text-worker.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* THE PDF READER, IN ITS OWN PROCESS.
|
|
5
|
+
*
|
|
6
|
+
* node pdf-text-worker.js < bytes-on-stdin > json-on-stdout
|
|
7
|
+
*
|
|
8
|
+
* Why a child process and not a call: `pdfjs-dist` is ESM-only and this
|
|
9
|
+
* package compiles to CommonJS, so it can only be reached through a real
|
|
10
|
+
* dynamic import — which a plain Node process allows and the test runner's
|
|
11
|
+
* sandbox does not. Running it here keeps the adapter testable, keeps a
|
|
12
|
+
* misbehaving parser from taking the CLI down, and bounds it with a timeout
|
|
13
|
+
* the parent owns.
|
|
14
|
+
*
|
|
15
|
+
* The one `Function` constructor below exists solely to keep `import()` a
|
|
16
|
+
* real dynamic import in CommonJS output. It takes a literal specifier only.
|
|
17
|
+
*
|
|
18
|
+
* Output is one JSON document on stdout, one of:
|
|
19
|
+
* { ok: true, pages: [{ page, text }], diagnostics: { canvasLoaded } }
|
|
20
|
+
* { ok: false, because, diagnostics }
|
|
21
|
+
*/
|
|
22
|
+
const node_fs_1 = require("node:fs");
|
|
23
|
+
const pdf_text_lines_1 = require("./pdf-text-lines");
|
|
24
|
+
const LEGACY_BUILD = 'pdfjs-dist/legacy/build/pdf.mjs';
|
|
25
|
+
const importEsm = new Function('specifier', 'return import(specifier)');
|
|
26
|
+
const emit = (value) => {
|
|
27
|
+
process.stdout.write(JSON.stringify(value));
|
|
28
|
+
};
|
|
29
|
+
const canvasLoaded = () => Object.keys(require.cache).some((k) => k.includes('@napi-rs'));
|
|
30
|
+
async function main() {
|
|
31
|
+
const bytes = new Uint8Array((0, node_fs_1.readFileSync)(0));
|
|
32
|
+
let lib;
|
|
33
|
+
try {
|
|
34
|
+
lib = await importEsm(LEGACY_BUILD);
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
emit({ ok: false, because: `the PDF reader could not be loaded: ${e.message}`, diagnostics: { canvasLoaded: canvasLoaded() } });
|
|
38
|
+
return 0;
|
|
39
|
+
}
|
|
40
|
+
let doc;
|
|
41
|
+
try {
|
|
42
|
+
doc = await lib.getDocument({
|
|
43
|
+
data: bytes,
|
|
44
|
+
// Text is read, never rendered, and no font program is ever run.
|
|
45
|
+
isEvalSupported: false,
|
|
46
|
+
useSystemFonts: false,
|
|
47
|
+
disableFontFace: true,
|
|
48
|
+
verbosity: 0,
|
|
49
|
+
}).promise;
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
emit({ ok: false, because: `not a readable PDF: ${e.name ?? 'error'}`, diagnostics: { canvasLoaded: canvasLoaded() } });
|
|
53
|
+
return 0;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
const pages = [];
|
|
57
|
+
for (let n = 1; n <= doc.numPages; n += 1) {
|
|
58
|
+
const page = await doc.getPage(n);
|
|
59
|
+
const content = await page.getTextContent({ disableNormalization: true });
|
|
60
|
+
pages.push({ page: n, text: (0, pdf_text_lines_1.linesFromRuns)(content.items).join('\n') });
|
|
61
|
+
}
|
|
62
|
+
if (pages.every((p) => p.text.trim().length === 0)) {
|
|
63
|
+
emit({
|
|
64
|
+
ok: false,
|
|
65
|
+
because: 'no text layer on any page (a scanned document?) — there is nothing to extract, and nothing will be invented',
|
|
66
|
+
diagnostics: { canvasLoaded: canvasLoaded() },
|
|
67
|
+
});
|
|
68
|
+
return 0;
|
|
69
|
+
}
|
|
70
|
+
emit({ ok: true, pages, diagnostics: { canvasLoaded: canvasLoaded() } });
|
|
71
|
+
return 0;
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
await doc.destroy().catch(() => undefined);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
main().then((code) => process.exit(code), (e) => {
|
|
78
|
+
emit({ ok: false, because: `the PDF reader failed: ${e.message}`, diagnostics: { canvasLoaded: canvasLoaded() } });
|
|
79
|
+
process.exit(0);
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=pdf-text-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdf-text-worker.js","sourceRoot":"","sources":["../src/pdf-text-worker.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,qCAAuC;AACvC,qDAAiD;AAcjD,MAAM,YAA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AAE,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,IAAI,CACT,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAC5B,CAAC,CAAC,EAAE,EAAE;IACJ,IAAI,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,0BAA2B,CAAW,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC;IAC9H,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE TEXT LAYER OF A PDF, PAGE BY PAGE — and a refusal when there is none.
|
|
3
|
+
*
|
|
4
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
* WHAT THIS IS, AND IS NOT
|
|
6
|
+
*
|
|
7
|
+
* This reads a PDF's positioned text runs with `pdfjs-dist` (Mozilla's
|
|
8
|
+
* pdf.js, pinned) and rebuilds lines from their geometry (`pdf-text-lines.ts`),
|
|
9
|
+
* page by page, as plain text. That is the whole extraction. It does not OCR,
|
|
10
|
+
* it does not guess at a scanned page, and it does not interpret anything.
|
|
11
|
+
*
|
|
12
|
+
* 🔴 A PDF WITH NO TEXT LAYER IS REFUSED, NOT EMPTIED. A scanned document is
|
|
13
|
+
* bytes with nothing to read, and "extracted zero statements" would be a
|
|
14
|
+
* silent loss dressed as success — the one failure the intake path exists to
|
|
15
|
+
* prevent. A page with no text inside a document that has some elsewhere is
|
|
16
|
+
* reported as an empty page, and core keeps its place as `unsupported`.
|
|
17
|
+
*
|
|
18
|
+
* ⚠️ THE READER RUNS IN A CHILD PROCESS (`pdf-text-worker.ts`). The library is
|
|
19
|
+
* ESM-only and this package compiles to CommonJS, so it can only be reached
|
|
20
|
+
* through a real dynamic import — which a plain Node process allows and the
|
|
21
|
+
* test runner's sandbox does not. The child also bounds the parser: a crash or
|
|
22
|
+
* a hang there is a refusal here, never a dead CLI. Bytes go in on stdin, one
|
|
23
|
+
* JSON document comes back on stdout; nothing is written to disk.
|
|
24
|
+
*
|
|
25
|
+
* ⚠️ `@napi-rs/canvas` (an optional, prebuilt native module) IS loaded by the
|
|
26
|
+
* pdf.js Node build at import time whether or not anything is rendered. The
|
|
27
|
+
* worker reports it in `diagnostics`, and the adapter spec pins the fact so a
|
|
28
|
+
* later version that changes it is noticed rather than assumed.
|
|
29
|
+
*/
|
|
30
|
+
export interface PdfPage {
|
|
31
|
+
/** 1-based. */
|
|
32
|
+
page: number;
|
|
33
|
+
/** The page's lines, joined with `\n`; blank lines mark paragraph gaps. `''` when the page has no text. */
|
|
34
|
+
text: string;
|
|
35
|
+
}
|
|
36
|
+
export interface PdfDiagnostics {
|
|
37
|
+
canvasLoaded: boolean;
|
|
38
|
+
}
|
|
39
|
+
export type PdfTextResult = {
|
|
40
|
+
ok: true;
|
|
41
|
+
pages: PdfPage[];
|
|
42
|
+
diagnostics?: PdfDiagnostics;
|
|
43
|
+
} | {
|
|
44
|
+
ok: false;
|
|
45
|
+
because: string;
|
|
46
|
+
diagnostics?: PdfDiagnostics;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Where the compiled worker is. At runtime it sits beside this file in
|
|
50
|
+
* `dist/`; under the test runner this file is `src/` and the worker is the
|
|
51
|
+
* built one, which the jest global setup produces before any suite runs.
|
|
52
|
+
*/
|
|
53
|
+
export declare function workerPath(): string;
|
|
54
|
+
/** Every page's text layer, or why the document cannot be read as text. */
|
|
55
|
+
export declare function extractPdfPages(bytes: Uint8Array): Promise<PdfTextResult>;
|
|
56
|
+
//# sourceMappingURL=pdf-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdf-text.d.ts","sourceRoot":"","sources":["../src/pdf-text.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,MAAM,WAAW,OAAO;IACtB,eAAe;IACf,IAAI,EAAE,MAAM,CAAC;IACb,2GAA2G;IAC3G,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,OAAO,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE,cAAc,CAAA;CAAE,GAC5D;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,cAAc,CAAA;CAAE,CAAC;AAOjE;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAInC;AAID,2EAA2E;AAC3E,wBAAsB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAqC/E"}
|
package/dist/pdf-text.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.workerPath = workerPath;
|
|
4
|
+
exports.extractPdfPages = extractPdfPages;
|
|
5
|
+
const node_child_process_1 = require("node:child_process");
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
/** How long the child may take for one document. Generous: a plan, not a data set. */
|
|
9
|
+
const WORKER_TIMEOUT_MS = 60_000;
|
|
10
|
+
/** The largest JSON answer accepted from the child. */
|
|
11
|
+
const WORKER_MAX_BUFFER = 64 * 1024 * 1024;
|
|
12
|
+
/**
|
|
13
|
+
* Where the compiled worker is. At runtime it sits beside this file in
|
|
14
|
+
* `dist/`; under the test runner this file is `src/` and the worker is the
|
|
15
|
+
* built one, which the jest global setup produces before any suite runs.
|
|
16
|
+
*/
|
|
17
|
+
function workerPath() {
|
|
18
|
+
const beside = (0, node_path_1.join)(__dirname, 'pdf-text-worker.js');
|
|
19
|
+
if ((0, node_fs_1.existsSync)(beside))
|
|
20
|
+
return beside;
|
|
21
|
+
return (0, node_path_1.join)(__dirname, '..', 'dist', 'pdf-text-worker.js');
|
|
22
|
+
}
|
|
23
|
+
const PDF_HEADER = '%PDF-';
|
|
24
|
+
/** Every page's text layer, or why the document cannot be read as text. */
|
|
25
|
+
async function extractPdfPages(bytes) {
|
|
26
|
+
if (bytes.length < PDF_HEADER.length || Buffer.from(bytes.subarray(0, PDF_HEADER.length)).toString('latin1') !== PDF_HEADER) {
|
|
27
|
+
return { ok: false, because: 'not a PDF: the file does not start with a PDF header' };
|
|
28
|
+
}
|
|
29
|
+
const worker = workerPath();
|
|
30
|
+
if (!(0, node_fs_1.existsSync)(worker)) {
|
|
31
|
+
return { ok: false, because: `the PDF reader is not built (${worker} is missing); run npm run build` };
|
|
32
|
+
}
|
|
33
|
+
const child = (0, node_child_process_1.spawnSync)(process.execPath, [worker], {
|
|
34
|
+
input: bytes,
|
|
35
|
+
encoding: 'utf8',
|
|
36
|
+
timeout: WORKER_TIMEOUT_MS,
|
|
37
|
+
maxBuffer: WORKER_MAX_BUFFER,
|
|
38
|
+
windowsHide: true,
|
|
39
|
+
});
|
|
40
|
+
if (child.error) {
|
|
41
|
+
const timedOut = child.error.code === 'ETIMEDOUT';
|
|
42
|
+
return {
|
|
43
|
+
ok: false,
|
|
44
|
+
because: timedOut
|
|
45
|
+
? `the PDF reader did not finish within ${WORKER_TIMEOUT_MS / 1000} s`
|
|
46
|
+
: `the PDF reader could not be started: ${child.error.message}`,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (child.status !== 0) {
|
|
50
|
+
const head = (child.stderr ?? '').split('\n').find((l) => l.trim().length > 0) ?? `exit ${child.status}`;
|
|
51
|
+
return { ok: false, because: `the PDF reader failed: ${head.trim()}` };
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
const parsed = JSON.parse(child.stdout);
|
|
55
|
+
if (typeof parsed !== 'object' || parsed === null || typeof parsed.ok !== 'boolean') {
|
|
56
|
+
return { ok: false, because: 'the PDF reader answered in a shape this version does not understand' };
|
|
57
|
+
}
|
|
58
|
+
return parsed;
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return { ok: false, because: 'the PDF reader answered with something that is not JSON' };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=pdf-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdf-text.js","sourceRoot":"","sources":["../src/pdf-text.ts"],"names":[],"mappings":";;AA2DA,gCAIC;AAKD,0CAqCC;AAzGD,2DAA+C;AAC/C,qCAAqC;AACrC,yCAAiC;AA+CjC,sFAAsF;AACtF,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACjC,uDAAuD;AACvD,MAAM,iBAAiB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C;;;;GAIG;AACH,SAAgB,UAAU;IACxB,MAAM,MAAM,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;IACrD,IAAI,IAAA,oBAAU,EAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IACtC,OAAO,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,GAAG,OAAO,CAAC;AAE3B,2EAA2E;AACpE,KAAK,UAAU,eAAe,CAAC,KAAiB;IACrD,IAAI,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,UAAU,EAAE,CAAC;QAC5H,OAAO,EAAE,EAAE,EAAE,KAAK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