@asanchez-sa/abby 0.0.0-stage → 0.1.0
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 +217 -2
- package/dist/_virtual/_rolldown/runtime.js +26 -0
- package/dist/agents/approvals.d.ts +46 -0
- package/dist/agents/approvals.js +58 -0
- package/dist/agents/changes.d.ts +21 -0
- package/dist/agents/changes.js +21 -0
- package/dist/agents/hooks.d.ts +20 -0
- package/dist/agents/hooks.js +58 -0
- package/dist/agents/index.d.ts +11 -0
- package/dist/agents/index.js +9 -0
- package/dist/agents/run-tool.d.ts +44 -0
- package/dist/agents/run-tool.js +79 -0
- package/dist/agents/ui-sdk.d.ts +5 -0
- package/dist/agents/ui-sdk.js +3 -0
- package/dist/behaviors/canvas/index.d.ts +2 -0
- package/dist/behaviors/canvas/index.js +1 -0
- package/dist/behaviors/canvas/ui-sdk.d.ts +2 -0
- package/dist/behaviors/canvas/ui-sdk.js +1 -0
- package/dist/behaviors/drag-and-drop/index.d.ts +2 -0
- package/dist/behaviors/drag-and-drop/index.js +1 -0
- package/dist/behaviors/drag-and-drop/ui-sdk.d.ts +2 -0
- package/dist/behaviors/drag-and-drop/ui-sdk.js +1 -0
- package/dist/behaviors/dragging/index.d.ts +2 -0
- package/dist/behaviors/dragging/index.js +1 -0
- package/dist/behaviors/dragging/ui-sdk.d.ts +2 -0
- package/dist/behaviors/dragging/ui-sdk.js +1 -0
- package/dist/behaviors/focus/index.d.ts +2 -0
- package/dist/behaviors/focus/index.js +1 -0
- package/dist/behaviors/focus/ui-sdk.d.ts +2 -0
- package/dist/behaviors/focus/ui-sdk.js +1 -0
- package/dist/behaviors/lists/index.d.ts +3 -0
- package/dist/behaviors/lists/index.js +3 -0
- package/dist/behaviors/lists/ui-sdk.d.ts +3 -0
- package/dist/behaviors/lists/ui-sdk.js +3 -0
- package/dist/behaviors/popups/index.d.ts +3 -0
- package/dist/behaviors/popups/index.js +3 -0
- package/dist/behaviors/popups/ui-sdk.d.ts +3 -0
- package/dist/behaviors/popups/ui-sdk.js +3 -0
- package/dist/behaviors/preferences/index.d.ts +3 -0
- package/dist/behaviors/preferences/index.js +3 -0
- package/dist/behaviors/preferences/ui-sdk.d.ts +3 -0
- package/dist/behaviors/preferences/ui-sdk.js +3 -0
- package/dist/behaviors/selection/index.d.ts +3 -0
- package/dist/behaviors/selection/index.js +3 -0
- package/dist/behaviors/selection/indicator.d.ts +13 -0
- package/dist/behaviors/selection/indicator.js +20 -0
- package/dist/behaviors/selection/ui-sdk.d.ts +2 -0
- package/dist/behaviors/selection/ui-sdk.js +1 -0
- package/dist/behaviors/transitions/index.d.ts +3 -0
- package/dist/behaviors/transitions/index.js +3 -0
- package/dist/behaviors/transitions/ui-sdk.d.ts +3 -0
- package/dist/behaviors/transitions/ui-sdk.js +3 -0
- package/dist/behaviors/trees/index.d.ts +2 -0
- package/dist/behaviors/trees/index.js +1 -0
- package/dist/behaviors/trees/ui-sdk.d.ts +2 -0
- package/dist/behaviors/trees/ui-sdk.js +1 -0
- package/dist/components/accordion/accordion.d.ts +13 -0
- package/dist/components/accordion/accordion.js +165 -0
- package/dist/components/alert/alert.d.ts +13 -0
- package/dist/components/alert/alert.js +131 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +15 -0
- package/dist/components/alert-dialog/alert-dialog.js +257 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +7 -0
- package/dist/components/aspect-ratio/aspect-ratio.js +57 -0
- package/dist/components/attachment/attachment.d.ts +48 -0
- package/dist/components/attachment/attachment.js +372 -0
- package/dist/components/autocomplete/autocomplete.d.ts +32 -0
- package/dist/components/autocomplete/autocomplete.js +466 -0
- package/dist/components/avatar/avatar.d.ts +6 -0
- package/dist/components/avatar/avatar.js +100 -0
- package/dist/components/avatar-group/avatar-group.d.ts +9 -0
- package/dist/components/avatar-group/avatar-group.js +75 -0
- package/dist/components/badge/badge.d.ts +15 -0
- package/dist/components/badge/badge.js +31 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +24 -0
- package/dist/components/breadcrumb/breadcrumb.js +279 -0
- package/dist/components/bubble/bubble.d.ts +26 -0
- package/dist/components/bubble/bubble.js +173 -0
- package/dist/components/button/button.d.ts +18 -0
- package/dist/components/button/button.js +91 -0
- package/dist/components/button-group/button-group.d.ts +15 -0
- package/dist/components/button-group/button-group.js +71 -0
- package/dist/components/calendar/calendar.d.ts +29 -0
- package/dist/components/calendar/calendar.js +453 -0
- package/dist/components/card/card.d.ts +14 -0
- package/dist/components/card/card.js +213 -0
- package/dist/components/carousel/carousel.d.ts +16 -0
- package/dist/components/carousel/carousel.js +364 -0
- package/dist/components/chain-of-thought/chain-of-thought.d.ts +72 -0
- package/dist/components/chain-of-thought/chain-of-thought.js +491 -0
- package/dist/components/chat/chat.d.ts +48 -0
- package/dist/components/chat/chat.js +207 -0
- package/dist/components/checkbox/checkbox.d.ts +10 -0
- package/dist/components/checkbox/checkbox.js +118 -0
- package/dist/components/checkpoint/checkpoint.d.ts +24 -0
- package/dist/components/checkpoint/checkpoint.js +178 -0
- package/dist/components/choice-cards/choice-cards.d.ts +38 -0
- package/dist/components/choice-cards/choice-cards.js +255 -0
- package/dist/components/code-block/code-block.d.ts +58 -0
- package/dist/components/code-block/code-block.js +506 -0
- package/dist/components/code-block/highlighter.js +96 -0
- package/dist/components/code-block/use-highlighted-code.d.ts +11 -0
- package/dist/components/code-block/use-highlighted-code.js +54 -0
- package/dist/components/collapsible/collapsible.d.ts +10 -0
- package/dist/components/collapsible/collapsible.js +92 -0
- package/dist/components/color-picker/color-picker.d.ts +17 -0
- package/dist/components/color-picker/color-picker.js +395 -0
- package/dist/components/combobox/combobox.d.ts +54 -0
- package/dist/components/combobox/combobox.js +683 -0
- package/dist/components/command/command.d.ts +23 -0
- package/dist/components/command/command.js +373 -0
- package/dist/components/command-dock/command-dock.d.ts +118 -0
- package/dist/components/command-dock/command-dock.js +944 -0
- package/dist/components/confirmation/confirmation.d.ts +58 -0
- package/dist/components/confirmation/confirmation.js +181 -0
- package/dist/components/context/context.d.ts +82 -0
- package/dist/components/context/context.js +490 -0
- package/dist/components/date-input/date-input.d.ts +16 -0
- package/dist/components/date-input/date-input.js +89 -0
- package/dist/components/date-picker/date-picker.d.ts +28 -0
- package/dist/components/date-picker/date-picker.js +361 -0
- package/dist/components/dialog/dialog.d.ts +14 -0
- package/dist/components/dialog/dialog.js +261 -0
- package/dist/components/drawer/drawer.d.ts +16 -0
- package/dist/components/drawer/drawer.js +309 -0
- package/dist/components/empty/empty.d.ts +18 -0
- package/dist/components/empty/empty.js +192 -0
- package/dist/components/field/field.d.ts +15 -0
- package/dist/components/field/field.js +261 -0
- package/dist/components/file-input/file-input.d.ts +12 -0
- package/dist/components/file-input/file-input.js +216 -0
- package/dist/components/file-tree/file-tree.d.ts +45 -0
- package/dist/components/file-tree/file-tree.js +283 -0
- package/dist/components/hover-card/hover-card.d.ts +10 -0
- package/dist/components/hover-card/hover-card.js +118 -0
- package/dist/components/icon/icon.d.ts +14 -0
- package/dist/components/icon/icon.js +60 -0
- package/dist/components/image-cropper/image-cropper.d.ts +15 -0
- package/dist/components/image-cropper/image-cropper.js +334 -0
- package/dist/components/inline-citation/inline-citation.d.ts +46 -0
- package/dist/components/inline-citation/inline-citation.js +269 -0
- package/dist/components/input/input.d.ts +9 -0
- package/dist/components/input/input.js +43 -0
- package/dist/components/input-group/input-group.d.ts +42 -0
- package/dist/components/input-group/input-group.js +192 -0
- package/dist/components/item/item.d.ts +32 -0
- package/dist/components/item/item.js +394 -0
- package/dist/components/kbd/kbd.d.ts +9 -0
- package/dist/components/kbd/kbd.js +75 -0
- package/dist/components/label/label.d.ts +6 -0
- package/dist/components/label/label.js +40 -0
- package/dist/components/link/link.d.ts +21 -0
- package/dist/components/link/link.js +126 -0
- package/dist/components/listbox/listbox.d.ts +20 -0
- package/dist/components/listbox/listbox.js +199 -0
- package/dist/components/marker/marker.d.ts +11 -0
- package/dist/components/marker/marker.js +88 -0
- package/dist/components/menu/menu.d.ts +38 -0
- package/dist/components/menu/menu.js +553 -0
- package/dist/components/menubar/menubar.d.ts +9 -0
- package/dist/components/menubar/menubar.js +47 -0
- package/dist/components/message/message.d.ts +44 -0
- package/dist/components/message/message.js +328 -0
- package/dist/components/message-scroller/message-scroller.d.ts +111 -0
- package/dist/components/message-scroller/message-scroller.js +957 -0
- package/dist/components/meter/meter.d.ts +8 -0
- package/dist/components/meter/meter.js +162 -0
- package/dist/components/model-selector/model-selector.d.ts +155 -0
- package/dist/components/model-selector/model-selector.js +905 -0
- package/dist/components/native-select/native-select.d.ts +27 -0
- package/dist/components/native-select/native-select.js +226 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +29 -0
- package/dist/components/navigation-menu/navigation-menu.js +318 -0
- package/dist/components/not-label.js +9 -0
- package/dist/components/note-editor/blocks.d.ts +22 -0
- package/dist/components/note-editor/blocks.js +245 -0
- package/dist/components/note-editor/diff.d.ts +19 -0
- package/dist/components/note-editor/diff.js +64 -0
- package/dist/components/note-editor/editor.js +249 -0
- package/dist/components/note-editor/note-editor.d.ts +109 -0
- package/dist/components/note-editor/note-editor.js +954 -0
- package/dist/components/note-editor/parts/comments.d.ts +24 -0
- package/dist/components/note-editor/parts/comments.js +336 -0
- package/dist/components/note-editor/parts/header.d.ts +25 -0
- package/dist/components/note-editor/parts/header.js +263 -0
- package/dist/components/note-editor/parts/history.d.ts +56 -0
- package/dist/components/note-editor/parts/history.js +409 -0
- package/dist/components/note-editor/parts/presence.d.ts +31 -0
- package/dist/components/note-editor/parts/presence.js +140 -0
- package/dist/components/note-editor/parts/suggestions.d.ts +45 -0
- package/dist/components/note-editor/parts/suggestions.js +316 -0
- package/dist/components/note-editor/parts/toolbar.d.ts +38 -0
- package/dist/components/note-editor/parts/toolbar.js +683 -0
- package/dist/components/note-editor/people.d.ts +84 -0
- package/dist/components/note-editor/people.js +276 -0
- package/dist/components/note-editor/person.d.ts +11 -0
- package/dist/components/note-editor/person.js +15 -0
- package/dist/components/note-place/note-place.d.ts +42 -0
- package/dist/components/note-place/note-place.js +256 -0
- package/dist/components/note-status/note-status.d.ts +59 -0
- package/dist/components/note-status/note-status.js +380 -0
- package/dist/components/number-input/number-input.d.ts +12 -0
- package/dist/components/number-input/number-input.js +252 -0
- package/dist/components/otp-input/otp-input.d.ts +12 -0
- package/dist/components/otp-input/otp-input.js +136 -0
- package/dist/components/pagination/pagination.d.ts +23 -0
- package/dist/components/pagination/pagination.js +218 -0
- package/dist/components/password-input/password-input.d.ts +11 -0
- package/dist/components/password-input/password-input.js +117 -0
- package/dist/components/plan/plan.d.ts +51 -0
- package/dist/components/plan/plan.js +320 -0
- package/dist/components/popover/popover.d.ts +16 -0
- package/dist/components/popover/popover.js +268 -0
- package/dist/components/preferences/preferences.d.ts +5 -0
- package/dist/components/preferences/preferences.js +18 -0
- package/dist/components/progress/progress.d.ts +8 -0
- package/dist/components/progress/progress.js +162 -0
- package/dist/components/prompt-input/prompt-input.d.ts +247 -0
- package/dist/components/prompt-input/prompt-input.js +1367 -0
- package/dist/components/questionnaire/questionnaire.d.ts +174 -0
- package/dist/components/questionnaire/questionnaire.js +1628 -0
- package/dist/components/queue/queue.d.ts +82 -0
- package/dist/components/queue/queue.js +471 -0
- package/dist/components/radio/radio.d.ts +7 -0
- package/dist/components/radio/radio.js +101 -0
- package/dist/components/rating/rating.d.ts +10 -0
- package/dist/components/rating/rating.js +95 -0
- package/dist/components/reasoning/reasoning.d.ts +50 -0
- package/dist/components/reasoning/reasoning.js +233 -0
- package/dist/components/resizable/resizable.d.ts +6 -0
- package/dist/components/resizable/resizable.js +100 -0
- package/dist/components/scroll-area/scroll-area.d.ts +17 -0
- package/dist/components/scroll-area/scroll-area.js +211 -0
- package/dist/components/segmented-control/segmented-control.d.ts +16 -0
- package/dist/components/segmented-control/segmented-control.js +142 -0
- package/dist/components/select/select.d.ts +43 -0
- package/dist/components/select/select.js +577 -0
- package/dist/components/separator/separator.d.ts +4 -0
- package/dist/components/separator/separator.js +38 -0
- package/dist/components/sheet/sheet.d.ts +24 -0
- package/dist/components/sheet/sheet.js +330 -0
- package/dist/components/sidebar/sidebar.d.ts +138 -0
- package/dist/components/sidebar/sidebar.js +1374 -0
- package/dist/components/skeleton/skeleton.d.ts +4 -0
- package/dist/components/skeleton/skeleton.js +40 -0
- package/dist/components/slider/slider.d.ts +9 -0
- package/dist/components/slider/slider.js +193 -0
- package/dist/components/sources/sources.d.ts +35 -0
- package/dist/components/sources/sources.js +209 -0
- package/dist/components/spinner/spinner.d.ts +11 -0
- package/dist/components/spinner/spinner.js +59 -0
- package/dist/components/stack-trace/parse-stack-trace.d.ts +21 -0
- package/dist/components/stack-trace/parse-stack-trace.js +61 -0
- package/dist/components/stack-trace/stack-trace.d.ts +79 -0
- package/dist/components/stack-trace/stack-trace.js +434 -0
- package/dist/components/subagent/subagent.d.ts +71 -0
- package/dist/components/subagent/subagent.js +450 -0
- package/dist/components/suggestion/suggestion.d.ts +21 -0
- package/dist/components/suggestion/suggestion.js +130 -0
- package/dist/components/switch/switch.d.ts +6 -0
- package/dist/components/switch/switch.js +70 -0
- package/dist/components/table/table.d.ts +19 -0
- package/dist/components/table/table.js +284 -0
- package/dist/components/table-of-contents/spy.js +84 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts +92 -0
- package/dist/components/table-of-contents/table-of-contents.js +787 -0
- package/dist/components/tabs/tabs.d.ts +25 -0
- package/dist/components/tabs/tabs.js +273 -0
- package/dist/components/task/task.d.ts +40 -0
- package/dist/components/task/task.js +262 -0
- package/dist/components/terminal/terminal.d.ts +82 -0
- package/dist/components/terminal/terminal.js +457 -0
- package/dist/components/test-results/test-results.d.ts +127 -0
- package/dist/components/test-results/test-results.js +687 -0
- package/dist/components/textarea/textarea.d.ts +8 -0
- package/dist/components/textarea/textarea.js +43 -0
- package/dist/components/time-input/time-input.d.ts +7 -0
- package/dist/components/time-input/time-input.js +82 -0
- package/dist/components/timeline/timeline.d.ts +19 -0
- package/dist/components/timeline/timeline.js +247 -0
- package/dist/components/toast/toast.d.ts +12 -0
- package/dist/components/toast/toast.js +285 -0
- package/dist/components/toggle/toggle.d.ts +15 -0
- package/dist/components/toggle/toggle.js +137 -0
- package/dist/components/token-input/token-input.d.ts +7 -0
- package/dist/components/token-input/token-input.js +117 -0
- package/dist/components/tool/tool.d.ts +66 -0
- package/dist/components/tool/tool.js +413 -0
- package/dist/components/toolbar/toolbar.d.ts +91 -0
- package/dist/components/toolbar/toolbar.js +655 -0
- package/dist/components/tooltip/tooltip.d.ts +8 -0
- package/dist/components/tooltip/tooltip.js +97 -0
- package/dist/components/trace/trace.d.ts +31 -0
- package/dist/components/trace/trace.js +309 -0
- package/dist/components/tree/tree.d.ts +13 -0
- package/dist/components/tree/tree.js +258 -0
- package/dist/components/trigger-menu/trigger-menu.d.ts +30 -0
- package/dist/components/trigger-menu/trigger-menu.js +352 -0
- package/dist/components/usage/usage.d.ts +132 -0
- package/dist/components/usage/usage.js +1368 -0
- package/dist/components/waterfall/waterfall.d.ts +20 -0
- package/dist/components/waterfall/waterfall.js +360 -0
- package/dist/components/week-strip/week-strip.d.ts +177 -0
- package/dist/components/week-strip/week-strip.js +1081 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.js +27 -0
- package/dist/core/ui-sdk.d.ts +3 -0
- package/dist/core/ui-sdk.js +3 -0
- package/dist/core/use-primitive-state.d.ts +14 -0
- package/dist/core/use-primitive-state.js +25 -0
- package/dist/styles/LICENSE-shadcn.md +21 -0
- package/dist/styles/color-scheme.css +32 -0
- package/dist/styles/components.css +303 -0
- package/dist/styles/index.css +41 -0
- package/dist/styles/tokens.css +474 -0
- package/dist/styles/typeset/shadcn.css +506 -0
- package/dist/styles/typeset.css +70 -0
- package/dist/styles/utilities.css +555 -0
- package/dist/tools/observe/index.d.ts +2 -0
- package/dist/tools/observe/index.js +3 -0
- package/dist/tools/observe/ui-sdk.d.ts +1 -0
- package/dist/tools/observe/ui-sdk.js +2 -0
- package/dist/tools/testing/check-agent.d.ts +28 -0
- package/dist/tools/testing/check-agent.js +42 -0
- package/dist/tools/testing/index.d.ts +4 -0
- package/dist/tools/testing/index.js +4 -0
- package/dist/tools/testing/ui-sdk.d.ts +1 -0
- package/dist/tools/testing/ui-sdk.js +2 -0
- package/dist/utilities/cn/index.d.ts +12 -0
- package/dist/utilities/cn/index.js +47 -0
- package/dist/utilities/color/index.d.ts +2 -0
- package/dist/utilities/color/index.js +3 -0
- package/dist/utilities/color/ui-sdk.d.ts +1 -0
- package/dist/utilities/color/ui-sdk.js +2 -0
- package/dist/utilities/date/index.d.ts +2 -0
- package/dist/utilities/date/index.js +6 -0
- package/dist/utilities/date/ui-sdk.d.ts +1 -0
- package/dist/utilities/date/ui-sdk.js +2 -0
- package/dist/utilities/image/index.d.ts +2 -0
- package/dist/utilities/image/index.js +3 -0
- package/dist/utilities/image/ui-sdk.d.ts +1 -0
- package/dist/utilities/image/ui-sdk.js +2 -0
- package/dist/utilities/mobile/index.d.ts +2 -0
- package/dist/utilities/mobile/index.js +1 -0
- package/dist/utilities/mobile/ui-sdk.d.ts +2 -0
- package/dist/utilities/mobile/ui-sdk.js +1 -0
- package/dist/utilities/number/index.d.ts +2 -0
- package/dist/utilities/number/index.js +3 -0
- package/dist/utilities/number/ui-sdk.d.ts +1 -0
- package/dist/utilities/number/ui-sdk.js +2 -0
- package/dist/utilities/platform/index.d.ts +3 -0
- package/dist/utilities/platform/index.js +14 -0
- package/dist/utilities/platform/ui-sdk.d.ts +3 -0
- package/dist/utilities/platform/ui-sdk.js +3 -0
- package/dist/utilities/storage/index.d.ts +2 -0
- package/dist/utilities/storage/index.js +1 -0
- package/dist/utilities/storage/ui-sdk.d.ts +2 -0
- package/dist/utilities/storage/ui-sdk.js +1 -0
- package/dist/utilities/text/index.d.ts +3 -0
- package/dist/utilities/text/index.js +3 -0
- package/dist/utilities/text/ui-sdk.d.ts +3 -0
- package/dist/utilities/text/ui-sdk.js +3 -0
- package/package.json +192 -4
- package/skills/agent-ready-ui/SKILL.md +229 -0
- package/skills/blocks/SKILL.md +262 -0
- package/skills/compose-screens/SKILL.md +354 -0
- package/skills/note-editor/SKILL.md +493 -0
- package/skills/note-status/SKILL.md +295 -0
- package/skills/setup/SKILL.md +136 -0
- package/skills/theming/SKILL.md +216 -0
- package/src/blocks/notes/adapters.ts +77 -0
- package/src/blocks/notes/data.ts +508 -0
- package/src/blocks/notes/notes-block.tsx +244 -0
- package/src/blocks/notes/parts/home.tsx +219 -0
- package/src/blocks/notes/parts/no-access.tsx +84 -0
- package/src/blocks/notes/parts/note-screen.tsx +412 -0
- package/src/blocks/notes/parts/notes-sidebar.tsx +277 -0
- package/src/blocks/notes/parts/panels.tsx +393 -0
- package/src/blocks/notes/parts/place.ts +15 -0
- package/src/blocks/notes/parts/review-dialog.tsx +159 -0
- package/src/blocks/notes/parts/share.tsx +172 -0
- package/src/blocks/notes/texts.ts +135 -0
- package/src/blocks/shell/adapters.ts +69 -0
- package/src/blocks/shell/data.ts +281 -0
- package/src/blocks/shell/parts/compose.tsx +292 -0
- package/src/blocks/shell/parts/home.tsx +203 -0
- package/src/blocks/shell/parts/marks.tsx +144 -0
- package/src/blocks/shell/parts/rail.tsx +166 -0
- package/src/blocks/shell/parts/rooms-column.tsx +326 -0
- package/src/blocks/shell/shell-block.tsx +210 -0
- package/src/blocks/shell/texts.ts +80 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import { extendTailwindMerge } from "tailwind-merge";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
// src/utilities/cn/index.ts
|
|
5
|
+
const twMerge = extendTailwindMerge({ extend: {
|
|
6
|
+
theme: {
|
|
7
|
+
text: [
|
|
8
|
+
"display-1",
|
|
9
|
+
"display-2",
|
|
10
|
+
"display-3",
|
|
11
|
+
"heading-1",
|
|
12
|
+
"heading-2",
|
|
13
|
+
"heading-3",
|
|
14
|
+
"heading-4",
|
|
15
|
+
"body",
|
|
16
|
+
"label",
|
|
17
|
+
"supporting",
|
|
18
|
+
"footnote",
|
|
19
|
+
"micro",
|
|
20
|
+
"chat",
|
|
21
|
+
"composer",
|
|
22
|
+
"code"
|
|
23
|
+
],
|
|
24
|
+
ease: ["drawer"]
|
|
25
|
+
},
|
|
26
|
+
classGroups: { duration: [{ duration: [
|
|
27
|
+
"quick",
|
|
28
|
+
"press",
|
|
29
|
+
"popup",
|
|
30
|
+
"modal",
|
|
31
|
+
"sheet",
|
|
32
|
+
"collapse",
|
|
33
|
+
"expand"
|
|
34
|
+
] }] }
|
|
35
|
+
} });
|
|
36
|
+
/** Joins class names and lets a later Tailwind class override an earlier one. */
|
|
37
|
+
function cn(...inputs) {
|
|
38
|
+
return twMerge(clsx(inputs));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Puts a component's own classes before the caller's `className`, which may be
|
|
42
|
+
* a function of the part's state. The caller's classes win.
|
|
43
|
+
*/
|
|
44
|
+
function cnState(base, className) {
|
|
45
|
+
return (state) => cn(base, typeof className === "function" ? className(state) : className);
|
|
46
|
+
}
|
|
47
|
+
export { cn, cnState, cva };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/color";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/date";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/image";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { EnterKeyHint, InputHintKind, InputHintOptions, InputHints, ViewportState, bindAvoidKeyboard, bindViewport, inputHints } from "./ui-sdk.js";
|
|
2
|
+
export { type EnterKeyHint, type InputHintKind, type InputHintOptions, type InputHints, type ViewportState, bindAvoidKeyboard, bindViewport, inputHints };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { bindAvoidKeyboard, bindViewport, inputHints } from "./ui-sdk.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { EnterKeyHint, InputHintKind, InputHintOptions, InputHints, ViewportState, bindAvoidKeyboard, bindViewport, inputHints } from "@ui-sdk/core";
|
|
2
|
+
export { type EnterKeyHint, type InputHintKind, type InputHintOptions, type InputHints, type ViewportState, bindAvoidKeyboard, bindViewport, inputHints };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { bindAvoidKeyboard, bindViewport, inputHints } from "@ui-sdk/core";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/number";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AnnouncePriority, announce, ariaKeyshortcuts, formatShortcut, isRTL, matchesShortcut, prepareAnnouncements, supportsTopLayer } from "./ui-sdk.js";
|
|
2
|
+
export * from "@ui-sdk/react/shortcuts";
|
|
3
|
+
export { type AnnouncePriority, announce, ariaKeyshortcuts, formatShortcut, isRTL, matchesShortcut, prepareAnnouncements, supportsTopLayer };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { announce, ariaKeyshortcuts, formatShortcut, isRTL, matchesShortcut, prepareAnnouncements, supportsTopLayer } from "./ui-sdk.js";
|
|
3
|
+
export * from "@ui-sdk/react/shortcuts";
|
|
4
|
+
// src/utilities/platform/index.ts
|
|
5
|
+
var platform_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
announce: () => announce,
|
|
7
|
+
ariaKeyshortcuts: () => ariaKeyshortcuts,
|
|
8
|
+
formatShortcut: () => formatShortcut,
|
|
9
|
+
isRTL: () => isRTL,
|
|
10
|
+
matchesShortcut: () => matchesShortcut,
|
|
11
|
+
prepareAnnouncements: () => prepareAnnouncements,
|
|
12
|
+
supportsTopLayer: () => supportsTopLayer
|
|
13
|
+
});
|
|
14
|
+
export { announce, ariaKeyshortcuts, formatShortcut, isRTL, matchesShortcut, platform_exports, prepareAnnouncements, supportsTopLayer };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AnnouncePriority, announce, ariaKeyshortcuts, formatShortcut, isRTL, matchesShortcut, prepareAnnouncements, supportsTopLayer } from "@ui-sdk/core";
|
|
2
|
+
export * from "@ui-sdk/react/shortcuts";
|
|
3
|
+
export { type AnnouncePriority, announce, ariaKeyshortcuts, formatShortcut, isRTL, matchesShortcut, prepareAnnouncements, supportsTopLayer };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { CookieStorageOptions, StorageScriptOptions, ValueStorage, createCookieStorage, createLocalStorage, createSessionStorage } from "./ui-sdk.js";
|
|
2
|
+
export { type CookieStorageOptions, type StorageScriptOptions, type ValueStorage, createCookieStorage, createLocalStorage, createSessionStorage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createCookieStorage, createLocalStorage, createSessionStorage } from "./ui-sdk.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { CookieStorageOptions, StorageScriptOptions, ValueStorage, createCookieStorage, createLocalStorage, createSessionStorage } from "@ui-sdk/core";
|
|
2
|
+
export { type CookieStorageOptions, type StorageScriptOptions, type ValueStorage, createCookieStorage, createLocalStorage, createSessionStorage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createCookieStorage, createLocalStorage, createSessionStorage } from "@ui-sdk/core";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InputHistoryOptions, createInputHistory, createTypeahead, isComposing, isTypeaheadKey, labelOf, pageLocale, toLocale, userLocale } from "./ui-sdk.js";
|
|
2
|
+
export * from "@ui-sdk/core/text-match";
|
|
3
|
+
export { type InputHistoryOptions, createInputHistory, createTypeahead, isComposing, isTypeaheadKey, labelOf, pageLocale, toLocale, userLocale };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InputHistoryOptions, createInputHistory, createTypeahead, isComposing, isTypeaheadKey, labelOf, pageLocale, toLocale, userLocale } from "@ui-sdk/core";
|
|
2
|
+
export * from "@ui-sdk/core/text-match";
|
|
3
|
+
export { type InputHistoryOptions, createInputHistory, createTypeahead, isComposing, isTypeaheadKey, labelOf, pageLocale, toLocale, userLocale };
|
package/package.json
CHANGED
|
@@ -1,6 +1,194 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asanchez-sa/abby",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Sistema de diseño para React sobre ui-sdk y Tailwind CSS.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"agents",
|
|
7
|
+
"components",
|
|
8
|
+
"design-system",
|
|
9
|
+
"react",
|
|
10
|
+
"tailwindcss",
|
|
11
|
+
"tanstack-intent",
|
|
12
|
+
"ui-sdk"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": "Alejandro Sanchez",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/asanchez-sa/abby.git"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"skills",
|
|
23
|
+
"!skills/_artifacts",
|
|
24
|
+
"src/blocks",
|
|
25
|
+
"!src/blocks/**/*.stories.tsx"
|
|
26
|
+
],
|
|
27
|
+
"type": "module",
|
|
28
|
+
"exports": {
|
|
29
|
+
"./agents": "./dist/agents/index.js",
|
|
30
|
+
"./behaviors/canvas": "./dist/behaviors/canvas/index.js",
|
|
31
|
+
"./behaviors/drag-and-drop": "./dist/behaviors/drag-and-drop/index.js",
|
|
32
|
+
"./behaviors/dragging": "./dist/behaviors/dragging/index.js",
|
|
33
|
+
"./behaviors/focus": "./dist/behaviors/focus/index.js",
|
|
34
|
+
"./behaviors/lists": "./dist/behaviors/lists/index.js",
|
|
35
|
+
"./behaviors/popups": "./dist/behaviors/popups/index.js",
|
|
36
|
+
"./behaviors/preferences": "./dist/behaviors/preferences/index.js",
|
|
37
|
+
"./behaviors/selection": "./dist/behaviors/selection/index.js",
|
|
38
|
+
"./behaviors/transitions": "./dist/behaviors/transitions/index.js",
|
|
39
|
+
"./behaviors/trees": "./dist/behaviors/trees/index.js",
|
|
40
|
+
"./core": "./dist/core/index.js",
|
|
41
|
+
"./tools/observe": "./dist/tools/observe/index.js",
|
|
42
|
+
"./tools/testing": "./dist/tools/testing/index.js",
|
|
43
|
+
"./utilities/cn": "./dist/utilities/cn/index.js",
|
|
44
|
+
"./utilities/color": "./dist/utilities/color/index.js",
|
|
45
|
+
"./utilities/date": "./dist/utilities/date/index.js",
|
|
46
|
+
"./utilities/image": "./dist/utilities/image/index.js",
|
|
47
|
+
"./utilities/mobile": "./dist/utilities/mobile/index.js",
|
|
48
|
+
"./utilities/number": "./dist/utilities/number/index.js",
|
|
49
|
+
"./utilities/platform": "./dist/utilities/platform/index.js",
|
|
50
|
+
"./utilities/storage": "./dist/utilities/storage/index.js",
|
|
51
|
+
"./utilities/text": "./dist/utilities/text/index.js",
|
|
52
|
+
"./package.json": "./package.json",
|
|
53
|
+
"./accordion": "./dist/components/accordion/accordion.js",
|
|
54
|
+
"./alert-dialog": "./dist/components/alert-dialog/alert-dialog.js",
|
|
55
|
+
"./alert": "./dist/components/alert/alert.js",
|
|
56
|
+
"./aspect-ratio": "./dist/components/aspect-ratio/aspect-ratio.js",
|
|
57
|
+
"./attachment": "./dist/components/attachment/attachment.js",
|
|
58
|
+
"./autocomplete": "./dist/components/autocomplete/autocomplete.js",
|
|
59
|
+
"./avatar-group": "./dist/components/avatar-group/avatar-group.js",
|
|
60
|
+
"./avatar": "./dist/components/avatar/avatar.js",
|
|
61
|
+
"./badge": "./dist/components/badge/badge.js",
|
|
62
|
+
"./breadcrumb": "./dist/components/breadcrumb/breadcrumb.js",
|
|
63
|
+
"./bubble": "./dist/components/bubble/bubble.js",
|
|
64
|
+
"./button-group": "./dist/components/button-group/button-group.js",
|
|
65
|
+
"./button": "./dist/components/button/button.js",
|
|
66
|
+
"./calendar": "./dist/components/calendar/calendar.js",
|
|
67
|
+
"./card": "./dist/components/card/card.js",
|
|
68
|
+
"./carousel": "./dist/components/carousel/carousel.js",
|
|
69
|
+
"./chain-of-thought": "./dist/components/chain-of-thought/chain-of-thought.js",
|
|
70
|
+
"./chat": "./dist/components/chat/chat.js",
|
|
71
|
+
"./checkbox": "./dist/components/checkbox/checkbox.js",
|
|
72
|
+
"./checkpoint": "./dist/components/checkpoint/checkpoint.js",
|
|
73
|
+
"./choice-cards": "./dist/components/choice-cards/choice-cards.js",
|
|
74
|
+
"./code-block": "./dist/components/code-block/code-block.js",
|
|
75
|
+
"./collapsible": "./dist/components/collapsible/collapsible.js",
|
|
76
|
+
"./color-picker": "./dist/components/color-picker/color-picker.js",
|
|
77
|
+
"./combobox": "./dist/components/combobox/combobox.js",
|
|
78
|
+
"./command-dock": "./dist/components/command-dock/command-dock.js",
|
|
79
|
+
"./command": "./dist/components/command/command.js",
|
|
80
|
+
"./confirmation": "./dist/components/confirmation/confirmation.js",
|
|
81
|
+
"./context": "./dist/components/context/context.js",
|
|
82
|
+
"./date-input": "./dist/components/date-input/date-input.js",
|
|
83
|
+
"./date-picker": "./dist/components/date-picker/date-picker.js",
|
|
84
|
+
"./dialog": "./dist/components/dialog/dialog.js",
|
|
85
|
+
"./drawer": "./dist/components/drawer/drawer.js",
|
|
86
|
+
"./empty": "./dist/components/empty/empty.js",
|
|
87
|
+
"./field": "./dist/components/field/field.js",
|
|
88
|
+
"./file-input": "./dist/components/file-input/file-input.js",
|
|
89
|
+
"./file-tree": "./dist/components/file-tree/file-tree.js",
|
|
90
|
+
"./hover-card": "./dist/components/hover-card/hover-card.js",
|
|
91
|
+
"./icon": "./dist/components/icon/icon.js",
|
|
92
|
+
"./image-cropper": "./dist/components/image-cropper/image-cropper.js",
|
|
93
|
+
"./inline-citation": "./dist/components/inline-citation/inline-citation.js",
|
|
94
|
+
"./input-group": "./dist/components/input-group/input-group.js",
|
|
95
|
+
"./input": "./dist/components/input/input.js",
|
|
96
|
+
"./item": "./dist/components/item/item.js",
|
|
97
|
+
"./kbd": "./dist/components/kbd/kbd.js",
|
|
98
|
+
"./label": "./dist/components/label/label.js",
|
|
99
|
+
"./link": "./dist/components/link/link.js",
|
|
100
|
+
"./listbox": "./dist/components/listbox/listbox.js",
|
|
101
|
+
"./marker": "./dist/components/marker/marker.js",
|
|
102
|
+
"./menu": "./dist/components/menu/menu.js",
|
|
103
|
+
"./menubar": "./dist/components/menubar/menubar.js",
|
|
104
|
+
"./message-scroller": "./dist/components/message-scroller/message-scroller.js",
|
|
105
|
+
"./message": "./dist/components/message/message.js",
|
|
106
|
+
"./meter": "./dist/components/meter/meter.js",
|
|
107
|
+
"./model-selector": "./dist/components/model-selector/model-selector.js",
|
|
108
|
+
"./native-select": "./dist/components/native-select/native-select.js",
|
|
109
|
+
"./navigation-menu": "./dist/components/navigation-menu/navigation-menu.js",
|
|
110
|
+
"./note-editor": "./dist/components/note-editor/note-editor.js",
|
|
111
|
+
"./note-place": "./dist/components/note-place/note-place.js",
|
|
112
|
+
"./note-status": "./dist/components/note-status/note-status.js",
|
|
113
|
+
"./number-input": "./dist/components/number-input/number-input.js",
|
|
114
|
+
"./otp-input": "./dist/components/otp-input/otp-input.js",
|
|
115
|
+
"./pagination": "./dist/components/pagination/pagination.js",
|
|
116
|
+
"./password-input": "./dist/components/password-input/password-input.js",
|
|
117
|
+
"./plan": "./dist/components/plan/plan.js",
|
|
118
|
+
"./popover": "./dist/components/popover/popover.js",
|
|
119
|
+
"./preferences": "./dist/components/preferences/preferences.js",
|
|
120
|
+
"./progress": "./dist/components/progress/progress.js",
|
|
121
|
+
"./prompt-input": "./dist/components/prompt-input/prompt-input.js",
|
|
122
|
+
"./questionnaire": "./dist/components/questionnaire/questionnaire.js",
|
|
123
|
+
"./queue": "./dist/components/queue/queue.js",
|
|
124
|
+
"./radio": "./dist/components/radio/radio.js",
|
|
125
|
+
"./rating": "./dist/components/rating/rating.js",
|
|
126
|
+
"./reasoning": "./dist/components/reasoning/reasoning.js",
|
|
127
|
+
"./resizable": "./dist/components/resizable/resizable.js",
|
|
128
|
+
"./scroll-area": "./dist/components/scroll-area/scroll-area.js",
|
|
129
|
+
"./segmented-control": "./dist/components/segmented-control/segmented-control.js",
|
|
130
|
+
"./select": "./dist/components/select/select.js",
|
|
131
|
+
"./separator": "./dist/components/separator/separator.js",
|
|
132
|
+
"./sheet": "./dist/components/sheet/sheet.js",
|
|
133
|
+
"./sidebar": "./dist/components/sidebar/sidebar.js",
|
|
134
|
+
"./skeleton": "./dist/components/skeleton/skeleton.js",
|
|
135
|
+
"./slider": "./dist/components/slider/slider.js",
|
|
136
|
+
"./sources": "./dist/components/sources/sources.js",
|
|
137
|
+
"./spinner": "./dist/components/spinner/spinner.js",
|
|
138
|
+
"./stack-trace": "./dist/components/stack-trace/stack-trace.js",
|
|
139
|
+
"./subagent": "./dist/components/subagent/subagent.js",
|
|
140
|
+
"./suggestion": "./dist/components/suggestion/suggestion.js",
|
|
141
|
+
"./switch": "./dist/components/switch/switch.js",
|
|
142
|
+
"./table-of-contents": "./dist/components/table-of-contents/table-of-contents.js",
|
|
143
|
+
"./table": "./dist/components/table/table.js",
|
|
144
|
+
"./tabs": "./dist/components/tabs/tabs.js",
|
|
145
|
+
"./task": "./dist/components/task/task.js",
|
|
146
|
+
"./terminal": "./dist/components/terminal/terminal.js",
|
|
147
|
+
"./test-results": "./dist/components/test-results/test-results.js",
|
|
148
|
+
"./textarea": "./dist/components/textarea/textarea.js",
|
|
149
|
+
"./time-input": "./dist/components/time-input/time-input.js",
|
|
150
|
+
"./timeline": "./dist/components/timeline/timeline.js",
|
|
151
|
+
"./toast": "./dist/components/toast/toast.js",
|
|
152
|
+
"./toggle": "./dist/components/toggle/toggle.js",
|
|
153
|
+
"./token-input": "./dist/components/token-input/token-input.js",
|
|
154
|
+
"./tool": "./dist/components/tool/tool.js",
|
|
155
|
+
"./toolbar": "./dist/components/toolbar/toolbar.js",
|
|
156
|
+
"./tooltip": "./dist/components/tooltip/tooltip.js",
|
|
157
|
+
"./trace": "./dist/components/trace/trace.js",
|
|
158
|
+
"./tree": "./dist/components/tree/tree.js",
|
|
159
|
+
"./trigger-menu": "./dist/components/trigger-menu/trigger-menu.js",
|
|
160
|
+
"./usage": "./dist/components/usage/usage.js",
|
|
161
|
+
"./waterfall": "./dist/components/waterfall/waterfall.js",
|
|
162
|
+
"./week-strip": "./dist/components/week-strip/week-strip.js",
|
|
163
|
+
"./styles.css": "./dist/styles/index.css",
|
|
164
|
+
"./typeset.css": "./dist/styles/typeset.css",
|
|
165
|
+
"./themes/*.css": "./dist/styles/themes/*.css"
|
|
166
|
+
},
|
|
167
|
+
"publishConfig": {
|
|
168
|
+
"access": "public",
|
|
169
|
+
"registry": "https://registry.npmjs.org/"
|
|
170
|
+
},
|
|
171
|
+
"dependencies": {
|
|
172
|
+
"@fontsource-variable/geist": "^5.3.0",
|
|
173
|
+
"@fontsource-variable/geist-mono": "^5.3.0",
|
|
174
|
+
"@hugeicons/core-free-icons": "^4.4.0",
|
|
175
|
+
"@hugeicons/react": "^1.1.10",
|
|
176
|
+
"@tiptap/core": "3.32.2",
|
|
177
|
+
"@tiptap/extension-list": "3.32.2",
|
|
178
|
+
"@tiptap/extension-unique-id": "3.32.2",
|
|
179
|
+
"@tiptap/extensions": "3.32.2",
|
|
180
|
+
"@tiptap/markdown": "3.32.2",
|
|
181
|
+
"@tiptap/pm": "3.32.2",
|
|
182
|
+
"@tiptap/starter-kit": "3.32.2",
|
|
183
|
+
"@ui-sdk/core": "^0.1.0-beta.1",
|
|
184
|
+
"@ui-sdk/react": "^0.1.0-beta.1",
|
|
185
|
+
"class-variance-authority": "^0.7.1",
|
|
186
|
+
"clsx": "^2.1.1",
|
|
187
|
+
"shiki": "^4.6.0",
|
|
188
|
+
"tailwind-merge": "^3.7.0"
|
|
189
|
+
},
|
|
190
|
+
"peerDependencies": {
|
|
191
|
+
"react": ">=19",
|
|
192
|
+
"react-dom": ">=19"
|
|
193
|
+
}
|
|
194
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-ready-ui
|
|
3
|
+
description: "Use when an AI agent must read and operate an app built with abby:
|
|
4
|
+
createAgent, unique accessible names, data-agent-confirm, data-agent-secret
|
|
5
|
+
and data-agent-hidden, refusing agent changes with details.cancel(), approvals
|
|
6
|
+
and runAgentTool for a chat, WebMCP with registerTools, and checkAgent in
|
|
7
|
+
tests."
|
|
8
|
+
metadata:
|
|
9
|
+
purpose: Lets an agent use an abby interface the way a person does, through
|
|
10
|
+
ui-sdk's bridge instead of screenshots and clicks, with the person approving
|
|
11
|
+
risky steps and the app keeping its rules.
|
|
12
|
+
type: core
|
|
13
|
+
library: abby
|
|
14
|
+
library_version: 0.1.0
|
|
15
|
+
requires:
|
|
16
|
+
- compose-screens
|
|
17
|
+
sources:
|
|
18
|
+
- src/agents/*.ts
|
|
19
|
+
- src/tools/testing/check-agent.ts
|
|
20
|
+
- README.md
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# Make an abby interface usable by an agent
|
|
24
|
+
|
|
25
|
+
Read the compose-screens skill first. Every abby component is listed on ui-sdk's agent bridge: an agent reads the controls with `snapshot()`, finds them by their accessible name, and runs their actions with `act()`. Import the bridge from `abby/agents`, not `@ui-sdk/core/agent`. ui-sdk's own skill (`@ui-sdk/core#ui-sdk`) covers the bridge's API in depth.
|
|
26
|
+
|
|
27
|
+
## Setup
|
|
28
|
+
|
|
29
|
+
Create the bridge once, in client code, before the page renders. With approvals, a step marked `data-agent-confirm` waits for the person.
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { createAgent, createApprovals } from "abby/agents";
|
|
33
|
+
|
|
34
|
+
export const approvals = createApprovals();
|
|
35
|
+
export const agent = createAgent({ allow: approvals.allow });
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Core Patterns
|
|
39
|
+
|
|
40
|
+
### Name every control once
|
|
41
|
+
|
|
42
|
+
The agent finds a control by its name: a `FieldLabel`, a button's text or an `aria-label`. Each name is unique on the page, and no name contains another's whole words: "Region" and "Suggest a region" collide. A label has to stand alone: "Undo archive", not "Undo". `snapshot()` lists controls only, so static text next to a control doesn't explain it to the agent.
|
|
43
|
+
|
|
44
|
+
### Mark what the agent may not do, read or see
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
import { Button } from "abby/button";
|
|
48
|
+
import { Field, FieldLabel } from "abby/field";
|
|
49
|
+
import { Input } from "abby/input";
|
|
50
|
+
|
|
51
|
+
export function Danger() {
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
<Button variant="destructive" data-agent-confirm="Deletes the project">
|
|
55
|
+
Delete project
|
|
56
|
+
</Button>
|
|
57
|
+
<Field name="apiKey">
|
|
58
|
+
<FieldLabel>API key</FieldLabel>
|
|
59
|
+
<Input data-agent-secret="" />
|
|
60
|
+
</Field>
|
|
61
|
+
<div data-agent-hidden="">Internal notes</div>
|
|
62
|
+
</>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`data-agent-confirm` asks the person first, `data-agent-secret` hides the value, `data-agent-hidden` hides the element and everything inside it.
|
|
68
|
+
|
|
69
|
+
### Keep business rules in the change callbacks
|
|
70
|
+
|
|
71
|
+
`details.source === "agent"` tells the agent's changes apart, and `details.cancel()` refuses one. `act()` reports no error for a refused step, so use `actAndCheck` (or `runAgentTool`, which uses it) to tell the model which steps changed nothing.
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
"use client";
|
|
75
|
+
|
|
76
|
+
import { Field, FieldLabel } from "abby/field";
|
|
77
|
+
import { Select, SelectContent, SelectTrigger } from "abby/select";
|
|
78
|
+
|
|
79
|
+
const plans = [
|
|
80
|
+
{ value: "pro", label: "Pro" },
|
|
81
|
+
{ value: "enterprise", label: "Enterprise" },
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
export function PlanField() {
|
|
85
|
+
return (
|
|
86
|
+
<Field name="plan">
|
|
87
|
+
<FieldLabel>Plan</FieldLabel>
|
|
88
|
+
<Select
|
|
89
|
+
items={plans}
|
|
90
|
+
defaultValue="pro"
|
|
91
|
+
onValueChange={(value, details) => {
|
|
92
|
+
if (details.source === "agent" && value === "enterprise") details.cancel();
|
|
93
|
+
}}
|
|
94
|
+
>
|
|
95
|
+
<SelectTrigger />
|
|
96
|
+
<SelectContent />
|
|
97
|
+
</Select>
|
|
98
|
+
</Field>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Ask the person in the chat
|
|
104
|
+
|
|
105
|
+
`useApprovals` lists the pending steps. Draw one `Confirmation` each. Mark the approve button with `data-agent-confirm` too, so the agent can't approve its own step.
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
"use client";
|
|
109
|
+
|
|
110
|
+
import { createApprovals, useApprovals } from "abby/agents";
|
|
111
|
+
import {
|
|
112
|
+
Confirmation,
|
|
113
|
+
ConfirmationAction,
|
|
114
|
+
ConfirmationActions,
|
|
115
|
+
ConfirmationTitle,
|
|
116
|
+
} from "abby/confirmation";
|
|
117
|
+
|
|
118
|
+
const approvals = createApprovals();
|
|
119
|
+
|
|
120
|
+
export function PendingSteps() {
|
|
121
|
+
const pending = useApprovals(approvals);
|
|
122
|
+
return pending.map((approval) => {
|
|
123
|
+
const what =
|
|
124
|
+
approval.confirm ?? `${approval.step.action} on ${approval.step.label ?? "a control"}`;
|
|
125
|
+
return (
|
|
126
|
+
<Confirmation
|
|
127
|
+
key={approval.id}
|
|
128
|
+
approval={{ id: approval.id }}
|
|
129
|
+
state="approval-requested"
|
|
130
|
+
aria-label={what}
|
|
131
|
+
>
|
|
132
|
+
<ConfirmationTitle>{what}?</ConfirmationTitle>
|
|
133
|
+
<ConfirmationActions>
|
|
134
|
+
<ConfirmationAction variant="outline" onClick={() => approvals.reject(approval.id)}>
|
|
135
|
+
Deny
|
|
136
|
+
</ConfirmationAction>
|
|
137
|
+
<ConfirmationAction
|
|
138
|
+
data-agent-confirm={`Approves: ${what}`}
|
|
139
|
+
onClick={() => approvals.approve(approval.id)}
|
|
140
|
+
>
|
|
141
|
+
Approve
|
|
142
|
+
</ConfirmationAction>
|
|
143
|
+
</ConfirmationActions>
|
|
144
|
+
</Confirmation>
|
|
145
|
+
);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Connect a model's tool calls
|
|
151
|
+
|
|
152
|
+
`agentTools` describes the three tools (`snapshot`, `act`, `query`) for the model. `runAgentTool` runs a call and resolves with what to send back, including `{ error }` for an unknown tool. `collectChanges` tells the model what the person changed since its last turn.
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
import { agentTools, collectChanges, createAgent, runAgentTool } from "abby/agents";
|
|
156
|
+
|
|
157
|
+
const agent = createAgent();
|
|
158
|
+
const changes = collectChanges(agent);
|
|
159
|
+
|
|
160
|
+
export const tools = agentTools.map(({ name, description, inputSchema }) => ({
|
|
161
|
+
name,
|
|
162
|
+
description,
|
|
163
|
+
input_schema: inputSchema,
|
|
164
|
+
}));
|
|
165
|
+
|
|
166
|
+
export async function onToolCall(call: { name: string; input: unknown }) {
|
|
167
|
+
const context = changes
|
|
168
|
+
.take()
|
|
169
|
+
.map((change) => `${change.label}: ${change.previous} → ${change.value}`);
|
|
170
|
+
const result = await runAgentTool(agent, call.name, call.input);
|
|
171
|
+
return { context, result };
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
To offer the same tools to the browser's agent (WebMCP), call `registerTools(agent, { allow: () => true })`. The bridge already asks through `allow`, so don't ask twice.
|
|
176
|
+
|
|
177
|
+
### Undo the agent's changes
|
|
178
|
+
|
|
179
|
+
`createHistory` records each change and who made it. `history.undoSource("agent")` behind a `Checkpoint` undoes the agent's changes only, and `useAgentHistory` reads the entries in React. `stageChanges` previews a suggestion on the real controls, and `revert()` discards it.
|
|
180
|
+
|
|
181
|
+
### Check a screen in tests
|
|
182
|
+
|
|
183
|
+
`checkAgent` from `abby/tools/testing` throws when a control has no name, when two share one, or when an enabled button takes no action. It returns the entries; find one by its label, never by position.
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
import { createAgent } from "abby/agents";
|
|
187
|
+
import { checkAgent } from "abby/tools/testing";
|
|
188
|
+
|
|
189
|
+
const agent = createAgent();
|
|
190
|
+
|
|
191
|
+
export async function choosePlan() {
|
|
192
|
+
const entries = checkAgent(agent);
|
|
193
|
+
const plan = entries.find((entry) => entry.label === "Plan");
|
|
194
|
+
await agent.act({ steps: [{ ref: "Plan", action: "setValue", args: ["Enterprise"] }] });
|
|
195
|
+
return plan;
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Common Mistakes
|
|
200
|
+
|
|
201
|
+
### CRITICAL: An approve button the agent can press
|
|
202
|
+
|
|
203
|
+
Without `data-agent-confirm` on the approve button, the agent can approve its own risky step. Mark it.
|
|
204
|
+
|
|
205
|
+
### HIGH: Treating a refused step as done
|
|
206
|
+
|
|
207
|
+
`act()` returns no error when `onValueChange` calls `details.cancel()`. Read `unchanged` from `actAndCheck`, or the value, before telling the model the step worked. Source: `src/agents/run-tool.ts`.
|
|
208
|
+
|
|
209
|
+
### HIGH: A bare `<a>`, or a `Button` rendered as a link
|
|
210
|
+
|
|
211
|
+
The agent can't follow either. Use `Link` from `abby/link`.
|
|
212
|
+
|
|
213
|
+
### HIGH: Lists written only as children
|
|
214
|
+
|
|
215
|
+
A closed Select or Menu written with item children has no choices to read. Pass `items` so the agent can choose without opening the list.
|
|
216
|
+
|
|
217
|
+
### MEDIUM: Asking twice
|
|
218
|
+
|
|
219
|
+
With `allow` on the bridge, `registerTools(agent, { allow: () => true })`. Asking in both places shows the person two prompts.
|
|
220
|
+
|
|
221
|
+
### MEDIUM: Finding entries by position
|
|
222
|
+
|
|
223
|
+
The order of `snapshot()` isn't stable. Find an entry by its `label`.
|
|
224
|
+
|
|
225
|
+
## Completion
|
|
226
|
+
|
|
227
|
+
- `checkAgent(agent)` passes on each screen.
|
|
228
|
+
- A test drives the main task with `agent.act()` and checks the resulting state, including a refused step that leaves the value as it was.
|
|
229
|
+
- Each risky action waits for approval, and the agent can't approve it.
|