@alwith/module-chat 0.1.29 → 0.1.31

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 (110) hide show
  1. package/dist/activity-host.js +1 -1
  2. package/dist/approval/choice-elicitation-form.js +1 -1
  3. package/dist/approval/permission-view.js +1 -1
  4. package/dist/approval/schema-elicitation-form.js +1 -1
  5. package/dist/approval/url-elicitation-card.js +1 -1
  6. package/dist/chunk-0m271xz8.js +1 -0
  7. package/dist/chunk-1hy64ewz.js +1 -0
  8. package/dist/chunk-1twg3evk.js +1 -0
  9. package/dist/chunk-2r04c28x.js +2 -0
  10. package/dist/chunk-3dr41azp.js +2 -0
  11. package/dist/chunk-54h8srdy.js +1 -0
  12. package/dist/chunk-6f7mdmsp.js +2 -0
  13. package/dist/chunk-7n3ege46.js +2 -0
  14. package/dist/chunk-8r6388q9.js +2 -0
  15. package/dist/{chunk-kzccs8ak.js → chunk-arge74eh.js} +2 -2
  16. package/dist/chunk-bf5fh35b.js +2 -0
  17. package/dist/chunk-bwzjm3g8.js +1 -0
  18. package/dist/chunk-d0ptk8x8.js +1 -0
  19. package/dist/chunk-dj8v2w6n.js +1 -0
  20. package/dist/{chunk-swg5v7sg.js → chunk-g77gammg.js} +2 -2
  21. package/dist/chunk-kscn218z.js +1 -0
  22. package/dist/chunk-pk9khgvs.js +2 -0
  23. package/dist/chunk-qmbekvg9.js +2 -0
  24. package/dist/chunk-qwe4sfh0.js +1 -0
  25. package/dist/chunk-r125b0z5.js +2 -0
  26. package/dist/chunk-s365bfbf.js +1 -0
  27. package/dist/chunk-sepy631p.js +1 -0
  28. package/dist/chunk-tygbx698.js +7 -0
  29. package/dist/chunk-vq236zge.js +1 -0
  30. package/dist/chunk-w5mg77ac.js +2 -0
  31. package/dist/chunk-wjejhpgw.js +1 -0
  32. package/dist/chunk-wjqqh1d4.js +1 -0
  33. package/dist/chunk-x3jp5bsh.js +3 -0
  34. package/dist/chunk-xhkt2dhz.js +2 -0
  35. package/dist/chunk-zt7a6b1m.js +1 -0
  36. package/dist/chunk-zy5cq9m3.js +2 -0
  37. package/dist/codex/activity-group.js +1 -1
  38. package/dist/codex/assistant-message.js +2 -2
  39. package/dist/codex/async-question-card.js +2 -2
  40. package/dist/codex/edited-files-card.js +1 -1
  41. package/dist/codex/image-view-activity.js +1 -1
  42. package/dist/codex/markdown-renderer.js +5 -5
  43. package/dist/codex/navigation-preview.js +1 -1
  44. package/dist/codex/navigation-rail.js +1 -1
  45. package/dist/codex/patch-view.js +2 -2
  46. package/dist/codex/plan.js +1 -1
  47. package/dist/codex/terminal-output.js +1 -1
  48. package/dist/codex/thread-virtualizer.js +1 -1
  49. package/dist/codex/user-message.js +1 -1
  50. package/dist/codex/virtualized-turn-list.js +1 -1
  51. package/dist/composer/completion-filter.js +1 -1
  52. package/dist/composer/completion-menu.js +3 -3
  53. package/dist/composer/effort-slider.js +1 -1
  54. package/dist/composer/menu-radio.js +1 -1
  55. package/dist/composer/model-select.js +1 -1
  56. package/dist/composer/permission-mode-select.js +1 -1
  57. package/dist/composer/prompt-input-attachments.js +1 -1
  58. package/dist/composer/prompt-input-context.js +1 -1
  59. package/dist/composer/prompt-input-textarea.js +2 -2
  60. package/dist/composer/prompt-input.js +1 -1
  61. package/dist/image-lightbox.js +1 -1
  62. package/dist/image-preview-dialog.js +1 -1
  63. package/dist/search/chat-search.js +1 -1
  64. package/dist/search/find-bar.js +1 -1
  65. package/dist/ui/button.js +1 -1
  66. package/dist/ui/card.js +1 -1
  67. package/dist/ui/checkbox.js +1 -1
  68. package/dist/ui/dialog.js +1 -1
  69. package/dist/ui/dropdown-menu.js +1 -1
  70. package/dist/ui/field.js +1 -1
  71. package/dist/ui/hover-card.js +1 -1
  72. package/dist/ui/input-group-textarea.js +1 -1
  73. package/dist/ui/input-group.js +1 -1
  74. package/dist/ui/input.js +1 -1
  75. package/dist/ui/label.js +1 -1
  76. package/dist/ui/radio-group.js +1 -1
  77. package/dist/ui/separator.js +1 -1
  78. package/dist/ui/switch.js +1 -1
  79. package/dist/ui/textarea.js +1 -1
  80. package/dist/ui/tooltip.js +1 -1
  81. package/package.json +3 -3
  82. package/dist/chunk-6x9vcfpg.js +0 -1
  83. package/dist/chunk-70sfgw0j.js +0 -2
  84. package/dist/chunk-74phx7h8.js +0 -2
  85. package/dist/chunk-7gh078gc.js +0 -2
  86. package/dist/chunk-7pr2j1zb.js +0 -1
  87. package/dist/chunk-8bdd6q4w.js +0 -2
  88. package/dist/chunk-8zs8vy0q.js +0 -1
  89. package/dist/chunk-awbgf3hp.js +0 -2
  90. package/dist/chunk-ax9ganqr.js +0 -2
  91. package/dist/chunk-dekjd5sf.js +0 -2
  92. package/dist/chunk-etvhn65g.js +0 -2
  93. package/dist/chunk-f20xh0z9.js +0 -1
  94. package/dist/chunk-ghfbzhnb.js +0 -1
  95. package/dist/chunk-gycty1x1.js +0 -2
  96. package/dist/chunk-hy1x2td2.js +0 -2
  97. package/dist/chunk-jnx3t913.js +0 -2
  98. package/dist/chunk-k1c0jrk1.js +0 -1
  99. package/dist/chunk-kj1wrn2j.js +0 -1
  100. package/dist/chunk-m8gejgjs.js +0 -1
  101. package/dist/chunk-pnncsvbz.js +0 -1
  102. package/dist/chunk-r9k7kszp.js +0 -1
  103. package/dist/chunk-rka1mc9r.js +0 -1
  104. package/dist/chunk-s0nhgptn.js +0 -1
  105. package/dist/chunk-s28x10qd.js +0 -1
  106. package/dist/chunk-skx67pc6.js +0 -2
  107. package/dist/chunk-v4p0qwmj.js +0 -1
  108. package/dist/chunk-wc3patey.js +0 -7
  109. package/dist/chunk-wtkv29ba.js +0 -1
  110. package/dist/chunk-ynga7fm4.js +0 -3
@@ -1 +1 @@
1
- import{wt,t,u}from"./chunk-gycty1x1.js";export{wt as ActivityHostProvider,u as ActivityMarkdown,t as useActivityHost};
1
+ import{wt,t,u}from"./chunk-8r6388q9.js";export{wt as ActivityHostProvider,u as ActivityMarkdown,t as useActivityHost};
@@ -1 +1 @@
1
- import{Ae}from"../chunk-341yykkp.js";import{e}from"../chunk-7pr2j1zb.js";import{w}from"../chunk-v4p0qwmj.js";import{l}from"../chunk-m8gejgjs.js";import{r}from"../chunk-pnncsvbz.js";import{c,a}from"../chunk-rka1mc9r.js";import{o}from"../chunk-r9k7kszp.js";import{Ce,X,h,F}from"../chunk-yk52gm8x.js";import{autoUpdate as W}from"@floating-ui/dom";import{cn as _}from"cn";import{useCallback as I,useEffect as z,useLayoutEffect as D,useMemo as j,useRef as K,useState as L}from"react";import{createPortal as J}from"react-dom";import{jsxDEV as s}from"react/jsx-dev-runtime";var v="__other__";function ce({current:m,total:q,anchorRef:E,t:x,onAccept:B,onDecline:H}){let S=j(()=>m?Ce(m.requestedSchema):[],[m]),[T,k]=L({}),P=K(null);z(()=>{if(m?.elicitationId===void 0)return;let t={};for(let{key:u,property:n}of S)if(!h(n)){let p=F(n)[0];if(p)t[u]={selected:p.value}}k(t)},[m?.elicitationId,S]),z(()=>{if(m?.elicitationId!==void 0&&P.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")P.current.focus()},[m?.elicitationId]);let[C,M]=L(null),[Q,G]=L(null),U=I(()=>{let t=E.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})},[E]);D(()=>{if(!m)return;let t=0,u=()=>{if(E.current){U();return}t=requestAnimationFrame(u)};return u(),()=>cancelAnimationFrame(t)},[m,U,E]),D(()=>{let t=E.current;if(!m||!t||!Q)return;return W(t,Q,U,{animationFrame:!0})},[m,Q,E,U]);let R=j(()=>{if(!m)return!1;for(let{key:t,property:u}of S){let n=T[t];if(!n)return!1;if(h(u)){if(!n.selectedSet||n.selectedSet.size===0)return!1;if(n.selectedSet.has(v)&&!n.otherText?.trim())return!1}else{if(!n.selected)return!1;if(n.selected===v&&!n.otherText?.trim())return!1}}return!0},[m,S,T]),V=I(async()=>{if(!m)return;if(!R)return;let t={},u={};for(let{key:n,property:p}of S){let f=T[n];if(!f)continue;let b;if(h(p))t[n]=[...f.selectedSet??[]].map((g)=>g===v?(f.otherText??"").trim():g).filter(Boolean);else{let g=f.selected??"";if(t[n]=g===v?(f.otherText??"").trim():g,g!==v)b=F(p).find((i)=>i.value===g)?.preview}let N=f.notes?.trim();if(b||N)u[n]={...b&&{preview:b},...N&&{notes:N}}}await B(m.elicitationId,t,u)},[m,S,T,R,B]),O=I(async()=>{if(m)await H(m.elicitationId)},[m,H]);if(!m||!C)return null;return J(s("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(t)=>{if(t.key==="Escape")t.preventDefault(),O()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left:C.left,width:C.width,bottom:C.bottom,maxHeight:"70vh"},ref:(t)=>{P.current=t,G(t)},children:[s("div",{className:"border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",children:[s("div",{className:"text-foreground text-sm font-medium",children:x("askUserQuestion.title")},void 0,!1,void 0,this),q>1&&s("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${q}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s("div",{className:"min-h-0 flex-1 overflow-y-auto",children:s("div",{className:"space-y-4 px-3 py-3",children:S.map(({key:t,property:u},n)=>{let p=T[t],f=p?.selected,b=p?.selectedSet??new Set,N=F(u),g=h(u);return s("div",{className:"space-y-2",children:[s("div",{className:"flex items-center gap-2",children:[s(Ae,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:X(u).title??t},void 0,!1,void 0,this),s("div",{className:"text-foreground text-sm font-medium",children:X(u).description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),g?s("div",{className:"space-y-1.5 ps-1",children:[N.map((i)=>s("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[s(w,{checked:b.has(i.value),onCheckedChange:(d)=>{k((y)=>{let A=new Set(y[t]?.selectedSet??new Set);if(d)A.add(i.value);else A.delete(i.value);return{...y,[t]:{...y[t],selectedSet:A}}})}},void 0,!1,void 0,this),s("div",{className:"min-w-0 flex-1",children:[s("div",{className:"text-foreground text-sm",children:i.label},void 0,!1,void 0,this),i.description&&s("div",{className:"text-muted-foreground text-xs",children:i.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},i.value,!0,void 0,this)),s("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[s(w,{checked:b.has(v),onCheckedChange:(i)=>{k((d)=>{let y=new Set(d[t]?.selectedSet??new Set);if(i)y.add(v);else y.delete(v);return{...d,[t]:{...d[t],selectedSet:y}}})}},void 0,!1,void 0,this),s("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:x("askUserQuestion.other")},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b.has(v)&&s("div",{className:"ps-7",children:s(l,{placeholder:x("askUserQuestion.otherPlaceholder"),value:p?.otherText??"",onChange:(i)=>k((d)=>({...d,[t]:{...d[t],otherText:i.target.value}}))},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):s(c,{value:f??"",onValueChange:(i)=>k((d)=>({...d,[t]:{...d[t],selected:i}})),className:"space-y-1.5 ps-1",children:[N.map((i)=>{let d=`${n}:${i.value}`;return s("div",{className:_("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",f===i.value&&"bg-muted/60"),children:[s(a,{value:i.value,id:d},void 0,!1,void 0,this),s(r,{htmlFor:d,className:"min-w-0 flex-1 cursor-pointer",children:[s("div",{className:"text-foreground text-sm font-normal",children:i.label},void 0,!1,void 0,this),i.description&&s("div",{className:"text-muted-foreground text-xs font-normal",children:i.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},i.value,!0,void 0,this)}),s("div",{className:_("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",f===v&&"bg-muted/60"),children:[s(a,{value:v,id:`${n}:other`,className:"mt-0.5"},void 0,!1,void 0,this),s(r,{htmlFor:`${n}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:x("askUserQuestion.other")},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f===v&&s("div",{className:"ps-7",children:s(l,{placeholder:x("askUserQuestion.otherPlaceholder"),value:p?.otherText??"",onChange:(i)=>k((d)=>({...d,[t]:{...d[t],otherText:i.target.value}}))},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!g&&f&&f!==v&&(()=>{let i=N.find((d)=>d.value===f)?.preview;if(!i)return null;return s("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:i},void 0,!1,void 0,this)})(),N.some((i)=>i.preview)&&s(o,{placeholder:x("askUserQuestion.notesPlaceholder"),value:p?.notes??"",onChange:(i)=>k((d)=>({...d,[t]:{...d[t],notes:i.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"},void 0,!1,void 0,this)]},t,!0,void 0,this)})},void 0,!1,void 0,this)},void 0,!1,void 0,this),s("div",{className:"border-border bg-card flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2",children:[s(e,{variant:"ghost",size:"sm",onClick:()=>void O(),children:x("askUserQuestion.cancel")},void 0,!1,void 0,this),s(e,{size:"sm",disabled:!R,onClick:()=>void V(),children:x("askUserQuestion.submit")},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),document.body)}export{ce as ChoiceElicitationForm};
1
+ import{Ae}from"../chunk-341yykkp.js";import{e}from"../chunk-wjejhpgw.js";import{w}from"../chunk-dj8v2w6n.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{Ce,X,h,F}from"../chunk-yk52gm8x.js";import{autoUpdate as K}from"@floating-ui/dom";import{cn as z}from"cn";import{useCallback as L,useEffect as D,useLayoutEffect as j,useMemo as G,useRef as J,useState as q}from"react";import{createPortal as Y}from"react-dom";import{jsx as i,jsxs as p}from"react/jsx-runtime";var v="__other__";function me({current:m,total:B,anchorRef:T,t:b,onAccept:H,onDecline:M}){let k=G(()=>m?Ce(m.requestedSchema):[],[m]),[C,y]=q({}),Q=J(null);D(()=>{if(m?.elicitationId===void 0)return;let t={};for(let{key:u,property:n}of k)if(!h(n)){let g=F(n)[0];if(g)t[u]={selected:g.value}}y(t)},[m?.elicitationId,k]),D(()=>{if(m?.elicitationId!==void 0&&Q.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")Q.current.focus()},[m?.elicitationId]);let[U,O]=q(null),[R,V]=q(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);O({left:(window.innerWidth-n)/2,width:n,bottom:24});return}O({left:u.left,width:u.width,bottom:window.innerHeight-u.bottom+20})},[T]);j(()=>{if(!m)return;let t=0,u=()=>{if(T.current){P();return}t=requestAnimationFrame(u)};return u(),()=>cancelAnimationFrame(t)},[m,P,T]),j(()=>{let t=T.current;if(!m||!t||!R)return;return K(t,R,P,{animationFrame:!0})},[m,R,T,P]);let A=G(()=>{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(v)&&!n.otherText?.trim())return!1}else{if(!n.selected)return!1;if(n.selected===v&&!n.otherText?.trim())return!1}}return!0},[m,k,C]),W=L(async()=>{if(!m)return;if(!A)return;let t={},u={};for(let{key:n,property:g}of k){let f=C[n];if(!f)continue;let N;if(h(g))t[n]=[...f.selectedSet??[]].map((x)=>x===v?(f.otherText??"").trim():x).filter(Boolean);else{let x=f.selected??"";if(t[n]=x===v?(f.otherText??"").trim():x,x!==v)N=F(g).find((s)=>s.value===x)?.preview}let S=f.notes?.trim();if(N||S)u[n]={...N&&{preview:N},...S&&{notes:S}}}await H(m.elicitationId,t,u)},[m,k,C,A,H]),_=L(async()=>{if(m)await M(m.elicitationId)},[m,M]);if(!m||!U)return null;return Y(p("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(t)=>{if(t.key==="Escape")t.preventDefault(),_()},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,V(t)},children:[p("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:b("askUserQuestion.title")}),B>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${B}`})]}),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 g=C[t],f=g?.selected,N=g?.selectedSet??new Set,S=F(u),x=h(u);return p("div",{className:"space-y-2",children:[p("div",{className:"flex items-center gap-2",children:[i(Ae,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:X(u).title??t}),i("div",{className:"text-foreground text-sm font-medium",children:X(u).description})]}),x?p("div",{className:"space-y-1.5 ps-1",children:[S.map((s)=>p("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[i(w,{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}}})}}),p("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)),p("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[i(w,{checked:N.has(v),onCheckedChange:(s)=>{y((d)=>{let E=new Set(d[t]?.selectedSet??new Set);if(s)E.add(v);else E.delete(v);return{...d,[t]:{...d[t],selectedSet:E}}})}}),i("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:b("askUserQuestion.other")})]}),N.has(v)&&i("div",{className:"ps-7",children:i(l,{placeholder:b("askUserQuestion.otherPlaceholder"),value:g?.otherText??"",onChange:(s)=>y((d)=>({...d,[t]:{...d[t],otherText:s.target.value}}))})})]}):p(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 p("div",{className:z("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}),p(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)}),p("div",{className:z("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",f===v&&"bg-muted/60"),children:[i(a,{value:v,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:b("askUserQuestion.other")})]}),f===v&&i("div",{className:"ps-7",children:i(l,{placeholder:b("askUserQuestion.otherPlaceholder"),value:g?.otherText??"",onChange:(s)=>y((d)=>({...d,[t]:{...d[t],otherText:s.target.value}}))})})]}),!x&&f&&f!==v&&(()=>{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:b("askUserQuestion.notesPlaceholder"),value:g?.notes??"",onChange:(s)=>y((d)=>({...d,[t]:{...d[t],notes:s.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"})]},t)})})}),p("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 _(),children:b("askUserQuestion.cancel")}),i(e,{size:"sm",disabled:!A,onClick:()=>void W(),children:b("askUserQuestion.submit")})]})]}),document.body)}export{me as ChoiceElicitationForm};
@@ -1 +1 @@
1
- import{Te}from"../chunk-darkfx1b.js";import{autoUpdate as O}from"@floating-ui/dom";import{cn as k}from"cn";import{CheckCheckIcon as L,CheckIcon as _,ShieldXIcon as M,XIcon as V}from"lucide-react";import{useCallback as F,useEffect as I,useId as H,useLayoutEffect as N,useRef as T,useState as p}from"react";import{createPortal as S}from"react-dom";import{jsxDEV as i}from"react/jsx-dev-runtime";var z={allow_once:{icon:_},allow_always:{icon:L},reject_once:{icon:V},reject_always:{icon:M}};function Q({requestId:u,options:h,title:D,children:E,total:f=1,alwaysLabel:P="always",autoFocus:w="always",anchorRef:n,onRespond:r}){let y=H(),[a,b]=p(0),[s,g]=p(null),[l,j]=p(null),x=T(null),c=Te(h);I(()=>{b(0)},[u]),I(()=>{let e=document.activeElement;if(w==="always"||e===null||e===document.body)x.current?.focus()},[u,l,w]);let d=F(()=>{let e=n?.current;if(!e)return;let t=e.getBoundingClientRect();if(t.width===0){let o=Math.min(640,window.innerWidth*0.9);g({left:(window.innerWidth-o)/2,width:o,bottom:24});return}g({left:t.left,width:t.width,bottom:window.innerHeight-t.bottom+20})},[n]);if(N(()=>{if(!n)return;let e=0,t=()=>{if(n.current)d();else e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)},[u,n,d]),N(()=>{let e=n?.current;if(!e||!l)return;return O(e,l,d,{animationFrame:!0})},[n,l,d]),n&&!s)return null;let v=i("div",{ref:j,"data-overlay":"permission-request",className:k("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:[i("div",{className:"border-border border-b px-3 py-2",children:[i("div",{className:"flex items-center justify-between gap-2",children:[i("div",{id:y,className:"text-foreground text-sm font-medium",children:D},void 0,!1,void 0,this),f>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${f}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),E]},void 0,!0,void 0,this),i("div",{role:"listbox","aria-labelledby":y,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(),b((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",A=z[o]?.icon??_,C=o==="allow_always"||o==="reject_always",K=o==="reject_once"||o==="reject_always";return i("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:k("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",K&&t!==a&&"text-muted-foreground"),children:[i("span",{className:"min-w-3 text-xs opacity-70",children:t+1},void 0,!1,void 0,this),i(A,{className:"size-3.5 shrink-0 opacity-80"},void 0,!1,void 0,this),i("span",{className:"min-w-0 flex-1 truncate",children:e.name},void 0,!1,void 0,this),C&&i("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[10px] tracking-wide uppercase",children:P},void 0,!1,void 0,this)]},e.optionId,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return n?S(v,document.body):v}export{Q as PermissionView};
1
+ import{Te}from"../chunk-darkfx1b.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=Te(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-7pr2j1zb.js";import{w}from"../chunk-v4p0qwmj.js";import{E,R,qe,Ge,L,je}from"../chunk-s0nhgptn.js";import{r}from"../chunk-pnncsvbz.js";import"../chunk-8zs8vy0q.js";import{Z,Y,Fe,De,He,D}from"../chunk-k1c0jrk1.js";import{l}from"../chunk-m8gejgjs.js";import{c,a}from"../chunk-rka1mc9r.js";import{S}from"../chunk-s28x10qd.js";import{o}from"../chunk-r9k7kszp.js";import{isArrayProperty as O,isBooleanProperty as A,isNumberProperty as C,isStringProperty as N}from"@alwith/api";import{useEffect as V,useMemo as q,useState as P}from"react";import{jsxDEV as i}from"react/jsx-dev-runtime";function G(u){if(!N(u))return null;if(u.oneOf&&u.oneOf.length>0)return u.oneOf.map((t)=>({value:t.const,label:t.title??t.const,...t.description?{description:t.description}:{}}));if(u.enum&&u.enum.length>0)return u.enum.map((t)=>({value:t,label:t}));return null}function I(u){let t=u,s=t._meta?.alwith?.options;if(Array.isArray(s)&&Array.isArray(t.enum))return s.map((n)=>({value:n.const,label:n.title,...n.description?{description:n.description}:{}}));if(Array.isArray(t.enum))return t.enum.map((n)=>({value:String(n),label:String(n)}));if(Array.isArray(t.oneOf))return t.oneOf.map((n)=>({value:n.const,label:n.title,...n.description?{description:n.description}:{}}));return null}function B(u){let t=new Set(u.required??[]);return Object.entries(u.properties??{}).map(([s,n])=>({key:s,property:n,title:n.title??s,description:n.description??null,required:t.has(s),options:G(n),multiOptions:O(n)?I(n.items):null}))}function x(u){let t={};for(let s of u){let n=s.property.default;if(n!==void 0&&n!==null)t[s.key]=n;else if(s.options)t[s.key]=s.options[0].value;else if(A(s.property))t[s.key]=!1;else if(O(s.property))t[s.key]=[]}return t}function K(u,t){if(u.multiOptions)return Array.isArray(t)&&t.length>0;if(!u.required)return!0;return t!==void 0&&t!==""&&!(Array.isArray(t)&&t.length===0)}function k({id:u,label:t,description:s,control:n}){return i("div",{className:"hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",children:[n,i(r,{htmlFor:u,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[i("div",{className:"text-foreground text-sm",children:t},void 0,!1,void 0,this),s&&i("div",{className:"text-muted-foreground text-xs",children:s},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function T({id:u,field:t,value:s,onChange:n}){if(t.multiOptions){let m=new Set(Array.isArray(s)?s:[]);return i(Z,{children:[i(Y,{variant:"label",children:t.title},void 0,!1,void 0,this),t.description&&i(D,{children:t.description},void 0,!1,void 0,this),i("div",{className:"flex flex-col gap-1",children:t.multiOptions.map((p)=>{let f=`${u}:${p.value}`;return i(k,{id:f,...p,control:i(w,{id:f,checked:m.has(p.value),onCheckedChange:(y)=>{let g=new Set(m);if(y)g.add(p.value);else g.delete(p.value);n([...g])}},void 0,!1,void 0,this)},p.value,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}if(t.options)return i(Z,{children:[i(Y,{variant:"label",children:t.title},void 0,!1,void 0,this),t.description&&i(D,{children:t.description},void 0,!1,void 0,this),i(c,{value:typeof s==="string"?s:"",onValueChange:(m)=>n(String(m)),className:"flex flex-col gap-1",children:t.options.map((m)=>{let p=`${u}:${m.value}`;return i(k,{id:p,...m,control:i(a,{value:m.value,id:p},void 0,!1,void 0,this)},m.value,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return i(De,{children:[i(He,{htmlFor:u,children:t.title},void 0,!1,void 0,this),A(t.property)?i(S,{id:u,checked:s===!0,onCheckedChange:(m)=>n(m)},void 0,!1,void 0,this):C(t.property)?i(l,{id:u,type:"number",required:t.required,value:typeof s==="number"?s:"",onChange:(m)=>n(m.target.value===""?void 0:Number(m.target.value))},void 0,!1,void 0,this):i(o,{id:u,rows:2,required:t.required,value:typeof s==="string"?s:"",onChange:(m)=>n(m.target.value)},void 0,!1,void 0,this),t.description&&i(D,{children:t.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function te({requestId:u,schema:t,message:s,total:n,t:m,onRespond:p}){let f=q(()=>B(t),[t]),[y,g]=P(()=>x(f));V(()=>g(x(f)),[u,f]);let v=f.every((d)=>K(d,y[d.key])),b=()=>{if(!v)return;let d={};for(let[h,F]of Object.entries(y))if(F!==void 0)d[h]=F;p({action:"accept",content:d})};return i(E,{open:!0,onOpenChange:(d)=>!d&&p({action:"cancel"}),children:i(R,{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(),b()},children:[i(qe,{children:[i("div",{className:"flex items-center justify-between gap-2 pe-8",children:[i(L,{children:t.title??m("approval.needed")},void 0,!1,void 0,this),n>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${n}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),i(je,{children:s},void 0,!1,void 0,this)]},void 0,!0,void 0,this),i("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i(Fe,{children:f.map((d)=>i(T,{id:`${u}:${d.key}`,field:d,value:y[d.key],onChange:(h)=>g((F)=>({...F,[d.key]:h}))},d.key,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this),i(Ge,{children:[i(e,{variant:"ghost",onClick:()=>p({action:"decline"}),children:m("actions.decline")},void 0,!1,void 0,this),i(e,{disabled:!v,onClick:b,children:m("actions.submit")},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}export{te as SchemaElicitationForm,B as elicitationFields,x as initialValues,K as isAnswered};
1
+ import{e}from"../chunk-wjejhpgw.js";import{w}from"../chunk-dj8v2w6n.js";import{E,R,qe,Ge,L,je}from"../chunk-qwe4sfh0.js";import{r}from"../chunk-bwzjm3g8.js";import"../chunk-wjqqh1d4.js";import{Z,Y,Fe,De,He,D}from"../chunk-54h8srdy.js";import{l}from"../chunk-1hy64ewz.js";import{c,a}from"../chunk-zt7a6b1m.js";import{S}from"../chunk-kscn218z.js";import{o}from"../chunk-d0ptk8x8.js";import{isArrayProperty as A,isBooleanProperty as C,isNumberProperty as N,isStringProperty as V}from"@alwith/api";import{useEffect as q,useMemo as P,useState as G}from"react";import{jsx as u,jsxs as f}from"react/jsx-runtime";function I(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 B(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 K(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:I(i),multiOptions:A(i)?B(i.items):null}))}function k(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 T(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 O({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 j({id:s,field:t,value:n,onChange:i}){if(t.multiOptions){let m=new Set(Array.isArray(n)?n:[]);return f(Z,{children:[u(Y,{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(O,{id:g,...p,control:u(w,{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(Z,{children:[u(Y,{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(O,{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(S,{id:s,checked:n===!0,onCheckedChange:(m)=>i(m)}):N(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=P(()=>K(t),[t]),[F,y]=G(()=>k(g));q(()=>y(k(g)),[s,g]);let b=g.every((d)=>T(d,F[d.key])),x=()=>{if(!b)return;let d={};for(let[h,v]of Object.entries(F))if(v!==void 0)d[h]=v;p({action:"accept",content:d})};return u(E,{open:!0,onOpenChange:(d)=>!d&&p({action:"cancel"}),children:f(R,{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(),x()},children:[f(qe,{children:[f("div",{className:"flex items-center justify-between gap-2 pe-8",children:[u(L,{children:t.title??m("approval.needed")}),i>1&&u("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${i}`})]}),u(je,{children:n})]}),u("div",{className:"min-h-0 flex-1 overflow-y-auto",children:u(Fe,{children:g.map((d)=>u(j,{id:`${s}:${d.key}`,field:d,value:F[d.key],onChange:(h)=>y((v)=>({...v,[d.key]:h}))},d.key))})}),f(Ge,{children:[u(e,{variant:"ghost",onClick:()=>p({action:"decline"}),children:m("actions.decline")}),u(e,{disabled:!b,onClick:x,children:m("actions.submit")})]})]})})}export{ie as SchemaElicitationForm,K as elicitationFields,k as initialValues,T as isAnswered};
@@ -1 +1 @@
1
- import{e}from"../chunk-7pr2j1zb.js";import{Pe,Ie,Me,Ne,Se,Ee}from"../chunk-f20xh0z9.js";import{ExternalLinkIcon as l}from"lucide-react";import{jsxDEV as a}from"react/jsx-dev-runtime";function p({message:o,url:r,t:i,onOpen:t,onRespond:n}){return a(Pe,{size:"sm",children:[a(Ie,{children:[a(Ne,{children:i("approval.needed")},void 0,!1,void 0,this),a(Me,{children:o},void 0,!1,void 0,this)]},void 0,!0,void 0,this),a(Se,{children:a("div",{className:"flex flex-col gap-3",children:[a(e,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>void t(r),children:[a(l,{"data-icon":"inline-start"},void 0,!1,void 0,this),i("approval.openLink")]},void 0,!0,void 0,this),a("p",{className:"text-muted-foreground text-sm",children:i("approval.waitingForLink")},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),a(Ee,{className:"flex flex-wrap gap-2",children:[a(e,{variant:"outline",size:"sm",onClick:()=>n("decline"),children:i("actions.decline")},void 0,!1,void 0,this),a(e,{variant:"ghost",size:"sm",onClick:()=>n("cancel"),children:i("actions.cancel")},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}export{p as UrlElicitationCard};
1
+ import{e}from"../chunk-wjejhpgw.js";import{Pe,Ie,Me,Ne,Se,Ee}from"../chunk-sepy631p.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};
@@ -0,0 +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 v({...e}){return t(n.Root,{"data-slot":"dropdown-menu",...e})}function Et({...e}){return t(n.Portal,{"data-slot":"dropdown-menu-portal",...e})}function x({...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 b({...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 y({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 P({...e}){return t(n.SubmenuRoot,{"data-slot":"dropdown-menu-sub",...e})}function I({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 M({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 Oe({...e}){return t(n.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...e})}function Be({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{v,Et,x,m,b,H,y,P,I,M,J,Oe,Be,s,Rt};
@@ -0,0 +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 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};
@@ -0,0 +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 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};
@@ -0,0 +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};
@@ -0,0 +1,2 @@
1
+ import{Ye}from"./chunk-qj8r5xvx.js";import{E,We,R,L}from"./chunk-qwe4sfh0.js";import{cn as v}from"cn";import{XIcon as _}from"lucide-react";import{useCallback as p,useEffect as D,useMemo as j,useRef as N,useState as b}from"react";import{jsx as i,jsxs as A}from"react/jsx-runtime";function Ke({open:l,onOpenChange:y,url:h,filename:M,scale:d,onScaleChange:f,containerRef:z,containerClassName:H,dialogContentClassName:P,imageClassName:T}){let g=p((e)=>Math.min(4,Math.max(0.25,e)),[]),[I,O]=b(1),o=g(d??I),W=N(null),s=z??W,S=N(null),[m,x]=b({width:0,height:0}),[C,Z]=b({width:0,height:0}),w=p((e)=>{let n=g(e);if(typeof f==="function"){f(n);return}O(n)},[f,g]);D(()=>{if(!l)return;if(!h)return;if(typeof d==="number")return;O(1)},[l,h,d]),D(()=>{if(!l)return;let e=s.current;if(!e)return;let n=()=>{x({width:e.clientWidth,height:e.clientHeight})};n();let t=new ResizeObserver(n);return t.observe(e),()=>{t.disconnect()}},[s,l]);let k=p(()=>{w(1)},[w]),r=j(()=>{let{width:e,height:n}=C,{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,X=n*c;return{width:u*o,height:X*o}},[o,C,m]);if(!h)return null;return i(E,{open:l,onOpenChange:y,children:A(R,{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]!",P),showCloseButton:!1,children:[i(L,{className:"sr-only",children:M||"Image preview"}),i(We,{"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(_,{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=S.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",H),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:M||"image preview",className:v("block object-contain select-none",T),decoding:"async",draggable:!1,ref:S,onDoubleClick:k,onLoad:(e)=>{let n=e.currentTarget;Z({width:n.naturalWidth,height:n.naturalHeight});let t=s.current;if(t&&(t.clientWidth||t.clientHeight))x({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{Ke};
@@ -0,0 +1 @@
1
+ import{r}from"./chunk-bwzjm3g8.js";import{N}from"./chunk-wjqqh1d4.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 Z({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 Y({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 It({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 Mt({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 Nt({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(N,{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 St({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{Z,Y,Fe,De,It,He,Mt,D,Nt,St};
@@ -0,0 +1,2 @@
1
+ import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function ke({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{ke};
@@ -0,0 +1,2 @@
1
+ import{Oe,Be}from"./chunk-0m271xz8.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(Oe,{value:i,onValueChange:(e)=>o(String(e)),children:d.map((e)=>a(Be,{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
+ export{n};
@@ -0,0 +1,2 @@
1
+ import{createContext as r,useContext as s}from"react";import{jsx as i}from"react/jsx-runtime";var n=r(null);function wt({host:o,children:e}){return i(n.Provider,{value:o,children:e})}function t(){let o=s(n);if(o===null)throw Error("Activity host is missing");return o}function u(o){let{Markdown:e}=t();return i(e,{...o})}
2
+ export{wt,t,u};
@@ -1,2 +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 xt(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,xt};
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};
@@ -0,0 +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 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 @@
1
+ import{cn as a}from"cn";import{jsx as o}from"react/jsx-runtime";function r({className:e,...t}){return o("label",{"data-slot":"label",className:a("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}export{r};
@@ -0,0 +1 @@
1
+ import{cn as i}from"cn";import{jsx as a}from"react/jsx-runtime";function o({className:r,...e}){return a("textarea",{"data-slot":"textarea",className:i("border-input 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 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm",r),...e})}export{o};
@@ -0,0 +1 @@
1
+ import{Checkbox as i}from"@base-ui/react/checkbox";import{cn as o}from"cn";import{CheckIcon as t}from"lucide-react";import{jsx as e}from"react/jsx-runtime";function w({className:r,...a}){return e(i.Root,{"data-slot":"checkbox",className:o("peer border-input group-has-[:focus-visible]/field-label:not-data-checked:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",r),...a,children:e(i.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:e(t,{})})})}export{w};
@@ -1,2 +1,2 @@
1
- var vt=280;function pe({entries:i,gapPx:t,measuredHeightsByKey:o,leadingInsetPx:e=0}){let n=[],r=[],d=new Map,s=[],u=e;for(let[x,a]of i.entries()){d.set(a.turnKey,x);for(let h of a.aliases??[])d.set(h,x);s.push(a.turnKey),r.push(u);let f=a.aliases?.map((h)=>o[h]).find((h)=>h!==void 0),m=o[a.turnKey]??f??a.estimatedHeightPx??280;if(n.push(m),u+=m,x<i.length-1)u+=t}return{bottomOffsetsPx:r.map((x,a)=>{let f=n[a];if(f===void 0)throw Error(`Codex turn height is missing at index ${a}`);return u-x-f}),heightsPx:n,topOffsetsPx:r,totalHeightPx:u,turnIndexByKey:d,turnKeys:s}}function g({distanceFromBottomPx:i,layout:t,overscanCount:o,viewportHeightPx:e}){if(t.turnKeys.length===0)return{startIndex:0,endIndex:0};let n=Math.min(Math.max(0,i),t.totalHeightPx),r=Math.min(n+Math.max(0,e),t.totalHeightPx),d=l(t.bottomOffsetsPx,r),s=c(t.bottomOffsetsPx,t.heightsPx,n);return{startIndex:Math.max(0,d-o),endIndex:Math.min(t.turnKeys.length,Math.max(s,d+1)+o)}}function K({anchorKey:i,layout:t,previousRange:o}){let e=t.turnIndexByKey.get(i);if(e===void 0)return null;return{startIndex:e,endIndex:Math.min(t.turnKeys.length,e+o.endIndex-o.startIndex)}}function ge({anchorKey:i,distanceFromBottomPx:t,nextLayout:o,previousLayout:e}){let n=e.turnIndexByKey.get(i),r=o.turnIndexByKey.get(i);if(n===void 0||r===void 0)return null;let d=e.bottomOffsetsPx[n],s=e.heightsPx[n],u=o.bottomOffsetsPx[r],x=o.heightsPx[r];if(d===void 0||s===void 0||u===void 0||x===void 0)throw Error(`Codex turn geometry is missing: ${i}`);return Math.max(0,t+u+x-d-s)}function fe({layout:i,turnKey:t,viewportHeightPx:o}){let e=i.turnIndexByKey.get(t);if(e===void 0)return null;let n=i.bottomOffsetsPx[e],r=i.heightsPx[e];if(n===void 0||r===void 0)throw Error(`Codex turn geometry is missing: ${t}`);return Math.max(0,n-o/2+r/2)}function he({align:i,layout:t,targetHeightPx:o,targetOffsetPx:e,turnKey:n,viewportHeightPx:r}){let d=t.turnIndexByKey.get(n);if(d===void 0)return null;let s=t.bottomOffsetsPx[d],u=t.heightsPx[d];if(s===void 0||u===void 0)throw Error(`Codex turn geometry is missing: ${n}`);let x=s+u-e;return i==="top"?Math.max(0,x-r+10):Math.max(0,x-o/2-r/2)}function l(i,t){let o=0,e=i.length;while(o<e){let n=Math.floor((o+e)/2),r=i[n];if(r===void 0)throw Error(`Codex bottom offset is missing at index ${n}`);if(r<t)e=n;else o=n+1}return o}function c(i,t,o){let e=0,n=i.length;while(e<n){let r=Math.floor((e+n)/2),d=i[r],s=t[r];if(d===void 0||s===void 0)throw Error(`Codex turn geometry is missing at index ${r}`);if(d+s<=o)n=r;else e=r+1}return e}
2
- export{vt,pe,g,K,ge,fe,he};
1
+ var xt=280;function pe({entries:i,gapPx:t,measuredHeightsByKey:o,leadingInsetPx:e=0}){let n=[],r=[],d=new Map,s=[],u=e;for(let[x,a]of i.entries()){d.set(a.turnKey,x);for(let h of a.aliases??[])d.set(h,x);s.push(a.turnKey),r.push(u);let f=a.aliases?.map((h)=>o[h]).find((h)=>h!==void 0),m=o[a.turnKey]??f??a.estimatedHeightPx??280;if(n.push(m),u+=m,x<i.length-1)u+=t}return{bottomOffsetsPx:r.map((x,a)=>{let f=n[a];if(f===void 0)throw Error(`Codex turn height is missing at index ${a}`);return u-x-f}),heightsPx:n,topOffsetsPx:r,totalHeightPx:u,turnIndexByKey:d,turnKeys:s}}function g({distanceFromBottomPx:i,layout:t,overscanCount:o,viewportHeightPx:e}){if(t.turnKeys.length===0)return{startIndex:0,endIndex:0};let n=Math.min(Math.max(0,i),t.totalHeightPx),r=Math.min(n+Math.max(0,e),t.totalHeightPx),d=l(t.bottomOffsetsPx,r),s=c(t.bottomOffsetsPx,t.heightsPx,n);return{startIndex:Math.max(0,d-o),endIndex:Math.min(t.turnKeys.length,Math.max(s,d+1)+o)}}function K({anchorKey:i,layout:t,previousRange:o}){let e=t.turnIndexByKey.get(i);if(e===void 0)return null;return{startIndex:e,endIndex:Math.min(t.turnKeys.length,e+o.endIndex-o.startIndex)}}function ge({anchorKey:i,distanceFromBottomPx:t,nextLayout:o,previousLayout:e}){let n=e.turnIndexByKey.get(i),r=o.turnIndexByKey.get(i);if(n===void 0||r===void 0)return null;let d=e.bottomOffsetsPx[n],s=e.heightsPx[n],u=o.bottomOffsetsPx[r],x=o.heightsPx[r];if(d===void 0||s===void 0||u===void 0||x===void 0)throw Error(`Codex turn geometry is missing: ${i}`);return Math.max(0,t+u+x-d-s)}function fe({layout:i,turnKey:t,viewportHeightPx:o}){let e=i.turnIndexByKey.get(t);if(e===void 0)return null;let n=i.bottomOffsetsPx[e],r=i.heightsPx[e];if(n===void 0||r===void 0)throw Error(`Codex turn geometry is missing: ${t}`);return Math.max(0,n-o/2+r/2)}function he({align:i,layout:t,targetHeightPx:o,targetOffsetPx:e,turnKey:n,viewportHeightPx:r}){let d=t.turnIndexByKey.get(n);if(d===void 0)return null;let s=t.bottomOffsetsPx[d],u=t.heightsPx[d];if(s===void 0||u===void 0)throw Error(`Codex turn geometry is missing: ${n}`);let x=s+u-e;return i==="top"?Math.max(0,x-r+10):Math.max(0,x-o/2-r/2)}function l(i,t){let o=0,e=i.length;while(o<e){let n=Math.floor((o+e)/2),r=i[n];if(r===void 0)throw Error(`Codex bottom offset is missing at index ${n}`);if(r<t)e=n;else o=n+1}return o}function c(i,t,o){let e=0,n=i.length;while(e<n){let r=Math.floor((e+n)/2),d=i[r],s=t[r];if(d===void 0||s===void 0)throw Error(`Codex turn geometry is missing at index ${r}`);if(d+s<=o)n=r;else e=r+1}return e}
2
+ export{xt,pe,g,K,ge,fe,he};
@@ -0,0 +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 S({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{S};
@@ -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 xe({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{xe};
@@ -0,0 +1,2 @@
1
+ import{ke}from"./chunk-6f7mdmsp.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(ke,{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{e}from"./chunk-wjejhpgw.js";import{Dialog as i}from"@base-ui/react/dialog";import{cn as r}from"cn";import{XIcon as d}from"lucide-react";import{jsx as a,jsxs as l}from"react/jsx-runtime";function E({...o}){return a(i.Root,{"data-slot":"dialog",...o})}function _t({...o}){return a(i.Trigger,{"data-slot":"dialog-trigger",...o})}function dt({...o}){return a(i.Portal,{"data-slot":"dialog-portal",...o})}function We({...o}){return a(i.Close,{"data-slot":"dialog-close",...o})}function ct({className:o,...t}){return a(i.Backdrop,{"data-slot":"dialog-overlay",className:r("data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs",o),...t})}function R({className:o,children:t,showCloseButton:n=!0,...s}){return l(dt,{children:[a(ct,{}),l(i.Popup,{"data-slot":"dialog-content",className:r("bg-popover text-popover-foreground ring-foreground/10 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 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl p-6 text-sm ring-1 duration-100 outline-none sm:max-w-md",o),...s,children:[t,n&&l(i.Close,{"data-slot":"dialog-close",render:a(e,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm"}),children:[a(d,{}),a("span",{className:"sr-only",children:"Close"})]})]})]})}function qe({className:o,...t}){return a("div",{"data-slot":"dialog-header",className:r("flex flex-col gap-2",o),...t})}function Ge({className:o,showCloseButton:t=!1,children:n,...s}){return l("div",{"data-slot":"dialog-footer",className:r("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",o),...s,children:[n,t&&a(i.Close,{render:a(e,{variant:"outline"}),children:"Close"})]})}function L({className:o,...t}){return a(i.Title,{"data-slot":"dialog-title",className:r("font-heading leading-none font-medium",o),...t})}function je({className:o,...t}){return a(i.Description,{"data-slot":"dialog-description",className:r("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",o),...t})}export{E,_t,dt,We,ct,R,qe,Ge,L,je};
@@ -0,0 +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 me({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{me};
@@ -0,0 +1 @@
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 ze({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 Lt({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{ze,ee,te,Lt};
@@ -0,0 +1 @@
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 Pt({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,Pt,Se,Ee};
@@ -0,0 +1,7 @@
1
+ import{t,u}from"./chunk-8r6388q9.js";import{oe}from"./chunk-p9wpghey.js";import{d}from"./chunk-y2xbq7rb.js";import{i}from"./chunk-pve9b7z3.js";import{f,we}from"./chunk-xhkt2dhz.js";import{T}from"./chunk-bf5fh35b.js";import{cn as b}from"cn";import{BotIcon as ue,CheckIcon as me,CopyIcon as pe}from"lucide-react";import{Fragment as ge,useEffect as O,useRef as U,useState as _}from"react";import{jsx as a,jsxs as x,Fragment as V}from"react/jsx-runtime";function W(e,n){let[o,r]=_(()=>({key:e,mounted:n})),s=n||o.key===e&&o.mounted;if(o.key!==e||o.mounted!==s)r({key:e,mounted:s});return s}var z=new WeakMap,K=1;function L(e){if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return`${e.type}:${e.id}`;if(e.type==="thinking"&&e.id!==void 0)return`thinking:${e.id}`;let n=z.get(e);if(n!==void 0)return`${e.type}:${n}`;let o=K;return K+=1,z.set(e,o),`${e.type}:${o}`}function M(e){switch(e){case"pending":case"in_progress":return!0;case"completed":case"failed":case"cancelled":case"interrupted":return!1;default:throw Error(`Unknown ACP tool status: ${e}`)}}function Z(e,n){let o=Math.max(0,Math.round(e/1000)),r=Math.floor(o/3600),s=Math.floor(o%3600/60),c=o%60;if(c>=60)s+=Math.floor(c/60),c%=60;if(s>=60)r+=Math.floor(s/60),s%=60;let m=Intl.DurationFormat;if(m)try{return new m(n,{style:"narrow"}).format({hours:r,minutes:s,seconds:r>0?0:c})}catch{}if(r>0)return s>0?`${r}h ${s}m`:`${r}h`;if(s>0)return c>0?`${s}m ${c}s`:`${s}m`;return`${c}s`}var fe="M7.52925 3.7793C7.75652 3.55203 8.10803 3.52383 8.36616 3.69434L8.47065 3.7793L14.2207 9.5293C14.4804 9.789 14.4804 10.211 14.2207 10.4707L8.47065 16.2207C8.21095 16.4804 7.78895 16.4804 7.52925 16.2207C7.26955 15.961 7.26955 15.539 7.52925 15.2793L12.8085 10L7.52925 4.7207L7.44429 4.61621C7.27378 4.35808 7.30198 4.00657 7.52925 3.7793Z";function R({expanded:e,className:n}){return a("svg",{className:b("codex-activity-disclosure",e&&"codex-activity-disclosure-expanded",n),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:a("path",{d:fe})})}function Ce(){return a("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:a("path",{d:"M16.3965 5.01128C16.3963 4.93399 16.3489 4.87691 16.293 4.85406L16.2354 4.84332C13.9306 4.91764 12.5622 5.32101 10.665 6.34722V16.3716C11.3851 15.9994 12.0688 15.7115 12.7861 15.5015C13.8286 15.1965 14.9113 15.0633 16.2402 15.0435L16.2979 15.0308C16.353 15.0063 16.3965 14.9483 16.3965 14.8755V5.01128ZM3.54492 14.8765C3.54492 14.9725 3.62159 15.0422 3.70117 15.0435L4.19629 15.0562C5.94062 15.1247 7.26036 15.4201 8.65918 16.0484C8.05544 15.1706 7.14706 14.436 6.17871 14.1109V14.1099C5.56757 13.9045 5.16816 13.3314 5.16797 12.6988V4.98882C4.86679 4.93786 4.60268 4.8999 4.28223 4.87457L3.72754 4.84429C3.62093 4.84079 3.54505 4.92417 3.54492 5.01226V14.8765ZM17.7266 14.8755C17.7266 15.6314 17.1607 16.2751 16.4121 16.3628L16.2598 16.3736C15.0122 16.3922 14.0555 16.5159 13.1602 16.7779C12.2629 17.0404 11.3966 17.4508 10.3369 18.0738C10.129 18.1959 9.87099 18.1958 9.66309 18.0738C7.71455 16.9283 6.31974 16.4689 4.12988 16.3853L3.68164 16.3736C2.85966 16.3614 2.21484 15.6838 2.21484 14.8765V5.01226C2.21497 4.15391 2.93263 3.4871 3.77246 3.51519L4.39844 3.54937C4.67996 3.57191 4.92258 3.60421 5.16797 3.64214V2.51031C5.16797 1.44939 6.29018 0.645615 7.31055 1.15679L7.31152 1.15582C8.78675 1.89511 10.0656 3.33006 10.5352 4.91461C12.3595 3.98907 13.8688 3.58817 16.1924 3.51324L16.3506 3.51714C17.1285 3.5741 17.7264 4.23496 17.7266 5.01128V14.8755ZM6.49805 12.6988C6.49824 12.7723 6.5442 12.8296 6.60254 12.8492L6.96289 12.9859C7.85245 13.3586 8.68125 13.9846 9.33496 14.7496V5.5816C9.08794 4.37762 8.13648 3.1566 6.95801 2.47613L6.71582 2.34527C6.67779 2.32617 6.6337 2.32502 6.58301 2.35796C6.52946 2.39279 6.49805 2.44863 6.49805 2.51031V12.6988Z"})})}function xe(){return a("svg",{className:"codex-activity-icon",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:a("path",{d:"M7.33057 1.98535C10.2484 1.98535 12.6136 4.3508 12.6138 7.26855C12.6138 8.58031 12.1346 9.77942 11.3433 10.7031L13.9897 13.3496C14.1655 13.5253 14.1655 13.8106 13.9897 13.9863C13.814 14.1621 13.5288 14.1621 13.353 13.9863L10.7017 11.335C9.78678 12.0942 8.61243 12.5518 7.33057 12.5518C4.41281 12.5516 2.04736 10.1864 2.04736 7.26855C2.04754 4.35091 4.41292 1.98553 7.33057 1.98535ZM7.33057 2.88574C4.90998 2.88592 2.94793 4.84796 2.94775 7.26855C2.94775 9.68929 4.90987 11.6522 7.33057 11.6523C9.75141 11.6523 11.7144 9.6894 11.7144 7.26855C11.7142 4.84786 9.75131 2.88574 7.33057 2.88574Z"})})}function ve(){return x("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[a("path",{d:"M6.19629 7.86231C6.42357 7.63534 6.7752 7.60692 7.0332 7.77734L7.1377 7.86231L8.80371 9.5293C9.06329 9.78889 9.06307 10.21 8.80371 10.4697L7.1377 12.1367C6.878 12.3964 6.45599 12.3964 6.19629 12.1367C5.93686 11.8771 5.93697 11.456 6.19629 11.1963L7.39258 9.99902L6.19629 8.80371L6.11133 8.69922C5.94087 8.4411 5.96904 8.08955 6.19629 7.86231Z"}),a("path",{d:"M13.4668 11.0156C13.7699 11.0776 13.998 11.3456 13.998 11.667C13.9979 11.9883 13.7698 12.2564 13.4668 12.3184L13.333 12.332H10.833C10.466 12.3319 10.1682 12.034 10.168 11.667C10.168 11.2998 10.4659 11.0021 10.833 11.002H13.333L13.4668 11.0156Z"}),a("path",{d:"M12.6602 2.66504C13.3492 2.66504 13.9062 2.66439 14.3564 2.70117C14.8142 2.73859 15.2201 2.81796 15.5967 3.00977C16.1922 3.31321 16.677 3.79805 16.9805 4.39356C17.1722 4.77014 17.2517 5.17604 17.2891 5.63379C17.3258 6.08402 17.3252 6.64102 17.3252 7.33008V12.6602C17.3252 13.3492 17.3258 13.9062 17.2891 14.3564C17.2516 14.8142 17.1723 15.2201 16.9805 15.5967C16.677 16.1922 16.1922 16.677 15.5967 16.9805C15.2201 17.1723 14.8142 17.2516 14.3564 17.2891C13.9062 17.3258 13.3492 17.3252 12.6602 17.3252H7.33008C6.64102 17.3252 6.08402 17.3258 5.63379 17.2891C5.17604 17.2517 4.77014 17.1722 4.39356 16.9805C3.79805 16.677 3.31321 16.1922 3.00977 15.5967C2.81796 15.2201 2.73859 14.8142 2.70117 14.3564C2.66439 13.9062 2.66504 13.3492 2.66504 12.6602V7.33008C2.66504 6.64101 2.66439 6.08402 2.70117 5.63379C2.73858 5.17601 2.81797 4.77016 3.00977 4.39356C3.31321 3.79802 3.79802 3.31321 4.39356 3.00977C4.77016 2.81797 5.17601 2.73858 5.63379 2.70117C6.08402 2.66439 6.64101 2.66504 7.33008 2.66504H12.6602ZM7.33008 3.99512C6.61907 3.99512 6.1257 3.99601 5.74219 4.02734C5.3665 4.05804 5.15508 4.11481 4.99707 4.19531C4.65183 4.37124 4.37124 4.65183 4.19531 4.99707C4.11481 5.15508 4.05805 5.3665 4.02734 5.74219C3.99601 6.1257 3.99512 6.61908 3.99512 7.33008V12.6602C3.99512 13.3711 3.99601 13.8646 4.02734 14.248C4.05805 14.6237 4.11481 14.8352 4.19531 14.9932C4.37124 15.3384 4.65186 15.619 4.99707 15.7949C5.15507 15.8754 5.36654 15.9322 5.74219 15.9629C6.1257 15.9942 6.61908 15.9951 7.33008 15.9951H12.6602C13.3711 15.9951 13.8646 15.9942 14.248 15.9629C14.6237 15.9322 14.8352 15.8754 14.9932 15.7949C15.3384 15.619 15.619 15.3384 15.7949 14.9932C15.8754 14.8352 15.9322 14.6237 15.9629 14.248C15.9942 13.8646 15.9951 13.3711 15.9951 12.6602V7.33008C15.9951 6.61908 15.9942 6.1257 15.9629 5.74219C15.9322 5.36654 15.8754 5.15507 15.7949 4.99707C15.619 4.65186 15.3384 4.37124 14.9932 4.19531C14.8352 4.11481 14.6237 4.05805 14.248 4.02734C13.8646 3.99601 13.3711 3.99512 12.6602 3.99512H7.33008Z"})]})}function he(){return a("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:a("path",{d:"M11.3312 4.20472C12.7488 2.92391 14.9377 2.96644 16.3039 4.33265L16.4318 4.46742C17.6713 5.8393 17.6713 7.93343 16.4318 9.30531L16.3039 9.44007L10.0119 15.7311C9.68839 16.0546 9.45384 16.2917 9.22185 16.4821L8.98748 16.6588C8.78233 16.799 8.56429 16.9196 8.33709 17.0192L8.10759 17.1119C7.92582 17.1785 7.73843 17.2266 7.52166 17.2711L6.75701 17.4069L4.36345 17.8053C4.22059 17.8291 4.06914 17.8552 3.9406 17.8649C3.84183 17.8723 3.70833 17.875 3.56267 17.8395L3.41423 17.7907C3.19121 17.695 3.00747 17.5271 2.89177 17.316L2.84588 17.2223C2.75958 17.0209 2.76174 16.8276 2.77166 16.6959C2.78136 16.5674 2.80742 16.4159 2.83123 16.2731L3.22966 13.8795L3.36443 13.1149C3.40899 12.898 3.45795 12.7108 3.52459 12.5289L3.61736 12.2985C3.71691 12.0715 3.83772 11.854 3.97771 11.6491L4.15349 11.4147C4.34392 11.1825 4.58171 10.9484 4.90545 10.6246L11.1965 4.33265L11.3312 4.20472ZM5.84588 11.5651C5.49671 11.9142 5.31258 12.0998 5.1867 12.2526L5.07537 12.3991C4.98194 12.5358 4.90157 12.6812 4.83513 12.8327L4.77361 12.9869C4.73328 13.0971 4.70248 13.2125 4.66814 13.3815L4.54119 14.0983L4.14275 16.4918L4.14177 16.4938H4.1447L6.53826 16.0944L7.25505 15.9684C7.42406 15.9341 7.53946 15.9033 7.64959 15.8629L7.80291 15.8014C7.95461 15.7349 8.09953 15.6538 8.2365 15.5602L8.38396 15.4498C8.53674 15.3239 8.72231 15.1398 9.07146 14.7907L14.0588 9.80238L10.8332 6.57679L5.84588 11.5651ZM15.3635 5.27308C14.5281 4.43776 13.2058 4.38573 12.3097 5.11683L12.1369 5.27308L11.7736 5.63636L15.0002 8.86195L15.3635 8.49964L15.5197 8.32581C16.2015 7.48961 16.2015 6.28311 15.5197 5.44691L15.3635 5.27308Z"})})}function Le(){return a("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:a("path",{d:"M16.8347 7.91699C16.8347 7.76279 16.8266 7.61021 16.8123 7.45996L15.4705 8.80371C14.2903 9.98388 12.3762 9.98388 11.1961 8.80371C10.016 7.62352 10.0159 5.70942 11.1961 4.5293L12.5378 3.18652C12.3885 3.17238 12.237 3.16505 12.0837 3.16504C9.45947 3.16504 7.33179 5.29272 7.33179 7.91699C7.33184 8.56608 7.46162 9.18329 7.69605 9.74512C7.79981 9.9939 7.74311 10.2811 7.5525 10.4717L3.59547 14.4287C3.0498 14.9744 3.04991 15.8586 3.59547 16.4043L3.70191 16.501C4.25076 16.9483 5.05957 16.9158 5.57105 16.4043L9.52906 12.4473L9.60426 12.3828C9.79018 12.2455 10.0369 12.2131 10.2546 12.3037C10.8166 12.5382 11.4345 12.668 12.0837 12.668C14.7078 12.6678 16.8345 10.541 16.8347 7.91699ZM18.1648 7.91699C18.1646 11.2755 15.4423 13.9979 12.0837 13.998C11.4151 13.998 10.7708 13.8886 10.1677 13.6885L6.51246 17.3457C5.51389 18.3443 3.93332 18.406 2.86207 17.5322L2.65504 17.3457C1.58992 16.2806 1.58992 14.5534 2.65504 13.4883L6.31031 9.83203C6.1104 9.22921 6.00175 8.58526 6.00172 7.91699C6.00172 4.55818 8.72494 1.83496 12.0837 1.83496C12.7838 1.835 13.458 1.95316 14.0857 2.17188L14.1638 2.20508C14.3404 2.29325 14.4697 2.45713 14.5144 2.65234C14.5653 2.87533 14.4984 3.10876 14.3367 3.27051L12.1375 5.4707C11.4767 6.13148 11.4767 7.20251 12.1375 7.86328C12.7983 8.52373 13.8694 8.52395 14.53 7.86328L16.7293 5.66309L16.7937 5.60742C16.9499 5.48687 17.1532 5.44067 17.3484 5.48535C17.5714 5.53648 17.7526 5.69898 17.8279 5.91504C18.0466 6.54272 18.1648 7.21689 18.1648 7.91699Z"})})}function Y({block:e}){if(e.type!=="tool_use")return null;let n=d(e).category;if(n==="read")return a(Ce,{});if(n==="search"||n==="fetch")return a(xe,{});if(n==="execute")return a(ve,{});if(n==="edit")return a(he,{});return a(Le,{})}function S(e,n){let o=e.rawInput[n];return typeof o==="string"&&o.length>0?o:void 0}function Ne(e){return d(e).target}function j(e){return e.name.startsWith("mcp__")||e.name.startsWith("mcp_")}function ee(e,n){let{category:o}=d(e),r=Ne(e),s=M(e.status);if(j(e))return{leading:e.title};if(o==="execute"){let c=S(e,"command")?.split(`
2
+ `)[0]??r;return c?{leading:n(s?"stream.codex.running":"stream.codex.ran"),trailing:c}:{leading:n(s?"stream.codex.runningCommand":"stream.codex.ranCommandGeneric")}}if(o==="search"){let c=S(e,"pattern")??S(e,"query")??r;return c?{leading:n(s?"stream.codex.searching":"stream.codex.searched"),trailing:n("stream.codex.forDetail",{detail:c})}:{leading:n(s?"stream.codex.searchingFiles":"stream.codex.searchedFiles")}}if(o==="fetch"){let c=S(e,"query")??S(e,"url")??r;return c?{leading:n(s?"stream.codex.searchingWeb":"stream.codex.searchedWeb"),trailing:n("stream.codex.forDetail",{detail:c})}:{leading:n(s?"stream.codex.searchingWeb":"stream.codex.searchedWeb")}}if(o==="read")return r?{leading:n("stream.codex.readLabel"),trailing:r}:{leading:n("stream.codex.readFiles")};if(o==="edit")return r?{leading:n(s?"stream.codex.editingLabel":"stream.codex.editedLabel"),trailing:r}:{leading:n(s?"stream.codex.editingFiles":"stream.codex.editedFiles")};if(o==="delete")return r?{leading:n(s?"stream.codex.deletingLabel":"stream.codex.deletedLabel"),trailing:r}:{leading:n(s?"stream.codex.deletingFiles":"stream.codex.deletedFiles")};if(o==="move")return r?{leading:n(s?"stream.codex.movingLabel":"stream.codex.movedLabel"),trailing:r}:{leading:n(s?"stream.codex.movingFiles":"stream.codex.movedFiles")};return{leading:e.title}}function Te(e,n){let o=ee(e,n);return o.trailing===void 0?o.leading:`${o.leading} ${o.trailing}`}function $e(e){return e.map((n)=>{if(n.type!=="content")return"";let o=n.content;return o.type==="text"?o.text:""}).filter(Boolean).join(`
3
+ `).trim()}function ke(e){return e.flatMap((n)=>{if(n.type!=="content")return[];let o=n.content;return o.type==="image"?[{data:o.data,mimeType:o.mimeType}]:[]})}function Ae(e){return e.flatMap((n)=>{if(n.type!=="content")return[];let o=n.content;return o.type==="audio"?[{data:o.data,mimeType:o.mimeType}]:[]})}function Be(e){if(typeof e==="string"&&e.length>0)return e;return}function Me(e){return e.type==="diff"}function Ie(e){let n=e.content.find(Me);if(n===void 0)return;return n.changes.map((o)=>`${o.operation} ${o.path}`).join(`
4
+ `)}function te(e){let n=Be(e.rawOutput);if(n!==void 0)return n;let o=$e(e.content);if(o.length>0)return o;return Ie(e)}function Ee({block:e,command:n}){let{t:o,Output:r,commandStatus:s}=t(),[c,m]=_(!1),[p,g]=_(!1),C=te(e),l=s===void 0?e.exitCode===void 0?void 0:o("stream.codex.exitCode",{code:e.exitCode}):s(e),y=()=>{navigator.clipboard.writeText([`$ ${n}`,C].filter((w)=>w!==void 0).join(`
5
+ `)),m(!0),setTimeout(()=>m(!1),1500)};return a("div",{className:"codex-command-details",children:x("div",{className:"codex-command-card",children:[x("div",{className:"codex-command-line-row",children:[a("span",{className:"codex-command-prompt","aria-hidden":"true",children:"$"}),a("button",{type:"button",className:b("codex-command-line",!p&&"codex-command-line-clamped"),"data-codex-disclosure":"","aria-expanded":p,onClick:()=>g((w)=>!w),children:n}),a("button",{type:"button",className:"codex-command-copy","aria-label":o("actions.copy"),onClick:y,children:c?a(me,{}):a(pe,{})})]}),C!==void 0&&(r===void 0?a("pre",{className:"codex-command-output",children:C}):a(r,{text:C})),l!==void 0&&a("div",{className:"codex-command-footer",children:a("span",{className:"codex-command-status",children:l})})]})})}function ne({block:e}){let{t:n,openLink:o,Patch:r,openImage:s,commandStatus:c,expandToolOutput:m=!1}=t(),p=te(e),g=r===void 0?void 0:e.content.flatMap((v)=>{if(v.type!=="diff")return[];let E=v;return E.patch?.text?[E.patch.text]:[]}).join(`
6
+ `),C=ke(e.content),l=Ae(e.content),[y,w]=i(`tool:${e.id}`,!1),N=W(`tool:${e.id}`,y),k=d(e),A=k.category,h=ee(e,n),B=A==="execute"?S(e,"command"):void 0,F=B!==void 0||j(e)||C.length>0||l.length>0||Boolean(g)||m&&p!==void 0,I=!F&&!M(e.status)?k.filePath:void 0;if(A==="execute"&&!M(e.status)&&e.status!=="completed"){let v=c?.(e);if(v)h={...h,leading:v}}if(A==="read"&&M(e.status))return null;let G=x("span",{className:"codex-activity-label",children:[a(Y,{block:e}),a("span",{className:"min-w-0 flex-1 truncate",children:M(e.status)?a("span",{className:"codex-activity-running",children:h.trailing===void 0?h.leading:`${h.leading} ${h.trailing}`}):x(V,{children:[a("span",{className:"codex-activity-leading",children:h.leading}),h.trailing!==void 0&&(I!==void 0?x(V,{children:[" ",a("button",{type:"button",className:"codex-activity-trailing codex-activity-file-link",title:I,onClick:()=>o(I),children:h.trailing})]}):x("span",{className:"codex-activity-trailing",children:[" ",h.trailing]}))]})})]});return x("div",{className:"codex-activity-item",children:[F?x("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-label":h.trailing===void 0?h.leading:`${h.leading} ${h.trailing}`,"aria-expanded":y,onClick:()=>w((v)=>!v),children:[G,a(R,{expanded:y})]}):a("div",{className:"codex-activity-header codex-activity-header-static",children:G}),a("div",{className:b("codex-activity-details-grid",y&&"codex-activity-details-grid-open"),children:a("div",{className:"min-h-0 overflow-hidden",children:N&&x(V,{children:[B!==void 0?a(Ee,{block:e,command:B}):r!==void 0&&g?a(r,{patch:g}):p!==void 0&&a("pre",{className:"codex-activity-details",children:p}),C.length>0&&a("div",{className:"codex-activity-media",children:C.map((v)=>{let E=`data:${v.mimeType};base64,${v.data}`,q=a("img",{src:E,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},`${v.mimeType}:${v.data.slice(0,32)}`);return s===void 0?q:a("button",{type:"button",className:"cursor-pointer",onClick:()=>s(E),children:q},E)})}),l.map((v)=>a("audio",{className:"mt-1 w-full","aria-label":n("stream.codex.audioOutput"),controls:!0,src:`data:${v.mimeType};base64,${v.data}`},`${v.mimeType}:${v.data.slice(0,32)}`))]})})})]})}function ae({block:e}){if(e.type==="tool_use")return a(ne,{block:e});if(e.type==="thinking")return a(le,{block:e});if(e.type==="collab")return a(ce,{block:e});return a(ie,{block:e})}function ie({block:e}){let{t:n,openSession:o}=t(),r=M(e.status),[s,c]=i(`subagent:${e.id}`,r),m=U(r);O(()=>{if(r)c(!0);if(m.current&&!r)c(!1);m.current=r},[r,c]);let p=`${Fe(e.activity,r,e.name,n)}${re(e.model,e.reasoningEffort,n)}`,g=e.threadId??"",C=e.blocks.length>0;return x("div",{className:"codex-activity-item",children:[x("button",{type:"button",className:b("codex-activity-header",!C&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":C?s:void 0,disabled:!C,onClick:()=>c((l)=>!l),children:[x("span",{className:"codex-activity-label",children:[a(_e,{seed:e.threadId??e.id}),a("span",{className:"min-w-0 flex-1 truncate",children:o===void 0||e.threadId===null?r?a("span",{className:"codex-activity-running",children:p}):p:a("span",{role:"link",tabIndex:0,className:b("codex-agent-link",r&&"codex-activity-running"),"aria-label":n("stream.codex.subagentOpen",{name:e.name}),onClick:(l)=>{l.stopPropagation(),o(g,e.name)},onKeyDown:(l)=>{if(l.key!=="Enter"&&l.key!==" ")return;l.preventDefault(),l.stopPropagation(),o(g,e.name)},children:p})})]}),C&&a(R,{expanded:s})]}),a("div",{className:b("codex-activity-details-grid",s&&"codex-activity-details-grid-open"),children:a("div",{className:"min-h-0 overflow-hidden",children:a("div",{className:"codex-subagent-details",children:e.blocks.map((l)=>{if(l.type==="tool_use")return a(ne,{block:l},l.id);if(l.type==="thinking")return a(le,{block:l},L(l));if(l.type==="subagent")return a(ie,{block:l},l.id);if(l.type==="collab")return a(ce,{block:l},l.id);if(l.type==="text")return a("div",{className:"codex-reasoning-details",children:a(u,{text:l.text,streaming:!1})},L(l));if(l.type==="plan")return a(T,{entries:l.entries},L(l));if(l.type==="image")return a("img",{src:`data:${l.source.media_type};base64,${l.source.data}`,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},L(l));return null})})})})]})}var Se=8;function Re(e){let n=0;for(let o=0;o<e.length;o+=1)n=(n*31+e.charCodeAt(o))%2147483647;return n%Se}function _e({seed:e}){return a("span",{className:"codex-agent-avatar","data-hue":Re(e),"aria-hidden":"true"})}function Fe(e,n,o,r){switch(e){case"started":return r(n?"stream.codex.subagentWorking":"stream.codex.subagentFinished",{name:o});case"interacted":return r("stream.codex.subagentMessaged",{name:o});case"interrupted":return r("stream.codex.subagentInterrupted",{name:o});case"completed":return r("stream.codex.subagentFinished",{name:o})}}var De=new Set(["none","minimal","low","medium","high","xhigh","max","ultra","persistent"]);function re(e,n,o){if(e===null)return"";if(n===null)return` · ${oe(e)}`;let r=De.has(n)?o(`stream.codex.reasoningEffort.${n}`):n;return` · ${oe(e)} · ${r}`}var Pe={spawnAgent:"spawn",sendInput:"message",sendMessage:"message",followupTask:"message",interruptAgent:"interrupt",listAgents:"list",resumeAgent:"resume",closeAgent:"close"};function se(e){switch(e){case"pending":case"in_progress":return"inProgress";case"completed":return"completed";case"failed":return"failed";case"cancelled":case"interrupted":return"interrupted";default:throw Error(`Unknown ACP tool status: ${e}`)}}function H(e,n,o){if(e.tool==="wait")throw Error("Codex does not present wait calls");let r=se(e.status);if(r==="interrupted")return o("stream.codex.collab.interrupted");return o(`stream.codex.collab.${n}.${Pe[e.tool]}.${r}`)}function Ve(e){return e.agents.filter((n)=>n.nickname!==null)}function de(e,n){let o=e.agents.length>0?e.agents.length:1;return`${H(e,"header",n)}${n("stream.codex.collab.agentCount",{count:o})}`}var D="\x01";function P(e,n,o,r){let s=Object.fromEntries(Object.keys(r).map((c)=>[c,`${D}${c}${D}`]));return e(n,{...o,...s}).split(new RegExp(`${D}(\\w+)${D}`,"u")).map((c,m)=>a(ge,{children:m%2===1?r[c]:c},`${m}:${c}`))}function Oe({agent:e,showModel:n}){let{t:o,openSession:r}=t(),s=e.nickname??"",c=r===void 0?a("span",{className:"font-medium",children:s}):a("button",{type:"button",className:"codex-agent-link font-medium","aria-label":o("stream.codex.subagentOpen",{name:s}),onClick:()=>r(e.threadId,s),children:s});return x("span",{children:[c,e.role!==null&&` (${e.role})`,n&&re(e.model,e.reasoningEffort,o)]})}function J({prompt:e}){return a("span",{className:"codex-collab-prompt",title:e,children:e})}function Ue(e,n){let o=e.prompt?.trim()?e.prompt:null,r=se(e.status),s=e.tool==="spawnAgent"&&r==="completed"&&o!==null,c=(e.tool==="sendInput"||e.tool==="sendMessage"||e.tool==="followupTask")&&o!==null,m=Ve(e),p=[];if(m.length===0)p.push({key:"generic",node:H(e,"row",n)});for(let g of m){let C=a(Oe,{agent:g,showModel:e.tool==="spawnAgent"});if(s)p.push({key:g.threadId,node:a("span",{className:"codex-collab-line",children:P(n,"stream.codex.collab.createdWithInstructions",{},{agent:C,instructions:a(J,{prompt:o})})})});else if(c)p.push({key:g.threadId,node:a("span",{className:"codex-collab-line",children:P(n,"stream.codex.collab.messagedWithPrompt",{action:r==="interrupted"?n("stream.codex.collab.interrupted"):n(`stream.codex.collab.messaged.${r}`)},{agent:C,prompt:a(J,{prompt:o})})})});else{let y=e.tool!=="closeAgent"&&e.tool!=="resumeAgent"&&g.state!==null&&g.state!==null?g.state.message?.trim()?n("stream.codex.collab.stateWithMessage",{state:n(`stream.codex.collab.state.${g.state.status}`),message:g.state.message}):n("stream.codex.collab.stateOnly",{state:n(`stream.codex.collab.state.${g.state.status}`)}):"";p.push({key:g.threadId,node:P(n,"stream.codex.collab.agentRow",{action:H(e,"row",n),state:y},{agent:C})})}}if(!s&&!c&&o!==null)p.push({key:"input",node:P(n,"stream.codex.collab.input",{},{prompt:a("span",{className:"codex-collab-input",children:o})})});return p}function ce({block:e}){let{t:n}=t(),[o,r]=i(`collab:${e.id}`,!1);if(e.tool==="wait")return null;let s=M(e.status),c=de(e,n);return x("div",{className:"codex-activity-item",children:[x("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":o,onClick:()=>r((m)=>!m),children:[x("span",{className:"codex-activity-label",children:[a(ue,{className:"size-4 shrink-0","aria-hidden":"true"}),a("span",{className:"min-w-0 flex-1 truncate",children:s?a("span",{className:"codex-activity-running",children:c}):c})]}),a(R,{expanded:o})]}),a("div",{className:b("codex-activity-details-grid",o&&"codex-activity-details-grid-open"),children:a("div",{className:"min-h-0 overflow-hidden",children:a("div",{className:"codex-subagent-details",children:Ue(e,n).map((m)=>a("div",{className:"codex-collab-row",children:m.node},m.key))})})})]})}function le({block:e}){let{t:n,i18n:o}=t(),r=Boolean(e.isComplete),[s,c]=i(`thinking:${L(e)}`,!1),m=U(null),p=e.thinking.trim().length>0;O(()=>{if(r||!p)return;let l=m.current;if(l===null)throw Error("Thinking details are not mounted");let y=new ResizeObserver(()=>{l.scrollTop=l.scrollHeight}),w=null,N=()=>{let A=l.firstElementChild;if(A===w)return;if(w!==null)y.unobserve(w);if(w=A,w!==null)y.observe(w)},k=new MutationObserver(N);return k.observe(l,{childList:!0}),N(),()=>{k.disconnect(),y.disconnect()}},[p,r]);let g=r?e.durationMs!==void 0?n("stream.codex.thoughtFor",{duration:Z(e.durationMs,o.language)}):n("stream.codex.thought"):n("message.thinking"),C=e.thinking.trimStart().replace(/^\*\*[^\n]*?\*\*\s*/,"");return x("div",{className:"codex-activity-item",children:[x("button",{type:"button",className:b("codex-activity-header",!p&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":p?s:void 0,disabled:!p,onClick:()=>c((l)=>!l),children:[a("span",{className:"codex-activity-label",children:a("span",{className:"codex-reasoning-label min-w-0 flex-1 truncate",children:r?g:a("span",{className:"codex-activity-running",children:g})})}),p&&a(R,{expanded:s})]}),a("div",{className:b("codex-activity-details-grid",s&&"codex-activity-details-grid-open"),children:a("div",{className:"min-h-0 overflow-hidden",children:p&&a("div",{ref:m,className:"codex-reasoning-details",role:"region","aria-label":g,"aria-hidden":!s,tabIndex:0,inert:!s,children:a(u,{text:C,streaming:!r})})})})]})}function Ze(e){if(j(e))return"mcp";let n=d(e).category;return n==="think"||n==="switch_mode"?"other":n}function He(e,n,o,r){return r(`stream.codex.summary.${e}.${o?"leading":"following"}`,{count:n})}function We(e,n,o){let r=new Map;for(let c of e){let m=Ze(c);r.set(m,(r.get(m)??0)+1)}let s=Array.from(r,([c,m],p)=>He(c,m,p===0,n));if(o.startsWith("zh"))return s.join("");return new Intl.ListFormat(o,{style:"long",type:"conjunction"}).format(s)}function be({stateKey:e,durationMs:n,durationKind:o="work",active:r,startedAt:s,providerId:c,providerIcon:m,children:p}){let{t:g,i18n:C}=t(),[l,y]=i(`work:${e}:${r?"active":"complete"}`,r),w=W(`work:${e}`,l||r),N=U(null),[k,A]=_(0);O(()=>{if(!r||n!==void 0){N.current=null;return}N.current=s??Date.now();let B=()=>{let I=N.current;if(I===null)throw Error("Codex work section is ticking without a start time");A(Date.now()-I)};B();let F=window.setInterval(B,1000);return()=>window.clearInterval(F)},[r,s,n]);let h=n!==void 0?g(o==="total"?"stream.codex.totalDuration":"stream.codex.workedFor",{duration:Z(n,C.language)}):r&&k>=1000?g("stream.codex.workedFor",{duration:Z(k,C.language)}):g("stream.codex.worked");return x("section",{className:"codex-work-section",children:[x("button",{type:"button",className:"codex-work-trigger","data-codex-disclosure":"","aria-expanded":l,onClick:()=>y((B)=>!B),children:[c!==void 0&&a("span",{className:"codex-work-provider-icon","data-testid":"codex-work-provider-icon","data-provider-id":c,"aria-hidden":"true",children:m}),a("span",{children:h}),a(R,{expanded:l,className:"codex-work-chevron"})]}),a("div",{className:"codex-work-separator","aria-hidden":"true"}),a("div",{className:b("codex-work-grid",l&&"codex-work-grid-open"),"aria-hidden":!l,inert:!l,children:a("div",{className:"min-h-0 overflow-hidden",children:a("div",{className:"codex-work-body",children:w&&p})})})]})}function je(e,n){if(e.type==="tool_use")return Te(e,n);if(e.type==="thinking")return n("message.thinking");if(e.type==="collab")return de(e,n);return n("stream.codex.subagentWorking",{name:e.name})}function Q(e){if(e.type==="thinking")return!e.isComplete;if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return M(e.status);return!1}function Ge(e,n,o=1000){let[r,s]=_({text:e,live:n}),c=U(Date.now());return O(()=>{if(e===r.text&&n===r.live)return;let m=Date.now(),p=Math.max(0,c.current+o-m);if(p===0||n!==r.live){c.current=m,s({text:e,live:n});return}let g=window.setTimeout(()=>{c.current=Date.now(),s({text:e,live:n})},p);return()=>window.clearTimeout(g)},[r,n,o,e]),n===r.live?r.text:e}function qe({blocks:e}){let{t:n,i18n:o}=t(),r=e.some(Q),s=L(e[0]),[c,m]=i(`group:${s}`,!0),p=W(`group:${s}`,c||r),g=e.findLast(Q)??e.at(-1);if(g===void 0)throw Error("CodexActivityGroup requires at least one activity block");let C=e.filter((y)=>y.type==="tool_use"),l=Ge(r?je(g,n):We(C,n,o.language),r);return x("div",{className:"codex-activity-group",children:[x("button",{type:"button",className:"codex-activity-group-trigger","aria-expanded":c,onClick:()=>m((y)=>!y),children:[x("span",{className:"codex-activity-label",children:[a(Y,{block:e[0]}),a("span",{className:"truncate",children:r?a("span",{className:"codex-activity-running",children:l}):l})]}),a(R,{expanded:c})]}),a("div",{className:b("codex-activity-group-grid",c&&"codex-activity-group-grid-open"),children:a("div",{className:"min-h-0 overflow-hidden",children:a("div",{className:"codex-activity-group-body",children:p&&e.map((y)=>a(ae,{block:y},L(y)))})})})]})}function X({blocks:e}){if(e.length===0)throw Error("CodexActivityGroup requires at least one activity block");if(e.length===1)return a(ae,{block:e[0]});return a(qe,{blocks:e})}function ye({blocks:e}){if(!e.some(f))return a(X,{blocks:e});let n=[];for(let o of e){let r=n.at(-1);if(r&&f(r[0])===f(o))r.push(o);else n.push([o])}return a(V,{children:n.map((o)=>f(o[0])?a(we,{blocks:o.filter(f)},L(o[0])):a(X,{blocks:o},L(o[0])))})}
7
+ export{be,ye};
@@ -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 kt({delay:t=0,...e}){return o(i.Provider,{"data-slot":"tooltip-provider",delay:t,...e})}function G({...t}){return o(i.Root,{"data-slot":"tooltip",...t})}function j({...t}){return o(i.Trigger,{"data-slot":"tooltip-trigger",...t})}function Q({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{kt,G,j,Q};
@@ -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),O=f(null);function pt(){return i(O)}var B=f(null);function gt(){return i(B)}var k=f(null);function ce(){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:U,attachments:L,onAttachmentsChange:S,children:Q}){let T=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""},[]),W=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 j=n(()=>o.current.revision,[]),x=n((t)=>{if(o.current.value=t,o.current.revision++,W)U?.(t);else X(t)},[W,U]),h=n(()=>x(""),[x]),v=L!==void 0,[Y,Z]=K([]),I=L??Y,b=g(I);b.current=I;let s=n((t)=>{let e=typeof t==="function"?t(b.current):t;if(v)S?.(e);else Z(e)},[v,S]),w=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:T(u),filename:u.name,size:u.size,lastModified:u.lastModified,...G===void 0?{}:{sourcePath:G}}})]})},[P,T,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:w}),[I,E,H,_,q]),D=n((t,e)=>{w.current=t.current,M.current=e},[]),tt=J(()=>({textInput:{value:a,setInput:x,clear:h,getRevision:j,clearSubmitted:c??h},attachments:F,__registerFileInput:D}),[a,x,h,j,c,F,D]);return N(A.Provider,{value:tt,children:N(k.Provider,{value:F,children:Q})})}var z=f(null);function p(){let r=nt(),l=i(z),c=r??l;if(!c)throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return c}
2
+ export{O,pt,B,gt,k,ce,C,ft,ht,z,p};
@@ -0,0 +1 @@
1
+ import{Button as n}from"@base-ui/react/button";import{cva as d}from"class-variance-authority";import{cn as o}from"cn";import{jsx as s}from"react/jsx-runtime";var ut=d("group/button 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 inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:ring-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50 shadow-xs",secondary:"bg-secondary text-secondary-foreground aria-expanded:bg-secondary aria-expanded:text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",lg:"h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-9","icon-xs":"size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function e({className:r,variant:t="default",size:i="default",...a}){return s(n,{"data-slot":"button",className:o(ut({variant:t,size:i,className:r})),...a})}export{ut,e};
@@ -0,0 +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 N({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{N};
@@ -0,0 +1,3 @@
1
+ import{t}from"./chunk-8r6388q9.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 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 ve({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,ve,st};
@@ -0,0 +1,2 @@
1
+ import{t}from"./chunk-8r6388q9.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 we({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,we};
@@ -0,0 +1 @@
1
+ import{Radio as o}from"@base-ui/react/radio";import{RadioGroup as t}from"@base-ui/react/radio-group";import{cn as d}from"cn";import{jsx as i}from"react/jsx-runtime";function c({className:r,...e}){return i(t,{"data-slot":"radio-group",className:d("grid w-full gap-3",r),...e})}function a({className:r,...e}){return i(o.Root,{"data-slot":"radio-group-item",className:d("group/radio-group-item peer border-input group-has-[:focus-visible]/field-label:not-data-checked:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary relative flex aspect-square size-4 shrink-0 rounded-full border outline-none group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",r),...e,children:i(o.Indicator,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:i("span",{className:"bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full"})})})}export{c,a};
@@ -0,0 +1,2 @@
1
+ import{cn as x}from"cn";import{jsx as c,jsxs as u}from"react/jsx-runtime";function U({name:m,value:r,levels:p,disabled:d,onChange:h}){if(p.length===0)throw Error("EffortSlider requires at least one level");let a=p,o=Math.max(0,a.findIndex((t)=>t.value===r)),i=76,l=14,s=2,n=a.length,b=s+o/Math.max(1,n-1)*(i-l-s*2);return u("div",{className:x("flex items-center justify-between px-2 py-2.5",d&&"opacity-50"),children:[u("span",{className:"text-sm",children:[m," ",u("span",{"data-effort-value":"",style:{fontSize:12},children:["(",a.find((t)=>t.value===r)?.name??r,")"]})]}),u("button",{type:"button",disabled:d,role:"slider","aria-label":m,"aria-valuemin":0,"aria-valuemax":n-1,"aria-valuenow":o,"aria-valuetext":a.find((t)=>t.value===r)?.name??r,onKeyDown:(t)=>{let e;if(t.key==="ArrowRight"||t.key==="ArrowUp")e=Math.min(n-1,o+1);else if(t.key==="ArrowLeft"||t.key==="ArrowDown")e=Math.max(0,o-1);else if(t.key==="Home")e=0;else if(t.key==="End")e=n-1;else return;if(t.preventDefault(),t.stopPropagation(),!d&&e!==o)h(a[e].value)},className:"relative shrink-0 cursor-pointer overflow-hidden rounded-full border-none p-0 disabled:cursor-default",style:{width:i,height:18,background:"var(--input)"},onClick:(t)=>{let e=t.currentTarget.getBoundingClientRect(),f=t.clientX-e.left,g=i/n,y=Math.min(n-1,Math.max(0,Math.floor(f/g)));h(a[y].value)},children:[c("span",{className:"absolute inset-y-0 left-0 w-full rounded-full",style:{background:"var(--input)"}}),a.map((t,e)=>{let f=s+l/2+e/Math.max(1,n-1)*(i-l-s*2)-2;return c("span",{className:"absolute top-1/2 size-1 -translate-y-1/2 rounded-full",style:{left:f,background:"color-mix(in srgb, var(--muted-foreground) 40%, transparent)"}},t.value)}),c("span",{className:"absolute rounded-full transition-all duration-150",style:{width:l,height:l,top:s,left:b,background:"var(--foreground)",boxShadow:"0 1px 2px #0003"}})]})]})}
2
+ export{U};
@@ -1 +1 @@
1
- import{be,ye}from"../chunk-wc3patey.js";import"../chunk-hy1x2td2.js";import"../chunk-pve9b7z3.js";import"../chunk-gycty1x1.js";import"../chunk-7gh078gc.js";import"../chunk-p9wpghey.js";import"../chunk-y2xbq7rb.js";export{ye as CodexActivityGroup,be as CodexWorkSection};
1
+ import{be,ye}from"../chunk-tygbx698.js";import"../chunk-xhkt2dhz.js";import"../chunk-pve9b7z3.js";import"../chunk-8r6388q9.js";import"../chunk-bf5fh35b.js";import"../chunk-p9wpghey.js";import"../chunk-y2xbq7rb.js";export{ye as CodexActivityGroup,be as CodexWorkSection};
@@ -1,2 +1,2 @@
1
- import{t,u}from"../chunk-gycty1x1.js";import{d}from"../chunk-y2xbq7rb.js";import{Ue}from"../chunk-s3z33k7f.js";import"../chunk-p9wpghey.js";import"../chunk-pve9b7z3.js";import"../chunk-hy1x2td2.js";import{T}from"../chunk-7gh078gc.js";import{be,ye}from"../chunk-wc3patey.js";import{xe}from"../chunk-ynga7fm4.js";import"../chunk-8bdd6q4w.js";import{W}from"../chunk-ax9ganqr.js";import{cn as w}from"cn";import{jsxDEV as n}from"react/jsx-dev-runtime";var v=new WeakMap,P=1;function R(e){if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return`${e.type}:${e.id}`;let s=v.get(e);if(s!==void 0)return`${e.type}:${s}`;let i=P++;return v.set(e,i),`${e.type}:${i}`}function I({block:e,streaming:s,actions:i}){if(e.isApiError)return n("div",{className:"codex-stream-error",children:e.text},void 0,!1,void 0,this);return n("div",{className:"codex-assistant-message",children:[n(u,{text:e.text,streaming:s},void 0,!1,void 0,this),i]},void 0,!0,void 0,this)}function E({block:e,streaming:s,actions:i,renderText:r}){switch(e.type){case"text":return r===void 0?n(I,{block:e,streaming:s,actions:i},void 0,!1,void 0,this):r({block:e,streaming:s,actions:i});case"thinking":return e.thinking.length>0?n(u,{text:e.thinking,streaming:!e.isComplete},void 0,!1,void 0,this):null;case"plan":return n(T,{entries:e.entries},void 0,!1,void 0,this);case"image":return n("img",{src:`data:${e.source.media_type};base64,${e.source.data}`,className:"max-h-64 rounded",alt:""},void 0,!1,void 0,this);case"tool_use":case"subagent":case"collab":return null}}var _=new Set;function q({message:e,isMostRecentTurn:s,hiddenTools:i=_,time:r,beforeCopy:a,afterCopy:x,providerIcon:A,renderText:B,renderEditedFiles:y}){if(e.streaming===!0&&e.content.every((o)=>o.type==="text"?o.text.length===0:o.type==="thinking"?o.thinking.length===0:!1))return n(N,{},void 0,!1,void 0,this);let C=e.content.filter((o)=>o.type==="text").map((o)=>o.text).join(`
2
- `),M=!e.streaming&&C.trim().length>0?n(S,{text:C,isMostRecentTurn:s,beforeCopy:a,afterCopy:x,time:r},void 0,!1,void 0,this):null,l=Ue(e.content,"compact"),f=l.reduce((o,c,p)=>c.kind==="codexActivityGroup"?p:o,-1),h=l.findIndex((o,c)=>c>f&&o.kind==="block"&&o.block.type==="text"),b=[...e.content].toReversed().find((o)=>o.type==="text"),m=e.content.filter((o)=>o.type==="tool_use"&&d(o).category==="edit"),k=(o)=>{if(o.kind==="codexActivityGroup"){let c=o.blocks.filter((p)=>p.type!=="tool_use"||!i.has(p.name));return c.length===0?null:n(ye,{blocks:c},`activity:${R(c[0])}`,!1,void 0,this)}if(o.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${o.kind}`);return n(E,{block:o.block,streaming:Boolean(e.streaming),actions:o.block===b?M:void 0,renderText:B},R(o.block),!1,void 0,this)},g=f===-1?0:h===-1?l.length:h;return n(O,{stateKey:e.id,active:Boolean(e.streaming),startedAt:e.startedAt,durationMs:e.durationMs,providerId:e.providerId,providerIcon:A,work:l.slice(0,g).map(k),answer:l.length>g?l.slice(g).map(k):null,footer:f!==-1&&m.length>0&&(y===void 0?n(xe,{blocks:m},void 0,!1,void 0,this):y(m))},void 0,!1,void 0,this)}function S({text:e,isMostRecentTurn:s=!1,beforeCopy:i,afterCopy:r,time:a}){let{t:x}=t();return n("div",{className:w("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",s?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[i,n(W,{text:e,label:x("actions.copy")},void 0,!1,void 0,this),r,a&&n("span",{className:"codex-user-time ms-1",title:a.full,children:a.short},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function N(){let{t:e}=t();return n("div",{className:"codex-pending-message py-2",role:"status",children:n("span",{className:"codex-activity-running",children:e("message.thinking")},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function O({work:e,answer:s,footer:i,loading:r=!1,...a}){if(r)return n(N,{},void 0,!1,void 0,this);return n("div",{className:"group/am codex-assistant-turn",children:[e.length>0&&n(be,{...a,children:e},void 0,!1,void 0,this),s!==null&&(e.length===0?s:n("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:s},void 0,!1,void 0,this)),i]},void 0,!0,void 0,this)}export{q as CodexAssistantMessage,O as CodexAssistantTurn,S as CodexMessageActions};
1
+ import{t,u}from"../chunk-8r6388q9.js";import{d}from"../chunk-y2xbq7rb.js";import{Ue}from"../chunk-s3z33k7f.js";import"../chunk-p9wpghey.js";import"../chunk-pve9b7z3.js";import"../chunk-xhkt2dhz.js";import{T}from"../chunk-bf5fh35b.js";import{be,ye}from"../chunk-tygbx698.js";import{ve}from"../chunk-x3jp5bsh.js";import"../chunk-6f7mdmsp.js";import{W}from"../chunk-qmbekvg9.js";import{cn as P}from"cn";import{jsx as n,jsxs as y}from"react/jsx-runtime";var R=new WeakMap,I=1;function N(e){if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return`${e.type}:${e.id}`;let s=R.get(e);if(s!==void 0)return`${e.type}:${s}`;let i=I++;return R.set(e,i),`${e.type}:${i}`}function E({block:e,streaming:s,actions:i}){if(e.isApiError)return n("div",{className:"codex-stream-error",children:e.text});return y("div",{className:"codex-assistant-message",children:[n(u,{text:e.text,streaming:s}),i]})}function _({block:e,streaming:s,actions:i,renderText:r}){switch(e.type){case"text":return r===void 0?n(E,{block:e,streaming:s,actions:i}):r({block:e,streaming:s,actions:i});case"thinking":return e.thinking.length>0?n(u,{text:e.thinking,streaming:!e.isComplete}):null;case"plan":return n(T,{entries:e.entries});case"image":return n("img",{src:`data:${e.source.media_type};base64,${e.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":case"collab":return null}}var S=new Set;function z({message:e,isMostRecentTurn:s,hiddenTools:i=S,time:r,beforeCopy:a,afterCopy:x,providerIcon:B,renderText:M,renderEditedFiles:C}){if(e.streaming===!0&&e.content.every((o)=>o.type==="text"?o.text.length===0:o.type==="thinking"?o.thinking.length===0:!1))return n(A,{});let h=e.content.filter((o)=>o.type==="text").map((o)=>o.text).join(`
2
+ `),b=!e.streaming&&h.trim().length>0?n(O,{text:h,isMostRecentTurn:s,beforeCopy:a,afterCopy:x,time:r}):null,l=Ue(e.content,"compact"),f=l.reduce((o,c,p)=>c.kind==="codexActivityGroup"?p:o,-1),k=l.findIndex((o,c)=>c>f&&o.kind==="block"&&o.block.type==="text"),w=[...e.content].toReversed().find((o)=>o.type==="text"),m=e.content.filter((o)=>o.type==="tool_use"&&d(o).category==="edit"),v=(o)=>{if(o.kind==="codexActivityGroup"){let c=o.blocks.filter((p)=>p.type!=="tool_use"||!i.has(p.name));return c.length===0?null:n(ye,{blocks:c},`activity:${N(c[0])}`)}if(o.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${o.kind}`);return n(_,{block:o.block,streaming:Boolean(e.streaming),actions:o.block===w?b:void 0,renderText:M},N(o.block))},g=f===-1?0:k===-1?l.length:k;return n(U,{stateKey:e.id,active:Boolean(e.streaming),startedAt:e.startedAt,durationMs:e.durationMs,providerId:e.providerId,providerIcon:B,work:l.slice(0,g).map(v),answer:l.length>g?l.slice(g).map(v):null,footer:f!==-1&&m.length>0&&(C===void 0?n(ve,{blocks:m}):C(m))})}function O({text:e,isMostRecentTurn:s=!1,beforeCopy:i,afterCopy:r,time:a}){let{t:x}=t();return y("div",{className:P("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",s?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[i,n(W,{text:e,label:x("actions.copy")}),r,a&&n("span",{className:"codex-user-time ms-1",title:a.full,children:a.short})]})}function A(){let{t:e}=t();return n("div",{className:"codex-pending-message py-2",role:"status",children:n("span",{className:"codex-activity-running",children:e("message.thinking")})})}function U({work:e,answer:s,footer:i,loading:r=!1,...a}){if(r)return n(A,{});return y("div",{className:"group/am codex-assistant-turn",children:[e.length>0&&n(be,{...a,children:e}),s!==null&&(e.length===0?s:n("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:s})),i]})}export{z as CodexAssistantMessage,U as CodexAssistantTurn,O as CodexMessageActions};
@@ -1,3 +1,3 @@
1
- import{e}from"../chunk-7pr2j1zb.js";import{r}from"../chunk-pnncsvbz.js";import{c,a}from"../chunk-rka1mc9r.js";import{o}from"../chunk-r9k7kszp.js";import{useId as k}from"react";import{jsxDEV as i,Fragment as A}from"react/jsx-dev-runtime";function p(n){return n!==null&&typeof n==="object"&&!Array.isArray(n)}function I(n){if(!p(n)||!p(n.codex))return[];let s=n.codex,l=s.questions;if(s.delivery!=="async"||!Array.isArray(l))return[];if(!l.every((t)=>p(t)&&typeof t.title==="string"&&t.title.trim().length>0&&(t.options===null||Array.isArray(t.options)&&t.options.every((d)=>typeof d==="string"))))return[];return l}function D(n,s){return JSON.stringify(["request_user_input_async",n,s])}function S(n){return{selected:n.options?.length?0:null,text:""}}function h(n,s){return s.selected===null?s.text:n.options?.[s.selected]??""}function C(n){return`<send_user_message_question_reply>
1
+ import{e}from"../chunk-wjejhpgw.js";import{r}from"../chunk-bwzjm3g8.js";import{c,a}from"../chunk-zt7a6b1m.js";import{o}from"../chunk-d0ptk8x8.js";import{useId as h}from"react";import{jsx as l,jsxs as g,Fragment as A}from"react/jsx-runtime";function p(n){return n!==null&&typeof n==="object"&&!Array.isArray(n)}function D(n){if(!p(n)||!p(n.codex))return[];let s=n.codex,i=s.questions;if(s.delivery!=="async"||!Array.isArray(i))return[];if(!i.every((t)=>p(t)&&typeof t.title==="string"&&t.title.trim().length>0&&(t.options===null||Array.isArray(t.options)&&t.options.every((d)=>typeof d==="string"))))return[];return i}function S(n,s){return JSON.stringify(["request_user_input_async",n,s])}function C(n){return{selected:n.options?.length?0:null,text:""}}function v(n,s){return s.selected===null?s.text:n.options?.[s.selected]??""}function B(n){return`<send_user_message_question_reply>
2
2
  ${JSON.stringify([n])}
3
- </send_user_message_question_reply>`}function B(n){if(!p(n)||!p(n.codex))return[];let s=n.codex;return(Array.isArray(s.questionReplyParts)?s.questionReplyParts.map((t)=>p(t)?{...t,answer:t.text}:t):[s.questionReply]).filter((t)=>p(t)&&typeof t.questionItemId==="string"&&typeof t.question==="string"&&typeof t.answer==="string").map(({questionItemId:t,question:d,answer:g})=>({questionItemId:t,question:d,answer:g}))}function G({question:n,draft:s,status:l,answer:t,error:d,onChange:g,onSubmit:b,onSkip:w,t:u}){let x=k(),m=l==="pending",Q=l==="answered"||l==="skipped";return i("section",{"aria-labelledby":`${x}-title`,className:"border-border bg-card text-card-foreground flex min-w-0 flex-col gap-3 rounded-xl border p-4",children:[i("h3",{id:`${x}-title`,className:"text-sm font-medium whitespace-pre-wrap",children:n.title},void 0,!1,void 0,this),Q?i("p",{className:"text-sm whitespace-pre-wrap",children:l==="answered"?t:u("asyncQuestion.skipped")},void 0,!1,void 0,this):i(A,{children:[(n.options?.length??0)>0&&i(c,{"aria-labelledby":`${x}-title`,disabled:!m,value:s.selected===null?"other":String(s.selected),onValueChange:(y)=>g({...s,selected:y==="other"?null:Number(y)}),children:[n.options?.map((y,f)=>i(r,{className:"flex items-start gap-2 text-sm",children:[i(a,{value:String(f)},void 0,!1,void 0,this),i("span",{className:"whitespace-pre-wrap",children:y},void 0,!1,void 0,this)]},f,!0,void 0,this)),i(r,{className:"flex items-center gap-2 text-sm",children:[i(a,{value:"other"},void 0,!1,void 0,this),u("asyncQuestion.other")]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),i(o,{"aria-label":u("asyncQuestion.answer"),placeholder:u("asyncQuestion.answer"),value:s.text,readOnly:!m,onChange:(y)=>g({selected:null,text:y.target.value})},void 0,!1,void 0,this),d&&i("p",{role:"alert",className:"text-destructive text-sm",children:d},void 0,!1,void 0,this),i("div",{className:"flex flex-wrap items-center gap-2",children:[i(e,{size:"sm",disabled:!m||h(n,s).trim().length===0,onClick:b,children:u(l==="submitting"?"asyncQuestion.submitting":"asyncQuestion.submit")},void 0,!1,void 0,this),i(e,{size:"sm",variant:"ghost",disabled:!m,onClick:w,children:u("asyncQuestion.skip")},void 0,!1,void 0,this),(l==="closed"||l==="unavailable")&&i("span",{role:"status",className:"text-muted-foreground text-xs",children:u(`asyncQuestion.${l}`)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}export{G as AsyncQuestionCard,D as asyncQuestionId,I as asyncQuestions,S as initialQuestionDraft,h as questionAnswer,B as questionReplies,C as questionReplyEnvelope};
3
+ </send_user_message_question_reply>`}function G(n){if(!p(n)||!p(n.codex))return[];let s=n.codex;return(Array.isArray(s.questionReplyParts)?s.questionReplyParts.map((t)=>p(t)?{...t,answer:t.text}:t):[s.questionReply]).filter((t)=>p(t)&&typeof t.questionItemId==="string"&&typeof t.question==="string"&&typeof t.answer==="string").map(({questionItemId:t,question:d,answer:m})=>({questionItemId:t,question:d,answer:m}))}function L({question:n,draft:s,status:i,answer:t,error:d,onChange:m,onSubmit:w,onSkip:Q,t:u}){let f=h(),x=i==="pending",k=i==="answered"||i==="skipped";return g("section",{"aria-labelledby":`${f}-title`,className:"border-border bg-card text-card-foreground flex min-w-0 flex-col gap-3 rounded-xl border p-4",children:[l("h3",{id:`${f}-title`,className:"text-sm font-medium whitespace-pre-wrap",children:n.title}),k?l("p",{className:"text-sm whitespace-pre-wrap",children:i==="answered"?t:u("asyncQuestion.skipped")}):g(A,{children:[(n.options?.length??0)>0&&g(c,{"aria-labelledby":`${f}-title`,disabled:!x,value:s.selected===null?"other":String(s.selected),onValueChange:(y)=>m({...s,selected:y==="other"?null:Number(y)}),children:[n.options?.map((y,b)=>g(r,{className:"flex items-start gap-2 text-sm",children:[l(a,{value:String(b)}),l("span",{className:"whitespace-pre-wrap",children:y})]},b)),g(r,{className:"flex items-center gap-2 text-sm",children:[l(a,{value:"other"}),u("asyncQuestion.other")]})]}),l(o,{"aria-label":u("asyncQuestion.answer"),placeholder:u("asyncQuestion.answer"),value:s.text,readOnly:!x,onChange:(y)=>m({selected:null,text:y.target.value})}),d&&l("p",{role:"alert",className:"text-destructive text-sm",children:d}),g("div",{className:"flex flex-wrap items-center gap-2",children:[l(e,{size:"sm",disabled:!x||v(n,s).trim().length===0,onClick:w,children:u(i==="submitting"?"asyncQuestion.submitting":"asyncQuestion.submit")}),l(e,{size:"sm",variant:"ghost",disabled:!x,onClick:Q,children:u("asyncQuestion.skip")}),(i==="closed"||i==="unavailable")&&l("span",{role:"status",className:"text-muted-foreground text-xs",children:u(`asyncQuestion.${i}`)})]})]})]})}export{L as AsyncQuestionCard,S as asyncQuestionId,D as asyncQuestions,C as initialQuestionDraft,v as questionAnswer,G as questionReplies,B as questionReplyEnvelope};
@@ -1 +1 @@
1
- import{at,xe,st}from"../chunk-ynga7fm4.js";import"../chunk-gycty1x1.js";export{xe as CodexEditedFilesCard,st as EditedFilesCard,at as fileChanges};
1
+ import{at,ve,st}from"../chunk-x3jp5bsh.js";import"../chunk-8r6388q9.js";export{ve as CodexEditedFilesCard,st as EditedFilesCard,at as fileChanges};
@@ -1 +1 @@
1
- import{f,we}from"../chunk-hy1x2td2.js";import"../chunk-pve9b7z3.js";import"../chunk-gycty1x1.js";export{we as ImageViewActivity,f as isImageView};
1
+ import{f,we}from"../chunk-xhkt2dhz.js";import"../chunk-pve9b7z3.js";import"../chunk-8r6388q9.js";export{we as ImageViewActivity,f as isImageView};