@alwith/module-chat 0.5.7 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/dist/approval/choice-elicitation-form.js +1 -1
- package/dist/approval/choice-schema.js +1 -1
- package/dist/approval/permission-view.js +1 -1
- package/dist/approval/schema-elicitation-form.js +1 -1
- package/dist/approval/url-elicitation-card.js +1 -1
- package/dist/chunk-0bcmb1tj.js +4 -0
- package/dist/chunk-0j0xezr5.js +2 -0
- package/dist/{chunk-6xhjta3v.js → chunk-0mm2wh23.js} +1 -1
- package/dist/{chunk-h6354tmm.js → chunk-0n240acr.js} +2 -2
- package/dist/{chunk-v7581vjx.js → chunk-0pz9ryqh.js} +2 -2
- package/dist/{chunk-eftxa7tx.js → chunk-0v0mgxb4.js} +6 -6
- package/dist/{chunk-g5ke7686.js → chunk-0yvbqccv.js} +2 -2
- package/dist/{chunk-gxmrync5.js → chunk-18mgzmdc.js} +2 -2
- package/dist/{chunk-862r6ajk.js → chunk-1drkvxzk.js} +1 -1
- package/dist/{chunk-d1ckpc56.js → chunk-1dw0dx23.js} +1 -1
- package/dist/chunk-2qhzvpzz.js +2 -0
- package/dist/{chunk-fvgebjsz.js → chunk-30wqrz8v.js} +2 -2
- package/dist/{chunk-0nda3snj.js → chunk-34e5ad6w.js} +2 -2
- package/dist/{chunk-2mj3yh2z.js → chunk-377s443r.js} +2 -2
- package/dist/{chunk-8jhsjq8f.js → chunk-3arz4kfx.js} +2 -2
- package/dist/{chunk-tx1tn5kr.js → chunk-401q6mpb.js} +2 -2
- package/dist/{chunk-ze7v4hpt.js → chunk-460phps1.js} +2 -2
- package/dist/chunk-4hj619eb.js +2 -0
- package/dist/chunk-4hv66fey.js +2 -0
- package/dist/{chunk-sw9pw2vx.js → chunk-4q3w2353.js} +2 -2
- package/dist/{chunk-4y87qc0q.js → chunk-4svcj9c6.js} +2 -2
- package/dist/chunk-5ar229ya.js +1 -0
- package/dist/chunk-5d0a5ykg.js +2 -0
- package/dist/{chunk-zk6d3k70.js → chunk-5hv3f2z9.js} +5 -5
- package/dist/{chunk-xcfde6w5.js → chunk-5n1xv5w0.js} +2 -2
- package/dist/chunk-6ceybn6m.js +3 -0
- package/dist/{chunk-hz1pgnqp.js → chunk-6edz9f7j.js} +2 -2
- package/dist/{chunk-x55qtpsa.js → chunk-6r5s4bjp.js} +2 -2
- package/dist/{chunk-f09gwfr3.js → chunk-6ss1981q.js} +2 -2
- package/dist/{chunk-01ekhzvd.js → chunk-7ncycdpp.js} +1 -1
- package/dist/chunk-85xjmqq8.js +2 -0
- package/dist/{chunk-jrmdbkae.js → chunk-88xay4pa.js} +2 -2
- package/dist/chunk-8b8hc0b7.js +2 -0
- package/dist/{chunk-jn90tdhn.js → chunk-989btr3w.js} +1 -1
- package/dist/{chunk-z33zakbw.js → chunk-9evhky1b.js} +1 -1
- package/dist/chunk-9fbkfhsv.js +2 -0
- package/dist/chunk-9r0g5jc9.js +2 -0
- package/dist/{chunk-60tc6jmp.js → chunk-ab3thrqy.js} +2 -2
- package/dist/{chunk-appwebh3.js → chunk-abwjd5yv.js} +2 -2
- package/dist/{chunk-tc85dd04.js → chunk-ak0k5vg6.js} +1 -1
- package/dist/chunk-aprxk7c2.js +2 -0
- package/dist/chunk-asyfbagd.js +3 -0
- package/dist/{chunk-71zed0rt.js → chunk-b65vdzz3.js} +1 -1
- package/dist/{chunk-kywzvmjx.js → chunk-b9m454cd.js} +2 -2
- package/dist/{chunk-mgtkmbmd.js → chunk-bbwb4555.js} +2 -2
- package/dist/{chunk-1yz914xx.js → chunk-bjg1zasm.js} +1 -1
- package/dist/{chunk-tsexf956.js → chunk-c0ac9k7h.js} +2 -2
- package/dist/chunk-cyatvpv4.js +2 -0
- package/dist/chunk-dp8pjv6r.js +2 -0
- package/dist/{chunk-qrar3eh8.js → chunk-dwwpe6se.js} +3 -3
- package/dist/chunk-e0n346aa.js +2 -0
- package/dist/{chunk-4xt6bccx.js → chunk-f7kngj14.js} +2 -2
- package/dist/{chunk-356na0ca.js → chunk-fcqkxfv3.js} +2 -2
- package/dist/chunk-g5tsnsqt.js +2 -0
- package/dist/{chunk-gyt0xsmh.js → chunk-gc9g67j5.js} +2 -2
- package/dist/{chunk-nc724yjk.js → chunk-gd9s35b8.js} +2 -2
- package/dist/{chunk-4ar9qjya.js → chunk-gjkrfb1m.js} +2 -2
- package/dist/chunk-hjnf5kvc.js +2 -0
- package/dist/{chunk-7az2575k.js → chunk-hzxyj69n.js} +2 -2
- package/dist/{chunk-jce1mkfh.js → chunk-jg1ntm7n.js} +1 -1
- package/dist/chunk-jhe1aqmm.js +2 -0
- package/dist/{chunk-t177dfb8.js → chunk-jn0q0b7k.js} +2 -2
- package/dist/{chunk-dx176sdf.js → chunk-jsjgymb4.js} +1 -1
- package/dist/{chunk-kmt7fjdq.js → chunk-jtaph5am.js} +1 -1
- package/dist/{chunk-9yha9cvq.js → chunk-k3375qqd.js} +2 -2
- package/dist/{chunk-eq1azzrt.js → chunk-ksv9pjc2.js} +1 -1
- package/dist/{chunk-kh32nepy.js → chunk-m8djwdd5.js} +2 -2
- package/dist/{chunk-m8dbspj3.js → chunk-m8sp44qa.js} +1 -1
- package/dist/chunk-mvv28374.js +2 -0
- package/dist/{chunk-mdg2na3p.js → chunk-n8yj6reh.js} +3 -3
- package/dist/chunk-ncwd36vj.js +2 -0
- package/dist/{chunk-qsvd61ce.js → chunk-nfeea6s7.js} +3 -3
- package/dist/{chunk-2rjt5w9p.js → chunk-nfwmx8by.js} +2 -2
- package/dist/{chunk-3pk47npz.js → chunk-p2prcbq9.js} +1 -1
- package/dist/{chunk-58t2kkh8.js → chunk-pth2ajxw.js} +2 -2
- package/dist/{chunk-krn4yh36.js → chunk-q256c3hn.js} +2 -2
- package/dist/{chunk-bkyjy7tp.js → chunk-qfk24bq6.js} +1 -1
- package/dist/{chunk-cc8f9yvh.js → chunk-qgkj3wee.js} +1 -1
- package/dist/{chunk-qtwmcw8y.js → chunk-qgm2pqvw.js} +2 -2
- package/dist/{chunk-4y0yjee1.js → chunk-qq9p31a7.js} +2 -2
- package/dist/{chunk-ehrfhhfw.js → chunk-rky16ygr.js} +2 -2
- package/dist/{chunk-gjh9py8j.js → chunk-rnzphmk6.js} +2 -2
- package/dist/chunk-s6k9sg4g.js +2 -0
- package/dist/{chunk-wbkj0ea6.js → chunk-s9sf8hqk.js} +2 -2
- package/dist/{chunk-0geh5prw.js → chunk-sr5rcdza.js} +2 -2
- package/dist/chunk-ssmhqn6a.js +2 -0
- package/dist/{chunk-mzh48e09.js → chunk-svt0t387.js} +2 -2
- package/dist/{chunk-vmw815b1.js → chunk-syffw61b.js} +4 -4
- package/dist/chunk-szanfktp.js +2 -0
- package/dist/{chunk-n7yk45mr.js → chunk-t0fs5s5v.js} +2 -2
- package/dist/{chunk-3g3n0djp.js → chunk-t6t6hgzx.js} +2 -2
- package/dist/{chunk-ya03j791.js → chunk-tdwk5dct.js} +1 -1
- package/dist/{chunk-f5z2f54v.js → chunk-temeekck.js} +2 -2
- package/dist/chunk-tjbn0y8j.js +2 -0
- package/dist/{chunk-sppn6v56.js → chunk-tjgq4882.js} +2 -2
- package/dist/{chunk-k6tqy9x5.js → chunk-ty6yjhwk.js} +1 -1
- package/dist/{chunk-5hdcwxmh.js → chunk-vc5nsece.js} +1 -1
- package/dist/{chunk-nkjfa05y.js → chunk-ve686fw1.js} +2 -2
- package/dist/{chunk-9mknagqd.js → chunk-w8qmh6he.js} +2 -2
- package/dist/{chunk-b826jevt.js → chunk-wdyyy8c1.js} +2 -2
- package/dist/{chunk-4vb2e17y.js → chunk-x4jqabfz.js} +1 -1
- package/dist/{chunk-dsxw7qvm.js → chunk-xb1wvyky.js} +1 -1
- package/dist/{chunk-62sp80d0.js → chunk-xxkdv1zf.js} +1 -1
- package/dist/chunk-ysc51tpb.js +2 -0
- package/dist/{chunk-yx7f12tc.js → chunk-yvnad5k0.js} +1 -1
- package/dist/{chunk-p0bvkpwq.js → chunk-zk3j2f24.js} +3 -3
- package/dist/{chunk-d9xm18sy.js → chunk-znx2e9e7.js} +2 -2
- package/dist/{chunk-d7h2n049.js → chunk-zsxt5bbk.js} +1 -1
- package/dist/{chunk-aaqk0jrt.js → chunk-zz734bzf.js} +2 -2
- package/dist/codex/activity-group.js +1 -1
- package/dist/codex/assistant-message.js +1 -1
- package/dist/codex/async-question-card.js +1 -1
- package/dist/codex/edited-files-card.js +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.js +1 -1
- package/dist/codex/navigation-audio.js +1 -1
- package/dist/codex/navigation-preview.js +1 -1
- package/dist/codex/navigation-rail.js +1 -1
- package/dist/codex/patch-view.js +1 -1
- package/dist/codex/plan.js +1 -1
- package/dist/codex/timeline-virtualizer.js +1 -1
- package/dist/codex/turn-activity.js +1 -1
- package/dist/codex/user-message.js +1 -1
- package/dist/codex/virtualized-turn-list.js +1 -1
- package/dist/composer/completion-filter.js +1 -1
- package/dist/composer/completion-menu.js +1 -1
- package/dist/composer/menu-radio.js +1 -1
- package/dist/composer/model-select.js +1 -1
- package/dist/composer/permission-mode-select.js +1 -1
- package/dist/composer/prompt-input-attachments.js +1 -1
- package/dist/composer/prompt-input-clipboard.js +1 -1
- package/dist/composer/prompt-input-context.js +1 -1
- package/dist/composer/prompt-input-textarea.js +1 -1
- package/dist/composer/prompt-input.js +1 -1
- package/dist/conversation/action-card.js +1 -1
- package/dist/conversation/composer/composer.js +1 -1
- package/dist/conversation/composer/config-options.js +1 -1
- package/dist/conversation/composer/drafts.js +1 -1
- package/dist/conversation/composer/file-items.js +1 -1
- package/dist/conversation/composer/long-text.js +1 -1
- package/dist/conversation/composer/mention-chips.js +1 -1
- package/dist/conversation/composer/model-menu.js +1 -1
- package/dist/conversation/composer/pasted-text-attachment.js +1 -1
- package/dist/conversation/composer/permission-mode-menu.js +1 -1
- package/dist/conversation/composer/prediction.js +1 -1
- package/dist/conversation/composer/slash-command-button.js +1 -1
- package/dist/conversation/composer/submit-button.js +1 -1
- package/dist/conversation/composer/usage-meter.js +1 -1
- package/dist/conversation/context.js +1 -1
- package/dist/conversation/conversation-body.js +1 -1
- package/dist/conversation/conversation-view.js +1 -1
- package/dist/conversation/conversation.js +1 -1
- package/dist/conversation/diff-modal.js +1 -1
- package/dist/conversation/session-actions.js +1 -1
- package/dist/image-lightbox.js +1 -1
- package/dist/image-preview-dialog.js +1 -1
- package/dist/lib/code-highlighter.js +1 -1
- package/dist/lib/group-blocks.js +1 -1
- package/dist/lib/limits.js +1 -1
- package/dist/lib/markdown-parser.js +1 -1
- package/dist/lib/markdown-rules.js +1 -1
- package/dist/lib/model-name.js +1 -1
- package/dist/lib/stream-style.js +1 -1
- package/dist/lib/streaming-markdown.js +1 -1
- package/dist/locales.d.ts +16 -0
- package/dist/locales.js +1 -1
- package/dist/search/chat-search.js +1 -1
- package/dist/search/dom-matches.js +1 -1
- package/dist/session-list/archived-sessions.js +1 -1
- package/dist/session-list/highlight.js +1 -1
- package/dist/session-list/host.js +1 -1
- package/dist/session-list/hover-info-card.js +1 -1
- package/dist/session-list/locales.d.ts +16 -0
- package/dist/session-list/locales.js +1 -1
- package/dist/session-list/navigation.js +1 -1
- package/dist/session-list/overflow-marquee.js +1 -1
- package/dist/session-list/row-stop-button.js +1 -1
- package/dist/session-list/session-groups.js +1 -1
- package/dist/session-list/session-info-card.js +1 -1
- package/dist/session-list/session-list.js +1 -1
- package/dist/session-list/session-row.js +1 -1
- package/dist/session-list/session-state-dot.js +1 -1
- package/dist/session-list/session-state-menu.d.ts +8 -0
- package/dist/session-list/session-state-menu.js +1 -0
- package/dist/session-list/sidebar-overlay.js +1 -1
- package/dist/session-list/trailing-swap.js +1 -1
- package/dist/session-list/use-activity-preview.js +1 -1
- package/dist/session-list/use-project-sessions.js +1 -1
- package/dist/session-list/virtual-session-rows.js +1 -1
- package/dist/session-timeline/activity-group.js +1 -1
- package/dist/session-timeline/activity-projection.js +1 -1
- package/dist/session-timeline/assistant-content.js +1 -1
- package/dist/session-timeline/assistant-turn.js +1 -1
- package/dist/session-timeline/async-questions.js +1 -1
- package/dist/session-timeline/edited-files-card.js +1 -1
- package/dist/session-timeline/history-timeline.js +1 -1
- package/dist/session-timeline/host.js +1 -1
- package/dist/session-timeline/navigation-rail.js +1 -1
- package/dist/session-timeline/plan.js +1 -1
- package/dist/session-timeline/question-reply.js +1 -1
- package/dist/session-timeline/resource-content.js +1 -1
- package/dist/session-timeline/session-timeline.js +1 -1
- package/dist/session-timeline/turn-activity.js +1 -1
- package/dist/session-timeline/turn-error.js +1 -1
- package/dist/session-timeline/turn-time.js +1 -1
- package/dist/session-timeline/turns.js +1 -1
- package/dist/session-timeline/use-timeline-scroll.js +1 -1
- package/dist/session-timeline/user-message.js +1 -1
- package/dist/ui/alert.js +1 -1
- package/dist/ui/badge.js +1 -1
- package/dist/ui/card.js +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/empty.js +1 -1
- package/dist/ui/field.js +1 -1
- package/dist/ui/hover-card.js +1 -1
- package/dist/ui/radio-group.js +1 -1
- package/dist/ui/select.js +1 -1
- package/dist/ui/separator.js +1 -1
- package/dist/ui/spinner.js +1 -1
- package/dist/ui/switch.js +1 -1
- package/dist/ui/tooltip.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-11kwcp8b.js +0 -2
- package/dist/chunk-19em37f4.js +0 -2
- package/dist/chunk-3dhdh7jh.js +0 -1
- package/dist/chunk-465zxxrf.js +0 -2
- package/dist/chunk-5640ga6m.js +0 -2
- package/dist/chunk-5tsvqfej.js +0 -2
- package/dist/chunk-602snzpa.js +0 -2
- package/dist/chunk-82m8q66f.js +0 -2
- package/dist/chunk-90av8aeq.js +0 -2
- package/dist/chunk-9hqz5fbc.js +0 -2
- package/dist/chunk-9y31b3sw.js +0 -2
- package/dist/chunk-atv1r122.js +0 -2
- package/dist/chunk-awawx7sp.js +0 -2
- package/dist/chunk-eg2ts8sp.js +0 -2
- package/dist/chunk-f7tp22k1.js +0 -4
- package/dist/chunk-hf0nha31.js +0 -2
- package/dist/chunk-m5xngq9n.js +0 -2
- package/dist/chunk-msredq8h.js +0 -2
- package/dist/chunk-na21awb6.js +0 -2
- package/dist/chunk-nnfnwj9n.js +0 -2
- package/dist/chunk-nyvzyy9q.js +0 -3
- package/dist/chunk-qb09vn5h.js +0 -2
- package/dist/chunk-r3tfwy7k.js +0 -2
- package/dist/chunk-rj4z8zrk.js +0 -2
- package/dist/chunk-rwpr6j34.js +0 -2
- package/dist/chunk-tmc05znj.js +0 -3
- package/dist/chunk-v86a2qjp.js +0 -2
package/README.md
CHANGED
|
@@ -114,3 +114,19 @@ license, without per-application registration. This does not grant hosted-servic
|
|
|
114
114
|
access or rights to separately distributed Rust libraries or Runtime binaries.
|
|
115
115
|
The npm artifact includes compiled/minified JS, declarations and necessary assets,
|
|
116
116
|
not the private TS/TSX implementation or source maps. Minification is not encryption.
|
|
117
|
+
|
|
118
|
+
### Default session list
|
|
119
|
+
|
|
120
|
+
The shipped session list owns its 30px row height and hover styling. Hosts do not need U-specific CSS variables. To use another layout, implement a replacement list against the session client rather than configuring the default list through additional style options.
|
|
121
|
+
|
|
122
|
+
### Session status menu
|
|
123
|
+
|
|
124
|
+
`SessionStateMenu` from `@alwith/module-chat/session-list` is the compact four-dot
|
|
125
|
+
toolbar menu: needs attention (red), running (yellow), completed unread (blue),
|
|
126
|
+
and idle (green). Supply current Runtime `sessions`, the existing chat translator
|
|
127
|
+
`t`, and `onSelect(session)`. Put it beside other toolbar actions in the same row.
|
|
128
|
+
The host supplies the visible session scope and excludes unused reusable drafts.
|
|
129
|
+
Historical sessions without Runtime state do not count as idle. Opening the menu
|
|
130
|
+
does not acknowledge unread sessions, stop agents, or create a second registry.
|
|
131
|
+
`onSelect` uses the application's existing session navigation path.
|
|
132
|
+
The component is engine-neutral and does not require a Codex client or provider.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{qe}from"../chunk-x4jqabfz.js";import{e}from"../chunk-cg97byvk.js";import{ue}from"../chunk-1drkvxzk.js";import{l}from"../chunk-1hy64ewz.js";import{f}from"../chunk-ek06eyp4.js";import{j,S}from"../chunk-jtaph5am.js";import{k}from"../chunk-ncekagm6.js";import{mn,Ct,ae,We}from"../chunk-t6t6hgzx.js";import{autoUpdate as G}from"@floating-ui/dom";import{cn as H}from"cn";import{useCallback as R,useEffect as M,useLayoutEffect as O,useMemo as _,useRef as V,useState as F}from"react";import{createPortal as W}from"react-dom";import{jsx as i,jsxs as m}from"react/jsx-runtime";var c="__other__";function le({current:r,total:A,anchorRef:N,t:p,onAccept:I,onDecline:L}){let x=_(()=>r?mn(r.requestedSchema):[],[r]),[y,b]=F({}),C=V(null);M(()=>{if(r?.elicitationId===void 0)return;let t={};for(let{key:a,property:o}of x)if(!ae(o)){let u=We(o)[0];if(u)t[a]={selected:u.value}}b(t)},[r?.elicitationId,x]),M(()=>{if(r?.elicitationId!==void 0&&C.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")C.current.focus()},[r?.elicitationId]);let[E,q]=F(null),[U,z]=F(null),T=R(()=>{let t=N.current;if(!t)return;let a=t.getBoundingClientRect();if(a.width===0){let o=Math.min(640,window.innerWidth*0.9);q({left:(window.innerWidth-o)/2,width:o,bottom:24});return}q({left:a.left,width:a.width,bottom:window.innerHeight-a.bottom+20})},[N]);O(()=>{if(!r)return;let t=0,a=()=>{if(N.current){T();return}t=requestAnimationFrame(a)};return a(),()=>cancelAnimationFrame(t)},[r,T,N]),O(()=>{let t=N.current;if(!r||!t||!U)return;return G(t,U,T,{animationFrame:!0})},[r,U,N,T]);let P=_(()=>{if(!r)return!1;for(let{key:t,property:a}of x){let o=y[t];if(!o)return!1;if(ae(a)){if(!o.selectedSet||o.selectedSet.size===0)return!1;if(o.selectedSet.has(c)&&!o.otherText?.trim())return!1}else{if(!o.selected)return!1;if(o.selected===c&&!o.otherText?.trim())return!1}}return!0},[r,x,y]),D=R(async()=>{if(!r)return;if(!P)return;let t={},a={};for(let{key:o,property:u}of x){let d=y[o];if(!d)continue;let g;if(ae(u))t[o]=[...d.selectedSet??[]].map((v)=>v===c?(d.otherText??"").trim():v).filter(Boolean);else{let v=d.selected??"";if(t[o]=v===c?(d.otherText??"").trim():v,v!==c)g=We(u).find((s)=>s.value===v)?.preview}let h=d.notes?.trim();if(g||h)a[o]={...g&&{preview:g},...h&&{notes:h}}}await I(r.elicitationId,t,a)},[r,x,y,P,I]),B=R(async()=>{if(r)await L(r.elicitationId)},[r,L]);if(!r||!E)return null;return W(m("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(t)=>{if(t.key==="Escape")t.preventDefault(),B()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left:E.left,width:E.width,bottom:E.bottom,maxHeight:"70vh"},ref:(t)=>{C.current=t,z(t)},children:[m("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:p("askUserQuestion.title")}),A>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${A}`})]}),i("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i("div",{className:"space-y-4 px-3 py-3",children:x.map(({key:t,property:a},o)=>{let u=y[t],d=u?.selected,g=u?.selectedSet??new Set,h=We(a),v=ae(a);return m("div",{className:"space-y-2",children:[m("div",{className:"flex items-center gap-2",children:[i(qe,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:Ct(a).title??t}),i("div",{className:"text-foreground text-sm font-medium",children:Ct(a).description})]}),v?m("div",{className:"space-y-1.5 ps-1",children:[h.map((s)=>m("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[i(ue,{checked:g.has(s.value),onCheckedChange:(n)=>{b((w)=>{let Q=new Set(w[t]?.selectedSet??new Set);if(n)Q.add(s.value);else Q.delete(s.value);return{...w,[t]:{...w[t],selectedSet:Q}}})}}),m("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)),m("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[i(ue,{checked:g.has(c),onCheckedChange:(s)=>{b((n)=>{let w=new Set(n[t]?.selectedSet??new Set);if(s)w.add(c);else w.delete(c);return{...n,[t]:{...n[t],selectedSet:w}}})}}),i("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:p("askUserQuestion.other")})]}),g.has(c)&&i("div",{className:"ps-7",children:i(l,{placeholder:p("askUserQuestion.otherPlaceholder"),value:u?.otherText??"",onChange:(s)=>b((n)=>({...n,[t]:{...n[t],otherText:s.target.value}}))})})]}):m(j,{value:d??"",onValueChange:(s)=>b((n)=>({...n,[t]:{...n[t],selected:s}})),className:"space-y-1.5 ps-1",children:[h.map((s)=>{let n=`${o}:${s.value}`;return m("div",{className:H("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",d===s.value&&"bg-muted/60"),children:[i(S,{value:s.value,id:n}),m(f,{htmlFor:n,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)}),m("div",{className:H("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",d===c&&"bg-muted/60"),children:[i(S,{value:c,id:`${o}:other`,className:"mt-0.5"}),i(f,{htmlFor:`${o}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:p("askUserQuestion.other")})]}),d===c&&i("div",{className:"ps-7",children:i(l,{placeholder:p("askUserQuestion.otherPlaceholder"),value:u?.otherText??"",onChange:(s)=>b((n)=>({...n,[t]:{...n[t],otherText:s.target.value}}))})})]}),!v&&d&&d!==c&&(()=>{let s=h.find((n)=>n.value===d)?.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})})(),h.some((s)=>s.preview)&&i(k,{placeholder:p("askUserQuestion.notesPlaceholder"),value:u?.notes??"",onChange:(s)=>b((n)=>({...n,[t]:{...n[t],notes:s.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"})]},t)})})}),m("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 B(),children:p("askUserQuestion.cancel")}),i(e,{size:"sm",disabled:!P,onClick:()=>void D(),children:p("askUserQuestion.submit")})]})]}),document.body)}export{le as ChoiceElicitationForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mn,Ct,
|
|
1
|
+
import{mn,Ct,ae,We}from"../chunk-t6t6hgzx.js";export{mn as elicitationFields,Ct as elicitationLabels,We as elicitationOptions,ae as isMultiSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{yn}from"../chunk-qq9p31a7.js";import"../chunk-bztgv33r.js";export{yn as PermissionView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Sr,gr,Pr,bn}from"../chunk-fcqkxfv3.js";import"../chunk-1drkvxzk.js";import"../chunk-989btr3w.js";import"../chunk-1hy64ewz.js";import"../chunk-jtaph5am.js";import"../chunk-ek06eyp4.js";import"../chunk-ksv9pjc2.js";import"../chunk-ty6yjhwk.js";import"../chunk-ak0k5vg6.js";import"../chunk-ncekagm6.js";import"../chunk-cg97byvk.js";export{bn as SchemaElicitationForm,Sr as elicitationFields,gr as initialValues,Pr as isAnswered};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{wn}from"../chunk-18mgzmdc.js";import"../chunk-7ncycdpp.js";import"../chunk-cg97byvk.js";export{wn as UrlElicitationCard};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{po}from"./chunk-sr5rcdza.js";import{t}from"./chunk-dp8pjv6r.js";import{qn,Vn}from"./chunk-460phps1.js";import{_}from"./chunk-t0fs5s5v.js";import{G}from"./chunk-0pz9ryqh.js";import{isEmbeddedResource as g,isImage as d,isResourceLink as f,isText as x}from"@nyssance/codex-acp-v2/client";import{memo as p}from"react";import{jsx as r,jsxs as h}from"react/jsx-runtime";var $n=p(function({item:s,messageTime:c}){let l=t(),o=Vn(s._meta),m=o?o.map((e)=>e.question===void 0?e.text:`${e.question}
|
|
2
|
+
${e.text}`).join(`
|
|
3
|
+
`):G(s),a=s.content.filter(d),i=s.content.filter((e)=>f(e)||g(e)),u=o??s.content.filter(x).map((e)=>{let n=qn(e._meta);return n?{question:n.question,text:n.answer}:{text:e.text}});if(m.length===0&&a.length===0&&i.length===0)return null;return h("div",{className:"group/codex-user flex min-w-0 flex-col items-end gap-2","data-content-search-unit-key":s.id,children:[i.length>0&&r("div",{className:"codex-user-mentions",children:i.map((e,n)=>r(_,{block:e},`${s.id}:${n}`))}),r(po,{host:l,message:s,text:m,textParts:u.some((e)=>("question"in e))?u:void 0,images:a,mentions:[],messageTime:c})]})});
|
|
4
|
+
export{$n};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o}from"./chunk-dp8pjv6r.js";import{Ae,Le,De}from"./chunk-b65vdzz3.js";import{n}from"./chunk-ysc51tpb.js";import{y,ne}from"./chunk-g5tsnsqt.js";import{hasAccount as D}from"@nyssance/codex-acp-v2/client";import{cn as M}from"cn";import{useEffect as C,useState as L}from"react";import{jsx as a,jsxs as c}from"react/jsx-runtime";var d=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),H=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),T=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function p(e){return typeof e==="number"&&!Number.isNaN(e)?Math.max(0,e):0}function W(e,t){let r=Math.min(100,e/t*100),s=r>=90?"text-destructive":r>=70?"text-foreground":"text-muted-foreground";return{pct:r,className:s}}function F(e){let t=y(e.configOptions,"model");return t===void 0?void 0:ne(t)}function Oo(e,t){let r=e.windowDurationMins;if(r===null)return t("usage.usage");if(r%1440===0)return t("usage.windowDays",{count:r/1440});return t("usage.windowHours",{count:Math.round(r/60)})}function z(){let{client:e}=n(),t=o((i)=>i.connection==="ready"&&D(i.agent)),[r,s]=L(null);return C(()=>{if(!t){s(null);return}let i=!0;e.readRateLimits().then((m)=>{if(i)s(m)},()=>{return});let l=e.onRateLimits((m)=>{if(i)s(m)});return()=>{i=!1,l()}},[t,e]),r}function dt({session:e}){let{t}=n().host,r=z(),{usage:s,lastTurnUsage:i}=e;if(s===null&&i===null)return null;let l=s&&s.size>0?W(s.used,s.size):null,m=7,N=2*Math.PI*m,x=p(i?.inputTokens),h=p(i?.outputTokens),f=p(i?.cachedReadTokens),v=p(i?.cachedWriteTokens),b=p(i?.totalTokens)||x+h+f+v,k=x+f,w=k>0?H.format(f/k):t("tokens.notAvailable"),R=[[t("tokens.input"),d.format(x)],[t("tokens.output"),d.format(h)],[t("tokens.cachedRead"),d.format(f)],[t("tokens.cachedWrite"),d.format(v)],[t("tokens.cacheHitRate"),w],[t("tokens.total"),d.format(b)]],g=F(e);return c(Ae,{children:[a(Le,{delay:100,closeDelay:100,render:c("button",{type:"button",className:M("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",l?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[c("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[a("circle",{cx:"9",cy:"9",r:m,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),l!==null&&a("circle",{cx:"9",cy:"9",r:m,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:N,strokeDashoffset:N*(1-l.pct/100),transform:"rotate(-90 9 9)"})]}),l!==null&&c("span",{children:[Math.round(l.pct),"%"]})]})}),c(De,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[g!==void 0&&a("div",{className:"border-b px-3 py-2",children:a("p",{className:"text-foreground truncate text-xs font-semibold",title:g,children:g})}),c("div",{className:"flex flex-col gap-3 p-3",children:[i!==null&&c("div",{className:"flex flex-col gap-1.5",children:[a("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),a("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:R.map(([u,S])=>c("div",{className:"contents",children:[a("dt",{className:"text-muted-foreground",children:u}),a("dd",{className:"text-end tabular-nums",children:S})]},u))})]}),s!==null&&s.size>0&&c("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[a("p",{className:"text-xs font-medium",children:t("tokens.context")}),a("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:d.format(s.used),limit:d.format(s.size),percent:T.format(s.used/s.size*100)})})]}),r!==null&&(r.primary!==null||r.secondary!==null)&&c("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[a("p",{className:"text-xs font-medium",children:t("usage.limits")}),a("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[r.primary,r.secondary].filter((u)=>u!==null).map((u)=>c("div",{className:"contents",children:[a("dt",{className:"text-muted-foreground",children:Oo(u,t)}),a("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,u.usedPercent)))})})]},`${u.windowDurationMins??"window"}`))})]})]})]})]})}
|
|
2
|
+
export{Oo,dt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cva as s}from"class-variance-authority";import{cn as a}from"cn";import{jsx as r}from"react/jsx-runtime";var n=s("group/alert relative grid w-full gap-0.5 rounded-lg border px-4 py-3 text-start text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pe-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function
|
|
1
|
+
import{cva as s}from"class-variance-authority";import{cn as a}from"cn";import{jsx as r}from"react/jsx-runtime";var n=s("group/alert relative grid w-full gap-0.5 rounded-lg border px-4 py-3 text-start text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pe-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function q({className:t,variant:e,...o}){return r("div",{"data-slot":"alert",role:"alert",className:a(n({variant:e}),t),...o})}function Et({className:t,...e}){return r("div",{"data-slot":"alert-title",className:a("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",t),...e})}function V({className:t,...e}){return r("div",{"data-slot":"alert-description",className:a("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",t),...e})}function Qr({className:t,...e}){return r("div",{"data-slot":"alert-action",className:a("absolute top-2.5 end-3",t),...e})}export{q,Et,V,Qr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function go({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{go};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g}from"./chunk-
|
|
2
|
-
export{Or,
|
|
1
|
+
import{g}from"./chunk-nfeea6s7.js";import{codexMessageError as A,nativeTurnId as m,textOf as S,turns as _}from"@nyssance/codex-acp-v2/client";function Or(t){return t.kind==="tool"&&t.name==="mcp_startup"}function E(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let n=e.phase;return typeof n==="string"?n:null}function w(t){let e=t._meta?.codex;return typeof e==="object"&&e!==null&&e.notice===!0}function fo(t){return t.user===null&&t.items.length>0&&t.items.every((e)=>e.kind==="assistant"&&w(e))}function T(t,e,n){let o=t.work.at(-1);if(o?.kind==="activity"&&o.items.at(-1)===n){o.items.push(e);return}t.work.push({kind:"activity",key:`activity:${e.kind}:${e.id}`,items:[e]})}function M(t,e,n){if(t.kind!=="tool"){e.push(t);return}let o=n.get(t.id);if(o===void 0)throw Error(`Grouped tool is missing from the session: ${t.id}`);e.push(o);for(let s of t.children)M(s,e,n)}function j(t,e,n,o){switch(e.kind){case"user":break;case"assistant":{if(A(e)!==null){let u=m(e),f=t.errors.findIndex((p)=>u!==null&&m(p)===u);if(f===-1)t.errors.push(e);else t.errors[f]=e;break}let s=E(e),i=e._meta?.codex,d=g(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(g(e._meta).length>0)t.final.push(e);else if(d)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else if(s==="final_answer")t.final.push(e);else if(s==="commentary"||w(e)||s===null&&n)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else t.final.push(e);break}case"thought":T(t,e,o);break;case"tool":if(T(t,e,o),e.toolKind==="edit")t.edits.push(e);break;case"plan":t.work.push({kind:"plan",key:`plan:${e.id}`,item:e});break;case"compaction":t.work.push({kind:"compaction",key:`compaction:${e.id}`,item:e});break}}function ho(t,e=[],n=[]){let o=new Map(e.map((r)=>[r.key,r])),s=new Map(t.items.filter((r)=>r.kind==="tool").map((r)=>[r.id,r])),i={...t,items:t.items.filter((r)=>!Or(r))},d=new Map(n.map((r,a)=>[r.turnId,a])),u=[],f=[u],p,k=null;for(let r of i.items){let a=m(r),l=d.get(a??"");if(a!==null&&k!==null&&a!==k||l!==void 0&&p!==void 0&&l>p+1)u=[],f.push(u);if(u.push(r),a!==null||r.kind==="user")k=a;if(l!==void 0)p=l}return f.flatMap((r)=>_({...i,items:r})).map((r)=>{let a=r.prompt===null?[]:[r.prompt];for(let c of r.entries)M(c,a,s);let l=a[0];if(l===void 0)throw Error("A turn without items");let I=`turn:${l.kind}:${l.id}`,h=r.endedAt??Math.max(...a.map((c)=>c.at)),y=o.get(I);if(y!==void 0&&K(y.items,a)&&y.endedAt===h)return y;let x={key:I,user:r.prompt,work:[],final:[],errors:[],edits:[],startedAt:r.startedAt??l.at,endedAt:h,replayed:a.every(qt),items:a},v=a.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return a.forEach((c,b)=>j(x,c,b<v,a[b-1])),x})}function K(t,e){return t.length===e.length&&t.every((n,o)=>n===e[o])}function qt(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function G(t){return S(t.content)}function Ee(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function Vt(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function vo(t){let e=(s)=>{for(let i of t.items){let d=i._meta?.codex;if(typeof d!=="object"||d===null)continue;let u=d[s];if(typeof u==="number"&&Number.isFinite(u)&&u>=0)return u}return},n=e("workDurationMs"),o=e("turnDurationMs");return{durationMs:n??o,durationKind:n===void 0&&o!==void 0?"total":"work",startedAt:e("workStartedAt")}}function xo(t,e,n){if(n?.user==null)return!1;let o=e.items.map(m).find((i)=>i!==null),s=m(n.user);if(o!==void 0&&s!==null)return o===s;return!e.items.some((i)=>{let d=i._meta?.codex;return typeof d==="object"&&d!==null&&"turnCompletedAt"in d&&typeof d.turnCompletedAt==="number"})&&t.state!=="idle"&&(n.user.echo==="pending"||n.user.echo==="acknowledged")&&e.user!==null&&t.turnEndedAt[e.user.id]===void 0&&e.errors.length===0}function yo(t,e){if(t.state==="idle")return;let n=e.length-1;while(n>0){let o=e[n];if(o.items.some((s)=>s.kind!=="user"))break;if(!xo(t,e[n-1],o))break;n--}return e[n]?.key}function bo(t,e,n){let o=n,s=n;while(o>0&&xo(t,e[o-1],e[o]))o--;while(s+1<e.length&&xo(t,e[s],e[s+1]))s++;let i=e.slice(o,s+1),d=i.findLast((u)=>u.items.some((f)=>f.kind!=="user"))??i[0];return{continued:e[n]!==d,items:i.flatMap((u)=>u.items),edits:i.flatMap((u)=>u.edits),startedAt:i[0].startedAt}}
|
|
2
|
+
export{Or,fo,ho,qt,G,Ee,Vt,vo,xo,yo,bo};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{a,v}from"./chunk-ryz4c13z.js";import{Ut}from"./chunk-hz1pgnqp.js";import{A}from"./chunk-xcfde6w5.js";import{I}from"./chunk-ckft9abb.js";import{se,so}from"./chunk-8jhsjq8f.js";import{F}from"./chunk-9mknagqd.js";import{cn as y}from"cn";import{BotIcon as me,CheckIcon as pe,CopyIcon as ge}from"lucide-react";import{Fragment as fe,useEffect as V,useRef as O,useState as _}from"react";import{jsx as n,jsxs as p,Fragment as U}from"react/jsx-runtime";function j(e,t){let[o,i]=_(()=>({key:e,mounted:t})),r=t||o.key===e&&o.mounted;if(o.key!==e||o.mounted!==r)i({key:e,mounted:r});return r}var z=new WeakMap,K=1;function b(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 t=z.get(e);if(t!==void 0)return`${e.type}:${t}`;let o=K;return K+=1,z.set(e,o),`${e.type}:${o}`}function L(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 H(e,t){let o=Math.max(0,Math.round(e/1000)),i=Math.floor(o/3600),r=Math.floor(o%3600/60),s=o%60;if(s>=60)r+=Math.floor(s/60),s%=60;if(r>=60)i+=Math.floor(r/60),r%=60;let l=Intl.DurationFormat;if(l)try{return new l(t,{style:"narrow"}).format({hours:i,minutes:r,seconds:i>0?0:s})}catch{}if(i>0)return r>0?`${i}h ${r}m`:`${i}h`;if(r>0)return s>0?`${r}m ${s}s`:`${r}m`;return`${s}s`}var xe="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 M({expanded:e,className:t}){return n("svg",{className:y("codex-activity-disclosure",e&&"codex-activity-disclosure-expanded",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:xe})})}function Ce(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("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 ye(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n("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 p("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[n("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"}),n("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"}),n("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 n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("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 J(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("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 ee({block:e}){if(e.type!=="tool_use")return null;if(Z(e))return n(J,{});let t=A(e).category;if(t==="read")return n(Ce,{});if(t==="search"||t==="fetch")return n(ye,{});if(t==="execute")return n(ve,{});if(t==="edit")return n(he,{});return n(J,{})}function B(e,t){let o=e.rawInput[t];return typeof o==="string"&&o.length>0?o:void 0}function we(e){return A(e).target}function G(e){return e.name==="mcp"||e.name.startsWith("mcp__")||e.name.startsWith("mcp_")}function Z(e){return G(e)||e.name==="dynamic_tool"}function te(e,t){let{category:o}=A(e),i=we(e),r=L(e.status);if(Z(e))return{leading:e.title};if(o==="execute"){let s=B(e,"command")?.split(`
|
|
2
|
-
`)[0]??i;return s?{leading:t(r?"stream.codex.running":"stream.codex.ran"),trailing:s}:{leading:t(r?"stream.codex.runningCommand":"stream.codex.ranCommandGeneric")}}if(o==="search"){let s=
|
|
1
|
+
import{a,v}from"./chunk-ryz4c13z.js";import{zt}from"./chunk-6edz9f7j.js";import{D}from"./chunk-5n1xv5w0.js";import{I}from"./chunk-ckft9abb.js";import{pe,so}from"./chunk-3arz4kfx.js";import{W}from"./chunk-w8qmh6he.js";import{cn as y}from"cn";import{BotIcon as ue,CheckIcon as me,CopyIcon as ge}from"lucide-react";import{Fragment as fe,useEffect as U,useRef as V,useState as R}from"react";import{jsx as n,jsxs as p,Fragment as P}from"react/jsx-runtime";function j(e,t){let[o,i]=R(()=>({key:e,mounted:t})),r=t||o.key===e&&o.mounted;if(o.key!==e||o.mounted!==r)i({key:e,mounted:r});return r}var z=new WeakMap,K=1;function b(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 t=z.get(e);if(t!==void 0)return`${e.type}:${t}`;let o=K;return K+=1,z.set(e,o),`${e.type}:${o}`}function L(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,t){let o=Math.max(0,Math.round(e/1000)),i=Math.floor(o/3600),r=Math.floor(o%3600/60),s=o%60;if(s>=60)r+=Math.floor(s/60),s%=60;if(r>=60)i+=Math.floor(r/60),r%=60;let l=Intl.DurationFormat;if(l)try{return new l(t,{style:"narrow"}).format({hours:i,minutes:r,seconds:i>0?0:s})}catch{}if(i>0)return r>0?`${i}h ${r}m`:`${i}h`;if(r>0)return s>0?`${r}m ${s}s`:`${r}m`;return`${s}s`}var xe="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 B({expanded:e,className:t}){return n("svg",{className:y("codex-activity-disclosure",e&&"codex-activity-disclosure-expanded",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:xe})})}function Ce(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("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 ye(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n("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 p("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[n("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"}),n("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"}),n("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 n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("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 J(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("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 ee({block:e}){if(e.type!=="tool_use")return null;if(O(e))return n(J,{});let t=D(e).category;if(t==="read")return n(Ce,{});if(t==="search"||t==="fetch")return n(ye,{});if(t==="execute")return n(ve,{});if(t==="edit")return n(he,{});return n(J,{})}function A(e,t){let o=e.rawInput[t];return typeof o==="string"&&o.length>0?o:void 0}function we(e){return D(e).target}function G(e){return e.name==="mcp"||e.name.startsWith("mcp__")||e.name.startsWith("mcp_")}function O(e){return G(e)||e.name==="dynamic_tool"}function te(e,t){let{category:o}=D(e),i=we(e),r=L(e.status);if(O(e))return{leading:e.title};if(o==="execute"){let s=A(e,"command")?.split(`
|
|
2
|
+
`)[0]??i;return s?{leading:t(r?"stream.codex.running":"stream.codex.ran"),trailing:s}:{leading:t(r?"stream.codex.runningCommand":"stream.codex.ranCommandGeneric")}}if(o==="search"){let s=A(e,"pattern")??A(e,"query")??i;return s?{leading:t(r?"stream.codex.searching":"stream.codex.searched"),trailing:t("stream.codex.forDetail",{detail:s})}:{leading:t(r?"stream.codex.searchingFiles":"stream.codex.searchedFiles")}}if(o==="fetch"){let s=A(e,"query")??A(e,"url")??i;return s?{leading:t(r?"stream.codex.searchingWeb":"stream.codex.searchedWeb"),trailing:t("stream.codex.forDetail",{detail:s})}:{leading:t(r?"stream.codex.searchingWeb":"stream.codex.searchedWeb")}}if(o==="read")return i?{leading:t("stream.codex.readLabel"),trailing:i}:{leading:t("stream.codex.readFiles")};if(o==="edit")return i?{leading:t(r?"stream.codex.editingLabel":"stream.codex.editedLabel"),trailing:i}:{leading:t(r?"stream.codex.editingFiles":"stream.codex.editedFiles")};if(o==="delete")return i?{leading:t(r?"stream.codex.deletingLabel":"stream.codex.deletedLabel"),trailing:i}:{leading:t(r?"stream.codex.deletingFiles":"stream.codex.deletedFiles")};if(o==="move")return i?{leading:t(r?"stream.codex.movingLabel":"stream.codex.movedLabel"),trailing:i}:{leading:t(r?"stream.codex.movingFiles":"stream.codex.movedFiles")};return{leading:e.title}}function be(e,t){let o=te(e,t);return o.trailing===void 0?o.leading:`${o.leading} ${o.trailing}`}function Le(e){return e.map((t)=>{if(t.type!=="content")return"";let o=t.content;return o.type==="text"?o.text:""}).filter(Boolean).join(`
|
|
3
3
|
`).trim()}function Ne(e){return e.flatMap((t)=>{if(t.type!=="content")return[];let o=t.content;return o.type==="image"?[{data:o.data,mimeType:o.mimeType}]:[]})}function Te(e){return e.flatMap((t)=>{if(t.type!=="content")return[];let o=t.content;return o.type==="audio"?[{data:o.data,mimeType:o.mimeType}]:[]})}function $e(e){if(typeof e==="string"&&e.length>0)return e;return}function ke(e){return e.type==="diff"}function Ae(e){let t=e.content.find(ke);if(t===void 0)return;return t.changes.map((o)=>`${o.operation} ${o.path}`).join(`
|
|
4
|
-
`)}function ne(e){let t=$e(e.rawOutput);if(t!==void 0)return t;let o=Le(e.content);if(o.length>0)return o;return Ae(e)}function Be({block:e,command:t}){let{t:o,Output:i,commandStatus:r}=a(),[s,l]=
|
|
5
|
-
`)),l(!0),setTimeout(()=>l(!1),1500)};return n("div",{className:"codex-command-details",children:p("div",{className:"codex-command-card",children:[p("div",{className:"codex-command-line-row",children:[n("span",{className:"codex-command-prompt","aria-hidden":"true",children:"$"}),n("button",{type:"button",className:y("codex-command-line",!c&&"codex-command-line-clamped"),"data-codex-disclosure":"","aria-expanded":c,onClick:()=>u((f)=>!f),children:t}),n("button",{type:"button",className:"codex-command-copy","aria-label":o("actions.copy"),onClick:g,children:s?n(
|
|
6
|
-
`),m=Ne(e.content),d=Te(e.content),[g,f]=I(`tool:${e.id}`,!1),T=j(`tool:${e.id}`,g),h=A(e),w=h.category,C=te(e,t),E=w==="execute"?B(e,"command"):void 0,N=E!==void 0||Z(e)||m.length>0||d.length>0||Boolean(u)||l&&c!==void 0,S=!N&&!L(e.status)?h.filePath:void 0;if(w==="execute"&&!L(e.status)&&e.status!=="completed"){let x=s?.(e);if(x)C={...C,leading:x}}if(w==="read"&&L(e.status))return null;let R=p("span",{className:"codex-activity-label",children:[n(ee,{block:e}),n("span",{className:"min-w-0 flex-1 truncate",children:L(e.status)?n("span",{className:"codex-activity-running",children:C.trailing===void 0?C.leading:`${C.leading} ${C.trailing}`}):p(U,{children:[n("span",{className:"codex-activity-leading",children:C.leading}),C.trailing!==void 0&&(S!==void 0?p(U,{children:[" ",n("button",{type:"button",className:"codex-activity-trailing codex-activity-file-link",title:S,onClick:()=>o(S),children:C.trailing})]}):p("span",{className:"codex-activity-trailing",children:[" ",C.trailing]}))]})})]});return p("div",{className:"codex-activity-item",children:[N?p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-label":C.trailing===void 0?C.leading:`${C.leading} ${C.trailing}`,"aria-expanded":g,onClick:()=>f((x)=>!x),children:[R,n(M,{expanded:g})]}):n("div",{className:"codex-activity-header codex-activity-header-static",children:R}),n("div",{className:y("codex-activity-details-grid",g&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:T&&p(U,{children:[E!==void 0?n(Be,{block:e,command:E}):i!==void 0&&u?n(i,{patch:u}):c!==void 0&&n("pre",{className:"codex-activity-details",children:c}),m.length>0&&n("div",{className:"codex-activity-media",children:m.map((x)=>{let k=`data:${x.mimeType};base64,${x.data}`,q=n("img",{src:k,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},`${x.mimeType}:${x.data.slice(0,32)}`);return r===void 0?q:n("button",{type:"button",className:"cursor-pointer",onClick:()=>r(k),children:q},k)})}),d.map((x)=>n("audio",{className:"mt-1 w-full","aria-label":t("stream.codex.audioOutput"),controls:!0,src:`data:${x.mimeType};base64,${x.data}`},`${x.mimeType}:${x.data.slice(0,32)}`))]})})})]})}function oe({block:e}){if(e.type==="tool_use")return n(ae,{block:e});if(e.type==="thinking")return n(ue,{block:e});if(e.type==="collab")return n(le,{block:e});return n(ie,{block:e})}function ie({block:e}){let{t,openSession:o}=a(),i=L(e.status),[r,s]=I(`subagent:${e.id}`,i),l=O(i);V(()=>{if(i)s(!0);if(l.current&&!i)s(!1);l.current=i},[i,s]);let c=`${Re(e.activity,i,e.name,t)}${re(e.model,e.reasoningEffort,t)}`,u=e.threadId??"",m=e.blocks.length>0;return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:y("codex-activity-header",!m&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":m?r:void 0,disabled:!m,onClick:()=>s((d)=>!d),children:[p("span",{className:"codex-activity-label",children:[n(Ee,{seed:e.threadId??e.id}),n("span",{className:"min-w-0 flex-1 truncate",children:o===void 0||e.threadId===null?i?n("span",{className:"codex-activity-running",children:c}):c:n("span",{role:"link",tabIndex:0,className:y("codex-agent-link",i&&"codex-activity-running"),"aria-label":t("stream.codex.subagentOpen",{name:e.name}),onClick:(d)=>{d.stopPropagation(),o(u,e.name)},onKeyDown:(d)=>{if(d.key!=="Enter"&&d.key!==" ")return;d.preventDefault(),d.stopPropagation(),o(u,e.name)},children:c})})]}),m&&n(M,{expanded:r})]}),n("div",{className:y("codex-activity-details-grid",r&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:e.blocks.map((d)=>{if(d.type==="tool_use")return n(ae,{block:d},d.id);if(d.type==="thinking")return n(ue,{block:d},b(d));if(d.type==="subagent")return n(ie,{block:d},d.id);if(d.type==="collab")return n(le,{block:d},d.id);if(d.type==="text")return n("div",{className:"codex-reasoning-details",children:n(v,{text:d.text,streaming:!1})},b(d));if(d.type==="plan")return n(F,{entries:d.entries},b(d));if(d.type==="image")return n("img",{src:`data:${d.source.media_type};base64,${d.source.data}`,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},b(d));return null})})})})]})}var Ie=8;function Me(e){let t=0;for(let o=0;o<e.length;o+=1)t=(t*31+e.charCodeAt(o))%2147483647;return t%Ie}function Ee({seed:e}){return n("span",{className:"codex-agent-avatar","data-hue":Me(e),"aria-hidden":"true"})}function Re(e,t,o,i){switch(e){case"started":return i(t?"stream.codex.subagentWorking":"stream.codex.subagentFinished",{name:o});case"interacted":return i("stream.codex.subagentMessaged",{name:o});case"interrupted":return i("stream.codex.subagentInterrupted",{name:o});case"completed":return i("stream.codex.subagentFinished",{name:o})}}var _e=new Set(["none","minimal","low","medium","high","xhigh","max","ultra","persistent"]);function re(e,t,o){if(e===null)return"";if(t===null)return` · ${Ut(e)}`;let i=_e.has(t)?o(`stream.codex.reasoningEffort.${t}`):t;return` · ${Ut(e)} · ${i}`}var Fe={spawnAgent:"spawn",sendInput:"message",sendMessage:"message",followupTask:"message",interruptAgent:"interrupt",listAgents:"list",resumeAgent:"resume",closeAgent:"close"};function de(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 W(e,t,o){if(e.tool==="wait")throw Error("Codex does not present wait calls");let i=de(e.status);if(i==="interrupted")return o("stream.codex.collab.interrupted");return o(`stream.codex.collab.${t}.${Fe[e.tool]}.${i}`)}function De(e){return e.agents.filter((t)=>t.nickname!==null)}function ce(e,t){let o=e.agents.length>0?e.agents.length:1;return`${W(e,"header",t)}${t("stream.codex.collab.agentCount",{count:o})}`}var D="\x01";function P(e,t,o,i){let r=Object.fromEntries(Object.keys(i).map((s)=>[s,`${D}${s}${D}`]));return e(t,{...o,...r}).split(new RegExp(`${D}(\\w+)${D}`,"u")).map((s,l)=>n(fe,{children:l%2===1?i[s]:s},`${l}:${s}`))}function Pe({agent:e,showModel:t}){let{t:o,openSession:i}=a(),r=e.nickname??"",s=i===void 0?n("span",{className:"font-medium",children:r}):n("button",{type:"button",className:"codex-agent-link font-medium","aria-label":o("stream.codex.subagentOpen",{name:r}),onClick:()=>i(e.threadId,r),children:r});return p("span",{children:[s,e.role!==null&&` (${e.role})`,t&&re(e.model,e.reasoningEffort,o)]})}function Q({prompt:e}){return n("span",{className:"codex-collab-prompt",title:e,children:e})}function Ue(e,t){let o=e.prompt?.trim()?e.prompt:null,i=de(e.status),r=e.tool==="spawnAgent"&&i==="completed"&&o!==null,s=(e.tool==="sendInput"||e.tool==="sendMessage"||e.tool==="followupTask")&&o!==null,l=De(e),c=[];if(l.length===0)c.push({key:"generic",node:W(e,"row",t)});for(let u of l){let m=n(Pe,{agent:u,showModel:e.tool==="spawnAgent"});if(r)c.push({key:u.threadId,node:n("span",{className:"codex-collab-line",children:P(t,"stream.codex.collab.createdWithInstructions",{},{agent:m,instructions:n(Q,{prompt:o})})})});else if(s)c.push({key:u.threadId,node:n("span",{className:"codex-collab-line",children:P(t,"stream.codex.collab.messagedWithPrompt",{action:i==="interrupted"?t("stream.codex.collab.interrupted"):t(`stream.codex.collab.messaged.${i}`)},{agent:m,prompt:n(Q,{prompt:o})})})});else{let g=e.tool!=="closeAgent"&&e.tool!=="resumeAgent"&&u.state!==null&&u.state!==null?u.state.message?.trim()?t("stream.codex.collab.stateWithMessage",{state:t(`stream.codex.collab.state.${u.state.status}`),message:u.state.message}):t("stream.codex.collab.stateOnly",{state:t(`stream.codex.collab.state.${u.state.status}`)}):"";c.push({key:u.threadId,node:P(t,"stream.codex.collab.agentRow",{action:W(e,"row",t),state:g},{agent:m})})}}if(!r&&!s&&o!==null)c.push({key:"input",node:P(t,"stream.codex.collab.input",{},{prompt:n("span",{className:"codex-collab-input",children:o})})});return c}function le({block:e}){let{t}=a(),[o,i]=I(`collab:${e.id}`,!1);if(e.tool==="wait")return null;let r=L(e.status),s=ce(e,t);return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":o,onClick:()=>i((l)=>!l),children:[p("span",{className:"codex-activity-label",children:[n(me,{className:"size-4 shrink-0","aria-hidden":"true"}),n("span",{className:"min-w-0 flex-1 truncate",children:r?n("span",{className:"codex-activity-running",children:s}):s})]}),n(M,{expanded:o})]}),n("div",{className:y("codex-activity-details-grid",o&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:Ue(e,t).map((l)=>n("div",{className:"codex-collab-row",children:l.node},l.key))})})})]})}function ue({block:e}){let{t,i18n:o}=a(),i=Boolean(e.isComplete),[r,s]=I(`thinking:${b(e)}`,!1),l=O(null),c=e.thinking.trim().length>0;V(()=>{if(i||!c)return;let d=l.current;if(d===null)throw Error("Thinking details are not mounted");let g=new ResizeObserver(()=>{d.scrollTop=d.scrollHeight}),f=null,T=()=>{let w=d.firstElementChild;if(w===f)return;if(f!==null)g.unobserve(f);if(f=w,f!==null)g.observe(f)},h=new MutationObserver(T);return h.observe(d,{childList:!0}),T(),()=>{h.disconnect(),g.disconnect()}},[c,i]);let u=i?e.durationMs!==void 0?t("stream.codex.thoughtFor",{duration:H(e.durationMs,o.language)}):t("stream.codex.thought"):t("message.thinking"),m=e.thinking.trimStart().replace(/^\*\*[^\n]*?\*\*\s*/,"");return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:y("codex-activity-header",!c&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":c?r:void 0,disabled:!c,onClick:()=>s((d)=>!d),children:[n("span",{className:"codex-activity-label",children:n("span",{className:"codex-reasoning-label min-w-0 flex-1 truncate",children:i?u:n("span",{className:"codex-activity-running",children:u})})}),c&&n(M,{expanded:r})]}),n("div",{className:y("codex-activity-details-grid",r&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:c&&n("div",{ref:l,className:"codex-reasoning-details",role:"region","aria-label":u,"aria-hidden":!r,tabIndex:0,inert:!r,children:n(v,{text:m,streaming:!i})})})})]})}function Ve(e){if(G(e))return"mcp";let t=A(e).category;return t==="think"||t==="switch_mode"?"other":t}function Oe(e,t,o,i){return i(`stream.codex.summary.${e}.${o?"leading":"following"}`,{count:t})}function Ze(e,t,o){let i=new Map,r=[],s=new Set;for(let c of e){if(G(c)&&typeof c.rawInput.server==="string"){if(s.size===0)r.push({kind:"integrations"});s.add(c.rawInput.server);continue}if(Z(c)){if(!r.some((m)=>m.kind==="named"&&m.title===c.title))r.push({kind:"named",title:c.title});continue}let u=Ve(c);if(!i.has(u))r.push({kind:"category",category:u});i.set(u,(i.get(u)??0)+1)}let l=r.map((c,u)=>{if(c.kind==="named")return c.title;if(c.kind==="integrations")return t(`stream.codex.summary.integrations.${u===0?"leading":"following"}`,{count:s.size,sources:new Intl.ListFormat(o,{style:"long",type:"conjunction"}).format([...s])});return Oe(c.category,i.get(c.category),u===0,t)});if(o.startsWith("zh"))return l.join("");return new Intl.ListFormat(o,{style:"long",type:"conjunction"}).format(l)}function ao({stateKey:e,durationMs:t,durationKind:o="work",active:i,defaultExpanded:r=i,startedAt:s,providerId:l,providerIcon:c,children:u}){let{t:m,i18n:d}=a(),[g,f]=I(`work:${e}`,r,!0),T=j(`work:${e}`,g||i),h=O(null),[w,C]=_(0);V(()=>{if(!i||t!==void 0){h.current=null;return}h.current=s??Date.now();let N=()=>{let R=h.current;if(R===null)throw Error("Codex work section is ticking without a start time");C(Date.now()-R)};N();let S=window.setInterval(N,1000);return()=>window.clearInterval(S)},[i,s,t]);let E=t!==void 0?m(o==="total"?"stream.codex.totalDuration":"stream.codex.workedFor",{duration:H(t,d.language)}):i&&w>=1000?m("stream.codex.workingFor",{duration:H(w,d.language)}):m(i?"stream.codex.working":"stream.codex.worked");return p("section",{className:"codex-work-section",children:[p("button",{type:"button",className:"codex-work-trigger","data-codex-disclosure":"","aria-expanded":g,onClick:()=>f((N)=>!N),children:[l!==void 0&&n("span",{className:"codex-work-provider-icon","data-testid":"codex-work-provider-icon","data-provider-id":l,"aria-hidden":"true",children:c}),n("span",{children:E}),n(M,{expanded:g,className:"codex-work-chevron"})]}),n("div",{className:"codex-work-separator","aria-hidden":"true"}),n("div",{className:y("codex-work-grid",g&&"codex-work-grid-open"),"aria-hidden":!g,inert:!g,children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-work-body",children:T&&u})})})]})}function He(e,t){if(e.type==="tool_use")return be(e,t);if(e.type==="thinking")return t("message.thinking");if(e.type==="collab")return ce(e,t);return t("stream.codex.subagentWorking",{name:e.name})}function X(e){if(e.type==="thinking")return!e.isComplete;if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return L(e.status);return!1}function We(e,t,o=1000){let[i,r]=_({text:e,live:t}),s=O(Date.now());return V(()=>{if(e===i.text&&t===i.live)return;let l=Date.now(),c=Math.max(0,s.current+o-l);if(c===0||t!==i.live){s.current=l,r({text:e,live:t});return}let u=window.setTimeout(()=>{s.current=Date.now(),r({text:e,live:t})},c);return()=>window.clearTimeout(u)},[i,t,o,e]),t===i.live?i.text:e}function je({blocks:e,defaultExpanded:t=!0}){let{t:o,i18n:i}=a(),r=e.some(X),s=b(e[0]),[l,c]=I(`group:${s}`,t),u=j(`group:${s}`,l||r),m=e.findLast(X)??e.at(-1);if(m===void 0)throw Error("CodexActivityGroup requires at least one activity block");let d=e.filter((f)=>f.type==="tool_use"),g=We(r?He(m,o):Ze(d,o,i.language),r);return p("div",{className:"codex-activity-group",children:[p("button",{type:"button",className:"codex-activity-group-trigger","data-codex-disclosure":"","aria-expanded":l,onClick:()=>c((f)=>!f),children:[p("span",{className:"codex-activity-label",children:[n(ee,{block:e[0]}),n("span",{className:"truncate",children:r?n("span",{className:"codex-activity-running",children:g}):g})]}),n(M,{expanded:l})]}),n("div",{className:y("codex-activity-group-grid",l&&"codex-activity-group-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-activity-group-body",children:u&&e.map((f)=>n(oe,{block:f},b(f)))})})})]})}function Y({blocks:e,defaultExpanded:t}){if(e.length===0)throw Error("CodexActivityGroup requires at least one activity block");if(e.length===1)return n(oe,{block:e[0]});return n(je,{blocks:e,defaultExpanded:t})}function Se({blocks:e,defaultExpanded:t}){if(!e.some(se))return n(Y,{blocks:e,defaultExpanded:t});let o=[];for(let i of e){let r=o.at(-1);if(r&&se(r[0])===se(i))r.push(i);else o.push([i])}return n(U,{children:o.map((i)=>se(i[0])?n(so,{blocks:i.filter(se)},b(i[0])):n(Y,{blocks:i,defaultExpanded:t},b(i[0])))})}
|
|
7
|
-
export{ao,
|
|
4
|
+
`)}function ne(e){let t=$e(e.rawOutput);if(t!==void 0)return t;let o=Le(e.content);if(o.length>0)return o;return Ae(e)}function Be({block:e,command:t}){let{t:o,Output:i,commandStatus:r}=a(),[s,l]=R(!1),[c,u]=R(!1),m=ne(e),d=r===void 0?e.exitCode===void 0?void 0:o("stream.codex.exitCode",{code:e.exitCode}):r(e),g=()=>{navigator.clipboard.writeText([`$ ${t}`,m].filter((f)=>f!==void 0).join(`
|
|
5
|
+
`)),l(!0),setTimeout(()=>l(!1),1500)};return n("div",{className:"codex-command-details",children:p("div",{className:"codex-command-card",children:[p("div",{className:"codex-command-line-row",children:[n("span",{className:"codex-command-prompt","aria-hidden":"true",children:"$"}),n("button",{type:"button",className:y("codex-command-line",!c&&"codex-command-line-clamped"),"data-codex-disclosure":"","aria-expanded":c,onClick:()=>u((f)=>!f),children:t}),n("button",{type:"button",className:"codex-command-copy","aria-label":o("actions.copy"),onClick:g,children:s?n(me,{}):n(ge,{})})]}),m!==void 0&&(i===void 0?n("pre",{className:"codex-command-output",children:m}):n(i,{text:m})),d!==void 0&&n("div",{className:"codex-command-footer",children:n("span",{className:"codex-command-status",children:d})})]})})}function ae({block:e}){let{t,openLink:o,Patch:i,openImage:r,commandStatus:s,expandToolOutput:l=!1}=a(),c=ne(e),u=i===void 0?void 0:e.content.flatMap((x)=>{if(x.type!=="diff")return[];let k=x;return k.patch?.text?[k.patch.text]:[]}).join(`
|
|
6
|
+
`),m=Ne(e.content),d=Te(e.content),[g,f]=I(`tool:${e.id}`,!1),T=j(`tool:${e.id}`,g),h=D(e),w=h.category,C=te(e,t),M=w==="execute"?A(e,"command"):void 0,N=M!==void 0||O(e)||m.length>0||d.length>0||Boolean(u)||l&&c!==void 0,E=!N&&!L(e.status)?h.filePath:void 0;if(w==="execute"&&!L(e.status)&&e.status!=="completed"){let x=s?.(e);if(x)C={...C,leading:x}}if(w==="read"&&L(e.status))return null;let S=p("span",{className:"codex-activity-label",children:[n(ee,{block:e}),n("span",{className:"min-w-0 flex-1 truncate",children:L(e.status)?n("span",{className:"codex-activity-running",children:C.trailing===void 0?C.leading:`${C.leading} ${C.trailing}`}):p(P,{children:[n("span",{className:"codex-activity-leading",children:C.leading}),C.trailing!==void 0&&(E!==void 0?p(P,{children:[" ",n("button",{type:"button",className:"codex-activity-trailing codex-activity-file-link",title:E,onClick:()=>o(E),children:C.trailing})]}):p("span",{className:"codex-activity-trailing",children:[" ",C.trailing]}))]})})]});return p("div",{className:"codex-activity-item",children:[N?p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-label":C.trailing===void 0?C.leading:`${C.leading} ${C.trailing}`,"aria-expanded":g,onClick:()=>f((x)=>!x),children:[S,n(B,{expanded:g})]}):n("div",{className:"codex-activity-header codex-activity-header-static",children:S}),n("div",{className:y("codex-activity-details-grid",g&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:T&&p(P,{children:[M!==void 0?n(Be,{block:e,command:M}):i!==void 0&&u?n(i,{patch:u}):c!==void 0&&n("pre",{className:"codex-activity-details",children:c}),m.length>0&&n("div",{className:"codex-activity-media",children:m.map((x)=>{let k=`data:${x.mimeType};base64,${x.data}`,q=n("img",{src:k,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},`${x.mimeType}:${x.data.slice(0,32)}`);return r===void 0?q:n("button",{type:"button",className:"cursor-pointer",onClick:()=>r(k),children:q},k)})}),d.map((x)=>n("audio",{className:"mt-1 w-full","aria-label":t("stream.codex.audioOutput"),controls:!0,src:`data:${x.mimeType};base64,${x.data}`},`${x.mimeType}:${x.data.slice(0,32)}`))]})})})]})}function oe({block:e}){if(e.type==="tool_use")return n(ae,{block:e});if(e.type==="thinking")return n(le,{block:e});if(e.type==="collab")return n(ce,{block:e});return n(ie,{block:e})}function ie({block:e}){let{t,openSession:o}=a(),i=L(e.status),[r,s]=I(`subagent:${e.id}`,i),l=V(i);U(()=>{if(i)s(!0);if(l.current&&!i)s(!1);l.current=i},[i,s]);let c=`${Re(e.activity,i,e.name,t)}${re(e.model,e.reasoningEffort,t)}`,u=e.threadId??"",m=e.blocks.length>0;return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:y("codex-activity-header",!m&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":m?r:void 0,disabled:!m,onClick:()=>s((d)=>!d),children:[p("span",{className:"codex-activity-label",children:[n(Se,{seed:e.threadId??e.id}),n("span",{className:"min-w-0 flex-1 truncate",children:o===void 0||e.threadId===null?i?n("span",{className:"codex-activity-running",children:c}):c:n("span",{role:"link",tabIndex:0,className:y("codex-agent-link",i&&"codex-activity-running"),"aria-label":t("stream.codex.subagentOpen",{name:e.name}),onClick:(d)=>{d.stopPropagation(),o(u,e.name)},onKeyDown:(d)=>{if(d.key!=="Enter"&&d.key!==" ")return;d.preventDefault(),d.stopPropagation(),o(u,e.name)},children:c})})]}),m&&n(B,{expanded:r})]}),n("div",{className:y("codex-activity-details-grid",r&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:e.blocks.map((d)=>{if(d.type==="tool_use")return n(ae,{block:d},d.id);if(d.type==="thinking")return n(le,{block:d},b(d));if(d.type==="subagent")return n(ie,{block:d},d.id);if(d.type==="collab")return n(ce,{block:d},d.id);if(d.type==="text")return n("div",{className:"codex-reasoning-details",children:n(v,{text:d.text,streaming:!1})},b(d));if(d.type==="plan")return n(W,{entries:d.entries},b(d));if(d.type==="image")return n("img",{src:`data:${d.source.media_type};base64,${d.source.data}`,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},b(d));return null})})})})]})}var Ie=8;function Ee(e){let t=0;for(let o=0;o<e.length;o+=1)t=(t*31+e.charCodeAt(o))%2147483647;return t%Ie}function Se({seed:e}){return n("span",{className:"codex-agent-avatar","data-hue":Ee(e),"aria-hidden":"true"})}function Re(e,t,o,i){switch(e){case"started":return i(t?"stream.codex.subagentWorking":"stream.codex.subagentFinished",{name:o});case"interacted":return i("stream.codex.subagentMessaged",{name:o});case"interrupted":return i("stream.codex.subagentInterrupted",{name:o});case"completed":return i("stream.codex.subagentFinished",{name:o})}}var _e=new Set(["none","minimal","low","medium","high","xhigh","max","ultra","persistent"]);function re(e,t,o){if(e===null)return"";if(t===null)return` · ${zt(e)}`;let i=_e.has(t)?o(`stream.codex.reasoningEffort.${t}`):t;return` · ${zt(e)} · ${i}`}var Fe={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,t,o){if(e.tool==="wait")throw Error("Codex does not present wait calls");let i=se(e.status);if(i==="interrupted")return o("stream.codex.collab.interrupted");return o(`stream.codex.collab.${t}.${Fe[e.tool]}.${i}`)}function De(e){return e.agents.filter((t)=>t.nickname!==null)}function de(e,t){let o=e.agents.length>0?e.agents.length:1;return`${H(e,"header",t)}${t("stream.codex.collab.agentCount",{count:o})}`}var _="\x01";function F(e,t,o,i){let r=Object.fromEntries(Object.keys(i).map((s)=>[s,`${_}${s}${_}`]));return e(t,{...o,...r}).split(new RegExp(`${_}(\\w+)${_}`,"u")).map((s,l)=>n(fe,{children:l%2===1?i[s]:s},`${l}:${s}`))}function Pe({agent:e,showModel:t}){let{t:o,openSession:i}=a(),r=e.nickname??"",s=i===void 0?n("span",{className:"font-medium",children:r}):n("button",{type:"button",className:"codex-agent-link font-medium","aria-label":o("stream.codex.subagentOpen",{name:r}),onClick:()=>i(e.threadId,r),children:r});return p("span",{children:[s,e.role!==null&&` (${e.role})`,t&&re(e.model,e.reasoningEffort,o)]})}function Q({prompt:e}){return n("span",{className:"codex-collab-prompt",title:e,children:e})}function Ue(e,t){let o=e.prompt?.trim()?e.prompt:null,i=se(e.status),r=e.tool==="spawnAgent"&&i==="completed"&&o!==null,s=(e.tool==="sendInput"||e.tool==="sendMessage"||e.tool==="followupTask")&&o!==null,l=De(e),c=[];if(l.length===0)c.push({key:"generic",node:H(e,"row",t)});for(let u of l){let m=n(Pe,{agent:u,showModel:e.tool==="spawnAgent"});if(r)c.push({key:u.threadId,node:n("span",{className:"codex-collab-line",children:F(t,"stream.codex.collab.createdWithInstructions",{},{agent:m,instructions:n(Q,{prompt:o})})})});else if(s)c.push({key:u.threadId,node:n("span",{className:"codex-collab-line",children:F(t,"stream.codex.collab.messagedWithPrompt",{action:i==="interrupted"?t("stream.codex.collab.interrupted"):t(`stream.codex.collab.messaged.${i}`)},{agent:m,prompt:n(Q,{prompt:o})})})});else{let g=e.tool!=="closeAgent"&&e.tool!=="resumeAgent"&&u.state!==null&&u.state!==null?u.state.message?.trim()?t("stream.codex.collab.stateWithMessage",{state:t(`stream.codex.collab.state.${u.state.status}`),message:u.state.message}):t("stream.codex.collab.stateOnly",{state:t(`stream.codex.collab.state.${u.state.status}`)}):"";c.push({key:u.threadId,node:F(t,"stream.codex.collab.agentRow",{action:H(e,"row",t),state:g},{agent:m})})}}if(!r&&!s&&o!==null)c.push({key:"input",node:F(t,"stream.codex.collab.input",{},{prompt:n("span",{className:"codex-collab-input",children:o})})});return c}function ce({block:e}){let{t}=a(),[o,i]=I(`collab:${e.id}`,!1);if(e.tool==="wait")return null;let r=L(e.status),s=de(e,t);return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":o,onClick:()=>i((l)=>!l),children:[p("span",{className:"codex-activity-label",children:[n(ue,{className:"size-4 shrink-0","aria-hidden":"true"}),n("span",{className:"min-w-0 flex-1 truncate",children:r?n("span",{className:"codex-activity-running",children:s}):s})]}),n(B,{expanded:o})]}),n("div",{className:y("codex-activity-details-grid",o&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:Ue(e,t).map((l)=>n("div",{className:"codex-collab-row",children:l.node},l.key))})})})]})}function le({block:e}){let{t,i18n:o}=a(),i=Boolean(e.isComplete),[r,s]=I(`thinking:${b(e)}`,!1),l=V(null),c=e.thinking.trim().length>0;U(()=>{if(i||!c)return;let d=l.current;if(d===null)throw Error("Thinking details are not mounted");let g=new ResizeObserver(()=>{d.scrollTop=d.scrollHeight}),f=null,T=()=>{let w=d.firstElementChild;if(w===f)return;if(f!==null)g.unobserve(f);if(f=w,f!==null)g.observe(f)},h=new MutationObserver(T);return h.observe(d,{childList:!0}),T(),()=>{h.disconnect(),g.disconnect()}},[c,i]);let u=i?e.durationMs!==void 0?t("stream.codex.thoughtFor",{duration:Z(e.durationMs,o.language)}):t("stream.codex.thought"):t("message.thinking"),m=e.thinking.trimStart().replace(/^\*\*[^\n]*?\*\*\s*/,"");return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:y("codex-activity-header",!c&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":c?r:void 0,disabled:!c,onClick:()=>s((d)=>!d),children:[n("span",{className:"codex-activity-label",children:n("span",{className:"codex-reasoning-label min-w-0 flex-1 truncate",children:i?u:n("span",{className:"codex-activity-running",children:u})})}),c&&n(B,{expanded:r})]}),n("div",{className:y("codex-activity-details-grid",r&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:c&&n("div",{ref:l,className:"codex-reasoning-details",role:"region","aria-label":u,"aria-hidden":!r,tabIndex:0,inert:!r,children:n(v,{text:m,streaming:!i})})})})]})}function Ve(e){if(G(e))return"mcp";let t=D(e).category;return t==="think"||t==="switch_mode"?"other":t}function Oe(e,t,o,i){return i(`stream.codex.summary.${e}.${o?"leading":"following"}`,{count:t})}function Ze(e,t,o){let i=new Map,r=[],s=new Set;for(let c of e){if(G(c)&&typeof c.rawInput.server==="string"){if(s.size===0)r.push({kind:"integrations"});s.add(c.rawInput.server);continue}if(O(c)){if(!r.some((m)=>m.kind==="named"&&m.title===c.title))r.push({kind:"named",title:c.title});continue}let u=Ve(c);if(!i.has(u))r.push({kind:"category",category:u});i.set(u,(i.get(u)??0)+1)}let l=r.map((c,u)=>{if(c.kind==="named")return c.title;if(c.kind==="integrations")return t(`stream.codex.summary.integrations.${u===0?"leading":"following"}`,{count:s.size,sources:new Intl.ListFormat(o,{style:"long",type:"conjunction"}).format([...s])});return Oe(c.category,i.get(c.category),u===0,t)});if(o.startsWith("zh"))return l.join("");return new Intl.ListFormat(o,{style:"long",type:"conjunction"}).format(l)}function ao({stateKey:e,durationMs:t,durationKind:o="work",active:i,defaultExpanded:r=i,startedAt:s,providerId:l,providerIcon:c,children:u}){let{t:m,i18n:d}=a(),[g,f]=I(`work:${e}`,r,!0),T=j(`work:${e}`,g||i),h=V(null),[w,C]=R(0);U(()=>{if(!i||t!==void 0){h.current=null;return}h.current=s??Date.now();let N=()=>{let S=h.current;if(S===null)throw Error("Codex work section is ticking without a start time");C(Date.now()-S)};N();let E=window.setInterval(N,1000);return()=>window.clearInterval(E)},[i,s,t]);let M=t!==void 0?m(o==="total"?"stream.codex.totalDuration":"stream.codex.workedFor",{duration:Z(t,d.language)}):i&&w>=1000?m("stream.codex.workingFor",{duration:Z(w,d.language)}):m(i?"stream.codex.working":"stream.codex.worked");return p("section",{className:"codex-work-section",children:[p("button",{type:"button",className:"codex-work-trigger","data-codex-disclosure":"","aria-expanded":g,onClick:()=>f((N)=>!N),children:[l!==void 0&&n("span",{className:"codex-work-provider-icon","data-testid":"codex-work-provider-icon","data-provider-id":l,"aria-hidden":"true",children:c}),n("span",{children:M}),n(B,{expanded:g,className:"codex-work-chevron"})]}),n("div",{className:"codex-work-separator","aria-hidden":"true"}),n("div",{className:y("codex-work-grid",g&&"codex-work-grid-open"),"aria-hidden":!g,inert:!g,children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-work-body",children:T&&u})})})]})}function He(e,t){if(e.type==="tool_use")return be(e,t);if(e.type==="thinking")return t("message.thinking");if(e.type==="collab")return de(e,t);return t("stream.codex.subagentWorking",{name:e.name})}function X(e){if(e.type==="thinking")return!e.isComplete;if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return L(e.status);return!1}function We(e,t,o=1000){let[i,r]=R({text:e,live:t}),s=V(Date.now());return U(()=>{if(e===i.text&&t===i.live)return;let l=Date.now(),c=Math.max(0,s.current+o-l);if(c===0||t!==i.live){s.current=l,r({text:e,live:t});return}let u=window.setTimeout(()=>{s.current=Date.now(),r({text:e,live:t})},c);return()=>window.clearTimeout(u)},[i,t,o,e]),t===i.live?i.text:e}function je({blocks:e,defaultExpanded:t=!0}){let{t:o,i18n:i}=a(),r=e.some(X),s=b(e[0]),[l,c]=I(`group:${s}`,t),u=j(`group:${s}`,l||r),m=e.findLast(X)??e.at(-1);if(m===void 0)throw Error("CodexActivityGroup requires at least one activity block");let d=e.filter((f)=>f.type==="tool_use"),g=We(r?He(m,o):Ze(d,o,i.language),r);return p("div",{className:"codex-activity-group",children:[p("button",{type:"button",className:"codex-activity-group-trigger","data-codex-disclosure":"","aria-expanded":l,onClick:()=>c((f)=>!f),children:[p("span",{className:"codex-activity-label",children:[n(ee,{block:e[0]}),n("span",{className:"truncate",children:r?n("span",{className:"codex-activity-running",children:g}):g})]}),n(B,{expanded:l})]}),n("div",{className:y("codex-activity-group-grid",l&&"codex-activity-group-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-activity-group-body",children:u&&e.map((f)=>n(oe,{block:f},b(f)))})})})]})}function Y({blocks:e,defaultExpanded:t}){if(e.length===0)throw Error("CodexActivityGroup requires at least one activity block");if(e.length===1)return n(oe,{block:e[0]});return n(je,{blocks:e,defaultExpanded:t})}function Me({blocks:e,defaultExpanded:t}){if(!e.some(pe))return n(Y,{blocks:e,defaultExpanded:t});let o=[];for(let i of e){let r=o.at(-1);if(r&&pe(r[0])===pe(i))r.push(i);else o.push([i])}return n(P,{children:o.map((i)=>pe(i[0])?n(so,{blocks:i.filter(pe)},b(i[0])):n(Y,{blocks:i,defaultExpanded:t},b(i[0])))})}
|
|
7
|
+
export{ao,Me};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useCallback as f,useEffect as U,useRef as s,useState as X}from"react";var S=24,q=160,z=45,j=()=>{};function
|
|
2
|
-
export{
|
|
1
|
+
import{useCallback as f,useEffect as U,useRef as s,useState as X}from"react";var S=24,q=160,z=45,j=()=>{};function oo(e,Y,u=j){let r=s("following"),[A,b]=X(!0),D=s(Y);D.current=Y;let a=s(null),y=s(0),P=s(0),k=s(0),p=s(0),m=s(0),h=s(0),_=s(!1),g=s(null),o=f(()=>{if(a.current!==null)cancelAnimationFrame(a.current);a.current=null},[]),v=f(()=>{u(),o(),h.current++,g.current=null,m.current=0,r.current="reading",b(!1)},[o,u]),T=f(()=>{if(e===null||r.current!=="following"||a.current!==null)return;if(e.scrollTop>=Math.max(0,e.scrollHeight-e.clientHeight))return;y.current=performance.now(),P.current=e.scrollTop,k.current=0;let l=(c)=>{if(a.current=null,r.current!=="following")return;let i=Math.max(0,e.scrollHeight-e.clientHeight),w=i-e.scrollTop;if(w<=0)return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||w<=1)e.scrollTop=i;else{let E=Math.max(0,c-y.current),H=e.scrollTop===P.current?k.current:0,L=e.scrollTop+H+(w-H)*(1-Math.exp(-E/z));e.scrollTop=L,P.current=e.scrollTop,k.current=L-e.scrollTop,a.current=requestAnimationFrame(l)}y.current=c,p.current=e.scrollTop};a.current=requestAnimationFrame(l)},[e]),d=f(()=>{u(),h.current++,g.current=null,m.current=0,r.current="following",b(!0),T()},[u,T]),B=f((l)=>{u(),o();let c=++h.current;return r.current="locating",_.current=l,g.current=null,m.current=0,b(l),{isCurrent:()=>h.current===c,finish:(i)=>{if(h.current!==c||e===null)return;e.scrollTo({top:i,behavior:"instant"}),p.current=e.scrollTop,r.current=l?"following":"reading"}}},[o,u,e]),x=f(()=>{if(h.current++,r.current==="locating")r.current=_.current?"following":"reading"},[]),G=f((l=null)=>{if(e===null)return;let c=g.current;if(c!==null&&e.scrollHeight!==c){if(g.current=null,e.scrollHeight<c&&e.scrollHeight-e.clientHeight-e.scrollTop<=S)d()}if(r.current==="following"&&l!==null)o(),e.scrollTo({top:l,behavior:"instant"}),p.current=e.scrollTop;else T()},[o,e,T,d]);return U(()=>{if(e===null)return;p.current=e.scrollTop,r.current=e.scrollHeight-e.clientHeight-e.scrollTop<=S?"following":"reading",b(r.current==="following");let l=!1,c=!1,i=null,w=e.closest('[data-slot="scroll-area"]'),F=w??e,E=(n)=>{if(g.current=null,(n<0||r.current==="locating")&&e.scrollHeight>e.clientHeight)v();else u();if(m.current=n,r.current==="reading"&&n>0&&e.scrollHeight-e.clientHeight-e.scrollTop<=1)d()},H=()=>{let n=e.scrollTop>p.current;p.current=e.scrollTop;let t=n&&m.current>0;if(m.current=0,l){c=n;return}if(r.current!=="reading"||!t)return;let M=D.current?q:S;if(e.scrollHeight-e.clientHeight-e.scrollTop<=M)d()},L=(n)=>{if(n.ctrlKey||n.deltaY===0)return;let t=n.target instanceof Element?n.target:null;while(t!==null&&t!==e){if(t.scrollHeight>t.clientHeight&&/auto|scroll/.test(getComputedStyle(t).overflowY)){if(n.deltaY<0?t.scrollTop>0:t.scrollTop+t.clientHeight<t.scrollHeight)return}t=t.parentElement}E(Math.sign(n.deltaY))},C=(n)=>{i=n.touches[0].clientY},O=(n)=>{let t=n.touches[0].clientY;if(i!==null&&t!==i)E(Math.sign(i-t));i=t},I=(n)=>{if(n.defaultPrevented||!(n.target instanceof Element))return;if(n.target.closest("input, textarea, select, button, a, [contenteditable='true']"))return;if(["ArrowUp","PageUp","Home"].includes(n.key)||n.key===" "&&n.shiftKey)E(-1);else if(["ArrowDown","PageDown","End"," "].includes(n.key))E(1)},N=(n)=>{let t=n.target instanceof Element?n.target.closest('[data-slot="scroll-area-scrollbar"][data-orientation="vertical"]'):null,M=t!==null&&t.closest('[data-slot="scroll-area"]')===w;if(l=(n.target===e||M)&&n.button===0&&e.scrollHeight>e.clientHeight,c=!1,l)v()},R=()=>{let n=D.current?q:S;if(l&&c&&e.scrollHeight-e.clientHeight-e.scrollTop<=n)d();l=!1},K=()=>{l=!1},W=(n)=>{if(!(n.target instanceof Element)||n.target.closest("[data-codex-disclosure]")===null)return;v(),g.current=e.scrollHeight};return e.addEventListener("scroll",H,{passive:!0}),e.addEventListener("wheel",L,{passive:!0}),e.addEventListener("touchstart",C,{passive:!0}),e.addEventListener("touchmove",O,{passive:!0}),e.addEventListener("keydown",I),F.addEventListener("pointerdown",N,{capture:!0}),window.addEventListener("pointerup",R),window.addEventListener("pointercancel",K),e.addEventListener("click",W,{capture:!0}),()=>{o(),x(),e.removeEventListener("scroll",H),e.removeEventListener("wheel",L),e.removeEventListener("touchstart",C),e.removeEventListener("touchmove",O),e.removeEventListener("keydown",I),F.removeEventListener("pointerdown",N,{capture:!0}),window.removeEventListener("pointerup",R),window.removeEventListener("pointercancel",K),e.removeEventListener("click",W,{capture:!0})}},[e,o,x,u,d,v]),{isFollowing:A,scrollToBottom:d,stopFollowing:v,schedulePin:T,contentResized:G,beginLocate:B,cancelLocation:x}}
|
|
2
|
+
export{oo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-cg97byvk.js";import{Cn,Tn,In,Pn,
|
|
2
|
-
export{
|
|
1
|
+
import{e}from"./chunk-cg97byvk.js";import{Cn,Tn,In,Sn,Pn,Nn}from"./chunk-7ncycdpp.js";import{ExternalLinkIcon as d}from"lucide-react";import{jsx as a,jsxs as n}from"react/jsx-runtime";function wn({message:r,url:t,t:i,onOpen:l,onRespond:o}){return n(Cn,{size:"sm",children:[n(Tn,{children:[a(Sn,{children:i("approval.needed")}),a(In,{children:r})]}),a(Pn,{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(Nn,{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")})]})]})}
|
|
2
|
+
export{wn};
|
|
@@ -1 +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
|
|
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 ue({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{ue};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_n,
|
|
1
|
+
import{_n,me,Dt,Hn,On,Fn}from"./chunk-gd9s35b8.js";import{forwardRef as ve,useCallback as K,useEffect as ge,useImperativeHandle as pe,useLayoutEffect as w,useMemo as ne,useRef as s,useState as F}from"react";import{jsx as R,jsxs as re}from"react/jsx-runtime";var Re=12,X=2,V=800,he=new Map;function He({turnKey:q,heightPx:x,placeholder:W=!1,deferUntilReady:n=!1,observe:H,onReady:L,children:z}){let h=s(null),[T,_]=F(!1),U=K((m)=>{h.current=m,H(q,m)},[H,q]);return w(()=>{let m=h.current;if(m===null)throw Error("Codex turn element is missing");let b=()=>{L(m),_(!0)};if(m.querySelector("[data-markdown-pending]")===null){b();return}let d=new MutationObserver(()=>{if(m.querySelector("[data-markdown-pending]")!==null)return;d.disconnect(),b()});return d.observe(m,{childList:!0,subtree:!0}),()=>d.disconnect()},[L]),re("div",{style:T?void 0:{position:"relative",height:x,overflow:"hidden"},children:[R("div",{ref:U,className:"[&_[data-virtualized-turn-content]]:[content-visibility:visible]","data-turn-key":q,"aria-busy":!T||void 0,style:!T&&!W&&n?{visibility:"hidden"}:void 0,"data-turn-ready":T?"":void 0,children:z}),!T&&!W&&n&&R("div",{"aria-hidden":"true",className:"codex-turn-loading",children:re("div",{className:"codex-turn-loading-lines",children:[R("span",{}),R("span",{}),R("span",{})]})})]})}var Dn=ve(function({entries:x,renderTurn:W,scrollElement:n,sessionKey:H,leadingContent:L,leadingInsetPx:z=0,preserveViewport:h=!1},T){let _=s(null),[U,m]=F(z),b=L!==void 0&&L!==null;w(()=>{let e=_.current;if(e===null)return;let t=()=>m(e.getBoundingClientRect().height);t();let o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[b]);let d=ne(()=>he.get(H),[H]),[j,J]=F(()=>d?.turnHeightsByKey??{}),i=ne(()=>_n({entries:x,gapPx:Re,measuredHeightsByKey:j,leadingInsetPx:b?U:z}),[x,j,b,U,z]),fe=ne(()=>{let e=me({distanceFromBottomPx:d?.distanceFromBottomPx??0,layout:i,overscanCount:X,viewportHeightPx:V}),t=d?.renderedWindow;if(t===void 0||t===null)return e;return Dt({anchorKey:t.anchorKey,layout:i,previousRange:{startIndex:0,endIndex:Math.min(t.count,e.endIndex-e.startIndex)}})??e},[d,i]),[M,ie]=F(fe),[y,oe]=F(V),[c,ue]=F(null),N=s(d?.distanceFromBottomPx??0),k=s(M),ae=s(i.turnKeys),l=s(j),S=s(i),se=s(i),P=s(new Map),v=s(null),C=s(null),E=s(null),D=s(new Map),Q=s(!1),ce=s(()=>{}),O=s(null),de=K(()=>{if(!h||n===null||v.current!==null||O.current!==null)return;let e=n.getBoundingClientRect();if(e.height<=0)return;let t=[...P.current].filter(([,r])=>r.hasAttribute("data-turn-ready")).map(([r,u])=>{let a=u.getBoundingClientRect(),g=S.current.turnIndexByKey.get(r),B=g===void 0?a.height:S.current.heightsPx[g];return{key:r,element:u,rect:a,bottom:a.top+B}}).filter(({rect:r,bottom:u})=>u>e.top&&r.top<e.bottom).toSorted((r,u)=>r.rect.top-u.rect.top),o=t.flatMap((r)=>[...r.element.querySelectorAll("[data-user-message-bubble], .codex-markdown-root > *")].filter((u)=>!u.closest('[aria-hidden="true"], [inert]')).map((u)=>({key:r.key,element:u,rect:u.getBoundingClientRect()})).filter(({rect:u})=>u.height>0&&u.top>=e.top&&u.top<e.bottom)).toSorted((r,u)=>r.rect.top-u.rect.top)[0]??t[0];if(o)O.current={key:o.key,element:o.element,top:o.rect.top-e.top,scrollTop:n.scrollTop}},[h,n]),Y=s(de);Y.current=de;let p=K((e,t)=>{let o=Math.min(e,i.totalHeightPx),r=me({distanceFromBottomPx:o,layout:i,overscanCount:X,viewportHeightPx:t}),u=k.current,a=u.startIndex<=r.startIndex&&u.endIndex>=r.endIndex?u:r;if(N.current=o,k.current=a,ae.current=i.turnKeys,oe(t),a!==u)ie(a)},[i]),A=K((e)=>{let t=Math.max(0,e.scrollHeight-i.totalHeightPx);return Math.max(0,e.scrollHeight-e.clientHeight-e.scrollTop-t)},[i.totalHeightPx]),xe=K((e)=>{let t=e.dataset.turnKey;if(t===void 0)throw Error("Codex measured turn is missing its key");let o=Math.max(1,e.getBoundingClientRect().height);if(l.current[t]===o)return;Y.current();let r={...l.current,[t]:o};l.current=r,J(r)},[]),Z=K(()=>{if(C.current!==null)return C.current;return C.current=new ResizeObserver((e)=>{for(let t of e){let o=t.target;if(!("turnReady"in o.dataset)&&o.querySelector("[data-markdown-pending]")!==null)continue;let r=o.dataset.turnKey;if(r===void 0)throw Error("Codex measured turn is missing its key");let u=Math.max(1,t.borderBoxSize[0]?.blockSize??t.contentRect.height);D.current.set(r,u)}if(E.current!==null||D.current.size===0)return;E.current=requestAnimationFrame(()=>{E.current=null;let t=[...D.current].filter(([r,u])=>l.current[r]!==u);if(D.current.clear(),t.length===0)return;Y.current();let o={...l.current,...Object.fromEntries(t)};l.current=o,J(o)})}),C.current},[]),ye=K((e,t)=>{let o=P.current.get(e);if(o!==void 0)Z().unobserve(o),P.current.delete(e);if(t===null)return;if(t.dataset.turnKey!==e)throw Error(`Codex turn key does not match its element: ${e}`);P.current.set(e,t),Z().observe(t)},[Z]);ge(()=>()=>{if(C.current?.disconnect(),E.current!==null)cancelAnimationFrame(E.current);D.current.clear(),C.current=null,P.current.clear()},[]),w(()=>{ce.current=()=>{if(n===null)return;let e=A(n);if(v.current!==null){N.current=e,oe(n.clientHeight||V);return}p(e,n.clientHeight||V)}},[A,n,p]),w(()=>{if(n===null)return;if(!Q.current){Q.current=!0;let o=d?.distanceFromBottomPx??0;n.scrollTo({behavior:"instant",top:Math.max(0,o>0?S.current.totalHeightPx-n.clientHeight-o:n.scrollHeight-n.clientHeight)})}let e=()=>ce.current();e(),n.addEventListener("scroll",e,{passive:!0});let t=new ResizeObserver(e);return t.observe(n),()=>{n.removeEventListener("scroll",e),t.disconnect()}},[d,n]),w(()=>{if(n===null||c===null)return;let e=P.current.get(c.turnKey);if(e?.querySelector("[data-markdown-pending]")!==null)return;let t=e.offsetHeight;if(t<=0)return;if(l.current[c.turnKey]!==t){let g={...l.current,[c.turnKey]:t};l.current=g,J(g);return}let o=c.getTargetElement(e)??e,r=e.getBoundingClientRect(),u=o.getBoundingClientRect(),a=Fn({align:c.align,layout:i,targetHeightPx:u.height,targetOffsetPx:u.top-r.top,turnKey:c.turnKey,viewportHeightPx:n.clientHeight});if(a===null)throw Error(`Codex virtual turn is missing: ${c.turnKey}`);n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-a)}),p(a,n.clientHeight||V),queueMicrotask(()=>{if(v.current!==c)return;c.complete(),v.current=null,ue(null)})},[i,c,n,p]),w(()=>{let e=se.current;if(se.current=i,S.current=i,n===null||c!==null){O.current=null;return}let t=O.current;O.current=null;let o=t===null?void 0:n.contains(t.element)?t.element:P.current.get(t.key);if(h&&e!==i&&t!==null&&o!==void 0){let u=o.getBoundingClientRect().top-n.getBoundingClientRect().top,a=n.scrollTop-t.scrollTop;n.scrollTop+=u-t.top+a,p(A(n),n.clientHeight);return}let r=N.current;if(h&&e!==i&&Q.current)r=Math.max(0,e.totalHeightPx-n.clientHeight-n.scrollTop);if((r>24||h)&&e!==i){let u=A(n);if(u<=96&&!h){p(u,y);return}let a=me({distanceFromBottomPx:r,layout:e,overscanCount:0,viewportHeightPx:y}),g=e.turnKeys.slice(a.startIndex,a.endIndex).filter((f)=>i.turnIndexByKey.has(f)),B=g.find((f)=>l.current[f]!==void 0)??g[0];if(B!==void 0){let f=Hn({anchorKey:B,distanceFromBottomPx:r,nextLayout:i,previousLayout:e});if(f===null)throw Error(`Codex viewport anchor is missing: ${B}`);r=f,n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-r)})}}p(r,y)},[i,c,A,n,p,y,h]),w(()=>{k.current=M},[M]),ge(()=>()=>{v.current?.complete(),v.current=null;let e=k.current,o=S.current.turnKeys[e.startIndex];he.set(H,{distanceFromBottomPx:N.current,renderedWindow:o===void 0?null:{anchorKey:o,count:e.endIndex-e.startIndex},turnHeightsByKey:l.current})},[H]),pe(T,()=>({scrollToKey(e,t=(r)=>r,o={align:"center"}){v.current?.complete();let r=i.turnIndexByKey.get(e);if(r===void 0)throw Error(`Codex virtual turn is missing: ${e}`);let u=i.turnKeys[r],a=On({layout:i,turnKey:e,viewportHeightPx:y});if(a===null)throw Error(`Codex virtual turn is missing: ${e}`);let g=me({distanceFromBottomPx:a,layout:i,overscanCount:X,viewportHeightPx:y});return k.current=g,ie(g),new Promise((B)=>{let f={align:o.align,complete:B,getTargetElement:t,turnKey:u};v.current=f,ue(f)})}}),[i,y]);let I=M,G=ae.current;if(!(G===i.turnKeys||G.length===i.turnKeys.length&&G.every((e,t)=>e===i.turnKeys[t]))){let e=G[M.startIndex];I=(e===void 0?null:Dt({anchorKey:e,layout:i,previousRange:M}))??me({distanceFromBottomPx:N.current,layout:i,overscanCount:X,viewportHeightPx:y})}let ee=x.length-1,le=x[ee],te=x.slice(I.startIndex,Math.min(I.endIndex,ee)).map((e,t)=>({entry:e,index:I.startIndex+t}));if(le!==void 0)te.push({entry:le,index:ee});return re("div",{"data-codex-timeline":!0,"data-codex-virtualized-pending-key":c?.turnKey,"data-codex-virtualized-range":`${I.startIndex}:${I.endIndex}`,"data-codex-virtualized-total-count":x.length,"data-codex-virtualized-turn-count":te.length,className:"relative shrink-0",style:{height:i.totalHeightPx},children:[b&&R("div",{ref:_,"data-codex-timeline-leading":!0,className:"absolute inset-x-0 top-0",children:L}),te.map(({entry:e,index:t})=>R("div",{className:"absolute inset-x-0",style:{top:i.topOffsetsPx[t]??0},children:R(He,{turnKey:e.turnKey,heightPx:i.heightsPx[t],placeholder:e.placeholder,deferUntilReady:e.deferUntilReady,observe:ye,onReady:xe,children:W(e,t)})},e.turnKey))]})});
|
|
2
2
|
export{Dn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o}from"./chunk-dp8pjv6r.js";import{e}from"./chunk-cg97byvk.js";import{Ln}from"./chunk-szanfktp.js";import{ge,fe,he,ve}from"./chunk-9evhky1b.js";import{n,C}from"./chunk-ysc51tpb.js";import{Loader2Icon as f}from"lucide-react";import{jsx as i,jsxs as m}from"react/jsx-runtime";function st({session:t,timeline:c}){let{host:s,client:a}=n(),{t:r}=s,l=o((y)=>y.historyPages[t.id]?.cursor!=null),d=()=>C(s,a.open(t.id,t.cwd)),p=i(Ln,{...c,session:t,client:a,host:s});if(t.restoring)return t.items.length===0?m("div",{className:"text-muted-foreground flex flex-1 items-center justify-center gap-2 text-sm",children:[i(f,{className:"size-4 animate-spin","aria-hidden":"true"}),r("conversation.restoring")]}):p;if(!t.attached&&t.items.length===0)return m(ge,{className:"flex-1",children:[m(fe,{children:[i(he,{children:r("conversation.reopen")}),i(ve,{children:r("conversation.detached")})]}),i(e,{onClick:d,children:r("conversation.reopen")})]});if(t.items.length===0&&t.state==="idle"&&!l)return i(ge,{className:"flex-1",children:m(fe,{children:[i(he,{className:"text-[28px] font-normal",children:r("conversation.welcomeTitle")}),i(ve,{className:"truncate font-mono",children:t.cwd})]})});return p}
|
|
2
|
+
export{st};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function
|
|
2
|
-
export{
|
|
1
|
+
import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function eo(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function Ht(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
|
|
2
|
+
export{eo,Ht};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e}from"./chunk-cg97byvk.js";import{
|
|
1
|
+
import{e}from"./chunk-cg97byvk.js";import{Q}from"./chunk-ksv9pjc2.js";import{Zt}from"./chunk-f7kngj14.js";import{Eo}from"./chunk-294gms5s.js";import{ze}from"./chunk-pth2ajxw.js";import{autoUpdate as rt}from"@floating-ui/dom";import{cn as X}from"cn";import{BookOpenTextIcon as st,FileIcon as it,StoreIcon as lt}from"lucide-react";import{useCallback as ut,useEffect as v,useLayoutEffect as Y,useMemo as Z,useRef as _,useState as g}from"react";import{createPortal as at}from"react-dom";import{jsx as p,jsxs as E,Fragment as ct}from"react/jsx-runtime";function Ro({handleRef:a,anchorRef:c,commands:C,searchFiles:u,onMention:R,onSearchError:H,fileSearchDebounceMs:M=0,bashMode:A=!1,forcedOpen:i=!1,onForcedOpenChange:f,emptyLabel:F,fileStatusLabels:h,morePlugins:D}){let j=ze(),l=j.textInput.value,[z,K]=g(0),[y,P]=g(null),[b,L]=g(0),U=_(null);v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=()=>K(t.selectionStart??0),o=()=>{if(document.activeElement===t)n()};return t.addEventListener("keyup",n),t.addEventListener("click",n),t.addEventListener("input",n),t.addEventListener("select",n),t.addEventListener("focus",n),document.addEventListener("selectionchange",o),()=>{t.removeEventListener("keyup",n),t.removeEventListener("click",n),t.removeEventListener("input",n),t.removeEventListener("select",n),t.removeEventListener("focus",n),document.removeEventListener("selectionchange",o)}});let V=Z(()=>A&&l.startsWith("!")?null:Eo(l,z),[l,z,A]),r=V?.kind==="at"&&!u?null:V,q=`${r?.kind??"forced"}:${r?.query??""}:${i}`,[O,tt]=g(q);if(O!==q)tt(q),L(0);let I=_(null);v(()=>{if(!i){I.current=null;return}if(I.current===null)I.current=l;else if(l!==I.current)f?.(!1)},[i,l,f]);let x=r?.kind==="at"?r.query:null;v(()=>{if(x===null||!u){P(null);return}let t=!0,n=()=>{u(x).then((s)=>{if(t)P({query:x,search:u,items:s})},(s)=>{if(t)P({query:x,search:u,items:[]}),H(s)})},o=M>0?window.setTimeout(n,M):null;if(o===null)n();return()=>{if(t=!1,o!==null)window.clearTimeout(o)}},[x,u,M,H]);let d=Z(()=>{if(r?.kind==="at")return y?.query===r.query&&y.search===u?y.items:[];if(r)return Zt(C,r.query);if(i)return Zt(C,"");return[]},[r,i,C,y,u]),[et,N]=g(!1);v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=()=>N(!0),o=()=>{if(N(!1),i)f?.(!1)};return N(document.activeElement===t),t.addEventListener("focus",n),t.addEventListener("blur",o),()=>{t.removeEventListener("focus",n),t.removeEventListener("blur",o)}},[a,i,f]),v(()=>{if(i)a.current?.getTextarea()?.focus()},[i,a]);let m=et&&(r!==null?r.kind==="slash"||d.length>0||!!h:i);v(()=>{if(!m)return;U.current?.querySelector(`[data-idx="${b}"]`)?.scrollIntoView({block:"nearest"})},[b,m]);function W(t){let n=a.current?.getTextarea();if(!n)return;let o,s;if(r){let B=r.kind==="slash"?`/${t.payload} `:`@${t.label} `;if(o=l.slice(0,r.start)+B+l.slice(r.end),r.kind==="at")R?.(t.payload);s=r.start+B.length}else if(i)o=`${l.length===0||l.endsWith(`
|
|
2
2
|
`)?l:`${l}
|
|
3
|
-
`}/${t.payload} `,s=o.length,f?.(!1);else return;
|
|
3
|
+
`}/${t.payload} `,s=o.length,f?.(!1);else return;j.textInput.setInput(o),requestAnimationFrame(()=>{n.focus(),n.setSelectionRange(s,s)})}v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=(o)=>{if(!m)return;if(a.current?.isComposing()||o.isComposing||o.keyCode===229)return;if(o.key==="ArrowDown")o.preventDefault(),o.stopPropagation(),L((s)=>d.length===0?0:Math.min(d.length-1,s+1));else if(o.key==="ArrowUp")o.preventDefault(),o.stopPropagation(),L((s)=>Math.max(0,s-1));else if(o.key==="Enter"||o.key==="Tab"){o.preventDefault(),o.stopPropagation();let s=d[b];if(s)W(s)}else if(o.key==="Escape")if(o.preventDefault(),o.stopPropagation(),r)K(Math.max(0,r.start-1)),t.setSelectionRange(r.start,r.start);else f?.(!1)};return t.addEventListener("keydown",n,!0),()=>t.removeEventListener("keydown",n,!0)});let[k,G]=g(null),[S,nt]=g(null),T=ut(()=>{let t=c?.current;if(!t)return;let n=t.getBoundingClientRect();G({left:n.left,width:n.width,bottom:window.innerHeight-n.top+8})},[c]);if(Y(()=>{if(!m){G(null);return}T()},[m,T]),Y(()=>{let t=c?.current;if(!m||!t||!S)return;return rt(t,S,T,{animationFrame:!0})},[m,S,c,T]),!m||c&&!k)return null;let w=r?r.kind==="slash":i,ot=w?st:it,J=p("div",{ref:nt,className:c?"fixed z-50":"absolute inset-x-0 bottom-full z-50 mb-2",style:c&&k?{left:k.left,width:k.width,bottom:k.bottom}:void 0,children:E("div",{ref:U,role:"listbox",onMouseDown:(t)=>t.preventDefault(),className:"bg-popover text-popover-foreground ring-foreground/10 pointer-events-auto w-full overflow-hidden rounded-lg p-1 shadow-md ring-1 outline-hidden",children:[E("div",{className:"max-h-72 overflow-y-auto",children:[d.length===0&&w&&p("div",{className:"text-muted-foreground px-2 py-3 text-xs",children:F}),d.length===0&&!w&&h&&p("div",{role:"status",className:"text-muted-foreground px-2 py-3 text-xs",children:y?.query===x&&y.search===u?h.empty:h.loading}),d.map((t,n)=>E(e,{type:"button",variant:"ghost",role:"option","aria-selected":n===b,"data-idx":n,onMouseDown:(o)=>{o.preventDefault(),W(t)},onMouseEnter:()=>L(n),className:X("flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-2.5 py-2 text-start",n===b&&"bg-muted"),children:[p(ot,{className:X("size-4 shrink-0",w?"text-blue-500":"text-muted-foreground")}),p("span",{className:"text-foreground shrink-0 text-sm font-medium",children:t.label}),t.description&&p("span",{className:"text-muted-foreground min-w-0 flex-1 truncate text-xs",children:t.description})]},t.key))]}),w&&D&&E(ct,{children:[p(Q,{}),E(e,{type:"button",variant:"ghost",onMouseDown:(t)=>{t.preventDefault(),f?.(!1),D.open()},className:"h-auto w-full justify-start px-2.5 py-2",children:[p(lt,{"data-icon":"inline-start"}),D.label]})]})]})});return c?at(J,document.body):J}
|
|
4
4
|
export{Ro};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import{html as n}from"diff2html";import{ColorSchemeType as r}from"diff2html/lib/types";import{useMemo as s}from"react";import{jsx as a}from"react/jsx-runtime";function An(e){let t=0,i=0;for(let o of e.split(`
|
|
2
|
-
`)){if(o.startsWith("+++")||o.startsWith("---"))continue;if(o.startsWith("+"))t+=1;else if(o.startsWith("-"))i+=1}return{additions:t,deletions:i}}function
|
|
3
|
-
export{An,
|
|
2
|
+
`)){if(o.startsWith("+++")||o.startsWith("---"))continue;if(o.startsWith("+"))t+=1;else if(o.startsWith("-"))i+=1}return{additions:t,deletions:i}}function Ne({patch:e,theme:t}){let i=s(()=>n(e,{drawFileList:!1,outputFormat:"line-by-line",matching:"lines",colorScheme:t==="dark"?r.DARK:r.LIGHT}),[e,t]);return a("div",{className:"codex-patch-view",dangerouslySetInnerHTML:{__html:i}})}
|
|
3
|
+
export{An,Ne};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-ryz4c13z.js";import{I}from"./chunk-ckft9abb.js";import{isContentEntry as b,isImage as N,isResourceLink as w}from"@nyssance/codex-acp-v2/client";import{ChevronRightIcon as C,ImageIcon as S,LoaderCircleIcon as A,RefreshCwIcon as R}from"lucide-react";import{useEffect as B,useState as h}from"react";import{jsx as n,jsxs as y}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{a}from"./chunk-ryz4c13z.js";import{I}from"./chunk-ckft9abb.js";import{isContentEntry as b,isImage as N,isResourceLink as w}from"@nyssance/codex-acp-v2/client";import{ChevronRightIcon as C,ImageIcon as S,LoaderCircleIcon as A,RefreshCwIcon as R}from"lucide-react";import{useEffect as B,useState as h}from"react";import{jsx as n,jsxs as y}from"react/jsx-runtime";function pe(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function T(e){let r=[];for(let[c,l]of e.content.entries()){if(!b(l))continue;let o=l.content;if(N(o))r.push({key:`${e.id}:${c}`,src:`data:${o.mimeType};base64,${o.data}`,alt:e.title??""});if(w(o))r.push({key:`${e.id}:${c}`,path:o.uri,alt:o.name})}if(r.length)return r;let i=e.rawInput;if(i!==null&&typeof i==="object"&&"path"in i&&typeof i.path==="string")return[{key:e.id,path:i.path,alt:i.path.split(/[\\/]/).at(-1)??i.path}];throw Error(`Image view ${e.id} has no image source`)}function E({images:e}){let{loadImage:r,openImageGallery:i,openImage:c,t:l}=a(),[o,g]=h({}),[v,x]=h(0),f=JSON.stringify(e);B(()=>{let t=!0,u=JSON.parse(f);g({});for(let s of u)(s.src!==void 0?Promise.resolve(s.src):s.path!==void 0&&r?r(s.path):Promise.reject(Error("Image loading is unavailable"))).then((d)=>{if(t)g((p)=>({...p,[s.key]:{src:d}}))},()=>{if(t)g((d)=>({...d,[s.key]:{error:!0}}))});return()=>{t=!1}},[f,r,v]);let k=e.flatMap((t)=>{let u=o[t.key];return u&&"src"in u?[{src:u.src,alt:t.alt}]:[]});return n("div",{className:"codex-image-thumbnails",children:e.map((t,u)=>{let s=o[t.key];if(!s)return n("div",{className:"codex-image-thumbnail",role:"status","aria-label":l("stream.codex.imageLoading"),children:n(A,{className:"motion-safe:animate-spin","aria-hidden":"true"})},t.key);if("error"in s)return n("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,"aria-label":l("stream.codex.imageFailed"),onClick:()=>x((m)=>m+1),children:n(R,{"aria-hidden":"true"})},t.key);return n("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,onClick:()=>{let m=e.slice(0,u).filter((d)=>{let p=o[d.key];return p&&"src"in p}).length;if(i)i(k,m);else c?.(s.src)},children:n("img",{src:s.src,alt:t.alt,draggable:!1})},t.key)})})}function so({blocks:e}){let{t:r}=a(),i=e.flatMap(T),[c,l]=I(`image-view:${e[0].id}`,!1);return y("div",{className:"codex-activity-item",children:[y("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":c,onClick:()=>l((o)=>!o),children:[y("span",{className:"codex-activity-label",children:[n(S,{className:"codex-activity-icon","aria-hidden":"true"}),n("span",{className:"codex-activity-leading",children:r("stream.codex.viewedImages",{count:i.length})})]}),n(C,{className:c?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),c&&n(E,{images:i})]})}
|
|
2
|
+
export{pe,so};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-cg97byvk.js";import{
|
|
2
|
-
export{
|
|
1
|
+
import{e}from"./chunk-cg97byvk.js";import{ce}from"./chunk-xxkdv1zf.js";import{SquareIcon as u}from"lucide-react";import{useRef as c,useState as f}from"react";import{jsx as a}from"react/jsx-runtime";function Qe({title:t,onStop:s}){let[o,i]=f(!1),n=c(!1),l=async()=>{if(n.current)return;n.current=!0,i(!0);try{await s()}finally{n.current=!1,i(!1)}};return a(e,{variant:"ghost",size:"icon",className:"size-5",title:t,"aria-label":t,"aria-busy":o,disabled:o,onKeyDown:(r)=>r.stopPropagation(),onClick:(r)=>{r.stopPropagation(),l()},children:o?a(ce,{className:"size-3","aria-label":t}):a(u,{className:"size-3 fill-current"})})}
|
|
2
|
+
export{Qe};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function qn(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReply"in o))return null;let n=o.questionReply;if(!n||typeof n!=="object"||!("question"in n)||!("answer"in n))return null;return typeof n.question==="string"&&typeof n.answer==="string"?{question:n.question,answer:n.answer}:null}function Vn(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReplyParts"in o))return null;let n=o.questionReplyParts;if(!Array.isArray(n)||n.length===0)return null;let i=n;if(!i.every((e)=>!!e&&typeof e==="object"&&("text"in e)&&typeof e.text==="string"&&(!("question"in e)||e.question===void 0||typeof e.question==="string")))return null;return i.map((e)=>({text:e.text,...e.question===void 0?{}:{question:e.question}}))}
|
|
2
|
+
export{qn,Vn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o}from"./chunk-dp8pjv6r.js";import{de,Pe,it}from"./chunk-n8yj6reh.js";import{jsx as t,jsxs as d,Fragment as r}from"react/jsx-runtime";var a=[];function rt({sessionId:s}){let e=o((n)=>n.actions),c=e.some((n)=>n.sessionId===s)?e.filter((n)=>n.sessionId===s):a,i=c.filter(de),l=c.filter((n)=>!de(n));return d(r,{children:[l.length>0&&t("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-3 px-6 pb-3","data-session-actions":!0,children:l.map((n)=>t(it,{action:n},n.id))}),i[0]!==void 0&&t(Pe,{action:i[0],total:i.length},i[0].id)]})}
|
|
2
|
+
export{rt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var c={ar:{untitled:"دردشة جديدة",quickChats:"دردشات سريعة",retry:"إعادة المحاولة",stop:"إيقاف",rename:"إعادة تسمية",fork:"إنشاء فرع",archive:"أرشفة",unarchive:"استعادة",delete:"حذف",deleteTitle:"حذف هذه الدردشة؟",deleteDescription:"ستُحذف هذه الدردشة نهائيًا. لا يمكن التراجع عن هذا الإجراء.",cancel:"إلغاء",archived:"مؤرشفة"},de:{untitled:"Neuer Chat",quickChats:"Schnelle Chats",retry:"Wiederholen",stop:"Stopp",rename:"Umbenennen",fork:"Verzweigen",archive:"Archivieren",unarchive:"Wiederherstellen",delete:"Löschen",deleteTitle:"Diesen Chat löschen?",deleteDescription:"Dieser Chat wird dauerhaft gelöscht. Dies kann nicht rückgängig gemacht werden.",cancel:"Abbrechen",archived:"Archiviert"},en:{states:{title:"Session status",requires_action:"Needs attention",running:"Running",done:"Unread",idle:"Idle",empty:"No sessions"},untitled:"New chat",quickChats:"Quick chats",showAll:"Show all",retry:"Retry",stop:"Stop",rename:"Rename",fork:"Fork",archive:"Archive",unarchive:"Restore",delete:"Delete",deleteTitle:"Delete this chat?",deleteDescription:"This chat will be permanently deleted. This cannot be undone.",cancel:"Cancel",archived:"Archived",archives:{title:"Archived chats",deleteAll:"Delete all",search:"Search archived chats",chatType:"Chat type",allChats:"All chats",quickChats:"Quick chats",projectChats:"Project chats",project:"Project",allProjects:"All projects",noProject:"No project",count:"{{count}} chats",updatedAt:"Last updated",connecting:"Connect to Codex to view archived chats.",loading:"Loading archived chats…",retry:"Retry",empty:"No archived chats",noResults:"No matching archived chats",deleteTitle:"Delete archived chats?",deleteAllDescription:"Permanently delete these {{count}} archived chats? This cannot be undone. Deleting all includes chats hidden by the current filters.",deleteDescription:"Permanently delete this archived chat? This cannot be undone.",unarchive:"Unarchive",confirmDelete:"Delete permanently"}},es:{untitled:"Nuevo chat",quickChats:"Chats rápidos",retry:"Reintentar",stop:"Detener",rename:"Renombrar",fork:"Crear rama",archive:"Archivar",unarchive:"Restaurar",delete:"Eliminar",deleteTitle:"¿Eliminar este chat?",deleteDescription:"Este chat se eliminará permanentemente. Esta acción no se puede deshacer.",cancel:"Cancelar",archived:"Archivados"},fr:{untitled:"Nouveau chat",quickChats:"Discussions rapides",retry:"Réessayer",stop:"Arrêter",rename:"Renommer",fork:"Créer une branche",archive:"Archiver",unarchive:"Restaurer",delete:"Supprimer",deleteTitle:"Supprimer cette discussion ?",deleteDescription:"Cette discussion sera définitivement supprimée. Cette action est irréversible.",cancel:"Annuler",archived:"Archivées"},hi:{untitled:"नई चैट",quickChats:"त्वरित चैट",retry:"फिर से कोशिश करें",stop:"रोकें",rename:"नाम बदलें",fork:"शाखा बनाएँ",archive:"संग्रहित करें",unarchive:"रीस्टोर करें",delete:"हटाएं",deleteTitle:"यह चैट हटाएँ?",deleteDescription:"यह चैट स्थायी रूप से हटा दी जाएगी। इसे पूर्ववत नहीं किया जा सकता।",cancel:"रद्द करें",archived:"संग्रहीत"},id:{untitled:"Obrolan baru",quickChats:"Chat cepat",retry:"Coba lagi",stop:"Hentikan",rename:"Ganti nama",fork:"Buat cabang",archive:"Arsipkan",unarchive:"Pulihkan",delete:"Hapus",deleteTitle:"Hapus obrolan ini?",deleteDescription:"Obrolan ini akan dihapus permanen. Tindakan ini tidak dapat dibatalkan.",cancel:"Batal",archived:"Diarsipkan"},it:{untitled:"Nuova chat",quickChats:"Chat rapide",retry:"Riprova",stop:"Interrompi",rename:"Rinomina",fork:"Crea un ramo",archive:"Archivia",unarchive:"Ripristina",delete:"Elimina",deleteTitle:"Eliminare questa chat?",deleteDescription:"Questa chat verrà eliminata definitivamente. L’azione non può essere annullata.",cancel:"Annulla",archived:"Archiviate"},ja:{untitled:"新しいチャット",quickChats:"クイックチャット",retry:"再試行",stop:"停止",rename:"名前を変更",fork:"分岐を作成",archive:"アーカイブ",unarchive:"復元",delete:"削除",deleteTitle:"このチャットを削除しますか?",deleteDescription:"このチャットは完全に削除されます。この操作は取り消せません。",cancel:"キャンセル",archived:"アーカイブ済み"},ko:{untitled:"새 채팅",quickChats:"빠른 채팅",retry:"다시 시도",stop:"중지",rename:"이름 바꾸기",fork:"분기 만들기",archive:"보관",unarchive:"복원",delete:"삭제",deleteTitle:"이 채팅을 삭제할까요?",deleteDescription:"이 채팅은 영구적으로 삭제됩니다. 이 작업은 되돌릴 수 없습니다.",cancel:"취소",archived:"보관됨"},"pt-BR":{untitled:"Novo chat",quickChats:"Chats rápidos",retry:"Tentar novamente",stop:"Parar",rename:"Renomear",fork:"Criar ramificação",archive:"Arquivar",unarchive:"Restaurar",delete:"Excluir",deleteTitle:"Excluir esta conversa?",deleteDescription:"Esta conversa será excluída permanentemente. Esta ação não pode ser desfeita.",cancel:"Cancelar",archived:"Arquivadas"},ru:{untitled:"Новый чат",quickChats:"Быстрые чаты",retry:"Повторить",stop:"Остановить",rename:"Переименовать",fork:"Создать ветку",archive:"Архивировать",unarchive:"Восстановить",delete:"Удалить",deleteTitle:"Удалить этот чат?",deleteDescription:"Этот чат будет удалён навсегда. Это действие нельзя отменить.",cancel:"Отмена",archived:"В архиве"},"zh-CN":{states:{title:"会话状态",requires_action:"待处理",running:"运行中",done:"完成未读",idle:"空闲",empty:"暂无会话"},untitled:"新聊天",quickChats:"随聊",showAll:"展开显示",retry:"重试",stop:"停止",rename:"重命名",fork:"分叉",archive:"归档",unarchive:"恢复",delete:"删除",deleteTitle:"删除这个聊天?",deleteDescription:"该聊天将被永久删除。此操作不可撤销。",cancel:"取消",archived:"已归档",archives:{title:"已归档的聊天",deleteAll:"全部删除",search:"搜索已归档的聊天",chatType:"聊天类型",allChats:"全部聊天",quickChats:"快捷聊天",projectChats:"项目聊天",project:"项目",allProjects:"所有项目",noProject:"无项目",count:"{{count}} 个聊天",updatedAt:"最后更新时间",connecting:"连接 Codex 后查看已归档的聊天。",loading:"正在加载已归档的聊天…",retry:"重试",empty:"暂无已归档的聊天",noResults:"没有符合条件的已归档聊天",deleteTitle:"删除已归档的聊天?",deleteAllDescription:"永久删除这 {{count}} 个已归档的聊天?此操作无法撤销。全部删除包含被当前筛选条件隐藏的聊天。",deleteDescription:"永久删除这个已归档的聊天?此操作无法撤销。",unarchive:"取消归档",confirmDelete:"永久删除"}}};
|
|
2
|
+
export{c};
|