toolroll 0.9.52 → 0.9.54

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 (187) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +55 -80
  3. package/dist/agentconfig.d.ts +11 -36
  4. package/dist/agentconfig.js +3 -62
  5. package/dist/approval-policy.d.ts +1 -1
  6. package/dist/approval-policy.js +1 -1
  7. package/dist/board.d.ts +3 -19
  8. package/dist/board.js +4 -42
  9. package/dist/browser/workspace.js +18 -18
  10. package/dist/browser-workspace.d.ts +2 -1
  11. package/dist/builder.d.ts +9 -40
  12. package/dist/builder.js +50 -257
  13. package/dist/chat-actions.js +3 -14
  14. package/dist/chat-ask.js +8 -8
  15. package/dist/chat-controls.d.ts +0 -4
  16. package/dist/chat-controls.js +0 -1
  17. package/dist/chat-core.d.ts +171 -0
  18. package/dist/chat-core.js +288 -0
  19. package/dist/chat-decide.d.ts +10 -8
  20. package/dist/chat-decide.js +27 -24
  21. package/dist/chat-delivery-state.d.ts +51 -75
  22. package/dist/chat-delivery-state.js +140 -170
  23. package/dist/chat-delivery.d.ts +21 -4
  24. package/dist/chat-delivery.js +313 -195
  25. package/dist/chat-flow.d.ts +29 -1
  26. package/dist/chat-flow.js +24 -50
  27. package/dist/chat-messages.d.ts +319 -0
  28. package/dist/chat-messages.js +841 -0
  29. package/dist/chat-migration.d.ts +30 -0
  30. package/dist/chat-migration.js +802 -0
  31. package/dist/chat-quiet.d.ts +3 -0
  32. package/dist/chat-quiet.js +7 -2
  33. package/dist/chat-task-actions.d.ts +1 -1
  34. package/dist/chat-task-actions.js +0 -2
  35. package/dist/claim.d.ts +79 -244
  36. package/dist/claim.js +688 -1023
  37. package/dist/cli.d.ts +2 -0
  38. package/dist/cli.js +10 -2
  39. package/dist/contracts/chat-content.d.ts +71 -2
  40. package/dist/contracts/chat-content.js +22 -3
  41. package/dist/contracts/chat-tables.d.ts +11 -4
  42. package/dist/contracts/chat-tables.js +165 -87
  43. package/dist/contracts/cli.d.ts +0 -13
  44. package/dist/contracts/cli.js +0 -2
  45. package/dist/contracts/console-api.d.ts +5 -10
  46. package/dist/contracts/console-api.js +4 -10
  47. package/dist/contracts/discord-callback.js +2 -1
  48. package/dist/contracts/flow.d.ts +50 -0
  49. package/dist/contracts/flow.js +26 -1
  50. package/dist/contracts/lead-tools.d.ts +0 -13
  51. package/dist/contracts/lead-tools.js +3 -3
  52. package/dist/contracts/slack-callback.js +3 -2
  53. package/dist/contracts/store-json.d.ts +1 -29
  54. package/dist/contracts/store-json.js +4 -17
  55. package/dist/contracts/teams-callback.js +2 -1
  56. package/dist/converse.d.ts +1 -11
  57. package/dist/converse.js +6 -38
  58. package/dist/coordinator.d.ts +0 -1
  59. package/dist/coordinator.js +3 -5
  60. package/dist/demo.js +16 -26
  61. package/dist/desktop-update-gate.js +0 -1
  62. package/dist/desktop-update.js +1 -3
  63. package/dist/discord-chat.js +19 -38
  64. package/dist/discord-settings.js +4 -13
  65. package/dist/discord.js +4 -14
  66. package/dist/dispatch.d.ts +1 -1
  67. package/dist/dispatch.js +1 -1
  68. package/dist/dispose.d.ts +2 -3
  69. package/dist/dispose.js +17 -92
  70. package/dist/envelope.js +0 -3
  71. package/dist/exec.d.ts +0 -64
  72. package/dist/exec.js +3 -356
  73. package/dist/exhaustion.d.ts +22 -76
  74. package/dist/exhaustion.js +14 -140
  75. package/dist/export.js +8 -8
  76. package/dist/flow-engine.js +1 -1
  77. package/dist/flow-schedule.d.ts +154 -0
  78. package/dist/flow-schedule.js +321 -0
  79. package/dist/flow-share.js +1 -1
  80. package/dist/flow-triggers.d.ts +6 -1
  81. package/dist/flow-triggers.js +65 -10
  82. package/dist/flows-cli.js +8 -4
  83. package/dist/flows-ui.js +2 -0
  84. package/dist/flows.js +1 -1
  85. package/dist/guides.js +9 -29
  86. package/dist/invoke.d.ts +1 -24
  87. package/dist/invoke.js +17 -259
  88. package/dist/lead-status.js +2 -4
  89. package/dist/lead-voice.js +1 -1
  90. package/dist/mate-doors.d.ts +1 -2
  91. package/dist/mate-doors.js +12 -25
  92. package/dist/mate-tools.d.ts +2 -2
  93. package/dist/mate-tools.js +13 -24
  94. package/dist/modes.d.ts +19 -8
  95. package/dist/modes.js +24 -14
  96. package/dist/notification-rows.d.ts +30 -0
  97. package/dist/notification-rows.js +102 -0
  98. package/dist/operate-remote-arguments.js +2 -6
  99. package/dist/operate-remote.js +6 -7
  100. package/dist/operate.d.ts +0 -6
  101. package/dist/operate.js +226 -2248
  102. package/dist/phase-routing.d.ts +13 -23
  103. package/dist/phase-routing.js +13 -35
  104. package/dist/plan-auto.js +2 -2
  105. package/dist/plane-review.js +5 -11
  106. package/dist/planner-source.js +2 -1
  107. package/dist/policy.d.ts +1 -4
  108. package/dist/policy.js +0 -8
  109. package/dist/process-recovery-eligibility.js +2 -3
  110. package/dist/project-delete.js +24 -41
  111. package/dist/proposal.d.ts +4 -24
  112. package/dist/proposal.js +3 -88
  113. package/dist/provider-auth.d.ts +3 -3
  114. package/dist/provider-auth.js +4 -6
  115. package/dist/provider.d.ts +11 -25
  116. package/dist/provider.js +4 -36
  117. package/dist/push.js +1 -1
  118. package/dist/recipe-ui.js +6 -6
  119. package/dist/recipes.d.ts +3 -3
  120. package/dist/recipes.js +27 -23
  121. package/dist/result-shots.js +2 -2
  122. package/dist/retention.js +1 -1
  123. package/dist/run-closeout.d.ts +1 -1
  124. package/dist/run-closeout.js +1 -4
  125. package/dist/scope.d.ts +11 -65
  126. package/dist/scope.js +17 -82
  127. package/dist/serve.js +15 -24
  128. package/dist/server/chat.js +7 -30
  129. package/dist/server/flows.js +11 -10
  130. package/dist/server/guards.js +0 -1
  131. package/dist/server/pages-assets.js +1 -1
  132. package/dist/server/pages.js +0 -2
  133. package/dist/server/people-tokens.js +0 -4
  134. package/dist/server/route-table.d.ts +1 -1
  135. package/dist/server/route-table.js +2 -17
  136. package/dist/server/settings.js +6 -12
  137. package/dist/server/shared.d.ts +28 -212
  138. package/dist/server/shared.js +71 -780
  139. package/dist/server/task-views.js +9 -76
  140. package/dist/server/tasks.d.ts +1 -50
  141. package/dist/server/tasks.js +36 -946
  142. package/dist/setup-guide.d.ts +2 -2
  143. package/dist/slack-api.d.ts +5 -1
  144. package/dist/slack-api.js +2 -2
  145. package/dist/slack-chat.d.ts +9 -6
  146. package/dist/slack-chat.js +29 -53
  147. package/dist/slack-settings.js +6 -15
  148. package/dist/slack.js +6 -16
  149. package/dist/store.d.ts +200 -1702
  150. package/dist/store.js +811 -5439
  151. package/dist/surface.js +10 -24
  152. package/dist/task-composer.d.ts +1 -1
  153. package/dist/task-composer.js +1 -1
  154. package/dist/task-control.d.ts +3 -10
  155. package/dist/task-control.js +2 -7
  156. package/dist/teammate-desk.js +1 -1
  157. package/dist/teammate-question.js +12 -12
  158. package/dist/teammates-ui.js +1 -1
  159. package/dist/teams-chat.js +12 -9
  160. package/dist/teams-settings.js +2 -2
  161. package/dist/teams.js +4 -5
  162. package/dist/telegram-flow.js +5 -5
  163. package/dist/telegram-mate.d.ts +0 -3
  164. package/dist/telegram-mate.js +0 -1
  165. package/dist/telegram.js +4 -4
  166. package/dist/templates.d.ts +11 -7
  167. package/dist/templates.js +12 -9
  168. package/dist/toolroll-update.d.ts +20 -0
  169. package/dist/toolroll-update.js +104 -5
  170. package/dist/work-index.js +2 -6
  171. package/dist/workspace-revision.js +3 -1
  172. package/dist/workspace-ui.js +1 -1
  173. package/package.json +1 -1
  174. package/scripts/recovery-canary.mjs +3 -3
  175. package/dist/contest.d.ts +0 -318
  176. package/dist/contest.js +0 -753
  177. package/dist/held.d.ts +0 -150
  178. package/dist/held.js +0 -799
  179. package/dist/liveness.d.ts +0 -30
  180. package/dist/liveness.js +0 -42
  181. package/dist/pricing.d.ts +0 -45
  182. package/dist/pricing.js +0 -77
  183. package/dist/routine.d.ts +0 -228
  184. package/dist/routine.js +0 -764
  185. package/dist/slack-state.d.ts +0 -13
  186. package/dist/slack-state.js +0 -10
  187. package/dist/supervisor.mjs +0 -297
package/dist/held.d.ts DELETED
@@ -1,150 +0,0 @@
1
- /**
2
- * The HeldSessionCoordinator (Parity II Phase 2, spec v2 S0 as amended
3
- * through v6): the ONE owner of held attended sessions in an `up` process.
4
- *
5
- * Ownership transfer is the whole design: build() reaches its spawn point,
6
- * hands this coordinator the captured settlement record and returns `held`
7
- * WITHOUT settling anything — the watch loop keeps dispatching, and the
8
- * session's lease heartbeats, exact timers, turn ledger, and eventual
9
- * settlement all live here. A held run completes through the SAME
10
- * settleProviderOutcome → disposeBuildOutcome pair every other road uses,
11
- * or it is fenced to `interrupted` — never a third way.
12
- *
13
- * Phase 2D scope note, stated: this coordinator runs the attended
14
- * authorization road end-to-end — final proof, custody, the brief as turn
15
- * one, per-turn acceptance and marginal-delta settlement, expiry/lapse/
16
- * turn-timeout/lease fences, crash custody — and ends the hold at the
17
- * agent's first settled turn (terminal handoff, park, or silence, each
18
- * classified by the shared settlement). The multi-turn conversation loop
19
- * (operator turn box, answer injection, held repair) arrives with its
20
- * console surfaces in the next slice; nothing here forecloses it.
21
- */
22
- import { type CapturedBuild } from "./builder.js";
23
- import { type DisposeContext, type Disposition } from "./dispose.js";
24
- import { startClaudeHeldSession } from "./exec.js";
25
- import type { AttendedAuthorization, Store } from "./store.js";
26
- export type HeldLaunchArgs = {
27
- store: Store;
28
- captured: CapturedBuild;
29
- authorization: AttendedAuthorization;
30
- runId: number;
31
- leaseId: string;
32
- runner: string;
33
- runnerToken?: string;
34
- upIncarnation: string;
35
- /** The composed brief — injected as turn one, source 'brief'. */
36
- brief: string;
37
- cwd: string;
38
- /** A SHORT directory for control sockets (sun_path is unforgiving). */
39
- socketDir: string;
40
- releaseWorktree: (path: string) => Promise<unknown>;
41
- liveLog: {
42
- observe(event: Record<string, unknown>): void;
43
- close(): void;
44
- } | null;
45
- omitEnv: readonly string[];
46
- /** Fields the disposition service needs that the capture does not carry.
47
- * `policy` distinguishes the continuation road (taskless dispositions,
48
- * v4 Q7); absent = the ordinary tick policy. */
49
- dispose: Pick<DisposeContext, "repo" | "origin" | "provider" | "model"> & {
50
- policy?: DisposeContext["policy"];
51
- };
52
- clock: () => Date;
53
- /** Test seams. */
54
- starter?: typeof startClaudeHeldSession;
55
- graceMs?: number;
56
- onDisposed?: (disposition: Disposition | {
57
- kind: "interrupted";
58
- reason: string;
59
- }) => void;
60
- /** v28: enforced INSIDE the final custody transaction — two watch
61
- * loops racing a cap of one cannot both insert. */
62
- maxHeldSessions?: number;
63
- };
64
- export declare class HeldSessionCoordinator {
65
- private readonly sessions;
66
- count(): number;
67
- /**
68
- * The final proof, custody intent, brief recording, spawn, and timer
69
- * arming — one road, refusals typed. Returns once the session is HELD
70
- * (or refused); never awaits the hold itself.
71
- */
72
- launch(args: HeldLaunchArgs): Promise<{
73
- ok: true;
74
- } | {
75
- ok: false;
76
- reason: string;
77
- message: string;
78
- }>;
79
- /** Shutdown: fence every controller under ONE absolute deadline (v2 S0f
80
- * + parallel-sessions round 1, finding 7): the deadline timer is cleared
81
- * when the fences win so it cannot hold the process open, and the runs
82
- * that did NOT settle in time are RETURNED for the caller to page —
83
- * silence here contradicted up's "settled or paged" promise. */
84
- close(): Promise<number[]>;
85
- /**
86
- * The exact-run stop (v52): fence ONE held session now, through the
87
- * supervisor's own handle — EOF → grace → kill, conservative settlement,
88
- * the worktree preserved, the stop settled as `held` by the run's ending.
89
- * The console calls this after the durable request; the lapse interval
90
- * takes the same road for a stop filed by another process. Idempotent:
91
- * a session already fencing or gone settles nothing twice.
92
- */
93
- stop(runId: number): Promise<void>;
94
- /** The beat endpoint, answers, and revocation poke this directly (v2 S1d). */
95
- poke(runId: number): void;
96
- /**
97
- * The operator's own turn (v2 S1g, ruling 12-as-accepted): session-grade
98
- * speech, recorded through the SAME gated transaction every injection
99
- * takes — cap, single-flight, budget, open-decision, lease — so every
100
- * refusal is typed and atomic.
101
- */
102
- injectOperatorTurn(runId: number, author: string, text: string): {
103
- ok: true;
104
- } | {
105
- ok: false;
106
- reason: string;
107
- };
108
- private injectTurn;
109
- private injectPendingAnswers;
110
- private launches;
111
- private makeController;
112
- private armTurnTimer;
113
- private onTurnInit;
114
- private onTurnResult;
115
- /**
116
- * A park inside a held session (v2 S1f + round-6 finding 3): payload
117
- * preserved as evidence and unlinked exactly like the ordinary road,
118
- * the decision recorded WITHOUT ending anything, causally linked to the
119
- * turn that produced it. A malformed payload takes the held repair road
120
- * — a machine-authored ledger turn in the SAME session, correlated to
121
- * the producing turn (a malformed mailbox has no decision id), bounded;
122
- * exhaustion disposes through the shared malformed machinery.
123
- */
124
- private heldPark;
125
- private onExit;
126
- private conclude;
127
- private fenceByRun;
128
- /**
129
- * The interruption road (v2 S2e): stop admission, EOF → grace → kill via
130
- * the supervisor, conservative settlement, `interrupted`, worktree
131
- * preserved, authorization closed with the reason. Idempotent.
132
- */
133
- private fence;
134
- private clearClocks;
135
- private drop;
136
- }
137
- /**
138
- * The DB-side orphan fence (v4 Q5 + v5 P3/P4 + v6 W6): sweep every open
139
- * custody row whose recorded lease is NO LONGER the task's current live
140
- * lease, seize it (CAS open→fencing + lease fence in one transaction),
141
- * order the kill through the supervisor's socket — the kernel-stable
142
- * road — and settle. A supervisor that cannot be reached keeps custody
143
- * and PAGES (never a guessed PID kill); a later sweep resumes from
144
- * wherever the CASes stand. Runs BEFORE generic recovery at every entry
145
- * point; recovery excludes fenced-open held rows.
146
- */
147
- export declare function sweepHeldOrphans(store: Store, fencer: string, now: () => Date): Promise<{
148
- fenced: number;
149
- paged: number;
150
- }>;