toolroll 0.9.54 → 0.9.56

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.
Files changed (350) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +29 -12
  3. package/dist/action-ledger.d.ts +2 -4
  4. package/dist/action-ledger.js +2 -10
  5. package/dist/agent-onboard.js +4 -1
  6. package/dist/approval-policy.d.ts +5 -5
  7. package/dist/approval-policy.js +4 -4
  8. package/dist/approval-rules-ui.d.ts +3 -2
  9. package/dist/approval-rules-ui.js +17 -22
  10. package/dist/assignment-ui.d.ts +3 -2
  11. package/dist/assignment-ui.js +4 -11
  12. package/dist/backup-ui.d.ts +2 -1
  13. package/dist/backup-ui.js +16 -27
  14. package/dist/brand-mark.d.ts +3 -2
  15. package/dist/brand-mark.js +4 -4
  16. package/dist/browser/workspace.css +1 -1
  17. package/dist/browser/workspace.js +25 -25
  18. package/dist/browser-shell.d.ts +2 -1
  19. package/dist/browser-shell.js +9 -9
  20. package/dist/browser-workspace.d.ts +14 -15
  21. package/dist/browser-workspace.js +0 -3
  22. package/dist/budget-alerts.js +3 -3
  23. package/dist/chat-actions.d.ts +23 -18
  24. package/dist/chat-actions.js +110 -88
  25. package/dist/chat-ask.d.ts +2 -2
  26. package/dist/chat-ask.js +5 -5
  27. package/dist/chat-channel.d.ts +15 -15
  28. package/dist/chat-channel.js +20 -20
  29. package/dist/chat-controls.d.ts +0 -4
  30. package/dist/chat-controls.js +0 -1
  31. package/dist/chat-core.js +1 -1
  32. package/dist/chat-delivery-state.js +2 -2
  33. package/dist/chat-delivery.d.ts +2 -2
  34. package/dist/chat-delivery.js +27 -34
  35. package/dist/chat-flow.js +3 -3
  36. package/dist/chat-messages.d.ts +1 -1
  37. package/dist/chat-messages.js +4 -4
  38. package/dist/chat-migration.d.ts +1 -1
  39. package/dist/chat-migration.js +11 -11
  40. package/dist/chat-polish.d.ts +5 -4
  41. package/dist/chat-polish.js +9 -10
  42. package/dist/chat-rooms.js +3 -3
  43. package/dist/chat-warmth.d.ts +2 -2
  44. package/dist/check-levels-ui.d.ts +2 -1
  45. package/dist/check-levels-ui.js +26 -53
  46. package/dist/cli.d.ts +3 -1
  47. package/dist/cli.js +15 -10
  48. package/dist/coding-shipping-ui.d.ts +2 -1
  49. package/dist/coding-shipping-ui.js +6 -6
  50. package/dist/coding-ui.d.ts +3 -1
  51. package/dist/coding-ui.js +30 -29
  52. package/dist/contracts/chat-actions.d.ts +32 -27
  53. package/dist/contracts/chat-actions.js +29 -11
  54. package/dist/contracts/chat-content.d.ts +1 -1
  55. package/dist/contracts/chat-content.js +1 -1
  56. package/dist/contracts/chat-tables.js +4 -4
  57. package/dist/contracts/cli.d.ts +1 -3
  58. package/dist/contracts/console-api.d.ts +7 -7
  59. package/dist/contracts/console-api.js +13 -12
  60. package/dist/contracts/flow-propose.d.ts +3 -3
  61. package/dist/contracts/flow.d.ts +132 -125
  62. package/dist/contracts/flow.js +27 -12
  63. package/dist/contracts/health.d.ts +1 -3
  64. package/dist/contracts/lead-context.d.ts +1 -1
  65. package/dist/contracts/lead-context.js +2 -2
  66. package/dist/contracts/lead-tools.d.ts +20 -18
  67. package/dist/contracts/lead-tools.js +15 -15
  68. package/dist/contracts/stage-output.d.ts +1 -1
  69. package/dist/contracts/stage-output.js +1 -1
  70. package/dist/contracts/store-json.d.ts +23 -22
  71. package/dist/contracts/store-json.js +17 -17
  72. package/dist/contracts/{teammate-turn.d.ts → subagent-turn.d.ts} +5 -5
  73. package/dist/contracts/{teammate-turn.js → subagent-turn.js} +7 -7
  74. package/dist/control-ui.d.ts +5 -4
  75. package/dist/control-ui.js +9 -34
  76. package/dist/converse.d.ts +23 -23
  77. package/dist/converse.js +28 -28
  78. package/dist/coordinator-proposals.d.ts +2 -2
  79. package/dist/coordinator-proposals.js +1 -1
  80. package/dist/coordinator.js +1 -1
  81. package/dist/credentials-ui.d.ts +5 -4
  82. package/dist/credentials-ui.js +23 -24
  83. package/dist/demo-chat.d.ts +3 -3
  84. package/dist/demo-chat.js +29 -76
  85. package/dist/deprecations.d.ts +12 -0
  86. package/dist/deprecations.js +20 -0
  87. package/dist/desktop-update-gate.js +8 -4
  88. package/dist/desktop-update.js +6 -1
  89. package/dist/discord-chat.js +6 -6
  90. package/dist/discord-settings.d.ts +3 -2
  91. package/dist/discord-settings.js +17 -42
  92. package/dist/dispatch.d.ts +1 -1
  93. package/dist/dispatch.js +1 -1
  94. package/dist/envelope.js +10 -1
  95. package/dist/evidence-pack.d.ts +2 -1
  96. package/dist/evidence-pack.js +45 -49
  97. package/dist/export-ui.d.ts +7 -2
  98. package/dist/export-ui.js +4 -10
  99. package/dist/export.js +7 -7
  100. package/dist/flow-engine.d.ts +2 -2
  101. package/dist/flow-engine.js +21 -21
  102. package/dist/flow-gallery-ui.d.ts +4 -3
  103. package/dist/flow-gallery-ui.js +28 -43
  104. package/dist/flow-insights.d.ts +1 -1
  105. package/dist/flow-share.js +13 -8
  106. package/dist/flow-starters-ui.d.ts +2 -1
  107. package/dist/flow-starters-ui.js +12 -15
  108. package/dist/flow-steps.d.ts +5 -5
  109. package/dist/flow-steps.js +19 -19
  110. package/dist/flow-triggers.d.ts +2 -1
  111. package/dist/flow-triggers.js +17 -15
  112. package/dist/flows-cli.js +1 -1
  113. package/dist/flows-ui.d.ts +4 -3
  114. package/dist/flows-ui.js +38 -49
  115. package/dist/flows.js +21 -20
  116. package/dist/guides.js +112 -6
  117. package/dist/html.d.ts +76 -0
  118. package/dist/html.js +173 -0
  119. package/dist/integrations-ui.d.ts +2 -1
  120. package/dist/integrations-ui.js +19 -23
  121. package/dist/invoke.js +1 -1
  122. package/dist/kits-ui.d.ts +5 -4
  123. package/dist/kits-ui.js +22 -24
  124. package/dist/kits.d.ts +12 -12
  125. package/dist/kits.js +31 -31
  126. package/dist/knowledge-ui.d.ts +6 -5
  127. package/dist/knowledge-ui.js +26 -25
  128. package/dist/{mate-cli.d.ts → lead-cli.d.ts} +11 -11
  129. package/dist/{mate-cli.js → lead-cli.js} +38 -38
  130. package/dist/lead-commitments.js +4 -4
  131. package/dist/lead-context.d.ts +12 -2
  132. package/dist/lead-context.js +15 -17
  133. package/dist/{mate-contract.d.ts → lead-contract.d.ts} +3 -3
  134. package/dist/{mate-contract.js → lead-contract.js} +7 -6
  135. package/dist/{mate-doors.d.ts → lead-doors.d.ts} +6 -6
  136. package/dist/{mate-doors.js → lead-doors.js} +24 -24
  137. package/dist/lead-follow.d.ts +5 -5
  138. package/dist/lead-follow.js +9 -9
  139. package/dist/lead-people.d.ts +5 -5
  140. package/dist/lead-people.js +14 -14
  141. package/dist/{mate-progress.d.ts → lead-progress.d.ts} +9 -9
  142. package/dist/{mate-progress.js → lead-progress.js} +3 -3
  143. package/dist/{mate-tools.d.ts → lead-tools.d.ts} +19 -19
  144. package/dist/{mate-tools.js → lead-tools.js} +109 -101
  145. package/dist/{mate.d.ts → lead.d.ts} +27 -27
  146. package/dist/{mate.js → lead.js} +102 -102
  147. package/dist/ledger-view.d.ts +2 -1
  148. package/dist/ledger-view.js +27 -29
  149. package/dist/limits-ui.d.ts +3 -2
  150. package/dist/limits-ui.js +8 -8
  151. package/dist/live-bus.d.ts +50 -8
  152. package/dist/live-bus.js +133 -50
  153. package/dist/mcp-connect.d.ts +1 -1
  154. package/dist/mcp-connect.js +3 -3
  155. package/dist/mcp-core.js +1 -1
  156. package/dist/mcp-oauth.js +35 -36
  157. package/dist/memory-pass.d.ts +2 -2
  158. package/dist/memory-pass.js +7 -7
  159. package/dist/models-ui.d.ts +2 -1
  160. package/dist/models-ui.js +25 -35
  161. package/dist/monitoring-ui.d.ts +4 -3
  162. package/dist/monitoring-ui.js +13 -26
  163. package/dist/notification-rows.d.ts +2 -2
  164. package/dist/openrouter-models.d.ts +2 -1
  165. package/dist/openrouter-models.js +5 -9
  166. package/dist/operate.d.ts +3 -3
  167. package/dist/operate.js +46 -41
  168. package/dist/people-audit-ui.d.ts +2 -1
  169. package/dist/people-audit-ui.js +13 -13
  170. package/dist/policy-ui.d.ts +3 -2
  171. package/dist/policy-ui.js +17 -23
  172. package/dist/policy.d.ts +1 -1
  173. package/dist/principal.d.ts +1 -1
  174. package/dist/principal.js +2 -2
  175. package/dist/project-delete-ui.d.ts +4 -3
  176. package/dist/project-delete-ui.js +16 -28
  177. package/dist/project-delete.d.ts +1 -1
  178. package/dist/project-delete.js +26 -26
  179. package/dist/project-memory.js +1 -1
  180. package/dist/project-tools.d.ts +1 -1
  181. package/dist/project-tools.js +1 -1
  182. package/dist/pull-request-ui.d.ts +2 -1
  183. package/dist/pull-request-ui.js +17 -32
  184. package/dist/recipe-ui.d.ts +8 -7
  185. package/dist/recipe-ui.js +39 -32
  186. package/dist/release-adapters.d.ts +60 -0
  187. package/dist/release-adapters.js +435 -0
  188. package/dist/release-cli.d.ts +24 -0
  189. package/dist/release-cli.js +181 -0
  190. package/dist/release-gate.d.ts +80 -0
  191. package/dist/release-gate.js +150 -0
  192. package/dist/release-links.d.ts +29 -0
  193. package/dist/release-links.js +102 -0
  194. package/dist/release.d.ts +331 -0
  195. package/dist/release.js +550 -0
  196. package/dist/reply-shape.d.ts +2 -1
  197. package/dist/reply-shape.js +5 -5
  198. package/dist/repository-context-ui.d.ts +2 -1
  199. package/dist/repository-context-ui.js +2 -7
  200. package/dist/request-budget-ui.d.ts +2 -1
  201. package/dist/request-budget-ui.js +16 -16
  202. package/dist/result-review.d.ts +2 -3
  203. package/dist/result-review.js +3 -9
  204. package/dist/retention-ui.d.ts +7 -1
  205. package/dist/retention-ui.js +7 -11
  206. package/dist/retention.js +4 -4
  207. package/dist/scope.d.ts +2 -2
  208. package/dist/scout-report.d.ts +1 -1
  209. package/dist/scout-report.js +1 -1
  210. package/dist/serve.d.ts +11 -2
  211. package/dist/serve.js +105 -99
  212. package/dist/server/chat.d.ts +7 -10
  213. package/dist/server/chat.js +984 -1021
  214. package/dist/server/chrome.d.ts +291 -0
  215. package/dist/server/chrome.js +747 -0
  216. package/dist/server/console.css +2819 -0
  217. package/dist/server/flows.d.ts +2 -6
  218. package/dist/server/flows.js +854 -773
  219. package/dist/server/guards.d.ts +1 -1
  220. package/dist/server/guards.js +8 -5
  221. package/dist/server/handler-context.d.ts +1 -1
  222. package/dist/server/handler-context.js +1 -1
  223. package/dist/server/handler-registry.d.ts +8 -6
  224. package/dist/server/handler-registry.js +14 -2
  225. package/dist/server/http.d.ts +274 -0
  226. package/dist/server/http.js +239 -0
  227. package/dist/server/live.d.ts +34 -0
  228. package/dist/server/live.js +309 -0
  229. package/dist/server/pages.d.ts +2 -6
  230. package/dist/server/pages.js +808 -789
  231. package/dist/server/people-tokens.d.ts +1 -6
  232. package/dist/server/people-tokens.js +581 -573
  233. package/dist/server/remote.d.ts +4 -7
  234. package/dist/server/remote.js +39 -70
  235. package/dist/server/render-chat.d.ts +402 -0
  236. package/dist/server/render-chat.js +927 -0
  237. package/dist/server/render-pages.d.ts +535 -0
  238. package/dist/server/render-pages.js +1277 -0
  239. package/dist/server/render-people.d.ts +32 -0
  240. package/dist/server/render-people.js +121 -0
  241. package/dist/server/render-results.d.ts +744 -0
  242. package/dist/server/render-results.js +2237 -0
  243. package/dist/server/render-settings.d.ts +154 -0
  244. package/dist/server/render-settings.js +580 -0
  245. package/dist/server/render-tasks.d.ts +632 -0
  246. package/dist/server/render-tasks.js +2345 -0
  247. package/dist/server/request-context.d.ts +46 -0
  248. package/dist/server/request-context.js +17 -0
  249. package/dist/server/route-table.d.ts +25 -3
  250. package/dist/server/route-table.js +167 -77
  251. package/dist/server/runtime.d.ts +28 -20
  252. package/dist/server/runtime.js +7 -1
  253. package/dist/server/session.d.ts +138 -0
  254. package/dist/server/session.js +94 -0
  255. package/dist/server/settings.d.ts +1 -5
  256. package/dist/server/settings.js +2186 -2121
  257. package/dist/server/task-views.d.ts +11 -4
  258. package/dist/server/task-views.js +26 -22
  259. package/dist/server/tasks.d.ts +9 -9
  260. package/dist/server/tasks.js +1489 -1420
  261. package/dist/server-telemetry.d.ts +4 -3
  262. package/dist/server-telemetry.js +4 -8
  263. package/dist/setup-guide.d.ts +2 -2
  264. package/dist/skills-ui.d.ts +4 -3
  265. package/dist/skills-ui.js +14 -17
  266. package/dist/skills.d.ts +1 -1
  267. package/dist/skills.js +2 -1
  268. package/dist/slack-chat.d.ts +2 -2
  269. package/dist/slack-chat.js +6 -6
  270. package/dist/slack-settings.d.ts +3 -2
  271. package/dist/slack-settings.js +17 -42
  272. package/dist/spend-ui.d.ts +5 -4
  273. package/dist/spend-ui.js +17 -40
  274. package/dist/spend.d.ts +14 -14
  275. package/dist/spend.js +31 -31
  276. package/dist/sso-ui.d.ts +3 -2
  277. package/dist/sso-ui.js +26 -27
  278. package/dist/storage-ui.d.ts +2 -1
  279. package/dist/storage-ui.js +14 -33
  280. package/dist/store-baseline.d.ts +19 -0
  281. package/dist/store-baseline.js +2873 -0
  282. package/dist/store.d.ts +197 -249
  283. package/dist/store.js +747 -3084
  284. package/dist/subagent-admin.d.ts +53 -0
  285. package/dist/{teammate-admin.js → subagent-admin.js} +37 -37
  286. package/dist/{teammate-desk.d.ts → subagent-desk.d.ts} +22 -23
  287. package/dist/{teammate-desk.js → subagent-desk.js} +26 -35
  288. package/dist/{teammate-memory.d.ts → subagent-memory.d.ts} +17 -17
  289. package/dist/{teammate-memory.js → subagent-memory.js} +41 -41
  290. package/dist/{teammate-question.d.ts → subagent-question.d.ts} +6 -6
  291. package/dist/{teammate-question.js → subagent-question.js} +17 -17
  292. package/dist/{teammate-tools.d.ts → subagent-tools.d.ts} +18 -18
  293. package/dist/{teammate-tools.js → subagent-tools.js} +36 -36
  294. package/dist/{teammate-week.d.ts → subagent-week.d.ts} +10 -10
  295. package/dist/{teammate-week.js → subagent-week.js} +23 -23
  296. package/dist/{teammate-work.d.ts → subagent-work.d.ts} +21 -21
  297. package/dist/{teammate-work.js → subagent-work.js} +50 -50
  298. package/dist/subagents-ui.d.ts +22 -0
  299. package/dist/subagents-ui.js +137 -0
  300. package/dist/{teammates.d.ts → subagents.d.ts} +11 -11
  301. package/dist/{teammates.js → subagents.js} +21 -21
  302. package/dist/subscription-chat.d.ts +13 -13
  303. package/dist/subscription-chat.js +19 -19
  304. package/dist/surface.d.ts +19 -2
  305. package/dist/surface.js +20 -33
  306. package/dist/task-composer.d.ts +2 -1
  307. package/dist/task-composer.js +7 -7
  308. package/dist/task-status.d.ts +4 -3
  309. package/dist/task-status.js +15 -16
  310. package/dist/team-cli.d.ts +1 -0
  311. package/dist/team-cli.js +14 -2
  312. package/dist/team-http.d.ts +5 -9
  313. package/dist/team-http.js +5 -63
  314. package/dist/team-leads.js +13 -13
  315. package/dist/team-runtime.d.ts +2 -2
  316. package/dist/team-runtime.js +8 -8
  317. package/dist/team-ui.d.ts +2 -1
  318. package/dist/team-ui.js +2 -5
  319. package/dist/teams-chat.js +6 -6
  320. package/dist/teams-settings.d.ts +3 -2
  321. package/dist/teams-settings.js +20 -31
  322. package/dist/telegram-flow.d.ts +3 -3
  323. package/dist/telegram-flow.js +3 -3
  324. package/dist/{telegram-mate.d.ts → telegram-lead.d.ts} +5 -5
  325. package/dist/{telegram-mate.js → telegram-lead.js} +27 -27
  326. package/dist/telegram-settings.d.ts +3 -2
  327. package/dist/telegram-settings.js +14 -25
  328. package/dist/telegram-status.js +1 -1
  329. package/dist/telegram-team.d.ts +1 -1
  330. package/dist/telegram-team.js +5 -5
  331. package/dist/telegram.d.ts +1 -1
  332. package/dist/telegram.js +9 -30
  333. package/dist/text-limits.d.ts +18 -18
  334. package/dist/text-limits.js +18 -18
  335. package/dist/toolroll-update-ui.d.ts +3 -2
  336. package/dist/toolroll-update-ui.js +35 -39
  337. package/dist/toolroll-update.d.ts +8 -0
  338. package/dist/toolroll-update.js +45 -8
  339. package/dist/tools-ui.d.ts +5 -2
  340. package/dist/tools-ui.js +31 -31
  341. package/dist/when-html.d.ts +11 -3
  342. package/dist/when-html.js +5 -6
  343. package/dist/workspace-ui.d.ts +4 -2
  344. package/dist/workspace-ui.js +10 -10
  345. package/package.json +1 -2
  346. package/dist/server/shared.d.ts +0 -3151
  347. package/dist/server/shared.js +0 -12001
  348. package/dist/teammate-admin.d.ts +0 -53
  349. package/dist/teammates-ui.d.ts +0 -20
  350. package/dist/teammates-ui.js +0 -166
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 mateTimeoutNotice(keptProposals: boolean, unknownCost?: boolean): string;
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 mateTurnKeepsProposals(turn: {
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 MATE_ASK_SCHEMA = "\nCREATE TABLE IF NOT EXISTS mate_ask (\n turn INTEGER PRIMARY KEY REFERENCES mate_turn(id) ON DELETE CASCADE,\n thread INTEGER NOT NULL REFERENCES mate_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 mate_ask_thread ON mate_ask (thread, turn);\n";
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 MateAsk = {
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 MATE_ASK_OTHER = "Something else";
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 MATE_ASK_TTL_MS: number;
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 = 116;
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 mate turn. */
469
+ /** 'chat' = fleet chat v13, one request; 'mate-step' = one request of a lead turn. */
459
470
  kind: "chat" | "mate-step";
460
- mateTurn: number | null;
471
+ leadTurn: number | null;
461
472
  };
462
- export type MateSession = {
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 MateThreadScope = {
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: MateThreadScope;
487
- export type MateThread = {
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: MateThreadScope;
505
+ scope: LeadThreadScope;
495
506
  };
496
507
  /** A thread as the chat list shows it: its scope and its latest message. */
497
- export type MateThreadSummary = MateThread & {
508
+ export type LeadThreadSummary = LeadThread & {
498
509
  lastMessageAt: string | null;
499
510
  lastMessage: string | null;
500
511
  messages: number;
501
512
  };
502
- export type MateMessage = {
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 MateProposalKind = "task" | "next" | "reserve" | "hold" | "unhold" | "steer" | "scope" | "cancel" | "answer" | "repair" | "agents" | "review" | "control" | "task_action" | "action";
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 mate's (no `task` — filing has its own door), confirmed by
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 MateProposalState = "drafting" | "pending" | "confirming" | "confirmed" | "refused" | "dismissed" | "expired";
532
- export type MateProposal = {
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: MateProposalKind;
547
+ kind: LeadProposalKind;
537
548
  payload: Record<string, unknown>;
538
549
  ceilingDigest: string;
539
- state: MateProposalState;
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" | "teammate";
547
- /** An AI teammate (v92): who it is lives in its soul file; `handle` is how zones and chat name it. */
548
- export type TeammateRow = {
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 TeammateEventKind = "decided" | "handled" | "handed" | "asked" | "answered" | "note" | "paused" | "resumed" | "summary" | "failed";
569
- export type TeammateEventRow = {
579
+ export type SubagentEventKind = "decided" | "handled" | "handed" | "asked" | "answered" | "note" | "paused" | "resumed" | "summary" | "failed";
580
+ export type SubagentEventRow = {
570
581
  id: number;
571
- teammate: number;
582
+ subagent: number;
572
583
  card: number | null;
573
584
  entry: number | null;
574
- kind: TeammateEventKind;
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 TeammateQuestionRow = {
591
+ export type SubagentQuestionRow = {
581
592
  id: number;
582
- teammate: number;
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 teammate's own). */
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 teammate remembers: kept by it on a turn, or told it by a person. */
604
- export type TeammateMemoryRow = {
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
- teammate: number;
617
+ subagent: number;
607
618
  text: string;
608
- source: "teammate" | "person";
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 teammate suggests from what its people approved. */
617
- export type TeammateSuggestionRow = {
627
+ /** v95: a rule change a subagent suggests from what its people approved. */
628
+ export type SubagentSuggestionRow = {
618
629
  id: number;
619
- teammate: number;
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 teammate's rule for one action: do it, ask first, or never; "free" may ask first above a number in its input. */
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 TeammateGrantRow = {
636
- teammate: number;
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 TeammateCallState = "asked" | "approved" | "denied" | "refused" | "running" | "done" | "failed";
645
- /** v94: a tool call a teammate made, or asked to make, on one visit of a card: the receipt. */
646
- export type TeammateCallRow = {
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
- teammate: number;
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: TeammateCallState;
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 teammate took. */
668
- export type TeammateTurnRow = {
678
+ /** v97: one model turn a subagent took. */
679
+ export type SubagentTurnRow = {
669
680
  id: number;
670
- teammate: number;
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 MateTurn = {
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 mate request receipt identity: 32 hex, derived from bot, binding and update. */
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 mate turn selected for an exact result (v64): trusted identities only, never bytes or paths. */
1405
- export type MateTurnEvidence = {
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;
@@ -3105,7 +3053,7 @@ export declare class Store {
3105
3053
  };
3106
3054
  /** Comments to consume, or null when the brief has no comment batch (CI / criterion repair). */
3107
3055
  commentIds: readonly number[] | null;
3108
- /** v102: who asked for this revision (a person, an AI teammate's "Name (AI)", or none for machine repairs): its filer. */
3056
+ /** v102: who asked for this revision (a person, a subagent's "Name (AI)", or none for machine repairs): its filer. */
3109
3057
  requestedBy?: string | null;
3110
3058
  /** Fresh mode filing coverage, re-proved by the caller INSIDE this
3111
3059
  * transaction (never carried across one): its budget default may only
@@ -3866,7 +3814,7 @@ export declare class Store {
3866
3814
  * where not — the same arithmetic the admission transaction uses. */
3867
3815
  chatWeeklySpendMicrousd(credentialKey: string, now: Date): number;
3868
3816
  private chatOnlyWeeklySpendMicrousd;
3869
- /** The day's turns: fleet chat turns plus mate turns — a mate turn is
3817
+ /** The day's turns: fleet chat turns plus lead turns — a lead turn is
3870
3818
  * one turn however many steps it took (slice-1 review, finding 11). */
3871
3819
  chatTurnsToday(approver: string, now: Date): number;
3872
3820
  /** Turns blocking this credential until somebody owns the worst case. */
@@ -4340,7 +4288,7 @@ export declare class Store {
4340
4288
  policyHistory(limit?: number): LedgerEntry[];
4341
4289
  /** Why the policy stops a task's approved terms (its profile, every routed leg), or null. */
4342
4290
  scopePolicyRefusal(taskId: string): string | null;
4343
- /** Why the policy stops an agent on a provider and model now, or null (chats, teammates, flow steps). */
4291
+ /** Why the policy stops an agent on a provider and model now, or null (chats, subagents, flow steps). */
4344
4292
  agentPolicyRefusal(provider: string, model: string | null): string | null;
4345
4293
  /** Why the policy stops a planner, scout or native coding session (no profile to lower) on a provider and model, or null. */
4346
4294
  sessionPolicyRefusal(provider: string, model: string | null, what: string): string | null;
@@ -4395,7 +4343,7 @@ export declare class Store {
4395
4343
  budgetGate(now: Date): (work: {
4396
4344
  project: string | null;
4397
4345
  person: string | null;
4398
- teammate: number | null;
4346
+ subagent: number | null;
4399
4347
  agents?: readonly BudgetAgent[];
4400
4348
  }) => BudgetHold;
4401
4349
  /** How each provider would bill new work now (see spend.billingOf). */
@@ -4407,11 +4355,11 @@ export declare class Store {
4407
4355
  /** v105: how a run was really billed, from its own evidence, fixed before its usage is priced. */
4408
4356
  fixRunBilling(id: number, billing: Billing, now: Date): void;
4409
4357
  /** What a task's new work counts toward: its project, its filer (a person, or the person behind a coordinator), and
4410
- * the teammate that filed it. A revision (an automatic repair included) counts as its source task's. */
4358
+ * the subagent that filed it. A revision (an automatic repair included) counts as its source task's. */
4411
4359
  budgetSubject(taskRef: number): {
4412
4360
  project: string | null;
4413
4361
  person: string | null;
4414
- teammate: number | null;
4362
+ subagent: number | null;
4415
4363
  };
4416
4364
  /**
4417
4365
  * Stamp the machine's current phase on an OPEN run. A closed run's phase
@@ -4829,7 +4777,7 @@ export declare class Store {
4829
4777
  /**
4830
4778
  * Every live binding for a bot, oldest first — and only while each approver's credential generation still matches.
4831
4779
  * A rotation that somehow missed the sweep reads as no binding at all, which is the failure direction that fails
4832
- * closed. Several teammates may each hold one (v72); nothing here ranks them.
4780
+ * closed. Several subagents may each hold one (v72); nothing here ranks them.
4833
4781
  */
4834
4782
  liveTelegramBindings(botId: string): TelegramBinding[];
4835
4783
  /** The live binding one Telegram user holds with a bot, if any. */
@@ -4841,7 +4789,7 @@ export declare class Store {
4841
4789
  * `liveTelegramBindings` / `liveTelegramBindingFor` instead. */
4842
4790
  liveTelegramBinding(botId: string): TelegramBinding | null;
4843
4791
  /** Revoke every live binding one person holds with a bot, and everything
4844
- * those chats could still do. Teammates' bindings are untouched. */
4792
+ * those chats could still do. Subagents' bindings are untouched. */
4845
4793
  unpairTelegram(botId: string, by: string, now: Date): boolean;
4846
4794
  createTelegramAction(...args: Parameters<ChatMessages["createDecisionAction"]>): ReturnType<ChatMessages["createDecisionAction"]>;
4847
4795
  recordTelegramDecisionMessage(...args: Parameters<ChatMessages["recordDecisionMessage"]>): ReturnType<ChatMessages["recordDecisionMessage"]>;
@@ -5106,8 +5054,8 @@ export declare class Store {
5106
5054
  model: string | null;
5107
5055
  repo: string | null;
5108
5056
  }[];
5109
- /** Delegated chat spend, signed once: the row every mate turn debits. */
5110
- mintMateSession(args: {
5057
+ /** Delegated chat spend, signed once: the row every lead turn debits. */
5058
+ mintLeadSession(args: {
5111
5059
  approver: string;
5112
5060
  approverGeneration: number;
5113
5061
  credentialKey: string;
@@ -5125,31 +5073,31 @@ export declare class Store {
5125
5073
  termsDigest: string;
5126
5074
  thread: number;
5127
5075
  }, now: Date): number;
5128
- teamMateSession(approver: string, thread: number): MateSession | null;
5129
- openTeamMateThread(approver: string, ceilingDigest: string, now: Date): MateThread;
5076
+ teamMateSession(approver: string, thread: number): LeadSession | null;
5077
+ openTeamMateThread(approver: string, ceilingDigest: string, now: Date): LeadThread;
5130
5078
  canUseTeamMateThread(approver: string, generation: number, thread: number): boolean;
5131
5079
  /** Rechecked at admission; membership never grants project or approval standing. */
5132
5080
  teamMateThreadAllows(thread: number, approver: string, generation: number): boolean;
5133
5081
  /** The live session — explicitly ended or still active. Exhaustion is the caller's arithmetic. */
5134
- activeMateSession(approver: string): MateSession | null;
5135
- getMateSession(id: number): MateSession | null;
5136
- endMateSession(id: number, by: string, now: Date): boolean;
5082
+ activeLeadSession(approver: string): LeadSession | null;
5083
+ getLeadSession(id: number): LeadSession | null;
5084
+ endLeadSession(id: number, by: string, now: Date): boolean;
5137
5085
  /** Revocation's companion (ruling 10): an approver's standing ends every session it minted. */
5138
- endMateSessionsFor(approver: string, by: string, now: Date): number;
5086
+ endLeadSessionsFor(approver: string, by: string, now: Date): number;
5139
5087
  /** The live thread for this approver and scope under THIS ceiling; a
5140
5088
  * thread under another ceiling is closed first (ruling 9) — the surface
5141
5089
  * says why. The lead conversation is the default scope. */
5142
- openMateThread(approver: string, ceilingDigest: string, now: Date, scope?: MateThreadScope): {
5143
- thread: MateThread;
5090
+ openLeadThread(approver: string, ceilingDigest: string, now: Date, scope?: LeadThreadScope): {
5091
+ thread: LeadThread;
5144
5092
  ceilingChanged: boolean;
5145
5093
  };
5146
5094
  /** The approver's live thread for one scope, read only — null when none is open. */
5147
- liveMateThreadFor(approver: string, scope?: MateThreadScope): MateThread | null;
5095
+ liveLeadThreadFor(approver: string, scope?: LeadThreadScope): LeadThread | null;
5148
5096
  /** The lead thread a ceiling change closed just before `current` (ruling 9),
5149
5097
  * read only and for display only: it never continues and never reaches the
5150
5098
  * model. Null when there is none, when it was ended or revoked (its text is
5151
5099
  * gone), or when it closed under the same ceiling. */
5152
- replacedLeadThread(current: MateThread): MateThread | null;
5100
+ replacedLeadThread(current: LeadThread): LeadThread | null;
5153
5101
  /** The task a paired chat is talking about (v78), or null for the lead conversation. */
5154
5102
  chatFocus(surface: string, binding: number): string | null;
5155
5103
  setChatFocus(surface: string, binding: number, task: string | null, now: Date): void;
@@ -5247,7 +5195,7 @@ export declare class Store {
5247
5195
  failures: number;
5248
5196
  lastOutcome: string | null;
5249
5197
  }, now: Date): void;
5250
- createTeammate(mate: {
5198
+ createSubagent(mate: {
5251
5199
  repo: string;
5252
5200
  handle: string;
5253
5201
  soul: string;
@@ -5255,42 +5203,42 @@ export declare class Store {
5255
5203
  manager: string;
5256
5204
  by: string;
5257
5205
  }, now: Date): number;
5258
- getTeammate(id: number): TeammateRow | null;
5259
- /** The teammate a zone names in a project (paused ones too; never a removed one). */
5260
- teammateByHandle(repo: string, handle: string): TeammateRow | null;
5261
- teammates(repos: readonly string[]): TeammateRow[];
5262
- /** A new version of a teammate's soul file; false when nothing changed. */
5263
- saveTeammateSoul(id: number, soul: string, by: string, now: Date): boolean;
5264
- teammateVersions(id: number): {
5206
+ getSubagent(id: number): SubagentRow | null;
5207
+ /** The subagent a zone names in a project (paused ones too; never a removed one). */
5208
+ subagentByHandle(repo: string, handle: string): SubagentRow | null;
5209
+ subagents(repos: readonly string[]): SubagentRow[];
5210
+ /** A new version of a subagent's soul file; false when nothing changed. */
5211
+ saveSubagentSoul(id: number, soul: string, by: string, now: Date): boolean;
5212
+ subagentVersions(id: number): {
5265
5213
  version: number;
5266
5214
  soul: string;
5267
5215
  savedBy: string;
5268
5216
  savedAt: string;
5269
5217
  }[];
5270
- updateTeammate(id: number, change: {
5271
- state?: TeammateRow["state"];
5218
+ updateSubagent(id: number, change: {
5219
+ state?: SubagentRow["state"];
5272
5220
  model?: string | null;
5273
5221
  dailyTurns?: number;
5274
5222
  manager?: string;
5275
5223
  summaryAt?: string;
5276
5224
  weeklyAt?: string;
5277
5225
  }, by: string, now: Date): void;
5278
- addTeammateEvent(event: {
5279
- teammate: number;
5226
+ addSubagentEvent(event: {
5227
+ subagent: number;
5280
5228
  card?: number | null;
5281
5229
  entry?: number | null;
5282
- kind: TeammateEventKind;
5230
+ kind: SubagentEventKind;
5283
5231
  said: string;
5284
5232
  detail?: Record<string, unknown> | null;
5285
5233
  by?: string | null;
5286
5234
  }, now: Date): number;
5287
- /** A teammate's log, newest first; `since` bounds it (a day's summary). */
5288
- teammateEvents(teammate: number, limit: number, since?: string | null): TeammateEventRow[];
5289
- /** How many turns (decisions, handled cards, hand-offs, questions, failures, and v94 tool calls) a teammate took since a time: its daily limit. */
5290
- teammateTurnsSince(teammate: number, since: string): number;
5235
+ /** A subagent's log, newest first; `since` bounds it (a day's summary). */
5236
+ subagentEvents(subagent: number, limit: number, since?: string | null): SubagentEventRow[];
5237
+ /** How many turns (decisions, handled cards, hand-offs, questions, failures, and v94 tool calls) a subagent took since a time: its daily limit. */
5238
+ subagentTurnsSince(subagent: number, since: string): number;
5291
5239
  /** 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
- openTeammateQuestion(question: {
5293
- teammate: number;
5240
+ openSubagentQuestion(question: {
5241
+ subagent: number;
5294
5242
  card: number;
5295
5243
  entry: number;
5296
5244
  question: string;
@@ -5303,30 +5251,30 @@ export declare class Store {
5303
5251
  suggestion?: number;
5304
5252
  }, now: Date): number | null;
5305
5253
  /** v94: the first question still open on one visit of a card: its own, or a tool call's approval. */
5306
- openTeammateQuestionOn(card: number, entry: number): TeammateQuestionRow | null;
5254
+ openSubagentQuestionOn(card: number, entry: number): SubagentQuestionRow | null;
5307
5255
  /** v94: the approval question of one tool call. */
5308
- teammateQuestionForCall(call: number): TeammateQuestionRow | null;
5309
- /** v96: the flow a teammate's desk is. */
5310
- setTeammateDesk(id: number, flow: number): void;
5311
- addTeammateMemory(memory: {
5312
- teammate: number;
5256
+ subagentQuestionForCall(call: number): SubagentQuestionRow | null;
5257
+ /** v96: the flow a subagent's desk is. */
5258
+ setSubagentDesk(id: number, flow: number): void;
5259
+ addSubagentMemory(memory: {
5260
+ subagent: number;
5313
5261
  text: string;
5314
- source: TeammateMemoryRow["source"];
5262
+ source: SubagentMemoryRow["source"];
5315
5263
  card?: number | null;
5316
5264
  by: string;
5317
5265
  }, now: Date): number;
5318
- teammateMemory(id: number): TeammateMemoryRow | null;
5319
- /** What a teammate remembers now, newest first: one source, and every word of `words` (any case), when given. */
5320
- teammateMemories(teammate: number, options?: {
5321
- source?: TeammateMemoryRow["source"];
5266
+ subagentMemory(id: number): SubagentMemoryRow | null;
5267
+ /** What a subagent remembers now, newest first: one source, and every word of `words` (any case), when given. */
5268
+ subagentMemories(subagent: number, options?: {
5269
+ source?: SubagentMemoryRow["source"];
5322
5270
  words?: readonly string[];
5323
5271
  limit?: number;
5324
- }): TeammateMemoryRow[];
5325
- editTeammateMemory(id: number, text: string, by: string, now: Date): boolean;
5326
- forgetTeammateMemory(id: number, by: string, now: Date): boolean;
5327
- markTeammateMemoriesUsed(ids: readonly number[], now: Date): void;
5328
- addTeammateSuggestion(suggestion: {
5329
- teammate: number;
5272
+ }): SubagentMemoryRow[];
5273
+ editSubagentMemory(id: number, text: string, by: string, now: Date): boolean;
5274
+ forgetSubagentMemory(id: number, by: string, now: Date): boolean;
5275
+ markSubagentMemoriesUsed(ids: readonly number[], now: Date): void;
5276
+ addSubagentSuggestion(suggestion: {
5277
+ subagent: number;
5330
5278
  tool: string;
5331
5279
  action: string;
5332
5280
  rule: ToolRule;
@@ -5334,27 +5282,27 @@ export declare class Store {
5334
5282
  evidence: number[];
5335
5283
  said: string;
5336
5284
  }, now: Date): number;
5337
- teammateSuggestion(id: number): TeammateSuggestionRow | null;
5338
- /** A teammate's suggestions about one action, newest first. */
5339
- teammateSuggestionsFor(teammate: number, tool: string, action: string): TeammateSuggestionRow[];
5340
- teammateSuggestions(teammate: number, limit?: number): TeammateSuggestionRow[];
5285
+ subagentSuggestion(id: number): SubagentSuggestionRow | null;
5286
+ /** A subagent's suggestions about one action, newest first. */
5287
+ subagentSuggestionsFor(subagent: number, tool: string, action: string): SubagentSuggestionRow[];
5288
+ subagentSuggestions(subagent: number, limit?: number): SubagentSuggestionRow[];
5341
5289
  /** Decide a suggestion, once: false when it was already decided. */
5342
- decideTeammateSuggestion(id: number, state: "accepted" | "dismissed" | "stale", by: string | null, now: Date): boolean;
5290
+ decideSubagentSuggestion(id: number, state: "accepted" | "dismissed" | "stale", by: string | null, now: Date): boolean;
5343
5291
  /** v95: the question that offers a suggestion to its manager. */
5344
- teammateQuestionForSuggestion(suggestion: number): TeammateQuestionRow | null;
5345
- teammateGrants(teammate: number): TeammateGrantRow[];
5346
- teammateGrant(teammate: number, tool: string): TeammateGrantRow | null;
5292
+ subagentQuestionForSuggestion(suggestion: number): SubagentQuestionRow | null;
5293
+ subagentGrants(subagent: number): SubagentGrantRow[];
5294
+ subagentGrant(subagent: number, tool: string): SubagentGrantRow | null;
5347
5295
  /** Grant a tool, or change what it offers and the rules: the whole row is written. `listedAt` undefined keeps it. */
5348
- saveTeammateGrant(grant: {
5349
- teammate: number;
5296
+ saveSubagentGrant(grant: {
5297
+ subagent: number;
5350
5298
  tool: string;
5351
5299
  actions: ToolActionInfo[];
5352
5300
  rules: Record<string, ToolRule>;
5353
5301
  listedAt?: string | null;
5354
5302
  }, by: string, now: Date): void;
5355
- dropTeammateGrant(teammate: number, tool: string, by: string, now: Date): boolean;
5356
- addTeammateCall(call: {
5357
- teammate: number;
5303
+ dropSubagentGrant(subagent: number, tool: string, by: string, now: Date): boolean;
5304
+ addSubagentCall(call: {
5305
+ subagent: number;
5358
5306
  card: number;
5359
5307
  entry: number;
5360
5308
  tool: string;
@@ -5362,32 +5310,32 @@ export declare class Store {
5362
5310
  input: Record<string, unknown>;
5363
5311
  rule: ToolRule["use"];
5364
5312
  why: string;
5365
- state: TeammateCallState;
5313
+ state: SubagentCallState;
5366
5314
  result?: string | null;
5367
5315
  undoOf?: number;
5368
5316
  decidedBy?: string;
5369
5317
  }, now: Date): number;
5370
- /** v103: a teammate's tool call in the ledger, as the teammate (or the person who decided it), on its card's task. */
5371
- private recordTeammateCall;
5318
+ /** v103: a subagent's tool call in the ledger, as the subagent (or the person who decided it), on its card's task. */
5319
+ private recordSubagentCall;
5372
5320
  /** v97: a call was undone by a person; false when it already was. */
5373
- markTeammateCallUndone(id: number, by: string, now: Date): boolean;
5374
- /** v97: cards someone moved by hand right after this actor (a teammate) moved them, since a time: what people overrode. */
5321
+ markSubagentCallUndone(id: number, by: string, now: Date): boolean;
5322
+ /** v97: cards someone moved by hand right after this actor (a subagent) moved them, since a time: what people overrode. */
5375
5323
  flowMovesOverridden(actor: string, since: string): {
5376
5324
  card: number;
5377
5325
  flow: number;
5378
5326
  title: string;
5379
- teammateTo: string;
5327
+ subagentTo: string;
5380
5328
  personTo: string;
5381
5329
  by: string;
5382
5330
  at: string;
5383
5331
  }[];
5384
5332
  /** v97: undo calls a person asked for that aren't made yet. */
5385
- pendingTeammateUndos(): TeammateCallRow[];
5333
+ pendingSubagentUndos(): SubagentCallRow[];
5386
5334
  /** v97: an undo that failed leaves the call as it was. */
5387
- clearTeammateCallUndone(id: number, now: Date): void;
5388
- /** v97: one model turn a teammate took, with what it cost. */
5389
- addTeammateTurn(turn: {
5390
- teammate: number;
5335
+ clearSubagentCallUndone(id: number, now: Date): void;
5336
+ /** v97: one model turn a subagent took, with what it cost. */
5337
+ addSubagentTurn(turn: {
5338
+ subagent: number;
5391
5339
  card: number | null;
5392
5340
  model: string;
5393
5341
  ok: boolean;
@@ -5402,31 +5350,31 @@ export declare class Store {
5402
5350
  model: string | null;
5403
5351
  costUsd: number | null;
5404
5352
  }, now: Date): void;
5405
- teammateTurns(teammate: number, since: string): TeammateTurnRow[];
5406
- teammateCall(id: number): TeammateCallRow | null;
5353
+ subagentTurns(subagent: number, since: string): SubagentTurnRow[];
5354
+ subagentCall(id: number): SubagentCallRow | null;
5407
5355
  /** Move a call on, only from the state it is known to be in: false when someone else moved it first. */
5408
- moveTeammateCall(id: number, from: readonly TeammateCallState[], change: {
5409
- state: TeammateCallState;
5356
+ moveSubagentCall(id: number, from: readonly SubagentCallState[], change: {
5357
+ state: SubagentCallState;
5410
5358
  result?: string | null;
5411
5359
  decidedBy?: string;
5412
5360
  }, now: Date): boolean;
5413
5361
  /** A card's receipts, oldest first: one visit (`entry`), or every visit. */
5414
- teammateCallsOn(card: number, entry?: number | null): TeammateCallRow[];
5415
- /** A teammate's receipts, newest first; `since` bounds them (a day's summary). */
5416
- teammateCallsOf(teammate: number, limit: number, since?: string | null): TeammateCallRow[];
5417
- teammateQuestion(id: number): TeammateQuestionRow | null;
5418
- /** The question a teammate asked of its own on one visit (never a tool call's approval). */
5419
- teammateQuestionFor(card: number, entry: number): TeammateQuestionRow | null;
5420
- /** Open questions for these teammates, oldest first. */
5421
- openTeammateQuestions(teammates: readonly number[]): TeammateQuestionRow[];
5362
+ subagentCallsOn(card: number, entry?: number | null): SubagentCallRow[];
5363
+ /** A subagent's receipts, newest first; `since` bounds them (a day's summary). */
5364
+ subagentCallsOf(subagent: number, limit: number, since?: string | null): SubagentCallRow[];
5365
+ subagentQuestion(id: number): SubagentQuestionRow | null;
5366
+ /** The question a subagent asked of its own on one visit (never a tool call's approval). */
5367
+ subagentQuestionFor(card: number, entry: number): SubagentQuestionRow | null;
5368
+ /** Open questions for these subagents, oldest first. */
5369
+ openSubagentQuestions(subagents: readonly number[]): SubagentQuestionRow[];
5422
5370
  /** The answer, once: false when it was already answered (or dropped). */
5423
- answerTeammateQuestion(id: number, answer: {
5371
+ answerSubagentQuestion(id: number, answer: {
5424
5372
  choice: string | null;
5425
5373
  text: string | null;
5426
5374
  by: string;
5427
5375
  via: string;
5428
5376
  }, now: Date): boolean;
5429
- dropTeammateQuestion(id: number, now: Date): void;
5377
+ dropSubagentQuestion(id: number, now: Date): void;
5430
5378
  /** A step waiting on a person's answer becomes due now (the answer came). */
5431
5379
  wakeFlowStep(card: number, entry: number, now: Date): void;
5432
5380
  /** Cards arriving in one zone of a flow after a history line: what a trigger on another flow follows. */
@@ -5620,12 +5568,12 @@ export declare class Store {
5620
5568
  recordTelegramTaskMessage(...args: Parameters<ChatMessages["recordTaskMessage"]>): ReturnType<ChatMessages["recordTaskMessage"]>;
5621
5569
  /** The approver's live personal threads that have messages, most recent
5622
5570
  * first — the chat list. Team conversations list themselves. */
5623
- listMateThreads(approver: string, limit?: number): MateThreadSummary[];
5624
- getMateThread(id: number): MateThread | null;
5571
+ listLeadThreads(approver: string, limit?: number): LeadThreadSummary[];
5572
+ getLeadThread(id: number): LeadThread | null;
5625
5573
  /** `--end` and revocation: the thread's text and every proposal in it are
5626
5574
  * deleted; the thread row stays as closed metadata (when, whose). */
5627
- closeMateThreadsFor(approver: string, now: Date): number;
5628
- appendMateMessage(message: {
5575
+ closeLeadThreadsFor(approver: string, now: Date): number;
5576
+ appendLeadMessage(message: {
5629
5577
  thread: number;
5630
5578
  turn: number | null;
5631
5579
  role: "operator" | "assistant";
@@ -5633,37 +5581,37 @@ export declare class Store {
5633
5581
  activity?: string | null;
5634
5582
  }, now: Date): number;
5635
5583
  /** The last `limit` messages, oldest first. */
5636
- listMateMessages(thread: number, limit: number): MateMessage[];
5584
+ listLeadMessages(thread: number, limit: number): LeadMessage[];
5637
5585
  /** A proposal is inert (`drafting`) until its turn finalizes. */
5638
- draftMateProposal(proposal: {
5586
+ draftLeadProposal(proposal: {
5639
5587
  thread: number;
5640
5588
  turn: number;
5641
- kind: MateProposalKind;
5589
+ kind: LeadProposalKind;
5642
5590
  payload: Record<string, unknown>;
5643
5591
  ceilingDigest: string;
5644
5592
  }, now: Date): number;
5645
5593
  /** Record this turn's one question; false when the turn already asked one. */
5646
- recordMateAsk(ask: {
5594
+ recordLeadAsk(ask: {
5647
5595
  turn: number;
5648
5596
  thread: number;
5649
5597
  question: string;
5650
5598
  options: readonly string[];
5651
5599
  }, now: Date): boolean;
5652
5600
  /** A failed turn keeps no question, as it keeps no drafts. */
5653
- dropMateAsk(turn: number): void;
5601
+ dropLeadAsk(turn: number): void;
5654
5602
  /** The question an ANSWERED turn asked; null when it asked none or did not answer. */
5655
- mateAsk(turn: number): MateAsk | null;
5603
+ leadAsk(turn: number): LeadAsk | null;
5656
5604
  /** What a tap on the question finds: open; answered (its owner has written in its thread since the reply that asked
5657
5605
  * it, typed or tapped; a turn the lead started itself, or another person's message, is no answer); or expired (older
5658
- * than MATE_ASK_TTL_MS, or the question or the reply that asked it is gone, as after a retention purge). */
5659
- mateAskState(turn: number, now: Date): {
5606
+ * than LEAD_ASK_TTL_MS, or the question or the reply that asked it is gone, as after a retention purge). */
5607
+ leadAskState(turn: number, now: Date): {
5660
5608
  state: "open";
5661
- ask: MateAsk;
5609
+ ask: LeadAsk;
5662
5610
  } | {
5663
5611
  state: "answered" | "expired";
5664
5612
  };
5665
- /** The question while it is open (see mateAskState); null otherwise. */
5666
- mateAskOpen(turn: number, now: Date): MateAsk | null;
5613
+ /** The question while it is open (see leadAskState); null otherwise. */
5614
+ leadAskOpen(turn: number, now: Date): LeadAsk | null;
5667
5615
  /**
5668
5616
  * Record the screenshots one turn selected for an exact result, under the
5669
5617
  * turn, so a channel that delivers files can plan them from the completed
@@ -5672,25 +5620,25 @@ export declare class Store {
5672
5620
  * before upload. A turn holds at most `cap` images; the same artifact is
5673
5621
  * recorded once. Returns how many of THESE rows are recorded after the call.
5674
5622
  */
5675
- recordMateTurnEvidence(turn: number, rows: readonly Omit<MateTurnEvidence, "turn" | "ordinal" | "createdAt">[], cap: number, now: Date): number;
5623
+ recordLeadTurnEvidence(turn: number, rows: readonly Omit<LeadTurnEvidence, "turn" | "ordinal" | "createdAt">[], cap: number, now: Date): number;
5676
5624
  /** The screenshots a turn selected, in selection order — meaningful only for a turn that ANSWERED (a failed turn's rows are deleted). */
5677
- listMateTurnEvidence(turn: number): MateTurnEvidence[];
5625
+ listLeadTurnEvidence(turn: number): LeadTurnEvidence[];
5678
5626
  /** A failed turn's selection is DELETED with its drafts: nothing a failed turn selected is ever sent. */
5679
- discardMateTurnEvidence(turn: number): number;
5627
+ discardLeadTurnEvidence(turn: number): number;
5680
5628
  /** Drafts become confirmable only under a turn that ANSWERED (review finding 12). */
5681
- promoteMateProposals(turn: number): number;
5629
+ promoteLeadProposals(turn: number): number;
5682
5630
  /** A failed turn's drafts are DELETED — nothing a failed turn produced is durable (finding 4). */
5683
- discardMateProposals(turn: number): number;
5684
- getMateProposal(id: number): MateProposal | null;
5685
- listMateProposals(thread: number, states?: readonly MateProposalState[]): MateProposal[];
5631
+ discardLeadProposals(turn: number): number;
5632
+ getLeadProposal(id: number): LeadProposal | null;
5633
+ listLeadProposals(thread: number, states?: readonly LeadProposalState[]): LeadProposal[];
5686
5634
  /** The state CAS confirmation rides on (ruling 7). */
5687
- casMateProposal(id: number, from: MateProposalState, to: MateProposalState, by: string | null, outcome: Record<string, unknown> | null, now: Date): boolean;
5635
+ casLeadProposal(id: number, from: LeadProposalState, to: LeadProposalState, by: string | null, outcome: Record<string, unknown> | null, now: Date): boolean;
5688
5636
  /**
5689
5637
  * The turn's reservation, in ONE transaction against the session and the
5690
5638
  * weekly ledger, before any dispatch (ruling 5). One live turn per
5691
5639
  * approver serializes the console and the CLI.
5692
5640
  */
5693
- openMateTurn(args: {
5641
+ openLeadTurn(args: {
5694
5642
  approver: string;
5695
5643
  session: number;
5696
5644
  thread: number;
@@ -5707,17 +5655,17 @@ export declare class Store {
5707
5655
  ok: false;
5708
5656
  reason: "latched" | "concurrent" | "daily-cap" | "session-exhausted" | "session-ended" | "not-yours" | "thread-closed" | "over-budget" | "monthly-budget";
5709
5657
  };
5710
- startMateTurn(id: number, now: Date): {
5658
+ startLeadTurn(id: number, now: Date): {
5711
5659
  ok: true;
5712
5660
  generation: number;
5713
5661
  } | {
5714
5662
  ok: false;
5715
5663
  };
5716
- /** One provider request of a mate turn: a chat_turn row of kind
5664
+ /** One provider request of a lead turn: a chat_turn row of kind
5717
5665
  * 'mate-step', reserved at zero (the turn holds the reservation), with
5718
5666
  * the same dispatch CAS, terminal CAS, and crash latch as fleet chat. */
5719
- openMateStep(args: {
5720
- mateTurn: number;
5667
+ openLeadStep(args: {
5668
+ leadTurn: number;
5721
5669
  generation: number;
5722
5670
  approver: string;
5723
5671
  credentialKey: string;
@@ -5739,7 +5687,7 @@ export declare class Store {
5739
5687
  * releases money it cannot prove was not spent; acknowledging the step
5740
5688
  * later does not refund it.
5741
5689
  */
5742
- finalizeMateTurn(id: number, generation: number, outcome: {
5690
+ finalizeLeadTurn(id: number, generation: number, outcome: {
5743
5691
  state: "answered" | "failed";
5744
5692
  settledMicrousd: number;
5745
5693
  unknownSpend?: boolean;
@@ -5756,18 +5704,18 @@ export declare class Store {
5756
5704
  }, now: Date): boolean;
5757
5705
  /** A turn stopped at its deadline: the proposals its completed tool calls drafted (each validated when drafted) go pending, as an
5758
5706
  * answered turn's do; anything the provider sent after them was never acted on. Every other failure still deletes its drafts. */
5759
- private keepTimedOutMateProposals;
5707
+ private keepTimedOutLeadProposals;
5760
5708
  /** Revocation's companion for a loop in flight (finding 5): every live
5761
5709
  * turn of the approver fails NOW, charged its whole reservation, its
5762
5710
  * generation moved so the returning loop's terminal CAS loses. */
5763
- failLiveMateTurnsFor(approver: string, reason: string, now: Date, privateOnly?: boolean): number;
5711
+ failLiveLeadTurnsFor(approver: string, reason: string, now: Date, privateOnly?: boolean): number;
5764
5712
  /** The crash sweep for turns: past the deadline, failed. The session is
5765
5713
  * charged the settled sum of the steps that answered — unless any step
5766
5714
  * is unproven (dispatched and never settled, or latched), in which case
5767
5715
  * the WHOLE reservation is charged (finding 1). Like a turn that stopped
5768
5716
  * at its own deadline, it keeps the proposals its completed tool calls
5769
5717
  * drafted and says, in the thread, that the reply took too long. */
5770
- sweepStaleMateTurns(now: Date): number;
5718
+ sweepStaleLeadTurns(now: Date): number;
5771
5719
  /** A task_ref by its row id: the external id and repo — for decisions, which hang off runs. */
5772
5720
  refById(id: number): {
5773
5721
  id: number;
@@ -5795,10 +5743,10 @@ export declare class Store {
5795
5743
  casCoordinatorProposal(id: number, from: CoordinatorProposalState, to: CoordinatorProposalState, by: string | null, outcome: Record<string, unknown> | null, now: Date): boolean;
5796
5744
  /** Pending rows expire after seven days; a revoked credential's pending rows expire at once. */
5797
5745
  sweepCoordinatorProposals(now: Date, cid?: string): number;
5798
- recentMateTurns(approver: string, limit?: number): MateTurn[];
5799
- getMateTurn(id: number): MateTurn | null;
5800
- liveMateTurnFor(approver: string): MateTurn | null;
5801
- mateStepsOf(mateTurn: number): ChatTurn[];
5746
+ recentLeadTurns(approver: string, limit?: number): LeadTurn[];
5747
+ getLeadTurn(id: number): LeadTurn | null;
5748
+ liveLeadTurnFor(approver: string): LeadTurn | null;
5749
+ leadStepsOf(leadTurn: number): ChatTurn[];
5802
5750
  /** Remember a project was opened. Upsert keeps added_at; recency always moves.
5803
5751
  * A project added for the first time starts on Quick checks. */
5804
5752
  upsertProject(path: string, name: string, now: Date): void;
@@ -6524,7 +6472,7 @@ export declare class Store {
6524
6472
  private bumpPushFailures;
6525
6473
  /** A chat send receipt contains no message text. The session is part of
6526
6474
  * its namespace; callers must prove that session before reading it. */
6527
- mateRequestReceipt(session: number, request: string): {
6475
+ leadRequestReceipt(session: number, request: string): {
6528
6476
  digest: string;
6529
6477
  turn: number;
6530
6478
  } | null;