@alwith/module-chat 0.5.16 → 0.5.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- 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-01denvg2.js +5 -0
- package/dist/{chunk-2rv3cq7q.js → chunk-01dqjas2.js} +2 -2
- package/dist/{chunk-nact4a4b.js → chunk-074x98ak.js} +2 -2
- package/dist/{chunk-6k4mbmg1.js → chunk-0c8fy456.js} +2 -2
- package/dist/{chunk-20mzyay7.js → chunk-0dnwqm94.js} +1 -1
- package/dist/{chunk-vk36fprb.js → chunk-0mze2qnw.js} +2 -2
- package/dist/{chunk-6acs2hzs.js → chunk-0ss92kxr.js} +2 -2
- package/dist/{chunk-3w0wbv9c.js → chunk-14r2ktqe.js} +2 -2
- package/dist/{chunk-2mkqpzzx.js → chunk-180zvfd6.js} +1 -1
- package/dist/{chunk-a6b2vhmb.js → chunk-2g8targj.js} +1 -1
- package/dist/{chunk-qpmjezsw.js → chunk-2rperg04.js} +1 -1
- package/dist/{chunk-40d5the9.js → chunk-2swp3nfs.js} +2 -2
- package/dist/{chunk-zzhwfrzb.js → chunk-3dckftt6.js} +1 -1
- package/dist/{chunk-dxnttcwd.js → chunk-3k5n3809.js} +1 -1
- package/dist/chunk-3z6rx5qv.js +4 -0
- package/dist/{chunk-pvj43sjx.js → chunk-4z4tec0p.js} +2 -2
- package/dist/{chunk-rxc15vtr.js → chunk-4zzhckab.js} +2 -2
- package/dist/{chunk-c493d8ay.js → chunk-58wt406v.js} +1 -1
- package/dist/{chunk-61944cv6.js → chunk-59j0p8hy.js} +2 -2
- package/dist/{chunk-t1j88bvm.js → chunk-65m4bm74.js} +2 -2
- package/dist/{chunk-f4a1my6v.js → chunk-6nnwmqqp.js} +2 -2
- package/dist/{chunk-jzkmsbpe.js → chunk-75zcgcqm.js} +1 -1
- package/dist/{chunk-4tff1nyj.js → chunk-7ap638hx.js} +1 -1
- package/dist/{chunk-0pv9mq6d.js → chunk-7g79m27w.js} +2 -2
- package/dist/{chunk-1aeswxaf.js → chunk-7jdjdnh6.js} +1 -1
- package/dist/{chunk-m2jsfvs2.js → chunk-7wyrcphh.js} +1 -1
- package/dist/{chunk-9zmkj0dp.js → chunk-83sz9mv9.js} +3 -3
- package/dist/{chunk-egqxz6f8.js → chunk-88cfz41t.js} +2 -2
- package/dist/{chunk-zjmqne2f.js → chunk-8bfnjqkg.js} +1 -1
- package/dist/{chunk-r4r5ythb.js → chunk-8g09jrj1.js} +2 -2
- package/dist/{chunk-7f89k828.js → chunk-8v1bjdgv.js} +1 -1
- package/dist/{chunk-m2xmz1ag.js → chunk-90wm9rxz.js} +2 -2
- package/dist/{chunk-7qrz8zq8.js → chunk-91h14q3y.js} +2 -2
- package/dist/{chunk-10j68dch.js → chunk-ahtyazfy.js} +2 -2
- package/dist/{chunk-0keppemg.js → chunk-as1cvbzm.js} +2 -2
- package/dist/{chunk-cjmjv7pv.js → chunk-bew4srqj.js} +1 -1
- package/dist/{chunk-2aqv0chk.js → chunk-bv4adcrd.js} +1 -1
- package/dist/{chunk-nbkkfyss.js → chunk-c1vavp0q.js} +1 -1
- package/dist/{chunk-n8kfbg68.js → chunk-c26vy827.js} +2 -2
- package/dist/{chunk-dyp6kjqz.js → chunk-c2bkhrcc.js} +2 -2
- package/dist/{chunk-7zrnt6zw.js → chunk-cazdmcwd.js} +2 -2
- package/dist/{chunk-zynyx32t.js → chunk-cc0tan75.js} +2 -2
- package/dist/{chunk-j3tka93v.js → chunk-d7gjvz8z.js} +2 -2
- package/dist/{chunk-7eje3z81.js → chunk-d94rmh12.js} +1 -1
- package/dist/{chunk-g5gz25jy.js → chunk-e99sdapw.js} +2 -2
- package/dist/{chunk-pzth3knm.js → chunk-ebmbz9tg.js} +1 -1
- package/dist/{chunk-qsg1c5cc.js → chunk-ftcydsbs.js} +2 -2
- package/dist/{chunk-54941m0z.js → chunk-fydcbjsx.js} +2 -2
- package/dist/{chunk-aarvddmn.js → chunk-gdpa9dp5.js} +1 -1
- package/dist/{chunk-tp1gaw68.js → chunk-gz7adphb.js} +1 -1
- package/dist/{chunk-x7jtngzd.js → chunk-gzeg6bqp.js} +2 -2
- package/dist/{chunk-25bzk1wv.js → chunk-h68f23r0.js} +1 -1
- package/dist/chunk-h99fy0g3.js +4 -0
- package/dist/{chunk-pafshe3v.js → chunk-hfaarm10.js} +2 -2
- package/dist/{chunk-5cnw6yc7.js → chunk-jdjk6tf4.js} +1 -1
- package/dist/{chunk-q4btsq6a.js → chunk-jjnmq2zj.js} +3 -3
- package/dist/{chunk-qvknvzqn.js → chunk-jp73gpbp.js} +2 -2
- package/dist/{chunk-h2gng003.js → chunk-khj3ye94.js} +3 -3
- package/dist/{chunk-r9p03chx.js → chunk-kmhwwzga.js} +1 -1
- package/dist/{chunk-z4zm74ge.js → chunk-kv0tnq8g.js} +2 -2
- package/dist/chunk-kzq1797a.js +3 -0
- package/dist/{chunk-efcpawhs.js → chunk-m4dgha79.js} +2 -2
- package/dist/{chunk-y2z94rrh.js → chunk-m9en74e3.js} +2 -2
- package/dist/{chunk-1hzdqep7.js → chunk-n0xzhjdg.js} +2 -2
- package/dist/{chunk-kq8kz0jn.js → chunk-n56csv51.js} +2 -2
- package/dist/{chunk-b9hjn4a5.js → chunk-nqv69z6n.js} +2 -2
- package/dist/{chunk-4andq00q.js → chunk-nxk65z2e.js} +2 -2
- package/dist/{chunk-cf5mxxyp.js → chunk-pw6p654f.js} +2 -2
- package/dist/{chunk-2ecx1xed.js → chunk-qca5mhqd.js} +1 -1
- package/dist/{chunk-a3x74cr0.js → chunk-qp7aywgn.js} +2 -2
- package/dist/{chunk-gkv8w3v0.js → chunk-qz8gpb9j.js} +2 -2
- package/dist/chunk-r1988zpy.js +2 -0
- package/dist/{chunk-y3567zfn.js → chunk-rf9yxbes.js} +2 -2
- package/dist/{chunk-56e8naj1.js → chunk-sespfp7t.js} +2 -2
- package/dist/{chunk-nt224frq.js → chunk-sf6ze845.js} +1 -1
- package/dist/{chunk-vzy4vwqr.js → chunk-sxgc25gz.js} +2 -2
- package/dist/{chunk-frqg34kq.js → chunk-txn8v2yc.js} +1 -1
- package/dist/{chunk-aj5fk4ez.js → chunk-vp8fb7r8.js} +1 -1
- package/dist/chunk-w1awbykg.js +2 -0
- package/dist/{chunk-4ed8as5d.js → chunk-w390ewja.js} +1 -1
- package/dist/{chunk-jkwf97cs.js → chunk-wrkwz65x.js} +2 -2
- package/dist/{chunk-p1wnt0e5.js → chunk-x1xh8y2s.js} +1 -1
- package/dist/{chunk-7jyekmy9.js → chunk-yy4tw3nj.js} +2 -2
- package/dist/{chunk-z3mp9z01.js → chunk-zb4mqy8f.js} +1 -1
- package/dist/client.d.ts +1 -0
- package/dist/client.js +1 -0
- 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.d.ts +2 -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/effort-slider.js +1 -1
- package/dist/composer/menu-radio.js +1 -1
- package/dist/composer/model-select.js +1 -1
- package/dist/composer/permission-mode-select.js +1 -1
- package/dist/composer/prompt-input-attachments.js +1 -1
- package/dist/composer/prompt-input-clipboard.js +1 -1
- package/dist/composer/prompt-input-context.js +1 -1
- package/dist/composer/prompt-input-textarea.js +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/drafts.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/mention-uri.js +1 -1
- package/dist/conversation/composer/model-menu.js +1 -1
- package/dist/conversation/composer/pasted-text-attachment.js +1 -1
- package/dist/conversation/composer/permission-mode-menu.js +1 -1
- package/dist/conversation/composer/prediction.js +1 -1
- package/dist/conversation/composer/slash-command-button.js +1 -1
- package/dist/conversation/composer/submit-button.js +1 -1
- package/dist/conversation/composer/usage-meter.js +1 -1
- package/dist/conversation/context.js +1 -1
- package/dist/conversation/conversation-body.js +1 -1
- package/dist/conversation/conversation-view.js +1 -1
- package/dist/conversation/conversation.js +1 -1
- package/dist/conversation/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/import.d.ts +1 -0
- package/dist/import.js +1 -0
- package/dist/lib/fuzzy.js +1 -1
- package/dist/lib/group-blocks.js +1 -1
- package/dist/lib/markdown-parser.js +1 -1
- package/dist/lib/markdown-rules.js +1 -1
- package/dist/lib/model-name.js +1 -1
- package/dist/lib/pointer-centered-zoom.js +1 -1
- package/dist/lib/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/literal-matches.js +1 -1
- package/dist/session-list/archived-sessions.js +1 -1
- package/dist/session-list/navigation.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-menu.js +1 -1
- package/dist/session-list/virtual-session-rows.js +1 -1
- package/dist/session-timeline/activity-group.js +1 -1
- package/dist/session-timeline/activity-projection.js +1 -1
- package/dist/session-timeline/assistant-turn.js +1 -1
- package/dist/session-timeline/async-questions.js +1 -1
- package/dist/session-timeline/edited-files-card.js +1 -1
- package/dist/session-timeline/history-timeline.js +1 -1
- package/dist/session-timeline/navigation-rail.js +1 -1
- package/dist/session-timeline/plan.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/types.d.ts +3 -0
- package/dist/session-timeline/use-timeline-scroll.js +1 -1
- package/dist/session-timeline/user-message.js +1 -1
- package/dist/stage.d.ts +12 -0
- package/dist/stage.js +1 -0
- package/dist/ui/alert.js +1 -1
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/field.js +1 -1
- package/dist/ui/input-group.js +1 -1
- package/dist/ui/select.js +1 -1
- package/dist/ui/skeleton.js +1 -1
- package/package.json +22 -13
- package/dist/chunk-4r3ch7fk.js +0 -2
- package/dist/chunk-8e3wcvkd.js +0 -4
- package/dist/chunk-e1gwprwe.js +0 -2
- package/dist/chunk-en8s7tet.js +0 -4
- package/dist/chunk-gtahrx8j.js +0 -3
- package/dist/chunk-xe52kj6h.js +0 -5
package/README.md
CHANGED
|
@@ -137,3 +137,7 @@ descendant. Expanding a child reads its existing stream; it never opens another
|
|
|
137
137
|
agent session. `ConversationView` includes this shelf automatically; custom hosts
|
|
138
138
|
should mount one `SessionActions` for the root conversation. Requires
|
|
139
139
|
`@nyssance/codex-acp-v2` 0.7.47 or later.
|
|
140
|
+
|
|
141
|
+
## Application client and adapter staging
|
|
142
|
+
|
|
143
|
+
Applications import protocol clients and session projections from `@alwith/module-chat/client`, conversation import utilities from `@alwith/module-chat/import`, and build-time `stageChatAdapter(directory, licenses)` from `@alwith/module-chat/stage`. The chat package owns the adapter dependency and resolves it relative to its own installation; applications must not declare it separately or reach into a hoisted `node_modules` path. Staging preserves the published adapter bytes and includes both license notices. Runtime remains responsible for process ownership.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{We}from"../chunk-9gv1zffv.js";import{e}from"../chunk-wpdn3rx8.js";import{fe}from"../chunk-2a3tezgr.js";import{s}from"../chunk-96x0d2vd.js";import{v}from"../chunk-kjtd3wc3.js";import{Y,A}from"../chunk-0nkvfecf.js";import{k}from"../chunk-da6d6wze.js";import{fn,
|
|
1
|
+
import{We}from"../chunk-9gv1zffv.js";import{e}from"../chunk-wpdn3rx8.js";import{fe}from"../chunk-2a3tezgr.js";import{s}from"../chunk-96x0d2vd.js";import{v}from"../chunk-kjtd3wc3.js";import{Y,A}from"../chunk-0nkvfecf.js";import{k}from"../chunk-da6d6wze.js";import{fn,It,ae,Ke}from"../chunk-88cfz41t.js";import{autoUpdate as j}from"@floating-ui/dom";import{cn as H}from"cn";import{useCallback as Q,useEffect as M,useLayoutEffect as O,useMemo as _,useRef as G,useState as R}from"react";import{createPortal as V}from"react-dom";import{jsx as o,jsxs as m}from"react/jsx-runtime";var c="__other__";function le({current:a,total:F,anchorRef:N,t:p,onAccept:I,onDecline:L}){let x=_(()=>a?fn(a.requestedSchema):[],[a]),[S,b]=R({}),T=G(null);M(()=>{if(a?.elicitationId===void 0)return;let t={};for(let{key:l,property:n}of x)if(!ae(n)){let u=Ke(n)[0];if(u)t[l]={selected:u.value}}b(t)},[a?.elicitationId,x]),M(()=>{if(a?.elicitationId!==void 0&&T.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")T.current.focus()},[a?.elicitationId]);let[y,q]=R(null),[C,z]=R(null),E=Q(()=>{let t=N.current;if(!t)return;let l=t.getBoundingClientRect();if(l.width===0){let n=Math.min(640,window.innerWidth*0.9);q({left:(window.innerWidth-n)/2,width:n,bottom:24});return}q({left:l.left,width:l.width,bottom:window.innerHeight-l.bottom+20})},[N]);O(()=>{if(!a)return;let t=0,l=()=>{if(N.current){E();return}t=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(t)},[a,E,N]),O(()=>{let t=N.current;if(!a||!t||!C)return;return j(t,C,E,{animationFrame:!0})},[a,C,N,E]);let U=_(()=>{if(!a)return!1;for(let{key:t,property:l}of x){let n=S[t];if(!n)return!1;if(ae(l)){if(!n.selectedSet||n.selectedSet.size===0)return!1;if(n.selectedSet.has(c)&&!n.otherText?.trim())return!1}else{if(!n.selected)return!1;if(n.selected===c&&!n.otherText?.trim())return!1}}return!0},[a,x,S]),D=Q(async()=>{if(!a)return;if(!U)return;let t={},l={};for(let{key:n,property:u}of x){let d=S[n];if(!d)continue;let g;if(ae(u))t[n]=[...d.selectedSet??[]].map((f)=>f===c?(d.otherText??"").trim():f).filter(Boolean);else{let f=d.selected??"";if(t[n]=f===c?(d.otherText??"").trim():f,f!==c)g=Ke(u).find((i)=>i.value===f)?.preview}let h=d.notes?.trim();if(g||h)l[n]={...g&&{preview:g},...h&&{notes:h}}}await I(a.elicitationId,t,l)},[a,x,S,U,I]),B=Q(async()=>{if(a)await L(a.elicitationId)},[a,L]);if(!a||!y)return null;return V(m("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(t)=>{if(t.key==="Escape")t.preventDefault(),B()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left:y.left,width:y.width,bottom:y.bottom,maxHeight:"70vh"},ref:(t)=>{T.current=t,z(t)},children:[m("div",{className:"border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",children:[o("div",{className:"text-foreground text-sm font-medium",children:p("askUserQuestion.title")}),F>1&&o("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${F}`})]}),o("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o("div",{className:"space-y-4 px-3 py-3",children:x.map(({key:t,property:l},n)=>{let u=S[t],d=u?.selected,g=u?.selectedSet??new Set,h=Ke(l),f=ae(l);return m("div",{className:"space-y-2",children:[m("div",{className:"flex items-center gap-2",children:[o(We,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:It(l).title??t}),o("div",{className:"text-foreground text-sm font-medium",children:It(l).description})]}),f?m("div",{className:"space-y-1.5 ps-1",children:[h.map((i)=>m("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[o(fe,{checked:g.has(i.value),onCheckedChange:(r)=>{b((w)=>{let P=new Set(w[t]?.selectedSet??new Set);if(r)P.add(i.value);else P.delete(i.value);return{...w,[t]:{...w[t],selectedSet:P}}})}}),m("div",{className:"min-w-0 flex-1",children:[o("div",{className:"text-foreground text-sm",children:i.label}),i.description&&o("div",{className:"text-muted-foreground text-xs",children:i.description})]})]},i.value)),m("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[o(fe,{checked:g.has(c),onCheckedChange:(i)=>{b((r)=>{let w=new Set(r[t]?.selectedSet??new Set);if(i)w.add(c);else w.delete(c);return{...r,[t]:{...r[t],selectedSet:w}}})}}),o("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:p("askUserQuestion.other")})]}),g.has(c)&&o("div",{className:"ps-7",children:o(s,{placeholder:p("askUserQuestion.otherPlaceholder"),value:u?.otherText??"",onChange:(i)=>b((r)=>({...r,[t]:{...r[t],otherText:i.target.value}}))})})]}):m(Y,{value:d??"",onValueChange:(i)=>b((r)=>({...r,[t]:{...r[t],selected:i}})),className:"space-y-1.5 ps-1",children:[h.map((i)=>{let r=`${n}:${i.value}`;return m("div",{className:H("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",d===i.value&&"bg-muted/60"),children:[o(A,{value:i.value,id:r}),m(v,{htmlFor:r,className:"min-w-0 flex-1 cursor-pointer",children:[o("div",{className:"text-foreground text-sm font-normal",children:i.label}),i.description&&o("div",{className:"text-muted-foreground text-xs font-normal",children:i.description})]})]},i.value)}),m("div",{className:H("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",d===c&&"bg-muted/60"),children:[o(A,{value:c,id:`${n}:other`,className:"mt-0.5"}),o(v,{htmlFor:`${n}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:p("askUserQuestion.other")})]}),d===c&&o("div",{className:"ps-7",children:o(s,{placeholder:p("askUserQuestion.otherPlaceholder"),value:u?.otherText??"",onChange:(i)=>b((r)=>({...r,[t]:{...r[t],otherText:i.target.value}}))})})]}),!f&&d&&d!==c&&(()=>{let i=h.find((r)=>r.value===d)?.preview;if(!i)return null;return o("pre",{className:"bg-muted/50 text-muted-foreground ms-1 mt-1 overflow-auto rounded-sm px-2 py-1.5 font-mono text-[11px] whitespace-pre-wrap",children:i})})(),h.some((i)=>i.preview)&&o(k,{placeholder:p("askUserQuestion.notesPlaceholder"),value:u?.notes??"",onChange:(i)=>b((r)=>({...r,[t]:{...r[t],notes:i.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"})]},t)})})}),m("div",{className:"border-border bg-card flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2",children:[o(e,{variant:"ghost",size:"sm",onClick:()=>void B(),children:p("askUserQuestion.cancel")}),o(e,{size:"sm",disabled:!U,onClick:()=>void D(),children:p("askUserQuestion.submit")})]})]}),document.body)}export{le as ChoiceElicitationForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fn,
|
|
1
|
+
import{fn,It,ae,Ke}from"../chunk-88cfz41t.js";export{fn as elicitationFields,It as elicitationLabels,Ke as elicitationOptions,ae as isMultiSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{yr,eo,mi,pi}from"../chunk-r1988zpy.js";export{yr as PERMISSION_KIND_GROUP_ORDER,mi as isAllowKind,pi as isAlwaysKind,eo as sortPermissionOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Jn}from"../chunk-
|
|
1
|
+
import{Jn}from"../chunk-2g8targj.js";import"../chunk-r1988zpy.js";export{Jn as PermissionView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ar,
|
|
1
|
+
import{Ar,br,Lr,to}from"../chunk-gzeg6bqp.js";import"../chunk-2a3tezgr.js";import"../chunk-58wt406v.js";import"../chunk-1fm5vx1n.js";import"../chunk-n5xqjct2.js";import"../chunk-4s1rhts0.js";import"../chunk-96x0d2vd.js";import"../chunk-0nkvfecf.js";import"../chunk-kjtd3wc3.js";import"../chunk-da6d6wze.js";import"../chunk-wpdn3rx8.js";export{to as SchemaElicitationForm,Ar as elicitationFields,br as initialValues,Lr as isAnswered};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{no}from"../chunk-90wm9rxz.js";import"../chunk-mr1azhef.js";import"../chunk-wpdn3rx8.js";export{no as UrlElicitationCard};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{en}from"./chunk-kzq1797a.js";import{t}from"./chunk-q6km9nha.js";import{isDiffEntry as p}from"@nyssance/codex-acp-v2/client";import{jsx as c,jsxs as g,Fragment as h}from"react/jsx-runtime";function zr(o,s){let e=o.split(/^(?=diff --git )/m).filter((i)=>i.length>0);if(e.length<=1)return o;return e.find((i)=>{let a=i.split(`
|
|
2
|
+
`,1)[0]??"";return a.endsWith(` b/${s}`)||a.endsWith(` ${s}`)||a.includes(`/${s} `)})??o}function Ur(o){let s=new Map,e=null;for(let n of o.split(`
|
|
3
|
+
`)){if(n.startsWith("diff --git ")){e=null;continue}if(n.startsWith("+++ ")){let i=n.slice(4).trim(),a=i==="/dev/null"?null:i.replace(/^b\//,"");if(a!==null)e={additions:0,deletions:0},s.set(a,e);continue}if(n.startsWith("--- ")){let i=n.slice(4).trim();if(i!=="/dev/null"&&e===null)e={additions:0,deletions:0},s.set(i.replace(/^a\//,""),e);continue}if(e===null)continue;if(n.startsWith("+"))e.additions+=1;else if(n.startsWith("-"))e.deletions+=1}return s}function u(o,s){let e=s.replaceAll("\\","/");for(let[n,i]of o)if(e===n||e.endsWith(`/${n}`))return i;return{additions:0,deletions:0}}function $r(o){let s=new Map;for(let e of o)for(let n of e.content){if(!p(n))continue;let i=n.patch?Ur(n.patch.text):new Map;for(let a of n.changes){let r=typeof a.path==="string"?a.path:null;if(r===null)continue;let d=u(i,r),f=n.patch?zr(n.patch.text,r):"",l=s.get(r);if(l)l.additions+=d.additions,l.deletions+=d.deletions,l.patch=l.patch?`${l.patch}
|
|
4
|
+
${f}`:f;else s.set(r,{path:r,patch:f,...d})}}return[...s.values()]}function zo({items:o}){let s=t(),{openDiff:e,FileIcon:n}=s;return c(en,{files:$r(o),actions:s.EditedFilesActions?c(s.EditedFilesActions,{items:o}):void 0,onOpen:e===void 0?void 0:(i)=>e({path:i.path,patch:i.patch}),renderPath:n===void 0?void 0:(i)=>g(h,{children:[c(n,{path:i.path,className:"codex-edited-file-icon"}),c("span",{className:"codex-edited-file-name",children:i.path})]})})}
|
|
5
|
+
export{zr,Ur,$r,zo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Wo}from"./chunk-fydcbjsx.js";function Vo(t,o){if(Wo(o))return y(t);return t.map((e)=>({kind:"block",block:e}))}function i(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"||t.type==="collab"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function y(t){let o=[],e=[],r=()=>{if(e.length===0)return;o.push({kind:"codexActivityGroup",blocks:e}),e=[]};for(let n of t){if(i(n)&&c(n)){e.push(n);continue}if(r(),i(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return r(),o}
|
|
2
|
+
export{Vo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-wpdn3rx8.js";import{Nn}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{e}from"./chunk-wpdn3rx8.js";import{Nn}from"./chunk-gz7adphb.js";import{Pe,Ne,Me}from"./chunk-6wqbetcx.js";import{y}from"./chunk-cazdmcwd.js";import{cn as f}from"cn";import{PaperclipIcon as k,XIcon as T}from"lucide-react";import{Fragment as M,useEffect as L,useRef as z,useState as N}from"react";import{jsx as t,jsxs as o,Fragment as R}from"react/jsx-runtime";function E(n){return t(Me,{align:"start",...n})}function In({data:n,t:r,className:u,...c}){let p=y(),[d,h]=N(!1),[I,v]=N(1),C=z(null),s=n.filename||"",i=(n.mediaType?.startsWith("image/")&&n.url?"image":"file")==="image",A=s||(i?r("input.image"):r("input.attachment"));return L(()=>{if(!d)return;let l=0.1,g=(a)=>Math.min(10,Math.max(0.1,a)),x=(a)=>{if(!(a.ctrlKey||a.metaKey))return;let m=a.key,w=m==="+"||m==="=",H=m==="-"||m==="_",b=m==="0";if(!w&&!H&&!b)return;a.preventDefault(),v((P)=>{if(b)return 1;if(w)return g(P+l);return g(P-l)})};return window.addEventListener("keydown",x,{passive:!1}),()=>window.removeEventListener("keydown",x)},[d]),o(R,{children:[o(Pe,{children:[t(Ne,{render:o("div",{className:f("group border-border hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent relative flex h-8 cursor-pointer items-center gap-1.5 rounded-md border px-1.5 text-sm font-medium transition-all select-none",u),...c,children:[o("div",{className:"relative size-5 shrink-0",children:[i?t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":r("input.image"),className:"bg-background absolute inset-0 size-5 overflow-hidden rounded p-0 transition-opacity group-hover:opacity-0",onClick:()=>{v(1),h(!0)},children:t("img",{alt:s||"attachment",className:"size-5 object-cover",height:20,src:n.url,width:20})}):t("div",{className:"bg-background text-muted-foreground absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded transition-opacity group-hover:opacity-0",children:t(k,{className:"size-3"})}),o(e,{"aria-label":r("input.removeAttachment"),className:f("absolute -top-1 -right-1 size-4 rounded-full p-0 opacity-0 transition-opacity [&>svg]:size-3","pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100"),onClick:(l)=>{l.stopPropagation(),p.remove(n.id)},type:"button",variant:"ghost",children:[t(T,{}),t("span",{className:"sr-only",children:r("input.removeAttachment")})]})]}),!i&&t("span",{className:"max-w-40 flex-1 truncate text-xs",children:A})]})}),t(E,{className:"w-auto p-2",children:o("div",{className:"w-auto space-y-3",children:[i&&t("div",{className:"flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border",children:t("img",{alt:s||"attachment preview",className:"max-h-full max-w-full object-contain",height:384,src:n.url,width:448})}),t("div",{className:"flex items-center gap-2.5",children:o("div",{className:"min-w-0 flex-1 space-y-1 px-0.5",children:[t("h4",{className:"truncate text-sm leading-none font-semibold",children:s||(i?"Image":"Attachment")}),n.mediaType&&t("p",{className:"text-muted-foreground truncate font-mono text-xs",children:n.mediaType})]})})]})})]}),i&&n.url&&t(Nn,{containerRef:C,filename:s||r("input.image"),onOpenChange:h,onScaleChange:v,open:d,scale:I,url:n.url})]})}function Pn({children:n,className:r,...u}){let c=y();if(!c.files.length)return null;return t("div",{className:f("flex w-full flex-wrap items-center gap-1",r),...u,children:c.files.map((p)=>t(M,{children:n(p)},p.id))})}
|
|
2
|
+
export{In,Pn};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ko}from"./chunk-0mze2qnw.js";import{t}from"./chunk-q6km9nha.js";import{To,So}from"./chunk-1wpdb17m.js";import{B}from"./chunk-y6afvrnv.js";import{Q}from"./chunk-e99sdapw.js";import{isEmbeddedResource as g,isImage as d,isResourceLink as f,isText as x}from"@nyssance/codex-acp-v2/client";import{memo as p}from"react";import{jsx as r,jsxs as h}from"react/jsx-runtime";var Co=p(function({item:s,messageTime:c}){let l=t(),o=So(s._meta),m=o?o.map((e)=>e.question===void 0?e.text:`${e.question}
|
|
2
2
|
${e.text}`).join(`
|
|
3
|
-
`):Q(s),a=s.content.filter(d),i=s.content.filter((e)=>f(e)||g(e)),u=o??s.content.filter(x).map((e)=>{let n=To(e._meta);return n?{question:n.question,text:n.answer}:{text:e.text}});if(m.length===0&&a.length===0&&i.length===0)return null;return h("div",{className:"group/codex-user flex min-w-0 flex-col items-end gap-2","data-content-search-unit-key":s.id,children:[i.length>0&&r("div",{className:"codex-user-mentions",children:i.map((e,n)=>r(B,{block:e},`${s.id}:${n}`))}),r(
|
|
3
|
+
`):Q(s),a=s.content.filter(d),i=s.content.filter((e)=>f(e)||g(e)),u=o??s.content.filter(x).map((e)=>{let n=To(e._meta);return n?{question:n.question,text:n.answer}:{text:e.text}});if(m.length===0&&a.length===0&&i.length===0)return null;return h("div",{className:"group/codex-user flex min-w-0 flex-col items-end gap-2","data-content-search-unit-key":s.id,children:[i.length>0&&r("div",{className:"codex-user-mentions",children:i.map((e,n)=>r(B,{block:e},`${s.id}:${n}`))}),r(Ko,{host:l,message:s,text:m,textParts:u.some((e)=>("question"in e))?u:void 0,images:a,mentions:[],messageTime:c})]})});
|
|
4
4
|
export{Co};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n}from"./chunk-q6km9nha.js";import{o}from"./chunk-
|
|
1
|
+
import{n}from"./chunk-q6km9nha.js";import{o}from"./chunk-0ss92kxr.js";import{codexExtensionCapabilities as T,codexTurnId as w,composerPrediction as j,isBooleanOption as B,isSelectOption as F}from"@nyssance/codex-acp-v2/client";import{useEffect as b,useRef as C,useState as P}from"react";function mt(t,g,c,y){let{client:S}=o(),R=n((e)=>T(e.agent).composerPredictions),k=t.items.findLast((e)=>e.kind==="user"),i=w(k?._meta),O=t.configOptions.flatMap((e)=>F(e)||B(e)?[[e.configId,e.currentValue]]:[]).sort(([e],[u])=>String(e).localeCompare(String(u))),r=JSON.stringify([t.id,i,O]),s=j(t._meta),d=t._meta?.codex,m=typeof d==="object"&&d!==null&&"prediction"in d?d.prediction:null,l=C(null),f=C(!1);b(()=>(f.current=!0,()=>{f.current=!1}),[]);let[a,_]=P(null),[v,x]=P(null),p=y&&R&&g&&t.state==="idle"&&t.lastStopReason==="end_turn"&&!k?.replayed&&i!==null;b(()=>{if(!p||c||a===r||l.current?.key===r||i===null)return;let e={key:r,previousResult:m};l.current=e,x(null),S.requestPrediction(t.id,i).catch((u)=>{if(f.current&&l.current===e)x({key:r,message:u instanceof Error?u.message:String(u)})})},[S,p,c,a,r,m,t.id,i]);let I=p&&!c&&a!==r&&l.current?.key===r&&l.current.previousResult!==m&&s?.sourceTurnId===i,q=I&&s.result.type==="completed"?s.result.text:null,E=y&&g&&t.state==="idle"&&!c&&a!==r?v?.key===r?v.message:I&&s.result.type==="failed"?"Prediction failed":null:null;return{text:q,error:E,invalidate:()=>{if(p)_(r)}}}
|
|
2
2
|
export{mt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Qo}from"./chunk-qp7aywgn.js";import{CheckIcon as N,ChevronDownIcon as E,CopyIcon as T,FileIcon as w}from"lucide-react";import{useEffect as k,useLayoutEffect as H,useRef as I,useState as f}from"react";import{jsx as e,jsxs as p,Fragment as h}from"react/jsx-runtime";var A=20,L='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function y(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function R(n,o){let s=n.getBoundingClientRect(),a=o.getBoundingClientRect();return s.top>=a.top&&s.right<=a.right&&s.bottom<=a.bottom&&s.left>=a.left}function M({text:n,host:o}){let{t:s,Markdown:a}=o,c=I(null),[l,u]=f(!1),[d,x]=f(!1);return H(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=()=>{if(r.scrollHeight===0){u(!1);return}let b=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(b))throw Error("Codex user message line height is invalid");u(r.scrollHeight>A*b+1)};t();let m=new ResizeObserver(t);return m.observe(r),()=>m.disconnect()},[]),k(()=>{if(!l||d)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=new Map,m=typeof IntersectionObserver>"u"?null:new IntersectionObserver((i)=>{for(let g of i){let v=g.target;if(!t.has(v))continue;y(v,g.isIntersecting&&g.intersectionRatio>=1,t.get(v))}},{root:r,rootMargin:"0px",threshold:1}),b=()=>{for(let i of t.keys()){if(r.contains(i))continue;m?.unobserve(i),t.delete(i)}for(let i of r.querySelectorAll(L)){if(t.has(i)||i.hasAttribute("inert"))continue;let g=i.getAttribute("aria-hidden");t.set(i,g),y(i,m===null&&R(i,r),g),m?.observe(i)}};b();let C=new MutationObserver(b);return C.observe(r,{childList:!0,subtree:!0}),()=>{m?.disconnect(),C.disconnect();for(let[i,g]of t)y(i,!0,g)}},[l,d]),p("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:l&&!d?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(a,{text:n,streaming:!1})}),l&&!d&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),l&&p("button",{type:"button","aria-expanded":d,className:"codex-user-message-collapse-trigger",onClick:()=>{x((r)=>!r)},children:[e("span",{children:d?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(E,{className:d?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function on({text:n,label:o,host:s}){let[a,c]=f(!1),[l,u]=f(null),d=async()=>{c(!1),u(null);try{await(s?.copyText?s.copyText(n):navigator.clipboard.writeText(n)),c(!0),setTimeout(()=>c(!1),2000)}catch(x){u(String(x)),s?.onCopyError?.(x)}};return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:l??o,onClick:()=>void d(),children:a?e(N,{className:"codex-message-action-confirmed"}):e(T,{})})}function S({image:n,openImage:o}){let[s,a]=f(!1),c=`data:${n.mimeType};base64,${n.data}`;return p(h,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?a(!0):o(c),children:e("img",{src:c,alt:""})}),s&&e(Qo,{src:c,alt:"",onClose:()=>a(!1)})]})}function Ko({message:n,text:o,textParts:s,mentions:a,images:c,messageTime:l,host:u,bubbleStyle:d}){let{t:x,openImage:r}=u;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:p("div",{className:"group/codex-user codex-user-message-group",children:[a.length>0&&e("div",{className:"codex-user-mentions",children:a.map((t)=>p("span",{className:"codex-user-mention",title:t.title,children:[e(w,{"aria-hidden":"true"}),e("span",{className:"codex-user-mention-label",children:t.label})]},t.key))}),c.length>0&&e("div",{className:"codex-user-images",children:c.map((t)=>e(S,{image:t,openImage:r},`${t.mimeType}:${t.data}`))}),o.length>0&&e(h,{children:e("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:d,children:s?s.map((t,m)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(M,{text:t.text,host:u}):p(h,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question}),e("div",{className:"codex-user-question-answer",children:t.text})]})},m)):e(M,{text:o,host:u})})}),p("div",{className:"codex-user-actions",children:[e(on,{text:o,label:x("actions.copy"),host:u}),l&&e("span",{className:"codex-user-time",title:l.full,children:l.short})]})]})})}
|
|
2
|
+
export{on,Ko};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{re}from"./chunk-q6km9nha.js";import{createContext as v,useContext as a,useMemo as l}from"react";import{jsx as r}from"react/jsx-runtime";var i=v(null);function
|
|
2
|
-
export{
|
|
1
|
+
import{re}from"./chunk-q6km9nha.js";import{createContext as v,useContext as a,useMemo as l}from"react";import{jsx as r}from"react/jsx-runtime";var i=v(null);function yt({host:n,client:e,children:t}){let s=l(()=>({host:n,client:e}),[n,e]);return r(re,{host:n,client:e,children:r(i,{value:s,children:t})})}function o(){let n=a(i);if(n===null)throw Error("Conversation host is missing");return n}function C(n,e){e.catch((t)=>{if(n.reportError)n.reportError(t);else console.error(t)})}
|
|
2
|
+
export{yt,o,C};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{V,W}from"./chunk-
|
|
2
|
-
`));else y(null)}finally{S.current=!1,j(!1)}}return a("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":n("sessionList.archives.title"),children:[a("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[a("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[i("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:n("sessionList.archives.title")}),a(e,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:E||N.length===0,onClick:()=>{T(null),M(!0),y([...N])},children:[i(ee,{className:"size-4","aria-hidden":"true"}),n("sessionList.archives.deleteAll")]})]}),a("div",{className:"flex shrink-0 flex-wrap gap-3",children:[a("div",{className:"relative min-w-48 flex-1",children:[i(xe,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),i(s,{"aria-label":n("sessionList.archives.search"),placeholder:n("sessionList.archives.search"),value:O,onChange:(t)=>ie(t.target.value),className:"rounded-md ps-9"})]}),a(
|
|
1
|
+
import{V,W}from"./chunk-jdjk6tf4.js";import{e}from"./chunk-wpdn3rx8.js";import{u,m,b,K,p,w}from"./chunk-n5xqjct2.js";import{s}from"./chunk-96x0d2vd.js";import{Mt,Rt,Et,hn,Z}from"./chunk-gdpa9dp5.js";import{le}from"./chunk-pv35kspb.js";import{g,l,r}from"./chunk-da4m33bg.js";import{se,z,D}from"./chunk-x8kxqtva.js";import{sessionGroup as F}from"@nyssance/codex-acp-v2/client";import{cn as fe}from"cn";import{ArchiveIcon as ve,FolderIcon as Y,ListFilterIcon as ge,SearchIcon as xe,Trash2Icon as ee}from"lucide-react";import{useEffect as Se,useRef as ye,useState as h}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";function te({className:f,...n}){return i(hn,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...n,className:fe("max-w-(--available-width) min-w-0 p-1",f)})}function H(f){return f instanceof Error?f.message:String(f)}function Le({children:f}){return i("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i("div",{className:"flex flex-col gap-8",children:f})})}function dr({Scroll:f=Le}){let{t:n,i18n:B}=g(),v=l(),N=r((t)=>t.archivedSessions),A=r((t)=>t.connection),[O,ie]=h(""),[C,ne]=h("all"),[x,ae]=h("all"),[re,oe]=h(0),[G,Q]=h(!0),[q,U]=h(null),[_,R]=h(null),[I,j]=h(!1),S=ye(!1),[P,y]=h(null),[J,T]=h(null),[ce,M]=h(!1);Se(()=>{if(A!=="ready")return;let t=!1;Q(!0),U(null);async function d(){try{await v.listArchived({reset:!0});let o=new Set;while(!t&&v.state.archivedCursor!==null){let L=v.state.archivedCursor;if(o.has(L))throw Error("Archive pagination returned a repeated cursor");o.add(L),await v.listArchived()}}catch(o){if(!t)U(H(o))}finally{if(!t)Q(!1)}}return d(),()=>{t=!0}},[v,A,re]);let c=r((t)=>t.projectContext),E=!(c!==null&&A==="ready"&&!G&&q===null)||I,k=(t)=>t.title??n("sessionList.untitled"),de=[...new Set(N.filter((t)=>c&&F(c,t).id!==D).map((t)=>c?F(c,t).id:t.cwd))].toSorted(),ue=O.trim().toLocaleLowerCase(B.language),X=N.filter((t)=>{let d=c?F(c,t).id:null,o=d===D;return k(t).toLocaleLowerCase(B.language).includes(ue)&&(C==="all"||(C==="quick"?o:!o))&&(x==="all"||(x==="quick"?o:d===x))}),me=new Intl.DateTimeFormat(B.language,{dateStyle:"medium",timeStyle:"short"});async function pe(t){if(S.current)return;S.current=!0,j(!0),R(null);try{await v.unarchive(t.sessionId)}catch(d){R(H(d))}finally{S.current=!1,j(!1)}}async function he(){if(S.current||!P)return;S.current=!0,j(!0),T(null);let t=[],d=[];try{for(let o of P){if(!v.state.archivedSessions.some((L)=>L.sessionId===o.sessionId))continue;try{await v.delete(o.sessionId)}catch(L){t.push(o),d.push(`${k(o)}: ${H(L)}`)}}if(t.length)y(t),T(d.join(`
|
|
2
|
+
`));else y(null)}finally{S.current=!1,j(!1)}}return a("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":n("sessionList.archives.title"),children:[a("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[a("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[i("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:n("sessionList.archives.title")}),a(e,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:E||N.length===0,onClick:()=>{T(null),M(!0),y([...N])},children:[i(ee,{className:"size-4","aria-hidden":"true"}),n("sessionList.archives.deleteAll")]})]}),a("div",{className:"flex shrink-0 flex-wrap gap-3",children:[a("div",{className:"relative min-w-48 flex-1",children:[i(xe,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),i(s,{"aria-label":n("sessionList.archives.search"),placeholder:n("sessionList.archives.search"),value:O,onChange:(t)=>ie(t.target.value),className:"rounded-md ps-9"})]}),a(Mt,{value:C,onValueChange:(t)=>{if(t===null)throw Error("Archive chat type cannot be empty");ne(t)},children:[a(Et,{"aria-label":n("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[i(ge,{"aria-hidden":"true"}),i(Rt,{children:n(`sessionList.archives.${C==="all"?"allChats":C==="quick"?"quickChats":"projectChats"}`)})]}),a(te,{children:[i(Z,{value:"all",children:n("sessionList.archives.allChats")}),i(Z,{value:"quick",children:n("sessionList.archives.quickChats")}),i(Z,{value:"project",children:n("sessionList.archives.projectChats")})]})]}),a(Mt,{value:x,onValueChange:(t)=>{if(t===null)throw Error("Archive project filter cannot be empty");ae(t)},children:[a(Et,{"aria-label":n("sessionList.archives.project"),className:"w-48 rounded-md",children:[i(Y,{"aria-hidden":"true"}),i(Rt,{className:"truncate",children:x==="all"?n("sessionList.archives.allProjects"):x==="quick"?n("sessionList.archives.noProject"):z(x,c??void 0)})]}),a(te,{children:[i(Z,{value:"all",children:n("sessionList.archives.allProjects")}),i(Z,{value:"quick",children:n("sessionList.archives.noProject")}),de.map((t)=>i(Z,{value:t,title:t,children:z(t,c??void 0)},t))]})]})]}),a(f,{children:[A!=="ready"?i("p",{role:"status",className:"text-muted-foreground",children:n("sessionList.archives.connecting")}):G?a("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[i(le,{}),n("sessionList.archives.loading")]}):q?i(V,{variant:"destructive",children:a(W,{className:"flex items-center justify-between gap-4",children:[i("span",{children:q}),i(e,{variant:"outline",onClick:()=>oe((t)=>t+1),children:n("sessionList.archives.retry")})]})}):N.length===0?a("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[i(ve,{"aria-hidden":"true",className:"size-8"}),i("p",{children:n("sessionList.archives.empty")})]}):X.length===0?i("p",{className:"text-muted-foreground py-12 text-center",children:n("sessionList.archives.noResults")}):(c?se(X,c):[]).filter(([,t])=>t.length>0).map(([t,d])=>a("section",{className:"flex flex-col gap-3",children:[a("div",{className:"flex items-center justify-between gap-3",children:[a("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:t===D?void 0:t,children:[i(Y,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("span",{className:"truncate",children:t===D?n("sessionList.archives.noProject"):z(t,c??void 0)})]}),i("span",{className:"text-muted-foreground shrink-0 text-sm",children:n("sessionList.archives.count",{count:d.length})})]}),i("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:d.map((o)=>a("article",{"aria-label":k(o),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[a("div",{className:"min-w-0 flex-1 basis-40",children:[i("h3",{className:"truncate text-sm font-medium",title:k(o),children:k(o)}),o.updatedAt!==null&&i("time",{dateTime:o.updatedAt,title:n("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:me.format(new Date(o.updatedAt))})]}),a("div",{className:"flex shrink-0 items-center gap-2",children:[i(e,{variant:"ghost",size:"icon-sm","aria-label":n("sessionList.delete"),title:n("sessionList.delete"),disabled:E,className:"text-muted-foreground hover:text-destructive",onClick:()=>{T(null),M(!1),y([o])},children:i(ee,{"aria-hidden":"true"})}),i(e,{variant:"secondary",size:"sm",disabled:E,onClick:()=>void pe(o),children:n("sessionList.archives.unarchive")})]})]},o.sessionId))})]},t)),_&&i(V,{variant:"destructive",children:i(W,{children:_})})]})]}),i(u,{open:P!==null,onOpenChange:(t)=>{if(!t&&!S.current)y(null)},children:a(m,{showCloseButton:!I,children:[a(b,{children:[i(p,{children:n("sessionList.archives.deleteTitle")}),i(w,{children:n(ce?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:P?.length??0})})]}),J&&i(V,{variant:"destructive",children:i(W,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:J})}),a(K,{children:[i(e,{variant:"outline",disabled:I,onClick:()=>y(null),children:n("sessionList.cancel")}),a(e,{variant:"destructive",className:"text-sm font-normal",disabled:E,onClick:()=>void he(),children:[I&&i(le,{}),n("sessionList.archives.confirmDelete")]})]})]})})]})}
|
|
3
3
|
export{dr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n}from"./chunk-q6km9nha.js";import{o}from"./chunk-
|
|
1
|
+
import{n}from"./chunk-q6km9nha.js";import{o}from"./chunk-0ss92kxr.js";import{ge,Oe,ft}from"./chunk-83sz9mv9.js";import{Fe}from"./chunk-sxgc25gz.js";import{inSessionTree as d}from"@nyssance/codex-acp-v2/client";import{jsx as t,jsxs as c,Fragment as p}from"react/jsx-runtime";var u=[];function at({sessionId:e}){let l=n((s)=>s.sessions),{host:f}=o(),a=n((s)=>s.actions),r=a.some((s)=>d(l,e,s.sessionId))?a.filter((s)=>d(l,e,s.sessionId)):u,i=r.filter(ge),m=r.filter((s)=>!ge(s));return c(p,{children:[t("div",{className:"mx-auto max-h-[50vh] w-full max-w-3xl shrink-0 overflow-y-auto px-3","data-subagent-shelf":!0,children:t(Fe,{sessionId:e})}),m.length>0&&t("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-3 px-6 pb-3","data-session-actions":!0,children:m.map((s)=>c("div",{children:[s.sessionId!==e&&t("p",{className:"text-muted-foreground mb-1 truncate text-xs",children:s.sessionId===null?"":l[s.sessionId]?.title??f.t("subagents.untitled")}),t(ft,{action:s})]},s.id))}),i[0]!==void 0&&t(Oe,{action:i[0],total:i.length},i[0].id)]})}
|
|
2
2
|
export{at};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{eo}from"./chunk-r1988zpy.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=eo(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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"./chunk-wpdn3rx8.js";import{s}from"./chunk-96x0d2vd.js";import{k}from"./chunk-da6d6wze.js";import{cva as u}from"class-variance-authority";import{cn as n}from"cn";import{jsx as r}from"react/jsx-runtime";function Xn({className:a,...t}){return r("div",{"data-slot":"input-group",role:"group",className:n("group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pe-1.5 has-[>[data-align=inline-start]]:[&>input]:ps-1.5",a),...t})}var d=u("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first ps-2 has-[>button]:-ms-1 has-[>kbd]:ms-[-0.15rem]","inline-end":"order-last pe-2 has-[>button]:-me-1 has-[>kbd]:me-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function
|
|
1
|
+
import{e}from"./chunk-wpdn3rx8.js";import{s}from"./chunk-96x0d2vd.js";import{k}from"./chunk-da6d6wze.js";import{cva as u}from"class-variance-authority";import{cn as n}from"cn";import{jsx as r}from"react/jsx-runtime";function Xn({className:a,...t}){return r("div",{"data-slot":"input-group",role:"group",className:n("group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pe-1.5 has-[>[data-align=inline-start]]:[&>input]:ps-1.5",a),...t})}var d=u("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first ps-2 has-[>button]:-ms-1 has-[>kbd]:ms-[-0.15rem]","inline-end":"order-last pe-2 has-[>button]:-me-1 has-[>kbd]:me-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function Ut({className:a,align:t="inline-start",...i}){return r("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:n(d({align:t}),a),onClick:(o)=>{if(o.target.closest("button"))return;o.currentTarget.parentElement?.querySelector("input")?.focus()},...i})}var l=u("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function $t({className:a,type:t="button",variant:i="ghost",size:o="xs",...p}){return r(e,{type:t,"data-size":o,variant:i,className:n(l({size:o}),a),...p})}function ai({className:a,...t}){return r("span",{className:n("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",a),...t})}function si({className:a,...t}){return r(s,{"data-slot":"input-group-control",className:n("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",a),...t})}function Yn({className:a,...t}){return r(k,{"data-slot":"input-group-control",className:n("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",a),...t})}export{Xn,Ut,$t,ai,si,Yn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var i=new Map,a=new Map,f=new Map;function sr(t,r){if(a.has(t))throw Error("An attachment writer is already registered for this session");return a.set(t,r),()=>{if(a.get(t)===r)a.delete(t)}}function L(t,r){let n=i.get(t);if(!n)return;let e=r(n.attachments);i.set(t,{...n,attachments:e}),a.get(t)?.(e)}function
|
|
2
|
-
export{i,sr,L,
|
|
1
|
+
var i=new Map,a=new Map,f=new Map;function sr(t,r){if(a.has(t))throw Error("An attachment writer is already registered for this session");return a.set(t,r),()=>{if(a.get(t)===r)a.delete(t)}}function L(t,r){let n=i.get(t);if(!n)return;let e=r(n.attachments);i.set(t,{...n,attachments:e}),a.get(t)?.(e)}function bt(t,r){f.set(t,r),r.finally(()=>{if(f.get(t)===r)f.delete(t)})}async function Tr(t){for(;;){let e=i.get(t)?.attachments.flatMap((c)=>{let m=f.get(c.id);return m?[m]:[]})??[];if(!e.length)break;await Promise.all(e)}let r=i.get(t);if(!r)return null;let n=await Promise.all(r.attachments.map(async(e)=>{if(!e.url.startsWith("blob:"))return e;let c=await fetch(e.url);if(!c.ok)throw Error("Cannot read draft image");let m=await c.blob(),l=await new Promise((g,p)=>{let o=new FileReader;o.onload=()=>g(o.result),o.onerror=()=>p(o.error),o.readAsDataURL(m)});return{...e,url:l}}));return{text:r.text,mentions:[...r.mentions],attachments:n,modelId:r.modelId}}function Sr(t,r){if(r===null)i.delete(t);else i.set(t,r)}var s=new Map;function wt(t,r){if(s.has(t))throw Error("A composer is already registered for this session");return s.set(t,r),()=>{if(s.get(t)===r)s.delete(t)}}function Ir(t,r){if(typeof r!=="string"||!r.trim())throw Error("The draft is empty");let n=s.get(t);if(!n)throw Error("The session's composer is not open; open the session first");let e=i.get(t);if(e&&(e.text.length||e.attachments.length||e.mentions.length))throw Error("The composer already has a draft; send or clear it first");n(r),i.set(t,{text:r,attachments:[],mentions:[],modelId:e?.modelId??null})}
|
|
2
|
+
export{i,sr,L,bt,Tr,Sr,wt,Ir};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n}from"./chunk-q6km9nha.js";import{e}from"./chunk-wpdn3rx8.js";import{Ue}from"./chunk-
|
|
1
|
+
import{n}from"./chunk-q6km9nha.js";import{e}from"./chunk-wpdn3rx8.js";import{Ue}from"./chunk-zb4mqy8f.js";import{he,ve,xe,ye}from"./chunk-d5ga13n0.js";import{o,C}from"./chunk-0ss92kxr.js";import{Loader2Icon as f}from"lucide-react";import{jsx as i,jsxs as m}from"react/jsx-runtime";function vt({session:t,timeline:c}){let{host:s,client:a}=o(),{t:r}=s,l=n((y)=>y.historyPages[t.id]?.cursor!=null),d=()=>C(s,a.open(t.id,t.cwd)),p=i(Ue,{...c,session:t,client:a,host:s});if(t.restoring)return t.items.length===0?m("div",{className:"text-muted-foreground flex flex-1 items-center justify-center gap-2 text-sm",children:[i(f,{className:"size-4 animate-spin","aria-hidden":"true"}),r("conversation.restoring")]}):p;if(!t.attached&&t.items.length===0)return m(he,{className:"flex-1",children:[m(ve,{children:[i(xe,{children:r("conversation.reopen")}),i(ye,{children:r("conversation.detached")})]}),i(e,{onClick:d,children:r("conversation.reopen")})]});if(t.items.length===0&&t.state==="idle"&&!l)return i(he,{className:"flex-1",children:m(ve,{children:[i(xe,{className:"text-[28px] font-normal",children:r("conversation.welcomeTitle")}),i(ye,{className:"truncate font-mono",children:t.cwd})]})});return p}
|
|
2
2
|
export{vt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Hn,
|
|
1
|
+
import{Hn,Fn}from"./chunk-h68f23r0.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(Fn,{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};
|
|
@@ -0,0 +1,4 @@
|
|
|
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{useEffect as R,useId as N,useRef as w}from"react";import{jsx as l,jsxs as p,Fragment as _}from"react/jsx-runtime";function u(n){return n!==null&&typeof n==="object"&&!Array.isArray(n)}function h(n){if(!u(n)||!u(n.codex))return[];let r=n.codex,i=r.questions;if(r.delivery!=="async"||!Array.isArray(i))return[];if(!i.every((t)=>u(t)&&typeof t.title==="string"&&t.title.trim().length>0&&(t.options===null||Array.isArray(t.options)&&t.options.every((c)=>typeof c==="string"))))return[];return i}function dn(n,r){return JSON.stringify(["request_user_input_async",n,r])}function nr(n){return{selected:n.options?.length?0:null,text:""}}function xt(n,r){return r.selected===null?r.text:n.options?.[r.selected]??""}function or(n){return`<send_user_message_question_reply>
|
|
2
|
+
${JSON.stringify([n])}
|
|
3
|
+
</send_user_message_question_reply>`}function un(n){if(!u(n)||!u(n.codex))return[];let r=n.codex;return(Array.isArray(r.questionReplyParts)?r.questionReplyParts.map((t)=>u(t)?{...t,answer:t.text}:t):[r.questionReply]).filter((t)=>u(t)&&typeof t.questionItemId==="string"&&typeof t.question==="string"&&typeof t.answer==="string").map(({questionItemId:t,question:c,answer:m})=>({questionItemId:t,question:c,answer:m}))}function rr({question:n,draft:r,status:i,answer:t,error:c,onChange:m,onSubmit:f,onSkip:b,t:a}){let y=N(),g=w(!1),o=w(null);R(()=>()=>{if(o.current!==null)cancelAnimationFrame(o.current)},[]);let d=i==="pending",Q=i==="answered"||i==="skipped";return p("section",{"aria-labelledby":`${y}-title`,className:"flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-card p-4 text-card-foreground",children:[l("h3",{id:`${y}-title`,className:"text-sm font-medium whitespace-pre-wrap",children:n.title}),Q?l("p",{className:"text-sm whitespace-pre-wrap",children:i==="answered"?t:a("asyncQuestion.skipped")}):p(_,{children:[(n.options?.length??0)>0&&p(Y,{"aria-labelledby":`${y}-title`,disabled:!d,value:r.selected===null?"other":String(r.selected),onValueChange:(s)=>m({...r,selected:s==="other"?null:Number(s)}),children:[n.options?.map((s,x)=>p(v,{className:"flex items-start gap-2 text-sm",children:[l(A,{value:String(x)}),l("span",{className:"whitespace-pre-wrap",children:s})]},x)),p(v,{className:"flex items-center gap-2 text-sm",children:[l(A,{value:"other"}),a("asyncQuestion.other")]})]}),l(k,{rows:1,className:"min-h-0 resize-none",onCompositionStart:()=>{if(o.current!==null)cancelAnimationFrame(o.current);o.current=null,g.current=!0},onCompositionEnd:()=>{if(g.current=!1,o.current!==null)cancelAnimationFrame(o.current);o.current=requestAnimationFrame(()=>{o.current=null})},onKeyDown:(s)=>{if(s.key!=="Enter"||s.shiftKey||s.altKey||s.ctrlKey||s.metaKey||g.current||o.current!==null||s.nativeEvent.isComposing||s.nativeEvent.keyCode===229)return;if(s.preventDefault(),d&&xt(n,{...r,text:s.currentTarget.value}).trim().length>0)f()},"aria-label":a("asyncQuestion.answer"),placeholder:a("asyncQuestion.answer"),value:r.text,readOnly:!d,onChange:(s)=>m({selected:null,text:s.target.value})}),c&&l("p",{role:"alert",className:"text-sm text-destructive",children:c}),p("div",{className:"flex flex-wrap items-center gap-2",children:[l(e,{size:"sm",disabled:!d||xt(n,r).trim().length===0,onClick:f,children:a(i==="submitting"?"asyncQuestion.submitting":"asyncQuestion.submit")}),l(e,{size:"sm",variant:"ghost",disabled:!d,onClick:b,children:a("asyncQuestion.skip")}),(i==="closed"||i==="unavailable")&&l("span",{role:"status",className:"text-xs text-muted-foreground",children:a(`asyncQuestion.${i}`)})]})]})]})}
|
|
4
|
+
export{h,dn,nr,xt,or,un,rr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function jo(r,e){if(!e.running)return{kind:"idle"};if(e.blocked)return{kind:"waiting"};if(e.retrying)return{kind:"retrying"};let t=r.findLast((i)=>i.kind==="tool"&&i.active);if(t)return{kind:"tool",ownerKey:t.key};let n=r.findLast((i)=>i.kind!=="user");if(n?.active){if(n.kind==="answer")return{kind:"speaking",ownerKey:n.key};if(n.kind==="text")return{kind:"speaking",ownerKey:n.key};if(n.kind==="reasoning")return{kind:"reasoning",ownerKey:n.key};if(n.kind==="plan")return{kind:"planning",ownerKey:n.key};if(n.kind==="compaction")return{kind:"tool",ownerKey:n.key}}if(n?.kind==="answer")return{kind:"idle"};return{kind:"working",ownerKey:n?.key}}
|
|
2
|
+
export{jo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var ki=280;function ho({entries:i,gapPx:t,measuredHeightsByKey:o,leadingInsetPx:e=0}){let n=[],r=[],d=new Map,s=[],u=e;for(let[x,a]of i.entries()){d.set(a.turnKey,x);for(let h of a.aliases??[])d.set(h,x);s.push(a.turnKey),r.push(u);let f=a.aliases?.map((h)=>o[h]).find((h)=>h!==void 0),m=o[a.turnKey]??f??a.estimatedHeightPx??280;if(n.push(m),u+=m,x<i.length-1)u+=t}return{bottomOffsetsPx:r.map((x,a)=>{let f=n[a];if(f===void 0)throw Error(`Codex turn height is missing at index ${a}`);return u-x-f}),heightsPx:n,topOffsetsPx:r,totalHeightPx:u,turnIndexByKey:d,turnKeys:s}}function be({distanceFromBottomPx:i,layout:t,overscanCount:o,viewportHeightPx:e}){if(t.turnKeys.length===0)return{startIndex:0,endIndex:0};let n=Math.min(Math.max(0,i),t.totalHeightPx),r=Math.min(n+Math.max(0,e),t.totalHeightPx),d=g(t.bottomOffsetsPx,r),s=l(t.bottomOffsetsPx,t.heightsPx,n);return{startIndex:Math.max(0,d-o),endIndex:Math.min(t.turnKeys.length,Math.max(s,d+1)+o)}}function
|
|
2
|
-
export{ki,ho,be,
|
|
1
|
+
var ki=280;function ho({entries:i,gapPx:t,measuredHeightsByKey:o,leadingInsetPx:e=0}){let n=[],r=[],d=new Map,s=[],u=e;for(let[x,a]of i.entries()){d.set(a.turnKey,x);for(let h of a.aliases??[])d.set(h,x);s.push(a.turnKey),r.push(u);let f=a.aliases?.map((h)=>o[h]).find((h)=>h!==void 0),m=o[a.turnKey]??f??a.estimatedHeightPx??280;if(n.push(m),u+=m,x<i.length-1)u+=t}return{bottomOffsetsPx:r.map((x,a)=>{let f=n[a];if(f===void 0)throw Error(`Codex turn height is missing at index ${a}`);return u-x-f}),heightsPx:n,topOffsetsPx:r,totalHeightPx:u,turnIndexByKey:d,turnKeys:s}}function be({distanceFromBottomPx:i,layout:t,overscanCount:o,viewportHeightPx:e}){if(t.turnKeys.length===0)return{startIndex:0,endIndex:0};let n=Math.min(Math.max(0,i),t.totalHeightPx),r=Math.min(n+Math.max(0,e),t.totalHeightPx),d=g(t.bottomOffsetsPx,r),s=l(t.bottomOffsetsPx,t.heightsPx,n);return{startIndex:Math.max(0,d-o),endIndex:Math.min(t.turnKeys.length,Math.max(s,d+1)+o)}}function Kt({anchorKey:i,layout:t,previousRange:o}){let e=t.turnIndexByKey.get(i);if(e===void 0)return null;return{startIndex:e,endIndex:Math.min(t.turnKeys.length,e+o.endIndex-o.startIndex)}}function vo({anchorKey:i,distanceFromBottomPx:t,nextLayout:o,previousLayout:e}){let n=e.turnIndexByKey.get(i),r=o.turnIndexByKey.get(i);if(n===void 0||r===void 0)return null;let d=e.bottomOffsetsPx[n],s=e.heightsPx[n],u=o.bottomOffsetsPx[r],x=o.heightsPx[r];if(d===void 0||s===void 0||u===void 0||x===void 0)throw Error(`Codex turn geometry is missing: ${i}`);return Math.max(0,t+u+x-d-s)}function xo({layout:i,turnKey:t,viewportHeightPx:o}){let e=i.turnIndexByKey.get(t);if(e===void 0)return null;let n=i.bottomOffsetsPx[e],r=i.heightsPx[e];if(n===void 0||r===void 0)throw Error(`Codex turn geometry is missing: ${t}`);return Math.max(0,n-o/2+r/2)}function yo({align:i,layout:t,targetHeightPx:o,targetOffsetPx:e,turnKey:n,viewportHeightPx:r}){let d=t.turnIndexByKey.get(n);if(d===void 0)return null;let s=t.bottomOffsetsPx[d],u=t.heightsPx[d];if(s===void 0||u===void 0)throw Error(`Codex turn geometry is missing: ${n}`);let x=s+u-e;return i==="top"?Math.max(0,x-r+10):Math.max(0,x-o/2-r/2)}function g(i,t){let o=0,e=i.length;while(o<e){let n=Math.floor((o+e)/2),r=i[n];if(r===void 0)throw Error(`Codex bottom offset is missing at index ${n}`);if(r<t)e=n;else o=n+1}return o}function l(i,t,o){let e=0,n=i.length;while(e<n){let r=Math.floor((e+n)/2),d=i[r],s=t[r];if(d===void 0||s===void 0)throw Error(`Codex turn geometry is missing at index ${r}`);if(d+s<=o)n=r;else e=r+1}return e}
|
|
2
|
+
export{ki,ho,be,Kt,vo,xo,yo};
|
|
@@ -1 +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
|
|
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 Gt({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 jt({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{Gt,jt,co,uo,fi,mo,hi,ht,vi,xi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i,L,
|
|
2
|
-
export{
|
|
1
|
+
import{i,L,bt}from"./chunk-2swp3nfs.js";var On=5000;function de(t){return"pastedText"in t}function Er(t){return`file://${encodeURI(t).replaceAll("#","%23").replaceAll("?","%3F")}`}function Le(t,e,o){let n=(r,s)=>{for(let[a,x]of i){if(!x.attachments.some((p)=>p.id===e.id))continue;L(a,(p)=>p.map((d)=>d.id===e.id?{...e,url:s===void 0?"":Er(s),pastedText:{text:e.pastedText.text,status:r}}:d))}};if(!i.get(t)?.attachments.some((r)=>r.id===e.id))return;n("pending"),bt(e.id,o("pasted-text.txt",e.pastedText.text).then((r)=>n("ready",r)).catch(()=>n("error")))}function gt(t,e,o,n){if(t.defaultPrevented||t.currentTarget.disabled)return;if([...t.clipboardData.items].some((a)=>a.kind==="file"&&a.type.startsWith("image/")))return;let r=t.clipboardData.getData("text/plain");if(r.length<On)return;t.preventDefault(),t.stopPropagation();let s={id:crypto.randomUUID(),type:"file",mediaType:"text/plain",filename:o,url:"",pastedText:{text:r,status:"pending"}};L(e,(a)=>[...a,s]),Le(e,s,n)}
|
|
2
|
+
export{On,de,Er,Le,gt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as S}from"cn";import{useRef as y,useState as k}from"react";import{jsx as m,jsxs as u}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{cn as S}from"cn";import{useRef as y,useState as k}from"react";import{jsx as m,jsxs as u}from"react/jsx-runtime";function Bt({name:p,value:M,levels:h,disabled:c,onChange:P}){if(h.length===0)throw Error("EffortSlider requires at least one level");let o=h,g=Math.max(0,o.findIndex((t)=>t.value===M)),[v,d]=k(null),l=y(null),[I,x]=k(null),b=y(0),s=v??I??g,w=(t)=>{let n=++b.current;x(t);let e=()=>{if(b.current===n)x(null)};try{Promise.resolve(P(o[t].value)).then(e,e)}catch(N){throw e(),N}},f=100,r=14,a=2,i=o.length,C=a+s/Math.max(1,i-1)*(f-r-a*2);return u("div",{className:S("flex items-center justify-between px-2 py-2.5",c&&"opacity-50"),children:[u("span",{className:"grid shrink-0 text-sm whitespace-nowrap",children:[o.map((t)=>u("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1",children:[p," ",u("span",{style:{fontSize:12},children:["(",t.name,")"]})]},t.value)),u("span",{className:"col-start-1 row-start-1",children:[p," ",u("span",{"data-effort-value":"",style:{fontSize:12},children:["(",o[s].name,")"]})]})]}),u("button",{type:"button",disabled:c,role:"slider","aria-label":p,"aria-valuemin":0,"aria-valuemax":i-1,"aria-valuenow":s,"aria-valuetext":o[s].name,onKeyDown:(t)=>{let n;if(t.key==="ArrowRight"||t.key==="ArrowUp")n=Math.min(i-1,s+1);else if(t.key==="ArrowLeft"||t.key==="ArrowDown")n=Math.max(0,s-1);else if(t.key==="Home")n=0;else if(t.key==="End")n=i-1;else return;if(t.preventDefault(),t.stopPropagation(),!c&&n!==s)w(n)},className:"relative shrink-0 cursor-pointer touch-none overflow-hidden rounded-full border-none p-0 disabled:cursor-default",style:{width:f,height:18,background:"var(--input)"},onPointerDown:(t)=>{if(c||t.button!==0)return;t.preventDefault(),t.stopPropagation(),t.currentTarget.focus(),t.currentTarget.setPointerCapture(t.pointerId);let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/Math.max(1,n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerMove:(t)=>{if(l.current===null)return;let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/Math.max(1,n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerUp:(t)=>{let n=l.current;if(l.current=null,d(null),t.currentTarget.hasPointerCapture(t.pointerId))t.currentTarget.releasePointerCapture(t.pointerId);if(!c&&n!==null&&n!==g)w(n)},onLostPointerCapture:()=>{l.current=null,d(null)},onPointerCancel:()=>{l.current=null,d(null)},onClick:(t)=>{t.preventDefault(),t.stopPropagation()},children:[m("span",{className:"absolute inset-y-0 left-0 w-full rounded-full",style:{background:"var(--input)"}}),o.map((t,n)=>{let e=a+r/2+n/Math.max(1,i-1)*(f-r-a*2)-2;return m("span",{className:"absolute top-1/2 size-1 -translate-y-1/2 rounded-full",style:{left:e,background:"color-mix(in srgb, var(--muted-foreground) 40%, transparent)"}},t.value)}),m("span",{className:"absolute rounded-full transition-all duration-150",style:{width:r,height:r,top:a,left:C,background:"var(--foreground)",boxShadow:"0 1px 2px #0003"}})]})]})}
|
|
2
|
+
export{Bt};
|
|
@@ -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 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
|
|
2
|
-
export{Eo,Ti,Ao,Lo,Si,wr,
|
|
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 Fr(t,i);return kr(e,n)}function Fr(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+Or(e,n)}function Ii(e,n){return D(kr(e,n))}function Or(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,Fr,kr,Ii,Or,Br,Pi,Ni};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{No}from"./chunk-
|
|
1
|
+
import{No}from"./chunk-c2bkhrcc.js";import{Eo,Ao,Lo}from"./chunk-6nnwmqqp.js";import{Mo}from"./chunk-fexvhys2.js";import{t}from"./chunk-q6km9nha.js";import{Q}from"./chunk-e99sdapw.js";import{nativeTurnId as f,textOf as I}from"@nyssance/codex-acp-v2/client";import{useMemo as N}from"react";import{jsx as r,jsxs as v,Fragment as y}from"react/jsx-runtime";function Hr(i,n){return{installUnlock:n==="none"?()=>()=>{}:Ao,preload:()=>{if(n!=="none")Eo(i)},playSequence:(a,d,l)=>Lo(a,d,l,i,n)}}function Io(i,n={},a){let d=[];for(let e of i){if(e.user===null)continue;let o="";for(let m of e.final){let p=I(m.content).trim();if(p.length===0)continue;o=p}let u=n[e.user.id],s=e.items.map(f).find((m)=>m!==null);d.push({id:e.user.id,turnKey:e.key,label:Q(e.user),response:o,inputTokens:u?.inputTokens??0,outputTokens:u?.outputTokens??0,...s===void 0?{}:{nativeTurnId:s}})}if(!a?.complete)return d;let l=new Map;for(let e of d){if(e.nativeTurnId===void 0)continue;let o=l.get(e.nativeTurnId)??[];o.push(e),l.set(e.nativeTurnId,o)}let c=new Set(a.turns.map((e)=>e.turnId)),g=new Set(a.loadedTurnIds);return[...a.turns.flatMap((e)=>{let o=l.get(e.turnId);if(o)return o;if(g.has(e.turnId))return[];let u=a.previews[e.turnId];return((u?.messages.length)?u.messages:[{id:"",label:"",response:""}]).map((s,m)=>({id:`history:${e.turnId}:${m===0?"0":s.id}`,messageId:s.id||void 0,turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,isLoaded:!1,previewState:u?.state??"loading",label:s.label,response:s.response,inputTokens:0,outputTokens:0}))}),...d.filter((e)=>e.nativeTurnId===void 0||!c.has(e.nativeTurnId))]}function T({item:i}){let n=t(),a=N(()=>({theme:n.theme,copyLabel:n.t("actions.copy"),openLink:()=>{},preview:!0}),[n]);if(i.previewState==="loading")return v("div",{role:"status",className:"animate-pulse space-y-2 py-1","aria-label":n.t("timeline.navigationLoading"),children:[r("div",{className:"bg-muted h-3 w-3/5 rounded"}),r("div",{className:"bg-muted h-3 rounded"}),r("div",{className:"bg-muted h-3 w-4/5 rounded"})]});return v(y,{children:[r("div",{className:"min-w-0 truncate font-medium",children:i.previewState==="unavailable"?n.t("timeline.navigationUnavailable"):i.label||n.t("timeline.navigationEmpty")}),i.response&&r("div",{className:"text-muted-foreground pointer-events-none mt-1 line-clamp-3 [&_img]:hidden [&_pre]:max-h-20 [&_table]:table-fixed","data-navigation-response":!0,children:r(No,{text:i.response,host:a})})]})}function Po(i){return r(Mo,{...i,renderPreview:(n)=>r(T,{item:n})})}
|
|
2
2
|
export{Hr,Io,Po};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G}from"./chunk-
|
|
1
|
+
import{G}from"./chunk-kmhwwzga.js";import{t}from"./chunk-q6km9nha.js";import{SquareSlashIcon as s}from"lucide-react";import{useRef as l}from"react";import{jsx as r}from"react/jsx-runtime";function En({textareaRef:a,onOpenChange:p,menuOpen:e,disabled:m}){let{t:o}=t(),n=l(!1);return r(G,{"aria-label":o("composer.commands"),title:o("composer.commands"),disabled:m,"aria-pressed":e,onPointerDown:()=>{n.current=e},onClick:()=>{p(!n.current),a.current?.getTextarea()?.focus()},children:r(s,{className:"size-4"})})}
|
|
2
2
|
export{En};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$e}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{$e}from"./chunk-khj3ye94.js";import{ir}from"./chunk-n56csv51.js";import{t}from"./chunk-q6km9nha.js";import{B}from"./chunk-y6afvrnv.js";import{rn}from"./chunk-e99sdapw.js";import{isContentEntry as f,isEmbeddedResource as y,isResourceLink as g}from"@nyssance/codex-acp-v2/client";import{memo as k,useMemo as v}from"react";import{jsx as l,jsxs as u,Fragment as T}from"react/jsx-runtime";function R({item:n}){if(n.name==="view_image"&&n.status==="completed")return null;let r=n.content.filter(f).filter((o)=>y(o.content)||g(o.content));if(r.length===0)return null;return u("fieldset",{className:"mt-1 min-w-0",children:[l("legend",{className:"text-muted-foreground text-xs",children:n.title??n.name}),r.map((o,s)=>l(B,{block:o.content},`${n.id}:${s}`))]})}var tn=k(function({sessionId:r,items:o,terminals:s,streamingThoughtId:d}){let p=t(),i=o.every(rn),c=p.toolBlock,a=v(()=>o.map((e)=>{let m={...ir(e,s,e.kind==="thought"&&e.id===d),id:JSON.stringify([r,i?"history":"live",e.id])};return m.type==="tool_use"&&e.kind==="tool"&&c!==void 0?c(m,e):m}),[r,i,o,s,d,c]);return u(T,{children:[l($e,{blocks:a,defaultExpanded:!i}),o.map((e)=>e.kind==="tool"&&l(R,{item:e},e.id))]})});
|
|
2
|
+
export{tn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Dn}from"./chunk-
|
|
1
|
+
import{Dn}from"./chunk-sf6ze845.js";import{o,C}from"./chunk-0ss92kxr.js";import{N,c}from"./chunk-n1tjf64a.js";import{createLucideIcon as w,HandIcon as y,ShieldAlertIcon as S,ShieldCheckIcon as r}from"lucide-react";import{jsx as t}from"react/jsx-runtime";var O=w("ApprovalShield",[["path",{d:"M12 22s8-4 8-11V5l-8-3-8 3v6c0 7 8 11 8 11",key:"shield"}],["path",{d:"m8 8 3 3-3 3M13 15h3",key:"terminal"}]]),u={"read-only":y,"workspace-write":r,agent:O,"agent-full-access":S},b={"read-only":"readOnly","workspace-write":"workspaceAccess",agent:"agent","agent-full-access":"fullAccess"};function ut({sessionId:g,options:m,disabled:f,onConfigChange:l}){let{host:p,client:h}=o(),{t:a}=p,s=c(m,"mode");if(!s)return null;let n=s.currentValue,d=N(s).map((e)=>{let i=b[e.value];return i?{...e,name:a(`permissionModes.${i}.name`),description:a(`permissionModes.${i}.description`)}:e}),I=d.find((e)=>e.value===n),M=u[n]??r,v=(e)=>{if(e===n)return;C(p,l?l(s.configId,e):h.setConfig(g,s.configId,e))};return t(Dn,{value:n,warning:n==="agent-full-access",currentName:I?.name??n,icon:t(M,{className:"size-3.5 shrink-0"}),header:a("permissionModes.heading"),disabled:f,label:a("composer.switchPermissionMode"),onValueChange:v,options:d.map((e)=>{let i=u[e.value]??r,k=e.value==="agent-full-access";return{value:e.value,label:t("span",{"data-permission-warning":k?"":void 0,children:e.name}),description:e.description?t("span",{className:"whitespace-normal",children:e.description}):void 0,icon:t(i,{className:"size-3.5 shrink-0"})}})})}
|
|
2
2
|
export{ut};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cn as t}from"cn";import{jsx as n}from"react/jsx-runtime";function
|
|
1
|
+
import{cn as t}from"cn";import{jsx as n}from"react/jsx-runtime";function Pt({className:e,...o}){return n("div",{"data-slot":"skeleton",className:t("animate-pulse rounded-md bg-muted",e),...o})}export{Pt};
|
|
@@ -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
|
|
3
|
-
export{ge,
|
|
1
|
+
import{Jn}from"./chunk-2g8targj.js";import{to}from"./chunk-gzeg6bqp.js";import{no}from"./chunk-90wm9rxz.js";import{Be}from"./chunk-yh9qdb2k.js";import{n}from"./chunk-q6km9nha.js";import{o}from"./chunk-0ss92kxr.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 Oe({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(to,{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(Oe,{action:t,total:e??1,onRespond:s});let i=t.params;if(!w(i))throw Error("Unsupported elicitation mode");return a(no,{message:i.message,url:i.url,t:r.t,onOpen:r.openLink,onRespond:(c)=>l(c==="cancel"?{action:"cancel"}:{action:"decline"})})}
|
|
3
|
+
export{ge,Oe,ft};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function fn(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function
|
|
2
|
-
export{fn,
|
|
1
|
+
function fn(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function It(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,It,ae,Ke};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_e}from"./chunk-
|
|
1
|
+
import{_e}from"./chunk-cazdmcwd.js";import{G,Gn}from"./chunk-kmhwwzga.js";import{t}from"./chunk-q6km9nha.js";import{zn}from"./chunk-9j609g4n.js";import{ue,me,pe}from"./chunk-ea3582qy.js";import{cn as d}from"cn";import{SquareIcon as b}from"lucide-react";import{jsx as o,jsxs as n,Fragment as h}from"react/jsx-runtime";var f=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function Bn({active:a,sending:r,ready:p,hasMentions:m=!1,onStop:c}){let{t:e}=t(),s=_e(),u=m||s.textInput.value.trim().length>0||s.attachments.files.length>0,l=!p||r||!u,i=a?e("composer.steer"):e("composer.send");return n(h,{children:[a&&o(G,{"aria-label":e("composer.stop"),title:e("composer.stop"),className:"border-border size-7 rounded-full border",onClick:c,children:o(b,{className:"size-3 fill-current"})}),o("div",{className:d(l&&"cursor-not-allowed"),children:n(ue,{children:[o(me,{render:o(Gn,{"aria-label":i,disabled:l,"aria-busy":r,status:r?"submitted":"ready"})}),n(pe,{role:"tooltip",children:[o("span",{className:"min-w-0",children:i}),o(zn,{className:"shrink-0",children:f?"↩":"Enter"})]})]})})]})}
|
|
2
2
|
export{Bn};
|