makersclaw 0.8.0 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +234 -0
- package/registry/blocks/agent-pane/agent-pane.jsx +246 -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 +1677 -8
- package/templates/next/files/lib/platform.js +529 -21
- package/templates/next/template.json +13 -3
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Icon, cx } from "../../ui";
|
|
4
|
+
|
|
5
|
+
// The two marks every app draws, one of each for the whole platform
|
|
6
|
+
// (the app kit, D15). Before the kit the
|
|
7
|
+
// redesigns drew the agent in six different glyphs; now:
|
|
8
|
+
//
|
|
9
|
+
// AgentMark a filled diamond: the agent's work. It used tools, read
|
|
10
|
+
// and wrote, and it may cost more than one call.
|
|
11
|
+
// CallMark a sparkle in a dashed ring: ONE model call, no
|
|
12
|
+
// conversation and no tools ("Shorter · 1 cr").
|
|
13
|
+
//
|
|
14
|
+
// The difference is shape (filled vs dashed), never colour alone. Byline
|
|
15
|
+
// says who did a thing in words: "By the agent, on Priya's ask · 11:20".
|
|
16
|
+
// No data, no door: props in.
|
|
17
|
+
|
|
18
|
+
const PX = { xs: 10, sm: 12, md: 14, lg: 16 };
|
|
19
|
+
const px = (size) => (typeof size === "number" ? size : PX[size] ?? PX.sm);
|
|
20
|
+
|
|
21
|
+
/** A mark that names itself when `label` is given, and is decoration
|
|
22
|
+
* (hidden from a reader) when the words beside it already say it. */
|
|
23
|
+
function marked(label) {
|
|
24
|
+
return label ? { role: "img", "aria-label": label } : { "aria-hidden": true };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* label what a screen reader hears ("The agent"); leave it out when
|
|
29
|
+
* the words beside the mark already say it
|
|
30
|
+
* size xs · sm (default) · md · lg, or pixels
|
|
31
|
+
* children words drawn beside the mark ("Agent")
|
|
32
|
+
*/
|
|
33
|
+
export function AgentMark({ label, size = "sm", className, children }) {
|
|
34
|
+
const s = px(size);
|
|
35
|
+
const mark = (
|
|
36
|
+
<span {...(children ? { "aria-hidden": true } : marked(label))} className={cx("inline-flex shrink-0 text-primary", !children && className)}>
|
|
37
|
+
<Icon name="diamond" size={s} className="fill-current" />
|
|
38
|
+
</span>
|
|
39
|
+
);
|
|
40
|
+
if (!children) return mark;
|
|
41
|
+
return (
|
|
42
|
+
<span className={cx("inline-flex min-w-0 items-center gap-1", className)}>
|
|
43
|
+
{mark}
|
|
44
|
+
<span className="min-w-0">{children}</span>
|
|
45
|
+
</span>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* label what a screen reader hears ("One model call"); leave it out
|
|
51
|
+
* when the words beside the mark already say it
|
|
52
|
+
* size xs · sm (default) · md · lg, or pixels
|
|
53
|
+
* children words drawn beside the mark ("1 call")
|
|
54
|
+
*/
|
|
55
|
+
export function CallMark({ label, size = "sm", className, children }) {
|
|
56
|
+
const s = px(size);
|
|
57
|
+
const ring = s + 4;
|
|
58
|
+
const mark = (
|
|
59
|
+
<span
|
|
60
|
+
{...(children ? { "aria-hidden": true } : marked(label))}
|
|
61
|
+
style={{ width: ring, height: ring }}
|
|
62
|
+
className={cx(
|
|
63
|
+
"inline-flex shrink-0 items-center justify-center rounded-full border border-dashed border-current text-muted-foreground",
|
|
64
|
+
!children && className,
|
|
65
|
+
)}
|
|
66
|
+
>
|
|
67
|
+
<Icon name="sparkles" size={Math.max(8, s - 3)} />
|
|
68
|
+
</span>
|
|
69
|
+
);
|
|
70
|
+
if (!children) return mark;
|
|
71
|
+
return (
|
|
72
|
+
<span className={cx("inline-flex min-w-0 items-center gap-1", className)}>
|
|
73
|
+
{mark}
|
|
74
|
+
<span className="min-w-0">{children}</span>
|
|
75
|
+
</span>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const ISO = /^\d{4}-\d{2}-\d{2}T/;
|
|
80
|
+
|
|
81
|
+
/** "11:20" for a moment today, "12 Sep" for another day; words as given. */
|
|
82
|
+
function whenWords(at) {
|
|
83
|
+
if (at == null || at === "") return null;
|
|
84
|
+
const d = at instanceof Date ? at : typeof at === "string" && ISO.test(at) ? new Date(at) : null;
|
|
85
|
+
if (!d) return { words: String(at), iso: undefined };
|
|
86
|
+
if (Number.isNaN(d.getTime())) return null;
|
|
87
|
+
const now = new Date();
|
|
88
|
+
const today = d.toDateString() === now.toDateString();
|
|
89
|
+
const words = today
|
|
90
|
+
? d.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" })
|
|
91
|
+
: d.toLocaleDateString("en-GB", { day: "numeric", month: "short" });
|
|
92
|
+
return { words, iso: d.toISOString() };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** "Priya's", "James'", "your". */
|
|
96
|
+
function whose(name) {
|
|
97
|
+
const n = String(name).trim();
|
|
98
|
+
if (/^you$/i.test(n)) return "your";
|
|
99
|
+
return /s$/i.test(n) ? `${n}'` : `${n}'s`;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Who did it, in words.
|
|
104
|
+
*
|
|
105
|
+
* by "agent" (the agent's work, its mark before it), "call" (one
|
|
106
|
+
* model call), or a person's name
|
|
107
|
+
* ask whose ask the agent worked on ("Priya", or "you"); a job's run
|
|
108
|
+
* is `ask="run"` → "on a run"
|
|
109
|
+
* at words ("11:20"), a Date or an ISO string
|
|
110
|
+
* mark false: no mark before the words (a head that already has one)
|
|
111
|
+
*/
|
|
112
|
+
export function Byline({ by = "agent", ask, at, mark = true, className }) {
|
|
113
|
+
const agent = by === "agent";
|
|
114
|
+
const call = by === "call";
|
|
115
|
+
const who = agent ? "By the agent" : call ? "By one model call" : `By ${by}`;
|
|
116
|
+
const on = (agent || call) && ask ? (ask === "run" ? "on a run" : `on ${whose(ask)} ask`) : null;
|
|
117
|
+
const when = whenWords(at);
|
|
118
|
+
return (
|
|
119
|
+
<span className={cx("inline-flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs text-muted-foreground", className)}>
|
|
120
|
+
{!mark ? null : agent ? <AgentMark /> : call ? <CallMark /> : null}
|
|
121
|
+
<span className="min-w-0 break-words">
|
|
122
|
+
{who}
|
|
123
|
+
{on ? `, ${on}` : ""}
|
|
124
|
+
{when ? (
|
|
125
|
+
<>
|
|
126
|
+
{" · "}
|
|
127
|
+
<time dateTime={when.iso}>{when.words}</time>
|
|
128
|
+
</>
|
|
129
|
+
) : null}
|
|
130
|
+
</span>
|
|
131
|
+
</span>
|
|
132
|
+
);
|
|
133
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-marks",
|
|
3
|
+
"title": "AgentMarks",
|
|
4
|
+
"description": "The platform's two marks and its byline: AgentMark, a filled diamond for the agent's work (it used tools, read and wrote, it may cost more than one call); CallMark, a sparkle in a dashed ring for one model call (a Summarize, a Shorter); and Byline, who did a thing in words (\"By the agent, on Priya's ask · 11:20\", \"By one model call\", \"By Owen\"). The two differ in shape, never colour alone, and each names itself to a screen reader when no words stand beside it.",
|
|
5
|
+
"useWhen": "Anywhere a screen holds work that was not a person's own: a value the agent wrote, a line in a timeline, a draft from one model call, the head of an ask's receipt. Use these instead of drawing a sparkle or a robot of your own, so every app marks the agent the same way. The other kit blocks (ai-action, agent-changes, activity-log, needs-you) already use them.",
|
|
6
|
+
"tags": [
|
|
7
|
+
"ai",
|
|
8
|
+
"mark",
|
|
9
|
+
"badge",
|
|
10
|
+
"byline",
|
|
11
|
+
"provenance",
|
|
12
|
+
"model call",
|
|
13
|
+
"llm",
|
|
14
|
+
"who did it",
|
|
15
|
+
"author"
|
|
16
|
+
],
|
|
17
|
+
"exports": [
|
|
18
|
+
"AgentMark",
|
|
19
|
+
"CallMark",
|
|
20
|
+
"Byline"
|
|
21
|
+
],
|
|
22
|
+
"files": [
|
|
23
|
+
"index.js",
|
|
24
|
+
"agent-marks.jsx"
|
|
25
|
+
],
|
|
26
|
+
"requires": []
|
|
27
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// The marks and the byline, every size and every way of saying who — the
|
|
4
|
+
// gallery's and the smoke test's surface. Not installed into apps.
|
|
5
|
+
import { Card } from "../components/ui";
|
|
6
|
+
import { AgentMark, CallMark, Byline } from "../components/blocks/agent-marks";
|
|
7
|
+
|
|
8
|
+
export default function AgentMarksDemo() {
|
|
9
|
+
const earlier = new Date(Date.now() - 3 * 24 * 3600 * 1000).toISOString();
|
|
10
|
+
return (
|
|
11
|
+
<div className="grid gap-6 p-6">
|
|
12
|
+
<Card title="The two marks">
|
|
13
|
+
<div className="grid gap-3 text-sm">
|
|
14
|
+
<div className="flex flex-wrap items-center gap-4">
|
|
15
|
+
<AgentMark size="xs" label="The agent" />
|
|
16
|
+
<AgentMark size="sm" label="The agent" />
|
|
17
|
+
<AgentMark size="md" label="The agent" />
|
|
18
|
+
<AgentMark size="lg" label="The agent" />
|
|
19
|
+
<AgentMark>Agent</AgentMark>
|
|
20
|
+
</div>
|
|
21
|
+
<div className="flex flex-wrap items-center gap-4">
|
|
22
|
+
<CallMark size="xs" label="One model call" />
|
|
23
|
+
<CallMark size="sm" label="One model call" />
|
|
24
|
+
<CallMark size="md" label="One model call" />
|
|
25
|
+
<CallMark size="lg" label="One model call" />
|
|
26
|
+
<CallMark>1 call</CallMark>
|
|
27
|
+
</div>
|
|
28
|
+
<p className="flex items-center gap-1.5">
|
|
29
|
+
<AgentMark label="Written by the agent" />
|
|
30
|
+
Head of Product at Pennant Pay
|
|
31
|
+
</p>
|
|
32
|
+
</div>
|
|
33
|
+
</Card>
|
|
34
|
+
<Card title="Bylines">
|
|
35
|
+
<div className="grid gap-2">
|
|
36
|
+
<Byline by="agent" ask="Priya" at="11:20" />
|
|
37
|
+
<Byline by="agent" ask="you" at={new Date()} />
|
|
38
|
+
<Byline by="agent" ask="run" at={earlier} />
|
|
39
|
+
<Byline by="agent" ask="James" />
|
|
40
|
+
<Byline by="call" at="09:02" />
|
|
41
|
+
<Byline by="Owen Park" at="Yesterday" />
|
|
42
|
+
</div>
|
|
43
|
+
</Card>
|
|
44
|
+
<div className="w-80 max-w-full rounded-lg border border-border p-3">
|
|
45
|
+
<Byline by="agent" ask="Anastasia Konstantinopoulou-Whitfield" at="a very long afternoon, 14 September" />
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# AgentPane
|
|
2
|
+
|
|
3
|
+
The desk's agent sidebar, as the app's own pane, in the app's theme (0.8.1,
|
|
4
|
+
D27). It replaces `agent-chat`: the founder found that chat "not on par
|
|
5
|
+
with the desk agent sidebar, in terms of tool calls, questions, showing
|
|
6
|
+
information", so this is the sidebar, not a smaller chat.
|
|
7
|
+
|
|
8
|
+
It shows what the sidebar shows:
|
|
9
|
+
|
|
10
|
+
- the member's words, and the agent's text as it is written;
|
|
11
|
+
- the **plan**, a checklist that ticks as the agent works;
|
|
12
|
+
- the **work**, folded: the steps between two things the agent said are one
|
|
13
|
+
line, "Worked through 26 steps" (or the step running now, with a
|
|
14
|
+
spinner); open it for one line per step, each with a mono tag, what it
|
|
15
|
+
did in words, and a word for how it ended. **Open a step** for its facts,
|
|
16
|
+
the command or statement worth reading, what came back, and why it
|
|
17
|
+
failed;
|
|
18
|
+
- reads folded ("Read 6 files"), retries a later call fixed ("Fixed 2
|
|
19
|
+
issues on the way"), the same line again ("Checked on the build · 5
|
|
20
|
+
times"), a failure nothing fixed with its few plain words, and a card of
|
|
21
|
+
**helpers** started side by side;
|
|
22
|
+
- the agent's **questions** as one form: several at once, options as
|
|
23
|
+
chips, a box for the member's own words, one submit; an answered one
|
|
24
|
+
shrinks to a line;
|
|
25
|
+
- the one ask's **yes** as the `approval` block's press frame (`yes`);
|
|
26
|
+
- what it **made**: an app, files, addresses;
|
|
27
|
+
- the **past chats** (a dot on those that need you or work), New chat,
|
|
28
|
+
Stop ("Stopping…" after the press), "You stopped it", "It stopped before
|
|
29
|
+
finishing" in plain words, jump to latest.
|
|
30
|
+
|
|
31
|
+
It is the same conversation the desk's sidebar shows: one session, two
|
|
32
|
+
views. The lines and what they say are decided by the platform, with the
|
|
33
|
+
rules the sidebar runs, and sent as data; this block draws them and nothing
|
|
34
|
+
else. So a new tool the platform learns to describe reads right in every
|
|
35
|
+
app at once, with no change here.
|
|
36
|
+
|
|
37
|
+
```jsx
|
|
38
|
+
import { AgentPane } from "../components/blocks/agent-pane"; // a Makersclaw app ("./blocks/agent-pane" from components/)
|
|
39
|
+
import { AgentPane } from "@/components/makersclaw/blocks/agent-pane"; // a shadcn project
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
A client component. It draws the object `useAgentPane()` returns
|
|
43
|
+
(lib/hooks.js); asking stays with the hook. The Example is at the end.
|
|
44
|
+
|
|
45
|
+
## The frame is `chat-pane`
|
|
46
|
+
|
|
47
|
+
The head (title, New chat, Chats, close), the empty state, the scroll, the
|
|
48
|
+
message box and a starting line from the dock are the `chat-pane` block
|
|
49
|
+
(X5): the desk's chat pane, ported. This block is what the **agent** puts in
|
|
50
|
+
it: the lines (plan, folded work, questions, what it made) and the bar of what
|
|
51
|
+
waits on the member. `AgentPane` is `ChatPane` with those inside, so every
|
|
52
|
+
app that draws `AgentPane` has the desk's message box: the words on top, + to
|
|
53
|
+
attach and a round send under them, the microphone beside it, a round stop in
|
|
54
|
+
the send's place while a turn runs.
|
|
55
|
+
|
|
56
|
+
## Follow-ups are the same conversation
|
|
57
|
+
|
|
58
|
+
A message after a Stop, a finished ask or a failed turn goes on in the
|
|
59
|
+
same session and the same request (D29): the platform opens the closed
|
|
60
|
+
request again, so there is no second card and nothing jumps. The pane
|
|
61
|
+
sends every message with the thread's session (`useAgentPane` never starts
|
|
62
|
+
a fresh one for it) and says "Ask a follow-up…" once a thread exists.
|
|
63
|
+
Only a plan or a piece of one, a change the agent sent up, a counted job
|
|
64
|
+
and a hand-off that never started get a new request; for those
|
|
65
|
+
`chat.sameConversation` is false and the box keeps the app's own words.
|
|
66
|
+
|
|
67
|
+
## Questions keep the conversation open
|
|
68
|
+
|
|
69
|
+
While a question waits, the main composer stays available. Sending there
|
|
70
|
+
skips that question and continues the same thread, including attachments.
|
|
71
|
+
Answering the question removes it immediately while the answer is sent; a
|
|
72
|
+
failed submission restores it for retry. Stale thread reads cannot bring an
|
|
73
|
+
accepted question back, but a new question still appears. Approval, account
|
|
74
|
+
connection and credit-limit gates keep their existing controls.
|
|
75
|
+
|
|
76
|
+
## Tell the desk
|
|
77
|
+
|
|
78
|
+
An app that places this block says so in its package: `"agent_pane": true`
|
|
79
|
+
in `store.json`'s `seeds.blueprint` (a built app: in its blueprint). The
|
|
80
|
+
desk then draws no agent sidebar for the app's window: no column, no Agent
|
|
81
|
+
tab. The pane is the conversation. Without the flag the desk keeps its
|
|
82
|
+
sidebar, and the member sees two agent panes.
|
|
83
|
+
|
|
84
|
+
## What the app controls
|
|
85
|
+
|
|
86
|
+
- **Where it sits**: in the app's `agent-dock` (a column beside the work, the
|
|
87
|
+
desk's own shape; one per app, in the shell). Inside a dock the head's close
|
|
88
|
+
folds the column with no `onClose` from you. A compact card in a column of
|
|
89
|
+
its own is also fine (`fill={false}`). Do not put the shell's agent in a
|
|
90
|
+
modal `Sheet` that dims the work: that is what the dock replaced. `bare`
|
|
91
|
+
drops the head.
|
|
92
|
+
- **What it is about**: `useAgentPane({ row })`. `row` is the record on
|
|
93
|
+
screen (`{ kind, id, name }`); it rides with every ask as context and the
|
|
94
|
+
thread is kept for that record. `how` is one sentence for the agent only.
|
|
95
|
+
The ask is `chat.send(text)`, so an Ask button, an ask bar or a chip all
|
|
96
|
+
start or continue the same conversation.
|
|
97
|
+
- **Its first line**: a button that says the agent will do the work calls
|
|
98
|
+
`openAgent("Draft a project plan for me")` (blocks/agent-dock). The pane
|
|
99
|
+
inside the dock sends that line in a new chat and the agent asks only for
|
|
100
|
+
what it is missing; no form first (X9).
|
|
101
|
+
- **Its words**: `title`, `empty`, `suggestions`, `placeholder`, `hint`.
|
|
102
|
+
- **Nothing else.** No colour props: the app's theme paints it.
|
|
103
|
+
|
|
104
|
+
## Props
|
|
105
|
+
|
|
106
|
+
- `chat` — what `useAgentPane()` returns. Required.
|
|
107
|
+
- `title` — the head's words, and the box's label. Default `"Ask the
|
|
108
|
+
agent"`. About a record: `"Ask about Pinewood"`.
|
|
109
|
+
- `suggestions` — asks that fit the moment, as chips before the first ask.
|
|
110
|
+
- `empty` — one line before the first ask. Say what the agent can do here,
|
|
111
|
+
in the app's words.
|
|
112
|
+
- `placeholder` — the box's words. Default `"Ask anything…"`.
|
|
113
|
+
- `hint` — a quiet line under the box.
|
|
114
|
+
- `yes` — a node drawn in place of the bar when the agent waits on a yes
|
|
115
|
+
the app can take (`chat.needs.in_app === "press"`): the `approval` block,
|
|
116
|
+
fed by `useApproval(chat.request.id)`. Hook it only for that need:
|
|
117
|
+
`useApproval(chat.needs?.in_app === "press" ? chat.request?.id : null)`.
|
|
118
|
+
- `mark` — a node before the agent's turns (the app's mark). Default none.
|
|
119
|
+
- `onOpen` — `({ kind: "app", id } | { kind: "file", path, where, appRef })`:
|
|
120
|
+
the Open of something it made. Default: `chat.open` (the desk opens it).
|
|
121
|
+
- `onClose` — a close in the head. Inside an `agent-dock` it is the dock's
|
|
122
|
+
own (the column folds) unless you give one.
|
|
123
|
+
- `recent` — how many past chats the empty state lists before the first ask,
|
|
124
|
+
with an "All N chats" link past that. Default `5`; `0` lists none. With no
|
|
125
|
+
chats yet it says "No chats yet. Your first message starts one." The head
|
|
126
|
+
always has New chat and Chats.
|
|
127
|
+
- `bare` — no head, inside a `Sheet` or a `Card` that has its own.
|
|
128
|
+
- `fill` — default `true`: the pane takes its container's height and the
|
|
129
|
+
thread scrolls inside it. `false`: a compact pane for a card in a column;
|
|
130
|
+
once a thread starts it scrolls inside a capped height.
|
|
131
|
+
- `className` — layout around it. Never colour.
|
|
132
|
+
|
|
133
|
+
## useAgentPane (lib/hooks.js)
|
|
134
|
+
|
|
135
|
+
```js
|
|
136
|
+
const chat = useAgentPane({ row, how, job, key });
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
It is `useAgentThread` with the sidebar's view, plus the Chats list and a
|
|
140
|
+
step's detail. It returns everything `useAgentThread` returns (`sessionId`,
|
|
141
|
+
`state`, `needs`, `pending`, `place`, `request`, `sending`, `loading`,
|
|
142
|
+
`error`, `unavailable`, `send`, `stop`, `answer`, `openOnDesk`, `newChat`,
|
|
143
|
+
`reload`), and:
|
|
144
|
+
|
|
145
|
+
- `view` — `{ messages, thinking, failure, questions }`: the thread as the
|
|
146
|
+
sidebar draws it. A claw from before the view sends none; the pane then
|
|
147
|
+
draws the small turns plainly.
|
|
148
|
+
- `chats` — `{ items: [{ sessionId, title, mark, at }], loading, error,
|
|
149
|
+
unavailable }`, the member's own threads in this app.
|
|
150
|
+
- `openSession(sessionId)` — switch to one of them.
|
|
151
|
+
- `callDetail(callId)` — one step, opened: `{ facts, code, result, reason,
|
|
152
|
+
said }`, asked when a member opens a step, never carried with the line.
|
|
153
|
+
- `answer({ answers: [{ requestId, optionId | text }] })` — every question
|
|
154
|
+
the view lists, as one resume.
|
|
155
|
+
- `openRequest(requestId)` — "Open in Makersclaw" under a change the agent
|
|
156
|
+
sent up.
|
|
157
|
+
|
|
158
|
+
It reads `GET _claw/threads/<session>?view=1` and `GET _claw/threads` (lib/
|
|
159
|
+
platform.js `thread`, `threads`), the member's own threads in this app,
|
|
160
|
+
never a teammate's, and streams a working thread (`streamThread`). It looks
|
|
161
|
+
every 1.5 s while the agent works and no stream is alive, every 6 s while
|
|
162
|
+
it waits on the member, and not at all once the turn has ended or the page
|
|
163
|
+
is hidden. No tool's input or output is ever sent; a step's detail is
|
|
164
|
+
a bounded digest.
|
|
165
|
+
|
|
166
|
+
## The composer, the stream, the press, Open
|
|
167
|
+
|
|
168
|
+
- **Files.** The + in the box, paste and drop attach up to 4 files and 3 MB
|
|
169
|
+
together; they go with the words (`chat.send(text, { files })`, `ask({
|
|
170
|
+
files })`) as the desk's attachments. A message that is queued behind
|
|
171
|
+
another goes without them, and `chat.notice` says so.
|
|
172
|
+
- **Voice.** A microphone button dictates into the box with the browser's
|
|
173
|
+
speech recognition; it is not drawn where the browser has none.
|
|
174
|
+
- **Stop.** While a turn runs and the box is empty, a round stop takes the
|
|
175
|
+
send arrow's place (a message typed then waits its turn: the arrow comes
|
|
176
|
+
back). "Stopping…" after the press.
|
|
177
|
+
- **Live.** A working thread is streamed (`GET _claw/threads/<session>/
|
|
178
|
+
stream`): text and steps appear as they are written. The poll looks
|
|
179
|
+
rarely while the stream is alive and takes over if it ends or the claw
|
|
180
|
+
has none.
|
|
181
|
+
- **The yes, for a tool too.** `yes` is drawn whenever `chat.needs.in_app`
|
|
182
|
+
is `"press"`: the one ask's yes, or one parked tool call (the card says
|
|
183
|
+
what it will do and shows its command). Several calls parked together
|
|
184
|
+
stay on the desk.
|
|
185
|
+
- **Open.** Under an app or a file it made, Open asks the desk to open it
|
|
186
|
+
(`chat.open`); `onOpen` overrides.
|
|
187
|
+
|
|
188
|
+
## Outside Makersclaw
|
|
189
|
+
|
|
190
|
+
Any object of the same shape works: `view` (`messages` of `{ id, role:
|
|
191
|
+
"user", text, files }` or `{ id, role: "assistant", live, blocks }`), the
|
|
192
|
+
fields above, and the functions.
|
|
193
|
+
|
|
194
|
+
## Example
|
|
195
|
+
|
|
196
|
+
A pane about the person a screen has open, beside the record.
|
|
197
|
+
|
|
198
|
+
```jsx
|
|
199
|
+
"use client";
|
|
200
|
+
import { useAgentPane } from "../lib/hooks";
|
|
201
|
+
import { AgentPane } from "../components/blocks/agent-pane";
|
|
202
|
+
|
|
203
|
+
export default function PersonAsk({ person }) {
|
|
204
|
+
const chat = useAgentPane({ row: { kind: "person", id: person.id, name: person.name } });
|
|
205
|
+
return (
|
|
206
|
+
<AgentPane
|
|
207
|
+
chat={chat}
|
|
208
|
+
title={`Ask about ${person.name}`}
|
|
209
|
+
suggestions={["What did we last talk about?", "Draft a follow-up"]}
|
|
210
|
+
/>
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
With the yes pressed in the approval card above the box:
|
|
216
|
+
|
|
217
|
+
```jsx
|
|
218
|
+
"use client";
|
|
219
|
+
import { useAgentPane, useApproval } from "../lib/hooks";
|
|
220
|
+
import { AgentPane } from "../components/blocks/agent-pane";
|
|
221
|
+
import { Approval } from "../components/blocks/approval";
|
|
222
|
+
|
|
223
|
+
export default function Ask() {
|
|
224
|
+
const chat = useAgentPane();
|
|
225
|
+
// Only for the one ask's yes; useApproval(null) asks nothing.
|
|
226
|
+
const approval = useApproval(chat.needs?.in_app === "press" ? chat.request?.id : null);
|
|
227
|
+
return (
|
|
228
|
+
<AgentPane
|
|
229
|
+
chat={chat}
|
|
230
|
+
yes={<Approval approval={approval} title="Waiting for your yes" onOpenDesk={chat.openOnDesk} />}
|
|
231
|
+
/>
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
```
|