@alwith/module-chat 0.1.32 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/approval/choice-elicitation-form.js +1 -1
  2. package/dist/approval/choice-schema.js +1 -1
  3. package/dist/approval/permission-options.js +1 -1
  4. package/dist/approval/permission-view.js +1 -1
  5. package/dist/approval/schema-elicitation-form.js +1 -1
  6. package/dist/approval/url-elicitation-card.js +1 -1
  7. package/dist/{chunk-ta690ra0.js → chunk-0e1pdbec.js} +2 -2
  8. package/dist/{chunk-tbr607hk.js → chunk-1cy1j8gj.js} +2 -2
  9. package/dist/{chunk-wmsdg5fb.js → chunk-1hy64ewz.js} +1 -1
  10. package/dist/{chunk-dj84q7tx.js → chunk-1twg3evk.js} +1 -1
  11. package/dist/{chunk-ya0gvswb.js → chunk-1yy2jsnh.js} +1 -1
  12. package/dist/{chunk-kew8ef6z.js → chunk-25na55ve.js} +2 -2
  13. package/dist/chunk-2q9rzxbj.js +2 -0
  14. package/dist/{chunk-y1cbwywe.js → chunk-341yykkp.js} +1 -1
  15. package/dist/{chunk-32fcg6q4.js → chunk-3496tgga.js} +2 -2
  16. package/dist/chunk-36h9z1mt.js +1 -0
  17. package/dist/chunk-3eg720sa.js +2 -0
  18. package/dist/{chunk-98t2nc02.js → chunk-4gayxp21.js} +2 -2
  19. package/dist/{chunk-8gv9naya.js → chunk-66headm4.js} +1 -1
  20. package/dist/chunk-7tj0a2na.js +2 -0
  21. package/dist/chunk-8z8va1ws.js +2 -0
  22. package/dist/{chunk-6h5760d3.js → chunk-90rwhxdf.js} +2 -2
  23. package/dist/{chunk-8dtcrk6t.js → chunk-91nk8n6w.js} +2 -2
  24. package/dist/chunk-arge74eh.js +2 -0
  25. package/dist/{chunk-h96s3j1e.js → chunk-bf5fh35b.js} +2 -2
  26. package/dist/chunk-c4cqqqqh.js +2 -0
  27. package/dist/{chunk-2r04c28x.js → chunk-cp20nzhv.js} +2 -2
  28. package/dist/{chunk-71kpqt2g.js → chunk-e9zndx26.js} +2 -2
  29. package/dist/{chunk-hfhzy9c2.js → chunk-evcrrxfp.js} +1 -1
  30. package/dist/{chunk-6m16qe9q.js → chunk-ftka421d.js} +2 -2
  31. package/dist/chunk-g20b01rn.js +2 -0
  32. package/dist/chunk-gfj69sqc.js +2 -0
  33. package/dist/chunk-hnt4tt1n.js +2 -0
  34. package/dist/{chunk-aaybyhdj.js → chunk-k1pd257q.js} +2 -2
  35. package/dist/{chunk-ryf0p4v8.js → chunk-k7s0drzk.js} +2 -2
  36. package/dist/{chunk-47f4a577.js → chunk-kaeqvcew.js} +1 -1
  37. package/dist/{chunk-rq0cpnvn.js → chunk-kget6qfz.js} +1 -1
  38. package/dist/{chunk-664xazrz.js → chunk-m5pbe513.js} +1 -1
  39. package/dist/chunk-mbrd76nh.js +2 -0
  40. package/dist/chunk-p9wpghey.js +2 -0
  41. package/dist/chunk-pc1yzf1x.js +1 -0
  42. package/dist/{chunk-e12qaex5.js → chunk-ph7bk34y.js} +2 -2
  43. package/dist/{chunk-wf194rae.js → chunk-qj8r5xvx.js} +2 -2
  44. package/dist/chunk-reqrpvyy.js +2 -0
  45. package/dist/chunk-rgy601b7.js +2 -0
  46. package/dist/chunk-svmc952q.js +7 -0
  47. package/dist/{chunk-h7y6vmb3.js → chunk-tzdd96d0.js} +2 -2
  48. package/dist/{chunk-vk39871j.js → chunk-wjejhpgw.js} +1 -1
  49. package/dist/{chunk-a5b2tm60.js → chunk-y2xbq7rb.js} +3 -3
  50. package/dist/{chunk-p4c1w6qx.js → chunk-yvj5y06y.js} +2 -2
  51. package/dist/{chunk-sxjgyvnx.js → chunk-yw4e2tcz.js} +1 -1
  52. package/dist/codex/activity-group.d.ts +2 -1
  53. package/dist/codex/activity-group.js +1 -1
  54. package/dist/codex/assistant-message.js +2 -2
  55. package/dist/codex/async-question-card.js +1 -1
  56. package/dist/codex/disclosure-state.d.ts +1 -1
  57. package/dist/codex/disclosure-state.js +1 -1
  58. package/dist/codex/edited-files-card.js +1 -1
  59. package/dist/codex/image-view-activity.js +1 -1
  60. package/dist/codex/markdown-renderer.js +5 -5
  61. package/dist/codex/navigation-audio.js +1 -1
  62. package/dist/codex/navigation-preview.js +1 -1
  63. package/dist/codex/navigation-rail.css +68 -68
  64. package/dist/codex/navigation-rail.d.ts +6 -6
  65. package/dist/codex/navigation-rail.js +1 -1
  66. package/dist/codex/plan.js +1 -1
  67. package/dist/codex/timeline-virtualizer.js +1 -0
  68. package/dist/codex/user-message.js +1 -1
  69. package/dist/codex/virtualized-turn-list.js +1 -1
  70. package/dist/composer/completion-filter.js +1 -1
  71. package/dist/composer/completion-menu.js +2 -2
  72. package/dist/composer/completion-trigger.js +1 -1
  73. package/dist/composer/effort-slider.js +1 -1
  74. package/dist/composer/menu-radio.js +1 -1
  75. package/dist/composer/model-select.js +1 -1
  76. package/dist/composer/permission-mode-select.js +1 -1
  77. package/dist/composer/prompt-input-attachments.js +1 -1
  78. package/dist/composer/prompt-input-clipboard.js +1 -1
  79. package/dist/composer/prompt-input-context.js +1 -1
  80. package/dist/composer/prompt-input-textarea.js +3 -3
  81. package/dist/composer/prompt-input.js +1 -1
  82. package/dist/image-lightbox.js +1 -1
  83. package/dist/image-preview-dialog.js +1 -1
  84. package/dist/lib/code-highlighter.js +1 -1
  85. package/dist/lib/fuzzy.js +1 -1
  86. package/dist/lib/group-blocks.js +1 -1
  87. package/dist/lib/image-encode.js +1 -1
  88. package/dist/lib/limits.js +1 -1
  89. package/dist/lib/markdown-parser.js +1 -1
  90. package/dist/lib/markdown-rules.js +1 -1
  91. package/dist/lib/model-name.js +1 -1
  92. package/dist/lib/pointer-centered-zoom.js +1 -1
  93. package/dist/lib/prepare-prompt-files.js +1 -1
  94. package/dist/lib/stream-style.js +1 -1
  95. package/dist/lib/streaming-markdown.js +1 -1
  96. package/dist/locales.d.ts +6 -0
  97. package/dist/locales.js +1 -1
  98. package/dist/search/chat-search.js +1 -1
  99. package/dist/search/dom-matches.js +1 -1
  100. package/dist/search/find-bar.js +1 -1
  101. package/dist/search/literal-matches.js +1 -1
  102. package/dist/ui/badge.js +1 -1
  103. package/dist/ui/button.js +1 -1
  104. package/dist/ui/card.js +1 -1
  105. package/dist/ui/dialog.js +1 -1
  106. package/dist/ui/dropdown-menu.js +1 -1
  107. package/dist/ui/field.js +1 -1
  108. package/dist/ui/hover-card.js +1 -1
  109. package/dist/ui/input-group-textarea.js +1 -1
  110. package/dist/ui/input-group.js +1 -1
  111. package/dist/ui/input.js +1 -1
  112. package/dist/ui/separator.js +1 -1
  113. package/dist/ui/switch.js +1 -1
  114. package/dist/ui/tooltip.js +1 -1
  115. package/package.json +8 -13
  116. package/dist/chunk-11n6ah6p.js +0 -2
  117. package/dist/chunk-15a7wypc.js +0 -2
  118. package/dist/chunk-67ws5eed.js +0 -1
  119. package/dist/chunk-8k4z0gfx.js +0 -2
  120. package/dist/chunk-cwp8ct1z.js +0 -2
  121. package/dist/chunk-dvfka70p.js +0 -2
  122. package/dist/chunk-eyn3tdcs.js +0 -2
  123. package/dist/chunk-jrnjwjft.js +0 -7
  124. package/dist/chunk-naw83wcw.js +0 -2
  125. package/dist/chunk-nx3k6k2p.js +0 -2
  126. package/dist/chunk-p6kymvjw.js +0 -2
  127. package/dist/chunk-pve9b7z3.js +0 -2
  128. package/dist/chunk-s72dbmv3.js +0 -1
  129. package/dist/chunk-tm40sncc.js +0 -2
  130. package/dist/chunk-wbpw278r.js +0 -2
  131. package/dist/chunk-z3gwnjmk.js +0 -2
  132. package/dist/codex/thread-virtualizer.js +0 -1
  133. package/dist/lib/update-scheduler.d.ts +0 -10
  134. package/dist/lib/update-scheduler.js +0 -1
  135. /package/dist/codex/{thread-virtualizer.d.ts → timeline-virtualizer.d.ts} +0 -0
@@ -1 +1 @@
1
- import{ze}from"../chunk-y1cbwywe.js";import{e}from"../chunk-vk39871j.js";import{v}from"../chunk-r5d37dc0.js";import{d}from"../chunk-wmsdg5fb.js";import{r}from"../chunk-bwzjm3g8.js";import{c,a}from"../chunk-zt7a6b1m.js";import{o}from"../chunk-d0ptk8x8.js";import{le,O,p,_}from"../chunk-dvfka70p.js";import{autoUpdate as X}from"@floating-ui/dom";import{cn as D}from"cn";import{useCallback as I,useEffect as j,useLayoutEffect as G,useMemo as V,useRef as J,useState as L}from"react";import{createPortal as Y}from"react-dom";import{jsx as i,jsxs as h}from"react/jsx-runtime";var g="__other__";function ue({current:m,total:q,anchorRef:T,t:w,onAccept:B,onDecline:H}){let k=V(()=>m?le(m.requestedSchema):[],[m]),[C,y]=L({}),Q=J(null);j(()=>{if(m?.elicitationId===void 0)return;let t={};for(let{key:u,property:n}of k)if(!p(n)){let x=_(n)[0];if(x)t[u]={selected:x.value}}y(t)},[m?.elicitationId,k]),j(()=>{if(m?.elicitationId!==void 0&&Q.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")Q.current.focus()},[m?.elicitationId]);let[U,M]=L(null),[R,W]=L(null),P=I(()=>{let t=T.current;if(!t)return;let u=t.getBoundingClientRect();if(u.width===0){let n=Math.min(640,window.innerWidth*0.9);M({left:(window.innerWidth-n)/2,width:n,bottom:24});return}M({left:u.left,width:u.width,bottom:window.innerHeight-u.bottom+20})},[T]);G(()=>{if(!m)return;let t=0,u=()=>{if(T.current){P();return}t=requestAnimationFrame(u)};return u(),()=>cancelAnimationFrame(t)},[m,P,T]),G(()=>{let t=T.current;if(!m||!t||!R)return;return X(t,R,P,{animationFrame:!0})},[m,R,T,P]);let F=V(()=>{if(!m)return!1;for(let{key:t,property:u}of k){let n=C[t];if(!n)return!1;if(p(u)){if(!n.selectedSet||n.selectedSet.size===0)return!1;if(n.selectedSet.has(g)&&!n.otherText?.trim())return!1}else{if(!n.selected)return!1;if(n.selected===g&&!n.otherText?.trim())return!1}}return!0},[m,k,C]),K=I(async()=>{if(!m)return;if(!F)return;let t={},u={};for(let{key:n,property:x}of k){let f=C[n];if(!f)continue;let N;if(p(x))t[n]=[...f.selectedSet??[]].map((b)=>b===g?(f.otherText??"").trim():b).filter(Boolean);else{let b=f.selected??"";if(t[n]=b===g?(f.otherText??"").trim():b,b!==g)N=_(x).find((s)=>s.value===b)?.preview}let S=f.notes?.trim();if(N||S)u[n]={...N&&{preview:N},...S&&{notes:S}}}await B(m.elicitationId,t,u)},[m,k,C,F,B]),z=I(async()=>{if(m)await H(m.elicitationId)},[m,H]);if(!m||!U)return null;return Y(h("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(t)=>{if(t.key==="Escape")t.preventDefault(),z()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left:U.left,width:U.width,bottom:U.bottom,maxHeight:"70vh"},ref:(t)=>{Q.current=t,W(t)},children:[h("div",{className:"border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",children:[i("div",{className:"text-foreground text-sm font-medium",children:w("askUserQuestion.title")}),q>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${q}`})]}),i("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i("div",{className:"space-y-4 px-3 py-3",children:k.map(({key:t,property:u},n)=>{let x=C[t],f=x?.selected,N=x?.selectedSet??new Set,S=_(u),b=p(u);return h("div",{className:"space-y-2",children:[h("div",{className:"flex items-center gap-2",children:[i(ze,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:O(u).title??t}),i("div",{className:"text-foreground text-sm font-medium",children:O(u).description})]}),b?h("div",{className:"space-y-1.5 ps-1",children:[S.map((s)=>h("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[i(v,{checked:N.has(s.value),onCheckedChange:(l)=>{y((E)=>{let A=new Set(E[t]?.selectedSet??new Set);if(l)A.add(s.value);else A.delete(s.value);return{...E,[t]:{...E[t],selectedSet:A}}})}}),h("div",{className:"min-w-0 flex-1",children:[i("div",{className:"text-foreground text-sm",children:s.label}),s.description&&i("div",{className:"text-muted-foreground text-xs",children:s.description})]})]},s.value)),h("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[i(v,{checked:N.has(g),onCheckedChange:(s)=>{y((l)=>{let E=new Set(l[t]?.selectedSet??new Set);if(s)E.add(g);else E.delete(g);return{...l,[t]:{...l[t],selectedSet:E}}})}}),i("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:w("askUserQuestion.other")})]}),N.has(g)&&i("div",{className:"ps-7",children:i(d,{placeholder:w("askUserQuestion.otherPlaceholder"),value:x?.otherText??"",onChange:(s)=>y((l)=>({...l,[t]:{...l[t],otherText:s.target.value}}))})})]}):h(c,{value:f??"",onValueChange:(s)=>y((l)=>({...l,[t]:{...l[t],selected:s}})),className:"space-y-1.5 ps-1",children:[S.map((s)=>{let l=`${n}:${s.value}`;return h("div",{className:D("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",f===s.value&&"bg-muted/60"),children:[i(a,{value:s.value,id:l}),h(r,{htmlFor:l,className:"min-w-0 flex-1 cursor-pointer",children:[i("div",{className:"text-foreground text-sm font-normal",children:s.label}),s.description&&i("div",{className:"text-muted-foreground text-xs font-normal",children:s.description})]})]},s.value)}),h("div",{className:D("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",f===g&&"bg-muted/60"),children:[i(a,{value:g,id:`${n}:other`,className:"mt-0.5"}),i(r,{htmlFor:`${n}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:w("askUserQuestion.other")})]}),f===g&&i("div",{className:"ps-7",children:i(d,{placeholder:w("askUserQuestion.otherPlaceholder"),value:x?.otherText??"",onChange:(s)=>y((l)=>({...l,[t]:{...l[t],otherText:s.target.value}}))})})]}),!b&&f&&f!==g&&(()=>{let s=S.find((l)=>l.value===f)?.preview;if(!s)return null;return i("pre",{className:"bg-muted/50 text-muted-foreground ms-1 mt-1 overflow-auto rounded-sm px-2 py-1.5 font-mono text-[11px] whitespace-pre-wrap",children:s})})(),S.some((s)=>s.preview)&&i(o,{placeholder:w("askUserQuestion.notesPlaceholder"),value:x?.notes??"",onChange:(s)=>y((l)=>({...l,[t]:{...l[t],notes:s.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"})]},t)})})}),h("div",{className:"border-border bg-card flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2",children:[i(e,{variant:"ghost",size:"sm",onClick:()=>void z(),children:w("askUserQuestion.cancel")}),i(e,{size:"sm",disabled:!F,onClick:()=>void K(),children:w("askUserQuestion.submit")})]})]}),document.body)}export{ue as ChoiceElicitationForm};
1
+ import{Ae}from"../chunk-341yykkp.js";import{e}from"../chunk-wjejhpgw.js";import{v}from"../chunk-r5d37dc0.js";import{l}from"../chunk-1hy64ewz.js";import{r}from"../chunk-bwzjm3g8.js";import{c,a}from"../chunk-zt7a6b1m.js";import{o}from"../chunk-d0ptk8x8.js";import{ke,q,h,A}from"../chunk-c4cqqqqh.js";import{autoUpdate as X}from"@floating-ui/dom";import{cn as D}from"cn";import{useCallback as L,useEffect as j,useLayoutEffect as G,useMemo as V,useRef as J,useState as B}from"react";import{createPortal as Y}from"react-dom";import{jsx as i,jsxs as g}from"react/jsx-runtime";var p="__other__";function me({current:m,total:H,anchorRef:T,t:w,onAccept:M,onDecline:O}){let k=V(()=>m?ke(m.requestedSchema):[],[m]),[C,y]=B({}),Q=J(null);j(()=>{if(m?.elicitationId===void 0)return;let t={};for(let{key:u,property:n}of k)if(!h(n)){let x=A(n)[0];if(x)t[u]={selected:x.value}}y(t)},[m?.elicitationId,k]),j(()=>{if(m?.elicitationId!==void 0&&Q.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")Q.current.focus()},[m?.elicitationId]);let[U,_]=B(null),[R,W]=B(null),P=L(()=>{let t=T.current;if(!t)return;let u=t.getBoundingClientRect();if(u.width===0){let n=Math.min(640,window.innerWidth*0.9);_({left:(window.innerWidth-n)/2,width:n,bottom:24});return}_({left:u.left,width:u.width,bottom:window.innerHeight-u.bottom+20})},[T]);G(()=>{if(!m)return;let t=0,u=()=>{if(T.current){P();return}t=requestAnimationFrame(u)};return u(),()=>cancelAnimationFrame(t)},[m,P,T]),G(()=>{let t=T.current;if(!m||!t||!R)return;return X(t,R,P,{animationFrame:!0})},[m,R,T,P]);let F=V(()=>{if(!m)return!1;for(let{key:t,property:u}of k){let n=C[t];if(!n)return!1;if(h(u)){if(!n.selectedSet||n.selectedSet.size===0)return!1;if(n.selectedSet.has(p)&&!n.otherText?.trim())return!1}else{if(!n.selected)return!1;if(n.selected===p&&!n.otherText?.trim())return!1}}return!0},[m,k,C]),K=L(async()=>{if(!m)return;if(!F)return;let t={},u={};for(let{key:n,property:x}of k){let f=C[n];if(!f)continue;let N;if(h(x))t[n]=[...f.selectedSet??[]].map((b)=>b===p?(f.otherText??"").trim():b).filter(Boolean);else{let b=f.selected??"";if(t[n]=b===p?(f.otherText??"").trim():b,b!==p)N=A(x).find((s)=>s.value===b)?.preview}let S=f.notes?.trim();if(N||S)u[n]={...N&&{preview:N},...S&&{notes:S}}}await M(m.elicitationId,t,u)},[m,k,C,F,M]),z=L(async()=>{if(m)await O(m.elicitationId)},[m,O]);if(!m||!U)return null;return Y(g("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(t)=>{if(t.key==="Escape")t.preventDefault(),z()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left:U.left,width:U.width,bottom:U.bottom,maxHeight:"70vh"},ref:(t)=>{Q.current=t,W(t)},children:[g("div",{className:"border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",children:[i("div",{className:"text-foreground text-sm font-medium",children:w("askUserQuestion.title")}),H>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${H}`})]}),i("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i("div",{className:"space-y-4 px-3 py-3",children:k.map(({key:t,property:u},n)=>{let x=C[t],f=x?.selected,N=x?.selectedSet??new Set,S=A(u),b=h(u);return g("div",{className:"space-y-2",children:[g("div",{className:"flex items-center gap-2",children:[i(Ae,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:q(u).title??t}),i("div",{className:"text-foreground text-sm font-medium",children:q(u).description})]}),b?g("div",{className:"space-y-1.5 ps-1",children:[S.map((s)=>g("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[i(v,{checked:N.has(s.value),onCheckedChange:(d)=>{y((E)=>{let I=new Set(E[t]?.selectedSet??new Set);if(d)I.add(s.value);else I.delete(s.value);return{...E,[t]:{...E[t],selectedSet:I}}})}}),g("div",{className:"min-w-0 flex-1",children:[i("div",{className:"text-foreground text-sm",children:s.label}),s.description&&i("div",{className:"text-muted-foreground text-xs",children:s.description})]})]},s.value)),g("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[i(v,{checked:N.has(p),onCheckedChange:(s)=>{y((d)=>{let E=new Set(d[t]?.selectedSet??new Set);if(s)E.add(p);else E.delete(p);return{...d,[t]:{...d[t],selectedSet:E}}})}}),i("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:w("askUserQuestion.other")})]}),N.has(p)&&i("div",{className:"ps-7",children:i(l,{placeholder:w("askUserQuestion.otherPlaceholder"),value:x?.otherText??"",onChange:(s)=>y((d)=>({...d,[t]:{...d[t],otherText:s.target.value}}))})})]}):g(c,{value:f??"",onValueChange:(s)=>y((d)=>({...d,[t]:{...d[t],selected:s}})),className:"space-y-1.5 ps-1",children:[S.map((s)=>{let d=`${n}:${s.value}`;return g("div",{className:D("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",f===s.value&&"bg-muted/60"),children:[i(a,{value:s.value,id:d}),g(r,{htmlFor:d,className:"min-w-0 flex-1 cursor-pointer",children:[i("div",{className:"text-foreground text-sm font-normal",children:s.label}),s.description&&i("div",{className:"text-muted-foreground text-xs font-normal",children:s.description})]})]},s.value)}),g("div",{className:D("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",f===p&&"bg-muted/60"),children:[i(a,{value:p,id:`${n}:other`,className:"mt-0.5"}),i(r,{htmlFor:`${n}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:w("askUserQuestion.other")})]}),f===p&&i("div",{className:"ps-7",children:i(l,{placeholder:w("askUserQuestion.otherPlaceholder"),value:x?.otherText??"",onChange:(s)=>y((d)=>({...d,[t]:{...d[t],otherText:s.target.value}}))})})]}),!b&&f&&f!==p&&(()=>{let s=S.find((d)=>d.value===f)?.preview;if(!s)return null;return i("pre",{className:"bg-muted/50 text-muted-foreground ms-1 mt-1 overflow-auto rounded-sm px-2 py-1.5 font-mono text-[11px] whitespace-pre-wrap",children:s})})(),S.some((s)=>s.preview)&&i(o,{placeholder:w("askUserQuestion.notesPlaceholder"),value:x?.notes??"",onChange:(s)=>y((d)=>({...d,[t]:{...d[t],notes:s.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"})]},t)})})}),g("div",{className:"border-border bg-card flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2",children:[i(e,{variant:"ghost",size:"sm",onClick:()=>void z(),children:w("askUserQuestion.cancel")}),i(e,{size:"sm",disabled:!F,onClick:()=>void K(),children:w("askUserQuestion.submit")})]})]}),document.body)}export{me as ChoiceElicitationForm};
@@ -1 +1 @@
1
- import{le,O,p,_}from"../chunk-dvfka70p.js";export{le as elicitationFields,O as elicitationLabels,_ as elicitationOptions,p as isMultiSelect};
1
+ import{ke,q,h,A}from"../chunk-c4cqqqqh.js";export{ke as elicitationFields,q as elicitationLabels,A as elicitationOptions,h as isMultiSelect};
@@ -1 +1 @@
1
- import{nt,de,pt,gt}from"../chunk-p6kymvjw.js";export{nt as PERMISSION_KIND_GROUP_ORDER,pt as isAllowKind,gt as isAlwaysKind,de as sortPermissionOptions};
1
+ import{rt,Ce,wt,kt}from"../chunk-8z8va1ws.js";export{rt as PERMISSION_KIND_GROUP_ORDER,wt as isAllowKind,kt as isAlwaysKind,Ce as sortPermissionOptions};
@@ -1 +1 @@
1
- import{de}from"../chunk-p6kymvjw.js";import{autoUpdate as L}from"@floating-ui/dom";import{cn as I}from"cn";import{CheckCheckIcon as M,CheckIcon as h,ShieldXIcon as V,XIcon as F}from"lucide-react";import{useCallback as H,useEffect as N,useId as T,useLayoutEffect as _,useRef as S,useState as f}from"react";import{createPortal as z}from"react-dom";import{jsx as i,jsxs as u}from"react/jsx-runtime";var U={allow_once:{icon:h},allow_always:{icon:M},reject_once:{icon:F},reject_always:{icon:V}};function Y({requestId:p,options:D,title:E,children:P,total:w=1,alwaysLabel:j="always",autoFocus:y="always",anchorRef:n,onRespond:r}){let b=T(),[a,g]=f(0),[s,v]=f(null),[l,A]=f(null),x=S(null),c=de(D);N(()=>{g(0)},[p]),N(()=>{let e=document.activeElement;if(y==="always"||e===null||e===document.body)x.current?.focus()},[p,l,y]);let d=H(()=>{let e=n?.current;if(!e)return;let t=e.getBoundingClientRect();if(t.width===0){let o=Math.min(640,window.innerWidth*0.9);v({left:(window.innerWidth-o)/2,width:o,bottom:24});return}v({left:t.left,width:t.width,bottom:window.innerHeight-t.bottom+20})},[n]);if(_(()=>{if(!n)return;let e=0,t=()=>{if(n.current)d();else e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)},[p,n,d]),_(()=>{let e=n?.current;if(!e||!l)return;return L(e,l,d,{animationFrame:!0})},[n,l,d]),n&&!s)return null;let k=u("div",{ref:A,"data-overlay":"permission-request",className:I("bg-card border-border overflow-hidden rounded-lg border",n&&"fixed z-50"),style:n&&s?{left:s.left,width:s.width,bottom:s.bottom}:void 0,children:[u("div",{className:"border-border border-b px-3 py-2",children:[u("div",{className:"flex items-center justify-between gap-2",children:[i("div",{id:b,className:"text-foreground text-sm font-medium",children:E}),w>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${w}`})]}),P]}),i("div",{role:"listbox","aria-labelledby":b,tabIndex:0,ref:x,onKeyDown:(e)=>{let t=c.length;if(t===0&&e.key!=="Escape")return;if(e.key==="ArrowDown"||e.key==="ArrowUp")e.preventDefault(),g((o)=>e.key==="ArrowDown"?(o+1)%t:(o-1+t)%t);else if(e.key==="Enter")e.preventDefault(),r(c[a].optionId);else if(e.key==="Escape")e.preventDefault(),r(null);else if(/^[1-9]$/.test(e.key)&&Number(e.key)<=t)e.preventDefault(),r(c[Number(e.key)-1].optionId)},className:"outline-none",children:c.map((e,t)=>{let o=e.kind??"allow_once",C=U[o]?.icon??h,K=o==="allow_always"||o==="reject_always",O=o==="reject_once"||o==="reject_always";return u("div",{role:"option",tabIndex:-1,"aria-selected":t===a,title:e.description,onClick:()=>void r(e.optionId),onKeyDown:(m)=>{if(m.key==="Enter"||m.key===" ")m.preventDefault(),m.stopPropagation(),r(e.optionId)},className:I("flex cursor-pointer items-center gap-2 px-3 py-1.5 text-sm select-none",t===a?"bg-ring text-accent-foreground":"text-foreground",O&&t!==a&&"text-muted-foreground"),children:[i("span",{className:"min-w-3 text-xs opacity-70",children:t+1}),i(C,{className:"size-3.5 shrink-0 opacity-80"}),i("span",{className:"min-w-0 flex-1 truncate",children:e.name}),K&&i("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[10px] tracking-wide uppercase",children:j})]},e.optionId)})})]});return n?z(k,document.body):k}export{Y as PermissionView};
1
+ import{Ce}from"../chunk-8z8va1ws.js";import{autoUpdate as L}from"@floating-ui/dom";import{cn as I}from"cn";import{CheckCheckIcon as M,CheckIcon as h,ShieldXIcon as V,XIcon as F}from"lucide-react";import{useCallback as H,useEffect as N,useId as T,useLayoutEffect as _,useRef as S,useState as f}from"react";import{createPortal as z}from"react-dom";import{jsx as i,jsxs as u}from"react/jsx-runtime";var U={allow_once:{icon:h},allow_always:{icon:M},reject_once:{icon:F},reject_always:{icon:V}};function Y({requestId:p,options:D,title:E,children:P,total:w=1,alwaysLabel:j="always",autoFocus:y="always",anchorRef:n,onRespond:r}){let b=T(),[a,g]=f(0),[s,v]=f(null),[l,A]=f(null),x=S(null),c=Ce(D);N(()=>{g(0)},[p]),N(()=>{let e=document.activeElement;if(y==="always"||e===null||e===document.body)x.current?.focus()},[p,l,y]);let d=H(()=>{let e=n?.current;if(!e)return;let t=e.getBoundingClientRect();if(t.width===0){let o=Math.min(640,window.innerWidth*0.9);v({left:(window.innerWidth-o)/2,width:o,bottom:24});return}v({left:t.left,width:t.width,bottom:window.innerHeight-t.bottom+20})},[n]);if(_(()=>{if(!n)return;let e=0,t=()=>{if(n.current)d();else e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)},[p,n,d]),_(()=>{let e=n?.current;if(!e||!l)return;return L(e,l,d,{animationFrame:!0})},[n,l,d]),n&&!s)return null;let k=u("div",{ref:A,"data-overlay":"permission-request",className:I("bg-card border-border overflow-hidden rounded-lg border",n&&"fixed z-50"),style:n&&s?{left:s.left,width:s.width,bottom:s.bottom}:void 0,children:[u("div",{className:"border-border border-b px-3 py-2",children:[u("div",{className:"flex items-center justify-between gap-2",children:[i("div",{id:b,className:"text-foreground text-sm font-medium",children:E}),w>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${w}`})]}),P]}),i("div",{role:"listbox","aria-labelledby":b,tabIndex:0,ref:x,onKeyDown:(e)=>{let t=c.length;if(t===0&&e.key!=="Escape")return;if(e.key==="ArrowDown"||e.key==="ArrowUp")e.preventDefault(),g((o)=>e.key==="ArrowDown"?(o+1)%t:(o-1+t)%t);else if(e.key==="Enter")e.preventDefault(),r(c[a].optionId);else if(e.key==="Escape")e.preventDefault(),r(null);else if(/^[1-9]$/.test(e.key)&&Number(e.key)<=t)e.preventDefault(),r(c[Number(e.key)-1].optionId)},className:"outline-none",children:c.map((e,t)=>{let o=e.kind??"allow_once",C=U[o]?.icon??h,K=o==="allow_always"||o==="reject_always",O=o==="reject_once"||o==="reject_always";return u("div",{role:"option",tabIndex:-1,"aria-selected":t===a,title:e.description,onClick:()=>void r(e.optionId),onKeyDown:(m)=>{if(m.key==="Enter"||m.key===" ")m.preventDefault(),m.stopPropagation(),r(e.optionId)},className:I("flex cursor-pointer items-center gap-2 px-3 py-1.5 text-sm select-none",t===a?"bg-ring text-accent-foreground":"text-foreground",O&&t!==a&&"text-muted-foreground"),children:[i("span",{className:"min-w-3 text-xs opacity-70",children:t+1}),i(C,{className:"size-3.5 shrink-0 opacity-80"}),i("span",{className:"min-w-0 flex-1 truncate",children:e.name}),K&&i("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[10px] tracking-wide uppercase",children:j})]},e.optionId)})})]});return n?z(k,document.body):k}export{Y as PermissionView};
@@ -1 +1 @@
1
- import{e}from"../chunk-vk39871j.js";import{v}from"../chunk-r5d37dc0.js";import{P,I,He,Oe,M,Be}from"../chunk-sxjgyvnx.js";import{r}from"../chunk-bwzjm3g8.js";import"../chunk-8gv9naya.js";import{re,oe,Je,et,tt,H}from"../chunk-67ws5eed.js";import{d}from"../chunk-wmsdg5fb.js";import{c,a}from"../chunk-zt7a6b1m.js";import{L}from"../chunk-664xazrz.js";import{o}from"../chunk-d0ptk8x8.js";import{isArrayProperty as D,isBooleanProperty as S,isNumberProperty as A,isStringProperty as C}from"@alwith/api";import{useEffect as E,useMemo as N,useState as V}from"react";import{jsx as s,jsxs as f}from"react/jsx-runtime";function R(l){if(!C(l))return null;if(l.oneOf&&l.oneOf.length>0)return l.oneOf.map((t)=>({value:t.const,label:t.title??t.const,...t.description?{description:t.description}:{}}));if(l.enum&&l.enum.length>0)return l.enum.map((t)=>({value:t,label:t}));return null}function q(l){let t=l,n=t._meta?.alwith?.options;if(Array.isArray(n)&&Array.isArray(t.enum))return n.map((i)=>({value:i.const,label:i.title,...i.description?{description:i.description}:{}}));if(Array.isArray(t.enum))return t.enum.map((i)=>({value:String(i),label:String(i)}));if(Array.isArray(t.oneOf))return t.oneOf.map((i)=>({value:i.const,label:i.title,...i.description?{description:i.description}:{}}));return null}function G(l){let t=new Set(l.required??[]);return Object.entries(l.properties??{}).map(([n,i])=>({key:n,property:i,title:i.title??n,description:i.description??null,required:t.has(n),options:R(i),multiOptions:D(i)?q(i.items):null}))}function O(l){let t={};for(let n of l){let i=n.property.default;if(i!==void 0&&i!==null)t[n.key]=i;else if(n.options)t[n.key]=n.options[0].value;else if(S(n.property))t[n.key]=!1;else if(D(n.property))t[n.key]=[]}return t}function B(l,t){if(l.multiOptions)return Array.isArray(t)&&t.length>0;if(!l.required)return!0;return t!==void 0&&t!==""&&!(Array.isArray(t)&&t.length===0)}function w({id:l,label:t,description:n,control:i}){return f("div",{className:"hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",children:[i,f(r,{htmlFor:l,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[s("div",{className:"text-foreground text-sm",children:t}),n&&s("div",{className:"text-muted-foreground text-xs",children:n})]})]})}function K({id:l,field:t,value:n,onChange:i}){if(t.multiOptions){let u=new Set(Array.isArray(n)?n:[]);return f(re,{children:[s(oe,{variant:"label",children:t.title}),t.description&&s(H,{children:t.description}),s("div",{className:"flex flex-col gap-1",children:t.multiOptions.map((p)=>{let g=`${l}:${p.value}`;return s(w,{id:g,...p,control:s(v,{id:g,checked:u.has(p.value),onCheckedChange:(F)=>{let y=new Set(u);if(F)y.add(p.value);else y.delete(p.value);i([...y])}})},p.value)})})]})}if(t.options)return f(re,{children:[s(oe,{variant:"label",children:t.title}),t.description&&s(H,{children:t.description}),s(c,{value:typeof n==="string"?n:"",onValueChange:(u)=>i(String(u)),className:"flex flex-col gap-1",children:t.options.map((u)=>{let p=`${l}:${u.value}`;return s(w,{id:p,...u,control:s(a,{value:u.value,id:p})},u.value)})})]});return f(et,{children:[s(tt,{htmlFor:l,children:t.title}),S(t.property)?s(L,{id:l,checked:n===!0,onCheckedChange:(u)=>i(u)}):A(t.property)?s(d,{id:l,type:"number",required:t.required,value:typeof n==="number"?n:"",onChange:(u)=>i(u.target.value===""?void 0:Number(u.target.value))}):s(o,{id:l,rows:2,required:t.required,value:typeof n==="string"?n:"",onChange:(u)=>i(u.target.value)}),t.description&&s(H,{children:t.description})]})}function ee({requestId:l,schema:t,message:n,total:i,t:u,onRespond:p}){let g=N(()=>G(t),[t]),[F,y]=V(()=>O(g));E(()=>y(O(g)),[l,g]);let x=g.every((m)=>B(m,F[m.key])),k=()=>{if(!x)return;let m={};for(let[b,h]of Object.entries(F))if(h!==void 0)m[b]=h;p({action:"accept",content:m})};return s(P,{open:!0,onOpenChange:(m)=>!m&&p({action:"cancel"}),children:f(I,{className:"flex max-h-[80vh] flex-col gap-4 sm:max-w-lg",onKeyDown:(m)=>{if(m.key==="Enter"&&(m.metaKey||m.ctrlKey))m.preventDefault(),k()},children:[f(He,{children:[f("div",{className:"flex items-center justify-between gap-2 pe-8",children:[s(M,{children:t.title??u("approval.needed")}),i>1&&s("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${i}`})]}),s(Be,{children:n})]}),s("div",{className:"min-h-0 flex-1 overflow-y-auto",children:s(Je,{children:g.map((m)=>s(K,{id:`${l}:${m.key}`,field:m,value:F[m.key],onChange:(b)=>y((h)=>({...h,[m.key]:b}))},m.key))})}),f(Oe,{children:[s(e,{variant:"ghost",onClick:()=>p({action:"decline"}),children:u("actions.decline")}),s(e,{disabled:!x,onClick:k,children:u("actions.submit")})]})]})})}export{ee as SchemaElicitationForm,G as elicitationFields,O as initialValues,B as isAnswered};
1
+ import{e}from"../chunk-wjejhpgw.js";import{v}from"../chunk-r5d37dc0.js";import{M,N,Ke,We,S,qe}from"../chunk-yw4e2tcz.js";import{r}from"../chunk-bwzjm3g8.js";import"../chunk-66headm4.js";import{j,Q,Fe,De,He,D}from"../chunk-36h9z1mt.js";import{l}from"../chunk-1hy64ewz.js";import{c,a}from"../chunk-zt7a6b1m.js";import{I}from"../chunk-m5pbe513.js";import{o}from"../chunk-d0ptk8x8.js";import{isArrayProperty as A,isBooleanProperty as C,isNumberProperty as E,isStringProperty as V}from"@alwith/api";import{useEffect as R,useMemo as q,useState as P}from"react";import{jsx as u,jsxs as f}from"react/jsx-runtime";function L(s){if(!V(s))return null;if(s.oneOf&&s.oneOf.length>0)return s.oneOf.map((t)=>({value:t.const,label:t.title??t.const,...t.description?{description:t.description}:{}}));if(s.enum&&s.enum.length>0)return s.enum.map((t)=>({value:t,label:t}));return null}function G(s){let t=s,n=t._meta?.alwith?.options;if(Array.isArray(n)&&Array.isArray(t.enum))return n.map((i)=>({value:i.const,label:i.title,...i.description?{description:i.description}:{}}));if(Array.isArray(t.enum))return t.enum.map((i)=>({value:String(i),label:String(i)}));if(Array.isArray(t.oneOf))return t.oneOf.map((i)=>({value:i.const,label:i.title,...i.description?{description:i.description}:{}}));return null}function B(s){let t=new Set(s.required??[]);return Object.entries(s.properties??{}).map(([n,i])=>({key:n,property:i,title:i.title??n,description:i.description??null,required:t.has(n),options:L(i),multiOptions:A(i)?G(i.items):null}))}function O(s){let t={};for(let n of s){let i=n.property.default;if(i!==void 0&&i!==null)t[n.key]=i;else if(n.options)t[n.key]=n.options[0].value;else if(C(n.property))t[n.key]=!1;else if(A(n.property))t[n.key]=[]}return t}function K(s,t){if(s.multiOptions)return Array.isArray(t)&&t.length>0;if(!s.required)return!0;return t!==void 0&&t!==""&&!(Array.isArray(t)&&t.length===0)}function w({id:s,label:t,description:n,control:i}){return f("div",{className:"hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",children:[i,f(r,{htmlFor:s,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[u("div",{className:"text-foreground text-sm",children:t}),n&&u("div",{className:"text-muted-foreground text-xs",children:n})]})]})}function T({id:s,field:t,value:n,onChange:i}){if(t.multiOptions){let m=new Set(Array.isArray(n)?n:[]);return f(j,{children:[u(Q,{variant:"label",children:t.title}),t.description&&u(D,{children:t.description}),u("div",{className:"flex flex-col gap-1",children:t.multiOptions.map((p)=>{let g=`${s}:${p.value}`;return u(w,{id:g,...p,control:u(v,{id:g,checked:m.has(p.value),onCheckedChange:(F)=>{let y=new Set(m);if(F)y.add(p.value);else y.delete(p.value);i([...y])}})},p.value)})})]})}if(t.options)return f(j,{children:[u(Q,{variant:"label",children:t.title}),t.description&&u(D,{children:t.description}),u(c,{value:typeof n==="string"?n:"",onValueChange:(m)=>i(String(m)),className:"flex flex-col gap-1",children:t.options.map((m)=>{let p=`${s}:${m.value}`;return u(w,{id:p,...m,control:u(a,{value:m.value,id:p})},m.value)})})]});return f(De,{children:[u(He,{htmlFor:s,children:t.title}),C(t.property)?u(I,{id:s,checked:n===!0,onCheckedChange:(m)=>i(m)}):E(t.property)?u(l,{id:s,type:"number",required:t.required,value:typeof n==="number"?n:"",onChange:(m)=>i(m.target.value===""?void 0:Number(m.target.value))}):u(o,{id:s,rows:2,required:t.required,value:typeof n==="string"?n:"",onChange:(m)=>i(m.target.value)}),t.description&&u(D,{children:t.description})]})}function ie({requestId:s,schema:t,message:n,total:i,t:m,onRespond:p}){let g=q(()=>B(t),[t]),[F,y]=P(()=>O(g));R(()=>y(O(g)),[s,g]);let x=g.every((d)=>K(d,F[d.key])),k=()=>{if(!x)return;let d={};for(let[b,h]of Object.entries(F))if(h!==void 0)d[b]=h;p({action:"accept",content:d})};return u(M,{open:!0,onOpenChange:(d)=>!d&&p({action:"cancel"}),children:f(N,{className:"flex max-h-[80vh] flex-col gap-4 sm:max-w-lg",onKeyDown:(d)=>{if(d.key==="Enter"&&(d.metaKey||d.ctrlKey))d.preventDefault(),k()},children:[f(Ke,{children:[f("div",{className:"flex items-center justify-between gap-2 pe-8",children:[u(S,{children:t.title??m("approval.needed")}),i>1&&u("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${i}`})]}),u(qe,{children:n})]}),u("div",{className:"min-h-0 flex-1 overflow-y-auto",children:u(Fe,{children:g.map((d)=>u(T,{id:`${s}:${d.key}`,field:d,value:F[d.key],onChange:(b)=>y((h)=>({...h,[d.key]:b}))},d.key))})}),f(We,{children:[u(e,{variant:"ghost",onClick:()=>p({action:"decline"}),children:m("actions.decline")}),u(e,{disabled:!x,onClick:k,children:m("actions.submit")})]})]})})}export{ie as SchemaElicitationForm,B as elicitationFields,O as initialValues,K as isAnswered};
@@ -1 +1 @@
1
- import{e}from"../chunk-vk39871j.js";import{Ve,Ke,We,qe,Ge,je}from"../chunk-rq0cpnvn.js";import{ExternalLinkIcon as d}from"lucide-react";import{jsx as a,jsxs as n}from"react/jsx-runtime";function C({message:r,url:t,t:i,onOpen:l,onRespond:o}){return n(Ve,{size:"sm",children:[n(Ke,{children:[a(qe,{children:i("approval.needed")}),a(We,{children:r})]}),a(Ge,{children:n("div",{className:"flex flex-col gap-3",children:[n(e,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>void l(t),children:[a(d,{"data-icon":"inline-start"}),i("approval.openLink")]}),a("p",{className:"text-muted-foreground text-sm",children:i("approval.waitingForLink")})]})}),n(je,{className:"flex flex-wrap gap-2",children:[a(e,{variant:"outline",size:"sm",onClick:()=>o("decline"),children:i("actions.decline")}),a(e,{variant:"ghost",size:"sm",onClick:()=>o("cancel"),children:i("actions.cancel")})]})]})}export{C as UrlElicitationCard};
1
+ import{e}from"../chunk-wjejhpgw.js";import{Pe,Ie,Me,Ne,Se,Ee}from"../chunk-kget6qfz.js";import{ExternalLinkIcon as d}from"lucide-react";import{jsx as a,jsxs as n}from"react/jsx-runtime";function C({message:r,url:t,t:i,onOpen:l,onRespond:o}){return n(Pe,{size:"sm",children:[n(Ie,{children:[a(Ne,{children:i("approval.needed")}),a(Me,{children:r})]}),a(Se,{children:n("div",{className:"flex flex-col gap-3",children:[n(e,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>void l(t),children:[a(d,{"data-icon":"inline-start"}),i("approval.openLink")]}),a("p",{className:"text-muted-foreground text-sm",children:i("approval.waitingForLink")})]})}),n(Ee,{className:"flex flex-wrap gap-2",children:[a(e,{variant:"outline",size:"sm",onClick:()=>o("decline"),children:i("actions.decline")}),a(e,{variant:"ghost",size:"sm",onClick:()=>o("cancel"),children:i("actions.cancel")})]})]})}export{C as UrlElicitationCard};
@@ -1,2 +1,2 @@
1
- async function Ee(g,u){try{let a=await(await fetch(g)).blob(),s=u??a.type??"";if(!s.startsWith("image/"))return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(a)});let w=s.includes("svg"),n,r,o;if(w){let e=new Image,t=URL.createObjectURL(a);e.src=t;try{await new Promise((h,f)=>{e.onload=()=>h(),e.onerror=()=>f(Error("svg load failed"))})}finally{URL.revokeObjectURL(t)}r=e.naturalWidth||1024,o=e.naturalHeight||1024,n=e}else{let e=await createImageBitmap(a);r=e.width,o=e.height,n=e}let i=Math.min(1,2000/Math.max(r,o)),c=Math.round(r*i),l=Math.round(o*i),d=new OffscreenCanvas(c,l),m=d.getContext("2d");if(!m)throw Error("image-encode: OffscreenCanvas 2d context 不可用");if(m.drawImage(n,0,0,c,l),n instanceof ImageBitmap)n.close();let b=await d.convertToBlob({type:"image/webp",quality:0.85});return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(b)})}catch{return null}}
2
- export{Ee};
1
+ async function Qe(g,u){try{let a=await(await fetch(g)).blob(),s=u??a.type??"";if(!s.startsWith("image/"))return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(a)});let w=s.includes("svg"),n,r,o;if(w){let e=new Image,t=URL.createObjectURL(a);e.src=t;try{await new Promise((h,f)=>{e.onload=()=>h(),e.onerror=()=>f(Error("svg load failed"))})}finally{URL.revokeObjectURL(t)}r=e.naturalWidth||1024,o=e.naturalHeight||1024,n=e}else{let e=await createImageBitmap(a);r=e.width,o=e.height,n=e}let i=Math.min(1,2000/Math.max(r,o)),c=Math.round(r*i),l=Math.round(o*i),d=new OffscreenCanvas(c,l),m=d.getContext("2d");if(!m)throw Error("image-encode: OffscreenCanvas 2d context 不可用");if(m.drawImage(n,0,0,c,l),n instanceof ImageBitmap)n.close();let b=await d.convertToBlob({type:"image/webp",quality:0.85});return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(b)})}catch{return null}}
2
+ export{Qe};
@@ -1,4 +1,4 @@
1
- function Le(t,e){if(e===0)return null;let r=e-1;while(r>=0){let n=t[r];if(n===" "||n==="\t"||n===`
1
+ function ce(t,e){if(e===0)return null;let r=e-1;while(r>=0){let n=t[r];if(n===" "||n==="\t"||n===`
2
2
  `)return null;if(n==="@"||n==="/"){let i=r===0?"":t[r-1],s=r===0||i===`
3
3
  `;if(n==="/"?s&&!/[/\\]/.test(t.slice(r+1,e)):s||i===" "||i==="\t")return{kind:n==="/"?"slash":"at",start:r,end:e,query:t.slice(r+1,e)}}r-=1}return null}
4
- export{Le};
4
+ export{ce};
@@ -1 +1 @@
1
- import{Input as t}from"@base-ui/react/input";import{cn as n}from"cn";import{jsx as o}from"react/jsx-runtime";function d({className:i,type:e,...r}){return o(t,{type:e,"data-slot":"input",className:n("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 h-9 w-full min-w-0 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-3 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm",i),...r})}export{d};
1
+ import{Input as t}from"@base-ui/react/input";import{cn as n}from"cn";import{jsx as o}from"react/jsx-runtime";function l({className:i,type:e,...r}){return o(t,{type:e,"data-slot":"input",className:n("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 h-9 w-full min-w-0 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-3 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm",i),...r})}export{l};
@@ -1 +1 @@
1
- import{PreviewCard as i}from"@base-ui/react/preview-card";import{cn as s}from"cn";import{jsx as r}from"react/jsx-runtime";function Xe({...e}){return r(i.Root,{"data-slot":"hover-card",...e})}function Ze({...e}){return r(i.Trigger,{"data-slot":"hover-card-trigger",...e})}function Ye({className:e,side:o="bottom",sideOffset:t=4,align:a="center",alignOffset:d=4,...n}){return r(i.Portal,{"data-slot":"hover-card-portal",children:r(i.Positioner,{align:a,alignOffset:d,side:o,sideOffset:t,className:"isolate z-50",children:r(i.Popup,{"data-slot":"hover-card-content",className:s("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 w-64 origin-(--transform-origin) rounded-lg p-4 text-sm shadow-md ring-1 outline-hidden duration-100",e),...n})})})}export{Xe,Ze,Ye};
1
+ import{PreviewCard as i}from"@base-ui/react/preview-card";import{cn as s}from"cn";import{jsx as r}from"react/jsx-runtime";function Re({...e}){return r(i.Root,{"data-slot":"hover-card",...e})}function Le({...e}){return r(i.Trigger,{"data-slot":"hover-card-trigger",...e})}function _e({className:e,side:o="bottom",sideOffset:t=4,align:a="center",alignOffset:d=4,...n}){return r(i.Portal,{"data-slot":"hover-card-portal",children:r(i.Positioner,{align:a,alignOffset:d,side:o,sideOffset:t,className:"isolate z-50",children:r(i.Popup,{"data-slot":"hover-card-content",className:s("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 w-64 origin-(--transform-origin) rounded-lg p-4 text-sm shadow-md ring-1 outline-hidden duration-100",e),...n})})})}export{Re,Le,_e};
@@ -1,2 +1,2 @@
1
- import{$e,Ue}from"./chunk-47f4a577.js";import{cn as r}from"cn";import{jsx as t,jsxs as a}from"react/jsx-runtime";function n({value:i,onValueChange:o,options:d,itemClassName:l}){return t($e,{value:i,onValueChange:(e)=>o(String(e)),children:d.map((e)=>a(Ue,{value:e.value,disabled:e.disabled,title:e.title,closeOnClick:!0,className:r("gap-2",e.description?"items-start":"items-center",l),children:[e.icon,e.description?a("div",{className:"min-w-0 flex-1",children:[t("div",{className:"text-xs font-medium",children:e.label}),t("div",{className:"text-muted-foreground text-[11px] font-normal",children:e.description})]}):t("span",{className:"min-w-0 flex-1 truncate text-start",children:e.label})]},e.value))})}
1
+ import{Ge,je}from"./chunk-kaeqvcew.js";import{cn as r}from"cn";import{jsx as t,jsxs as a}from"react/jsx-runtime";function n({value:i,onValueChange:o,options:d,itemClassName:l}){return t(Ge,{value:i,onValueChange:(e)=>o(String(e)),children:d.map((e)=>a(je,{value:e.value,disabled:e.disabled,title:e.title,closeOnClick:!0,className:r("gap-2",e.description?"items-start":"items-center",l),children:[e.icon,e.description?a("div",{className:"min-w-0 flex-1",children:[t("div",{className:"text-xs font-medium",children:e.label}),t("div",{className:"text-muted-foreground text-[11px] font-normal",children:e.description})]}):t("span",{className:"min-w-0 flex-1 truncate text-start",children:e.label})]},e.value))})}
2
2
  export{n};
@@ -1,2 +1,2 @@
1
- class s{worker=new Worker(new URL("@alwith/module-chat/code-highlighter.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(i)=>{let e=this.active,t=i.data;if(t.clientId!==e?.clientId||t.revision!==e.revision){this.fail(Error("Code highlighting worker returned an unexpected request"));return}if(this.active=null,!t.ok){this.fail(Error(t.error));return}let r=this.clients.get(e.clientId);if(r?.revision===e.revision)r.onResult({code:e.code,language:e.language,html:t.html});this.dispatch()},this.worker.onerror=(i)=>this.fail(Error(i.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize code highlighting result"))}fail(i){this.failure=i,this.worker.terminate(),this.pending.clear(),this.active=null;for(let e of this.clients.values())e.onError(i)}dispatch(){if(this.active!==null||this.pending.size===0)return;let i=this.pending.values().next().value;this.pending.delete(i.clientId),this.active=i;try{this.worker.postMessage(i)}catch(e){this.fail(e instanceof Error?e:Error(String(e)))}}connect(i,e){if(this.failure!==null)throw this.failure;let t=++this.nextClientId,r={revision:0,onResult:i,onError:e};return this.clients.set(t,r),{update:(o,l)=>{if(this.failure!==null)throw this.failure;r.revision+=1,this.pending.set(t,{clientId:t,revision:r.revision,code:o,language:l}),this.dispatch()},dispose:()=>{if(this.clients.delete(t),this.pending.delete(t),this.clients.size===0)this.worker.terminate(),n=void 0}}}}var n;function ke(i,e){return n??=new s,n.connect(i,e)}
2
- export{ke};
1
+ class s{worker=new Worker(new URL("@alwith/module-chat/code-highlighter.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(i)=>{let e=this.active,t=i.data;if(t.clientId!==e?.clientId||t.revision!==e.revision){this.fail(Error("Code highlighting worker returned an unexpected request"));return}if(this.active=null,!t.ok){this.fail(Error(t.error));return}let r=this.clients.get(e.clientId);if(r?.revision===e.revision)r.onResult({code:e.code,language:e.language,html:t.html});this.dispatch()},this.worker.onerror=(i)=>this.fail(Error(i.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize code highlighting result"))}fail(i){this.failure=i,this.worker.terminate(),this.pending.clear(),this.active=null;for(let e of this.clients.values())e.onError(i)}dispatch(){if(this.active!==null||this.pending.size===0)return;let i=this.pending.values().next().value;this.pending.delete(i.clientId),this.active=i;try{this.worker.postMessage(i)}catch(e){this.fail(e instanceof Error?e:Error(String(e)))}}connect(i,e){if(this.failure!==null)throw this.failure;let t=++this.nextClientId,r={revision:0,onResult:i,onError:e};return this.clients.set(t,r),{update:(o,l)=>{if(this.failure!==null)throw this.failure;r.revision+=1,this.pending.set(t,{clientId:t,revision:r.revision,code:o,language:l}),this.dispatch()},dispose:()=>{if(this.clients.delete(t),this.pending.delete(t),this.clients.size===0)this.worker.terminate(),n=void 0}}}}var n;function tt(i,e){return n??=new s,n.connect(i,e)}
2
+ export{tt};
@@ -0,0 +1,2 @@
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};
@@ -1 +1 @@
1
- import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as n}from"@base-ui/react/use-render";import{cva as o}from"class-variance-authority";import{cn as d}from"cn";var ut=o("group/badge focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:ring-[3px] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function ze({className:r,variant:e="default",render:t,...i}){return n({defaultTagName:"span",props:a({className:d(ut({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{ut,ze};
1
+ import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as n}from"@base-ui/react/use-render";import{cva as o}from"class-variance-authority";import{cn as d}from"cn";var lt=o("group/badge focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:ring-[3px] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Ae({className:r,variant:e="default",render:t,...i}){return n({defaultTagName:"span",props:a({className:d(lt({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{lt,Ae};
@@ -1,2 +1,2 @@
1
- import{Re}from"./chunk-6m16qe9q.js";import{CheckIcon as N,ChevronDownIcon as E,CopyIcon as w,FileIcon as k}from"lucide-react";import{useEffect as H,useLayoutEffect as I,useRef as T,useState as b}from"react";import{jsx as e,jsxs as g,Fragment as y}from"react/jsx-runtime";var A=20,L='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function h(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function R(n,o){let s=n.getBoundingClientRect(),i=o.getBoundingClientRect();return s.top>=i.top&&s.right<=i.right&&s.bottom<=i.bottom&&s.left>=i.left}function M({text:n,host:o}){let{t:s,Markdown:i}=o,c=T(null),[l,p]=b(!1),[d,f]=b(!1);return I(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=()=>{if(r.scrollHeight===0){p(!1);return}let x=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(x))throw Error("Codex user message line height is invalid");p(r.scrollHeight>A*x+1)};t();let u=new ResizeObserver(t);return u.observe(r),()=>u.disconnect()},[]),H(()=>{if(!l||d)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=new Map,u=typeof IntersectionObserver>"u"?null:new IntersectionObserver((a)=>{for(let m of a){let v=m.target;if(!t.has(v))continue;h(v,m.isIntersecting&&m.intersectionRatio>=1,t.get(v))}},{root:r,rootMargin:"0px",threshold:1}),x=()=>{for(let a of t.keys()){if(r.contains(a))continue;u?.unobserve(a),t.delete(a)}for(let a of r.querySelectorAll(L)){if(t.has(a)||a.hasAttribute("inert"))continue;let m=a.getAttribute("aria-hidden");t.set(a,m),h(a,u===null&&R(a,r),m),u?.observe(a)}};x();let C=new MutationObserver(x);return C.observe(r,{childList:!0,subtree:!0}),()=>{u?.disconnect(),C.disconnect();for(let[a,m]of t)h(a,!0,m)}},[l,d]),g("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:l&&!d?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(i,{text:n,streaming:!1})}),l&&!d&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),l&&g("button",{type:"button","aria-expanded":d,className:"codex-user-message-collapse-trigger",onClick:()=>{f((r)=>!r)},children:[e("span",{children:d?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(E,{className:d?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function U({text:n,label:o}){let[s,i]=b(!1);return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:o,onClick:()=>{navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),2000)},children:s?e(N,{className:"codex-message-action-confirmed"}):e(w,{})})}function S({image:n,openImage:o}){let[s,i]=b(!1),c=`data:${n.mimeType};base64,${n.data}`;return g(y,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?i(!0):o(c),children:e("img",{src:c,alt:""})}),s&&e(Re,{src:c,alt:"",onClose:()=>i(!1)})]})}function vt({message:n,text:o,textParts:s,mentions:i,images:c,messageTime:l,host:p,bubbleStyle:d}){let{t:f,openImage:r}=p;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:g("div",{className:"group/codex-user codex-user-message-group",children:[i.length>0&&e("div",{className:"codex-user-mentions",children:i.map((t)=>g("span",{className:"codex-user-mention",title:t.title,children:[e(k,{"aria-hidden":"true"}),e("span",{className:"codex-user-mention-label",children:t.label})]},t.key))}),c.length>0&&e("div",{className:"codex-user-images",children:c.map((t)=>e(S,{image:t,openImage:r},`${t.mimeType}:${t.data}`))}),o.length>0&&e(y,{children:e("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:d,children:s?s.map((t,u)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(M,{text:t.text,host:p}):g(y,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question}),e("div",{className:"codex-user-question-answer",children:t.text})]})},u)):e(M,{text:o,host:p})})}),g("div",{className:"codex-user-actions",children:[e(U,{text:o,label:f("actions.copy")}),l&&e("span",{className:"codex-user-time",title:l.full,children:l.short})]})]})})}
2
- export{U,vt};
1
+ import{we}from"./chunk-ftka421d.js";import{CheckIcon as N,ChevronDownIcon as E,CopyIcon as w,FileIcon as k}from"lucide-react";import{useEffect as H,useLayoutEffect as I,useRef as T,useState as b}from"react";import{jsx as e,jsxs as g,Fragment as y}from"react/jsx-runtime";var A=20,L='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function h(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function R(n,o){let s=n.getBoundingClientRect(),i=o.getBoundingClientRect();return s.top>=i.top&&s.right<=i.right&&s.bottom<=i.bottom&&s.left>=i.left}function M({text:n,host:o}){let{t:s,Markdown:i}=o,c=T(null),[l,p]=b(!1),[d,f]=b(!1);return I(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=()=>{if(r.scrollHeight===0){p(!1);return}let x=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(x))throw Error("Codex user message line height is invalid");p(r.scrollHeight>A*x+1)};t();let u=new ResizeObserver(t);return u.observe(r),()=>u.disconnect()},[]),H(()=>{if(!l||d)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=new Map,u=typeof IntersectionObserver>"u"?null:new IntersectionObserver((a)=>{for(let m of a){let v=m.target;if(!t.has(v))continue;h(v,m.isIntersecting&&m.intersectionRatio>=1,t.get(v))}},{root:r,rootMargin:"0px",threshold:1}),x=()=>{for(let a of t.keys()){if(r.contains(a))continue;u?.unobserve(a),t.delete(a)}for(let a of r.querySelectorAll(L)){if(t.has(a)||a.hasAttribute("inert"))continue;let m=a.getAttribute("aria-hidden");t.set(a,m),h(a,u===null&&R(a,r),m),u?.observe(a)}};x();let C=new MutationObserver(x);return C.observe(r,{childList:!0,subtree:!0}),()=>{u?.disconnect(),C.disconnect();for(let[a,m]of t)h(a,!0,m)}},[l,d]),g("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:l&&!d?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(i,{text:n,streaming:!1})}),l&&!d&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),l&&g("button",{type:"button","aria-expanded":d,className:"codex-user-message-collapse-trigger",onClick:()=>{f((r)=>!r)},children:[e("span",{children:d?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(E,{className:d?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function W({text:n,label:o}){let[s,i]=b(!1);return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:o,onClick:()=>{navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),2000)},children:s?e(N,{className:"codex-message-action-confirmed"}):e(w,{})})}function S({image:n,openImage:o}){let[s,i]=b(!1),c=`data:${n.mimeType};base64,${n.data}`;return g(y,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?i(!0):o(c),children:e("img",{src:c,alt:""})}),s&&e(we,{src:c,alt:"",onClose:()=>i(!1)})]})}function bt({message:n,text:o,textParts:s,mentions:i,images:c,messageTime:l,host:p,bubbleStyle:d}){let{t:f,openImage:r}=p;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:g("div",{className:"group/codex-user codex-user-message-group",children:[i.length>0&&e("div",{className:"codex-user-mentions",children:i.map((t)=>g("span",{className:"codex-user-mention",title:t.title,children:[e(k,{"aria-hidden":"true"}),e("span",{className:"codex-user-mention-label",children:t.label})]},t.key))}),c.length>0&&e("div",{className:"codex-user-images",children:c.map((t)=>e(S,{image:t,openImage:r},`${t.mimeType}:${t.data}`))}),o.length>0&&e(y,{children:e("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:d,children:s?s.map((t,u)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(M,{text:t.text,host:p}):g(y,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question}),e("div",{className:"codex-user-question-answer",children:t.text})]})},u)):e(M,{text:o,host:p})})}),g("div",{className:"codex-user-actions",children:[e(W,{text:o,label:f("actions.copy")}),l&&e("span",{className:"codex-user-time",title:l.full,children:l.short})]})]})})}
2
+ export{W,bt};
@@ -0,0 +1 @@
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};
@@ -0,0 +1,2 @@
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};
@@ -1,2 +1,2 @@
1
- import{Ee}from"./chunk-ta690ra0.js";async function m(r){try{let i=await(await fetch(r)).blob();if(typeof createImageBitmap==="function")return(await createImageBitmap(i)).close(),!0;return await new Promise((a)=>{let o=new Image;o.onload=()=>a(!0),o.onerror=()=>a(!1),o.src=r})}catch{return!1}}async function Ne(r){let n=await Promise.all(r.map(async({id:a,lastModified:o,sourcePath:p,...t})=>{let e=t.url;if(t.url.startsWith("blob:")){let s=await Ee(t.url,t.mediaType);if(s===null)return null;e=s}let l=t.mediaType.toLowerCase().startsWith("image/"),c=e.startsWith("data:image/");if(l&&c&&!await m(e))return null;let u=e.startsWith("data:")?e.slice(5,e.indexOf(";")):t.mediaType;return{...t,url:e,mediaType:u}})),i=n.filter((a)=>a!==null);return{files:i,rejectedCount:n.length-i.length}}
2
- export{Ne};
1
+ import{Qe}from"./chunk-0e1pdbec.js";async function m(r){try{let i=await(await fetch(r)).blob();if(typeof createImageBitmap==="function")return(await createImageBitmap(i)).close(),!0;return await new Promise((a)=>{let o=new Image;o.onload=()=>a(!0),o.onerror=()=>a(!1),o.src=r})}catch{return!1}}async function $e(r){let n=await Promise.all(r.map(async({id:a,lastModified:o,sourcePath:p,...t})=>{let e=t.url;if(t.url.startsWith("blob:")){let s=await Qe(t.url,t.mediaType);if(s===null)return null;e=s}let l=t.mediaType.toLowerCase().startsWith("image/"),c=e.startsWith("data:image/");if(l&&c&&!await m(e))return null;let u=e.startsWith("data:")?e.slice(5,e.indexOf(";")):t.mediaType;return{...t,url:e,mediaType:u}})),i=n.filter((a)=>a!==null);return{files:i,rejectedCount:n.length-i.length}}
2
+ export{$e};
@@ -1 +1 @@
1
- import{Separator as o}from"@base-ui/react/separator";import{cn as i}from"cn";import{jsx as e}from"react/jsx-runtime";function R({className:a,orientation:r="horizontal",...t}){return e(o,{"data-slot":"separator",orientation:r,className:i("bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",a),...t})}export{R};
1
+ import{Separator as o}from"@base-ui/react/separator";import{cn as i}from"cn";import{jsx as e}from"react/jsx-runtime";function P({className:a,orientation:r="horizontal",...t}){return e(o,{"data-slot":"separator",orientation:r,className:i("bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",a),...t})}export{P};
@@ -0,0 +1,2 @@
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,_};
@@ -0,0 +1,2 @@
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};
@@ -1,2 +1,2 @@
1
- import{xe}from"./chunk-a5b2tm60.js";function fe(t,o){if(xe(o))return y(t);return t.map((e)=>({kind:"block",block:e}))}function i(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"||t.type==="collab"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function y(t){let o=[],e=[],r=()=>{if(e.length===0)return;o.push({kind:"codexActivityGroup",blocks:e}),e=[]};for(let n of t){if(i(n)&&c(n)){e.push(n);continue}if(r(),i(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return r(),o}
2
- export{fe};
1
+ import{et}from"./chunk-y2xbq7rb.js";function ze(t,o){if(et(o))return y(t);return t.map((e)=>({kind:"block",block:e}))}function i(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"||t.type==="collab"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function y(t){let o=[],e=[],r=()=>{if(e.length===0)return;o.push({kind:"codexActivityGroup",blocks:e}),e=[]};for(let n of t){if(i(n)&&c(n)){e.push(n);continue}if(r(),i(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return r(),o}
2
+ export{ze};
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-pqgtv07g.js";import{i}from"./chunk-pve9b7z3.js";import{isContentEntry as N,isImage as w,isResourceLink as C}from"@alwith/api";import{ChevronRightIcon as S,ImageIcon as A,LoaderCircleIcon as R,RefreshCwIcon as B}from"lucide-react";import{useEffect as T,useState as x}from"react";import{jsx as r,jsxs as h}from"react/jsx-runtime";function f(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function E(e){let c=[];for(let[l,u]of e.content.entries()){if(!N(u))continue;let s=u.content;if(w(s))c.push({key:`${e.id}:${l}`,src:`data:${s.mimeType};base64,${s.data}`,alt:e.title??""});if(C(s))c.push({key:`${e.id}:${l}`,path:s.uri,alt:s.name})}if(c.length)return c;let o=e.rawInput;if(o!==null&&typeof o==="object"&&"path"in o&&typeof o.path==="string")return[{key:e.id,path:o.path,alt:o.path.split(/[\\/]/).at(-1)??o.path}];throw Error(`Image view ${e.id} has no image source`)}function U({images:e}){let{loadImage:c,openImageGallery:o,openImage:l,t:u}=t(),[s,y]=x({}),[I,k]=x(0),v=JSON.stringify(e);T(()=>{let a=!0,d=JSON.parse(v);y({});for(let n of d)(n.src!==void 0?Promise.resolve(n.src):n.path!==void 0&&c?c(n.path):Promise.reject(Error("Image loading is unavailable"))).then((m)=>{if(a)y((g)=>({...g,[n.key]:{src:m}}))},()=>{if(a)y((m)=>({...m,[n.key]:{error:!0}}))});return()=>{a=!1}},[v,c,I]);let b=e.flatMap((a)=>{let d=s[a.key];return d&&"src"in d?[{src:d.src,alt:a.alt}]:[]});return r("div",{className:"codex-image-thumbnails",children:e.map((a,d)=>{let n=s[a.key];if(!n)return r("div",{className:"codex-image-thumbnail",role:"status","aria-label":u("stream.codex.imageLoading"),children:r(R,{className:"motion-safe:animate-spin","aria-hidden":"true"})},a.key);if("error"in n)return r("button",{type:"button",className:"codex-image-thumbnail",title:a.alt,"aria-label":u("stream.codex.imageFailed"),onClick:()=>k((p)=>p+1),children:r(B,{"aria-hidden":"true"})},a.key);return r("button",{type:"button",className:"codex-image-thumbnail",title:a.alt,onClick:()=>{let p=e.slice(0,d).filter((m)=>{let g=s[m.key];return g&&"src"in g}).length;if(o)o(b,p);else l?.(n.src)},children:r("img",{src:n.src,alt:a.alt,draggable:!1})},a.key)})})}function be({blocks:e}){let{t:c}=t(),o=e.flatMap(E),[l,u]=i(`image-view:${e[0].id}`,!1);return h("div",{className:"codex-activity-item",children:[h("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":l,onClick:()=>u((s)=>!s),children:[h("span",{className:"codex-activity-label",children:[r(A,{className:"codex-activity-icon","aria-hidden":"true"}),r("span",{className:"codex-activity-leading",children:c("stream.codex.viewedImages",{count:o.length})})]}),r(S,{className:l?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),l&&r(U,{images:o})]})}
2
- export{f,be};
1
+ import{t}from"./chunk-pqgtv07g.js";import{i}from"./chunk-rgy601b7.js";import{isContentEntry as N,isImage as w,isResourceLink as C}from"@alwith/api";import{ChevronRightIcon as S,ImageIcon as A,LoaderCircleIcon as R,RefreshCwIcon as B}from"lucide-react";import{useEffect as T,useState as x}from"react";import{jsx as r,jsxs as h}from"react/jsx-runtime";function f(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function E(e){let c=[];for(let[l,u]of e.content.entries()){if(!N(u))continue;let s=u.content;if(w(s))c.push({key:`${e.id}:${l}`,src:`data:${s.mimeType};base64,${s.data}`,alt:e.title??""});if(C(s))c.push({key:`${e.id}:${l}`,path:s.uri,alt:s.name})}if(c.length)return c;let o=e.rawInput;if(o!==null&&typeof o==="object"&&"path"in o&&typeof o.path==="string")return[{key:e.id,path:o.path,alt:o.path.split(/[\\/]/).at(-1)??o.path}];throw Error(`Image view ${e.id} has no image source`)}function U({images:e}){let{loadImage:c,openImageGallery:o,openImage:l,t:u}=t(),[s,y]=x({}),[I,k]=x(0),v=JSON.stringify(e);T(()=>{let a=!0,d=JSON.parse(v);y({});for(let n of d)(n.src!==void 0?Promise.resolve(n.src):n.path!==void 0&&c?c(n.path):Promise.reject(Error("Image loading is unavailable"))).then((m)=>{if(a)y((g)=>({...g,[n.key]:{src:m}}))},()=>{if(a)y((m)=>({...m,[n.key]:{error:!0}}))});return()=>{a=!1}},[v,c,I]);let b=e.flatMap((a)=>{let d=s[a.key];return d&&"src"in d?[{src:d.src,alt:a.alt}]:[]});return r("div",{className:"codex-image-thumbnails",children:e.map((a,d)=>{let n=s[a.key];if(!n)return r("div",{className:"codex-image-thumbnail",role:"status","aria-label":u("stream.codex.imageLoading"),children:r(R,{className:"motion-safe:animate-spin","aria-hidden":"true"})},a.key);if("error"in n)return r("button",{type:"button",className:"codex-image-thumbnail",title:a.alt,"aria-label":u("stream.codex.imageFailed"),onClick:()=>k((p)=>p+1),children:r(B,{"aria-hidden":"true"})},a.key);return r("button",{type:"button",className:"codex-image-thumbnail",title:a.alt,onClick:()=>{let p=e.slice(0,d).filter((m)=>{let g=s[m.key];return g&&"src"in g}).length;if(o)o(b,p);else l?.(n.src)},children:r("img",{src:n.src,alt:a.alt,draggable:!1})},a.key)})})}function ye({blocks:e}){let{t:c}=t(),o=e.flatMap(E),[l,u]=i(`image-view:${e[0].id}`,!1);return h("div",{className:"codex-activity-item",children:[h("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":l,onClick:()=>u((s)=>!s),children:[h("span",{className:"codex-activity-label",children:[r(A,{className:"codex-activity-icon","aria-hidden":"true"}),r("span",{className:"codex-activity-leading",children:c("stream.codex.viewedImages",{count:o.length})})]}),r(S,{className:l?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),l&&r(U,{images:o})]})}
2
+ export{f,ye};
@@ -0,0 +1,2 @@
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};
@@ -1,2 +1,2 @@
1
- import{CheckCircleIcon as c,CircleIcon as o,LoaderIcon as i}from"lucide-react";import{jsx as n,jsxs as e}from"react/jsx-runtime";function k({entries:s}){let d=s.filter((a)=>a.status==="completed").length,t=s.find((a)=>a.status==="in_progress");return e("div",{className:"codex-plan",children:[e("div",{className:"codex-plan-summary",children:[e("span",{children:[d,"/",s.length]}),t!==void 0&&e("span",{className:"codex-plan-active",children:["· ",t.content]})]}),n("div",{className:"codex-plan-entries",children:s.map((a)=>e("div",{className:"codex-plan-entry","data-status":a.status,children:[a.status==="completed"&&n(c,{"aria-hidden":"true"}),a.status==="in_progress"&&n(i,{className:"codex-plan-spinner","aria-hidden":"true"}),a.status==="pending"&&n(o,{"aria-hidden":"true"}),n("span",{children:a.content})]},a.content))})]})}
2
- export{k};
1
+ import{CheckCircleIcon as c,CircleIcon as o,LoaderIcon as i}from"lucide-react";import{jsx as n,jsxs as e}from"react/jsx-runtime";function T({entries:s}){let d=s.filter((a)=>a.status==="completed").length,t=s.find((a)=>a.status==="in_progress");return e("div",{className:"codex-plan",children:[e("div",{className:"codex-plan-summary",children:[e("span",{children:[d,"/",s.length]}),t!==void 0&&e("span",{className:"codex-plan-active",children:["· ",t.content]})]}),n("div",{className:"codex-plan-entries",children:s.map((a)=>e("div",{className:"codex-plan-entry","data-status":a.status,children:[a.status==="completed"&&n(c,{"aria-hidden":"true"}),a.status==="in_progress"&&n(i,{className:"codex-plan-spinner","aria-hidden":"true"}),a.status==="pending"&&n(o,{"aria-hidden":"true"}),n("span",{children:a.content})]},a.content))})]})}
2
+ export{T};
@@ -0,0 +1,2 @@
1
+ function ke(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function q(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function h(t){return t.type==="array"}function A(t){return(h(t)?t.items?.oneOf??[]:t.oneOf??[]).map((e)=>{let i=e,r=i.const??i.title??"";return{value:r,label:i.title??r,...i.description?{description:i.description}:{},...i._meta?.alwith?.preview?{preview:i._meta.alwith.preview}:{}}})}
2
+ export{ke,q,h,A};
@@ -1,2 +1,2 @@
1
- import{o}from"./chunk-d0ptk8x8.js";import{cn as n}from"cn";import{jsx as a}from"react/jsx-runtime";function ne({className:r,...e}){return a(o,{"data-slot":"input-group-control",className:n("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",r),...e})}
2
- export{ne};
1
+ import{o}from"./chunk-d0ptk8x8.js";import{cn as n}from"cn";import{jsx as a}from"react/jsx-runtime";function te({className:r,...e}){return a(o,{"data-slot":"input-group-control",className:n("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",r),...e})}
2
+ export{te};
@@ -1,2 +1,2 @@
1
- import{cn as S}from"cn";import{useRef as y,useState as k}from"react";import{jsx as m,jsxs as u}from"react/jsx-runtime";function Q({name:p,value:P,levels:h,disabled:c,onChange:v}){if(h.length===0)throw Error("EffortSlider requires at least one level");let o=h,g=Math.max(0,o.findIndex((t)=>t.value===P)),[M,d]=k(null),l=y(null),[I,b]=k(null),x=y(0),s=M??I??g,w=(t)=>{let n=++x.current;b(t);let e=()=>{if(x.current===n)b(null)};try{Promise.resolve(v(o[t].value)).then(e,e)}catch(N){throw e(),N}},f=76,r=14,a=2,i=o.length,C=a+s/Math.max(1,i-1)*(f-r-a*2);return u("div",{className:S("flex items-center justify-between px-2 py-2.5",c&&"opacity-50"),children:[u("span",{className:"grid shrink-0 text-sm whitespace-nowrap",children:[o.map((t)=>u("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1",children:[p," ",u("span",{style:{fontSize:12},children:["(",t.name,")"]})]},t.value)),u("span",{className:"col-start-1 row-start-1",children:[p," ",u("span",{"data-effort-value":"",style:{fontSize:12},children:["(",o[s].name,")"]})]})]}),u("button",{type:"button",disabled:c,role:"slider","aria-label":p,"aria-valuemin":0,"aria-valuemax":i-1,"aria-valuenow":s,"aria-valuetext":o[s].name,onKeyDown:(t)=>{let n;if(t.key==="ArrowRight"||t.key==="ArrowUp")n=Math.min(i-1,s+1);else if(t.key==="ArrowLeft"||t.key==="ArrowDown")n=Math.max(0,s-1);else if(t.key==="Home")n=0;else if(t.key==="End")n=i-1;else return;if(t.preventDefault(),t.stopPropagation(),!c&&n!==s)w(n)},className:"relative shrink-0 cursor-pointer touch-none overflow-hidden rounded-full border-none p-0 disabled:cursor-default",style:{width:f,height:18,background:"var(--input)"},onPointerDown:(t)=>{if(c||t.button!==0)return;t.preventDefault(),t.stopPropagation(),t.currentTarget.focus(),t.currentTarget.setPointerCapture(t.pointerId);let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/(n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerMove:(t)=>{if(l.current===null)return;let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/(n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerUp:(t)=>{let n=l.current;if(l.current=null,d(null),t.currentTarget.hasPointerCapture(t.pointerId))t.currentTarget.releasePointerCapture(t.pointerId);if(!c&&n!==null&&n!==g)w(n)},onLostPointerCapture:()=>{l.current=null,d(null)},onPointerCancel:()=>{l.current=null,d(null)},onClick:(t)=>{t.preventDefault(),t.stopPropagation()},children:[m("span",{className:"absolute inset-y-0 left-0 w-full rounded-full",style:{background:"var(--input)"}}),o.map((t,n)=>{let e=a+r/2+n/Math.max(1,i-1)*(f-r-a*2)-2;return m("span",{className:"absolute top-1/2 size-1 -translate-y-1/2 rounded-full",style:{left:e,background:"color-mix(in srgb, var(--muted-foreground) 40%, transparent)"}},t.value)}),m("span",{className:"absolute rounded-full transition-all duration-150",style:{width:r,height:r,top:a,left:C,background:"var(--foreground)",boxShadow:"0 1px 2px #0003"}})]})]})}
2
- export{Q};
1
+ import{cn as S}from"cn";import{useRef as y,useState as k}from"react";import{jsx as m,jsxs as u}from"react/jsx-runtime";function O({name:p,value:P,levels:h,disabled:c,onChange:v}){if(h.length===0)throw Error("EffortSlider requires at least one level");let o=h,g=Math.max(0,o.findIndex((t)=>t.value===P)),[M,d]=k(null),l=y(null),[I,b]=k(null),x=y(0),s=M??I??g,w=(t)=>{let n=++x.current;b(t);let e=()=>{if(x.current===n)b(null)};try{Promise.resolve(v(o[t].value)).then(e,e)}catch(N){throw e(),N}},f=76,r=14,a=2,i=o.length,C=a+s/Math.max(1,i-1)*(f-r-a*2);return u("div",{className:S("flex items-center justify-between px-2 py-2.5",c&&"opacity-50"),children:[u("span",{className:"grid shrink-0 text-sm whitespace-nowrap",children:[o.map((t)=>u("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1",children:[p," ",u("span",{style:{fontSize:12},children:["(",t.name,")"]})]},t.value)),u("span",{className:"col-start-1 row-start-1",children:[p," ",u("span",{"data-effort-value":"",style:{fontSize:12},children:["(",o[s].name,")"]})]})]}),u("button",{type:"button",disabled:c,role:"slider","aria-label":p,"aria-valuemin":0,"aria-valuemax":i-1,"aria-valuenow":s,"aria-valuetext":o[s].name,onKeyDown:(t)=>{let n;if(t.key==="ArrowRight"||t.key==="ArrowUp")n=Math.min(i-1,s+1);else if(t.key==="ArrowLeft"||t.key==="ArrowDown")n=Math.max(0,s-1);else if(t.key==="Home")n=0;else if(t.key==="End")n=i-1;else return;if(t.preventDefault(),t.stopPropagation(),!c&&n!==s)w(n)},className:"relative shrink-0 cursor-pointer touch-none overflow-hidden rounded-full border-none p-0 disabled:cursor-default",style:{width:f,height:18,background:"var(--input)"},onPointerDown:(t)=>{if(c||t.button!==0)return;t.preventDefault(),t.stopPropagation(),t.currentTarget.focus(),t.currentTarget.setPointerCapture(t.pointerId);let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/(n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerMove:(t)=>{if(l.current===null)return;let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/(n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerUp:(t)=>{let n=l.current;if(l.current=null,d(null),t.currentTarget.hasPointerCapture(t.pointerId))t.currentTarget.releasePointerCapture(t.pointerId);if(!c&&n!==null&&n!==g)w(n)},onLostPointerCapture:()=>{l.current=null,d(null)},onPointerCancel:()=>{l.current=null,d(null)},onClick:(t)=>{t.preventDefault(),t.stopPropagation()},children:[m("span",{className:"absolute inset-y-0 left-0 w-full rounded-full",style:{background:"var(--input)"}}),o.map((t,n)=>{let e=a+r/2+n/Math.max(1,i-1)*(f-r-a*2)-2;return m("span",{className:"absolute top-1/2 size-1 -translate-y-1/2 rounded-full",style:{left:e,background:"color-mix(in srgb, var(--muted-foreground) 40%, transparent)"}},t.value)}),m("span",{className:"absolute rounded-full transition-all duration-150",style:{width:r,height:r,top:a,left:C,background:"var(--foreground)",boxShadow:"0 1px 2px #0003"}})]})]})}
2
+ export{O};
@@ -1 +1 @@
1
- import{e}from"./chunk-vk39871j.js";import{cva as i}from"class-variance-authority";import{cn as r}from"cn";import{jsx as o}from"react/jsx-runtime";function Qe({className:a,...t}){return o("div",{"data-slot":"input-group",role:"group",className:r("group/input-group border-input has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 relative flex h-9 w-full min-w-0 items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-3 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",a),...t})}var p=i("text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:-ml-1 has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:-mr-1 has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function ee({className:a,align:t="inline-start",...s}){return o("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:r(p({align:t}),a),onClick:(n)=>{if(n.target.closest("button"))return;n.currentTarget.parentElement?.querySelector("input")?.focus()},...s})}var l=i("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function te({className:a,type:t="button",variant:s="ghost",size:n="xs",...u}){return o(e,{type:t,"data-size":n,variant:s,className:r(l({size:n}),a),...u})}function _t({className:a,...t}){return o("span",{className:r("text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",a),...t})}export{Qe,ee,te,_t};
1
+ import{e}from"./chunk-wjejhpgw.js";import{cva as i}from"class-variance-authority";import{cn as r}from"cn";import{jsx as o}from"react/jsx-runtime";function Oe({className:a,...t}){return o("div",{"data-slot":"input-group",role:"group",className:r("group/input-group border-input has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 relative flex h-9 w-full min-w-0 items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-3 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",a),...t})}var p=i("text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:-ml-1 has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:-mr-1 has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function J({className:a,align:t="inline-start",...s}){return o("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:r(p({align:t}),a),onClick:(n)=>{if(n.target.closest("button"))return;n.currentTarget.parentElement?.querySelector("input")?.focus()},...s})}var l=i("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function ee({className:a,type:t="button",variant:s="ghost",size:n="xs",...u}){return o(e,{type:t,"data-size":n,variant:s,className:r(l({size:n}),a),...u})}function Et({className:a,...t}){return o("span",{className:r("text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",a),...t})}export{Oe,J,ee,Et};
@@ -1,2 +1,2 @@
1
- import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function Re({src:o,alt:e,onClose:i}){return n(t("button",{type:"button",className:"fixed inset-0 z-[1000] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.7)"},onClick:i,children:t("img",{src:o,alt:e,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4}})}),document.body)}
2
- export{Re};
1
+ import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function we({src:o,alt:e,onClose:i}){return n(t("button",{type:"button",className:"fixed inset-0 z-[1000] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.7)"},onClick:i,children:t("img",{src:o,alt:e,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4}})}),document.body)}
2
+ export{we};
@@ -0,0 +1,2 @@
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};
@@ -0,0 +1,2 @@
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};
@@ -0,0 +1,2 @@
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};
@@ -1,2 +1,2 @@
1
- import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function Ce(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function W(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
- export{Ce,W};
1
+ import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function Be(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function ne(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
+ export{Be,ne};
@@ -1,3 +1,3 @@
1
1
  import{t}from"./chunk-pqgtv07g.js";import{ChevronDownIcon as v,ChevronUpIcon as b,FileDiffIcon as C}from"lucide-react";import{useState as m}from"react";import{jsx as d,jsxs as o}from"react/jsx-runtime";function x(e){if(e===null||e.length===0)return 0;return e.split(`
2
- `).length}function it(e){let l=new Map;for(let u of e)for(let a of u.content){if(a.type!=="diff")continue;let f=a,r=f._meta?.alwith?.hunks??[],h=r.reduce((i,s)=>i+x(s.newText),0),c=r.reduce((i,s)=>i+x(s.oldText),0);for(let i of f.changes){let s=l.get(i.path);if(s)s.additions+=h,s.deletions+=c;else l.set(i.path,{path:i.path,additions:h,deletions:c})}}return[...l.values()]}function ye({blocks:e}){return d(at,{files:it(e)})}function at({files:e,onOpen:l,renderPath:u}){let{t:a,openLink:f}=t(),[r,h]=m(!0),[c,i]=m(!1);if(e.length===0)return null;let s=e.reduce((n,p)=>n+p.additions,0),g=e.reduce((n,p)=>n+p.deletions,0);return o("section",{className:"codex-edited-files-card",children:[o("div",{className:"codex-edited-files-header",children:[d("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:d(C,{})}),o("div",{className:"codex-edited-files-summary",children:[d("strong",{children:a("stream.codex.editedFilesCount",{count:e.length})}),d("button",{type:"button","data-codex-disclosure":"",onClick:()=>{h((n)=>!n),i(!1)},"aria-expanded":r,children:a(r?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),o("div",{className:"codex-edited-files-total",title:a("stream.codex.changedLines"),children:[o("span",{className:"codex-diff-additions",children:["+",s]}),o("span",{className:"codex-diff-deletions",children:["-",g]})]})]}),r&&o("div",{className:"codex-edited-files-list",children:[(c?e:e.slice(0,3)).map((n)=>o("div",{className:"codex-edited-file-row",children:[d("button",{type:"button",className:"codex-edited-file-path",title:n.path,onClick:()=>l===void 0?f(n.path):l(n),children:u===void 0?n.path:u(n)}),o("span",{className:"codex-edited-file-counts",children:[o("span",{className:"codex-diff-additions",children:["+",n.additions]}),o("span",{className:"codex-diff-deletions",children:["-",n.deletions]})]})]},n.path)),e.length>3&&o("button",{type:"button",className:"codex-edited-files-more","aria-expanded":c,onClick:()=>i((n)=>!n),children:[a(c?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),c?d(b,{size:16,"aria-hidden":"true"}):d(v,{size:16,"aria-hidden":"true"})]})]})]})}
3
- export{it,ye,at};
2
+ `).length}function at(e){let l=new Map;for(let u of e)for(let a of u.content){if(a.type!=="diff")continue;let f=a,r=f._meta?.alwith?.hunks??[],h=r.reduce((i,s)=>i+x(s.newText),0),c=r.reduce((i,s)=>i+x(s.oldText),0);for(let i of f.changes){let s=l.get(i.path);if(s)s.additions+=h,s.deletions+=c;else l.set(i.path,{path:i.path,additions:h,deletions:c})}}return[...l.values()]}function he({blocks:e}){return d(st,{files:at(e)})}function st({files:e,onOpen:l,renderPath:u}){let{t:a,openLink:f}=t(),[r,h]=m(!0),[c,i]=m(!1);if(e.length===0)return null;let s=e.reduce((n,p)=>n+p.additions,0),g=e.reduce((n,p)=>n+p.deletions,0);return o("section",{className:"codex-edited-files-card",children:[o("div",{className:"codex-edited-files-header",children:[d("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:d(C,{})}),o("div",{className:"codex-edited-files-summary",children:[d("strong",{children:a("stream.codex.editedFilesCount",{count:e.length})}),d("button",{type:"button","data-codex-disclosure":"",onClick:()=>{h((n)=>!n),i(!1)},"aria-expanded":r,children:a(r?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),o("div",{className:"codex-edited-files-total",title:a("stream.codex.changedLines"),children:[o("span",{className:"codex-diff-additions",children:["+",s]}),o("span",{className:"codex-diff-deletions",children:["-",g]})]})]}),r&&o("div",{className:"codex-edited-files-list",children:[(c?e:e.slice(0,3)).map((n)=>o("div",{className:"codex-edited-file-row",children:[d("button",{type:"button",className:"codex-edited-file-path",title:n.path,onClick:()=>l===void 0?f(n.path):l(n),children:u===void 0?n.path:u(n)}),o("span",{className:"codex-edited-file-counts",children:[o("span",{className:"codex-diff-additions",children:["+",n.additions]}),o("span",{className:"codex-diff-deletions",children:["-",n.deletions]})]})]},n.path)),e.length>3&&o("button",{type:"button",className:"codex-edited-files-more","aria-expanded":c,onClick:()=>i((n)=>!n),children:[a(c?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),c?d(b,{size:16,"aria-hidden":"true"}):d(v,{size:16,"aria-hidden":"true"})]})]})]})}
3
+ export{at,he,st};
@@ -1 +1 @@
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 Et({...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 D({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 N({...e}){return t(n.SubmenuRoot,{"data-slot":"dropdown-menu-sub",...e})}function S({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 E({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 J({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 $e({...e}){return t(n.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...e})}function Ue({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 Rt({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,Et,b,m,y,D,w,N,S,E,J,$e,Ue,s,Rt};
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};
@@ -1 +1 @@
1
- import{cn as r}from"cn";import{jsx as d}from"react/jsx-runtime";function Ve({className:a,size:t="default",...o}){return d("div",{"data-slot":"card","data-size":t,className:r("group/card bg-card text-card-foreground ring-foreground/10 flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl py-(--card-spacing) text-sm shadow-xs ring-1 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...o})}function Ke({className:a,...t}){return d("div",{"data-slot":"card-header",className:r("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",a),...t})}function We({className:a,...t}){return d("div",{"data-slot":"card-title",className:r("font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",a),...t})}function qe({className:a,...t}){return d("div",{"data-slot":"card-description",className:r("text-muted-foreground text-sm",a),...t})}function Lt({className:a,...t}){return d("div",{"data-slot":"card-action",className:r("col-start-2 row-span-2 row-start-1 self-start justify-self-end",a),...t})}function Ge({className:a,...t}){return d("div",{"data-slot":"card-content",className:r("flex flex-col gap-3 px-(--card-spacing)",a),...t})}function je({className:a,...t}){return d("div",{"data-slot":"card-footer",className:r("flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)",a),...t})}export{Ve,Ke,We,qe,Lt,Ge,je};
1
+ import{cn as r}from"cn";import{jsx as d}from"react/jsx-runtime";function Pe({className:a,size:t="default",...o}){return d("div",{"data-slot":"card","data-size":t,className:r("group/card bg-card text-card-foreground ring-foreground/10 flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl py-(--card-spacing) text-sm shadow-xs ring-1 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...o})}function Ie({className:a,...t}){return d("div",{"data-slot":"card-header",className:r("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",a),...t})}function Me({className:a,...t}){return d("div",{"data-slot":"card-title",className:r("font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",a),...t})}function Ne({className:a,...t}){return d("div",{"data-slot":"card-description",className:r("text-muted-foreground text-sm",a),...t})}function Tt({className:a,...t}){return d("div",{"data-slot":"card-action",className:r("col-start-2 row-span-2 row-start-1 self-start justify-self-end",a),...t})}function Se({className:a,...t}){return d("div",{"data-slot":"card-content",className:r("flex flex-col gap-3 px-(--card-spacing)",a),...t})}function Ee({className:a,...t}){return d("div",{"data-slot":"card-footer",className:r("flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)",a),...t})}export{Pe,Ie,Me,Ne,Tt,Se,Ee};
@@ -1 +1 @@
1
- import{Switch as a}from"@base-ui/react/switch";import{cn as d}from"cn";import{jsx as e}from"react/jsx-runtime";function L({className:i,size:t="default",...r}){return e(a.Root,{"data-slot":"switch","data-size":t,className:d("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 aria-invalid:ring-3 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px]",i),...r,children:e(a.Thumb,{"data-slot":"switch-thumb",className:"bg-background dark:data-checked:bg-primary-foreground dark:data-unchecked:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0"})})}export{L};
1
+ import{Switch as a}from"@base-ui/react/switch";import{cn as d}from"cn";import{jsx as e}from"react/jsx-runtime";function I({className:i,size:t="default",...r}){return e(a.Root,{"data-slot":"switch","data-size":t,className:d("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 aria-invalid:ring-3 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px]",i),...r,children:e(a.Thumb,{"data-slot":"switch-thumb",className:"bg-background dark:data-checked:bg-primary-foreground dark:data-unchecked:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0"})})}export{I};
@@ -0,0 +1,2 @@
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};
@@ -0,0 +1,2 @@
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};
@@ -0,0 +1 @@
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};
@@ -1,2 +1,2 @@
1
- import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function Te({open:r,onOpenChange:a,trigger:i,children:t,...n}){return d(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100}),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t})})})]})}
2
- export{Te};
1
+ import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function ve({open:r,onOpenChange:a,trigger:i,children:t,...n}){return d(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100}),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t})})})]})}
2
+ export{ve};
@@ -1,2 +1,2 @@
1
- function Fe({container:i,target:f,clientX:e,clientY:n,currentScale:r,nextScale:s}){if(r<=0||s<=0)return null;let o=i.getBoundingClientRect(),t=f.getBoundingClientRect();if(t.width===0||t.height===0)return null;let h=e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom,l=h?(e-t.left)/t.width:0.5,a=h?(n-t.top)/t.height:0.5,c=t.width/r,g=t.height/r,m=c*s,u=g*s,d=e-o.left,p=n-o.top,P=i.scrollLeft+(t.left-o.left)+t.width/2,b=i.scrollTop+(t.top-o.top)+t.height/2,C=(l-0.5)*m,x=(a-0.5)*u;return{left:Math.max(0,P+C-d),top:Math.max(0,b+x-p)}}
2
- export{Fe};
1
+ function Ye({container:i,target:f,clientX:e,clientY:n,currentScale:r,nextScale:s}){if(r<=0||s<=0)return null;let o=i.getBoundingClientRect(),t=f.getBoundingClientRect();if(t.width===0||t.height===0)return null;let h=e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom,l=h?(e-t.left)/t.width:0.5,a=h?(n-t.top)/t.height:0.5,c=t.width/r,g=t.height/r,m=c*s,u=g*s,d=e-o.left,p=n-o.top,P=i.scrollLeft+(t.left-o.left)+t.width/2,b=i.scrollTop+(t.top-o.top)+t.height/2,C=(l-0.5)*m,x=(a-0.5)*u;return{left:Math.max(0,P+C-d),top:Math.max(0,b+x-p)}}
2
+ export{Ye};
@@ -0,0 +1,2 @@
1
+ var At=1e6,Ft=5000000;function Ze(_,e){return _+e>5000000}function Dt(_){return(_/1e6).toFixed(1)}var ae=5;
2
+ export{At,Ft,Ze,Dt,ae};
@@ -0,0 +1,2 @@
1
+ import{useCallback as f,useState as r}from"react";var t=new Map;function i(o,e,a=!1){let[p,S]=r(()=>({key:o,expanded:t.get(o)??e})),n=p.expanded;if(p.key!==o||a&&!t.has(o)&&n!==e)n=t.get(o)??e,S({key:o,expanded:n});let k=f((c)=>{S((s)=>{let b=s.key===o?s.expanded:t.get(o)??e,d=typeof c==="function"?c(b):c;return t.set(o,d),s.key===o?{key:o,expanded:d}:s})},[o,e]);return[n,k]}
2
+ export{i};