toolroll 0.9.42 → 0.9.44

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 (68) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/action-ledger.d.ts +5 -2
  3. package/dist/action-ledger.js +13 -3
  4. package/dist/chat-actions.js +1 -1
  5. package/dist/chat-approval.d.ts +45 -0
  6. package/dist/chat-approval.js +81 -0
  7. package/dist/chat-channel.js +5 -0
  8. package/dist/chat-decide.d.ts +18 -6
  9. package/dist/chat-decide.js +54 -20
  10. package/dist/chat-flow.js +2 -2
  11. package/dist/cli-http.d.ts +64 -0
  12. package/dist/cli-http.js +143 -0
  13. package/dist/cli.d.ts +3 -0
  14. package/dist/cli.js +8 -1
  15. package/dist/contracts/cli.d.ts +13 -0
  16. package/dist/contracts/cli.js +7 -0
  17. package/dist/contracts/console-api.d.ts +1 -0
  18. package/dist/contracts/console-api.js +1 -0
  19. package/dist/contracts/gateway-tools.d.ts +82 -0
  20. package/dist/contracts/gateway-tools.js +33 -0
  21. package/dist/contracts/lead-tools.d.ts +11 -0
  22. package/dist/contracts/lead-tools.js +2 -0
  23. package/dist/desktop-update.d.ts +3 -1
  24. package/dist/desktop-update.js +7 -6
  25. package/dist/flow-engine.d.ts +2 -0
  26. package/dist/flow-engine.js +10 -2
  27. package/dist/flows-cli.d.ts +28 -0
  28. package/dist/flows-cli.js +43 -1
  29. package/dist/guides.js +2 -0
  30. package/dist/mate-contract.js +1 -1
  31. package/dist/mate-tools.js +43 -1
  32. package/dist/mcp-core.d.ts +110 -0
  33. package/dist/mcp-core.js +311 -0
  34. package/dist/mcp-http.d.ts +26 -0
  35. package/dist/mcp-http.js +151 -0
  36. package/dist/mcp-person.d.ts +31 -0
  37. package/dist/mcp-person.js +96 -0
  38. package/dist/mcp.d.ts +1 -8
  39. package/dist/mcp.js +21 -322
  40. package/dist/operate-remote-arguments.d.ts +36 -0
  41. package/dist/operate-remote-arguments.js +185 -0
  42. package/dist/operate-remote.d.ts +86 -0
  43. package/dist/operate-remote.js +125 -0
  44. package/dist/operate.d.ts +21 -1
  45. package/dist/operate.js +229 -15
  46. package/dist/process-recovery-eligibility.d.ts +1 -1
  47. package/dist/remote-command.d.ts +45 -0
  48. package/dist/remote-command.js +124 -0
  49. package/dist/remote-exec.d.ts +18 -0
  50. package/dist/remote-exec.js +241 -0
  51. package/dist/remote-run.d.ts +16 -0
  52. package/dist/remote-run.js +13 -0
  53. package/dist/scope.d.ts +4 -2
  54. package/dist/scope.js +10 -0
  55. package/dist/serve.d.ts +7 -0
  56. package/dist/serve.js +75 -2
  57. package/dist/store.d.ts +23 -2
  58. package/dist/store.js +76 -9
  59. package/dist/surface.d.ts +10 -3
  60. package/dist/surface.js +71 -3
  61. package/dist/team-cli.d.ts +19 -0
  62. package/dist/team-cli.js +20 -3
  63. package/dist/teammate-work.js +1 -1
  64. package/dist/telegram-flow.d.ts +41 -1
  65. package/dist/telegram-flow.js +96 -12
  66. package/dist/telegram.js +27 -3
  67. package/dist/toolroll-update.js +4 -1
  68. package/package.json +1 -1
package/dist/telegram.js CHANGED
@@ -34,7 +34,7 @@ import { enqueueEveningDigests, finishedView, isTaskFact, joinsBatch, needsPerso
34
34
  import { BATCH_MS, chatText, chatTitle, factLinkLabel, mentions, nameTelegramBot } from "./chat-voice.js";
35
35
  import { LEAD_SAY_KIND, enqueueLeadLapses, leadSayEarlier, leadSayText, leadSubjectOf } from "./lead-voice.js";
36
36
  import { applyTeamInbound, deliverTeamChats, teamCommand } from "./telegram-team.js";
37
- import { applyFlowChoiceTap, applyFlowReply, applyFlowTap, FLOW_DECIDE_KEY, flowButtons, flowChoiceButtons, flowChoiceHead, flowDecisionAt, flowDecisionText, flowSendKeyboardRow, flowSentContent } from "./telegram-flow.js";
37
+ import { applyFlowChoiceTap, applyFlowConfirm, applyFlowReply, applyFlowTap, flowConfirmOf, FLOW_DECIDE_KEY, flowButtons, flowChoiceButtons, flowChoiceHead, flowDecisionAt, flowDecisionText, flowSendKeyboardRow, flowSentContent } from "./telegram-flow.js";
38
38
  import { flowChoiceAt, flowSendTail, FLOW_CHOOSE_KEY, FLOW_SEND_KEY } from "./flow-send.js";
39
39
  import { cleanFlowMessage, fitFlowMessage } from "./flow-items.js";
40
40
  import { telegramReply } from "./reply-shape.js";
@@ -1523,7 +1523,8 @@ async function enrolledForMessage(context, update) {
1523
1523
  async function projectsForTap(context, update) {
1524
1524
  const callback = update.callback_query;
1525
1525
  // Flow decision buttons (v86) work with or without the lead's conversation on this phone.
1526
- const flowTap = callback !== undefined && (context.store.getTelegramFlowAction(callback.data ?? "") !== null || context.store.getTelegramFlowChoice(callback.data ?? "") !== null);
1526
+ const flowTap = callback !== undefined && (context.store.getTelegramFlowAction(callback.data ?? "") !== null || context.store.getTelegramFlowChoice(callback.data ?? "") !== null
1527
+ || flowConfirmOf(context.store, callback.data ?? "") !== null);
1527
1528
  // So do a result's, plan's or pull request's own buttons (chat-decide.ts).
1528
1529
  const decideTap = callback !== undefined && isDecideToken(context.store, callback.data ?? "");
1529
1530
  if (callback === undefined || context.readProjects === undefined || (context.conversation === undefined && !flowTap && !decideTap))
@@ -2172,6 +2173,29 @@ function applyCallback(context, update, effects) {
2172
2173
  }
2173
2174
  return;
2174
2175
  }
2176
+ // A flow decision's repaint: its buttons (fresh ones stamped on this message) or links under the console.
2177
+ const flowEdit = (effect) => {
2178
+ if (effect.place !== undefined && effect.place.length > 0)
2179
+ store.placeTelegramFlowActions(effect.place, String(message.message_id));
2180
+ editText(effect.text, decideKeyboard(context.conversation?.phoneOrigin, effect.keyboard ?? []));
2181
+ };
2182
+ // The Yes or Cancel a flow Approve armed (telegram-flow.ts): on the message it was armed on, by the person it was armed for.
2183
+ const flowConfirm = flowConfirmOf(store, token);
2184
+ if (flowConfirm !== null) {
2185
+ if (flowConfirm.binding !== binding.id || flowConfirm.chatId !== tapChat || flowConfirm.messageId !== String(message.message_id)) {
2186
+ report.ignored++;
2187
+ ack("That button isn't for this chat. Nothing was done.");
2188
+ return;
2189
+ }
2190
+ const repos = context.projects === null ? null : telegramConversationRepos(store, binding.approver, context.projects);
2191
+ for (const effect of applyFlowConfirm(store, binding, flowConfirm, { text: message.text ?? "" }, repos, clock())) {
2192
+ if (effect.kind === "ack")
2193
+ ack(effect.text);
2194
+ else if (effect.kind === "edit")
2195
+ flowEdit(effect);
2196
+ }
2197
+ return;
2198
+ }
2175
2199
  const flowAction = store.getTelegramFlowAction(token);
2176
2200
  if (flowAction !== null) {
2177
2201
  if (flowAction.binding !== binding.id || flowAction.chatId !== tapChat || (flowAction.messageId !== null && flowAction.messageId !== String(message.message_id))) {
@@ -2184,7 +2208,7 @@ function applyCallback(context, update, effects) {
2184
2208
  if (effect.kind === "ack")
2185
2209
  ack(effect.text);
2186
2210
  else if (effect.kind === "edit")
2187
- editText(effect.text);
2211
+ flowEdit(effect);
2188
2212
  else
2189
2213
  effects.push(async () => {
2190
2214
  // A reply box: whatever they send back as a reply to this prompt is the new draft, or the note.
@@ -35,6 +35,7 @@ import { processMayBeAlive } from "./process-liveness.js";
35
35
  import { assertCodingUpdateStopped, backupCodingCatalog, codingCatalogExists, releaseStaleCodingOwner, removeCodingUpdateGate } from "./coding-update.js";
36
36
  import { installLaunchdService, launchdPlist, stopLaunchdService, writeFileDurably } from "./daemon.js";
37
37
  import { NAME } from "./names.js";
38
+ import { updateSafeSchema } from "./store.js";
38
39
  import { isNewer, REGISTRY } from "./releases.js";
39
40
  import { markNeverIndex } from "./never-index.js";
40
41
  import { readRuntimeUpdateJournal, RUNTIME_PHASES, RUNTIME_UPDATE_STEPS, stagedStartedAt, updaterStartingOf } from "./contracts/update-journal.js";
@@ -911,7 +912,9 @@ async function driveRuntimeUpdate(j, system) {
911
912
  db.close();
912
913
  }
913
914
  const backup = join(j.stageDir, existsSync(join(j.stageDir, "orders.backup.db")) ? `orders.backup.${randomUUID()}.db` : "orders.backup.db");
914
- j.backupHash = await verifiedDatabaseBackup(j.databaseFile, backup, j.id, async () => { await codingBackup(j); });
915
+ // A database one or more update-safe migrations behind is backed up as it is: the rehearsal below proves the
916
+ // migration on a copy, and the new runtime runs it. Any other schema needs the separate migration procedure.
917
+ j.backupHash = await verifiedDatabaseBackup(j.databaseFile, backup, j.id, async () => { await codingBackup(j); }, undefined, updateSafeSchema);
915
918
  j.backupPath = backup;
916
919
  save(j, "backing-up", "Database and coding catalog backed up.", system.now());
917
920
  step("rehearsing", `Rehearsing ${j.to.version} on a copy of the database.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolroll",
3
- "version": "0.9.42",
3
+ "version": "0.9.44",
4
4
  "description": "A control plane for unattended coding agents — queue tasks, walk away, come back to pull requests. Agents build in leased worktrees, never touch your default branch, and interrupt you only for decisions that need a human.",
5
5
  "directories": {
6
6
  "doc": "docs"