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.
- package/README.md +17 -4
- package/package.json +1 -1
- package/r/activity-log.json +52 -0
- package/r/agent-changes.json +51 -0
- package/r/agent-chat.json +53 -0
- package/r/agent-column.json +85 -0
- package/r/agent-dock.json +57 -0
- package/r/agent-kit.json +49 -0
- package/r/agent-marks.json +49 -0
- package/r/agent-pane.json +93 -0
- package/r/ai-action.json +56 -0
- package/r/annotate.json +4 -4
- package/r/approval-request.json +2 -2
- package/r/approval.json +54 -0
- package/r/ask-bar.json +50 -0
- package/r/audio-player.json +2 -2
- package/r/auth-form.json +2 -2
- package/r/automation-editor.json +66 -0
- package/r/automation-list.json +57 -0
- package/r/automation-model.json +118 -0
- package/r/automations-screen.json +71 -0
- package/r/board.json +2 -2
- package/r/calendar-view.json +3 -3
- package/r/cart.json +2 -2
- package/r/chart.json +5 -5
- package/r/chat-pane.json +84 -0
- package/r/chat.json +3 -3
- package/r/code-editor.json +2 -2
- package/r/comment-box.json +3 -3
- package/r/connect-card.json +51 -0
- package/r/contact-section.json +2 -2
- package/r/core.json +18 -6
- package/r/cost.json +51 -0
- package/r/csv-import.json +3 -3
- package/r/data-picker.json +60 -0
- package/r/data-table.json +2 -2
- package/r/diagram.json +2 -2
- package/r/doc-editor.json +2 -2
- package/r/doc-page.json +3 -3
- package/r/email-render.json +2 -2
- package/r/faq.json +2 -2
- package/r/file-upload.json +2 -2
- package/r/first-run.json +63 -0
- package/r/fix-note.json +57 -0
- package/r/flow-canvas.json +3 -3
- package/r/flow-editor.json +79 -0
- package/r/footer.json +3 -3
- package/r/gantt.json +3 -3
- package/r/job-panel.json +2 -2
- package/r/json-editor.json +3 -3
- package/r/library-shelf.json +56 -0
- package/r/map.json +2 -2
- package/r/margin-notes.json +67 -0
- package/r/menubar.json +2 -2
- package/r/mind-map.json +4 -4
- package/r/navigation-menu.json +2 -2
- package/r/needs-you.json +55 -0
- package/r/order-detail.json +2 -2
- package/r/org-chart.json +4 -4
- package/r/pace-bar.json +69 -0
- package/r/page-builder.json +3 -3
- package/r/payment-methods.json +2 -2
- package/r/pdf-document.json +2 -2
- package/r/pdf-viewer.json +3 -3
- package/r/product-detail.json +2 -2
- package/r/product-grid.json +3 -3
- package/r/record-form.json +2 -2
- package/r/record-grid.json +52 -0
- package/r/record-notes.json +4 -4
- package/r/registry.json +4089 -1510
- package/r/run-history.json +52 -0
- package/r/run-view.json +80 -0
- package/r/schedule-card.json +54 -0
- package/r/schedule-engine.json +79 -0
- package/r/schedule-gantt.json +83 -0
- package/r/schedule-ruler.json +64 -0
- package/r/search-dialog.json +2 -2
- package/r/settings-list.json +2 -2
- package/r/setup-checklist.json +2 -2
- package/r/share-dialog.json +2 -2
- package/r/sidebar.json +3 -3
- package/r/signature-pad.json +2 -2
- package/r/sketch-canvas.json +3 -3
- package/r/source-receipt.json +52 -0
- package/r/spreadsheet.json +3 -3
- package/r/stat-cards.json +3 -3
- package/r/step-picker.json +53 -0
- package/r/step-settings.json +72 -0
- package/r/suggestion.json +58 -0
- package/r/sum-bar.json +64 -0
- package/r/task-list.json +3 -3
- package/r/task-model.json +2 -2
- package/r/testimonials.json +2 -2
- package/r/tier-map.json +67 -0
- package/r/time-grid.json +73 -0
- package/r/time-strip.json +64 -0
- package/r/top-bar.json +66 -0
- package/r/transaction-list.json +2 -2
- package/r/trigger-picker.json +61 -0
- package/r/whiteboard.json +4 -4
- package/r/workflow-view.json +55 -0
- package/registry/blocks/activity-log/README.md +112 -0
- package/registry/blocks/activity-log/activity-log.jsx +351 -0
- package/registry/blocks/activity-log/block.json +33 -0
- package/registry/blocks/activity-log/demo.jsx +48 -0
- package/registry/blocks/activity-log/index.js +4 -0
- package/registry/blocks/agent-changes/README.md +94 -0
- package/registry/blocks/agent-changes/agent-changes.jsx +118 -0
- package/registry/blocks/agent-changes/block.json +28 -0
- package/registry/blocks/agent-changes/demo.jsx +39 -0
- package/registry/blocks/agent-changes/index.js +3 -0
- package/registry/blocks/agent-chat/README.md +145 -0
- package/registry/blocks/agent-chat/agent-chat.jsx +415 -0
- package/registry/blocks/agent-chat/block.json +30 -0
- package/registry/blocks/agent-chat/demo.jsx +165 -0
- package/registry/blocks/agent-chat/index.js +3 -0
- package/registry/blocks/agent-column/README.md +197 -0
- package/registry/blocks/agent-column/agent-column.jsx +492 -0
- package/registry/blocks/agent-column/block.json +67 -0
- package/registry/blocks/agent-column/column-picker.jsx +163 -0
- package/registry/blocks/agent-column/demo.jsx +50 -0
- package/registry/blocks/agent-column/index.js +7 -0
- package/registry/blocks/agent-column/model.js +164 -0
- package/registry/blocks/agent-column/receipt.jsx +483 -0
- package/registry/blocks/agent-column/spreadsheet-type.jsx +24 -0
- package/registry/blocks/agent-dock/README.md +210 -0
- package/registry/blocks/agent-dock/agent-dock.jsx +356 -0
- package/registry/blocks/agent-dock/block.json +47 -0
- package/registry/blocks/agent-dock/demo.jsx +153 -0
- package/registry/blocks/agent-dock/dock-model.js +118 -0
- package/registry/blocks/agent-dock/index.js +5 -0
- package/registry/blocks/agent-kit/README.md +73 -0
- package/registry/blocks/agent-kit/agent-kit.jsx +86 -0
- package/registry/blocks/agent-kit/block.json +10 -0
- package/registry/blocks/agent-kit/demo.jsx +35 -0
- package/registry/blocks/agent-kit/index.js +3 -0
- package/registry/blocks/agent-marks/README.md +80 -0
- package/registry/blocks/agent-marks/agent-marks.jsx +133 -0
- package/registry/blocks/agent-marks/block.json +27 -0
- package/registry/blocks/agent-marks/demo.jsx +49 -0
- package/registry/blocks/agent-marks/index.js +3 -0
- package/registry/blocks/agent-pane/README.md +225 -0
- package/registry/blocks/agent-pane/agent-pane.jsx +244 -0
- package/registry/blocks/agent-pane/block.json +41 -0
- package/registry/blocks/agent-pane/composer.jsx +6 -0
- package/registry/blocks/agent-pane/demo.jsx +233 -0
- package/registry/blocks/agent-pane/dock-context.js +10 -0
- package/registry/blocks/agent-pane/index.js +4 -0
- package/registry/blocks/agent-pane/prose.jsx +84 -0
- package/registry/blocks/agent-pane/questions.jsx +134 -0
- package/registry/blocks/agent-pane/transcript.jsx +268 -0
- package/registry/blocks/agent-pane/work.jsx +368 -0
- package/registry/blocks/ai-action/README.md +94 -0
- package/registry/blocks/ai-action/ai-action.jsx +188 -0
- package/registry/blocks/ai-action/block.json +34 -0
- package/registry/blocks/ai-action/demo.jsx +93 -0
- package/registry/blocks/ai-action/index.js +3 -0
- package/registry/blocks/annotate/README.md +14 -11
- package/registry/blocks/approval/README.md +145 -0
- package/registry/blocks/approval/approval.jsx +163 -0
- package/registry/blocks/approval/block.json +31 -0
- package/registry/blocks/approval/demo.jsx +121 -0
- package/registry/blocks/approval/index.js +3 -0
- package/registry/blocks/ask-bar/README.md +105 -0
- package/registry/blocks/ask-bar/ask-bar.jsx +166 -0
- package/registry/blocks/ask-bar/block.json +26 -0
- package/registry/blocks/ask-bar/demo.jsx +78 -0
- package/registry/blocks/ask-bar/index.js +3 -0
- package/registry/blocks/automation-editor/README.md +291 -0
- package/registry/blocks/automation-editor/automation-editor.jsx +656 -0
- package/registry/blocks/automation-editor/block.json +39 -0
- package/registry/blocks/automation-editor/demo.jsx +284 -0
- package/registry/blocks/automation-editor/index.js +4 -0
- package/registry/blocks/automation-editor/run-inputs.jsx +82 -0
- package/registry/blocks/automation-list/README.md +129 -0
- package/registry/blocks/automation-list/automation-list.jsx +476 -0
- package/registry/blocks/automation-list/block.json +35 -0
- package/registry/blocks/automation-list/demo.jsx +67 -0
- package/registry/blocks/automation-list/index.js +3 -0
- package/registry/blocks/automation-model/README.md +109 -0
- package/registry/blocks/automation-model/block.json +135 -0
- package/registry/blocks/automation-model/catalog.js +256 -0
- package/registry/blocks/automation-model/check.js +161 -0
- package/registry/blocks/automation-model/demo.jsx +42 -0
- package/registry/blocks/automation-model/edit.js +262 -0
- package/registry/blocks/automation-model/fixes.js +287 -0
- package/registry/blocks/automation-model/glyph.jsx +13 -0
- package/registry/blocks/automation-model/graph.js +410 -0
- package/registry/blocks/automation-model/index.js +33 -0
- package/registry/blocks/automation-model/overlay.js +175 -0
- package/registry/blocks/automation-model/parts.jsx +94 -0
- package/registry/blocks/automation-model/schedule.js +53 -0
- package/registry/blocks/automation-model/templates.js +128 -0
- package/registry/blocks/automation-model/values.js +29 -0
- package/registry/blocks/automation-model/words.js +439 -0
- package/registry/blocks/automations-screen/README.md +207 -0
- package/registry/blocks/automations-screen/automations-screen.jsx +452 -0
- package/registry/blocks/automations-screen/block.json +47 -0
- package/registry/blocks/automations-screen/demo.jsx +364 -0
- package/registry/blocks/automations-screen/index.js +4 -0
- package/registry/blocks/automations-screen/screen-model.js +129 -0
- package/registry/blocks/chart/cartesian.jsx +1 -1
- package/registry/blocks/chart/core.jsx +33 -23
- package/registry/blocks/chart/pie.jsx +1 -1
- package/registry/blocks/chat/README.md +4 -1
- package/registry/blocks/chat/demo.jsx +2 -2
- package/registry/blocks/chat-pane/README.md +143 -0
- package/registry/blocks/chat-pane/block.json +48 -0
- package/registry/blocks/chat-pane/chat-attach.js +166 -0
- package/registry/blocks/chat-pane/chat-composer.jsx +195 -0
- package/registry/blocks/chat-pane/chat-context.js +17 -0
- package/registry/blocks/chat-pane/chat-model.js +43 -0
- package/registry/blocks/chat-pane/chat-pane.jsx +398 -0
- package/registry/blocks/chat-pane/chats-list.jsx +52 -0
- package/registry/blocks/chat-pane/demo.jsx +103 -0
- package/registry/blocks/chat-pane/index.js +9 -0
- package/registry/blocks/connect-card/README.md +99 -0
- package/registry/blocks/connect-card/block.json +10 -0
- package/registry/blocks/connect-card/connect-card.jsx +103 -0
- package/registry/blocks/connect-card/demo.jsx +49 -0
- package/registry/blocks/connect-card/index.js +3 -0
- package/registry/blocks/cost/README.md +115 -0
- package/registry/blocks/cost/block.json +10 -0
- package/registry/blocks/cost/cost.jsx +176 -0
- package/registry/blocks/cost/demo.jsx +66 -0
- package/registry/blocks/cost/index.js +3 -0
- package/registry/blocks/data-picker/README.md +81 -0
- package/registry/blocks/data-picker/block.json +38 -0
- package/registry/blocks/data-picker/data-picker.jsx +210 -0
- package/registry/blocks/data-picker/demo.jsx +34 -0
- package/registry/blocks/data-picker/fields.js +89 -0
- package/registry/blocks/data-picker/index.js +4 -0
- package/registry/blocks/data-table/demo.jsx +1 -1
- package/registry/blocks/first-run/README.md +118 -0
- package/registry/blocks/first-run/block.json +11 -0
- package/registry/blocks/first-run/demo.jsx +88 -0
- package/registry/blocks/first-run/first-run-model.js +51 -0
- package/registry/blocks/first-run/first-run.jsx +156 -0
- package/registry/blocks/first-run/index.js +5 -0
- package/registry/blocks/first-run/probe-rules.js +26 -0
- package/registry/blocks/fix-note/README.md +79 -0
- package/registry/blocks/fix-note/block.json +35 -0
- package/registry/blocks/fix-note/demo.jsx +30 -0
- package/registry/blocks/fix-note/fix-note.jsx +235 -0
- package/registry/blocks/fix-note/index.js +3 -0
- package/registry/blocks/flow-canvas/README.md +15 -8
- package/registry/blocks/flow-editor/README.md +108 -0
- package/registry/blocks/flow-editor/block.json +44 -0
- package/registry/blocks/flow-editor/demo.jsx +115 -0
- package/registry/blocks/flow-editor/flow-canvas.jsx +568 -0
- package/registry/blocks/flow-editor/flow-editor.jsx +154 -0
- package/registry/blocks/flow-editor/index.js +6 -0
- package/registry/blocks/flow-editor/minimap.jsx +78 -0
- package/registry/blocks/flow-editor/outline.jsx +134 -0
- package/registry/blocks/footer/README.md +3 -2
- package/registry/blocks/library-shelf/README.md +117 -0
- package/registry/blocks/library-shelf/block.json +28 -0
- package/registry/blocks/library-shelf/demo.jsx +68 -0
- package/registry/blocks/library-shelf/index.js +3 -0
- package/registry/blocks/library-shelf/library-shelf.jsx +211 -0
- package/registry/blocks/library-shelf/probe-rules.js +15 -0
- package/registry/blocks/margin-notes/README.md +222 -0
- package/registry/blocks/margin-notes/block.json +10 -0
- package/registry/blocks/margin-notes/demo.jsx +144 -0
- package/registry/blocks/margin-notes/index.js +20 -0
- package/registry/blocks/margin-notes/margin-model.js +224 -0
- package/registry/blocks/margin-notes/margin-notes.jsx +465 -0
- package/registry/blocks/mind-map/README.md +4 -2
- package/registry/blocks/needs-you/README.md +177 -0
- package/registry/blocks/needs-you/block.json +34 -0
- package/registry/blocks/needs-you/demo.jsx +143 -0
- package/registry/blocks/needs-you/index.js +3 -0
- package/registry/blocks/needs-you/needs-you.jsx +441 -0
- package/registry/blocks/org-chart/README.md +4 -2
- package/registry/blocks/pace-bar/README.md +230 -0
- package/registry/blocks/pace-bar/block.json +10 -0
- package/registry/blocks/pace-bar/demo.jsx +255 -0
- package/registry/blocks/pace-bar/index.js +22 -0
- package/registry/blocks/pace-bar/pace-bar.jsx +461 -0
- package/registry/blocks/pace-bar/pace-model.js +288 -0
- package/registry/blocks/page-builder/README.md +1 -1
- package/registry/blocks/page-builder/demo.jsx +3 -3
- package/registry/blocks/pdf-viewer/README.md +4 -1
- package/registry/blocks/record-grid/README.md +100 -0
- package/registry/blocks/record-grid/block.json +28 -0
- package/registry/blocks/record-grid/demo.jsx +43 -0
- package/registry/blocks/record-grid/index.js +3 -0
- package/registry/blocks/record-grid/record-grid.jsx +251 -0
- package/registry/blocks/run-history/README.md +138 -0
- package/registry/blocks/run-history/block.json +10 -0
- package/registry/blocks/run-history/demo.jsx +74 -0
- package/registry/blocks/run-history/index.js +3 -0
- package/registry/blocks/run-history/run-history.jsx +218 -0
- package/registry/blocks/run-view/README.md +174 -0
- package/registry/blocks/run-view/block.json +50 -0
- package/registry/blocks/run-view/demo.jsx +286 -0
- package/registry/blocks/run-view/index.js +5 -0
- package/registry/blocks/run-view/run-controls.jsx +266 -0
- package/registry/blocks/run-view/run-view.jsx +236 -0
- package/registry/blocks/run-view/runs-list.jsx +99 -0
- package/registry/blocks/schedule-card/README.md +121 -0
- package/registry/blocks/schedule-card/block.json +10 -0
- package/registry/blocks/schedule-card/demo.jsx +82 -0
- package/registry/blocks/schedule-card/index.js +3 -0
- package/registry/blocks/schedule-card/schedule-card.jsx +136 -0
- package/registry/blocks/schedule-engine/README.md +137 -0
- package/registry/blocks/schedule-engine/block.json +10 -0
- package/registry/blocks/schedule-engine/demo.jsx +82 -0
- package/registry/blocks/schedule-engine/engine.js +769 -0
- package/registry/blocks/schedule-engine/index.js +9 -0
- package/registry/blocks/schedule-engine/ops.js +71 -0
- package/registry/blocks/schedule-engine/place.js +294 -0
- package/registry/blocks/schedule-engine/tree.js +79 -0
- package/registry/blocks/schedule-engine/waits.js +80 -0
- package/registry/blocks/schedule-gantt/README.md +159 -0
- package/registry/blocks/schedule-gantt/block.json +10 -0
- package/registry/blocks/schedule-gantt/demo.jsx +223 -0
- package/registry/blocks/schedule-gantt/gantt-model.js +219 -0
- package/registry/blocks/schedule-gantt/geometry.js +176 -0
- package/registry/blocks/schedule-gantt/index.js +26 -0
- package/registry/blocks/schedule-gantt/schedule-gantt.jsx +882 -0
- package/registry/blocks/schedule-gantt/sheet.jsx +372 -0
- package/registry/blocks/schedule-gantt/track.jsx +190 -0
- package/registry/blocks/schedule-ruler/README.md +148 -0
- package/registry/blocks/schedule-ruler/block.json +10 -0
- package/registry/blocks/schedule-ruler/demo.jsx +181 -0
- package/registry/blocks/schedule-ruler/index.js +21 -0
- package/registry/blocks/schedule-ruler/ruler-model.js +239 -0
- package/registry/blocks/schedule-ruler/schedule-ruler.jsx +548 -0
- package/registry/blocks/sidebar/README.md +23 -13
- package/registry/blocks/sketch-canvas/README.md +15 -9
- package/registry/blocks/source-receipt/README.md +97 -0
- package/registry/blocks/source-receipt/block.json +30 -0
- package/registry/blocks/source-receipt/demo.jsx +71 -0
- package/registry/blocks/source-receipt/index.js +3 -0
- package/registry/blocks/source-receipt/source-receipt.jsx +107 -0
- package/registry/blocks/spreadsheet/spreadsheet.jsx +15 -1
- package/registry/blocks/step-picker/README.md +78 -0
- package/registry/blocks/step-picker/block.json +31 -0
- package/registry/blocks/step-picker/demo.jsx +23 -0
- package/registry/blocks/step-picker/index.js +3 -0
- package/registry/blocks/step-picker/step-picker.jsx +144 -0
- package/registry/blocks/step-settings/README.md +100 -0
- package/registry/blocks/step-settings/block.json +44 -0
- package/registry/blocks/step-settings/demo.jsx +93 -0
- package/registry/blocks/step-settings/fields.jsx +58 -0
- package/registry/blocks/step-settings/flow-settings.jsx +115 -0
- package/registry/blocks/step-settings/index.js +5 -0
- package/registry/blocks/step-settings/step-settings.jsx +290 -0
- package/registry/blocks/suggestion/README.md +171 -0
- package/registry/blocks/suggestion/block.json +40 -0
- package/registry/blocks/suggestion/demo.jsx +91 -0
- package/registry/blocks/suggestion/index.js +3 -0
- package/registry/blocks/suggestion/suggestion.jsx +436 -0
- package/registry/blocks/sum-bar/README.md +122 -0
- package/registry/blocks/sum-bar/block.json +10 -0
- package/registry/blocks/sum-bar/demo.jsx +110 -0
- package/registry/blocks/sum-bar/index.js +5 -0
- package/registry/blocks/sum-bar/sum-bar.jsx +209 -0
- package/registry/blocks/sum-bar/sum-model.js +126 -0
- package/registry/blocks/tier-map/README.md +217 -0
- package/registry/blocks/tier-map/block.json +10 -0
- package/registry/blocks/tier-map/demo.jsx +222 -0
- package/registry/blocks/tier-map/index.js +24 -0
- package/registry/blocks/tier-map/tier-map.jsx +574 -0
- package/registry/blocks/tier-map/tier-model.js +318 -0
- package/registry/blocks/time-grid/README.md +305 -0
- package/registry/blocks/time-grid/block.json +10 -0
- package/registry/blocks/time-grid/demo.jsx +279 -0
- package/registry/blocks/time-grid/grid-model.js +322 -0
- package/registry/blocks/time-grid/index.js +25 -0
- package/registry/blocks/time-grid/time-grid.jsx +1325 -0
- package/registry/blocks/time-strip/README.md +141 -0
- package/registry/blocks/time-strip/block.json +10 -0
- package/registry/blocks/time-strip/demo.jsx +129 -0
- package/registry/blocks/time-strip/index.js +19 -0
- package/registry/blocks/time-strip/strip-model.js +178 -0
- package/registry/blocks/time-strip/time-strip.jsx +260 -0
- package/registry/blocks/top-bar/README.md +149 -0
- package/registry/blocks/top-bar/block.json +35 -0
- package/registry/blocks/top-bar/demo.jsx +78 -0
- package/registry/blocks/top-bar/index.js +5 -0
- package/registry/blocks/top-bar/probe-rules.js +74 -0
- package/registry/blocks/top-bar/top-bar-model.js +152 -0
- package/registry/blocks/top-bar/top-bar.jsx +244 -0
- package/registry/blocks/trigger-picker/README.md +98 -0
- package/registry/blocks/trigger-picker/block.json +38 -0
- package/registry/blocks/trigger-picker/demo.jsx +59 -0
- package/registry/blocks/trigger-picker/index.js +3 -0
- package/registry/blocks/trigger-picker/trigger-picker.jsx +374 -0
- package/registry/blocks/whiteboard/README.md +20 -14
- package/registry/blocks/workflow-view/README.md +123 -0
- package/registry/blocks/workflow-view/block.json +10 -0
- package/registry/blocks/workflow-view/demo.jsx +90 -0
- package/registry/blocks/workflow-view/index.js +3 -0
- package/registry/blocks/workflow-view/workflow-view.jsx +203 -0
- package/src/cli.mjs +2 -2
- package/src/install.mjs +100 -22
- package/src/registry.mjs +37 -3
- package/templates/next/browser/lib/data.js +6 -1
- package/templates/next/files/README.md +909 -26
- package/templates/next/files/app/shell.jsx +54 -37
- package/templates/next/files/check/automation-format.ts +2103 -0
- package/templates/next/files/check/automation-package.ts +142 -0
- package/templates/next/files/check/run.mjs +1043 -12
- package/templates/next/files/components/ui/field.jsx +17 -4
- package/templates/next/files/components/ui/icon.jsx +13 -0
- package/templates/next/files/components/ui/index.js +3 -1
- package/templates/next/files/components/ui/layout.jsx +382 -0
- package/templates/next/files/components/ui/notice.jsx +70 -0
- package/templates/next/files/components/ui/page.jsx +124 -0
- package/templates/next/files/components/ui/stat.jsx +22 -7
- package/templates/next/files/components/ui/toast.jsx +6 -3
- package/templates/next/files/lib/automations.js +660 -0
- package/templates/next/files/lib/claw.js +244 -5
- package/templates/next/files/lib/door.js +92 -0
- package/templates/next/files/lib/hooks.js +1694 -6
- package/templates/next/files/lib/platform.js +611 -14
- package/templates/next/template.json +22 -3
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// The small pieces the automation blocks share: a health chip and dot, and
|
|
4
|
+
// the side panel every settings view sits in (a head with the thing's
|
|
5
|
+
// face, a scrolling body, a foot). Presentational; words and callbacks in.
|
|
6
|
+
|
|
7
|
+
import { Icon, Select, cx } from "../../ui";
|
|
8
|
+
import { creditsWords, runLine } from "./words";
|
|
9
|
+
|
|
10
|
+
const CHIP = {
|
|
11
|
+
green: "border-success/40 text-success",
|
|
12
|
+
blue: "border-info/40 text-info",
|
|
13
|
+
amber: "border-warning/50 text-warning",
|
|
14
|
+
red: "border-destructive/50 text-destructive",
|
|
15
|
+
grey: "border-border text-muted-foreground",
|
|
16
|
+
};
|
|
17
|
+
const DOT = { green: "bg-success", blue: "bg-info", amber: "bg-warning", red: "bg-destructive", grey: "bg-muted-foreground/60" };
|
|
18
|
+
|
|
19
|
+
/** A small word in a pill. tone: green | blue | amber | red | grey. */
|
|
20
|
+
export function Chip({ tone = "grey", className, children }) {
|
|
21
|
+
return <span className={cx("inline-flex shrink-0 items-center whitespace-nowrap rounded-full border px-2 py-px text-xs font-medium", CHIP[tone] ?? CHIP.grey, className)}>{children}</span>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** A dot of the same tones, beside a health word. */
|
|
25
|
+
export function Dot({ tone = "grey", className }) {
|
|
26
|
+
return <i aria-hidden="true" className={cx("inline-block size-2 shrink-0 rounded-full", DOT[tone] ?? DOT.grey, className)} />;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The panel beside (or, narrow, over) a canvas.
|
|
31
|
+
* icon a kit Icon name drawn in the head
|
|
32
|
+
* glyph or: a node here (automation-model's Glyph) instead
|
|
33
|
+
* title, subtitle
|
|
34
|
+
* onClose draws the close button
|
|
35
|
+
* footer a node pinned under the body
|
|
36
|
+
* label what a screen reader calls it
|
|
37
|
+
*/
|
|
38
|
+
export function SidePanel({ icon, glyph, title, subtitle, onClose, footer, label, tone = "plain", className, children }) {
|
|
39
|
+
return (
|
|
40
|
+
<aside aria-label={label ?? title} className={cx("flex min-h-0 min-w-0 flex-col bg-card text-card-foreground", className)}>
|
|
41
|
+
<header className="flex min-w-0 items-start gap-2.5 border-b border-border px-3.5 py-3">
|
|
42
|
+
{glyph || icon ? (
|
|
43
|
+
<span className={cx("inline-flex size-9 shrink-0 items-center justify-center rounded-lg border", tone === "plain" ? "border-border text-muted-foreground" : "border-primary bg-primary/15 text-primary")}>
|
|
44
|
+
{glyph ?? <Icon name={icon} size={18} />}
|
|
45
|
+
</span>
|
|
46
|
+
) : null}
|
|
47
|
+
<div className="grid min-w-0 flex-1 gap-0.5">
|
|
48
|
+
<h3 className="m-0 break-words text-sm font-semibold leading-tight">{title}</h3>
|
|
49
|
+
{subtitle ? <p className="m-0 text-xs text-muted-foreground">{subtitle}</p> : null}
|
|
50
|
+
</div>
|
|
51
|
+
{onClose ? (
|
|
52
|
+
<button type="button" aria-label="Close" onClick={onClose} className="inline-flex size-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
|
|
53
|
+
<Icon name="x" size={16} />
|
|
54
|
+
</button>
|
|
55
|
+
) : null}
|
|
56
|
+
</header>
|
|
57
|
+
<div data-scroll className="grid min-h-0 flex-1 content-start gap-4 overflow-y-auto px-3.5 py-3.5">
|
|
58
|
+
{children}
|
|
59
|
+
</div>
|
|
60
|
+
{footer ? <footer className="flex flex-wrap items-center gap-2 border-t border-border px-3.5 py-2.5">{footer}</footer> : null}
|
|
61
|
+
</aside>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** A titled group inside a panel. */
|
|
66
|
+
export function PanelSection({ title, children }) {
|
|
67
|
+
return (
|
|
68
|
+
<section className="grid gap-3 border-t border-border pt-3">
|
|
69
|
+
<h4 className="m-0 text-2xs font-semibold uppercase tracking-wide text-muted-foreground">{title}</h4>
|
|
70
|
+
{children}
|
|
71
|
+
</section>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Newest first, numbered from the oldest: the number a person says.
|
|
77
|
+
* runs [{ id, status, created_at, is_test, credits }]
|
|
78
|
+
* value the run shown, or null
|
|
79
|
+
* onPick(runId)
|
|
80
|
+
*/
|
|
81
|
+
export function RunPicker({ runs, value = null, onPick, className }) {
|
|
82
|
+
if (!runs?.length) return null;
|
|
83
|
+
const total = runs.length;
|
|
84
|
+
return (
|
|
85
|
+
<span className={cx("block w-64 max-w-full", className)}>
|
|
86
|
+
<Select
|
|
87
|
+
aria-label="Pick a run"
|
|
88
|
+
value={value ?? ""}
|
|
89
|
+
onChange={(e) => e.target.value && onPick?.(e.target.value)}
|
|
90
|
+
options={[...(value === null ? [{ value: "", label: "Runs" }] : []), ...runs.map((r, i) => ({ value: r.id, label: `${runLine(r, total - i)} · ${creditsWords(r.credits)}` }))]}
|
|
91
|
+
/>
|
|
92
|
+
</span>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// A schedule in a person's terms and in cron, both ways.
|
|
2
|
+
//
|
|
3
|
+
// The trigger picker offers the shapes people ask for ("every weekday at
|
|
4
|
+
// 07:00"); the definition holds a five-field cron. Anything the picker
|
|
5
|
+
// cannot read back stays a custom cron, kept exactly as written.
|
|
6
|
+
|
|
7
|
+
const clamp = (n, lo, hi) => Math.min(hi, Math.max(lo, n));
|
|
8
|
+
|
|
9
|
+
/** parts: { freq: daily|weekdays|weekly|hourly|custom, hour, minute,
|
|
10
|
+
* weekday (0 is Sunday), cron } */
|
|
11
|
+
export function cronFromParts(p) {
|
|
12
|
+
const h = clamp(Math.round(p.hour), 0, 23);
|
|
13
|
+
const m = clamp(Math.round(p.minute), 0, 59);
|
|
14
|
+
switch (p.freq) {
|
|
15
|
+
case "daily":
|
|
16
|
+
return `${m} ${h} * * *`;
|
|
17
|
+
case "weekdays":
|
|
18
|
+
return `${m} ${h} * * 1-5`;
|
|
19
|
+
case "weekly":
|
|
20
|
+
return `${m} ${h} * * ${clamp(Math.round(p.weekday), 0, 6)}`;
|
|
21
|
+
case "hourly":
|
|
22
|
+
return `${m} * * * *`;
|
|
23
|
+
default:
|
|
24
|
+
return p.cron;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function partsFromCron(cron) {
|
|
29
|
+
const c = String(cron ?? "").trim().replace(/\s+/g, " ");
|
|
30
|
+
const base = { hour: 7, minute: 0, weekday: 1, cron: c };
|
|
31
|
+
let m = /^(\d{1,2}) (\d{1,2}) \* \* \*$/.exec(c);
|
|
32
|
+
if (m) return { ...base, freq: "daily", minute: Number(m[1]), hour: Number(m[2]) };
|
|
33
|
+
m = /^(\d{1,2}) (\d{1,2}) \* \* 1-5$/.exec(c);
|
|
34
|
+
if (m) return { ...base, freq: "weekdays", minute: Number(m[1]), hour: Number(m[2]) };
|
|
35
|
+
m = /^(\d{1,2}) (\d{1,2}) \* \* ([0-6])$/.exec(c);
|
|
36
|
+
if (m) return { ...base, freq: "weekly", minute: Number(m[1]), hour: Number(m[2]), weekday: Number(m[3]) };
|
|
37
|
+
m = /^(\d{1,2}) \* \* \* \*$/.exec(c);
|
|
38
|
+
if (m) return { ...base, freq: "hourly", minute: Number(m[1]) };
|
|
39
|
+
return { ...base, freq: "custom" };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const WEEKDAYS = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
43
|
+
|
|
44
|
+
/** `07:00` for a time input. */
|
|
45
|
+
export const timeText = (hour, minute) => `${String(hour).padStart(2, "0")}:${String(minute).padStart(2, "0")}`;
|
|
46
|
+
|
|
47
|
+
export function parseTime(text) {
|
|
48
|
+
const m = /^(\d{1,2}):(\d{2})$/.exec(String(text ?? ""));
|
|
49
|
+
if (!m) return null;
|
|
50
|
+
const hour = Number(m[1]);
|
|
51
|
+
const minute = Number(m[2]);
|
|
52
|
+
return hour <= 23 && minute <= 59 ? { hour, minute } : null;
|
|
53
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// Starting points: a few ready-made flows a person can open and change,
|
|
2
|
+
// so a first automation is never a blank canvas. They use only steps the
|
|
3
|
+
// engine runs today; each is a whole definition with its blanks marked (an
|
|
4
|
+
// action to pick, a message to write).
|
|
5
|
+
//
|
|
6
|
+
// Content, not code: add one by adding an entry. An app may hand its own
|
|
7
|
+
// list to the list screen (`starts`), which is how an app offers flows
|
|
8
|
+
// that name its own actions.
|
|
9
|
+
|
|
10
|
+
import { blankAutomation, keyFromName } from "./edit";
|
|
11
|
+
|
|
12
|
+
function base(name, taken, trigger) {
|
|
13
|
+
return blankAutomation(name, keyFromName(name, taken), trigger);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Each: { id, name, blurb, glyph, needs, build(taken) → definition }. */
|
|
17
|
+
export const STARTING_POINTS = [
|
|
18
|
+
{
|
|
19
|
+
id: "weekly-reminder",
|
|
20
|
+
name: "A reminder every Monday",
|
|
21
|
+
blurb: "Leaves a note for you at the start of each week.",
|
|
22
|
+
glyph: "trigger-schedule",
|
|
23
|
+
needs: null,
|
|
24
|
+
build: (taken) => ({
|
|
25
|
+
...base("Monday reminder", taken, { type: "schedule", cron: "0 9 * * 1", tz: "team" }),
|
|
26
|
+
does: "Leaves a note for the owner every Monday morning.",
|
|
27
|
+
steps: [{ id: "note", kind: "notify", label: "Leave the reminder", message: "It is Monday. Look at the week ahead." }],
|
|
28
|
+
}),
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "check-then-tell",
|
|
32
|
+
name: "Check something, then tell me",
|
|
33
|
+
blurb: "Goes one way when a condition holds and another way when it does not.",
|
|
34
|
+
glyph: "condition",
|
|
35
|
+
needs: "A condition to check",
|
|
36
|
+
build: (taken) => ({
|
|
37
|
+
...base("Check and tell", taken, { type: "manual" }),
|
|
38
|
+
does: "Checks a condition and says which way it went.",
|
|
39
|
+
steps: [
|
|
40
|
+
{
|
|
41
|
+
id: "check",
|
|
42
|
+
kind: "condition",
|
|
43
|
+
label: "Is it worth a look?",
|
|
44
|
+
if: "{{ true }}",
|
|
45
|
+
then: [{ id: "say_yes", kind: "notify", label: "Tell me it is", message: "Yes, it is worth a look." }],
|
|
46
|
+
else: [{ id: "say_no", kind: "stop", label: "Nothing to do", message: "Nothing to look at today." }],
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
}),
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "wait-then-follow-up",
|
|
53
|
+
name: "Wait, then follow up",
|
|
54
|
+
blurb: "Waits a couple of days, then leaves a note. Nothing runs while it waits.",
|
|
55
|
+
glyph: "wait",
|
|
56
|
+
needs: null,
|
|
57
|
+
build: (taken) => ({
|
|
58
|
+
...base("Follow up later", taken, { type: "manual" }),
|
|
59
|
+
does: "Waits two days, then reminds the owner.",
|
|
60
|
+
steps: [
|
|
61
|
+
{ id: "pause", kind: "wait", for: "2d" },
|
|
62
|
+
{ id: "remind", kind: "notify", label: "Remind me", message: "Time to follow up." },
|
|
63
|
+
],
|
|
64
|
+
}),
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: "app-action-daily",
|
|
68
|
+
name: "Run an app's action every morning",
|
|
69
|
+
blurb: "Picks one of your apps' actions and runs it each weekday.",
|
|
70
|
+
glyph: "action",
|
|
71
|
+
needs: "An app and one of its actions",
|
|
72
|
+
build: (taken) => ({
|
|
73
|
+
...base("Morning action", taken, { type: "schedule", cron: "0 7 * * 1-5", tz: "team" }),
|
|
74
|
+
does: "Runs an app's action each weekday morning.",
|
|
75
|
+
steps: [
|
|
76
|
+
{ id: "act", kind: "action", label: "Run the action", action: "", input: {} },
|
|
77
|
+
{ id: "done", kind: "notify", message: "It ran." },
|
|
78
|
+
],
|
|
79
|
+
}),
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: "ask-model",
|
|
83
|
+
name: "Ask the model to write a line",
|
|
84
|
+
blurb: "One model call, then a note with what it wrote.",
|
|
85
|
+
glyph: "llm",
|
|
86
|
+
needs: "What to ask",
|
|
87
|
+
build: (taken) => ({
|
|
88
|
+
...base("Write a line", taken, { type: "manual" }),
|
|
89
|
+
does: "Asks the model for a line and leaves it as a note.",
|
|
90
|
+
steps: [
|
|
91
|
+
{ id: "write", kind: "llm", label: "Write the line", prompt: "Write one friendly line that wishes the team a good week.", tier: "fast" },
|
|
92
|
+
{ id: "tell", kind: "notify", message: "{{ steps.write.output }}" },
|
|
93
|
+
],
|
|
94
|
+
}),
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
/** The starting points the platform keeps (the desk's `GET automation-starts`
|
|
99
|
+
* → `starts`), in the shape the list draws:
|
|
100
|
+
* { id, name, blurb, glyph, needs (a line or null), ai (a line or ""),
|
|
101
|
+
* price: { credits, per }, build(taken) → a whole definition }.
|
|
102
|
+
* `needs` is joined into one plain line ("payments, a mailbox"); `price.per`
|
|
103
|
+
* is "each" when the cost is per item, else null. `build` hands back a copy
|
|
104
|
+
* of the definition with a key nobody has taken. Anything that is not a
|
|
105
|
+
* start is left out. */
|
|
106
|
+
export function startsFromPlatform(list) {
|
|
107
|
+
const out = [];
|
|
108
|
+
for (const s of Array.isArray(list) ? list : []) {
|
|
109
|
+
if (!s || typeof s !== "object" || typeof s.id !== "string" || !s.definition || typeof s.definition !== "object") continue;
|
|
110
|
+
const needs = (Array.isArray(s.needs) ? s.needs : []).filter((x) => typeof x === "string" && x.trim()).map((x) => x.trim());
|
|
111
|
+
const credits = Number(s.credits);
|
|
112
|
+
out.push({
|
|
113
|
+
id: s.id,
|
|
114
|
+
name: String(s.name ?? s.definition.name ?? s.id),
|
|
115
|
+
blurb: String(s.blurb ?? ""),
|
|
116
|
+
glyph: typeof s.glyph === "string" && s.glyph ? s.glyph : undefined,
|
|
117
|
+
needs: needs.length ? needs.join(", ") : null,
|
|
118
|
+
ai: typeof s.ai === "string" ? s.ai : "",
|
|
119
|
+
price: { credits: Number.isFinite(credits) && credits > 0 ? credits : 0, per: s.per === "each" ? "each" : null },
|
|
120
|
+
build: (taken) => {
|
|
121
|
+
const def = JSON.parse(JSON.stringify(s.definition));
|
|
122
|
+
def.key = keyFromName(def.name ?? s.name ?? s.id, taken instanceof Set ? taken : new Set(taken ?? []));
|
|
123
|
+
return def;
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
return out;
|
|
128
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// A step's value as the text a person types, and back. Plain numbers,
|
|
2
|
+
// true/false/null and JSON objects are kept as what they are; everything
|
|
3
|
+
// else is text. A value that is one `{{ expression }}` is text the engine
|
|
4
|
+
// reads later.
|
|
5
|
+
|
|
6
|
+
/** A step's value, as the text a person types. */
|
|
7
|
+
export function valueToText(v) {
|
|
8
|
+
if (v === undefined) return "";
|
|
9
|
+
if (typeof v === "string") return v;
|
|
10
|
+
if (v === null) return "null";
|
|
11
|
+
return typeof v === "object" ? JSON.stringify(v) : String(v);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** What a person typed, as a value. */
|
|
15
|
+
export function textToValue(text) {
|
|
16
|
+
const t = String(text ?? "").trim();
|
|
17
|
+
if (/^-?\d+(\.\d+)?$/.test(t)) return Number(t);
|
|
18
|
+
if (t === "true") return true;
|
|
19
|
+
if (t === "false") return false;
|
|
20
|
+
if (t === "null") return null;
|
|
21
|
+
if ((t.startsWith("{") && t.endsWith("}") && !t.startsWith("{{")) || (t.startsWith("[") && t.endsWith("]"))) {
|
|
22
|
+
try {
|
|
23
|
+
return JSON.parse(t);
|
|
24
|
+
} catch {
|
|
25
|
+
return text;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return text;
|
|
29
|
+
}
|