@alwith/module-chat 0.6.33 → 0.6.35
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/README.md +1 -1
- package/assets/catalogs/deepseek/models.json +4 -66
- package/assets/catalogs/doubao/models.json +92 -0
- package/assets/catalogs/doubao-coding/models.json +92 -0
- package/assets/catalogs/kimi/models.json +84 -0
- package/assets/catalogs/minimax/models.json +79 -0
- package/assets/catalogs/qwen/models.json +10 -201
- package/assets/catalogs/xai/models.json +4 -77
- package/assets/catalogs/zhipu/models.json +83 -0
- package/assets/provider-catalog.json +130 -58
- package/assets/provider-models.v1.json +379 -0
- package/dist/activity-host.d.ts +2 -0
- package/dist/activity-host.js +1 -1
- package/dist/agent/client.d.ts +2 -0
- package/dist/agent/client.js +1 -1
- package/dist/agent/custom-model-effort.d.ts +1 -1
- package/dist/agent/custom-model-effort.js +1 -1
- package/dist/agent/fork-title.js +1 -1
- package/dist/agent/image-request.js +1 -1
- package/dist/agent/image-tools.d.ts +3 -1
- package/dist/agent/image-tools.js +1 -1
- package/dist/agent/input-config.js +1 -1
- package/dist/agent/input-modes/chat.js +1 -1
- package/dist/agent/input-modes/execution-meta.js +1 -1
- package/dist/agent/input-modes/image-context.js +1 -1
- package/dist/agent/input-modes/image.js +1 -1
- package/dist/agent/input-modes/index.js +1 -1
- package/dist/agent/project-path.js +1 -1
- package/dist/agent/request-error.js +1 -1
- package/dist/agent/session-list-refresh.js +1 -1
- package/dist/app-reference.js +1 -1
- package/dist/application-tools.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-1y5zgya3.js → chunk-0sb0c014.js} +2 -2
- package/dist/{chunk-exrt8sd0.js → chunk-0xztk729.js} +2 -2
- package/dist/chunk-18gcnf2a.js +2 -0
- package/dist/{chunk-7r3k37ys.js → chunk-1a46v4cy.js} +2 -2
- package/dist/chunk-1b3frq9c.js +3 -0
- package/dist/{chunk-016v1nnv.js → chunk-1vwece23.js} +6 -6
- package/dist/{chunk-b7ze9dje.js → chunk-20dc4fm0.js} +2 -2
- package/dist/{chunk-pe6ex52z.js → chunk-22nybrkv.js} +5 -5
- package/dist/{chunk-tszqev50.js → chunk-23kvszfc.js} +1 -1
- package/dist/chunk-2nq204hz.js +2 -0
- package/dist/{chunk-pxbr08fz.js → chunk-2nv5ebq1.js} +2 -2
- package/dist/chunk-33fxyn5r.js +2 -0
- package/dist/chunk-359pf448.js +2 -0
- package/dist/{chunk-n8b9yg4q.js → chunk-3knw8e0x.js} +2 -2
- package/dist/{chunk-xjbf9h6m.js → chunk-3kytka7m.js} +3 -3
- package/dist/{chunk-y81242w2.js → chunk-3sq2k9ca.js} +2 -2
- package/dist/{chunk-pe79c1re.js → chunk-3t3n8nfy.js} +2 -2
- package/dist/{chunk-9n8cds8p.js → chunk-3tvq6xr2.js} +2 -2
- package/dist/{chunk-qm0zd4wj.js → chunk-482segb0.js} +2 -2
- package/dist/{chunk-w2z3sxdq.js → chunk-4chmr87g.js} +2 -2
- package/dist/chunk-4g2412p5.js +2 -0
- package/dist/chunk-4ma6bmcm.js +2 -0
- package/dist/{chunk-9b8gnrcb.js → chunk-54jfqcd1.js} +2 -2
- package/dist/chunk-5mxh7h57.js +2 -0
- package/dist/{chunk-2ad4fb9z.js → chunk-5qaa4atv.js} +2 -2
- package/dist/{chunk-f8bx4etj.js → chunk-5zf3px9y.js} +2 -2
- package/dist/chunk-60yk0ye9.js +2 -0
- package/dist/chunk-63kwbtgs.js +2 -0
- package/dist/{chunk-12bfnfbk.js → chunk-67fn9pq0.js} +2 -2
- package/dist/{chunk-yw927w3q.js → chunk-6br4568a.js} +2 -2
- package/dist/{chunk-zyermn00.js → chunk-6c7q2rz8.js} +2 -2
- package/dist/{chunk-pd5yrdg6.js → chunk-6ea6q6dj.js} +2 -2
- package/dist/{chunk-vcj2jfnz.js → chunk-6v0r7m92.js} +2 -2
- package/dist/{chunk-j4w2hbbe.js → chunk-6xap6hvz.js} +2 -2
- package/dist/{chunk-46bgwhx8.js → chunk-7naym98x.js} +2 -2
- package/dist/{chunk-kdcde4s5.js → chunk-7nfv27hz.js} +2 -2
- package/dist/{chunk-djqexpgf.js → chunk-7tgfj1zb.js} +2 -2
- package/dist/{chunk-ypdh88cj.js → chunk-7ywnza68.js} +2 -2
- package/dist/{chunk-51s7qck0.js → chunk-8be6eq9r.js} +2 -2
- package/dist/chunk-8eyw37rv.js +2 -0
- package/dist/{chunk-4z6gyvy3.js → chunk-8pb726d6.js} +2 -2
- package/dist/{chunk-pwk7epmy.js → chunk-8x7a5n2w.js} +2 -2
- package/dist/{chunk-82e3194f.js → chunk-8yetzgqb.js} +2 -2
- package/dist/{chunk-enc99kvz.js → chunk-8zkn8x2j.js} +2 -2
- package/dist/chunk-95f0wens.js +2 -0
- package/dist/{chunk-3dbxzwcz.js → chunk-9ghxym50.js} +2 -2
- package/dist/{chunk-f84mdhkx.js → chunk-9hts7x5n.js} +2 -2
- package/dist/{chunk-basmnv1z.js → chunk-9hwqfjc1.js} +2 -2
- package/dist/{chunk-zhf7403q.js → chunk-9ns2xh84.js} +2 -2
- package/dist/{chunk-vqqafkcx.js → chunk-9nz4c647.js} +2 -2
- package/dist/{chunk-8q5zwkry.js → chunk-a2tkhes5.js} +2 -2
- package/dist/{chunk-jhaf3qtt.js → chunk-a4ebhcsy.js} +2 -2
- package/dist/{chunk-3d3z6dam.js → chunk-aeccrrg1.js} +2 -2
- package/dist/{chunk-y47sn7w2.js → chunk-aemtk0r5.js} +2 -2
- package/dist/{chunk-ky3n1mza.js → chunk-afnnrn6z.js} +2 -2
- package/dist/chunk-aj0z9a5r.js +2 -0
- package/dist/{chunk-p9x6rya1.js → chunk-aj6yxm6d.js} +2 -2
- package/dist/{chunk-9pm3vzgx.js → chunk-aq3hemsb.js} +3 -3
- package/dist/{chunk-rsbced6k.js → chunk-b0zzq2ky.js} +2 -2
- package/dist/{chunk-nf7q3crw.js → chunk-b3mja7d9.js} +3 -3
- package/dist/{chunk-pyqhwz2d.js → chunk-b6kn9ack.js} +3 -3
- package/dist/{chunk-znafsq0a.js → chunk-b8tx1n1a.js} +2 -2
- package/dist/chunk-bdea3k6b.js +2 -0
- package/dist/{chunk-nec3tcjh.js → chunk-bm457bsd.js} +2 -2
- package/dist/chunk-bt42z99s.js +2 -0
- package/dist/{chunk-egbb5295.js → chunk-by7k0ypx.js} +2 -2
- package/dist/{chunk-p6ffd8yn.js → chunk-bysgsnph.js} +2 -2
- package/dist/{chunk-ma6ycen5.js → chunk-c0czkyzh.js} +2 -2
- package/dist/chunk-c70a2esc.js +2 -0
- package/dist/{chunk-enbvjbcm.js → chunk-ccner90h.js} +2 -2
- package/dist/{chunk-x0etjzy8.js → chunk-cgpnhrm5.js} +3 -3
- package/dist/{chunk-7hfd7hnm.js → chunk-chjt1pct.js} +2 -2
- package/dist/{chunk-3eetka54.js → chunk-ck70ewc8.js} +2 -2
- package/dist/{chunk-fpsn6fmf.js → chunk-ckft9abb.js} +2 -2
- package/dist/{chunk-7a806p3q.js → chunk-d0zazfrq.js} +3 -3
- package/dist/{chunk-fy8dmpv3.js → chunk-d607659a.js} +2 -2
- package/dist/{chunk-4hasepkm.js → chunk-d84xx4bh.js} +2 -2
- package/dist/{chunk-x4bzkzbt.js → chunk-db8hae9d.js} +2 -2
- package/dist/chunk-ddaz4j9s.js +2 -0
- package/dist/{chunk-4vfrxhj4.js → chunk-dhx1sd4s.js} +2 -2
- package/dist/{chunk-gh1rtwrb.js → chunk-dzncwejn.js} +2 -2
- package/dist/chunk-e99t3sk5.js +2 -0
- package/dist/{chunk-5p53j8mf.js → chunk-ebkz1sy2.js} +2 -2
- package/dist/chunk-eevfr0tx.js +2 -0
- package/dist/{chunk-7z1k4s4f.js → chunk-enkrqfqq.js} +2 -2
- package/dist/{chunk-rej2s2c0.js → chunk-epqqzh99.js} +2 -2
- package/dist/{chunk-kvwyryw2.js → chunk-epqyjwrh.js} +2 -2
- package/dist/{chunk-e31s069c.js → chunk-evgfpd16.js} +2 -2
- package/dist/chunk-eyw05qyj.js +4 -0
- package/dist/{chunk-15m908ph.js → chunk-f2h074g0.js} +2 -2
- package/dist/{chunk-c531krny.js → chunk-fggwwmzc.js} +3 -3
- package/dist/{chunk-544g9fky.js → chunk-fqchnswc.js} +2 -2
- package/dist/{chunk-cfj92m1y.js → chunk-fvmnj6bg.js} +2 -2
- package/dist/chunk-fxzh4f7c.js +4 -0
- package/dist/chunk-fzfwftqs.js +2 -0
- package/dist/{chunk-kx9nnmwb.js → chunk-g9v0jr0f.js} +3 -3
- package/dist/{chunk-mfrg4vze.js → chunk-ged1nyhk.js} +5 -5
- package/dist/chunk-gk7nn747.js +2 -0
- package/dist/chunk-gmns080g.js +2 -0
- package/dist/chunk-gw4zbw0m.js +2 -0
- package/dist/{chunk-3vdx0cme.js → chunk-gy446wcz.js} +2 -2
- package/dist/chunk-h71pkpwg.js +2 -0
- package/dist/{chunk-3a8qwbgh.js → chunk-ha1s3jbc.js} +3 -3
- package/dist/{chunk-zvfad5gd.js → chunk-hfjttc7r.js} +2 -2
- package/dist/{chunk-e6wq8gef.js → chunk-hqc5c3nz.js} +3 -3
- package/dist/{chunk-r84xcy0d.js → chunk-hwhyyaen.js} +2 -2
- package/dist/{chunk-qmx3t5he.js → chunk-j1t1fnew.js} +2 -2
- package/dist/chunk-j2bp0zbe.js +2 -0
- package/dist/{chunk-tftgnw1w.js → chunk-jne0bc79.js} +2 -2
- package/dist/chunk-jtws1jg5.js +2 -0
- package/dist/{chunk-zmr5pwhd.js → chunk-jygp7479.js} +2 -2
- package/dist/{chunk-5f7t16kj.js → chunk-jz7mckdp.js} +2 -2
- package/dist/{chunk-hpv8x22r.js → chunk-k014w2jg.js} +2 -2
- package/dist/{chunk-rfkgks0a.js → chunk-k0h18sme.js} +2 -2
- package/dist/{chunk-xg6ayxsy.js → chunk-k1w3acq7.js} +2 -2
- package/dist/{chunk-m8243rnx.js → chunk-k5065dzv.js} +2 -2
- package/dist/chunk-k97dpdcj.js +2 -0
- package/dist/{chunk-c4rptwfx.js → chunk-kgx0jj22.js} +3 -3
- package/dist/chunk-khd2r3jh.js +2 -0
- package/dist/{chunk-84zzf0ys.js → chunk-kk9dbwd1.js} +2 -2
- package/dist/chunk-kvgn4b2n.js +2 -0
- package/dist/{chunk-1jznzjzn.js → chunk-mg9a4t04.js} +2 -2
- package/dist/{chunk-kn1j4cy1.js → chunk-mgve4dcw.js} +2 -2
- package/dist/{chunk-akgjyyz8.js → chunk-mgwkmr8g.js} +2 -2
- package/dist/{chunk-qk1yqepm.js → chunk-mhrn3e8j.js} +2 -2
- package/dist/{chunk-705j0x4q.js → chunk-mkawbqx5.js} +2 -2
- package/dist/chunk-mp5f940y.js +1 -0
- package/dist/chunk-mybye5t2.js +2 -0
- package/dist/{chunk-bf7sgpzq.js → chunk-n4rep234.js} +2 -2
- package/dist/{chunk-wbnmcagf.js → chunk-nebke41s.js} +3 -3
- package/dist/{chunk-nqt9gyz9.js → chunk-newkrtrj.js} +2 -2
- package/dist/{chunk-j9f4mh66.js → chunk-nfnejf16.js} +2 -2
- package/dist/{chunk-tss25z64.js → chunk-njw6x85v.js} +3 -3
- package/dist/{chunk-2d4zb2ac.js → chunk-npt6at4f.js} +2 -2
- package/dist/chunk-nrfyvzmk.js +2 -0
- package/dist/{chunk-3dvxhfcr.js → chunk-nvadhyne.js} +2 -2
- package/dist/{chunk-g2ew3jg9.js → chunk-p2bn8ypc.js} +2 -2
- package/dist/chunk-pnx0f495.js +2 -0
- package/dist/{chunk-k1f40yn4.js → chunk-ppcwcrdz.js} +2 -2
- package/dist/chunk-prr551k0.js +2 -0
- package/dist/chunk-pvm6d77q.js +2 -0
- package/dist/{chunk-af0e5epn.js → chunk-pxbww0j1.js} +2 -2
- package/dist/{chunk-n96z8etk.js → chunk-pz5d0vgv.js} +2 -2
- package/dist/chunk-q2ykvjrz.js +2 -0
- package/dist/chunk-q8c4k6qh.js +2 -0
- package/dist/{chunk-1pnbntv2.js → chunk-q8y2a23c.js} +2 -2
- package/dist/{chunk-fxdkhe0d.js → chunk-qbmgsd3h.js} +2 -2
- package/dist/{chunk-6yx869ht.js → chunk-qbpy0aqe.js} +2 -2
- package/dist/chunk-qgrd5xre.js +2 -0
- package/dist/{chunk-v6x7x69b.js → chunk-qkddvxjr.js} +2 -2
- package/dist/chunk-qv61ef2y.js +2 -0
- package/dist/{chunk-ep9z16w6.js → chunk-qvdfrmpb.js} +2 -2
- package/dist/chunk-qvzxzzw8.js +2 -0
- package/dist/{chunk-k3h77wtz.js → chunk-r2b234a7.js} +2 -2
- package/dist/{chunk-mahky9ad.js → chunk-ra52dqfb.js} +2 -2
- package/dist/{chunk-hj8nkk6a.js → chunk-rb6mjycp.js} +2 -2
- package/dist/{chunk-rhptdqpp.js → chunk-rbs3079t.js} +2 -2
- package/dist/chunk-rcynxrkk.js +4 -0
- package/dist/{chunk-m31f2m2y.js → chunk-rms7wj04.js} +2 -2
- package/dist/{chunk-8zsta2p3.js → chunk-rntrfb49.js} +2 -2
- package/dist/{chunk-33bd1ey8.js → chunk-rxj5619b.js} +2 -2
- package/dist/{chunk-k76s8cq2.js → chunk-ry5phnnk.js} +2 -2
- package/dist/{chunk-xckysrk7.js → chunk-s11mgwyh.js} +2 -2
- package/dist/{chunk-q988bycf.js → chunk-s170cg6j.js} +2 -2
- package/dist/{chunk-zwpv75f4.js → chunk-s1w3j9p9.js} +2 -2
- package/dist/{chunk-11kv54bx.js → chunk-sfd0pp49.js} +3 -3
- package/dist/chunk-shzj5zf0.js +2 -0
- package/dist/chunk-sk9rm826.js +2 -0
- package/dist/chunk-svxnx1c7.js +2 -0
- package/dist/chunk-symaxskd.js +2 -0
- package/dist/chunk-t3rv7vat.js +2 -0
- package/dist/{chunk-r8gfcyeb.js → chunk-t6ddgvkm.js} +2 -2
- package/dist/chunk-th5vv83g.js +2 -0
- package/dist/{chunk-spqfmr4z.js → chunk-tj4b0s68.js} +2 -2
- package/dist/chunk-veef1avy.js +2 -0
- package/dist/chunk-vgxvtmja.js +2 -0
- package/dist/{chunk-0zncrzar.js → chunk-vjfxm73q.js} +2 -2
- package/dist/chunk-vnxa4qe2.js +2 -0
- package/dist/{chunk-5jvpeww3.js → chunk-vq060dnz.js} +2 -2
- package/dist/{chunk-hwppy236.js → chunk-vyvsm4v9.js} +2 -2
- package/dist/{chunk-8w5bt0nc.js → chunk-w1yrsbw1.js} +2 -2
- package/dist/{chunk-3y9az4b9.js → chunk-w2p1g8rp.js} +2 -2
- package/dist/{chunk-mjd3839j.js → chunk-w4537026.js} +2 -2
- package/dist/chunk-wexhc7rb.js +2 -0
- package/dist/{chunk-xmesmh1h.js → chunk-wf0ytnh9.js} +2 -2
- package/dist/{chunk-9m36e0yq.js → chunk-wf4z9w5x.js} +2 -2
- package/dist/{chunk-036wyz4n.js → chunk-whax282d.js} +2 -2
- package/dist/{chunk-chg6j0zg.js → chunk-wrxj79ct.js} +2 -2
- package/dist/{chunk-p72pzfww.js → chunk-xanfp0nh.js} +2 -2
- package/dist/{chunk-abbpbnjj.js → chunk-xjf2zkrg.js} +2 -2
- package/dist/{chunk-cy5kh1yr.js → chunk-xqrhfxct.js} +2 -2
- package/dist/chunk-xxwevgqr.js +2 -0
- package/dist/{chunk-wkbxdz82.js → chunk-y5qzgfsd.js} +2 -2
- package/dist/chunk-y72y3j24.js +2 -0
- package/dist/{chunk-askwff3a.js → chunk-y8aeahf2.js} +3 -3
- package/dist/chunk-ygake3bx.js +2 -0
- package/dist/{chunk-67a3eqhg.js → chunk-ymdhz3x0.js} +2 -2
- package/dist/{chunk-02sj8dwy.js → chunk-ytkcpeq2.js} +2 -2
- package/dist/{chunk-h3geg09z.js → chunk-z27pxeqg.js} +2 -2
- package/dist/{chunk-x4brdfv3.js → chunk-z53fd30n.js} +2 -2
- package/dist/{chunk-mfmh7ztq.js → chunk-zjzzqtaj.js} +2 -2
- package/dist/{chunk-ggxdrm0c.js → chunk-zpetyx45.js} +2 -2
- package/dist/chunk-zpm0t5ye.js +2 -0
- package/dist/chunk-ztrkk6sp.js +2 -0
- package/dist/client.js +1 -1
- package/dist/codex/activity-group.js +1 -1
- package/dist/codex/artifact-links.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/inline-document.js +1 -1
- package/dist/composer/inline-dom.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.d.ts +9 -0
- package/dist/composer/prompt-input-context.js +1 -1
- package/dist/composer/prompt-input-inline.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/app-mentions.js +1 -1
- package/dist/conversation/composer/apps-menu.js +1 -1
- package/dist/conversation/composer/composer-menu.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/prompt-history.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/conversation/subagent-tasks.js +1 -1
- package/dist/desktop/desktop-composer.d.ts +2 -1
- package/dist/desktop/desktop-composer.js +1 -1
- package/dist/desktop/desktop.js +1 -1
- package/dist/desktop/draft-model-select.js +1 -1
- package/dist/desktop/load-image.js +1 -1
- package/dist/desktop/model-catalog.js +1 -1
- package/dist/desktop/model-recovery.js +1 -1
- package/dist/desktop/model-settings-action.js +1 -1
- package/dist/desktop/native-file-drop.d.ts +3 -1
- package/dist/desktop/native-file-drop.js +1 -1
- package/dist/generated/commands.d.ts +66 -65
- package/dist/generated/commands.js +1 -1
- package/dist/generated-image-storage.d.ts +11 -0
- package/dist/generated-image-storage.js +1 -0
- package/dist/image-lightbox.js +1 -1
- package/dist/image-preview-dialog.js +1 -1
- package/dist/image.d.ts +5 -1
- package/dist/image.js +1 -1
- package/dist/lib/app-reference.js +1 -1
- package/dist/lib/application-metadata.js +1 -1
- package/dist/lib/chat-path.js +1 -1
- package/dist/lib/code-highlighter.js +1 -1
- package/dist/lib/file-url.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.d.ts +2 -2
- package/dist/lib/prepare-prompt-files.js +1 -1
- package/dist/lib/reference-presentation.js +1 -1
- package/dist/lib/stream-style.js +1 -1
- package/dist/lib/streaming-markdown.js +1 -1
- package/dist/lib/tool-artifacts.js +1 -1
- package/dist/locales.js +1 -1
- package/dist/mermaid/diagram.js +1 -1
- package/dist/mermaid/export.js +1 -1
- package/dist/mermaid/index.js +1 -1
- package/dist/mermaid/preview.js +1 -1
- package/dist/oauth/claude-login.js +1 -1
- package/dist/oauth.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/locales.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/reference-projection.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/locales.js +1 -1
- package/dist/session-list/navigation-controls.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/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-image-references.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/image-generation-progress.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.d.ts +3 -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.d.ts +2 -4
- package/dist/settings/providers.js +1 -1
- package/dist/settings/settings-bridge.js +1 -1
- package/dist/settings/settings.d.ts +1 -1
- package/dist/settings/settings.js +1 -1
- package/native/win32-x64/alwith_native_chat.dll +0 -0
- package/native/win32-x64/artifact.json +1 -1
- package/package.json +3 -3
- package/assets/catalogs/openrouter/models.json +0 -215
- package/dist/chunk-06mvwewp.js +0 -2
- package/dist/chunk-1jxvmsgm.js +0 -2
- package/dist/chunk-1wk1yw69.js +0 -2
- package/dist/chunk-23r2z6bp.js +0 -2
- package/dist/chunk-2ay0m7xn.js +0 -2
- package/dist/chunk-2qa3c571.js +0 -2
- package/dist/chunk-2reym9jt.js +0 -4
- package/dist/chunk-2w3c4tg8.js +0 -2
- package/dist/chunk-3myhs627.js +0 -2
- package/dist/chunk-5e575zvm.js +0 -2
- package/dist/chunk-5hjk7xnq.js +0 -2
- package/dist/chunk-5t2ge7gg.js +0 -2
- package/dist/chunk-680e6bz4.js +0 -2
- package/dist/chunk-68a1sgrr.js +0 -3
- package/dist/chunk-69965ctr.js +0 -4
- package/dist/chunk-6ewv4vns.js +0 -2
- package/dist/chunk-6wsr59dr.js +0 -2
- package/dist/chunk-7f5xngd2.js +0 -2
- package/dist/chunk-8at9k0cn.js +0 -2
- package/dist/chunk-8byhp88a.js +0 -2
- package/dist/chunk-a0qy1r02.js +0 -2
- package/dist/chunk-b5g055qp.js +0 -2
- package/dist/chunk-b7gntaap.js +0 -4
- package/dist/chunk-b89bzpce.js +0 -2
- package/dist/chunk-c4mm4fzg.js +0 -2
- package/dist/chunk-cjj5bxdb.js +0 -2
- package/dist/chunk-cr0pb6g0.js +0 -2
- package/dist/chunk-d9q9qgm1.js +0 -2
- package/dist/chunk-eb78ebxa.js +0 -2
- package/dist/chunk-ekfs7wrp.js +0 -2
- package/dist/chunk-fbrv2v3t.js +0 -1
- package/dist/chunk-fer4r3b8.js +0 -2
- package/dist/chunk-h77c4pnj.js +0 -2
- package/dist/chunk-hjbq9ez1.js +0 -2
- package/dist/chunk-hzcerz8j.js +0 -2
- package/dist/chunk-jfyz3rx6.js +0 -2
- package/dist/chunk-jnpkpe5t.js +0 -2
- package/dist/chunk-jp2s1xsa.js +0 -2
- package/dist/chunk-ky4j58wz.js +0 -2
- package/dist/chunk-m6yg0dc9.js +0 -2
- package/dist/chunk-p0v9d7e1.js +0 -2
- package/dist/chunk-p9226dye.js +0 -2
- package/dist/chunk-qj87dxrr.js +0 -2
- package/dist/chunk-qm9c9sd7.js +0 -2
- package/dist/chunk-qth2ames.js +0 -2
- package/dist/chunk-qyfkwznx.js +0 -2
- package/dist/chunk-rayhzb8p.js +0 -2
- package/dist/chunk-rkqptd9w.js +0 -2
- package/dist/chunk-srqs8z90.js +0 -2
- package/dist/chunk-twwcd2qv.js +0 -2
- package/dist/chunk-tzb4b5ve.js +0 -2
- package/dist/chunk-v92wj4tv.js +0 -2
- package/dist/chunk-wg223rq3.js +0 -2
- package/dist/chunk-wv6ntscn.js +0 -2
- package/dist/chunk-wvm8srp7.js +0 -2
- package/dist/chunk-x03z0hme.js +0 -2
- package/dist/chunk-y2bb2ey4.js +0 -2
- package/dist/chunk-zdqjjwx0.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{D,
|
|
2
|
-
export{
|
|
1
|
+
import{D,Yo,bs,eo,Cs,ei,ws}from"./chunk-fggwwmzc.js";import{t,We,k,n}from"./chunk-aj0z9a5r.js";import{Ke}from"./chunk-mgwkmr8g.js";import{createStore as M}from"@alwith/api/client";import{isText as w,nativeTurnId as Q}from"@nyssance/codex-acp-v2/client";import{jsx as y}from"react/jsx-runtime";var b=M({entries:{}});function p(r,e){b.setState((s)=>({entries:{...s.entries,[r]:e}}))}function v(r,e){let s=Q(e),a=r.items.findLast((i)=>Q(i)!==null);return!e.replayed&&s!==null&&a!==void 0&&Q(a)===s}function O(r,e){for(let s of r.items){if(s.kind!=="user"||s.echo==="pending")continue;for(let a of[...ei(s._meta),...s.content.filter(w).flatMap((i)=>ei(i._meta))])if(a.questionItemId===e)return a.answer}return}function R({sessionId:r,item:e,question:s,index:a}){let i=We(),{t:l}=t(),m=Yo(e.id,a),c=JSON.stringify([r,m]),u=k(b,(o)=>o.entries[c]),d=n((o)=>o.sessions[r]),A=n((o)=>o.connection==="ready"),f=u?.draft??bs(s),x=d===void 0?u?.accepted:O(d,m)??u?.accepted,h=d!==void 0&&v(d,e),C=!d?.subagent&&A&&d?.attached&&!d.restoring&&!d.readOnly,g=x!==void 0?"answered":u?.skipped?"skipped":u?.pending?"submitting":!h?"closed":!C?"unavailable":"pending",E=async()=>{if(b.getState().entries[c]?.pending||g!=="pending")return;let o=i.state.sessions[r];if(o===void 0||!v(o,e)||!o.attached||o.readOnly||o.restoring)return;let S=eo(s,f);if(!S.trim())return;let q={questionItemId:m,question:s.title,answer:S};p(c,{draft:f,pending:!0});try{await i.prompt(r,[{type:"text",text:Cs(q),_meta:{codex:{questionReply:q}}}]),p(c,{draft:f,accepted:S})}catch(I){p(c,{draft:f,error:I instanceof Error?I.message:String(I)})}};if(g==="closed")return null;return y(ws,{question:s,draft:f,status:g,answer:x,error:g==="pending"?u?.error:void 0,t:l,onChange:(o)=>p(c,{draft:o}),onSkip:()=>p(c,{draft:f,skipped:!0}),onSubmit:()=>{E()}})}function Ko({sessionId:r,item:e}){let s=n((i)=>i.sessions[r]),a=D(e._meta);if(s===void 0||s.subagent!==void 0||s.readOnly||!v(s,e))return y(Ke,{content:e.content.some((i)=>!w(i)||i.text.trim().length>0)?e.content:a.map((i)=>({type:"text",text:i.title})),messageId:e.id,streaming:!1});return y("div",{className:"flex min-w-0 flex-col gap-3","data-async-questions":e.id,children:a.map((i,l)=>y(R,{sessionId:r,item:e,question:i,index:l},Yo(e.id,l)))})}
|
|
2
|
+
export{Ko};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{F}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{F}from"./chunk-gk7nn747.js";import{t}from"./chunk-aj0z9a5r.js";import{C}from"./chunk-q2ykvjrz.js";import{ContentBlock as i}from"@agentclientprotocol/sdk/experimental/v2/unstable";import{isEmbeddedResource as m,isResourceLink as u}from"@nyssance/codex-acp-v2/client";import{jsx as n}from"react/jsx-runtime";function d({block:e,streaming:o}){let r=t();if(i.isText(e)){if(e.text.length===0)return null;return n("div",{className:"codex-assistant-message",children:n(F,{text:e.text,streaming:o})})}if(i.isImage(e))return n(C,{block:e,generated:!0});if(i.isAudio(e))return n("audio",{controls:!0,src:`data:${e.mimeType};base64,${e.data}`});if(u(e)||m(e))return n(C,{block:e,generated:!0});return n("div",{className:"text-muted-foreground",children:r.t("timeline.unsupportedContent",{type:e.type})})}function Ke({content:e,messageId:o,streaming:r}){return e.map((s,a)=>n(d,{block:s,streaming:r},`${o}:${a}`))}
|
|
2
|
+
export{Ke};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ScrollArea as r}from"@base-ui/react/scroll-area";import{cn as o}from"cn";import{useState as v}from"react";import{jsx as e,jsxs as u}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 v}from"react";import{jsx as e,jsxs as u}from"react/jsx-runtime";function S({nativeScroll:f=!1,className:t,viewportClassName:n,viewportRef:i,onScroll:s,viewportProps:a,children:c,...m}){let[p,l]=v(!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 u(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{S};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
export{
|
|
1
|
+
var al=280;function kr({entries:i,gapPx:t,measuredHeightsByKey:o,leadingInsetPx:e=0}){let n=[],r=[],d=new Map,s=[],u=e;for(let[x,a]of i.entries()){d.set(a.turnKey,x);for(let h of a.aliases??[])d.set(h,x);s.push(a.turnKey),r.push(u);let f=a.aliases?.map((h)=>o[h]).find((h)=>h!==void 0),m=o[a.turnKey]??f??a.estimatedHeightPx??280;if(n.push(m),u+=m,x<i.length-1)u+=t}return{bottomOffsetsPx:r.map((x,a)=>{let f=n[a];if(f===void 0)throw Error(`Codex turn height is missing at index ${a}`);return u-x-f}),heightsPx:n,topOffsetsPx:r,totalHeightPx:u,turnIndexByKey:d,turnKeys:s}}function lt({distanceFromBottomPx:i,layout:t,overscanCount:o,viewportHeightPx:e}){if(t.turnKeys.length===0)return{startIndex:0,endIndex:0};let n=Math.min(Math.max(0,i),t.totalHeightPx),r=Math.min(n+Math.max(0,e),t.totalHeightPx),d=g(t.bottomOffsetsPx,r),s=l(t.bottomOffsetsPx,t.heightsPx,n);return{startIndex:Math.max(0,d-o),endIndex:Math.min(t.turnKeys.length,Math.max(s,d+1)+o)}}function Eo({anchorKey:i,layout:t,previousRange:o}){let e=t.turnIndexByKey.get(i);if(e===void 0)return null;return{startIndex:e,endIndex:Math.min(t.turnKeys.length,e+o.endIndex-o.startIndex)}}function Sr({anchorKey:i,distanceFromBottomPx:t,nextLayout:o,previousLayout:e}){let n=e.turnIndexByKey.get(i),r=o.turnIndexByKey.get(i);if(n===void 0||r===void 0)return null;let d=e.bottomOffsetsPx[n],s=e.heightsPx[n],u=o.bottomOffsetsPx[r],x=o.heightsPx[r];if(d===void 0||s===void 0||u===void 0||x===void 0)throw Error(`Codex turn geometry is missing: ${i}`);return Math.max(0,t+u+x-d-s)}function _r({layout:i,turnKey:t,viewportHeightPx:o}){let e=i.turnIndexByKey.get(t);if(e===void 0)return null;let n=i.bottomOffsetsPx[e],r=i.heightsPx[e];if(n===void 0||r===void 0)throw Error(`Codex turn geometry is missing: ${t}`);return Math.max(0,n-o/2+r/2)}function Ir({align:i,layout:t,targetHeightPx:o,targetOffsetPx:e,turnKey:n,viewportHeightPx:r}){let d=t.turnIndexByKey.get(n);if(d===void 0)return null;let s=t.bottomOffsetsPx[d],u=t.heightsPx[d];if(s===void 0||u===void 0)throw Error(`Codex turn geometry is missing: ${n}`);let x=s+u-e;return i==="top"?Math.max(0,x-r+10):Math.max(0,x-o/2-r/2)}function g(i,t){let o=0,e=i.length;while(o<e){let n=Math.floor((o+e)/2),r=i[n];if(r===void 0)throw Error(`Codex bottom offset is missing at index ${n}`);if(r<t)e=n;else o=n+1}return o}function l(i,t,o){let e=0,n=i.length;while(e<n){let r=Math.floor((e+n)/2),d=i[r],s=t[r];if(d===void 0||s===void 0)throw Error(`Codex turn geometry is missing at index ${r}`);if(d+s<=o)n=r;else e=r+1}return e}
|
|
2
|
+
export{al,kr,lt,Eo,Sr,_r,Ir};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fe}from"./chunk-vgxvtmja.js";import{O}from"./chunk-kv1v7kgn.js";import{cn as n}from"cn";import{Item as i,ItemActions as K,ItemContent as q,ItemDescription as pe,ItemMedia as W,ItemTitle as a}from"@nyssance/shadcn/vega/components/ui/item";import{jsx as o}from"react/jsx-runtime";function Z({className:e,...t}){return o("div",{className:n("flex flex-col px-2",e),...t})}function _e({className:e,size:t="xs",active:m,...r}){return o(i,{size:t,"data-active":m,className:n(Fe,"data-[active=true]:font-medium",e),...r})}function Qt({className:e,children:t,...m}){return o(a,{className:n("w-full",e),...m,children:o(O,{children:t})})}export{K,q,pe,W,Z,_e,Qt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function*Ao(n,e){if(e.length===0)return;let r=new RegExp(e.replaceAll(/[.*+?^{}()|[\]\\$]/g,String.raw`\$&`),"giu");for(let t of n.matchAll(r))yield{start:t.index,end:t.index+t[0].length}}function Cr(n,e){if(e.length===0)return[];let r=[];for(let{turnKey:t,segments:o}of n){let c=0;for(let s of o)for(let a of Ao(s,e))r.push({turnKey:t,occurrenceInTurn:c}),c+=1}return r}
|
|
2
|
+
export{Ao,Cr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function Rr({open:r,onOpenChange:a,trigger:i,children:t,...n}){return d(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100}),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t})})})]})}
|
|
2
|
+
export{Rr};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)}function I({subject:t,requestTitle:o}){let{host:s}=e();if(!f(t))return null;let i=t.toolCall,l=A(i),r=v(i),u=P(i),d=s.toolTitle?.(i)??i.title;return m("div",{className:"flex flex-col gap-2",children:[d&&d!==o&&l===null&&c("div",{className:"text-sm font-medium",children:d}),l!==null&&m("pre",{className:"bg-muted max-h-80 overflow-auto overscroll-contain rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:[c("span",{className:"text-muted-foreground select-none",children:"$ "}),l]}),r!==null&&c("div",{className:"max-h-80 overflow-auto rounded-lg border","data-stream-style":"codexUI",children:c(
|
|
3
|
-
export{
|
|
1
|
+
import{Ti}from"./chunk-nfnejf16.js";import{Ai}from"./chunk-z53fd30n.js";import{Mi}from"./chunk-y5qzgfsd.js";import{wt}from"./chunk-y8aeahf2.js";import{n}from"./chunk-aj0z9a5r.js";import{e}from"./chunk-qgrd5xre.js";import{isContentEntry as b,isDiffEntry as w,isFormElicitation as C,isText as j,isToolCallSubject as f,isUrlElicitation as y}from"@nyssance/codex-acp-v2/client";import{jsx as c,jsxs as m}from"react/jsx-runtime";function nt(t){return t.kind==="elicitation"&&C(t.params)}function R(t,o){if(!t.subject||!f(t.subject)||o===void 0)return t;let s={toolCallId:o.id,name:o.name,title:o.title,kind:o.toolKind,content:o.content,locations:o.locations,rawInput:o.rawInput},i=Object.fromEntries(Object.entries(t.subject.toolCall).filter(([,l])=>l!=null));return{...t,subject:{...t.subject,toolCall:{...s,...i}}}}function T(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(w(o)&&o.patch&&o.patch.text.length>0)return o.patch.text;return null}function P(t){return(t.content??[]).filter(b).map((o)=>j(o.content)?o.content.text:"").filter((o)=>o.length>0).join(`
|
|
2
|
+
`)}function I({subject:t,requestTitle:o}){let{host:s}=e();if(!f(t))return null;let i=t.toolCall,l=A(i),r=v(i),u=P(i),d=s.toolTitle?.(i)??i.title;return m("div",{className:"flex flex-col gap-2",children:[d&&d!==o&&l===null&&c("div",{className:"text-sm font-medium",children:d}),l!==null&&m("pre",{className:"bg-muted max-h-80 overflow-auto overscroll-contain rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:[c("span",{className:"text-muted-foreground select-none",children:"$ "}),l]}),r!==null&&c("div",{className:"max-h-80 overflow-auto rounded-lg border","data-stream-style":"codexUI",children:c(wt,{patch:r,theme:s.theme})}),r===null&&l===null&&u.length>0&&c("pre",{className:"bg-muted max-h-60 overflow-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:u}),(i.locations??[]).length>0&&c("ul",{className:"text-muted-foreground flex flex-col gap-0.5 text-xs",children:(i.locations??[]).map((a)=>c("li",{className:"truncate font-mono",children:a.path},`${a.path}:${a.line??""}`))})]})}function g(t,o){let{host:s,client:i}=e();return(l)=>{try{if(o)o(t.id,l);else i.respond(t.id,l)}catch(r){if(s.reportError)s.reportError(r);else console.error(r)}}}function E({action:t,total:o,onRespond:s}){let{host:i}=e(),l=g(t,s),r=t.params.subject,u=r&&f(r)?r.toolCall.toolCallId:null,d=n((p)=>p.sessions[t.sessionId]?.items.find((h)=>h.kind==="tool"&&h.id===u)),a=R(t.params,d),x=i.permissionTitle?.(a)??a.title;return m(Ti,{requestId:t.id,title:x,alwaysLabel:i.t("approval.always"),autoFocus:"if-idle",total:o,options:a.options.map((p)=>({...p,description:T(p)??void 0})),onRespond:(p)=>l({outcome:p===null?{outcome:"cancelled"}:{outcome:"selected",optionId:p}}),children:[a.description&&c("div",{className:"text-muted-foreground mt-0.5 text-xs",children:a.description}),a.subject&&c(I,{subject:a.subject,requestTitle:x})]})}function Ct({action:t,total:o,onRespond:s}){let{host:i}=e(),l=g(t,s),r=n((u)=>t.sessionId===null?void 0:u.sessions[t.sessionId]);return c(Ai,{requestId:t.id,schema:t.params.requestedSchema,message:r?.subagent?`${r.title??i.t("subagents.untitled")}: ${t.params.message}`:t.params.message,total:o,t:i.t,onRespond:l})}function He({action:t,total:o,onRespond:s}){let{host:i}=e(),l=g(t,s);if(t.kind==="permission")return c(E,{action:t,total:o,onRespond:s});if(nt(t))return c(Ct,{action:t,total:o??1,onRespond:s});let r=t.params;if(!y(r))throw Error("Unsupported elicitation mode");return c(Mi,{message:r.message,url:r.url,t:i.t,onOpen:i.openLink,onRespond:(u)=>l(u==="cancel"?{action:"cancel"}:{action:"decline"})})}
|
|
3
|
+
export{nt,Ct,He};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{SquareIcon as l}from"lucide-react";import{useRef as u,useState as c}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{Spinner as p}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as r}from"react/jsx-runtime";function
|
|
2
|
-
export{
|
|
1
|
+
import{SquareIcon as l}from"lucide-react";import{useRef as u,useState as c}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{Spinner as p}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as r}from"react/jsx-runtime";function Me({title:t,onStop:i}){let[o,a]=c(!1),e=u(!1),s=async()=>{if(e.current)return;e.current=!0,a(!0);try{await i()}finally{e.current=!1,a(!1)}};return r(f,{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(p,{className:"size-3","aria-label":t}):r(l,{className:"size-3 fill-current"})})}
|
|
2
|
+
export{Me};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Ni}from"./chunk-63kwbtgs.js";import{autoUpdate as K}from"@floating-ui/dom";import{cn as k}from"cn";import{CheckCheckIcon as L,CheckIcon as I,ShieldXIcon as V,XIcon as F}from"lucide-react";import{useCallback as H,useEffect as h,useId as S,useLayoutEffect as N,useRef as T,useState as f}from"react";import{createPortal as z}from"react-dom";import{jsx as i,jsxs as w}from"react/jsx-runtime";var U={allow_once:{icon:I},allow_always:{icon:L},reject_once:{icon:F},reject_always:{icon:V}};function Ti({requestId:u,options:E,title:_,children:D,total:v=1,alwaysLabel:P="always",autoFocus:y="always",anchorRef:o,onRespond:l}){let c=S(),[r,b]=f(0),[s,x]=f(null),[d,j]=f(null),p=T(null),a=Ni(E);h(()=>{b(0)},[u]),h(()=>{let e=document.activeElement,t=p.current?.closest("[data-session-actions]")?.closest("[data-chat-drop-zone]"),n=e?.matches("[data-chat-input]")&&t?.contains(e);if(y==="always"||e===null||e===document.body||n)p.current?.focus({preventScroll:!0})},[u,d,y]);let m=H(()=>{let e=o?.current;if(!e)return;let t=e.getBoundingClientRect();if(t.width===0){let n=Math.min(640,window.innerWidth*0.9);x({left:(window.innerWidth-n)/2,width:n,bottom:24});return}x({left:t.left,width:t.width,bottom:window.innerHeight-t.bottom+20})},[o]);if(N(()=>{if(!o)return;let e=0,t=()=>{if(o.current)m();else e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)},[u,o,m]),N(()=>{let e=o?.current;if(!e||!d)return;return K(e,d,m,{animationFrame:!0})},[o,d,m]),o&&!s)return null;let g=w("div",{ref:j,"data-overlay":"permission-request",className:k("bg-card border-border flex min-h-0 min-w-0 flex-col overflow-hidden rounded-lg border",o&&"fixed z-50"),style:o&&s?{left:s.left,width:s.width,bottom:s.bottom}:void 0,children:[i("div",{"data-permission-header":!0,className:"shrink-0 px-3 pt-2",children:w("div",{className:"flex items-center justify-between gap-2",children:[i("div",{id:c,className:"text-foreground text-sm font-medium",children:_}),v>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${v}`})]})}),i("div",{"data-permission-content":!0,className:"min-h-0 flex-1 overflow-auto overscroll-contain px-3 pb-2",children:D}),i("div",{role:"listbox","aria-labelledby":c,"aria-activedescendant":a[r]?`${c}-option-${r}`:void 0,tabIndex:0,ref:p,onKeyDown:(e)=>{if(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;let t=a.length;if(t===0&&e.key!=="Escape")return;if(e.key==="ArrowDown"||e.key==="ArrowUp")e.preventDefault(),b((n)=>e.key==="ArrowDown"?(n+1)%t:(n-1+t)%t);else if(e.key==="Enter"){e.preventDefault();let n=a[r];if(n&&!e.repeat)l(n.optionId)}else if(e.key==="Escape")e.preventDefault(),l(null);else if(/^[1-9]$/.test(e.key)&&Number(e.key)<=t)e.preventDefault(),l(a[Number(e.key)-1].optionId)},className:"border-border shrink-0 border-t outline-none",children:a.map((e,t)=>{let n=e.kind??"allow_once",C=U[n]?.icon??I,A=n==="allow_always"||n==="reject_always",M=n==="reject_once"||n==="reject_always";return w("div",{id:`${c}-option-${t}`,role:"option",onMouseDown:(O)=>O.preventDefault(),"aria-selected":t===r,title:e.description,onClick:()=>void l(e.optionId),className:k("flex cursor-pointer items-center gap-2 px-3 py-1.5 text-sm select-none",t===r?"bg-ring text-accent-foreground":"text-foreground",M&&t!==r&&"text-muted-foreground"),children:[i("span",{className:"min-w-3 text-xs opacity-70",children:t+1}),i(C,{className:"size-3.5 shrink-0 opacity-80"}),i("span",{className:"min-w-0 flex-1 truncate",children:e.name}),A&&i("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[10px] tracking-wide uppercase",children:P})]},e.optionId)})})]});return o?z(g,document.body):g}
|
|
2
|
+
export{Ti};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e}from"./chunk-b89bzpce.js";import{Zt}from"./chunk-f8bx4etj.js";import{E,xt,ae,Ln}from"./chunk-680e6bz4.js";import{un,pn}from"./chunk-7f5xngd2.js";import{CardSendIcon as pe}from"@solar-icons/react/line-duotone/card-send";import{cn as j}from"cn";import{ChevronDownIcon as te,ExternalLinkIcon as ve,EyeIcon as se,EyeOffIcon as ne,PlusIcon as ge,ServerIcon as oe,Trash2Icon as fe}from"lucide-react";import{useEffect as V,useRef as ye,useState as y}from"react";import{Button as R}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as ie,CollapsibleContent as re,CollapsibleTrigger as le}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Field as O,FieldDescription as de,FieldLabel as _}from"@nyssance/shadcn/vega/components/ui/field";import{Input as Z}from"@nyssance/shadcn/vega/components/ui/input";import{InputGroup as H,InputGroupAddon as ce,InputGroupButton as ue,InputGroupInput as q}from"@nyssance/shadcn/vega/components/ui/input-group";import{Select as be,SelectContent as he,SelectGroup as xe,SelectItem as Ne,SelectTrigger as Pe,SelectValue as Ce}from"@nyssance/shadcn/vega/components/ui/select";import{Separator as Q}from"@nyssance/shadcn/vega/components/ui/separator";import{Spinner as X}from"@nyssance/shadcn/vega/components/ui/spinner";import{Textarea as we}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as t,jsxs as i,Fragment as Se}from"react/jsx-runtime";function W(s){if(s instanceof Error)return s.message;if(typeof s==="object"&&s!==null&&"message"in s)return String(s.message);return String(s)}function Y(){let{host:s}=e();return(d)=>{let u=d instanceof Error?d:Error(W(d));if(s.reportError)s.reportError(u);else console.error(u)}}function ri({refreshAccountProviders:s,openTopUp:d,group:u}){let{t:v}=e().host,C=Y(),[S,N]=y(0),[l,n]=y(null),[h,c]=y(!0),w=ye(s);return w.current=s,V(()=>{let b=()=>N((p)=>p+1);return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[]),V(()=>{let b=!0;return c(!0),w.current().then(()=>{if(b)n(null),c(!1)},(p)=>{if(b)n(W(p)),c(!1)}),()=>{b=!1}},[S]),t(u,{children:i("div",{className:"space-y-3 rounded-xl border p-4",children:[i("div",{className:"flex items-center justify-between gap-3",children:[t("h3",{className:"text-sm font-medium",children:"ALwith"}),d&&t(R,{variant:"ghost",size:"icon-sm",className:"text-primary hover:text-primary/80","aria-label":v("provider.managed.topUp"),title:v("provider.managed.topUp"),onClick:()=>{d().catch(C)},children:t(pe,{className:"size-4","aria-hidden":"true"})})]}),t("p",{className:"text-muted-foreground text-xs",children:v("provider.managed.description")}),l!==null&&i("div",{className:"space-y-2",children:[t("p",{role:"alert",className:"text-destructive text-xs",children:l}),i(R,{variant:"outline",size:"sm",disabled:h,onClick:()=>N((b)=>b+1),children:[h&&t(X,{"aria-hidden":"true"}),v("provider.retry")]})]})]})})}function Ks({port:s,bridge:d,group:u,label:v,refreshAccountProviders:C,openTopUp:S}){let{host:N}=e(),{t:l}=N,n=Y(),h=(o)=>N.notify?.(o),c=pn(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(E[0]?.id??""),[F,B]=y(0),[U,M]=y({}),J=async(o,r,f)=>{p(r.id);try{let a=await s.save(o,r.id,f);if(!a.error)M((L)=>{let G={...L};return delete G[r.id],G});if(a.error)n(a.error);if(!a.error)h(l(a.status==="pending"?"provider.pending":f===null?"provider.removed":"provider.saved",{name:r.name}));return a}catch(a){return n(a),null}finally{p(null)}},I=async(o)=>{p(o);try{let r=await s.test(o);if(M((f)=>({...f,[o]:r})),r.ok)h(l("provider.testSuccess",{latency:r.latencyMs??0}));else n(`${l(`provider.testErrors.${r.code}`)}${r.message?`: ${r.message}`:""}`)}catch(r){n(r)}finally{p(null)}},T=async(o,r)=>{p(r.id);try{let f=await s.saveCustom(o,r);if(f.error)n(f.error);else M((a)=>{let L={...a};return delete L[r.id],L}),h(l(f.status==="pending"?"provider.pending":"provider.saved",{name:r.name}));return!f.error}catch(f){return n(f),!1}finally{p(null)}},z=async(o)=>{if(!c)return;p(o.id);try{let r=await s.removeCustom(c.revision,o.id);if(r.error)n(r.error);else k(E[0]?.id??""),h(l(r.status==="pending"?"provider.pending":"provider.removed",{name:o.name}))}catch(r){n(r)}finally{p(null)}},K=async()=>{p("retry");try{let o=await un(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=E.find((o)=>o.id===x)??null,A=c?.customProviders.find((o)=>o.id===x)??null;return V(()=>{if(!c||x==="new"||P||A)return;k(E[0]?.id??"")},[c,x,P,A]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(Zt,{bridge:d})]}),C&&t(ri,{refreshAccountProviders:C,openTopUp:S,group:u}),c?.status==="pending"&&t("p",{className:"text-muted-foreground text-sm",children:l("provider.pending")}),c?.error&&t("p",{className:"text-destructive text-sm",children:c.error}),c&&c.status!=="applied"&&t(R,{variant:"outline",className:"self-start",disabled:b!==null,onClick:()=>void K(),children:l("provider.retry")}),t(u,{children:c&&i(Se,{children:[t(si,{activeId:x,keys:w,customProviders:c.customProviders,onSelect:k,onAdd:()=>k("new"),label:v}),E.map((o)=>t("div",{hidden:x!==o.id,children:t(li,{provider:o,saved:w[o.id]??null,revision:c.revision,busy:b!==null,onSave:(r,f)=>J(r,o,f),testResult:U[o.id],onTest:()=>I(o.id)})},o.id)),c.customProviders.map((o)=>t("div",{hidden:x!==o.id,children:t(Xn,{provider:o,revision:c.revision,busy:b!==null,testResult:U[o.id],onTest:()=>I(o.id),onRemove:()=>z(o),onSaved:k,onSave:T})},o.id)),t("div",{hidden:x!=="new",children:t(Xn,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{B((r)=>r+1),k(o)},onSave:T},F)})]})})]})}function si({activeId:s,keys:d,customProviders:u,onSelect:v,onAdd:C,label:S}){let{t:N}=e().host;return i("div",{children:[t(S,{children:N("provider.label")}),i("div",{className:"grid grid-cols-2 gap-2 py-4 sm:grid-cols-3",children:[E.map((l)=>{let n=l.logo,h=d[l.id]!==void 0;return t(ee,{id:l.id,name:l.name,active:s===l.id,configured:h,icon:t(n,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)}),u.map((l)=>t(ee,{id:l.id,name:l.name,active:s===l.id,configured:!0,icon:t(oe,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)),i(R,{type:"button",variant:"outline","aria-pressed":s==="new",onClick:C,className:j("h-9 w-full justify-start gap-2 rounded-full px-4",s==="new"&&"bg-accent"),children:[t(ge,{className:"size-4 shrink-0"}),t("span",{className:"truncate",children:N("provider.customButton")})]})]})]})}function ee({id:s,name:d,active:u,configured:v,icon:C,onClick:S}){return i(R,{type:"button",variant:"outline","aria-label":d,"aria-pressed":u,onClick:S,className:j("h-9 w-full gap-2 rounded-full px-4",u&&"bg-accent"),children:[C,t("span",{className:"min-w-0 flex-1 truncate text-center",children:d}),t("span",{"data-testid":`${s}-status`,"data-configured":v,"aria-hidden":"true",className:j("size-2 shrink-0 rounded-full",v?"bg-green-500":"bg-muted-foreground/30")})]})}function ai({result:s}){let{t:d}=e().host;return t("p",{role:"status",className:s.ok?"text-muted-foreground text-xs":"text-destructive text-xs",children:s.ok?d("provider.testSuccess",{latency:s.latencyMs??0}):`${d(`provider.testErrors.${s.code}`)}${s.status?` (HTTP ${s.status})`:""}`})}function me({busy:s,canTest:d,onTest:u,onRemove:v,result:C,children:S}){let{t:N}=e().host;return i("div",{className:"space-y-3 border-t pt-4",children:[C&&t(ai,{result:C}),u&&t("p",{className:"text-muted-foreground text-xs leading-relaxed",children:N("provider.testDescription")}),i("div",{className:"flex flex-wrap items-center gap-2",children:[v&&i(R,{size:"sm",variant:"destructive",className:"font-normal",disabled:s,onClick:v,children:[t(fe,{className:"size-4"}),N("provider.remove")]}),i("div",{className:"ms-auto flex flex-wrap items-center gap-2",children:[u&&t(R,{size:"sm",variant:"outline",disabled:s||!d,onClick:u,children:N("provider.testButton")}),S]})]})]})}function li({provider:s,saved:d,revision:u,busy:v,onSave:C,testResult:S,onTest:N}){let{host:l}=e(),{t:n}=l,h=Y(),[c,w]=y(""),[b,p]=y(!1),[x,k]=y({saved:d,revision:u}),[F,B]=y(ae(s,d?.region)?.id),[U,M]=y(d?.base_url??""),J=s.logo,I=d!==null,T=c.trim(),z=Ln(s,F),K=F!==ae(s,x.saved?.region)?.id,P=U.trim()!==(x.saved?.base_url??"");V(()=>{if(u>x.revision&&T===""&&!K&&!P)k({saved:d,revision:u}),B(ae(s,d?.region)?.id),M(d?.base_url??"")},[u,d,s,x.revision,T,K,P]);let A=!v&&(T!==""||K||P),o=`${s.id}-api-key`,r=async(a)=>{let L=c,G=F,m=await C(x.revision,a);if(!m)return;let D=m.providers[s.id]??null;k({saved:D,revision:m.revision}),w((g)=>g===L?"":g),B((g)=>g===G?ae(s,D?.region)?.id:g),M((g)=>g===U?D?.base_url??"":g)},f=()=>{if(T===""&&x.saved===null)return;r({...T===""?{}:{apiKey:T},...F===void 0?{}:{region:F},...P?{baseUrl:U.trim()}:{}})};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex flex-wrap items-center gap-3",children:[t(J,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium",children:s.name}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:I?n("provider.active",{name:s.name,count:s.models.length}):n("provider.inactive")})]}),s.regions&&i(be,{value:F,onValueChange:(a)=>B(a??s.regions?.[0]?.id),children:[t(Pe,{className:"w-32","aria-label":n("provider.region"),children:t(Ce,{})}),t(he,{align:"start",alignItemWithTrigger:!1,sideOffset:6,className:"max-w-(--available-width) min-w-0 p-1",children:t(xe,{children:s.regions.map((a)=>t(Ne,{value:a.id,children:n(`provider.regions.${a.id}`)},a.id))})})]})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${s.id}-connection`,children:[t("h4",{id:`${s.id}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(O,{className:"gap-2",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t(_,{htmlFor:o,children:n("provider.apiKey")}),z!==null&&i(R,{type:"button",variant:"link",size:"sm",className:"text-muted-foreground h-auto p-0 text-xs",onClick:()=>{try{l.openLink(z)}catch(a){h(a)}},children:[n("provider.getKey",{name:s.name}),t(ve,{className:"size-3","aria-hidden":"true"})]})]}),i(H,{children:[t(q,{id:o,type:b?"text":"password",autoComplete:"off",spellCheck:!1,placeholder:I?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:c,onChange:(a)=>w(a.target.value),onKeyDown:(a)=>{if(a.key==="Enter"&&A)f()}}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(b?"provider.hideKey":"provider.showKey"),onClick:()=>p((a)=>!a),children:b?t(se,{}):t(ne,{})})})]})]}),i(ie,{className:"space-y-2",children:[i(le,{render:t(R,{variant:"ghost",size:"sm",className:"group px-2.5"}),children:[n("provider.baseUrl"),t(te,{className:"size-4 transition-transform group-aria-expanded:rotate-180","aria-hidden":"true"})]}),t(re,{children:i(O,{className:"gap-2",children:[t(_,{htmlFor:`${s.id}-base-url`,className:"sr-only",children:n("provider.baseUrl")}),t(H,{children:t(q,{id:`${s.id}-base-url`,type:"url",spellCheck:!1,placeholder:ae(s,F)?.baseUrl??s.baseUrl,value:U,onChange:(a)=>M(a.target.value)})}),t(de,{className:"text-xs",children:n("provider.baseUrlDescription")})]})})]})]}),t(me,{busy:v,canTest:!A,onTest:I?N:void 0,onRemove:I?()=>void r(null):void 0,result:!A?S:void 0,children:i(R,{size:"sm",disabled:!A,onClick:f,children:[v&&t(X,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function Xn({provider:s,revision:d,busy:u,testResult:v,onTest:C,onRemove:S,onSaved:N,onSave:l}){let{t:n}=e().host,[h,c]=y(s?.name??""),[w,b]=y(s?.baseUrl??""),[p,x]=y(""),[k,F]=y(!1),[B,U]=y(s===null),[M,J]=y(s?.models??[]),[I,T]=y(s?JSON.stringify(s.models,null,2):`[
|
|
1
|
+
import{e}from"./chunk-qgrd5xre.js";import{sn}from"./chunk-5zf3px9y.js";import{R,It,ce,zn}from"./chunk-th5vv83g.js";import{xn,bn}from"./chunk-bdea3k6b.js";import{CardSendIcon as pe}from"@solar-icons/react/line-duotone/card-send";import{cn as j}from"cn";import{ChevronDownIcon as te,ExternalLinkIcon as ve,EyeIcon as se,EyeOffIcon as ne,PlusIcon as ge,ServerIcon as oe,Trash2Icon as fe}from"lucide-react";import{useEffect as V,useRef as ye,useState as y}from"react";import{Button as F}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as ie,CollapsibleContent as re,CollapsibleTrigger as ae}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Field as O,FieldDescription as le,FieldLabel as _}from"@nyssance/shadcn/vega/components/ui/field";import{Input as Z}from"@nyssance/shadcn/vega/components/ui/input";import{InputGroup as H,InputGroupAddon as de,InputGroupButton as ue,InputGroupInput as q}from"@nyssance/shadcn/vega/components/ui/input-group";import{Select as be,SelectContent as he,SelectGroup as xe,SelectItem as Ne,SelectTrigger as Pe,SelectValue as Ce}from"@nyssance/shadcn/vega/components/ui/select";import{Separator as Q}from"@nyssance/shadcn/vega/components/ui/separator";import{Spinner as X}from"@nyssance/shadcn/vega/components/ui/spinner";import{Textarea as we}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as t,jsxs as i,Fragment as Se}from"react/jsx-runtime";function W(s){if(s instanceof Error)return s.message;if(typeof s==="object"&&s!==null&&"message"in s)return String(s.message);return String(s)}function Y(){let{host:s}=e();return(d)=>{let u=d instanceof Error?d:Error(W(d));if(s.reportError)s.reportError(u);else console.error(u)}}function pi({refreshAccountProviders:s,openTopUp:d,group:u}){let{t:v}=e().host,C=Y(),[S,N]=y(0),[l,n]=y(null),[h,c]=y(!0),w=ye(s);return w.current=s,V(()=>{let b=()=>N((p)=>p+1);return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[]),V(()=>{let b=!0;return c(!0),w.current().then(()=>{if(b)n(null),c(!1)},(p)=>{if(b)n(W(p)),c(!1)}),()=>{b=!1}},[S]),t(u,{children:i("div",{className:"space-y-3 rounded-xl border p-4",children:[i("div",{className:"flex items-center justify-between gap-3",children:[t("h3",{className:"text-sm font-medium",children:"ALwith"}),d&&t(F,{variant:"ghost",size:"icon-sm",className:"text-primary hover:text-primary/80","aria-label":v("provider.managed.topUp"),title:v("provider.managed.topUp"),onClick:()=>{d().catch(C)},children:t(pe,{className:"size-4","aria-hidden":"true"})})]}),t("p",{className:"text-muted-foreground text-xs",children:v("provider.managed.description")}),l!==null&&i("div",{className:"space-y-2",children:[t("p",{role:"alert",className:"text-destructive text-xs",children:l}),i(F,{variant:"outline",size:"sm",disabled:h,onClick:()=>N((b)=>b+1),children:[h&&t(X,{"aria-hidden":"true"}),v("provider.retry")]})]})]})})}function ea({port:s,bridge:d,group:u,label:v,refreshAccountProviders:C,openTopUp:S}){let{host:N}=e(),{t:l}=N,n=Y(),h=(o)=>N.notify?.(o),c=bn(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(R[0]?.id??""),[K,U]=y(0),[z,M]=y({}),J=async(o,r,f)=>{p(r.id);try{let a=await s.save(o,r.id,f);if(!a.error)M((L)=>{let G={...L};return delete G[r.id],G});if(a.error)n(a.error);if(!a.error)h(l(a.status==="pending"?"provider.pending":f===null?"provider.removed":"provider.saved",{name:r.name}));return a}catch(a){return n(a),null}finally{p(null)}},I=async(o)=>{p(o);try{let r=await s.test(o);if(M((f)=>({...f,[o]:r})),r.ok)h(l("provider.testSuccess",{latency:r.latencyMs??0}));else n(`${l(`provider.testErrors.${r.code}`)}${r.message?`: ${r.message}`:""}`)}catch(r){n(r)}finally{p(null)}},T=async(o,r)=>{p(r.id);try{let f=await s.saveCustom(o,r);if(f.error)n(f.error);else M((a)=>{let L={...a};return delete L[r.id],L}),h(l(f.status==="pending"?"provider.pending":"provider.saved",{name:r.name}));return!f.error}catch(f){return n(f),!1}finally{p(null)}},E=async(o)=>{if(!c)return;p(o.id);try{let r=await s.removeCustom(c.revision,o.id);if(r.error)n(r.error);else k(R[0]?.id??""),h(l(r.status==="pending"?"provider.pending":"provider.removed",{name:o.name}))}catch(r){n(r)}finally{p(null)}},B=async()=>{p("retry");try{let o=await xn(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=R.find((o)=>o.id===x)??null,A=c?.customProviders.find((o)=>o.id===x)??null;return V(()=>{if(!c||x==="new"||P||A)return;k(R[0]?.id??"")},[c,x,P,A]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(sn,{bridge:d})]}),C&&t(pi,{refreshAccountProviders:C,openTopUp:S,group:u}),c?.status==="pending"&&t("p",{className:"text-muted-foreground text-sm",children:l("provider.pending")}),c?.error&&t("p",{className:"text-destructive text-sm",children:c.error}),c&&c.status!=="applied"&&t(F,{variant:"outline",className:"self-start",disabled:b!==null,onClick:()=>void B(),children:l("provider.retry")}),t(u,{children:c&&i(Se,{children:[t(mi,{activeId:x,keys:w,customProviders:c.customProviders,onSelect:k,onAdd:()=>k("new"),label:v}),R.map((o)=>t("div",{hidden:x!==o.id,children:t(fi,{provider:o,saved:w[o.id]??null,revision:c.revision,busy:b!==null,onSave:(r,f)=>J(r,o,f),testResult:z[o.id],onTest:()=>I(o.id)})},o.id)),c.customProviders.map((o)=>t("div",{hidden:x!==o.id,children:t(so,{provider:o,revision:c.revision,busy:b!==null,testResult:z[o.id],onTest:()=>I(o.id),onRemove:()=>E(o),onSaved:k,onSave:T})},o.id)),t("div",{hidden:x!=="new",children:t(so,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{U((r)=>r+1),k(o)},onSave:T},K)})]})})]})}function mi({activeId:s,keys:d,customProviders:u,onSelect:v,onAdd:C,label:S}){let{t:N}=e().host;return i("div",{children:[t(S,{children:N("provider.label")}),i("div",{className:"grid grid-cols-2 gap-2 py-4 sm:grid-cols-3",children:[R.map((l)=>{let n=l.logo,h=d[l.id]!==void 0;return t(ee,{id:l.id,name:l.name,active:s===l.id,configured:h,icon:t(n,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)}),u.map((l)=>t(ee,{id:l.id,name:l.name,active:s===l.id,configured:!0,icon:t(oe,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)),i(F,{type:"button",variant:"outline","aria-pressed":s==="new",onClick:C,className:j("h-9 w-full justify-start gap-2 rounded-full px-4",s==="new"&&"bg-accent"),children:[t(ge,{className:"size-4 shrink-0"}),t("span",{className:"truncate",children:N("provider.customButton")})]})]})]})}function ee({id:s,name:d,active:u,configured:v,icon:C,onClick:S}){return i(F,{type:"button",variant:"outline","aria-label":d,"aria-pressed":u,onClick:S,className:j("h-9 w-full gap-2 rounded-full px-4",u&&"bg-accent"),children:[C,t("span",{className:"min-w-0 flex-1 truncate text-center",children:d}),t("span",{"data-testid":`${s}-status`,"data-configured":v,"aria-hidden":"true",className:j("size-2 shrink-0 rounded-full",v?"bg-green-500":"bg-muted-foreground/30")})]})}function gi({result:s}){let{t:d}=e().host;return t("p",{role:"status",className:s.ok?"text-muted-foreground text-xs":"text-destructive text-xs",children:s.ok?d("provider.testSuccess",{latency:s.latencyMs??0}):`${d(`provider.testErrors.${s.code}`)}${s.status?` (HTTP ${s.status})`:""}`})}function me({busy:s,canTest:d,onTest:u,onRemove:v,result:C,children:S}){let{t:N}=e().host;return i("div",{className:"space-y-3 border-t pt-4",children:[C&&t(gi,{result:C}),u&&t("p",{className:"text-muted-foreground text-xs leading-relaxed",children:N("provider.testDescription")}),i("div",{className:"flex flex-wrap items-center gap-2",children:[v&&i(F,{size:"sm",variant:"destructive",className:"font-normal",disabled:s,onClick:v,children:[t(fe,{className:"size-4"}),N("provider.remove")]}),i("div",{className:"ms-auto flex flex-wrap items-center gap-2",children:[u&&t(F,{size:"sm",variant:"outline",disabled:s||!d,onClick:u,children:N("provider.testButton")}),S]})]})]})}function fi({provider:s,saved:d,revision:u,busy:v,onSave:C,testResult:S,onTest:N}){let{host:l}=e(),{t:n}=l,h=Y(),[c,w]=y(""),[b,p]=y(!1),[x,k]=y({saved:d,revision:u}),[K,U]=y(ce(s,d?.region)?.id),[z,M]=y(d?.base_url??""),J=s.logo,I=d!==null,T=c.trim(),E=zn(s,K),B=K!==ce(s,x.saved?.region)?.id,P=z.trim()!==(x.saved?.base_url??"");V(()=>{if(u>x.revision&&T===""&&!B&&!P)k({saved:d,revision:u}),U(ce(s,d?.region)?.id),M(d?.base_url??"")},[u,d,s,x.revision,T,B,P]);let A=!v&&(T!==""||B||P),o=`${s.id}-api-key`,r=async(a)=>{let L=c,G=K,m=await C(x.revision,a);if(!m)return;let D=m.providers[s.id]??null;k({saved:D,revision:m.revision}),w((g)=>g===L?"":g),U((g)=>g===G?ce(s,D?.region)?.id:g),M((g)=>g===z?D?.base_url??"":g)},f=()=>{if(T===""&&x.saved===null)return;r({...T===""?{}:{apiKey:T},...K===void 0?{}:{region:K},...P?{baseUrl:z.trim()}:{}})};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex flex-wrap items-center gap-3",children:[t(J,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium",children:s.name}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:I?n("provider.active",{name:s.name,count:s.models.length}):n("provider.inactive")})]}),s.regions&&i(be,{value:K,onValueChange:(a)=>U(a??s.regions?.[0]?.id),children:[t(Pe,{className:"w-32","aria-label":n("provider.region"),children:t(Ce,{})}),t(he,{align:"start",alignItemWithTrigger:!1,sideOffset:6,className:"max-w-(--available-width) min-w-0 p-1",children:t(xe,{children:s.regions.map((a)=>t(Ne,{value:a.id,children:n(`provider.regions.${a.id}`)},a.id))})})]})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${s.id}-connection`,children:[t("h4",{id:`${s.id}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(O,{className:"gap-2",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t(_,{htmlFor:o,children:n("provider.apiKey")}),E!==null&&i(F,{type:"button",variant:"link",size:"sm",className:"text-muted-foreground h-auto p-0 text-xs",onClick:()=>{try{l.openLink(E)}catch(a){h(a)}},children:[n("provider.getKey",{name:s.name}),t(ve,{className:"size-3","aria-hidden":"true"})]})]}),i(H,{children:[t(q,{id:o,type:b?"text":"password",autoComplete:"off",spellCheck:!1,placeholder:I?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:c,onChange:(a)=>w(a.target.value),onKeyDown:(a)=>{if(a.key==="Enter"&&A)f()}}),t(de,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(b?"provider.hideKey":"provider.showKey"),onClick:()=>p((a)=>!a),children:b?t(se,{}):t(ne,{})})})]})]}),i(ie,{className:"space-y-2",children:[i(ae,{render:t(F,{variant:"ghost",size:"sm",className:"group px-2.5"}),children:[n("provider.baseUrl"),t(te,{className:"size-4 transition-transform group-aria-expanded:rotate-180","aria-hidden":"true"})]}),t(re,{children:i(O,{className:"gap-2",children:[t(_,{htmlFor:`${s.id}-base-url`,className:"sr-only",children:n("provider.baseUrl")}),t(H,{children:t(q,{id:`${s.id}-base-url`,type:"url",spellCheck:!1,placeholder:ce(s,K)?.baseUrl??s.baseUrl,value:z,onChange:(a)=>M(a.target.value)})}),t(le,{className:"text-xs",children:n("provider.baseUrlDescription")})]})})]})]}),t(me,{busy:v,canTest:!A,onTest:I?N:void 0,onRemove:I?()=>void r(null):void 0,result:!A?S:void 0,children:i(F,{size:"sm",disabled:!A,onClick:f,children:[v&&t(X,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function so({provider:s,revision:d,busy:u,testResult:v,onTest:C,onRemove:S,onSaved:N,onSave:l}){let{t:n}=e().host,[h,c]=y(s?.name??""),[w,b]=y(s?.baseUrl??""),[p,x]=y(""),[k,K]=y(!1),[U,z]=y(s===null),[M,J]=y(s?.models??[]),[I,T]=y(s?JSON.stringify(s.models,null,2):`[
|
|
2
2
|
{ "label": "My Model", "api_id": "model-id" }
|
|
3
|
-
]`),[
|
|
4
|
-
export{
|
|
3
|
+
]`),[E,B]=y(null),[P]=y(()=>s?.id??`custom_${crypto.randomUUID().replaceAll("-","")}`),A=`${P}-name`,o=`${P}-base-url`,r=`${P}-api-key`,f=`${P}-models`,a=h.trim()!==s?.name||w.trim()!==s.baseUrl||p.trim()!==""||I!==JSON.stringify(s.models,null,2),L=(m)=>{if(!m)try{J(It(I)),B(null)}catch(D){B(W(D));return}z(m)},G=async()=>{let m;try{m=It(I),B(null)}catch(g){B(W(g)),z(!0);return}if(await l(d,{id:P,name:h.trim(),baseUrl:w.trim(),models:m,...p.trim()===""?{}:{apiKey:p.trim()}}))c((g)=>g===h?h.trim():g),b((g)=>g===w?w.trim():g),x((g)=>g===p?"":g),T((g)=>g===I?JSON.stringify(m,null,2):g),N(P)};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex items-center gap-3",children:[t(oe,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium break-words",children:s?.name||n("provider.addCustom")}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:n("provider.customDescription")})]}),s&&t("span",{className:"text-muted-foreground shrink-0 text-xs",children:n("provider.configured")})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${P}-connection`,children:[t("h4",{id:`${P}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(O,{className:"gap-2",children:[t(_,{htmlFor:A,children:n("provider.name")}),t(Z,{id:A,value:h,onChange:(m)=>c(m.target.value)})]}),i(O,{className:"gap-2",children:[t(_,{htmlFor:o,children:n("provider.baseUrl")}),t(Z,{id:o,type:"url",placeholder:"https://.../v1",value:w,onChange:(m)=>b(m.target.value)})]}),i(O,{className:"gap-2",children:[t(_,{htmlFor:r,children:n("provider.apiKey")}),i(H,{children:[t(q,{id:r,type:k?"text":"password",autoComplete:"off",placeholder:s?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:p,onChange:(m)=>x(m.target.value)}),t(de,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(k?"provider.hideKey":"provider.showKey"),onClick:()=>K((m)=>!m),children:k?t(se,{}):t(ne,{})})})]})]})]}),t(Q,{}),i(ie,{open:U,onOpenChange:L,className:"space-y-3",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t("h4",{className:"text-sm font-medium",children:n("provider.models")}),i(ae,{render:t(F,{variant:"ghost",size:"sm"}),children:[n(U?"provider.previewModels":"provider.editModels"),t(te,{className:j("size-4",U&&"rotate-180")})]})]}),!U&&t("ul",{className:"bg-muted/40 divide-y rounded-lg px-3",children:M.map((m)=>i("li",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 py-2.5 text-sm",children:[t("span",{className:"break-all",children:m.label}),t("span",{className:"text-muted-foreground font-mono text-xs break-all",children:m.api_id})]},m.api_id))}),t(re,{children:i(O,{className:"gap-2","data-invalid":E!==null,children:[t(_,{htmlFor:f,children:n("provider.modelsJson")}),t(we,{id:f,"aria-invalid":E!==null,"aria-describedby":`${f}-description`,spellCheck:!1,className:"min-h-44 font-mono text-xs",value:I,onChange:(m)=>{T(m.target.value),B(null)}}),t(le,{id:`${f}-description`,className:j("text-xs",E&&"text-destructive"),role:E?"alert":void 0,children:E??n("provider.modelsJsonDescription")})]})})]}),t(me,{busy:u,canTest:!a,onTest:s?C:void 0,onRemove:s?S:void 0,result:!a?v:void 0,children:i(F,{size:"sm",disabled:u||!a||h.trim()===""||w.trim()===""||!s&&p.trim()==="",onClick:()=>void G(),children:[u&&t(X,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}
|
|
4
|
+
export{pi,ea,mi,gi,fi,so};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var oi=`<svg xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<defs>
|
|
3
3
|
<linearGradient id="plugin-agent-mode-paint0_linear_1_1034" x1="30.0398" y1="40.0728" x2="11.3112" y2="-1.39757" gradientUnits="userSpaceOnUse">
|
|
4
4
|
<stop stop-color="#2BBFFF"/>
|
|
@@ -1286,4 +1286,4 @@ var Qo=`<svg xmlns="http://www.w3.org/2000/svg">
|
|
|
1286
1286
|
</symbol>
|
|
1287
1287
|
</svg>
|
|
1288
1288
|
`;
|
|
1289
|
-
export{
|
|
1289
|
+
export{oi};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ki}from"./chunk-pxbww0j1.js";import{createContext as r,useContext as i}from"react";import{jsx as s}from"react/jsx-runtime";var n=r(null);function sa({host:o,children:t}){return s(n,{value:o,children:t})}function A(){let o=i(n),e={...ki(),...o};if(e.t===void 0||e.i18n===void 0)throw Error("Collection host is missing; mount collections inside SessionListProvider or CollectionHostProvider");return e}function Ci(o,t){t.catch((e)=>{if(o.reportError)o.reportError(e);else console.error(e)})}function he(){let o=A();return(t)=>Ci(o,t)}function wi(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}
|
|
2
|
+
export{sa,A,Ci,he,wi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{kr,lt,Eo,Sr,_r,Ir}from"./chunk-mkawbqx5.js";import{forwardRef as ye,useCallback as K,useEffect as ge,useImperativeHandle as ve,useLayoutEffect as w,useMemo as ne,useRef as s,useState as F}from"react";import{jsx as R,jsxs as re}from"react/jsx-runtime";var pe=12,X=2,V=800,he=new Map;function Re({turnKey:q,heightPx:x,placeholder:W=!1,deferUntilReady:n=!1,observe:b,onReady:L,children:z}){let h=s(null),[H,_]=F(!1),U=K((m)=>{h.current=m,b(q,m)},[b,q]);return w(()=>{let m=h.current;if(m===null)throw Error("Codex turn element is missing");let T=()=>{L(m),_(!0)};if(m.querySelector("[data-markdown-pending]")===null){T();return}let d=new MutationObserver(()=>{if(m.querySelector("[data-markdown-pending]")!==null)return;d.disconnect(),T()});return d.observe(m,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-markdown-pending"]}),()=>d.disconnect()},[L]),re("div",{style:H?void 0:{position:"relative",height:x,overflow:"hidden"},children:[R("div",{ref:U,className:"[&_[data-virtualized-turn-content]]:[content-visibility:visible]","data-turn-key":q,"aria-busy":!H||void 0,style:!H&&!W&&n?{visibility:"hidden"}:void 0,"data-turn-ready":H?"":void 0,children:z}),!H&&!W&&n&&R("div",{"aria-hidden":"true",className:"codex-turn-loading",children:re("div",{className:"codex-turn-loading-lines",children:[R("span",{}),R("span",{}),R("span",{})]})})]})}var wr=ye(function({entries:x,renderTurn:W,scrollElement:n,sessionKey:b,leadingContent:L,leadingInsetPx:z=0,preserveViewport:h=!1},H){let _=s(null),[U,m]=F(z),T=L!==void 0&&L!==null;w(()=>{let e=_.current;if(e===null)return;let t=()=>m(e.getBoundingClientRect().height);t();let o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[T]);let d=ne(()=>he.get(b),[b]),[j,J]=F(()=>d?.turnHeightsByKey??{}),i=ne(()=>kr({entries:x,gapPx:pe,measuredHeightsByKey:j,leadingInsetPx:T?U:z}),[x,j,T,U,z]),me=ne(()=>{let e=lt({distanceFromBottomPx:d?.distanceFromBottomPx??0,layout:i,overscanCount:X,viewportHeightPx:V}),t=d?.renderedWindow;if(t===void 0||t===null)return e;return Eo({anchorKey:t.anchorKey,layout:i,previousRange:{startIndex:0,endIndex:Math.min(t.count,e.endIndex-e.startIndex)}})??e},[d,i]),[M,ie]=F(me),[y,oe]=F(V),[c,ue]=F(null),N=s(d?.distanceFromBottomPx??0),k=s(M),ae=s(i.turnKeys),l=s(j),S=s(i),se=s(i),P=s(new Map),v=s(null),C=s(null),E=s(null),D=s(new Map),Q=s(!1),ce=s(()=>{}),O=s(null),de=K(()=>{if(!h||n===null||v.current!==null||O.current!==null)return;let e=n.getBoundingClientRect();if(e.height<=0)return;let t=[...P.current].filter(([,r])=>r.hasAttribute("data-turn-ready")).map(([r,u])=>{let a=u.getBoundingClientRect(),g=S.current.turnIndexByKey.get(r),B=g===void 0?a.height:S.current.heightsPx[g];return{key:r,element:u,rect:a,bottom:a.top+B}}).filter(({rect:r,bottom:u})=>u>e.top&&r.top<e.bottom).toSorted((r,u)=>r.rect.top-u.rect.top),o=t.flatMap((r)=>[...r.element.querySelectorAll("[data-user-message-bubble], .codex-markdown-root > *")].filter((u)=>!u.closest('[aria-hidden="true"], [inert]')).map((u)=>({key:r.key,element:u,rect:u.getBoundingClientRect()})).filter(({rect:u})=>u.height>0&&u.top>=e.top&&u.top<e.bottom)).toSorted((r,u)=>r.rect.top-u.rect.top)[0]??t[0];if(o)O.current={key:o.key,element:o.element,top:o.rect.top-e.top,scrollTop:n.scrollTop}},[h,n]),Y=s(de);Y.current=de;let p=K((e,t)=>{let o=Math.min(e,i.totalHeightPx),r=lt({distanceFromBottomPx:o,layout:i,overscanCount:X,viewportHeightPx:t}),u=k.current,a=u.startIndex<=r.startIndex&&u.endIndex>=r.endIndex?u:r;if(N.current=o,k.current=a,ae.current=i.turnKeys,oe(t),a!==u)ie(a)},[i]),A=K((e)=>{let t=Math.max(0,e.scrollHeight-i.totalHeightPx);return Math.max(0,e.scrollHeight-e.clientHeight-e.scrollTop-t)},[i.totalHeightPx]),fe=K((e)=>{let t=e.dataset.turnKey;if(t===void 0)throw Error("Codex measured turn is missing its key");let o=Math.max(1,e.getBoundingClientRect().height);if(l.current[t]===o)return;Y.current();let r={...l.current,[t]:o};l.current=r,J(r)},[]),Z=K(()=>{if(C.current!==null)return C.current;return C.current=new ResizeObserver((e)=>{for(let t of e){let o=t.target;if(!("turnReady"in o.dataset)&&o.querySelector("[data-markdown-pending]")!==null)continue;let r=o.dataset.turnKey;if(r===void 0)throw Error("Codex measured turn is missing its key");let u=Math.max(1,t.borderBoxSize[0]?.blockSize??t.contentRect.height);D.current.set(r,u)}if(E.current!==null||D.current.size===0)return;E.current=requestAnimationFrame(()=>{E.current=null;let t=[...D.current].filter(([r,u])=>l.current[r]!==u);if(D.current.clear(),t.length===0)return;Y.current();let o={...l.current,...Object.fromEntries(t)};l.current=o,J(o)})}),C.current},[]),xe=K((e,t)=>{let o=P.current.get(e);if(o!==void 0)Z().unobserve(o),P.current.delete(e);if(t===null)return;if(t.dataset.turnKey!==e)throw Error(`Codex turn key does not match its element: ${e}`);P.current.set(e,t),Z().observe(t)},[Z]);ge(()=>()=>{if(C.current?.disconnect(),E.current!==null)cancelAnimationFrame(E.current);D.current.clear(),C.current=null,P.current.clear()},[]),w(()=>{ce.current=()=>{if(n===null)return;let e=A(n);if(v.current!==null){N.current=e,oe(n.clientHeight||V);return}p(e,n.clientHeight||V)}},[A,n,p]),w(()=>{if(n===null)return;if(!Q.current){Q.current=!0;let o=d?.distanceFromBottomPx??0;n.scrollTo({behavior:"instant",top:Math.max(0,o>0?S.current.totalHeightPx-n.clientHeight-o:n.scrollHeight-n.clientHeight)})}let e=()=>ce.current();e(),n.addEventListener("scroll",e,{passive:!0});let t=new ResizeObserver(e);return t.observe(n),()=>{n.removeEventListener("scroll",e),t.disconnect()}},[d,n]),w(()=>{if(n===null||c===null)return;let e=P.current.get(c.turnKey);if(e?.querySelector("[data-markdown-pending]")!==null)return;let t=e.offsetHeight;if(t<=0)return;if(l.current[c.turnKey]!==t){let g={...l.current,[c.turnKey]:t};l.current=g,J(g);return}let o=c.getTargetElement(e)??e,r=e.getBoundingClientRect(),u=o.getBoundingClientRect(),a=Ir({align:c.align,layout:i,targetHeightPx:u.height,targetOffsetPx:u.top-r.top,turnKey:c.turnKey,viewportHeightPx:n.clientHeight});if(a===null)throw Error(`Codex virtual turn is missing: ${c.turnKey}`);n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-a)}),p(a,n.clientHeight||V),queueMicrotask(()=>{if(v.current!==c)return;c.complete(),v.current=null,ue(null)})},[i,c,n,p]),w(()=>{let e=se.current;if(se.current=i,S.current=i,n===null||c!==null){O.current=null;return}let t=O.current;O.current=null;let o=t===null?void 0:n.contains(t.element)?t.element:P.current.get(t.key);if(h&&e!==i&&t!==null&&o!==void 0){let u=o.getBoundingClientRect().top-n.getBoundingClientRect().top,a=n.scrollTop-t.scrollTop;n.scrollTop+=u-t.top+a,p(A(n),n.clientHeight);return}let r=N.current;if(h&&e!==i&&Q.current)r=Math.max(0,e.totalHeightPx-n.clientHeight-n.scrollTop);if((r>24||h)&&e!==i){let u=A(n);if(u<=96&&!h){p(u,y);return}let a=lt({distanceFromBottomPx:r,layout:e,overscanCount:0,viewportHeightPx:y}),g=e.turnKeys.slice(a.startIndex,a.endIndex).filter((f)=>i.turnIndexByKey.has(f)),B=g.find((f)=>l.current[f]!==void 0)??g[0];if(B!==void 0){let f=Sr({anchorKey:B,distanceFromBottomPx:r,nextLayout:i,previousLayout:e});if(f===null)throw Error(`Codex viewport anchor is missing: ${B}`);r=f,n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-r)})}}p(r,y)},[i,c,A,n,p,y,h]),w(()=>{k.current=M},[M]),ge(()=>()=>{v.current?.complete(),v.current=null;let e=k.current,o=S.current.turnKeys[e.startIndex];he.set(b,{distanceFromBottomPx:N.current,renderedWindow:o===void 0?null:{anchorKey:o,count:e.endIndex-e.startIndex},turnHeightsByKey:l.current})},[b]),ve(H,()=>({scrollToKey(e,t=(r)=>r,o={align:"center"}){v.current?.complete();let r=i.turnIndexByKey.get(e);if(r===void 0)throw Error(`Codex virtual turn is missing: ${e}`);let u=i.turnKeys[r],a=_r({layout:i,turnKey:e,viewportHeightPx:y});if(a===null)throw Error(`Codex virtual turn is missing: ${e}`);let g=lt({distanceFromBottomPx:a,layout:i,overscanCount:X,viewportHeightPx:y});return k.current=g,ie(g),new Promise((B)=>{let f={align:o.align,complete:B,getTargetElement:t,turnKey:u};v.current=f,ue(f)})}}),[i,y]);let I=M,G=ae.current;if(!(G===i.turnKeys||G.length===i.turnKeys.length&&G.every((e,t)=>e===i.turnKeys[t]))){let e=G[M.startIndex];I=(e===void 0?null:Eo({anchorKey:e,layout:i,previousRange:M}))??lt({distanceFromBottomPx:N.current,layout:i,overscanCount:X,viewportHeightPx:y})}let ee=x.length-1,le=x[ee],te=x.slice(I.startIndex,Math.min(I.endIndex,ee)).map((e,t)=>({entry:e,index:I.startIndex+t}));if(le!==void 0)te.push({entry:le,index:ee});return re("div",{"data-codex-timeline":!0,"data-codex-virtualized-pending-key":c?.turnKey,"data-codex-virtualized-range":`${I.startIndex}:${I.endIndex}`,"data-codex-virtualized-total-count":x.length,"data-codex-virtualized-turn-count":te.length,className:"relative shrink-0",style:{height:i.totalHeightPx},children:[T&&R("div",{ref:_,"data-codex-timeline-leading":!0,className:"absolute inset-x-0 top-0",children:L}),te.map(({entry:e,index:t})=>R("div",{className:"absolute inset-x-0",style:{top:i.topOffsetsPx[t]??0},children:R(Re,{turnKey:e.turnKey,heightPx:i.heightsPx[t],placeholder:e.placeholder,deferUntilReady:e.deferUntilReady,observe:xe,onReady:fe,children:W(e,t)})},e.turnKey))]})});
|
|
2
|
+
export{wr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{s}from"./chunk-pxbww0j1.js";import{ln}from"./chunk-evgfpd16.js";import{O}from"./chunk-kv1v7kgn.js";import{cn,Le}from"./chunk-95f0wens.js";import{formatDistanceToNowStrict as x}from"date-fns";import{enUS as H,zhCN as L}from"date-fns/locale";import{ClockIcon as z,MessageSquareIcon as E}from"lucide-react";import{useEffect as g,useState as A}from"react";import{Input as D}from"@nyssance/shadcn/vega/components/ui/input";import{Separator as w}from"@nyssance/shadcn/vega/components/ui/separator";import{jsx as o,jsxs as h,Fragment as M}from"react/jsx-runtime";var S={en:H,"zh-CN":L};function ft(t,a){let r=a==="zh-CN"?S["zh-CN"]:S.en;return x(new Date(t),{locale:r})}function Ne({sessionRow:t,actions:a,shortcut:r,renaming:n=!1,onRename:m}){let{t:i,i18n:C,PathAction:u}=s(),f=Le(),y=cn();g(()=>{f(n)},[n,f]);let[I,p]=A(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?ft(t.updatedAt,C.language):null,v=[];if(N!==null)v.push({icon:o(z,{className:"size-3.5"}),text:N});let l=u&&o(u,{cwd:t.cwd,onOpened:y});return o(ln,{title:n?o(D,{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(O,{className:"min-w-0 flex-1",children:t.title??i("sessionList.untitled")})}),r]}),titleIcon:o(E,{className:"size-3.5"}),details:v,actions:l||a!==void 0?h(M,{children:[l,l&&a!==void 0&&o(w,{}),a]}):void 0})}
|
|
2
|
+
export{ft,Ne};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ke}from"./chunk-33fxyn5r.js";import{je,dt}from"./chunk-fzfwftqs.js";import{we}from"./chunk-db8hae9d.js";import{isContentEntry as u,isImage as d,isResourceLink as p,isText as m}from"@nyssance/codex-acp-v2/client";var g=we();function jo(c,l){let a=new Set;for(let e of l){if(e.kind!=="tool"||e.status!=="completed")continue;let s=dt(e),n=s?je(e):e.content.filter(u).map((t)=>t.content),f=(t)=>d(t)||s&&ke(t)!==null;if(!n.some(f))continue;n.forEach((t,i)=>{if(f(t)){if(a.add(`${e.id}:${i}`),p(t))a.add(t.uri)}if(!m(t))return;let r;try{r=JSON.parse(t.text)}catch(o){if(o instanceof SyntaxError)return;throw o}if(r===null||typeof r!=="object"||!("kind"in r)||r.kind!=="alwith.image"||!("images"in r)||!Array.isArray(r.images))return;for(let o of r.images)if(o!==null&&typeof o==="object"&&typeof o.reference==="string")a.add(o.reference)})}if(a.size===0)return c;return c.map((e)=>{if(!m(e)||!e.text.includes("!["))return e;let s=g.lexer(e.text).map((n)=>{if(n.type!=="paragraph"||!n.tokens)return n.raw;let f=0;return n.tokens.map((i)=>(f+=i.raw.length,i.type==="image"&&a.has(i.href)?"":i.raw)).join("")+n.raw.slice(f)}).join("");return s===e.text?e:{...e,text:s}}).filter((e)=>!m(e)||e.text.trim().length>0)}
|
|
2
|
+
export{jo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{et,dn}from"./chunk-5qaa4atv.js";import{createStore as S}from"@alwith/api/client";import{createContext as y,useContext as h,useSyncExternalStore as x}from"react";import{jsx as w}from"react/jsx-runtime";function u(o){return typeof o==="object"&&o!==null&&!Array.isArray(o)}function bi(o){if(o===null||o===void 0)return et();if(!u(o)||!u(o.collections)||!Array.isArray(o.order))throw Error("Saved collections are not in the expected format");let{collections:t,order:e}=o;for(let r of e)if(typeof r!=="string"||!u(t[r]))throw Error(`Saved collection missing: ${String(r)}`);return{collections:t,order:e,sessionMeta:{}}}function oa(o,{reportError:t=console.error}={}){let e=S(et()),r=async()=>{e.setState(bi(await o.load()),!0)},i=r(),l=i.catch(t),C=()=>{let n=l.then(r);return i=n,l=n.catch(()=>{}),n},s=!1,a,c=o.subscribe?.(()=>{if(!s)C().catch(t)});if(typeof c==="function")a=c;else if(c!==void 0)c.then((n)=>{if(s)n();else a=n},t);return{store:e,getState:()=>e.getState(),ready:i,dispatch:(n)=>{let p=l.then(async()=>{await i;let d=(Array.isArray(n)?n:[n]).reduce(dn,e.getState());await o.save({collections:d.collections,order:d.order}),e.setState(d,!0)});return l=p.catch(()=>{}),p},reload:C,dispose:()=>{s=!0,a?.()}}}var f=y(null);function ia({store:o,children:t}){return w(f,{value:o,children:t})}function ao(){let o=h(f);if(o===null)throw Error("Collection store is missing; wrap the tree in CollectionProvider");return o}function Oe(o){let{store:t}=ao(),e=()=>o?o(t.getState()):t.getState();return x((r)=>t.subscribe(r),e,e)}function fe(){return ao().dispatch}
|
|
2
|
+
export{bi,oa,ia,ao,Oe,fe};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Qi}from"./chunk-y72y3j24.js";import{ve}from"./chunk-sk9rm826.js";var t={chat:Qi,image:ve};function rt(n){return Object.hasOwn(t,n)}function ze(n){if(!rt(n))throw Error(`Unsupported input mode: ${n}`);return t[n]}function ka(n){if(n===null)return"chat";let o=n.mode;if(!rt(o))throw Error(`Unsupported input mode: ${o}`);return t[o].parseConfig(n.config),o}
|
|
2
|
+
export{rt,ze,ka};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Et,oe}from"./chunk-vnxa4qe2.js";import{ur}from"./chunk-ztrkk6sp.js";import{Po,To,Ft,Ot,Mo}from"./chunk-q8c4k6qh.js";import{cn as P}from"cn";import{ArrowUpIcon as ve,Loader2Icon as Ie,SquareIcon as xe,XIcon as he}from"lucide-react";import{Children as Z,useCallback as h,useEffect as T,useMemo as Pe,useRef as S,useState as Le}from"react";import{flushSync as ye}from"react-dom";import{InputGroup as Fe,InputGroupAddon as te,InputGroupButton as re}from"@nyssance/shadcn/vega/components/ui/input-group";import{jsx as a,jsxs as Te}from"react/jsx-runtime";function ee(l){let i=new FormData(l).get("message");return typeof i==="string"?i:""}var rr=({className:l,bashMode:i=!1,attachmentPolicy:n,onCommand:f,onSubmitError:L,canSubmit:g,onSubmitAsync:b,accept:M,multiple:ne,globalDrop:E,syncHiddenInput:U,maxFiles:_,maxFileSize:H,onError:v,onSubmit:se,children:ie,...ue})=>{let u=Ot(),p=!!u,ae=i&&p&&u.textInput.value.startsWith("!"),y=S(null),C=S(null),k=S(!1),[le,D]=Le([]),d=p?u.attachments.files:le,B=S(d);B.current=d;let pe=h(()=>{y.current?.click()},[]),O=h((e)=>{if(!M||M.trim()==="")return!0;return M.split(",").map((t)=>t.trim()).filter(Boolean).some((t)=>{if(t.endsWith("/*")){let o=t.slice(0,-1);return e.type.startsWith(o)}return e.type===t})},[M]),W=h((e)=>{if(e.type)return e.type;let r=(e.name||"").toLowerCase();if(r.endsWith(".png"))return"image/png";if(r.endsWith(".jpg")||r.endsWith(".jpeg"))return"image/jpeg";if(r.endsWith(".webp"))return"image/webp";if(r.endsWith(".gif"))return"image/gif";if(r.endsWith(".bmp"))return"image/bmp";if(r.endsWith(".svg"))return"image/svg+xml";return""},[]),me=h((e)=>{let r=[...e],t=r.filter((s)=>O(s));if(r.length&&t.length===0){v?.({code:"accept",message:"No files match the accepted types."});return}let o=(s)=>H?s.size<=H:!0,c=t.filter(o);if(t.length>0&&c.length===0){v?.({code:"max_file_size",message:"All files exceed the maximum size."});return}D((s)=>{let I=n?n.uniqueFiles(c,s):c,m=typeof _==="number"?Math.max(0,_-s.length):void 0,z=typeof m==="number"?I.slice(0,m):I;if(typeof m==="number"&&I.length>m)v?.({code:"max_files",message:"Too many files. Some were not added."});let V=[];for(let x of z){let Y=n?.sourcePath(x),R=n?.isLocalImage?.(x);V.push({id:crypto.randomUUID(),type:"file",url:R&&x.size===0?"":URL.createObjectURL(x),mediaType:W(x),filename:x.name,size:x.size,lastModified:x.lastModified,...Y===void 0?{}:{sourcePath:Y},...R?{localImage:R}:{}})}return[...s,...V]})},[n,W,O,_,H,v]),ce=h((e)=>D((r)=>{let t=r.find((o)=>o.id===e);if(t?.url)URL.revokeObjectURL(t.url);return r.filter((o)=>o.id!==e)}),[]),de=h(()=>D((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),G=p?u.attachments.add:me,F=h((e)=>{let r=[...e],t=r.filter((c)=>!(c.type??"").toLowerCase().startsWith("image/"));if(t.length>0){v?.({code:"unsupported_type",message:`Only image attachments are supported. ${t.length} non-image file(s) were ignored.`});return}let o=r.reduce((c,s)=>c+(n?.useLocalImages&&n.isLocalImage?.(s)?0:s.size),0);if(o>0){let c=d.filter((s)=>(s.mediaType??"").toLowerCase().startsWith("image/")&&!(n?.useLocalImages&&s.localImage)).reduce((s,I)=>s+(I.size??0),0);if(Et(c,o)){v?.({code:"max_total_size",message:`Total image size must not exceed ${oe}MB.`});return}}G(r)},[d,G,v,n]),q=p?u.attachments.remove:ce,N=p?u.attachments.clear:de,X=p?u.attachments.openFileDialog:pe;T(()=>{if(!p)return;u.__registerFileInput(y,n?.openFileDialog??(()=>y.current?.click()))},[p,u,n]),T(()=>{if(U&&y.current&&d.length===0)y.current.value=""},[d,U]),T(()=>{let e=C.current;if(!e)return;if(E)return;let r=(o)=>{if(o.dataTransfer?.types?.includes("Files"))o.preventDefault()},t=(o)=>{if(o.dataTransfer?.types?.includes("Files"))o.preventDefault();if(o.dataTransfer?.files&&o.dataTransfer.files.length>0)if(n?.onSelectFiles)n.onSelectFiles([...o.dataTransfer.files]);else F(o.dataTransfer.files)};return e.addEventListener("dragover",r),e.addEventListener("drop",t),()=>{e.removeEventListener("dragover",r),e.removeEventListener("drop",t)}},[F,E,n]),T(()=>{if(!E)return;let e=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault()},r=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault();if(t.dataTransfer?.files&&t.dataTransfer.files.length>0)if(n?.onSelectFiles)n.onSelectFiles([...t.dataTransfer.files]);else F(t.dataTransfer.files)};return document.addEventListener("dragover",e),document.addEventListener("drop",r),()=>{document.removeEventListener("dragover",e),document.removeEventListener("drop",r)}},[F,E,n]),T(()=>()=>{if(!p){for(let e of B.current)if(e.url)URL.revokeObjectURL(e.url)}},[p]);let fe=(e)=>{if(e.currentTarget.files)if(n?.onSelectFiles)n.onSelectFiles([...e.currentTarget.files]);else F(e.currentTarget.files);e.currentTarget.value=""},J=Pe(()=>({files:d.map((e)=>({...e,id:e.id})),add:F,remove:q,clear:N,openFileDialog:X,fileInputRef:y}),[d,F,q,N,X]),A=S({controller:u,files:d,canSubmit:g});A.current={controller:u,files:d,canSubmit:g};let w=S(!0);T(()=>(w.current=!0,()=>{w.current=!1}),[]);let K=async(e)=>{let r=g===void 0?!0:g();if(r!==!0)return{status:"blocked",reason:r};if(k.current)return{status:"blocked",reason:"submission_pending"};if(e===null&&b===void 0)throw Error("Awaitable submission requires onSubmitAsync");let t=C.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let o=p?u.textInput.value:ee(t),c=u?.textInput.getRevision?.(),s=d,I=()=>{if(!w.current)return;let m=A.current;if(m.files!==s)return;if(p){if(c===void 0||m.controller===null||m.controller.textInput.getRevision?.()!==c)return;if(m.controller.textInput.clearSubmitted===void 0)m.controller.textInput.clear();else m.controller.textInput.clearSubmitted()}else if(ee(t)===o)t.reset();N()};k.current=!0;try{if(f?.(o.trim()))return I(),{status:"accepted"};let m=await ur(s,n),z=A.current.canSubmit===void 0?!0:A.current.canSubmit();if(z!==!0)return{status:"blocked",reason:z};if(!w.current)return{status:"blocked",reason:"form_unmounted"};if(m.rejectedCount>0)v?.({code:"accept",message:"One or more images are corrupted and were removed before sending."});if(b!==void 0)await b({text:o,files:m.files});else if(e!==null)await se({text:o,files:m.files},e);return I(),{status:"accepted"}}finally{k.current=!1}},ge=(e)=>{e.preventDefault(),K(e).catch(L)},be=h((e)=>{if(!e.trim())return;if(p&&u)ye(()=>{u.textInput.setInput(e)});C.current?.requestSubmit()},[u,p]),Q=a(To.Provider,{value:()=>K(null),children:Te(Po.Provider,{value:be,children:[a("input",{accept:n?.onSelectFiles?n.accept:M,"aria-label":"Upload files",className:"hidden",multiple:ne,onChange:fe,ref:y,title:"Upload files",type:"file"}),a("form",{className:P("w-full",l),onSubmit:ge,ref:C,"data-tour":"chat-input",...ue,children:a(Fe,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",ae&&"border! border-[rgb(255,0,135)] has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(255,0,135)] dark:border-[rgb(253,93,177)] dark:has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(253,93,177)]"),children:ie})})]})});return p?a(Ft.Provider,{value:J,children:Q}):a(Mo.Provider,{value:J,children:Q})};function sr({className:l,...i}){return a("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",l),...i})}function ar({className:l,...i}){return a(te,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",l),...i})}function lr({className:l,...i}){return a(te,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",l),...i})}function cr({className:l,...i}){return a("div",{className:P("flex items-center gap-1",l),...i})}var j=({variant:l="ghost",className:i,size:n,collapsed:f=!1,...L})=>{let g=f||Z.count(L.children)<=1?"icon-xs":"xs";return a(re,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(f||Z.count(L.children)<=1)&&"size-7",i),size:g,type:"button",variant:l,...L})},dr=({className:l,variant:i="ghost",size:n="icon-xs",status:f,children:L,...g})=>{let b=a(ve,{className:"size-4"});if(f==="submitted")b=a(Ie,{className:"size-4 animate-spin"});else if(f==="streaming")b=a(xe,{className:"size-3 fill-current"});else if(f==="error")b=a(he,{className:"size-4"});return a(re,{"aria-label":"Submit",className:P("bg-foreground text-background hover:bg-foreground/70 size-7 rounded-full p-0 transition-opacity disabled:opacity-50",l),size:n,type:"submit",variant:i,...g,children:L??b})};
|
|
2
|
+
export{rr,sr,ar,lr,cr,j,dr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{E}from"./chunk-q8y2a23c.js";import{createContext as c,useContext as p,useState as f,useSyncExternalStore as x}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as y,DialogContent as D,DialogDescription as L,DialogFooter as w,DialogHeader as P,DialogTitle as H}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as d}from"react/jsx-runtime";var S=c(null),g=c(null),C=c(null);function aa({host:e,client:t,children:n}){let[r,l]=f(null);E(r!==null);let{t:u}=e;return i(S,{value:e,children:i(g,{value:t,children:d(C,{value:l,children:[n,i(y,{open:r!==null,onOpenChange:(v)=>!v&&l(null),children:d(D,{children:[d(P,{children:[i(H,{children:u("sessionList.deleteTitle")}),i(L,{children:u("sessionList.deleteDescription")})]}),d(w,{children:[i(m,{variant:"outline",onClick:()=>l(null),children:u("sessionList.cancel")}),i(m,{onClick:()=>{if(r)h(e,t.delete(r.sessionId));l(null)},children:u("sessionList.delete")})]})]})})]})})})}function s(){let e=p(S);if(e===null)throw Error("Session list host is missing");return e}function ki(){return p(S)}function a(){let e=p(g);if(e===null)throw Error("Session list client is missing");return e}function un(){let e=p(C);if(e===null)throw Error("Session list provider is missing");return e}function o(e){let t=a();return x((n)=>t.store.subscribe(n),()=>e(t.store.getState()),()=>e(t.store.getState()))}function h(e,t){return t.then(()=>{},(n)=>{if(e.reportError)e.reportError(n);else console.error(n)})}
|
|
2
|
+
export{aa,s,ki,a,un,o,h};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{invoke as i}from"@tauri-apps/api/core";import{
|
|
2
|
-
export{
|
|
1
|
+
import{invoke as i}from"@tauri-apps/api/core";import{listen as t,once as n,emit as s,emitTo as a}from"@tauri-apps/api/event";var u={providersRead:()=>i("plugin:alwith-chat|providers_read"),providersSave:(e)=>i("plugin:alwith-chat|providers_save",e),providersSaveCustom:(e)=>i("plugin:alwith-chat|providers_save_custom",e),providersRemoveCustom:(e)=>i("plugin:alwith-chat|providers_remove_custom",e),providersTest:(e)=>i("plugin:alwith-chat|providers_test",e),providersApply:()=>i("plugin:alwith-chat|providers_apply"),providersAccountBind:(e)=>i("plugin:alwith-chat|providers_account_bind",e),providersRefreshManaged:(e)=>i("plugin:alwith-chat|providers_refresh_managed",e),providersClearManaged:()=>i("plugin:alwith-chat|providers_clear_managed"),readSkillDocument:(e)=>i("plugin:alwith-chat|read_skill_document",e),sessionsList:(e)=>i("plugin:alwith-chat|sessions_list",e),sessionsCountTypes:(e)=>i("plugin:alwith-chat|sessions_count_types",e),sessionsPersonaEvidence:(e)=>i("plugin:alwith-chat|sessions_persona_evidence",e),getModelPricing:()=>i("plugin:alwith-chat|get_model_pricing"),scanSessionAggregates:(e)=>i("plugin:alwith-chat|scan_session_aggregates",e),exportWeekSessions:()=>i("plugin:alwith-chat|export_week_sessions"),dailyTokenUsage:(e)=>i("plugin:alwith-chat|daily_token_usage",e),downloadUsageJson:(e)=>i("plugin:alwith-chat|download_usage_json",e),wordCloud:(e)=>i("plugin:alwith-chat|word_cloud",e),readDroppedFile:(e)=>i("plugin:alwith-chat|read_dropped_file",e),clipboardFilePaths:()=>i("plugin:alwith-chat|clipboard_file_paths"),writePastedFile:(e)=>i("plugin:alwith-chat|write_pasted_file",e),readImage:(e)=>i("plugin:alwith-chat|read_image",e),saveFile:(e)=>i("plugin:alwith-chat|save_file",e),writeTextAttachment:(e)=>i("plugin:alwith-chat|write_text_attachment",e),previewFile:(e)=>i("plugin:alwith-chat|preview_file",e)},go={"providers:changed":{name:"providers:changed",listen:(e)=>t("providers:changed",e),once:(e)=>n("providers:changed",e),emit:(e)=>s("providers:changed",e),emitTo:(e,r)=>a(e,"providers:changed",r)},"providers:managed-revoked":{name:"providers:managed-revoked",listen:(e)=>t("providers:managed-revoked",e),once:(e)=>n("providers:managed-revoked",e),emit:(e)=>s("providers:managed-revoked",e),emitTo:(e,r)=>a(e,"providers:managed-revoked",r)}};function Da(e){return typeof e==="object"&&e!==null&&typeof e.code==="string"&&typeof e.message==="string"}function Xa(e){if(Da(e)||e instanceof Error)return e.message;return String(e)}
|
|
2
|
+
export{u,go,Da,Xa};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Ce}from"./chunk-ytkcpeq2.js";import{ke}from"./chunk-33fxyn5r.js";import{w}from"./chunk-4g2412p5.js";import{t,ue}from"./chunk-aj0z9a5r.js";import{isEmbeddedResource as U,isImage as E,isResourceLink as b}from"@nyssance/codex-acp-v2/client";import{DownloadIcon as G,FileIcon as T,ImageOffIcon as z,LoaderCircleIcon as L}from"lucide-react";import{useEffect as S,useState as v}from"react";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as s}from"react/jsx-runtime";function Yn(e){let i=e.split(/[\\/]/).at(-1)??e;if(e.startsWith("file:")||/^https?:/.test(e))i=new URL(e).pathname.split("/").at(-1)??"";try{return decodeURIComponent(i)||"attachment"}catch(a){if(a instanceof URIError)return i||"attachment";throw a}}function Zo(e,i){let a=document.createElement("a");a.href=i,a.download=e,a.click()}function j({reference:e,uri:i}){let{loadGeneratedImage:a,t:d}=t(),[m,f]=v();if(S(()=>{if(!a)return;let u=!0;return a(e).then((r)=>{if(u)f(r)},()=>{if(u)f(null)}),()=>{u=!1}},[a,e]),m===null||!a)return n(C,{block:{type:"resource_link",uri:"codex-image:unavailable",name:i}});if(m===void 0)return n("div",{role:"status","aria-busy":"true",children:n(L,{"aria-label":d("timeline.viewImage"),className:"motion-safe:animate-spin"})});return n(C,{block:{type:"image",uri:i,...m},generated:!0})}function C({block:e,generated:i=!1}){let a=t(),[d,m]=v(!1),[f,u]=v(null);if(b(e)){let p=ke(e);if(i&&p!==null)return n(j,{reference:p,uri:e.uri},p);let B=w(e.uri);if(B!==null)return n(Ce,{app:{id:B,name:e.title??e.name}});if(e.uri==="codex-image:unavailable")return s("span",{className:"text-muted-foreground flex items-center gap-2 rounded-lg border p-3 text-sm",children:[n(z,{className:"size-4"}),a.t("timeline.imageUnavailable")]});let x=Yn(e.uri);return s(g,{variant:"outline",className:"h-auto max-w-full min-w-0 justify-start gap-3 overflow-hidden p-3","aria-label":e.title??e.name,title:e.uri,onClick:()=>a.openLink(e.uri),children:[n(T,{}),s("span",{className:"min-w-0 flex-1 text-start",children:[n("span",{className:"block truncate",children:e.title??e.name}),s("span",{className:"text-muted-foreground block truncate text-xs",children:[(e.title??e.name)!==x&&`${x} · `,e.mimeType??x.split(".").at(-1)?.toUpperCase()]})]})]})}if(!U(e)&&!E(e))return null;let r=E(e)?{uri:e.uri??`image.${e.mimeType.split("/")[1]??"png"}`,mimeType:e.mimeType,blob:e.data}:e.resource,o=Yn(r.uri);if("text"in r)return s("div",{className:"min-w-0",children:[n("pre",{className:"overflow-x-auto whitespace-pre-wrap",children:r.text}),s(g,{variant:"link",size:"sm",className:"max-w-full min-w-0",title:r.uri,onClick:()=>a.openLink(r.uri),children:[n(T,{}),n("span",{className:"truncate",children:o})]})]});let l=`data:${r.mimeType??"application/octet-stream"};base64,${r.blob}`,y=r.mimeType?.toLowerCase().startsWith("image/")&&f!==l,{openImage:I,openImageGallery:h}=a,N=h?()=>h([{src:l,alt:o,uri:r.uri}],0):I&&(()=>I(l)),c=i&&y,F=async()=>{m(!0);try{if(a.saveFile)await a.saveFile(o,r.blob);else Zo(o,l)}catch(p){ue(a,p)}finally{m(!1)}},R=n("img",{src:l,alt:"",className:i?"max-h-[40rem] max-w-full object-contain":"max-h-96 max-w-full rounded object-contain",onError:()=>u(l)});return s("div",{className:c?"codex-generated-image":"flex max-w-full min-w-0 flex-col items-start gap-1",children:[y&&(N===void 0?R:n(g,{variant:"ghost",className:i?"codex-generated-image-preview h-auto max-w-full p-0":"h-auto max-w-full p-0","aria-label":a.t("timeline.viewImage"),onClick:N,children:R})),s(g,{variant:c?"secondary":"link",size:c?"icon":"sm",className:c?"codex-generated-image-download":"max-w-full min-w-0",disabled:d,title:a.t("timeline.download",{name:o}),"aria-label":a.t("timeline.download",{name:o}),onClick:()=>{F()},children:[d?n(L,{className:"motion-safe:animate-spin"}):n(G,{}),!c&&n("span",{className:"truncate",children:o})]})]})}
|
|
2
|
+
export{Yn,Zo,C};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createContext as f,useCallback as n,useContext as s,useEffect as X,useMemo as _,useRef as x,useState as q}from"react";import{jsx as B}from"react/jsx-runtime";var y=f(null),Po=f(null);function il(){return s(Po)}var To=f(null);function rl(){return s(To)}var Ft=f(null);function ye(){let r=s(y);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");return r}var Ot=()=>s(y);function sl(){let r=s(Ft);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");return r}var Y=()=>s(Ft);function yr({initialInput:r="",revision:l,onSubmittedClear:c,onRemoveAttachment:A,attachmentPolicy:p,value:R,onValueChange:U,attachments:L,onAttachmentsChange:S,children:G}){let T=n((t)=>{if(t.type)return t.type;let e=(t.name||"").toLowerCase();if(e.endsWith(".png"))return"image/png";if(e.endsWith(".jpg")||e.endsWith(".jpeg"))return"image/jpeg";if(e.endsWith(".webp"))return"image/webp";if(e.endsWith(".gif"))return"image/gif";if(e.endsWith(".bmp"))return"image/bmp";if(e.endsWith(".svg"))return"image/svg+xml";return""},[]),W=R!==void 0,[J,K]=q(r),a=R??J,i=x({value:a,external:l,revision:0});if(i.current.value!==a||i.current.external!==l)i.current={value:a,external:l,revision:i.current.revision+1};let j=n(()=>i.current.revision,[]),P=n((t)=>{if(i.current.value=t,i.current.revision++,W)U?.(t);else K(t)},[W,U]),h=n(()=>P(""),[P]),I=L!==void 0,[N,Q]=q([]),v=L??N,b=x(v);b.current=v;let u=n((t)=>{let e=typeof t==="function"?t(b.current):t;if(I)S?.(e);else Q(e)},[I,S]),w=x(null),O=x(()=>{}),M=n((t)=>{let e=[...t];if(e.length===0)return;u((m)=>{let d=p===void 0?e:p.uniqueFiles(e,m);return[...m,...d.map((o)=>{let H=p?.sourcePath(o),C=p?.isLocalImage?.(o);return{id:crypto.randomUUID(),type:"file",url:C&&o.size===0?"":URL.createObjectURL(o),mediaType:T(o),filename:o.name,size:o.size,lastModified:o.lastModified,...H===void 0?{}:{sourcePath:H},...C?{localImage:C}:{}}})]})},[p,T,u]),E=n((t)=>{u((e)=>{let m=e.find((d)=>d.id===t);if(m?.url)URL.revokeObjectURL(m.url);return e.filter((d)=>d.id!==t)}),A?.()},[A,u]),k=n(()=>{u((t)=>{for(let e of t)if(e.url)URL.revokeObjectURL(e.url);return[]})},[u]);X(()=>{if(I)return;return()=>{for(let t of b.current)if(t.url)URL.revokeObjectURL(t.url)}},[I]);let z=n(()=>{O.current?.()},[]),F=_(()=>({files:v,add:M,remove:E,clear:k,openFileDialog:z,fileInputRef:w}),[v,M,E,k,z]),D=n((t,e)=>{w.current=t.current,O.current=e},[]),V=_(()=>({textInput:{value:a,setInput:P,clear:h,getRevision:j,clearSubmitted:c??h},attachments:F,__registerFileInput:D}),[a,P,h,j,c,F,D]);return B(y.Provider,{value:V,children:B(Ft.Provider,{value:F,children:G})})}var Mo=f(null);function g(){let r=Y(),l=s(Mo),c=r??l;if(!c)throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return c}
|
|
2
|
+
export{Po,il,To,rl,Ft,ye,Ot,sl,yr,Mo,g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createContext as o,useContext as n,useEffect as r}from"react";var
|
|
2
|
-
export{
|
|
1
|
+
import{createContext as o,useContext as n,useEffect as r}from"react";var Si=o(null);function E(t){let e=n(Si);r(()=>{if(t&&e!==null)return e()},[t,e])}
|
|
2
|
+
export{Si,E};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s,a,
|
|
2
|
-
export{
|
|
1
|
+
import{s,a,un,o,h}from"./chunk-pxbww0j1.js";import{B}from"./chunk-evgfpd16.js";import{De}from"./chunk-95f0wens.js";import{Me}from"./chunk-newkrtrj.js";import{ft,Ne}from"./chunk-p2bn8ypc.js";import{hasRename as F}from"@nyssance/codex-acp-v2/client";import{ArchiveIcon as D,ArchiveRestoreIcon as x,GitForkIcon as A,PencilIcon as H,Trash2Icon as N}from"lucide-react";import{useRef as R,useState as y}from"react";import{jsx as n,jsxs as b,Fragment as C}from"react/jsx-runtime";function oo({sessionRow:e,active:p,onSelect:m,onForked:v=m,onHoverCardOpenChange:c,actions:d}){let t=s(),{t:f,i18n:S}=t,k=a(),l=o((i)=>i.runStates[e.sessionId]),I=un(),u=()=>m(e);return n(De,{"data-session-id":e.sessionId,role:"button",tabIndex:0,active:p,onClick:u,onKeyDown:(i)=>{if(i.key==="Enter"||i.key===" ")i.preventDefault(),u()},media:t.SessionMedia?n(t.SessionMedia,{sessionId:e.sessionId,state:l?.state}):void 0,state:l?.state,interruption:l?.interruption??null,title:e.title??f("sessionList.untitled"),onHoverCardOpenChange:c,hoverCard:n(E,{sessionRow:e,onDelete:()=>I(e),onForked:v,actions:d}),meta:e.updatedAt!==null?n("span",{className:"text-muted-foreground shrink-0 text-xs",children:ft(e.updatedAt,S.language)}):void 0,actions:l!=null?n(Me,{title:f("sessionList.stop"),onStop:()=>h(t,k.stopSession(e.sessionId))}):void 0})}function E({sessionRow:e,onDelete:p,onForked:m,actions:v}){let c=s(),{t:d}=c,t=a(),f=o((r)=>F(r.agent)),S=o((r)=>r.connection==="ready"&&r.agent?.capabilities?.session?.fork!=null),[k,l]=y(!1),[I,u]=y(!1),i=R(!1);return n(Ne,{sessionRow:e,renaming:k,onRename:(r)=>{if(l(!1),r!==null)h(c,t.renameSession(e.sessionId,r))},actions:b(C,{children:[f&&n(B,{icon:n(H,{}),label:d("sessionList.rename"),onClick:()=>l(!0)}),v,e.archived?n(B,{icon:n(x,{}),label:d("sessionList.unarchive"),onClick:()=>void h(c,t.unarchive(e.sessionId))}):b(C,{children:[n(B,{icon:n(A,{}),label:d("sessionList.fork"),disabled:!S||I,onClick:()=>{if(i.current)return;i.current=!0,u(!0),h(c,t.fork(e.sessionId,e.cwd).then((r)=>{let g=t.state.sessionList.find((L)=>L.sessionId===r);if(!g)throw Error("Forked chat is missing from the session list");m(g)}).finally(()=>{i.current=!1,u(!1)}))}}),n(B,{icon:n(D,{}),label:d("sessionList.archive"),onClick:()=>void h(c,t.archive(e.sessionId))})]}),n(B,{variant:"destructive",icon:n(N,{}),label:d("sessionList.delete"),onClick:p})]})})}
|
|
2
|
+
export{oo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createStore as r}from"@alwith/api/client";var
|
|
2
|
-
export{
|
|
1
|
+
import{createStore as r}from"@alwith/api/client";var pt=r({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}});function rs(e){pt.setState({...e,terminals:e.terminals??{}})}function ss(e){if(pt.getState().sessionId===e)pt.setState({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}})}async function as(e,n,t){let i=pt.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{pt,rs,ss,as};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{qe}from"./chunk-aj0z9a5r.js";import{createContext as v,useContext as C,useMemo as a}from"react";import{jsx as r}from"react/jsx-runtime";var i=v(null);function Fn({host:o,client:n,children:t}){let s=a(()=>({host:o,client:n}),[o,n]);return r(qe,{host:o,client:n,children:r(i,{value:s,children:t})})}function e(){let o=C(i);if(o===null)throw Error("Conversation host is missing");return o}function x(o,n){n.catch((t)=>{if(o.reportError)o.reportError(t);else console.error(t)})}
|
|
2
|
+
export{Fn,e,x};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-
|
|
2
|
-
export{
|
|
1
|
+
import{e}from"./chunk-qgrd5xre.js";import{useState as d}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as v,DialogContent as C,DialogDescription as k,DialogFooter as I,DialogHeader as K,DialogTitle as E}from"@nyssance/shadcn/vega/components/ui/dialog";import{Empty as F,EmptyDescription as b,EmptyHeader as T,EmptyTitle as x}from"@nyssance/shadcn/vega/components/ui/empty";import{Field as w,FieldGroup as A,FieldLabel as L}from"@nyssance/shadcn/vega/components/ui/field";import{Input as B}from"@nyssance/shadcn/vega/components/ui/input";import{Spinner as H}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as t,jsxs as i}from"react/jsx-runtime";function P(r,a){switch(r.methodId){case"chat-gpt":return a("connection.signIn");case"chat-gpt-device-code":return a("connection.signInDevice");case"api-key":return a("connection.signInApiKey");default:return r.name}}function an({methods:r,signIn:a}){let{host:g}=e(),{t:o}=g,[p,u]=d(null),[f,l]=d(!1),[c,h]=d(""),y=async(n,s={})=>{u(n);try{await a(n,s)}catch(D){g.reportError?.(D)}finally{u(null)}};return i(F,{children:[i(T,{children:[t(x,{children:o("connection.signIn")}),t(b,{children:o("connection.signInHint")})]}),t("div",{className:"flex flex-wrap justify-center gap-2",children:r.map((n,s)=>i(m,{variant:s===0?"default":"outline",disabled:p!==null,onClick:()=>n.methodId==="api-key"?l(!0):void y(n.methodId),children:[p===n.methodId&&t(H,{"data-icon":"inline-start"}),P(n,o)]},n.methodId))}),t(v,{open:f,onOpenChange:l,children:i(C,{children:[i(K,{children:[t(E,{children:o("connection.apiKeyTitle")}),t(k,{children:o("connection.signInApiKey")})]}),t(A,{children:i(w,{children:[t(L,{htmlFor:"codex-api-key",children:o("connection.apiKeyTitle")}),t(B,{id:"codex-api-key",type:"password",autoComplete:"off",placeholder:o("connection.apiKeyPlaceholder"),value:c,onChange:(n)=>h(n.target.value)})]})}),i(I,{children:[t(m,{variant:"outline",onClick:()=>l(!1),children:o("actions.cancel")}),t(m,{disabled:c.trim().length===0||p!==null,onClick:()=>{l(!1),y("api-key",{"api-key":{apiKey:c.trim()}})},children:o("actions.submit")})]})]})})]})}
|
|
2
|
+
export{an};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ne}from"./chunk-whax282d.js";import{b}from"./chunk-veef1avy.js";import{k}from"./chunk-aj0z9a5r.js";import{Pn}from"./chunk-kvgn4b2n.js";import{Ue}from"./chunk-fxzh4f7c.js";import{yn}from"./chunk-bdea3k6b.js";import{Ge}from"./chunk-359pf448.js";import{Dn}from"./chunk-r2b234a7.js";import{Be}from"./chunk-23kvszfc.js";import{Rn,Ln}from"./chunk-k97dpdcj.js";import{isTauri as y}from"@tauri-apps/api/core";import{useMemo as R,useRef as u}from"react";import{jsx as n,jsxs as P,Fragment as O}from"react/jsx-runtime";var f;function M(){return f??=yn(),f}function F({imagesOnly:r,picker:s,openPicker:t,pickFilePaths:l}){let e=Pn();return n(Ln,{imagesOnly:r,picker:s,openPicker:t,pickFilePaths:l,sessionId:e.session.id,enabled:e.inputReady&&!e.sending&&!e.shellMode,onMention:e.addMention,onBusyChange:e.setAdding})}function va({client:r,providers:s,catalog:t,shellCommands:l=!0,imagesOnly:e=!1,pickFilePaths:d,modelMenu:g,children:h,...m}){let p=u(null),a=u(null),c=!e&&d!==void 0&&y(),C=R(()=>({...Rn,useLocalImages:c,...c?{openFileDialog:()=>{if(!a.current)throw Error("The file picker is not ready");a.current()}}:{},accept:e?"image/png,image/jpeg,image/webp,image/gif":void 0,onSelectFiles(o){if(!p.current)throw Error("The file picker is not ready");p.current(o)}}),[e,c]),{session:i}=m,v=k(r.store,(o)=>o.modelRecovery[i.id]??!1);return P(O,{children:[v&&!ne(i.error?.error)&&n(Dn,{client:r,session:i,providers:s??M(),catalog:t},i.id),P(Ue,{modelMenu:g??{defaultGroup:b,catalog:(o)=>Ge(o,t),headerAction:n(Be,{})},...m,attachmentPolicy:C,onShellCommand:l?(o)=>r.executeShell(i.id,o):void 0,children:[n(F,{imagesOnly:e,picker:p,openPicker:a,pickFilePaths:d}),h]})]})}
|
|
2
|
+
export{va};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t,
|
|
2
|
-
export{
|
|
1
|
+
import{t,ue}from"./chunk-aj0z9a5r.js";import{Zo}from"./chunk-q2ykvjrz.js";import{Do,Ur}from"./chunk-jygp7479.js";import{Hr}from"./chunk-epqyjwrh.js";import{Code as P,Copy as I,Download as k,Eye as B,Maximize2 as L,MoreHorizontal as H,X as O}from"lucide-react";import{useEffect as R,useId as V,useMemo as _,useRef as F,useState as u}from"react";import{Button as w}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as A,DialogClose as U,DialogContent as X}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as j,DropdownMenuContent as q,DropdownMenuItem as y,DropdownMenuTrigger as G}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as l,Fragment as K}from"react/jsx-runtime";function J(m){let r=getComputedStyle(m),e=document.createElement("canvas").getContext("2d");if(!e)throw Error("Unable to resolve diagram colors");let i=(p)=>{e.clearRect(0,0,1,1),e.fillStyle=r.backgroundColor,e.fillRect(0,0,1,1),e.fillStyle=p,e.fillRect(0,0,1,1);let[n,s,d]=e.getImageData(0,0,1,1).data;return`#${[n,s,d].map((f)=>f.toString(16).padStart(2,"0")).join("")}`};return{background:i(r.backgroundColor),primaryColor:i(r.getPropertyValue("--muted").trim()),primaryTextColor:i(r.color),primaryBorderColor:i(r.getPropertyValue("--border").trim()),lineColor:i(r.getPropertyValue("--muted-foreground").trim())}}function Lo({source:m}){let r=t(),{t:e,theme:i}=r,p=`mermaid-${V().replaceAll(":","")}`,[n,s]=u(null),[d,f]=u(!1),[h,b]=u(!1),[v,C]=u(!1),[x,z]=u(!1),c=F(null),g=_(()=>n===null?null:Do(n),[n]);R(()=>{let a=!1;return s(null),(async()=>{try{let M=await import("mermaid");if(a||c.current===null)return;let S=M.default;S.initialize({startOnLoad:!1,securityLevel:"strict",htmlLabels:!1,theme:"base",themeVariables:{...J(c.current),darkMode:i==="dark"}});let N=await S.render(p,m);if(!a)s(N.svg)}catch{if(!a)s(null)}})(),()=>{a=!0}},[p,i,m]);let T=async()=>{try{await(r.copyText?r.copyText(m):navigator.clipboard.writeText(m))}catch(a){if(r.onCopyError)r.onCopyError(a);else ue(r,a)}},D=async()=>{if(n===null||c.current===null||v)return;C(!0);try{let a=await Ur(n,getComputedStyle(c.current).backgroundColor);if(r.saveFile)await r.saveFile("mermaid.png",a);else Zo("mermaid.png",`data:image/png;base64,${a}`)}catch(a){ue(r,a)}finally{C(!1)}},E=o(w,{variant:"ghost",size:"icon-sm","aria-label":e("mermaid.downloadPng"),title:e("mermaid.downloadPng"),disabled:n===null||v,onClick:()=>void D(),children:o(k,{className:"size-4"})});return l("div",{ref:c,className:"group/mermaid bg-background relative my-3 min-w-0 rounded-lg",children:[l("div",{"data-open":x,className:"absolute top-2 right-2 z-10 flex gap-1 opacity-0 transition-opacity group-focus-within/mermaid:opacity-100 group-hover/mermaid:opacity-100 data-[open=true]:opacity-100 [@media(hover:none)]:opacity-100",children:[l(j,{open:x,onOpenChange:z,children:[o(G,{"aria-label":e("mermaid.options"),title:e("mermaid.options"),render:o(w,{variant:"ghost",size:"icon-sm"}),children:o(H,{className:"size-4"})}),l(q,{align:"end",className:"w-40",children:[l(y,{disabled:n===null,onClick:()=>f((a)=>!a),children:[d?o(B,{}):o(P,{}),d?e("mermaid.viewDiagram"):e("mermaid.viewSource")]}),l(y,{onClick:()=>void T(),children:[o(I,{}),e("mermaid.copySource")]}),l(y,{disabled:n===null||v,onClick:()=>void D(),children:[o(k,{}),e("mermaid.downloadPng")]})]})]}),o(w,{variant:"ghost",size:"icon-sm","aria-label":e("mermaid.expand"),title:e("mermaid.expand"),disabled:n===null,onClick:()=>b(!0),children:o(L,{className:"size-4"})})]}),d||n===null?o("pre",{className:"bg-muted/30 overflow-x-auto rounded-lg p-3 pt-11 text-xs",children:o("code",{children:m})}):o("div",{className:"overflow-x-auto rounded-lg px-3 pt-10 pb-3 [&_svg]:mx-auto [&_svg]:max-w-full",dangerouslySetInnerHTML:{__html:n}}),o(A,{open:h&&g!==null,onOpenChange:b,children:o(X,{showCloseButton:!1,className:"bg-background flex h-[calc(100dvh-clamp(1.5rem,10dvh,6rem))] w-[calc(100vw-clamp(1.5rem,10vw,8rem))] max-w-none flex-col gap-2 overflow-hidden p-2 sm:max-w-none sm:p-4",children:h&&g&&o(Hr,{image:g,t:e,actions:l(K,{children:[E,o(U,{"aria-label":e("mermaid.closePreview"),title:e("mermaid.closePreview"),render:o(w,{variant:"ghost",size:"icon-sm"}),children:o(O,{className:"size-4"})})]})},g.src)})})]})}
|
|
2
|
+
export{Lo};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Yt}from"./chunk-dhx1sd4s.js";import{createContext as l,useContext as a,useEffect as p,useSyncExternalStore as u}from"react";import{jsx as o}from"react/jsx-runtime";var g=l(null),P=l(null),r=new WeakMap;function Ze(e){let t=r.get(e);if(!t)t=Yt(e),r.set(e,t);return t}function Es({host:e,client:t,children:n}){let s=Ze(t);return s.bindHost(e),p(()=>s.bindHost(e),[s,e]),o(g,{value:e,children:o(P,{value:t,children:n})})}function d(){let e=a(g);if(e===null)throw Error("Plugins host is missing");return e}function Qe(){let e=a(P);if(e===null)throw Error("Plugins client is missing");return e}function gt(e){let t=Qe();return u((n)=>t.store.subscribe(n),()=>e(t.store.getState()),()=>e(t.store.getState()))}function i(e){let t=Ze(Qe());return u((n)=>t.subscribe(n),()=>e(t.getState()),()=>e(t.getState()))}function Je(e,t){return t.then(()=>{},(n)=>{if(e.reportError)e.reportError(n);else console.error(n)})}
|
|
2
|
+
export{Ze,Es,d,Qe,gt,i,Je};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{k}from"./chunk-aj0z9a5r.js";import{e}from"./chunk-qgrd5xre.js";import{useRef as y,useState as m}from"react";import{Button as u}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as f}from"react/jsx-runtime";function Dn({client:s,session:t}){let{host:r}=e(),[a,l]=m(!1),[d,c]=m(null),i=y(!1),p=k(s.store,(o)=>o.connection==="ready"),v=a||!p||t.restoring;async function g(){if(i.current||!p||t.restoring)return;i.current=!0,c(null),l(!0);try{await s.open(t.id,t.cwd)}catch(o){c(o instanceof Error?o.message:String(o))}finally{i.current=!1,l(!1)}}return f("div",{className:"text-muted-foreground flex flex-wrap items-center gap-3 px-4 py-3 text-sm","aria-busy":a,"data-model-recovery":!0,children:[f("div",{className:"min-w-0 flex-1 basis-full",children:[n("p",{children:r.t("provider.modelUnavailable")}),d&&n("p",{role:"alert",className:"text-destructive break-words",children:d})]}),r.openSettings&&n(u,{size:"sm",variant:"outline",onClick:()=>void r.openSettings?.("provider"),children:r.t("settings.provider")}),n(u,{size:"sm",disabled:v,onClick:()=>void g(),children:r.t(t.restoring?"conversation.restoring":"provider.retry")})]})}
|
|
2
|
+
export{Dn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var a=(e)=>String(e).padStart(2,"0");function
|
|
2
|
-
export{
|
|
1
|
+
var a=(e)=>String(e).padStart(2,"0");function $t(e,l="user"){let r=e.replayed||e.items.some((t)=>t._meta?.codex&&typeof t._meta.codex==="object"&&("historyReplay"in t._meta.codex)&&t._meta.codex.historyReplay===!0),n=l==="user"?s(e.user?._meta,"messageSentAt")??(!r?e.user?.at??null:null):s(e.final.at(-1)?._meta,"messageCompletedAt")??e.items.map((t)=>s(t._meta,"turnCompletedAt")).find((t)=>t!==null)??(!r&&e.final.length>0?e.endedAt:null);if(n===null)return null;let o=new Date(n),u=o.toDateString()===new Date().toDateString();return{short:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",...u?{}:{month:"short",day:"numeric"}}).format(o),full:`${o.getFullYear()}-${a(o.getMonth()+1)}-${a(o.getDate())} ${a(o.getHours())}:${a(o.getMinutes())}`}}function s(e,l){let r=e?.codex;if(typeof r!=="object"||r===null)return null;let n=r[l];return typeof n==="number"&&Number.isFinite(n)&&Math.abs(n)<=8640000000000000?n:null}
|
|
2
|
+
export{$t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Gt}from"./chunk-k014w2jg.js";import{cn as v}from"cn";import{XIcon as E}from"lucide-react";import{useCallback as p,useEffect as D,useMemo as X,useRef as N,useState as b}from"react";import{Dialog as _,DialogClose as L,DialogContent as j,DialogTitle as A}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as F}from"react/jsx-runtime";function fr({open:l,onOpenChange:y,url:h,filename:M,scale:d,onScaleChange:f,containerRef:z,containerClassName:H,dialogContentClassName:P,imageClassName:T}){let g=p((e)=>Math.min(4,Math.max(0.25,e)),[]),[I,O]=b(1),o=g(d??I),R=N(null),s=z??R,S=N(null),[m,x]=b({width:0,height:0}),[C,W]=b({width:0,height:0}),w=p((e)=>{let n=g(e);if(typeof f==="function"){f(n);return}O(n)},[f,g]);D(()=>{if(!l)return;if(!h)return;if(typeof d==="number")return;O(1)},[l,h,d]),D(()=>{if(!l)return;let e=s.current;if(!e)return;let n=()=>{x({width:e.clientWidth,height:e.clientHeight})};n();let t=new ResizeObserver(n);return t.observe(e),()=>{t.disconnect()}},[s,l]);let Z=p(()=>{w(1)},[w]),r=X(()=>{let{width:e,height:n}=C,{width:t,height:a}=m;if(e===0||n===0)return{width:0,height:0};if(t===0||a===0)return{width:0,height:0};let c=Math.min(t/e,a/n,1),u=e*c,k=n*c;return{width:u*o,height:k*o}},[o,C,m]);if(!h)return null;return i(_,{open:l,onOpenChange:y,children:F(j,{className:v("top-1/2 left-1/2 h-[90vh] max-h-[90vh] w-[90vw]! max-w-[90vw]! -translate-x-1/2 -translate-y-1/2 gap-0 rounded-none bg-transparent p-0 ring-0 sm:w-[90vw]! sm:max-w-[90vw]!",P),showCloseButton:!1,children:[i(A,{className:"sr-only",children:M||"Image preview"}),i(L,{"aria-label":"Close",className:"absolute top-3 right-3 z-10 flex size-10 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur-sm transition-colors hover:bg-black/75",children:i(E,{className:"size-5"})}),i("div",{ref:s,onWheel:(e)=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let n=e.deltaY>0?o-0.2:o+0.2,t=g(Number.parseFloat(n.toFixed(2)));if(t===o)return;let a=s.current,c=S.current,u=a&&c?Gt({container:a,target:c,clientX:e.clientX,clientY:e.clientY,currentScale:o,nextScale:t}):null;if(w(t),a&&u)requestAnimationFrame(()=>{a.scrollTo(u)})},className:v("h-full w-full scrollbar-thin overflow-auto",H),children:i("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.max(m.width,r.width),height:Math.max(m.height,r.height)},children:i("div",{className:"shrink-0",children:i("img",{alt:M||"image preview",className:v("block object-contain select-none",T),decoding:"async",draggable:!1,ref:S,onDoubleClick:Z,onLoad:(e)=>{let n=e.currentTarget;W({width:n.naturalWidth,height:n.naturalHeight});let t=s.current;if(t&&(t.clientWidth||t.clientHeight))x({width:t.clientWidth,height:t.clientHeight})},style:{imageRendering:"auto",width:r.width||void 0,height:r.height||void 0,maxWidth:r.width?"none":"90vw",maxHeight:r.height?"none":"90vh"},src:h})})})})]})})}
|
|
2
|
+
export{fr};
|