@alwith/module-chat 0.5.22 → 0.5.23
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.d.ts +1 -1
- package/dist/approval/schema-elicitation-form.js +1 -1
- package/dist/approval/url-elicitation-card.js +1 -1
- package/dist/{chunk-1tkzxktd.js → chunk-0mmcy6k7.js} +2 -2
- package/dist/chunk-0p6y2t9b.js +2 -0
- package/dist/{chunk-xgjkj9j8.js → chunk-0wa9yjg3.js} +2 -2
- package/dist/{chunk-dya74vts.js → chunk-0whxm2f0.js} +2 -2
- package/dist/{chunk-s55n9cby.js → chunk-1fggcrvs.js} +2 -2
- package/dist/{chunk-r9dt4bs3.js → chunk-1k21j77z.js} +2 -2
- package/dist/chunk-1k697ncv.js +2 -0
- package/dist/chunk-1mn2t6ga.js +2 -0
- package/dist/{chunk-2tce3pc5.js → chunk-1qyxrh0n.js} +3 -3
- package/dist/{chunk-2f1qx13s.js → chunk-1rg3nab3.js} +2 -2
- package/dist/{chunk-63kxepkh.js → chunk-2388yq9z.js} +2 -2
- package/dist/{chunk-2tkeevm0.js → chunk-28f3zv6v.js} +2 -2
- package/dist/{chunk-1ppfn0e1.js → chunk-2f9vjmxz.js} +2 -2
- package/dist/{chunk-8hte6dh7.js → chunk-36m8zstj.js} +2 -2
- package/dist/chunk-3bzqcxq2.js +2 -0
- package/dist/{chunk-9sq2etjk.js → chunk-3e6wcamp.js} +2 -2
- package/dist/{chunk-8t36vprh.js → chunk-3ka3bt0t.js} +2 -2
- package/dist/{chunk-xmstt6hh.js → chunk-3s94ekrs.js} +2 -2
- package/dist/{chunk-23rjsm3a.js → chunk-3yxjh7b1.js} +2 -2
- package/dist/{chunk-8jxcdap5.js → chunk-42atrgm1.js} +2 -2
- package/dist/{chunk-mg2mkzkk.js → chunk-48fj5m0p.js} +2 -2
- package/dist/{chunk-1e6x0018.js → chunk-4bb6dzzs.js} +2 -2
- package/dist/{chunk-dv65h7z5.js → chunk-4ddkzbm0.js} +2 -2
- package/dist/chunk-4fk0vjh5.js +2 -0
- package/dist/{chunk-n0khj68q.js → chunk-4gyd9hx9.js} +2 -2
- package/dist/{chunk-n3xhh6ch.js → chunk-4jfynrgh.js} +2 -2
- package/dist/chunk-4p6svs37.js +2 -0
- package/dist/chunk-4wa7tehh.js +3 -0
- package/dist/{chunk-m2b8kzpk.js → chunk-5a6xc345.js} +2 -2
- package/dist/chunk-5ap6fvrp.js +2 -0
- package/dist/chunk-6179zrn1.js +3 -0
- package/dist/chunk-658njfx1.js +4 -0
- package/dist/{chunk-nxp1b8ny.js → chunk-667z0pac.js} +2 -2
- package/dist/chunk-6cmttr4w.js +1 -0
- package/dist/{chunk-3jcmv5qf.js → chunk-6t5war9h.js} +2 -2
- package/dist/chunk-6trv0snh.js +2 -0
- package/dist/{chunk-jm6zja6h.js → chunk-76a04a6j.js} +2 -2
- package/dist/{chunk-k7k6qsqh.js → chunk-7z4gtfkd.js} +2 -2
- package/dist/{chunk-nq7gg9vg.js → chunk-855w49k0.js} +2 -2
- package/dist/chunk-8c8ncw1m.js +2 -0
- package/dist/{chunk-0fs2k5fe.js → chunk-95mynf7q.js} +2 -2
- package/dist/chunk-9tp0z23q.js +2 -0
- package/dist/{chunk-v4t0p6pp.js → chunk-9wasxr1v.js} +2 -2
- package/dist/{chunk-0gy6ngda.js → chunk-a42211a1.js} +2 -2
- package/dist/{chunk-77j8n5k5.js → chunk-a63k8tht.js} +2 -2
- package/dist/{chunk-ap0vmczf.js → chunk-acb8t4jt.js} +2 -2
- package/dist/{chunk-2nvsvw67.js → chunk-agqnt7xq.js} +2 -2
- package/dist/chunk-ah4pgmqr.js +2 -0
- package/dist/{chunk-vyk4zh1m.js → chunk-asyfpv8n.js} +7 -7
- package/dist/chunk-awmra30d.js +2 -0
- package/dist/{chunk-aza82m2p.js → chunk-azfmr99x.js} +2 -2
- package/dist/{chunk-0vhkv9ax.js → chunk-b12v22de.js} +2 -2
- package/dist/chunk-bbnhytn3.js +2 -0
- package/dist/{chunk-mcjwwxa1.js → chunk-bfhfbrzt.js} +2 -2
- package/dist/{chunk-w9dh298r.js → chunk-bg03czcx.js} +2 -2
- package/dist/chunk-bmey8et5.js +2 -0
- package/dist/{chunk-67hrx4kg.js → chunk-bvgqsaey.js} +2 -2
- package/dist/chunk-c32z3wjq.js +2 -0
- package/dist/{chunk-33620ca6.js → chunk-c723sswh.js} +2 -2
- package/dist/{chunk-x6nz6eyb.js → chunk-ce1qr37c.js} +2 -2
- package/dist/chunk-cgk9mtky.js +2 -0
- package/dist/{chunk-1q2cykp4.js → chunk-ckyat78p.js} +2 -2
- package/dist/chunk-cvz3k5gk.js +2 -0
- package/dist/{chunk-aqvy57zs.js → chunk-cw76pj9b.js} +2 -2
- package/dist/{chunk-b2wczqtd.js → chunk-cz4k8aad.js} +2 -2
- package/dist/{chunk-xyvqcpjx.js → chunk-d257n8gj.js} +2 -2
- package/dist/{chunk-sy5tq3y6.js → chunk-d8ytdk0x.js} +2 -2
- package/dist/{chunk-m7wn4z9x.js → chunk-drhzcs6e.js} +2 -2
- package/dist/{chunk-nqw4deag.js → chunk-dte0n4kf.js} +2 -2
- package/dist/{chunk-4s6gx750.js → chunk-e3pfvwhd.js} +2 -2
- package/dist/chunk-e5qk8b1f.js +2 -0
- package/dist/{chunk-dyqvhn6y.js → chunk-eg9hemqa.js} +5 -5
- package/dist/chunk-f1gj3yzt.js +2 -0
- package/dist/{chunk-0gersbj0.js → chunk-f1x483c9.js} +2 -2
- package/dist/chunk-f2rq6nj6.js +3 -0
- package/dist/{chunk-dyrgfdxz.js → chunk-f2w2sct6.js} +2 -2
- package/dist/{chunk-mgm1x3de.js → chunk-f5gsffbv.js} +2 -2
- package/dist/chunk-fh3pjhe6.js +2 -0
- package/dist/{chunk-vcy5vyp7.js → chunk-fnpf84rf.js} +2 -2
- package/dist/{chunk-3aq5c12k.js → chunk-g2qcyqc6.js} +2 -2
- package/dist/{chunk-hv1ejvhg.js → chunk-g44hhdha.js} +2 -2
- package/dist/chunk-g8w3emvn.js +2 -0
- package/dist/{chunk-xrs7x5ah.js → chunk-g9t2d8hg.js} +2 -2
- package/dist/{chunk-z2v008kc.js → chunk-gha517v4.js} +2 -2
- package/dist/{chunk-fke98cj0.js → chunk-gsfgdnfp.js} +2 -2
- package/dist/{chunk-memvzzc6.js → chunk-hac9xtfv.js} +2 -2
- package/dist/{chunk-8w22ck92.js → chunk-heyqzkxq.js} +2 -2
- package/dist/{chunk-k5rkpqbh.js → chunk-jgd6dcgy.js} +2 -2
- package/dist/chunk-jmb8r6aj.js +2 -0
- package/dist/{chunk-42nhwnbe.js → chunk-jwt7q6yx.js} +4 -4
- package/dist/{chunk-983gkw32.js → chunk-jxntqarp.js} +2 -2
- package/dist/chunk-k2k5tt5x.js +2 -0
- package/dist/{chunk-6dn3j8a2.js → chunk-k7ye738q.js} +2 -2
- package/dist/{chunk-72x7rae0.js → chunk-kc56dhwd.js} +2 -2
- package/dist/chunk-kfy7yvke.js +2 -0
- package/dist/{chunk-j86x2rn0.js → chunk-kg5hcf28.js} +2 -2
- package/dist/{chunk-42hkbpey.js → chunk-kmdag4vy.js} +2 -2
- package/dist/{chunk-n929wkw7.js → chunk-kz1kjzmq.js} +2 -2
- package/dist/{chunk-qwfwxfhn.js → chunk-m271yxxm.js} +2 -2
- package/dist/chunk-m8hb96f5.js +2 -0
- package/dist/{chunk-zxkvvecz.js → chunk-mj7094yh.js} +2 -2
- package/dist/{chunk-nn25kjm4.js → chunk-mvs2dzyt.js} +2 -2
- package/dist/{chunk-xktybk48.js → chunk-mxfvakya.js} +2 -2
- package/dist/chunk-mz8a6292.js +2 -0
- package/dist/chunk-mztwft71.js +2 -0
- package/dist/chunk-n0acc2tb.js +2 -0
- package/dist/{chunk-p4bb313p.js → chunk-n45a05jx.js} +3 -3
- package/dist/{chunk-e9ntencj.js → chunk-n5v1h0sk.js} +2 -2
- package/dist/{chunk-1f628zap.js → chunk-n66yy1m1.js} +2 -2
- package/dist/{chunk-0mp7tyea.js → chunk-nn2hmwzd.js} +2 -2
- package/dist/{chunk-a8p82wp7.js → chunk-nsf0e6gj.js} +2 -2
- package/dist/chunk-nv6s8x9f.js +2 -0
- package/dist/{chunk-82xjggwn.js → chunk-p7dd93e5.js} +2 -2
- package/dist/chunk-p8g927x6.js +2 -0
- package/dist/chunk-pk2rvqd0.js +2 -0
- package/dist/{chunk-7wk3d01c.js → chunk-pprt7ntb.js} +4 -4
- package/dist/{chunk-rcbb4ke2.js → chunk-pqa37epj.js} +2 -2
- package/dist/{chunk-t97yjy4f.js → chunk-pw8b9brz.js} +2 -2
- package/dist/{chunk-ns5rnxdj.js → chunk-pwjz3yxb.js} +2 -2
- package/dist/{chunk-z71pp1mb.js → chunk-pzjag1mt.js} +3 -3
- package/dist/chunk-pzyradqt.js +2 -0
- package/dist/chunk-q9zawfn1.js +2 -0
- package/dist/{chunk-141kppzb.js → chunk-qd1z91fm.js} +1 -1
- package/dist/{chunk-k5wgf59a.js → chunk-qdg5zphd.js} +2 -2
- package/dist/chunk-qn6ppn0r.js +2 -0
- package/dist/{chunk-8ch9444t.js → chunk-qwfw4xpn.js} +2 -2
- package/dist/chunk-r5z08bp6.js +2 -0
- package/dist/{chunk-mwpchd85.js → chunk-raye7hnk.js} +3 -3
- package/dist/{chunk-x2yc5748.js → chunk-rbv1scqm.js} +2 -2
- package/dist/{chunk-156m3888.js → chunk-rjkpe1fw.js} +3 -3
- package/dist/{chunk-xf36kt74.js → chunk-rjw63t34.js} +3 -3
- package/dist/chunk-rq5e0922.js +2 -0
- package/dist/{chunk-x334e7wb.js → chunk-sjs9484n.js} +3 -3
- package/dist/{chunk-b614gnnv.js → chunk-swpy2b9a.js} +2 -2
- package/dist/chunk-sz3vcbp5.js +2 -0
- package/dist/{chunk-c38t8809.js → chunk-t6vcdf4j.js} +2 -2
- package/dist/{chunk-7p1r1ha9.js → chunk-t7drk9ja.js} +2 -2
- package/dist/{chunk-5cdr7q6f.js → chunk-t9f2cw75.js} +3 -3
- package/dist/chunk-tpbqg729.js +2 -0
- package/dist/chunk-ttn8ss6b.js +2 -0
- package/dist/{chunk-w6rwngm3.js → chunk-tv0fwt2g.js} +2 -2
- package/dist/{chunk-vs02ry2r.js → chunk-tz1kzpzp.js} +2 -2
- package/dist/{chunk-8c042xya.js → chunk-vbab9hc4.js} +2 -2
- package/dist/{chunk-w0hpztj7.js → chunk-vfhxerxt.js} +2 -2
- package/dist/chunk-vnsgjnp3.js +2 -0
- package/dist/{chunk-59957gfy.js → chunk-vt6cyes7.js} +2 -2
- package/dist/chunk-vvtbtx09.js +2 -0
- package/dist/{chunk-z2fjwkmt.js → chunk-wccx911q.js} +2 -2
- package/dist/{chunk-g73f62qm.js → chunk-wgrmjfyp.js} +2 -2
- package/dist/chunk-wm0jty6e.js +2 -0
- package/dist/{chunk-h5m2fpp4.js → chunk-wvry7t79.js} +2 -2
- package/dist/{chunk-00eytt1z.js → chunk-y0q6jwq4.js} +2 -2
- package/dist/chunk-y97ne5kj.js +2 -0
- package/dist/{chunk-cbwya2ss.js → chunk-yakar0e2.js} +2 -2
- package/dist/{chunk-3yvd77ph.js → chunk-yg3xhn5m.js} +2 -2
- package/dist/{chunk-et8rcxw6.js → chunk-z3nybrbb.js} +2 -2
- package/dist/chunk-zheyzqcq.js +2 -0
- package/dist/codex/activity-group.js +1 -1
- package/dist/codex/assistant-message.js +1 -1
- package/dist/codex/async-question-card.js +1 -1
- package/dist/codex/disclosure-state.js +1 -1
- package/dist/codex/edited-files-card.js +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.js +1 -1
- package/dist/codex/navigation-audio.js +1 -1
- package/dist/codex/navigation-preview.js +1 -1
- package/dist/codex/navigation-rail.js +1 -1
- package/dist/codex/patch-view.js +1 -1
- package/dist/codex/plan.js +1 -1
- package/dist/codex/timeline-virtualizer.js +1 -1
- package/dist/codex/turn-activity.js +1 -1
- package/dist/codex/user-message.js +1 -1
- package/dist/codex/virtualized-turn-list.js +1 -1
- package/dist/collections/collection-emoji.js +1 -1
- package/dist/collections/collection-menu.js +1 -1
- package/dist/collections/collection-panel.js +1 -1
- package/dist/collections/collections.js +1 -1
- package/dist/collections/host.js +1 -1
- package/dist/collections/locales.js +1 -1
- package/dist/collections/model.js +1 -1
- package/dist/collections/store.js +1 -1
- package/dist/composer/completion-filter.js +1 -1
- package/dist/composer/completion-menu.js +1 -1
- package/dist/composer/completion-trigger.js +1 -1
- package/dist/composer/effort-slider.js +1 -1
- package/dist/composer/menu-radio.js +1 -1
- package/dist/composer/model-select.js +1 -1
- package/dist/composer/permission-mode-select.js +1 -1
- package/dist/composer/prompt-input-attachments.js +1 -1
- package/dist/composer/prompt-input-clipboard.js +1 -1
- package/dist/composer/prompt-input-context.js +1 -1
- package/dist/composer/prompt-input-textarea.js +1 -1
- package/dist/composer/prompt-input.js +1 -1
- package/dist/conversation/action-card.js +1 -1
- package/dist/conversation/composer/composer.js +1 -1
- package/dist/conversation/composer/config-options.js +1 -1
- package/dist/conversation/composer/context.js +1 -1
- package/dist/conversation/composer/drafts.js +1 -1
- package/dist/conversation/composer/file-items.js +1 -1
- package/dist/conversation/composer/long-text.js +1 -1
- package/dist/conversation/composer/mention-chips.js +1 -1
- package/dist/conversation/composer/mention-uri.js +1 -1
- package/dist/conversation/composer/model-menu.js +1 -1
- package/dist/conversation/composer/pasted-text-attachment.js +1 -1
- package/dist/conversation/composer/permission-mode-menu.js +1 -1
- package/dist/conversation/composer/prediction.js +1 -1
- package/dist/conversation/composer/slash-command-button.js +1 -1
- package/dist/conversation/composer/submit-button.js +1 -1
- package/dist/conversation/composer/usage-meter.js +1 -1
- package/dist/conversation/connection-notice.js +1 -1
- package/dist/conversation/context.js +1 -1
- package/dist/conversation/conversation-body.js +1 -1
- package/dist/conversation/conversation-search.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/draft-project-picker.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/plugins/catalog-header.js +1 -1
- package/dist/plugins/catalog-skeleton.js +1 -1
- package/dist/plugins/host.js +1 -1
- package/dist/plugins/new-chat-directory.js +1 -1
- package/dist/plugins/pane.js +1 -1
- package/dist/plugins/panel-item.js +1 -1
- package/dist/plugins/plugin-detail-page.js +1 -1
- package/dist/plugins/plugin-icon.js +1 -1
- package/dist/plugins/plugin-icons.js +1 -1
- package/dist/plugins/plugins-page.js +1 -1
- package/dist/plugins/plugins.js +1 -1
- package/dist/plugins/read-skill-document.js +1 -1
- package/dist/plugins/skill-document.js +1 -1
- package/dist/plugins/skills-tab.js +1 -1
- package/dist/plugins/store.js +1 -1
- package/dist/plugins/toolbox-layout.js +1 -1
- package/dist/search/chat-search.js +1 -1
- package/dist/search/codex-source-matches.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/account-menu.js +1 -1
- package/dist/session-list/activity-list.js +1 -1
- package/dist/session-list/archived-sessions.js +1 -1
- package/dist/session-list/help-menu.js +1 -1
- package/dist/session-list/highlight.js +1 -1
- package/dist/session-list/host.js +1 -1
- package/dist/session-list/hover-info-card.js +1 -1
- package/dist/session-list/navigation-header.js +1 -1
- package/dist/session-list/navigation-store.js +1 -1
- package/dist/session-list/navigation-tabs.js +1 -1
- package/dist/session-list/navigation.js +1 -1
- package/dist/session-list/overflow-marquee.js +1 -1
- package/dist/session-list/platform.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/shortcut-hint.js +1 -1
- package/dist/session-list/shortcut.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-notification.js +1 -1
- package/dist/session-list/use-activity-preview.js +1 -1
- package/dist/session-list/use-cmd-held.js +1 -1
- package/dist/session-list/use-project-sessions.js +1 -1
- package/dist/session-list/virtual-session-rows.js +1 -1
- package/dist/session-timeline/activity-group.js +1 -1
- package/dist/session-timeline/activity-projection.js +1 -1
- package/dist/session-timeline/assistant-content.js +1 -1
- package/dist/session-timeline/assistant-turn.js +1 -1
- package/dist/session-timeline/async-questions.js +1 -1
- package/dist/session-timeline/edited-files-card.js +1 -1
- package/dist/session-timeline/history-timeline.js +1 -1
- package/dist/session-timeline/host.js +1 -1
- package/dist/session-timeline/navigation-rail.js +1 -1
- package/dist/session-timeline/plan.js +1 -1
- package/dist/session-timeline/question-reply.js +1 -1
- package/dist/session-timeline/resource-content.js +1 -1
- package/dist/session-timeline/session-timeline.js +1 -1
- package/dist/session-timeline/timeline-registry.js +1 -1
- package/dist/session-timeline/turn-activity.js +1 -1
- package/dist/session-timeline/turn-error.js +1 -1
- package/dist/session-timeline/turn-retry.js +1 -1
- package/dist/session-timeline/turn-time.js +1 -1
- package/dist/session-timeline/turns.js +1 -1
- package/dist/session-timeline/use-timeline-scroll.js +1 -1
- package/dist/session-timeline/user-message.js +1 -1
- package/dist/settings/codex-account-card.js +1 -1
- package/dist/settings/login-card.js +1 -1
- package/dist/settings/model-alias-settings.js +1 -1
- package/dist/settings/model-aliases.js +1 -1
- package/dist/settings/provider-logos.js +1 -1
- package/dist/settings/provider-section.js +1 -1
- package/dist/settings/providers-port.d.ts +3 -3
- package/dist/settings/providers-port.js +1 -1
- package/dist/settings/providers.js +1 -1
- package/dist/settings/settings-bridge.d.ts +3 -3
- package/dist/settings/settings-bridge.js +1 -1
- package/dist/settings/settings.js +1 -1
- package/package.json +3 -3
- package/rust/Cargo.lock +484 -10
- package/rust/Cargo.toml +16 -1
- package/rust/src/__tests__/native_network.rs +406 -0
- package/rust/src/lib.rs +3 -0
- package/rust/src/native_network.rs +302 -0
- package/rust/src/native_network_diagnostics.rs +220 -0
- package/rust/src/providers/tests.rs +4 -1
- package/rust/src/system_proxy.rs +257 -0
- package/dist/chunk-14exd146.js +0 -2
- package/dist/chunk-2ce8gd89.js +0 -2
- package/dist/chunk-3n47hknp.js +0 -2
- package/dist/chunk-40bcp4pa.js +0 -2
- package/dist/chunk-52p7kyam.js +0 -2
- package/dist/chunk-59exzf5n.js +0 -2
- package/dist/chunk-5nc3dtyt.js +0 -2
- package/dist/chunk-78s6h7r4.js +0 -2
- package/dist/chunk-80ckz04b.js +0 -2
- package/dist/chunk-85ffkcch.js +0 -2
- package/dist/chunk-8qw8erv6.js +0 -2
- package/dist/chunk-908ndb9r.js +0 -2
- package/dist/chunk-9g67z1b4.js +0 -2
- package/dist/chunk-9n79tr1q.js +0 -2
- package/dist/chunk-ajpxjj5m.js +0 -2
- package/dist/chunk-b3jg6nzv.js +0 -3
- package/dist/chunk-c1b8z8pa.js +0 -2
- package/dist/chunk-c9nbavk0.js +0 -2
- package/dist/chunk-cg8ekwka.js +0 -2
- package/dist/chunk-ec9rgnt3.js +0 -2
- package/dist/chunk-efrn25h9.js +0 -2
- package/dist/chunk-emcefs0g.js +0 -2
- package/dist/chunk-f28hhbf4.js +0 -2
- package/dist/chunk-f3924gdb.js +0 -2
- package/dist/chunk-f8zy35gz.js +0 -2
- package/dist/chunk-f98at4r5.js +0 -2
- package/dist/chunk-g242n3dt.js +0 -2
- package/dist/chunk-h1bhhqtq.js +0 -2
- package/dist/chunk-kc5k5e59.js +0 -3
- package/dist/chunk-kvc6ewkt.js +0 -4
- package/dist/chunk-kxmajv0m.js +0 -3
- package/dist/chunk-myrdfa3s.js +0 -2
- package/dist/chunk-nacjea1s.js +0 -2
- package/dist/chunk-py837qjk.js +0 -1
- package/dist/chunk-q7nn5xe5.js +0 -2
- package/dist/chunk-qjhkzdhm.js +0 -2
- package/dist/chunk-qxcnyvps.js +0 -2
- package/dist/chunk-r3qrftds.js +0 -2
- package/dist/chunk-r8rre2zb.js +0 -2
- package/dist/chunk-rbqn4725.js +0 -2
- package/dist/chunk-rekc1q3m.js +0 -2
- package/dist/chunk-rwkkqdcv.js +0 -2
- package/dist/chunk-rwnz06kr.js +0 -2
- package/dist/chunk-sxh0pd3y.js +0 -2
- package/dist/chunk-t0cr21e3.js +0 -2
- package/dist/chunk-vkrgdqnm.js +0 -2
- package/dist/chunk-wvdncbrt.js +0 -2
- package/dist/chunk-y7xcync7.js +0 -2
- package/dist/chunk-ye9tsdhn.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{l,i}from"./chunk-4p6svs37.js";import{f}from"./chunk-1k21j77z.js";import{I}from"./chunk-wvry7t79.js";import{le}from"./chunk-bfhfbrzt.js";import{E,ae,se}from"./chunk-tv0fwt2g.js";import{ExternalLinkIcon as W,PlusIcon as _}from"lucide-react";import{useEffect as q,useState as y}from"react";import{Badge as O}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as v}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as F,DialogContent as G,DialogDescription as J,DialogHeader as K,DialogTitle as Q}from"@nyssance/shadcn/vega/components/ui/dialog";import{Spinner as S}from"@nyssance/shadcn/vega/components/ui/spinner";import{Switch as X}from"@nyssance/shadcn/vega/components/ui/switch";import{jsx as e,jsxs as n,Fragment as T}from"react/jsx-runtime";function lt({entry:r,onBack:p}){let u=l(),{t}=u,P=i((a)=>a.readPlugin),C=i((a)=>a.installed.find(({plugin:g})=>g.id===r.plugin.id)),x=i((a)=>a.busyIds[r.plugin.id]),H=i((a)=>a.install),V=i((a)=>a.uninstall),j=i((a)=>a.setPluginEnabled),[o,B]=y(null),[D,U]=y(null),[R,M]=y(0),[c,z]=y(null);q(()=>{let a=!0;return U(null),B(null),P(r).then((g)=>{if(a)B(g)},(g)=>{if(a)U(g instanceof Error?g.message:String(g))}),()=>{a=!1}},[r,P,R]);let d=o?.summary??r.plugin,m=C?.plugin??d,s=d.interface,b=s?.displayName??d.name,k=m.availability!=="AVAILABLE"||m.installPolicy==="NOT_AVAILABLE",A=s?.longDescription??o?.description??s?.shortDescription,L=[...u.assetUrl?s?.screenshots.map((a)=>u.assetUrl(a))??[]:[],...s?.screenshotUrls??[]];return n("div",{className:"toolbox-surface flex min-h-0 flex-1 flex-col overflow-hidden",children:[e(se,{children:n("header",{className:"flex min-w-0 flex-col gap-4",children:[n("nav",{"aria-label":t("plugins.detail.root"),className:"flex min-w-0 items-center gap-2 text-[13px]",children:[e(v,{variant:"link",size:"sm",className:"text-muted-foreground hover:text-foreground px-2 hover:no-underline",onClick:p,children:t("plugins.detail.root")}),e("span",{"aria-hidden":"true",className:"text-muted-foreground/50 text-sm",children:"/"}),e("span",{"aria-current":"page",className:"truncate",children:b})]}),n("div",{className:"flex min-h-9 flex-wrap items-center justify-between gap-4",children:[n("div",{className:"flex min-w-0 items-center gap-3",children:[e(I,{name:d.name,className:"size-9 shrink-0 rounded-lg"}),e("h1",{className:"min-w-0 text-2xl leading-8 font-semibold break-words",children:b})]}),e("div",{className:"flex shrink-0 items-center gap-3",children:C?n(T,{children:[e(X,{checked:m.enabled,disabled:!!x||k,"aria-label":t(m.enabled?"plugins.card.disable":"plugins.card.enable",{pluginName:b}),onCheckedChange:(a)=>void j(m,a)}),e(v,{variant:"outline",size:"sm",disabled:!!x,onClick:()=>void V(m),children:x?e(S,{}):t("plugins.detail.uninstall")})]}):e(v,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0","aria-label":t(k?"plugins.detail.unavailable":"plugins.detail.install"),title:t(k?"plugins.detail.unavailable":"plugins.detail.install"),disabled:!!x||k,onClick:()=>void H({...r,plugin:d}).catch(()=>{}),children:x?e(S,{"aria-hidden":"true"}):e(_,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})})]})]})}),e(f,{className:"pe-0",viewportClassName:"pe-0",children:n("div",{className:`${E} pt-2`,children:[s?.shortDescription&&e("p",{className:"text-muted-foreground text-sm leading-6",children:s.shortDescription}),d.keywords.length>0&&e("div",{className:"mt-3 flex flex-wrap gap-2",children:[...new Set(d.keywords)].map((a)=>e(O,{variant:"secondary",className:"text-xs font-normal",children:a},a))}),n("div",{className:"mt-6 flex items-stretch overflow-x-auto border-y py-4",children:[s?.developerName&&e(N,{label:t("plugins.detail.developer"),children:s.developerName}),s?.category&&e(N,{label:t("plugins.detail.category"),children:s.category}),(m.localVersion??m.version)&&e(N,{label:t("plugins.detail.version"),children:m.localVersion??m.version}),e(N,{label:t("plugins.headings.marketplace"),children:r.marketplace.interface?.displayName??r.marketplace.name}),s?.websiteUrl&&e(N,{label:t("plugins.detail.website"),children:e(w,{url:s.websiteUrl,label:t("plugins.detail.website")})})]}),!o&&!D&&n("div",{role:"status",className:"text-muted-foreground mt-8 flex items-center gap-2 text-sm",children:[e(S,{}),t("plugins.detail.loading")]}),D&&n("div",{role:"alert",className:"mt-8 space-y-2",children:[n("p",{className:"text-destructive text-sm",children:[t("plugins.detail.errorTitle"),": ",D]}),e(v,{variant:"outline",size:"sm",className:"h-9",onClick:()=>M((a)=>a+1),children:t("plugins.loadError.retry")})]}),A&&e("p",{className:"mt-8 text-sm leading-6 whitespace-pre-wrap",children:A}),L.length>0&&e("div",{className:"mt-6 flex gap-3 overflow-x-auto",children:[...new Set(L)].map((a)=>e("img",{src:a,alt:b,loading:"lazy",className:"max-h-72 max-w-full rounded-xl border object-contain"},a))}),s&&s.capabilities.length>0&&e(h,{label:t("plugins.detail.capabilities"),count:s.capabilities.length,children:s.capabilities.map((a)=>e(O,{variant:"secondary",className:"me-2",children:a},a))}),o&&o.mcpServers.length>0&&e(h,{label:t("plugins.detail.mcpServers"),count:o.mcpServers.length,children:o.mcpServers.map((a)=>n("div",{className:"flex items-center gap-3 py-1",children:[e(I,{name:d.name,className:"size-6 rounded-md"}),e("span",{className:"text-sm font-medium",children:a})]},a))}),o&&o.skills.length>0&&e(h,{label:t("plugins.detail.skills"),count:o.skills.length,children:o.skills.map((a)=>n(v,{variant:"ghost",className:"h-auto w-full justify-start gap-3 rounded-xl px-3 py-3 text-start whitespace-normal",onClick:()=>z(a),children:[e(I,{name:a.name,className:"size-8"}),n("span",{className:"min-w-0 flex-1",children:[e("span",{className:"block text-sm font-medium",children:a.interface?.displayName??a.name}),e("span",{className:"text-muted-foreground mt-1 block truncate text-[13px] leading-5 font-normal",children:a.interface?.shortDescription??a.shortDescription??a.description})]})]},a.path??a.name))}),o&&o.apps.length>0&&e(h,{label:t("plugins.detail.apps"),count:o.apps.length,children:o.apps.map((a)=>n("div",{className:"rounded-xl px-3 py-3",children:[e("div",{className:"text-sm font-medium",children:a.name}),a.description&&e("p",{className:"text-muted-foreground mt-1 text-[13px] leading-5",children:a.description}),a.installUrl&&e(w,{url:a.installUrl,label:t("plugins.installModal.connect")})]},a.id))}),o&&o.hooks.length>0&&e(h,{label:t("plugins.detail.hooks"),count:o.hooks.length,children:o.hooks.map((a)=>e("p",{className:"text-sm",children:a.eventName},a.key))}),(s?.privacyPolicyUrl||s?.termsOfServiceUrl)&&n("div",{className:"mt-10 flex flex-wrap gap-4 border-t pt-4",children:[s.privacyPolicyUrl&&e(w,{url:s.privacyPolicyUrl,label:t("plugins.detail.privacyPolicy")}),s.termsOfServiceUrl&&e(w,{url:s.termsOfServiceUrl,label:t("plugins.detail.termsOfService")})]})]})}),e(F,{open:c!==null,onOpenChange:(a)=>{if(!a)z(null)},children:e(G,{className:ae,children:c&&n(T,{children:[e("div",{className:"shrink-0 pr-8",children:e(I,{name:c.name,className:"size-10"})}),n("div",{className:"min-h-0 space-y-6 overflow-y-auto overscroll-contain",children:[n(K,{className:"gap-3",children:[e(Q,{className:"text-2xl leading-8 font-semibold break-words",children:c.interface?.displayName??c.name}),e(J,{className:"text-sm leading-6 break-words whitespace-pre-wrap",children:c.description})]}),e(le,{path:c.path,description:c.description},c.path??c.name)]})]})})})]})}function N({label:r,children:p}){return n("div",{className:"flex min-w-28 shrink-0 flex-col items-center justify-between gap-1.5 border-e px-6 first:ps-2 last:border-e-0",children:[e("span",{className:"text-muted-foreground text-xs",children:r}),e("span",{className:"flex items-center text-sm font-normal",children:p})]})}function h({label:r,count:p,children:u}){return n("section",{className:"mt-8",children:[n("h2",{className:"text-base font-medium",children:[r," ",e("span",{className:"text-muted-foreground font-normal",children:p})]}),e("div",{className:"mt-3 flex flex-col gap-2",children:u})]})}function w({url:r,label:p}){let{openLink:u}=l();if(!/^https?:\/\//i.test(r))return null;return n(v,{variant:"link",className:"text-muted-foreground h-auto p-0 text-xs",title:r,onClick:()=>u(r),children:[p,e(W,{className:"size-3.5"})]})}
|
|
2
|
+
export{lt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Li}from"./chunk-kz1kjzmq.js";import{Ei,it}from"./chunk-wm0jty6e.js";import{Button as et}from"@nyssance/shadcn/vega/components/ui/button";import{cn as rt}from"cn";import{LoaderCircleIcon as nt,SearchIcon as ot}from"lucide-react";import{useCallback as _,useEffect as f,useMemo as J,useRef as b,useState as v}from"react";import{jsx as H,jsxs as q,Fragment as st}from"react/jsx-runtime";var V="chat-search",W="chat-search-current",X=150;function ga(o){let r=o??"";return[...document.querySelectorAll("[data-chat-scroll]")].find((l)=>l.dataset.chatScroll===r)??null}var lt=12;function Lr(o,r="center"){let l=o.closest("[data-chat-scroll]");if(!l)return;let g=o.getBoundingClientRect(),y=l.getBoundingClientRect(),m=r==="start"?lt:(l.clientHeight-g.height)/2;l.scrollTo({top:l.scrollTop+(g.top-y.top)-m,behavior:"smooth"})}function P(o){let r=o.startContainer.parentElement;if(!r)return;Lr(r)}var M=new Map;function Y(){if(typeof CSS>"u"||!("highlights"in CSS)||typeof Highlight>"u")return;if(M.size===0){CSS.highlights.delete(V),CSS.highlights.delete(W);return}let o=[...M.values()];CSS.highlights.set(V,new Highlight(...o.flatMap((r)=>r.all))),CSS.highlights.set(W,new Highlight(...o.flatMap((r)=>r.current?[r.current]:[])))}function ct(){let o=Symbol();return{clearHighlights:()=>{M.delete(o),Y()},applyHighlights:(r,l)=>{M.set(o,{all:r,current:l}),Y()}}}function Ai({getViewport:o,findSourceMatches:r,revealTurn:l,prepareSource:g,subscribeOpen:y,labels:m,placement:K="header"}){let{clearHighlights:s,applyHighlights:p}=J(ct,[]),S=r!==void 0,[c,R]=v(!1),[i,O]=v(""),[z,T]=v(!1),[D,L]=v(null),G=i.trim().length>0;f(()=>{if(!c||!G||g===void 0){T(!1),L(null);return}let e=new AbortController;return T(!0),L(null),g(e.signal).catch((t)=>{if(!e.signal.aborted)L(t instanceof Error?t.message:String(t))}).finally(()=>{if(!e.signal.aborted)T(!1)}),()=>e.abort()},[G,c,g]);let u=J(()=>c&&i.trim()&&r?r(i.trim()):[],[r,c,i]),[F,I]=v(0),[Z,E]=v(0),C=b([]),x=b(0),a=b(null),Q=b(null),U=b(null);f(()=>{if(!y)return;return y(()=>{R(!0);let t=U.current;if(t!==null)t.focus({preventScroll:!0}),t.select()})},[y]);let A=_(async(e,t)=>{let n=u[e];if(n===void 0)return;let h=o();if(h===null)throw Error("Chat scroll container is missing");if(l)await l(n.turnKey,t);if(t.aborted)return;let d=h.querySelector(`[data-turn-key="${CSS.escape(n.turnKey)}"]`);if(d===null)throw Error(`Codex turn is missing: ${n.turnKey}`);if(await Ei(d,t),t.aborted)return;if(!l)Lr(d,"start");if(await new Promise((tt)=>requestAnimationFrame(()=>tt())),t.aborted)return;let N=it(d,i.trim());C.current=N;let B=N[n.occurrenceInTurn];if(p(N,B??null),B!==void 0)P(B)},[p,u,o,i,l]),k=b(A);f(()=>{k.current=A},[A]);let w=_(()=>{R(!1),O(""),x.current=0,a.current?.abort(),a.current=null,s(),C.current=[]},[s]);f(()=>{if(!c)return;let e=(t)=>{if(t.key==="Escape"&&Q.current?.contains(document.activeElement))t.preventDefault(),w()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[c,w]),f(()=>{if(!c||!i.trim()){s(),C.current=[],I(0),E(0),x.current=0;return}let e=setTimeout(()=>{if(S)return;let t=o();if(!t)return;let n=it(t,i);if(C.current=n,I(n.length),E(0),p(n,n[0]??null),n[0])P(n[0])},X);return()=>{clearTimeout(e),s()}},[p,s,S,c,i,o]),f(()=>{if(!c||!S||!i.trim())return;let e=new AbortController;a.current?.abort(),a.current=e;let t=setTimeout(()=>{C.current=[],x.current=0,I(u.length),E(0),s(),k.current(0,e.signal)},X);return()=>{if(e.abort(),a.current===e)a.current=null;clearTimeout(t),s()}},[s,u.length,S,c,i]),f(()=>()=>{a.current?.abort(),s()},[s]),f(()=>{if(!c)s()},[s,c]);let j=_((e)=>{if(S){if(u.length===0)return;let n=(x.current+(e?-1:1)+u.length)%u.length;x.current=n,E(n),a.current?.abort();let h=new AbortController;a.current=h,k.current(n,h.signal);return}let t=C.current;if(!t.length)return;E((n)=>{let h=(n+(e?-1:1)+t.length)%t.length,d=t[h];return p(t,d),P(d),h})},[p,u.length,S]);return q(st,{children:[K==="header"&&H(et,{variant:"ghost",size:"icon-sm",title:m.search,onClick:()=>c?w():R(!0),children:H(ot,{})}),c&&q("div",{"data-chat-search":!0,"aria-busy":z||void 0,ref:Q,className:rt("bg-background border-b",K==="body"?"relative shrink-0":"absolute inset-x-0 top-full z-30"),children:[H(Li,{ref:U,value:i,onChange:O,onFind:j,onClose:w,placeholder:m.placeholder,prevTitle:m.previous,nextTitle:m.next}),i.trim()&&q("div",{className:"text-muted-foreground border-border border-t px-3 py-1 text-[11px]",children:[z?H(nt,{"aria-hidden":"true",className:"size-3 animate-spin"}):F===0?"0 / 0":`${Z+1} / ${F}`,D!==null&&H("span",{role:"alert",children:D})]})]})]})}
|
|
2
|
+
export{ga,Lr,Ai};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{e}from"./chunk-4fk0vjh5.js";import{Alert as s,AlertDescription as a,AlertTitle as p}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as c}from"react/jsx-runtime";function Rr({connection:n,error:i,onReconnect:r,className:l="mx-auto w-full max-w-3xl px-6 pt-12"}){let{t:o}=e().host;if(n!=="failed"&&n!=="disconnected")return null;return t("div",{className:l,children:c(s,{variant:"destructive",children:[t(p,{children:n==="failed"?o("connection.failed"):o("connection.disconnected")}),c(a,{className:"flex flex-wrap items-center gap-2",children:[i!==null&&t("span",{className:"font-mono",children:i}),t(m,{size:"sm",variant:"outline",onClick:r,children:o("connection.reconnect")})]})]})})}
|
|
2
|
+
export{Rr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
export{
|
|
1
|
+
var ve="chrome-hover hover:bg-foreground/8 data-[active=true]:bg-foreground/5",d="chrome-hover hover:bg-foreground/8 data-active:bg-foreground/5";
|
|
2
|
+
export{ve,d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{S}from"./chunk-mj7094yh.js";import{t}from"./chunk-sz3vcbp5.js";import{Z}from"./chunk-ce1qr37c.js";import{ContentBlock as i}from"@agentclientprotocol/sdk/experimental/v2/unstable";import{isEmbeddedResource as m,isResourceLink as u}from"@nyssance/codex-acp-v2/client";import{jsx as n}from"react/jsx-runtime";function d({block:e,streaming:o}){let r=t();if(i.isText(e)){if(e.text.length===0)return null;return n("div",{className:"codex-assistant-message",children:n(S,{text:e.text,streaming:o})})}if(i.isImage(e))return n(Z,{block:e,generated:!0});if(i.isAudio(e))return n("audio",{controls:!0,src:`data:${e.mimeType};base64,${e.data}`});if(u(e)||m(e))return n(Z,{block:e,generated:!0});return n("div",{className:"text-muted-foreground",children:r.t("timeline.unsupportedContent",{type:e.type})})}function be({content:e,messageId:o,streaming:r}){return e.map((s,a)=>n(d,{block:s,streaming:r},`${o}:${a}`))}
|
|
2
|
+
export{be};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function vo({container:i,target:f,clientX:e,clientY:n,currentScale:r,nextScale:s}){if(r<=0||s<=0)return null;let o=i.getBoundingClientRect(),t=f.getBoundingClientRect();if(t.width===0||t.height===0)return null;let h=e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom,l=h?(e-t.left)/t.width:0.5,a=h?(n-t.top)/t.height:0.5,c=t.width/r,g=t.height/r,m=c*s,u=g*s,d=e-o.left,p=n-o.top,P=i.scrollLeft+(t.left-o.left)+t.width/2,b=i.scrollTop+(t.top-o.top)+t.height/2,C=(l-0.5)*m,x=(a-0.5)*u;return{left:Math.max(0,P+C-d),top:Math.max(0,b+x-p)}}
|
|
2
|
+
export{vo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{codexMessageError as u,codexTurnError as a}from"@nyssance/codex-acp-v2/client";var c=[10,30,120,300];function
|
|
2
|
-
export{
|
|
1
|
+
import{codexMessageError as u,codexTurnError as a}from"@nyssance/codex-acp-v2/client";var c=[10,30,120,300];function qo(e){let n=0;for(let r=e.length-1;r>=0;r--){let o=e[r],t=o.errors.at(-1),l=t===void 0?null:u(t);if(l===null||a(l).category!=="overloaded")break;if(n++,o.user!==null)break}return c[n-1]??null}
|
|
2
|
+
export{qo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{To,ye}from"./chunk-8c8ncw1m.js";import{Io}from"./chunk-swpy2b9a.js";import{ln,cn,qe,Ze,dn}from"./chunk-rbv1scqm.js";import{InputGroup as ge,InputGroupAddon as Z,InputGroupButton as ee}from"@nyssance/shadcn/vega/components/ui/input-group";import{cn as P}from"cn";import{ArrowUpIcon as be,Loader2Icon as ve,SquareIcon as he,XIcon as Pe}from"lucide-react";import{Children as V,useCallback as h,useEffect as F,useMemo as Ie,useRef as M,useState as xe}from"react";import{flushSync as Le}from"react-dom";import{jsx as a,jsxs as Te}from"react/jsx-runtime";function Y(u){let o=new FormData(u).get("message");return typeof o==="string"?o:""}var Co=({className:u,bashMode:o=!1,attachmentPolicy:I,onCommand:d,onSubmitError:y,canSubmit:f,onSubmitAsync:g,accept:E,multiple:te,globalDrop:C,syncHiddenInput:R,maxFiles:z,maxFileSize:H,onError:b,onSubmit:re,children:oe,...se})=>{let s=Ze(),l=!!s,ie=o&&l&&s.textInput.value.startsWith("!"),x=M(null),A=M(null),k=M(!1),[ae,D]=xe([]),c=l?s.attachments.files:ae,U=M(c);U.current=c;let ue=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""},[]),le=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 K=[];for(let T of _){let Q=I?.sourcePath(T);K.push({id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(T),mediaType:O(T),filename:T.name,size:T.size,lastModified:T.lastModified,...Q===void 0?{}:{sourcePath:Q}})}return[...i,...K]})},[I,O,B,z,H,b]),pe=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)}),[]),me=h(()=>D((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),W=l?s.attachments.add:le,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(To(m,n)){b?.({code:"max_total_size",message:`Total image size must not exceed ${ye}MB.`});return}}W(r)},[c,W,b]),G=l?s.attachments.remove:pe,N=l?s.attachments.clear:me,j=l?s.attachments.openFileDialog:ue;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 ce=(e)=>{if(e.currentTarget.files)L(e.currentTarget.files);e.currentTarget.value=""},q=Ie(()=>({files:c.map((e)=>({...e,id:e.id})),add:L,remove:G,clear:N,openFileDialog:j,fileInputRef:x}),[c,L,G,N,j]),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 X=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:Y(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(Y(t)===n)t.reset();N()};k.current=!0;try{if(d?.(n.trim()))return v(),{status:"accepted"};let p=await Io(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 re({text:n,files:p.files},e);return v(),{status:"accepted"}}finally{k.current=!1}},de=(e)=>{e.preventDefault(),X(e).catch(y)},fe=h((e)=>{if(!e.trim())return;if(l&&s)Le(()=>{s.textInput.setInput(e)});A.current?.requestSubmit()},[s,l]),J=a(cn.Provider,{value:()=>X(null),children:Te(ln.Provider,{value:fe,children:[a("input",{accept:E,"aria-label":"Upload files",className:"hidden",multiple:te,onChange:ce,ref:x,title:"Upload files",type:"file"}),a("form",{className:P("w-full",u),onSubmit:de,ref:A,"data-tour":"chat-input",...se,children:a(ge,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",ie&&"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:oe})})]})});return l?a(qe.Provider,{value:q,children:J}):a(dn.Provider,{value:q,children:J})};function wo({className:u,...o}){return a("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",u),...o})}function ko({className:u,...o}){return a(Z,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",u),...o})}function So({className:u,...o}){return a(Z,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",u),...o})}function _o({className:u,...o}){return a("div",{className:P("flex items-center gap-1",u),...o})}var ne=({variant:u="ghost",className:o,size:I,collapsed:d=!1,...y})=>{let f=d||V.count(y.children)<=1?"icon-xs":"xs";return a(ee,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(d||V.count(y.children)<=1)&&"size-7",o),size:f,type:"button",variant:u,...y})},Po=({className:u,variant:o="ghost",size:I="icon-xs",status:d,children:y,...f})=>{let g=a(be,{className:"size-4"});if(d==="submitted")g=a(ve,{className:"size-4 animate-spin"});else if(d==="streaming")g=a(he,{className:"size-3 fill-current"});else if(d==="error")g=a(Pe,{className:"size-4"});return a(ee,{"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{Co,wo,ko,So,_o,ne,Po};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r}from"./chunk-1mn2t6ga.js";import{useSyncExternalStore as d}from"react";function Ne(t,i){let e=t.runStates[i];return e!==void 0&&(!e.reusableDraft||t.drafts[i]!==void 0)}function c(t,i){let e=new Set(Object.keys(i.runStates).filter((s)=>Ne(i,s))),n=t.filter((s)=>e.delete(s));return n.push(...e),n.length===t.length&&n.every((s,a)=>s===t[a])?t:n}var S=new WeakMap;function g(t){return{view:"sessions",activityOrder:c([],t.state),activitySeen:new Map,activityCollapsedGroups:new Set}}function on(t){let i=S.get(t);if(i)return i;let e=g(t),n=new Set,s=(o)=>{e={...e,...o};for(let v of n)v()};t.store.subscribe(()=>{let o=c(e.activityOrder,t.store.getState());if(o!==e.activityOrder)s({activityOrder:o})});let a={get:()=>e,set:s,subscribe:(o)=>(n.add(o),()=>n.delete(o))};return S.set(t,a),a}function pr(t){S.get(t)?.set(g(t))}function q(t){let i=on(r());return d(i.subscribe,()=>t(i.get()),()=>t(i.get()))}function te(){return on(r()).set}function mr(){let t=q((e)=>e.view),i=te();return[t,(e)=>i({view:e})]}
|
|
2
|
+
export{Ne,on,pr,q,te,mr};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{yn}from"./chunk-
|
|
2
|
-
`,1)[0]??"";return a.endsWith(` b/${s}`)||a.endsWith(` ${s}`)||a.includes(`/${s} `)})??o}function
|
|
3
|
-
`)){if(n.startsWith("diff --git ")){e=null;continue}if(n.startsWith("+++ ")){let i=n.slice(4).trim(),a=i==="/dev/null"?null:i.replace(/^b\//,"");if(a!==null)e={additions:0,deletions:0},s.set(a,e);continue}if(n.startsWith("--- ")){let i=n.slice(4).trim();if(i!=="/dev/null"&&e===null)e={additions:0,deletions:0},s.set(i.replace(/^a\//,""),e);continue}if(e===null)continue;if(n.startsWith("+"))e.additions+=1;else if(n.startsWith("-"))e.deletions+=1}return s}function u(o,s){let e=s.replaceAll("\\","/");for(let[n,i]of o)if(e===n||e.endsWith(`/${n}`))return i;return{additions:0,deletions:0}}function
|
|
4
|
-
${f}`:f;else s.set(r,{path:r,patch:f,...d})}}return[...s.values()]}function
|
|
5
|
-
export{
|
|
1
|
+
import{yn}from"./chunk-1qyxrh0n.js";import{t}from"./chunk-sz3vcbp5.js";import{isDiffEntry as p}from"@nyssance/codex-acp-v2/client";import{jsx as c,jsxs as g,Fragment as h}from"react/jsx-runtime";function jr(o,s){let e=o.split(/^(?=diff --git )/m).filter((i)=>i.length>0);if(e.length<=1)return o;return e.find((i)=>{let a=i.split(`
|
|
2
|
+
`,1)[0]??"";return a.endsWith(` b/${s}`)||a.endsWith(` ${s}`)||a.includes(`/${s} `)})??o}function $r(o){let s=new Map,e=null;for(let n of o.split(`
|
|
3
|
+
`)){if(n.startsWith("diff --git ")){e=null;continue}if(n.startsWith("+++ ")){let i=n.slice(4).trim(),a=i==="/dev/null"?null:i.replace(/^b\//,"");if(a!==null)e={additions:0,deletions:0},s.set(a,e);continue}if(n.startsWith("--- ")){let i=n.slice(4).trim();if(i!=="/dev/null"&&e===null)e={additions:0,deletions:0},s.set(i.replace(/^a\//,""),e);continue}if(e===null)continue;if(n.startsWith("+"))e.additions+=1;else if(n.startsWith("-"))e.deletions+=1}return s}function u(o,s){let e=s.replaceAll("\\","/");for(let[n,i]of o)if(e===n||e.endsWith(`/${n}`))return i;return{additions:0,deletions:0}}function Kr(o){let s=new Map;for(let e of o)for(let n of e.content){if(!p(n))continue;let i=n.patch?$r(n.patch.text):new Map;for(let a of n.changes){let r=typeof a.path==="string"?a.path:null;if(r===null)continue;let d=u(i,r),f=n.patch?jr(n.patch.text,r):"",l=s.get(r);if(l)l.additions+=d.additions,l.deletions+=d.deletions,l.patch=l.patch?`${l.patch}
|
|
4
|
+
${f}`:f;else s.set(r,{path:r,patch:f,...d})}}return[...s.values()]}function ui({items:o}){let s=t(),{openDiff:e,FileIcon:n}=s;return c(yn,{files:Kr(o),actions:s.EditedFilesActions?c(s.EditedFilesActions,{items:o}):void 0,onOpen:e===void 0?void 0:(i)=>e({path:i.path,patch:i.patch}),renderPath:n===void 0?void 0:(i)=>g(h,{children:[c(n,{path:i.path,className:"codex-edited-file-icon"}),c("span",{className:"codex-edited-file-name",children:i.path})]})})}
|
|
5
|
+
export{jr,$r,Kr,ui};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{k}from"./chunk-pzjag1mt.js";import{codexMessageError as A,nativeTurnId as m,textOf as S,turns as _}from"@nyssance/codex-acp-v2/client";function Zr(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 bi(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=k(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(k(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 Ci(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)=>!Zr(r))},d=new Map(n.map((r,a)=>[r.turnId,a])),u=[],f=[u],p,I=null;for(let r of i.items){let a=m(r),l=d.get(a??"");if(a!==null&&I!==null&&a!==I||l!==void 0&&p!==void 0&&l>p+1)u=[],f.push(u);if(u.push(r),a!==null||r.kind==="user")I=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 h=`turn:${l.kind}:${l.id}`,x=r.endedAt??Math.max(...a.map((c)=>c.at)),y=o.get(h);if(y!==void 0&&K(y.items,a)&&y.endedAt===x)return y;let b={key:h,user:r.prompt,work:[],final:[],errors:[],edits:[],startedAt:r.startedAt??l.at,endedAt:x,replayed:a.every(wn),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 wn(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function oe(t){return S(t.content)}function nt(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function kn(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function wi(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 ki(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 Si(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(!ki(t,e[n-1],o))break;n--}return e[n]?.key}function _i(t,e,n){let o=n,s=n;while(o>0&&ki(t,e[o-1],e[o]))o--;while(s+1<e.length&&ki(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{Zr,bi,Ci,wn,oe,nt,kn,wi,ki,Si,_i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{w}from"./chunk-b12v22de.js";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as f,DropdownMenuContent as x,DropdownMenuTrigger as b}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{useState as M}from"react";import{jsx as e,jsxs as o}from"react/jsx-runtime";function Fo({value:a,currentName:n,icon:r,options:p,label:i,header:t,onValueChange:s,showLabel:d=!1,disabled:l=!1,warning:u=!1}){let[m,c]=M(!1);return o(f,{open:m,onOpenChange:c,children:[e(b,{render:o(g,{disabled:l,"data-permission-warning":u?"":void 0,variant:"ghost","aria-label":`${i}: ${n}`,title:n,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:[r,e("span",{className:d?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:n})]})}),o(x,{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:[t&&e("div",{className:"text-muted-foreground flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4",children:e("span",{children:t})}),e(w,{value:a,onValueChange:s,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:p})]})]})}
|
|
2
|
+
export{Fo};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{d}from"./chunk-d257n8gj.js";import{b,p}from"./chunk-1k697ncv.js";import{at}from"./chunk-bvgqsaey.js";import{ke,l,Se,Oe,i}from"./chunk-4p6svs37.js";import{L,R,Y,F,D,ce,dt}from"./chunk-6cmttr4w.js";import{re}from"./chunk-kg5hcf28.js";import{He}from"./chunk-p7dd93e5.js";import{f}from"./chunk-1k21j77z.js";import{ct,I}from"./chunk-wvry7t79.js";import{E,se}from"./chunk-tv0fwt2g.js";import{lt}from"./chunk-cvz3k5gk.js";import{st}from"./chunk-m8hb96f5.js";import{hasPluginStore as te}from"@nyssance/codex-acp-v2/client";import{BlocksIcon as ae,BookOpenIcon as ne,CheckIcon as ie,CircleArrowUpIcon as le,MoreVerticalIcon as oe,PlusIcon as U,PuzzleIcon as de,RefreshCwIcon as me,SearchIcon as ue,Trash2Icon as pe,XIcon as ge}from"lucide-react";import{memo as fe,useDeferredValue as ve,useEffect as K,useMemo as Q,useState as S}from"react";import{Button as k}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as xe,DialogContent as he,DialogDescription as Ne,DialogHeader as ye,DialogTitle as be,DialogTrigger as Pe}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as we,DropdownMenuContent as Ce,DropdownMenuItem as Ie,DropdownMenuTrigger as De}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as W}from"@nyssance/shadcn/vega/components/ui/input";import{Label as Me}from"@nyssance/shadcn/vega/components/ui/label";import{Spinner as B}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as e,jsxs as s,Fragment as Z}from"react/jsx-runtime";function T(t){return t.interface?.displayName??t.name}function X(t){return t.interface?.shortDescription??""}function Ee({plugin:t,marketplace:c}){let{t:u}=l(),g=i((n)=>(t.id in n.busyIds)),a=i((n)=>n.installed.some((x)=>x.plugin.id===t.id)),v=i((n)=>n.install),m=t.availability!=="AVAILABLE"||t.installPolicy==="NOT_AVAILABLE",r=u(g?"plugins.card.installing":a?"plugins.sections.installed":"plugins.card.install");if(a&&!g)return e(ie,{className:"text-muted-foreground size-4 shrink-0","aria-label":r});return e(k,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0 rounded-full",disabled:g||a||m,"aria-label":r,title:m?u("plugins.disabledReason.unknown"):r,onClick:()=>void v({plugin:t,marketplace:c}).catch(()=>{}),children:g?e(B,{"aria-hidden":"true"}):e(U,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})}function ze({plugin:t,marketplace:c,actions:u,onOpen:g}){let a=X(t),v=t.interface?.developerName,m=t.localVersion??t.version,r=[v,m?`v${m}`:null].filter(Boolean).join(" · ");return s(ce,{className:"toolbox-row relative",children:[e(k,{variant:"ghost",className:"absolute inset-0 z-0 size-full","data-hover-background":"none","aria-label":T(t),onClick:()=>g({plugin:t,marketplace:c})}),e(F,{className:"pointer-events-none relative translate-none! self-center!",children:e("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:e(I,{name:t.name})})}),s(R,{className:"pointer-events-none relative min-w-0",children:[e(dt,{className:"mb-0.5",children:T(t)}),e(Y,{className:"line-clamp-1",title:a,children:a||c.interface?.displayName||c.name}),r&&e(Y,{"data-toolbox-metadata":"",children:r})]}),e(L,{className:"relative w-8 shrink-0 justify-center",children:u})]})}function q(){return Oe((t)=>t.connection==="ready"&&te(t.agent))}var z=48;function Be({marketplace:t,plugins:c,onOpen:u}){let{t:g}=l(),a=i((n)=>n.removeMarketplace),[v,m]=S(0),r=Math.min(v,Math.max(0,Math.ceil(c.length/z)-1));if(c.length===0)return null;return s("section",{className:"flex flex-col gap-4",children:[s("div",{className:"flex items-center gap-2",children:[e("h2",{className:"text-base font-medium",children:t.interface?.displayName??t.name}),e("span",{className:"text-muted-foreground text-xs",children:c.length}),t.path!==null&&s(we,{children:[e(De,{render:e(k,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground ms-auto","aria-label":g("plugins.pageActions")}),children:e(oe,{})}),e(Ce,{align:"end",className:"w-max min-w-[140px] whitespace-nowrap",children:s(Ie,{className:"text-destructive",onClick:()=>void a(t.name),children:[e(pe,{className:"size-3.5"}),g("plugins.marketplace.remove")]})})]})]}),e(D,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:c.slice(r*z,(r+1)*z).map((n)=>e(ze,{onOpen:u,plugin:n,marketplace:t,actions:e(Ee,{plugin:n,marketplace:t})},n.remotePluginId??n.id))}),c.length>z&&s("div",{className:"flex items-center justify-end gap-2 px-2",children:[e(k,{variant:"outline",size:"sm",className:"h-9",disabled:r===0,onClick:()=>m(r-1),children:g("plugins.previousPage")}),s("span",{className:"text-muted-foreground text-xs",children:[r+1," / ",Math.ceil(c.length/z)]}),e(k,{variant:"outline",size:"sm",className:"h-9",disabled:(r+1)*z>=c.length,onClick:()=>m(r+1),children:g("plugins.nextPage")})]})]},t.name)}var Te=fe(function({query:c,onOpen:u}){let{t:g}=l(),a=i((n)=>n.marketplaces),v=i((n)=>n.featuredPluginIds),m=Q(()=>a.map((n)=>({marketplace:n,entries:n.plugins.map((x)=>({plugin:x,text:[x.name,T(x),X(x),x.interface?.developerName??"",...x.keywords].join(`
|
|
2
|
+
`).toLowerCase()}))})),[a]),r=Q(()=>{let n=new Set(v);return m.map(({marketplace:x,entries:h})=>({marketplace:x,plugins:h.filter(({plugin:y,text:P})=>c===""?x.path!==null||n.has(y.id):P.includes(c)).map(({plugin:y})=>y)}))},[m,v,c]);return s(Z,{children:[r.map(({marketplace:n,plugins:x})=>e(Be,{marketplace:n,plugins:x,onOpen:u},JSON.stringify([n.name,n.path,c]))),r.every((n)=>n.plugins.length===0)&&e("p",{className:"text-muted-foreground px-2 py-6 text-center text-sm",children:g("plugins.empty")})]})});function Ae(){let{t}=l(),c=q(),u=i((N)=>N.addMarketplace),g=i((N)=>N.upgradeAll),a=i((N)=>N.upgrading),[v,m]=S(""),[r,n]=S(!1),[x,h]=S(!1),[y,P]=S(null),A=async()=>{let N=v.trim();if(!N||r)return;n(!0),P(null);try{await u({source:N}),m(""),h(!1)}catch(M){P(M instanceof Error?M.message:String(M))}finally{n(!1)}};return s("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s(k,{size:"sm",className:"h-9",variant:"outline",disabled:!c||a,"aria-busy":a,onClick:()=>void g(),children:[a?e(B,{}):e(le,{"data-icon":"inline-start"}),t("plugins.marketplace.upgradeAll")]}),s(xe,{open:x,onOpenChange:(N)=>{if(!r)h(N)},children:[s(Pe,{render:e(k,{size:"sm",className:"h-9",variant:"outline",disabled:!c}),children:[e(U,{"data-icon":"inline-start"}),t("plugins.addMarketplace")]}),s(he,{children:[s(ye,{children:[e(be,{children:t("plugins.marketplace.addTitle")}),e(Ne,{children:t("plugins.catalog.sourceHelp")})]}),s("form",{className:"space-y-4",onSubmit:(N)=>{N.preventDefault(),A()},children:[e(Me,{htmlFor:"marketplace-source",children:t("plugins.marketplace.sourceLabel")}),e(W,{id:"marketplace-source",value:v,disabled:r,onChange:(N)=>m(N.target.value),placeholder:t("plugins.marketplace.sourcePlaceholder")}),y&&e("p",{role:"alert",className:"text-destructive text-sm",children:y}),s("div",{className:"flex justify-end gap-2",children:[e(k,{type:"button",variant:"ghost",disabled:r,onClick:()=>h(!1),children:t("plugins.marketplace.addCancel")}),s(k,{type:"submit",disabled:r||v.trim()==="",children:[r&&e(B,{}),t("plugins.marketplace.addSubmit")]})]})]})]})]})]})}function Le({onOpen:t,query:c}){let u=q(),g=i((m)=>m.marketplaceLoadErrors),a=i((m)=>m.loading)||!u,v=ve(c.trim().toLowerCase());return e(f,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${E} flex flex-col gap-8`,children:[g.map((m)=>s("p",{className:"text-destructive px-2 text-xs",children:[m.marketplacePath,": ",m.message]},m.marketplacePath)),a?e(re,{}):e(Te,{query:v,onOpen:t})]})})}function Ui({cwd:t,active:c,extensions:u,onOpenCatalog:g}){let{t:a}=l(),v=Se(),m=ke(v),r=i((o)=>o.refresh),n=i((o)=>o.loading),x=i((o)=>o.error),[h,y]=S("plugins"),[P,A]=S({plugins:"",skills:""}),N=h==="skills"?P.skills:P.plugins,M=(o)=>A((O)=>({...O,[h]:o})),ee=Oe((o)=>JSON.stringify([...new Set(o.sessionList.map((O)=>He(O.cwd,o.projectContext)).filter((O)=>O!==null))].toSorted())),H=JSON.stringify([...new Set([He(t,v.state.projectContext),...JSON.parse(ee)].filter((o)=>o!==null))].toSorted()),j=i((o)=>o.installed),V=a(h==="skills"?"plugins.skills.search":"plugins.search"),[w,G]=S(null),C=q();K(()=>{if(!c||!C)return;if(m.getState().loadedScope!==H)r(JSON.parse(H))},[c,C,r,H,m]),K(()=>{if(!C)return;return v.onSkillsChanged(()=>void r(void 0,{background:!0}))},[C,r,v]);let J=(o)=>{g?.(),y("plugins"),G(o)},_=(o)=>{g?.(),y(o),G(null)};return s("div",{className:"plugins-page @container flex h-full min-h-0 overflow-hidden [--navigation-row-height:30px] [--spacing:4px]",children:[e(ct,{}),s("aside",{className:"bg-sidebar/40 flex w-44 shrink-0 flex-col border-e sm:w-60","aria-label":a("plugins.catalog.navigation"),children:[e("div",{className:"shrink-0 px-3 pt-3",children:e("div",{className:"flex h-9 items-center","data-plugin-sidebar-header":"",children:e("h2",{className:"text-sm leading-8 font-semibold",children:a("plugins.catalog.customize")})})}),s("nav",{"aria-label":a("plugins.manageTabs.aria"),className:"flex shrink-0 flex-col gap-1 px-2 pb-1",children:[u&&s(p,{className:`${d} h-8 gap-2 px-2`,active:u.active,onClick:u.onOpen,children:[e(ae,{className:"size-4"}),e("span",{children:a("plugins.extensions")})]}),["plugins","skills"].map((o)=>s(p,{className:`${d} h-8 gap-2 px-2`,active:!u?.active&&h===o&&w===null,onClick:()=>_(o),children:[o==="plugins"?e(de,{className:"size-4"}):e(ne,{className:"size-4"}),e("span",{children:a(`plugins.headings.${o}`)})]},o))]}),e("h3",{className:"text-muted-foreground mx-2 mt-1 mb-2 flex h-8 shrink-0 items-center px-2 text-xs font-medium",children:a("plugins.sections.installed")}),e(f,{className:"min-h-0 flex-1 pe-0",viewportClassName:"pe-0",children:e("nav",{"aria-label":a("plugins.sections.installed"),className:"px-2 pb-4",children:e(b,{children:!C||n&&j.length===0?s("div",{role:"status",className:"text-muted-foreground flex items-center gap-2 px-3 py-2 text-xs",children:[e(B,{className:"size-3.5",role:"presentation","aria-hidden":"true"}),a("plugins.detail.loading")]}):j.length===0?e("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:a("plugins.sections.installedEmpty")}):j.map((o)=>s(p,{title:T(o.plugin),className:`${d} gap-2 px-2`,active:!u?.active&&w?.plugin.id===o.plugin.id,onClick:()=>J(o),children:[e(I,{name:o.plugin.name,className:"size-4 shrink-0"}),e("span",{className:"truncate",children:T(o.plugin)})]},o.plugin.id))})})})]}),e("main",{className:"toolbox-surface @container flex min-h-0 min-w-0 flex-1 flex-col","aria-label":a("plugins.catalog.content"),children:u?.active?u.content:s(Z,{children:[w&&e(lt,{entry:w,onBack:()=>_("plugins")},JSON.stringify([w.marketplace.name,w.marketplace.path,w.plugin.id,t])),s("div",{hidden:w!==null,className:w?"hidden":"flex min-h-0 flex-1 flex-col",children:[e(se,{children:e(at,{title:a(`plugins.headings.${h}`),children:s("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s("div",{className:"relative w-52 max-w-full",children:[e(ue,{className:"text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2"}),e(W,{className:"h-9 rounded-full ps-9 pe-9","aria-label":V,value:N,onChange:(o)=>M(o.target.value),placeholder:V}),N&&e(k,{className:"toolbox-search-clear absolute end-1 top-1/2 -translate-y-1/2",variant:"ghost",size:"icon-xs","aria-label":a("plugins.catalog.clearSearch"),onClick:()=>M(""),children:e(ge,{})})]}),e(k,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":a("plugins.skills.refresh"),disabled:!C||n,onClick:()=>void r(void 0,{forceRefetch:!0}),children:n?e(B,{}):e(me,{})}),h==="plugins"&&e(Ae,{})]})})}),(h==="plugins"||x)&&s("div",{className:"toolbox-content flex shrink-0 flex-col gap-4 pt-2 pb-6",children:[h==="plugins"&&e("p",{className:"text-muted-foreground text-sm",children:a("plugins.catalog.description")}),x&&s("div",{role:"alert",className:"text-destructive flex items-center justify-between gap-2 text-sm",children:[s("p",{children:[a("plugins.loadError.title"),": ",x]}),e(k,{size:"sm",className:"h-9",variant:"outline",disabled:n||!C,onClick:()=>void r(),children:a("plugins.loadError.retry")})]})]}),s("div",{className:"flex min-h-0 flex-1 flex-col",children:[e("div",{hidden:h!=="plugins",className:h==="plugins"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(Le,{query:P.plugins,onOpen:J})}),e("div",{hidden:h!=="skills",className:h==="skills"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(st,{query:P.skills,ready:C,onOpenPlugin:J})})]})]})]})})]})}
|
|
3
|
+
export{Ui};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Ri}from"./chunk-mz8a6292.js";import{isText as s,terminalOf as i}from"@nyssance/codex-acp-v2/client";function n(t){if(typeof t==="string")return[t];if(Array.isArray(t))return t.flatMap(n);if(typeof t!=="object"||t===null)return[];return Object.entries(t).flatMap(([r,e])=>r==="data"||r==="blob"?[]:n(e))}function u(t){return s(t)?[t.text]:[]}function p(t,r){switch(t.kind){case"user":case"assistant":case"thought":return t.content.flatMap(u);case"tool":return[t.title??"",...n(t.rawInput),...n(i(t,r)?.output||t.rawOutput),...n(t.content)];case"plan":return n(t.plan);case"compaction":return[t.error??""]}}function Mn(t,r,e={}){let o=r.trim();if(o.length===0)return[];return Ri(t.map((a)=>({turnKey:a.key,segments:a.items.flatMap((c)=>p(c,e))})),o)}
|
|
2
|
+
export{Mn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function
|
|
2
|
-
export{
|
|
1
|
+
import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function ti(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function aa(){c()}function ni(){if(r.unlockConsumerCount===0)window.addEventListener("pointerdown",c,{capture:!0}),window.addEventListener("keydown",c,{capture:!0});return r.unlockConsumerCount++,()=>{if(r.unlockConsumerCount--,r.unlockConsumerCount===0)window.removeEventListener("pointerdown",c,{capture:!0}),window.removeEventListener("keydown",c,{capture:!0})}}function oi(e,n,t,i,o){if(o==="none")return;let a=Math.sign(n-e),u=Math.abs(n-e),x=Array.from({length:u},(L,A)=>{let N=e+a*(A+1),v=t[N];return Nr(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function sa(e,n,t,i,o,a){if(a==="none")return;_(o,[Nr(e,n,t,i,a)])}function Nr(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Gr(t,i);return Mr(e,n)}function Gr(e,n){let t=Math.imul(e,5)+Math.imul(n,3)>>>0,i=(Math.imul(e,11)^Math.imul(n,13))>>>0,o=t%f.length;return 12*(U+i%C+1)+f[o]}function Mr(e,n){return y+zr(e,n)}function la(e,n){return D(Mr(e,n))}function zr(e,n){if(n<=l)return Vr(n)[n-e-1];return Math.round((n-e-1)/(n-1)*(l-1))}function Vr(e){if(e<=s.length)return s.slice(0,e);let n=new Set(s),t=s[0]-1,i=s.at(-1)+1;while(n.size<e&&(t>=0||i<l)){if(t>=0&&n.size<e)n.add(t--);if(i<l&&n.size<e)n.add(i++)}for(let o=0;n.size<e&&o<l;o++)n.add(o);return[...n].toSorted((o,a)=>o-a)}function D(e){return 440*2**((e-69)/12)}function _(e,n){let t=d();if(t.state!=="running")return;let{player:i,ready:o}=g(e);o.then(()=>{let a=Math.max(t.currentTime,r.nextNoteTime);for(let u=0;u<n.length;u++)i.start({note:n[u],time:a+u*p,duration:b,velocity:S});r.nextNoteTime=a+n.length*p}).catch((a)=>{console.error(`Failed to play navigation instrument "${e}"`,a)})}function ca(){return r.context?.state}function da(e){return g(e).ready}
|
|
2
|
+
export{ti,aa,ni,oi,sa,Nr,Gr,Mr,la,zr,Vr,ca,da};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,O,Bt}from"./chunk-y97ne5kj.js";var Ao=5000;function Ee(t){return"pastedText"in t}function Hr(t){return`file://${encodeURI(t).replaceAll("#","%23").replaceAll("?","%3F")}`}function Ke(t,e,o){let n=(r,s)=>{for(let[i,x]of a){if(!x.attachments.some((p)=>p.id===e.id))continue;O(i,(p)=>p.map((d)=>d.id===e.id?{...e,url:s===void 0?"":Hr(s),pastedText:{text:e.pastedText.text,status:r}}:d))}};if(!a.get(t)?.attachments.some((r)=>r.id===e.id))return;n("pending"),Bt(e.id,o("pasted-text.txt",e.pastedText.text).then((r)=>n("ready",r)).catch(()=>n("error")))}function Ot(t,e,o,n){if(t.defaultPrevented||t.currentTarget.disabled)return;if([...t.clipboardData.items].some((i)=>i.kind==="file"&&i.type.startsWith("image/")))return;let r=t.clipboardData.getData("text/plain");if(r.length<Ao)return;t.preventDefault(),t.stopPropagation();let s={id:crypto.randomUUID(),type:"file",mediaType:"text/plain",filename:o,url:"",pastedText:{text:r,status:"pending"}};O(e,(i)=>[...i,s]),Ke(e,s,n)}
|
|
2
|
+
export{Ao,Ee,Hr,Ke,Ot};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{an}from"./chunk-qwfw4xpn.js";import{mo}from"./chunk-n66yy1m1.js";import{We}from"./chunk-rbv1scqm.js";import{Button as G}from"@nyssance/shadcn/vega/components/ui/button";import{Separator as ot}from"@nyssance/shadcn/vega/components/ui/separator";import{autoUpdate as rt}from"@floating-ui/dom";import{cn as J}from"cn";import{BookOpenTextIcon as st,FileIcon as it,StoreIcon as lt}from"lucide-react";import{useCallback as ut,useEffect as d,useLayoutEffect as X,useMemo as Y,useRef as Z,useState as v}from"react";import{createPortal as at}from"react-dom";import{jsx as m,jsxs as w,Fragment as ct}from"react/jsx-runtime";function po({handleRef:u,anchorRef:a,commands:T,searchFiles:l,onMention:_,onSearchError:B,fileSearchDebounceMs:C=0,bashMode:H=!1,forcedOpen:s=!1,onForcedOpenChange:p,emptyLabel:R,fileStatusLabels:E,morePlugins:M}){let A=We(),i=A.textInput.value,[j,z]=v(0),[g,D]=v(null),[x,h]=v(0),K=Z(null);d(()=>{let t=u.current?.getTextarea();if(!t)return;let e=()=>z(t.selectionStart??0),n=()=>{if(document.activeElement===t)e()};return t.addEventListener("keyup",e),t.addEventListener("click",e),t.addEventListener("input",e),t.addEventListener("select",e),t.addEventListener("focus",e),document.addEventListener("selectionchange",n),()=>{t.removeEventListener("keyup",e),t.removeEventListener("click",e),t.removeEventListener("input",e),t.removeEventListener("select",e),t.removeEventListener("focus",e),document.removeEventListener("selectionchange",n)}});let U=Y(()=>H&&i.startsWith("!")?null:mo(i,j),[i,j,H]),o=U?.kind==="at"&&!l?null:U,P=`${o?.kind??"forced"}:${o?.query??""}:${s}`,[F,O]=v(P);if(F!==P)O(P),h(0);let L=Z(null);d(()=>{if(!s){L.current=null;return}if(L.current===null)L.current=i;else if(i!==L.current)p?.(!1)},[s,i,p]);let y=o?.kind==="at"?o.query:null;d(()=>{if(y===null||!l){D(null);return}let t=!0,e=()=>{l(y).then((r)=>{if(t)D({query:y,search:l,items:r})},(r)=>{if(t)D({query:y,search:l,items:[]}),B(r)})},n=C>0?window.setTimeout(e,C):null;if(n===null)e();return()=>{if(t=!1,n!==null)window.clearTimeout(n)}},[y,l,C,B]);let f=Y(()=>{if(o?.kind==="at")return g?.query===o.query&&g.search===l?g.items:[];if(o)return an(T,o.query);if(s)return an(T,"");return[]},[o,s,T,g,l]),[tt,q]=v(!1);d(()=>{let t=u.current?.getTextarea();if(!t)return;let e=()=>q(!0),n=()=>{if(q(!1),s)p?.(!1)};return q(document.activeElement===t),t.addEventListener("focus",e),t.addEventListener("blur",n),()=>{t.removeEventListener("focus",e),t.removeEventListener("blur",n)}},[u,s,p]),d(()=>{if(s)u.current?.getTextarea()?.focus()},[s,u]);let c=tt&&(o!==null?o.kind==="slash"||f.length>0||!!E:s);d(()=>{if(!c)return;K.current?.querySelector(`[data-idx="${x}"]`)?.scrollIntoView({block:"nearest"})},[x,c]);function V(t){let e=u.current?.getTextarea();if(!e)return;let n,r;if(o){let S=o.kind==="slash"?`/${t.payload} `:`@${t.label} `;if(n=i.slice(0,o.start)+S+i.slice(o.end),o.kind==="at")_?.(t.payload);r=o.start+S.length}else if(s)n=`${i.length===0||i.endsWith(`
|
|
2
2
|
`)?i:`${i}
|
|
3
3
|
`}/${t.payload} `,r=n.length,p?.(!1);else return;A.textInput.setInput(n),requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(r,r)})}d(()=>{let t=u.current?.getTextarea();if(!t)return;let e=(n)=>{if(!c)return;if(u.current?.isComposing()||n.isComposing||n.keyCode===229)return;if(n.key==="ArrowDown")n.preventDefault(),n.stopPropagation(),h((r)=>f.length===0?0:Math.min(f.length-1,r+1));else if(n.key==="ArrowUp")n.preventDefault(),n.stopPropagation(),h((r)=>Math.max(0,r-1));else if(n.key==="Enter"||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let r=f[x];if(r)V(r)}else if(n.key==="Escape")if(n.preventDefault(),n.stopPropagation(),o)z(Math.max(0,o.start-1)),t.setSelectionRange(o.start,o.start);else p?.(!1)};return t.addEventListener("keydown",e,!0),()=>t.removeEventListener("keydown",e,!0)});let[b,W]=v(null),[N,et]=v(null),I=ut(()=>{let t=a?.current;if(!t)return;let e=t.getBoundingClientRect();W({left:e.left,width:e.width,bottom:window.innerHeight-e.top+8})},[a]);if(X(()=>{if(!c){W(null);return}I()},[c,I]),X(()=>{let t=a?.current;if(!c||!t||!N)return;return rt(t,N,I,{animationFrame:!0})},[c,N,a,I]),!c||a&&!b)return null;let k=o?o.kind==="slash":s,nt=k?st:it,Q=m("div",{ref:et,className:a?"fixed z-50":"absolute inset-x-0 bottom-full z-50 mb-2",style:a&&b?{left:b.left,width:b.width,bottom:b.bottom}:void 0,children:w("div",{ref:K,role:"listbox",onMouseDown:(t)=>t.preventDefault(),className:"bg-popover text-popover-foreground ring-foreground/10 pointer-events-auto w-full overflow-hidden rounded-lg p-1 shadow-md ring-1 outline-hidden",children:[w("div",{className:"max-h-72 overflow-y-auto",children:[f.length===0&&k&&m("div",{className:"text-muted-foreground px-2 py-3 text-xs",children:R}),f.length===0&&!k&&E&&m("div",{role:"status",className:"text-muted-foreground px-2 py-3 text-xs",children:g?.query===y&&g.search===l?E.empty:E.loading}),f.map((t,e)=>w(G,{type:"button",variant:"ghost",role:"option","aria-selected":e===x,"data-idx":e,onMouseDown:(n)=>{n.preventDefault(),V(t)},onMouseEnter:()=>h(e),className:J("flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-2.5 py-2 text-start",e===x&&"bg-muted"),children:[m(nt,{className:J("size-4 shrink-0",k?"text-blue-500":"text-muted-foreground")}),m("span",{className:"text-foreground shrink-0 text-sm font-medium",children:t.label}),t.description&&m("span",{className:"text-muted-foreground min-w-0 flex-1 truncate text-xs",children:t.description})]},t.key))]}),k&&M&&w(ct,{children:[m(ot,{}),w(G,{type:"button",variant:"ghost",onMouseDown:(t)=>{t.preventDefault(),p?.(!1),M.open()},className:"h-auto w-full justify-start px-2.5 py-2",children:[m(lt,{"data-icon":"inline-start"}),M.label]})]})]})});return a?at(Q,document.body):Q}
|
|
4
|
-
export{
|
|
4
|
+
export{po};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{C}from"./chunk-heyqzkxq.js";import{s}from"./chunk-1mn2t6ga.js";import{CircleHelpIcon as m}from"lucide-react";import{useRef as c,useState as p}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as h,DropdownMenuContent as g,DropdownMenuTrigger as w}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as M}from"react/jsx-runtime";function ar({children:l}){let{t:n}=s(),[o,u]=p(!1),r=c(null),[a,d]=p();return C(o),M(h,{open:o,onOpenChange:(t)=>{if(t){let i=r.current?.parentElement;if(!i)throw Error("Help trigger must be mounted in its footer row");d(i.clientWidth)}u(t)},children:[e(w,{render:e(f,{ref:r,variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] shrink-0 rounded-[10px] p-0 [corner-shape:superellipse(1.5)]","aria-label":n("sessionList.help"),title:n("sessionList.help")}),children:e(m,{className:"size-4 shrink-0"})}),e(g,{side:"top",align:"end",sideOffset:8,style:{width:a},children:l})]})}
|
|
2
|
+
export{ar};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createStore as M}from"@alwith/api/client";function k(a){return a instanceof Error?a.message:String(a)}function E(a){return a.interface?.displayName??a.name}function I(a){let u={},n=new Map,l=new Map;for(let p of a.data){for(let o of p.skills)if(n.set(o.path,o),o.scope==="repo"){let m=u[p.cwd]??[];if(!m.includes(o.path))m.push(o.path);u[p.cwd]=m}for(let o of p.errors)l.set(o.path,o)}return{skills:[...n.values()],errors:[...l.values()],projects:u}}function v(a){let u=[];for(let n of a.marketplaces)for(let l of n.plugins)if(l.installed)u.push({plugin:l,marketplace:n});return u.toSorted((n,l)=>(l.plugin.installedAt??0)-(n.plugin.installedAt??0))}function
|
|
2
|
-
export{
|
|
1
|
+
import{createStore as M}from"@alwith/api/client";function k(a){return a instanceof Error?a.message:String(a)}function E(a){return a.interface?.displayName??a.name}function I(a){let u={},n=new Map,l=new Map;for(let p of a.data){for(let o of p.skills)if(n.set(o.path,o),o.scope==="repo"){let m=u[p.cwd]??[];if(!m.includes(o.path))m.push(o.path);u[p.cwd]=m}for(let o of p.errors)l.set(o.path,o)}return{skills:[...n.values()],errors:[...l.values()],projects:u}}function v(a){let u=[];for(let n of a.marketplaces)for(let l of n.plugins)if(l.installed)u.push({plugin:l,marketplace:n});return u.toSorted((n,l)=>(l.plugin.installedAt??0)-(n.plugin.installedAt??0))}function Fn(a){let{plugin:u,marketplace:n}=a;return{installAttemptId:crypto.randomUUID(),pluginName:n.path===null?u.remotePluginId??u.name:u.name,...n.path===null?{remoteMarketplaceName:n.name}:{marketplacePath:n.path}}}function A(a){let{plugin:u,marketplace:n}=a;return{pluginName:n.path===null?u.remotePluginId??u.name:u.name,...n.path===null?{remoteMarketplaceName:n.name}:{marketplacePath:n.path}}}function ut(a,u){let n=u??{t:(e)=>e},l=(e,r)=>n.t(e,r),p=(e)=>n.notify?.(e),o=(e)=>{if(n.reportError)n.reportError(Error(e));else console.error(e)},m=null,b=null,d=(e)=>S.setState(e),P=()=>S.getState(),y=async(e=!1)=>{if(await P().refresh(void 0,{forceRefetch:e,background:!0}),P().error)throw Error(l("plugins.toast.syncError",{message:P().error}))},f=(e,r)=>d((s)=>{let t={...s.busyIds};if(r===null)delete t[e];else t[e]=r;return{busyIds:t}}),h=(e,r)=>d((s)=>{let t={...s.busyMarketplaces};if(r)t[e]=!0;else delete t[e];return{busyMarketplaces:t}}),w=M({loading:!1,loadedScope:null,upgrading:!1,error:null,cwds:[],marketplaces:[],marketplaceLoadErrors:[],featuredPluginIds:[],installed:[],skills:[],skillProjects:{},skillErrors:[],busyIds:{},busySkills:{},busyMarketplaces:{},refresh:(e=P().cwds,r={})=>{if(m={cwds:e,forceRefetch:r.forceRefetch===!0||m?.forceRefetch===!0},d({cwds:e,...!r.background?{loading:!0}:{}}),b)return b;return b=(async()=>{while(m){let s=m;m=null,d({error:null});try{let[t,i,g]=await Promise.all([a.listSkills(s.cwds,s.forceRefetch),a.listPlugins({...s.cwds.length>0?{cwds:s.cwds}:{},...s.forceRefetch?{forceRefetch:!0}:{}}),a.installedPlugins(s.cwds)]);if(m)continue;let c=I(t);d({loadedScope:JSON.stringify(s.cwds),skills:c.skills,skillProjects:c.projects,skillErrors:c.errors,marketplaces:i.marketplaces,marketplaceLoadErrors:i.marketplaceLoadErrors,featuredPluginIds:i.featuredPluginIds,installed:v(g)})}catch(t){if(!m)d({error:k(t)})}}})().finally(()=>{b=null,d({loading:!1})}),b},install:async(e)=>{if(e.plugin.id in P().busyIds)throw Error("Plugin operation already in progress");let r=E(e.plugin);f(e.plugin.id,"installing");try{let s=await a.installPlugin(Fn(e));return await y(),f(e.plugin.id,null),p(l("plugins.toast.installed",{pluginName:r})),s}catch(s){throw o(`${l("plugins.toast.installError")}: ${k(s)}`),s}finally{f(e.plugin.id,null)}},setPluginEnabled:async(e,r)=>{if(e.id in P().busyIds)return;f(e.id,"toggling");let s=(i)=>d((g)=>({installed:g.installed.map((c)=>c.plugin.id===e.id?{...c,plugin:{...c.plugin,enabled:i}}:c)}));s(r);let t=e.enabled;try{let i=e.source.type==="remote"?e.remotePluginId:void 0;if(i===null)throw Error("Remote plugin ID is missing");let g=await a.setPluginEnabled(e.id,r,i);t=g.enabled,s(g.enabled),await y();let c=P().installed.find((R)=>R.plugin.id===e.id);if(c)t=c.plugin.enabled;if(!c||t!==r)throw Error(l("plugins.toast.toggleNotApplied"));f(e.id,null),p(l(r?"plugins.toast.enabled":"plugins.toast.disabled",{pluginName:E(e)}))}catch(i){s(t),o(`${l("plugins.toast.toggleError")}: ${k(i)}`)}finally{f(e.id,null)}},uninstall:async(e)=>{if(e.id in P().busyIds)return;let r=E(e);f(e.id,"uninstalling");try{let s=e.source.type==="remote"?e.remotePluginId:e.id;if(!s)throw Error("Remote plugin ID is missing");if(await a.uninstallPlugin(s),await y(),P().installed.some((t)=>t.plugin.id===e.id))throw Error(l("plugins.toast.uninstallNotApplied"));f(e.id,null),p(l("plugins.toast.uninstalled",{pluginName:r}))}catch(s){o(`${l("plugins.toast.uninstallError")}: ${k(s)}`)}finally{f(e.id,null)}},readPlugin:async(e)=>(await a.readPlugin(A(e))).plugin,setSkillEnabled:async(e,r)=>{if(e.path in P().busySkills)return;d((t)=>({busySkills:{...t.busySkills,[e.path]:!0}})),d((t)=>({skills:t.skills.map((i)=>i.path===e.path?{...i,enabled:r}:i)}));let s=e.interface?.displayName??e.name;try{let t=await a.setSkillEnabled({path:e.path,enabled:r});if(d((i)=>({skills:i.skills.map((g)=>g.path===e.path?{...g,enabled:t.effectiveEnabled}:g)})),t.effectiveEnabled!==r){o(l("plugins.catalog.toggleNotApplied"));return}p(l(r?"plugins.skills.enabledToast":"plugins.skills.disabledToast",{skillName:s}))}catch(t){d((i)=>({skills:i.skills.map((g)=>g.path===e.path?{...g,enabled:e.enabled}:g)})),o(`${l("plugins.skills.toggleError")}: ${k(t)}`)}finally{d((t)=>{let i={...t.busySkills};return delete i[e.path],{busySkills:i}})}},addMarketplace:async(e)=>{let r=await a.addMarketplace(e);return await y(!0),p(r.alreadyAdded?l("plugins.marketplace.alreadyAdded",{marketplaceName:r.marketplaceName}):l("plugins.marketplace.added",{marketplaceName:r.marketplaceName})),r},removeMarketplace:async(e)=>{h(e,!0);try{await a.removeMarketplace(e),await y(),h(e,!1),p(l("plugins.marketplace.removed",{marketplaceName:e}))}catch(r){o(`${l("plugins.marketplace.removeError")}: ${k(r)}`)}finally{h(e,!1)}},upgradeMarketplace:async(e)=>{h(e,!0);try{let r=await a.upgradeMarketplaces(e);if(await y(!0),h(e,!1),r.errors.length>0)o(`${l("plugins.marketplace.upgradeError")}: ${r.errors.map((s)=>s.message).join("; ")}`);else p(l("plugins.marketplace.upgraded",{marketplaceName:e}))}catch(r){o(`${l("plugins.marketplace.upgradeError")}: ${k(r)}`)}finally{h(e,!1)}},upgradeAll:async()=>{if(P().upgrading)return;d({upgrading:!0});try{let e=await a.upgradeMarketplaces();if(await y(!0),d({upgrading:!1}),e.errors.length>0)o(l("plugins.marketplace.upgradeAllError"));else p(l("plugins.marketplace.upgradedAll"))}catch(e){o(`${l("plugins.marketplace.upgradeAllRequestError")}: ${k(e)}`)}finally{d({upgrading:!1})}}}),S=Object.assign(w,{bindHost:(e)=>{n=e}});return S}
|
|
2
|
+
export{Fn,ut};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n}from"./chunk-sz3vcbp5.js";import{Yt,e,g}from"./chunk-4fk0vjh5.js";import{Ft}from"./chunk-awmra30d.js";import{Wt}from"./chunk-n0acc2tb.js";import{Qt}from"./chunk-zheyzqcq.js";import{Et,Lt}from"./chunk-6179zrn1.js";import{Rt}from"./chunk-4jfynrgh.js";import{Alert as x,AlertDescription as C,AlertTitle as N}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as H,EmptyDescription as k,EmptyHeader as O,EmptyTitle as S}from"@nyssance/shadcn/vega/components/ui/empty";import{LockIcon as M,UnplugIcon as P}from"lucide-react";import{useMemo as z,useRef as B}from"react";import{jsx as o,jsxs as r}from"react/jsx-runtime";function br({host:t,client:c,...s}){let m=z(()=>t.openDiff?t:{...t,openDiff:Et},[t]);return r(Yt,{host:m,client:c,children:[o(I,{...s}),!t.openDiff&&o(Lt,{})]})}function I({session:t,header:c,overlay:s,timeline:m,composer:w,readOnlyActions:D,welcome:E,children:T,rootRef:l,search:A=!0}){let{host:d,client:R}=e(),p=B(null),b=(a)=>{if(p.current=a,typeof l==="function")l(a);else if(l)l.current=a},{t:i}=d,f=n((a)=>a.connection==="ready"),v=n((a)=>a.historyPages[t.id]?.error),y=()=>g(d,R.open(t.id,t.cwd)),u=t.items.length===0&&t.attached&&!t.restoring&&t.state==="idle";return r("div",{"data-chat-drop-zone":!0,ref:b,className:"flex h-full min-h-0 flex-col",children:[c,r("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[A&&!u&&o(Qt,{sessionId:t.id,rootRef:p}),s,f&&!t.attached&&!t.restoring&&!t.readOnly&&o("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:r(x,{children:[o(P,{}),o(N,{children:i("conversation.stopped")}),o(C,{children:o(h,{size:"sm",variant:"outline",onClick:y,children:i("conversation.reconnect")})})]})}),u?E??o(H,{className:"flex-1",children:r(O,{children:[o(S,{className:"text-[28px] font-normal",children:i("conversation.welcomeTitle")}),o(k,{children:i("conversation.welcomeDescription")})]})}):o(Wt,{session:t,timeline:m}),o(Rt,{sessionId:t.id}),t.readOnly?o("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:r(x,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[r("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[o(M,{"aria-hidden":"true",className:"size-4 shrink-0"}),r("div",{className:"min-w-0 space-y-1",children:[o(N,{children:i("conversation.readOnlyTitle")}),o(C,{children:i("conversation.readOnlyDescription")}),v&&o("p",{role:"alert",className:"text-destructive break-words",children:v})]})]}),r("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[o(h,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:y,disabled:!f||t.restoring,children:i(t.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),D]})]})}):w??o(Ft,{session:t})]}),T]})}
|
|
2
|
+
export{br};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{c}from"./chunk-mj7094yh.js";import{G}from"./chunk-1fggcrvs.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 R,useState as h}from"react";import{jsx as s,jsxs as y}from"react/jsx-runtime";function Fe(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function B(e){let n=[];for(let[r,l]of e.content.entries()){if(!k(l))continue;let i=l.content;if(b(i))n.push({key:`${e.id}:${r}`,src:`data:${i.mimeType};base64,${i.data}`,alt:e.title??""});if(N(i))n.push({key:`${e.id}:${r}`,path:i.uri,alt:i.name})}if(n.length)return n;let a=e.rawInput;if(a!==null&&typeof a==="object"&&"path"in a&&typeof a.path==="string")return[{key:e.id,path:a.path,alt:a.path.split(/[\\/]/).at(-1)??a.path}];throw Error(`Image view ${e.id} has no image source`)}function T({images:e}){let{loadImage:n,openImageGallery:a,openImage:r,t:l}=c(),[i,g]=h({}),[v,x]=h(0),f=JSON.stringify(e);R(()=>{let t=!0,u=JSON.parse(f);g({});for(let o of u)(o.src!==void 0?Promise.resolve(o.src):o.path!==void 0&&n?n(o.path):Promise.reject(Error("Image loading is unavailable"))).then((d)=>{if(t)g((p)=>({...p,[o.key]:{src:d}}))},()=>{if(t)g((d)=>({...d,[o.key]:{error:!0}}))});return()=>{t=!1}},[f,n,v]);let I=e.flatMap((t)=>{let u=i[t.key];return u&&"src"in u?[{src:u.src,alt:t.alt}]:[]});return s("div",{className:"codex-image-thumbnails",children:e.map((t,u)=>{let o=i[t.key];if(!o)return s("div",{className:"codex-image-thumbnail",role:"status","aria-label":l("stream.codex.imageLoading"),children:s(S,{className:"motion-safe:animate-spin","aria-hidden":"true"})},t.key);if("error"in o)return s("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,"aria-label":l("stream.codex.imageFailed"),onClick:()=>x((m)=>m+1),children:s(A,{"aria-hidden":"true"})},t.key);return s("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,onClick:()=>{let m=e.slice(0,u).filter((d)=>{let p=i[d.key];return p&&"src"in p}).length;if(a)a(I,m);else r?.(o.src)},children:s("img",{src:o.src,alt:t.alt,draggable:!1})},t.key)})})}function gi({blocks:e}){let{t:n}=c(),a=e.flatMap(B),[r,l]=G(`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":r,onClick:()=>l((i)=>!i),children:[y("span",{className:"codex-activity-label",children:[s(C,{className:"codex-activity-icon","aria-hidden":"true"}),s("span",{className:"codex-activity-leading",children:n("stream.codex.viewedImages",{count:a.length})})]}),s(w,{className:r?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),r&&s(T,{images:a})]})}
|
|
2
|
+
export{Fe,gi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var a=(e)=>String(e).padStart(2,"0");function
|
|
2
|
-
export{
|
|
1
|
+
var a=(e)=>String(e).padStart(2,"0");function ot(e,l="user"){let r=e.replayed||e.items.some((t)=>t._meta?.codex&&typeof t._meta.codex==="object"&&("historyReplay"in t._meta.codex)&&t._meta.codex.historyReplay===!0),n=l==="user"?s(e.user?._meta,"messageSentAt")??(!r?e.user?.at??null:null):s(e.final.at(-1)?._meta,"messageCompletedAt")??e.items.map((t)=>s(t._meta,"turnCompletedAt")).find((t)=>t!==null)??(!r&&e.final.length>0?e.endedAt:null);if(n===null)return null;let o=new Date(n),u=o.toDateString()===new Date().toDateString();return{short:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",...u?{}:{month:"short",day:"numeric"}}).format(o),full:`${o.getFullYear()}-${a(o.getMonth()+1)}-${a(o.getDate())} ${a(o.getHours())}:${a(o.getMinutes())}`}}function s(e,l){let r=e?.codex;if(typeof r!=="object"||r===null)return null;let n=r[l];return typeof n==="number"&&Number.isFinite(n)&&Math.abs(n)<=8640000000000000?n:null}
|
|
2
|
+
export{ot};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
export{
|
|
1
|
+
var ra=280;function Vo({entries:i,gapPx:t,measuredHeightsByKey:o,leadingInsetPx:e=0}){let n=[],r=[],d=new Map,s=[],u=e;for(let[x,a]of i.entries()){d.set(a.turnKey,x);for(let h of a.aliases??[])d.set(h,x);s.push(a.turnKey),r.push(u);let f=a.aliases?.map((h)=>o[h]).find((h)=>h!==void 0),m=o[a.turnKey]??f??a.estimatedHeightPx??280;if(n.push(m),u+=m,x<i.length-1)u+=t}return{bottomOffsetsPx:r.map((x,a)=>{let f=n[a];if(f===void 0)throw Error(`Codex turn height is missing at index ${a}`);return u-x-f}),heightsPx:n,topOffsetsPx:r,totalHeightPx:u,turnIndexByKey:d,turnKeys:s}}function Re({distanceFromBottomPx:i,layout:t,overscanCount:o,viewportHeightPx:e}){if(t.turnKeys.length===0)return{startIndex:0,endIndex:0};let n=Math.min(Math.max(0,i),t.totalHeightPx),r=Math.min(n+Math.max(0,e),t.totalHeightPx),d=g(t.bottomOffsetsPx,r),s=l(t.bottomOffsetsPx,t.heightsPx,n);return{startIndex:Math.max(0,d-o),endIndex:Math.min(t.turnKeys.length,Math.max(s,d+1)+o)}}function mn({anchorKey:i,layout:t,previousRange:o}){let e=t.turnIndexByKey.get(i);if(e===void 0)return null;return{startIndex:e,endIndex:Math.min(t.turnKeys.length,e+o.endIndex-o.startIndex)}}function jo({anchorKey:i,distanceFromBottomPx:t,nextLayout:o,previousLayout:e}){let n=e.turnIndexByKey.get(i),r=o.turnIndexByKey.get(i);if(n===void 0||r===void 0)return null;let d=e.bottomOffsetsPx[n],s=e.heightsPx[n],u=o.bottomOffsetsPx[r],x=o.heightsPx[r];if(d===void 0||s===void 0||u===void 0||x===void 0)throw Error(`Codex turn geometry is missing: ${i}`);return Math.max(0,t+u+x-d-s)}function $o({layout:i,turnKey:t,viewportHeightPx:o}){let e=i.turnIndexByKey.get(t);if(e===void 0)return null;let n=i.bottomOffsetsPx[e],r=i.heightsPx[e];if(n===void 0||r===void 0)throw Error(`Codex turn geometry is missing: ${t}`);return Math.max(0,n-o/2+r/2)}function Ko({align:i,layout:t,targetHeightPx:o,targetOffsetPx:e,turnKey:n,viewportHeightPx:r}){let d=t.turnIndexByKey.get(n);if(d===void 0)return null;let s=t.bottomOffsetsPx[d],u=t.heightsPx[d];if(s===void 0||u===void 0)throw Error(`Codex turn geometry is missing: ${n}`);let x=s+u-e;return i==="top"?Math.max(0,x-r+10):Math.max(0,x-o/2-r/2)}function g(i,t){let o=0,e=i.length;while(o<e){let n=Math.floor((o+e)/2),r=i[n];if(r===void 0)throw Error(`Codex bottom offset is missing at index ${n}`);if(r<t)e=n;else o=n+1}return o}function l(i,t,o){let e=0,n=i.length;while(e<n){let r=Math.floor((e+n)/2),d=i[r],s=t[r];if(d===void 0||s===void 0)throw Error(`Codex turn geometry is missing at index ${r}`);if(d+s<=o)n=r;else e=r+1}return e}
|
|
2
|
+
export{ra,Vo,Re,mn,jo,$o,Ko};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{T}from"./chunk-rbv1scqm.js";import{e}from"./chunk-4fk0vjh5.js";import{Ke}from"./chunk-fh3pjhe6.js";import{Button as r}from"@nyssance/shadcn/vega/components/ui/button";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 Mo({data:s,sessionId:m}){let{host:a}=e(),{t:o}=a,p=T(),{text:c,status:n}=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(r,{type:"button",variant:"ghost",disabled:n!=="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:n==="ready"?o("composer.pastedTextCharacters",{count:c.length}):o(n==="pending"?"composer.pastedTextPending":"composer.pastedTextError")})]})]}),n==="error"&&a.writeTextAttachment&&t(r,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRetry"),onClick:()=>Ke(m,s,a.writeTextAttachment),children:t(x,{className:"size-3"})}),t(r,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRemove"),onClick:()=>p.remove(s.id),children:t(d,{className:"size-3"})})]})}
|
|
2
|
+
export{Mo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createContext as o,useContext as n,useEffect as r}from"react";var
|
|
2
|
-
export{
|
|
1
|
+
import{createContext as o,useContext as n,useEffect as r}from"react";var ro=o(null);function C(t){let e=n(ro);r(()=>{if(t&&e!==null)return e()},[t,e])}
|
|
2
|
+
export{ro,C};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function Zo(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReply"in o))return null;let n=o.questionReply;if(!n||typeof n!=="object"||!("question"in n)||!("answer"in n))return null;return typeof n.question==="string"&&typeof n.answer==="string"?{question:n.question,answer:n.answer}:null}function Qo(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReplyParts"in o))return null;let n=o.questionReplyParts;if(!Array.isArray(n)||n.length===0)return null;let i=n;if(!i.every((e)=>!!e&&typeof e==="object"&&("text"in e)&&typeof e.text==="string"&&(!("question"in e)||e.question===void 0||typeof e.question==="string")))return null;return i.map((e)=>({text:e.text,...e.question===void 0?{}:{question:e.question}}))}
|
|
2
|
+
export{Zo,Qo};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
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(
|
|
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(
|
|
4
|
-
export{
|
|
1
|
+
import{go,fo,Dt}from"./chunk-qn6ppn0r.js";import{Ze,T}from"./chunk-rbv1scqm.js";import{InputGroupTextarea as D}from"@nyssance/shadcn/vega/components/ui/input-group";import{cn as M}from"cn";import{forwardRef as R,useCallback as F,useEffect as x,useImperativeHandle as K,useRef as d}from"react";import{jsx as N}from"react/jsx-runtime";var z=(c)=>!c.shiftKey,L=()=>!1,rn=R(({onChange:c,onCompositionStart:b,onCompositionEnd:y,className:E,placeholder:I,bashMode:C=!1,isSendShortcut:H=z,isNewlineShortcut:S=L,...h},P)=>{let n=Ze(),p=T(),u=d(!1),i=d(!1),a=d(null),l=d(null),o=F(()=>{if(globalThis.CSS?.supports?.("field-sizing","content")||l.current!==null)return;l.current=requestAnimationFrame(()=>{l.current=null;let e=a.current;if(!e||u.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`})},[]);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}=go(t),f=fo(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:Dt(e.currentTarget);n.textInput.setInput(m?`!${t}`:t),o(),c?.(e)}}:{onChange:(e)=>{if(!u.current)Dt(e.currentTarget);o(),c?.(e)}};return K(P,()=>({resetHeight:()=>{if(a.current)a.current.style.height="auto"},focus:()=>{a.current?.focus()},isComposing:()=>u.current||i.current,getTextarea:()=>a.current}),[]),N(D,{"data-chat-input":!0,ref:a,rows:3,className:M("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",E),name:"message",onCompositionEnd:(e)=>{u.current=!1;let t=Dt(e.currentTarget);n?.textInput.setInput(m?`!${t}`:t),o(),y?.(e),i.current=!0,requestAnimationFrame(()=>{i.current=!1})},onCompositionStart:(e)=>{i.current=!1,u.current=!0,b?.(e)},onKeyDown:w,onPaste:k,placeholder:I,...h,...A})});rn.displayName="PromptInputTextarea";
|
|
4
|
+
export{rn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{hasAccount as x}from"@nyssance/codex-acp-v2/client";import{useEffect as R,useState as S}from"react";var f="main",p="settings",y="settings:request-agent",w="settings:agent",E="settings:auth-request",A="settings:auth-result",T="settings:request-account",h="settings:account",P="settings:account-error",v=(t)=>t instanceof Error?t.message:String(t);function
|
|
2
|
-
export{
|
|
1
|
+
import{hasAccount as x}from"@nyssance/codex-acp-v2/client";import{useEffect as R,useState as S}from"react";var f="main",p="settings",y="settings:request-agent",w="settings:agent",E="settings:auth-request",A="settings:auth-result",T="settings:request-account",h="settings:account",P="settings:account-error",v=(t)=>t instanceof Error?t.message:String(t);function zi(t){return{agent:()=>{let n=t.state.agent;if(t.state.connection!=="ready"||!n?.info)return null;return{name:n.info.title??n.info.name,version:n.info.version,authMethods:n.authMethods??[],actions:t.state.actions.filter((o)=>o.sessionId===null)}},subscribe:(n)=>t.store.subscribe(n),logout:()=>t.logout(),login:(n,o)=>t.login(n,o),respond:(n,o)=>t.respond(n,o),account:async()=>{if(t.state.connection!=="ready"||!x(t.state.agent))return null;let[n,o]=await Promise.all([t.readAccount(),t.readRateLimits().catch(()=>null)]);return{account:n,rateLimits:o}},onRateLimits:(n)=>t.onRateLimits(n)}}function Vi(t,n){let{listen:o,emitTo:u}=n,g=t.agent(),l=()=>{let s=t.agent();if(u(p,w,s),g===null!==(s===null))c();g=s},i=null,r=0,a=!1,c=async()=>{let s=++r;try{let d=await t.account();if(a||s!==r)return;i=d,await u(p,h,i)}catch(d){if(a||s!==r)return;await u(p,P,v(d))}},e=t.subscribe(l),m=t.onRateLimits((s)=>{if(i===null)return;i={...i,rateLimits:s},u(p,h,i)}),b=Promise.all([o(y,l),o(T,()=>void c()),o(E,({payload:s})=>void(async()=>{try{switch(s.action){case"login":await t.login(s.methodId,s.extra),await c();break;case"logout":await t.logout(),await c();break;case"respond":t.respond(s.actionId,s.answer);break}await u(p,A,{id:s.id,error:null})}catch(d){await u(p,A,{id:s.id,error:v(d)})}})())]);return()=>{a=!0,r++,e(),m(),b.then((s)=>{for(let d of s)d()})}}function ji(t,n=console.error){let{listen:o,emitTo:u}=t,g;async function l(i){let r,a=new Promise((e)=>{r=e}),c=await o(A,(e)=>{if(e.payload.id===i.id)r(e.payload)});try{await u(f,E,i);let{error:e}=await a;if(e!==null)throw Error(e)}finally{c()}}return{useSettingsAccount(){let[i,r]=S(()=>g);return R(()=>{let a=!1,c=Promise.all([o(h,(e)=>{if(a)return;g=e.payload,r(e.payload)}),o(P,(e)=>{if(a)return;if(g===void 0)r(null),n(e.payload);else console.error("Account refresh failed",e.payload)})]);return c.then(()=>{if(!a)return u(f,T)}),()=>{a=!0,c.then((e)=>{for(let m of e)m()})}},[]),i},useSettingsAgent(){let[i,r]=S(void 0);return R(()=>{let a=!1,c=o(w,(e)=>{if(!a)r(e.payload)});return c.then(()=>{if(!a)return u(f,y)}),()=>{a=!0,c.then((e)=>e())}},[]),i},requestSignOut:()=>l({id:crypto.randomUUID(),action:"logout"}),requestSignIn:(i,r)=>l({id:crypto.randomUUID(),action:"login",methodId:i,extra:r}),requestActionResponse:(i,r)=>l({id:crypto.randomUUID(),action:"respond",actionId:i,answer:r})}}
|
|
2
|
+
export{zi,Vi,ji};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d}from"./chunk-d257n8gj.js";import{r,o}from"./chunk-1mn2t6ga.js";import{b,_,p,W}from"./chunk-1k697ncv.js";import{x,J,Qn}from"./chunk-9tp0z23q.js";import{ze}from"./chunk-t6vcdf4j.js";import{N,j}from"./chunk-y0q6jwq4.js";import{de,X}from"./chunk-tz1kzpzp.js";import{closestCorners as fe,DndContext as Ce,KeyboardSensor as ye,PointerSensor as Se,useSensor as Z,useSensors as De}from"@dnd-kit/core";import{SortableContext as ee,sortableKeyboardCoordinates as we,useSortable as ae,verticalListSortingStrategy as oe}from"@dnd-kit/sortable";import{CSS as ce}from"@dnd-kit/utilities";import{cn as F}from"cn";import{BrushCleaningIcon as ve,MessageSquareIcon as Ne,MoreHorizontalIcon as Ie,PencilIcon as he,PlusIcon as me,StarIcon as be,Trash2Icon as pe}from"lucide-react";import{useEffect as xe,useMemo as Me,useState as R}from"react";import{Button as D}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as te,DialogContent as ne,DialogDescription as ie,DialogFooter as le,DialogHeader as re,DialogTitle as se}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as Ee,DropdownMenuContent as ke,DropdownMenuGroup as Le,DropdownMenuItem as H,DropdownMenuTrigger as Re}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as Pe}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as e,jsxs as a,Fragment as Ke}from"react/jsx-runtime";function Te({collectionId:l,sessionId:C,children:M}){let{attributes:w,listeners:v,setNodeRef:i,transform:u,transition:g,isDragging:E}=ae({id:JSON.stringify([l,C]),data:{type:"session",collectionId:l,sessionId:C}});return e("div",{ref:i,style:{transform:ce.Transform.toString(u),transition:g},className:F("w-full min-w-0",E&&"opacity-50"),...w,...v,role:"group",children:M})}function Be({collection:l,children:C,onEdit:M,onConfirm:w,onNewChat:v}){let{t:i}=x(),u=X(),g=J(),{attributes:E,listeners:m,setNodeRef:I,transform:P,transition:T,isDragging:z}=ae({id:l.id,disabled:{draggable:l.id===N,droppable:!1},data:{type:"collection"}});return e("div",{ref:I,style:{transform:ce.Transform.toString(P),transition:T},className:F("w-full min-w-0",z&&"opacity-50"),children:e(W,{open:!l.collapsed,onOpenChange:(c)=>g(u({type:"collapse",id:l.id,collapsed:!c})),label:j(l,i),count:l.sessionIds.length,leading:l.id===N?e(be,{className:"size-3.5"}):e(ze,{emoji:l.emoji,onChange:(c)=>g(u({type:"emoji",id:l.id,emoji:c}))}),wrapHeader:(c)=>e("div",{...E,...m,role:"group",children:c}),actions:a(Ee,{children:[e(Re,{onClick:(c)=>c.stopPropagation(),onPointerDown:(c)=>c.stopPropagation(),render:e(D,{variant:"ghost",size:"icon",className:"size-5","aria-label":i("collection.more",{name:j(l,i)}),children:e(Ie,{className:"size-3.5"})})}),e(ke,{children:a(Le,{children:[l.id!==N&&a(H,{onClick:M,children:[e(he,{}),i("collection.rename")]}),a(H,{onClick:v,children:[e(me,{}),i("collection.newChat")]}),a(H,{onClick:()=>w("clear"),children:[e(ve,{}),i("collection.clearCollection")]}),l.id!==N&&a(H,{variant:"destructive",onClick:()=>w("delete"),children:[e(pe,{}),i("collection.deleteCollection")]})]})})]}),children:C})})}function He({children:l}){return e("div",{className:"min-h-0 flex-1 overflow-y-auto ps-2 pe-0 pb-1",children:l})}function Xi({renderRow:l,onSelect:C,onNewChat:M,Scroll:w=He}){let v=x(),{t:i}=v,u=X(),g=J(),E=r(),{collections:m,order:I}=de(),P=o((t)=>t.sessionList),T=o((t)=>t.archivedSessions),z=o((t)=>t.sessionListLoaded),c=o((t)=>t.sessionListError),U=Me(()=>new Map([...T,...P].map((t)=>[t.sessionId,t])),[T,P]),q=v.isMac??Qn(),[y,k]=R(null),[L,K]=R(""),[A,O]=R(""),[S,B]=R(null),[f,Q]=R(!1),ue=De(Z(Se,{activationConstraint:{distance:5}}),Z(ye,{coordinateGetter:we})),G=I.flatMap((t)=>m[t].collapsed?[]:m[t].sessionIds.flatMap((n)=>{let s=U.get(n);return s&&!s.archived?[s]:[]}));xe(()=>{let t=(n)=>{if(n.defaultPrevented||n.isComposing||n.repeat||n.shiftKey||n.altKey)return;if(q?!n.metaKey||n.ctrlKey:!n.ctrlKey||n.metaKey)return;if(document.querySelector('[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]'))return;if(n.target instanceof HTMLElement&&(n.target.isContentEditable||n.target.closest("input,textarea,[role=dialog],[role=menu]")))return;let s=Number(n.key)-1;if(!Number.isInteger(s)||s<0||s>8||!G[s])return;n.preventDefault(),C(G[s])};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[G,q,C]);let ge=({active:t,over:n})=>{if(n===null)return;let s=t.data.current,h=n.data.current;if(s?.type==="session"&&h!==void 0){let Y=h.type==="session"?String(h.collectionId):String(n.id);g(u({type:"move",sourceCollectionId:String(s.collectionId),collectionId:Y,sessionId:String(s.sessionId),index:h.type==="session"?m[Y].sessionIds.indexOf(String(h.sessionId)):void 0}))}else if(s?.type==="collection"&&h?.type==="collection"&&String(n.id)!==N)g(u({type:"reorder",id:String(t.id),index:I.indexOf(String(n.id))}))},V=(t,n)=>{Q(!0),g(t.then(n).finally(()=>Q(!1)))};return a(Ke,{children:[e(w,{children:a(b,{children:[a(p,{className:F(d,"font-normal"),onClick:()=>{k("new"),K(""),O("")},children:[e(_,{children:e(me,{})}),e("span",{children:i("collection.newCollection")})]}),c&&a("div",{className:"text-muted-foreground px-2 text-sm",children:[e("p",{role:"alert",children:c}),e(D,{variant:"ghost",onClick:()=>g(E.listSessions({reset:!0})),children:i("collection.retry")})]}),e(Ce,{sensors:ue,collisionDetection:fe,onDragEnd:ge,children:e(ee,{items:I,strategy:oe,children:e(b,{children:I.map((t)=>e(Be,{collection:m[t],onNewChat:()=>M(t),onEdit:()=>{k(t),K(m[t].name),O(m[t].emoji??"")},onConfirm:(n)=>B({id:t,type:n}),children:e(ee,{items:m[t].sessionIds.map((n)=>JSON.stringify([t,n])),strategy:oe,children:m[t].sessionIds.map((n)=>{let s=U.get(n);if(s?.archived)return null;if(!s)return z?a("div",{className:"text-muted-foreground flex h-[var(--navigation-row-height)] w-full items-center gap-1 rounded-[10px] ps-1 pe-1.5 text-sm font-normal",children:[e(_,{children:e(Ne,{className:"size-3.5"})}),e("span",{className:"min-w-0 flex-1 truncate",children:i("collection.unavailable")}),e(D,{variant:"ghost",size:"icon",className:"size-5 [&_svg]:size-3.5","aria-label":i("collection.removeFromGroup"),onClick:()=>g(u({type:"remove",sessionId:n,collectionId:t})),children:e(pe,{})})]},n):null;return e(Te,{collectionId:t,sessionId:n,children:l(s,()=>{},t)},n)})})},t))})})})]})}),e(te,{open:y!==null,onOpenChange:(t)=>{if(!t&&!f)k(null)},children:a(ne,{children:[a(re,{children:[e(se,{children:i(y==="new"?"collection.newCollection":"collection.rename")}),e(ie,{children:i("collection.collectionName")})]}),a("form",{onSubmit:(t)=>{if(t.preventDefault(),y===null||!L.trim()||f)return;let n=y==="new"?`collection-${crypto.randomUUID()}`:y;V(u([y==="new"?{type:"create",id:n,name:L}:{type:"rename",id:n,name:L},{type:"emoji",id:n,emoji:A}]),()=>k(null))},className:"flex flex-col gap-3",children:[e(Pe,{autoFocus:!0,"aria-label":i("collection.collectionName"),value:L,onChange:(t)=>K(t.target.value),disabled:f}),y!=="new"&&e(ze,{emoji:A,onChange:O}),a(le,{children:[e(D,{type:"button",variant:"outline",disabled:f,onClick:()=>k(null),children:i("collection.cancel")}),e(D,{type:"submit",disabled:f||!L.trim(),children:i("collection.confirm")})]})]})]})}),e(te,{open:S!==null,onOpenChange:(t)=>{if(!t&&!f)B(null)},children:a(ne,{children:[a(re,{children:[e(se,{children:i(S?.type==="delete"?"collection.deleteCollection":"collection.clearCollection")}),e(ie,{children:i("collection.confirmCollectionChange",{name:S===null?"":j(m[S.id],i)})})]}),a(le,{children:[e(D,{variant:"outline",disabled:f,onClick:()=>B(null),children:i("collection.cancel")}),e(D,{disabled:f,onClick:()=>{if(S!==null)V(u({type:S.type,id:S.id}),()=>B(null))},children:i("collection.confirm")})]})]})})]})}
|
|
2
|
+
export{Xi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{terminalOf as u,textOf as p}from"@nyssance/codex-acp-v2/client";function
|
|
2
|
-
export{
|
|
1
|
+
import{terminalOf as u,textOf as p}from"@nyssance/codex-acp-v2/client";function Nn(n){if(n.kind!=="tool")return!1;let t=n._meta?.codex;return typeof t==="object"&&t!==null&&"commandSource"in t&&t.commandSource==="userShell"}function Ni(n,t,r){if(n.kind!=="tool"){let o=p(n.content),d=/^\s*\*\*([^\n]*?)\*\*\s*$/.exec(o);return{type:"thinking",id:n.id,thinking:d?d[1]:o,isComplete:!r}}if(n.name==="subagent"){let o=s(n.rawInput,n.id);return{type:"subagent",id:n.id,name:g(o.agentPath,n.id),threadId:f(o.agentThreadId,"agentThreadId",n.id),activity:y(o.activity,n.id),model:l(o.model,"model",n.id),reasoningEffort:l(o.reasoningEffort,"reasoningEffort",n.id),status:n.status??"pending",blocks:[]}}if(n.name==="collab"){let o=s(s(s(n._meta,n.id).codex,n.id).collaboration,n.id);if(typeof o.tool!=="string"||!Array.isArray(o.agents))throw Error(`Collaboration call ${n.id} lacks codex-acp-v2 agent metadata`);return{type:"collab",id:n.id,tool:o.tool,status:n.status??"pending",prompt:l(s(n.rawInput,n.id).prompt,"prompt",n.id),agents:o.agents}}let a=typeof n.rawInput==="object"&&n.rawInput!==null&&!Array.isArray(n.rawInput)?{...n.rawInput}:{},i=u(n,t);if(Array.isArray(a.command))a.command=a.command.map(String).join(" ");if(n.toolKind==="execute"&&n.name!=="mcp"&&n.name!=="dynamic_tool"&&typeof a.command!=="string"){let o=i?.command??n.title;if(o!==null)a.command=o}let e=n.rawOutput;if(typeof e==="object"&&e!==null&&"output"in e&&typeof e.output==="string")e=e.output;if(i!==null&&i.output.length>0)e=i.output;let c=i?.exitStatus?.exitCode;return{type:"tool_use",id:n.id,name:n.name??"",title:n.title??n.name??"",kind:n.toolKind??"other",status:n.status??"pending",content:n.content,locations:n.locations,rawInput:a,rawOutput:e,...Nn(n)?{userShell:!0}:{},...typeof c==="number"?{exitCode:c}:{}}}function s(n,t){if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`Tool call ${t} is missing an object codex-acp-v2 always sends`);return n}function l(n,t,r){if(n===null||typeof n==="string")return n;throw Error(`Tool call ${r} has a non-string ${t}`)}function g(n,t){let r=typeof n==="string"?n.split("/").findLast(Boolean):void 0;if(r===void 0)throw Error(`Subagent ${t} has no agent path`);return r}function f(n,t,r){if(typeof n==="string")return n;throw Error(`Tool call ${r} has no ${t}`)}function y(n,t){if(n==="started"||n==="interacted"||n==="interrupted"||n==="completed")return n;throw Error(`Subagent ${t} has an unknown activity ${String(n)}`)}
|
|
2
|
+
export{Nn,Ni};
|