@adea-ai/ui 0.140.0 → 0.142.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/dist/components/composites/appearance-editor/appearance-editor.js +2 -2
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.js +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts +56 -0
- package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts.map +1 -0
- package/dist/components/composites/chain-of-thought/chain-of-thought.js +117 -0
- package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -0
- package/dist/components/composites/chain-of-thought/index.d.ts +2 -0
- package/dist/components/composites/chain-of-thought/index.d.ts.map +1 -0
- package/dist/components/composites/chain-of-thought/index.js +2 -0
- package/dist/components/composites/chat/chat.d.ts +67 -0
- package/dist/components/composites/chat/chat.d.ts.map +1 -0
- package/dist/components/composites/chat/chat.js +179 -0
- package/dist/components/composites/chat/chat.js.map +1 -0
- package/dist/components/composites/chat/index.d.ts +2 -0
- package/dist/components/composites/chat/index.d.ts.map +1 -0
- package/dist/components/composites/chat/index.js +2 -0
- package/dist/components/composites/checkpoint/checkpoint-model.d.ts +34 -0
- package/dist/components/composites/checkpoint/checkpoint-model.d.ts.map +1 -0
- package/dist/components/composites/checkpoint/checkpoint-model.js +48 -0
- package/dist/components/composites/checkpoint/checkpoint-model.js.map +1 -0
- package/dist/components/composites/checkpoint/checkpoint.d.ts +48 -0
- package/dist/components/composites/checkpoint/checkpoint.d.ts.map +1 -0
- package/dist/components/composites/checkpoint/checkpoint.js +160 -0
- package/dist/components/composites/checkpoint/checkpoint.js.map +1 -0
- package/dist/components/composites/checkpoint/index.d.ts +3 -0
- package/dist/components/composites/checkpoint/index.d.ts.map +1 -0
- package/dist/components/composites/checkpoint/index.js +3 -0
- package/dist/components/composites/confirmation/confirmation-model.d.ts +45 -0
- package/dist/components/composites/confirmation/confirmation-model.d.ts.map +1 -0
- package/dist/components/composites/confirmation/confirmation-model.js +51 -0
- package/dist/components/composites/confirmation/confirmation-model.js.map +1 -0
- package/dist/components/composites/confirmation/confirmation.d.ts +72 -0
- package/dist/components/composites/confirmation/confirmation.d.ts.map +1 -0
- package/dist/components/composites/confirmation/confirmation.js +300 -0
- package/dist/components/composites/confirmation/confirmation.js.map +1 -0
- package/dist/components/composites/confirmation/index.d.ts +3 -0
- package/dist/components/composites/confirmation/index.d.ts.map +1 -0
- package/dist/components/composites/confirmation/index.js +3 -0
- package/dist/components/composites/context/context-model.d.ts +69 -0
- package/dist/components/composites/context/context-model.d.ts.map +1 -0
- package/dist/components/composites/context/context-model.js +122 -0
- package/dist/components/composites/context/context-model.js.map +1 -0
- package/dist/components/composites/context/context.d.ts +38 -0
- package/dist/components/composites/context/context.d.ts.map +1 -0
- package/dist/components/composites/context/context.js +234 -0
- package/dist/components/composites/context/context.js.map +1 -0
- package/dist/components/composites/context/index.d.ts +3 -0
- package/dist/components/composites/context/index.d.ts.map +1 -0
- package/dist/components/composites/context/index.js +3 -0
- package/dist/components/composites/file-tree/build-file-tree.d.ts +138 -0
- package/dist/components/composites/file-tree/build-file-tree.d.ts.map +1 -0
- package/dist/components/composites/file-tree/build-file-tree.js +325 -0
- package/dist/components/composites/file-tree/build-file-tree.js.map +1 -0
- package/dist/components/composites/file-tree/file-tree.d.ts +74 -0
- package/dist/components/composites/file-tree/file-tree.d.ts.map +1 -0
- package/dist/components/composites/file-tree/file-tree.js +389 -0
- package/dist/components/composites/file-tree/file-tree.js.map +1 -0
- package/dist/components/composites/file-tree/index.d.ts +3 -0
- package/dist/components/composites/file-tree/index.d.ts.map +1 -0
- package/dist/components/composites/file-tree/index.js +3 -0
- package/dist/components/composites/inline-citation/citation.d.ts +37 -0
- package/dist/components/composites/inline-citation/citation.d.ts.map +1 -0
- package/dist/components/composites/inline-citation/citation.js +52 -0
- package/dist/components/composites/inline-citation/citation.js.map +1 -0
- package/dist/components/composites/inline-citation/index.d.ts +3 -0
- package/dist/components/composites/inline-citation/index.d.ts.map +1 -0
- package/dist/components/composites/inline-citation/index.js +3 -0
- package/dist/components/composites/inline-citation/inline-citation.d.ts +64 -0
- package/dist/components/composites/inline-citation/inline-citation.d.ts.map +1 -0
- package/dist/components/composites/inline-citation/inline-citation.js +272 -0
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -0
- package/dist/components/composites/message-scroller/index.d.ts +3 -0
- package/dist/components/composites/message-scroller/index.d.ts.map +1 -0
- package/dist/components/composites/message-scroller/index.js +3 -0
- package/dist/components/composites/message-scroller/message-scroller.d.ts +55 -0
- package/dist/components/composites/message-scroller/message-scroller.d.ts.map +1 -0
- package/dist/components/composites/message-scroller/message-scroller.js +201 -0
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -0
- package/dist/components/composites/message-scroller/scroll-anchor.d.ts +66 -0
- package/dist/components/composites/message-scroller/scroll-anchor.d.ts.map +1 -0
- package/dist/components/composites/message-scroller/scroll-anchor.js +122 -0
- package/dist/components/composites/message-scroller/scroll-anchor.js.map +1 -0
- package/dist/components/composites/model-selector/index.d.ts +3 -0
- package/dist/components/composites/model-selector/index.d.ts.map +1 -0
- package/dist/components/composites/model-selector/index.js +3 -0
- package/dist/components/composites/model-selector/model-selector.d.ts +55 -0
- package/dist/components/composites/model-selector/model-selector.d.ts.map +1 -0
- package/dist/components/composites/model-selector/model-selector.js +490 -0
- package/dist/components/composites/model-selector/model-selector.js.map +1 -0
- package/dist/components/composites/model-selector/models.d.ts +51 -0
- package/dist/components/composites/model-selector/models.d.ts.map +1 -0
- package/dist/components/composites/model-selector/models.js +71 -0
- package/dist/components/composites/model-selector/models.js.map +1 -0
- package/dist/components/composites/plan/index.d.ts +2 -0
- package/dist/components/composites/plan/index.d.ts.map +1 -0
- package/dist/components/composites/plan/index.js +2 -0
- package/dist/components/composites/plan/plan.d.ts +61 -0
- package/dist/components/composites/plan/plan.d.ts.map +1 -0
- package/dist/components/composites/plan/plan.js +130 -0
- package/dist/components/composites/plan/plan.js.map +1 -0
- package/dist/components/composites/queue/index.d.ts +2 -0
- package/dist/components/composites/queue/index.d.ts.map +1 -0
- package/dist/components/composites/queue/index.js +2 -0
- package/dist/components/composites/queue/queue.d.ts +77 -0
- package/dist/components/composites/queue/queue.d.ts.map +1 -0
- package/dist/components/composites/queue/queue.js +271 -0
- package/dist/components/composites/queue/queue.js.map +1 -0
- package/dist/components/composites/reasoning/index.d.ts +2 -0
- package/dist/components/composites/reasoning/index.d.ts.map +1 -0
- package/dist/components/composites/reasoning/index.js +2 -0
- package/dist/components/composites/reasoning/reasoning.d.ts +62 -0
- package/dist/components/composites/reasoning/reasoning.d.ts.map +1 -0
- package/dist/components/composites/reasoning/reasoning.js +156 -0
- package/dist/components/composites/reasoning/reasoning.js.map +1 -0
- package/dist/components/composites/sources/index.d.ts +3 -0
- package/dist/components/composites/sources/index.d.ts.map +1 -0
- package/dist/components/composites/sources/index.js +3 -0
- package/dist/components/composites/sources/source.d.ts +46 -0
- package/dist/components/composites/sources/source.d.ts.map +1 -0
- package/dist/components/composites/sources/source.js +74 -0
- package/dist/components/composites/sources/source.js.map +1 -0
- package/dist/components/composites/sources/sources.d.ts +45 -0
- package/dist/components/composites/sources/sources.d.ts.map +1 -0
- package/dist/components/composites/sources/sources.js +175 -0
- package/dist/components/composites/sources/sources.js.map +1 -0
- package/dist/components/composites/stack-trace/index.d.ts +3 -0
- package/dist/components/composites/stack-trace/index.d.ts.map +1 -0
- package/dist/components/composites/stack-trace/index.js +3 -0
- package/dist/components/composites/stack-trace/parse-stack-trace.d.ts +118 -0
- package/dist/components/composites/stack-trace/parse-stack-trace.d.ts.map +1 -0
- package/dist/components/composites/stack-trace/parse-stack-trace.js +376 -0
- package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -0
- package/dist/components/composites/stack-trace/stack-trace.d.ts +63 -0
- package/dist/components/composites/stack-trace/stack-trace.d.ts.map +1 -0
- package/dist/components/composites/stack-trace/stack-trace.js +491 -0
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -0
- package/dist/components/composites/subagent/index.d.ts +2 -0
- package/dist/components/composites/subagent/index.d.ts.map +1 -0
- package/dist/components/composites/subagent/index.js +2 -0
- package/dist/components/composites/subagent/subagent.d.ts +55 -0
- package/dist/components/composites/subagent/subagent.d.ts.map +1 -0
- package/dist/components/composites/subagent/subagent.js +138 -0
- package/dist/components/composites/subagent/subagent.js.map +1 -0
- package/dist/components/composites/suggestion/index.d.ts +2 -0
- package/dist/components/composites/suggestion/index.d.ts.map +1 -0
- package/dist/components/composites/suggestion/index.js +2 -0
- package/dist/components/composites/suggestion/suggestion.d.ts +37 -0
- package/dist/components/composites/suggestion/suggestion.d.ts.map +1 -0
- package/dist/components/composites/suggestion/suggestion.js +100 -0
- package/dist/components/composites/suggestion/suggestion.js.map +1 -0
- package/dist/components/composites/task/index.d.ts +2 -0
- package/dist/components/composites/task/index.d.ts.map +1 -0
- package/dist/components/composites/task/index.js +2 -0
- package/dist/components/composites/task/task.d.ts +96 -0
- package/dist/components/composites/task/task.d.ts.map +1 -0
- package/dist/components/composites/task/task.js +311 -0
- package/dist/components/composites/task/task.js.map +1 -0
- package/dist/components/composites/terminal/ansi.d.ts +101 -0
- package/dist/components/composites/terminal/ansi.d.ts.map +1 -0
- package/dist/components/composites/terminal/ansi.js +544 -0
- package/dist/components/composites/terminal/ansi.js.map +1 -0
- package/dist/components/composites/terminal/index.d.ts +4 -0
- package/dist/components/composites/terminal/index.d.ts.map +1 -0
- package/dist/components/composites/terminal/index.js +4 -0
- package/dist/components/composites/terminal/terminal-model.d.ts +63 -0
- package/dist/components/composites/terminal/terminal-model.d.ts.map +1 -0
- package/dist/components/composites/terminal/terminal-model.js +69 -0
- package/dist/components/composites/terminal/terminal-model.js.map +1 -0
- package/dist/components/composites/terminal/terminal.d.ts +88 -0
- package/dist/components/composites/terminal/terminal.d.ts.map +1 -0
- package/dist/components/composites/terminal/terminal.js +500 -0
- package/dist/components/composites/terminal/terminal.js.map +1 -0
- package/dist/components/composites/test-results/index.d.ts +3 -0
- package/dist/components/composites/test-results/index.d.ts.map +1 -0
- package/dist/components/composites/test-results/index.js +3 -0
- package/dist/components/composites/test-results/test-results-model.d.ts +154 -0
- package/dist/components/composites/test-results/test-results-model.d.ts.map +1 -0
- package/dist/components/composites/test-results/test-results-model.js +252 -0
- package/dist/components/composites/test-results/test-results-model.js.map +1 -0
- package/dist/components/composites/test-results/test-results.d.ts +60 -0
- package/dist/components/composites/test-results/test-results.d.ts.map +1 -0
- package/dist/components/composites/test-results/test-results.js +631 -0
- package/dist/components/composites/test-results/test-results.js.map +1 -0
- package/dist/components/composites/tool/format-tool-value.d.ts +37 -0
- package/dist/components/composites/tool/format-tool-value.d.ts.map +1 -0
- package/dist/components/composites/tool/format-tool-value.js +135 -0
- package/dist/components/composites/tool/format-tool-value.js.map +1 -0
- package/dist/components/composites/tool/index.d.ts +3 -0
- package/dist/components/composites/tool/index.d.ts.map +1 -0
- package/dist/components/composites/tool/index.js +3 -0
- package/dist/components/composites/tool/tool.d.ts +69 -0
- package/dist/components/composites/tool/tool.d.ts.map +1 -0
- package/dist/components/composites/tool/tool.js +214 -0
- package/dist/components/composites/tool/tool.js.map +1 -0
- package/dist/components/composites/update-dialog/update-dialog.js +1 -1
- package/dist/components/conversation/conversation-surface.d.ts +7 -0
- package/dist/components/conversation/conversation-surface.d.ts.map +1 -1
- package/dist/components/conversation/conversation-surface.js +2 -0
- package/dist/components/conversation/conversation-surface.js.map +1 -1
- package/dist/components/conversation/scroll-follow-core.d.ts +24 -0
- package/dist/components/conversation/scroll-follow-core.d.ts.map +1 -1
- package/dist/components/conversation/scroll-follow-core.js +23 -1
- package/dist/components/conversation/scroll-follow-core.js.map +1 -1
- package/dist/components/conversation/scroll-follow.d.ts +3 -0
- package/dist/components/conversation/scroll-follow.d.ts.map +1 -1
- package/dist/components/conversation/scroll-follow.js +80 -1
- package/dist/components/conversation/scroll-follow.js.map +1 -1
- package/dist/components/ui/attachment/attachment.d.ts +58 -0
- package/dist/components/ui/attachment/attachment.d.ts.map +1 -0
- package/dist/components/ui/attachment/attachment.js +279 -0
- package/dist/components/ui/attachment/attachment.js.map +1 -0
- package/dist/components/ui/attachment/index.d.ts +2 -0
- package/dist/components/ui/attachment/index.d.ts.map +1 -0
- package/dist/components/ui/attachment/index.js +2 -0
- package/dist/components/ui/badge/badge.d.ts +1 -1
- package/dist/components/ui/bubble/bubble.d.ts +33 -0
- package/dist/components/ui/bubble/bubble.d.ts.map +1 -0
- package/dist/components/ui/bubble/bubble.js +95 -0
- package/dist/components/ui/bubble/bubble.js.map +1 -0
- package/dist/components/ui/bubble/index.d.ts +2 -0
- package/dist/components/ui/bubble/index.d.ts.map +1 -0
- package/dist/components/ui/bubble/index.js +2 -0
- package/dist/components/ui/button/button.d.ts +1 -1
- package/dist/components/ui/code-block/code-block.d.ts +56 -3
- package/dist/components/ui/code-block/code-block.d.ts.map +1 -1
- package/dist/components/ui/code-block/code-block.js +231 -50
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/code-block/index.d.ts +1 -1
- package/dist/components/ui/code-block/index.d.ts.map +1 -1
- package/dist/components/ui/code-block/index.js +2 -2
- package/dist/components/ui/field/number-field.d.ts +21 -4
- package/dist/components/ui/field/number-field.d.ts.map +1 -1
- package/dist/components/ui/field/number-field.js +22 -11
- package/dist/components/ui/field/number-field.js.map +1 -1
- package/dist/components/ui/marker/index.d.ts +2 -0
- package/dist/components/ui/marker/index.d.ts.map +1 -0
- package/dist/components/ui/marker/index.js +2 -0
- package/dist/components/ui/marker/marker.d.ts +35 -0
- package/dist/components/ui/marker/marker.d.ts.map +1 -0
- package/dist/components/ui/marker/marker.js +123 -0
- package/dist/components/ui/marker/marker.js.map +1 -0
- package/dist/components/ui/message/cite-ranges.d.ts +42 -0
- package/dist/components/ui/message/cite-ranges.d.ts.map +1 -0
- package/dist/components/ui/message/cite-ranges.js +105 -0
- package/dist/components/ui/message/cite-ranges.js.map +1 -0
- package/dist/components/ui/message/index.d.ts +4 -0
- package/dist/components/ui/message/index.d.ts.map +1 -0
- package/dist/components/ui/message/index.js +4 -0
- package/dist/components/ui/message/message.d.ts +95 -0
- package/dist/components/ui/message/message.d.ts.map +1 -0
- package/dist/components/ui/message/message.js +443 -0
- package/dist/components/ui/message/message.js.map +1 -0
- package/dist/components/ui/message/parse-message-text.d.ts +93 -0
- package/dist/components/ui/message/parse-message-text.d.ts.map +1 -0
- package/dist/components/ui/message/parse-message-text.js +365 -0
- package/dist/components/ui/message/parse-message-text.js.map +1 -0
- package/dist/components/ui/questionnaire/index.d.ts +2 -0
- package/dist/components/ui/questionnaire/index.d.ts.map +1 -0
- package/dist/components/ui/questionnaire/index.js +2 -0
- package/dist/components/ui/questionnaire/questionnaire.d.ts +83 -0
- package/dist/components/ui/questionnaire/questionnaire.d.ts.map +1 -0
- package/dist/components/ui/questionnaire/questionnaire.js +470 -0
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -0
- package/dist/components/ui/status-chip/status-chip.d.ts +1 -1
- package/dist/components/ui/switch/switch.js +11 -11
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/trace/index.d.ts +2 -0
- package/dist/components/ui/trace/index.d.ts.map +1 -0
- package/dist/components/ui/trace/index.js +2 -0
- package/dist/components/ui/trace/trace.d.ts +72 -0
- package/dist/components/ui/trace/trace.d.ts.map +1 -0
- package/dist/components/ui/trace/trace.js +340 -0
- package/dist/components/ui/trace/trace.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -5
- package/dist/r/attachment.json +25 -0
- package/dist/r/bubble.json +22 -0
- package/dist/r/chain-of-thought.json +26 -0
- package/dist/r/chat.json +24 -0
- package/dist/r/checkpoint.json +35 -0
- package/dist/r/confirmation.json +34 -0
- package/dist/r/context.json +33 -0
- package/dist/r/file-tree.json +32 -0
- package/dist/r/inline-citation.json +35 -0
- package/dist/r/marker.json +22 -0
- package/dist/r/message-scroller.json +31 -0
- package/dist/r/message.json +33 -0
- package/dist/r/model-selector.json +34 -0
- package/dist/r/plan.json +26 -0
- package/dist/r/questionnaire.json +28 -0
- package/dist/r/queue.json +26 -0
- package/dist/r/reasoning.json +26 -0
- package/dist/r/registry.json +811 -52
- package/dist/r/sources.json +32 -0
- package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +141 -0
- package/dist/r/src/components/composites/chain-of-thought/index.ts +11 -0
- package/dist/r/src/components/composites/chat/chat.tsx +190 -0
- package/dist/r/src/components/composites/chat/index.ts +11 -0
- package/dist/r/src/components/composites/checkpoint/checkpoint-model.ts +71 -0
- package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +214 -0
- package/dist/r/src/components/composites/checkpoint/index.ts +8 -0
- package/dist/r/src/components/composites/confirmation/confirmation-model.ts +83 -0
- package/dist/r/src/components/composites/confirmation/confirmation.tsx +311 -0
- package/dist/r/src/components/composites/confirmation/index.ts +9 -0
- package/dist/r/src/components/composites/context/context-model.ts +168 -0
- package/dist/r/src/components/composites/context/context.tsx +187 -0
- package/dist/r/src/components/composites/context/index.ts +18 -0
- package/dist/r/src/components/composites/file-tree/build-file-tree.ts +456 -0
- package/dist/r/src/components/composites/file-tree/file-tree.tsx +405 -0
- package/dist/r/src/components/composites/file-tree/index.ts +25 -0
- package/dist/r/src/components/composites/inline-citation/citation.ts +78 -0
- package/dist/r/src/components/composites/inline-citation/index.ts +9 -0
- package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +285 -0
- package/dist/r/src/components/composites/message-scroller/index.ts +2 -0
- package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +301 -0
- package/dist/r/src/components/composites/message-scroller/scroll-anchor.ts +170 -0
- package/dist/r/src/components/composites/model-selector/index.ts +14 -0
- package/dist/r/src/components/composites/model-selector/model-selector.tsx +420 -0
- package/dist/r/src/components/composites/model-selector/models.ts +103 -0
- package/dist/r/src/components/composites/plan/index.ts +1 -0
- package/dist/r/src/components/composites/plan/plan.tsx +155 -0
- package/dist/r/src/components/composites/queue/index.ts +10 -0
- package/dist/r/src/components/composites/queue/queue.tsx +264 -0
- package/dist/r/src/components/composites/reasoning/index.ts +1 -0
- package/dist/r/src/components/composites/reasoning/reasoning.tsx +176 -0
- package/dist/r/src/components/composites/sources/index.ts +11 -0
- package/dist/r/src/components/composites/sources/source.ts +116 -0
- package/dist/r/src/components/composites/sources/sources.tsx +163 -0
- package/dist/r/src/components/composites/stack-trace/index.ts +19 -0
- package/dist/r/src/components/composites/stack-trace/parse-stack-trace.ts +507 -0
- package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +395 -0
- package/dist/r/src/components/composites/subagent/index.ts +1 -0
- package/dist/r/src/components/composites/subagent/subagent.tsx +159 -0
- package/dist/r/src/components/composites/suggestion/index.ts +1 -0
- package/dist/r/src/components/composites/suggestion/suggestion.tsx +140 -0
- package/dist/r/src/components/composites/task/index.ts +14 -0
- package/dist/r/src/components/composites/task/task.tsx +317 -0
- package/dist/r/src/components/composites/terminal/ansi.ts +674 -0
- package/dist/r/src/components/composites/terminal/index.ts +20 -0
- package/dist/r/src/components/composites/terminal/terminal-model.ts +111 -0
- package/dist/r/src/components/composites/terminal/terminal.tsx +574 -0
- package/dist/r/src/components/composites/test-results/index.ts +20 -0
- package/dist/r/src/components/composites/test-results/test-results-model.ts +368 -0
- package/dist/r/src/components/composites/test-results/test-results.tsx +586 -0
- package/dist/r/src/components/composites/tool/format-tool-value.ts +221 -0
- package/dist/r/src/components/composites/tool/index.ts +2 -0
- package/dist/r/src/components/composites/tool/tool.tsx +228 -0
- package/dist/r/src/components/conversation/conversation-surface.tsx +9 -0
- package/dist/r/src/components/conversation/scroll-follow-core.ts +31 -0
- package/dist/r/src/components/conversation/scroll-follow.ts +92 -0
- package/dist/r/src/components/ui/attachment/attachment.tsx +282 -0
- package/dist/r/src/components/ui/attachment/index.ts +10 -0
- package/dist/r/src/components/ui/bubble/bubble.tsx +86 -0
- package/dist/r/src/components/ui/bubble/index.ts +1 -0
- package/dist/r/src/components/ui/code-block/code-block.tsx +256 -26
- package/dist/r/src/components/ui/code-block/index.ts +9 -1
- package/dist/r/src/components/ui/field/number-field.tsx +51 -14
- package/dist/r/src/components/ui/marker/index.ts +1 -0
- package/dist/r/src/components/ui/marker/marker.tsx +90 -0
- package/dist/r/src/components/ui/message/cite-ranges.ts +144 -0
- package/dist/r/src/components/ui/message/index.ts +23 -0
- package/dist/r/src/components/ui/message/message.tsx +434 -0
- package/dist/r/src/components/ui/message/parse-message-text.ts +450 -0
- package/dist/r/src/components/ui/questionnaire/index.ts +10 -0
- package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +446 -0
- package/dist/r/src/components/ui/trace/index.ts +9 -0
- package/dist/r/src/components/ui/trace/trace.tsx +334 -0
- package/dist/r/src/styles/base.css +34 -0
- package/dist/r/stack-trace.json +32 -0
- package/dist/r/subagent.json +27 -0
- package/dist/r/suggestion.json +24 -0
- package/dist/r/task.json +28 -0
- package/dist/r/terminal.json +35 -0
- package/dist/r/test-results.json +33 -0
- package/dist/r/tool.json +31 -0
- package/dist/r/trace.json +25 -0
- package/package.json +6 -3
- package/registry.json +811 -52
- package/src/components/composites/chain-of-thought/chain-of-thought.tsx +141 -0
- package/src/components/composites/chain-of-thought/index.ts +11 -0
- package/src/components/composites/chat/chat.tsx +190 -0
- package/src/components/composites/chat/index.ts +11 -0
- package/src/components/composites/checkpoint/checkpoint-model.ts +71 -0
- package/src/components/composites/checkpoint/checkpoint.tsx +214 -0
- package/src/components/composites/checkpoint/index.ts +8 -0
- package/src/components/composites/confirmation/confirmation-model.ts +83 -0
- package/src/components/composites/confirmation/confirmation.tsx +311 -0
- package/src/components/composites/confirmation/index.ts +9 -0
- package/src/components/composites/context/context-model.ts +168 -0
- package/src/components/composites/context/context.tsx +187 -0
- package/src/components/composites/context/index.ts +18 -0
- package/src/components/composites/file-tree/build-file-tree.ts +456 -0
- package/src/components/composites/file-tree/file-tree.tsx +405 -0
- package/src/components/composites/file-tree/index.ts +25 -0
- package/src/components/composites/inline-citation/citation.ts +78 -0
- package/src/components/composites/inline-citation/index.ts +9 -0
- package/src/components/composites/inline-citation/inline-citation.tsx +285 -0
- package/src/components/composites/message-scroller/index.ts +2 -0
- package/src/components/composites/message-scroller/message-scroller.tsx +301 -0
- package/src/components/composites/message-scroller/scroll-anchor.ts +170 -0
- package/src/components/composites/model-selector/index.ts +14 -0
- package/src/components/composites/model-selector/model-selector.tsx +420 -0
- package/src/components/composites/model-selector/models.ts +103 -0
- package/src/components/composites/plan/index.ts +1 -0
- package/src/components/composites/plan/plan.tsx +155 -0
- package/src/components/composites/queue/index.ts +10 -0
- package/src/components/composites/queue/queue.tsx +264 -0
- package/src/components/composites/reasoning/index.ts +1 -0
- package/src/components/composites/reasoning/reasoning.tsx +176 -0
- package/src/components/composites/sources/index.ts +11 -0
- package/src/components/composites/sources/source.ts +116 -0
- package/src/components/composites/sources/sources.tsx +163 -0
- package/src/components/composites/stack-trace/index.ts +19 -0
- package/src/components/composites/stack-trace/parse-stack-trace.ts +507 -0
- package/src/components/composites/stack-trace/stack-trace.tsx +395 -0
- package/src/components/composites/subagent/index.ts +1 -0
- package/src/components/composites/subagent/subagent.tsx +159 -0
- package/src/components/composites/suggestion/index.ts +1 -0
- package/src/components/composites/suggestion/suggestion.tsx +140 -0
- package/src/components/composites/task/index.ts +14 -0
- package/src/components/composites/task/task.tsx +317 -0
- package/src/components/composites/terminal/ansi.ts +674 -0
- package/src/components/composites/terminal/index.ts +20 -0
- package/src/components/composites/terminal/terminal-model.ts +111 -0
- package/src/components/composites/terminal/terminal.tsx +574 -0
- package/src/components/composites/test-results/index.ts +20 -0
- package/src/components/composites/test-results/test-results-model.ts +368 -0
- package/src/components/composites/test-results/test-results.tsx +586 -0
- package/src/components/composites/tool/format-tool-value.ts +221 -0
- package/src/components/composites/tool/index.ts +2 -0
- package/src/components/composites/tool/tool.tsx +228 -0
- package/src/components/conversation/conversation-surface.tsx +9 -0
- package/src/components/conversation/scroll-follow-core.ts +31 -0
- package/src/components/conversation/scroll-follow.ts +92 -0
- package/src/components/ui/attachment/attachment.tsx +282 -0
- package/src/components/ui/attachment/index.ts +10 -0
- package/src/components/ui/bubble/bubble.tsx +86 -0
- package/src/components/ui/bubble/index.ts +1 -0
- package/src/components/ui/code-block/code-block.tsx +256 -26
- package/src/components/ui/code-block/index.ts +9 -1
- package/src/components/ui/field/number-field.tsx +51 -14
- package/src/components/ui/marker/index.ts +1 -0
- package/src/components/ui/marker/marker.tsx +90 -0
- package/src/components/ui/message/cite-ranges.ts +144 -0
- package/src/components/ui/message/index.ts +23 -0
- package/src/components/ui/message/message.tsx +434 -0
- package/src/components/ui/message/parse-message-text.ts +450 -0
- package/src/components/ui/questionnaire/index.ts +10 -0
- package/src/components/ui/questionnaire/questionnaire.tsx +446 -0
- package/src/components/ui/trace/index.ts +9 -0
- package/src/components/ui/trace/trace.tsx +334 -0
- package/src/index.ts +26 -0
- package/src/styles/base.css +34 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type JSX } from 'solid-js';
|
|
2
|
+
import { type TraceLineProps, type TraceStatus } from '../../ui/trace';
|
|
3
|
+
/**
|
|
4
|
+
* Subagent.
|
|
5
|
+
*
|
|
6
|
+
* Another agent the main one handed work to, as a `TraceLine`: its name, the task
|
|
7
|
+
* it was given, its status, and — folded away — everything it did. The body is a
|
|
8
|
+
* nested `Trace`, so a subagent's tool calls, reasoning and own subagents are the
|
|
9
|
+
* same lines as the parent's, one level in; nothing about "a run inside a run"
|
|
10
|
+
* needs a new visual. Reach for `Tool` when the call has an input and an output
|
|
11
|
+
* and no steps of its own, and for `Task` when the items are a statement of work
|
|
12
|
+
* rather than a record of what ran.
|
|
13
|
+
*
|
|
14
|
+
* ## The collapsed line is the summary
|
|
15
|
+
*
|
|
16
|
+
* Folded, the line carries what a reader scanning the turn needs: the name, the
|
|
17
|
+
* task, the status, and — in the trailing text — the model, the number of steps
|
|
18
|
+
* and how long it took. Each of those appears only when known: `model` and
|
|
19
|
+
* `duration` are the host's, and the step count is the number of lines passed as
|
|
20
|
+
* `children` unless the host knows better (`stepCount`, for a run whose earlier
|
|
21
|
+
* steps are not loaded). No count is shown for a run with no steps.
|
|
22
|
+
*
|
|
23
|
+
* ## Result and failure
|
|
24
|
+
*
|
|
25
|
+
* `result` is a slot for the answer the subagent returned — usually prose or a
|
|
26
|
+
* `CodeBlock` — below its steps, labelled "Result". `errorText` is a failure as
|
|
27
|
+
* text. Neither is invented: a subagent that finished without a result shows
|
|
28
|
+
* none, and one with no steps, result or error yet is a plain line (there is
|
|
29
|
+
* nothing to open; the line becomes a disclosure when its first step arrives).
|
|
30
|
+
*
|
|
31
|
+
* A `Subagent` is a line: place it inside a `Trace`, and its `children` are
|
|
32
|
+
* `TraceLine`s.
|
|
33
|
+
*/
|
|
34
|
+
export type SubagentProps = Omit<TraceLineProps, 'title' | 'description' | 'href' | 'onSelect' | 'selectHaspopup' | 'meta'> & {
|
|
35
|
+
/** The subagent's name. Rendered as text. */
|
|
36
|
+
name: string;
|
|
37
|
+
/** The task it was given, on the line. */
|
|
38
|
+
task?: JSX.Element;
|
|
39
|
+
status?: TraceStatus;
|
|
40
|
+
/** A model label, e.g. `sonnet-5`. Rendered as text. */
|
|
41
|
+
model?: string;
|
|
42
|
+
/** Seconds the run took, if the host measured it. */
|
|
43
|
+
duration?: number;
|
|
44
|
+
/** Overrides the count taken from `children`. */
|
|
45
|
+
stepCount?: number;
|
|
46
|
+
/** What the subagent returned. */
|
|
47
|
+
result?: JSX.Element;
|
|
48
|
+
errorText?: string;
|
|
49
|
+
/** Trailing text appended after the derived summary. */
|
|
50
|
+
meta?: JSX.Element;
|
|
51
|
+
};
|
|
52
|
+
/** `3 steps`, `1 step`. */
|
|
53
|
+
export declare function stepCountLabel(count: number): string;
|
|
54
|
+
export declare function Subagent(props: SubagentProps): JSX.Element;
|
|
55
|
+
//# sourceMappingURL=subagent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subagent.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/subagent/subagent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiD,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAGlF,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAA;AAMvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,cAAc,EACd,OAAO,GAAG,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,gBAAgB,GAAG,MAAM,CAC1E,GAAG;IACF,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,0CAA0C;IAC1C,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kCAAkC;IAClC,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wDAAwD;IACxD,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACnB,CAAA;AAED,2BAA2B;AAC3B,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,eAoF5C"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { CodeBlock } from "../../ui/code-block/code-block.js";
|
|
2
|
+
import { ScrollArea } from "../../ui/scroll-area/scroll-area.js";
|
|
3
|
+
import { Trace, TraceDetail, TraceLine } from "../../ui/trace/trace.js";
|
|
4
|
+
import { formatDuration } from "../reasoning/reasoning.js";
|
|
5
|
+
import { createComponent, insert, memo, mergeProps, template } from "solid-js/web";
|
|
6
|
+
import { Bot } from "lucide-solid";
|
|
7
|
+
import { Show, children, splitProps } from "solid-js";
|
|
8
|
+
//#region src/components/composites/subagent/subagent.tsx
|
|
9
|
+
var _tmpl$ = /*#__PURE__*/ template(`<span class="inline-block max-w-72 truncate align-bottom">`);
|
|
10
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<div class="flex min-w-0 flex-col gap-1"><p class="m-0 font-medium text-foreground">Result`);
|
|
11
|
+
var deferred = (render) => render;
|
|
12
|
+
/** `3 steps`, `1 step`. */
|
|
13
|
+
function stepCountLabel(count) {
|
|
14
|
+
return `${count} ${count === 1 ? "step" : "steps"}`;
|
|
15
|
+
}
|
|
16
|
+
function Subagent(props) {
|
|
17
|
+
const [local, rest] = splitProps(props, [
|
|
18
|
+
"name",
|
|
19
|
+
"task",
|
|
20
|
+
"status",
|
|
21
|
+
"model",
|
|
22
|
+
"duration",
|
|
23
|
+
"stepCount",
|
|
24
|
+
"result",
|
|
25
|
+
"errorText",
|
|
26
|
+
"icon",
|
|
27
|
+
"meta",
|
|
28
|
+
"children"
|
|
29
|
+
]);
|
|
30
|
+
const steps = children(() => local.children);
|
|
31
|
+
const count = () => local.stepCount ?? steps.toArray().length;
|
|
32
|
+
const hasError = () => local.errorText !== void 0 && local.errorText !== "";
|
|
33
|
+
const hasResult = () => local.result !== void 0 && local.result !== null;
|
|
34
|
+
const hasDetail = () => steps.toArray().length > 0 || hasResult() || hasError();
|
|
35
|
+
const summary = () => {
|
|
36
|
+
const parts = [
|
|
37
|
+
local.model,
|
|
38
|
+
count() > 0 ? stepCountLabel(count()) : void 0,
|
|
39
|
+
formatDuration(local.duration)
|
|
40
|
+
].filter((part) => part !== void 0 && part !== "");
|
|
41
|
+
return parts.length > 0 ? parts.join(" · ") : void 0;
|
|
42
|
+
};
|
|
43
|
+
const meta = () => summary() || local.meta ? [createComponent(Show, {
|
|
44
|
+
get when() {
|
|
45
|
+
return summary();
|
|
46
|
+
},
|
|
47
|
+
get children() {
|
|
48
|
+
var _el$ = _tmpl$();
|
|
49
|
+
insert(_el$, summary);
|
|
50
|
+
return _el$;
|
|
51
|
+
}
|
|
52
|
+
}), memo(() => local.meta)] : void 0;
|
|
53
|
+
const detail = () => createComponent(TraceDetail, {
|
|
54
|
+
"class": "flex flex-col gap-2",
|
|
55
|
+
get children() {
|
|
56
|
+
return [
|
|
57
|
+
createComponent(Show, {
|
|
58
|
+
get when() {
|
|
59
|
+
return steps.toArray().length > 0;
|
|
60
|
+
},
|
|
61
|
+
get children() {
|
|
62
|
+
return createComponent(Trace, {
|
|
63
|
+
size: "sm",
|
|
64
|
+
get ["aria-label"]() {
|
|
65
|
+
return `${local.name} steps`;
|
|
66
|
+
},
|
|
67
|
+
get children() {
|
|
68
|
+
return steps();
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}),
|
|
73
|
+
createComponent(Show, {
|
|
74
|
+
get when() {
|
|
75
|
+
return hasError();
|
|
76
|
+
},
|
|
77
|
+
get children() {
|
|
78
|
+
return createComponent(CodeBlock, {
|
|
79
|
+
size: "sm",
|
|
80
|
+
title: "Error",
|
|
81
|
+
language: "error",
|
|
82
|
+
get code() {
|
|
83
|
+
return local.errorText ?? "";
|
|
84
|
+
},
|
|
85
|
+
lineMarks: { 1: "error" },
|
|
86
|
+
complete: true,
|
|
87
|
+
maxHeight: "12rem",
|
|
88
|
+
wrap: true
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}),
|
|
92
|
+
createComponent(Show, {
|
|
93
|
+
get when() {
|
|
94
|
+
return hasResult();
|
|
95
|
+
},
|
|
96
|
+
get children() {
|
|
97
|
+
var _el$2 = _tmpl$2();
|
|
98
|
+
_el$2.firstChild;
|
|
99
|
+
insert(_el$2, createComponent(ScrollArea, {
|
|
100
|
+
role: "region",
|
|
101
|
+
get ["aria-label"]() {
|
|
102
|
+
return `${local.name} result`;
|
|
103
|
+
},
|
|
104
|
+
"class": "max-h-72",
|
|
105
|
+
get children() {
|
|
106
|
+
return local.result;
|
|
107
|
+
}
|
|
108
|
+
}), null);
|
|
109
|
+
return _el$2;
|
|
110
|
+
}
|
|
111
|
+
})
|
|
112
|
+
];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
return createComponent(TraceLine, mergeProps({
|
|
116
|
+
get icon() {
|
|
117
|
+
return local.icon ?? createComponent(Bot, {});
|
|
118
|
+
},
|
|
119
|
+
get title() {
|
|
120
|
+
return local.name;
|
|
121
|
+
},
|
|
122
|
+
get description() {
|
|
123
|
+
return local.task;
|
|
124
|
+
},
|
|
125
|
+
get status() {
|
|
126
|
+
return local.status;
|
|
127
|
+
},
|
|
128
|
+
get meta() {
|
|
129
|
+
return meta();
|
|
130
|
+
}
|
|
131
|
+
}, rest, { get children() {
|
|
132
|
+
return memo(() => !!hasDetail())() ? deferred(detail) : void 0;
|
|
133
|
+
} }));
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
export { Subagent, stepCountLabel };
|
|
137
|
+
|
|
138
|
+
//# sourceMappingURL=subagent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subagent.js","names":["Bot","children","resolveChildren","Show","splitProps","JSX","CodeBlock","ScrollArea","Trace","TraceDetail","TraceLine","TraceLineProps","TraceStatus","formatDuration","deferred","render","Element","SubagentProps","Omit","name","task","status","model","duration","stepCount","result","errorText","meta","stepCountLabel","count","Subagent","props","local","rest","steps","toArray","length","hasError","undefined","hasResult","hasDetail","summary","parts","filter","part","join","_$createComponent","when","_el$","_tmpl$","_$insert","_$memo","detail","size","aria-label","title","language","code","lineMarks","complete","maxHeight","wrap","_el$2","_tmpl$2","_el$3","firstChild","role","_$mergeProps","icon","description","resolveChildren","_$createComponent","_$memo","_$mergeProps"],"sources":["../../../../src/components/composites/subagent/subagent.tsx"],"sourcesContent":["import { Bot } from 'lucide-solid'\nimport { children as resolveChildren, Show, splitProps, type JSX } from 'solid-js'\nimport { CodeBlock } from '../../ui/code-block'\nimport { ScrollArea } from '../../ui/scroll-area'\nimport {\n Trace,\n TraceDetail,\n TraceLine,\n type TraceLineProps,\n type TraceStatus,\n} from '../../ui/trace'\nimport { formatDuration } from '../reasoning'\n\n// A function child runs once, when the content mounts (see `deferred` in `tool.tsx`).\nconst deferred = (render: () => JSX.Element) => render as unknown as JSX.Element\n\n/**\n * Subagent.\n *\n * Another agent the main one handed work to, as a `TraceLine`: its name, the task\n * it was given, its status, and — folded away — everything it did. The body is a\n * nested `Trace`, so a subagent's tool calls, reasoning and own subagents are the\n * same lines as the parent's, one level in; nothing about \"a run inside a run\"\n * needs a new visual. Reach for `Tool` when the call has an input and an output\n * and no steps of its own, and for `Task` when the items are a statement of work\n * rather than a record of what ran.\n *\n * ## The collapsed line is the summary\n *\n * Folded, the line carries what a reader scanning the turn needs: the name, the\n * task, the status, and — in the trailing text — the model, the number of steps\n * and how long it took. Each of those appears only when known: `model` and\n * `duration` are the host's, and the step count is the number of lines passed as\n * `children` unless the host knows better (`stepCount`, for a run whose earlier\n * steps are not loaded). No count is shown for a run with no steps.\n *\n * ## Result and failure\n *\n * `result` is a slot for the answer the subagent returned — usually prose or a\n * `CodeBlock` — below its steps, labelled \"Result\". `errorText` is a failure as\n * text. Neither is invented: a subagent that finished without a result shows\n * none, and one with no steps, result or error yet is a plain line (there is\n * nothing to open; the line becomes a disclosure when its first step arrives).\n *\n * A `Subagent` is a line: place it inside a `Trace`, and its `children` are\n * `TraceLine`s.\n */\nexport type SubagentProps = Omit<\n TraceLineProps,\n 'title' | 'description' | 'href' | 'onSelect' | 'selectHaspopup' | 'meta'\n> & {\n /** The subagent's name. Rendered as text. */\n name: string\n /** The task it was given, on the line. */\n task?: JSX.Element\n status?: TraceStatus\n /** A model label, e.g. `sonnet-5`. Rendered as text. */\n model?: string\n /** Seconds the run took, if the host measured it. */\n duration?: number\n /** Overrides the count taken from `children`. */\n stepCount?: number\n /** What the subagent returned. */\n result?: JSX.Element\n errorText?: string\n /** Trailing text appended after the derived summary. */\n meta?: JSX.Element\n}\n\n/** `3 steps`, `1 step`. */\nexport function stepCountLabel(count: number): string {\n return `${count} ${count === 1 ? 'step' : 'steps'}`\n}\n\nexport function Subagent(props: SubagentProps) {\n const [local, rest] = splitProps(props, [\n 'name',\n 'task',\n 'status',\n 'model',\n 'duration',\n 'stepCount',\n 'result',\n 'errorText',\n 'icon',\n 'meta',\n 'children',\n ])\n // Resolved once: the steps are created once and keep their own state (an open\n // tool call, a scrolled output) while the run is folded and unfolded.\n const steps = resolveChildren(() => local.children)\n const count = () => local.stepCount ?? steps.toArray().length\n const hasError = () => local.errorText !== undefined && local.errorText !== ''\n const hasResult = () => local.result !== undefined && local.result !== null\n const hasDetail = () => steps.toArray().length > 0 || hasResult() || hasError()\n\n const summary = () => {\n const parts = [\n local.model,\n count() > 0 ? stepCountLabel(count()) : undefined,\n formatDuration(local.duration),\n ].filter((part): part is string => part !== undefined && part !== '')\n return parts.length > 0 ? parts.join(' · ') : undefined\n }\n\n // A model label is host text and may be long; it must not widen the line.\n const meta = () =>\n summary() || local.meta ? (\n <>\n <Show when={summary()}>\n <span class=\"inline-block max-w-72 truncate align-bottom\">{summary()}</span>\n </Show>\n {local.meta}\n </>\n ) : undefined\n\n const detail = () => (\n <TraceDetail class=\"flex flex-col gap-2\">\n <Show when={steps.toArray().length > 0}>\n <Trace size=\"sm\" aria-label={`${local.name} steps`}>\n {steps()}\n </Trace>\n </Show>\n <Show when={hasError()}>\n <CodeBlock\n size=\"sm\"\n title=\"Error\"\n language=\"error\"\n code={local.errorText ?? ''}\n lineMarks={{ 1: 'error' }}\n complete\n maxHeight=\"12rem\"\n wrap\n />\n </Show>\n <Show when={hasResult()}>\n <div class=\"flex min-w-0 flex-col gap-1\">\n <p class=\"m-0 font-medium text-foreground\">Result</p>\n <ScrollArea role=\"region\" aria-label={`${local.name} result`} class=\"max-h-72\">\n {local.result}\n </ScrollArea>\n </div>\n </Show>\n </TraceDetail>\n )\n\n return (\n <TraceLine\n icon={local.icon ?? <Bot />}\n title={local.name}\n description={local.task}\n status={local.status}\n meta={meta()}\n {...rest}\n >\n {hasDetail() ? deferred(detail) : undefined}\n </TraceLine>\n )\n}\n"],"mappings":";;;;;;;;;;AAcA,IAAMc,YAAYC,WAA8BA;;AAwDhD,SAAgBa,eAAeC,OAAuB;CACpD,OAAO,GAAGA,MAAK,GAAIA,UAAU,IAAI,SAAS;AAC5C;AAEA,SAAgBC,SAASC,OAAsB;CAC7C,MAAM,CAACC,OAAOC,QAAQ7B,WAAW2B,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAGD,MAAMG,QAAQhC,eAAsB8B,MAAM/B,QAAQ;CAClD,MAAM4B,cAAcG,MAAMR,aAAaU,MAAMC,QAAQ,CAAC,CAACC;CACvD,MAAMC,iBAAiBL,MAAMN,cAAcY,KAAAA,KAAaN,MAAMN,cAAc;CAC5E,MAAMa,kBAAkBP,MAAMP,WAAWa,KAAAA,KAAaN,MAAMP,WAAW;CACvE,MAAMe,kBAAkBN,MAAMC,QAAQ,CAAC,CAACC,SAAS,KAAKG,UAAU,KAAKF,SAAS;CAE9E,MAAMI,gBAAgB;EACpB,MAAMC,QAAQ;GACZV,MAAMV;GACNO,MAAM,IAAI,IAAID,eAAeC,MAAM,CAAC,IAAIS,KAAAA;GACxCzB,eAAemB,MAAMT,QAAQ;EAAC,CAC/B,CAACoB,QAAQC,SAAyBA,SAASN,KAAAA,KAAaM,SAAS,EAAE;EACpE,OAAOF,MAAMN,SAAS,IAAIM,MAAMG,KAAK,KAAK,IAAIP,KAAAA;CAChD;CAGA,MAAMX,aACJc,QAAQ,KAAKT,MAAML,OAAI,CAAAmB,gBAElB3C,MAAI;EAAA,IAAC4C,OAAI;GAAA,OAAEN,QAAQ;EAAC;EAAA,IAAAxC,WAAA;GAAA,IAAA+C,OAAAC,OAAA;GAAAC,OAAAF,MACwCP,OAAO;GAAA,OAAAO;EAAA;CAAA,CAAA,GAAAG,WAEnEnB,MAAML,IAAI,CAAA,IAEXW,KAAAA;CAEN,MAAMc,eAASN,gBACZrC,aAAW;EAAA,SAAA;EAAA,IAAAR,WAAA;GAAA,OAAA;IAAA6C,gBACT3C,MAAI;KAAA,IAAC4C,OAAI;MAAA,OAAEb,MAAMC,QAAQ,CAAC,CAACC,SAAS;KAAC;KAAA,IAAAnC,WAAA;MAAA,OAAA6C,gBACnCtC,OAAK;OAAC6C,MAAI;OAAA,KAAA,gBAAA;QAAA,OAAkB,GAAGrB,MAAMb,KAAI;OAAQ;OAAA,IAAAlB,WAAA;QAAA,OAC/CiC,MAAM;OAAC;MAAA,CAAA;KAAA;IAAA,CAAA;IAAAY,gBAGX3C,MAAI;KAAA,IAAC4C,OAAI;MAAA,OAAEV,SAAS;KAAC;KAAA,IAAApC,WAAA;MAAA,OAAA6C,gBACnBxC,WAAS;OACR+C,MAAI;OACJE,OAAK;OACLC,UAAQ;OAAA,IACRC,OAAI;QAAA,OAAEzB,MAAMN,aAAa;OAAE;OAC3BgC,WAAW,EAAE,GAAG,QAAQ;OACxBC,UAAQ;OACRC,WAAS;OACTC,MAAI;MAAA,CAAA;KAAA;IAAA,CAAA;IAAAf,gBAGP3C,MAAI;KAAA,IAAC4C,OAAI;MAAA,OAAER,UAAU;KAAC;KAAA,IAAAtC,WAAA;MAAA,IAAA6D,QAAAC,QAAA;MAAAD,MAAAG;MAAAf,OAAAY,OAAAhB,gBAGlBvC,YAAU;OAAC2D,MAAI;OAAA,KAAA,gBAAA;QAAA,OAAsB,GAAGlC,MAAMb,KAAI;OAAS;OAAA,SAAA;OAAA,IAAAlB,WAAA;QAAA,OACzD+B,MAAMP;OAAM;MAAA,CAAA,GAAA,IAAA;MAAA,OAAAqC;KAAA;IAAA,CAAA;GAAA;EAAA;CAAA,CAAA;CAOvB,OAAAhB,gBACGpC,WAASyD,WAAA;EAAA,IACRC,OAAI;GAAA,OAAEpC,MAAMoC,QAAItB,gBAAK9C,KAAG,CAAA,CAAA;EAAG;EAAA,IAC3BuD,QAAK;GAAA,OAAEvB,MAAMb;EAAI;EAAA,IACjBkD,cAAW;GAAA,OAAErC,MAAMZ;EAAI;EAAA,IACvBC,SAAM;GAAA,OAAEW,MAAMX;EAAM;EAAA,IACpBM,OAAI;GAAA,OAAEA,KAAK;EAAC;CAAA,GACRM,MAAI,EAAA,IAAAhC,WAAA;EAAA,OAEPkD,WAAA,CAAA,CAAAX,UAAU,CAAC,CAAA,CAAA,IAAG1B,SAASsC,MAAM,IAAId,KAAAA;CAAS,EAAA,CAAA,CAAA;AAGjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/suggestion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ComponentProps } from 'solid-js';
|
|
2
|
+
/**
|
|
3
|
+
* Suggestions.
|
|
4
|
+
*
|
|
5
|
+
* A row of one-click prompts: each chip is the text that will be sent, so choosing
|
|
6
|
+
* one is a single decision and never "fill the composer, then still have to press
|
|
7
|
+
* send". What a chip *does* with its text — send it, drop it in the composer —
|
|
8
|
+
* is the host's `onSelect`; this component only reports which one was chosen.
|
|
9
|
+
*
|
|
10
|
+
* - **Layout.** `wrap` (default) lets chips flow onto further lines, which is the
|
|
11
|
+
* right behaviour at a narrow width. `scroll` keeps a single line that scrolls
|
|
12
|
+
* sideways, for a bar above a composer that must not grow; the chips are real
|
|
13
|
+
* buttons, so keyboard focus scrolls them into view and nothing depends on a
|
|
14
|
+
* pointer to reach the overflow.
|
|
15
|
+
* - **Long text is clipped, not hidden.** A chip is one line and truncates; the
|
|
16
|
+
* full text is the button's accessible name and its `title`.
|
|
17
|
+
* - **The host owns authority.** No `onSelect`, or a `disabledReason`, disables
|
|
18
|
+
* every chip and says why in words under the row. Chips use `aria-disabled`
|
|
19
|
+
* rather than `disabled`, so a keyboard or screen-reader user can still reach
|
|
20
|
+
* them and hear the reason instead of finding a row that is silently skipped.
|
|
21
|
+
*/
|
|
22
|
+
export type SuggestionsProps = Omit<ComponentProps<'div'>, 'onSelect'> & {
|
|
23
|
+
/** The row's accessible name. */
|
|
24
|
+
label?: string;
|
|
25
|
+
layout?: 'wrap' | 'scroll';
|
|
26
|
+
/** Called with the chosen chip's text. Without it every chip is disabled. */
|
|
27
|
+
onSelect?: (text: string) => void;
|
|
28
|
+
/** Why the chips cannot be used right now. Implies disabled. */
|
|
29
|
+
disabledReason?: string;
|
|
30
|
+
};
|
|
31
|
+
export declare function Suggestions(props: SuggestionsProps): import("solid-js").JSX.Element;
|
|
32
|
+
export type SuggestionProps = Omit<ComponentProps<'button'>, 'onSelect' | 'children'> & {
|
|
33
|
+
/** The text that is sent when the chip is chosen. Also the chip's name. */
|
|
34
|
+
text: string;
|
|
35
|
+
};
|
|
36
|
+
export declare function Suggestion(props: SuggestionProps): import("solid-js").JSX.Element;
|
|
37
|
+
//# sourceMappingURL=suggestion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestion.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/suggestion/suggestion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,UAAU,CAAA;AAKjB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACvE,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IAC1B,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,gEAAgE;IAChE,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAUD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,kCAmDlD;AAED,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,GAAG;IACtF,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,kCA+BhD"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { Button } from "../../ui/button/button.js";
|
|
3
|
+
import { boundText } from "../sources/source.js";
|
|
4
|
+
import { createComponent, insert, memo, mergeProps, setAttribute, spread, template } from "solid-js/web";
|
|
5
|
+
import { Show, createContext, createUniqueId, splitProps, useContext } from "solid-js";
|
|
6
|
+
//#region src/components/composites/suggestion/suggestion.tsx
|
|
7
|
+
var _tmpl$ = /*#__PURE__*/ template(`<p role=status class="m-0 text-xs text-muted-foreground">`);
|
|
8
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<div data-slot=suggestions class="flex min-w-0 flex-col gap-1.5"><div role=group>`);
|
|
9
|
+
var _tmpl$3 = /*#__PURE__*/ template(`<span class=truncate>`);
|
|
10
|
+
var SuggestionsContext = createContext();
|
|
11
|
+
function Suggestions(props) {
|
|
12
|
+
const [local, rest] = splitProps(props, [
|
|
13
|
+
"class",
|
|
14
|
+
"label",
|
|
15
|
+
"layout",
|
|
16
|
+
"onSelect",
|
|
17
|
+
"disabledReason",
|
|
18
|
+
"children"
|
|
19
|
+
]);
|
|
20
|
+
const reasonId = `${createUniqueId()}-reason`;
|
|
21
|
+
const reason = () => local.disabledReason ? boundText(local.disabledReason, 240) : local.onSelect === void 0 ? "Suggestions are not available here." : void 0;
|
|
22
|
+
return createComponent(SuggestionsContext.Provider, {
|
|
23
|
+
value: {
|
|
24
|
+
select: (text) => local.onSelect?.(text),
|
|
25
|
+
blocked: () => reason() !== void 0,
|
|
26
|
+
reasonId: () => reason() ? reasonId : void 0
|
|
27
|
+
},
|
|
28
|
+
get children() {
|
|
29
|
+
var _el$ = _tmpl$2(), _el$2 = _el$.firstChild;
|
|
30
|
+
spread(_el$2, mergeProps({
|
|
31
|
+
get ["aria-label"]() {
|
|
32
|
+
return local.label ?? "Suggested prompts";
|
|
33
|
+
},
|
|
34
|
+
get ["class"]() {
|
|
35
|
+
return cn("flex min-w-0 gap-2", {
|
|
36
|
+
"flex-wrap": local.layout !== "scroll",
|
|
37
|
+
"flex-nowrap overflow-x-auto p-1 [&>*]:shrink-0": local.layout === "scroll"
|
|
38
|
+
}, local.class);
|
|
39
|
+
}
|
|
40
|
+
}, rest), false, true);
|
|
41
|
+
insert(_el$2, () => local.children);
|
|
42
|
+
insert(_el$, createComponent(Show, {
|
|
43
|
+
get when() {
|
|
44
|
+
return reason();
|
|
45
|
+
},
|
|
46
|
+
get children() {
|
|
47
|
+
var _el$3 = _tmpl$();
|
|
48
|
+
setAttribute(_el$3, "id", reasonId);
|
|
49
|
+
insert(_el$3, reason);
|
|
50
|
+
return _el$3;
|
|
51
|
+
}
|
|
52
|
+
}), null);
|
|
53
|
+
return _el$;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function Suggestion(props) {
|
|
58
|
+
const [local, rest] = splitProps(props, [
|
|
59
|
+
"class",
|
|
60
|
+
"text",
|
|
61
|
+
"onClick"
|
|
62
|
+
]);
|
|
63
|
+
const context = useContext(SuggestionsContext);
|
|
64
|
+
const blocked = () => context === void 0 || context.blocked();
|
|
65
|
+
const text = () => boundText(local.text, 400);
|
|
66
|
+
return createComponent(Button, mergeProps({
|
|
67
|
+
type: "button",
|
|
68
|
+
variant: "outline",
|
|
69
|
+
size: "sm",
|
|
70
|
+
"data-slot": "suggestion",
|
|
71
|
+
get title() {
|
|
72
|
+
return memo(() => text().length > 40)() ? text() : void 0;
|
|
73
|
+
},
|
|
74
|
+
get ["aria-disabled"]() {
|
|
75
|
+
return blocked() || void 0;
|
|
76
|
+
},
|
|
77
|
+
get ["aria-describedby"]() {
|
|
78
|
+
return context?.reasonId();
|
|
79
|
+
},
|
|
80
|
+
get ["class"]() {
|
|
81
|
+
return cn("max-w-full", local.class);
|
|
82
|
+
},
|
|
83
|
+
onClick: (event) => {
|
|
84
|
+
if (blocked()) {
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (typeof local.onClick === "function") local.onClick(event);
|
|
89
|
+
context?.select(local.text);
|
|
90
|
+
}
|
|
91
|
+
}, rest, { get children() {
|
|
92
|
+
var _el$4 = _tmpl$3();
|
|
93
|
+
insert(_el$4, text);
|
|
94
|
+
return _el$4;
|
|
95
|
+
} }));
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
98
|
+
export { Suggestion, Suggestions };
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=suggestion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestion.js","names":["createContext","createUniqueId","Show","splitProps","useContext","ComponentProps","cn","Button","boundText","SuggestionsProps","Omit","label","layout","onSelect","text","disabledReason","SuggestionsContext","select","blocked","reasonId","Suggestions","props","local","rest","uid","reason","undefined","_$createComponent","Provider","value","children","_el$","_tmpl$2","_el$2","firstChild","_$spread","_$mergeProps","aria-label","class","_$insert","when","_el$3","_tmpl$","_$setAttribute","SuggestionProps","Suggestion","context","type","variant","size","title","_$memo","length","aria-disabled","aria-describedby","onClick","event","preventDefault","_el$4","_tmpl$3","_$createComponent","_$mergeProps","_$memo"],"sources":["../../../../src/components/composites/suggestion/suggestion.tsx"],"sourcesContent":["import {\n createContext,\n createUniqueId,\n Show,\n splitProps,\n useContext,\n type ComponentProps,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { boundText } from '../sources/source'\n\n/**\n * Suggestions.\n *\n * A row of one-click prompts: each chip is the text that will be sent, so choosing\n * one is a single decision and never \"fill the composer, then still have to press\n * send\". What a chip *does* with its text — send it, drop it in the composer —\n * is the host's `onSelect`; this component only reports which one was chosen.\n *\n * - **Layout.** `wrap` (default) lets chips flow onto further lines, which is the\n * right behaviour at a narrow width. `scroll` keeps a single line that scrolls\n * sideways, for a bar above a composer that must not grow; the chips are real\n * buttons, so keyboard focus scrolls them into view and nothing depends on a\n * pointer to reach the overflow.\n * - **Long text is clipped, not hidden.** A chip is one line and truncates; the\n * full text is the button's accessible name and its `title`.\n * - **The host owns authority.** No `onSelect`, or a `disabledReason`, disables\n * every chip and says why in words under the row. Chips use `aria-disabled`\n * rather than `disabled`, so a keyboard or screen-reader user can still reach\n * them and hear the reason instead of finding a row that is silently skipped.\n */\nexport type SuggestionsProps = Omit<ComponentProps<'div'>, 'onSelect'> & {\n /** The row's accessible name. */\n label?: string\n layout?: 'wrap' | 'scroll'\n /** Called with the chosen chip's text. Without it every chip is disabled. */\n onSelect?: (text: string) => void\n /** Why the chips cannot be used right now. Implies disabled. */\n disabledReason?: string\n}\n\ntype SuggestionsContext = {\n select: (text: string) => void\n blocked: () => boolean\n reasonId: () => string | undefined\n}\n\nconst SuggestionsContext = createContext<SuggestionsContext>()\n\nexport function Suggestions(props: SuggestionsProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'layout',\n 'onSelect',\n 'disabledReason',\n 'children',\n ])\n const uid = createUniqueId()\n const reasonId = `${uid}-reason`\n const reason = () =>\n local.disabledReason\n ? boundText(local.disabledReason, 240)\n : local.onSelect === undefined\n ? 'Suggestions are not available here.'\n : undefined\n\n return (\n <SuggestionsContext.Provider\n value={{\n select: (text) => local.onSelect?.(text),\n blocked: () => reason() !== undefined,\n reasonId: () => (reason() ? reasonId : undefined),\n }}\n >\n <div data-slot=\"suggestions\" class=\"flex min-w-0 flex-col gap-1.5\">\n <div\n role=\"group\"\n aria-label={local.label ?? 'Suggested prompts'}\n class={cn(\n 'flex min-w-0 gap-2',\n {\n 'flex-wrap': local.layout !== 'scroll',\n // Padding below keeps the focus ring of a chip from being clipped by the scroller.\n 'flex-nowrap overflow-x-auto p-1 [&>*]:shrink-0': local.layout === 'scroll',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>\n <Show when={reason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {reason()}\n </p>\n </Show>\n </div>\n </SuggestionsContext.Provider>\n )\n}\n\nexport type SuggestionProps = Omit<ComponentProps<'button'>, 'onSelect' | 'children'> & {\n /** The text that is sent when the chip is chosen. Also the chip's name. */\n text: string\n}\n\nexport function Suggestion(props: SuggestionProps) {\n const [local, rest] = splitProps(props, ['class', 'text', 'onClick'])\n const context = useContext(SuggestionsContext)\n // A chip outside a `Suggestions` row has no handler to call: inert and honest.\n const blocked = () => context === undefined || context.blocked()\n const text = () => boundText(local.text, 400)\n\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n data-slot=\"suggestion\"\n title={text().length > 40 ? text() : undefined}\n aria-disabled={blocked() || undefined}\n aria-describedby={context?.reasonId()}\n class={cn('max-w-full', local.class)}\n onClick={(event) => {\n if (blocked()) {\n event.preventDefault()\n return\n }\n if (typeof local.onClick === 'function') local.onClick(event)\n // The host's own string, untouched: only the label is clipped, never what is sent.\n context?.select(local.text)\n }}\n {...rest}\n >\n <span class=\"truncate\">{text()}</span>\n </Button>\n )\n}\n"],"mappings":";;;;;;;;;AAgDA,IAAMgB,qBAAqBhB,cAAkC;AAE7D,SAAgBoB,YAAYC,OAAyB;CACnD,MAAM,CAACC,OAAOC,QAAQpB,WAAWkB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,MAAMF,WAAW,GADLlB,eACQuB,EAAG;CACvB,MAAMC,eACJH,MAAMP,iBACFP,UAAUc,MAAMP,gBAAgB,GAAG,IACnCO,MAAMT,aAAaa,KAAAA,IACjB,wCACAA,KAAAA;CAER,OAAAC,gBACGX,mBAAmBY,UAAQ;EAC1BC,OAAO;GACLZ,SAASH,SAASQ,MAAMT,WAAWC,IAAI;GACvCI,eAAeO,OAAO,MAAMC,KAAAA;GAC5BP,gBAAiBM,OAAO,IAAIN,WAAWO,KAAAA;EACzC;EAAC,IAAAI,WAAA;GAAA,IAAAC,OAAAC,QAAA,GAAAC,QAAAF,KAAAG;GAAAC,OAAAF,OAAAG,WAAA;IAAA,KAAA,gBAAA;KAAA,OAKed,MAAMX,SAAS;IAAmB;IAAA,KAAA,WAAA;KAAA,OACvCL,GACL,sBACA;MACE,aAAagB,MAAMV,WAAW;MAE9B,kDAAkDU,MAAMV,WAAW;KACrE,GACAU,MAAMgB,KACR;IAAC;GAAA,GACGf,IAAI,GAAA,OAAA,IAAA;GAAAgB,OAAAN,aAEPX,MAAMQ,QAAQ;GAAAS,OAAAR,MAAAJ,gBAEhBzB,MAAI;IAAA,IAACsC,OAAI;KAAA,OAAEf,OAAO;IAAC;IAAA,IAAAK,WAAA;KAAA,IAAAW,QAAAC,OAAA;KAAAC,aAAAF,OAAA,MACXtB,QAAQ;KAAAoB,OAAAE,OACZhB,MAAM;KAAA,OAAAgB;IAAA;GAAA,CAAA,GAAA,IAAA;GAAA,OAAAV;EAAA;CAAA,CAAA;AAMnB;AAOA,SAAgBc,WAAWxB,OAAwB;CACjD,MAAM,CAACC,OAAOC,QAAQpB,WAAWkB,OAAO;EAAC;EAAS;EAAQ;CAAS,CAAC;CACpE,MAAMyB,UAAU1C,WAAWY,kBAAkB;CAE7C,MAAME,gBAAgB4B,YAAYpB,KAAAA,KAAaoB,QAAQ5B,QAAQ;CAC/D,MAAMJ,aAAaN,UAAUc,MAAMR,MAAM,GAAG;CAE5C,OAAAa,gBACGpB,QAAM6B,WAAA;EACLW,MAAI;EACJC,SAAO;EACPC,MAAI;EAAA,aAAA;EAAA,IAEJC,QAAK;GAAA,OAAEC,WAAArC,KAAK,CAAC,CAACsC,SAAS,EAAE,CAAA,CAAA,IAAGtC,KAAK,IAAIY,KAAAA;EAAS;EAAA,KAAA,mBAAA;GAAA,OAC/BR,QAAQ,KAAKQ,KAAAA;EAAS;EAAA,KAAA,sBAAA;GAAA,OACnBoB,SAAS3B,SAAS;EAAC;EAAA,KAAA,WAAA;GAAA,OAC9Bb,GAAG,cAAcgB,MAAMgB,KAAK;EAAC;EACpCiB,UAAUC,UAAU;GAClB,IAAItC,QAAQ,GAAG;IACbsC,MAAMC,eAAe;IACrB;GACF;GACA,IAAI,OAAOnC,MAAMiC,YAAY,YAAYjC,MAAMiC,QAAQC,KAAK;GAE5DV,SAAS7B,OAAOK,MAAMR,IAAI;EAC5B;CAAC,GACGS,MAAI,EAAA,IAAAO,WAAA;EAAA,IAAA4B,QAAAC,QAAA;EAAApB,OAAAmB,OAEgB5C,IAAI;EAAA,OAAA4C;CAAA,EAAA,CAAA,CAAA;AAGlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/task/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,uBAAuB,EACvB,YAAY,EACZ,iBAAiB,EACjB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,SAAS,GACf,MAAM,QAAQ,CAAA"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { type ComponentProps, type JSX } from 'solid-js';
|
|
2
|
+
import { type AttachmentKind } from '../../ui/attachment';
|
|
3
|
+
import { type TraceLineProps } from '../../ui/trace';
|
|
4
|
+
/**
|
|
5
|
+
* Task.
|
|
6
|
+
*
|
|
7
|
+
* One piece of work the agent is doing, as a `TraceLine` that opens onto its
|
|
8
|
+
* items: a title, then a list in which each item is a sentence, optionally a
|
|
9
|
+
* status, and optionally the files it touched. Reach for `Plan` when the list is
|
|
10
|
+
* a proposal the person approves, for `Queue` when it is the agent's running
|
|
11
|
+
* todo list, and for a `Trace` of tool calls when the items are things that
|
|
12
|
+
* *ran* — a Task item is a statement about work, not a record of a call.
|
|
13
|
+
*
|
|
14
|
+
* ## Items wrap; lines do not
|
|
15
|
+
*
|
|
16
|
+
* A `TraceLine` truncates its title to one row, which is right for "Read
|
|
17
|
+
* src/app.tsx" and wrong for "Backfill locale from profile.language, falling
|
|
18
|
+
* back to en". Items are therefore their own rows with the same mark and colour
|
|
19
|
+
* vocabulary as a Trace line but wrapping text, clamped to three lines so a
|
|
20
|
+
* pasted paragraph cannot take the column. `TaskItemRow` and `TaskItemList` are
|
|
21
|
+
* exported because `Plan` and `Queue` are built from them.
|
|
22
|
+
*
|
|
23
|
+
* ## Status is a claim
|
|
24
|
+
*
|
|
25
|
+
* An item shows a mark and speaks a word only when the host supplied `status`.
|
|
26
|
+
* The "2 of 4 done" in the header is derived from those statuses and appears
|
|
27
|
+
* only if at least one item has one; items without a status are counted in the
|
|
28
|
+
* total and not in "done" (see `taskProgress`). A task with no items is a plain
|
|
29
|
+
* line: there is nothing to open, and an empty disclosure is a control that
|
|
30
|
+
* does nothing.
|
|
31
|
+
*
|
|
32
|
+
* ## Files are untrusted metadata
|
|
33
|
+
*
|
|
34
|
+
* File chips are `Attachment` chips with no handlers, so they are text: a name
|
|
35
|
+
* is never a link or a path. Past six, the rest sit behind one toggle button
|
|
36
|
+
* whose label changes in place, so keyboard focus survives opening and closing
|
|
37
|
+
* it.
|
|
38
|
+
*/
|
|
39
|
+
export type TaskItemStatus = 'complete' | 'active' | 'pending' | 'failed' | 'skipped';
|
|
40
|
+
export type TaskFile = Readonly<{
|
|
41
|
+
name: string;
|
|
42
|
+
kind?: AttachmentKind;
|
|
43
|
+
/** Bytes. */
|
|
44
|
+
size?: number;
|
|
45
|
+
}>;
|
|
46
|
+
export type TaskItem = Readonly<{
|
|
47
|
+
/** Only needed for the host's own bookkeeping; rows are kept by position. */
|
|
48
|
+
id?: string;
|
|
49
|
+
text: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
status?: TaskItemStatus;
|
|
52
|
+
files?: readonly TaskFile[];
|
|
53
|
+
}>;
|
|
54
|
+
/** The words spoken for each item status. */
|
|
55
|
+
export declare const TASK_ITEM_STATUS_LABELS: Readonly<Record<TaskItemStatus, string>>;
|
|
56
|
+
/**
|
|
57
|
+
* How many items are done, or nothing at all when no item carries a status.
|
|
58
|
+
* Items without a status count toward the total: the host did not say they were
|
|
59
|
+
* finished, so they are not.
|
|
60
|
+
*/
|
|
61
|
+
export declare function taskProgress(items: readonly Pick<TaskItem, 'status'>[]): Readonly<{
|
|
62
|
+
done: number;
|
|
63
|
+
total: number;
|
|
64
|
+
}> | undefined;
|
|
65
|
+
/** `2 of 4 done`, in words. */
|
|
66
|
+
export declare function taskProgressLabel(progress: {
|
|
67
|
+
done: number;
|
|
68
|
+
total: number;
|
|
69
|
+
}): string;
|
|
70
|
+
export type TaskItemRowProps = Omit<ComponentProps<'li'>, 'children'> & {
|
|
71
|
+
text: string;
|
|
72
|
+
description?: string;
|
|
73
|
+
status?: TaskItemStatus;
|
|
74
|
+
files?: readonly TaskFile[];
|
|
75
|
+
/** Spoken in place of the default status word. */
|
|
76
|
+
statusLabel?: string;
|
|
77
|
+
};
|
|
78
|
+
export declare function TaskItemRow(props: TaskItemRowProps): JSX.Element;
|
|
79
|
+
export type TaskItemListProps = Omit<ComponentProps<'div'>, 'children'> & {
|
|
80
|
+
/** The list's accessible name. A scrolling region without one is an unlabelled tab stop. */
|
|
81
|
+
label: string;
|
|
82
|
+
children?: JSX.Element;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* The items, bounded. Two hundred todo items must scroll inside their line and
|
|
86
|
+
* not push the answer out of view; the region is keyboard-focusable and named,
|
|
87
|
+
* which is what makes the overflow reachable without a pointer.
|
|
88
|
+
*/
|
|
89
|
+
export declare function TaskItemList(props: TaskItemListProps): JSX.Element;
|
|
90
|
+
export type TaskProps = Omit<TraceLineProps, 'description' | 'href' | 'onSelect' | 'selectHaspopup' | 'children'> & {
|
|
91
|
+
items: readonly TaskItem[];
|
|
92
|
+
/** The item list's accessible name. Defaults to the title when it is a string. */
|
|
93
|
+
itemsLabel?: string;
|
|
94
|
+
};
|
|
95
|
+
export declare function Task(props: TaskProps): JSX.Element;
|
|
96
|
+
//# sourceMappingURL=task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/task/task.tsx"],"names":[],"mappings":"AAQA,OAAO,EAOL,KAAK,cAAc,EACnB,KAAK,GAAG,EACT,MAAM,UAAU,CAAA;AAEjB,OAAO,EAA8B,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAGrF,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAK/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAA;AAErF,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,aAAa;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC;IAC9B,6EAA6E;IAC7E,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,KAAK,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAA;CAC5B,CAAC,CAAA;AAEF,6CAA6C;AAC7C,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAM5E,CAAA;AAWD;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,GACzC,QAAQ,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,SAAS,CAMvD;AAED,+BAA+B;AAC/B,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEnF;AAyCD,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,GAAG;IACtE,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,KAAK,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAA;IAC3B,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,eA2ElD;AAED,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACxE,4FAA4F;IAC5F,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACvB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eAcpD;AAED,MAAM,MAAM,SAAS,GAAG,IAAI,CAC1B,cAAc,EACd,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,gBAAgB,GAAG,UAAU,CACpE,GAAG;IACF,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAA;IAC1B,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,eAqCpC"}
|