@alwith/module-chat 0.5.13 → 0.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/approval/choice-elicitation-form.js +1 -1
- package/dist/approval/choice-schema.js +1 -1
- package/dist/approval/permission-options.js +1 -1
- package/dist/approval/permission-view.js +1 -1
- package/dist/approval/schema-elicitation-form.js +1 -1
- package/dist/approval/url-elicitation-card.js +1 -1
- package/dist/chunk-0nkvfecf.js +1 -0
- package/dist/{chunk-2bkh8cjr.js → chunk-0pv9mq6d.js} +2 -2
- package/dist/{chunk-8q0nz9fp.js → chunk-10j68dch.js} +1 -1
- package/dist/chunk-12fcr66z.js +2 -0
- package/dist/{chunk-b0zk92wd.js → chunk-1aeswxaf.js} +1 -1
- package/dist/{chunk-emdw6cpb.js → chunk-1fm5vx1n.js} +1 -1
- package/dist/{chunk-x2wg6e97.js → chunk-1hzdqep7.js} +2 -2
- package/dist/chunk-25bzk1wv.js +1 -0
- package/dist/chunk-2a3tezgr.js +1 -0
- package/dist/{chunk-4p7yyxq8.js → chunk-2aqv0chk.js} +1 -1
- package/dist/{chunk-5mpabjpm.js → chunk-2ecx1xed.js} +2 -2
- package/dist/{chunk-gtyab797.js → chunk-2mkqpzzx.js} +1 -1
- package/dist/{chunk-gqxjp1xf.js → chunk-2rv3cq7q.js} +2 -2
- package/dist/{chunk-7x4dpkzh.js → chunk-3919sqde.js} +2 -2
- package/dist/{chunk-wdy20cvh.js → chunk-39sbgvd3.js} +1 -1
- package/dist/{chunk-ns6yd5s6.js → chunk-3w0wbv9c.js} +2 -2
- package/dist/{chunk-nvqy2rd1.js → chunk-4andq00q.js} +2 -2
- package/dist/{chunk-nt59nkbj.js → chunk-4ed8as5d.js} +2 -2
- package/dist/chunk-4s1rhts0.js +1 -0
- package/dist/{chunk-vbgfrh23.js → chunk-4tff1nyj.js} +2 -2
- package/dist/{chunk-3ccatjcc.js → chunk-54941m0z.js} +3 -3
- package/dist/{chunk-r8mszb32.js → chunk-56e8naj1.js} +2 -2
- package/dist/chunk-59g9h4v1.js +2 -0
- package/dist/{chunk-6y5d4j79.js → chunk-61944cv6.js} +2 -2
- package/dist/{chunk-mqxg6cgm.js → chunk-6k4mbmg1.js} +2 -2
- package/dist/{chunk-wmeebq8x.js → chunk-6s7z09b0.js} +1 -1
- package/dist/{chunk-can1xpx6.js → chunk-6wqbetcx.js} +1 -1
- package/dist/{chunk-tv74s60m.js → chunk-7eje3z81.js} +2 -2
- package/dist/{chunk-wf9bna6z.js → chunk-7f89k828.js} +1 -1
- package/dist/{chunk-d1z2ns5m.js → chunk-7jyekmy9.js} +2 -2
- package/dist/{chunk-a4j8mjg1.js → chunk-7qrz8zq8.js} +2 -2
- package/dist/{chunk-195y00jd.js → chunk-7zrnt6zw.js} +2 -2
- package/dist/{chunk-j5047dxn.js → chunk-8e3wcvkd.js} +2 -2
- package/dist/chunk-96x0d2vd.js +1 -0
- package/dist/{chunk-qx9j4bnh.js → chunk-9gv1zffv.js} +1 -1
- package/dist/{chunk-jgvbf3sx.js → chunk-9j609g4n.js} +1 -1
- package/dist/{chunk-bx2rafbd.js → chunk-9zmkj0dp.js} +2 -2
- package/dist/{chunk-qp7aywgn.js → chunk-a3x74cr0.js} +2 -2
- package/dist/{chunk-xpdv1aed.js → chunk-a6b2vhmb.js} +1 -1
- package/dist/chunk-aarvddmn.js +1 -0
- package/dist/{chunk-19a0ehyy.js → chunk-aj5fk4ez.js} +1 -1
- package/dist/chunk-bj5ma2sv.js +2 -0
- package/dist/chunk-c493d8ay.js +1 -0
- package/dist/{chunk-bm68x7xa.js → chunk-cf5mxxyp.js} +2 -2
- package/dist/chunk-cjmjv7pv.js +2 -0
- package/dist/{chunk-ajmyr2zy.js → chunk-d5ga13n0.js} +1 -1
- package/dist/{chunk-215c1t1e.js → chunk-d5w1nvrz.js} +2 -2
- package/dist/{chunk-y6xhz68r.js → chunk-da4m33bg.js} +2 -2
- package/dist/chunk-da6d6wze.js +1 -0
- package/dist/{chunk-c4t2a146.js → chunk-djmnmbm2.js} +2 -2
- package/dist/{chunk-yhxs6266.js → chunk-dxnttcwd.js} +1 -1
- package/dist/{chunk-c2bkhrcc.js → chunk-dyp6kjqz.js} +2 -2
- package/dist/chunk-e1gwprwe.js +2 -0
- package/dist/chunk-ea3582qy.js +1 -0
- package/dist/{chunk-m4dgha79.js → chunk-efcpawhs.js} +2 -2
- package/dist/{chunk-ksb110ef.js → chunk-egqxz6f8.js} +2 -2
- package/dist/{chunk-hhwdk46d.js → chunk-en8s7tet.js} +3 -3
- package/dist/{chunk-e8ngg07w.js → chunk-f4a1my6v.js} +2 -2
- package/dist/{chunk-mbjv33a2.js → chunk-frbeen15.js} +1 -1
- package/dist/{chunk-d0q5kbq8.js → chunk-frqg34kq.js} +1 -1
- package/dist/{chunk-zrx7qt5g.js → chunk-g5gz25jy.js} +2 -2
- package/dist/{chunk-qz8gpb9j.js → chunk-gkv8w3v0.js} +2 -2
- package/dist/{chunk-qpdgh554.js → chunk-gtahrx8j.js} +2 -2
- package/dist/{chunk-mst2ng40.js → chunk-h2gng003.js} +3 -3
- package/dist/{chunk-3wwkzyxs.js → chunk-jzkmsbpe.js} +1 -1
- package/dist/{chunk-qa6kb660.js → chunk-kq8kz0jn.js} +2 -2
- package/dist/{chunk-tc7qxw3f.js → chunk-m2jsfvs2.js} +1 -1
- package/dist/{chunk-mrfy48hg.js → chunk-m2xmz1ag.js} +2 -2
- package/dist/chunk-mr1azhef.js +1 -0
- package/dist/{chunk-cj9htyem.js → chunk-n1tjf64a.js} +2 -2
- package/dist/chunk-n5xqjct2.js +1 -0
- package/dist/chunk-n8kfbg68.js +2 -0
- package/dist/{chunk-phq6b35v.js → chunk-nact4a4b.js} +2 -2
- package/dist/{chunk-de85vphg.js → chunk-nbkkfyss.js} +1 -1
- package/dist/{chunk-4q7rpdzc.js → chunk-nt224frq.js} +2 -2
- package/dist/{chunk-9v7x6sqy.js → chunk-p1wnt0e5.js} +1 -1
- package/dist/{chunk-hfaarm10.js → chunk-pafshe3v.js} +2 -2
- package/dist/{chunk-4z4tec0p.js → chunk-pvj43sjx.js} +2 -2
- package/dist/{chunk-7cm1jptm.js → chunk-pzth3knm.js} +2 -2
- package/dist/{chunk-b7afpbwn.js → chunk-q4btsq6a.js} +3 -3
- package/dist/chunk-qpmjezsw.js +1 -0
- package/dist/{chunk-ftcydsbs.js → chunk-qsg1c5cc.js} +2 -2
- package/dist/{chunk-xqr05vqf.js → chunk-qvknvzqn.js} +2 -2
- package/dist/{chunk-8x43r6fk.js → chunk-r4r5ythb.js} +2 -2
- package/dist/{chunk-wtkn1jej.js → chunk-r9p03chx.js} +2 -2
- package/dist/{chunk-n9f80j0a.js → chunk-rvr6zj7p.js} +2 -2
- package/dist/{chunk-7h1m9nbx.js → chunk-rxc15vtr.js} +2 -2
- package/dist/{chunk-k7gn0faf.js → chunk-tp1gaw68.js} +2 -2
- package/dist/{chunk-0mze2qnw.js → chunk-vk36fprb.js} +2 -2
- package/dist/{chunk-ntegv7av.js → chunk-vzy4vwqr.js} +1 -1
- package/dist/{chunk-1z6v9pjq.js → chunk-w38vbf7h.js} +2 -2
- package/dist/{chunk-htnp024d.js → chunk-wpdn3rx8.js} +1 -1
- package/dist/{chunk-2wxea30c.js → chunk-x7jtngzd.js} +2 -2
- package/dist/{chunk-e4a1cf50.js → chunk-xe52kj6h.js} +5 -5
- package/dist/{chunk-xw93fypz.js → chunk-xfx689xm.js} +2 -2
- package/dist/{chunk-rf9yxbes.js → chunk-y3567zfn.js} +2 -2
- package/dist/{chunk-m5k1xtjr.js → chunk-y6afvrnv.js} +1 -1
- package/dist/{chunk-9wgngtx8.js → chunk-z3mp9z01.js} +1 -1
- package/dist/{chunk-kv0tnq8g.js → chunk-z4zm74ge.js} +2 -2
- package/dist/{chunk-t1m9ysv5.js → chunk-zjmqne2f.js} +2 -2
- package/dist/{chunk-cc0tan75.js → chunk-zynyx32t.js} +2 -2
- package/dist/{chunk-ey5vrsya.js → chunk-zzhwfrzb.js} +1 -1
- 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/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/completion-trigger.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.d.ts +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/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/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/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/conversation/subagent-sessions.js +1 -1
- package/dist/image-lightbox.js +1 -1
- package/dist/image-preview-dialog.js +1 -1
- package/dist/lib/fuzzy.js +1 -1
- package/dist/lib/group-blocks.js +1 -1
- package/dist/lib/image-encode.js +1 -1
- package/dist/lib/limits.js +1 -1
- package/dist/lib/markdown-parser.js +1 -1
- package/dist/lib/markdown-rules.js +1 -1
- package/dist/lib/model-name.js +1 -1
- package/dist/lib/prepare-prompt-files.js +1 -1
- package/dist/lib/stream-style.js +1 -1
- package/dist/lib/streaming-markdown.js +1 -1
- package/dist/search/chat-search.js +1 -1
- package/dist/search/dom-matches.js +1 -1
- package/dist/search/find-bar.js +1 -1
- package/dist/session-list/archived-sessions.js +1 -1
- package/dist/session-list/host.js +1 -1
- package/dist/session-list/navigation.js +1 -1
- package/dist/session-list/row-stop-button.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.js +1 -1
- package/dist/session-list/sidebar-overlay.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-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/navigation-rail.js +1 -1
- package/dist/session-timeline/plan.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/timeline-registry.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/user-message.js +1 -1
- package/dist/ui/badge.js +1 -1
- package/dist/ui/button.js +1 -1
- package/dist/ui/card.d.ts +1 -1
- package/dist/ui/card.js +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/dialog.d.ts +2 -2
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/dropdown-menu.d.ts +2 -2
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/empty.js +1 -1
- package/dist/ui/field.d.ts +1 -1
- package/dist/ui/field.js +1 -1
- package/dist/ui/hover-card.js +1 -1
- package/dist/ui/input-group.d.ts +4 -3
- package/dist/ui/input-group.js +1 -1
- package/dist/ui/input.js +1 -1
- package/dist/ui/kbd.js +1 -1
- package/dist/ui/radio-group.js +1 -1
- package/dist/ui/select.d.ts +2 -2
- package/dist/ui/select.js +1 -1
- package/dist/ui/separator.js +1 -1
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/switch.js +1 -1
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/tooltip.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-1ghceftn.js +0 -1
- package/dist/chunk-1gmz5kxh.js +0 -2
- package/dist/chunk-3fvwqfm2.js +0 -2
- package/dist/chunk-4tst6wwf.js +0 -1
- package/dist/chunk-5pr21n80.js +0 -1
- package/dist/chunk-9mxxxkzq.js +0 -1
- package/dist/chunk-aac5y6xt.js +0 -1
- package/dist/chunk-apqdf6y3.js +0 -1
- package/dist/chunk-bk0ezksw.js +0 -1
- package/dist/chunk-fsyc5ybt.js +0 -2
- package/dist/chunk-kzcrcs7q.js +0 -2
- package/dist/chunk-ms49ecg4.js +0 -1
- package/dist/chunk-ncekagm6.js +0 -1
- package/dist/chunk-p12g8enf.js +0 -1
- package/dist/chunk-rwczpvta.js +0 -2
- package/dist/chunk-rxwqvya2.js +0 -2
- package/dist/chunk-tc85dd04.js +0 -1
- package/dist/chunk-wmp3w889.js +0 -2
- package/dist/chunk-xx4tnhcy.js +0 -1
- package/dist/ui/input-group-textarea.d.ts +0 -2
- package/dist/ui/input-group-textarea.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as n}from"@base-ui/react/use-render";import{cva as o}from"class-variance-authority";import{cn as
|
|
1
|
+
import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as n}from"@base-ui/react/use-render";import{cva as o}from"class-variance-authority";import{cn as s}from"cn";var Gr=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function We({className:r,variant:e="default",render:t,...i}){return n({defaultTagName:"span",props:a({className:s(Gr({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{Gr,We};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cn as e}from"cn";import{jsx as o}from"react/jsx-runtime";function
|
|
1
|
+
import{cn as e}from"cn";import{jsx as o}from"react/jsx-runtime";function zn({className:t,...n}){return o("kbd",{"data-slot":"kbd",className:e("pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3",t),...n})}function ni({className:t,...n}){return o("kbd",{"data-slot":"kbd-group",className:e("inline-flex items-center gap-1",t),...n})}export{zn,ni};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Jn}from"./chunk-
|
|
2
|
-
`)}function T({subject:t,requestTitle:e}){let{host:s}=o();if(!b(t))return null;let r=t.toolCall,l=A(r),i=v(r),c=R(r),p=s.toolTitle?.(r)??r.title;return m("div",{className:"flex flex-col gap-2",children:[p&&p!==e&&l===null&&a("div",{className:"text-sm font-medium",children:p}),l!==null&&m("pre",{className:"bg-muted overflow-x-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:[a("span",{className:"text-muted-foreground select-none",children:"$ "}),l]}),i!==null&&a("div",{className:"max-h-80 overflow-auto rounded-lg border","data-stream-style":"codexUI",children:a(Be,{patch:i,theme:s.theme})}),i===null&&l===null&&c.length>0&&a("pre",{className:"bg-muted max-h-60 overflow-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:c}),(r.locations??[]).length>0&&a("ul",{className:"text-muted-foreground flex flex-col gap-0.5 text-xs",children:(r.locations??[]).map((u)=>a("li",{className:"truncate font-mono",children:u.path},`${u.path}:${u.line??""}`))})]})}function d(t,e){let{host:s,client:r}=o();return(l)=>{try{if(e)e(t.id,l);else r.respond(t.id,l)}catch(i){if(s.reportError)s.reportError(i);else console.error(i)}}}function C({action:t,total:e,onRespond:s}){let{host:r}=o(),l=d(t,s),i=t.params,c=r.permissionTitle?.(i)??i.title;return m(Jn,{requestId:t.id,title:c,alwaysLabel:r.t("approval.always"),autoFocus:"if-idle",total:e,options:i.options.map((p)=>({...p,description:y(p)??void 0})),onRespond:(p)=>l({outcome:p===null?{outcome:"cancelled"}:{outcome:"selected",optionId:p}}),children:[i.description&&a("div",{className:"text-muted-foreground mt-0.5 text-xs",children:i.description}),i.subject&&a(T,{subject:i.subject,requestTitle:c})]})}function Fe({action:t,total:e,onRespond:s}){let{host:r}=o(),l=d(t,s),i=n((c)=>t.sessionId===null?void 0:c.sessions[t.sessionId]);return a(
|
|
1
|
+
import{Jn}from"./chunk-a6b2vhmb.js";import{eo}from"./chunk-x7jtngzd.js";import{to}from"./chunk-m2xmz1ag.js";import{Be}from"./chunk-yh9qdb2k.js";import{n}from"./chunk-q6km9nha.js";import{o}from"./chunk-6acs2hzs.js";import{isContentEntry as f,isDiffEntry as g,isFormElicitation as x,isText as h,isToolCallSubject as b,isUrlElicitation as w}from"@nyssance/codex-acp-v2/client";import{jsx as a,jsxs as m}from"react/jsx-runtime";function ge(t){return t.kind==="elicitation"&&x(t.params)}function y(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let s=e.description;return typeof s==="string"?s:null}function A(t){let e=t.rawInput;if(typeof e!=="object"||e===null)return null;let s=e.command;if(typeof s==="string")return s;if(Array.isArray(s))return s.map(String).join(" ");return null}function v(t){for(let e of t.content??[])if(g(e)&&e.patch&&e.patch.text.length>0)return e.patch.text;return null}function R(t){return(t.content??[]).filter(f).map((e)=>h(e.content)?e.content.text:"").filter((e)=>e.length>0).join(`
|
|
2
|
+
`)}function T({subject:t,requestTitle:e}){let{host:s}=o();if(!b(t))return null;let r=t.toolCall,l=A(r),i=v(r),c=R(r),p=s.toolTitle?.(r)??r.title;return m("div",{className:"flex flex-col gap-2",children:[p&&p!==e&&l===null&&a("div",{className:"text-sm font-medium",children:p}),l!==null&&m("pre",{className:"bg-muted overflow-x-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:[a("span",{className:"text-muted-foreground select-none",children:"$ "}),l]}),i!==null&&a("div",{className:"max-h-80 overflow-auto rounded-lg border","data-stream-style":"codexUI",children:a(Be,{patch:i,theme:s.theme})}),i===null&&l===null&&c.length>0&&a("pre",{className:"bg-muted max-h-60 overflow-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:c}),(r.locations??[]).length>0&&a("ul",{className:"text-muted-foreground flex flex-col gap-0.5 text-xs",children:(r.locations??[]).map((u)=>a("li",{className:"truncate font-mono",children:u.path},`${u.path}:${u.line??""}`))})]})}function d(t,e){let{host:s,client:r}=o();return(l)=>{try{if(e)e(t.id,l);else r.respond(t.id,l)}catch(i){if(s.reportError)s.reportError(i);else console.error(i)}}}function C({action:t,total:e,onRespond:s}){let{host:r}=o(),l=d(t,s),i=t.params,c=r.permissionTitle?.(i)??i.title;return m(Jn,{requestId:t.id,title:c,alwaysLabel:r.t("approval.always"),autoFocus:"if-idle",total:e,options:i.options.map((p)=>({...p,description:y(p)??void 0})),onRespond:(p)=>l({outcome:p===null?{outcome:"cancelled"}:{outcome:"selected",optionId:p}}),children:[i.description&&a("div",{className:"text-muted-foreground mt-0.5 text-xs",children:i.description}),i.subject&&a(T,{subject:i.subject,requestTitle:c})]})}function Fe({action:t,total:e,onRespond:s}){let{host:r}=o(),l=d(t,s),i=n((c)=>t.sessionId===null?void 0:c.sessions[t.sessionId]);return a(eo,{requestId:t.id,schema:t.params.requestedSchema,message:i?.subagent?`${i.title??r.t("subagents.untitled")}: ${t.params.message}`:t.params.message,total:e,t:r.t,onRespond:l})}function ft({action:t,total:e,onRespond:s}){let{host:r}=o(),l=d(t,s);if(t.kind==="permission")return a(C,{action:t,total:e,onRespond:s});if(ge(t))return a(Fe,{action:t,total:e??1,onRespond:s});let i=t.params;if(!w(i))throw Error("Unsupported elicitation mode");return a(to,{message:i.message,url:i.url,t:r.t,onOpen:r.openLink,onRespond:(c)=>l(c==="cancel"?{action:"cancel"}:{action:"decline"})})}
|
|
3
3
|
export{ge,Fe,ft};
|
|
@@ -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 jo({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{jo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{no}from"./chunk-e1gwprwe.js";import{autoUpdate as L}from"@floating-ui/dom";import{cn as I}from"cn";import{CheckCheckIcon as M,CheckIcon as h,ShieldXIcon as V,XIcon as F}from"lucide-react";import{useCallback as H,useEffect as N,useId as T,useLayoutEffect as _,useRef as S,useState as f}from"react";import{createPortal as z}from"react-dom";import{jsx as i,jsxs as u}from"react/jsx-runtime";var U={allow_once:{icon:h},allow_always:{icon:M},reject_once:{icon:F},reject_always:{icon:V}};function Jn({requestId:p,options:D,title:E,children:P,total:w=1,alwaysLabel:j="always",autoFocus:y="always",anchorRef:n,onRespond:r}){let b=T(),[a,g]=f(0),[s,v]=f(null),[l,A]=f(null),x=S(null),c=no(D);N(()=>{g(0)},[p]),N(()=>{let e=document.activeElement;if(y==="always"||e===null||e===document.body)x.current?.focus()},[p,l,y]);let d=H(()=>{let e=n?.current;if(!e)return;let t=e.getBoundingClientRect();if(t.width===0){let o=Math.min(640,window.innerWidth*0.9);v({left:(window.innerWidth-o)/2,width:o,bottom:24});return}v({left:t.left,width:t.width,bottom:window.innerHeight-t.bottom+20})},[n]);if(_(()=>{if(!n)return;let e=0,t=()=>{if(n.current)d();else e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)},[p,n,d]),_(()=>{let e=n?.current;if(!e||!l)return;return L(e,l,d,{animationFrame:!0})},[n,l,d]),n&&!s)return null;let k=u("div",{ref:A,"data-overlay":"permission-request",className:I("bg-card border-border overflow-hidden rounded-lg border",n&&"fixed z-50"),style:n&&s?{left:s.left,width:s.width,bottom:s.bottom}:void 0,children:[u("div",{className:"border-border border-b px-3 py-2",children:[u("div",{className:"flex items-center justify-between gap-2",children:[i("div",{id:b,className:"text-foreground text-sm font-medium",children:E}),w>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${w}`})]}),P]}),i("div",{role:"listbox","aria-labelledby":b,tabIndex:0,ref:x,onKeyDown:(e)=>{let t=c.length;if(t===0&&e.key!=="Escape")return;if(e.key==="ArrowDown"||e.key==="ArrowUp")e.preventDefault(),g((o)=>e.key==="ArrowDown"?(o+1)%t:(o-1+t)%t);else if(e.key==="Enter")e.preventDefault(),r(c[a].optionId);else if(e.key==="Escape")e.preventDefault(),r(null);else if(/^[1-9]$/.test(e.key)&&Number(e.key)<=t)e.preventDefault(),r(c[Number(e.key)-1].optionId)},className:"outline-none",children:c.map((e,t)=>{let o=e.kind??"allow_once",C=U[o]?.icon??h,K=o==="allow_always"||o==="reject_always",O=o==="reject_once"||o==="reject_always";return u("div",{role:"option",tabIndex:-1,"aria-selected":t===a,title:e.description,onClick:()=>void r(e.optionId),onKeyDown:(m)=>{if(m.key==="Enter"||m.key===" ")m.preventDefault(),m.stopPropagation(),r(e.optionId)},className:I("flex cursor-pointer items-center gap-2 px-3 py-1.5 text-sm select-none",t===a?"bg-ring text-accent-foreground":"text-foreground",O&&t!==a&&"text-muted-foreground"),children:[i("span",{className:"min-w-3 text-xs opacity-70",children:t+1}),i(C,{className:"size-3.5 shrink-0 opacity-80"}),i("span",{className:"min-w-0 flex-1 truncate",children:e.name}),K&&i("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[10px] tracking-wide uppercase",children:j})]},e.optionId)})})]});return n?z(k,document.body):k}
|
|
2
2
|
export{Jn};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Select as r}from"@base-ui/react/select";import{cn as o}from"cn";import{ChevronDownIcon as c,CheckIcon as u,ChevronUpIcon as f}from"lucide-react";import{jsx as e,jsxs as n}from"react/jsx-runtime";var Nt=r.Root;function Qr({className:t,...i}){return e(r.Group,{"data-slot":"select-group",className:o("scroll-my-1 p-1",t),...i})}function Mt({className:t,...i}){return e(r.Value,{"data-slot":"select-value",className:o("flex flex-1 text-start",t),...i})}function Rt({className:t,size:i="default",children:a,...s}){return n(r.Trigger,{"data-slot":"select-trigger","data-size":i,className:o("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pe-2 ps-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...s,children:[a,e(r.Icon,{render:e(c,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function hn({className:t,children:i,side:a="bottom",sideOffset:s=4,align:d="center",alignOffset:p=0,alignItemWithTrigger:l=!0,...m}){return e(r.Portal,{children:e(r.Positioner,{side:a,sideOffset:s,align:d,alignOffset:p,alignItemWithTrigger:l,className:"isolate z-50",children:n(r.Popup,{"data-slot":"select-content","data-align-trigger":l,className:o("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...m,children:[e(Pr,{}),e(r.List,{children:i}),e(Nr,{})]})})})}function Xr({className:t,...i}){return e(r.GroupLabel,{"data-slot":"select-label",className:o("px-2 py-1.5 text-xs text-muted-foreground",t),...i})}function Z({className:t,children:i,...a}){return n(r.Item,{"data-slot":"select-item",className:o("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pe-8 ps-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...a,children:[e(r.ItemText,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:i}),e(r.ItemIndicator,{render:e("span",{className:"pointer-events-none absolute end-2 flex size-4 items-center justify-center"}),children:e(u,{className:"pointer-events-none"})})]})}function Yr({className:t,...i}){return e(r.Separator,{"data-slot":"select-separator",className:o("pointer-events-none -mx-1 my-1 h-px bg-border",t),...i})}function Pr({className:t,...i}){return e(r.ScrollUpArrow,{"data-slot":"select-scroll-up-button",className:o("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",t),...i,children:e(f,{})})}function Nr({className:t,...i}){return e(r.ScrollDownArrow,{"data-slot":"select-scroll-down-button",className:o("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",t),...i,children:e(c,{})})}export{Nt,Qr,Mt,Rt,hn,Xr,Z,Yr,Pr,Nr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s}from"./chunk-96x0d2vd.js";import{j}from"./chunk-1fm5vx1n.js";import{g}from"./chunk-da4m33bg.js";import{Xe}from"./chunk-ykp85wc1.js";import{_}from"./chunk-2pj3pcc7.js";import{Je,et}from"./chunk-r4r5ythb.js";import{formatDistanceToNowStrict as H}from"date-fns";import{enUS as L,zhCN as z}from"date-fns/locale";import{ClockIcon as E,MessageSquareIcon as A}from"lucide-react";import{useEffect as S,useState as D}from"react";import{jsx as o,jsxs as C,Fragment as w}from"react/jsx-runtime";var h={en:L,"zh-CN":z};function Ce(t,a){let r=a==="zh-CN"?h["zh-CN"]:h.en;return H(new Date(t),{locale:r})}function Qe({sessionRow:t,actions:a,shortcut:r,renaming:n=!1,onRename:m}){let{t:i,i18n:y,PathAction:u}=g(),f=et(),I=Je();S(()=>{f(n)},[n,f]);let[x,p]=D(t.title??"");S(()=>{if(n)p(t.title??"")},[n,t.title]);let d=(e)=>{let c=e.trim();m?.(c!==""&&c!==t.title?c:null)},N=t.archived?i("sessionList.archived"):t.updatedAt!==null?Ce(t.updatedAt,y.language):null,v=[];if(N!==null)v.push({icon:o(E,{className:"size-3.5"}),text:N});let l=u&&o(u,{cwd:t.cwd,onOpened:I});return o(Xe,{title:n?o(s,{autoFocus:!0,value:x,className:"h-7 text-sm","aria-label":i("sessionList.rename"),onChange:(e)=>p(e.target.value),onKeyDown:(e)=>{if(e.stopPropagation(),e.key==="Enter")d(e.target.value);if(e.key==="Escape")m?.(null)},onBlur:(e)=>d(e.target.value)}):C("span",{className:"flex items-center gap-2",children:[o("span",{className:"min-w-0",children:o(_,{className:"min-w-0 flex-1",children:t.title??i("sessionList.untitled")})}),r]}),titleIcon:o(A,{className:"size-3.5"}),details:v,actions:l||a!==void 0?C(w,{children:[l,l&&a!==void 0&&o(j,{}),a]}):void 0})}
|
|
2
2
|
export{Ce,Qe};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{v}from"./chunk-kjtd3wc3.js";import{j}from"./chunk-1fm5vx1n.js";import{useMemo as f}from"react";import{cva as p}from"class-variance-authority";import{cn as l}from"cn";import{jsx as t,jsxs as c}from"react/jsx-runtime";function Wt({className:a,...e}){return t("fieldset",{"data-slot":"field-set",className:l("flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",a),...e})}function Gt({className:a,variant:e="legend",...o}){return t("legend",{"data-slot":"field-legend","data-variant":e,className:l("mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base",a),...o})}function co({className:a,...e}){return t("div",{"data-slot":"field-group",className:l("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",a),...e})}var u=p("group/field flex w-full gap-3 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function uo({className:a,orientation:e="vertical",...o}){return t("div",{role:"group","data-slot":"field","data-orientation":e,className:l(u({orientation:e}),a),...o})}function fi({className:a,...e}){return t("div",{"data-slot":"field-content",className:l("group/field-content flex flex-1 flex-col gap-1 leading-snug",a),...e})}function mo({className:a,...e}){return t(v,{"data-slot":"field-label",className:l("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-3 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",a),...e})}function hi({className:a,...e}){return t("div",{"data-slot":"field-label",className:l("flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50",a),...e})}function ht({className:a,...e}){return t("p",{"data-slot":"field-description",className:l("text-start text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5","last:mt-0 nth-last-2:-mt-1","[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",a),...e})}function vi({children:a,className:e,...o}){return c("div",{"data-slot":"field-separator","data-content":!!a,className:l("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",e),...o,children:[t(j,{className:"absolute inset-0 top-1/2"}),a&&t("span",{className:"relative mx-auto block w-fit bg-background px-2 text-muted-foreground","data-slot":"field-separator-content",children:a})]})}function xi({className:a,children:e,errors:o,...s}){let i=f(()=>{if(e)return e;if(!o?.length)return null;let r=[...new Map(o.map((d)=>[d?.message,d])).values()];if(r?.length==1)return r[0]?.message;return t("ul",{className:"ms-4 flex list-disc flex-col gap-1",children:r.map((d,n)=>d?.message&&t("li",{children:d.message},n))})},[e,o]);if(!i)return null;return t("div",{role:"alert","data-slot":"field-error",className:l("text-sm font-normal text-destructive",a),...s,children:i})}export{Wt,Gt,co,uo,fi,mo,hi,ht,vi,xi};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Zt
|
|
2
|
-
`),w=o?null:
|
|
1
|
+
import{Yt,Zt}from"./chunk-q4btsq6a.js";import{h}from"./chunk-en8s7tet.js";import{mn}from"./chunk-kq8kz0jn.js";import{t}from"./chunk-q6km9nha.js";import{Ko,Q,Ve,Xo}from"./chunk-g5gz25jy.js";import{Jt}from"./chunk-0pv9mq6d.js";import{oe}from"./chunk-39sbgvd3.js";import{ln}from"./chunk-qvknvzqn.js";import{Vo}from"./chunk-xe52kj6h.js";import{rr}from"./chunk-zynyx32t.js";import{ir}from"./chunk-gkv8w3v0.js";import{an,sn}from"./chunk-7qrz8zq8.js";import{qe}from"./chunk-efcpawhs.js";import{codexMessageError as J,codexTurnError as U,isContentEntry as ae,isEmbeddedResource as X,isImage as Y,isResourceLink as me,isText as le,nativeTurnId as de}from"@nyssance/codex-acp-v2/client";import{LoaderCircleIcon as ce,SparklesIcon as ge}from"lucide-react";import{Fragment as ue,memo as pe,useEffect as fe,useState as ye}from"react";import{jsx as s,jsxs as m,Fragment as E}from"react/jsx-runtime";function q(i){if(Y(i))return`${i.mimeType.toLowerCase()}:${i.data}`;if(X(i)&&"blob"in i.resource&&i.resource.mimeType?.toLowerCase().startsWith("image/"))return`${i.resource.mimeType.toLowerCase()}:${i.resource.blob}`;return null}function he({item:i}){let{t:n}=t(),l=i.status==="in_progress",[o,c]=ye(()=>Date.now()-i.at>=1e4);return fe(()=>{if(!l)return;let a=Math.max(0,i.at+1e4-Date.now());if(c(a===0),a===0)return;let f=setTimeout(()=>c(!0),a);return()=>clearTimeout(f)},[i.id,i.at,l]),m("div",{className:"codex-context-compaction",children:[s(ge,{"aria-hidden":"true"}),s("span",{children:i.status==="completed"?n("stream.codex.contextCompacted"):i.status==="cancelled"?n("timeline.interrupted"):n(o?"timeline.compactingWithDelayNotice":"timeline.compacting")})]})}function N({sessionId:i,entry:n,terminals:l,streaming:o,streamingThoughtId:c}){let{t:a}=t();switch(n.kind){case"activity":return s(Jt,{sessionId:i,items:n.items,terminals:l,streamingThoughtId:c});case"text":return h(n.item._meta).length>0?s(ln,{sessionId:i,item:n.item}):s(oe,{content:n.item.content,messageId:n.item.id,streaming:o});case"plan":return s(rr,{plan:n.item.plan});case"compaction":if(n.item.status==="failed")return m(an,{children:[s("div",{children:a("timeline.compactionFailed")}),n.item.error!==null&&s("div",{children:n.item.error})]});return s(he,{item:n.item})}}function xe({sessionId:i,turn:n,terminals:l,active:o,blocked:c=!1,continued:a=!1,edits:f=n.edits,activityItems:M=n.items,workStartedAt:Z=n.startedAt,isLast:W,error:y,interrupted:F,retry:L,retrying:u,answerActions:K,footer:ee}){let{t:d}=t(),C=n.errors.map((e)=>{let r=J(e);if(r===null)throw Error("Turn error item is missing its diagnostics");let v=L?.turnId===de(e)?L:void 0;return s(sn,{error:r,retry:v},`${e.id}:${v?.delaySeconds??"manual"}`)});if(W&&y!==null&&!n.errors.some((e)=>{let r=J(e);return r!==null&&r.stopReason===y.stopReason&&U(r).message===U(y).message}))C.push(s(sn,{error:y},"current-run-error"));let x=C.length>0?s("div",{className:"codex-turn-errors",children:C}):null,A=n.items.filter(mn);if(A.length>0&&A.length===n.items.length)return m(E,{children:[s(Jt,{sessionId:i,items:A,terminals:l,streamingThoughtId:null}),x]});let k=n.work,T=k.length>0&&k.every((e)=>e.kind==="compaction");if(Ko(n)||T&&n.final.length===0)return m(E,{children:[s("div",{role:"status",className:"text-muted-foreground flex min-w-0 flex-col gap-2 py-2 text-sm",children:n.work.map((e)=>s(N,{sessionId:i,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key))}),x]});let O=Ve(n),P=n.final.filter((e)=>h(e._meta).length===0).map(Q).join(`
|
|
2
|
+
`),w=o?null:qe(n,"assistant"),D=n.items.filter((e)=>e.kind==="tool"&&e.name==="image_generation"&&(e.status==="pending"||e.status==="in_progress")),G=new Set(n.final.flatMap((e)=>e.content.map(q).filter((r)=>r!==null))),b=n.items.flatMap((e)=>{if(e.kind!=="tool"||e.status!=="completed")return[];return e.content.filter(ae).flatMap((r,v)=>{let g=r.content,ie=e.name==="image_generation"&&Y(g),re=e.toolKind!=="read"&&e.toolKind!=="search"&&(me(g)||X(g)&&("blob"in g.resource));if(!ie&&!re)return[];let _=q(g);if(_!==null){if(G.has(_))return[];G.add(_)}return[{key:`${e.id}:${v}`,block:g}]})}),R=n.final.some((e)=>h(e._meta).length===0&&e.content.some((r)=>!le(r)||r.text.trim().length>0)),te=D.length>0||b.length>0||T||R||n.final.some((e)=>h(e._meta).length>0),I=n.items.findIndex((e)=>n.final.includes(e)),S=(e)=>n.items.indexOf(e.kind==="activity"?e.items[0]:e.item),B=k.filter((e)=>I===-1||S(e)<I),ne=k.filter((e)=>I!==-1&&S(e)>I),se=[...n.final.map((e)=>({kind:"answer",item:e,index:n.items.indexOf(e)})),...ne.map((e)=>({kind:"work",entry:e,index:S(e)}))].toSorted((e,r)=>e.index-r.index),H=!o&&!a&&(P.trim().length>0?s(Yt,{text:P,isMostRecentTurn:W,time:w,afterCopy:K}):m("div",{className:"flex items-center gap-0.5",children:[K,w&&s("span",{className:"codex-user-time ms-1",title:w.full,children:w.short})]})),p=ir({...n,items:M},{running:o,blocked:c,retrying:u!==void 0}),V=p.kind==="reasoning"?p.ownerKey??null:null,j=p.kind==="thinking",z=Xo({...n,items:M});return m(E,{children:[s(Zt,{stateKey:JSON.stringify([i,n.replayed?"history":"live",n.key]),active:o&&!R,defaultExpanded:o&&!R||!n.replayed&&(F||O),...z,startedAt:z.startedAt??Z,loading:(j||p.kind==="working")&&n.work.length===0,loadingLabel:p.kind==="working"?d("stream.codex.working"):void 0,work:a||T?[]:B.map((e)=>s(N,{sessionId:i,entry:e,terminals:l,streaming:o,streamingThoughtId:V},e.key)),answer:te||a?m("div",{className:"flex min-w-0 flex-col gap-3",children:[(a||T)&&B.map((e)=>s(N,{sessionId:i,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key)),se.map((e)=>{if(e.kind==="work")return s(N,{sessionId:i,entry:e.entry,terminals:l,streaming:o,streamingThoughtId:V},e.entry.key);let r=e.item;return m(ue,{children:[h(r._meta).length>0?s(ln,{sessionId:i,item:r}):s(oe,{content:r.content,messageId:r.id,streaming:o}),r===n.final.at(-1)&&H]},r.id)}),D.map((e)=>m("div",{className:"codex-image-generation",role:"status","aria-label":d(o?"timeline.imageGenerating":"timeline.imageStopped"),"aria-busy":o,children:[s("div",{className:"codex-image-generation-texture","aria-hidden":"true"}),m("span",{className:"codex-image-generation-status",children:[o&&s(ce,{className:"size-4 motion-safe:animate-spin","aria-hidden":"true"}),d(o?"timeline.imageGenerating":"timeline.imageStopped")]})]},e.id)),b.length>0&&s("div",{className:"codex-reply-artifacts flex min-w-0 flex-col gap-3",children:b.map((e)=>s(oe,{content:[e.block],messageId:e.key,streaming:!1},e.key))}),n.final.length===0&&H]}):null,footer:m(E,{children:[j&&n.work.length>0&&s("div",{className:"codex-pending-message py-2",role:"status",children:s("span",{className:"codex-activity-running",children:d("message.thinking")})}),ee,f.length>0&&!o&&!a&&s(Vo,{items:f}),F&&!O&&s("div",{className:"codex-interrupted-turn",role:"status",children:d("timeline.interrupted")}),!o&&x]})}),o&&u!==void 0&&s("div",{className:"text-muted-foreground py-2 text-sm",role:"status",children:u.capacity?(()=>{let e=/Reconnecting(?:\.\.\.)?\s+(\d+\/\d+)/.exec(u.message)?.[1];return e===void 0?d("timeline.capacityReconnecting"):d("timeline.capacityReconnectingProgress",{progress:e})})():u.message}),o&&x]})}var Bo=pe(xe);
|
|
3
3
|
export{Bo};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_n}from"./chunk-pzth3knm.js";import{n}from"./chunk-q6km9nha.js";import{o,C}from"./chunk-6acs2hzs.js";import{N,c,M}from"./chunk-n1tjf64a.js";import{isBooleanOption as A,isGroupedSelect as Z,isSelectOption as D}from"@nyssance/codex-acp-v2/client";import{Zap as F}from"lucide-react";import{useRef as H}from"react";import{jsx as G}from"react/jsx-runtime";function pt({sessionId:l,options:p,disabled:I,onModelChange:O,onConfigChange:_,defaultGroup:x={id:"models",name:"Models"},catalog:L=(f)=>f,headerAction:P}){let{host:f,client:k}=o(),{t:i}=f,z=n((e)=>Boolean(e.configPending[l])),g=H({sessionId:l,model:!0}),v=z&&(g.current.sessionId!==l||g.current.model),R=n((e)=>{let r=e.sessions[l];return r?.state==="running"||r?.state==="requires_action"}),t=c(p,"model"),a=c(p,"thought_level"),S=p.filter((e)=>e.configId!=="collaboration_mode"&&(e.category==="model_config"||e.category!=="mode"&&e!==t&&e!==a)),V=S.filter(D),m=S.filter(A);if(!t&&!a&&V.length===0&&m.length===0)return null;let u=(e,r)=>{if(r===e.currentValue)return Promise.resolve();g.current={sessionId:l,model:e===t};let d=_?_(e.configId,r):k.setConfig(l,e.configId,r);return C(f,d),d},h=a?N(a):[],E=h.reduce((e,r)=>r.name.length>=e.length?r.name:e,""),U=t?M(t):i("composer.model"),y=(e)=>({api_id:e.value,label:e.name}),w=L(t&&Z(t.options)?t.options.map((e)=>({id:e.groupId,name:e.name,models:e.options.map(y)})):[{...x,models:t?N(t).map(y):[]}]),B=w.flatMap((e)=>e.models),b=B.find((e)=>e.api_id===t?.currentValue)??{api_id:t?.currentValue??"",label:U},s=m.find((e)=>e.configId==="fast_mode"||e.configId==="fast-mode");return G(_n,{disabled:I||v||R,switching:v,value:{...b,label:b.shortLabel??b.label},compactCatalog:!0,models:B,showModelList:Boolean(t),onChange:(e)=>{if(e.api_id===t?.currentValue)return;if(O)O(e.api_id);else if(t)u(t,e.api_id)},header:{name:t?.name??i("composer.model"),action:P},modelGroups:w,t:i,effortConfig:a&&h.length>0?{name:"Effort",value:a.currentValue,levels:h,sizer:E,onChange:(e)=>u(a,e)}:void 0,selectOptions:V.map((e)=>({id:e.configId,name:e.name,value:e.currentValue,options:N(e).map((r)=>({value:r.value,label:r.name})),onChange:(r)=>u(e,r)})),booleanOptions:[{id:"fast_mode",name:i("composer.fastMode"),currentValue:s?.currentValue??!1,disabled:!s,title:!s?i("composer.fastModeUnsupported"):void 0,icon:G(F,{className:"size-4","aria-hidden":"true"})},...m.filter((e)=>e!==s).map((e)=>({id:e.configId,name:e.name,currentValue:e.currentValue}))],onBooleanChange:(e,r)=>{let d=e==="fast_mode"?s:m.find((q)=>q.configId===e);if(!d)throw Error(`Unknown boolean config: ${e}`);u(d,r)}})}
|
|
2
|
+
export{pt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cva as o}from"class-variance-authority";import{cn as n}from"cn";import{jsx as a}from"react/jsx-runtime";function he({className:e,...t}){return a("div",{"data-slot":"empty",className:n("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-lg border-dashed p-12 text-center text-balance",e),...t})}function ve({className:e,...t}){return a("div",{"data-slot":"empty-header",className:n("flex max-w-sm flex-col items-center gap-2",e),...t})}var i=o("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function
|
|
1
|
+
import{cva as o}from"class-variance-authority";import{cn as n}from"cn";import{jsx as a}from"react/jsx-runtime";function he({className:e,...t}){return a("div",{"data-slot":"empty",className:n("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-lg border-dashed p-12 text-center text-balance",e),...t})}function ve({className:e,...t}){return a("div",{"data-slot":"empty-header",className:n("flex max-w-sm flex-col items-center gap-2",e),...t})}var i=o("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function bi({className:e,variant:t="default",...r}){return a("div",{"data-slot":"empty-icon","data-variant":t,className:n(i({variant:t,className:e})),...r})}function xe({className:e,...t}){return a("div",{"data-slot":"empty-title",className:n("text-lg font-medium tracking-tight",e),...t})}function ye({className:e,...t}){return a("div",{"data-slot":"empty-description",className:n("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}function wi({className:e,...t}){return a("div",{"data-slot":"empty-content",className:n("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",e),...t})}export{he,ve,bi,xe,ye,wi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Qn}from"./chunk-rvr6zj7p.js";async function m(r){try{let i=await(await fetch(r)).blob();if(typeof createImageBitmap==="function")return(await createImageBitmap(i)).close(),!0;return await new Promise((a)=>{let o=new Image;o.onload=()=>a(!0),o.onerror=()=>a(!1),o.src=r})}catch{return!1}}async function Kn(r){let n=await Promise.all(r.map(async({id:a,lastModified:o,sourcePath:p,...t})=>{let e=t.url;if(t.url.startsWith("blob:")){let s=await Qn(t.url,t.mediaType);if(s===null)return null;e=s}let l=t.mediaType.toLowerCase().startsWith("image/"),c=e.startsWith("data:image/");if(l&&c&&!await m(e))return null;let u=e.startsWith("data:")?e.slice(5,e.indexOf(";")):t.mediaType;return{...t,url:e,mediaType:u}})),i=n.filter((a)=>a!==null);return{files:i,rejectedCount:n.length-i.length}}
|
|
2
|
+
export{Kn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
2
|
-
export{fr,g,
|
|
1
|
+
import{e}from"./chunk-wpdn3rx8.js";import{u,m,b,K,p,w}from"./chunk-n5xqjct2.js";import{ee}from"./chunk-3919sqde.js";import{createContext as S,useContext as C,useState as y,useSyncExternalStore as L}from"react";import{jsx as i,jsxs as c}from"react/jsx-runtime";var v=S(null),f=S(null),x=S(null);function fr({host:t,client:o,children:n}){let[s,a]=y(null);ee(s!==null);let{t:d}=t;return i(v,{value:t,children:i(f,{value:o,children:c(x,{value:a,children:[n,i(u,{open:s!==null,onOpenChange:(D)=>!D&&a(null),children:c(m,{children:[c(b,{children:[i(p,{children:d("sessionList.deleteTitle")}),i(w,{children:d("sessionList.deleteDescription")})]}),c(K,{children:[i(e,{variant:"outline",onClick:()=>a(null),children:d("sessionList.cancel")}),i(e,{onClick:()=>{if(s)T(t,o.delete(s.sessionId));a(null)},children:d("sessionList.delete")})]})]})})]})})})}function g(){let t=C(v);if(t===null)throw Error("Session list host is missing");return t}function l(){let t=C(f);if(t===null)throw Error("Session list client is missing");return t}function ot(){let t=C(x);if(t===null)throw Error("Session list provider is missing");return t}function r(t){let o=l();return L((n)=>o.store.subscribe(n),()=>t(o.store.getState()),()=>t(o.store.getState()))}function T(t,o){return o.then(()=>{},(n)=>{if(t.reportError)t.reportError(n);else console.error(n)})}
|
|
2
|
+
export{fr,g,l,ot,r,T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as i}from"cn";import{jsx as a}from"react/jsx-runtime";function k({className:r,...e}){return a("textarea",{"data-slot":"textarea",className:i("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",r),...e})}export{k};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Ping as l}from"ldrs/react";import"ldrs/react/Ping.css";import{cn as i}from"cn";import{jsx as e,jsxs as u}from"react/jsx-runtime";var
|
|
2
|
-
export{yn,
|
|
1
|
+
import{Ping as l}from"ldrs/react";import"ldrs/react/Ping.css";import{cn as i}from"cn";import{jsx as e,jsxs as u}from"react/jsx-runtime";var xn={requires_action:"bg-red-500",running:"bg-yellow-500",done:"bg-blue-500",idle:"bg-green-500"},yn={requires_action:"text-red-500",running:"text-yellow-500",done:"text-blue-500",idle:"text-green-500"};function q({state:n,className:t,pulse:s=!0,title:r}){if(n===void 0)return null;let o=xn[n];if(n==="running"&&s)return u("span",{title:r,className:i("relative inline-flex size-1.5 shrink-0 items-center justify-center",yn.running,t),children:[e("span",{className:"absolute inset-0 flex items-center justify-center",children:e(l,{size:"26",speed:"2",color:"currentColor"})}),e("span",{className:"relative size-1.5 rounded-full bg-current"})]});return e("span",{title:r,className:i("size-2 shrink-0 rounded-full",o,t)})}
|
|
2
|
+
export{xn,yn,q};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{On
|
|
1
|
+
import{Hn,On}from"./chunk-25bzk1wv.js";import{cn as l}from"cn";import{jsx as t,jsxs as a}from"react/jsx-runtime";function f({value:i,onValueChange:n,options:o,itemClassName:d}){return t(Hn,{value:i,onValueChange:(e)=>n(String(e)),children:o.map((e)=>a(On,{value:e.value,disabled:e.disabled,title:e.title,closeOnClick:!0,className:l("gap-2",e.description?"items-start":"items-center",d),children:[e.icon,e.description?a("div",{className:"min-w-0 flex-1",children:[t("div",{className:"text-xs font-medium",children:e.label}),t("div",{className:"text-muted-foreground text-[11px] font-normal",children:e.description})]}):t("span",{className:"min-w-0 flex-1 truncate text-start",children:e.label})]},e.value))})}
|
|
2
2
|
export{f};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{Do}from"./chunk-dnsmr5nf.js";import{
|
|
1
|
+
import{Do}from"./chunk-dnsmr5nf.js";import{Xt,Ho}from"./chunk-pafshe3v.js";import{Qt}from"./chunk-y3567zfn.js";import{decodeHTMLAttribute as C,decodeHTMLStrict as R}from"entities";import oe from"katex";import{CheckIcon as z,ChevronLeftIcon as ae,ChevronRightIcon as se,CopyIcon as ie,DownloadIcon as ce,FileIcon as de,LinkIcon as le,MailIcon as ue,XIcon as me}from"lucide-react";import"katex/dist/katex.min.css";import{createContext as ge,createElement as U,memo as B,startTransition as fe,useContext as he,useEffect as k,useLayoutEffect as D,useMemo as X,useRef as w,useState as p}from"react";import{jsx as a,jsxs as f,Fragment as te}from"react/jsx-runtime";var G=ge(null);function y(){let e=he(G);if(e===null)throw Error("Markdown host is missing");return e}var pe=80,A=/\[([^\]\n]+)\]\(([^)\n]+)$/,ke=/(^|\n)[^\S\n]*!\[[^\]\n]*(?:\](?:\([^\n]*)?)?\s*$/,we=/\uE200[^\uE201]*$/,be=4,xe=new Set("7zipx.accdb.asarpack.asciidoc.backup.backupdb.bundle.ccproj.cdrdao.code-workspace.config.debugin.deploy.design.docbook.dockerfile.dockerignore.editorconfig.eslintignore.gitattributes.gitignore.gitignore.gitkeep.gradle.graphqls.ignore.ipynb.keychain.keynote.licensee.lockfile.lockfile.markdown.markup.matlab.mkdocs.models.module.msstyle.notebook.npmignore.output.packageinfo.parquet.pickle.plistx.policy.postcssrc.prettierignore.projectfile.python.readme.review.robots.schema.search.series.settingsjson.shader.sqlite.sqlite3.storyboard.styles.system.target.terraform.update.vertex.webapp.webdoc.webpackrc.widget.workspace.xcodeproj.yarnlock".split("."));function N(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function J(e,n,t){if(t.length!==1)return!1;return e[n-1]===t||e[n+1]===t}function Te(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!N(e,r)&&!J(e,r,n)){t+=1,r+=n.length;continue}r+=1}return t}function ve(e,n){for(let t=e.length-n.length;t>=0;t-=1)if(e.startsWith(n,t)&&!N(e,t)&&!J(e,t,n))return t;return-1}function Ce(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!N(e,r)){t+=1,r+=n.length;continue}r+=1}return t}function ye(e){return Ce(e,"```")%2===1}function V(e){let n=0;for(let t=0;t<e.length;){if(e.startsWith("```",t)){for(t+=3;t<e.length&&!e.startsWith("```",t);)t+=1;if(t<e.length)t+=3;continue}if(e[t]==="`"&&!N(e,t))n+=1;t+=1}return n%2===1}function Ne(e){return e.endsWith(`
|
|
2
2
|
`)?`${e}\`\`\``:`${e}
|
|
3
3
|
\`\`\``}function H(e,n){if(!e.includes(n)||Te(e,n)%2===0)return e;let t=ve(e,n);if(t<0)return e;let r=e.slice(t+n.length);if(r.length===0||/^\s/.test(r)||r.includes(`
|
|
4
4
|
`)||V(r))return e;return`${e}${n}`}function Me(e){return e.startsWith("/")&&!e.startsWith("//")||/^[A-Za-z]:[\\/]/.test(e)||/^\\\\[^\\]+\\[^\\]+/.test(e)||/^\/\/[^/]+\/[^/]+/.test(e)}function Z(e){let n=e.replaceAll("`","").trim(),t=n.match(/^(.*?):(\d+)(?::(\d+))?(?:[-–](\d+)(?::(\d+))?)?$/);if(t!==null){let[,o,s,i,c,d]=t;if(o===void 0||s===void 0)throw Error("Codex file location is incomplete");return{path:o,line:Number.parseInt(s,10),column:i===void 0?void 0:Number.parseInt(i,10),endLine:c===void 0?void 0:Number.parseInt(c,10),endColumn:d===void 0?void 0:Number.parseInt(d,10)}}let r=n.match(/^(.*?)#L(\d+)(?:C(\d+))?(?:-L(\d+)(?:C(\d+))?)?$/);if(r!==null){let[,o,s,i,c,d]=r;if(o===void 0||s===void 0)throw Error("Codex hash file location is incomplete");return{path:o,line:Number.parseInt(s,10),column:i===void 0?void 0:Number.parseInt(i,10),endLine:c===void 0?void 0:Number.parseInt(c,10),endColumn:d===void 0?void 0:Number.parseInt(d,10)}}return{path:n}}function Ee(e){let{path:n,line:t,column:r,endLine:o,endColumn:s}=Z(e);if(/^[a-z][a-z0-9+.-]*:\/\//i.test(n)||/^www\./i.test(n)||/^(mailto|tel):/i.test(n))return!1;if(t!==void 0||r!==void 0||o!==void 0||s!==void 0)return!0;if(!/(?:^|[\\/])[^\\/]+\.(?!\d+$)[^\\/.]+$/i.test(n))return!1;let i=/[\\/]/.test(n),c=n.split(/[\\/]/).at(-1);if(c===void 0)throw Error("Codex streaming link target has no file name");let d=c.split(".").at(-1);if(d===void 0||d.length===0)return!1;if(!i&&/[a-z]/.test(d)&&/[A-Z]/.test(d.slice(1)))return!1;if(!i){let u=d.toLowerCase();if(u.length>be&&!xe.has(u))return!1}return!0}function Le(e){let{path:n}=Z(e);if(Me(n))return!0;try{return new URL(n).protocol==="file:"}catch{return!1}}function Ie(e){let n=e.match(A);if(n===null)return e;let t=n[2];if(t===void 0)throw Error("Codex streaming link target is missing");return Ee(t)||Le(t)?e.replace(A,"$1"):`${e})`}function $e(e){let n=e.replace(we,"");if(n.length===0||n.includes("`")&&V(n))return{isCodeFenceOpen:!1,markdown:n};if(n.includes("```")&&ye(n))return{isCodeFenceOpen:!0,markdown:Ne(n)};if(n.includes(")n=Ie(n);return n=H(n,"**"),n=H(n,"*"),{isCodeFenceOpen:!1,markdown:n}}function Re(e){return e?.type==="paragraph"&&"tokens"in e&&Array.isArray(e.tokens)}function _(e){return Re(e)&&e.tokens.length===1&&e.tokens[0]?.type==="image"}function Y(e){for(let n=0;n<e.length;n+=1){let t=e[n];if(t===void 0)throw Error(`Codex Markdown token is missing at index ${n}`);if("tokens"in t&&Array.isArray(t.tokens))Y(t.tokens);if(!_(t))continue;let r=[...t.tokens],o=n+1,s=o;for(;;){while(e[o]?.type==="space")o+=1;let i=e[o];if(!_(i))break;r.push(...i.tokens),o+=1,s=o}if(s===n+1)continue;t.tokens=r,t.text=r.map((i)=>i.raw).join(`
|
|
5
5
|
`),t.raw=e.slice(n,s).map((i)=>i.raw).join(""),e.splice(n+1,s-n-1)}}function O(e){return{type:"text",raw:e,text:e}}function Pe(e){return{type:"paragraph",raw:e.raw,text:e.text,tokens:e.tokens??[e]}}function I(e){for(let n of e){if(n.type==="list")for(let t of n.items){let r=t.tokens[0];if(r?.type==="heading"){let o=r,s=o.raw.trimEnd(),i=s.match(/^#{1,6}\s+/)?.[0];if(i!==void 0)t.tokens[0]={type:"paragraph",raw:o.raw,text:s,tokens:o.tokens===void 0?[O(s)]:[O(i),...o.tokens]}}if(t.loose)t.tokens=t.tokens.map((o)=>o.type==="text"?Pe(o):o);I(t.tokens)}if("tokens"in n&&Array.isArray(n.tokens))I(n.tokens)}}function Se(e,n,t){e.preventDefault(),e.stopPropagation(),t.openLink(n)}function Fe(e){try{let n=new URL(e);return n.protocol!=="http:"&&n.protocol!=="https:"?null:`${n.origin}/favicon.ico`}catch{return null}}function Ae(e){let n=Fe(e);return n===null?[]:[n,`https://www.google.com/s2/favicons?domain=${new URL(e).origin}&sz=32`]}function He({href:e}){let n=X(()=>Ae(e),[e]),[t,r]=p(),o=n.length===0&&!/^[a-z][a-z0-9+.-]*:/i.test(e),s=e.toLowerCase().startsWith("mailto:")?ue:o?de:le;return f("span",{className:"codex-markdown-favicon",children:[t===void 0?a("span",{className:"codex-markdown-favicon-fallback",children:a(s,{"aria-hidden":!0})}):null,n.map((i)=>a("img",{alt:"",className:t===i?"codex-markdown-favicon-image-loaded":void 0,decoding:"async",draggable:!1,referrerPolicy:"no-referrer",src:i,onLoad:()=>r((c)=>c!==void 0&&n.includes(c)?c:i)},i))]})}function _e({children:e,href:n,title:t}){let r=y();if(r.preview)return a("span",{children:e});return a("a",{className:"codex-markdown-link","data-inline-mention-interactive":"",href:n,title:t,onClick:(o)=>Se(o,n,r),children:f("span",{className:"codex-markdown-link-mention","data-layout":"inline-flow","data-interactive":"","data-underline-on-hover":"",children:[a("span",{className:"codex-markdown-link-icon-container","data-markdown-copy":"exclude",children:a(He,{href:n})}),a("span",{className:"codex-markdown-link-label",children:e})]})})}function Oe({code:e,language:n}){let{theme:t,copyLabel:r,copyText:o,onCopyError:s}=y(),i=w(null),[c,d]=p(null),[u,h]=p(null),[M,b]=p(!1);if(k(()=>{let g=Do(d,h);return i.current=g,()=>{g.dispose(),i.current=null}},[]),k(()=>{let g=i.current;if(g===null)throw Error("Code highlighter is not mounted");g.update(e,n)},[e,n]),u!==null)throw u;let x=c!==null&&c.code===e&&c.language===n?c.html:null,l=async()=>{b(!1);try{await(o?o(e):navigator.clipboard.writeText(e)),b(!0),window.setTimeout(()=>b(!1),2000)}catch(g){s?.(g)}};return f("div",{className:"codex-markdown-code-block","data-markdown-copy":"code-block","data-markdown-copy-text":e,"data-theme":t==="dark"?"dark":"light",children:[f("div",{className:"codex-markdown-code-header","data-markdown-copy":"exclude",children:[a("div",{className:"codex-markdown-code-title",children:n}),a("div",{className:"codex-markdown-code-actions",children:a("button",{type:"button",className:"codex-markdown-code-copy",title:r,onClick:()=>void l(),children:M?a(z,{}):a(ie,{})})})]}),a("div",{className:"codex-markdown-code-container",dir:"ltr",children:a("code",{className:"codex-markdown-code-content hljs",...x===null?{children:e}:{dangerouslySetInnerHTML:{__html:x}}})})]})}function je({code:e,language:n}){return y().preview?a("span",{children:e}):a(We,{code:e,language:n})}function We({code:e,language:n}){let t=w(null),[r,o]=p(!1);if(k(()=>{if(r)return;let s=t.current;if(s===null)throw Error("Codex code block placeholder is not mounted");if(typeof IntersectionObserver>"u"){let c=window.setTimeout(()=>o(!0),0);return()=>window.clearTimeout(c)}let i=new IntersectionObserver((c)=>{if(!c.some((d)=>d.isIntersecting))return;o(!0),i.disconnect()},{rootMargin:"600px 0px"});return i.observe(s),()=>i.disconnect()},[r]),r)return a(Oe,{code:e,language:n});return a("div",{ref:t,className:"codex-markdown-code-block",children:a("pre",{className:"codex-markdown-code-placeholder",children:a("code",{children:e})})})}function qe(e){let n=[...document.body.querySelectorAll('[data-markdown-image-preview-trigger="true"]')],t=n.map((o)=>{let s=o.querySelector("img");if(s===null)throw Error("Codex image preview trigger has no image");return{src:s.currentSrc||s.src,alt:s.alt}}),r=n.indexOf(e);if(r===-1)throw Error("Codex image preview trigger is outside the document");return{images:t,index:r}}function Ke({preview:e,setPreview:n}){let t=e.images[e.index];if(t===void 0)throw Error(`Codex image preview index is out of range: ${e.index}`);return f("div",{className:"codex-markdown-image-preview",children:[a("img",{src:t.src,alt:t.alt}),f("div",{className:"codex-markdown-image-preview-actions",children:[a("button",{type:"button","aria-label":"Previous image",disabled:e.index===0,onClick:()=>n({...e,index:e.index-1}),children:a(ae,{})}),a("a",{href:t.src,download:!0,"aria-label":"Download image",children:a(ce,{})}),a("button",{type:"button","aria-label":"Next image",disabled:e.index===e.images.length-1,onClick:()=>n({...e,index:e.index+1}),children:a(se,{})}),a("button",{type:"button","aria-label":"Close image preview",onClick:()=>n(void 0),children:a(me,{})})]})]})}function ze(e){return y().preview?a(te,{children:e.alt}):a(Ue,{...e})}function Ue({src:e,alt:n,title:t,allowWide:r}){let o=w(null),[s,i]=p();k(()=>{let d=o.current;if(d===null)throw Error("Codex image preview dialog is not mounted");if(s===void 0){if(d.open)d.close();return}if(!d.open)d.showModal()},[s]);let c=n.length===0?"Open image preview":n;return f(te,{children:[a("button",{type:"button",className:`codex-markdown-image-trigger${r?"codex-markdown-image-trigger-wide":""}`,"aria-label":c,"data-markdown-image-preview-trigger":"true",onClick:(d)=>i(qe(d.currentTarget)),children:a("img",{className:`codex-markdown-image${r?"codex-markdown-image-wide":""}`,src:e,alt:n,title:t,loading:"lazy"})}),a("dialog",{ref:o,className:"codex-markdown-image-dialog","aria-label":c,onClose:()=>i(void 0),children:s===void 0?null:a(Ke,{preview:s,setPreview:i})})]})}function Be({value:e,display:n}){let t=w(null);return D(()=>{if(t.current===null)throw Error("Codex math root is not mounted");oe.render(e,t.current,{displayMode:n,throwOnError:!1})},[n,e]),a("span",{ref:t,className:n?"codex-markdown-math-block":"codex-markdown-inline-math"})}var De=150,v=null;function j(e,n){let t=v;if(t===null)return e;let r=t.cursor,o=r+e.length;t.cursor=o;let s=[],i=r;for(let c of t.runs){if(c.end<=r)continue;if(c.start>=o)break;let d=Math.max(r,c.start),u=Math.min(o,c.end);if(i<d)s.push(e.slice(i-r,d-r));s.push(a("span",{className:"codex-markdown-fade",children:e.slice(d-r,u-r)},`${n}:${t.generation}:${c.start}`)),i=u}if(i<o)s.push(e.slice(i-r));return s}function Q(e){let n=5381;for(let t=0;t<e.length;t+=1)n=(n*33+e.charCodeAt(t))%4294967296;return n.toString(36)}function W(e){let n=e.trim();if(n.length===0)return"";let t=n.split(`
|
|
6
|
-
`,1)[0];if(t===void 0)throw Error("Codex Markdown token has no first line");return(t.match(/\S+/)?.[0]??t).slice(0,pe)}function Xe(e){switch(e.type){case"code":return e.raw.trimStart().match(/^(```|~~~)/)?.[1]??"";case"link":return e.href;case"image":{let n=e;return`${n.href}:${W(n.text)}`}case"html":case"space":case"br":case"hr":case"def":return e.raw;case"math":return W(e.text);default:return""}}function ee(e){return`${e.type==="math"?`math-${e.display?"block":"inline"}`:e.type}-${Q(Xe(e))}`}function m(e,n){let t=new Map;return e.map((r)=>{let o=ee(r),s=t.get(o)??0;return t.set(o,s+1),ne(r,`${n}-${o}-${s}`)})}function Ge(e,n){let t=e.task?e.tokens.filter((r)=>r.type!=="checkbox"):e.tokens;return f("li",{className:`codex-markdown-list-item${e.task?"codex-markdown-task-list-item":""}`,children:[e.task?f("div",{className:"codex-markdown-task-checkbox",children:[a("input",{type:"checkbox",className:"codex-markdown-checkbox",checked:e.checked,"data-state":e.checked?"checked":"unchecked",readOnly:!0,disabled:!0}),e.checked?a(z,{}):null]}):null,m(t,n)]},n)}function Je(e,n){let r=`codex-markdown-list ${e.items.some((s)=>s.task)?"codex-markdown-task-list":e.ordered?"codex-markdown-ordered-list":"codex-markdown-unordered-list"}`,o=m(e.items,n);return e.ordered?a("ol",{className:r,start:e.start===""?void 0:e.start,children:o},n):a("ul",{className:r,children:o},n)}function q(e,n,t){let r=t?"th":"td",o=/^\d+$/.test(e.text);return U(r,{key:n,className:`${t?"codex-markdown-table-header":"codex-markdown-table-cell"}${o?" codex-markdown-numeric-table-cell":""}`,align:e.align??void 0},...m(e.tokens,n))}function Ve(e,n){let t=new Map;return a("div",{className:"codex-markdown-table-container","data-markdown-table":!0,tabIndex:-1,children:a("div",{className:"codex-markdown-table-scroller",children:a("div",{className:"codex-markdown-table-wrapper",children:f("table",{className:"codex-markdown-table",children:[a("thead",{children:a("tr",{className:"codex-markdown-table-row",children:e.header.map((r,o)=>q(r,`${n}-header-${o}`,!0))})}),a("tbody",{className:"codex-markdown-table-body",children:e.rows.map((r)=>{let o=Q(r.map((c)=>c.text).join("\x00")),s=t.get(o)??0;t.set(o,s+1);let i=`${n}-row-${o}-${s}`;return a("tr",{className:"codex-markdown-table-row",children:r.map((c,d)=>q(c,`${i}-cell-${d}`,!1))},i)})})]})})})},n)}function K(e,n,t){let r=C(e.href);if(!
|
|
6
|
+
`,1)[0];if(t===void 0)throw Error("Codex Markdown token has no first line");return(t.match(/\S+/)?.[0]??t).slice(0,pe)}function Xe(e){switch(e.type){case"code":return e.raw.trimStart().match(/^(```|~~~)/)?.[1]??"";case"link":return e.href;case"image":{let n=e;return`${n.href}:${W(n.text)}`}case"html":case"space":case"br":case"hr":case"def":return e.raw;case"math":return W(e.text);default:return""}}function ee(e){return`${e.type==="math"?`math-${e.display?"block":"inline"}`:e.type}-${Q(Xe(e))}`}function m(e,n){let t=new Map;return e.map((r)=>{let o=ee(r),s=t.get(o)??0;return t.set(o,s+1),ne(r,`${n}-${o}-${s}`)})}function Ge(e,n){let t=e.task?e.tokens.filter((r)=>r.type!=="checkbox"):e.tokens;return f("li",{className:`codex-markdown-list-item${e.task?"codex-markdown-task-list-item":""}`,children:[e.task?f("div",{className:"codex-markdown-task-checkbox",children:[a("input",{type:"checkbox",className:"codex-markdown-checkbox",checked:e.checked,"data-state":e.checked?"checked":"unchecked",readOnly:!0,disabled:!0}),e.checked?a(z,{}):null]}):null,m(t,n)]},n)}function Je(e,n){let r=`codex-markdown-list ${e.items.some((s)=>s.task)?"codex-markdown-task-list":e.ordered?"codex-markdown-ordered-list":"codex-markdown-unordered-list"}`,o=m(e.items,n);return e.ordered?a("ol",{className:r,start:e.start===""?void 0:e.start,children:o},n):a("ul",{className:r,children:o},n)}function q(e,n,t){let r=t?"th":"td",o=/^\d+$/.test(e.text);return U(r,{key:n,className:`${t?"codex-markdown-table-header":"codex-markdown-table-cell"}${o?" codex-markdown-numeric-table-cell":""}`,align:e.align??void 0},...m(e.tokens,n))}function Ve(e,n){let t=new Map;return a("div",{className:"codex-markdown-table-container","data-markdown-table":!0,tabIndex:-1,children:a("div",{className:"codex-markdown-table-scroller",children:a("div",{className:"codex-markdown-table-wrapper",children:f("table",{className:"codex-markdown-table",children:[a("thead",{children:a("tr",{className:"codex-markdown-table-row",children:e.header.map((r,o)=>q(r,`${n}-header-${o}`,!0))})}),a("tbody",{className:"codex-markdown-table-body",children:e.rows.map((r)=>{let o=Q(r.map((c)=>c.text).join("\x00")),s=t.get(o)??0;t.set(o,s+1);let i=`${n}-row-${o}-${s}`;return a("tr",{className:"codex-markdown-table-row",children:r.map((c,d)=>q(c,`${i}-cell-${d}`,!1))},i)})})]})})})},n)}function K(e,n,t){let r=C(e.href);if(!Qt(r))return null;return a(ze,{src:r,alt:R(e.text),title:e.title==null?void 0:C(e.title),allowWide:t},n)}function ne(e,n){switch(e.type){case"space":case"def":case"internalMessage":return null;case"hr":return a("hr",{className:"codex-markdown-horizontal-rule"},n);case"heading":{let t=e,o={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"}[t.depth];if(o===void 0)throw Error(`Unsupported Codex Markdown heading depth: ${t.depth}`);return U(o,{key:n,className:`codex-markdown-heading codex-markdown-heading-${t.depth}`},...m(t.tokens,n))}case"paragraph":{let t=e,r=t.tokens.filter((i)=>i.type!=="space"&&i.type!=="br"),o=r.length>0&&r.every((i)=>i.type==="image"),s=o&&r.length>1;return a("p",{className:`codex-markdown-paragraph${o?"codex-markdown-media-paragraph codex-markdown-media-wide-block":""}${s?"codex-markdown-media-grid-paragraph":""}`,"data-markdown-image-grid":s?"true":void 0,"data-wide-markdown-block":o?"true":void 0,"data-wide-markdown-block-kind":o?"image":void 0,children:o?r.map((i,c)=>K(i,`${n}-image-${c}`,!0)):m(t.tokens,n)},n)}case"text":{let t=e;return t.tokens===void 0?j(R(t.text),n):m(t.tokens,n)}case"escape":return j(e.text,n);case"strong":return a("strong",{className:"codex-markdown-strong",children:m(e.tokens,n)},n);case"em":return a("em",{children:m(e.tokens,n)},n);case"del":return a("del",{children:m(e.tokens,n)},n);case"codespan":return a("span",{className:"codex-markdown-inline-code",dir:"ltr","data-markdown-copy":"inline-code",children:e.text},n);case"br":return a("br",{},n);case"link":{let t=e,r=m(t.tokens,n),o=C(t.href);return Qt(o)?a(_e,{href:o,title:t.title==null?void 0:C(t.title),children:r},n):a("span",{children:r},n)}case"image":return K(e,n,!1);case"code":{let t=e;return a(je,{code:t.text,language:t.lang},n)}case"blockquote":return a("blockquote",{className:"codex-markdown-blockquote",children:m(e.tokens,n)},n);case"list":return Je(e,n);case"list_item":return Ge(e,n);case"table":return Ve(e,n);case"html":{let t=e;return/^<br\s*\/?>$/i.test(t.raw.trim())?a("br",{},n):t.raw}case"math":{let t=e;return a(Be,{value:t.text,display:t.display},n)}default:throw Error(`Unsupported Codex Markdown token: ${JSON.stringify(e)}`)}}function T(e){switch(e.type){case"text":{let n=e;return n.tokens===void 0?R(n.text):n.tokens.map(T).join("")}case"escape":return e.text;case"paragraph":case"heading":case"strong":case"em":case"del":case"link":case"blockquote":case"list_item":return e.tokens.map(T).join("");case"list":return e.items.map(T).join("");case"table":{let n=e;return[n.header,...n.rows].map((t)=>t.map((r)=>r.tokens.map(T).join("")).join("")).join("")}default:return""}}function Ze({token:e,tokenKey:n,offset:t,runs:r,generation:o}){let s=v;try{return v={cursor:t,runs:r,generation:o},ne(e,n)}finally{v=s}}var Ye=B(function({result:n}){let{text:t,isStreaming:r}=n,o=X(()=>{let l=n.tokens;if(n.source.includes("!["))Y(l);I(l);let g=new Map,P=0;return l.map((E)=>{let L=ee(E),S=g.get(L)??0;g.set(L,S+1);let F=T(E),re={token:E,tokenKey:`root-${L}-${S}`,offset:P,visibleText:F};return P+=F.length,re})},[n]),s=o.map((l)=>l.visibleText).join(""),i=w({text:"",visibleText:"",runs:[],generation:0}),c=i.current,d=t.startsWith(c.text)||s.startsWith(c.visibleText),u=d?c.visibleText.length:0,h=performance.now(),M=r&&d?c.runs.filter((l)=>h-l.firstSeenAtMs<De):[],b=c.generation+(d?0:1),x={text:t,visibleText:s,runs:M.filter((l)=>l.start<s.length).map((l)=>({...l,end:Math.min(l.end,s.length)})),generation:b};if(r&&s.length>u)x.runs.push({start:u,end:s.length,firstSeenAtMs:h});return D(()=>{i.current=x}),a("div",{dir:"auto",className:"codex-markdown-content codex-markdown-root","data-streaming":r?"true":void 0,children:o.map((l)=>a(Ze,{token:l.token,tokenKey:l.tokenKey,offset:l.offset,runs:x.runs,generation:b},l.tokenKey))})}),Qe=B(function({text:n,isStreaming:t}){let r=w(null),[o,s]=p(()=>Xt(n,t)),i=w(o!==null),[c,d]=p(null);if(k(()=>{let u=Ho((h)=>{if(!i.current)i.current=!0,s(h);else fe(()=>s(h))},d);return r.current=u,()=>{u.dispose(),r.current=null}},[]),k(()=>{let u=r.current;if(u===null)throw Error("Markdown parser is not mounted");let h=t?$e(n).markdown:n;u.update({source:h,text:n,isStreaming:t})},[t,n]),c!==null)throw c;return o===null?a("div",{"data-markdown-pending":!0}):a(Ye,{result:o})});function No({text:e,streaming:n,host:t}){let r=n===!0,[o,s]=p(e);return k(()=>{if(o===e)return;if(!r){s(e);return}let i=requestAnimationFrame(()=>s(e));return()=>cancelAnimationFrame(i)},[o,r,e]),a(G.Provider,{value:t,children:a(Qe,{text:r?o:e,isStreaming:r})})}
|
|
7
7
|
export{No};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var br={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function no(e){return[...e].toSorted((o,n)=>(br[o.kind]??99)-(br[n.kind]??99))}function mi(e){return e==="allow_once"||e==="allow_always"}function pi(e){return e==="allow_always"||e==="reject_always"}
|
|
2
|
+
export{br,no,mi,pi};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Tooltip as i}from"@base-ui/react/tooltip";import{cn as l}from"cn";import{jsx as o,jsxs as p}from"react/jsx-runtime";function ui({delay:t=0,...e}){return o(i.Provider,{"data-slot":"tooltip-provider",delay:t,...e})}function ue({...t}){return o(i.Root,{"data-slot":"tooltip",...t})}function me({...t}){return o(i.Trigger,{"data-slot":"tooltip-trigger",...t})}function pe({className:t,side:e="top",sideOffset:a=4,align:d="center",alignOffset:r=0,children:n,...s}){return o(i.Portal,{children:o(i.Positioner,{align:d,alignOffset:r,side:e,sideOffset:a,className:"isolate z-50",children:p(i.Popup,{"data-slot":"tooltip-content",className:l("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pe-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...s,children:[n,o(i.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-start-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-end-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}export{ui,ue,me,pe};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var a=(e)=>String(e).padStart(2,"0");function
|
|
2
|
-
export{
|
|
1
|
+
var a=(e)=>String(e).padStart(2,"0");function qe(e,l="user"){let r=e.replayed||e.items.some((t)=>t._meta?.codex&&typeof t._meta.codex==="object"&&("historyReplay"in t._meta.codex)&&t._meta.codex.historyReplay===!0),n=l==="user"?s(e.user?._meta,"messageSentAt")??(!r?e.user?.at??null:null):s(e.final.at(-1)?._meta,"messageCompletedAt")??e.items.map((t)=>s(t._meta,"turnCompletedAt")).find((t)=>t!==null)??(!r&&e.final.length>0?e.endedAt:null);if(n===null)return null;let o=new Date(n),u=o.toDateString()===new Date().toDateString();return{short:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",...u?{}:{month:"short",day:"numeric"}}).format(o),full:`${o.getFullYear()}-${a(o.getMonth()+1)}-${a(o.getDate())} ${a(o.getHours())}:${a(o.getMinutes())}`}}function s(e,l){let r=e?.codex;if(typeof r!=="object"||r===null)return null;let n=r[l];return typeof n==="number"&&Number.isFinite(n)&&Math.abs(n)<=8640000000000000?n:null}
|
|
2
|
+
export{qe};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function fn(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function St(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function ae(t){return t.type==="array"}function Ke(t){return(ae(t)?t.items?.oneOf??[]:t.oneOf??[]).map((e)=>{let i=e,r=i.const??i.title??"";return{value:r,label:i.title??r,...i.description?{description:i.description}:{},...i._meta?.alwith?.preview?{preview:i._meta.alwith.preview}:{}}})}
|
|
2
|
+
export{fn,St,ae,Ke};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
1
|
+
import{e}from"./chunk-wpdn3rx8.js";import{v}from"./chunk-kjtd3wc3.js";import{Y,A}from"./chunk-0nkvfecf.js";import{k}from"./chunk-da6d6wze.js";import{useId as b}from"react";import{jsx as r,jsxs as p,Fragment as w}from"react/jsx-runtime";function a(n){return n!==null&&typeof n==="object"&&!Array.isArray(n)}function h(n){if(!a(n)||!a(n.codex))return[];let s=n.codex,i=s.questions;if(s.delivery!=="async"||!Array.isArray(i))return[];if(!i.every((t)=>a(t)&&typeof t.title==="string"&&t.title.trim().length>0&&(t.options===null||Array.isArray(t.options)&&t.options.every((l)=>typeof l==="string"))))return[];return i}function cn(n,s){return JSON.stringify(["request_user_input_async",n,s])}function er(n){return{selected:n.options?.length?0:null,text:""}}function dn(n,s){return s.selected===null?s.text:n.options?.[s.selected]??""}function tr(n){return`<send_user_message_question_reply>
|
|
2
2
|
${JSON.stringify([n])}
|
|
3
|
-
</send_user_message_question_reply>`}function
|
|
4
|
-
export{h,dn,
|
|
3
|
+
</send_user_message_question_reply>`}function un(n){if(!a(n)||!a(n.codex))return[];let s=n.codex;return(Array.isArray(s.questionReplyParts)?s.questionReplyParts.map((t)=>a(t)?{...t,answer:t.text}:t):[s.questionReply]).filter((t)=>a(t)&&typeof t.questionItemId==="string"&&typeof t.question==="string"&&typeof t.answer==="string").map(({questionItemId:t,question:l,answer:c})=>({questionItemId:t,question:l,answer:c}))}function nr({question:n,draft:s,status:i,answer:t,error:l,onChange:c,onSubmit:m,onSkip:x,t:o}){let y=b(),d=i==="pending",f=i==="answered"||i==="skipped";return p("section",{"aria-labelledby":`${y}-title`,className:"border-border bg-card text-card-foreground flex min-w-0 flex-col gap-3 rounded-xl border p-4",children:[r("h3",{id:`${y}-title`,className:"text-sm font-medium whitespace-pre-wrap",children:n.title}),f?r("p",{className:"text-sm whitespace-pre-wrap",children:i==="answered"?t:o("asyncQuestion.skipped")}):p(w,{children:[(n.options?.length??0)>0&&p(Y,{"aria-labelledby":`${y}-title`,disabled:!d,value:s.selected===null?"other":String(s.selected),onValueChange:(u)=>c({...s,selected:u==="other"?null:Number(u)}),children:[n.options?.map((u,g)=>p(v,{className:"flex items-start gap-2 text-sm",children:[r(A,{value:String(g)}),r("span",{className:"whitespace-pre-wrap",children:u})]},g)),p(v,{className:"flex items-center gap-2 text-sm",children:[r(A,{value:"other"}),o("asyncQuestion.other")]})]}),r(k,{"aria-label":o("asyncQuestion.answer"),placeholder:o("asyncQuestion.answer"),value:s.text,readOnly:!d,onChange:(u)=>c({selected:null,text:u.target.value})}),l&&r("p",{role:"alert",className:"text-destructive text-sm",children:l}),p("div",{className:"flex flex-wrap items-center gap-2",children:[r(e,{size:"sm",disabled:!d||dn(n,s).trim().length===0,onClick:m,children:o(i==="submitting"?"asyncQuestion.submitting":"asyncQuestion.submit")}),r(e,{size:"sm",variant:"ghost",disabled:!d,onClick:x,children:o("asyncQuestion.skip")}),(i==="closed"||i==="unavailable")&&r("span",{role:"status",className:"text-muted-foreground text-xs",children:o(`asyncQuestion.${i}`)})]})]})]})}
|
|
4
|
+
export{h,cn,er,dn,tr,un,nr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function Eo(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function
|
|
2
|
-
export{Eo,
|
|
1
|
+
import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function Eo(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function Ti(){c()}function Ao(){if(r.unlockConsumerCount===0)window.addEventListener("pointerdown",c,{capture:!0}),window.addEventListener("keydown",c,{capture:!0});return r.unlockConsumerCount++,()=>{if(r.unlockConsumerCount--,r.unlockConsumerCount===0)window.removeEventListener("pointerdown",c,{capture:!0}),window.removeEventListener("keydown",c,{capture:!0})}}function Lo(e,n,t,i,o){if(o==="none")return;let a=Math.sign(n-e),u=Math.abs(n-e),x=Array.from({length:u},(L,A)=>{let N=e+a*(A+1),v=t[N];return wr(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function Si(e,n,t,i,o,a){if(a==="none")return;_(o,[wr(e,n,t,i,a)])}function wr(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Or(t,i);return kr(e,n)}function Or(e,n){let t=Math.imul(e,5)+Math.imul(n,3)>>>0,i=(Math.imul(e,11)^Math.imul(n,13))>>>0,o=t%f.length;return 12*(U+i%C+1)+f[o]}function kr(e,n){return y+Fr(e,n)}function Ii(e,n){return D(kr(e,n))}function Fr(e,n){if(n<=l)return Br(n)[n-e-1];return Math.round((n-e-1)/(n-1)*(l-1))}function Br(e){if(e<=s.length)return s.slice(0,e);let n=new Set(s),t=s[0]-1,i=s.at(-1)+1;while(n.size<e&&(t>=0||i<l)){if(t>=0&&n.size<e)n.add(t--);if(i<l&&n.size<e)n.add(i++)}for(let o=0;n.size<e&&o<l;o++)n.add(o);return[...n].toSorted((o,a)=>o-a)}function D(e){return 440*2**((e-69)/12)}function _(e,n){let t=d();if(t.state!=="running")return;let{player:i,ready:o}=g(e);o.then(()=>{let a=Math.max(t.currentTime,r.nextNoteTime);for(let u=0;u<n.length;u++)i.start({note:n[u],time:a+u*p,duration:b,velocity:S});r.nextNoteTime=a+n.length*p}).catch((a)=>{console.error(`Failed to play navigation instrument "${e}"`,a)})}function Pi(){return r.context?.state}function Ni(e){return g(e).ready}
|
|
2
|
+
export{Eo,Ti,Ao,Lo,Si,wr,Or,kr,Ii,Fr,Br,Pi,Ni};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
1
|
+
import{e}from"./chunk-wpdn3rx8.js";import{le}from"./chunk-pv35kspb.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 Ye({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(le,{className:"size-3","aria-label":t}):a(u,{className:"size-3 fill-current"})})}
|
|
2
2
|
export{Ye};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ho,be,
|
|
1
|
+
import{ho,be,jt,vo,xo,yo}from"./chunk-rxc15vtr.js";import{forwardRef as ye,useCallback as K,useEffect as ge,useImperativeHandle as ve,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 pe=12,X=2,V=800,he=new Map;function Re({turnKey:q,heightPx:x,placeholder:W=!1,deferUntilReady:n=!1,observe:b,onReady:L,children:z}){let h=s(null),[H,_]=F(!1),U=K((m)=>{h.current=m,b(q,m)},[b,q]);return w(()=>{let m=h.current;if(m===null)throw Error("Codex turn element is missing");let T=()=>{L(m),_(!0)};if(m.querySelector("[data-markdown-pending]")===null){T();return}let d=new MutationObserver(()=>{if(m.querySelector("[data-markdown-pending]")!==null)return;d.disconnect(),T()});return d.observe(m,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-markdown-pending"]}),()=>d.disconnect()},[L]),re("div",{style:H?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":!H||void 0,style:!H&&!W&&n?{visibility:"hidden"}:void 0,"data-turn-ready":H?"":void 0,children:z}),!H&&!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 fo=ye(function({entries:x,renderTurn:W,scrollElement:n,sessionKey:b,leadingContent:L,leadingInsetPx:z=0,preserveViewport:h=!1},H){let _=s(null),[U,m]=F(z),T=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()},[T]);let d=ne(()=>he.get(b),[b]),[j,J]=F(()=>d?.turnHeightsByKey??{}),i=ne(()=>ho({entries:x,gapPx:pe,measuredHeightsByKey:j,leadingInsetPx:T?U:z}),[x,j,T,U,z]),me=ne(()=>{let e=be({distanceFromBottomPx:d?.distanceFromBottomPx??0,layout:i,overscanCount:X,viewportHeightPx:V}),t=d?.renderedWindow;if(t===void 0||t===null)return e;return jt({anchorKey:t.anchorKey,layout:i,previousRange:{startIndex:0,endIndex:Math.min(t.count,e.endIndex-e.startIndex)}})??e},[d,i]),[M,ie]=F(me),[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=be({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]),fe=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},[]),xe=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=yo({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=be({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=vo({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(b,{distanceFromBottomPx:N.current,renderedWindow:o===void 0?null:{anchorKey:o,count:e.endIndex-e.startIndex},turnHeightsByKey:l.current})},[b]),ve(H,()=>({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=xo({layout:i,turnKey:e,viewportHeightPx:y});if(a===null)throw Error(`Codex virtual turn is missing: ${e}`);let g=be({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:jt({anchorKey:e,layout:i,previousRange:M}))??be({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:[T&&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(Re,{turnKey:e.turnKey,heightPx:i.heightsPx[t],placeholder:e.placeholder,deferUntilReady:e.deferUntilReady,observe:xe,onReady:fe,children:W(e,t)})},e.turnKey))]})});
|
|
2
2
|
export{fo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h}from"./chunk-
|
|
2
|
-
export{Wr,
|
|
1
|
+
import{h}from"./chunk-en8s7tet.js";import{codexMessageError as A,nativeTurnId as m,textOf as S,turns as _}from"@nyssance/codex-acp-v2/client";function Wr(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 Ko(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=h(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(h(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 Qo(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)=>!Wr(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}`,x=r.endedAt??Math.max(...a.map((c)=>c.at)),y=o.get(I);if(y!==void 0&&K(y.items,a)&&y.endedAt===x)return y;let b={key:I,user:r.prompt,work:[],final:[],errors:[],edits:[],startedAt:r.startedAt??l.at,endedAt:x,replayed:a.every(on),items:a},v=a.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return a.forEach((c,g)=>j(b,c,g<v,a[g-1])),b})}function K(t,e){return t.length===e.length&&t.every((n,o)=>n===e[o])}function on(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function Q(t){return S(t.content)}function Ve(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function rn(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function Xo(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 Yo(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 Zo(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(!Yo(t,e[n-1],o))break;n--}return e[n]?.key}function Jo(t,e,n){let o=n,s=n;while(o>0&&Yo(t,e[o-1],e[o]))o--;while(s+1<e.length&&Yo(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{Wr,Ko,Qo,on,Q,Ve,rn,Xo,Yo,Zo,Jo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{ar}from"./chunk-pvj43sjx.js";import{isPlanItems as o}from"@nyssance/codex-acp-v2/client";function ir(s,r){let n=s.items.findLast((e)=>e.kind!=="user"),a=s.items.map((e)=>{switch(e.kind){case"user":return{key:e.id,kind:"user",active:!1};case"tool":return{key:e.id,kind:"tool",active:e.status==="pending"||e.status==="in_progress"};case"compaction":return{key:e.id,kind:"compaction",active:e.status==="in_progress"};case"plan":return{key:e.id,kind:"plan",active:o(e.plan)&&e.plan.entries.some((t)=>t.status==="in_progress")};case"thought":return{key:e.id,kind:"reasoning",active:e===n};case"assistant":{let t=e._meta?.codex,i=typeof t==="object"&&t!==null&&(("messageCompleted"in t)&&t.messageCompleted===!0||("messageCompletedAt"in t)&&typeof t.messageCompletedAt==="number");return{key:e.id,kind:s.final.includes(e)?"answer":"text",active:e===n&&!i}}}});return ar(a,r)}
|
|
2
|
+
export{ir};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import{a}from"./chunk-qxabrz98.js";import{ChevronDownIcon as v,ChevronUpIcon as b,FileDiffIcon as C}from"lucide-react";import{useState as m}from"react";import{jsx as s,jsxs as n}from"react/jsx-runtime";function x(e){if(e===null||e.length===0)return 0;return e.split(`
|
|
2
|
-
`).length}function
|
|
3
|
-
export{
|
|
2
|
+
`).length}function Vr(e){let l=new Map;for(let u of e)for(let d of u.content){if(d.type!=="diff")continue;let f=d,r=f._meta?.alwith?.hunks??[],h=r.reduce((o,i)=>o+x(i.newText),0),c=r.reduce((o,i)=>o+x(i.oldText),0);for(let o of f.changes){let i=l.get(o.path);if(i)i.additions+=h,i.deletions+=c;else l.set(o.path,{path:o.path,additions:h,deletions:c})}}return[...l.values()]}function Wo({blocks:e}){return s(tn,{files:Vr(e)})}function tn({files:e,onOpen:l,renderPath:u}){let{t:d,openLink:f}=a(),[r,h]=m(!0),[c,o]=m(!1);if(e.length===0)return null;let i=e.reduce((t,p)=>t+p.additions,0),g=e.reduce((t,p)=>t+p.deletions,0);return n("section",{className:"codex-edited-files-card",children:[n("div",{className:"codex-edited-files-header",children:[s("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:s(C,{})}),n("div",{className:"codex-edited-files-summary",children:[s("strong",{children:d("stream.codex.editedFilesCount",{count:e.length})}),s("button",{type:"button","data-codex-disclosure":"",onClick:()=>{h((t)=>!t),o(!1)},"aria-expanded":r,children:d(r?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),n("div",{className:"codex-edited-files-total",title:d("stream.codex.changedLines"),children:[n("span",{className:"codex-diff-additions",children:["+",i]}),n("span",{className:"codex-diff-deletions",children:["-",g]})]})]}),r&&n("div",{className:"codex-edited-files-list",children:[(c?e:e.slice(0,3)).map((t)=>n("div",{className:"codex-edited-file-row",children:[s("button",{type:"button",className:"codex-edited-file-path",title:t.path,onClick:()=>l===void 0?f(t.path):l(t),children:u===void 0?t.path:u(t)}),n("span",{className:"codex-edited-file-counts",children:[n("span",{className:"codex-diff-additions",children:["+",t.additions]}),n("span",{className:"codex-diff-deletions",children:["-",t.deletions]})]})]},t.path)),e.length>3&&n("button",{type:"button",className:"codex-edited-files-more","aria-expanded":c,onClick:()=>o((t)=>!t),children:[d(c?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),c?s(b,{size:16,"aria-hidden":"true"}):s(v,{size:16,"aria-hidden":"true"})]})]})]})}
|
|
3
|
+
export{Vr,Wo,tn};
|