makersclaw 0.8.0 → 0.8.2

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 (401) hide show
  1. package/README.md +9 -3
  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 +3 -3
  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 +2 -2
  26. package/r/chat-pane.json +84 -0
  27. package/r/chat.json +2 -2
  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 +13 -7
  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 +2 -2
  46. package/r/flow-editor.json +79 -0
  47. package/r/footer.json +2 -2
  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 +3 -3
  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 +3 -3
  60. package/r/pace-bar.json +69 -0
  61. package/r/page-builder.json +2 -2
  62. package/r/payment-methods.json +2 -2
  63. package/r/pdf-document.json +2 -2
  64. package/r/pdf-viewer.json +2 -2
  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 +4086 -1512
  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 +2 -2
  82. package/r/signature-pad.json +2 -2
  83. package/r/sketch-canvas.json +2 -2
  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 +3 -3
  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 +234 -0
  143. package/registry/blocks/agent-pane/agent-pane.jsx +246 -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/approval/README.md +145 -0
  159. package/registry/blocks/approval/approval.jsx +163 -0
  160. package/registry/blocks/approval/block.json +31 -0
  161. package/registry/blocks/approval/demo.jsx +121 -0
  162. package/registry/blocks/approval/index.js +3 -0
  163. package/registry/blocks/ask-bar/README.md +105 -0
  164. package/registry/blocks/ask-bar/ask-bar.jsx +166 -0
  165. package/registry/blocks/ask-bar/block.json +26 -0
  166. package/registry/blocks/ask-bar/demo.jsx +78 -0
  167. package/registry/blocks/ask-bar/index.js +3 -0
  168. package/registry/blocks/automation-editor/README.md +291 -0
  169. package/registry/blocks/automation-editor/automation-editor.jsx +656 -0
  170. package/registry/blocks/automation-editor/block.json +39 -0
  171. package/registry/blocks/automation-editor/demo.jsx +284 -0
  172. package/registry/blocks/automation-editor/index.js +4 -0
  173. package/registry/blocks/automation-editor/run-inputs.jsx +82 -0
  174. package/registry/blocks/automation-list/README.md +129 -0
  175. package/registry/blocks/automation-list/automation-list.jsx +476 -0
  176. package/registry/blocks/automation-list/block.json +35 -0
  177. package/registry/blocks/automation-list/demo.jsx +67 -0
  178. package/registry/blocks/automation-list/index.js +3 -0
  179. package/registry/blocks/automation-model/README.md +109 -0
  180. package/registry/blocks/automation-model/block.json +135 -0
  181. package/registry/blocks/automation-model/catalog.js +256 -0
  182. package/registry/blocks/automation-model/check.js +161 -0
  183. package/registry/blocks/automation-model/demo.jsx +42 -0
  184. package/registry/blocks/automation-model/edit.js +262 -0
  185. package/registry/blocks/automation-model/fixes.js +287 -0
  186. package/registry/blocks/automation-model/glyph.jsx +13 -0
  187. package/registry/blocks/automation-model/graph.js +410 -0
  188. package/registry/blocks/automation-model/index.js +33 -0
  189. package/registry/blocks/automation-model/overlay.js +175 -0
  190. package/registry/blocks/automation-model/parts.jsx +94 -0
  191. package/registry/blocks/automation-model/schedule.js +53 -0
  192. package/registry/blocks/automation-model/templates.js +128 -0
  193. package/registry/blocks/automation-model/values.js +29 -0
  194. package/registry/blocks/automation-model/words.js +439 -0
  195. package/registry/blocks/automations-screen/README.md +207 -0
  196. package/registry/blocks/automations-screen/automations-screen.jsx +452 -0
  197. package/registry/blocks/automations-screen/block.json +47 -0
  198. package/registry/blocks/automations-screen/demo.jsx +364 -0
  199. package/registry/blocks/automations-screen/index.js +4 -0
  200. package/registry/blocks/automations-screen/screen-model.js +129 -0
  201. package/registry/blocks/chat-pane/README.md +143 -0
  202. package/registry/blocks/chat-pane/block.json +48 -0
  203. package/registry/blocks/chat-pane/chat-attach.js +166 -0
  204. package/registry/blocks/chat-pane/chat-composer.jsx +195 -0
  205. package/registry/blocks/chat-pane/chat-context.js +17 -0
  206. package/registry/blocks/chat-pane/chat-model.js +43 -0
  207. package/registry/blocks/chat-pane/chat-pane.jsx +398 -0
  208. package/registry/blocks/chat-pane/chats-list.jsx +52 -0
  209. package/registry/blocks/chat-pane/demo.jsx +103 -0
  210. package/registry/blocks/chat-pane/index.js +9 -0
  211. package/registry/blocks/connect-card/README.md +99 -0
  212. package/registry/blocks/connect-card/block.json +10 -0
  213. package/registry/blocks/connect-card/connect-card.jsx +103 -0
  214. package/registry/blocks/connect-card/demo.jsx +49 -0
  215. package/registry/blocks/connect-card/index.js +3 -0
  216. package/registry/blocks/cost/README.md +115 -0
  217. package/registry/blocks/cost/block.json +10 -0
  218. package/registry/blocks/cost/cost.jsx +176 -0
  219. package/registry/blocks/cost/demo.jsx +66 -0
  220. package/registry/blocks/cost/index.js +3 -0
  221. package/registry/blocks/data-picker/README.md +81 -0
  222. package/registry/blocks/data-picker/block.json +38 -0
  223. package/registry/blocks/data-picker/data-picker.jsx +210 -0
  224. package/registry/blocks/data-picker/demo.jsx +34 -0
  225. package/registry/blocks/data-picker/fields.js +89 -0
  226. package/registry/blocks/data-picker/index.js +4 -0
  227. package/registry/blocks/data-table/demo.jsx +1 -1
  228. package/registry/blocks/first-run/README.md +118 -0
  229. package/registry/blocks/first-run/block.json +11 -0
  230. package/registry/blocks/first-run/demo.jsx +88 -0
  231. package/registry/blocks/first-run/first-run-model.js +51 -0
  232. package/registry/blocks/first-run/first-run.jsx +156 -0
  233. package/registry/blocks/first-run/index.js +5 -0
  234. package/registry/blocks/first-run/probe-rules.js +26 -0
  235. package/registry/blocks/fix-note/README.md +79 -0
  236. package/registry/blocks/fix-note/block.json +35 -0
  237. package/registry/blocks/fix-note/demo.jsx +30 -0
  238. package/registry/blocks/fix-note/fix-note.jsx +235 -0
  239. package/registry/blocks/fix-note/index.js +3 -0
  240. package/registry/blocks/flow-editor/README.md +108 -0
  241. package/registry/blocks/flow-editor/block.json +44 -0
  242. package/registry/blocks/flow-editor/demo.jsx +115 -0
  243. package/registry/blocks/flow-editor/flow-canvas.jsx +568 -0
  244. package/registry/blocks/flow-editor/flow-editor.jsx +154 -0
  245. package/registry/blocks/flow-editor/index.js +6 -0
  246. package/registry/blocks/flow-editor/minimap.jsx +78 -0
  247. package/registry/blocks/flow-editor/outline.jsx +134 -0
  248. package/registry/blocks/library-shelf/README.md +117 -0
  249. package/registry/blocks/library-shelf/block.json +28 -0
  250. package/registry/blocks/library-shelf/demo.jsx +68 -0
  251. package/registry/blocks/library-shelf/index.js +3 -0
  252. package/registry/blocks/library-shelf/library-shelf.jsx +211 -0
  253. package/registry/blocks/library-shelf/probe-rules.js +15 -0
  254. package/registry/blocks/margin-notes/README.md +222 -0
  255. package/registry/blocks/margin-notes/block.json +10 -0
  256. package/registry/blocks/margin-notes/demo.jsx +144 -0
  257. package/registry/blocks/margin-notes/index.js +20 -0
  258. package/registry/blocks/margin-notes/margin-model.js +224 -0
  259. package/registry/blocks/margin-notes/margin-notes.jsx +465 -0
  260. package/registry/blocks/needs-you/README.md +177 -0
  261. package/registry/blocks/needs-you/block.json +34 -0
  262. package/registry/blocks/needs-you/demo.jsx +143 -0
  263. package/registry/blocks/needs-you/index.js +3 -0
  264. package/registry/blocks/needs-you/needs-you.jsx +441 -0
  265. package/registry/blocks/pace-bar/README.md +230 -0
  266. package/registry/blocks/pace-bar/block.json +10 -0
  267. package/registry/blocks/pace-bar/demo.jsx +255 -0
  268. package/registry/blocks/pace-bar/index.js +22 -0
  269. package/registry/blocks/pace-bar/pace-bar.jsx +461 -0
  270. package/registry/blocks/pace-bar/pace-model.js +288 -0
  271. package/registry/blocks/record-grid/README.md +100 -0
  272. package/registry/blocks/record-grid/block.json +28 -0
  273. package/registry/blocks/record-grid/demo.jsx +43 -0
  274. package/registry/blocks/record-grid/index.js +3 -0
  275. package/registry/blocks/record-grid/record-grid.jsx +251 -0
  276. package/registry/blocks/run-history/README.md +138 -0
  277. package/registry/blocks/run-history/block.json +10 -0
  278. package/registry/blocks/run-history/demo.jsx +74 -0
  279. package/registry/blocks/run-history/index.js +3 -0
  280. package/registry/blocks/run-history/run-history.jsx +218 -0
  281. package/registry/blocks/run-view/README.md +174 -0
  282. package/registry/blocks/run-view/block.json +50 -0
  283. package/registry/blocks/run-view/demo.jsx +286 -0
  284. package/registry/blocks/run-view/index.js +5 -0
  285. package/registry/blocks/run-view/run-controls.jsx +266 -0
  286. package/registry/blocks/run-view/run-view.jsx +236 -0
  287. package/registry/blocks/run-view/runs-list.jsx +99 -0
  288. package/registry/blocks/schedule-card/README.md +121 -0
  289. package/registry/blocks/schedule-card/block.json +10 -0
  290. package/registry/blocks/schedule-card/demo.jsx +82 -0
  291. package/registry/blocks/schedule-card/index.js +3 -0
  292. package/registry/blocks/schedule-card/schedule-card.jsx +136 -0
  293. package/registry/blocks/schedule-engine/README.md +137 -0
  294. package/registry/blocks/schedule-engine/block.json +10 -0
  295. package/registry/blocks/schedule-engine/demo.jsx +82 -0
  296. package/registry/blocks/schedule-engine/engine.js +769 -0
  297. package/registry/blocks/schedule-engine/index.js +9 -0
  298. package/registry/blocks/schedule-engine/ops.js +71 -0
  299. package/registry/blocks/schedule-engine/place.js +294 -0
  300. package/registry/blocks/schedule-engine/tree.js +79 -0
  301. package/registry/blocks/schedule-engine/waits.js +80 -0
  302. package/registry/blocks/schedule-gantt/README.md +159 -0
  303. package/registry/blocks/schedule-gantt/block.json +10 -0
  304. package/registry/blocks/schedule-gantt/demo.jsx +223 -0
  305. package/registry/blocks/schedule-gantt/gantt-model.js +219 -0
  306. package/registry/blocks/schedule-gantt/geometry.js +176 -0
  307. package/registry/blocks/schedule-gantt/index.js +26 -0
  308. package/registry/blocks/schedule-gantt/schedule-gantt.jsx +882 -0
  309. package/registry/blocks/schedule-gantt/sheet.jsx +372 -0
  310. package/registry/blocks/schedule-gantt/track.jsx +190 -0
  311. package/registry/blocks/schedule-ruler/README.md +148 -0
  312. package/registry/blocks/schedule-ruler/block.json +10 -0
  313. package/registry/blocks/schedule-ruler/demo.jsx +181 -0
  314. package/registry/blocks/schedule-ruler/index.js +21 -0
  315. package/registry/blocks/schedule-ruler/ruler-model.js +239 -0
  316. package/registry/blocks/schedule-ruler/schedule-ruler.jsx +548 -0
  317. package/registry/blocks/source-receipt/README.md +97 -0
  318. package/registry/blocks/source-receipt/block.json +30 -0
  319. package/registry/blocks/source-receipt/demo.jsx +71 -0
  320. package/registry/blocks/source-receipt/index.js +3 -0
  321. package/registry/blocks/source-receipt/source-receipt.jsx +107 -0
  322. package/registry/blocks/spreadsheet/spreadsheet.jsx +15 -1
  323. package/registry/blocks/step-picker/README.md +78 -0
  324. package/registry/blocks/step-picker/block.json +31 -0
  325. package/registry/blocks/step-picker/demo.jsx +23 -0
  326. package/registry/blocks/step-picker/index.js +3 -0
  327. package/registry/blocks/step-picker/step-picker.jsx +144 -0
  328. package/registry/blocks/step-settings/README.md +100 -0
  329. package/registry/blocks/step-settings/block.json +44 -0
  330. package/registry/blocks/step-settings/demo.jsx +93 -0
  331. package/registry/blocks/step-settings/fields.jsx +58 -0
  332. package/registry/blocks/step-settings/flow-settings.jsx +115 -0
  333. package/registry/blocks/step-settings/index.js +5 -0
  334. package/registry/blocks/step-settings/step-settings.jsx +290 -0
  335. package/registry/blocks/suggestion/README.md +171 -0
  336. package/registry/blocks/suggestion/block.json +40 -0
  337. package/registry/blocks/suggestion/demo.jsx +91 -0
  338. package/registry/blocks/suggestion/index.js +3 -0
  339. package/registry/blocks/suggestion/suggestion.jsx +436 -0
  340. package/registry/blocks/sum-bar/README.md +122 -0
  341. package/registry/blocks/sum-bar/block.json +10 -0
  342. package/registry/blocks/sum-bar/demo.jsx +110 -0
  343. package/registry/blocks/sum-bar/index.js +5 -0
  344. package/registry/blocks/sum-bar/sum-bar.jsx +209 -0
  345. package/registry/blocks/sum-bar/sum-model.js +126 -0
  346. package/registry/blocks/tier-map/README.md +217 -0
  347. package/registry/blocks/tier-map/block.json +10 -0
  348. package/registry/blocks/tier-map/demo.jsx +222 -0
  349. package/registry/blocks/tier-map/index.js +24 -0
  350. package/registry/blocks/tier-map/tier-map.jsx +574 -0
  351. package/registry/blocks/tier-map/tier-model.js +318 -0
  352. package/registry/blocks/time-grid/README.md +305 -0
  353. package/registry/blocks/time-grid/block.json +10 -0
  354. package/registry/blocks/time-grid/demo.jsx +279 -0
  355. package/registry/blocks/time-grid/grid-model.js +322 -0
  356. package/registry/blocks/time-grid/index.js +25 -0
  357. package/registry/blocks/time-grid/time-grid.jsx +1325 -0
  358. package/registry/blocks/time-strip/README.md +141 -0
  359. package/registry/blocks/time-strip/block.json +10 -0
  360. package/registry/blocks/time-strip/demo.jsx +129 -0
  361. package/registry/blocks/time-strip/index.js +19 -0
  362. package/registry/blocks/time-strip/strip-model.js +178 -0
  363. package/registry/blocks/time-strip/time-strip.jsx +260 -0
  364. package/registry/blocks/top-bar/README.md +149 -0
  365. package/registry/blocks/top-bar/block.json +35 -0
  366. package/registry/blocks/top-bar/demo.jsx +78 -0
  367. package/registry/blocks/top-bar/index.js +5 -0
  368. package/registry/blocks/top-bar/probe-rules.js +74 -0
  369. package/registry/blocks/top-bar/top-bar-model.js +152 -0
  370. package/registry/blocks/top-bar/top-bar.jsx +244 -0
  371. package/registry/blocks/trigger-picker/README.md +98 -0
  372. package/registry/blocks/trigger-picker/block.json +38 -0
  373. package/registry/blocks/trigger-picker/demo.jsx +59 -0
  374. package/registry/blocks/trigger-picker/index.js +3 -0
  375. package/registry/blocks/trigger-picker/trigger-picker.jsx +374 -0
  376. package/registry/blocks/workflow-view/README.md +123 -0
  377. package/registry/blocks/workflow-view/block.json +10 -0
  378. package/registry/blocks/workflow-view/demo.jsx +90 -0
  379. package/registry/blocks/workflow-view/index.js +3 -0
  380. package/registry/blocks/workflow-view/workflow-view.jsx +203 -0
  381. package/src/install.mjs +77 -16
  382. package/src/registry.mjs +3 -0
  383. package/templates/next/browser/lib/data.js +6 -1
  384. package/templates/next/files/README.md +627 -24
  385. package/templates/next/files/check/automation-format.ts +2103 -0
  386. package/templates/next/files/check/automation-package.ts +142 -0
  387. package/templates/next/files/check/run.mjs +968 -9
  388. package/templates/next/files/components/ui/field.jsx +17 -4
  389. package/templates/next/files/components/ui/icon.jsx +13 -0
  390. package/templates/next/files/components/ui/index.js +2 -1
  391. package/templates/next/files/components/ui/layout.jsx +77 -2
  392. package/templates/next/files/components/ui/notice.jsx +70 -0
  393. package/templates/next/files/components/ui/page.jsx +124 -0
  394. package/templates/next/files/components/ui/stat.jsx +22 -7
  395. package/templates/next/files/components/ui/toast.jsx +6 -3
  396. package/templates/next/files/lib/automations.js +660 -0
  397. package/templates/next/files/lib/claw.js +241 -5
  398. package/templates/next/files/lib/door.js +92 -0
  399. package/templates/next/files/lib/hooks.js +1677 -8
  400. package/templates/next/files/lib/platform.js +529 -21
  401. package/templates/next/template.json +13 -3
@@ -0,0 +1,156 @@
1
+ "use client";
2
+
3
+ import { useState } from "react";
4
+ import { ActionCard, Button, Card, Icon, cx } from "../../ui";
5
+ import { columnsFor, stepsOf, stepsWords } from "./first-run-model";
6
+
7
+ // FirstRun — an app's first page, before anything is made. Working-tool
8
+ // style, not a landing page (UI review X10, 2026-10-12: Gantt Planner opened
9
+ // on a 52px hero, four stacked cards, a big chart and a second shelf; each
10
+ // app invented its own first run, Roadmap's, Newsletter's and Gantt's all
11
+ // differed).
12
+ //
13
+ // In order, at the kit's normal sizes:
14
+ // 1. one plain heading line, and one line of what the app does
15
+ // 2. the first steps in a row, the agent's way in first (X9), then making
16
+ // the first thing yourself, then starting from the Library, then
17
+ // bringing it in from another tool. The first is the page's one main
18
+ // button
19
+ // 3. the starting points shelf (the app passes its LibraryShelf)
20
+ // 4. what the agent will do, and the accounts it can use, side by side
21
+ // 5. a worked example, behind "See an example". Never filling the page
22
+ //
23
+ // `npm run check` (rule 24, hero) refuses an <h1> at 36px or more.
24
+ //
25
+ // One column, the page's own scroll (UI review X13, 2026-10-12: Newsletter
26
+ // Engine's first run was a short intro on the left and a long "Name it" form
27
+ // in the right column, so the left sat short and the right scrolled on). The
28
+ // block has no side column and draws none: a form for "type it yourself"
29
+ // (`children`) is revealed in the main flow, as its own card between the
30
+ // steps and the shelf, when its step is pressed. Never beside them. Rule 27
31
+ // (sidelong) refuses an app that puts a form in a side column.
32
+
33
+ /** A step's button. */
34
+ function StepButton({ action, variant, kind }) {
35
+ return (
36
+ <Button data-first-run-step={kind} variant={variant} icon={action.icon} href={action.href} onClick={action.onClick} disabled={action.disabled} loading={action.loading}>
37
+ {action.label}
38
+ {action.cost ? <span className="ml-1">{action.cost}</span> : null}
39
+ </Button>
40
+ );
41
+ }
42
+
43
+ function WhatTheAgentDoes({ title, items }) {
44
+ return (
45
+ <section aria-label={title} className="grid content-start gap-3">
46
+ <h2 className="text-xs font-semibold uppercase tracking-[0.06em] text-muted-foreground">{title}</h2>
47
+ <ul className="m-0 grid list-none gap-3 p-0">
48
+ {items.map((it) => (
49
+ <li key={it.name} className="flex gap-2.5">
50
+ <Icon name="sparkles" size={14} className="mt-1 shrink-0 text-muted-foreground" />
51
+ <div className="min-w-0">
52
+ <p className="font-semibold">
53
+ {it.name}
54
+ {it.when ? <span className="font-normal text-muted-foreground"> · {it.when}</span> : null}
55
+ </p>
56
+ {it.what ? <p className="text-[13px] text-muted-foreground">{it.what}</p> : null}
57
+ {it.cost ? <p className="text-xs">{it.cost}</p> : null}
58
+ </div>
59
+ </li>
60
+ ))}
61
+ </ul>
62
+ </section>
63
+ );
64
+ }
65
+
66
+ /**
67
+ * title the heading: one plain line ("Nothing is planned here yet.")
68
+ * lede one line of what the app does and what happens next
69
+ * notice a node above the steps (a Notice: a missing account, a limit)
70
+ * choices [{ key, kind, icon, title, description, action, status, note }]
71
+ * kind: agent · hand · library · import · other (the order they
72
+ * are offered in, whatever order they are given). action:
73
+ * { label, href | onClick, icon, cost, variant, disabled,
74
+ * loading }: a step with no action is dropped. An agent step
75
+ * opens the agent's dock with a starting line ("Draft a project
76
+ * plan for me") and the agent asks for what it is missing; it
77
+ * never opens a form first. status: { tone, children } (an
78
+ * ActionCard's); note: a node between the description and
79
+ * the status (a price line)
80
+ * children a node after the steps, in the main flow (a card that
81
+ * reveals the form to name the first thing when its step is
82
+ * pressed). Never a side column
83
+ * shelf the starting points: your LibraryShelf, as a node
84
+ * agentDoes [{ name, when, what, cost }]: what the agent will do, by
85
+ * itself, and when. `agentTitle` (default "What the agent will do")
86
+ * accounts a node: the accounts it can use, all optional (ConnectRow
87
+ * list). `accountsTitle` (default "Accounts, all optional")
88
+ * example { label, title, description, onOpen, children }: a worked
89
+ * example behind a button. With `onOpen` the button calls it
90
+ * (an example mode); with `children` it reveals them in place
91
+ * className spacing around the page
92
+ */
93
+ export function FirstRun({ title, lede, notice, choices, children, shelf, agentDoes, agentTitle = "What the agent will do", accounts, accountsTitle = "Accounts, all optional", example, className }) {
94
+ const steps = stepsOf(choices);
95
+ const [open, setOpen] = useState(false);
96
+ const wide = Boolean(agentDoes?.length) && Boolean(accounts);
97
+ return (
98
+ <div data-first-run className={cx("@container grid gap-6 p-4 sm:p-6", className)}>
99
+ <header className="grid gap-1.5">
100
+ <h1 className="font-display text-2xl font-semibold leading-tight">{title}</h1>
101
+ {lede ? <p className="max-w-[62ch] text-[13px] text-muted-foreground">{lede}</p> : null}
102
+ </header>
103
+
104
+ {notice ?? null}
105
+
106
+ {steps.length ? (
107
+ <section aria-label={stepsWords(steps.length)} className={cx("grid gap-3", columnsFor(steps.length))}>
108
+ {steps.map((c) => (
109
+ <ActionCard
110
+ key={c.key ?? c.title}
111
+ icon={c.icon}
112
+ title={c.title}
113
+ description={c.description}
114
+ status={c.status}
115
+ action={<StepButton action={c.action} variant={c.variant} kind={c.kind} />}
116
+ >
117
+ {c.note ?? null}
118
+ </ActionCard>
119
+ ))}
120
+ </section>
121
+ ) : null}
122
+
123
+ {children ?? null}
124
+ {shelf ?? null}
125
+
126
+ {agentDoes?.length || accounts ? (
127
+ <div className={cx("grid gap-6", wide && "@3xl:grid-cols-2")}>
128
+ {agentDoes?.length ? <WhatTheAgentDoes title={agentTitle} items={agentDoes} /> : null}
129
+ {accounts ? (
130
+ <section aria-label={accountsTitle} className="grid content-start gap-3">
131
+ <h2 className="text-xs font-semibold uppercase tracking-[0.06em] text-muted-foreground">{accountsTitle}</h2>
132
+ {accounts}
133
+ </section>
134
+ ) : null}
135
+ </div>
136
+ ) : null}
137
+
138
+ {example ? (
139
+ <section aria-label={example.title ?? "Example"} className="grid gap-3">
140
+ <Card padding="sm" className="border-dashed">
141
+ <div className="flex flex-wrap items-center gap-3">
142
+ <div className="min-w-0 flex-1 basis-72">
143
+ {example.title ? <p className="font-semibold">{example.title}</p> : null}
144
+ {example.description ? <p className="text-[13px] text-muted-foreground">{example.description}</p> : null}
145
+ </div>
146
+ <Button variant="secondary" onClick={example.onOpen ?? (() => setOpen((v) => !v))} aria-expanded={example.onOpen ? undefined : open}>
147
+ {example.onOpen ? (example.label ?? "See an example") : open ? "Hide the example" : (example.label ?? "See an example")}
148
+ </Button>
149
+ </div>
150
+ </Card>
151
+ {open && !example.onOpen ? <div className="min-w-0">{example.children}</div> : null}
152
+ </section>
153
+ ) : null}
154
+ </div>
155
+ );
156
+ }
@@ -0,0 +1,5 @@
1
+ // The FirstRun block — `makersclaw add first-run`. Fixed: compose it through
2
+ // its props (README.md beside this file). The model's helpers are plain
3
+ // functions; they work on the server too.
4
+ export { FirstRun } from "./first-run";
5
+ export { KINDS, columnsFor, orderChoices, stepsOf, stepsWords, variantFor } from "./first-run-model";
@@ -0,0 +1,26 @@
1
+ // The layout rules this block ships for the store's probe (makersclaw-store
2
+ // scripts/probe.mjs --suite); see top-bar/probe-rules.js. Nothing imports this.
3
+ export default {
4
+ block: "first-run",
5
+ rules: [
6
+ {
7
+ id: "no-hero-heading",
8
+ kind: "heading-max",
9
+ note: "UI review X10: a marketing hero on the first screen",
10
+ scope: "[data-first-run]",
11
+ max: 32,
12
+ },
13
+ {
14
+ id: "agent-step-opens-the-dock",
15
+ kind: "flow",
16
+ note: "UI review X9: a form before the agent",
17
+ scope: "[data-first-run-step='agent']",
18
+ sizes: ["375x812", "1280x900"],
19
+ steps: [
20
+ { click: { selector: "[data-first-run-step='agent']" }, neverText: [] },
21
+ { expect: { dock: "open" } },
22
+ { expect: { noDialog: true } },
23
+ ],
24
+ },
25
+ ],
26
+ };
@@ -0,0 +1,79 @@
1
+ # FixNote
2
+
3
+ "The agent fixed this." When a step of an automation fails, the agent may
4
+ change what it needs to so **this run** still finishes the same job: a date
5
+ format, a missing field, a trimmed address, a different path that holds the
6
+ same thing. This block says what it changed, in the run, in words.
7
+
8
+ - A sentence on **why** ("The mail tool refuses spaces").
9
+ - The value **as it was** and **as it is now**, side by side.
10
+ - What kind of change it was, and what the fix cost.
11
+ - **Keep this fix for next time** — keeps the change the agent drafted: a
12
+ new version of the automation, which runs from now on. A person keeps or
13
+ drops it; nothing the agent proposes goes live by itself, and the agent
14
+ never changes who gets what, an approved word, a schedule or a limit.
15
+ - Whether it can be **taken back**: a write can, a send cannot.
16
+
17
+ ```jsx
18
+ import { FixNote } from "../components/blocks/fix-note"; // a Makersclaw app
19
+ import { FixNote } from "@/components/makersclaw/blocks/fix-note"; // a shadcn project
20
+ ```
21
+
22
+ `makersclaw add fix-note` lays `agent-marks` and `automation-model` with
23
+ it. A client component. Its own width decides its layout: before and after
24
+ sit side by side from about 384 px.
25
+
26
+ ## Props
27
+
28
+ - `fix` — what a run's step reports: `{ by, kind, before, after, why,
29
+ credits, effect, undo }`. `by` is `agent` or `member` (a person's own edit
30
+ of a run's data, worded as theirs). `kind` is `input` · `mapping` ·
31
+ `format` · `prompt` · `retry` · `skip`. `effect` is `read` · `write` ·
32
+ `send`: only a **write** offers to be taken back (`undo: true`); a send
33
+ says it cannot be. Null draws nothing.
34
+ - `stepTitle` — the step's name, when the note stands apart from its step.
35
+ - `draft` — the change the agent drafted for next time, from the run's
36
+ `fixes`: `{ id, status: proposed | kept | dropped, new_version }`. A kept
37
+ one says "Kept as version 3"; a dropped one says so; a proposed one shows
38
+ Keep and Drop.
39
+ - `onKeep()` — async → `{ ok }` or `{ ok: false, error }`. With a `draft` it
40
+ keeps that draft (a new version that runs); with none it asks the platform
41
+ to draft one from this fix. Without it there is no button (the member may
42
+ not).
43
+ - `onDrop()` — drops the drafted change. Needs a `draft`.
44
+ - `onUndo()` — takes a write back. Without it the note only says it can be.
45
+ - `kept` — true once it was proposed (the note says so, with no button).
46
+ - `compact` — one paragraph with no before and after.
47
+ - `className`.
48
+
49
+ ## FixProposal
50
+
51
+ The same change on the automation itself: what the agent drafted from a
52
+ failed run, for the automation as it stands. Why, which steps it would touch
53
+ (named, never shown), **Keep it** and **Drop it**. A stale one (the
54
+ automation moved on) can only be dropped.
55
+
56
+ - `proposal` — `{ id, why, stale, patch }`, one of `suggestions` from
57
+ `useAutomation`.
58
+ - `def` — the definition, to name the steps.
59
+ - `onKeep()`, `onDrop()` — async, as above.
60
+ - `blocked` — words for why Keep waits ("Save or discard your changes first").
61
+
62
+ ## Never
63
+
64
+ - Never a fix that looks like the member's own edit: it is the agent's, and
65
+ the note says so.
66
+ - Never "Keep" that publishes without a person: the agent drafts, a person
67
+ keeps, and kept saves a new version (the old one stays in the history).
68
+ - Never an Undo for a send: a message that went out cannot be taken back.
69
+
70
+ ## Example
71
+
72
+ ```jsx
73
+ "use client";
74
+ import { FixNote } from "../components/blocks/fix-note";
75
+
76
+ export default function Fixed({ step, onKeep }) {
77
+ return <FixNote fix={step.fix} stepTitle="Send the follow-up" onKeep={onKeep} />;
78
+ }
79
+ ```
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "fix-note",
3
+ "title": "FixNote",
4
+ "description": "\"The agent fixed this\": what the agent changed when a step of an automation failed, so the run still finished the same job. A sentence on why, the value as it was and as it is now, what the fix cost, and \"Keep this fix for next time\", which asks for a proposed change a person keeps or drops (nothing the agent proposes goes live by itself). It draws a run step's `fix`, says whether a write can be taken back (a send cannot), words a person's own edit of a run's data as theirs, and shows what became of the change the agent drafted: kept as a new version, dropped, or waiting. FixProposal is that drafted change on the automation itself, to keep or drop.",
5
+ "useWhen": "A run's screen shows a step the agent repaired: run-view and step-settings place it for you. Use it on its own in a needs-you list or an activity line about an automation.",
6
+ "tags": [
7
+ "automation",
8
+ "workflow",
9
+ "agent",
10
+ "fix",
11
+ "repair",
12
+ "run",
13
+ "failed step",
14
+ "before and after",
15
+ "keep",
16
+ "proposal",
17
+ "provenance",
18
+ "undo",
19
+ "draft",
20
+ "suggestion",
21
+ "version"
22
+ ],
23
+ "exports": [
24
+ "FixNote",
25
+ "FixProposal"
26
+ ],
27
+ "files": [
28
+ "index.js",
29
+ "fix-note.jsx"
30
+ ],
31
+ "requires": [
32
+ "agent-marks",
33
+ "automation-model"
34
+ ]
35
+ }
@@ -0,0 +1,30 @@
1
+ "use client";
2
+
3
+ // FixNote and FixProposal — the gallery's and the smoke test's surface. Not
4
+ // installed into apps. Press Keep: the note says it was kept as a new
5
+ // version, or (with no draft) that it was proposed, never that it is live by
6
+ // itself. A write offers Undo; a send says it cannot be taken back; a
7
+ // person's own edit is worded as theirs.
8
+ import { useState } from "react";
9
+ import { FixNote, FixProposal } from "../components/blocks/fix-note";
10
+
11
+ const FIX = { by: "agent", kind: "format", before: "Ana@x.com ", after: "ana@x.com", why: "The mail tool refuses a space after the address.", credits: 0.4 };
12
+ const DEF = { steps: [{ id: "mail", kind: "tool", label: "Read the mail" }, { id: "save", kind: "action", label: "Save the draft" }] };
13
+ const PROPOSAL = { id: "d1", why: "The save step was given the address with a space after it. Trimming it stops this.", stale: false, base_version: 2, patch: { changes: [{ id: "save", input: { email: "{{ trim steps.mail.output.from }}" } }, { id: "mail", retry: { max: 3 } }] } };
14
+
15
+ export default function FixNoteDemo() {
16
+ const [asked, setAsked] = useState(0);
17
+ return (
18
+ <div className="grid max-w-lg gap-4 p-4">
19
+ <FixNote fix={FIX} stepTitle="Send the follow-up" onKeep={async () => { setAsked((n) => n + 1); return { ok: true }; }} />
20
+ <FixNote fix={{ ...FIX, effect: "write", undo: true }} stepTitle="Save the draft" draft={{ id: "d1", status: "proposed" }} onKeep={async () => ({ ok: true })} onDrop={async () => ({ ok: true })} onUndo={async () => ({ ok: true })} />
21
+ <FixNote fix={{ ...FIX, effect: "send", undo: false }} compact draft={{ id: "d2", status: "kept", new_version: 3 }} />
22
+ <FixNote fix={FIX} compact draft={{ id: "d3", status: "dropped" }} />
23
+ <FixNote fix={{ by: "member", kind: "input", before: { limit: 200 }, after: { limit: 50 }, why: "Changed by you for this run." }} stepTitle="Read the mail" />
24
+ <FixNote fix={{ by: "agent", kind: "mapping", before: "steps.mail.output.items", after: "steps.mail.output.messages", why: "The mail step names its list messages." }} onKeep={async () => ({ ok: false, error: "Could not draft the change. Try again." })} />
25
+ <FixProposal proposal={PROPOSAL} def={DEF} onKeep={async () => ({ ok: true })} onDrop={async () => ({ ok: true })} />
26
+ <FixProposal proposal={{ ...PROPOSAL, id: "d2", stale: true }} def={DEF} onKeep={async () => ({ ok: true })} onDrop={async () => ({ ok: true })} />
27
+ <p className="m-0 text-xs text-muted-foreground">Keep pressed {asked} times.</p>
28
+ </div>
29
+ );
30
+ }
@@ -0,0 +1,235 @@
1
+ "use client";
2
+
3
+ // "The agent fixed this": what the agent changed when a step failed, so
4
+ // the run still finished the same job. It says why in a sentence, shows
5
+ // the value as it was and as it is now, what the fix cost, whether it can
6
+ // be taken back (only a write can; a send cannot), and what became of the
7
+ // change the agent drafted for next time: kept as a new version, dropped,
8
+ // or still waiting for a person. Nothing the agent proposes goes live by
9
+ // itself. It draws what a run's step reports in `fix`:
10
+ // { by, kind, before, after, why, credits, effect, undo }, and the draft
11
+ // from the run's `fixes`. A person's own edit of a run's data is the same
12
+ // shape with `by: "member"` and is worded as theirs. Props in, callbacks out.
13
+ //
14
+ // FixProposal is the other half: a change the agent drafted from a failed
15
+ // run, shown on the automation itself, to keep or drop.
16
+
17
+ import { useState } from "react";
18
+ import { Button, cx } from "../../ui";
19
+ import { AgentMark } from "../agent-marks";
20
+ import { changeLines, creditsWords } from "../automation-model";
21
+
22
+ const KIND = {
23
+ input: "A value it was given",
24
+ mapping: "Where a value came from",
25
+ format: "The way a value is written",
26
+ prompt: "The words it asked with",
27
+ retry: "How it tries again",
28
+ skip: "A step that was skipped",
29
+ };
30
+
31
+ /** A value as text: words as they are, the rest as compact JSON. */
32
+ const show = (v) => (typeof v === "string" ? v : (JSON.stringify(v) ?? ""));
33
+
34
+ function Side({ label, value, tone }) {
35
+ return (
36
+ <div className="grid min-w-0 gap-0.5">
37
+ <dt className="text-2xs font-semibold uppercase tracking-wide text-muted-foreground">{label}</dt>
38
+ <dd className={cx("m-0 min-w-0 break-words rounded-md border px-2 py-1 font-mono text-xs", tone === "now" ? "border-primary/50 bg-primary/10" : "border-border bg-muted")}>{show(value) || "nothing"}</dd>
39
+ </div>
40
+ );
41
+ }
42
+
43
+ /** One press that may fail: busy while it runs, its refusal in words. */
44
+ function usePress() {
45
+ const [busy, setBusy] = useState(null);
46
+ const [error, setError] = useState(null);
47
+ async function press(what, work) {
48
+ if (!work || busy) return null;
49
+ setBusy(what);
50
+ setError(null);
51
+ let r;
52
+ try {
53
+ r = await work();
54
+ } catch (e) {
55
+ r = { ok: false, error: e?.message ?? String(e) };
56
+ }
57
+ setBusy(null);
58
+ if (r && r.ok === false) {
59
+ setError(r.error || "That did not work. Try again.");
60
+ return false;
61
+ }
62
+ return true;
63
+ }
64
+ return { busy, error, press };
65
+ }
66
+
67
+ /**
68
+ * fix { by, kind, before, after, why, credits, effect, undo }
69
+ * stepTitle the step's name, when the note stands apart from its step
70
+ * draft the change the agent drafted for next time, from the run's
71
+ * `fixes`: { id, status: proposed | kept | dropped, new_version }.
72
+ * With it, Keep and Drop act on that draft.
73
+ * onKeep() async → { ok } | { ok: false, error }: keep the fix for next
74
+ * time. With a `draft` it saves a new version that runs; with
75
+ * no draft the platform drafts one from this fix (a person
76
+ * keeps it). Without onKeep there is no button.
77
+ * onDrop() async: drop the drafted change. Needs a `draft`.
78
+ * onUndo() async: take a write back. Without it the note only says it can be.
79
+ * kept true once it was proposed (the note says so, with no button)
80
+ * compact one paragraph, no before and after
81
+ */
82
+ export function FixNote({ fix, stepTitle, draft = null, onKeep, onDrop, onUndo, kept: keptProp = false, compact = false, className }) {
83
+ const { busy, error, press } = usePress();
84
+ const [done, setDone] = useState(null);
85
+ if (!fix) return null;
86
+ const mine = fix.by === "member";
87
+ const has = fix.before !== undefined || fix.after !== undefined;
88
+ const state = draft && draft.status !== "proposed" ? draft.status : done;
89
+ const undone = done === "undone";
90
+
91
+ const keep = async () => {
92
+ if ((await press("keep", onKeep)) === true) setDone(draft ? "kept" : "proposed");
93
+ };
94
+ const drop = async () => {
95
+ if ((await press("drop", onDrop)) === true) setDone("dropped");
96
+ };
97
+ const undo = async () => {
98
+ if ((await press("undo", onUndo)) === true) setDone("undone");
99
+ };
100
+
101
+ const heading = mine
102
+ ? fix.kind === "skip"
103
+ ? "You skipped this step"
104
+ : stepTitle
105
+ ? `You changed the data for “${stepTitle}”`
106
+ : "You changed this step’s data"
107
+ : stepTitle
108
+ ? `The agent fixed “${stepTitle}”`
109
+ : "The agent fixed this";
110
+
111
+ return (
112
+ <section aria-label={mine ? "You changed this" : "The agent fixed this"} className={cx("@container grid min-w-0 gap-2 rounded-lg border p-3 text-sm text-foreground", mine ? "border-border bg-muted" : "border-primary/50 bg-primary/10", className)}>
113
+ <h4 className="m-0 flex min-w-0 items-center gap-1.5 text-[13px] font-semibold">
114
+ {mine ? null : <AgentMark />}
115
+ <span className="min-w-0">{heading}</span>
116
+ </h4>
117
+ {fix.why ? <p className="m-0 text-[13px]">{fix.why}</p> : null}
118
+ {!compact && has ? (
119
+ <dl className="m-0 grid gap-2 @sm:grid-cols-2">
120
+ <Side label="It was" value={fix.before} />
121
+ <Side label="Now" value={fix.after} tone="now" />
122
+ </dl>
123
+ ) : null}
124
+ <p className="m-0 text-xs text-muted-foreground">
125
+ {KIND[fix.kind] ? `${KIND[fix.kind]}, for this run only.` : "For this run only."}
126
+ {!mine && fix.credits ? ` It cost ${creditsWords(fix.credits)}.` : ""}
127
+ </p>
128
+ {fix.effect === "write" && fix.undo ? (
129
+ <div className="flex flex-wrap items-center gap-2">
130
+ <p className="m-0 text-xs text-muted-foreground">{undone ? "Taken back." : "It wrote to the app. That can be taken back."}</p>
131
+ {onUndo && !undone ? (
132
+ <Button size="sm" variant="quiet" icon="undo" loading={busy === "undo"} onClick={undo}>
133
+ Undo
134
+ </Button>
135
+ ) : null}
136
+ </div>
137
+ ) : fix.effect === "send" ? (
138
+ <p className="m-0 text-xs text-muted-foreground">It sent something, so it cannot be taken back.</p>
139
+ ) : null}
140
+ {state === "kept" ? (
141
+ <p role="status" className="m-0 text-xs text-muted-foreground">
142
+ {draft?.new_version ? `Kept as version ${draft.new_version}. It runs this way from now on.` : "Kept. It runs this way from now on."}
143
+ </p>
144
+ ) : state === "dropped" ? (
145
+ <p role="status" className="m-0 text-xs text-muted-foreground">
146
+ Dropped. The automation stays as it was.
147
+ </p>
148
+ ) : state === "proposed" || keptProp ? (
149
+ <p role="status" className="m-0 text-xs text-muted-foreground">
150
+ Proposed as a change to this automation. It waits for you to keep it.
151
+ </p>
152
+ ) : onKeep ? (
153
+ <div className="flex flex-wrap items-center gap-2">
154
+ <Button size="sm" variant="secondary" loading={busy === "keep"} disabled={busy !== null} onClick={keep}>
155
+ Keep this fix for next time
156
+ </Button>
157
+ {draft && onDrop ? (
158
+ <Button size="sm" variant="quiet" loading={busy === "drop"} disabled={busy !== null} onClick={drop}>
159
+ Drop it
160
+ </Button>
161
+ ) : null}
162
+ </div>
163
+ ) : null}
164
+ {error ? (
165
+ <p role="alert" className="m-0 text-xs text-destructive">
166
+ {error}
167
+ </p>
168
+ ) : null}
169
+ </section>
170
+ );
171
+ }
172
+
173
+ /**
174
+ * A change the agent drafted from a failed run, for the automation as it
175
+ * stands: why, which steps it would touch and what in them (named, never
176
+ * shown), and Keep or Drop. Keeping saves a new version that runs; dropping
177
+ * forgets it. A change drafted against an older version is stale: it can only
178
+ * be dropped.
179
+ *
180
+ * proposal { id, why, stale, patch, base_version } (GET automations/<id> `suggestions`)
181
+ * def the definition, to name the steps
182
+ * onKeep(), onDrop() async → { ok } | { ok: false, error }
183
+ * blocked words for why Keep waits ("Save or discard your changes first")
184
+ */
185
+ export function FixProposal({ proposal, def, onKeep, onDrop, blocked = null, className }) {
186
+ const { busy, error, press } = usePress();
187
+ const [done, setDone] = useState(null);
188
+ if (!proposal) return null;
189
+ const lines = changeLines(proposal.patch, def);
190
+
191
+ return (
192
+ <section aria-label="The agent suggests a change" className={cx("@container grid min-w-0 gap-2 rounded-lg border border-primary/50 bg-primary/10 p-3 text-sm text-foreground", className)}>
193
+ <h4 className="m-0 flex min-w-0 items-center gap-1.5 text-[13px] font-semibold">
194
+ <AgentMark />
195
+ <span className="min-w-0">The agent suggests a change for next time</span>
196
+ </h4>
197
+ {proposal.why ? <p className="m-0 text-[13px]">{proposal.why}</p> : null}
198
+ {lines.length > 0 ? (
199
+ <ul className="m-0 grid list-disc gap-0.5 pl-5 text-[13px]">
200
+ {lines.map((l) => (
201
+ <li key={l.stepId} className="min-w-0 break-words">
202
+ <span className="font-medium">{l.title}</span>: {l.what}
203
+ </li>
204
+ ))}
205
+ </ul>
206
+ ) : null}
207
+ {done ? (
208
+ <p role="status" className="m-0 text-xs text-muted-foreground">
209
+ {done === "kept" ? "Kept. This version runs now." : "Dropped. The automation stays as it was."}
210
+ </p>
211
+ ) : (
212
+ <>
213
+ {proposal.stale ? <p className="m-0 text-xs text-muted-foreground">The automation changed after this was suggested, so it is out of date. You can drop it.</p> : blocked ? <p className="m-0 text-xs text-muted-foreground">{blocked}</p> : null}
214
+ <div className="flex flex-wrap items-center gap-2">
215
+ {onKeep ? (
216
+ <Button size="sm" variant="secondary" loading={busy === "keep"} disabled={busy !== null || proposal.stale || Boolean(blocked)} onClick={async () => ((await press("keep", onKeep)) === true ? setDone("kept") : null)}>
217
+ Keep it
218
+ </Button>
219
+ ) : null}
220
+ {onDrop ? (
221
+ <Button size="sm" variant="quiet" loading={busy === "drop"} disabled={busy !== null} onClick={async () => ((await press("drop", onDrop)) === true ? setDone("dropped") : null)}>
222
+ Drop it
223
+ </Button>
224
+ ) : null}
225
+ </div>
226
+ </>
227
+ )}
228
+ {error ? (
229
+ <p role="alert" className="m-0 text-xs text-destructive">
230
+ {error}
231
+ </p>
232
+ ) : null}
233
+ </section>
234
+ );
235
+ }
@@ -0,0 +1,3 @@
1
+ // The FixNote block — `makersclaw add fix-note`. Fixed: compose it
2
+ // through its props (README.md beside this file).
3
+ export { FixNote, FixProposal } from "./fix-note";