@kitn.ai/ui 0.25.1 → 0.26.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 +5 -7
- package/dist/components/attachment-types.d.ts +46 -1
- package/dist/components/attachments.d.ts +31 -0
- package/dist/components/audio-visualizer/fit-scale.d.ts +50 -0
- package/dist/components/audio-visualizer/index.d.ts +15 -1
- package/dist/components/audio-visualizer/variant-bar.d.ts +24 -1
- package/dist/components/chat-thread.d.ts +3 -41
- package/dist/components/code-block.d.ts +22 -0
- package/dist/components/conversation-item.d.ts +54 -1
- package/dist/components/conversation-list.d.ts +65 -0
- package/dist/components/form.d.ts +42 -0
- package/dist/components/message.d.ts +7 -0
- package/dist/components/toast.d.ts +2 -1
- package/dist/components/voice-input.d.ts +8 -0
- package/dist/components/voice-output.d.ts +12 -1
- package/dist/components/workspace-shell.d.ts +87 -0
- package/dist/{create-tween-B5Y4Im8G.js → create-tween-BFT6c-Y8.js} +1 -1
- package/dist/{create-tween-4z1XYLkR.js → create-tween-CJNlzoaO.js} +1 -1
- package/dist/{create-tween-CUzOlaMS.js → create-tween-CQED4T0g.js} +1 -1
- package/dist/custom-elements.json +2931 -2572
- package/dist/diagnostics/hook.d.ts +81 -0
- package/dist/diagnostics/index.d.ts +7 -0
- package/dist/diagnostics/report-request.d.ts +61 -0
- package/dist/diagnostics.d.ts +5 -0
- package/dist/diagnostics.js +209 -0
- 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/autoloader.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/checkpoint.js +1 -1
- package/dist/elements/choice.js +1 -1
- package/dist/elements/chunks/{Icon-b5A8hlHs.js → Icon--Y8vsFal.js} +1 -1
- package/dist/elements/chunks/action-icons-D9u3OzYW.js +1 -0
- package/dist/elements/chunks/arrow-left-CVh1TeN7.js +1 -0
- package/dist/elements/chunks/{artifact-BSuPYFHY.js → artifact-BkYcfIlZ.js} +1 -1
- package/dist/elements/chunks/attachments-DwfNlubq.js +1 -0
- package/dist/elements/chunks/audio-visualizer-D7lB6mvR.js +1 -0
- package/dist/elements/chunks/{badge-TIMiJFKc.js → badge-Q0-Cmwzz.js} +1 -1
- package/dist/elements/chunks/{button-B9okqG73.js → button-flUbeufF.js} +1 -1
- package/dist/elements/chunks/{card-renderer-CSoTL_e1.js → card-renderer-3Dyl-FpN.js} +1 -1
- package/dist/elements/chunks/check-B5kBPKeo.js +1 -0
- package/dist/elements/chunks/chevron-down-DZ1GS39h.js +1 -0
- package/dist/elements/chunks/chevron-right-CvP7OUd2.js +1 -0
- package/dist/elements/chunks/{choice-card-CGMc3kek.js → choice-card-D4QUIOWZ.js} +1 -1
- package/dist/elements/chunks/circle-CDf9g6MQ.js +1 -0
- package/dist/elements/chunks/circle-check-CA47Nqbz.js +1 -0
- package/dist/elements/chunks/{circle-x-mhH7pOK2.js → circle-x-CJ_HVbC8.js} +1 -1
- package/dist/elements/chunks/code-block-BdLiTitd.js +1 -0
- package/dist/elements/chunks/collapsible-BzbXpPzr.js +1 -0
- package/dist/elements/chunks/{composer-CZZmtYOT.js → composer-Byve-n8K.js} +2 -2
- package/dist/elements/chunks/{confirm-card-BWjf2-xo.js → confirm-card-B0flE3MN.js} +1 -1
- package/dist/elements/chunks/context-VLIL3sJ-.js +1 -0
- package/dist/elements/chunks/controllable-DTwTIlwp.js +1 -0
- package/dist/elements/chunks/conversation-item-BDztezOG.js +1 -0
- package/dist/elements/chunks/copy-Nf-kqxXH.js +1 -0
- package/dist/elements/chunks/{create-tween-CUrM6D_o.js → create-tween-c4Z8TDYz.js} +2 -2
- package/dist/elements/chunks/default-input-C2iLFq0b.js +1 -0
- package/dist/elements/chunks/define-wjHR1MkU.js +1 -0
- package/dist/elements/chunks/disclosure-CcNbyLy0.js +1 -0
- package/dist/elements/chunks/{download-DnCyWFJE.js → download-C4V7tBdb.js} +1 -1
- package/dist/elements/chunks/dropdown-BgWTthUx.js +1 -0
- package/dist/elements/chunks/{ellipsis-CVxqfsDZ.js → ellipsis-7gU33mL2.js} +1 -1
- package/dist/elements/chunks/embed-D3KewsIJ.js +1 -0
- package/dist/elements/chunks/{external-link-DG2sRdQL.js → external-link-CSOEsNlx.js} +1 -1
- package/dist/elements/chunks/{file-text-D0J9F6M7.js → file-text-D1G8khle.js} +1 -1
- package/dist/elements/chunks/{file-tree-yGWNK0Js.js → file-tree-zvB2i7P9.js} +1 -1
- package/dist/elements/chunks/{folder-NV1pi_ud.js → folder-WW2LGLid.js} +1 -1
- package/dist/elements/chunks/form-CQirdC4W.js +1 -0
- package/dist/elements/chunks/hover-card-CJJkfHTK.js +1 -0
- package/dist/elements/chunks/icon-Cfgmf4fa.js +1 -0
- package/dist/elements/chunks/{info-C8r5Q6cc.js → info-DX3YMOt6.js} +1 -1
- package/dist/elements/chunks/input-BtW9U6Sq.js +1 -0
- package/dist/elements/chunks/{kbd-OGJDUT-O.js → kbd-LGXwuT_V.js} +1 -1
- package/dist/elements/chunks/{link-BdsfLB7b.js → link-2My69BqT.js} +1 -1
- package/dist/elements/chunks/{link-preview-Cf5KOP-i.js → link-preview-OQ9IEq0f.js} +1 -1
- package/dist/elements/chunks/{loader-B5QzK_8_.js → loader-iOxc_Tu-.js} +1 -1
- package/dist/elements/chunks/{markdown-DbozyYqa.js → markdown-DgBFaGAz.js} +1 -1
- package/dist/elements/chunks/{message-DtXKPqiR.js → message-VMZohrXx.js} +1 -1
- package/dist/elements/chunks/message-circle-CpXMM-_n.js +1 -0
- package/dist/elements/chunks/message-square-DxcWtETQ.js +1 -0
- package/dist/elements/chunks/message-tZmV2A3p.js +1 -0
- package/dist/elements/chunks/{minimize-2-SegJ_oku.js → minimize-2-DPIUKTrT.js} +1 -1
- package/dist/elements/chunks/{model-switcher-D7JrFFHp.js → model-switcher-DsT8tFB0.js} +1 -1
- package/dist/elements/chunks/{overlay-CV7z2YuX.js → overlay-DuiwdXjm.js} +1 -1
- package/dist/elements/chunks/{paperclip-Bg0ITU3b.js → paperclip-CRZVp4z_.js} +1 -1
- package/dist/elements/chunks/{progress-bar-D1_rzt6N.js → progress-bar-DNy66e_E.js} +1 -1
- package/dist/elements/chunks/{prompt-suggestion-D5Sm8xF1.js → prompt-suggestion-Bn64Nl7L.js} +1 -1
- package/dist/elements/chunks/reasoning-Emn9N4-T.js +1 -0
- package/dist/elements/chunks/{resizable-Dpzjlvp4.js → resizable-D181b4fM.js} +1 -1
- package/dist/elements/chunks/{rotate-cw-DzVDJOA1.js → rotate-cw-CPWe37D9.js} +1 -1
- package/dist/elements/chunks/{scroll-area-93A1bbeG.js → scroll-area-ClZkZxIk.js} +1 -1
- package/dist/elements/chunks/scroll-button-DPE-t3x_.js +1 -0
- package/dist/elements/chunks/{separator-DH2r_ZSZ.js → separator-CeJHQqLW.js} +1 -1
- package/dist/elements/chunks/{settings-BFMOd6yB.js → settings-CqaHgJF9.js} +1 -1
- package/dist/elements/chunks/{settings-group-B3VZKIcz.js → settings-group-CjqjLCOn.js} +1 -1
- package/dist/elements/chunks/share-CyfnNEqp.js +1 -0
- package/dist/elements/chunks/{skeleton-N8BuWYmf.js → skeleton-D8akBnKS.js} +1 -1
- package/dist/elements/chunks/slots-DaNjX0rc.js +1 -0
- package/dist/elements/chunks/{source-w9V0NnBn.js → source-UWCvmVak.js} +1 -1
- package/dist/elements/chunks/{star-DHvACxtm.js → star-DoHFAikQ.js} +1 -1
- package/dist/elements/chunks/store-Cjq0qwYN.js +1 -0
- package/dist/elements/chunks/{tasks-card-lPxoodlA.js → tasks-card-CmZ5xh6v.js} +1 -1
- package/dist/elements/chunks/{text-shimmer-BY_rI3s5.js → text-shimmer-DYn09zrz.js} +1 -1
- package/dist/elements/chunks/textarea-skiGHURM.js +1 -0
- package/dist/elements/chunks/{thumbs-up-DQe0hvkZ.js → thumbs-up-DX2Ijk3H.js} +1 -1
- package/dist/elements/chunks/{toast-store-VUZZBhzH.js → toast-store-CFnQpThX.js} +1 -1
- package/dist/elements/chunks/{tool-C1YtxwPu.js → tool-DKQ2D1DP.js} +1 -1
- package/dist/elements/chunks/{tooltip-BqwnFWhn.js → tooltip-B0G99y8w.js} +1 -1
- package/dist/elements/chunks/{triangle-alert-B6or7F5u.js → triangle-alert-F9cyUEyy.js} +1 -1
- package/dist/elements/chunks/{use-card-resolution-DJg32jGH.js → use-card-resolution-DoA2f_EU.js} +1 -1
- package/dist/elements/chunks/{variant-aurora-QXTZPyST.js → variant-aurora-qt6Zct8M.js} +2 -2
- package/dist/elements/chunks/variant-custom-tJp22_BQ.js +1 -0
- package/dist/{variant-wave-BwzrHD1s.js → elements/chunks/variant-wave-CaQ5ti39.js} +2 -2
- package/dist/elements/chunks/x-B6UnOiLw.js +1 -0
- 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.d.ts +1 -0
- package/dist/elements/conversation-item.js +1 -0
- package/dist/elements/conversation-list.js +1 -1
- package/dist/elements/default-input.d.ts +3 -3
- package/dist/elements/define.d.ts +27 -0
- package/dist/elements/diagnostic-events.d.ts +74 -0
- package/dist/elements/dialog.js +1 -1
- package/dist/elements/dock.d.ts +1 -0
- package/dist/elements/dock.js +149 -0
- package/dist/elements/dropdown.d.ts +1 -0
- package/dist/elements/dropdown.js +1 -0
- package/dist/elements/editable-label.js +1 -1
- package/dist/elements/element-diagnostics.d.ts +81 -0
- 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-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/reasoning.js +1 -1
- package/dist/elements/register.d.ts +2 -0
- package/dist/elements/remote.js +1 -1
- package/dist/elements/resizable.js +1 -1
- package/dist/elements/response-stream.js +3 -3
- 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/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/slots.d.ts +35 -3
- 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/elements.d.ts +232 -148
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5456 -4931
- package/dist/index.server.js +4142 -3669
- package/dist/kai-provider.es.js +40 -40
- package/dist/kai.es.js +1 -1
- package/dist/llms/llms-full.txt +184 -69
- package/dist/llms/llms.txt +3 -3
- package/dist/mcp.es.js +2669 -546
- package/dist/primitives/use-resize-observer.d.ts +23 -0
- package/dist/primitives/use-speech-recognition.d.ts +8 -0
- package/dist/primitives/use-text-stream.d.ts +5 -0
- package/dist/react/index.d.ts +115 -266
- package/dist/react.js +247 -221
- package/dist/register-impl-DpE7icIb.js +293 -0
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/tool-defs.d.ts +35 -0
- package/dist/schemas.js +403 -310
- package/dist/{solid-BMuDmFo_.js → solid-BtdqNZI7.js} +8435 -7394
- package/dist/{solid-CGYNdLRR.js → solid-CnavwBye.js} +5987 -5035
- package/dist/solid.d.ts +5 -0
- package/dist/solid.js +210 -203
- package/dist/solid.server.js +210 -203
- package/dist/state/index.d.ts +4 -0
- package/dist/state/persistence.d.ts +51 -0
- package/dist/state/stream.d.ts +50 -0
- package/dist/state/threads.d.ts +71 -0
- package/dist/state.js +269 -169
- package/dist/types.d.ts +4 -2
- package/dist/ui/dock.d.ts +109 -0
- package/dist/ui/hover-card.d.ts +44 -0
- package/dist/{variant-aurora-DwSOfraQ.js → variant-aurora-B8II3-I1.js} +27 -27
- package/dist/{variant-aurora-wKvAQ5wp.js → variant-aurora-CMNWOSJR.js} +28 -28
- package/dist/{variant-aurora-XEkPT0_z.js → variant-aurora-CcuDMWwQ.js} +2 -2
- package/dist/{variant-custom-eFIg2XWQ.js → variant-custom-BdvYC7af.js} +40 -40
- package/dist/{variant-custom-BhS9wIpU.js → variant-custom-C714mqKl.js} +65 -65
- package/dist/variant-custom-L16JLLZy.js +1 -0
- package/dist/{elements/chunks/variant-wave-DDCwhLas.js → variant-wave-2S4La2Ka.js} +2 -2
- package/dist/{variant-wave-CbVsmgwT.js → variant-wave-D7ruiA1W.js} +25 -25
- package/dist/{variant-wave-CUWGx9Bn.js → variant-wave-ecwykeyL.js} +21 -21
- package/dist/wire/chunk.d.ts +47 -0
- package/dist/wire/diagnostics.d.ts +575 -0
- package/dist/wire/encode-probe.d.ts +70 -0
- package/dist/wire/encode.d.ts +24 -0
- package/dist/wire/index.d.ts +2 -0
- package/dist/wire/sse.d.ts +10 -2
- package/dist/wire.js +917 -480
- package/frameworks/react/index.tsx +132 -93
- package/llms-full.txt +184 -69
- package/llms.txt +3 -3
- package/package.json +27 -7
- package/src/agent-tooling/archetypes.ts +41 -9
- package/src/agent-tooling/catalog/README.md +676 -0
- package/src/agent-tooling/catalog/catalog-types.ts +231 -0
- package/src/agent-tooling/catalog/fabrications.ts +96 -0
- package/src/agent-tooling/catalog/invariants.ts +284 -0
- package/src/agent-tooling/catalog/labs-titles.ts +114 -0
- package/src/agent-tooling/catalog/scenarios.ts +87 -0
- package/src/agent-tooling/catalog/surfaces.ts +275 -0
- package/src/agent-tooling/integrations/anthropic.ts +7 -1
- package/src/agent-tooling/integrations/cloudflare.ts +43 -2
- package/src/agent-tooling/integrations/langgraph.ts +7 -1
- package/src/agent-tooling/integrations/mastra.ts +7 -1
- package/src/agent-tooling/integrations/mock.ts +92 -17
- package/src/agent-tooling/integrations/ollama.ts +7 -1
- package/src/agent-tooling/integrations/openai.ts +7 -1
- package/src/agent-tooling/integrations/openrouter.ts +7 -1
- package/src/agent-tooling/integrations/pi.ts +56 -1
- package/src/agent-tooling/integrations/vercel-ai-sdk.ts +7 -1
- package/src/agent-tooling/mcp/css-raw.d.ts +12 -0
- package/src/agent-tooling/mcp/manifest.ts +100 -1
- package/src/agent-tooling/mcp/server.ts +61 -5
- package/src/agent-tooling/mcp/tools/reference.ts +440 -4
- package/src/agent-tooling/mcp/tools/scaffold.ts +1834 -307
- package/src/agent-tooling/mcp/tools/theme.ts +146 -30
- package/src/agent-tooling/mcp/validate-args.ts +141 -0
- package/src/agent-tooling/registry.ts +19 -7
- package/src/agent-tooling/route-emit.ts +26 -2
- package/src/components/attachment-types.ts +47 -1
- package/src/components/attachments.tsx +169 -22
- package/src/components/audio-visualizer/fit-scale.ts +112 -0
- package/src/components/audio-visualizer/index.tsx +80 -3
- package/src/components/audio-visualizer/variant-aurora.tsx +10 -4
- package/src/components/audio-visualizer/variant-bar.tsx +38 -6
- package/src/components/audio-visualizer/variant-custom.tsx +8 -2
- package/src/components/audio-visualizer/variant-grid.tsx +16 -11
- package/src/components/audio-visualizer/variant-radial.tsx +15 -10
- package/src/components/audio-visualizer/variant-wave.tsx +7 -2
- package/src/components/chat-container.tsx +4 -1
- package/src/components/chat-thread.tsx +36 -7
- package/src/components/code-block.tsx +79 -3
- package/src/components/composer.tsx +8 -1
- package/src/components/conversation-item.tsx +114 -4
- package/src/components/conversation-list.tsx +212 -12
- package/src/components/embed.tsx +4 -0
- package/src/components/form.tsx +41 -14
- package/src/components/message.tsx +75 -5
- package/src/components/response-stream.tsx +13 -7
- package/src/components/screen.tsx +5 -0
- package/src/components/scroll-button.tsx +7 -0
- package/src/components/toast.tsx +11 -5
- package/src/components/voice-input.tsx +35 -3
- package/src/components/voice-output.tsx +46 -6
- package/src/components/workspace-shell.tsx +285 -0
- package/src/diagnostics/hook.ts +352 -0
- package/src/diagnostics/index.ts +82 -0
- package/src/diagnostics/report-request.ts +296 -0
- package/src/elements/attachments.tsx +6 -7
- package/src/elements/audio-visualizer.tsx +48 -4
- package/src/elements/chat-workspace.tsx +159 -287
- package/src/elements/chat.tsx +12 -9
- package/src/elements/code-block.tsx +19 -1
- package/src/elements/command.tsx +4 -1
- package/src/elements/compiled.css +1 -1
- package/src/elements/conversation-item.tsx +80 -0
- package/src/elements/conversation-list.tsx +60 -11
- package/src/elements/default-input.tsx +5 -5
- package/src/elements/define.tsx +168 -8
- package/src/elements/diagnostic-events.ts +114 -0
- package/src/elements/dialog.tsx +47 -0
- package/src/elements/disclosure.ts +34 -12
- package/src/elements/dock.tsx +204 -0
- package/src/elements/dropdown.tsx +123 -0
- package/src/elements/element-diagnostics.ts +392 -0
- package/src/elements/element-manifest.json +12 -0
- package/src/elements/element-meta.json +672 -439
- package/src/elements/element-nonscalar.json +170 -0
- package/src/elements/element-types.d.ts +232 -148
- package/src/elements/menu.tsx +13 -0
- package/src/elements/prompt-dock.tsx +2 -1
- package/src/elements/prompt-input.tsx +8 -8
- package/src/elements/register-impl.ts +46 -0
- package/src/elements/register.ts +28 -0
- package/src/elements/resizable.tsx +52 -25
- package/src/elements/scroll-button.tsx +5 -0
- package/src/elements/slots.ts +107 -12
- package/src/elements/styles.css +30 -6
- package/src/elements/thinking-bar.tsx +16 -7
- package/src/elements/toast.tsx +3 -0
- package/src/elements/tool.tsx +26 -5
- package/src/elements/voice-input.tsx +11 -2
- package/src/elements/voice-output.tsx +16 -3
- package/src/index.ts +2 -0
- package/src/primitives/use-resize-observer.ts +33 -0
- package/src/primitives/use-speech-recognition.ts +12 -1
- package/src/primitives/use-stick-to-bottom.ts +34 -2
- package/src/primitives/use-text-stream.ts +33 -2
- package/src/remote/provider-runtime.ts +6 -3
- package/src/schemas/index.ts +1 -0
- package/src/schemas/tool-defs.ts +297 -6
- package/src/solid.ts +5 -0
- package/src/state/index.ts +12 -0
- package/src/state/persistence.ts +180 -0
- package/src/state/stream.ts +71 -4
- package/src/state/threads.ts +142 -0
- package/src/types.ts +4 -2
- package/src/ui/dialog.tsx +6 -0
- package/src/ui/dock.tsx +445 -0
- package/src/ui/dropdown.tsx +67 -23
- package/src/ui/hover-card.tsx +156 -6
- package/src/ui/input.tsx +29 -10
- package/src/ui/resizable.tsx +11 -0
- package/src/wire/chunk.ts +47 -0
- package/src/wire/consume.ts +185 -26
- package/src/wire/diagnostics.ts +727 -0
- package/src/wire/encode-probe.ts +214 -0
- package/src/wire/encode.ts +267 -14
- package/src/wire/formats/anthropic.ts +8 -1
- package/src/wire/formats/openai.ts +5 -0
- package/src/wire/index.ts +22 -0
- package/src/wire/read.ts +250 -6
- package/src/wire/sse.ts +16 -3
- package/dist/elements/chunks/action-icons-DW9muWrY.js +0 -1
- package/dist/elements/chunks/arrow-left-iJVnQmxA.js +0 -1
- package/dist/elements/chunks/attachments-CL6TaqIb.js +0 -1
- package/dist/elements/chunks/audio-visualizer-BuUqQmaO.js +0 -1
- package/dist/elements/chunks/chat-thread-DxoKaStk.js +0 -1
- package/dist/elements/chunks/check-MdLzbxrm.js +0 -1
- package/dist/elements/chunks/chevron-down-MK7IzDqe.js +0 -1
- package/dist/elements/chunks/chevron-right-C5jXhmtV.js +0 -1
- package/dist/elements/chunks/circle-BG7VkPep.js +0 -1
- package/dist/elements/chunks/circle-check-GqvO2UBs.js +0 -1
- package/dist/elements/chunks/code-block-ClhQO9RW.js +0 -1
- package/dist/elements/chunks/collapsible-DBcBkFPh.js +0 -1
- package/dist/elements/chunks/context-hKjNqiyQ.js +0 -1
- package/dist/elements/chunks/conversation-list-CsGJjSKG.js +0 -1
- package/dist/elements/chunks/default-input-B1Mem5wu.js +0 -1
- package/dist/elements/chunks/define-B_tXMYRm.js +0 -1
- package/dist/elements/chunks/disclosure-DAoYOKew.js +0 -1
- package/dist/elements/chunks/dropdown-CmNna5lT.js +0 -1
- package/dist/elements/chunks/embed-CjAD2jSi.js +0 -1
- package/dist/elements/chunks/form-Cp8Y00Wn.js +0 -1
- package/dist/elements/chunks/hover-card-6KtXpLwT.js +0 -1
- package/dist/elements/chunks/icon-97R8SR2p.js +0 -1
- package/dist/elements/chunks/input-DrseEjhp.js +0 -1
- package/dist/elements/chunks/message-CE4k-qaj.js +0 -1
- package/dist/elements/chunks/message-square-C9ovmtOo.js +0 -1
- package/dist/elements/chunks/reasoning-BrxQfpfI.js +0 -1
- package/dist/elements/chunks/scroll-button-CrTo7wm4.js +0 -1
- package/dist/elements/chunks/share-DgNbkJKY.js +0 -1
- package/dist/elements/chunks/slots-CIw9RlAe.js +0 -1
- package/dist/elements/chunks/store-HIPGhNz9.js +0 -1
- package/dist/elements/chunks/textarea-DPfuhswM.js +0 -1
- package/dist/elements/chunks/variant-custom-D5ZlmziF.js +0 -1
- package/dist/elements/chunks/video-Bb86fVYI.js +0 -1
- package/dist/elements/chunks/x-BOhjBeOd.js +0 -1
- package/dist/primitives/card-validate-generator.testlib.d.ts +0 -20
- package/dist/register-impl-DGmGzrEM.js +0 -145
- package/dist/variant-custom-MkTNTycd.js +0 -1
- package/src/primitives/card-validate-generator.testlib.ts +0 -38
package/dist/solid.server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e,
|
|
1
|
+
import { A as e, b as t, d as o, e as r, f as n, g as i, h as c, i as d, j as C, k as l, l as b, m as g, n as m, o as u, B as p, p as h, q as T, r as A, t as S, u as I, v as R, x as v, y as E, z as P, D, E as k, F as f, G as L, H as x, I as w, J as _, K as y, L as O, M as B, N as M, O as F, N as H, P as N, Q as z, R as V, S as G, T as U, U as Y, V as K, W, X as j, Y as q, Z as J, _ as Q, $ as X, a0 as Z, a1 as $, a2 as aa, a3 as sa, a4 as ea, a5 as ta, a6 as oa, a7 as ra, a8 as na, a9 as ia, aa as ca, ab as da, ac as Ca, ad as la, ae as ba, af as ga, ag as ma, ah as ua, ai as pa, aj as ha, ak as Ta, al as Aa, am as Sa, an as Ia, ao as Ra, ap as va, aq as Ea, ar as Pa, as as Da, at as ka, au as fa, av as La, aw as xa, ax as wa, ay as _a, az as ya, aA as Oa, aB as Ba, aC as Ma, aD as Fa, aE as Ha, aF as Na, aG as za, aH as Va, aI as Ga, aJ as Ua, aK as Ya, aL as Ka, aM as Wa, aN as ja, aO as qa, aP as Ja, aQ as Qa, aR as Xa, aS as Za, aT as $a, aU as as, aV as ss, aW as es, aX as ts, aY as os, aZ as rs, a_ as ns, a$ as is, b0 as cs, b1 as ds, b2 as Cs, b3 as ls, b4 as bs, b5 as gs, b6 as ms, b7 as us, b8 as ps, b9 as hs, ba as Ts, bb as As, bc as Ss, bd as Is, be as Rs, bf as vs, bg as Es, bh as Ps, bi as Ds, bj as ks, bk as fs, bl as Ls, bm as xs, bn as ws, bo as _s, bp as ys, bq as Os, br as Bs, bs as Ms, bt as Fs, bu as Hs, bv as Ns, bw as zs, bx as Vs, by as Gs, bz as Us, bA as Ys, bB as Ks, bC as Ws, bD as js, bE as qs, bF as Js, bG as Qs, bH as Xs, bI as Zs, bJ as $s, bK as ae, bL as se, bM as ee, bN as te, bO as oe, bP as re, bQ as ne, bR as ie, bS as ce, bT as de, bU as Ce, bV as le, bW as be, bX as ge, bY as me, bZ as ue, b_ as pe, b$ as he, c0 as Te, c1 as Ae, c2 as Se, c3 as Ie, c4 as Re, c5 as ve, c6 as Ee, c7 as Pe, c8 as De, c9 as ke, ca as fe, cb as Le, cc as xe, c as we, cd as _e, ce as ye, cf as Oe, cg as Be, ch as Me, ci as Fe, cj as He, ck as Ne, cl as ze, cm as Ve, cn as Ge, co as Ue, cp as Ye, cq as Ke, cr as We, cs as je, ct as qe, cu as Je, cv as Qe, cw as Xe, cx as Ze, cy as $e, cz as at, cA as st, cB as et, cC as tt, cD as ot, cE as rt, cF as nt, cG as it, cH as ct, cI as dt, cJ as Ct, cK as lt, cL as bt, cM as gt, cN as mt, cO as ut, cP as pt, cQ as ht, cR as Tt, cS as At, cT as St, cU as It, cV as Rt, cW as vt, cX as Et, cY as Pt, cZ as Dt, c_ as kt, c$ as ft, d0 as Lt, d1 as xt, d2 as wt, d3 as _t, d4 as yt, d5 as Ot, d6 as Bt, d7 as Mt, d8 as Ft, d9 as Ht, da as Nt, db as zt, dc as Vt, dd as Gt, de as Ut, df as Yt, dg as Kt, dh as Wt, di as jt, dj as qt, dk as Jt, dl as Qt } from "./solid-CnavwBye.js";
|
|
2
2
|
export {
|
|
3
3
|
e as AgentCard,
|
|
4
4
|
t as Artifact,
|
|
@@ -15,33 +15,33 @@ export {
|
|
|
15
15
|
m as AudioVisualizer,
|
|
16
16
|
u as Avatar,
|
|
17
17
|
p as BUILTIN_CARD_COMPONENTS,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
h as BUILTIN_CARD_TAGS,
|
|
19
|
+
T as Badge,
|
|
20
20
|
A as BarsLoader,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
S as Button,
|
|
22
|
+
I as CARD_CONTRACT_VERSION,
|
|
23
|
+
R as CARD_EVENT_NAME,
|
|
24
|
+
v as CHOICE_CARD_TYPE,
|
|
25
|
+
E as CONFIRM_CARD_TYPE,
|
|
26
|
+
P as Card,
|
|
27
27
|
D as CardFallback,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
k as CardProvider,
|
|
29
|
+
f as CardRenderer,
|
|
30
30
|
L as ChainOfThought,
|
|
31
|
-
|
|
31
|
+
x as ChainOfThoughtAccordion,
|
|
32
32
|
w as ChainOfThoughtContent,
|
|
33
33
|
_ as ChainOfThoughtItem,
|
|
34
|
-
|
|
34
|
+
y as ChainOfThoughtStep,
|
|
35
35
|
O as ChainOfThoughtTrigger,
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
B as ChatConfig,
|
|
37
|
+
M as ChatContainer,
|
|
38
38
|
F as ChatContainerContent,
|
|
39
39
|
H as ChatContainerRoot,
|
|
40
40
|
N as ChatContainerScrollAnchor,
|
|
41
41
|
z as ChatScopePicker,
|
|
42
42
|
V as ChatThread,
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
G as Checkpoint,
|
|
44
|
+
U as CheckpointIcon,
|
|
45
45
|
Y as CheckpointTrigger,
|
|
46
46
|
K as ChoiceCard,
|
|
47
47
|
W as CircularLoader,
|
|
@@ -69,193 +69,200 @@ export {
|
|
|
69
69
|
ma as ContextTrigger,
|
|
70
70
|
ua as ConversationItem,
|
|
71
71
|
pa as ConversationList,
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
ha as DEFAULT_ARTIFACT_CARD_HEIGHT,
|
|
73
|
+
Ta as Dialog,
|
|
74
74
|
Aa as DismissedStub,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
Da as
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
La as
|
|
85
|
-
|
|
86
|
-
wa as
|
|
87
|
-
_a as
|
|
75
|
+
Sa as Dock,
|
|
76
|
+
Ia as DockCloseGlyph,
|
|
77
|
+
Ra as DockLauncherGlyph,
|
|
78
|
+
va as DotsLoader,
|
|
79
|
+
Ea as Dropdown,
|
|
80
|
+
Pa as DropdownCheckboxItem,
|
|
81
|
+
Da as DropdownContent,
|
|
82
|
+
ka as DropdownItem,
|
|
83
|
+
fa as DropdownLabel,
|
|
84
|
+
La as DropdownRadioItem,
|
|
85
|
+
xa as DropdownSeparator,
|
|
86
|
+
wa as DropdownSub,
|
|
87
|
+
_a as DropdownSubContent,
|
|
88
|
+
ya as DropdownSubTrigger,
|
|
89
|
+
Oa as DropdownTrigger,
|
|
90
|
+
Ba as EMBED_CARD_TYPE,
|
|
88
91
|
Ma as EditableLabel,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
92
|
+
Fa as Embed,
|
|
93
|
+
Ha as Empty,
|
|
94
|
+
Na as EmptyContent,
|
|
95
|
+
za as EmptyDescription,
|
|
96
|
+
Va as EmptyHeader,
|
|
97
|
+
Ga as EmptyMedia,
|
|
98
|
+
Ua as EmptyTitle,
|
|
99
|
+
Ya as FeedbackBar,
|
|
100
|
+
Ka as FileTree,
|
|
101
|
+
Wa as FileUpload,
|
|
102
|
+
ja as FileUploadContent,
|
|
103
|
+
qa as FileUploadTrigger,
|
|
104
|
+
Ja as Form,
|
|
105
|
+
Qa as HoverCard,
|
|
106
|
+
Xa as HoverCardContent,
|
|
107
|
+
Za as HoverCardRoot,
|
|
108
|
+
$a as HoverCardTrigger,
|
|
109
|
+
as as Image,
|
|
110
|
+
ss as Input,
|
|
111
|
+
es as Kbd,
|
|
112
|
+
ts as LINK_PREVIEW_TYPE,
|
|
113
|
+
os as LinkPreview,
|
|
114
|
+
rs as Loader,
|
|
115
|
+
ns as Markdown,
|
|
116
|
+
is as Message,
|
|
117
|
+
cs as MessageAction,
|
|
118
|
+
ds as MessageActions,
|
|
119
|
+
Cs as MessageAvatar,
|
|
120
|
+
ls as MessageBody,
|
|
121
|
+
bs as MessageContent,
|
|
122
|
+
gs as MessageCopyButton,
|
|
123
|
+
ms as MessageSkills,
|
|
124
|
+
us as ModelSwitcher,
|
|
125
|
+
ps as Nav,
|
|
126
|
+
hs as Notice,
|
|
127
|
+
Ts as OTHER_ACTION,
|
|
128
|
+
As as Pane,
|
|
129
|
+
Ss as PaneGrid,
|
|
130
|
+
Is as PaneGroup,
|
|
131
|
+
Rs as Popover,
|
|
132
|
+
vs as ProgressBar,
|
|
133
|
+
Es as PromptDock,
|
|
134
|
+
Ps as PromptInput,
|
|
135
|
+
Ds as PromptInputAction,
|
|
136
|
+
ks as PromptInputActions,
|
|
137
|
+
fs as PromptInputTextarea,
|
|
138
|
+
Ls as PromptSuggestion,
|
|
139
|
+
xs as PulseDotLoader,
|
|
140
|
+
ws as PulseLoader,
|
|
141
|
+
_s as Reasoning,
|
|
142
|
+
ys as ReasoningContent,
|
|
143
|
+
Os as ReasoningTrigger,
|
|
144
|
+
Bs as Resizable,
|
|
142
145
|
Ms as ResizableHandle,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
Me as
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
Mt as
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
146
|
+
Fs as ResizablePanel,
|
|
147
|
+
Hs as ResizablePanelGroup,
|
|
148
|
+
Ns as ResponseCompare,
|
|
149
|
+
zs as ResponseStream,
|
|
150
|
+
Vs as Screen,
|
|
151
|
+
Gs as ScrollArea,
|
|
152
|
+
Us as ScrollButton,
|
|
153
|
+
Ys as Segmented,
|
|
154
|
+
Ks as Separator,
|
|
155
|
+
Ws as SettingItem,
|
|
156
|
+
js as SettingsGroup,
|
|
157
|
+
qs as Skeleton,
|
|
158
|
+
Js as SlottedConversationItem,
|
|
159
|
+
Qs as Source,
|
|
160
|
+
Xs as SourceContent,
|
|
161
|
+
Zs as SourceList,
|
|
162
|
+
$s as SourceTrigger,
|
|
163
|
+
ae as Status,
|
|
164
|
+
se as Switch,
|
|
165
|
+
ee as TASKS_CARD_TYPE,
|
|
166
|
+
te as Tabs,
|
|
167
|
+
oe as TasksCard,
|
|
168
|
+
re as TerminalLoader,
|
|
169
|
+
ne as TextBlinkLoader,
|
|
170
|
+
ie as TextDotsLoader,
|
|
171
|
+
ce as TextShimmer,
|
|
172
|
+
de as TextShimmerLoader,
|
|
173
|
+
Ce as Textarea,
|
|
174
|
+
le as ThinkingBar,
|
|
175
|
+
be as Thread,
|
|
176
|
+
ge as Toast,
|
|
177
|
+
me as ToastRegion,
|
|
178
|
+
ue as Tool,
|
|
179
|
+
pe as Tooltip,
|
|
180
|
+
he as TypingLoader,
|
|
181
|
+
Te as VoiceInput,
|
|
182
|
+
Ae as VoiceOutput,
|
|
183
|
+
Se as WaveLoader,
|
|
184
|
+
Ie as WorkspaceShell,
|
|
185
|
+
Re as applyResolution,
|
|
186
|
+
ve as buildFileTree,
|
|
187
|
+
Ee as buildResult,
|
|
188
|
+
Pe as buildSelection,
|
|
189
|
+
De as buttonVariantForStyle,
|
|
190
|
+
ke as buttonVariants,
|
|
191
|
+
fe as canConfirm,
|
|
192
|
+
Le as clampBasis,
|
|
193
|
+
xe as classifyTool,
|
|
194
|
+
we as cn,
|
|
195
|
+
_e as coerceValue,
|
|
196
|
+
ye as configureCodeHighlighting,
|
|
197
|
+
Oe as configureEmbedAllowlist,
|
|
198
|
+
Be as configureLinkPreview,
|
|
199
|
+
Me as configurePdfPreview,
|
|
200
|
+
Fe as configureToasts,
|
|
201
|
+
He as confirmReason,
|
|
202
|
+
Ne as createConversationItemsController,
|
|
203
|
+
ze as createKaiChat,
|
|
204
|
+
Ve as createPresence,
|
|
205
|
+
Ge as defaultActionId,
|
|
206
|
+
Ue as defaultIsReopenable,
|
|
207
|
+
Ye as dismissRecovery,
|
|
208
|
+
Ke as emitCardEvent,
|
|
209
|
+
We as emptyMediaVariants,
|
|
210
|
+
je as ensureToastRegion,
|
|
211
|
+
qe as firstEnabledIndex,
|
|
212
|
+
Je as getAttachmentLabel,
|
|
213
|
+
Qe as getMediaCategory,
|
|
214
|
+
Xe as getToasts,
|
|
215
|
+
Ze as hasLinkPreviewFetcher,
|
|
216
|
+
$e as initialSelected,
|
|
217
|
+
at as isAnyStreaming,
|
|
218
|
+
st as isCodeHighlightingEnabled,
|
|
219
|
+
et as isGenericOriginAllowed,
|
|
220
|
+
tt as isMaxReached,
|
|
221
|
+
ot as isPdfPreviewEnabled,
|
|
222
|
+
rt as listenForCardEvents,
|
|
223
|
+
nt as mergeCardComponents,
|
|
224
|
+
it as mergeCardTags,
|
|
225
|
+
ct as mountRemoteCard,
|
|
226
|
+
dt as nextEnabledIndex,
|
|
227
|
+
Ct as normalizeActions,
|
|
228
|
+
lt as normalizeCandidates,
|
|
229
|
+
bt as normalizeOptions,
|
|
230
|
+
gt as normalizeSize,
|
|
231
|
+
mt as normalizeTasks,
|
|
232
|
+
ut as orderedKeys,
|
|
233
|
+
pt as parseVimeoId,
|
|
234
|
+
ht as parseYouTubeId,
|
|
235
|
+
Tt as proseClass,
|
|
236
|
+
At as readConversationItemId,
|
|
237
|
+
St as renderCard,
|
|
238
|
+
It as renderIcon,
|
|
239
|
+
Rt as resolutionFromEvent,
|
|
240
|
+
vt as resolveEmbed,
|
|
241
|
+
Et as resolveLinkMetadata,
|
|
242
|
+
Pt as resolveOtherConfig,
|
|
243
|
+
Dt as resolveToPx,
|
|
244
|
+
kt as routeCardEvent,
|
|
245
|
+
ft as selectAllState,
|
|
246
|
+
Lt as selectedInOrder,
|
|
247
|
+
xt as showSelectAll,
|
|
248
|
+
wt as stubIntent,
|
|
249
|
+
_t as textClass,
|
|
250
|
+
yt as toast,
|
|
251
|
+
Ot as toggleableIds,
|
|
252
|
+
Bt as useAttachmentContext,
|
|
253
|
+
Mt as useAttachmentsContext,
|
|
254
|
+
Ft as useAutoResize,
|
|
255
|
+
Ht as useCardHost,
|
|
256
|
+
Nt as useChatConfig,
|
|
257
|
+
zt as useChatContainer,
|
|
258
|
+
Vt as useDismiss,
|
|
259
|
+
Gt as usePosition,
|
|
260
|
+
Ut as usePromptInput,
|
|
261
|
+
Yt as useResolved,
|
|
262
|
+
Kt as useStickToBottom,
|
|
263
|
+
Wt as useTextStream,
|
|
264
|
+
jt as useVoiceRecorder,
|
|
265
|
+
qt as validateAgainstSchema,
|
|
266
|
+
Jt as validateForm,
|
|
267
|
+
Qt as widgetFor
|
|
261
268
|
};
|
package/dist/state/index.d.ts
CHANGED
|
@@ -4,6 +4,10 @@ export { createAssistantStream, onStreamSettled } from './stream.js';
|
|
|
4
4
|
export type { SetMessages, AssistantStream } from './stream.js';
|
|
5
5
|
export { appendTextPart, appendReasoningPart, upsertToolPart, upsertCardPart, fingerprint } from './parts.js';
|
|
6
6
|
export type { ReasoningOpts } from './parts.js';
|
|
7
|
+
export { updateThreadMessages, bindThreadMessages, createThreadSessions } from './threads.js';
|
|
8
|
+
export type { ThreadLike, SetThreads, BindThreadOptions, ThreadSessions } from './threads.js';
|
|
9
|
+
export { parseStoredThread, createSaveScheduler } from './persistence.js';
|
|
10
|
+
export type { ParsedThread, DroppedStored, SaveScheduler, SaveSchedulerOptions } from './persistence.js';
|
|
7
11
|
export { createMockResponder, DEFAULT_MOCK_REPLIES, MOCK_BANNER, MOCK_MARKER, MOCK_MARKER_KEY, MOCK_MODEL_ID } from './mock.js';
|
|
8
12
|
export type { MockResponder, MockResponderOptions } from './mock.js';
|
|
9
13
|
export type { ChatMessage, ChatMessageAction, CustomAction, AvatarData, FeedbackVote, MessagePart, MessageSource, RawOrigin, } from '../elements/chat-types.js';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ChatMessage } from '../elements/chat-types.js';
|
|
2
|
+
/** One record the parse refused, and why. Deciding loudly is the caller's
|
|
3
|
+
* verb (warn, reject the whole record, count it); this is the information
|
|
4
|
+
* that a quiet version would withhold. */
|
|
5
|
+
export interface DroppedStored {
|
|
6
|
+
at: 'thread' | 'message' | 'part';
|
|
7
|
+
reason: string;
|
|
8
|
+
value: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface ParsedThread {
|
|
11
|
+
messages: ChatMessage[];
|
|
12
|
+
/** Empty on a clean parse. Never silently shorter output than input. */
|
|
13
|
+
dropped: DroppedStored[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Validate a stored thread — the JSON-parsed value of one thread's messages
|
|
17
|
+
* array — back into `ChatMessage[]`. Never throws: unreadable records are
|
|
18
|
+
* DROPPED and reported in `dropped`, so a truncated write loses one record,
|
|
19
|
+
* not every conversation. What to DO about a drop (warn, discard the whole
|
|
20
|
+
* record, telemetry) is the caller's policy.
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseStoredThread(value: unknown): ParsedThread;
|
|
23
|
+
export interface SaveSchedulerOptions {
|
|
24
|
+
/** The quiet period before a scheduled snapshot is written. This is policy
|
|
25
|
+
* and therefore REQUIRED — the kit ships no default debounce. */
|
|
26
|
+
delayMs: number;
|
|
27
|
+
/** The scheduler the seam runs on. Defaults to the global timers; inject
|
|
28
|
+
* your own for tests or a non-timer scheduler. */
|
|
29
|
+
setTimeout?: (fn: () => void, ms: number) => unknown;
|
|
30
|
+
clearTimeout?: (handle: unknown) => void;
|
|
31
|
+
}
|
|
32
|
+
export interface SaveScheduler<T> {
|
|
33
|
+
/** Remember `snapshot` as the latest state and (re)start the quiet-period
|
|
34
|
+
* timer. Call it on every state change; only the last snapshot inside the
|
|
35
|
+
* quiet period is written. */
|
|
36
|
+
schedule(snapshot: T): void;
|
|
37
|
+
/** Write the pending snapshot NOW and disarm the timer — the
|
|
38
|
+
* `beforeunload`/`visibilitychange` story, so a tab closed mid-stream still
|
|
39
|
+
* persists. No-op when nothing is pending: the last write already happened. */
|
|
40
|
+
flush(): void;
|
|
41
|
+
/** Drop the pending write unsaved (e.g. unmount-without-persist). */
|
|
42
|
+
cancel(): void;
|
|
43
|
+
pending(): boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The debounce/flush seam: a streaming reply lands a state update per token,
|
|
47
|
+
* and without this shape so would the consumer's storage backend. The kit owns
|
|
48
|
+
* only the timer dance; `save` (WHAT and WHERE, including its own try/catch
|
|
49
|
+
* policy for quota errors) and `delayMs` (HOW LONG) are the consumer's.
|
|
50
|
+
*/
|
|
51
|
+
export declare function createSaveScheduler<T>(save: (snapshot: T) => void, opts: SaveSchedulerOptions): SaveScheduler<T>;
|
package/dist/state/stream.d.ts
CHANGED
|
@@ -36,6 +36,56 @@ export interface AssistantStream {
|
|
|
36
36
|
addSource(source: Unmixed<Source>): AssistantStream;
|
|
37
37
|
addFile(attachment: AttachmentData): AssistantStream;
|
|
38
38
|
done(): void;
|
|
39
|
+
/** Settles the turn as FAILED and puts `reason` where the reader can find it.
|
|
40
|
+
*
|
|
41
|
+
* WHERE THE REASON LANDS, in order:
|
|
42
|
+
* 1. every tool part that has NOT produced a result flips to `output-error`
|
|
43
|
+
* with `errorText: reason`, so no panel spins forever. A tool ALREADY in
|
|
44
|
+
* `output-error` with its own non-empty `errorText` is left exactly as it
|
|
45
|
+
* is: "search index offline" is the answer to what went wrong and
|
|
46
|
+
* "Connection lost." is the generic outer symptom, so overwriting the
|
|
47
|
+
* specific with the generic loses the only actionable thing on the
|
|
48
|
+
* message. It still counts as carrying the failure. A tool in
|
|
49
|
+
* `output-error` with NO text does get filled in — an error panel with
|
|
50
|
+
* nothing in it says no more than a blank bubble does.
|
|
51
|
+
* 2. if no part was able to carry it, the reason is APPENDED as its own text
|
|
52
|
+
* part.
|
|
53
|
+
*
|
|
54
|
+
* Never both — a turn does not report the same failure twice.
|
|
55
|
+
*
|
|
56
|
+
* "Where the reader can FIND it" is deliberate, and rule 1 and rule 2 are not
|
|
57
|
+
* equally loud. Rule 2 is text in the thread: read without any interaction.
|
|
58
|
+
* Rule 1 is a tool panel, which renders COLLAPSED — the header shows an error
|
|
59
|
+
* icon and a badge, so the failure is unmissable, but the `errorText` itself
|
|
60
|
+
* is one click away. That is the right default for a failed tool inside an
|
|
61
|
+
* otherwise readable answer, and it is why rule 2 exists rather than always
|
|
62
|
+
* stamping the panel and calling it reported.
|
|
63
|
+
*
|
|
64
|
+
* Rule 2 is the whole point and it used to be missing. `abort` only ever did
|
|
65
|
+
* rule 1, so a TEXT-ONLY turn — every turn of a text-only support widget —
|
|
66
|
+
* had nothing to stamp: the string was discarded and a failed request
|
|
67
|
+
* rendered an EMPTY assistant bubble, while the consumer that passed a
|
|
68
|
+
* perfectly good sentence believed it had reported the failure. That is the
|
|
69
|
+
* repo's "decide loudly" rule broken on the one path where being quiet is
|
|
70
|
+
* worst, and it shipped because the discard is invisible from the call site.
|
|
71
|
+
*
|
|
72
|
+
* It is a NEW part, never a merge onto the trailing text: gluing "Connection
|
|
73
|
+
* lost." onto the model's half-finished sentence reads as the model saying
|
|
74
|
+
* it. Text that already streamed stays exactly where it is.
|
|
75
|
+
*
|
|
76
|
+
* The reason is TRIMMED, and `abort()` with no reason — or one that is empty
|
|
77
|
+
* or all whitespace — appends nothing: there is no reason to discard, and the
|
|
78
|
+
* kit will not invent copy the consumer did not write. Rule 1 still runs,
|
|
79
|
+
* with `errorText: undefined`. Whitespace is not a pedantic case here: the
|
|
80
|
+
* scaffold hands over `err.message`, and an `Error` is free to carry `''`,
|
|
81
|
+
* which would otherwise render an INVISIBLE text part — a blank bubble that
|
|
82
|
+
* also claims to have said something.
|
|
83
|
+
*
|
|
84
|
+
* Settled is settled: after `done()` or a first `abort()`, this is a no-op
|
|
85
|
+
* like every other mutator, so the reason cannot be appended twice.
|
|
86
|
+
*
|
|
87
|
+
* The reason is CONSUMER-facing text and is rendered as markdown like any
|
|
88
|
+
* other text part. Pass a sentence a visitor can read, not a stack trace. */
|
|
39
89
|
abort(reason?: string): void;
|
|
40
90
|
}
|
|
41
91
|
/** Start an assistant message and drive it through `set`. New refs on every mutation. */
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ChatMessage } from '../elements/chat-types.js';
|
|
2
|
+
import { SetMessages } from './stream.js';
|
|
3
|
+
/** The minimal thread record the fold needs. The consumer's own record type
|
|
4
|
+
* (title, timestamps, whatever its storage keeps) extends this — those fields
|
|
5
|
+
* are policy and stay outside the kit. */
|
|
6
|
+
export interface ThreadLike {
|
|
7
|
+
id: string;
|
|
8
|
+
messages: ChatMessage[];
|
|
9
|
+
}
|
|
10
|
+
/** The functional-updater setter over the whole thread LIST — the same
|
|
11
|
+
* React-setState shape `SetMessages` is, one level up. */
|
|
12
|
+
export type SetThreads<T extends ThreadLike> = (updater: (prev: T[]) => T[]) => void;
|
|
13
|
+
export interface BindThreadOptions<T extends ThreadLike> {
|
|
14
|
+
/** Stamp the changed record (e.g. `updatedAt`). Runs on a hit only. Kept a
|
|
15
|
+
* callback because WHAT gets stamped — and with whose clock — is the
|
|
16
|
+
* consumer's record shape, not ours. */
|
|
17
|
+
touch?: (thread: T) => T;
|
|
18
|
+
/** A delta arrived for a thread that is no longer in the list (deleted while
|
|
19
|
+
* its reply was streaming). The delta is dropped either way — dropping is
|
|
20
|
+
* the only correct fold — but the drop is reported, not silent. */
|
|
21
|
+
onDrop?: (threadId: string) => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Pure fold: apply `updater` to the messages of thread `id` within a list.
|
|
25
|
+
*
|
|
26
|
+
* reactivity-two-halves (CLAUDE.md): the hit gets a NEW containing array
|
|
27
|
+
* (which notifies) and a NEW record object (which makes the change visible);
|
|
28
|
+
* every other record keeps its reference. A MISS returns `threads` itself —
|
|
29
|
+
* the same reference — so a late delta for a deleted thread re-renders
|
|
30
|
+
* nothing and resurrects nothing.
|
|
31
|
+
*/
|
|
32
|
+
export declare function updateThreadMessages<T extends ThreadLike>(threads: T[], id: string, updater: (prev: ChatMessage[]) => ChatMessage[], opts?: BindThreadOptions<T>): T[];
|
|
33
|
+
/**
|
|
34
|
+
* A `SetMessages` bound to ONE thread. Capture the id when the user hits send
|
|
35
|
+
* and hand the result to `createAssistantStream`: the reply then lands in the
|
|
36
|
+
* thread that was open at send time, never whichever one is open when the
|
|
37
|
+
* tokens arrive — which is what makes switching away mid-reply (and coming
|
|
38
|
+
* back to a finished answer) safe.
|
|
39
|
+
*/
|
|
40
|
+
export declare function bindThreadMessages<T extends ThreadLike>(setThreads: SetThreads<T>, id: string, opts?: BindThreadOptions<T>): SetMessages;
|
|
41
|
+
/** The in-flight-turn bookkeeping for a multi-thread app: which threads are
|
|
42
|
+
* streaming, and the AbortController for each. See `createThreadSessions`. */
|
|
43
|
+
export interface ThreadSessions {
|
|
44
|
+
/** Register a new in-flight turn. One turn per thread: a prior in-flight
|
|
45
|
+
* turn for the SAME thread is aborted first. Pass the returned controller's
|
|
46
|
+
* `signal` to your fetch — the fetch line itself stays yours. */
|
|
47
|
+
begin(threadId: string): AbortController;
|
|
48
|
+
/** The turn settled (done or failed) — call from your `finally`. `controller`
|
|
49
|
+
* is required so a slow old turn's cleanup cannot clear a newer turn that
|
|
50
|
+
* has since begun on the same thread: a stale controller is a no-op. */
|
|
51
|
+
end(threadId: string, controller: AbortController): void;
|
|
52
|
+
/** Cancel the in-flight turn (the delete-under-stream story): aborts the
|
|
53
|
+
* controller and clears the streaming state. Returns whether anything was
|
|
54
|
+
* actually in flight. Pair it with the id-bound sink above, which drops any
|
|
55
|
+
* deltas that were already past the abort. */
|
|
56
|
+
abort(threadId: string): boolean;
|
|
57
|
+
isStreaming(threadId: string): boolean;
|
|
58
|
+
/** A fresh array snapshot each call — safe to hand straight to a setState. */
|
|
59
|
+
streamingIds(): string[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Create the session tracker. `onChange` fires with a fresh `streamingIds()`
|
|
63
|
+
* snapshot after every transition — mirror it into your framework's state to
|
|
64
|
+
* derive `loading` (`sessions.isStreaming(activeId)` is the per-thread flag a
|
|
65
|
+
* single boolean cannot be, because a stream keeps running when you switch
|
|
66
|
+
* away).
|
|
67
|
+
*
|
|
68
|
+
* This is the one stateful object in the module, because an abort map is
|
|
69
|
+
* irreducibly stateful; it still does no I/O and owns no timer.
|
|
70
|
+
*/
|
|
71
|
+
export declare function createThreadSessions(onChange?: (streamingIds: string[]) => void): ThreadSessions;
|