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,236 @@
1
+ "use client";
2
+
3
+ // One run, on the same canvas as the builder: every card wears how it
4
+ // went, the path the run took is lit and the paths it did not take are
5
+ // dimmed, and a step the agent fixed says so on its card and in its panel.
6
+ //
7
+ // Read-only: nothing here changes the flow. "Run again", the controls for
8
+ // a run (pause, resume, stop; retry, skip, change the data
9
+ // or raise the limit when it is stuck; retry from a step of one that is over) and keeping or dropping the change
10
+ // the agent drafted from a fix are the platform's doors; the screen around
11
+ // this view calls them. Props in, callbacks out.
12
+
13
+ import { useMemo, useState } from "react";
14
+ import { Button, Icon, cx } from "../../ui";
15
+ import {
16
+ Chip,
17
+ RunPicker,
18
+ SidePanel,
19
+ PanelSection,
20
+ agoWords,
21
+ availableBefore,
22
+ clockWords,
23
+ creditsWords,
24
+ draftOfStep,
25
+ durationWords,
26
+ findStep,
27
+ layoutAutomation,
28
+ overlayOf,
29
+ reportLines,
30
+ runStatusWords,
31
+ stepTitle,
32
+ testWords,
33
+ triggerTypeWords,
34
+ triggerWords,
35
+ } from "../automation-model";
36
+ import { FlowEditor } from "../flow-editor";
37
+ import { FixNote } from "../fix-note";
38
+ import { StepSettings } from "../step-settings";
39
+ import { RetryFromStep, RunControls } from "./run-controls";
40
+
41
+ function titleOfId(def, id) {
42
+ const step = findStep(def.steps, id);
43
+ return step ? stepTitle(step) : id;
44
+ }
45
+
46
+ /** The strip over a test run's canvas: how the test went in a line, what the
47
+ * steps would have done, what could not be checked, what was only sampled.
48
+ * The platform's own account (`run.result.dry`); nothing here is invented. */
49
+ function TestStrip({ detail, def }) {
50
+ const run = detail.run;
51
+ const line = testWords(detail);
52
+ const dry = run.result && typeof run.result === "object" ? run.result.dry : null;
53
+ const would = (Array.isArray(dry?.would) ? dry.would : []).filter((w) => w && typeof w.words === "string" && w.words.trim());
54
+ const unchecked = Array.isArray(dry?.unchecked) ? dry.unchecked.length : 0;
55
+ const sampled = (Array.isArray(dry?.sampled) ? dry.sampled : []).filter((x) => x && Number.isFinite(Number(x.of)) && Number.isFinite(Number(x.looked_at)));
56
+ const shown = would.slice(0, 5);
57
+ const tone = run.status === "failed" ? "border-destructive/50 bg-destructive/10" : run.status === "done" ? "border-border bg-muted/40" : "border-warning/50 bg-warning/10";
58
+ return (
59
+ <section aria-label="What this test did" className={cx("grid gap-1.5 border-b px-3 py-2 text-[13px]", tone)}>
60
+ {line ? <p className="m-0 font-medium">{line}</p> : null}
61
+ {shown.length > 0 ? (
62
+ <ul className="m-0 grid list-none gap-0.5 p-0 text-muted-foreground">
63
+ {shown.map((w, i) => (
64
+ <li key={`${w.path ?? w.step ?? i}`} className="flex min-w-0 gap-1.5">
65
+ <Icon name="pencil" size={13} className="mt-0.5 shrink-0" />
66
+ <span className="min-w-0 break-words">{w.words}</span>
67
+ </li>
68
+ ))}
69
+ {would.length > shown.length ? <li className="pl-5">and {would.length - shown.length} more</li> : null}
70
+ </ul>
71
+ ) : null}
72
+ {unchecked > 0 ? <p className="m-0 text-muted-foreground">{unchecked === 1 ? "1 step could not be checked" : `${unchecked} steps could not be checked`}: they need what an earlier step would have made.</p> : null}
73
+ {sampled.map((x) => (
74
+ <p key={x.step} className="m-0 text-muted-foreground">
75
+ Looked at the first {Number(x.looked_at)} of {Number(x.of)}
76
+ {x.step ? ` in “${titleOfId(def, x.step)}”` : ""}.
77
+ </p>
78
+ ))}
79
+ </section>
80
+ );
81
+ }
82
+
83
+ function Note({ tone, children }) {
84
+ return <p className={cx("m-0 rounded-md border px-3 py-2 text-[13px]", tone === "red" ? "border-destructive/50 bg-destructive/10" : "border-warning/50 bg-warning/10")}>{children}</p>;
85
+ }
86
+
87
+ /**
88
+ * def the definition the run used (or the closest one: say so in versionNote)
89
+ * versionNote "This run used version 3. The steps drawn are the current ones."
90
+ * detail a run's account: { run, steps, steps_visible, fixes? } (GET automation-runs/<id>);
91
+ * `fixes` are the fixer's attempts and the changes it drafted
92
+ * runs the automation's runs, newest first, for the picker and the number
93
+ * apps, actions, ownedByApp as the builder's, for the read-only step panel
94
+ * tz the automation's time zone, for the clock words
95
+ * tabs the Flow / Runs tabs, drawn in the header
96
+ * name the automation's name, on the back button
97
+ * A TEST run (`run.dry`: it read real data and changed nothing) draws a strip over the
98
+ * canvas (`testWords`, what each step would have done from `run.result.dry`, what
99
+ * could not be checked, what was only sampled), its chip says Test passed / Test
100
+ * failed / Test stopped, its steps that stood in for themselves are dashed with a
101
+ * pencil, and the button reads "Test again".
102
+ * onBack, onPickRun(runId), onRunAgain(), runAgainBusy
103
+ * onControl(op, { path?, input?, confirmNotSent?, raiseBy?, confirmResend? }) pause · resume · stop · retry ·
104
+ * skip · edit (a run's step data) · retry_from (start over at a step, from its panel); resolves { ok } or { ok: false, error, code }
105
+ * controlBusy the op that is out
106
+ * onKeepFix(stepId), onDropFix(stepId) keep or drop the change the agent drafted for a
107
+ * step it fixed (a new version that runs). A fix with no draft has no button.
108
+ * onUndoFix(stepId) take back a write the agent made while fixing a step
109
+ */
110
+ export function RunView({ def, versionNote = null, detail, runs = [], apps = [], actions, ownedByApp = false, tz = "UTC", tabs, name, onBack, onPickRun, onRunAgain, runAgainBusy = false, onControl, controlBusy = null, onKeepFix, onDropFix, onUndoFix, className }) {
111
+ const run = detail.run;
112
+ const [selected, setSelected] = useState(null);
113
+ const fixes = detail.fixes ?? [];
114
+ // The change the agent drafted for a step it fixed: Keep and Drop act on it.
115
+ // With none drafted there is nothing to keep, so no button.
116
+ const keepProps = (stepId) => {
117
+ const draft = draftOfStep(fixes, stepId);
118
+ return {
119
+ draft,
120
+ onKeep: draft && draft.status === "proposed" && onKeepFix ? () => onKeepFix(stepId) : undefined,
121
+ onDrop: draft && draft.status === "proposed" && onDropFix ? () => onDropFix(stepId) : undefined,
122
+ onUndo: onUndoFix ? () => onUndoFix(stepId) : undefined,
123
+ };
124
+ };
125
+
126
+ const words = triggerWords(def.trigger);
127
+ const layout = useMemo(() => layoutAutomation(def, { triggerWords: words }), [def, words]);
128
+ const overlay = useMemo(() => overlayOf(layout, detail.steps, run.status), [layout, detail.steps, run.status]);
129
+
130
+ const dry = run.dry === true;
131
+ const status = runStatusWords(run.status, dry);
132
+ const at = runs.findIndex((r) => r.id === run.id);
133
+ const n = at >= 0 ? runs.length - at : 0;
134
+ const selectedStep = selected && selected !== "trigger" ? findStep(def.steps, selected) : null;
135
+ const fixed = [...overlay.summary.values()].filter((s) => s.fix && s.fix.by !== "member");
136
+ const edited = [...overlay.summary.values()].filter((s) => s.fix && s.fix.by === "member");
137
+ const lines = reportLines(run.result);
138
+ const errorWords = run.error && typeof run.error.words === "string" ? run.error.words : null;
139
+ const started = clockWords(run.started_at ?? run.created_at, tz);
140
+
141
+ const side = selectedStep ? (
142
+ <StepSettings
143
+ key={selectedStep.id}
144
+ step={selectedStep}
145
+ available={availableBefore(def, selectedStep.id, stepTitle)}
146
+ apps={apps}
147
+ actions={actions}
148
+ ownedByApp={ownedByApp}
149
+ problems={[]}
150
+ readOnly
151
+ summary={overlay.summary.get(selectedStep.id) ?? null}
152
+ dataVisible={detail.steps_visible}
153
+ fixProps={keepProps(selectedStep.id)}
154
+ runActions={<RetryFromStep run={run} steps={detail.steps} def={def} stepId={selectedStep.id} onControl={onControl} busy={controlBusy} />}
155
+ onChange={() => undefined}
156
+ onClose={() => setSelected(null)}
157
+ />
158
+ ) : (
159
+ <SidePanel title={`${run.is_test ? "Test run" : "Run"} ${n > 0 ? n : ""}`.trim()} subtitle={`${agoWords(run.created_at) ?? ""}${started ? ` · ${started}` : ""}`} label="This run">
160
+ <dl className="m-0 grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-1.5 text-[13px]">
161
+ <dt className="text-muted-foreground">Started by</dt>
162
+ <dd className="m-0">{triggerTypeWords(run.trigger_type)}</dd>
163
+ <dt className="text-muted-foreground">Took</dt>
164
+ <dd className="m-0">{durationWords(run.started_at, run.ended_at) ?? (run.status === "running" ? "Still running" : "—")}</dd>
165
+ <dt className="text-muted-foreground">Cost</dt>
166
+ <dd className="m-0 font-mono">
167
+ {creditsWords(run.credits)}
168
+ {run.cap_credits ? ` of ${creditsWords(run.cap_credits)}` : ""}
169
+ </dd>
170
+ <dt className="text-muted-foreground">Version</dt>
171
+ <dd className="m-0 font-mono">{run.version}</dd>
172
+ </dl>
173
+ {run.status === "waiting" && run.wake_at ? <Note tone="amber">Waiting until {clockWords(run.wake_at, tz)}.</Note> : null}
174
+ {run.status === "needs_you" && !onControl ? <Note tone="amber">It is waiting for its owner. Open the step that is marked.</Note> : null}
175
+ {errorWords ? <Note tone="red">{errorWords}</Note> : null}
176
+ <RunControls run={run} steps={detail.steps} stepsVisible={detail.steps_visible} titleOf={(id) => titleOfId(def, id)} onControl={onControl} busy={controlBusy} />
177
+ {fixed.length > 0 ? (
178
+ <PanelSection title={fixed.length === 1 ? "The agent fixed one step" : `The agent fixed ${fixed.length} steps`}>
179
+ {fixed.map((s) => (
180
+ <FixNote key={s.stepId} fix={s.fix} stepTitle={titleOfId(def, s.stepId)} compact {...keepProps(s.stepId)} />
181
+ ))}
182
+ </PanelSection>
183
+ ) : null}
184
+ {edited.length > 0 ? (
185
+ <PanelSection title={edited.length === 1 ? "You changed one step" : `You changed ${edited.length} steps`}>
186
+ {edited.map((s) => (
187
+ <FixNote key={s.stepId} fix={s.fix} stepTitle={titleOfId(def, s.stepId)} compact />
188
+ ))}
189
+ </PanelSection>
190
+ ) : null}
191
+ {lines.length > 0 ? (
192
+ <PanelSection title="What it did">
193
+ <dl className="m-0 grid grid-cols-[minmax(0,1fr)_auto] gap-x-4 gap-y-1 text-[13px]">
194
+ {lines.map((l) => (
195
+ <div key={l.label} className="contents">
196
+ <dt className="text-muted-foreground">{l.label.charAt(0).toUpperCase() + l.label.slice(1)}</dt>
197
+ <dd className="m-0 text-right font-mono">{l.value}</dd>
198
+ </div>
199
+ ))}
200
+ </dl>
201
+ </PanelSection>
202
+ ) : null}
203
+ <p className="m-0 text-xs text-muted-foreground">Press a card to see how that step went{detail.steps_visible ? ", and what went in and out" : ""}.</p>
204
+ </SidePanel>
205
+ );
206
+
207
+ return (
208
+ <div className={cx("@container flex min-h-0 min-w-0 flex-1 flex-col bg-background text-foreground", className)}>
209
+ <header className="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2">
210
+ {onBack ? (
211
+ <Button size="sm" variant="quiet" icon="arrow-left" onClick={onBack}>
212
+ {name ?? detail.automation?.name ?? "Back"}
213
+ </Button>
214
+ ) : null}
215
+ <Chip tone={run.paused ? "amber" : status.tone}>{run.paused ? "Paused" : status.text}</Chip>
216
+ {run.is_test ? <Chip tone="grey">Test</Chip> : null}
217
+ {tabs}
218
+ <span className="ml-auto" />
219
+ {runs.length ? <RunPicker runs={runs} value={run.id} onPick={onPickRun} /> : null}
220
+ {onRunAgain ? (
221
+ <Button size="sm" variant="secondary" icon="play" loading={runAgainBusy} onClick={onRunAgain}>
222
+ {dry ? "Test again" : "Run again"}
223
+ </Button>
224
+ ) : null}
225
+ </header>
226
+ {versionNote ? <div className="border-b border-warning/50 bg-warning/10 px-3 py-2 text-sm">{versionNote}</div> : null}
227
+ <div className="flex min-h-0 flex-1 flex-col @3xl:flex-row">
228
+ <div className="flex min-h-[360px] min-w-0 flex-1 flex-col">
229
+ {dry ? <TestStrip detail={detail} def={def} /> : null}
230
+ <FlowEditor def={def} selectedId={selected} onSelect={setSelected} overlay={overlay} fitKey={run.id} />
231
+ </div>
232
+ <div className="flex max-h-[60%] min-h-0 shrink-0 flex-col border-t border-border @3xl:max-h-none @3xl:w-[360px] @3xl:border-l @3xl:border-t-0 [&>aside]:min-h-0 [&>aside]:flex-1">{side}</div>
233
+ </div>
234
+ </div>
235
+ );
236
+ }
@@ -0,0 +1,99 @@
1
+ "use client";
2
+
3
+ // An automation's runs, newest first: what ran, how it ended, when, how
4
+ // long, what it cost. Above them the little overview a person wants first:
5
+ // how many finished, how many failed, what is still going, what it cost.
6
+ // A row opens the run on the canvas. Props in, callbacks out.
7
+
8
+ import { useMemo, useState } from "react";
9
+ import { cx } from "../../ui";
10
+ import { ACTIVE, Dot, agoWords, clockWords, creditsWords, durationWords, overviewOf, runStatusWords, triggerTypeWords } from "../automation-model";
11
+
12
+ const FILTERS = [
13
+ { value: "all", label: "All" },
14
+ { value: "done", label: "Done" },
15
+ { value: "failed", label: "Failed" },
16
+ { value: "active", label: "In progress" },
17
+ ];
18
+
19
+ const STATUS_TEXT = { green: "text-success", blue: "text-info", amber: "text-warning", red: "text-destructive", grey: "text-muted-foreground" };
20
+
21
+ /**
22
+ * runs [{ id, status, trigger_type, is_test, dry?, created_at, started_at, ended_at, credits }], newest first
23
+ * tz the automation's time zone, for the clock words
24
+ * onOpen(runId)
25
+ * howToTest the words under "It has not run yet" (default says Test run)
26
+ */
27
+ export function RunsList({ runs, tz = "UTC", onOpen, howToTest = "When it runs, each run is listed here, with how it went and what it cost. Use Test run to try it once.", className }) {
28
+ const [filter, setFilter] = useState("all");
29
+ const total = runs.length;
30
+ const o = useMemo(() => overviewOf(runs), [runs]);
31
+ const shown = runs.filter((r) => (filter === "all" ? true : filter === "active" ? ACTIVE.has(r.status) : r.status === filter));
32
+
33
+ if (total === 0) {
34
+ return (
35
+ <div className={cx("grid content-start gap-1 p-6", className)}>
36
+ <h3 className="m-0 text-base font-semibold">It has not run yet</h3>
37
+ <p className="m-0 text-sm text-muted-foreground">{howToTest}</p>
38
+ </div>
39
+ );
40
+ }
41
+ return (
42
+ <div data-scroll className={cx("@container grid min-h-0 min-w-0 flex-1 content-start gap-3 overflow-y-auto p-4", className)}>
43
+ <dl className="m-0 grid grid-cols-2 gap-2 @xl:grid-cols-4">
44
+ {[
45
+ ["Done", o.done, false],
46
+ ["Failed", o.failed, o.failed > 0],
47
+ ["In progress", o.active, false],
48
+ ["Spent", creditsWords(o.credits), false],
49
+ ].map(([label, value, bad]) => (
50
+ <div key={label} className="grid gap-0.5 rounded-lg border border-border bg-card px-3 py-2 text-card-foreground">
51
+ <dt className="text-xs text-muted-foreground">{label}</dt>
52
+ <dd className={cx("m-0 text-lg font-semibold tabular-nums", bad && "text-destructive")}>{value}</dd>
53
+ </div>
54
+ ))}
55
+ </dl>
56
+ <div role="group" aria-label="Show" className="flex flex-wrap gap-1">
57
+ {FILTERS.map((f) => (
58
+ <button
59
+ key={f.value}
60
+ type="button"
61
+ aria-pressed={filter === f.value}
62
+ onClick={() => setFilter(f.value)}
63
+ className={cx("min-h-9 rounded-full border px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", filter === f.value ? "border-foreground bg-accent font-medium" : "border-border text-muted-foreground hover:bg-accent")}
64
+ >
65
+ {f.label}
66
+ </button>
67
+ ))}
68
+ </div>
69
+ {shown.length === 0 ? (
70
+ <p className="m-0 text-sm text-muted-foreground">No run matches.</p>
71
+ ) : (
72
+ <ol className="m-0 grid list-none gap-1.5 p-0">
73
+ {shown.map((r) => {
74
+ const idx = total - runs.indexOf(r);
75
+ const h = runStatusWords(r.status, r.dry === true);
76
+ return (
77
+ <li key={r.id}>
78
+ <button type="button" onClick={() => onOpen?.(r.id)} className="grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-3 gap-y-0.5 rounded-lg border border-border bg-card px-3 py-2 text-left text-card-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring @xl:grid-cols-[auto_minmax(0,1fr)_auto_auto_auto]">
79
+ <Dot tone={h.tone} />
80
+ <span className="grid min-w-0 gap-0.5">
81
+ <b className="text-sm font-semibold">
82
+ {r.is_test ? "Test run" : "Run"} {idx}
83
+ </b>
84
+ <span className="truncate text-xs text-muted-foreground">
85
+ {triggerTypeWords(r.trigger_type)} · {clockWords(r.started_at ?? r.created_at, tz) ?? ""} · {agoWords(r.created_at) ?? ""}
86
+ </span>
87
+ </span>
88
+ <span className={cx("text-[13px] font-medium", STATUS_TEXT[h.tone])}>{h.text}</span>
89
+ <span className="hidden font-mono text-xs text-muted-foreground @xl:inline">{durationWords(r.started_at, r.ended_at) ?? "—"}</span>
90
+ <span className="hidden font-mono text-xs text-muted-foreground @xl:inline">{creditsWords(r.credits)}</span>
91
+ </button>
92
+ </li>
93
+ );
94
+ })}
95
+ </ol>
96
+ )}
97
+ </div>
98
+ );
99
+ }
@@ -0,0 +1,121 @@
1
+ # ScheduleCard
2
+
3
+ > **Superseded** (0.8.1, the automations engine, D26). A job's card for an app whose jobs still run as the agent's wakes (`useJobs`). For an app whose jobs run on the automations engine (`useAutomations`), use `automation-list`: whole rows that open the automation, with the switch, health, next and last run and cost, and the editor and run views behind them. Keep using this block for an app that has not moved: it works as it did.
4
+
5
+
6
+ One scheduled job of the app's agent, on a card beside the day's work:
7
+ its name, how its last run went (a mark and words), one line of what it
8
+ did, this run's cost and the week's credits against the allowance as a
9
+ bar, when it runs next, **Run now** with its price on the button, and an
10
+ on/off switch.
11
+
12
+ It is part of the agent kit (0.8.1). The app shows its agent's work
13
+ itself, in its own look; the window's Runs tab stays as the full
14
+ history.
15
+
16
+ ```jsx
17
+ import { ScheduleCard } from "../components/blocks/schedule-card"; // a Makersclaw app ("./blocks/schedule-card" from components/)
18
+ import { ScheduleCard } from "@/components/makersclaw/blocks/schedule-card"; // a shadcn project
19
+ ```
20
+
21
+ A client component. It formats nothing: every line comes in as words,
22
+ so the screen says "Next: Wed 30 Sep, 07:00" in the app's voice. Its own
23
+ width decides its layout: under about 320 px the next run and Run now
24
+ stack, the button full width.
25
+
26
+ ## Props
27
+
28
+ - `title` — "Morning read". `icon` — a kit `Icon` name (default
29
+ `"clock"`).
30
+ - `state` — `{ tone, words }`. `tone` is `ok` · `failed` · `running` ·
31
+ `off` · `none`; `words` "Ran 07:02", "Didn't run", "Reading now",
32
+ "Off", "Not set up". Each tone has its own mark, so the state is never
33
+ told by colour alone.
34
+ - `summary` — what the last run did, one or two lines. A failed run's
35
+ summary is the reason, in plain words.
36
+ - `cost` — this run's cost, in words ("640 credits").
37
+ - `allowance` — `{ used, of, words }`: the week's credits as a bar, in
38
+ the danger tone once full.
39
+ - `next` — "Next: Wed 30 Sep, 07:00".
40
+ - `run` — `{ label, price, onRun, loading, disabled, why }`: Run now,
41
+ its price muted inside the button ("Read now · about 700 cr"). `why`
42
+ is the button's title when it is disabled. Leave `run` out where the
43
+ member may not run the job.
44
+ - `enabled`, `onToggle(next)` — the on/off switch. Drawn only when
45
+ `onToggle` is given; leave it out where the member may not switch the
46
+ job. `toggleLabel` — its words (default "On" / "Off"). `toggleBusy` —
47
+ the press is out.
48
+ - `href` — the job's page. The whole card opens it (the chevron is a stretched link over the card); the switch, the Run button and any link or button in `children` keep their own press.
49
+ - `children` — more under the summary: a reason, a link to the desk.
50
+ - `className` — layout around it. Never colour.
51
+
52
+ ## useJobs (lib/hooks.js)
53
+
54
+ ```js
55
+ const { jobs, budget, may, busy, runNow, setEnabled } = useJobs();
56
+ ```
57
+
58
+ It reads `GET _claw/jobs`: each job's `id`, `name`, `does`, `words` (the
59
+ schedule in words, "Weekdays at 07:00"), `enabled`, `next_run_at`,
60
+ `last_run` (`{ id, status, ended_at }`), `plan`; the week's `budget`
61
+ (`{ week_cap_credits, week_used_credits }`, or null with no cap); and
62
+ `may` (`{ run, switch, pause }`). `runNow(id)` posts `_claw/run`,
63
+ `setEnabled(id, on)` patches `_claw/jobs/<id>`; both look again after.
64
+ `busy[id]` is `"run"` or `"switch"` while a press is out. It looks every
65
+ 30 s, every 5 s while a run is going, and not at all while the page is
66
+ hidden. On a claw from before the door it is `unavailable`: show the
67
+ card's quiet "Not set up", never an error.
68
+
69
+ ## Who may do what
70
+
71
+ - Anyone who opens the app reads the card.
72
+ - **Run now** and **the switch**: the app's owner, a workspace owner or
73
+ an admin — `may.run` and `may.switch`. Pass `run` and `onToggle` only
74
+ when they are true. The door refuses the others anyway; a hidden
75
+ button is never the guard.
76
+
77
+ ## Never
78
+
79
+ - Never Run now without its price on the button: the press spends.
80
+ - Never an Approve: a run that needs the member's yes waits for it on
81
+ the desk.
82
+ - Never change the schedule's time here: that is the window's Settings ›
83
+ Schedule.
84
+ - Never a colour of your own: the app's theme paints it.
85
+
86
+ ## Example
87
+
88
+ ```jsx
89
+ "use client";
90
+ import { useJobs } from "../lib/hooks";
91
+ import { ScheduleCard } from "../components/blocks/schedule-card";
92
+
93
+ const when = (iso) => (iso ? new Date(iso).toLocaleString("en-GB", { weekday: "short", day: "numeric", month: "short", hour: "2-digit", minute: "2-digit" }) : null);
94
+
95
+ export default function MorningRead() {
96
+ const { jobs, budget, may, busy, runNow, setEnabled } = useJobs();
97
+ const job = jobs.find((j) => j.name === "Morning read");
98
+ if (!job) return null;
99
+ const last = job.last_run;
100
+ return (
101
+ <ScheduleCard
102
+ title={job.name}
103
+ icon="sun"
104
+ state={
105
+ !job.enabled ? { tone: "off", words: "Off" }
106
+ : !last ? { tone: "none", words: "Not run yet" }
107
+ : last.status === "running" ? { tone: "running", words: "Reading now" }
108
+ : last.status === "failed" ? { tone: "failed", words: "Didn't run" }
109
+ : { tone: "ok", words: `Ran ${when(last.ended_at)}` }
110
+ }
111
+ summary={job.does}
112
+ allowance={budget && { used: budget.week_used_credits, of: budget.week_cap_credits, words: `${budget.week_used_credits} of ${budget.week_cap_credits} credits this week` }}
113
+ next={job.enabled && job.next_run_at ? `Next: ${when(job.next_run_at)}` : null}
114
+ run={may.run ? { label: "Read now", price: "about 700 cr", onRun: () => runNow(job.id), loading: busy[job.id] === "run" } : undefined}
115
+ enabled={job.enabled}
116
+ onToggle={may.switch ? (on) => setEnabled(job.id, on) : undefined}
117
+ toggleBusy={busy[job.id] === "switch"}
118
+ />
119
+ );
120
+ }
121
+ ```
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "schedule-card",
3
+ "title": "ScheduleCard",
4
+ "description": "One scheduled job of the app's agent on a card: its name, how its last run went as a mark and words (Ran 07:02, Didn't run, Reading now, Off, Not set up), one line of what it did, this run's cost and the week's credits against the allowance as a bar, when it runs next, Run now with its price on the button, and an on/off switch. It draws what useJobs() returns (lib/hooks.js, GET _claw/jobs); Run now and the switch show only where the door says the member may press them. Its own width decides its layout.",
5
+ "useWhen": "Superseded by automation-list for an app whose jobs run on the automations engine; still the block for an app that has not moved (its jobs are the agent's wakes). An app whose agent runs on a schedule shows that job beside the day's work: a CRM's morning read on Today, a nightly import, a weekly report, an inbox checked every 15 minutes. For the runs themselves use run-history; for the job drawn as a graph with its runs use workflow-view; for one ask in progress use job-panel.",
6
+ "tags": ["schedule", "job", "automation", "agent", "run now", "next run", "cron", "credits", "allowance", "cost", "switch", "enabled", "status", "kit"],
7
+ "exports": ["ScheduleCard"],
8
+ "files": ["index.js", "schedule-card.jsx"],
9
+ "requires": []
10
+ }
@@ -0,0 +1,82 @@
1
+ "use client";
2
+
3
+ // ScheduleCard with pretend jobs — the gallery's and the smoke test's
4
+ // surface. Not installed into apps. Four states: a job that ran, one that
5
+ // is reading now, one that did not run (the allowance spent), and one not
6
+ // set up yet; at 320, 368 and 800 px so the layout by its own width
7
+ // shows. The switch and Run now answer after a moment.
8
+ import { useState } from "react";
9
+ import { ScheduleCard } from "../components/blocks/schedule-card";
10
+
11
+ function useJob(initial) {
12
+ const [on, setOn] = useState(initial);
13
+ const [busy, setBusy] = useState(null);
14
+ const press = (what, then) => {
15
+ setBusy(what);
16
+ setTimeout(() => {
17
+ then?.();
18
+ setBusy(null);
19
+ }, 700);
20
+ };
21
+ return { on, busy, toggle: (next) => press("switch", () => setOn(next)), run: () => press("run") };
22
+ }
23
+
24
+ export default function ScheduleCardDemo() {
25
+ const read = useJob(true);
26
+ const inbox = useJob(true);
27
+ const report = useJob(false);
28
+ return (
29
+ <div className="grid gap-6 p-4">
30
+ <div className="flex flex-wrap items-start gap-4">
31
+ <ScheduleCard
32
+ className="w-full max-w-[320px]"
33
+ title="Morning read"
34
+ icon="sun"
35
+ href="#"
36
+ state={read.on ? { tone: "ok", words: "Ran 07:02" } : { tone: "off", words: "Off" }}
37
+ summary="Read 38 emails and 3 meetings from Mon 28 Sep. Found 4 people, 3 details and 1 deal move."
38
+ cost="640 credits"
39
+ allowance={{ used: 4180, of: 10000, words: "4,180 of 10,000 this week" }}
40
+ next={read.on ? "Next: Wed 30 Sep, 07:00" : "Off: it runs again once switched on"}
41
+ run={{ label: "Read now", price: "about 700 cr", onRun: read.run, loading: read.busy === "run" }}
42
+ enabled={read.on}
43
+ onToggle={read.toggle}
44
+ toggleBusy={read.busy === "switch"}
45
+ />
46
+ <ScheduleCard
47
+ className="w-full max-w-[368px]"
48
+ title="Inbox sweep"
49
+ icon="inbox"
50
+ state={{ tone: "running", words: "Reading now · 12 of 40" }}
51
+ summary="Every 15 minutes: files new mail under its deal and drafts a reply where one is owed."
52
+ cost="about 90 credits a run"
53
+ next="Next: 10:45"
54
+ run={{ label: "Run now", price: "about 90 cr", disabled: true, why: "It is running now" }}
55
+ enabled={inbox.on}
56
+ onToggle={inbox.toggle}
57
+ toggleBusy={inbox.busy === "switch"}
58
+ />
59
+ </div>
60
+ <div className="flex flex-wrap items-start gap-4">
61
+ <ScheduleCard
62
+ className="w-full max-w-[800px]"
63
+ title="Friday review"
64
+ icon="calendar"
65
+ state={{ tone: "failed", words: "Didn't run" }}
66
+ summary="Fri 07:00 · The week's 10,000 credits were spent by Thursday. Nothing was read and nothing was charged."
67
+ allowance={{ used: 10000, of: 10000, words: "10,000 of 10,000 credits this week · back Monday" }}
68
+ next="Next: Fri 9 Oct, 07:00"
69
+ enabled={report.on}
70
+ onToggle={report.toggle}
71
+ toggleBusy={report.busy === "switch"}
72
+ />
73
+ <ScheduleCard
74
+ className="w-full max-w-[320px]"
75
+ title="Weekly digest"
76
+ state={{ tone: "none", words: "Not set up" }}
77
+ summary="It starts once a mailbox is connected."
78
+ />
79
+ </div>
80
+ </div>
81
+ );
82
+ }
@@ -0,0 +1,3 @@
1
+ // The ScheduleCard block — `makersclaw add schedule-card`. Fixed: compose
2
+ // it through its props (README.md beside this file).
3
+ export { ScheduleCard } from "./schedule-card";