toolroll 0.9.62 → 0.9.65
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 +80 -0
- package/README.md +66 -8
- package/dist/acp-agents.d.ts +43 -0
- package/dist/acp-agents.js +62 -0
- package/dist/acp-attest.d.ts +44 -0
- package/dist/acp-attest.js +269 -0
- package/dist/acp-check.d.ts +28 -0
- package/dist/acp-check.js +410 -0
- package/dist/acp-client.d.ts +163 -0
- package/dist/acp-client.js +738 -0
- package/dist/acp-inspect.d.ts +23 -0
- package/dist/acp-inspect.js +109 -0
- package/dist/agent-board.d.ts +19 -6
- package/dist/agent-board.js +30 -9
- package/dist/agent-fence.d.ts +203 -10
- package/dist/agent-fence.js +623 -41
- package/dist/agent-pulse.js +9 -2
- package/dist/agent-state-words.d.ts +19 -0
- package/dist/agent-state-words.js +20 -0
- package/dist/agent-state.d.ts +65 -0
- package/dist/agent-state.js +229 -0
- package/dist/agentconfig.js +36 -13
- package/dist/agents-board.d.ts +34 -2
- package/dist/agents-board.js +110 -1
- package/dist/approval-rules-ui.js +2 -2
- package/dist/assignment-delivery.d.ts +14 -0
- package/dist/assignment-delivery.js +13 -0
- package/dist/assignment.js +13 -0
- package/dist/attest.js +7 -0
- package/dist/backup-ui.js +2 -2
- package/dist/browser/THIRD_PARTY_NOTICES.txt +48 -0
- package/dist/browser/terminal.css +37 -0
- package/dist/browser/terminal.js +117 -0
- package/dist/browser/workspace.css +2 -2
- package/dist/browser/workspace.js +42 -38
- package/dist/browser-shell.js +6 -3
- package/dist/browser-workspace.d.ts +263 -1
- package/dist/browser-workspace.js +60 -0
- package/dist/builder.d.ts +6 -1
- package/dist/builder.js +34 -13
- package/dist/chat-actions.d.ts +13 -1
- package/dist/chat-actions.js +199 -17
- package/dist/chat-ask.d.ts +4 -0
- package/dist/chat-ask.js +14 -0
- package/dist/chat-channel.js +20 -0
- package/dist/chat-continuity.js +5 -4
- package/dist/chat-decide.d.ts +0 -14
- package/dist/chat-decide.js +4 -1
- package/dist/chat-delivery.d.ts +9 -0
- package/dist/chat-delivery.js +45 -6
- package/dist/chat-messages.d.ts +8 -0
- package/dist/chat-messages.js +36 -4
- package/dist/check-levels-ui.js +2 -2
- package/dist/check-levels.js +3 -0
- package/dist/checkout-proof.d.ts +28 -0
- package/dist/checkout-proof.js +62 -0
- package/dist/claim.d.ts +12 -0
- package/dist/claim.js +20 -1
- package/dist/cli-help.d.ts +1 -1
- package/dist/cli-help.js +5 -1
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +24 -2
- package/dist/coding-ui.js +6 -4
- package/dist/console-instance.d.ts +124 -0
- package/dist/console-instance.js +337 -0
- package/dist/contracts/chat-actions.d.ts +16 -0
- package/dist/contracts/chat-actions.js +4 -0
- package/dist/contracts/chat-content.d.ts +19 -0
- package/dist/contracts/chat-content.js +6 -0
- package/dist/contracts/cli.d.ts +8 -0
- package/dist/contracts/cli.js +3 -1
- package/dist/contracts/console-api.d.ts +30 -4
- package/dist/contracts/console-api.js +13 -4
- package/dist/contracts/flow-card.d.ts +4 -0
- package/dist/contracts/flow-card.js +3 -0
- package/dist/contracts/flow.d.ts +46 -0
- package/dist/contracts/flow.js +11 -2
- package/dist/contracts/integration-metadata.d.ts +2 -1
- package/dist/contracts/integration-metadata.js +2 -1
- package/dist/contracts/lead-tools.d.ts +92 -0
- package/dist/contracts/lead-tools.js +13 -0
- package/dist/contracts/provider.d.ts +11 -1
- package/dist/contracts/provider.js +1 -1
- package/dist/contracts/route.d.ts +76 -1
- package/dist/contracts/route.js +1 -1
- package/dist/contracts/store-json.d.ts +2 -0
- package/dist/control-setup.d.ts +1 -1
- package/dist/control-ui.js +2 -2
- package/dist/converse.d.ts +16 -0
- package/dist/converse.js +32 -4
- package/dist/demo-chat.js +4 -4
- package/dist/demo.js +2 -2
- package/dist/desktop-update-gate.js +6 -0
- package/dist/discord-chat.js +4 -1
- package/dist/dispatch.js +7 -4
- package/dist/doctor.d.ts +53 -0
- package/dist/doctor.js +427 -0
- package/dist/egress-bridge.d.ts +17 -0
- package/dist/egress-bridge.js +111 -0
- package/dist/egress.d.ts +119 -0
- package/dist/egress.js +423 -0
- package/dist/evidence-pack.d.ts +1 -1
- package/dist/evidence-pack.js +2 -2
- package/dist/exec.d.ts +81 -0
- package/dist/exec.js +368 -9
- package/dist/export-ui.js +2 -2
- package/dist/flow-code.d.ts +2 -2
- package/dist/flow-code.js +4 -15
- package/dist/flow-engine.js +35 -11
- package/dist/flow-gallery-ui.js +2 -2
- package/dist/flow-gallery.js +27 -8
- package/dist/flow-share.js +16 -5
- package/dist/flow-triggers.d.ts +84 -11
- package/dist/flow-triggers.js +554 -87
- package/dist/flow-unattended-words.d.ts +28 -0
- package/dist/flow-unattended-words.js +50 -0
- package/dist/flow-unattended.d.ts +227 -0
- package/dist/flow-unattended.js +776 -0
- package/dist/flows-cli.d.ts +28 -1
- package/dist/flows-cli.js +63 -12
- package/dist/flows-ui.d.ts +2 -3
- package/dist/flows-ui.js +56 -5
- package/dist/flows.d.ts +4 -0
- package/dist/flows.js +9 -1
- package/dist/google-mail.d.ts +1 -0
- package/dist/google-mail.js +61 -18
- package/dist/html.d.ts +9 -0
- package/dist/html.js +11 -0
- package/dist/integrations-ui.d.ts +2 -1
- package/dist/integrations-ui.js +6 -3
- package/dist/integrations.d.ts +17 -3
- package/dist/integrations.js +38 -18
- package/dist/invoke.d.ts +17 -0
- package/dist/invoke.js +510 -182
- package/dist/keys.d.ts +18 -14
- package/dist/keys.js +5 -0
- package/dist/landed-cleanup.d.ts +3 -2
- package/dist/landed-cleanup.js +12 -5
- package/dist/lead-capabilities.js +3 -2
- package/dist/lead-contract.js +2 -0
- package/dist/lead-doors.d.ts +2 -0
- package/dist/lead-doors.js +7 -0
- package/dist/lead-follow.d.ts +2 -0
- package/dist/lead-follow.js +58 -2
- package/dist/lead-progress.js +1 -0
- package/dist/lead-queue-runtime.d.ts +46 -0
- package/dist/lead-queue-runtime.js +191 -0
- package/dist/lead-queue.d.ts +104 -0
- package/dist/lead-queue.js +187 -0
- package/dist/lead-sweep.d.ts +67 -0
- package/dist/lead-sweep.js +99 -0
- package/dist/lead-tools.d.ts +22 -0
- package/dist/lead-tools.js +163 -4
- package/dist/lead.d.ts +13 -5
- package/dist/lead.js +89 -29
- package/dist/limits-ui.d.ts +8 -1
- package/dist/limits-ui.js +26 -0
- package/dist/live-bus.d.ts +8 -0
- package/dist/live-bus.js +40 -4
- package/dist/live-detail.d.ts +27 -0
- package/dist/live-detail.js +57 -0
- package/dist/live-notes.d.ts +20 -0
- package/dist/live-notes.js +47 -0
- package/dist/live-records.d.ts +140 -0
- package/dist/live-records.js +935 -0
- package/dist/live-terminal.d.ts +258 -0
- package/dist/live-terminal.js +649 -0
- package/dist/live.d.ts +38 -27
- package/dist/live.js +142 -124
- package/dist/mcp-connect.d.ts +8 -7
- package/dist/mcp-connect.js +49 -51
- package/dist/mcp-oauth.d.ts +6 -3
- package/dist/mcp-oauth.js +8 -4
- package/dist/memory-pass.js +2 -2
- package/dist/mobile-viewport.d.ts +5 -1
- package/dist/mobile-viewport.js +18 -2
- package/dist/model-catalog.js +4 -0
- package/dist/monitoring-ui.js +2 -2
- package/dist/needs-you.d.ts +1 -1
- package/dist/needs-you.js +11 -4
- package/dist/oauth-run-token.d.ts +51 -0
- package/dist/oauth-run-token.js +127 -0
- package/dist/operate.d.ts +2 -0
- package/dist/operate.js +282 -18
- package/dist/passwordless.d.ts +23 -0
- package/dist/passwordless.js +26 -0
- package/dist/peek-cli.d.ts +12 -4
- package/dist/peek-cli.js +19 -11
- package/dist/phase-routing.js +10 -3
- package/dist/plan-auto.d.ts +11 -0
- package/dist/plan-auto.js +62 -11
- package/dist/planner-source.d.ts +3 -0
- package/dist/planner-source.js +14 -0
- package/dist/planner.d.ts +2 -1
- package/dist/planner.js +7 -1
- package/dist/policy-ui.js +2 -2
- package/dist/policy.d.ts +1 -20
- package/dist/policy.js +29 -2
- package/dist/process-recovery-eligibility.d.ts +1 -1
- package/dist/project-access.d.ts +3 -0
- package/dist/project-access.js +3 -0
- package/dist/project-delete-ui.d.ts +12 -0
- package/dist/project-delete-ui.js +41 -9
- package/dist/project-delete.d.ts +3 -1
- package/dist/project-delete.js +12 -6
- package/dist/project-file.d.ts +3 -0
- package/dist/project-file.js +16 -0
- package/dist/project-memory.d.ts +3 -1
- package/dist/project-memory.js +57 -25
- package/dist/project-tools.d.ts +103 -27
- package/dist/project-tools.js +399 -100
- package/dist/provider-auth.d.ts +4 -3
- package/dist/provider-auth.js +5 -4
- package/dist/provider-connection.d.ts +2 -1
- package/dist/provider-connection.js +5 -0
- package/dist/provider-home.d.ts +22 -0
- package/dist/provider-home.js +99 -0
- package/dist/provider.d.ts +42 -5
- package/dist/provider.js +97 -19
- package/dist/pull-request-ui.js +2 -2
- package/dist/push.js +1 -1
- package/dist/quick-start.d.ts +24 -0
- package/dist/quick-start.js +127 -0
- package/dist/release.d.ts +3 -0
- package/dist/release.js +14 -8
- package/dist/remote-main.d.ts +4 -0
- package/dist/remote-main.js +3 -3
- package/dist/request-budget-ui.js +2 -2
- package/dist/result-review.d.ts +1 -1
- package/dist/result-review.js +9 -3
- package/dist/retention-ui.js +2 -2
- package/dist/retention.js +10 -1
- package/dist/run-efficiency.d.ts +73 -0
- package/dist/run-efficiency.js +228 -0
- package/dist/runner.d.ts +5 -1
- package/dist/runner.js +22 -1
- package/dist/scope.d.ts +171 -6
- package/dist/scope.js +251 -31
- package/dist/scout-net.d.ts +4 -1
- package/dist/scout-net.js +37 -12
- package/dist/scout.d.ts +20 -6
- package/dist/scout.js +27 -3
- package/dist/serve.js +258 -43
- package/dist/server/chat.d.ts +1 -1
- package/dist/server/chat.js +122 -31
- package/dist/server/chrome.d.ts +6 -1
- package/dist/server/chrome.js +18 -7
- package/dist/server/console.css +52 -38
- package/dist/server/flows.js +65 -13
- package/dist/server/guards.d.ts +1 -0
- package/dist/server/guards.js +23 -9
- package/dist/server/http.d.ts +7 -0
- package/dist/server/http.js +3 -2
- package/dist/server/live.d.ts +34 -1
- package/dist/server/live.js +39 -17
- package/dist/server/pages-assets.js +5 -0
- package/dist/server/pages.js +90 -13
- package/dist/server/people-tokens.d.ts +3 -0
- package/dist/server/people-tokens.js +55 -17
- package/dist/server/remote-hooks.js +12 -6
- package/dist/server/remote.d.ts +2 -1
- package/dist/server/remote.js +14 -5
- package/dist/server/render-chat.d.ts +12 -3
- package/dist/server/render-chat.js +47 -16
- package/dist/server/render-pages.d.ts +4 -1
- package/dist/server/render-pages.js +5 -4
- package/dist/server/render-people.d.ts +3 -2
- package/dist/server/render-people.js +3 -2
- package/dist/server/render-results.d.ts +18 -2
- package/dist/server/render-results.js +37 -28
- package/dist/server/render-settings.js +6 -5
- package/dist/server/render-tasks.d.ts +35 -10
- package/dist/server/render-tasks.js +110 -27
- package/dist/server/request-context.d.ts +2 -0
- package/dist/server/request-context.js +2 -1
- package/dist/server/route-table.d.ts +3 -0
- package/dist/server/route-table.js +49 -5
- package/dist/server/runtime.d.ts +34 -3
- package/dist/server/session.d.ts +25 -1
- package/dist/server/session.js +18 -4
- package/dist/server/settings.js +132 -13
- package/dist/server/sweeps.d.ts +4 -0
- package/dist/server/sweeps.js +58 -0
- package/dist/server/task-views.d.ts +2 -1
- package/dist/server/task-views.js +96 -6
- package/dist/server/tasks.js +320 -74
- package/dist/server/terminals.d.ts +31 -0
- package/dist/server/terminals.js +365 -0
- package/dist/setup-guide.js +3 -2
- package/dist/slack-chat.js +4 -1
- package/dist/spend-ui.js +3 -3
- package/dist/spend.js +2 -1
- package/dist/steer-capabilities.d.ts +32 -0
- package/dist/steer-capabilities.js +60 -0
- package/dist/steer-controls.d.ts +14 -0
- package/dist/steer-controls.js +36 -0
- package/dist/steer-status.js +2 -2
- package/dist/storage-sweep-child.js +3 -1
- package/dist/storage-sweep-process.d.ts +12 -5
- package/dist/storage-sweep-process.js +23 -6
- package/dist/storage-ui.js +4 -4
- package/dist/store-baseline.d.ts +1 -1
- package/dist/store-baseline.js +1 -1
- package/dist/store.d.ts +466 -19
- package/dist/store.js +1185 -63
- package/dist/subagent-desk.js +1 -1
- package/dist/subagent-tools.d.ts +1 -1
- package/dist/summary.js +3 -0
- package/dist/surface.js +6 -4
- package/dist/task-source.d.ts +58 -0
- package/dist/task-source.js +93 -0
- package/dist/team-leads.js +1 -1
- package/dist/teams-chat.js +4 -1
- package/dist/teardown-git.d.ts +14 -0
- package/dist/teardown-git.js +119 -0
- package/dist/telegram-lead.d.ts +3 -0
- package/dist/telegram-lead.js +44 -7
- package/dist/telegram.d.ts +11 -2
- package/dist/telegram.js +51 -17
- package/dist/terminal-catalog.d.ts +11 -0
- package/dist/terminal-catalog.js +129 -0
- package/dist/text-limits.d.ts +2 -0
- package/dist/text-limits.js +2 -0
- package/dist/tool-broker.d.ts +39 -0
- package/dist/tool-broker.js +370 -0
- package/dist/tool-launcher.js +5 -4
- package/dist/tool-secret-store.d.ts +170 -0
- package/dist/tool-secret-store.js +834 -0
- package/dist/toolroll-update-ui.js +2 -2
- package/dist/toolroll-update.js +14 -3
- package/dist/tools-ui.d.ts +7 -1
- package/dist/tools-ui.js +19 -10
- package/dist/webhook-limits.d.ts +23 -0
- package/dist/webhook-limits.js +30 -0
- package/dist/webhook-readers.d.ts +56 -0
- package/dist/webhook-readers.js +138 -0
- package/dist/webhook-signing.d.ts +27 -0
- package/dist/webhook-signing.js +119 -0
- package/dist/work-index.d.ts +29 -0
- package/dist/work-index.js +21 -5
- package/dist/workspace-revision.js +3 -1
- package/dist/worktree.d.ts +10 -4
- package/dist/worktree.js +70 -29
- package/package.json +13 -2
- package/scripts/provider-canary.mjs +210 -31
package/dist/store.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type ProjectNetwork, type RunNetworkRecord } from "./egress.js";
|
|
2
|
+
import { type AcpLaunch } from "./acp-attest.js";
|
|
1
3
|
import { type ChatBinding } from "./chat-core.js";
|
|
2
4
|
import { ChatMessages, TELEGRAM_HOLD_REASONS, TELEGRAM_SKIPPED_ELSEWHERE, TELEGRAM_SKIPPED_OTHER_CHAT, TELEGRAM_SKIPPED_QUIET } from "./chat-messages.js";
|
|
3
5
|
import { isLifecycleNotification, isTelegramProgressNotification, LIFECYCLE_KEY_PREFIX, LIFECYCLE_KINDS, proposalTaskOf, type LifecycleKind } from "./notification-rows.js";
|
|
@@ -41,6 +43,10 @@ export declare function leadTurnKeepsProposals(turn: {
|
|
|
41
43
|
/** What the lead promised to follow up on (lead-commitments.ts; no version bump: additive only, so a build that
|
|
42
44
|
* predates it still opens the store). `condition_json` is a task, attempt, check or time; `check_at` is when to look
|
|
43
45
|
* next; `channel` is where it reports (`chat`: the conversation it was promised in); a promise lapses at `expires_at`. */
|
|
46
|
+
/** Lead fan-out (docs/plans/lead-fan-out.md): a sweep is N ordinary tasks under one shared brief, started with one yes,
|
|
47
|
+
* at most `max_parallel` of them claimed at once. Membership is by task family root, so a revision of a child is that
|
|
48
|
+
* child. Additive (no schema version bump), like lead_commitment. */
|
|
49
|
+
export declare const LEAD_SWEEP_SCHEMA = "\nCREATE TABLE IF NOT EXISTS lead_sweep (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n owner TEXT NOT NULL,\n thread INTEGER,\n repo TEXT NOT NULL,\n title TEXT NOT NULL,\n brief TEXT NOT NULL,\n max_parallel INTEGER NOT NULL CHECK (max_parallel BETWEEN 1 AND 16),\n proposal INTEGER UNIQUE,\n created_at TEXT NOT NULL\n);\nCREATE TABLE IF NOT EXISTS lead_sweep_task (\n sweep INTEGER NOT NULL REFERENCES lead_sweep(id),\n root_task TEXT NOT NULL UNIQUE,\n ordinal INTEGER NOT NULL,\n label TEXT NOT NULL,\n PRIMARY KEY (sweep, ordinal)\n);\n";
|
|
44
50
|
export declare const LEAD_COMMITMENT_SCHEMA = "\nCREATE TABLE IF NOT EXISTS lead_commitment (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n owner TEXT NOT NULL,\n repo TEXT,\n thread INTEGER NOT NULL,\n turn INTEGER,\n channel TEXT NOT NULL DEFAULT 'chat',\n what TEXT NOT NULL,\n condition_json TEXT NOT NULL,\n check_at TEXT NOT NULL,\n expires_at TEXT NOT NULL,\n state TEXT NOT NULL DEFAULT 'open' CHECK (state IN ('open', 'done', 'cancelled', 'expired')),\n created_at TEXT NOT NULL,\n checked_at TEXT,\n closed_at TEXT,\n closed_by TEXT,\n outcome TEXT\n);\nCREATE INDEX IF NOT EXISTS lead_commitment_due ON lead_commitment (state, check_at);\nCREATE INDEX IF NOT EXISTS lead_commitment_owner ON lead_commitment (owner, state, id);\n";
|
|
45
51
|
/** What stops a finished run reading stopped (Store.stopQuiescenceFact). */
|
|
46
52
|
export type StopFactKind = "open" | "alive" | "elsewhere" | "unprovable" | "unknown" | "settling";
|
|
@@ -92,6 +98,8 @@ export declare const BRANCH_BASE_MOVE_SCHEMA = "\nCREATE TABLE IF NOT EXISTS bra
|
|
|
92
98
|
* continues a paused build with a short continue frame and no note: one row per request, bound to the exact paused run;
|
|
93
99
|
* sent_at when the frame was written, ended_at when the run was no longer paused to take it. */
|
|
94
100
|
export declare const LIVE_STEER_SCHEMA = "\nCREATE TABLE IF NOT EXISTS run_pause (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n run INTEGER NOT NULL REFERENCES run(id) ON DELETE CASCADE,\n task_ref INTEGER NOT NULL REFERENCES task_ref(id) ON DELETE CASCADE,\n request_id TEXT NOT NULL UNIQUE,\n requested_by TEXT NOT NULL,\n requested_via TEXT NOT NULL CHECK (requested_via IN ('cli','web','chat')),\n requested_at TEXT NOT NULL,\n note INTEGER REFERENCES task_steer(id) ON DELETE SET NULL,\n sent_at TEXT,\n paused_at TEXT,\n resumed_at TEXT,\n ended_at TEXT\n);\nCREATE INDEX IF NOT EXISTS run_pause_by_run ON run_pause (run, id);\nCREATE TABLE IF NOT EXISTS run_resume (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n run INTEGER NOT NULL REFERENCES run(id) ON DELETE CASCADE,\n task_ref INTEGER NOT NULL REFERENCES task_ref(id) ON DELETE CASCADE,\n request_id TEXT NOT NULL UNIQUE,\n requested_by TEXT NOT NULL,\n requested_via TEXT NOT NULL CHECK (requested_via IN ('cli','web','chat')),\n requested_at TEXT NOT NULL,\n sent_at TEXT,\n ended_at TEXT\n);\nCREATE INDEX IF NOT EXISTS run_resume_by_run ON run_resume (run, id);\n";
|
|
101
|
+
/** A project's "Show commands in the live view" (live-detail.ts): absent means off. */
|
|
102
|
+
export declare const LIVE_DETAIL_SCHEMA = "\nCREATE TABLE IF NOT EXISTS live_detail_setting (\n repo TEXT PRIMARY KEY,\n commands INTEGER NOT NULL CHECK (commands IN (0,1)),\n updated_by TEXT NOT NULL,\n updated_at TEXT NOT NULL\n);\n-- Every run a steering note reached, kept as it happens (live-notes.ts): a\n-- note's own attached/mailed fields move to the next attempt, this does not.\nCREATE TABLE IF NOT EXISTS steer_note_run (\n note INTEGER NOT NULL REFERENCES task_steer(id) ON DELETE CASCADE,\n run INTEGER NOT NULL REFERENCES run(id) ON DELETE CASCADE,\n how TEXT NOT NULL CHECK (how IN ('attached','mailed','read')),\n at TEXT NOT NULL,\n PRIMARY KEY (note, run, how)\n);\nCREATE INDEX IF NOT EXISTS steer_note_run_by_run ON steer_note_run (run, note);\n";
|
|
95
103
|
export declare const CHAT_APPROVAL_SCHEMA = "\nCREATE TABLE IF NOT EXISTS chat_approval_setting (\n approver TEXT NOT NULL,\n scope TEXT NOT NULL,\n enabled INTEGER NOT NULL CHECK (enabled IN (0,1)),\n full_access INTEGER NOT NULL DEFAULT 0 CHECK (full_access IN (0,1)),\n attempt_cap_microusd INTEGER CHECK (attempt_cap_microusd IS NULL OR attempt_cap_microusd >= 0),\n generation INTEGER NOT NULL,\n digest TEXT NOT NULL,\n updated_by TEXT NOT NULL,\n updated_at TEXT NOT NULL,\n PRIMARY KEY (approver, scope)\n);\n";
|
|
96
104
|
export declare const CHAT_DECIDE_SCHEMA = "\nCREATE TABLE IF NOT EXISTS chat_decide_action (\n token TEXT PRIMARY KEY,\n channel TEXT NOT NULL,\n binding INTEGER NOT NULL,\n chat TEXT NOT NULL,\n message TEXT,\n act TEXT NOT NULL CHECK (act IN ('accept','changes','retry','approve','not-now','merge')),\n phase TEXT NOT NULL CHECK (phase IN ('offer','yes','cancel')),\n task_id TEXT NOT NULL,\n run INTEGER,\n digest TEXT NOT NULL,\n created_at TEXT NOT NULL,\n expires_at TEXT NOT NULL,\n consumed_at TEXT\n);\nCREATE INDEX IF NOT EXISTS chat_decide_action_message ON chat_decide_action (channel, chat, message);\nCREATE TABLE IF NOT EXISTS chat_decide_prompt (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n channel TEXT NOT NULL,\n binding INTEGER NOT NULL,\n chat TEXT NOT NULL,\n task_id TEXT NOT NULL,\n run INTEGER NOT NULL,\n digest TEXT NOT NULL,\n message TEXT,\n created_at TEXT NOT NULL,\n expires_at TEXT NOT NULL,\n consumed_at TEXT\n);\nCREATE INDEX IF NOT EXISTS chat_decide_prompt_open ON chat_decide_prompt (channel, binding, consumed_at);\n";
|
|
97
105
|
export type LeadAsk = {
|
|
@@ -110,6 +118,10 @@ export declare const LEAD_FOLLOW_MESSAGE = "Automatic crew update: inspect the s
|
|
|
110
118
|
* nothing set up, such as no `gh` sign-in). `ok_at` and `error`/`error_at` keep the last success and the last
|
|
111
119
|
* failure across checks, so a row can say both. `account` is a display name only, never a credential. */
|
|
112
120
|
export declare const INTEGRATIONS_SCHEMA = "\nCREATE TABLE IF NOT EXISTS integration_check (\n key TEXT PRIMARY KEY,\n outcome TEXT NOT NULL CHECK (outcome IN ('ok', 'failed', 'absent')),\n account TEXT,\n detail TEXT,\n problem TEXT,\n checked_at TEXT NOT NULL,\n ok_at TEXT,\n error TEXT,\n error_at TEXT\n);\n";
|
|
121
|
+
/** Tool secrets (no version bump): which sealing key Toolroll made for the secrets it keeps in the keychain, as a
|
|
122
|
+
* digest of the key, never the key. A key found beside them that isn't this one was put there by something else and is
|
|
123
|
+
* refused (tool-secret-store.ts). */
|
|
124
|
+
export declare const TOOL_SECRET_KEY_SCHEMA = "\nCREATE TABLE IF NOT EXISTS tool_secret_key (\n id INTEGER PRIMARY KEY CHECK (id = 1),\n digest TEXT NOT NULL CHECK (length(digest) = 64),\n made_at TEXT NOT NULL\n);\n-- Where secrets were kept before Toolroll's folder, decided once at this database's first start (null: none) and never\n-- probed again, so a folder a build makes later under an old name is never migrated in.\nCREATE TABLE IF NOT EXISTS tool_secret_legacy (\n id INTEGER PRIMARY KEY CHECK (id = 1),\n dir TEXT,\n decided_at TEXT NOT NULL\n);\n";
|
|
113
125
|
export type BackupSettings = {
|
|
114
126
|
enabled: boolean;
|
|
115
127
|
everyHours: number;
|
|
@@ -166,7 +178,7 @@ export type SealedLedgerEntry = LedgerEntry & {
|
|
|
166
178
|
hash: string;
|
|
167
179
|
} | null;
|
|
168
180
|
};
|
|
169
|
-
export declare const SCHEMA_VERSION =
|
|
181
|
+
export declare const SCHEMA_VERSION = 130;
|
|
170
182
|
/** v118: the tables merged into `credential`, in the order they move (a person's API tokens keep their ids first). */
|
|
171
183
|
export declare const V118_MERGED_TABLES: Readonly<Record<string, CredentialKind>>;
|
|
172
184
|
/**
|
|
@@ -227,7 +239,11 @@ export declare const V115_DROPPED_TABLES: readonly string[];
|
|
|
227
239
|
* three nullable task_steer columns (the running build's steering folder), checked the same way. v121 only adds
|
|
228
240
|
* new tables and the columns in V121_ADDED_COLUMNS (null, or no sends), checked the same way. v122 only adds a new
|
|
229
241
|
* table (branch_base_move) and the nullable column in V122_ADDED_COLUMNS (a project's recorded remote), checked the
|
|
230
|
-
* same way.
|
|
242
|
+
* same way. v123 only adds new tables (unattended flows, tool secrets) and the columns in V123_ADDED_COLUMNS ('mode',
|
|
243
|
+
* 0 or null), checked the same way. v124 only adds new tables (the live conversation's setting and note history).
|
|
244
|
+
* v125 rebuilds five tables with wider CHECKs, every row and id carried over (the rehearsal's history rules find them
|
|
245
|
+
* unchanged), and adds the nullable column in V125_ADDED_COLUMNS, checked the same way. v126 only adds a new table
|
|
246
|
+
* (task_source) and the columns in V126_ADDED_COLUMNS (null or 0), checked the same way.
|
|
231
247
|
*/
|
|
232
248
|
export declare const UPDATE_SAFE_MIGRATIONS: readonly number[];
|
|
233
249
|
/** v119: the columns it adds, by table, with the value every row saved before it reads (toolroll-update's HISTORY_RULES). */
|
|
@@ -263,6 +279,52 @@ export declare const V122_ADDED_COLUMNS: Readonly<Record<string, Readonly<Record
|
|
|
263
279
|
definition: string;
|
|
264
280
|
saved: string;
|
|
265
281
|
}>>>>;
|
|
282
|
+
/** v123: the columns it adds, with the value every row saved before it reads: which authority armed a plan's
|
|
283
|
+
* unchanged-plan approval (saved rows read the operating mode), whether a trigger's firing was the clock's own (saved
|
|
284
|
+
* firings read not), and what code an on-time script firing a grant signed for ran (saved firings read none). */
|
|
285
|
+
export declare const V123_ADDED_COLUMNS: Readonly<Record<string, Readonly<Record<string, {
|
|
286
|
+
definition: string;
|
|
287
|
+
saved: string;
|
|
288
|
+
}>>>>;
|
|
289
|
+
/** v125: the column it adds, with the value every row saved before it reads: what a run's ACP agent itself reported it
|
|
290
|
+
* used (acp-client.ts; never priced). Runs saved before it read none. */
|
|
291
|
+
export declare const V125_ADDED_COLUMNS: Readonly<Record<string, Readonly<Record<string, {
|
|
292
|
+
definition: string;
|
|
293
|
+
saved: string;
|
|
294
|
+
}>>>>;
|
|
295
|
+
/** v126: the columns it adds, with the value every row saved before it reads (docs/plans/webhook-tasks.md). A saved
|
|
296
|
+
* receipt reads no state (accepted when it has a card, skipped otherwise), no acceptance time (its arrival counts) and
|
|
297
|
+
* no held item; a saved trigger is on its first credential generation with nothing turned away; a saved card was made
|
|
298
|
+
* by a person. */
|
|
299
|
+
export declare const V126_ADDED_COLUMNS: Readonly<Record<string, Readonly<Record<string, {
|
|
300
|
+
definition: string;
|
|
301
|
+
saved: string;
|
|
302
|
+
}>>>>;
|
|
303
|
+
/** v128: whether a lead message waits for its turn. A message saved before v128 waits exactly when it is an operator
|
|
304
|
+
* message that a team queue row holds and no turn has taken (the team runtime's own unadmitted messages); every other
|
|
305
|
+
* saved message is history (`saved` is evaluated per row). */
|
|
306
|
+
export declare const V128_ADDED_COLUMNS: Readonly<Record<string, Readonly<Record<string, {
|
|
307
|
+
definition: string;
|
|
308
|
+
saved: string;
|
|
309
|
+
}>>>>;
|
|
310
|
+
/** v129: how a run went (docs/plans/run-efficiency.md). Recorded from now on; a saved row reads unknown (NULL), never 0. */
|
|
311
|
+
export declare const V129_ADDED_COLUMNS: Readonly<Record<string, Readonly<Record<string, {
|
|
312
|
+
definition: string;
|
|
313
|
+
saved: string;
|
|
314
|
+
}>>>>;
|
|
315
|
+
/** v130: a project's network (an approver's setting, egress.ts ProjectNetwork as JSON) and the installation's choice
|
|
316
|
+
* whether an agent may run where no OS confinement exists (one row; 0 until an instance operator turns it on). */
|
|
317
|
+
export declare const CONFINEMENT_SCHEMA = "\nCREATE TABLE IF NOT EXISTS project_network (\n repo TEXT PRIMARY KEY,\n network_json TEXT NOT NULL CHECK (length(network_json) <= 16384),\n updated_at TEXT NOT NULL,\n updated_by TEXT NOT NULL\n);\nCREATE TABLE IF NOT EXISTS confinement_setting (\n id INTEGER PRIMARY KEY CHECK (id = 1),\n unfenced_allowed INTEGER NOT NULL DEFAULT 0 CHECK (unfenced_allowed IN (0, 1)),\n updated_at TEXT,\n updated_by TEXT\n);\nINSERT OR IGNORE INTO confinement_setting (id, unfenced_allowed) VALUES (1, 0);\n";
|
|
318
|
+
/** v129: a finished run's How it ran, derived from its own records on first view (display only: never a verdict). Its
|
|
319
|
+
* parser version says when to derive again; `steps` says how complete the step detail was, and why not. */
|
|
320
|
+
export declare const RUN_EFFICIENCY_SCHEMA = "\nCREATE TABLE IF NOT EXISTS run_efficiency (\n run INTEGER PRIMARY KEY REFERENCES run(id) ON DELETE CASCADE,\n parser_version INTEGER NOT NULL,\n steps TEXT NOT NULL CHECK (steps IN ('complete','truncated','expired','absent')),\n steps_reason TEXT,\n payload_json TEXT NOT NULL CHECK (length(payload_json) <= 16384),\n derived_at TEXT NOT NULL\n);\n";
|
|
321
|
+
/** v128: the personal lead queue (docs/plans/lead-message-queue.md). A message sent while one of its author's personal
|
|
322
|
+
* lead turns runs (or while earlier ones wait) waits here, one turn per message, in order. Its words are the
|
|
323
|
+
* lead_message row (pending until admitted); terminal rows keep only their request identity (a tombstone). */
|
|
324
|
+
export declare const LEAD_QUEUE_SCHEMA = "\nCREATE TABLE IF NOT EXISTS lead_queue (\n message INTEGER PRIMARY KEY REFERENCES lead_message(id) ON DELETE CASCADE,\n thread INTEGER NOT NULL REFERENCES lead_thread(id) ON DELETE CASCADE,\n approver TEXT NOT NULL,\n approver_generation INTEGER NOT NULL,\n session INTEGER NOT NULL,\n ceiling_digest TEXT NOT NULL,\n request_id TEXT NOT NULL,\n payload_hash TEXT NOT NULL,\n context_json TEXT,\n status TEXT NOT NULL CHECK (status IN ('queued','running','answered','failed','cancelled','uncertain')),\n revision INTEGER NOT NULL DEFAULT 1,\n generation INTEGER NOT NULL DEFAULT 0,\n runner TEXT,\n claimed_at TEXT,\n turn_id INTEGER REFERENCES mate_turn(id),\n error TEXT,\n created_at TEXT NOT NULL,\n settled_at TEXT,\n UNIQUE (session, request_id)\n);\nCREATE INDEX IF NOT EXISTS lead_queue_backlog ON lead_queue (approver, status, message);\nCREATE UNIQUE INDEX IF NOT EXISTS lead_queue_one_running ON lead_queue (approver) WHERE status = 'running';\nCREATE INDEX IF NOT EXISTS lead_queue_admitted ON lead_queue (turn_id) WHERE turn_id IS NOT NULL;\n";
|
|
325
|
+
/** v126: the outside source a task was filed from, kept with the task (a card's own task link moves on; this never
|
|
326
|
+
* does). Written in the filing's transaction, copied whole to a revision, never changed. */
|
|
327
|
+
export declare const TASK_SOURCE_SCHEMA = "\nCREATE TABLE IF NOT EXISTS task_source (\n task_id TEXT PRIMARY KEY,\n flow INTEGER NOT NULL,\n card INTEGER NOT NULL,\n card_entry INTEGER NOT NULL,\n source_json TEXT NOT NULL,\n at TEXT NOT NULL\n);\nCREATE TRIGGER IF NOT EXISTS task_source_immutable BEFORE UPDATE ON task_source\nBEGIN\n SELECT RAISE(ABORT, 'a task source is immutable');\nEND;\nCREATE INDEX IF NOT EXISTS flow_trigger_event_accepted ON flow_trigger_event (trigger, accepted_at);\n";
|
|
266
328
|
/** Whether a database settled at `version` reaches this build's schema through update-safe migrations alone. */
|
|
267
329
|
export declare function updateSafeSchema(version: number | null): boolean;
|
|
268
330
|
export type OAuthClientRow = {
|
|
@@ -587,6 +649,8 @@ export type LeadMessage = {
|
|
|
587
649
|
text: string;
|
|
588
650
|
activity: string | null;
|
|
589
651
|
createdAt: string;
|
|
652
|
+
/** v128: still waiting for its turn (a queued message); absent when admitted or never queued. */
|
|
653
|
+
pending?: true;
|
|
590
654
|
};
|
|
591
655
|
export type LeadProposalKind = "task" | "next" | "reserve" | "hold" | "unhold" | "steer" | "scope" | "cancel" | "answer" | "repair" | "agents" | "review" | "control" | "task_action" | "action";
|
|
592
656
|
/** A coordinator's proposal over the MCP gateway (mate arc v3): the same
|
|
@@ -821,6 +885,13 @@ export type FlowCardSource = {
|
|
|
821
885
|
subject: string;
|
|
822
886
|
from: string;
|
|
823
887
|
};
|
|
888
|
+
/** v126: a webhook delivery's sender that proved it ("none": unsigned), the outside thing it names, and its receipt's key. */
|
|
889
|
+
verified?: string;
|
|
890
|
+
external?: {
|
|
891
|
+
id: string | null;
|
|
892
|
+
url: string | null;
|
|
893
|
+
};
|
|
894
|
+
receipt?: string;
|
|
824
895
|
chat?: {
|
|
825
896
|
app: string;
|
|
826
897
|
installation: string;
|
|
@@ -859,6 +930,22 @@ export type FlowTriggerRow = {
|
|
|
859
930
|
createdBy: string;
|
|
860
931
|
createdAt: string;
|
|
861
932
|
updatedAt: string;
|
|
933
|
+
/** v126: which saved secret proves this trigger's deliveries: "legacy" (the address every secret saved before v126
|
|
934
|
+
* has), "" (none yet: refused until one is saved), or the id of a secret written whole before the trigger pointed at it. */
|
|
935
|
+
hookCredential: string;
|
|
936
|
+
/** v126: deliveries turned away because the hold queue was full, and since when, until a person clears them. */
|
|
937
|
+
droppedCount: number;
|
|
938
|
+
droppedSince: string | null;
|
|
939
|
+
};
|
|
940
|
+
/** v126: what a trigger did with one delivery. Saved before v126: accepted when it made a card, skipped otherwise. */
|
|
941
|
+
export type FlowReceiptState = "accepted" | "skipped" | "held" | "ignored";
|
|
942
|
+
export type FlowReceipt = {
|
|
943
|
+
state: FlowReceiptState;
|
|
944
|
+
card: number | null;
|
|
945
|
+
note: string | null;
|
|
946
|
+
at: string;
|
|
947
|
+
acceptedAt: string | null;
|
|
948
|
+
itemJson: string | null;
|
|
862
949
|
};
|
|
863
950
|
export type FlowEventOutcome = "created" | "ok" | "fail" | "moved" | "approved" | "sent-back" | "cancelled";
|
|
864
951
|
export type LeadTurn = {
|
|
@@ -1147,6 +1234,8 @@ export type Run = {
|
|
|
1147
1234
|
tokensIn: number | null;
|
|
1148
1235
|
tokensOut: number | null;
|
|
1149
1236
|
costUsd: number | null;
|
|
1237
|
+
/** v129: the agent's turns where its provider reports them (Claude's num_turns); null when unknown. */
|
|
1238
|
+
agentTurns?: number | null;
|
|
1150
1239
|
/** HEAD after the agent, as accepted — what a publication may push. */
|
|
1151
1240
|
headRevision: string | null;
|
|
1152
1241
|
/** The validated terminal handoff's conclusion. */
|
|
@@ -1161,7 +1250,7 @@ export type Run = {
|
|
|
1161
1250
|
* How this attempt authenticated (v30) — 'subscription' or 'api-key' —
|
|
1162
1251
|
* stamped by the gateway. Decides which exhaustion class a match yields.
|
|
1163
1252
|
*/
|
|
1164
|
-
authMode?: "subscription" | "api-key" | null;
|
|
1253
|
+
authMode?: "subscription" | "api-key" | "agent-login" | null;
|
|
1165
1254
|
/**
|
|
1166
1255
|
* The gateway's honest classification of how this attempt ENDED (v30),
|
|
1167
1256
|
* computed where the structural terminal still exists (exhaustion.ts).
|
|
@@ -1750,6 +1839,77 @@ export declare const REVIEW_ROOT_ATTEMPTS = 3;
|
|
|
1750
1839
|
/** The receipt v114 keeps a notification's old single-destination delivery under. No sender claims it: every real
|
|
1751
1840
|
* destination is a kind and a 64-character hash, or a Telegram binding. */
|
|
1752
1841
|
export declare const LEGACY_NOTIFICATION_DESTINATION = "legacy:single-destination";
|
|
1842
|
+
/**
|
|
1843
|
+
* v125: an ACP agent's passed conformance checks (acp-attest.ts): per provider and runner, how to launch the exact
|
|
1844
|
+
* binary that passed and every file that launch depends on, what the agent said it is, the models it offered and the
|
|
1845
|
+
* checks it passed. At most one live row per agent and runner; revoking keeps the row as history.
|
|
1846
|
+
*/
|
|
1847
|
+
export declare const ACP_ATTESTATION_SCHEMA = "\nCREATE TABLE IF NOT EXISTS acp_attestation (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n provider TEXT NOT NULL CHECK (provider IN ('opencode','cursor','cline','qwen','goose')),\n runner TEXT NOT NULL,\n conformance_version INTEGER NOT NULL,\n launch_json TEXT NOT NULL,\n agent_name TEXT NOT NULL,\n agent_version TEXT NOT NULL,\n cli_version TEXT NOT NULL,\n models_json TEXT NOT NULL,\n checks_json TEXT NOT NULL,\n recorded_at TEXT NOT NULL,\n recorded_by TEXT NOT NULL,\n revoked_at TEXT,\n revoked_by TEXT\n);\nCREATE UNIQUE INDEX IF NOT EXISTS acp_attestation_live ON acp_attestation (provider, runner) WHERE revoked_at IS NULL;\n";
|
|
1848
|
+
/**
|
|
1849
|
+
* v125: how an ACP agent's work on one model is billed, per runner (docs/plans/acp-adapter.md § Billing): metered
|
|
1850
|
+
* (the default, and what no row means — cost unknown, charged as unknown cost is) or the agent's own plan ($0,
|
|
1851
|
+
* counted as unmeasured). Each change is a new row; the newest is the declaration, its id the revision a run stamps.
|
|
1852
|
+
*/
|
|
1853
|
+
/**
|
|
1854
|
+
* v125: a requested ACP agent check (docs/plans/acp-adapter.md § Layer E): asked for with a password, claimed and run
|
|
1855
|
+
* by one watch of the named runner — one running check per runner, which the partial unique index holds — through two
|
|
1856
|
+
* bounded steps, each bound to its run and graded on plane evidence; the attestation is recorded only in the same
|
|
1857
|
+
* transaction that marks the request passed.
|
|
1858
|
+
*/
|
|
1859
|
+
export declare const ACP_CHECK_SCHEMA = "\nCREATE TABLE IF NOT EXISTS acp_check_request (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n provider TEXT NOT NULL CHECK (provider IN ('opencode','cursor','cline','qwen','goose')),\n runner TEXT NOT NULL,\n model TEXT NOT NULL,\n conformance_version INTEGER NOT NULL,\n requested_by TEXT NOT NULL,\n requested_at TEXT NOT NULL,\n expires_at TEXT NOT NULL,\n state TEXT NOT NULL DEFAULT 'pending' CHECK (state IN ('pending','running','passed','failed','expired')),\n watch_repo TEXT,\n watch_owner TEXT,\n task_ref INTEGER REFERENCES task_ref(id),\n launch_json TEXT,\n lease_id TEXT,\n steps_used INTEGER NOT NULL DEFAULT 0 CHECK (steps_used BETWEEN 0 AND 2),\n step1_run INTEGER REFERENCES run(id),\n step2_run INTEGER REFERENCES run(id),\n step1_passed INTEGER NOT NULL DEFAULT 0 CHECK (step1_passed IN (0,1)),\n step2_passed INTEGER NOT NULL DEFAULT 0 CHECK (step2_passed IN (0,1)),\n result TEXT,\n finished_at TEXT,\n settled_at TEXT,\n settle_by TEXT,\n settle_until TEXT\n);\nCREATE UNIQUE INDEX IF NOT EXISTS acp_check_running ON acp_check_request (runner) WHERE state = 'running';\n";
|
|
1860
|
+
/** A check request as the job and the screens read it. */
|
|
1861
|
+
export type AcpCheckRequest = {
|
|
1862
|
+
id: number;
|
|
1863
|
+
provider: string;
|
|
1864
|
+
runner: string;
|
|
1865
|
+
model: string;
|
|
1866
|
+
conformanceVersion: number;
|
|
1867
|
+
requestedBy: string;
|
|
1868
|
+
requestedAt: string;
|
|
1869
|
+
expiresAt: string;
|
|
1870
|
+
state: "pending" | "running" | "passed" | "failed" | "expired";
|
|
1871
|
+
watch: {
|
|
1872
|
+
repo: string;
|
|
1873
|
+
owner: string;
|
|
1874
|
+
} | null;
|
|
1875
|
+
taskRef: number | null;
|
|
1876
|
+
launchJson: string | null;
|
|
1877
|
+
/** The claim the check took on its task: the only one its cleanup may release. */
|
|
1878
|
+
leaseId: string | null;
|
|
1879
|
+
stepsUsed: number;
|
|
1880
|
+
step1Run: number | null;
|
|
1881
|
+
step2Run: number | null;
|
|
1882
|
+
step1Passed: boolean;
|
|
1883
|
+
step2Passed: boolean;
|
|
1884
|
+
result: string | null;
|
|
1885
|
+
finishedAt: string | null;
|
|
1886
|
+
/** When everything the finished check held (claim, checkout, task) was let go. */
|
|
1887
|
+
settledAt: string | null;
|
|
1888
|
+
};
|
|
1889
|
+
export declare const ACP_BILLING_SCHEMA = "\nCREATE TABLE IF NOT EXISTS acp_billing (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n provider TEXT NOT NULL CHECK (provider IN ('opencode','cursor','cline','qwen','goose')),\n runner TEXT NOT NULL,\n model TEXT NOT NULL,\n kind TEXT NOT NULL CHECK (kind IN ('metered','plan')),\n set_at TEXT NOT NULL,\n set_by TEXT NOT NULL\n);\nCREATE INDEX IF NOT EXISTS acp_billing_by ON acp_billing (provider, runner, model, id);\n";
|
|
1890
|
+
/** An ACP run's billing as stamped when the run was admitted: never re-read from the live declaration. */
|
|
1891
|
+
export type AcpBillingStamp = {
|
|
1892
|
+
kind: "metered" | "plan";
|
|
1893
|
+
revision: number;
|
|
1894
|
+
model: string;
|
|
1895
|
+
};
|
|
1896
|
+
/** An ACP agent's live attestation, as the gateway reads it. */
|
|
1897
|
+
export type AcpAttestation = {
|
|
1898
|
+
id: number;
|
|
1899
|
+
provider: string;
|
|
1900
|
+
runner: string;
|
|
1901
|
+
conformanceVersion: number;
|
|
1902
|
+
launch: AcpLaunch;
|
|
1903
|
+
agent: {
|
|
1904
|
+
name: string;
|
|
1905
|
+
version: string;
|
|
1906
|
+
};
|
|
1907
|
+
cliVersion: string;
|
|
1908
|
+
models: string[];
|
|
1909
|
+
checks: string[];
|
|
1910
|
+
recordedAt: string;
|
|
1911
|
+
recordedBy: string;
|
|
1912
|
+
};
|
|
1753
1913
|
/** Reporting never creates, migrates, or repairs a store. SQLite itself
|
|
1754
1914
|
* enforces read-only access, including the race where the file disappears. */
|
|
1755
1915
|
export declare function openStoreReadOnly(file: string): Store | null;
|
|
@@ -1770,6 +1930,18 @@ export declare class Store {
|
|
|
1770
1930
|
/** The database's own file (null in memory): where the agent fence begins. */
|
|
1771
1931
|
databaseFile(): string | null;
|
|
1772
1932
|
close(): void;
|
|
1933
|
+
/** The digest of the sealing key Toolroll made for its tool secrets; null before it made one (or in an older database). */
|
|
1934
|
+
toolSecretKeyDigest(): string | null;
|
|
1935
|
+
/**
|
|
1936
|
+
* The folder secrets were kept in before Toolroll's own, as decided at this database's first start of a command that
|
|
1937
|
+
* can start builds (`record`): `probe` runs until then, and its answer (null: none) is kept for every later start.
|
|
1938
|
+
* Other commands never write, so a preview stays read-only and a busy database doesn't stop them.
|
|
1939
|
+
*/
|
|
1940
|
+
toolSecretLegacyDir(probe: () => string | null, now: Date, options: {
|
|
1941
|
+
record: boolean;
|
|
1942
|
+
}): string | null;
|
|
1943
|
+
/** Record a new sealing key's digest only if the one recorded is still `expected` (null: none yet). */
|
|
1944
|
+
swapToolSecretKeyDigest(expected: string | null, next: string, now: Date): boolean;
|
|
1773
1945
|
/**
|
|
1774
1946
|
* Creating a task also creates its overlay reference, because a task with no
|
|
1775
1947
|
* `TaskRef` cannot be claimed, held, or scheduled — it would be work the
|
|
@@ -2164,7 +2336,7 @@ export declare class Store {
|
|
|
2164
2336
|
* exactly what the signed digest was bound to. Returns false when the
|
|
2165
2337
|
* scope vanished mid-ceremony. */
|
|
2166
2338
|
sealScopeApproval(taskId: string, by: string, now: Date, mutation?: Mutation, basis?: {
|
|
2167
|
-
kind: "mode" | "chat";
|
|
2339
|
+
kind: "mode" | "chat" | "grant";
|
|
2168
2340
|
modeDigest: string;
|
|
2169
2341
|
}, approverKind?: ApproverKind): boolean;
|
|
2170
2342
|
/** Whether this task's scope carries a LIVE seal: approved, and the
|
|
@@ -2219,6 +2391,10 @@ export declare class Store {
|
|
|
2219
2391
|
* ceremony. Reconciliation drops mode-basis intents to waiting-human;
|
|
2220
2392
|
* `firing` rows are untouched — an issued call is one-shot (E1). */
|
|
2221
2393
|
revokeMode(repo: string, by: string, reason: string, now: Date): boolean;
|
|
2394
|
+
/** A flow's "runs on its own" grant ended (revoked, expired, renewed): the undispatched work it sealed falls back
|
|
2395
|
+
* to a person, as a mode's does, and plans it armed lose their pre-authorization. Running and finished work keeps
|
|
2396
|
+
* its history. */
|
|
2397
|
+
withdrawGrantApprovals(digest: string, now: Date): void;
|
|
2222
2398
|
/** F2/R-REVOKE: the ONE reconciliation road. newMode null = no live
|
|
2223
2399
|
* automerge authority (revocation, expiry, or a notify posture):
|
|
2224
2400
|
* mode-basis pending/claimed intents drop to waiting-human, leases
|
|
@@ -3142,6 +3318,19 @@ export declare class Store {
|
|
|
3142
3318
|
} | null;
|
|
3143
3319
|
/** Stamp a task as the revision it is: source task + immutable brief. */
|
|
3144
3320
|
markRevision(taskRef: number, revisionOf: string, briefArtifact: number): void;
|
|
3321
|
+
/** v126: where a task came from, written once in its filing's transaction (task-source.ts), never changed. */
|
|
3322
|
+
recordTaskSource(taskId: string, from: {
|
|
3323
|
+
flow: number;
|
|
3324
|
+
card: number;
|
|
3325
|
+
entry: number;
|
|
3326
|
+
}, sourceJson: string, now: Date): void;
|
|
3327
|
+
/** v126: where a task came from, as kept when it (or the task it revises) was filed; null for every other task. */
|
|
3328
|
+
taskSourceOf(taskId: string): {
|
|
3329
|
+
flow: number;
|
|
3330
|
+
card: number;
|
|
3331
|
+
entry: number;
|
|
3332
|
+
sourceJson: string;
|
|
3333
|
+
} | null;
|
|
3145
3334
|
/**
|
|
3146
3335
|
* Seal a revision in ONE transaction (Codex M5-M8 audit, C-3; contract
|
|
3147
3336
|
* handoff task 2): the SOURCE BINDING is proven here, against live rows,
|
|
@@ -3441,13 +3630,19 @@ export declare class Store {
|
|
|
3441
3630
|
* verified, attested or accepted, or its branch was published (revised
|
|
3442
3631
|
* through its pull request). Null when `requeueTask` may run it again. */
|
|
3443
3632
|
finalResultReason(runId: number): "accepted-result" | "published" | null;
|
|
3444
|
-
requeueTask(taskId: string, by: string, now: Date
|
|
3633
|
+
requeueTask(taskId: string, by: string, now: Date,
|
|
3634
|
+
/** Approve & build again: requeue only while this exact build is the finished task's latest result and the scope
|
|
3635
|
+
* is still the one just approved, read inside this transaction ("moved" otherwise). */
|
|
3636
|
+
expect?: {
|
|
3637
|
+
run: number;
|
|
3638
|
+
scopeDigest: string;
|
|
3639
|
+
}): {
|
|
3445
3640
|
ok: true;
|
|
3446
3641
|
resolvedIncidents: number;
|
|
3447
3642
|
rejectedRun: number | null;
|
|
3448
3643
|
} | {
|
|
3449
3644
|
ok: false;
|
|
3450
|
-
reason: "unknown-task" | "not-stalled" | "claimed" | "accepted-result" | "published";
|
|
3645
|
+
reason: "unknown-task" | "not-stalled" | "claimed" | "accepted-result" | "published" | "moved";
|
|
3451
3646
|
};
|
|
3452
3647
|
/**
|
|
3453
3648
|
* Cancel, aware of who might be building right now. A live claim wins:
|
|
@@ -3954,6 +4149,9 @@ export declare class Store {
|
|
|
3954
4149
|
unknownSpend?: boolean;
|
|
3955
4150
|
replyBytes?: number;
|
|
3956
4151
|
candidateCount?: number;
|
|
4152
|
+
/** v129: the request's cache read and write tokens, where its provider reports them (unknown stays NULL). */
|
|
4153
|
+
cacheReadTokens?: number | null;
|
|
4154
|
+
cacheWriteTokens?: number | null;
|
|
3957
4155
|
}, now: Date): boolean;
|
|
3958
4156
|
/**
|
|
3959
4157
|
* The crash sweep: turns past their deadline become failed('crashed'),
|
|
@@ -4411,7 +4609,96 @@ export declare class Store {
|
|
|
4411
4609
|
* structural signal is gone. `auth-expired` pauses its provider; every
|
|
4412
4610
|
* other class is observational.
|
|
4413
4611
|
*/
|
|
4414
|
-
|
|
4612
|
+
/**
|
|
4613
|
+
* Record an ACP agent's passed conformance check on a runner (acp-attest.ts), replacing the live one — one
|
|
4614
|
+
* transaction, so there is never a moment with two or with a gap that reads as the old one.
|
|
4615
|
+
*/
|
|
4616
|
+
recordAcpAttestation(input: Omit<AcpAttestation, "id" | "recordedAt" | "conformanceVersion"> & {
|
|
4617
|
+
conformanceVersion?: number;
|
|
4618
|
+
}, now: Date): number;
|
|
4619
|
+
/** An ACP agent's live attestation on a runner, under this build's conformance version; null when there is none. */
|
|
4620
|
+
acpAttestationFor(provider: string, runner: string): AcpAttestation | null;
|
|
4621
|
+
/** Declare how an ACP agent's work on one model is billed on a runner; the new revision. */
|
|
4622
|
+
declareAcpBilling(input: {
|
|
4623
|
+
provider: string;
|
|
4624
|
+
runner: string;
|
|
4625
|
+
model: string;
|
|
4626
|
+
kind: "metered" | "plan";
|
|
4627
|
+
by: string;
|
|
4628
|
+
}, now: Date): number;
|
|
4629
|
+
/** The billing declaration standing for an ACP agent's model on a runner: metered, revision 0, when none was made. */
|
|
4630
|
+
acpBillingFor(provider: string, runner: string, model: string): AcpBillingStamp;
|
|
4631
|
+
/** The billing an ACP run was admitted under, or null (not an ACP run, or unreadable — then it is metered). */
|
|
4632
|
+
acpBillingOfRun(runId: number): AcpBillingStamp | null;
|
|
4633
|
+
/** Ask for an ACP agent check on a runner (the caller proved the password); the request's id. Valid 30 minutes. */
|
|
4634
|
+
requestAcpCheck(input: {
|
|
4635
|
+
provider: string;
|
|
4636
|
+
runner: string;
|
|
4637
|
+
model: string;
|
|
4638
|
+
by: string;
|
|
4639
|
+
}, now: Date): number;
|
|
4640
|
+
acpCheck(id: number): AcpCheckRequest | null;
|
|
4641
|
+
/** The checks asked for an agent, newest first (for the providers screen). */
|
|
4642
|
+
acpChecksFor(provider: string, limit?: number): AcpCheckRequest[];
|
|
4643
|
+
/** The SQL that proves a watch still holds its lease (runner, repo, owner) at `?` — appended with its bindings. */
|
|
4644
|
+
private static readonly WATCH_LIVE;
|
|
4645
|
+
/**
|
|
4646
|
+
* Claim the oldest pending, unexpired check for this runner, for the watch that will run it — one statement; the
|
|
4647
|
+
* partial unique index refuses a second running check on the runner. Null when there is none (or another runs).
|
|
4648
|
+
*/
|
|
4649
|
+
claimAcpCheck(runner: string, watch: {
|
|
4650
|
+
repo: string;
|
|
4651
|
+
owner: string;
|
|
4652
|
+
}, now: Date): AcpCheckRequest | null;
|
|
4653
|
+
/** Bind a running check, still owned and unexpired, to its task and the launch it inspected. */
|
|
4654
|
+
bindAcpCheck(id: number, binding: {
|
|
4655
|
+
taskRef: number;
|
|
4656
|
+
launchJson: string;
|
|
4657
|
+
leaseId: string;
|
|
4658
|
+
}, now: Date): boolean;
|
|
4659
|
+
/** Consume step 1 or 2 for its run: in order, once, owned, unexpired. */
|
|
4660
|
+
consumeAcpCheckStep(id: number, step: 1 | 2, runId: number, now: Date): boolean;
|
|
4661
|
+
/** Record a step as passed, once its grading did: owned, unexpired, and only for the run the step was bound to. */
|
|
4662
|
+
passAcpCheckStep(id: number, step: 1 | 2, runId: number, now: Date): boolean;
|
|
4663
|
+
/**
|
|
4664
|
+
* Publish a passed check: in one transaction, the request moves to passed — only if it is still running, unexpired,
|
|
4665
|
+
* owned by its live watch, with both steps used, bound and passed, and both their runs finished as agent-check
|
|
4666
|
+
* refusals — and the attestation is recorded. Anything else publishes nothing.
|
|
4667
|
+
*/
|
|
4668
|
+
publishAcpCheck(id: number, attestation: Omit<AcpAttestation, "id" | "recordedAt" | "conformanceVersion">, now: Date): boolean;
|
|
4669
|
+
/** The check request, when it still admits this run as its current step: running, unexpired, its watch's lease
|
|
4670
|
+
* live, and the step bound to exactly this run. Null otherwise. */
|
|
4671
|
+
acpCheckAdmitting(id: number, step: 1 | 2, runId: number, now: Date): AcpCheckRequest | null;
|
|
4672
|
+
/** Fail a check that hasn't finished, with its words. */
|
|
4673
|
+
failAcpCheck(id: number, words: string, now: Date): boolean;
|
|
4674
|
+
/** Running checks on this runner no live watch holds any more, or past their time: the ones recovery may close. */
|
|
4675
|
+
abandonedAcpChecks(runner: string, now: Date): AcpCheckRequest[];
|
|
4676
|
+
/** Finished checks on this runner whose claim, checkout and task are not yet let go: cleanup's to-do, retried each pass. */
|
|
4677
|
+
unsettledAcpChecks(runner: string): AcpCheckRequest[];
|
|
4678
|
+
/** The claim a finished check's cleanup now holds on its task (its first one expired): the only one it may release. */
|
|
4679
|
+
setAcpCheckLease(id: number, leaseId: string): boolean;
|
|
4680
|
+
/** A finished check holds something again (a checkout that landed after recovery settled it): cleanup reopens. */
|
|
4681
|
+
unsettleAcpCheck(id: number): boolean;
|
|
4682
|
+
/** Take — or renew — the one cleanup attempt a finished check may have at a time: free, lapsed, or already this one. */
|
|
4683
|
+
holdAcpSettle(id: number, attempt: string, now: Date, ttlMs: number): boolean;
|
|
4684
|
+
/** Whether this cleanup attempt still holds the check. */
|
|
4685
|
+
holdsAcpSettle(id: number, attempt: string, now: Date): boolean;
|
|
4686
|
+
/** Let go of a cleanup attempt (only this one). */
|
|
4687
|
+
endAcpSettle(id: number, attempt: string): void;
|
|
4688
|
+
/** Mark a finished check's holdings let go — by the attempt holding it, and only if no checkout of its branch is
|
|
4689
|
+
* left (one that landed late keeps it open, whatever the attempt last saw). */
|
|
4690
|
+
settleAcpCheck(id: number, attempt: string, branch: string, now: Date): boolean;
|
|
4691
|
+
/** Pending checks past their time are expired, untouched. */
|
|
4692
|
+
expireAcpChecks(now: Date): number;
|
|
4693
|
+
/** Revoke an ACP agent's live attestation on a runner; whether there was one. */
|
|
4694
|
+
revokeAcpAttestation(provider: string, runner: string, by: string, now: Date): boolean;
|
|
4695
|
+
/** What a run's ACP agent itself reported it used (never priced; acp-client.ts). */
|
|
4696
|
+
stampAgentReportedUsage(id: number, usage: string | null): void;
|
|
4697
|
+
stampTerminalClass(id: number, authMode: "subscription" | "api-key" | "agent-login", terminalClass: TerminalClass): void;
|
|
4698
|
+
/** A launch refused before any model turn (an installed CLI too old for a
|
|
4699
|
+
* build's flags): the start stamp goes, its version and evidence stay. Only
|
|
4700
|
+
* while the run is open, so a settled run's account never changes. */
|
|
4701
|
+
withdrawProviderStart(id: number): void;
|
|
4415
4702
|
/** The race-refusal stamp (Phase 3 C5): the version that was REFUSED,
|
|
4416
4703
|
* recorded without provider_started_at — no provider process started. */
|
|
4417
4704
|
stampProviderVersion(id: number, providerVersion: string): void;
|
|
@@ -4421,6 +4708,7 @@ export declare class Store {
|
|
|
4421
4708
|
tokensOut?: number;
|
|
4422
4709
|
costUsd?: number;
|
|
4423
4710
|
usageJson?: string;
|
|
4711
|
+
agentTurns?: number;
|
|
4424
4712
|
}): void;
|
|
4425
4713
|
/** v105: price a run as it stands (reported cost, or tokens at the catalogue price, or unpriced), frozen at the
|
|
4426
4714
|
* price of the moment it's settled. Settled again whenever its usage changes. */
|
|
@@ -4515,6 +4803,9 @@ export declare class Store {
|
|
|
4515
4803
|
subagent: number | null;
|
|
4516
4804
|
agents?: readonly BudgetAgent[];
|
|
4517
4805
|
}) => BudgetHold;
|
|
4806
|
+
/** How one agent would bill new work now: an ACP agent by its declaration for that exact model on that runner
|
|
4807
|
+
* (plan reads as a plan, anything else as metered), every other provider as agentsFor says. */
|
|
4808
|
+
agentFor(provider: string, model: string | null, runner: string | null): BudgetAgent;
|
|
4518
4809
|
/** How each provider would bill new work now (see spend.billingOf). */
|
|
4519
4810
|
agentsFor(providers: readonly string[]): BudgetAgent[];
|
|
4520
4811
|
/** v105: how a provider's CLI was seen billing (a Claude stream's key source, Codex's account mode). */
|
|
@@ -4768,6 +5059,27 @@ export declare class Store {
|
|
|
4768
5059
|
reason: "unknown-task" | "task-finished" | "invalid-note";
|
|
4769
5060
|
problem?: string;
|
|
4770
5061
|
};
|
|
5062
|
+
/**
|
|
5063
|
+
* File a note for the exact run a person is watching (live-conversation.md
|
|
5064
|
+
* §6): in ONE transaction, the run must still be the task's live attempt
|
|
5065
|
+
* (or, `onward`, any attempt of this task: the note goes to the next one),
|
|
5066
|
+
* and a repeated `key` from the same author hands back the same note — only
|
|
5067
|
+
* for the same task, run and text, whichever of the two ways it was sent;
|
|
5068
|
+
* any other reuse is refused. Nothing is filed on a refusal.
|
|
5069
|
+
*/
|
|
5070
|
+
fileSteerNoteForRun(taskId: string, author: VerifiedAuthor, note: string, now: Date, expect: {
|
|
5071
|
+
run: number;
|
|
5072
|
+
key: string | null;
|
|
5073
|
+
onward?: boolean;
|
|
5074
|
+
}): {
|
|
5075
|
+
ok: true;
|
|
5076
|
+
id: number;
|
|
5077
|
+
replayed: boolean;
|
|
5078
|
+
} | {
|
|
5079
|
+
ok: false;
|
|
5080
|
+
reason: "unknown-task" | "task-finished" | "invalid-note" | "attempt-ended" | "key-reused";
|
|
5081
|
+
problem?: string;
|
|
5082
|
+
};
|
|
4771
5083
|
/** One verified note, with the identity a running build's stdin copy is sent under: filing it is also what queues
|
|
4772
5084
|
* its live delivery, in the same transaction (the builder's dispatcher sends whatever is filed and unsent). */
|
|
4773
5085
|
private insertSteerNote;
|
|
@@ -4813,6 +5125,10 @@ export declare class Store {
|
|
|
4813
5125
|
/** The pulse wrote this note into the run's steering folder. Mailing is not
|
|
4814
5126
|
* reading: delivery settles only on the agent's own acknowledgement. */
|
|
4815
5127
|
markSteerMailed(noteId: number, runId: number, now: Date): boolean;
|
|
5128
|
+
/** One run a note reached, kept for its live conversation (live-notes.ts); display state, so a failure never blocks steering. */
|
|
5129
|
+
private noteSteerReached;
|
|
5130
|
+
/** The notes this run reached, filing order — attached to its brief, mailed into its folder, or read by it. */
|
|
5131
|
+
steerNotesReaching(runId: number): SteerNote[];
|
|
4816
5132
|
/**
|
|
4817
5133
|
* The agent moved this note to handled/ (v120): it was read, by THIS run.
|
|
4818
5134
|
* Acknowledgement is the only road from mailed to delivered — a hook firing
|
|
@@ -5401,12 +5717,16 @@ export declare class Store {
|
|
|
5401
5717
|
by: string;
|
|
5402
5718
|
}, now: Date): boolean;
|
|
5403
5719
|
archiveFlow(id: number, by: string, now: Date): boolean;
|
|
5720
|
+
/** A new card. `byKind` (v126) is decided where the card is made, never read from `by`: a delivery, a poll, a schedule
|
|
5721
|
+
* a public form or a chat channel's message is automation whatever its label says; a signed-in person's own card is a
|
|
5722
|
+
* person's. Every caller says which: filing passes it on exactly, and never reads it from `by`. */
|
|
5404
5723
|
addFlowCard(card: {
|
|
5405
5724
|
flow: number;
|
|
5406
5725
|
title: string;
|
|
5407
5726
|
description: string | null;
|
|
5408
5727
|
stage: string;
|
|
5409
5728
|
by: string;
|
|
5729
|
+
byKind: "person" | "automation";
|
|
5410
5730
|
source?: FlowCardSource;
|
|
5411
5731
|
}, now: Date): number;
|
|
5412
5732
|
getFlowCard(id: number): FlowCardRow | null;
|
|
@@ -5684,7 +6004,7 @@ export declare class Store {
|
|
|
5684
6004
|
}, now: Date): number;
|
|
5685
6005
|
/** A person approves a held script (one an imported flow brought): from now on it runs. False when it wasn't held. */
|
|
5686
6006
|
approveFlowScript(repo: string, name: string): boolean;
|
|
5687
|
-
removeFlowScript(repo: string, name: string): boolean;
|
|
6007
|
+
removeFlowScript(repo: string, name: string, by?: string, now?: Date): boolean;
|
|
5688
6008
|
/** Claim a card's visit to a step zone. False when another pass holds it or it already finished. */
|
|
5689
6009
|
claimFlowStep(step: {
|
|
5690
6010
|
card: number;
|
|
@@ -5764,7 +6084,7 @@ export declare class Store {
|
|
|
5764
6084
|
lastOutcome?: string;
|
|
5765
6085
|
failures?: number;
|
|
5766
6086
|
hookHash?: string | null;
|
|
5767
|
-
}, now: Date): void;
|
|
6087
|
+
}, now: Date, by?: string): void;
|
|
5768
6088
|
/** Whether a trigger already handled this outside thing (an issue, a run, a schedule slot). */
|
|
5769
6089
|
flowTriggerSaw(trigger: number, key: string): boolean;
|
|
5770
6090
|
/** The card one outside thing made (v89: a chat message, so replies in its thread find it). */
|
|
@@ -5775,7 +6095,48 @@ export declare class Store {
|
|
|
5775
6095
|
* Record what a trigger did with one outside thing: the card it made, or why it made none, and (a standing order's
|
|
5776
6096
|
* firing) the task it filed. False when it was already recorded.
|
|
5777
6097
|
*/
|
|
5778
|
-
recordFlowTriggerEvent(trigger: number, key: string, card: number | null, note: string | null, now: Date, task?: string | null): boolean;
|
|
6098
|
+
recordFlowTriggerEvent(trigger: number, key: string, card: number | null, note: string | null, now: Date, task?: string | null, onTime?: boolean, ranScript?: string | null): boolean;
|
|
6099
|
+
/**
|
|
6100
|
+
* v126: point a trigger at another saved secret ("" for none), and (when given) its new settings, in one write — only
|
|
6101
|
+
* from the secret and settings the caller read, so of two changes at once exactly one lands. False when it changed
|
|
6102
|
+
* meanwhile (or the trigger is gone): the caller then removes only the secret it wrote itself.
|
|
6103
|
+
*/
|
|
6104
|
+
swapFlowHookCredential(id: number, from: {
|
|
6105
|
+
credential: string;
|
|
6106
|
+
configJson: string;
|
|
6107
|
+
hookHash: string | null;
|
|
6108
|
+
}, to: {
|
|
6109
|
+
credential: string;
|
|
6110
|
+
hookHash?: string;
|
|
6111
|
+
}, configJson: string | null, now: Date): boolean;
|
|
6112
|
+
/** v126: what a trigger did with one delivery, or null when it never received it. */
|
|
6113
|
+
flowReceipt(trigger: number, key: string): FlowReceipt | null;
|
|
6114
|
+
/** v126: a delivery received but made no card for: ignored (not for this flow), or held until there's room (its
|
|
6115
|
+
* prepared item kept whole). False when the key was already received. */
|
|
6116
|
+
recordFlowReceipt(trigger: number, key: string, state: "ignored" | "held", note: string | null, itemJson: string | null, now: Date): boolean;
|
|
6117
|
+
/** v126: a held delivery became its card. Only ever from held, in the card's own transaction: false (the caller rolls
|
|
6118
|
+
* the card back) when it is no longer held. */
|
|
6119
|
+
acceptHeldReceipt(trigger: number, key: string, card: number, now: Date): boolean;
|
|
6120
|
+
/** v126: the cards a trigger made since `since`, counted when each was made (a held delivery counts when it became
|
|
6121
|
+
* its card, not when it arrived). A receipt saved before v126 counts at its arrival. */
|
|
6122
|
+
flowCardsAcceptedSince(trigger: number, since: Date): number;
|
|
6123
|
+
/** v126: a trigger's held deliveries, oldest first. */
|
|
6124
|
+
heldFlowReceipts(trigger: number, limit: number): {
|
|
6125
|
+
key: string;
|
|
6126
|
+
itemJson: string;
|
|
6127
|
+
at: string;
|
|
6128
|
+
}[];
|
|
6129
|
+
/** v126: a held delivery that can't become its card (its words no longer pass): left out, with why. */
|
|
6130
|
+
skipHeldReceipt(trigger: number, key: string, note: string): boolean;
|
|
6131
|
+
/** v126: how many deliveries a trigger holds. */
|
|
6132
|
+
heldFlowReceiptCount(trigger: number): number;
|
|
6133
|
+
/** v126: one delivery turned away because the hold queue was full: counted, and since when, until a person clears it. */
|
|
6134
|
+
noteFlowDeliveryDropped(trigger: number, now: Date): void;
|
|
6135
|
+
/** v126: a person has seen the turned-away deliveries. */
|
|
6136
|
+
clearFlowDeliveriesDropped(trigger: number): void;
|
|
6137
|
+
/** v126: whether this hour's "too many" note on a trigger is still to be written: true at most once an hour, claimed
|
|
6138
|
+
* atomically so two deliveries at once write it once. */
|
|
6139
|
+
claimFlowLimitNote(trigger: number, now: Date): boolean;
|
|
5779
6140
|
/** The last card a trigger made, if any. */
|
|
5780
6141
|
lastFlowTriggerCard(trigger: number): number | null;
|
|
5781
6142
|
/**
|
|
@@ -5833,6 +6194,9 @@ export declare class Store {
|
|
|
5833
6194
|
method: string;
|
|
5834
6195
|
paths: number;
|
|
5835
6196
|
}, now: Date): void;
|
|
6197
|
+
/** What one attempt's network was and what its proxy saw (egress.ts), kept beside its fence. */
|
|
6198
|
+
recordRunNetwork(run: number, network: RunNetworkRecord, now: Date): void;
|
|
6199
|
+
runNetwork(run: number): RunNetworkRecord | null;
|
|
5836
6200
|
runFence(run: number): {
|
|
5837
6201
|
method: string;
|
|
5838
6202
|
paths: number;
|
|
@@ -5855,13 +6219,20 @@ export declare class Store {
|
|
|
5855
6219
|
/** `--end` and revocation: the thread's text and every proposal in it are
|
|
5856
6220
|
* deleted; the thread row stays as closed metadata (when, whose). */
|
|
5857
6221
|
closeLeadThreadsFor(approver: string, now: Date): number;
|
|
6222
|
+
/** `pending`: a queued message (personal or team) that waits for its turn — out of the model's history until the
|
|
6223
|
+
* admission that binds it clears the flag in the same statement (v128). */
|
|
5858
6224
|
appendLeadMessage(message: {
|
|
5859
6225
|
thread: number;
|
|
5860
6226
|
turn: number | null;
|
|
5861
6227
|
role: "operator" | "assistant";
|
|
5862
6228
|
text: string;
|
|
5863
6229
|
activity?: string | null;
|
|
6230
|
+
pending?: boolean;
|
|
5864
6231
|
}, now: Date): number;
|
|
6232
|
+
/** The model's history: the last `limit` ADMITTED messages, oldest first — a message still waiting for its turn (or
|
|
6233
|
+
* removed, expired or refused while waiting) is never read back to the lead. An index range scan whatever the backlog
|
|
6234
|
+
* (lead_message_history). People see the whole thread through listLeadMessages. */
|
|
6235
|
+
listLeadHistory(thread: number, limit: number): LeadMessage[];
|
|
5865
6236
|
/** The last `limit` messages, oldest first. */
|
|
5866
6237
|
listLeadMessages(thread: number, limit: number): LeadMessage[];
|
|
5867
6238
|
/** A proposal is inert (`drafting`) until its turn finalizes. */
|
|
@@ -5930,12 +6301,18 @@ export declare class Store {
|
|
|
5930
6301
|
weeklyCeilingMicrousd: number;
|
|
5931
6302
|
deadlineMs: number;
|
|
5932
6303
|
provider?: string;
|
|
6304
|
+
/** The personal queue claim this turn runs (lead-queue.ts): the only admission the backlog lets through. */
|
|
6305
|
+
queueClaim?: {
|
|
6306
|
+
message: number;
|
|
6307
|
+
runner: string;
|
|
6308
|
+
generation: number;
|
|
6309
|
+
};
|
|
5933
6310
|
}, now: Date): {
|
|
5934
6311
|
ok: true;
|
|
5935
6312
|
id: number;
|
|
5936
6313
|
} | {
|
|
5937
6314
|
ok: false;
|
|
5938
|
-
reason: "latched" | "concurrent" | "daily-cap" | "session-exhausted" | "session-ended" | "not-yours" | "thread-closed" | "over-budget" | "monthly-budget";
|
|
6315
|
+
reason: "latched" | "concurrent" | "backlog" | "daily-cap" | "session-exhausted" | "session-ended" | "not-yours" | "thread-closed" | "over-budget" | "monthly-budget";
|
|
5939
6316
|
};
|
|
5940
6317
|
startLeadTurn(id: number, now: Date): {
|
|
5941
6318
|
ok: true;
|
|
@@ -6115,7 +6492,7 @@ export declare class Store {
|
|
|
6115
6492
|
handoff: string | null;
|
|
6116
6493
|
costUsd: number | null;
|
|
6117
6494
|
provider: string | null;
|
|
6118
|
-
authMode: "subscription" | "api-key" | null;
|
|
6495
|
+
authMode: "subscription" | "api-key" | "agent-login" | null;
|
|
6119
6496
|
ranMinutes: number | null;
|
|
6120
6497
|
prNumber: number | null;
|
|
6121
6498
|
prUrl: string | null;
|
|
@@ -6149,7 +6526,7 @@ export declare class Store {
|
|
|
6149
6526
|
startedAt: string;
|
|
6150
6527
|
ranMinutes: number | null;
|
|
6151
6528
|
costUsd: number | null;
|
|
6152
|
-
authMode: "subscription" | "api-key" | null;
|
|
6529
|
+
authMode: "subscription" | "api-key" | "agent-login" | null;
|
|
6153
6530
|
prNumber: number | null;
|
|
6154
6531
|
prUrl: string | null;
|
|
6155
6532
|
}[];
|
|
@@ -6361,6 +6738,8 @@ export declare class Store {
|
|
|
6361
6738
|
* note couldn't be read has stopped. */
|
|
6362
6739
|
private workspaceConfirmedByApprover;
|
|
6363
6740
|
reserveRunProcess(runId: number, now: Date, group?: boolean): number;
|
|
6741
|
+
/** The run's process witnesses not yet proved exited — after first saving whatever exit evidence is available. */
|
|
6742
|
+
openRunProcessCount(runId: number, now: Date): number;
|
|
6364
6743
|
/** Save positive OS exit evidence while it is available, before a numeric
|
|
6365
6744
|
* PID can be reused. Completion, missing ancestry and age prove nothing.
|
|
6366
6745
|
* Existing rows stay intact; only a previously unknown exit is recorded.
|
|
@@ -6458,14 +6837,14 @@ export declare class Store {
|
|
|
6458
6837
|
scope?: string;
|
|
6459
6838
|
reason: string;
|
|
6460
6839
|
resetAt?: Date;
|
|
6461
|
-
authMode?: "subscription" | "api-key";
|
|
6840
|
+
authMode?: "subscription" | "api-key" | "agent-login";
|
|
6462
6841
|
credentialFp?: string;
|
|
6463
6842
|
}, now: Date): void;
|
|
6464
6843
|
/**
|
|
6465
6844
|
* The quota gate's answer, with the lazy exhausted→half-open transition at
|
|
6466
6845
|
* the known reset. Null means no recorded constraint.
|
|
6467
6846
|
*/
|
|
6468
|
-
quotaState(runner: string, provider: string, scope: string, now: Date, authMode?: "subscription" | "api-key", credentialFp?: string): {
|
|
6847
|
+
quotaState(runner: string, provider: string, scope: string, now: Date, authMode?: "subscription" | "api-key" | "agent-login", credentialFp?: string): {
|
|
6469
6848
|
state: "exhausted" | "half-open";
|
|
6470
6849
|
reason: string;
|
|
6471
6850
|
resetAt: string | null;
|
|
@@ -6473,7 +6852,7 @@ export declare class Store {
|
|
|
6473
6852
|
/** Read-only quota observation for status surfaces. A passed reset reads
|
|
6474
6853
|
* half-open, matching quotaState's lazy transition, but this method never
|
|
6475
6854
|
* consumes or changes the probe slot. */
|
|
6476
|
-
readQuotaState(runner: string, provider: string, scope: string, now: Date, authMode?: "subscription" | "api-key", credentialFp?: string): {
|
|
6855
|
+
readQuotaState(runner: string, provider: string, scope: string, now: Date, authMode?: "subscription" | "api-key" | "agent-login", credentialFp?: string): {
|
|
6477
6856
|
state: "exhausted" | "half-open";
|
|
6478
6857
|
reason: string;
|
|
6479
6858
|
resetAt: string | null;
|
|
@@ -6485,9 +6864,9 @@ export declare class Store {
|
|
|
6485
6864
|
* while the probe flies. The probe's success clears the row; the same
|
|
6486
6865
|
* structured signal that stamped it re-stamps on failure.
|
|
6487
6866
|
*/
|
|
6488
|
-
consumeHalfOpen(runner: string, provider: string, scope: string, now: Date, authMode?: "subscription" | "api-key", credentialFp?: string): boolean;
|
|
6867
|
+
consumeHalfOpen(runner: string, provider: string, scope: string, now: Date, authMode?: "subscription" | "api-key" | "agent-login", credentialFp?: string): boolean;
|
|
6489
6868
|
/** A structured all-clear (or an operator's), by name. */
|
|
6490
|
-
clearQuota(runner: string, provider: string, scope: string, authMode?: "subscription" | "api-key", credentialFp?: string): boolean;
|
|
6869
|
+
clearQuota(runner: string, provider: string, scope: string, authMode?: "subscription" | "api-key" | "agent-login", credentialFp?: string): boolean;
|
|
6491
6870
|
/**
|
|
6492
6871
|
* Live claims this runner holds right now — the occupied slots of §8's
|
|
6493
6872
|
* capacity gate.
|
|
@@ -6498,6 +6877,16 @@ export declare class Store {
|
|
|
6498
6877
|
/** Every builder's live attempts, by project: what `status` shows against each project's limit. */
|
|
6499
6878
|
runningBuildsByRepo(now: Date): Map<string, number>;
|
|
6500
6879
|
/** A project's build concurrency changed (project-concurrency.ts): the ledger keeps before → after. */
|
|
6880
|
+
/** A project's network (egress.ts): its saved setting, or the default when none is saved or it doesn't read. */
|
|
6881
|
+
projectNetwork(repo: string): ProjectNetwork;
|
|
6882
|
+
/** An approver changed a project's network: saved, and in the ledger as before → after. */
|
|
6883
|
+
setProjectNetwork(repo: string, network: ProjectNetwork, by: string, now: Date): {
|
|
6884
|
+
before: ProjectNetwork;
|
|
6885
|
+
after: ProjectNetwork;
|
|
6886
|
+
};
|
|
6887
|
+
/** Whether this installation lets an agent run where no OS confinement exists (off unless an operator said so). */
|
|
6888
|
+
unfencedAgentsAllowed(): boolean;
|
|
6889
|
+
setUnfencedAgentsAllowed(allowed: boolean, by: string, now: Date): void;
|
|
6501
6890
|
recordProjectConcurrency(by: string, repo: string, before: number, after: number, now: Date): void;
|
|
6502
6891
|
/** Review 827: a project's demo URL changed (`off` when it has none). */
|
|
6503
6892
|
recordProjectDemo(by: string, repo: string, before: string | null, after: string | null, now: Date): void;
|
|
@@ -6518,6 +6907,7 @@ export declare class Store {
|
|
|
6518
6907
|
advanceBridgeCursor(botId: string, owner: string, generation: number, cursor: number, now: Date): boolean;
|
|
6519
6908
|
markTelegramUpdateApplied(...args: Parameters<ChatMessages["markUpdateApplied"]>): ReturnType<ChatMessages["markUpdateApplied"]>;
|
|
6520
6909
|
enqueueTelegramConversation(...args: Parameters<ChatMessages["enqueueMessage"]>): ReturnType<ChatMessages["enqueueMessage"]>;
|
|
6910
|
+
telegramMessagesWaiting(binding: number): number;
|
|
6521
6911
|
telegramConversationWaitingOn(...args: Parameters<ChatMessages["messageWaitingOn"]>): ReturnType<ChatMessages["messageWaitingOn"]>;
|
|
6522
6912
|
getTelegramConversation(...args: Parameters<ChatMessages["getMessage"]>): ReturnType<ChatMessages["getMessage"]>;
|
|
6523
6913
|
listTelegramConversations(...args: Parameters<ChatMessages["listMessages"]>): ReturnType<ChatMessages["listMessages"]>;
|
|
@@ -6545,6 +6935,7 @@ export declare class Store {
|
|
|
6545
6935
|
telegramRetryAt(botId: string): string;
|
|
6546
6936
|
deferTelegram(botId: string, until: string): void;
|
|
6547
6937
|
telegramDeliveryProblem(...args: Parameters<ChatMessages["deliveryProblem"]>): ReturnType<ChatMessages["deliveryProblem"]>;
|
|
6938
|
+
telegramWatchFence(...args: Parameters<ChatMessages["watchFence"]>): ReturnType<ChatMessages["watchFence"]>;
|
|
6548
6939
|
recordTelegramMessage(...args: Parameters<ChatMessages["recordMessage"]>): ReturnType<ChatMessages["recordMessage"]>;
|
|
6549
6940
|
telegramMessageOf(...args: Parameters<ChatMessages["messageOf"]>): ReturnType<ChatMessages["messageOf"]>;
|
|
6550
6941
|
finalizeTelegramDelivery(...args: Parameters<ChatMessages["finalizeDelivery"]>): ReturnType<ChatMessages["finalizeDelivery"]>;
|
|
@@ -6745,7 +7136,7 @@ export declare class Store {
|
|
|
6745
7136
|
* the subscription live under its enrolled generation, the notification
|
|
6746
7137
|
* unresolved and still stamped. Null = do not transmit.
|
|
6747
7138
|
*/
|
|
6748
|
-
pushSendFence(id: number, owner: string, generation: number): (PushPair & {
|
|
7139
|
+
pushSendFence(id: number, owner: string, generation: number, now?: Date): (PushPair & {
|
|
6749
7140
|
subscriptionRow: PushSubscription;
|
|
6750
7141
|
notificationRow: Notification;
|
|
6751
7142
|
}) | null;
|
|
@@ -6790,6 +7181,62 @@ export declare class Store {
|
|
|
6790
7181
|
*/
|
|
6791
7182
|
replay<T>(mutation: Mutation, operation: string, body: () => T, worthRecording?: (result: T) => boolean): T;
|
|
6792
7183
|
private once;
|
|
7184
|
+
/** A kept web session's changes: never inserts, so a session ended elsewhere is not brought back by a cached copy.
|
|
7185
|
+
* False when it is gone. (Kept last in the class: the freshness tripwire pins method positions.) */
|
|
7186
|
+
updateWebSession(session: Pick<WebSessionRow, "idHash" | "lastSeen" | "project" | "projectRevision" | "ssoAt">): boolean;
|
|
7187
|
+
/** A new sweep record (inside the caller's filing transaction). */
|
|
7188
|
+
createSweep(input: {
|
|
7189
|
+
owner: string;
|
|
7190
|
+
thread: number | null;
|
|
7191
|
+
repo: string;
|
|
7192
|
+
title: string;
|
|
7193
|
+
brief: string;
|
|
7194
|
+
maxParallel: number;
|
|
7195
|
+
proposal: number | null;
|
|
7196
|
+
}, now: Date): number;
|
|
7197
|
+
/** Link one filed child (its family root) to its sweep, in order. */
|
|
7198
|
+
addSweepTask(sweep: number, rootTask: string, ordinal: number, label: string): void;
|
|
7199
|
+
getSweep(id: number): {
|
|
7200
|
+
id: number;
|
|
7201
|
+
owner: string;
|
|
7202
|
+
thread: number | null;
|
|
7203
|
+
repo: string;
|
|
7204
|
+
title: string;
|
|
7205
|
+
brief: string;
|
|
7206
|
+
maxParallel: number;
|
|
7207
|
+
proposal: number | null;
|
|
7208
|
+
createdAt: string;
|
|
7209
|
+
} | null;
|
|
7210
|
+
/** The sweep a proposal filed, if it did (a replayed confirm finds it). */
|
|
7211
|
+
sweepOfProposal(proposal: number): number | null;
|
|
7212
|
+
/** A sweep's children, in order: each one's family root and its label. */
|
|
7213
|
+
sweepTasks(sweep: number): {
|
|
7214
|
+
rootTask: string;
|
|
7215
|
+
ordinal: number;
|
|
7216
|
+
label: string;
|
|
7217
|
+
}[];
|
|
7218
|
+
/** The sweep a task belongs to through its family root (a revision of a child belongs too), or null. */
|
|
7219
|
+
sweepOfTask(taskId: string): {
|
|
7220
|
+
id: number;
|
|
7221
|
+
maxParallel: number;
|
|
7222
|
+
} | null;
|
|
7223
|
+
/**
|
|
7224
|
+
* How many of a sweep's families hold a live claim now (the latest lease of any task in the family, unreleased and
|
|
7225
|
+
* unexpired, across every runner) — claimed-but-not-started counts. `except` leaves one task_ref out (the one being
|
|
7226
|
+
* claimed). Read inside acquire's own write transaction, so two runners can't both take the last slot.
|
|
7227
|
+
*/
|
|
7228
|
+
sweepLiveClaims(sweep: number, stamp: string, except?: number | null): number;
|
|
7229
|
+
/** Whether a request of this lead turn ended with its cost unknown and that cost is still unconfirmed — the turn is
|
|
7230
|
+
* what keeps chat paused on its credential. Once confirmed, it no longer is. */
|
|
7231
|
+
leadTurnCostUnconfirmed(leadTurn: number): boolean;
|
|
7232
|
+
/** The lead turn a chat step belongs to (a lead reply's request), or null for a standalone chat turn. */
|
|
7233
|
+
leadTurnOfStep(step: number): LeadTurn | null;
|
|
7234
|
+
/** A waiting message that will never run keeps nothing of what it said (v128 lead queue): its words, the context it was
|
|
7235
|
+
* sent with, and any copy the memory search made of it. Only while it is still pending — a message a turn took stays. */
|
|
7236
|
+
/** Whether a send of this session reached the plane: the engine took it, or the lead queue holds it (waiting, run,
|
|
7237
|
+
* removed or expired — any of those means the composer's draft was accepted and must not be sent again). */
|
|
7238
|
+
leadRequestReceived(session: number, request: string): boolean;
|
|
7239
|
+
forgetQueuedLeadMessage(message: number): void;
|
|
6793
7240
|
}
|
|
6794
7241
|
/** The receipt a bot's first pairing writes over pre-pairing history: an
|
|
6795
7242
|
* explicit skip, with no delivered timestamp and no attempt, so suppressed
|