@alwith/module-chat 0.5.18 → 0.5.19
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-w38vbf7h.js → chunk-01rfnabj.js} +2 -2
- package/dist/chunk-04mj5ftg.js +7 -0
- package/dist/{chunk-ahtyazfy.js → chunk-09r35ts9.js} +2 -2
- package/dist/chunk-0jvfabsq.js +2 -0
- package/dist/{chunk-rvr6zj7p.js → chunk-0vy6cqmw.js} +2 -2
- package/dist/{chunk-6nnwmqqp.js → chunk-0zp04d1m.js} +2 -2
- package/dist/{chunk-yh9qdb2k.js → chunk-0zph0gwq.js} +3 -3
- package/dist/chunk-107y8e8x.js +2 -0
- package/dist/{chunk-65m4bm74.js → chunk-210b2kk6.js} +2 -2
- package/dist/chunk-22h5rh2h.js +2 -0
- package/dist/{chunk-qp7aywgn.js → chunk-2hk04fh3.js} +2 -2
- package/dist/chunk-31yt34hy.js +2 -0
- package/dist/chunk-3hp5t5wf.js +2 -0
- package/dist/chunk-3jcx1ns0.js +2 -0
- package/dist/chunk-3jjc06nd.js +3 -0
- package/dist/chunk-3z8ajtxp.js +2 -0
- package/dist/chunk-4b3g7acq.js +2 -0
- package/dist/chunk-4jkg9p4g.js +2 -0
- package/dist/chunk-4xhvh2dn.js +2 -0
- package/dist/chunk-4xmbve71.js +4 -0
- package/dist/chunk-50mckd2p.js +2 -0
- package/dist/chunk-54qxv3er.js +2 -0
- package/dist/chunk-5bz1bzsw.js +2 -0
- package/dist/chunk-5dk4xga8.js +2 -0
- package/dist/{chunk-01dqjas2.js → chunk-5e10bzg2.js} +2 -2
- package/dist/chunk-5my9w4vd.js +2 -0
- package/dist/{chunk-s55n9cby.js → chunk-5n4mefej.js} +2 -2
- package/dist/{chunk-nxk65z2e.js → chunk-5nj2fjej.js} +2 -2
- package/dist/chunk-5tqygmg9.js +2 -0
- package/dist/{chunk-ykp85wc1.js → chunk-6p41wmgs.js} +2 -2
- package/dist/chunk-7dd374an.js +2 -0
- package/dist/chunk-7s7txz2j.js +2 -0
- package/dist/chunk-8hbwf0qe.js +2 -0
- package/dist/chunk-8yj3q7n2.js +2 -0
- package/dist/{chunk-qz8gpb9j.js → chunk-9ebnn34t.js} +2 -2
- package/dist/{chunk-mzh48e09.js → chunk-9ej4c7a8.js} +2 -2
- package/dist/{chunk-6t3tgzps.js → chunk-9eqezb4k.js} +2 -2
- package/dist/chunk-9xfv8jdn.js +2 -0
- package/dist/{chunk-2g8targj.js → chunk-9xkp5x7h.js} +2 -2
- package/dist/chunk-a3s36z4s.js +3 -0
- package/dist/chunk-a414w7ah.js +3 -0
- package/dist/{chunk-2qhbm5y9.js → chunk-a4wrn6ep.js} +2 -2
- package/dist/chunk-a9s3m9fs.js +2 -0
- package/dist/chunk-am6tss41.js +2 -0
- package/dist/chunk-b53ky6rb.js +2 -0
- package/dist/chunk-b65w6x23.js +2 -0
- package/dist/chunk-c2h76vnt.js +2 -0
- package/dist/{chunk-wrkwz65x.js → chunk-cdrmg9jj.js} +2 -2
- package/dist/chunk-cv2j9sjp.js +2 -0
- package/dist/chunk-d1trg76g.js +2 -0
- package/dist/chunk-d6c0mnth.js +2 -0
- package/dist/chunk-dgm4gxkj.js +2 -0
- package/dist/{chunk-2pj3pcc7.js → chunk-dj4e0q7k.js} +2 -2
- package/dist/{chunk-d7gjvz8z.js → chunk-e44hny11.js} +2 -2
- package/dist/chunk-e6ddpdxn.js +2 -0
- package/dist/chunk-e92r4g3v.js +2 -0
- package/dist/chunk-e9znmqdj.js +2 -0
- package/dist/{chunk-n56csv51.js → chunk-eeq8d3x7.js} +2 -2
- package/dist/chunk-ekd97p2x.js +2 -0
- package/dist/chunk-eyf9bxyx.js +2 -0
- package/dist/chunk-eyfdn4p3.js +2 -0
- package/dist/{chunk-4z4tec0p.js → chunk-f8wzz84b.js} +2 -2
- package/dist/chunk-fcqwzmkd.js +2 -0
- package/dist/{chunk-w390ewja.js → chunk-fcy4sv9f.js} +2 -2
- package/dist/{chunk-as1cvbzm.js → chunk-fgzq0ktw.js} +2 -2
- package/dist/chunk-fkwafga0.js +2 -0
- package/dist/chunk-gap8n0vv.js +5 -0
- package/dist/{chunk-dnsmr5nf.js → chunk-gcx4fk1a.js} +2 -2
- package/dist/{chunk-kv0tnq8g.js → chunk-gr1nnczz.js} +2 -2
- package/dist/{chunk-djmnmbm2.js → chunk-h3antqdd.js} +2 -2
- package/dist/{chunk-c2bkhrcc.js → chunk-hwh88n0v.js} +4 -4
- package/dist/chunk-j5rd55qs.js +3 -0
- package/dist/chunk-j9q2s4kq.js +2 -0
- package/dist/{chunk-5x4an3fb.js → chunk-jc52024g.js} +2 -2
- package/dist/{chunk-s0ef3h7b.js → chunk-jnena0v6.js} +2 -2
- package/dist/{chunk-m9en74e3.js → chunk-jt8h82c2.js} +2 -2
- package/dist/chunk-jx1cngyb.js +2 -0
- package/dist/chunk-k9mbpf0g.js +2 -0
- package/dist/chunk-kjswq0tx.js +2 -0
- package/dist/chunk-kkps1qd4.js +4 -0
- package/dist/{chunk-0mze2qnw.js → chunk-kvx8fv1e.js} +2 -2
- package/dist/{chunk-hfaarm10.js → chunk-m2hpfdch.js} +2 -2
- package/dist/chunk-mpnv2rht.js +2 -0
- package/dist/chunk-mtydzse4.js +2 -0
- package/dist/chunk-mw9k08ky.js +3 -0
- package/dist/{chunk-m4dgha79.js → chunk-nkqe2e8s.js} +2 -2
- package/dist/chunk-px6nrr87.js +2 -0
- package/dist/chunk-pzmd5d3m.js +2 -0
- package/dist/{chunk-rf9yxbes.js → chunk-q4q4f03j.js} +2 -2
- package/dist/chunk-q5az5kp2.js +4 -0
- package/dist/chunk-qmc18ejg.js +2 -0
- package/dist/chunk-qqm07rfv.js +2 -0
- package/dist/chunk-qv7kkv47.js +2 -0
- package/dist/{chunk-d5w1nvrz.js → chunk-qy2prx7m.js} +2 -2
- package/dist/chunk-rq04p6pn.js +3 -0
- package/dist/chunk-rsfwc38x.js +4 -0
- package/dist/chunk-rx9sdjtn.js +2 -0
- package/dist/chunk-s0b5g8nc.js +2 -0
- package/dist/{chunk-yy4tw3nj.js → chunk-sf1z4r7v.js} +2 -2
- package/dist/chunk-syp06z39.js +2 -0
- package/dist/chunk-t6cfjn19.js +2 -0
- package/dist/{chunk-fexvhys2.js → chunk-tzyc5myt.js} +2 -2
- package/dist/chunk-vsff9djs.js +2 -0
- package/dist/chunk-vvq50011.js +2 -0
- package/dist/chunk-wkvm8f2e.js +2 -0
- package/dist/chunk-ww223tm5.js +2 -0
- package/dist/chunk-x0tbzjqc.js +2 -0
- package/dist/chunk-x480gyp7.js +2 -0
- package/dist/chunk-yjhypkmc.js +2 -0
- package/dist/{chunk-fydcbjsx.js → chunk-yjtq166b.js} +3 -3
- package/dist/{chunk-1wpdb17m.js → chunk-z5tstgsh.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/styles.css +2 -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.d.ts +1 -1
- package/dist/composer/model-select.js +1 -1
- package/dist/composer/permission-mode-select.js +1 -1
- package/dist/composer/prompt-input-attachments.js +1 -1
- package/dist/composer/prompt-input-clipboard.js +1 -1
- package/dist/composer/prompt-input-context.js +1 -1
- package/dist/composer/prompt-input-textarea.d.ts +1 -1
- package/dist/composer/prompt-input-textarea.js +1 -1
- package/dist/composer/prompt-input.d.ts +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/conversation/subagent-sessions.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-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/locales.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/locales.js +1 -1
- package/dist/session-list/navigation.js +1 -1
- package/dist/session-list/overflow-marquee.js +1 -1
- package/dist/session-list/row-stop-button.js +1 -1
- package/dist/session-list/session-groups.js +1 -1
- package/dist/session-list/session-info-card.js +1 -1
- package/dist/session-list/session-list.js +1 -1
- package/dist/session-list/session-row.js +1 -1
- package/dist/session-list/session-state-dot.js +1 -1
- package/dist/session-list/session-state-menu.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/package.json +7 -5
- package/dist/chunk-01denvg2.js +0 -5
- package/dist/chunk-074x98ak.js +0 -2
- package/dist/chunk-0c8fy456.js +0 -4
- package/dist/chunk-0dnwqm94.js +0 -2
- package/dist/chunk-0nkvfecf.js +0 -1
- package/dist/chunk-0ss92kxr.js +0 -2
- package/dist/chunk-12fcr66z.js +0 -2
- package/dist/chunk-14r2ktqe.js +0 -3
- package/dist/chunk-180zvfd6.js +0 -2
- package/dist/chunk-1fm5vx1n.js +0 -1
- package/dist/chunk-2a3tezgr.js +0 -1
- package/dist/chunk-2r3sfmyf.js +0 -2
- package/dist/chunk-2rperg04.js +0 -1
- package/dist/chunk-2swp3nfs.js +0 -2
- package/dist/chunk-3919sqde.js +0 -2
- package/dist/chunk-39sbgvd3.js +0 -2
- package/dist/chunk-3dckftt6.js +0 -2
- package/dist/chunk-3k5n3809.js +0 -2
- package/dist/chunk-3z6rx5qv.js +0 -4
- package/dist/chunk-4s1rhts0.js +0 -1
- package/dist/chunk-4zzhckab.js +0 -2
- package/dist/chunk-58wt406v.js +0 -1
- package/dist/chunk-59g9h4v1.js +0 -2
- package/dist/chunk-59j0p8hy.js +0 -2
- package/dist/chunk-6s7z09b0.js +0 -2
- package/dist/chunk-6wqbetcx.js +0 -1
- package/dist/chunk-75zcgcqm.js +0 -2
- package/dist/chunk-7ap638hx.js +0 -2
- package/dist/chunk-7g79m27w.js +0 -2
- package/dist/chunk-7jdjdnh6.js +0 -2
- package/dist/chunk-7wyrcphh.js +0 -1
- package/dist/chunk-83sz9mv9.js +0 -3
- package/dist/chunk-88cfz41t.js +0 -2
- package/dist/chunk-8bfnjqkg.js +0 -2
- package/dist/chunk-8g09jrj1.js +0 -2
- package/dist/chunk-8v1bjdgv.js +0 -2
- package/dist/chunk-90wm9rxz.js +0 -2
- package/dist/chunk-91h14q3y.js +0 -2
- package/dist/chunk-96x0d2vd.js +0 -1
- package/dist/chunk-9gv1zffv.js +0 -1
- package/dist/chunk-9j609g4n.js +0 -1
- package/dist/chunk-afd3bq7v.js +0 -2
- package/dist/chunk-bew4srqj.js +0 -2
- package/dist/chunk-bj5ma2sv.js +0 -2
- package/dist/chunk-bv4adcrd.js +0 -2
- package/dist/chunk-c1vavp0q.js +0 -2
- package/dist/chunk-c26vy827.js +0 -2
- package/dist/chunk-cazdmcwd.js +0 -2
- package/dist/chunk-cc0tan75.js +0 -2
- package/dist/chunk-d5ga13n0.js +0 -1
- package/dist/chunk-d94rmh12.js +0 -2
- package/dist/chunk-da4m33bg.js +0 -2
- package/dist/chunk-da6d6wze.js +0 -1
- package/dist/chunk-e99sdapw.js +0 -2
- package/dist/chunk-ea3582qy.js +0 -1
- package/dist/chunk-ebmbz9tg.js +0 -2
- package/dist/chunk-frbeen15.js +0 -2
- package/dist/chunk-ftcydsbs.js +0 -2
- package/dist/chunk-gdpa9dp5.js +0 -1
- package/dist/chunk-gz7adphb.js +0 -2
- package/dist/chunk-gzeg6bqp.js +0 -2
- package/dist/chunk-h68f23r0.js +0 -1
- package/dist/chunk-h99fy0g3.js +0 -4
- package/dist/chunk-jdjk6tf4.js +0 -1
- package/dist/chunk-jjnmq2zj.js +0 -3
- package/dist/chunk-jp73gpbp.js +0 -2
- package/dist/chunk-khj3ye94.js +0 -7
- package/dist/chunk-kjtd3wc3.js +0 -1
- package/dist/chunk-kmhwwzga.js +0 -2
- package/dist/chunk-kzq1797a.js +0 -3
- package/dist/chunk-mr1azhef.js +0 -1
- package/dist/chunk-n0xzhjdg.js +0 -2
- package/dist/chunk-n1tjf64a.js +0 -2
- package/dist/chunk-n5xqjct2.js +0 -1
- package/dist/chunk-nqv69z6n.js +0 -2
- package/dist/chunk-pv35kspb.js +0 -1
- package/dist/chunk-pw6p654f.js +0 -3
- package/dist/chunk-q6km9nha.js +0 -2
- package/dist/chunk-qca5mhqd.js +0 -2
- package/dist/chunk-qxabrz98.js +0 -2
- package/dist/chunk-r1988zpy.js +0 -2
- package/dist/chunk-sespfp7t.js +0 -4
- package/dist/chunk-sf6ze845.js +0 -2
- package/dist/chunk-sxgc25gz.js +0 -2
- package/dist/chunk-tq6ekz3s.js +0 -2
- package/dist/chunk-txn8v2yc.js +0 -2
- package/dist/chunk-vp8fb7r8.js +0 -2
- package/dist/chunk-w1awbykg.js +0 -2
- package/dist/chunk-wpdn3rx8.js +0 -1
- package/dist/chunk-x1xh8y2s.js +0 -2
- package/dist/chunk-x8kxqtva.js +0 -2
- package/dist/chunk-xfx689xm.js +0 -3
- package/dist/chunk-y6afvrnv.js +0 -2
- package/dist/chunk-zb4mqy8f.js +0 -2
- package/dist/ui/alert.d.ts +0 -10
- package/dist/ui/alert.js +0 -1
- package/dist/ui/badge.d.ts +0 -7
- package/dist/ui/badge.js +0 -1
- package/dist/ui/button.d.ts +0 -8
- package/dist/ui/button.js +0 -1
- package/dist/ui/card.d.ts +0 -11
- package/dist/ui/card.js +0 -1
- package/dist/ui/checkbox.d.ts +0 -3
- package/dist/ui/checkbox.js +0 -1
- package/dist/ui/dialog.d.ts +0 -17
- package/dist/ui/dialog.js +0 -1
- package/dist/ui/dropdown-menu.d.ts +0 -29
- package/dist/ui/dropdown-menu.js +0 -1
- package/dist/ui/empty.d.ts +0 -11
- package/dist/ui/empty.js +0 -1
- package/dist/ui/field.d.ts +0 -24
- package/dist/ui/field.js +0 -1
- package/dist/ui/hover-card.d.ts +0 -5
- package/dist/ui/hover-card.js +0 -1
- package/dist/ui/input-group.d.ts +0 -18
- package/dist/ui/input-group.js +0 -1
- package/dist/ui/input.d.ts +0 -3
- package/dist/ui/input.js +0 -1
- package/dist/ui/kbd.d.ts +0 -3
- package/dist/ui/kbd.js +0 -1
- package/dist/ui/label.d.ts +0 -3
- package/dist/ui/label.js +0 -1
- package/dist/ui/radio-group.d.ts +0 -5
- package/dist/ui/radio-group.js +0 -1
- package/dist/ui/select.d.ts +0 -15
- package/dist/ui/select.js +0 -1
- package/dist/ui/separator.d.ts +0 -3
- package/dist/ui/separator.js +0 -1
- package/dist/ui/skeleton.d.ts +0 -2
- package/dist/ui/skeleton.js +0 -1
- package/dist/ui/spinner.d.ts +0 -2
- package/dist/ui/spinner.js +0 -1
- package/dist/ui/switch.d.ts +0 -5
- package/dist/ui/switch.js +0 -1
- package/dist/ui/textarea.d.ts +0 -3
- package/dist/ui/textarea.js +0 -1
- package/dist/ui/tooltip.d.ts +0 -6
- package/dist/ui/tooltip.js +0 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{Nt,Mt,Ce}from"./chunk-54qxv3er.js";import{Z,p}from"./chunk-wkvm8f2e.js";import{InputGroupTextarea as D}from"@nyssance/shadcn/vega/components/ui/input-group";import{cn as M}from"cn";import{forwardRef as R,useCallback as F,useEffect as T,useImperativeHandle as K,useRef as h}from"react";import{jsx as N}from"react/jsx-runtime";var z=(c)=>!c.shiftKey,L=()=>!1,qe=R(({onChange:c,onCompositionStart:b,onCompositionEnd:y,className:E,placeholder:I,bashMode:C=!1,isSendShortcut:H=z,isNewlineShortcut:S=L,...g},P)=>{let n=Z(),m=p(),u=h(!1),i=h(!1),a=h(null),l=h(null),o=F(()=>{if(globalThis.CSS?.supports?.("field-sizing","content")||l.current!==null)return;l.current=requestAnimationFrame(()=>{l.current=null;let e=a.current;if(!e||u.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`})},[]);T(()=>{let e=a.current;if(!e||globalThis.CSS?.supports?.("field-sizing","content"))return;let t,r=new ResizeObserver(([s])=>{if(s&&s.contentRect.width!==t)t=s.contentRect.width,o()});return r.observe(e),o(),()=>{if(r.disconnect(),l.current!==null)cancelAnimationFrame(l.current);l.current=null}},[o]),T(o,[o,n?.textInput.value,g.value]);let f=C&&(n?.textInput.value??"").startsWith("!"),w=(e)=>{if(u.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||i.current)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
|
|
2
|
+
`&&e.key!=="\r"&&e.key!=="\t"){e.preventDefault();return}if(f&&n){let t=e.currentTarget.selectionStart===0&&e.currentTarget.selectionEnd===0;if(e.key==="Escape"||(e.key==="Backspace"||e.key==="Delete")&&t){e.preventDefault(),n.textInput.setInput(n.textInput.value.slice(1));return}}if(e.key==="Enter"){if(S(e.nativeEvent)){e.preventDefault();let t=e.currentTarget,{selectionStart:r,selectionEnd:s,value:d}=t,v=`${d.slice(0,r)}
|
|
3
|
+
${d.slice(s)}`;if(n)n.textInput.setInput(v);else t.value=v;let x=r+1;t.setSelectionRange(x,x),o();return}if(H(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let r=t.querySelector('button[type="submit"]');if(!r||r.disabled)return;t.requestSubmit(r)}}if(e.key==="Backspace"&&e.currentTarget.value===""&&m.files.length>0){e.preventDefault();let t=m.files.at(-1);if(t)m.remove(t.id)}},k=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:r,sawNonImageFile:s}=Nt(t),d=Mt(t);if(r.length>0)e.preventDefault(),m.add(r);else if(s&&!d)e.preventDefault()},A=n?{value:u.current&&a.current?a.current.value:f?n.textInput.value.slice(1):n.textInput.value,onChange:(e)=>{let t=u.current?e.currentTarget.value:Ce(e.currentTarget);n.textInput.setInput(f?`!${t}`:t),o(),c?.(e)}}:{onChange:(e)=>{if(!u.current)Ce(e.currentTarget);o(),c?.(e)}};return K(P,()=>({resetHeight:()=>{if(a.current)a.current.style.height="auto"},focus:()=>{a.current?.focus()},isComposing:()=>u.current||i.current,getTextarea:()=>a.current}),[]),N(D,{"data-chat-input":!0,ref:a,rows:3,className:M("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",E),name:"message",onCompositionEnd:(e)=>{u.current=!1;let t=Ce(e.currentTarget);n?.textInput.setInput(f?`!${t}`:t),o(),y?.(e),i.current=!0,requestAnimationFrame(()=>{i.current=!1})},onCompositionStart:(e)=>{i.current=!1,u.current=!0,b?.(e)},onKeyDown:w,onPaste:k,placeholder:I,...g,...A})});qe.displayName="PromptInputTextarea";
|
|
4
|
+
export{qe};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Cn}from"./chunk-2hk04fh3.js";import{CheckIcon as N,ChevronDownIcon as E,CopyIcon as T,FileIcon as w}from"lucide-react";import{useEffect as k,useLayoutEffect as H,useRef as I,useState as f}from"react";import{jsx as e,jsxs as p,Fragment as h}from"react/jsx-runtime";var A=20,L='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function y(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function R(n,o){let s=n.getBoundingClientRect(),a=o.getBoundingClientRect();return s.top>=a.top&&s.right<=a.right&&s.bottom<=a.bottom&&s.left>=a.left}function M({text:n,host:o}){let{t:s,Markdown:a}=o,c=I(null),[l,u]=f(!1),[d,x]=f(!1);return H(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=()=>{if(r.scrollHeight===0){u(!1);return}let b=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(b))throw Error("Codex user message line height is invalid");u(r.scrollHeight>A*b+1)};t();let m=new ResizeObserver(t);return m.observe(r),()=>m.disconnect()},[]),k(()=>{if(!l||d)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=new Map,m=typeof IntersectionObserver>"u"?null:new IntersectionObserver((i)=>{for(let g of i){let v=g.target;if(!t.has(v))continue;y(v,g.isIntersecting&&g.intersectionRatio>=1,t.get(v))}},{root:r,rootMargin:"0px",threshold:1}),b=()=>{for(let i of t.keys()){if(r.contains(i))continue;m?.unobserve(i),t.delete(i)}for(let i of r.querySelectorAll(L)){if(t.has(i)||i.hasAttribute("inert"))continue;let g=i.getAttribute("aria-hidden");t.set(i,g),y(i,m===null&&R(i,r),g),m?.observe(i)}};b();let C=new MutationObserver(b);return C.observe(r,{childList:!0,subtree:!0}),()=>{m?.disconnect(),C.disconnect();for(let[i,g]of t)y(i,!0,g)}},[l,d]),p("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:l&&!d?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(a,{text:n,streaming:!1})}),l&&!d&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),l&&p("button",{type:"button","aria-expanded":d,className:"codex-user-message-collapse-trigger",onClick:()=>{x((r)=>!r)},children:[e("span",{children:d?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(E,{className:d?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function it({text:n,label:o,host:s}){let[a,c]=f(!1),[l,u]=f(null),d=async()=>{c(!1),u(null);try{await(s?.copyText?s.copyText(n):navigator.clipboard.writeText(n)),c(!0),setTimeout(()=>c(!1),2000)}catch(x){u(String(x)),s?.onCopyError?.(x)}};return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:l??o,onClick:()=>void d(),children:a?e(N,{className:"codex-message-action-confirmed"}):e(T,{})})}function S({image:n,openImage:o}){let[s,a]=f(!1),c=`data:${n.mimeType};base64,${n.data}`;return p(h,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?a(!0):o(c),children:e("img",{src:c,alt:""})}),s&&e(Cn,{src:c,alt:"",onClose:()=>a(!1)})]})}function wn({message:n,text:o,textParts:s,mentions:a,images:c,messageTime:l,host:u,bubbleStyle:d}){let{t:x,openImage:r}=u;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:p("div",{className:"group/codex-user codex-user-message-group",children:[a.length>0&&e("div",{className:"codex-user-mentions",children:a.map((t)=>p("span",{className:"codex-user-mention",title:t.title,children:[e(w,{"aria-hidden":"true"}),e("span",{className:"codex-user-mention-label",children:t.label})]},t.key))}),c.length>0&&e("div",{className:"codex-user-images",children:c.map((t)=>e(S,{image:t,openImage:r},`${t.mimeType}:${t.data}`))}),o.length>0&&e(h,{children:e("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:d,children:s?s.map((t,m)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(M,{text:t.text,host:u}):p(h,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question}),e("div",{className:"codex-user-question-answer",children:t.text})]})},m)):e(M,{text:o,host:u})})}),p("div",{className:"codex-user-actions",children:[e(it,{text:o,label:x("actions.copy"),host:u}),l&&e("span",{className:"codex-user-time",title:l.full,children:l.short})]})]})})}
|
|
2
|
+
export{it,wn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t=new Map;var a=0;function
|
|
2
|
-
export{
|
|
1
|
+
var t=new Map;var a=0;function st(e,n){let r=n?void 0:t.get(e);if(r===void 0)return null;return t.delete(e),t.set(e,r),{...r,tokens:structuredClone(r.tokens)}}function c(e){if(e.isStreaming||e.text.length>1048576)return;if(t.delete(e.text))a-=e.text.length;t.set(e.text,{...e,tokens:structuredClone(e.tokens)}),a+=e.text.length;while(a>2097152||t.size>200){let n=t.keys().next().value;a-=n.length,t.delete(n)}}class l{worker=new Worker(new URL("@alwith/module-chat/markdown-parser.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(e)=>{let n=e.data,r=this.active;if(n.clientId!==r?.clientId||n.revision!==r.revision){this.fail(Error("Markdown worker returned an unexpected request"));return}if(this.active=null,!n.ok){this.fail(Error(n.error));return}let i={...r.input,tokens:n.tokens};c(i);let s=this.clients.get(r.clientId),o=this.pending.get(r.clientId),u=o!==void 0&&r.input.isStreaming&&o.input.isStreaming&&o.input.text.startsWith(r.input.text);if(s!==void 0&&(s.revision===r.revision||u))s.onResult(i);this.dispatch()},this.worker.onerror=(e)=>this.fail(Error(e.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize Markdown parsing result"))}fail(e){this.failure=e,this.worker.terminate(),this.pending.clear(),this.active=null;for(let n of this.clients.values())n.onError(e)}send(e){try{this.worker.postMessage(e)}catch(n){this.fail(n instanceof Error?n:Error(String(n)))}}dispatch(){if(this.active!==null||this.pending.size===0)return;let e=this.pending.values().next().value;this.pending.delete(e.clientId),this.active=e,this.send({type:"parse",clientId:e.clientId,revision:e.revision,source:e.input.source})}connect(e,n){if(this.failure!==null)throw this.failure;let r=++this.nextClientId,i={revision:0,onResult:e,onError:n};return this.clients.set(r,i),{update:(s)=>{if(this.failure!==null)throw this.failure;i.revision+=1;let o=st(s.text,s.isStreaming);if(o!==null){this.pending.delete(r),i.onResult(o);return}this.pending.set(r,{clientId:r,revision:i.revision,input:s}),this.dispatch()},dispose:()=>{if(!this.clients.delete(r))return;if(this.pending.delete(r),this.clients.size===0)this.worker.terminate(),d=void 0;else if(this.failure===null)this.send({type:"dispose",clientId:r})}}}}var d;function _n(e,n){return d??=new l,d.connect(e,n)}
|
|
2
|
+
export{st,_n};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{DropdownMenuRadioGroup as r,DropdownMenuRadioItem as s}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{cn as p}from"cn";import{jsx as t,jsxs as a}from"react/jsx-runtime";function d({value:i,onValueChange:n,options:o,itemClassName:l}){return t(r,{value:i,onValueChange:(e)=>n(String(e)),children:o.map((e)=>a(s,{value:e.value,disabled:e.disabled,title:e.title,closeOnClick:!0,className:p("gap-2",e.description?"items-start":"items-center",l),children:[e.icon,e.description?a("div",{className:"min-w-0 flex-1",children:[t("div",{className:"text-xs font-medium",children:e.label}),t("div",{className:"text-muted-foreground text-[11px] font-normal",children:e.description})]}):t("span",{className:"min-w-0 flex-1 truncate text-start",children:e.label})]},e.value))})}
|
|
2
|
+
export{d};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c,a,ve,o,f}from"./chunk-107y8e8x.js";import{I}from"./chunk-6p41wmgs.js";import{fe}from"./chunk-7s7txz2j.js";import{ue}from"./chunk-eyf9bxyx.js";import{j,ce}from"./chunk-5bz1bzsw.js";import{hasRename as D}from"@nyssance/codex-acp-v2/client";import{ArchiveIcon as x,ArchiveRestoreIcon as A,GitForkIcon as H,PencilIcon as N,Trash2Icon as R}from"lucide-react";import{useRef as B,useState as C}from"react";import{jsx as n,jsxs as L,Fragment as b}from"react/jsx-runtime";function ze({sessionRow:e,active:v,onSelect:m,onForked:S=m,onHoverCardOpenChange:r,actions:l}){let i=c(),{t:p,i18n:k}=i,h=a(),d=o((s)=>s.runStates[e.sessionId]),g=ve(),u=()=>m(e);return n(fe,{"data-session-id":e.sessionId,role:"button",tabIndex:0,active:v,onClick:u,onKeyDown:(s)=>{if(s.key==="Enter"||s.key===" ")s.preventDefault(),u()},state:d?.state,interruption:d?.interruption??null,title:e.title??p("sessionList.untitled"),onHoverCardOpenChange:r,hoverCard:n(E,{sessionRow:e,onDelete:()=>g(e),onForked:S,actions:l}),meta:e.updatedAt!==null?n("span",{className:"text-muted-foreground shrink-0 text-xs",children:j(e.updatedAt,k.language)}):void 0,actions:d!=null?n(ue,{title:p("sessionList.stop"),onStop:()=>f(i,h.stopSession(e.sessionId))}):void 0})}function E({sessionRow:e,onDelete:v,onForked:m,actions:S}){let r=c(),{t:l}=r,i=a(),p=o((t)=>D(t.agent)),k=o((t)=>t.connection==="ready"&&t.agent?.capabilities?.session?.fork!=null),[h,d]=C(!1),[g,u]=C(!1),s=B(!1);return n(ce,{sessionRow:e,renaming:h,onRename:(t)=>{if(d(!1),t!==null)f(r,i.renameSession(e.sessionId,t))},actions:L(b,{children:[p&&n(I,{icon:n(N,{}),label:l("sessionList.rename"),onClick:()=>d(!0)}),S,e.archived?n(I,{icon:n(A,{}),label:l("sessionList.unarchive"),onClick:()=>void f(r,i.unarchive(e.sessionId))}):L(b,{children:[n(I,{icon:n(H,{}),label:l("sessionList.fork"),disabled:!k||g,onClick:()=>{if(s.current)return;s.current=!0,u(!0),f(r,i.fork(e.sessionId,e.cwd).then((t)=>{let y=i.state.sessionList.find((F)=>F.sessionId===t);if(!y)throw Error("Forked chat is missing from the session list");m(y)}).finally(()=>{s.current=!1,u(!1)}))}}),n(I,{icon:n(x,{}),label:l("sessionList.archive"),onClick:()=>void f(r,i.archive(e.sessionId))})]}),n(I,{variant:"destructive",icon:n(R,{}),label:l("sessionList.delete"),onClick:v})]})})}
|
|
2
|
+
export{ze};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{Ze,Je}from"./chunk-3jjc06nd.js";import{u}from"./chunk-4xmbve71.js";import{rt}from"./chunk-eeq8d3x7.js";import{e}from"./chunk-7dd374an.js";import{Hn,P,ie,On}from"./chunk-8hbwf0qe.js";import{tt}from"./chunk-9xfv8jdn.js";import{L}from"./chunk-qv7kkv47.js";import{mt}from"./chunk-eyfdn4p3.js";import{sn}from"./chunk-gap8n0vv.js";import{vn}from"./chunk-3jcx1ns0.js";import{xn}from"./chunk-9ebnn34t.js";import{dt,ut}from"./chunk-cv2j9sjp.js";import{re}from"./chunk-nkqe2e8s.js";import{codexMessageError as U,codexTurnError as q,isContentEntry as le,isEmbeddedResource as Y,isImage as Z,isResourceLink as de,isText as ce,nativeTurnId as ge}from"@nyssance/codex-acp-v2/client";import{LoaderCircleIcon as ue,SparklesIcon as pe}from"lucide-react";import{Fragment as fe,memo as ye,useEffect as he,useState as xe}from"react";import{jsx as s,jsxs as m,Fragment as E}from"react/jsx-runtime";function X(i){if(Z(i))return`${i.mimeType.toLowerCase()}:${i.data}`;if(Y(i)&&"blob"in i.resource&&i.resource.mimeType?.toLowerCase().startsWith("image/"))return`${i.resource.mimeType.toLowerCase()}:${i.resource.blob}`;return null}function ke({item:i}){let{t:n}=e(),l=i.status==="in_progress",[o,c]=xe(()=>Date.now()-i.at>=1e4);return he(()=>{if(!l)return;let a=Math.max(0,i.at+1e4-Date.now());if(c(a===0),a===0)return;let y=setTimeout(()=>c(!0),a);return()=>clearTimeout(y)},[i.id,i.at,l]),m("div",{className:"codex-context-compaction",children:[s(pe,{"aria-hidden":"true"}),s("span",{children:i.status==="completed"?n("stream.codex.contextCompacted"):i.status==="cancelled"?n("timeline.interrupted"):n(o?"timeline.compactingWithDelayNotice":"timeline.compacting")})]})}function N({sessionId:i,entry:n,terminals:l,streaming:o,streamingThoughtId:c}){let{t:a}=e();switch(n.kind){case"activity":return s(tt,{sessionId:i,items:n.items,terminals:l,streamingThoughtId:c});case"text":return u(n.item._meta).length>0?s(mt,{sessionId:i,item:n.item}):s(L,{content:n.item.content,messageId:n.item.id,streaming:o});case"plan":return s(vn,{plan:n.item.plan});case"compaction":if(n.item.status==="failed")return m(dt,{children:[s("div",{children:a("timeline.compactionFailed")}),n.item.error!==null&&s("div",{children:n.item.error})]});return s(ke,{item:n.item})}}function Te({sessionId:i,turn:n,terminals:l,active:o,blocked:c=!1,continued:a=!1,edits:y=n.edits,activityItems:M=n.items,workStartedAt:ee=n.startedAt,isLast:W,error:h,interrupted:F,retry:K,retrying:p,answerActions:O,footer:te}){let{t:d}=e(),C=n.errors.map((t)=>{let r=U(t);if(r===null)throw Error("Turn error item is missing its diagnostics");let v=K?.turnId===ge(t)?K:void 0;return s(ut,{error:r,retry:v},`${t.id}:${v?.delaySeconds??"manual"}`)});if(W&&h!==null&&!n.errors.some((t)=>{let r=U(t);return r!==null&&r.stopReason===h.stopReason&&q(r).message===q(h).message}))C.push(s(ut,{error:h},"current-run-error"));let x=C.length>0?s("div",{className:"codex-turn-errors",children:C}):null,A=n.items.filter(rt);if(A.length>0&&A.length===n.items.length)return m(E,{children:[s(tt,{sessionId:i,items:A,terminals:l,streamingThoughtId:null}),x]});let k=n.work,T=k.length>0&&k.every((t)=>t.kind==="compaction");if(Hn(n)||T&&n.final.length===0)return m(E,{children:[s("div",{role:"status",className:"text-muted-foreground flex min-w-0 flex-col gap-2 py-2 text-sm",children:n.work.map((t)=>s(N,{sessionId:i,entry:t,terminals:l,streaming:!1,streamingThoughtId:null},t.key))}),x]});let D=ie(n),G=n.final.filter((t)=>u(t._meta).length===0).map(P).join(`
|
|
2
|
+
`),w=o?null:re(n,"assistant"),B=n.items.filter((t)=>t.kind==="tool"&&t.name==="image_generation"&&(t.status==="pending"||t.status==="in_progress")),H=new Set(n.final.flatMap((t)=>t.content.map(X).filter((r)=>r!==null))),b=n.items.flatMap((t)=>{if(t.kind!=="tool"||t.status!=="completed")return[];return t.content.filter(le).flatMap((r,v)=>{let g=r.content,ae=t.name==="image_generation"&&Z(g),me=t.toolKind!=="read"&&t.toolKind!=="search"&&(de(g)||Y(g)&&("blob"in g.resource));if(!ae&&!me)return[];let _=X(g);if(_!==null){if(H.has(_))return[];H.add(_)}return[{key:`${t.id}:${v}`,block:g}]})}),R=n.final.some((t)=>u(t._meta).length===0&&t.content.some((r)=>!ce(r)||r.text.trim().length>0)),ne=B.length>0||b.length>0||T||R||n.final.some((t)=>u(t._meta).length>0),I=n.items.findIndex((t)=>n.final.includes(t)),S=(t)=>n.items.indexOf(t.kind==="activity"?t.items[0]:t.item),Q=k.filter((t)=>I===-1||S(t)<I),se=k.filter((t)=>I!==-1&&S(t)>I),oe=[...n.final.map((t)=>({kind:"answer",item:t,index:n.items.indexOf(t)})),...se.map((t)=>({kind:"work",entry:t,index:S(t)}))].toSorted((t,r)=>t.index-r.index),V=!o&&!a&&(G.trim().length>0?s(Ze,{text:G,isMostRecentTurn:W,time:w,afterCopy:O}):m("div",{className:"flex items-center gap-0.5",children:[O,w&&s("span",{className:"codex-user-time ms-1",title:w.full,children:w.short})]})),f=xn({...n,items:M},{running:o,blocked:c,retrying:p!==void 0}),j=f.kind==="reasoning"?f.ownerKey??null:null,z=f.kind==="thinking",J=On({...n,items:M});return m(E,{children:[s(Je,{stateKey:JSON.stringify([i,n.replayed?"history":"live",n.key]),active:o&&!R,defaultExpanded:o&&!R||!n.replayed&&(F||D),...J,startedAt:J.startedAt??ee,loading:(z||f.kind==="working")&&n.work.length===0,loadingLabel:f.kind==="working"?d("stream.codex.working"):void 0,work:a||T?[]:Q.map((t)=>s(N,{sessionId:i,entry:t,terminals:l,streaming:o,streamingThoughtId:j},t.key)),answer:ne||a?m("div",{className:"flex min-w-0 flex-col gap-3",children:[(a||T)&&Q.map((t)=>s(N,{sessionId:i,entry:t,terminals:l,streaming:!1,streamingThoughtId:null},t.key)),oe.map((t)=>{if(t.kind==="work")return s(N,{sessionId:i,entry:t.entry,terminals:l,streaming:o,streamingThoughtId:j},t.entry.key);let r=t.item;return m(fe,{children:[u(r._meta).length>0?s(mt,{sessionId:i,item:r}):s(L,{content:r.content,messageId:r.id,streaming:o}),r===n.final.at(-1)&&V]},r.id)}),B.map((t)=>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(ue,{className:"size-4 motion-safe:animate-spin","aria-hidden":"true"}),d(o?"timeline.imageGenerating":"timeline.imageStopped")]})]},t.id)),b.length>0&&s("div",{className:"codex-reply-artifacts flex min-w-0 flex-col gap-3",children:b.map((t)=>s(L,{content:[t.block],messageId:t.key,streaming:!1},t.key))}),n.final.length===0&&V]}):null,footer:m(E,{children:[z&&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")})}),te,y.length>0&&!o&&!a&&s(sn,{items:y}),F&&!D&&s("div",{className:"codex-interrupted-turn",role:"status",children:d("timeline.interrupted")}),!o&&x]})}),o&&p!==void 0&&s("div",{className:"text-muted-foreground py-2 text-sm",role:"status",children:p.capacity?(()=>{let t=/Reconnecting(?:\.\.\.)?\s+(\d+\/\d+)/.exec(p.message)?.[1];return t===void 0?d("timeline.capacityReconnecting"):d("timeline.capacityReconnectingProgress",{progress:t})})():p.message}),o&&x]})}var an=ye(Te);
|
|
3
|
+
export{an};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var a=(e)=>String(e).padStart(2,"0");function
|
|
2
|
-
export{
|
|
1
|
+
var a=(e)=>String(e).padStart(2,"0");function re(e,l="user"){let r=e.replayed||e.items.some((t)=>t._meta?.codex&&typeof t._meta.codex==="object"&&("historyReplay"in t._meta.codex)&&t._meta.codex.historyReplay===!0),n=l==="user"?s(e.user?._meta,"messageSentAt")??(!r?e.user?.at??null:null):s(e.final.at(-1)?._meta,"messageCompletedAt")??e.items.map((t)=>s(t._meta,"turnCompletedAt")).find((t)=>t!==null)??(!r&&e.final.length>0?e.endedAt:null);if(n===null)return null;let o=new Date(n),u=o.toDateString()===new Date().toDateString();return{short:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",...u?{}:{month:"short",day:"numeric"}}).format(o),full:`${o.getFullYear()}-${a(o.getMonth()+1)}-${a(o.getDate())} ${a(o.getHours())}:${a(o.getMinutes())}`}}function s(e,l){let r=e?.codex;if(typeof r!=="object"||r===null)return null;let n=r[l];return typeof n==="number"&&Number.isFinite(n)&&Math.abs(n)<=8640000000000000?n:null}
|
|
2
|
+
export{re};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i}from"./chunk-fcqwzmkd.js";import{x}from"./chunk-5n4mefej.js";import{isContentEntry as b,isImage as N,isResourceLink as w}from"@nyssance/codex-acp-v2/client";import{ChevronRightIcon as C,ImageIcon as S,LoaderCircleIcon as A,RefreshCwIcon as R}from"lucide-react";import{useEffect as B,useState as h}from"react";import{jsx as n,jsxs as y}from"react/jsx-runtime";function q(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function T(e){let r=[];for(let[c,l]of e.content.entries()){if(!b(l))continue;let o=l.content;if(N(o))r.push({key:`${e.id}:${c}`,src:`data:${o.mimeType};base64,${o.data}`,alt:e.title??""});if(w(o))r.push({key:`${e.id}:${c}`,path:o.uri,alt:o.name})}if(r.length)return r;let a=e.rawInput;if(a!==null&&typeof a==="object"&&"path"in a&&typeof a.path==="string")return[{key:e.id,path:a.path,alt:a.path.split(/[\\/]/).at(-1)??a.path}];throw Error(`Image view ${e.id} has no image source`)}function E({images:e}){let{loadImage:r,openImageGallery:a,openImage:c,t:l}=i(),[o,g]=h({}),[v,I]=h(0),f=JSON.stringify(e);B(()=>{let t=!0,u=JSON.parse(f);g({});for(let s of u)(s.src!==void 0?Promise.resolve(s.src):s.path!==void 0&&r?r(s.path):Promise.reject(Error("Image loading is unavailable"))).then((d)=>{if(t)g((p)=>({...p,[s.key]:{src:d}}))},()=>{if(t)g((d)=>({...d,[s.key]:{error:!0}}))});return()=>{t=!1}},[f,r,v]);let k=e.flatMap((t)=>{let u=o[t.key];return u&&"src"in u?[{src:u.src,alt:t.alt}]:[]});return n("div",{className:"codex-image-thumbnails",children:e.map((t,u)=>{let s=o[t.key];if(!s)return n("div",{className:"codex-image-thumbnail",role:"status","aria-label":l("stream.codex.imageLoading"),children:n(A,{className:"motion-safe:animate-spin","aria-hidden":"true"})},t.key);if("error"in s)return n("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,"aria-label":l("stream.codex.imageFailed"),onClick:()=>I((m)=>m+1),children:n(R,{"aria-hidden":"true"})},t.key);return n("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,onClick:()=>{let m=e.slice(0,u).filter((d)=>{let p=o[d.key];return p&&"src"in p}).length;if(a)a(k,m);else c?.(s.src)},children:n("img",{src:s.src,alt:t.alt,draggable:!1})},t.key)})})}function dn({blocks:e}){let{t:r}=i(),a=e.flatMap(T),[c,l]=x(`image-view:${e[0].id}`,!1);return y("div",{className:"codex-activity-item",children:[y("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":c,onClick:()=>l((o)=>!o),children:[y("span",{className:"codex-activity-label",children:[n(S,{className:"codex-activity-icon","aria-hidden":"true"}),n("span",{className:"codex-activity-leading",children:r("stream.codex.viewedImages",{count:a.length})})]}),n(C,{className:c?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),c&&n(E,{images:a})]})}
|
|
2
|
+
export{q,dn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var Bo=280;function tn({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 z({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 Ye({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 nn({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 rn({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{Bo,tn,z,Ye,nn,on,rn};
|
|
@@ -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 Dn(){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 at(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
|
|
2
|
+
export{Dn,at};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{wn}from"./chunk-kvx8fv1e.js";import{e}from"./chunk-7dd374an.js";import{kn,Tn}from"./chunk-z5tstgsh.js";import{k}from"./chunk-qmc18ejg.js";import{P}from"./chunk-8hbwf0qe.js";import{isEmbeddedResource as g,isImage as d,isResourceLink as f,isText as x}from"@nyssance/codex-acp-v2/client";import{memo as p}from"react";import{jsx as r,jsxs as h}from"react/jsx-runtime";var bn=p(function({item:s,messageTime:c}){let l=e(),o=Tn(s._meta),m=o?o.map((t)=>t.question===void 0?t.text:`${t.question}
|
|
2
|
+
${t.text}`).join(`
|
|
3
|
+
`):P(s),a=s.content.filter(d),i=s.content.filter((t)=>f(t)||g(t)),u=o??s.content.filter(x).map((t)=>{let n=kn(t._meta);return n?{question:n.question,text:n.answer}:{text:t.text}});if(m.length===0&&a.length===0&&i.length===0)return null;return h("div",{className:"group/codex-user flex min-w-0 flex-col items-end gap-2","data-content-search-unit-key":s.id,children:[i.length>0&&r("div",{className:"codex-user-mentions",children:i.map((t,n)=>r(k,{block:t},`${s.id}:${n}`))}),r(wn,{host:l,message:s,text:m,textParts:u.some((t)=>("question"in t))?u:void 0,images:a,mentions:[],messageTime:c})]})});
|
|
4
|
+
export{bn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e,ae}from"./chunk-7dd374an.js";import{Button as u}from"@nyssance/shadcn/vega/components/ui/button";import{isEmbeddedResource as B,isImage as h,isResourceLink as E}from"@nyssance/codex-acp-v2/client";import{DownloadIcon as T,FileIcon as N,ImageOffIcon as L,LoaderCircleIcon as F}from"lucide-react";import{useState as y}from"react";import{jsx as n,jsxs as o}from"react/jsx-runtime";function co(t){let s=t.split(/[\\/]/).at(-1)??t;if(t.startsWith("file:")||/^https?:/.test(t))s=new URL(t).pathname.split("/").at(-1)??"";try{return decodeURIComponent(s)||"attachment"}catch(a){if(a instanceof URIError)return s||"attachment";throw a}}function U(t,s){let a=document.createElement("a");a.href=s,a.download=t,a.click()}function k({block:t,generated:s=!1}){let a=e(),[p,d]=y(!1),[I,C]=y(null);if(E(t)){if(t.uri==="codex-image:unavailable")return o("span",{className:"text-muted-foreground flex items-center gap-2 rounded-lg border p-3 text-sm",children:[n(L,{className:"size-4"}),a.t("timeline.imageUnavailable")]});let c=co(t.uri);return o(u,{variant:"outline",className:"h-auto max-w-full min-w-0 justify-start gap-3 overflow-hidden p-3","aria-label":t.title??t.name,title:t.uri,onClick:()=>a.openLink(t.uri),children:[n(N,{}),o("span",{className:"min-w-0 flex-1 text-start",children:[n("span",{className:"block truncate",children:t.title??t.name}),o("span",{className:"text-muted-foreground block truncate text-xs",children:[(t.title??t.name)!==c&&`${c} · `,t.mimeType??c.split(".").at(-1)?.toUpperCase()]})]})]})}if(!B(t)&&!h(t))return null;let i=h(t)?{uri:t.uri??`image.${t.mimeType.split("/")[1]??"png"}`,mimeType:t.mimeType,blob:t.data}:t.resource,r=co(i.uri);if("text"in i)return o("div",{className:"min-w-0",children:[n("pre",{className:"overflow-x-auto whitespace-pre-wrap",children:i.text}),o(u,{variant:"link",size:"sm",className:"max-w-full min-w-0",title:i.uri,onClick:()=>a.openLink(i.uri),children:[n(N,{}),n("span",{className:"truncate",children:r})]})]});let l=`data:${i.mimeType??"application/octet-stream"};base64,${i.blob}`,f=i.mimeType?.toLowerCase().startsWith("image/")&&I!==l,{openImage:g,openImageGallery:w}=a,x=w?()=>w([{src:l,alt:r,uri:i.uri}],0):g&&(()=>g(l)),m=s&&f,R=async()=>{d(!0);try{if(a.saveFile)await a.saveFile(r,i.blob);else U(r,l)}catch(c){ae(a,c)}finally{d(!1)}},v=n("img",{src:l,alt:"",className:s?"max-h-[40rem] max-w-full object-contain":"max-h-96 max-w-full rounded object-contain",onError:()=>C(l)});return o("div",{className:m?"codex-generated-image":"flex max-w-full min-w-0 flex-col items-start gap-1",children:[f&&(x===void 0?v:n(u,{variant:"ghost",className:s?"codex-generated-image-preview h-auto max-w-full p-0":"h-auto max-w-full p-0","aria-label":a.t("timeline.viewImage"),onClick:x,children:v})),o(u,{variant:m?"secondary":"link",size:m?"icon":"sm",className:m?"codex-generated-image-download":"max-w-full min-w-0",disabled:p,title:a.t("timeline.download",{name:r}),"aria-label":a.t("timeline.download",{name:r}),onClick:()=>{R()},children:[p?n(F,{className:"motion-safe:animate-spin"}):n(T,{}),!m&&n("span",{className:"truncate",children:r})]})]})}
|
|
2
|
+
export{co,k};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{en}from"./chunk-t6cfjn19.js";import{D,e,_,t,ae}from"./chunk-7dd374an.js";import{Fn,ie,ct,Un,zn}from"./chunk-8hbwf0qe.js";import{re}from"./chunk-nkqe2e8s.js";import{an}from"./chunk-mw9k08ky.js";import{$n}from"./chunk-fgzq0ktw.js";import{In,Sn}from"./chunk-22h5rh2h.js";import{gn,fn}from"./chunk-sf1z4r7v.js";import{pn}from"./chunk-a4wrn6ep.js";import{qn}from"./chunk-cdrmg9jj.js";import{bn}from"./chunk-q5az5kp2.js";import{Button as Z}from"@nyssance/shadcn/vega/components/ui/button";import{codexExtensionCapabilities as Be,codexMessageError as qe,codexRetryNotice as Oe,codexTurnError as Fe,nativeTurnId as xe}from"@nyssance/codex-acp-v2/client";import{ArrowDownIcon as Ke}from"lucide-react";import{useCallback as z,useEffect as E,useLayoutEffect as he,useMemo as Y,useRef as h,useState as U}from"react";import{flushSync as be}from"react-dom";import{jsx as o,jsxs as A}from"react/jsx-runtime";var we=24;function Ue(n){let d=Math.max(0,n.turnTopPx-we),g=Math.max(0,n.scrollHeightPx-n.viewportHeightPx),s=d-g;return{scrollTopPx:d,spacerPx:s>0?n.spacerPx+s:n.spacerPx}}function _e({viewportRef:n,viewportProps:d,children:g}){return o("div",{ref:n,...d,className:"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain outline-none",children:g})}function $e({sessionId:n,turnId:d,root:g,error:s,connected:R}){let L=h(null),b=_(),{t:H}=e(),w=z(()=>{b.loadHistoryTurn(n,d).catch(()=>{})},[b,n,d]);return E(()=>{if(!g||!L.current||!R||s)return;let V=new IntersectionObserver((v)=>{if(v.some((S)=>S.isIntersecting))V.disconnect(),w()},{root:g,rootMargin:"800px 0px"});return V.observe(L.current),()=>V.disconnect()},[g,R,s,w]),o("div",{ref:L,className:"flex min-h-80 flex-col justify-center gap-3 py-8","data-history-turn":d,"data-markdown-pending":!0,children:s?A("div",{className:"flex flex-col items-center gap-2",children:[o("p",{role:"alert",className:"text-destructive text-xs",children:s}),o(Z,{variant:"outline",size:"sm",onClick:w,disabled:!R,children:H("timeline.navigationRetry")})]}):A("div",{role:"status","aria-label":H("timeline.navigationLoading"),className:"space-y-3",children:[o("div",{className:"bg-muted ml-auto h-5 w-1/3 rounded"}),o("div",{className:"bg-muted h-3 w-4/5 rounded"}),o("div",{className:"bg-muted h-3 w-3/5 rounded"})]})})}function De(n,d){let g=h([]),s=h(null);if(s.current?.items!==n.items||s.current.state!==n.state||s.current.ended!==n.turnEndedAt||s.current.usage!==n.turnUsage||s.current.historyOrder!==d)s.current={state:n.state,items:n.items,ended:n.turnEndedAt,usage:n.turnUsage,historyOrder:d,turns:Fn(n,g.current,d)};let R=s.current.turns;return g.current=R,R}function ne(n){return o(D,{host:n.host,client:n.client,children:o(je,{...n})})}function je({session:n,leading:d,afterTurn:g,answerActions:s,turnFooter:R,renderUserMessage:L,insert:b,navigation:H,anchorNewTurn:w=!1,Viewport:V=_e}){let v=_(),S=e(),T=t((r)=>r.historyNavigation[n.id]),c=De(n,T?.turns),C=c.at(-1)?.key,Re=Un(n,c),y=n.state==="running"||n.state==="requires_action",j=Y(()=>$n(c,T),[c,T]),ee=Y(()=>j.flatMap((r)=>r.turn===void 0?[]:[{...r.turn,key:r.turnKey}]),[j]),Se=Y(()=>H===void 0?[]:In(c,n.turnUsage,T),[H,c,n.turnUsage,T]),te=b&&b.afterItemId!==null?c.findIndex((r)=>r.items.some((l)=>l.id===b.afterItemId)):-1,W=h(c);W.current=c;let[a,Pe]=U(null),x=t((r)=>r.historyPages[n.id]),P=t((r)=>r.connection==="ready"),Ie=t((r)=>Be(r.agent).sessionRetry),oe=x!==void 0;E(()=>{if(P&&oe&&!n.restoring)v.loadHistoryNavigation(n.id).catch(()=>{})},[v,P,oe,n.id,n.restoring]);let[He,Ne]=U(!1),O=h(null),[ke,le]=U(!1),ue=h(0),X=h({key:C,running:y});X.current={key:C,running:y};let[se,F]=U(0),N=h(0),k=h(null);N.current=se;let Ee=z(()=>{if(k.current!==null)k.current.keepTop=!1},[]),{isFollowing:M,scrollToBottom:G,stopFollowing:B,schedulePin:ce,contentResized:de,beginLocate:me,cancelLocation:fe}=qn(a,y,Ee),pe=z(()=>{if(a===null||!y)return;let r=c.at(-1)?.key;if(r===void 0)return;let l=me(!0),u=()=>l.isCurrent()&&X.current.running&&X.current.key===r,i=()=>requestAnimationFrame(()=>requestAnimationFrame(()=>{if(!u())return;let p=a.querySelector(`[data-codex-turn="${CSS.escape(r)}"]`);if(p===null)return;let m=a.scrollTop+p.getBoundingClientRect().top-a.getBoundingClientRect().top,I=Ue({turnTopPx:m,scrollHeightPx:a.scrollHeight,viewportHeightPx:a.clientHeight,spacerPx:N.current});k.current=I.spacerPx>0?{element:p,heightPx:p.getBoundingClientRect().height+I.spacerPx,keepTop:!0}:null,be(()=>F(I.spacerPx)),requestAnimationFrame(()=>{if(u())l.finish(I.scrollTopPx)})})),f=O.current;if(f===null)return;f.scrollToKey(r,void 0,{align:"top"}).then(()=>{if(u())i()})},[me,y,a,c]);he(()=>{if(!w||y)return;fe(),k.current=null,N.current=0,F(0)},[w,fe,y]);let J=z(()=>{B(),v.loadOlderHistory(n.id).catch(()=>{})},[v,n.id,B]);E(()=>{if(a===null)return;let r=()=>{let l=a.scrollTop<600;if(Ne(l),l&&!T?.complete&&P&&!n.restoring&&!M&&x?.cursor&&!x.loading&&!x.error)J()};return r(),a.addEventListener("scroll",r,{passive:!0}),()=>a.removeEventListener("scroll",r)},[P,x,M,J,a,n.restoring,T?.complete]),E(()=>{gn({sessionId:n.id,turns:ee,api:O.current,beforeReveal:B,terminals:n.terminals})},[n.id,n.terminals,ee,B]),E(()=>()=>fn(n.id),[n.id]);let Ae=z(async(r,l)=>{let u=++ue.current;le(!0);try{if(r.isLoaded===!1&&r.nativeTurnId!==void 0)await v.loadHistoryTurn(n.id,r.nativeTurnId),await new Promise((m)=>requestAnimationFrame(()=>m()));if(!l())return null;let i=W.current.find((m)=>m.user?.id===(r.messageId??r.id))??W.current.find((m)=>m.user!==null&&r.nativeTurnId!==void 0&&m.items.some((I)=>xe(I)===r.nativeTurnId));if(!i?.user)return null;let f=i.user.id,p=O.current;if(p===null)throw Error("Virtual timeline is not mounted");return await p.scrollToKey(i.key,(m)=>m.querySelector(`[data-content-search-unit-key="${CSS.escape(f)}"]`),{align:"top"}),document.querySelector(`[data-chat-scroll] [data-content-search-unit-key="${CSS.escape(f)}"]`)}finally{if(ue.current===u)le(!1)}},[v,n.id]),Le=z(async(r)=>{if(r.nativeTurnId!==void 0)await v.previewHistoryTurn(n.id,r.nativeTurnId)},[v,n.id]);E(()=>{if(a===null)return;let r=a.querySelector("[data-codex-timeline]");if(r===null)throw Error("Timeline content element is missing");let l=new ResizeObserver(()=>{let u=k.current,i=null;if(u!==null){let f=Math.max(0,u.heightPx-u.element.getBoundingClientRect().height);if(f!==N.current&&(f<N.current||u.keepTop)){if(N.current=f,be(()=>F(f)),f===0)k.current=null}if(f>0&&u.keepTop)i=a.scrollTop+u.element.getBoundingClientRect().top-a.getBoundingClientRect().top-we}de(i)});if(l.observe(r),l.observe(a),C!==void 0){let u=a.querySelector(`[data-codex-turn="${CSS.escape(C)}"]`);if(u===null)throw Error("Latest turn is not mounted");l.observe(u)}return()=>l.disconnect()},[de,C,a]),E(()=>{if(n.items.length===0)return;ce()},[ce,n.items]);let ge=h(null);he(()=>{if(a===null)return;let r=c.at(-1),l=ge.current;if(ge.current=r===void 0?null:{key:r.key,running:y},r===void 0||l===null||r.user===null||r.replayed)return;if(w){if(y&&n.turnEndedAt[r.user.id]===void 0&&(r.key!==l.key||!l.running))k.current=null,N.current=0,F(0),pe()}else if(r.key!==l.key)G()},[pe,w,y,G,a,n.turnEndedAt,c]);let Ce=(r,l)=>{let u=r,i=u.turn;if(i===void 0){if(u.nativeTurnId===void 0)throw Error(`Turn is missing at index ${l}`);return o($e,{sessionId:n.id,turnId:u.nativeTurnId,root:a,error:T?.turnErrors[u.nativeTurnId],connected:P&&!M&&!ke})}let f=c.indexOf(i),p=i.key===Re,m=zn(n,c,f),I=!p&&m.continued,K=i.key===C,q=i.errors.at(-1),ve=q===void 0?null:qe(q),Q=q===void 0?null:xe(q),Me=!n.subagent&&K&&!p&&P&&Ie&&n.attached&&!n.readOnly&&!n.restoring&&q===n.items.at(-1)&&ve!==null&&Fe(ve).category==="overloaded"&&Q!==null&&n.lastStopReason!=="end_turn"&&n.lastStopReason!=="cancelled",Te=R?.(i)??null,ze=i.work.length>0||i.final.length>0||i.errors.length>0||p||Te!==null||ie(i)||ct(i)||K&&(n.error!==null||n.lastStopReason==="cancelled"),ye=i.user===null?null:re(i);return A("div",{"data-virtualized-turn-content":!0,"data-codex-turn":i.key,className:"flex flex-col gap-1.5",children:[i.user!==null&&(L===void 0?o(bn,{item:i.user,messageTime:ye}):L(i.user,ye)),ze&&o(an,{sessionId:n.id,turn:i,terminals:n.terminals,active:p,blocked:n.state==="requires_action",continued:I,edits:m.edits,activityItems:m.items,workStartedAt:m.startedAt,isLast:K,error:n.error,retrying:p?Oe(n._meta)??void 0:void 0,retry:Me?{turnId:Q,delaySeconds:pn(c),run:(Ve)=>v.retrySession(n.id,Q,Ve)}:void 0,interrupted:ct(i)||!p&&K&&n.lastStopReason==="cancelled",answerActions:s?.(i),footer:Te}),l===te&&b?.node,g?.(i)]})};return A("div",{className:"relative flex min-h-0 flex-1 flex-col","data-stream-style":"codexUI",children:[o(V,{viewportRef:Pe,viewportProps:{"data-chat-scroll":"",style:{overflowAnchor:"none"},tabIndex:0,role:"log","aria-label":S.t("timeline.label")},children:o("div",{className:"codex-timeline-content flex min-h-full w-full flex-col",children:A("div",{"data-timeline-user-message-navigation-content":!0,className:"mx-auto flex w-full max-w-3xl shrink-0 flex-col",children:[b&&te===-1&&b.node,o(en,{ref:O,entries:j,renderTurn:Ce,scrollElement:a,sessionKey:n.id,preserveViewport:!M,leadingInsetPx:12,leadingContent:d===void 0?void 0:o("div",{className:"pt-3",children:d})}),w&&o("div",{"aria-hidden":"true","data-turn-anchor-spacer":!0,className:"shrink-0",style:{height:se}}),o("div",{"aria-hidden":"true",className:"h-6 shrink-0"})]})})}),o("div",{"aria-hidden":"true",className:"codex-timeline-bottom-fade"}),T?.error&&o("div",{className:"absolute inset-x-0 top-2 z-10 flex justify-center",children:o(Z,{variant:"outline",size:"sm",disabled:!P,title:T.error,onClick:()=>{v.loadHistoryNavigation(n.id).catch(()=>{})},children:S.t("timeline.navigationRetry")})}),He&&x?.cursor&&!T?.complete&&A("div",{className:"absolute inset-x-0 top-2 z-10 flex flex-col items-center gap-1","data-history-loader":!0,children:[o(Z,{variant:"outline",size:"sm",disabled:!P||n.restoring||x.loading,onClick:J,children:x.loading?S.t("timeline.loadingEarlier"):S.t("timeline.loadEarlier")}),x.error&&o("p",{role:"alert",className:"bg-background text-destructive max-w-md rounded px-2 py-1 text-xs",children:x.error})]}),H!==void 0&&o(Sn,{items:Se,audio:H.audio,scrollRoot:a,beforeReveal:B,ensureItemMounted:Ae,onPreviewItem:Le,onRevealError:(r)=>ae(S,r),targetTopMarginPx:16},n.id),o("button",{type:"button",className:M?"codex-scroll-to-bottom codex-scroll-to-bottom-hidden":"codex-scroll-to-bottom",tabIndex:M?-1:void 0,onClick:G,"aria-label":S.t("timeline.scrollToBottom"),children:y?A("span",{className:"codex-scroll-to-bottom-dots","aria-hidden":"true",children:[o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"})]}):o(Ke,{})})]})}
|
|
2
|
+
export{ne};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{m}from"./chunk-fcqwzmkd.js";import{e}from"./chunk-7dd374an.js";import{k}from"./chunk-qmc18ejg.js";import{ContentBlock as i}from"@agentclientprotocol/sdk/experimental/v2/unstable";import{isEmbeddedResource as u,isResourceLink as d}from"@nyssance/codex-acp-v2/client";import{jsx as n}from"react/jsx-runtime";function c({block:t,streaming:o}){let r=e();if(i.isText(t)){if(t.text.length===0)return null;return n("div",{className:"codex-assistant-message",children:n(m,{text:t.text,streaming:o})})}if(i.isImage(t))return n(k,{block:t,generated:!0});if(i.isAudio(t))return n("audio",{controls:!0,src:`data:${t.mimeType};base64,${t.data}`});if(d(t)||u(t))return n(k,{block:t,generated:!0});return n("div",{className:"text-muted-foreground",children:r.t("timeline.unsupportedContent",{type:t.type})})}function L({content:t,messageId:o,streaming:r}){return t.map((s,a)=>n(c,{block:s,streaming:r},`${o}:${a}`))}
|
|
2
|
+
export{L};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Vt}from"./chunk-0vy6cqmw.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 Kt(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 Vt(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{Kt};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{c,a,o}from"./chunk-107y8e8x.js";import{F,T,w}from"./chunk-5dk4xga8.js";import{Alert as P,AlertDescription as E}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as ue,DialogContent as me,DialogDescription as pe,DialogFooter as he,DialogHeader as fe,DialogTitle as ve}from"@nyssance/shadcn/vega/components/ui/dialog";import{Input as ge}from"@nyssance/shadcn/vega/components/ui/input";import{Select as R,SelectContent as xe,SelectItem as x,SelectTrigger as W,SelectValue as J}from"@nyssance/shadcn/vega/components/ui/select";import{Spinner as M}from"@nyssance/shadcn/vega/components/ui/spinner";import{sessionGroup as B}from"@nyssance/codex-acp-v2/client";import{cn as Se}from"cn";import{ArchiveIcon as ye,FolderIcon as X,ListFilterIcon as Le,SearchIcon as Ne,Trash2Icon as Y}from"lucide-react";import{useEffect as Ce,useRef as we,useState as d}from"react";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Z({className:u,...s}){return t(xe,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...s,className:Se("max-w-(--available-width) min-w-0 p-1",u)})}function q(u){return u instanceof Error?u.message:String(u)}function De({children:u}){return t("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t("div",{className:"flex flex-col gap-8",children:u})})}function Xn({Scroll:u=De}){let{t:s,i18n:I}=c(),m=a(),S=o((e)=>e.archivedSessions),N=o((e)=>e.connection),[z,ee]=d(""),[y,te]=d("all"),[p,se]=d("all"),[ie,ne]=d(0),[V,H]=d(!0),[j,O]=d(null),[G,K]=d(null),[C,D]=d(!1),h=we(!1),[b,f]=d(null),[Q,k]=d(null),[ae,U]=d(!1);Ce(()=>{if(N!=="ready")return;let e=!1;H(!0),O(null);async function l(){try{await m.listArchived({reset:!0});let n=new Set;while(!e&&m.state.archivedCursor!==null){let v=m.state.archivedCursor;if(n.has(v))throw Error("Archive pagination returned a repeated cursor");n.add(v),await m.listArchived()}}catch(n){if(!e)O(q(n))}finally{if(!e)H(!1)}}return l(),()=>{e=!0}},[m,N,ie]);let r=o((e)=>e.projectContext),A=!(r!==null&&N==="ready"&&!V&&j===null)||C,L=(e)=>e.title??s("sessionList.untitled"),re=[...new Set(S.filter((e)=>r&&B(r,e).id!==w).map((e)=>r?B(r,e).id:e.cwd))].toSorted(),le=z.trim().toLocaleLowerCase(I.language),_=S.filter((e)=>{let l=r?B(r,e).id:null,n=l===w;return L(e).toLocaleLowerCase(I.language).includes(le)&&(y==="all"||(y==="quick"?n:!n))&&(p==="all"||(p==="quick"?n:l===p))}),oe=new Intl.DateTimeFormat(I.language,{dateStyle:"medium",timeStyle:"short"});async function ce(e){if(h.current)return;h.current=!0,D(!0),K(null);try{await m.unarchive(e.sessionId)}catch(l){K(q(l))}finally{h.current=!1,D(!1)}}async function de(){if(h.current||!b)return;h.current=!0,D(!0),k(null);let e=[],l=[];try{for(let n of b){if(!m.state.archivedSessions.some((v)=>v.sessionId===n.sessionId))continue;try{await m.delete(n.sessionId)}catch(v){e.push(n),l.push(`${L(n)}: ${q(v)}`)}}if(e.length)f(e),k(l.join(`
|
|
2
|
+
`));else f(null)}finally{h.current=!1,D(!1)}}return i("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":s("sessionList.archives.title"),children:[i("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:[i("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[t("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:s("sessionList.archives.title")}),i(g,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:A||S.length===0,onClick:()=>{k(null),U(!0),f([...S])},children:[t(Y,{className:"size-4","aria-hidden":"true"}),s("sessionList.archives.deleteAll")]})]}),i("div",{className:"flex shrink-0 flex-wrap gap-3",children:[i("div",{className:"relative min-w-48 flex-1",children:[t(Ne,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),t(ge,{"aria-label":s("sessionList.archives.search"),placeholder:s("sessionList.archives.search"),value:z,onChange:(e)=>ee(e.target.value),className:"rounded-md ps-9"})]}),i(R,{value:y,onValueChange:(e)=>{if(e===null)throw Error("Archive chat type cannot be empty");te(e)},children:[i(W,{"aria-label":s("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[t(Le,{"aria-hidden":"true"}),t(J,{children:s(`sessionList.archives.${y==="all"?"allChats":y==="quick"?"quickChats":"projectChats"}`)})]}),i(Z,{children:[t(x,{value:"all",children:s("sessionList.archives.allChats")}),t(x,{value:"quick",children:s("sessionList.archives.quickChats")}),t(x,{value:"project",children:s("sessionList.archives.projectChats")})]})]}),i(R,{value:p,onValueChange:(e)=>{if(e===null)throw Error("Archive project filter cannot be empty");se(e)},children:[i(W,{"aria-label":s("sessionList.archives.project"),className:"w-48 rounded-md",children:[t(X,{"aria-hidden":"true"}),t(J,{className:"truncate",children:p==="all"?s("sessionList.archives.allProjects"):p==="quick"?s("sessionList.archives.noProject"):T(p,r??void 0)})]}),i(Z,{children:[t(x,{value:"all",children:s("sessionList.archives.allProjects")}),t(x,{value:"quick",children:s("sessionList.archives.noProject")}),re.map((e)=>t(x,{value:e,title:e,children:T(e,r??void 0)},e))]})]})]}),i(u,{children:[N!=="ready"?t("p",{role:"status",className:"text-muted-foreground",children:s("sessionList.archives.connecting")}):V?i("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[t(M,{}),s("sessionList.archives.loading")]}):j?t(P,{variant:"destructive",children:i(E,{className:"flex items-center justify-between gap-4",children:[t("span",{children:j}),t(g,{variant:"outline",onClick:()=>ne((e)=>e+1),children:s("sessionList.archives.retry")})]})}):S.length===0?i("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[t(ye,{"aria-hidden":"true",className:"size-8"}),t("p",{children:s("sessionList.archives.empty")})]}):_.length===0?t("p",{className:"text-muted-foreground py-12 text-center",children:s("sessionList.archives.noResults")}):(r?F(_,r):[]).filter(([,e])=>e.length>0).map(([e,l])=>i("section",{className:"flex flex-col gap-3",children:[i("div",{className:"flex items-center justify-between gap-3",children:[i("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:e===w?void 0:e,children:[t(X,{"aria-hidden":"true",className:"size-4 shrink-0"}),t("span",{className:"truncate",children:e===w?s("sessionList.archives.noProject"):T(e,r??void 0)})]}),t("span",{className:"text-muted-foreground shrink-0 text-sm",children:s("sessionList.archives.count",{count:l.length})})]}),t("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:l.map((n)=>i("article",{"aria-label":L(n),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[i("div",{className:"min-w-0 flex-1 basis-40",children:[t("h3",{className:"truncate text-sm font-medium",title:L(n),children:L(n)}),n.updatedAt!==null&&t("time",{dateTime:n.updatedAt,title:s("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:oe.format(new Date(n.updatedAt))})]}),i("div",{className:"flex shrink-0 items-center gap-2",children:[t(g,{variant:"ghost",size:"icon-sm","aria-label":s("sessionList.delete"),title:s("sessionList.delete"),disabled:A,className:"text-muted-foreground hover:text-destructive",onClick:()=>{k(null),U(!1),f([n])},children:t(Y,{"aria-hidden":"true"})}),t(g,{variant:"secondary",size:"sm",disabled:A,onClick:()=>void ce(n),children:s("sessionList.archives.unarchive")})]})]},n.sessionId))})]},e)),G&&t(P,{variant:"destructive",children:t(E,{children:G})})]})]}),t(ue,{open:b!==null,onOpenChange:(e)=>{if(!e&&!h.current)f(null)},children:i(me,{showCloseButton:!C,children:[i(fe,{children:[t(ve,{children:s("sessionList.archives.deleteTitle")}),t(pe,{children:s(ae?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:b?.length??0})})]}),Q&&t(P,{variant:"destructive",children:t(E,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:Q})}),i(he,{children:[t(g,{variant:"outline",disabled:C,onClick:()=>f(null),children:s("sessionList.cancel")}),i(g,{variant:"destructive",className:"text-sm font-normal",disabled:A,onClick:()=>void de(),children:[C&&t(M,{}),s("sessionList.archives.confirmDelete")]})]})]})})]})}
|
|
3
|
+
export{Xn};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{We}from"./chunk-09r35ts9.js";import{St}from"./chunk-01rfnabj.js";import{Y}from"./chunk-wkvm8f2e.js";import{Button as G}from"@nyssance/shadcn/vega/components/ui/button";import{Separator as rt}from"@nyssance/shadcn/vega/components/ui/separator";import{autoUpdate as st}from"@floating-ui/dom";import{cn as J}from"cn";import{BookOpenTextIcon as it,FileIcon as lt,StoreIcon as ut}from"lucide-react";import{useCallback as at,useEffect as d,useLayoutEffect as X,useMemo as Z,useRef as _,useState as v}from"react";import{createPortal as ct}from"react-dom";import{jsx as m,jsxs as w,Fragment as mt}from"react/jsx-runtime";function It({handleRef:u,anchorRef:a,commands:T,searchFiles:l,onMention:R,onSearchError:B,fileSearchDebounceMs:C=0,bashMode:H=!1,forcedOpen:s=!1,onForcedOpenChange:p,emptyLabel:F,fileStatusLabels:E,morePlugins:M}){let A=Y(),i=A.textInput.value,[j,z]=v(0),[g,D]=v(null),[x,h]=v(0),K=_(null);d(()=>{let t=u.current?.getTextarea();if(!t)return;let e=()=>z(t.selectionStart??0),n=()=>{if(document.activeElement===t)e()};return t.addEventListener("keyup",e),t.addEventListener("click",e),t.addEventListener("input",e),t.addEventListener("select",e),t.addEventListener("focus",e),document.addEventListener("selectionchange",n),()=>{t.removeEventListener("keyup",e),t.removeEventListener("click",e),t.removeEventListener("input",e),t.removeEventListener("select",e),t.removeEventListener("focus",e),document.removeEventListener("selectionchange",n)}});let U=Z(()=>H&&i.startsWith("!")?null:St(i,j),[i,j,H]),o=U?.kind==="at"&&!l?null:U,P=`${o?.kind??"forced"}:${o?.query??""}:${s}`,[O,tt]=v(P);if(O!==P)tt(P),h(0);let L=_(null);d(()=>{if(!s){L.current=null;return}if(L.current===null)L.current=i;else if(i!==L.current)p?.(!1)},[s,i,p]);let y=o?.kind==="at"?o.query:null;d(()=>{if(y===null||!l){D(null);return}let t=!0,e=()=>{l(y).then((r)=>{if(t)D({query:y,search:l,items:r})},(r)=>{if(t)D({query:y,search:l,items:[]}),B(r)})},n=C>0?window.setTimeout(e,C):null;if(n===null)e();return()=>{if(t=!1,n!==null)window.clearTimeout(n)}},[y,l,C,B]);let f=Z(()=>{if(o?.kind==="at")return g?.query===o.query&&g.search===l?g.items:[];if(o)return We(T,o.query);if(s)return We(T,"");return[]},[o,s,T,g,l]),[et,q]=v(!1);d(()=>{let t=u.current?.getTextarea();if(!t)return;let e=()=>q(!0),n=()=>{if(q(!1),s)p?.(!1)};return q(document.activeElement===t),t.addEventListener("focus",e),t.addEventListener("blur",n),()=>{t.removeEventListener("focus",e),t.removeEventListener("blur",n)}},[u,s,p]),d(()=>{if(s)u.current?.getTextarea()?.focus()},[s,u]);let c=et&&(o!==null?o.kind==="slash"||f.length>0||!!E:s);d(()=>{if(!c)return;K.current?.querySelector(`[data-idx="${x}"]`)?.scrollIntoView({block:"nearest"})},[x,c]);function V(t){let e=u.current?.getTextarea();if(!e)return;let n,r;if(o){let S=o.kind==="slash"?`/${t.payload} `:`@${t.label} `;if(n=i.slice(0,o.start)+S+i.slice(o.end),o.kind==="at")R?.(t.payload);r=o.start+S.length}else if(s)n=`${i.length===0||i.endsWith(`
|
|
2
|
+
`)?i:`${i}
|
|
3
|
+
`}/${t.payload} `,r=n.length,p?.(!1);else return;A.textInput.setInput(n),requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(r,r)})}d(()=>{let t=u.current?.getTextarea();if(!t)return;let e=(n)=>{if(!c)return;if(u.current?.isComposing()||n.isComposing||n.keyCode===229)return;if(n.key==="ArrowDown")n.preventDefault(),n.stopPropagation(),h((r)=>f.length===0?0:Math.min(f.length-1,r+1));else if(n.key==="ArrowUp")n.preventDefault(),n.stopPropagation(),h((r)=>Math.max(0,r-1));else if(n.key==="Enter"||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let r=f[x];if(r)V(r)}else if(n.key==="Escape")if(n.preventDefault(),n.stopPropagation(),o)z(Math.max(0,o.start-1)),t.setSelectionRange(o.start,o.start);else p?.(!1)};return t.addEventListener("keydown",e,!0),()=>t.removeEventListener("keydown",e,!0)});let[b,W]=v(null),[N,nt]=v(null),I=at(()=>{let t=a?.current;if(!t)return;let e=t.getBoundingClientRect();W({left:e.left,width:e.width,bottom:window.innerHeight-e.top+8})},[a]);if(X(()=>{if(!c){W(null);return}I()},[c,I]),X(()=>{let t=a?.current;if(!c||!t||!N)return;return st(t,N,I,{animationFrame:!0})},[c,N,a,I]),!c||a&&!b)return null;let k=o?o.kind==="slash":s,ot=k?it:lt,Q=m("div",{ref:nt,className:a?"fixed z-50":"absolute inset-x-0 bottom-full z-50 mb-2",style:a&&b?{left:b.left,width:b.width,bottom:b.bottom}:void 0,children:w("div",{ref:K,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:[w("div",{className:"max-h-72 overflow-y-auto",children:[f.length===0&&k&&m("div",{className:"text-muted-foreground px-2 py-3 text-xs",children:F}),f.length===0&&!k&&E&&m("div",{role:"status",className:"text-muted-foreground px-2 py-3 text-xs",children:g?.query===y&&g.search===l?E.empty:E.loading}),f.map((t,e)=>w(G,{type:"button",variant:"ghost",role:"option","aria-selected":e===x,"data-idx":e,onMouseDown:(n)=>{n.preventDefault(),V(t)},onMouseEnter:()=>h(e),className:J("flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-2.5 py-2 text-start",e===x&&"bg-muted"),children:[m(ot,{className:J("size-4 shrink-0",k?"text-blue-500":"text-muted-foreground")}),m("span",{className:"text-foreground shrink-0 text-sm font-medium",children:t.label}),t.description&&m("span",{className:"text-muted-foreground min-w-0 flex-1 truncate text-xs",children:t.description})]},t.key))]}),k&&M&&w(mt,{children:[m(rt,{}),w(G,{type:"button",variant:"ghost",onMouseDown:(t)=>{t.preventDefault(),p?.(!1),M.open()},className:"h-auto w-full justify-start px-2.5 py-2",children:[m(ut,{"data-icon":"inline-start"}),M.label]})]})]})});return a?ct(Q,document.body):Q}
|
|
4
|
+
export{It};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t}from"./chunk-7dd374an.js";import{Ae,n,g}from"./chunk-3hp5t5wf.js";import{we}from"./chunk-5my9w4vd.js";import{Re}from"./chunk-yjhypkmc.js";import{xe,ye}from"./chunk-a414w7ah.js";import{be}from"./chunk-e9znmqdj.js";import{Alert as v,AlertDescription as y,AlertTitle as x}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as u}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as E,EmptyDescription as T,EmptyHeader as b,EmptyTitle as k}from"@nyssance/shadcn/vega/components/ui/empty";import{LockIcon as O,UnplugIcon as H}from"lucide-react";import{useMemo as P}from"react";import{jsx as o,jsxs as r}from"react/jsx-runtime";function no({host:e,client:a,...l}){let c=P(()=>e.openDiff?e:{...e,openDiff:xe},[e]);return r(Ae,{host:c,client:a,children:[o(S,{...l}),!e.openDiff&&o(ye,{})]})}function S({session:e,header:a,overlay:l,timeline:c,composer:C,readOnlyActions:N,welcome:w,children:h,rootRef:D}){let{host:m,client:A}=n(),{t:i}=m,d=t((s)=>s.connection==="ready"),p=t((s)=>s.historyPages[e.id]?.error),f=()=>g(m,A.open(e.id,e.cwd)),R=e.items.length===0&&e.attached&&!e.restoring&&e.state==="idle";return r("div",{"data-chat-drop-zone":!0,ref:D,className:"flex h-full min-h-0 flex-col",children:[a,r("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[l,d&&!e.attached&&!e.restoring&&!e.readOnly&&o("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:r(v,{children:[o(H,{}),o(x,{children:i("conversation.stopped")}),o(y,{children:o(u,{size:"sm",variant:"outline",onClick:f,children:i("conversation.reconnect")})})]})}),R?w??o(E,{className:"flex-1",children:r(b,{children:[o(k,{className:"text-[28px] font-normal",children:i("conversation.welcomeTitle")}),o(T,{children:i("conversation.welcomeDescription")})]})}):o(Re,{session:e,timeline:c}),o(be,{sessionId:e.id}),e.readOnly?o("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:r(v,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[r("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[o(O,{"aria-hidden":"true",className:"size-4 shrink-0"}),r("div",{className:"min-w-0 space-y-1",children:[o(x,{children:i("conversation.readOnlyTitle")}),o(y,{children:i("conversation.readOnlyDescription")}),p&&o("p",{role:"alert",className:"text-destructive break-words",children:p})]})]}),r("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[o(u,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:f,disabled:!d||e.restoring,children:i(e.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),N]})]})}):C??o(we,{session:e})]}),h]})}
|
|
2
|
+
export{no};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function*Oe(n,e){if(e.length===0)return;let r=new RegExp(e.replaceAll(/[.*+?^{}()|[\]\\$]/g,String.raw`\$&`),"giu");for(let t of n.matchAll(r))yield{start:t.index,end:t.index+t[0].length}}function Po(n,e){if(e.length===0)return[];let r=[];for(let{turnKey:t,segments:o}of n){let c=0;for(let s of o)for(let a of Oe(s,e))r.push({turnKey:t,occurrenceInTurn:c}),c+=1}return r}
|
|
2
|
+
export{Oe,Po};
|
|
@@ -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 ot=r({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}});function gn(e){ot.setState({...e,terminals:e.terminals??{}})}function fn(e){if(ot.getState().sessionId===e)ot.setState({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}})}async function qo(e,n,t){let i=ot.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{ot,gn,fn,qo};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function vt(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function Be(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function H(t){return t.type==="array"}function le(t){return(H(t)?t.items?.oneOf??[]:t.oneOf??[]).map((e)=>{let i=e,r=i.const??i.title??"";return{value:r,label:i.title??r,...i.description?{description:i.description}:{},...i._meta?.alwith?.preview?{preview:i._meta.alwith.preview}:{}}})}
|
|
2
|
+
export{vt,Be,H,le};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{tn,z,Ye,nn,on,rn}from"./chunk-pzmd5d3m.js";import{forwardRef as ve,useCallback as K,useEffect as he,useImperativeHandle as pe,useLayoutEffect as w,useMemo as re,useRef as s,useState as F}from"react";import{jsx as R,jsxs as ie}from"react/jsx-runtime";var Re=12,j=2,q=800,me=new Map;function be({turnKey:W,heightPx:x,placeholder:_=!1,deferUntilReady:n=!1,observe:b,onReady:L,children:N}){let h=s(null),[H,U]=F(!1),G=K((m)=>{h.current=m,b(W,m)},[b,W]);return w(()=>{let m=h.current;if(m===null)throw Error("Codex turn element is missing");let T=()=>{L(m),U(!0)};if(m.querySelector("[data-markdown-pending]")===null){T();return}let d=new MutationObserver(()=>{if(m.querySelector("[data-markdown-pending]")!==null)return;d.disconnect(),T()});return d.observe(m,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-markdown-pending"]}),()=>d.disconnect()},[L]),ie("div",{style:H?void 0:{position:"relative",height:x,overflow:"hidden"},children:[R("div",{ref:G,className:"[&_[data-virtualized-turn-content]]:[content-visibility:visible]","data-turn-key":W,"aria-busy":!H||void 0,style:!H&&!_&&n?{visibility:"hidden"}:void 0,"data-turn-ready":H?"":void 0,children:N}),!H&&!_&&n&&R("div",{"aria-hidden":"true",className:"codex-turn-loading",children:ie("div",{className:"codex-turn-loading-lines",children:[R("span",{}),R("span",{}),R("span",{})]})})]})}var en=ve(function({entries:x,renderTurn:_,scrollElement:n,sessionKey:b,leadingContent:L,leadingInsetPx:N=0,preserveViewport:h=!1},H){let U=s(null),[G,m]=F(N),T=L!==void 0&&L!==null;w(()=>{let e=U.current;if(e===null)return;let t=()=>m(e.getBoundingClientRect().height);t();let o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[T]);let d=re(()=>me.get(b),[b]),[J,Q]=F(()=>d?.turnHeightsByKey??{}),i=re(()=>tn({entries:x,gapPx:Re,measuredHeightsByKey:J,leadingInsetPx:T?G:N}),[x,J,T,G,N]),fe=re(()=>{let e=z({distanceFromBottomPx:d?.distanceFromBottomPx??0,layout:i,overscanCount:j,viewportHeightPx:q}),t=d?.renderedWindow;if(t===void 0||t===null)return e;return Ye({anchorKey:t.anchorKey,layout:i,previousRange:{startIndex:0,endIndex:Math.min(t.count,e.endIndex-e.startIndex)}})??e},[d,i]),[M,oe]=F(fe),[y,ue]=F(q),[c,ae]=F(null),k=s(d?.distanceFromBottomPx??0),S=s(M),se=s(i.turnKeys),l=s(J),E=s(i),ce=s(i),P=s(new Map),v=s(null),C=s(null),D=s(null),O=s(new Map),Y=s(!1),de=s(()=>{}),A=s(null),le=K(()=>{if(!h||n===null||v.current!==null||A.current!==null)return;let e=n.getBoundingClientRect();if(e.height<=0)return;let t=[...P.current].filter(([,r])=>r.hasAttribute("data-turn-ready")).map(([r,u])=>{let a=u.getBoundingClientRect(),g=E.current.turnIndexByKey.get(r),B=g===void 0?a.height:E.current.heightsPx[g];return{key:r,element:u,rect:a,bottom:a.top+B}}).filter(({rect:r,bottom:u})=>u>e.top&&r.top<e.bottom).toSorted((r,u)=>r.rect.top-u.rect.top),o=t.flatMap((r)=>[...r.element.querySelectorAll("[data-user-message-bubble], .codex-markdown-root > *")].filter((u)=>!u.closest('[aria-hidden="true"], [inert]')).map((u)=>({key:r.key,element:u,rect:u.getBoundingClientRect()})).filter(({rect:u})=>u.height>0&&u.top>=e.top&&u.top<e.bottom)).toSorted((r,u)=>r.rect.top-u.rect.top)[0]??t[0];if(o)A.current={key:o.key,element:o.element,top:o.rect.top-e.top,scrollTop:n.scrollTop}},[h,n]),Z=s(le);Z.current=le;let p=K((e,t)=>{let o=Math.min(e,i.totalHeightPx),r=z({distanceFromBottomPx:o,layout:i,overscanCount:j,viewportHeightPx:t}),u=S.current,a=u.startIndex<=r.startIndex&&u.endIndex>=r.endIndex?u:r;if(k.current=o,S.current=a,se.current=i.turnKeys,ue(t),a!==u)oe(a)},[i]),V=K((e)=>{let t=Math.max(0,e.scrollHeight-i.totalHeightPx);return Math.max(0,e.scrollHeight-e.clientHeight-e.scrollTop-t)},[i.totalHeightPx]),xe=K((e)=>{let t=e.dataset.turnKey;if(t===void 0)throw Error("Codex measured turn is missing its key");let o=Math.max(1,e.getBoundingClientRect().height);if(l.current[t]===o)return;Z.current();let r={...l.current,[t]:o};l.current=r,Q(r)},[]),ee=K(()=>{if(C.current!==null)return C.current;return C.current=new ResizeObserver((e)=>{for(let t of e){let o=t.target;if(!("turnReady"in o.dataset)&&o.querySelector("[data-markdown-pending]")!==null)continue;let r=o.dataset.turnKey;if(r===void 0)throw Error("Codex measured turn is missing its key");let u=Math.max(1,t.borderBoxSize[0]?.blockSize??t.contentRect.height);O.current.set(r,u)}if(D.current!==null||O.current.size===0)return;D.current=requestAnimationFrame(()=>{D.current=null;let t=[...O.current].filter(([r,u])=>l.current[r]!==u);if(O.current.clear(),t.length===0)return;Z.current();let o={...l.current,...Object.fromEntries(t)};l.current=o,Q(o)})}),C.current},[]),ye=K((e,t)=>{let o=P.current.get(e);if(o!==void 0)ee().unobserve(o),P.current.delete(e);if(t===null)return;if(t.dataset.turnKey!==e)throw Error(`Codex turn key does not match its element: ${e}`);P.current.set(e,t),ee().observe(t)},[ee]);he(()=>()=>{if(C.current?.disconnect(),D.current!==null)cancelAnimationFrame(D.current);O.current.clear(),C.current=null,P.current.clear()},[]),w(()=>{de.current=()=>{if(n===null)return;let e=V(n);if(v.current!==null){k.current=e,ue(n.clientHeight||q);return}p(e,n.clientHeight||q)}},[V,n,p]),w(()=>{if(n===null)return;if(!Y.current){Y.current=!0;let o=d?.distanceFromBottomPx??0;n.scrollTo({behavior:"instant",top:Math.max(0,o>0?E.current.totalHeightPx-n.clientHeight-o:n.scrollHeight-n.clientHeight)})}let e=()=>de.current();e(),n.addEventListener("scroll",e,{passive:!0});let t=new ResizeObserver(e);return t.observe(n),()=>{n.removeEventListener("scroll",e),t.disconnect()}},[d,n]),w(()=>{if(n===null||c===null)return;let e=P.current.get(c.turnKey);if(e?.querySelector("[data-markdown-pending]")!==null)return;let t=e.offsetHeight;if(t<=0)return;if(l.current[c.turnKey]!==t){let g={...l.current,[c.turnKey]:t};l.current=g,Q(g);return}let o=c.getTargetElement(e)??e,r=e.getBoundingClientRect(),u=o.getBoundingClientRect(),a=rn({align:c.align,layout:i,targetHeightPx:u.height,targetOffsetPx:u.top-r.top,turnKey:c.turnKey,viewportHeightPx:n.clientHeight});if(a===null)throw Error(`Codex virtual turn is missing: ${c.turnKey}`);n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-a)}),p(a,n.clientHeight||q),queueMicrotask(()=>{if(v.current!==c)return;c.complete(),v.current=null,ae(null)})},[i,c,n,p]),w(()=>{let e=ce.current;if(ce.current=i,E.current=i,n===null||c!==null){A.current=null;return}let t=A.current;A.current=null;let o=t===null?void 0:n.contains(t.element)?t.element:P.current.get(t.key);if(h&&e!==i&&t!==null&&o!==void 0){let u=o.getBoundingClientRect().top-n.getBoundingClientRect().top,a=n.scrollTop-t.scrollTop;n.scrollTop+=u-t.top+a,p(V(n),n.clientHeight);return}let r=k.current;if(h&&e!==i&&Y.current)r=Math.max(0,e.totalHeightPx-n.clientHeight-n.scrollTop);if((r>24||h)&&e!==i){let u=V(n);if(u<=96&&!h){p(u,y);return}let a=z({distanceFromBottomPx:r,layout:e,overscanCount:0,viewportHeightPx:y}),g=e.turnKeys.slice(a.startIndex,a.endIndex).filter((f)=>i.turnIndexByKey.has(f)),B=g.find((f)=>l.current[f]!==void 0)??g[0];if(B!==void 0){let f=nn({anchorKey:B,distanceFromBottomPx:r,nextLayout:i,previousLayout:e});if(f===null)throw Error(`Codex viewport anchor is missing: ${B}`);r=f,n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-r)})}}p(r,y)},[i,c,V,n,p,y,h]),w(()=>{S.current=M},[M]),he(()=>()=>{v.current?.complete(),v.current=null;let e=S.current,o=E.current.turnKeys[e.startIndex];me.set(b,{distanceFromBottomPx:k.current,renderedWindow:o===void 0?null:{anchorKey:o,count:e.endIndex-e.startIndex},turnHeightsByKey:l.current})},[b]),pe(H,()=>({scrollToKey(e,t=(r)=>r,o={align:"center"}){v.current?.complete();let r=i.turnIndexByKey.get(e);if(r===void 0)throw Error(`Codex virtual turn is missing: ${e}`);let u=i.turnKeys[r],a=on({layout:i,turnKey:e,viewportHeightPx:y});if(a===null)throw Error(`Codex virtual turn is missing: ${e}`);let g=z({distanceFromBottomPx:a,layout:i,overscanCount:j,viewportHeightPx:y});return S.current=g,oe(g),new Promise((B)=>{let f={align:o.align,complete:B,getTargetElement:t,turnKey:u};v.current=f,ae(f)})}}),[i,y]);let I=M,X=se.current;if(!(X===i.turnKeys||X.length===i.turnKeys.length&&X.every((e,t)=>e===i.turnKeys[t]))){let e=X[M.startIndex];I=(e===void 0?null:Ye({anchorKey:e,layout:i,previousRange:M}))??z({distanceFromBottomPx:k.current,layout:i,overscanCount:j,viewportHeightPx:y})}let te=x.length-1,ge=x[te],ne=x.slice(I.startIndex,Math.min(I.endIndex,te)).map((e,t)=>({entry:e,index:I.startIndex+t}));if(ge!==void 0)ne.push({entry:ge,index:te});return ie("div",{"data-codex-timeline":!0,"data-codex-virtualized-pending-key":c?.turnKey,"data-codex-virtualized-range":`${I.startIndex}:${I.endIndex}`,"data-codex-virtualized-total-count":x.length,"data-codex-virtualized-turn-count":ne.length,className:"relative shrink-0",style:{height:i.totalHeightPx},children:[T&&R("div",{ref:U,"data-codex-timeline-leading":!0,className:"absolute inset-x-0 top-0",children:L}),ne.map(({entry:e,index:t})=>R("div",{className:"absolute inset-x-0",style:{top:i.topOffsetsPx[t]??0},children:R(be,{turnKey:e.turnKey,heightPx:i.heightsPx[t],placeholder:e.placeholder,deferUntilReady:e.deferUntilReady,observe:ye,onReady:xe,children:_(e,t)})},e.turnKey))]})});
|
|
2
|
+
export{en};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Pn}from"./chunk-jc52024g.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 Mn({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(Pn,{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{Mn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p}from"./chunk-wkvm8f2e.js";import{n}from"./chunk-3hp5t5wf.js";import{Q}from"./chunk-5tqygmg9.js";import{Button as r}from"@nyssance/shadcn/vega/components/ui/button";import{FileText as x,RotateCcw as d,X as u}from"lucide-react";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Dt({data:e,sessionId:m}){let{host:s}=n(),{t:a}=s,c=p(),{text:l,status:o}=e.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(r,{type:"button",variant:"ghost",disabled:o!=="ready",onClick:()=>s.openLink(e.url),className:"h-auto min-w-0 flex-1 shrink gap-2 overflow-hidden px-0 py-1",children:[t(x,{className:"size-4 shrink-0"}),i("span",{className:"min-w-0 flex-1 text-start",children:[t("span",{className:"block truncate text-xs",children:e.filename}),t("span",{className:"text-muted-foreground block text-xs",children:o==="ready"?a("composer.pastedTextCharacters",{count:l.length}):a(o==="pending"?"composer.pastedTextPending":"composer.pastedTextError")})]})]}),o==="error"&&s.writeTextAttachment&&t(r,{type:"button",variant:"ghost",size:"icon-xs","aria-label":a("composer.pastedTextRetry"),onClick:()=>Q(m,e,s.writeTextAttachment),children:t(d,{className:"size-3"})}),t(r,{type:"button",variant:"ghost",size:"icon-xs","aria-label":a("composer.pastedTextRemove"),onClick:()=>c.remove(e.id),children:t(u,{className:"size-3"})})]})}
|
|
2
|
+
export{Dt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jt,A}from"./chunk-x480gyp7.js";import{Kt}from"./chunk-qy2prx7m.js";import{Ge,Qe,X,Z,Xe}from"./chunk-wkvm8f2e.js";import{InputGroup as he,InputGroupAddon as ne,InputGroupButton as oe}from"@nyssance/shadcn/vega/components/ui/input-group";import{cn as P}from"cn";import{ArrowUpIcon as Pe,Loader2Icon as Ie,SquareIcon as ye,XIcon as xe}from"lucide-react";import{Children as te,useCallback as h,useEffect as F,useMemo as Le,useRef as M,useState as Te}from"react";import{flushSync as Fe}from"react-dom";import{jsx as a,jsxs as Me}from"react/jsx-runtime";function re(u){let o=new FormData(u).get("message");return typeof o==="string"?o:""}var Bt=({className:u,bashMode:o=!1,attachmentPolicy:I,onCommand:d,onSubmitError:y,canSubmit:f,onSubmitAsync:g,accept:E,multiple:se,globalDrop:C,syncHiddenInput:B,maxFiles:H,maxFileSize:k,onError:b,onSubmit:ie,children:ae,...ue})=>{let s=Z(),l=!!s,le=o&&l&&s.textInput.value.startsWith("!"),x=M(null),w=M(null),D=M(!1),[pe,R]=Te([]),c=l?s.attachments.files:pe,O=M(c);O.current=c;let me=h(()=>{x.current?.click()},[]),W=h((e)=>{if(!E||E.trim()==="")return!0;return E.split(",").map((t)=>t.trim()).filter(Boolean).some((t)=>{if(t.endsWith("/*")){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t})},[E]),G=h((e)=>{if(e.type)return e.type;let r=(e.name||"").toLowerCase();if(r.endsWith(".png"))return"image/png";if(r.endsWith(".jpg")||r.endsWith(".jpeg"))return"image/jpeg";if(r.endsWith(".webp"))return"image/webp";if(r.endsWith(".gif"))return"image/gif";if(r.endsWith(".bmp"))return"image/bmp";if(r.endsWith(".svg"))return"image/svg+xml";return""},[]),ce=h((e)=>{let r=[...e],t=r.filter((i)=>W(i));if(r.length&&t.length===0){b?.({code:"accept",message:"No files match the accepted types."});return}let n=(i)=>k?i.size<=k:!0,m=t.filter(n);if(t.length>0&&m.length===0){b?.({code:"max_file_size",message:"All files exceed the maximum size."});return}R((i)=>{let v=I?I.uniqueFiles(m,i):m,p=typeof H==="number"?Math.max(0,H-i.length):void 0,z=typeof p==="number"?v.slice(0,p):v;if(typeof p==="number"&&v.length>p)b?.({code:"max_files",message:"Too many files. Some were not added."});let Y=[];for(let T of z){let ee=I?.sourcePath(T);Y.push({id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(T),mediaType:G(T),filename:T.name,size:T.size,lastModified:T.lastModified,...ee===void 0?{}:{sourcePath:ee}})}return[...i,...Y]})},[I,G,W,H,k,b]),de=h((e)=>R((r)=>{let t=r.find((n)=>n.id===e);if(t?.url)URL.revokeObjectURL(t.url);return r.filter((n)=>n.id!==e)}),[]),fe=h(()=>R((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),j=l?s.attachments.add:ce,L=h((e)=>{let r=[...e],t=r.filter((m)=>!(m.type??"").toLowerCase().startsWith("image/"));if(t.length>0){b?.({code:"unsupported_type",message:`Only image attachments are supported. ${t.length} non-image file(s) were ignored.`});return}let n=r.reduce((m,i)=>m+i.size,0);if(n>0){let m=c.filter((i)=>(i.mediaType??"").toLowerCase().startsWith("image/")).reduce((i,v)=>i+(v.size??0),0);if(jt(m,n)){b?.({code:"max_total_size",message:`Total image size must not exceed ${A}MB.`});return}}j(r)},[c,j,b]),q=l?s.attachments.remove:de,U=l?s.attachments.clear:fe,J=l?s.attachments.openFileDialog:me;F(()=>{if(!l)return;s.__registerFileInput(x,()=>x.current?.click())},[l,s]),F(()=>{if(B&&x.current&&c.length===0)x.current.value=""},[c,B]),F(()=>{let e=w.current;if(!e)return;if(C)return;let r=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault()},t=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault();if(n.dataTransfer?.files&&n.dataTransfer.files.length>0)L(n.dataTransfer.files)};return e.addEventListener("dragover",r),e.addEventListener("drop",t),()=>{e.removeEventListener("dragover",r),e.removeEventListener("drop",t)}},[L,C]),F(()=>{if(!C)return;let e=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault()},r=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault();if(t.dataTransfer?.files&&t.dataTransfer.files.length>0)L(t.dataTransfer.files)};return document.addEventListener("dragover",e),document.addEventListener("drop",r),()=>{document.removeEventListener("dragover",e),document.removeEventListener("drop",r)}},[L,C]),F(()=>()=>{if(!l){for(let e of O.current)if(e.url)URL.revokeObjectURL(e.url)}},[l]);let ge=(e)=>{if(e.currentTarget.files)L(e.currentTarget.files);e.currentTarget.value=""},K=Le(()=>({files:c.map((e)=>({...e,id:e.id})),add:L,remove:q,clear:U,openFileDialog:J,fileInputRef:x}),[c,L,q,U,J]),S=M({controller:s,files:c,canSubmit:f});S.current={controller:s,files:c,canSubmit:f};let _=M(!0);F(()=>(_.current=!0,()=>{_.current=!1}),[]);let Q=async(e)=>{let r=f===void 0?!0:f();if(r!==!0)return{status:"blocked",reason:r};if(D.current)return{status:"blocked",reason:"submission_pending"};if(e===null&&g===void 0)throw Error("Awaitable submission requires onSubmitAsync");let t=w.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let n=l?s.textInput.value:re(t),m=s?.textInput.getRevision?.(),i=c,v=()=>{if(!_.current)return;let p=S.current;if(p.files!==i)return;if(l){if(m===void 0||p.controller===null||p.controller.textInput.getRevision?.()!==m)return;if(p.controller.textInput.clearSubmitted===void 0)p.controller.textInput.clear();else p.controller.textInput.clearSubmitted()}else if(re(t)===n)t.reset();U()};D.current=!0;try{if(d?.(n.trim()))return v(),{status:"accepted"};let p=await Kt(i),z=S.current.canSubmit===void 0?!0:S.current.canSubmit();if(z!==!0)return{status:"blocked",reason:z};if(!_.current)return{status:"blocked",reason:"form_unmounted"};if(p.rejectedCount>0)b?.({code:"accept",message:"One or more images are corrupted and were removed before sending."});if(g!==void 0)await g({text:n,files:p.files});else if(e!==null)await ie({text:n,files:p.files},e);return v(),{status:"accepted"}}finally{D.current=!1}},be=(e)=>{e.preventDefault(),Q(e).catch(y)},ve=h((e)=>{if(!e.trim())return;if(l&&s)Fe(()=>{s.textInput.setInput(e)});w.current?.requestSubmit()},[s,l]),V=a(Qe.Provider,{value:()=>Q(null),children:Me(Ge.Provider,{value:ve,children:[a("input",{accept:E,"aria-label":"Upload files",className:"hidden",multiple:se,onChange:ge,ref:x,title:"Upload files",type:"file"}),a("form",{className:P("w-full",u),onSubmit:be,ref:w,"data-tour":"chat-input",...ue,children:a(he,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",le&&"border! border-[rgb(255,0,135)] has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(255,0,135)] dark:border-[rgb(253,93,177)] dark:has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(253,93,177)]"),children:ae})})]})});return l?a(X.Provider,{value:K,children:V}):a(Xe.Provider,{value:K,children:V})};function Ut({className:u,...o}){return a("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",u),...o})}function zt({className:u,...o}){return a(ne,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",u),...o})}function $t({className:u,...o}){return a(ne,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",u),...o})}function qt({className:u,...o}){return a("div",{className:P("flex items-center gap-1",u),...o})}var N=({variant:u="ghost",className:o,size:I,collapsed:d=!1,...y})=>{let f=d||te.count(y.children)<=1?"icon-xs":"xs";return a(oe,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(d||te.count(y.children)<=1)&&"size-7",o),size:f,type:"button",variant:u,...y})},Wt=({className:u,variant:o="ghost",size:I="icon-xs",status:d,children:y,...f})=>{let g=a(Pe,{className:"size-4"});if(d==="submitted")g=a(Ie,{className:"size-4 animate-spin"});else if(d==="streaming")g=a(ye,{className:"size-3 fill-current"});else if(d==="error")g=a(xe,{className:"size-4"});return a(oe,{"aria-label":"Submit",className:P("bg-foreground text-background hover:bg-foreground/70 size-7 rounded-full p-0 transition-opacity disabled:opacity-50",u),size:I,type:"submit",variant:o,...f,children:y??g})};
|
|
2
|
+
export{Bt,Ut,zt,$t,qt,N,Wt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createContext as f,useCallback as n,useContext as i,useEffect as V,useMemo as q,useRef as g,useState as z}from"react";import{jsx as D}from"react/jsx-runtime";var F=f(null),Ge=f(null);function Do(){return i(Ge)}var Qe=f(null);function _o(){return i(Qe)}var X=f(null);function Y(){let r=i(F);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");return r}var Z=()=>i(F);function Ho(){let r=i(X);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");return r}var tt=()=>i(X);function Gt({initialInput:r="",revision:l,onSubmittedClear:c,onRemoveAttachment:A,attachmentPolicy:P,value:R,onValueChange:y,attachments:U,onAttachmentsChange:L,children:B}){let S=n((t)=>{if(t.type)return t.type;let e=(t.name||"").toLowerCase();if(e.endsWith(".png"))return"image/png";if(e.endsWith(".jpg")||e.endsWith(".jpeg"))return"image/jpeg";if(e.endsWith(".webp"))return"image/webp";if(e.endsWith(".gif"))return"image/gif";if(e.endsWith(".bmp"))return"image/bmp";if(e.endsWith(".svg"))return"image/svg+xml";return""},[]),T=R!==void 0,[G,J]=z(r),a=R??G,o=g({value:a,external:l,revision:0});if(o.current.value!==a||o.current.external!==l)o.current={value:a,external:l,revision:o.current.revision+1};let W=n(()=>o.current.revision,[]),x=n((t)=>{if(o.current.value=t,o.current.revision++,T)y?.(t);else J(t)},[T,y]),h=n(()=>x(""),[x]),v=U!==void 0,[K,N]=z([]),I=U??K,b=g(I);b.current=I;let s=n((t)=>{let e=typeof t==="function"?t(b.current):t;if(v)L?.(e);else N(e)},[v,L]),j=g(null),w=g(()=>{}),O=n((t)=>{let e=[...t];if(e.length===0)return;s((m)=>{let d=P===void 0?e:P.uniqueFiles(e,m);return[...m,...d.map((u)=>{let _=P?.sourcePath(u);return{id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(u),mediaType:S(u),filename:u.name,size:u.size,lastModified:u.lastModified,..._===void 0?{}:{sourcePath:_}}})]})},[P,S,s]),M=n((t)=>{s((e)=>{let m=e.find((d)=>d.id===t);if(m?.url)URL.revokeObjectURL(m.url);return e.filter((d)=>d.id!==t)}),A?.()},[A,s]),E=n(()=>{s((t)=>{for(let e of t)if(e.url)URL.revokeObjectURL(e.url);return[]})},[s]);V(()=>{if(v)return;return()=>{for(let t of b.current)if(t.url)URL.revokeObjectURL(t.url)}},[v]);let k=n(()=>{w.current?.()},[]),C=q(()=>({files:I,add:O,remove:M,clear:E,openFileDialog:k,fileInputRef:j}),[I,O,M,E,k]),H=n((t,e)=>{j.current=t.current,w.current=e},[]),Q=q(()=>({textInput:{value:a,setInput:x,clear:h,getRevision:W,clearSubmitted:c??h},attachments:C,__registerFileInput:H}),[a,x,h,W,c,C,H]);return D(F.Provider,{value:Q,children:D(X.Provider,{value:C,children:B})})}var Xe=f(null);function p(){let r=tt(),l=i(Xe),c=r??l;if(!c)throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return c}
|
|
2
|
+
export{Ge,Do,Qe,_o,X,Y,Z,Ho,Gt,Xe,p};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Ve}from"./chunk-210b2kk6.js";import{d}from"./chunk-mpnv2rht.js";import{Button as A}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as W,DropdownMenuCheckboxItem as Z,DropdownMenuContent as q,DropdownMenuGroup as y,DropdownMenuItem as k,DropdownMenuLabel as L,DropdownMenuSeparator as p,DropdownMenuSub as C,DropdownMenuSubContent as T,DropdownMenuSubTrigger as O,DropdownMenuTrigger as H}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Switch as ue}from"@nyssance/shadcn/vega/components/ui/switch";import{Tooltip as J,TooltipContent as K,TooltipTrigger as Q}from"@nyssance/shadcn/vega/components/ui/tooltip";import{cn as m}from"cn";import{ArrowUpRight as pe,ChevronUp as X,Loader2Icon as Y,Zap as E}from"lucide-react";import{Fragment as ce,useState as ee}from"react";import{jsx as e,jsxs as a,Fragment as c}from"react/jsx-runtime";function Ht({value:h,onChange:ne,models:v,modelGroups:V,compactCatalog:t,effortPresentation:j="slider",unavailableEffort:N,providerMenu:w,header:g,className:B,condensed:z,stripLabelPrefix:_,showDescription:ae,showModelList:se=!0,loading:ie,switching:G,isLoading:oe,effortConfig:s,booleanOptions:f,onBooleanChange:R,selectOptions:te=[],t:u,...r}){let[le,de]=ee(!1),[re,me]=ee(!1),l=f?.find((n)=>n.id==="fast_mode"),I=t?f?.filter((n)=>n!==l):f,P=(n)=>_&&n.startsWith(_)?n.slice(_.length):n;if(ie)return e("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:a(A,{variant:"ghost",disabled:!0,className:m("h-7 min-w-0 shrink gap-1.5 rounded-md px-2 text-xs font-normal",B),children:[e(Y,{className:"size-3 animate-spin"}),e("span",{className:"text-muted-foreground truncate",children:u("model.loadingModels")})]})});return a("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:[w&&a(W,{open:le,onOpenChange:de,children:[a(J,{children:[e(Q,{render:e(H,{render:a(A,{"data-testid":"provider-trigger",variant:"ghost",disabled:r.disabled,className:m("h-7 shrink-0 gap-1 rounded-md px-1.5","hover:bg-accent"),children:[w.icon,e(X,{className:"size-2.5 shrink-0 opacity-60"})]})})}),e(K,{children:u("model.switchProvider")})]}),a(q,{side:"top",align:"end",sideOffset:4,className:"z-100 min-w-[10rem]",children:[w.groups.map((n,o)=>a(ce,{children:[o>0&&n.length>0&&e(p,{}),e(d,{value:w.value,onValueChange:w.onChange,options:n})]},o)),w.moreAction&&a(c,{children:[e(p,{}),a(k,{onClick:w.moreAction,className:"whitespace-nowrap",children:[e("span",{className:"min-w-0 flex-1 truncate",children:u("model.moreModels")}),e(pe,{className:"size-4"})]})]})]})]}),a(W,{open:re,onOpenChange:me,children:[a(J,{children:[e(Q,{render:e(H,{render:a(A,{"data-testid":"model-trigger","aria-busy":G,variant:"ghost",className:m("h-7 gap-1.5 rounded-md px-2 text-xs font-normal","hover:bg-accent","max-w-full min-w-0 shrink",z&&"h-7 gap-1 px-1.5 text-[11px]",B),...r,children:[h.icon,f?.some((n)=>n.id==="fast_mode"&&n.currentValue&&!n.disabled)&&e(E,{"aria-hidden":"true",className:"size-3 shrink-0 fill-current"}),e("span",{className:m("min-w-0 flex-1 truncate text-start",z&&"text-[11px]"),children:P(h.label)||u("model.selectModel")}),s&&a("span",{className:"text-muted-foreground grid shrink-0 justify-items-center",children:[e("span",{className:"invisible col-start-1 row-start-1",children:s.sizer??s.levels.reduce((n,o)=>o.name.length>n.length?o.name:n,"")}),e("span",{className:"col-start-1 row-start-1",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),G?e(Y,{"data-testid":"model-switch-loading",className:"size-3 shrink-0 animate-spin"}):e(X,{className:m("size-3 shrink-0",z&&"size-2.5")})]})})}),e(K,{children:u("model.switchModel")})]}),a(q,{side:"top",align:"end",sideOffset:4,className:m("z-100 w-auto max-w-[min(24rem,calc(100vw-1rem))] min-w-[14rem]",t&&"flex h-[350px] w-80 min-w-0 flex-col overflow-hidden rounded-xl p-1.5"),children:[t&&a(c,{children:[a(y,{"data-model-menu-header":!0,className:"flex shrink-0 items-center justify-between gap-2 px-2 py-1",children:[s?j==="slider"?e("div",{role:"menuitem","aria-label":s.name,className:"min-w-0 flex-1 [&>div]:justify-between [&>div]:gap-3 [&>div]:px-0 [&>div]:py-1.5",children:e(Ve,{...s,disabled:r.disabled})}):a(C,{children:[a(O,{disabled:r.disabled,className:"h-8 min-w-0 flex-1 gap-2 rounded-md",children:[e("span",{children:s.name}),e("span",{className:"text-muted-foreground min-w-0 truncate text-xs",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),e(T,{children:e(d,{value:s.value,onValueChange:s.onChange,options:s.levels.map((n)=>({value:n.value,label:n.name}))})})]}):N?a(k,{disabled:!0,className:"h-8 min-w-0 flex-1 gap-2",children:[e("span",{children:N.name}),e("span",{className:"text-muted-foreground truncate text-xs",children:N.label})]}):e(L,{className:"min-w-0 flex-1 truncate",children:g?.name}),l&&e(Z,{"aria-label":l.name,title:l.title??l.name,disabled:r.disabled||l.disabled,checked:l.currentValue,closeOnClick:!1,onCheckedChange:(n)=>R?.(l.id,n),className:m("hover:bg-accent focus:hover:bg-accent focus-visible:bg-accent ms-auto -me-2 size-8 shrink-0 justify-center rounded-md p-0 focus:bg-transparent [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",l.currentValue&&!l.disabled?"text-foreground [&_svg]:fill-current":"text-muted-foreground"),children:l.icon??e(E,{className:"size-4","aria-hidden":"true"})})]}),e(p,{className:"shrink-0"})]}),g&&!t&&a(c,{children:[a("div",{className:"flex items-center gap-2 px-2 py-2",children:[g.icon,e("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:g.name}),g.action]}),e(p,{})]}),a(y,{"data-model-menu-list":t?"":void 0,className:t?"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain":void 0,children:[se&&(oe?e(k,{disabled:!0,className:"text-muted-foreground",children:u("model.loadingModels")}):v.length===0?e(k,{disabled:!0,className:"text-muted-foreground",children:u("model.noModelsAvailable")}):(()=>{let n=v.filter((i)=>!i.more),o=v.filter((i)=>i.more),F=n.length>0&&o.length>0,M=(i,b)=>({disabled:r.disabled,icon:i.icon,value:i.api_id,label:P(i.label),description:b?.noDescription?void 0:ae?i.description:void 0}),D=(i)=>{let b=v.find((S)=>S.api_id===i);if(b)ne(b)};if(t)return e(d,{value:h.api_id,onValueChange:D,itemClassName:"min-w-0 max-w-full font-normal whitespace-nowrap",options:v.map((i)=>M(i))});return a(c,{children:[V?V.map((i)=>{let b=i.models.filter((x)=>!x.more),S=i.models.filter((x)=>x.more),U=b.length>0&&S.length>0;return a(y,{children:[e(L,{className:"text-muted-foreground text-xs font-normal",children:i.name}),e(d,{value:h.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:(U?b:i.models).map((x)=>M(x))}),U&&a(C,{children:[e(O,{className:"font-medium whitespace-nowrap",children:u("model.moreModels")}),e(T,{children:e(d,{value:h.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:S.map((x)=>M(x,{noDescription:!0}))})})]})]},i.id)}):e(d,{value:h.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:(F?n:v).map((i)=>M(i))}),!V&&F&&a(C,{children:[e(O,{className:"font-medium whitespace-nowrap",children:u("model.moreModels")}),e(T,{children:e(d,{value:h.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:o.map((i)=>M(i,{noDescription:!0}))})})]})]})})()),!t&&s&&a(c,{children:[e(p,{}),j==="menu"?a(C,{children:[a(O,{disabled:r.disabled,children:[e("span",{className:"flex-1",children:s.name}),e("span",{className:"text-muted-foreground",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),e(T,{children:e(d,{value:s.value,onValueChange:s.onChange,options:s.levels.map((n)=>({value:n.value,label:n.name}))})})]}):e(Ve,{...s,disabled:r.disabled})]}),!t&&!s&&N&&a(c,{children:[e(p,{}),a(k,{disabled:!0,children:[e("span",{className:"flex-1",children:N.name}),e("span",{children:N.label})]})]}),te.map((n)=>a(y,{children:[e(p,{}),e(L,{children:n.name}),e(d,{value:n.value,onValueChange:n.onChange,options:n.options,itemClassName:"whitespace-nowrap"})]},n.id)),I&&I.length>0&&a(c,{children:[!s&&e(p,{}),I.map((n)=>t?a(Z,{"aria-label":n.name,title:n.title,disabled:r.disabled||n.disabled,checked:n.currentValue,closeOnClick:!1,onCheckedChange:(o)=>R?.(n.id,o),className:"justify-between gap-3 py-2.5 pr-2 [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",children:[a("span",{className:"flex items-center gap-2",children:[n.icon,n.name]}),e("span",{"aria-hidden":"true",className:m("flex h-[18px] w-8 shrink-0 items-center rounded-full p-0.5",n.currentValue?"bg-primary":"bg-input"),children:e("span",{className:m("bg-background size-3.5 rounded-full shadow-xs transition-transform",n.currentValue&&"translate-x-3.5")})})]},n.id):a("div",{title:n.title,className:m("flex items-center justify-between gap-3 px-2 py-2.5",n.disabled&&"opacity-50"),children:[a("span",{className:"flex items-center gap-2 text-sm font-medium",children:[n.icon,n.name]}),e(ue,{"aria-label":n.name,disabled:r.disabled||n.disabled,checked:n.currentValue,onCheckedChange:(o)=>R?.(n.id,o)})]},n.id))]})]}),t&&g?.action&&a(c,{children:[e(p,{className:"shrink-0"}),e(y,{"data-model-menu-footer":!0,className:"shrink-0",children:g.action})]})]})]})]})}
|
|
2
|
+
export{Ht};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_t}from"./chunk-kjswq0tx.js";import{n,g}from"./chunk-3hp5t5wf.js";import{h,s}from"./chunk-e6ddpdxn.js";import{createLucideIcon as y,HandIcon as S,ShieldAlertIcon as O,ShieldCheckIcon as r}from"lucide-react";import{jsx as a}from"react/jsx-runtime";var b=y("ApprovalShield",[["path",{d:"M12 22s8-4 8-11V5l-8-3-8 3v6c0 7 8 11 8 11",key:"shield"}],["path",{d:"m8 8 3 3-3 3M13 15h3",key:"terminal"}]]),u={"read-only":S,"workspace-write":r,agent:b,"agent-full-access":O},A={"read-only":"readOnly","workspace-write":"workspaceAccess",agent:"agent","agent-full-access":"fullAccess"};function Ie({sessionId:m,options:f,disabled:I,onConfigChange:l}){let{host:p,client:M}=n(),{t:c}=p,i=s(f,"mode");if(!i)return null;let o=i.currentValue,d=h(i).map((e)=>{let t=A[e.value];return t?{...e,name:c(`permissionModes.${t}.name`),description:c(`permissionModes.${t}.description`)}:e}),v=d.find((e)=>e.value===o),C=u[o]??r,k=(e)=>{if(e===o)return;g(p,l?l(i.configId,e):M.setConfig(m,i.configId,e))};return a(_t,{value:o,warning:o==="agent-full-access",currentName:v?.name??o,icon:a(C,{className:"size-3.5 shrink-0"}),header:c("permissionModes.heading"),disabled:I,label:c("composer.switchPermissionMode"),onValueChange:k,options:d.map((e)=>{let t=u[e.value]??r,w=e.value==="agent-full-access";return{value:e.value,label:a("span",{"data-permission-warning":w?"":void 0,children:e.name}),description:e.description?a("span",{className:"whitespace-normal",children:e.description}):void 0,icon:a(t,{className:"size-3.5 shrink-0"})}})})}
|
|
2
|
+
export{Ie};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t}from"./chunk-7dd374an.js";import{ne}from"./chunk-qqm07rfv.js";import{n,g}from"./chunk-3hp5t5wf.js";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as p,EmptyDescription as c,EmptyHeader as l,EmptyTitle as d}from"@nyssance/shadcn/vega/components/ui/empty";import{Loader2Icon as v}from"lucide-react";import{jsx as o,jsxs as r}from"react/jsx-runtime";function Re({session:e,timeline:y}){let{host:m,client:s}=n(),{t:i}=m,f=t((E)=>E.historyPages[e.id]?.cursor!=null),u=()=>g(m,s.open(e.id,e.cwd)),a=o(ne,{...y,session:e,client:s,host:m});if(e.restoring)return e.items.length===0?r("div",{className:"text-muted-foreground flex flex-1 items-center justify-center gap-2 text-sm",children:[o(v,{className:"size-4 animate-spin","aria-hidden":"true"}),i("conversation.restoring")]}):a;if(!e.attached&&e.items.length===0)return r(p,{className:"flex-1",children:[r(l,{children:[o(d,{children:i("conversation.reopen")}),o(c,{children:i("conversation.detached")})]}),o(h,{onClick:u,children:i("conversation.reopen")})]});if(e.items.length===0&&e.state==="idle"&&!f)return o(p,{className:"flex-1",children:r(l,{children:[o(d,{className:"text-[28px] font-normal",children:i("conversation.welcomeTitle")}),o(c,{className:"truncate font-mono",children:e.cwd})]})});return a}
|
|
2
|
+
export{Re};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
2
|
-
`)[0]??e("pattern")??e("url")??e("query")??e("description");return{category:o,...s===void 0?{}:{target:s},...n===void 0?{}:{filePath:n}}}function
|
|
3
|
-
export{
|
|
1
|
+
var zo=["full","compact","codexUI"];function mn(t){return t==="compact"||t==="codexUI"}var ko=["read","edit","delete","move","search","execute","think","fetch","switch_mode","other"];function c(t){let o=t.split(/[/\\]/).at(-1)??"";return o===""?t:o}function y(t){let o=ko.includes(t.kind)?t.kind:"other",i=t.rawInput,e=(a)=>{let r=i[a];return typeof r==="string"&&r.length>0?r:void 0},n=t.locations?.[0]?.path??e("file_path")??e("notebook_path"),s=n!==void 0?c(n):e("command")?.split(`
|
|
2
|
+
`)[0]??e("pattern")??e("url")??e("query")??e("description");return{category:o,...s===void 0?{}:{target:s},...n===void 0?{}:{filePath:n}}}function $o(t,o){if(o)return"dot-permission";switch(t){case"completed":return"dot-success";case"failed":return"dot-error";case"in_progress":return"dot-in-progress";case"pending":return"dot-pending";case"interrupted":return"dot-interrupted";default:return console.warn("[acp] unknown tool call status:",t),"dot-pending"}}
|
|
3
|
+
export{zo,mn,ko,y,$o};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function kn(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 Tn(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{kn,Tn};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{cn,oe}from"../chunk-04mj5ftg.js";import"../chunk-px6nrr87.js";import"../chunk-5n4mefej.js";import"../chunk-gr1nnczz.js";import"../chunk-yjtq166b.js";import"../chunk-jnena0v6.js";import"../chunk-fcqwzmkd.js";export{oe as CodexActivityGroup,cn as CodexWorkSection};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Uo,Ze,Je}from"../chunk-3jjc06nd.js";import"../chunk-j5rd55qs.js";import"../chunk-04mj5ftg.js";import"../chunk-px6nrr87.js";import"../chunk-5n4mefej.js";import"../chunk-gr1nnczz.js";import"../chunk-5e10bzg2.js";import"../chunk-yjtq166b.js";import"../chunk-jnena0v6.js";import"../chunk-kvx8fv1e.js";import"../chunk-2hk04fh3.js";import"../chunk-fcqwzmkd.js";export{Uo as CodexAssistantMessage,Je as CodexAssistantTurn,Ze as CodexMessageActions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{u,pt,Wn,Ee,jn,gt,Kn}from"../chunk-4xmbve71.js";export{Kn as AsyncQuestionCard,pt as asyncQuestionId,u as asyncQuestions,Wn as initialQuestionDraft,Ee as questionAnswer,gt as questionReplies,jn as questionReplyEnvelope};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{x}from"../chunk-5n4mefej.js";export{x as useCodexDisclosureState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Co,ln,et}from"../chunk-j5rd55qs.js";import"../chunk-fcqwzmkd.js";export{ln as CodexEditedFilesCard,et as EditedFilesCard,Co as fileChanges};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{q,dn}from"../chunk-px6nrr87.js";import"../chunk-5n4mefej.js";import"../chunk-fcqwzmkd.js";export{dn as ImageViewActivity,q as isImageView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Nn}from"../chunk-hwh88n0v.js";import"../chunk-gcx4fk1a.js";import"../chunk-q4q4f03j.js";import"../chunk-m2hpfdch.js";export{Nn as CodexMarkdownRenderer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Rn,Wo,En,An,jo,so,Io,lo,Ko,So,No,Vo,Go}from"../chunk-0zp04d1m.js";export{Wo as armTimelineUserMessageNavigationAudio,Io as automaticNavigationMidiNote,Vo as getNavigationAudioContextState,Go as getNavigationInstrumentReady,En as installTimelineUserMessageNavigationAudioUnlock,So as itemPianoKeyIndex,so as navigationMidiNote,No as navigationPianoKeyIndexes,Ko as pianoKeyFrequency,lo as pianoKeyMidiNote,jo as playTimelineUserMessageNavigationNote,An as playTimelineUserMessageNavigationSequence,Rn as preloadTimelineUserMessageNavigationInstrument};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Pn}from"../chunk-jc52024g.js";export{Pn as NavigationPreview};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Mn}from"../chunk-tzyc5myt.js";import"../chunk-jc52024g.js";export{Mn as TimelineUserMessageNavigationRail};
|
package/dist/codex/patch-view.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Jt,te}from"../chunk-0zph0gwq.js";export{te as PatchView,Jt as patchStats};
|
package/dist/codex/plan.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{M}from"../chunk-jnena0v6.js";export{M as CodexPlan};
|
package/dist/codex/styles.css
CHANGED
|
@@ -1732,7 +1732,8 @@
|
|
|
1732
1732
|
|
|
1733
1733
|
/* Composer controls share a single subtle fill in both themes. */
|
|
1734
1734
|
@media (hover: hover) {
|
|
1735
|
-
.chat-composer-toolbar
|
|
1735
|
+
.chat-composer-toolbar
|
|
1736
|
+
button:not([type="submit"]):not(:disabled):not([aria-disabled="true"]):not([data-disabled]):hover {
|
|
1736
1737
|
background-color: color-mix(in srgb, var(--foreground) 5%, transparent);
|
|
1737
1738
|
background-image: none;
|
|
1738
1739
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Bo,tn,z,Ye,nn,on,rn}from"../chunk-pzmd5d3m.js";export{Bo as CODEX_UNKNOWN_TURN_HEIGHT,z as calculateCodexThreadVirtualRange,on as calculateCodexTurnCenterDistanceFromBottom,rn as calculateCodexTurnTargetDistanceFromBottom,tn as createCodexThreadVirtualLayout,nn as preserveCodexThreadDistanceFromBottom,Ye as preserveCodexThreadRenderedWindow};
|