toolroll 0.9.55 → 0.9.57
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 +18 -0
- package/README.md +24 -8
- package/dist/action-ledger.d.ts +2 -4
- package/dist/action-ledger.js +2 -10
- package/dist/approval-policy.d.ts +5 -5
- package/dist/approval-policy.js +4 -4
- package/dist/approval-rules-ui.js +2 -2
- package/dist/assignment-adapters.d.ts +5 -0
- package/dist/assignment.d.ts +24 -3
- package/dist/assignment.js +36 -10
- package/dist/browser/workspace.js +5 -5
- package/dist/browser-workspace.d.ts +12 -12
- package/dist/browser-workspace.js +1 -1
- package/dist/budget-alerts.js +3 -3
- package/dist/chat-actions.d.ts +23 -18
- package/dist/chat-actions.js +110 -88
- package/dist/chat-ask.d.ts +2 -2
- package/dist/chat-ask.js +5 -5
- package/dist/chat-channel.d.ts +15 -15
- package/dist/chat-channel.js +20 -20
- package/dist/chat-controls.d.ts +0 -4
- package/dist/chat-controls.js +0 -1
- package/dist/chat-core.js +1 -1
- package/dist/chat-delivery-state.js +2 -2
- package/dist/chat-delivery.d.ts +2 -2
- package/dist/chat-delivery.js +30 -37
- package/dist/chat-flow.js +3 -3
- package/dist/chat-messages.d.ts +1 -1
- package/dist/chat-messages.js +4 -4
- package/dist/chat-migration.d.ts +1 -1
- package/dist/chat-migration.js +11 -11
- package/dist/chat-rooms.js +3 -3
- package/dist/chat-voice.js +1 -1
- package/dist/chat-warmth.d.ts +2 -2
- package/dist/check-levels.d.ts +3 -0
- package/dist/check-levels.js +5 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +6 -7
- package/dist/contracts/chat-actions.d.ts +32 -27
- package/dist/contracts/chat-actions.js +29 -11
- package/dist/contracts/chat-content.d.ts +1 -1
- package/dist/contracts/chat-content.js +1 -1
- package/dist/contracts/chat-tables.js +4 -4
- package/dist/contracts/console-api.d.ts +6 -6
- package/dist/contracts/console-api.js +7 -7
- package/dist/contracts/flow-propose.d.ts +3 -3
- package/dist/contracts/flow.d.ts +132 -125
- package/dist/contracts/flow.js +27 -12
- package/dist/contracts/lead-context.d.ts +1 -1
- package/dist/contracts/lead-context.js +2 -2
- package/dist/contracts/lead-tools.d.ts +20 -18
- package/dist/contracts/lead-tools.js +15 -15
- package/dist/contracts/stage-output.d.ts +1 -1
- package/dist/contracts/stage-output.js +1 -1
- package/dist/contracts/store-json.d.ts +23 -22
- package/dist/contracts/store-json.js +17 -17
- package/dist/contracts/{teammate-turn.d.ts → subagent-turn.d.ts} +5 -5
- package/dist/contracts/{teammate-turn.js → subagent-turn.js} +7 -7
- package/dist/converse.d.ts +23 -23
- package/dist/converse.js +28 -28
- package/dist/coordinator-proposals.d.ts +2 -2
- package/dist/coordinator-proposals.js +1 -1
- package/dist/coordinator.js +1 -1
- package/dist/deprecations.d.ts +12 -0
- package/dist/deprecations.js +20 -0
- package/dist/desktop-update-gate.js +8 -4
- package/dist/desktop-update.js +6 -1
- package/dist/discord-chat.js +6 -6
- package/dist/dispatch.d.ts +1 -1
- package/dist/dispatch.js +1 -1
- package/dist/dispose.js +0 -5
- package/dist/envelope.js +0 -1
- package/dist/export-ui.js +1 -1
- package/dist/export.js +7 -7
- package/dist/flow-engine.d.ts +2 -2
- package/dist/flow-engine.js +21 -21
- package/dist/flow-insights.d.ts +1 -1
- package/dist/flow-share.js +13 -8
- package/dist/flow-steps.d.ts +5 -5
- package/dist/flow-steps.js +19 -19
- package/dist/flow-triggers.d.ts +1 -1
- package/dist/flow-triggers.js +1 -1
- package/dist/flows-cli.js +1 -1
- package/dist/flows-ui.js +20 -20
- package/dist/flows.js +19 -19
- package/dist/guides.js +4 -3
- package/dist/invoke.js +1 -1
- package/dist/kits-ui.js +5 -5
- package/dist/kits.d.ts +12 -12
- package/dist/kits.js +31 -31
- package/dist/{mate-cli.d.ts → lead-cli.d.ts} +11 -11
- package/dist/{mate-cli.js → lead-cli.js} +38 -38
- package/dist/lead-commitments.js +4 -4
- package/dist/lead-context.d.ts +2 -2
- package/dist/lead-context.js +9 -9
- package/dist/{mate-contract.d.ts → lead-contract.d.ts} +3 -3
- package/dist/{mate-contract.js → lead-contract.js} +7 -6
- package/dist/{mate-doors.d.ts → lead-doors.d.ts} +6 -6
- package/dist/{mate-doors.js → lead-doors.js} +24 -24
- package/dist/lead-follow.d.ts +5 -5
- package/dist/lead-follow.js +9 -9
- package/dist/lead-people.d.ts +5 -5
- package/dist/lead-people.js +14 -14
- package/dist/{mate-progress.d.ts → lead-progress.d.ts} +9 -9
- package/dist/{mate-progress.js → lead-progress.js} +3 -3
- package/dist/lead-status.d.ts +1 -1
- package/dist/lead-status.js +2 -2
- package/dist/{mate-tools.d.ts → lead-tools.d.ts} +19 -19
- package/dist/{mate-tools.js → lead-tools.js} +109 -101
- package/dist/{mate.d.ts → lead.d.ts} +27 -27
- package/dist/{mate.js → lead.js} +102 -102
- package/dist/limits-ui.d.ts +1 -1
- package/dist/limits-ui.js +1 -1
- package/dist/mcp-connect.d.ts +1 -1
- package/dist/mcp-connect.js +3 -3
- package/dist/mcp-core.js +1 -1
- package/dist/memory-pass.d.ts +2 -2
- package/dist/memory-pass.js +7 -7
- package/dist/notification-rows.d.ts +2 -2
- package/dist/operate.d.ts +3 -3
- package/dist/operate.js +52 -42
- package/dist/policy.d.ts +1 -1
- package/dist/principal.d.ts +1 -1
- package/dist/principal.js +2 -2
- package/dist/project-delete-ui.js +1 -1
- package/dist/project-delete.d.ts +1 -1
- package/dist/project-delete.js +26 -26
- package/dist/project-memory.js +1 -1
- package/dist/project-tools.d.ts +1 -1
- package/dist/project-tools.js +1 -1
- package/dist/proof.d.ts +9 -0
- package/dist/proof.js +12 -0
- package/dist/recipe-ui.js +1 -1
- package/dist/release-coverage.d.ts +16 -0
- package/dist/release-coverage.js +92 -0
- package/dist/retention.js +4 -4
- package/dist/scope.d.ts +2 -2
- package/dist/scout-report.d.ts +1 -1
- package/dist/scout-report.js +1 -1
- package/dist/serve.js +40 -45
- package/dist/server/chat.d.ts +4 -4
- package/dist/server/chat.js +105 -103
- package/dist/server/chrome.js +3 -3
- package/dist/server/flows.js +69 -62
- package/dist/server/guards.js +3 -3
- package/dist/server/http.d.ts +3 -3
- package/dist/server/http.js +1 -1
- package/dist/server/live.js +6 -6
- package/dist/server/people-tokens.js +1 -1
- package/dist/server/remote.js +12 -10
- package/dist/server/render-chat.d.ts +30 -30
- package/dist/server/render-chat.js +33 -33
- package/dist/server/render-pages.js +2 -2
- package/dist/server/render-results.d.ts +4 -1
- package/dist/server/render-results.js +23 -9
- package/dist/server/render-settings.d.ts +7 -0
- package/dist/server/render-settings.js +3 -0
- package/dist/server/route-table.js +9 -7
- package/dist/server/runtime.d.ts +13 -13
- package/dist/server/settings.js +14 -13
- package/dist/server/tasks.js +34 -30
- package/dist/setup-guide.d.ts +2 -2
- package/dist/slack-chat.d.ts +2 -2
- package/dist/slack-chat.js +6 -6
- package/dist/spend-ui.d.ts +3 -3
- package/dist/spend-ui.js +9 -9
- package/dist/spend.d.ts +14 -14
- package/dist/spend.js +31 -31
- package/dist/store-baseline.d.ts +19 -0
- package/dist/store-baseline.js +2873 -0
- package/dist/store.d.ts +200 -254
- package/dist/store.js +830 -3152
- package/dist/subagent-admin.d.ts +53 -0
- package/dist/{teammate-admin.js → subagent-admin.js} +37 -37
- package/dist/{teammate-desk.d.ts → subagent-desk.d.ts} +22 -23
- package/dist/{teammate-desk.js → subagent-desk.js} +26 -35
- package/dist/{teammate-memory.d.ts → subagent-memory.d.ts} +17 -17
- package/dist/{teammate-memory.js → subagent-memory.js} +41 -41
- package/dist/{teammate-question.d.ts → subagent-question.d.ts} +6 -6
- package/dist/{teammate-question.js → subagent-question.js} +17 -17
- package/dist/{teammate-tools.d.ts → subagent-tools.d.ts} +18 -18
- package/dist/{teammate-tools.js → subagent-tools.js} +36 -36
- package/dist/{teammate-week.d.ts → subagent-week.d.ts} +10 -10
- package/dist/{teammate-week.js → subagent-week.js} +23 -23
- package/dist/{teammate-work.d.ts → subagent-work.d.ts} +21 -21
- package/dist/{teammate-work.js → subagent-work.js} +50 -50
- package/dist/subagents-ui.d.ts +22 -0
- package/dist/{teammates-ui.js → subagents-ui.js} +45 -45
- package/dist/{teammates.d.ts → subagents.d.ts} +11 -11
- package/dist/{teammates.js → subagents.js} +21 -21
- package/dist/subscription-chat.d.ts +13 -13
- package/dist/subscription-chat.js +19 -19
- package/dist/surface.d.ts +19 -2
- package/dist/surface.js +7 -31
- package/dist/task-outcome-cli.js +3 -1
- package/dist/task-status.d.ts +59 -7
- package/dist/task-status.js +132 -16
- package/dist/team-cli.d.ts +1 -0
- package/dist/team-cli.js +14 -2
- package/dist/team-leads.js +13 -13
- package/dist/team-runtime.d.ts +2 -2
- package/dist/team-runtime.js +9 -9
- package/dist/teams-chat.js +6 -6
- package/dist/telegram-flow.d.ts +3 -3
- package/dist/telegram-flow.js +3 -3
- package/dist/{telegram-mate.d.ts → telegram-lead.d.ts} +5 -5
- package/dist/{telegram-mate.js → telegram-lead.js} +27 -27
- package/dist/telegram-status.d.ts +11 -4
- package/dist/telegram-status.js +18 -11
- package/dist/telegram-team.d.ts +1 -1
- package/dist/telegram-team.js +5 -5
- package/dist/telegram.d.ts +1 -1
- package/dist/telegram.js +13 -34
- package/dist/text-limits.d.ts +18 -18
- package/dist/text-limits.js +18 -18
- package/dist/toolroll-update.d.ts +8 -0
- package/dist/toolroll-update.js +45 -8
- package/dist/work-index.d.ts +6 -1
- package/dist/work-index.js +50 -8
- package/dist/workspace-ui.js +2 -1
- package/package.json +1 -2
- package/dist/teammate-admin.d.ts +0 -53
- package/dist/teammates-ui.d.ts +0 -21
package/dist/store.d.ts
CHANGED
|
@@ -32,9 +32,9 @@ import { type LedgerChainReport } from "./ledger-chain.js";
|
|
|
32
32
|
import { type ApprovalGate, type ApprovalRules, type ApproverKind, type Filer } from "./approval-policy.js";
|
|
33
33
|
/** A lead reply stopped at its deadline, in the thread as plain words: what happened, what it means, one next step. The
|
|
34
34
|
* proposals it made before then are kept; the cost line only when an unknown cost paused chat. */
|
|
35
|
-
export declare function
|
|
35
|
+
export declare function leadTimeoutNotice(keptProposals: boolean, unknownCost?: boolean): string;
|
|
36
36
|
/** Whether a turn's proposals stand: it answered, or it stopped at its deadline after its completed tool calls proposed them. */
|
|
37
|
-
export declare function
|
|
37
|
+
export declare function leadTurnKeepsProposals(turn: {
|
|
38
38
|
state: string;
|
|
39
39
|
failureReason: string | null;
|
|
40
40
|
} | null): boolean;
|
|
@@ -63,7 +63,7 @@ export type TaskActRow = {
|
|
|
63
63
|
/** The lead's one question to its owner (no version bump): at most one per answered turn, two to four short options;
|
|
64
64
|
* "Something else" is implied. The tapped option comes back as the owner's next message, so nothing here is an answer:
|
|
65
65
|
* a question is open while no later message from the owner sits in its thread. */
|
|
66
|
-
export declare const
|
|
66
|
+
export declare const LEAD_ASK_SCHEMA = "\nCREATE TABLE IF NOT EXISTS lead_ask (\n turn INTEGER PRIMARY KEY REFERENCES mate_turn(id) ON DELETE CASCADE,\n thread INTEGER NOT NULL REFERENCES lead_thread(id) ON DELETE CASCADE,\n question TEXT NOT NULL,\n options_json TEXT NOT NULL,\n created_at TEXT NOT NULL\n);\nCREATE INDEX IF NOT EXISTS lead_ask_thread ON lead_ask (thread, turn);\n";
|
|
67
67
|
/** Decisions in the chat app (chat-decide.ts; no version bump: additive only). A token names one act on one card (the chat and message it rides); `digest` is
|
|
68
68
|
* what the card showed — a receipt, a revision source, a task stamp, a plan or a commit. */
|
|
69
69
|
/** A flow's "Send to me" and "Person chooses" zones (no version bump: additive only). flow_send keeps what one visit sent its
|
|
@@ -80,16 +80,16 @@ export declare const FLOW_SEND_SCHEMA = "\nCREATE TABLE IF NOT EXISTS flow_send
|
|
|
80
80
|
export declare const RUN_ACTIVITY_SCHEMA = "\nCREATE TABLE IF NOT EXISTS run_activity (\n run INTEGER PRIMARY KEY REFERENCES run(id) ON DELETE CASCADE,\n kind TEXT NOT NULL CHECK (kind IN ('session','message','edit','command','read','search','lookup','plan','delegate','tool')),\n at TEXT NOT NULL\n);\n";
|
|
81
81
|
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";
|
|
82
82
|
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";
|
|
83
|
-
export type
|
|
83
|
+
export type LeadAsk = {
|
|
84
84
|
turn: number;
|
|
85
85
|
thread: number;
|
|
86
86
|
question: string;
|
|
87
87
|
options: string[];
|
|
88
88
|
createdAt: string;
|
|
89
89
|
};
|
|
90
|
-
export declare const
|
|
90
|
+
export declare const LEAD_ASK_OTHER = "Something else";
|
|
91
91
|
/** How long the question's buttons work, on every channel. */
|
|
92
|
-
export declare const
|
|
92
|
+
export declare const LEAD_ASK_TTL_MS: number;
|
|
93
93
|
/** What a turn the lead starts itself for automatic crew updates says in the owner's place (lead-follow.ts): never their answer. */
|
|
94
94
|
export declare const LEAD_FOLLOW_MESSAGE = "Automatic crew update: inspect the saved results or decisions and tell me what needs attention. Do not rerun work.";
|
|
95
95
|
/** Settings → Integrations (no version bump): each integration's last check. `outcome` is ok, failed, or absent (the check found
|
|
@@ -152,7 +152,14 @@ export type SealedLedgerEntry = LedgerEntry & {
|
|
|
152
152
|
hash: string;
|
|
153
153
|
} | null;
|
|
154
154
|
};
|
|
155
|
-
export declare const SCHEMA_VERSION =
|
|
155
|
+
export declare const SCHEMA_VERSION = 117;
|
|
156
|
+
/** v117: each table renamed, by its old name. Rows, ids, foreign keys and indexes go with it (renameForV117). */
|
|
157
|
+
export declare const V117_RENAMED_TABLES: Readonly<Record<string, string>>;
|
|
158
|
+
/** v117: the columns renamed with them (by the table's new name): a subagent's rows name it `subagent`. */
|
|
159
|
+
export declare const V117_RENAMED_COLUMNS: readonly (readonly [table: string, from: string, to: string])[];
|
|
160
|
+
/** A row `PRAGMA foreign_key_check` reports, by today's table names: a row already pointing nowhere before v117 is the
|
|
161
|
+
* same row after it, though RENAME now reports it (and what it points at) under the new names. */
|
|
162
|
+
export declare function orphanKey(row: Record<string, unknown>): string;
|
|
156
163
|
/** v115: the tables migrateToV115 drops. */
|
|
157
164
|
export declare const V115_DROPPED_TABLES: readonly string[];
|
|
158
165
|
/**
|
|
@@ -163,6 +170,8 @@ export declare const V115_DROPPED_TABLES: readonly string[];
|
|
|
163
170
|
* needs the separate verified migration procedure. The desktop update never
|
|
164
171
|
* migrates and does not read this list.
|
|
165
172
|
*
|
|
173
|
+
* v108 only adds provider_auth_pause; v109 only adds task_ref.auth_wait_pause,
|
|
174
|
+
* so a database at the v107 baseline (0.5.0) takes the same update.
|
|
166
175
|
* v110 rebuilds action_ledger only to widen its source check ('api', 'mcp'):
|
|
167
176
|
* every row, id and hash-chain link is copied unchanged. v111 adds nullable
|
|
168
177
|
* api_token columns (project limit, rotation); existing tokens read as before.
|
|
@@ -183,7 +192,9 @@ export declare const V115_DROPPED_TABLES: readonly string[];
|
|
|
183
192
|
* separate procedure. v116 is the next declared exception: every row of the 70 old
|
|
184
193
|
* per-app chat tables moves into the shared chat tables keyed by provider, in one
|
|
185
194
|
* transaction that checks each count before the old tables are dropped; the
|
|
186
|
-
* rehearsal checks each moved table's rows arrived (HISTORY_RULES).
|
|
195
|
+
* rehearsal checks each moved table's rows arrived (HISTORY_RULES). v117 renames the mate's tables to the lead's and the
|
|
196
|
+
* teammates' to its subagents' (SQLite's RENAME, every row, id and link carried), renames their teammate column, and rewrites four internal kinds from 'teammate' to 'subagent' in place; the rehearsal checks
|
|
197
|
+
* each renamed table's rows arrived under its new name.
|
|
187
198
|
*/
|
|
188
199
|
export declare const UPDATE_SAFE_MIGRATIONS: readonly number[];
|
|
189
200
|
/** Whether a database settled at `version` reaches this build's schema through update-safe migrations alone. */
|
|
@@ -455,11 +466,11 @@ export type ChatTurn = {
|
|
|
455
466
|
acknowledgedBy: string | null;
|
|
456
467
|
replyBytes: number | null;
|
|
457
468
|
candidateCount: number | null;
|
|
458
|
-
/** 'chat' = fleet chat v13, one request; 'mate-step' = one request of a
|
|
469
|
+
/** 'chat' = fleet chat v13, one request; 'mate-step' = one request of a lead turn. */
|
|
459
470
|
kind: "chat" | "mate-step";
|
|
460
|
-
|
|
471
|
+
leadTurn: number | null;
|
|
461
472
|
};
|
|
462
|
-
export type
|
|
473
|
+
export type LeadSession = {
|
|
463
474
|
id: number;
|
|
464
475
|
approver: string;
|
|
465
476
|
approverGeneration: number;
|
|
@@ -474,7 +485,7 @@ export type MateSession = {
|
|
|
474
485
|
};
|
|
475
486
|
/** What one lead thread is about (v77): the lead conversation across every
|
|
476
487
|
* project, one project, or one task (keyed by its root id). */
|
|
477
|
-
export type
|
|
488
|
+
export type LeadThreadScope = {
|
|
478
489
|
kind: "lead";
|
|
479
490
|
} | {
|
|
480
491
|
kind: "project";
|
|
@@ -483,23 +494,23 @@ export type MateThreadScope = {
|
|
|
483
494
|
kind: "task";
|
|
484
495
|
key: string;
|
|
485
496
|
};
|
|
486
|
-
export declare const LEAD_THREAD:
|
|
487
|
-
export type
|
|
497
|
+
export declare const LEAD_THREAD: LeadThreadScope;
|
|
498
|
+
export type LeadThread = {
|
|
488
499
|
id: number;
|
|
489
500
|
approver: string;
|
|
490
501
|
ceilingDigest: string;
|
|
491
502
|
openedAt: string;
|
|
492
503
|
lastTurnAt: string | null;
|
|
493
504
|
closedAt: string | null;
|
|
494
|
-
scope:
|
|
505
|
+
scope: LeadThreadScope;
|
|
495
506
|
};
|
|
496
507
|
/** A thread as the chat list shows it: its scope and its latest message. */
|
|
497
|
-
export type
|
|
508
|
+
export type LeadThreadSummary = LeadThread & {
|
|
498
509
|
lastMessageAt: string | null;
|
|
499
510
|
lastMessage: string | null;
|
|
500
511
|
messages: number;
|
|
501
512
|
};
|
|
502
|
-
export type
|
|
513
|
+
export type LeadMessage = {
|
|
503
514
|
id: number;
|
|
504
515
|
thread: number;
|
|
505
516
|
turn: number | null;
|
|
@@ -508,9 +519,9 @@ export type MateMessage = {
|
|
|
508
519
|
activity: string | null;
|
|
509
520
|
createdAt: string;
|
|
510
521
|
};
|
|
511
|
-
export type
|
|
522
|
+
export type LeadProposalKind = "task" | "next" | "reserve" | "hold" | "unhold" | "steer" | "scope" | "cancel" | "answer" | "repair" | "agents" | "review" | "control" | "task_action" | "action";
|
|
512
523
|
/** A coordinator's proposal over the MCP gateway (mate arc v3): the same
|
|
513
|
-
* kinds as the
|
|
524
|
+
* kinds as the lead's (no `task` — filing has its own door), confirmed by
|
|
514
525
|
* any approver whose ceiling admits the repo. */
|
|
515
526
|
export type CoordinatorProposalKind = "next" | "reserve" | "hold" | "unhold" | "scope" | "cancel" | "answer";
|
|
516
527
|
export type CoordinatorProposalState = "pending" | "confirming" | "confirmed" | "refused" | "dismissed" | "expired";
|
|
@@ -528,24 +539,24 @@ export type CoordinatorProposal = {
|
|
|
528
539
|
resolvedBy: string | null;
|
|
529
540
|
outcome: Record<string, unknown> | null;
|
|
530
541
|
};
|
|
531
|
-
export type
|
|
532
|
-
export type
|
|
542
|
+
export type LeadProposalState = "drafting" | "pending" | "confirming" | "confirmed" | "refused" | "dismissed" | "expired";
|
|
543
|
+
export type LeadProposal = {
|
|
533
544
|
id: number;
|
|
534
545
|
thread: number;
|
|
535
546
|
turn: number;
|
|
536
|
-
kind:
|
|
547
|
+
kind: LeadProposalKind;
|
|
537
548
|
payload: Record<string, unknown>;
|
|
538
549
|
ceilingDigest: string;
|
|
539
|
-
state:
|
|
550
|
+
state: LeadProposalState;
|
|
540
551
|
createdAt: string;
|
|
541
552
|
resolvedAt: string | null;
|
|
542
553
|
resolvedBy: string | null;
|
|
543
554
|
outcome: Record<string, unknown> | null;
|
|
544
555
|
};
|
|
545
556
|
/** The zones a worker's step pass runs, one run per visit. */
|
|
546
|
-
export type FlowStepKind = "check" | "update" | "sort" | "draft" | "request" | "email" | "tool" | "
|
|
547
|
-
/**
|
|
548
|
-
export type
|
|
557
|
+
export type FlowStepKind = "check" | "update" | "sort" | "draft" | "request" | "email" | "tool" | "subagent";
|
|
558
|
+
/** A subagent (v92): who it is lives in its soul file; `handle` is how zones and chat name it. */
|
|
559
|
+
export type SubagentRow = {
|
|
549
560
|
id: number;
|
|
550
561
|
repo: string;
|
|
551
562
|
handle: string;
|
|
@@ -565,21 +576,21 @@ export type TeammateRow = {
|
|
|
565
576
|
/** v97: when its last weekly report went out. */
|
|
566
577
|
weeklyAt: string | null;
|
|
567
578
|
};
|
|
568
|
-
export type
|
|
569
|
-
export type
|
|
579
|
+
export type SubagentEventKind = "decided" | "handled" | "handed" | "asked" | "answered" | "note" | "paused" | "resumed" | "summary" | "failed";
|
|
580
|
+
export type SubagentEventRow = {
|
|
570
581
|
id: number;
|
|
571
|
-
|
|
582
|
+
subagent: number;
|
|
572
583
|
card: number | null;
|
|
573
584
|
entry: number | null;
|
|
574
|
-
kind:
|
|
585
|
+
kind: SubagentEventKind;
|
|
575
586
|
said: string;
|
|
576
587
|
detail: Record<string, unknown> | null;
|
|
577
588
|
by: string | null;
|
|
578
589
|
at: string;
|
|
579
590
|
};
|
|
580
|
-
export type
|
|
591
|
+
export type SubagentQuestionRow = {
|
|
581
592
|
id: number;
|
|
582
|
-
|
|
593
|
+
subagent: number;
|
|
583
594
|
card: number;
|
|
584
595
|
entry: number;
|
|
585
596
|
question: string;
|
|
@@ -595,17 +606,17 @@ export type TeammateQuestionRow = {
|
|
|
595
606
|
answeredVia: string | null;
|
|
596
607
|
answeredAt: string | null;
|
|
597
608
|
createdAt: string;
|
|
598
|
-
/** v94: the ask-first tool call this question approves (null: a question of the
|
|
609
|
+
/** v94: the ask-first tool call this question approves (null: a question of the subagent's own). */
|
|
599
610
|
toolCall: number | null;
|
|
600
611
|
/** v95: the rule change this question offers its manager (null: not one). */
|
|
601
612
|
suggestion: number | null;
|
|
602
613
|
};
|
|
603
|
-
/** v95: one thing a
|
|
604
|
-
export type
|
|
614
|
+
/** v95: one thing a subagent remembers: kept by it on a turn, or told it by a person. */
|
|
615
|
+
export type SubagentMemoryRow = {
|
|
605
616
|
id: number;
|
|
606
|
-
|
|
617
|
+
subagent: number;
|
|
607
618
|
text: string;
|
|
608
|
-
source: "
|
|
619
|
+
source: "subagent" | "person";
|
|
609
620
|
card: number | null;
|
|
610
621
|
createdBy: string;
|
|
611
622
|
createdAt: string;
|
|
@@ -613,10 +624,10 @@ export type TeammateMemoryRow = {
|
|
|
613
624
|
updatedAt: string;
|
|
614
625
|
usedAt: string | null;
|
|
615
626
|
};
|
|
616
|
-
/** v95: a rule change a
|
|
617
|
-
export type
|
|
627
|
+
/** v95: a rule change a subagent suggests from what its people approved. */
|
|
628
|
+
export type SubagentSuggestionRow = {
|
|
618
629
|
id: number;
|
|
619
|
-
|
|
630
|
+
subagent: number;
|
|
620
631
|
tool: string;
|
|
621
632
|
action: string;
|
|
622
633
|
rule: ToolRule;
|
|
@@ -630,10 +641,10 @@ export type TeammateSuggestionRow = {
|
|
|
630
641
|
};
|
|
631
642
|
/** v94: one action a project tool offers, as it described itself when listed. */
|
|
632
643
|
export type ToolActionInfo = SavedToolAction;
|
|
633
|
-
/** v94: a
|
|
644
|
+
/** v94: a subagent's rule for one action: do it, ask first, or never; "free" may ask first above a number in its input. */
|
|
634
645
|
export type ToolRule = SavedToolRule;
|
|
635
|
-
export type
|
|
636
|
-
|
|
646
|
+
export type SubagentGrantRow = {
|
|
647
|
+
subagent: number;
|
|
637
648
|
tool: string;
|
|
638
649
|
actions: ToolActionInfo[];
|
|
639
650
|
rules: Record<string, ToolRule>;
|
|
@@ -641,11 +652,11 @@ export type TeammateGrantRow = {
|
|
|
641
652
|
updatedBy: string;
|
|
642
653
|
updatedAt: string;
|
|
643
654
|
};
|
|
644
|
-
export type
|
|
645
|
-
/** v94: a tool call a
|
|
646
|
-
export type
|
|
655
|
+
export type SubagentCallState = "asked" | "approved" | "denied" | "refused" | "running" | "done" | "failed";
|
|
656
|
+
/** v94: a tool call a subagent made, or asked to make, on one visit of a card: the receipt. */
|
|
657
|
+
export type SubagentCallRow = {
|
|
647
658
|
id: number;
|
|
648
|
-
|
|
659
|
+
subagent: number;
|
|
649
660
|
card: number;
|
|
650
661
|
entry: number;
|
|
651
662
|
tool: string;
|
|
@@ -653,7 +664,7 @@ export type TeammateCallRow = {
|
|
|
653
664
|
input: Record<string, unknown>;
|
|
654
665
|
rule: ToolRule["use"];
|
|
655
666
|
why: string;
|
|
656
|
-
state:
|
|
667
|
+
state: SubagentCallState;
|
|
657
668
|
result: string | null;
|
|
658
669
|
decidedBy: string | null;
|
|
659
670
|
decidedAt: string | null;
|
|
@@ -664,10 +675,10 @@ export type TeammateCallRow = {
|
|
|
664
675
|
undoneBy: string | null;
|
|
665
676
|
undoneAt: string | null;
|
|
666
677
|
};
|
|
667
|
-
/** v97: one model turn a
|
|
668
|
-
export type
|
|
678
|
+
/** v97: one model turn a subagent took. */
|
|
679
|
+
export type SubagentTurnRow = {
|
|
669
680
|
id: number;
|
|
670
|
-
|
|
681
|
+
subagent: number;
|
|
671
682
|
card: number | null;
|
|
672
683
|
model: string;
|
|
673
684
|
ok: boolean;
|
|
@@ -781,7 +792,7 @@ export type FlowTriggerRow = {
|
|
|
781
792
|
updatedAt: string;
|
|
782
793
|
};
|
|
783
794
|
export type FlowEventOutcome = "created" | "ok" | "fail" | "moved" | "approved" | "sent-back" | "cancelled";
|
|
784
|
-
export type
|
|
795
|
+
export type LeadTurn = {
|
|
785
796
|
id: number;
|
|
786
797
|
approver: string;
|
|
787
798
|
session: number;
|
|
@@ -1328,7 +1339,7 @@ export type TelegramConversation = {
|
|
|
1328
1339
|
updateId: number;
|
|
1329
1340
|
messageId: string;
|
|
1330
1341
|
replyTo: string | null;
|
|
1331
|
-
/** The
|
|
1342
|
+
/** The lead request receipt identity: 32 hex, derived from bot, binding and update. */
|
|
1332
1343
|
request: string;
|
|
1333
1344
|
text: string;
|
|
1334
1345
|
/** Server-authored context for the turn — the exact task/result a reply bound to. */
|
|
@@ -1401,8 +1412,8 @@ export type TelegramConversationPartPlan = {
|
|
|
1401
1412
|
artifact: number;
|
|
1402
1413
|
sha256: string;
|
|
1403
1414
|
};
|
|
1404
|
-
/** One verified screenshot a
|
|
1405
|
-
export type
|
|
1415
|
+
/** One verified screenshot a lead turn selected for an exact result (v64): trusted identities only, never bytes or paths. */
|
|
1416
|
+
export type LeadTurnEvidence = {
|
|
1406
1417
|
turn: number;
|
|
1407
1418
|
ordinal: number;
|
|
1408
1419
|
taskId: string;
|
|
@@ -1609,69 +1620,6 @@ export declare const REVIEW_ROOT_ATTEMPTS = 3;
|
|
|
1609
1620
|
/** The receipt v114 keeps a notification's old single-destination delivery under. No sender claims it: every real
|
|
1610
1621
|
* destination is a kind and a 64-character hash, or a Telegram binding. */
|
|
1611
1622
|
export declare const LEGACY_NOTIFICATION_DESTINATION = "legacy:single-destination";
|
|
1612
|
-
/** v34: artifact.kind admits 'report'. A table already rebuilt to the v38
|
|
1613
|
-
* shape (migrate() runs unconditionally on every open, including a fresh
|
|
1614
|
-
* database created straight at the current shape) is a DONE shape too —
|
|
1615
|
-
* the same "old-shape-plus-later-widening" recognizer rebuildRunForV29
|
|
1616
|
-
* uses for V34_RUN_DDL. */
|
|
1617
|
-
export declare function rebuildArtifactForV34(db: Database): void;
|
|
1618
|
-
/** v34: incident.kind admits 'malformed-report'. Same v38-shape tolerance as rebuildArtifactForV34. */
|
|
1619
|
-
export declare function rebuildIncidentForV34(db: Database): void;
|
|
1620
|
-
/** v38: artifact.kind admits 'proof','check-log','screenshot'. */
|
|
1621
|
-
export declare function rebuildArtifactForV38(db: Database): void;
|
|
1622
|
-
/** v46: artifact.kind additionally admits structured-output. A table
|
|
1623
|
-
* already at the v51 shape is a DONE shape (migrate() runs every step on
|
|
1624
|
-
* every open). */
|
|
1625
|
-
export declare function rebuildArtifactForV46(db: Database): void;
|
|
1626
|
-
/** v51: artifact.kind additionally admits plan-contract and review-context. */
|
|
1627
|
-
export declare function rebuildArtifactForV51(db: Database): void;
|
|
1628
|
-
/** v38: incident.kind admits 'malformed-proof'. */
|
|
1629
|
-
export declare function rebuildIncidentForV38(db: Database): void;
|
|
1630
|
-
/**
|
|
1631
|
-
* v34: run.role admits 'scout'. An EXACT recognizer, like v29's and v33's:
|
|
1632
|
-
* the stored DDL must be the v29+v30 shape (either placement of the v30
|
|
1633
|
-
* columns is the same shape) or already v34; anything else refuses rather
|
|
1634
|
-
* than being guessed. Rows and ids are carried whole; foreign keys are
|
|
1635
|
-
* checked before commit; the indexes return with the post-migration block.
|
|
1636
|
-
*/
|
|
1637
|
-
export declare function rebuildRunForV34(db: Database): void;
|
|
1638
|
-
export declare function rebuildMateProposalForV66(db: Database): void;
|
|
1639
|
-
/** v74: Microsoft Teams joins the recorded surfaces a stop or an answer names. */
|
|
1640
|
-
export declare const DECISION_V74_DDL: (name: string) => string;
|
|
1641
|
-
export declare const RUN_STOP_V74_DDL: (name: string) => string;
|
|
1642
|
-
export declare function rebuildTeamsAuditForV74(db: Database): void;
|
|
1643
|
-
export declare const DECISION_V68_DDL_FOR_TESTS: (name: string) => string;
|
|
1644
|
-
export declare const RUN_STOP_V68_DDL_FOR_TESTS: (name: string) => string;
|
|
1645
|
-
export declare function rebuildDiscordAuditForV68(db: Database): void;
|
|
1646
|
-
export declare function rebuildSlackAuditForV67(db: Database): void;
|
|
1647
|
-
/** The v63 columns, in order: what an upgrade copies, and what a wind-back keeps. */
|
|
1648
|
-
export declare const TELEGRAM_CONVERSATION_PART_V63_COLUMNS: readonly ["conversation", "ordinal", "kind", "text", "reply_to", "proposal", "keyboard_json", "state", "message_id", "attempts", "uncertain", "next_attempt_at", "last_error", "created_at", "sent_at"];
|
|
1649
|
-
/** v64: image parts join the outbound conversation parts with typed media identity. Every v63 row, receipt, attempt and uncertain count is carried whole. */
|
|
1650
|
-
export declare function rebuildTelegramConversationPartForV64(db: Database): void;
|
|
1651
|
-
/** v62: the stop audit admits 'telegram'. Rows, ids and settlements are carried whole. */
|
|
1652
|
-
export declare function rebuildRunStopForV62(db: Database): void;
|
|
1653
|
-
export declare function rebuildMateProposalForV60(db: Database): void;
|
|
1654
|
-
/**
|
|
1655
|
-
* v33 (mate v3): `answer` joins mate_proposal's kinds — an EXACT recognizer
|
|
1656
|
-
* (v3 review, finding 9): the stored DDL must equal the v32 shape or the
|
|
1657
|
-
* v33 shape, byte for byte after canonicalization; anything else refuses
|
|
1658
|
-
* rather than being guessed. Rows and ids are carried whole; the one
|
|
1659
|
-
* shipped index is recreated; foreign keys are checked before commit.
|
|
1660
|
-
*/
|
|
1661
|
-
export declare function rebuildMateProposalForV33(db: Database): void;
|
|
1662
|
-
/** v42: `repair` joins the mate proposal kinds through the same exact,
|
|
1663
|
-
* row-preserving copy-rename used for v33. */
|
|
1664
|
-
export declare function rebuildMateProposalForV42(db: Database): void;
|
|
1665
|
-
/** v43: `steer` joins the mate proposal kinds through the same exact,
|
|
1666
|
-
* row-preserving copy-rename used for v33 and v42. */
|
|
1667
|
-
export declare function rebuildMateProposalForV43(db: Database): void;
|
|
1668
|
-
/** v48: `agents` joins the mate proposal kinds — the same exact,
|
|
1669
|
-
* row-preserving copy-rename as v33, v42, and v43. */
|
|
1670
|
-
export declare function rebuildMateProposalForV48(db: Database): void;
|
|
1671
|
-
/** v35: widen both persisted provider checks with exact-shape rebuilds. */
|
|
1672
|
-
export declare function rebuildChatProvidersForV35(db: Database): void;
|
|
1673
|
-
/** v36: remove the mate's artificial absolute expiry. */
|
|
1674
|
-
export declare function rebuildMateSessionForV36(db: Database): void;
|
|
1675
1623
|
/** Reporting never creates, migrates, or repairs a store. SQLite itself
|
|
1676
1624
|
* enforces read-only access, including the race where the file disappears. */
|
|
1677
1625
|
export declare function openStoreReadOnly(file: string): Store | null;
|
|
@@ -3070,7 +3018,7 @@ export declare class Store {
|
|
|
3070
3018
|
* transaction can never commit half a seal). A brief FILE whose seal
|
|
3071
3019
|
* failed is an orphan on disk, not authority — no artifact row points at
|
|
3072
3020
|
* it. Two concurrent seals race on the comment consumption count, the
|
|
3073
|
-
*
|
|
3021
|
+
* family's next version id, or the repair chain's `source_run UNIQUE`, and
|
|
3074
3022
|
* exactly one wins; the loser refuses in words with zero rows.
|
|
3075
3023
|
*
|
|
3076
3024
|
* The child is filed UNAPPROVED, always: this method never stamps an
|
|
@@ -3096,16 +3044,15 @@ export declare class Store {
|
|
|
3096
3044
|
bytes: number;
|
|
3097
3045
|
capture: string;
|
|
3098
3046
|
};
|
|
3099
|
-
/** The child's own words:
|
|
3100
|
-
*
|
|
3047
|
+
/** The child's own words: its title and the explicitly described repair
|
|
3048
|
+
* appended to the SOURCE goal. Its id is the family's next version. */
|
|
3101
3049
|
child: {
|
|
3102
|
-
id?: string;
|
|
3103
3050
|
title: string;
|
|
3104
3051
|
repair: string;
|
|
3105
3052
|
};
|
|
3106
3053
|
/** Comments to consume, or null when the brief has no comment batch (CI / criterion repair). */
|
|
3107
3054
|
commentIds: readonly number[] | null;
|
|
3108
|
-
/** v102: who asked for this revision (a person,
|
|
3055
|
+
/** v102: who asked for this revision (a person, a subagent's "Name (AI)", or none for machine repairs): its filer. */
|
|
3109
3056
|
requestedBy?: string | null;
|
|
3110
3057
|
/** Fresh mode filing coverage, re-proved by the caller INSIDE this
|
|
3111
3058
|
* transaction (never carried across one): its budget default may only
|
|
@@ -3221,7 +3168,6 @@ export declare class Store {
|
|
|
3221
3168
|
capture: string;
|
|
3222
3169
|
};
|
|
3223
3170
|
child: {
|
|
3224
|
-
id: string;
|
|
3225
3171
|
title: string;
|
|
3226
3172
|
repair: string;
|
|
3227
3173
|
};
|
|
@@ -3866,7 +3812,7 @@ export declare class Store {
|
|
|
3866
3812
|
* where not — the same arithmetic the admission transaction uses. */
|
|
3867
3813
|
chatWeeklySpendMicrousd(credentialKey: string, now: Date): number;
|
|
3868
3814
|
private chatOnlyWeeklySpendMicrousd;
|
|
3869
|
-
/** The day's turns: fleet chat turns plus
|
|
3815
|
+
/** The day's turns: fleet chat turns plus lead turns — a lead turn is
|
|
3870
3816
|
* one turn however many steps it took (slice-1 review, finding 11). */
|
|
3871
3817
|
chatTurnsToday(approver: string, now: Date): number;
|
|
3872
3818
|
/** Turns blocking this credential until somebody owns the worst case. */
|
|
@@ -4340,7 +4286,7 @@ export declare class Store {
|
|
|
4340
4286
|
policyHistory(limit?: number): LedgerEntry[];
|
|
4341
4287
|
/** Why the policy stops a task's approved terms (its profile, every routed leg), or null. */
|
|
4342
4288
|
scopePolicyRefusal(taskId: string): string | null;
|
|
4343
|
-
/** Why the policy stops an agent on a provider and model now, or null (chats,
|
|
4289
|
+
/** Why the policy stops an agent on a provider and model now, or null (chats, subagents, flow steps). */
|
|
4344
4290
|
agentPolicyRefusal(provider: string, model: string | null): string | null;
|
|
4345
4291
|
/** Why the policy stops a planner, scout or native coding session (no profile to lower) on a provider and model, or null. */
|
|
4346
4292
|
sessionPolicyRefusal(provider: string, model: string | null, what: string): string | null;
|
|
@@ -4395,7 +4341,7 @@ export declare class Store {
|
|
|
4395
4341
|
budgetGate(now: Date): (work: {
|
|
4396
4342
|
project: string | null;
|
|
4397
4343
|
person: string | null;
|
|
4398
|
-
|
|
4344
|
+
subagent: number | null;
|
|
4399
4345
|
agents?: readonly BudgetAgent[];
|
|
4400
4346
|
}) => BudgetHold;
|
|
4401
4347
|
/** How each provider would bill new work now (see spend.billingOf). */
|
|
@@ -4407,11 +4353,11 @@ export declare class Store {
|
|
|
4407
4353
|
/** v105: how a run was really billed, from its own evidence, fixed before its usage is priced. */
|
|
4408
4354
|
fixRunBilling(id: number, billing: Billing, now: Date): void;
|
|
4409
4355
|
/** What a task's new work counts toward: its project, its filer (a person, or the person behind a coordinator), and
|
|
4410
|
-
* the
|
|
4356
|
+
* the subagent that filed it. A revision (an automatic repair included) counts as its source task's. */
|
|
4411
4357
|
budgetSubject(taskRef: number): {
|
|
4412
4358
|
project: string | null;
|
|
4413
4359
|
person: string | null;
|
|
4414
|
-
|
|
4360
|
+
subagent: number | null;
|
|
4415
4361
|
};
|
|
4416
4362
|
/**
|
|
4417
4363
|
* Stamp the machine's current phase on an OPEN run. A closed run's phase
|
|
@@ -4829,7 +4775,7 @@ export declare class Store {
|
|
|
4829
4775
|
/**
|
|
4830
4776
|
* Every live binding for a bot, oldest first — and only while each approver's credential generation still matches.
|
|
4831
4777
|
* A rotation that somehow missed the sweep reads as no binding at all, which is the failure direction that fails
|
|
4832
|
-
* closed. Several
|
|
4778
|
+
* closed. Several subagents may each hold one (v72); nothing here ranks them.
|
|
4833
4779
|
*/
|
|
4834
4780
|
liveTelegramBindings(botId: string): TelegramBinding[];
|
|
4835
4781
|
/** The live binding one Telegram user holds with a bot, if any. */
|
|
@@ -4841,7 +4787,7 @@ export declare class Store {
|
|
|
4841
4787
|
* `liveTelegramBindings` / `liveTelegramBindingFor` instead. */
|
|
4842
4788
|
liveTelegramBinding(botId: string): TelegramBinding | null;
|
|
4843
4789
|
/** Revoke every live binding one person holds with a bot, and everything
|
|
4844
|
-
* those chats could still do.
|
|
4790
|
+
* those chats could still do. Subagents' bindings are untouched. */
|
|
4845
4791
|
unpairTelegram(botId: string, by: string, now: Date): boolean;
|
|
4846
4792
|
createTelegramAction(...args: Parameters<ChatMessages["createDecisionAction"]>): ReturnType<ChatMessages["createDecisionAction"]>;
|
|
4847
4793
|
recordTelegramDecisionMessage(...args: Parameters<ChatMessages["recordDecisionMessage"]>): ReturnType<ChatMessages["recordDecisionMessage"]>;
|
|
@@ -5106,8 +5052,8 @@ export declare class Store {
|
|
|
5106
5052
|
model: string | null;
|
|
5107
5053
|
repo: string | null;
|
|
5108
5054
|
}[];
|
|
5109
|
-
/** Delegated chat spend, signed once: the row every
|
|
5110
|
-
|
|
5055
|
+
/** Delegated chat spend, signed once: the row every lead turn debits. */
|
|
5056
|
+
mintLeadSession(args: {
|
|
5111
5057
|
approver: string;
|
|
5112
5058
|
approverGeneration: number;
|
|
5113
5059
|
credentialKey: string;
|
|
@@ -5125,31 +5071,31 @@ export declare class Store {
|
|
|
5125
5071
|
termsDigest: string;
|
|
5126
5072
|
thread: number;
|
|
5127
5073
|
}, now: Date): number;
|
|
5128
|
-
teamMateSession(approver: string, thread: number):
|
|
5129
|
-
openTeamMateThread(approver: string, ceilingDigest: string, now: Date):
|
|
5074
|
+
teamMateSession(approver: string, thread: number): LeadSession | null;
|
|
5075
|
+
openTeamMateThread(approver: string, ceilingDigest: string, now: Date): LeadThread;
|
|
5130
5076
|
canUseTeamMateThread(approver: string, generation: number, thread: number): boolean;
|
|
5131
5077
|
/** Rechecked at admission; membership never grants project or approval standing. */
|
|
5132
5078
|
teamMateThreadAllows(thread: number, approver: string, generation: number): boolean;
|
|
5133
5079
|
/** The live session — explicitly ended or still active. Exhaustion is the caller's arithmetic. */
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5080
|
+
activeLeadSession(approver: string): LeadSession | null;
|
|
5081
|
+
getLeadSession(id: number): LeadSession | null;
|
|
5082
|
+
endLeadSession(id: number, by: string, now: Date): boolean;
|
|
5137
5083
|
/** Revocation's companion (ruling 10): an approver's standing ends every session it minted. */
|
|
5138
|
-
|
|
5084
|
+
endLeadSessionsFor(approver: string, by: string, now: Date): number;
|
|
5139
5085
|
/** The live thread for this approver and scope under THIS ceiling; a
|
|
5140
5086
|
* thread under another ceiling is closed first (ruling 9) — the surface
|
|
5141
5087
|
* says why. The lead conversation is the default scope. */
|
|
5142
|
-
|
|
5143
|
-
thread:
|
|
5088
|
+
openLeadThread(approver: string, ceilingDigest: string, now: Date, scope?: LeadThreadScope): {
|
|
5089
|
+
thread: LeadThread;
|
|
5144
5090
|
ceilingChanged: boolean;
|
|
5145
5091
|
};
|
|
5146
5092
|
/** The approver's live thread for one scope, read only — null when none is open. */
|
|
5147
|
-
|
|
5093
|
+
liveLeadThreadFor(approver: string, scope?: LeadThreadScope): LeadThread | null;
|
|
5148
5094
|
/** The lead thread a ceiling change closed just before `current` (ruling 9),
|
|
5149
5095
|
* read only and for display only: it never continues and never reaches the
|
|
5150
5096
|
* model. Null when there is none, when it was ended or revoked (its text is
|
|
5151
5097
|
* gone), or when it closed under the same ceiling. */
|
|
5152
|
-
replacedLeadThread(current:
|
|
5098
|
+
replacedLeadThread(current: LeadThread): LeadThread | null;
|
|
5153
5099
|
/** The task a paired chat is talking about (v78), or null for the lead conversation. */
|
|
5154
5100
|
chatFocus(surface: string, binding: number): string | null;
|
|
5155
5101
|
setChatFocus(surface: string, binding: number, task: string | null, now: Date): void;
|
|
@@ -5247,7 +5193,7 @@ export declare class Store {
|
|
|
5247
5193
|
failures: number;
|
|
5248
5194
|
lastOutcome: string | null;
|
|
5249
5195
|
}, now: Date): void;
|
|
5250
|
-
|
|
5196
|
+
createSubagent(mate: {
|
|
5251
5197
|
repo: string;
|
|
5252
5198
|
handle: string;
|
|
5253
5199
|
soul: string;
|
|
@@ -5255,42 +5201,42 @@ export declare class Store {
|
|
|
5255
5201
|
manager: string;
|
|
5256
5202
|
by: string;
|
|
5257
5203
|
}, now: Date): number;
|
|
5258
|
-
|
|
5259
|
-
/** The
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
/** A new version of a
|
|
5263
|
-
|
|
5264
|
-
|
|
5204
|
+
getSubagent(id: number): SubagentRow | null;
|
|
5205
|
+
/** The subagent a zone names in a project (paused ones too; never a removed one). */
|
|
5206
|
+
subagentByHandle(repo: string, handle: string): SubagentRow | null;
|
|
5207
|
+
subagents(repos: readonly string[]): SubagentRow[];
|
|
5208
|
+
/** A new version of a subagent's soul file; false when nothing changed. */
|
|
5209
|
+
saveSubagentSoul(id: number, soul: string, by: string, now: Date): boolean;
|
|
5210
|
+
subagentVersions(id: number): {
|
|
5265
5211
|
version: number;
|
|
5266
5212
|
soul: string;
|
|
5267
5213
|
savedBy: string;
|
|
5268
5214
|
savedAt: string;
|
|
5269
5215
|
}[];
|
|
5270
|
-
|
|
5271
|
-
state?:
|
|
5216
|
+
updateSubagent(id: number, change: {
|
|
5217
|
+
state?: SubagentRow["state"];
|
|
5272
5218
|
model?: string | null;
|
|
5273
5219
|
dailyTurns?: number;
|
|
5274
5220
|
manager?: string;
|
|
5275
5221
|
summaryAt?: string;
|
|
5276
5222
|
weeklyAt?: string;
|
|
5277
5223
|
}, by: string, now: Date): void;
|
|
5278
|
-
|
|
5279
|
-
|
|
5224
|
+
addSubagentEvent(event: {
|
|
5225
|
+
subagent: number;
|
|
5280
5226
|
card?: number | null;
|
|
5281
5227
|
entry?: number | null;
|
|
5282
|
-
kind:
|
|
5228
|
+
kind: SubagentEventKind;
|
|
5283
5229
|
said: string;
|
|
5284
5230
|
detail?: Record<string, unknown> | null;
|
|
5285
5231
|
by?: string | null;
|
|
5286
5232
|
}, now: Date): number;
|
|
5287
|
-
/** A
|
|
5288
|
-
|
|
5289
|
-
/** How many turns (decisions, handled cards, hand-offs, questions, failures, and v94 tool calls) a
|
|
5290
|
-
|
|
5233
|
+
/** A subagent's log, newest first; `since` bounds it (a day's summary). */
|
|
5234
|
+
subagentEvents(subagent: number, limit: number, since?: string | null): SubagentEventRow[];
|
|
5235
|
+
/** How many turns (decisions, handled cards, hand-offs, questions, failures, and v94 tool calls) a subagent took since a time: its daily limit. */
|
|
5236
|
+
subagentTurnsSince(subagent: number, since: string): number;
|
|
5291
5237
|
/** Ask a person about one visit of a card (v94: or to approve one tool call); null when that visit, or that call, already has its question. */
|
|
5292
|
-
|
|
5293
|
-
|
|
5238
|
+
openSubagentQuestion(question: {
|
|
5239
|
+
subagent: number;
|
|
5294
5240
|
card: number;
|
|
5295
5241
|
entry: number;
|
|
5296
5242
|
question: string;
|
|
@@ -5303,30 +5249,30 @@ export declare class Store {
|
|
|
5303
5249
|
suggestion?: number;
|
|
5304
5250
|
}, now: Date): number | null;
|
|
5305
5251
|
/** v94: the first question still open on one visit of a card: its own, or a tool call's approval. */
|
|
5306
|
-
|
|
5252
|
+
openSubagentQuestionOn(card: number, entry: number): SubagentQuestionRow | null;
|
|
5307
5253
|
/** v94: the approval question of one tool call. */
|
|
5308
|
-
|
|
5309
|
-
/** v96: the flow a
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5254
|
+
subagentQuestionForCall(call: number): SubagentQuestionRow | null;
|
|
5255
|
+
/** v96: the flow a subagent's desk is. */
|
|
5256
|
+
setSubagentDesk(id: number, flow: number): void;
|
|
5257
|
+
addSubagentMemory(memory: {
|
|
5258
|
+
subagent: number;
|
|
5313
5259
|
text: string;
|
|
5314
|
-
source:
|
|
5260
|
+
source: SubagentMemoryRow["source"];
|
|
5315
5261
|
card?: number | null;
|
|
5316
5262
|
by: string;
|
|
5317
5263
|
}, now: Date): number;
|
|
5318
|
-
|
|
5319
|
-
/** What a
|
|
5320
|
-
|
|
5321
|
-
source?:
|
|
5264
|
+
subagentMemory(id: number): SubagentMemoryRow | null;
|
|
5265
|
+
/** What a subagent remembers now, newest first: one source, and every word of `words` (any case), when given. */
|
|
5266
|
+
subagentMemories(subagent: number, options?: {
|
|
5267
|
+
source?: SubagentMemoryRow["source"];
|
|
5322
5268
|
words?: readonly string[];
|
|
5323
5269
|
limit?: number;
|
|
5324
|
-
}):
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5270
|
+
}): SubagentMemoryRow[];
|
|
5271
|
+
editSubagentMemory(id: number, text: string, by: string, now: Date): boolean;
|
|
5272
|
+
forgetSubagentMemory(id: number, by: string, now: Date): boolean;
|
|
5273
|
+
markSubagentMemoriesUsed(ids: readonly number[], now: Date): void;
|
|
5274
|
+
addSubagentSuggestion(suggestion: {
|
|
5275
|
+
subagent: number;
|
|
5330
5276
|
tool: string;
|
|
5331
5277
|
action: string;
|
|
5332
5278
|
rule: ToolRule;
|
|
@@ -5334,27 +5280,27 @@ export declare class Store {
|
|
|
5334
5280
|
evidence: number[];
|
|
5335
5281
|
said: string;
|
|
5336
5282
|
}, now: Date): number;
|
|
5337
|
-
|
|
5338
|
-
/** A
|
|
5339
|
-
|
|
5340
|
-
|
|
5283
|
+
subagentSuggestion(id: number): SubagentSuggestionRow | null;
|
|
5284
|
+
/** A subagent's suggestions about one action, newest first. */
|
|
5285
|
+
subagentSuggestionsFor(subagent: number, tool: string, action: string): SubagentSuggestionRow[];
|
|
5286
|
+
subagentSuggestions(subagent: number, limit?: number): SubagentSuggestionRow[];
|
|
5341
5287
|
/** Decide a suggestion, once: false when it was already decided. */
|
|
5342
|
-
|
|
5288
|
+
decideSubagentSuggestion(id: number, state: "accepted" | "dismissed" | "stale", by: string | null, now: Date): boolean;
|
|
5343
5289
|
/** v95: the question that offers a suggestion to its manager. */
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5290
|
+
subagentQuestionForSuggestion(suggestion: number): SubagentQuestionRow | null;
|
|
5291
|
+
subagentGrants(subagent: number): SubagentGrantRow[];
|
|
5292
|
+
subagentGrant(subagent: number, tool: string): SubagentGrantRow | null;
|
|
5347
5293
|
/** Grant a tool, or change what it offers and the rules: the whole row is written. `listedAt` undefined keeps it. */
|
|
5348
|
-
|
|
5349
|
-
|
|
5294
|
+
saveSubagentGrant(grant: {
|
|
5295
|
+
subagent: number;
|
|
5350
5296
|
tool: string;
|
|
5351
5297
|
actions: ToolActionInfo[];
|
|
5352
5298
|
rules: Record<string, ToolRule>;
|
|
5353
5299
|
listedAt?: string | null;
|
|
5354
5300
|
}, by: string, now: Date): void;
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5301
|
+
dropSubagentGrant(subagent: number, tool: string, by: string, now: Date): boolean;
|
|
5302
|
+
addSubagentCall(call: {
|
|
5303
|
+
subagent: number;
|
|
5358
5304
|
card: number;
|
|
5359
5305
|
entry: number;
|
|
5360
5306
|
tool: string;
|
|
@@ -5362,32 +5308,32 @@ export declare class Store {
|
|
|
5362
5308
|
input: Record<string, unknown>;
|
|
5363
5309
|
rule: ToolRule["use"];
|
|
5364
5310
|
why: string;
|
|
5365
|
-
state:
|
|
5311
|
+
state: SubagentCallState;
|
|
5366
5312
|
result?: string | null;
|
|
5367
5313
|
undoOf?: number;
|
|
5368
5314
|
decidedBy?: string;
|
|
5369
5315
|
}, now: Date): number;
|
|
5370
|
-
/** v103: a
|
|
5371
|
-
private
|
|
5316
|
+
/** v103: a subagent's tool call in the ledger, as the subagent (or the person who decided it), on its card's task. */
|
|
5317
|
+
private recordSubagentCall;
|
|
5372
5318
|
/** v97: a call was undone by a person; false when it already was. */
|
|
5373
|
-
|
|
5374
|
-
/** v97: cards someone moved by hand right after this actor (a
|
|
5319
|
+
markSubagentCallUndone(id: number, by: string, now: Date): boolean;
|
|
5320
|
+
/** v97: cards someone moved by hand right after this actor (a subagent) moved them, since a time: what people overrode. */
|
|
5375
5321
|
flowMovesOverridden(actor: string, since: string): {
|
|
5376
5322
|
card: number;
|
|
5377
5323
|
flow: number;
|
|
5378
5324
|
title: string;
|
|
5379
|
-
|
|
5325
|
+
subagentTo: string;
|
|
5380
5326
|
personTo: string;
|
|
5381
5327
|
by: string;
|
|
5382
5328
|
at: string;
|
|
5383
5329
|
}[];
|
|
5384
5330
|
/** v97: undo calls a person asked for that aren't made yet. */
|
|
5385
|
-
|
|
5331
|
+
pendingSubagentUndos(): SubagentCallRow[];
|
|
5386
5332
|
/** v97: an undo that failed leaves the call as it was. */
|
|
5387
|
-
|
|
5388
|
-
/** v97: one model turn a
|
|
5389
|
-
|
|
5390
|
-
|
|
5333
|
+
clearSubagentCallUndone(id: number, now: Date): void;
|
|
5334
|
+
/** v97: one model turn a subagent took, with what it cost. */
|
|
5335
|
+
addSubagentTurn(turn: {
|
|
5336
|
+
subagent: number;
|
|
5391
5337
|
card: number | null;
|
|
5392
5338
|
model: string;
|
|
5393
5339
|
ok: boolean;
|
|
@@ -5402,31 +5348,31 @@ export declare class Store {
|
|
|
5402
5348
|
model: string | null;
|
|
5403
5349
|
costUsd: number | null;
|
|
5404
5350
|
}, now: Date): void;
|
|
5405
|
-
|
|
5406
|
-
|
|
5351
|
+
subagentTurns(subagent: number, since: string): SubagentTurnRow[];
|
|
5352
|
+
subagentCall(id: number): SubagentCallRow | null;
|
|
5407
5353
|
/** Move a call on, only from the state it is known to be in: false when someone else moved it first. */
|
|
5408
|
-
|
|
5409
|
-
state:
|
|
5354
|
+
moveSubagentCall(id: number, from: readonly SubagentCallState[], change: {
|
|
5355
|
+
state: SubagentCallState;
|
|
5410
5356
|
result?: string | null;
|
|
5411
5357
|
decidedBy?: string;
|
|
5412
5358
|
}, now: Date): boolean;
|
|
5413
5359
|
/** A card's receipts, oldest first: one visit (`entry`), or every visit. */
|
|
5414
|
-
|
|
5415
|
-
/** A
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
/** The question a
|
|
5419
|
-
|
|
5420
|
-
/** Open questions for these
|
|
5421
|
-
|
|
5360
|
+
subagentCallsOn(card: number, entry?: number | null): SubagentCallRow[];
|
|
5361
|
+
/** A subagent's receipts, newest first; `since` bounds them (a day's summary). */
|
|
5362
|
+
subagentCallsOf(subagent: number, limit: number, since?: string | null): SubagentCallRow[];
|
|
5363
|
+
subagentQuestion(id: number): SubagentQuestionRow | null;
|
|
5364
|
+
/** The question a subagent asked of its own on one visit (never a tool call's approval). */
|
|
5365
|
+
subagentQuestionFor(card: number, entry: number): SubagentQuestionRow | null;
|
|
5366
|
+
/** Open questions for these subagents, oldest first. */
|
|
5367
|
+
openSubagentQuestions(subagents: readonly number[]): SubagentQuestionRow[];
|
|
5422
5368
|
/** The answer, once: false when it was already answered (or dropped). */
|
|
5423
|
-
|
|
5369
|
+
answerSubagentQuestion(id: number, answer: {
|
|
5424
5370
|
choice: string | null;
|
|
5425
5371
|
text: string | null;
|
|
5426
5372
|
by: string;
|
|
5427
5373
|
via: string;
|
|
5428
5374
|
}, now: Date): boolean;
|
|
5429
|
-
|
|
5375
|
+
dropSubagentQuestion(id: number, now: Date): void;
|
|
5430
5376
|
/** A step waiting on a person's answer becomes due now (the answer came). */
|
|
5431
5377
|
wakeFlowStep(card: number, entry: number, now: Date): void;
|
|
5432
5378
|
/** Cards arriving in one zone of a flow after a history line: what a trigger on another flow follows. */
|
|
@@ -5620,12 +5566,12 @@ export declare class Store {
|
|
|
5620
5566
|
recordTelegramTaskMessage(...args: Parameters<ChatMessages["recordTaskMessage"]>): ReturnType<ChatMessages["recordTaskMessage"]>;
|
|
5621
5567
|
/** The approver's live personal threads that have messages, most recent
|
|
5622
5568
|
* first — the chat list. Team conversations list themselves. */
|
|
5623
|
-
|
|
5624
|
-
|
|
5569
|
+
listLeadThreads(approver: string, limit?: number): LeadThreadSummary[];
|
|
5570
|
+
getLeadThread(id: number): LeadThread | null;
|
|
5625
5571
|
/** `--end` and revocation: the thread's text and every proposal in it are
|
|
5626
5572
|
* deleted; the thread row stays as closed metadata (when, whose). */
|
|
5627
|
-
|
|
5628
|
-
|
|
5573
|
+
closeLeadThreadsFor(approver: string, now: Date): number;
|
|
5574
|
+
appendLeadMessage(message: {
|
|
5629
5575
|
thread: number;
|
|
5630
5576
|
turn: number | null;
|
|
5631
5577
|
role: "operator" | "assistant";
|
|
@@ -5633,37 +5579,37 @@ export declare class Store {
|
|
|
5633
5579
|
activity?: string | null;
|
|
5634
5580
|
}, now: Date): number;
|
|
5635
5581
|
/** The last `limit` messages, oldest first. */
|
|
5636
|
-
|
|
5582
|
+
listLeadMessages(thread: number, limit: number): LeadMessage[];
|
|
5637
5583
|
/** A proposal is inert (`drafting`) until its turn finalizes. */
|
|
5638
|
-
|
|
5584
|
+
draftLeadProposal(proposal: {
|
|
5639
5585
|
thread: number;
|
|
5640
5586
|
turn: number;
|
|
5641
|
-
kind:
|
|
5587
|
+
kind: LeadProposalKind;
|
|
5642
5588
|
payload: Record<string, unknown>;
|
|
5643
5589
|
ceilingDigest: string;
|
|
5644
5590
|
}, now: Date): number;
|
|
5645
5591
|
/** Record this turn's one question; false when the turn already asked one. */
|
|
5646
|
-
|
|
5592
|
+
recordLeadAsk(ask: {
|
|
5647
5593
|
turn: number;
|
|
5648
5594
|
thread: number;
|
|
5649
5595
|
question: string;
|
|
5650
5596
|
options: readonly string[];
|
|
5651
5597
|
}, now: Date): boolean;
|
|
5652
5598
|
/** A failed turn keeps no question, as it keeps no drafts. */
|
|
5653
|
-
|
|
5599
|
+
dropLeadAsk(turn: number): void;
|
|
5654
5600
|
/** The question an ANSWERED turn asked; null when it asked none or did not answer. */
|
|
5655
|
-
|
|
5601
|
+
leadAsk(turn: number): LeadAsk | null;
|
|
5656
5602
|
/** What a tap on the question finds: open; answered (its owner has written in its thread since the reply that asked
|
|
5657
5603
|
* it, typed or tapped; a turn the lead started itself, or another person's message, is no answer); or expired (older
|
|
5658
|
-
* than
|
|
5659
|
-
|
|
5604
|
+
* than LEAD_ASK_TTL_MS, or the question or the reply that asked it is gone, as after a retention purge). */
|
|
5605
|
+
leadAskState(turn: number, now: Date): {
|
|
5660
5606
|
state: "open";
|
|
5661
|
-
ask:
|
|
5607
|
+
ask: LeadAsk;
|
|
5662
5608
|
} | {
|
|
5663
5609
|
state: "answered" | "expired";
|
|
5664
5610
|
};
|
|
5665
|
-
/** The question while it is open (see
|
|
5666
|
-
|
|
5611
|
+
/** The question while it is open (see leadAskState); null otherwise. */
|
|
5612
|
+
leadAskOpen(turn: number, now: Date): LeadAsk | null;
|
|
5667
5613
|
/**
|
|
5668
5614
|
* Record the screenshots one turn selected for an exact result, under the
|
|
5669
5615
|
* turn, so a channel that delivers files can plan them from the completed
|
|
@@ -5672,25 +5618,25 @@ export declare class Store {
|
|
|
5672
5618
|
* before upload. A turn holds at most `cap` images; the same artifact is
|
|
5673
5619
|
* recorded once. Returns how many of THESE rows are recorded after the call.
|
|
5674
5620
|
*/
|
|
5675
|
-
|
|
5621
|
+
recordLeadTurnEvidence(turn: number, rows: readonly Omit<LeadTurnEvidence, "turn" | "ordinal" | "createdAt">[], cap: number, now: Date): number;
|
|
5676
5622
|
/** The screenshots a turn selected, in selection order — meaningful only for a turn that ANSWERED (a failed turn's rows are deleted). */
|
|
5677
|
-
|
|
5623
|
+
listLeadTurnEvidence(turn: number): LeadTurnEvidence[];
|
|
5678
5624
|
/** A failed turn's selection is DELETED with its drafts: nothing a failed turn selected is ever sent. */
|
|
5679
|
-
|
|
5625
|
+
discardLeadTurnEvidence(turn: number): number;
|
|
5680
5626
|
/** Drafts become confirmable only under a turn that ANSWERED (review finding 12). */
|
|
5681
|
-
|
|
5627
|
+
promoteLeadProposals(turn: number): number;
|
|
5682
5628
|
/** A failed turn's drafts are DELETED — nothing a failed turn produced is durable (finding 4). */
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5629
|
+
discardLeadProposals(turn: number): number;
|
|
5630
|
+
getLeadProposal(id: number): LeadProposal | null;
|
|
5631
|
+
listLeadProposals(thread: number, states?: readonly LeadProposalState[]): LeadProposal[];
|
|
5686
5632
|
/** The state CAS confirmation rides on (ruling 7). */
|
|
5687
|
-
|
|
5633
|
+
casLeadProposal(id: number, from: LeadProposalState, to: LeadProposalState, by: string | null, outcome: Record<string, unknown> | null, now: Date): boolean;
|
|
5688
5634
|
/**
|
|
5689
5635
|
* The turn's reservation, in ONE transaction against the session and the
|
|
5690
5636
|
* weekly ledger, before any dispatch (ruling 5). One live turn per
|
|
5691
5637
|
* approver serializes the console and the CLI.
|
|
5692
5638
|
*/
|
|
5693
|
-
|
|
5639
|
+
openLeadTurn(args: {
|
|
5694
5640
|
approver: string;
|
|
5695
5641
|
session: number;
|
|
5696
5642
|
thread: number;
|
|
@@ -5707,17 +5653,17 @@ export declare class Store {
|
|
|
5707
5653
|
ok: false;
|
|
5708
5654
|
reason: "latched" | "concurrent" | "daily-cap" | "session-exhausted" | "session-ended" | "not-yours" | "thread-closed" | "over-budget" | "monthly-budget";
|
|
5709
5655
|
};
|
|
5710
|
-
|
|
5656
|
+
startLeadTurn(id: number, now: Date): {
|
|
5711
5657
|
ok: true;
|
|
5712
5658
|
generation: number;
|
|
5713
5659
|
} | {
|
|
5714
5660
|
ok: false;
|
|
5715
5661
|
};
|
|
5716
|
-
/** One provider request of a
|
|
5662
|
+
/** One provider request of a lead turn: a chat_turn row of kind
|
|
5717
5663
|
* 'mate-step', reserved at zero (the turn holds the reservation), with
|
|
5718
5664
|
* the same dispatch CAS, terminal CAS, and crash latch as fleet chat. */
|
|
5719
|
-
|
|
5720
|
-
|
|
5665
|
+
openLeadStep(args: {
|
|
5666
|
+
leadTurn: number;
|
|
5721
5667
|
generation: number;
|
|
5722
5668
|
approver: string;
|
|
5723
5669
|
credentialKey: string;
|
|
@@ -5739,7 +5685,7 @@ export declare class Store {
|
|
|
5739
5685
|
* releases money it cannot prove was not spent; acknowledging the step
|
|
5740
5686
|
* later does not refund it.
|
|
5741
5687
|
*/
|
|
5742
|
-
|
|
5688
|
+
finalizeLeadTurn(id: number, generation: number, outcome: {
|
|
5743
5689
|
state: "answered" | "failed";
|
|
5744
5690
|
settledMicrousd: number;
|
|
5745
5691
|
unknownSpend?: boolean;
|
|
@@ -5756,18 +5702,18 @@ export declare class Store {
|
|
|
5756
5702
|
}, now: Date): boolean;
|
|
5757
5703
|
/** A turn stopped at its deadline: the proposals its completed tool calls drafted (each validated when drafted) go pending, as an
|
|
5758
5704
|
* answered turn's do; anything the provider sent after them was never acted on. Every other failure still deletes its drafts. */
|
|
5759
|
-
private
|
|
5705
|
+
private keepTimedOutLeadProposals;
|
|
5760
5706
|
/** Revocation's companion for a loop in flight (finding 5): every live
|
|
5761
5707
|
* turn of the approver fails NOW, charged its whole reservation, its
|
|
5762
5708
|
* generation moved so the returning loop's terminal CAS loses. */
|
|
5763
|
-
|
|
5709
|
+
failLiveLeadTurnsFor(approver: string, reason: string, now: Date, privateOnly?: boolean): number;
|
|
5764
5710
|
/** The crash sweep for turns: past the deadline, failed. The session is
|
|
5765
5711
|
* charged the settled sum of the steps that answered — unless any step
|
|
5766
5712
|
* is unproven (dispatched and never settled, or latched), in which case
|
|
5767
5713
|
* the WHOLE reservation is charged (finding 1). Like a turn that stopped
|
|
5768
5714
|
* at its own deadline, it keeps the proposals its completed tool calls
|
|
5769
5715
|
* drafted and says, in the thread, that the reply took too long. */
|
|
5770
|
-
|
|
5716
|
+
sweepStaleLeadTurns(now: Date): number;
|
|
5771
5717
|
/** A task_ref by its row id: the external id and repo — for decisions, which hang off runs. */
|
|
5772
5718
|
refById(id: number): {
|
|
5773
5719
|
id: number;
|
|
@@ -5795,10 +5741,10 @@ export declare class Store {
|
|
|
5795
5741
|
casCoordinatorProposal(id: number, from: CoordinatorProposalState, to: CoordinatorProposalState, by: string | null, outcome: Record<string, unknown> | null, now: Date): boolean;
|
|
5796
5742
|
/** Pending rows expire after seven days; a revoked credential's pending rows expire at once. */
|
|
5797
5743
|
sweepCoordinatorProposals(now: Date, cid?: string): number;
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5744
|
+
recentLeadTurns(approver: string, limit?: number): LeadTurn[];
|
|
5745
|
+
getLeadTurn(id: number): LeadTurn | null;
|
|
5746
|
+
liveLeadTurnFor(approver: string): LeadTurn | null;
|
|
5747
|
+
leadStepsOf(leadTurn: number): ChatTurn[];
|
|
5802
5748
|
/** Remember a project was opened. Upsert keeps added_at; recency always moves.
|
|
5803
5749
|
* A project added for the first time starts on Quick checks. */
|
|
5804
5750
|
upsertProject(path: string, name: string, now: Date): void;
|
|
@@ -6524,7 +6470,7 @@ export declare class Store {
|
|
|
6524
6470
|
private bumpPushFailures;
|
|
6525
6471
|
/** A chat send receipt contains no message text. The session is part of
|
|
6526
6472
|
* its namespace; callers must prove that session before reading it. */
|
|
6527
|
-
|
|
6473
|
+
leadRequestReceipt(session: number, request: string): {
|
|
6528
6474
|
digest: string;
|
|
6529
6475
|
turn: number;
|
|
6530
6476
|
} | null;
|