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,492 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useId, useState } from "react";
|
|
4
|
+
import { Button, Icon, Input, cx } from "../../ui";
|
|
5
|
+
import { CONFIDENCE, answerState, answerWords, markWords, needsCheck, progressWords, shortUrl } from "./model";
|
|
6
|
+
|
|
7
|
+
// AgentColumn — the pieces of a column an agent fills (or suggests) for
|
|
8
|
+
// every record: the answer as a cell, how sure it is as a mark, the
|
|
9
|
+
// column's progress under its name, and the answer's detail with what a
|
|
10
|
+
// person can do about it. Props in, callbacks out; the block never
|
|
11
|
+
// fetches. The answer's shape is in model.js.
|
|
12
|
+
|
|
13
|
+
/* ------------------------------ the mark ------------------------------ */
|
|
14
|
+
|
|
15
|
+
// How sure, drawn so it differs in shape (never colour alone): filled =
|
|
16
|
+
// sure, half = likely, dashed ring = guess, a tick = a person accepted
|
|
17
|
+
// or typed it.
|
|
18
|
+
export function SureMark({ confidence, checked = false, typed = false, className }) {
|
|
19
|
+
const label = typed ? "typed by you" : checked ? "checked by you" : CONFIDENCE[confidence]?.label;
|
|
20
|
+
if (!label) return null;
|
|
21
|
+
if (checked || typed)
|
|
22
|
+
return (
|
|
23
|
+
<span role="img" aria-label={label} className={cx("inline-grid size-3 shrink-0 place-items-center text-primary", className)}>
|
|
24
|
+
<Icon name="check" size={12} />
|
|
25
|
+
</span>
|
|
26
|
+
);
|
|
27
|
+
return (
|
|
28
|
+
<span role="img" aria-label={label} className={cx("relative inline-block size-2.5 shrink-0 rounded-full", className, MARK[confidence])}>
|
|
29
|
+
{confidence === "likely" ? <span aria-hidden="true" className="absolute inset-y-0 left-0 w-1/2 bg-foreground" /> : null}
|
|
30
|
+
</span>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const MARK = {
|
|
35
|
+
sure: "bg-foreground",
|
|
36
|
+
likely: "overflow-hidden border border-foreground",
|
|
37
|
+
guess: "border border-dashed border-foreground",
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** The key to the marks: "● sure ◐ likely ◌ guess". */
|
|
41
|
+
export function SureLegend({ className }) {
|
|
42
|
+
return (
|
|
43
|
+
<span aria-label="How sure" className={cx("flex flex-wrap items-center gap-x-3.5 gap-y-1 text-xs text-muted-foreground", className)}>
|
|
44
|
+
{["sure", "likely", "guess"].map((c) => (
|
|
45
|
+
<span key={c} className="inline-flex items-center gap-1.5">
|
|
46
|
+
<SureMark confidence={c} />
|
|
47
|
+
<span className={c === "guess" ? "italic" : undefined}>{c}</span>
|
|
48
|
+
</span>
|
|
49
|
+
))}
|
|
50
|
+
</span>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* ------------------------------ the cell ------------------------------ */
|
|
55
|
+
|
|
56
|
+
const MONO = new Set(["link", "email", "number", "domain"]);
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* One answer, as a cell: the value and its detail, or the state in words.
|
|
60
|
+
*
|
|
61
|
+
* answer the answer (model.js), or null for "not asked yet"
|
|
62
|
+
* type how the value reads: text · link · email · number · domain (mono)
|
|
63
|
+
* onOpen makes the cell a button that opens its detail
|
|
64
|
+
* onRetry a failed answer's "Try again" in the cell
|
|
65
|
+
* lines the value's lines before it clips (default 2)
|
|
66
|
+
*/
|
|
67
|
+
export function AnswerCell({ answer, type = "text", onOpen, onRetry, lines = 2, className, label }) {
|
|
68
|
+
const st = answerState(answer);
|
|
69
|
+
const mono = MONO.has(type);
|
|
70
|
+
const body = (() => {
|
|
71
|
+
switch (st) {
|
|
72
|
+
case "empty":
|
|
73
|
+
return <Quiet>not asked yet</Quiet>;
|
|
74
|
+
case "queued":
|
|
75
|
+
return <Quiet>{answer?.value ? <Old answer={answer} /> : "Queued"}</Quiet>;
|
|
76
|
+
case "waiting":
|
|
77
|
+
return <Quiet>{answerWords(answer)}</Quiet>;
|
|
78
|
+
case "blocked":
|
|
79
|
+
return (
|
|
80
|
+
<div className="min-w-0">
|
|
81
|
+
<div className="font-medium text-muted-foreground">Can’t fill</div>
|
|
82
|
+
<div className="text-xs text-muted-foreground">needs {answer.blockedBy.join(" and ")}</div>
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
case "working":
|
|
86
|
+
return (
|
|
87
|
+
<div className="min-w-0">
|
|
88
|
+
<div className="flex items-center gap-2 font-medium text-primary">
|
|
89
|
+
<span aria-hidden="true" className="size-1.5 animate-pulse rounded-full bg-primary motion-reduce:animate-none" />
|
|
90
|
+
{answer.value ? "Writing" : "Looking up"}
|
|
91
|
+
</div>
|
|
92
|
+
{answer.looking ? <div className="truncate text-xs text-muted-foreground">{answer.looking}</div> : null}
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
case "two_answers":
|
|
96
|
+
return (
|
|
97
|
+
<div className="min-w-0">
|
|
98
|
+
<div className={cx("flex flex-wrap items-baseline gap-x-1.5", mono && "font-mono")}>
|
|
99
|
+
<Icon name="git-branch" size={13} className="self-center text-warning" />
|
|
100
|
+
<span className="font-medium">{answer.value}</span>
|
|
101
|
+
<span className="font-sans text-xs text-muted-foreground">or</span>
|
|
102
|
+
<span className="font-medium">{answer.other?.value}</span>
|
|
103
|
+
</div>
|
|
104
|
+
<div className="text-xs font-medium text-warning">two answers</div>
|
|
105
|
+
</div>
|
|
106
|
+
);
|
|
107
|
+
case "not_found":
|
|
108
|
+
return (
|
|
109
|
+
<div className="min-w-0">
|
|
110
|
+
<div className="font-medium text-warning">Not found</div>
|
|
111
|
+
{answer.detail ? <div className="truncate text-xs text-muted-foreground">{answer.detail}</div> : null}
|
|
112
|
+
</div>
|
|
113
|
+
);
|
|
114
|
+
case "failed":
|
|
115
|
+
return (
|
|
116
|
+
<div className="min-w-0">
|
|
117
|
+
<div className="font-medium text-destructive">Failed</div>
|
|
118
|
+
{answer.detail || answer.note ? <div className="truncate text-xs text-muted-foreground">{answer.detail || answer.note}</div> : null}
|
|
119
|
+
</div>
|
|
120
|
+
);
|
|
121
|
+
case "stale":
|
|
122
|
+
return (
|
|
123
|
+
<div className="min-w-0">
|
|
124
|
+
<div className="text-xs italic text-muted-foreground">out of date</div>
|
|
125
|
+
<Clamp lines={lines} className="text-muted-foreground">{answer.value}</Clamp>
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
default:
|
|
129
|
+
return <Found answer={answer} mono={mono} lines={lines} />;
|
|
130
|
+
}
|
|
131
|
+
})();
|
|
132
|
+
const tint = st === "two_answers" || (needsCheck(answer) && answer?.flag) ? "bg-warning/10" : undefined;
|
|
133
|
+
const inner = <div className={cx("min-w-0 text-sm", tint && "-mx-2 -my-1 rounded-sm px-2 py-1", tint, className)}>{body}</div>;
|
|
134
|
+
const retry = st === "failed" && onRetry ? (
|
|
135
|
+
<Button size="sm" variant="link" onClick={onRetry} className="mt-1 text-xs">
|
|
136
|
+
Try again
|
|
137
|
+
</Button>
|
|
138
|
+
) : null;
|
|
139
|
+
if (!onOpen || st === "empty")
|
|
140
|
+
return (
|
|
141
|
+
<div>
|
|
142
|
+
{inner}
|
|
143
|
+
{retry}
|
|
144
|
+
</div>
|
|
145
|
+
);
|
|
146
|
+
return (
|
|
147
|
+
<div>
|
|
148
|
+
<button
|
|
149
|
+
type="button"
|
|
150
|
+
onClick={onOpen}
|
|
151
|
+
aria-label={label}
|
|
152
|
+
className="block w-full min-w-0 rounded-sm text-left outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
153
|
+
>
|
|
154
|
+
{inner}
|
|
155
|
+
</button>
|
|
156
|
+
{retry}
|
|
157
|
+
</div>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function Quiet({ children }) {
|
|
162
|
+
return <div className="text-xs text-muted-foreground">{children}</div>;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function Old({ answer }) {
|
|
166
|
+
return (
|
|
167
|
+
<span>
|
|
168
|
+
Queued · <span className="italic">{answer.value}</span>
|
|
169
|
+
</span>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function Clamp({ lines, className, children }) {
|
|
174
|
+
return (
|
|
175
|
+
<div className={cx("min-w-0 overflow-hidden", className)} style={{ display: "-webkit-box", WebkitLineClamp: lines, WebkitBoxOrient: "vertical" }}>
|
|
176
|
+
{children}
|
|
177
|
+
</div>
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function Found({ answer, mono, lines }) {
|
|
182
|
+
const st = answerState(answer);
|
|
183
|
+
const guess = answer.confidence === "guess" && st === "found";
|
|
184
|
+
const flagLine = answer.flag === "may_not_fit" && !answer.checked ? "may not fit" : null;
|
|
185
|
+
return (
|
|
186
|
+
<div className="flex min-w-0 gap-2">
|
|
187
|
+
<SureMark confidence={answer.confidence} checked={st === "checked"} typed={st === "typed"} className="mt-1.5" />
|
|
188
|
+
<div className="min-w-0">
|
|
189
|
+
<Clamp lines={answer.detail ? 1 : lines} className={cx(mono ? "font-mono text-xs leading-5" : "", guess && "italic", answer.flag === "left" && "font-medium")}>
|
|
190
|
+
{answer.value}
|
|
191
|
+
</Clamp>
|
|
192
|
+
{answer.detail ? <div className="truncate text-xs text-muted-foreground">{answer.detail}</div> : null}
|
|
193
|
+
{flagLine ? <div className="text-xs font-medium text-warning">{flagLine}</div> : null}
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* ------------------------------ the header ------------------------------ */
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* A column's name and its progress: "Headcount / 20 of 22 · 3 to check".
|
|
203
|
+
* `progress` is summarizeAnswers(); `agent` false draws a person's own
|
|
204
|
+
* column (its name and "yours").
|
|
205
|
+
*/
|
|
206
|
+
export function ColumnHeader({ name, progress, agent = true, note, className }) {
|
|
207
|
+
const words = progress ? progressWords(progress) : null;
|
|
208
|
+
const [head, ...rest] = words ? words.split(" · ") : [];
|
|
209
|
+
return (
|
|
210
|
+
<div className={cx("min-w-0", className)}>
|
|
211
|
+
<div className="truncate text-sm font-semibold text-foreground">{name}</div>
|
|
212
|
+
<div className="truncate font-mono text-xs font-normal text-muted-foreground">
|
|
213
|
+
{agent ? (
|
|
214
|
+
<>
|
|
215
|
+
{head}
|
|
216
|
+
{rest.map((p) => (
|
|
217
|
+
<span key={p} className={p.endsWith("to check") ? "text-warning" : undefined}>
|
|
218
|
+
{" · "}
|
|
219
|
+
{p}
|
|
220
|
+
</span>
|
|
221
|
+
))}
|
|
222
|
+
</>
|
|
223
|
+
) : (
|
|
224
|
+
(note ?? "yours")
|
|
225
|
+
)}
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* ------------------------------ the detail ------------------------------ */
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* One answer in full, and what a person can do about it.
|
|
235
|
+
*
|
|
236
|
+
* answer the answer (model.js)
|
|
237
|
+
* type how the value reads: text · link · email · number · domain (mono)
|
|
238
|
+
* title the record ("Klarwerk"); subtitle, a line under it
|
|
239
|
+
* question the column's name ("Headcount")
|
|
240
|
+
* needs [{ name, answer }] the answers this one read (shown as "It needed")
|
|
241
|
+
* history [{ at, words, credits }] earlier asks, oldest first
|
|
242
|
+
* askCost credits an ask again costs ("40")
|
|
243
|
+
* placeholder for "type your own"; hintPlaceholder for the hint
|
|
244
|
+
* onAccept() accept a found answer or a guess
|
|
245
|
+
* onPick("one" | "other") choose one of two answers
|
|
246
|
+
* onType(value) a person's own value
|
|
247
|
+
* onAskAgain(hint)
|
|
248
|
+
* onKeepNotFound()
|
|
249
|
+
* onKeep() / onDrop() a suggestion's keep and drop
|
|
250
|
+
* busy a call is running (disables the actions)
|
|
251
|
+
* children more of your own under the actions (a row's choices)
|
|
252
|
+
*/
|
|
253
|
+
export function AnswerDetail({
|
|
254
|
+
answer,
|
|
255
|
+
type = "text",
|
|
256
|
+
title,
|
|
257
|
+
subtitle,
|
|
258
|
+
question,
|
|
259
|
+
needs = [],
|
|
260
|
+
history = [],
|
|
261
|
+
askCost,
|
|
262
|
+
placeholder = "Your answer",
|
|
263
|
+
hintPlaceholder = "a hint, if you have one",
|
|
264
|
+
onAccept,
|
|
265
|
+
onPick,
|
|
266
|
+
onType,
|
|
267
|
+
onAskAgain,
|
|
268
|
+
onKeepNotFound,
|
|
269
|
+
onKeep,
|
|
270
|
+
onDrop,
|
|
271
|
+
busy = false,
|
|
272
|
+
note,
|
|
273
|
+
children,
|
|
274
|
+
}) {
|
|
275
|
+
const st = answerState(answer);
|
|
276
|
+
const [own, setOwn] = useState("");
|
|
277
|
+
const [hint, setHint] = useState(answer?.hint ?? "");
|
|
278
|
+
const ownId = useId();
|
|
279
|
+
const hintId = useId();
|
|
280
|
+
const typeWord = st === "not_found" ? "Type who it is" : st === "two_answers" ? "Or type your own" : "Or type the one you know";
|
|
281
|
+
return (
|
|
282
|
+
<div className="grid gap-5">
|
|
283
|
+
<header className="grid gap-1">
|
|
284
|
+
{title ? <h3 className="font-display text-3xl leading-tight">{title}</h3> : null}
|
|
285
|
+
{subtitle ? <p className="text-sm text-muted-foreground">{subtitle}</p> : null}
|
|
286
|
+
</header>
|
|
287
|
+
|
|
288
|
+
{st === "two_answers" ? (
|
|
289
|
+
<section className="grid gap-3">
|
|
290
|
+
<p className="text-sm font-medium text-warning">Two answers: the sources disagree</p>
|
|
291
|
+
<Choice value={answer.value} detail={answer.detail} source={answer.source} onUse={onPick ? () => onPick("one") : null} busy={busy} />
|
|
292
|
+
<Choice value={answer.other?.value} detail={answer.other?.detail} source={answer.other?.source} onUse={onPick ? () => onPick("other") : null} busy={busy} />
|
|
293
|
+
</section>
|
|
294
|
+
) : st === "not_found" ? (
|
|
295
|
+
<section className="grid gap-3">
|
|
296
|
+
<p className="flex items-baseline gap-2">
|
|
297
|
+
<span className="font-display text-2xl italic text-warning">Not found</span>
|
|
298
|
+
{history.length ? <span className="text-sm text-muted-foreground">· asked {history.length + 1 === 2 ? "twice" : `${history.length + 1} times`}</span> : null}
|
|
299
|
+
</p>
|
|
300
|
+
{answer.note ? <p className="text-sm">{answer.note}</p> : null}
|
|
301
|
+
{answer.tried?.length ? (
|
|
302
|
+
<div className="grid gap-2">
|
|
303
|
+
<h4 className="text-xs font-medium text-muted-foreground">What it read</h4>
|
|
304
|
+
{answer.tried.map((t, i) => (
|
|
305
|
+
<Source key={i} source={t} />
|
|
306
|
+
))}
|
|
307
|
+
</div>
|
|
308
|
+
) : null}
|
|
309
|
+
</section>
|
|
310
|
+
) : st === "blocked" || st === "waiting" || st === "queued" || st === "working" || st === "empty" ? (
|
|
311
|
+
<section className="grid gap-2">
|
|
312
|
+
<p className="font-display text-2xl italic">{st === "working" ? "Looking up" : answerWords(answer)}</p>
|
|
313
|
+
{st === "blocked" ? <p className="text-sm text-muted-foreground">It needs {answer.blockedBy.join(" and ")}, which wasn’t found. Type it there and this fills from it.</p> : null}
|
|
314
|
+
{answer?.looking ? <p className="text-sm text-muted-foreground">{answer.looking}</p> : null}
|
|
315
|
+
</section>
|
|
316
|
+
) : (
|
|
317
|
+
<section className="grid gap-3">
|
|
318
|
+
<p className={cx("break-words text-xl", MONO.has(type) ? "font-mono text-base" : "font-medium", answer.confidence === "guess" && st === "found" && "italic")}>{answer.value}</p>
|
|
319
|
+
{answer.detail ? <p className="text-sm text-muted-foreground">{answer.detail}</p> : null}
|
|
320
|
+
<p className="flex items-center gap-2 text-sm">
|
|
321
|
+
<SureMark confidence={answer.confidence} checked={st === "checked"} typed={st === "typed"} />
|
|
322
|
+
<span className="font-medium capitalize">{st === "checked" || st === "typed" ? answerWords(answer) : CONFIDENCE[answer.confidence]?.label ?? "found"}</span>
|
|
323
|
+
{st === "found" && CONFIDENCE[answer.confidence] ? <span className="text-muted-foreground">· {CONFIDENCE[answer.confidence].words}</span> : null}
|
|
324
|
+
</p>
|
|
325
|
+
{answer.source?.url || answer.source?.evidence ? <Source source={answer.source} mark={answer.value} /> : null}
|
|
326
|
+
{st === "stale" ? <p className="text-sm text-muted-foreground">Out of date: its question or its row changed. It keeps this until a new answer lands.</p> : null}
|
|
327
|
+
</section>
|
|
328
|
+
)}
|
|
329
|
+
|
|
330
|
+
{needs.length ? (
|
|
331
|
+
<section className="grid gap-2">
|
|
332
|
+
<h4 className="text-xs font-medium text-muted-foreground">It needed</h4>
|
|
333
|
+
<ul className="grid gap-1.5 text-sm">
|
|
334
|
+
{needs.map((n) => (
|
|
335
|
+
<li key={n.name} className="flex items-center gap-2">
|
|
336
|
+
{n.answer ? <SureMark confidence={n.answer.confidence} checked={answerState(n.answer) === "checked"} typed={answerState(n.answer) === "typed"} /> : null}
|
|
337
|
+
<span>
|
|
338
|
+
{n.name}
|
|
339
|
+
{n.answer?.confidence ? <span className="text-muted-foreground"> · {n.answer.confidence}</span> : null}
|
|
340
|
+
{n.answer?.value ? <span className="text-muted-foreground"> · {n.answer.value}</span> : null}
|
|
341
|
+
</span>
|
|
342
|
+
</li>
|
|
343
|
+
))}
|
|
344
|
+
</ul>
|
|
345
|
+
</section>
|
|
346
|
+
) : null}
|
|
347
|
+
|
|
348
|
+
{answer?.note && st !== "not_found" ? (
|
|
349
|
+
<p className="text-sm">
|
|
350
|
+
<span className="font-medium">How it was found.</span> {answer.note}
|
|
351
|
+
</p>
|
|
352
|
+
) : null}
|
|
353
|
+
|
|
354
|
+
{history.length ? (
|
|
355
|
+
<section className="grid gap-2">
|
|
356
|
+
<h4 className="text-xs font-medium text-muted-foreground">Asked</h4>
|
|
357
|
+
<ul className="grid gap-1 text-sm">
|
|
358
|
+
{history.map((h, i) => (
|
|
359
|
+
<li key={i} className="flex gap-3">
|
|
360
|
+
<span className="w-14 shrink-0 text-muted-foreground">{h.at}</span>
|
|
361
|
+
<span className="min-w-0 flex-1">{h.words}</span>
|
|
362
|
+
{h.credits != null ? <span data-nums className="font-mono text-xs text-muted-foreground">{h.credits}</span> : null}
|
|
363
|
+
</li>
|
|
364
|
+
))}
|
|
365
|
+
</ul>
|
|
366
|
+
</section>
|
|
367
|
+
) : null}
|
|
368
|
+
|
|
369
|
+
{note ? <p className="text-sm text-muted-foreground">{note}</p> : null}
|
|
370
|
+
|
|
371
|
+
{st === "suggested" && (onKeep || onDrop) ? (
|
|
372
|
+
<div className="flex flex-wrap gap-2">
|
|
373
|
+
{onKeep ? (
|
|
374
|
+
<Button variant="primary" onClick={onKeep} disabled={busy}>
|
|
375
|
+
Keep it
|
|
376
|
+
</Button>
|
|
377
|
+
) : null}
|
|
378
|
+
{onDrop ? (
|
|
379
|
+
<Button onClick={onDrop} disabled={busy}>
|
|
380
|
+
Drop it
|
|
381
|
+
</Button>
|
|
382
|
+
) : null}
|
|
383
|
+
</div>
|
|
384
|
+
) : null}
|
|
385
|
+
|
|
386
|
+
{(st === "found" || st === "stale") && onAccept && needsCheck(answer) ? (
|
|
387
|
+
<Button variant="primary" onClick={onAccept} disabled={busy} className="justify-self-start">
|
|
388
|
+
Accept it
|
|
389
|
+
</Button>
|
|
390
|
+
) : null}
|
|
391
|
+
|
|
392
|
+
{onType && st !== "working" ? (
|
|
393
|
+
<form
|
|
394
|
+
className="grid gap-1.5"
|
|
395
|
+
onSubmit={(e) => {
|
|
396
|
+
e.preventDefault();
|
|
397
|
+
if (own.trim()) onType(own.trim());
|
|
398
|
+
}}
|
|
399
|
+
>
|
|
400
|
+
<label htmlFor={ownId} className="text-sm font-medium">
|
|
401
|
+
{typeWord}
|
|
402
|
+
</label>
|
|
403
|
+
<div className="flex gap-2">
|
|
404
|
+
<Input id={ownId} value={own} onChange={(e) => setOwn(e.target.value)} placeholder={placeholder} className="min-w-0 flex-1" />
|
|
405
|
+
<Button type="submit" disabled={busy || !own.trim()}>
|
|
406
|
+
Save
|
|
407
|
+
</Button>
|
|
408
|
+
</div>
|
|
409
|
+
</form>
|
|
410
|
+
) : null}
|
|
411
|
+
|
|
412
|
+
{onAskAgain && st !== "working" && st !== "typed" ? (
|
|
413
|
+
<form
|
|
414
|
+
className="grid gap-1.5"
|
|
415
|
+
onSubmit={(e) => {
|
|
416
|
+
e.preventDefault();
|
|
417
|
+
onAskAgain(hint.trim());
|
|
418
|
+
}}
|
|
419
|
+
>
|
|
420
|
+
<label htmlFor={hintId} className="text-sm font-medium">
|
|
421
|
+
Or ask again, with a hint
|
|
422
|
+
</label>
|
|
423
|
+
<div className="flex gap-2">
|
|
424
|
+
<Input id={hintId} value={hint} onChange={(e) => setHint(e.target.value)} placeholder={hintPlaceholder} className="min-w-0 flex-1" />
|
|
425
|
+
<Button type="submit" disabled={busy}>
|
|
426
|
+
Ask again{askCost != null ? <span data-nums className="font-mono text-xs"> · {askCost}</span> : null}
|
|
427
|
+
</Button>
|
|
428
|
+
</div>
|
|
429
|
+
</form>
|
|
430
|
+
) : null}
|
|
431
|
+
|
|
432
|
+
{st === "not_found" && onKeepNotFound ? (
|
|
433
|
+
<Button onClick={onKeepNotFound} disabled={busy} className="justify-self-start">
|
|
434
|
+
Keep “not found”
|
|
435
|
+
</Button>
|
|
436
|
+
) : null}
|
|
437
|
+
|
|
438
|
+
{children}
|
|
439
|
+
</div>
|
|
440
|
+
);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
function Choice({ value, detail, source, onUse, busy }) {
|
|
444
|
+
return (
|
|
445
|
+
<div className="grid gap-2 rounded-lg border border-border p-4">
|
|
446
|
+
<div className="flex items-baseline gap-3">
|
|
447
|
+
<span className="font-display text-4xl leading-none">{value}</span>
|
|
448
|
+
{detail ? <span className="text-sm text-muted-foreground">{detail}</span> : null}
|
|
449
|
+
</div>
|
|
450
|
+
{source ? <Source source={source} mark={value} /> : null}
|
|
451
|
+
{onUse ? (
|
|
452
|
+
<Button variant="secondary" size="sm" onClick={onUse} disabled={busy} className="justify-self-start">
|
|
453
|
+
Use {value}
|
|
454
|
+
</Button>
|
|
455
|
+
) : null}
|
|
456
|
+
</div>
|
|
457
|
+
);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/** A source: its title and address, and the words on it in the display
|
|
461
|
+
* face, the answer marked where it appears. */
|
|
462
|
+
export function Source({ source, mark, className }) {
|
|
463
|
+
if (!source) return null;
|
|
464
|
+
const words = markWords(source.evidence, mark);
|
|
465
|
+
return (
|
|
466
|
+
<div className={cx("grid gap-0.5 border-l-2 border-border pl-3", className)}>
|
|
467
|
+
<div className="flex min-w-0 flex-wrap items-baseline gap-x-2 text-sm">
|
|
468
|
+
{source.title ? <span className="font-medium">{source.title}</span> : null}
|
|
469
|
+
{source.url ? (
|
|
470
|
+
<a href={/^https?:/i.test(source.url) ? source.url : `https://${source.url}`} target="_blank" rel="noreferrer" className="min-w-0 truncate font-mono text-xs text-primary underline-offset-2 hover:underline">
|
|
471
|
+
{shortUrl(source.url)}
|
|
472
|
+
</a>
|
|
473
|
+
) : null}
|
|
474
|
+
</div>
|
|
475
|
+
{source.evidence ? (
|
|
476
|
+
<blockquote className="font-display text-lg leading-snug">
|
|
477
|
+
“
|
|
478
|
+
{words.map((w, i) =>
|
|
479
|
+
w.marked ? (
|
|
480
|
+
<mark key={i} className="rounded-sm bg-primary/15 px-0.5 text-foreground">
|
|
481
|
+
{w.text}
|
|
482
|
+
</mark>
|
|
483
|
+
) : (
|
|
484
|
+
<span key={i}>{w.text}</span>
|
|
485
|
+
),
|
|
486
|
+
)}
|
|
487
|
+
”
|
|
488
|
+
</blockquote>
|
|
489
|
+
) : null}
|
|
490
|
+
</div>
|
|
491
|
+
);
|
|
492
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-column",
|
|
3
|
+
"title": "AgentColumn",
|
|
4
|
+
"description": "A column an agent fills (or suggests) for every record, cell by cell: each answer shows its state in words (queued, waits for another column, looking up, found, not found, two answers, can't fill, failed, out of date, checked or typed by a person) and how sure it is as a mark that differs in shape (filled sure, half likely, dashed guess, a tick for a person). Its detail shows the source, the words on the page with the answer marked in them, how it was found, both answers when sources disagree, what was tried when nothing was found, and what a person can do: accept, pick one of two, type their own, ask again with a hint, keep not found, or keep and drop a suggestion. With a column header that carries live progress, a legend, and a picker that chooses columns with their cost per record. Works in data-table cells, a spreadsheet column type, or a list of its own. Grown in Data Enrichment 0.5.0: the receipt (an answer opened as a claim with its citation: each source a clipping with the deciding words underlined, two clippings to pick from, what was tried crossed off), the one-line answer and trust mark a dense grid draws, and a column heading drawn as a job (its progress, its cost per row, its menu).",
|
|
5
|
+
"useWhen": "An app whose agent fills or proposes values record by record and a person checks them: enrichment of a list, a CRM filling in a contact, a base whose agent fills a field or suggests a cleaner value, a research table. Not for a single agent reply (job-panel) or a person's own typing (spreadsheet, record-form).",
|
|
6
|
+
"tags": [
|
|
7
|
+
"enrichment",
|
|
8
|
+
"column",
|
|
9
|
+
"cell",
|
|
10
|
+
"answer",
|
|
11
|
+
"source",
|
|
12
|
+
"citation",
|
|
13
|
+
"confidence",
|
|
14
|
+
"suggestion",
|
|
15
|
+
"proposal",
|
|
16
|
+
"fill",
|
|
17
|
+
"research",
|
|
18
|
+
"table",
|
|
19
|
+
"spreadsheet",
|
|
20
|
+
"keep",
|
|
21
|
+
"drop",
|
|
22
|
+
"receipt",
|
|
23
|
+
"clipping",
|
|
24
|
+
"trust",
|
|
25
|
+
"job",
|
|
26
|
+
"heading"
|
|
27
|
+
],
|
|
28
|
+
"exports": [
|
|
29
|
+
"AnswerCell",
|
|
30
|
+
"AnswerDetail",
|
|
31
|
+
"ColumnHeader",
|
|
32
|
+
"SureMark",
|
|
33
|
+
"SureLegend",
|
|
34
|
+
"Source",
|
|
35
|
+
"AgentMark",
|
|
36
|
+
"AnswerLine",
|
|
37
|
+
"Clipping",
|
|
38
|
+
"JobHeader",
|
|
39
|
+
"Receipt",
|
|
40
|
+
"ReceiptActions",
|
|
41
|
+
"TriedList",
|
|
42
|
+
"TrustMark",
|
|
43
|
+
"ColumnPicker",
|
|
44
|
+
"answerColumnType",
|
|
45
|
+
"answerState",
|
|
46
|
+
"answerWords",
|
|
47
|
+
"needsCheck",
|
|
48
|
+
"summarizeAnswers",
|
|
49
|
+
"progressWords",
|
|
50
|
+
"markWords",
|
|
51
|
+
"decidingWords",
|
|
52
|
+
"plainWords",
|
|
53
|
+
"shortUrl",
|
|
54
|
+
"CONFIDENCE"
|
|
55
|
+
],
|
|
56
|
+
"files": [
|
|
57
|
+
"index.js",
|
|
58
|
+
"agent-column.jsx",
|
|
59
|
+
"receipt.jsx",
|
|
60
|
+
"column-picker.jsx",
|
|
61
|
+
"spreadsheet-type.jsx",
|
|
62
|
+
"model.js"
|
|
63
|
+
],
|
|
64
|
+
"requires": [
|
|
65
|
+
"agent-marks"
|
|
66
|
+
]
|
|
67
|
+
}
|