makersclaw 0.7.0 → 0.8.1

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 (419) hide show
  1. package/README.md +17 -4
  2. package/package.json +1 -1
  3. package/r/activity-log.json +52 -0
  4. package/r/agent-changes.json +51 -0
  5. package/r/agent-chat.json +53 -0
  6. package/r/agent-column.json +85 -0
  7. package/r/agent-dock.json +57 -0
  8. package/r/agent-kit.json +49 -0
  9. package/r/agent-marks.json +49 -0
  10. package/r/agent-pane.json +93 -0
  11. package/r/ai-action.json +56 -0
  12. package/r/annotate.json +4 -4
  13. package/r/approval-request.json +2 -2
  14. package/r/approval.json +54 -0
  15. package/r/ask-bar.json +50 -0
  16. package/r/audio-player.json +2 -2
  17. package/r/auth-form.json +2 -2
  18. package/r/automation-editor.json +66 -0
  19. package/r/automation-list.json +57 -0
  20. package/r/automation-model.json +118 -0
  21. package/r/automations-screen.json +71 -0
  22. package/r/board.json +2 -2
  23. package/r/calendar-view.json +3 -3
  24. package/r/cart.json +2 -2
  25. package/r/chart.json +5 -5
  26. package/r/chat-pane.json +84 -0
  27. package/r/chat.json +3 -3
  28. package/r/code-editor.json +2 -2
  29. package/r/comment-box.json +3 -3
  30. package/r/connect-card.json +51 -0
  31. package/r/contact-section.json +2 -2
  32. package/r/core.json +18 -6
  33. package/r/cost.json +51 -0
  34. package/r/csv-import.json +3 -3
  35. package/r/data-picker.json +60 -0
  36. package/r/data-table.json +2 -2
  37. package/r/diagram.json +2 -2
  38. package/r/doc-editor.json +2 -2
  39. package/r/doc-page.json +3 -3
  40. package/r/email-render.json +2 -2
  41. package/r/faq.json +2 -2
  42. package/r/file-upload.json +2 -2
  43. package/r/first-run.json +63 -0
  44. package/r/fix-note.json +57 -0
  45. package/r/flow-canvas.json +3 -3
  46. package/r/flow-editor.json +79 -0
  47. package/r/footer.json +3 -3
  48. package/r/gantt.json +3 -3
  49. package/r/job-panel.json +2 -2
  50. package/r/json-editor.json +3 -3
  51. package/r/library-shelf.json +56 -0
  52. package/r/map.json +2 -2
  53. package/r/margin-notes.json +67 -0
  54. package/r/menubar.json +2 -2
  55. package/r/mind-map.json +4 -4
  56. package/r/navigation-menu.json +2 -2
  57. package/r/needs-you.json +55 -0
  58. package/r/order-detail.json +2 -2
  59. package/r/org-chart.json +4 -4
  60. package/r/pace-bar.json +69 -0
  61. package/r/page-builder.json +3 -3
  62. package/r/payment-methods.json +2 -2
  63. package/r/pdf-document.json +2 -2
  64. package/r/pdf-viewer.json +3 -3
  65. package/r/product-detail.json +2 -2
  66. package/r/product-grid.json +3 -3
  67. package/r/record-form.json +2 -2
  68. package/r/record-grid.json +52 -0
  69. package/r/record-notes.json +4 -4
  70. package/r/registry.json +4089 -1510
  71. package/r/run-history.json +52 -0
  72. package/r/run-view.json +80 -0
  73. package/r/schedule-card.json +54 -0
  74. package/r/schedule-engine.json +79 -0
  75. package/r/schedule-gantt.json +83 -0
  76. package/r/schedule-ruler.json +64 -0
  77. package/r/search-dialog.json +2 -2
  78. package/r/settings-list.json +2 -2
  79. package/r/setup-checklist.json +2 -2
  80. package/r/share-dialog.json +2 -2
  81. package/r/sidebar.json +3 -3
  82. package/r/signature-pad.json +2 -2
  83. package/r/sketch-canvas.json +3 -3
  84. package/r/source-receipt.json +52 -0
  85. package/r/spreadsheet.json +3 -3
  86. package/r/stat-cards.json +3 -3
  87. package/r/step-picker.json +53 -0
  88. package/r/step-settings.json +72 -0
  89. package/r/suggestion.json +58 -0
  90. package/r/sum-bar.json +64 -0
  91. package/r/task-list.json +3 -3
  92. package/r/task-model.json +2 -2
  93. package/r/testimonials.json +2 -2
  94. package/r/tier-map.json +67 -0
  95. package/r/time-grid.json +73 -0
  96. package/r/time-strip.json +64 -0
  97. package/r/top-bar.json +66 -0
  98. package/r/transaction-list.json +2 -2
  99. package/r/trigger-picker.json +61 -0
  100. package/r/whiteboard.json +4 -4
  101. package/r/workflow-view.json +55 -0
  102. package/registry/blocks/activity-log/README.md +112 -0
  103. package/registry/blocks/activity-log/activity-log.jsx +351 -0
  104. package/registry/blocks/activity-log/block.json +33 -0
  105. package/registry/blocks/activity-log/demo.jsx +48 -0
  106. package/registry/blocks/activity-log/index.js +4 -0
  107. package/registry/blocks/agent-changes/README.md +94 -0
  108. package/registry/blocks/agent-changes/agent-changes.jsx +118 -0
  109. package/registry/blocks/agent-changes/block.json +28 -0
  110. package/registry/blocks/agent-changes/demo.jsx +39 -0
  111. package/registry/blocks/agent-changes/index.js +3 -0
  112. package/registry/blocks/agent-chat/README.md +145 -0
  113. package/registry/blocks/agent-chat/agent-chat.jsx +415 -0
  114. package/registry/blocks/agent-chat/block.json +30 -0
  115. package/registry/blocks/agent-chat/demo.jsx +165 -0
  116. package/registry/blocks/agent-chat/index.js +3 -0
  117. package/registry/blocks/agent-column/README.md +197 -0
  118. package/registry/blocks/agent-column/agent-column.jsx +492 -0
  119. package/registry/blocks/agent-column/block.json +67 -0
  120. package/registry/blocks/agent-column/column-picker.jsx +163 -0
  121. package/registry/blocks/agent-column/demo.jsx +50 -0
  122. package/registry/blocks/agent-column/index.js +7 -0
  123. package/registry/blocks/agent-column/model.js +164 -0
  124. package/registry/blocks/agent-column/receipt.jsx +483 -0
  125. package/registry/blocks/agent-column/spreadsheet-type.jsx +24 -0
  126. package/registry/blocks/agent-dock/README.md +210 -0
  127. package/registry/blocks/agent-dock/agent-dock.jsx +356 -0
  128. package/registry/blocks/agent-dock/block.json +47 -0
  129. package/registry/blocks/agent-dock/demo.jsx +153 -0
  130. package/registry/blocks/agent-dock/dock-model.js +118 -0
  131. package/registry/blocks/agent-dock/index.js +5 -0
  132. package/registry/blocks/agent-kit/README.md +73 -0
  133. package/registry/blocks/agent-kit/agent-kit.jsx +86 -0
  134. package/registry/blocks/agent-kit/block.json +10 -0
  135. package/registry/blocks/agent-kit/demo.jsx +35 -0
  136. package/registry/blocks/agent-kit/index.js +3 -0
  137. package/registry/blocks/agent-marks/README.md +80 -0
  138. package/registry/blocks/agent-marks/agent-marks.jsx +133 -0
  139. package/registry/blocks/agent-marks/block.json +27 -0
  140. package/registry/blocks/agent-marks/demo.jsx +49 -0
  141. package/registry/blocks/agent-marks/index.js +3 -0
  142. package/registry/blocks/agent-pane/README.md +225 -0
  143. package/registry/blocks/agent-pane/agent-pane.jsx +244 -0
  144. package/registry/blocks/agent-pane/block.json +41 -0
  145. package/registry/blocks/agent-pane/composer.jsx +6 -0
  146. package/registry/blocks/agent-pane/demo.jsx +233 -0
  147. package/registry/blocks/agent-pane/dock-context.js +10 -0
  148. package/registry/blocks/agent-pane/index.js +4 -0
  149. package/registry/blocks/agent-pane/prose.jsx +84 -0
  150. package/registry/blocks/agent-pane/questions.jsx +134 -0
  151. package/registry/blocks/agent-pane/transcript.jsx +268 -0
  152. package/registry/blocks/agent-pane/work.jsx +368 -0
  153. package/registry/blocks/ai-action/README.md +94 -0
  154. package/registry/blocks/ai-action/ai-action.jsx +188 -0
  155. package/registry/blocks/ai-action/block.json +34 -0
  156. package/registry/blocks/ai-action/demo.jsx +93 -0
  157. package/registry/blocks/ai-action/index.js +3 -0
  158. package/registry/blocks/annotate/README.md +14 -11
  159. package/registry/blocks/approval/README.md +145 -0
  160. package/registry/blocks/approval/approval.jsx +163 -0
  161. package/registry/blocks/approval/block.json +31 -0
  162. package/registry/blocks/approval/demo.jsx +121 -0
  163. package/registry/blocks/approval/index.js +3 -0
  164. package/registry/blocks/ask-bar/README.md +105 -0
  165. package/registry/blocks/ask-bar/ask-bar.jsx +166 -0
  166. package/registry/blocks/ask-bar/block.json +26 -0
  167. package/registry/blocks/ask-bar/demo.jsx +78 -0
  168. package/registry/blocks/ask-bar/index.js +3 -0
  169. package/registry/blocks/automation-editor/README.md +291 -0
  170. package/registry/blocks/automation-editor/automation-editor.jsx +656 -0
  171. package/registry/blocks/automation-editor/block.json +39 -0
  172. package/registry/blocks/automation-editor/demo.jsx +284 -0
  173. package/registry/blocks/automation-editor/index.js +4 -0
  174. package/registry/blocks/automation-editor/run-inputs.jsx +82 -0
  175. package/registry/blocks/automation-list/README.md +129 -0
  176. package/registry/blocks/automation-list/automation-list.jsx +476 -0
  177. package/registry/blocks/automation-list/block.json +35 -0
  178. package/registry/blocks/automation-list/demo.jsx +67 -0
  179. package/registry/blocks/automation-list/index.js +3 -0
  180. package/registry/blocks/automation-model/README.md +109 -0
  181. package/registry/blocks/automation-model/block.json +135 -0
  182. package/registry/blocks/automation-model/catalog.js +256 -0
  183. package/registry/blocks/automation-model/check.js +161 -0
  184. package/registry/blocks/automation-model/demo.jsx +42 -0
  185. package/registry/blocks/automation-model/edit.js +262 -0
  186. package/registry/blocks/automation-model/fixes.js +287 -0
  187. package/registry/blocks/automation-model/glyph.jsx +13 -0
  188. package/registry/blocks/automation-model/graph.js +410 -0
  189. package/registry/blocks/automation-model/index.js +33 -0
  190. package/registry/blocks/automation-model/overlay.js +175 -0
  191. package/registry/blocks/automation-model/parts.jsx +94 -0
  192. package/registry/blocks/automation-model/schedule.js +53 -0
  193. package/registry/blocks/automation-model/templates.js +128 -0
  194. package/registry/blocks/automation-model/values.js +29 -0
  195. package/registry/blocks/automation-model/words.js +439 -0
  196. package/registry/blocks/automations-screen/README.md +207 -0
  197. package/registry/blocks/automations-screen/automations-screen.jsx +452 -0
  198. package/registry/blocks/automations-screen/block.json +47 -0
  199. package/registry/blocks/automations-screen/demo.jsx +364 -0
  200. package/registry/blocks/automations-screen/index.js +4 -0
  201. package/registry/blocks/automations-screen/screen-model.js +129 -0
  202. package/registry/blocks/chart/cartesian.jsx +1 -1
  203. package/registry/blocks/chart/core.jsx +33 -23
  204. package/registry/blocks/chart/pie.jsx +1 -1
  205. package/registry/blocks/chat/README.md +4 -1
  206. package/registry/blocks/chat/demo.jsx +2 -2
  207. package/registry/blocks/chat-pane/README.md +143 -0
  208. package/registry/blocks/chat-pane/block.json +48 -0
  209. package/registry/blocks/chat-pane/chat-attach.js +166 -0
  210. package/registry/blocks/chat-pane/chat-composer.jsx +195 -0
  211. package/registry/blocks/chat-pane/chat-context.js +17 -0
  212. package/registry/blocks/chat-pane/chat-model.js +43 -0
  213. package/registry/blocks/chat-pane/chat-pane.jsx +398 -0
  214. package/registry/blocks/chat-pane/chats-list.jsx +52 -0
  215. package/registry/blocks/chat-pane/demo.jsx +103 -0
  216. package/registry/blocks/chat-pane/index.js +9 -0
  217. package/registry/blocks/connect-card/README.md +99 -0
  218. package/registry/blocks/connect-card/block.json +10 -0
  219. package/registry/blocks/connect-card/connect-card.jsx +103 -0
  220. package/registry/blocks/connect-card/demo.jsx +49 -0
  221. package/registry/blocks/connect-card/index.js +3 -0
  222. package/registry/blocks/cost/README.md +115 -0
  223. package/registry/blocks/cost/block.json +10 -0
  224. package/registry/blocks/cost/cost.jsx +176 -0
  225. package/registry/blocks/cost/demo.jsx +66 -0
  226. package/registry/blocks/cost/index.js +3 -0
  227. package/registry/blocks/data-picker/README.md +81 -0
  228. package/registry/blocks/data-picker/block.json +38 -0
  229. package/registry/blocks/data-picker/data-picker.jsx +210 -0
  230. package/registry/blocks/data-picker/demo.jsx +34 -0
  231. package/registry/blocks/data-picker/fields.js +89 -0
  232. package/registry/blocks/data-picker/index.js +4 -0
  233. package/registry/blocks/data-table/demo.jsx +1 -1
  234. package/registry/blocks/first-run/README.md +118 -0
  235. package/registry/blocks/first-run/block.json +11 -0
  236. package/registry/blocks/first-run/demo.jsx +88 -0
  237. package/registry/blocks/first-run/first-run-model.js +51 -0
  238. package/registry/blocks/first-run/first-run.jsx +156 -0
  239. package/registry/blocks/first-run/index.js +5 -0
  240. package/registry/blocks/first-run/probe-rules.js +26 -0
  241. package/registry/blocks/fix-note/README.md +79 -0
  242. package/registry/blocks/fix-note/block.json +35 -0
  243. package/registry/blocks/fix-note/demo.jsx +30 -0
  244. package/registry/blocks/fix-note/fix-note.jsx +235 -0
  245. package/registry/blocks/fix-note/index.js +3 -0
  246. package/registry/blocks/flow-canvas/README.md +15 -8
  247. package/registry/blocks/flow-editor/README.md +108 -0
  248. package/registry/blocks/flow-editor/block.json +44 -0
  249. package/registry/blocks/flow-editor/demo.jsx +115 -0
  250. package/registry/blocks/flow-editor/flow-canvas.jsx +568 -0
  251. package/registry/blocks/flow-editor/flow-editor.jsx +154 -0
  252. package/registry/blocks/flow-editor/index.js +6 -0
  253. package/registry/blocks/flow-editor/minimap.jsx +78 -0
  254. package/registry/blocks/flow-editor/outline.jsx +134 -0
  255. package/registry/blocks/footer/README.md +3 -2
  256. package/registry/blocks/library-shelf/README.md +117 -0
  257. package/registry/blocks/library-shelf/block.json +28 -0
  258. package/registry/blocks/library-shelf/demo.jsx +68 -0
  259. package/registry/blocks/library-shelf/index.js +3 -0
  260. package/registry/blocks/library-shelf/library-shelf.jsx +211 -0
  261. package/registry/blocks/library-shelf/probe-rules.js +15 -0
  262. package/registry/blocks/margin-notes/README.md +222 -0
  263. package/registry/blocks/margin-notes/block.json +10 -0
  264. package/registry/blocks/margin-notes/demo.jsx +144 -0
  265. package/registry/blocks/margin-notes/index.js +20 -0
  266. package/registry/blocks/margin-notes/margin-model.js +224 -0
  267. package/registry/blocks/margin-notes/margin-notes.jsx +465 -0
  268. package/registry/blocks/mind-map/README.md +4 -2
  269. package/registry/blocks/needs-you/README.md +177 -0
  270. package/registry/blocks/needs-you/block.json +34 -0
  271. package/registry/blocks/needs-you/demo.jsx +143 -0
  272. package/registry/blocks/needs-you/index.js +3 -0
  273. package/registry/blocks/needs-you/needs-you.jsx +441 -0
  274. package/registry/blocks/org-chart/README.md +4 -2
  275. package/registry/blocks/pace-bar/README.md +230 -0
  276. package/registry/blocks/pace-bar/block.json +10 -0
  277. package/registry/blocks/pace-bar/demo.jsx +255 -0
  278. package/registry/blocks/pace-bar/index.js +22 -0
  279. package/registry/blocks/pace-bar/pace-bar.jsx +461 -0
  280. package/registry/blocks/pace-bar/pace-model.js +288 -0
  281. package/registry/blocks/page-builder/README.md +1 -1
  282. package/registry/blocks/page-builder/demo.jsx +3 -3
  283. package/registry/blocks/pdf-viewer/README.md +4 -1
  284. package/registry/blocks/record-grid/README.md +100 -0
  285. package/registry/blocks/record-grid/block.json +28 -0
  286. package/registry/blocks/record-grid/demo.jsx +43 -0
  287. package/registry/blocks/record-grid/index.js +3 -0
  288. package/registry/blocks/record-grid/record-grid.jsx +251 -0
  289. package/registry/blocks/run-history/README.md +138 -0
  290. package/registry/blocks/run-history/block.json +10 -0
  291. package/registry/blocks/run-history/demo.jsx +74 -0
  292. package/registry/blocks/run-history/index.js +3 -0
  293. package/registry/blocks/run-history/run-history.jsx +218 -0
  294. package/registry/blocks/run-view/README.md +174 -0
  295. package/registry/blocks/run-view/block.json +50 -0
  296. package/registry/blocks/run-view/demo.jsx +286 -0
  297. package/registry/blocks/run-view/index.js +5 -0
  298. package/registry/blocks/run-view/run-controls.jsx +266 -0
  299. package/registry/blocks/run-view/run-view.jsx +236 -0
  300. package/registry/blocks/run-view/runs-list.jsx +99 -0
  301. package/registry/blocks/schedule-card/README.md +121 -0
  302. package/registry/blocks/schedule-card/block.json +10 -0
  303. package/registry/blocks/schedule-card/demo.jsx +82 -0
  304. package/registry/blocks/schedule-card/index.js +3 -0
  305. package/registry/blocks/schedule-card/schedule-card.jsx +136 -0
  306. package/registry/blocks/schedule-engine/README.md +137 -0
  307. package/registry/blocks/schedule-engine/block.json +10 -0
  308. package/registry/blocks/schedule-engine/demo.jsx +82 -0
  309. package/registry/blocks/schedule-engine/engine.js +769 -0
  310. package/registry/blocks/schedule-engine/index.js +9 -0
  311. package/registry/blocks/schedule-engine/ops.js +71 -0
  312. package/registry/blocks/schedule-engine/place.js +294 -0
  313. package/registry/blocks/schedule-engine/tree.js +79 -0
  314. package/registry/blocks/schedule-engine/waits.js +80 -0
  315. package/registry/blocks/schedule-gantt/README.md +159 -0
  316. package/registry/blocks/schedule-gantt/block.json +10 -0
  317. package/registry/blocks/schedule-gantt/demo.jsx +223 -0
  318. package/registry/blocks/schedule-gantt/gantt-model.js +219 -0
  319. package/registry/blocks/schedule-gantt/geometry.js +176 -0
  320. package/registry/blocks/schedule-gantt/index.js +26 -0
  321. package/registry/blocks/schedule-gantt/schedule-gantt.jsx +882 -0
  322. package/registry/blocks/schedule-gantt/sheet.jsx +372 -0
  323. package/registry/blocks/schedule-gantt/track.jsx +190 -0
  324. package/registry/blocks/schedule-ruler/README.md +148 -0
  325. package/registry/blocks/schedule-ruler/block.json +10 -0
  326. package/registry/blocks/schedule-ruler/demo.jsx +181 -0
  327. package/registry/blocks/schedule-ruler/index.js +21 -0
  328. package/registry/blocks/schedule-ruler/ruler-model.js +239 -0
  329. package/registry/blocks/schedule-ruler/schedule-ruler.jsx +548 -0
  330. package/registry/blocks/sidebar/README.md +23 -13
  331. package/registry/blocks/sketch-canvas/README.md +15 -9
  332. package/registry/blocks/source-receipt/README.md +97 -0
  333. package/registry/blocks/source-receipt/block.json +30 -0
  334. package/registry/blocks/source-receipt/demo.jsx +71 -0
  335. package/registry/blocks/source-receipt/index.js +3 -0
  336. package/registry/blocks/source-receipt/source-receipt.jsx +107 -0
  337. package/registry/blocks/spreadsheet/spreadsheet.jsx +15 -1
  338. package/registry/blocks/step-picker/README.md +78 -0
  339. package/registry/blocks/step-picker/block.json +31 -0
  340. package/registry/blocks/step-picker/demo.jsx +23 -0
  341. package/registry/blocks/step-picker/index.js +3 -0
  342. package/registry/blocks/step-picker/step-picker.jsx +144 -0
  343. package/registry/blocks/step-settings/README.md +100 -0
  344. package/registry/blocks/step-settings/block.json +44 -0
  345. package/registry/blocks/step-settings/demo.jsx +93 -0
  346. package/registry/blocks/step-settings/fields.jsx +58 -0
  347. package/registry/blocks/step-settings/flow-settings.jsx +115 -0
  348. package/registry/blocks/step-settings/index.js +5 -0
  349. package/registry/blocks/step-settings/step-settings.jsx +290 -0
  350. package/registry/blocks/suggestion/README.md +171 -0
  351. package/registry/blocks/suggestion/block.json +40 -0
  352. package/registry/blocks/suggestion/demo.jsx +91 -0
  353. package/registry/blocks/suggestion/index.js +3 -0
  354. package/registry/blocks/suggestion/suggestion.jsx +436 -0
  355. package/registry/blocks/sum-bar/README.md +122 -0
  356. package/registry/blocks/sum-bar/block.json +10 -0
  357. package/registry/blocks/sum-bar/demo.jsx +110 -0
  358. package/registry/blocks/sum-bar/index.js +5 -0
  359. package/registry/blocks/sum-bar/sum-bar.jsx +209 -0
  360. package/registry/blocks/sum-bar/sum-model.js +126 -0
  361. package/registry/blocks/tier-map/README.md +217 -0
  362. package/registry/blocks/tier-map/block.json +10 -0
  363. package/registry/blocks/tier-map/demo.jsx +222 -0
  364. package/registry/blocks/tier-map/index.js +24 -0
  365. package/registry/blocks/tier-map/tier-map.jsx +574 -0
  366. package/registry/blocks/tier-map/tier-model.js +318 -0
  367. package/registry/blocks/time-grid/README.md +305 -0
  368. package/registry/blocks/time-grid/block.json +10 -0
  369. package/registry/blocks/time-grid/demo.jsx +279 -0
  370. package/registry/blocks/time-grid/grid-model.js +322 -0
  371. package/registry/blocks/time-grid/index.js +25 -0
  372. package/registry/blocks/time-grid/time-grid.jsx +1325 -0
  373. package/registry/blocks/time-strip/README.md +141 -0
  374. package/registry/blocks/time-strip/block.json +10 -0
  375. package/registry/blocks/time-strip/demo.jsx +129 -0
  376. package/registry/blocks/time-strip/index.js +19 -0
  377. package/registry/blocks/time-strip/strip-model.js +178 -0
  378. package/registry/blocks/time-strip/time-strip.jsx +260 -0
  379. package/registry/blocks/top-bar/README.md +149 -0
  380. package/registry/blocks/top-bar/block.json +35 -0
  381. package/registry/blocks/top-bar/demo.jsx +78 -0
  382. package/registry/blocks/top-bar/index.js +5 -0
  383. package/registry/blocks/top-bar/probe-rules.js +74 -0
  384. package/registry/blocks/top-bar/top-bar-model.js +152 -0
  385. package/registry/blocks/top-bar/top-bar.jsx +244 -0
  386. package/registry/blocks/trigger-picker/README.md +98 -0
  387. package/registry/blocks/trigger-picker/block.json +38 -0
  388. package/registry/blocks/trigger-picker/demo.jsx +59 -0
  389. package/registry/blocks/trigger-picker/index.js +3 -0
  390. package/registry/blocks/trigger-picker/trigger-picker.jsx +374 -0
  391. package/registry/blocks/whiteboard/README.md +20 -14
  392. package/registry/blocks/workflow-view/README.md +123 -0
  393. package/registry/blocks/workflow-view/block.json +10 -0
  394. package/registry/blocks/workflow-view/demo.jsx +90 -0
  395. package/registry/blocks/workflow-view/index.js +3 -0
  396. package/registry/blocks/workflow-view/workflow-view.jsx +203 -0
  397. package/src/cli.mjs +2 -2
  398. package/src/install.mjs +100 -22
  399. package/src/registry.mjs +37 -3
  400. package/templates/next/browser/lib/data.js +6 -1
  401. package/templates/next/files/README.md +909 -26
  402. package/templates/next/files/app/shell.jsx +54 -37
  403. package/templates/next/files/check/automation-format.ts +2103 -0
  404. package/templates/next/files/check/automation-package.ts +142 -0
  405. package/templates/next/files/check/run.mjs +1043 -12
  406. package/templates/next/files/components/ui/field.jsx +17 -4
  407. package/templates/next/files/components/ui/icon.jsx +13 -0
  408. package/templates/next/files/components/ui/index.js +3 -1
  409. package/templates/next/files/components/ui/layout.jsx +382 -0
  410. package/templates/next/files/components/ui/notice.jsx +70 -0
  411. package/templates/next/files/components/ui/page.jsx +124 -0
  412. package/templates/next/files/components/ui/stat.jsx +22 -7
  413. package/templates/next/files/components/ui/toast.jsx +6 -3
  414. package/templates/next/files/lib/automations.js +660 -0
  415. package/templates/next/files/lib/claw.js +244 -5
  416. package/templates/next/files/lib/door.js +92 -0
  417. package/templates/next/files/lib/hooks.js +1694 -6
  418. package/templates/next/files/lib/platform.js +611 -14
  419. package/templates/next/template.json +22 -3
@@ -0,0 +1,244 @@
1
+ "use client";
2
+
3
+ import { Button, Icon, Notice, Spinner, cx } from "../../ui";
4
+ import { ChatPane } from "../chat-pane";
5
+ import { QuestionBox } from "../needs-you";
6
+ import { Prose } from "./prose";
7
+ import { QuestionForm } from "./questions";
8
+ import { MemberWords, Message } from "./transcript";
9
+
10
+ // AgentPane — the desk's agent sidebar, as the app's own pane (0.8.1, D27;
11
+ // docs/AGENT-BLOCK-PLAN.md). The founder: "the inapp component is not on
12
+ // par with the desk agent sidebar, in terms of tool calls, questions,
13
+ // showing information". So this is the sidebar, drawn in the app's theme:
14
+ // the member's words, the agent's text as it is written, the plan, the
15
+ // work folded into "Worked through N steps" (each step opening to its
16
+ // facts and what came back), helpers, several questions as one form, the
17
+ // one ask's yes as the `approval` block's press, what it made, the past
18
+ // chats and New chat, Stop.
19
+ //
20
+ // const chat = useAgentPane({ row: { kind: "person", id, name } });
21
+ // <AgentPane chat={chat} title={`Ask about ${name}`} suggestions={[…]} />
22
+ //
23
+ // It draws the object useAgentPane() returns (lib/hooks.js) and decides
24
+ // nothing: which lines there are and what they say is the platform's (the
25
+ // same rules the sidebar runs), sent as data. It is the SAME conversation
26
+ // the desk's sidebar shows: one session, two views. An app that places it
27
+ // says so in its package (`"agent_pane": true` in the blueprint), and the
28
+ // desk then draws no sidebar for the app's window.
29
+ //
30
+ // The frame around the lines (the head with New chat and Chats, the empty
31
+ // state, the scroll, the desk's composer with + and the round send, a
32
+ // starting line from the dock) is the `chat-pane` block (X5); this file is
33
+ // what the AGENT puts in it: the lines above, and the bar of what waits.
34
+ //
35
+ // What waits on the member is settled here, where it was asked. The
36
+ // agent's QUESTIONS are answered in place (`chat.answer`); its YES is the
37
+ // `approval` block's press frame, handed in as `yes` — this pane never
38
+ // draws an Approve of its own. A sign-in, money, or a tool approval says
39
+ // so and opens the desk.
40
+
41
+ const STATE_LINE = {
42
+ queued: "Queued — it starts when the one before it ends",
43
+ working: "Working on it",
44
+ };
45
+
46
+ /** What waits on the member, as the bar under the thread says it. */
47
+ function needsTitle(kind, inApp) {
48
+ if (kind === "yes" || kind === "approval") return inApp === "press" ? "Waiting for your yes" : "Waiting for your yes on the desk";
49
+ if (kind === "question") return inApp === "answer" ? "A question for you" : "Waiting for your answer on the desk";
50
+ if (kind === "connect") return "Waiting for you to connect an account on the desk";
51
+ if (kind === "limit") return "Paused for credits — see the desk";
52
+ return "Needs you on the desk";
53
+ }
54
+
55
+ /** A claw from before the sidebar's view sends only the small turns: the
56
+ * member's words, the agent's text, one line per step. Drawn plainly. */
57
+ function LegacyTurn({ turn }) {
58
+ return (
59
+ <div className="grid min-w-0 gap-2">
60
+ {turn.member ? <MemberWords>{turn.member}</MemberWords> : null}
61
+ {(turn.parts ?? []).map((p, i) =>
62
+ p.type === "step" ? (
63
+ <p key={i} className="flex min-w-0 items-center gap-2 text-xs text-muted-foreground">
64
+ {p.status === "running" ? <Spinner size="sm" label="Working" /> : <Icon name={p.status === "failed" ? "warning" : "check"} size={12} className="shrink-0" />}
65
+ <span className="min-w-0 truncate">{p.label}</span>
66
+ </p>
67
+ ) : p.text?.trim() ? (
68
+ <Prose key={i} text={p.text} />
69
+ ) : null,
70
+ )}
71
+ {turn.writing ? <Prose text={`${turn.writing}▍`} /> : null}
72
+ </div>
73
+ );
74
+ }
75
+
76
+ /**
77
+ * chat what useAgentPane() returns (required)
78
+ * title the head's words ("Ask about Pinewood"); default "Ask the agent"
79
+ * suggestions asks that fit the moment, shown before the first ask
80
+ * empty one line before the first ask
81
+ * placeholder the box's words
82
+ * hint a quiet line under the box
83
+ * yes a node drawn in the needs slot when the agent waits on a
84
+ * yes the app can take (`chat.needs.in_app === "press"`):
85
+ * the `approval` block, fed by useApproval(chat.request.id).
86
+ * Without it that yes opens the desk
87
+ * mark a node before the agent's turns (the app's mark), or none
88
+ * onOpen ({ kind: "app", id } | { kind: "file", path, where, appRef })
89
+ * the "Open" of something it made. Default: `chat.open`
90
+ * (the desk opens it); with neither there is no Open
91
+ * onClose a close in the head (a panel beside a record). Inside an
92
+ * AgentDock it is the dock's own, unless this is given
93
+ * recent past chats listed before the first ask (default 5; 0
94
+ * draws none)
95
+ * bare no head (inside a Sheet or a Card that has its own)
96
+ * fill take the height of its container (default). false: a
97
+ * compact pane whose thread scrolls inside a capped height
98
+ * className layout around it. Never colour.
99
+ */
100
+ export function AgentPane({
101
+ chat,
102
+ title = "Ask the agent",
103
+ suggestions = [],
104
+ empty,
105
+ placeholder,
106
+ hint,
107
+ yes,
108
+ mark,
109
+ onOpen,
110
+ onClose,
111
+ recent = 5,
112
+ bare = false,
113
+ fill = true,
114
+ className,
115
+ }) {
116
+ const view = chat?.view ?? null;
117
+ const legacy = !view ? (chat?.turns ?? []) : [];
118
+ const messages = view?.messages ?? [];
119
+ const pending = chat?.pending && !messages.some((m) => m.role === "user" && m.text === chat.pending) && !legacy.some((t) => t.member === chat.pending) ? chat.pending : null;
120
+ const needs = chat?.state === "needs_you" ? (chat.needs ?? { kind: "other", text: "" }) : null;
121
+ const live = chat?.state === "working" || chat?.state === "queued" || Boolean(pending);
122
+ const started = messages.length > 0 || legacy.length > 0 || Boolean(pending);
123
+ const inMakersclaw = chat?.place === "makersclaw";
124
+ const questions = view?.questions ?? [];
125
+ const result = chat?.request?.status === "done" ? chat.request?.result?.sentence : null;
126
+ // The thinking row: the turn runs and nothing visibly grows yet (the
127
+ // platform says when, in the view); words just sent wait for their turn.
128
+ const lastLegacy = legacy[legacy.length - 1];
129
+ const starting = Boolean(pending) && !messages.some((m) => m.role === "assistant" && m.live);
130
+ const thinking =
131
+ !needs && !inMakersclaw && (pending ? true : view ? view.thinking : live && !(lastLegacy?.writing || lastLegacy?.parts?.length));
132
+
133
+ const openThing = onOpen ?? (typeof chat?.open === "function" ? chat.open : undefined);
134
+ const answerHere = needs?.in_app === "answer" && typeof chat?.answer === "function";
135
+ const pressHere = needs?.in_app === "press" && yes != null && yes !== false;
136
+ const blocked = Boolean(needs) || inMakersclaw;
137
+ const closedWords = needs ? (answerHere ? "Answer above first" : pressHere ? "Say yes above first" : "Answer on the desk first") : "This ask is in Makersclaw";
138
+
139
+ // What sits between the lines and the box: what waits on the member, or
140
+ // that the agent works (its Stop is the box's, in the arrow's place), or
141
+ // how the ask ended.
142
+ const bar =
143
+ needs && pressHere ? (
144
+ <div className="max-h-[70%] shrink-0 overflow-y-auto border-t border-border p-2.5">{yes}</div>
145
+ ) : needs ? (
146
+ <div className="max-h-[70%] shrink-0 overflow-y-auto border-t border-border p-2.5">
147
+ <div className="grid min-w-0 gap-2 rounded-[var(--radius)] border border-warning p-2.5">
148
+ <div className="flex min-w-0 items-start gap-2">
149
+ <Icon name="warning" size={16} className="mt-px shrink-0 text-warning" />
150
+ <div className="grid min-w-0 gap-0.5">
151
+ <span className="font-medium">
152
+ {answerHere && questions.length > 1 ? `${questions.length} questions for you` : needsTitle(needs.kind, answerHere ? "answer" : needs.in_app)}
153
+ </span>
154
+ {needs.text && !(answerHere && questions.length > 0) ? (
155
+ <span className={cx("break-words text-muted-foreground", !answerHere && "line-clamp-3")}>{needs.text}</span>
156
+ ) : null}
157
+ </div>
158
+ </div>
159
+ {answerHere && questions.length > 0 ? (
160
+ <QuestionForm key={needs.at ?? "q"} questions={questions} onSubmit={(answers) => chat.answer({ answers })} />
161
+ ) : answerHere ? (
162
+ <QuestionBox key={needs.at ?? "q"} options={needs.options ?? []} free={needs.free} onAnswer={(payload) => chat.answer(payload)} />
163
+ ) : (
164
+ <Button size="sm" variant="primary" className="justify-self-start" onClick={() => chat.openOnDesk?.()}>
165
+ Open on the desk <Icon name="external" size={12} />
166
+ </Button>
167
+ )}
168
+ </div>
169
+ </div>
170
+ ) : live && !inMakersclaw ? (
171
+ <div className="flex shrink-0 items-center gap-2 border-t border-border px-3.5 py-1.5 text-xs text-muted-foreground">
172
+ <Spinner size="sm" label="Working" />
173
+ <span className="min-w-0 flex-1 truncate">{STATE_LINE[chat?.state] ?? STATE_LINE.working}</span>
174
+ </div>
175
+ ) : result ? (
176
+ <p className="flex shrink-0 items-start gap-2 border-t border-border px-3.5 py-1.5 text-xs text-muted-foreground">
177
+ <Icon name="circle-check" size={14} className="mt-px shrink-0 text-success" />
178
+ <span className="min-w-0 break-words">{result}</span>
179
+ </p>
180
+ ) : null;
181
+
182
+ return (
183
+ <ChatPane
184
+ chat={chat}
185
+ title={title}
186
+ suggestions={suggestions}
187
+ empty={empty}
188
+ placeholder={placeholder}
189
+ closedWords={closedWords}
190
+ hint={hint}
191
+ recent={recent}
192
+ bare={bare}
193
+ fill={fill}
194
+ onClose={onClose}
195
+ started={started || inMakersclaw}
196
+ busy={live && !inMakersclaw}
197
+ blocked={blocked}
198
+ bar={bar}
199
+ className={className}
200
+ >
201
+ {inMakersclaw ? (
202
+ <Notice
203
+ tone="info"
204
+ title="This ask is in Makersclaw"
205
+ action={
206
+ <Button size="sm" variant="secondary" onClick={() => chat.openOnDesk?.()}>
207
+ Open <Icon name="external" size={12} />
208
+ </Button>
209
+ }
210
+ >
211
+ {chat.request?.title ?? "It is followed there."}
212
+ </Notice>
213
+ ) : (
214
+ <>
215
+ {messages.map((m) => (
216
+ <Message key={m.id} message={m} load={chat.callDetail} onOpen={openThing} onOpenRequest={chat.openRequest} mark={mark} />
217
+ ))}
218
+ {legacy.map((t) => (
219
+ <LegacyTurn key={t.id} turn={t} />
220
+ ))}
221
+ {pending ? <MemberWords>{pending}</MemberWords> : null}
222
+ {thinking ? (
223
+ <div role="status" className="flex items-center gap-2 text-xs text-muted-foreground">
224
+ <Spinner size="sm" label="Thinking" /> {starting ? "Starting…" : "Thinking…"}
225
+ </div>
226
+ ) : null}
227
+ {!live && view?.failure ? (
228
+ <p role="alert" className="text-xs text-destructive">
229
+ {view.failure.kind === "stopped" ? (
230
+ <>
231
+ <b>You stopped it.</b> <span className="text-muted-foreground">Send a message to carry on.</span>
232
+ </>
233
+ ) : (
234
+ <>
235
+ <b>It stopped before finishing.</b> {view.failure.words} <span className="text-muted-foreground">Send a message to carry on.</span>
236
+ </>
237
+ )}
238
+ </p>
239
+ ) : null}
240
+ </>
241
+ )}
242
+ </ChatPane>
243
+ );
244
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "agent-pane",
3
+ "title": "AgentPane",
4
+ "description": "The desk's agent sidebar, as the app's own pane, in the app's theme (D27): the member's words, the agent's text as it is written, the plan, the work folded into \"Worked through N steps\" with each step opening to its facts and what came back, reads folded, retries a later call fixed, helpers, the agent's questions as one form, the one ask's yes as the `approval` block's press, what it made, the past chats with a dot on those that need you, New chat and Stop; and the desk's message box (the chat-pane block's: the words on top, + to attach and a round send under them, a stop in its place while a turn runs), files to send with the words and dictation in the box; a tool's yes pressed in place; the thread streamed as the agent writes; Open under an app or file it made. It draws what useAgentPane() returns (lib/hooks.js): the same conversation and the same rules the desk's sidebar runs, one session, two views. The app places it and chooses where; the platform supplies what it shows.",
5
+ "useWhen": "The app should hold its conversation with its agent at the level of the desk's sidebar: an Ask panel beside a record, a sheet behind an Ask button, an inspector on a home screen. It replaces agent-chat. Place it and set \"agent_pane\": true in the package's blueprint, so the desk draws no sidebar for the app's window. For work the founder commissions from a verb and watches land, use job-panel.",
6
+ "tags": [
7
+ "chat",
8
+ "ask",
9
+ "assistant",
10
+ "conversation",
11
+ "thread",
12
+ "sidebar",
13
+ "tool calls",
14
+ "steps",
15
+ "plan",
16
+ "questions",
17
+ "stop",
18
+ "ai",
19
+ "copilot",
20
+ "inspector",
21
+ "record"
22
+ ],
23
+ "exports": [
24
+ "AgentPane",
25
+ "AgentDockContext"
26
+ ],
27
+ "files": [
28
+ "index.js",
29
+ "dock-context.js",
30
+ "agent-pane.jsx",
31
+ "transcript.jsx",
32
+ "work.jsx",
33
+ "prose.jsx",
34
+ "questions.jsx",
35
+ "composer.jsx"
36
+ ],
37
+ "requires": [
38
+ "needs-you",
39
+ "chat-pane"
40
+ ]
41
+ }
@@ -0,0 +1,6 @@
1
+ "use client";
2
+
3
+ // The pane's composer parts — files to send with the words, and dictation —
4
+ // are the chat-pane block's now (X5): the composer is the desk's box, and
5
+ // this file keeps the names agent-pane has always exported.
6
+ export { MAX_BYTES, MAX_FILES, addFiles, filesFromTransfer, formatBytes, readFile, useDictation } from "../chat-pane";
@@ -0,0 +1,233 @@
1
+ "use client";
2
+
3
+ // AgentPane driven by a pretend thread — the gallery's and the smoke test's
4
+ // surface. Not installed into apps. The left pane opens on a finished turn
5
+ // that shows what the desk's sidebar shows: a plan, the work folded into
6
+ // one line (open it: reads folded, a failure a later step fixed, a search),
7
+ // a step that opens to its facts, a helpers card, an app it made. The
8
+ // right pane is live: ask anything and it works a few steps and writes;
9
+ // "questions" stops on a form of two questions; "send them" stops for a
10
+ // yes. Chats lists two past chats; New chat clears this one.
11
+ import { useEffect, useRef, useState } from "react";
12
+ import { AgentPane } from "../components/blocks/agent-pane";
13
+
14
+ const call = (id, tag, line, status = "done", extra = {}) => ({ kind: "call", id, tag, line, status, reason: null, saysFailure: false, openRequest: null, ...extra });
15
+
16
+ const FINISHED = {
17
+ messages: [
18
+ { id: "m1", role: "user", text: "Find restaurant groups in New England with 10 or more sites and add them to a list.", files: [] },
19
+ {
20
+ id: "m2",
21
+ role: "assistant",
22
+ live: false,
23
+ blocks: [
24
+ { kind: "text", key: "t0", text: "On it. Here is the plan.", streaming: false },
25
+ {
26
+ kind: "plan",
27
+ key: "plan",
28
+ items: [
29
+ { text: "Find the groups", state: "done" },
30
+ { text: "Check their site counts", state: "done" },
31
+ { text: "Add them to a list", state: "done" },
32
+ ],
33
+ },
34
+ {
35
+ kind: "work",
36
+ key: "w0",
37
+ runs: [
38
+ {
39
+ kind: "fold",
40
+ id: "fold-1",
41
+ summary: { steps: 9, failed: 0, running: false, stopped: false, latest: "Added 14 people to the list" },
42
+ rows: [
43
+ { kind: "reads", id: "reads-1", tag: "READ", label: "Read 3 files", status: "done", calls: [call("r1", "FILES", "Read story.md"), call("r2", "FILES", "Read lists.md"), call("r3", "FILES", "Read people.md")] },
44
+ call("s1", "WEB", "Searched the web for “restaurant groups New England 10+ sites”"),
45
+ { kind: "fixed", id: "fixed-1", fixes: [{ id: "f1", what: "Couldn’t read the old list", reason: "that file isn’t there", then: "worked after a change" }] },
46
+ { kind: "repeat", id: "rep-1", tag: "DATA", line: "Checked a group’s site count", count: 5, status: "done", reason: null, saysFailure: false, calls: [call("c1", "DATA", "Checked a group’s site count"), call("c2", "DATA", "Checked a group’s site count")] },
47
+ call("a1", "DATA", "Added 14 people to the list"),
48
+ ],
49
+ },
50
+ ],
51
+ },
52
+ { kind: "text", key: "t1", text: "Done. I added **14 groups** with 10 or more sites to the list *New England groups*:\n\n- Tavolo Hospitality — 22 sites\n- Harbor & Co — 15 sites\n- Pine Street Group — 11 sites\n\nWant me to find who to write to at each?", streaming: false },
53
+ { kind: "receipt", key: "rc", decision: "answered", text: "New England", prompt: "Which region first?", requestId: "q0" },
54
+ { kind: "made", key: "made", apps: [], files: [{ path: "reports/new-england.csv", name: "new-england.csv", kind: "CSV", meta: "14 rows", where: "workspace", appRef: null, url: null }] },
55
+ ],
56
+ },
57
+ ],
58
+ thinking: false,
59
+ failure: null,
60
+ questions: [],
61
+ };
62
+
63
+ const DETAIL = {
64
+ s1: { id: "s1", line: "Searched the web", status: "done", reason: null, said: null, facts: [{ label: "Searched for", value: "restaurant groups New England 10+ sites" }, { label: "Results", value: "8 pages" }], code: null, result: "Tavolo Hospitality — 22 sites\nHarbor & Co — 15 sites\nPine Street Group — 11 sites" },
65
+ r1: { id: "r1", line: "Read story.md", status: "done", reason: null, said: null, facts: [{ label: "File", value: "story.md" }, { label: "Size", value: "2 KB" }], code: null, result: null },
66
+ a1: { id: "a1", line: "Added 14 people to the list", status: "done", reason: null, said: null, facts: [{ label: "List", value: "New England groups" }], code: { label: "Statement", text: "add 14 people to the list New England groups, one row each" }, result: "14 rows written" },
67
+ };
68
+ const load = (id) => new Promise((resolve) => setTimeout(() => resolve({ ok: true, data: { ok: true, call: DETAIL[id] ?? { id, line: "", status: "done", reason: null, said: null, facts: [], code: null, result: null } } }), 350));
69
+
70
+ const CHATS = {
71
+ items: [
72
+ { sessionId: "past-1", requestId: "q1", title: "Reach 50 investors", mark: "needs", at: new Date(Date.now() - 20 * 60 * 1000).toISOString() },
73
+ { sessionId: "past-2", requestId: "q2", title: "Weekly pipeline read", mark: null, at: new Date(Date.now() - 3 * 3600 * 1000).toISOString() },
74
+ ],
75
+ loading: false,
76
+ error: null,
77
+ unavailable: false,
78
+ };
79
+
80
+ function usePretendPane() {
81
+ const [view, setView] = useState({ messages: [], thinking: false, failure: null, questions: [] });
82
+ const [state, setState] = useState(null);
83
+ const [needs, setNeeds] = useState(null);
84
+ const timers = useRef([]);
85
+ useEffect(() => () => timers.current.forEach(clearTimeout), []);
86
+ const later = (ms, fn) => timers.current.push(setTimeout(fn, ms));
87
+ const patchLast = (fn) => setView((v) => ({ ...v, messages: v.messages.map((m, i) => (i === v.messages.length - 1 ? fn(m) : m)) }));
88
+
89
+ const send = (text) => {
90
+ const id = `m${Date.now()}`;
91
+ setState("working");
92
+ setNeeds(null);
93
+ setView((v) => ({
94
+ ...v,
95
+ thinking: true,
96
+ messages: [...v.messages, { id: `${id}u`, role: "user", text, files: [] }],
97
+ }));
98
+ const work = (rows, summary) => ({ kind: "work", key: "w", runs: [{ kind: "fold", id: "f", summary, rows }] });
99
+ later(500, () =>
100
+ setView((v) => ({
101
+ ...v,
102
+ thinking: false,
103
+ messages: [...v.messages, { id: `${id}a`, role: "assistant", live: true, blocks: [work([call("x1", "FILES", "Reading the people", "running")], { steps: 1, failed: 0, running: true, stopped: false, latest: "Reading the people" })] }],
104
+ })),
105
+ );
106
+ later(1300, () =>
107
+ patchLast((m) => ({
108
+ ...m,
109
+ blocks: [work([call("x1", "FILES", "Read the people"), call("x2", "WEB", "Searching the web", "running")], { steps: 2, failed: 0, running: true, stopped: false, latest: "Searching the web" })],
110
+ })),
111
+ );
112
+ if (/question/i.test(text)) {
113
+ later(2100, () => {
114
+ patchLast((m) => ({ ...m, blocks: [work([call("x1", "FILES", "Read the people"), call("x2", "WEB", "Searched the web")], { steps: 2, failed: 0, running: false, stopped: false, latest: null })] }));
115
+ setState("needs_you");
116
+ setNeeds({ kind: "question", in_app: "answer", text: "Two questions", at: "q" });
117
+ setView((v) => ({
118
+ ...v,
119
+ questions: [
120
+ { id: "qa", prompt: "Which list should I start with?", options: [{ id: "warm", label: "Warm leads" }, { id: "cold", label: "Cold" }], free: true },
121
+ { id: "qb", prompt: "Which day should the read go out?", options: [{ id: "mon", label: "Monday" }, { id: "fri", label: "Friday" }], free: false },
122
+ ],
123
+ }));
124
+ });
125
+ return;
126
+ }
127
+ if (/send/i.test(text)) {
128
+ later(2100, () => {
129
+ patchLast((m) => ({ ...m, live: false, blocks: [work([call("x1", "FILES", "Read the people"), call("x2", "WEB", "Searched the web")], { steps: 2, failed: 0, running: false, stopped: false, latest: null })] }));
130
+ setState("needs_you");
131
+ setNeeds({ kind: "yes", in_app: null, text: "Send 12 follow-ups from ada@acme.com?" });
132
+ });
133
+ return;
134
+ }
135
+ const reply = "I found **12 investors** who back seed-stage fintech.\n\nWant me to draft a first note to each?";
136
+ later(2000, () =>
137
+ patchLast((m) => ({
138
+ ...m,
139
+ live: false,
140
+ blocks: [
141
+ work([call("x1", "FILES", "Read the people"), call("x2", "WEB", "Searched the web")], { steps: 2, failed: 0, running: false, stopped: false, latest: null }),
142
+ { kind: "text", key: "tx", text: reply, streaming: false },
143
+ ],
144
+ })),
145
+ );
146
+ later(2100, () => setState("done"));
147
+ };
148
+
149
+ return {
150
+ sessionId: view.messages.length ? "demo" : null,
151
+ state,
152
+ needs,
153
+ turns: [],
154
+ view,
155
+ place: "app",
156
+ request: view.messages.length ? { id: "demo-request", title: "Investors" } : null,
157
+ pending: null,
158
+ sending: false,
159
+ loading: false,
160
+ error: null,
161
+ unavailable: false,
162
+ chats: CHATS,
163
+ send,
164
+ answer: async () => {
165
+ setNeeds(null);
166
+ setView((v) => ({ ...v, questions: [] }));
167
+ setState("working");
168
+ later(900, () => {
169
+ patchLast((m) => ({ ...m, blocks: [...m.blocks, { kind: "text", key: "ty", text: "Thanks — starting with warm leads on Mondays.", streaming: false }] }));
170
+ setState("done");
171
+ });
172
+ return { ok: true };
173
+ },
174
+ stop: () => {
175
+ timers.current.forEach(clearTimeout);
176
+ setState("stopped");
177
+ setView((v) => ({ ...v, thinking: false, failure: { kind: "stopped", words: "" } }));
178
+ },
179
+ openOnDesk: () => true,
180
+ openRequest: () => true,
181
+ openSession: () => undefined,
182
+ callDetail: load,
183
+ newChat: () => {
184
+ setView({ messages: [], thinking: false, failure: null, questions: [] });
185
+ setState(null);
186
+ setNeeds(null);
187
+ },
188
+ reload: () => undefined,
189
+ };
190
+ }
191
+
192
+ export default function AgentPaneDemo() {
193
+ const live = usePretendPane();
194
+ const finished = {
195
+ sessionId: "done",
196
+ state: "done",
197
+ needs: null,
198
+ turns: [],
199
+ view: FINISHED,
200
+ place: "app",
201
+ request: { id: "r", title: "New England groups", status: "done", result: { sentence: "14 groups are on the list New England groups." } },
202
+ pending: null,
203
+ sending: false,
204
+ loading: false,
205
+ error: null,
206
+ unavailable: false,
207
+ chats: CHATS,
208
+ send: () => undefined,
209
+ answer: async () => ({ ok: true }),
210
+ stop: () => undefined,
211
+ openOnDesk: () => true,
212
+ openRequest: () => true,
213
+ openSession: () => undefined,
214
+ callDetail: load,
215
+ newChat: () => undefined,
216
+ reload: () => undefined,
217
+ };
218
+ return (
219
+ <div className="grid gap-6 p-6 lg:grid-cols-2">
220
+ <div className="h-[640px] min-w-0 overflow-hidden rounded-lg border border-border">
221
+ <AgentPane chat={finished} title="Ask about Pinewood" onOpen={() => undefined} />
222
+ </div>
223
+ <div className="h-[640px] min-w-0 overflow-hidden rounded-lg border border-border">
224
+ <AgentPane
225
+ chat={live}
226
+ title="Ask the agent"
227
+ empty="The agent reads the whole app."
228
+ suggestions={["Who should we follow up with?", "Two questions first", "Send them a note"]}
229
+ />
230
+ </div>
231
+ </div>
232
+ );
233
+ }
@@ -0,0 +1,10 @@
1
+ "use client";
2
+
3
+ // What an AgentPane placed inside an AgentDock (blocks/agent-dock) is told:
4
+ // `close` folds the dock (the head's close, when the app gave no onClose of
5
+ // its own), `mode` is "column" or "sheet", and `start` is the starting line
6
+ // a "have the agent do it" button asked for (openAgent). Null outside a
7
+ // dock, where nothing changes. It is the chat-pane block's context under
8
+ // the name the dock and the apps have always used (X5: the pane's frame
9
+ // moved to chat-pane, and the context with it).
10
+ export { ChatDockContext as AgentDockContext } from "../chat-pane";
@@ -0,0 +1,4 @@
1
+ // The AgentPane block — `makersclaw add agent-pane`. Fixed: compose it
2
+ // through its props (README.md beside this file).
3
+ export { AgentPane } from "./agent-pane";
4
+ export { AgentDockContext } from "./dock-context";
@@ -0,0 +1,84 @@
1
+ "use client";
2
+
3
+ import { Fragment } from "react";
4
+ import { cx } from "../../ui";
5
+
6
+ // The agent's text: plain words with the markdown agents write —
7
+ // paragraphs, lists, headings, fenced code, **bold**, `code`, [links](https://…).
8
+ // React nodes only, never HTML. A link opens in a new tab, and only an
9
+ // http(s) address is a link.
10
+
11
+ const INLINE = /(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\((?:https?:\/\/)[^)\s]+\))/g;
12
+
13
+ function inline(text, key) {
14
+ const out = [];
15
+ let last = 0;
16
+ let i = 0;
17
+ for (const m of String(text).matchAll(INLINE)) {
18
+ if (m.index > last) out.push(text.slice(last, m.index));
19
+ const tok = m[0];
20
+ const k = `${key}-${i++}`;
21
+ if (tok.startsWith("**")) out.push(<strong key={k}>{tok.slice(2, -2)}</strong>);
22
+ else if (tok.startsWith("`")) out.push(<code key={k} className="rounded bg-muted px-1 font-mono text-[0.92em]">{tok.slice(1, -1)}</code>);
23
+ else {
24
+ const label = tok.slice(1, tok.indexOf("]("));
25
+ const href = tok.slice(tok.indexOf("](") + 2, -1);
26
+ out.push(
27
+ <a key={k} href={href} target="_blank" rel="noopener noreferrer" className="break-all text-primary underline underline-offset-2">
28
+ {label}
29
+ </a>,
30
+ );
31
+ }
32
+ last = m.index + tok.length;
33
+ }
34
+ if (last < text.length) out.push(text.slice(last));
35
+ return out;
36
+ }
37
+
38
+ const LIST_ITEM = /^\s*(?:[-*•]|\d+[.)])\s+/;
39
+
40
+ /** Paragraphs, lists and fenced code from the agent's text. */
41
+ export function Prose({ text, className }) {
42
+ // Fenced code first: it may hold blank lines.
43
+ const parts = String(text ?? "").replace(/\r/g, "").split(/^```[^\n]*\n([\s\S]*?)^```[ \t]*$/m);
44
+ return (
45
+ <div className={cx("grid min-w-0 gap-2 break-words", className)}>
46
+ {parts.map((part, p) => {
47
+ if (p % 2 === 1)
48
+ return (
49
+ <pre key={p} className="max-h-72 overflow-auto rounded-md bg-muted p-2.5 font-mono text-xs leading-relaxed whitespace-pre-wrap break-words">
50
+ {part.replace(/\n$/, "")}
51
+ </pre>
52
+ );
53
+ return part
54
+ .split(/\n{2,}/)
55
+ .map((block, b) => {
56
+ const lines = block.split("\n").filter((l) => l.trim());
57
+ if (!lines.length) return null;
58
+ const key = `${p}-${b}`;
59
+ if (lines.every((l) => LIST_ITEM.test(l))) {
60
+ const ordered = /^\s*\d/.test(lines[0]);
61
+ const List = ordered ? "ol" : "ul";
62
+ return (
63
+ <List key={key} className={cx("grid gap-1 pl-5", ordered ? "list-decimal" : "list-disc")}>
64
+ {lines.map((l, j) => (
65
+ <li key={j}>{inline(l.replace(LIST_ITEM, ""), `${key}-${j}`)}</li>
66
+ ))}
67
+ </List>
68
+ );
69
+ }
70
+ return (
71
+ <p key={key} className="whitespace-pre-wrap">
72
+ {lines.map((l, j) => (
73
+ <Fragment key={j}>
74
+ {j > 0 ? "\n" : null}
75
+ {/^#{1,6}\s/.test(l) ? <strong>{inline(l.replace(/^#{1,6}\s+/, ""), `${key}-${j}`)}</strong> : inline(l, `${key}-${j}`)}
76
+ </Fragment>
77
+ ))}
78
+ </p>
79
+ );
80
+ });
81
+ })}
82
+ </div>
83
+ );
84
+ }