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,251 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// RecordGrid — a dense grid for reading many records at once: a row
|
|
4
|
+
// number and a tick at the start of every row, the name column pinned
|
|
5
|
+
// beside them while the rest scrolls sideways, a header that is yours to
|
|
6
|
+
// draw (a column's live progress, its cost, its menu), a cell that is
|
|
7
|
+
// yours to draw, marks on whole rows (selected, highlighted, struck,
|
|
8
|
+
// dimmed), one active cell, and the keyboard. Only the rows in the window
|
|
9
|
+
// are drawn, so 2,000 rows scroll like twenty. It scrolls itself: give it
|
|
10
|
+
// a bounded parent (h-full, flex-1 min-h-0).
|
|
11
|
+
//
|
|
12
|
+
// Props in, callbacks out; it never fetches and formats nothing. Tokens
|
|
13
|
+
// only.
|
|
14
|
+
|
|
15
|
+
import { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
16
|
+
import { cx } from "../../ui";
|
|
17
|
+
|
|
18
|
+
const keyOf = (row, rowKey) => (typeof rowKey === "function" ? rowKey(row) : row?.[rowKey ?? "id"]);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* rows the records, in order
|
|
22
|
+
* columns [{ key, width (px), header (node), cell(row, index) (node),
|
|
23
|
+
* className?, headerClassName?, label? (a screen reader's
|
|
24
|
+
* name for the column when the header is not words) }]
|
|
25
|
+
* lead [{ key, width, header, cell(row, index), className? }]:
|
|
26
|
+
* the columns before the pinned ones (a row number, a tick)
|
|
27
|
+
* pinned how many of `columns` stay put beside `lead` (default 1)
|
|
28
|
+
* rowKey a key or (row) => key (default "id")
|
|
29
|
+
* rowHeight px (default 32); headerHeight px (default 50)
|
|
30
|
+
* rowMark(row) { selected, highlighted, struck, dimmed }
|
|
31
|
+
* active { row: key, column: key } the active cell, or null
|
|
32
|
+
* onActiveChange(next) the keyboard or a click moved it
|
|
33
|
+
* onCellClick(row, columnKey) a click on a cell (open it)
|
|
34
|
+
* onOpen(row, columnKey) Enter on the active cell
|
|
35
|
+
* after a node in a row of its own after the last row
|
|
36
|
+
* empty what an empty grid says
|
|
37
|
+
* label what a screen reader calls the grid
|
|
38
|
+
* className layout around it
|
|
39
|
+
* ref { scrollToRow(key), scrollToEnd(), focus() }
|
|
40
|
+
*/
|
|
41
|
+
export const RecordGrid = forwardRef(function RecordGrid(
|
|
42
|
+
{
|
|
43
|
+
rows,
|
|
44
|
+
columns,
|
|
45
|
+
lead = [],
|
|
46
|
+
pinned = 1,
|
|
47
|
+
rowKey = "id",
|
|
48
|
+
rowHeight = 32,
|
|
49
|
+
headerHeight = 50,
|
|
50
|
+
overscan = 8,
|
|
51
|
+
rowMark,
|
|
52
|
+
active,
|
|
53
|
+
onActiveChange,
|
|
54
|
+
onCellClick,
|
|
55
|
+
onOpen,
|
|
56
|
+
after,
|
|
57
|
+
empty,
|
|
58
|
+
label = "Records",
|
|
59
|
+
className,
|
|
60
|
+
},
|
|
61
|
+
ref,
|
|
62
|
+
) {
|
|
63
|
+
const box = useRef(null);
|
|
64
|
+
const [scroll, setScroll] = useState({ top: 0, left: 0, height: 600 });
|
|
65
|
+
|
|
66
|
+
const all = useMemo(() => [...lead.map((c) => ({ ...c, lead: true })), ...columns], [lead, columns]);
|
|
67
|
+
const stuck = lead.length + Math.max(0, Math.min(pinned, columns.length));
|
|
68
|
+
const offsets = useMemo(() => {
|
|
69
|
+
const out = [];
|
|
70
|
+
let x = 0;
|
|
71
|
+
for (const c of all) {
|
|
72
|
+
out.push(x);
|
|
73
|
+
x += Number(c.width) || 120;
|
|
74
|
+
}
|
|
75
|
+
return { at: out, width: x };
|
|
76
|
+
}, [all]);
|
|
77
|
+
|
|
78
|
+
const onScroll = useCallback(() => {
|
|
79
|
+
const el = box.current;
|
|
80
|
+
if (!el) return;
|
|
81
|
+
setScroll((s) => (s.top === el.scrollTop && s.left === el.scrollLeft && s.height === el.clientHeight ? s : { top: el.scrollTop, left: el.scrollLeft, height: el.clientHeight }));
|
|
82
|
+
}, []);
|
|
83
|
+
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
const el = box.current;
|
|
86
|
+
if (!el) return;
|
|
87
|
+
onScroll();
|
|
88
|
+
const ro = typeof ResizeObserver === "function" ? new ResizeObserver(onScroll) : null;
|
|
89
|
+
ro?.observe(el);
|
|
90
|
+
return () => ro?.disconnect();
|
|
91
|
+
}, [onScroll]);
|
|
92
|
+
|
|
93
|
+
const total = rows.length;
|
|
94
|
+
const first = Math.max(0, Math.floor((scroll.top - headerHeight) / rowHeight) - overscan);
|
|
95
|
+
const last = Math.min(total, Math.ceil((scroll.top + scroll.height) / rowHeight) + overscan);
|
|
96
|
+
const shown = rows.slice(first, last);
|
|
97
|
+
|
|
98
|
+
const indexOf = useCallback((key) => rows.findIndex((r) => keyOf(r, rowKey) === key), [rows, rowKey]);
|
|
99
|
+
|
|
100
|
+
const scrollToIndex = useCallback(
|
|
101
|
+
(i, block = "nearest") => {
|
|
102
|
+
const el = box.current;
|
|
103
|
+
if (!el || i < 0) return;
|
|
104
|
+
const top = headerHeight + i * rowHeight;
|
|
105
|
+
const view = el.clientHeight;
|
|
106
|
+
if (block === "end") el.scrollTop = Math.max(0, top + rowHeight - view);
|
|
107
|
+
else if (top < el.scrollTop + headerHeight) el.scrollTop = Math.max(0, top - headerHeight);
|
|
108
|
+
else if (top + rowHeight > el.scrollTop + view) el.scrollTop = top + rowHeight - view;
|
|
109
|
+
},
|
|
110
|
+
[headerHeight, rowHeight],
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
useImperativeHandle(
|
|
114
|
+
ref,
|
|
115
|
+
() => ({
|
|
116
|
+
scrollToRow: (key) => scrollToIndex(indexOf(key)),
|
|
117
|
+
scrollToEnd: () => {
|
|
118
|
+
const el = box.current;
|
|
119
|
+
if (el) el.scrollTop = el.scrollHeight;
|
|
120
|
+
},
|
|
121
|
+
focus: () => box.current?.focus({ preventScroll: true }),
|
|
122
|
+
}),
|
|
123
|
+
[indexOf, scrollToIndex],
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
// The active cell stays in view.
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
if (active?.row != null) scrollToIndex(indexOf(active.row));
|
|
129
|
+
}, [active?.row, indexOf, scrollToIndex]);
|
|
130
|
+
|
|
131
|
+
const keys = columns.map((c) => c.key);
|
|
132
|
+
const onKeyDown = (e) => {
|
|
133
|
+
if (!rows.length || !keys.length) return;
|
|
134
|
+
const at = active ? indexOf(active.row) : -1;
|
|
135
|
+
const col = active ? Math.max(0, keys.indexOf(active.column)) : 0;
|
|
136
|
+
let next = null;
|
|
137
|
+
if (e.key === "ArrowDown") next = { i: Math.min(total - 1, at + 1), c: col };
|
|
138
|
+
else if (e.key === "ArrowUp") next = { i: Math.max(0, at < 0 ? 0 : at - 1), c: col };
|
|
139
|
+
else if (e.key === "ArrowRight") next = { i: Math.max(0, at), c: Math.min(keys.length - 1, col + 1) };
|
|
140
|
+
else if (e.key === "ArrowLeft") next = { i: Math.max(0, at), c: Math.max(0, col - 1) };
|
|
141
|
+
else if (e.key === "Home") next = { i: e.metaKey || e.ctrlKey ? 0 : Math.max(0, at), c: 0 };
|
|
142
|
+
else if (e.key === "End") next = { i: e.metaKey || e.ctrlKey ? total - 1 : Math.max(0, at), c: keys.length - 1 };
|
|
143
|
+
else if (e.key === "PageDown") next = { i: Math.min(total - 1, at + Math.max(1, Math.floor(scroll.height / rowHeight) - 1)), c: col };
|
|
144
|
+
else if (e.key === "PageUp") next = { i: Math.max(0, at - Math.max(1, Math.floor(scroll.height / rowHeight) - 1)), c: col };
|
|
145
|
+
else if (e.key === "Enter" && active) {
|
|
146
|
+
e.preventDefault();
|
|
147
|
+
const row = rows[at];
|
|
148
|
+
if (row) onOpen?.(row, active.column);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (!next) return;
|
|
152
|
+
e.preventDefault();
|
|
153
|
+
const row = rows[next.i];
|
|
154
|
+
if (row) onActiveChange?.({ row: keyOf(row, rowKey), column: keys[next.c] });
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const stick = (i, head = false) => {
|
|
158
|
+
if (i >= stuck) return null;
|
|
159
|
+
return { position: "sticky", left: offsets.at[i], zIndex: head ? 3 : 1 };
|
|
160
|
+
};
|
|
161
|
+
const edge = (i) => i === stuck - 1 && scroll.left > 0;
|
|
162
|
+
|
|
163
|
+
return (
|
|
164
|
+
<div
|
|
165
|
+
ref={box}
|
|
166
|
+
role="grid"
|
|
167
|
+
aria-label={label}
|
|
168
|
+
aria-rowcount={total + 1}
|
|
169
|
+
aria-colcount={all.length}
|
|
170
|
+
tabIndex={0}
|
|
171
|
+
onScroll={onScroll}
|
|
172
|
+
onKeyDown={onKeyDown}
|
|
173
|
+
className={cx("relative h-full min-h-0 overflow-auto overscroll-contain outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring", className)}
|
|
174
|
+
>
|
|
175
|
+
<div style={{ width: offsets.width, minWidth: "100%", height: headerHeight + total * rowHeight + (after ? 48 : 0) }} className="relative">
|
|
176
|
+
<div role="row" aria-rowindex={1} className="sticky top-0 z-[2] flex bg-background" style={{ height: headerHeight, width: offsets.width }}>
|
|
177
|
+
{all.map((c, i) => (
|
|
178
|
+
<div
|
|
179
|
+
key={c.key}
|
|
180
|
+
role="columnheader"
|
|
181
|
+
aria-label={c.label}
|
|
182
|
+
className={cx(
|
|
183
|
+
"shrink-0 overflow-hidden border-b border-r border-border bg-background px-2 pb-1 pt-1.5 text-left align-top",
|
|
184
|
+
edge(i) && "shadow-[6px_0_8px_-6px_var(--color-foreground)]",
|
|
185
|
+
c.headerClassName,
|
|
186
|
+
)}
|
|
187
|
+
style={{ width: Number(c.width) || 120, ...stick(i, true) }}
|
|
188
|
+
>
|
|
189
|
+
{c.header}
|
|
190
|
+
</div>
|
|
191
|
+
))}
|
|
192
|
+
</div>
|
|
193
|
+
{total === 0 ? (
|
|
194
|
+
<div className="px-3 py-6 text-sm text-muted-foreground">{empty ?? "Nothing here."}</div>
|
|
195
|
+
) : null}
|
|
196
|
+
<div style={{ position: "absolute", top: headerHeight + first * rowHeight, left: 0, width: offsets.width }}>
|
|
197
|
+
{shown.map((row, j) => {
|
|
198
|
+
const index = first + j;
|
|
199
|
+
const key = keyOf(row, rowKey);
|
|
200
|
+
const mark = rowMark?.(row) ?? {};
|
|
201
|
+
const tint = mark.selected ? "bg-accent text-accent-foreground" : "bg-background";
|
|
202
|
+
return (
|
|
203
|
+
<div
|
|
204
|
+
key={key}
|
|
205
|
+
role="row"
|
|
206
|
+
aria-rowindex={index + 2}
|
|
207
|
+
aria-selected={mark.selected ? true : undefined}
|
|
208
|
+
className={cx("flex", mark.struck && "text-muted-foreground")}
|
|
209
|
+
style={{ height: rowHeight }}
|
|
210
|
+
>
|
|
211
|
+
{all.map((c, i) => {
|
|
212
|
+
const on = active && active.row === key && active.column === c.key;
|
|
213
|
+
return (
|
|
214
|
+
<div
|
|
215
|
+
key={c.key}
|
|
216
|
+
role="gridcell"
|
|
217
|
+
aria-selected={on ? true : undefined}
|
|
218
|
+
onClick={c.lead ? undefined : () => {
|
|
219
|
+
onActiveChange?.({ row: key, column: c.key });
|
|
220
|
+
onCellClick?.(row, c.key);
|
|
221
|
+
}}
|
|
222
|
+
className={cx(
|
|
223
|
+
"flex shrink-0 items-center overflow-hidden whitespace-nowrap border-b border-r border-border px-2",
|
|
224
|
+
tint,
|
|
225
|
+
!c.lead && onCellClick && "cursor-pointer",
|
|
226
|
+
mark.dimmed && !c.lead && i >= stuck && "opacity-55",
|
|
227
|
+
mark.struck && i === stuck - 1 && "line-through decoration-muted-foreground",
|
|
228
|
+
mark.highlighted && i === 0 && "border-l-2 border-l-primary",
|
|
229
|
+
edge(i) && "shadow-[6px_0_8px_-6px_var(--color-foreground)]",
|
|
230
|
+
on && "outline outline-2 -outline-offset-2 outline-ring",
|
|
231
|
+
c.className,
|
|
232
|
+
)}
|
|
233
|
+
style={{ width: Number(c.width) || 120, height: rowHeight, ...stick(i) }}
|
|
234
|
+
>
|
|
235
|
+
{c.cell ? c.cell(row, index) : row[c.key]}
|
|
236
|
+
</div>
|
|
237
|
+
);
|
|
238
|
+
})}
|
|
239
|
+
</div>
|
|
240
|
+
);
|
|
241
|
+
})}
|
|
242
|
+
</div>
|
|
243
|
+
{after && total ? (
|
|
244
|
+
<div className="absolute left-0 flex items-center px-3 text-sm text-muted-foreground" style={{ top: headerHeight + total * rowHeight, minHeight: 48, width: "100%" }}>
|
|
245
|
+
<div className="sticky left-3">{after}</div>
|
|
246
|
+
</div>
|
|
247
|
+
) : null}
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
);
|
|
251
|
+
});
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# RunHistory
|
|
2
|
+
|
|
3
|
+
> **Superseded** (0.8.1, the automations engine, D26). A job's runs and the account of one, from `useRuns` and `useRun`. For an app whose jobs run on the automations engine, use `run-view`'s `RunsList` and `RunView` (`useAutomation`, `useAutomationRun`). Keep using this block for an app that has not moved: it works as it did.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
A job's runs, the account of one, and the overview of them all, drawn
|
|
7
|
+
inside the app in its own look. Part of the agent kit (0.8.1): the app
|
|
8
|
+
shows its agent's work itself, beside the rows that work wrote; the
|
|
9
|
+
window's Runs tab stays as the full history.
|
|
10
|
+
|
|
11
|
+
- `RunHistory` — the runs, newest first: each one's outcome as a mark
|
|
12
|
+
and a word, its title, one line of what it did, when and what it cost.
|
|
13
|
+
One is selected.
|
|
14
|
+
- `RunAccount` — that run: its steps in order with how each ended, a row
|
|
15
|
+
of figures, and the account itself, one line a heading (Read,
|
|
16
|
+
Suggested, Drafted, Failed).
|
|
17
|
+
- `RunOverview` — completed, failed and in progress, the average run
|
|
18
|
+
time, and the credits used against the week's cap as a bar.
|
|
19
|
+
|
|
20
|
+
```jsx
|
|
21
|
+
import { RunHistory, RunAccount, RunOverview } from "../components/blocks/run-history"; // a Makersclaw app
|
|
22
|
+
import { RunHistory, RunAccount, RunOverview } from "@/components/makersclaw/blocks/run-history"; // a shadcn project
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Client components. They format no time: each comes in as words. Their own
|
|
26
|
+
width decides their layout: the account's figures run two to a row,
|
|
27
|
+
four from about 672 px; its lines stack their heading over the text
|
|
28
|
+
under about 384 px.
|
|
29
|
+
|
|
30
|
+
## Props
|
|
31
|
+
|
|
32
|
+
### RunHistory
|
|
33
|
+
|
|
34
|
+
- `runs` — `[{ id, status, title, line, when?, cost? }]`, newest first.
|
|
35
|
+
`status` is `done` (or `ok`) · `failed` · `running` · `needs_you` ·
|
|
36
|
+
`stopped` · `skipped`: useRuns' `state` passes as it is. A failed
|
|
37
|
+
run's `line` is in the danger tone: write it as the reason ("Didn't
|
|
38
|
+
run: Google asked Nadia to sign in again").
|
|
39
|
+
- `selected` — the id the account shows. `onSelect(run)`.
|
|
40
|
+
- `empty` — what an empty history says: when the first run will be.
|
|
41
|
+
- `label` — the list's name for a screen reader (default "Runs").
|
|
42
|
+
- `className`.
|
|
43
|
+
|
|
44
|
+
### RunAccount
|
|
45
|
+
|
|
46
|
+
- `title`, `sub` — the run's time, and the muted line beside it.
|
|
47
|
+
- `steps` — `[{ label, status, count? }]`: useRun's `steps` pass as they
|
|
48
|
+
are.
|
|
49
|
+
- `figures` — `[{ label, value, note?, noteTone?, progress?,
|
|
50
|
+
progressTone? }]`: a tile each (`progress` 0 to 1 draws a bar;
|
|
51
|
+
`progressTone` `neutral` · `danger` · `info`).
|
|
52
|
+
- `lines` — `[{ label, text }]`: the account.
|
|
53
|
+
- `empty` — shown while there are no lines (a run still going).
|
|
54
|
+
- `className`.
|
|
55
|
+
|
|
56
|
+
### RunOverview
|
|
57
|
+
|
|
58
|
+
- `completed`, `failed`, `running` — counts.
|
|
59
|
+
- `avg` — the average run time, in words ("2 seconds").
|
|
60
|
+
- `credits` — `{ used, of, words }`: the credits used, the week's cap,
|
|
61
|
+
and their words ("7 of 37,000 this week"); the bar is full in the
|
|
62
|
+
danger tone. Leave it out with no cap.
|
|
63
|
+
- `title` — default "Overview"; `null` for none. `className`.
|
|
64
|
+
|
|
65
|
+
## useRuns and useRun (lib/hooks.js)
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
const { runs, overview } = useRuns({ job: wakeId, limit: 20 });
|
|
69
|
+
const { run, steps, text, needs } = useRun(selectedId);
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`useRuns` reads `GET _claw/runs`: each run's `id`, `title`, `state`
|
|
73
|
+
(`running` · `done` · `failed` · `stopped` · `needs_you`), `job`,
|
|
74
|
+
`trigger` (`schedule` · `manual` · `event` · `ask`), `by` (who pressed
|
|
75
|
+
Run now), `number` (1 is the oldest), `started_at`, `duration_ms`,
|
|
76
|
+
`credits`; and `overview` (`{ completed, failed, running, avg_ms,
|
|
77
|
+
credits_week, cap_week_credits }`). It looks every 5 s while a run is
|
|
78
|
+
going, else every 30 s, and at once after useJobs' Run now. `useRun`
|
|
79
|
+
reads `GET _claw/runs/<id>`: the run, its `steps`, the agent's report
|
|
80
|
+
(`text`) and what it waits on (`needs`), every 2.5 s while it runs. A
|
|
81
|
+
claw from before the doors is `unavailable`: say "No runs yet", never an
|
|
82
|
+
error.
|
|
83
|
+
|
|
84
|
+
## Who may do what
|
|
85
|
+
|
|
86
|
+
Any member reads the jobs' runs and their own asks. A teammate's ask is
|
|
87
|
+
never listed: the door leaves it out. Running a job is the
|
|
88
|
+
`schedule-card`'s or the `workflow-view`'s, never this block's.
|
|
89
|
+
|
|
90
|
+
## Never
|
|
91
|
+
|
|
92
|
+
- Never a run's outcome by colour alone: the mark and the word come
|
|
93
|
+
with it.
|
|
94
|
+
- Never an Approve on a run that needs the member: "Needs you" opens the
|
|
95
|
+
desk, where the yes is given.
|
|
96
|
+
- Never a time or a figure formatted here: the screen says it in the
|
|
97
|
+
app's words.
|
|
98
|
+
|
|
99
|
+
## Example
|
|
100
|
+
|
|
101
|
+
```jsx
|
|
102
|
+
"use client";
|
|
103
|
+
import { useState } from "react";
|
|
104
|
+
import { useRun, useRuns } from "../lib/hooks";
|
|
105
|
+
import { RunAccount, RunHistory, RunOverview } from "../components/blocks/run-history";
|
|
106
|
+
|
|
107
|
+
const at = (iso) => new Date(iso).toLocaleString("en-GB", { weekday: "short", day: "numeric", month: "short", hour: "2-digit", minute: "2-digit" });
|
|
108
|
+
const cr = (n) => (n == null ? null : `${Math.round(n)} cr`);
|
|
109
|
+
|
|
110
|
+
export default function ReadRuns({ jobId }) {
|
|
111
|
+
const { runs, overview } = useRuns({ job: jobId });
|
|
112
|
+
const [id, setId] = useState(null);
|
|
113
|
+
const open = id ?? runs[0]?.id;
|
|
114
|
+
const { run, steps, text } = useRun(open);
|
|
115
|
+
return (
|
|
116
|
+
<div className="@container grid @3xl:grid-cols-[320px_minmax(0,1fr)]">
|
|
117
|
+
<RunHistory
|
|
118
|
+
runs={runs.map((r) => ({ id: r.id, status: r.state, title: `Run #${r.number} · ${at(r.started_at)}`, line: r.trigger === "manual" ? `Run now, by ${r.by}` : r.job, cost: cr(r.credits) }))}
|
|
119
|
+
selected={open}
|
|
120
|
+
onSelect={(r) => setId(r.id)}
|
|
121
|
+
empty="No runs yet. The first runs Mon 12 Oct, 07:00."
|
|
122
|
+
/>
|
|
123
|
+
<div className="grid content-start gap-4">
|
|
124
|
+
{run ? <RunAccount title={at(run.started_at)} sub={cr(run.credits)} steps={steps} lines={text ? [{ label: "Report", text }] : []} /> : null}
|
|
125
|
+
{overview ? (
|
|
126
|
+
<RunOverview
|
|
127
|
+
completed={overview.completed}
|
|
128
|
+
failed={overview.failed}
|
|
129
|
+
running={overview.running}
|
|
130
|
+
avg={overview.avg_ms == null ? null : `${Math.round(overview.avg_ms / 1000)} seconds`}
|
|
131
|
+
credits={overview.cap_week_credits ? { used: overview.credits_week, of: overview.cap_week_credits, words: `${overview.credits_week} of ${overview.cap_week_credits} this week` } : null}
|
|
132
|
+
/>
|
|
133
|
+
) : null}
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "run-history",
|
|
3
|
+
"title": "RunHistory",
|
|
4
|
+
"description": "A job's runs and the account of one, drawn inside the app. RunHistory is the list, newest first: each run's outcome as a mark and a word (completed, failed, running, needs you, stopped, skipped), its title, one line of what it did, when and what it cost. RunAccount is one run: its steps in order with how each ended, a row of figures and the account itself, one line a heading. RunOverview is the summary: completed, failed, in progress, the average run time, and the credits used against the week's cap as a bar. They draw what useRuns() and useRun() return (lib/hooks.js, GET _claw/runs and _claw/runs/<id>). Their own width decides their layout.",
|
|
5
|
+
"useWhen": "Superseded by run-view for an app whose jobs run on the automations engine; still the block for an app that has not moved (its jobs are the agent's wakes). An app whose agent runs on a schedule, or does work on asks, accounts for itself inside the app: a morning read's page, a nightly import's log, the runs beside a job's card. For the job drawn as a graph with its runs beside it use workflow-view (it uses these); for who did what to the rows use activity-log; for one ask in progress use job-panel.",
|
|
6
|
+
"tags": ["runs", "history", "schedule", "automation", "agent", "account", "steps", "overview", "credits", "report", "log", "kit"],
|
|
7
|
+
"exports": ["RunHistory", "RunAccount", "RunOverview"],
|
|
8
|
+
"files": ["index.js", "run-history.jsx"],
|
|
9
|
+
"requires": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// RunHistory, RunAccount and RunOverview with pretend runs — the
|
|
4
|
+
// gallery's and the smoke test's surface. Not installed into apps. A busy
|
|
5
|
+
// history (a run going, one that needs the member, one failed), the
|
|
6
|
+
// account of the one selected, the overview, and an empty history; the
|
|
7
|
+
// account at 368 px too, so its layout by its own width shows.
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
import { RunAccount, RunHistory, RunOverview } from "../components/blocks/run-history";
|
|
10
|
+
|
|
11
|
+
const RUNS = [
|
|
12
|
+
{ id: "r14", status: "running", title: "Run #14 · Wed 30 Sep, 07:00", line: "Reading mail · 12 of 40", when: "now" },
|
|
13
|
+
{ id: "r13", status: "needs_you", title: "Run #13 · Tue 29 Sep, 16:10 · Read now, by Owen", line: "Waiting for your yes on the desk: send 3 follow-ups", when: "yesterday", cost: "420 cr" },
|
|
14
|
+
{ id: "r12", status: "done", title: "Run #12 · Tue 29 Sep, 07:02", line: "38 emails, 3 meetings · 4 people, 3 details, 1 move", when: "yesterday", cost: "640 cr" },
|
|
15
|
+
{ id: "r11", status: "failed", title: "Run #11 · Mon 28 Sep, 07:00", line: "Didn't run: Google asked Nadia to sign in again", when: "2 days ago", cost: "0 cr" },
|
|
16
|
+
{ id: "r10", status: "stopped", title: "Run #10 · Fri 25 Sep, 07:00", line: "Stopped by Owen after 2 steps; what it wrote stays", when: "5 days ago", cost: "110 cr" },
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
const ACCOUNTS = {
|
|
20
|
+
r14: { title: "Wed 30 Sep, 07:00", sub: "Running · started 2 min ago", steps: [{ label: "Read mail", status: "running", count: "12 of 40" }, { label: "Find people", status: "skipped" }, { label: "Draft follow-ups", status: "skipped" }], lines: [] },
|
|
21
|
+
r13: { title: "Tue 29 Sep, 16:10", sub: "420 credits · Read now, by Owen", steps: [{ label: "Read mail", status: "done", count: "22 emails" }, { label: "Draft follow-ups", status: "needs_you", count: "3 drafts" }], lines: [{ label: "Drafted", text: "3 follow-ups, to Pennant, Harbor Seed and Lowline. They wait for your yes on the desk." }] },
|
|
22
|
+
r12: {
|
|
23
|
+
title: "Tue 29 Sep, 07:02",
|
|
24
|
+
sub: "640 credits · next Wed 30 Sep, 07:00",
|
|
25
|
+
steps: [{ label: "Read mail", status: "done", count: "38 emails" }, { label: "Find people", status: "done", count: "4 found" }, { label: "Draft follow-ups", status: "failed" }],
|
|
26
|
+
figures: [
|
|
27
|
+
{ label: "Runs this month", value: "21", note: "20 completed", noteTone: "success" },
|
|
28
|
+
{ label: "Failures", value: "1", note: "Mon 28 Sep", noteTone: "danger" },
|
|
29
|
+
{ label: "Took", value: "1m 52s" },
|
|
30
|
+
{ label: "Credits this week", value: "4,180", progress: 0.418, note: "of 10,000" },
|
|
31
|
+
],
|
|
32
|
+
lines: [
|
|
33
|
+
{ label: "Read", text: "38 emails and 3 meetings." },
|
|
34
|
+
{ label: "Suggested", text: "4 people, 3 details, 1 deal move — on Today, in pencil." },
|
|
35
|
+
{ label: "Failed", text: "Drafting follow-ups: the model timed out after 60 s. Nothing was sent." },
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
r11: { title: "Mon 28 Sep, 07:00", sub: "0 credits", steps: [{ label: "Read mail", status: "failed" }], lines: [{ label: "Failed", text: "Google asked Nadia to sign in again. No mail was read and nothing was spent." }] },
|
|
39
|
+
r10: { title: "Fri 25 Sep, 07:00", sub: "110 credits", steps: [{ label: "Read mail", status: "done", count: "9 emails" }, { label: "Find people", status: "stopped" }], lines: [{ label: "Stopped", text: "By Owen. The 9 emails read stay filed." }] },
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default function RunHistoryDemo() {
|
|
43
|
+
const [id, setId] = useState("r12");
|
|
44
|
+
const account = ACCOUNTS[id];
|
|
45
|
+
return (
|
|
46
|
+
<div className="grid gap-6 p-4">
|
|
47
|
+
<div className="@container grid min-w-0 overflow-hidden rounded-[var(--radius)] border border-border @3xl:grid-cols-[320px_minmax(0,1fr)]">
|
|
48
|
+
<RunHistory runs={RUNS} selected={id} onSelect={(r) => setId(r.id)} className="border-border @3xl:border-r" />
|
|
49
|
+
<div className="grid min-w-0 content-start gap-4 pb-4">
|
|
50
|
+
<RunAccount {...account} empty={<p className="text-[13px] text-muted-foreground">It says here what it read and did once the run ends.</p>} />
|
|
51
|
+
<RunOverview
|
|
52
|
+
className="px-4"
|
|
53
|
+
completed={149}
|
|
54
|
+
failed={2}
|
|
55
|
+
running={1}
|
|
56
|
+
avg="1 min 52 s"
|
|
57
|
+
credits={{ used: 4180, of: 10000, words: "4,180 of 10,000 this week" }}
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
<div className="flex flex-wrap items-start gap-4">
|
|
62
|
+
<div className="w-full max-w-[368px] rounded-[var(--radius)] border border-border">
|
|
63
|
+
<RunAccount {...ACCOUNTS.r12} />
|
|
64
|
+
</div>
|
|
65
|
+
<div className="grid w-full max-w-[320px] gap-4">
|
|
66
|
+
<div className="rounded-[var(--radius)] border border-border">
|
|
67
|
+
<RunHistory runs={[]} empty="No runs yet. The first runs Mon 12 Oct, 07:00, once a mailbox is connected." />
|
|
68
|
+
</div>
|
|
69
|
+
<RunOverview completed={0} failed={0} running={0} avg={null} credits={{ used: 0, of: 10000, words: "0 of 10,000 this week" }} />
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
}
|