makersclaw 0.8.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 +9 -3
- 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 +3 -3
- 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 +2 -2
- package/r/chat-pane.json +84 -0
- package/r/chat.json +2 -2
- 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 +13 -7
- 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 +2 -2
- package/r/flow-editor.json +79 -0
- package/r/footer.json +2 -2
- 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 +3 -3
- 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 +3 -3
- package/r/pace-bar.json +69 -0
- package/r/page-builder.json +2 -2
- package/r/payment-methods.json +2 -2
- package/r/pdf-document.json +2 -2
- package/r/pdf-viewer.json +2 -2
- 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 +4086 -1512
- 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 +2 -2
- package/r/signature-pad.json +2 -2
- package/r/sketch-canvas.json +2 -2
- 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 +3 -3
- 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/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/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-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/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/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/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/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/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/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/install.mjs +77 -16
- package/src/registry.mjs +3 -0
- package/templates/next/browser/lib/data.js +6 -1
- package/templates/next/files/README.md +627 -24
- 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 +968 -9
- 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 +2 -1
- package/templates/next/files/components/ui/layout.jsx +77 -2
- 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 +241 -5
- package/templates/next/files/lib/door.js +92 -0
- package/templates/next/files/lib/hooks.js +1627 -8
- package/templates/next/files/lib/platform.js +529 -21
- package/templates/next/template.json +13 -3
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Button, Icon, cx } from "../../ui";
|
|
5
|
+
import { AgentMark, Byline } from "../agent-marks";
|
|
6
|
+
|
|
7
|
+
// AgentChanges — the receipt of one ask (the app kit, D15): what the
|
|
8
|
+
// agent did in one line ("Sorted 46 stickies into 6 groups"), the changes
|
|
9
|
+
// listed (folded after five), and "Undo this ask". The block draws; the
|
|
10
|
+
// app's own declared undo action does the work, because only the app
|
|
11
|
+
// knows what an ask drew (Whiteboard's "violet trace", Mind Maps, Gantt's
|
|
12
|
+
// "Undo draft"). The list comes from useActivity({ agent: true, since })
|
|
13
|
+
// or from what the ask reported. Props in, callbacks out.
|
|
14
|
+
|
|
15
|
+
const FOLD = 5;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* summary what the ask did, one line ("Sorted 46 stickies into 6 groups")
|
|
19
|
+
* changes [{ id?, label, detail? }]: each change, newest last;
|
|
20
|
+
* folded after five
|
|
21
|
+
* by who and when: Byline's props ({ by, ask, at }), or words
|
|
22
|
+
* onUndo() async → { ok } | { ok: false, error }: the app's undo of
|
|
23
|
+
* this ask; without it there is no Undo (the member may not)
|
|
24
|
+
* undone true when the ask was undone already (from your data)
|
|
25
|
+
* undoLabel default "Undo this ask"
|
|
26
|
+
* undoneWords default "Undone. Everything this ask changed is back as it was."
|
|
27
|
+
* label the region's name for a reader (default the summary)
|
|
28
|
+
*/
|
|
29
|
+
export function AgentChanges({
|
|
30
|
+
summary,
|
|
31
|
+
changes = [],
|
|
32
|
+
by,
|
|
33
|
+
onUndo,
|
|
34
|
+
undone: undoneProp = false,
|
|
35
|
+
undoLabel = "Undo this ask",
|
|
36
|
+
undoneWords = "Undone. Everything this ask changed is back as it was.",
|
|
37
|
+
label,
|
|
38
|
+
className,
|
|
39
|
+
}) {
|
|
40
|
+
const [open, setOpen] = useState(false);
|
|
41
|
+
const [busy, setBusy] = useState(false);
|
|
42
|
+
const [error, setError] = useState(null);
|
|
43
|
+
const [undoneHere, setUndoneHere] = useState(false);
|
|
44
|
+
const undone = undoneProp || undoneHere;
|
|
45
|
+
const list = (changes ?? []).filter(Boolean);
|
|
46
|
+
const shown = open ? list : list.slice(0, FOLD);
|
|
47
|
+
const more = list.length - shown.length;
|
|
48
|
+
|
|
49
|
+
async function undo() {
|
|
50
|
+
if (!onUndo || busy) return;
|
|
51
|
+
setBusy(true);
|
|
52
|
+
setError(null);
|
|
53
|
+
let r;
|
|
54
|
+
try {
|
|
55
|
+
r = await onUndo();
|
|
56
|
+
} catch (e) {
|
|
57
|
+
r = { ok: false, error: e?.message ?? String(e) };
|
|
58
|
+
}
|
|
59
|
+
setBusy(false);
|
|
60
|
+
if (r && r.ok === false) setError(r.error || "Couldn't undo it. Try again.");
|
|
61
|
+
else setUndoneHere(true);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<section
|
|
66
|
+
aria-label={label ?? (typeof summary === "string" ? summary : "What the agent changed")}
|
|
67
|
+
className={cx("@container grid grid-cols-1 min-w-0 content-start gap-2.5 rounded-lg border border-border bg-card p-3.5 text-sm text-card-foreground", undone && "bg-muted", className)}
|
|
68
|
+
>
|
|
69
|
+
<div className="flex min-w-0 items-start gap-2">
|
|
70
|
+
<span className="mt-1 shrink-0">
|
|
71
|
+
<AgentMark label="The agent" />
|
|
72
|
+
</span>
|
|
73
|
+
<div className="grid grid-cols-1 min-w-0 flex-1 gap-0.5">
|
|
74
|
+
<p className={cx("min-w-0 break-words font-semibold", undone && "text-muted-foreground line-through")}>{summary}</p>
|
|
75
|
+
{by ? typeof by === "object" && !Array.isArray(by) && !by.$$typeof ? <Byline mark={false} {...by} /> : <span className="text-xs text-muted-foreground">{by}</span> : null}
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
{list.length ? (
|
|
80
|
+
<ul className={cx("m-0 grid grid-cols-1 list-none gap-1 p-0 pl-5", undone && "text-muted-foreground")}>
|
|
81
|
+
{shown.map((c, i) => (
|
|
82
|
+
<li key={c.id ?? i} className="flex min-w-0 items-start gap-2">
|
|
83
|
+
<Icon name={undone ? "undo" : "check"} size={12} className={cx("mt-1 shrink-0", undone ? "text-muted-foreground" : "text-success")} />
|
|
84
|
+
<span className="min-w-0 break-words">
|
|
85
|
+
<span className={undone ? "line-through" : undefined}>{c.label}</span>
|
|
86
|
+
{c.detail ? <span className="text-muted-foreground"> · {c.detail}</span> : null}
|
|
87
|
+
</span>
|
|
88
|
+
</li>
|
|
89
|
+
))}
|
|
90
|
+
</ul>
|
|
91
|
+
) : null}
|
|
92
|
+
{list.length > FOLD ? (
|
|
93
|
+
<Button variant="link" size="inherit" tone="muted" className="justify-self-start pl-5 text-xs" aria-expanded={open} onClick={() => setOpen((v) => !v)}>
|
|
94
|
+
{open ? "Show fewer" : `Show ${more} more`}
|
|
95
|
+
</Button>
|
|
96
|
+
) : null}
|
|
97
|
+
|
|
98
|
+
{undone ? (
|
|
99
|
+
<p role="status" className="flex items-center gap-1.5 text-xs text-muted-foreground">
|
|
100
|
+
<Icon name="undo" size={14} className="shrink-0" />
|
|
101
|
+
{undoneWords}
|
|
102
|
+
</p>
|
|
103
|
+
) : onUndo ? (
|
|
104
|
+
<div className="flex min-w-0 flex-wrap items-center gap-2">
|
|
105
|
+
<Button size="sm" variant="secondary" loading={busy} onClick={undo}>
|
|
106
|
+
<Icon name="undo" size={14} /> {undoLabel}
|
|
107
|
+
</Button>
|
|
108
|
+
{list.length ? <span className="text-xs text-muted-foreground">{list.length === 1 ? "takes it back" : `takes back all ${list.length} changes`}</span> : null}
|
|
109
|
+
</div>
|
|
110
|
+
) : null}
|
|
111
|
+
{error ? (
|
|
112
|
+
<p role="alert" className="text-xs text-destructive">
|
|
113
|
+
{error}
|
|
114
|
+
</p>
|
|
115
|
+
) : null}
|
|
116
|
+
</section>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-changes",
|
|
3
|
+
"title": "AgentChanges",
|
|
4
|
+
"description": "The receipt of one ask: what the agent did in one line (\"Sorted 46 stickies into 6 groups\"), who asked and when, the changes listed (folded after five, \"Show 41 more\"), and \"Undo this ask\" — your async undo, the app's own declared action, answering { ok } — then the undone state, struck through, in words. The block draws; the app knows what an ask changed and takes it back.",
|
|
5
|
+
"useWhen": "After the agent changes many things at once on a member's ask and the member should see them and take them all back in one press: a whiteboard sorted into groups, a mind map grown, a plan drafted onto a Gantt, a batch of records tidied. Not for proposals waiting to be kept (suggestion) or for the app's whole history (activity-log).",
|
|
6
|
+
"tags": [
|
|
7
|
+
"undo",
|
|
8
|
+
"changes",
|
|
9
|
+
"receipt",
|
|
10
|
+
"ask",
|
|
11
|
+
"what changed",
|
|
12
|
+
"revert",
|
|
13
|
+
"trace",
|
|
14
|
+
"batch",
|
|
15
|
+
"summary",
|
|
16
|
+
"history"
|
|
17
|
+
],
|
|
18
|
+
"exports": [
|
|
19
|
+
"AgentChanges"
|
|
20
|
+
],
|
|
21
|
+
"files": [
|
|
22
|
+
"index.js",
|
|
23
|
+
"agent-changes.jsx"
|
|
24
|
+
],
|
|
25
|
+
"requires": [
|
|
26
|
+
"agent-marks"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// AgentChanges for a big ask (folded), a small one, an undo that fails,
|
|
4
|
+
// one already undone, and one the member may not undo — the gallery's and
|
|
5
|
+
// the smoke test's surface. Not installed into apps.
|
|
6
|
+
import { AgentChanges } from "../components/blocks/agent-changes";
|
|
7
|
+
|
|
8
|
+
const GROUPS = ["Pricing", "Onboarding", "Scheduling", "Reports", "Mobile", "Integrations"];
|
|
9
|
+
const MOVES = Array.from({ length: 46 }, (_, i) => ({ id: `m${i}`, label: `Sticky ${i + 1}`, detail: `to ${GROUPS[i % GROUPS.length]}` }));
|
|
10
|
+
|
|
11
|
+
const later = (r, ms = 700) => () => new Promise((res) => setTimeout(() => res(r), ms));
|
|
12
|
+
|
|
13
|
+
export default function AgentChangesDemo() {
|
|
14
|
+
return (
|
|
15
|
+
<div className="grid gap-6 p-6 [grid-template-columns:repeat(auto-fit,minmax(min(100%,20rem),1fr))]">
|
|
16
|
+
<AgentChanges summary="Sorted 46 stickies into 6 groups" by={{ ask: "Priya", at: "11:20" }} changes={MOVES} onUndo={later({ ok: true })} />
|
|
17
|
+
<AgentChanges
|
|
18
|
+
summary="Drafted the launch plan onto the chart"
|
|
19
|
+
by={{ ask: "you", at: new Date() }}
|
|
20
|
+
changes={[
|
|
21
|
+
{ label: "Beta invites", detail: "Mon 3 Nov – Fri 7 Nov" },
|
|
22
|
+
{ label: "Press kit", detail: "Tue 4 Nov – Thu 13 Nov" },
|
|
23
|
+
{ label: "Launch day", detail: "Tue 18 Nov" },
|
|
24
|
+
]}
|
|
25
|
+
onUndo={later({ ok: false, error: "Two of these bars were moved by Owen since. Undo them one by one." })}
|
|
26
|
+
/>
|
|
27
|
+
<AgentChanges summary="Grew the Pricing branch by 5 ideas" by={{ ask: "run", at: "07:00" }} changes={MOVES.slice(0, 5)} undone />
|
|
28
|
+
<AgentChanges summary="Tidied 12 company names" by="By the agent, on Owen's ask · yesterday" changes={[{ label: "ACME corp → Acme Corp" }]} />
|
|
29
|
+
<div className="w-80 max-w-full">
|
|
30
|
+
<AgentChanges
|
|
31
|
+
summary="Merged Harborview Hospitality Group and Harborview Hospitality Group Ltd, a duplicate found in last week's import"
|
|
32
|
+
by={{ ask: "Anastasia", at: "09:05" }}
|
|
33
|
+
changes={[{ label: "Kept the older record, with every note and deal from both" }]}
|
|
34
|
+
onUndo={later({ ok: true })}
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# AgentChat
|
|
2
|
+
|
|
3
|
+
The app's own chat with its agent, drawn in the app's look. The member
|
|
4
|
+
types; the agent's answer appears as it is written, with one line per
|
|
5
|
+
step it takes ("Searching the web"), folded into "Worked through 6 steps"
|
|
6
|
+
once the turn ends. Stop is one press away while it works.
|
|
7
|
+
|
|
8
|
+
It is the same conversation the desk's agent column shows: one session,
|
|
9
|
+
two views, never a copy. A member who opens the column on the desk reads
|
|
10
|
+
the same thread, and either place can continue it.
|
|
11
|
+
|
|
12
|
+
What waits on the member is settled in the chat, where it was asked:
|
|
13
|
+
|
|
14
|
+
- **The agent's question** is answered in place (0.8.1, D19): its options,
|
|
15
|
+
one press each, and a box for the member's own words where the question
|
|
16
|
+
welcomes them (`chat.answer`). The same checks as the desk's form.
|
|
17
|
+
- **The agent's yes** is the `approval` block's press frame, handed in as
|
|
18
|
+
`yes`. The chat never draws an Approve of its own: the press is
|
|
19
|
+
Makersclaw's, in a frame the app's code cannot script. Without `yes` the
|
|
20
|
+
chat says "Waiting for your yes on the desk" with the agent's words and
|
|
21
|
+
"Open on the desk".
|
|
22
|
+
- **Connecting an account**, and **money**: on the desk, always, and
|
|
23
|
+
several questions at once.
|
|
24
|
+
|
|
25
|
+
```jsx
|
|
26
|
+
import { AgentChat } from "../components/blocks/agent-chat"; // a Makersclaw app ("./blocks/agent-chat" from components/)
|
|
27
|
+
import { AgentChat } from "@/components/makersclaw/blocks/agent-chat"; // a shadcn project
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
A client component. It draws the object `useAgentThread()` returns
|
|
31
|
+
(lib/hooks.js); asking stays with the hook. The Example is at the end.
|
|
32
|
+
|
|
33
|
+
## Tell the desk
|
|
34
|
+
|
|
35
|
+
An app that places this block says so in its package: `"agent_in_app":
|
|
36
|
+
true` in `store.json`'s `seeds.blueprint` (a built app: in its
|
|
37
|
+
blueprint). The desk then keeps its agent column folded for the app, and
|
|
38
|
+
an ask from the app's screens never opens the column by itself; the
|
|
39
|
+
column still opens from the window's Show agent control, on the same
|
|
40
|
+
thread. Without the flag the desk opens its column on every ask, as it
|
|
41
|
+
did before, and the member sees two agent panes.
|
|
42
|
+
|
|
43
|
+
## Props
|
|
44
|
+
|
|
45
|
+
- `chat` — what `useAgentThread()` returns. Required.
|
|
46
|
+
- `title` — the head's words, and the box's label. Default `"Ask the
|
|
47
|
+
agent"`. About a record: `"Ask about Pinewood"`.
|
|
48
|
+
- `suggestions` — asks that fit the moment, as chips before the first ask.
|
|
49
|
+
A chip sends its words. Long ones wrap; they never run off the column.
|
|
50
|
+
- `empty` — one line before the first ask. Say what the agent can do here,
|
|
51
|
+
in the app's words. Never where the answer appears: it appears here.
|
|
52
|
+
- `placeholder` — the box's words. Default `"Ask anything…"`.
|
|
53
|
+
- `yes` — a node drawn in place of the bar when the agent waits on a yes
|
|
54
|
+
the app can take (`chat.needs.in_app === "press"`): the `approval`
|
|
55
|
+
block, fed by `useApproval(chat.request.id)`. Hook it only for that
|
|
56
|
+
need: `useApproval(chat.needs?.in_app === "press" ? chat.request?.id : null)`.
|
|
57
|
+
- `onClose` — a close in the head, for a panel beside a record.
|
|
58
|
+
- `bare` — no head, inside a `Sheet` or a `Card` that has its own.
|
|
59
|
+
- `fill` — default `true`: the chat takes its container's height (a
|
|
60
|
+
panel, a sheet) and the thread scrolls inside it. `false`: a compact
|
|
61
|
+
chat for a card in a column (an inspector, a home screen's side): it is
|
|
62
|
+
as tall as its content, and once a thread starts it scrolls inside a
|
|
63
|
+
capped height.
|
|
64
|
+
- `className` — layout around it. Never colour.
|
|
65
|
+
|
|
66
|
+
## useAgentThread (lib/hooks.js)
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
const chat = useAgentThread({ row, how, job, key });
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
- `row` — the record the chat is about, `{ kind, id, name }`. It rides
|
|
73
|
+
with every ask as context, and the thread is kept for it: open the same
|
|
74
|
+
record again and its chat is there.
|
|
75
|
+
- `how` — instructions for the agent only.
|
|
76
|
+
- `job` — a declared job's key, or `true`. Default none: a chat is a
|
|
77
|
+
conversation, not a job.
|
|
78
|
+
- `key` — where this browser keeps the thread (default the row's
|
|
79
|
+
`kind:id`, else `"app"`); `null` keeps none.
|
|
80
|
+
|
|
81
|
+
It returns `sessionId`, `state` (`queued` · `working` · `needs_you` ·
|
|
82
|
+
`done` · `stopped` · `failed`, or null before the first ask), `needs`
|
|
83
|
+
(`{ kind, text, at, in_app, options?, free? }` while it waits on the
|
|
84
|
+
member: `in_app` is `"answer"`, `"press"` or null for the desk), `turns`, `pending`,
|
|
85
|
+
`place` (`"makersclaw"` for an ask made in Makersclaw: the chat shows a
|
|
86
|
+
pointer, not the turns), `request`, `sending`, `loading`, `error`,
|
|
87
|
+
`unavailable`, and `send(text)`, `stop()`, `answer({ optionId | text })`,
|
|
88
|
+
`openOnDesk()`, `newChat()`, `reload()`.
|
|
89
|
+
|
|
90
|
+
It reads `GET _claw/threads/<session>` (lib/platform.js `thread`): the
|
|
91
|
+
member's own thread in this app, never a teammate's. It looks every
|
|
92
|
+
1.5 s while the agent works, every 6 s while it waits on the member, and
|
|
93
|
+
not at all once the turn has ended or the page is hidden.
|
|
94
|
+
|
|
95
|
+
## Outside Makersclaw
|
|
96
|
+
|
|
97
|
+
Any object of the same shape works: `turns` (`[{ id, member, parts:
|
|
98
|
+
[{ type: "text", text } | { type: "step", label, status }], writing,
|
|
99
|
+
status }]`), `state`, `needs`, `pending`, and the five functions.
|
|
100
|
+
|
|
101
|
+
## Example
|
|
102
|
+
|
|
103
|
+
A chat about the person a screen has open, beside the record.
|
|
104
|
+
|
|
105
|
+
```jsx
|
|
106
|
+
"use client";
|
|
107
|
+
import { useAgentThread } from "../lib/hooks";
|
|
108
|
+
import { AgentChat } from "../components/blocks/agent-chat";
|
|
109
|
+
|
|
110
|
+
export default function PersonAsk({ person }) {
|
|
111
|
+
const chat = useAgentThread({ row: { kind: "person", id: person.id, name: person.name } });
|
|
112
|
+
return (
|
|
113
|
+
<AgentChat
|
|
114
|
+
chat={chat}
|
|
115
|
+
title={`Ask about ${person.name}`}
|
|
116
|
+
suggestions={["What did we last talk about?", "Draft a follow-up"]}
|
|
117
|
+
/>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
On a home screen, the same chat as a card in the side column: `fill={false}` and `bare`
|
|
123
|
+
inside a `Card` that has its own title.
|
|
124
|
+
|
|
125
|
+
A chat that settles what waits on the member in place: the question
|
|
126
|
+
answered in the chat, the yes pressed in the approval card above it.
|
|
127
|
+
|
|
128
|
+
```jsx
|
|
129
|
+
"use client";
|
|
130
|
+
import { useAgentThread, useApproval } from "../lib/hooks";
|
|
131
|
+
import { AgentChat } from "../components/blocks/agent-chat";
|
|
132
|
+
import { Approval } from "../components/blocks/approval";
|
|
133
|
+
|
|
134
|
+
export default function Ask() {
|
|
135
|
+
const chat = useAgentThread();
|
|
136
|
+
// Only for the one ask's yes; useApproval(null) asks nothing.
|
|
137
|
+
const approval = useApproval(chat.needs?.in_app === "press" ? chat.request?.id : null);
|
|
138
|
+
return (
|
|
139
|
+
<AgentChat
|
|
140
|
+
chat={chat}
|
|
141
|
+
yes={<Approval approval={approval} title="Waiting for your yes" onOpenDesk={chat.openOnDesk} />}
|
|
142
|
+
/>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
```
|