@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
package/dist/chunk-cazdmcwd.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createContext as d,useCallback as n,useContext as i,useEffect as V,useMemo as q,useRef as I,useState as z}from"react";import{jsx as D}from"react/jsx-runtime";var C=d(null),qt=d(null);function li(){return i(qt)}var Vt=d(null);function ci(){return i(Vt)}var De=d(null);function _e(){let r=i(C);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");return r}var He=()=>i(C);function di(){let r=i(De);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");return r}var X=()=>i(De);function Zn({initialInput:r="",revision:l,onSubmittedClear:c,onRemoveAttachment:F,attachmentPolicy:f,value:A,onValueChange:R,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=A!==void 0,[G,J]=z(r),p=A??G,o=I({value:p,external:l,revision:0});if(o.current.value!==p||o.current.external!==l)o.current={value:p,external:l,revision:o.current.revision+1};let W=n(()=>o.current.revision,[]),P=n((t)=>{if(o.current.value=t,o.current.revision++,T)R?.(t);else J(t)},[T,R]),g=n(()=>P(""),[P]),x=U!==void 0,[K,N]=z([]),v=U??K,h=I(v);h.current=v;let s=n((t)=>{let e=typeof t==="function"?t(h.current):t;if(x)L?.(e);else N(e)},[x,L]),j=I(null),w=I(()=>{}),O=n((t)=>{let e=[...t];if(e.length===0)return;s((a)=>{let m=f===void 0?e:f.uniqueFiles(e,a);return[...a,...m.map((u)=>{let _=f?.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:_}}})]})},[f,S,s]),M=n((t)=>{s((e)=>{let a=e.find((m)=>m.id===t);if(a?.url)URL.revokeObjectURL(a.url);return e.filter((m)=>m.id!==t)}),F?.()},[F,s]),E=n(()=>{s((t)=>{for(let e of t)if(e.url)URL.revokeObjectURL(e.url);return[]})},[s]);V(()=>{if(x)return;return()=>{for(let t of h.current)if(t.url)URL.revokeObjectURL(t.url)}},[x]);let k=n(()=>{w.current?.()},[]),b=q(()=>({files:v,add:O,remove:M,clear:E,openFileDialog:k,fileInputRef:j}),[v,O,M,E,k]),H=n((t,e)=>{j.current=t.current,w.current=e},[]),Q=q(()=>({textInput:{value:p,setInput:P,clear:g,getRevision:W,clearSubmitted:c??g},attachments:b,__registerFileInput:H}),[p,P,g,W,c,b,H]);return D(C.Provider,{value:Q,children:D(De.Provider,{value:b,children:B})})}var Wt=d(null);function y(){let r=X(),l=i(Wt),c=r??l;if(!c)throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return c}
|
|
2
|
-
export{qt,li,Vt,ci,De,_e,He,di,Zn,Wt,y};
|
package/dist/chunk-cc0tan75.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{x}from"./chunk-qxabrz98.js";import{X}from"./chunk-s0ef3h7b.js";import{isPlanItems as n,isPlanMarkdown as r}from"@nyssance/codex-acp-v2/client";import{jsx as e}from"react/jsx-runtime";function ar({plan:t}){if(r(t))return e("div",{className:"codex-reasoning-details",children:e(x,{text:t.content,streaming:!1})});if(!n(t))return null;return e(X,{entries:t.entries})}
|
|
2
|
-
export{ar};
|
package/dist/chunk-d5ga13n0.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cva as o}from"class-variance-authority";import{cn as n}from"cn";import{jsx as a}from"react/jsx-runtime";function he({className:e,...t}){return a("div",{"data-slot":"empty",className:n("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-lg border-dashed p-12 text-center text-balance",e),...t})}function ve({className:e,...t}){return a("div",{"data-slot":"empty-header",className:n("flex max-w-sm flex-col items-center gap-2",e),...t})}var i=o("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function bi({className:e,variant:t="default",...r}){return a("div",{"data-slot":"empty-icon","data-variant":t,className:n(i({variant:t,className:e})),...r})}function xe({className:e,...t}){return a("div",{"data-slot":"empty-title",className:n("text-lg font-medium tracking-tight",e),...t})}function ye({className:e,...t}){return a("div",{"data-slot":"empty-description",className:n("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}function wi({className:e,...t}){return a("div",{"data-slot":"empty-content",className:n("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",e),...t})}export{he,ve,bi,xe,ye,wi};
|
package/dist/chunk-d94rmh12.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n}from"./chunk-q6km9nha.js";import{Pe,Ne,Me}from"./chunk-6wqbetcx.js";import{o}from"./chunk-0ss92kxr.js";import{c,M}from"./chunk-n1tjf64a.js";import{hasAccount as L,isGroupedSelect as H}from"@nyssance/codex-acp-v2/client";import{cn as W}from"cn";import{useEffect as T,useState as F}from"react";import{jsx as r,jsxs as u}from"react/jsx-runtime";var p=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),z=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),O=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function g(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function A(a,t){let e=Math.min(100,a/t*100),f=e>=90?"text-destructive":e>=70?"text-foreground":"text-muted-foreground";return{pct:e,className:f}}function I(a){let t=c(a.configOptions,"model");return t===void 0?void 0:M(t)}function An(a,t){let e=a.windowDurationMins;if(e===null)return t("usage.usage");if(e%1440===0)return t("usage.windowDays",{count:e/1440});return t("usage.windowHours",{count:Math.round(e/60)})}function U(a){let{client:t}=o(),e=n((s)=>a&&s.connection==="ready"&&L(s.agent)),[f,l]=F(null);return T(()=>{if(!e){l(null);return}let s=!0;t.readRateLimits().then((m)=>{if(s)l(m)},()=>{return});let d=t.onRateLimits((m)=>{if(s)l(m)});return()=>{s=!1,d()}},[e,t]),e?f:null}function ct({session:a}){let{t}=o().host,e=c(a.configOptions,"model"),f=e!==void 0&&(H(e.options)?e.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((y)=>y.value===e.currentValue)):!e.currentValue.startsWith("gateway:")&&e.options.some((i)=>i.value===e.currentValue)),l=U(f),{usage:s,lastTurnUsage:d}=a;if(s===null&&d===null)return null;let m=s&&s.size>0?A(s.used,s.size):null,h=7,b=2*Math.PI*h,N=g(d?.inputTokens),k=g(d?.outputTokens),x=g(d?.cachedReadTokens),w=g(d?.cachedWriteTokens),S=g(d?.totalTokens)||N+k+x+w,R=N+x,C=R>0?z.format(x/R):t("tokens.notAvailable"),D=[[t("tokens.input"),p.format(N)],[t("tokens.output"),p.format(k)],[t("tokens.cachedRead"),p.format(x)],[t("tokens.cachedWrite"),p.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),p.format(S)]],v=I(a);return u(Pe,{children:[r(Ne,{delay:100,closeDelay:100,render:u("button",{type:"button",className:W("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",m?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),m!==null&&r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-m.pct/100),transform:"rotate(-90 9 9)"})]}),m!==null&&u("span",{children:[Math.round(m.pct),"%"]})]})}),u(Me,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[v!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:v,children:v})}),u("div",{className:"flex flex-col gap-3 p-3",children:[d!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:D.map(([i,y])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:y})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:p.format(s.used),limit:p.format(s.size),percent:O.format(s.used/s.size*100)})})]}),l!==null&&(l.primary!==null||l.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[l.primary,l.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:An(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}
|
|
2
|
-
export{An,ct};
|
package/dist/chunk-da4m33bg.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e}from"./chunk-wpdn3rx8.js";import{u,m,b,K,p,w}from"./chunk-n5xqjct2.js";import{ee}from"./chunk-3919sqde.js";import{createContext as S,useContext as C,useState as y,useSyncExternalStore as L}from"react";import{jsx as i,jsxs as c}from"react/jsx-runtime";var v=S(null),f=S(null),x=S(null);function fr({host:t,client:o,children:n}){let[s,a]=y(null);ee(s!==null);let{t:d}=t;return i(v,{value:t,children:i(f,{value:o,children:c(x,{value:a,children:[n,i(u,{open:s!==null,onOpenChange:(D)=>!D&&a(null),children:c(m,{children:[c(b,{children:[i(p,{children:d("sessionList.deleteTitle")}),i(w,{children:d("sessionList.deleteDescription")})]}),c(K,{children:[i(e,{variant:"outline",onClick:()=>a(null),children:d("sessionList.cancel")}),i(e,{onClick:()=>{if(s)T(t,o.delete(s.sessionId));a(null)},children:d("sessionList.delete")})]})]})})]})})})}function g(){let t=C(v);if(t===null)throw Error("Session list host is missing");return t}function l(){let t=C(f);if(t===null)throw Error("Session list client is missing");return t}function ot(){let t=C(x);if(t===null)throw Error("Session list provider is missing");return t}function r(t){let o=l();return L((n)=>o.store.subscribe(n),()=>t(o.store.getState()),()=>t(o.store.getState()))}function T(t,o){return o.then(()=>{},(n)=>{if(t.reportError)t.reportError(n);else console.error(n)})}
|
|
2
|
-
export{fr,g,l,ot,r,T};
|
package/dist/chunk-da6d6wze.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cn as i}from"cn";import{jsx as a}from"react/jsx-runtime";function k({className:r,...e}){return a("textarea",{"data-slot":"textarea",className:i("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",r),...e})}export{k};
|
package/dist/chunk-e99sdapw.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h}from"./chunk-3z6rx5qv.js";import{codexMessageError as A,nativeTurnId as m,textOf as S,turns as _}from"@nyssance/codex-acp-v2/client";function Wr(t){return t.kind==="tool"&&t.name==="mcp_startup"}function E(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let n=e.phase;return typeof n==="string"?n:null}function w(t){let e=t._meta?.codex;return typeof e==="object"&&e!==null&&e.notice===!0}function Xo(t){return t.user===null&&t.items.length>0&&t.items.every((e)=>e.kind==="assistant"&&w(e))}function T(t,e,n){let o=t.work.at(-1);if(o?.kind==="activity"&&o.items.at(-1)===n){o.items.push(e);return}t.work.push({kind:"activity",key:`activity:${e.kind}:${e.id}`,items:[e]})}function M(t,e,n){if(t.kind!=="tool"){e.push(t);return}let o=n.get(t.id);if(o===void 0)throw Error(`Grouped tool is missing from the session: ${t.id}`);e.push(o);for(let s of t.children)M(s,e,n)}function j(t,e,n,o){switch(e.kind){case"user":break;case"assistant":{if(A(e)!==null){let u=m(e),f=t.errors.findIndex((p)=>u!==null&&m(p)===u);if(f===-1)t.errors.push(e);else t.errors[f]=e;break}let s=E(e),i=e._meta?.codex,d=h(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(h(e._meta).length>0)t.final.push(e);else if(d)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else if(s==="final_answer")t.final.push(e);else if(s==="commentary"||w(e)||s===null&&n)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else t.final.push(e);break}case"thought":T(t,e,o);break;case"tool":if(T(t,e,o),e.toolKind==="edit")t.edits.push(e);break;case"plan":t.work.push({kind:"plan",key:`plan:${e.id}`,item:e});break;case"compaction":t.work.push({kind:"compaction",key:`compaction:${e.id}`,item:e});break}}function Yo(t,e=[],n=[]){let o=new Map(e.map((r)=>[r.key,r])),s=new Map(t.items.filter((r)=>r.kind==="tool").map((r)=>[r.id,r])),i={...t,items:t.items.filter((r)=>!Wr(r))},d=new Map(n.map((r,a)=>[r.turnId,a])),u=[],f=[u],p,k=null;for(let r of i.items){let a=m(r),l=d.get(a??"");if(a!==null&&k!==null&&a!==k||l!==void 0&&p!==void 0&&l>p+1)u=[],f.push(u);if(u.push(r),a!==null||r.kind==="user")k=a;if(l!==void 0)p=l}return f.flatMap((r)=>_({...i,items:r})).map((r)=>{let a=r.prompt===null?[]:[r.prompt];for(let c of r.entries)M(c,a,s);let l=a[0];if(l===void 0)throw Error("A turn without items");let I=`turn:${l.kind}:${l.id}`,x=r.endedAt??Math.max(...a.map((c)=>c.at)),y=o.get(I);if(y!==void 0&&K(y.items,a)&&y.endedAt===x)return y;let b={key:I,user:r.prompt,work:[],final:[],errors:[],edits:[],startedAt:r.startedAt??l.at,endedAt:x,replayed:a.every(rn),items:a},v=a.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return a.forEach((c,g)=>j(b,c,g<v,a[g-1])),b})}function K(t,e){return t.length===e.length&&t.every((n,o)=>n===e[o])}function rn(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function Q(t){return S(t.content)}function qe(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function an(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function Zo(t){let e=(s)=>{for(let i of t.items){let d=i._meta?.codex;if(typeof d!=="object"||d===null)continue;let u=d[s];if(typeof u==="number"&&Number.isFinite(u)&&u>=0)return u}return},n=e("workDurationMs"),o=e("turnDurationMs");return{durationMs:n??o,durationKind:n===void 0&&o!==void 0?"total":"work",startedAt:e("workStartedAt")}}function Jo(t,e,n){if(n?.user==null)return!1;let o=e.items.map(m).find((i)=>i!==null),s=m(n.user);if(o!==void 0&&s!==null)return o===s;return!e.items.some((i)=>{let d=i._meta?.codex;return typeof d==="object"&&d!==null&&"turnCompletedAt"in d&&typeof d.turnCompletedAt==="number"})&&t.state!=="idle"&&(n.user.echo==="pending"||n.user.echo==="acknowledged")&&e.user!==null&&t.turnEndedAt[e.user.id]===void 0&&e.errors.length===0}function er(t,e){if(t.state==="idle")return;let n=e.length-1;while(n>0){let o=e[n];if(o.items.some((s)=>s.kind!=="user"))break;if(!Jo(t,e[n-1],o))break;n--}return e[n]?.key}function tr(t,e,n){let o=n,s=n;while(o>0&&Jo(t,e[o-1],e[o]))o--;while(s+1<e.length&&Jo(t,e[s],e[s+1]))s++;let i=e.slice(o,s+1),d=i.findLast((u)=>u.items.some((f)=>f.kind!=="user"))??i[0];return{continued:e[n]!==d,items:i.flatMap((u)=>u.items),edits:i.flatMap((u)=>u.edits),startedAt:i[0].startedAt}}
|
|
2
|
-
export{Wr,Xo,Yo,rn,Q,qe,an,Zo,Jo,er,tr};
|
package/dist/chunk-ea3582qy.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Tooltip as i}from"@base-ui/react/tooltip";import{cn as l}from"cn";import{jsx as o,jsxs as p}from"react/jsx-runtime";function ui({delay:t=0,...e}){return o(i.Provider,{"data-slot":"tooltip-provider",delay:t,...e})}function ue({...t}){return o(i.Root,{"data-slot":"tooltip",...t})}function me({...t}){return o(i.Trigger,{"data-slot":"tooltip-trigger",...t})}function pe({className:t,side:e="top",sideOffset:a=4,align:d="center",alignOffset:r=0,children:n,...s}){return o(i.Portal,{children:o(i.Positioner,{align:d,alignOffset:r,side:e,sideOffset:a,className:"isolate z-50",children:p(i.Popup,{"data-slot":"tooltip-content",className:l("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pe-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...s,children:[n,o(i.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-start-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-end-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}export{ui,ue,me,pe};
|
package/dist/chunk-ebmbz9tg.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e}from"./chunk-wpdn3rx8.js";import{H,F,S,O,te,I,Re,Ee,Ae,zt,P}from"./chunk-h68f23r0.js";import{ze}from"./chunk-4s1rhts0.js";import{ue,me,pe}from"./chunk-ea3582qy.js";import{Bt}from"./chunk-65m4bm74.js";import{f}from"./chunk-3k5n3809.js";import{cn as m}from"cn";import{ArrowUpRight as se,ChevronUp as G,Loader2Icon as U,Zap as W}from"lucide-react";import{Fragment as ie,useState as Z}from"react";import{jsx as n,jsxs as s,Fragment as p}from"react/jsx-runtime";function _n({value:c,onChange:q,models:x,modelGroups:k,compactCatalog:l,effortPresentation:_="slider",unavailableEffort:v,providerMenu:h,header:w,className:R,condensed:C,stripLabelPrefix:T,showDescription:J,showModelList:K=!0,loading:Q,switching:A,isLoading:X,effortConfig:i,booleanOptions:D,onBooleanChange:V,selectOptions:Y=[],t:u,...r}){let[E,ee]=Z(!1),[ne,ae]=Z(!1),d=D?.find((a)=>a.id==="fast_mode"),z=l?D?.filter((a)=>a!==d):D,L=(a)=>T&&a.startsWith(T)?a.slice(T.length):a;if(Q)return n("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:s(e,{variant:"ghost",disabled:!0,className:m("h-7 min-w-0 shrink gap-1.5 rounded-md px-2 text-xs font-normal",R),children:[n(U,{className:"size-3 animate-spin"}),n("span",{className:"text-muted-foreground truncate",children:u("model.loadingModels")})]})});return s("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:[h&&s(H,{open:E,onOpenChange:ee,children:[s(ue,{children:[n(me,{render:n(F,{render:s(e,{"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:[h.icon,n(G,{className:"size-2.5 shrink-0 opacity-60"})]})})}),n(pe,{children:u("model.switchProvider")})]}),s(S,{side:"top",align:"end",sideOffset:4,className:"z-100 min-w-[10rem]",children:[h.groups.map((a,t)=>s(ie,{children:[t>0&&a.length>0&&n(P,{}),n(f,{value:h.value,onValueChange:h.onChange,options:a})]},t)),h.moreAction&&s(p,{children:[n(P,{}),s(I,{onClick:h.moreAction,className:"whitespace-nowrap",children:[n("span",{className:"min-w-0 flex-1 truncate",children:u("model.moreModels")}),n(se,{className:"size-4"})]})]})]})]}),s(H,{open:ne,onOpenChange:ae,children:[s(ue,{children:[n(me,{render:n(F,{render:s(e,{"data-testid":"model-trigger","aria-busy":A,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",C&&"h-7 gap-1 px-1.5 text-[11px]",R),...r,children:[c.icon,D?.some((a)=>a.id==="fast_mode"&&a.currentValue&&!a.disabled)&&n(W,{"aria-hidden":"true",className:"size-3 shrink-0 fill-current"}),n("span",{className:m("min-w-0 flex-1 truncate text-start",C&&"text-[11px]"),children:L(c.label)||u("model.selectModel")}),i&&s("span",{className:"text-muted-foreground grid shrink-0 justify-items-center",children:[n("span",{className:"invisible col-start-1 row-start-1",children:i.sizer??i.levels.reduce((a,t)=>t.name.length>a.length?t.name:a,"")}),n("span",{className:"col-start-1 row-start-1",children:i.levels.find((a)=>a.value===i.value)?.name??i.value})]}),A?n(U,{"data-testid":"model-switch-loading",className:"size-3 shrink-0 animate-spin"}):n(G,{className:m("size-3 shrink-0",C&&"size-2.5")})]})})}),n(pe,{children:u("model.switchModel")})]}),s(S,{side:"top",align:"end",sideOffset:4,className:m("z-100 w-auto max-w-[min(24rem,calc(100vw-1rem))] min-w-[14rem]",l&&"flex h-[350px] w-80 min-w-0 flex-col overflow-hidden rounded-xl p-1.5"),children:[l&&s(p,{children:[s(O,{"data-model-menu-header":!0,className:"flex shrink-0 items-center justify-between gap-2 px-2 py-1",children:[i?_==="slider"?n("div",{role:"menuitem","aria-label":i.name,className:"min-w-0 flex-1 [&>div]:justify-between [&>div]:gap-3 [&>div]:px-0 [&>div]:py-1.5",children:n(Bt,{...i,disabled:r.disabled})}):s(Re,{children:[s(Ee,{disabled:r.disabled,className:"h-8 min-w-0 flex-1 gap-2 rounded-md",children:[n("span",{children:i.name}),n("span",{className:"text-muted-foreground min-w-0 truncate text-xs",children:i.levels.find((a)=>a.value===i.value)?.name??i.value})]}),n(Ae,{children:n(f,{value:i.value,onValueChange:i.onChange,options:i.levels.map((a)=>({value:a.value,label:a.name}))})})]}):v?s(I,{disabled:!0,className:"h-8 min-w-0 flex-1 gap-2",children:[n("span",{children:v.name}),n("span",{className:"text-muted-foreground truncate text-xs",children:v.label})]}):n(te,{className:"min-w-0 flex-1 truncate",children:w?.name}),d&&n(zt,{"aria-label":d.name,title:d.title??d.name,disabled:r.disabled||d.disabled,checked:d.currentValue,closeOnClick:!1,onCheckedChange:(a)=>V?.(d.id,a),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",d.currentValue&&!d.disabled?"text-foreground [&_svg]:fill-current":"text-muted-foreground"),children:d.icon??n(W,{className:"size-4","aria-hidden":"true"})})]}),n(P,{className:"shrink-0"})]}),w&&!l&&s(p,{children:[s("div",{className:"flex items-center gap-2 px-2 py-2",children:[w.icon,n("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:w.name}),w.action]}),n(P,{})]}),s(O,{"data-model-menu-list":l?"":void 0,className:l?"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain":void 0,children:[K&&(X?n(I,{disabled:!0,className:"text-muted-foreground",children:u("model.loadingModels")}):x.length===0?n(I,{disabled:!0,className:"text-muted-foreground",children:u("model.noModelsAvailable")}):(()=>{let a=x.filter((o)=>!o.more),t=x.filter((o)=>o.more),j=a.length>0&&t.length>0,N=(o,g)=>({disabled:r.disabled,icon:o.icon,value:o.api_id,label:L(o.label),description:g?.noDescription?void 0:J?o.description:void 0}),M=(o)=>{let g=x.find((y)=>y.api_id===o);if(g)q(g)};if(l)return n(f,{value:c.api_id,onValueChange:M,itemClassName:"min-w-0 max-w-full font-normal whitespace-nowrap",options:x.map((o)=>N(o))});return s(p,{children:[k?k.map((o)=>{let g=o.models.filter((b)=>!b.more),y=o.models.filter((b)=>b.more),B=g.length>0&&y.length>0;return s(O,{children:[n(te,{className:"text-muted-foreground text-xs font-normal",children:o.name}),n(f,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:(B?g:o.models).map((b)=>N(b))}),B&&s(Re,{children:[n(Ee,{className:"font-medium whitespace-nowrap",children:u("model.moreModels")}),n(Ae,{children:n(f,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:y.map((b)=>N(b,{noDescription:!0}))})})]})]},o.id)}):n(f,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:(j?a:x).map((o)=>N(o))}),!k&&j&&s(Re,{children:[n(Ee,{className:"font-medium whitespace-nowrap",children:u("model.moreModels")}),n(Ae,{children:n(f,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:t.map((o)=>N(o,{noDescription:!0}))})})]})]})})()),!l&&i&&s(p,{children:[n(P,{}),_==="menu"?s(Re,{children:[s(Ee,{disabled:r.disabled,children:[n("span",{className:"flex-1",children:i.name}),n("span",{className:"text-muted-foreground",children:i.levels.find((a)=>a.value===i.value)?.name??i.value})]}),n(Ae,{children:n(f,{value:i.value,onValueChange:i.onChange,options:i.levels.map((a)=>({value:a.value,label:a.name}))})})]}):n(Bt,{...i,disabled:r.disabled})]}),!l&&!i&&v&&s(p,{children:[n(P,{}),s(I,{disabled:!0,children:[n("span",{className:"flex-1",children:v.name}),n("span",{children:v.label})]})]}),Y.map((a)=>s(O,{children:[n(P,{}),n(te,{children:a.name}),n(f,{value:a.value,onValueChange:a.onChange,options:a.options,itemClassName:"whitespace-nowrap"})]},a.id)),z&&z.length>0&&s(p,{children:[!i&&n(P,{}),z.map((a)=>l?s(zt,{"aria-label":a.name,title:a.title,disabled:r.disabled||a.disabled,checked:a.currentValue,closeOnClick:!1,onCheckedChange:(t)=>V?.(a.id,t),className:"justify-between gap-3 py-2.5 pr-2 [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",children:[s("span",{className:"flex items-center gap-2",children:[a.icon,a.name]}),n("span",{"aria-hidden":"true",className:m("flex h-[18px] w-8 shrink-0 items-center rounded-full p-0.5",a.currentValue?"bg-primary":"bg-input"),children:n("span",{className:m("bg-background size-3.5 rounded-full shadow-xs transition-transform",a.currentValue&&"translate-x-3.5")})})]},a.id):s("div",{title:a.title,className:m("flex items-center justify-between gap-3 px-2 py-2.5",a.disabled&&"opacity-50"),children:[s("span",{className:"flex items-center gap-2 text-sm font-medium",children:[a.icon,a.name]}),n(ze,{"aria-label":a.name,disabled:r.disabled||a.disabled,checked:a.currentValue,onCheckedChange:(t)=>V?.(a.id,t)})]},a.id))]})]}),l&&w?.action&&s(p,{children:[n(P,{className:"shrink-0"}),n(O,{"data-model-menu-footer":!0,className:"shrink-0",children:w.action})]})]})]})]})}
|
|
2
|
-
export{_n};
|
package/dist/chunk-frbeen15.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e}from"./chunk-wpdn3rx8.js";import{le}from"./chunk-pv35kspb.js";import{SquareIcon as u}from"lucide-react";import{useRef as c,useState as f}from"react";import{jsx as a}from"react/jsx-runtime";function Ye({title:t,onStop:s}){let[o,i]=f(!1),n=c(!1),l=async()=>{if(n.current)return;n.current=!0,i(!0);try{await s()}finally{n.current=!1,i(!1)}};return a(e,{variant:"ghost",size:"icon",className:"size-5",title:t,"aria-label":t,"aria-busy":o,disabled:o,onKeyDown:(r)=>r.stopPropagation(),onClick:(r)=>{r.stopPropagation(),l()},children:o?a(le,{className:"size-3","aria-label":t}):a(u,{className:"size-3 fill-current"})})}
|
|
2
|
-
export{Ye};
|
package/dist/chunk-ftcydsbs.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-qxabrz98.js";import{R}from"./chunk-s55n9cby.js";import{isContentEntry as k,isImage as b,isResourceLink as N}from"@nyssance/codex-acp-v2/client";import{ChevronRightIcon as w,ImageIcon as C,LoaderCircleIcon as S,RefreshCwIcon as A}from"lucide-react";import{useEffect as B,useState as h}from"react";import{jsx as n,jsxs as y}from"react/jsx-runtime";function we(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(!k(l))continue;let o=l.content;if(b(o))r.push({key:`${e.id}:${c}`,src:`data:${o.mimeType};base64,${o.data}`,alt:e.title??""});if(N(o))r.push({key:`${e.id}:${c}`,path:o.uri,alt:o.name})}if(r.length)return r;let i=e.rawInput;if(i!==null&&typeof i==="object"&&"path"in i&&typeof i.path==="string")return[{key:e.id,path:i.path,alt:i.path.split(/[\\/]/).at(-1)??i.path}];throw Error(`Image view ${e.id} has no image source`)}function E({images:e}){let{loadImage:r,openImageGallery:i,openImage:c,t:l}=a(),[o,g]=h({}),[v,x]=h(0),f=JSON.stringify(e);B(()=>{let t=!0,u=JSON.parse(f);g({});for(let s of u)(s.src!==void 0?Promise.resolve(s.src):s.path!==void 0&&r?r(s.path):Promise.reject(Error("Image loading is unavailable"))).then((d)=>{if(t)g((p)=>({...p,[s.key]:{src:d}}))},()=>{if(t)g((d)=>({...d,[s.key]:{error:!0}}))});return()=>{t=!1}},[f,r,v]);let I=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(S,{className:"motion-safe:animate-spin","aria-hidden":"true"})},t.key);if("error"in s)return n("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,"aria-label":l("stream.codex.imageFailed"),onClick:()=>x((m)=>m+1),children:n(A,{"aria-hidden":"true"})},t.key);return n("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,onClick:()=>{let m=e.slice(0,u).filter((d)=>{let p=o[d.key];return p&&"src"in p}).length;if(i)i(I,m);else c?.(s.src)},children:n("img",{src:s.src,alt:t.alt,draggable:!1})},t.key)})})}function qo({blocks:e}){let{t:r}=a(),i=e.flatMap(T),[c,l]=R(`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(C,{className:"codex-activity-icon","aria-hidden":"true"}),n("span",{className:"codex-activity-leading",children:r("stream.codex.viewedImages",{count:i.length})})]}),n(w,{className:c?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),c&&n(E,{images:i})]})}
|
|
2
|
-
export{we,qo};
|
package/dist/chunk-gdpa9dp5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Select as r}from"@base-ui/react/select";import{cn as o}from"cn";import{ChevronDownIcon as c,CheckIcon as u,ChevronUpIcon as f}from"lucide-react";import{jsx as e,jsxs as n}from"react/jsx-runtime";var Mt=r.Root;function Qr({className:t,...i}){return e(r.Group,{"data-slot":"select-group",className:o("scroll-my-1 p-1",t),...i})}function Rt({className:t,...i}){return e(r.Value,{"data-slot":"select-value",className:o("flex flex-1 text-start",t),...i})}function Et({className:t,size:i="default",children:a,...s}){return n(r.Trigger,{"data-slot":"select-trigger","data-size":i,className:o("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pe-2 ps-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...s,children:[a,e(r.Icon,{render:e(c,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function hn({className:t,children:i,side:a="bottom",sideOffset:s=4,align:d="center",alignOffset:p=0,alignItemWithTrigger:l=!0,...m}){return e(r.Portal,{children:e(r.Positioner,{side:a,sideOffset:s,align:d,alignOffset:p,alignItemWithTrigger:l,className:"isolate z-50",children:n(r.Popup,{"data-slot":"select-content","data-align-trigger":l,className:o("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...m,children:[e(Pr,{}),e(r.List,{children:i}),e(Nr,{})]})})})}function Xr({className:t,...i}){return e(r.GroupLabel,{"data-slot":"select-label",className:o("px-2 py-1.5 text-xs text-muted-foreground",t),...i})}function Z({className:t,children:i,...a}){return n(r.Item,{"data-slot":"select-item",className:o("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pe-8 ps-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...a,children:[e(r.ItemText,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:i}),e(r.ItemIndicator,{render:e("span",{className:"pointer-events-none absolute end-2 flex size-4 items-center justify-center"}),children:e(u,{className:"pointer-events-none"})})]})}function Yr({className:t,...i}){return e(r.Separator,{"data-slot":"select-separator",className:o("pointer-events-none -mx-1 my-1 h-px bg-border",t),...i})}function Pr({className:t,...i}){return e(r.ScrollUpArrow,{"data-slot":"select-scroll-up-button",className:o("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",t),...i,children:e(f,{})})}function Nr({className:t,...i}){return e(r.ScrollDownArrow,{"data-slot":"select-scroll-down-button",className:o("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",t),...i,children:e(c,{})})}export{Mt,Qr,Rt,Et,hn,Xr,Z,Yr,Pr,Nr};
|
package/dist/chunk-gz7adphb.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Mn}from"./chunk-d7gjvz8z.js";import{u,go,m,p}from"./chunk-n5xqjct2.js";import{cn as M}from"cn";import{XIcon as L}from"lucide-react";import{useCallback as O,useEffect as z,useMemo as j,useRef as H,useState as S}from"react";import{jsx as i,jsxs as A}from"react/jsx-runtime";function Nn({open:l,onOpenChange:P,url:h,filename:x,scale:w,onScaleChange:v,containerRef:T,containerClassName:I,dialogContentClassName:R,imageClassName:W}){let g=O((e)=>Math.min(4,Math.max(0.25,e)),[]),[Z,C]=S(1),o=g(w??Z),k=H(null),s=T??k,D=H(null),[d,N]=S({width:0,height:0}),[y,E]=S({width:0,height:0}),b=O((e)=>{let n=g(e);if(typeof v==="function"){v(n);return}C(n)},[v,g]);z(()=>{if(!l)return;if(!h)return;if(typeof w==="number")return;C(1)},[l,h,w]),z(()=>{if(!l)return;let e=s.current;if(!e)return;let n=()=>{N({width:e.clientWidth,height:e.clientHeight})};n();let t=new ResizeObserver(n);return t.observe(e),()=>{t.disconnect()}},[s,l]);let X=O(()=>{b(1)},[b]),r=j(()=>{let{width:e,height:n}=y,{width:t,height:a}=d;if(e===0||n===0)return{width:0,height:0};if(t===0||a===0)return{width:0,height:0};let c=Math.min(t/e,a/n,1),f=e*c,_=n*c;return{width:f*o,height:_*o}},[o,y,d]);if(!h)return null;return i(u,{open:l,onOpenChange:P,children:A(m,{className:M("top-1/2 left-1/2 h-[90vh] max-h-[90vh] w-[90vw]! max-w-[90vw]! -translate-x-1/2 -translate-y-1/2 gap-0 rounded-none bg-transparent p-0 ring-0 sm:w-[90vw]! sm:max-w-[90vw]!",R),showCloseButton:!1,children:[i(p,{className:"sr-only",children:x||"Image preview"}),i(go,{"aria-label":"Close",className:"absolute top-3 right-3 z-10 flex size-10 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur-sm transition-colors hover:bg-black/75",children:i(L,{className:"size-5"})}),i("div",{ref:s,onWheel:(e)=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let n=e.deltaY>0?o-0.2:o+0.2,t=g(Number.parseFloat(n.toFixed(2)));if(t===o)return;let a=s.current,c=D.current,f=a&&c?Mn({container:a,target:c,clientX:e.clientX,clientY:e.clientY,currentScale:o,nextScale:t}):null;if(b(t),a&&f)requestAnimationFrame(()=>{a.scrollTo(f)})},className:M("h-full w-full scrollbar-thin overflow-auto",I),children:i("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.max(d.width,r.width),height:Math.max(d.height,r.height)},children:i("div",{className:"shrink-0",children:i("img",{alt:x||"image preview",className:M("block object-contain select-none",W),decoding:"async",draggable:!1,ref:D,onDoubleClick:X,onLoad:(e)=>{let n=e.currentTarget;E({width:n.naturalWidth,height:n.naturalHeight});let t=s.current;if(t&&(t.clientWidth||t.clientHeight))N({width:t.clientWidth,height:t.clientHeight})},style:{imageRendering:"auto",width:r.width||void 0,height:r.height||void 0,maxWidth:r.width?"none":"90vw",maxHeight:r.height?"none":"90vh"},src:h})})})})]})})}
|
|
2
|
-
export{Nn};
|
package/dist/chunk-gzeg6bqp.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e}from"./chunk-wpdn3rx8.js";import{fe}from"./chunk-2a3tezgr.js";import{u,m,b,K,p,w}from"./chunk-n5xqjct2.js";import{v}from"./chunk-kjtd3wc3.js";import{Gt,jt,co,uo,mo,ht}from"./chunk-58wt406v.js";import{s}from"./chunk-96x0d2vd.js";import{Y,A}from"./chunk-0nkvfecf.js";import{ze}from"./chunk-4s1rhts0.js";import{k}from"./chunk-da6d6wze.js";import{isArrayProperty as S,isBooleanProperty as C,isNumberProperty as E,isStringProperty as N}from"@nyssance/codex-acp-v2/client";import{useEffect as V,useMemo as R,useState as q}from"react";import{jsx as o,jsxs as d}from"react/jsx-runtime";function P(r){if(!N(r))return null;if(r.oneOf&&r.oneOf.length>0)return r.oneOf.map((t)=>({value:t.const,label:t.title??t.const,...t.description?{description:t.description}:{}}));if(r.enum&&r.enum.length>0)return r.enum.map((t)=>({value:t,label:t}));return null}function L(r){let t=r,n=t._meta?.alwith?.options;if(Array.isArray(n)&&Array.isArray(t.enum))return n.map((i)=>({value:i.const,label:i.title,...i.description?{description:i.description}:{}}));if(Array.isArray(t.enum))return t.enum.map((i)=>({value:String(i),label:String(i)}));if(Array.isArray(t.oneOf))return t.oneOf.map((i)=>({value:i.const,label:i.title,...i.description?{description:i.description}:{}}));return null}function Ar(r){let t=new Set(r.required??[]);return Object.entries(r.properties??{}).map(([n,i])=>({key:n,property:i,title:i.title??n,description:i.description??null,required:t.has(n),options:P(i),multiOptions:S(i)?L(i.items):null}))}function br(r){let t={};for(let n of r){let i=n.property.default;if(i!==void 0&&i!==null)t[n.key]=i;else if(n.options)t[n.key]=n.options[0].value;else if(C(n.property))t[n.key]=!1;else if(S(n.property))t[n.key]=[]}return t}function Lr(r,t){if(r.multiOptions)return Array.isArray(t)&&t.length>0;if(!r.required)return!0;return t!==void 0&&t!==""&&!(Array.isArray(t)&&t.length===0)}function D({id:r,label:t,description:n,control:i}){return d("div",{className:"hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",children:[i,d(v,{htmlFor:r,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[o("div",{className:"text-foreground text-sm",children:t}),n&&o("div",{className:"text-muted-foreground text-xs",children:n})]})]})}function G({id:r,field:t,value:n,onChange:i}){if(t.multiOptions){let a=new Set(Array.isArray(n)?n:[]);return d(Gt,{children:[o(jt,{variant:"label",children:t.title}),t.description&&o(ht,{children:t.description}),o("div",{className:"flex flex-col gap-1",children:t.multiOptions.map((c)=>{let f=`${r}:${c.value}`;return o(D,{id:f,...c,control:o(fe,{id:f,checked:a.has(c.value),onCheckedChange:(y)=>{let g=new Set(a);if(y)g.add(c.value);else g.delete(c.value);i([...g])}})},c.value)})})]})}if(t.options)return d(Gt,{children:[o(jt,{variant:"label",children:t.title}),t.description&&o(ht,{children:t.description}),o(Y,{value:typeof n==="string"?n:"",onValueChange:(a)=>i(String(a)),className:"flex flex-col gap-1",children:t.options.map((a)=>{let c=`${r}:${a.value}`;return o(D,{id:c,...a,control:o(A,{value:a.value,id:c})},a.value)})})]});return d(uo,{children:[o(mo,{htmlFor:r,children:t.title}),C(t.property)?o(ze,{id:r,checked:n===!0,onCheckedChange:(a)=>i(a)}):E(t.property)?o(s,{id:r,type:"number",required:t.required,value:typeof n==="number"?n:"",onChange:(a)=>i(a.target.value===""?void 0:Number(a.target.value))}):o(k,{id:r,rows:2,required:t.required,value:typeof n==="string"?n:"",onChange:(a)=>i(a.target.value)}),t.description&&o(ht,{children:t.description})]})}function to({requestId:r,schema:t,message:n,total:i,t:a,onRespond:c}){let f=R(()=>Ar(t),[t]),[y,g]=q(()=>br(f));V(()=>g(br(f)),[r,f]);let x=f.every((l)=>Lr(l,y[l.key])),O=()=>{if(!x)return;let l={};for(let[h,F]of Object.entries(y))if(F!==void 0)l[h]=F;c({action:"accept",content:l})};return o(u,{open:!0,onOpenChange:(l)=>!l&&c({action:"cancel"}),children:d(m,{className:"flex max-h-[80vh] flex-col gap-4 sm:max-w-lg",onKeyDown:(l)=>{if(l.key==="Enter"&&(l.metaKey||l.ctrlKey))l.preventDefault(),O()},children:[d(b,{children:[d("div",{className:"flex items-center justify-between gap-2 pe-8",children:[o(p,{children:t.title??a("approval.needed")}),i>1&&o("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${i}`})]}),o(w,{children:n})]}),o("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o(co,{children:f.map((l)=>o(G,{id:`${r}:${l.key}`,field:l,value:y[l.key],onChange:(h)=>g((F)=>({...F,[l.key]:h}))},l.key))})}),d(K,{children:[o(e,{variant:"ghost",onClick:()=>c({action:"decline"}),children:a("actions.decline")}),o(e,{disabled:!x,onClick:O,children:a("actions.submit")})]})]})})}
|
|
2
|
-
export{Ar,br,Lr,to};
|
package/dist/chunk-h68f23r0.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Menu as n}from"@base-ui/react/menu";import{cn as i}from"cn";import{ChevronRightIcon as p,CheckIcon as c}from"lucide-react";import{jsx as t,jsxs as u}from"react/jsx-runtime";function H({...e}){return t(n.Root,{"data-slot":"dropdown-menu",...e})}function ei({...e}){return t(n.Portal,{"data-slot":"dropdown-menu-portal",...e})}function F({...e}){return t(n.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function S({align:e="start",alignOffset:o=0,side:a="bottom",sideOffset:r=4,className:d,...s}){return t(n.Portal,{children:t(n.Positioner,{className:"isolate z-50 outline-none",align:e,alignOffset:o,side:a,sideOffset:r,children:t(n.Popup,{"data-slot":"dropdown-menu-content",className:i("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",d),...s})})})}function O({...e}){return t(n.Group,{"data-slot":"dropdown-menu-group",...e})}function te({className:e,inset:o,...a}){return t(n.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":o,className:i("px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:ps-8",e),...a})}function I({className:e,inset:o,variant:a="default",...r}){return t(n.Item,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":a,className:i("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}function Re({...e}){return t(n.SubmenuRoot,{"data-slot":"dropdown-menu-sub",...e})}function Ee({className:e,inset:o,children:a,...r}){return u(n.SubmenuTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:i("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-8 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[a,t(p,{className:"rtl:rotate-180 ms-auto"})]})}function Ae({align:e="start",alignOffset:o=-3,side:a="inline-end",sideOffset:r=0,className:d,...s}){return t(S,{"data-slot":"dropdown-menu-sub-content",className:i("w-auto min-w-[96px] rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",d),align:e,alignOffset:o,side:a,sideOffset:r,...s})}function zt({className:e,children:o,checked:a,inset:r,...d}){return u(n.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:i("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-8 ps-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...d,children:[t("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:t(n.CheckboxItemIndicator,{children:t(c,{})})}),o]})}function Hn({...e}){return t(n.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...e})}function Fn({className:e,children:o,inset:a,...r}){return u(n.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":a,className:i("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-8 ps-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[t("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:t(n.RadioItemIndicator,{children:t(c,{})})}),o]})}function P({className:e,...o}){return t(n.Separator,{"data-slot":"dropdown-menu-separator",className:i("-mx-1 my-1 h-px bg-border",e),...o})}function ti({className:e,...o}){return t("span",{"data-slot":"dropdown-menu-shortcut",className:i("ms-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground",e),...o})}export{H,ei,F,S,O,te,I,Re,Ee,Ae,zt,Hn,Fn,P,ti};
|
package/dist/chunk-h99fy0g3.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Yn}from"./chunk-2rperg04.js";import{Cn,Tn,lt}from"./chunk-n0xzhjdg.js";import{He,y}from"./chunk-cazdmcwd.js";import{cn as D}from"cn";import{forwardRef as M,useCallback as R,useEffect as x,useImperativeHandle as F,useRef as d}from"react";import{jsx as L}from"react/jsx-runtime";var K=(c)=>!c.shiftKey,z=()=>!1,_t=M(({onChange:c,onCompositionStart:T,onCompositionEnd:b,className:E,placeholder:I,bashMode:C=!1,isSendShortcut:H=K,isNewlineShortcut:S=z,...h},P)=>{let n=He(),p=y(),u=d(!1),i=d(!1),a=d(null),l=d(null),o=R(()=>{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`})},[]);x(()=>{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]),x(o,[o,n?.textInput.value,h.value]);let m=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(m&&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:f}=t,g=`${f.slice(0,r)}
|
|
3
|
-
${f.slice(s)}`;if(n)n.textInput.setInput(g);else t.value=g;let v=r+1;t.setSelectionRange(v,v),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===""&&p.files.length>0){e.preventDefault();let t=p.files.at(-1);if(t)p.remove(t.id)}},k=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:r,sawNonImageFile:s}=Cn(t),f=Tn(t);if(r.length>0)e.preventDefault(),p.add(r);else if(s&&!f)e.preventDefault()},A=n?{value:u.current&&a.current?a.current.value:m?n.textInput.value.slice(1):n.textInput.value,onChange:(e)=>{let t=u.current?e.currentTarget.value:lt(e.currentTarget);n.textInput.setInput(m?`!${t}`:t),o(),c?.(e)}}:{onChange:(e)=>{if(!u.current)lt(e.currentTarget);o(),c?.(e)}};return F(P,()=>({resetHeight:()=>{if(a.current)a.current.style.height="auto"},focus:()=>{a.current?.focus()},isComposing:()=>u.current||i.current,getTextarea:()=>a.current}),[]),L(Yn,{"data-chat-input":!0,ref:a,rows:3,className:D("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=lt(e.currentTarget);n?.textInput.setInput(m?`!${t}`:t),o(),b?.(e),i.current=!0,requestAnimationFrame(()=>{i.current=!1})},onCompositionStart:(e)=>{i.current=!1,u.current=!0,T?.(e)},onKeyDown:w,onPaste:k,placeholder:I,...h,...A})});_t.displayName="PromptInputTextarea";
|
|
4
|
-
export{_t};
|
package/dist/chunk-jdjk6tf4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cva as s}from"class-variance-authority";import{cn as a}from"cn";import{jsx as r}from"react/jsx-runtime";var n=s("group/alert relative grid w-full gap-0.5 rounded-lg border px-4 py-3 text-start text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pe-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function V({className:t,variant:e,...o}){return r("div",{"data-slot":"alert",role:"alert",className:a(n({variant:e}),t),...o})}function Dt({className:t,...e}){return r("div",{"data-slot":"alert-title",className:a("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",t),...e})}function W({className:t,...e}){return r("div",{"data-slot":"alert-description",className:a("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",t),...e})}function Zr({className:t,...e}){return r("div",{"data-slot":"alert-action",className:a("absolute top-2.5 end-3",t),...e})}export{V,Dt,W,Zr};
|
package/dist/chunk-jjnmq2zj.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a,x}from"./chunk-qxabrz98.js";import{E}from"./chunk-fydcbjsx.js";import{Vo}from"./chunk-01dqjas2.js";import{X}from"./chunk-s0ef3h7b.js";import{$o,$e}from"./chunk-khj3ye94.js";import{Uo}from"./chunk-kzq1797a.js";import{on}from"./chunk-0mze2qnw.js";import{cn as M}from"cn";import{jsx as o,jsxs as y}from"react/jsx-runtime";var R=new WeakMap,w=1;function N(t){if(t.type==="tool_use"||t.type==="subagent"||t.type==="collab")return`${t.type}:${t.id}`;let n=R.get(t);if(n!==void 0)return`${t.type}:${n}`;let s=w++;return R.set(t,s),`${t.type}:${s}`}function P({block:t,streaming:n,actions:s}){if(t.isApiError)return o("div",{className:"codex-stream-error",children:t.text});return y("div",{className:"codex-assistant-message",children:[o(x,{text:t.text,streaming:n}),s]})}function I({block:t,streaming:n,actions:s,renderText:i}){switch(t.type){case"text":return i===void 0?o(P,{block:t,streaming:n,actions:s}):i({block:t,streaming:n,actions:s});case"thinking":return t.thinking.length>0?o(x,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(X,{entries:t.entries});case"image":return o("img",{src:`data:${t.source.media_type};base64,${t.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":case"collab":return null}}var _=new Set;function Mi({message:t,isMostRecentTurn:n,hiddenTools:s=_,time:i,beforeCopy:r,afterCopy:d,providerIcon:u,renderText:T,renderEditedFiles:C}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return o(A,{});let h=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
|
|
2
|
-
`),b=!t.streaming&&h.trim().length>0?o(Zt,{text:h,isMostRecentTurn:n,beforeCopy:r,afterCopy:d,time:i}):null,l=Vo(t.content,"compact"),f=l.reduce((e,c,p)=>c.kind==="codexActivityGroup"?p:e,-1),k=l.findIndex((e,c)=>c>f&&e.kind==="block"&&e.block.type==="text"),B=[...t.content].toReversed().find((e)=>e.type==="text"),m=t.content.filter((e)=>e.type==="tool_use"&&E(e).category==="edit"),v=(e)=>{if(e.kind==="codexActivityGroup"){let c=e.blocks.filter((p)=>p.type!=="tool_use"||!s.has(p.name));return c.length===0?null:o($e,{blocks:c},`activity:${N(c[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return o(I,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===B?b:void 0,renderText:T},N(e.block))},g=f===-1?0:k===-1?l.length:k;return o(Jt,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:u,work:l.slice(0,g).map(v),answer:l.length>g?l.slice(g).map(v):null,footer:f!==-1&&m.length>0&&(C===void 0?o(Uo,{blocks:m}):C(m))})}function Zt({text:t,isMostRecentTurn:n=!1,beforeCopy:s,afterCopy:i,time:r}){let d=a(),{t:u}=d;return y("div",{className:M("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",n?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[s,o(on,{text:t,label:u("actions.copy"),host:d}),i,r&&o("span",{className:"codex-user-time ms-1",title:r.full,children:r.short})]})}function A({label:t}){let{t:n}=a();return o("div",{className:"codex-pending-message py-2",role:"status",children:o("span",{className:"codex-activity-running",children:t??n("message.thinking")})})}function Jt({work:t,answer:n,footer:s,loading:i=!1,loadingLabel:r,...d}){if(i)return o(A,{label:r});return y("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&o($o,{...d,children:t}),n!==null&&(t.length===0?n:o("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:n})),s]})}
|
|
3
|
-
export{Mi,Zt,Jt};
|
package/dist/chunk-jp73gpbp.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h,dn,nr,xt,or,un,rr}from"./chunk-3z6rx5qv.js";import{t,ie,ke,n}from"./chunk-q6km9nha.js";import{oe}from"./chunk-39sbgvd3.js";import{createStore as E}from"@alwith/api/client";import{isText as w,nativeTurnId as Q}from"@nyssance/codex-acp-v2/client";import{jsx as y}from"react/jsx-runtime";var b=E({entries:{}});function p(r,e){b.setState((s)=>({entries:{...s.entries,[r]:e}}))}function v(r,e){let s=Q(e),a=r.items.findLast((i)=>Q(i)!==null);return!e.replayed&&s!==null&&a!==void 0&&Q(a)===s}function M(r,e){for(let s of r.items){if(s.kind!=="user"||s.echo==="pending")continue;for(let a of[...un(s._meta),...s.content.filter(w).flatMap((i)=>un(i._meta))])if(a.questionItemId===e)return a.answer}return}function O({sessionId:r,item:e,question:s,index:a}){let i=ie(),{t:l}=t(),m=dn(e.id,a),c=JSON.stringify([r,m]),u=ke(b,(o)=>o.entries[c]),d=n((o)=>o.sessions[r]),k=n((o)=>o.connection==="ready"),f=u?.draft??nr(s),x=d===void 0?u?.accepted:M(d,m)??u?.accepted,A=d!==void 0&&v(d,e),D=!d?.subagent&&k&&d?.attached&&!d.restoring&&!d.readOnly,g=x!==void 0?"answered":u?.skipped?"skipped":u?.pending?"submitting":!A?"closed":!D?"unavailable":"pending",C=async()=>{if(b.getState().entries[c]?.pending||g!=="pending")return;let o=i.state.sessions[r];if(o===void 0||!v(o,e)||!o.attached||o.readOnly||o.restoring)return;let S=xt(s,f);if(!S.trim())return;let q={questionItemId:m,question:s.title,answer:S};p(c,{draft:f,pending:!0});try{await i.prompt(r,[{type:"text",text:or(q),_meta:{codex:{questionReply:q}}}]),p(c,{draft:f,accepted:S})}catch(I){p(c,{draft:f,error:I instanceof Error?I.message:String(I)})}};if(g==="closed")return null;return y(rr,{question:s,draft:f,status:g,answer:x,error:g==="pending"?u?.error:void 0,t:l,onChange:(o)=>p(c,{draft:o}),onSkip:()=>p(c,{draft:f,skipped:!0}),onSubmit:()=>{C()}})}function cn({sessionId:r,item:e}){let s=n((i)=>i.sessions[r]),a=h(e._meta);if(s===void 0||s.subagent!==void 0||s.readOnly||!v(s,e))return y(oe,{content:e.content.some((i)=>!w(i)||i.text.trim().length>0)?e.content:a.map((i)=>({type:"text",text:i.title})),messageId:e.id,streaming:!1});return y("div",{className:"flex min-w-0 flex-col gap-3","data-async-questions":e.id,children:a.map((i,l)=>y(O,{sessionId:r,item:e,question:i,index:l},dn(e.id,l)))})}
|
|
2
|
-
export{cn};
|
package/dist/chunk-khj3ye94.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a,x}from"./chunk-qxabrz98.js";import{nn}from"./chunk-kv0tnq8g.js";import{E}from"./chunk-fydcbjsx.js";import{R}from"./chunk-s55n9cby.js";import{we,qo}from"./chunk-ftcydsbs.js";import{X}from"./chunk-s0ef3h7b.js";import{cn as h}from"cn";import{BotIcon as me,CheckIcon as pe,CopyIcon as ge}from"lucide-react";import{Fragment as fe,useEffect as O,useRef as U,useState as _}from"react";import{jsx as n,jsxs as p,Fragment as P}from"react/jsx-runtime";function W(e,t){let[o,i]=_(()=>({key:e,mounted:t})),r=t||o.key===e&&o.mounted;if(o.key!==e||o.mounted!==r)i({key:e,mounted:r});return r}var q=new WeakMap,z=1;function N(e){if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return`${e.type}:${e.id}`;if(e.type==="thinking"&&e.id!==void 0)return`thinking:${e.id}`;let t=q.get(e);if(t!==void 0)return`${e.type}:${t}`;let o=z;return z+=1,q.set(e,o),`${e.type}:${o}`}function b(e){switch(e){case"pending":case"in_progress":return!0;case"completed":case"failed":case"cancelled":case"interrupted":return!1;default:throw Error(`Unknown ACP tool status: ${e}`)}}function Z(e,t){let o=Math.max(0,Math.round(e/1000)),i=Math.floor(o/3600),r=Math.floor(o%3600/60),s=o%60;if(s>=60)r+=Math.floor(s/60),s%=60;if(r>=60)i+=Math.floor(r/60),r%=60;let u=Intl.DurationFormat;if(u)try{return new u(t,{style:"narrow"}).format({hours:i,minutes:r,seconds:i>0?0:s})}catch{}if(i>0)return r>0?`${i}h ${r}m`:`${i}h`;if(r>0)return s>0?`${r}m ${s}s`:`${r}m`;return`${s}s`}var xe="M7.52925 3.7793C7.75652 3.55203 8.10803 3.52383 8.36616 3.69434L8.47065 3.7793L14.2207 9.5293C14.4804 9.789 14.4804 10.211 14.2207 10.4707L8.47065 16.2207C8.21095 16.4804 7.78895 16.4804 7.52925 16.2207C7.26955 15.961 7.26955 15.539 7.52925 15.2793L12.8085 10L7.52925 4.7207L7.44429 4.61621C7.27378 4.35808 7.30198 4.00657 7.52925 3.7793Z";function I({expanded:e,className:t}){return n("svg",{className:h("codex-activity-disclosure",e&&"codex-activity-disclosure-expanded",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:xe})})}function Ce(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.3965 5.01128C16.3963 4.93399 16.3489 4.87691 16.293 4.85406L16.2354 4.84332C13.9306 4.91764 12.5622 5.32101 10.665 6.34722V16.3716C11.3851 15.9994 12.0688 15.7115 12.7861 15.5015C13.8286 15.1965 14.9113 15.0633 16.2402 15.0435L16.2979 15.0308C16.353 15.0063 16.3965 14.9483 16.3965 14.8755V5.01128ZM3.54492 14.8765C3.54492 14.9725 3.62159 15.0422 3.70117 15.0435L4.19629 15.0562C5.94062 15.1247 7.26036 15.4201 8.65918 16.0484C8.05544 15.1706 7.14706 14.436 6.17871 14.1109V14.1099C5.56757 13.9045 5.16816 13.3314 5.16797 12.6988V4.98882C4.86679 4.93786 4.60268 4.8999 4.28223 4.87457L3.72754 4.84429C3.62093 4.84079 3.54505 4.92417 3.54492 5.01226V14.8765ZM17.7266 14.8755C17.7266 15.6314 17.1607 16.2751 16.4121 16.3628L16.2598 16.3736C15.0122 16.3922 14.0555 16.5159 13.1602 16.7779C12.2629 17.0404 11.3966 17.4508 10.3369 18.0738C10.129 18.1959 9.87099 18.1958 9.66309 18.0738C7.71455 16.9283 6.31974 16.4689 4.12988 16.3853L3.68164 16.3736C2.85966 16.3614 2.21484 15.6838 2.21484 14.8765V5.01226C2.21497 4.15391 2.93263 3.4871 3.77246 3.51519L4.39844 3.54937C4.67996 3.57191 4.92258 3.60421 5.16797 3.64214V2.51031C5.16797 1.44939 6.29018 0.645615 7.31055 1.15679L7.31152 1.15582C8.78675 1.89511 10.0656 3.33006 10.5352 4.91461C12.3595 3.98907 13.8688 3.58817 16.1924 3.51324L16.3506 3.51714C17.1285 3.5741 17.7264 4.23496 17.7266 5.01128V14.8755ZM6.49805 12.6988C6.49824 12.7723 6.5442 12.8296 6.60254 12.8492L6.96289 12.9859C7.85245 13.3586 8.68125 13.9846 9.33496 14.7496V5.5816C9.08794 4.37762 8.13648 3.1566 6.95801 2.47613L6.71582 2.34527C6.67779 2.32617 6.6337 2.32502 6.58301 2.35796C6.52946 2.39279 6.49805 2.44863 6.49805 2.51031V12.6988Z"})})}function ye(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M7.33057 1.98535C10.2484 1.98535 12.6136 4.3508 12.6138 7.26855C12.6138 8.58031 12.1346 9.77942 11.3433 10.7031L13.9897 13.3496C14.1655 13.5253 14.1655 13.8106 13.9897 13.9863C13.814 14.1621 13.5288 14.1621 13.353 13.9863L10.7017 11.335C9.78678 12.0942 8.61243 12.5518 7.33057 12.5518C4.41281 12.5516 2.04736 10.1864 2.04736 7.26855C2.04754 4.35091 4.41292 1.98553 7.33057 1.98535ZM7.33057 2.88574C4.90998 2.88592 2.94793 4.84796 2.94775 7.26855C2.94775 9.68929 4.90987 11.6522 7.33057 11.6523C9.75141 11.6523 11.7144 9.6894 11.7144 7.26855C11.7142 4.84786 9.75131 2.88574 7.33057 2.88574Z"})})}function ve(){return p("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[n("path",{d:"M6.19629 7.86231C6.42357 7.63534 6.7752 7.60692 7.0332 7.77734L7.1377 7.86231L8.80371 9.5293C9.06329 9.78889 9.06307 10.21 8.80371 10.4697L7.1377 12.1367C6.878 12.3964 6.45599 12.3964 6.19629 12.1367C5.93686 11.8771 5.93697 11.456 6.19629 11.1963L7.39258 9.99902L6.19629 8.80371L6.11133 8.69922C5.94087 8.4411 5.96904 8.08955 6.19629 7.86231Z"}),n("path",{d:"M13.4668 11.0156C13.7699 11.0776 13.998 11.3456 13.998 11.667C13.9979 11.9883 13.7698 12.2564 13.4668 12.3184L13.333 12.332H10.833C10.466 12.3319 10.1682 12.034 10.168 11.667C10.168 11.2998 10.4659 11.0021 10.833 11.002H13.333L13.4668 11.0156Z"}),n("path",{d:"M12.6602 2.66504C13.3492 2.66504 13.9062 2.66439 14.3564 2.70117C14.8142 2.73859 15.2201 2.81796 15.5967 3.00977C16.1922 3.31321 16.677 3.79805 16.9805 4.39356C17.1722 4.77014 17.2517 5.17604 17.2891 5.63379C17.3258 6.08402 17.3252 6.64102 17.3252 7.33008V12.6602C17.3252 13.3492 17.3258 13.9062 17.2891 14.3564C17.2516 14.8142 17.1723 15.2201 16.9805 15.5967C16.677 16.1922 16.1922 16.677 15.5967 16.9805C15.2201 17.1723 14.8142 17.2516 14.3564 17.2891C13.9062 17.3258 13.3492 17.3252 12.6602 17.3252H7.33008C6.64102 17.3252 6.08402 17.3258 5.63379 17.2891C5.17604 17.2517 4.77014 17.1722 4.39356 16.9805C3.79805 16.677 3.31321 16.1922 3.00977 15.5967C2.81796 15.2201 2.73859 14.8142 2.70117 14.3564C2.66439 13.9062 2.66504 13.3492 2.66504 12.6602V7.33008C2.66504 6.64101 2.66439 6.08402 2.70117 5.63379C2.73858 5.17601 2.81797 4.77016 3.00977 4.39356C3.31321 3.79802 3.79802 3.31321 4.39356 3.00977C4.77016 2.81797 5.17601 2.73858 5.63379 2.70117C6.08402 2.66439 6.64101 2.66504 7.33008 2.66504H12.6602ZM7.33008 3.99512C6.61907 3.99512 6.1257 3.99601 5.74219 4.02734C5.3665 4.05804 5.15508 4.11481 4.99707 4.19531C4.65183 4.37124 4.37124 4.65183 4.19531 4.99707C4.11481 5.15508 4.05805 5.3665 4.02734 5.74219C3.99601 6.1257 3.99512 6.61908 3.99512 7.33008V12.6602C3.99512 13.3711 3.99601 13.8646 4.02734 14.248C4.05805 14.6237 4.11481 14.8352 4.19531 14.9932C4.37124 15.3384 4.65186 15.619 4.99707 15.7949C5.15507 15.8754 5.36654 15.9322 5.74219 15.9629C6.1257 15.9942 6.61908 15.9951 7.33008 15.9951H12.6602C13.3711 15.9951 13.8646 15.9942 14.248 15.9629C14.6237 15.9322 14.8352 15.8754 14.9932 15.7949C15.3384 15.619 15.619 15.3384 15.7949 14.9932C15.8754 14.8352 15.9322 14.6237 15.9629 14.248C15.9942 13.8646 15.9951 13.3711 15.9951 12.6602V7.33008C15.9951 6.61908 15.9942 6.1257 15.9629 5.74219C15.9322 5.36654 15.8754 5.15507 15.7949 4.99707C15.619 4.65186 15.3384 4.37124 14.9932 4.19531C14.8352 4.11481 14.6237 4.05805 14.248 4.02734C13.8646 3.99601 13.3711 3.99512 12.6602 3.99512H7.33008Z"})]})}function he(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M11.3312 4.20472C12.7488 2.92391 14.9377 2.96644 16.3039 4.33265L16.4318 4.46742C17.6713 5.8393 17.6713 7.93343 16.4318 9.30531L16.3039 9.44007L10.0119 15.7311C9.68839 16.0546 9.45384 16.2917 9.22185 16.4821L8.98748 16.6588C8.78233 16.799 8.56429 16.9196 8.33709 17.0192L8.10759 17.1119C7.92582 17.1785 7.73843 17.2266 7.52166 17.2711L6.75701 17.4069L4.36345 17.8053C4.22059 17.8291 4.06914 17.8552 3.9406 17.8649C3.84183 17.8723 3.70833 17.875 3.56267 17.8395L3.41423 17.7907C3.19121 17.695 3.00747 17.5271 2.89177 17.316L2.84588 17.2223C2.75958 17.0209 2.76174 16.8276 2.77166 16.6959C2.78136 16.5674 2.80742 16.4159 2.83123 16.2731L3.22966 13.8795L3.36443 13.1149C3.40899 12.898 3.45795 12.7108 3.52459 12.5289L3.61736 12.2985C3.71691 12.0715 3.83772 11.854 3.97771 11.6491L4.15349 11.4147C4.34392 11.1825 4.58171 10.9484 4.90545 10.6246L11.1965 4.33265L11.3312 4.20472ZM5.84588 11.5651C5.49671 11.9142 5.31258 12.0998 5.1867 12.2526L5.07537 12.3991C4.98194 12.5358 4.90157 12.6812 4.83513 12.8327L4.77361 12.9869C4.73328 13.0971 4.70248 13.2125 4.66814 13.3815L4.54119 14.0983L4.14275 16.4918L4.14177 16.4938H4.1447L6.53826 16.0944L7.25505 15.9684C7.42406 15.9341 7.53946 15.9033 7.64959 15.8629L7.80291 15.8014C7.95461 15.7349 8.09953 15.6538 8.2365 15.5602L8.38396 15.4498C8.53674 15.3239 8.72231 15.1398 9.07146 14.7907L14.0588 9.80238L10.8332 6.57679L5.84588 11.5651ZM15.3635 5.27308C14.5281 4.43776 13.2058 4.38573 12.3097 5.11683L12.1369 5.27308L11.7736 5.63636L15.0002 8.86195L15.3635 8.49964L15.5197 8.32581C16.2015 7.48961 16.2015 6.28311 15.5197 5.44691L15.3635 5.27308Z"})})}function K(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.8347 7.91699C16.8347 7.76279 16.8266 7.61021 16.8123 7.45996L15.4705 8.80371C14.2903 9.98388 12.3762 9.98388 11.1961 8.80371C10.016 7.62352 10.0159 5.70942 11.1961 4.5293L12.5378 3.18652C12.3885 3.17238 12.237 3.16505 12.0837 3.16504C9.45947 3.16504 7.33179 5.29272 7.33179 7.91699C7.33184 8.56608 7.46162 9.18329 7.69605 9.74512C7.79981 9.9939 7.74311 10.2811 7.5525 10.4717L3.59547 14.4287C3.0498 14.9744 3.04991 15.8586 3.59547 16.4043L3.70191 16.501C4.25076 16.9483 5.05957 16.9158 5.57105 16.4043L9.52906 12.4473L9.60426 12.3828C9.79018 12.2455 10.0369 12.2131 10.2546 12.3037C10.8166 12.5382 11.4345 12.668 12.0837 12.668C14.7078 12.6678 16.8345 10.541 16.8347 7.91699ZM18.1648 7.91699C18.1646 11.2755 15.4423 13.9979 12.0837 13.998C11.4151 13.998 10.7708 13.8886 10.1677 13.6885L6.51246 17.3457C5.51389 18.3443 3.93332 18.406 2.86207 17.5322L2.65504 17.3457C1.58992 16.2806 1.58992 14.5534 2.65504 13.4883L6.31031 9.83203C6.1104 9.22921 6.00175 8.58526 6.00172 7.91699C6.00172 4.55818 8.72494 1.83496 12.0837 1.83496C12.7838 1.835 13.458 1.95316 14.0857 2.17188L14.1638 2.20508C14.3404 2.29325 14.4697 2.45713 14.5144 2.65234C14.5653 2.87533 14.4984 3.10876 14.3367 3.27051L12.1375 5.4707C11.4767 6.13148 11.4767 7.20251 12.1375 7.86328C12.7983 8.52373 13.8694 8.52395 14.53 7.86328L16.7293 5.66309L16.7937 5.60742C16.9499 5.48687 17.1532 5.44067 17.3484 5.48535C17.5714 5.53648 17.7526 5.69898 17.8279 5.91504C18.0466 6.54272 18.1648 7.21689 18.1648 7.91699Z"})})}function te({block:e}){if(e.type!=="tool_use")return null;if(V(e))return n(K,{});let t=E(e).category;if(t==="read")return n(Ce,{});if(t==="search"||t==="fetch")return n(ye,{});if(t==="execute")return n(ve,{});if(t==="edit")return n(he,{});return n(K,{})}function B(e,t){let o=e.rawInput[t];return typeof o==="string"&&o.length>0?o:void 0}function Le(e){return E(e).target}function j(e){return e.name==="mcp"||e.name.startsWith("mcp__")||e.name.startsWith("mcp_")}function V(e){return j(e)||e.name==="dynamic_tool"}function ne(e,t){let{category:o}=E(e),i=Le(e),r=b(e.status);if(V(e))return{leading:e.title};if(o==="execute"){let s=B(e,"command")?.split(`
|
|
2
|
-
`)[0]??i;return s?{leading:t(r?"stream.codex.running":"stream.codex.ran"),trailing:s}:{leading:t(r?"stream.codex.runningCommand":"stream.codex.ranCommandGeneric")}}if(o==="search"){let s=B(e,"pattern")??B(e,"query")??i;return s?{leading:t(r?"stream.codex.searching":"stream.codex.searched"),trailing:t("stream.codex.forDetail",{detail:s})}:{leading:t(r?"stream.codex.searchingFiles":"stream.codex.searchedFiles")}}if(o==="fetch"){let s=B(e,"query")??B(e,"url")??i;return s?{leading:t(r?"stream.codex.searchingWeb":"stream.codex.searchedWeb"),trailing:t("stream.codex.forDetail",{detail:s})}:{leading:t(r?"stream.codex.searchingWeb":"stream.codex.searchedWeb")}}if(o==="read")return i?{leading:t("stream.codex.readLabel"),trailing:i}:{leading:t("stream.codex.readFiles")};if(o==="edit")return i?{leading:t(r?"stream.codex.editingLabel":"stream.codex.editedLabel"),trailing:i}:{leading:t(r?"stream.codex.editingFiles":"stream.codex.editedFiles")};if(o==="delete")return i?{leading:t(r?"stream.codex.deletingLabel":"stream.codex.deletedLabel"),trailing:i}:{leading:t(r?"stream.codex.deletingFiles":"stream.codex.deletedFiles")};if(o==="move")return i?{leading:t(r?"stream.codex.movingLabel":"stream.codex.movedLabel"),trailing:i}:{leading:t(r?"stream.codex.movingFiles":"stream.codex.movedFiles")};return{leading:e.title}}function Ne(e,t){let o=ne(e,t);return o.trailing===void 0?o.leading:`${o.leading} ${o.trailing}`}function be(e){return e.map((t)=>{if(t.type!=="content")return"";let o=t.content;return o.type==="text"?o.text:""}).filter(Boolean).join(`
|
|
3
|
-
`).trim()}function Te(e){return e.flatMap((t)=>{if(t.type!=="content")return[];let o=t.content;return o.type==="image"?[{data:o.data,mimeType:o.mimeType}]:[]})}function ke(e){return e.flatMap((t)=>{if(t.type!=="content")return[];let o=t.content;return o.type==="audio"?[{data:o.data,mimeType:o.mimeType}]:[]})}function Ae(e){if(typeof e==="string"&&e.length>0)return e;return}function Be(e){return e.type==="diff"}function Ie(e){let t=e.content.find(Be);if(t===void 0)return;return t.changes.map((o)=>`${o.operation} ${o.path}`).join(`
|
|
4
|
-
`)}function ae(e){let t=Ae(e.rawOutput);if(t!==void 0)return t;let o=be(e.content);if(o.length>0)return o;return Ie(e)}function J({block:e,command:t}){let{t:o,Output:i,commandStatus:r}=a(),[s,u]=_(!1),[c,l]=_(!1),m=ae(e),d=r===void 0?e.exitCode===void 0?void 0:o("stream.codex.exitCode",{code:e.exitCode}):r(e),g=()=>{navigator.clipboard.writeText([`$ ${t}`,m].filter((f)=>f!==void 0).join(`
|
|
5
|
-
`)),u(!0),setTimeout(()=>u(!1),1500)};return n("div",{className:"codex-command-details",children:p("div",{className:"codex-command-card",children:[p("div",{className:"codex-command-line-row",children:[n("span",{className:"codex-command-prompt","aria-hidden":"true",children:"$"}),n("button",{type:"button",className:h("codex-command-line",!c&&"codex-command-line-clamped"),"data-codex-disclosure":"","aria-expanded":c,onClick:()=>l((f)=>!f),children:t}),n("button",{type:"button",className:"codex-command-copy","aria-label":o("actions.copy"),onClick:g,children:s?n(pe,{}):n(ge,{})})]}),m!==void 0&&(i===void 0?n("pre",{className:"codex-command-output",children:m}):n(i,{text:m})),d!==void 0&&n("div",{className:"codex-command-footer",children:n("span",{className:"codex-command-status",children:d})})]})})}function oe({block:e}){let{t,openLink:o,Patch:i,openImage:r,commandStatus:s,expandToolOutput:u=!1}=a(),c=ae(e),l=i===void 0?void 0:e.content.flatMap((C)=>{if(C.type!=="diff")return[];let A=C;return A.patch?.text?[A.patch.text]:[]}).join(`
|
|
6
|
-
`),m=Te(e.content),d=ke(e.content),[g,f]=R(`tool:${e.id}`,!1),y=W(`tool:${e.id}`,g),w=E(e),L=w.category,v=ne(e,t),T=L==="execute"?B(e,"command"):void 0;if(e.userShell&&T!==void 0)return n(J,{block:e,command:T});let k=T!==void 0||V(e)||m.length>0||d.length>0||Boolean(l)||u&&c!==void 0,M=!k&&!b(e.status)?w.filePath:void 0;if(L==="execute"&&!b(e.status)&&e.status!=="completed"){let C=s?.(e);if(C)v={...v,leading:C}}if(L==="read"&&b(e.status))return null;let S=p("span",{className:"codex-activity-label",children:[n(te,{block:e}),n("span",{className:"min-w-0 flex-1 truncate",children:b(e.status)?n("span",{className:"codex-activity-running",children:v.trailing===void 0?v.leading:`${v.leading} ${v.trailing}`}):p(P,{children:[n("span",{className:"codex-activity-leading",children:v.leading}),v.trailing!==void 0&&(M!==void 0?p(P,{children:[" ",n("button",{type:"button",className:"codex-activity-trailing codex-activity-file-link",title:M,onClick:()=>o(M),children:v.trailing})]}):p("span",{className:"codex-activity-trailing",children:[" ",v.trailing]}))]})})]});return p("div",{className:"codex-activity-item",children:[k?p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-label":v.trailing===void 0?v.leading:`${v.leading} ${v.trailing}`,"aria-expanded":g,onClick:()=>f((C)=>!C),children:[S,n(I,{expanded:g})]}):n("div",{className:"codex-activity-header codex-activity-header-static",children:S}),n("div",{className:h("codex-activity-details-grid",g&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:y&&p(P,{children:[T!==void 0?n(J,{block:e,command:T}):i!==void 0&&l?n(i,{patch:l}):c!==void 0&&n("pre",{className:"codex-activity-details",children:c}),m.length>0&&n("div",{className:"codex-activity-media",children:m.map((C)=>{let A=`data:${C.mimeType};base64,${C.data}`,G=n("img",{src:A,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},`${C.mimeType}:${C.data.slice(0,32)}`);return r===void 0?G:n("button",{type:"button",className:"cursor-pointer",onClick:()=>r(A),children:G},A)})}),d.map((C)=>n("audio",{className:"mt-1 w-full","aria-label":t("stream.codex.audioOutput"),controls:!0,src:`data:${C.mimeType};base64,${C.data}`},`${C.mimeType}:${C.data.slice(0,32)}`))]})})})]})}function ie({block:e}){if(e.type==="tool_use")return n(oe,{block:e});if(e.type==="thinking")return n(ue,{block:e});if(e.type==="collab")return n(le,{block:e});return n(re,{block:e})}function re({block:e}){let{t,openSession:o}=a(),i=b(e.status),[r,s]=R(`subagent:${e.id}`,i),u=U(i);O(()=>{if(i)s(!0);if(u.current&&!i)s(!1);u.current=i},[i,s]);let c=`${_e(e.activity,i,e.name,t)}${se(e.model,e.reasoningEffort,t)}`,l=e.threadId??"",m=e.blocks.length>0;return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:h("codex-activity-header",!m&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":m?r:void 0,disabled:!m,onClick:()=>s((d)=>!d),children:[p("span",{className:"codex-activity-label",children:[n(Se,{seed:e.threadId??e.id}),n("span",{className:"min-w-0 flex-1 truncate",children:o===void 0||e.threadId===null?i?n("span",{className:"codex-activity-running",children:c}):c:n("span",{role:"link",tabIndex:0,className:h("codex-agent-link",i&&"codex-activity-running"),"aria-label":t("stream.codex.subagentOpen",{name:e.name}),onClick:(d)=>{d.stopPropagation(),o(l,e.name)},onKeyDown:(d)=>{if(d.key!=="Enter"&&d.key!==" ")return;d.preventDefault(),d.stopPropagation(),o(l,e.name)},children:c})})]}),m&&n(I,{expanded:r})]}),n("div",{className:h("codex-activity-details-grid",r&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:e.blocks.map((d)=>{if(d.type==="tool_use")return n(oe,{block:d},d.id);if(d.type==="thinking")return n(ue,{block:d},N(d));if(d.type==="subagent")return n(re,{block:d},d.id);if(d.type==="collab")return n(le,{block:d},d.id);if(d.type==="text")return n("div",{className:"codex-reasoning-details",children:n(x,{text:d.text,streaming:!1})},N(d));if(d.type==="plan")return n(X,{entries:d.entries},N(d));if(d.type==="image")return n("img",{src:`data:${d.source.media_type};base64,${d.source.data}`,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},N(d));return null})})})})]})}var Me=8;function Ee(e){let t=0;for(let o=0;o<e.length;o+=1)t=(t*31+e.charCodeAt(o))%2147483647;return t%Me}function Se({seed:e}){return n("span",{className:"codex-agent-avatar","data-hue":Ee(e),"aria-hidden":"true"})}function _e(e,t,o,i){switch(e){case"started":return i(t?"stream.codex.subagentWorking":"stream.codex.subagentFinished",{name:o});case"interacted":return i("stream.codex.subagentMessaged",{name:o});case"interrupted":return i("stream.codex.subagentInterrupted",{name:o});case"completed":return i("stream.codex.subagentFinished",{name:o})}}var Re=new Set(["none","minimal","low","medium","high","xhigh","max","ultra","persistent"]);function se(e,t,o){if(e===null)return"";if(t===null)return` · ${nn(e)}`;let i=Re.has(t)?o(`stream.codex.reasoningEffort.${t}`):t;return` · ${nn(e)} · ${i}`}var Fe={spawnAgent:"spawn",sendInput:"message",sendMessage:"message",followupTask:"message",interruptAgent:"interrupt",listAgents:"list",resumeAgent:"resume",closeAgent:"close"};function de(e){switch(e){case"pending":case"in_progress":return"inProgress";case"completed":return"completed";case"failed":return"failed";case"cancelled":case"interrupted":return"interrupted";default:throw Error(`Unknown ACP tool status: ${e}`)}}function H(e,t,o){if(e.tool==="wait")throw Error("Codex does not present wait calls");let i=de(e.status);if(i==="interrupted")return o("stream.codex.collab.interrupted");return o(`stream.codex.collab.${t}.${Fe[e.tool]}.${i}`)}function De(e){return e.agents.filter((t)=>t.nickname!==null)}function ce(e,t){let o=e.agents.length>0?e.agents.length:1;return`${H(e,"header",t)}${t("stream.codex.collab.agentCount",{count:o})}`}var F="\x01";function D(e,t,o,i){let r=Object.fromEntries(Object.keys(i).map((s)=>[s,`${F}${s}${F}`]));return e(t,{...o,...r}).split(new RegExp(`${F}(\\w+)${F}`,"u")).map((s,u)=>n(fe,{children:u%2===1?i[s]:s},`${u}:${s}`))}function Pe({agent:e,showModel:t}){let{t:o,openSession:i}=a(),r=e.nickname??"",s=i===void 0?n("span",{className:"font-medium",children:r}):n("button",{type:"button",className:"codex-agent-link font-medium","aria-label":o("stream.codex.subagentOpen",{name:r}),onClick:()=>i(e.threadId,r),children:r});return p("span",{children:[s,e.role!==null&&` (${e.role})`,t&&se(e.model,e.reasoningEffort,o)]})}function Q({prompt:e}){return n("span",{className:"codex-collab-prompt",title:e,children:e})}function Oe(e,t){let o=e.prompt?.trim()?e.prompt:null,i=de(e.status),r=e.tool==="spawnAgent"&&i==="completed"&&o!==null,s=(e.tool==="sendInput"||e.tool==="sendMessage"||e.tool==="followupTask")&&o!==null,u=De(e),c=[];if(u.length===0)c.push({key:"generic",node:H(e,"row",t)});for(let l of u){let m=n(Pe,{agent:l,showModel:e.tool==="spawnAgent"});if(r)c.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:D(t,"stream.codex.collab.createdWithInstructions",{},{agent:m,instructions:n(Q,{prompt:o})})})});else if(s)c.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:D(t,"stream.codex.collab.messagedWithPrompt",{action:i==="interrupted"?t("stream.codex.collab.interrupted"):t(`stream.codex.collab.messaged.${i}`)},{agent:m,prompt:n(Q,{prompt:o})})})});else{let g=e.tool!=="closeAgent"&&e.tool!=="resumeAgent"&&l.state!==null&&l.state!==null?l.state.message?.trim()?t("stream.codex.collab.stateWithMessage",{state:t(`stream.codex.collab.state.${l.state.status}`),message:l.state.message}):t("stream.codex.collab.stateOnly",{state:t(`stream.codex.collab.state.${l.state.status}`)}):"";c.push({key:l.threadId,node:D(t,"stream.codex.collab.agentRow",{action:H(e,"row",t),state:g},{agent:m})})}}if(!r&&!s&&o!==null)c.push({key:"input",node:D(t,"stream.codex.collab.input",{},{prompt:n("span",{className:"codex-collab-input",children:o})})});return c}function le({block:e}){let{t}=a(),[o,i]=R(`collab:${e.id}`,!1);if(e.tool==="wait")return null;let r=b(e.status),s=ce(e,t);return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":o,onClick:()=>i((u)=>!u),children:[p("span",{className:"codex-activity-label",children:[n(me,{className:"size-4 shrink-0","aria-hidden":"true"}),n("span",{className:"min-w-0 flex-1 truncate",children:r?n("span",{className:"codex-activity-running",children:s}):s})]}),n(I,{expanded:o})]}),n("div",{className:h("codex-activity-details-grid",o&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:Oe(e,t).map((u)=>n("div",{className:"codex-collab-row",children:u.node},u.key))})})})]})}function ue({block:e}){let{t,i18n:o}=a(),i=Boolean(e.isComplete),[r,s]=R(`thinking:${N(e)}`,!1),u=U(null),c=e.thinking.trim().length>0;O(()=>{if(i||!c)return;let d=u.current;if(d===null)throw Error("Thinking details are not mounted");let g=new ResizeObserver(()=>{d.scrollTop=d.scrollHeight}),f=null,y=()=>{let L=d.firstElementChild;if(L===f)return;if(f!==null)g.unobserve(f);if(f=L,f!==null)g.observe(f)},w=new MutationObserver(y);return w.observe(d,{childList:!0}),y(),()=>{w.disconnect(),g.disconnect()}},[c,i]);let l=i?e.durationMs!==void 0?t("stream.codex.thoughtFor",{duration:Z(e.durationMs,o.language)}):t("stream.codex.thought"):t("message.thinking"),m=e.thinking.trimStart().replace(/^\*\*[^\n]*?\*\*\s*/,"");return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:h("codex-activity-header",!c&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":c?r:void 0,disabled:!c,onClick:()=>s((d)=>!d),children:[n("span",{className:"codex-activity-label",children:n("span",{className:"codex-reasoning-label min-w-0 flex-1 truncate",children:i?l:n("span",{className:"codex-activity-running",children:l})})}),c&&n(I,{expanded:r})]}),n("div",{className:h("codex-activity-details-grid",r&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:c&&n("div",{ref:u,className:"codex-reasoning-details",role:"region","aria-label":l,"aria-hidden":!r,tabIndex:0,inert:!r,children:n(x,{text:m,streaming:!i})})})})]})}function Ue(e){if(j(e))return"mcp";let t=E(e).category;return t==="think"||t==="switch_mode"?"other":t}function Ve(e,t,o,i){return i(`stream.codex.summary.${e}.${o?"leading":"following"}`,{count:t})}function Ze(e,t,o){let i=new Map,r=[],s=new Set;for(let c of e){if(j(c)&&typeof c.rawInput.server==="string"){if(s.size===0)r.push({kind:"integrations"});s.add(c.rawInput.server);continue}if(V(c)){if(!r.some((m)=>m.kind==="named"&&m.title===c.title))r.push({kind:"named",title:c.title});continue}let l=Ue(c);if(!i.has(l))r.push({kind:"category",category:l});i.set(l,(i.get(l)??0)+1)}let u=r.map((c,l)=>{if(c.kind==="named")return c.title;if(c.kind==="integrations")return t(`stream.codex.summary.integrations.${l===0?"leading":"following"}`,{count:s.size,sources:new Intl.ListFormat(o,{style:"long",type:"conjunction"}).format([...s])});return Ve(c.category,i.get(c.category),l===0,t)});if(o.startsWith("zh"))return u.join("");return new Intl.ListFormat(o,{style:"long",type:"conjunction"}).format(u)}function $o({stateKey:e,durationMs:t,durationKind:o="work",active:i,defaultExpanded:r=i,startedAt:s,providerId:u,providerIcon:c,children:l}){let{t:m,i18n:d}=a(),[g,f]=R(`work:${e}`,r,!0),y=W(`work:${e}`,g||i),w=U(null),[L,v]=_(0);O(()=>{if(!i||t!==void 0){w.current=null;return}w.current=s??Date.now();let k=()=>{let S=w.current;if(S===null)throw Error("Codex work section is ticking without a start time");v(Date.now()-S)};k();let M=window.setInterval(k,1000);return()=>window.clearInterval(M)},[i,s,t]);let T=t!==void 0?m(o==="total"?"stream.codex.totalDuration":"stream.codex.workedFor",{duration:Z(t,d.language)}):i&&L>=1000?m("stream.codex.workingFor",{duration:Z(L,d.language)}):m(i?"stream.codex.working":"stream.codex.worked");return p("section",{className:"codex-work-section",children:[p("button",{type:"button",className:"codex-work-trigger","data-codex-disclosure":"","aria-expanded":g,onClick:()=>f((k)=>!k),children:[u!==void 0&&n("span",{className:"codex-work-provider-icon","data-testid":"codex-work-provider-icon","data-provider-id":u,"aria-hidden":"true",children:c}),n("span",{children:T}),n(I,{expanded:g,className:"codex-work-chevron"})]}),n("div",{className:"codex-work-separator","aria-hidden":"true"}),n("div",{className:h("codex-work-grid",g&&"codex-work-grid-open"),"aria-hidden":!g,inert:!g,children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-work-body",children:y&&l})})})]})}function He(e,t){if(e.type==="tool_use")return Ne(e,t);if(e.type==="thinking")return t("message.thinking");if(e.type==="collab")return ce(e,t);return t("stream.codex.subagentWorking",{name:e.name})}function Y(e){if(e.type==="thinking")return!e.isComplete;if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return b(e.status);return!1}function We(e,t,o=1000){let[i,r]=_({text:e,live:t}),s=U(Date.now());return O(()=>{if(e===i.text&&t===i.live)return;let u=Date.now(),c=Math.max(0,s.current+o-u);if(c===0||t!==i.live){s.current=u,r({text:e,live:t});return}let l=window.setTimeout(()=>{s.current=Date.now(),r({text:e,live:t})},c);return()=>window.clearTimeout(l)},[i,t,o,e]),t===i.live?i.text:e}function je({blocks:e,defaultExpanded:t=!0}){let{t:o,i18n:i}=a(),r=e.some(Y),s=N(e[0]),u=e.every((y)=>y.type==="tool_use"&&E(y).category==="execute"),[c,l]=R(`group:${s}`,t&&!u),m=W(`group:${s}`,c),d=e.findLast(Y)??e.at(-1);if(d===void 0)throw Error("CodexActivityGroup requires at least one activity block");let g=e.filter((y)=>y.type==="tool_use"),f=We(r?He(d,o):Ze(g,o,i.language),r);return p("div",{className:"codex-activity-group",children:[p("button",{type:"button",className:"codex-activity-group-trigger","data-codex-disclosure":"","aria-expanded":c,onClick:()=>l((y)=>!y),children:[p("span",{className:"codex-activity-label",children:[n(te,{block:e[0]}),n("span",{className:"truncate",children:r?n("span",{className:"codex-activity-running",children:f}):f})]}),n(I,{expanded:c})]}),n("div",{className:h("codex-activity-group-grid",c&&"codex-activity-group-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-activity-group-body",children:m&&e.map((y)=>n(ie,{block:y},N(y)))})})})]})}function ee({blocks:e,defaultExpanded:t}){if(e.length===0)throw Error("CodexActivityGroup requires at least one activity block");if(e.length===1)return n(ie,{block:e[0]});return n(je,{blocks:e,defaultExpanded:t})}function $e({blocks:e,defaultExpanded:t}){if(!e.some(we))return n(ee,{blocks:e,defaultExpanded:t});let o=[];for(let i of e){let r=o.at(-1);if(r&&we(r[0])===we(i))r.push(i);else o.push([i])}return n(P,{children:o.map((i)=>we(i[0])?n(qo,{blocks:i.filter(we)},N(i[0])):n(ee,{blocks:i,defaultExpanded:t},N(i[0])))})}
|
|
7
|
-
export{$o,$e};
|
package/dist/chunk-kjtd3wc3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cn as a}from"cn";import{jsx as o}from"react/jsx-runtime";function v({className:e,...t}){return o("label",{"data-slot":"label",className:a("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}export{v};
|
package/dist/chunk-kmhwwzga.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jn,ne}from"./chunk-bj5ma2sv.js";import{Kn}from"./chunk-d5w1nvrz.js";import{Xn,Ut,$t}from"./chunk-2rperg04.js";import{qt,Vt,De,He,Wt}from"./chunk-cazdmcwd.js";import{cn as P}from"cn";import{ArrowUpIcon as fe,Loader2Icon as ge,SquareIcon as be,XIcon as ve}from"lucide-react";import{Children as Y,useCallback as h,useEffect as F,useMemo as he,useRef as M,useState as Pe}from"react";import{flushSync as Ie}from"react-dom";import{jsx as a,jsxs as ye}from"react/jsx-runtime";function Z(u){let o=new FormData(u).get("message");return typeof o==="string"?o:""}var Un=({className:u,bashMode:o=!1,attachmentPolicy:I,onCommand:d,onSubmitError:y,canSubmit:f,onSubmitAsync:g,accept:E,multiple:ee,globalDrop:C,syncHiddenInput:R,maxFiles:z,maxFileSize:H,onError:b,onSubmit:te,children:re,...oe})=>{let s=He(),l=!!s,se=o&&l&&s.textInput.value.startsWith("!"),x=M(null),A=M(null),k=M(!1),[ie,D]=Pe([]),c=l?s.attachments.files:ie,U=M(c);U.current=c;let ae=h(()=>{x.current?.click()},[]),B=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]),O=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""},[]),ue=h((e)=>{let r=[...e],t=r.filter((i)=>B(i));if(r.length&&t.length===0){b?.({code:"accept",message:"No files match the accepted types."});return}let n=(i)=>H?i.size<=H:!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}D((i)=>{let v=I?I.uniqueFiles(m,i):m,p=typeof z==="number"?Math.max(0,z-i.length):void 0,_=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 Q=[];for(let T of _){let V=I?.sourcePath(T);Q.push({id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(T),mediaType:O(T),filename:T.name,size:T.size,lastModified:T.lastModified,...V===void 0?{}:{sourcePath:V}})}return[...i,...Q]})},[I,O,B,z,H,b]),le=h((e)=>D((r)=>{let t=r.find((n)=>n.id===e);if(t?.url)URL.revokeObjectURL(t.url);return r.filter((n)=>n.id!==e)}),[]),pe=h(()=>D((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),W=l?s.attachments.add:ue,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(jn(m,n)){b?.({code:"max_total_size",message:`Total image size must not exceed ${ne}MB.`});return}}W(r)},[c,W,b]),j=l?s.attachments.remove:le,N=l?s.attachments.clear:pe,q=l?s.attachments.openFileDialog:ae;F(()=>{if(!l)return;s.__registerFileInput(x,()=>x.current?.click())},[l,s]),F(()=>{if(R&&x.current&&c.length===0)x.current.value=""},[c,R]),F(()=>{let e=A.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 U.current)if(e.url)URL.revokeObjectURL(e.url)}},[l]);let me=(e)=>{if(e.currentTarget.files)L(e.currentTarget.files);e.currentTarget.value=""},X=he(()=>({files:c.map((e)=>({...e,id:e.id})),add:L,remove:j,clear:N,openFileDialog:q,fileInputRef:x}),[c,L,j,N,q]),w=M({controller:s,files:c,canSubmit:f});w.current={controller:s,files:c,canSubmit:f};let S=M(!0);F(()=>(S.current=!0,()=>{S.current=!1}),[]);let J=async(e)=>{let r=f===void 0?!0:f();if(r!==!0)return{status:"blocked",reason:r};if(k.current)return{status:"blocked",reason:"submission_pending"};if(e===null&&g===void 0)throw Error("Awaitable submission requires onSubmitAsync");let t=A.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let n=l?s.textInput.value:Z(t),m=s?.textInput.getRevision?.(),i=c,v=()=>{if(!S.current)return;let p=w.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(Z(t)===n)t.reset();N()};k.current=!0;try{if(d?.(n.trim()))return v(),{status:"accepted"};let p=await Kn(i),_=w.current.canSubmit===void 0?!0:w.current.canSubmit();if(_!==!0)return{status:"blocked",reason:_};if(!S.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 te({text:n,files:p.files},e);return v(),{status:"accepted"}}finally{k.current=!1}},ce=(e)=>{e.preventDefault(),J(e).catch(y)},de=h((e)=>{if(!e.trim())return;if(l&&s)Ie(()=>{s.textInput.setInput(e)});A.current?.requestSubmit()},[s,l]),K=a(Vt.Provider,{value:()=>J(null),children:ye(qt.Provider,{value:de,children:[a("input",{accept:E,"aria-label":"Upload files",className:"hidden",multiple:ee,onChange:me,ref:x,title:"Upload files",type:"file"}),a("form",{className:P("w-full",u),onSubmit:ce,ref:A,"data-tour":"chat-input",...oe,children:a(Xn,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",se&&"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:re})})]})});return l?a(De.Provider,{value:X,children:K}):a(Wt.Provider,{value:X,children:K})};function $n({className:u,...o}){return a("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",u),...o})}function qn({className:u,...o}){return a(Ut,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",u),...o})}function Vn({className:u,...o}){return a(Ut,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",u),...o})}function Wn({className:u,...o}){return a("div",{className:P("flex items-center gap-1",u),...o})}var G=({variant:u="ghost",className:o,size:I,collapsed:d=!1,...y})=>{let f=d||Y.count(y.children)<=1?"icon-xs":"xs";return a($t,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(d||Y.count(y.children)<=1)&&"size-7",o),size:f,type:"button",variant:u,...y})},Gn=({className:u,variant:o="ghost",size:I="icon-xs",status:d,children:y,...f})=>{let g=a(fe,{className:"size-4"});if(d==="submitted")g=a(ge,{className:"size-4 animate-spin"});else if(d==="streaming")g=a(be,{className:"size-3 fill-current"});else if(d==="error")g=a(ve,{className:"size-4"});return a($t,{"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{Un,$n,qn,Vn,Wn,G,Gn};
|
package/dist/chunk-kzq1797a.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-qxabrz98.js";import{ChevronDownIcon as b,ChevronUpIcon as C,FileDiffIcon as k}from"lucide-react";import{useState as m}from"react";import{jsx as s,jsxs as o}from"react/jsx-runtime";function x(e){if(e===null||e.length===0)return 0;return e.split(`
|
|
2
|
-
`).length}function qr(e){let c=new Map;for(let r of e)for(let u of r.content){if(u.type!=="diff")continue;let d=u,f=d._meta?.alwith?.hunks??[],l=f.reduce((n,i)=>n+x(i.newText),0),h=f.reduce((n,i)=>n+x(i.oldText),0);for(let n of d.changes){let i=c.get(n.path);if(i)i.additions+=l,i.deletions+=h;else c.set(n.path,{path:n.path,additions:l,deletions:h})}}return[...c.values()]}function Uo({blocks:e}){return s(en,{files:qr(e)})}function en({files:e,onOpen:c,renderPath:r,actions:u}){let{t:d,openLink:f}=a(),[l,h]=m(!0),[n,i]=m(!1);if(e.length===0)return null;let g=e.reduce((t,p)=>t+p.additions,0),v=e.reduce((t,p)=>t+p.deletions,0);return o("section",{className:"codex-edited-files-card",children:[o("div",{className:"codex-edited-files-header",children:[s("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:s(k,{})}),o("div",{className:"codex-edited-files-summary",children:[s("strong",{children:d("stream.codex.editedFilesCount",{count:e.length})}),s("button",{type:"button","data-codex-disclosure":"",onClick:()=>{h((t)=>!t),i(!1)},"aria-expanded":l,children:d(l?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),u,o("div",{className:"codex-edited-files-total",title:d("stream.codex.changedLines"),children:[o("span",{className:"codex-diff-additions",children:["+",g]}),o("span",{className:"codex-diff-deletions",children:["-",v]})]})]}),l&&o("div",{className:"codex-edited-files-list",children:[(n?e:e.slice(0,3)).map((t)=>o("div",{className:"codex-edited-file-row",children:[s("button",{type:"button",className:"codex-edited-file-path",title:t.path,onClick:()=>c===void 0?f(t.path):c(t),children:r===void 0?t.path:r(t)}),o("span",{className:"codex-edited-file-counts",children:[o("span",{className:"codex-diff-additions",children:["+",t.additions]}),o("span",{className:"codex-diff-deletions",children:["-",t.deletions]})]})]},t.path)),e.length>3&&o("button",{type:"button",className:"codex-edited-files-more","aria-expanded":n,onClick:()=>i((t)=>!t),children:[d(n?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),n?s(C,{size:16,"aria-hidden":"true"}):s(b,{size:16,"aria-hidden":"true"})]})]})]})}
|
|
3
|
-
export{qr,Uo,en};
|
package/dist/chunk-mr1azhef.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cn as r}from"cn";import{jsx as d}from"react/jsx-runtime";function oo({className:a,size:t="default",...o}){return d("div",{"data-slot":"card","data-size":t,className:r("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...o})}function ro({className:a,...t}){return d("div",{"data-slot":"card-header",className:r("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",a),...t})}function io({className:a,...t}){return d("div",{"data-slot":"card-title",className:r("text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",a),...t})}function ao({className:a,...t}){return d("div",{"data-slot":"card-description",className:r("text-sm text-muted-foreground",a),...t})}function gi({className:a,...t}){return d("div",{"data-slot":"card-action",className:r("col-start-2 row-span-2 row-start-1 self-start justify-self-end",a),...t})}function so({className:a,...t}){return d("div",{"data-slot":"card-content",className:r("flex flex-col gap-3 px-(--card-spacing)",a),...t})}function lo({className:a,...t}){return d("div",{"data-slot":"card-footer",className:r("flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)",a),...t})}export{oo,ro,io,ao,gi,so,lo};
|
package/dist/chunk-n0xzhjdg.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function Mr(t,e){if(t.type||!e.type)return t;let o=e.type.split("/")[1],i=o!==void 0&&o!==""?`pasted-${Date.now()}.${o==="jpeg"?"jpg":o}`:"";return new File([t],t.name||i||`pasted-${Date.now()}`,{type:e.type})}function Cn(t){let e=[],o=!1;for(let i of t){if(i.kind!=="file")continue;let n=i.getAsFile();if(!n)continue;if(!(n.type||i.type).startsWith("image/")){o=!0;continue}e.push(Mr(n,i))}return{imageFiles:e,sawNonImageFile:o}}function Tn(t){return[...t].some((e)=>e.kind==="string")}function s(t){let e=t.codePointAt(0);return e<32&&e!==9&&e!==10&&e!==13||e===127}function Rr(t){return[...t].filter((e)=>!s(e)).join("")}function vr(t,e){let o=0;for(let i=0;i<e;i++){let n=t.charCodeAt(i);if(n>=0&&n<=8||n===11||n===12||n>=14&&n<=31||n===127)o++}return o}function lt(t){let{value:e,selectionStart:o,selectionEnd:i}=t,n=Rr(e);if(n===e)return n;if(t.value=n,o!==null&&i!==null){let a=Math.max(0,o-vr(e,o)),r=Math.max(0,i-vr(e,i));requestAnimationFrame(()=>{t.setSelectionRange(a,r)})}return n}
|
|
2
|
-
export{Mr,Cn,Tn,Rr,vr,lt};
|
package/dist/chunk-n1tjf64a.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{isGroupedSelect as i,isSelectOption as o}from"@nyssance/codex-acp-v2/client";function N(e){return i(e.options)?e.options.flatMap((t)=>t.options):e.options}function c(e,t){return e.find((n)=>n.category===t&&o(n))}function M(e){return N(e).find((t)=>t.value===e.currentValue)?.name??e.currentValue}
|
|
2
|
-
export{N,c,M};
|
package/dist/chunk-n5xqjct2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e}from"./chunk-wpdn3rx8.js";import{Dialog as i}from"@base-ui/react/dialog";import{cn as r}from"cn";import{XIcon as d}from"lucide-react";import{jsx as a,jsxs as l}from"react/jsx-runtime";function u({...o}){return a(i.Root,{"data-slot":"dialog",...o})}function yi({...o}){return a(i.Trigger,{"data-slot":"dialog-trigger",...o})}function Dr({...o}){return a(i.Portal,{"data-slot":"dialog-portal",...o})}function go({...o}){return a(i.Close,{"data-slot":"dialog-close",...o})}function _r({className:o,...t}){return a(i.Backdrop,{"data-slot":"dialog-overlay",className:r("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",o),...t})}function m({className:o,children:t,showCloseButton:n=!0,...s}){return l(Dr,{children:[a(_r,{}),l(i.Popup,{"data-slot":"dialog-content",className:r("fixed top-1/2 start-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",o),...s,children:[t,n&&l(i.Close,{"data-slot":"dialog-close",render:a(e,{variant:"ghost",className:"absolute top-4 end-4",size:"icon-sm"}),children:[a(d,{}),a("span",{className:"sr-only",children:"Close"})]})]})]})}function b({className:o,...t}){return a("div",{"data-slot":"dialog-header",className:r("flex flex-col gap-2",o),...t})}function K({className:o,showCloseButton:t=!1,children:n,...s}){return l("div",{"data-slot":"dialog-footer",className:r("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",o),...s,children:[n,t&&a(i.Close,{render:a(e,{variant:"outline"}),children:"Close"})]})}function p({className:o,...t}){return a(i.Title,{"data-slot":"dialog-title",className:r("leading-none font-medium",o),...t})}function w({className:o,...t}){return a(i.Description,{"data-slot":"dialog-description",className:r("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",o),...t})}export{u,yi,Dr,go,_r,m,b,K,p,w};
|
package/dist/chunk-nqv69z6n.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function*St(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 Kr(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 St(s,e))r.push({turnKey:t,occurrenceInTurn:c}),c+=1}return r}
|
|
2
|
-
export{St,Kr};
|
package/dist/chunk-pv35kspb.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cn as a}from"cn";import{Loader2Icon as r}from"lucide-react";import{jsx as e}from"react/jsx-runtime";function le({className:o,...n}){return e(r,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:a("size-4 animate-spin",o),...n})}export{le};
|
package/dist/chunk-pw6p654f.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{Zt,Jt}from"./chunk-jjnmq2zj.js";import{h}from"./chunk-3z6rx5qv.js";import{mn}from"./chunk-n56csv51.js";import{t}from"./chunk-q6km9nha.js";import{Xo,Q,qe,Zo}from"./chunk-e99sdapw.js";import{tn}from"./chunk-7g79m27w.js";import{oe}from"./chunk-39sbgvd3.js";import{cn}from"./chunk-jp73gpbp.js";import{zo}from"./chunk-01denvg2.js";import{ar}from"./chunk-cc0tan75.js";import{Go}from"./chunk-qz8gpb9j.js";import{sn,ln}from"./chunk-91h14q3y.js";import{Ve}from"./chunk-m4dgha79.js";import{codexMessageError as J,codexTurnError as U,isContentEntry as ae,isEmbeddedResource as X,isImage as Y,isResourceLink as me,isText as le,nativeTurnId as de}from"@nyssance/codex-acp-v2/client";import{LoaderCircleIcon as ce,SparklesIcon as ge}from"lucide-react";import{Fragment as ue,memo as pe,useEffect as fe,useState as ye}from"react";import{jsx as s,jsxs as m,Fragment as E}from"react/jsx-runtime";function q(i){if(Y(i))return`${i.mimeType.toLowerCase()}:${i.data}`;if(X(i)&&"blob"in i.resource&&i.resource.mimeType?.toLowerCase().startsWith("image/"))return`${i.resource.mimeType.toLowerCase()}:${i.resource.blob}`;return null}function he({item:i}){let{t:n}=t(),l=i.status==="in_progress",[o,c]=ye(()=>Date.now()-i.at>=1e4);return fe(()=>{if(!l)return;let a=Math.max(0,i.at+1e4-Date.now());if(c(a===0),a===0)return;let f=setTimeout(()=>c(!0),a);return()=>clearTimeout(f)},[i.id,i.at,l]),m("div",{className:"codex-context-compaction",children:[s(ge,{"aria-hidden":"true"}),s("span",{children:i.status==="completed"?n("stream.codex.contextCompacted"):i.status==="cancelled"?n("timeline.interrupted"):n(o?"timeline.compactingWithDelayNotice":"timeline.compacting")})]})}function N({sessionId:i,entry:n,terminals:l,streaming:o,streamingThoughtId:c}){let{t:a}=t();switch(n.kind){case"activity":return s(tn,{sessionId:i,items:n.items,terminals:l,streamingThoughtId:c});case"text":return h(n.item._meta).length>0?s(cn,{sessionId:i,item:n.item}):s(oe,{content:n.item.content,messageId:n.item.id,streaming:o});case"plan":return s(ar,{plan:n.item.plan});case"compaction":if(n.item.status==="failed")return m(sn,{children:[s("div",{children:a("timeline.compactionFailed")}),n.item.error!==null&&s("div",{children:n.item.error})]});return s(he,{item:n.item})}}function xe({sessionId:i,turn:n,terminals:l,active:o,blocked:c=!1,continued:a=!1,edits:f=n.edits,activityItems:M=n.items,workStartedAt:Z=n.startedAt,isLast:W,error:y,interrupted:F,retry:L,retrying:u,answerActions:K,footer:ee}){let{t:d}=t(),C=n.errors.map((e)=>{let r=J(e);if(r===null)throw Error("Turn error item is missing its diagnostics");let v=L?.turnId===de(e)?L:void 0;return s(ln,{error:r,retry:v},`${e.id}:${v?.delaySeconds??"manual"}`)});if(W&&y!==null&&!n.errors.some((e)=>{let r=J(e);return r!==null&&r.stopReason===y.stopReason&&U(r).message===U(y).message}))C.push(s(ln,{error:y},"current-run-error"));let x=C.length>0?s("div",{className:"codex-turn-errors",children:C}):null,A=n.items.filter(mn);if(A.length>0&&A.length===n.items.length)return m(E,{children:[s(tn,{sessionId:i,items:A,terminals:l,streamingThoughtId:null}),x]});let k=n.work,T=k.length>0&&k.every((e)=>e.kind==="compaction");if(Xo(n)||T&&n.final.length===0)return m(E,{children:[s("div",{role:"status",className:"text-muted-foreground flex min-w-0 flex-col gap-2 py-2 text-sm",children:n.work.map((e)=>s(N,{sessionId:i,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key))}),x]});let O=qe(n),P=n.final.filter((e)=>h(e._meta).length===0).map(Q).join(`
|
|
2
|
-
`),w=o?null:Ve(n,"assistant"),D=n.items.filter((e)=>e.kind==="tool"&&e.name==="image_generation"&&(e.status==="pending"||e.status==="in_progress")),G=new Set(n.final.flatMap((e)=>e.content.map(q).filter((r)=>r!==null))),b=n.items.flatMap((e)=>{if(e.kind!=="tool"||e.status!=="completed")return[];return e.content.filter(ae).flatMap((r,v)=>{let g=r.content,ie=e.name==="image_generation"&&Y(g),re=e.toolKind!=="read"&&e.toolKind!=="search"&&(me(g)||X(g)&&("blob"in g.resource));if(!ie&&!re)return[];let _=q(g);if(_!==null){if(G.has(_))return[];G.add(_)}return[{key:`${e.id}:${v}`,block:g}]})}),R=n.final.some((e)=>h(e._meta).length===0&&e.content.some((r)=>!le(r)||r.text.trim().length>0)),te=D.length>0||b.length>0||T||R||n.final.some((e)=>h(e._meta).length>0),I=n.items.findIndex((e)=>n.final.includes(e)),S=(e)=>n.items.indexOf(e.kind==="activity"?e.items[0]:e.item),B=k.filter((e)=>I===-1||S(e)<I),ne=k.filter((e)=>I!==-1&&S(e)>I),se=[...n.final.map((e)=>({kind:"answer",item:e,index:n.items.indexOf(e)})),...ne.map((e)=>({kind:"work",entry:e,index:S(e)}))].toSorted((e,r)=>e.index-r.index),H=!o&&!a&&(P.trim().length>0?s(Zt,{text:P,isMostRecentTurn:W,time:w,afterCopy:K}):m("div",{className:"flex items-center gap-0.5",children:[K,w&&s("span",{className:"codex-user-time ms-1",title:w.full,children:w.short})]})),p=Go({...n,items:M},{running:o,blocked:c,retrying:u!==void 0}),V=p.kind==="reasoning"?p.ownerKey??null:null,j=p.kind==="thinking",z=Zo({...n,items:M});return m(E,{children:[s(Jt,{stateKey:JSON.stringify([i,n.replayed?"history":"live",n.key]),active:o&&!R,defaultExpanded:o&&!R||!n.replayed&&(F||O),...z,startedAt:z.startedAt??Z,loading:(j||p.kind==="working")&&n.work.length===0,loadingLabel:p.kind==="working"?d("stream.codex.working"):void 0,work:a||T?[]:B.map((e)=>s(N,{sessionId:i,entry:e,terminals:l,streaming:o,streamingThoughtId:V},e.key)),answer:te||a?m("div",{className:"flex min-w-0 flex-col gap-3",children:[(a||T)&&B.map((e)=>s(N,{sessionId:i,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key)),se.map((e)=>{if(e.kind==="work")return s(N,{sessionId:i,entry:e.entry,terminals:l,streaming:o,streamingThoughtId:V},e.entry.key);let r=e.item;return m(ue,{children:[h(r._meta).length>0?s(cn,{sessionId:i,item:r}):s(oe,{content:r.content,messageId:r.id,streaming:o}),r===n.final.at(-1)&&H]},r.id)}),D.map((e)=>m("div",{className:"codex-image-generation",role:"status","aria-label":d(o?"timeline.imageGenerating":"timeline.imageStopped"),"aria-busy":o,children:[s("div",{className:"codex-image-generation-texture","aria-hidden":"true"}),m("span",{className:"codex-image-generation-status",children:[o&&s(ce,{className:"size-4 motion-safe:animate-spin","aria-hidden":"true"}),d(o?"timeline.imageGenerating":"timeline.imageStopped")]})]},e.id)),b.length>0&&s("div",{className:"codex-reply-artifacts flex min-w-0 flex-col gap-3",children:b.map((e)=>s(oe,{content:[e.block],messageId:e.key,streaming:!1},e.key))}),n.final.length===0&&H]}):null,footer:m(E,{children:[j&&n.work.length>0&&s("div",{className:"codex-pending-message py-2",role:"status",children:s("span",{className:"codex-activity-running",children:d("message.thinking")})}),ee,f.length>0&&!o&&!a&&s(zo,{items:f}),F&&!O&&s("div",{className:"codex-interrupted-turn",role:"status",children:d("timeline.interrupted")}),!o&&x]})}),o&&u!==void 0&&s("div",{className:"text-muted-foreground py-2 text-sm",role:"status",children:u.capacity?(()=>{let e=/Reconnecting(?:\.\.\.)?\s+(\d+\/\d+)/.exec(u.message)?.[1];return e===void 0?d("timeline.capacityReconnecting"):d("timeline.capacityReconnectingProgress",{progress:e})})():u.message}),o&&x]})}var Bo=pe(xe);
|
|
3
|
-
export{Bo};
|
package/dist/chunk-q6km9nha.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{cr}from"./chunk-qxabrz98.js";import{createContext as s,useContext as l,useSyncExternalStore as m}from"react";import{jsx as r}from"react/jsx-runtime";var c=s(null),u=s(null);function re({host:e,client:i,children:o}){return r(cr,{host:e,children:r(c,{value:e,children:r(u,{value:i,children:o})})})}function t(){let e=l(c);if(e===null)throw Error("Timeline host is missing");return e}function ie(){let e=l(u);if(e===null)throw Error("Timeline client is missing");return e}function ke(e,i){return m((o)=>e.subscribe(o),()=>i(e.getState()),()=>i(e.getState()))}function n(e){let i=ie();return ke(i.store,e)}function Ge(e,i){if(e.reportError)e.reportError(i);else console.error(i)}
|
|
2
|
-
export{re,t,ie,ke,n,Ge};
|
package/dist/chunk-qca5mhqd.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{y}from"./chunk-cazdmcwd.js";import{e}from"./chunk-wpdn3rx8.js";import{o}from"./chunk-0ss92kxr.js";import{Le}from"./chunk-59j0p8hy.js";import{FileText as l,RotateCcw as x,X as d}from"lucide-react";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Ln({data:s,sessionId:m}){let{host:a}=o(),{t:n}=a,p=y(),{text:c,status:r}=s.pastedText;return i("div",{className:"bg-muted flex max-w-64 min-w-0 items-center gap-1 rounded-lg px-2 py-1",children:[i(e,{type:"button",variant:"ghost",disabled:r!=="ready",onClick:()=>a.openLink(s.url),className:"h-auto min-w-0 flex-1 shrink gap-2 overflow-hidden px-0 py-1",children:[t(l,{className:"size-4 shrink-0"}),i("span",{className:"min-w-0 flex-1 text-start",children:[t("span",{className:"block truncate text-xs",children:s.filename}),t("span",{className:"text-muted-foreground block text-xs",children:r==="ready"?n("composer.pastedTextCharacters",{count:c.length}):n(r==="pending"?"composer.pastedTextPending":"composer.pastedTextError")})]})]}),r==="error"&&a.writeTextAttachment&&t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":n("composer.pastedTextRetry"),onClick:()=>Le(m,s,a.writeTextAttachment),children:t(x,{className:"size-3"})}),t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":n("composer.pastedTextRemove"),onClick:()=>p.remove(s.id),children:t(d,{className:"size-3"})})]})}
|
|
2
|
-
export{Ln};
|
package/dist/chunk-qxabrz98.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createContext as i,useContext as r}from"react";import{jsx as e}from"react/jsx-runtime";var n=i(null);function cr({host:t,children:o}){return e(n.Provider,{value:t,children:o})}function a(){let t=r(n);if(t===null)throw Error("Activity host is missing");return t}function x(t){let{Markdown:o}=a();return e(o,{...t})}
|
|
2
|
-
export{cr,a,x};
|
package/dist/chunk-r1988zpy.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var yr={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function eo(e){return[...e].toSorted((o,n)=>(yr[o.kind]??99)-(yr[n.kind]??99))}function mi(e){return e==="allow_once"||e==="allow_always"}function pi(e){return e==="allow_always"||e==="reject_always"}
|
|
2
|
-
export{yr,eo,mi,pi};
|
package/dist/chunk-sespfp7t.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{e}from"./chunk-wpdn3rx8.js";import{j}from"./chunk-1fm5vx1n.js";import{Ht}from"./chunk-ahtyazfy.js";import{Sn}from"./chunk-w38vbf7h.js";import{_e}from"./chunk-cazdmcwd.js";import{autoUpdate as rt}from"@floating-ui/dom";import{cn as X}from"cn";import{BookOpenTextIcon as st,FileIcon as it,StoreIcon as lt}from"lucide-react";import{useCallback as ut,useEffect as v,useLayoutEffect as Y,useMemo as Z,useRef as _,useState as g}from"react";import{createPortal as at}from"react-dom";import{jsx as p,jsxs as E,Fragment as ct}from"react/jsx-runtime";function kn({handleRef:a,anchorRef:c,commands:C,searchFiles:u,onMention:R,onSearchError:H,fileSearchDebounceMs:M=0,bashMode:A=!1,forcedOpen:i=!1,onForcedOpenChange:f,emptyLabel:F,fileStatusLabels:h,morePlugins:D}){let z=_e(),l=z.textInput.value,[K,U]=g(0),[y,P]=g(null),[b,L]=g(0),V=_(null);v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=()=>U(t.selectionStart??0),o=()=>{if(document.activeElement===t)n()};return t.addEventListener("keyup",n),t.addEventListener("click",n),t.addEventListener("input",n),t.addEventListener("select",n),t.addEventListener("focus",n),document.addEventListener("selectionchange",o),()=>{t.removeEventListener("keyup",n),t.removeEventListener("click",n),t.removeEventListener("input",n),t.removeEventListener("select",n),t.removeEventListener("focus",n),document.removeEventListener("selectionchange",o)}});let W=Z(()=>A&&l.startsWith("!")?null:Sn(l,K),[l,K,A]),r=W?.kind==="at"&&!u?null:W,q=`${r?.kind??"forced"}:${r?.query??""}:${i}`,[O,tt]=g(q);if(O!==q)tt(q),L(0);let I=_(null);v(()=>{if(!i){I.current=null;return}if(I.current===null)I.current=l;else if(l!==I.current)f?.(!1)},[i,l,f]);let x=r?.kind==="at"?r.query:null;v(()=>{if(x===null||!u){P(null);return}let t=!0,n=()=>{u(x).then((s)=>{if(t)P({query:x,search:u,items:s})},(s)=>{if(t)P({query:x,search:u,items:[]}),H(s)})},o=M>0?window.setTimeout(n,M):null;if(o===null)n();return()=>{if(t=!1,o!==null)window.clearTimeout(o)}},[x,u,M,H]);let d=Z(()=>{if(r?.kind==="at")return y?.query===r.query&&y.search===u?y.items:[];if(r)return Ht(C,r.query);if(i)return Ht(C,"");return[]},[r,i,C,y,u]),[et,N]=g(!1);v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=()=>N(!0),o=()=>{if(N(!1),i)f?.(!1)};return N(document.activeElement===t),t.addEventListener("focus",n),t.addEventListener("blur",o),()=>{t.removeEventListener("focus",n),t.removeEventListener("blur",o)}},[a,i,f]),v(()=>{if(i)a.current?.getTextarea()?.focus()},[i,a]);let m=et&&(r!==null?r.kind==="slash"||d.length>0||!!h:i);v(()=>{if(!m)return;V.current?.querySelector(`[data-idx="${b}"]`)?.scrollIntoView({block:"nearest"})},[b,m]);function Q(t){let n=a.current?.getTextarea();if(!n)return;let o,s;if(r){let B=r.kind==="slash"?`/${t.payload} `:`@${t.label} `;if(o=l.slice(0,r.start)+B+l.slice(r.end),r.kind==="at")R?.(t.payload);s=r.start+B.length}else if(i)o=`${l.length===0||l.endsWith(`
|
|
2
|
-
`)?l:`${l}
|
|
3
|
-
`}/${t.payload} `,s=o.length,f?.(!1);else return;z.textInput.setInput(o),requestAnimationFrame(()=>{n.focus(),n.setSelectionRange(s,s)})}v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=(o)=>{if(!m)return;if(a.current?.isComposing()||o.isComposing||o.keyCode===229)return;if(o.key==="ArrowDown")o.preventDefault(),o.stopPropagation(),L((s)=>d.length===0?0:Math.min(d.length-1,s+1));else if(o.key==="ArrowUp")o.preventDefault(),o.stopPropagation(),L((s)=>Math.max(0,s-1));else if(o.key==="Enter"||o.key==="Tab"){o.preventDefault(),o.stopPropagation();let s=d[b];if(s)Q(s)}else if(o.key==="Escape")if(o.preventDefault(),o.stopPropagation(),r)U(Math.max(0,r.start-1)),t.setSelectionRange(r.start,r.start);else f?.(!1)};return t.addEventListener("keydown",n,!0),()=>t.removeEventListener("keydown",n,!0)});let[k,G]=g(null),[S,nt]=g(null),T=ut(()=>{let t=c?.current;if(!t)return;let n=t.getBoundingClientRect();G({left:n.left,width:n.width,bottom:window.innerHeight-n.top+8})},[c]);if(Y(()=>{if(!m){G(null);return}T()},[m,T]),Y(()=>{let t=c?.current;if(!m||!t||!S)return;return rt(t,S,T,{animationFrame:!0})},[m,S,c,T]),!m||c&&!k)return null;let w=r?r.kind==="slash":i,ot=w?st:it,J=p("div",{ref:nt,className:c?"fixed z-50":"absolute inset-x-0 bottom-full z-50 mb-2",style:c&&k?{left:k.left,width:k.width,bottom:k.bottom}:void 0,children:E("div",{ref:V,role:"listbox",onMouseDown:(t)=>t.preventDefault(),className:"bg-popover text-popover-foreground ring-foreground/10 pointer-events-auto w-full overflow-hidden rounded-lg p-1 shadow-md ring-1 outline-hidden",children:[E("div",{className:"max-h-72 overflow-y-auto",children:[d.length===0&&w&&p("div",{className:"text-muted-foreground px-2 py-3 text-xs",children:F}),d.length===0&&!w&&h&&p("div",{role:"status",className:"text-muted-foreground px-2 py-3 text-xs",children:y?.query===x&&y.search===u?h.empty:h.loading}),d.map((t,n)=>E(e,{type:"button",variant:"ghost",role:"option","aria-selected":n===b,"data-idx":n,onMouseDown:(o)=>{o.preventDefault(),Q(t)},onMouseEnter:()=>L(n),className:X("flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-2.5 py-2 text-start",n===b&&"bg-muted"),children:[p(ot,{className:X("size-4 shrink-0",w?"text-blue-500":"text-muted-foreground")}),p("span",{className:"text-foreground shrink-0 text-sm font-medium",children:t.label}),t.description&&p("span",{className:"text-muted-foreground min-w-0 flex-1 truncate text-xs",children:t.description})]},t.key))]}),w&&D&&E(ct,{children:[p(j,{}),E(e,{type:"button",variant:"ghost",onMouseDown:(t)=>{t.preventDefault(),f?.(!1),D.open()},className:"h-auto w-full justify-start px-2.5 py-2",children:[p(lt,{"data-icon":"inline-start"}),D.label]})]})]})});return c?at(J,document.body):J}
|
|
4
|
-
export{kn};
|
package/dist/chunk-sf6ze845.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e}from"./chunk-wpdn3rx8.js";import{H,F,S}from"./chunk-h68f23r0.js";import{f}from"./chunk-3k5n3809.js";import{useState as w}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";function Dn({value:r,currentName:o,icon:p,options:i,label:s,header:a,onValueChange:d,showLabel:l=!1,disabled:u=!1,warning:m=!1}){let[c,g]=w(!1);return t(H,{open:c,onOpenChange:g,children:[n(F,{render:t(e,{disabled:u,"data-permission-warning":m?"":void 0,variant:"ghost","aria-label":`${s}: ${o}`,title:o,className:"text-muted-foreground data-popup-open:hover:bg-muted h-7 gap-1.5 rounded-full bg-transparent px-2 text-xs font-normal whitespace-nowrap data-popup-open:bg-transparent",children:[p,n("span",{className:l?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:o})]})}),t(S,{align:"start",sideOffset:4,className:"permission-mode-menu z-100 w-auto max-w-[calc(100vw-2rem)] min-w-72 rounded-xl p-1.5",children:[a&&n("div",{className:"text-muted-foreground flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4",children:n("span",{children:a})}),n(f,{value:r,onValueChange:d,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:i})]})]})}
|
|
2
|
-
export{Dn};
|
package/dist/chunk-sxgc25gz.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n}from"./chunk-q6km9nha.js";import{e}from"./chunk-wpdn3rx8.js";import{Ue}from"./chunk-zb4mqy8f.js";import{c,M}from"./chunk-n1tjf64a.js";import{o}from"./chunk-0ss92kxr.js";import{inSessionTree as z}from"@nyssance/codex-acp-v2/client";import{ChevronDownIcon as B,ChevronRightIcon as q,GitBranchIcon as E,Loader2Icon as O,SquareIcon as R}from"lucide-react";import{useId as T,useState as g}from"react";import{jsx as s,jsxs as r}from"react/jsx-runtime";function Fe({sessionId:t}){let d=n((a)=>a.sessions),l=Object.values(d).filter((a)=>a.subagent?.parentId===t);if(l.length===0)return null;return s("div",{"data-subagent-sessions":!0,className:"min-w-0",children:l.map((a)=>s(j,{session:a},a.id))})}function j({session:t}){let{client:d,host:l}=o(),{t:a}=l,v=n((i)=>i.actions),w=n((i)=>i.sessions),I=n((i)=>i.connection==="ready"),u=v.filter((i)=>z(w,t.id,i.sessionId)).length,[m,S]=g(!1),[f,x]=g(!1),[h,b]=g(null),N=T(),p=c(t.configOptions,"model"),k=!t.attached?"detached":u>0?"requires_action":t.state==="unknown"?"unknown":t.error?"failed":t.state,y=I&&t.attached&&t.subagent?.capabilities?.cancel!=null&&t.state!=="idle",C=async()=>{x(!0),b(null);try{await d.cancel(t.id)}catch(i){b(i instanceof Error?i.message:String(i))}finally{x(!1)}};return r("section",{"aria-label":t.title??a("subagents.untitled"),className:"min-w-0",children:[r("div",{className:"flex min-w-0 items-center gap-1",children:[r(e,{variant:"ghost",size:"sm",className:"min-w-0 flex-1 justify-start gap-2","aria-expanded":m,"aria-controls":N,onClick:()=>S(!m),children:[m?s(B,{className:"size-3.5 shrink-0"}):s(q,{className:"size-3.5 shrink-0"}),s(E,{className:"text-muted-foreground size-3.5 shrink-0"}),s("span",{className:"truncate",children:t.title??a("subagents.untitled")}),r("span",{className:"text-foreground ms-auto shrink-0 text-xs",role:"status",children:[a(`subagents.${k}`),u>0?` · ${u}`:""]})]}),y&&s(e,{variant:"ghost",size:"icon-sm",disabled:f,"aria-label":a("subagents.cancel",{name:t.title??a("subagents.untitled")}),onClick:()=>{C()},children:f?s(O,{className:"size-3.5 animate-spin"}):s(R,{className:"size-3.5"})})]}),h&&s("p",{role:"alert",className:"text-destructive px-2 py-1 text-xs",children:h}),m&&r("div",{id:N,className:"min-w-0 ps-4",children:[(t.subagent?.description||p)&&r("div",{className:"text-muted-foreground flex min-w-0 items-center gap-2 px-2 py-1 text-xs",children:[s("span",{className:"min-w-0 flex-1 truncate",title:t.subagent?.description??void 0,children:t.subagent?.description}),p&&s("span",{className:"shrink-0",children:M(p)})]}),t.items.length>0?s("div",{className:"flex max-h-72 min-h-0 flex-col",children:s(Ue,{session:t,client:d,host:l})}):s("p",{className:"text-muted-foreground px-2 py-3 text-xs",children:a("subagents.noMessages")}),s(Fe,{sessionId:t.id})]})]})}
|
|
2
|
-
export{Fe};
|
package/dist/chunk-tq6ekz3s.js
DELETED
package/dist/chunk-txn8v2yc.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{ho,be,Kt,vo,xo,yo}from"./chunk-4zzhckab.js";import{forwardRef as ye,useCallback as K,useEffect as ge,useImperativeHandle as ve,useLayoutEffect as w,useMemo as ne,useRef as s,useState as F}from"react";import{jsx as R,jsxs as re}from"react/jsx-runtime";var pe=12,X=2,V=800,he=new Map;function Re({turnKey:q,heightPx:x,placeholder:W=!1,deferUntilReady:n=!1,observe:b,onReady:L,children:z}){let h=s(null),[H,_]=F(!1),U=K((m)=>{h.current=m,b(q,m)},[b,q]);return w(()=>{let m=h.current;if(m===null)throw Error("Codex turn element is missing");let T=()=>{L(m),_(!0)};if(m.querySelector("[data-markdown-pending]")===null){T();return}let d=new MutationObserver(()=>{if(m.querySelector("[data-markdown-pending]")!==null)return;d.disconnect(),T()});return d.observe(m,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-markdown-pending"]}),()=>d.disconnect()},[L]),re("div",{style:H?void 0:{position:"relative",height:x,overflow:"hidden"},children:[R("div",{ref:U,className:"[&_[data-virtualized-turn-content]]:[content-visibility:visible]","data-turn-key":q,"aria-busy":!H||void 0,style:!H&&!W&&n?{visibility:"hidden"}:void 0,"data-turn-ready":H?"":void 0,children:z}),!H&&!W&&n&&R("div",{"aria-hidden":"true",className:"codex-turn-loading",children:re("div",{className:"codex-turn-loading-lines",children:[R("span",{}),R("span",{}),R("span",{})]})})]})}var fo=ye(function({entries:x,renderTurn:W,scrollElement:n,sessionKey:b,leadingContent:L,leadingInsetPx:z=0,preserveViewport:h=!1},H){let _=s(null),[U,m]=F(z),T=L!==void 0&&L!==null;w(()=>{let e=_.current;if(e===null)return;let t=()=>m(e.getBoundingClientRect().height);t();let o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[T]);let d=ne(()=>he.get(b),[b]),[j,J]=F(()=>d?.turnHeightsByKey??{}),i=ne(()=>ho({entries:x,gapPx:pe,measuredHeightsByKey:j,leadingInsetPx:T?U:z}),[x,j,T,U,z]),me=ne(()=>{let e=be({distanceFromBottomPx:d?.distanceFromBottomPx??0,layout:i,overscanCount:X,viewportHeightPx:V}),t=d?.renderedWindow;if(t===void 0||t===null)return e;return Kt({anchorKey:t.anchorKey,layout:i,previousRange:{startIndex:0,endIndex:Math.min(t.count,e.endIndex-e.startIndex)}})??e},[d,i]),[M,ie]=F(me),[y,oe]=F(V),[c,ue]=F(null),N=s(d?.distanceFromBottomPx??0),k=s(M),ae=s(i.turnKeys),l=s(j),S=s(i),se=s(i),P=s(new Map),v=s(null),C=s(null),E=s(null),D=s(new Map),Q=s(!1),ce=s(()=>{}),O=s(null),de=K(()=>{if(!h||n===null||v.current!==null||O.current!==null)return;let e=n.getBoundingClientRect();if(e.height<=0)return;let t=[...P.current].filter(([,r])=>r.hasAttribute("data-turn-ready")).map(([r,u])=>{let a=u.getBoundingClientRect(),g=S.current.turnIndexByKey.get(r),B=g===void 0?a.height:S.current.heightsPx[g];return{key:r,element:u,rect:a,bottom:a.top+B}}).filter(({rect:r,bottom:u})=>u>e.top&&r.top<e.bottom).toSorted((r,u)=>r.rect.top-u.rect.top),o=t.flatMap((r)=>[...r.element.querySelectorAll("[data-user-message-bubble], .codex-markdown-root > *")].filter((u)=>!u.closest('[aria-hidden="true"], [inert]')).map((u)=>({key:r.key,element:u,rect:u.getBoundingClientRect()})).filter(({rect:u})=>u.height>0&&u.top>=e.top&&u.top<e.bottom)).toSorted((r,u)=>r.rect.top-u.rect.top)[0]??t[0];if(o)O.current={key:o.key,element:o.element,top:o.rect.top-e.top,scrollTop:n.scrollTop}},[h,n]),Y=s(de);Y.current=de;let p=K((e,t)=>{let o=Math.min(e,i.totalHeightPx),r=be({distanceFromBottomPx:o,layout:i,overscanCount:X,viewportHeightPx:t}),u=k.current,a=u.startIndex<=r.startIndex&&u.endIndex>=r.endIndex?u:r;if(N.current=o,k.current=a,ae.current=i.turnKeys,oe(t),a!==u)ie(a)},[i]),A=K((e)=>{let t=Math.max(0,e.scrollHeight-i.totalHeightPx);return Math.max(0,e.scrollHeight-e.clientHeight-e.scrollTop-t)},[i.totalHeightPx]),fe=K((e)=>{let t=e.dataset.turnKey;if(t===void 0)throw Error("Codex measured turn is missing its key");let o=Math.max(1,e.getBoundingClientRect().height);if(l.current[t]===o)return;Y.current();let r={...l.current,[t]:o};l.current=r,J(r)},[]),Z=K(()=>{if(C.current!==null)return C.current;return C.current=new ResizeObserver((e)=>{for(let t of e){let o=t.target;if(!("turnReady"in o.dataset)&&o.querySelector("[data-markdown-pending]")!==null)continue;let r=o.dataset.turnKey;if(r===void 0)throw Error("Codex measured turn is missing its key");let u=Math.max(1,t.borderBoxSize[0]?.blockSize??t.contentRect.height);D.current.set(r,u)}if(E.current!==null||D.current.size===0)return;E.current=requestAnimationFrame(()=>{E.current=null;let t=[...D.current].filter(([r,u])=>l.current[r]!==u);if(D.current.clear(),t.length===0)return;Y.current();let o={...l.current,...Object.fromEntries(t)};l.current=o,J(o)})}),C.current},[]),xe=K((e,t)=>{let o=P.current.get(e);if(o!==void 0)Z().unobserve(o),P.current.delete(e);if(t===null)return;if(t.dataset.turnKey!==e)throw Error(`Codex turn key does not match its element: ${e}`);P.current.set(e,t),Z().observe(t)},[Z]);ge(()=>()=>{if(C.current?.disconnect(),E.current!==null)cancelAnimationFrame(E.current);D.current.clear(),C.current=null,P.current.clear()},[]),w(()=>{ce.current=()=>{if(n===null)return;let e=A(n);if(v.current!==null){N.current=e,oe(n.clientHeight||V);return}p(e,n.clientHeight||V)}},[A,n,p]),w(()=>{if(n===null)return;if(!Q.current){Q.current=!0;let o=d?.distanceFromBottomPx??0;n.scrollTo({behavior:"instant",top:Math.max(0,o>0?S.current.totalHeightPx-n.clientHeight-o:n.scrollHeight-n.clientHeight)})}let e=()=>ce.current();e(),n.addEventListener("scroll",e,{passive:!0});let t=new ResizeObserver(e);return t.observe(n),()=>{n.removeEventListener("scroll",e),t.disconnect()}},[d,n]),w(()=>{if(n===null||c===null)return;let e=P.current.get(c.turnKey);if(e?.querySelector("[data-markdown-pending]")!==null)return;let t=e.offsetHeight;if(t<=0)return;if(l.current[c.turnKey]!==t){let g={...l.current,[c.turnKey]:t};l.current=g,J(g);return}let o=c.getTargetElement(e)??e,r=e.getBoundingClientRect(),u=o.getBoundingClientRect(),a=yo({align:c.align,layout:i,targetHeightPx:u.height,targetOffsetPx:u.top-r.top,turnKey:c.turnKey,viewportHeightPx:n.clientHeight});if(a===null)throw Error(`Codex virtual turn is missing: ${c.turnKey}`);n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-a)}),p(a,n.clientHeight||V),queueMicrotask(()=>{if(v.current!==c)return;c.complete(),v.current=null,ue(null)})},[i,c,n,p]),w(()=>{let e=se.current;if(se.current=i,S.current=i,n===null||c!==null){O.current=null;return}let t=O.current;O.current=null;let o=t===null?void 0:n.contains(t.element)?t.element:P.current.get(t.key);if(h&&e!==i&&t!==null&&o!==void 0){let u=o.getBoundingClientRect().top-n.getBoundingClientRect().top,a=n.scrollTop-t.scrollTop;n.scrollTop+=u-t.top+a,p(A(n),n.clientHeight);return}let r=N.current;if(h&&e!==i&&Q.current)r=Math.max(0,e.totalHeightPx-n.clientHeight-n.scrollTop);if((r>24||h)&&e!==i){let u=A(n);if(u<=96&&!h){p(u,y);return}let a=be({distanceFromBottomPx:r,layout:e,overscanCount:0,viewportHeightPx:y}),g=e.turnKeys.slice(a.startIndex,a.endIndex).filter((f)=>i.turnIndexByKey.has(f)),B=g.find((f)=>l.current[f]!==void 0)??g[0];if(B!==void 0){let f=vo({anchorKey:B,distanceFromBottomPx:r,nextLayout:i,previousLayout:e});if(f===null)throw Error(`Codex viewport anchor is missing: ${B}`);r=f,n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-r)})}}p(r,y)},[i,c,A,n,p,y,h]),w(()=>{k.current=M},[M]),ge(()=>()=>{v.current?.complete(),v.current=null;let e=k.current,o=S.current.turnKeys[e.startIndex];he.set(b,{distanceFromBottomPx:N.current,renderedWindow:o===void 0?null:{anchorKey:o,count:e.endIndex-e.startIndex},turnHeightsByKey:l.current})},[b]),ve(H,()=>({scrollToKey(e,t=(r)=>r,o={align:"center"}){v.current?.complete();let r=i.turnIndexByKey.get(e);if(r===void 0)throw Error(`Codex virtual turn is missing: ${e}`);let u=i.turnKeys[r],a=xo({layout:i,turnKey:e,viewportHeightPx:y});if(a===null)throw Error(`Codex virtual turn is missing: ${e}`);let g=be({distanceFromBottomPx:a,layout:i,overscanCount:X,viewportHeightPx:y});return k.current=g,ie(g),new Promise((B)=>{let f={align:o.align,complete:B,getTargetElement:t,turnKey:u};v.current=f,ue(f)})}}),[i,y]);let I=M,G=ae.current;if(!(G===i.turnKeys||G.length===i.turnKeys.length&&G.every((e,t)=>e===i.turnKeys[t]))){let e=G[M.startIndex];I=(e===void 0?null:Kt({anchorKey:e,layout:i,previousRange:M}))??be({distanceFromBottomPx:N.current,layout:i,overscanCount:X,viewportHeightPx:y})}let ee=x.length-1,le=x[ee],te=x.slice(I.startIndex,Math.min(I.endIndex,ee)).map((e,t)=>({entry:e,index:I.startIndex+t}));if(le!==void 0)te.push({entry:le,index:ee});return re("div",{"data-codex-timeline":!0,"data-codex-virtualized-pending-key":c?.turnKey,"data-codex-virtualized-range":`${I.startIndex}:${I.endIndex}`,"data-codex-virtualized-total-count":x.length,"data-codex-virtualized-turn-count":te.length,className:"relative shrink-0",style:{height:i.totalHeightPx},children:[T&&R("div",{ref:_,"data-codex-timeline-leading":!0,className:"absolute inset-x-0 top-0",children:L}),te.map(({entry:e,index:t})=>R("div",{className:"absolute inset-x-0",style:{top:i.topOffsetsPx[t]??0},children:R(Re,{turnKey:e.turnKey,heightPx:i.heightsPx[t],placeholder:e.placeholder,deferUntilReady:e.deferUntilReady,observe:xe,onReady:fe,children:W(e,t)})},e.turnKey))]})});
|
|
2
|
-
export{fo};
|
package/dist/chunk-vp8fb7r8.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{s}from"./chunk-96x0d2vd.js";import{j}from"./chunk-1fm5vx1n.js";import{g}from"./chunk-da4m33bg.js";import{Xe}from"./chunk-ykp85wc1.js";import{_}from"./chunk-2pj3pcc7.js";import{Je,et}from"./chunk-8g09jrj1.js";import{formatDistanceToNowStrict as H}from"date-fns";import{enUS as L,zhCN as z}from"date-fns/locale";import{ClockIcon as E,MessageSquareIcon as A}from"lucide-react";import{useEffect as S,useState as D}from"react";import{jsx as o,jsxs as C,Fragment as w}from"react/jsx-runtime";var h={en:L,"zh-CN":z};function Ce(t,a){let r=a==="zh-CN"?h["zh-CN"]:h.en;return H(new Date(t),{locale:r})}function Qe({sessionRow:t,actions:a,shortcut:r,renaming:n=!1,onRename:m}){let{t:i,i18n:y,PathAction:u}=g(),f=et(),I=Je();S(()=>{f(n)},[n,f]);let[x,p]=D(t.title??"");S(()=>{if(n)p(t.title??"")},[n,t.title]);let d=(e)=>{let c=e.trim();m?.(c!==""&&c!==t.title?c:null)},N=t.archived?i("sessionList.archived"):t.updatedAt!==null?Ce(t.updatedAt,y.language):null,v=[];if(N!==null)v.push({icon:o(E,{className:"size-3.5"}),text:N});let l=u&&o(u,{cwd:t.cwd,onOpened:I});return o(Xe,{title:n?o(s,{autoFocus:!0,value:x,className:"h-7 text-sm","aria-label":i("sessionList.rename"),onChange:(e)=>p(e.target.value),onKeyDown:(e)=>{if(e.stopPropagation(),e.key==="Enter")d(e.target.value);if(e.key==="Escape")m?.(null)},onBlur:(e)=>d(e.target.value)}):C("span",{className:"flex items-center gap-2",children:[o("span",{className:"min-w-0",children:o(_,{className:"min-w-0 flex-1",children:t.title??i("sessionList.untitled")})}),r]}),titleIcon:o(A,{className:"size-3.5"}),details:v,actions:l||a!==void 0?C(w,{children:[l,l&&a!==void 0&&o(j,{}),a]}):void 0})}
|
|
2
|
-
export{Ce,Qe};
|
package/dist/chunk-w1awbykg.js
DELETED
package/dist/chunk-wpdn3rx8.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Button as n}from"@base-ui/react/button";import{cva as d}from"class-variance-authority";import{cn as o}from"cn";import{jsx as s}from"react/jsx-runtime";var jr=d("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5",lg:"h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",icon:"size-9","icon-xs":"size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function e({className:r,variant:t="default",size:i="default",...a}){return s(n,{"data-slot":"button",className:o(jr({variant:t,size:i,className:r})),...a})}export{jr,e};
|
package/dist/chunk-x1xh8y2s.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n}from"./chunk-q6km9nha.js";import{V,Dt,W}from"./chunk-jdjk6tf4.js";import{e}from"./chunk-wpdn3rx8.js";import{he,ve,xe,ye}from"./chunk-d5ga13n0.js";import{yt,o,C}from"./chunk-0ss92kxr.js";import{st}from"./chunk-8v1bjdgv.js";import{vt}from"./chunk-3dckftt6.js";import{rt,it}from"./chunk-xfx689xm.js";import{at}from"./chunk-180zvfd6.js";import{LockIcon as g,UnplugIcon as A}from"lucide-react";import{useMemo as R}from"react";import{jsx as r,jsxs as i}from"react/jsx-runtime";function hr({host:t,client:l,...c}){let s=R(()=>t.openDiff?t:{...t,openDiff:rt},[t]);return i(yt,{host:s,client:l,children:[r(E,{...c}),!t.openDiff&&r(it,{})]})}function E({session:t,header:l,overlay:c,timeline:s,composer:y,readOnlyActions:x,welcome:u,children:N,rootRef:w}){let{host:d,client:h}=o(),{t:a}=d,p=n((m)=>m.connection==="ready"),f=n((m)=>m.historyPages[t.id]?.error),v=()=>C(d,h.open(t.id,t.cwd)),D=t.items.length===0&&t.attached&&!t.restoring&&t.state==="idle";return i("div",{"data-chat-drop-zone":!0,ref:w,className:"flex h-full min-h-0 flex-col",children:[l,i("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[c,p&&!t.attached&&!t.restoring&&!t.readOnly&&r("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:i(V,{children:[r(A,{}),r(Dt,{children:a("conversation.stopped")}),r(W,{children:r(e,{size:"sm",variant:"outline",onClick:v,children:a("conversation.reconnect")})})]})}),D?u??r(he,{className:"flex-1",children:i(ve,{children:[r(xe,{className:"text-[28px] font-normal",children:a("conversation.welcomeTitle")}),r(ye,{children:a("conversation.welcomeDescription")})]})}):r(vt,{session:t,timeline:s}),r(at,{sessionId:t.id}),t.readOnly?r("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:i(V,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[i("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[r(g,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("div",{className:"min-w-0 space-y-1",children:[r(Dt,{children:a("conversation.readOnlyTitle")}),r(W,{children:a("conversation.readOnlyDescription")}),f&&r("p",{role:"alert",className:"text-destructive break-words",children:f})]})]}),i("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[r(e,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:v,disabled:!p||t.restoring,children:a(t.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),x]})]})}):y??r(st,{session:t})]}),N]})}
|
|
2
|
-
export{hr};
|
package/dist/chunk-x8kxqtva.js
DELETED
package/dist/chunk-xfx689xm.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{po,Be}from"./chunk-yh9qdb2k.js";import{t,ke}from"./chunk-q6km9nha.js";import{u,m,b,p,w}from"./chunk-n5xqjct2.js";import{createStore as d}from"@alwith/api/client";import{jsx as i,jsxs as l}from"react/jsx-runtime";var c=d({request:null});function rt(e){c.setState({request:{path:e.path,patch:wn(e.patch,e.path)}})}function wn(e,a){let n=e.split(/^(?=diff --git )/m).filter((o)=>o.length>0);if(n.length<=1)return e;return n.find((o)=>{let r=o.split(`
|
|
2
|
-
`,1)[0]??"";return r.endsWith(` b/${a}`)||r.endsWith(` ${a}`)||r.includes(`/${a} `)})??e}function it(){let{t:e,theme:a}=t(),n=ke(c,(o)=>o.request),s=n===null?null:po(n.patch);return i(u,{open:n!==null,onOpenChange:(o)=>!o&&c.setState({request:null}),children:l(m,{className:"flex h-[calc(100vh-2.5rem)] max-h-[900px] flex-col gap-3 sm:max-w-[min(1400px,calc(100vw-2.5rem))]",children:[l(b,{children:[i(p,{className:"truncate pe-8 font-mono text-sm font-normal",children:n?.path}),s!==null&&l(w,{children:[l("span",{className:"codex-diff-additions",children:["+",s.additions]})," ",l("span",{className:"codex-diff-deletions",children:["-",s.deletions]})," ",i("span",{children:e("conversation.changedLines")})]})]}),i("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden rounded-lg border [&>.codex-patch-view]:h-full","data-stream-style":"codexUI",children:n!==null&&i(Be,{patch:n.patch,theme:a})})]})})}
|
|
3
|
-
export{rt,wn,it};
|
package/dist/chunk-y6afvrnv.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e}from"./chunk-wpdn3rx8.js";import{t,Ge}from"./chunk-q6km9nha.js";import{isEmbeddedResource as E,isImage as h,isResourceLink as T}from"@nyssance/codex-acp-v2/client";import{DownloadIcon as L,FileIcon as N,ImageOffIcon as F,LoaderCircleIcon as U}from"lucide-react";import{useState as y}from"react";import{jsx as i,jsxs as r}from"react/jsx-runtime";function Cr(a){let o=a.split(/[\\/]/).at(-1)??a;if(a.startsWith("file:")||/^https?:/.test(a))o=new URL(a).pathname.split("/").at(-1)??"";try{return decodeURIComponent(o)||"attachment"}catch(n){if(n instanceof URIError)return o||"attachment";throw n}}function b(a,o){let n=document.createElement("a");n.href=o,n.download=a,n.click()}function B({block:a,generated:o=!1}){let n=t(),[p,d]=y(!1),[I,C]=y(null);if(T(a)){if(a.uri==="codex-image:unavailable")return r("span",{className:"text-muted-foreground flex items-center gap-2 rounded-lg border p-3 text-sm",children:[i(F,{className:"size-4"}),n.t("timeline.imageUnavailable")]});let u=Cr(a.uri);return r(e,{variant:"outline",className:"h-auto max-w-full min-w-0 justify-start gap-3 overflow-hidden p-3","aria-label":a.title??a.name,title:a.uri,onClick:()=>n.openLink(a.uri),children:[i(N,{}),r("span",{className:"min-w-0 flex-1 text-start",children:[i("span",{className:"block truncate",children:a.title??a.name}),r("span",{className:"text-muted-foreground block truncate text-xs",children:[(a.title??a.name)!==u&&`${u} · `,a.mimeType??u.split(".").at(-1)?.toUpperCase()]})]})]})}if(!E(a)&&!h(a))return null;let s=h(a)?{uri:a.uri??`image.${a.mimeType.split("/")[1]??"png"}`,mimeType:a.mimeType,blob:a.data}:a.resource,l=Cr(s.uri);if("text"in s)return r("div",{className:"min-w-0",children:[i("pre",{className:"overflow-x-auto whitespace-pre-wrap",children:s.text}),r(e,{variant:"link",size:"sm",className:"max-w-full min-w-0",title:s.uri,onClick:()=>n.openLink(s.uri),children:[i(N,{}),i("span",{className:"truncate",children:l})]})]});let m=`data:${s.mimeType??"application/octet-stream"};base64,${s.blob}`,f=s.mimeType?.toLowerCase().startsWith("image/")&&I!==m,{openImage:g,openImageGallery:w}=n,x=w?()=>w([{src:m,alt:l,uri:s.uri}],0):g&&(()=>g(m)),c=o&&f,R=async()=>{d(!0);try{if(n.saveFile)await n.saveFile(l,s.blob);else b(l,m)}catch(u){Ge(n,u)}finally{d(!1)}},v=i("img",{src:m,alt:"",className:o?"max-h-[40rem] max-w-full object-contain":"max-h-96 max-w-full rounded object-contain",onError:()=>C(m)});return r("div",{className:c?"codex-generated-image":"flex max-w-full min-w-0 flex-col items-start gap-1",children:[f&&(x===void 0?v:i(e,{variant:"ghost",className:o?"codex-generated-image-preview h-auto max-w-full p-0":"h-auto max-w-full p-0","aria-label":n.t("timeline.viewImage"),onClick:x,children:v})),r(e,{variant:c?"secondary":"link",size:c?"icon":"sm",className:c?"codex-generated-image-download":"max-w-full min-w-0",disabled:p,title:n.t("timeline.download",{name:l}),"aria-label":n.t("timeline.download",{name:l}),onClick:()=>{R()},children:[p?i(U,{className:"motion-safe:animate-spin"}):i(L,{}),!c&&i("span",{className:"truncate",children:l})]})]})}
|
|
2
|
-
export{Cr,B};
|