@kitn.ai/ui 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/chat-thread.d.ts +9 -0
- package/dist/{create-tween-D3Y5qiij.js → create-tween-COnPwAQN.js} +1 -1
- package/dist/{create-tween-DGKY1FDY.js → create-tween-DmTUaXWE.js} +1 -1
- package/dist/{create-tween-paho5Rh-.js → create-tween-qs-jjvNA.js} +1 -1
- package/dist/custom-elements.json +43 -7
- 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/checkpoint.js +1 -1
- package/dist/elements/choice.js +1 -1
- package/dist/elements/chunks/{Icon-C-2LvGDG.js → Icon-CHG5z5L7.js} +1 -1
- package/dist/elements/chunks/{action-icons-CaYoImEk.js → action-icons-BAtCEEgg.js} +1 -1
- package/dist/elements/chunks/arrow-left-CFPTeL1Y.js +1 -0
- package/dist/elements/chunks/{artifact-BBIscOxJ.js → artifact-fBZOE4SO.js} +1 -1
- package/dist/elements/chunks/{attachments-BB56zoji.js → attachments-DpYMe5VQ.js} +1 -1
- package/dist/elements/chunks/{audio-visualizer-BxOx4THz.js → audio-visualizer-DFwzAcuL.js} +1 -1
- package/dist/elements/chunks/{badge-SxLSZ19R.js → badge-D6zodm6E.js} +1 -1
- package/dist/elements/chunks/{button-CmkUkz6c.js → button-C42vrGvO.js} +1 -1
- package/dist/elements/chunks/{card-renderer-Db4ffkWv.js → card-renderer-DMZsSuvU.js} +1 -1
- package/dist/elements/chunks/{chat-thread-B3Ks-cKr.js → chat-thread-CNNEhol-.js} +1 -1
- package/dist/elements/chunks/check-7Q3K-iXE.js +1 -0
- package/dist/elements/chunks/chevron-down-CpNYLn7E.js +1 -0
- package/dist/elements/chunks/chevron-right-DrH85Fha.js +1 -0
- package/dist/elements/chunks/{choice-card-Q9cYYDyM.js → choice-card-YoWjpsFV.js} +1 -1
- package/dist/elements/chunks/circle-C9KRjKYv.js +1 -0
- package/dist/elements/chunks/circle-check-Dmi7Y4zw.js +1 -0
- package/dist/elements/chunks/{circle-x-D0MEfxOM.js → circle-x-QIxXda6k.js} +1 -1
- package/dist/elements/chunks/{code-block-C8VzAraE.js → code-block-CqeugReY.js} +1 -1
- package/dist/elements/chunks/{collapsible-Cvj61obE.js → collapsible-sTv-_5lF.js} +1 -1
- package/dist/elements/chunks/{composer-D86ztyL0.js → composer-ldQyeVEB.js} +1 -1
- package/dist/elements/chunks/{confirm-card-BdyDAGLw.js → confirm-card-C0RNOwfn.js} +1 -1
- package/dist/elements/chunks/context-5qgypNHC.js +1 -0
- package/dist/elements/chunks/conversation-list-DLzOacXz.js +1 -0
- package/dist/elements/chunks/{create-tween-C_A_B638.js → create-tween-V4TXZ93X.js} +1 -1
- package/dist/elements/chunks/default-input-DeeRSDHc.js +1 -0
- package/dist/elements/chunks/{define-BzPnNsXg.js → define-lE-QvQFn.js} +1 -1
- package/dist/elements/chunks/{disclosure-DVKsoc1F.js → disclosure-DZSa9jog.js} +1 -1
- package/dist/elements/chunks/{download-BjA54IMJ.js → download-B2ZmnGqW.js} +1 -1
- package/dist/elements/chunks/{dropdown-BjVVHWXH.js → dropdown-R3B7cSRE.js} +1 -1
- package/dist/elements/chunks/{ellipsis-BNedmqfi.js → ellipsis-BmxceY4l.js} +1 -1
- package/dist/elements/chunks/{embed-DQsl4XEq.js → embed-BVrtTZPo.js} +1 -1
- package/dist/elements/chunks/{external-link-Di-dw2CU.js → external-link-BbdR7YO7.js} +1 -1
- package/dist/elements/chunks/{file-text-B3sAODCV.js → file-text-D7dijo1A.js} +1 -1
- package/dist/elements/chunks/{file-tree-Dgto-bMn.js → file-tree-0upJ5jeb.js} +1 -1
- package/dist/elements/chunks/{folder-D6rMadFV.js → folder-D8z58t7B.js} +1 -1
- package/dist/elements/chunks/{form-CILxvhQ7.js → form-p5BKJNw5.js} +1 -1
- package/dist/elements/chunks/{hover-card-BtiF4XiU.js → hover-card-CN9s2md5.js} +1 -1
- package/dist/elements/chunks/{icon-DKkmze3y.js → icon-CNiKP37E.js} +1 -1
- package/dist/elements/chunks/{info-CWRjZkuy.js → info-BSnuJiHI.js} +1 -1
- package/dist/elements/chunks/{input--QJBK6BA.js → input-BauDmzxX.js} +1 -1
- package/dist/elements/chunks/{kbd-C3zuKh8R.js → kbd-BlHJaP9b.js} +1 -1
- package/dist/elements/chunks/{link-BL5JA7Q0.js → link-DEi5iUWC.js} +1 -1
- package/dist/elements/chunks/{link-preview-CU37bbXh.js → link-preview-BaHyM6W4.js} +1 -1
- package/dist/elements/chunks/{loader-XmpyxyRH.js → loader-CmJG_Fkq.js} +1 -1
- package/dist/elements/chunks/{markdown-3Gv5UZ_o.js → markdown-D2jaMpCN.js} +1 -1
- package/dist/elements/chunks/{message-X5NZbq-W.js → message-C5UfXZ2Z.js} +1 -1
- package/dist/elements/chunks/{message-CnBA2OUt.js → message-CXWLmmLn.js} +1 -1
- package/dist/elements/chunks/message-square-hXylwsy0.js +1 -0
- package/dist/elements/chunks/{minimize-2-DwyrUTcM.js → minimize-2-C9ytZFMU.js} +1 -1
- package/dist/elements/chunks/model-switcher-CivGfD7-.js +1 -0
- package/dist/elements/chunks/{overlay-Cepd-KcS.js → overlay-DJL_sbOm.js} +1 -1
- package/dist/elements/chunks/{paperclip-CdwKjrlu.js → paperclip-CFaB8naM.js} +1 -1
- package/dist/elements/chunks/{progress-bar-DMVXBD3b.js → progress-bar-Br5SksfR.js} +1 -1
- package/dist/elements/chunks/{prompt-suggestion-Di_WZE_5.js → prompt-suggestion-CMIvtAhU.js} +1 -1
- package/dist/elements/chunks/{reasoning-D0jMch5u.js → reasoning-DpZcNzLq.js} +1 -1
- package/dist/elements/chunks/{resizable-1znbL1Gv.js → resizable-Q8i3T9a_.js} +1 -1
- package/dist/elements/chunks/{rotate-cw-DVhhgx8n.js → rotate-cw-B5IHCBFV.js} +1 -1
- package/dist/elements/chunks/{scroll-area-Bs4bFS1P.js → scroll-area-eLeydBje.js} +1 -1
- package/dist/elements/chunks/{scroll-button-Bet5NLc4.js → scroll-button-DWbz0yA1.js} +1 -1
- package/dist/elements/chunks/{separator-C5Gh8qGC.js → separator-Xic78AD_.js} +1 -1
- package/dist/elements/chunks/{settings-5vmEFg0K.js → settings-B8H51pAx.js} +1 -1
- package/dist/elements/chunks/{settings-group-BWLB38kz.js → settings-group-CsG9eYLe.js} +1 -1
- package/dist/elements/chunks/{share-BZ3G_DaB.js → share-CNTx0z__.js} +1 -1
- package/dist/elements/chunks/{skeleton-DafPJQTp.js → skeleton-CLlHTcMI.js} +1 -1
- package/dist/elements/chunks/{source-D_qj_6uJ.js → source-BoVcU5ok.js} +1 -1
- package/dist/elements/chunks/{star-Cuv7j2IE.js → star-CxQVTVhI.js} +1 -1
- package/dist/elements/chunks/{store-C1StPHfW.js → store-CLtS5CUG.js} +1 -1
- package/dist/elements/chunks/{tasks-card-EyoBZfpA.js → tasks-card-CzlkLmUt.js} +1 -1
- package/dist/elements/chunks/{text-shimmer-D9gRSh34.js → text-shimmer-D5NhpIQ1.js} +1 -1
- package/dist/elements/chunks/{textarea-DuhtHfcm.js → textarea-x5Uxsmtm.js} +1 -1
- package/dist/elements/chunks/{thumbs-up-B9hwv43w.js → thumbs-up-UobcJnx9.js} +1 -1
- package/dist/elements/chunks/{toast-store-Bm3DUEDe.js → toast-store-BOfs9eXq.js} +1 -1
- package/dist/elements/chunks/{tool-CDtW7L0z.js → tool-Be6Dh_dt.js} +1 -1
- package/dist/elements/chunks/{tooltip-eB226mGK.js → tooltip-RxMxyCLF.js} +1 -1
- package/dist/elements/chunks/{triangle-alert-C1SNzTqK.js → triangle-alert-C4yxH2XN.js} +1 -1
- package/dist/elements/chunks/{use-card-resolution-YZh2MvI5.js → use-card-resolution-jva9ehH6.js} +1 -1
- package/dist/elements/chunks/{variant-aurora-Cj1F7D0l.js → variant-aurora-Dx4VRcjS.js} +1 -1
- package/dist/elements/chunks/{variant-custom-T9gpt7QE.js → variant-custom-Y1ZTWgEa.js} +1 -1
- package/dist/elements/chunks/{variant-wave-CxU9z-TE.js → variant-wave-B9gml9Cg.js} +1 -1
- package/dist/elements/chunks/{video-CK4R7Rus.js → video-CrPHsytT.js} +1 -1
- package/dist/elements/chunks/x-_-OPHept.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-list.js +1 -1
- package/dist/elements/default-input.d.ts +27 -0
- package/dist/elements/dialog.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-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/remote.js +1 -1
- package/dist/elements/resizable.js +1 -1
- package/dist/elements/response-stream.js +2 -2
- 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/slot-text.d.ts +51 -0
- package/dist/elements/slots.d.ts +5 -0
- 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 +12 -6
- package/dist/index.js +1535 -1487
- package/dist/index.server.js +2330 -2296
- package/dist/kai.es.js +1 -1
- package/dist/llms/llms-full.txt +12 -3
- package/dist/mcp.es.js +809 -75
- package/dist/react/index.d.ts +13 -3
- package/dist/react.js +14 -14
- package/dist/register-impl-AxIlqjo7.js +145 -0
- package/dist/{solid-BCJUQqwS.js → solid-BGYSJyHG.js} +4901 -4691
- package/dist/{solid-BdENBcEq.js → solid-Dt2nEwfl.js} +4406 -4320
- package/dist/solid.js +1 -1
- package/dist/solid.server.js +1 -1
- package/dist/{variant-aurora-DOb_o4pC.js → variant-aurora-B44X69AG.js} +1 -1
- package/dist/{variant-aurora-BKHHiOgL.js → variant-aurora-BRhV8Flk.js} +2 -2
- package/dist/{variant-aurora-1wMcXRUS.js → variant-aurora-Ds5ou9BH.js} +2 -2
- package/dist/{variant-custom-DWSSgmd2.js → variant-custom-B20FhtYj.js} +2 -2
- package/dist/{variant-custom-CJGB0Kbw.js → variant-custom-BvA1Schl.js} +1 -1
- package/dist/{variant-custom-Co0CkXJF.js → variant-custom-D6Rtvneb.js} +2 -2
- package/dist/{variant-wave-CEODq-9q.js → variant-wave-BUQtkryq.js} +1 -1
- package/dist/{variant-wave-C3-45cL6.js → variant-wave-BVYnqy9L.js} +2 -2
- package/dist/{variant-wave-jdXBnCUZ.js → variant-wave-DXC6_LcH.js} +2 -2
- package/dist/wire/encode.d.ts +79 -6
- package/dist/wire/files.d.ts +116 -0
- package/dist/wire/index.d.ts +3 -1
- package/dist/wire/media-types.d.ts +106 -0
- package/dist/wire.js +596 -368
- package/frameworks/react/index.tsx +9 -5
- package/llms-full.txt +12 -3
- package/package.json +2 -1
- package/src/agent-tooling/archetypes.ts +43 -12
- package/src/agent-tooling/integrations/anthropic.ts +29 -5
- package/src/agent-tooling/integrations/cloudflare.ts +5 -0
- package/src/agent-tooling/integrations/langgraph.ts +13 -0
- package/src/agent-tooling/integrations/mastra.ts +46 -5
- package/src/agent-tooling/integrations/mock.ts +4 -0
- package/src/agent-tooling/integrations/ollama.ts +7 -0
- package/src/agent-tooling/integrations/openai.ts +2 -0
- package/src/agent-tooling/integrations/openrouter.ts +2 -0
- package/src/agent-tooling/integrations/pi.ts +26 -1
- package/src/agent-tooling/integrations/pydantic-ai.ts +37 -3
- package/src/agent-tooling/integrations/vercel-ai-sdk.ts +42 -6
- package/src/agent-tooling/mcp/tools/scaffold.ts +853 -32
- package/src/agent-tooling/registry.ts +57 -0
- package/src/agent-tooling/types.ts +132 -0
- package/src/components/chat-thread.tsx +10 -1
- package/src/components/context.tsx +18 -12
- package/src/components/conversation-item.tsx +6 -0
- package/src/components/model-switcher.tsx +38 -8
- package/src/components/toast.tsx +6 -1
- package/src/elements/button.tsx +26 -3
- package/src/elements/chat.tsx +28 -2
- package/src/elements/default-input.tsx +128 -5
- package/src/elements/element-meta.json +30 -4
- package/src/elements/element-types.d.ts +12 -6
- package/src/elements/menu.tsx +30 -3
- package/src/elements/slot-text.ts +73 -0
- package/src/elements/slots.ts +10 -0
- package/src/index.ts +9 -5
- package/src/wire/encode.ts +229 -14
- package/src/wire/files.ts +342 -0
- package/src/wire/index.ts +21 -0
- package/src/wire/media-types.ts +344 -0
- package/dist/elements/chunks/arrow-left-Bb46H7w9.js +0 -1
- package/dist/elements/chunks/check-C8desc_h.js +0 -1
- package/dist/elements/chunks/chevron-down-DKtc2HNB.js +0 -1
- package/dist/elements/chunks/chevron-right-Dw4GPhwL.js +0 -1
- package/dist/elements/chunks/circle-BeokBsvB.js +0 -1
- package/dist/elements/chunks/circle-check-wJSqt859.js +0 -1
- package/dist/elements/chunks/context-WHDl-xSx.js +0 -1
- package/dist/elements/chunks/conversation-list-CdR14_Y4.js +0 -1
- package/dist/elements/chunks/default-input-CSZqUM81.js +0 -1
- package/dist/elements/chunks/message-square-CnpAm_P0.js +0 -1
- package/dist/elements/chunks/model-switcher-CclaJEHt.js +0 -1
- package/dist/elements/chunks/x-D1qx0aLd.js +0 -1
- package/dist/register-impl-bzrZ44ft.js +0 -145
package/dist/solid.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, a as t, b as o, d as r, e as n, f as i, g as c, h as d, i as C, j as l, k as b, l as g, m, n as u, B as p, o as T, p as h, q as A, r as R, t as S, u as I, v as E, x as P, y as v, z as D, D as f, E as x, F as L, G as k, H as w, I as _, J as M, K as O, L as y, M as B, N as F, M as H, O as N, P as z, Q as V, R as U, S as G, T as Y, U as K, V as W, W as j, X as q, Y as J, Z as Q, _ as X, $ as Z, a0 as $, a1 as aa, a2 as sa, a3 as ea, a4 as ta, a5 as oa, a6 as ra, a7 as na, a8 as ia, a9 as ca, aa as da, ab as Ca, ac as la, ad as ba, ae as ga, af as ma, ag as ua, ah as pa, ai as Ta, aj as ha, ak as Aa, al as Ra, am as Sa, an as Ia, ao as Ea, ap as Pa, aq as va, ar as Da, as as fa, at as xa, au as La, av as ka, aw as wa, ax as _a, ay as Ma, az as Oa, aA as ya, aB as Ba, aC as Fa, aD as Ha, aE as Na, aF as za, aG as Va, aH as Ua, aI as Ga, aJ as Ya, aK as Ka, aL as Wa, aM as ja, aN as qa, aO as Ja, aP as Qa, aQ as Xa, aR as Za, aS as $a, aT as as, aU as ss, aV as es, aW as ts, aX as os, aY as rs, aZ as ns, a_ as is, a$ as cs, b0 as ds, b1 as Cs, b2 as ls, b3 as bs, b4 as gs, b5 as ms, b6 as us, b7 as ps, b8 as Ts, b9 as hs, ba as As, bb as Rs, bc as Ss, bd as Is, be as Es, bf as Ps, bg as vs, bh as Ds, bi as fs, bj as xs, bk as Ls, bl as ks, bm as ws, bn as _s, bo as Ms, bp as Os, bq as ys, br as Bs, bs as Fs, bt as Hs, bu as Ns, bv as zs, bw as Vs, bx as Us, by as Gs, bz as Ys, bA as Ks, bB as Ws, bC as js, bD as qs, bE as Js, bF as Qs, bG as Xs, bH as Zs, bI as $s, bJ as ae, bK as se, bL as ee, bM as te, bN as oe, bO as re, bP as ne, bQ as ie, bR as ce, bS as de, bT as Ce, bU as le, bV as be, bW as ge, bX as me, bY as ue, bZ as pe, b_ as Te, b$ as he, c0 as Ae, c1 as Re, c2 as Se, c3 as Ie, c4 as Ee, c5 as Pe, c6 as ve, c as De, c7 as fe, c8 as xe, c9 as Le, ca as ke, cb as we, cc as _e, cd as Me, ce as Oe, cf as ye, cg as Be, ch as Fe, ci as He, cj as Ne, ck as ze, cl as Ve, cm as Ue, cn as Ge, co as Ye, cp as Ke, cq as We, cr as je, cs as qe, ct as Je, cu as Qe, cv as Xe, cw as Ze, cx as $e, cy as at, cz as st, cA as et, cB as tt, cC as ot, cD as rt, cE as nt, cF as it, cG as ct, cH as dt, cI as Ct, cJ as lt, cK as bt, cL as gt, cM as mt, cN as ut, cO as pt, cP as Tt, cQ as ht, cR as At, cS as Rt, cT as St, cU as It, cV as Et, cW as Pt, cX as vt, cY as Dt, cZ as ft, c_ as xt, c$ as Lt, d0 as kt, d1 as wt, d2 as _t, d3 as Mt, d4 as Ot, d5 as yt, d6 as Bt, d7 as Ft, d8 as Ht, d9 as Nt, da as zt, db as Vt, dc as Ut, dd as Gt } from "./solid-
|
|
1
|
+
import { A as e, a as t, b as o, d as r, e as n, f as i, g as c, h as d, i as C, j as l, k as b, l as g, m, n as u, B as p, o as T, p as h, q as A, r as R, t as S, u as I, v as E, x as P, y as v, z as D, D as f, E as x, F as L, G as k, H as w, I as _, J as M, K as O, L as y, M as B, N as F, M as H, O as N, P as z, Q as V, R as U, S as G, T as Y, U as K, V as W, W as j, X as q, Y as J, Z as Q, _ as X, $ as Z, a0 as $, a1 as aa, a2 as sa, a3 as ea, a4 as ta, a5 as oa, a6 as ra, a7 as na, a8 as ia, a9 as ca, aa as da, ab as Ca, ac as la, ad as ba, ae as ga, af as ma, ag as ua, ah as pa, ai as Ta, aj as ha, ak as Aa, al as Ra, am as Sa, an as Ia, ao as Ea, ap as Pa, aq as va, ar as Da, as as fa, at as xa, au as La, av as ka, aw as wa, ax as _a, ay as Ma, az as Oa, aA as ya, aB as Ba, aC as Fa, aD as Ha, aE as Na, aF as za, aG as Va, aH as Ua, aI as Ga, aJ as Ya, aK as Ka, aL as Wa, aM as ja, aN as qa, aO as Ja, aP as Qa, aQ as Xa, aR as Za, aS as $a, aT as as, aU as ss, aV as es, aW as ts, aX as os, aY as rs, aZ as ns, a_ as is, a$ as cs, b0 as ds, b1 as Cs, b2 as ls, b3 as bs, b4 as gs, b5 as ms, b6 as us, b7 as ps, b8 as Ts, b9 as hs, ba as As, bb as Rs, bc as Ss, bd as Is, be as Es, bf as Ps, bg as vs, bh as Ds, bi as fs, bj as xs, bk as Ls, bl as ks, bm as ws, bn as _s, bo as Ms, bp as Os, bq as ys, br as Bs, bs as Fs, bt as Hs, bu as Ns, bv as zs, bw as Vs, bx as Us, by as Gs, bz as Ys, bA as Ks, bB as Ws, bC as js, bD as qs, bE as Js, bF as Qs, bG as Xs, bH as Zs, bI as $s, bJ as ae, bK as se, bL as ee, bM as te, bN as oe, bO as re, bP as ne, bQ as ie, bR as ce, bS as de, bT as Ce, bU as le, bV as be, bW as ge, bX as me, bY as ue, bZ as pe, b_ as Te, b$ as he, c0 as Ae, c1 as Re, c2 as Se, c3 as Ie, c4 as Ee, c5 as Pe, c6 as ve, c as De, c7 as fe, c8 as xe, c9 as Le, ca as ke, cb as we, cc as _e, cd as Me, ce as Oe, cf as ye, cg as Be, ch as Fe, ci as He, cj as Ne, ck as ze, cl as Ve, cm as Ue, cn as Ge, co as Ye, cp as Ke, cq as We, cr as je, cs as qe, ct as Je, cu as Qe, cv as Xe, cw as Ze, cx as $e, cy as at, cz as st, cA as et, cB as tt, cC as ot, cD as rt, cE as nt, cF as it, cG as ct, cH as dt, cI as Ct, cJ as lt, cK as bt, cL as gt, cM as mt, cN as ut, cO as pt, cP as Tt, cQ as ht, cR as At, cS as Rt, cT as St, cU as It, cV as Et, cW as Pt, cX as vt, cY as Dt, cZ as ft, c_ as xt, c$ as Lt, d0 as kt, d1 as wt, d2 as _t, d3 as Mt, d4 as Ot, d5 as yt, d6 as Bt, d7 as Ft, d8 as Ht, d9 as Nt, da as zt, db as Vt, dc as Ut, dd as Gt } from "./solid-BGYSJyHG.js";
|
|
2
2
|
export {
|
|
3
3
|
e as AgentCard,
|
|
4
4
|
t as Artifact,
|
package/dist/solid.server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, a as t, b as o, d as r, e as n, f as i, g as c, h as d, i as C, j as l, k as b, l as g, m, n as u, B as p, o as T, p as h, q as A, r as R, t as S, u as I, v as E, x as P, y as v, z as D, D as f, E as x, F as L, G as k, H as w, I as _, J as M, K as O, L as y, M as B, N as F, M as H, O as N, P as z, Q as V, R as U, S as G, T as Y, U as K, V as W, W as j, X as q, Y as J, Z as Q, _ as X, $ as Z, a0 as $, a1 as aa, a2 as sa, a3 as ea, a4 as ta, a5 as oa, a6 as ra, a7 as na, a8 as ia, a9 as ca, aa as da, ab as Ca, ac as la, ad as ba, ae as ga, af as ma, ag as ua, ah as pa, ai as Ta, aj as ha, ak as Aa, al as Ra, am as Sa, an as Ia, ao as Ea, ap as Pa, aq as va, ar as Da, as as fa, at as xa, au as La, av as ka, aw as wa, ax as _a, ay as Ma, az as Oa, aA as ya, aB as Ba, aC as Fa, aD as Ha, aE as Na, aF as za, aG as Va, aH as Ua, aI as Ga, aJ as Ya, aK as Ka, aL as Wa, aM as ja, aN as qa, aO as Ja, aP as Qa, aQ as Xa, aR as Za, aS as $a, aT as as, aU as ss, aV as es, aW as ts, aX as os, aY as rs, aZ as ns, a_ as is, a$ as cs, b0 as ds, b1 as Cs, b2 as ls, b3 as bs, b4 as gs, b5 as ms, b6 as us, b7 as ps, b8 as Ts, b9 as hs, ba as As, bb as Rs, bc as Ss, bd as Is, be as Es, bf as Ps, bg as vs, bh as Ds, bi as fs, bj as xs, bk as Ls, bl as ks, bm as ws, bn as _s, bo as Ms, bp as Os, bq as ys, br as Bs, bs as Fs, bt as Hs, bu as Ns, bv as zs, bw as Vs, bx as Us, by as Gs, bz as Ys, bA as Ks, bB as Ws, bC as js, bD as qs, bE as Js, bF as Qs, bG as Xs, bH as Zs, bI as $s, bJ as ae, bK as se, bL as ee, bM as te, bN as oe, bO as re, bP as ne, bQ as ie, bR as ce, bS as de, bT as Ce, bU as le, bV as be, bW as ge, bX as me, bY as ue, bZ as pe, b_ as Te, b$ as he, c0 as Ae, c1 as Re, c2 as Se, c3 as Ie, c4 as Ee, c5 as Pe, c6 as ve, c as De, c7 as fe, c8 as xe, c9 as Le, ca as ke, cb as we, cc as _e, cd as Me, ce as Oe, cf as ye, cg as Be, ch as Fe, ci as He, cj as Ne, ck as ze, cl as Ve, cm as Ue, cn as Ge, co as Ye, cp as Ke, cq as We, cr as je, cs as qe, ct as Je, cu as Qe, cv as Xe, cw as Ze, cx as $e, cy as at, cz as st, cA as et, cB as tt, cC as ot, cD as rt, cE as nt, cF as it, cG as ct, cH as dt, cI as Ct, cJ as lt, cK as bt, cL as gt, cM as mt, cN as ut, cO as pt, cP as Tt, cQ as ht, cR as At, cS as Rt, cT as St, cU as It, cV as Et, cW as Pt, cX as vt, cY as Dt, cZ as ft, c_ as xt, c$ as Lt, d0 as kt, d1 as wt, d2 as _t, d3 as Mt, d4 as Ot, d5 as yt, d6 as Bt, d7 as Ft, d8 as Ht, d9 as Nt, da as zt, db as Vt, dc as Ut, dd as Gt } from "./solid-
|
|
1
|
+
import { A as e, a as t, b as o, d as r, e as n, f as i, g as c, h as d, i as C, j as l, k as b, l as g, m, n as u, B as p, o as T, p as h, q as A, r as R, t as S, u as I, v as E, x as P, y as v, z as D, D as f, E as x, F as L, G as k, H as w, I as _, J as M, K as O, L as y, M as B, N as F, M as H, O as N, P as z, Q as V, R as U, S as G, T as Y, U as K, V as W, W as j, X as q, Y as J, Z as Q, _ as X, $ as Z, a0 as $, a1 as aa, a2 as sa, a3 as ea, a4 as ta, a5 as oa, a6 as ra, a7 as na, a8 as ia, a9 as ca, aa as da, ab as Ca, ac as la, ad as ba, ae as ga, af as ma, ag as ua, ah as pa, ai as Ta, aj as ha, ak as Aa, al as Ra, am as Sa, an as Ia, ao as Ea, ap as Pa, aq as va, ar as Da, as as fa, at as xa, au as La, av as ka, aw as wa, ax as _a, ay as Ma, az as Oa, aA as ya, aB as Ba, aC as Fa, aD as Ha, aE as Na, aF as za, aG as Va, aH as Ua, aI as Ga, aJ as Ya, aK as Ka, aL as Wa, aM as ja, aN as qa, aO as Ja, aP as Qa, aQ as Xa, aR as Za, aS as $a, aT as as, aU as ss, aV as es, aW as ts, aX as os, aY as rs, aZ as ns, a_ as is, a$ as cs, b0 as ds, b1 as Cs, b2 as ls, b3 as bs, b4 as gs, b5 as ms, b6 as us, b7 as ps, b8 as Ts, b9 as hs, ba as As, bb as Rs, bc as Ss, bd as Is, be as Es, bf as Ps, bg as vs, bh as Ds, bi as fs, bj as xs, bk as Ls, bl as ks, bm as ws, bn as _s, bo as Ms, bp as Os, bq as ys, br as Bs, bs as Fs, bt as Hs, bu as Ns, bv as zs, bw as Vs, bx as Us, by as Gs, bz as Ys, bA as Ks, bB as Ws, bC as js, bD as qs, bE as Js, bF as Qs, bG as Xs, bH as Zs, bI as $s, bJ as ae, bK as se, bL as ee, bM as te, bN as oe, bO as re, bP as ne, bQ as ie, bR as ce, bS as de, bT as Ce, bU as le, bV as be, bW as ge, bX as me, bY as ue, bZ as pe, b_ as Te, b$ as he, c0 as Ae, c1 as Re, c2 as Se, c3 as Ie, c4 as Ee, c5 as Pe, c6 as ve, c as De, c7 as fe, c8 as xe, c9 as Le, ca as ke, cb as we, cc as _e, cd as Me, ce as Oe, cf as ye, cg as Be, ch as Fe, ci as He, cj as Ne, ck as ze, cl as Ve, cm as Ue, cn as Ge, co as Ye, cp as Ke, cq as We, cr as je, cs as qe, ct as Je, cu as Qe, cv as Xe, cw as Ze, cx as $e, cy as at, cz as st, cA as et, cB as tt, cC as ot, cD as rt, cE as nt, cF as it, cG as ct, cH as dt, cI as Ct, cJ as lt, cK as bt, cL as gt, cM as mt, cN as ut, cO as pt, cP as Tt, cQ as ht, cR as At, cS as Rt, cT as St, cU as It, cV as Et, cW as Pt, cX as vt, cY as Dt, cZ as ft, c_ as xt, c$ as Lt, d0 as kt, d1 as wt, d2 as _t, d3 as Mt, d4 as Ot, d5 as yt, d6 as Bt, d7 as Ft, d8 as Ht, d9 as Nt, da as zt, db as Vt, dc as Ut, dd as Gt } from "./solid-Dt2nEwfl.js";
|
|
2
2
|
export {
|
|
3
3
|
e as AgentCard,
|
|
4
4
|
t as Artifact,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as x,s as y,c as b,a as w,C as R,t as A}from"./register-impl-
|
|
1
|
+
import{i as x,s as y,c as b,a as w,C as R,t as A}from"./register-impl-AxIlqjo7.js";import{d as u,j as S,b as _,f as k,o as M}from"./kai.es.js";import{c as n,h as T,S as W,D as C}from"./create-tween-qs-jjvNA.js";const q=`
|
|
2
2
|
const float PI = 3.14159265359;
|
|
3
3
|
// Strand phase span: 0.5 + pi (fact sheet section 2's "sigma", the
|
|
4
4
|
// midpoint of the interval [1, 2*pi] with the interpolation knob fixed
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { insert as x, createComponent as y, effect as b, setAttribute as w, className as R, setStyleProperty as A, template as S } from "solid-js/web";
|
|
2
2
|
import { createEffect as u, createSignal as k, onCleanup as C } from "solid-js";
|
|
3
|
-
import { c as l, S as T, h as _, D as M } from "./create-tween-
|
|
4
|
-
import { C as W } from "./solid-
|
|
3
|
+
import { c as l, S as T, h as _, D as M } from "./create-tween-DmTUaXWE.js";
|
|
4
|
+
import { C as W } from "./solid-BGYSJyHG.js";
|
|
5
5
|
const z = `
|
|
6
6
|
const float PI = 3.14159265359;
|
|
7
7
|
// Strand phase span: 0.5 + pi (fact sheet section 2's "sigma", the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ssr as b, ssrAttribute as h, escape as l, ssrStyleProperty as d, createComponent as w } from "solid-js/web";
|
|
2
2
|
import { createEffect as u, createSignal as R, onCleanup as A } from "solid-js";
|
|
3
|
-
import { c, S, h as _, D as k } from "./create-tween-
|
|
4
|
-
import { C } from "./solid-
|
|
3
|
+
import { c, S, h as _, D as k } from "./create-tween-COnPwAQN.js";
|
|
4
|
+
import { C } from "./solid-Dt2nEwfl.js";
|
|
5
5
|
const T = `
|
|
6
6
|
const float PI = 3.14159265359;
|
|
7
7
|
// Strand phase span: 0.5 + pi (fact sheet section 2's "sigma", the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createComponent as c, ssr as m, ssrAttribute as o, escape as u, ssrStyle as d } from "solid-js/web";
|
|
2
2
|
import { createEffect as v, createMemo as g, Show as y } from "solid-js";
|
|
3
|
-
import { c as b, D as x, S as $, h as S } from "./create-tween-
|
|
4
|
-
import { s as z, C as A } from "./solid-
|
|
3
|
+
import { c as b, D as x, S as $, h as S } from "./create-tween-COnPwAQN.js";
|
|
4
|
+
import { s as z, C as A } from "./solid-Dt2nEwfl.js";
|
|
5
5
|
var h = ["<div", ' style="', '"></div>'], C = ["<div", ' style="', '">', "</div>"];
|
|
6
6
|
const E = {
|
|
7
7
|
"1f": !0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as k,i as w,s as d,c,d as m,t as S,C as M}from"./register-impl-
|
|
1
|
+
import{b as k,i as w,s as d,c,d as m,t as S,C as M}from"./register-impl-AxIlqjo7.js";import{d as h,c as A,j as y,S as g,b as p}from"./kai.es.js";import{c as x,S as N,h as j,D as C}from"./create-tween-qs-jjvNA.js";var b=S("<div>");const E={"1f":!0,"1i":!0,"1fv":!0,"2f":!0,"3f":!0,"3fv":!0,"4f":!0,"4fv":!0,Matrix2fv:!0,Matrix3fv:!0,Matrix4fv:!0},V=new Set(["1f","1i"]),F={"2f":2,"3f":3,"4f":4,Matrix2fv:4,Matrix3fv:9,Matrix4fv:16};function O(r,e){if(e==null||typeof e!="object")return`uniform "${r}" is not a valid declaration (expected an object with "type" and "value").`;if(E[e.type]!==!0)return`uniform "${r}" has an unrecognized type "${String(e.type)}".`;if(V.has(e.type))return typeof e.value!="number"||!Number.isFinite(e.value)?`uniform "${r}" is declared "${e.type}" (a number) but its value is not a finite number.`:void 0;if(!Array.isArray(e.value)||e.value.some(s=>typeof s!="number"||!Number.isFinite(s)))return`uniform "${r}" is declared "${e.type}" (an array) but its value is not an array of finite numbers.`;const o=F[e.type];if(o!==void 0&&e.value.length!==o)return`uniform "${r}" is declared "${e.type}", which takes exactly ${o} numbers, but its value has ${e.value.length}.`}function $(r,e){const o=r.bands.length?r.bands:[0],s={uColor:{type:"3fv",value:j(r.color)},uIntensity:{type:"1f",value:r.intensity},uSpeed:{type:"1f",value:r.speed},uComplexity:{type:"1f",value:r.complexity},uVolume:{type:"1f",value:r.volume},uBands:{type:"1fv",value:o,arraySize:o.length}};if(!e)return s;for(const[l,v]of Object.entries(e)){const t=O(l,v);if(t)throw new Error(t)}return{...s,...e}}function U(r){const e=x(.3),o=x(1);h(()=>{const t=k(r.state);if(r.state==="speaking")e.to(.3+.7*r.volume,{duration:0});else{const a=r.frozen?{duration:0}:{duration:.5,ease:"easeOut"};e.to(Array.isArray(t.intensity)&&r.frozen?t.intensity[0]:t.intensity,a)}o.to(r.frozen?0:t.speed,{duration:0})});const s=A(()=>{var t;try{return{uniforms:$({color:r.color??C,intensity:e.value(),speed:o.value(),complexity:r.complexity??.5,volume:r.volume,bands:r.bands},(t=r.shader)==null?void 0:t.uniforms)}}catch(a){return{error:a instanceof Error?a.message:String(a)}}});let l=!1;h(()=>{const{error:t}=s();if(!t){l=!1;return}l||(l=!0,console.error(`<kai-audio-visualizer variant="custom">: ${t}`),r.onUnavailable())});const v=()=>({height:`${M[r.size]}px`,"aspect-ratio":"1"});return y(g,{get when(){var t;return(t=r.shader)==null?void 0:t.fragment},get fallback(){return(()=>{var t=b();return p(a=>{var n=r.state,i=r.class,u=v();return n!==a.e&&d(t,"data-kai-state",a.e=n),i!==a.t&&c(t,a.t=i),a.a=m(t,u,a.a),a},{e:void 0,t:void 0,a:void 0}),t})()},children:t=>y(g,{get when(){return s().uniforms},get fallback(){return(()=>{var a=b();return p(n=>{var i=r.state,u=r.class,f=v();return i!==n.e&&d(a,"data-kai-state",n.e=i),u!==n.t&&c(a,n.t=u),n.a=m(a,f,n.a),n},{e:void 0,t:void 0,a:void 0}),a})()},children:a=>(()=>{var n=b();return w(n,y(N,{get fragment(){return t()},get precision(){return r.size==="icon"||r.size==="sm"?"mediump":"highp"},get uniforms(){return a()},get animateWhenNotVisible(){return r.animateWhenNotVisible},onError:i=>{/not available/i.test(i)?console.warn('<kai-audio-visualizer variant="custom">: shader unavailable',i):console.error('<kai-audio-visualizer variant="custom">: shader error',i),r.onUnavailable()}})),p(i=>{var u=r.state,f=r.class,z=v();return u!==i.e&&d(n,"data-kai-state",i.e=u),f!==i.t&&c(n,i.t=f),i.a=m(n,z,i.a),i},{e:void 0,t:void 0,a:void 0}),n})()})})}export{$ as customUniforms,U as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createComponent as d, insert as A, effect as m, setAttribute as c, className as y, style as b, template as C } from "solid-js/web";
|
|
2
2
|
import { createEffect as g, createMemo as E, Show as x } from "solid-js";
|
|
3
|
-
import { c as S, D as N, S as k, h as w } from "./create-tween-
|
|
4
|
-
import { s as M, C as T } from "./solid-
|
|
3
|
+
import { c as S, D as N, S as k, h as w } from "./create-tween-DmTUaXWE.js";
|
|
4
|
+
import { s as M, C as T } from "./solid-BGYSJyHG.js";
|
|
5
5
|
var h = /* @__PURE__ */ C("<div>");
|
|
6
6
|
const O = {
|
|
7
7
|
"1f": !0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as p,s as m,c as h,a as x,C as g,t as y,w as b}from"./register-impl-
|
|
1
|
+
import{i as p,s as m,c as h,a as x,C as g,t as y,w as b}from"./register-impl-AxIlqjo7.js";import{d as v,j as w,b as C}from"./kai.es.js";import{c as r,h as z,S,D as U}from"./create-tween-qs-jjvNA.js";const F=`
|
|
2
2
|
const float TAU = 6.28318530718;
|
|
3
3
|
|
|
4
4
|
// Noise for dithering
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { insert as m, createComponent as h, effect as p, setAttribute as x, className as g, setStyleProperty as y, template as b } from "solid-js/web";
|
|
2
2
|
import { createEffect as v } from "solid-js";
|
|
3
|
-
import { c as r, S as w, h as C, D as S } from "./create-tween-
|
|
4
|
-
import { C as z, w as U } from "./solid-
|
|
3
|
+
import { c as r, S as w, h as C, D as S } from "./create-tween-DmTUaXWE.js";
|
|
4
|
+
import { C as z, w as U } from "./solid-BGYSJyHG.js";
|
|
5
5
|
const A = `
|
|
6
6
|
const float TAU = 6.28318530718;
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ssr as m, ssrAttribute as f, escape as o, ssrStyleProperty as l, createComponent as h } from "solid-js/web";
|
|
2
2
|
import { createEffect as d } from "solid-js";
|
|
3
|
-
import { c, S as p, h as x, D as g } from "./create-tween-
|
|
4
|
-
import { C as y, w as b } from "./solid-
|
|
3
|
+
import { c, S as p, h as x, D as g } from "./create-tween-COnPwAQN.js";
|
|
4
|
+
import { C as y, w as b } from "./solid-Dt2nEwfl.js";
|
|
5
5
|
const w = `
|
|
6
6
|
const float TAU = 6.28318530718;
|
|
7
7
|
|
package/dist/wire/encode.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChatMessage } from '../elements/chat-types.js';
|
|
2
|
+
import { MediaTypeFilter } from './media-types.js';
|
|
2
3
|
export interface OpenAIToolCall {
|
|
3
4
|
id: string;
|
|
4
5
|
type: 'function';
|
|
@@ -12,9 +13,30 @@ export interface OpenAIToolCall {
|
|
|
12
13
|
* through UNTOUCHED, and a closed type would be a list of the fields we happen
|
|
13
14
|
* to have seen. */
|
|
14
15
|
export type OpenAIReasoningDetail = Record<string, unknown>;
|
|
16
|
+
/** A multimodal user message's content entries. `image_url` takes an https URL
|
|
17
|
+
* or a `data:` URI in the same field; `file` takes `file_data`, which is a DATA
|
|
18
|
+
* URI on this wire (`data:application/pdf;base64,...`) and not bare base64. */
|
|
19
|
+
export type OpenAIContentPart = {
|
|
20
|
+
type: 'text';
|
|
21
|
+
text: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'image_url';
|
|
24
|
+
image_url: {
|
|
25
|
+
url: string;
|
|
26
|
+
};
|
|
27
|
+
} | {
|
|
28
|
+
type: 'file';
|
|
29
|
+
file: {
|
|
30
|
+
filename?: string;
|
|
31
|
+
file_data: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
15
34
|
export interface OpenAIWireMessage {
|
|
16
35
|
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
17
|
-
|
|
36
|
+
/** An ARRAY only when the turn carries an encodable `file` part. A text-only
|
|
37
|
+
* turn stays a plain string, so adding attachment support changed nothing
|
|
38
|
+
* about what an existing thread puts on the wire. */
|
|
39
|
+
content: string | OpenAIContentPart[] | null;
|
|
18
40
|
tool_calls?: OpenAIToolCall[];
|
|
19
41
|
tool_call_id?: string;
|
|
20
42
|
name?: string;
|
|
@@ -22,7 +44,10 @@ export interface OpenAIWireMessage {
|
|
|
22
44
|
* `OpenAIEncodeOptions.reasoning`. */
|
|
23
45
|
reasoning_details?: OpenAIReasoningDetail[];
|
|
24
46
|
}
|
|
25
|
-
|
|
47
|
+
/** EXTENDS rather than restates the file options: `onUnencodableFile` and
|
|
48
|
+
* `accept` mean the same thing on both wires, and a second declaration of them
|
|
49
|
+
* here is a second place to forget to update. */
|
|
50
|
+
export interface OpenAIEncodeOptions extends FileEncodeOptions {
|
|
26
51
|
/**
|
|
27
52
|
* Whether to send the assistant's own reasoning back with the thread.
|
|
28
53
|
*
|
|
@@ -46,6 +71,37 @@ export interface OpenAIEncodeOptions {
|
|
|
46
71
|
*/
|
|
47
72
|
reasoning?: 'omit' | 'include';
|
|
48
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* What to do with a `file` part this wire cannot carry.
|
|
76
|
+
*
|
|
77
|
+
* DEFAULT `'throw'`, and the default is the whole point. Skipping is how
|
|
78
|
+
* attachments came to render perfectly in the thread and reach the model as
|
|
79
|
+
* nothing: the developer wires up upload, watches it work, and ships a model
|
|
80
|
+
* that cannot see the file. A throw here names the message, the part and the
|
|
81
|
+
* reason, which is strictly more than a 400 at request time would tell you.
|
|
82
|
+
*
|
|
83
|
+
* `'skip'` restores the lenient behaviour for a host that would rather send a
|
|
84
|
+
* degraded turn than fail one. It is silent, but it is silence the developer
|
|
85
|
+
* asked for by name, which is the difference that matters.
|
|
86
|
+
*/
|
|
87
|
+
export type UnencodableFilePolicy = 'throw' | 'skip';
|
|
88
|
+
export interface FileEncodeOptions {
|
|
89
|
+
onUnencodableFile?: UnencodableFilePolicy;
|
|
90
|
+
/**
|
|
91
|
+
* Narrow which attachment media types reach the wire, as HTML `accept` syntax
|
|
92
|
+
* (`'image/*,application/pdf'`) or an array of the same.
|
|
93
|
+
*
|
|
94
|
+
* THE SAME STRING the composer takes as `<kai-chat accept="...">`, resolved by
|
|
95
|
+
* the same function against the same declaration -- so a developer writes the
|
|
96
|
+
* set once as a constant and hands it to both ends. Omitted means the kit's
|
|
97
|
+
* full capability set, which is `encodableMediaTypes()`.
|
|
98
|
+
*
|
|
99
|
+
* It can only NARROW. Naming a type the encoders cannot represent does not
|
|
100
|
+
* enable it; that would just move the failure to a provider 400.
|
|
101
|
+
*/
|
|
102
|
+
accept?: MediaTypeFilter;
|
|
103
|
+
}
|
|
104
|
+
export type AnthropicEncodeOptions = FileEncodeOptions;
|
|
49
105
|
/** Anthropic content blocks are an open, provider-owned union. Keeping them as
|
|
50
106
|
* records is what lets a verbatim `thinking` payload pass through UNTOUCHED,
|
|
51
107
|
* which is the entire point of this encoder. */
|
|
@@ -98,9 +154,19 @@ export declare class WireEncodeError extends Error {
|
|
|
98
154
|
* text and no settled tool is skipped exactly as before, rather than becoming
|
|
99
155
|
* `{ content: null }` with no `tool_calls`.
|
|
100
156
|
*
|
|
101
|
-
* `card
|
|
102
|
-
*
|
|
103
|
-
*
|
|
157
|
+
* `card` and `source` parts are never encoded; they are kit-side.
|
|
158
|
+
*
|
|
159
|
+
* `file` parts ARE encoded, on a USER turn, and a turn carrying nothing but an
|
|
160
|
+
* attachment is now a real message rather than nothing. Images become
|
|
161
|
+
* `image_url` (https URL or `data:` URI alike); a base64 PDF becomes a `file`
|
|
162
|
+
* part whose `file_data` is the data URI. Two cases have no form here and THROW
|
|
163
|
+
* by default: a remote PDF, because this wire's `file` part has no URL variant,
|
|
164
|
+
* and anything that is neither -- see `UnencodableFilePolicy` for why the
|
|
165
|
+
* default is a throw and not a skip.
|
|
166
|
+
*
|
|
167
|
+
* A `file` part on an ASSISTANT turn is still dropped. Neither API accepts image
|
|
168
|
+
* or document content in an assistant message, so there is nothing to encode it
|
|
169
|
+
* to; attachments belong to the user turn that sent them.
|
|
104
170
|
*/
|
|
105
171
|
export declare function toOpenAIMessages(messages: ChatMessage[], options?: OpenAIEncodeOptions): OpenAIWireMessage[];
|
|
106
172
|
/**
|
|
@@ -141,8 +207,15 @@ export declare function toOpenAIMessages(messages: ChatMessage[], options?: Open
|
|
|
141
207
|
* tool_result message always follows its assistant message and can never be
|
|
142
208
|
* appended after a plain user turn.
|
|
143
209
|
*
|
|
210
|
+
* `file` parts on a USER turn become `image` and `document` blocks, in part
|
|
211
|
+
* order. Both take `source: {type:'base64'}` and `source: {type:'url'}`, so this
|
|
212
|
+
* wire can carry a remote PDF that `toOpenAIMessages` has to refuse. Anything
|
|
213
|
+
* neither API accepts as message content THROWS by default; see
|
|
214
|
+
* `UnencodableFilePolicy`. A `file` part on an ASSISTANT turn is dropped, because
|
|
215
|
+
* an assistant message here carries only text, thinking and tool_use.
|
|
216
|
+
*
|
|
144
217
|
* Asymmetry worth knowing: `tool_use.input` is a parsed OBJECT on this wire, not
|
|
145
218
|
* a string, so it uses `input` and not `rawInput`. Only thinking blocks carry a
|
|
146
219
|
* verbatim requirement.
|
|
147
220
|
*/
|
|
148
|
-
export declare function toAnthropicMessages(messages: ChatMessage[]): AnthropicWireMessage[];
|
|
221
|
+
export declare function toAnthropicMessages(messages: ChatMessage[], options?: AnthropicEncodeOptions): AnthropicWireMessage[];
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { AttachmentData } from '../components/attachment-types.js';
|
|
2
|
+
import { MediaPolicy } from './media-types.js';
|
|
3
|
+
/** Where the bytes live. `base64` carries them inline; `remote` is an address
|
|
4
|
+
* the PROVIDER dereferences, never us. */
|
|
5
|
+
export type FileSource = {
|
|
6
|
+
type: 'base64';
|
|
7
|
+
mediaType: string;
|
|
8
|
+
data: string;
|
|
9
|
+
dataUri: string;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'remote';
|
|
12
|
+
url: string;
|
|
13
|
+
};
|
|
14
|
+
/** Bytes already in hand, shaped for the provider. A union rather than an
|
|
15
|
+
* optional `text` field so neither encoder can reach for text that is not
|
|
16
|
+
* there, and so adding a kind is a compile error at both wires rather than a
|
|
17
|
+
* silently unhandled branch. */
|
|
18
|
+
export type ClassifiedFile =
|
|
19
|
+
/** Named for the Anthropic blocks they become. `document` is PDF-only. */
|
|
20
|
+
{
|
|
21
|
+
kind: 'image';
|
|
22
|
+
mediaType: string;
|
|
23
|
+
source: FileSource;
|
|
24
|
+
filename?: string;
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'document';
|
|
27
|
+
mediaType: string;
|
|
28
|
+
source: FileSource;
|
|
29
|
+
filename?: string;
|
|
30
|
+
}
|
|
31
|
+
/** The bytes, decoded. A text file rides as TEXT CONTENT on both wires --
|
|
32
|
+
* neither API has an arbitrary-file block, so this is the only representation
|
|
33
|
+
* the wire can express, not a preference. `source` is narrowed to `base64`
|
|
34
|
+
* because the text has to be in hand to inline it, and fetching a remote one
|
|
35
|
+
* would put I/O in the encoder. */
|
|
36
|
+
| {
|
|
37
|
+
kind: 'text';
|
|
38
|
+
mediaType: string;
|
|
39
|
+
source: Extract<FileSource, {
|
|
40
|
+
type: 'base64';
|
|
41
|
+
}>;
|
|
42
|
+
filename?: string;
|
|
43
|
+
text: string;
|
|
44
|
+
};
|
|
45
|
+
export type FileClassification =
|
|
46
|
+
/** Ready for either wire to shape. A wire may still refuse it -- see
|
|
47
|
+
* OpenAI and remote PDFs -- but the attachment itself is sound. */
|
|
48
|
+
{
|
|
49
|
+
status: 'encodable';
|
|
50
|
+
file: ClassifiedFile;
|
|
51
|
+
}
|
|
52
|
+
/** Not an upload at all. A `source-document` is the citation chip an app
|
|
53
|
+
* renders next to a RAG answer, not something the user staged to send, and
|
|
54
|
+
* its content is already in the prompt that produced the answer. Encoding it
|
|
55
|
+
* would send the same text twice. */
|
|
56
|
+
| {
|
|
57
|
+
status: 'kit-side';
|
|
58
|
+
}
|
|
59
|
+
/** Cannot reach a model. `reason` completes the sentence "Cannot encode file
|
|
60
|
+
* part N of message X: ...", so it explains AND says what to do. */
|
|
61
|
+
| {
|
|
62
|
+
status: 'unencodable';
|
|
63
|
+
reason: string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* The text content a text attachment contributes to the prompt.
|
|
67
|
+
*
|
|
68
|
+
* ★ THE SWAP POINT for how a text file appears in a message, and the shape is
|
|
69
|
+
* SETTLED: `<file name="..." type="...">…</file>`. Two alternatives were weighed
|
|
70
|
+
* and rejected. A bare `filename:\n` prefix marks where the file BEGINS and not
|
|
71
|
+
* where it ends, so the next part of the turn reads as more file. An Anthropic
|
|
72
|
+
* `document` block would buy citations, but it is Anthropic-specific -- the
|
|
73
|
+
* OpenAI wire has no equivalent, so the two wires would disagree about one
|
|
74
|
+
* attachment -- and it needs a Files API upload round trip, which is I/O, in a
|
|
75
|
+
* layer that by design has none. Changing the envelope is still a change to this
|
|
76
|
+
* function and nothing else; it just is not an open question.
|
|
77
|
+
*
|
|
78
|
+
* ★ WHY THE BODY IS BARELY TOUCHED. Both attributes are escaped in full, as
|
|
79
|
+
* attributes always are. The body is not, and that is deliberate: these are
|
|
80
|
+
* source files, a reader will diff what they attached against what arrived, and
|
|
81
|
+
* XML-escaping every `<` in a TSX file would mangle the exact thing this feature
|
|
82
|
+
* exists to send and pay tokens to do it. So the body transform is the smallest
|
|
83
|
+
* one that makes the delimiter unforgeable -- the end tag, and nothing else.
|
|
84
|
+
*
|
|
85
|
+
* Left alone, that end tag is a way out of the block. A file containing `</file>`
|
|
86
|
+
* closes it early, and everything after that point reads to the model as the turn
|
|
87
|
+
* AROUND the file rather than as file content: user-supplied bytes in instruction
|
|
88
|
+
* position, reachable by anyone who can get a file in front of the composer.
|
|
89
|
+
* Escaped, it stays where it belongs. `</file>` ends nothing, and it is
|
|
90
|
+
* visible in the output and reversible by eye, which a deletion or a silent
|
|
91
|
+
* substitution would not be -- a reader who spots it can say exactly what the
|
|
92
|
+
* original byte was. The OPENING tag is left untouched on purpose: it cannot end
|
|
93
|
+
* the block, and escaping it would corrupt every HTML file anyone ever attaches.
|
|
94
|
+
*/
|
|
95
|
+
export declare function textFileContent(file: Extract<ClassifiedFile, {
|
|
96
|
+
kind: 'text';
|
|
97
|
+
}>): string;
|
|
98
|
+
/**
|
|
99
|
+
* One attachment to the provider-neutral facts both encoders need.
|
|
100
|
+
*
|
|
101
|
+
* A `data:` URI's OWN media type wins over `attachment.mediaType` when they
|
|
102
|
+
* disagree: the URI describes the bytes actually present, while the field is a
|
|
103
|
+
* label the host set, and it is the bytes the provider will decode. The one
|
|
104
|
+
* exception is a URI whose media type names nothing, where there is no answer to
|
|
105
|
+
* prefer -- see below.
|
|
106
|
+
*
|
|
107
|
+
* When NOTHING names the file, it is settled by DECODING it rather than by
|
|
108
|
+
* reading its filename. That path can only ever produce text, and only when the
|
|
109
|
+
* policy still allows text, so it cannot be used to get around `accept`.
|
|
110
|
+
*
|
|
111
|
+
* `policy` narrows what counts as encodable. It defaults to the kit's full
|
|
112
|
+
* capability set, so an omitted policy behaves exactly as before for images and
|
|
113
|
+
* PDFs. It is the SAME object the composer resolves for its picker -- see
|
|
114
|
+
* `media-types.ts` for why that sharing is the point rather than a convenience.
|
|
115
|
+
*/
|
|
116
|
+
export declare function classifyAttachment(attachment: AttachmentData, policy?: MediaPolicy): FileClassification;
|
package/dist/wire/index.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ export type { StreamSource, ReadOptions } from './read.js';
|
|
|
3
3
|
export { consumeModelStream, createToolCallAccumulator } from './consume.js';
|
|
4
4
|
export { applyToolOutput, applyToolFailure, bufferText } from './sink-helpers.js';
|
|
5
5
|
export { toOpenAIMessages, toAnthropicMessages, WireEncodeError } from './encode.js';
|
|
6
|
-
export type { AnthropicContentBlock, AnthropicWireMessage, OpenAIEncodeOptions, OpenAIReasoningDetail, OpenAIToolCall, OpenAIWireMessage, } from './encode.js';
|
|
6
|
+
export type { AnthropicContentBlock, AnthropicEncodeOptions, AnthropicWireMessage, FileEncodeOptions, OpenAIContentPart, OpenAIEncodeOptions, OpenAIReasoningDetail, OpenAIToolCall, OpenAIWireMessage, UnencodableFilePolicy, } from './encode.js';
|
|
7
|
+
export { encodableMediaTypes, resolveMediaPolicy } from './media-types.js';
|
|
8
|
+
export type { EncodableKind, MediaDecision, MediaPolicy, MediaPolicyOptions, MediaTypeFilter, } from './media-types.js';
|
|
7
9
|
export { openaiChatFormat } from './formats/openai.js';
|
|
8
10
|
export { anthropicMessagesFormat } from './formats/anthropic.js';
|
|
9
11
|
export { sseDataFrames, sseJson, readableToAsyncIterable } from './sse.js';
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/** What a media type BECOMES on the wire. Named for the Anthropic block set,
|
|
2
|
+
* which is the narrower of the two: `text` / `image` / `document` and nothing
|
|
3
|
+
* else. There is no arbitrary-file block on either API, which is why a text
|
|
4
|
+
* file has to ride as text content and a `.zip` has no representation at all. */
|
|
5
|
+
export type EncodableKind = 'image' | 'document' | 'text';
|
|
6
|
+
/**
|
|
7
|
+
* The media type an unnamed file gets once its BYTES have proven to be UTF-8
|
|
8
|
+
* text, and the type whose presence in the effective policy is what permits that
|
|
9
|
+
* proof to be attempted at all.
|
|
10
|
+
*
|
|
11
|
+
* `text/plain` is not a guess dressed up as a fact. It is the media type for
|
|
12
|
+
* "text, no further structure claimed", which is exactly what a successful
|
|
13
|
+
* decode establishes and the most any decode could ever establish. A `.rs` file
|
|
14
|
+
* arriving as `text/plain` is true; arriving as `text/x-rust` would be the
|
|
15
|
+
* filename talking.
|
|
16
|
+
*/
|
|
17
|
+
export declare const UNNAMED_TEXT_MEDIA_TYPE = "text/plain";
|
|
18
|
+
/** A developer's narrowing filter. A comma-separated string (so it works as an
|
|
19
|
+
* HTML attribute under the `kai-` contract) or an array (so it composes in JS).
|
|
20
|
+
* Both spell the same thing; the string form is what `<kai-chat accept="...">`
|
|
21
|
+
* takes and what the `kai` MCP scaffolder can emit as data. */
|
|
22
|
+
export type MediaTypeFilter = string | readonly string[];
|
|
23
|
+
/** One media type, decided against the effective set.
|
|
24
|
+
*
|
|
25
|
+
* `unsupported` and `filtered` are split because the developer needs different
|
|
26
|
+
* things from them: `unsupported` means fix your expectations (no API takes
|
|
27
|
+
* this), `filtered` means fix your `accept` (the kit could have sent it). */
|
|
28
|
+
export type MediaDecision = {
|
|
29
|
+
status: 'allowed';
|
|
30
|
+
kind: EncodableKind;
|
|
31
|
+
} | {
|
|
32
|
+
status: 'unsupported';
|
|
33
|
+
} | {
|
|
34
|
+
status: 'filtered';
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Nobody named this file, so its media type cannot decide it. LOOK AT THE
|
|
38
|
+
* BYTES: decode them as UTF-8 (`classifyAttachment` does), and it is `text`
|
|
39
|
+
* if they decode and unencodable if they do not. Do not look at the filename.
|
|
40
|
+
*
|
|
41
|
+
* ★ THIS VARIANT IS WHERE THE DEVELOPER'S FILTER IS ENFORCED, so the caller
|
|
42
|
+
* cannot get it wrong by forgetting to check. It is returned ONLY when the
|
|
43
|
+
* effective policy still admits `text/plain` -- the one thing a decode can
|
|
44
|
+
* establish. Narrow `accept` to `image/png` and an unnamed file comes back
|
|
45
|
+
* `unsupported` instead, so the decode path is unreachable and a typeless
|
|
46
|
+
* `.rs` cannot slip past an images-only filter. That is the whole reason the
|
|
47
|
+
* check lives here rather than at each call site: there is one place to get
|
|
48
|
+
* right, and the callers physically cannot reach the bytes without being told
|
|
49
|
+
* to.
|
|
50
|
+
*/
|
|
51
|
+
| {
|
|
52
|
+
status: 'undetermined';
|
|
53
|
+
};
|
|
54
|
+
export interface MediaPolicy {
|
|
55
|
+
/** The effective patterns: the kit's capability set narrowed by the
|
|
56
|
+
* developer's filter. Never wider than `encodableMediaTypes()`. */
|
|
57
|
+
readonly types: readonly string[];
|
|
58
|
+
/** The same set as an HTML `accept` attribute value, ready to put on an
|
|
59
|
+
* `<input type="file">`. This is what makes the picker and the encoder
|
|
60
|
+
* provably one thing rather than two lists that agree today. */
|
|
61
|
+
readonly accept: string;
|
|
62
|
+
/**
|
|
63
|
+
* What this policy makes of one media type, including "I cannot tell from
|
|
64
|
+
* this, go and read the bytes" -- see `undetermined`.
|
|
65
|
+
*
|
|
66
|
+
* The primitive behind "expose information, do not make decisions": it answers
|
|
67
|
+
* a question and returns a fact, so a consumer can build their own picker,
|
|
68
|
+
* their own validation and their own error copy on top of it without the kit
|
|
69
|
+
* deciding anything on their behalf.
|
|
70
|
+
*/
|
|
71
|
+
decide(mediaType: string | undefined): MediaDecision;
|
|
72
|
+
}
|
|
73
|
+
export interface MediaPolicyOptions {
|
|
74
|
+
/** Narrow the kit's capability set. Omitted means the full set. Anything here
|
|
75
|
+
* that the kit cannot encode is dropped rather than honoured, because
|
|
76
|
+
* allowing it would only relocate the failure to the provider. */
|
|
77
|
+
accept?: MediaTypeFilter;
|
|
78
|
+
}
|
|
79
|
+
/** Does this media type say anything at all about the bytes it labels? Exported
|
|
80
|
+
* so `files.ts` decides "nameless" by the same rule `decide()` does, rather
|
|
81
|
+
* than growing a second opinion about which spellings mean "I don't know". */
|
|
82
|
+
export declare const namesNothing: (mediaType: string | undefined) => boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Every media type this kit's encoders can represent, as HTML `accept` patterns.
|
|
85
|
+
*
|
|
86
|
+
* PUBLIC ON PURPOSE, and not merely for introspection: a consumer who wants
|
|
87
|
+
* their own picker, their own validation and their own error copy can build all
|
|
88
|
+
* three against this without touching `<kai-chat>` at all. That demotes the
|
|
89
|
+
* `accept` prop from "the only door" to a convenience over a published fact,
|
|
90
|
+
* which is the composition-first shape this project already committed to.
|
|
91
|
+
*/
|
|
92
|
+
export declare function encodableMediaTypes(): readonly string[];
|
|
93
|
+
/**
|
|
94
|
+
* The effective policy: the kit's capability set narrowed by the developer's
|
|
95
|
+
* filter, plus the text ceiling.
|
|
96
|
+
*
|
|
97
|
+
* BOTH LAYERS CALL THIS. The composer calls it to build its picker `accept`
|
|
98
|
+
* attribute and to filter what actually gets staged; the encoders call it to
|
|
99
|
+
* decide what reaches the wire. That shared call is the whole design -- it is
|
|
100
|
+
* why changing `ENCODABLE` above moves the picker and the encoder together
|
|
101
|
+
* rather than moving one and leaving the other to be noticed in production.
|
|
102
|
+
*/
|
|
103
|
+
export declare function resolveMediaPolicy(options?: MediaPolicyOptions): MediaPolicy;
|
|
104
|
+
/** The policy every caller gets when nobody narrowed anything: the kit's full
|
|
105
|
+
* capability set. Built once -- it has no inputs. */
|
|
106
|
+
export declare const DEFAULT_MEDIA_POLICY: MediaPolicy;
|