@alwith/module-chat 0.5.10 → 0.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity-host.js +1 -1
- 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-pmpeh7e8.js → chunk-0d4xsx23.js} +2 -2
- package/dist/{chunk-8tn17nw7.js → chunk-0gwe31zs.js} +2 -2
- package/dist/chunk-0kwfy29d.js +2 -0
- package/dist/{chunk-951wn2bd.js → chunk-0n240acr.js} +2 -2
- package/dist/{chunk-vdeh7n7d.js → chunk-0yvbqccv.js} +2 -2
- package/dist/chunk-133f0wed.js +2 -0
- package/dist/{chunk-et0rpfh9.js → chunk-17zegmxa.js} +1 -1
- package/dist/{chunk-9bjywaze.js → chunk-1drkvxzk.js} +1 -1
- package/dist/{chunk-gajhc4bp.js → chunk-20svvgj3.js} +2 -2
- package/dist/{chunk-rmv0t2ee.js → chunk-294gms5s.js} +2 -2
- package/dist/{chunk-ybwgmphj.js → chunk-2pha46d9.js} +1 -1
- package/dist/{chunk-dzx4rypz.js → chunk-30wqrz8v.js} +2 -2
- package/dist/chunk-31x6chk8.js +2 -0
- package/dist/{chunk-2879v3ps.js → chunk-377s443r.js} +2 -2
- package/dist/chunk-3e0mfcj6.js +2 -0
- package/dist/chunk-3vrtepy0.js +3 -0
- package/dist/chunk-443z7mve.js +2 -0
- package/dist/{chunk-ptws0wtt.js → chunk-460phps1.js} +2 -2
- package/dist/chunk-4b3s7gyc.js +3 -0
- package/dist/chunk-4nh3xzrm.js +2 -0
- package/dist/{chunk-jbz530rv.js → chunk-4svcj9c6.js} +2 -2
- package/dist/{chunk-5f4m4ptz.js → chunk-50qyant6.js} +3 -3
- package/dist/chunk-51sbmqdk.js +2 -0
- package/dist/chunk-5ev4qvsp.js +2 -0
- package/dist/chunk-5fgakrmr.js +2 -0
- package/dist/{chunk-k583q9wq.js → chunk-5hsmhj1g.js} +3 -3
- package/dist/chunk-5kpcpjrb.js +4 -0
- package/dist/{chunk-erzjz56d.js → chunk-5m4605a3.js} +1 -1
- package/dist/{chunk-xv3qen27.js → chunk-5w92bzgs.js} +2 -2
- package/dist/chunk-64whvkk0.js +2 -0
- package/dist/{chunk-nsns7rgs.js → chunk-6amcjhqh.js} +2 -2
- package/dist/{chunk-y0ppdmcv.js → chunk-6d7ppje3.js} +2 -2
- package/dist/{chunk-dnhmnmgf.js → chunk-6edz9f7j.js} +2 -2
- package/dist/{chunk-akcs13sj.js → chunk-6pmc9283.js} +2 -2
- package/dist/{chunk-bm4s6n8a.js → chunk-6ss1981q.js} +2 -2
- package/dist/{chunk-x66yhg5y.js → chunk-728v2as1.js} +2 -2
- package/dist/{chunk-kgkrtc3r.js → chunk-7a6t282a.js} +1 -1
- package/dist/chunk-7drq0g9b.js +2 -0
- package/dist/{chunk-9h86hvc3.js → chunk-7dzq2t68.js} +2 -2
- package/dist/{chunk-tjhwk02y.js → chunk-7h8pv9eg.js} +1 -1
- package/dist/{chunk-9cbpmdqf.js → chunk-7jdazbzv.js} +2 -2
- package/dist/{chunk-wp673je0.js → chunk-7k0wvvy0.js} +1 -1
- package/dist/{chunk-5nqhvv28.js → chunk-88xay4pa.js} +2 -2
- package/dist/{chunk-j8fybkv1.js → chunk-91x8etvh.js} +2 -2
- package/dist/{chunk-wzjq9j6g.js → chunk-93x6b2qa.js} +3 -3
- package/dist/chunk-96xwaa2t.js +2 -0
- package/dist/{chunk-rqnvygqy.js → chunk-9a4kjze3.js} +6 -6
- package/dist/chunk-9tdzg6e6.js +2 -0
- package/dist/{chunk-gc1m6aw5.js → chunk-a3krtv66.js} +2 -2
- package/dist/{chunk-vpt3vyfc.js → chunk-abwjd5yv.js} +2 -2
- package/dist/{chunk-tc85dd04.js → chunk-ak0k5vg6.js} +1 -1
- package/dist/chunk-aprxk7c2.js +2 -0
- package/dist/chunk-b4dsjhkq.js +2 -0
- package/dist/{chunk-rawfwgmw.js → chunk-b65vdzz3.js} +1 -1
- package/dist/chunk-bhze2sjv.js +2 -0
- package/dist/{chunk-vyf9wx2w.js → chunk-c0ac9k7h.js} +2 -2
- package/dist/{chunk-eg1d1gbc.js → chunk-cgqhz23q.js} +2 -2
- package/dist/{chunk-7awdgc0t.js → chunk-cjztkcsm.js} +2 -2
- package/dist/{chunk-1k1e55de.js → chunk-cke0v0a7.js} +1 -1
- package/dist/{chunk-3wg25354.js → chunk-cpk3y6ad.js} +2 -2
- package/dist/chunk-d84cxw1v.js +2 -0
- package/dist/chunk-dp8pjv6r.js +2 -0
- package/dist/{chunk-kathd6f3.js → chunk-e11qjnb4.js} +2 -2
- package/dist/chunk-e55zxnda.js +2 -0
- package/dist/{chunk-kjtd3wc3.js → chunk-ek06eyp4.js} +1 -1
- package/dist/chunk-f1zvbkak.js +2 -0
- package/dist/{chunk-76xfekar.js → chunk-f4h7yb7d.js} +2 -2
- package/dist/chunk-fe3c678p.js +2 -0
- package/dist/{chunk-s4tydqhr.js → chunk-g7p46jq1.js} +2 -2
- package/dist/{chunk-0fr24sxr.js → chunk-gj3j9zh5.js} +3 -3
- package/dist/{chunk-6z9r27t2.js → chunk-gzff19t3.js} +2 -2
- package/dist/chunk-ha5jfz6r.js +4 -0
- package/dist/{chunk-r828rqdv.js → chunk-hjnf5kvc.js} +2 -2
- package/dist/{chunk-t1yd4a57.js → chunk-hrsz92yq.js} +1 -1
- package/dist/{chunk-v2bbgpvw.js → chunk-hxhptw6e.js} +2 -2
- package/dist/{chunk-ct5wk01a.js → chunk-j2wtwb37.js} +3 -3
- package/dist/chunk-j2wty8a3.js +2 -0
- package/dist/chunk-jhk2chpp.js +2 -0
- package/dist/{chunk-5c4z345j.js → chunk-jn0q0b7k.js} +2 -2
- package/dist/{chunk-rw9bsnyp.js → chunk-k3375qqd.js} +2 -2
- package/dist/{chunk-bhrnw36x.js → chunk-k5c82xk9.js} +2 -2
- package/dist/{chunk-r55p44ys.js → chunk-kahn24np.js} +2 -2
- package/dist/{chunk-grncrd31.js → chunk-knsf6jm1.js} +2 -2
- package/dist/{chunk-vxm45kym.js → chunk-krmz8t4p.js} +2 -2
- package/dist/{chunk-5d94195x.js → chunk-ksv9pjc2.js} +1 -1
- package/dist/chunk-m28hdj8j.js +2 -0
- package/dist/{chunk-34a7aha4.js → chunk-m6rrt94g.js} +2 -2
- package/dist/chunk-m8djwdd5.js +2 -0
- package/dist/{chunk-d8rf7rff.js → chunk-m99k3e5h.js} +2 -2
- package/dist/{chunk-anshr0mw.js → chunk-magaaqab.js} +1 -1
- package/dist/{chunk-f4e289mj.js → chunk-mgtkmbmd.js} +2 -2
- package/dist/{chunk-0sdhavk8.js → chunk-mt965yn0.js} +2 -2
- package/dist/{chunk-xjtqdp82.js → chunk-ncekagm6.js} +1 -1
- package/dist/{chunk-vvk1knxf.js → chunk-nkypxxjk.js} +1 -1
- package/dist/chunk-p1ydsj54.js +2 -0
- package/dist/{chunk-9w0w5by0.js → chunk-p8nx34zm.js} +2 -2
- package/dist/chunk-p8qgqtkc.js +2 -0
- package/dist/chunk-q905xt4v.js +2 -0
- package/dist/{chunk-wqrn3428.js → chunk-qah4fs3d.js} +1 -1
- package/dist/{chunk-b616t3fp.js → chunk-qj63fv6w.js} +2 -2
- package/dist/{chunk-4t6bd8j7.js → chunk-qnk5jk1b.js} +2 -2
- package/dist/chunk-qpc4ca5y.js +2 -0
- package/dist/chunk-qw0jp3wm.js +2 -0
- package/dist/{chunk-zbnjrtye.js → chunk-r79zqx0t.js} +5 -5
- package/dist/{chunk-94r5frad.js → chunk-rnykpmn2.js} +2 -2
- package/dist/{chunk-r67bkrmr.js → chunk-rnzphmk6.js} +2 -2
- package/dist/{chunk-zse2yz8e.js → chunk-rszktjdw.js} +3 -3
- package/dist/{chunk-46gb51y9.js → chunk-ryz4c13z.js} +2 -2
- package/dist/{chunk-13y1xqbb.js → chunk-sex6d2c2.js} +2 -2
- package/dist/{chunk-83dkw1mh.js → chunk-sr5rcdza.js} +2 -2
- package/dist/{chunk-btjqewxj.js → chunk-svt0t387.js} +2 -2
- package/dist/{chunk-12swy4za.js → chunk-syffw61b.js} +4 -4
- package/dist/{chunk-y8qmxd0j.js → chunk-t3ew92b3.js} +2 -2
- package/dist/{chunk-rg5vskrr.js → chunk-t6t6hgzx.js} +2 -2
- package/dist/{chunk-bq05e911.js → chunk-tjgq4882.js} +2 -2
- package/dist/{chunk-b81yxz7f.js → chunk-tv89wh8b.js} +2 -2
- package/dist/{chunk-gthvary5.js → chunk-vv1ghqq3.js} +1 -1
- package/dist/{chunk-2ymhbrf9.js → chunk-w43dvzqk.js} +3 -3
- package/dist/chunk-w6hhyjcn.js +2 -0
- package/dist/{chunk-fjwg3y8h.js → chunk-w8qmh6he.js} +2 -2
- package/dist/{chunk-7q07tm0w.js → chunk-wb3zpzk3.js} +1 -1
- package/dist/chunk-xh8wth6z.js +2 -0
- package/dist/{chunk-64hrczd9.js → chunk-xxkdv1zf.js} +1 -1
- package/dist/chunk-y3qgsj79.js +2 -0
- package/dist/{chunk-gq30yqjk.js → chunk-ynw0f8h2.js} +2 -2
- package/dist/chunk-ysc51tpb.js +2 -0
- package/dist/{chunk-115a3p9z.js → chunk-zbtas7pt.js} +2 -2
- package/dist/{chunk-90c0tynf.js → chunk-znx2e9e7.js} +2 -2
- package/dist/chunk-zt8qaqbz.js +2 -0
- package/dist/{chunk-2pj3pcc7.js → chunk-zz734bzf.js} +2 -2
- package/dist/codex/activity-group.js +1 -1
- package/dist/codex/assistant-message.js +1 -1
- package/dist/codex/async-question-card.js +1 -1
- package/dist/codex/disclosure-state.js +1 -1
- package/dist/codex/edited-files-card.js +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.js +1 -1
- package/dist/codex/navigation-audio.js +1 -1
- package/dist/codex/navigation-preview.js +1 -1
- package/dist/codex/navigation-rail.js +1 -1
- package/dist/codex/patch-view.js +1 -1
- package/dist/codex/plan.js +1 -1
- package/dist/codex/timeline-virtualizer.js +1 -1
- package/dist/codex/turn-activity.js +1 -1
- package/dist/codex/user-message.js +1 -1
- package/dist/codex/virtualized-turn-list.js +1 -1
- package/dist/composer/completion-filter.js +1 -1
- package/dist/composer/completion-menu.js +1 -1
- package/dist/composer/completion-trigger.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/config-options.js +1 -1
- package/dist/conversation/composer/context.js +1 -1
- package/dist/conversation/composer/drafts.js +1 -1
- package/dist/conversation/composer/file-items.js +1 -1
- package/dist/conversation/composer/long-text.js +1 -1
- package/dist/conversation/composer/mention-chips.js +1 -1
- package/dist/conversation/composer/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/diff-modal.js +1 -1
- package/dist/conversation/session-actions.js +1 -1
- package/dist/image-lightbox.js +1 -1
- package/dist/image-preview-dialog.js +1 -1
- package/dist/lib/code-highlighter.js +1 -1
- package/dist/lib/fuzzy.js +1 -1
- package/dist/lib/group-blocks.js +1 -1
- package/dist/lib/image-encode.js +1 -1
- package/dist/lib/limits.js +1 -1
- package/dist/lib/markdown-parser.js +1 -1
- package/dist/lib/markdown-parser.worker.js +43 -39
- 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/prepare-prompt-files.js +1 -1
- package/dist/lib/stream-style.js +1 -1
- package/dist/lib/streaming-markdown.js +1 -1
- package/dist/search/chat-search.js +1 -1
- package/dist/search/dom-matches.js +1 -1
- package/dist/search/find-bar.js +1 -1
- package/dist/search/literal-matches.js +1 -1
- package/dist/session-list/archived-sessions.js +1 -1
- package/dist/session-list/highlight.js +1 -1
- package/dist/session-list/host.js +1 -1
- package/dist/session-list/hover-info-card.js +1 -1
- package/dist/session-list/navigation.js +1 -1
- package/dist/session-list/overflow-marquee.js +1 -1
- package/dist/session-list/row-stop-button.js +1 -1
- package/dist/session-list/session-groups.js +1 -1
- package/dist/session-list/session-info-card.js +1 -1
- package/dist/session-list/session-list.js +1 -1
- package/dist/session-list/session-row.js +1 -1
- package/dist/session-list/session-state-dot.js +1 -1
- package/dist/session-list/session-state-menu.js +1 -1
- package/dist/session-list/sidebar-overlay.js +1 -1
- package/dist/session-list/trailing-swap.js +1 -1
- package/dist/session-list/use-activity-preview.js +1 -1
- package/dist/session-list/use-project-sessions.js +1 -1
- package/dist/session-list/virtual-session-rows.js +1 -1
- package/dist/session-timeline/activity-group.js +1 -1
- package/dist/session-timeline/activity-projection.js +1 -1
- package/dist/session-timeline/assistant-content.js +1 -1
- package/dist/session-timeline/assistant-turn.js +1 -1
- package/dist/session-timeline/async-questions.js +1 -1
- package/dist/session-timeline/edited-files-card.js +1 -1
- package/dist/session-timeline/history-timeline.js +1 -1
- package/dist/session-timeline/host.js +1 -1
- package/dist/session-timeline/navigation-rail.js +1 -1
- package/dist/session-timeline/plan.js +1 -1
- package/dist/session-timeline/question-reply.js +1 -1
- package/dist/session-timeline/resource-content.js +1 -1
- package/dist/session-timeline/session-timeline.js +1 -1
- package/dist/session-timeline/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-retry.js +1 -1
- package/dist/session-timeline/turn-time.js +1 -1
- package/dist/session-timeline/turns.js +1 -1
- package/dist/session-timeline/use-timeline-scroll.js +1 -1
- package/dist/session-timeline/user-message.js +1 -1
- package/dist/ui/alert.js +1 -1
- package/dist/ui/badge.js +1 -1
- package/dist/ui/card.js +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/empty.js +1 -1
- package/dist/ui/field.js +1 -1
- package/dist/ui/hover-card.js +1 -1
- package/dist/ui/input-group-textarea.js +1 -1
- package/dist/ui/input-group.js +1 -1
- package/dist/ui/kbd.js +1 -1
- package/dist/ui/label.js +1 -1
- package/dist/ui/radio-group.js +1 -1
- package/dist/ui/select.js +1 -1
- package/dist/ui/separator.js +1 -1
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/spinner.js +1 -1
- package/dist/ui/switch.js +1 -1
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/tooltip.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-1jzxmw98.js +0 -2
- package/dist/chunk-1wxebrbt.js +0 -2
- package/dist/chunk-1xg1qw4g.js +0 -4
- package/dist/chunk-3g8ck68k.js +0 -2
- package/dist/chunk-3xnbypjz.js +0 -2
- package/dist/chunk-4ecdn9z1.js +0 -2
- package/dist/chunk-60ks28ef.js +0 -2
- package/dist/chunk-62x983rq.js +0 -2
- package/dist/chunk-6f2h379x.js +0 -2
- package/dist/chunk-6xp64b2e.js +0 -2
- package/dist/chunk-78x93ef2.js +0 -2
- package/dist/chunk-7e1m1d9x.js +0 -2
- package/dist/chunk-8dtaq4eh.js +0 -2
- package/dist/chunk-9tgtskz4.js +0 -2
- package/dist/chunk-a7nqzhxj.js +0 -2
- package/dist/chunk-aafg3jqm.js +0 -3
- package/dist/chunk-b8ywzj88.js +0 -2
- package/dist/chunk-b9ew8dwr.js +0 -2
- package/dist/chunk-cc6vp2sg.js +0 -2
- package/dist/chunk-ckft9abb.js +0 -2
- package/dist/chunk-fb6vxbmc.js +0 -2
- package/dist/chunk-fcyzhbmn.js +0 -2
- package/dist/chunk-fw3emcqw.js +0 -2
- package/dist/chunk-h7ks1p6h.js +0 -2
- package/dist/chunk-j4cm74nv.js +0 -4
- package/dist/chunk-jegkf64h.js +0 -2
- package/dist/chunk-jjtgsnj0.js +0 -2
- package/dist/chunk-jnrcqphc.js +0 -2
- package/dist/chunk-jyy20tw1.js +0 -2
- package/dist/chunk-k7wta28t.js +0 -2
- package/dist/chunk-ksmcznp2.js +0 -3
- package/dist/chunk-m2ab6p4w.js +0 -2
- package/dist/chunk-n89jvr5q.js +0 -2
- package/dist/chunk-nvya2g1d.js +0 -2
- package/dist/chunk-s1z1418w.js +0 -2
- package/dist/chunk-sgy6b5me.js +0 -2
- package/dist/chunk-sk14wfkj.js +0 -2
- package/dist/chunk-sx4fhs54.js +0 -2
- package/dist/chunk-vmcxp5e2.js +0 -2
package/dist/activity-host.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{sr,a,v}from"./chunk-ryz4c13z.js";export{sr as ActivityHostProvider,v as ActivityMarkdown,a as useActivityHost};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{qe}from"../chunk-nkypxxjk.js";import{e}from"../chunk-6kn920c5.js";import{ue}from"../chunk-1drkvxzk.js";import{l}from"../chunk-1hy64ewz.js";import{f}from"../chunk-ek06eyp4.js";import{j,I}from"../chunk-5m4605a3.js";import{k}from"../chunk-ncekagm6.js";import{mn,Ct,ae,We}from"../chunk-t6t6hgzx.js";import{autoUpdate as G}from"@floating-ui/dom";import{cn as H}from"cn";import{useCallback as Q,useEffect as M,useLayoutEffect as O,useMemo as _,useRef as V,useState as R}from"react";import{createPortal as W}from"react-dom";import{jsx as i,jsxs as m}from"react/jsx-runtime";var c="__other__";function le({current:r,total:F,anchorRef:N,t:p,onAccept:A,onDecline:L}){let x=_(()=>r?mn(r.requestedSchema):[],[r]),[S,b]=R({}),T=V(null);M(()=>{if(r?.elicitationId===void 0)return;let t={};for(let{key:a,property:o}of x)if(!ae(o)){let u=We(o)[0];if(u)t[a]={selected:u.value}}b(t)},[r?.elicitationId,x]),M(()=>{if(r?.elicitationId!==void 0&&T.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")T.current.focus()},[r?.elicitationId]);let[y,q]=R(null),[C,z]=R(null),E=Q(()=>{let t=N.current;if(!t)return;let a=t.getBoundingClientRect();if(a.width===0){let o=Math.min(640,window.innerWidth*0.9);q({left:(window.innerWidth-o)/2,width:o,bottom:24});return}q({left:a.left,width:a.width,bottom:window.innerHeight-a.bottom+20})},[N]);O(()=>{if(!r)return;let t=0,a=()=>{if(N.current){E();return}t=requestAnimationFrame(a)};return a(),()=>cancelAnimationFrame(t)},[r,E,N]),O(()=>{let t=N.current;if(!r||!t||!C)return;return G(t,C,E,{animationFrame:!0})},[r,C,N,E]);let U=_(()=>{if(!r)return!1;for(let{key:t,property:a}of x){let o=S[t];if(!o)return!1;if(ae(a)){if(!o.selectedSet||o.selectedSet.size===0)return!1;if(o.selectedSet.has(c)&&!o.otherText?.trim())return!1}else{if(!o.selected)return!1;if(o.selected===c&&!o.otherText?.trim())return!1}}return!0},[r,x,S]),D=Q(async()=>{if(!r)return;if(!U)return;let t={},a={};for(let{key:o,property:u}of x){let d=S[o];if(!d)continue;let g;if(ae(u))t[o]=[...d.selectedSet??[]].map((v)=>v===c?(d.otherText??"").trim():v).filter(Boolean);else{let v=d.selected??"";if(t[o]=v===c?(d.otherText??"").trim():v,v!==c)g=We(u).find((s)=>s.value===v)?.preview}let h=d.notes?.trim();if(g||h)a[o]={...g&&{preview:g},...h&&{notes:h}}}await A(r.elicitationId,t,a)},[r,x,S,U,A]),B=Q(async()=>{if(r)await L(r.elicitationId)},[r,L]);if(!r||!y)return null;return W(m("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(t)=>{if(t.key==="Escape")t.preventDefault(),B()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left: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:[i("div",{className:"text-foreground text-sm font-medium",children:p("askUserQuestion.title")}),F>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${F}`})]}),i("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i("div",{className:"space-y-4 px-3 py-3",children:x.map(({key:t,property:a},o)=>{let u=S[t],d=u?.selected,g=u?.selectedSet??new Set,h=We(a),v=ae(a);return m("div",{className:"space-y-2",children:[m("div",{className:"flex items-center gap-2",children:[i(qe,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:Ct(a).title??t}),i("div",{className:"text-foreground text-sm font-medium",children:Ct(a).description})]}),v?m("div",{className:"space-y-1.5 ps-1",children:[h.map((s)=>m("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[i(ue,{checked:g.has(s.value),onCheckedChange:(n)=>{b((w)=>{let P=new Set(w[t]?.selectedSet??new Set);if(n)P.add(s.value);else P.delete(s.value);return{...w,[t]:{...w[t],selectedSet:P}}})}}),m("div",{className:"min-w-0 flex-1",children:[i("div",{className:"text-foreground text-sm",children:s.label}),s.description&&i("div",{className:"text-muted-foreground text-xs",children:s.description})]})]},s.value)),m("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[i(ue,{checked:g.has(c),onCheckedChange:(s)=>{b((n)=>{let w=new Set(n[t]?.selectedSet??new Set);if(s)w.add(c);else w.delete(c);return{...n,[t]:{...n[t],selectedSet:w}}})}}),i("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:p("askUserQuestion.other")})]}),g.has(c)&&i("div",{className:"ps-7",children:i(l,{placeholder:p("askUserQuestion.otherPlaceholder"),value:u?.otherText??"",onChange:(s)=>b((n)=>({...n,[t]:{...n[t],otherText:s.target.value}}))})})]}):m(j,{value:d??"",onValueChange:(s)=>b((n)=>({...n,[t]:{...n[t],selected:s}})),className:"space-y-1.5 ps-1",children:[h.map((s)=>{let n=`${o}:${s.value}`;return m("div",{className:H("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",d===s.value&&"bg-muted/60"),children:[i(I,{value:s.value,id:n}),m(f,{htmlFor:n,className:"min-w-0 flex-1 cursor-pointer",children:[i("div",{className:"text-foreground text-sm font-normal",children:s.label}),s.description&&i("div",{className:"text-muted-foreground text-xs font-normal",children:s.description})]})]},s.value)}),m("div",{className:H("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",d===c&&"bg-muted/60"),children:[i(I,{value:c,id:`${o}:other`,className:"mt-0.5"}),i(f,{htmlFor:`${o}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:p("askUserQuestion.other")})]}),d===c&&i("div",{className:"ps-7",children:i(l,{placeholder:p("askUserQuestion.otherPlaceholder"),value:u?.otherText??"",onChange:(s)=>b((n)=>({...n,[t]:{...n[t],otherText:s.target.value}}))})})]}),!v&&d&&d!==c&&(()=>{let s=h.find((n)=>n.value===d)?.preview;if(!s)return null;return i("pre",{className:"bg-muted/50 text-muted-foreground ms-1 mt-1 overflow-auto rounded-sm px-2 py-1.5 font-mono text-[11px] whitespace-pre-wrap",children:s})})(),h.some((s)=>s.preview)&&i(k,{placeholder:p("askUserQuestion.notesPlaceholder"),value:u?.notes??"",onChange:(s)=>b((n)=>({...n,[t]:{...n[t],notes:s.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"})]},t)})})}),m("div",{className:"border-border bg-card flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2",children:[i(e,{variant:"ghost",size:"sm",onClick:()=>void B(),children:p("askUserQuestion.cancel")}),i(e,{size:"sm",disabled:!U,onClick:()=>void D(),children:p("askUserQuestion.submit")})]})]}),document.body)}export{le as ChoiceElicitationForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{mn,Ct,ae,We}from"../chunk-t6t6hgzx.js";export{mn as elicitationFields,Ct as elicitationLabels,We as elicitationOptions,ae as isMultiSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{hr,kn,Yr,Zr}from"../chunk-p8qgqtkc.js";export{hr as PERMISSION_KIND_GROUP_ORDER,Yr as isAllowKind,Zr as isAlwaysKind,kn as sortPermissionOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{yn}from"../chunk-cgqhz23q.js";import"../chunk-p8qgqtkc.js";export{yn as PermissionView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Pr,fr,Nr,bn}from"../chunk-443z7mve.js";import"../chunk-1drkvxzk.js";import"../chunk-7k0wvvy0.js";import"../chunk-1hy64ewz.js";import"../chunk-5m4605a3.js";import"../chunk-ek06eyp4.js";import"../chunk-ksv9pjc2.js";import"../chunk-17zegmxa.js";import"../chunk-ak0k5vg6.js";import"../chunk-ncekagm6.js";import"../chunk-6kn920c5.js";export{bn as SchemaElicitationForm,Pr as elicitationFields,fr as initialValues,Nr as isAnswered};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{wn}from"../chunk-krmz8t4p.js";import"../chunk-vv1ghqq3.js";import"../chunk-6kn920c5.js";export{wn as UrlElicitationCard};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Me}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{Me}from"./chunk-9a4kjze3.js";import{To}from"./chunk-k3375qqd.js";import{t}from"./chunk-dp8pjv6r.js";import{_}from"./chunk-g7p46jq1.js";import{qt}from"./chunk-m6rrt94g.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(_,{block:o.content},`${n.id}:${s}`))]})}var io=k(function({sessionId:r,items:o,terminals:s,streamingThoughtId:d}){let p=t(),i=o.every(qt),c=p.toolBlock,a=v(()=>o.map((e)=>{let m={...To(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(Me,{blocks:a,defaultExpanded:!i}),o.map((e)=>e.kind==="tool"&&l(R,{item:e},e.id))]})});
|
|
2
|
+
export{io};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
export{
|
|
1
|
+
var ri=280;function _n({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 me({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 Dt({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 Hn({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 On({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 Fn({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{ri,_n,me,Dt,Hn,On,Fn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function go({src:o,alt:e,onClose:i}){return n(t("button",{type:"button",className:"fixed inset-0 z-[1000] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.7)"},onClick:i,children:t("img",{src:o,alt:e,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4}})}),document.body)}
|
|
2
|
+
export{go};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useCallback as f,useEffect as U,useRef as s,useState as X}from"react";var S=24,q=160,z=45,j=()=>{};function
|
|
2
|
-
export{
|
|
1
|
+
import{useCallback as f,useEffect as U,useRef as s,useState as X}from"react";var S=24,q=160,z=45,j=()=>{};function oo(e,Y,u=j){let r=s("following"),[A,b]=X(!0),D=s(Y);D.current=Y;let a=s(null),y=s(0),P=s(0),k=s(0),p=s(0),m=s(0),h=s(0),_=s(!1),g=s(null),o=f(()=>{if(a.current!==null)cancelAnimationFrame(a.current);a.current=null},[]),v=f(()=>{u(),o(),h.current++,g.current=null,m.current=0,r.current="reading",b(!1)},[o,u]),T=f(()=>{if(e===null||r.current!=="following"||a.current!==null)return;if(e.scrollTop>=Math.max(0,e.scrollHeight-e.clientHeight))return;y.current=performance.now(),P.current=e.scrollTop,k.current=0;let l=(c)=>{if(a.current=null,r.current!=="following")return;let i=Math.max(0,e.scrollHeight-e.clientHeight),w=i-e.scrollTop;if(w<=0)return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||w<=1)e.scrollTop=i;else{let E=Math.max(0,c-y.current),H=e.scrollTop===P.current?k.current:0,L=e.scrollTop+H+(w-H)*(1-Math.exp(-E/z));e.scrollTop=L,P.current=e.scrollTop,k.current=L-e.scrollTop,a.current=requestAnimationFrame(l)}y.current=c,p.current=e.scrollTop};a.current=requestAnimationFrame(l)},[e]),d=f(()=>{u(),h.current++,g.current=null,m.current=0,r.current="following",b(!0),T()},[u,T]),B=f((l)=>{u(),o();let c=++h.current;return r.current="locating",_.current=l,g.current=null,m.current=0,b(l),{isCurrent:()=>h.current===c,finish:(i)=>{if(h.current!==c||e===null)return;e.scrollTo({top:i,behavior:"instant"}),p.current=e.scrollTop,r.current=l?"following":"reading"}}},[o,u,e]),x=f(()=>{if(h.current++,r.current==="locating")r.current=_.current?"following":"reading"},[]),G=f((l=null)=>{if(e===null)return;let c=g.current;if(c!==null&&e.scrollHeight!==c){if(g.current=null,e.scrollHeight<c&&e.scrollHeight-e.clientHeight-e.scrollTop<=S)d()}if(r.current==="following"&&l!==null)o(),e.scrollTo({top:l,behavior:"instant"}),p.current=e.scrollTop;else T()},[o,e,T,d]);return U(()=>{if(e===null)return;p.current=e.scrollTop,r.current=e.scrollHeight-e.clientHeight-e.scrollTop<=S?"following":"reading",b(r.current==="following");let l=!1,c=!1,i=null,w=e.closest('[data-slot="scroll-area"]'),F=w??e,E=(n)=>{if(g.current=null,(n<0||r.current==="locating")&&e.scrollHeight>e.clientHeight)v();else u();if(m.current=n,r.current==="reading"&&n>0&&e.scrollHeight-e.clientHeight-e.scrollTop<=1)d()},H=()=>{let n=e.scrollTop>p.current;p.current=e.scrollTop;let t=n&&m.current>0;if(m.current=0,l){c=n;return}if(r.current!=="reading"||!t)return;let M=D.current?q:S;if(e.scrollHeight-e.clientHeight-e.scrollTop<=M)d()},L=(n)=>{if(n.ctrlKey||n.deltaY===0)return;let t=n.target instanceof Element?n.target:null;while(t!==null&&t!==e){if(t.scrollHeight>t.clientHeight&&/auto|scroll/.test(getComputedStyle(t).overflowY)){if(n.deltaY<0?t.scrollTop>0:t.scrollTop+t.clientHeight<t.scrollHeight)return}t=t.parentElement}E(Math.sign(n.deltaY))},C=(n)=>{i=n.touches[0].clientY},O=(n)=>{let t=n.touches[0].clientY;if(i!==null&&t!==i)E(Math.sign(i-t));i=t},I=(n)=>{if(n.defaultPrevented||!(n.target instanceof Element))return;if(n.target.closest("input, textarea, select, button, a, [contenteditable='true']"))return;if(["ArrowUp","PageUp","Home"].includes(n.key)||n.key===" "&&n.shiftKey)E(-1);else if(["ArrowDown","PageDown","End"," "].includes(n.key))E(1)},N=(n)=>{let t=n.target instanceof Element?n.target.closest('[data-slot="scroll-area-scrollbar"][data-orientation="vertical"]'):null,M=t!==null&&t.closest('[data-slot="scroll-area"]')===w;if(l=(n.target===e||M)&&n.button===0&&e.scrollHeight>e.clientHeight,c=!1,l)v()},R=()=>{let n=D.current?q:S;if(l&&c&&e.scrollHeight-e.clientHeight-e.scrollTop<=n)d();l=!1},K=()=>{l=!1},W=(n)=>{if(!(n.target instanceof Element)||n.target.closest("[data-codex-disclosure]")===null)return;v(),g.current=e.scrollHeight};return e.addEventListener("scroll",H,{passive:!0}),e.addEventListener("wheel",L,{passive:!0}),e.addEventListener("touchstart",C,{passive:!0}),e.addEventListener("touchmove",O,{passive:!0}),e.addEventListener("keydown",I),F.addEventListener("pointerdown",N,{capture:!0}),window.addEventListener("pointerup",R),window.addEventListener("pointercancel",K),e.addEventListener("click",W,{capture:!0}),()=>{o(),x(),e.removeEventListener("scroll",H),e.removeEventListener("wheel",L),e.removeEventListener("touchstart",C),e.removeEventListener("touchmove",O),e.removeEventListener("keydown",I),F.removeEventListener("pointerdown",N,{capture:!0}),window.removeEventListener("pointerup",R),window.removeEventListener("pointercancel",K),e.removeEventListener("click",W,{capture:!0})}},[e,o,x,u,d,v]),{isFollowing:A,scrollToBottom:d,stopFollowing:v,schedulePin:T,contentResized:G,beginLocate:B,cancelLocation:x}}
|
|
2
|
+
export{oo};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ze}from"./chunk-cpk3y6ad.js";import{K,Zo}from"./chunk-zbtas7pt.js";import{t}from"./chunk-dp8pjv6r.js";import{Go}from"./chunk-7a6t282a.js";import{ye,be,we}from"./chunk-wb3zpzk3.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 Vo({active:a,sending:r,ready:p,hasMentions:m=!1,onStop:c}){let{t:e}=t(),s=ze(),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(K,{"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(ye,{children:[o(be,{render:o(Zo,{"aria-label":i,disabled:l,"aria-busy":r,status:r?"submitted":"ready"})}),n(we,{role:"tooltip",children:[o("span",{className:"min-w-0",children:i}),o(Go,{className:"shrink-0",children:f?"↩":"Enter"})]})]})})]})}
|
|
2
|
+
export{Vo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"./chunk-6kn920c5.js";import{Dialog as i}from"@base-ui/react/dialog";import{cn as r}from"cn";import{XIcon as g}from"lucide-react";import{jsx as a,jsxs as l}from"react/jsx-runtime";function d({...o}){return a(i.Root,{"data-slot":"dialog",...o})}function
|
|
1
|
+
import{e}from"./chunk-6kn920c5.js";import{Dialog as i}from"@base-ui/react/dialog";import{cn as r}from"cn";import{XIcon as g}from"lucide-react";import{jsx as a,jsxs as l}from"react/jsx-runtime";function d({...o}){return a(i.Root,{"data-slot":"dialog",...o})}function Ni({...o}){return a(i.Trigger,{"data-slot":"dialog-trigger",...o})}function $r({...o}){return a(i.Portal,{"data-slot":"dialog-portal",...o})}function rr({...o}){return a(i.Close,{"data-slot":"dialog-close",...o})}function qr({className:o,...t}){return a(i.Backdrop,{"data-slot":"dialog-overlay",className:r("data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs",o),...t})}function u({className:o,children:t,showCloseButton:n=!0,...s}){return l($r,{children:[a(qr,{}),l(i.Popup,{"data-slot":"dialog-content",className:r("bg-popover text-popover-foreground ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl p-6 text-sm ring-1 duration-100 outline-none sm:max-w-md",o),...s,children:[t,n&&l(i.Close,{"data-slot":"dialog-close",render:a(e,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm"}),children:[a(g,{}),a("span",{className:"sr-only",children:"Close"})]})]})]})}function b({className:o,...t}){return a("div",{"data-slot":"dialog-header",className:r("flex flex-col gap-2",o),...t})}function X({className:o,showCloseButton:t=!1,children:n,...s}){return l("div",{"data-slot":"dialog-footer",className:r("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",o),...s,children:[n,t&&a(i.Close,{render:a(e,{variant:"outline"}),children:"Close"})]})}function m({className:o,...t}){return a(i.Title,{"data-slot":"dialog-title",className:r("font-heading leading-none font-medium",o),...t})}function w({className:o,...t}){return a(i.Description,{"data-slot":"dialog-description",className:r("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",o),...t})}export{d,Ni,$r,rr,qr,u,b,X,m,w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Checkbox as i}from"@base-ui/react/checkbox";import{cn as o}from"cn";import{CheckIcon as t}from"lucide-react";import{jsx as e}from"react/jsx-runtime";function
|
|
1
|
+
import{Checkbox as i}from"@base-ui/react/checkbox";import{cn as o}from"cn";import{CheckIcon as t}from"lucide-react";import{jsx as e}from"react/jsx-runtime";function ue({className:r,...a}){return e(i.Root,{"data-slot":"checkbox",className:o("peer border-input group-has-[:focus-visible]/field-label:not-data-checked:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",r),...a,children:e(i.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:e(t,{})})})}export{ue};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var i=new Map,a=new Map,f=new Map;function
|
|
2
|
-
export{i,
|
|
1
|
+
var i=new Map,a=new Map,f=new Map;function ir(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 E(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 vt(t,r){f.set(t,r),r.finally(()=>{if(f.get(t)===r)f.delete(t)})}async function kr(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 Cr(t,r){if(r===null)i.delete(t);else i.set(t,r)}var s=new Map;function xt(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 Tr(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,ir,E,vt,kr,Cr,xt,Tr};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Eo(t,e){if(e===0)return null;let r=e-1;while(r>=0){let n=t[r];if(n===" "||n==="\t"||n===`
|
|
2
2
|
`)return null;if(n==="@"||n==="/"){let i=r===0?"":t[r-1],s=r===0||i===`
|
|
3
3
|
`;if(n==="/"?s&&!/[/\\]/.test(t.slice(r+1,e)):s||i===" "||i==="\t")return{kind:n==="/"?"slash":"at",start:r,end:e,query:t.slice(r+1,e)}}r-=1}return null}
|
|
4
|
-
export{
|
|
4
|
+
export{Eo};
|
|
@@ -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 Tt({className:e,...o}){return n("div",{"data-slot":"skeleton",className:t("bg-muted animate-pulse rounded-md",e),...o})}export{Tt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function
|
|
2
|
-
export{
|
|
1
|
+
import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function eo(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function Ht(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
|
|
2
|
+
export{eo,Ht};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{html as n}from"diff2html";import{ColorSchemeType as r}from"diff2html/lib/types";import{useMemo as s}from"react";import{jsx as a}from"react/jsx-runtime";function
|
|
1
|
+
import{html as n}from"diff2html";import{ColorSchemeType as r}from"diff2html/lib/types";import{useMemo as s}from"react";import{jsx as a}from"react/jsx-runtime";function An(e){let t=0,i=0;for(let o of e.split(`
|
|
2
2
|
`)){if(o.startsWith("+++")||o.startsWith("---"))continue;if(o.startsWith("+"))t+=1;else if(o.startsWith("-"))i+=1}return{additions:t,deletions:i}}function Ne({patch:e,theme:t}){let i=s(()=>n(e,{drawFileList:!1,outputFormat:"line-by-line",matching:"lines",colorScheme:t==="dark"?r.DARK:r.LIGHT}),[e,t]);return a("div",{className:"codex-patch-view",dangerouslySetInnerHTML:{__html:i}})}
|
|
3
|
-
export{
|
|
3
|
+
export{An,Ne};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{q,V}from"./chunk-cke0v0a7.js";import{e}from"./chunk-6kn920c5.js";import{d,u,b,X,m,w}from"./chunk-17zegmxa.js";import{l}from"./chunk-1hy64ewz.js";import{Nt,Mt,Rt,hn,Z}from"./chunk-hrsz92yq.js";import{ce}from"./chunk-xxkdv1zf.js";import{p,s,r}from"./chunk-5fgakrmr.js";import{le,U,L}from"./chunk-d84cxw1v.js";import{sessionGroup as _}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 f}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";function te({className:v,...n}){return i(hn,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...n,className:fe("max-w-(--available-width) min-w-0 p-1",v)})}function z(v){return v instanceof Error?v.message:String(v)}function Le({children:v}){return i("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i("div",{className:"flex flex-col gap-8",children:v})})}function ur({Scroll:v=Le}){let{t:n,i18n:B}=p(),g=s(),C=r((t)=>t.archivedSessions),A=r((t)=>t.connection),[H,se]=f(""),[k,ie]=f("all"),[x,re]=f("all"),[ne,ae]=f(0),[O,G]=f(!0),[F,K]=f(null),[Q,R]=f(null),[I,j]=f(!1),S=ye(!1),[P,y]=f(null),[W,T]=f(null),[oe,J]=f(!1);Se(()=>{if(A!=="ready")return;let t=!1;G(!0),K(null);async function h(){try{await g.listArchived({reset:!0});let o=new Set;while(!t&&g.state.archivedCursor!==null){let N=g.state.archivedCursor;if(o.has(N))throw Error("Archive pagination returned a repeated cursor");o.add(N),await g.listArchived()}}catch(o){if(!t)K(z(o))}finally{if(!t)G(!1)}}return h(),()=>{t=!0}},[g,A,ne]);let c=r((t)=>t.projectContext),E=!(c!==null&&A==="ready"&&!O&&F===null)||I,D=(t)=>t.title??n("sessionList.untitled"),de=[...new Set(C.filter((t)=>c&&_(c,t).id!==L).map((t)=>c?_(c,t).id:t.cwd))].toSorted(),ue=H.trim().toLocaleLowerCase(B.language),M=C.filter((t)=>{let h=c?_(c,t).id:null,o=h===L;return D(t).toLocaleLowerCase(B.language).includes(ue)&&(k==="all"||(k==="quick"?o:!o))&&(x==="all"||(x==="quick"?o:h===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 g.unarchive(t.sessionId)}catch(h){R(z(h))}finally{S.current=!1,j(!1)}}async function he(){if(S.current||!P)return;S.current=!0,j(!0),T(null);let t=[],h=[];try{for(let o of P){if(!g.state.archivedSessions.some((N)=>N.sessionId===o.sessionId))continue;try{await g.delete(o.sessionId)}catch(N){t.push(o),h.push(`${D(o)}: ${z(N)}`)}}if(t.length)y(t),T(h.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,{variant:"destructive",className:"text-[color-mix(in_oklab,var(--destructive)_80%,var(--foreground))]",disabled:E||C.length===0,onClick:()=>{T(null),J(!0),y([...C])},children:[i(ee,{"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(l,{"aria-label":n("sessionList.archives.search"),placeholder:n("sessionList.archives.search"),value:H,onChange:(t)=>se(t.target.value),className:"rounded-md ps-9"})]}),a(Nt,{value:k,onValueChange:(t)=>{if(t===null)throw Error("Archive chat type cannot be empty");ie(t)},children:[a(Rt,{"aria-label":n("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[i(ge,{"aria-hidden":"true"}),i(Mt,{children:n(`sessionList.archives.${k==="all"?"allChats":k==="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(Nt,{value:x,onValueChange:(t)=>{if(t===null)throw Error("Archive project filter cannot be empty");re(t)},children:[a(Rt,{"aria-label":n("sessionList.archives.project"),className:"w-48 rounded-md",children:[i(Y,{"aria-hidden":"true"}),i(Mt,{className:"truncate",children:x==="all"?n("sessionList.archives.allProjects"):x==="quick"?n("sessionList.archives.noProject"):U(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:U(t,c??void 0)},t))]})]})]}),a(v,{children:[A!=="ready"?i("p",{role:"status",className:"text-muted-foreground",children:n("sessionList.archives.connecting")}):O?a("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[i(ce,{}),n("sessionList.archives.loading")]}):F?i(q,{variant:"destructive",children:a(V,{className:"flex items-center justify-between gap-4",children:[i("span",{children:F}),i(e,{variant:"outline",onClick:()=>ae((t)=>t+1),children:n("sessionList.archives.retry")})]})}):C.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")})]}):M.length===0?i("p",{className:"text-muted-foreground py-12 text-center",children:n("sessionList.archives.noResults")}):(c?le(M,c):[]).filter(([,t])=>t.length>0).map(([t,h])=>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===L?void 0:t,children:[i(Y,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("span",{className:"truncate",children:t===L?n("sessionList.archives.noProject"):U(t,c??void 0)})]}),i("span",{className:"text-muted-foreground shrink-0 text-sm",children:n("sessionList.archives.count",{count:h.length})})]}),i("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:h.map((o)=>a("article",{"aria-label":D(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:D(o),children:D(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),J(!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)),Q&&i(q,{variant:"destructive",children:i(V,{children:Q})})]})]}),i(d,{open:P!==null,onOpenChange:(t)=>{if(!t&&!S.current)y(null)},children:a(u,{showCloseButton:!I,children:[a(b,{children:[i(m,{children:n("sessionList.archives.deleteTitle")}),i(w,{children:n(oe?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:P?.length??0})})]}),W&&i(q,{variant:"destructive",children:i(V,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:W})}),a(X,{children:[i(e,{variant:"outline",disabled:I,onClick:()=>y(null),children:n("sessionList.cancel")}),a(e,{variant:"destructive",className:"text-[color-mix(in_oklab,var(--destructive)_80%,var(--foreground))]",disabled:E,onClick:()=>void he(),children:[I&&i(ce,{}),n("sessionList.archives.confirmDelete")]})]})]})})]})}
|
|
3
|
+
export{ur};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e}from"./chunk-6kn920c5.js";import{ue}from"./chunk-1drkvxzk.js";import{d,u,b,X,m,w}from"./chunk-17zegmxa.js";import{f}from"./chunk-ek06eyp4.js";import{At,Lt,Mn,Rn,En,at}from"./chunk-7k0wvvy0.js";import{l}from"./chunk-1hy64ewz.js";import{j,I}from"./chunk-5m4605a3.js";import{$e}from"./chunk-ak0k5vg6.js";import{k}from"./chunk-ncekagm6.js";import{isArrayProperty as S,isBooleanProperty as A,isNumberProperty as C,isStringProperty as E}from"@nyssance/codex-acp-v2/client";import{useEffect as N,useMemo as V,useState as R}from"react";import{jsx as o,jsxs as p}from"react/jsx-runtime";function q(r){if(!E(r))return null;if(r.oneOf&&r.oneOf.length>0)return r.oneOf.map((t)=>({value:t.const,label:t.title??t.const,...t.description?{description:t.description}:{}}));if(r.enum&&r.enum.length>0)return r.enum.map((t)=>({value:t,label:t}));return null}function P(r){let t=r,n=t._meta?.alwith?.options;if(Array.isArray(n)&&Array.isArray(t.enum))return n.map((i)=>({value:i.const,label:i.title,...i.description?{description:i.description}:{}}));if(Array.isArray(t.enum))return t.enum.map((i)=>({value:String(i),label:String(i)}));if(Array.isArray(t.oneOf))return t.oneOf.map((i)=>({value:i.const,label:i.title,...i.description?{description:i.description}:{}}));return null}function Pr(r){let t=new Set(r.required??[]);return Object.entries(r.properties??{}).map(([n,i])=>({key:n,property:i,title:i.title??n,description:i.description??null,required:t.has(n),options:q(i),multiOptions:S(i)?P(i.items):null}))}function fr(r){let t={};for(let n of r){let i=n.property.default;if(i!==void 0&&i!==null)t[n.key]=i;else if(n.options)t[n.key]=n.options[0].value;else if(A(n.property))t[n.key]=!1;else if(S(n.property))t[n.key]=[]}return t}function Nr(r,t){if(r.multiOptions)return Array.isArray(t)&&t.length>0;if(!r.required)return!0;return t!==void 0&&t!==""&&!(Array.isArray(t)&&t.length===0)}function D({id:r,label:t,description:n,control:i}){return p("div",{className:"hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",children:[i,p(f,{htmlFor:r,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[o("div",{className:"text-foreground text-sm",children:t}),n&&o("div",{className:"text-muted-foreground text-xs",children:n})]})]})}function L({id:r,field:t,value:n,onChange:i}){if(t.multiOptions){let a=new Set(Array.isArray(n)?n:[]);return p(At,{children:[o(Lt,{variant:"label",children:t.title}),t.description&&o(at,{children:t.description}),o("div",{className:"flex flex-col gap-1",children:t.multiOptions.map((c)=>{let g=`${r}:${c.value}`;return o(D,{id:g,...c,control:o(ue,{id:g,checked:a.has(c.value),onCheckedChange:(F)=>{let y=new Set(a);if(F)y.add(c.value);else y.delete(c.value);i([...y])}})},c.value)})})]})}if(t.options)return p(At,{children:[o(Lt,{variant:"label",children:t.title}),t.description&&o(at,{children:t.description}),o(j,{value:typeof n==="string"?n:"",onValueChange:(a)=>i(String(a)),className:"flex flex-col gap-1",children:t.options.map((a)=>{let c=`${r}:${a.value}`;return o(D,{id:c,...a,control:o(I,{value:a.value,id:c})},a.value)})})]});return p(Rn,{children:[o(En,{htmlFor:r,children:t.title}),A(t.property)?o($e,{id:r,checked:n===!0,onCheckedChange:(a)=>i(a)}):C(t.property)?o(l,{id:r,type:"number",required:t.required,value:typeof n==="number"?n:"",onChange:(a)=>i(a.target.value===""?void 0:Number(a.target.value))}):o(k,{id:r,rows:2,required:t.required,value:typeof n==="string"?n:"",onChange:(a)=>i(a.target.value)}),t.description&&o(at,{children:t.description})]})}function bn({requestId:r,schema:t,message:n,total:i,t:a,onRespond:c}){let g=V(()=>Pr(t),[t]),[F,y]=R(()=>fr(g));N(()=>y(fr(g)),[r,g]);let x=g.every((s)=>Nr(s,F[s.key])),O=()=>{if(!x)return;let s={};for(let[h,v]of Object.entries(F))if(v!==void 0)s[h]=v;c({action:"accept",content:s})};return o(d,{open:!0,onOpenChange:(s)=>!s&&c({action:"cancel"}),children:p(u,{className:"flex max-h-[80vh] flex-col gap-4 sm:max-w-lg",onKeyDown:(s)=>{if(s.key==="Enter"&&(s.metaKey||s.ctrlKey))s.preventDefault(),O()},children:[p(b,{children:[p("div",{className:"flex items-center justify-between gap-2 pe-8",children:[o(m,{children:t.title??a("approval.needed")}),i>1&&o("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${i}`})]}),o(w,{children:n})]}),o("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o(Mn,{children:g.map((s)=>o(L,{id:`${r}:${s.key}`,field:s,value:F[s.key],onChange:(h)=>y((v)=>({...v,[s.key]:h}))},s.key))})}),p(X,{children:[o(e,{variant:"ghost",onClick:()=>c({action:"decline"}),children:a("actions.decline")}),o(e,{disabled:!x,onClick:O,children:a("actions.submit")})]})]})})}
|
|
2
|
+
export{Pr,fr,Nr,bn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function qn(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReply"in o))return null;let n=o.questionReply;if(!n||typeof n!=="object"||!("question"in n)||!("answer"in n))return null;return typeof n.question==="string"&&typeof n.answer==="string"?{question:n.question,answer:n.answer}:null}function Vn(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReplyParts"in o))return null;let n=o.questionReplyParts;if(!Array.isArray(n)||n.length===0)return null;let i=n;if(!i.every((e)=>!!e&&typeof e==="object"&&("text"in e)&&typeof e.text==="string"&&(!("question"in e)||e.question===void 0||typeof e.question==="string")))return null;return i.map((e)=>({text:e.text,...e.question===void 0?{}:{question:e.question}}))}
|
|
2
|
+
export{qn,Vn};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{Ft,Bt}from"./chunk-93x6b2qa.js";import{g}from"./chunk-5kpcpjrb.js";import{t}from"./chunk-dp8pjv6r.js";import{fo,G,Ee,vo}from"./chunk-m6rrt94g.js";import{io}from"./chunk-0d4xsx23.js";import{ee}from"./chunk-jhk2chpp.js";import{jt}from"./chunk-q905xt4v.js";import{uo}from"./chunk-r79zqx0t.js";import{So}from"./chunk-b4dsjhkq.js";import{Io}from"./chunk-m99k3e5h.js";import{Gt,Wt}from"./chunk-91x8etvh.js";import{Re}from"./chunk-c0ac9k7h.js";import{codexMessageError as J,codexTurnError as q,isContentEntry as oe,isEmbeddedResource as U,isImage as X,isResourceLink as ae,isText as me,nativeTurnId as le}from"@nyssance/codex-acp-v2/client";import{LoaderCircleIcon as de,SparklesIcon as ce}from"lucide-react";import{Fragment as ge,memo as pe}from"react";import{jsx as s,jsxs as m,Fragment as R}from"react/jsx-runtime";function D(r){if(X(r))return`${r.mimeType.toLowerCase()}:${r.data}`;if(U(r)&&"blob"in r.resource&&r.resource.mimeType?.toLowerCase().startsWith("image/"))return`${r.resource.mimeType.toLowerCase()}:${r.resource.blob}`;return null}function T({sessionId:r,entry:n,terminals:l,streaming:o,streamingThoughtId:w}){let{t:a}=t();switch(n.kind){case"activity":return s(io,{sessionId:r,items:n.items,terminals:l,streamingThoughtId:w});case"text":return g(n.item._meta).length>0?s(jt,{sessionId:r,item:n.item}):s(ee,{content:n.item.content,messageId:n.item.id,streaming:o});case"plan":return s(So,{plan:n.item.plan});case"compaction":if(n.item.status==="failed")return m(Gt,{children:[s("div",{children:a("timeline.compactionFailed")}),n.item.error!==null&&s("div",{children:n.item.error})]});return m("div",{className:"codex-context-compaction",children:[s(ce,{"aria-hidden":"true"}),s("span",{children:n.item.status==="completed"?a("stream.codex.contextCompacted"):n.item.status==="cancelled"?a("timeline.interrupted"):a("timeline.compacting")})]})}}function ue({sessionId:r,turn:n,terminals:l,active:o,blocked:w=!1,continued:a=!1,edits:S=n.edits,activityItems:_=n.items,workStartedAt:Y=n.startedAt,isLast:F,error:u,interrupted:M,retry:L,retrying:p,answerActions:W,footer:Z}){let{t:d}=t(),I=n.errors.map((e)=>{let i=J(e);if(i===null)throw Error("Turn error item is missing its diagnostics");let k=L?.turnId===le(e)?L:void 0;return s(Wt,{error:i,retry:k},`${e.id}:${k?.delaySeconds??"manual"}`)});if(F&&u!==null&&!n.errors.some((e)=>{let i=J(e);return i!==null&&i.stopReason===u.stopReason&&q(i).message===q(u).message}))I.push(s(Wt,{error:u},"current-run-error"));let v=I.length>0?s("div",{className:"codex-turn-errors",children:I}):null,f=n.work,y=f.length>0&&f.every((e)=>e.kind==="compaction");if(fo(n)||y&&n.final.length===0)return m(R,{children:[s("div",{role:"status",className:"text-muted-foreground flex min-w-0 flex-col gap-2 py-2 text-sm",children:n.work.map((e)=>s(T,{sessionId:r,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key))}),v]});let K=Ee(n),O=n.final.filter((e)=>g(e._meta).length===0).map(G).join(`
|
|
2
|
+
`),h=o?null:Re(n,"assistant"),P=n.items.filter((e)=>e.kind==="tool"&&e.name==="image_generation"&&(e.status==="pending"||e.status==="in_progress")),B=new Set(n.final.flatMap((e)=>e.content.map(D).filter((i)=>i!==null))),N=n.items.flatMap((e)=>{if(e.kind!=="tool"||e.status!=="completed")return[];return e.content.filter(oe).flatMap((i,k)=>{let c=i.content,ie=e.name==="image_generation"&&X(c),re=e.toolKind!=="read"&&e.toolKind!=="search"&&(ae(c)||U(c)&&("blob"in c.resource));if(!ie&&!re)return[];let b=D(c);if(b!==null){if(B.has(b))return[];B.add(b)}return[{key:`${e.id}:${k}`,block:c}]})}),A=n.final.some((e)=>g(e._meta).length===0&&e.content.some((i)=>!me(i)||i.text.trim().length>0)),te=P.length>0||N.length>0||y||A||n.final.some((e)=>g(e._meta).length>0),x=n.items.findIndex((e)=>n.final.includes(e)),C=(e)=>n.items.indexOf(e.kind==="activity"?e.items[0]:e.item),H=f.filter((e)=>x===-1||C(e)<x),ne=f.filter((e)=>x!==-1&&C(e)>x),se=[...n.final.map((e)=>({kind:"answer",item:e,index:n.items.indexOf(e)})),...ne.map((e)=>({kind:"work",entry:e,index:C(e)}))].toSorted((e,i)=>e.index-i.index),Q=!o&&!a&&(O.trim().length>0?s(Ft,{text:O,isMostRecentTurn:F,time:h,afterCopy:W}):m("div",{className:"flex items-center gap-0.5",children:[W,h&&s("span",{className:"codex-user-time ms-1",title:h.full,children:h.short})]})),E=Io({...n,items:_},{running:o,blocked:w,retrying:p!==void 0}),V=E.kind==="reasoning"?E.ownerKey??null:null,j=E.kind==="thinking",z=vo({...n,items:_});return m(R,{children:[s(Bt,{stateKey:JSON.stringify([r,n.replayed?"history":"live",n.key]),active:o&&!A,defaultExpanded:o&&!A||!n.replayed&&(M||K),...z,startedAt:z.startedAt??Y,loading:j&&n.work.length===0,work:a||y?[]:H.map((e)=>s(T,{sessionId:r,entry:e,terminals:l,streaming:o,streamingThoughtId:V},e.key)),answer:te||a?m("div",{className:"flex min-w-0 flex-col gap-3",children:[(a||y)&&H.map((e)=>s(T,{sessionId:r,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key)),se.map((e)=>{if(e.kind==="work")return s(T,{sessionId:r,entry:e.entry,terminals:l,streaming:o,streamingThoughtId:V},e.entry.key);let i=e.item;return m(ge,{children:[g(i._meta).length>0?s(jt,{sessionId:r,item:i}):s(ee,{content:i.content,messageId:i.id,streaming:o}),i===n.final.at(-1)&&Q]},i.id)}),P.map((e)=>m("div",{className:"codex-image-generation",role:"status","aria-label":d(o?"timeline.imageGenerating":"timeline.imageStopped"),"aria-busy":o,children:[s("div",{className:"codex-image-generation-texture","aria-hidden":"true"}),m("span",{className:"codex-image-generation-status",children:[o&&s(de,{className:"size-4 motion-safe:animate-spin","aria-hidden":"true"}),d(o?"timeline.imageGenerating":"timeline.imageStopped")]})]},e.id)),N.length>0&&s("div",{className:"codex-reply-artifacts flex min-w-0 flex-col gap-3",children:N.map((e)=>s(ee,{content:[e.block],messageId:e.key,streaming:!1},e.key))}),n.final.length===0&&Q]}):null,footer:m(R,{children:[j&&n.work.length>0&&s("div",{className:"codex-pending-message py-2",role:"status",children:s("span",{className:"codex-activity-running",children:d("message.thinking")})}),Z,S.length>0&&!o&&!a&&s(uo,{items:S}),M&&!K&&s("div",{className:"codex-interrupted-turn",role:"status",children:d("timeline.interrupted")}),!o&&v]})}),o&&p!==void 0&&s("div",{className:"text-muted-foreground py-2 text-sm",role:"status",children:p.capacity?(()=>{let e=/Reconnecting(?:\.\.\.)?\s+(\d+\/\d+)/.exec(p.message)?.[1];return e===void 0?d("timeline.capacityReconnecting"):d("timeline.capacityReconnectingProgress",{progress:e})})():p.message}),o&&v]})}var ro=pe(ue);
|
|
3
|
+
export{ro};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{K}from"./chunk-zbtas7pt.js";import{t}from"./chunk-dp8pjv6r.js";import{SquareSlashIcon as s}from"lucide-react";import{useRef as l}from"react";import{jsx as r}from"react/jsx-runtime";function Wo({textareaRef:a,onOpenChange:p,menuOpen:e,disabled:m}){let{t:o}=t(),n=l(!1);return r(K,{"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
|
+
export{Wo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Qn}from"./chunk-znx2e9e7.js";import{useCallback as xe,useEffect as P,useLayoutEffect as ye,useMemo as X,useRef as I,useState as E}from"react";import"@alwith/module-chat/navigation-rail.css";import{jsx as T,jsxs as Ne,Fragment as ke}from"react/jsx-runtime";var Se=4,ge=10;function we(h,x){let v=new Map(x.flatMap((c)=>c.itemIds.map((S)=>[S,c.key]))),p=Array(h.length),C;for(let c=h.length-1;c>=0;c--)C=v.get(h[c])??C,p[c]=C;let A=Math.max(-1,...x.map((c)=>c.key))+1,B=new Set,n=[];for(let[c,S]of h.entries()){let w=v.get(S),m=n.at(-1);if(!m||w!==void 0&&w!==m.key||w===void 0&&m.itemIds.length>=64&&p[c]!==m.key){let y=w!==void 0&&!B.has(w)?w:A++;m={key:y,startIndex:c,itemIds:[]},n.push(m),B.add(y)}m.itemIds.push(S)}return n}function fe(h,x){if(h.size!==x.size)return!1;for(let v of h)if(!x.has(v))return!1;return!0}function Kn({audio:h,beforeReveal:x,ensureItemMounted:v,items:p,onPreviewItem:C,renderPreview:A,onRevealError:B,scrollRoot:n,targetTopMarginPx:c=16}){let[S,w]=E(()=>{let e=p.at(-1);return new Set(e===void 0?[]:[e.id])}),[m,y]=E(null),[_,O]=E(null),[Z,R]=E(!1),[j,pe]=E(()=>new Set),[ve,be]=E(!0),[Ie,F]=E(null),{installUnlock:ee,preload:te,playSequence:ne}=h,K=I(null),M=I(null),U=I(!1),H=I(null),L=I(0),G=I(null),k=I(null),V=I(new Set),z=X(()=>p.map((e)=>e.id).join("\x00"),[p]),J=I(p);J.current=p;let ie=I(j),re=I(S),se=I({itemIdsKey:z,scrollRoot:n});if(se.current.scrollRoot!==n)L.current+=1,se.current={itemIdsKey:z,scrollRoot:n};let g=X(()=>v===void 0?p.filter((e)=>j.has(e.id)):p,[v,p,j]),ae=X(()=>g.map((e)=>({inputTokens:e.inputTokens,outputTokens:e.outputTokens})),[g]),D=I({ids:"",groups:[]}),oe=g.map((e)=>e.id).join("\x00");if(D.current.ids!==oe)D.current={ids:oe,groups:we(g.map((e)=>e.id),D.current.groups)};P(()=>ee(),[ee]),P(()=>()=>{if(L.current+=1,G.current?.cancel(),k.current!==null)clearTimeout(k.current)},[]),P(()=>{y(null),R(!1),O(null),M.current=null,U.current=!1,H.current=null,F(null),V.current.clear()},[n]),P(()=>{te()},[te]),P(()=>{if(n===null)return;let e=new Set,t=new Map,i=new Set(J.current.map((s)=>s.id)),r=()=>{let s=new Set(t.values()),d=J.current.filter((f)=>s.has(f.id)).map((f)=>f.id),o=d.findIndex((f)=>e.has(f));if(o===-1)return;let b=o;for(let f=o+1;f<d.length;f++)if(e.has(d[f]))b=f;let N=new Set(d.slice(o,b+1));if(fe(re.current,N))return;re.current=N,w(N)},a=new IntersectionObserver((s)=>{for(let d of s){let o=t.get(d.target);if(d.isIntersecting)e.add(o);else e.delete(o)}r()},{root:n,rootMargin:`-${c}px 0px 0px 0px`}),u=()=>{let s=new Set,d=new Set;for(let o of n.querySelectorAll("[data-content-search-unit-key]")){let b=o.dataset.contentSearchUnitKey;if(b===void 0||!i.has(b)||s.has(b))continue;s.add(b);let N=o.closest("[data-turn-key]"),f=N===null||d.has(N)?o:N;if(d.add(f),t.has(f))continue;t.set(f,b),a.observe(f)}for(let o of t.keys()){if(d.has(o))continue;a.unobserve(o),e.delete(t.get(o)),t.delete(o)}if(r(),fe(ie.current,s))return;ie.current=s,pe(s)};u();let l=new MutationObserver((s)=>{if(s.some((o)=>[...o.addedNodes,...o.removedNodes].some((b)=>b instanceof Element&&(b.matches("[data-turn-key], [data-content-search-unit-key]")||b.querySelector("[data-turn-key], [data-content-search-unit-key]")!==null))))u()});return l.observe(n,{childList:!0,subtree:!0}),()=>{l.disconnect(),a.disconnect()}},[z,n,c]);let Y=g.find((e)=>S.has(e.id))?.id??g.at(-1)?.id;ye(()=>{let e=K.current;if(e===null||M.current!==null||Y===void 0)return;let t=e.querySelector(`[data-timeline-user-message-navigation-item-id="${CSS.escape(Y)}"]`);if(t===null)return;let i=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(r.top<i.top)e.scrollTop+=r.top-i.top;else if(r.bottom>i.bottom)e.scrollTop+=r.bottom-i.bottom+1},[Y,z]),P(()=>{let e=n?.querySelector("[data-timeline-user-message-navigation-content]");if(!n||!e)return;let t=()=>{let r=n.getBoundingClientRect(),a=e.getBoundingClientRect();if(r.width===0||a.width===0)return;let u=n.offsetWidth>0?r.width/n.offsetWidth:1;be((a.left-r.left)/u>=48)},i=new ResizeObserver(t);return i.observe(n),i.observe(e),t(),()=>i.disconnect()},[n]);let he=xe(async(e,t="smooth")=>{if(n===null)throw Error("Thread user-message navigation scroll root is missing");let i=L.current+1;L.current=i,x();let r=()=>n.querySelector(`[data-content-search-unit-key="${CSS.escape(e.id)}"]`),a=r(),u=a!==null&&n.clientHeight>0&&a.closest("[data-turn-key]")!==null&&Math.abs(a.getBoundingClientRect().top-n.getBoundingClientRect().top)>n.clientHeight*2;if((a===null||u)&&v!==void 0){if(t==="instant"&&e.isLoaded===!1)return;a=await v(e,()=>L.current===i)??r(),t="instant"}if(L.current!==i)return;if(a===null)return;let l=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;a.scrollIntoView({behavior:l?"instant":t,block:"start"});let s=a.querySelector("[data-user-message-bubble], [data-composer-attachment-pill]");if(G.current?.cancel(),G.current=null,s===null)return;let d=getComputedStyle(s).backgroundColor,o=`color-mix(in srgb, var(--foreground) 14%, ${d})`;G.current=s.animate?.([{backgroundColor:o},{backgroundColor:o,offset:0.35},{backgroundColor:d}],{duration:l?0:1000,easing:"cubic-bezier(0.23, 1, 0.32, 1)"})??null},[x,v,n]);if(g.length<Se||!ve)return null;let Q=()=>{if(k.current!==null)clearTimeout(k.current);k.current=null},ue=(e,t=!1)=>{if(Q(),C===void 0||e.isLoaded!==!1||V.current.has(e.turnKey))return;let i=()=>{k.current=null,V.current.add(e.turnKey),C(e).catch(()=>V.current.delete(e.turnKey))};if(t)i();else k.current=setTimeout(i,150)},q=m===null?null:g.find((e)=>e.id===m.item.id)??g.find((e)=>e.nativeTurnId!==void 0&&e.nativeTurnId===m.item.nativeTurnId)??m.item,le=(e,t="smooth")=>{he(e,t).catch((i)=>{if(B)B(i);else throw i})},de=g.findIndex((e)=>e.id===(_??Ie)),ce=K.current,Te=m===null||!ce?.contains(m.button)?0:Me(ce,m.button),me=(e)=>{let t=e?.closest("[data-timeline-user-message-navigation-item-id]"),i=K.current;if(t===void 0||t===null||!i.contains(t))return null;let r=t.dataset.timelineUserMessageNavigationItemId,a=g.findIndex((u)=>u.id===r);return{button:t,item:g[a],index:a}},W=(e)=>{let t=M.current;if(t?.pointerId!==e.pointerId)return;if(M.current=null,O(null),t.captureTarget.hasPointerCapture(e.pointerId))t.captureTarget.releasePointerCapture(e.pointerId)};return T("nav",{"aria-label":"User messages",className:"timeline-user-message-navigation absolute start-4 top-1/2 z-20 -translate-y-1/2",children:T(Qn,{open:Z,onOpenChange:R,side:"inline-end",sideOffset:0,align:"center",alignOffset:Te,trigger:T("div",{ref:K,"data-timeline-user-message-navigation-rail-list":!0,"data-scrubbing":_===null?void 0:"",className:"timeline-user-message-navigation-rail-list",onPointerEnter:()=>{H.current=null},onPointerDown:(e)=>{if(e.button!==0)return;Q();let t=me(e.target instanceof Element?e.target:null);if(t===null)return;U.current=!1,M.current={pointerId:e.pointerId,itemId:t.item.id,itemIndex:t.index,captureTarget:t.button},t.button.setPointerCapture(e.pointerId),O(t.item.id),y(t),R(!0)},onPointerMove:(e)=>{let t=M.current;if(t===null){let l=me(e.target instanceof Element?e.target:null);if(l!==null){F(l.item.id);let s=H.current;if(s!==null&&s!==l.index)ne(s,l.index,ae);H.current=l.index,y((d)=>d?.item.id===l.item.id?d:l),ue(l.item)}return}if(t.pointerId!==e.pointerId)return;if((e.buttons&1)===0){W(e);return}let i=e.currentTarget.getBoundingClientRect(),r=Math.max(0,Math.min(g.length-1,Math.floor((e.clientY-i.top+e.currentTarget.scrollTop)/ge))),u={button:e.currentTarget.querySelectorAll("[data-timeline-user-message-navigation-item-id]")[r],item:g[r],index:r};if(u.item.id===t.itemId)return;ne(t.itemIndex,u.index,ae),H.current=u.index,M.current={...t,itemId:u.item.id,itemIndex:u.index},U.current=!0,O(u.item.id),y(u),le(u.item,"instant")},onPointerUp:W,onPointerCancel:W,onLostPointerCapture:W,onPointerLeave:()=>{if(Q(),F(null),H.current=null,M.current===null&&!Z)y(null)},children:T("div",{className:"flex flex-col",children:D.current.groups.map((e)=>T("div",{className:"flex w-9 shrink-0 flex-col [content-visibility:auto]",style:{height:e.itemIds.length*ge},children:g.slice(e.startIndex,e.startIndex+e.itemIds.length).map((t,i)=>{let r=e.startIndex+i,a=Math.abs(r-de),u=de===-1||a>3?void 0:[1,0.7,0.4,0.2][a];return T("button",{type:"button","data-timeline-user-message-navigation-item-id":t.id,"data-scrub-target":_===t.id?"":void 0,"aria-current":S.has(t.id)?"true":void 0,"aria-label":`Jump to user message ${r+1}`,className:"timeline-user-message-navigation-row",onClick:(l)=>{if(U.current){U.current=!1;return}let s={button:l.currentTarget,item:t,index:r};y(s),R(!0),le(t)},onFocus:(l)=>{ue(t,!0),y({button:l.currentTarget,item:t,index:r}),R(!0)},children:T("span",{className:"flex h-0.5 w-[30px] items-center",children:T("span",{className:"timeline-user-message-navigation-marker",style:u===void 0?void 0:{"--marker-progress":u}})})},t.id)})},e.key))})}),children:q!==null&&T("div",{className:"bg-popover/95 text-popover-foreground ring-border w-80 max-w-[calc(100vw-1rem)] overflow-hidden rounded-xl p-2 text-sm leading-5 shadow-xl ring-[0.5px] backdrop-blur-sm",children:A?A(q):Ne(ke,{children:[T("div",{className:"min-w-0 truncate font-medium",children:q.label}),q.response.length>0&&T("div",{className:"text-muted-foreground mt-1 line-clamp-3",children:q.response})]})})})})}function Me(h,x){let v=h.getBoundingClientRect(),p=x.getBoundingClientRect();return p.top+p.height/2-(v.top+v.height/2)}
|
|
2
|
+
export{Kn};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
`).length}function Or(e){let l=new Map;for(let u of e)for(let d of u.content){if(d.type!=="diff")continue;let f=d,r=f._meta?.alwith?.hunks??[],h=r.reduce((o,i)=>o+x(i.newText),0),c=r.reduce((o,i)=>o+x(i.oldText),0);for(let o of f.changes){let i=l.get(o.path);if(i)i.additions+=h,i.deletions+=c;else l.set(o.path,{path:o.path,additions:h,deletions:c})}}return[...l.values()]}function
|
|
3
|
-
export{Or,
|
|
1
|
+
import{a}from"./chunk-ryz4c13z.js";import{ChevronDownIcon as v,ChevronUpIcon as b,FileDiffIcon as C}from"lucide-react";import{useState as m}from"react";import{jsx as s,jsxs as n}from"react/jsx-runtime";function x(e){if(e===null||e.length===0)return 0;return e.split(`
|
|
2
|
+
`).length}function Or(e){let l=new Map;for(let u of e)for(let d of u.content){if(d.type!=="diff")continue;let f=d,r=f._meta?.alwith?.hunks??[],h=r.reduce((o,i)=>o+x(i.newText),0),c=r.reduce((o,i)=>o+x(i.oldText),0);for(let o of f.changes){let i=l.get(o.path);if(i)i.additions+=h,i.deletions+=c;else l.set(o.path,{path:o.path,additions:h,deletions:c})}}return[...l.values()]}function mo({blocks:e}){return s(Ut,{files:Or(e)})}function Ut({files:e,onOpen:l,renderPath:u}){let{t:d,openLink:f}=a(),[r,h]=m(!0),[c,o]=m(!1);if(e.length===0)return null;let i=e.reduce((t,p)=>t+p.additions,0),g=e.reduce((t,p)=>t+p.deletions,0);return n("section",{className:"codex-edited-files-card",children:[n("div",{className:"codex-edited-files-header",children:[s("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:s(C,{})}),n("div",{className:"codex-edited-files-summary",children:[s("strong",{children:d("stream.codex.editedFilesCount",{count:e.length})}),s("button",{type:"button","data-codex-disclosure":"",onClick:()=>{h((t)=>!t),o(!1)},"aria-expanded":r,children:d(r?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),n("div",{className:"codex-edited-files-total",title:d("stream.codex.changedLines"),children:[n("span",{className:"codex-diff-additions",children:["+",i]}),n("span",{className:"codex-diff-deletions",children:["-",g]})]})]}),r&&n("div",{className:"codex-edited-files-list",children:[(c?e:e.slice(0,3)).map((t)=>n("div",{className:"codex-edited-file-row",children:[s("button",{type:"button",className:"codex-edited-file-path",title:t.path,onClick:()=>l===void 0?f(t.path):l(t),children:u===void 0?t.path:u(t)}),n("span",{className:"codex-edited-file-counts",children:[n("span",{className:"codex-diff-additions",children:["+",t.additions]}),n("span",{className:"codex-diff-deletions",children:["-",t.deletions]})]})]},t.path)),e.length>3&&n("button",{type:"button",className:"codex-edited-files-more","aria-expanded":c,onClick:()=>o((t)=>!t),children:[d(c?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),c?s(b,{size:16,"aria-hidden":"true"}):s(v,{size:16,"aria-hidden":"true"})]})]})]})}
|
|
3
|
+
export{Or,mo,Ut};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useCallback as r,useState as x}from"react";var t=new Map;function S(o,e,k=!1){let[p,d]=x(()=>({key:o,expanded:t.get(o)??e})),n=p.expanded;if(p.key!==o||k&&!t.has(o)&&n!==e)n=t.get(o)??e,d({key:o,expanded:n});let b=r((c)=>{d((s)=>{let f=s.key===o?s.expanded:t.get(o)??e,a=typeof c==="function"?c(f):c;return t.set(o,a),s.key===o?{key:o,expanded:a}:s})},[o,e]);return[n,b]}
|
|
2
|
+
export{S};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o}from"./chunk-dp8pjv6r.js";import{Ae,Le,De}from"./chunk-b65vdzz3.js";import{n}from"./chunk-ysc51tpb.js";import{x,ne}from"./chunk-bhze2sjv.js";import{hasAccount as M,isGroupedSelect as L}from"@nyssance/codex-acp-v2/client";import{cn as H}from"cn";import{useEffect as W,useState as T}from"react";import{jsx as r,jsxs as u}from"react/jsx-runtime";var m=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),F=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),z=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function f(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function O(a,t){let e=Math.min(100,a/t*100),p=e>=90?"text-destructive":e>=70?"text-foreground":"text-muted-foreground";return{pct:e,className:p}}function A(a){let t=x(a.configOptions,"model");return t===void 0?void 0:ne(t)}function Oo(a,t){let e=a.windowDurationMins;if(e===null)return t("usage.usage");if(e%1440===0)return t("usage.windowDays",{count:e/1440});return t("usage.windowHours",{count:Math.round(e/60)})}function I(a){let{client:t}=n(),e=o((s)=>a&&s.connection==="ready"&&M(s.agent)),[p,l]=T(null);return W(()=>{if(!e){l(null);return}let s=!0;t.readRateLimits().then((d)=>{if(s)l(d)},()=>{return});let c=t.onRateLimits((d)=>{if(s)l(d)});return()=>{s=!1,c()}},[e,t]),e?p:null}function dt({session:a}){let{t}=n().host,e=x(a.configOptions,"model"),p=e!==void 0&&(L(e.options)?e.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((y)=>y.value===e.currentValue)):!e.currentValue.startsWith("gateway:")&&e.options.some((i)=>i.value===e.currentValue)),l=I(p),{usage:s,lastTurnUsage:c}=a;if(s===null&&c===null)return null;let d=s&&s.size>0?O(s.used,s.size):null,h=7,b=2*Math.PI*h,N=f(c?.inputTokens),k=f(c?.outputTokens),g=f(c?.cachedReadTokens),w=f(c?.cachedWriteTokens),S=f(c?.totalTokens)||N+k+g+w,R=N+g,C=R>0?F.format(g/R):t("tokens.notAvailable"),D=[[t("tokens.input"),m.format(N)],[t("tokens.output"),m.format(k)],[t("tokens.cachedRead"),m.format(g)],[t("tokens.cachedWrite"),m.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),m.format(S)]],v=A(a);return u(Ae,{children:[r(Le,{delay:100,closeDelay:100,render:u("button",{type:"button",className:H("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",d?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),d!==null&&r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-d.pct/100),transform:"rotate(-90 9 9)"})]}),d!==null&&u("span",{children:[Math.round(d.pct),"%"]})]})}),u(De,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[v!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:v,children:v})}),u("div",{className:"flex flex-col gap-3 p-3",children:[c!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:D.map(([i,y])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:y})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:m.format(s.used),limit:m.format(s.size),percent:z.format(s.used/s.size*100)})})]}),l!==null&&(l.primary!==null||l.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[l.primary,l.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:Oo(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}
|
|
2
|
+
export{Oo,dt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e}from"./chunk-6kn920c5.js";import{d,u,b,X,m,w}from"./chunk-17zegmxa.js";import{J}from"./chunk-m8djwdd5.js";import{createContext as g,useContext as C,useState as y,useSyncExternalStore as L}from"react";import{jsx as i,jsxs as S}from"react/jsx-runtime";var v=g(null),f=g(null),x=g(null);function pr({host:t,client:o,children:n}){let[l,a]=y(null);J(l!==null);let{t:c}=t;return i(v,{value:t,children:i(f,{value:o,children:S(x,{value:a,children:[n,i(d,{open:l!==null,onOpenChange:(D)=>!D&&a(null),children:S(u,{children:[S(b,{children:[i(m,{children:c("sessionList.deleteTitle")}),i(w,{children:c("sessionList.deleteDescription")})]}),S(X,{children:[i(e,{variant:"outline",onClick:()=>a(null),children:c("sessionList.cancel")}),i(e,{onClick:()=>{if(l)T(t,o.delete(l.sessionId));a(null)},children:c("sessionList.delete")})]})]})})]})})})}function p(){let t=C(v);if(t===null)throw Error("Session list host is missing");return t}function s(){let t=C(f);if(t===null)throw Error("Session list client is missing");return t}function tt(){let t=C(x);if(t===null)throw Error("Session list provider is missing");return t}function r(t){let o=s();return L((n)=>o.store.subscribe(n),()=>t(o.store.getState()),()=>t(o.store.getState()))}function T(t,o){return o.then(()=>{},(n)=>{if(t.reportError)t.reportError(n);else console.error(n)})}
|
|
2
|
+
export{pr,p,s,tt,r,T};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e}from"./chunk-6kn920c5.js";import{
|
|
1
|
+
import{e}from"./chunk-6kn920c5.js";import{Q}from"./chunk-ksv9pjc2.js";import{Zt}from"./chunk-knsf6jm1.js";import{Eo}from"./chunk-294gms5s.js";import{ze}from"./chunk-cpk3y6ad.js";import{autoUpdate as rt}from"@floating-ui/dom";import{cn as X}from"cn";import{BookOpenTextIcon as st,FileIcon as it,StoreIcon as lt}from"lucide-react";import{useCallback as ut,useEffect as v,useLayoutEffect as Y,useMemo as Z,useRef as _,useState as g}from"react";import{createPortal as at}from"react-dom";import{jsx as p,jsxs as E,Fragment as ct}from"react/jsx-runtime";function Ro({handleRef:a,anchorRef:c,commands:C,searchFiles:u,onMention:R,onSearchError:H,fileSearchDebounceMs:M=0,bashMode:A=!1,forcedOpen:i=!1,onForcedOpenChange:f,emptyLabel:F,fileStatusLabels:h,morePlugins:D}){let j=ze(),l=j.textInput.value,[z,K]=g(0),[y,P]=g(null),[b,L]=g(0),U=_(null);v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=()=>K(t.selectionStart??0),o=()=>{if(document.activeElement===t)n()};return t.addEventListener("keyup",n),t.addEventListener("click",n),t.addEventListener("input",n),t.addEventListener("select",n),t.addEventListener("focus",n),document.addEventListener("selectionchange",o),()=>{t.removeEventListener("keyup",n),t.removeEventListener("click",n),t.removeEventListener("input",n),t.removeEventListener("select",n),t.removeEventListener("focus",n),document.removeEventListener("selectionchange",o)}});let V=Z(()=>A&&l.startsWith("!")?null:Eo(l,z),[l,z,A]),r=V?.kind==="at"&&!u?null:V,q=`${r?.kind??"forced"}:${r?.query??""}:${i}`,[O,tt]=g(q);if(O!==q)tt(q),L(0);let I=_(null);v(()=>{if(!i){I.current=null;return}if(I.current===null)I.current=l;else if(l!==I.current)f?.(!1)},[i,l,f]);let x=r?.kind==="at"?r.query:null;v(()=>{if(x===null||!u){P(null);return}let t=!0,n=()=>{u(x).then((s)=>{if(t)P({query:x,search:u,items:s})},(s)=>{if(t)P({query:x,search:u,items:[]}),H(s)})},o=M>0?window.setTimeout(n,M):null;if(o===null)n();return()=>{if(t=!1,o!==null)window.clearTimeout(o)}},[x,u,M,H]);let d=Z(()=>{if(r?.kind==="at")return y?.query===r.query&&y.search===u?y.items:[];if(r)return Zt(C,r.query);if(i)return Zt(C,"");return[]},[r,i,C,y,u]),[et,N]=g(!1);v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=()=>N(!0),o=()=>{if(N(!1),i)f?.(!1)};return N(document.activeElement===t),t.addEventListener("focus",n),t.addEventListener("blur",o),()=>{t.removeEventListener("focus",n),t.removeEventListener("blur",o)}},[a,i,f]),v(()=>{if(i)a.current?.getTextarea()?.focus()},[i,a]);let m=et&&(r!==null?r.kind==="slash"||d.length>0||!!h:i);v(()=>{if(!m)return;U.current?.querySelector(`[data-idx="${b}"]`)?.scrollIntoView({block:"nearest"})},[b,m]);function W(t){let n=a.current?.getTextarea();if(!n)return;let o,s;if(r){let B=r.kind==="slash"?`/${t.payload} `:`@${t.label} `;if(o=l.slice(0,r.start)+B+l.slice(r.end),r.kind==="at")R?.(t.payload);s=r.start+B.length}else if(i)o=`${l.length===0||l.endsWith(`
|
|
2
2
|
`)?l:`${l}
|
|
3
|
-
`}/${t.payload} `,s=o.length,f?.(!1);else return;j.textInput.setInput(o),requestAnimationFrame(()=>{n.focus(),n.setSelectionRange(s,s)})}v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=(o)=>{if(!m)return;if(a.current?.isComposing()||o.isComposing||o.keyCode===229)return;if(o.key==="ArrowDown")o.preventDefault(),o.stopPropagation(),L((s)=>d.length===0?0:Math.min(d.length-1,s+1));else if(o.key==="ArrowUp")o.preventDefault(),o.stopPropagation(),L((s)=>Math.max(0,s-1));else if(o.key==="Enter"||o.key==="Tab"){o.preventDefault(),o.stopPropagation();let s=d[b];if(s)W(s)}else if(o.key==="Escape")if(o.preventDefault(),o.stopPropagation(),r)K(Math.max(0,r.start-1)),t.setSelectionRange(r.start,r.start);else f?.(!1)};return t.addEventListener("keydown",n,!0),()=>t.removeEventListener("keydown",n,!0)});let[k,
|
|
4
|
-
export{
|
|
3
|
+
`}/${t.payload} `,s=o.length,f?.(!1);else return;j.textInput.setInput(o),requestAnimationFrame(()=>{n.focus(),n.setSelectionRange(s,s)})}v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=(o)=>{if(!m)return;if(a.current?.isComposing()||o.isComposing||o.keyCode===229)return;if(o.key==="ArrowDown")o.preventDefault(),o.stopPropagation(),L((s)=>d.length===0?0:Math.min(d.length-1,s+1));else if(o.key==="ArrowUp")o.preventDefault(),o.stopPropagation(),L((s)=>Math.max(0,s-1));else if(o.key==="Enter"||o.key==="Tab"){o.preventDefault(),o.stopPropagation();let s=d[b];if(s)W(s)}else if(o.key==="Escape")if(o.preventDefault(),o.stopPropagation(),r)K(Math.max(0,r.start-1)),t.setSelectionRange(r.start,r.start);else f?.(!1)};return t.addEventListener("keydown",n,!0),()=>t.removeEventListener("keydown",n,!0)});let[k,G]=g(null),[S,nt]=g(null),T=ut(()=>{let t=c?.current;if(!t)return;let n=t.getBoundingClientRect();G({left:n.left,width:n.width,bottom:window.innerHeight-n.top+8})},[c]);if(Y(()=>{if(!m){G(null);return}T()},[m,T]),Y(()=>{let t=c?.current;if(!m||!t||!S)return;return rt(t,S,T,{animationFrame:!0})},[m,S,c,T]),!m||c&&!k)return null;let w=r?r.kind==="slash":i,ot=w?st:it,J=p("div",{ref:nt,className:c?"fixed z-50":"absolute inset-x-0 bottom-full z-50 mb-2",style:c&&k?{left:k.left,width:k.width,bottom:k.bottom}:void 0,children:E("div",{ref:U,role:"listbox",onMouseDown:(t)=>t.preventDefault(),className:"bg-popover text-popover-foreground ring-foreground/10 pointer-events-auto w-full overflow-hidden rounded-lg p-1 shadow-md ring-1 outline-hidden",children:[E("div",{className:"max-h-72 overflow-y-auto",children:[d.length===0&&w&&p("div",{className:"text-muted-foreground px-2 py-3 text-xs",children:F}),d.length===0&&!w&&h&&p("div",{role:"status",className:"text-muted-foreground px-2 py-3 text-xs",children:y?.query===x&&y.search===u?h.empty:h.loading}),d.map((t,n)=>E(e,{type:"button",variant:"ghost",role:"option","aria-selected":n===b,"data-idx":n,onMouseDown:(o)=>{o.preventDefault(),W(t)},onMouseEnter:()=>L(n),className:X("flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-2.5 py-2 text-start",n===b&&"bg-muted"),children:[p(ot,{className:X("size-4 shrink-0",w?"text-blue-500":"text-muted-foreground")}),p("span",{className:"text-foreground shrink-0 text-sm font-medium",children:t.label}),t.description&&p("span",{className:"text-muted-foreground min-w-0 flex-1 truncate text-xs",children:t.description})]},t.key))]}),w&&D&&E(ct,{children:[p(Q,{}),E(e,{type:"button",variant:"ghost",onMouseDown:(t)=>{t.preventDefault(),f?.(!1),D.open()},className:"h-auto w-full justify-start px-2.5 py-2",children:[p(lt,{"data-icon":"inline-start"}),D.label]})]})]})});return c?at(J,document.body):J}
|
|
4
|
+
export{Ro};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{e}from"./chunk-6kn920c5.js";import{f}from"./chunk-ek06eyp4.js";import{j,I}from"./chunk-5m4605a3.js";import{k}from"./chunk-ncekagm6.js";import{useId as Q}from"react";import{jsx as r,jsxs as p,Fragment as h}from"react/jsx-runtime";function a(n){return n!==null&&typeof n==="object"&&!Array.isArray(n)}function g(n){if(!a(n)||!a(n.codex))return[];let s=n.codex,i=s.questions;if(s.delivery!=="async"||!Array.isArray(i))return[];if(!i.every((t)=>a(t)&&typeof t.title==="string"&&t.title.trim().length>0&&(t.options===null||Array.isArray(t.options)&&t.options.every((l)=>typeof l==="string"))))return[];return i}function Kt(n,s){return JSON.stringify(["request_user_input_async",n,s])}function wo(n){return{selected:n.options?.length?0:null,text:""}}function Qt(n,s){return s.selected===null?s.text:n.options?.[s.selected]??""}function ko(n){return`<send_user_message_question_reply>
|
|
2
|
+
${JSON.stringify([n])}
|
|
3
|
+
</send_user_message_question_reply>`}function Xt(n){if(!a(n)||!a(n.codex))return[];let s=n.codex;return(Array.isArray(s.questionReplyParts)?s.questionReplyParts.map((t)=>a(t)?{...t,answer:t.text}:t):[s.questionReply]).filter((t)=>a(t)&&typeof t.questionItemId==="string"&&typeof t.question==="string"&&typeof t.answer==="string").map(({questionItemId:t,question:l,answer:c})=>({questionItemId:t,question:l,answer:c}))}function Co({question:n,draft:s,status:i,answer:t,error:l,onChange:c,onSubmit:x,onSkip:b,t:o}){let y=Q(),d=i==="pending",w=i==="answered"||i==="skipped";return p("section",{"aria-labelledby":`${y}-title`,className:"border-border bg-card text-card-foreground flex min-w-0 flex-col gap-3 rounded-xl border p-4",children:[r("h3",{id:`${y}-title`,className:"text-sm font-medium whitespace-pre-wrap",children:n.title}),w?r("p",{className:"text-sm whitespace-pre-wrap",children:i==="answered"?t:o("asyncQuestion.skipped")}):p(h,{children:[(n.options?.length??0)>0&&p(j,{"aria-labelledby":`${y}-title`,disabled:!d,value:s.selected===null?"other":String(s.selected),onValueChange:(u)=>c({...s,selected:u==="other"?null:Number(u)}),children:[n.options?.map((u,m)=>p(f,{className:"flex items-start gap-2 text-sm",children:[r(I,{value:String(m)}),r("span",{className:"whitespace-pre-wrap",children:u})]},m)),p(f,{className:"flex items-center gap-2 text-sm",children:[r(I,{value:"other"}),o("asyncQuestion.other")]})]}),r(k,{"aria-label":o("asyncQuestion.answer"),placeholder:o("asyncQuestion.answer"),value:s.text,readOnly:!d,onChange:(u)=>c({selected:null,text:u.target.value})}),l&&r("p",{role:"alert",className:"text-destructive text-sm",children:l}),p("div",{className:"flex flex-wrap items-center gap-2",children:[r(e,{size:"sm",disabled:!d||Qt(n,s).trim().length===0,onClick:x,children:o(i==="submitting"?"asyncQuestion.submitting":"asyncQuestion.submit")}),r(e,{size:"sm",variant:"ghost",disabled:!d,onClick:b,children:o("asyncQuestion.skip")}),(i==="closed"||i==="unavailable")&&r("span",{role:"status",className:"text-muted-foreground text-xs",children:o(`asyncQuestion.${i}`)})]})]})]})}
|
|
4
|
+
export{g,Kt,wo,Qt,ko,Xt,Co};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Radio as e}from"@base-ui/react/radio";import{RadioGroup as d}from"@base-ui/react/radio-group";import{cn as o}from"cn";import{jsx as i}from"react/jsx-runtime";function
|
|
1
|
+
import{Radio as e}from"@base-ui/react/radio";import{RadioGroup as d}from"@base-ui/react/radio-group";import{cn as o}from"cn";import{jsx as i}from"react/jsx-runtime";function j({className:r,...a}){return i(d,{"data-slot":"radio-group",className:o("grid w-full gap-3",r),...a})}function I({className:r,...a}){return i(e.Root,{"data-slot":"radio-group-item",className:o("group/radio-group-item peer border-input group-has-[:focus-visible]/field-label:not-data-checked:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary relative flex aspect-square size-4 shrink-0 rounded-full border outline-none group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",r),...a,children:i(e.Indicator,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:i("span",{className:"bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full"})})})}export{j,I};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{y}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{y}from"./chunk-cpk3y6ad.js";import{e}from"./chunk-6kn920c5.js";import{n}from"./chunk-ysc51tpb.js";import{Fe}from"./chunk-m28hdj8j.js";import{FileText as l,RotateCcw as x,X as d}from"lucide-react";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Fo({data:s,sessionId:m}){let{host:a}=n(),{t:o}=a,p=y(),{text:c,status:r}=s.pastedText;return i("div",{className:"bg-muted flex max-w-64 min-w-0 items-center gap-1 rounded-lg px-2 py-1",children:[i(e,{type:"button",variant:"ghost",disabled:r!=="ready",onClick:()=>a.openLink(s.url),className:"h-auto min-w-0 flex-1 shrink gap-2 overflow-hidden px-0 py-1",children:[t(l,{className:"size-4 shrink-0"}),i("span",{className:"min-w-0 flex-1 text-start",children:[t("span",{className:"block truncate text-xs",children:s.filename}),t("span",{className:"text-muted-foreground block text-xs",children:r==="ready"?o("composer.pastedTextCharacters",{count:c.length}):o(r==="pending"?"composer.pastedTextPending":"composer.pastedTextError")})]})]}),r==="error"&&a.writeTextAttachment&&t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRetry"),onClick:()=>Fe(m,s,a.writeTextAttachment),children:t(x,{className:"size-3"})}),t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRemove"),onClick:()=>p.remove(s.id),children:t(d,{className:"size-3"})})]})}
|
|
2
|
+
export{Fo};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o}from"./chunk-dp8pjv6r.js";import{e}from"./chunk-6kn920c5.js";import{Ln}from"./chunk-p1ydsj54.js";import{ge,fe,he,ve}from"./chunk-magaaqab.js";import{n,C}from"./chunk-ysc51tpb.js";import{Loader2Icon as f}from"lucide-react";import{jsx as i,jsxs as m}from"react/jsx-runtime";function st({session:t,timeline:c}){let{host:s,client:a}=n(),{t:r}=s,l=o((y)=>y.historyPages[t.id]?.cursor!=null),d=()=>C(s,a.open(t.id,t.cwd)),p=i(Ln,{...c,session:t,client:a,host:s});if(t.restoring)return t.items.length===0?m("div",{className:"text-muted-foreground flex flex-1 items-center justify-center gap-2 text-sm",children:[i(f,{className:"size-4 animate-spin","aria-hidden":"true"}),r("conversation.restoring")]}):p;if(!t.attached&&t.items.length===0)return m(ge,{className:"flex-1",children:[m(fe,{children:[i(he,{children:r("conversation.reopen")}),i(ve,{children:r("conversation.detached")})]}),i(e,{onClick:d,children:r("conversation.reopen")})]});if(t.items.length===0&&t.state==="idle"&&!l)return i(ge,{className:"flex-1",children:m(fe,{children:[i(he,{className:"text-[28px] font-normal",children:r("conversation.welcomeTitle")}),i(ve,{className:"truncate font-mono",children:t.cwd})]})});return p}
|
|
2
|
+
export{st};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{tr}from"./chunk-tv89wh8b.js";async function m(r){try{let i=await(await fetch(r)).blob();if(typeof createImageBitmap==="function")return(await createImageBitmap(i)).close(),!0;return await new Promise((a)=>{let o=new Image;o.onload=()=>a(!0),o.onerror=()=>a(!1),o.src=r})}catch{return!1}}async function er(r){let n=await Promise.all(r.map(async({id:a,lastModified:o,sourcePath:p,...t})=>{let e=t.url;if(t.url.startsWith("blob:")){let s=await tr(t.url,t.mediaType);if(s===null)return null;e=s}let l=t.mediaType.toLowerCase().startsWith("image/"),c=e.startsWith("data:image/");if(l&&c&&!await m(e))return null;let u=e.startsWith("data:")?e.slice(5,e.indexOf(";")):t.mediaType;return{...t,url:e,mediaType:u}})),i=n.filter((a)=>a!==null);return{files:i,rejectedCount:n.length-i.length}}
|
|
2
|
+
export{er};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createStore as r}from"@alwith/api/client";var
|
|
2
|
-
export{
|
|
1
|
+
import{createStore as r}from"@alwith/api/client";var _t=r({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}});function zn(e){_t.setState({...e,terminals:e.terminals??{}})}function Un(e){if(_t.getState().sessionId===e)_t.setState({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}})}async function ii(e,n,t){let i=_t.getState();if(t.aborted||e===null||i.sessionId!==e||i.api===null)return;if(i.beforeReveal===null)throw Error("Mounted timeline has no navigation lifecycle");i.beforeReveal(),await i.api.scrollToKey(n,void 0,{align:"top"})}
|
|
2
|
+
export{_t,zn,Un,ii};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function zt(r){if(!r.trimStart().toLowerCase().startsWith("gpt"))return r;let a=/^gpt-\d/iu.test(r.trimStart())?" ":"-";return r.split(/(\s+)/).map((i)=>i.trim().length===0?i:i.split("-").map((t,o)=>{if(t.toLowerCase()==="gpt")return"GPT";if(t.toLowerCase()==="oai")return"OAI";return o>0&&t.length>0?`${t[0]?.toUpperCase()}${t.slice(1)}`:t}).join(a).replace(/^GPT (?=\d)/u,"GPT-")).join("")}
|
|
2
|
+
export{zt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Bo}from"./chunk-kahn24np.js";import{n,C}from"./chunk-ysc51tpb.js";import{R,x}from"./chunk-bhze2sjv.js";import{createLucideIcon as k,HandIcon as w,ShieldAlertIcon as y,ShieldCheckIcon as c}from"lucide-react";import{jsx as t}from"react/jsx-runtime";var S=k("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"}]]),d={"read-only":w,"workspace-write":c,agent:S,"agent-full-access":y},O={"read-only":"readOnly","workspace-write":"workspaceAccess",agent:"agent","agent-full-access":"fullAccess"};function mt({sessionId:u,options:g,disabled:m,onConfigChange:r}){let{host:l,client:f}=n(),{t:a}=l,o=x(g,"mode");if(!o)return null;let s=o.currentValue,p=R(o).map((e)=>{let i=O[e.value];return i?{...e,name:a(`permissionModes.${i}.name`),description:a(`permissionModes.${i}.description`)}:e}),h=p.find((e)=>e.value===s),I=d[s]??c,M=(e)=>{if(e===s)return;C(l,r?r(o.configId,e):f.setConfig(u,o.configId,e))};return t(Bo,{value:s,warning:s==="agent-full-access",currentName:h?.name??s,icon:t(I,{className:"size-3.5 shrink-0"}),header:a("permissionModes.heading"),disabled:m,label:a("composer.switchPermissionMode"),onValueChange:M,options:p.map((e)=>{let i=d[e.value]??c,v=e.value==="agent-full-access";return{value:e.value,label:t("span",{"data-permission-warning":v?"":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
|
+
export{mt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as f}from"cn";import{jsx as e,jsxs as a,Fragment as v}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{cn as f}from"cn";import{jsx as e,jsxs as a,Fragment as v}from"react/jsx-runtime";function Ke({title:r,titleIcon:t,body:o,rows:d,details:n,actions:s}){return a("div",{"data-slot":"hover-info-card",className:"flex flex-col gap-1.5",children:[a("div",{"data-slot":"hover-info-card-summary",className:"flex min-w-0 flex-col gap-1",children:[a("div",{"data-slot":"hover-info-card-title-row",className:"flex min-w-0 items-center gap-1.5",children:[t!=null&&e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t}),e("div",{"data-slot":"hover-info-card-title",className:"text-foreground line-clamp-2 min-w-0 flex-1 text-sm break-words",children:r})]}),o!=null&&e("div",{"data-slot":"hover-info-card-body",className:"text-muted-foreground line-clamp-2 text-xs break-words",children:o}),e(i,{rows:d})]}),n!=null&&n.length>0&&e("div",{"data-slot":"hover-info-card-details",className:"flex min-w-0 flex-col gap-1.5",children:e(i,{rows:n})}),s!=null&&a(v,{children:[e("div",{"data-slot":"hover-info-card-separator",className:"bg-border -mx-3 mt-1.5 h-px"}),e("div",{"data-slot":"hover-info-card-actions",className:"-mx-1 flex flex-col",children:s})]})]})}function i({rows:r}){return r?.map((t,o)=>a("div",{"data-slot":"hover-info-card-row",className:"text-muted-foreground flex items-start gap-1.5 text-xs",children:[e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t.icon}),e("span",{className:"min-w-0 break-all",children:t.text})]},o))}function B({icon:r,label:t,trailing:o,disabled:d,onClick:n,variant:s="default",className:l,...c}){return a("button",{...c,"data-slot":"hover-info-card-action","data-variant":s,type:"button",disabled:d,onClick:n,className:f("text-foreground hover:bg-foreground/5 active:bg-foreground/10 flex h-8 w-full items-center gap-2 rounded-sm px-2 text-start text-sm font-normal disabled:pointer-events-none disabled:opacity-50","[&_svg]:size-4 [&_svg]:shrink-0",s==="destructive"?"text-destructive [&_svg]:text-destructive":"[&_svg]:text-muted-foreground",l),children:[r,e("span",{className:"min-w-0 flex-1 truncate",children:t}),o]})}
|
|
2
|
+
export{Ke,B};
|