@alwith/module-chat 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity-host.js +1 -1
- package/dist/approval/choice-elicitation-form.js +1 -1
- package/dist/approval/choice-schema.js +1 -1
- package/dist/approval/permission-options.js +1 -1
- package/dist/approval/permission-view.js +1 -1
- package/dist/approval/schema-elicitation-form.js +1 -1
- package/dist/approval/url-elicitation-card.js +1 -1
- package/dist/{chunk-4gayxp21.js → chunk-1vxrdkew.js} +2 -2
- package/dist/{chunk-kget6qfz.js → chunk-2sgxwycp.js} +1 -1
- package/dist/{chunk-y2xbq7rb.js → chunk-2v9kbth7.js} +3 -3
- package/dist/chunk-35j3t609.js +2 -0
- package/dist/{chunk-1twg3evk.js → chunk-38skakaz.js} +1 -1
- package/dist/chunk-3abwky4a.js +1 -0
- package/dist/chunk-3t2c4zky.js +2 -0
- package/dist/{chunk-0e1pdbec.js → chunk-3z0y9amd.js} +2 -2
- package/dist/chunk-6mhdcz0h.js +2 -0
- package/dist/{chunk-yvj5y06y.js → chunk-6pmsbx1j.js} +2 -2
- package/dist/{chunk-341yykkp.js → chunk-6q8b8aww.js} +1 -1
- package/dist/{chunk-1yy2jsnh.js → chunk-6ynartgd.js} +1 -1
- package/dist/{chunk-91nk8n6w.js → chunk-7ar540cc.js} +2 -2
- package/dist/{chunk-k7s0drzk.js → chunk-7ex6r8ja.js} +3 -3
- package/dist/chunk-7xdvwjxh.js +2 -0
- package/dist/{chunk-1cy1j8gj.js → chunk-8md0gr7j.js} +2 -2
- package/dist/{chunk-tzdd96d0.js → chunk-98g6kwj5.js} +2 -2
- package/dist/chunk-9f42d428.js +1 -0
- package/dist/{chunk-k1pd257q.js → chunk-ahcmeqvb.js} +2 -2
- package/dist/chunk-bbw2zg1a.js +2 -0
- package/dist/chunk-c4ps9628.js +2 -0
- package/dist/chunk-c8dr4btd.js +2 -0
- package/dist/chunk-d4e74rv1.js +2 -0
- package/dist/{chunk-r5d37dc0.js → chunk-dj8v2w6n.js} +1 -1
- package/dist/{chunk-25na55ve.js → chunk-dp4g5y18.js} +2 -2
- package/dist/{chunk-ftka421d.js → chunk-en6qem8e.js} +2 -2
- package/dist/chunk-fk1z4bmr.js +2 -0
- package/dist/{chunk-e9zndx26.js → chunk-fk5nvz2s.js} +2 -2
- package/dist/{chunk-evcrrxfp.js → chunk-fmxt5ysw.js} +1 -1
- package/dist/{chunk-90rwhxdf.js → chunk-g13txkf0.js} +2 -2
- package/dist/{chunk-66headm4.js → chunk-gnthx1zg.js} +1 -1
- package/dist/{chunk-bf5fh35b.js → chunk-h96s3j1e.js} +2 -2
- package/dist/chunk-j3my6gn8.js +1 -0
- package/dist/{chunk-3496tgga.js → chunk-jaf9msp7.js} +2 -2
- package/dist/{chunk-c4cqqqqh.js → chunk-k0mayxgs.js} +2 -2
- package/dist/chunk-k4w61adv.js +2 -0
- package/dist/chunk-kk9q6wtq.js +2 -0
- package/dist/{chunk-zt7a6b1m.js → chunk-nfd274y3.js} +1 -1
- package/dist/{chunk-cp20nzhv.js → chunk-p141s624.js} +2 -2
- package/dist/{chunk-ph7bk34y.js → chunk-r125b0z5.js} +2 -2
- package/dist/{chunk-m5pbe513.js → chunk-s2n85pks.js} +1 -1
- package/dist/chunk-sdv6vdhr.js +7 -0
- package/dist/{chunk-pqgtv07g.js → chunk-sptvg9xh.js} +2 -2
- package/dist/{chunk-qj8r5xvx.js → chunk-tcqf45rf.js} +2 -2
- package/dist/{chunk-wjejhpgw.js → chunk-vk39871j.js} +1 -1
- package/dist/{chunk-1hy64ewz.js → chunk-wmsdg5fb.js} +1 -1
- package/dist/{chunk-yw4e2tcz.js → chunk-wnq8g0kp.js} +1 -1
- package/dist/codex/activity-group.js +1 -1
- package/dist/codex/assistant-message.js +2 -2
- package/dist/codex/async-question-card.js +2 -2
- package/dist/codex/edited-files-card.js +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.js +4 -4
- package/dist/codex/navigation-audio.d.ts +5 -5
- package/dist/codex/navigation-audio.js +1 -1
- package/dist/codex/navigation-preview.js +1 -1
- package/dist/codex/navigation-rail.js +1 -1
- package/dist/codex/plan.js +1 -1
- package/dist/codex/timeline-virtualizer.js +1 -1
- package/dist/codex/user-message.js +1 -1
- package/dist/codex/virtualized-turn-list.js +1 -1
- package/dist/composer/completion-filter.js +1 -1
- package/dist/composer/completion-menu.js +2 -2
- package/dist/composer/completion-trigger.js +1 -1
- package/dist/composer/effort-slider.js +1 -1
- package/dist/composer/menu-radio.js +1 -1
- package/dist/composer/model-select.js +1 -1
- package/dist/composer/permission-mode-select.js +1 -1
- package/dist/composer/prompt-input-attachments.js +1 -1
- package/dist/composer/prompt-input-clipboard.js +1 -1
- package/dist/composer/prompt-input-context.js +1 -1
- package/dist/composer/prompt-input-textarea.js +3 -3
- package/dist/composer/prompt-input.js +1 -1
- package/dist/image-lightbox.js +1 -1
- package/dist/image-preview-dialog.js +1 -1
- package/dist/lib/code-highlighter.js +1 -1
- package/dist/lib/fuzzy.js +1 -1
- package/dist/lib/group-blocks.js +1 -1
- package/dist/lib/image-encode.js +1 -1
- package/dist/lib/limits.js +1 -1
- package/dist/lib/markdown-parser.js +1 -1
- package/dist/lib/markdown-rules.js +1 -1
- package/dist/lib/model-name.js +1 -1
- package/dist/lib/pointer-centered-zoom.js +1 -1
- package/dist/lib/prepare-prompt-files.js +1 -1
- package/dist/lib/stream-style.js +1 -1
- package/dist/lib/streaming-markdown.js +1 -1
- package/dist/search/chat-search.js +1 -1
- package/dist/search/dom-matches.js +1 -1
- package/dist/search/find-bar.js +1 -1
- package/dist/search/literal-matches.js +1 -1
- package/dist/ui/badge.js +1 -1
- package/dist/ui/button.js +1 -1
- package/dist/ui/card.js +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/field.js +1 -1
- package/dist/ui/hover-card.js +1 -1
- package/dist/ui/input-group-textarea.js +1 -1
- package/dist/ui/input-group.js +1 -1
- package/dist/ui/input.js +1 -1
- package/dist/ui/radio-group.js +1 -1
- package/dist/ui/separator.js +1 -1
- package/dist/ui/switch.js +1 -1
- package/dist/ui/tooltip.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2q9rzxbj.js +0 -2
- package/dist/chunk-36h9z1mt.js +0 -1
- package/dist/chunk-3eg720sa.js +0 -2
- package/dist/chunk-7tj0a2na.js +0 -2
- package/dist/chunk-8z8va1ws.js +0 -2
- package/dist/chunk-arge74eh.js +0 -2
- package/dist/chunk-g20b01rn.js +0 -2
- package/dist/chunk-gfj69sqc.js +0 -2
- package/dist/chunk-hnt4tt1n.js +0 -2
- package/dist/chunk-kaeqvcew.js +0 -1
- package/dist/chunk-mbrd76nh.js +0 -2
- package/dist/chunk-p9wpghey.js +0 -2
- package/dist/chunk-pc1yzf1x.js +0 -1
- package/dist/chunk-reqrpvyy.js +0 -2
- package/dist/chunk-svmc952q.js +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n}from"../chunk-
|
|
1
|
+
import{n}from"../chunk-6ynartgd.js";import"../chunk-j3my6gn8.js";export{n as MenuRadioSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"../chunk-
|
|
1
|
+
import{e}from"../chunk-vk39871j.js";import{v,x,m,b,D,y,P,I,M,J,a}from"../chunk-j3my6gn8.js";import{N}from"../chunk-s2n85pks.js";import{ee,te,ne}from"../chunk-9f42d428.js";import{V}from"../chunk-fk5nvz2s.js";import{n}from"../chunk-6ynartgd.js";import{cn as c}from"cn";import{ArrowUpRight as ce,ChevronUp as Q,Loader2Icon as X,Zap as Y}from"lucide-react";import{Fragment as he,useState as E}from"react";import{jsx as s,jsxs as o,Fragment as w}from"react/jsx-runtime";function ke({value:g,onChange:ae,models:T,modelGroups:L,compactCatalog:r,effortPresentation:U="slider",unavailableEffort:O,providerMenu:k,header:S,className:W,condensed:j,stripLabelPrefix:B,showDescription:se,showModelList:ie=!0,loading:oe,switching:Z,isLoading:le,effortConfig:t,booleanOptions:R,onBooleanChange:G,selectOptions:de=[],t:h,...p}){let[re,me]=E(!1),[ue,pe]=E(!1),u=R?.find((i)=>i.id==="fast_mode"),F=r?R?.filter((i)=>i!==u):R,q=(i)=>B&&i.startsWith(B)?i.slice(B.length):i;if(oe)return s("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:o(e,{variant:"ghost",disabled:!0,className:c("h-7 min-w-0 shrink gap-1.5 rounded-md px-2 text-xs font-normal",W),children:[s(X,{className:"size-3 animate-spin"}),s("span",{className:"text-muted-foreground truncate",children:h("model.loadingModels")})]})});return o("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:[k&&o(v,{open:re,onOpenChange:me,children:[o(ee,{children:[s(te,{render:s(x,{render:o(e,{"data-testid":"provider-trigger",variant:"ghost",disabled:p.disabled,className:c("h-7 shrink-0 gap-1 rounded-md px-1.5","hover:bg-accent"),children:[k.icon,s(Q,{className:"size-2.5 shrink-0 opacity-60"})]})})}),s(ne,{children:h("model.switchProvider")})]}),o(m,{side:"top",align:"end",sideOffset:4,className:"z-100 min-w-[10rem]",children:[k.groups.map((i,d)=>o(he,{children:[d>0&&i.length>0&&s(a,{}),s(n,{value:k.value,onValueChange:k.onChange,options:i})]},d)),k.moreAction&&o(w,{children:[s(a,{}),o(y,{onClick:k.moreAction,className:"whitespace-nowrap",children:[s("span",{className:"min-w-0 flex-1 truncate",children:h("model.moreModels")}),s(ce,{className:"size-4"})]})]})]})]}),o(v,{open:ue,onOpenChange:pe,children:[o(ee,{children:[s(te,{render:s(x,{render:o(e,{"data-testid":"model-trigger","aria-busy":Z,variant:"ghost",className:c("h-7 gap-1.5 rounded-md px-2 text-xs font-normal","hover:bg-accent","max-w-full min-w-0 shrink",j&&"h-7 gap-1 px-1.5 text-[11px]",W),...p,children:[g.icon,R?.some((i)=>i.id==="fast_mode"&&i.currentValue&&!i.disabled)&&s(Y,{"aria-hidden":"true",className:"size-3 shrink-0"}),s("span",{className:c("min-w-0 flex-1 truncate text-start",j&&"text-[11px]"),children:q(g.label)||h("model.selectModel")}),t&&o("span",{className:"text-muted-foreground grid shrink-0 justify-items-center",children:[s("span",{className:"invisible col-start-1 row-start-1",children:t.sizer??t.levels.reduce((i,d)=>d.name.length>i.length?d.name:i,"")}),s("span",{className:"col-start-1 row-start-1",children:t.levels.find((i)=>i.value===t.value)?.name??t.value})]}),Z?s(X,{"data-testid":"model-switch-loading",className:"size-3 shrink-0 animate-spin"}):s(Q,{className:c("size-3 shrink-0",j&&"size-2.5")})]})})}),s(ne,{children:h("model.switchModel")})]}),o(m,{side:"top",align:"end",sideOffset:4,className:c("z-100 w-auto max-w-[min(24rem,calc(100vw-1rem))] min-w-[14rem]",r&&"flex h-[350px] w-80 min-w-0 flex-col overflow-hidden rounded-xl p-1.5"),children:[r&&o(w,{children:[o(b,{"data-model-menu-header":!0,className:"flex shrink-0 items-center justify-between gap-2 px-1 py-1",children:[t?U==="slider"?s("div",{role:"menuitem","aria-label":t.name,className:"min-w-0 [&>div]:justify-start [&>div]:gap-3 [&>div]:px-2 [&>div]:py-1.5",children:s(V,{...t,disabled:p.disabled})}):o(P,{children:[o(I,{disabled:p.disabled,className:"h-8 min-w-0 flex-1 gap-2 rounded-md",children:[s("span",{children:t.name}),s("span",{className:"text-muted-foreground min-w-0 truncate text-xs",children:t.levels.find((i)=>i.value===t.value)?.name??t.value})]}),s(M,{children:s(n,{value:t.value,onValueChange:t.onChange,options:t.levels.map((i)=>({value:i.value,label:i.name}))})})]}):O?o(y,{disabled:!0,className:"h-8 min-w-0 flex-1 gap-2",children:[s("span",{children:O.name}),s("span",{className:"text-muted-foreground truncate text-xs",children:O.label})]}):s(D,{className:"min-w-0 flex-1 truncate",children:S?.name}),u&&s(J,{"aria-label":u.name,title:u.title??u.name,disabled:p.disabled||u.disabled,checked:u.currentValue,closeOnClick:!1,onCheckedChange:(i)=>G?.(u.id,i),className:c("hover:bg-accent focus:hover:bg-accent focus-visible:bg-accent ml-auto size-8 shrink-0 justify-center rounded-md p-0 focus:bg-transparent [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",u.currentValue&&!u.disabled?"text-foreground [&_svg]:fill-current":"text-muted-foreground"),children:u.icon??s(Y,{className:"size-4","aria-hidden":"true"})})]}),s(a,{className:"shrink-0"})]}),S&&!r&&o(w,{children:[o("div",{className:"flex items-center gap-2 px-2 py-2",children:[S.icon,s("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:S.name}),S.action]}),s(a,{})]}),o(b,{"data-model-menu-list":r?"":void 0,className:r?"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain":void 0,children:[ie&&(le?s(y,{disabled:!0,className:"text-muted-foreground",children:h("model.loadingModels")}):T.length===0?s(y,{disabled:!0,className:"text-muted-foreground",children:h("model.noModelsAvailable")}):(()=>{let i=T.filter((l)=>!l.more),d=T.filter((l)=>l.more),H=i.length>0&&d.length>0,z=(l,f)=>({disabled:p.disabled,icon:l.icon,value:l.api_id,label:q(l.label),description:f?.noDescription?void 0:se?l.description:void 0}),_=(l)=>{let f=T.find((A)=>A.api_id===l);if(f)ae(f)};if(r)return s(n,{value:g.api_id,onValueChange:_,itemClassName:"min-w-0 max-w-full font-normal whitespace-nowrap",options:T.map((l)=>z(l))});return o(w,{children:[L?L.map((l)=>{let f=l.models.filter((C)=>!C.more),A=l.models.filter((C)=>C.more),K=f.length>0&&A.length>0;return o(b,{children:[s(D,{className:"text-muted-foreground text-xs font-normal",children:l.name}),s(n,{value:g.api_id,onValueChange:_,itemClassName:"font-medium whitespace-nowrap",options:(K?f:l.models).map((C)=>z(C))}),K&&o(P,{children:[s(I,{className:"font-medium whitespace-nowrap",children:h("model.moreModels")}),s(M,{children:s(n,{value:g.api_id,onValueChange:_,itemClassName:"font-medium whitespace-nowrap",options:A.map((C)=>z(C,{noDescription:!0}))})})]})]},l.id)}):s(n,{value:g.api_id,onValueChange:_,itemClassName:"font-medium whitespace-nowrap",options:(H?i:T).map((l)=>z(l))}),!L&&H&&o(P,{children:[s(I,{className:"font-medium whitespace-nowrap",children:h("model.moreModels")}),s(M,{children:s(n,{value:g.api_id,onValueChange:_,itemClassName:"font-medium whitespace-nowrap",options:d.map((l)=>z(l,{noDescription:!0}))})})]})]})})()),!r&&t&&o(w,{children:[s(a,{}),U==="menu"?o(P,{children:[o(I,{disabled:p.disabled,children:[s("span",{className:"flex-1",children:t.name}),s("span",{className:"text-muted-foreground",children:t.levels.find((i)=>i.value===t.value)?.name??t.value})]}),s(M,{children:s(n,{value:t.value,onValueChange:t.onChange,options:t.levels.map((i)=>({value:i.value,label:i.name}))})})]}):s(V,{...t,disabled:p.disabled})]}),!r&&!t&&O&&o(w,{children:[s(a,{}),o(y,{disabled:!0,children:[s("span",{className:"flex-1",children:O.name}),s("span",{children:O.label})]})]}),de.map((i)=>o(b,{children:[s(a,{}),s(D,{children:i.name}),s(n,{value:i.value,onValueChange:i.onChange,options:i.options,itemClassName:"whitespace-nowrap"})]},i.id)),F&&F.length>0&&o(w,{children:[!t&&s(a,{}),F.map((i)=>r?o(J,{"aria-label":i.name,title:i.title,disabled:p.disabled||i.disabled,checked:i.currentValue,closeOnClick:!1,onCheckedChange:(d)=>G?.(i.id,d),className:"justify-between gap-3 py-2.5 pr-2 [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",children:[o("span",{className:"flex items-center gap-2",children:[i.icon,i.name]}),s("span",{"aria-hidden":"true",className:c("flex h-[18px] w-8 shrink-0 items-center rounded-full p-0.5",i.currentValue?"bg-primary":"bg-input"),children:s("span",{className:c("bg-background size-3.5 rounded-full shadow-xs transition-transform",i.currentValue&&"translate-x-3.5")})})]},i.id):o("div",{title:i.title,className:c("flex items-center justify-between gap-3 px-2 py-2.5",i.disabled&&"opacity-50"),children:[o("span",{className:"flex items-center gap-2 text-sm font-medium",children:[i.icon,i.name]}),s(N,{"aria-label":i.name,disabled:p.disabled||i.disabled,checked:i.currentValue,onCheckedChange:(d)=>G?.(i.id,d)})]},i.id))]})]}),r&&S?.action&&o(w,{children:[s(a,{className:"shrink-0"}),s(b,{"data-model-menu-footer":!0,className:"shrink-0",children:S.action})]})]})]})]})}export{ke as ModelSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"../chunk-
|
|
1
|
+
import{e}from"../chunk-vk39871j.js";import{v,x,m}from"../chunk-j3my6gn8.js";import{n}from"../chunk-6ynartgd.js";import{useState as w}from"react";import{jsx as o,jsxs as a}from"react/jsx-runtime";function C({value:r,currentName:t,icon:s,options:i,label:d,header:p,onValueChange:l,showLabel:u=!1,disabled:c=!1}){let[g,f]=w(!1);return a(v,{open:g,onOpenChange:f,children:[o(x,{render:a(e,{disabled:c,variant:"ghost","aria-label":`${d}: ${t}`,title:t,className:"text-muted-foreground data-popup-open:hover:bg-muted h-7 gap-1.5 rounded-full bg-transparent px-2 text-xs font-normal whitespace-nowrap data-popup-open:bg-transparent",children:[s,o("span",{className:u?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:t})]})}),a(m,{align:"start",sideOffset:4,className:"permission-mode-menu z-100 w-auto max-w-[calc(100vw-2rem)] min-w-72 rounded-xl p-1.5",children:[p&&o("div",{className:"text-muted-foreground flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4",children:o("span",{children:p})}),o(n,{value:r,onValueChange:l,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:i})]})]})}export{C as PermissionModeSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-tcqf45rf.js";import{e}from"../chunk-vk39871j.js";import"../chunk-wnq8g0kp.js";import{we}from"../chunk-kk9q6wtq.js";import{We,qe,Ge}from"../chunk-38skakaz.js";import{f}from"../chunk-fk1z4bmr.js";import{cn as h}from"cn";import{PaperclipIcon as k,XIcon as T}from"lucide-react";import{Fragment as M,useEffect as L,useRef as z,useState as N}from"react";import{jsx as t,jsxs as o,Fragment as R}from"react/jsx-runtime";function E(n){return t(Ge,{align:"start",...n})}function X({data:n,t:r,className:u,...c}){let p=f(),[d,g]=N(!1),[I,v]=N(1),C=z(null),s=n.filename||"",i=(n.mediaType?.startsWith("image/")&&n.url?"image":"file")==="image",A=s||(i?r("input.image"):r("input.attachment"));return L(()=>{if(!d)return;let l=0.1,y=(a)=>Math.min(10,Math.max(0.1,a)),x=(a)=>{if(!(a.ctrlKey||a.metaKey))return;let m=a.key,w=m==="+"||m==="=",H=m==="-"||m==="_",b=m==="0";if(!w&&!H&&!b)return;a.preventDefault(),v((P)=>{if(b)return 1;if(w)return y(P+l);return y(P-l)})};return window.addEventListener("keydown",x,{passive:!1}),()=>window.removeEventListener("keydown",x)},[d]),o(R,{children:[o(We,{children:[t(qe,{render:o("div",{className:h("group border-border hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent relative flex h-8 cursor-pointer items-center gap-1.5 rounded-md border px-1.5 text-sm font-medium transition-all select-none",u),...c,children:[o("div",{className:"relative size-5 shrink-0",children:[i?t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":r("input.image"),className:"bg-background absolute inset-0 size-5 overflow-hidden rounded p-0 transition-opacity group-hover:opacity-0",onClick:()=>{v(1),g(!0)},children:t("img",{alt:s||"attachment",className:"size-5 object-cover",height:20,src:n.url,width:20})}):t("div",{className:"bg-background text-muted-foreground absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded transition-opacity group-hover:opacity-0",children:t(k,{className:"size-3"})}),o(e,{"aria-label":r("input.removeAttachment"),className:h("absolute -top-1 -right-1 size-4 rounded-full p-0 opacity-0 transition-opacity [&>svg]:size-3","pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100"),onClick:(l)=>{l.stopPropagation(),p.remove(n.id)},type:"button",variant:"ghost",children:[t(T,{}),t("span",{className:"sr-only",children:r("input.removeAttachment")})]})]}),!i&&t("span",{className:"max-w-40 flex-1 truncate text-xs",children:A})]})}),t(E,{className:"w-auto p-2",children:o("div",{className:"w-auto space-y-3",children:[i&&t("div",{className:"flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border",children:t("img",{alt:s||"attachment preview",className:"max-h-full max-w-full object-contain",height:384,src:n.url,width:448})}),t("div",{className:"flex items-center gap-2.5",children:o("div",{className:"min-w-0 flex-1 space-y-1 px-0.5",children:[t("h4",{className:"truncate text-sm leading-none font-semibold",children:s||(i?"Image":"Attachment")}),n.mediaType&&t("p",{className:"text-muted-foreground truncate font-mono text-xs",children:n.mediaType})]})})]})})]}),i&&n.url&&t(we,{containerRef:C,filename:s||r("input.image"),onOpenChange:g,onScaleChange:v,open:d,scale:I,url:n.url})]})}function _({children:n,className:r,...u}){let c=f();if(!c.files.length)return null;return t("div",{className:h("flex w-full flex-wrap items-center gap-1",r),...u,children:c.files.map((p)=>t(M,{children:n(p)},p.id))})}export{X as PromptInputAttachment,_ as PromptInputAttachments};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{at,Te,Pe,st,rt,F}from"../chunk-c8dr4btd.js";export{Pe as clipboardHasStringItem,rt as countControlCharsBeforeIndex,at as normalizePastedImageFile,F as sanitizeTextareaTargetValue,st as sanitizeTextareaValue,Te as scanClipboardForImageFiles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{K,vt,W,xt,C,ye,T,bt,yt,q,f}from"../chunk-fk1z4bmr.js";export{q as LocalAttachmentsContext,yt as PromptInputProvider,W as PromptInputSubmissionContext,K as PromptInputSubmitContext,C as ProviderAttachmentsContext,T as useOptionalPromptInputController,f as usePromptInputAttachments,ye as usePromptInputController,xt as usePromptInputSubmission,vt as usePromptInputSubmit,bt as useProviderAttachments};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"../chunk-d0ptk8x8.js";import{
|
|
2
|
-
`&&e.key!=="\r"&&e.key!=="\t"){e.preventDefault();return}if(c&&n){let t=e.currentTarget.selectionStart===0&&e.currentTarget.selectionEnd===0;if(e.key==="Escape"||(e.key==="Backspace"||e.key==="Delete")&&t){e.preventDefault(),n.textInput.setInput(n.textInput.value.slice(1));return}}if(e.key==="Enter"){if(
|
|
3
|
-
${
|
|
1
|
+
import"../chunk-d0ptk8x8.js";import{se}from"../chunk-p141s624.js";import{Te,Pe,F}from"../chunk-c8dr4btd.js";import{T,f}from"../chunk-fk1z4bmr.js";import{cn as A}from"cn";import{forwardRef as D,useCallback as M,useEffect as K,useImperativeHandle as L,useRef as d}from"react";import{jsx as z}from"react/jsx-runtime";var R=(i)=>!i.shiftKey,N=()=>!1,q=D(({onChange:i,onCompositionStart:v,onCompositionEnd:x,className:y,placeholder:b,bashMode:E=!1,isSendShortcut:I=R,isNewlineShortcut:C=N,...H},P)=>{let n=T(),l=f(),o=d(!1),u=d(!1),r=d(null),s=M(()=>{let e=r.current;if(!e||o.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`},[]);K(()=>{let e=r.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(s)});return t.observe(e),()=>t.disconnect()},[s]);let c=E&&(n?.textInput.value??"").startsWith("!"),S=(e)=>{if(o.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||u.current)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
|
|
2
|
+
`&&e.key!=="\r"&&e.key!=="\t"){e.preventDefault();return}if(c&&n){let t=e.currentTarget.selectionStart===0&&e.currentTarget.selectionEnd===0;if(e.key==="Escape"||(e.key==="Backspace"||e.key==="Delete")&&t){e.preventDefault(),n.textInput.setInput(n.textInput.value.slice(1));return}}if(e.key==="Enter"){if(C(e.nativeEvent)){e.preventDefault();let t=e.currentTarget,{selectionStart:a,selectionEnd:m,value:p}=t,h=`${p.slice(0,a)}
|
|
3
|
+
${p.slice(m)}`;if(n)n.textInput.setInput(h);else t.value=h;let g=a+1;t.setSelectionRange(g,g),s();return}if(I(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let a=t.querySelector('button[type="submit"]');if(!a||a.disabled)return;t.requestSubmit(a)}}if(e.key==="Backspace"&&e.currentTarget.value===""&&l.files.length>0){e.preventDefault();let t=l.files.at(-1);if(t)l.remove(t.id)}},k=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:a,sawNonImageFile:m}=Te(t),p=Pe(t);if(a.length>0)e.preventDefault(),l.add(a);else if(m&&!p)e.preventDefault()},w=n?{value:o.current&&r.current?r.current.value:c?n.textInput.value.slice(1):n.textInput.value,onChange:(e)=>{let t=o.current?e.currentTarget.value:F(e.currentTarget);n.textInput.setInput(c?`!${t}`:t),s(),i?.(e)}}:{onChange:(e)=>{if(!o.current)F(e.currentTarget);s(),i?.(e)}};return L(P,()=>({resetHeight:()=>{if(r.current)r.current.style.height="auto"},focus:()=>{r.current?.focus()},isComposing:()=>o.current||u.current,getTextarea:()=>r.current}),[]),z(se,{"data-chat-input":!0,ref:r,rows:3,className:A("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",y),name:"message",onCompositionEnd:(e)=>{o.current=!1;let t=F(e.currentTarget);n?.textInput.setInput(c?`!${t}`:t),s(),x?.(e),u.current=!0,requestAnimationFrame(()=>{u.current=!1})},onCompositionStart:(e)=>{u.current=!1,o.current=!0,v?.(e)},onKeyDown:S,onPaste:k,placeholder:b,...H,...w})});q.displayName="PromptInputTextarea";export{q as PromptInputTextarea};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ne,Q}from"../chunk-bbw2zg1a.js";import"../chunk-3z0y9amd.js";import{Ae}from"../chunk-1vxrdkew.js";import"../chunk-vk39871j.js";import"../chunk-d0ptk8x8.js";import"../chunk-p141s624.js";import{tt,ie,ae}from"../chunk-fmxt5ysw.js";import{K,W,C,T,q}from"../chunk-fk1z4bmr.js";import{cn as P}from"cn";import{ArrowUpIcon as Ie,Loader2Icon as ye,SquareIcon as xe,XIcon as Le}from"lucide-react";import{Children as ne,useCallback as h,useEffect as M,useMemo as Te,useRef as E,useState as Fe}from"react";import{flushSync as Me}from"react-dom";import{jsx as a,jsxs as Ee}from"react/jsx-runtime";function oe(u){let o=new FormData(u).get("message");return typeof o==="string"?o:""}var Re=({className:u,bashMode:o=!1,attachmentPolicy:I,onCommand:d,onSubmitError:y,canSubmit:f,onSubmitAsync:g,accept:A,multiple:se,globalDrop:w,syncHiddenInput:B,maxFiles:k,maxFileSize:D,onError:b,onSubmit:ue,children:le,...pe})=>{let s=T(),l=!!s,me=o&&l&&s.textInput.value.startsWith("!"),x=E(null),S=E(null),N=E(!1),[ce,R]=Fe([]),c=l?s.attachments.files:ce,O=E(c);O.current=c;let de=h(()=>{x.current?.click()},[]),G=h((e)=>{if(!A||A.trim()==="")return!0;return A.split(",").map((t)=>t.trim()).filter(Boolean).some((t)=>{if(t.endsWith("/*")){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t})},[A]),j=h((e)=>{if(e.type)return e.type;let r=(e.name||"").toLowerCase();if(r.endsWith(".png"))return"image/png";if(r.endsWith(".jpg")||r.endsWith(".jpeg"))return"image/jpeg";if(r.endsWith(".webp"))return"image/webp";if(r.endsWith(".gif"))return"image/gif";if(r.endsWith(".bmp"))return"image/bmp";if(r.endsWith(".svg"))return"image/svg+xml";return""},[]),fe=h((e)=>{let r=[...e],t=r.filter((i)=>G(i));if(r.length&&t.length===0){b?.({code:"accept",message:"No files match the accepted types."});return}let n=(i)=>D?i.size<=D:!0,m=t.filter(n);if(t.length>0&&m.length===0){b?.({code:"max_file_size",message:"All files exceed the maximum size."});return}R((i)=>{let v=I?I.uniqueFiles(m,i):m,p=typeof k==="number"?Math.max(0,k-i.length):void 0,H=typeof p==="number"?v.slice(0,p):v;if(typeof p==="number"&&v.length>p)b?.({code:"max_files",message:"Too many files. Some were not added."});let te=[];for(let F of H){let re=I?.sourcePath(F);te.push({id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(F),mediaType:j(F),filename:F.name,size:F.size,lastModified:F.lastModified,...re===void 0?{}:{sourcePath:re}})}return[...i,...te]})},[I,j,G,k,D,b]),ge=h((e)=>R((r)=>{let t=r.find((n)=>n.id===e);if(t?.url)URL.revokeObjectURL(t.url);return r.filter((n)=>n.id!==e)}),[]),be=h(()=>R((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),X=l?s.attachments.add:fe,L=h((e)=>{let r=[...e],t=r.filter((m)=>!(m.type??"").toLowerCase().startsWith("image/"));if(t.length>0){b?.({code:"unsupported_type",message:`Only image attachments are supported. ${t.length} non-image file(s) were ignored.`});return}let n=r.reduce((m,i)=>m+i.size,0);if(n>0){let m=c.filter((i)=>(i.mediaType??"").toLowerCase().startsWith("image/")).reduce((i,v)=>i+(v.size??0),0);if(Ne(m,n)){b?.({code:"max_total_size",message:`Total image size must not exceed ${Q}MB.`});return}}X(r)},[c,X,b]),J=l?s.attachments.remove:ge,U=l?s.attachments.clear:be,V=l?s.attachments.openFileDialog:de;M(()=>{if(!l)return;s.__registerFileInput(x,()=>x.current?.click())},[l,s]),M(()=>{if(B&&x.current&&c.length===0)x.current.value=""},[c,B]),M(()=>{let e=S.current;if(!e)return;if(w)return;let r=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault()},t=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault();if(n.dataTransfer?.files&&n.dataTransfer.files.length>0)L(n.dataTransfer.files)};return e.addEventListener("dragover",r),e.addEventListener("drop",t),()=>{e.removeEventListener("dragover",r),e.removeEventListener("drop",t)}},[L,w]),M(()=>{if(!w)return;let e=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault()},r=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault();if(t.dataTransfer?.files&&t.dataTransfer.files.length>0)L(t.dataTransfer.files)};return document.addEventListener("dragover",e),document.addEventListener("drop",r),()=>{document.removeEventListener("dragover",e),document.removeEventListener("drop",r)}},[L,w]),M(()=>()=>{if(!l){for(let e of O.current)if(e.url)URL.revokeObjectURL(e.url)}},[l]);let ve=(e)=>{if(e.currentTarget.files)L(e.currentTarget.files);e.currentTarget.value=""},Y=Te(()=>({files:c.map((e)=>({...e,id:e.id})),add:L,remove:J,clear:U,openFileDialog:V,fileInputRef:x}),[c,L,J,U,V]),_=E({controller:s,files:c,canSubmit:f});_.current={controller:s,files:c,canSubmit:f};let z=E(!0);M(()=>(z.current=!0,()=>{z.current=!1}),[]);let Z=async(e)=>{let r=f===void 0?!0:f();if(r!==!0)return{status:"blocked",reason:r};if(N.current)return{status:"blocked",reason:"submission_pending"};if(e===null&&g===void 0)throw Error("Awaitable submission requires onSubmitAsync");let t=S.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let n=l?s.textInput.value:oe(t),m=s?.textInput.getRevision?.(),i=c,v=()=>{if(!z.current)return;let p=_.current;if(p.files!==i)return;if(l){if(m===void 0||p.controller===null||p.controller.textInput.getRevision?.()!==m)return;if(p.controller.textInput.clearSubmitted===void 0)p.controller.textInput.clear();else p.controller.textInput.clearSubmitted()}else if(oe(t)===n)t.reset();U()};N.current=!0;try{if(d?.(n.trim()))return v(),{status:"accepted"};let p=await Ae(i),H=_.current.canSubmit===void 0?!0:_.current.canSubmit();if(H!==!0)return{status:"blocked",reason:H};if(!z.current)return{status:"blocked",reason:"form_unmounted"};if(p.rejectedCount>0)b?.({code:"accept",message:"One or more images are corrupted and were removed before sending."});if(g!==void 0)await g({text:n,files:p.files});else if(e!==null)await ue({text:n,files:p.files},e);return v(),{status:"accepted"}}finally{N.current=!1}},he=(e)=>{e.preventDefault(),Z(e).catch(y)},Pe=h((e)=>{if(!e.trim())return;if(l&&s)Me(()=>{s.textInput.setInput(e)});S.current?.requestSubmit()},[s,l]),ee=a(W.Provider,{value:()=>Z(null),children:Ee(K.Provider,{value:Pe,children:[a("input",{accept:A,"aria-label":"Upload files",className:"hidden",multiple:se,onChange:ve,ref:x,title:"Upload files",type:"file"}),a("form",{className:P("w-full",u),onSubmit:he,ref:S,"data-tour":"chat-input",...pe,children:a(tt,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",me&&"border! border-[rgb(255,0,135)] has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(255,0,135)] dark:border-[rgb(253,93,177)] dark:has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(253,93,177)]"),children:le})})]})});return l?a(C.Provider,{value:Y,children:ee}):a(q.Provider,{value:Y,children:ee})};function Ue({className:u,...o}){return a("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",u),...o})}function Be({className:u,...o}){return a(ie,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",u),...o})}function Oe({className:u,...o}){return a(ie,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",u),...o})}function We({className:u,...o}){return a("div",{className:P("flex items-center gap-1",u),...o})}var Ge=({variant:u="ghost",className:o,size:I,collapsed:d=!1,...y})=>{let f=d||ne.count(y.children)<=1?"icon-xs":"xs";return a(ae,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(d||ne.count(y.children)<=1)&&"size-7",o),size:f,type:"button",variant:u,...y})},je=({className:u,variant:o="ghost",size:I="icon-xs",status:d,children:y,...f})=>{let g=a(Ie,{className:"size-4"});if(d==="submitted")g=a(ye,{className:"size-4 animate-spin"});else if(d==="streaming")g=a(xe,{className:"size-3 fill-current"});else if(d==="error")g=a(Le,{className:"size-4"});return a(ae,{"aria-label":"Submit",className:P("bg-foreground text-background hover:bg-foreground/70 size-7 rounded-full p-0 transition-opacity disabled:opacity-50",u),size:I,type:"submit",variant:o,...f,children:y??g})};export{Q as MAX_TOTAL_IMAGE_MB,Re as PromptInput,Ue as PromptInputBody,Ge as PromptInputButton,Oe as PromptInputFooter,Be as PromptInputHeader,je as PromptInputSubmit,We as PromptInputTools};
|
package/dist/image-lightbox.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ge}from"./chunk-en6qem8e.js";export{ge as ImageLightbox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{we}from"./chunk-kk9q6wtq.js";import"./chunk-tcqf45rf.js";import"./chunk-wnq8g0kp.js";import"./chunk-vk39871j.js";export{we as ImagePreviewDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Me}from"../chunk-dp4g5y18.js";export{Me as createCodeHighlighter};
|
package/dist/lib/fuzzy.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Y,De}from"../chunk-c4ps9628.js";export{De as fuzzyFilter,Y as fuzzyMatch};
|
package/dist/lib/group-blocks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ee}from"../chunk-g13txkf0.js";import"../chunk-2v9kbth7.js";export{Ee as groupBlocksForStyle};
|
package/dist/lib/image-encode.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fe}from"../chunk-3z0y9amd.js";export{Fe as convertBlobUrlToDataUrl};
|
package/dist/lib/limits.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ct,Tt,Ne,Pt,Q}from"../chunk-bbw2zg1a.js";export{Ct as BYTES_PER_MB,Tt as MAX_TOTAL_IMAGE_BYTES,Q as MAX_TOTAL_IMAGE_MB,Ne as exceedsImageLimit,Pt as formatImageSizeMb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Z,_e}from"../chunk-35j3t609.js";export{Z as cachedMarkdown,_e as createMarkdownParser};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Le,X}from"../chunk-ahcmeqvb.js";export{Le as createChatMarkdown,X as isSafeMarkdownUrl};
|
package/dist/lib/model-name.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{j}from"../chunk-k4w61adv.js";export{j as formatModelName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ie}from"../chunk-tcqf45rf.js";export{Ie as getPointerCenteredScrollPosition};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ae}from"../chunk-1vxrdkew.js";import"../chunk-3z0y9amd.js";export{Ae as preparePromptFiles};
|
package/dist/lib/stream-style.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Mt,Re,dt,l,Nt}from"../chunk-2v9kbth7.js";export{Mt as STREAM_STYLES,dt as TOOL_CATEGORIES,l as describeToolUse,Re as isCodexLook,Nt as toolDotClass};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Le}from"../chunk-ahcmeqvb.js";function T(e,o){let t=Object.keys(e);return t.length===Object.keys(o).length&&t.every((r)=>{let i=o[r];return e[r].href===i?.href&&e[r].title===i.title})}function b(e,o){let t=2,r=0;for(let n=e.length-1;n>=0;n-=1){if(e[n].type==="space")continue;if(t-=1,t===0){r=n;break}}let i=0;for(let n=0;n<r;n+=1){let l=e[n];if(l.type==="def"||/^ {0,3}(?:\[|<|\$\$|\\\[)/.test(l.raw))return i;let k=!1;if(o.walkTokens([e[n]],(a)=>{if(a.type==="html"&&(("inLink"in a)&&a.inLink||("inRawBlock"in a)&&a.inRawBlock))k=!0}),k)return i;if(/\n[\t ]*\n$/.test(e[n].raw))i=n+1}return i}function L(e=Le()){let o="",t=[],r={},i={};return{parse(n){let l=n.replaceAll(/\r\n|\r/g,`
|
|
2
2
|
`);if(!l.startsWith(o))o="",t=[],r={},i={};let k=new e.Lexer(e.defaults);k.tokens.links={...r};let a=k.lex(l.slice(o.length)),f=[...t,...a],u=a.links;if(t.length>0&&!T(i,u)){let s=e.lexer(l);f=[...s],u=s.links}i=u;let h=0,d=[];for(let s of f){if(!l.startsWith(s.raw,h))break;d.push(s),h+=s.raw.length}return t=d.slice(0,b(d,e)),o=l.slice(0,t.reduce((s,c)=>s+c.raw.length,0)),r=Object.create(null),e.walkTokens(t,(s)=>{if(s.type!=="def")return;let c=s;if(!Object.hasOwn(r,c.tag))r[c.tag]={href:c.href,title:c.title}}),structuredClone(f)}}}export{L as createStreamingMarkdownLexer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"../chunk-
|
|
1
|
+
import{e}from"../chunk-vk39871j.js";import"../chunk-wmsdg5fb.js";import{ue}from"../chunk-3t2c4zky.js";import"../chunk-7xdvwjxh.js";import{_}from"../chunk-98g6kwj5.js";import{cn as Z}from"cn";import{SearchIcon as j}from"lucide-react";import{useCallback as N,useEffect as g,useMemo as z,useRef as v,useState as M}from"react";import{jsx as R,jsxs as J,Fragment as rt}from"react/jsx-runtime";var D="chat-search",F="chat-search-current",U=150;function st(o){let r=o??"";return[...document.querySelectorAll("[data-chat-scroll]")].find((l)=>l.dataset.chatScroll===r)??null}var tt=12;function V(o,r="center"){let l=o.closest("[data-chat-scroll]");if(!l)return;let d=o.getBoundingClientRect(),m=l.getBoundingClientRect(),H=r==="start"?tt:(l.clientHeight-d.height)/2;l.scrollTo({top:l.scrollTop+(d.top-m.top)-H,behavior:"smooth"})}function q(o){let r=o.startContainer.parentElement;if(!r)return;V(r)}var T=new Map;function Q(){if(typeof CSS>"u"||!("highlights"in CSS)||typeof Highlight>"u")return;if(T.size===0){CSS.highlights.delete(D),CSS.highlights.delete(F);return}let o=[...T.values()];CSS.highlights.set(D,new Highlight(...o.flatMap((r)=>r.all))),CSS.highlights.set(F,new Highlight(...o.flatMap((r)=>r.current?[r.current]:[])))}function et(){let o=Symbol();return{clearHighlights:()=>{T.delete(o),Q()},applyHighlights:(r,l)=>{T.set(o,{all:r,current:l}),Q()}}}function at({getViewport:o,findSourceMatches:r,revealTurn:l,subscribeOpen:d,labels:m,placement:H="header"}){let{clearHighlights:i,applyHighlights:p}=z(et,[]),S=r!==void 0,[s,w]=M(!1),[u,K]=M(""),h=z(()=>s&&u.trim()&&r?r(u.trim()):[],[r,s,u]),[O,L]=M(0),[W,y]=M(0),C=v([]),E=v(0),a=v(null),P=v(null),G=v(null);g(()=>{if(!d)return;return d(()=>{w(!0);let t=G.current;if(t!==null)t.focus(),t.select()})},[d]);let I=N(async(c,t)=>{let n=h[c];if(n===void 0)return;let f=o();if(f===null)throw Error("Chat scroll container is missing");if(l)await l(n.turnKey,t);if(t.aborted)return;let b=f.querySelector(`[data-turn-key="${CSS.escape(n.turnKey)}"]`);if(b===null)throw Error(`Codex turn is missing: ${n.turnKey}`);if(!l)V(b,"start");if(await new Promise((Y)=>requestAnimationFrame(()=>Y())),t.aborted)return;let k=_(b,u.trim());C.current=k;let B=k[n.occurrenceInTurn];if(p(k,B??null),B!==void 0)q(B)},[p,h,o,u,l]),A=v(I);g(()=>{A.current=I},[I]);let x=N(()=>{w(!1),K(""),E.current=0,a.current?.abort(),a.current=null,i(),C.current=[]},[i]);g(()=>{if(!s)return;let c=(t)=>{if(t.key==="Escape"&&P.current?.contains(document.activeElement))t.preventDefault(),x()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s,x]),g(()=>{if(!s||!u.trim()){i(),C.current=[],L(0),y(0),E.current=0;return}let c=setTimeout(()=>{if(S)return;let t=o();if(!t)return;let n=_(t,u);if(C.current=n,L(n.length),y(0),p(n,n[0]??null),n[0])q(n[0])},U);return()=>{clearTimeout(c),i()}},[p,i,S,s,u,o]),g(()=>{if(!s||!S||!u.trim())return;let c=new AbortController;a.current?.abort(),a.current=c;let t=setTimeout(()=>{C.current=[],E.current=0,L(h.length),y(0),i(),A.current(0,c.signal)},U);return()=>{if(c.abort(),a.current===c)a.current=null;clearTimeout(t),i()}},[i,h.length,S,s,u]),g(()=>()=>{a.current?.abort(),i()},[i]),g(()=>{if(!s)i()},[i,s]);let X=N((c)=>{if(S){if(h.length===0)return;let n=(E.current+(c?-1:1)+h.length)%h.length;E.current=n,y(n),a.current?.abort();let f=new AbortController;a.current=f,A.current(n,f.signal);return}let t=C.current;if(!t.length)return;y((n)=>{let f=(n+(c?-1:1)+t.length)%t.length,b=t[f];return p(t,b),q(b),f})},[p,h.length,S]);return J(rt,{children:[H==="header"&&R(e,{variant:"ghost",size:"icon-sm",title:m.search,onClick:()=>s?x():w(!0),children:R(j,{})}),s&&J("div",{"data-chat-search":!0,ref:P,className:Z("bg-background border-b",H==="body"?"relative shrink-0":"absolute inset-x-0 top-full z-30"),children:[R(ue,{ref:G,value:u,onChange:K,onFind:X,onClose:x,placeholder:m.placeholder,prevTitle:m.previous,nextTitle:m.next}),u.trim()&&R("div",{className:"text-muted-foreground border-border border-t px-3 py-1 text-[11px]",children:O===0?"0 / 0":`${W+1} / ${O}`})]})]})}export{at as ChatSearch,_ as collectMatches,st as findChatScrollContainer,V as scrollChatElementIntoView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{_}from"../chunk-98g6kwj5.js";import"../chunk-7xdvwjxh.js";export{_ as collectMatches};
|
package/dist/search/find-bar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ue}from"../chunk-3t2c4zky.js";import"../chunk-wmsdg5fb.js";import"../chunk-vk39871j.js";export{ue as FindBar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O,pt}from"../chunk-7xdvwjxh.js";export{pt as findTextSourceMatches,O as literalMatches};
|
package/dist/ui/badge.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{lt,
|
|
1
|
+
import{lt,Se}from"../chunk-6q8b8aww.js";export{Se as Badge,lt as badgeVariants};
|
package/dist/ui/button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{mt,e}from"../chunk-vk39871j.js";export{e as Button,mt as buttonVariants};
|
package/dist/ui/card.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Be,ze,$e,Ue,Rt,Ve,Ke}from"../chunk-2sgxwycp.js";export{Be as Card,Rt as CardAction,Ve as CardContent,Ue as CardDescription,Ke as CardFooter,ze as CardHeader,$e as CardTitle};
|
package/dist/ui/checkbox.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{w}from"../chunk-dj8v2w6n.js";export{w as Checkbox};
|
package/dist/ui/dialog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{E,Ht,ct,Ze,ut,R,Ye,Je,L,et}from"../chunk-wnq8g0kp.js";import"../chunk-vk39871j.js";export{E as Dialog,Ze as DialogClose,R as DialogContent,et as DialogDescription,Je as DialogFooter,Ye as DialogHeader,ut as DialogOverlay,ct as DialogPortal,L as DialogTitle,Ht as DialogTrigger};
|
package/dist/ui/dropdown-menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x,
|
|
1
|
+
import{v,St,x,m,b,D,y,P,I,M,J,He,Oe,a,Et}from"../chunk-j3my6gn8.js";export{v as DropdownMenu,J as DropdownMenuCheckboxItem,m as DropdownMenuContent,b as DropdownMenuGroup,y as DropdownMenuItem,D as DropdownMenuLabel,St as DropdownMenuPortal,He as DropdownMenuRadioGroup,Oe as DropdownMenuRadioItem,a as DropdownMenuSeparator,Et as DropdownMenuShortcut,P as DropdownMenuSub,M as DropdownMenuSubContent,I as DropdownMenuSubTrigger,x as DropdownMenuTrigger};
|
package/dist/ui/field.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{re,oe,je,Qe,_t,Xe,At,H,Ft,Dt}from"../chunk-3abwky4a.js";import"../chunk-gnthx1zg.js";import"../chunk-bwzjm3g8.js";export{Qe as Field,_t as FieldContent,H as FieldDescription,Dt as FieldError,je as FieldGroup,Xe as FieldLabel,oe as FieldLegend,Ft as FieldSeparator,re as FieldSet,At as FieldTitle};
|
package/dist/ui/hover-card.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{We,qe,Ge}from"../chunk-38skakaz.js";export{We as HoverCard,Ge as HoverCardContent,qe as HoverCardTrigger};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{se}from"../chunk-p141s624.js";import"../chunk-d0ptk8x8.js";export{se as InputGroupTextarea};
|
package/dist/ui/input-group.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{tt,ie,ae,Ot}from"../chunk-fmxt5ysw.js";import{se}from"../chunk-p141s624.js";import"../chunk-d0ptk8x8.js";import"../chunk-vk39871j.js";export{tt as InputGroup,ie as InputGroupAddon,ae as InputGroupButton,Ot as InputGroupText,se as InputGroupTextarea};
|
package/dist/ui/input.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d}from"../chunk-wmsdg5fb.js";export{d as Input};
|
package/dist/ui/radio-group.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,
|
|
1
|
+
import{c,s}from"../chunk-nfd274y3.js";export{c as RadioGroup,s as RadioGroupItem};
|
package/dist/ui/separator.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{S}from"../chunk-gnthx1zg.js";export{S as Separator};
|
package/dist/ui/switch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{N}from"../chunk-s2n85pks.js";export{N as Switch};
|
package/dist/ui/tooltip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Lt,ee,te,ne}from"../chunk-9f42d428.js";export{ee as Tooltip,ne as TooltipContent,Lt as TooltipProvider,te as TooltipTrigger};
|
package/package.json
CHANGED
package/dist/chunk-2q9rzxbj.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Ye}from"./chunk-qj8r5xvx.js";import{M,Ve,N,S}from"./chunk-yw4e2tcz.js";import{cn as v}from"cn";import{XIcon as L}from"lucide-react";import{useCallback as p,useEffect as z,useMemo as j,useRef as H,useState as b}from"react";import{jsx as i,jsxs as A}from"react/jsx-runtime";function Ue({open:l,onOpenChange:P,url:h,filename:O,scale:d,onScaleChange:f,containerRef:T,containerClassName:I,dialogContentClassName:R,imageClassName:W}){let g=p((e)=>Math.min(4,Math.max(0.25,e)),[]),[Z,x]=b(1),o=g(d??Z),k=H(null),s=T??k,C=H(null),[m,D]=b({width:0,height:0}),[y,E]=b({width:0,height:0}),w=p((e)=>{let n=g(e);if(typeof f==="function"){f(n);return}x(n)},[f,g]);z(()=>{if(!l)return;if(!h)return;if(typeof d==="number")return;x(1)},[l,h,d]),z(()=>{if(!l)return;let e=s.current;if(!e)return;let n=()=>{D({width:e.clientWidth,height:e.clientHeight})};n();let t=new ResizeObserver(n);return t.observe(e),()=>{t.disconnect()}},[s,l]);let X=p(()=>{w(1)},[w]),r=j(()=>{let{width:e,height:n}=y,{width:t,height:a}=m;if(e===0||n===0)return{width:0,height:0};if(t===0||a===0)return{width:0,height:0};let c=Math.min(t/e,a/n,1),u=e*c,_=n*c;return{width:u*o,height:_*o}},[o,y,m]);if(!h)return null;return i(M,{open:l,onOpenChange:P,children:A(N,{className:v("top-1/2 left-1/2 h-[90vh] max-h-[90vh] w-[90vw]! max-w-[90vw]! -translate-x-1/2 -translate-y-1/2 gap-0 rounded-none bg-transparent p-0 ring-0 sm:w-[90vw]! sm:max-w-[90vw]!",R),showCloseButton:!1,children:[i(S,{className:"sr-only",children:O||"Image preview"}),i(Ve,{"aria-label":"Close",className:"absolute top-3 right-3 z-10 flex size-10 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur-sm transition-colors hover:bg-black/75",children:i(L,{className:"size-5"})}),i("div",{ref:s,onWheel:(e)=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let n=e.deltaY>0?o-0.2:o+0.2,t=g(Number.parseFloat(n.toFixed(2)));if(t===o)return;let a=s.current,c=C.current,u=a&&c?Ye({container:a,target:c,clientX:e.clientX,clientY:e.clientY,currentScale:o,nextScale:t}):null;if(w(t),a&&u)requestAnimationFrame(()=>{a.scrollTo(u)})},className:v("h-full w-full scrollbar-thin overflow-auto",I),children:i("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.max(m.width,r.width),height:Math.max(m.height,r.height)},children:i("div",{className:"shrink-0",children:i("img",{alt:O||"image preview",className:v("block object-contain select-none",W),decoding:"async",draggable:!1,ref:C,onDoubleClick:X,onLoad:(e)=>{let n=e.currentTarget;E({width:n.naturalWidth,height:n.naturalHeight});let t=s.current;if(t&&(t.clientWidth||t.clientHeight))D({width:t.clientWidth,height:t.clientHeight})},style:{imageRendering:"auto",width:r.width||void 0,height:r.height||void 0,maxWidth:r.width?"none":"90vw",maxHeight:r.height?"none":"90vh"},src:h})})})})]})})}
|
|
2
|
-
export{Ue};
|
package/dist/chunk-36h9z1mt.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r}from"./chunk-bwzjm3g8.js";import{P}from"./chunk-66headm4.js";import{cva as p}from"class-variance-authority";import{cn as l}from"cn";import{useMemo as u}from"react";import{jsx as t,jsxs as m}from"react/jsx-runtime";function j({className:a,...e}){return t("fieldset",{"data-slot":"field-set",className:l("flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",a),...e})}function Q({className:a,variant:e="legend",...o}){return t("legend",{"data-slot":"field-legend","data-variant":e,className:l("mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base",a),...o})}function Fe({className:a,...e}){return t("div",{"data-slot":"field-group",className:l("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",a),...e})}var c=p("group/field data-[invalid=true]:text-destructive flex w-full gap-3",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function De({className:a,orientation:e="vertical",...o}){return t("div",{role:"group","data-slot":"field","data-orientation":e,className:l(c({orientation:e}),a),...o})}function Pt({className:a,...e}){return t("div",{"data-slot":"field-content",className:l("group/field-content flex flex-1 flex-col gap-1 leading-snug",a),...e})}function He({className:a,...e}){return t(r,{"data-slot":"field-label",className:l("group/field-label peer/field-label has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 *:data-[slot=field]:p-3","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",a),...e})}function It({className:a,...e}){return t("div",{"data-slot":"field-label",className:l("flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50",a),...e})}function D({className:a,...e}){return t("p",{"data-slot":"field-description",className:l("text-muted-foreground text-left text-sm leading-normal font-normal group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5","last:mt-0 nth-last-2:-mt-1","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",a),...e})}function Mt({children:a,className:e,...o}){return m("div",{"data-slot":"field-separator","data-content":!!a,className:l("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",e),...o,children:[t(P,{className:"absolute inset-0 top-1/2"}),a&&t("span",{className:"bg-background text-muted-foreground relative mx-auto block w-fit px-2","data-slot":"field-separator-content",children:a})]})}function Nt({className:a,children:e,errors:o,...n}){let s=u(()=>{if(e)return e;if(!o?.length)return null;let i=[...new Map(o.map((d)=>[d?.message,d])).values()];if(i?.length==1)return i[0]?.message;return t("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:i.map((d,f)=>d?.message&&t("li",{children:d.message},f))})},[e,o]);if(!s)return null;return t("div",{role:"alert","data-slot":"field-error",className:l("text-destructive text-sm font-normal",a),...n,children:s})}export{j,Q,Fe,De,Pt,He,It,D,Mt,Nt};
|
package/dist/chunk-3eg720sa.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e}from"./chunk-wjejhpgw.js";import{l}from"./chunk-1hy64ewz.js";import{cn as v}from"cn";import{ChevronDownIcon as g,ChevronUpIcon as b,XIcon as z}from"lucide-react";import{useEffect as B,useImperativeHandle as N,useRef as E}from"react";import{jsx as n,jsxs as k}from"react/jsx-runtime";function Te({ref:p,value:i,onChange:d,onFind:o,onClose:s,placeholder:m,autoFocusOpen:a=!0,prevTitle:c,nextTitle:u,className:h}){let r=E(null);N(p,()=>{if(r.current===null)throw Error("FindBar input is not mounted");return r.current},[]),B(()=>{if(!a)return;let t=r.current;if(t===null)throw Error("FindBar input is not mounted");t.focus(),t.select()},[a]);let f=!i;return k("div",{className:v("border-border flex h-9 shrink-0 items-center gap-1 border-b px-2",h),children:[n(l,{ref:r,value:i,onChange:(t)=>d(t.target.value),placeholder:m,className:"h-7 text-xs",onKeyDown:(t)=>{if(t.key==="Escape"){t.preventDefault(),s();return}if(t.key==="Enter"){if(t.preventDefault(),i)o(t.shiftKey)}}}),n(e,{size:"icon",variant:"ghost",className:"size-6",disabled:f,onClick:()=>o(!0),title:c?`${c} (⇧↵)`:"⇧↵",children:n(b,{className:"size-3.5"})}),n(e,{size:"icon",variant:"ghost",className:"size-6",disabled:f,onClick:()=>o(!1),title:u?`${u} (↵)`:"↵",children:n(g,{className:"size-3.5"})}),n(e,{size:"icon",variant:"ghost",className:"size-6",onClick:s,title:"Esc",children:n(z,{className:"size-3.5"})})]})}
|
|
2
|
-
export{Te};
|
package/dist/chunk-7tj0a2na.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function ot(t,e){if(t.type||!e.type)return t;let o=e.type.split("/")[1],i=o!==void 0&&o!==""?`pasted-${Date.now()}.${o==="jpeg"?"jpg":o}`:"";return new File([t],t.name||i||`pasted-${Date.now()}`,{type:e.type})}function le(t){let e=[],o=!1;for(let i of t){if(i.kind!=="file")continue;let n=i.getAsFile();if(!n)continue;if(!(n.type||i.type).startsWith("image/")){o=!0;continue}e.push(ot(n,i))}return{imageFiles:e,sawNonImageFile:o}}function de(t){return[...t].some((e)=>e.kind==="string")}function s(t){let e=t.codePointAt(0);return e<32&&e!==9&&e!==10&&e!==13||e===127}function it(t){return[...t].filter((e)=>!s(e)).join("")}function nt(t,e){let o=0;for(let i=0;i<e;i++){let n=t.charCodeAt(i);if(n>=0&&n<=8||n===11||n===12||n>=14&&n<=31||n===127)o++}return o}function _(t){let{value:e,selectionStart:o,selectionEnd:i}=t,n=it(e);if(n===e)return n;if(t.value=n,o!==null&&i!==null){let a=Math.max(0,o-nt(e,o)),r=Math.max(0,i-nt(e,i));requestAnimationFrame(()=>{t.setSelectionRange(a,r)})}return n}
|
|
2
|
-
export{ot,le,de,it,nt,_};
|
package/dist/chunk-8z8va1ws.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var rt={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function Ce(e){return[...e].toSorted((o,n)=>(rt[o.kind]??99)-(rt[n.kind]??99))}function wt(e){return e==="allow_once"||e==="allow_always"}function kt(e){return e==="allow_always"||e==="reject_always"}
|
|
2
|
-
export{rt,Ce,wt,kt};
|
package/dist/chunk-arge74eh.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{se,Je}from"./chunk-hnt4tt1n.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function V(t,s,o=50){let i=new Set,r=t.filter((n)=>{if(i.has(n.name))return!1;return i.add(n.name),!0});if(!s)return r.slice(0,o).map(c);let l=s.toLowerCase(),e=[];for(let n of r){let a=se(n.name,s);if(a)e.push({c:n,score:a.score});else if(n.description?.toLowerCase().includes(l))e.push({c:n,score:-1})}return e.sort((n,a)=>a.score-n.score),e.slice(0,o).map((n)=>c(n.c))}function vt(t,s,o,i=50){let r=o?`${o.replace(/\/$/,"")}/`:"",l=t.map((e)=>({abs:e,rel:r&&e.startsWith(r)?e.slice(r.length):e}));return Je(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
|
|
2
|
-
export{V,vt};
|
package/dist/chunk-g20b01rn.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var t=new Map;var a=0;function ie(e,n){let r=n?void 0:t.get(e);if(r===void 0)return null;return t.delete(e),t.set(e,r),{...r,tokens:structuredClone(r.tokens)}}function c(e){if(e.isStreaming||e.text.length>1048576)return;if(t.delete(e.text))a-=e.text.length;t.set(e.text,{...e,tokens:structuredClone(e.tokens)}),a+=e.text.length;while(a>2097152||t.size>200){let n=t.keys().next().value;a-=n.length,t.delete(n)}}class l{worker=new Worker(new URL("@alwith/module-chat/markdown-parser.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(e)=>{let n=e.data,r=this.active;if(n.clientId!==r?.clientId||n.revision!==r.revision){this.fail(Error("Markdown worker returned an unexpected request"));return}if(this.active=null,!n.ok){this.fail(Error(n.error));return}let i={...r.input,tokens:n.tokens};c(i);let s=this.clients.get(r.clientId),o=this.pending.get(r.clientId),u=o!==void 0&&r.input.isStreaming&&o.input.isStreaming&&o.input.text.startsWith(r.input.text);if(s!==void 0&&(s.revision===r.revision||u))s.onResult(i);this.dispatch()},this.worker.onerror=(e)=>this.fail(Error(e.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize Markdown parsing result"))}fail(e){this.failure=e,this.worker.terminate(),this.pending.clear(),this.active=null;for(let n of this.clients.values())n.onError(e)}send(e){try{this.worker.postMessage(e)}catch(n){this.fail(n instanceof Error?n:Error(String(n)))}}dispatch(){if(this.active!==null||this.pending.size===0)return;let e=this.pending.values().next().value;this.pending.delete(e.clientId),this.active=e,this.send({type:"parse",clientId:e.clientId,revision:e.revision,source:e.input.source})}connect(e,n){if(this.failure!==null)throw this.failure;let r=++this.nextClientId,i={revision:0,onResult:e,onError:n};return this.clients.set(r,i),{update:(s)=>{if(this.failure!==null)throw this.failure;i.revision+=1;let o=ie(s.text,s.isStreaming);if(o!==null){this.pending.delete(r),i.onResult(o);return}this.pending.set(r,{clientId:r,revision:i.revision,input:s}),this.dispatch()},dispose:()=>{if(!this.clients.delete(r))return;if(this.pending.delete(r),this.clients.size===0)this.worker.terminate(),d=void 0;else if(this.failure===null)this.send({type:"dispose",clientId:r})}}}}var d;function Xe(e,n){return d??=new l,d.connect(e,n)}
|
|
2
|
-
export{ie,Xe};
|
package/dist/chunk-gfj69sqc.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function*G(n,e){if(e.length===0)return;let r=new RegExp(e.replaceAll(/[.*+?^{}()|[\]\\$]/g,String.raw`\$&`),"giu");for(let t of n.matchAll(r))yield{start:t.index,end:t.index+t[0].length}}function Ct(n,e){if(e.length===0)return[];let r=[];for(let{turnKey:t,segments:o}of n){let c=0;for(let s of o)for(let a of G(s,e))r.push({turnKey:t,occurrenceInTurn:c}),c+=1}return r}
|
|
2
|
-
export{G,Ct};
|
package/dist/chunk-hnt4tt1n.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function se(r,n){if(!n)return{score:0,indices:[]};let s=r.toLowerCase(),c=n.toLowerCase(),i=[],t=0,e=0,u=-2;for(let l of c.split("")){let o=-1;while(t<s.length){if(s[t]===l){o=t;break}t++}if(o<0)return null;if(e+=1,o===u+1)e+=4;if(h(r,o))e+=5;let f=r.lastIndexOf("/");if(f!==-1&&o>f)e+=2;i.push(o),u=o,t=o+1}if(e-=Math.floor(r.length/50),r.includes(n))e+=3;return{score:e,indices:i}}function Je(r,n,s,c=100){if(!n)return r.slice(0,c).map((t)=>({item:t,score:0,indices:[]}));let i=[];for(let t of r){let e=se(s(t),n);if(!e)continue;i.push({item:t,score:e.score,indices:e.indices})}return i.sort((t,e)=>e.score-t.score),i.slice(0,c)}
|
|
2
|
-
export{se,Je};
|
package/dist/chunk-kaeqvcew.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Menu as n}from"@base-ui/react/menu";import{cn as i}from"cn";import{CheckIcon as p,ChevronRightIcon as l}from"lucide-react";import{jsx as t,jsxs as c}from"react/jsx-runtime";function x({...e}){return t(n.Root,{"data-slot":"dropdown-menu",...e})}function Lt({...e}){return t(n.Portal,{"data-slot":"dropdown-menu-portal",...e})}function b({...e}){return t(n.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function m({align:e="start",alignOffset:o=0,side:a="bottom",sideOffset:r=4,className:d,...u}){return t(n.Portal,{children:t(n.Positioner,{className:"isolate z-50 outline-none",align:e,alignOffset:o,side:a,sideOffset:r,children:t(n.Popup,{"data-slot":"dropdown-menu-content",className:i("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md p-1 shadow-md ring-1 duration-100 outline-none data-closed:overflow-hidden",d),...u})})})}function y({...e}){return t(n.Group,{"data-slot":"dropdown-menu-group",...e})}function H({className:e,inset:o,...a}){return t(n.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":o,className:i("text-muted-foreground px-2 py-1.5 text-xs font-medium data-inset:pl-8",e),...a})}function w({className:e,inset:o,variant:a="default",...r}){return t(n.Item,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":a,className:i("group/dropdown-menu-item focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:*:[svg]:text-destructive relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function E({...e}){return t(n.SubmenuRoot,{"data-slot":"dropdown-menu-sub",...e})}function R({className:e,inset:o,children:a,...r}){return c(n.SubmenuTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:i("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[a,t(l,{className:"ml-auto"})]})}function L({align:e="start",alignOffset:o=-3,side:a="right",sideOffset:r=0,className:d,...u}){return t(m,{"data-slot":"dropdown-menu-sub-content",className:i("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 w-auto min-w-[96px] rounded-md p-1 shadow-lg ring-1 duration-100",d),align:e,alignOffset:o,side:a,sideOffset:r,...u})}function re({className:e,children:o,checked:a,inset:r,...d}){return c(n.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:i("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...d,children:[t("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:t(n.CheckboxItemIndicator,{children:t(p,{})})}),o]})}function Ge({...e}){return t(n.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...e})}function je({className:e,children:o,inset:a,...r}){return c(n.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":a,className:i("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[t("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:t(n.RadioItemIndicator,{children:t(p,{})})}),o]})}function s({className:e,...o}){return t(n.Separator,{"data-slot":"dropdown-menu-separator",className:i("bg-border -mx-1 my-1 h-px",e),...o})}function _t({className:e,...o}){return t("span",{"data-slot":"dropdown-menu-shortcut",className:i("text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest",e),...o})}export{x,Lt,b,m,y,H,w,E,R,L,re,Ge,je,s,_t};
|
package/dist/chunk-mbrd76nh.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createContext as f,useCallback as n,useContext as i,useEffect as et,useMemo as J,useRef as g,useState as K}from"react";import{jsx as N}from"react/jsx-runtime";var A=f(null),B=f(null);function pt(){return i(B)}var z=f(null);function gt(){return i(z)}var k=f(null);function ue(){let r=i(A);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");return r}var C=()=>i(A);function ft(){let r=i(k);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");return r}var nt=()=>i(k);function ht({initialInput:r="",revision:l,onSubmittedClear:c,onRemoveAttachment:R,attachmentPolicy:P,value:y,onValueChange:L,attachments:S,onAttachmentsChange:T,children:Q}){let W=n((t)=>{if(t.type)return t.type;let e=(t.name||"").toLowerCase();if(e.endsWith(".png"))return"image/png";if(e.endsWith(".jpg")||e.endsWith(".jpeg"))return"image/jpeg";if(e.endsWith(".webp"))return"image/webp";if(e.endsWith(".gif"))return"image/gif";if(e.endsWith(".bmp"))return"image/bmp";if(e.endsWith(".svg"))return"image/svg+xml";return""},[]),j=y!==void 0,[V,X]=K(r),a=y??V,o=g({value:a,external:l,revision:0});if(o.current.value!==a||o.current.external!==l)o.current={value:a,external:l,revision:o.current.revision+1};let w=n(()=>o.current.revision,[]),x=n((t)=>{if(o.current.value=t,o.current.revision++,j)L?.(t);else X(t)},[j,L]),h=n(()=>x(""),[x]),v=S!==void 0,[Y,Z]=K([]),I=S??Y,b=g(I);b.current=I;let s=n((t)=>{let e=typeof t==="function"?t(b.current):t;if(v)T?.(e);else Z(e)},[v,T]),O=g(null),M=g(()=>{}),E=n((t)=>{let e=[...t];if(e.length===0)return;s((m)=>{let d=P===void 0?e:P.uniqueFiles(e,m);return[...m,...d.map((u)=>{let G=P?.sourcePath(u);return{id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(u),mediaType:W(u),filename:u.name,size:u.size,lastModified:u.lastModified,...G===void 0?{}:{sourcePath:G}}})]})},[P,W,s]),H=n((t)=>{s((e)=>{let m=e.find((d)=>d.id===t);if(m?.url)URL.revokeObjectURL(m.url);return e.filter((d)=>d.id!==t)}),R?.()},[R,s]),_=n(()=>{s((t)=>{for(let e of t)if(e.url)URL.revokeObjectURL(e.url);return[]})},[s]);et(()=>{if(v)return;return()=>{for(let t of b.current)if(t.url)URL.revokeObjectURL(t.url)}},[v]);let q=n(()=>{M.current?.()},[]),F=J(()=>({files:I,add:E,remove:H,clear:_,openFileDialog:q,fileInputRef:O}),[I,E,H,_,q]),D=n((t,e)=>{O.current=t.current,M.current=e},[]),tt=J(()=>({textInput:{value:a,setInput:x,clear:h,getRevision:w,clearSubmitted:c??h},attachments:F,__registerFileInput:D}),[a,x,h,w,c,F,D]);return N(A.Provider,{value:tt,children:N(k.Provider,{value:F,children:Q})})}var U=f(null);function p(){let r=nt(),l=i(U),c=r??l;if(!c)throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return c}
|
|
2
|
-
export{B,pt,z,gt,k,ue,C,ft,ht,U,p};
|
package/dist/chunk-p9wpghey.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function oe(r){if(!r.trimStart().toLowerCase().startsWith("gpt"))return r;let a=/^gpt-\d/iu.test(r.trimStart())?" ":"-";return r.split(/(\s+)/).map((i)=>i.trim().length===0?i:i.split("-").map((t,o)=>{if(t.toLowerCase()==="gpt")return"GPT";if(t.toLowerCase()==="oai")return"OAI";return o>0&&t.length>0?`${t[0]?.toUpperCase()}${t.slice(1)}`:t}).join(a).replace(/^GPT (?=\d)/u,"GPT-")).join("")}
|
|
2
|
-
export{oe};
|
package/dist/chunk-pc1yzf1x.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Tooltip as i}from"@base-ui/react/tooltip";import{cn as l}from"cn";import{jsx as o,jsxs as p}from"react/jsx-runtime";function St({delay:t=0,...e}){return o(i.Provider,{"data-slot":"tooltip-provider",delay:t,...e})}function X({...t}){return o(i.Root,{"data-slot":"tooltip",...t})}function Z({...t}){return o(i.Trigger,{"data-slot":"tooltip-trigger",...t})}function Y({className:t,side:e="top",sideOffset:a=4,align:d="center",alignOffset:r=0,children:n,...s}){return o(i.Portal,{children:o(i.Positioner,{align:d,alignOffset:r,side:e,sideOffset:a,className:"isolate z-50",children:p(i.Popup,{"data-slot":"tooltip-content",className:l("bg-foreground text-background data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md px-3 py-1.5 text-xs has-data-[slot=kbd]:pr-1.5 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm",t),...s,children:[n,o(i.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}export{St,X,Z,Y};
|
package/dist/chunk-reqrpvyy.js
DELETED