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,452 @@
1
+ "use client";
2
+
3
+ // The Automations page of an app, as one block. The places a member goes:
4
+ //
5
+ // the list every automation as a row that opens whole, a switch,
6
+ // New automation (starting points, Describe it), the
7
+ // week's allowance once, and the app's own slots
8
+ // New a new one in the editor; not saved until Create
9
+ // one automation its flow, edited, tested, kept and switched on;
10
+ // its Runs; the app's own tabs
11
+ // one run step by step, with the run's controls and the
12
+ // agent's fixes
13
+ //
14
+ // It composes `automation-list`, `automation-editor`, `run-view` and `cost`,
15
+ // and decides only what they leave open: which place is showing (and how it
16
+ // travels in a URL), Back to where the member WAS (the list with its search,
17
+ // the Runs tab a run was opened from), what each editor is handed (the
18
+ // platform's triggers, the webhook, the version a save began on), a delete
19
+ // that asks first and can be undone, "Describe it", and the old schedule an
20
+ // app has not updated yet (read-only).
21
+ //
22
+ // It reads nothing itself. The engine's hooks come in as `hooks`; a block may
23
+ // not import lib/. Every wire is a prop; none given, the page still draws.
24
+
25
+ import { useCallback, useMemo, useRef, useState } from "react";
26
+ import { AppLayout, Button, Notice, Skeleton, Tabs, toast } from "../../ui";
27
+ import { AutomationList } from "../automation-list";
28
+ import { AutomationEditor } from "../automation-editor";
29
+ import { RunView, RunsList } from "../run-view";
30
+ import { STARTING_POINTS, blankAutomation, keyFromName, startsFromPlatform } from "../automation-model";
31
+ import { Allowance } from "../cost";
32
+ import { FLOW, NEW, RUNS, backFrom, combineStarts, deletedWords, hooksProblem, normalizePlace, originAfter, tabsOf } from "./screen-model";
33
+
34
+ const FILL = "flex min-h-0 flex-1 flex-col";
35
+ const LIST = normalizePlace(null);
36
+ const UNDO_MS = 8000;
37
+ const LEGACY_WORDS = "This one is the app's older schedule. Its steps come with the next update of the app; until then you can switch it on or off and run it.";
38
+ const UNAVAILABLE_WORDS = "Automations are not set up on this Makersclaw yet.";
39
+
40
+ /** A slot is a node, or a function that gets what it may need and returns one. */
41
+ const slot = (s, arg) => (typeof s === "function" ? s(arg) : s ?? null);
42
+
43
+ /** The frame when the app gives none: the kit's AppLayout, filling the slot it is in. */
44
+ function defaultFrame({ label, fill, children }) {
45
+ return (
46
+ <AppLayout height="parent" contentLabel={label} contentMode={fill ? "fill" : "scroll"}>
47
+ {children}
48
+ </AppLayout>
49
+ );
50
+ }
51
+
52
+ function Said({ children, onBack, back = "Back to the automations" }) {
53
+ return (
54
+ <div className="grid content-start justify-items-start gap-3 p-5 text-sm">
55
+ <p className="m-0 text-muted-foreground">{children}</p>
56
+ {onBack ? (
57
+ <Button size="sm" variant="secondary" icon="arrow-left" onClick={onBack}>
58
+ {back}
59
+ </Button>
60
+ ) : null}
61
+ </div>
62
+ );
63
+ }
64
+
65
+ /* ---- the list ---------------------------------------------------------- */
66
+
67
+ function ListPage({ c }) {
68
+ const { list } = c;
69
+ const unavailable = Boolean(list.unavailable);
70
+ const waiting = list.loading && list.automations.length === 0 && !list.error && !unavailable;
71
+ const failed = !unavailable && !list.loading && list.automations.length === 0 && Boolean(list.error);
72
+ const ready = !unavailable && !waiting && !failed;
73
+ const a = c.allowance;
74
+ const body = (
75
+ <div className="@container grid min-w-0 content-start">
76
+ {a ? (
77
+ <div className="px-4 pt-4">
78
+ <Allowance used={a.used} of={a.of} words={a.words} title={null} className="max-w-md" />
79
+ </div>
80
+ ) : null}
81
+ {unavailable ? (
82
+ <p className="m-0 p-4 text-sm text-muted-foreground">{c.unavailableWords}</p>
83
+ ) : waiting ? (
84
+ <div aria-busy="true" aria-label="Loading the automations" className="grid gap-2 p-4">
85
+ <Skeleton className="h-6 w-1/3" />
86
+ <Skeleton shape="rect" className="h-16 w-full" />
87
+ <Skeleton shape="rect" className="h-16 w-full" />
88
+ <Skeleton shape="rect" className="h-16 w-full" />
89
+ </div>
90
+ ) : failed ? (
91
+ <div className="p-4">
92
+ <Notice tone="danger" title="The automations did not load." action={<Button size="sm" onClick={() => list.reload?.()}>Try again</Button>}>
93
+ Nothing was changed. Try again in a moment.
94
+ </Notice>
95
+ </div>
96
+ ) : (
97
+ <AutomationList
98
+ rows={list.automations}
99
+ grouped={false}
100
+ title={c.title}
101
+ intro={c.intro}
102
+ now={c.now}
103
+ starts={c.startList}
104
+ query={c.query}
105
+ onQueryChange={c.setQuery}
106
+ onOpen={(id) => c.go({ automation: id })}
107
+ onNew={(start) => c.go({ automation: NEW, ...(start ? { start: start.id } : {}) })}
108
+ onToggle={c.toggle}
109
+ canToggle={c.canToggle}
110
+ canCreate={c.canCreate}
111
+ canDelete={c.canDelete}
112
+ {...(c.remove ? { onDelete: (row) => c.remove(row.id) } : {})}
113
+ {...(c.describe ? { onDescribe: c.describe, describePrice: c.describePrice, describeChips: c.describeChips } : {})}
114
+ />
115
+ )}
116
+ {ready && c.onRequest ? <div className="px-4 pb-4">{slot(c.onRequest, { automations: list.automations })}</div> : null}
117
+ {ready && c.extras ? <div className="px-4 pb-4">{slot(c.extras, { automations: list.automations })}</div> : null}
118
+ </div>
119
+ );
120
+ return c.render([{ label: c.title }], c.title, false, body);
121
+ }
122
+
123
+ /* ---- one automation ---------------------------------------------------- */
124
+
125
+ function OnePage({ c, id, runId, tab }) {
126
+ const { hooks, go, list } = c;
127
+ const a = hooks.useAutomation(id, c.every ? { every: c.every } : undefined);
128
+ const run = hooks.useAutomationRun(runId);
129
+ const root = { label: c.title, href: c.hrefOf?.(LIST), onPress: () => go({}) };
130
+ const crumb = [root, { label: a.automation?.name ?? "Automation" }];
131
+ const toList = () => go({});
132
+
133
+ if (a.unavailable) return c.render(crumb, "Automation", false, <Said>{c.unavailableWords}</Said>);
134
+ if (!a.automation || !a.definition) {
135
+ const gone = a.code === "not_found";
136
+ return c.render(
137
+ crumb,
138
+ "Automation",
139
+ false,
140
+ a.error ? <Said onBack={toList}>{gone ? "That automation is not there any more." : "That automation could not be opened."}</Said> : <Said>Opening…</Said>,
141
+ );
142
+ }
143
+
144
+ const au = a.automation;
145
+ const legacy = au.source === "legacy";
146
+ const tabList = tabsOf(c.extraTabs, au);
147
+ // The app's own tab pressed (tabsOf keeps only the keys and labels the strip needs).
148
+ const extra = tab !== FLOW && tab !== RUNS && tabList.some((t) => t.key === tab) ? (c.extraTabs ?? []).find((t) => t && t.key === tab) ?? null : null;
149
+ const here = (t) => (t === FLOW ? { automation: id } : { automation: id, tab: t });
150
+ const tabs = <Tabs value={extra ? tab : tab === RUNS ? RUNS : FLOW} onChange={(t) => go(here(t))} aria-label="This automation" tabs={tabList} className="border-b-0" />;
151
+ const ctx = { automation: au, definition: a.definition, tab, runId, go };
152
+
153
+ let body;
154
+ let fill = true;
155
+ if (runId) {
156
+ fill = Boolean(run.detail);
157
+ if (!run.detail) {
158
+ body = run.error ? <Said onBack={() => go(here(RUNS))} back="Back to the runs">That run could not be opened.</Said> : <Said>Opening the run…</Said>;
159
+ } else {
160
+ body = (
161
+ <>
162
+ <div className={FILL}>
163
+ <RunView
164
+ def={run.definition ?? a.definition}
165
+ versionNote={run.definition ? null : `This run used version ${run.run?.version}. The steps drawn are the current ones.`}
166
+ detail={run.detail}
167
+ runs={a.runs}
168
+ apps={c.apps}
169
+ tz={au.tz}
170
+ actions={c.actions}
171
+ ownedByApp={c.ownedByApp}
172
+ tabs={tabs}
173
+ name={au.name}
174
+ onBack={() => go(backFrom({ automation: id, run: runId }, c.origin.current))}
175
+ onPickRun={(r) => go({ automation: id, run: r })}
176
+ onRunAgain={async () => {
177
+ const r = await a.test({ dry: run.run?.dry === true });
178
+ if (r.ok) go({ automation: id, run: r.data.run_id });
179
+ }}
180
+ onControl={run.control}
181
+ controlBusy={run.busy}
182
+ onKeepFix={run.keepFix}
183
+ onDropFix={run.dropFix}
184
+ />
185
+ </div>
186
+ {slot(c.afterRun, { ...ctx, run: run.detail.run })}
187
+ </>
188
+ );
189
+ }
190
+ } else if (extra) {
191
+ fill = false;
192
+ body = (
193
+ <div>
194
+ <div className="px-4 pt-3">{tabs}</div>
195
+ {extra.render?.(ctx) ?? null}
196
+ </div>
197
+ );
198
+ } else if (tab === RUNS) {
199
+ fill = false;
200
+ body = (
201
+ <div>
202
+ <div className="px-4 pt-3">{tabs}</div>
203
+ <RunsList runs={a.runs} tz={au.tz} onOpen={(r) => go({ automation: id, run: r })} />
204
+ </div>
205
+ );
206
+ } else {
207
+ body = (
208
+ <div className={FILL}>
209
+ <AutomationEditor
210
+ key={id}
211
+ automationId={id}
212
+ status={au.status}
213
+ liveVersion={au.live_version}
214
+ draftVersion={au.draft_version}
215
+ baseline={a.definition}
216
+ versions={a.versions}
217
+ runs={a.runs}
218
+ estimate={a.estimate}
219
+ tests={a.tests}
220
+ apps={c.apps}
221
+ actions={c.actions}
222
+ runnable={c.runnable}
223
+ ownedByApp={c.ownedByApp}
224
+ triggers={list.triggers}
225
+ selfKey={au.key}
226
+ hook={a.hook}
227
+ onRotateHook={a.rotateHook}
228
+ source={au.source}
229
+ canEdit={!legacy}
230
+ canDelete={c.canDelete}
231
+ compareTo={a.live ? { version: a.live.version, definition: a.live.definition } : null}
232
+ tabs={tabs}
233
+ onBack={toList}
234
+ onSave={a.save}
235
+ onKeep={a.keep}
236
+ onLive={a.setLive}
237
+ onTest={async (inputs) => {
238
+ const r = await a.test({ inputs });
239
+ if (r.ok) go({ automation: id, run: r.data.run_id });
240
+ return r;
241
+ }}
242
+ onOpenRun={(r) => go({ automation: id, run: r })}
243
+ suggestions={a.suggestions}
244
+ onKeepSuggestion={a.keepSuggestion}
245
+ onDropSuggestion={a.dropSuggestion}
246
+ onFocus={c.onFocus}
247
+ {...(c.remove
248
+ ? {
249
+ onDelete: async () => {
250
+ const r = await c.remove(id, au.name);
251
+ if (r.ok) toList();
252
+ return r;
253
+ },
254
+ }
255
+ : {})}
256
+ />
257
+ </div>
258
+ );
259
+ }
260
+
261
+ const above = slot(c.aboveOne, { ...ctx, run: run.detail?.run ?? null });
262
+ const label = au.name;
263
+ const framed = (
264
+ <div className={fill ? "flex h-full min-h-0 flex-col" : undefined}>
265
+ {legacy && c.legacyWords ? (
266
+ <div className="px-4 pt-3">
267
+ <Notice tone="info">{c.legacyWords}</Notice>
268
+ </div>
269
+ ) : null}
270
+ {above ? <div className="px-4 pt-3">{above}</div> : null}
271
+ {body}
272
+ </div>
273
+ );
274
+ return c.render(crumb, label, fill, framed);
275
+ }
276
+
277
+ /* ---- a new one --------------------------------------------------------- */
278
+
279
+ function NewPage({ c, start }) {
280
+ const { go, list } = c;
281
+ const taken = new Set(list.automations.map((x) => x.key));
282
+ const picked = c.startList.find((s) => s.id === start);
283
+ const crumb = [{ label: c.title, href: c.hrefOf?.(LIST), onPress: () => go({}) }, { label: "New automation" }];
284
+ const body = (
285
+ <div className="flex h-full min-h-0 flex-col">
286
+ <AutomationEditor
287
+ key={start ?? "blank"}
288
+ automationId={null}
289
+ status="new"
290
+ baseline={picked ? picked.build(taken) : blankAutomation("", keyFromName("New automation", taken))}
291
+ apps={c.apps}
292
+ actions={c.actions}
293
+ runnable={c.runnable}
294
+ ownedByApp={c.ownedByApp}
295
+ triggers={list.triggers}
296
+ onFocus={c.onFocus}
297
+ onBack={() => go({})}
298
+ onSave={async (def) => {
299
+ const r = await list.create({ ...def, key: keyFromName(def.name, taken) });
300
+ if (r.ok) go({ automation: r.data.id });
301
+ return r;
302
+ }}
303
+ />
304
+ </div>
305
+ );
306
+ return c.render(crumb, "New automation", true, body);
307
+ }
308
+
309
+ /* ---- the screen -------------------------------------------------------- */
310
+
311
+ export function AutomationsScreen({
312
+ hooks,
313
+ place: placeProp,
314
+ onPlace,
315
+ query: queryProp,
316
+ onQueryChange,
317
+ title = "Automations",
318
+ intro = "What this app does on its own. Open one to see its steps, change them, test it and switch it on.",
319
+ starts,
320
+ actions,
321
+ apps,
322
+ runnable,
323
+ ownedByApp = true,
324
+ allowance = null,
325
+ onRequest,
326
+ extras,
327
+ extraTabs,
328
+ aboveOne,
329
+ afterRun,
330
+ frame,
331
+ hrefOf,
332
+ onDescribe,
333
+ describePrice,
334
+ describeChips,
335
+ onToggled,
336
+ canToggle = true,
337
+ canCreate = true,
338
+ canDelete = true,
339
+ onFocus,
340
+ every,
341
+ legacyWords = LEGACY_WORDS,
342
+ unavailableWords = UNAVAILABLE_WORDS,
343
+ now,
344
+ }) {
345
+ const problem = hooksProblem(hooks);
346
+ if (problem) return <Notice tone="danger">{problem}</Notice>;
347
+ return (
348
+ <Screen
349
+ {...{ hooks, placeProp, onPlace, queryProp, onQueryChange, title, intro, starts, actions, apps, runnable, ownedByApp, allowance, onRequest, extras, extraTabs, aboveOne, afterRun, frame, hrefOf, onDescribe, describePrice, describeChips, onToggled, canToggle, canCreate, canDelete, onFocus, every, legacyWords, unavailableWords, now }}
350
+ />
351
+ );
352
+ }
353
+
354
+ function Screen(p) {
355
+ const { hooks, placeProp, onPlace, queryProp, onQueryChange } = p;
356
+ // The place: the app's (a URL, say) when it passes one, else held here.
357
+ const controlled = placeProp !== undefined && placeProp !== null;
358
+ const [held, setHeld] = useState(LIST);
359
+ const place = normalizePlace(controlled ? placeProp : held);
360
+ const at = useRef(place);
361
+ at.current = place;
362
+ // Where a run was opened from, so Back returns there.
363
+ const origin = useRef(null);
364
+ const go = useCallback(
365
+ (next) => {
366
+ const to = normalizePlace(next);
367
+ origin.current = originAfter(at.current, to, origin.current);
368
+ at.current = to;
369
+ if (!controlled) setHeld(to);
370
+ onPlace?.(to);
371
+ },
372
+ [controlled, onPlace],
373
+ );
374
+ // The words in the list's search box outlive the automation that was opened.
375
+ const [typed, setTyped] = useState("");
376
+ const query = typeof queryProp === "string" ? queryProp : typed;
377
+ const setQuery = useCallback(
378
+ (t) => {
379
+ setTyped(t);
380
+ onQueryChange?.(t);
381
+ },
382
+ [onQueryChange],
383
+ );
384
+
385
+ const list = hooks.useAutomations(p.every ? { every: p.every } : undefined);
386
+ const platform = useMemo(() => startsFromPlatform(list.starts), [list.starts]);
387
+ const startList = useMemo(() => combineStarts(p.starts, platform, STARTING_POINTS), [p.starts, platform]);
388
+
389
+ const { deleteAutomation, restoreAutomation } = hooks;
390
+ const reload = list.reload;
391
+ // A delete that asks first (the blocks do) and can be taken back for a while.
392
+ const remove = useMemo(() => {
393
+ if (typeof deleteAutomation !== "function") return null;
394
+ return async (id, name = "") => {
395
+ const r = await deleteAutomation(id);
396
+ if (!r.ok) return { ok: false, error: r.error || "That did not work.", code: r.code };
397
+ const done = r.data && typeof r.data === "object" ? r.data : {};
398
+ reload?.();
399
+ const said = deletedWords({ id, ...done }, name);
400
+ toast(said.title, {
401
+ ...(said.detail ? { description: said.detail } : {}),
402
+ duration: UNDO_MS,
403
+ ...(said.undo && typeof restoreAutomation === "function"
404
+ ? {
405
+ action: {
406
+ label: "Undo",
407
+ onClick: async () => {
408
+ const back = await restoreAutomation(done.id ?? id);
409
+ if (back.ok) reload?.();
410
+ else toast.error(back.error || "It could not be brought back.");
411
+ },
412
+ },
413
+ }
414
+ : {}),
415
+ });
416
+ return { ok: true };
417
+ };
418
+ }, [deleteAutomation, restoreAutomation, reload]);
419
+
420
+ const { setStatus } = list;
421
+ const { onToggled } = p;
422
+ const toggle = useCallback(
423
+ async (row, on) => {
424
+ const r = await setStatus(row.id, on);
425
+ if (!r.ok) throw new Error(r.error || "That did not work.");
426
+ await onToggled?.(row, on);
427
+ },
428
+ [setStatus, onToggled],
429
+ );
430
+
431
+ const { onDescribe } = p;
432
+ const describe = onDescribe === "platform" ? (ask) => list.describe(ask) : typeof onDescribe === "function" ? onDescribe : null;
433
+
434
+ const render = (crumb, label, fill, children) => (p.frame ?? defaultFrame)({ crumb, label, fill, children });
435
+ const c = {
436
+ ...p,
437
+ list,
438
+ startList,
439
+ go,
440
+ origin,
441
+ query,
442
+ setQuery,
443
+ remove,
444
+ toggle,
445
+ describe,
446
+ render,
447
+ };
448
+
449
+ if (place.automation === NEW) return <NewPage c={c} start={place.start} />;
450
+ if (place.automation) return <OnePage key={place.automation} c={c} id={place.automation} runId={place.run} tab={place.tab} />;
451
+ return <ListPage c={c} />;
452
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "automations-screen",
3
+ "title": "AutomationsScreen",
4
+ "description": "The whole Automations page of an app as ONE block. The places a member goes: the list (every automation as a row that opens whole, a switch, New automation with starting points and Describe it, the week's allowance shown once, a slot for jobs that run on request and one for the app's own extras); a new automation in the editor; one automation (its flow, edited, tested, kept and switched on; its Runs; the app's own tabs); and one run, step by step with the run's controls and the agent's fixes. It composes automation-list, automation-editor, run-view and cost, and decides what they leave open: which place is showing and how it travels in a page address (placeFromParams, paramsOfPlace), Back to where the member WAS (the list with the words in its search box, the Runs tab a run was opened from), a save that names the version the copy began on, a delete that asks first and can be undone for a few seconds, the platform's triggers and webhook handed to both editors, Describe it (to the platform, or handed on to the agent beside the page), and an older schedule an app has not updated yet shown read-only. It reads nothing itself: the engine's hooks come in as a hooks prop.",
5
+ "useWhen": "An app has jobs that run on the automations engine and needs its Automations page: the list, the editor, the runs and a run, in the app's theme. One component, one source, so a fix to this page reaches every app through update. The app adds only what is its own: the allowance, jobs a press or an ask starts, extra tabs on an automation, a notice above one, its own starting points and its declared actions.",
6
+ "tags": [
7
+ "automation",
8
+ "automations",
9
+ "page",
10
+ "screen",
11
+ "workflow",
12
+ "builder",
13
+ "jobs",
14
+ "schedule",
15
+ "runs",
16
+ "run",
17
+ "editor",
18
+ "list",
19
+ "describe it",
20
+ "starting points",
21
+ "allowance",
22
+ "delete",
23
+ "undo",
24
+ "n8n",
25
+ "make",
26
+ "zapier"
27
+ ],
28
+ "exports": [
29
+ "AutomationsScreen",
30
+ "deletedWords",
31
+ "normalizePlace",
32
+ "paramsOfPlace",
33
+ "placeFromParams"
34
+ ],
35
+ "files": [
36
+ "index.js",
37
+ "automations-screen.jsx",
38
+ "screen-model.js"
39
+ ],
40
+ "requires": [
41
+ "automation-editor",
42
+ "automation-list",
43
+ "automation-model",
44
+ "cost",
45
+ "run-view"
46
+ ]
47
+ }