@buoy-gg/ask-buoy 7.0.34 → 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 (352) hide show
  1. package/README.md +35 -8
  2. package/lib/commonjs/blocks/AskBlocks.js +338 -1
  3. package/lib/commonjs/blocks/AskBlocks.js.map +1 -0
  4. package/lib/commonjs/blocks/BlockRenderer.js +262 -1
  5. package/lib/commonjs/blocks/BlockRenderer.js.map +1 -0
  6. package/lib/commonjs/blocks/ChromePrototypes.js +514 -1
  7. package/lib/commonjs/blocks/ChromePrototypes.js.map +1 -0
  8. package/lib/commonjs/blocks/DataBlocks.js +781 -1
  9. package/lib/commonjs/blocks/DataBlocks.js.map +1 -0
  10. package/lib/commonjs/blocks/ExtraBlocks.js +1860 -1
  11. package/lib/commonjs/blocks/ExtraBlocks.js.map +1 -0
  12. package/lib/commonjs/blocks/MediaBlocks.js +156 -1
  13. package/lib/commonjs/blocks/MediaBlocks.js.map +1 -0
  14. package/lib/commonjs/blocks/ReceiptBlocks.js +586 -1
  15. package/lib/commonjs/blocks/ReceiptBlocks.js.map +1 -0
  16. package/lib/commonjs/blocks/blockText.js +60 -0
  17. package/lib/commonjs/blocks/blockText.js.map +1 -0
  18. package/lib/commonjs/blocks/blockText.test.js +53 -0
  19. package/lib/commonjs/blocks/blockText.test.js.map +1 -0
  20. package/lib/commonjs/blocks/context.js +42 -1
  21. package/lib/commonjs/blocks/context.js.map +1 -0
  22. package/lib/commonjs/blocks/icons.js +96 -1
  23. package/lib/commonjs/blocks/icons.js.map +1 -0
  24. package/lib/commonjs/blocks/index.js +95 -1
  25. package/lib/commonjs/blocks/index.js.map +1 -0
  26. package/lib/commonjs/blocks/listRow.test.js +55 -0
  27. package/lib/commonjs/blocks/listRow.test.js.map +1 -0
  28. package/lib/commonjs/blocks/pageState.js +34 -0
  29. package/lib/commonjs/blocks/pageState.js.map +1 -0
  30. package/lib/commonjs/blocks/pageState.test.js +57 -0
  31. package/lib/commonjs/blocks/pageState.test.js.map +1 -0
  32. package/lib/commonjs/blocks/primitives.js +457 -1
  33. package/lib/commonjs/blocks/primitives.js.map +1 -0
  34. package/lib/commonjs/blocks/primitivesIndex.js +62 -1
  35. package/lib/commonjs/blocks/primitivesIndex.js.map +1 -0
  36. package/lib/commonjs/components/ApprovalCard.js +244 -1
  37. package/lib/commonjs/components/ApprovalCard.js.map +1 -0
  38. package/lib/commonjs/components/AskBuoyHeader.js +196 -1
  39. package/lib/commonjs/components/AskBuoyHeader.js.map +1 -0
  40. package/lib/commonjs/components/AskBuoyIcon.js +19 -1
  41. package/lib/commonjs/components/AskBuoyIcon.js.map +1 -0
  42. package/lib/commonjs/components/AskBuoyModal.js +479 -1
  43. package/lib/commonjs/components/AskBuoyModal.js.map +1 -0
  44. package/lib/commonjs/components/AskBuoySettings.js +119 -0
  45. package/lib/commonjs/components/AskBuoySettings.js.map +1 -0
  46. package/lib/commonjs/components/ChangesBar.js +211 -1
  47. package/lib/commonjs/components/ChangesBar.js.map +1 -0
  48. package/lib/commonjs/components/Composer.js +255 -1
  49. package/lib/commonjs/components/Composer.js.map +1 -0
  50. package/lib/commonjs/components/EmptyState.js +161 -1
  51. package/lib/commonjs/components/EmptyState.js.map +1 -0
  52. package/lib/commonjs/components/KeyboardPad.js +80 -0
  53. package/lib/commonjs/components/KeyboardPad.js.map +1 -0
  54. package/lib/commonjs/components/Markdown.js +310 -1
  55. package/lib/commonjs/components/Markdown.js.map +1 -0
  56. package/lib/commonjs/components/MessageList.js +930 -1
  57. package/lib/commonjs/components/MessageList.js.map +1 -0
  58. package/lib/commonjs/components/QueuedMessages.js +145 -0
  59. package/lib/commonjs/components/QueuedMessages.js.map +1 -0
  60. package/lib/commonjs/components/ThinkingStrip.js +223 -0
  61. package/lib/commonjs/components/ThinkingStrip.js.map +1 -0
  62. package/lib/commonjs/components/TypingDots.js +63 -1
  63. package/lib/commonjs/components/TypingDots.js.map +1 -0
  64. package/lib/commonjs/components/markdownParse.js +131 -0
  65. package/lib/commonjs/components/markdownParse.js.map +1 -0
  66. package/lib/commonjs/components/markdownParse.test.js +99 -0
  67. package/lib/commonjs/components/markdownParse.test.js.map +1 -0
  68. package/lib/commonjs/components/useCopyAction.js +50 -0
  69. package/lib/commonjs/components/useCopyAction.js.map +1 -0
  70. package/lib/commonjs/index.js +252 -1
  71. package/lib/commonjs/index.js.map +1 -0
  72. package/lib/commonjs/preset.js +90 -1
  73. package/lib/commonjs/preset.js.map +1 -0
  74. package/lib/commonjs/store/activityGroups.js +110 -0
  75. package/lib/commonjs/store/activityGroups.js.map +1 -0
  76. package/lib/commonjs/store/activityGroups.test.js +78 -0
  77. package/lib/commonjs/store/activityGroups.test.js.map +1 -0
  78. package/lib/commonjs/store/askBuoySettings.js +72 -0
  79. package/lib/commonjs/store/askBuoySettings.js.map +1 -0
  80. package/lib/commonjs/store/askBuoyStore.js +547 -1
  81. package/lib/commonjs/store/askBuoyStore.js.map +1 -0
  82. package/lib/commonjs/store/blockPlacement.js +64 -0
  83. package/lib/commonjs/store/blockPlacement.js.map +1 -0
  84. package/lib/commonjs/store/blockPlacement.test.js +123 -0
  85. package/lib/commonjs/store/blockPlacement.test.js.map +1 -0
  86. package/lib/commonjs/store/queue.test.js +150 -0
  87. package/lib/commonjs/store/queue.test.js.map +1 -0
  88. package/lib/commonjs/store/resetConversation.js +77 -0
  89. package/lib/commonjs/store/resetConversation.js.map +1 -0
  90. package/lib/commonjs/store/restorePending.test.js +63 -0
  91. package/lib/commonjs/store/restorePending.test.js.map +1 -0
  92. package/lib/commonjs/store/restoredIds.test.js +47 -0
  93. package/lib/commonjs/store/restoredIds.test.js.map +1 -0
  94. package/lib/commonjs/store/suggestions.js +54 -0
  95. package/lib/commonjs/store/suggestions.js.map +1 -0
  96. package/lib/commonjs/store/suggestions.test.js +58 -0
  97. package/lib/commonjs/store/suggestions.test.js.map +1 -0
  98. package/lib/commonjs/store/systemLine.test.js +77 -0
  99. package/lib/commonjs/store/systemLine.test.js.map +1 -0
  100. package/lib/commonjs/store/ticketPrompt.js +17 -0
  101. package/lib/commonjs/store/ticketPrompt.js.map +1 -0
  102. package/lib/commonjs/store/traceText.js +81 -0
  103. package/lib/commonjs/store/traceText.js.map +1 -0
  104. package/lib/commonjs/store/traceText.test.js +112 -0
  105. package/lib/commonjs/store/traceText.test.js.map +1 -0
  106. package/lib/commonjs/store/transcriptPersistence.js +297 -0
  107. package/lib/commonjs/store/transcriptPersistence.js.map +1 -0
  108. package/lib/commonjs/store/transcriptPersistence.test.js +333 -0
  109. package/lib/commonjs/store/transcriptPersistence.test.js.map +1 -0
  110. package/lib/commonjs/store/turnRendering.test.js +151 -0
  111. package/lib/commonjs/store/turnRendering.test.js.map +1 -0
  112. package/lib/commonjs/store/useAskBuoy.js +622 -1
  113. package/lib/commonjs/store/useAskBuoy.js.map +1 -0
  114. package/lib/commonjs/store/useAskBuoySettings.js +14 -0
  115. package/lib/commonjs/store/useAskBuoySettings.js.map +1 -0
  116. package/lib/commonjs/sync/askBuoySyncAdapter.js +140 -1
  117. package/lib/commonjs/sync/askBuoySyncAdapter.js.map +1 -0
  118. package/lib/commonjs/sync/askBuoySyncAdapter.test.js +141 -1
  119. package/lib/commonjs/sync/askBuoySyncAdapter.test.js.map +1 -0
  120. package/lib/commonjs/sync/wire.js +58 -1
  121. package/lib/commonjs/sync/wire.js.map +1 -0
  122. package/lib/commonjs/types.js +6 -1
  123. package/lib/commonjs/types.js.map +1 -0
  124. package/lib/module/blocks/AskBlocks.js +331 -1
  125. package/lib/module/blocks/AskBlocks.js.map +1 -0
  126. package/lib/module/blocks/BlockRenderer.js +257 -1
  127. package/lib/module/blocks/BlockRenderer.js.map +1 -0
  128. package/lib/module/blocks/ChromePrototypes.js +503 -1
  129. package/lib/module/blocks/ChromePrototypes.js.map +1 -0
  130. package/lib/module/blocks/DataBlocks.js +767 -1
  131. package/lib/module/blocks/DataBlocks.js.map +1 -0
  132. package/lib/module/blocks/ExtraBlocks.js +1833 -1
  133. package/lib/module/blocks/ExtraBlocks.js.map +1 -0
  134. package/lib/module/blocks/MediaBlocks.js +151 -1
  135. package/lib/module/blocks/MediaBlocks.js.map +1 -0
  136. package/lib/module/blocks/ReceiptBlocks.js +574 -1
  137. package/lib/module/blocks/ReceiptBlocks.js.map +1 -0
  138. package/lib/module/blocks/blockText.js +55 -0
  139. package/lib/module/blocks/blockText.js.map +1 -0
  140. package/lib/module/blocks/blockText.test.js +53 -0
  141. package/lib/module/blocks/blockText.test.js.map +1 -0
  142. package/lib/module/blocks/context.js +35 -1
  143. package/lib/module/blocks/context.js.map +1 -0
  144. package/lib/module/blocks/icons.js +91 -1
  145. package/lib/module/blocks/icons.js.map +1 -0
  146. package/lib/module/blocks/index.js +8 -1
  147. package/lib/module/blocks/index.js.map +1 -0
  148. package/lib/module/blocks/listRow.test.js +56 -0
  149. package/lib/module/blocks/listRow.test.js.map +1 -0
  150. package/lib/module/blocks/pageState.js +30 -0
  151. package/lib/module/blocks/pageState.js.map +1 -0
  152. package/lib/module/blocks/pageState.test.js +56 -0
  153. package/lib/module/blocks/pageState.test.js.map +1 -0
  154. package/lib/module/blocks/primitives.js +445 -1
  155. package/lib/module/blocks/primitives.js.map +1 -0
  156. package/lib/module/blocks/primitivesIndex.js +5 -1
  157. package/lib/module/blocks/primitivesIndex.js.map +1 -0
  158. package/lib/module/components/ApprovalCard.js +239 -1
  159. package/lib/module/components/ApprovalCard.js.map +1 -0
  160. package/lib/module/components/AskBuoyHeader.js +193 -1
  161. package/lib/module/components/AskBuoyHeader.js.map +1 -0
  162. package/lib/module/components/AskBuoyIcon.js +8 -1
  163. package/lib/module/components/AskBuoyIcon.js.map +1 -0
  164. package/lib/module/components/AskBuoyModal.js +474 -1
  165. package/lib/module/components/AskBuoyModal.js.map +1 -0
  166. package/lib/module/components/AskBuoySettings.js +114 -0
  167. package/lib/module/components/AskBuoySettings.js.map +1 -0
  168. package/lib/module/components/ChangesBar.js +206 -1
  169. package/lib/module/components/ChangesBar.js.map +1 -0
  170. package/lib/module/components/Composer.js +250 -1
  171. package/lib/module/components/Composer.js.map +1 -0
  172. package/lib/module/components/EmptyState.js +156 -1
  173. package/lib/module/components/EmptyState.js.map +1 -0
  174. package/lib/module/components/KeyboardPad.js +75 -0
  175. package/lib/module/components/KeyboardPad.js.map +1 -0
  176. package/lib/module/components/Markdown.js +305 -1
  177. package/lib/module/components/Markdown.js.map +1 -0
  178. package/lib/module/components/MessageList.js +924 -1
  179. package/lib/module/components/MessageList.js.map +1 -0
  180. package/lib/module/components/QueuedMessages.js +140 -0
  181. package/lib/module/components/QueuedMessages.js.map +1 -0
  182. package/lib/module/components/ThinkingStrip.js +218 -0
  183. package/lib/module/components/ThinkingStrip.js.map +1 -0
  184. package/lib/module/components/TypingDots.js +58 -1
  185. package/lib/module/components/TypingDots.js.map +1 -0
  186. package/lib/module/components/markdownParse.js +125 -0
  187. package/lib/module/components/markdownParse.js.map +1 -0
  188. package/lib/module/components/markdownParse.test.js +98 -0
  189. package/lib/module/components/markdownParse.test.js.map +1 -0
  190. package/lib/module/components/useCopyAction.js +46 -0
  191. package/lib/module/components/useCopyAction.js.map +1 -0
  192. package/lib/module/index.js +34 -1
  193. package/lib/module/index.js.map +1 -0
  194. package/lib/module/preset.js +73 -1
  195. package/lib/module/preset.js.map +1 -0
  196. package/lib/module/store/activityGroups.js +103 -0
  197. package/lib/module/store/activityGroups.js.map +1 -0
  198. package/lib/module/store/activityGroups.test.js +77 -0
  199. package/lib/module/store/activityGroups.test.js.map +1 -0
  200. package/lib/module/store/askBuoySettings.js +67 -0
  201. package/lib/module/store/askBuoySettings.js.map +1 -0
  202. package/lib/module/store/askBuoyStore.js +541 -1
  203. package/lib/module/store/askBuoyStore.js.map +1 -0
  204. package/lib/module/store/blockPlacement.js +59 -0
  205. package/lib/module/store/blockPlacement.js.map +1 -0
  206. package/lib/module/store/blockPlacement.test.js +122 -0
  207. package/lib/module/store/blockPlacement.test.js.map +1 -0
  208. package/lib/module/store/queue.test.js +149 -0
  209. package/lib/module/store/queue.test.js.map +1 -0
  210. package/lib/module/store/resetConversation.js +72 -0
  211. package/lib/module/store/resetConversation.js.map +1 -0
  212. package/lib/module/store/restorePending.test.js +62 -0
  213. package/lib/module/store/restorePending.test.js.map +1 -0
  214. package/lib/module/store/restoredIds.test.js +46 -0
  215. package/lib/module/store/restoredIds.test.js.map +1 -0
  216. package/lib/module/store/suggestions.js +49 -0
  217. package/lib/module/store/suggestions.js.map +1 -0
  218. package/lib/module/store/suggestions.test.js +57 -0
  219. package/lib/module/store/suggestions.test.js.map +1 -0
  220. package/lib/module/store/systemLine.test.js +76 -0
  221. package/lib/module/store/systemLine.test.js.map +1 -0
  222. package/lib/module/store/ticketPrompt.js +13 -0
  223. package/lib/module/store/ticketPrompt.js.map +1 -0
  224. package/lib/module/store/traceText.js +75 -0
  225. package/lib/module/store/traceText.js.map +1 -0
  226. package/lib/module/store/traceText.test.js +111 -0
  227. package/lib/module/store/traceText.test.js.map +1 -0
  228. package/lib/module/store/transcriptPersistence.js +287 -0
  229. package/lib/module/store/transcriptPersistence.js.map +1 -0
  230. package/lib/module/store/transcriptPersistence.test.js +332 -0
  231. package/lib/module/store/transcriptPersistence.test.js.map +1 -0
  232. package/lib/module/store/turnRendering.test.js +150 -0
  233. package/lib/module/store/turnRendering.test.js.map +1 -0
  234. package/lib/module/store/useAskBuoy.js +616 -1
  235. package/lib/module/store/useAskBuoy.js.map +1 -0
  236. package/lib/module/store/useAskBuoySettings.js +9 -0
  237. package/lib/module/store/useAskBuoySettings.js.map +1 -0
  238. package/lib/module/sync/askBuoySyncAdapter.js +135 -1
  239. package/lib/module/sync/askBuoySyncAdapter.js.map +1 -0
  240. package/lib/module/sync/askBuoySyncAdapter.test.js +140 -1
  241. package/lib/module/sync/askBuoySyncAdapter.test.js.map +1 -0
  242. package/lib/module/sync/wire.js +47 -1
  243. package/lib/module/sync/wire.js.map +1 -0
  244. package/lib/module/types.js +4 -1
  245. package/lib/module/types.js.map +1 -0
  246. package/lib/typescript/blocks/AskBlocks.d.ts.map +1 -0
  247. package/lib/typescript/blocks/BlockRenderer.d.ts.map +1 -0
  248. package/lib/typescript/blocks/ChromePrototypes.d.ts.map +1 -0
  249. package/lib/typescript/blocks/DataBlocks.d.ts +42 -0
  250. package/lib/typescript/blocks/DataBlocks.d.ts.map +1 -0
  251. package/lib/typescript/blocks/ExtraBlocks.d.ts +29 -2
  252. package/lib/typescript/blocks/ExtraBlocks.d.ts.map +1 -0
  253. package/lib/typescript/blocks/MediaBlocks.d.ts.map +1 -0
  254. package/lib/typescript/blocks/ReceiptBlocks.d.ts.map +1 -0
  255. package/lib/typescript/blocks/blockText.d.ts +14 -0
  256. package/lib/typescript/blocks/blockText.d.ts.map +1 -0
  257. package/lib/typescript/blocks/blockText.test.d.ts +2 -0
  258. package/lib/typescript/blocks/blockText.test.d.ts.map +1 -0
  259. package/lib/typescript/blocks/context.d.ts.map +1 -0
  260. package/lib/typescript/blocks/icons.d.ts.map +1 -0
  261. package/lib/typescript/blocks/index.d.ts.map +1 -0
  262. package/lib/typescript/blocks/listRow.test.d.ts +2 -0
  263. package/lib/typescript/blocks/listRow.test.d.ts.map +1 -0
  264. package/lib/typescript/blocks/pageState.d.ts +23 -0
  265. package/lib/typescript/blocks/pageState.d.ts.map +1 -0
  266. package/lib/typescript/blocks/pageState.test.d.ts +2 -0
  267. package/lib/typescript/blocks/pageState.test.d.ts.map +1 -0
  268. package/lib/typescript/blocks/primitives.d.ts +55 -10
  269. package/lib/typescript/blocks/primitives.d.ts.map +1 -0
  270. package/lib/typescript/blocks/primitivesIndex.d.ts +2 -1
  271. package/lib/typescript/blocks/primitivesIndex.d.ts.map +1 -0
  272. package/lib/typescript/components/ApprovalCard.d.ts.map +1 -0
  273. package/lib/typescript/components/AskBuoyHeader.d.ts +41 -1
  274. package/lib/typescript/components/AskBuoyHeader.d.ts.map +1 -0
  275. package/lib/typescript/components/AskBuoyIcon.d.ts.map +1 -0
  276. package/lib/typescript/components/AskBuoyModal.d.ts.map +1 -0
  277. package/lib/typescript/components/AskBuoySettings.d.ts +2 -0
  278. package/lib/typescript/components/AskBuoySettings.d.ts.map +1 -0
  279. package/lib/typescript/components/ChangesBar.d.ts.map +1 -0
  280. package/lib/typescript/components/Composer.d.ts +16 -1
  281. package/lib/typescript/components/Composer.d.ts.map +1 -0
  282. package/lib/typescript/components/EmptyState.d.ts +5 -1
  283. package/lib/typescript/components/EmptyState.d.ts.map +1 -0
  284. package/lib/typescript/components/KeyboardPad.d.ts +33 -0
  285. package/lib/typescript/components/KeyboardPad.d.ts.map +1 -0
  286. package/lib/typescript/components/Markdown.d.ts +0 -10
  287. package/lib/typescript/components/Markdown.d.ts.map +1 -0
  288. package/lib/typescript/components/MessageList.d.ts +19 -7
  289. package/lib/typescript/components/MessageList.d.ts.map +1 -0
  290. package/lib/typescript/components/QueuedMessages.d.ts +10 -0
  291. package/lib/typescript/components/QueuedMessages.d.ts.map +1 -0
  292. package/lib/typescript/components/ThinkingStrip.d.ts +5 -0
  293. package/lib/typescript/components/ThinkingStrip.d.ts.map +1 -0
  294. package/lib/typescript/components/TypingDots.d.ts.map +1 -0
  295. package/lib/typescript/components/markdownParse.d.ts +49 -0
  296. package/lib/typescript/components/markdownParse.d.ts.map +1 -0
  297. package/lib/typescript/components/markdownParse.test.d.ts +2 -0
  298. package/lib/typescript/components/markdownParse.test.d.ts.map +1 -0
  299. package/lib/typescript/components/useCopyAction.d.ts +5 -0
  300. package/lib/typescript/components/useCopyAction.d.ts.map +1 -0
  301. package/lib/typescript/index.d.ts +5 -0
  302. package/lib/typescript/index.d.ts.map +1 -0
  303. package/lib/typescript/preset.d.ts.map +1 -0
  304. package/lib/typescript/store/activityGroups.d.ts +29 -0
  305. package/lib/typescript/store/activityGroups.d.ts.map +1 -0
  306. package/lib/typescript/store/activityGroups.test.d.ts +2 -0
  307. package/lib/typescript/store/activityGroups.test.d.ts.map +1 -0
  308. package/lib/typescript/store/askBuoySettings.d.ts +44 -0
  309. package/lib/typescript/store/askBuoySettings.d.ts.map +1 -0
  310. package/lib/typescript/store/askBuoyStore.d.ts +216 -18
  311. package/lib/typescript/store/askBuoyStore.d.ts.map +1 -0
  312. package/lib/typescript/store/blockPlacement.d.ts +30 -0
  313. package/lib/typescript/store/blockPlacement.d.ts.map +1 -0
  314. package/lib/typescript/store/blockPlacement.test.d.ts +2 -0
  315. package/lib/typescript/store/blockPlacement.test.d.ts.map +1 -0
  316. package/lib/typescript/store/queue.test.d.ts +2 -0
  317. package/lib/typescript/store/queue.test.d.ts.map +1 -0
  318. package/lib/typescript/store/resetConversation.d.ts +38 -0
  319. package/lib/typescript/store/resetConversation.d.ts.map +1 -0
  320. package/lib/typescript/store/restorePending.test.d.ts +2 -0
  321. package/lib/typescript/store/restorePending.test.d.ts.map +1 -0
  322. package/lib/typescript/store/restoredIds.test.d.ts +2 -0
  323. package/lib/typescript/store/restoredIds.test.d.ts.map +1 -0
  324. package/lib/typescript/store/suggestions.d.ts +32 -0
  325. package/lib/typescript/store/suggestions.d.ts.map +1 -0
  326. package/lib/typescript/store/suggestions.test.d.ts +2 -0
  327. package/lib/typescript/store/suggestions.test.d.ts.map +1 -0
  328. package/lib/typescript/store/systemLine.test.d.ts +2 -0
  329. package/lib/typescript/store/systemLine.test.d.ts.map +1 -0
  330. package/lib/typescript/store/ticketPrompt.d.ts +11 -0
  331. package/lib/typescript/store/ticketPrompt.d.ts.map +1 -0
  332. package/lib/typescript/store/traceText.d.ts +33 -0
  333. package/lib/typescript/store/traceText.d.ts.map +1 -0
  334. package/lib/typescript/store/traceText.test.d.ts +2 -0
  335. package/lib/typescript/store/traceText.test.d.ts.map +1 -0
  336. package/lib/typescript/store/transcriptPersistence.d.ts +79 -0
  337. package/lib/typescript/store/transcriptPersistence.d.ts.map +1 -0
  338. package/lib/typescript/store/transcriptPersistence.test.d.ts +2 -0
  339. package/lib/typescript/store/transcriptPersistence.test.d.ts.map +1 -0
  340. package/lib/typescript/store/turnRendering.test.d.ts +2 -0
  341. package/lib/typescript/store/turnRendering.test.d.ts.map +1 -0
  342. package/lib/typescript/store/useAskBuoy.d.ts +23 -1
  343. package/lib/typescript/store/useAskBuoy.d.ts.map +1 -0
  344. package/lib/typescript/store/useAskBuoySettings.d.ts +3 -0
  345. package/lib/typescript/store/useAskBuoySettings.d.ts.map +1 -0
  346. package/lib/typescript/sync/askBuoySyncAdapter.d.ts +26 -6
  347. package/lib/typescript/sync/askBuoySyncAdapter.d.ts.map +1 -0
  348. package/lib/typescript/sync/askBuoySyncAdapter.test.d.ts.map +1 -0
  349. package/lib/typescript/sync/wire.d.ts.map +1 -0
  350. package/lib/typescript/types.d.ts +24 -1
  351. package/lib/typescript/types.d.ts.map +1 -0
  352. package/package.json +9 -9
@@ -1,16 +1,3 @@
1
- /**
2
- * Conversation state for the sheet.
3
- *
4
- * A module-level store rather than component state for two reasons: the sheet
5
- * is unmounted whenever the tool is closed or minimised (and a conversation
6
- * that vanished because someone tapped away would be maddening), and the sync
7
- * adapter needs to read the same transcript to show it on the desktop.
8
- *
9
- * Deliberately NOT persisted. A transcript can contain anything the agent read
10
- * — storage values, response bodies, a customer's record — and writing that to
11
- * disk under a Buoy key would put it in the Storage tool and, from there, on
12
- * the unauthenticated broker wire. It lives for the session and no longer.
13
- */
14
1
  import type { Block, BlockAnswer, AskBuoySession, EffectLedger, TurnEvent } from "@buoy-gg/agent-core";
15
2
  /** A block in a message, and (for receipts) the tool call that produced it. */
16
3
  export interface PlacedBlock {
@@ -25,9 +12,50 @@ export interface ChatToolCall {
25
12
  label: string;
26
13
  /** The catalog's fuller sentence, shown when the row is expanded. */
27
14
  description?: string;
28
- 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";
29
25
  /** Trailing status word once finished — "12 items", "Not found", "Done". */
30
26
  summary?: string;
27
+ /**
28
+ * What the model asked this step to do, serialised and capped. Shown only in
29
+ * the thinking view — it is the difference between "a storage write ran" and
30
+ * "it wrote `null` to `@pokemart/bag`".
31
+ */
32
+ params?: string;
33
+ /** read / write / destructive, from the catalog. */
34
+ effect?: "read" | "write" | "destructive";
35
+ /** Epoch ms the dispatch started, and how long it took. */
36
+ startedAt?: number;
37
+ durationMs?: number;
38
+ /**
39
+ * The redacted result the model was given, capped.
40
+ *
41
+ * IN MEMORY ONLY. `transcriptPersistence` strips it before writing, which is
42
+ * what keeps the promise that tool results never reach the disk; it leaves
43
+ * on the clipboard because that is a deliberate human act, the same as Share.
44
+ */
45
+ result?: string;
46
+ }
47
+ /**
48
+ * A stretch of the model's own reasoning, and where it fell.
49
+ *
50
+ * `afterCalls` is how many tool calls this message had already made when the
51
+ * thought arrived, so the thinking view can lay reasoning and steps out in the
52
+ * order they actually happened. One assistant bubble spans every turn of a
53
+ * multi-step run, so "think, act, think, act" is the normal shape and showing
54
+ * all the thoughts in a lump at the top would misreport it.
55
+ */
56
+ export interface ChatReasoning {
57
+ text: string;
58
+ afterCalls: number;
31
59
  }
32
60
  export interface ChatMessage {
33
61
  id: string;
@@ -36,9 +64,45 @@ export interface ChatMessage {
36
64
  toolCalls: ChatToolCall[];
37
65
  /** Rich blocks — receipts from tool results and model-authored blocks. */
38
66
  blocks: PlacedBlock[];
67
+ /** The model's reasoning, when the provider reports any. See ChatReasoning. */
68
+ reasoning?: ChatReasoning[];
69
+ /** Epoch ms the turn opened and closed — the answer's wall time. */
70
+ startedAt?: number;
71
+ endedAt?: number;
72
+ /** Tokens this ONE answer cost, across however many provider requests it took. */
73
+ usage?: {
74
+ input: number;
75
+ output: number;
76
+ requests: number;
77
+ };
39
78
  /** Set while the assistant is still streaming this message. */
40
79
  streaming?: boolean;
41
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;
42
106
  /**
43
107
  * True once a tool call has run and no narration has arrived since.
44
108
  *
@@ -57,11 +121,52 @@ export interface PendingApproval {
57
121
  label: string;
58
122
  description?: string;
59
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;
60
141
  resolve: (approved: boolean) => void;
61
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";
62
165
  export interface AskBuoyState {
63
166
  messages: ChatMessage[];
64
167
  busy: boolean;
168
+ /** Stop was pressed and the turn has not yet wound down. See TurnPhase. */
169
+ stopping: boolean;
65
170
  pending: PendingApproval | null;
66
171
  /** Set when the tool is unconfigured or the endpoint keeps failing. */
67
172
  notice: string | null;
@@ -73,14 +178,34 @@ export interface AskBuoyState {
73
178
  awaitingBlockId: string | null;
74
179
  /** Run state of block action buttons, keyed `${blockId}:${label}`. */
75
180
  actionState: Record<string, "running" | "done" | "failed">;
76
- /** A message typed while a turn was running; sent when the turn finishes. */
77
- 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;
78
188
  /** Session token totals, accumulated from provider usage reports. */
79
189
  usage: {
80
190
  input: number;
81
191
  output: number;
82
192
  requests: number;
83
193
  };
194
+ /**
195
+ * Which model, app and build this conversation happened against.
196
+ *
197
+ * Carried so an exported run identifies itself. A pasted trace with no model
198
+ * name is unusable a day later — "it did the wrong thing" and "gpt-4.1 did
199
+ * the wrong thing" are different bug reports.
200
+ */
201
+ meta: SessionMeta;
202
+ }
203
+ export interface SessionMeta {
204
+ model?: string;
205
+ protocol?: string;
206
+ appName?: string;
207
+ platform?: string;
208
+ build?: "development" | "release";
84
209
  }
85
210
  type Listener = () => void;
86
211
  export declare const askBuoyStore: {
@@ -95,11 +220,26 @@ export declare const askBuoyStore: {
95
220
  } | null;
96
221
  setNotice(notice: string | null): void;
97
222
  setConfigured(configured: boolean): void;
223
+ setMeta(meta: SessionMeta): void;
98
224
  addUser(text: string): void;
99
225
  /** Mark a turn as running without adding a bubble — the retry path. */
100
226
  beginTurn(): void;
101
- /** Park a message typed mid-turn instead of silently dropping it. */
102
- 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;
103
243
  /** Drop one message — the failed assistant bubble a retry replaces. */
104
244
  removeMessage(id: string): void;
105
245
  /** The user answered (or skipped) an Ask block. */
@@ -115,10 +255,68 @@ export declare const askBuoyStore: {
115
255
  * only form a non-developer can actually check.
116
256
  */
117
257
  applyEvent(messageId: string, ev: TurnEvent): void;
258
+ /** The user pressed Stop on this turn. See `ChatMessage.stopped`. */
259
+ markStopped(messageId: string): void;
118
260
  finishAssistant(messageId: string): void;
119
261
  askApproval(input: Omit<PendingApproval, "resolve">): Promise<boolean>;
120
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;
285
+ /**
286
+ * Put a saved conversation back, once, at open.
287
+ *
288
+ * Refuses if anything has been said already: a slow disk read landing after
289
+ * the user has started typing must not shove an old chat in front of them.
290
+ */
291
+ hydrate(input: {
292
+ messages: ChatMessage[];
293
+ answers: Record<string, BlockAnswer>;
294
+ usage: {
295
+ input: number;
296
+ output: number;
297
+ requests: number;
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[];
305
+ }): boolean;
121
306
  reset(): void;
122
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;
123
321
  export {};
124
322
  //# sourceMappingURL=askBuoyStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"askBuoyStore.d.ts","sourceRoot":"","sources":["../../../src/store/askBuoyStore.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,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;QAC3D;;;;WAIG;QACH,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;KAC1B,GAAG,OAAO;aAWF,IAAI;CAoBd,CAAC;AAEF,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,CAAC,EAAE,YAAY,GAAG,SAAS,CAKtD;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=restoredIds.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restoredIds.test.d.ts","sourceRoot":"","sources":["../../../src/store/restoredIds.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"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The agent's work for one answer, laid out in the order it happened.
3
+ *
4
+ * `traceEntries` is the ordering, shared by the collapsible strip in the chat
5
+ * and by the JSON export — the two must agree, because the point of the export
6
+ * is reading elsewhere the run you were just looking at. `traceToText` is the
7
+ * plain-text rendering, kept for a quick paste into Slack; the debugging
8
+ * artefact is `sessionExport.ts`.
9
+ *
10
+ * Reasoning and steps INTERLEAVE. One assistant bubble spans every turn of a
11
+ * multi-step run, so the real shape is "think, act, think, act"; lumping the
12
+ * thoughts at the top would misreport when the model knew what.
13
+ */
14
+ import type { ChatMessage, ChatToolCall } from "./askBuoyStore";
15
+ export type TraceEntry = {
16
+ kind: "thought";
17
+ text: string;
18
+ } | {
19
+ kind: "step";
20
+ n: number;
21
+ call: ChatToolCall;
22
+ };
23
+ export declare function traceEntries(message: ChatMessage): TraceEntry[];
24
+ /** Has this message anything to show? Drives whether the strip renders at all. */
25
+ export declare function hasTrace(message: ChatMessage): boolean;
26
+ /**
27
+ * The trace as plain text, for the clipboard.
28
+ *
29
+ * Indented under the answer it belongs to so a pasted session still reads as a
30
+ * conversation rather than a log dump.
31
+ */
32
+ export declare function traceToText(message: ChatMessage, indent?: string): string[];
33
+ //# sourceMappingURL=traceText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traceText.d.ts","sourceRoot":"","sources":["../../../src/store/traceText.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,WAAW,EAAiB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE/E,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC;AAEpD,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,UAAU,EAAE,CAoB/D;AAED,kFAAkF;AAClF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAEtD;AASD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAO,GAAG,MAAM,EAAE,CAezE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=traceText.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traceText.test.d.ts","sourceRoot":"","sources":["../../../src/store/traceText.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,79 @@
1
+ import type { AgentMessage, LedgerEntry } from "@buoy-gg/agent-core";
2
+ import type { ChatMessage, PendingApproval, QueuedMessage } from "./askBuoyStore";
3
+ /** `@react_buoy` prefix, so the Storage tool treats it as one of its own. */
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
+ }
24
+ export interface StoredTranscript {
25
+ v: number;
26
+ savedAt: number;
27
+ /** What the user sees. */
28
+ messages: ChatMessage[];
29
+ /** What the model remembers. */
30
+ history: AgentMessage[];
31
+ answers: Record<string, unknown>;
32
+ usage: {
33
+ input: number;
34
+ output: number;
35
+ requests: number;
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[];
54
+ }
55
+ /**
56
+ * Trim to the caps. Messages and history are trimmed together and from the
57
+ * same end, so what the user sees and what the model remembers stay the same
58
+ * conversation rather than drifting apart across restarts.
59
+ */
60
+ export declare function fitToCaps(payload: StoredTranscript): StoredTranscript;
61
+ export declare function buildPayload(input: {
62
+ messages: ChatMessage[];
63
+ history: AgentMessage[];
64
+ answers: Record<string, unknown>;
65
+ usage: {
66
+ input: number;
67
+ output: number;
68
+ requests: number;
69
+ };
70
+ pending?: PendingApproval | null;
71
+ ledger?: LedgerEntry[];
72
+ queued?: QueuedMessage[];
73
+ }): StoredTranscript;
74
+ /** Anything unparseable, or from an older shape, is treated as "no transcript". */
75
+ export declare function parsePayload(raw: string | null): StoredTranscript | null;
76
+ export declare function readTranscript(): Promise<StoredTranscript | null>;
77
+ export declare function writeTranscript(payload: StoredTranscript): Promise<void>;
78
+ export declare function clearTranscript(): Promise<void>;
79
+ //# sourceMappingURL=transcriptPersistence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transcriptPersistence.d.ts","sourceRoot":"","sources":["../../../src/store/transcriptPersistence.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAErE,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGlF,6EAA6E;AAC7E,eAAO,MAAM,cAAc,QAAoD,CAAC;AAyBhF;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,M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,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=transcriptPersistence.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transcriptPersistence.test.d.ts","sourceRoot":"","sources":["../../../src/store/transcriptPersistence.test.ts"],"names":[],"mappings":""}
@@ -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":""}