@asanchez-sa/abby 0.0.0-stage → 0.1.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 +245 -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 +337 -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 +687 -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,58 @@
|
|
|
1
|
+
import { ButtonProps } from "../button/button.js";
|
|
2
|
+
import { ItemActions, ItemProps, ItemTitle } from "../item/item.js";
|
|
3
|
+
import { ComponentProps, ReactNode } from "react";
|
|
4
|
+
/** Where a tool call is. The names are the AI SDK's, so a tool part's `state` fits as it comes. */
|
|
5
|
+
type ConfirmationState = "input-streaming" | "input-available" | "approval-requested" | "approval-responded" | "output-available" | "output-error" | "output-denied";
|
|
6
|
+
/** The approval of a tool call: asked while `approved` is undefined, then answered. */
|
|
7
|
+
type ConfirmationApproval = {
|
|
8
|
+
id: string;
|
|
9
|
+
approved?: boolean;
|
|
10
|
+
reason?: string;
|
|
11
|
+
};
|
|
12
|
+
type ConfirmationContextValue = {
|
|
13
|
+
approval: ConfirmationApproval | undefined;
|
|
14
|
+
state: ConfirmationState;
|
|
15
|
+
};
|
|
16
|
+
/** The approval and the state of the tool call, for a part inside `Confirmation`. */
|
|
17
|
+
declare function useConfirmation(): ConfirmationContextValue;
|
|
18
|
+
type ConfirmationProps = ItemProps & {
|
|
19
|
+
/** The tool call's approval. Without one the tool needs no answer, and nothing renders. */
|
|
20
|
+
approval?: ConfirmationApproval;
|
|
21
|
+
state: ConfirmationState;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The question a tool asks before it runs. It renders nothing until the call
|
|
25
|
+
* asks for approval. It is a group: name it with `aria-label`, like "Run rm -rf dist?".
|
|
26
|
+
*/
|
|
27
|
+
declare function Confirmation({ approval, state, variant, size, ...props }: ConfirmationProps): import("react").JSX.Element | null;
|
|
28
|
+
type ConfirmationTitleProps = ComponentProps<typeof ItemTitle> & {
|
|
29
|
+
/** A line under the title, like where the command runs. */
|
|
30
|
+
description?: ReactNode;
|
|
31
|
+
};
|
|
32
|
+
/** The question's text. It holds `ConfirmationRequest`, `ConfirmationAccepted` and `ConfirmationRejected`, or plain text. */
|
|
33
|
+
declare function ConfirmationTitle({ description, ...props }: ConfirmationTitleProps): import("react").JSX.Element;
|
|
34
|
+
type ConfirmationRequestProps = {
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
};
|
|
37
|
+
/** Shows its children while the tool waits for an answer. */
|
|
38
|
+
declare function ConfirmationRequest({ children }: ConfirmationRequestProps): ReactNode;
|
|
39
|
+
type ConfirmationAcceptedProps = {
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
};
|
|
42
|
+
/** Shows its children once the person approved. */
|
|
43
|
+
declare function ConfirmationAccepted({ children }: ConfirmationAcceptedProps): ReactNode;
|
|
44
|
+
type ConfirmationRejectedProps = {
|
|
45
|
+
children?: ReactNode;
|
|
46
|
+
};
|
|
47
|
+
/** Shows its children once the person denied. */
|
|
48
|
+
declare function ConfirmationRejected({ children }: ConfirmationRejectedProps): ReactNode;
|
|
49
|
+
type ConfirmationActionsProps = ComponentProps<typeof ItemActions>;
|
|
50
|
+
/** The buttons that answer. They show only while the tool waits for an answer. */
|
|
51
|
+
declare function ConfirmationActions(props: ConfirmationActionsProps): import("react").JSX.Element | null;
|
|
52
|
+
type ConfirmationActionProps = ButtonProps;
|
|
53
|
+
/**
|
|
54
|
+
* One answer. Give the one that approves `data-agent-confirm` with what it
|
|
55
|
+
* does, so an agent can't approve its own tool call without the person.
|
|
56
|
+
*/
|
|
57
|
+
declare function ConfirmationAction({ size, ...props }: ConfirmationActionProps): import("react").JSX.Element;
|
|
58
|
+
export { Confirmation, ConfirmationAccepted, type ConfirmationAcceptedProps, ConfirmationAction, type ConfirmationActionProps, ConfirmationActions, type ConfirmationActionsProps, type ConfirmationApproval, type ConfirmationProps, ConfirmationRejected, type ConfirmationRejectedProps, ConfirmationRequest, type ConfirmationRequestProps, type ConfirmationState, ConfirmationTitle, type ConfirmationTitleProps, useConfirmation };
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Button } from "../button/button.js";
|
|
3
|
+
import { Item, ItemActions, ItemContent, ItemDescription, ItemTitle } from "../item/item.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { createContext, use } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
// src/components/confirmation/confirmation.tsx
|
|
8
|
+
const ConfirmationContext = createContext(null);
|
|
9
|
+
/** The approval and the state of the tool call, for a part inside `Confirmation`. */
|
|
10
|
+
function useConfirmation() {
|
|
11
|
+
const context = use(ConfirmationContext);
|
|
12
|
+
if (!context) throw new Error("Confirmation parts must be used within Confirmation");
|
|
13
|
+
return context;
|
|
14
|
+
}
|
|
15
|
+
/** Whether the tool call got its answer. */
|
|
16
|
+
function isAnswered(state) {
|
|
17
|
+
return state === "approval-responded" || state === "output-denied" || state === "output-available";
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The question a tool asks before it runs. It renders nothing until the call
|
|
21
|
+
* asks for approval. It is a group: name it with `aria-label`, like "Run rm -rf dist?".
|
|
22
|
+
*/
|
|
23
|
+
function Confirmation(t0) {
|
|
24
|
+
const $ = c(17);
|
|
25
|
+
let approval;
|
|
26
|
+
let props;
|
|
27
|
+
let state;
|
|
28
|
+
let t1;
|
|
29
|
+
let t2;
|
|
30
|
+
if ($[0] !== t0) {
|
|
31
|
+
({approval, state, variant: t1, size: t2, ...props} = t0);
|
|
32
|
+
$[0] = t0;
|
|
33
|
+
$[1] = approval;
|
|
34
|
+
$[2] = props;
|
|
35
|
+
$[3] = state;
|
|
36
|
+
$[4] = t1;
|
|
37
|
+
$[5] = t2;
|
|
38
|
+
} else {
|
|
39
|
+
approval = $[1];
|
|
40
|
+
props = $[2];
|
|
41
|
+
state = $[3];
|
|
42
|
+
t1 = $[4];
|
|
43
|
+
t2 = $[5];
|
|
44
|
+
}
|
|
45
|
+
const variant = t1 === void 0 ? "outline" : t1;
|
|
46
|
+
const size = t2 === void 0 ? "sm" : t2;
|
|
47
|
+
if (!approval || state === "input-streaming" || state === "input-available") return null;
|
|
48
|
+
let t3;
|
|
49
|
+
if ($[6] !== approval || $[7] !== state) {
|
|
50
|
+
t3 = {
|
|
51
|
+
approval,
|
|
52
|
+
state
|
|
53
|
+
};
|
|
54
|
+
$[6] = approval;
|
|
55
|
+
$[7] = state;
|
|
56
|
+
$[8] = t3;
|
|
57
|
+
} else t3 = $[8];
|
|
58
|
+
let t4;
|
|
59
|
+
if ($[9] !== props || $[10] !== size || $[11] !== state || $[12] !== variant) {
|
|
60
|
+
t4 = /* @__PURE__ */ jsx(Item, {
|
|
61
|
+
role: "group",
|
|
62
|
+
"data-state": state,
|
|
63
|
+
variant,
|
|
64
|
+
size,
|
|
65
|
+
...props
|
|
66
|
+
});
|
|
67
|
+
$[9] = props;
|
|
68
|
+
$[10] = size;
|
|
69
|
+
$[11] = state;
|
|
70
|
+
$[12] = variant;
|
|
71
|
+
$[13] = t4;
|
|
72
|
+
} else t4 = $[13];
|
|
73
|
+
let t5;
|
|
74
|
+
if ($[14] !== t3 || $[15] !== t4) {
|
|
75
|
+
t5 = /* @__PURE__ */ jsx(ConfirmationContext, {
|
|
76
|
+
value: t3,
|
|
77
|
+
children: t4
|
|
78
|
+
});
|
|
79
|
+
$[14] = t3;
|
|
80
|
+
$[15] = t4;
|
|
81
|
+
$[16] = t5;
|
|
82
|
+
} else t5 = $[16];
|
|
83
|
+
return t5;
|
|
84
|
+
}
|
|
85
|
+
/** The question's text. It holds `ConfirmationRequest`, `ConfirmationAccepted` and `ConfirmationRejected`, or plain text. */
|
|
86
|
+
function ConfirmationTitle(t0) {
|
|
87
|
+
const $ = c(10);
|
|
88
|
+
let description;
|
|
89
|
+
let props;
|
|
90
|
+
if ($[0] !== t0) {
|
|
91
|
+
({description, ...props} = t0);
|
|
92
|
+
$[0] = t0;
|
|
93
|
+
$[1] = description;
|
|
94
|
+
$[2] = props;
|
|
95
|
+
} else {
|
|
96
|
+
description = $[1];
|
|
97
|
+
props = $[2];
|
|
98
|
+
}
|
|
99
|
+
let t1;
|
|
100
|
+
if ($[3] !== props) {
|
|
101
|
+
t1 = /* @__PURE__ */ jsx(ItemTitle, { ...props });
|
|
102
|
+
$[3] = props;
|
|
103
|
+
$[4] = t1;
|
|
104
|
+
} else t1 = $[4];
|
|
105
|
+
let t2;
|
|
106
|
+
if ($[5] !== description) {
|
|
107
|
+
t2 = description != null && /* @__PURE__ */ jsx(ItemDescription, { children: description });
|
|
108
|
+
$[5] = description;
|
|
109
|
+
$[6] = t2;
|
|
110
|
+
} else t2 = $[6];
|
|
111
|
+
let t3;
|
|
112
|
+
if ($[7] !== t1 || $[8] !== t2) {
|
|
113
|
+
t3 = /* @__PURE__ */ jsxs(ItemContent, { children: [t1, t2] });
|
|
114
|
+
$[7] = t1;
|
|
115
|
+
$[8] = t2;
|
|
116
|
+
$[9] = t3;
|
|
117
|
+
} else t3 = $[9];
|
|
118
|
+
return t3;
|
|
119
|
+
}
|
|
120
|
+
/** Shows its children while the tool waits for an answer. */
|
|
121
|
+
function ConfirmationRequest(t0) {
|
|
122
|
+
const { children } = t0;
|
|
123
|
+
const { state } = useConfirmation();
|
|
124
|
+
return state === "approval-requested" ? children : null;
|
|
125
|
+
}
|
|
126
|
+
/** Shows its children once the person approved. */
|
|
127
|
+
function ConfirmationAccepted(t0) {
|
|
128
|
+
const { children } = t0;
|
|
129
|
+
const { approval, state } = useConfirmation();
|
|
130
|
+
return approval?.approved === true && isAnswered(state) ? children : null;
|
|
131
|
+
}
|
|
132
|
+
/** Shows its children once the person denied. */
|
|
133
|
+
function ConfirmationRejected(t0) {
|
|
134
|
+
const { children } = t0;
|
|
135
|
+
const { approval, state } = useConfirmation();
|
|
136
|
+
return approval?.approved === false && isAnswered(state) ? children : null;
|
|
137
|
+
}
|
|
138
|
+
/** The buttons that answer. They show only while the tool waits for an answer. */
|
|
139
|
+
function ConfirmationActions(props) {
|
|
140
|
+
const $ = c(3);
|
|
141
|
+
const { state } = useConfirmation();
|
|
142
|
+
let t0;
|
|
143
|
+
if ($[0] !== props || $[1] !== state) {
|
|
144
|
+
t0 = state === "approval-requested" ? /* @__PURE__ */ jsx(ItemActions, { ...props }) : null;
|
|
145
|
+
$[0] = props;
|
|
146
|
+
$[1] = state;
|
|
147
|
+
$[2] = t0;
|
|
148
|
+
} else t0 = $[2];
|
|
149
|
+
return t0;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* One answer. Give the one that approves `data-agent-confirm` with what it
|
|
153
|
+
* does, so an agent can't approve its own tool call without the person.
|
|
154
|
+
*/
|
|
155
|
+
function ConfirmationAction(t0) {
|
|
156
|
+
const $ = c(6);
|
|
157
|
+
let props;
|
|
158
|
+
let t1;
|
|
159
|
+
if ($[0] !== t0) {
|
|
160
|
+
({size: t1, ...props} = t0);
|
|
161
|
+
$[0] = t0;
|
|
162
|
+
$[1] = props;
|
|
163
|
+
$[2] = t1;
|
|
164
|
+
} else {
|
|
165
|
+
props = $[1];
|
|
166
|
+
t1 = $[2];
|
|
167
|
+
}
|
|
168
|
+
const size = t1 === void 0 ? "sm" : t1;
|
|
169
|
+
let t2;
|
|
170
|
+
if ($[3] !== props || $[4] !== size) {
|
|
171
|
+
t2 = /* @__PURE__ */ jsx(Button, {
|
|
172
|
+
size,
|
|
173
|
+
...props
|
|
174
|
+
});
|
|
175
|
+
$[3] = props;
|
|
176
|
+
$[4] = size;
|
|
177
|
+
$[5] = t2;
|
|
178
|
+
} else t2 = $[5];
|
|
179
|
+
return t2;
|
|
180
|
+
}
|
|
181
|
+
export { Confirmation, ConfirmationAccepted, ConfirmationAction, ConfirmationActions, ConfirmationRejected, ConfirmationRequest, ConfirmationTitle, useConfirmation };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { UsageContentProps, UsageProps, UsageSectionProps, UsageTriggerProps } from "../usage/usage.js";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* The tokens of each kind. The field names are the AI SDK's
|
|
5
|
+
* `LanguageModelUsage`, so its value can be passed as it is.
|
|
6
|
+
*/
|
|
7
|
+
type ContextUsage = {
|
|
8
|
+
inputTokens?: number;
|
|
9
|
+
outputTokens?: number;
|
|
10
|
+
reasoningTokens?: number;
|
|
11
|
+
cachedInputTokens?: number;
|
|
12
|
+
};
|
|
13
|
+
type ContextValue = {
|
|
14
|
+
usedTokens: number;
|
|
15
|
+
maxTokens: number;
|
|
16
|
+
usage?: ContextUsage;
|
|
17
|
+
modelId?: string;
|
|
18
|
+
/** The share of the window in use, a whole number from 0 to 100. */
|
|
19
|
+
percent: number;
|
|
20
|
+
};
|
|
21
|
+
/** What `Context` was given, plus the percent used. For a part of your own inside it. */
|
|
22
|
+
declare function useContextUsage(): ContextValue;
|
|
23
|
+
type ContextProps = Omit<UsageProps, "limit" | "value" | "segments"> & {
|
|
24
|
+
/** Tokens in the window now. */
|
|
25
|
+
usedTokens: number;
|
|
26
|
+
/** The size of the model's window. */
|
|
27
|
+
maxTokens: number;
|
|
28
|
+
/** The tokens of each kind, for the usage rows. */
|
|
29
|
+
usage?: ContextUsage;
|
|
30
|
+
/** Kept for the app's own parts; abby doesn't price a model. */
|
|
31
|
+
modelId?: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* The root: a Usage whose limit is the window. It opens when the pointer rests
|
|
35
|
+
* on the trigger, as shadcn's hover card does, and when the trigger is pressed,
|
|
36
|
+
* so keyboard, touch and agents open it too.
|
|
37
|
+
*
|
|
38
|
+
* `usedTokens` is the reading, not the sum of `usage`: the AI SDK counts
|
|
39
|
+
* reasoning inside output and cached tokens inside input.
|
|
40
|
+
*/
|
|
41
|
+
declare function Context({ usedTokens, maxTokens, usage, modelId, openOnHover, delay, closeDelay, ...props }: ContextProps): import("react").JSX.Element;
|
|
42
|
+
type ContextTriggerProps = UsageTriggerProps;
|
|
43
|
+
/**
|
|
44
|
+
* Usage's trigger, a `pill` by default: a small ring and "10.7K / 128K". Its
|
|
45
|
+
* name says the share in words: "Context: 10.7K / 128K, 8% used".
|
|
46
|
+
*/
|
|
47
|
+
declare function ContextTrigger({ variant, ...props }: ContextTriggerProps): import("react").JSX.Element;
|
|
48
|
+
type ContextContentProps = UsageContentProps;
|
|
49
|
+
/** The popover: the header, the body and the footer, one under the other. */
|
|
50
|
+
declare function ContextContent(props: ContextContentProps): import("react").JSX.Element;
|
|
51
|
+
type ContextContentHeaderProps = ComponentProps<"div"> & {
|
|
52
|
+
/** The heading over the numbers. Context's `label` by default. */
|
|
53
|
+
label?: ReactNode;
|
|
54
|
+
/** The bar's accessible name. "Context total" by default. */
|
|
55
|
+
progressLabel?: string;
|
|
56
|
+
};
|
|
57
|
+
/** Usage's summary: the used and max tokens over a bar. Children replace it whole. */
|
|
58
|
+
declare function ContextContentHeader({ className, children, label, progressLabel, ...props }: ContextContentHeaderProps): import("react").JSX.Element;
|
|
59
|
+
type ContextContentBodyProps = UsageSectionProps;
|
|
60
|
+
/** Holds the usage rows, under a rule. */
|
|
61
|
+
declare function ContextContentBody({ className, ...props }: ContextContentBodyProps): import("react").JSX.Element;
|
|
62
|
+
type ContextContentFooterProps = ComponentProps<"div"> & {
|
|
63
|
+
label?: ReactNode;
|
|
64
|
+
/** The total, already formatted: "$0.04". abby doesn't compute it. */
|
|
65
|
+
cost?: ReactNode;
|
|
66
|
+
};
|
|
67
|
+
/** The total cost, in Usage's footer band. It draws nothing with no `cost` and no children. */
|
|
68
|
+
declare function ContextContentFooter({ children, label, cost, ...props }: ContextContentFooterProps): import("react").JSX.Element | null;
|
|
69
|
+
type ContextUsageRowProps = ComponentProps<"div"> & {
|
|
70
|
+
label?: ReactNode;
|
|
71
|
+
/** What these tokens cost, already formatted: "$0.01". */
|
|
72
|
+
cost?: ReactNode;
|
|
73
|
+
};
|
|
74
|
+
/** The input tokens of `usage`. Children replace the row's contents. */
|
|
75
|
+
declare function ContextInputUsage({ label, ...props }: ContextUsageRowProps): import("react").JSX.Element;
|
|
76
|
+
/** The output tokens of `usage`. Children replace the row's contents. */
|
|
77
|
+
declare function ContextOutputUsage({ label, ...props }: ContextUsageRowProps): import("react").JSX.Element;
|
|
78
|
+
/** The reasoning tokens of `usage`. Children replace the row's contents. */
|
|
79
|
+
declare function ContextReasoningUsage({ label, ...props }: ContextUsageRowProps): import("react").JSX.Element;
|
|
80
|
+
/** The input tokens of `usage` read from the cache. Children replace the row's contents. */
|
|
81
|
+
declare function ContextCacheUsage({ label, ...props }: ContextUsageRowProps): import("react").JSX.Element;
|
|
82
|
+
export { Context, ContextCacheUsage, ContextContent, ContextContentBody, type ContextContentBodyProps, ContextContentFooter, type ContextContentFooterProps, ContextContentHeader, type ContextContentHeaderProps, type ContextContentProps, ContextInputUsage, ContextOutputUsage, type ContextProps, ContextReasoningUsage, ContextTrigger, type ContextTriggerProps, type ContextUsage, type ContextUsageRowProps, useContextUsage };
|