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,290 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// The panel for one step: its name, what it does (a form made for its
|
|
4
|
+
// kind), what happens if it fails, and the plain list of what is wrong
|
|
5
|
+
// with it. In a run the same panel is read-only and adds how the step went,
|
|
6
|
+
// what went in and what came out, and, when the agent fixed the step,
|
|
7
|
+
// what it changed (fix-note).
|
|
8
|
+
//
|
|
9
|
+
// Fields are written in a person's words; the definition's own keys stay
|
|
10
|
+
// out of sight (the step id is shown small, because it is what a run's rows
|
|
11
|
+
// and an app update match steps by). Props in, callbacks out: every change
|
|
12
|
+
// is `onChange(patch)`, applied by the screen with automation-model's
|
|
13
|
+
// updateStep.
|
|
14
|
+
|
|
15
|
+
import { useState } from "react";
|
|
16
|
+
import { Button, Confirm, Icon, cx } from "../../ui";
|
|
17
|
+
import { Glyph, KINDS, SidePanel, creditsWords, innerCount, nodeStateWords, stepTitle } from "../automation-model";
|
|
18
|
+
import { DataInput, DataPairs } from "../data-picker";
|
|
19
|
+
import { FixNote } from "../fix-note";
|
|
20
|
+
import { NumberField, SelectField, TextField } from "./fields";
|
|
21
|
+
|
|
22
|
+
const FAIL_OPTIONS = [
|
|
23
|
+
{ value: "stop", label: "Stop the run" },
|
|
24
|
+
{ value: "continue", label: "Carry on without it" },
|
|
25
|
+
];
|
|
26
|
+
const OP_OPTIONS = [
|
|
27
|
+
{ value: "search", label: "Search" },
|
|
28
|
+
{ value: "get", label: "Get one" },
|
|
29
|
+
{ value: "list", label: "List" },
|
|
30
|
+
];
|
|
31
|
+
const METHOD_OPTIONS = [
|
|
32
|
+
{ value: "GET", label: "Ask (GET)" },
|
|
33
|
+
{ value: "POST", label: "Send (POST)" },
|
|
34
|
+
{ value: "PUT", label: "Replace (PUT)" },
|
|
35
|
+
{ value: "PATCH", label: "Change (PATCH)" },
|
|
36
|
+
];
|
|
37
|
+
const TIER_OPTIONS = [
|
|
38
|
+
{ value: "fast", label: "Quick" },
|
|
39
|
+
{ value: "smart", label: "Careful" },
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const show = (v) => JSON.stringify(v, null, 2) ?? "";
|
|
43
|
+
|
|
44
|
+
function Data({ label, value }) {
|
|
45
|
+
if (value === undefined || value === null) return null;
|
|
46
|
+
const text = show(value);
|
|
47
|
+
return (
|
|
48
|
+
<details open={text.length < 240} className="rounded-md border border-border bg-muted">
|
|
49
|
+
<summary className="cursor-pointer px-2 py-1 text-xs font-medium">{label}</summary>
|
|
50
|
+
<pre className="m-0 max-h-64 overflow-auto px-2 pb-2 font-mono text-xs">{text.length > 4000 ? `${text.slice(0, 4000)}\n…` : text}</pre>
|
|
51
|
+
</details>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** A run's own account of the step: how it went, what went in and out. */
|
|
56
|
+
function RunBlock({ summary, dataVisible, title, fixProps }) {
|
|
57
|
+
const last = summary.rows[summary.rows.length - 1];
|
|
58
|
+
return (
|
|
59
|
+
<section aria-label="How it went" className="grid gap-2 rounded-lg border border-border bg-background p-3">
|
|
60
|
+
<h4 className={cx("m-0 text-sm font-semibold", summary.state === "failed" && "text-destructive", summary.state === "done" && "text-success", summary.state === "would" && "text-primary")}>{nodeStateWords(summary.state)}</h4>
|
|
61
|
+
<p className="m-0 text-xs text-muted-foreground">
|
|
62
|
+
{summary.passes > 1 ? `${summary.passes} times · ` : ""}
|
|
63
|
+
{creditsWords(summary.credits)}
|
|
64
|
+
</p>
|
|
65
|
+
{summary.words ? <p className="m-0 text-[13px] text-destructive">{summary.words}</p> : null}
|
|
66
|
+
{summary.state === "would" && summary.would ? <p className="m-0 text-[13px] text-primary">{summary.would}</p> : null}
|
|
67
|
+
{summary.unchecked ? <p className="m-0 text-[13px] text-muted-foreground">Not checked: it needs what an earlier step would have made.</p> : null}
|
|
68
|
+
{summary.fix ? <FixNote fix={summary.fix} stepTitle={title} {...fixProps} /> : null}
|
|
69
|
+
{dataVisible && last ? (
|
|
70
|
+
<>
|
|
71
|
+
<Data label="Went in" value={last.input} />
|
|
72
|
+
<Data label="Came out" value={last.output} />
|
|
73
|
+
</>
|
|
74
|
+
) : (
|
|
75
|
+
<p className="m-0 text-xs text-muted-foreground">What went in and came out is shown to the automation's owner and the admins.</p>
|
|
76
|
+
)}
|
|
77
|
+
</section>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* step the step shown
|
|
83
|
+
* available automation-model's availableBefore(def, id, stepTitle), plus
|
|
84
|
+
* optionally `inputs: [{ name, label }]` (what a manual run asks)
|
|
85
|
+
* samples { [stepId]: a real output } for the data picker, or null
|
|
86
|
+
* apps the workspace's apps, [{ id, name }], for an action in a team automation
|
|
87
|
+
* actions the app's declared actions, [{ name, description? }]: an action
|
|
88
|
+
* step picks from them instead of typing a name
|
|
89
|
+
* ownedByApp the automation belongs to an app (its actions need no app)
|
|
90
|
+
* problems lines about this step to fix
|
|
91
|
+
* readOnly shown, not editable (a run)
|
|
92
|
+
* onChange(patch), onRemove(), onDuplicate(), onClose()
|
|
93
|
+
* summary a run: automation-model's summarizeSteps() entry for this step
|
|
94
|
+
* dataVisible the member may read what went in and out
|
|
95
|
+
* fixProps what FixNote needs for a step the agent fixed: { draft, onKeep, onDrop, onUndo }
|
|
96
|
+
* onKeepFix() keep a fix the agent made, for next time (shorthand for fixProps.onKeep)
|
|
97
|
+
* runActions a run: what the member can do with this step (a node), drawn under how it went
|
|
98
|
+
*/
|
|
99
|
+
export function StepSettings({ step, available, samples = null, apps = [], actions, ownedByApp = false, problems = [], readOnly = false, onChange, onRemove, onDuplicate, onClose, summary = null, dataVisible = false, fixProps, onKeepFix, runActions = null }) {
|
|
100
|
+
const info = KINDS[step.kind] ?? KINDS.action;
|
|
101
|
+
const dis = readOnly;
|
|
102
|
+
const set = (patch) => onChange?.(patch);
|
|
103
|
+
const inner = innerCount(step);
|
|
104
|
+
const [confirming, setConfirming] = useState(false);
|
|
105
|
+
const title = stepTitle(step);
|
|
106
|
+
|
|
107
|
+
const remove = () => {
|
|
108
|
+
if (inner > 0) setConfirming(true);
|
|
109
|
+
else onRemove?.();
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<SidePanel
|
|
114
|
+
glyph={<Glyph name={info.glyph} size={20} />}
|
|
115
|
+
tone={info.tone === "plain" ? "plain" : "ai"}
|
|
116
|
+
title={title}
|
|
117
|
+
subtitle={`${info.name}${info.paid ? " · costs credits" : " · free"}`}
|
|
118
|
+
label={`${info.name} settings`}
|
|
119
|
+
onClose={onClose}
|
|
120
|
+
footer={
|
|
121
|
+
readOnly ? null : (
|
|
122
|
+
<>
|
|
123
|
+
<Button size="sm" variant="secondary" icon="copy" onClick={onDuplicate}>
|
|
124
|
+
Duplicate
|
|
125
|
+
</Button>
|
|
126
|
+
<Button size="sm" variant="danger" icon="trash" onClick={remove}>
|
|
127
|
+
Remove
|
|
128
|
+
</Button>
|
|
129
|
+
</>
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
>
|
|
133
|
+
{summary ? <RunBlock summary={summary} dataVisible={dataVisible} title={title} fixProps={fixProps ?? (onKeepFix ? { onKeep: onKeepFix } : undefined)} /> : null}
|
|
134
|
+
{summary && runActions ? runActions : null}
|
|
135
|
+
|
|
136
|
+
<TextField label="Name" value={step.label ?? ""} placeholder={stepTitle({ ...step, label: undefined })} disabled={dis} onChange={(v) => set({ label: v.trim() ? v : undefined })} help="What this step is called on the canvas." />
|
|
137
|
+
|
|
138
|
+
{step.kind === "action" ? (
|
|
139
|
+
<>
|
|
140
|
+
{!ownedByApp ? (
|
|
141
|
+
<SelectField label="App" value={step.app ?? ""} disabled={dis} onChange={(v) => set({ app: v || undefined })} options={[{ value: "", label: "Pick an app" }, ...apps.map((a) => ({ value: a.id, label: a.name }))]} help="Which of your apps this action belongs to." />
|
|
142
|
+
) : null}
|
|
143
|
+
{actions?.length ? (
|
|
144
|
+
<SelectField
|
|
145
|
+
label="Action"
|
|
146
|
+
value={step.action}
|
|
147
|
+
disabled={dis}
|
|
148
|
+
onChange={(v) => set({ action: v })}
|
|
149
|
+
options={[{ value: "", label: "Pick an action" }, ...actions.map((a) => ({ value: a.name, label: a.description ? `${a.name}: ${a.description}` : a.name })), ...(step.action && !actions.some((a) => a.name === step.action) ? [{ value: step.action, label: step.action }] : [])]}
|
|
150
|
+
help="The actions this app declares."
|
|
151
|
+
/>
|
|
152
|
+
) : (
|
|
153
|
+
<TextField label="Action" value={step.action} mono disabled={dis} placeholder="add_people" onChange={(v) => set({ action: v })} help="The name of the action the app declares." />
|
|
154
|
+
)}
|
|
155
|
+
<DataPairs label="What to give it" value={step.input} available={available} samples={samples} disabled={dis} onChange={(v) => set({ input: v })} />
|
|
156
|
+
</>
|
|
157
|
+
) : null}
|
|
158
|
+
|
|
159
|
+
{step.kind === "tool" ? (
|
|
160
|
+
<>
|
|
161
|
+
<TextField label="Kind of account" value={step.needs?.category ?? ""} mono disabled={dis} placeholder="mail" onChange={(v) => set({ needs: { category: v } })} help="The account is chosen by kind (mail, calendar, chat), never by product." />
|
|
162
|
+
<TextField label="Tool" value={step.tool} mono disabled={dis} placeholder="list_messages" onChange={(v) => set({ tool: v })} />
|
|
163
|
+
<TextField label="Which account" value={step.account ?? ""} disabled={dis} placeholder="you@company.com" onChange={(v) => set({ account: v || undefined })} help="Only when you have several of that kind." />
|
|
164
|
+
<DataPairs label="What to give it" value={step.input} available={available} samples={samples} disabled={dis} onChange={(v) => set({ input: v })} />
|
|
165
|
+
</>
|
|
166
|
+
) : null}
|
|
167
|
+
|
|
168
|
+
{step.kind === "brain.read" ? (
|
|
169
|
+
<>
|
|
170
|
+
<SelectField label="How" value={step.op} options={OP_OPTIONS} disabled={dis} onChange={(v) => set({ op: v })} />
|
|
171
|
+
<DataPairs label="What to look for" value={step.input} available={available} samples={samples} disabled={dis} onChange={(v) => set({ input: v })} />
|
|
172
|
+
</>
|
|
173
|
+
) : null}
|
|
174
|
+
|
|
175
|
+
{step.kind === "condition" ? (
|
|
176
|
+
<DataInput label="Go the Yes way when" value={step.if} mono multiline rows={3} disabled={dis} available={available} samples={samples} onChange={(v) => set({ if: v })} help="Anything else goes the No way. Branches are drawn on the canvas; add steps to each with +." />
|
|
177
|
+
) : null}
|
|
178
|
+
|
|
179
|
+
{step.kind === "loop" ? (
|
|
180
|
+
<>
|
|
181
|
+
<DataInput label="Go through" value={step.over} mono disabled={dis} available={available} samples={samples} onChange={(v) => set({ over: v })} help="A list from an earlier step." />
|
|
182
|
+
<NumberField label="At most" value={step.max} min={1} max={500} disabled={dis} onChange={(v) => set({ max: v })} help="How many items it will go through." />
|
|
183
|
+
<DataInput label="Collect from each pass" value={step.collect ?? ""} mono disabled={dis} available={available} samples={samples} onChange={(v) => set({ collect: v || undefined })} help="Optional: what to keep from every pass, as a list." />
|
|
184
|
+
</>
|
|
185
|
+
) : null}
|
|
186
|
+
|
|
187
|
+
{step.kind === "set" ? <DataPairs label="Values" value={step.values} available={available} samples={samples} disabled={dis} keyLabel="Name" onChange={(v) => set({ values: v })} /> : null}
|
|
188
|
+
|
|
189
|
+
{step.kind === "wait" ? (
|
|
190
|
+
<>
|
|
191
|
+
<TextField label="Wait for" value={step.for ?? ""} mono disabled={dis} placeholder="10m" onChange={(v) => set({ for: v || undefined, ...(v ? { until: undefined } : {}) })} help="A number and a unit: 30s, 10m, 2h, 3d. Nothing runs while it waits." />
|
|
192
|
+
<DataInput label="Or wait until" value={step.until ?? ""} mono disabled={dis} available={available} samples={samples} onChange={(v) => set({ until: v || undefined, ...(v ? { for: undefined } : {}) })} help="A time, as data." />
|
|
193
|
+
</>
|
|
194
|
+
) : null}
|
|
195
|
+
|
|
196
|
+
{step.kind === "stop" ? (
|
|
197
|
+
<>
|
|
198
|
+
<DataInput label="Message" value={step.message} multiline rows={3} disabled={dis} available={available} samples={samples} onChange={(v) => set({ message: v })} />
|
|
199
|
+
<SelectField
|
|
200
|
+
label="Ends as"
|
|
201
|
+
value={step.as ?? "done"}
|
|
202
|
+
disabled={dis}
|
|
203
|
+
onChange={(v) => set({ as: v === "done" ? undefined : v })}
|
|
204
|
+
options={[
|
|
205
|
+
{ value: "done", label: "Done" },
|
|
206
|
+
{ value: "failed", label: "Failed" },
|
|
207
|
+
]}
|
|
208
|
+
/>
|
|
209
|
+
</>
|
|
210
|
+
) : null}
|
|
211
|
+
|
|
212
|
+
{step.kind === "notify" ? <DataInput label="Message" value={step.message} multiline rows={3} disabled={dis} available={available} samples={samples} onChange={(v) => set({ message: v })} help="A line for the owner, in their Needs you." /> : null}
|
|
213
|
+
|
|
214
|
+
{step.kind === "search" ? (
|
|
215
|
+
<>
|
|
216
|
+
<DataInput label="Search for" value={step.query} multiline rows={2} disabled={dis} available={available} samples={samples} onChange={(v) => set({ query: v })} />
|
|
217
|
+
<NumberField label="How many results" value={step.limit} min={1} max={20} disabled={dis} onChange={(v) => set({ limit: v })} />
|
|
218
|
+
</>
|
|
219
|
+
) : null}
|
|
220
|
+
|
|
221
|
+
{step.kind === "llm" ? (
|
|
222
|
+
<>
|
|
223
|
+
<DataInput label="What to ask" value={step.prompt} multiline rows={6} disabled={dis} available={available} samples={samples} onChange={(v) => set({ prompt: v })} />
|
|
224
|
+
<SelectField label="Which model" value={step.tier ?? "fast"} options={TIER_OPTIONS} disabled={dis} onChange={(v) => set({ tier: v })} help="Quick is cheaper. Careful thinks longer." />
|
|
225
|
+
<TextField label="Standing instructions" value={step.system ?? ""} multiline rows={2} disabled={dis} onChange={(v) => set({ system: v || undefined })} help="Optional instructions that frame every answer." />
|
|
226
|
+
</>
|
|
227
|
+
) : null}
|
|
228
|
+
|
|
229
|
+
{step.kind === "agent" ? (
|
|
230
|
+
<>
|
|
231
|
+
<DataInput label="What the agent should do" value={step.instructions} multiline rows={7} disabled={dis} available={available} samples={samples} onChange={(v) => set({ instructions: v })} help="Plain words. The agent may use your apps and connected accounts, within what you can reach." />
|
|
232
|
+
<NumberField label="Most it may spend" value={step.cap_credits} min={1} disabled={dis} onChange={(v) => set({ cap_credits: v })} help="In credits. The run stops the agent there." />
|
|
233
|
+
</>
|
|
234
|
+
) : null}
|
|
235
|
+
|
|
236
|
+
{step.kind === "zero" ? (
|
|
237
|
+
<>
|
|
238
|
+
<TextField label="Paid service" value={step.capability ?? ""} mono disabled={dis} placeholder="the service's name" onChange={(v) => set({ capability: v })} help="The name the platform's catalog of paid services gave it." />
|
|
239
|
+
<DataInput label="Address" value={step.url ?? ""} mono disabled={dis} available={available} samples={samples} onChange={(v) => set({ url: v })} help="The service's own web address, starting with https://." />
|
|
240
|
+
<SelectField label="How it is called" value={step.method ?? "GET"} options={METHOD_OPTIONS} disabled={dis} onChange={(v) => set({ method: v === "GET" ? undefined : v })} help="Ask puts what you give it on the address; the others send it as a body." />
|
|
241
|
+
<DataPairs label="What to give it" value={step.input} available={available} samples={samples} disabled={dis} onChange={(v) => set({ input: v })} />
|
|
242
|
+
<NumberField label="Most one call may cost, in dollars" value={step.max_pay_usd} min={0.01} max={2} step={0.01} disabled={dis} onChange={(v) => set({ max_pay_usd: v })} help="The step never pays more than this, and the same call is not paid for twice. It comes out of your credits." />
|
|
243
|
+
</>
|
|
244
|
+
) : null}
|
|
245
|
+
|
|
246
|
+
{step.kind === "automation" ? (
|
|
247
|
+
<>
|
|
248
|
+
<TextField label="Which automation" value={step.key} mono disabled={dis} placeholder="morning-read" onChange={(v) => set({ key: v })} />
|
|
249
|
+
<DataPairs label="What to give it" value={step.input} available={available} samples={samples} disabled={dis} onChange={(v) => set({ input: v })} />
|
|
250
|
+
</>
|
|
251
|
+
) : null}
|
|
252
|
+
|
|
253
|
+
<section className="grid gap-3 border-t border-border pt-3">
|
|
254
|
+
<h4 className="m-0 text-2xs font-semibold uppercase tracking-wide text-muted-foreground">If it fails</h4>
|
|
255
|
+
<SelectField label="After the tries are used up" value={step.on_error ?? "stop"} options={FAIL_OPTIONS} disabled={dis} onChange={(v) => set({ on_error: v === "stop" ? undefined : v })} help="The agent steps in first, if the flow lets it." />
|
|
256
|
+
<NumberField label="Tries after the first" value={step.retry?.max} min={0} max={5} disabled={dis} placeholder="3" onChange={(v) => set({ retry: v === undefined ? undefined : { max: v } })} help="For a slow or busy service. Leave empty for the usual three." />
|
|
257
|
+
</section>
|
|
258
|
+
|
|
259
|
+
{problems.length > 0 ? (
|
|
260
|
+
<div role="alert" className="grid gap-1 rounded-lg border border-destructive/50 bg-destructive/10 p-3">
|
|
261
|
+
<h4 className="m-0 flex items-center gap-1.5 text-sm font-semibold text-destructive">
|
|
262
|
+
<Icon name="warning" size={14} /> To fix
|
|
263
|
+
</h4>
|
|
264
|
+
<ul className="m-0 grid list-disc gap-0.5 pl-5 text-[13px]">
|
|
265
|
+
{problems.map((x) => (
|
|
266
|
+
<li key={x}>{x}</li>
|
|
267
|
+
))}
|
|
268
|
+
</ul>
|
|
269
|
+
</div>
|
|
270
|
+
) : null}
|
|
271
|
+
|
|
272
|
+
<p className="m-0 text-xs text-muted-foreground">
|
|
273
|
+
Step id <span className="font-mono">{step.id}</span>
|
|
274
|
+
</p>
|
|
275
|
+
|
|
276
|
+
<Confirm
|
|
277
|
+
open={confirming}
|
|
278
|
+
onClose={() => setConfirming(false)}
|
|
279
|
+
onConfirm={() => {
|
|
280
|
+
setConfirming(false);
|
|
281
|
+
onRemove?.();
|
|
282
|
+
}}
|
|
283
|
+
title="Remove this step?"
|
|
284
|
+
body={`This also removes the ${inner} step${inner === 1 ? "" : "s"} inside it.`}
|
|
285
|
+
confirmLabel="Remove"
|
|
286
|
+
tone="danger"
|
|
287
|
+
/>
|
|
288
|
+
</SidePanel>
|
|
289
|
+
);
|
|
290
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# Suggestion
|
|
2
|
+
|
|
3
|
+
A value the agent proposes, drawn in pencil: **dashed** while it is a
|
|
4
|
+
proposal, **solid** once kept. Its source is always shown, and a person
|
|
5
|
+
keeps or drops it. A proposal differs from a fact in shape, never colour
|
|
6
|
+
alone.
|
|
7
|
+
|
|
8
|
+
Five shapes, one idea:
|
|
9
|
+
|
|
10
|
+
- **FieldSuggestion** — under a field: what it holds now ("empty now"),
|
|
11
|
+
the proposed value, where it came from, Keep and Drop.
|
|
12
|
+
- **InlineSuggestion** — found in place: a small dashed chip inside the
|
|
13
|
+
cell or field it would fill, its source, a tick and a cross (CRM v2).
|
|
14
|
+
- **TextSuggestion** — a span of text: the old words struck, the new
|
|
15
|
+
beside them, the reason, the source (Writing Review's proof marks).
|
|
16
|
+
- **Pencil** — the dashed frame for a whole proposed record: a drafted
|
|
17
|
+
email, a deal, a week's plan ("pencil to ink", Weekly Planner).
|
|
18
|
+
- **SuggestionGroup** — the head over several: "Keep all 6", "Drop all".
|
|
19
|
+
|
|
20
|
+
And **Looking**: "✦ Looking…" where a value is still being found.
|
|
21
|
+
|
|
22
|
+
Grown in the CRM (0.7.0) as `field-suggestion`; every export kept its
|
|
23
|
+
props. One change: a FieldSuggestion that was dropped now goes, as an
|
|
24
|
+
InlineSuggestion always did.
|
|
25
|
+
|
|
26
|
+
```jsx
|
|
27
|
+
import { FieldSuggestion, InlineSuggestion, TextSuggestion, Pencil, SuggestionGroup, Looking } from "../components/blocks/suggestion"; // a Makersclaw app ("./blocks/suggestion" from components/)
|
|
28
|
+
import { FieldSuggestion } from "@/components/makersclaw/blocks/suggestion"; // a shadcn project
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Client components; `suggestionSource` is a plain function.
|
|
32
|
+
|
|
33
|
+
## Which hook feeds it
|
|
34
|
+
|
|
35
|
+
None of its own. The proposals are app data the agent wrote (a
|
|
36
|
+
`suggestions` table, a column of proposed values). **A keep runs the
|
|
37
|
+
app's own declared action** (`runAction`, lib/actions), so a keep is the
|
|
38
|
+
same write the agent would make, and the door's rules hold for it.
|
|
39
|
+
|
|
40
|
+
## The verbs are props
|
|
41
|
+
|
|
42
|
+
Each app says it its way: Keep/Drop (CRM), Apply/Dismiss (Data Tables),
|
|
43
|
+
Accept/Decline (Writing Review). Every shape takes `keepLabel` and
|
|
44
|
+
`dropLabel`; FieldSuggestion and TextSuggestion also take `keptLabel`
|
|
45
|
+
("Applied").
|
|
46
|
+
|
|
47
|
+
## Props
|
|
48
|
+
|
|
49
|
+
### FieldSuggestion
|
|
50
|
+
|
|
51
|
+
- `label` — the field's name ("Job title"). It also names the group for a
|
|
52
|
+
reader ("Suggested job title") and the buttons ("Keep job title").
|
|
53
|
+
- `current` — what the field holds now; empty → "empty now".
|
|
54
|
+
- `value` — the proposed value (text or a node).
|
|
55
|
+
- `source` — `{ from, at }` ("her email signature", "2026-09-12") or a
|
|
56
|
+
string.
|
|
57
|
+
- `onKeep()` · `onDrop()` — async, answer `{ ok: true }` or `{ ok: false,
|
|
58
|
+
error }` (a throw counts as failed). The frame spins while it runs,
|
|
59
|
+
turns solid when kept, goes when dropped, and says why when it fails.
|
|
60
|
+
- `compact` — icon buttons at the row's end, the label inside the frame:
|
|
61
|
+
for a list of several.
|
|
62
|
+
- `showLabel` — `false` when you draw the field's label above it.
|
|
63
|
+
- `keepLabel` · `dropLabel` · `keptLabel` — default "Keep", "Drop", "Kept".
|
|
64
|
+
- `formatDate(date)` — how `source.at` is worded (default "Sat 12 Sep").
|
|
65
|
+
|
|
66
|
+
Under 22rem of its own width the buttons go below the value.
|
|
67
|
+
|
|
68
|
+
### InlineSuggestion
|
|
69
|
+
|
|
70
|
+
- `value`, `source`, `label` (names the buttons for a reader),
|
|
71
|
+
`onKeep()` · `onDrop()`, `keepLabel` · `dropLabel`, `formatDate`.
|
|
72
|
+
|
|
73
|
+
A dashed chip in the agent's tone (`border-info`); kept, solid with a
|
|
74
|
+
tick; dropped, gone. For a table cell or a record's field list.
|
|
75
|
+
|
|
76
|
+
### TextSuggestion
|
|
77
|
+
|
|
78
|
+
- `before` — the words now, struck. Empty for an insertion.
|
|
79
|
+
- `after` — the words proposed. Empty for a cut.
|
|
80
|
+
- `lead` · `tail` — a few words around the span, muted, so it reads in
|
|
81
|
+
place ("…sorry about ", " order").
|
|
82
|
+
- `reason` — why, one line.
|
|
83
|
+
- `source` — `{ from, at }` or a string: what it leans on (the style
|
|
84
|
+
guide, a page).
|
|
85
|
+
- `onKeep()` · `onDrop()` — async `{ ok }`.
|
|
86
|
+
- `keepLabel` · `dropLabel` · `keptLabel`.
|
|
87
|
+
|
|
88
|
+
A reader hears "Remove: … Add: …" for the struck and new words.
|
|
89
|
+
|
|
90
|
+
### Pencil
|
|
91
|
+
|
|
92
|
+
- `kicker` — the small line above ("A NEW DEAL").
|
|
93
|
+
- `title` — what it is ("Crumb & Co: 22 shops").
|
|
94
|
+
- `reason` — why the agent proposes it.
|
|
95
|
+
- `children` — your content between the title and the reason.
|
|
96
|
+
- `actions` — your buttons, with your verbs ("Make the deal", "Drop").
|
|
97
|
+
- `state` — `pencil` (default) · `kept` (solid) · `failed` (with
|
|
98
|
+
`error`).
|
|
99
|
+
- `label` — the region's name for a reader.
|
|
100
|
+
|
|
101
|
+
### SuggestionGroup
|
|
102
|
+
|
|
103
|
+
- `title` — "3 details found for Sofia: job title, LinkedIn and city".
|
|
104
|
+
- `description` — where they came from; that nothing changes until kept.
|
|
105
|
+
- `count` — for "Keep all 3" (or `keepAllLabel`). `dropAllLabel` —
|
|
106
|
+
default "Drop all".
|
|
107
|
+
- `onKeepAll()` · `onDropAll()` — async `{ ok }`; a failure shows under
|
|
108
|
+
the title.
|
|
109
|
+
- `children` — the suggestions under it.
|
|
110
|
+
|
|
111
|
+
### Looking
|
|
112
|
+
|
|
113
|
+
`children` replaces "Looking…". Pulses, and stays still under reduced
|
|
114
|
+
motion.
|
|
115
|
+
|
|
116
|
+
### suggestionSource({ from, at }, format?)
|
|
117
|
+
|
|
118
|
+
"her email signature, Sat 12 Sep".
|
|
119
|
+
|
|
120
|
+
## Who may do what
|
|
121
|
+
|
|
122
|
+
The block shows the buttons it is given. Give `onKeep`/`onDrop` only to a
|
|
123
|
+
member who may make that write; the declared action's door refuses anyone
|
|
124
|
+
else anyway.
|
|
125
|
+
|
|
126
|
+
## Never
|
|
127
|
+
|
|
128
|
+
- Never write the value yourself on render: nothing changes until a
|
|
129
|
+
person keeps it.
|
|
130
|
+
- Never draw a proposal solid, or a kept value dashed.
|
|
131
|
+
- Never hide the source.
|
|
132
|
+
|
|
133
|
+
## Example
|
|
134
|
+
|
|
135
|
+
A contact's found details, kept through the app's declared actions.
|
|
136
|
+
|
|
137
|
+
```jsx
|
|
138
|
+
"use client";
|
|
139
|
+
import { runAction } from "../lib/actions";
|
|
140
|
+
import { FieldSuggestion, SuggestionGroup } from "../components/blocks/suggestion";
|
|
141
|
+
|
|
142
|
+
export function FoundDetails({ person, suggestions, reload }) {
|
|
143
|
+
const done = (r) => {
|
|
144
|
+
if (r.ok) reload();
|
|
145
|
+
return r;
|
|
146
|
+
};
|
|
147
|
+
return (
|
|
148
|
+
<SuggestionGroup
|
|
149
|
+
title={`${suggestions.length} details found for ${person.first_name}`}
|
|
150
|
+
description="From her email signature and a web search. Nothing changes until you keep them."
|
|
151
|
+
count={suggestions.length}
|
|
152
|
+
onKeepAll={async () => done(await runAction({ name: "keep_details", args: { person: person.id } }))}
|
|
153
|
+
onDropAll={async () => done(await runAction({ name: "drop_details", args: { person: person.id } }))}
|
|
154
|
+
>
|
|
155
|
+
{suggestions.map((s) => (
|
|
156
|
+
<FieldSuggestion
|
|
157
|
+
key={s.id}
|
|
158
|
+
label={s.label}
|
|
159
|
+
current={person[s.column]}
|
|
160
|
+
value={s.value}
|
|
161
|
+
source={{ from: s.from, at: s.at }}
|
|
162
|
+
onKeep={async () => done(await runAction({ name: "keep_detail", args: { id: s.id } }))}
|
|
163
|
+
onDrop={async () => done(await runAction({ name: "drop_detail", args: { id: s.id } }))}
|
|
164
|
+
/>
|
|
165
|
+
))}
|
|
166
|
+
</SuggestionGroup>
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
In a server-mode app the same calls are `loadRows` in a server surface and the Server Actions of `lib/actions`.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "suggestion",
|
|
3
|
+
"title": "Suggestion",
|
|
4
|
+
"description": "A value the agent proposes, drawn in pencil — dashed while it is a proposal, solid once kept — with its source always shown and a keep or a drop. Five shapes: FieldSuggestion under a field (\"empty now\", the proposed value, where it came from, Keep and Drop); InlineSuggestion found in place, a small dashed chip inside the cell it would fill with a tick and a cross; TextSuggestion, a span of text struck with its replacement beside it, the reason and the source; Pencil, the dashed frame for a whole proposed record (\"pencil to ink\"); SuggestionGroup, the head over several (\"Keep all 6\", \"Drop all\"); and Looking while a value is still being found. The verbs are props (Keep/Drop, Apply/Dismiss, Accept/Decline). Keeps and drops go out through async callbacks that answer { ok }; a failure says why in place.",
|
|
5
|
+
"useWhen": "The agent proposes values or changes a person keeps or drops: a CRM filling in a contact, a cleaner value in a table cell, a priority on an issue, a proofread sentence, a drafted plan for the week, a batch of moves on a board. For a whole column of answers across many records use agent-column; for one ask's finished changes with an undo use agent-changes.",
|
|
6
|
+
"tags": [
|
|
7
|
+
"suggestion",
|
|
8
|
+
"proposal",
|
|
9
|
+
"keep",
|
|
10
|
+
"drop",
|
|
11
|
+
"accept",
|
|
12
|
+
"decline",
|
|
13
|
+
"apply",
|
|
14
|
+
"dismiss",
|
|
15
|
+
"pencil",
|
|
16
|
+
"field",
|
|
17
|
+
"inline",
|
|
18
|
+
"found in place",
|
|
19
|
+
"proofread",
|
|
20
|
+
"redline",
|
|
21
|
+
"diff",
|
|
22
|
+
"enrichment",
|
|
23
|
+
"source",
|
|
24
|
+
"review"
|
|
25
|
+
],
|
|
26
|
+
"exports": [
|
|
27
|
+
"FieldSuggestion",
|
|
28
|
+
"InlineSuggestion",
|
|
29
|
+
"TextSuggestion",
|
|
30
|
+
"Pencil",
|
|
31
|
+
"SuggestionGroup",
|
|
32
|
+
"Looking",
|
|
33
|
+
"suggestionSource"
|
|
34
|
+
],
|
|
35
|
+
"files": [
|
|
36
|
+
"index.js",
|
|
37
|
+
"suggestion.jsx"
|
|
38
|
+
],
|
|
39
|
+
"requires": []
|
|
40
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// Every shape of a suggestion, kept, dropped, saving and failing — the
|
|
4
|
+
// gallery's and the smoke test's surface. Not installed into apps.
|
|
5
|
+
import { Button, Card } from "../components/ui";
|
|
6
|
+
import { FieldSuggestion, InlineSuggestion, TextSuggestion, Pencil, SuggestionGroup, Looking } from "../components/blocks/suggestion";
|
|
7
|
+
|
|
8
|
+
const ok = () => new Promise((r) => setTimeout(() => r({ ok: true }), 600));
|
|
9
|
+
const no = () => new Promise((r) => setTimeout(() => r({ ok: false, error: "The table didn't answer. Try again." }), 600));
|
|
10
|
+
const slow = () => new Promise(() => undefined);
|
|
11
|
+
|
|
12
|
+
export default function SuggestionDemo() {
|
|
13
|
+
return (
|
|
14
|
+
<div className="grid gap-6 p-6 [grid-template-columns:repeat(auto-fit,minmax(min(100%,22rem),1fr))]">
|
|
15
|
+
<div className="grid content-start gap-4">
|
|
16
|
+
<SuggestionGroup
|
|
17
|
+
title="3 details found for Sofia: job title, LinkedIn and city"
|
|
18
|
+
description="From her email signature of Sat 12 Sep and a web search. Nothing changes until you keep them."
|
|
19
|
+
count={3}
|
|
20
|
+
onKeepAll={ok}
|
|
21
|
+
onDropAll={ok}
|
|
22
|
+
/>
|
|
23
|
+
<FieldSuggestion label="Job title" value="Head of Retail Operations" source={{ from: "her email signature", at: "2026-09-12" }} onKeep={ok} onDrop={ok} />
|
|
24
|
+
<FieldSuggestion label="LinkedIn" current="linkedin.com/in/sofia" value="linkedin.com/in/sofia-lindqvist" source="a web search" onKeep={no} onDrop={ok} />
|
|
25
|
+
<FieldSuggestion compact label="City" value="Minneapolis, MN · Central time" source="her email signature" onKeep={ok} onDrop={ok} />
|
|
26
|
+
<FieldSuggestion label="Priority" value="Urgent" source="three customers wrote in today" keepLabel="Apply" dropLabel="Dismiss" keptLabel="Applied" onKeep={slow} onDrop={ok} />
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div className="grid content-start gap-4">
|
|
30
|
+
<Card title="Found in place">
|
|
31
|
+
<table className="w-full table-fixed text-sm">
|
|
32
|
+
<tbody>
|
|
33
|
+
<tr className="border-b border-border">
|
|
34
|
+
<td className="w-[7.5rem] py-2 pr-3 text-muted-foreground">Phone</td>
|
|
35
|
+
<td className="py-2">
|
|
36
|
+
<InlineSuggestion label="Phone" value="+1 612 555 0142" source={{ from: "her email signature", at: "2026-09-12" }} onKeep={ok} onDrop={ok} />
|
|
37
|
+
</td>
|
|
38
|
+
</tr>
|
|
39
|
+
<tr className="border-b border-border">
|
|
40
|
+
<td className="py-2 pr-3 text-muted-foreground">Company size</td>
|
|
41
|
+
<td className="py-2">
|
|
42
|
+
<InlineSuggestion label="Company size" value="51–200" source="LinkedIn" onKeep={no} onDrop={ok} />
|
|
43
|
+
</td>
|
|
44
|
+
</tr>
|
|
45
|
+
<tr>
|
|
46
|
+
<td className="py-2 pr-3 text-muted-foreground">Website</td>
|
|
47
|
+
<td className="py-2">
|
|
48
|
+
<Looking />
|
|
49
|
+
</td>
|
|
50
|
+
</tr>
|
|
51
|
+
</tbody>
|
|
52
|
+
</table>
|
|
53
|
+
</Card>
|
|
54
|
+
|
|
55
|
+
<TextSuggestion
|
|
56
|
+
lead="We're sorry about "
|
|
57
|
+
before="you're"
|
|
58
|
+
after="your"
|
|
59
|
+
tail=" order arriving late."
|
|
60
|
+
reason="“Your” is the owner's; “you're” is “you are”."
|
|
61
|
+
source="Kestrel's style guide"
|
|
62
|
+
keepLabel="Accept"
|
|
63
|
+
dropLabel="Decline"
|
|
64
|
+
keptLabel="Accepted"
|
|
65
|
+
onKeep={ok}
|
|
66
|
+
onDrop={ok}
|
|
67
|
+
/>
|
|
68
|
+
<TextSuggestion before="we are working to resolve it" reason="Says nothing the next sentence doesn't." onKeep={ok} onDrop={ok} />
|
|
69
|
+
<TextSuggestion lead="Ships in " after="two to three" tail=" days." reason="The order page says two to three." onKeep={no} onDrop={ok} />
|
|
70
|
+
|
|
71
|
+
<Pencil
|
|
72
|
+
kicker="A new deal"
|
|
73
|
+
title="Crumb & Co: 22 shops"
|
|
74
|
+
reason="Sofia: “we're looking at scheduling for all 22 shops”"
|
|
75
|
+
actions={
|
|
76
|
+
<>
|
|
77
|
+
<Button size="sm" variant="primary">
|
|
78
|
+
Make the deal
|
|
79
|
+
</Button>
|
|
80
|
+
<Button size="sm" variant="quiet">
|
|
81
|
+
Drop
|
|
82
|
+
</Button>
|
|
83
|
+
</>
|
|
84
|
+
}
|
|
85
|
+
/>
|
|
86
|
+
<Pencil kicker="Monday" title="Pencilled: deep work 9–11, the board review at 2" state="kept" />
|
|
87
|
+
<Pencil kicker="A move" title="Harbor Seed to Proposal" state="failed" error="Proposal needs an amount first." />
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
}
|