@alwith/module-chat 0.5.20 → 0.5.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity-host.js +1 -1
- package/dist/approval/choice-elicitation-form.js +1 -1
- package/dist/approval/choice-schema.js +1 -1
- package/dist/approval/permission-options.js +1 -1
- package/dist/approval/permission-view.js +1 -1
- package/dist/approval/schema-elicitation-form.js +1 -1
- package/dist/approval/url-elicitation-card.js +1 -1
- package/dist/{chunk-y0q6jwq4.js → chunk-00eytt1z.js} +2 -2
- package/dist/{chunk-95mynf7q.js → chunk-0fs2k5fe.js} +2 -2
- package/dist/{chunk-f1x483c9.js → chunk-0gersbj0.js} +2 -2
- package/dist/{chunk-bbyscgdd.js → chunk-0gy6ngda.js} +2 -2
- package/dist/{chunk-rkfq0c0p.js → chunk-0mp7tyea.js} +2 -2
- package/dist/{chunk-b12v22de.js → chunk-0vhkv9ax.js} +2 -2
- package/dist/{chunk-qd1z91fm.js → chunk-141kppzb.js} +1 -1
- package/dist/chunk-14exd146.js +2 -0
- package/dist/{chunk-rjkpe1fw.js → chunk-156m3888.js} +3 -3
- package/dist/{chunk-4bb6dzzs.js → chunk-1e6x0018.js} +2 -2
- package/dist/{chunk-n66yy1m1.js → chunk-1f628zap.js} +2 -2
- package/dist/{chunk-2f9vjmxz.js → chunk-1ppfn0e1.js} +2 -2
- package/dist/{chunk-ckyat78p.js → chunk-1q2cykp4.js} +2 -2
- package/dist/{chunk-h491shsg.js → chunk-1tkzxktd.js} +2 -2
- package/dist/{chunk-3yxjh7b1.js → chunk-23rjsm3a.js} +2 -2
- package/dist/chunk-2ce8gd89.js +2 -0
- package/dist/{chunk-1rg3nab3.js → chunk-2f1qx13s.js} +2 -2
- package/dist/{chunk-agqnt7xq.js → chunk-2nvsvw67.js} +2 -2
- package/dist/{chunk-1qyxrh0n.js → chunk-2tce3pc5.js} +3 -3
- package/dist/{chunk-28f3zv6v.js → chunk-2tkeevm0.js} +2 -2
- package/dist/{chunk-62jm1gct.js → chunk-33620ca6.js} +2 -2
- package/dist/{chunk-g2qcyqc6.js → chunk-3aq5c12k.js} +2 -2
- package/dist/{chunk-6t5war9h.js → chunk-3jcmv5qf.js} +2 -2
- package/dist/chunk-3n47hknp.js +2 -0
- package/dist/{chunk-yg3xhn5m.js → chunk-3yvd77ph.js} +2 -2
- package/dist/chunk-40bcp4pa.js +2 -0
- package/dist/{chunk-kmdag4vy.js → chunk-42hkbpey.js} +2 -2
- package/dist/{chunk-jwt7q6yx.js → chunk-42nhwnbe.js} +4 -4
- package/dist/{chunk-ktvh4yb5.js → chunk-4s6gx750.js} +2 -2
- package/dist/chunk-52p7kyam.js +2 -0
- package/dist/{chunk-vt6cyes7.js → chunk-59957gfy.js} +2 -2
- package/dist/chunk-59exzf5n.js +2 -0
- package/dist/{chunk-annzfgfq.js → chunk-5cdr7q6f.js} +3 -3
- package/dist/chunk-5nc3dtyt.js +2 -0
- package/dist/{chunk-s8s65pj2.js → chunk-63kxepkh.js} +2 -2
- package/dist/{chunk-bvgqsaey.js → chunk-67hrx4kg.js} +2 -2
- package/dist/{chunk-k7ye738q.js → chunk-6dn3j8a2.js} +2 -2
- package/dist/{chunk-kc56dhwd.js → chunk-72x7rae0.js} +2 -2
- package/dist/{chunk-a63k8tht.js → chunk-77j8n5k5.js} +2 -2
- package/dist/chunk-78s6h7r4.js +2 -0
- package/dist/{chunk-t7drk9ja.js → chunk-7p1r1ha9.js} +2 -2
- package/dist/{chunk-pprt7ntb.js → chunk-7wk3d01c.js} +4 -4
- package/dist/chunk-80ckz04b.js +2 -0
- package/dist/{chunk-p7dd93e5.js → chunk-82xjggwn.js} +2 -2
- package/dist/chunk-85ffkcch.js +2 -0
- package/dist/{chunk-vbab9hc4.js → chunk-8c042xya.js} +2 -2
- package/dist/{chunk-qwfw4xpn.js → chunk-8ch9444t.js} +2 -2
- package/dist/{chunk-36m8zstj.js → chunk-8hte6dh7.js} +2 -2
- package/dist/{chunk-42atrgm1.js → chunk-8jxcdap5.js} +2 -2
- package/dist/chunk-8qw8erv6.js +2 -0
- package/dist/{chunk-3ka3bt0t.js → chunk-8t36vprh.js} +2 -2
- package/dist/{chunk-heyqzkxq.js → chunk-8w22ck92.js} +2 -2
- package/dist/{chunk-q2gfd4jk.js → chunk-908ndb9r.js} +2 -2
- package/dist/{chunk-jxntqarp.js → chunk-983gkw32.js} +2 -2
- package/dist/chunk-9g67z1b4.js +2 -0
- package/dist/chunk-9n79tr1q.js +2 -0
- package/dist/{chunk-581e33tz.js → chunk-9sq2etjk.js} +2 -2
- package/dist/{chunk-nxyrrmz8.js → chunk-a8p82wp7.js} +2 -2
- package/dist/chunk-ajpxjj5m.js +2 -0
- package/dist/{chunk-acb8t4jt.js → chunk-ap0vmczf.js} +2 -2
- package/dist/{chunk-v5pbaf9x.js → chunk-aqvy57zs.js} +2 -2
- package/dist/{chunk-azfmr99x.js → chunk-aza82m2p.js} +2 -2
- package/dist/{chunk-adk7aeyt.js → chunk-b2wczqtd.js} +2 -2
- package/dist/chunk-b3jg6nzv.js +3 -0
- package/dist/{chunk-swpy2b9a.js → chunk-b614gnnv.js} +2 -2
- package/dist/chunk-c1b8z8pa.js +2 -0
- package/dist/{chunk-11484wvv.js → chunk-c38t8809.js} +2 -2
- package/dist/chunk-c9nbavk0.js +2 -0
- package/dist/{chunk-yakar0e2.js → chunk-cbwya2ss.js} +2 -2
- package/dist/chunk-cg8ekwka.js +2 -0
- package/dist/{chunk-x99fyd88.js → chunk-dv65h7z5.js} +2 -2
- package/dist/{chunk-0whxm2f0.js → chunk-dya74vts.js} +2 -2
- package/dist/{chunk-9jp5t3qq.js → chunk-dyqvhn6y.js} +5 -5
- package/dist/{chunk-f2w2sct6.js → chunk-dyrgfdxz.js} +2 -2
- package/dist/{chunk-n5v1h0sk.js → chunk-e9ntencj.js} +2 -2
- package/dist/chunk-ec9rgnt3.js +2 -0
- package/dist/chunk-efrn25h9.js +2 -0
- package/dist/chunk-emcefs0g.js +2 -0
- package/dist/{chunk-z3nybrbb.js → chunk-et8rcxw6.js} +2 -2
- package/dist/chunk-f28hhbf4.js +2 -0
- package/dist/chunk-f3924gdb.js +2 -0
- package/dist/chunk-f8zy35gz.js +2 -0
- package/dist/chunk-f98at4r5.js +2 -0
- package/dist/{chunk-gsfgdnfp.js → chunk-fke98cj0.js} +2 -2
- package/dist/chunk-g242n3dt.js +2 -0
- package/dist/{chunk-wgrmjfyp.js → chunk-g73f62qm.js} +2 -2
- package/dist/{chunk-2t9j90mw.js → chunk-h1bhhqtq.js} +2 -2
- package/dist/{chunk-wvry7t79.js → chunk-h5m2fpp4.js} +2 -2
- package/dist/{chunk-g44hhdha.js → chunk-hv1ejvhg.js} +2 -2
- package/dist/{chunk-mr6k70s4.js → chunk-j86x2rn0.js} +2 -2
- package/dist/{chunk-x2nemdjf.js → chunk-jm6zja6h.js} +2 -2
- package/dist/{chunk-jgd6dcgy.js → chunk-k5rkpqbh.js} +2 -2
- package/dist/{chunk-qdg5zphd.js → chunk-k5wgf59a.js} +2 -2
- package/dist/{chunk-7z4gtfkd.js → chunk-k7k6qsqh.js} +2 -2
- package/dist/{chunk-n9gq2wbz.js → chunk-kc5k5e59.js} +3 -3
- package/dist/chunk-kvc6ewkt.js +4 -0
- package/dist/chunk-kxmajv0m.js +3 -0
- package/dist/{chunk-5a6xc345.js → chunk-m2b8kzpk.js} +2 -2
- package/dist/{chunk-drhzcs6e.js → chunk-m7wn4z9x.js} +2 -2
- package/dist/{chunk-bfhfbrzt.js → chunk-mcjwwxa1.js} +2 -2
- package/dist/{chunk-k64wvbbc.js → chunk-memvzzc6.js} +2 -2
- package/dist/{chunk-48fj5m0p.js → chunk-mg2mkzkk.js} +2 -2
- package/dist/{chunk-f5gsffbv.js → chunk-mgm1x3de.js} +2 -2
- package/dist/chunk-mwpchd85.js +3 -0
- package/dist/chunk-myrdfa3s.js +2 -0
- package/dist/{chunk-4gyd9hx9.js → chunk-n0khj68q.js} +2 -2
- package/dist/chunk-n3xhh6ch.js +2 -0
- package/dist/{chunk-kz1kjzmq.js → chunk-n929wkw7.js} +2 -2
- package/dist/chunk-nacjea1s.js +2 -0
- package/dist/{chunk-mvs2dzyt.js → chunk-nn25kjm4.js} +2 -2
- package/dist/{chunk-855w49k0.js → chunk-nq7gg9vg.js} +2 -2
- package/dist/{chunk-dte0n4kf.js → chunk-nqw4deag.js} +2 -2
- package/dist/{chunk-pwjz3yxb.js → chunk-ns5rnxdj.js} +2 -2
- package/dist/{chunk-667z0pac.js → chunk-nxp1b8ny.js} +2 -2
- package/dist/{chunk-06zh85wp.js → chunk-p4bb313p.js} +3 -3
- package/dist/chunk-py837qjk.js +1 -0
- package/dist/chunk-q7nn5xe5.js +2 -0
- package/dist/{chunk-grr1k5zn.js → chunk-qjhkzdhm.js} +2 -2
- package/dist/{chunk-m271yxxm.js → chunk-qwfwxfhn.js} +2 -2
- package/dist/chunk-qxcnyvps.js +2 -0
- package/dist/chunk-r3qrftds.js +2 -0
- package/dist/chunk-r8rre2zb.js +2 -0
- package/dist/{chunk-1k21j77z.js → chunk-r9dt4bs3.js} +2 -2
- package/dist/chunk-rbqn4725.js +2 -0
- package/dist/{chunk-0643swd4.js → chunk-rcbb4ke2.js} +2 -2
- package/dist/chunk-rekc1q3m.js +2 -0
- package/dist/chunk-rwkkqdcv.js +2 -0
- package/dist/{chunk-b18zr059.js → chunk-rwnz06kr.js} +2 -2
- package/dist/{chunk-1fggcrvs.js → chunk-s55n9cby.js} +2 -2
- package/dist/chunk-sxh0pd3y.js +2 -0
- package/dist/{chunk-hd7bk591.js → chunk-sy5tq3y6.js} +2 -2
- package/dist/chunk-t0cr21e3.js +2 -0
- package/dist/{chunk-8mgypdap.js → chunk-t97yjy4f.js} +2 -2
- package/dist/{chunk-4ygyb91q.js → chunk-v4t0p6pp.js} +2 -2
- package/dist/{chunk-fnpf84rf.js → chunk-vcy5vyp7.js} +2 -2
- package/dist/chunk-vkrgdqnm.js +2 -0
- package/dist/{chunk-r9sweaq4.js → chunk-vs02ry2r.js} +2 -2
- package/dist/{chunk-s4wjckd1.js → chunk-vyk4zh1m.js} +7 -7
- package/dist/{chunk-vfhxerxt.js → chunk-w0hpztj7.js} +2 -2
- package/dist/{chunk-tv0fwt2g.js → chunk-w6rwngm3.js} +2 -2
- package/dist/{chunk-bg03czcx.js → chunk-w9dh298r.js} +2 -2
- package/dist/chunk-wvdncbrt.js +2 -0
- package/dist/{chunk-rbv1scqm.js → chunk-x2yc5748.js} +2 -2
- package/dist/{chunk-r7s7kx38.js → chunk-x334e7wb.js} +3 -3
- package/dist/{chunk-j69t1f4a.js → chunk-x6nz6eyb.js} +2 -2
- package/dist/{chunk-rjw63t34.js → chunk-xf36kt74.js} +3 -3
- package/dist/{chunk-0wa9yjg3.js → chunk-xgjkj9j8.js} +2 -2
- package/dist/{chunk-dfgak1md.js → chunk-xktybk48.js} +2 -2
- package/dist/{chunk-3s94ekrs.js → chunk-xmstt6hh.js} +2 -2
- package/dist/{chunk-g9t2d8hg.js → chunk-xrs7x5ah.js} +2 -2
- package/dist/{chunk-d257n8gj.js → chunk-xyvqcpjx.js} +2 -2
- package/dist/chunk-y7xcync7.js +2 -0
- package/dist/chunk-ye9tsdhn.js +2 -0
- package/dist/{chunk-wccx911q.js → chunk-z2fjwkmt.js} +2 -2
- package/dist/{chunk-gha517v4.js → chunk-z2v008kc.js} +2 -2
- package/dist/{chunk-pzjag1mt.js → chunk-z71pp1mb.js} +3 -3
- package/dist/{chunk-mj7094yh.js → chunk-zxkvvecz.js} +2 -2
- package/dist/codex/activity-group.js +1 -1
- package/dist/codex/assistant-message.js +1 -1
- package/dist/codex/async-question-card.js +1 -1
- package/dist/codex/disclosure-state.js +1 -1
- package/dist/codex/edited-files-card.js +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.js +1 -1
- package/dist/codex/navigation-audio.js +1 -1
- package/dist/codex/navigation-preview.js +1 -1
- package/dist/codex/navigation-rail.js +1 -1
- package/dist/codex/patch-view.js +1 -1
- package/dist/codex/plan.js +1 -1
- package/dist/codex/timeline-virtualizer.js +1 -1
- package/dist/codex/turn-activity.js +1 -1
- package/dist/codex/user-message.js +1 -1
- package/dist/codex/virtualized-turn-list.js +1 -1
- package/dist/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.js +1 -1
- package/dist/settings/providers.js +1 -1
- package/dist/settings/settings-bridge.js +1 -1
- package/dist/settings/settings.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-0p6y2t9b.js +0 -2
- package/dist/chunk-1k697ncv.js +0 -2
- package/dist/chunk-1mn2t6ga.js +0 -2
- package/dist/chunk-1r25anvg.js +0 -2
- package/dist/chunk-20k9syde.js +0 -1
- package/dist/chunk-3gk86w24.js +0 -2
- package/dist/chunk-3vsc49pt.js +0 -2
- package/dist/chunk-4d853988.js +0 -2
- package/dist/chunk-4p6svs37.js +0 -2
- package/dist/chunk-5ap6fvrp.js +0 -2
- package/dist/chunk-5m7vc4s6.js +0 -2
- package/dist/chunk-615a0yhh.js +0 -2
- package/dist/chunk-6syhjege.js +0 -2
- package/dist/chunk-8akwfgkq.js +0 -2
- package/dist/chunk-8c8ncw1m.js +0 -2
- package/dist/chunk-c32z3wjq.js +0 -2
- package/dist/chunk-cvz3k5gk.js +0 -2
- package/dist/chunk-d0vhdr07.js +0 -2
- package/dist/chunk-erjscd1r.js +0 -4
- package/dist/chunk-feg5rp9g.js +0 -2
- package/dist/chunk-ffspd86m.js +0 -2
- package/dist/chunk-fh3pjhe6.js +0 -2
- package/dist/chunk-g9yg36dh.js +0 -3
- package/dist/chunk-ha46rhzj.js +0 -2
- package/dist/chunk-hp4a0e8c.js +0 -2
- package/dist/chunk-j8v3sfpv.js +0 -2
- package/dist/chunk-jmb8r6aj.js +0 -2
- package/dist/chunk-kbeme4w0.js +0 -3
- package/dist/chunk-kq48hbd5.js +0 -2
- package/dist/chunk-mv51zgj1.js +0 -2
- package/dist/chunk-mz8a6292.js +0 -2
- package/dist/chunk-p8g927x6.js +0 -2
- package/dist/chunk-pk2rvqd0.js +0 -2
- package/dist/chunk-px1ehzwc.js +0 -2
- package/dist/chunk-q9ef9n7b.js +0 -2
- package/dist/chunk-q9zawfn1.js +0 -2
- package/dist/chunk-qn6ppn0r.js +0 -2
- package/dist/chunk-rq5e0922.js +0 -2
- package/dist/chunk-ssxbxanb.js +0 -2
- package/dist/chunk-tpbqg729.js +0 -2
- package/dist/chunk-ttn8ss6b.js +0 -2
- package/dist/chunk-vnsgjnp3.js +0 -2
- package/dist/chunk-vzgv360q.js +0 -2
- package/dist/chunk-xft0s40a.js +0 -3
- package/dist/chunk-y6kzbbya.js +0 -2
- package/dist/chunk-y97ne5kj.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{CheckCircleIcon as c,CircleIcon as o,LoaderIcon as i}from"lucide-react";import{jsx as n,jsxs as e}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{CheckCircleIcon as c,CircleIcon as o,LoaderIcon as i}from"lucide-react";import{jsx as n,jsxs as e}from"react/jsx-runtime";function ee({entries:s}){let d=s.filter((a)=>a.status==="completed").length,t=s.find((a)=>a.status==="in_progress");return e("div",{className:"codex-plan",children:[e("div",{className:"codex-plan-summary",children:[e("span",{children:[d,"/",s.length]}),t!==void 0&&e("span",{className:"codex-plan-active",children:["· ",t.content]})]}),n("div",{className:"codex-plan-entries",children:s.map((a)=>e("div",{className:"codex-plan-entry","data-status":a.status,children:[a.status==="completed"&&n(c,{"aria-hidden":"true"}),a.status==="in_progress"&&n(i,{className:"codex-plan-spinner","aria-hidden":"true"}),a.status==="pending"&&n(o,{"aria-hidden":"true"}),n("span",{children:a.content})]},a.content))})]})}
|
|
2
|
+
export{ee};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function eo(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 to(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{eo,to};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{oi}from"./chunk-1e6x0018.js";import{_}from"./chunk-x2yc5748.js";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{HoverCard as H,HoverCardContent as k,HoverCardTrigger as T}from"@nyssance/shadcn/vega/components/ui/hover-card";import{cn as v}from"cn";import{PaperclipIcon as M,XIcon as L}from"lucide-react";import{Fragment as z,useEffect as E,useRef as R,useState as P}from"react";import{jsx as e,jsxs as r,Fragment as F}from"react/jsx-runtime";function D(t){return e(k,{align:"start",...t})}function ei({data:t,t:n,className:l,...m}){let c=_(),[u,f]=P(!1),[N,d]=P(1),I=R(null),a=t.filename||"",o=(t.mediaType?.startsWith("image/")&&t.url?"image":"file")==="image",C=a||(o?n("input.image"):n("input.attachment"));return E(()=>{if(!u)return;let p=0.1,h=(i)=>Math.min(10,Math.max(0.1,i)),g=(i)=>{if(!(i.ctrlKey||i.metaKey))return;let s=i.key,y=s==="+"||s==="=",A=s==="-"||s==="_",x=s==="0";if(!y&&!A&&!x)return;i.preventDefault(),d((w)=>{if(x)return 1;if(y)return h(w+p);return h(w-p)})};return window.addEventListener("keydown",g,{passive:!1}),()=>window.removeEventListener("keydown",g)},[u]),r(F,{children:[r(H,{children:[e(T,{render:r("div",{className:v("group border-border hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent relative flex h-8 cursor-pointer items-center gap-1.5 rounded-md border px-1.5 text-sm font-medium transition-all select-none",l),...m,children:[r("div",{className:"relative size-5 shrink-0",children:[o?e(b,{type:"button",variant:"ghost",size:"icon-xs","aria-label":n("input.image"),className:"bg-background absolute inset-0 size-5 overflow-hidden rounded p-0 transition-opacity group-hover:opacity-0",onClick:()=>{d(1),f(!0)},children:e("img",{alt:a||"attachment",className:"size-5 object-cover",height:20,src:t.url,width:20})}):e("div",{className:"bg-background text-muted-foreground absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded transition-opacity group-hover:opacity-0",children:e(M,{className:"size-3"})}),r(b,{"aria-label":n("input.removeAttachment"),className:v("absolute -top-1 -right-1 size-4 rounded-full p-0 opacity-0 transition-opacity [&>svg]:size-3","pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100"),onClick:(p)=>{p.stopPropagation(),c.remove(t.id)},type:"button",variant:"ghost",children:[e(L,{}),e("span",{className:"sr-only",children:n("input.removeAttachment")})]})]}),!o&&e("span",{className:"max-w-40 flex-1 truncate text-xs",children:C})]})}),e(D,{className:"w-auto p-2",children:r("div",{className:"w-auto space-y-3",children:[o&&e("div",{className:"flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border",children:e("img",{alt:a||"attachment preview",className:"max-h-full max-w-full object-contain",height:384,src:t.url,width:448})}),e("div",{className:"flex items-center gap-2.5",children:r("div",{className:"min-w-0 flex-1 space-y-1 px-0.5",children:[e("h4",{className:"truncate text-sm leading-none font-semibold",children:a||(o?"Image":"Attachment")}),t.mediaType&&e("p",{className:"text-muted-foreground truncate font-mono text-xs",children:t.mediaType})]})})]})})]}),o&&t.url&&e(oi,{containerRef:I,filename:a||n("input.image"),onOpenChange:f,onScaleChange:d,open:u,scale:N,url:t.url})]})}function ti({children:t,className:n,...l}){let m=_();if(!m.files.length)return null;return e("div",{className:v("flex w-full flex-wrap items-center gap-1",n),...l,children:m.files.map((c)=>e(z,{children:t(c)},c.id))})}
|
|
2
|
+
export{ei,ti};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{Card as d,CardContent as c,CardDescription as s,CardFooter as p,CardHeader as C,CardTitle as m}from"@nyssance/shadcn/vega/components/ui/card";import{ExternalLinkIcon as v}from"lucide-react";import{jsx as a,jsxs as e}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{Card as d,CardContent as c,CardDescription as s,CardFooter as p,CardHeader as C,CardTitle as m}from"@nyssance/shadcn/vega/components/ui/card";import{ExternalLinkIcon as v}from"lucide-react";import{jsx as a,jsxs as e}from"react/jsx-runtime";function bi({message:r,url:t,t:i,onOpen:l,onRespond:o}){return e(d,{size:"sm",children:[e(C,{children:[a(s,{children:i("approval.needed")}),a(m,{children:r})]}),a(c,{children:e("div",{className:"flex flex-col gap-3",children:[e(n,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>void l(t),children:[a(v,{"data-icon":"inline-start"}),i("approval.openLink")]}),a("p",{className:"text-muted-foreground text-sm",children:i("approval.waitingForLink")})]})}),e(p,{className:"flex flex-wrap gap-2",children:[a(n,{variant:"outline",size:"sm",onClick:()=>o("decline"),children:i("actions.decline")}),a(n,{variant:"ghost",size:"sm",onClick:()=>o("cancel"),children:i("actions.cancel")})]})]})}
|
|
2
|
+
export{bi};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`,1)[0]??"";return r.endsWith(` b/${a}`)||r.endsWith(` ${a}`)||r.includes(`/${a} `)})??e}function
|
|
3
|
-
export{
|
|
1
|
+
import{Ci,Je}from"./chunk-xf36kt74.js";import{t,Le}from"./chunk-ye9tsdhn.js";import{createStore as d}from"@alwith/api/client";import{Dialog as f,DialogContent as p,DialogDescription as m,DialogHeader as u,DialogTitle as h}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as l}from"react/jsx-runtime";var c=d({request:null});function ct(e){c.setState({request:{path:e.path,patch:En(e.patch,e.path)}})}function En(e,a){let n=e.split(/^(?=diff --git )/m).filter((o)=>o.length>0);if(n.length<=1)return e;return n.find((o)=>{let r=o.split(`
|
|
2
|
+
`,1)[0]??"";return r.endsWith(` b/${a}`)||r.endsWith(` ${a}`)||r.includes(`/${a} `)})??e}function dt(){let{t:e,theme:a}=t(),n=Le(c,(o)=>o.request),s=n===null?null:Ci(n.patch);return i(f,{open:n!==null,onOpenChange:(o)=>!o&&c.setState({request:null}),children:l(p,{className:"flex h-[calc(100vh-2.5rem)] max-h-[900px] flex-col gap-3 sm:max-w-[min(1400px,calc(100vw-2.5rem))]",children:[l(u,{children:[i(h,{className:"truncate pe-8 font-mono text-sm font-normal",children:n?.path}),s!==null&&l(m,{children:[l("span",{className:"codex-diff-additions",children:["+",s.additions]})," ",l("span",{className:"codex-diff-deletions",children:["-",s.deletions]})," ",i("span",{children:e("conversation.changedLines")})]})]}),i("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden rounded-lg border [&>.codex-patch-view]:h-full","data-stream-style":"codexUI",children:n!==null&&i(Je,{patch:n.patch,theme:a})})]})})}
|
|
3
|
+
export{ct,En,dt};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{Mo}from"./chunk-59957gfy.js";import{t}from"./chunk-ye9tsdhn.js";import{eo,to}from"./chunk-k5rkpqbh.js";import{j}from"./chunk-x6nz6eyb.js";import{J}from"./chunk-q7nn5xe5.js";import{isEmbeddedResource as g,isImage as d,isResourceLink as f,isText as x}from"@nyssance/codex-acp-v2/client";import{memo as p}from"react";import{jsx as r,jsxs as h}from"react/jsx-runtime";var Jn=p(function({item:s,messageTime:c}){let l=t(),o=to(s._meta),m=o?o.map((e)=>e.question===void 0?e.text:`${e.question}
|
|
2
|
+
${e.text}`).join(`
|
|
3
|
+
`):J(s),a=s.content.filter(d),i=s.content.filter((e)=>f(e)||g(e)),u=o??s.content.filter(x).map((e)=>{let n=eo(e._meta);return n?{question:n.question,text:n.answer}:{text:e.text}});if(m.length===0&&a.length===0&&i.length===0)return null;return h("div",{className:"group/codex-user flex min-w-0 flex-col items-end gap-2","data-content-search-unit-key":s.id,children:[i.length>0&&r("div",{className:"codex-user-mentions",children:i.map((e,n)=>r(j,{block:e},`${s.id}:${n}`))}),r(Mo,{host:l,message:s,text:m,textParts:u.some((e)=>("question"in e))?u:void 0,images:a,mentions:[],messageTime:c})]})});
|
|
4
|
+
export{Jn};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{gn,fn}from"./chunk-x334e7wb.js";import{b}from"./chunk-z71pp1mb.js";import{an}from"./chunk-6dn3j8a2.js";import{t}from"./chunk-ye9tsdhn.js";import{ao,J,ze,lo}from"./chunk-q7nn5xe5.js";import{rn}from"./chunk-dv65h7z5.js";import{ae}from"./chunk-sy5tq3y6.js";import{tn}from"./chunk-vkrgdqnm.js";import{oo}from"./chunk-dyqvhn6y.js";import{qn}from"./chunk-9n79tr1q.js";import{Wn}from"./chunk-aza82m2p.js";import{nn,on}from"./chunk-63kxepkh.js";import{Ge}from"./chunk-z2v008kc.js";import{codexMessageError as z,codexTurnError as U,isContentEntry as oe,isEmbeddedResource as X,isImage as Y,isResourceLink as me,isText as le,nativeTurnId as de}from"@nyssance/codex-acp-v2/client";import{LoaderCircleIcon as ce,SparklesIcon as ge}from"lucide-react";import{Fragment as ue,memo as pe,useEffect as fe,useState as ye}from"react";import{jsx as s,jsxs as m,Fragment as N}from"react/jsx-runtime";function q(i){if(Y(i))return`${i.mimeType.toLowerCase()}:${i.data}`;if(X(i)&&"blob"in i.resource&&i.resource.mimeType?.toLowerCase().startsWith("image/"))return`${i.resource.mimeType.toLowerCase()}:${i.resource.blob}`;return null}function he({item:i}){let{t:n}=t(),l=i.status==="in_progress",[o,c]=ye(()=>Date.now()-i.at>=1e4);return fe(()=>{if(!l)return;let a=Math.max(0,i.at+1e4-Date.now());if(c(a===0),a===0)return;let f=setTimeout(()=>c(!0),a);return()=>clearTimeout(f)},[i.id,i.at,l]),m("div",{className:"codex-context-compaction",children:[s(ge,{"aria-hidden":"true"}),s("span",{children:i.status==="completed"?n("stream.codex.contextCompacted"):i.status==="cancelled"?n("timeline.interrupted"):n(o?"timeline.compactingWithDelayNotice":"timeline.compacting")})]})}function v({sessionId:i,entry:n,terminals:l,streaming:o,streamingThoughtId:c}){let{t:a}=t();switch(n.kind){case"activity":return s(rn,{sessionId:i,items:n.items,terminals:l,streamingThoughtId:c});case"text":return b(n.item._meta).length>0?s(tn,{sessionId:i,item:n.item}):s(ae,{content:n.item.content,messageId:n.item.id,streaming:o});case"plan":return s(qn,{plan:n.item.plan});case"compaction":if(n.item.status==="failed")return m(nn,{children:[s("div",{children:a("timeline.compactionFailed")}),n.item.error!==null&&s("div",{children:n.item.error})]});return s(he,{item:n.item})}}function xe({sessionId:i,turn:n,terminals:l,active:o,blocked:c=!1,continued:a=!1,edits:f=n.edits,activityItems:M=n.items,workStartedAt:Z=n.startedAt,isLast:W,error:y,interrupted:F,retry:L,retrying:u,answerActions:K,footer:ee}){let{t:d}=t(),E=n.errors.map((e)=>{let r=z(e);if(r===null)throw Error("Turn error item is missing its diagnostics");let I=L?.turnId===de(e)?L:void 0;return s(on,{error:r,retry:I},`${e.id}:${I?.delaySeconds??"manual"}`)});if(W&&y!==null&&!n.errors.some((e)=>{let r=z(e);return r!==null&&r.stopReason===y.stopReason&&U(r).message===U(y).message}))E.push(s(on,{error:y},"current-run-error"));let h=E.length>0?s("div",{className:"codex-turn-errors",children:E}):null,C=n.items.filter(an);if(C.length>0&&C.length===n.items.length)return m(N,{children:[s(rn,{sessionId:i,items:C,terminals:l,streamingThoughtId:null}),h]});let x=n.work,k=x.length>0&&x.every((e)=>e.kind==="compaction");if(ao(n)||k&&n.final.length===0)return m(N,{children:[s("div",{role:"status",className:"text-muted-foreground flex min-w-0 flex-col gap-2 py-2 text-sm",children:n.work.map((e)=>s(v,{sessionId:i,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key))}),h]});let O=ze(n),P=n.final.filter((e)=>b(e._meta).length===0).map(J).join(`
|
|
2
|
+
`),T=o?null:Ge(n,"assistant"),D=n.items.filter((e)=>e.kind==="tool"&&e.name==="image_generation"&&(e.status==="pending"||e.status==="in_progress")),G=new Set(n.final.flatMap((e)=>e.content.map(q).filter((r)=>r!==null))),A=n.items.flatMap((e)=>{if(e.kind!=="tool"||e.status!=="completed")return[];return e.content.filter(oe).flatMap((r,I)=>{let g=r.content,ie=e.name==="image_generation"&&Y(g),re=e.toolKind!=="read"&&e.toolKind!=="search"&&(me(g)||X(g)&&("blob"in g.resource));if(!ie&&!re)return[];let _=q(g);if(_!==null){if(G.has(_))return[];G.add(_)}return[{key:`${e.id}:${I}`,block:g}]})}),R=n.final.some((e)=>b(e._meta).length===0&&e.content.some((r)=>!le(r)||r.text.trim().length>0)),te=D.length>0||A.length>0||k||R||n.final.some((e)=>b(e._meta).length>0),w=n.items.findIndex((e)=>n.final.includes(e)),S=(e)=>n.items.indexOf(e.kind==="activity"?e.items[0]:e.item),B=x.filter((e)=>w===-1||S(e)<w),ne=x.filter((e)=>w!==-1&&S(e)>w),se=[...n.final.map((e)=>({kind:"answer",item:e,index:n.items.indexOf(e)})),...ne.map((e)=>({kind:"work",entry:e,index:S(e)}))].toSorted((e,r)=>e.index-r.index),H=!o&&!a&&(P.trim().length>0?s(gn,{text:P,isMostRecentTurn:W,time:T,afterCopy:K}):m("div",{className:"flex items-center gap-0.5",children:[K,T&&s("span",{className:"codex-user-time ms-1",title:T.full,children:T.short})]})),p=Wn({...n,items:M},{running:o,blocked:c,retrying:u!==void 0}),Q=p.kind==="reasoning"?p.ownerKey??null:null,V=p.kind==="thinking",j=lo({...n,items:M});return m(N,{children:[s(fn,{stateKey:JSON.stringify([i,n.replayed?"history":"live",n.key]),active:o&&!R,defaultExpanded:o&&!R||!n.replayed&&(F||O),...j,startedAt:j.startedAt??Z,loading:(V||p.kind==="working")&&n.work.length===0,loadingLabel:p.kind==="working"?d("stream.codex.working"):void 0,work:a||k?[]:B.map((e)=>s(v,{sessionId:i,entry:e,terminals:l,streaming:o,streamingThoughtId:Q},e.key)),answer:te||a?m("div",{className:"flex min-w-0 flex-col gap-3",children:[(a||k)&&B.map((e)=>s(v,{sessionId:i,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key)),se.map((e)=>{if(e.kind==="work")return s(v,{sessionId:i,entry:e.entry,terminals:l,streaming:o,streamingThoughtId:Q},e.entry.key);let r=e.item;return m(ue,{children:[b(r._meta).length>0?s(tn,{sessionId:i,item:r}):s(ae,{content:r.content,messageId:r.id,streaming:o}),r===n.final.at(-1)&&H]},r.id)}),D.map((e)=>m("div",{className:"codex-image-generation",role:"status","aria-label":d(o?"timeline.imageGenerating":"timeline.imageStopped"),"aria-busy":o,children:[s("div",{className:"codex-image-generation-texture","aria-hidden":"true"}),m("span",{className:"codex-image-generation-status",children:[o&&s(ce,{className:"size-4 motion-safe:animate-spin","aria-hidden":"true"}),d(o?"timeline.imageGenerating":"timeline.imageStopped")]})]},e.id)),A.length>0&&s("div",{className:"codex-reply-artifacts flex min-w-0 flex-col gap-3",children:A.map((e)=>s(ae,{content:[e.block],messageId:e.key,streaming:!1},e.key))}),n.final.length===0&&H]}):null,footer:m(N,{children:[V&&n.work.length>0&&s("div",{className:"codex-pending-message py-2",role:"status",children:s("span",{className:"codex-activity-running",children:d("message.thinking")})}),ee,f.length>0&&!o&&!a&&s(oo,{items:f}),F&&!O&&s("div",{className:"codex-interrupted-turn",role:"status",children:d("timeline.interrupted")}),!o&&h]})}),o&&u!==void 0&&s("div",{className:"text-muted-foreground py-2 text-sm",role:"status",children:u.capacity?(()=>{let e=/Reconnecting(?:\.\.\.)?\s+(\d+\/\d+)/.exec(u.message)?.[1];return e===void 0?d("timeline.capacityReconnecting"):d("timeline.capacityReconnectingProgress",{progress:e})})():u.message}),o&&h]})}var Kn=pe(xe);
|
|
3
|
+
export{Kn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t=new Map;var a=0;function
|
|
2
|
-
export{
|
|
1
|
+
var t=new Map;var a=0;function Pn(e,n){let r=n?void 0:t.get(e);if(r===void 0)return null;return t.delete(e),t.set(e,r),{...r,tokens:structuredClone(r.tokens)}}function c(e){if(e.isStreaming||e.text.length>1048576)return;if(t.delete(e.text))a-=e.text.length;t.set(e.text,{...e,tokens:structuredClone(e.tokens)}),a+=e.text.length;while(a>2097152||t.size>200){let n=t.keys().next().value;a-=n.length,t.delete(n)}}class l{worker=new Worker(new URL("@alwith/module-chat/markdown-parser.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(e)=>{let n=e.data,r=this.active;if(n.clientId!==r?.clientId||n.revision!==r.revision){this.fail(Error("Markdown worker returned an unexpected request"));return}if(this.active=null,!n.ok){this.fail(Error(n.error));return}let i={...r.input,tokens:n.tokens};c(i);let s=this.clients.get(r.clientId),o=this.pending.get(r.clientId),u=o!==void 0&&r.input.isStreaming&&o.input.isStreaming&&o.input.text.startsWith(r.input.text);if(s!==void 0&&(s.revision===r.revision||u))s.onResult(i);this.dispatch()},this.worker.onerror=(e)=>this.fail(Error(e.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize Markdown parsing result"))}fail(e){this.failure=e,this.worker.terminate(),this.pending.clear(),this.active=null;for(let n of this.clients.values())n.onError(e)}send(e){try{this.worker.postMessage(e)}catch(n){this.fail(n instanceof Error?n:Error(String(n)))}}dispatch(){if(this.active!==null||this.pending.size===0)return;let e=this.pending.values().next().value;this.pending.delete(e.clientId),this.active=e,this.send({type:"parse",clientId:e.clientId,revision:e.revision,source:e.input.source})}connect(e,n){if(this.failure!==null)throw this.failure;let r=++this.nextClientId,i={revision:0,onResult:e,onError:n};return this.clients.set(r,i),{update:(s)=>{if(this.failure!==null)throw this.failure;i.revision+=1;let o=Pn(s.text,s.isStreaming);if(o!==null){this.pending.delete(r),i.onResult(o);return}this.pending.set(r,{clientId:r,revision:i.revision,input:s}),this.dispatch()},dispose:()=>{if(!this.clients.delete(r))return;if(this.pending.delete(r),this.clients.size===0)this.worker.terminate(),d=void 0;else if(this.failure===null)this.send({type:"dispose",clientId:r})}}}}var d;function si(e,n){return d??=new l,d.connect(e,n)}
|
|
2
|
+
export{Pn,si};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function ii({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{ii};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Ze}from"./chunk-7wk3d01c.js";import{l,Me}from"./chunk-t0cr21e3.js";import{v}from"./chunk-r9dt4bs3.js";import{MoreHorizontalIcon as y}from"lucide-react";import{useEffect as D,useState as p}from"react";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as P,DropdownMenuContent as b,DropdownMenuItem as g,DropdownMenuTrigger as z}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Skeleton as c}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as o,jsxs as a,Fragment as F}from"react/jsx-runtime";function ai(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function C(n){let i=n.replaceAll("\\","/"),t=i.lastIndexOf("/");return t<=0?"/":i.slice(0,t)}function I(n){let i=/^(\/\/[^/]+\/[^/]+|[A-Za-z]:\/|\/)/.exec(n)?.[0]??"",t=[];for(let e of n.slice(i.length).split("/")){if(!e||e===".")continue;if(e==="..")t.pop();else t.push(e)}return`${i.replace(/\/$/,"")}/${t.join("/")}`}function le({path:n,renderHeader:i,description:t}){let e=l(),{t:r}=e,d=e.readFile,[u,f]=p(null),[w,k]=p(null),[M,N]=p(0);D(()=>{let s=!1;return f(null),k(null),(n===null||!d?Promise.resolve(t??""):d(n)).then((m)=>{if(!s)f(m)},(m)=>{if(!s)k(String(m))}),()=>{s=!0}},[n,t,M,d]);let x=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:a(P,{children:[o(z,{render:o(h,{variant:"ghost",size:"icon-sm","aria-label":r("plugins.card.moreActions")}),children:o(y,{})}),a(b,{align:"end",children:[e.openPath&&o(g,{onClick:()=>void Me(e,e.openPath(n)),children:r("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void Me(e,e.revealPath(n)),children:r("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:u===null,onClick:()=>{if(u!==null)Me(e,e.copyText(u))},children:r("plugins.skills.document.copy")})]})]});return a(F,{children:[i?i(x):o("div",{className:"flex justify-end",children:x}),o(v,{className:"skill-document bg-muted/50 h-[45dvh] min-h-32 min-w-0 flex-none rounded-xl pe-0",viewportClassName:"overscroll-contain p-5 text-sm leading-6",viewportProps:{role:"region",tabIndex:0,"aria-label":r("plugins.skills.document.content")},children:w?a("div",{role:"alert",className:"space-y-3",children:[a("p",{className:"text-destructive text-sm break-words",children:[r("plugins.skills.document.error"),": ",w]}),o(h,{variant:"outline",size:"sm",onClick:()=>N((s)=>s+1),children:r("plugins.loadError.retry")})]}):u===null?a("div",{role:"status","aria-label":r("plugins.skills.loading"),className:"space-y-3",children:[o(c,{className:"h-6 w-1/3"}),o(c,{className:"h-4 w-full"}),o(c,{className:"h-4 w-full"}),o(c,{className:"h-4 w-2/3"})]}):o(Ze,{text:ai(u),host:{theme:e.theme,copyLabel:r("plugins.copy"),openLink:(s)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(s)||n===null?s:I(`${C(n)}/${s}`))}})})]})}
|
|
2
|
+
export{ai,le};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{_}from"./chunk-x2yc5748.js";import{e}from"./chunk-f3924gdb.js";import{He}from"./chunk-g242n3dt.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 Fn({data:s,sessionId:m}){let{host:a}=e(),{t:o}=a,p=_(),{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:()=>He(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{Fn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{nativeTurnId as a}from"@nyssance/codex-acp-v2/client";function
|
|
2
|
-
export{
|
|
1
|
+
import{nativeTurnId as a}from"@nyssance/codex-acp-v2/client";function jn(o,i){let u=new Set,s=(e)=>{let t=e.items.map(a).find((r)=>r!==null),n=e.items.every((r)=>r.replayed);if(t===void 0||u.has(t))return{turnKey:e.key,turn:e,deferUntilReady:n};return u.add(t),{turnKey:`history:${t}`,aliases:[e.key],turn:e,deferUntilReady:n}};if(!i?.complete)return o.map(s);let d=new Map;for(let e of o){let t=e.items.map(a).find((r)=>r!==null);if(t===void 0)continue;let n=d.get(t)??[];n.push(e),d.set(t,n)}let l=new Set(i.turns.map((e)=>e.turnId)),y=new Set(i.loadedTurnIds);return[...i.turns.flatMap((e)=>{let t=d.get(e.turnId);if(t)return t.map(s);return y.has(e.turnId)?[]:[{turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,estimatedHeightPx:320,placeholder:!0}]}),...o.filter((e)=>!e.items.some((t)=>l.has(a(t)??""))).map(s)]}
|
|
2
|
+
export{jn};
|
|
@@ -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 go(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function Qr(){c()}function fo(){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 ho(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 er(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function Yr(e,n,t,i,o,a){if(a==="none")return;_(o,[er(e,n,t,i,a)])}function er(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Gr(t,i);return tr(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 tr(e,n){return y+zr(e,n)}function Xr(e,n){return D(tr(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 Jr(){return r.context?.state}function ea(e){return g(e).ready}
|
|
2
|
+
export{go,Qr,fo,ho,Yr,er,Gr,tr,Xr,zr,Vr,Jr,ea};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{s,a,o}from"./chunk-80ckz04b.js";import{Re,oe,q}from"./chunk-efrn25h9.js";import{Alert as j,AlertDescription as P}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as de,DialogContent as ue,DialogDescription as me,DialogFooter as pe,DialogHeader as he,DialogTitle as fe}from"@nyssance/shadcn/vega/components/ui/dialog";import{Input as ve}from"@nyssance/shadcn/vega/components/ui/input";import{Select as U,SelectContent as ge,SelectItem as x,SelectTrigger as _,SelectValue as R}from"@nyssance/shadcn/vega/components/ui/select";import{Spinner as W}from"@nyssance/shadcn/vega/components/ui/spinner";import{sessionGroup as T}from"@nyssance/codex-acp-v2/client";import{cn as xe}from"cn";import{ArchiveIcon as Se,FolderIcon as J,ListFilterIcon as ye,SearchIcon as Le,Trash2Icon as M}from"lucide-react";import{useEffect as Ne,useRef as Ce,useState as d}from"react";import{jsx as t,jsxs as n}from"react/jsx-runtime";function X({className:u,...i}){return t(ge,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...i,className:xe("max-w-(--available-width) min-w-0 p-1",u)})}function E(u){return u instanceof Error?u.message:String(u)}function we({children:u}){return t("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t("div",{className:"flex flex-col gap-8",children:u})})}function Ir({Scroll:u=we}){let{t:i,i18n:A}=s(),m=a(),S=o((e)=>e.archivedSessions),N=o((e)=>e.connection),[B,Y]=d(""),[y,Z]=d("all"),[p,ee]=d("all"),[te,se]=d(0),[z,F]=d(!0),[I,V]=d(null),[H,O]=d(null),[C,w]=d(!1),h=Ce(!1),[D,f]=d(null),[G,b]=d(null),[ie,K]=d(!1);Ne(()=>{if(N!=="ready")return;let e=!1;F(!0),V(null);async function c(){try{await m.listArchived({reset:!0});let r=new Set;while(!e&&m.state.archivedCursor!==null){let v=m.state.archivedCursor;if(r.has(v))throw Error("Archive pagination returned a repeated cursor");r.add(v),await m.listArchived()}}catch(r){if(!e)V(E(r))}finally{if(!e)F(!1)}}return c(),()=>{e=!0}},[m,N,te]);let l=o((e)=>e.projectContext),k=!(l!==null&&N==="ready"&&!z&&I===null)||C,L=(e)=>e.title??i("sessionList.untitled"),ne=[...new Set(S.filter((e)=>l&&T(l,e).id!==q).map((e)=>l?T(l,e).id:e.cwd))].toSorted(),ae=B.trim().toLocaleLowerCase(A.language),Q=S.filter((e)=>{let c=l?T(l,e).id:null,r=c===q;return L(e).toLocaleLowerCase(A.language).includes(ae)&&(y==="all"||(y==="quick"?r:!r))&&(p==="all"||(p==="quick"?r:c===p))}),re=new Intl.DateTimeFormat(A.language,{dateStyle:"medium",timeStyle:"short"});async function le(e){if(h.current)return;h.current=!0,w(!0),O(null);try{await m.unarchive(e.sessionId)}catch(c){O(E(c))}finally{h.current=!1,w(!1)}}async function ce(){if(h.current||!D)return;h.current=!0,w(!0),b(null);let e=[],c=[];try{for(let r of D){if(!m.state.archivedSessions.some((v)=>v.sessionId===r.sessionId))continue;try{await m.delete(r.sessionId)}catch(v){e.push(r),c.push(`${L(r)}: ${E(v)}`)}}if(e.length)f(e),b(c.join(`
|
|
2
|
+
`));else f(null)}finally{h.current=!1,w(!1)}}return n("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":i("sessionList.archives.title"),children:[n("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[n("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[t("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:i("sessionList.archives.title")}),n(g,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:k||S.length===0,onClick:()=>{b(null),K(!0),f([...S])},children:[t(M,{className:"size-4","aria-hidden":"true"}),i("sessionList.archives.deleteAll")]})]}),n("div",{className:"flex shrink-0 flex-wrap gap-3",children:[n("div",{className:"relative min-w-48 flex-1",children:[t(Le,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),t(ve,{"aria-label":i("sessionList.archives.search"),placeholder:i("sessionList.archives.search"),value:B,onChange:(e)=>Y(e.target.value),className:"rounded-md ps-9"})]}),n(U,{value:y,onValueChange:(e)=>{if(e===null)throw Error("Archive chat type cannot be empty");Z(e)},children:[n(_,{"aria-label":i("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[t(ye,{"aria-hidden":"true"}),t(R,{children:i(`sessionList.archives.${y==="all"?"allChats":y==="quick"?"quickChats":"projectChats"}`)})]}),n(X,{children:[t(x,{value:"all",children:i("sessionList.archives.allChats")}),t(x,{value:"quick",children:i("sessionList.archives.quickChats")}),t(x,{value:"project",children:i("sessionList.archives.projectChats")})]})]}),n(U,{value:p,onValueChange:(e)=>{if(e===null)throw Error("Archive project filter cannot be empty");ee(e)},children:[n(_,{"aria-label":i("sessionList.archives.project"),className:"w-48 rounded-md",children:[t(J,{"aria-hidden":"true"}),t(R,{className:"truncate",children:p==="all"?i("sessionList.archives.allProjects"):p==="quick"?i("sessionList.archives.noProject"):oe(p,l??void 0)})]}),n(X,{children:[t(x,{value:"all",children:i("sessionList.archives.allProjects")}),t(x,{value:"quick",children:i("sessionList.archives.noProject")}),ne.map((e)=>t(x,{value:e,title:e,children:oe(e,l??void 0)},e))]})]})]}),n(u,{children:[N!=="ready"?t("p",{role:"status",className:"text-muted-foreground",children:i("sessionList.archives.connecting")}):z?n("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[t(W,{}),i("sessionList.archives.loading")]}):I?t(j,{variant:"destructive",children:n(P,{className:"flex items-center justify-between gap-4",children:[t("span",{children:I}),t(g,{variant:"outline",onClick:()=>se((e)=>e+1),children:i("sessionList.archives.retry")})]})}):S.length===0?n("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[t(Se,{"aria-hidden":"true",className:"size-8"}),t("p",{children:i("sessionList.archives.empty")})]}):Q.length===0?t("p",{className:"text-muted-foreground py-12 text-center",children:i("sessionList.archives.noResults")}):(l?Re(Q,l):[]).filter(([,e])=>e.length>0).map(([e,c])=>n("section",{className:"flex flex-col gap-3",children:[n("div",{className:"flex items-center justify-between gap-3",children:[n("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:e===q?void 0:e,children:[t(J,{"aria-hidden":"true",className:"size-4 shrink-0"}),t("span",{className:"truncate",children:e===q?i("sessionList.archives.noProject"):oe(e,l??void 0)})]}),t("span",{className:"text-muted-foreground shrink-0 text-sm",children:i("sessionList.archives.count",{count:c.length})})]}),t("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:c.map((r)=>n("article",{"aria-label":L(r),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[n("div",{className:"min-w-0 flex-1 basis-40",children:[t("h3",{className:"truncate text-sm font-medium",title:L(r),children:L(r)}),r.updatedAt!==null&&t("time",{dateTime:r.updatedAt,title:i("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:re.format(new Date(r.updatedAt))})]}),n("div",{className:"flex shrink-0 items-center gap-2",children:[t(g,{variant:"ghost",size:"icon-sm","aria-label":i("sessionList.delete"),title:i("sessionList.delete"),disabled:k,className:"text-muted-foreground hover:text-destructive",onClick:()=>{b(null),K(!1),f([r])},children:t(M,{"aria-hidden":"true"})}),t(g,{variant:"secondary",size:"sm",disabled:k,onClick:()=>void le(r),children:i("sessionList.archives.unarchive")})]})]},r.sessionId))})]},e)),H&&t(j,{variant:"destructive",children:t(P,{children:H})})]})]}),t(de,{open:D!==null,onOpenChange:(e)=>{if(!e&&!h.current)f(null)},children:n(ue,{showCloseButton:!C,children:[n(he,{children:[t(fe,{children:i("sessionList.archives.deleteTitle")}),t(me,{children:i(ie?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:D?.length??0})})]}),G&&t(j,{variant:"destructive",children:t(P,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:G})}),n(pe,{children:[t(g,{variant:"outline",disabled:C,onClick:()=>f(null),children:i("sessionList.cancel")}),n(g,{variant:"destructive",className:"text-sm font-normal",disabled:k,onClick:()=>void ce(),children:[C&&t(W,{}),i("sessionList.archives.confirmDelete")]})]})]})})]})}
|
|
3
|
+
export{Ir};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{cn}from"./chunk-dyrgfdxz.js";import{vo}from"./chunk-aqvy57zs.js";import{X,Xn}from"./chunk-rwkkqdcv.js";import{e}from"./chunk-f3924gdb.js";import{useCallback as s,useSyncExternalStore as E}from"react";import"@alwith/module-chat/search.css";import{jsx as w}from"react/jsx-runtime";var h="alwith-chat:find";function zi(t){window.dispatchEvent(new CustomEvent(h,{detail:t}))}function lt({sessionId:t,rootRef:p}){let{host:v,client:a}=e(),{t:l}=v,u=E(X.subscribe,X.getState,X.getState),y=s(()=>p.current?.querySelector("[data-chat-scroll]")??null,[p]),m=s((r)=>u.sessionId===t?cn(u.turns,r,u.terminals):[],[u,t]),S=s((r,i)=>Xn(t,r,i),[t]),b=s(async(r)=>{await a.loadHistoryNavigation(t);let i=a.state.historyNavigation[t];for(let n of i?.turns??[]){if(r.aborted)return;if(!a.state.historyNavigation[t]?.loadedTurnIds.includes(n.turnId))await a.loadHistoryTurn(t,n.turnId)}let c=new Set;while(!r.aborted){let n=a.state.historyPages[t]?.cursor;if(n==null)return;if(c.has(n))throw Error("Chat history pagination returned a repeated cursor");c.add(n),await a.loadOlderHistory(t)}},[a,t]),{subscribeSearch:f,shouldOpenSearch:d}=v,g=s((r)=>{let i=(o)=>{if((o.metaKey||o.ctrlKey)&&!o.altKey&&!o.shiftKey&&o.key.toLowerCase()==="f"){if(d&&!d(o))return;o.preventDefault(),r()}},c=(o)=>{if(o.detail===t)r()};window.addEventListener("keydown",i),window.addEventListener(h,c);let n=f?.(r);return()=>{window.removeEventListener("keydown",i),window.removeEventListener(h,c),n?.()}},[f,d,t]);return w("div",{className:"absolute inset-x-0 top-0 z-30",children:w(vo,{placement:"body",getViewport:y,findSourceMatches:m,revealTurn:S,prepareSource:b,subscribeOpen:g,labels:{search:l("conversation.search.label"),placeholder:l("conversation.search.placeholder"),previous:l("conversation.search.previous"),next:l("conversation.search.next")}},t)})}
|
|
2
|
+
export{zi,lt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{s}from"./chunk-80ckz04b.js";import{Qt}from"./chunk-nxp1b8ny.js";import{T}from"./chunk-8jxcdap5.js";import{Zt,ye}from"./chunk-5nc3dtyt.js";import{Input as x}from"@nyssance/shadcn/vega/components/ui/input";import{Separator as H}from"@nyssance/shadcn/vega/components/ui/separator";import{formatDistanceToNowStrict as L}from"date-fns";import{enUS as z,zhCN as E}from"date-fns/locale";import{ClockIcon as A,MessageSquareIcon as D}from"lucide-react";import{useEffect as g,useState as w}from"react";import{jsx as o,jsxs as h,Fragment as M}from"react/jsx-runtime";var S={en:z,"zh-CN":E};function ot(t,a){let r=a==="zh-CN"?S["zh-CN"]:S.en;return L(new Date(t),{locale:r})}function ve({sessionRow:t,actions:a,shortcut:r,renaming:n=!1,onRename:m}){let{t:i,i18n:C,PathAction:u}=s(),f=ye(),y=Zt();g(()=>{f(n)},[n,f]);let[I,p]=w(t.title??"");g(()=>{if(n)p(t.title??"")},[n,t.title]);let d=(e)=>{let c=e.trim();m?.(c!==""&&c!==t.title?c:null)},N=t.archived?i("sessionList.archived"):t.updatedAt!==null?ot(t.updatedAt,C.language):null,v=[];if(N!==null)v.push({icon:o(A,{className:"size-3.5"}),text:N});let l=u&&o(u,{cwd:t.cwd,onOpened:y});return o(Qt,{title:n?o(x,{autoFocus:!0,value:I,className:"h-7 text-sm","aria-label":i("sessionList.rename"),onChange:(e)=>p(e.target.value),onKeyDown:(e)=>{if(e.stopPropagation(),e.key==="Enter")d(e.target.value);if(e.key==="Escape")m?.(null)},onBlur:(e)=>d(e.target.value)}):h("span",{className:"flex items-center gap-2",children:[o("span",{className:"min-w-0",children:o(T,{className:"min-w-0 flex-1",children:t.title??i("sessionList.untitled")})}),r]}),titleIcon:o(D,{className:"size-3.5"}),details:v,actions:l||a!==void 0?h(M,{children:[l,l&&a!==void 0&&o(H,{}),a]}):void 0})}
|
|
2
|
+
export{ot,ve};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n}from"./chunk-ye9tsdhn.js";import{e}from"./chunk-f3924gdb.js";import{Ae,Xe,me}from"./chunk-p4bb313p.js";import{Oe}from"./chunk-t97yjy4f.js";import{inSessionTree as c}from"@nyssance/codex-acp-v2/client";import{jsx as o,jsxs as u,Fragment as x}from"react/jsx-runtime";var p=[];function st({sessionId:s}){let i=n((t)=>t.sessions),{host:f}=e(),a=n((t)=>t.actions),d=a.some((t)=>c(i,s,t.sessionId))?a.filter((t)=>c(i,s,t.sessionId)):p,r=d.filter(Ae).filter((t)=>{if(t.sessionId!==s||i[s]?.subagent!==void 0)return!0;let l=t.params._meta?.codex;return!(typeof l==="object"&&l!==null&&("delivery"in l)&&l.delivery==="async")}),m=d.filter((t)=>!Ae(t));return u(x,{children:[o("div",{className:"mx-auto max-h-[50vh] w-full max-w-3xl shrink-0 overflow-y-auto px-3","data-subagent-shelf":!0,children:o(Oe,{sessionId:s})}),m.length>0&&o("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-3 px-6 pb-3","data-session-actions":!0,children:m.map((t)=>u("div",{children:[t.sessionId!==s&&o("p",{className:"text-muted-foreground mb-1 truncate text-xs",children:t.sessionId===null?"":i[t.sessionId]?.title??f.t("subagents.untitled")}),o(me,{action:t})]},t.id))}),r[0]!==void 0&&o(Xe,{action:r[0],total:r.length},r[0].id)]})}
|
|
2
|
+
export{st};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Button as i}from"@nyssance/shadcn/vega/components/ui/button";import{Input as v}from"@nyssance/shadcn/vega/components/ui/input";import{cn as h}from"cn";import{ChevronDownIcon as g,ChevronUpIcon as b,XIcon as z}from"lucide-react";import{useEffect as B,useImperativeHandle as N,useRef as E}from"react";import{jsx as t,jsxs as k}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{Button as i}from"@nyssance/shadcn/vega/components/ui/button";import{Input as v}from"@nyssance/shadcn/vega/components/ui/input";import{cn as h}from"cn";import{ChevronDownIcon as g,ChevronUpIcon as b,XIcon as z}from"lucide-react";import{useEffect as B,useImperativeHandle as N,useRef as E}from"react";import{jsx as t,jsxs as k}from"react/jsx-runtime";function xo({ref:f,value:r,onChange:p,onFind:o,onClose:s,placeholder:d,autoFocusOpen:a=!0,prevTitle:l,nextTitle:c,className:m}){let n=E(null);N(f,()=>{if(n.current===null)throw Error("FindBar input is not mounted");return n.current},[]),B(()=>{if(!a)return;let e=n.current;if(e===null)throw Error("FindBar input is not mounted");e.focus({preventScroll:!0}),e.select()},[a]);let u=!r;return k("div",{className:h("border-border flex h-9 shrink-0 items-center gap-1 border-b px-2",m),children:[t(v,{ref:n,value:r,onChange:(e)=>p(e.target.value),placeholder:d,className:"h-7 text-xs",onKeyDown:(e)=>{if(e.key==="Escape"){e.preventDefault(),s();return}if(e.key==="Enter"){if(e.preventDefault(),r)o(e.shiftKey)}}}),t(i,{size:"icon",variant:"ghost",className:"size-6",disabled:u,onClick:()=>o(!0),title:l?`${l} (⇧↵)`:"⇧↵",children:t(b,{className:"size-3.5"})}),t(i,{size:"icon",variant:"ghost",className:"size-6",disabled:u,onClick:()=>o(!1),title:c?`${c} (↵)`:"↵",children:t(g,{className:"size-3.5"})}),t(i,{size:"icon",variant:"ghost",className:"size-6",onClick:s,title:"Esc",children:t(z,{className:"size-3.5"})})]})}
|
|
2
|
+
export{xo};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{S}from"./chunk-8w22ck92.js";import{s,u}from"./chunk-80ckz04b.js";import{P,g}from"./chunk-5nc3dtyt.js";import{GlobeIcon as b,LogOutIcon as x}from"lucide-react";import{useState as M}from"react";import{Avatar as A,AvatarFallback as N,AvatarImage as y}from"@nyssance/shadcn/vega/components/ui/avatar";import{DropdownMenu as h,DropdownMenuContent as C,DropdownMenuGroup as i,DropdownMenuItem as L,DropdownMenuLabel as I,DropdownMenuRadioGroup as O,DropdownMenuRadioItem as G,DropdownMenuSeparator as c,DropdownMenuSub as k,DropdownMenuSubContent as R,DropdownMenuSubTrigger as T,DropdownMenuTrigger as U}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as n}from"react/jsx-runtime";function br(e){return o(i,{...e})}function Cr(e){return o(c,{...e})}function Ii({className:e,...r}){return o(L,{className:["h-[var(--navigation-row-height,30px)] py-0 [&_svg]:text-muted-foreground",e].filter(Boolean).join(" "),...r})}function wr({languages:e,value:r,onChange:p}){let a=s();return n(k,{children:[n(T,{className:"h-[var(--navigation-row-height,30px)] py-0",children:[o(b,{className:"text-muted-foreground"}),a.t("sessionList.language")]}),o(R,{children:o(O,{value:r,onValueChange:(t)=>void u(a,Promise.resolve(p(t))),children:e.map((t)=>o(G,{value:t.code,children:t.label},t.code))})})]})}function kr({user:e,children:r,onSignOut:p,busy:a=!1}){let t=s(),{t:w}=t,[d,v]=M(!1),[D,m]=M(!1);S(d);let l=a||D,f=n(A,{className:"size-[18px] after:border-0",children:[o(y,{src:e.avatar??void 0,alt:""}),o(N,{className:"bg-primary text-primary-foreground text-xs",children:[...e.name].slice(0,2).join("").toLocaleUpperCase()})]});return n(h,{open:d,onOpenChange:v,children:[n(U,{render:o(g,{disabled:l,className:"text-muted-foreground hover:bg-foreground/8 data-popup-open:bg-foreground/5 font-normal"}),children:[o(P,{children:f}),o("span",{className:"min-w-0 truncate",children:e.name})]}),n(C,{side:"top",align:"start",sideOffset:8,className:"w-[calc(var(--anchor-width)+36px)]",children:[n(i,{children:[n(I,{className:"text-popover-foreground flex items-center gap-2 px-2 py-2 text-sm font-medium",children:[f,n("span",{className:"min-w-0 flex-1",children:[o("span",{className:"block truncate",children:e.name}),o("span",{className:"text-muted-foreground mt-0.5 block truncate text-xs font-normal",children:e.email})]})]}),o(c,{})]}),r,r!=null&&o(c,{}),o(i,{children:n(Ii,{disabled:l,onClick:()=>{m(!0),u(t,p()).finally(()=>m(!1))},children:[o(x,{}),w("sessionList.signOut")]})})]})]})}
|
|
2
|
+
export{br,Cr,Ii,wr,kr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
class s{worker=new Worker(new URL("@alwith/module-chat/code-highlighter.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(i)=>{let e=this.active,t=i.data;if(t.clientId!==e?.clientId||t.revision!==e.revision){this.fail(Error("Code highlighting worker returned an unexpected request"));return}if(this.active=null,!t.ok){this.fail(Error(t.error));return}let r=this.clients.get(e.clientId);if(r?.revision===e.revision)r.onResult({code:e.code,language:e.language,html:t.html});this.dispatch()},this.worker.onerror=(i)=>this.fail(Error(i.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize code highlighting result"))}fail(i){this.failure=i,this.worker.terminate(),this.pending.clear(),this.active=null;for(let e of this.clients.values())e.onError(i)}dispatch(){if(this.active!==null||this.pending.size===0)return;let i=this.pending.values().next().value;this.pending.delete(i.clientId),this.active=i;try{this.worker.postMessage(i)}catch(e){this.fail(e instanceof Error?e:Error(String(e)))}}connect(i,e){if(this.failure!==null)throw this.failure;let t=++this.nextClientId,r={revision:0,onResult:i,onError:e};return this.clients.set(t,r),{update:(o,l)=>{if(this.failure!==null)throw this.failure;r.revision+=1,this.pending.set(t,{clientId:t,revision:r.revision,code:o,language:l}),this.dispatch()},dispose:()=>{if(this.clients.delete(t),this.pending.delete(t),this.clients.size===0)this.worker.terminate(),n=void 0}}}}var n;function
|
|
2
|
-
export{
|
|
1
|
+
class s{worker=new Worker(new URL("@alwith/module-chat/code-highlighter.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(i)=>{let e=this.active,t=i.data;if(t.clientId!==e?.clientId||t.revision!==e.revision){this.fail(Error("Code highlighting worker returned an unexpected request"));return}if(this.active=null,!t.ok){this.fail(Error(t.error));return}let r=this.clients.get(e.clientId);if(r?.revision===e.revision)r.onResult({code:e.code,language:e.language,html:t.html});this.dispatch()},this.worker.onerror=(i)=>this.fail(Error(i.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize code highlighting result"))}fail(i){this.failure=i,this.worker.terminate(),this.pending.clear(),this.active=null;for(let e of this.clients.values())e.onError(i)}dispatch(){if(this.active!==null||this.pending.size===0)return;let i=this.pending.values().next().value;this.pending.delete(i.clientId),this.active=i;try{this.worker.postMessage(i)}catch(e){this.fail(e instanceof Error?e:Error(String(e)))}}connect(i,e){if(this.failure!==null)throw this.failure;let t=++this.nextClientId,r={revision:0,onResult:i,onError:e};return this.clients.set(t,r),{update:(o,l)=>{if(this.failure!==null)throw this.failure;r.revision+=1,this.pending.set(t,{clientId:t,revision:r.revision,code:o,language:l}),this.dispatch()},dispose:()=>{if(this.clients.delete(t),this.pending.delete(t),this.clients.size===0)this.worker.terminate(),n=void 0}}}}var n;function ci(i,e){return n??=new s,n.connect(i,e)}
|
|
2
|
+
export{ci};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function _o(r,e){if(!e.running)return{kind:"idle"};if(e.blocked)return{kind:"waiting"};if(e.retrying)return{kind:"retrying"};let t=r.findLast((i)=>i.kind==="tool"&&i.active);if(t)return{kind:"tool",ownerKey:t.key};let n=r.findLast((i)=>i.kind!=="user");if(n?.active){if(n.kind==="answer")return{kind:"speaking",ownerKey:n.key};if(n.kind==="text")return{kind:"speaking",ownerKey:n.key};if(n.kind==="reasoning")return{kind:"reasoning",ownerKey:n.key};if(n.kind==="plan")return{kind:"planning",ownerKey:n.key};if(n.kind==="compaction")return{kind:"tool",ownerKey:n.key}}if(n?.kind==="answer")return{kind:"idle"};return{kind:"working",ownerKey:n?.key}}
|
|
2
|
+
export{_o};
|
|
@@ -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 Zn(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{Zn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function vn(r){if(!r.trimStart().toLowerCase().startsWith("gpt"))return r;let a=/^gpt-\d/iu.test(r.trimStart())?" ":"-";return r.split(/(\s+)/).map((i)=>i.trim().length===0?i:i.split("-").map((t,o)=>{if(t.toLowerCase()==="gpt")return"GPT";if(t.toLowerCase()==="oai")return"OAI";return o>0&&t.length>0?`${t[0]?.toUpperCase()}${t.slice(1)}`:t}).join(a).replace(/^GPT (?=\d)/u,"GPT-")).join("")}
|
|
2
|
+
export{vn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as f}from"cn";import{jsx as e,jsxs as a,Fragment as v}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{cn as f}from"cn";import{jsx as e,jsxs as a,Fragment as v}from"react/jsx-runtime";function Qt({title:r,titleIcon:t,body:o,rows:d,details:n,actions:s}){return a("div",{"data-slot":"hover-info-card",className:"flex flex-col gap-1.5",children:[a("div",{"data-slot":"hover-info-card-summary",className:"flex min-w-0 flex-col gap-1",children:[a("div",{"data-slot":"hover-info-card-title-row",className:"flex min-w-0 items-center gap-1.5",children:[t!=null&&e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t}),e("div",{"data-slot":"hover-info-card-title",className:"text-foreground line-clamp-2 min-w-0 flex-1 text-sm break-words",children:r})]}),o!=null&&e("div",{"data-slot":"hover-info-card-body",className:"text-muted-foreground line-clamp-2 text-xs break-words",children:o}),e(i,{rows:d})]}),n!=null&&n.length>0&&e("div",{"data-slot":"hover-info-card-details",className:"flex min-w-0 flex-col gap-1.5",children:e(i,{rows:n})}),s!=null&&a(v,{children:[e("div",{"data-slot":"hover-info-card-separator",className:"bg-border -mx-3 mt-1.5 h-px"}),e("div",{"data-slot":"hover-info-card-actions",className:"-mx-1 flex flex-col",children:s})]})]})}function i({rows:r}){return r?.map((t,o)=>a("div",{"data-slot":"hover-info-card-row",className:"text-muted-foreground flex items-start gap-1.5 text-xs",children:[e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t.icon}),e("span",{className:"min-w-0 break-all",children:t.text})]},o))}function A({icon:r,label:t,trailing:o,disabled:d,onClick:n,variant:s="default",className:l,...c}){return a("button",{...c,"data-slot":"hover-info-card-action","data-variant":s,type:"button",disabled:d,onClick:n,className:f("text-foreground hover:bg-foreground/5 active:bg-foreground/10 flex h-8 w-full items-center gap-2 rounded-sm px-2 text-start text-sm font-normal disabled:pointer-events-none disabled:opacity-50","[&_svg]:size-4 [&_svg]:shrink-0",s==="destructive"?"text-destructive [&_svg]:text-destructive":"[&_svg]:text-muted-foreground",l),children:[r,e("span",{className:"min-w-0 flex-1 truncate",children:t}),o]})}
|
|
2
|
+
export{Qt,A};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)}function T({subject:t,requestTitle:o}){let{host:s}=e();if(!b(t))return null;let r=t.toolCall,l=A(r),i=v(r),c=R(r),p=s.toolTitle?.(r)??r.title;return m("div",{className:"flex flex-col gap-2",children:[p&&p!==o&&l===null&&a("div",{className:"text-sm font-medium",children:p}),l!==null&&m("pre",{className:"bg-muted overflow-x-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:[a("span",{className:"text-muted-foreground select-none",children:"$ "}),l]}),i!==null&&a("div",{className:"max-h-80 overflow-auto rounded-lg border","data-stream-style":"codexUI",children:a(
|
|
3
|
-
export{
|
|
1
|
+
import{vi}from"./chunk-42hkbpey.js";import{yi}from"./chunk-9sq2etjk.js";import{bi}from"./chunk-k7k6qsqh.js";import{Je}from"./chunk-xf36kt74.js";import{n}from"./chunk-ye9tsdhn.js";import{e}from"./chunk-f3924gdb.js";import{isContentEntry as f,isDiffEntry as g,isFormElicitation as x,isText as h,isToolCallSubject as b,isUrlElicitation as w}from"@nyssance/codex-acp-v2/client";import{jsx as a,jsxs as m}from"react/jsx-runtime";function Ae(t){return t.kind==="elicitation"&&x(t.params)}function y(t){let o=t._meta?.codex;if(typeof o!=="object"||o===null)return null;let s=o.description;return typeof s==="string"?s:null}function A(t){let o=t.rawInput;if(typeof o!=="object"||o===null)return null;let s=o.command;if(typeof s==="string")return s;if(Array.isArray(s))return s.map(String).join(" ");return null}function v(t){for(let o of t.content??[])if(g(o)&&o.patch&&o.patch.text.length>0)return o.patch.text;return null}function R(t){return(t.content??[]).filter(f).map((o)=>h(o.content)?o.content.text:"").filter((o)=>o.length>0).join(`
|
|
2
|
+
`)}function T({subject:t,requestTitle:o}){let{host:s}=e();if(!b(t))return null;let r=t.toolCall,l=A(r),i=v(r),c=R(r),p=s.toolTitle?.(r)??r.title;return m("div",{className:"flex flex-col gap-2",children:[p&&p!==o&&l===null&&a("div",{className:"text-sm font-medium",children:p}),l!==null&&m("pre",{className:"bg-muted overflow-x-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:[a("span",{className:"text-muted-foreground select-none",children:"$ "}),l]}),i!==null&&a("div",{className:"max-h-80 overflow-auto rounded-lg border","data-stream-style":"codexUI",children:a(Je,{patch:i,theme:s.theme})}),i===null&&l===null&&c.length>0&&a("pre",{className:"bg-muted max-h-60 overflow-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:c}),(r.locations??[]).length>0&&a("ul",{className:"text-muted-foreground flex flex-col gap-0.5 text-xs",children:(r.locations??[]).map((u)=>a("li",{className:"truncate font-mono",children:u.path},`${u.path}:${u.line??""}`))})]})}function d(t,o){let{host:s,client:r}=e();return(l)=>{try{if(o)o(t.id,l);else r.respond(t.id,l)}catch(i){if(s.reportError)s.reportError(i);else console.error(i)}}}function C({action:t,total:o,onRespond:s}){let{host:r}=e(),l=d(t,s),i=t.params,c=r.permissionTitle?.(i)??i.title;return m(vi,{requestId:t.id,title:c,alwaysLabel:r.t("approval.always"),autoFocus:"if-idle",total:o,options:i.options.map((p)=>({...p,description:y(p)??void 0})),onRespond:(p)=>l({outcome:p===null?{outcome:"cancelled"}:{outcome:"selected",optionId:p}}),children:[i.description&&a("div",{className:"text-muted-foreground mt-0.5 text-xs",children:i.description}),i.subject&&a(T,{subject:i.subject,requestTitle:c})]})}function Xe({action:t,total:o,onRespond:s}){let{host:r}=e(),l=d(t,s),i=n((c)=>t.sessionId===null?void 0:c.sessions[t.sessionId]);return a(yi,{requestId:t.id,schema:t.params.requestedSchema,message:i?.subagent?`${i.title??r.t("subagents.untitled")}: ${t.params.message}`:t.params.message,total:o,t:r.t,onRespond:l})}function me({action:t,total:o,onRespond:s}){let{host:r}=e(),l=d(t,s);if(t.kind==="permission")return a(C,{action:t,total:o,onRespond:s});if(Ae(t))return a(Xe,{action:t,total:o??1,onRespond:s});let i=t.params;if(!w(i))throw Error("Unsupported elicitation mode");return a(bi,{message:i.message,url:i.url,t:r.t,onOpen:r.openLink,onRespond:(c)=>l(c==="cancel"?{action:"cancel"}:{action:"decline"})})}
|
|
3
|
+
export{Ae,Xe,me};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{we}from"./chunk-xyvqcpjx.js";import{T}from"./chunk-8jxcdap5.js";import{cn as n}from"cn";import{Item as i,ItemActions as D,ItemContent as H,ItemDescription as ne,ItemMedia as O,ItemTitle as a}from"@nyssance/shadcn/vega/components/ui/item";import{jsx as o}from"react/jsx-runtime";function U({className:e,...t}){return o("div",{className:n("flex flex-col px-2",e),...t})}function pe({className:e,size:t="xs",active:m,...r}){return o(i,{size:t,"data-active":m,className:n(we,"data-[active=true]:font-medium",e),...r})}function Mt({className:e,children:t,...m}){return o(a,{className:n("w-full",e),...m,children:o(T,{children:t})})}export{D,H,ne,O,U,pe,Mt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b}from"./chunk-z71pp1mb.js";import{codexMessageError as A,nativeTurnId as m,textOf as S,turns as _}from"@nyssance/codex-acp-v2/client";function Br(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 ao(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=b(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(b(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 so(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)=>!Br(r))},d=new Map(n.map((r,a)=>[r.turnId,a])),u=[],f=[u],p,k=null;for(let r of i.items){let a=m(r),l=d.get(a??"");if(a!==null&&k!==null&&a!==k||l!==void 0&&p!==void 0&&l>p+1)u=[],f.push(u);if(u.push(r),a!==null||r.kind==="user")k=a;if(l!==void 0)p=l}return f.flatMap((r)=>_({...i,items:r})).map((r)=>{let a=r.prompt===null?[]:[r.prompt];for(let c of r.entries)M(c,a,s);let l=a[0];if(l===void 0)throw Error("A turn without items");let I=`turn:${l.kind}:${l.id}`,h=r.endedAt??Math.max(...a.map((c)=>c.at)),y=o.get(I);if(y!==void 0&&K(y.items,a)&&y.endedAt===h)return y;let x={key:I,user:r.prompt,work:[],final:[],errors:[],edits:[],startedAt:r.startedAt??l.at,endedAt:h,replayed:a.every(sn),items:a},v=a.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return a.forEach((c,g)=>j(x,c,g<v,a[g-1])),x})}function K(t,e){return t.length===e.length&&t.every((n,o)=>n===e[o])}function sn(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function J(t){return S(t.content)}function ze(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function ln(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function lo(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 co(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 uo(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(!co(t,e[n-1],o))break;n--}return e[n]?.key}function po(t,e,n){let o=n,s=n;while(o>0&&co(t,e[o-1],e[o]))o--;while(s+1<e.length&&co(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{Br,ao,so,sn,J,ze,ln,lo,co,uo,po};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{te}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{te}from"./chunk-4s6gx750.js";import{t}from"./chunk-ye9tsdhn.js";import{SquareSlashIcon as s}from"lucide-react";import{useRef as l}from"react";import{jsx as r}from"react/jsx-runtime";function On({textareaRef:a,onOpenChange:p,menuOpen:e,disabled:m}){let{t:o}=t(),n=l(!1);return r(te,{"aria-label":o("composer.commands"),title:o("composer.commands"),disabled:m,"aria-pressed":e,onPointerDown:()=>{n.current=e},onClick:()=>{p(!n.current),a.current?.getTextarea()?.focus()},children:r(s,{className:"size-4"})})}
|
|
2
|
+
export{On};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Button as l}from"@nyssance/shadcn/vega/components/ui/button";import{Spinner as u}from"@nyssance/shadcn/vega/components/ui/spinner";import{SquareIcon as c}from"lucide-react";import{useRef as f,useState as p}from"react";import{jsx as r}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{Button as l}from"@nyssance/shadcn/vega/components/ui/button";import{Spinner as u}from"@nyssance/shadcn/vega/components/ui/spinner";import{SquareIcon as c}from"lucide-react";import{useRef as f,useState as p}from"react";import{jsx as r}from"react/jsx-runtime";function he({title:t,onStop:i}){let[o,a]=p(!1),e=f(!1),s=async()=>{if(e.current)return;e.current=!0,a(!0);try{await i()}finally{e.current=!1,a(!1)}};return r(l,{variant:"ghost",size:"icon",className:"size-5",title:t,"aria-label":t,"aria-busy":o,disabled:o,onKeyDown:(n)=>n.stopPropagation(),onClick:(n)=>{n.stopPropagation(),s()},children:o?r(u,{className:"size-3","aria-label":t}):r(c,{className:"size-3 fill-current"})})}
|
|
2
|
+
export{he};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{l,i}from"./chunk-t0cr21e3.js";import{D,H,ne,O,U,pe}from"./chunk-py837qjk.js";import{ue}from"./chunk-j86x2rn0.js";import{v}from"./chunk-r9dt4bs3.js";import{le}from"./chunk-mcjwwxa1.js";import{F,ce}from"./chunk-w6rwngm3.js";import{CheckIcon as V,SparklesIcon as X,XIcon as _}from"lucide-react";import{useDeferredValue as J,useState as y}from"react";import{Button as N}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as K,DialogClose as Q,DialogContent as R,DialogDescription as W,DialogHeader as Y,DialogTitle as Z}from"@nyssance/shadcn/vega/components/ui/dialog";import{ItemTitle as ee}from"@nyssance/shadcn/vega/components/ui/item";import{Spinner as te}from"@nyssance/shadcn/vega/components/ui/spinner";import{Switch as ae}from"@nyssance/shadcn/vega/components/ui/switch";import{Tabs as se,TabsContent as ie,TabsList as oe,TabsTrigger as re}from"@nyssance/shadcn/vega/components/ui/tabs";import{jsx as t,jsxs as n,Fragment as S}from"react/jsx-runtime";function P({skill:c}){let{assetUrl:m}=l(),[u,s]=y(!1),o=c.interface?.iconSmall,h=o&&m?m(o):c.interface?.iconSmallUrl;return t("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:h&&!u?t("img",{src:h,alt:"",onError:()=>s(!0),className:"size-6 rounded object-contain"}):t(X,{className:"text-muted-foreground size-6"})})}function me({skill:c}){let{t:m}=l(),u=i((o)=>o.setSkillEnabled),s=i((o)=>(c.path in o.busySkills));return n("div",{className:"flex items-center gap-2",children:[s&&t(te,{className:"text-muted-foreground size-3.5"}),t(ae,{checked:c.enabled,disabled:s,"aria-label":`${m(c.enabled?"plugins.skills.disable":"plugins.skills.enable")}: ${c.interface?.displayName??c.name}`,onCheckedChange:(o)=>void u(c,o)})]})}function Pt({query:c,ready:m,onOpenPlugin:u}){let{t:s}=l(),o=i((e)=>e.skills),h=i((e)=>e.skillErrors),j=i((e)=>e.loading)||!m,z=i((e)=>e.installed),M=i((e)=>e.skillProjects),[E,L]=y(null),[k,B]=y(!1),[G,C]=y(null),b=J(c.trim().toLowerCase()),r=o.find((e)=>e.path===G),x=z.find(({plugin:e})=>e.id===r?.pluginId),p=o.filter((e)=>[e.name,e.interface?.displayName,e.description,e.shortDescription,e.interface?.shortDescription,e.pluginId].filter(Boolean).join(" ").toLowerCase().includes(b)).toSorted((e,a)=>(e.interface?.displayName??e.name).localeCompare(a.interface?.displayName??a.name)),d=[...["user","system","admin"].flatMap((e)=>{let a=o.filter((f)=>f.scope===e);return a.length?[{id:e,label:s(e==="user"?"plugins.catalog.personal":`plugins.skills.scope.${e}`),paths:new Set(a.map((f)=>f.path)),path:null}]:[]}),...Object.entries(M).flatMap(([e,a])=>{if(!o.some((T)=>T.scope==="repo"&&a.includes(T.path)))return[];let f=e.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)||e;return[{id:`project:${e}`,label:f,paths:new Set(a),path:e}]})],q=d.map((e)=>e.label);for(let e of d)if(e.path&&q.filter((a)=>a===e.label).length>1)e.label=e.path;let g=d.find((e)=>e.id===E)??d[0],w=g?p.filter((e)=>g.paths.has(e.path)):[],A=k||b?p:p.slice(0,6),I=(e)=>t(U,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:e.map((a)=>n(pe,{className:"toolbox-row relative [contain-intrinsic-size:auto_80px] [content-visibility:auto]",children:[t(N,{variant:"ghost",className:"absolute inset-0 z-0 size-full","aria-label":a.interface?.displayName??a.name,onClick:()=>C(a.path)}),t(O,{className:"pointer-events-none relative translate-none! self-center!",children:t(P,{skill:a})}),n(H,{className:"pointer-events-none relative min-w-0",children:[t(ee,{className:"block truncate",children:a.interface?.displayName??a.name}),t(ne,{className:"line-clamp-1",title:a.interface?.shortDescription??a.shortDescription??a.description,children:a.interface?.shortDescription??a.shortDescription??a.description})]}),t(D,{className:"text-muted-foreground pointer-events-none relative",children:a.enabled?t(V,{className:"size-4","aria-label":s("plugins.skills.enabledStatus")}):t("span",{className:"text-xs",children:s("plugins.skills.disabledBadge")})})]},a.path))});return n("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[t(v,{className:"pe-0",viewportClassName:"pe-0",children:n("div",{className:`${F} space-y-8 pt-6`,children:[h.map((e)=>n("p",{role:"alert",className:"text-destructive text-xs break-words",children:[e.path,": ",e.message]},e.path)),j?t(ue,{skills:!0}):n(S,{children:[n("section",{"aria-label":s("plugins.skills.installed"),children:[n("div",{className:"mb-4 flex items-center justify-between gap-3",children:[t("h2",{className:"text-base font-medium",children:s("plugins.skills.installed")}),t("span",{role:"status",className:"text-muted-foreground text-xs",children:s("plugins.catalog.skillCount",{count:p.length})})]}),p.length?I(A):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s(b?"plugins.skills.filteredEmpty":"plugins.skills.empty")}),!b&&p.length>6&&t(N,{variant:"ghost",className:"text-muted-foreground mt-3 max-w-full justify-start","aria-expanded":k,onClick:()=>B((e)=>!e),children:k?s("plugins.sections.showLess"):s("plugins.catalog.showMore",{count:p.length-6})})]}),g&&n(se,{value:g.id,onValueChange:(e)=>{if(typeof e==="string")L(e)},className:"gap-6",children:[t(oe,{"aria-label":s("plugins.catalog.scope"),className:"h-auto max-w-full flex-wrap justify-start gap-2 bg-transparent",children:d.map((e)=>t(re,{value:e.id,title:e.path??e.label,className:"data-active:bg-muted! h-8 flex-none rounded-lg px-3 text-[13px] font-medium shadow-none! after:hidden dark:data-active:border-transparent",children:e.label},e.id))}),d.map((e)=>t(ie,{value:e.id,children:e.id===g.id&&(w.length?I(w):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s("plugins.skills.filteredEmpty")}))},e.id))]})]})]})}),t(K,{open:!!r,onOpenChange:(e)=>{if(!e)C(null)},children:t(R,{showCloseButton:!1,className:ce,children:r&&n(S,{children:[t(le,{path:r.path,renderHeader:(e)=>n(S,{children:[n("div",{className:"flex items-center justify-between gap-4",children:[t(P,{skill:r}),n("div",{className:"flex shrink-0 items-center gap-2",children:[t(me,{skill:r}),e,t(Q,{render:t(N,{variant:"ghost",size:"icon-sm","aria-label":s("plugins.close")}),children:t(_,{})})]})]}),n(Y,{className:"gap-3",children:[t(Z,{className:"text-2xl leading-8 font-semibold break-words",children:r.interface?.displayName??r.name}),t(W,{className:"text-sm leading-6 break-words whitespace-pre-wrap",children:r.description})]})]})},r.path),r.pluginId&&n("div",{className:"text-sm",children:[n("span",{className:"text-muted-foreground",children:[s("plugins.catalog.fromPlugin")," "]}),x?t(N,{variant:"link",className:"h-auto p-0",onClick:()=>{C(null),u(x)},children:x.plugin.interface?.displayName??x.plugin.name}):r.pluginId]})]})})})]})}
|
|
2
|
+
export{Pt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n}from"./chunk-ye9tsdhn.js";import{Kt,e,m}from"./chunk-f3924gdb.js";import{ut}from"./chunk-rekc1q3m.js";import{at}from"./chunk-9g67z1b4.js";import{lt}from"./chunk-myrdfa3s.js";import{ct,dt}from"./chunk-kc5k5e59.js";import{st}from"./chunk-n3xhh6ch.js";import{Alert as C,AlertDescription as N,AlertTitle as h}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as w}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 Ui({host:t,client:c,...s}){let d=z(()=>t.openDiff?t:{...t,openDiff:ct},[t]);return r(Kt,{host:d,client:c,children:[o(I,{...s}),!t.openDiff&&o(dt,{})]})}function I({session:t,header:c,overlay:s,timeline:d,composer:D,readOnlyActions:g,welcome:E,children:T,rootRef:l,search:A=!0}){let{host:p,client:R}=e(),f=B(null),b=(a)=>{if(f.current=a,typeof l==="function")l(a);else if(l)l.current=a},{t:i}=p,v=n((a)=>a.connection==="ready"),y=n((a)=>a.historyPages[t.id]?.error),u=()=>m(p,R.open(t.id,t.cwd)),x=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&&!x&&o(lt,{sessionId:t.id,rootRef:f}),s,v&&!t.attached&&!t.restoring&&!t.readOnly&&o("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:r(C,{children:[o(P,{}),o(h,{children:i("conversation.stopped")}),o(N,{children:o(w,{size:"sm",variant:"outline",onClick:u,children:i("conversation.reconnect")})})]})}),x?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(at,{session:t,timeline:d}),o(st,{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(C,{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(h,{children:i("conversation.readOnlyTitle")}),o(N,{children:i("conversation.readOnlyDescription")}),y&&o("p",{role:"alert",className:"text-destructive break-words",children:y})]})]}),r("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[o(w,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:u,disabled:!v||t.restoring,children:i(t.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),g]})]})}):D??o(ut,{session:t})]}),T]})}
|
|
2
|
+
export{Ui};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ScrollArea as r}from"@base-ui/react/scroll-area";import{cn as o}from"cn";import{useState as u}from"react";import{jsx as e,jsxs as g}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{ScrollArea as r}from"@base-ui/react/scroll-area";import{cn as o}from"cn";import{useState as u}from"react";import{jsx as e,jsxs as g}from"react/jsx-runtime";function v({nativeScroll:f=!1,className:t,viewportClassName:n,viewportRef:i,onScroll:s,viewportProps:a,children:c,...m}){let[p,l]=u(!1);if(f)return e("div",{className:o("relative flex min-h-0 flex-1",t),...m,children:e("div",{ref:i,onScroll:s,...a,className:o("min-h-0 min-w-0 flex-1 overflow-y-auto outline-none",n,a?.className),children:c})});return g(r.Root,{"data-slot":"scroll-area",className:o("relative min-h-0 flex-1 pe-[var(--app-scrollbar-track-size)]",t),...m,children:[e(r.Viewport,{ref:i,onScroll:s,"data-slot":"scroll-area-viewport",...a,className:o("size-full rounded-[inherit] pe-2 outline-none",n,a?.className),children:c}),e(r.Scrollbar,{"data-slot":"scroll-area-scrollbar","data-orientation":"vertical",orientation:"vertical","data-dragging":p?"":void 0,onPointerDownCapture:(d)=>{if(d.button===0)l(!0)},onPointerUpCapture:()=>l(!1),onPointerCancelCapture:()=>l(!1),onLostPointerCapture:()=>l(!1),className:"flex h-full w-[var(--app-scrollbar-track-size)] touch-none px-[var(--app-scrollbar-edge-gap)] select-none",children:e(r.Thumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})}),e(r.Corner,{})]})}
|
|
2
|
+
export{v};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-80ckz04b.js";import{useSyncExternalStore as d}from"react";function De(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)=>De(i,s))),n=t.filter((s)=>e.delete(s));return n.push(...e),n.length===t.length&&n.every((s,r)=>s===t[r])?t:n}var S=new WeakMap;function g(t){return{view:"sessions",activityOrder:c([],t.state),activitySeen:new Map,activityCollapsedGroups:new Set}}function Mn(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 r={get:()=>e,set:s,subscribe:(o)=>(n.add(o),()=>n.delete(o))};return S.set(t,r),r}function Er(t){S.get(t)?.set(g(t))}function Z(t){let i=Mn(a());return d(i.subscribe,()=>t(i.get()),()=>t(i.get()))}function ie(){return Mn(a()).set}function Lr(){let t=Z((e)=>e.view),i=ie();return[t,(e)=>i({view:e})]}
|
|
2
|
+
export{De,Mn,Er,Z,ie,Lr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{n}from"./chunk-ye9tsdhn.js";import{e}from"./chunk-f3924gdb.js";import{p,G}from"./chunk-y7xcync7.js";import{HoverCard as M,HoverCardContent as L,HoverCardTrigger as H}from"@nyssance/shadcn/vega/components/ui/hover-card";import{hasAccount as W,isGroupedSelect as T}from"@nyssance/codex-acp-v2/client";import{cn as F}from"cn";import{useEffect as z,useState as O}from"react";import{jsx as r,jsxs as u}from"react/jsx-runtime";var m=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),A=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),I=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function g(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function U(a,t){let o=Math.min(100,a/t*100),f=o>=90?"text-destructive":o>=70?"text-foreground":"text-muted-foreground";return{pct:o,className:f}}function V(a){let t=p(a.configOptions,"model");return t===void 0?void 0:G(t)}function Ee(a,t){let o=a.windowDurationMins;if(o===null)return t("usage.usage");if(o%1440===0)return t("usage.windowDays",{count:o/1440});return t("usage.windowHours",{count:Math.round(o/60)})}function P(a){let{client:t}=e(),o=n((s)=>a&&s.connection==="ready"&&W(s.agent)),[f,l]=O(null);return z(()=>{if(!o){l(null);return}let s=!0;t.readRateLimits().then((d)=>{if(s)l(d)},()=>{return});let c=t.onRateLimits((d)=>{if(s)l(d)});return()=>{s=!1,c()}},[o,t]),o?f:null}function Dt({session:a}){let{t}=e().host,o=p(a.configOptions,"model"),f=o!==void 0&&(T(o.options)?o.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((y)=>y.value===o.currentValue)):!o.currentValue.startsWith("gateway:")&&o.options.some((i)=>i.value===o.currentValue)),l=P(f),{usage:s,lastTurnUsage:c}=a;if(s===null&&c===null)return null;let d=s&&s.size>0?U(s.used,s.size):null,h=7,b=2*Math.PI*h,N=g(c?.inputTokens),k=g(c?.outputTokens),x=g(c?.cachedReadTokens),w=g(c?.cachedWriteTokens),S=g(c?.totalTokens)||N+k+x+w,R=N+x,C=R>0?A.format(x/R):t("tokens.notAvailable"),D=[[t("tokens.input"),m.format(N)],[t("tokens.output"),m.format(k)],[t("tokens.cachedRead"),m.format(x)],[t("tokens.cachedWrite"),m.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),m.format(S)]],v=V(a);return u(M,{children:[r(H,{delay:100,closeDelay:100,render:u("button",{type:"button",className:F("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",d?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),d!==null&&r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-d.pct/100),transform:"rotate(-90 9 9)"})]}),d!==null&&u("span",{children:[Math.round(d.pct),"%"]})]})}),u(L,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[v!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:v,children:v})}),u("div",{className:"flex flex-col gap-3 p-3",children:[c!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:D.map(([i,y])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:y})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:m.format(s.used),limit:m.format(s.size),percent:I.format(s.used/s.size*100)})})]}),l!==null&&(l.primary!==null||l.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[l.primary,l.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:Ee(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}
|
|
2
|
+
export{Ee,Dt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ni,_}from"./chunk-x2yc5748.js";import{Bo}from"./chunk-vcy5vyp7.js";import{se}from"./chunk-3n47hknp.js";import{jo,$o,Ko,qo,Wo,te}from"./chunk-4s6gx750.js";import{ei,ti}from"./chunk-k5wgf59a.js";import{Cn}from"./chunk-42nhwnbe.js";import{t,n}from"./chunk-ye9tsdhn.js";import{e}from"./chunk-f3924gdb.js";import{Xt}from"./chunk-c9nbavk0.js";import{r,Hn,E,yt}from"./chunk-78s6h7r4.js";import{pt}from"./chunk-23rjsm3a.js";import{ke,ht}from"./chunk-g242n3dt.js";import{xt,Ct}from"./chunk-cg8ekwka.js";import{Rn}from"./chunk-33620ca6.js";import{gt}from"./chunk-40bcp4pa.js";import{Fn}from"./chunk-memvzzc6.js";import{mt}from"./chunk-xktybk48.js";import{ft}from"./chunk-h1bhhqtq.js";import{On}from"./chunk-qjhkzdhm.js";import{Ln}from"./chunk-0gy6ngda.js";import{Dt}from"./chunk-rcbb4ke2.js";import{hasFuzzyFileSearch as kt}from"@nyssance/codex-acp-v2/client";import{PlusIcon as Bt}from"lucide-react";import{useCallback as O,useEffect as _t,useLayoutEffect as J,useMemo as Q,useRef as Y,useState as S}from"react";import{jsx as c,jsxs as w}from"react/jsx-runtime";var Lt=["image/png","image/jpeg","image/webp","image/gif"],Z=[];async function zt(o){let d=await(await fetch(o.url)).blob();return new Promise((l,C)=>{let I=new FileReader;I.onerror=()=>C(I.error),I.onload=()=>{let L=I.result;l(L.slice(L.indexOf(",")+1))},I.readAsDataURL(d)})}function Ut(o){let{t:d}=t(),l=_();return c(te,{"aria-label":d("composer.attachImage"),title:d("composer.attachImage"),onClick:()=>l.openFileDialog(),...o,children:c(Bt,{className:"size-4"})})}function ut({session:o,onSubmit:d,onShellCommand:l,onHandOff:C,modelSelector:I,modelMenu:L,inputHeader:tt,actions:bt,children:vt,attachmentPolicy:wt,predictions:It=!0,disabled:Tt=!1,preparing:et=!1,allowPendingInput:At=!1}){let{host:F,client:R}=e(),{t:p}=F,k=O((a)=>{if(F.reportError)F.reportError(a);else console.error(a)},[F]),[rt,D]=S(()=>({text:r.get(o.id)?.text??"",revision:0})),{text:P}=rt,[T,Mt]=S(()=>r.get(o.id)?.attachments??Z),[u,z]=S(()=>r.get(o.id)?.mentions??[]),V=T.some((a)=>ke(a)&&a.pastedText.status!=="ready"),[A,nt]=S(!1),[U,Et]=S(!1),[X,ot]=S(!1),f=Y(null),at=Y(null),i=Y(rt),W=O((a)=>{at.current?.(),i.current={text:a,revision:i.current.revision+1},D(i.current)},[]),it=Q(()=>({read:()=>{let s=f.current?.getTextarea(),g=s===null||s===void 0?[i.current.text.length,i.current.text.length]:[s.selectionStart,s.selectionEnd];return{target:o.id,...i.current,selection:g}},compareAndSet(s,g,M){if(s.target!==o.id||s.revision!==i.current.revision)return null;i.current={text:g,revision:i.current.revision+1},D(i.current);let x=f.current?.getTextarea();if(x!==null&&x!==void 0)x.value=g,x.setSelectionRange(M[0],M[1]);return{target:o.id,...i.current,selection:M}}}),[o.id]),B=Y(null),ct=O((a)=>(B.current=a,()=>{if(B.current===a)B.current=null}),[]),j=o.state!=="idle",b=l!==void 0&&P.startsWith("!"),h=!Tt&&!et&&o.attached&&!o.restoring&&!o.readOnly,N=!o.readOnly&&(At||h),H=ft(o,h&&!A&&!U&&!V&&!X,P.length>0||T.length>0||u.length>0,It&&!b),st=H.invalidate;J(()=>{r.set(o.id,{text:P,attachments:T,mentions:u,modelId:r.get(o.id)?.modelId??null})},[o.id,P,T,u]),J(()=>Hn(o.id,Mt),[o.id]),J(()=>yt(o.id,(a)=>{if(!N||A)throw Error("The composer cannot take text now; try again later");if(P.length||T.length||u.length)throw Error("The composer already has a draft; send or clear it first");W(a)}),[o.id,N,A,P,T,u,W]);let lt=n((a)=>kt(a.agent)),Rt=Q(()=>lt&&h?async(a)=>pt((await R.fuzzyFileSearch({query:a,roots:[o.cwd]})).files):void 0,[R,lt,h,o.cwd]),q=O((a)=>{z((s)=>s.includes(a)?s:[...s,a])},[]);_t(()=>{f.current?.focus()},[]);let dt=O(async({text:a,files:s})=>{let g=l!==void 0&&a.startsWith("!")?a.slice(1):null;if(g!==null){if(g.trim().length===0)return;if(s.length||u.length)throw Error("Shell commands cannot include file references or attachments");if(o.state!=="idle")throw Error("Wait for the current turn before running a shell command")}let M=a.trim();if(M.length===0&&s.length===0&&u.length===0)return;let x=B.current;nt(!0);let v=r.get(o.id),Ft=i.current.revision,K=null;try{let y=[];for(let m of u){let G={kind:"file",absPath:m};y.push({type:"resource_link",uri:xt(G),name:Ct(G)})}if(M.length>0)y.push({type:"text",text:M});for(let m of s)if(ke(m)){if(m.pastedText.status!=="ready")throw Error("Text attachment is not ready");y.push({type:"resource_link",uri:m.url,name:m.filename??"pasted-text.txt"})}else y.push({type:"image",data:await zt(m),mimeType:m.mediaType});if(i.current.revision===Ft&&r.get(o.id)===v)i.current={text:"",revision:i.current.revision+1},K=i.current.revision,D(i.current),z([]),E(o.id,()=>Z),r.set(o.id,{text:"",attachments:Z,mentions:[],modelId:v?.modelId??null}),f.current?.resetHeight();if(g!==null&&l)await l(g);else if(d)if(x===null)await d(y);else await d(y,(m)=>{if(x.signal.aborted||B.current!==x)return;x.accept(m),C?.(o.id,m)});else if(x===null)await R.prompt(o.id,y);else{let m=await R.prompt(o.id,y);x.accept(m)}st();for(let m of v?.attachments??[])if(m.url.startsWith("blob:")&&!r.get(o.id)?.attachments.some((G)=>G.id===m.id))URL.revokeObjectURL(m.url)}catch(y){if(v&&K!==null&&i.current.revision===K&&r.get(o.id)?.attachments.length===0&&r.get(o.id)?.mentions.length===0)i.current={text:v.text,revision:K+1},D(i.current),z(v.mentions),r.set(o.id,v),E(o.id,()=>v.attachments);throw y}finally{nt(!1),f.current?.focus()}},[R,o.id,o.state,u,d,l,C,st]),Nt=()=>{R.cancel(o.id).catch(k)},Ot=O((a)=>{let s=a.code==="max_total_size"?Object.assign(Error(p("composer.imageTooLargeTitle")),{description:p("composer.imageTooLargeDescription",{mb:se})}):Object.assign(Error(p("composer.unsupportedAttachmentTitle")),{description:p("composer.unsupportedAttachmentDescription")});k(s)},[k,p]),St=Q(()=>({session:o,ready:h,inputReady:N,sending:A,textareaRef:f,draft:it,interruptRef:at,observeReceipts:ct,addMention:q,setAdding:Et,shellMode:b,handsFree:!b&&(d===void 0||C!==void 0)}),[o,h,N,A,it,ct,q,d,C,b]),Pt=F.writeTextAttachment;return c(Xt,{value:St,children:c("div",{"data-chat-drop-zone":!0,className:"mx-auto w-full max-w-3xl px-6 pb-5",children:w("div",{className:"relative",children:[tt&&c("div",{"data-chat-input-header":!0,className:"bg-sidebar dark:bg-foreground/3 relative top-1 z-0 mx-[13px] -mb-[18px] flex min-w-0 items-center gap-2 overflow-hidden rounded-t-2xl px-1.5 pt-1.5 pb-[27px]",children:tt}),w(ni,{attachmentPolicy:wt,value:P,revision:i.current.revision,onValueChange:W,onSubmittedClear:()=>{i.current={text:"",revision:i.current.revision+1},D(i.current)},attachments:T,onAttachmentsChange:(a)=>E(o.id,()=>a),children:[c(Bo,{bashMode:l!==void 0,handleRef:f,commands:o.commands,searchFiles:Rt,onMention:q,onSearchError:k,forcedOpen:X,onForcedOpenChange:ot,emptyLabel:p("composer.noCommands"),fileStatusLabels:{loading:p("composer.searchingFiles"),empty:p("composer.noMatchingFiles")}}),w(jo,{"data-shell-mode":b||void 0,bashMode:l!==void 0,globalDrop:!0,multiple:!0,accept:Lt.join(","),onError:Ot,onSubmit:dt,onSubmitAsync:dt,onSubmitError:k,canSubmit:()=>h&&!A&&!U&&!V&&(!b||!j&&P.slice(1).trim().length>0)?!0:"chat_not_ready",className:"relative z-10",children:[vt,w(Ko,{className:"px-3 pt-3 pb-0 empty:hidden",children:[U&&c("span",{role:"status",className:"text-muted-foreground text-xs",children:p("composer.addingFiles")}),c(Rn,{mentions:u,onRemove:(a)=>z((s)=>s.filter((g)=>g!==a))}),c(ti,{children:(a)=>ke(a)?c(Fn,{data:a,sessionId:o.id}):c(ei,{data:a,t:p})})]}),w($o,{className:"mb-0 min-h-16 px-3 pt-4 pb-2",onKeyDownCapture:(a)=>{if(!H.text||f.current?.isComposing()||a.nativeEvent.isComposing||a.nativeEvent.keyCode===229||a.shiftKey||a.ctrlKey||a.altKey||a.metaKey||a.target!==f.current?.getTextarea())return;if(a.key==="Tab")a.preventDefault(),a.stopPropagation(),W(H.text)},children:[b&&c("span",{"data-shell-prefix":!0,"aria-hidden":"true",className:"text-destructive self-start pt-0.5 text-sm",children:"❗"}),c(Cn,{className:"min-h-10 bg-transparent text-sm font-normal",ref:f,rows:2,bashMode:l!==void 0,disabled:!N,onPasteCapture:Pt?(a)=>ht(a,o.id,p("composer.pastedTextFilename"),Pt):void 0,placeholder:b?"! command":H.text||(j?p("composer.steerPlaceholder"):p("composer.placeholder")),"aria-label":p("composer.placeholder")})]}),c(qo,{className:"chat-composer-toolbar @container/input-footer mt-0 mb-2 w-full min-w-0 p-0",children:w("div",{className:"grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-[5px] px-2",children:[w("div",{className:"flex min-w-0 items-center gap-[5px]",children:[c(Ut,{className:"text-foreground",disabled:!N}),c(On,{textareaRef:f,menuOpen:X,onOpenChange:ot,disabled:!h||o.commands.length===0}),c(mt,{sessionId:o.id,options:o.configOptions,disabled:!h})]}),w(Wo,{className:"w-full min-w-0 items-center justify-end gap-1",children:[c(Dt,{session:o}),I??c(gt,{...L,sessionId:o.id,options:o.configOptions,disabled:!h}),bt,c(Ln,{active:j,sending:A||et||U,ready:h&&!V&&(!b||!j&&P.slice(1).trim().length>0),hasMentions:u.length>0,onStop:Nt})]})]})})]})]})]})})})}
|
|
2
|
+
export{ut};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createStore as r}from"@alwith/api/client";var X=r({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}});function Qn(e){X.setState({...e,terminals:e.terminals??{}})}function Yn(e){if(X.getState().sessionId===e)X.setState({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}})}async function Xn(e,n,t){let i=X.getState();if(t.aborted||e===null||i.sessionId!==e||i.api===null)return;if(i.beforeReveal===null)throw Error("Mounted timeline has no navigation lifecycle");i.beforeReveal(),await i.api.scrollToKey(n,void 0,{align:"top"})}
|
|
2
|
+
export{X,Qn,Yn,Xn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{dn}from"./chunk-85ffkcch.js";async function yo(i,c){let s=new WeakSet;while(!c.aborted){let r=Array.from(i.querySelectorAll('[data-codex-disclosure][aria-expanded="false"]')).filter((e)=>!s.has(e)&&!e.matches(":disabled"));for(let e of r)s.add(e),e.click();if(r.length===0&&i.querySelector("[data-markdown-pending]")===null)return;await new Promise((e)=>requestAnimationFrame(()=>e()))}}function Ve(i,c){if(!c)return[];let s=[],r="",e=[],o=()=>{let t=0,n=0;for(let{start:a,end:l}of dn(r,c)){while(t<e.length&&e[t].end<=a)t++;n=Math.max(n,t);while(n<e.length&&e[n].end<l)n++;let d=e[t],f=e[n];if(!d||!f)throw Error("Search text offset has no DOM node");let h=document.createRange();h.setStart(d.node,a-d.start),h.setEnd(f.node,l-f.start),s.push(h)}r="",e=[]},m=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),u=(t)=>{if(t.nodeType===Node.TEXT_NODE){let a=t.parentElement;if(!a||a.offsetParent===null&&a.tagName!=="BODY")return;let l=t.nodeValue??"";e.push({node:t,start:r.length,end:r.length+l.length}),r+=l;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){o();return}if(t.tagName==="BR"){o();return}let n=m.has(t.tagName);if(n)o();for(let a of t.childNodes)u(a);if(n)o()};return u(i),o(),s}
|
|
2
|
+
export{yo,Ve};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useCallback as f,useState as r}from"react";var t=new Map;function
|
|
2
|
-
export{
|
|
1
|
+
import{useCallback as f,useState as r}from"react";var t=new Map;function R(o,e,a=!1){let[p,S]=r(()=>({key:o,expanded:t.get(o)??e})),n=p.expanded;if(p.key!==o||a&&!t.has(o)&&n!==e)n=t.get(o)??e,S({key:o,expanded:n});let k=f((c)=>{S((s)=>{let b=s.key===o?s.expanded:t.get(o)??e,d=typeof c==="function"?c(b):c;return t.set(o,d),s.key===o?{key:o,expanded:d}:s})},[o,e]);return[n,k]}
|
|
2
|
+
export{R};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d}from"./chunk-xyvqcpjx.js";import{a,o}from"./chunk-80ckz04b.js";import{k,P,g,W}from"./chunk-5nc3dtyt.js";import{x,Y,Vn}from"./chunk-52p7kyam.js";import{Ue}from"./chunk-c38t8809.js";import{I,V}from"./chunk-00eytt1z.js";import{re,Q}from"./chunk-vs02ry2r.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 ce,verticalListSortingStrategy as oe}from"@dnd-kit/sortable";import{CSS as de}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 se,DialogTitle as ae}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as Ee,DropdownMenuContent as ke,DropdownMenuGroup as Le,DropdownMenuItem as z,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 s,Fragment as ze}from"react/jsx-runtime";function Te({collectionId:l,sessionId:C,children:b}){let{attributes:w,listeners:v,setNodeRef:i,transform:p,transition:u,isDragging:M}=ce({id:JSON.stringify([l,C]),data:{type:"session",collectionId:l,sessionId:C}});return e("div",{ref:i,style:{transform:de.Transform.toString(p),transition:u},className:F("w-full min-w-0",M&&"opacity-50"),...w,...v,role:"group",children:b})}function Be({collection:l,children:C,onEdit:b,onConfirm:w,onNewChat:v}){let{t:i}=x(),p=Q(),u=Y(),{attributes:M,listeners:m,setNodeRef:N,transform:T,transition:B,isDragging:K}=ce({id:l.id,disabled:{draggable:l.id===I,droppable:!1},data:{type:"collection"}});return e("div",{ref:N,style:{transform:de.Transform.toString(T),transition:B},className:F("w-full min-w-0",K&&"opacity-50"),children:e(W,{open:!l.collapsed,onOpenChange:(c)=>u(p({type:"collapse",id:l.id,collapsed:!c})),label:V(l,i),count:l.sessionIds.length,leading:l.id===I?e(be,{className:"size-3.5"}):e(Ue,{emoji:l.emoji,onChange:(c)=>u(p({type:"emoji",id:l.id,emoji:c}))}),wrapHeader:(c)=>e("div",{...M,...m,role:"group",children:c}),actions:s(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:V(l,i)}),children:e(Ie,{className:"size-3.5"})})}),e(ke,{children:s(Le,{children:[l.id!==I&&s(z,{onClick:b,children:[e(he,{}),i("collection.rename")]}),s(z,{onClick:v,children:[e(me,{}),i("collection.newChat")]}),s(z,{onClick:()=>w("clear"),children:[e(ve,{}),i("collection.clearCollection")]}),l.id!==I&&s(z,{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 qi({renderRow:l,onSelect:C,onNewChat:b,Scroll:w=He}){let v=x(),{t:i}=v,p=Q(),u=Y(),M=a(),{collections:m,order:N}=re(),T=o((t)=>t.sessionList),B=o((t)=>t.archivedSessions),K=o((t)=>t.sessionListLoaded),c=o((t)=>t.sessionListError),U=Me(()=>new Map([...B,...T].map((t)=>[t.sessionId,t])),[B,T]),_=v.isMac??Vn(),[y,E]=R(null),[L,O]=R(""),[q,j]=R(""),[S,H]=R(null),[f,J]=R(!1),ue=De(Z(Se,{activationConstraint:{distance:5}}),Z(ye,{coordinateGetter:we})),G=N.flatMap((t)=>m[t].collapsed?[]:m[t].sessionIds.flatMap((n)=>{let r=U.get(n);return r&&!r.archived?[r]:[]}));xe(()=>{let t=(n)=>{if(n.defaultPrevented||n.isComposing||n.repeat||n.shiftKey||n.altKey)return;if(_?!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 r=Number(n.key)-1;if(!Number.isInteger(r)||r<0||r>8||!G[r])return;n.preventDefault(),C(G[r])};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[G,_,C]);let ge=({active:t,over:n})=>{if(n===null)return;let r=t.data.current,h=n.data.current;if(r?.type==="session"&&h!==void 0){let X=h.type==="session"?String(h.collectionId):String(n.id);u(p({type:"move",sourceCollectionId:String(r.collectionId),collectionId:X,sessionId:String(r.sessionId),index:h.type==="session"?m[X].sessionIds.indexOf(String(h.sessionId)):void 0}))}else if(r?.type==="collection"&&h?.type==="collection"&&String(n.id)!==I)u(p({type:"reorder",id:String(t.id),index:N.indexOf(String(n.id))}))},A=(t,n)=>{J(!0),u(t.then(n).finally(()=>J(!1)))};return s(ze,{children:[e(w,{children:s(k,{children:[s(g,{className:F(d,"font-normal"),onClick:()=>{E("new"),O(""),j("")},children:[e(P,{children:e(me,{})}),e("span",{children:i("collection.newCollection")})]}),c&&s("div",{className:"text-muted-foreground px-2 text-sm",children:[e("p",{role:"alert",children:c}),e(D,{variant:"ghost",onClick:()=>u(M.listSessions({reset:!0})),children:i("collection.retry")})]}),e(Ce,{sensors:ue,collisionDetection:fe,onDragEnd:ge,children:e(ee,{items:N,strategy:oe,children:e(k,{children:N.map((t)=>e(Be,{collection:m[t],onNewChat:()=>b(t),onEdit:()=>{E(t),O(m[t].name),j(m[t].emoji??"")},onConfirm:(n)=>H({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 r=U.get(n);if(r?.archived)return null;if(!r)return K?s("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(P,{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:()=>u(p({type:"remove",sessionId:n,collectionId:t})),children:e(pe,{})})]},n):null;return e(Te,{collectionId:t,sessionId:n,children:l(r,()=>{},t)},n)})})},t))})})})]})}),e(te,{open:y!==null,onOpenChange:(t)=>{if(!t&&!f)E(null)},children:s(ne,{children:[s(se,{children:[e(ae,{children:i(y==="new"?"collection.newCollection":"collection.rename")}),e(ie,{children:i("collection.collectionName")})]}),s("form",{onSubmit:(t)=>{if(t.preventDefault(),y===null||!L.trim()||f)return;let n=y==="new"?`collection-${crypto.randomUUID()}`:y;A(p([y==="new"?{type:"create",id:n,name:L}:{type:"rename",id:n,name:L},{type:"emoji",id:n,emoji:q}]),()=>E(null))},className:"flex flex-col gap-3",children:[e(Pe,{autoFocus:!0,"aria-label":i("collection.collectionName"),value:L,onChange:(t)=>O(t.target.value),disabled:f}),y!=="new"&&e(Ue,{emoji:q,onChange:j}),s(le,{children:[e(D,{type:"button",variant:"outline",disabled:f,onClick:()=>E(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)H(null)},children:s(ne,{children:[s(se,{children:[e(ae,{children:i(S?.type==="delete"?"collection.deleteCollection":"collection.clearCollection")}),e(ie,{children:i("collection.confirmCollectionChange",{name:S===null?"":V(m[S.id],i)})})]}),s(le,{children:[e(D,{variant:"outline",disabled:f,onClick:()=>H(null),children:i("collection.cancel")}),e(D,{disabled:f,onClick:()=>{if(S!==null)A(p({type:S.type,id:S.id}),()=>H(null))},children:i("collection.confirm")})]})]})})]})}
|
|
2
|
+
export{qi};
|