toolroll 0.9.93 → 0.9.95
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/CHANGELOG.md +79 -0
- package/dist/activity-line.d.ts +7 -4
- package/dist/activity-line.js +9 -7
- package/dist/agent-fence.d.ts +10 -0
- package/dist/agent-fence.js +6 -3
- package/dist/approval-authority.d.ts +7 -1
- package/dist/approval-authority.js +11 -2
- package/dist/approval-password.d.ts +31 -0
- package/dist/approval-password.js +26 -0
- package/dist/assignment-status.d.ts +1 -1
- package/dist/assignment-ui.js +3 -1
- package/dist/assignment.js +5 -0
- package/dist/attest.d.ts +3 -0
- package/dist/attest.js +10 -0
- package/dist/boot-identity.d.ts +2 -1
- package/dist/boot-identity.js +6 -4
- package/dist/bounded-spawn.d.ts +57 -0
- package/dist/bounded-spawn.js +220 -0
- package/dist/browser/terminal.js +42 -42
- package/dist/browser/workspace.css +1 -1
- package/dist/browser/workspace.js +32 -32
- package/dist/browser-crew.js +2 -0
- package/dist/browser-shell.d.ts +1 -1
- package/dist/browser-shell.js +2 -2
- package/dist/browser-workspace.d.ts +50 -2
- package/dist/browser-workspace.js +3 -3
- package/dist/build-review.js +2 -0
- package/dist/builder-restart.d.ts +21 -0
- package/dist/builder-restart.js +50 -0
- package/dist/builder.d.ts +11 -2
- package/dist/builder.js +234 -101
- package/dist/card-catalog.d.ts +209 -0
- package/dist/card-catalog.js +133 -0
- package/dist/card-cli.d.ts +43 -0
- package/dist/card-cli.js +44 -0
- package/dist/card-render.d.ts +26 -0
- package/dist/card-render.js +223 -0
- package/dist/card-sources.d.ts +68 -0
- package/dist/card-sources.js +234 -0
- package/dist/chat-acceptance.js +1 -1
- package/dist/chat-actions.d.ts +106 -9
- package/dist/chat-actions.js +473 -46
- package/dist/chat-approval.d.ts +13 -0
- package/dist/chat-approval.js +39 -9
- package/dist/chat-card-part.d.ts +11 -0
- package/dist/chat-card-part.js +18 -0
- package/dist/chat-card.d.ts +46 -0
- package/dist/chat-card.js +99 -0
- package/dist/chat-channel.d.ts +2 -0
- package/dist/chat-channel.js +37 -14
- package/dist/chat-controls.d.ts +4 -0
- package/dist/chat-controls.js +4 -0
- package/dist/chat-decide.d.ts +10 -16
- package/dist/chat-decide.js +79 -62
- package/dist/chat-delivery.js +13 -4
- package/dist/chat-flow.d.ts +0 -27
- package/dist/chat-flow.js +31 -2
- package/dist/chat-quiet.js +4 -4
- package/dist/chat-task-actions.d.ts +3 -2
- package/dist/chat-task-actions.js +19 -5
- package/dist/chat-terms.d.ts +14 -2
- package/dist/chat-terms.js +35 -0
- package/dist/chat-voice.d.ts +1 -1
- package/dist/chat-voice.js +2 -2
- package/dist/check-facts.d.ts +3 -1
- package/dist/check-facts.js +57 -11
- package/dist/check-failure.d.ts +24 -3
- package/dist/check-failure.js +89 -13
- package/dist/check-levels-ui.d.ts +4 -0
- package/dist/check-levels-ui.js +10 -1
- package/dist/check-load.d.ts +85 -0
- package/dist/check-load.js +147 -0
- package/dist/check-only-standing.d.ts +36 -0
- package/dist/check-only-standing.js +39 -0
- package/dist/check-only.d.ts +15 -0
- package/dist/check-only.js +99 -0
- package/dist/check-repair.d.ts +47 -0
- package/dist/check-repair.js +240 -0
- package/dist/check-report.d.ts +2 -0
- package/dist/check-report.js +1 -1
- package/dist/check-stamp.d.ts +46 -0
- package/dist/check-stamp.js +93 -0
- package/dist/checkout-cleanup.d.ts +36 -5
- package/dist/checkout-cleanup.js +166 -14
- package/dist/claim.d.ts +6 -0
- package/dist/claim.js +13 -2
- package/dist/cli-help.d.ts +4 -1
- package/dist/cli-help.js +49 -30
- package/dist/cli.js +15 -1
- package/dist/code-extract.d.ts +44 -0
- package/dist/code-extract.js +88 -0
- package/dist/code-map-acts.d.ts +24 -0
- package/dist/code-map-acts.js +53 -0
- package/dist/code-map-admission.d.ts +52 -0
- package/dist/code-map-admission.js +295 -0
- package/dist/code-map-build.d.ts +63 -0
- package/dist/code-map-build.js +415 -0
- package/dist/code-map-cli.d.ts +153 -0
- package/dist/code-map-cli.js +103 -0
- package/dist/code-map-main.d.ts +1 -0
- package/dist/code-map-main.js +48 -0
- package/dist/code-map-read.d.ts +106 -0
- package/dist/code-map-read.js +171 -0
- package/dist/code-map-report.d.ts +37 -0
- package/dist/code-map-report.js +95 -0
- package/dist/code-map-shape.d.ts +172 -0
- package/dist/code-map-shape.js +327 -0
- package/dist/code-map-store.d.ts +136 -0
- package/dist/code-map-store.js +233 -0
- package/dist/coding-provider.d.ts +3 -1
- package/dist/coding-provider.js +12 -7
- package/dist/coding-update.js +3 -2
- package/dist/coding-workspace.d.ts +1 -1
- package/dist/coding-workspace.js +8 -8
- package/dist/console-chrome.js +2 -2
- package/dist/containment.d.ts +5 -0
- package/dist/containment.js +14 -1
- package/dist/contracts/chat-actions.d.ts +92 -0
- package/dist/contracts/chat-actions.js +20 -0
- package/dist/contracts/chat-card.d.ts +91 -0
- package/dist/contracts/chat-card.js +54 -0
- package/dist/contracts/chat-content.d.ts +191 -0
- package/dist/contracts/chat-content.js +4 -0
- package/dist/contracts/cli.d.ts +52 -0
- package/dist/contracts/cli.js +4 -0
- package/dist/contracts/console-api.d.ts +12 -3
- package/dist/contracts/console-api.js +12 -3
- package/dist/contracts/flow-propose.d.ts +8 -1
- package/dist/contracts/flow-propose.js +3 -1
- package/dist/contracts/flow-send.d.ts +126 -0
- package/dist/contracts/flow-send.js +3 -0
- package/dist/contracts/gateway-tools.d.ts +17 -0
- package/dist/contracts/gateway-tools.js +3 -1
- package/dist/contracts/lead-tools.d.ts +234 -0
- package/dist/contracts/lead-tools.js +25 -1
- package/dist/contracts/project-knowledge.d.ts +38 -5
- package/dist/contracts/project-knowledge.js +11 -5
- package/dist/contracts/project-memory.d.ts +3 -1
- package/dist/contracts/project-memory.js +3 -2
- package/dist/contracts/storage.d.ts +14 -0
- package/dist/contracts/storage.js +3 -1
- package/dist/contracts/store-json.d.ts +18 -0
- package/dist/contracts/youiyoux-request.d.ts +1 -1
- package/dist/contracts/youiyoux-request.js +1 -1
- package/dist/desktop-access.js +6 -2
- package/dist/discord-chat.js +14 -0
- package/dist/dispatch.d.ts +1 -1
- package/dist/dispatch.js +25 -16
- package/dist/dispose.d.ts +19 -0
- package/dist/dispose.js +55 -9
- package/dist/easy-start.js +2 -3
- package/dist/eval-oracle.js +4 -1
- package/dist/evals.js +2 -1
- package/dist/evidence-pair.d.ts +53 -0
- package/dist/evidence-pair.js +128 -0
- package/dist/exhaustion.d.ts +17 -4
- package/dist/exhaustion.js +44 -4
- package/dist/export.js +1 -1
- package/dist/failing-first.d.ts +31 -0
- package/dist/failing-first.js +44 -0
- package/dist/fallback-schema.d.ts +8 -0
- package/dist/fallback-schema.js +40 -0
- package/dist/fallback.d.ts +138 -0
- package/dist/fallback.js +605 -0
- package/dist/fast-start.d.ts +136 -0
- package/dist/fast-start.js +431 -0
- package/dist/fast-terms.d.ts +9 -0
- package/dist/fast-terms.js +23 -0
- package/dist/fenced-check-coverage.d.ts +62 -0
- package/dist/fenced-check-coverage.js +54 -0
- package/dist/findings.d.ts +224 -0
- package/dist/findings.js +449 -0
- package/dist/first-run.js +1 -1
- package/dist/flaky-ci.d.ts +31 -0
- package/dist/flaky-ci.js +149 -0
- package/dist/flaky-cli.d.ts +60 -0
- package/dist/flaky-cli.js +60 -0
- package/dist/flaky.d.ts +75 -9
- package/dist/flaky.js +255 -0
- package/dist/fleet-schema.d.ts +17 -0
- package/dist/fleet-schema.js +135 -0
- package/dist/flow-browser.js +2 -2
- package/dist/flow-card-task.js +3 -0
- package/dist/flow-code.d.ts +2 -2
- package/dist/flow-code.js +9 -5
- package/dist/flow-result-card.d.ts +22 -0
- package/dist/flow-result-card.js +55 -0
- package/dist/flow-send.js +12 -9
- package/dist/flow-steps.js +1 -1
- package/dist/flow-triggers.d.ts +1 -1
- package/dist/flow-triggers.js +2 -2
- package/dist/flow-unattended.d.ts +26 -0
- package/dist/flow-unattended.js +12 -3
- package/dist/flows-ui.js +10 -2
- package/dist/follow-through-brief.d.ts +12 -0
- package/dist/follow-through-brief.js +31 -0
- package/dist/follow-through-cli.d.ts +23 -0
- package/dist/follow-through-cli.js +153 -0
- package/dist/git-incident.d.ts +16 -0
- package/dist/git-incident.js +69 -6
- package/dist/github-import.d.ts +62 -0
- package/dist/github-import.js +146 -0
- package/dist/guides.js +15 -10
- package/dist/handover-note.d.ts +33 -0
- package/dist/handover-note.js +106 -0
- package/dist/invoke.d.ts +25 -2
- package/dist/invoke.js +157 -58
- package/dist/job-object-helper.ps1 +10 -3
- package/dist/keymap.d.ts +41 -0
- package/dist/keymap.js +51 -0
- package/dist/knowledge-cli.js +1 -1
- package/dist/knowledge-ui.d.ts +21 -4
- package/dist/knowledge-ui.js +75 -7
- package/dist/laptop-background.d.ts +16 -0
- package/dist/laptop-background.js +108 -2
- package/dist/lead-cli.js +26 -24
- package/dist/lead-context.js +1 -1
- package/dist/lead-contract.d.ts +1 -1
- package/dist/lead-contract.js +3 -2
- package/dist/lead-doors.d.ts +4 -0
- package/dist/lead-doors.js +2 -2
- package/dist/lead-progress.js +5 -0
- package/dist/lead-status.d.ts +2 -0
- package/dist/lead-status.js +6 -2
- package/dist/lead-tools.js +162 -34
- package/dist/lead.js +2 -2
- package/dist/lesson-notes.d.ts +81 -0
- package/dist/lesson-notes.js +336 -0
- package/dist/limits-ui.js +1 -1
- package/dist/local-owner.d.ts +1 -1
- package/dist/local-owner.js +16 -0
- package/dist/machine-check.d.ts +16 -0
- package/dist/machine-check.js +26 -0
- package/dist/machine-identity.d.ts +75 -0
- package/dist/machine-identity.js +170 -0
- package/dist/mcp-core.js +11 -1
- package/dist/memory-cli.d.ts +300 -1
- package/dist/memory-cli.js +62 -9
- package/dist/memory-pass.d.ts +16 -0
- package/dist/memory-pass.js +67 -3
- package/dist/memory-tidy.d.ts +181 -0
- package/dist/memory-tidy.js +523 -0
- package/dist/memory-use.d.ts +35 -0
- package/dist/memory-use.js +109 -0
- package/dist/merge-checklist.d.ts +55 -0
- package/dist/merge-checklist.js +182 -0
- package/dist/modes.d.ts +6 -6
- package/dist/modes.js +3 -1
- package/dist/needs-you.d.ts +31 -9
- package/dist/needs-you.js +110 -41
- package/dist/nightly-github.d.ts +2 -0
- package/dist/nightly-github.js +4 -4
- package/dist/operate-remote-arguments.js +7 -1
- package/dist/operate-remote.js +3 -1
- package/dist/operate.d.ts +6 -1
- package/dist/operate.js +565 -64
- package/dist/phase-routing.js +2 -2
- package/dist/plain-schema.d.ts +23 -0
- package/dist/plain-schema.js +94 -0
- package/dist/plain-words.d.ts +20 -0
- package/dist/plain-words.js +66 -0
- package/dist/plan-login.d.ts +14 -0
- package/dist/plan-login.js +58 -0
- package/dist/planner.d.ts +1 -1
- package/dist/planner.js +4 -2
- package/dist/process-liveness.d.ts +2 -0
- package/dist/process-liveness.js +61 -17
- package/dist/project-delete-ui.d.ts +19 -2
- package/dist/project-delete-ui.js +29 -1
- package/dist/project-delete.js +14 -1
- package/dist/project-knowledge.d.ts +18 -11
- package/dist/project-knowledge.js +39 -9
- package/dist/project-learning.d.ts +2 -1
- package/dist/project-learning.js +15 -45
- package/dist/project-memory.d.ts +5 -0
- package/dist/project-memory.js +22 -2
- package/dist/project-tools.d.ts +4 -4
- package/dist/project-tools.js +23 -7
- package/dist/proof.js +30 -5
- package/dist/protected-storage-look.d.ts +1 -0
- package/dist/protected-storage-look.js +13 -0
- package/dist/protected-storage.d.ts +70 -39
- package/dist/protected-storage.js +196 -147
- package/dist/provider-auth.js +1 -1
- package/dist/provider-capture.d.ts +34 -0
- package/dist/provider-capture.js +53 -0
- package/dist/publish.js +9 -1
- package/dist/pull-request-flow.js +5 -0
- package/dist/push.d.ts +18 -2
- package/dist/push.js +40 -16
- package/dist/release-adapters.d.ts +9 -0
- package/dist/release-adapters.js +76 -0
- package/dist/release-auto.js +13 -13
- package/dist/release-card.d.ts +1 -2
- package/dist/release-card.js +11 -0
- package/dist/release-carry.d.ts +7 -2
- package/dist/release-carry.js +49 -10
- package/dist/release-cli.d.ts +4 -0
- package/dist/release-cli.js +29 -22
- package/dist/release-coverage.js +1 -1
- package/dist/release-next.d.ts +48 -0
- package/dist/release-next.js +161 -0
- package/dist/release.d.ts +20 -1
- package/dist/release.js +85 -9
- package/dist/remote-destination.d.ts +36 -0
- package/dist/remote-destination.js +217 -0
- package/dist/remote-main.d.ts +48 -0
- package/dist/remote-main.js +84 -5
- package/dist/repository-context.d.ts +3 -2
- package/dist/repository-context.js +112 -70
- package/dist/restart-certification.d.ts +1 -0
- package/dist/restart-certification.js +8 -6
- package/dist/result-acts.d.ts +27 -19
- package/dist/result-acts.js +36 -25
- package/dist/result-follow-ups.d.ts +2 -2
- package/dist/result-follow-ups.js +18 -4
- package/dist/result-review.d.ts +1 -1
- package/dist/route-change-check.d.ts +4 -0
- package/dist/route-change-check.js +13 -0
- package/dist/route-change.d.ts +22 -0
- package/dist/route-change.js +89 -0
- package/dist/route-hooks.js +3 -2
- package/dist/route-results.d.ts +6 -1
- package/dist/route-results.js +14 -5
- package/dist/run-closeout.d.ts +1 -1
- package/dist/run-closeout.js +7 -5
- package/dist/runner-process.js +3 -2
- package/dist/runner.js +2 -1
- package/dist/scope.d.ts +28 -4
- package/dist/scope.js +92 -28
- package/dist/scout.d.ts +1 -1
- package/dist/scout.js +2 -1
- package/dist/serve.d.ts +1 -1
- package/dist/serve.js +26 -18
- package/dist/server/chat.js +16 -14
- package/dist/server/chrome.d.ts +1 -1
- package/dist/server/chrome.js +26 -35
- package/dist/server/console.css +73 -0
- package/dist/server/guards.js +3 -0
- package/dist/server/home.d.ts +6 -0
- package/dist/server/home.js +21 -13
- package/dist/server/http.js +1 -1
- package/dist/server/kit.js +1 -1
- package/dist/server/merge-ready-view.d.ts +10 -0
- package/dist/server/merge-ready-view.js +30 -0
- package/dist/server/pages-assets.d.ts +1 -0
- package/dist/server/pages-assets.js +8 -5
- package/dist/server/pages.js +103 -82
- package/dist/server/render-chat.js +16 -3
- package/dist/server/render-code-map.d.ts +30 -0
- package/dist/server/render-code-map.js +137 -0
- package/dist/server/render-flaky.d.ts +20 -0
- package/dist/server/render-flaky.js +59 -0
- package/dist/server/render-follow-through.d.ts +11 -0
- package/dist/server/render-follow-through.js +68 -0
- package/dist/server/render-history.js +1 -1
- package/dist/server/render-new-task.d.ts +26 -1
- package/dist/server/render-new-task.js +30 -5
- package/dist/server/render-pages.d.ts +1 -175
- package/dist/server/render-pages.js +38 -313
- package/dist/server/render-projects.d.ts +2 -1
- package/dist/server/render-projects.js +9 -7
- package/dist/server/render-release.d.ts +2 -0
- package/dist/server/render-release.js +3 -3
- package/dist/server/render-results.d.ts +2 -0
- package/dist/server/render-results.js +68 -68
- package/dist/server/render-tasks.d.ts +16 -2
- package/dist/server/render-tasks.js +177 -141
- package/dist/server/retired-routes.d.ts +17 -0
- package/dist/server/retired-routes.js +53 -0
- package/dist/server/route-table.d.ts +3 -0
- package/dist/server/route-table.js +48 -12
- package/dist/server/settings.js +166 -34
- package/dist/server/task-views.js +66 -26
- package/dist/server/tasks.d.ts +2 -6
- package/dist/server/tasks.js +250 -321
- package/dist/server/welcome.js +1 -1
- package/dist/settings-groups-ui.d.ts +1 -0
- package/dist/settings-groups-ui.js +4 -2
- package/dist/settings-kit.js +3 -2
- package/dist/settings-proofs.js +3 -1
- package/dist/slack-chat.js +14 -1
- package/dist/steer-mailbox.d.ts +8 -1
- package/dist/steer-mailbox.js +164 -6
- package/dist/stop-proof.js +6 -4
- package/dist/storage-sweep-process.js +1 -1
- package/dist/storage-sweep.d.ts +5 -3
- package/dist/storage-sweep.js +30 -9
- package/dist/storage-ui.js +28 -17
- package/dist/storage.d.ts +27 -2
- package/dist/storage.js +39 -2
- package/dist/store.d.ts +89 -7
- package/dist/store.js +386 -114
- package/dist/surface.js +67 -6
- package/dist/sweep-quarantine.d.ts +1 -0
- package/dist/sweep-quarantine.js +6 -4
- package/dist/tamper-scan.d.ts +4 -0
- package/dist/tamper-scan.js +90 -0
- package/dist/task-aliases.d.ts +5 -0
- package/dist/task-aliases.js +9 -0
- package/dist/task-control.d.ts +2 -1
- package/dist/task-control.js +4 -1
- package/dist/task-outcome-cli.d.ts +2 -0
- package/dist/task-outcome-cli.js +17 -17
- package/dist/task-sizing.d.ts +5 -0
- package/dist/task-sizing.js +2 -0
- package/dist/task-source.d.ts +7 -0
- package/dist/task-source.js +14 -0
- package/dist/task-status.d.ts +9 -0
- package/dist/task-status.js +45 -49
- package/dist/teardown-git.d.ts +18 -0
- package/dist/teardown-git.js +105 -21
- package/dist/telegram-lead.js +23 -6
- package/dist/telegram-progress.js +5 -3
- package/dist/telegram-status.js +6 -4
- package/dist/telegram.js +12 -1
- package/dist/test-infra.d.ts +8 -0
- package/dist/test-infra.js +18 -0
- package/dist/tidy.js +1 -1
- package/dist/toolroll-update.js +19 -5
- package/dist/tui-contract.d.ts +24 -0
- package/dist/tui-source.js +67 -8
- package/dist/tui.js +51 -51
- package/dist/vanished-retry.d.ts +30 -0
- package/dist/vanished-retry.js +174 -0
- package/dist/work-index.d.ts +2 -0
- package/dist/work-index.js +95 -66
- package/dist/work-summary.d.ts +1 -1
- package/dist/work-summary.js +7 -2
- package/dist/workspace-ui.d.ts +7 -3
- package/dist/workspace-ui.js +38 -23
- package/dist/worktree.d.ts +12 -3
- package/dist/worktree.js +91 -14
- package/package.json +2 -1
- package/dist/server/render-next.d.ts +0 -63
- package/dist/server/render-next.js +0 -109
package/dist/phase-routing.js
CHANGED
|
@@ -745,7 +745,7 @@ export function projectRoute(route, readiness) {
|
|
|
745
745
|
...leg,
|
|
746
746
|
reasons: leg.reasons.map(reason => reason.replace("builder and reviewer", "builder")),
|
|
747
747
|
readiness: state,
|
|
748
|
-
readinessReason: seen === null ? "no
|
|
748
|
+
readinessReason: seen === null ? "no builder has reported this provider yet" : seen.reason,
|
|
749
749
|
readinessRunner: seen === null ? null : seen.runner,
|
|
750
750
|
observedAt: seen === null ? null : seen.observedAt,
|
|
751
751
|
words: "",
|
|
@@ -775,7 +775,7 @@ export function projectRoute(route, readiness) {
|
|
|
775
775
|
export function routeWords(projection, indent = " ") {
|
|
776
776
|
const pad = `${indent} `;
|
|
777
777
|
return [
|
|
778
|
-
`${indent}route ${projection.riskTitle.toLowerCase()} · ${projection.postureWords}
|
|
778
|
+
`${indent}route ${projection.riskTitle.toLowerCase()} · ${projection.postureWords}`,
|
|
779
779
|
...(projection.sizeWords === null ? [] : [`${indent}size ${projection.sizeWords} — ${projection.sizeReason}`]),
|
|
780
780
|
`${pad}${projection.summary}`,
|
|
781
781
|
...projection.legs.flatMap(leg => [`${pad}${leg.words}`, ...leg.reasons.map(reason => `${pad} ${reason}`)]),
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** v153 (docs/plans/plain-toolroll.md Phase 2): the tables the authority slices own, new tables only. Kept apart so
|
|
2
|
+
* store.ts loads them without loading the roads that use them. */
|
|
3
|
+
/** A vanished build's one charge per run, and the episode its automatic retries stay inside (vanished-retry.ts). */
|
|
4
|
+
export declare const VANISHED_SCHEMA = "\nCREATE TABLE IF NOT EXISTS vanished_charge (\n run INTEGER PRIMARY KEY REFERENCES run(id),\n task_ref INTEGER NOT NULL REFERENCES task_ref(id),\n charged_at TEXT NOT NULL,\n settled_at TEXT\n);\nCREATE INDEX IF NOT EXISTS vanished_charge_open ON vanished_charge (task_ref) WHERE settled_at IS NULL;\nCREATE TABLE IF NOT EXISTS retry_episode (\n task_ref INTEGER PRIMARY KEY REFERENCES task_ref(id),\n retries INTEGER NOT NULL DEFAULT 0 CHECK (retries >= 0),\n reserved_microusd INTEGER NOT NULL DEFAULT 0 CHECK (reserved_microusd >= 0),\n stopped TEXT CHECK (stopped IS NULL OR stopped IN ('no-budget', 'attempts', 'spend')),\n stopped_run INTEGER,\n started_at TEXT NOT NULL,\n updated_at TEXT NOT NULL\n);\n";
|
|
5
|
+
/** A check-only authorization (check-only.ts): one automatic run of the approved check on one exact commit. The unique
|
|
6
|
+
* key is the cap: one per (commit, command digest), however many workers race. Written only from the approval that
|
|
7
|
+
* built that commit; it seals nothing and starts no agent. */
|
|
8
|
+
export declare const CHECK_ONLY_SCHEMA = "\nCREATE TABLE IF NOT EXISTS check_authorization (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n task_ref INTEGER NOT NULL REFERENCES task_ref(id),\n run INTEGER NOT NULL REFERENCES run(id),\n candidate TEXT NOT NULL CHECK (length(candidate) = 40),\n command_digest TEXT NOT NULL,\n level TEXT NOT NULL CHECK (level IN ('quick', 'full')),\n check_access TEXT NOT NULL,\n scope_digest TEXT NOT NULL,\n written_at TEXT NOT NULL,\n expires_at TEXT NOT NULL,\n used_at TEXT,\n used_request INTEGER,\n closed_at TEXT,\n UNIQUE (task_ref, candidate, command_digest)\n);\nCREATE INDEX IF NOT EXISTS check_authorization_open ON check_authorization (expires_at) WHERE used_at IS NULL AND closed_at IS NULL;\n";
|
|
9
|
+
/** Whether this computer's own builder is meant to be running, and with what (builder-restart.ts): set by `background
|
|
10
|
+
* on` and `up`, cleared by `background off` and `stop`. `builder_restart` is every automatic restart Toolroll tried. */
|
|
11
|
+
export declare const BUILDER_SERVICE_SCHEMA = "\nCREATE TABLE IF NOT EXISTS builder_service (\n id INTEGER PRIMARY KEY CHECK (id = 1),\n desired TEXT NOT NULL CHECK (desired IN ('running', 'stopped')),\n build TEXT NOT NULL,\n schema_version INTEGER NOT NULL,\n set_by TEXT NOT NULL,\n set_at TEXT NOT NULL\n);\nCREATE TABLE IF NOT EXISTS builder_restart (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n at TEXT NOT NULL\n);\n";
|
|
12
|
+
/** A fast start's form as it was rendered (fast-start.ts): what the person typed and what the classifier said, kept here
|
|
13
|
+
* so Build files exactly that, whatever a form posts. Used once. */
|
|
14
|
+
export declare const FAST_PREVIEW_SCHEMA = "\nCREATE TABLE IF NOT EXISTS fast_preview (\n id TEXT PRIMARY KEY,\n actor TEXT NOT NULL,\n via TEXT NOT NULL,\n task_id TEXT NOT NULL,\n repo TEXT NOT NULL,\n title TEXT NOT NULL,\n permission TEXT,\n sizing_json TEXT NOT NULL,\n digest TEXT NOT NULL,\n created_at TEXT NOT NULL,\n expires_at TEXT NOT NULL,\n consumed_at TEXT\n);\n";
|
|
15
|
+
/** The one new route Toolroll proposed for a task whose sealed one no longer matches (route-change.ts): the line a person
|
|
16
|
+
* reads, bound to the exact route digest it describes. */
|
|
17
|
+
export declare const ROUTE_CHANGE_SCHEMA = "\nCREATE TABLE IF NOT EXISTS route_change (\n task_ref INTEGER PRIMARY KEY REFERENCES task_ref(id),\n scope_digest TEXT NOT NULL,\n to_route_digest TEXT NOT NULL,\n words TEXT NOT NULL,\n created_at TEXT NOT NULL\n);\n";
|
|
18
|
+
/** v153's columns: a fast start's marker and start window on the task (both NULL on saved rows) and the project setting
|
|
19
|
+
* Small tasks start right away (NULL: the default). */
|
|
20
|
+
export declare const V153_ADDED_COLUMNS: Readonly<Record<string, Readonly<Record<string, {
|
|
21
|
+
definition: string;
|
|
22
|
+
saved: string;
|
|
23
|
+
}>>>>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/** v153 (docs/plans/plain-toolroll.md Phase 2): the tables the authority slices own, new tables only. Kept apart so
|
|
2
|
+
* store.ts loads them without loading the roads that use them. */
|
|
3
|
+
/** A vanished build's one charge per run, and the episode its automatic retries stay inside (vanished-retry.ts). */
|
|
4
|
+
export const VANISHED_SCHEMA = `
|
|
5
|
+
CREATE TABLE IF NOT EXISTS vanished_charge (
|
|
6
|
+
run INTEGER PRIMARY KEY REFERENCES run(id),
|
|
7
|
+
task_ref INTEGER NOT NULL REFERENCES task_ref(id),
|
|
8
|
+
charged_at TEXT NOT NULL,
|
|
9
|
+
settled_at TEXT
|
|
10
|
+
);
|
|
11
|
+
CREATE INDEX IF NOT EXISTS vanished_charge_open ON vanished_charge (task_ref) WHERE settled_at IS NULL;
|
|
12
|
+
CREATE TABLE IF NOT EXISTS retry_episode (
|
|
13
|
+
task_ref INTEGER PRIMARY KEY REFERENCES task_ref(id),
|
|
14
|
+
retries INTEGER NOT NULL DEFAULT 0 CHECK (retries >= 0),
|
|
15
|
+
reserved_microusd INTEGER NOT NULL DEFAULT 0 CHECK (reserved_microusd >= 0),
|
|
16
|
+
stopped TEXT CHECK (stopped IS NULL OR stopped IN ('no-budget', 'attempts', 'spend')),
|
|
17
|
+
stopped_run INTEGER,
|
|
18
|
+
started_at TEXT NOT NULL,
|
|
19
|
+
updated_at TEXT NOT NULL
|
|
20
|
+
);
|
|
21
|
+
`;
|
|
22
|
+
/** A check-only authorization (check-only.ts): one automatic run of the approved check on one exact commit. The unique
|
|
23
|
+
* key is the cap: one per (commit, command digest), however many workers race. Written only from the approval that
|
|
24
|
+
* built that commit; it seals nothing and starts no agent. */
|
|
25
|
+
export const CHECK_ONLY_SCHEMA = `
|
|
26
|
+
CREATE TABLE IF NOT EXISTS check_authorization (
|
|
27
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
28
|
+
task_ref INTEGER NOT NULL REFERENCES task_ref(id),
|
|
29
|
+
run INTEGER NOT NULL REFERENCES run(id),
|
|
30
|
+
candidate TEXT NOT NULL CHECK (length(candidate) = 40),
|
|
31
|
+
command_digest TEXT NOT NULL,
|
|
32
|
+
level TEXT NOT NULL CHECK (level IN ('quick', 'full')),
|
|
33
|
+
check_access TEXT NOT NULL,
|
|
34
|
+
scope_digest TEXT NOT NULL,
|
|
35
|
+
written_at TEXT NOT NULL,
|
|
36
|
+
expires_at TEXT NOT NULL,
|
|
37
|
+
used_at TEXT,
|
|
38
|
+
used_request INTEGER,
|
|
39
|
+
closed_at TEXT,
|
|
40
|
+
UNIQUE (task_ref, candidate, command_digest)
|
|
41
|
+
);
|
|
42
|
+
CREATE INDEX IF NOT EXISTS check_authorization_open ON check_authorization (expires_at) WHERE used_at IS NULL AND closed_at IS NULL;
|
|
43
|
+
`;
|
|
44
|
+
/** Whether this computer's own builder is meant to be running, and with what (builder-restart.ts): set by `background
|
|
45
|
+
* on` and `up`, cleared by `background off` and `stop`. `builder_restart` is every automatic restart Toolroll tried. */
|
|
46
|
+
export const BUILDER_SERVICE_SCHEMA = `
|
|
47
|
+
CREATE TABLE IF NOT EXISTS builder_service (
|
|
48
|
+
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
49
|
+
desired TEXT NOT NULL CHECK (desired IN ('running', 'stopped')),
|
|
50
|
+
build TEXT NOT NULL,
|
|
51
|
+
schema_version INTEGER NOT NULL,
|
|
52
|
+
set_by TEXT NOT NULL,
|
|
53
|
+
set_at TEXT NOT NULL
|
|
54
|
+
);
|
|
55
|
+
CREATE TABLE IF NOT EXISTS builder_restart (
|
|
56
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
57
|
+
at TEXT NOT NULL
|
|
58
|
+
);
|
|
59
|
+
`;
|
|
60
|
+
/** A fast start's form as it was rendered (fast-start.ts): what the person typed and what the classifier said, kept here
|
|
61
|
+
* so Build files exactly that, whatever a form posts. Used once. */
|
|
62
|
+
export const FAST_PREVIEW_SCHEMA = `
|
|
63
|
+
CREATE TABLE IF NOT EXISTS fast_preview (
|
|
64
|
+
id TEXT PRIMARY KEY,
|
|
65
|
+
actor TEXT NOT NULL,
|
|
66
|
+
via TEXT NOT NULL,
|
|
67
|
+
task_id TEXT NOT NULL,
|
|
68
|
+
repo TEXT NOT NULL,
|
|
69
|
+
title TEXT NOT NULL,
|
|
70
|
+
permission TEXT,
|
|
71
|
+
sizing_json TEXT NOT NULL,
|
|
72
|
+
digest TEXT NOT NULL,
|
|
73
|
+
created_at TEXT NOT NULL,
|
|
74
|
+
expires_at TEXT NOT NULL,
|
|
75
|
+
consumed_at TEXT
|
|
76
|
+
);
|
|
77
|
+
`;
|
|
78
|
+
/** The one new route Toolroll proposed for a task whose sealed one no longer matches (route-change.ts): the line a person
|
|
79
|
+
* reads, bound to the exact route digest it describes. */
|
|
80
|
+
export const ROUTE_CHANGE_SCHEMA = `
|
|
81
|
+
CREATE TABLE IF NOT EXISTS route_change (
|
|
82
|
+
task_ref INTEGER PRIMARY KEY REFERENCES task_ref(id),
|
|
83
|
+
scope_digest TEXT NOT NULL,
|
|
84
|
+
to_route_digest TEXT NOT NULL,
|
|
85
|
+
words TEXT NOT NULL,
|
|
86
|
+
created_at TEXT NOT NULL
|
|
87
|
+
);
|
|
88
|
+
`;
|
|
89
|
+
/** v153's columns: a fast start's marker and start window on the task (both NULL on saved rows) and the project setting
|
|
90
|
+
* Small tasks start right away (NULL: the default). */
|
|
91
|
+
export const V153_ADDED_COLUMNS = Object.freeze({
|
|
92
|
+
task_ref: { fast_start_at: { definition: "TEXT", saved: "NULL" }, fast_start_until: { definition: "TEXT", saved: "NULL" } },
|
|
93
|
+
project: { fast_start: { definition: "INTEGER CHECK (fast_start IS NULL OR fast_start IN (0, 1))", saved: "NULL" } },
|
|
94
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** One vocabulary for the words Toolroll writes (docs/plans/plain-toolroll.md, "The words"): each row is a word or
|
|
2
|
+
* phrase product copy never says, and what it says instead. Matching is by whole word and ignores case.
|
|
3
|
+
*
|
|
4
|
+
* Product copy is the text Toolroll writes. Preserved content (goals, requirements, notes, agent reports, issue text,
|
|
5
|
+
* commit messages and the exact terms a consent shows) is never rewritten to satisfy this table. Code, the database,
|
|
6
|
+
* `--json`, the agent contract and the audit page's hash detail keep their own words. */
|
|
7
|
+
export type PlainWord = {
|
|
8
|
+
never: string;
|
|
9
|
+
pattern: RegExp;
|
|
10
|
+
say: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const PLAIN_WORDS: readonly PlainWord[];
|
|
13
|
+
/** The words, for messages and tests. */
|
|
14
|
+
export declare const BANNED_WORDS: readonly string[];
|
|
15
|
+
/** Every banned word in `text`, as the table names it. */
|
|
16
|
+
export declare function bannedWordsIn(text: string): string[];
|
|
17
|
+
/** Whether `text` says any word product copy never says. */
|
|
18
|
+
export declare const hasInternalWords: (text: string) => boolean;
|
|
19
|
+
/** A plan's version as Details shows it: a short handle, never the whole digest. */
|
|
20
|
+
export declare const planVersionWords: (digest: string) => string;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** One vocabulary for the words Toolroll writes (docs/plans/plain-toolroll.md, "The words"): each row is a word or
|
|
2
|
+
* phrase product copy never says, and what it says instead. Matching is by whole word and ignores case.
|
|
3
|
+
*
|
|
4
|
+
* Product copy is the text Toolroll writes. Preserved content (goals, requirements, notes, agent reports, issue text,
|
|
5
|
+
* commit messages and the exact terms a consent shows) is never rewritten to satisfy this table. Code, the database,
|
|
6
|
+
* `--json`, the agent contract and the audit page's hash detail keep their own words. */
|
|
7
|
+
const row = (never, pattern, say) => ({ never, pattern: new RegExp(`(?<![\\w-])(?:${pattern})(?![\\w-])`, "i"), say });
|
|
8
|
+
export const PLAIN_WORDS = [
|
|
9
|
+
row("scope", "scopes?|scoped", "plan"),
|
|
10
|
+
row("contract", "contracts?", "plan"),
|
|
11
|
+
// "Sign in", "signed in" and "signed out" are a person signing in, not an approval.
|
|
12
|
+
row("signs", "signs|signed(?!\\s+(?:in|out|into)\\b)", "Approved by …"),
|
|
13
|
+
row("sealed", "seal|seals|sealed|sealing", "approved"),
|
|
14
|
+
row("binds", "binds?", "approved"),
|
|
15
|
+
row("digest", "digests?", "(the plan version, in Details)"),
|
|
16
|
+
row("worker", "workers?", "builder"),
|
|
17
|
+
row("runner", "runners?", "builder"),
|
|
18
|
+
row("daemon", "daemons?", "builder"),
|
|
19
|
+
row("background service", "background service", "builder"),
|
|
20
|
+
row("operator", "operators?|instance operator", "approver, or owner"),
|
|
21
|
+
row("coordinator", "coordinators?", "your lead"),
|
|
22
|
+
row("mate", "mate", "your lead"),
|
|
23
|
+
row("scout", "scouts?|scouting|scouted", "research"),
|
|
24
|
+
row("criterion", "criterion|criteria", "requirement"),
|
|
25
|
+
row("evidence", "evidence", "requirement, or the saved files"),
|
|
26
|
+
row("proof", "proofs?", "requirement"),
|
|
27
|
+
row("verdict", "verdicts?", "requirement"),
|
|
28
|
+
row("caveat", "caveats?", "requirement"),
|
|
29
|
+
row("mark complete", "mark(?:ed|s|ing)?\\s+(?:it\\s+|this\\s+|that\\s+|them\\s+|the\\s+result\\s+)?complete", "Accept"),
|
|
30
|
+
row("Accept and finish", "accept\\s+and\\s+finish", "Accept"),
|
|
31
|
+
row("Revise", "revise", "Send back, or Request changes"),
|
|
32
|
+
row("re-file", "re-?file[ds]?|re-?filing", "Send back, or Request changes"),
|
|
33
|
+
row("Draft a repair task", "draft\\s+a\\s+repair\\s+task", "Send back"),
|
|
34
|
+
row("put away", "put(?:s|ting)?\\s+(?:it\\s+|them\\s+|tasks\\s+|old\\s+tasks\\s+)?away", "Archive"),
|
|
35
|
+
row("tidy", "tidy|tidied|tidying", "Archive"),
|
|
36
|
+
row("run #N", "(?:run|attempt|result)\\s+#?\\d+", "build #N"),
|
|
37
|
+
row("reconcile", "reconcile[ds]?|reconciling|reconciliation", "Waiting: Toolroll is …"),
|
|
38
|
+
row("requeue", "requeue[ds]?|requeuing", "Waiting: Toolroll is …"),
|
|
39
|
+
row("claim", "claim|claimed", "Waiting: Toolroll is …"),
|
|
40
|
+
row("lease", "leases?|leased", "Waiting: Toolroll is …"),
|
|
41
|
+
row("custody", "custody", "Waiting: Toolroll is …"),
|
|
42
|
+
row("incident", "incidents?", "Waiting: Toolroll is …"),
|
|
43
|
+
row("plane", "plane", "Toolroll"),
|
|
44
|
+
row("fence", "fences?|fenced", "Waiting: Toolroll is …"),
|
|
45
|
+
row("attested", "attest|attested|attestation", "Waiting: Toolroll is …"),
|
|
46
|
+
row("receipt", "receipts?", "Waiting: Toolroll is …"),
|
|
47
|
+
row("regate", "regate[ds]?", "Run checks"),
|
|
48
|
+
row("carried", "carried|carry|carries", "Waiting: Toolroll is …"),
|
|
49
|
+
row("incarnation", "incarnations?", "Waiting: Toolroll is …"),
|
|
50
|
+
row("admission", "admission", "Waiting: Toolroll is …"),
|
|
51
|
+
row("quiescence", "quiescen(?:ce|t)", "Waiting: Toolroll is …"),
|
|
52
|
+
row("witness", "witness(?:es|ed)?", "Waiting: Toolroll is …"),
|
|
53
|
+
row("unproven", "unproven", "Waiting: Toolroll is …"),
|
|
54
|
+
// A plan version or digest written out: twelve or more hex characters. A short commit (seven) is fine.
|
|
55
|
+
row("version hex", "(?=[0-9a-f]*\\d)(?=[0-9a-f]*[a-f])[0-9a-f]{12,64}", "(the plan version, in Details)"),
|
|
56
|
+
];
|
|
57
|
+
/** The words, for messages and tests. */
|
|
58
|
+
export const BANNED_WORDS = PLAIN_WORDS.map(one => one.never);
|
|
59
|
+
/** Every banned word in `text`, as the table names it. */
|
|
60
|
+
export function bannedWordsIn(text) {
|
|
61
|
+
return PLAIN_WORDS.filter(one => one.pattern.test(text)).map(one => one.never);
|
|
62
|
+
}
|
|
63
|
+
/** Whether `text` says any word product copy never says. */
|
|
64
|
+
export const hasInternalWords = (text) => PLAIN_WORDS.some(one => one.pattern.test(text));
|
|
65
|
+
/** A plan's version as Details shows it: a short handle, never the whole digest. */
|
|
66
|
+
export const planVersionWords = (digest) => `Plan version ${digest.slice(0, 8)}`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Billing } from "./spend.js";
|
|
2
|
+
/** How Codex says it's signed in (`codex login status`): a ChatGPT sign-in is its plan; a key or Bedrock is a key;
|
|
3
|
+
* null when it says neither (not signed in, or it didn't answer). */
|
|
4
|
+
export declare function codexLoginBilling(binary: string, omitEnv: readonly string[], env?: Record<string, string | undefined>): Promise<Billing | null>;
|
|
5
|
+
/** Providers whose CLI can say, live and machine-readably, that the credential a run will use is a plan. */
|
|
6
|
+
export declare const PLAN_LOGIN_PROVABLE: ReadonlySet<string>;
|
|
7
|
+
/**
|
|
8
|
+
* How Claude says it is signed in (`claude auth status --json`), read with the run's own environment so it reads the
|
|
9
|
+
* credential the child will use. Strict: a plan only for a first-party claude.ai login with a named subscription; any
|
|
10
|
+
* other shape, a key, a cloud provider or no answer is not a plan.
|
|
11
|
+
*/
|
|
12
|
+
export declare function claudeLoginBilling(binary: string, omitEnv: readonly string[], env: Record<string, string | undefined>): Promise<Billing | null>;
|
|
13
|
+
/** The live plan proof for a provider, or null where none exists (the caller refuses). */
|
|
14
|
+
export declare function livePlanLogin(provider: string, binary: string, omitEnv: readonly string[], env: Record<string, string | undefined>): Promise<Billing | null>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a CLI says it is signed in, read live, right before a run: the gateway's billing evidence, and the proof a
|
|
3
|
+
* plan-pinned fallback agent needs before it runs (fallback.ts). Only providers listed in PLAN_LOGIN_PROVABLE can be a
|
|
4
|
+
* plan fallback: for any other there is no live proof, so filing and the chain setting refuse it.
|
|
5
|
+
*/
|
|
6
|
+
import { run as runCommand } from "./exec.js";
|
|
7
|
+
/** How Codex says it's signed in (`codex login status`): a ChatGPT sign-in is its plan; a key or Bedrock is a key;
|
|
8
|
+
* null when it says neither (not signed in, or it didn't answer). */
|
|
9
|
+
export async function codexLoginBilling(binary, omitEnv, env) {
|
|
10
|
+
try {
|
|
11
|
+
const status = await runCommand(binary, ["login", "status"], { timeoutMs: 15_000, omitEnv, processGroup: true,
|
|
12
|
+
...(env === undefined ? {} : { env: Object.fromEntries(Object.entries(env).filter((one) => one[1] !== undefined)) }) });
|
|
13
|
+
const said = `${status.stdout}\n${status.stderr}`;
|
|
14
|
+
// Strict: the status line itself, at the start of a line. A line naming both is never read as a plan.
|
|
15
|
+
if (/^Logged in using ChatGPT\s*$/m.test(said) && !/api key|bedrock/i.test(said))
|
|
16
|
+
return "subscription";
|
|
17
|
+
// Anything naming a key or Bedrock is read as a key (never a plan): that only ever narrows.
|
|
18
|
+
return /api key|bedrock/i.test(said) ? "api-key" : null;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** Providers whose CLI can say, live and machine-readably, that the credential a run will use is a plan. */
|
|
25
|
+
export const PLAN_LOGIN_PROVABLE = new Set(["claude", "codex"]);
|
|
26
|
+
/**
|
|
27
|
+
* How Claude says it is signed in (`claude auth status --json`), read with the run's own environment so it reads the
|
|
28
|
+
* credential the child will use. Strict: a plan only for a first-party claude.ai login with a named subscription; any
|
|
29
|
+
* other shape, a key, a cloud provider or no answer is not a plan.
|
|
30
|
+
*/
|
|
31
|
+
export async function claudeLoginBilling(binary, omitEnv, env) {
|
|
32
|
+
try {
|
|
33
|
+
const status = await runCommand(binary, ["auth", "status", "--json"], { timeoutMs: 15_000, omitEnv, processGroup: true,
|
|
34
|
+
env: Object.fromEntries(Object.entries(env).filter((one) => one[1] !== undefined)) });
|
|
35
|
+
if (status.code !== 0)
|
|
36
|
+
return null;
|
|
37
|
+
const read = JSON.parse(status.stdout);
|
|
38
|
+
if (read === null || typeof read !== "object" || Array.isArray(read))
|
|
39
|
+
return null;
|
|
40
|
+
const said = read;
|
|
41
|
+
if (said["loggedIn"] !== true)
|
|
42
|
+
return null;
|
|
43
|
+
if (said["authMethod"] === "claude.ai" && said["apiProvider"] === "firstParty" && typeof said["subscriptionType"] === "string" && /^[a-z0-9_-]{1,32}$/.test(said["subscriptionType"]))
|
|
44
|
+
return "subscription";
|
|
45
|
+
return "api-key";
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** The live plan proof for a provider, or null where none exists (the caller refuses). */
|
|
52
|
+
export async function livePlanLogin(provider, binary, omitEnv, env) {
|
|
53
|
+
if (provider === "codex")
|
|
54
|
+
return codexLoginBilling(binary, omitEnv, env);
|
|
55
|
+
if (provider === "claude")
|
|
56
|
+
return claudeLoginBilling(binary, omitEnv, env);
|
|
57
|
+
return null;
|
|
58
|
+
}
|
package/dist/planner.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ProviderId } from "./contracts/provider.js";
|
|
|
2
2
|
import type { Store } from "./store.js";
|
|
3
3
|
import { type ParsedDecision, type Problem } from "./decision.js";
|
|
4
4
|
import { type ParsedPlan, type PlanProblem } from "./plan.js";
|
|
5
|
-
import type
|
|
5
|
+
import { type Runner } from "./builder.js";
|
|
6
6
|
import { type PlannerSource } from "./planner-source.js";
|
|
7
7
|
export type PlanRequest = {
|
|
8
8
|
/** v105: what's left of a monthly budget this API-key work counts toward (the CLI's own cap), when one does. */
|
package/dist/planner.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ACP_AGENTS, isAcpProvider } from "./acp-agents.js";
|
|
2
2
|
import { skillsContext } from "./project-skills.js";
|
|
3
3
|
import { learningContext } from "./project-learning.js";
|
|
4
|
+
import { deliverCodeMap } from "./code-map-admission.js";
|
|
4
5
|
import { knowledgeContext } from "./project-knowledge.js";
|
|
5
6
|
/**
|
|
6
7
|
* The planner: an agent that reads the repository and negotiates a plan —
|
|
@@ -31,6 +32,7 @@ import { TEXT_LIMITS } from "./text-limits.js";
|
|
|
31
32
|
import { invokeAgent } from "./invoke.js";
|
|
32
33
|
import { TOKEN_ENVS as TELEGRAM_TOKEN_ENVS } from "./telegram.js";
|
|
33
34
|
import { evidenceRoot, mailboxName, planFileName, quarantineMailboxes, readMailbox, storeEvidence, writeEvidenceFile, } from "./evidence.js";
|
|
35
|
+
import { gitFailureWords } from "./builder.js";
|
|
34
36
|
import { MARKER as LEASE_MARKER } from "./worktree.js";
|
|
35
37
|
import { liveLogContext } from "./live-detail.js";
|
|
36
38
|
import { openLiveLog } from "./live.js";
|
|
@@ -536,7 +538,7 @@ export async function plan(store, request) {
|
|
|
536
538
|
}
|
|
537
539
|
const revision = await git(GIT, ["--no-optional-locks", "rev-parse", "HEAD"], { cwd: worktree });
|
|
538
540
|
if (revision.code !== 0) {
|
|
539
|
-
return { ok: false, kind: "failure", reason: "git", message: `could not read the base revision in ${worktree}` };
|
|
541
|
+
return { ok: false, kind: "failure", reason: "git", message: `could not read the base revision in ${worktree} (${gitFailureWords(revision)})` };
|
|
540
542
|
}
|
|
541
543
|
const baseRevision = revision.stdout.trim();
|
|
542
544
|
store.stampRun(request.runId, { baseRevision });
|
|
@@ -712,7 +714,7 @@ export async function plan(store, request) {
|
|
|
712
714
|
try {
|
|
713
715
|
const invoked = await invokeAgent(store, request.runId, { provider, model }, {
|
|
714
716
|
phase: "plan",
|
|
715
|
-
brief: projectSkillContext + knowledgeContext(store, request.runId, join(root, '..', 'repository-context')) + learningContext(store, root, request.runId, "plan", clock()) + plannerBrief(request.taskTitle, mailbox, planFile, request.answers ?? [], request.source, structured),
|
|
717
|
+
brief: projectSkillContext + knowledgeContext(store, request.runId, join(root, '..', 'repository-context'), undefined, clock()) + deliverCodeMap(store, request.runId, clock()) + learningContext(store, root, request.runId, "plan", clock()) + plannerBrief(request.taskTitle, mailbox, planFile, request.answers ?? [], request.source, structured),
|
|
716
718
|
maxTurns,
|
|
717
719
|
// Claude's built-in `plan` permission mode diverts writes into its
|
|
718
720
|
// own ~/.claude/plans file and refuses the nonce-bound handoff file.
|
|
@@ -3,6 +3,8 @@ type HistoricalWitness = {
|
|
|
3
3
|
finishedAt: unknown;
|
|
4
4
|
exitedAt?: unknown;
|
|
5
5
|
};
|
|
6
|
+
/** How long a run must have been over before a number its group once held can be read as someone else's. */
|
|
7
|
+
export declare const REUSED_GROUP_AFTER_MS: number;
|
|
6
8
|
/** Read-only checks of retained process witnesses. Saved PIDs authorize no
|
|
7
9
|
* signal. ESRCH or proven macOS PID reuse establishes absence; everything
|
|
8
10
|
* unknown stays occupied. This concerns the historical identity, not whether
|
package/dist/process-liveness.js
CHANGED
|
@@ -6,6 +6,17 @@ function timestamp(value) {
|
|
|
6
6
|
const ms = Date.parse(value);
|
|
7
7
|
return Number.isFinite(ms) && new Date(ms).toISOString() === value ? ms : null;
|
|
8
8
|
}
|
|
9
|
+
/** A whole `ps` lstart (locale C, UTC) as the earliest moment that process can have started, or null. The displayed
|
|
10
|
+
* second is a lower bound, not a rounded millisecond identity. Never lets Date.parse guess a locale, a timezone or an
|
|
11
|
+
* invalid calendar date. */
|
|
12
|
+
function birthOf(lstart) {
|
|
13
|
+
const match = /^(Sun|Mon|Tue|Wed|Thu|Fri|Sat) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{1,2}) (\d{2}:\d{2}:\d{2}) (\d{4})$/.exec(lstart.trim().replace(/ +/g, " "));
|
|
14
|
+
if (match === null)
|
|
15
|
+
return null;
|
|
16
|
+
const utc = `${match[1]}, ${match[3].padStart(2, "0")} ${match[2]} ${match[5]} ${match[4]} GMT`;
|
|
17
|
+
const start = Date.parse(utc);
|
|
18
|
+
return !Number.isFinite(start) || new Date(start).toUTCString() !== utc || start > Date.now() ? null : start;
|
|
19
|
+
}
|
|
9
20
|
function newerMacProcess(pid, witness) {
|
|
10
21
|
if (process.platform !== "darwin" || witness === undefined)
|
|
11
22
|
return false;
|
|
@@ -13,26 +24,58 @@ function newerMacProcess(pid, witness) {
|
|
|
13
24
|
if (observed === null || finished === null)
|
|
14
25
|
return false;
|
|
15
26
|
try {
|
|
16
|
-
|
|
17
|
-
// Date.parse guess either, or normalize an invalid calendar date.
|
|
18
|
-
const raw = execFileSync("/bin/ps", ["-p", String(pid), "-o", "lstart="], {
|
|
27
|
+
const start = birthOf(execFileSync("/bin/ps", ["-p", String(pid), "-o", "lstart="], {
|
|
19
28
|
encoding: "utf8", env: { ...process.env, LC_ALL: "C", TZ: "UTC" },
|
|
20
29
|
stdio: ["ignore", "pipe", "ignore"], maxBuffer: 1024,
|
|
21
30
|
// Bound only this owned diagnostic child, never an agent or task.
|
|
22
31
|
// A stalled/oversized lookup throws and leaves the witness occupied.
|
|
23
32
|
timeout: 1_000, killSignal: "SIGKILL",
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
}));
|
|
34
|
+
// Same-second observations are ambiguous. Reservations can precede
|
|
35
|
+
// spawn, so also require birth AFTER the owning run ended.
|
|
36
|
+
return start !== null && start > Math.max(observed, finished);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/** How long a run must have been over before a number its group once held can be read as someone else's. */
|
|
43
|
+
export const REUSED_GROUP_AFTER_MS = 10 * 60_000;
|
|
44
|
+
/**
|
|
45
|
+
* Whether a group whose exit is recorded is now a different group under the same number (macOS; run 3313's pid-less
|
|
46
|
+
* witness waited on three numbers MTLCompilerService and dataaccessd had taken). A recorded group exit was proved when
|
|
47
|
+
* it was written (no member left, a newer process holding the number, or a reboot), so the proof here only has to
|
|
48
|
+
* show that whoever holds the number came later: the run is over and old, and every process now in the group was
|
|
49
|
+
* born after that exit, or after the run ended if the exit was recorded later than that. A member older than that,
|
|
50
|
+
* an empty or unreadable table, or any line that can't be read leaves the group occupied. Nothing is signalled.
|
|
51
|
+
*/
|
|
52
|
+
function groupTakenSinceExit(pgid, witness) {
|
|
53
|
+
if (process.platform !== "darwin" || witness === undefined)
|
|
54
|
+
return false;
|
|
55
|
+
const observed = timestamp(witness.observedAt), finished = timestamp(witness.finishedAt), exited = timestamp(witness.exitedAt);
|
|
56
|
+
if (observed === null || finished === null || exited === null || Date.now() - finished < REUSED_GROUP_AFTER_MS)
|
|
57
|
+
return false;
|
|
58
|
+
const since = Math.max(observed, Math.min(exited, finished));
|
|
59
|
+
try {
|
|
60
|
+
const table = execFileSync("/bin/ps", ["-axo", "pid=,pgid=,lstart="], {
|
|
61
|
+
encoding: "utf8", env: { ...process.env, LC_ALL: "C", TZ: "UTC" },
|
|
62
|
+
stdio: ["ignore", "pipe", "ignore"], maxBuffer: 16 * 1024 * 1024, timeout: 5_000, killSignal: "SIGKILL",
|
|
63
|
+
});
|
|
64
|
+
let members = 0;
|
|
65
|
+
for (const line of table.split("\n")) {
|
|
66
|
+
if (line.trim() === "")
|
|
67
|
+
continue;
|
|
68
|
+
const row = /^\s*\d+\s+(\d+)(?:\s+(.*))?$/.exec(line);
|
|
69
|
+
if (row === null)
|
|
70
|
+
return false;
|
|
71
|
+
if (Number(row[1]) !== pgid)
|
|
72
|
+
continue;
|
|
73
|
+
const start = birthOf(row[2] ?? "");
|
|
74
|
+
if (start === null || start <= since)
|
|
75
|
+
return false;
|
|
76
|
+
members += 1;
|
|
77
|
+
}
|
|
78
|
+
return members > 0;
|
|
36
79
|
}
|
|
37
80
|
catch {
|
|
38
81
|
return false;
|
|
@@ -65,10 +108,11 @@ export function processMayBeAlive(pid, group, witness) {
|
|
|
65
108
|
// Darwin's forkproc excludes existing PIDs, PGIDs and session IDs under
|
|
66
109
|
// proc_list_lock. A proven newer PID EQUAL to the saved PGID therefore
|
|
67
110
|
// implies the old group ended before allocation, even if a new group now
|
|
68
|
-
// uses that number. A new member or an absent leader proves nothing
|
|
111
|
+
// uses that number. A new member or an absent leader proves nothing,
|
|
112
|
+
// unless the group's exit is already on record (groupTakenSinceExit).
|
|
69
113
|
// See docs/assessments/UPDATE_PID_REUSE_2026-09-15.md, recovery attempt 2.
|
|
70
114
|
if (!absent)
|
|
71
|
-
return !newerMacProcess(pid, witness);
|
|
115
|
+
return !newerMacProcess(pid, witness) && !groupTakenSinceExit(pid, witness);
|
|
72
116
|
}
|
|
73
117
|
try {
|
|
74
118
|
process.kill(pid, 0);
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings → Project: what Toolroll holds for a project, and deleting
|
|
3
|
+
* it. An instance operator deletes in two steps: type the project's name,
|
|
4
|
+
* then read exactly what goes and confirm with their password (or a fresh
|
|
5
|
+
* sign-in with the identity provider). The repository itself stays.
|
|
6
|
+
*/
|
|
7
|
+
import { type FallbackSetting } from "./fallback.js";
|
|
1
8
|
import type { ProjectSandbox } from "./project-sandbox.js";
|
|
2
9
|
import type { ProjectNetwork } from "./egress.js";
|
|
3
10
|
import type { WritesMode } from "./writes-mode.js";
|
|
@@ -8,6 +15,13 @@ import { type ProjectHoldings } from "./project-delete.js";
|
|
|
8
15
|
export declare const PROJECT_DELETE_CSS: string;
|
|
9
16
|
export type ProjectSettingsView = {
|
|
10
17
|
remoteUrl?: string | null;
|
|
18
|
+
/** The code map's switch and, while it runs, the holdout's end date. */
|
|
19
|
+
codeMap?: {
|
|
20
|
+
on: boolean;
|
|
21
|
+
enrollUntil: string | null;
|
|
22
|
+
canEndHoldout: boolean;
|
|
23
|
+
href: string;
|
|
24
|
+
};
|
|
11
25
|
repo: string;
|
|
12
26
|
name: string;
|
|
13
27
|
holdings: ProjectHoldings;
|
|
@@ -42,6 +56,11 @@ export type ProjectSettingsView = {
|
|
|
42
56
|
setting: ProjectNetwork;
|
|
43
57
|
canChange: boolean;
|
|
44
58
|
};
|
|
59
|
+
/** Who takes over when an agent runs out of its plan (fallback.ts), and whether this person may change it. */
|
|
60
|
+
fallback?: {
|
|
61
|
+
setting: FallbackSetting | null;
|
|
62
|
+
canChange: boolean;
|
|
63
|
+
};
|
|
45
64
|
/** Where its builds may write (writes-mode.ts), and whether this person may change it. */
|
|
46
65
|
writes?: {
|
|
47
66
|
setting: WritesMode;
|
|
@@ -69,8 +88,6 @@ export type ProjectSettingsView = {
|
|
|
69
88
|
signInsUnavailable?: string | null;
|
|
70
89
|
};
|
|
71
90
|
};
|
|
72
|
-
/** The project's page: its name and path, what Toolroll holds for it, its build settings, and (for an instance operator)
|
|
73
|
-
* Remove and Delete. */
|
|
74
91
|
export declare function projectSettingsHtml(view: ProjectSettingsView, said: {
|
|
75
92
|
said?: string | null;
|
|
76
93
|
problem?: string | null;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* then read exactly what goes and confirm with their password (or a fresh
|
|
5
5
|
* sign-in with the identity provider). The repository itself stays.
|
|
6
6
|
*/
|
|
7
|
+
import { entryMovesOnWords, entryWords } from "./fallback.js";
|
|
7
8
|
import { sandboxRuntimeWords } from "./sandbox-runtime.js";
|
|
8
9
|
import { CHECK_ACCESS_WARNINGS, signInHostsMissing } from "./check-access.js";
|
|
9
10
|
import { html, joinHtml, postForm } from "./html.js";
|
|
@@ -132,6 +133,22 @@ function networkHtml(view) {
|
|
|
132
133
|
note("Tasks scoped from now on use this; tasks already approved keep the network they were approved with."),
|
|
133
134
|
]) }))]) });
|
|
134
135
|
}
|
|
136
|
+
function fallbackHtml(view) {
|
|
137
|
+
const fallback = view.fallback;
|
|
138
|
+
if (fallback === undefined)
|
|
139
|
+
return "";
|
|
140
|
+
const { setting } = fallback;
|
|
141
|
+
const lead = setting === null ? html `When an agent runs out of its plan, the task stops.` : html `When an agent runs out of its plan, the work moves to the next agent here.`;
|
|
142
|
+
const lines = setting === null ? "" : joinHtml(setting.entries.map(one => note(`${entryWords(one)}. ${entryMovesOnWords(one)}.`)));
|
|
143
|
+
return settingsSection({ id: "fallback", title: "Fallback agents", state: setting === null ? "" : ` · ${setting.entries.length}`, lead,
|
|
144
|
+
body: joinHtml([lines, !fallback.canChange ? APPROVER_CHANGES : disclose("Change", kitSectionForm({ proof: "project-fallback", action: "/settings/project/fallback", id: "fallback-form", gate: true, hidden: { repo: view.repo },
|
|
145
|
+
body: joinHtml([
|
|
146
|
+
formRow("Agents, in order", "One per line: provider:model:plan or provider:model:api-key. Empty turns this off.", textarea({ id: "fallback-agents", name: "agents", value: setting === null ? "" : setting.entries.map(one => `${one.provider}:${one.model}:${one.authMode === "subscription" ? "plan" : "api-key"}`).join("\n"), rows: 3,
|
|
147
|
+
attrs: { autocomplete: "off", autocapitalize: "off", spellcheck: "false", placeholder: "codex:gpt-5.6:plan", "aria-label": "Fallback agents, in order" } }), "top"),
|
|
148
|
+
formRow("Paid fallback", "An agent on an API key spends money. It runs only while this is on.", switchInput({ id: "fallback-paid", name: "paid", label: "Allowed", on: setting?.paidGrant != null, attrs: { value: "on", "aria-label": "Allow paid fallback agents to spend" } }), "inline"),
|
|
149
|
+
note("Tasks scoped from now on use this; tasks already approved keep the chain they were approved with."),
|
|
150
|
+
]) }))]) });
|
|
151
|
+
}
|
|
135
152
|
/** Live view: hidden by default; showing commands takes the password, hiding them is one step. */
|
|
136
153
|
function liveViewHtml(view) {
|
|
137
154
|
const live = view.liveView;
|
|
@@ -186,6 +203,17 @@ function buildsHtml(view) {
|
|
|
186
203
|
}
|
|
187
204
|
/** The project's page: its name and path, what Toolroll holds for it, its build settings, and (for an instance operator)
|
|
188
205
|
* Remove and Delete. */
|
|
206
|
+
function codeMapHtml(view) {
|
|
207
|
+
const map = view.codeMap;
|
|
208
|
+
if (map === undefined)
|
|
209
|
+
return html ``;
|
|
210
|
+
return settingsSection({ id: "code-map", title: "Code map", right: postForm("/settings/project/code-map", btn(map.on ? "Turn off" : "Turn on", { sm: true, type: "submit" }), { hidden: { repo: view.repo, on: map.on ? "0" : "1" } }),
|
|
211
|
+
lead: map.on ? "Toolroll makes a map of main and gives it to builds." : "Off. No new maps are made, and builds get none.",
|
|
212
|
+
body: joinHtml([
|
|
213
|
+
html `<p><a class="k-link" href="${map.href}">Open code map</a></p>`,
|
|
214
|
+
...(map.enrollUntil === null ? [] : [formRow("Holdout", `About half of new builds run without the map until ${map.enrollUntil.slice(0, 10)}, to measure whether it helps.`, map.canEndHoldout ? postForm("/settings/project/code-map/holdout", btn("End holdout", { sm: true, type: "submit" }), { hidden: { repo: view.repo } }) : html ``, "inline")]),
|
|
215
|
+
]) });
|
|
216
|
+
}
|
|
189
217
|
export function projectSettingsHtml(view, said) {
|
|
190
218
|
const answer = said.problem ? notice(said.problem) : said.said ? infoLine(said.said) : "";
|
|
191
219
|
const project = settingsSection({ id: "project", title: view.name, lead: mono(view.repo),
|
|
@@ -194,7 +222,7 @@ export function projectSettingsHtml(view, said) {
|
|
|
194
222
|
formRow("Recorded remote", view.remoteUrl ? null : "None. Landed work waits for your review.", view.remoteUrl ? mono(view.remoteUrl) : html ``, view.remoteUrl ? "wide" : "inline"),
|
|
195
223
|
disclose("Change remote", joinHtml([note("An owner or instance operator can run:"), codeLine("toolroll repos add <project> --remote <url>")])),
|
|
196
224
|
]) });
|
|
197
|
-
const settings = joinHtml([buildsHtml(view), accessHtml(view), networkHtml(view), writesHtml(view), sandboxHtml(view), checkAccessHtml(view), liveViewHtml(view)]);
|
|
225
|
+
const settings = joinHtml([buildsHtml(view), accessHtml(view), networkHtml(view), fallbackHtml(view), writesHtml(view), sandboxHtml(view), checkAccessHtml(view), liveViewHtml(view), codeMapHtml(view)]);
|
|
198
226
|
if (!view.canDelete)
|
|
199
227
|
return joinHtml([answer, project, settings, note("An instance operator can remove or delete a project.")]);
|
|
200
228
|
const deleteBody = view.running.length > 0
|
package/dist/project-delete.js
CHANGED
|
@@ -50,6 +50,8 @@ const SETTINGS = [
|
|
|
50
50
|
["intake_grant", "repo"], ["capability", "repo"], ["project_tool", "repo"],
|
|
51
51
|
["learning_policy", "repo"], ["operating_mode", "repo"], ["project_knowledge", "repo"], ["live_detail_setting", "repo"],
|
|
52
52
|
["project_decision", "repo"], ["flow_script", "repo"], ["workflow_recipe", "repo"], ["team_lead_project", "project"],
|
|
53
|
+
// Its fallback agents and, on the same row, its paid fallback grant (fallback.ts).
|
|
54
|
+
["fallback_setting", "repo"],
|
|
53
55
|
];
|
|
54
56
|
/** The project's Models rows, counted with its settings and deleted by forgetProjectModels only. */
|
|
55
57
|
export const MODEL_SETTINGS = Object.freeze([["phase_config", "scope"], ["phase_tier_config", "scope"], ["phase_tier_alternate", "scope"]]);
|
|
@@ -264,8 +266,14 @@ function deleteRows(store, repo, d, now) {
|
|
|
264
266
|
del("diff_comment", `${IN("run")} OR ${IN("reviewer_run")} OR ${IN("artifact")}`, R, R, A);
|
|
265
267
|
del("review_request", `${IN("run")} OR ${IN("reviewer_run")}`, R, R);
|
|
266
268
|
del("repair_chain", IN("source_run"), R);
|
|
269
|
+
// What happens to a result after its agent finishes (fleet-schema.ts): a project's own rows, answers first.
|
|
270
|
+
del("finding_answer", "finding IN (SELECT id FROM finding WHERE repo = ?)", repo);
|
|
271
|
+
for (const table of ["finding", "check_repair", "evidence_pair", "failing_first", "provider_capture"])
|
|
272
|
+
del(table, "repo = ?", repo);
|
|
267
273
|
for (const table of ["incident", "proof_acceptance", "proof_verdict", "run_process", "run_route", "run_spend", "run_tool", "run_note", "run_stop", "run_checkpoint", "execution_slot"])
|
|
268
274
|
del(table, IN("run"), R);
|
|
275
|
+
del("code_map_delivery", IN("run"), R);
|
|
276
|
+
del("code_map_snapshot", IN("run"), R);
|
|
269
277
|
del("knowledge_snapshot", `repo = ? OR ${IN("run")}`, repo, R);
|
|
270
278
|
del("learning_snapshot", `repo = ? OR ${IN("run")}`, repo, R);
|
|
271
279
|
del("learning_capture", `repo = ? OR ${IN("source")} OR ${IN("reviewer")}`, repo, R, R);
|
|
@@ -290,9 +298,10 @@ function deleteRows(store, repo, d, now) {
|
|
|
290
298
|
for (const [table, column] of [["scope_approval_vote", "task_id"], ["scope_author", "task_id"], ["plan_authorization", "task_id"], ["tool_seal", "task"], ["mcp_idempotency", "task_id"], ["coordinator_event", "task_id"], ["workflow_preview", "task_id"], ["task_source", "task_id"]])
|
|
291
299
|
del(table, IN(column), K);
|
|
292
300
|
del("workflow_preview", "repo = ?", repo);
|
|
301
|
+
del("fast_preview", "repo = ?", repo);
|
|
293
302
|
del("coding_handoff_scope", `id IN (SELECT id FROM coding_handoff WHERE json_extract(payload, '$.repo') = ?)`, repo);
|
|
294
303
|
del("coding_handoff", "json_extract(payload, '$.repo') = ?", repo);
|
|
295
|
-
for (const table of ["task_act", "task_replacement", "task_archive"])
|
|
304
|
+
for (const table of ["task_act", "task_replacement", "task_archive", "vanished_charge", "retry_episode", "check_authorization", "route_change"])
|
|
296
305
|
del(table, IN("task_ref"), T);
|
|
297
306
|
del("task_ref", IN("id"), T);
|
|
298
307
|
del("task_scope", IN("task_id"), K);
|
|
@@ -322,6 +331,10 @@ function deleteRows(store, repo, d, now) {
|
|
|
322
331
|
// the rows they hang off (the deleted runs, notes and decisions), below.
|
|
323
332
|
for (const table of V149_REPO_TABLES)
|
|
324
333
|
del(table, "repo = ?", repo);
|
|
334
|
+
// Its code map: the pointer before the versions it names.
|
|
335
|
+
del("code_map_current", "repo = ?", repo);
|
|
336
|
+
for (const table of ["code_map_version", "code_map_refresh", "code_map_family"])
|
|
337
|
+
del(table, "repo = ?", repo);
|
|
325
338
|
del("memory_sighting", "gap IN (SELECT id FROM memory_gap WHERE repo = ?) OR session IN (SELECT id FROM memory_session WHERE repo = ?)", repo, repo);
|
|
326
339
|
for (const [table, column] of SETTINGS)
|
|
327
340
|
del(table, `${column} = ?`, repo);
|