@kitn.ai/ui 0.28.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -7
- package/dist/{Icon-DObhsRtm.js → Icon-BzBET3E-.js} +1 -1
- package/dist/{action-icons-CcgNN2oT.js → action-icons-DaW2pU6m.js} +1 -1
- package/dist/agent-tooling/construct/public.d.ts +15 -0
- package/dist/agent-tooling/construct/schema.d.ts +111 -0
- package/dist/arrow-down-D783iMJj.js +1 -0
- package/dist/arrow-left-0VLM5kyg.js +1 -0
- package/dist/artifact-DGjzHYUT.js +1 -0
- package/dist/{attachments-Qr4kg-2b.js → attachments-YvXHlg88.js} +1 -1
- package/dist/{audio-visualizer-DToYdfSc.js → audio-visualizer-9lz5IHsL.js} +1 -1
- package/dist/{badge-CdEu_jn2.js → badge-Dh_vp8A5.js} +1 -1
- package/dist/{bell-DQAAOpDz.js → bell-CT7_WUwS.js} +1 -1
- package/dist/{button-DkuOnGLy.js → button-C_3te6fm.js} +1 -1
- package/dist/{card-renderer-Jx70m6_l.js → card-renderer-DZVaGH2e.js} +1 -1
- package/dist/check-CiEOVnEN.js +1 -0
- package/dist/{checkbox-D7iRB3nL.js → checkbox-Bu2T2e0U.js} +1 -1
- package/dist/{checkbox-group-B2_rpoPM.js → checkbox-group-BiryEXPQ.js} +1 -1
- package/dist/chevron-down-CSobuZRG.js +1 -0
- package/dist/chevron-right-DR9ZAP-2.js +1 -0
- package/dist/{choice-card-m0BYqqOK.js → choice-card-CM6IjkmL.js} +1 -1
- package/dist/circle-BC66EYF7.js +1 -0
- package/dist/circle-check-BqmahW0O.js +1 -0
- package/dist/{circle-x-BPG0iPst.js → circle-x-Bk-dA5Wf.js} +1 -1
- package/dist/{code-block-ClMLKb7C.js → code-block-B26t-Q7q.js} +1 -1
- package/dist/{collapsible-B4DlWicL.js → collapsible-Bhc636Cf.js} +1 -1
- package/dist/components/builder-composer-triggers.d.ts +62 -0
- package/dist/components/builder-layout.d.ts +54 -0
- package/dist/components/builder-message-actions.d.ts +72 -0
- package/dist/components/builder-panel.d.ts +189 -0
- package/dist/components/builder-preview.d.ts +11 -0
- package/dist/components/builder-shell-controls.d.ts +69 -0
- package/dist/components/builder-skeleton.d.ts +58 -0
- package/dist/components/builder-start.d.ts +75 -0
- package/dist/components/builder-workspace-variants.d.ts +23 -0
- package/dist/components/captions.d.ts +66 -0
- package/dist/{composer-sQ0HcvyG.js → composer-DMI85B6j.js} +1 -1
- package/dist/{confirm-card-rQWDQsnC.js → confirm-card-B0YIAwXp.js} +1 -1
- package/dist/construct-cli.es.js +3 -3
- package/dist/construct.d.ts +5 -0
- package/dist/construct.js +327 -0
- package/dist/{context-0kg4ZX1J.js → context-DWgfhqWp.js} +1 -1
- package/dist/controllable-BagRpyHv.js +1 -0
- package/dist/{conversation-item-BxwQLaFJ.js → conversation-item-BsOsVGmT.js} +1 -1
- package/dist/{conversation-list-BCfGN1JU.js → conversation-list-aX3Vtc7L.js} +1 -1
- package/dist/{copy-n9u9rqpi.js → copy-BmEwsNhJ.js} +1 -1
- package/dist/core-C8fzo39E.js +1 -12
- package/dist/{create-tween-uPkArjIG.js → create-tween-CNOAU3Fx.js} +1 -1
- package/dist/{create-tween-C-q-JCM-.js → create-tween-WfqiENls.js} +1 -1
- package/dist/{create-tween-CRrJXxBd.js → create-tween-wlFtW9Kh.js} +1 -1
- package/dist/{create-tween-DZ3RRDHD.js → create-tween-zt79ba32.js} +1 -1
- package/dist/{default-input-CaMrJkgH.js → default-input-DMV5Eaze.js} +1 -1
- package/dist/define-CI0y3eE4.js +1 -0
- package/dist/define.js +40 -40
- package/dist/define.server.js +45 -45
- package/dist/{disclosure-WUImBbDv.js → disclosure-NnACBxsC.js} +1 -1
- package/dist/{dropdown-wZVeJOMd.js → dropdown-DT7G0RGR.js} +1 -1
- package/dist/elements/agent-card.js +1 -1
- package/dist/elements/artifact.js +1 -1
- package/dist/elements/attachments.js +1 -1
- package/dist/elements/audio-visualizer.js +1 -1
- package/dist/elements/avatar.js +1 -1
- package/dist/elements/badge.js +1 -1
- package/dist/elements/button.js +1 -1
- package/dist/elements/card.js +1 -1
- package/dist/elements/cards.js +1 -1
- package/dist/elements/chain-of-thought.js +1 -1
- package/dist/elements/chat-scope-picker.js +1 -1
- package/dist/elements/chat-workspace.js +1 -1
- package/dist/elements/chat.js +1 -1
- package/dist/elements/checkbox-group.js +1 -1
- package/dist/elements/checkbox.js +1 -1
- package/dist/elements/checkpoint.js +1 -1
- package/dist/elements/choice.js +1 -1
- package/dist/elements/coachmark.js +1 -1
- package/dist/elements/code-block.js +1 -1
- package/dist/elements/command.js +1 -1
- package/dist/elements/compare.js +1 -1
- package/dist/elements/composer.js +1 -1
- package/dist/elements/confirm-card.js +1 -1
- package/dist/elements/context-meter.js +1 -1
- package/dist/elements/conversation-item.js +1 -1
- package/dist/elements/conversation-list.js +1 -1
- package/dist/elements/dialog.js +1 -1
- package/dist/elements/dock.js +1 -1
- package/dist/elements/dropdown.js +1 -1
- package/dist/elements/editable-label.js +1 -1
- package/dist/elements/embed.js +1 -1
- package/dist/elements/empty.js +1 -1
- package/dist/elements/feedback-bar.js +1 -1
- package/dist/elements/file-tree.js +1 -1
- package/dist/elements/file-upload.js +1 -1
- package/dist/elements/form.js +1 -1
- package/dist/elements/hover-card.js +1 -1
- package/dist/elements/icon.js +1 -1
- package/dist/elements/image.js +1 -1
- package/dist/elements/input.js +1 -1
- package/dist/elements/kbd.js +1 -1
- package/dist/elements/link-preview.js +1 -1
- package/dist/elements/loader.js +1 -1
- package/dist/elements/markdown.js +1 -1
- package/dist/elements/menu.js +1 -1
- package/dist/elements/message-skills.js +1 -1
- package/dist/elements/message.js +1 -1
- package/dist/elements/model-switcher.js +1 -1
- package/dist/elements/nav.js +1 -1
- package/dist/elements/notice.js +1 -1
- package/dist/elements/pane-grid.js +1 -1
- package/dist/elements/pane-group.js +1 -1
- package/dist/elements/pane.js +1 -1
- package/dist/elements/popover.js +1 -1
- package/dist/elements/progress-bar.js +1 -1
- package/dist/elements/prompt-dock.js +1 -1
- package/dist/elements/prompt-input.js +1 -1
- package/dist/elements/prompt-suggestions.js +1 -1
- package/dist/elements/radio-group.js +1 -1
- package/dist/elements/reasoning.js +1 -1
- package/dist/elements/remote.js +1 -1
- package/dist/elements/resizable.js +1 -1
- package/dist/elements/response-stream.js +1 -1
- package/dist/elements/screen.js +1 -1
- package/dist/elements/scroll-area.js +1 -1
- package/dist/elements/scroll-button.js +1 -1
- package/dist/elements/search.js +1 -1
- package/dist/elements/segmented.js +1 -1
- package/dist/elements/select.js +1 -1
- package/dist/elements/separator.js +1 -1
- package/dist/elements/setting-item.js +1 -1
- package/dist/elements/settings-group.js +1 -1
- package/dist/elements/skeleton.js +1 -1
- package/dist/elements/slider.js +1 -1
- package/dist/elements/source.js +1 -1
- package/dist/elements/status.js +1 -1
- package/dist/elements/switch.js +1 -1
- package/dist/elements/tabs.js +1 -1
- package/dist/elements/tasks.js +1 -1
- package/dist/elements/text-shimmer.js +1 -1
- package/dist/elements/thinking-bar.js +1 -1
- package/dist/elements/thread.js +1 -1
- package/dist/elements/toast.js +1 -1
- package/dist/elements/tool.js +1 -1
- package/dist/elements/tooltip.js +1 -1
- package/dist/elements/voice-input.js +1 -1
- package/dist/elements/voice-output.js +1 -1
- package/dist/{ellipsis-CbOpJnU3.js → ellipsis-6pJ7SxYT.js} +1 -1
- package/dist/{embed-CrfjkbUG.js → embed-BMje-nxj.js} +1 -1
- package/dist/engine-javascript-C1x7zo1_.js +1 -141
- package/dist/{external-link-ByXAwBBQ.js → external-link-Beh9DKeR.js} +1 -1
- package/dist/{file-text-DMib2qwt.js → file-text-D1GPfZ8Q.js} +1 -1
- package/dist/{file-tree-CJqM2aP7.js → file-tree-Dwj2lqg-.js} +1 -1
- package/dist/{folder-_BAb929C.js → folder-b6D8x1DY.js} +1 -1
- package/dist/{form-DSZgZQZk.js → form-DWgdxDXu.js} +1 -1
- package/dist/{hover-card-BQbul9eq.js → hover-card-CWRkqm40.js} +1 -1
- package/dist/{icon-CdcfRhYI.js → icon-CL0jdhsf.js} +1 -1
- package/dist/index.js +1741 -1725
- package/dist/index.server.js +1582 -1566
- package/dist/{info-DsFjGuI_.js → info-0cOUherQ.js} +1 -1
- package/dist/{input-DKbmkMos.js → input-BH6Ru91Q.js} +1 -1
- package/dist/kai.es.js +1 -1
- package/dist/{kbd-PvdGhX4s.js → kbd-DRAnVtNX.js} +1 -1
- package/dist/{link-zF8PzWfF.js → link-Dlr0vssB.js} +1 -1
- package/dist/{link-preview-DbM1866N.js → link-preview-DODgRyV9.js} +1 -1
- package/dist/loader-KvJB6NrT.js +1 -0
- package/dist/{markdown-LMvmAyBk.js → markdown-DX9tuJVj.js} +1 -1
- package/dist/mcp.es.js +9 -5
- package/dist/{message-BYZECyek.js → message-BqQ7Ot5q.js} +1 -1
- package/dist/{message-BSsgvHvf.js → message-DkaGfBd8.js} +1 -1
- package/dist/message-circle-BPpp5QKv.js +1 -0
- package/dist/message-square-BLbsd9BJ.js +1 -0
- package/dist/{minimize-2-BQRoBV1V.js → minimize-2-CyOHJwcN.js} +1 -1
- package/dist/{model-switcher-CMpCOYcB.js → model-switcher-0hrKDiK2.js} +1 -1
- package/dist/{overlay-Cb-MkyDa.js → overlay-DBMFXie6.js} +1 -1
- package/dist/{panel-right-i8warFxT.js → panel-right-t8SWJL6e.js} +1 -1
- package/dist/{paperclip-ByY3UVO6.js → paperclip-CdzuOjbU.js} +1 -1
- package/dist/play-BXy1u7rW.js +1 -0
- package/dist/primitives/use-auto-resize.d.ts +11 -0
- package/dist/{progress-bar-jVAHvMUf.js → progress-bar-CiBtxMWT.js} +1 -1
- package/dist/{prompt-suggestion-CD-qtNgC.js → prompt-suggestion-I_DHP21i.js} +1 -1
- package/dist/{radio-BsoBMhkF.js → radio-C_p3n39l.js} +1 -1
- package/dist/{reasoning-4kBPtlTx.js → reasoning-BDwy_tIe.js} +1 -1
- package/dist/register-impl-DvEnhIxx.js +424 -0
- package/dist/{resizable-uPmY9VY-.js → resizable-SYC-fStM.js} +1 -1
- package/dist/{rotate-ccw-B2xn93py.js → rotate-ccw-B1nwmwuY.js} +1 -1
- package/dist/{rotate-cw-CMVLoCyH.js → rotate-cw-CLAnBcm1.js} +1 -1
- package/dist/{scroll-area-BqLUo8ZZ.js → scroll-area-zRyXoLhI.js} +1 -1
- package/dist/{scroll-button-DslXiJyL.js → scroll-button-jzrbYCG9.js} +1 -1
- package/dist/{select-2cLRtPGT.js → select-DM-0nEe0.js} +1 -1
- package/dist/{separator-BWQtNJcM.js → separator-BToOOoOt.js} +1 -1
- package/dist/{settings-BBR63jLg.js → settings-PaGo_S4U.js} +1 -1
- package/dist/{settings-group-B2ciy-Iw.js → settings-group-BFXGIfXq.js} +1 -1
- package/dist/{skeleton-CkHI-HgC.js → skeleton-DYpmFnnm.js} +1 -1
- package/dist/{slider-DDR9U-i0.js → slider-ebutAmkQ.js} +1 -1
- package/dist/{solid-DruVOXnf.js → solid-15v_3WVL.js} +3563 -3412
- package/dist/{solid-BzCFdL25.js → solid-5P-otgdi.js} +4502 -4296
- package/dist/solid.d.ts +6 -0
- package/dist/solid.js +259 -254
- package/dist/solid.server.js +259 -254
- package/dist/{source-GEnFF528.js → source-c1gpRl9h.js} +1 -1
- package/dist/{star-CilHq8GP.js → star-pcV_3LqF.js} +1 -1
- package/dist/{store-Ciyk6eZG.js → store-CSgbFFCg.js} +1 -1
- package/dist/{switch-KkeQIbuH.js → switch-Bh2OdLV2.js} +1 -1
- package/dist/{tasks-card-BrN4bggJ.js → tasks-card-CbqQAn2S.js} +1 -1
- package/dist/text-shimmer-BSzgEnDH.js +1 -0
- package/dist/textarea-DrYNt_0z.js +1 -0
- package/dist/theme.tokens.css +22 -21
- package/dist/{thumbs-up-CsT9Wzb9.js → thumbs-up-BL3-NenK.js} +1 -1
- package/dist/{toast-store-tgK6MuMv.js → toast-store-DkOlYczt.js} +1 -1
- package/dist/{tool-DzUjIBT8.js → tool-CeIWUVUe.js} +1 -1
- package/dist/{tooltip-Bkkg_4t0.js → tooltip-GA-nmg06.js} +1 -1
- package/dist/{trash-2-jBKxjGGQ.js → trash-2-CT66QWlm.js} +1 -1
- package/dist/{triangle-alert-DlQ68ppf.js → triangle-alert-CeHLWxhD.js} +1 -1
- package/dist/ui/color-field.d.ts +48 -0
- package/dist/ui/textarea.d.ts +4 -0
- package/dist/ui/toggle-chip.d.ts +40 -0
- package/dist/{upload-TcAHXv9W.js → upload-9Csb0F0J.js} +1 -1
- package/dist/{use-card-resolution-DaZqAdWf.js → use-card-resolution-Zg0a08Z-.js} +1 -1
- package/dist/{variant-aurora-DbW_OWL2.js → variant-aurora-4VBQHIKV.js} +1 -1
- package/dist/{variant-aurora-CNmfHhcx.js → variant-aurora-DBeCAQNk.js} +2 -2
- package/dist/{variant-aurora-D6GsdTPA.js → variant-aurora-FzHVXHby.js} +2 -2
- package/dist/{variant-aurora-BhLuYxJR.js → variant-aurora-LE3fqxgw.js} +1 -1
- package/dist/{variant-custom-BvYHR62b.js → variant-custom-AFRGcOBS.js} +1 -1
- package/dist/{variant-custom-DV2x254s.js → variant-custom-BQkNuPpE.js} +2 -2
- package/dist/{variant-custom-BRvaNHSi.js → variant-custom-DI5R0rln.js} +1 -1
- package/dist/{variant-custom-DMTrEO5w.js → variant-custom-WWnrrRHS.js} +2 -2
- package/dist/{variant-wave-CyBueXj9.js → variant-wave-DUCbH5oI.js} +2 -2
- package/dist/{variant-wave-BNMGrDfj.js → variant-wave-DuQV7DhQ.js} +2 -2
- package/dist/{variant-wave-BpDd8t3Z.js → variant-wave-nSI2sfII.js} +1 -1
- package/dist/{variant-wave-sp-qwsdI.js → variant-wave-wTP5v_jU.js} +1 -1
- package/dist/x-eiO9V6J6.js +1 -0
- package/{src/elements/styles.css → kit-base.css} +27 -44
- package/package.json +32 -17
- package/solid.css +33 -0
- package/theme.css +39 -23
- package/bin/route.test.js +0 -58
- package/dist/arrow-down-CjRU3JgV.js +0 -1
- package/dist/arrow-left-Bnpb1UEW.js +0 -1
- package/dist/artifact-Bwt7OgcR.js +0 -1
- package/dist/check-njkVdZu2.js +0 -1
- package/dist/chevron-down-B72s6PXR.js +0 -1
- package/dist/chevron-right-BatuHzUm.js +0 -1
- package/dist/circle-check-B62pODB3.js +0 -1
- package/dist/circle-zx0ByzY9.js +0 -1
- package/dist/controllable-CnGpMF6r.js +0 -1
- package/dist/define-By-uL588.js +0 -1
- package/dist/loader-BM4CEz4G.js +0 -1
- package/dist/message-circle-DruwObfX.js +0 -1
- package/dist/message-square-BG6q6mlm.js +0 -1
- package/dist/play-BvKKq3fX.js +0 -1
- package/dist/register-impl-B1hLkrI8.js +0 -424
- package/dist/text-shimmer-Dcj1MHuq.js +0 -1
- package/dist/textarea-Dpvbngbg.js +0 -1
- package/dist/x-Z5UntkIJ.js +0 -1
- package/src/agent-tooling/README.md +0 -192
- package/src/agent-tooling/archetypes.ts +0 -205
- package/src/agent-tooling/catalog/README.md +0 -676
- package/src/agent-tooling/catalog/catalog-types.ts +0 -231
- package/src/agent-tooling/catalog/fabrications.ts +0 -96
- package/src/agent-tooling/catalog/invariants.ts +0 -284
- package/src/agent-tooling/catalog/labs-titles.ts +0 -114
- package/src/agent-tooling/catalog/scenarios.ts +0 -87
- package/src/agent-tooling/catalog/surfaces.ts +0 -347
- package/src/agent-tooling/construct/cli-entry.ts +0 -8
- package/src/agent-tooling/construct/cli.ts +0 -147
- package/src/agent-tooling/construct/codegen.ts +0 -1635
- package/src/agent-tooling/construct/construct.v1.schema.json +0 -319
- package/src/agent-tooling/construct/dev.ts +0 -148
- package/src/agent-tooling/construct/fixtures/demo-widget.construct.json +0 -7
- package/src/agent-tooling/construct/fixtures/ops-console.construct.json +0 -44
- package/src/agent-tooling/construct/fixtures/owner-widget.construct.json +0 -32
- package/src/agent-tooling/construct/schema.ts +0 -452
- package/src/agent-tooling/integrations/anthropic.ts +0 -442
- package/src/agent-tooling/integrations/cloudflare.ts +0 -218
- package/src/agent-tooling/integrations/langgraph.ts +0 -133
- package/src/agent-tooling/integrations/mastra.ts +0 -182
- package/src/agent-tooling/integrations/mock.ts +0 -148
- package/src/agent-tooling/integrations/ollama.ts +0 -97
- package/src/agent-tooling/integrations/openai.ts +0 -95
- package/src/agent-tooling/integrations/openrouter.ts +0 -82
- package/src/agent-tooling/integrations/pi.ts +0 -176
- package/src/agent-tooling/integrations/pydantic-ai.ts +0 -108
- package/src/agent-tooling/integrations/vercel-ai-sdk.ts +0 -398
- package/src/agent-tooling/mcp/css-raw.d.ts +0 -12
- package/src/agent-tooling/mcp/manifest.ts +0 -422
- package/src/agent-tooling/mcp/server.ts +0 -116
- package/src/agent-tooling/mcp/stdio.ts +0 -18
- package/src/agent-tooling/mcp/tools/construct.ts +0 -130
- package/src/agent-tooling/mcp/tools/debug.ts +0 -621
- package/src/agent-tooling/mcp/tools/reference.ts +0 -980
- package/src/agent-tooling/mcp/tools/scaffold.ts +0 -6708
- package/src/agent-tooling/mcp/tools/theme.ts +0 -456
- package/src/agent-tooling/mcp/tools/types.ts +0 -14
- package/src/agent-tooling/mcp/validate-args.ts +0 -141
- package/src/agent-tooling/recipes/composed-thread.ts +0 -714
- package/src/agent-tooling/recipes/index.ts +0 -22
- package/src/agent-tooling/recipes/types.ts +0 -32
- package/src/agent-tooling/registry.ts +0 -132
- package/src/agent-tooling/route-emit.ts +0 -305
- package/src/agent-tooling/types.ts +0 -390
- package/src/components/artifact-card.tsx +0 -120
- package/src/components/artifact.tsx +0 -914
- package/src/components/attachment-types.ts +0 -66
- package/src/components/attachments.tsx +0 -536
- package/src/components/audio-visualizer/audio-visualizer.voice-fixture.ts +0 -257
- package/src/components/audio-visualizer/aurora.glsl.ts +0 -330
- package/src/components/audio-visualizer/fit-scale.ts +0 -112
- package/src/components/audio-visualizer/index.tsx +0 -528
- package/src/components/audio-visualizer/labs/lab-choreography.ts +0 -187
- package/src/components/audio-visualizer/labs/lab-shaders.ts +0 -363
- package/src/components/audio-visualizer/labs/lab-visualizer.tsx +0 -102
- package/src/components/audio-visualizer/shader-canvas.tsx +0 -876
- package/src/components/audio-visualizer/sizes.ts +0 -54
- package/src/components/audio-visualizer/variant-aurora.tsx +0 -305
- package/src/components/audio-visualizer/variant-bar.tsx +0 -175
- package/src/components/audio-visualizer/variant-custom.tsx +0 -344
- package/src/components/audio-visualizer/variant-grid.tsx +0 -175
- package/src/components/audio-visualizer/variant-radial.tsx +0 -163
- package/src/components/audio-visualizer/variant-wave.tsx +0 -130
- package/src/components/audio-visualizer/wave.glsl.ts +0 -130
- package/src/components/card-fallback.tsx +0 -60
- package/src/components/card-renderer.tsx +0 -220
- package/src/components/card.tsx +0 -212
- package/src/components/chain-of-thought.tsx +0 -348
- package/src/components/chat-container.tsx +0 -89
- package/src/components/chat-scope-picker.tsx +0 -57
- package/src/components/chat-thread.tsx +0 -1014
- package/src/components/checkpoint.tsx +0 -88
- package/src/components/choice-card.tsx +0 -743
- package/src/components/coachmark.tsx +0 -249
- package/src/components/code-block.tsx +0 -181
- package/src/components/composer-dom.ts +0 -159
- package/src/components/composer-highlight.ts +0 -242
- package/src/components/composer-history.ts +0 -82
- package/src/components/composer.tsx +0 -1075
- package/src/components/confirm-card.tsx +0 -402
- package/src/components/context.tsx +0 -377
- package/src/components/conversation-item.tsx +0 -241
- package/src/components/conversation-list.tsx +0 -429
- package/src/components/conversation-panel.tsx +0 -118
- package/src/components/dismissed-stub.tsx +0 -80
- package/src/components/embed.tsx +0 -200
- package/src/components/empty.tsx +0 -177
- package/src/components/feedback-bar.tsx +0 -166
- package/src/components/file-tree.tsx +0 -530
- package/src/components/file-upload.tsx +0 -167
- package/src/components/form-widgets.tsx +0 -525
- package/src/components/form.tsx +0 -1296
- package/src/components/home-panel.tsx +0 -159
- package/src/components/image.tsx +0 -65
- package/src/components/link-preview.tsx +0 -195
- package/src/components/loader.tsx +0 -367
- package/src/components/markdown.tsx +0 -162
- package/src/components/message-skills.tsx +0 -40
- package/src/components/message.tsx +0 -765
- package/src/components/model-switcher.tsx +0 -132
- package/src/components/prompt-input.tsx +0 -188
- package/src/components/prompt-suggestion.tsx +0 -150
- package/src/components/reasoning.tsx +0 -293
- package/src/components/response-compare-types.ts +0 -152
- package/src/components/response-compare.tsx +0 -455
- package/src/components/response-stream.tsx +0 -109
- package/src/components/screen.tsx +0 -181
- package/src/components/scroll-button.tsx +0 -93
- package/src/components/source.tsx +0 -192
- package/src/components/tasks-card.tsx +0 -801
- package/src/components/text-shimmer.tsx +0 -37
- package/src/components/thinking-bar.tsx +0 -50
- package/src/components/thread.tsx +0 -228
- package/src/components/toast.tsx +0 -503
- package/src/components/tool-classify.ts +0 -26
- package/src/components/tool-types.ts +0 -49
- package/src/components/tool.tsx +0 -190
- package/src/components/use-card-resolution.ts +0 -44
- package/src/components/voice-input.tsx +0 -222
- package/src/components/voice-output.tsx +0 -242
- package/src/components/widget-tab-bar.tsx +0 -73
- package/src/components/workspace-shell.tsx +0 -285
- package/src/diagnostics/hook.ts +0 -352
- package/src/diagnostics/index.ts +0 -82
- package/src/diagnostics/report-request.ts +0 -296
- package/src/elements/agent-card.tsx +0 -67
- package/src/elements/artifact.tsx +0 -194
- package/src/elements/attachments.tsx +0 -140
- package/src/elements/audio-visualizer.tsx +0 -227
- package/src/elements/autoloader.ts +0 -89
- package/src/elements/avatar.tsx +0 -33
- package/src/elements/badge.tsx +0 -32
- package/src/elements/button.tsx +0 -149
- package/src/elements/card.tsx +0 -133
- package/src/elements/cards.tsx +0 -266
- package/src/elements/chain-of-thought.tsx +0 -141
- package/src/elements/chat-scope-picker.tsx +0 -65
- package/src/elements/chat-types.ts +0 -102
- package/src/elements/chat-workspace.tsx +0 -188
- package/src/elements/chat.tsx +0 -304
- package/src/elements/checkbox-group.tsx +0 -164
- package/src/elements/checkbox.tsx +0 -134
- package/src/elements/checkpoint.tsx +0 -47
- package/src/elements/choice.tsx +0 -100
- package/src/elements/coachmark.tsx +0 -90
- package/src/elements/code-block.tsx +0 -60
- package/src/elements/command.tsx +0 -197
- package/src/elements/compare.tsx +0 -111
- package/src/elements/compiled.css +0 -2
- package/src/elements/composer.tsx +0 -162
- package/src/elements/confirm-card.tsx +0 -76
- package/src/elements/context-meter.tsx +0 -107
- package/src/elements/conversation-item.tsx +0 -120
- package/src/elements/conversation-list.tsx +0 -203
- package/src/elements/css.ts +0 -5
- package/src/elements/default-input.tsx +0 -392
- package/src/elements/define-entry.ts +0 -12
- package/src/elements/define.tsx +0 -563
- package/src/elements/diagnostic-events.ts +0 -114
- package/src/elements/dialog.tsx +0 -145
- package/src/elements/disclosure.ts +0 -95
- package/src/elements/dock.tsx +0 -215
- package/src/elements/dropdown.tsx +0 -123
- package/src/elements/editable-label.tsx +0 -140
- package/src/elements/element-data-types.ts +0 -152
- package/src/elements/element-diagnostics.ts +0 -392
- package/src/elements/element-manifest.json +0 -354
- package/src/elements/element-nonscalar.json +0 -187
- package/src/elements/element-types.d.ts +0 -4353
- package/src/elements/embed.tsx +0 -35
- package/src/elements/empty.tsx +0 -29
- package/src/elements/feedback-bar.tsx +0 -66
- package/src/elements/file-tree.tsx +0 -62
- package/src/elements/file-upload.tsx +0 -44
- package/src/elements/form.tsx +0 -94
- package/src/elements/hover-card.tsx +0 -80
- package/src/elements/icon.tsx +0 -41
- package/src/elements/image.tsx +0 -32
- package/src/elements/input.tsx +0 -492
- package/src/elements/kbd.tsx +0 -45
- package/src/elements/link-preview.tsx +0 -34
- package/src/elements/loader.tsx +0 -25
- package/src/elements/markdown.tsx +0 -38
- package/src/elements/menu.tsx +0 -241
- package/src/elements/message-skills.tsx +0 -83
- package/src/elements/message.tsx +0 -361
- package/src/elements/model-switcher.tsx +0 -121
- package/src/elements/nav.tsx +0 -87
- package/src/elements/notice.tsx +0 -53
- package/src/elements/pane-grid.tsx +0 -111
- package/src/elements/pane-group.tsx +0 -119
- package/src/elements/pane.tsx +0 -129
- package/src/elements/popover.tsx +0 -81
- package/src/elements/progress-bar.tsx +0 -39
- package/src/elements/prompt-dock.tsx +0 -82
- package/src/elements/prompt-input.tsx +0 -240
- package/src/elements/prompt-suggestions.tsx +0 -113
- package/src/elements/radio-group.tsx +0 -129
- package/src/elements/reasoning.tsx +0 -71
- package/src/elements/register-impl.ts +0 -148
- package/src/elements/register.ts +0 -76
- package/src/elements/remote.tsx +0 -225
- package/src/elements/resizable.globals.d.ts +0 -36
- package/src/elements/resizable.tsx +0 -704
- package/src/elements/response-stream.tsx +0 -40
- package/src/elements/screen.tsx +0 -90
- package/src/elements/scroll-area.tsx +0 -33
- package/src/elements/scroll-button.tsx +0 -179
- package/src/elements/search.tsx +0 -185
- package/src/elements/segmented.tsx +0 -129
- package/src/elements/select.tsx +0 -165
- package/src/elements/separator.tsx +0 -36
- package/src/elements/setting-item.tsx +0 -50
- package/src/elements/settings-group.tsx +0 -37
- package/src/elements/skeleton.tsx +0 -45
- package/src/elements/slider.tsx +0 -171
- package/src/elements/slot-text.ts +0 -73
- package/src/elements/slots.ts +0 -787
- package/src/elements/source.tsx +0 -126
- package/src/elements/status.tsx +0 -42
- package/src/elements/switch.tsx +0 -118
- package/src/elements/tabs.tsx +0 -95
- package/src/elements/tasks.tsx +0 -103
- package/src/elements/text-shimmer.tsx +0 -28
- package/src/elements/thinking-bar.tsx +0 -43
- package/src/elements/thread.tsx +0 -139
- package/src/elements/toast.tsx +0 -106
- package/src/elements/tool.tsx +0 -78
- package/src/elements/tooltip.tsx +0 -85
- package/src/elements/validate-messages.ts +0 -76
- package/src/elements/voice-input.tsx +0 -100
- package/src/elements/voice-output.tsx +0 -82
- package/src/index.ts +0 -430
- package/src/primitives/audio-bands.ts +0 -174
- package/src/primitives/card-component-types.ts +0 -63
- package/src/primitives/card-contract.ts +0 -80
- package/src/primitives/card-data-types.ts +0 -361
- package/src/primitives/card-host.tsx +0 -37
- package/src/primitives/card-recovery.ts +0 -160
- package/src/primitives/card-registry.tsx +0 -78
- package/src/primitives/card-resolution.ts +0 -36
- package/src/primitives/card-routing.ts +0 -85
- package/src/primitives/card-schemas/artifact.schema.json +0 -92
- package/src/primitives/card-schemas/card-envelope.schema.json +0 -14
- package/src/primitives/card-schemas/card-event.schema.json +0 -12
- package/src/primitives/card-schemas/choice.schema.json +0 -75
- package/src/primitives/card-schemas/confirm.schema.json +0 -65
- package/src/primitives/card-schemas/embed.schema.json +0 -63
- package/src/primitives/card-schemas/form.result.schema.json +0 -7
- package/src/primitives/card-schemas/form.schema.json +0 -53
- package/src/primitives/card-schemas/link.schema.json +0 -54
- package/src/primitives/card-schemas/tasks.result.schema.json +0 -16
- package/src/primitives/card-schemas/tasks.schema.json +0 -83
- package/src/primitives/card-tags.ts +0 -61
- package/src/primitives/card-validate-cards.ts +0 -255
- package/src/primitives/card-validate-schemas.ts +0 -58
- package/src/primitives/card-validate.ts +0 -131
- package/src/primitives/chat-config.tsx +0 -103
- package/src/primitives/composer-model.ts +0 -49
- package/src/primitives/composer-triggers.ts +0 -35
- package/src/primitives/controllable.ts +0 -21
- package/src/primitives/conversation-store.ts +0 -248
- package/src/primitives/create-kai-chat.ts +0 -66
- package/src/primitives/create-tween.ts +0 -266
- package/src/primitives/embed-providers.ts +0 -254
- package/src/primitives/field-mask.ts +0 -256
- package/src/primitives/field-semantics.ts +0 -115
- package/src/primitives/highlighter.ts +0 -157
- package/src/primitives/input-mask.ts +0 -853
- package/src/primitives/link-preview.ts +0 -87
- package/src/primitives/message-feedback.ts +0 -124
- package/src/primitives/pdf-preview.ts +0 -121
- package/src/primitives/toast-store.ts +0 -338
- package/src/primitives/url-scheme-policy.ts +0 -70
- package/src/primitives/use-audio-analysis.ts +0 -340
- package/src/primitives/use-auto-resize.ts +0 -31
- package/src/primitives/use-resize-observer.ts +0 -45
- package/src/primitives/use-sequencer.ts +0 -72
- package/src/primitives/use-speech-recognition.ts +0 -146
- package/src/primitives/use-stick-to-bottom.ts +0 -75
- package/src/primitives/use-text-stream.ts +0 -143
- package/src/primitives/use-voice-recorder.ts +0 -62
- package/src/primitives/visualizer-sequences.ts +0 -350
- package/src/remote/host-embed.ts +0 -345
- package/src/remote/index.ts +0 -2
- package/src/remote/origin.ts +0 -30
- package/src/remote/provider-runtime.ts +0 -262
- package/src/remote/provider.ts +0 -2
- package/src/remote/validate.ts +0 -22
- package/src/remote/version.ts +0 -12
- package/src/remote/wire.ts +0 -48
- package/src/schemas/from-tool-call.ts +0 -151
- package/src/schemas/index.ts +0 -341
- package/src/schemas/provider-subsets.ts +0 -538
- package/src/schemas/registry.ts +0 -355
- package/src/schemas/tool-defs.ts +0 -793
- package/src/solid.ts +0 -173
- package/src/state/index.ts +0 -44
- package/src/state/messages.ts +0 -53
- package/src/state/mock.ts +0 -297
- package/src/state/parts.ts +0 -295
- package/src/state/persistence.ts +0 -180
- package/src/state/stream.ts +0 -246
- package/src/state/suggestions.ts +0 -9
- package/src/state/threads.ts +0 -142
- package/src/test-utils/fake-clock.ts +0 -88
- package/src/types.ts +0 -95
- package/src/ui/action-icons.ts +0 -53
- package/src/ui/agent-card.tsx +0 -218
- package/src/ui/avatar.tsx +0 -23
- package/src/ui/badge.tsx +0 -21
- package/src/ui/button.tsx +0 -49
- package/src/ui/card.tsx +0 -245
- package/src/ui/checkbox-group.tsx +0 -153
- package/src/ui/checkbox.tsx +0 -63
- package/src/ui/collapsible.tsx +0 -163
- package/src/ui/command.tsx +0 -103
- package/src/ui/dialog.tsx +0 -223
- package/src/ui/dock.tsx +0 -630
- package/src/ui/dropdown.tsx +0 -636
- package/src/ui/editable-label.tsx +0 -112
- package/src/ui/hover-card.tsx +0 -345
- package/src/ui/icon.tsx +0 -167
- package/src/ui/input.tsx +0 -391
- package/src/ui/kbd.tsx +0 -118
- package/src/ui/nav.tsx +0 -282
- package/src/ui/notice.tsx +0 -84
- package/src/ui/overlay.tsx +0 -277
- package/src/ui/pane-grid.tsx +0 -117
- package/src/ui/pane-group.tsx +0 -291
- package/src/ui/pane.tsx +0 -193
- package/src/ui/popover.tsx +0 -106
- package/src/ui/progress-bar.tsx +0 -83
- package/src/ui/prompt-dock.tsx +0 -145
- package/src/ui/radio.tsx +0 -150
- package/src/ui/resizable.tsx +0 -693
- package/src/ui/scroll-area.tsx +0 -26
- package/src/ui/segmented.tsx +0 -109
- package/src/ui/select.tsx +0 -168
- package/src/ui/separator.tsx +0 -10
- package/src/ui/settings-group.tsx +0 -67
- package/src/ui/skeleton.tsx +0 -73
- package/src/ui/slider.tsx +0 -178
- package/src/ui/status.tsx +0 -48
- package/src/ui/switch.tsx +0 -119
- package/src/ui/tabs.tsx +0 -168
- package/src/ui/textarea.tsx +0 -21
- package/src/ui/tooltip.tsx +0 -118
- package/src/utils/cn.ts +0 -30
- package/src/wire/chunk.ts +0 -248
- package/src/wire/consume.ts +0 -599
- package/src/wire/diagnostics.ts +0 -727
- package/src/wire/encode-probe.ts +0 -214
- package/src/wire/encode.ts +0 -947
- package/src/wire/files.ts +0 -342
- package/src/wire/formats/anthropic.ts +0 -274
- package/src/wire/formats/openai.ts +0 -228
- package/src/wire/index.ts +0 -95
- package/src/wire/media-types.ts +0 -344
- package/src/wire/read.ts +0 -396
- package/src/wire/sink-helpers.ts +0 -50
- package/src/wire/sse.ts +0 -153
package/src/components/toast.tsx
DELETED
|
@@ -1,503 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createSignal, createEffect, onCleanup, on, For, Show, createMemo,
|
|
3
|
-
} from 'solid-js';
|
|
4
|
-
import { X, Check, AlertTriangle, XCircle, Info } from 'lucide-solid';
|
|
5
|
-
import { cn } from '../utils/cn';
|
|
6
|
-
import { createPresence } from '../ui/overlay';
|
|
7
|
-
import {
|
|
8
|
-
type ToastItem, type ToastVariant, type ToastAppearance, resolveDuration,
|
|
9
|
-
} from '../primitives/toast-store';
|
|
10
|
-
|
|
11
|
-
export type { ToastItem, ToastVariant, ToastAppearance };
|
|
12
|
-
|
|
13
|
-
/** Why a toast went away — surfaced to `onDismiss` (and the facade event). */
|
|
14
|
-
export type ToastDismissReason = 'timeout' | 'close' | 'action';
|
|
15
|
-
|
|
16
|
-
export type ToastPosition = 'top-center' | 'top-right' | 'top-left' | 'bottom-center' | 'bottom-right' | 'bottom-left';
|
|
17
|
-
|
|
18
|
-
export interface ToastRegionProps {
|
|
19
|
-
/** The toasts to render. Newest is shown on top. Set as a JS property on the
|
|
20
|
-
* element; mutate by passing a new array reference. */
|
|
21
|
-
toasts: ToastItem[];
|
|
22
|
-
/** Where the stack anchors. Defaults to `'top-center'`. */
|
|
23
|
-
position?: ToastPosition;
|
|
24
|
-
/** Max simultaneously-visible toasts; the rest queue and promote as slots
|
|
25
|
-
* free up. Defaults to `3`. */
|
|
26
|
-
max?: number;
|
|
27
|
-
/** Stacking: 'expanded' (default, full column) | 'collapsed' (Sonner-style
|
|
28
|
-
* pile that expands on hover/focus). Attribute: stack. */
|
|
29
|
-
stack?: 'expanded' | 'collapsed';
|
|
30
|
-
/** Region-level default appearance for toasts that don't set their own. A
|
|
31
|
-
* per-toast `appearance` always wins. Defaults to `'pill'`. */
|
|
32
|
-
appearance?: ToastAppearance;
|
|
33
|
-
/** Region-level default inverse treatment for toasts that don't set their own.
|
|
34
|
-
* A per-toast `inverse` always wins. Defaults to `false`. */
|
|
35
|
-
inverse?: boolean;
|
|
36
|
-
/** When set, this region renders only the toasts scoped to that element and
|
|
37
|
-
* anchors over its bounds (top-center), following it on scroll/resize. Unset =
|
|
38
|
-
* the global, viewport-anchored region. */
|
|
39
|
-
target?: HTMLElement;
|
|
40
|
-
/** Fired when a toast leaves, with the reason. */
|
|
41
|
-
onDismiss?: (id: string, reason: ToastDismissReason) => void;
|
|
42
|
-
/** Fired when a toast's action button is pressed. */
|
|
43
|
-
onAction?: (id: string, label: string) => void;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** Reactive `prefers-reduced-motion`. SSR-safe (returns false when no window). */
|
|
47
|
-
function usePrefersReducedMotion() {
|
|
48
|
-
const [reduced, setReduced] = createSignal(
|
|
49
|
-
typeof window !== 'undefined' && window.matchMedia?.('(prefers-reduced-motion: reduce)').matches === true,
|
|
50
|
-
);
|
|
51
|
-
if (typeof window !== 'undefined' && window.matchMedia) {
|
|
52
|
-
const mq = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
53
|
-
const on = () => setReduced(mq.matches);
|
|
54
|
-
mq.addEventListener?.('change', on);
|
|
55
|
-
onCleanup(() => mq.removeEventListener?.('change', on));
|
|
56
|
-
}
|
|
57
|
-
return reduced;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// ── Single toast pill ────────────────────────────────────────────────────────
|
|
61
|
-
|
|
62
|
-
export interface ToastProps {
|
|
63
|
-
item: ToastItem;
|
|
64
|
-
onDismiss: (reason: ToastDismissReason) => void;
|
|
65
|
-
onAction?: (label: string) => void;
|
|
66
|
-
/** Hold the auto-dismiss timer (the region sets this true while the whole stack
|
|
67
|
-
* is hovered/expanded, so peers don't dismiss out from under the cursor). */
|
|
68
|
-
paused?: boolean;
|
|
69
|
-
/** Region-level default appearance, used when the item doesn't set its own. */
|
|
70
|
-
appearance?: ToastAppearance;
|
|
71
|
-
/** Region-level default inverse, used when the item doesn't set its own. */
|
|
72
|
-
inverse?: boolean;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* A single toast pill. Auto-dismisses after its (action-floored) duration, holds
|
|
77
|
-
* the timer while hovered (this pill) OR while `paused` (the whole stack is
|
|
78
|
-
* hovered), and animates in/out via `createPresence`. Pure + prop-driven — the
|
|
79
|
-
* parent `ToastRegion` owns the list + queue.
|
|
80
|
-
*/
|
|
81
|
-
export function Toast(props: ToastProps) {
|
|
82
|
-
const [open, setOpen] = createSignal(true);
|
|
83
|
-
const presence = createPresence(open);
|
|
84
|
-
const variant = () => props.item.variant ?? 'neutral';
|
|
85
|
-
const dismissible = () => props.item.dismissible !== false;
|
|
86
|
-
// Item-level value wins, then the region-level default, then the built-in default.
|
|
87
|
-
const appearance = (): ToastAppearance => props.item.appearance ?? props.appearance ?? 'pill';
|
|
88
|
-
const inverse = (): boolean => props.item.inverse ?? props.inverse ?? false;
|
|
89
|
-
|
|
90
|
-
// Surface + accent colors, swapped for the high-contrast inverse treatment so the
|
|
91
|
-
// toast pops on EITHER appearance, in light AND dark. The inverse surface is the
|
|
92
|
-
// foreground color, so action/close/muted text switch to the background color.
|
|
93
|
-
const surfaceClass = () =>
|
|
94
|
-
inverse() ? 'bg-foreground text-background border-transparent' : 'bg-popover text-popover-foreground border-border';
|
|
95
|
-
const mutedClass = () => (inverse() ? 'text-background/70' : 'text-muted-foreground');
|
|
96
|
-
const actionClass = () => (inverse() ? 'text-background hover:text-background/80' : 'text-primary hover:text-primary/80');
|
|
97
|
-
const closeClass = () => (inverse() ? 'text-background/70 hover:text-background' : 'text-muted-foreground hover:text-foreground');
|
|
98
|
-
|
|
99
|
-
let remaining = resolveDuration(props.item);
|
|
100
|
-
let startedAt = 0;
|
|
101
|
-
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
102
|
-
let reason: ToastDismissReason = 'timeout';
|
|
103
|
-
|
|
104
|
-
const clear = () => { if (timer !== undefined) { clearTimeout(timer); timer = undefined; } };
|
|
105
|
-
|
|
106
|
-
const begin = () => {
|
|
107
|
-
clear();
|
|
108
|
-
if (remaining <= 0) return; // sticky (duration 0)
|
|
109
|
-
startedAt = Date.now();
|
|
110
|
-
timer = setTimeout(() => { reason = 'timeout'; setOpen(false); }, remaining);
|
|
111
|
-
};
|
|
112
|
-
const pause = () => {
|
|
113
|
-
if (timer === undefined) return;
|
|
114
|
-
clear();
|
|
115
|
-
remaining -= Date.now() - startedAt;
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
const [hovered, setHovered] = createSignal(false);
|
|
119
|
-
// Held = this pill is hovered, OR the region says the whole stack is hovered.
|
|
120
|
-
const held = (): boolean => props.paused === true || hovered();
|
|
121
|
-
|
|
122
|
-
// (Re)start the timer whenever the resolved duration changes (mount + update());
|
|
123
|
-
// resets the remaining time to full. Holds instead of running if currently held.
|
|
124
|
-
createEffect(on(() => resolveDuration(props.item), (d) => {
|
|
125
|
-
remaining = d;
|
|
126
|
-
if (held()) clear();
|
|
127
|
-
else begin();
|
|
128
|
-
}));
|
|
129
|
-
// Pause/resume on hover (this pill or the whole stack) WITHOUT resetting remaining,
|
|
130
|
-
// so the countdown continues from where it left off. Deferred — the duration
|
|
131
|
-
// effect already armed it on mount.
|
|
132
|
-
createEffect(on(held, (isHeld) => {
|
|
133
|
-
if (isHeld) pause();
|
|
134
|
-
else begin();
|
|
135
|
-
}, { defer: true }));
|
|
136
|
-
onCleanup(clear);
|
|
137
|
-
|
|
138
|
-
// When presence has fully exited, notify the parent so it drops the item.
|
|
139
|
-
createEffect(() => {
|
|
140
|
-
if (!presence.present() && !open()) props.onDismiss(reason);
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
const close = () => { clear(); reason = 'close'; setOpen(false); };
|
|
144
|
-
|
|
145
|
-
const act = () => {
|
|
146
|
-
const action = props.item.action;
|
|
147
|
-
if (!action) return;
|
|
148
|
-
props.onAction?.(action.label);
|
|
149
|
-
const keepOpen = action.onAction() === false;
|
|
150
|
-
if (!keepOpen) { clear(); reason = 'action'; setOpen(false); }
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
// Leading variant icon — shared by both appearances. In the card it sits at the
|
|
154
|
-
// top, so nudge it down to align with the title's cap height.
|
|
155
|
-
const iconAlign = () => (appearance() === 'card' ? 'mt-0.5' : undefined);
|
|
156
|
-
const VariantIcon = () => (
|
|
157
|
-
<>
|
|
158
|
-
<Show when={variant() === 'success'}>
|
|
159
|
-
<Check class={cn('size-4 shrink-0 text-emerald-500', iconAlign())} />
|
|
160
|
-
</Show>
|
|
161
|
-
<Show when={variant() === 'warning'}>
|
|
162
|
-
<AlertTriangle class={cn('size-4 shrink-0 text-warning', iconAlign())} />
|
|
163
|
-
</Show>
|
|
164
|
-
<Show when={variant() === 'error'}>
|
|
165
|
-
<XCircle class={cn('size-4 shrink-0 text-destructive', iconAlign())} />
|
|
166
|
-
</Show>
|
|
167
|
-
<Show when={variant() === 'info'}>
|
|
168
|
-
<Info class={cn('size-4 shrink-0 text-info', iconAlign())} />
|
|
169
|
-
</Show>
|
|
170
|
-
</>
|
|
171
|
-
);
|
|
172
|
-
|
|
173
|
-
const ActionButton = (p: { class?: string }) => (
|
|
174
|
-
<Show when={props.item.action}>
|
|
175
|
-
{(action) => (
|
|
176
|
-
<button
|
|
177
|
-
type="button"
|
|
178
|
-
onClick={act}
|
|
179
|
-
class={cn(
|
|
180
|
-
appearance() === 'card'
|
|
181
|
-
? cn(
|
|
182
|
-
'inline-flex shrink-0 items-center rounded-md border px-2.5 py-1 text-xs font-medium transition-colors',
|
|
183
|
-
inverse()
|
|
184
|
-
? 'border-background/30 text-background hover:bg-background/10'
|
|
185
|
-
: 'border-border text-foreground hover:bg-accent',
|
|
186
|
-
)
|
|
187
|
-
: cn('shrink-0 rounded-md text-sm font-medium underline-offset-2 hover:underline', actionClass()),
|
|
188
|
-
p.class,
|
|
189
|
-
)}
|
|
190
|
-
>
|
|
191
|
-
{action().label}
|
|
192
|
-
</button>
|
|
193
|
-
)}
|
|
194
|
-
</Show>
|
|
195
|
-
);
|
|
196
|
-
|
|
197
|
-
const CloseButton = () => (
|
|
198
|
-
<Show when={dismissible()}>
|
|
199
|
-
<button
|
|
200
|
-
type="button"
|
|
201
|
-
onClick={close}
|
|
202
|
-
aria-label="Dismiss"
|
|
203
|
-
class={cn(
|
|
204
|
-
'-mr-1 flex size-5 shrink-0 items-center justify-center rounded-md transition-colors',
|
|
205
|
-
closeClass(),
|
|
206
|
-
)}
|
|
207
|
-
>
|
|
208
|
-
<X class="size-3.5" />
|
|
209
|
-
</button>
|
|
210
|
-
</Show>
|
|
211
|
-
);
|
|
212
|
-
|
|
213
|
-
return (
|
|
214
|
-
<Show when={presence.present()}>
|
|
215
|
-
<div
|
|
216
|
-
ref={presence.setRef}
|
|
217
|
-
// `variant` already picks the error ICON; it has to pick the ROLE too, or
|
|
218
|
-
// a failure is announced with the same (polite, easily missed) urgency as
|
|
219
|
-
// a success. `alert` is implicitly assertive and interrupts, which is what
|
|
220
|
-
// the region's `aria-live="polite"` alone will not do for the toast that
|
|
221
|
-
// actually matters. Same expression as ui/notice.tsx.
|
|
222
|
-
role={variant() === 'error' ? 'alert' : 'status'}
|
|
223
|
-
data-appearance={appearance()}
|
|
224
|
-
data-inverse={inverse() ? '' : undefined}
|
|
225
|
-
data-closed={presence.state() === 'closed' ? '' : undefined}
|
|
226
|
-
onPointerEnter={() => setHovered(true)}
|
|
227
|
-
onPointerLeave={() => setHovered(false)}
|
|
228
|
-
class={cn(
|
|
229
|
-
'pointer-events-auto border text-sm shadow-lg',
|
|
230
|
-
surfaceClass(),
|
|
231
|
-
'animate-in fade-in-0 slide-in-from-top-4',
|
|
232
|
-
'data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:slide-out-to-top-2',
|
|
233
|
-
appearance() === 'card'
|
|
234
|
-
? 'flex min-w-[24rem] items-start gap-3 rounded-xl p-4 shadow-xl'
|
|
235
|
-
: 'flex items-center gap-3 rounded-full px-4 py-2.5',
|
|
236
|
-
)}
|
|
237
|
-
>
|
|
238
|
-
<VariantIcon />
|
|
239
|
-
<Show
|
|
240
|
-
when={appearance() === 'card'}
|
|
241
|
-
fallback={
|
|
242
|
-
<>
|
|
243
|
-
<span class="min-w-0 flex-1 truncate">{props.item.message}</span>
|
|
244
|
-
<ActionButton />
|
|
245
|
-
<CloseButton />
|
|
246
|
-
</>
|
|
247
|
-
}
|
|
248
|
-
>
|
|
249
|
-
<div class="min-w-0 flex-1">
|
|
250
|
-
<div class="font-medium leading-snug">{props.item.message}</div>
|
|
251
|
-
<Show when={props.item.description}>
|
|
252
|
-
<div class={cn('mt-1 line-clamp-2 text-xs leading-snug', mutedClass())}>
|
|
253
|
-
{props.item.description}
|
|
254
|
-
</div>
|
|
255
|
-
</Show>
|
|
256
|
-
<ActionButton class="mt-2" />
|
|
257
|
-
</div>
|
|
258
|
-
<CloseButton />
|
|
259
|
-
</Show>
|
|
260
|
-
</div>
|
|
261
|
-
</Show>
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
// ── Region (stack + queue) ───────────────────────────────────────────────────
|
|
266
|
-
|
|
267
|
-
const POSITION_CLASSES: Record<ToastPosition, string> = {
|
|
268
|
-
'top-center': 'top-4 left-1/2 -translate-x-1/2 items-center',
|
|
269
|
-
'top-right': 'top-4 right-4 items-end',
|
|
270
|
-
'top-left': 'top-4 left-4 items-start',
|
|
271
|
-
'bottom-center': 'bottom-4 left-1/2 -translate-x-1/2 items-center flex-col-reverse',
|
|
272
|
-
'bottom-right': 'bottom-4 right-4 items-end flex-col-reverse',
|
|
273
|
-
'bottom-left': 'bottom-4 left-4 items-start flex-col-reverse',
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
// Flex alignment + stack direction per position, for a TARGET-anchored region (the
|
|
277
|
-
// stack hugs the chosen corner; bottom rows grow upward so the newest sits at the
|
|
278
|
-
// anchored edge). Mirrors POSITION_CLASSES minus the viewport-edge offsets.
|
|
279
|
-
const ANCHOR_FLEX: Record<ToastPosition, string> = {
|
|
280
|
-
'top-center': 'items-center',
|
|
281
|
-
'top-left': 'items-start',
|
|
282
|
-
'top-right': 'items-end',
|
|
283
|
-
'bottom-center': 'items-center flex-col-reverse',
|
|
284
|
-
'bottom-left': 'items-start flex-col-reverse',
|
|
285
|
-
'bottom-right': 'items-end flex-col-reverse',
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
/** Inset from the target's edges, in px. */
|
|
289
|
-
const ANCHOR_PAD = 12;
|
|
290
|
-
|
|
291
|
-
interface TargetRect { top: number; left: number; right: number; bottom: number; width: number }
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* The fixed-position style pinning a target-anchored stack to the corner named by
|
|
295
|
-
* `position`, computed from the target's rect. The region is `position: fixed`, so
|
|
296
|
-
* we resolve absolute top/left + a transform that grows the stack inward from that
|
|
297
|
-
* edge. (Rect-based, like the popover's anchor math — no collision flipping needed.)
|
|
298
|
-
*/
|
|
299
|
-
function anchorStyle(position: ToastPosition, r: TargetRect): Record<string, string> {
|
|
300
|
-
const cx = r.left + r.width / 2;
|
|
301
|
-
const top = r.top + ANCHOR_PAD;
|
|
302
|
-
const bottom = r.bottom - ANCHOR_PAD;
|
|
303
|
-
const left = r.left + ANCHOR_PAD;
|
|
304
|
-
const right = r.right - ANCHOR_PAD;
|
|
305
|
-
const maxWidth = `${Math.max(0, r.width - ANCHOR_PAD * 2)}px`;
|
|
306
|
-
switch (position) {
|
|
307
|
-
case 'top-left':
|
|
308
|
-
return { top: `${top}px`, left: `${left}px`, transform: 'none', 'max-width': maxWidth };
|
|
309
|
-
case 'top-right':
|
|
310
|
-
return { top: `${top}px`, left: `${right}px`, transform: 'translateX(-100%)', 'max-width': maxWidth };
|
|
311
|
-
case 'bottom-center':
|
|
312
|
-
return { top: `${bottom}px`, left: `${cx}px`, transform: 'translate(-50%, -100%)', 'max-width': maxWidth };
|
|
313
|
-
case 'bottom-left':
|
|
314
|
-
return { top: `${bottom}px`, left: `${left}px`, transform: 'translateY(-100%)', 'max-width': maxWidth };
|
|
315
|
-
case 'bottom-right':
|
|
316
|
-
return { top: `${bottom}px`, left: `${right}px`, transform: 'translate(-100%, -100%)', 'max-width': maxWidth };
|
|
317
|
-
case 'top-center':
|
|
318
|
-
default:
|
|
319
|
-
return { top: `${top}px`, left: `${cx}px`, transform: 'translateX(-50%)', 'max-width': maxWidth };
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
/** The overlay layer both region roots sit on. One token, one default:
|
|
324
|
-
* your app chrome must stay below the toast layer; set `--kai-toast-z`
|
|
325
|
-
* (default 100) on the host to move the layer. */
|
|
326
|
-
const TOAST_Z = 'var(--kai-toast-z, 100)';
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Renders a stack of toasts at a viewport edge. Caps the visible count at `max`
|
|
330
|
-
* (newest on top); overflow waits in a queue and is promoted as visible toasts
|
|
331
|
-
* leave. `aria-live=polite` / `role=region` so screen readers announce new
|
|
332
|
-
* toasts without stealing focus. Your app chrome must stay below the toast
|
|
333
|
-
* layer; set `--kai-toast-z` (default 100) on the host to move the layer.
|
|
334
|
-
*/
|
|
335
|
-
export function ToastRegion(props: ToastRegionProps) {
|
|
336
|
-
const max = () => props.max ?? 3;
|
|
337
|
-
const position = () => props.position ?? 'top-center';
|
|
338
|
-
|
|
339
|
-
const stack = () => props.stack ?? 'expanded';
|
|
340
|
-
const reduced = usePrefersReducedMotion();
|
|
341
|
-
const collapsed = () => stack() === 'collapsed' && !reduced();
|
|
342
|
-
// Expanded while the stack is hovered OR holds focus (collapsed mode). These are
|
|
343
|
-
// tracked SEPARATELY and OR'd: dismissing a toast (clicking its ×) removes the
|
|
344
|
-
// focused button → a focusout — but if the pointer is still over the stack we must
|
|
345
|
-
// stay expanded (and paused), so focusout alone must not collapse it.
|
|
346
|
-
const [hovered, setHovered] = createSignal(false);
|
|
347
|
-
const [focused, setFocused] = createSignal(false);
|
|
348
|
-
const open = () => hovered() || focused();
|
|
349
|
-
|
|
350
|
-
// Tunable look (IVP). Resting peek + per-depth shrink; uniform expanded row height.
|
|
351
|
-
const OFFSET = 20; // px each deeper toast peeks past the one in front
|
|
352
|
-
const SCALE_STEP = 0.05; // each deeper toast is 5% smaller
|
|
353
|
-
const ROW_FALLBACK = 48; // px; used until the front pill is measured
|
|
354
|
-
const GAP = 8; // matches gap-2 in the expanded column
|
|
355
|
-
|
|
356
|
-
const isBottom = () => position().startsWith('bottom');
|
|
357
|
-
const dir = () => (isBottom() ? -1 : 1);
|
|
358
|
-
|
|
359
|
-
// Measure ONE pill (all are single-line/uniform) to size the expanded spacing.
|
|
360
|
-
const [rowH, setRowH] = createSignal(ROW_FALLBACK);
|
|
361
|
-
const measure = (el: HTMLElement | undefined) => {
|
|
362
|
-
if (!el || typeof window === 'undefined') return;
|
|
363
|
-
const set = () => { const h = el.offsetHeight; if (h) setRowH(h); };
|
|
364
|
-
set();
|
|
365
|
-
// jsdom (and SSR) lack ResizeObserver; the fallback height is fine there.
|
|
366
|
-
if (typeof ResizeObserver === 'undefined') return;
|
|
367
|
-
const ro = new ResizeObserver(set);
|
|
368
|
-
ro.observe(el);
|
|
369
|
-
onCleanup(() => ro.disconnect());
|
|
370
|
-
};
|
|
371
|
-
|
|
372
|
-
// The transform for the wrapper at depth i, given the current open/resting state.
|
|
373
|
-
const depthTransform = (i: number): string => {
|
|
374
|
-
if (open()) return `translateY(${dir() * (rowH() + GAP) * i}px) scale(1)`;
|
|
375
|
-
return `translateY(${dir() * OFFSET * i}px) scale(${1 - SCALE_STEP * i})`;
|
|
376
|
-
};
|
|
377
|
-
// The collapsed stage gets an explicit height covering the whole stack extent —
|
|
378
|
-
// resting (the pile) vs expanded (the full column) — so the region is ONE
|
|
379
|
-
// continuous hover surface. Without it the cursor falls into the gaps between
|
|
380
|
-
// expanded pills (or the spot a just-dismissed pill vacated) and the region
|
|
381
|
-
// flickers collapsed→expanded. Grows away from the anchored edge in both modes.
|
|
382
|
-
const stageHeight = (): number => {
|
|
383
|
-
const n = visible().length;
|
|
384
|
-
if (!n) return 0;
|
|
385
|
-
return open() ? n * rowH() + (n - 1) * GAP : rowH() + (n - 1) * OFFSET;
|
|
386
|
-
};
|
|
387
|
-
|
|
388
|
-
// Only the toasts for THIS region's target (undefined target = the global one).
|
|
389
|
-
// Newest-first so the freshest toast sits at the top; the queue (past `max`)
|
|
390
|
-
// stays mounted-but-hidden until a slot frees up.
|
|
391
|
-
const ordered = createMemo(() =>
|
|
392
|
-
[...(props.toasts ?? []).filter((t) => (t.target ?? undefined) === props.target)].reverse(),
|
|
393
|
-
);
|
|
394
|
-
const visible = createMemo(() => ordered().slice(0, max()));
|
|
395
|
-
|
|
396
|
-
// Scoped to a target → anchor the stack to the `position` corner of the target,
|
|
397
|
-
// following it on scroll/resize. Otherwise it's a viewport-fixed corner/center.
|
|
398
|
-
const [anchor, setAnchor] = createSignal<TargetRect | null>(null);
|
|
399
|
-
createEffect(() => {
|
|
400
|
-
const t = props.target;
|
|
401
|
-
if (!t || typeof window === 'undefined') { setAnchor(null); return; }
|
|
402
|
-
// Captured at SETUP and closed over, never re-resolved as a global inside
|
|
403
|
-
// `onCleanup`: cleanup can run after the host removed the DOM globals (a
|
|
404
|
-
// `kai-*` release is deferred one microtask past detachment, so an
|
|
405
|
-
// environment teardown gets in between), and a bare `window` there throws.
|
|
406
|
-
// See tests/components/teardown-without-dom-globals.test.tsx.
|
|
407
|
-
const win = window;
|
|
408
|
-
const update = () => {
|
|
409
|
-
const r = t.getBoundingClientRect();
|
|
410
|
-
setAnchor({ top: r.top, left: r.left, right: r.right, bottom: r.bottom, width: r.width });
|
|
411
|
-
};
|
|
412
|
-
update();
|
|
413
|
-
const ro = new ResizeObserver(update);
|
|
414
|
-
ro.observe(t);
|
|
415
|
-
win.addEventListener('scroll', update, true);
|
|
416
|
-
win.addEventListener('resize', update);
|
|
417
|
-
onCleanup(() => {
|
|
418
|
-
ro.disconnect();
|
|
419
|
-
win.removeEventListener('scroll', update, true);
|
|
420
|
-
win.removeEventListener('resize', update);
|
|
421
|
-
});
|
|
422
|
-
});
|
|
423
|
-
|
|
424
|
-
return (
|
|
425
|
-
<Show
|
|
426
|
-
when={collapsed()}
|
|
427
|
-
fallback={
|
|
428
|
-
<div
|
|
429
|
-
role="region"
|
|
430
|
-
aria-label="Notifications"
|
|
431
|
-
aria-live="polite"
|
|
432
|
-
data-stack="expanded"
|
|
433
|
-
class={cn(
|
|
434
|
-
'pointer-events-none fixed flex flex-col gap-2',
|
|
435
|
-
anchor()
|
|
436
|
-
? ANCHOR_FLEX[position()]
|
|
437
|
-
: cn('max-w-[min(30rem,calc(100vw-2rem))]', POSITION_CLASSES[position()]),
|
|
438
|
-
)}
|
|
439
|
-
style={{ 'z-index': TOAST_Z, ...(anchor() ? anchorStyle(position(), anchor()!) : undefined) }}
|
|
440
|
-
>
|
|
441
|
-
<For each={visible()}>
|
|
442
|
-
{(item) => (
|
|
443
|
-
<Toast
|
|
444
|
-
item={item}
|
|
445
|
-
appearance={props.appearance}
|
|
446
|
-
inverse={props.inverse}
|
|
447
|
-
onDismiss={(reason) => props.onDismiss?.(item.id, reason)}
|
|
448
|
-
onAction={(label) => props.onAction?.(item.id, label)}
|
|
449
|
-
/>
|
|
450
|
-
)}
|
|
451
|
-
</For>
|
|
452
|
-
</div>
|
|
453
|
-
}
|
|
454
|
-
>
|
|
455
|
-
<div
|
|
456
|
-
role="region"
|
|
457
|
-
aria-label="Notifications"
|
|
458
|
-
aria-live="polite"
|
|
459
|
-
data-stack="collapsed"
|
|
460
|
-
data-expanded={open() ? '' : undefined}
|
|
461
|
-
onPointerEnter={() => setHovered(true)}
|
|
462
|
-
onPointerLeave={() => setHovered(false)}
|
|
463
|
-
onFocusIn={() => setFocused(true)}
|
|
464
|
-
onFocusOut={() => setFocused(false)}
|
|
465
|
-
class={cn('pointer-events-none fixed', !anchor() && POSITION_CLASSES[position()])}
|
|
466
|
-
style={{ 'z-index': TOAST_Z, ...(anchor() ? anchorStyle(position(), anchor()!) : undefined) }}
|
|
467
|
-
>
|
|
468
|
-
{/* Relative stage with an explicit height so it's ONE continuous hover
|
|
469
|
-
surface (pointer-events-auto) — no flicker when the cursor crosses gaps
|
|
470
|
-
or a dismissed pill's vacated spot. Pills are absolutely stacked from the
|
|
471
|
-
anchored edge. */}
|
|
472
|
-
<div
|
|
473
|
-
class="pointer-events-auto relative transition-[height] duration-200 ease-out"
|
|
474
|
-
style={{ 'min-width': '16rem', 'max-width': 'min(30rem, calc(100vw - 2rem))', height: `${stageHeight()}px` }}
|
|
475
|
-
>
|
|
476
|
-
<For each={visible()}>
|
|
477
|
-
{(item, i) => (
|
|
478
|
-
<div
|
|
479
|
-
data-depth={i()}
|
|
480
|
-
ref={(el) => { if (i() === 0) measure(el); }}
|
|
481
|
-
class={cn(
|
|
482
|
-
'absolute inset-x-0 flex transition-[transform,opacity] duration-200 ease-out',
|
|
483
|
-
isBottom() ? 'bottom-0 origin-bottom' : 'top-0 origin-top',
|
|
484
|
-
position().endsWith('right') ? 'justify-end' : position().endsWith('left') ? 'justify-start' : 'justify-center',
|
|
485
|
-
)}
|
|
486
|
-
style={{ 'z-index': String(max() - i()), transform: depthTransform(i()) }}
|
|
487
|
-
>
|
|
488
|
-
<Toast
|
|
489
|
-
item={item}
|
|
490
|
-
paused={open()}
|
|
491
|
-
appearance={props.appearance}
|
|
492
|
-
inverse={props.inverse}
|
|
493
|
-
onDismiss={(reason) => props.onDismiss?.(item.id, reason)}
|
|
494
|
-
onAction={(label) => props.onAction?.(item.id, label)}
|
|
495
|
-
/>
|
|
496
|
-
</div>
|
|
497
|
-
)}
|
|
498
|
-
</For>
|
|
499
|
-
</div>
|
|
500
|
-
</div>
|
|
501
|
-
</Show>
|
|
502
|
-
);
|
|
503
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/** Semantic classification of a tool call, used to pick a rendering. Derived from
|
|
2
|
-
* the provider-chosen tool NAME, which is arbitrary, so this stays conservative and
|
|
3
|
-
* prefers 'generic' over a confident wrong answer. */
|
|
4
|
-
export type ToolKind =
|
|
5
|
-
| 'command'
|
|
6
|
-
| 'file-change'
|
|
7
|
-
| 'search'
|
|
8
|
-
| 'fetch'
|
|
9
|
-
| 'mcp'
|
|
10
|
-
| 'image'
|
|
11
|
-
| 'generic';
|
|
12
|
-
|
|
13
|
-
/** Total, deterministic, side-effect free. ALWAYS terminates in 'generic' so an
|
|
14
|
-
* unrecognized tool still renders a panel instead of a blank. Order matters:
|
|
15
|
-
* 'search' is tested before 'fetch' so `web_search` classifies as a search. */
|
|
16
|
-
export function classifyTool(name: string): ToolKind {
|
|
17
|
-
const n = name.toLowerCase();
|
|
18
|
-
if (!n) return 'generic';
|
|
19
|
-
if (n.includes('bash') || n.includes('command') || n.includes('shell') || n.includes('terminal') || n.includes('exec')) return 'command';
|
|
20
|
-
if (n.includes('edit') || n.includes('write') || n.includes('patch') || n.includes('replace') || n.includes('delete')) return 'file-change';
|
|
21
|
-
if (n.includes('search') || n.includes('grep') || n.includes('glob') || n.includes('find')) return 'search';
|
|
22
|
-
if (n.includes('fetch') || n.includes('http') || n.includes('browse') || n.includes('crawl')) return 'fetch';
|
|
23
|
-
if (n.includes('mcp')) return 'mcp';
|
|
24
|
-
if (n.includes('image') || n.includes('screenshot') || n.includes('vision')) return 'image';
|
|
25
|
-
return 'generic';
|
|
26
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { ToolKind } from './tool-classify';
|
|
2
|
-
|
|
3
|
-
/** The untranslated provider payload a part was normalized from.
|
|
4
|
-
*
|
|
5
|
-
* Optional in the type but REQUIRED in practice for round-trip fidelity. Anthropic
|
|
6
|
-
* returns a 400 invalid_request_error if `thinking` blocks are modified, reordered,
|
|
7
|
-
* filtered or RECONSTRUCTED, so an encoder must send `raw.payload` back verbatim
|
|
8
|
-
* rather than rebuilding a block from `text` + `signature`. */
|
|
9
|
-
export interface RawOrigin {
|
|
10
|
-
/** Tagged origin, e.g. 'anthropic.content_block', 'openai.delta', `custom.${string}`. */
|
|
11
|
-
source: string;
|
|
12
|
-
payload: unknown;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/** A tool-call part rendered by <Tool>. Pure type — kept JSX-free so it can be
|
|
16
|
-
* imported by the framework-neutral state core and the React typecheck pass.
|
|
17
|
-
*
|
|
18
|
-
* Adding a field here also requires adding it to `TOOL_KEYS` (and a comparator
|
|
19
|
-
* in `TOOL_COMPARATORS`) in `state/parts.ts`, or `tsc` fails to compile: those
|
|
20
|
-
* drive `upsertToolPart`'s dedupe check, and a field missing from them would
|
|
21
|
-
* silently make that check ignore the new field, keeping a stale array
|
|
22
|
-
* reference alive when only that field changed. */
|
|
23
|
-
export interface ToolPart {
|
|
24
|
-
/** The tool name exactly as the provider reported it. */
|
|
25
|
-
type: string;
|
|
26
|
-
/** Semantic classification for rendering. Derive with classifyTool(type). */
|
|
27
|
-
kind?: ToolKind;
|
|
28
|
-
/** The call's lifecycle. A provider stream (real or `createMockResponder`)
|
|
29
|
-
* only ever ANNOUNCES a call: arguments stream in (`input-streaming`), then
|
|
30
|
-
* the part parks at `input-available` — and stays there. The kit parses and
|
|
31
|
-
* renders the call; EXECUTING it and answering is the host's side of the
|
|
32
|
-
* seam: after the read settles, run the tool and patch the part forward with
|
|
33
|
-
* `stream.upsertTool(id, { state: 'output-available', output })` (or
|
|
34
|
-
* `upsertToolPart`), or `output-error` + `errorText` on failure. The one
|
|
35
|
-
* exception is a call the provider ran itself (`raw` carries the result and
|
|
36
|
-
* the wire sets `output` directly) — never re-execute those. */
|
|
37
|
-
state: 'input-streaming' | 'input-available' | 'output-available' | 'output-error';
|
|
38
|
-
/** Last VALID parsed snapshot, fingerprint-deduped. The primary channel: this is
|
|
39
|
-
* what the kit renders. */
|
|
40
|
-
input?: Record<string, unknown>;
|
|
41
|
-
/** Raw accumulated argument fragments, for consumers wanting character-level
|
|
42
|
-
* streaming. Most consumers should read `input` instead. */
|
|
43
|
-
rawInput?: string;
|
|
44
|
-
output?: Record<string, unknown>;
|
|
45
|
-
toolCallId?: string;
|
|
46
|
-
errorText?: string;
|
|
47
|
-
/** The untranslated provider payload this was normalized from. */
|
|
48
|
-
raw?: RawOrigin;
|
|
49
|
-
}
|