@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,79 @@
|
|
|
1
|
+
import { CodeBlockCopyButtonProps, CodeBlockProps } from "../code-block/code-block.js";
|
|
2
|
+
import { TraceCollapsibleContent, TraceCollapsibleProps, TraceCollapsibleTrigger } from "../trace/trace.js";
|
|
3
|
+
import { ParsedStackTrace, StackFrame, parseStackTrace } from "./parse-stack-trace.js";
|
|
4
|
+
import { ComponentProps, ReactNode } from "react";
|
|
5
|
+
type FilePathClick = (filePath: string, line?: number, column?: number) => void;
|
|
6
|
+
type StackTraceContextValue = {
|
|
7
|
+
/** The trace, parsed into its error and its frames. */
|
|
8
|
+
trace: ParsedStackTrace;
|
|
9
|
+
/** The trace as given. */
|
|
10
|
+
raw: string;
|
|
11
|
+
onFilePathClick: FilePathClick | undefined;
|
|
12
|
+
};
|
|
13
|
+
/** What `StackTrace` shares with its parts: the parsed trace. Call it inside a `StackTrace`. */
|
|
14
|
+
declare function useStackTrace(): StackTraceContextValue;
|
|
15
|
+
type StackTraceProps = Omit<TraceCollapsibleProps, "className" | "children"> & {
|
|
16
|
+
/** The raw stack trace, as `error.stack` gives it. */
|
|
17
|
+
trace: string;
|
|
18
|
+
/** Makes each frame's file path a button that calls this, to open the file at the line. */
|
|
19
|
+
onFilePathClick?: FilePathClick;
|
|
20
|
+
className?: string;
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A failure: a `StackTraceHeader` and a `StackTraceContent`. It parses `trace`
|
|
25
|
+
* into the error's type, its message and its frames, which the parts read. It
|
|
26
|
+
* takes Collapsible's props: `open`, `defaultOpen`, `onOpenChange`, `controller`.
|
|
27
|
+
*/
|
|
28
|
+
declare function StackTrace({ trace, onFilePathClick, className, children, ...props }: StackTraceProps): import("react").JSX.Element;
|
|
29
|
+
/** The row with the line and, next to it, what can't sit inside a button: the actions. */
|
|
30
|
+
declare function StackTraceHeader({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
31
|
+
type StackTraceErrorProps = Omit<ComponentProps<typeof TraceCollapsibleTrigger>, "children"> & {
|
|
32
|
+
/** Replaces the error icon. */
|
|
33
|
+
icon?: ReactNode;
|
|
34
|
+
/** The title. By default the error's type and message, "TypeError: …". */
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* The failed line, which opens the frames. Its title truncates, so show the
|
|
39
|
+
* whole error in the content too, as `StackTraceFrames` does.
|
|
40
|
+
*/
|
|
41
|
+
declare function StackTraceError({ icon, children, ...props }: StackTraceErrorProps): import("react").JSX.Element;
|
|
42
|
+
/** The error's type, "TypeError". It is empty when the trace names none. */
|
|
43
|
+
declare function StackTraceErrorType({ className, children, ...props }: ComponentProps<"span">): import("react").JSX.Element;
|
|
44
|
+
/** The error's message. */
|
|
45
|
+
declare function StackTraceErrorMessage({ children, ...props }: ComponentProps<"span">): import("react").JSX.Element;
|
|
46
|
+
/** The buttons next to the line. */
|
|
47
|
+
declare function StackTraceActions({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
48
|
+
type StackTraceCopyButtonProps = Omit<CodeBlockCopyButtonProps, "value">;
|
|
49
|
+
/**
|
|
50
|
+
* Copies the raw trace. Its name is `aria-label`, "Copy" by default: with
|
|
51
|
+
* several traces on a page, name the error in it.
|
|
52
|
+
*/
|
|
53
|
+
declare function StackTraceCopyButton(props: StackTraceCopyButtonProps): import("react").JSX.Element;
|
|
54
|
+
type StackTraceContentProps = ComponentProps<typeof TraceCollapsibleContent>;
|
|
55
|
+
/** What the line opens: `StackTraceFrames`, or your own layout of the frames from `useStackTrace`. */
|
|
56
|
+
declare function StackTraceContent(props: StackTraceContentProps): import("react").JSX.Element;
|
|
57
|
+
type StackTraceFramesProps = Omit<CodeBlockProps, "children"> & {
|
|
58
|
+
/** Show the frames from node_modules and from Node itself, dimmed. */
|
|
59
|
+
showInternalFrames?: boolean;
|
|
60
|
+
/** Start the block with the whole error, since the line's title truncates. */
|
|
61
|
+
showError?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* The name of the block, "Stack trace" by default. The block is a tab stop
|
|
64
|
+
* so the keyboard can scroll it: with several traces on a page, name the
|
|
65
|
+
* error in it.
|
|
66
|
+
*/
|
|
67
|
+
label?: string;
|
|
68
|
+
/** What the block says when it has nothing to show. */
|
|
69
|
+
emptyLabel?: ReactNode;
|
|
70
|
+
/** Goes on the block that scrolls, which is 16rem tall at most. */
|
|
71
|
+
className?: string;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* The frames in a Code Block, one per line, with the internal ones dimmed so
|
|
75
|
+
* your own stand out. With `onFilePathClick` on the `StackTrace`, each file
|
|
76
|
+
* path is a button.
|
|
77
|
+
*/
|
|
78
|
+
declare function StackTraceFrames({ showInternalFrames, showError, label, emptyLabel, className, ...props }: StackTraceFramesProps): import("react").JSX.Element;
|
|
79
|
+
export { type ParsedStackTrace, type StackFrame, StackTrace, StackTraceActions, StackTraceContent, type StackTraceContentProps, type StackTraceContextValue, StackTraceCopyButton, type StackTraceCopyButtonProps, StackTraceError, StackTraceErrorMessage, type StackTraceErrorProps, StackTraceErrorType, StackTraceFrames, type StackTraceFramesProps, StackTraceHeader, type StackTraceProps, parseStackTrace, useStackTrace };
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utilities/cn/index.js";
|
|
3
|
+
import { CodeBlock, CodeBlockContent, CodeBlockCopyButton, CodeBlockLine } from "../code-block/code-block.js";
|
|
4
|
+
import { Icon } from "../icon/icon.js";
|
|
5
|
+
import { Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceIcon, TraceLine, TraceTitle } from "../trace/trace.js";
|
|
6
|
+
import { parseStackTrace } from "./parse-stack-trace.js";
|
|
7
|
+
import { c } from "react/compiler-runtime";
|
|
8
|
+
import { createContext, useContext } from "react";
|
|
9
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Button } from "@ui-sdk/react/button";
|
|
11
|
+
import { CancelCircleIcon } from "@hugeicons/core-free-icons";
|
|
12
|
+
// src/components/stack-trace/stack-trace.tsx
|
|
13
|
+
const StackTraceContext = createContext(null);
|
|
14
|
+
/** What `StackTrace` shares with its parts: the parsed trace. Call it inside a `StackTrace`. */
|
|
15
|
+
function useStackTrace() {
|
|
16
|
+
const context = useContext(StackTraceContext);
|
|
17
|
+
if (!context) throw new Error("StackTrace's parts must be used within StackTrace.");
|
|
18
|
+
return context;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A failure: a `StackTraceHeader` and a `StackTraceContent`. It parses `trace`
|
|
22
|
+
* into the error's type, its message and its frames, which the parts read. It
|
|
23
|
+
* takes Collapsible's props: `open`, `defaultOpen`, `onOpenChange`, `controller`.
|
|
24
|
+
*/
|
|
25
|
+
function StackTrace({ trace, onFilePathClick, className, children = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(StackTraceHeader, { children: /* @__PURE__ */ jsx(StackTraceError, {}) }), /* @__PURE__ */ jsx(StackTraceContent, { children: /* @__PURE__ */ jsx(StackTraceFrames, {}) })] }), ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(StackTraceContext.Provider, {
|
|
27
|
+
value: {
|
|
28
|
+
trace: parseStackTrace(trace),
|
|
29
|
+
raw: trace,
|
|
30
|
+
onFilePathClick
|
|
31
|
+
},
|
|
32
|
+
children: /* @__PURE__ */ jsx(Trace, {
|
|
33
|
+
"data-slot": "stack-trace",
|
|
34
|
+
className,
|
|
35
|
+
children: /* @__PURE__ */ jsx(TraceCollapsible, {
|
|
36
|
+
...props,
|
|
37
|
+
children
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/** The row with the line and, next to it, what can't sit inside a button: the actions. */
|
|
43
|
+
function StackTraceHeader(t0) {
|
|
44
|
+
const $ = c(8);
|
|
45
|
+
let className;
|
|
46
|
+
let props;
|
|
47
|
+
if ($[0] !== t0) {
|
|
48
|
+
({className, ...props} = t0);
|
|
49
|
+
$[0] = t0;
|
|
50
|
+
$[1] = className;
|
|
51
|
+
$[2] = props;
|
|
52
|
+
} else {
|
|
53
|
+
className = $[1];
|
|
54
|
+
props = $[2];
|
|
55
|
+
}
|
|
56
|
+
let t1;
|
|
57
|
+
if ($[3] !== className) {
|
|
58
|
+
t1 = cn("flex min-w-0 items-center gap-2", className);
|
|
59
|
+
$[3] = className;
|
|
60
|
+
$[4] = t1;
|
|
61
|
+
} else t1 = $[4];
|
|
62
|
+
let t2;
|
|
63
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
64
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
65
|
+
"data-slot": "stack-trace-header",
|
|
66
|
+
className: t1,
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
69
|
+
$[5] = props;
|
|
70
|
+
$[6] = t1;
|
|
71
|
+
$[7] = t2;
|
|
72
|
+
} else t2 = $[7];
|
|
73
|
+
return t2;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The failed line, which opens the frames. Its title truncates, so show the
|
|
77
|
+
* whole error in the content too, as `StackTraceFrames` does.
|
|
78
|
+
*/
|
|
79
|
+
function StackTraceError(t0) {
|
|
80
|
+
const $ = c(19);
|
|
81
|
+
let children;
|
|
82
|
+
let icon;
|
|
83
|
+
let props;
|
|
84
|
+
if ($[0] !== t0) {
|
|
85
|
+
({icon, children, ...props} = t0);
|
|
86
|
+
$[0] = t0;
|
|
87
|
+
$[1] = children;
|
|
88
|
+
$[2] = icon;
|
|
89
|
+
$[3] = props;
|
|
90
|
+
} else {
|
|
91
|
+
children = $[1];
|
|
92
|
+
icon = $[2];
|
|
93
|
+
props = $[3];
|
|
94
|
+
}
|
|
95
|
+
const { trace } = useStackTrace();
|
|
96
|
+
let t1;
|
|
97
|
+
if ($[4] !== icon) {
|
|
98
|
+
t1 = icon ?? /* @__PURE__ */ jsx(Icon, { icon: CancelCircleIcon });
|
|
99
|
+
$[4] = icon;
|
|
100
|
+
$[5] = t1;
|
|
101
|
+
} else t1 = $[5];
|
|
102
|
+
let t2;
|
|
103
|
+
if ($[6] !== t1) {
|
|
104
|
+
t2 = /* @__PURE__ */ jsx(TraceIcon, { children: t1 });
|
|
105
|
+
$[6] = t1;
|
|
106
|
+
$[7] = t2;
|
|
107
|
+
} else t2 = $[7];
|
|
108
|
+
let t3;
|
|
109
|
+
if ($[8] !== children || $[9] !== trace) {
|
|
110
|
+
t3 = children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [trace.errorType !== null && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
111
|
+
/* @__PURE__ */ jsx(StackTraceErrorType, {}),
|
|
112
|
+
":",
|
|
113
|
+
" "
|
|
114
|
+
] }), /* @__PURE__ */ jsx(StackTraceErrorMessage, {})] });
|
|
115
|
+
$[8] = children;
|
|
116
|
+
$[9] = trace;
|
|
117
|
+
$[10] = t3;
|
|
118
|
+
} else t3 = $[10];
|
|
119
|
+
let t4;
|
|
120
|
+
if ($[11] !== t3) {
|
|
121
|
+
t4 = /* @__PURE__ */ jsx(TraceTitle, { children: t3 });
|
|
122
|
+
$[11] = t3;
|
|
123
|
+
$[12] = t4;
|
|
124
|
+
} else t4 = $[12];
|
|
125
|
+
let t5;
|
|
126
|
+
if ($[13] !== t2 || $[14] !== t4) {
|
|
127
|
+
t5 = /* @__PURE__ */ jsxs(TraceLine, {
|
|
128
|
+
status: "error",
|
|
129
|
+
children: [t2, t4]
|
|
130
|
+
});
|
|
131
|
+
$[13] = t2;
|
|
132
|
+
$[14] = t4;
|
|
133
|
+
$[15] = t5;
|
|
134
|
+
} else t5 = $[15];
|
|
135
|
+
let t6;
|
|
136
|
+
if ($[16] !== props || $[17] !== t5) {
|
|
137
|
+
t6 = /* @__PURE__ */ jsx(TraceCollapsibleTrigger, {
|
|
138
|
+
"data-slot": "stack-trace-error",
|
|
139
|
+
...props,
|
|
140
|
+
children: t5
|
|
141
|
+
});
|
|
142
|
+
$[16] = props;
|
|
143
|
+
$[17] = t5;
|
|
144
|
+
$[18] = t6;
|
|
145
|
+
} else t6 = $[18];
|
|
146
|
+
return t6;
|
|
147
|
+
}
|
|
148
|
+
/** The error's type, "TypeError". It is empty when the trace names none. */
|
|
149
|
+
function StackTraceErrorType(t0) {
|
|
150
|
+
const $ = c(10);
|
|
151
|
+
let children;
|
|
152
|
+
let className;
|
|
153
|
+
let props;
|
|
154
|
+
if ($[0] !== t0) {
|
|
155
|
+
({className, children, ...props} = t0);
|
|
156
|
+
$[0] = t0;
|
|
157
|
+
$[1] = children;
|
|
158
|
+
$[2] = className;
|
|
159
|
+
$[3] = props;
|
|
160
|
+
} else {
|
|
161
|
+
children = $[1];
|
|
162
|
+
className = $[2];
|
|
163
|
+
props = $[3];
|
|
164
|
+
}
|
|
165
|
+
const { trace } = useStackTrace();
|
|
166
|
+
let t1;
|
|
167
|
+
if ($[4] !== className) {
|
|
168
|
+
t1 = cn("font-medium", className);
|
|
169
|
+
$[4] = className;
|
|
170
|
+
$[5] = t1;
|
|
171
|
+
} else t1 = $[5];
|
|
172
|
+
const t2 = children ?? trace.errorType;
|
|
173
|
+
let t3;
|
|
174
|
+
if ($[6] !== props || $[7] !== t1 || $[8] !== t2) {
|
|
175
|
+
t3 = /* @__PURE__ */ jsx("span", {
|
|
176
|
+
"data-slot": "stack-trace-error-type",
|
|
177
|
+
className: t1,
|
|
178
|
+
...props,
|
|
179
|
+
children: t2
|
|
180
|
+
});
|
|
181
|
+
$[6] = props;
|
|
182
|
+
$[7] = t1;
|
|
183
|
+
$[8] = t2;
|
|
184
|
+
$[9] = t3;
|
|
185
|
+
} else t3 = $[9];
|
|
186
|
+
return t3;
|
|
187
|
+
}
|
|
188
|
+
/** The error's message. */
|
|
189
|
+
function StackTraceErrorMessage(t0) {
|
|
190
|
+
const $ = c(6);
|
|
191
|
+
let children;
|
|
192
|
+
let props;
|
|
193
|
+
if ($[0] !== t0) {
|
|
194
|
+
({children, ...props} = t0);
|
|
195
|
+
$[0] = t0;
|
|
196
|
+
$[1] = children;
|
|
197
|
+
$[2] = props;
|
|
198
|
+
} else {
|
|
199
|
+
children = $[1];
|
|
200
|
+
props = $[2];
|
|
201
|
+
}
|
|
202
|
+
const { trace } = useStackTrace();
|
|
203
|
+
const t1 = children ?? trace.errorMessage;
|
|
204
|
+
let t2;
|
|
205
|
+
if ($[3] !== props || $[4] !== t1) {
|
|
206
|
+
t2 = /* @__PURE__ */ jsx("span", {
|
|
207
|
+
"data-slot": "stack-trace-error-message",
|
|
208
|
+
...props,
|
|
209
|
+
children: t1
|
|
210
|
+
});
|
|
211
|
+
$[3] = props;
|
|
212
|
+
$[4] = t1;
|
|
213
|
+
$[5] = t2;
|
|
214
|
+
} else t2 = $[5];
|
|
215
|
+
return t2;
|
|
216
|
+
}
|
|
217
|
+
/** The buttons next to the line. */
|
|
218
|
+
function StackTraceActions(t0) {
|
|
219
|
+
const $ = c(8);
|
|
220
|
+
let className;
|
|
221
|
+
let props;
|
|
222
|
+
if ($[0] !== t0) {
|
|
223
|
+
({className, ...props} = t0);
|
|
224
|
+
$[0] = t0;
|
|
225
|
+
$[1] = className;
|
|
226
|
+
$[2] = props;
|
|
227
|
+
} else {
|
|
228
|
+
className = $[1];
|
|
229
|
+
props = $[2];
|
|
230
|
+
}
|
|
231
|
+
let t1;
|
|
232
|
+
if ($[3] !== className) {
|
|
233
|
+
t1 = cn("flex shrink-0 items-center gap-1", className);
|
|
234
|
+
$[3] = className;
|
|
235
|
+
$[4] = t1;
|
|
236
|
+
} else t1 = $[4];
|
|
237
|
+
let t2;
|
|
238
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
239
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
240
|
+
"data-slot": "stack-trace-actions",
|
|
241
|
+
className: t1,
|
|
242
|
+
...props
|
|
243
|
+
});
|
|
244
|
+
$[5] = props;
|
|
245
|
+
$[6] = t1;
|
|
246
|
+
$[7] = t2;
|
|
247
|
+
} else t2 = $[7];
|
|
248
|
+
return t2;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Copies the raw trace. Its name is `aria-label`, "Copy" by default: with
|
|
252
|
+
* several traces on a page, name the error in it.
|
|
253
|
+
*/
|
|
254
|
+
function StackTraceCopyButton(props) {
|
|
255
|
+
const $ = c(3);
|
|
256
|
+
const { raw } = useStackTrace();
|
|
257
|
+
let t0;
|
|
258
|
+
if ($[0] !== props || $[1] !== raw) {
|
|
259
|
+
t0 = /* @__PURE__ */ jsx(CodeBlockCopyButton, {
|
|
260
|
+
value: raw,
|
|
261
|
+
...props
|
|
262
|
+
});
|
|
263
|
+
$[0] = props;
|
|
264
|
+
$[1] = raw;
|
|
265
|
+
$[2] = t0;
|
|
266
|
+
} else t0 = $[2];
|
|
267
|
+
return t0;
|
|
268
|
+
}
|
|
269
|
+
/** What the line opens: `StackTraceFrames`, or your own layout of the frames from `useStackTrace`. */
|
|
270
|
+
function StackTraceContent(props) {
|
|
271
|
+
const $ = c(2);
|
|
272
|
+
let t0;
|
|
273
|
+
if ($[0] !== props) {
|
|
274
|
+
t0 = /* @__PURE__ */ jsx(TraceCollapsibleContent, {
|
|
275
|
+
"data-slot": "stack-trace-content",
|
|
276
|
+
...props
|
|
277
|
+
});
|
|
278
|
+
$[0] = props;
|
|
279
|
+
$[1] = t0;
|
|
280
|
+
} else t0 = $[1];
|
|
281
|
+
return t0;
|
|
282
|
+
}
|
|
283
|
+
function filePosition({ filePath, lineNumber, columnNumber }) {
|
|
284
|
+
return [
|
|
285
|
+
filePath,
|
|
286
|
+
lineNumber,
|
|
287
|
+
columnNumber
|
|
288
|
+
].filter((part) => part !== null).join(":");
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* The frames in a Code Block, one per line, with the internal ones dimmed so
|
|
292
|
+
* your own stand out. With `onFilePathClick` on the `StackTrace`, each file
|
|
293
|
+
* path is a button.
|
|
294
|
+
*/
|
|
295
|
+
function StackTraceFrames(t0) {
|
|
296
|
+
const $ = c(36);
|
|
297
|
+
let className;
|
|
298
|
+
let props;
|
|
299
|
+
let t1;
|
|
300
|
+
let t2;
|
|
301
|
+
let t3;
|
|
302
|
+
let t4;
|
|
303
|
+
if ($[0] !== t0) {
|
|
304
|
+
({showInternalFrames: t1, showError: t2, label: t3, emptyLabel: t4, className, ...props} = t0);
|
|
305
|
+
$[0] = t0;
|
|
306
|
+
$[1] = className;
|
|
307
|
+
$[2] = props;
|
|
308
|
+
$[3] = t1;
|
|
309
|
+
$[4] = t2;
|
|
310
|
+
$[5] = t3;
|
|
311
|
+
$[6] = t4;
|
|
312
|
+
} else {
|
|
313
|
+
className = $[1];
|
|
314
|
+
props = $[2];
|
|
315
|
+
t1 = $[3];
|
|
316
|
+
t2 = $[4];
|
|
317
|
+
t3 = $[5];
|
|
318
|
+
t4 = $[6];
|
|
319
|
+
}
|
|
320
|
+
const showInternalFrames = t1 === void 0 ? true : t1;
|
|
321
|
+
const showError = t2 === void 0 ? true : t2;
|
|
322
|
+
const label = t3 === void 0 ? "Stack trace" : t3;
|
|
323
|
+
const emptyLabel = t4 === void 0 ? "No stack frames" : t4;
|
|
324
|
+
const { trace, onFilePathClick } = useStackTrace();
|
|
325
|
+
let t5;
|
|
326
|
+
if ($[7] !== showInternalFrames || $[8] !== trace.frames) {
|
|
327
|
+
t5 = showInternalFrames ? trace.frames : trace.frames.filter(_temp);
|
|
328
|
+
$[7] = showInternalFrames;
|
|
329
|
+
$[8] = trace.frames;
|
|
330
|
+
$[9] = t5;
|
|
331
|
+
} else t5 = $[9];
|
|
332
|
+
const frames = t5;
|
|
333
|
+
let t6;
|
|
334
|
+
if ($[10] !== trace.errorMessage || $[11] !== trace.errorType) {
|
|
335
|
+
t6 = [trace.errorType, trace.errorMessage].filter(Boolean);
|
|
336
|
+
$[10] = trace.errorMessage;
|
|
337
|
+
$[11] = trace.errorType;
|
|
338
|
+
$[12] = t6;
|
|
339
|
+
} else t6 = $[12];
|
|
340
|
+
const error = t6.join(": ");
|
|
341
|
+
const hasError = showError && error.length > 0;
|
|
342
|
+
let t7;
|
|
343
|
+
if ($[13] !== className) {
|
|
344
|
+
t7 = cn("max-h-64", className);
|
|
345
|
+
$[13] = className;
|
|
346
|
+
$[14] = t7;
|
|
347
|
+
} else t7 = $[14];
|
|
348
|
+
let t8;
|
|
349
|
+
if ($[15] !== error || $[16] !== hasError) {
|
|
350
|
+
t8 = hasError && /* @__PURE__ */ jsx(CodeBlockLine, {
|
|
351
|
+
className: "text-destructive",
|
|
352
|
+
children: error
|
|
353
|
+
});
|
|
354
|
+
$[15] = error;
|
|
355
|
+
$[16] = hasError;
|
|
356
|
+
$[17] = t8;
|
|
357
|
+
} else t8 = $[17];
|
|
358
|
+
let t9;
|
|
359
|
+
if ($[18] !== frames || $[19] !== onFilePathClick) {
|
|
360
|
+
let t10;
|
|
361
|
+
if ($[21] !== onFilePathClick) {
|
|
362
|
+
t10 = (frame_0, index) => {
|
|
363
|
+
const { filePath, functionName } = frame_0;
|
|
364
|
+
return /* @__PURE__ */ jsx(CodeBlockLine, {
|
|
365
|
+
"data-internal": frame_0.isInternal || void 0,
|
|
366
|
+
className: frame_0.isInternal ? "text-muted-foreground" : void 0,
|
|
367
|
+
children: onFilePathClick && filePath !== null ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
368
|
+
"at ",
|
|
369
|
+
functionName !== null && `${functionName} (`,
|
|
370
|
+
/* @__PURE__ */ jsx(Button, {
|
|
371
|
+
"data-slot": "stack-trace-file-path",
|
|
372
|
+
className: "cursor-pointer rounded-xs text-start underline decoration-dotted underline-offset-2 focus-ring hover:text-foreground",
|
|
373
|
+
onClick: () => onFilePathClick(filePath, frame_0.lineNumber ?? void 0, frame_0.columnNumber ?? void 0),
|
|
374
|
+
children: filePosition(frame_0)
|
|
375
|
+
}),
|
|
376
|
+
functionName !== null && ")"
|
|
377
|
+
] }) : frame_0.raw
|
|
378
|
+
}, index);
|
|
379
|
+
};
|
|
380
|
+
$[21] = onFilePathClick;
|
|
381
|
+
$[22] = t10;
|
|
382
|
+
} else t10 = $[22];
|
|
383
|
+
t9 = frames.map(t10);
|
|
384
|
+
$[18] = frames;
|
|
385
|
+
$[19] = onFilePathClick;
|
|
386
|
+
$[20] = t9;
|
|
387
|
+
} else t9 = $[20];
|
|
388
|
+
let t10;
|
|
389
|
+
if ($[23] !== emptyLabel || $[24] !== frames.length || $[25] !== hasError) {
|
|
390
|
+
t10 = !hasError && frames.length === 0 && /* @__PURE__ */ jsx(CodeBlockLine, {
|
|
391
|
+
className: "text-muted-foreground",
|
|
392
|
+
children: emptyLabel
|
|
393
|
+
});
|
|
394
|
+
$[23] = emptyLabel;
|
|
395
|
+
$[24] = frames.length;
|
|
396
|
+
$[25] = hasError;
|
|
397
|
+
$[26] = t10;
|
|
398
|
+
} else t10 = $[26];
|
|
399
|
+
let t11;
|
|
400
|
+
if ($[27] !== label || $[28] !== t10 || $[29] !== t7 || $[30] !== t8 || $[31] !== t9) {
|
|
401
|
+
t11 = /* @__PURE__ */ jsxs(CodeBlockContent, {
|
|
402
|
+
wrap: true,
|
|
403
|
+
"aria-label": label,
|
|
404
|
+
className: t7,
|
|
405
|
+
children: [
|
|
406
|
+
t8,
|
|
407
|
+
t9,
|
|
408
|
+
t10
|
|
409
|
+
]
|
|
410
|
+
});
|
|
411
|
+
$[27] = label;
|
|
412
|
+
$[28] = t10;
|
|
413
|
+
$[29] = t7;
|
|
414
|
+
$[30] = t8;
|
|
415
|
+
$[31] = t9;
|
|
416
|
+
$[32] = t11;
|
|
417
|
+
} else t11 = $[32];
|
|
418
|
+
let t12;
|
|
419
|
+
if ($[33] !== props || $[34] !== t11) {
|
|
420
|
+
t12 = /* @__PURE__ */ jsx(CodeBlock, {
|
|
421
|
+
size: "sm",
|
|
422
|
+
...props,
|
|
423
|
+
children: t11
|
|
424
|
+
});
|
|
425
|
+
$[33] = props;
|
|
426
|
+
$[34] = t11;
|
|
427
|
+
$[35] = t12;
|
|
428
|
+
} else t12 = $[35];
|
|
429
|
+
return t12;
|
|
430
|
+
}
|
|
431
|
+
function _temp(frame) {
|
|
432
|
+
return !frame.isInternal;
|
|
433
|
+
}
|
|
434
|
+
export { StackTrace, StackTraceActions, StackTraceContent, StackTraceCopyButton, StackTraceError, StackTraceErrorMessage, StackTraceErrorType, StackTraceFrames, StackTraceHeader, parseStackTrace, useStackTrace };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { CodeBlockProps } from "../code-block/code-block.js";
|
|
2
|
+
import { ToolHeaderProps, ToolProps } from "../tool/tool.js";
|
|
3
|
+
import { Trace, TraceCollapsibleContent, TraceCollapsibleProps, TraceCollapsibleTrigger } from "../trace/trace.js";
|
|
4
|
+
import { ComponentProps, ReactNode } from "react";
|
|
5
|
+
/** Where a run is. Leave it out once the run is done. */
|
|
6
|
+
type SubagentStatus = "running" | "error";
|
|
7
|
+
type SubagentProps = Omit<TraceCollapsibleProps, "className" | "children"> & {
|
|
8
|
+
/**
|
|
9
|
+
* Set it to `false` until the subagent makes its first call: with nothing to
|
|
10
|
+
* open, the line is plain text instead of a button, and `SubagentContent` draws nothing.
|
|
11
|
+
*/
|
|
12
|
+
collapsible?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A subagent's run: a `SubagentHeader` and a `SubagentContent`. It takes
|
|
18
|
+
* Collapsible's props. Put it in a `Trace` next to the turn's other lines.
|
|
19
|
+
*/
|
|
20
|
+
declare function Subagent({ collapsible, className, children, ...props }: SubagentProps): import("react").JSX.Element;
|
|
21
|
+
type SubagentHeaderProps = Omit<ComponentProps<typeof TraceCollapsibleTrigger>, "name"> & {
|
|
22
|
+
/** The line's title, in the tense of the run: "Running the research agent", "Ran the research agent". */
|
|
23
|
+
name: ReactNode;
|
|
24
|
+
/** The model that ran it, in a Badge next to the line. */
|
|
25
|
+
model?: ReactNode;
|
|
26
|
+
/** `running` shimmers the title, `error` turns the line destructive. */
|
|
27
|
+
status?: SubagentStatus;
|
|
28
|
+
/** What follows the title, like how long the run took. */
|
|
29
|
+
description?: ReactNode;
|
|
30
|
+
/** Replaces the icon the header draws for the status. */
|
|
31
|
+
icon?: ReactNode;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* The run's line. Children replace the icon, the title and the description,
|
|
35
|
+
* inside the `TraceLine`. While the run has nothing to open, a running title
|
|
36
|
+
* is announced; once it opens, the calls inside announce the wait.
|
|
37
|
+
*/
|
|
38
|
+
declare function SubagentHeader({ name, model, status, description, icon, children, ...props }: SubagentHeaderProps): import("react").JSX.Element;
|
|
39
|
+
type SubagentContentProps = ComponentProps<typeof TraceCollapsibleContent>;
|
|
40
|
+
/**
|
|
41
|
+
* What the run opens into. It stays mounted while closed, so a call the person
|
|
42
|
+
* opened is still open when the run opens again.
|
|
43
|
+
*/
|
|
44
|
+
declare function SubagentContent({ className, ...props }: SubagentContentProps): import("react").JSX.Element | null;
|
|
45
|
+
type SubagentInstructionsProps = ComponentProps<"div"> & {
|
|
46
|
+
/** The heading over the text. Pass `null` to leave it out. */
|
|
47
|
+
label?: ReactNode;
|
|
48
|
+
};
|
|
49
|
+
/** The task the subagent was given. */
|
|
50
|
+
declare function SubagentInstructions({ label, className, children, ...props }: SubagentInstructionsProps): import("react").JSX.Element;
|
|
51
|
+
type SubagentToolsProps = ComponentProps<typeof Trace>;
|
|
52
|
+
/** The calls the subagent made, as a Trace of `SubagentTool`. */
|
|
53
|
+
declare function SubagentTools(props: SubagentToolsProps): import("react").JSX.Element;
|
|
54
|
+
type SubagentToolProps = Pick<ToolHeaderProps, "state" | "type" | "toolName" | "title" | "icon" | "getTitle"> & Pick<ToolProps, "open" | "defaultOpen" | "onOpenChange" | "controller"> & {
|
|
55
|
+
/** The call's detail, like a `ToolOutput`. With it the line opens; with none, it is a plain line. */
|
|
56
|
+
children?: ReactNode;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* One call the subagent made: a `Tool` whose icon follows its state. For more
|
|
60
|
+
* control, put a `Tool` in `SubagentTools` instead.
|
|
61
|
+
*/
|
|
62
|
+
declare function SubagentTool({ state, type, toolName, title, icon, getTitle, children, ...props }: SubagentToolProps): import("react").JSX.Element;
|
|
63
|
+
type SubagentOutputProps = Omit<CodeBlockProps, "children"> & {
|
|
64
|
+
/** The schema of what the subagent returns, as text. */
|
|
65
|
+
schema: string;
|
|
66
|
+
/** The block's title, and the accessible name of its code. */
|
|
67
|
+
label?: string;
|
|
68
|
+
};
|
|
69
|
+
/** The schema of the subagent's output, in a small code block. */
|
|
70
|
+
declare function SubagentOutput({ schema, label, size, ...props }: SubagentOutputProps): import("react").JSX.Element;
|
|
71
|
+
export { Subagent, SubagentContent, type SubagentContentProps, SubagentHeader, type SubagentHeaderProps, SubagentInstructions, type SubagentInstructionsProps, SubagentOutput, type SubagentOutputProps, type SubagentProps, type SubagentStatus, SubagentTool, type SubagentToolProps, SubagentTools, type SubagentToolsProps };
|