@alwith/module-chat 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -10
- package/dist/activity-host.d.ts +1 -0
- 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-15nwm04a.js +2 -0
- package/dist/chunk-16y5rmm5.js +2 -0
- package/dist/chunk-1d4c9j8w.js +2 -0
- package/dist/chunk-20zcgxa5.js +4 -0
- package/dist/{chunk-kaeqvcew.js → chunk-2epnn4sq.js} +1 -1
- package/dist/chunk-2f19pcpn.js +2 -0
- package/dist/chunk-3vt71emt.js +2 -0
- package/dist/{chunk-1yy2jsnh.js → chunk-42zr8zpv.js} +2 -2
- package/dist/{chunk-k7s0drzk.js → chunk-4svwa5p8.js} +3 -3
- package/dist/chunk-4tkxmh52.js +2 -0
- package/dist/chunk-5grywgpq.js +4 -0
- package/dist/chunk-5h13saah.js +2 -0
- package/dist/chunk-5j3wnans.js +2 -0
- package/dist/{chunk-yw4e2tcz.js → chunk-6p5hgnpq.js} +1 -1
- package/dist/{chunk-kget6qfz.js → chunk-6qa5dt1k.js} +1 -1
- package/dist/{chunk-341yykkp.js → chunk-6qn5srgg.js} +1 -1
- package/dist/{chunk-1cy1j8gj.js → chunk-6vky4fcv.js} +2 -2
- package/dist/{chunk-p9wpghey.js → chunk-7kcdf82d.js} +2 -2
- package/dist/{chunk-1hy64ewz.js → chunk-7q7c0mds.js} +1 -1
- package/dist/{chunk-wjejhpgw.js → chunk-801v0awm.js} +1 -1
- package/dist/{chunk-evcrrxfp.js → chunk-8e7xf2tb.js} +1 -1
- package/dist/chunk-8k7wzkna.js +2 -0
- package/dist/chunk-8vvn71rf.js +2 -0
- package/dist/{chunk-0e1pdbec.js → chunk-9ab18v07.js} +2 -2
- package/dist/{chunk-ph7bk34y.js → chunk-9dsa5vm7.js} +2 -2
- package/dist/chunk-9pdj44jr.js +2 -0
- package/dist/{chunk-m5pbe513.js → chunk-9s1cgt7s.js} +1 -1
- package/dist/chunk-aqj0v5a9.js +7 -0
- package/dist/chunk-azmqtycn.js +2 -0
- package/dist/{chunk-3eg720sa.js → chunk-b5mkvr4d.js} +2 -2
- package/dist/chunk-bfe7xk9m.js +3 -0
- package/dist/{chunk-k1pd257q.js → chunk-bkbemt8g.js} +2 -2
- package/dist/{chunk-d0ptk8x8.js → chunk-c4621n0b.js} +1 -1
- package/dist/chunk-cw9tg2sz.js +1 -0
- package/dist/{chunk-25na55ve.js → chunk-d675nr2b.js} +2 -2
- package/dist/{chunk-y2xbq7rb.js → chunk-d8gwsw6j.js} +3 -3
- package/dist/{chunk-1twg3evk.js → chunk-dgp9q950.js} +1 -1
- package/dist/chunk-dm31xvh3.js +2 -0
- package/dist/chunk-dr6z453e.js +2 -0
- package/dist/{chunk-4gayxp21.js → chunk-ea7zsd2s.js} +2 -2
- package/dist/chunk-fgsd4fsd.js +2 -0
- package/dist/chunk-fvnb8ds4.js +2 -0
- package/dist/{chunk-qj8r5xvx.js → chunk-h0dq9ztv.js} +2 -2
- package/dist/{chunk-66headm4.js → chunk-h38yw8y3.js} +1 -1
- package/dist/{chunk-hnt4tt1n.js → chunk-h6df4xfd.js} +2 -2
- package/dist/chunk-h87xp1gv.js +2 -0
- package/dist/{chunk-bwzjm3g8.js → chunk-hx6wfscz.js} +1 -1
- package/dist/chunk-j2mcvb68.js +7 -0
- package/dist/chunk-jeyvacx6.js +5 -0
- package/dist/chunk-jh8jske0.js +2 -0
- package/dist/chunk-jn2pj92h.js +2 -0
- package/dist/{chunk-r5d37dc0.js → chunk-jrrvpnf3.js} +1 -1
- package/dist/chunk-jsb0zged.js +2 -0
- package/dist/chunk-k2y4cpra.js +2 -0
- package/dist/{chunk-zt7a6b1m.js → chunk-k7zzrns3.js} +1 -1
- package/dist/chunk-m2myfd89.js +2 -0
- package/dist/chunk-m2wxz0sj.js +2 -0
- package/dist/chunk-nxarfyj2.js +2 -0
- package/dist/chunk-p1pd1twf.js +2 -0
- package/dist/chunk-p6558tbk.js +2 -0
- package/dist/{chunk-e9zndx26.js → chunk-phe3an96.js} +2 -2
- package/dist/{chunk-ftka421d.js → chunk-q7e2bdav.js} +2 -2
- package/dist/chunk-qh5fhcrh.js +3 -0
- package/dist/chunk-sky795ex.js +1 -0
- package/dist/chunk-t3vgbc9s.js +2 -0
- package/dist/{chunk-90rwhxdf.js → chunk-t5nstx0k.js} +2 -2
- package/dist/chunk-trgq8rq1.js +2 -0
- package/dist/{chunk-bf5fh35b.js → chunk-v0zn87k5.js} +2 -2
- package/dist/chunk-v72t4sf9.js +2 -0
- package/dist/chunk-vhat5rbz.js +2 -0
- package/dist/chunk-vw2hv2sq.js +2 -0
- package/dist/{chunk-3496tgga.js → chunk-w3yddw6n.js} +2 -2
- package/dist/chunk-x9pramem.js +2 -0
- package/dist/{chunk-arge74eh.js → chunk-xjen1yt6.js} +2 -2
- package/dist/{chunk-g20b01rn.js → chunk-ypvjzkfb.js} +2 -2
- package/dist/codex/activity-group.js +1 -1
- package/dist/codex/assistant-message.js +1 -2
- package/dist/codex/async-question-card.js +1 -3
- package/dist/codex/disclosure-state.js +1 -1
- package/dist/codex/edited-files-card.js +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.js +1 -6
- 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/styles.css +176 -0
- 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/locales.d.ts +312 -0
- package/dist/locales.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/session-timeline/activity-group.d.ts +7 -0
- package/dist/session-timeline/activity-group.js +1 -0
- package/dist/session-timeline/activity-projection.d.ts +3 -0
- package/dist/session-timeline/activity-projection.js +1 -0
- package/dist/session-timeline/assistant-content.d.ts +7 -0
- package/dist/session-timeline/assistant-content.js +1 -0
- package/dist/session-timeline/assistant-turn.d.ts +28 -0
- package/dist/session-timeline/assistant-turn.js +1 -0
- package/dist/session-timeline/async-questions.d.ts +5 -0
- package/dist/session-timeline/async-questions.js +1 -0
- package/dist/session-timeline/edited-files-card.d.ts +18 -0
- package/dist/session-timeline/edited-files-card.js +1 -0
- package/dist/session-timeline/history-timeline.d.ts +12 -0
- package/dist/session-timeline/history-timeline.js +1 -0
- package/dist/session-timeline/host.d.ts +14 -0
- package/dist/session-timeline/host.js +1 -0
- package/dist/session-timeline/navigation-rail.d.ts +10 -0
- package/dist/session-timeline/navigation-rail.js +1 -0
- package/dist/session-timeline/plan.d.ts +4 -0
- package/dist/session-timeline/plan.js +1 -0
- package/dist/session-timeline/question-reply.d.ts +8 -0
- package/dist/session-timeline/question-reply.js +1 -0
- package/dist/session-timeline/resource-content.d.ts +7 -0
- package/dist/session-timeline/resource-content.js +1 -0
- package/dist/session-timeline/session-timeline.d.ts +40 -0
- package/dist/session-timeline/session-timeline.js +1 -0
- package/dist/session-timeline/timeline-registry.d.ts +12 -0
- package/dist/session-timeline/timeline-registry.js +1 -0
- package/dist/session-timeline/turn-error.d.ts +14 -0
- package/dist/session-timeline/turn-error.js +1 -0
- package/dist/session-timeline/turn-retry.d.ts +2 -0
- package/dist/session-timeline/turn-retry.js +1 -0
- package/dist/session-timeline/turn-time.d.ts +5 -0
- package/dist/session-timeline/turn-time.js +1 -0
- package/dist/session-timeline/turns.d.ts +51 -0
- package/dist/session-timeline/turns.js +1 -0
- package/dist/session-timeline/types.d.ts +31 -0
- package/dist/session-timeline/types.js +0 -0
- package/dist/session-timeline/use-timeline-scroll.d.ts +12 -0
- package/dist/session-timeline/use-timeline-scroll.js +1 -0
- package/dist/session-timeline/user-message.d.ts +8 -0
- package/dist/session-timeline/user-message.js +1 -0
- 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/label.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/textarea.js +1 -1
- package/dist/ui/tooltip.js +1 -1
- package/package.json +32 -4
- package/dist/chunk-2q9rzxbj.js +0 -2
- package/dist/chunk-36h9z1mt.js +0 -1
- package/dist/chunk-7tj0a2na.js +0 -2
- package/dist/chunk-8z8va1ws.js +0 -2
- package/dist/chunk-91nk8n6w.js +0 -2
- package/dist/chunk-c4cqqqqh.js +0 -2
- package/dist/chunk-cp20nzhv.js +0 -2
- package/dist/chunk-gfj69sqc.js +0 -2
- package/dist/chunk-mbrd76nh.js +0 -2
- package/dist/chunk-pc1yzf1x.js +0 -1
- package/dist/chunk-pqgtv07g.js +0 -2
- package/dist/chunk-reqrpvyy.js +0 -2
- package/dist/chunk-rgy601b7.js +0 -2
- package/dist/chunk-svmc952q.js +0 -7
- package/dist/chunk-tzdd96d0.js +0 -2
- package/dist/chunk-yvj5y06y.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"../chunk-
|
|
1
|
+
import{e}from"../chunk-801v0awm.js";import{k,C,x,T,j,I,H,F,D,ue,l}from"../chunk-2epnn4sq.js";import{R}from"../chunk-9s1cgt7s.js";import{oe,ie,ae}from"../chunk-cw9tg2sz.js";import{Y}from"../chunk-phe3an96.js";import{r}from"../chunk-42zr8zpv.js";import{cn as p}from"cn";import{ArrowUpRight as ce,ChevronUp as J,Loader2Icon as K,Zap as Q}from"lucide-react";import{Fragment as he,useState as X}from"react";import{jsx as n,jsxs as s,Fragment as h}from"react/jsx-runtime";function ke({value:w,onChange:E,models:M,modelGroups:z,compactCatalog:d,effortPresentation:G="slider",unavailableEffort:y,providerMenu:g,header:b,className:P,condensed:_,stripLabelPrefix:A,showDescription:ee,showModelList:ne=!0,loading:se,switching:U,isLoading:te,effortConfig:i,booleanOptions:O,onBooleanChange:L,selectOptions:le=[],t:c,...u}){let[de,re]=X(!1),[me,pe]=X(!1),m=O?.find((a)=>a.id==="fast_mode"),B=d?O?.filter((a)=>a!==m):O,W=(a)=>A&&a.startsWith(A)?a.slice(A.length):a;if(se)return n("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:s(e,{variant:"ghost",disabled:!0,className:p("h-7 min-w-0 shrink gap-1.5 rounded-md px-2 text-xs font-normal",P),children:[n(K,{className:"size-3 animate-spin"}),n("span",{className:"text-muted-foreground truncate",children:c("model.loadingModels")})]})});return s("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:[g&&s(k,{open:de,onOpenChange:re,children:[s(oe,{children:[n(ie,{render:n(C,{render:s(e,{"data-testid":"provider-trigger",variant:"ghost",disabled:u.disabled,className:p("h-7 shrink-0 gap-1 rounded-md px-1.5","hover:bg-accent"),children:[g.icon,n(J,{className:"size-2.5 shrink-0 opacity-60"})]})})}),n(ae,{children:c("model.switchProvider")})]}),s(x,{side:"top",align:"end",sideOffset:4,className:"z-100 min-w-[10rem]",children:[g.groups.map((a,t)=>s(he,{children:[t>0&&a.length>0&&n(l,{}),n(r,{value:g.value,onValueChange:g.onChange,options:a})]},t)),g.moreAction&&s(h,{children:[n(l,{}),s(I,{onClick:g.moreAction,className:"whitespace-nowrap",children:[n("span",{className:"min-w-0 flex-1 truncate",children:c("model.moreModels")}),n(ce,{className:"size-4"})]})]})]})]}),s(k,{open:me,onOpenChange:pe,children:[s(oe,{children:[n(ie,{render:n(C,{render:s(e,{"data-testid":"model-trigger","aria-busy":U,variant:"ghost",className:p("h-7 gap-1.5 rounded-md px-2 text-xs font-normal","hover:bg-accent","max-w-full min-w-0 shrink",_&&"h-7 gap-1 px-1.5 text-[11px]",P),...u,children:[w.icon,O?.some((a)=>a.id==="fast_mode"&&a.currentValue&&!a.disabled)&&n(Q,{"aria-hidden":"true",className:"size-3 shrink-0"}),n("span",{className:p("min-w-0 flex-1 truncate text-start",_&&"text-[11px]"),children:W(w.label)||c("model.selectModel")}),i&&s("span",{className:"text-muted-foreground grid shrink-0 justify-items-center",children:[n("span",{className:"invisible col-start-1 row-start-1",children:i.sizer??i.levels.reduce((a,t)=>t.name.length>a.length?t.name:a,"")}),n("span",{className:"col-start-1 row-start-1",children:i.levels.find((a)=>a.value===i.value)?.name??i.value})]}),U?n(K,{"data-testid":"model-switch-loading",className:"size-3 shrink-0 animate-spin"}):n(J,{className:p("size-3 shrink-0",_&&"size-2.5")})]})})}),n(ae,{children:c("model.switchModel")})]}),s(x,{side:"top",align:"end",sideOffset:4,className:p("z-100 w-auto max-w-[min(24rem,calc(100vw-1rem))] min-w-[14rem]",d&&"flex h-[350px] w-80 min-w-0 flex-col overflow-hidden rounded-xl p-1.5"),children:[d&&s(h,{children:[s(T,{"data-model-menu-header":!0,className:"flex shrink-0 items-center justify-between gap-2 px-1 py-1",children:[i?G==="slider"?n("div",{role:"menuitem","aria-label":i.name,className:"min-w-0 [&>div]:justify-start [&>div]:gap-3 [&>div]:px-2 [&>div]:py-1.5",children:n(Y,{...i,disabled:u.disabled})}):s(H,{children:[s(F,{disabled:u.disabled,className:"h-8 min-w-0 flex-1 gap-2 rounded-md",children:[n("span",{children:i.name}),n("span",{className:"text-muted-foreground min-w-0 truncate text-xs",children:i.levels.find((a)=>a.value===i.value)?.name??i.value})]}),n(D,{children:n(r,{value:i.value,onValueChange:i.onChange,options:i.levels.map((a)=>({value:a.value,label:a.name}))})})]}):y?s(I,{disabled:!0,className:"h-8 min-w-0 flex-1 gap-2",children:[n("span",{children:y.name}),n("span",{className:"text-muted-foreground truncate text-xs",children:y.label})]}):n(j,{className:"min-w-0 flex-1 truncate",children:b?.name}),m&&n(ue,{"aria-label":m.name,title:m.title??m.name,disabled:u.disabled||m.disabled,checked:m.currentValue,closeOnClick:!1,onCheckedChange:(a)=>L?.(m.id,a),className:p("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",m.currentValue&&!m.disabled?"text-foreground [&_svg]:fill-current":"text-muted-foreground"),children:m.icon??n(Q,{className:"size-4","aria-hidden":"true"})})]}),n(l,{className:"shrink-0"})]}),b&&!d&&s(h,{children:[s("div",{className:"flex items-center gap-2 px-2 py-2",children:[b.icon,n("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:b.name}),b.action]}),n(l,{})]}),s(T,{"data-model-menu-list":d?"":void 0,className:d?"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain":void 0,children:[ne&&(te?n(I,{disabled:!0,className:"text-muted-foreground",children:c("model.loadingModels")}):M.length===0?n(I,{disabled:!0,className:"text-muted-foreground",children:c("model.noModelsAvailable")}):(()=>{let a=M.filter((o)=>!o.more),t=M.filter((o)=>o.more),Z=a.length>0&&t.length>0,S=(o,v)=>({disabled:u.disabled,icon:o.icon,value:o.api_id,label:W(o.label),description:v?.noDescription?void 0:ee?o.description:void 0}),f=(o)=>{let v=M.find((V)=>V.api_id===o);if(v)E(v)};if(d)return n(r,{value:w.api_id,onValueChange:f,itemClassName:"min-w-0 max-w-full font-normal whitespace-nowrap",options:M.map((o)=>S(o))});return s(h,{children:[z?z.map((o)=>{let v=o.models.filter((N)=>!N.more),V=o.models.filter((N)=>N.more),q=v.length>0&&V.length>0;return s(T,{children:[n(j,{className:"text-muted-foreground text-xs font-normal",children:o.name}),n(r,{value:w.api_id,onValueChange:f,itemClassName:"font-medium whitespace-nowrap",options:(q?v:o.models).map((N)=>S(N))}),q&&s(H,{children:[n(F,{className:"font-medium whitespace-nowrap",children:c("model.moreModels")}),n(D,{children:n(r,{value:w.api_id,onValueChange:f,itemClassName:"font-medium whitespace-nowrap",options:V.map((N)=>S(N,{noDescription:!0}))})})]})]},o.id)}):n(r,{value:w.api_id,onValueChange:f,itemClassName:"font-medium whitespace-nowrap",options:(Z?a:M).map((o)=>S(o))}),!z&&Z&&s(H,{children:[n(F,{className:"font-medium whitespace-nowrap",children:c("model.moreModels")}),n(D,{children:n(r,{value:w.api_id,onValueChange:f,itemClassName:"font-medium whitespace-nowrap",options:t.map((o)=>S(o,{noDescription:!0}))})})]})]})})()),!d&&i&&s(h,{children:[n(l,{}),G==="menu"?s(H,{children:[s(F,{disabled:u.disabled,children:[n("span",{className:"flex-1",children:i.name}),n("span",{className:"text-muted-foreground",children:i.levels.find((a)=>a.value===i.value)?.name??i.value})]}),n(D,{children:n(r,{value:i.value,onValueChange:i.onChange,options:i.levels.map((a)=>({value:a.value,label:a.name}))})})]}):n(Y,{...i,disabled:u.disabled})]}),!d&&!i&&y&&s(h,{children:[n(l,{}),s(I,{disabled:!0,children:[n("span",{className:"flex-1",children:y.name}),n("span",{children:y.label})]})]}),le.map((a)=>s(T,{children:[n(l,{}),n(j,{children:a.name}),n(r,{value:a.value,onValueChange:a.onChange,options:a.options,itemClassName:"whitespace-nowrap"})]},a.id)),B&&B.length>0&&s(h,{children:[!i&&n(l,{}),B.map((a)=>d?s(ue,{"aria-label":a.name,title:a.title,disabled:u.disabled||a.disabled,checked:a.currentValue,closeOnClick:!1,onCheckedChange:(t)=>L?.(a.id,t),className:"justify-between gap-3 py-2.5 pr-2 [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",children:[s("span",{className:"flex items-center gap-2",children:[a.icon,a.name]}),n("span",{"aria-hidden":"true",className:p("flex h-[18px] w-8 shrink-0 items-center rounded-full p-0.5",a.currentValue?"bg-primary":"bg-input"),children:n("span",{className:p("bg-background size-3.5 rounded-full shadow-xs transition-transform",a.currentValue&&"translate-x-3.5")})})]},a.id):s("div",{title:a.title,className:p("flex items-center justify-between gap-3 px-2 py-2.5",a.disabled&&"opacity-50"),children:[s("span",{className:"flex items-center gap-2 text-sm font-medium",children:[a.icon,a.name]}),n(R,{"aria-label":a.name,disabled:u.disabled||a.disabled,checked:a.currentValue,onCheckedChange:(t)=>L?.(a.id,t)})]},a.id))]})]}),d&&b?.action&&s(h,{children:[n(l,{className:"shrink-0"}),n(T,{"data-model-menu-footer":!0,className:"shrink-0",children:b.action})]})]})]})]})}export{ke as ModelSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"../chunk-
|
|
1
|
+
import{e}from"../chunk-801v0awm.js";import{k,C,x}from"../chunk-2epnn4sq.js";import{r}from"../chunk-42zr8zpv.js";import{useState as f}from"react";import{jsx as o,jsxs as t}from"react/jsx-runtime";function v({value:p,currentName:n,icon:s,options:i,label:d,header:a,onValueChange:l,showLabel:u=!1,disabled:m=!1}){let[c,g]=f(!1);return t(k,{open:c,onOpenChange:g,children:[o(C,{render:t(e,{disabled:m,variant:"ghost","aria-label":`${d}: ${n}`,title:n,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:n})]})}),t(x,{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:[a&&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:a})}),o(r,{value:p,onValueChange:l,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:i})]})]})}export{v as PermissionModeSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-h0dq9ztv.js";import{e}from"../chunk-801v0awm.js";import"../chunk-6p5hgnpq.js";import{Je}from"../chunk-dm31xvh3.js";import{je,Qe,Xe}from"../chunk-dgp9q950.js";import{y}from"../chunk-t3vgbc9s.js";import{cn as f}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(Xe,{align:"start",...n})}function X({data:n,t:r,className:u,...c}){let p=y(),[d,h]=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,g=(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 g(P+l);return g(P-l)})};return window.addEventListener("keydown",x,{passive:!1}),()=>window.removeEventListener("keydown",x)},[d]),o(R,{children:[o(je,{children:[t(Qe,{render:o("div",{className:f("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),h(!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:f("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(Je,{containerRef:C,filename:s||r("input.image"),onOpenChange:h,onScaleChange:v,open:d,scale:I,url:n.url})]})}function _({children:n,className:r,...u}){let c=y();if(!c.files.length)return null;return t("div",{className:f("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{cn,Le,Ae,un,rn,q}from"../chunk-m2myfd89.js";export{Ae as clipboardHasStringItem,rn as countControlCharsBeforeIndex,cn as normalizePastedImageFile,q as sanitizeTextareaTargetValue,un as sanitizeTextareaValue,Le as scanClipboardForImageFiles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Z,Pn,J,Nn,S,_e,E,Mn,Sn,ee,y}from"../chunk-t3vgbc9s.js";export{ee as LocalAttachmentsContext,Sn as PromptInputProvider,J as PromptInputSubmissionContext,Z as PromptInputSubmitContext,S as ProviderAttachmentsContext,E as useOptionalPromptInputController,y as usePromptInputAttachments,_e as usePromptInputController,Nn as usePromptInputSubmission,Pn as usePromptInputSubmit,Mn as useProviderAttachments};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"../chunk-
|
|
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-c4621n0b.js";import{ce}from"../chunk-16y5rmm5.js";import{Le,Ae,q}from"../chunk-m2myfd89.js";import{E,y}from"../chunk-t3vgbc9s.js";import{cn as A}from"cn";import{forwardRef as D,useCallback as M,useEffect as K,useImperativeHandle as L,useRef as f}from"react";import{jsx as z}from"react/jsx-runtime";var R=(i)=>!i.shiftKey,F=()=>!1,N=D(({onChange:i,onCompositionStart:g,onCompositionEnd:v,className:x,placeholder:T,bashMode:b=!1,isSendShortcut:I=R,isNewlineShortcut:C=F,...H},P)=>{let n=E(),l=y(),o=f(!1),u=f(!1),r=f(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=b&&(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,d=`${p.slice(0,a)}
|
|
3
|
+
${p.slice(m)}`;if(n)n.textInput.setInput(d);else t.value=d;let h=a+1;t.setSelectionRange(h,h),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}=Le(t),p=Ae(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:q(e.currentTarget);n.textInput.setInput(c?`!${t}`:t),s(),i?.(e)}}:{onChange:(e)=>{if(!o.current)q(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(ce,{"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",x),name:"message",onCompositionEnd:(e)=>{o.current=!1;let t=q(e.currentTarget);n?.textInput.setInput(c?`!${t}`:t),s(),v?.(e),u.current=!0,requestAnimationFrame(()=>{u.current=!1})},onCompositionStart:(e)=>{u.current=!1,o.current=!0,g?.(e)},onKeyDown:S,onPaste:k,placeholder:T,...H,...w})});N.displayName="PromptInputTextarea";export{N as PromptInputTextarea};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{at,me}from"../chunk-v72t4sf9.js";import"../chunk-9ab18v07.js";import{Ze}from"../chunk-ea7zsd2s.js";import"../chunk-801v0awm.js";import"../chunk-c4621n0b.js";import"../chunk-16y5rmm5.js";import{$e,le,de}from"../chunk-8e7xf2tb.js";import{Z,J,S,E,ee}from"../chunk-t3vgbc9s.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 re,useCallback as h,useEffect as F,useMemo as Te,useRef as M,useState as Fe}from"react";import{flushSync as Me}from"react-dom";import{jsx as a,jsxs as Ee}from"react/jsx-runtime";function ne(u){let o=new FormData(u).get("message");return typeof o==="string"?o:""}var De=({className:u,bashMode:o=!1,attachmentPolicy:I,onCommand:d,onSubmitError:y,canSubmit:f,onSubmitAsync:g,accept:C,multiple:oe,globalDrop:A,syncHiddenInput:B,maxFiles:k,maxFileSize:D,onError:b,onSubmit:se,children:ie,...ae})=>{let s=E(),l=!!s,ue=o&&l&&s.textInput.value.startsWith("!"),x=M(null),w=M(null),N=M(!1),[pe,R]=Fe([]),c=l?s.attachments.files:pe,O=M(c);O.current=c;let ce=h(()=>{x.current?.click()},[]),W=h((e)=>{if(!C||C.trim()==="")return!0;return C.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})},[C]),G=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)=>W(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 Y=[];for(let T of H){let te=I?.sourcePath(T);Y.push({id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(T),mediaType:G(T),filename:T.name,size:T.size,lastModified:T.lastModified,...te===void 0?{}:{sourcePath:te}})}return[...i,...Y]})},[I,G,W,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[]}),[]),j=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(at(m,n)){b?.({code:"max_total_size",message:`Total image size must not exceed ${me}MB.`});return}}j(r)},[c,j,b]),q=l?s.attachments.remove:ge,U=l?s.attachments.clear:be,X=l?s.attachments.openFileDialog:ce;F(()=>{if(!l)return;s.__registerFileInput(x,()=>x.current?.click())},[l,s]),F(()=>{if(B&&x.current&&c.length===0)x.current.value=""},[c,B]),F(()=>{let e=w.current;if(!e)return;if(A)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,A]),F(()=>{if(!A)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,A]),F(()=>()=>{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=""},K=Te(()=>({files:c.map((e)=>({...e,id:e.id})),add:L,remove:q,clear:U,openFileDialog:X,fileInputRef:x}),[c,L,q,U,X]),_=M({controller:s,files:c,canSubmit:f});_.current={controller:s,files:c,canSubmit:f};let z=M(!0);F(()=>(z.current=!0,()=>{z.current=!1}),[]);let Q=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=w.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let n=l?s.textInput.value:ne(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(ne(t)===n)t.reset();U()};N.current=!0;try{if(d?.(n.trim()))return v(),{status:"accepted"};let p=await Ze(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 se({text:n,files:p.files},e);return v(),{status:"accepted"}}finally{N.current=!1}},he=(e)=>{e.preventDefault(),Q(e).catch(y)},Pe=h((e)=>{if(!e.trim())return;if(l&&s)Me(()=>{s.textInput.setInput(e)});w.current?.requestSubmit()},[s,l]),V=a(J.Provider,{value:()=>Q(null),children:Ee(Z.Provider,{value:Pe,children:[a("input",{accept:C,"aria-label":"Upload files",className:"hidden",multiple:oe,onChange:ve,ref:x,title:"Upload files",type:"file"}),a("form",{className:P("w-full",u),onSubmit:he,ref:w,"data-tour":"chat-input",...ae,children:a($e,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",ue&&"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:ie})})]})});return l?a(S.Provider,{value:K,children:V}):a(ee.Provider,{value:K,children:V})};function Ne({className:u,...o}){return a("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",u),...o})}function Re({className:u,...o}){return a(le,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",u),...o})}function Ue({className:u,...o}){return a(le,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",u),...o})}function Be({className:u,...o}){return a("div",{className:P("flex items-center gap-1",u),...o})}var Oe=({variant:u="ghost",className:o,size:I,collapsed:d=!1,...y})=>{let f=d||re.count(y.children)<=1?"icon-xs":"xs";return a(de,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(d||re.count(y.children)<=1)&&"size-7",o),size:f,type:"button",variant:u,...y})},We=({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(de,{"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{me as MAX_TOTAL_IMAGE_MB,De as PromptInput,Ne as PromptInputBody,Oe as PromptInputButton,Ue as PromptInputFooter,Re as PromptInputHeader,We as PromptInputSubmit,Be as PromptInputTools};
|
package/dist/image-lightbox.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ct}from"./chunk-q7e2bdav.js";export{Ct as ImageLightbox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Je}from"./chunk-dm31xvh3.js";import"./chunk-6p5hgnpq.js";import"./chunk-h0dq9ztv.js";import"./chunk-801v0awm.js";export{Je as ImagePreviewDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ut}from"../chunk-d675nr2b.js";export{Ut as createCodeHighlighter};
|
package/dist/lib/fuzzy.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{pe,lt}from"../chunk-h6df4xfd.js";export{lt as fuzzyFilter,pe as fuzzyMatch};
|
package/dist/lib/group-blocks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ht}from"../chunk-t5nstx0k.js";import"../chunk-d8gwsw6j.js";export{ht as groupBlocksForStyle};
|
package/dist/lib/image-encode.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{dt}from"../chunk-9ab18v07.js";export{dt as convertBlobUrlToDataUrl};
|
package/dist/lib/limits.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Vn,qn,at,Kn,me}from"../chunk-v72t4sf9.js";export{Vn as BYTES_PER_MB,qn as MAX_TOTAL_IMAGE_BYTES,me as MAX_TOTAL_IMAGE_MB,at as exceedsImageLimit,Kn as formatImageSizeMb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ce,qt}from"../chunk-ypvjzkfb.js";export{Ce as cachedMarkdown,qt as createMarkdownParser};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Vt,ke}from"../chunk-bkbemt8g.js";export{Vt as createChatMarkdown,ke as isSafeMarkdownUrl};
|
package/dist/lib/model-name.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{be}from"../chunk-7kcdf82d.js";export{be as formatModelName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{st}from"../chunk-h0dq9ztv.js";export{st as getPointerCenteredScrollPosition};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ze}from"../chunk-ea7zsd2s.js";import"../chunk-9ab18v07.js";export{Ze as preparePromptFiles};
|
package/dist/lib/stream-style.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jn,Mt,bn,m,Qn}from"../chunk-d8gwsw6j.js";export{jn as STREAM_STYLES,bn as TOOL_CATEGORIES,m as describeToolUse,Mt as isCodexLook,Qn as toolDotClass};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Vt}from"../chunk-bkbemt8g.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=Vt()){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};
|