zen-code 4.8.1 → 4.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +175 -99
- package/dist/chunk-03bb6pab.js +1 -0
- package/dist/chunk-03d08304.js +1 -0
- package/dist/{chunk-wwn7gw8g.js → chunk-04kzaj7h.js} +3 -3
- package/dist/chunk-09f94dtz.js +1 -0
- package/dist/chunk-0bpvpy2e.js +1 -0
- package/dist/chunk-0ch9bkct.js +1 -0
- package/dist/chunk-0cz1ygrn.js +1 -0
- package/dist/chunk-0dstjr38.js +1 -0
- package/dist/chunk-0gb5n1jp.js +1 -0
- package/dist/{chunk-9k57afdm.js → chunk-0gpa9n28.js} +1 -1
- package/dist/chunk-0mryaqgb.js +1 -0
- package/dist/chunk-0myk23dw.js +1 -0
- package/dist/chunk-0qrqmmqt.js +1 -0
- package/dist/chunk-0teh8cbt.js +2 -0
- package/dist/chunk-1163kxya.js +1 -0
- package/dist/chunk-11ctp51v.js +2 -0
- package/dist/chunk-13f0qh77.js +1 -0
- package/dist/chunk-17zj2hd5.js +1 -0
- package/dist/chunk-1a5zv67s.js +1 -0
- package/dist/chunk-1dwn0qqb.js +1 -0
- package/dist/chunk-1efcgvx0.js +1 -0
- package/dist/chunk-1ggv4msc.js +1 -0
- package/dist/chunk-1mdbzd7e.js +1 -0
- package/dist/chunk-1pm5qfkm.js +1 -0
- package/dist/chunk-1q8wzky6.js +1 -0
- package/dist/chunk-1w5m9c5y.js +2 -0
- package/dist/{chunk-bgpcx3bm.js → chunk-21w7a0t2.js} +2 -2
- package/dist/chunk-2215g4qb.js +2 -0
- package/dist/chunk-25es8s2e.js +1 -0
- package/dist/chunk-28p35k17.js +1 -0
- package/dist/chunk-2evyqqz7.js +2 -0
- package/dist/chunk-2f9mf6mw.js +2 -0
- package/dist/chunk-2gr7rdv0.js +1 -0
- package/dist/chunk-2hjzw0cx.js +1 -0
- package/dist/chunk-2kka9ex2.js +1 -0
- package/dist/chunk-2m3g6fah.js +1 -0
- package/dist/chunk-2qx9kzj1.js +1 -0
- package/dist/chunk-2tg0fzzw.js +2 -0
- package/dist/chunk-2vtz4ypn.js +1 -0
- package/dist/chunk-2w2pzwmm.js +1 -0
- package/dist/chunk-2zqq58q6.js +2 -0
- package/dist/chunk-323aj0k7.js +1 -0
- package/dist/chunk-3b8bw2gg.js +1 -0
- package/dist/chunk-3c791dd5.js +1 -0
- package/dist/chunk-3dqan531.js +1 -0
- package/dist/chunk-3ek4pcr6.js +1 -0
- package/dist/chunk-3mzwewcx.js +1 -0
- package/dist/chunk-3ns6c29z.js +1 -0
- package/dist/chunk-3p4khpea.js +1 -0
- package/dist/chunk-3pd9zqn2.js +1 -0
- package/dist/chunk-3pqm74e3.js +1 -0
- package/dist/{chunk-j1n8jp1w.js → chunk-3s46q55v.js} +2 -2
- package/dist/chunk-3s6j6d1z.js +1 -0
- package/dist/chunk-3tq80kwe.js +1 -0
- package/dist/chunk-3x564va6.js +2 -0
- package/dist/chunk-3z87tvcn.js +1 -0
- package/dist/chunk-40fxbk0k.js +1 -0
- package/dist/chunk-41hzdwnx.js +1 -0
- package/dist/chunk-45dyg3fv.js +1 -0
- package/dist/chunk-4ecfe9a1.js +1 -0
- package/dist/chunk-4g796wg5.js +1 -0
- package/dist/chunk-4j4w856j.js +1 -0
- package/dist/chunk-4mw5szy1.js +1 -0
- package/dist/{chunk-yaa4eesd.js → chunk-4n978rje.js} +2 -2
- package/dist/chunk-4pa2a33z.js +1 -0
- package/dist/chunk-4qs8qf3g.js +1 -0
- package/dist/{chunk-czz2fs2w.js → chunk-4s6z4724.js} +1 -1
- package/dist/chunk-4tgv8687.js +1 -0
- package/dist/chunk-4vr7sc1e.js +1 -0
- package/dist/chunk-4wmmjwq3.js +1 -0
- package/dist/chunk-4z0wk36t.js +1 -0
- package/dist/chunk-4zemyepb.js +1 -0
- package/dist/chunk-501c35tf.js +1 -0
- package/dist/chunk-50hw7e2n.js +1 -0
- package/dist/chunk-51cf1nrg.js +1 -0
- package/dist/chunk-51h1tm3c.js +1 -0
- package/dist/chunk-5743qc09.js +1 -0
- package/dist/chunk-5g0asgdm.js +1 -0
- package/dist/chunk-5gaygdyf.js +1 -0
- package/dist/chunk-5n3h6mhr.js +1 -0
- package/dist/chunk-5vzt6z7d.js +1 -0
- package/dist/chunk-6180vb4q.js +2 -0
- package/dist/chunk-62zhdx11.js +1 -0
- package/dist/chunk-63ghca0g.js +1 -0
- package/dist/chunk-6a35z43a.js +1 -0
- package/dist/chunk-6e734rff.js +1 -0
- package/dist/chunk-6ezeq351.js +1 -0
- package/dist/chunk-6gxwe3hq.js +1 -0
- package/dist/chunk-6hbnk94n.js +1 -0
- package/dist/chunk-6meyz753.js +1 -0
- package/dist/chunk-6nhdwm44.js +1 -0
- package/dist/chunk-6r7b9pg1.js +1 -0
- package/dist/chunk-6rzyzk0g.js +1 -0
- package/dist/chunk-6v5eepr1.js +1 -0
- package/dist/chunk-70gnwjt8.js +1 -0
- package/dist/chunk-72h39xc8.js +1 -0
- package/dist/chunk-76gx2wc0.js +1 -0
- package/dist/chunk-77gv3r7z.js +1 -0
- package/dist/chunk-7893pky5.js +1 -0
- package/dist/chunk-7cenjy4r.js +2 -0
- package/dist/chunk-7dmms791.js +1 -0
- package/dist/chunk-7h9sjfmy.js +1 -0
- package/dist/chunk-7hvw60gp.js +1 -0
- package/dist/chunk-7pntzqpm.js +1 -0
- package/dist/chunk-7zprjevz.js +1 -0
- package/dist/chunk-80jab8dy.js +1 -0
- package/dist/chunk-85j75g9q.js +1 -0
- package/dist/chunk-86em0evs.js +1 -0
- package/dist/chunk-86exrje1.js +1 -0
- package/dist/chunk-88191bqb.js +1 -0
- package/dist/chunk-8chx87e7.js +1 -0
- package/dist/chunk-8evmvqza.js +1 -0
- package/dist/chunk-8hp4t30w.js +1 -0
- package/dist/chunk-8kv8e5sn.js +1 -0
- package/dist/chunk-8m5dqftt.js +1 -0
- package/dist/chunk-8m6adpjf.js +1 -0
- package/dist/chunk-8mmvxxyj.js +1 -0
- package/dist/chunk-8nkp692y.js +1 -0
- package/dist/chunk-8tg10bhe.js +1 -0
- package/dist/chunk-91rrbsk7.js +1 -0
- package/dist/chunk-92pjraxh.js +2 -0
- package/dist/chunk-952k4ak8.js +1 -0
- package/dist/chunk-97bsgfnr.js +1 -0
- package/dist/{chunk-3ep2tag7.js → chunk-98x8wkt6.js} +1 -1
- package/dist/chunk-9c0wnb5t.js +1 -0
- package/dist/chunk-9dh8d15f.js +1 -0
- package/dist/chunk-9dn65rqp.js +1 -0
- package/dist/chunk-9ft87v6s.js +2 -0
- package/dist/chunk-9gnhztzd.js +1 -0
- package/dist/chunk-9h0v5e0k.js +2 -0
- package/dist/{chunk-rrkzfahh.js → chunk-9hkn5b8e.js} +1 -1
- package/dist/chunk-9kydh60d.js +1 -0
- package/dist/chunk-9nb6v3q0.js +2 -0
- package/dist/chunk-9phx46cq.js +2 -0
- package/dist/chunk-9xaygaay.js +2 -0
- package/dist/chunk-9ynmrc70.js +1 -0
- package/dist/chunk-acceg8yk.js +1 -0
- package/dist/chunk-afdat9a4.js +1 -0
- package/dist/chunk-ajtch74a.js +1 -0
- package/dist/chunk-ak0aqr2c.js +1 -0
- package/dist/chunk-ak2n1ckf.js +1 -0
- package/dist/chunk-ak43xwf1.js +1 -0
- package/dist/{chunk-7dp8kq2f.js → chunk-anbr96y3.js} +2 -2
- package/dist/{chunk-5wn1nfqy.js → chunk-aqyqcpz2.js} +2 -2
- package/dist/{chunk-yvhq458c.js → chunk-arppjtcv.js} +1 -1
- package/dist/chunk-azxn0zvz.js +1 -0
- package/dist/chunk-b4fn3tre.js +1 -0
- package/dist/chunk-b68ekt52.js +1 -0
- package/dist/chunk-b6xencpw.js +1 -0
- package/dist/{chunk-3n2b4eb4.js → chunk-b9fn4n7z.js} +2 -2
- package/dist/{chunk-s3fyfrka.js → chunk-ba18by4y.js} +2 -2
- package/dist/chunk-bb9mvt9d.js +1 -0
- package/dist/chunk-bd35cx5s.js +1 -0
- package/dist/chunk-bf0pjbfa.js +1 -0
- package/dist/chunk-bfm294j1.js +1 -0
- package/dist/chunk-bh05aqrf.js +2 -0
- package/dist/chunk-bh33p34p.js +1 -0
- package/dist/chunk-bngqptzm.js +1 -0
- package/dist/chunk-bnrv5f66.js +2 -0
- package/dist/chunk-bwcdkk1e.js +2 -0
- package/dist/chunk-bwjh7xrm.js +1 -0
- package/dist/chunk-bwnx1zht.js +1 -0
- package/dist/chunk-c1345z85.js +1 -0
- package/dist/chunk-c1gpr8nz.js +1 -0
- package/dist/chunk-c1r7zjt3.js +1 -0
- package/dist/chunk-c3b7gwkd.js +1 -0
- package/dist/chunk-c5d87fzk.js +1 -0
- package/dist/chunk-cd37w7qk.js +1 -0
- package/dist/chunk-cegx2zze.js +1 -0
- package/dist/chunk-cm6vfvym.js +1 -0
- package/dist/chunk-crjf70s3.js +1 -0
- package/dist/chunk-crvp4wnc.js +1 -0
- package/dist/chunk-cwvb8zr5.js +1 -0
- package/dist/chunk-cyd358a8.js +1 -0
- package/dist/chunk-d08qq3wd.js +1 -0
- package/dist/chunk-d9hpz80s.js +2 -0
- package/dist/chunk-d9xgby9w.js +1 -0
- package/dist/chunk-dhgjjhh7.js +1 -0
- package/dist/chunk-djmxgj5c.js +1 -0
- package/dist/chunk-dpa9tgf6.js +2 -0
- package/dist/chunk-dvmzq40v.js +1 -0
- package/dist/chunk-dw3081wb.js +1 -0
- package/dist/chunk-dxg8cctv.js +2 -0
- package/dist/chunk-e112438q.js +1 -0
- package/dist/chunk-e2qmvzgm.js +1 -0
- package/dist/chunk-e2vdc3vs.js +1 -0
- package/dist/chunk-eh3cemzk.js +1 -0
- package/dist/chunk-ehpz2t7m.js +1 -0
- package/dist/chunk-ek58k066.js +1 -0
- package/dist/chunk-emdn1c33.js +1 -0
- package/dist/chunk-er06b5kx.js +2 -0
- package/dist/chunk-eyty7ng4.js +1 -0
- package/dist/chunk-f3jbz60e.js +1 -0
- package/dist/chunk-f40x0w1g.js +1 -0
- package/dist/chunk-f6cbjh6q.js +1 -0
- package/dist/chunk-fbf3gztk.js +1 -0
- package/dist/chunk-fcexqvhh.js +1 -0
- package/dist/chunk-fcxgd3qb.js +1 -0
- package/dist/{chunk-cze71w02.js → chunk-feptb1bb.js} +1 -1
- package/dist/chunk-fmmsa2ry.js +2 -0
- package/dist/chunk-frzyyytq.js +1 -0
- package/dist/chunk-fs2mzcgs.js +1 -0
- package/dist/{chunk-15smn69q.js → chunk-g0fa5dyc.js} +2 -2
- package/dist/chunk-g1yt0qc9.js +1 -0
- package/dist/chunk-g30bcqjk.js +1 -0
- package/dist/chunk-g3p0vcay.js +2 -0
- package/dist/chunk-g8k4dhcx.js +1 -0
- package/dist/chunk-g9q5nbz0.js +1 -0
- package/dist/chunk-geyhpd32.js +1 -0
- package/dist/chunk-gh5vbn9x.js +1 -0
- package/dist/chunk-gp1ensbx.js +1 -0
- package/dist/chunk-gphyz2x3.js +1 -0
- package/dist/chunk-gpmj4w3z.js +1 -0
- package/dist/{chunk-5fqt5yg1.js → chunk-gqdapzfq.js} +1 -1
- package/dist/chunk-gtms11w9.js +1 -0
- package/dist/chunk-gy4p2qnz.js +1 -0
- package/dist/chunk-h5k1z56v.js +1 -0
- package/dist/chunk-h8ay3dqc.js +1 -0
- package/dist/chunk-h8de6gyf.js +1 -0
- package/dist/chunk-hgpmrbsr.js +1 -0
- package/dist/chunk-hsq3vxna.js +2 -0
- package/dist/chunk-htgt048s.js +1 -0
- package/dist/chunk-hvekwfwd.js +1 -0
- package/dist/{chunk-j204fejq.js → chunk-hxw717c2.js} +1 -1
- package/dist/chunk-hzejh175.js +1 -0
- package/dist/chunk-j5e4dmw7.js +1 -0
- package/dist/chunk-j8b7x5pr.js +1 -0
- package/dist/chunk-jafhgffb.js +1 -0
- package/dist/chunk-jam7nh0r.js +1 -0
- package/dist/chunk-jh6wwc9v.js +1 -0
- package/dist/chunk-jhjbxj1k.js +1 -0
- package/dist/chunk-jhwm3phf.js +1 -0
- package/dist/chunk-jmzy9per.js +1 -0
- package/dist/chunk-jppcve2j.js +1 -0
- package/dist/chunk-jy5kmp4s.js +1 -0
- package/dist/chunk-k1kzp019.js +2 -0
- package/dist/chunk-k7e2abhq.js +1 -0
- package/dist/chunk-k97swe5s.js +1 -0
- package/dist/chunk-ke9tpkk2.js +1 -0
- package/dist/chunk-kncs6js6.js +1 -0
- package/dist/chunk-ksr76npa.js +1 -0
- package/dist/chunk-ksy4d0za.js +1 -0
- package/dist/chunk-kvb035wf.js +2 -0
- package/dist/chunk-kwgygr4z.js +1 -0
- package/dist/chunk-m3zge9wv.js +1 -0
- package/dist/chunk-m7bwshtn.js +1 -0
- package/dist/chunk-m8mdqeye.js +1 -0
- package/dist/chunk-mcrmg4m8.js +1 -0
- package/dist/chunk-mfexzmw2.js +1 -0
- package/dist/chunk-mjwypsrz.js +1 -0
- package/dist/chunk-mp159559.js +2 -0
- package/dist/chunk-mp6yhf6a.js +1 -0
- package/dist/chunk-mr7em8w4.js +1 -0
- package/dist/chunk-mrkf2b3t.js +434 -0
- package/dist/chunk-msha9pw1.js +1 -0
- package/dist/chunk-mvv3ktys.js +1 -0
- package/dist/chunk-mymqnpgf.js +1 -0
- package/dist/chunk-n220pha2.js +1 -0
- package/dist/chunk-n65ycayf.js +1 -0
- package/dist/{chunk-q8arjxg1.js → chunk-n72x5y7a.js} +1 -1
- package/dist/chunk-n9x46wsq.js +1 -0
- package/dist/chunk-n9zmzbyq.js +1 -0
- package/dist/chunk-na5z94zg.js +2 -0
- package/dist/chunk-nbcah8mh.js +1 -0
- package/dist/chunk-ncs4rnsn.js +1 -0
- package/dist/chunk-nt5n8jcr.js +1 -0
- package/dist/chunk-nv58ta3s.js +1 -0
- package/dist/chunk-nw76mbwc.js +1 -0
- package/dist/chunk-p2z2bacg.js +1 -0
- package/dist/chunk-p3mpqeqw.js +1 -0
- package/dist/chunk-p3p6a3ht.js +1 -0
- package/dist/chunk-p46at2ts.js +1 -0
- package/dist/chunk-p6dgtz38.js +1 -0
- package/dist/chunk-p70r0dds.js +1 -0
- package/dist/{chunk-h5nnz4dy.js → chunk-p89xw4y2.js} +1 -1
- package/dist/chunk-pd4wysbn.js +1 -0
- package/dist/chunk-pe45n68n.js +1 -0
- package/dist/chunk-pf09ha3g.js +1 -0
- package/dist/chunk-pn04v4sv.js +1 -0
- package/dist/{chunk-bjywwcgn.js → chunk-pnhf6jtr.js} +2 -2
- package/dist/chunk-pr7vzg5y.js +1 -0
- package/dist/chunk-psdrzwp5.js +1 -0
- package/dist/chunk-px75djc6.js +1 -0
- package/dist/chunk-q3x300wy.js +1 -0
- package/dist/chunk-q56ns9ta.js +1 -0
- package/dist/chunk-q86xqx6c.js +1 -0
- package/dist/chunk-q9711zm8.js +1 -0
- package/dist/chunk-q9w8vj93.js +2 -0
- package/dist/chunk-qpkn7wvc.js +1 -0
- package/dist/chunk-qrr2ytkg.js +2 -0
- package/dist/chunk-r0gjpz5m.js +1 -0
- package/dist/chunk-r1enj0f0.js +1 -0
- package/dist/chunk-r9r1v9kw.js +1 -0
- package/dist/chunk-rc027n67.js +1 -0
- package/dist/chunk-rgc9k4rf.js +2 -0
- package/dist/chunk-rmrp92n9.js +1 -0
- package/dist/chunk-rv0x9fbs.js +1 -0
- package/dist/chunk-rvxb17kx.js +1 -0
- package/dist/chunk-rxs4gexg.js +1 -0
- package/dist/{chunk-0fhpz98a.js → chunk-rxxn6qxm.js} +2 -2
- package/dist/chunk-s6t5vxm9.js +1 -0
- package/dist/chunk-s6xjfvvd.js +1 -0
- package/dist/chunk-s719ttj9.js +1 -0
- package/dist/chunk-sd6qvm4t.js +1 -0
- package/dist/chunk-shc3fcge.js +1 -0
- package/dist/chunk-ss233wsa.js +1 -0
- package/dist/chunk-stp38gza.js +1 -0
- package/dist/{chunk-c9q11tk2.js → chunk-sws9653v.js} +1 -1
- package/dist/chunk-syme57ea.js +1 -0
- package/dist/chunk-sz3tq28n.js +2 -0
- package/dist/chunk-t0tznkac.js +1 -0
- package/dist/chunk-t32zj7ah.js +1 -0
- package/dist/chunk-t5z5e89a.js +1 -0
- package/dist/chunk-t8w9hqaa.js +1 -0
- package/dist/chunk-t97kks4j.js +1 -0
- package/dist/chunk-tamfhbc6.js +1 -0
- package/dist/chunk-tchg9ygq.js +1 -0
- package/dist/chunk-te7k3eqj.js +1 -0
- package/dist/chunk-tjj6zd94.js +2 -0
- package/dist/chunk-tpgf3t6p.js +1 -0
- package/dist/chunk-tpyp8wqr.js +1 -0
- package/dist/chunk-trx18gxg.js +1 -0
- package/dist/chunk-ts98e90r.js +1 -0
- package/dist/chunk-tv1kqdv9.js +1 -0
- package/dist/chunk-tvbj84md.js +1 -0
- package/dist/chunk-tx71e422.js +1 -0
- package/dist/chunk-ty5eswjv.js +1 -0
- package/dist/chunk-v1e0cwqh.js +1 -0
- package/dist/{chunk-dh3jz71n.js → chunk-v28dexnx.js} +1 -1
- package/dist/chunk-v3bw2mnd.js +1 -0
- package/dist/chunk-v3ta4qyy.js +1 -0
- package/dist/chunk-v85y10pz.js +1 -0
- package/dist/chunk-v8ag7wgx.js +1 -0
- package/dist/chunk-v9b5r8aq.js +1 -0
- package/dist/chunk-vd8byz1r.js +2 -0
- package/dist/chunk-vgvekk29.js +1 -0
- package/dist/chunk-vjvr9n6y.js +1 -0
- package/dist/chunk-vkfgx6sa.js +2 -0
- package/dist/{chunk-kbs4px1b.js → chunk-vkfhjhhh.js} +1 -1
- package/dist/chunk-vtxyeepe.js +2 -0
- package/dist/chunk-vxzscaap.js +1 -0
- package/dist/{chunk-9kc9cea3.js → chunk-vyfvrrc8.js} +2 -2
- package/dist/chunk-w0me5x6g.js +1 -0
- package/dist/{chunk-vjj00e3e.js → chunk-w69pf8zx.js} +2 -2
- package/dist/chunk-w895krdx.js +1 -0
- package/dist/chunk-w8vzpn90.js +1 -0
- package/dist/chunk-wb0ms9q0.js +1 -0
- package/dist/chunk-we3jwpsb.js +2 -0
- package/dist/chunk-wk8sx9ev.js +1 -0
- package/dist/{chunk-jkbtx9va.js → chunk-wtwgpw9g.js} +1 -1
- package/dist/chunk-wy3eznsy.js +2 -0
- package/dist/chunk-x0mnchxz.js +1 -0
- package/dist/chunk-x0qb9311.js +1 -0
- package/dist/chunk-x7g4cwft.js +1 -0
- package/dist/{chunk-6ty22kkt.js → chunk-xb46b3bf.js} +1 -1
- package/dist/chunk-xcea0hn5.js +2 -0
- package/dist/{chunk-kxk71nn0.js → chunk-xh3gtpfd.js} +1 -1
- package/dist/chunk-xk0abc6t.js +1 -0
- package/dist/chunk-xmp5jp4r.js +1 -0
- package/dist/{chunk-vc384abg.js → chunk-xzpqbfjh.js} +1 -1
- package/dist/chunk-y1f3hfaq.js +1 -0
- package/dist/chunk-y3d9nwzf.js +1 -0
- package/dist/chunk-y3gfd4y3.js +1 -0
- package/dist/{chunk-sft6ep0c.js → chunk-y5pf2d0x.js} +1 -1
- package/dist/chunk-y6vatv51.js +1 -0
- package/dist/chunk-y971vkwy.js +1 -0
- package/dist/chunk-yb2kp04v.js +1 -0
- package/dist/chunk-yctck6wf.js +1 -0
- package/dist/chunk-yfasv01s.js +1 -0
- package/dist/chunk-yj27rmw2.js +1 -0
- package/dist/chunk-ypj2k2de.js +1 -0
- package/dist/chunk-yr04s6b7.js +1 -0
- package/dist/chunk-yr48as8z.js +1 -0
- package/dist/chunk-ywas7wb8.js +1 -0
- package/dist/chunk-ywp666sg.js +1 -0
- package/dist/chunk-yx4mdqvf.js +1 -0
- package/dist/chunk-yxwramd1.js +1 -0
- package/dist/chunk-yz8sseev.js +1 -0
- package/dist/chunk-z0abvgpr.js +1 -0
- package/dist/chunk-z46zzhqf.js +1 -0
- package/dist/chunk-z6rwg7bs.js +1 -0
- package/dist/chunk-zag96nyc.js +2 -0
- package/dist/chunk-zb9wth64.js +1 -0
- package/dist/chunk-zkfa00mf.js +1 -0
- package/dist/chunk-znpdxhep.js +1 -0
- package/dist/chunk-zpes0b8m.js +1 -0
- package/dist/{chunk-n1d8xx5k.js → chunk-zqx4fcfe.js} +1 -1
- package/dist/chunk-zt78xjtr.js +2 -0
- package/dist/chunk-ztpff54v.js +1 -0
- package/dist/chunk-zv9ac3c0.js +2 -0
- package/dist/chunk-zx19re81.js +2 -0
- package/dist/cli.js +1 -1
- package/dist/nonInteractive.js +3 -3
- package/dist/zen-keyboard.js +1 -1
- package/package.json +4 -2
- package/dist/chunk-3jek9sxm.js +0 -2
- package/dist/chunk-3znrwnd8.js +0 -1
- package/dist/chunk-4b8yaknt.js +0 -1
- package/dist/chunk-5nzs0q25.js +0 -1
- package/dist/chunk-70a0e941.js +0 -1
- package/dist/chunk-8nhayyat.js +0 -1
- package/dist/chunk-cga0m5sy.js +0 -1
- package/dist/chunk-e0sqjq2h.js +0 -1
- package/dist/chunk-efhkdw2z.js +0 -1
- package/dist/chunk-ew7249h9.js +0 -1
- package/dist/chunk-hww94vjn.js +0 -1
- package/dist/chunk-k67epfhc.js +0 -1
- package/dist/chunk-keqk70wm.js +0 -2
- package/dist/chunk-mg8zpgaz.js +0 -1
- package/dist/chunk-ndtwq2zx.js +0 -2
- package/dist/chunk-pdkbrds7.js +0 -1
- package/dist/chunk-rdc9pxf6.js +0 -1
- package/dist/chunk-vkng13p1.js +0 -424
- package/dist/chunk-wbn1hbxf.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{T as e}from"./chunk-d9hpz80s.js";var n=Object.freeze(JSON.parse('{"displayName":"SCSS","name":"scss","patterns":[{"include":"#variable_setting"},{"include":"#at_rule_forward"},{"include":"#at_rule_use"},{"include":"#at_rule_include"},{"include":"#at_rule_import"},{"include":"#general"},{"include":"#flow_control"},{"include":"#rules"},{"include":"#property_list"},{"include":"#at_rule_mixin"},{"include":"#at_rule_media"},{"include":"#at_rule_function"},{"include":"#at_rule_charset"},{"include":"#at_rule_option"},{"include":"#at_rule_namespace"},{"include":"#at_rule_fontface"},{"include":"#at_rule_page"},{"include":"#at_rule_keyframes"},{"include":"#at_rule_at_root"},{"include":"#at_rule_supports"},{"match":";","name":"punctuation.terminator.rule.css"}],"repository":{"at_rule_at_root":{"begin":"\\\\s*((@)(at-root))(\\\\s+|$)","beginCaptures":{"1":{"name":"keyword.control.at-rule.at-root.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"end":"\\\\s*(?=\\\\{)","name":"meta.at-rule.at-root.scss","patterns":[{"include":"#function_attributes"},{"include":"#functions"},{"include":"#selectors"}]},"at_rule_charset":{"begin":"\\\\s*((@)charset)\\\\b\\\\s*","captures":{"1":{"name":"keyword.control.at-rule.charset.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"end":"\\\\s*((?=;|$))","name":"meta.at-rule.charset.scss","patterns":[{"include":"#variable"},{"include":"#string_single"},{"include":"#string_double"}]},"at_rule_content":{"begin":"\\\\s*((@)content)\\\\b\\\\s*","captures":{"1":{"name":"keyword.control.content.scss"}},"end":"\\\\s*((?=;))","name":"meta.content.scss","patterns":[{"include":"#variable"},{"include":"#selectors"},{"include":"#property_values"}]},"at_rule_each":{"begin":"\\\\s*((@)each)\\\\b\\\\s*","captures":{"1":{"name":"keyword.control.each.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"end":"\\\\s*((?=}))","name":"meta.at-rule.each.scss","patterns":[{"match":"\\\\b(in|,)\\\\b","name":"keyword.control.operator"},{"include":"#variable"},{"include":"#property_values"},{"include":"$self"}]},"at_rule_else":{"begin":"\\\\s*((@)else(\\\\s*(if)?))\\\\s*","captures":{"1":{"name":"keyword.control.else.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"end":"\\\\s*(?=\\\\{)","name":"meta.at-rule.else.scss","patterns":[{"include":"#conditional_operators"},{"include":"#variable"},{"include":"#property_values"}]},"at_rule_extend":{"begin":"\\\\s*((@)extend)\\\\b\\\\s*","captures":{"1":{"name":"keyword.control.at-rule.extend.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"end":"\\\\s*(?=;)","name":"meta.at-rule.extend.scss","patterns":[{"include":"#variable"},{"include":"#selectors"},{"include":"#property_values"}]},"at_rule_fontface":{"patterns":[{"begin":"^\\\\s*((@)font-face)\\\\b","beginCaptures":{"1":{"name":"keyword.control.at-rule.fontface.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"end":"\\\\s*(?=\\\\{)","name":"meta.at-rule.fontface.scss","patterns":[{"include":"#function_attributes"}]}]},"at_rule_for":{"begin":"\\\\s*((@)for)\\\\b\\\\s*","captures":{"1":{"name":"keyword.control.for.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"end":"\\\\s*(?=\\\\{)","name":"meta.at-rule.for.scss","patterns":[{"match":"(==|!=|<=|>=|[<>]|from|to|through)","name":"keyword.control.operator"},{"include":"#variable"},{"include":"#property_values"},{"include":"$self"}]},"at_rule_forward":{"begin":"\\\\s*((@)forward)\\\\b\\\\s*","captures":{"1":{"name":"keyword.control.at-rule.forward.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"end":"\\\\s*(?=;)","name":"meta.at-rule.forward.scss","patterns":[{"match":"\\\\b(as|hide|show)\\\\b","name":"keyword.control.operator"},{"captures":{"1":{"name":"entity.other.attribute-name.module.scss"},"2":{"name":"punctuation.definition.wildcard.scss"}},"match":"\\\\b([-\\\\w]+)(\\\\*)"},{"match":"\\\\b[-\\\\w]+\\\\b","name":"entity.name.function.scss"},{"include":"#variable"},{"include":"#string_single"},{"include":"#string_double"},{"include":"#comment_line"},{"include":"#comment_block"}]},"at_rule_function":{"patterns":[{"begin":"\\\\s*((@)function)\\\\b\\\\s*","captures":{"1":{"name":"keyword.control.at-rule.function.scss"},"2":{"name":"punctuation.definition.keyword.scss"},"3":{"name":"entity.name.function.scss"}},"end":"\\\\s*(?=\\\\{)","name":"meta.at-rule.function.scss","patterns":[{"include":"#function_attributes"}]},{"captures":{"1":{"name":"keyword.control.at-rule.function.scss"},"2":{"name":"punctuation.definition.keyword.scss"},"3":{"name":"entity.name.function.scss"}},"match":"\\\\s*((@)function)\\\\b\\\\s*","name":"meta.at-rule.function.scss"}]},"at_rule_if":{"begin":"\\\\s*((@)if)\\\\b\\\\s*","captures":{"1":{"name":"keyword.control.if.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"end":"\\\\s*(?=\\\\{)","name":"meta.at-rule.if.scss","patterns":[{"include":"#conditional_operators"},{"include":"#variable"},{"include":"#property_values"}]},"at_rule_import":{"begin":"\\\\s*((@)import)\\\\b\\\\s*","captures":{"1":{"name":"keyword.control.at-rule.import.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"end":"\\\\s*((?=;)|(?=}))","name":"meta.at-rule.import.scss","patterns":[{"include":"#variable"},{"include":"#string_single"},{"include":"#string_double"},{"include":"#functions"},{"include":"#comment_line"}]},"at_rule_include":{"patterns":[{"begin":"(?<=@include)\\\\s+(?:([-\\\\w]+)\\\\s*(\\\\.))?([-\\\\w]+)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"variable.scss"},"2":{"name":"punctuation.access.module.scss"},"3":{"name":"entity.name.function.scss"},"4":{"name":"punctuation.definition.parameters.begin.bracket.round.scss"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.scss"}},"name":"meta.at-rule.include.scss","patterns":[{"include":"#function_attributes"}]},{"captures":{"0":{"name":"meta.at-rule.include.scss"},"1":{"name":"variable.scss"},"2":{"name":"punctuation.access.module.scss"},"3":{"name":"entity.name.function.scss"}},"match":"(?<=@include)\\\\s+(?:([-\\\\w]+)\\\\s*(\\\\.))?([-\\\\w]+)"},{"captures":{"0":{"name":"meta.at-rule.include.scss"},"1":{"name":"keyword.control.at-rule.include.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"match":"((@)include)\\\\b"}]},"at_rule_keyframes":{"begin":"(?<=^|\\\\s)(@)(?:-(?:webkit|moz)-)?keyframes\\\\b","beginCaptures":{"0":{"name":"keyword.control.at-rule.keyframes.scss"},"1":{"name":"punctuation.definition.keyword.scss"}},"end":"(?<=})","name":"meta.at-rule.keyframes.scss","patterns":[{"captures":{"1":{"name":"entity.name.function.scss"}},"match":"(?<=@keyframes)\\\\s+((?:[A-Z_a-z][-\\\\w]|-[A-Z_a-z])[-\\\\w]*)"},{"begin":"(?<=@keyframes)\\\\s+(\\")","beginCaptures":{"1":{"name":"punctuation.definition.string.begin.scss"}},"contentName":"entity.name.function.scss","end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.scss"}},"name":"string.quoted.double.scss","patterns":[{"match":"\\\\\\\\(\\\\h{1,6}|.)","name":"constant.character.escape.scss"},{"include":"#interpolation"}]},{"begin":"(?<=@keyframes)\\\\s+(\')","beginCaptures":{"1":{"name":"punctuation.definition.string.begin.scss"}},"contentName":"entity.name.function.scss","end":"\'","endCaptures":{"0":{"name":"punctuation.definition.string.end.scss"}},"name":"string.quoted.single.scss","patterns":[{"match":"\\\\\\\\(\\\\h{1,6}|.)","name":"constant.character.escape.scss"},{"include":"#interpolation"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.keyframes.begin.scss"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.keyframes.end.scss"}},"patterns":[{"match":"\\\\b(?:(?:100|[1-9]\\\\d|\\\\d)%|from|to)(?=\\\\s*\\\\{)","name":"entity.other.attribute-name.scss"},{"include":"#flow_control"},{"include":"#interpolation"},{"include":"#property_list"},{"include":"#rules"}]}]},"at_rule_media":{"patterns":[{"begin":"^\\\\s*((@)media)\\\\b","beginCaptures":{"1":{"name":"keyword.control.at-rule.media.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"end":"\\\\s*(?=\\\\{)","name":"meta.at-rule.media.scss","patterns":[{"include":"#comment_docblock"},{"include":"#comment_block"},{"include":"#comment_line"},{"match":"\\\\b(only)\\\\b","name":"keyword.control.operator.css.scss"},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.media-query.begin.bracket.round.scss"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.media-query.end.bracket.round.scss"}},"name":"meta.property-list.media-query.scss","patterns":[{"begin":"(?<![-a-z])(?=[-a-z])","end":"$|(?![-a-z])","name":"meta.property-name.media-query.scss","patterns":[{"include":"source.css#media-features"},{"include":"source.css#property-names"}]},{"begin":"(:)\\\\s*(?!(\\\\s*\\\\{))","beginCaptures":{"1":{"name":"punctuation.separator.key-value.scss"}},"contentName":"meta.property-value.media-query.scss","end":"\\\\s*(;|(?=[)}]))","endCaptures":{"1":{"name":"punctuation.terminator.rule.scss"}},"patterns":[{"include":"#general"},{"include":"#property_values"}]}]},{"include":"#variable"},{"include":"#conditional_operators"},{"include":"source.css#media-types"}]}]},"at_rule_mixin":{"patterns":[{"begin":"(?<=@mixin)\\\\s+([-\\\\w]+)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"entity.name.function.scss"},"2":{"name":"punctuation.definition.parameters.begin.bracket.round.scss"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.scss"}},"name":"meta.at-rule.mixin.scss","patterns":[{"include":"#function_attributes"}]},{"captures":{"1":{"name":"entity.name.function.scss"}},"match":"(?<=@mixin)\\\\s+([-\\\\w]+)","name":"meta.at-rule.mixin.scss"},{"captures":{"1":{"name":"keyword.control.at-rule.mixin.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"match":"((@)mixin)\\\\b","name":"meta.at-rule.mixin.scss"}]},"at_rule_namespace":{"patterns":[{"begin":"(?<=@namespace)\\\\s+(?=url)","end":"(?=;|$)","name":"meta.at-rule.namespace.scss","patterns":[{"include":"#property_values"},{"include":"#string_single"},{"include":"#string_double"}]},{"begin":"(?<=@namespace)\\\\s+([-\\\\w]*)","captures":{"1":{"name":"entity.name.namespace-prefix.scss"}},"end":"(?=;|$)","name":"meta.at-rule.namespace.scss","patterns":[{"include":"#variables"},{"include":"#property_values"},{"include":"#string_single"},{"include":"#string_double"}]},{"captures":{"1":{"name":"keyword.control.at-rule.namespace.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"match":"((@)namespace)\\\\b","name":"meta.at-rule.namespace.scss"}]},"at_rule_option":{"captures":{"1":{"name":"keyword.control.at-rule.charset.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"match":"^\\\\s*((@)option)\\\\b\\\\s*","name":"meta.at-rule.option.scss"},"at_rule_page":{"patterns":[{"begin":"^\\\\s*((@)page)(?=[:\\\\s])\\\\s*([-:\\\\w]*)","captures":{"1":{"name":"keyword.control.at-rule.page.scss"},"2":{"name":"punctuation.definition.keyword.scss"},"3":{"name":"entity.name.function.scss"}},"end":"\\\\s*(?=\\\\{)","name":"meta.at-rule.page.scss"}]},"at_rule_return":{"begin":"\\\\s*((@)(return))\\\\b","captures":{"1":{"name":"keyword.control.return.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"end":"\\\\s*((?=;))","name":"meta.at-rule.return.scss","patterns":[{"include":"#variable"},{"include":"#property_values"}]},"at_rule_supports":{"begin":"(?<=^|\\\\s)(@)supports\\\\b","captures":{"0":{"name":"keyword.control.at-rule.supports.scss"},"1":{"name":"punctuation.definition.keyword.scss"}},"end":"(?=\\\\{)|$","name":"meta.at-rule.supports.scss","patterns":[{"include":"#logical_operators"},{"include":"#properties"},{"match":"\\\\(","name":"punctuation.definition.condition.begin.bracket.round.scss"},{"match":"\\\\)","name":"punctuation.definition.condition.end.bracket.round.scss"}]},"at_rule_use":{"begin":"\\\\s*((@)use)\\\\b\\\\s*","captures":{"1":{"name":"keyword.control.at-rule.use.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"end":"\\\\s*(?=;)","name":"meta.at-rule.use.scss","patterns":[{"match":"\\\\b(as|with)\\\\b","name":"keyword.control.operator"},{"match":"\\\\b[-\\\\w]+\\\\b","name":"variable.scss"},{"match":"\\\\*","name":"variable.language.expanded-namespace.scss"},{"include":"#string_single"},{"include":"#string_double"},{"include":"#comment_line"},{"include":"#comment_block"},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.parameters.begin.bracket.round.scss"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.scss"}},"patterns":[{"include":"#function_attributes"}]}]},"at_rule_warn":{"begin":"\\\\s*((@)(warn|debug|error))\\\\b\\\\s*","captures":{"1":{"name":"keyword.control.warn.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"end":"\\\\s*(?=;)","name":"meta.at-rule.warn.scss","patterns":[{"include":"#variable"},{"include":"#string_double"},{"include":"#string_single"}]},"at_rule_while":{"begin":"\\\\s*((@)while)\\\\b\\\\s*","captures":{"1":{"name":"keyword.control.while.scss"},"2":{"name":"punctuation.definition.keyword.scss"}},"end":"\\\\s*(?=})","name":"meta.at-rule.while.scss","patterns":[{"include":"#conditional_operators"},{"include":"#variable"},{"include":"#property_values"},{"include":"$self"}]},"comment_block":{"begin":"/\\\\*","beginCaptures":{"0":{"name":"punctuation.definition.comment.scss"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.scss"}},"name":"comment.block.scss"},"comment_docblock":{"begin":"///","beginCaptures":{"0":{"name":"punctuation.definition.comment.scss"}},"end":"(?=$)","name":"comment.block.documentation.scss","patterns":[{"include":"source.sassdoc"}]},"comment_line":{"begin":"//","beginCaptures":{"0":{"name":"punctuation.definition.comment.scss"}},"end":"\\\\n","name":"comment.line.scss"},"comparison_operators":{"match":"==|!=|<=|>=|[<>]","name":"keyword.operator.comparison.scss"},"conditional_operators":{"patterns":[{"include":"#comparison_operators"},{"include":"#logical_operators"}]},"constant_default":{"match":"!default","name":"keyword.other.default.scss"},"constant_functions":{"begin":"(?:([-\\\\w]+)(\\\\.))?([-\\\\w]+)(\\\\()","beginCaptures":{"1":{"name":"variable.scss"},"2":{"name":"punctuation.access.module.scss"},"3":{"name":"support.function.misc.scss"},"4":{"name":"punctuation.section.function.scss"}},"end":"(\\\\))","endCaptures":{"1":{"name":"punctuation.section.function.scss"}},"patterns":[{"include":"#parameters"}]},"constant_important":{"match":"!important","name":"keyword.other.important.scss"},"constant_mathematical_symbols":{"match":"\\\\b([-*+/])\\\\b","name":"support.constant.mathematical-symbols.scss"},"constant_optional":{"match":"!optional","name":"keyword.other.optional.scss"},"constant_sass_functions":{"begin":"(headings|stylesheet-url|rgba?|hsla?|ie-hex-str|red|green|blue|alpha|opacity|hue|saturation|lightness|prefixed|prefix|-moz|-svg|-css2|-pie|-webkit|-ms|font-(?:files|url)|grid-image|image-(?:width|height|url|color)|sprites?|sprite-(?:map|map-name|file|url|position)|inline-(?:font-files|image)|opposite-position|grad-point|grad-end-position|color-stops|color-stops-in-percentages|grad-color-stops|(?:radial|linear)-(?:|svg-)gradient|opacify|fade-?in|transparentize|fade-?out|lighten|darken|saturate|desaturate|grayscale|adjust-(?:hue|lightness|saturation|color)|scale-(?:lightness|saturation|color)|change-color|spin|complement|invert|mix|-compass-(?:list|space-list|slice|nth|list-size)|blank|compact|nth|first-value-of|join|length|append|nest|append-selector|headers|enumerate|range|percentage|unitless|unit|if|type-of|comparable|elements-of-type|quote|unquote|escape|e|sin|cos|tan|abs|round|ceil|floor|pi|translate[XY])(\\\\()","beginCaptures":{"1":{"name":"support.function.misc.scss"},"2":{"name":"punctuation.section.function.scss"}},"end":"(\\\\))","endCaptures":{"1":{"name":"punctuation.section.function.scss"}},"patterns":[{"include":"#parameters"}]},"flow_control":{"patterns":[{"include":"#at_rule_if"},{"include":"#at_rule_else"},{"include":"#at_rule_warn"},{"include":"#at_rule_for"},{"include":"#at_rule_while"},{"include":"#at_rule_each"},{"include":"#at_rule_return"}]},"function_attributes":{"patterns":[{"match":":","name":"punctuation.separator.key-value.scss"},{"include":"#general"},{"include":"#property_values"},{"match":"[;=?@{}]","name":"invalid.illegal.scss"}]},"functions":{"patterns":[{"begin":"([-\\\\w]+)(\\\\()\\\\s*","beginCaptures":{"1":{"name":"support.function.misc.scss"},"2":{"name":"punctuation.section.function.scss"}},"end":"(\\\\))","endCaptures":{"1":{"name":"punctuation.section.function.scss"}},"patterns":[{"include":"#parameters"}]},{"match":"([-\\\\w]+)","name":"support.function.misc.scss"}]},"general":{"patterns":[{"include":"#variable"},{"include":"#comment_docblock"},{"include":"#comment_block"},{"include":"#comment_line"}]},"interpolation":{"begin":"#\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.interpolation.begin.bracket.curly.scss"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.interpolation.end.bracket.curly.scss"}},"name":"variable.interpolation.scss","patterns":[{"include":"#variable"},{"include":"#property_values"}]},"logical_operators":{"match":"\\\\b(not|or|and)\\\\b","name":"keyword.operator.logical.scss"},"map":{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.map.begin.bracket.round.scss"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.map.end.bracket.round.scss"}},"name":"meta.definition.variable.map.scss","patterns":[{"include":"#comment_docblock"},{"include":"#comment_block"},{"include":"#comment_line"},{"captures":{"1":{"name":"support.type.map.key.scss"},"2":{"name":"punctuation.separator.key-value.scss"}},"match":"\\\\b([-\\\\w]+)\\\\s*(:)"},{"match":",","name":"punctuation.separator.delimiter.scss"},{"include":"#map"},{"include":"#variable"},{"include":"#property_values"}]},"operators":{"match":"[-*+/](?!\\\\s*[-*+/])","name":"keyword.operator.css"},"parameters":{"patterns":[{"include":"#variable"},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.begin.bracket.round.scss"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.scss"}},"patterns":[{"include":"#function_attributes"}]},{"include":"#property_values"},{"include":"#comment_block"},{"match":"[^\\\\t \\"\'),]+","name":"variable.parameter.url.scss"},{"match":",","name":"punctuation.separator.delimiter.scss"}]},"parent_selector_suffix":{"captures":{"1":{"name":"punctuation.definition.entity.css"},"2":{"patterns":[{"include":"#interpolation"},{"match":"\\\\\\\\(\\\\h{1,6}|.)","name":"constant.character.escape.scss"},{"match":"[$}]","name":"invalid.illegal.identifier.scss"}]}},"match":"(?<=&)((?:[-0-9A-Z_a-z[^\\\\x00-\\\\x7F]]|\\\\\\\\(?:\\\\h{1,6}|.)|#\\\\{|[$}])+)(?=$|[#)+,.:>\\\\[{|~\\\\s]|/\\\\*)","name":"entity.other.attribute-name.parent-selector-suffix.css"},"properties":{"patterns":[{"begin":"(?<![-a-z])(?=[-a-z])","end":"$|(?![-a-z])","name":"meta.property-name.scss","patterns":[{"include":"source.css#property-names"},{"include":"#at_rule_include"}]},{"begin":"(:)\\\\s*(?!(\\\\s*\\\\{))","beginCaptures":{"1":{"name":"punctuation.separator.key-value.scss"}},"contentName":"meta.property-value.scss","end":"\\\\s*(;|(?=[)}]))","endCaptures":{"1":{"name":"punctuation.terminator.rule.scss"}},"patterns":[{"include":"#general"},{"include":"#property_values"}]}]},"property_list":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.property-list.begin.bracket.curly.scss"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.property-list.end.bracket.curly.scss"}},"name":"meta.property-list.scss","patterns":[{"include":"#flow_control"},{"include":"#rules"},{"include":"#properties"},{"include":"$self"}]},"property_values":{"patterns":[{"include":"#string_single"},{"include":"#string_double"},{"include":"#constant_functions"},{"include":"#constant_sass_functions"},{"include":"#constant_important"},{"include":"#constant_default"},{"include":"#constant_optional"},{"include":"source.css#numeric-values"},{"include":"source.css#property-keywords"},{"include":"source.css#color-keywords"},{"include":"source.css#property-names"},{"include":"#constant_mathematical_symbols"},{"include":"#operators"},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.begin.bracket.round.scss"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.scss"}},"patterns":[{"include":"#general"},{"include":"#property_values"}]}]},"rules":{"patterns":[{"include":"#general"},{"include":"#at_rule_extend"},{"include":"#at_rule_content"},{"include":"#at_rule_include"},{"include":"#at_rule_media"},{"include":"#selectors"}]},"selector_attribute":{"captures":{"1":{"name":"punctuation.definition.attribute-selector.begin.bracket.square.scss"},"2":{"name":"entity.other.attribute-name.attribute.scss","patterns":[{"include":"#interpolation"},{"match":"\\\\\\\\(\\\\h{1,6}|.)","name":"constant.character.escape.scss"},{"match":"[$}]","name":"invalid.illegal.scss"}]},"3":{"name":"keyword.operator.scss"},"4":{"name":"string.unquoted.attribute-value.scss","patterns":[{"include":"#interpolation"},{"match":"\\\\\\\\(\\\\h{1,6}|.)","name":"constant.character.escape.scss"},{"match":"[$}]","name":"invalid.illegal.scss"}]},"5":{"name":"string.quoted.double.attribute-value.scss"},"6":{"name":"punctuation.definition.string.begin.scss"},"7":{"patterns":[{"include":"#interpolation"},{"match":"\\\\\\\\(\\\\h{1,6}|.)","name":"constant.character.escape.scss"},{"match":"[$}]","name":"invalid.illegal.scss"}]},"8":{"name":"punctuation.definition.string.end.scss"},"9":{"name":"string.quoted.single.attribute-value.scss"},"10":{"name":"punctuation.definition.string.begin.scss"},"11":{"patterns":[{"include":"#interpolation"},{"match":"\\\\\\\\(\\\\h{1,6}|.)","name":"constant.character.escape.scss"},{"match":"[$}]","name":"invalid.illegal.scss"}]},"12":{"name":"punctuation.definition.string.end.scss"},"13":{"name":"punctuation.definition.attribute-selector.end.bracket.square.scss"}},"match":"(?i)(\\\\[)\\\\s*((?:[-0-9A-Z_a-z[^\\\\x00-\\\\x7F]]|\\\\\\\\(?:\\\\h{1,6}|.)|#\\\\{|\\\\.?\\\\$|})+?)(?:\\\\s*([$*^|~]?=)\\\\s*(?:((?:[-0-9A-Z_a-z[^\\\\x00-\\\\x7F]]|\\\\\\\\(?:\\\\h{1,6}|.)|#\\\\{|\\\\.?\\\\$|})+)|((\\")(.*?)(\\"))|((\')(.*?)(\'))))?\\\\s*(])","name":"meta.attribute-selector.scss"},"selector_class":{"captures":{"1":{"name":"punctuation.definition.entity.css"},"2":{"patterns":[{"include":"#interpolation"},{"match":"\\\\\\\\(\\\\h{1,6}|.)","name":"constant.character.escape.scss"},{"match":"[$}]","name":"invalid.illegal.scss"}]}},"match":"(\\\\.)((?:[-0-9A-Z_a-z[^\\\\x00-\\\\x7F]]|\\\\\\\\(?:\\\\h{1,6}|.)|#\\\\{|\\\\.?\\\\$|})+)(?=$|[#)+,:>\\\\[{|~\\\\s]|\\\\.[^$]|/\\\\*|;)","name":"entity.other.attribute-name.class.css"},"selector_custom":{"match":"\\\\b([0-9A-Za-z]+(-[0-9A-Za-z]+)+)(?=\\\\.|\\\\s++[^:]|\\\\s*[,\\\\[{]|:(link|visited|hover|active|focus|target|lang|disabled|enabled|checked|indeterminate|root|nth-((?:|last-)(?:child|of-type))|first-child|last-child|first-of-type|last-of-type|only-child|only-of-type|empty|not|valid|invalid)(\\\\([0-9A-Za-z]*\\\\))?)","name":"entity.name.tag.custom.scss"},"selector_id":{"captures":{"1":{"name":"punctuation.definition.entity.css"},"2":{"patterns":[{"include":"#interpolation"},{"match":"\\\\\\\\(\\\\h{1,6}|.)","name":"constant.character.escape.scss"},{"match":"[$}]","name":"invalid.illegal.identifier.scss"}]}},"match":"(#)((?:[-0-9A-Z_a-z[^\\\\x00-\\\\x7F]]|\\\\\\\\(?:\\\\h{1,6}|.)|#\\\\{|\\\\.?\\\\$|})+)(?=$|[#)+,:>\\\\[{|~\\\\s]|\\\\.[^$]|/\\\\*)","name":"entity.other.attribute-name.id.css"},"selector_placeholder":{"captures":{"1":{"name":"punctuation.definition.entity.css"},"2":{"patterns":[{"include":"#interpolation"},{"match":"\\\\\\\\(\\\\h{1,6}|.)","name":"constant.character.escape.scss"},{"match":"[$}]","name":"invalid.illegal.identifier.scss"}]}},"match":"(%)((?:[-0-9A-Z_a-z[^\\\\x00-\\\\x7F]]|\\\\\\\\(?:\\\\h{1,6}|.)|#\\\\{|\\\\.\\\\$|[$}])+)(?=;|$|[#)+,:>\\\\[{|~\\\\s]|\\\\.[^$]|/\\\\*)","name":"entity.other.attribute-name.placeholder.css"},"selector_pseudo_class":{"patterns":[{"begin":"((:)\\\\bnth-(?:|last-)(?:child|of-type))(\\\\()","beginCaptures":{"1":{"name":"entity.other.attribute-name.pseudo-class.css"},"2":{"name":"punctuation.definition.entity.css"},"3":{"name":"punctuation.definition.pseudo-class.begin.bracket.round.css"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.pseudo-class.end.bracket.round.css"}},"patterns":[{"include":"#interpolation"},{"match":"\\\\d+","name":"constant.numeric.css"},{"match":"(?:(?<=\\\\d)n|\\\\b(n|even|odd))\\\\b","name":"constant.other.scss"},{"match":"\\\\w+","name":"invalid.illegal.scss"}]},{"include":"source.css#pseudo-classes"},{"include":"source.css#pseudo-elements"},{"include":"source.css#functional-pseudo-classes"}]},"selectors":{"patterns":[{"include":"source.css#tag-names"},{"include":"#selector_custom"},{"include":"#selector_class"},{"include":"#selector_id"},{"include":"#selector_pseudo_class"},{"include":"#tag_wildcard"},{"include":"#tag_parent_reference"},{"include":"source.css#pseudo-elements"},{"include":"#selector_attribute"},{"include":"#selector_placeholder"},{"include":"#parent_selector_suffix"}]},"string_double":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.scss"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.scss"}},"name":"string.quoted.double.scss","patterns":[{"match":"\\\\\\\\(\\\\h{1,6}|.)","name":"constant.character.escape.scss"},{"include":"#interpolation"}]},"string_single":{"begin":"\'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.scss"}},"end":"\'","endCaptures":{"0":{"name":"punctuation.definition.string.end.scss"}},"name":"string.quoted.single.scss","patterns":[{"match":"\\\\\\\\(\\\\h{1,6}|.)","name":"constant.character.escape.scss"},{"include":"#interpolation"}]},"tag_parent_reference":{"match":"&","name":"entity.name.tag.reference.scss"},"tag_wildcard":{"match":"\\\\*","name":"entity.name.tag.wildcard.scss"},"variable":{"patterns":[{"include":"#variables"},{"include":"#interpolation"}]},"variable_setting":{"begin":"(?=\\\\$[-\\\\w]+\\\\s*:)","contentName":"meta.definition.variable.scss","end":";","endCaptures":{"0":{"name":"punctuation.terminator.rule.scss"}},"patterns":[{"match":"\\\\$[-\\\\w]+(?=\\\\s*:)","name":"variable.scss"},{"begin":":","beginCaptures":{"0":{"name":"punctuation.separator.key-value.scss"}},"end":"(?=;)","patterns":[{"include":"#comment_docblock"},{"include":"#comment_block"},{"include":"#comment_line"},{"include":"#map"},{"include":"#property_values"},{"include":"#variable"},{"match":",","name":"punctuation.separator.delimiter.scss"}]}]},"variables":{"patterns":[{"captures":{"1":{"name":"variable.scss"},"2":{"name":"punctuation.access.module.scss"},"3":{"name":"variable.scss"}},"match":"\\\\b([-\\\\w]+)(\\\\.)(\\\\$[-\\\\w]+)\\\\b"},{"match":"(\\\\$|--)[-0-9A-Z_a-z]+\\\\b","name":"variable.scss"}]}},"scopeName":"source.css.scss","embeddedLangs":["css"]}')),s=[...e,n];
|
|
2
|
+
export{s as J};
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
2
|
+
import{Va as E}from"./chunk-xh3gtpfd.js";import{kc as w}from"./chunk-feptb1bb.js";var j=process.argv.slice(2);async function F(){process.env.LG_TEMP_MESSAGE="true";let f=j.indexOf("--yolo");if(f!==-1)process.env.YOLO_MODE="true",j.splice(f,1);if(globalThis.Bun&&E("~/.zen-code/data/sessions.db"),j[0]==="init")console.log("Please zen-code and use /m to configure models");else if(j[0]==="keyboard")import("./zen-keyboard.js");else if(j[0]==="-p"||j[0]==="--prompt"){let A=j.slice(1).join(" "),{runNonInteractive:q}=await import("./nonInteractive.js");await q(A,!1)}else if(await G()){let{runNonInteractive:q}=await import("./nonInteractive.js");await q(void 0,!0)}else await import("./app.js")}async function G(){return new Promise((f)=>{if(process.stdin.isTTY){f(!1);return}let q=process.stdin.read();if(q)process.stdin.unshift(q),f(!0);else setTimeout(()=>{let B=process.stdin.read();if(B)process.stdin.unshift(B),f(!0);else f(!1)},100)})}F().catch((f)=>{console.error("❌ 执行失败:",f),process.exit(1)});
|
package/dist/nonInteractive.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-
|
|
2
|
-
用法:`),console.error(' zen-code -p "你的任务描述"'),console.error(' echo "内容" | zen-code'),process.exit(1);try{let w={messages:[new
|
|
1
|
+
import"./chunk-98x8wkt6.js";import"./chunk-rxxn6qxm.js";import"./chunk-g0fa5dyc.js";import"./chunk-zqx4fcfe.js";import{sb as A}from"./chunk-3s46q55v.js";import"./chunk-mrkf2b3t.js";import"./chunk-pnhf6jtr.js";import"./chunk-y5pf2d0x.js";import"./chunk-v28dexnx.js";import{bc as N}from"./chunk-4n978rje.js";import"./chunk-wtwgpw9g.js";import"./chunk-vkfhjhhh.js";import"./chunk-0gpa9n28.js";import"./chunk-feptb1bb.js";import{HumanMessage as q}from"langchain";import{AgentPackage as B,ToolRegistry as l,MiddlewareRegistry as P}from"@langgraph-js/standard-agent";async function D(){return new Promise((b,x)=>{let T="";process.stdin.setEncoding("utf8"),process.stdin.on("data",(d)=>{T+=d}),process.stdin.on("end",()=>{b(T)}),process.stdin.on("error",(d)=>{x(d)})})}async function i(b,x=!1){let T=await N();await T.initialize();let d=await T.getConfig(),y=b||"";if(x)try{y=(await D()).trim()}catch(w){throw console.error("❌ 读取 stdin 失败:",w),w}if(!y)console.error("❌ 错误: 未提供输入内容"),console.error(`
|
|
2
|
+
用法:`),console.error(' zen-code -p "你的任务描述"'),console.error(' echo "内容" | zen-code'),process.exit(1);try{let w={messages:[new q(y)],provider_id:d.provider_id,model_id:d.model_id,enable_thinking:d.enable_thinking},E=await A.invoke(w,{recursionLimit:500}),F=E.messages||[],M=F[F.length-1];if(M)console.log(M.text);return E}catch(w){throw console.error(`
|
|
3
3
|
❌ 执行失败: ${w instanceof Error?w.message:String(w)}
|
|
4
|
-
`),w}}export{
|
|
4
|
+
`),w}}export{i as runNonInteractive};
|
package/dist/zen-keyboard.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{$a as i,Ya as h,_a as s,eb as p,fb as u}from"./chunk-04kzaj7h.js";import{gc as n}from"./chunk-feptb1bb.js";var f=n(h(),1);var r=n(u(),1);i(r.jsxDEV(O,{},void 0,!1,void 0,this));function O(){let[m,l]=f.useState(`Press any key...
|
|
2
2
|
`);return p((y,c,g)=>{let t=["\x1B[2J\x1B[H","input:",JSON.stringify(y),"","key:"],o=Object.entries(c).filter(([,e])=>e===!0);for(let[e]of o)t.push(` ${e}: true`);if(o.length===0)t.push(" (no true values)");t.push(JSON.stringify(g,null,2)),l(t.join(`
|
|
3
3
|
`))}),r.jsxDEV(s,{children:m},void 0,!1,void 0,this)}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zen-code",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.3",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "./dist/
|
|
5
|
+
"main": "./dist/cli.js",
|
|
6
6
|
"bin": "./dist/cli.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"kysely-wasm": "^1.2.1",
|
|
41
41
|
"langchain": "1.1.1",
|
|
42
42
|
"lowdb": "^7.0.1",
|
|
43
|
+
"marked": "^17.0.3",
|
|
43
44
|
"micromatch": "^4.0.8",
|
|
44
45
|
"node-notifier": "^10.0.1",
|
|
45
46
|
"node-sqlite3-wasm": "^0.8.53",
|
|
@@ -53,6 +54,7 @@
|
|
|
53
54
|
"zod": "^4.3.5"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
57
|
+
"@langgraph-js/agent-middlewares": "^0.1.0",
|
|
56
58
|
"@codegraph/agent": "^1.0.0",
|
|
57
59
|
"@codegraph/config": "^1.0.0",
|
|
58
60
|
"@codegraph/union-client": "^1.0.0",
|
package/dist/chunk-3jek9sxm.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{M as c}from"./chunk-keqk70wm.js";import{R,T as D}from"./chunk-9kc9cea3.js";import{ca as t,da as B,ea as q,ka as x,la as E,ma as m}from"./chunk-wwn7gw8g.js";import{nb as S}from"./chunk-cze71w02.js";var i=30000;function V(){let z=new AbortController,G=setTimeout(()=>{z.abort(),G=null},i);return{controller:z,cleanup:()=>{if(G!==null)clearTimeout(G),G=null}}}async function a(z,G){let{controller:N,cleanup:Q}=V();try{let H=await fetch(`${G}/models`,{method:"GET",headers:{Authorization:`Bearer ${z}`,"Content-Type":"application/json"},signal:N.signal});if(!H.ok){let Z=await H.text();throw Error(`OpenAI API error (${H.status}): ${H.statusText}`)}return(await H.json()).data.map((Z)=>({id:Z.id,name:Z.id,provider:"openai"})).sort((Z,g)=>Z.id.localeCompare(g.id))}catch(H){if(H.name==="AbortError")throw Error("OpenAI API request timeout (30s)");throw H}finally{Q()}}async function n(z,G){let{controller:N,cleanup:Q}=V();try{let H=await fetch(`${G}/v1/models`,{method:"GET",headers:{"x-api-key":z,"anthropic-version":"2023-06-01","Content-Type":"application/json"},signal:N.signal});if(!H.ok){let Z=await H.text();throw Error(`Anthropic API error (${H.status}): ${H.statusText}`)}return(await H.json()).data.map((Z)=>({id:Z.id,name:Z.display_name||Z.id,provider:"anthropic"}))}catch(H){if(H.name==="AbortError")throw Error("Anthropic API request timeout (30s)");throw H}finally{Q()}}async function d(z,G){let{controller:N,cleanup:Q}=V();try{let H=await fetch(G+"/v1beta/models",{method:"GET",headers:{Authorization:"Bearer "+z},signal:N.signal});if(!H.ok)throw Error(`Gemini API error (${H.status}): Invalid API key`);return(await H.json()).models.map((Z)=>({id:Z.name,name:Z.displayName||Z.name,provider:"gemini"}))}catch(H){if(H.name==="AbortError")throw Error("Gemini API request timeout (30s)");throw H}finally{Q()}}function zz({provider:z,enabled:G=!0}){return R({queryKey:D.models.list(z?.id||"unknown"),queryFn:async()=>{if(!z||!z.apiKey||!z.baseUrl)return[];try{if(z.type==="openai")return await a(z.apiKey,z.baseUrl);else if(z.type==="anthropic")return await n(z.apiKey,z.baseUrl);else if(z.type==="gemini")return await d(z.apiKey,z.baseUrl);return[]}catch(N){throw N}},enabled:G&&!!z&&!!z.apiKey&&!!z.baseUrl,staleTime:600000,retry:(N,Q)=>{if(Q?.message?.includes("timeout"))return N<2;if(Q?.name==="TypeError"||Q?.message?.includes("fetch"))return N<2;return!1}})}var J=S(t(),1);var $=S(E(),1),L=[{id:"openai",label:"OpenAI",defaultUrl:"https://api.openai.com/v1"},{id:"anthropic",label:"Anthropic",defaultUrl:"https://api.anthropic.com"},{id:"gemini",label:"Gemini",defaultUrl:"https://generativelanguage.googleapis.com/v1beta"}],_=[{key:"id",label:"ID",placeholder:"my-provider"},{key:"name",label:"Name",placeholder:"My Provider"},{key:"apiKey",label:"API Key",placeholder:"sk-xxx..."},{key:"url",label:"URL",placeholder:"https://api.xxx.com"}],o=({provider:z,onCancel:G,onSave:N})=>{let{config:Q}=c(),[H,O]=J.useState({id:z?.id||"",type:z?.type||"openai",name:z?.id||"",apiKey:z?.apiKey||"",baseUrl:z?.baseUrl||L[0].defaultUrl}),[Z,g]=J.useState({}),[U,v]=J.useState(0),w=J.useRef(H),C=J.useRef(U),f=J.useRef(Z);J.useEffect(()=>{w.current=H},[H]),J.useEffect(()=>{C.current=U},[U]),J.useEffect(()=>{f.current=Z},[Z]);let u=J.useMemo(()=>{return L.find((X)=>X.id===H.type)||L[0]},[H.type]),k=J.useCallback(()=>{let X=w.current,W={},A=Q?.providers||[];if(!X.id||X.id.length<3||X.id.length>32)W.id="ID 必须为 3-32 个字符";else if(!/^[a-zA-Z0-9_]+$/.test(X.id))W.id="ID 只能包含字母、数字和下划线";else if(A.some((M)=>M.id===X.id&&M.id!==z?.id))W.id="ID 已存在";if(!X.name||X.name.length<2||X.name.length>50)W.name="名称必须为 2-50 个字符";if(!X.apiKey)W.apiKey="API Key 不能为空";if(!X.baseUrl)W.baseUrl="Base URL 不能为空";else if(!X.baseUrl.startsWith("https://"))W.baseUrl="Base URL 必须以 https:// 开头";return g(W),Object.keys(W).length===0},[Q?.providers,z?.id]),h=J.useRef(k);J.useEffect(()=>{h.current=k},[k]);let K=J.useCallback(()=>{if(h.current())N(w.current)},[N]),P=J.useCallback(()=>{let X=w.current.type,A=(L.findIndex((Y)=>Y.id===X)+1)%L.length,M=L[A];O((Y)=>({...Y,type:M.id,baseUrl:Y.baseUrl||M.defaultUrl}))},[]),b=J.useCallback((X)=>{let W=C.current,A=X==="next"?(W+1)%_.length:(W-1+_.length)%_.length;v(A)},[]),p=(X)=>{let W=_[X];if(W.key==="url")return"baseUrl";return W.key},I=J.useRef(K),T=J.useRef(b),F=J.useRef(P),y=J.useRef(G);J.useEffect(()=>{I.current=K},[K]),J.useEffect(()=>{T.current=b},[b]),J.useEffect(()=>{F.current=P},[P]),J.useEffect(()=>{y.current=G},[G]),x((X,W)=>{if(W.return)I.current();else if(W.escape)y.current();else if(W.tab)T.current(W.shift?"prev":"next");else if(X===" ")F.current()},{isActive:!0});let j=(X)=>{let W=_[X],A=p(X),M=Z[A],Y=U===X;return $.jsxDEV(B,{marginBottom:0,children:[$.jsxDEV(q,{color:Y?"cyan":M?"red":"gray",children:[W.label,": "]},void 0,!0,void 0,this),Y?$.jsxDEV(B,{width:50,children:$.jsxDEV(m,{value:H[A],onChange:(l)=>O((s)=>({...s,[A]:l})),onSubmit:K,placeholder:W.placeholder,maxVisibleLines:1,showCursor:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this):$.jsxDEV(q,{children:H[A]||W.placeholder},void 0,!1,void 0,this),M&&$.jsxDEV(q,{color:"red",children:[" ",M]},void 0,!0,void 0,this)]},W.key,!0,void 0,this)};return $.jsxDEV(B,{flexDirection:"column",paddingX:2,children:[$.jsxDEV(B,{marginTop:1,flexDirection:"column",gap:1,children:[j(0),$.jsxDEV(B,{marginBottom:0,children:[$.jsxDEV(q,{color:U===0?"cyan":"gray",children:"Type: "},void 0,!1,void 0,this),$.jsxDEV(q,{color:"cyan",bold:!0,children:u.label},void 0,!1,void 0,this),$.jsxDEV(q,{color:"gray",children:" [空格切换]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),j(1),j(2),j(3)]},void 0,!0,void 0,this),$.jsxDEV(B,{marginTop:1,children:$.jsxDEV(q,{color:"gray",dimColor:!0,children:[$.jsxDEV(q,{color:"cyan",children:"Enter"},void 0,!1,void 0,this)," 保存 ",$.jsxDEV(q,{color:"cyan",children:"Tab"},void 0,!1,void 0,this)," 切换字段"," ",$.jsxDEV(q,{color:"cyan",children:"Esc"},void 0,!1,void 0,this)," 取消"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},Nz=o;
|
|
2
|
-
export{zz as D,Nz as E};
|
package/dist/chunk-3znrwnd8.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{q as U}from"./chunk-vjj00e3e.js";import"./chunk-s3fyfrka.js";import{R as g,T as D}from"./chunk-9kc9cea3.js";import{ca as f,da as w,ea as X,la as L,pa as V}from"./chunk-wwn7gw8g.js";import{nb as v}from"./chunk-cze71w02.js";var A=v(f(),1);function E(J){let{historyList:O,refreshHistoryList:Y,setHistoryFilter:Z}=U(),W=J?JSON.stringify(J):null,_=W?["history","list",W]:D.history.list();return g({queryKey:_,queryFn:async()=>{if(J)Z(J);return await Y(),O},staleTime:60000})}var G=v(L(),1),C=({onClose:J})=>{let{currentChatId:O,toHistoryChat:Y,createNewChat:Z,refreshHistoryList:W,historyFilter:_}=U(),b=A.useMemo(()=>({metadata:{path:process.cwd()}}),[]),{data:B=[],refetch:y}=E(b),p=A.useRef(W);A.default.useEffect(()=>{p.current=W},[W]);let j=(z)=>z.toLocaleTimeString(),H=(z)=>{switch(z){case"idle":return{emoji:"\uD83D\uDFE2",color:"green",text:"空闲"};case"busy":return{emoji:"\uD83D\uDFE1",color:"yellow",text:"忙碌"};case"interrupted":return{emoji:"\uD83D\uDFE0",color:"orange",text:"中断"};case"error":return{emoji:"\uD83D\uDD34",color:"red",text:"错误"};default:return{emoji:"⚪",color:"gray",text:z}}},N=A.useCallback(async()=>{return B},[B]),P=A.useCallback((z,$,Q)=>{let S=H(z.status),M=z.thread_id===O,m=j(new Date(z.updated_at)),k=Q?">":" ",x=M?"▶":" ",T=(()=>{if(M)return{color:"green",bold:!0};else if(Q)return{color:"cyanBright",bold:!0};else return{color:S.color,bold:!1}})();return G.jsxDEV(w,{children:[G.jsxDEV(X,{bold:T.bold,color:T.color,children:[k,x," ",$+1,". ",z.thread_id.slice(-8)]},void 0,!0,void 0,this),G.jsxDEV(w,{flexGrow:1},void 0,!1,void 0,this),G.jsxDEV(X,{dimColor:!0,children:m},void 0,!1,void 0,this)]},z.thread_id,!0,void 0,this)},[O]),F=A.useCallback((z)=>{return z.thread_id===O},[O]),R=A.useCallback(async(z)=>{if(z.value==="new_chat")Z({});else Y(z);J()},[Z,Y,J]),q=A.useCallback((z)=>{let $=z.find((Q)=>Q.thread_id===O);return $?G.jsxDEV(X,{color:"gray",dimColor:!0,children:["当前: ",G.jsxDEV(X,{color:"green",children:$.thread_id.substring(0,8)},void 0,!1,void 0,this),G.jsxDEV(X,{children:[" ",_?.metadata?.path]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null},[O,_]),K=A.useMemo(()=>({}),[]),I=A.useMemo(()=>({id:"history",title:"历史记录",icon:"\uD83D\uDCDC",dataSource:N,searchable:!0,searchFields:["thread_id"],searchPlaceholder:"搜索对话 ID...",filterable:!1,filters:[],defaultFilter:"all",itemHeight:1,visibleCount:10,renderItem:P,isSelected:F,onSelect:R,showCount:!0,statusInfo:q,keyMap:K}),[N,P,F,R,q,K]);return G.jsxDEV(V,{config:I,onClose:J},void 0,!1,void 0,this)},e=C;export{e as default};
|
package/dist/chunk-4b8yaknt.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{M as k}from"./chunk-keqk70wm.js";import"./chunk-9kc9cea3.js";import{ca as R,da as g,ea as r,ka as B,la as b}from"./chunk-wwn7gw8g.js";import"./chunk-dh3jz71n.js";import"./chunk-yaa4eesd.js";import"./chunk-jkbtx9va.js";import"./chunk-kbs4px1b.js";import"./chunk-9k57afdm.js";import{nb as m}from"./chunk-cze71w02.js";var w=m(R(),1);var u=m(R(),1);var n=m(b(),1),H=({field:e,value:t,isFocused:o})=>n.jsxDEV(g,{flexDirection:"row",children:[n.jsxDEV(r,{bold:o,color:o?"cyan":void 0,children:e.label},void 0,!1,void 0,this),n.jsxDEV(r,{dimColor:!0,children:": "},void 0,!1,void 0,this),n.jsxDEV(r,{color:t?"green":"gray",bold:o,children:t?"ON":"OFF"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),J=({field:e,value:t,isFocused:o})=>n.jsxDEV(g,{flexDirection:"row",children:[n.jsxDEV(r,{bold:o,color:o?"cyan":void 0,children:e.label},void 0,!1,void 0,this),n.jsxDEV(r,{dimColor:!0,children:": "},void 0,!1,void 0,this),n.jsxDEV(r,{color:o?"yellow":void 0,bold:o,children:t??e.min??0},void 0,!1,void 0,this),n.jsxDEV(r,{dimColor:!0,children:" ms"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),L=({field:e,value:t,isFocused:o})=>{let a=e.options?.find((y)=>y.value===t);return n.jsxDEV(g,{flexDirection:"row",children:[n.jsxDEV(r,{bold:o,color:o?"cyan":void 0,children:e.label},void 0,!1,void 0,this),n.jsxDEV(r,{dimColor:!0,children:": "},void 0,!1,void 0,this),n.jsxDEV(r,{color:o?"yellow":void 0,bold:o,children:a?.label||t},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},Y=({field:e,value:t,isFocused:o})=>n.jsxDEV(g,{flexDirection:"row",children:[n.jsxDEV(r,{bold:o,color:o?"cyan":void 0,children:e.label},void 0,!1,void 0,this),n.jsxDEV(r,{dimColor:!0,children:": "},void 0,!1,void 0,this),n.jsxDEV(r,{color:o?"yellow":"gray",bold:o,children:t||e.placeholder||"-"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q=(e)=>{switch(e.field.type){case"toggle":return n.jsxDEV(H,{...e},void 0,!1,void 0,this);case"number":return n.jsxDEV(J,{...e},void 0,!1,void 0,this);case"select":return n.jsxDEV(L,{...e},void 0,!1,void 0,this);case"input":return n.jsxDEV(Y,{...e},void 0,!1,void 0,this);default:return n.jsxDEV(r,{color:"red",children:"Unknown"},void 0,!1,void 0,this)}},M=q;var x=[{key:"compact_mode",label:"紧凑模式",type:"toggle",group:"显示",tab:"General",help:"紧凑显示消息 (Ctrl+O)"},{key:"show_detailed_info",label:"系统信息",type:"toggle",group:"显示",tab:"General",help:"显示系统资源信息"},{key:"enable_thinking",label:"思考模式",type:"toggle",group:"模型",tab:"General",help:"启用模型思考"},{key:"stream_refresh_interval",label:"流刷新间隔",type:"number",group:"模型",tab:"General",min:50,max:1000,step:50,help:"流刷新间隔 (ms)"}],S=(()=>{let e=new Map;return x.forEach((t)=>{let o=t.tab||"General";if(!e.has(o))e.set(o,{id:o,label:o,icon:"⚙"})}),Array.from(e.values())})(),D=(()=>{let e=new Map;return x.forEach((t)=>{if(!e.has(t.group))e.set(t.group,{id:t.group,label:t.group,fields:[]});e.get(t.group).fields.push(t)}),Array.from(e.values())})();function z(e){return x.filter((t)=>(t.tab||"General")===e)}function _(e){let t=z(e),o=new Map;return t.forEach((a)=>{if(!o.has(a.group))o.set(a.group,{id:a.group,label:a.group,fields:[]});o.get(a.group).fields.push(a)}),Array.from(o.values())}var f=m(b(),1);function K(e){switch(e.type){case"toggle":return!1;case"number":return e.min??0;case"select":return e.options?.[0]?.value;case"input":return"";default:return}}var Q=({schema:e,config:t,onUpdate:o,activeTab:a="General"})=>{let y=u.useMemo(()=>_(a),[a]),T=u.useMemo(()=>y.flatMap((l)=>l.fields),[y]),[P,h]=u.useState(0),p=T[P],c=u.useCallback((l,i)=>{o(l.key,i)},[o]),G=u.useCallback((l)=>{c(l,!t[l.key])},[t,c]),A=u.useCallback((l,i)=>{let d=t[l.key]??K(l),F=l.step||1,C=l.min??-1/0,I=l.max??1/0;c(l,Math.max(C,Math.min(I,d+i*F)))},[t,c]),U=u.useCallback((l,i)=>{let d=l.options||[];if(!d.length)return;let C=(d.findIndex((I)=>I.value===t[l.key])+i+d.length)%d.length;c(l,d[C].value)},[t,c]);B((l,i)=>{if(i.upArrow)h((d)=>Math.max(0,d-1));else if(i.downArrow)h((d)=>Math.min(T.length-1,d+1));else if(i.leftArrow||i.rightArrow){let d=i.leftArrow?-1:1;if(p?.type==="toggle")G(p);else if(p?.type==="number")A(p,d);else if(p?.type==="select")U(p,d)}},{isActive:!0});let X=0;return f.jsxDEV(g,{flexDirection:"column",paddingX:2,paddingY:1,children:[y.map((l)=>f.jsxDEV(g,{flexDirection:"column",marginBottom:1,children:[f.jsxDEV(r,{bold:!0,color:"gray",children:["[",l.label,"]"]},void 0,!0,void 0,this),l.fields.map((i)=>{let F=X++===P;return f.jsxDEV(g,{flexDirection:"column",children:[f.jsxDEV(M,{field:i,value:t[i.key],onChange:(C)=>c(i,C),isFocused:F},void 0,!1,void 0,this),F&&i.help&&f.jsxDEV(r,{dimColor:!0,color:"yellow",children:[" ","→ ",i.help]},void 0,!0,void 0,this)]},i.key,!0,void 0,this)})]},l.id,!0,void 0,this)),f.jsxDEV(g,{marginTop:1,children:f.jsxDEV(r,{dimColor:!0,children:"↑↓ 导航 | ←→ 修改"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},v=Q;var s=m(b(),1),W=({onClose:e})=>{let{config:t,updateConfig:o}=k(),[a,y]=w.useState("General"),T=S.length>1,P=w.useCallback(async(p,c)=>{await o({[p]:c})},[o]),h=w.useCallback((p)=>{if(!T)return;let G=(S.findIndex((A)=>A.id===a)+p+S.length)%S.length;y(S[G].id)},[a,T]);if(B((p,c)=>{if(c.escape)e();else if(c.leftArrow&&c.alt)h(-1);else if(c.rightArrow&&c.alt)h(1)},{isActive:t!==null}),!t)return s.jsxDEV(g,{padding:2,children:s.jsxDEV(r,{children:"Loading..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);return s.jsxDEV(g,{flexDirection:"column",width:"100%",borderStyle:"single",borderColor:"gray",children:[s.jsxDEV(g,{paddingX:2,borderBottom:!0,borderColor:"gray",children:s.jsxDEV(r,{bold:!0,color:"cyan",children:"⚙ Settings"},void 0,!1,void 0,this)},void 0,!1,void 0,this),T&&s.jsxDEV(g,{flexDirection:"row",gap:2,paddingX:2,borderBottom:!0,borderColor:"gray",children:S.map((p)=>s.jsxDEV(r,{bold:a===p.id,color:a===p.id?"cyan":"gray",children:[p.icon," ",p.label]},p.id,!0,void 0,this))},void 0,!1,void 0,this),s.jsxDEV(v,{schema:x,config:t,onUpdate:P,activeTab:a},void 0,!1,void 0,this),s.jsxDEV(g,{paddingX:2,borderTop:!0,borderColor:"gray",children:s.jsxDEV(r,{dimColor:!0,children:"Esc: Close | Auto-save | Global: Ctrl+O (Compact)"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},N=W;var O=m(b(),1),Z=({onClose:e})=>{return O.jsxDEV(N,{onClose:e},void 0,!1,void 0,this)},ue=Z;export{ue as default};
|
package/dist/chunk-5nzs0q25.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{G as M,I,L as u}from"./chunk-3n2b4eb4.js";import{ca as A,la as V}from"./chunk-wwn7gw8g.js";import{nb as y}from"./chunk-cze71w02.js";function QP(G){return G?.replace(process.cwd(),".")||G||""}var S=y(A(),1);function o(){let[G,X]=S.useState({width:process.stdout.columns,height:process.stdout.rows}),W=S.useCallback(()=>{X({width:process.stdout.columns,height:process.stdout.rows})},[]);return S.useEffect(()=>{return process.stdout.on("resize",W),()=>{process.stdout.off("resize",W)}},[W]),G}var q=y(A(),1);var s=()=>{return process.env.TERM?.includes("256color")||process.env.TERM==="xterm-256color"||process.env.WT_SESSION!==void 0||process.platform==="darwin"||process.env.TERM_PROGRAM==="vscode"||process.env.TERM_PROGRAM==="iTerm.app"},xP=()=>{if(process.env.TERM_PROGRAM==="iTerm.app")return"iTerm2";if(process.env.WT_SESSION!==void 0)return"Windows Terminal";if(process.env.TERM_PROGRAM==="vscode")return"VSCode";if(process.env.TERM?.includes("screen"))return"GNU Screen";if(process.env.TERM?.includes("tmux"))return"tmux";return process.env.TERM||"unknown"},C={success:{hex:"#4fd6be",fallback:"green"},warning:{hex:"#ffdb95",fallback:"yellow"},error:{hex:"#f7768e",fallback:"red"},info:{hex:"#7dcfff",fallback:"cyan"},muted:{hex:"#565f89",fallback:"gray"},highlight:{hex:"#7dcfff",fallback:"cyanBright"},accent:{hex:"#bb9af7",fallback:"magentaBright"},border:{hex:"#414868",fallback:"gray"},primary:{hex:"#7aa2f7",fallback:"cyan"},secondary:{hex:"#bb9af7",fallback:"magenta"},keyword:{hex:"#bb9af7",fallback:"magenta"},function:{hex:"#7aa2f7",fallback:"blue"},string:{hex:"#9ece6a",fallback:"green"},number:{hex:"#ff9e64",fallback:"yellow"},comment:{hex:"#565f89",fallback:"gray"},variable:{hex:"#c0caf5",fallback:"white"},type:{hex:"#0db9d7",fallback:"cyan"},constant:{hex:"#e0af68",fallback:"yellow"},textPrimary:{hex:"#c0caf5",fallback:"white"},textSecondary:{hex:"#9aa5ce",fallback:"whiteBright"},textMuted:{hex:"#565f89",fallback:"gray"},bg:{hex:"#1a1b26",fallback:"black"},bgCard:{hex:"#24283b",fallback:"black"},indigo:{hex:"#6366f1",fallback:"blue"},purple:{hex:"#a855f7",fallback:"magenta"},pink:{hex:"#ec4899",fallback:"redBright"},rose:{hex:"#f43f5e",fallback:"red"},orange:{hex:"#f97316",fallback:"yellowBright"},amber:{hex:"#f59e0b",fallback:"yellow"},emerald:{hex:"#10b981",fallback:"green"},teal:{hex:"#14b8a6",fallback:"cyan"},sky:{hex:"#0ea5e9",fallback:"blue"}},TP=(G)=>{if(!(G in C))G="sky";return s()?C[G].hex:C[G].fallback};import n from"os";function AP(){try{return n.userInfo().username}catch(G){return process.env.USER||process.env.USERNAME||"User"}}var Q=y(A(),1);var g=y(V(),1),t=50,e=1800000,PP=300000,HP=Q.createContext(null);var uP=({children:G})=>{let[X,W]=Q.useState([]),[F,D]=Q.useState(null),z=Q.useCallback(async($)=>{let J=$.tool;if(!J)return;let{status:Y,editedArgs:K}=$;if(Y==="approved")J.sendResumeData({type:"approve"});else if(Y==="edited"){let H={name:J.message.name,args:K};J.sendResumeData({type:"edit",edited_action:H})}else if(Y==="rejected")J.sendResumeData({type:"reject",message:"User rejected to run this tool"});else console.error("[ChatWrapper] Unknown approval status:",Y)},[]),w=Q.useCallback(()=>{return`approval_${Date.now()}_${Math.random().toString(36).substring(2,9)}`},[]),j=Q.useCallback(($)=>{let J={...$,id:w(),status:"pending",createdAt:new Date};return W((Y)=>{let K=[...Y,J];if(K.length>t){let H=K.filter((P)=>P.status!=="pending");if(H.length>0)return K.filter((P)=>P.id!==H[0].id)}if(Y.length===0)D(J.id);return K}),J.id},[w]),N=Q.useCallback(($,J)=>{W((Y)=>Y.map((K)=>K.id===$?{...K,...J}:K))},[]),h=Q.useCallback(($)=>{W((J)=>{let Y=J.filter((K)=>K.id!==$);if(F===$)D(Y.length>0?Y[0].id:null);return Y})},[F]),_=Q.useCallback(()=>{W(($)=>{let J=$.filter((Y)=>Y.status==="pending");if(J.length===0)D(null);else if(F&&!J.find((Y)=>Y.id===F))D(J[0].id);return J})},[F]),L=Q.useCallback(async()=>{let $=X.filter((J)=>J.status==="approved"||J.status==="edited"||J.status==="rejected");if($.length===0)return;for(let J of $)try{await z(J)}catch(Y){console.error(`[ApprovalContext] Execute approval request failed: ${J.id}`,Y)}_()},[X,z,_]),b=Q.useCallback(async($)=>{await z($)},[z]),B=Q.useMemo(()=>X.some(($)=>$.status==="pending"),[X]),x=Q.useMemo(()=>X.length>0&&!B,[X.length,B]),f=Q.useCallback(()=>{let $=Date.now();W((J)=>J.filter((Y)=>Y.createdAt.getTime()>$-e))},[]);M(()=>{f()},PP),I(()=>{W(($)=>$.map((J)=>({...J,tool:void 0})))}),Q.useEffect(()=>{if(x)L()},[x,L]);let R=Q.useMemo(()=>({requests:X,addApprovalRequest:j,updateApprovalRequest:N,removeApprovalRequest:h,clearCompletedApprovals:_,executeRequest:b,executeApproved:L,hasPendingRequests:B,allRequestsProcessed:x}),[X,j,N,h,_,b,L,B,x]);return g.jsxDEV(HP.Provider,{value:R,children:G},void 0,!1,void 0,this)};var O=y(A(),1);var c=y(V(),1),JP=1800000,WP=300000,d=O.createContext(null),nP=({children:G})=>{let[X,W]=O.useState(""),F=O.useRef(Date.now()),D=O.useCallback(()=>{W("")},[]),z=O.useCallback((j)=>{F.current=Date.now(),W(j)},[]);M(()=>{if(Date.now()-F.current>JP)D()},WP);let w={bufferedMessage:X,setBufferedMessage:z,clearBuffer:D};return c.jsxDEV(d.Provider,{value:w,children:G},void 0,!1,void 0,this)},aP=()=>{let G=O.useContext(d);if(!G)throw Error("useChatInputBuffer must be used within ChatInputBufferProvider");return G};var T=y(A(),1);var YP=y(V(),1),PH=T.createContext(void 0);var Z=y(A(),1);var i=y(V(),1),ZP=100,$P=1800000,GP=300000,l=Z.createContext(null),GH=()=>{let G=Z.useContext(l);if(!G)throw Error("useInteractionContext must be used within InteractionProvider");return G},QH=({children:G,onInteractionSubmit:X})=>{let[W,F]=Z.useState([]),[D,z]=Z.useState(0),w=Z.useCallback(()=>{return`interaction_${Date.now()}_${Math.random().toString(36).substring(2,9)}`},[]),j=Z.useCallback((H,P)=>{let U=new Date,E={id:w(),category:"panel",state:"idle",metadata:{title:P?.metadata?.title,description:P?.metadata?.description,icon:P?.metadata?.icon,priority:P?.metadata?.priority??"medium",groupKey:P?.metadata?.groupKey,messageIndex:P?.metadata?.messageIndex},tool:P?.tool,config:{layout:{border:!0,padding:1,...P?.config?.layout},interaction:{autoSubmit:!1,allowSkip:!1,showPreview:!0,...P?.config?.interaction},style:P?.config?.style??{}},content:H,createdAt:U,updatedAt:U};return F((m)=>{let v=[...m,E];if(v.length>ZP){let p=v.filter((k)=>k.state==="submitted"||k.state==="edited"||k.state==="cancelled");if(p.length>0){let k=p[0].id;return v.filter((r)=>r.id!==k)}}return v}),z((m)=>m+1),E},[w]),N=Z.useCallback((H,P)=>{F((U)=>U.map((E)=>E.id===H?{...E,...P,updatedAt:new Date}:E)),z((U)=>U+1)},[]),h=Z.useCallback((H)=>{F((P)=>P.filter((U)=>U.id!==H)),z((P)=>P+1)},[]),_=Z.useCallback(()=>{F([]),z((H)=>H+1)},[]),L=Z.useCallback((H)=>{return W.find((P)=>P.id===H)},[W]),b=Z.useCallback(()=>{return[...W]},[W]),B=Z.useCallback((H)=>{return W.filter((P)=>P.state===H)},[W]),x=Z.useCallback((H)=>{return W.filter((P)=>P.content.type===H)},[W]),f=Z.useCallback(async()=>{let H=W.filter((P)=>P.state==="submitted"||P.state==="edited"||P.state==="cancelled");for(let P of H)if(!P.resultSent&&X)await X(P),N(P.id,{resultSent:!0})},[W,X,N]),R=Z.useCallback(()=>{F((H)=>H.filter((P)=>P.state==="idle"||P.state==="active")),z((H)=>H+1)},[]),$=Z.useCallback(()=>{let H=Date.now();F((P)=>P.filter((U)=>U.updatedAt.getTime()>H-$P))},[]);M(()=>{$()},GP),I(()=>{F((H)=>H.map((P)=>({...P,tool:void 0})))});let J=Z.useMemo(()=>W.some((H)=>H.state==="idle"||H.state==="active"),[W]),Y=Z.useMemo(()=>W.length>0&&W.every((H)=>H.state==="submitted"||H.state==="edited"||H.state==="cancelled"),[W]);u(()=>{R()},Y&&J===!1?100:null),Z.useEffect(()=>{if(Y&&J===!1)f()},[Y,J,f]);let K=Z.useMemo(()=>({addInteraction:j,updateInteraction:N,removeInteraction:h,clearAll:_,getInteraction:L,getInteractions:b,getInteractionsByState:B,getInteractionsByContent:x,submitInteractions:f,clearCompleted:R,interactions:W,updateCount:D,hasPendingInteractions:J,allInteractionsProcessed:Y}),[j,N,h,_,L,b,B,x,f,R,W,D,J,Y]);return i.jsxDEV(l.Provider,{value:K,children:G},void 0,!1,void 0,this)};export{o as t,QP as u,xP as v,TP as w,AP as x,uP as y,nP as z,aP as A,GH as B,QH as C};
|
package/dist/chunk-70a0e941.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{lb as a}from"./chunk-kbs4px1b.js";import"./chunk-cze71w02.js";export{a as FileSystemSkillStore};
|
package/dist/chunk-8nhayyat.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{wa as a}from"./chunk-15smn69q.js";import"./chunk-n1d8xx5k.js";import"./chunk-cze71w02.js";export{a as MemoriesMiddleware};
|
package/dist/chunk-cga0m5sy.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{mb as a}from"./chunk-9k57afdm.js";import"./chunk-cze71w02.js";export{a as FileSystemPluginStore};
|
package/dist/chunk-e0sqjq2h.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{P as C,R as S,S as y,T as w}from"./chunk-9kc9cea3.js";import{ca as l,da as Z,ea as J,ha as j,ka as d,la as m,na as D,pa as u}from"./chunk-wwn7gw8g.js";import{nb as q,rb as p}from"./chunk-cze71w02.js";var L=q(l(),1);function f({filter:H,enabled:Q=!0}){return S({queryKey:w.tasks.list(H),queryFn:async()=>{let{getTasksStore:X}=await import("./chunk-h5nnz4dy.js"),Y=X(process.cwd());if(await Y.initialize(),H)return await Y.getTasksByStatus(H);return await Y.getAllTasks()},enabled:Q,staleTime:30000})}function I(){let H=C();return y({mutationFn:async(Q)=>{let{getTasksStore:X}=await import("./chunk-h5nnz4dy.js"),Y=X(process.cwd());return await Y.initialize(),await Y.deleteTask(Q)},onSuccess:(Q,X)=>{H.invalidateQueries({queryKey:w.tasks.all}),H.removeQueries({queryKey:w.tasks.detail(X)})}})}var z=q(m(),1),F={pickup:{emoji:"\uD83D\uDCE5",color:"cyan",label:"待领取"},running:{emoji:"\uD83D\uDD04",color:"yellow",label:"运行中"},complete:{emoji:"✅",color:"green",label:"已完成"},error:{emoji:"❌",color:"red",label:"失败"},review:{emoji:"\uD83D\uDC40",color:"blue",label:"待审核"},feedback:{emoji:"\uD83D\uDCAC",color:"magenta",label:"待反馈"}},i={simple:{emoji:"\uD83D\uDFE2",label:"简单"},medium:{emoji:"\uD83D\uDFE1",label:"中等"},complex:{emoji:"\uD83D\uDD34",label:"复杂"}},E=({task:H,onClose:Q,onExecuteTask:X,onDelete:Y})=>{d((K,M)=>{if(M.escape)Q();else if(M.return&&X){if(H.status==="pickup"||H.status==="error"||H.status==="feedback")X(H)}else if((M.backspace||M.delete)&&Y)Y(H)});let R=H.status?F[H.status]:F.pickup,A=H.status==="pickup"||H.status==="error"||H.status==="feedback",G=H.complexity?i[H.complexity]:null;return z.jsxDEV(Z,{flexDirection:"column",paddingX:1,children:[z.jsxDEV(Z,{borderStyle:"single",paddingX:1,marginBottom:1,children:[z.jsxDEV(J,{bold:!0,color:"cyan",children:[R.emoji," 任务预览"]},void 0,!0,void 0,this),z.jsxDEV(Z,{flexGrow:1},void 0,!1,void 0,this),A&&X&&z.jsxDEV(J,{color:"green",children:"Enter 执行"},void 0,!1,void 0,this),Y&&z.jsxDEV(z.Fragment,{children:[A&&X&&z.jsxDEV(J,{dimColor:!0,children:" | "},void 0,!1,void 0,this),z.jsxDEV(J,{color:"red",children:"Delete 删除"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV(J,{dimColor:!0,children:" | "},void 0,!1,void 0,this),z.jsxDEV(J,{dimColor:!0,children:"Esc 退出"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV(Z,{marginBottom:1,children:z.jsxDEV(J,{bold:!0,color:"white",children:H.title},void 0,!1,void 0,this)},void 0,!1,void 0,this),z.jsxDEV(Z,{marginBottom:1,children:[z.jsxDEV(J,{color:R.color,children:[R.emoji," ",R.label]},void 0,!0,void 0,this),G&&z.jsxDEV(z.Fragment,{children:[z.jsxDEV(J,{children:" • "},void 0,!1,void 0,this),z.jsxDEV(J,{children:[G.emoji," ",G.label]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.estimatedTime&&z.jsxDEV(z.Fragment,{children:[z.jsxDEV(J,{children:" • "},void 0,!1,void 0,this),z.jsxDEV(J,{children:["⏱️ ",H.estimatedTime]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV(Z,{marginBottom:1,flexDirection:"column",children:[z.jsxDEV(J,{color:"gray",bold:!0,children:"描述:"},void 0,!1,void 0,this),z.jsxDEV(J,{children:H.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV(Z,{marginBottom:1,children:[z.jsxDEV(J,{color:"gray",children:"ID: "},void 0,!1,void 0,this),z.jsxDEV(J,{dimColor:!0,children:H.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.agentType&&z.jsxDEV(Z,{marginBottom:1,children:[z.jsxDEV(J,{color:"gray",children:"建议 Agent: "},void 0,!1,void 0,this),z.jsxDEV(J,{color:"yellow",children:H.agentType},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.assignedTo&&z.jsxDEV(Z,{marginBottom:1,children:[z.jsxDEV(J,{color:"gray",children:"分配给: "},void 0,!1,void 0,this),z.jsxDEV(J,{color:"blue",children:H.assignedTo},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.threadId&&z.jsxDEV(Z,{marginBottom:1,children:[z.jsxDEV(J,{color:"gray",children:"Thread ID: "},void 0,!1,void 0,this),z.jsxDEV(J,{dimColor:!0,children:H.threadId},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.dependencies&&H.dependencies.length>0&&z.jsxDEV(Z,{marginBottom:1,flexDirection:"column",children:[z.jsxDEV(J,{color:"gray",bold:!0,children:"依赖任务:"},void 0,!1,void 0,this),z.jsxDEV(J,{dimColor:!0,children:H.dependencies.join(", ")},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.acceptanceCriteria&&H.acceptanceCriteria.length>0&&z.jsxDEV(Z,{marginBottom:1,flexDirection:"column",children:[z.jsxDEV(J,{color:"gray",bold:!0,children:"验收标准:"},void 0,!1,void 0,this),H.acceptanceCriteria.map((K,M)=>z.jsxDEV(J,{dimColor:!0,children:[M+1,". ",K]},`ac-${M}-${H.id}`,!0,void 0,this))]},void 0,!0,void 0,this),H.children&&H.children.length>0&&z.jsxDEV(Z,{flexDirection:"column",children:[z.jsxDEV(J,{color:"gray",bold:!0,children:["子任务 (",H.children.length,"):"]},void 0,!0,void 0,this),H.children.map((K,M)=>{let U=K.status?F[K.status]:F.pickup;return z.jsxDEV(Z,{children:z.jsxDEV(J,{color:U.color,children:[U.emoji," ",M+1,". ",K.title]},void 0,!0,void 0,this)},K.id,!1,void 0,this)})]},void 0,!0,void 0,this),H.status==="error"&&H.error&&z.jsxDEV(Z,{marginTop:1,flexDirection:"column",borderStyle:"single",paddingX:1,children:[z.jsxDEV(J,{color:"red",bold:!0,children:"错误:"},void 0,!1,void 0,this),z.jsxDEV(J,{color:"red",children:H.error.message},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},V=E;var $=q(m(),1),P={pickup:{emoji:"\uD83D\uDCE5",color:"cyan",label:"待领取"},running:{emoji:"\uD83D\uDD04",color:"yellow",label:"运行中"},complete:{emoji:"✅",color:"green",label:"已完成"},error:{emoji:"❌",color:"red",label:"失败"},review:{emoji:"\uD83D\uDC40",color:"blue",label:"待审核"},feedback:{emoji:"\uD83D\uDCAC",color:"magenta",label:"待反馈"}},r={simple:{emoji:"\uD83D\uDFE2",label:"简单"},medium:{emoji:"\uD83D\uDFE1",label:"中等"},complex:{emoji:"\uD83D\uDD34",label:"复杂"}},n=({onClose:H,onExecuteTask:Q})=>{let{data:X=[]}=f(),Y=I(),[R,A]=L.useState(null),G=L.useRef(A),K=L.useRef(Q);L.default.useEffect(()=>{G.current=A},[A]),L.default.useEffect(()=>{K.current=Q},[Q]);let M=L.useCallback(()=>{A(null)},[]),U=L.useCallback(async(W)=>{await Y.mutateAsync(W.id),A((N)=>N?.id===W.id?null:N)},[Y]),v=L.useCallback((W,N,B)=>{let O=W.status?P[W.status]:P.pickup,_=W.complexity?r[W.complexity]:null;return $.jsxDEV(D,{isSelected:B,children:$.jsxDEV(Z,{children:[$.jsxDEV(J,{color:"cyan",dimColor:O===P.complete,children:[O.emoji," ",N+1,". ",W.title]},void 0,!0,void 0,this),$.jsxDEV(j,{},void 0,!1,void 0,this),$.jsxDEV(J,{color:"yellow",dimColor:!0,children:O.label},void 0,!1,void 0,this),_&&$.jsxDEV(J,{dimColor:!0,children:[_.emoji," ",_.label]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},`task-${W.id}`,!1,void 0,this)},[]),g=L.useCallback((W)=>{let N=W.filter((b)=>b.status==="running").length,B=W.filter((b)=>b.status==="complete").length,O=W.filter((b)=>b.status==="error").length,_=W.filter((b)=>b.status==="pickup"||b.status==="error"||b.status==="feedback").length;return $.jsxDEV(J,{color:"gray",children:["运行: ",N," | 完成: ",B," | 失败: ",O,_>0&&$.jsxDEV(J,{color:"green",children:[" | 可执行: ",_]},void 0,!0,void 0,this),$.jsxDEV(J,{dimColor:!0,children:" | Backspace 删除"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},[]),h=L.useCallback((W)=>{G.current(W)},[]),c=L.default.useMemo(()=>({id:"tasks",title:"任务看板",icon:"\uD83D\uDCCB",dataSource:async()=>X,searchable:!0,searchFields:["title","description"],searchPlaceholder:"搜索任务...",filterable:!0,filters:[{id:"all",label:"全部",predicate:()=>!0},{id:"pickup",label:"待领取",predicate:(W)=>W.status==="pickup"},{id:"running",label:"运行中",predicate:(W)=>W.status==="running"},{id:"complete",label:"已完成",predicate:(W)=>W.status==="complete"},{id:"error",label:"失败",predicate:(W)=>W.status==="error"}],defaultFilter:"all",itemHeight:3,visibleCount:10,renderItem:v,onSelect:h,onDelete:U,showCount:!0,statusInfo:g}),[X,v,g,h,U]);return $.jsxDEV($.Fragment,{children:R?$.jsxDEV(V,{task:R,onClose:M,onExecuteTask:Q,onDelete:U},void 0,!1,void 0,this):$.jsxDEV(u,{config:c,onClose:H},void 0,!1,void 0,this)},void 0,!1,void 0,this)},Zz=n;export{Zz as default};
|
package/dist/chunk-efhkdw2z.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{kb as a}from"./chunk-jkbtx9va.js";import"./chunk-cze71w02.js";export{a as FileSystemConfigStore};
|
package/dist/chunk-ew7249h9.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ta as a,ua as b,va as c}from"./chunk-0fhpz98a.js";import"./chunk-bjywwcgn.js";import"./chunk-sft6ep0c.js";import"./chunk-dh3jz71n.js";import"./chunk-yaa4eesd.js";import"./chunk-jkbtx9va.js";import"./chunk-kbs4px1b.js";import"./chunk-9k57afdm.js";import"./chunk-cze71w02.js";export{c as getAgentListFromPackage,a as createSubAgentsMiddleware,b as SubAgentsMiddleware};
|
package/dist/chunk-hww94vjn.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as A,b as W}from"./chunk-5wn1nfqy.js";import"./chunk-7dp8kq2f.js";import{U as q,X as R}from"./chunk-bgpcx3bm.js";import{nb as V}from"./chunk-cze71w02.js";var x=V(W(),1);function B(M){if(M===null||typeof M!=="object")return JSON.stringify(M);if(Array.isArray(M))return JSON.stringify(M.map((J)=>B(J)));let F={},G=Object.keys(M).sort();for(let J of G)F[J]=M[J];return JSON.stringify(F,(J,Q)=>{if(Q!==null&&typeof Q==="object"&&!Array.isArray(Q)){let X={},Y=Object.keys(Q).sort();for(let Z of Y)X[Z]=Q[Z];return X}return Q})}var P=[{index:"checkpoints",prefix:"checkpoint:",schema:{"$.thread_id":{type:"TAG",AS:"thread_id"},"$.checkpoint_ns":{type:"TAG",AS:"checkpoint_ns"},"$.checkpoint_id":{type:"TAG",AS:"checkpoint_id"},"$.parent_checkpoint_id":{type:"TAG",AS:"parent_checkpoint_id"},"$.checkpoint_ts":{type:"NUMERIC",AS:"checkpoint_ts"},"$.has_writes":{type:"TAG",AS:"has_writes"},"$.source":{type:"TAG",AS:"source"},"$.step":{type:"NUMERIC",AS:"step"}}},{index:"checkpoint_writes",prefix:"checkpoint_write:",schema:{"$.thread_id":{type:"TAG",AS:"thread_id"},"$.checkpoint_ns":{type:"TAG",AS:"checkpoint_ns"},"$.checkpoint_id":{type:"TAG",AS:"checkpoint_id"},"$.task_id":{type:"TAG",AS:"task_id"},"$.idx":{type:"NUMERIC",AS:"idx"},"$.channel":{type:"TAG",AS:"channel"},"$.type":{type:"TAG",AS:"type"}}}],N=class M extends R{client;ttlConfig;constructor(F,G){super();this.client=F,this.ttlConfig=G}static async fromUrl(F,G){let J=x.createClient({url:F});await J.connect();let Q=new M(J,G);return await Q.ensureIndexes(),Q}async get(F){return(await this.getTuple(F))?.checkpoint}async put(F,G,J,Q){await this.ensureIndexes();let X=F.configurable?.thread_id,Y=F.configurable?.checkpoint_ns??"",Z=F.configurable?.checkpoint_id;if(!X)throw Error("thread_id is required");let _=G.id||q(0),E=`checkpoint:${X}:${Y}:shallow`,H=null,$=null;try{if(H=await this.client.json.get(E),H&&typeof H==="object")$=H.checkpoint_id}catch(O){}if($&&$!==_)await this.cleanupOldCheckpoint(X,Y,$);let L={...G,channel_values:G.channel_values||{},channel_blobs:void 0},U={thread_id:X,checkpoint_ns:Y,checkpoint_id:_,parent_checkpoint_id:Z||null,checkpoint:L,metadata:this.sanitizeMetadata(J),checkpoint_ts:Date.now(),has_writes:"false"};if(this.addSearchableMetadataFields(U,J),await this.client.json.set(E,"$",U),this.ttlConfig?.defaultTTL)await this.applyTTL(E);return{configurable:{thread_id:X,checkpoint_ns:Y,checkpoint_id:_}}}async getTuple(F){let G=F.configurable?.thread_id,J=F.configurable?.checkpoint_ns??"",Q=F.configurable?.checkpoint_id;if(!G)return;let X=`checkpoint:${G}:${J}:shallow`,Y=await this.client.json.get(X);if(!Y)return;if(Q&&Y.checkpoint_id!==Q)return;if(this.ttlConfig?.refreshOnRead&&this.ttlConfig?.defaultTTL)await this.applyTTL(X);let Z=await this.serde.loadsTyped("json",JSON.stringify(Y.checkpoint)),_;if(Y.has_writes==="true")_=await this.loadPendingWrites(Y.thread_id,Y.checkpoint_ns,Y.checkpoint_id);return await this.createCheckpointTuple(Y,Z,_)}async*list(F,G){if(await this.ensureIndexes(),F?.configurable?.thread_id){let J=await this.getTuple(F);if(J)if(G?.filter){if(this.checkMetadataFilterMatch(J.metadata,G.filter))yield J}else yield J}else{let J=[];if(G?.filter){for(let[Y,Z]of Object.entries(G.filter))if(Z===void 0);else if(Z===null);else if(typeof Z==="string"){let _=A(Y),E=A(Z);J.push(`(@${_}:{${E}})`)}else if(typeof Z==="number"){let _=A(Y);J.push(`(@${_}:[${Z} ${Z}])`)}}if(J.length===0)J.push("*");let Q=J.join(" "),X=G?.limit??10;try{let Y=await this.client.ft.search("checkpoints",Q,{LIMIT:{from:0,size:X*2},SORTBY:{BY:"checkpoint_ts",DIRECTION:"DESC"}}),Z=new Set,_=0;for(let E of Y.documents){if(_>=X)break;let H=E.value,$=`${H.thread_id}:${H.checkpoint_ns}`;if(Z.has($))continue;if(Z.add($),G?.filter){if(!this.checkMetadataFilterMatch(H.metadata,G.filter))continue}let L=await this.serde.loadsTyped("json",JSON.stringify(H.checkpoint));yield await this.createCheckpointTuple(H,L),_++}}catch(Y){if(Y.message?.includes("no such index")){let Z=await this.client.keys("checkpoint:*:*:shallow");if(Z.length===0)return;Z.sort().reverse();let _=new Set,E=0,H=G?.limit??10;for(let $ of Z){if(E>=H)break;let L=await this.client.json.get($);if(!L)continue;let U=`${L.thread_id}:${L.checkpoint_ns}`;if(_.has(U))continue;if(_.add(U),G?.filter){if(!this.checkMetadataFilterMatch(L.metadata,G.filter))continue}let O=await this.serde.loadsTyped("json",JSON.stringify(L.checkpoint));yield await this.createCheckpointTuple(L,O),E++}return}throw Y}}}async putWrites(F,G,J){await this.ensureIndexes();let Q=F.configurable?.thread_id,X=F.configurable?.checkpoint_ns??"",Y=F.configurable?.checkpoint_id;if(!Q||!Y)throw Error("thread_id and checkpoint_id are required");let Z=`checkpoint_write:${Q}:${X}:${Y}:${J}:*`,_=await this.client.keys(Z);if(_.length>0)await this.client.del(_);let E=[];for(let $=0;$<G.length;$++){let[L,U]=G[$],O=`checkpoint_write:${Q}:${X}:${Y}:${J}:${$}`;E.push(O);let T={thread_id:Q,checkpoint_ns:X,checkpoint_id:Y,task_id:J,idx:$,channel:L,type:typeof U==="object"?"json":"string",value:U};await this.client.json.set(O,"$",T)}if(E.length>0){let $=`write_keys_zset:${Q}:${X}:${Y}`,L={};if(E.forEach((U,O)=>{L[U]=O}),await this.client.zAdd($,Object.entries(L).map(([U,O])=>({score:O,value:U}))),this.ttlConfig?.defaultTTL)await this.applyTTL(...E,$)}let H=`checkpoint:${Q}:${X}:shallow`;if(await this.client.exists(H)){let $=await this.client.json.get(H);if($)$.has_writes="true",await this.client.json.set(H,"$",$)}}async deleteThread(F){let G=`checkpoint:${F}:*:shallow`,J=await this.client.keys(G);if(J.length>0)await this.client.del(J);let Q=`checkpoint_write:${F}:*`,X=await this.client.keys(Q);if(X.length>0)await this.client.del(X);let Y=`write_keys_zset:${F}:*`,Z=await this.client.keys(Y);if(Z.length>0)await this.client.del(Z)}async end(){await this.client.quit()}addSearchableMetadataFields(F,G){if(!G)return;if("source"in G)F.source=G.source;if("step"in G)F.step=G.step;if("writes"in G)F.writes=typeof G.writes==="object"?JSON.stringify(G.writes):G.writes;if("score"in G)F.score=G.score}async createCheckpointTuple(F,G,J){let Q=await this.serde.loadsTyped("json",JSON.stringify(F.metadata));return{config:{configurable:{thread_id:F.thread_id,checkpoint_ns:F.checkpoint_ns,checkpoint_id:F.checkpoint_id}},checkpoint:G,metadata:Q,parentConfig:F.parent_checkpoint_id?{configurable:{thread_id:F.thread_id,checkpoint_ns:F.checkpoint_ns,checkpoint_id:F.parent_checkpoint_id}}:void 0,pendingWrites:J}}async applyTTL(...F){if(!this.ttlConfig?.defaultTTL)return;let G=Math.floor(this.ttlConfig.defaultTTL*60),J=await Promise.allSettled(F.map((Q)=>this.client.expire(Q,G)));for(let Q=0;Q<J.length;Q++)if(J[Q].status==="rejected")console.warn(`Failed to set TTL for key ${F[Q]}:`,J[Q].reason)}async loadPendingWrites(F,G,J){let Q=`write_keys_zset:${F}:${G}:${J}`,X=await this.client.zRange(Q,0,-1);if(X.length===0)return;let Y=[];for(let Z of X){let _=await this.client.json.get(Z);if(_){let E=await this.serde.loadsTyped("json",JSON.stringify(_.value));Y.push([_.task_id,_.channel,E])}}return Y}checkMetadataFilterMatch(F,G){for(let[J,Q]of Object.entries(G)){let X=F?.[J];if(Q===null){if(!(J in(F||{}))||X!==null)return!1}else if(typeof Q==="object"&&!Array.isArray(Q)){if(typeof X!=="object"||X===null)return!1;if(B(Q)!==B(X))return!1}else if(X!==Q)return!1}return!0}async cleanupOldCheckpoint(F,G,J){let Q=`checkpoint_write:${F}:${G}:${J}:*`,X=await this.client.keys(Q);if(X.length>0)await this.client.del(X);let Y=`write_keys_zset:${F}:${G}:${J}`;await this.client.del(Y);let Z=`checkpoint_blob:${F}:${G}:${J}:*`,_=await this.client.keys(Z);if(_.length>0)await this.client.del(_)}sanitizeMetadata(F){if(!F)return{};let G={};for(let[J,Q]of Object.entries(F)){let X=J.replace(/\x00/g,"");G[X]=typeof Q==="string"?Q.replace(/\x00/g,""):Q}return G}async ensureIndexes(){for(let F of P)try{await this.client.ft.create(F.index,F.schema,{ON:"JSON",PREFIX:F.prefix})}catch(G){if(!G.message?.includes("Index already exists"))console.error(`Failed to create index ${F.index}:`,G.message)}}};export{N as ShallowRedisSaver};
|
package/dist/chunk-k67epfhc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as s,E as r}from"./chunk-3jek9sxm.js";import{L as o}from"./chunk-3n2b4eb4.js";import{M as T}from"./chunk-keqk70wm.js";import"./chunk-9kc9cea3.js";import{ca as l,da as Y,ea as H,ha as u,ka as p,la as f,na as i,pa as t}from"./chunk-wwn7gw8g.js";import"./chunk-dh3jz71n.js";import"./chunk-yaa4eesd.js";import"./chunk-jkbtx9va.js";import"./chunk-kbs4px1b.js";import"./chunk-9k57afdm.js";import{nb as S}from"./chunk-cze71w02.js";var qq=S(l(),1);var _=S(l(),1);var $=S(f(),1),a={openai:"\uD83E\uDD16",anthropic:"\uD83E\uDDE0",gemini:"✨",default:"\uD83D\uDD2E"};var Gq=({onClose:O})=>{let{extraParams:F,config:U,updateConfig:B}=T(),[X,A]=_.useState(""),k=_.useRef([]),G=_.useMemo(()=>{if(!U?.providers||U.providers.length===0)return[];return U.providers.map((q)=>{let Z=q.type||"default";return{id:q.id,label:q.id,icon:a[Z]||a.default,config:q}})},[U?.providers]);_.useMemo(()=>{if(G.length>0&&!X){let q=G.find((Z)=>Z.id===F.provider_id);A(q?.id||G[0].id)}},[G,F.provider_id,X]);let h=G.find((q)=>q.id===X),{data:P,isLoading:w,error:b}=s({provider:h?.config||null,enabled:!!X}),c=_.useMemo(()=>{let q=(P||[]).map((Z)=>({id:Z.id,name:Z.name}));return k.current=q,q},[P]),C=_.useCallback(async()=>{return k.current},[]),I=_.useCallback((q,Z,V)=>{let m=q.id===F.provider_id+"-"+q.id;return $.jsxDEV(i,{isSelected:V,isCurrent:m,children:[$.jsxDEV(H,{bold:!0,children:[Z+1,". ",q.id]},void 0,!0,void 0,this),$.jsxDEV(H,{dimColor:!0,children:[" ",q.name!==q.id?`(${q.name})`:""]},void 0,!0,void 0,this)]},`model-${Z}-${q.id}`,!0,void 0,this)},[F.provider_id]),D=_.useCallback((q)=>{return q.id===F.provider_id+"-"+q.id},[F.provider_id]),R=_.useCallback(async(q)=>{await B({provider_id:X,model_id:q.id}),O()},[B,X,O]),j=_.useCallback((q)=>{if(G.length<=1)return;let Z=G.findIndex((m)=>m.id===X),V=q==="left"?(Z-1+G.length)%G.length:(Z+1)%G.length;A(G[V].id)},[X,G]),E=_.useMemo(()=>{let q=h?.label||"加载中...";return{id:`model-${X}`,title:`模型选择 - ${q}`,icon:h?.icon||"\uD83D\uDD2E",dataSource:C,searchable:!0,searchFields:["id","name"],searchPlaceholder:"搜索模型...",itemHeight:1,visibleCount:10,renderItem:I,isSelected:D,onSelect:R,showCount:!0,keyMap:{leftArrow:(Z)=>{j("left")},rightArrow:(Z)=>{j("right")}}}},[X,h,C,I,D,R,j]);if(G.length===0)return $.jsxDEV(Y,{flexDirection:"column",paddingX:2,paddingY:1,children:[$.jsxDEV(H,{color:"yellow",children:"⚠️ 未配置任何 Provider"},void 0,!1,void 0,this),$.jsxDEV(H,{color:"gray",dimColor:!0,children:"请先配置 Provider 后再查看模型列表"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let g=h?.config.apiKey;return $.jsxDEV(Y,{flexDirection:"column",children:[$.jsxDEV(Y,{gap:1,paddingX:1,paddingY:1,children:G.map((q)=>$.jsxDEV(H,{bold:q.id===X,color:q.id===X?"cyan":"gray",children:[q.icon," ",q.label,q.id===X&&" [当前]",q.id===X&&!g&&" (未配置 API Key)"]},q.id,!0,void 0,this))},void 0,!1,void 0,this),w?$.jsxDEV(Y,{paddingX:2,paddingY:1,children:$.jsxDEV(H,{color:"gray",children:"加载模型列表中..."},void 0,!1,void 0,this)},void 0,!1,void 0,this):b?$.jsxDEV(Y,{paddingX:2,paddingY:1,children:$.jsxDEV(H,{color:"red",children:["加载失败: ",b.message]},void 0,!0,void 0,this)},void 0,!1,void 0,this):!g?$.jsxDEV(Y,{paddingX:2,paddingY:1,children:$.jsxDEV(H,{color:"yellow",children:"请先配置 API Key"},void 0,!1,void 0,this)},void 0,!1,void 0,this):$.jsxDEV(t,{config:E,onClose:O},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},d=Gq;var z=S(l(),1);var Q=S(f(),1),Hq=({onClose:O})=>{let{config:F,updateConfig:U}=T(),[B,X]=z.useState("list"),[A,k]=z.useState(null),[G,h]=z.useState(0),[P,w]=z.useState(null),b=z.useCallback(()=>w(null),[]);o(b,P?3000:null);let c=z.useRef(B),C=z.useRef(G),I=z.useRef([]),D=z.useRef(!0);z.useEffect(()=>{c.current=B},[B]),z.useEffect(()=>{C.current=G},[G]);let R=F?.providers||[];z.useEffect(()=>{I.current=R},[R]);let j=z.useCallback(()=>{D.current=!0,k(null),X("form"),w(null)},[]),E=z.useCallback(()=>{let J=I.current,W=C.current,N=J[W];if(!N)return;D.current=!1,k(N),X("form"),w(null)},[]),g=z.useCallback(()=>{X("list"),k(null),w(null)},[]),q=z.useCallback(async(J)=>{let W=I.current,N=D.current,K=N?[...W,J]:W.map((L)=>L.id===J.id?J:L);if(await U({providers:K}),w(N?`已添加 Provider: ${J.id}`:`已更新 Provider: ${J.id}`),N){let L=K.findIndex((M)=>M.id===J.id);h(L>=0?L:0)}X("list"),k(null),w(null)},[U]),Z=z.useCallback(async()=>{let J=I.current,W=C.current,N=J[W];if(!N)return;if(J.length<=1){w("无法删除最后一个 Provider");return}let K=J.filter((M)=>M.id!==N.id);await U({providers:K});let L=Math.min(W,K.length-1);h(L>=0?L:0),w(`已删除 Provider: ${N.id}`)},[U]),V=z.useRef(j),m=z.useRef(E),v=z.useRef(Z),x=z.useRef(g),n=z.useRef(O);z.useEffect(()=>{V.current=j},[j]),z.useEffect(()=>{m.current=E},[E]),z.useEffect(()=>{v.current=Z},[Z]),z.useEffect(()=>{x.current=g},[g]),z.useEffect(()=>{n.current=O},[O]),p((J,W)=>{let N=c.current,K=I.current,L=C.current;if(N==="form"){if(W.escape)x.current();return}if(W.upArrow)h((M)=>M>0?M-1:K.length-1);else if(W.downArrow)h((M)=>M<K.length-1?M+1:0);else if(J==="n"||J==="N")V.current();else if((J==="e"||J==="E"||W.return)&&K[L])m.current();else if((J==="d"||J==="D")&&K[L])v.current();else if(W.escape)n.current()},{isActive:!0});let zq=z.useMemo(()=>{if(R.length===0)return Q.jsxDEV(Y,{paddingX:2,paddingY:1,children:Q.jsxDEV(H,{color:"yellow",children:"未配置任何 Provider"},void 0,!1,void 0,this)},void 0,!1,void 0,this);return Q.jsxDEV(Y,{flexDirection:"column",paddingX:2,gap:1,children:[R.map((J,W)=>{let N=!!J.apiKey,K=N?"green":"yellow";return Q.jsxDEV(Y,{marginBottom:0,gap:1,children:[Q.jsxDEV(H,{color:W===G?"cyan":"gray",bold:W===G,children:W===G?">":" "},void 0,!1,void 0,this),Q.jsxDEV(H,{bold:W===G,color:W===G?"cyan":void 0,children:J.id},void 0,!1,void 0,this),Q.jsxDEV(u,{},void 0,!1,void 0,this),Q.jsxDEV(H,{color:"gray",dimColor:W!==G,children:[" ",J.type]},void 0,!0,void 0,this),Q.jsxDEV(H,{color:K,dimColor:W!==G,children:[" ","[",N?"已配置":"未配置","]"]},void 0,!0,void 0,this)]},J.id,!0,void 0,this)}),Q.jsxDEV(Y,{marginTop:1,children:Q.jsxDEV(H,{color:"gray",dimColor:!0,children:[Q.jsxDEV(H,{color:"cyan",children:"↑↓"},void 0,!1,void 0,this)," 导航 ",Q.jsxDEV(H,{color:"cyan",children:"n"},void 0,!1,void 0,this)," 新增 ",Q.jsxDEV(H,{color:"cyan",children:"d"},void 0,!1,void 0,this)," ","删除 ",Q.jsxDEV(H,{color:"cyan",children:"Esc"},void 0,!1,void 0,this)," 关闭"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},[R,G]);return Q.jsxDEV(Y,{flexDirection:"column",children:[Q.jsxDEV(Y,{paddingX:2,paddingY:1,children:Q.jsxDEV(H,{bold:!0,color:"cyan",children:"Providers"},void 0,!1,void 0,this)},void 0,!1,void 0,this),B==="list"?zq:Q.jsxDEV(r,{provider:A||void 0,onCancel:g,onSave:q},void 0,!1,void 0,this),P&&Q.jsxDEV(Y,{paddingX:2,paddingY:0,children:Q.jsxDEV(H,{color:"green",children:P},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},e=Hq;var y=S(f(),1),Jq=({onClose:O,initialTab:F="model"})=>{let[U,B]=qq.useState(F);return p((X,A)=>{if(A.leftArrow&&A.alt)B("model");else if(A.rightArrow&&A.alt)B("provider");else if(A.escape)O()},{isActive:!0}),y.jsxDEV(Y,{flexDirection:"column",width:"100%",borderStyle:"single",borderDimColor:!0,children:[y.jsxDEV(Y,{flexDirection:"column",paddingX:0,paddingY:0,children:[U==="model"&&y.jsxDEV(d,{onClose:O},void 0,!1,void 0,this),U==="provider"&&y.jsxDEV(e,{onClose:O},void 0,!1,void 0,this)]},void 0,!0,void 0,this),y.jsxDEV(Y,{flexDirection:"row",gap:2,paddingX:2,paddingY:1,borderTop:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:"single",borderColor:"gray",children:[y.jsxDEV(H,{bold:U==="model",color:U==="model"?"cyan":"gray",children:"\uD83E\uDD16 Model"},void 0,!1,void 0,this),y.jsxDEV(H,{bold:U==="provider",color:U==="provider"?"cyan":"gray",children:"\uD83D\uDD0C Provider"},void 0,!1,void 0,this),y.jsxDEV(u,{},void 0,!1,void 0,this),y.jsxDEV(H,{dimColor:!0,children:"Alt+ < >"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},Iq=Jq;export{Iq as default};
|
package/dist/chunk-keqk70wm.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{P as U,R as Y,S as B,T as W}from"./chunk-9kc9cea3.js";import{ca as q,da as T,ea as O,la as j}from"./chunk-wwn7gw8g.js";import{ib as k}from"./chunk-yaa4eesd.js";import{nb as b}from"./chunk-cze71w02.js";var J=b(q(),1);function K({manager:z,enabled:N=!0}){return Y({queryKey:W.config.detail(),queryFn:async()=>{return await z.initialize(),await z.getConfig()},enabled:N,staleTime:300000,gcTime:600000})}function P({manager:z}){let N=U();return B({mutationFn:async(R)=>{return await z.updateConfig(R),await z.getConfig()},onSuccess:(R)=>{N.setQueryData(W.config.detail(),R),N.invalidateQueries({queryKey:W.providers.all}),N.invalidateQueries({queryKey:W.models.all})}})}var X=b(j(),1),H=null,Z=null;async function S(){if(!H){if(!Z)Z=k().then((z)=>{return H=z,Z=null,z});return Z}return Promise.resolve(H)}var I=J.createContext(void 0),E=({manager:z,get_allowed_models:N,children:R})=>{let{data:G,isLoading:V,error:x}=K({manager:z}),$=P({manager:z}),{data:F=[],isLoading:h,error:p}=Y({queryKey:W.models.available(),queryFn:N,staleTime:1800000,retry:1}),A=J.useMemo(()=>{return{provider_id:G?.provider_id||"default",model_id:G?.model_id||F[0]?.id||"default",mcp_config:G?.mcp_config,enable_thinking:G?.enable_thinking??!0,switch_command:G?.switch_command||""}},[G?.provider_id,G?.model_id,G?.mcp_config,G?.enable_thinking,G?.switch_command,F]),Q=J.useMemo(()=>{return G?.compact_mode??!1},[G?.compact_mode]),w=async()=>{await $.mutateAsync({compact_mode:!Q})},v=J.useMemo(()=>{return G?.show_detailed_info??!1},[G?.show_detailed_info]),L=async()=>{await $.mutateAsync({show_detailed_info:!v})},D=async(_)=>{await $.mutateAsync(_)};if(V||h)return X.jsxDEV(T,{padding:2,children:X.jsxDEV(O,{children:"Loading configuration..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);return X.jsxDEV(I.Provider,{value:{config:G||null,updateConfig:D,extraParams:A,AVAILABLE_MODELS:F,manager:z,compactMode:Q,toggleCompactMode:w,showDetailedInfo:v,toggleDetailedInfo:L},children:R},void 0,!1,void 0,this)},s=()=>{let z=J.useContext(I);if(z===void 0)throw Error("useSettings must be used within a SettingsProvider");return z},r=({get_allowed_models:z,children:N})=>{let[R,G]=J.useState(null);if(J.useEffect(()=>{S().then(G)},[]),!R)return X.jsxDEV(T,{padding:2,children:X.jsxDEV(O,{children:"Initializing configuration manager..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);return X.jsxDEV(E,{manager:R,get_allowed_models:z,children:N},void 0,!1,void 0,this)};
|
|
2
|
-
export{s as M,r as N};
|
package/dist/chunk-mg8zpgaz.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as M}from"./chunk-5nzs0q25.js";import"./chunk-3n2b4eb4.js";import{R as A,T as _}from"./chunk-9kc9cea3.js";import{ca as g,da as X,ea as Y,la as C,pa as K}from"./chunk-wwn7gw8g.js";import{xa as R}from"./chunk-n1d8xx5k.js";import{nb as Q}from"./chunk-cze71w02.js";var F=Q(g(),1);import{listSkills as V}from"@langgraph-js/standard-agent";import{join as w}from"path";function $({type:G,enabled:J=!0}){return A({queryKey:G==="memories"?_.knowledge.memories():_.knowledge.skills(),queryFn:async()=>{let L=w(process.cwd(),".claude",G),N=w(process.env.HOME||"",".deepagents/code",G);try{if(G==="memories")return R(N,L).map((W)=>({...W,type:"memory"}));else return V(N,L).map((W)=>({...W,type:"skill"}))}catch(O){return console.warn(`Failed to load ${G}:`,O),[]}},enabled:J,staleTime:120000})}var H=Q(C(),1),S=(G)=>{return G.length>80?G.slice(0,80)+"...":G},k=({onClose:G})=>{let[J,L]=F.useState("memories"),N=F.useRef(L);F.default.useEffect(()=>{N.current=L},[L]);let{data:O=[]}=$({type:"memories",enabled:J==="memories"}),{data:W=[]}=$({type:"skills",enabled:J==="skills"}),U=F.useCallback(async()=>{return J==="memories"?O:W},[J,O,W]),q=F.useCallback((z,h,Z)=>{let E=S(z.description);return H.jsxDEV(X,{flexDirection:"column",paddingY:1,children:[H.jsxDEV(X,{children:H.jsxDEV(Y,{bold:!0,color:Z?"cyan":"gray",children:[h+1,". ",z.name]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV(X,{paddingY:1,children:H.jsxDEV(Y,{color:Z?"white":"gray",children:E},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV(X,{children:H.jsxDEV(Y,{color:"cyan",dimColor:!Z,children:[M(z.path),z.category&&H.jsxDEV(Y,{color:"yellow",children:[" ",z.category]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},z.path,!0,void 0,this)},[]),I=F.useCallback((z)=>{console.log("Selected knowledge item:",z.name)},[]),P=F.useMemo(()=>[{id:"memory",label:"记忆",predicate:(z)=>z.type==="memory"},{id:"skill",label:"技能",predicate:(z)=>z.type==="skill"}],[]),B=F.useMemo(()=>({h:(z)=>{N.current("memories"),z.setActiveFilter("memory")},s:(z)=>{N.current("skills"),z.setActiveFilter("skill")}}),[]),f=F.useMemo(()=>({id:"knowledge",title:"知识库",icon:"\uD83D\uDCDA",dataSource:U,searchable:!0,searchFields:["name","description"],searchPlaceholder:"搜索知识库 (名称/描述/分类)...",filterable:!0,filters:P,defaultFilter:J==="memories"?"memory":"skill",itemHeight:8,visibleCount:3,renderItem:q,showCount:!0,onSelect:I,keyMap:B}),[U,P,q,I,B,J]);return H.jsxDEV(K,{config:f,onClose:G},void 0,!1,void 0,this)},l=k;export{l as default};
|
package/dist/chunk-ndtwq2zx.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{s as i}from"./chunk-s3fyfrka.js";import{U as s,V as j,W as o,X as d,Y as r,Z as t,_ as a}from"./chunk-bgpcx3bm.js";import{rb as R}from"./chunk-cze71w02.js";import{AIMessageChunk as O0}from"@langchain/core/messages";import{Command as D0,Send as K0}from"@langchain/langgraph";import{concat as V0}from"@langchain/core/utils/stream";import{load as F0}from"@langchain/core/load";var V=[];for(let $=0;$<256;++$)V.push(($+256).toString(16).slice(1));function p($,x=0){return(V[$[x+0]]+V[$[x+1]]+V[$[x+2]]+V[$[x+3]]+"-"+V[$[x+4]]+V[$[x+5]]+"-"+V[$[x+6]]+V[$[x+7]]+"-"+V[$[x+8]]+V[$[x+9]]+"-"+V[$[x+10]]+V[$[x+11]]+V[$[x+12]]+V[$[x+13]]+V[$[x+14]]+V[$[x+15]]).toLowerCase()}import{randomFillSync as P0}from"node:crypto";var G=new Uint8Array(256),S=G.length;function w(){if(S>G.length-16)P0(G),S=0;return G.slice(S,S+=16)}var m={};function Q0($,x,X){let Y;if($)Y=l($.random??$.rng?.()??w(),$.msecs,$.seq,x,X);else{let Z=Date.now(),J=w();z0(m,Z,J),Y=l(J,m.msecs,m.seq,x,X)}return x??p(Y)}function z0($,x,X){if($.msecs??=-1/0,$.seq??=0,x>$.msecs)$.seq=X[6]<<23|X[7]<<16|X[8]<<8|X[9],$.msecs=x;else if($.seq=$.seq+1|0,$.seq===0)$.msecs++;return $}function l($,x,X,Y,Z=0){if($.length<16)throw Error("Random bytes length must be >= 16");if(!Y)Y=new Uint8Array(16),Z=0;else if(Z<0||Z+16>Y.length)throw RangeError(`UUID byte range ${Z}:${Z+15} is out of buffer bounds`);return x??=Date.now(),X??=$[6]*127<<24|$[7]<<16|$[8]<<8|$[9],Y[Z++]=x/1099511627776&255,Y[Z++]=x/4294967296&255,Y[Z++]=x/16777216&255,Y[Z++]=x/65536&255,Y[Z++]=x/256&255,Y[Z++]=x&255,Y[Z++]=112|X>>>28&15,Y[Z++]=X>>>20&255,Y[Z++]=128|X>>>14&63,Y[Z++]=X>>>6&255,Y[Z++]=X<<2&255|$[10]&3,Y[Z++]=$[11],Y[Z++]=$[12],Y[Z++]=$[13],Y[Z++]=$[14],Y[Z++]=$[15],Y}var B=Q0;import"kysely";var A0=($)=>{let x=$.goto!=null&&!Array.isArray($.goto)?[$.goto]:$.goto;return new D0({goto:x?.map((X)=>{if(typeof X!=="string")return new K0(X.node,X.input);return X}),update:$.update??void 0,resume:$.resume})},n="[...]",B0="[Circular]",M=[],E=[];function L0(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function N0($,x,X,Y){if(typeof Y>"u")Y=L0();k($,"",0,[],void 0,0,Y);var Z;try{if(E.length===0)Z=JSON.stringify($,x,X);else Z=JSON.stringify($,R0(x),X)}catch(U){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{while(M.length!==0){var J=M.pop();if(J.length===4)Object.defineProperty(J[0],J[1],J[3]);else J[0][J[1]]=J[2]}}return Z}function b($,x,X,Y){var Z=Object.getOwnPropertyDescriptor(Y,X);if(Z.get!==void 0)if(Z.configurable)Object.defineProperty(Y,X,{value:$}),M.push([Y,X,x,Z]);else E.push([x,X,$]);else Y[X]=$,M.push([Y,X,x])}function k($,x,X,Y,Z,J,U){J+=1;var H;if(typeof $==="object"&&$!==null){for(H=0;H<Y.length;H++)if(Y[H]===$){b(B0,$,x,Z);return}if(typeof U.depthLimit<"u"&&J>U.depthLimit){b(n,$,x,Z);return}if(typeof U.edgesLimit<"u"&&X+1>U.edgesLimit){b(n,$,x,Z);return}if(Y.push($),Array.isArray($))for(H=0;H<$.length;H++)k($[H],H,H,Y,$,J,U);else{var W=Object.keys($);for(H=0;H<W.length;H++){var Q=W[H];k($[Q],Q,H,Y,$,J,U)}}Y.pop()}}function R0($){return $=typeof $<"u"?$:function(x,X){return X},function(x,X){if(E.length>0)for(var Y=0;Y<E.length;Y++){var Z=E[Y];if(Z[1]===x&&Z[0]===X){X=Z[2],E.splice(Y,1);break}}return $.call(this,x,X)}}function _0($){return $!==null&&$.lc===1&&$.type==="constructor"&&Array.isArray($.id)}async function y($){if($&&typeof $==="object")if(Array.isArray($))return await Promise.all($.map((X)=>y(X)));else{let x={};for(let[X,Y]of Object.entries($))x[X]=await y(Y);if(x.lc===2&&x.type==="undefined")return;else if(x.lc===2&&x.type==="constructor"&&Array.isArray(x.id))try{let X=x.id[x.id.length-1],Y;switch(X){case"Set":Y=Set;break;case"Map":Y=Map;break;case"RegExp":Y=RegExp;break;case"Error":Y=Error;break;default:return x}if(x.method)return Y[x.method](...x.args||[]);else return new Y(...x.args||[])}catch(X){return x}else if(_0(x))return F0(JSON.stringify(x));return x}return $}function v($,x,X,Y){return{lc:2,type:"constructor",id:[$.name],method:x??null,args:X??[],kwargs:Y??{}}}function E0($){if($===void 0)return{lc:2,type:"undefined"};else if($ instanceof Set||$ instanceof Map)return v($.constructor,void 0,[Array.from($)]);else if($ instanceof RegExp)return v(RegExp,void 0,[$.source,$.flags]);else if($ instanceof Error)return v($.constructor,void 0,[$.message]);else if($?.lg_name==="Send")return{node:$.node,args:$.args};else return $}class e{_dumps($){return new TextEncoder().encode(N0($,(X,Y)=>{return E0(Y)}))}async dumpsTyped($){if($ instanceof Uint8Array)return["bytes",$];else return["json",this._dumps($)]}async _loads($){let x=JSON.parse($);return y(x)}async loadsTyped($,x){if($==="bytes")return typeof x==="string"?new TextEncoder().encode(x):x;else if($==="json")return this._loads(typeof x==="string"?x:new TextDecoder().decode(x));else throw Error(`Unknown serialization type: ${$}`)}}class $0 extends i.default{constructor($,x=!0,X=300){super();this.id=$,this.compressMessages=x,this.ttl=X}serializer=new e;async encodeData($){let[x,X]=await this.serializer.dumpsTyped($);return X}async decodeData($){return await this.serializer.loadsTyped("json",$)}}class x0{queues=new Map;defaultCompressMessages;queueConstructor;constructor($,x={}){this.defaultCompressMessages=x.defaultCompressMessages??!0,this.queueConstructor=$}createQueue($,x=300){return this.queues.set($,new this.queueConstructor($,this.defaultCompressMessages,x)),this.queues.get($)}async getQueue($){let x=this.queues.get($);if(!x)if(await this.queueConstructor?.isQueueExist?.($))return this.createQueue($);else throw Error(`Queue with id '${$}' does not exist`);return x}async cancelQueue($){await this.removeQueue($)}async pushToQueue($,x){await(await this.getQueue($)).push(x)}async getQueueData($){let x=this.queues.get($);if(!x)throw Error(`Queue with id '${$}' does not exist`);return await x.getAll()}async clearQueue($){let x=this.queues.get($);if(x){let X=x.clear();if(X instanceof Promise)await X}}async removeQueue($){let x=this.queues.get($);if(!x)return!1;try{await x.cancel()}catch(X){console.error("Error cancelling queue:",X)}try{let X=x.clear();if(X instanceof Promise)await X}catch(X){console.error("Error clearing queue:",X)}if(typeof x.destroy==="function")try{await x.destroy()}catch(X){console.error("Error destroying queue:",X)}return this.queues.delete($)}getAllQueueIds(){return Array.from(this.queues.keys())}async getAllQueuesData(){let $={};for(let[x,X]of this.queues)$[x]=await X.getAll();return $}clearAllQueues(){for(let $ of this.queues.values())$.clear()}async copyQueue($,x,X){let Z=await(await this.getQueue($)).copyToQueue(x,X);return this.queues.set(x,Z),Z}}var T={};async function n0($,x){T[$]=x}async function X0($,x,X){if(!T[$])throw Error(`Graph "${$}" not found`);let Y=typeof T[$]==="function"?await T[$](x??{configurable:{}}):T[$];if(typeof X?.checkpointer<"u")Y.checkpointer=X?.checkpointer??F.globalCheckPointer;else Y.checkpointer=F.globalCheckPointer;return Y.store=X?.store??void 0,Y}class I{db;adapter;constructor($){this.db=$.db,this.adapter=$}async setup(){await this.adapter.createTables(this.db),await this.adapter.createIndexes(this.db)}async create($){let x=$?.threadId||B(),X=new Date,Y=$?.metadata||{},Z={};if($?.ifExists==="raise"){if(await this.db.selectFrom("threads").select("thread_id").where("thread_id","=",x).executeTakeFirst())throw Error(`Thread with ID ${x} already exists.`)}if($?.ifExists==="do_nothing"&&$?.threadId){let J=await this.db.selectFrom("threads").selectAll().where("thread_id","=",x).executeTakeFirst();if(J)return{thread_id:J.thread_id,created_at:this.adapter.dbToDate(J.created_at).toISOString(),updated_at:this.adapter.dbToDate(J.updated_at).toISOString(),state_updated_at:this.adapter.dbToDate(J.updated_at).toISOString(),metadata:this.adapter.dbToJson(J.metadata),status:J.status,values:J.values?this.adapter.dbToJson(J.values):null,interrupts:this.adapter.dbToJson(J.interrupts)}}return await this.db.insertInto("threads").values({thread_id:x,created_at:this.adapter.dateToDb(X),updated_at:this.adapter.dateToDb(X),metadata:this.adapter.jsonToDb(Y),status:"idle",values:null,interrupts:this.adapter.jsonToDb(Z)}).execute(),{thread_id:x,created_at:X.toISOString(),updated_at:X.toISOString(),state_updated_at:X.toISOString(),metadata:Y,status:"idle",values:null,interrupts:Z}}async search($){let x=this.db.selectFrom("threads"),X;if($?.select)X=new Set($.select);else if($?.withoutDetails)X=new Set(["thread_id","created_at","updated_at","metadata","status"]);else X=new Set(["thread_id","created_at","updated_at","metadata","status","values","interrupts"]);let Y=[];if(X.has("thread_id"))Y.push("thread_id");if(X.has("created_at"))Y.push("created_at");if(X.has("updated_at"))Y.push("updated_at");if(X.has("metadata"))Y.push("metadata");if(X.has("status"))Y.push("status");if(X.has("values"))Y.push("values");if(X.has("interrupts"))Y.push("interrupts");if(Y.length>0)x=x.select(Y);else x=x.selectAll();if($?.ids&&$.ids.length>0)x=x.where("thread_id","in",$.ids);if($?.status)x=x.where("status","=",$.status);if($?.metadata)for(let[J,U]of Object.entries($.metadata))x=x.where(this.adapter.buildJsonQuery(this.db,"metadata",J,U));if($?.values)x=x.where((J)=>{return J("values","=",this.adapter.jsonToDb($.values))});if($?.sortBy){let J=$.sortOrder==="desc"?"desc":"asc";x=x.orderBy($.sortBy,J)}if($?.limit!==void 0){if(x=x.limit($.limit),$?.offset!==void 0)x=x.offset($.offset)}return(await x.execute()).map((J)=>{let U={thread_id:J.thread_id};if(X.has("created_at"))U.created_at=this.adapter.dbToDate(J.created_at).toISOString();if(X.has("updated_at"))U.updated_at=this.adapter.dbToDate(J.updated_at).toISOString();if(X.has("metadata"))U.metadata=this.adapter.dbToJson(J.metadata);if(X.has("status"))U.status=J.status;if(X.has("values"))U.values=J.values?this.adapter.dbToJson(J.values):null;if(X.has("interrupts"))U.interrupts=this.adapter.dbToJson(J.interrupts);return U})}async get($){let x=await this.db.selectFrom("threads").selectAll().where("thread_id","=",$).executeTakeFirst();if(!x)throw Error(`Thread with ID ${$} not found.`);return{thread_id:x.thread_id,created_at:this.adapter.dbToDate(x.created_at).toISOString(),updated_at:this.adapter.dbToDate(x.updated_at).toISOString(),state_updated_at:this.adapter.dbToDate(x.updated_at).toISOString(),metadata:this.adapter.dbToJson(x.metadata),status:x.status,values:x.values?this.adapter.dbToJson(x.values):null,interrupts:this.adapter.dbToJson(x.interrupts)}}async set($,x){if(!await this.db.selectFrom("threads").select("thread_id").where("thread_id","=",$).executeTakeFirst())throw Error(`Thread with ID ${$} not found.`);let Y={updated_at:this.adapter.dateToDb(new Date)};if(x.metadata!==void 0)Y.metadata=this.adapter.jsonToDb(x.metadata);if(x.status!==void 0)Y.status=x.status;if(x.values!==void 0)Y.values=x.values?this.adapter.jsonToDb(x.values):null;if(x.interrupts!==void 0)Y.interrupts=this.adapter.jsonToDb(x.interrupts);await this.db.updateTable("threads").set(Y).where("thread_id","=",$).execute()}async delete($){if((await this.db.deleteFrom("threads").where("thread_id","=",$).executeTakeFirst()).numDeletedRows===0n)throw Error(`Thread with ID ${$} not found.`)}async updateState($,x){let X=await this.get($);if(X.status==="busy")throw Error(`Thread with ID ${$} is busy, can't update state.`);let Y=X.metadata?.graph_id;if(!Y)return await this.set($,{values:x.values??null}),{configurable:{thread_id:$}};let Z={configurable:{thread_id:$,graph_id:Y}},J=await X0(Y,Z),U=await J.updateState(Z,x.values),H=await J.getState(Z);return await this.set($,{values:JSON.parse(f(H.values))}),U}async createRun($,x,X){let Y=B(),Z=new Date,J=X?.metadata??{};return await this.db.insertInto("runs").values({run_id:Y,thread_id:$,assistant_id:x,created_at:this.adapter.dateToDb(Z),updated_at:this.adapter.dateToDb(Z),status:"pending",metadata:this.adapter.jsonToDb(J),multitask_strategy:"reject"}).execute(),{run_id:Y,thread_id:$,assistant_id:x,created_at:Z.toISOString(),updated_at:Z.toISOString(),status:"pending",metadata:J,multitask_strategy:"reject"}}async listRuns($,x){let X=this.db.selectFrom("runs").selectAll().where("thread_id","=",$).orderBy("created_at","desc");if(x?.status)X=X.where("status","=",x.status);if(x?.limit!==void 0){if(X=X.limit(x.limit),x?.offset!==void 0)X=X.offset(x.offset)}return(await X.execute()).map((Z)=>({run_id:Z.run_id,thread_id:Z.thread_id,assistant_id:Z.assistant_id,created_at:this.adapter.dbToDate(Z.created_at).toISOString(),updated_at:this.adapter.dbToDate(Z.updated_at).toISOString(),status:Z.status,metadata:this.adapter.dbToJson(Z.metadata),multitask_strategy:Z.multitask_strategy}))}async updateRun($,x){if(!await this.db.selectFrom("runs").select("run_id").where("run_id","=",$).executeTakeFirst())throw Error(`Run with ID ${$} not found.`);let Y={updated_at:this.adapter.dateToDb(new Date)};if(x.status!==void 0)Y.status=x.status;if(x.metadata!==void 0)Y.metadata=this.adapter.jsonToDb(x.metadata);if(x.multitask_strategy!==void 0)Y.multitask_strategy=x.multitask_strategy;await this.db.updateTable("runs").set(Y).where("run_id","=",$).execute()}async count($){return(await this.search($)).length}async patch($,x){let X=await this.db.selectFrom("threads").selectAll().where("thread_id","=",$).executeTakeFirst();if(!X)throw Error(`Thread with ID ${$} not found.`);let Y={updated_at:this.adapter.dateToDb(new Date)};if(x.metadata!==void 0){let Z=this.adapter.dbToJson(X.metadata)||{};Y.metadata=this.adapter.jsonToDb({...Z,...x.metadata})}if(x.status!==void 0)Y.status=x.status;if(x.values!==void 0)Y.values=x.values?this.adapter.jsonToDb(x.values):null;if(x.interrupts!==void 0)Y.interrupts=this.adapter.jsonToDb(x.interrupts);return await this.db.updateTable("threads").set(Y).where("thread_id","=",$).execute(),await this.get($)}async getState($,x){let X=await this.get($);if(x?.checkpointId){let Z=await this.db.selectFrom("checkpoints").selectAll().where("checkpoint_id","=",x.checkpointId).where("thread_id","=",$).executeTakeFirst();if(!Z)throw Error(`Checkpoint with ID ${x.checkpointId} not found for thread ${$}`);return{values:this.adapter.dbToJson(Z.values),next:this.adapter.dbToJson(Z.next),metadata:this.adapter.dbToJson(Z.metadata),checkpoint:{id:Z.checkpoint_id,thread_id:$,parent_checkpoint_id:null,checkpoint_ns:"",metadata:this.adapter.dbToJson(Z.metadata),created_at:this.adapter.dbToDate(Z.created_at).toISOString()},created_at:this.adapter.dbToDate(Z.created_at).toISOString(),parent_checkpoint:null,tasks:[]}}return{values:X.values||{},next:[],metadata:X.metadata,checkpoint:null,created_at:X.created_at,parent_checkpoint:null,tasks:[]}}async getStateHistory($,x){let Y=await this.db.selectFrom("checkpoints").selectAll().where("thread_id","=",$).orderBy("created_at","asc").execute(),Z=Y.map((J)=>({values:this.adapter.dbToJson(J.values),next:this.adapter.dbToJson(J.next),metadata:this.adapter.dbToJson(J.metadata),checkpoint:{thread_id:$,checkpoint_ns:"",checkpoint_id:J.checkpoint_id,checkpoint_map:null},created_at:this.adapter.dbToDate(J.created_at).toISOString(),parent_checkpoint:null,tasks:[]}));if(x?.before){let J=Y.findIndex((U)=>U.checkpoint_id===x.before);if(J!==-1)Z=Z.slice(J+1)}if(x?.limit)Z=Z.slice(0,x.limit);return Z}async copy($){let x=await this.get($),X=B(),Y=new Date;await this.db.insertInto("threads").values({thread_id:X,created_at:this.adapter.dateToDb(Y),updated_at:this.adapter.dateToDb(Y),metadata:this.adapter.jsonToDb(x.metadata),status:x.status,values:x.values?this.adapter.jsonToDb(x.values):null,interrupts:this.adapter.jsonToDb(x.interrupts)}).execute();let Z=await this.db.selectFrom("checkpoints").selectAll().where("thread_id","=",$).orderBy("created_at","asc").execute();for(let J of Z)await this.db.insertInto("checkpoints").values({checkpoint_id:B(),thread_id:X,values:J.values,next:J.next,config:J.config,created_at:J.created_at,metadata:J.metadata}).execute();return{...x,thread_id:X,created_at:Y.toISOString(),updated_at:Y.toISOString()}}async saveCheckpoint($,x,X,Y,Z){await this.db.insertInto("checkpoints").values({checkpoint_id:B(),thread_id:$,values:this.adapter.jsonToDb(x),next:this.adapter.jsonToDb(X),config:this.adapter.jsonToDb(Y),created_at:this.adapter.dateToDb(new Date),metadata:this.adapter.jsonToDb(Z||{})}).execute()}}function T0($){let[x,X]=$.split("::");return{threadId:x,checkpointNs:X??""}}function C($,x,X){return`${$}::${x}::${X}`}function g($){if($===null||typeof $!=="object")return JSON.stringify($);if(Array.isArray($))return JSON.stringify($.map((Y)=>g(Y)));let x={},X=Object.keys($).sort();for(let Y of X)x[Y]=$[Y];return JSON.stringify(x,(Y,Z)=>{if(Z!==null&&typeof Z==="object"&&!Array.isArray(Z)){let J={},U=Object.keys(Z).sort();for(let H of U)J[H]=Z[H];return J}return Z})}class Y0 extends d{storage={};writes={};constructor($){super($)}async get($){return(await this.getTuple($))?.checkpoint}async _migratePendingSends($,x,X,Y){let Z=$,J=C(x,X,Y),U=await Promise.all(Object.values(this.writes[J]??{}).filter(([H,W])=>W===j).map(async([H,W,Q])=>await this.serde.loadsTyped("json",Q)));Z.channel_values??={},Z.channel_values[j]=U,Z.channel_versions??={},Z.channel_versions[j]=Object.keys(Z.channel_versions).length>0?r(...Object.values(Z.channel_versions)):this.getNextVersion(void 0)}async _loadPendingWrites($,x,X){let Y=C($,x,X),Z=this.writes[Y]??{};if(Object.keys(Z).length===0)return[];return await Promise.all(Object.values(Z).map(async([J,U,H])=>{return[J,U,await this.serde.loadsTyped("json",H)]}))}_cleanupOldWrites($,x,X){let Y=C($,x,X);delete this.writes[Y]}_checkMetadataFilterMatch($,x){for(let[X,Y]of Object.entries(x)){let Z=$?.[X];if(Y===null){if(!(X in($||{}))||Z!==null)return!1}else if(typeof Y==="object"&&!Array.isArray(Y)){if(typeof Z!=="object"||Z===null)return!1;if(g(Y)!==g(Z))return!1}else if(Z!==Y)return!1}return!0}async getTuple($){let x=$.configurable?.thread_id,X=$.configurable?.checkpoint_ns??"",Y=a($);if(x===void 0)return;let Z=this.storage[x]?.[X];if(Z===void 0)return;let{checkpoint:J,metadata:U,checkpoint_id:H,parent_checkpoint_id:W}=Z;if(Y&&H!==Y)return;let Q=await this.serde.loadsTyped("json",J);if(Q.v<4&&W!==void 0)await this._migratePendingSends(Q,x,X,W);let P=await this._loadPendingWrites(x,X,H),O=await this.serde.loadsTyped("json",U),K={config:{configurable:{thread_id:x,checkpoint_ns:X,checkpoint_id:H}},checkpoint:Q,metadata:O,pendingWrites:P};if(W!==void 0)K.parentConfig={configurable:{thread_id:x,checkpoint_ns:X,checkpoint_id:W}};return K}async*list($,x){let{before:X,limit:Y,filter:Z}=x??{},J=$.configurable?.thread_id?[$.configurable.thread_id]:Object.keys(this.storage),U=$.configurable?.checkpoint_ns,H=$.configurable?.checkpoint_id,W=[];for(let P of J){let O=this.storage[P];if(O===void 0)continue;for(let K of Object.keys(O)){if(U!==void 0&&K!==U)continue;let A=O[K];if(A===void 0)continue;let{checkpoint_id:D}=A;if(H&&D!==H)continue;if(X?.configurable?.checkpoint_id&&D>=X.configurable.checkpoint_id)continue;let L=await this.serde.loadsTyped("json",A.metadata);if(Z&&!this._checkMetadataFilterMatch(L,Z))continue;W.push({threadId:P,checkpointNs:K,namespaceData:A})}}W.sort((P,O)=>O.namespaceData.checkpoint_ts-P.namespaceData.checkpoint_ts);let Q=0;for(let{threadId:P,checkpointNs:O,namespaceData:K}of W){if(Y!==void 0&&Q>=Y)return;let{checkpoint:A,metadata:D,checkpoint_id:L,parent_checkpoint_id:_}=K,z=await this.serde.loadsTyped("json",A);if(z.v<4&&_!==void 0)await this._migratePendingSends(z,P,O,_);let q=await this._loadPendingWrites(P,O,L),W0=await this.serde.loadsTyped("json",D),u={config:{configurable:{thread_id:P,checkpoint_ns:O,checkpoint_id:L}},checkpoint:z,metadata:W0,pendingWrites:q};if(_!==void 0)u.parentConfig={configurable:{thread_id:P,checkpoint_ns:O,checkpoint_id:_}};Q++,yield u}}async put($,x,X,Y){let Z=o(x),J=$.configurable?.thread_id,U=$.configurable?.checkpoint_ns??"",H=$.configurable?.checkpoint_id;if(J===void 0)throw Error("thread_id is required");let W=x.id||s(0);if(!this.storage[J])this.storage[J]={};let Q=this.storage[J][U];if(Q!==void 0&&Q.checkpoint_id!==W)this._cleanupOldWrites(J,U,Q.checkpoint_id);let[[,P],[,O]]=await Promise.all([this.serde.dumpsTyped(Z),this.serde.dumpsTyped(X)]);return this.storage[J][U]={checkpoint:P,metadata:O,checkpoint_id:W,parent_checkpoint_id:H,checkpoint_ts:Date.now()},{configurable:{thread_id:J,checkpoint_ns:U,checkpoint_id:W}}}async putWrites($,x,X){let Y=$.configurable?.thread_id,Z=$.configurable?.checkpoint_ns??"",J=$.configurable?.checkpoint_id;if(!Y||!J)throw Error("thread_id and checkpoint_id are required");let U=C(Y,Z,J),H=this.writes[U];if(this.writes[U]===void 0)this.writes[U]={};await Promise.all(x.map(async([W,Q],P)=>{let[,O]=await this.serde.dumpsTyped(Q),K=[X,t[W]||P],A=`${K[0]},${K[1]}`;if(K[1]>=0&&H&&A in H)return;this.writes[U][A]=[X,W,O]}))}async deleteThread($){delete this.storage[$];for(let x of Object.keys(this.writes)){let{threadId:X}=T0(x.split("::").slice(0,2).join("::"));if(X===$)delete this.writes[x]}}}class N{event;data;id;constructor($,x){this.event=$,this.data=x}}class Z0 extends N{constructor(){super("__system_cancel__","user cancel this run")}}class J0 extends N{constructor(){super("__stream_end__","stream end")}}class c extends N{constructor($){super("__stream_error__",{error:$.name,message:$.message})}}class h extends $0{data=[];activeGenerators=new Set;isDestroyed=!1;async push($){if(this.isDestroyed)return;let x=this.compressMessages?await this.encodeData($):$;process.env.LG_TEMP_MESSAGE!=="true"&&this.data.push(x),this.emit("dataChange",x)}onDataChange($){if(this.isDestroyed)return()=>{};return this.on("dataChange",async(x)=>{if(this.isDestroyed)return;$(this.compressMessages?await this.decodeData(x):x)}),()=>this.off("dataChange",$)}async*onDataReceive(){if(this.isDestroyed)return;let $=new AbortController;this.activeGenerators.add($);let x=[],X=null,Y=!1,Z=!1,J=null,U=async(Q)=>{if(Z||$.signal.aborted)return;try{let P=this.compressMessages?await this.decodeData(Q):Q;if(x.push(P),P.event==="__stream_end__"||P.event==="__stream_error__"||P.event==="__stream_cancel__"){if(J)clearTimeout(J),J=null;if(J=setTimeout(()=>{if(Y=!0,X)X(),X=null},300),P.event==="__stream_cancel__")$.abort("stream cancelled")}if(X)X(),X=null}catch(P){if(console.error("Error in handleData:",P),X)X(),X=null}};this.on("dataChange",U);let H=()=>{if(Y=!0,X)X(),X=null};$.signal.addEventListener("abort",H);let W=()=>{if(Z)return;if(Z=!0,J)clearTimeout(J),J=null;try{this.off("dataChange",U)}catch(Q){}try{$.signal.removeEventListener("abort",H)}catch(Q){}if(X)X(),X=null;x.length=0,this.activeGenerators.delete($)};try{if($.signal.aborted||this.isDestroyed)return;while(!Y&&!$.signal.aborted&&!this.isDestroyed)if(x.length>0){for(let Q of x)yield Q;x.length=0}else await new Promise((Q)=>{X=Q})}finally{W()}}async getAll(){if(this.isDestroyed)return[];return this.compressMessages?await Promise.all(this.data.map(($)=>this.decodeData($))):[...this.data]}clear(){this.data.length=0}cancelSignal=new AbortController;async cancel(){for(let $ of this.activeGenerators)try{$.abort("user cancel this run")}catch(x){}if(this.activeGenerators.clear(),!this.cancelSignal.signal.aborted)this.cancelSignal.abort("user cancel this run");if(!this.isDestroyed)await this.push(new Z0)}async copyToQueue($,x){let X=this.data.slice(),Y=new h($,this.compressMessages,x??this.ttl);return Y.data=X,Y}async destroy(){if(this.isDestroyed)return;this.isDestroyed=!0,await this.cancel(),this.clear(),this.removeAllListeners(),this.activeGenerators.clear()}}class U0{threads=[];checkpoints=new Map;async setup(){return}async create($){let x=$?.threadId||B();if($?.ifExists==="raise"&&this.threads.some((Y)=>Y.thread_id===x))throw Error(`Thread with ID ${x} already exists.`);let X={thread_id:x,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),state_updated_at:new Date().toISOString(),metadata:$?.metadata||{},status:"idle",values:null,interrupts:{}};return this.checkpoints.set(x,[]),this.threads.push(X),X}async search($){let x=[...this.threads];if($?.ids&&$.ids.length>0)x=x.filter((J)=>$.ids.includes(J.thread_id));if($?.status)x=x.filter((J)=>J.status===$.status);if($?.metadata){for(let J in $.metadata)if(Object.prototype.hasOwnProperty.call($.metadata,J))x=x.filter((U)=>U.metadata&&U.metadata[J]===$.metadata?.[J])}if($?.values)x=x.filter((J)=>{if(!J.values)return!1;return this.deepEqual(J.values,$.values)});if($?.sortBy)x.sort((J,U)=>{let H,W;switch($.sortBy){case"thread_id":H=J.thread_id,W=U.thread_id;break;case"created_at":H=new Date(J.created_at).getTime(),W=new Date(U.created_at).getTime();break;case"updated_at":H=new Date(J.updated_at).getTime(),W=new Date(U.updated_at).getTime();break;case"status":H=J.status,W=U.status;break;default:return 0}if($.sortOrder==="desc")return W>H?1:W<H?-1:0;else return H>W?1:H<W?-1:0});let X=$?.offset||0,Y=$?.limit||x.length;return x.slice(X,X+Y).map((J)=>{let U={thread_id:J.thread_id},H;if($?.select)H=new Set($.select);else if($?.withoutDetails)H=new Set(["thread_id","created_at","updated_at","metadata","status"]);else H=new Set(["thread_id","created_at","updated_at","metadata","status","values","interrupts"]);if(H.has("thread_id"))U.thread_id=J.thread_id;if(H.has("created_at"))U.created_at=J.created_at;if(H.has("updated_at"))U.updated_at=J.updated_at;if(H.has("metadata"))U.metadata=J.metadata;if(H.has("status"))U.status=J.status;if(H.has("values"))U.values=J.values;if(H.has("interrupts"))U.interrupts=J.interrupts;return U})}deepEqual($,x){if($===x)return!0;if(typeof $!==typeof x)return!1;if(typeof $!=="object"||$===null||x===null)return!1;let X=Object.keys($),Y=Object.keys(x);if(X.length!==Y.length)return!1;for(let Z of X){if(!Y.includes(Z))return!1;if(!this.deepEqual($[Z],x[Z]))return!1}return!0}async get($){let x=this.threads.find((X)=>X.thread_id===$);if(!x)throw Error(`Thread with ID ${$} not found.`);return x}async set($,x){let X=this.threads.findIndex((Y)=>Y.thread_id===$);if(X===-1)throw Error(`Thread with ID ${$} not found.`);this.threads[X]={...this.threads[X],...x}}async delete($){let x=this.threads.length;if(this.threads=this.threads.filter((X)=>X.thread_id!==$),this.checkpoints.delete($),this.threads.length===x)throw Error(`Thread with ID ${$} not found.`)}async updateState($,x){let X=this.threads.findIndex((Z)=>Z.thread_id===$);if(X===-1)throw Error(`Thread with ID ${$} not found.`);let Y=this.threads[X];if(Y.status==="busy")throw Error(`Thread with ID ${$} is busy, can't update state.`);if(this.threads[X]={...Y,values:x.values,updated_at:new Date().toISOString()},Y.metadata?.graph_id){let Z=Y.metadata?.graph_id,J={configurable:{thread_id:$,graph_id:Z}};try{let U=await X0(Z,J),H=await U.updateState(J,x.values),W=await U.getState(J);return await this.set($,{values:JSON.parse(f(W.values))}),H}catch(U){console.warn("Failed to update graph state:",U)}}return{configurable:{thread_id:$}}}runs=[];async createRun($,x,X){let Z={run_id:B(),thread_id:$,assistant_id:x,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),status:"pending",metadata:X?.metadata??{},multitask_strategy:"reject"};return this.runs.push(Z),Z}async listRuns($,x){let X=[...this.runs];if(x?.status)X=X.filter((Y)=>Y.status===x.status);if(x?.limit)X=X.slice(x.offset||0,(x.offset||0)+x.limit);return X}async updateRun($,x){let X=this.runs.findIndex((Y)=>Y.run_id===$);if(X===-1)throw Error(`Run with ID ${$} not found.`);this.runs[X]={...this.runs[X],...x}}async count($){return(await this.search($)).length}async patch($,x){let X=this.threads.findIndex((Z)=>Z.thread_id===$);if(X===-1)throw Error(`Thread with ID ${$} not found.`);let Y={...this.threads[X],...x,updated_at:new Date().toISOString(),metadata:x.metadata?{...this.threads[X].metadata,...x.metadata}:this.threads[X].metadata};return this.threads[X]=Y,Y}async getState($,x){let X=await this.get($);if(x?.checkpointId){let J=(this.checkpoints.get($)||[]).find((U)=>U.checkpoint_id===x.checkpointId);if(!J)throw Error(`Checkpoint with ID ${x.checkpointId} not found for thread ${$}`);return{values:J.values,next:J.next,metadata:J.metadata,checkpoint:{id:J.checkpoint_id,thread_id:$,parent_checkpoint_id:null,checkpoint_ns:"",metadata:J.metadata,created_at:J.created_at},created_at:J.created_at,parent_checkpoint:null,tasks:[]}}return{values:X.values||{},next:[],metadata:X.metadata,checkpoint:null,created_at:X.created_at,parent_checkpoint:null,tasks:[]}}async getStateHistory($,x){let X=this.checkpoints.get($)||[],Y=X.map((Z)=>({values:Z.values,next:Z.next,metadata:Z.metadata,checkpoint:{checkpoint_id:Z.checkpoint_id,thread_id:$,checkpoint_ns:"",checkpoint_map:void 0},created_at:Z.created_at,parent_checkpoint:null,tasks:[]}));if(x?.before){let Z=X.findIndex((J)=>J.checkpoint_id===x.before);if(Z!==-1)Y=Y.slice(Z+1)}if(x?.limit)Y=Y.slice(0,x.limit);return Y}async copy($){let x=await this.get($),X=B(),Y={...x,thread_id:X,created_at:new Date().toISOString(),updated_at:new Date().toISOString()};this.threads.push(Y);let J=(this.checkpoints.get($)||[]).map((U)=>({...U,checkpoint_id:B(),thread_id:X}));return this.checkpoints.set(X,J),Y}async saveCheckpoint($,x,X,Y,Z){let J=this.checkpoints.get($)||[],U={checkpoint_id:B(),thread_id:$,values:x,next:X,config:Y,created_at:new Date().toISOString(),metadata:Z};J.push(U),this.checkpoints.set($,J)}}var S0=async()=>{if(process.env.REDIS_URL&&(process.env.CHECKPOINT_TYPE==="redis"||process.env.CHECKPOINT_TYPE==="shallow/redis")){if(process.env.CHECKPOINT_TYPE==="redis"){console.debug("LG | Using redis as checkpoint");let{RedisSaver:$}=await import("./chunk-pdkbrds7.js");return await $.fromUrl(process.env.REDIS_URL,{defaultTTL:60,refreshOnRead:!0})}if(process.env.CHECKPOINT_TYPE==="shallow/redis"){console.debug("LG | Using shallow redis as checkpoint");let{ShallowRedisSaver:$}=await import("./chunk-hww94vjn.js");return await $.fromUrl(process.env.REDIS_URL)}}if(process.env.DATABASE_URL&&H0(process.env.DATABASE_URL)==="postgres"){console.debug("LG | Using postgres as checkpoint");let{createPGCheckpoint:$}=await import("./chunk-c9q11tk2.js");return $()}if(process.env.SQLITE_DATABASE_URI){if(process.env.CHECKPOINT_TYPE==="sqlite"){console.debug("LG | Using sqlite (full) as checkpoint");let{SqliteSaver:X}=await import("./chunk-rrkzfahh.js");return await X.fromConnStringAsync(process.env.SQLITE_DATABASE_URI)}console.debug("LG | Using shallow sqlite as checkpoint (default)");let{SqliteShallowSaver:$}=await import("./chunk-5fqt5yg1.js");return await $.fromConnStringAsync(process.env.SQLITE_DATABASE_URI)}return console.log("LG | You are using memory as checkpoint!"),console.log("\x1B[33m%s\x1B[0m","LG | set SQLITE_DATABASE_URI=./.langgraph_api/langgraph.db to your .env file to use \x1B[1mSQLite\x1B[0m for dev!"),console.log("\x1B[33m%s\x1B[0m","LG | set DATABASE_URL=postgresql://user:pass@localhost:5432/db to your .env file to use \x1B[1mPostgreSQL\x1B[0m for prod!"),new Y0},G0=async()=>{let $;if(process.env.REDIS_URL){console.debug("LG | Using redis as stream queue");let{RedisStreamQueue:x}=await import("./chunk-vc384abg.js");$=x}else $=h;return new x0($)};function H0($){let x=$.toLowerCase();if(x.startsWith("http://")||x.startsWith("https://"))return"remote";return"postgres"}var w0=async($)=>{if(process.env.DATABASE_URL){if(H0(process.env.DATABASE_URL)==="remote"){console.debug("LG | Using Remote PostgreSQL ThreadsManager");let{RemoteKyselyThreadsManager:X}=await import("./chunk-j204fejq.js"),Y=new X(process.env.DATABASE_URL);if(process.env.DATABASE_INIT==="true")await Y.setup();return Y}else if($.checkpointer){console.debug("LG | Using PostgreSQL ThreadsManager");let{PostgresAdapter:X}=await import("./chunk-q8arjxg1.js"),Y=$.checkpointer.pool,Z=new I(new X(Y));if(process.env.DATABASE_INIT==="true")await Z.setup();return Z}}if(process.env.SQLITE_DATABASE_URI&&$.checkpointer){console.debug("LG | Using SQLite ThreadsManager");let{SQLiteAdapter:x}=await import("./chunk-yvhq458c.js"),X=$.checkpointer.db,Y=new I(new x(X));return await Y.setup(),Y}return new U0};class F{static globalMessageQueue=null;static globalCheckPointer=null;static globalThreadsManager=null;static isInitialized=null;static async initGlobal(){if(F.isInitialized)return F.isInitialized;return F.isInitialized=(async()=>{let[$,x]=await Promise.all([G0(),S0()]);console.debug("LG | checkpointer created");let X=await w0({checkpointer:x});console.debug("LG | threads manager created"),console.debug("LG | global init done"),F.globalMessageQueue=$,F.globalCheckPointer=x,F.globalThreadsManager=X})(),F.isInitialized}}async function C0($,x,X,Y,Z){let U=Y.config?.configurable?.graph_id;if(!U||typeof U!=="string")throw Error("Invalid or missing graph_id");let H=await Z.getGraph(U,Y.config,{checkpointer:Y.temporary?null:void 0}),W=Array.isArray(Y.streamMode)?Y.streamMode:Y.streamMode?[Y.streamMode]:[],Q=new Set(["values",...W.filter((D)=>D!=="events"&&D!=="messages-tuple")]);if(W.includes("messages-tuple"))Q.add("messages");if(W.includes("messages"))Q.add("values");await X.push(new N("metadata",{run_id:x.run_id,attempt:Z.attempt,graph_id:U}));let P={...Y.config?.metadata,run_attempt:Z.attempt},O=null,K=null,A=null;try{O=new Set,K=new Map,A=await H.stream(Y.command!=null?A0(Y.command):Y.input??null,{interruptAfter:Y.interruptAfter,interruptBefore:Y.interruptBefore,tags:Y.config?.tags,configurable:Y.config?.configurable,recursionLimit:Y.config?.recursionLimit,subgraphs:Y.streamSubgraphs,metadata:P,runId:x.run_id,streamMode:[...Q],signal:X.cancelSignal.signal});for await(let D of A){let L=[];if(D.length===3)L=D.splice(0,1);let _=(z)=>{if(L.length===0)return z;if(L.length===1&&L[0]?.length===0)return z;return`${z}|${L.join("|")}`};if(D[0]==="values"){let z=D[1];if(_("values")==="values")if(await X.push(new N(_("values"),z)),z?.__interrupt__)await $.set(x.thread_id,{status:"interrupted",interrupts:z?JSON.parse(f(z)):""});else await $.set(x.thread_id,{values:z?JSON.parse(f(z)):""})}else if(D[0]==="messages"){let z=D[1][0],q=D[1][1];if(z.id&&!O.has(z.id))await X.push(new N("messages/metadata",{[z.id]:q})),O.add(z.id);if(O0.isInstance(z)&&z.id){if(K.set(z.id,[...K.get(z.id)??[],z]),await X.push(new N("messages/partial",[K.get(z.id).reduce(V0)])),z.content===""&&!z.tool_calls?.length)K.delete(z.id)}else await X.push(new N("messages/partial",[z]))}else if(D[0]==="updates"){let z=D[1];await X.push(new N(_("updates"),z))}}}catch(D){if(!(D instanceof Error&&D.message?.includes("cancel"))){console.error("streamStateWithQueue error:",D);try{await X.push(new c(D))}catch(L){}}throw D}finally{try{await X.push(new J0)}catch(D){}if(O)O.clear(),O=null;if(K)K.clear(),K=null;A=null}}var f=($,x=0)=>{return JSON.stringify($,function(X,Y){let Z=this[X];if(Z!=null&&typeof Z==="object"&&"toDict"in Z&&typeof Z.toDict==="function"){let{type:J,data:U}=Z.toDict();return{...U,type:J}}return Y},x)};async function*i0($,x,X,Y){x=await x;let{run_id:Z,thread_id:J}=x,U=null,H=null,W=null,Q=!1;try{await $.set(J,{status:"busy"}),await $.updateRun(x.run_id,{status:"running"}),H=F.globalMessageQueue.createQueue(Z),U=H.onDataReceive(),W=C0($,x,H,X,Y).catch((P)=>{if(Q)return;if(P.message!=="user cancel this run")console.error("Queue task error:",P);F.globalMessageQueue.pushToQueue(Z,new c(P))});for await(let P of U)yield P;await $.updateRun(x.run_id,{status:"success"})}catch(P){console.error("Stream error:",P),await $.updateRun(x.run_id,{status:"error"}),await $.set(J,{status:"error"})}finally{if(Q=!0,U){try{await U.return(void 0)}catch(O){}U=null}if(H&&!H.cancelSignal.signal.aborted)try{H.cancelSignal.abort("Stream consumer disconnected")}catch(O){}if(W){try{await Promise.race([W,new Promise((O)=>setTimeout(O,1000))])}catch(O){}W=null}if((await $.get(J)).status==="interrupted")await F.globalMessageQueue.copyQueue(Z,J,30000);else await $.set(J,{status:"idle",interrupts:{}});await F.globalMessageQueue.removeQueue(Z),H=null}}
|
|
2
|
-
export{$0 as d,T as e,n0 as f,X0 as g,Z0 as h,F as i,f as j,i0 as k};
|
package/dist/chunk-pdkbrds7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as x,b as I}from"./chunk-5wn1nfqy.js";import"./chunk-7dp8kq2f.js";import{U as C,V as T,W as b,X as w,Y as v}from"./chunk-bgpcx3bm.js";import{nb as K}from"./chunk-cze71w02.js";var W=K(I(),1),g=[{index:"checkpoints",prefix:"checkpoint:",schema:{"$.thread_id":{type:"TAG",AS:"thread_id"},"$.checkpoint_ns":{type:"TAG",AS:"checkpoint_ns"},"$.checkpoint_id":{type:"TAG",AS:"checkpoint_id"},"$.parent_checkpoint_id":{type:"TAG",AS:"parent_checkpoint_id"},"$.checkpoint_ts":{type:"NUMERIC",AS:"checkpoint_ts"},"$.has_writes":{type:"TAG",AS:"has_writes"},"$.source":{type:"TAG",AS:"source"},"$.step":{type:"NUMERIC",AS:"step"}}},{index:"checkpoint_blobs",prefix:"checkpoint_blob:",schema:{"$.thread_id":{type:"TAG",AS:"thread_id"},"$.checkpoint_ns":{type:"TAG",AS:"checkpoint_ns"},"$.checkpoint_id":{type:"TAG",AS:"checkpoint_id"},"$.channel":{type:"TAG",AS:"channel"},"$.version":{type:"TAG",AS:"version"},"$.type":{type:"TAG",AS:"type"}}},{index:"checkpoint_writes",prefix:"checkpoint_write:",schema:{"$.thread_id":{type:"TAG",AS:"thread_id"},"$.checkpoint_ns":{type:"TAG",AS:"checkpoint_ns"},"$.checkpoint_id":{type:"TAG",AS:"checkpoint_id"},"$.task_id":{type:"TAG",AS:"task_id"},"$.idx":{type:"NUMERIC",AS:"idx"},"$.channel":{type:"TAG",AS:"channel"},"$.type":{type:"TAG",AS:"type"}}}],f=class z extends w{client;ttlConfig;constructor(G,J){super();this.client=G,this.ttlConfig=J}static async fromUrl(G,J){let Z=W.createClient({url:G});await Z.connect();let Q=new z(Z,J);return await Q.ensureIndexes(),Q}static async fromCluster(G,J){let Z=W.createCluster({rootNodes:G});await Z.connect();let Q=new z(Z,J);return await Q.ensureIndexes(),Q}async get(G){return(await this.getTuple(G))?.checkpoint}async getTuple(G){let J=G.configurable?.thread_id,Z=G.configurable?.checkpoint_ns??"",Q=G.configurable?.checkpoint_id;if(!J)return;let Y,E;if(Q)Y=`checkpoint:${J}:${Z}:${Q}`,E=await this.client.json.get(Y);else{let $=`checkpoint:${J}:${Z}:*`,_=await this.client.keys($);if(_.length===0)return;_.sort(),Y=_[_.length-1],E=await this.client.json.get(Y)}if(!E)return;if(this.ttlConfig?.refreshOnRead&&this.ttlConfig?.defaultTTL)await this.applyTTL(Y);let{checkpoint:F,pendingWrites:X}=await this.loadCheckpointWithWrites(E);return await this.createCheckpointTuple(E,F,X)}async put(G,J,Z,Q){await this.ensureIndexes();let Y=G.configurable?.thread_id,E=G.configurable?.checkpoint_ns??"",F=G.configurable?.checkpoint_id;if(!Y)throw Error("thread_id is required");let X=J.id||C(0),$=`checkpoint:${Y}:${E}:${X}`,_=b(J);if(_.channel_values&&Q!==void 0)if(Object.keys(Q).length===0)_.channel_values={};else{let U={};for(let B of Object.keys(Q))if(B in _.channel_values)U[B]=_.channel_values[B];_.channel_values=U}let H={thread_id:Y,checkpoint_ns:E===""?"__empty__":E,checkpoint_id:X,parent_checkpoint_id:F||null,checkpoint:_,metadata:Z,checkpoint_ts:Date.now(),has_writes:"false"};if(this.addSearchableMetadataFields(H,Z),await this.client.json.set($,"$",H),this.ttlConfig?.defaultTTL)await this.applyTTL($);return{configurable:{thread_id:Y,checkpoint_ns:E,checkpoint_id:X}}}async*list(G,J){if(await this.ensureIndexes(),J?.filter!==void 0){let Q=Object.values(J.filter).some((X)=>X===null),Y=[];if(G?.configurable?.thread_id){let X=G.configurable.thread_id.replace(/[-.@]/g,"\\$&");Y.push(`(@thread_id:{${X}})`)}if(G?.configurable?.checkpoint_ns!==void 0){let X=G.configurable.checkpoint_ns;if(X==="")Y.push("(@checkpoint_ns:{__empty__})");else{let $=X.replace(/[-.@]/g,"\\$&");Y.push(`(@checkpoint_ns:{${$}})`)}}if(!J?.before&&J?.filter){for(let[X,$]of Object.entries(J.filter))if($===void 0);else if($===null);else if(typeof $==="string"){let _=x(X),H=x($);Y.push(`(@${_}:{${H}})`)}else if(typeof $==="number"){let _=x(X);Y.push(`(@${_}:[${$} ${$}])`)}else if(typeof $==="object"&&Object.keys($).length===0);}if(Y.length===0)Y.push("*");let E=Y.join(" "),F=J?.limit??10;try{let X=J?.before&&!G?.configurable?.thread_id?1000:J?.before?F*10:F,$=(await this.client.ft.search("checkpoints",E,{LIMIT:{from:0,size:X},SORTBY:{BY:"checkpoint_ts",DIRECTION:"DESC"}})).documents,_=0;for(let H of $){if(_>=F)break;if(J?.before?.configurable?.checkpoint_id){if(H.value.checkpoint_id>=J.before.configurable.checkpoint_id)continue}let U=H.value,B=!0;if((Q||J?.before)&&J?.filter){for(let[M,O]of Object.entries(J.filter))if(O===null){if(U.metadata?.[M]!==null){B=!1;break}}else if(O!==void 0){let A=U.metadata?.[M];if(typeof O==="object"&&O!==null){if(q(A)!==q(O)){B=!1;break}}else if(A!==O){B=!1;break}}if(!B)continue}let{checkpoint:L,pendingWrites:R}=await this.loadCheckpointWithWrites(U);yield await this.createCheckpointTuple(U,L,R),_++}return}catch(X){if(X.message?.includes("no such index"));else throw X}if(G?.configurable?.thread_id){let X=G.configurable.thread_id,$=G.configurable.checkpoint_ns??"",_=`checkpoint:${X}:${$}:*`,H=await this.client.keys(_);H.sort().reverse();let U=H;if(J?.before?.configurable?.checkpoint_id){let R=`checkpoint:${J.before.configurable.thread_id||X}:${J.before.configurable.checkpoint_ns??$}:${J.before.configurable.checkpoint_id}`,M=H.indexOf(R);if(M>0)U=H.slice(M+1);else if(M===0)U=[]}let B=J?.limit??10,L=U.slice(0,B);for(let R of L){let M=await this.client.json.get(R);if(M){let O=!0;for(let[V,S]of Object.entries(J.filter)){let N=M.metadata?.[V];if(S===null){if(N!==null){O=!1;break}}else if(N!==S){O=!1;break}}if(!O)continue;let{checkpoint:A,pendingWrites:P}=await this.loadCheckpointWithWrites(M);yield await this.createCheckpointTuple(M,A,P)}}}else{let X=G?.configurable?.checkpoint_ns!==void 0?`checkpoint:*:${G.configurable.checkpoint_ns===""?"__empty__":G.configurable.checkpoint_ns}:*`:"checkpoint:*",$=await this.client.keys(X),_=[];for(let B of $){let L=await this.client.json.get(B);if(L)_.push({key:B,doc:L})}_.sort((B,L)=>L.doc.checkpoint_ts-B.doc.checkpoint_ts);let H=0,U=J?.limit??10;for(let{doc:B}of _){if(H>=U)break;if(J?.before?.configurable?.checkpoint_id){if(B.checkpoint_id>=J.before.configurable.checkpoint_id)continue}let L=!0;if(J?.filter){for(let[O,A]of Object.entries(J.filter))if(A===null){if(B.metadata?.[O]!==null){L=!1;break}}else if(A!==void 0){let P=B.metadata?.[O];if(typeof A==="object"&&A!==null){if(q(P)!==q(A)){L=!1;break}}else if(P!==A){L=!1;break}}if(!L)continue}let{checkpoint:R,pendingWrites:M}=await this.loadCheckpointWithWrites(B);yield await this.createCheckpointTuple(B,R,M),H++}}return}let Z={...J,filter:{}};yield*this.list(G,Z)}async putWrites(G,J,Z){await this.ensureIndexes();let Q=G.configurable?.thread_id,Y=G.configurable?.checkpoint_ns??"",E=G.configurable?.checkpoint_id;if(!Q||!E)throw Error("thread_id and checkpoint_id are required");let F=[],X=performance.now()*1000;for(let _=0;_<J.length;_++){let[H,U]=J[_],B=`checkpoint_write:${Q}:${Y}:${E}:${Z}:${_}`;F.push(B);let L={thread_id:Q,checkpoint_ns:Y,checkpoint_id:E,task_id:Z,idx:_,channel:H,type:typeof U==="object"?"json":"string",value:U,timestamp:X,global_idx:X+_};await this.client.json.set(B,"$",L)}if(F.length>0){let _=`write_keys_zset:${Q}:${Y}:${E}`,H={};if(F.forEach((U,B)=>{H[U]=X+B}),await this.client.zAdd(_,Object.entries(H).map(([U,B])=>({score:B,value:U}))),this.ttlConfig?.defaultTTL)await this.applyTTL(...F,_)}let $=`checkpoint:${Q}:${Y}:${E}`;if(await this.client.exists($)){let _=await this.client.json.get($);if(_)_.has_writes="true",await this.client.json.set($,"$",_)}}async deleteThread(G){let J=`checkpoint:${G}:*`,Z=await this.client.keys(J);if(Z.length>0)await this.client.del(Z);let Q=`writes:${G}:*`,Y=await this.client.keys(Q);if(Y.length>0)await this.client.del(Y)}async end(){await this.client.quit()}async loadPendingWrites(G,J,Z){let Q=`checkpoint_write:${G}:${J}:${Z}:*`,Y=await this.client.keys(Q);if(Y.length===0)return;let E=[];for(let X of Y){let $=await this.client.json.get(X);if($)E.push($)}E.sort((X,$)=>(X.global_idx||0)-($.global_idx||0));let F=[];for(let X of E){let $=await this.serde.loadsTyped("json",JSON.stringify(X.value));F.push([X.task_id,X.channel,$])}return F}async loadCheckpointWithWrites(G){let J=await this.serde.loadsTyped("json",JSON.stringify(G.checkpoint));if(J.v<4&&G.parent_checkpoint_id!=null){let Q=G.checkpoint_ns==="__empty__"?"":G.checkpoint_ns;await this.migratePendingSends(J,G.thread_id,Q,G.parent_checkpoint_id)}let Z;if(G.has_writes==="true"){let Q=G.checkpoint_ns==="__empty__"?"":G.checkpoint_ns;Z=await this.loadPendingWrites(G.thread_id,Q,G.checkpoint_id)}return{checkpoint:J,pendingWrites:Z}}async migratePendingSends(G,J,Z,Q){let Y=await this.loadPendingWrites(J,Z,Q);if(!Y||Y.length===0)return;let E=Y.filter(([,X])=>X===T);if(E.length===0)return;let F=[];for(let[,,X]of E)F.push(X);G.channel_values??={},G.channel_values[T]=F,G.channel_versions[T]=Object.keys(G.channel_versions).length>0?v(...Object.values(G.channel_versions)):1}async createCheckpointTuple(G,J,Z){let Q=G.checkpoint_ns==="__empty__"?"":G.checkpoint_ns,Y=await this.serde.loadsTyped("json",JSON.stringify(G.metadata));return{config:{configurable:{thread_id:G.thread_id,checkpoint_ns:Q,checkpoint_id:G.checkpoint_id}},checkpoint:J,metadata:Y,parentConfig:G.parent_checkpoint_id?{configurable:{thread_id:G.thread_id,checkpoint_ns:Q,checkpoint_id:G.parent_checkpoint_id}}:void 0,pendingWrites:Z}}addSearchableMetadataFields(G,J){if(!J)return;if("source"in J)G.source=J.source;if("step"in J)G.step=J.step;if("writes"in J)G.writes=typeof J.writes==="object"?JSON.stringify(J.writes):J.writes;if("score"in J)G.score=J.score}async applyTTL(...G){if(!this.ttlConfig?.defaultTTL)return;let J=Math.floor(this.ttlConfig.defaultTTL*60),Z=await Promise.allSettled(G.map((Q)=>this.client.expire(Q,J)));for(let Q=0;Q<Z.length;Q++)if(Z[Q].status==="rejected")console.warn(`Failed to set TTL for key ${G[Q]}:`,Z[Q].reason)}async ensureIndexes(){for(let G of g)try{await this.client.ft.create(G.index,G.schema,{ON:"JSON",PREFIX:G.prefix})}catch(J){if(!J.message?.includes("Index already exists"))console.error(`Failed to create index ${G.index}:`,J.message)}}};function q(z){if(z===null||typeof z!=="object")return JSON.stringify(z);if(Array.isArray(z))return JSON.stringify(z.map((Z)=>q(Z)));let G={},J=Object.keys(z).sort();for(let Z of J)G[Z]=z[Z];return JSON.stringify(G,(Z,Q)=>{if(Q!==null&&typeof Q==="object"&&!Array.isArray(Q)){let Y={},E=Object.keys(Q).sort();for(let F of E)Y[F]=Q[F];return Y}return Q})}export{f as RedisSaver};
|
package/dist/chunk-rdc9pxf6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{M}from"./chunk-keqk70wm.js";import"./chunk-9kc9cea3.js";import{ca as T,ea as G,ha as Z,la as Y,na as _,pa as $}from"./chunk-wwn7gw8g.js";import{sa as L}from"./chunk-3ep2tag7.js";import{Fa as w}from"./chunk-vkng13p1.js";import"./chunk-sft6ep0c.js";import"./chunk-dh3jz71n.js";import"./chunk-yaa4eesd.js";import"./chunk-jkbtx9va.js";import"./chunk-kbs4px1b.js";import"./chunk-9k57afdm.js";import{nb as K}from"./chunk-cze71w02.js";var z=K(T(),1);var y=K(Y(),1),h=({onClose:H})=>{let{config:U,updateConfig:N}=M(),B=U?.switch_command||"default",O=z.useCallback(async()=>{let q=await L(w);return Object.values(q)},[]),Q=z.useCallback((q,F,J)=>{let P=q.id===B;return y.jsxDEV(_,{isSelected:J,isCurrent:P,children:[y.jsxDEV(G,{bold:!0,children:[F+1,". ",q.id]},void 0,!0,void 0,this),y.jsxDEV(Z,{},void 0,!1,void 0,this),y.jsxDEV(G,{dimColor:!0,children:q.description},void 0,!1,void 0,this)]},`agent-${q.id}`,!0,void 0,this)},[B]),R=z.useCallback((q)=>{return q.id===B},[B]),W=z.useCallback(async(q)=>{let F=q.id==="default"?"":q.id;N({switch_command:F}),H()},[N,H]),X=z.useCallback((q)=>{let F=q.find((J)=>J.id===B);return F?y.jsxDEV(G,{color:"gray",dimColor:!0,children:["当前 Agent: ",y.jsxDEV(G,{color:"green",children:F.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null},[B]),v=z.useMemo(()=>({id:"agent",title:"Agent 选择",icon:"\uD83E\uDD16",dataSource:O,searchable:!0,searchFields:["id","name","description"],searchPlaceholder:"搜索 agent (名称/描述)...",filterable:!0,filters:[{id:"default",label:"默认",predicate:(q)=>q.id==="default"},{id:"custom",label:"自定义",predicate:(q)=>q.id!=="default"}],defaultFilter:"all",itemHeight:3,visibleCount:15,renderItem:Q,isSelected:R,onSelect:W,showCount:!0,statusInfo:X}),[O,Q,R,W,X]);return y.jsxDEV($,{config:v,onClose:H},void 0,!1,void 0,this)},m=h;export{m as default};
|