@buoy-gg/ask-buoy 7.0.35 → 7.0.36

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 (217) hide show
  1. package/README.md +35 -8
  2. package/lib/commonjs/blocks/BlockRenderer.js +13 -1
  3. package/lib/commonjs/blocks/BlockRenderer.js.map +1 -1
  4. package/lib/commonjs/blocks/DataBlocks.js +126 -33
  5. package/lib/commonjs/blocks/DataBlocks.js.map +1 -1
  6. package/lib/commonjs/blocks/ExtraBlocks.js +12 -6
  7. package/lib/commonjs/blocks/ExtraBlocks.js.map +1 -1
  8. package/lib/commonjs/blocks/MediaBlocks.js +22 -6
  9. package/lib/commonjs/blocks/MediaBlocks.js.map +1 -1
  10. package/lib/commonjs/blocks/blockText.js +60 -0
  11. package/lib/commonjs/blocks/blockText.js.map +1 -0
  12. package/lib/commonjs/blocks/blockText.test.js +53 -0
  13. package/lib/commonjs/blocks/blockText.test.js.map +1 -0
  14. package/lib/commonjs/blocks/primitives.js +58 -2
  15. package/lib/commonjs/blocks/primitives.js.map +1 -1
  16. package/lib/commonjs/components/ApprovalCard.js +111 -7
  17. package/lib/commonjs/components/ApprovalCard.js.map +1 -1
  18. package/lib/commonjs/components/AskBuoyHeader.js +36 -4
  19. package/lib/commonjs/components/AskBuoyHeader.js.map +1 -1
  20. package/lib/commonjs/components/AskBuoyModal.js +160 -34
  21. package/lib/commonjs/components/AskBuoyModal.js.map +1 -1
  22. package/lib/commonjs/components/AskBuoySettings.js +50 -0
  23. package/lib/commonjs/components/AskBuoySettings.js.map +1 -1
  24. package/lib/commonjs/components/Composer.js +94 -14
  25. package/lib/commonjs/components/Composer.js.map +1 -1
  26. package/lib/commonjs/components/EmptyState.js +12 -5
  27. package/lib/commonjs/components/EmptyState.js.map +1 -1
  28. package/lib/commonjs/components/KeyboardPad.js +80 -0
  29. package/lib/commonjs/components/KeyboardPad.js.map +1 -0
  30. package/lib/commonjs/components/Markdown.js +148 -90
  31. package/lib/commonjs/components/Markdown.js.map +1 -1
  32. package/lib/commonjs/components/MessageList.js +339 -92
  33. package/lib/commonjs/components/MessageList.js.map +1 -1
  34. package/lib/commonjs/components/QueuedMessages.js +145 -0
  35. package/lib/commonjs/components/QueuedMessages.js.map +1 -0
  36. package/lib/commonjs/components/markdownParse.js +131 -0
  37. package/lib/commonjs/components/markdownParse.js.map +1 -0
  38. package/lib/commonjs/components/markdownParse.test.js +99 -0
  39. package/lib/commonjs/components/markdownParse.test.js.map +1 -0
  40. package/lib/commonjs/store/activityGroups.js +110 -0
  41. package/lib/commonjs/store/activityGroups.js.map +1 -0
  42. package/lib/commonjs/store/activityGroups.test.js +78 -0
  43. package/lib/commonjs/store/activityGroups.test.js.map +1 -0
  44. package/lib/commonjs/store/askBuoySettings.js +7 -2
  45. package/lib/commonjs/store/askBuoySettings.js.map +1 -1
  46. package/lib/commonjs/store/askBuoyStore.js +192 -10
  47. package/lib/commonjs/store/askBuoyStore.js.map +1 -1
  48. package/lib/commonjs/store/blockPlacement.js +64 -0
  49. package/lib/commonjs/store/blockPlacement.js.map +1 -0
  50. package/lib/commonjs/store/blockPlacement.test.js +123 -0
  51. package/lib/commonjs/store/blockPlacement.test.js.map +1 -0
  52. package/lib/commonjs/store/queue.test.js +150 -0
  53. package/lib/commonjs/store/queue.test.js.map +1 -0
  54. package/lib/commonjs/store/resetConversation.js +77 -0
  55. package/lib/commonjs/store/resetConversation.js.map +1 -0
  56. package/lib/commonjs/store/restorePending.test.js +63 -0
  57. package/lib/commonjs/store/restorePending.test.js.map +1 -0
  58. package/lib/commonjs/store/suggestions.js +54 -0
  59. package/lib/commonjs/store/suggestions.js.map +1 -0
  60. package/lib/commonjs/store/suggestions.test.js +58 -0
  61. package/lib/commonjs/store/suggestions.test.js.map +1 -0
  62. package/lib/commonjs/store/systemLine.test.js +77 -0
  63. package/lib/commonjs/store/systemLine.test.js.map +1 -0
  64. package/lib/commonjs/store/ticketPrompt.js +17 -0
  65. package/lib/commonjs/store/ticketPrompt.js.map +1 -0
  66. package/lib/commonjs/store/transcriptPersistence.js +92 -3
  67. package/lib/commonjs/store/transcriptPersistence.js.map +1 -1
  68. package/lib/commonjs/store/transcriptPersistence.test.js +148 -0
  69. package/lib/commonjs/store/transcriptPersistence.test.js.map +1 -1
  70. package/lib/commonjs/store/turnRendering.test.js +151 -0
  71. package/lib/commonjs/store/turnRendering.test.js.map +1 -0
  72. package/lib/commonjs/store/useAskBuoy.js +271 -49
  73. package/lib/commonjs/store/useAskBuoy.js.map +1 -1
  74. package/lib/commonjs/sync/askBuoySyncAdapter.js +25 -4
  75. package/lib/commonjs/sync/askBuoySyncAdapter.js.map +1 -1
  76. package/lib/module/blocks/BlockRenderer.js +13 -1
  77. package/lib/module/blocks/BlockRenderer.js.map +1 -1
  78. package/lib/module/blocks/DataBlocks.js +128 -35
  79. package/lib/module/blocks/DataBlocks.js.map +1 -1
  80. package/lib/module/blocks/ExtraBlocks.js +12 -6
  81. package/lib/module/blocks/ExtraBlocks.js.map +1 -1
  82. package/lib/module/blocks/MediaBlocks.js +22 -6
  83. package/lib/module/blocks/MediaBlocks.js.map +1 -1
  84. package/lib/module/blocks/blockText.js +55 -0
  85. package/lib/module/blocks/blockText.js.map +1 -0
  86. package/lib/module/blocks/blockText.test.js +53 -0
  87. package/lib/module/blocks/blockText.test.js.map +1 -0
  88. package/lib/module/blocks/primitives.js +58 -2
  89. package/lib/module/blocks/primitives.js.map +1 -1
  90. package/lib/module/components/ApprovalCard.js +113 -9
  91. package/lib/module/components/ApprovalCard.js.map +1 -1
  92. package/lib/module/components/AskBuoyHeader.js +37 -5
  93. package/lib/module/components/AskBuoyHeader.js.map +1 -1
  94. package/lib/module/components/AskBuoyModal.js +163 -37
  95. package/lib/module/components/AskBuoyModal.js.map +1 -1
  96. package/lib/module/components/AskBuoySettings.js +52 -2
  97. package/lib/module/components/AskBuoySettings.js.map +1 -1
  98. package/lib/module/components/Composer.js +95 -15
  99. package/lib/module/components/Composer.js.map +1 -1
  100. package/lib/module/components/EmptyState.js +12 -5
  101. package/lib/module/components/EmptyState.js.map +1 -1
  102. package/lib/module/components/KeyboardPad.js +75 -0
  103. package/lib/module/components/KeyboardPad.js.map +1 -0
  104. package/lib/module/components/Markdown.js +149 -90
  105. package/lib/module/components/Markdown.js.map +1 -1
  106. package/lib/module/components/MessageList.js +341 -94
  107. package/lib/module/components/MessageList.js.map +1 -1
  108. package/lib/module/components/QueuedMessages.js +140 -0
  109. package/lib/module/components/QueuedMessages.js.map +1 -0
  110. package/lib/module/components/markdownParse.js +125 -0
  111. package/lib/module/components/markdownParse.js.map +1 -0
  112. package/lib/module/components/markdownParse.test.js +98 -0
  113. package/lib/module/components/markdownParse.test.js.map +1 -0
  114. package/lib/module/store/activityGroups.js +103 -0
  115. package/lib/module/store/activityGroups.js.map +1 -0
  116. package/lib/module/store/activityGroups.test.js +77 -0
  117. package/lib/module/store/activityGroups.test.js.map +1 -0
  118. package/lib/module/store/askBuoySettings.js +7 -2
  119. package/lib/module/store/askBuoySettings.js.map +1 -1
  120. package/lib/module/store/askBuoyStore.js +190 -10
  121. package/lib/module/store/askBuoyStore.js.map +1 -1
  122. package/lib/module/store/blockPlacement.js +59 -0
  123. package/lib/module/store/blockPlacement.js.map +1 -0
  124. package/lib/module/store/blockPlacement.test.js +122 -0
  125. package/lib/module/store/blockPlacement.test.js.map +1 -0
  126. package/lib/module/store/queue.test.js +149 -0
  127. package/lib/module/store/queue.test.js.map +1 -0
  128. package/lib/module/store/resetConversation.js +72 -0
  129. package/lib/module/store/resetConversation.js.map +1 -0
  130. package/lib/module/store/restorePending.test.js +62 -0
  131. package/lib/module/store/restorePending.test.js.map +1 -0
  132. package/lib/module/store/suggestions.js +49 -0
  133. package/lib/module/store/suggestions.js.map +1 -0
  134. package/lib/module/store/suggestions.test.js +57 -0
  135. package/lib/module/store/suggestions.test.js.map +1 -0
  136. package/lib/module/store/systemLine.test.js +76 -0
  137. package/lib/module/store/systemLine.test.js.map +1 -0
  138. package/lib/module/store/ticketPrompt.js +13 -0
  139. package/lib/module/store/ticketPrompt.js.map +1 -0
  140. package/lib/module/store/transcriptPersistence.js +92 -3
  141. package/lib/module/store/transcriptPersistence.js.map +1 -1
  142. package/lib/module/store/transcriptPersistence.test.js +148 -0
  143. package/lib/module/store/transcriptPersistence.test.js.map +1 -1
  144. package/lib/module/store/turnRendering.test.js +150 -0
  145. package/lib/module/store/turnRendering.test.js.map +1 -0
  146. package/lib/module/store/useAskBuoy.js +275 -53
  147. package/lib/module/store/useAskBuoy.js.map +1 -1
  148. package/lib/module/sync/askBuoySyncAdapter.js +25 -4
  149. package/lib/module/sync/askBuoySyncAdapter.js.map +1 -1
  150. package/lib/typescript/blocks/BlockRenderer.d.ts.map +1 -1
  151. package/lib/typescript/blocks/DataBlocks.d.ts +11 -0
  152. package/lib/typescript/blocks/DataBlocks.d.ts.map +1 -1
  153. package/lib/typescript/blocks/ExtraBlocks.d.ts +18 -2
  154. package/lib/typescript/blocks/ExtraBlocks.d.ts.map +1 -1
  155. package/lib/typescript/blocks/MediaBlocks.d.ts.map +1 -1
  156. package/lib/typescript/blocks/blockText.d.ts +14 -0
  157. package/lib/typescript/blocks/blockText.d.ts.map +1 -0
  158. package/lib/typescript/blocks/blockText.test.d.ts +2 -0
  159. package/lib/typescript/blocks/blockText.test.d.ts.map +1 -0
  160. package/lib/typescript/blocks/primitives.d.ts +16 -1
  161. package/lib/typescript/blocks/primitives.d.ts.map +1 -1
  162. package/lib/typescript/components/ApprovalCard.d.ts.map +1 -1
  163. package/lib/typescript/components/AskBuoyHeader.d.ts +31 -1
  164. package/lib/typescript/components/AskBuoyHeader.d.ts.map +1 -1
  165. package/lib/typescript/components/AskBuoyModal.d.ts.map +1 -1
  166. package/lib/typescript/components/AskBuoySettings.d.ts.map +1 -1
  167. package/lib/typescript/components/Composer.d.ts +16 -1
  168. package/lib/typescript/components/Composer.d.ts.map +1 -1
  169. package/lib/typescript/components/EmptyState.d.ts +5 -1
  170. package/lib/typescript/components/EmptyState.d.ts.map +1 -1
  171. package/lib/typescript/components/KeyboardPad.d.ts +33 -0
  172. package/lib/typescript/components/KeyboardPad.d.ts.map +1 -0
  173. package/lib/typescript/components/Markdown.d.ts +0 -10
  174. package/lib/typescript/components/Markdown.d.ts.map +1 -1
  175. package/lib/typescript/components/MessageList.d.ts +7 -2
  176. package/lib/typescript/components/MessageList.d.ts.map +1 -1
  177. package/lib/typescript/components/QueuedMessages.d.ts +10 -0
  178. package/lib/typescript/components/QueuedMessages.d.ts.map +1 -0
  179. package/lib/typescript/components/markdownParse.d.ts +49 -0
  180. package/lib/typescript/components/markdownParse.d.ts.map +1 -0
  181. package/lib/typescript/components/markdownParse.test.d.ts +2 -0
  182. package/lib/typescript/components/markdownParse.test.d.ts.map +1 -0
  183. package/lib/typescript/store/activityGroups.d.ts +29 -0
  184. package/lib/typescript/store/activityGroups.d.ts.map +1 -0
  185. package/lib/typescript/store/activityGroups.test.d.ts +2 -0
  186. package/lib/typescript/store/activityGroups.test.d.ts.map +1 -0
  187. package/lib/typescript/store/askBuoySettings.d.ts +22 -0
  188. package/lib/typescript/store/askBuoySettings.d.ts.map +1 -1
  189. package/lib/typescript/store/askBuoyStore.d.ts +142 -5
  190. package/lib/typescript/store/askBuoyStore.d.ts.map +1 -1
  191. package/lib/typescript/store/blockPlacement.d.ts +30 -0
  192. package/lib/typescript/store/blockPlacement.d.ts.map +1 -0
  193. package/lib/typescript/store/blockPlacement.test.d.ts +2 -0
  194. package/lib/typescript/store/blockPlacement.test.d.ts.map +1 -0
  195. package/lib/typescript/store/queue.test.d.ts +2 -0
  196. package/lib/typescript/store/queue.test.d.ts.map +1 -0
  197. package/lib/typescript/store/resetConversation.d.ts +38 -0
  198. package/lib/typescript/store/resetConversation.d.ts.map +1 -0
  199. package/lib/typescript/store/restorePending.test.d.ts +2 -0
  200. package/lib/typescript/store/restorePending.test.d.ts.map +1 -0
  201. package/lib/typescript/store/suggestions.d.ts +32 -0
  202. package/lib/typescript/store/suggestions.d.ts.map +1 -0
  203. package/lib/typescript/store/suggestions.test.d.ts +2 -0
  204. package/lib/typescript/store/suggestions.test.d.ts.map +1 -0
  205. package/lib/typescript/store/systemLine.test.d.ts +2 -0
  206. package/lib/typescript/store/systemLine.test.d.ts.map +1 -0
  207. package/lib/typescript/store/ticketPrompt.d.ts +11 -0
  208. package/lib/typescript/store/ticketPrompt.d.ts.map +1 -0
  209. package/lib/typescript/store/transcriptPersistence.d.ts +41 -2
  210. package/lib/typescript/store/transcriptPersistence.d.ts.map +1 -1
  211. package/lib/typescript/store/turnRendering.test.d.ts +2 -0
  212. package/lib/typescript/store/turnRendering.test.d.ts.map +1 -0
  213. package/lib/typescript/store/useAskBuoy.d.ts +23 -1
  214. package/lib/typescript/store/useAskBuoy.d.ts.map +1 -1
  215. package/lib/typescript/sync/askBuoySyncAdapter.d.ts +26 -6
  216. package/lib/typescript/sync/askBuoySyncAdapter.d.ts.map +1 -1
  217. package/package.json +9 -9
@@ -12,7 +12,16 @@ export interface ChatToolCall {
12
12
  label: string;
13
13
  /** The catalog's fuller sentence, shown when the row is expanded. */
14
14
  description?: string;
15
- status: "running" | "ok" | "failed" | "refused";
15
+ /**
16
+ * `refused` — the policy said no. `declined` — the USER said no on the
17
+ * approval card. Both are rows for calls that never ran, and both matter:
18
+ * a turn that changed course because permission was withheld is unreadable
19
+ * without them. `stopped` — the user pressed Stop before this call started;
20
+ * the engine checks the abort signal before every call in a batch, and a
21
+ * call it skipped is shown rather than silently omitted, because the user
22
+ * needs to know which of the proposed changes did NOT land.
23
+ */
24
+ status: "running" | "ok" | "failed" | "refused" | "declined" | "stopped";
16
25
  /** Trailing status word once finished — "12 items", "Not found", "Done". */
17
26
  summary?: string;
18
27
  /**
@@ -69,6 +78,31 @@ export interface ChatMessage {
69
78
  /** Set while the assistant is still streaming this message. */
70
79
  streaming?: boolean;
71
80
  error?: string;
81
+ /**
82
+ * The user pressed Stop.
83
+ *
84
+ * Kept apart from `error` because it is not one: the abort surfaces as a
85
+ * cancelled fetch, and reported as an error it told the user "couldn't reach
86
+ * your AI endpoint, check the connection" about a thing they had just chosen
87
+ * to do — with a Swift exception underneath it.
88
+ */
89
+ stopped?: boolean;
90
+ /**
91
+ * This bubble came back from disk.
92
+ *
93
+ * The MODEL does not remember it the way the screen does: a restored history
94
+ * is rewound to the last complete round, so an Ask block — which ends its
95
+ * turn with a `buoy_ui` call — is always rewound out of the model's memory
96
+ * while its buttons stay tappable on screen. Answering one has to carry the
97
+ * question with it. See `answer` in useAskBuoy.
98
+ */
99
+ restored?: boolean;
100
+ /**
101
+ * A line from Buoy itself, not the model — "older messages were trimmed".
102
+ * Rendered as a dim centred note, never as an answer, and never given a
103
+ * footer or a copy pill.
104
+ */
105
+ system?: boolean;
72
106
  /**
73
107
  * True once a tool call has run and no narration has arrived since.
74
108
  *
@@ -87,11 +121,52 @@ export interface PendingApproval {
87
121
  label: string;
88
122
  description?: string;
89
123
  reason: string;
124
+ /** The call itself. Never rendered; kept so a restored card can run it. */
125
+ params?: Record<string, unknown>;
126
+ /**
127
+ * This card came back from disk after a reload.
128
+ *
129
+ * The turn that asked the question died with the JS context, so there is no
130
+ * promise left to resolve and no model waiting on the answer. Allow has to
131
+ * dispatch the call itself — see `approve` in useAskBuoy.
132
+ */
133
+ restored?: boolean;
134
+ /**
135
+ * Fingerprint of what the call would overwrite, as of when it was asked.
136
+ * A restored Allow re-reads and compares before writing: same label, same
137
+ * params, different app state is exactly the case a restart produces. A
138
+ * hash, so nothing of the value itself is persisted.
139
+ */
140
+ targetDigest?: string;
90
141
  resolve: (approved: boolean) => void;
91
142
  }
143
+ /**
144
+ * A message typed while a turn was running.
145
+ *
146
+ * A list with ids, not a string: the single slot it replaced OVERWROTE — type
147
+ * two things mid-turn and the first vanished, which is precisely the loss the
148
+ * queue exists to prevent. Ids so two identical requests stay distinguishable
149
+ * and the list can be edited by row.
150
+ */
151
+ export interface QueuedMessage {
152
+ id: string;
153
+ text: string;
154
+ }
155
+ /**
156
+ * The one word every component reads to know what the chat is doing.
157
+ *
158
+ * Presentation state (minimised, settings open) is NOT in here on purpose —
159
+ * it sits on top. This exists because the header, the composer, the queue
160
+ * flush and the modal each used to derive their own answer from five
161
+ * overlapping booleans, and disagreed: the queue fired after an error because
162
+ * "not busy" looked like "idle" to it.
163
+ */
164
+ export type TurnPhase = "idle" | "running" | "awaitingApproval" | "awaitingAnswer" | "stopping";
92
165
  export interface AskBuoyState {
93
166
  messages: ChatMessage[];
94
167
  busy: boolean;
168
+ /** Stop was pressed and the turn has not yet wound down. See TurnPhase. */
169
+ stopping: boolean;
95
170
  pending: PendingApproval | null;
96
171
  /** Set when the tool is unconfigured or the endpoint keeps failing. */
97
172
  notice: string | null;
@@ -103,8 +178,13 @@ export interface AskBuoyState {
103
178
  awaitingBlockId: string | null;
104
179
  /** Run state of block action buttons, keyed `${blockId}:${label}`. */
105
180
  actionState: Record<string, "running" | "done" | "failed">;
106
- /** A message typed while a turn was running; sent when the turn finishes. */
107
- queued: string | null;
181
+ /** Messages typed while a turn was running, in the order they were typed. */
182
+ queued: QueuedMessage[];
183
+ /**
184
+ * Text handed back to the composer — a queued message the user tapped to
185
+ * edit. The composer takes it and calls `clearDraft`.
186
+ */
187
+ draft: string | null;
108
188
  /** Session token totals, accumulated from provider usage reports. */
109
189
  usage: {
110
190
  input: number;
@@ -144,8 +224,22 @@ export declare const askBuoyStore: {
144
224
  addUser(text: string): void;
145
225
  /** Mark a turn as running without adding a bubble — the retry path. */
146
226
  beginTurn(): void;
147
- /** Park a message typed mid-turn instead of silently dropping it. */
148
- setQueued(text: string | null): void;
227
+ /** Park a message typed mid-turn, behind whatever is already parked. */
228
+ enqueue(text: string): QueuedMessage;
229
+ /** Drop one parked message — the ✕ on its row. */
230
+ removeQueued(id: string): void;
231
+ /** Take the FIRST parked message off the queue — the flush path. */
232
+ shiftQueued(): QueuedMessage | undefined;
233
+ /** Hand one parked message back to the composer to edit. See `draft`. */
234
+ takeQueuedToDraft(id: string): void;
235
+ /**
236
+ * The user pressed Stop. The turn is still winding down — the abort is only
237
+ * read between calls — so the phase is `stopping`, not `idle`, until
238
+ * `finishAssistant` lands.
239
+ */
240
+ requestStop(): void;
241
+ /** The composer has taken the draft into its input. */
242
+ clearDraft(): void;
149
243
  /** Drop one message — the failed assistant bubble a retry replaces. */
150
244
  removeMessage(id: string): void;
151
245
  /** The user answered (or skipped) an Ask block. */
@@ -161,9 +255,33 @@ export declare const askBuoyStore: {
161
255
  * only form a non-developer can actually check.
162
256
  */
163
257
  applyEvent(messageId: string, ev: TurnEvent): void;
258
+ /** The user pressed Stop on this turn. See `ChatMessage.stopped`. */
259
+ markStopped(messageId: string): void;
164
260
  finishAssistant(messageId: string): void;
165
261
  askApproval(input: Omit<PendingApproval, "resolve">): Promise<boolean>;
166
262
  answerApproval(approved: boolean): void;
263
+ /**
264
+ * Put an unanswered approval back after a restart.
265
+ *
266
+ * A question the app asked and then forgot is worse than not asking: the
267
+ * user tapped nothing, so as far as they are concerned the change is still
268
+ * waiting for them. `resolve` is a no-op because nothing is waiting on this
269
+ * one any more; `restored` is what tells the sheet to run the call rather
270
+ * than answer a dead promise.
271
+ *
272
+ * Refused once a turn is under way, for the same reason `hydrate` is: a slow
273
+ * disk read must not shove an old question in front of a live conversation.
274
+ */
275
+ restorePending(input: Omit<PendingApproval, "resolve" | "restored">): boolean;
276
+ /**
277
+ * A line in the transcript from Buoy itself rather than from the model.
278
+ *
279
+ * It wears the assistant's bubble because that is the only shape the list
280
+ * renders, but nothing is sent to the model and nothing lands in its
281
+ * history — it exists so an approval answered after a restart leaves a
282
+ * trace, instead of the card silently vanishing a second time.
283
+ */
284
+ addNote(text: string): void;
167
285
  /**
168
286
  * Put a saved conversation back, once, at open.
169
287
  *
@@ -178,8 +296,27 @@ export declare const askBuoyStore: {
178
296
  output: number;
179
297
  requests: number;
180
298
  };
299
+ /**
300
+ * Messages that were still parked when the app died. Restored VISIBLY and
301
+ * never auto-sent: the turn they were waiting on is gone, and a request
302
+ * firing by itself on relaunch is the one thing a restart must not do.
303
+ */
304
+ queued?: QueuedMessage[];
181
305
  }): boolean;
182
306
  reset(): void;
183
307
  };
308
+ /** See TurnPhase. Pure, so every component and the flush effect agree. */
309
+ export declare function turnPhaseOf(s: AskBuoyState): TurnPhase;
310
+ /**
311
+ * Why parked messages are NOT being sent right now, in the user's words — or
312
+ * null when the queue may deliver.
313
+ *
314
+ * A queued message is a next TASK, not an answer. It used to go the moment
315
+ * `busy` dropped: after an error it fired into the same dead connection, and
316
+ * with a choice block open it was sent as the reply to the question. So the
317
+ * queue holds on error, Stop, an approval and an unanswered Ask block, and
318
+ * says which.
319
+ */
320
+ export declare function queuePauseReason(s: AskBuoyState): string | null;
184
321
  export {};
185
322
  //# sourceMappingURL=askBuoyStore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"askBuoyStore.d.ts","sourceRoot":"","sources":["../../../src/store/askBuoyStore.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEvG,+EAA+E;AAC/E,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,SAAS,GAAG,IAAI,GAAG,QAAQ,GAAG,SAAS,CAAC;IAChD,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,GAAG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,GAAG,IAAI,CAS/D"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Where each block of a turn is drawn: inside a step row, after the prose as
3
+ * the answer itself, or last of all as the thing being asked.
4
+ *
5
+ * Pure and separate from MessageList because the rule is subtle and the cost
6
+ * of getting it wrong is silent — a block that lands in no bucket renders
7
+ * nowhere at all, and nothing in the UI says so. That is exactly what
8
+ * happened: "show me the shop as pictures" built its imageGrid, the engine
9
+ * accepted it, and the sheet dropped it on the floor twice while the model
10
+ * narrated the artwork in prose.
11
+ */
12
+ import { type Block } from "@buoy-gg/agent-core";
13
+ import type { PlacedBlock } from "./askBuoyStore";
14
+ export interface BlockPlacement {
15
+ /** Receipts folded into the step row that produced them, by tool-call id. */
16
+ nested: Map<string, Block[]>;
17
+ /**
18
+ * Cards drawn AFTER the prose — the answer itself, once the text has said
19
+ * what it is. Named for the position on purpose: this bucket used to render
20
+ * between the activity list and the text, which put a 28-item grid above
21
+ * the five paragraphs explaining it. The order is a promise the prompt
22
+ * makes to the model ("say what it means, then show it"), so it must not be
23
+ * a detail of how MessageList happens to be laid out.
24
+ */
25
+ afterText: PlacedBlock[];
26
+ /** Choice / confirm / input — drawn last of all, after the answer. */
27
+ ask: PlacedBlock[];
28
+ }
29
+ export declare function placeBlocks(blocks: PlacedBlock[], stepIds: Iterable<string>): BlockPlacement;
30
+ //# sourceMappingURL=blockPlacement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockPlacement.d.ts","sourceRoot":"","sources":["../../../src/store/blockPlacement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAc,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,cAAc;IAC7B,6EAA6E;IAC7E,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7B;;;;;;;OAOG;IACH,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,sEAAsE;IACtE,GAAG,EAAE,WAAW,EAAE,CAAC;CACpB;AAiBD,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,cAAc,CAwB5F"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=blockPlacement.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockPlacement.test.d.ts","sourceRoot":"","sources":["../../../src/store/blockPlacement.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=queue.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.test.d.ts","sourceRoot":"","sources":["../../../src/store/queue.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * "New conversation" — the ONE way a conversation is cleared.
3
+ *
4
+ * Clearing drops the effect ledger, which is the only undo surface, while the
5
+ * agent's changes stay live in the app. So the path that clears has to be the
6
+ * path that knows whether undo succeeded — and there used to be two paths
7
+ * that did not: the sheet's "Undo, then clear" awaited `revertAll` and reset
8
+ * without reading the outcome (two of five reverts fail, the conversation
9
+ * clears anyway, two changes stay applied with no record), and the desktop's
10
+ * `reset` action skipped the question entirely.
11
+ *
12
+ * Both now come through here. A failed revert does NOT clear: the caller gets
13
+ * the list of what is still applied and clearing becomes a second, explicit
14
+ * choice.
15
+ */
16
+ import type { DispatchFn, RevertOutcome } from "@buoy-gg/agent-core";
17
+ export interface ResetOutcome {
18
+ /** The conversation, session and saved copy are gone. */
19
+ cleared: boolean;
20
+ /** How many changes were put back first. */
21
+ reverted: number;
22
+ /** Changes that could not be put back and are still live in the app. */
23
+ failed: RevertOutcome["failed"];
24
+ }
25
+ /** Clear everything, unconditionally. The caller has already decided. */
26
+ export declare function clearConversation(): void;
27
+ /**
28
+ * Undo what can be undone, then clear — unless something would not go back.
29
+ *
30
+ * Refuses while a turn is running: the ledger is being written to, and a
31
+ * revert racing a dispatch is how "changed since Ask Buoy wrote it" happens
32
+ * to our own write.
33
+ */
34
+ export declare function resetConversation(input: {
35
+ dispatch: DispatchFn;
36
+ undoFirst: boolean;
37
+ }): Promise<ResetOutcome>;
38
+ //# sourceMappingURL=resetConversation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resetConversation.d.ts","sourceRoot":"","sources":["../../../src/store/resetConversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKrE,MAAM,WAAW,YAAY;IAC3B,yDAAyD;IACzD,OAAO,EAAE,OAAO,CAAC;IACjB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;CACjC;AAED,yEAAyE;AACzE,wBAAgB,iBAAiB,IAAI,IAAI,CAMxC;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE;IAC7C,QAAQ,EAAE,UAAU,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;CACpB,GAAG,OAAO,CAAC,YAAY,CAAC,CAexB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=restorePending.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restorePending.test.d.ts","sourceRoot":"","sources":["../../../src/store/restorePending.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * The empty state's "try asking" chips, filtered to what will actually work.
3
+ *
4
+ * The list was static, so a release build offered "Make the next request fail
5
+ * with a 500" directly above a line saying simulations need a dev build — and
6
+ * the agent then refused the very thing the screen had just suggested. First
7
+ * impression: broken. Each chip now says what it needs; the empty state keeps
8
+ * the ones this device, build and policy can honour.
9
+ *
10
+ * Deterministic on purpose: no model call, no navigation, no guessed route
11
+ * names or account ids. When the tool registry has not reported yet (it fills
12
+ * in a frame or two after open) only the chips that need nothing are shown —
13
+ * a short list that grows beats a long one that shrinks.
14
+ */
15
+ export interface Suggestion {
16
+ text: string;
17
+ /** A Buoy tool that must be registered on this device. */
18
+ needs?: string;
19
+ /** The chip asks for a change — hidden in read-only mode. */
20
+ write?: boolean;
21
+ /** The chip drives a dev-only simulation — hidden in a release build. */
22
+ devOnly?: boolean;
23
+ }
24
+ export declare const SUGGESTIONS: Suggestion[];
25
+ /** At most this many chips — the rest of the screen is the point. */
26
+ export declare const MAX_SUGGESTIONS = 4;
27
+ export declare function pickSuggestions(input: {
28
+ availableToolIds: string[];
29
+ readOnly: boolean;
30
+ isRelease: boolean;
31
+ }): string[];
32
+ //# sourceMappingURL=suggestions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggestions.d.ts","sourceRoot":"","sources":["../../../src/store/suggestions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yEAAyE;IACzE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,WAAW,EAAE,UAAU,EAOnC,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,eAAe,IAAI,CAAC;AAEjC,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACpB,GAAG,MAAM,EAAE,CAUX"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=suggestions.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggestions.test.d.ts","sourceRoot":"","sources":["../../../src/store/suggestions.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=systemLine.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"systemLine.test.d.ts","sourceRoot":"","sources":["../../../src/store/systemLine.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The "Summarize for a ticket" request, sent as an ordinary user message.
3
+ *
4
+ * One button, one canned sentence, because the machinery already exists: the
5
+ * prompt teaches the `finding` block and the renderer draws it. What was
6
+ * missing was a way to ASK for one without knowing the word, and a Copy that
7
+ * includes it (see blockText.ts). Facts and inference are separated in the
8
+ * ask, nothing is re-run to produce it, and nothing is submitted anywhere.
9
+ */
10
+ export declare const TICKET_PROMPT: string;
11
+ //# sourceMappingURL=ticketPrompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ticketPrompt.d.ts","sourceRoot":"","sources":["../../../src/store/ticketPrompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,QAMiG,CAAC"}
@@ -1,7 +1,26 @@
1
- import type { AgentMessage } from "@buoy-gg/agent-core";
2
- import type { ChatMessage } from "./askBuoyStore";
1
+ import type { AgentMessage, LedgerEntry } from "@buoy-gg/agent-core";
2
+ import type { ChatMessage, PendingApproval, QueuedMessage } from "./askBuoyStore";
3
3
  /** `@react_buoy` prefix, so the Storage tool treats it as one of its own. */
4
4
  export declare const TRANSCRIPT_KEY: string;
5
+ /**
6
+ * An approval the user never answered.
7
+ *
8
+ * Saved with the conversation because an unanswered question is exactly the
9
+ * state a reload must not quietly resolve for them: nothing was tapped, so the
10
+ * change is still pending as far as they know. `params` is the real call —
11
+ * after a restart there is no turn left to resume, so Allow re-dispatches it.
12
+ */
13
+ export interface StoredApproval {
14
+ id: string;
15
+ toolId: string;
16
+ action: string;
17
+ label: string;
18
+ description?: string;
19
+ reason: string;
20
+ params: Record<string, unknown>;
21
+ /** A hash of the target at ask time, never the target. See PendingApproval. */
22
+ targetDigest?: string;
23
+ }
5
24
  export interface StoredTranscript {
6
25
  v: number;
7
26
  savedAt: number;
@@ -15,6 +34,23 @@ export interface StoredTranscript {
15
34
  output: number;
16
35
  requests: number;
17
36
  };
37
+ /** The card that was still on screen, if any. See StoredApproval. */
38
+ pending?: StoredApproval | null;
39
+ /**
40
+ * The effect ledger — what the agent changed, and how to put it back.
41
+ *
42
+ * Saved because it is the ONLY undo surface and it used to die with the JS
43
+ * context: the transcript came back after a reload with its "saved" lines
44
+ * and receipt cards intact, while the changes bar vanished and the changes
45
+ * stayed applied. Entries are plain data; the values inside them are the
46
+ * PRIOR state a revert needs (a storage key's old value, a rule id).
47
+ */
48
+ ledger?: LedgerEntry[];
49
+ /**
50
+ * Messages still parked when the app died. Come back as unsent rows the
51
+ * user can send, edit or drop — never auto-sent on relaunch.
52
+ */
53
+ queued?: QueuedMessage[];
18
54
  }
19
55
  /**
20
56
  * Trim to the caps. Messages and history are trimmed together and from the
@@ -31,6 +67,9 @@ export declare function buildPayload(input: {
31
67
  output: number;
32
68
  requests: number;
33
69
  };
70
+ pending?: PendingApproval | null;
71
+ ledger?: LedgerEntry[];
72
+ queued?: QueuedMessage[];
34
73
  }): StoredTranscript;
35
74
  /** Anything unparseable, or from an older shape, is treated as "no transcript". */
36
75
  export declare function parsePayload(raw: string | null): StoredTranscript | null;
@@ -1 +1 @@
1
- {"version":3,"file":"transcriptPersistence.d.ts","sourceRoot":"","sources":["../../../src/store/transcriptPersistence.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,6EAA6E;AAC7E,eAAO,MAAM,cAAc,QAAoD,CAAC;AAkBhF,MAAM,WAAW,gBAAgB;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;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AC;IACjC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3D,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;CAC1B,GAAG,gBAAgB,CAcnB;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,gBAAgB,GAAG,IAAI,CAiCxE;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAMvE;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAO9E;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAMrD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=turnRendering.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turnRendering.test.d.ts","sourceRoot":"","sources":["../../../src/store/turnRendering.test.ts"],"names":[],"mappings":""}
@@ -1,15 +1,35 @@
1
1
  import { type BlockAction, type BlockAnswer } from "@buoy-gg/agent-core";
2
2
  import { type AskBuoyState } from "./askBuoyStore";
3
+ import { type ResetOutcome } from "./resetConversation";
3
4
  import type { AskBuoyConfig } from "../types";
4
5
  export declare function useAskBuoyState(): AskBuoyState;
5
6
  export interface AskBuoyController {
6
7
  state: AskBuoyState;
7
8
  send: (text: string) => void;
8
9
  stop: () => void;
10
+ /** Clear everything, unconditionally. See `undoThenReset` for the guarded path. */
9
11
  reset: () => void;
12
+ /**
13
+ * Undo what can be undone, then clear — or refuse and say what is still
14
+ * applied. The sheet's "Undo, then clear" and the desktop's reset both go
15
+ * through this; see resetConversation.ts for why there is only one path.
16
+ */
17
+ undoThenReset: () => Promise<ResetOutcome>;
10
18
  approve: (approved: boolean) => void;
11
- /** Re-send the last user message after a failed turn. */
19
+ /**
20
+ * Run the last user message again after a failed or stopped turn.
21
+ *
22
+ * The failed bubble STAYS. It used to be removed first, and it can hold
23
+ * receipts for writes that really happened — two bag lines landed, the
24
+ * endpoint dropped on the third — so deleting it deleted the only record of
25
+ * them while the changes bar went on counting them. A new attempt gets a new
26
+ * bubble; the old one simply loses its Try-again button.
27
+ */
12
28
  retry: () => void;
29
+ /** Pull a parked message back into the composer to edit. */
30
+ editQueued: (id: string) => void;
31
+ /** Drop a parked message. */
32
+ removeQueued: (id: string) => void;
13
33
  /** Answer an Ask block: locks it and sends the answer as the next message. */
14
34
  answer: (answer: BlockAnswer) => void;
15
35
  /** Run a block button that dispatches a Buoy action or sends a message. */
@@ -17,6 +37,8 @@ export interface AskBuoyController {
17
37
  configured: boolean;
18
38
  /** How many Buoy tools the agent can reach on this device. */
19
39
  toolCount: number;
40
+ /** Which ones, for the empty state's chips. */
41
+ availableToolIds: string[];
20
42
  }
21
43
  export declare function useAskBuoy(config: AskBuoyConfig | undefined): AskBuoyController;
22
44
  //# sourceMappingURL=useAskBuoy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAskBuoy.d.ts","sourceRoot":"","sources":["../../../src/store/useAskBuoy.ts"],"names":[],"mappings":"AAuBA,OAAO,EAML,KAAK,WAAW,EAChB,KAAK,WAAW,EAEjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAOjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAO9C,wBAAgB,eAAe,IAAI,YAAY,CAE9C;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,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EAAE,MAAM,IAAI,CAAC;IAClB,4DAA4D;IAC5D,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,6BAA6B;IAC7B,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,8EAA8E;IAC9E,MAAM,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IACtC,2EAA2E;IAC3E,SAAS,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,UAAU,EAAE,OAAO,CAAC;IACpB,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,GAAG,iBAAiB,CAujB/E"}
@@ -15,7 +15,7 @@ export declare const askBuoySyncAdapter: {
15
15
  toolCalls: {
16
16
  toolId: string;
17
17
  action: string;
18
- status: "running" | "failed" | "ok" | "refused";
18
+ status: "running" | "failed" | "ok" | "refused" | "declined" | "stopped";
19
19
  }[];
20
20
  }[];
21
21
  usage: {
@@ -33,7 +33,7 @@ export declare const askBuoySyncAdapter: {
33
33
  permanent: number;
34
34
  transients: number;
35
35
  items: {
36
- kind: "network-override" | "impersonation" | "storage-write" | "state-write" | "transient";
36
+ kind: "network-override" | "impersonation" | "storage-write" | "query-write" | "state-write" | "transient";
37
37
  label: string;
38
38
  }[];
39
39
  };
@@ -46,7 +46,7 @@ export declare const askBuoySyncAdapter: {
46
46
  at: number;
47
47
  toolId: string;
48
48
  action: string;
49
- kind: "network-override" | "impersonation" | "storage-write" | "state-write" | "transient";
49
+ kind: "network-override" | "impersonation" | "storage-write" | "query-write" | "state-write" | "transient";
50
50
  label: string;
51
51
  reversible: boolean;
52
52
  }[];
@@ -64,10 +64,30 @@ export declare const askBuoySyncAdapter: {
64
64
  ok: boolean;
65
65
  error?: undefined;
66
66
  }>;
67
- /** Clear the transcript and the ledger. Does not undo anything. */
68
- reset: () => {
67
+ /**
68
+ * Undo what can be undone, then clear the transcript and the ledger.
69
+ *
70
+ * The same path as the sheet's "New conversation" (resetConversation.ts).
71
+ * This action used to clear unconditionally — no question, no undo — so a
72
+ * desktop click could drop the only undo record for changes still live on
73
+ * the tester's phone. Now it refuses to clear when a revert fails and says
74
+ * what is still applied; the dashboard decides whether to clear anyway
75
+ * by calling `undoAll` first or accepting the kept conversation.
76
+ */
77
+ reset: () => Promise<{
69
78
  ok: boolean;
70
- };
79
+ error: string;
80
+ failed: {
81
+ label: string;
82
+ error: string;
83
+ }[];
84
+ reverted?: undefined;
85
+ } | {
86
+ ok: boolean;
87
+ reverted: number;
88
+ error?: undefined;
89
+ failed?: undefined;
90
+ }>;
71
91
  };
72
92
  };
73
93
  //# sourceMappingURL=askBuoySyncAdapter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"askBuoySyncAdapter.d.ts","sourceRoot":"","sources":["../../../src/sync/askBuoySyncAdapter.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAiDT,MAAM,IAAI;;QAU5B,8DAA8D;;;;;;;;;;QAgB9D,qEAAqE;;;;;;;;;;;;;;QAQrE,mEAAmE;;;;;CAMtE,CAAC"}
1
+ {"version":3,"file":"askBuoySyncAdapter.d.ts","sourceRoot":"","sources":["../../../src/sync/askBuoySyncAdapter.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAiDT,MAAM,IAAI;;QAU5B,8DAA8D;;;;;;;;;;QAgB9D,qEAAqE;;;;;;;;;;;;;;QAQrE;;;;;;;;;WASG;;;;;;;;;;;;;;;;CAaN,CAAC"}