claude-code-best 1.3.6 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/{chunk-snpjjn5q.js → chunk-00b2znqm.js} +2 -2
- package/dist/{chunk-cy7hbg8h.js → chunk-0asd58w2.js} +2 -2
- package/dist/{chunk-4zkbp6fk.js → chunk-0ctfznp2.js} +85 -84
- package/dist/{chunk-3b0p0vrc.js → chunk-0kp39at8.js} +40 -40
- package/dist/{chunk-xfe2m04z.js → chunk-0n0r9fwa.js} +1 -1
- package/dist/{chunk-ttqs2rma.js → chunk-0qe6jzfm.js} +28 -28
- package/dist/{chunk-m1xjfwvq.js → chunk-0rbezx7s.js} +28 -28
- package/dist/{chunk-r1pxpxxk.js → chunk-0w8eb8gt.js} +2 -2
- package/dist/{chunk-d267stxj.js → chunk-0z0m6mm5.js} +1 -1
- package/dist/{chunk-r6pe7y6z.js → chunk-157v5wtn.js} +2 -2
- package/dist/{chunk-m6ee4m2f.js → chunk-1e8f0nx0.js} +28 -28
- package/dist/{chunk-6a316dkg.js → chunk-1j332jvg.js} +10 -10
- package/dist/{chunk-mq37sf2q.js → chunk-1neq14g8.js} +28 -28
- package/dist/{chunk-ttswf1a8.js → chunk-1zjrec16.js} +5 -5
- package/dist/{chunk-e3kwey2b.js → chunk-21pvq2fw.js} +31 -31
- package/dist/{chunk-12e5a806.js → chunk-25yy8wx5.js} +4 -4
- package/dist/{chunk-dh6khzjj.js → chunk-29p0hjfs.js} +2 -2
- package/dist/{chunk-j16rp8y4.js → chunk-29yjrfeq.js} +1 -1
- package/dist/{chunk-bem4prar.js → chunk-2apay7a3.js} +31 -31
- package/dist/{chunk-dbv7vcrz.js → chunk-2c4003f8.js} +28 -28
- package/dist/{chunk-hd98he8z.js → chunk-2eb66dha.js} +6 -6
- package/dist/{chunk-8q4yg5pk.js → chunk-2j4wdmkt.js} +1 -1
- package/dist/{chunk-w94epkj0.js → chunk-2mbctja8.js} +5 -5
- package/dist/{chunk-a6s9h1qh.js → chunk-2smwf3e9.js} +2 -2
- package/dist/{chunk-194wmkgc.js → chunk-2x5az5dc.js} +29 -29
- package/dist/{chunk-03881djp.js → chunk-34vnwd0v.js} +8 -8
- package/dist/{chunk-q0exa8dt.js → chunk-386z9vh4.js} +30 -30
- package/dist/{chunk-hs7qq18b.js → chunk-3ah2pq1f.js} +34 -34
- package/dist/{chunk-etbqf6ty.js → chunk-3c0rxf7q.js} +33 -33
- package/dist/{chunk-2krazyfm.js → chunk-3ef0cpf6.js} +29 -29
- package/dist/{chunk-35g2t0y0.js → chunk-3fjgkntc.js} +1 -1
- package/dist/{chunk-hw1qqgzj.js → chunk-3gtk4mh3.js} +33 -33
- package/dist/{chunk-4xbmk1fe.js → chunk-3gww1j1y.js} +34 -30
- package/dist/{chunk-xqch8m5f.js → chunk-3wjy1cpr.js} +4 -4
- package/dist/{chunk-3h4pyb94.js → chunk-4169yf5x.js} +2 -2
- package/dist/{chunk-q5v3yazb.js → chunk-43b84za2.js} +1 -1
- package/dist/{chunk-j1r1mywp.js → chunk-4581z0wr.js} +8 -8
- package/dist/{chunk-mmcr6z1m.js → chunk-45bbgebk.js} +4 -4
- package/dist/{chunk-1scf0v8s.js → chunk-4drmj637.js} +5 -5
- package/dist/{chunk-jg85npcz.js → chunk-4f4jqsza.js} +1 -1
- package/dist/{chunk-e0jj5paw.js → chunk-4f5xrg8h.js} +28 -28
- package/dist/{chunk-v6maw2x3.js → chunk-4gpt5ay1.js} +29 -29
- package/dist/{chunk-hda58kjk.js → chunk-4krsdy3p.js} +2 -2
- package/dist/{chunk-wp6axm3b.js → chunk-4m47hfh0.js} +28 -28
- package/dist/{chunk-hwby3r4g.js → chunk-4nf1ec4f.js} +1 -1
- package/dist/{chunk-f39ftn0d.js → chunk-4vj2d7dz.js} +35 -35
- package/dist/{chunk-rpm043xg.js → chunk-4vjvqns0.js} +3 -3
- package/dist/{chunk-k2m40brd.js → chunk-50xwa16q.js} +29 -29
- package/dist/{chunk-683cf5j7.js → chunk-53sfy7n4.js} +28 -28
- package/dist/{chunk-nsh75cdk.js → chunk-53vj9v9s.js} +6 -6
- package/dist/{chunk-byrh00bq.js → chunk-5526qw2k.js} +1 -1
- package/dist/{chunk-t0b0bas5.js → chunk-5840qkdv.js} +1 -1
- package/dist/{chunk-8xmqgp50.js → chunk-5hjsrynt.js} +1 -1
- package/dist/{chunk-9dgec475.js → chunk-5km8j211.js} +1 -1
- package/dist/{chunk-vyejsevp.js → chunk-5wzcv9gh.js} +5 -5
- package/dist/{chunk-pwxgff26.js → chunk-5xjn56aq.js} +3 -3
- package/dist/{chunk-8vkefxtt.js → chunk-5yd55bg7.js} +28 -28
- package/dist/{chunk-61j8wh0j.js → chunk-607fe07t.js} +28 -28
- package/dist/{chunk-7xnaj5zg.js → chunk-688ah6p4.js} +42 -42
- package/dist/{chunk-26zepstf.js → chunk-6ad36q0w.js} +3 -3
- package/dist/{chunk-nkvkmxw4.js → chunk-6b45etp0.js} +2 -2
- package/dist/{chunk-38tedxdq.js → chunk-6cqap182.js} +32 -32
- package/dist/{chunk-ctbkh6m5.js → chunk-6k1w8x4k.js} +29 -29
- package/dist/{chunk-a75g97ek.js → chunk-6sqsx9jy.js} +5 -5
- package/dist/{chunk-r9cy8b69.js → chunk-6wpr3tjc.js} +28 -28
- package/dist/{chunk-s3gzpm93.js → chunk-6yahjmr9.js} +1 -1
- package/dist/{chunk-dqrmn537.js → chunk-75fdprgp.js} +1 -1
- package/dist/{chunk-asfhkynx.js → chunk-7750n93j.js} +1 -1
- package/dist/{chunk-33fsprrx.js → chunk-77dn0tk8.js} +3 -3
- package/dist/{chunk-kw6sq28k.js → chunk-79wycw4g.js} +68 -66
- package/dist/{chunk-zsssgqjr.js → chunk-7cfbwd7q.js} +29 -29
- package/dist/{chunk-rb79txq9.js → chunk-7hftfbxa.js} +2 -2
- package/dist/{chunk-n35gnb9g.js → chunk-7hmy36fh.js} +121 -2
- package/dist/{chunk-psz76514.js → chunk-7p1esgzf.js} +1 -1
- package/dist/{chunk-g4fc7hyp.js → chunk-7w2h14a6.js} +5 -5
- package/dist/{chunk-xkfzn8zv.js → chunk-86epd45z.js} +11 -11
- package/dist/{chunk-m9g44vvc.js → chunk-8833n19q.js} +1 -1
- package/dist/{chunk-rd3w1pnm.js → chunk-8cn35yvf.js} +4 -4
- package/dist/{chunk-p80rbxhh.js → chunk-8favkbxx.js} +2 -2
- package/dist/{chunk-znpx8t4w.js → chunk-8fwh1vg6.js} +5 -5
- package/dist/{chunk-04hdmsbx.js → chunk-8j0cag62.js} +1 -1
- package/dist/{chunk-t7z61mwv.js → chunk-8n7czf03.js} +29 -29
- package/dist/{chunk-vyty9qyf.js → chunk-90vttb3v.js} +38 -38
- package/dist/{chunk-z3vynq90.js → chunk-9fsvmcz5.js} +31 -31
- package/dist/{chunk-f9my4m74.js → chunk-9gpr8jae.js} +29 -29
- package/dist/{chunk-gcxez66d.js → chunk-9je35yst.js} +3 -3
- package/dist/{chunk-xspp3626.js → chunk-9qbwahdr.js} +3 -3
- package/dist/{chunk-fdc4mbdf.js → chunk-9tgts6mc.js} +1 -1
- package/dist/{chunk-7qf1wt5n.js → chunk-a27gcyws.js} +2 -2
- package/dist/{chunk-5rezdbjk.js → chunk-a5b9swcd.js} +28 -28
- package/dist/{chunk-yb4zstfq.js → chunk-adjan1zm.js} +28 -28
- package/dist/{chunk-66s54sg3.js → chunk-agabmbjf.js} +31 -31
- package/dist/{chunk-k73mekxt.js → chunk-ajs8dza3.js} +28 -28
- package/dist/{chunk-0jcebzyj.js → chunk-akkp39da.js} +28 -28
- package/dist/{chunk-c3a6ss16.js → chunk-amyrs3hm.js} +2 -2
- package/dist/{chunk-gnq6fd5g.js → chunk-ap1ykep6.js} +1 -1
- package/dist/{chunk-y7sdst27.js → chunk-azksrewr.js} +34 -34
- package/dist/{chunk-rwyc5eh7.js → chunk-b0x349dj.js} +29 -29
- package/dist/{chunk-cd99ankh.js → chunk-b2vzxkee.js} +5 -5
- package/dist/{chunk-tbm211vs.js → chunk-beq5rrj7.js} +5 -5
- package/dist/{chunk-963ysvck.js → chunk-bv1k9d6v.js} +28 -28
- package/dist/{chunk-870vafdb.js → chunk-bx6g17ek.js} +4 -4
- package/dist/{chunk-mayfcyq2.js → chunk-c1jzx2gv.js} +4 -4
- package/dist/{chunk-vhggszd9.js → chunk-c4y7537k.js} +2 -2
- package/dist/{chunk-a0yw6a1m.js → chunk-ccb92crb.js} +4 -4
- package/dist/{chunk-fj7x7q9f.js → chunk-cd6mvmte.js} +29 -29
- package/dist/{chunk-6p2kydfj.js → chunk-cdqf4qst.js} +28 -28
- package/dist/{chunk-13pvvkd3.js → chunk-cj8t81dc.js} +28 -28
- package/dist/{chunk-ez3c99v0.js → chunk-cnggqnzm.js} +6 -6
- package/dist/{chunk-b7e8n2r7.js → chunk-cqndxy46.js} +1 -1
- package/dist/chunk-cr6s4vp6.js +1396 -0
- package/dist/{chunk-7jsk6wen.js → chunk-crvsdcfv.js} +28 -28
- package/dist/{chunk-h48af73s.js → chunk-cyjjqcs3.js} +29 -29
- package/dist/{chunk-d01wa055.js → chunk-cyxsqapw.js} +3 -3
- package/dist/{chunk-7whq2gjt.js → chunk-d3paf9v2.js} +28 -28
- package/dist/{chunk-wrxzr8y1.js → chunk-d6ecf8f1.js} +37 -37
- package/dist/{chunk-evbemh4j.js → chunk-d92pjy0h.js} +31 -31
- package/dist/{chunk-wqx2ybqh.js → chunk-deatxv64.js} +8 -8
- package/dist/{chunk-9nm5sbkf.js → chunk-djp9rrcq.js} +17 -17
- package/dist/{chunk-274pv89a.js → chunk-dtv3phgm.js} +28 -28
- package/dist/{chunk-knqgpzjb.js → chunk-e5mw3cyw.js} +1 -1
- package/dist/{chunk-pj4p53ve.js → chunk-e6rrn2tj.js} +28 -28
- package/dist/{chunk-ewcq3dcx.js → chunk-ebzv9705.js} +2 -2
- package/dist/{chunk-gv4dsg6q.js → chunk-edz2xqmx.js} +37 -37
- package/dist/{chunk-714yn4hd.js → chunk-egwqdd9k.js} +13 -13
- package/dist/{chunk-92v75fwp.js → chunk-enzrrdn4.js} +1 -1
- package/dist/{chunk-j1ftb6pr.js → chunk-erjs2wr4.js} +4 -4
- package/dist/{chunk-yhg6hhw7.js → chunk-erxndz83.js} +21 -20
- package/dist/{chunk-2jzsktxp.js → chunk-etg0he8j.js} +28 -28
- package/dist/{chunk-yk15ya1h.js → chunk-evww0yyb.js} +2 -2
- package/dist/{chunk-k25d0zv6.js → chunk-ew9re4pd.js} +3 -3
- package/dist/{chunk-tpgs71gk.js → chunk-ewb2cm8z.js} +2 -2
- package/dist/{chunk-w3sv9y41.js → chunk-fbs21kq9.js} +1 -1
- package/dist/{chunk-9vshpe8q.js → chunk-fezbtqkp.js} +37 -37
- package/dist/{chunk-de1831as.js → chunk-fjh0vhqw.js} +3 -3
- package/dist/{chunk-dchgtage.js → chunk-fsqp1hdd.js} +2 -2
- package/dist/{chunk-jbts6gcv.js → chunk-fsrg55vw.js} +4 -4
- package/dist/{chunk-2qhfqgbj.js → chunk-g3t3tpmr.js} +5 -5
- package/dist/{chunk-yy3dj90t.js → chunk-g5w87dmr.js} +1 -1
- package/dist/{chunk-95jqp7w7.js → chunk-g9t81ym4.js} +29 -29
- package/dist/{chunk-gd0gptts.js → chunk-gc91es60.js} +28 -28
- package/dist/{chunk-etv5netv.js → chunk-gfc6zk7q.js} +3 -3
- package/dist/{chunk-xzh7ae0a.js → chunk-gra7rch0.js} +37 -37
- package/dist/{chunk-995f4htk.js → chunk-gyzh9997.js} +28 -28
- package/dist/{chunk-9wz3jvbh.js → chunk-h65cdcmj.js} +8 -8
- package/dist/{chunk-3cvw39wv.js → chunk-h6wkvzrd.js} +2 -2
- package/dist/{chunk-9073kfry.js → chunk-hcwq2bw3.js} +5 -5
- package/dist/{chunk-vsrejr6p.js → chunk-hhx05ny2.js} +39 -39
- package/dist/{chunk-sj7m6hsp.js → chunk-hy2yy9dj.js} +1 -1
- package/dist/{chunk-tjwcr6x0.js → chunk-hz4cc1fy.js} +28 -28
- package/dist/{chunk-1gvjejsj.js → chunk-j5pcp6j1.js} +2 -2
- package/dist/{chunk-a6hvbf61.js → chunk-jhbtp60e.js} +4 -4
- package/dist/{chunk-fqpabm91.js → chunk-jjcks6sw.js} +1 -1
- package/dist/{chunk-b4hkf17a.js → chunk-jver0cay.js} +1 -1
- package/dist/{chunk-9kgh44wk.js → chunk-jz86pz25.js} +40 -40
- package/dist/{chunk-fcwx5cbb.js → chunk-k5kw9hyy.js} +1 -1
- package/dist/{chunk-jr10vd79.js → chunk-k8vb990d.js} +28 -28
- package/dist/{chunk-wqmza60n.js → chunk-kyvg0zcc.js} +2 -2
- package/dist/{chunk-p4ebkyd1.js → chunk-m007chff.js} +12 -12
- package/dist/{chunk-q6nvm3r5.js → chunk-m08081ys.js} +29 -29
- package/dist/{chunk-79y6s5n4.js → chunk-m77e1esy.js} +1 -1
- package/dist/{chunk-ys51gfy8.js → chunk-mcwdvkc5.js} +5 -5
- package/dist/{chunk-mh6e2xje.js → chunk-mdk5vcer.js} +11 -11
- package/dist/{chunk-mcmh43pn.js → chunk-mfmqxvy3.js} +30 -30
- package/dist/{chunk-eqn3qmfz.js → chunk-mg88phh5.js} +28 -28
- package/dist/{chunk-3tbrhape.js → chunk-mh9bbz4s.js} +2 -2
- package/dist/{chunk-84tfftm0.js → chunk-mhd4n6av.js} +1 -1
- package/dist/{chunk-h6v79pb5.js → chunk-mmc59v16.js} +336 -136
- package/dist/{chunk-s6xaezgh.js → chunk-mqqg7cf6.js} +3 -3
- package/dist/{chunk-k3yxwy95.js → chunk-mt10f1tp.js} +1 -1
- package/dist/{chunk-1fn2d8e6.js → chunk-mz2rbmwe.js} +31 -31
- package/dist/{chunk-sbafpprr.js → chunk-n4by7yk8.js} +29 -29
- package/dist/{chunk-svb53yk3.js → chunk-ndgnv15y.js} +29 -29
- package/dist/{chunk-hw4w8f8x.js → chunk-ne7y2xb5.js} +3 -3
- package/dist/{chunk-sk1z4m1n.js → chunk-nnbp6hww.js} +2 -2
- package/dist/{chunk-x3nshkcr.js → chunk-nrgyjw8e.js} +5 -5
- package/dist/{chunk-akc4jb4z.js → chunk-ns09xpt7.js} +1 -1
- package/dist/{chunk-kkq06r33.js → chunk-ns11b23b.js} +30 -30
- package/dist/{chunk-7pfwfh7h.js → chunk-nskrydpn.js} +28 -28
- package/dist/{chunk-knqbt146.js → chunk-nt5vedsr.js} +1 -1
- package/dist/{chunk-x1afcacf.js → chunk-nzrgdzqp.js} +2 -2
- package/dist/{chunk-dm2gyqck.js → chunk-p2pgnk1y.js} +28 -28
- package/dist/{chunk-xce2xjv1.js → chunk-p78dmmrg.js} +28 -28
- package/dist/{chunk-979mvrgv.js → chunk-p88crc0s.js} +4 -4
- package/dist/{chunk-763jzvy7.js → chunk-p9rdn455.js} +29 -29
- package/dist/{chunk-7k3mv7cr.js → chunk-pc4szfak.js} +5 -5
- package/dist/{chunk-347zaz9e.js → chunk-pp11ggs7.js} +1 -1
- package/dist/{chunk-ejrvwn8n.js → chunk-ptpynwv2.js} +28 -28
- package/dist/{chunk-9zyfkrwt.js → chunk-ptxwtjpj.js} +17 -1387
- package/dist/{chunk-wnff3sck.js → chunk-pzxksam8.js} +28 -28
- package/dist/{chunk-sqzmp660.js → chunk-q223vmcc.js} +1 -1
- package/dist/{chunk-ag255pqj.js → chunk-q6d7rjw1.js} +28 -28
- package/dist/{chunk-vsfqfbsh.js → chunk-q7e35wkk.js} +1 -1
- package/dist/{chunk-zx084xfr.js → chunk-qbmbmhef.js} +28 -28
- package/dist/{chunk-t6q0r0gs.js → chunk-qga7he5v.js} +2 -2
- package/dist/{chunk-tnhf35ky.js → chunk-qkwmefpm.js} +29 -29
- package/dist/{chunk-namrjc11.js → chunk-qpprdv6x.js} +2 -2
- package/dist/{chunk-89be833d.js → chunk-qqfr3g23.js} +30 -30
- package/dist/{chunk-21r0t9p5.js → chunk-qxy16bqn.js} +93 -1030
- package/dist/{chunk-90tb6xj7.js → chunk-r1gkg1zh.js} +31 -31
- package/dist/{chunk-ff5z5bf0.js → chunk-r4hf85nn.js} +3 -3
- package/dist/{chunk-pe3t1k22.js → chunk-r8cbwyz2.js} +37 -37
- package/dist/{chunk-vrbt94t8.js → chunk-rck3g0jk.js} +28 -28
- package/dist/{chunk-6e1xak8j.js → chunk-rejx7z4t.js} +1 -1
- package/dist/{chunk-zmdg1zhh.js → chunk-rfnh6gdw.js} +5 -5
- package/dist/{chunk-s5yykd80.js → chunk-rywnz223.js} +4 -4
- package/dist/{chunk-jbhhp82d.js → chunk-s0c72pgz.js} +29 -29
- package/dist/{chunk-v4bx30kd.js → chunk-s4erjnky.js} +28 -28
- package/dist/{chunk-g04kk7dj.js → chunk-s7gt9pbp.js} +29 -29
- package/dist/{chunk-57vnbap8.js → chunk-s95y1wsx.js} +3 -3
- package/dist/{chunk-dnqrmqfa.js → chunk-sfs23jb0.js} +28 -28
- package/dist/{chunk-e1hz6df1.js → chunk-sjr9vygr.js} +3 -3
- package/dist/{chunk-ed8b4mw3.js → chunk-smskbnfh.js} +4 -4
- package/dist/{chunk-6174c2qe.js → chunk-swjmy1ec.js} +4 -4
- package/dist/{chunk-3me1hah2.js → chunk-t5vfbd78.js} +28 -28
- package/dist/{chunk-0z70mbgk.js → chunk-t76a178c.js} +28 -28
- package/dist/{chunk-d7mjq8wa.js → chunk-tgav5bz9.js} +86 -85
- package/dist/chunk-tr91zear.js +1012 -0
- package/dist/{chunk-06zzah5k.js → chunk-ts2892h4.js} +6 -6
- package/dist/{chunk-61q7vfrc.js → chunk-txz05nf1.js} +1 -1
- package/dist/{chunk-1ynhxc03.js → chunk-v3kfrhgg.js} +1 -1
- package/dist/chunk-v47r6dev.js +3799 -0
- package/dist/{chunk-8wzwqd1z.js → chunk-v7vav1dg.js} +29 -29
- package/dist/{chunk-9hcw3b4h.js → chunk-v88g6btg.js} +2 -2
- package/dist/{chunk-tcgzwpm2.js → chunk-v9bnkmpp.js} +29 -29
- package/dist/{chunk-rjgn3yzv.js → chunk-vchfbqh0.js} +1 -1
- package/dist/{chunk-2zzh0pds.js → chunk-vcv8kqah.js} +31 -31
- package/dist/{chunk-mbetxrea.js → chunk-vdv5g7q5.js} +29 -29
- package/dist/{chunk-s337frnp.js → chunk-vjbm6e89.js} +8 -8
- package/dist/{chunk-dm2wnjrr.js → chunk-vjvstd86.js} +1 -1
- package/dist/{chunk-ty49mrty.js → chunk-vmb323h1.js} +115 -115
- package/dist/{chunk-p8vf12kz.js → chunk-vq51wj3f.js} +28 -28
- package/dist/{chunk-e4518h45.js → chunk-vqrph16d.js} +2 -2
- package/dist/{chunk-w43ks9ey.js → chunk-vvsc8651.js} +36 -36
- package/dist/{chunk-xfe479s0.js → chunk-w5b8wpff.js} +29 -29
- package/dist/{chunk-3synjm2x.js → chunk-w5f4g9ty.js} +1 -1
- package/dist/{chunk-2k9fbk1p.js → chunk-w64rnehj.js} +5 -5
- package/dist/{chunk-g0ab48tb.js → chunk-w74twxev.js} +5 -5
- package/dist/{chunk-1mygjwf9.js → chunk-w8hh0w92.js} +28 -28
- package/dist/{chunk-7xxqf2r6.js → chunk-wcxc5m91.js} +6 -0
- package/dist/{chunk-eqvsjpvm.js → chunk-wh42d494.js} +29 -29
- package/dist/{chunk-j6493m6s.js → chunk-wm9c1620.js} +1 -1
- package/dist/{chunk-n562n1g9.js → chunk-x0qzkte0.js} +1 -1
- package/dist/{chunk-qz32t082.js → chunk-x3p67k4j.js} +1 -1
- package/dist/{chunk-eef1npre.js → chunk-x7jtxq14.js} +1 -1
- package/dist/{chunk-q2q31ng9.js → chunk-xayw54gs.js} +5 -5
- package/dist/{chunk-tj6kayqs.js → chunk-xe4dvfz2.js} +28 -28
- package/dist/{chunk-e1hqpkj1.js → chunk-xjcmfp13.js} +31 -31
- package/dist/{chunk-kd2g8s3v.js → chunk-xmretc2b.js} +28 -28
- package/dist/{chunk-vs95kmdc.js → chunk-xqf27kff.js} +28 -28
- package/dist/{chunk-epkw6jp6.js → chunk-xsevshsa.js} +4 -4
- package/dist/{chunk-jj2c3dtz.js → chunk-y0fvv8rp.js} +3 -3
- package/dist/{chunk-n3grbsgp.js → chunk-y2x0t2gb.js} +34 -34
- package/dist/{chunk-rb67t4fq.js → chunk-y315v6st.js} +12 -12
- package/dist/{chunk-a1pm2zwv.js → chunk-y81y5v3d.js} +30 -30
- package/dist/{chunk-648z0z9m.js → chunk-yatby2yh.js} +1 -1
- package/dist/{chunk-2fn6s9rq.js → chunk-yg0h97bm.js} +28 -28
- package/dist/{chunk-3caf4y23.js → chunk-ypgs2acw.js} +5 -5
- package/dist/{chunk-nhpkz83c.js → chunk-ysdxmhpv.js} +31 -31
- package/dist/{chunk-t7a8ch9m.js → chunk-ytwnb2km.js} +28 -28
- package/dist/{chunk-8200svcn.js → chunk-z6gvvfmf.js} +2 -2
- package/dist/{chunk-5zbm7te6.js → chunk-z6q66vf8.js} +1 -1
- package/dist/{chunk-7p3kar3b.js → chunk-z9f8mvd1.js} +34 -34
- package/dist/{chunk-kmnz4ygv.js → chunk-zda436nm.js} +2 -2
- package/dist/{chunk-4mtfrpdt.js → chunk-zddcrj90.js} +28 -28
- package/dist/{chunk-c209ascy.js → chunk-zh7z8zmq.js} +3 -3
- package/dist/{chunk-veeeke8r.js → chunk-zhq7vk2g.js} +5 -5
- package/dist/{chunk-42f9j6bp.js → chunk-zjhz0qyc.js} +30 -30
- package/dist/{chunk-4451b82w.js → chunk-zkv7atzf.js} +39 -39
- package/dist/{chunk-rzgj07hb.js → chunk-zrrd9egx.js} +29 -29
- package/dist/{chunk-9r28w6ye.js → chunk-zttmdag3.js} +1 -1
- package/dist/cli-node.js +0 -32
- package/dist/cli.js +14 -8
- package/package.json +19 -11
|
@@ -4,17 +4,12 @@ import {
|
|
|
4
4
|
} from "./chunk-nt837qt9.js";
|
|
5
5
|
import {
|
|
6
6
|
notifySessionStateChanged
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
init_slashCommandParsing,
|
|
10
|
-
parseSlashCommand
|
|
11
|
-
} from "./chunk-rn0v1hk8.js";
|
|
7
|
+
} from "./chunk-z6q66vf8.js";
|
|
12
8
|
import {
|
|
13
9
|
AccountInfoSchema,
|
|
14
10
|
AgentDefinitionSchema,
|
|
15
11
|
AgentInfoSchema,
|
|
16
12
|
DEFAULT_CRON_JITTER_CONFIG,
|
|
17
|
-
DEFAULT_OUTPUT_STYLE_NAME,
|
|
18
13
|
FastModeStateSchema,
|
|
19
14
|
HookEventSchema,
|
|
20
15
|
HookInputSchema,
|
|
@@ -28,124 +23,57 @@ import {
|
|
|
28
23
|
SDKStreamlinedTextMessageSchema,
|
|
29
24
|
SDKStreamlinedToolUseSummaryMessageSchema,
|
|
30
25
|
SDKUserMessageSchema,
|
|
31
|
-
Select,
|
|
32
26
|
SlashCommandSchema,
|
|
33
|
-
Spinner,
|
|
34
27
|
Stream,
|
|
35
28
|
addMarketplaceSource,
|
|
36
29
|
applyPermissionUpdates,
|
|
37
|
-
createAttachmentMessage,
|
|
38
|
-
createCommandInputMessage,
|
|
39
|
-
createImageMetadataText,
|
|
40
|
-
createSystemMessage,
|
|
41
|
-
createUserMessage,
|
|
42
30
|
cronToHuman,
|
|
43
31
|
detectImageFormatFromBase64,
|
|
44
32
|
executePermissionRequestHooks,
|
|
45
|
-
executeUserPromptSubmitHooks,
|
|
46
|
-
extractTag,
|
|
47
|
-
fileHistoryCanRestore,
|
|
48
|
-
fileHistoryEnabled,
|
|
49
|
-
fileHistoryGetDiffStats,
|
|
50
|
-
findCommand,
|
|
51
33
|
findMissedTasks,
|
|
52
|
-
getAttachmentMessages,
|
|
53
|
-
getCommandName,
|
|
54
|
-
getContentText,
|
|
55
34
|
getCronFilePath,
|
|
56
35
|
getDeclaredMarketplaces,
|
|
57
|
-
getUserPromptSubmitHookBlockingMessage,
|
|
58
36
|
hasCronTasksSync,
|
|
59
37
|
hasPermissionsToUseTool,
|
|
60
38
|
hookJSONOutputSchema,
|
|
61
|
-
init_AppState,
|
|
62
39
|
init_PermissionUpdate,
|
|
63
40
|
init_PermissionUpdateSchema,
|
|
64
|
-
init_Spinner,
|
|
65
|
-
init_attachments,
|
|
66
41
|
init_commandLifecycle,
|
|
67
|
-
init_commands1 as init_commands,
|
|
68
42
|
init_coreSchemas,
|
|
69
43
|
init_cron,
|
|
70
44
|
init_cronTasks,
|
|
71
|
-
init_fileHistory,
|
|
72
|
-
init_generators,
|
|
73
45
|
init_hooks,
|
|
74
46
|
init_hooks1 as init_hooks2,
|
|
75
47
|
init_imageResizer,
|
|
76
|
-
init_imageStore,
|
|
77
48
|
init_marketplaceManager,
|
|
78
|
-
init_messages1 as init_messages,
|
|
79
|
-
init_outputStyles,
|
|
80
49
|
init_permissions,
|
|
81
|
-
init_queryProfiler,
|
|
82
|
-
init_select,
|
|
83
50
|
init_stream,
|
|
84
|
-
init_textInputTypes,
|
|
85
|
-
init_useTerminalSize,
|
|
86
|
-
isBridgeSafeCommand,
|
|
87
|
-
isEmptyMessageText,
|
|
88
|
-
isSyntheticMessage,
|
|
89
|
-
isToolUseResultMessage,
|
|
90
|
-
isValidImagePaste,
|
|
91
51
|
jitteredNextCronRunMs,
|
|
92
52
|
loadKnownMarketplacesConfig,
|
|
93
53
|
markCronTasksFired,
|
|
94
|
-
maybeResizeAndDownsampleImageBlock,
|
|
95
54
|
notifyCommandLifecycle,
|
|
96
55
|
oneShotJitteredNextCronRunMs,
|
|
97
56
|
permissionUpdateSchema,
|
|
98
57
|
persistPermissionUpdates,
|
|
99
|
-
queryCheckpoint,
|
|
100
58
|
readCronTasks,
|
|
101
|
-
removeCronTasks
|
|
102
|
-
|
|
103
|
-
toArray,
|
|
104
|
-
useAppState
|
|
105
|
-
} from "./chunk-h6v79pb5.js";
|
|
106
|
-
import {
|
|
107
|
-
init_useExitOnCtrlCDWithKeybindings,
|
|
108
|
-
useExitOnCtrlCDWithKeybindings
|
|
109
|
-
} from "./chunk-3h4pyb94.js";
|
|
110
|
-
import {
|
|
111
|
-
init_useKeybinding
|
|
112
|
-
} from "./chunk-t0twk3e5.js";
|
|
113
|
-
import {
|
|
114
|
-
init_events,
|
|
115
|
-
init_sessionTracing,
|
|
116
|
-
logOTelEvent,
|
|
117
|
-
redactIfDisabled,
|
|
118
|
-
startInteractionSpan
|
|
119
|
-
} from "./chunk-84tfftm0.js";
|
|
59
|
+
removeCronTasks
|
|
60
|
+
} from "./chunk-mmc59v16.js";
|
|
120
61
|
import {
|
|
121
|
-
AGENT_TOOL_NAME,
|
|
122
|
-
LEGACY_AGENT_TOOL_NAME,
|
|
123
|
-
getAnthropicApiKeyWithSource,
|
|
124
|
-
getFastModeState,
|
|
125
62
|
getFeatureValue_CACHED_WITH_REFRESH,
|
|
126
|
-
getSettings_DEPRECATED,
|
|
127
|
-
init_auth,
|
|
128
|
-
init_constants1 as init_constants,
|
|
129
|
-
init_fastMode,
|
|
130
63
|
init_file,
|
|
131
64
|
init_genericProcessUtils,
|
|
132
65
|
init_growthbook,
|
|
133
66
|
init_isEqual,
|
|
134
67
|
init_schemas,
|
|
135
|
-
init_settings1 as init_settings,
|
|
136
68
|
isEqual_default,
|
|
137
69
|
isLocalMarketplaceSource,
|
|
138
70
|
isProcessRunning,
|
|
139
71
|
pathExists
|
|
140
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-4581z0wr.js";
|
|
141
73
|
import {
|
|
142
74
|
init_json,
|
|
143
75
|
safeParseJSON
|
|
144
76
|
} from "./chunk-hnx0eg6x.js";
|
|
145
|
-
import {
|
|
146
|
-
count,
|
|
147
|
-
init_array
|
|
148
|
-
} from "./chunk-zwarn9h7.js";
|
|
149
77
|
import {
|
|
150
78
|
init_lazySchema,
|
|
151
79
|
lazySchema
|
|
@@ -157,26 +85,6 @@ import {
|
|
|
157
85
|
import {
|
|
158
86
|
exports_external
|
|
159
87
|
} from "./chunk-d7886r6a.js";
|
|
160
|
-
import {
|
|
161
|
-
formatRelativeTimeAgo,
|
|
162
|
-
init_format,
|
|
163
|
-
truncate
|
|
164
|
-
} from "./chunk-prgsmrmy.js";
|
|
165
|
-
import {
|
|
166
|
-
Divider,
|
|
167
|
-
ThemedBox_default,
|
|
168
|
-
ThemedText,
|
|
169
|
-
init_src,
|
|
170
|
-
useKeybinding,
|
|
171
|
-
useKeybindings,
|
|
172
|
-
useTerminalSize
|
|
173
|
-
} from "./chunk-e4jqbn4d.js";
|
|
174
|
-
import {
|
|
175
|
-
require_jsx_dev_runtime
|
|
176
|
-
} from "./chunk-vxnvzfnv.js";
|
|
177
|
-
import {
|
|
178
|
-
require_react
|
|
179
|
-
} from "./chunk-ns3babbs.js";
|
|
180
88
|
import {
|
|
181
89
|
init_analytics,
|
|
182
90
|
logEvent
|
|
@@ -188,28 +96,9 @@ import {
|
|
|
188
96
|
logForDiagnosticsNoPII
|
|
189
97
|
} from "./chunk-pedmqmrf.js";
|
|
190
98
|
import {
|
|
191
|
-
getCwd,
|
|
192
|
-
init_cwd
|
|
193
|
-
} from "./chunk-tv74hgw9.js";
|
|
194
|
-
import {
|
|
195
|
-
BASH_STDERR_TAG,
|
|
196
|
-
BASH_STDOUT_TAG,
|
|
197
|
-
COMMAND_MESSAGE_TAG,
|
|
198
|
-
LOCAL_COMMAND_STDERR_TAG,
|
|
199
|
-
LOCAL_COMMAND_STDOUT_TAG,
|
|
200
|
-
TASK_NOTIFICATION_TAG,
|
|
201
|
-
TEAMMATE_MESSAGE_TAG,
|
|
202
|
-
TICK_TAG,
|
|
203
|
-
init_displayTags,
|
|
204
99
|
init_log,
|
|
205
|
-
|
|
206
|
-
logError,
|
|
207
|
-
stripDisplayTags
|
|
100
|
+
logError
|
|
208
101
|
} from "./chunk-d2vb6m9e.js";
|
|
209
|
-
import {
|
|
210
|
-
figures_default,
|
|
211
|
-
init_figures
|
|
212
|
-
} from "./chunk-qajrkk97.js";
|
|
213
102
|
import {
|
|
214
103
|
init_cleanupRegistry,
|
|
215
104
|
init_debug,
|
|
@@ -233,824 +122,18 @@ import {
|
|
|
233
122
|
getOriginalCwd,
|
|
234
123
|
getProjectRoot,
|
|
235
124
|
getScheduledTasksEnabled,
|
|
236
|
-
getSdkBetas,
|
|
237
125
|
getSessionCronTasks,
|
|
238
126
|
getSessionId,
|
|
239
127
|
init_state,
|
|
240
128
|
removeSessionCronTasks,
|
|
241
|
-
setPromptId,
|
|
242
129
|
setScheduledTasksEnabled
|
|
243
130
|
} from "./chunk-gzp6rza1.js";
|
|
244
131
|
import {
|
|
245
132
|
__esm,
|
|
246
133
|
__export,
|
|
247
|
-
__require
|
|
248
|
-
__toESM
|
|
134
|
+
__require
|
|
249
135
|
} from "./chunk-qp2qdcda.js";
|
|
250
136
|
|
|
251
|
-
// src/components/MessageSelector.tsx
|
|
252
|
-
var exports_MessageSelector = {};
|
|
253
|
-
__export(exports_MessageSelector, {
|
|
254
|
-
selectableUserMessagesFilter: () => selectableUserMessagesFilter,
|
|
255
|
-
messagesAfterAreOnlySynthetic: () => messagesAfterAreOnlySynthetic,
|
|
256
|
-
MessageSelector: () => MessageSelector
|
|
257
|
-
});
|
|
258
|
-
import { randomUUID } from "crypto";
|
|
259
|
-
import * as path from "path";
|
|
260
|
-
function isTextBlock(block) {
|
|
261
|
-
return block.type === "text";
|
|
262
|
-
}
|
|
263
|
-
function isSummarizeOption(option) {
|
|
264
|
-
return option === "summarize" || option === "summarize_up_to";
|
|
265
|
-
}
|
|
266
|
-
function MessageSelector({
|
|
267
|
-
messages,
|
|
268
|
-
onPreRestore,
|
|
269
|
-
onRestoreMessage,
|
|
270
|
-
onRestoreCode,
|
|
271
|
-
onSummarize,
|
|
272
|
-
onClose,
|
|
273
|
-
preselectedMessage
|
|
274
|
-
}) {
|
|
275
|
-
const fileHistory = useAppState((s) => s.fileHistory);
|
|
276
|
-
const [error, setError] = import_react.useState(undefined);
|
|
277
|
-
const isFileHistoryEnabled = fileHistoryEnabled();
|
|
278
|
-
const currentUUID = import_react.useMemo(randomUUID, []);
|
|
279
|
-
const messageOptions = import_react.useMemo(() => [
|
|
280
|
-
...messages.filter(selectableUserMessagesFilter),
|
|
281
|
-
{
|
|
282
|
-
...createUserMessage({
|
|
283
|
-
content: ""
|
|
284
|
-
}),
|
|
285
|
-
uuid: currentUUID
|
|
286
|
-
}
|
|
287
|
-
], [messages, currentUUID]);
|
|
288
|
-
const [selectedIndex, setSelectedIndex] = import_react.useState(messageOptions.length - 1);
|
|
289
|
-
const firstVisibleIndex = Math.max(0, Math.min(selectedIndex - Math.floor(MAX_VISIBLE_MESSAGES / 2), messageOptions.length - MAX_VISIBLE_MESSAGES));
|
|
290
|
-
const hasMessagesToSelect = messageOptions.length > 1;
|
|
291
|
-
const [messageToRestore, setMessageToRestore] = import_react.useState(preselectedMessage);
|
|
292
|
-
const [diffStatsForRestore, setDiffStatsForRestore] = import_react.useState(undefined);
|
|
293
|
-
import_react.useEffect(() => {
|
|
294
|
-
if (!preselectedMessage || !isFileHistoryEnabled)
|
|
295
|
-
return;
|
|
296
|
-
let cancelled = false;
|
|
297
|
-
fileHistoryGetDiffStats(fileHistory, preselectedMessage.uuid).then((stats) => {
|
|
298
|
-
if (!cancelled)
|
|
299
|
-
setDiffStatsForRestore(stats);
|
|
300
|
-
});
|
|
301
|
-
return () => {
|
|
302
|
-
cancelled = true;
|
|
303
|
-
};
|
|
304
|
-
}, [preselectedMessage, isFileHistoryEnabled, fileHistory]);
|
|
305
|
-
const [isRestoring, setIsRestoring] = import_react.useState(false);
|
|
306
|
-
const [restoringOption, setRestoringOption] = import_react.useState(null);
|
|
307
|
-
const [selectedRestoreOption, setSelectedRestoreOption] = import_react.useState("both");
|
|
308
|
-
const [summarizeFromFeedback, setSummarizeFromFeedback] = import_react.useState("");
|
|
309
|
-
const [summarizeUpToFeedback, setSummarizeUpToFeedback] = import_react.useState("");
|
|
310
|
-
function getRestoreOptions(canRestoreCode2) {
|
|
311
|
-
const baseOptions = canRestoreCode2 ? [
|
|
312
|
-
{ value: "both", label: "Restore code and conversation" },
|
|
313
|
-
{ value: "conversation", label: "Restore conversation" },
|
|
314
|
-
{ value: "code", label: "Restore code" }
|
|
315
|
-
] : [{ value: "conversation", label: "Restore conversation" }];
|
|
316
|
-
const summarizeInputProps = {
|
|
317
|
-
type: "input",
|
|
318
|
-
placeholder: "add context (optional)",
|
|
319
|
-
initialValue: "",
|
|
320
|
-
allowEmptySubmitToCancel: true,
|
|
321
|
-
showLabelWithValue: true,
|
|
322
|
-
labelValueSeparator: ": "
|
|
323
|
-
};
|
|
324
|
-
baseOptions.push({
|
|
325
|
-
value: "summarize",
|
|
326
|
-
label: "Summarize from here",
|
|
327
|
-
...summarizeInputProps,
|
|
328
|
-
onChange: setSummarizeFromFeedback
|
|
329
|
-
});
|
|
330
|
-
if (process.env.USER_TYPE === "ant") {
|
|
331
|
-
baseOptions.push({
|
|
332
|
-
value: "summarize_up_to",
|
|
333
|
-
label: "Summarize up to here",
|
|
334
|
-
...summarizeInputProps,
|
|
335
|
-
onChange: setSummarizeUpToFeedback
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
baseOptions.push({ value: "nevermind", label: "Never mind" });
|
|
339
|
-
return baseOptions;
|
|
340
|
-
}
|
|
341
|
-
import_react.useEffect(() => {
|
|
342
|
-
logEvent("tengu_message_selector_opened", {});
|
|
343
|
-
}, []);
|
|
344
|
-
async function restoreConversationDirectly(message) {
|
|
345
|
-
onPreRestore();
|
|
346
|
-
setIsRestoring(true);
|
|
347
|
-
try {
|
|
348
|
-
await onRestoreMessage(message);
|
|
349
|
-
setIsRestoring(false);
|
|
350
|
-
onClose();
|
|
351
|
-
} catch (error2) {
|
|
352
|
-
logError(error2);
|
|
353
|
-
setIsRestoring(false);
|
|
354
|
-
setError(`Failed to restore the conversation:
|
|
355
|
-
${error2}`);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
async function handleSelect(message) {
|
|
359
|
-
const index = messages.indexOf(message);
|
|
360
|
-
const indexFromEnd = messages.length - 1 - index;
|
|
361
|
-
logEvent("tengu_message_selector_selected", {
|
|
362
|
-
index_from_end: indexFromEnd,
|
|
363
|
-
message_type: message.type,
|
|
364
|
-
is_current_prompt: false
|
|
365
|
-
});
|
|
366
|
-
if (!messages.includes(message)) {
|
|
367
|
-
onClose();
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
if (!isFileHistoryEnabled) {
|
|
371
|
-
await restoreConversationDirectly(message);
|
|
372
|
-
return;
|
|
373
|
-
}
|
|
374
|
-
const diffStats = await fileHistoryGetDiffStats(fileHistory, message.uuid);
|
|
375
|
-
setMessageToRestore(message);
|
|
376
|
-
setDiffStatsForRestore(diffStats);
|
|
377
|
-
}
|
|
378
|
-
async function onSelectRestoreOption(option) {
|
|
379
|
-
logEvent("tengu_message_selector_restore_option_selected", {
|
|
380
|
-
option
|
|
381
|
-
});
|
|
382
|
-
if (!messageToRestore) {
|
|
383
|
-
setError("Message not found.");
|
|
384
|
-
return;
|
|
385
|
-
}
|
|
386
|
-
if (option === "nevermind") {
|
|
387
|
-
if (preselectedMessage)
|
|
388
|
-
onClose();
|
|
389
|
-
else
|
|
390
|
-
setMessageToRestore(undefined);
|
|
391
|
-
return;
|
|
392
|
-
}
|
|
393
|
-
if (isSummarizeOption(option)) {
|
|
394
|
-
onPreRestore();
|
|
395
|
-
setIsRestoring(true);
|
|
396
|
-
setRestoringOption(option);
|
|
397
|
-
setError(undefined);
|
|
398
|
-
try {
|
|
399
|
-
const direction = option === "summarize_up_to" ? "up_to" : "from";
|
|
400
|
-
const feedback = (direction === "up_to" ? summarizeUpToFeedback : summarizeFromFeedback).trim() || undefined;
|
|
401
|
-
await onSummarize(messageToRestore, feedback, direction);
|
|
402
|
-
setIsRestoring(false);
|
|
403
|
-
setRestoringOption(null);
|
|
404
|
-
setMessageToRestore(undefined);
|
|
405
|
-
onClose();
|
|
406
|
-
} catch (error2) {
|
|
407
|
-
logError(error2);
|
|
408
|
-
setIsRestoring(false);
|
|
409
|
-
setRestoringOption(null);
|
|
410
|
-
setMessageToRestore(undefined);
|
|
411
|
-
setError(`Failed to summarize:
|
|
412
|
-
${error2}`);
|
|
413
|
-
}
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
onPreRestore();
|
|
417
|
-
setIsRestoring(true);
|
|
418
|
-
setError(undefined);
|
|
419
|
-
let codeError = null;
|
|
420
|
-
let conversationError = null;
|
|
421
|
-
if (option === "code" || option === "both") {
|
|
422
|
-
try {
|
|
423
|
-
await onRestoreCode(messageToRestore);
|
|
424
|
-
} catch (error2) {
|
|
425
|
-
codeError = error2;
|
|
426
|
-
logError(codeError);
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
if (option === "conversation" || option === "both") {
|
|
430
|
-
try {
|
|
431
|
-
await onRestoreMessage(messageToRestore);
|
|
432
|
-
} catch (error2) {
|
|
433
|
-
conversationError = error2;
|
|
434
|
-
logError(conversationError);
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
setIsRestoring(false);
|
|
438
|
-
setMessageToRestore(undefined);
|
|
439
|
-
if (conversationError && codeError) {
|
|
440
|
-
setError(`Failed to restore the conversation and code:
|
|
441
|
-
${conversationError}
|
|
442
|
-
${codeError}`);
|
|
443
|
-
} else if (conversationError) {
|
|
444
|
-
setError(`Failed to restore the conversation:
|
|
445
|
-
${conversationError}`);
|
|
446
|
-
} else if (codeError) {
|
|
447
|
-
setError(`Failed to restore the code:
|
|
448
|
-
${codeError}`);
|
|
449
|
-
} else {
|
|
450
|
-
onClose();
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
const exitState = useExitOnCtrlCDWithKeybindings();
|
|
454
|
-
const handleEscape = import_react.useCallback(() => {
|
|
455
|
-
if (messageToRestore && !preselectedMessage) {
|
|
456
|
-
setMessageToRestore(undefined);
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
|
-
logEvent("tengu_message_selector_cancelled", {});
|
|
460
|
-
onClose();
|
|
461
|
-
}, [onClose, messageToRestore, preselectedMessage]);
|
|
462
|
-
const moveUp = import_react.useCallback(() => setSelectedIndex((prev) => Math.max(0, prev - 1)), []);
|
|
463
|
-
const moveDown = import_react.useCallback(() => setSelectedIndex((prev) => Math.min(messageOptions.length - 1, prev + 1)), [messageOptions.length]);
|
|
464
|
-
const jumpToTop = import_react.useCallback(() => setSelectedIndex(0), []);
|
|
465
|
-
const jumpToBottom = import_react.useCallback(() => setSelectedIndex(messageOptions.length - 1), [messageOptions.length]);
|
|
466
|
-
const handleSelectCurrent = import_react.useCallback(() => {
|
|
467
|
-
const selected = messageOptions[selectedIndex];
|
|
468
|
-
if (selected) {
|
|
469
|
-
handleSelect(selected);
|
|
470
|
-
}
|
|
471
|
-
}, [messageOptions, selectedIndex, handleSelect]);
|
|
472
|
-
useKeybinding("confirm:no", handleEscape, {
|
|
473
|
-
context: "Confirmation",
|
|
474
|
-
isActive: !messageToRestore
|
|
475
|
-
});
|
|
476
|
-
useKeybindings({
|
|
477
|
-
"messageSelector:up": moveUp,
|
|
478
|
-
"messageSelector:down": moveDown,
|
|
479
|
-
"messageSelector:top": jumpToTop,
|
|
480
|
-
"messageSelector:bottom": jumpToBottom,
|
|
481
|
-
"messageSelector:select": handleSelectCurrent
|
|
482
|
-
}, {
|
|
483
|
-
context: "MessageSelector",
|
|
484
|
-
isActive: !isRestoring && !error && !messageToRestore && hasMessagesToSelect
|
|
485
|
-
});
|
|
486
|
-
const [fileHistoryMetadata, setFileHistoryMetadata] = import_react.useState({});
|
|
487
|
-
import_react.useEffect(() => {
|
|
488
|
-
async function loadFileHistoryMetadata() {
|
|
489
|
-
if (!isFileHistoryEnabled) {
|
|
490
|
-
return;
|
|
491
|
-
}
|
|
492
|
-
Promise.all(messageOptions.map(async (userMessage, itemIndex) => {
|
|
493
|
-
if (userMessage.uuid !== currentUUID) {
|
|
494
|
-
const canRestore = fileHistoryCanRestore(fileHistory, userMessage.uuid);
|
|
495
|
-
const nextUserMessage = messageOptions.at(itemIndex + 1);
|
|
496
|
-
const diffStats = canRestore ? computeDiffStatsBetweenMessages(messages, userMessage.uuid, nextUserMessage?.uuid !== currentUUID ? nextUserMessage?.uuid : undefined) : undefined;
|
|
497
|
-
if (diffStats !== undefined) {
|
|
498
|
-
setFileHistoryMetadata((prev) => ({
|
|
499
|
-
...prev,
|
|
500
|
-
[itemIndex]: diffStats
|
|
501
|
-
}));
|
|
502
|
-
} else {
|
|
503
|
-
setFileHistoryMetadata((prev) => ({
|
|
504
|
-
...prev,
|
|
505
|
-
[itemIndex]: undefined
|
|
506
|
-
}));
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
}));
|
|
510
|
-
}
|
|
511
|
-
loadFileHistoryMetadata();
|
|
512
|
-
}, [messageOptions, messages, currentUUID, fileHistory, isFileHistoryEnabled]);
|
|
513
|
-
const canRestoreCode = isFileHistoryEnabled && diffStatsForRestore?.filesChanged && diffStatsForRestore.filesChanged.length > 0;
|
|
514
|
-
const showPickList = !error && !messageToRestore && !preselectedMessage && hasMessagesToSelect;
|
|
515
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
516
|
-
flexDirection: "column",
|
|
517
|
-
width: "100%",
|
|
518
|
-
children: [
|
|
519
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(Divider, {
|
|
520
|
-
color: "suggestion"
|
|
521
|
-
}, undefined, false, undefined, this),
|
|
522
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
523
|
-
flexDirection: "column",
|
|
524
|
-
marginX: 1,
|
|
525
|
-
gap: 1,
|
|
526
|
-
children: [
|
|
527
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
528
|
-
bold: true,
|
|
529
|
-
color: "suggestion",
|
|
530
|
-
children: "Rewind"
|
|
531
|
-
}, undefined, false, undefined, this),
|
|
532
|
-
error && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
533
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
534
|
-
color: "error",
|
|
535
|
-
children: [
|
|
536
|
-
"Error: ",
|
|
537
|
-
error
|
|
538
|
-
]
|
|
539
|
-
}, undefined, true, undefined, this)
|
|
540
|
-
}, undefined, false, undefined, this),
|
|
541
|
-
!hasMessagesToSelect && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
542
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
543
|
-
children: "Nothing to rewind to yet."
|
|
544
|
-
}, undefined, false, undefined, this)
|
|
545
|
-
}, undefined, false, undefined, this),
|
|
546
|
-
!error && messageToRestore && hasMessagesToSelect && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
547
|
-
children: [
|
|
548
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
549
|
-
children: [
|
|
550
|
-
"Confirm you want to restore",
|
|
551
|
-
" ",
|
|
552
|
-
!diffStatsForRestore && "the conversation ",
|
|
553
|
-
"to the point before you sent this message:"
|
|
554
|
-
]
|
|
555
|
-
}, undefined, true, undefined, this),
|
|
556
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
557
|
-
flexDirection: "column",
|
|
558
|
-
paddingLeft: 1,
|
|
559
|
-
borderStyle: "single",
|
|
560
|
-
borderRight: false,
|
|
561
|
-
borderTop: false,
|
|
562
|
-
borderBottom: false,
|
|
563
|
-
borderLeft: true,
|
|
564
|
-
borderLeftDimColor: true,
|
|
565
|
-
children: [
|
|
566
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(UserMessageOption, {
|
|
567
|
-
userMessage: messageToRestore,
|
|
568
|
-
color: "text",
|
|
569
|
-
isCurrent: false
|
|
570
|
-
}, undefined, false, undefined, this),
|
|
571
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
572
|
-
dimColor: true,
|
|
573
|
-
children: [
|
|
574
|
-
"(",
|
|
575
|
-
formatRelativeTimeAgo(new Date(messageToRestore.timestamp)),
|
|
576
|
-
")"
|
|
577
|
-
]
|
|
578
|
-
}, undefined, true, undefined, this)
|
|
579
|
-
]
|
|
580
|
-
}, undefined, true, undefined, this),
|
|
581
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(RestoreOptionDescription, {
|
|
582
|
-
selectedRestoreOption,
|
|
583
|
-
canRestoreCode: !!canRestoreCode,
|
|
584
|
-
diffStatsForRestore
|
|
585
|
-
}, undefined, false, undefined, this),
|
|
586
|
-
isRestoring && isSummarizeOption(restoringOption) ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
587
|
-
flexDirection: "row",
|
|
588
|
-
gap: 1,
|
|
589
|
-
children: [
|
|
590
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(Spinner, {}, undefined, false, undefined, this),
|
|
591
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
592
|
-
children: "Summarizing\u2026"
|
|
593
|
-
}, undefined, false, undefined, this)
|
|
594
|
-
]
|
|
595
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Select, {
|
|
596
|
-
isDisabled: isRestoring,
|
|
597
|
-
options: getRestoreOptions(!!canRestoreCode),
|
|
598
|
-
defaultFocusValue: canRestoreCode ? "both" : "conversation",
|
|
599
|
-
onFocus: (value) => setSelectedRestoreOption(value),
|
|
600
|
-
onChange: (value) => onSelectRestoreOption(value),
|
|
601
|
-
onCancel: () => preselectedMessage ? onClose() : setMessageToRestore(undefined)
|
|
602
|
-
}, undefined, false, undefined, this),
|
|
603
|
-
canRestoreCode && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
604
|
-
marginBottom: 1,
|
|
605
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
606
|
-
dimColor: true,
|
|
607
|
-
children: [
|
|
608
|
-
figures_default.warning,
|
|
609
|
-
" Rewinding does not affect files edited manually or via bash."
|
|
610
|
-
]
|
|
611
|
-
}, undefined, true, undefined, this)
|
|
612
|
-
}, undefined, false, undefined, this)
|
|
613
|
-
]
|
|
614
|
-
}, undefined, true, undefined, this),
|
|
615
|
-
showPickList && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
616
|
-
children: [
|
|
617
|
-
isFileHistoryEnabled ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
618
|
-
children: "Restore the code and/or conversation to the point before\u2026"
|
|
619
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
620
|
-
children: "Restore and fork the conversation to the point before\u2026"
|
|
621
|
-
}, undefined, false, undefined, this),
|
|
622
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
623
|
-
width: "100%",
|
|
624
|
-
flexDirection: "column",
|
|
625
|
-
children: messageOptions.slice(firstVisibleIndex, firstVisibleIndex + MAX_VISIBLE_MESSAGES).map((msg, visibleOptionIndex) => {
|
|
626
|
-
const optionIndex = firstVisibleIndex + visibleOptionIndex;
|
|
627
|
-
const isSelected = optionIndex === selectedIndex;
|
|
628
|
-
const isCurrent = msg.uuid === currentUUID;
|
|
629
|
-
const metadataLoaded = optionIndex in fileHistoryMetadata;
|
|
630
|
-
const metadata = fileHistoryMetadata[optionIndex];
|
|
631
|
-
const numFilesChanged = metadata?.filesChanged && metadata.filesChanged.length;
|
|
632
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
633
|
-
height: isFileHistoryEnabled ? 3 : 2,
|
|
634
|
-
overflow: "hidden",
|
|
635
|
-
width: "100%",
|
|
636
|
-
flexDirection: "row",
|
|
637
|
-
children: [
|
|
638
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
639
|
-
width: 2,
|
|
640
|
-
minWidth: 2,
|
|
641
|
-
children: isSelected ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
642
|
-
color: "permission",
|
|
643
|
-
bold: true,
|
|
644
|
-
children: [
|
|
645
|
-
figures_default.pointer,
|
|
646
|
-
" "
|
|
647
|
-
]
|
|
648
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
649
|
-
children: " "
|
|
650
|
-
}, undefined, false, undefined, this)
|
|
651
|
-
}, undefined, false, undefined, this),
|
|
652
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
653
|
-
flexDirection: "column",
|
|
654
|
-
children: [
|
|
655
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
656
|
-
flexShrink: 1,
|
|
657
|
-
height: 1,
|
|
658
|
-
overflow: "hidden",
|
|
659
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(UserMessageOption, {
|
|
660
|
-
userMessage: msg,
|
|
661
|
-
color: isSelected ? "suggestion" : undefined,
|
|
662
|
-
isCurrent,
|
|
663
|
-
paddingRight: 10
|
|
664
|
-
}, undefined, false, undefined, this)
|
|
665
|
-
}, undefined, false, undefined, this),
|
|
666
|
-
isFileHistoryEnabled && metadataLoaded && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
667
|
-
height: 1,
|
|
668
|
-
flexDirection: "row",
|
|
669
|
-
children: metadata ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
670
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
671
|
-
dimColor: !isSelected,
|
|
672
|
-
color: "inactive",
|
|
673
|
-
children: numFilesChanged ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
674
|
-
children: [
|
|
675
|
-
numFilesChanged === 1 && metadata.filesChanged[0] ? `${path.basename(metadata.filesChanged[0])} ` : `${numFilesChanged} files changed `,
|
|
676
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(DiffStatsText, {
|
|
677
|
-
diffStats: metadata
|
|
678
|
-
}, undefined, false, undefined, this)
|
|
679
|
-
]
|
|
680
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
681
|
-
children: "No code changes"
|
|
682
|
-
}, undefined, false, undefined, this)
|
|
683
|
-
}, undefined, false, undefined, this)
|
|
684
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
685
|
-
dimColor: true,
|
|
686
|
-
color: "warning",
|
|
687
|
-
children: [
|
|
688
|
-
figures_default.warning,
|
|
689
|
-
" No code restore"
|
|
690
|
-
]
|
|
691
|
-
}, undefined, true, undefined, this)
|
|
692
|
-
}, undefined, false, undefined, this)
|
|
693
|
-
]
|
|
694
|
-
}, undefined, true, undefined, this)
|
|
695
|
-
]
|
|
696
|
-
}, msg.uuid, true, undefined, this);
|
|
697
|
-
})
|
|
698
|
-
}, undefined, false, undefined, this)
|
|
699
|
-
]
|
|
700
|
-
}, undefined, true, undefined, this),
|
|
701
|
-
!messageToRestore && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
702
|
-
dimColor: true,
|
|
703
|
-
italic: true,
|
|
704
|
-
children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
705
|
-
children: [
|
|
706
|
-
"Press ",
|
|
707
|
-
exitState.keyName,
|
|
708
|
-
" again to exit"
|
|
709
|
-
]
|
|
710
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
711
|
-
children: [
|
|
712
|
-
!error && hasMessagesToSelect && "Enter to continue \xB7 ",
|
|
713
|
-
"Esc to exit"
|
|
714
|
-
]
|
|
715
|
-
}, undefined, true, undefined, this)
|
|
716
|
-
}, undefined, false, undefined, this)
|
|
717
|
-
]
|
|
718
|
-
}, undefined, true, undefined, this)
|
|
719
|
-
]
|
|
720
|
-
}, undefined, true, undefined, this);
|
|
721
|
-
}
|
|
722
|
-
function getRestoreOptionConversationText(option) {
|
|
723
|
-
switch (option) {
|
|
724
|
-
case "summarize":
|
|
725
|
-
return "Messages after this point will be summarized.";
|
|
726
|
-
case "summarize_up_to":
|
|
727
|
-
return "Preceding messages will be summarized. This and subsequent messages will remain unchanged \u2014 you will stay at the end of the conversation.";
|
|
728
|
-
case "both":
|
|
729
|
-
case "conversation":
|
|
730
|
-
return "The conversation will be forked.";
|
|
731
|
-
case "code":
|
|
732
|
-
case "nevermind":
|
|
733
|
-
return "The conversation will be unchanged.";
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
function RestoreOptionDescription({
|
|
737
|
-
selectedRestoreOption,
|
|
738
|
-
canRestoreCode,
|
|
739
|
-
diffStatsForRestore
|
|
740
|
-
}) {
|
|
741
|
-
const showCodeRestore = canRestoreCode && (selectedRestoreOption === "both" || selectedRestoreOption === "code");
|
|
742
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
743
|
-
flexDirection: "column",
|
|
744
|
-
children: [
|
|
745
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
746
|
-
dimColor: true,
|
|
747
|
-
children: getRestoreOptionConversationText(selectedRestoreOption)
|
|
748
|
-
}, undefined, false, undefined, this),
|
|
749
|
-
!isSummarizeOption(selectedRestoreOption) && (showCodeRestore ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(RestoreCodeConfirmation, {
|
|
750
|
-
diffStatsForRestore
|
|
751
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
752
|
-
dimColor: true,
|
|
753
|
-
children: "The code will be unchanged."
|
|
754
|
-
}, undefined, false, undefined, this))
|
|
755
|
-
]
|
|
756
|
-
}, undefined, true, undefined, this);
|
|
757
|
-
}
|
|
758
|
-
function RestoreCodeConfirmation({
|
|
759
|
-
diffStatsForRestore
|
|
760
|
-
}) {
|
|
761
|
-
if (diffStatsForRestore === undefined) {
|
|
762
|
-
return;
|
|
763
|
-
}
|
|
764
|
-
if (!diffStatsForRestore.filesChanged || !diffStatsForRestore.filesChanged[0]) {
|
|
765
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
766
|
-
dimColor: true,
|
|
767
|
-
children: "The code has not changed (nothing will be restored)."
|
|
768
|
-
}, undefined, false, undefined, this);
|
|
769
|
-
}
|
|
770
|
-
const numFilesChanged = diffStatsForRestore.filesChanged.length;
|
|
771
|
-
let fileLabel = "";
|
|
772
|
-
if (numFilesChanged === 1) {
|
|
773
|
-
fileLabel = path.basename(diffStatsForRestore.filesChanged[0] || "");
|
|
774
|
-
} else if (numFilesChanged === 2) {
|
|
775
|
-
const file1 = path.basename(diffStatsForRestore.filesChanged[0] || "");
|
|
776
|
-
const file2 = path.basename(diffStatsForRestore.filesChanged[1] || "");
|
|
777
|
-
fileLabel = `${file1} and ${file2}`;
|
|
778
|
-
} else {
|
|
779
|
-
const file1 = path.basename(diffStatsForRestore.filesChanged[0] || "");
|
|
780
|
-
fileLabel = `${file1} and ${diffStatsForRestore.filesChanged.length - 1} other files`;
|
|
781
|
-
}
|
|
782
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
783
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
784
|
-
dimColor: true,
|
|
785
|
-
children: [
|
|
786
|
-
"The code will be restored",
|
|
787
|
-
" ",
|
|
788
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(DiffStatsText, {
|
|
789
|
-
diffStats: diffStatsForRestore
|
|
790
|
-
}, undefined, false, undefined, this),
|
|
791
|
-
" in ",
|
|
792
|
-
fileLabel,
|
|
793
|
-
"."
|
|
794
|
-
]
|
|
795
|
-
}, undefined, true, undefined, this)
|
|
796
|
-
}, undefined, false, undefined, this);
|
|
797
|
-
}
|
|
798
|
-
function DiffStatsText({
|
|
799
|
-
diffStats
|
|
800
|
-
}) {
|
|
801
|
-
if (!diffStats || !diffStats.filesChanged) {
|
|
802
|
-
return;
|
|
803
|
-
}
|
|
804
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
805
|
-
children: [
|
|
806
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
807
|
-
color: "diffAddedWord",
|
|
808
|
-
children: [
|
|
809
|
-
"+",
|
|
810
|
-
diffStats.insertions,
|
|
811
|
-
" "
|
|
812
|
-
]
|
|
813
|
-
}, undefined, true, undefined, this),
|
|
814
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
815
|
-
color: "diffRemovedWord",
|
|
816
|
-
children: [
|
|
817
|
-
"-",
|
|
818
|
-
diffStats.deletions
|
|
819
|
-
]
|
|
820
|
-
}, undefined, true, undefined, this)
|
|
821
|
-
]
|
|
822
|
-
}, undefined, true, undefined, this);
|
|
823
|
-
}
|
|
824
|
-
function UserMessageOption({
|
|
825
|
-
userMessage,
|
|
826
|
-
color,
|
|
827
|
-
dimColor,
|
|
828
|
-
isCurrent,
|
|
829
|
-
paddingRight
|
|
830
|
-
}) {
|
|
831
|
-
const { columns } = useTerminalSize();
|
|
832
|
-
if (isCurrent) {
|
|
833
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
834
|
-
width: "100%",
|
|
835
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
836
|
-
italic: true,
|
|
837
|
-
color,
|
|
838
|
-
dimColor,
|
|
839
|
-
children: "(current)"
|
|
840
|
-
}, undefined, false, undefined, this)
|
|
841
|
-
}, undefined, false, undefined, this);
|
|
842
|
-
}
|
|
843
|
-
const content = userMessage.message.content;
|
|
844
|
-
const lastBlock = typeof content === "string" ? null : content[content.length - 1];
|
|
845
|
-
const rawMessageText = typeof content === "string" ? content.trim() : lastBlock && isTextBlock(lastBlock) ? lastBlock.text.trim() : "(no prompt)";
|
|
846
|
-
const messageText = stripDisplayTags(rawMessageText);
|
|
847
|
-
if (isEmptyMessageText(messageText)) {
|
|
848
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
849
|
-
flexDirection: "row",
|
|
850
|
-
width: "100%",
|
|
851
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
852
|
-
italic: true,
|
|
853
|
-
color,
|
|
854
|
-
dimColor,
|
|
855
|
-
children: "((empty message))"
|
|
856
|
-
}, undefined, false, undefined, this)
|
|
857
|
-
}, undefined, false, undefined, this);
|
|
858
|
-
}
|
|
859
|
-
if (messageText.includes("<bash-input>")) {
|
|
860
|
-
const input = extractTag(messageText, "bash-input");
|
|
861
|
-
if (input) {
|
|
862
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
863
|
-
flexDirection: "row",
|
|
864
|
-
width: "100%",
|
|
865
|
-
children: [
|
|
866
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
867
|
-
color: "bashBorder",
|
|
868
|
-
children: "!"
|
|
869
|
-
}, undefined, false, undefined, this),
|
|
870
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
871
|
-
color,
|
|
872
|
-
dimColor,
|
|
873
|
-
children: [
|
|
874
|
-
" ",
|
|
875
|
-
input
|
|
876
|
-
]
|
|
877
|
-
}, undefined, true, undefined, this)
|
|
878
|
-
]
|
|
879
|
-
}, undefined, true, undefined, this);
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
if (messageText.includes(`<${COMMAND_MESSAGE_TAG}>`)) {
|
|
883
|
-
const commandMessage = extractTag(messageText, COMMAND_MESSAGE_TAG);
|
|
884
|
-
const args = extractTag(messageText, "command-args");
|
|
885
|
-
const isSkillFormat = extractTag(messageText, "skill-format") === "true";
|
|
886
|
-
if (commandMessage) {
|
|
887
|
-
if (isSkillFormat) {
|
|
888
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
889
|
-
flexDirection: "row",
|
|
890
|
-
width: "100%",
|
|
891
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
892
|
-
color,
|
|
893
|
-
dimColor,
|
|
894
|
-
children: [
|
|
895
|
-
"Skill(",
|
|
896
|
-
commandMessage,
|
|
897
|
-
")"
|
|
898
|
-
]
|
|
899
|
-
}, undefined, true, undefined, this)
|
|
900
|
-
}, undefined, false, undefined, this);
|
|
901
|
-
} else {
|
|
902
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
903
|
-
flexDirection: "row",
|
|
904
|
-
width: "100%",
|
|
905
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
906
|
-
color,
|
|
907
|
-
dimColor,
|
|
908
|
-
children: [
|
|
909
|
-
"/",
|
|
910
|
-
commandMessage,
|
|
911
|
-
" ",
|
|
912
|
-
args
|
|
913
|
-
]
|
|
914
|
-
}, undefined, true, undefined, this)
|
|
915
|
-
}, undefined, false, undefined, this);
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
920
|
-
flexDirection: "row",
|
|
921
|
-
width: "100%",
|
|
922
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
923
|
-
color,
|
|
924
|
-
dimColor,
|
|
925
|
-
children: paddingRight ? truncate(messageText, columns - paddingRight, true) : messageText.slice(0, 500).split(`
|
|
926
|
-
`).slice(0, 4).join(`
|
|
927
|
-
`)
|
|
928
|
-
}, undefined, false, undefined, this)
|
|
929
|
-
}, undefined, false, undefined, this);
|
|
930
|
-
}
|
|
931
|
-
function computeDiffStatsBetweenMessages(messages, fromMessageId, toMessageId) {
|
|
932
|
-
const startIndex = messages.findIndex((msg) => msg.uuid === fromMessageId);
|
|
933
|
-
if (startIndex === -1) {
|
|
934
|
-
return;
|
|
935
|
-
}
|
|
936
|
-
let endIndex = toMessageId ? messages.findIndex((msg) => msg.uuid === toMessageId) : messages.length;
|
|
937
|
-
if (endIndex === -1) {
|
|
938
|
-
endIndex = messages.length;
|
|
939
|
-
}
|
|
940
|
-
const filesChanged = [];
|
|
941
|
-
let insertions = 0;
|
|
942
|
-
let deletions = 0;
|
|
943
|
-
for (let i = startIndex + 1;i < endIndex; i++) {
|
|
944
|
-
const msg = messages[i];
|
|
945
|
-
if (!msg || !isToolUseResultMessage(msg)) {
|
|
946
|
-
continue;
|
|
947
|
-
}
|
|
948
|
-
const result = msg.toolUseResult;
|
|
949
|
-
if (!result || !result.filePath || !result.structuredPatch) {
|
|
950
|
-
continue;
|
|
951
|
-
}
|
|
952
|
-
if (!filesChanged.includes(result.filePath)) {
|
|
953
|
-
filesChanged.push(result.filePath);
|
|
954
|
-
}
|
|
955
|
-
try {
|
|
956
|
-
if ("type" in result && result.type === "create") {
|
|
957
|
-
insertions += result.content.split(/\r?\n/).length;
|
|
958
|
-
} else {
|
|
959
|
-
for (const hunk of result.structuredPatch) {
|
|
960
|
-
const additions = count(hunk.lines, (line) => line.startsWith("+"));
|
|
961
|
-
const removals = count(hunk.lines, (line) => line.startsWith("-"));
|
|
962
|
-
insertions += additions;
|
|
963
|
-
deletions += removals;
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
} catch {
|
|
967
|
-
continue;
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
return {
|
|
971
|
-
filesChanged,
|
|
972
|
-
insertions,
|
|
973
|
-
deletions
|
|
974
|
-
};
|
|
975
|
-
}
|
|
976
|
-
function selectableUserMessagesFilter(message) {
|
|
977
|
-
if (message.type !== "user") {
|
|
978
|
-
return false;
|
|
979
|
-
}
|
|
980
|
-
if (Array.isArray(message.message.content) && message.message.content[0]?.type === "tool_result") {
|
|
981
|
-
return false;
|
|
982
|
-
}
|
|
983
|
-
if (isSyntheticMessage(message)) {
|
|
984
|
-
return false;
|
|
985
|
-
}
|
|
986
|
-
if (message.isMeta) {
|
|
987
|
-
return false;
|
|
988
|
-
}
|
|
989
|
-
if (message.isCompactSummary || message.isVisibleInTranscriptOnly) {
|
|
990
|
-
return false;
|
|
991
|
-
}
|
|
992
|
-
const content = message.message.content;
|
|
993
|
-
const lastBlock = typeof content === "string" ? null : content[content.length - 1];
|
|
994
|
-
const messageText = typeof content === "string" ? content.trim() : lastBlock && isTextBlock(lastBlock) ? lastBlock.text.trim() : "";
|
|
995
|
-
if (messageText.indexOf(`<${LOCAL_COMMAND_STDOUT_TAG}>`) !== -1 || messageText.indexOf(`<${LOCAL_COMMAND_STDERR_TAG}>`) !== -1 || messageText.indexOf(`<${BASH_STDOUT_TAG}>`) !== -1 || messageText.indexOf(`<${BASH_STDERR_TAG}>`) !== -1 || messageText.indexOf(`<${TASK_NOTIFICATION_TAG}>`) !== -1 || messageText.indexOf(`<${TICK_TAG}>`) !== -1 || messageText.indexOf(`<${TEAMMATE_MESSAGE_TAG}`) !== -1) {
|
|
996
|
-
return false;
|
|
997
|
-
}
|
|
998
|
-
return true;
|
|
999
|
-
}
|
|
1000
|
-
function messagesAfterAreOnlySynthetic(messages, fromIndex) {
|
|
1001
|
-
for (let i = fromIndex + 1;i < messages.length; i++) {
|
|
1002
|
-
const msg = messages[i];
|
|
1003
|
-
if (!msg)
|
|
1004
|
-
continue;
|
|
1005
|
-
if (isSyntheticMessage(msg))
|
|
1006
|
-
continue;
|
|
1007
|
-
if (isToolUseResultMessage(msg))
|
|
1008
|
-
continue;
|
|
1009
|
-
if (msg.type === "progress")
|
|
1010
|
-
continue;
|
|
1011
|
-
if (msg.type === "system")
|
|
1012
|
-
continue;
|
|
1013
|
-
if (msg.type === "attachment")
|
|
1014
|
-
continue;
|
|
1015
|
-
if (msg.type === "user" && msg.isMeta)
|
|
1016
|
-
continue;
|
|
1017
|
-
if (msg.type === "assistant") {
|
|
1018
|
-
const content = msg.message.content;
|
|
1019
|
-
if (Array.isArray(content)) {
|
|
1020
|
-
const hasMeaningfulContent = content.some((block) => block.type === "text" && block.text.trim() || block.type === "tool_use");
|
|
1021
|
-
if (hasMeaningfulContent)
|
|
1022
|
-
return false;
|
|
1023
|
-
}
|
|
1024
|
-
continue;
|
|
1025
|
-
}
|
|
1026
|
-
if (msg.type === "user") {
|
|
1027
|
-
return false;
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
return true;
|
|
1031
|
-
}
|
|
1032
|
-
var import_react, jsx_dev_runtime, MAX_VISIBLE_MESSAGES = 7;
|
|
1033
|
-
var init_MessageSelector = __esm(() => {
|
|
1034
|
-
init_figures();
|
|
1035
|
-
init_analytics();
|
|
1036
|
-
init_AppState();
|
|
1037
|
-
init_fileHistory();
|
|
1038
|
-
init_log();
|
|
1039
|
-
init_useExitOnCtrlCDWithKeybindings();
|
|
1040
|
-
init_src();
|
|
1041
|
-
init_useKeybinding();
|
|
1042
|
-
init_displayTags();
|
|
1043
|
-
init_messages();
|
|
1044
|
-
init_select();
|
|
1045
|
-
init_Spinner();
|
|
1046
|
-
init_useTerminalSize();
|
|
1047
|
-
init_xml();
|
|
1048
|
-
init_array();
|
|
1049
|
-
init_format();
|
|
1050
|
-
import_react = __toESM(require_react(), 1);
|
|
1051
|
-
jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
|
|
1052
|
-
});
|
|
1053
|
-
|
|
1054
137
|
// src/utils/cronJitterConfig.ts
|
|
1055
138
|
var exports_cronJitterConfig = {};
|
|
1056
139
|
__export(exports_cronJitterConfig, {
|
|
@@ -1097,19 +180,19 @@ async function readLock(dir) {
|
|
|
1097
180
|
return result.success ? result.data : undefined;
|
|
1098
181
|
}
|
|
1099
182
|
async function tryCreateExclusive(lock, dir) {
|
|
1100
|
-
const
|
|
183
|
+
const path = getLockPath(dir);
|
|
1101
184
|
const body = jsonStringify(lock);
|
|
1102
185
|
try {
|
|
1103
|
-
await writeFile(
|
|
186
|
+
await writeFile(path, body, { flag: "wx" });
|
|
1104
187
|
return true;
|
|
1105
188
|
} catch (e) {
|
|
1106
189
|
const code = getErrnoCode(e);
|
|
1107
190
|
if (code === "EEXIST")
|
|
1108
191
|
return false;
|
|
1109
192
|
if (code === "ENOENT") {
|
|
1110
|
-
await mkdir(dirname(
|
|
193
|
+
await mkdir(dirname(path), { recursive: true });
|
|
1111
194
|
try {
|
|
1112
|
-
await writeFile(
|
|
195
|
+
await writeFile(path, body, { flag: "wx" });
|
|
1113
196
|
return true;
|
|
1114
197
|
} catch (retryErr) {
|
|
1115
198
|
if (getErrnoCode(retryErr) === "EEXIST")
|
|
@@ -1381,8 +464,8 @@ function createCronScheduler(options) {
|
|
|
1381
464
|
lockProbeTimer.unref?.();
|
|
1382
465
|
}
|
|
1383
466
|
load(true);
|
|
1384
|
-
const
|
|
1385
|
-
watcher = chokidar.watch(
|
|
467
|
+
const path = getCronFilePath(dir);
|
|
468
|
+
watcher = chokidar.watch(path, {
|
|
1386
469
|
persistent: false,
|
|
1387
470
|
ignoreInitial: true,
|
|
1388
471
|
awaitWriteFinish: { stabilityThreshold: FILE_STABILITY_MS },
|
|
@@ -1584,7 +667,7 @@ function permissionPromptToolResultToPermissionDecision(result, tool, input, too
|
|
|
1584
667
|
}
|
|
1585
668
|
|
|
1586
669
|
// src/cli/structuredIO.ts
|
|
1587
|
-
import { randomUUID
|
|
670
|
+
import { randomUUID } from "crypto";
|
|
1588
671
|
|
|
1589
672
|
// src/entrypoints/sdk/controlSchemas.ts
|
|
1590
673
|
init_v4();
|
|
@@ -2198,7 +1281,7 @@ class StructuredIO {
|
|
|
2198
1281
|
writeToStdout(ndjsonSafeStringify(message) + `
|
|
2199
1282
|
`);
|
|
2200
1283
|
}
|
|
2201
|
-
async sendRequest(request, schema, signal, requestId =
|
|
1284
|
+
async sendRequest(request, schema, signal, requestId = randomUUID()) {
|
|
2202
1285
|
const message = {
|
|
2203
1286
|
type: "control_request",
|
|
2204
1287
|
request_id: requestId,
|
|
@@ -2264,7 +1347,7 @@ class StructuredIO {
|
|
|
2264
1347
|
parentSignal.addEventListener("abort", onParentAbort, { once: true });
|
|
2265
1348
|
try {
|
|
2266
1349
|
const hookPromise = executePermissionRequestHooksForSDK(tool.name, toolUseID, input, toolUseContext, mainPermissionResult.suggestions).then((decision) => ({ source: "hook", decision }));
|
|
2267
|
-
const requestId =
|
|
1350
|
+
const requestId = randomUUID();
|
|
2268
1351
|
onPermissionPrompt?.(buildRequiresActionDetails(tool, input, toolUseID, requestId));
|
|
2269
1352
|
const sdkPromise = this.sendRequest({
|
|
2270
1353
|
subtype: "can_use_tool",
|
|
@@ -2344,7 +1427,7 @@ class StructuredIO {
|
|
|
2344
1427
|
subtype: "can_use_tool",
|
|
2345
1428
|
tool_name: SANDBOX_NETWORK_ACCESS_TOOL_NAME,
|
|
2346
1429
|
input: { host: hostPattern.host },
|
|
2347
|
-
tool_use_id:
|
|
1430
|
+
tool_use_id: randomUUID(),
|
|
2348
1431
|
description: `Allow network connection to ${hostPattern.host}?`
|
|
2349
1432
|
}, outputSchema());
|
|
2350
1433
|
return result.behavior === "allow";
|
|
@@ -2412,459 +1495,6 @@ async function executePermissionRequestHooksForSDK(toolName, toolUseID, input, t
|
|
|
2412
1495
|
return;
|
|
2413
1496
|
}
|
|
2414
1497
|
|
|
2415
|
-
// src/utils/messages/systemInit.ts
|
|
2416
|
-
init_state();
|
|
2417
|
-
init_outputStyles();
|
|
2418
|
-
init_constants();
|
|
2419
|
-
init_auth();
|
|
2420
|
-
init_cwd();
|
|
2421
|
-
init_fastMode();
|
|
2422
|
-
init_settings();
|
|
2423
|
-
import { randomUUID as randomUUID3 } from "crypto";
|
|
2424
|
-
function sdkCompatToolName(name) {
|
|
2425
|
-
return name === AGENT_TOOL_NAME ? LEGACY_AGENT_TOOL_NAME : name;
|
|
2426
|
-
}
|
|
2427
|
-
function buildSystemInitMessage(inputs) {
|
|
2428
|
-
const settings = getSettings_DEPRECATED();
|
|
2429
|
-
const outputStyle = settings?.outputStyle ?? DEFAULT_OUTPUT_STYLE_NAME;
|
|
2430
|
-
const initMessage = {
|
|
2431
|
-
type: "system",
|
|
2432
|
-
subtype: "init",
|
|
2433
|
-
cwd: getCwd(),
|
|
2434
|
-
session_id: getSessionId(),
|
|
2435
|
-
tools: inputs.tools.map((tool) => sdkCompatToolName(tool.name)),
|
|
2436
|
-
mcp_servers: inputs.mcpClients.map((client) => ({
|
|
2437
|
-
name: client.name,
|
|
2438
|
-
status: client.type
|
|
2439
|
-
})),
|
|
2440
|
-
model: inputs.model,
|
|
2441
|
-
permissionMode: inputs.permissionMode,
|
|
2442
|
-
slash_commands: inputs.commands.filter((c) => c.userInvocable !== false).map((c) => c.name),
|
|
2443
|
-
apiKeySource: getAnthropicApiKeyWithSource().source,
|
|
2444
|
-
betas: getSdkBetas(),
|
|
2445
|
-
claude_code_version: "2.1.888",
|
|
2446
|
-
output_style: outputStyle,
|
|
2447
|
-
agents: inputs.agents.map((agent) => agent.agentType),
|
|
2448
|
-
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
|
|
2449
|
-
plugins: inputs.plugins.map((plugin) => ({
|
|
2450
|
-
name: plugin.name,
|
|
2451
|
-
path: plugin.path,
|
|
2452
|
-
source: plugin.source
|
|
2453
|
-
})),
|
|
2454
|
-
uuid: randomUUID3()
|
|
2455
|
-
};
|
|
2456
|
-
if (false) {}
|
|
2457
|
-
initMessage.fast_mode_state = getFastModeState(inputs.model, inputs.fastMode);
|
|
2458
|
-
return initMessage;
|
|
2459
|
-
}
|
|
2460
|
-
|
|
2461
|
-
// src/utils/ultraplan/keyword.ts
|
|
2462
|
-
var OPEN_TO_CLOSE = {
|
|
2463
|
-
"`": "`",
|
|
2464
|
-
'"': '"',
|
|
2465
|
-
"<": ">",
|
|
2466
|
-
"{": "}",
|
|
2467
|
-
"[": "]",
|
|
2468
|
-
"(": ")",
|
|
2469
|
-
"'": "'"
|
|
2470
|
-
};
|
|
2471
|
-
function findKeywordTriggerPositions(text, keyword) {
|
|
2472
|
-
const re = new RegExp(keyword, "i");
|
|
2473
|
-
if (!re.test(text))
|
|
2474
|
-
return [];
|
|
2475
|
-
if (text.startsWith("/"))
|
|
2476
|
-
return [];
|
|
2477
|
-
const quotedRanges = [];
|
|
2478
|
-
let openQuote = null;
|
|
2479
|
-
let openAt = 0;
|
|
2480
|
-
const isWord = (ch) => !!ch && /[\p{L}\p{N}_]/u.test(ch);
|
|
2481
|
-
for (let i = 0;i < text.length; i++) {
|
|
2482
|
-
const ch = text[i];
|
|
2483
|
-
if (openQuote) {
|
|
2484
|
-
if (openQuote === "[" && ch === "[") {
|
|
2485
|
-
openAt = i;
|
|
2486
|
-
continue;
|
|
2487
|
-
}
|
|
2488
|
-
if (ch !== OPEN_TO_CLOSE[openQuote])
|
|
2489
|
-
continue;
|
|
2490
|
-
if (openQuote === "'" && isWord(text[i + 1]))
|
|
2491
|
-
continue;
|
|
2492
|
-
quotedRanges.push({ start: openAt, end: i + 1 });
|
|
2493
|
-
openQuote = null;
|
|
2494
|
-
} else if (ch === "<" && i + 1 < text.length && /[a-zA-Z/]/.test(text[i + 1]) || ch === "'" && !isWord(text[i - 1]) || ch !== "<" && ch !== "'" && ch in OPEN_TO_CLOSE) {
|
|
2495
|
-
openQuote = ch;
|
|
2496
|
-
openAt = i;
|
|
2497
|
-
}
|
|
2498
|
-
}
|
|
2499
|
-
const positions = [];
|
|
2500
|
-
const wordRe = new RegExp(`\\b${keyword}\\b`, "gi");
|
|
2501
|
-
const matches = text.matchAll(wordRe);
|
|
2502
|
-
for (const match of matches) {
|
|
2503
|
-
if (match.index === undefined)
|
|
2504
|
-
continue;
|
|
2505
|
-
const start = match.index;
|
|
2506
|
-
const end = start + match[0].length;
|
|
2507
|
-
if (quotedRanges.some((r) => start >= r.start && start < r.end))
|
|
2508
|
-
continue;
|
|
2509
|
-
const before = text[start - 1];
|
|
2510
|
-
const after = text[end];
|
|
2511
|
-
if (before === "/" || before === "\\" || before === "-")
|
|
2512
|
-
continue;
|
|
2513
|
-
if (after === "/" || after === "\\" || after === "-" || after === "?")
|
|
2514
|
-
continue;
|
|
2515
|
-
if (after === "." && isWord(text[end + 1]))
|
|
2516
|
-
continue;
|
|
2517
|
-
positions.push({ word: match[0], start, end });
|
|
2518
|
-
}
|
|
2519
|
-
return positions;
|
|
2520
|
-
}
|
|
2521
|
-
function findUltraplanTriggerPositions(text) {
|
|
2522
|
-
return findKeywordTriggerPositions(text, "ultraplan");
|
|
2523
|
-
}
|
|
2524
|
-
function findUltrareviewTriggerPositions(text) {
|
|
2525
|
-
return findKeywordTriggerPositions(text, "ultrareview");
|
|
2526
|
-
}
|
|
2527
|
-
function hasUltraplanKeyword(text) {
|
|
2528
|
-
return findUltraplanTriggerPositions(text).length > 0;
|
|
2529
|
-
}
|
|
2530
|
-
function replaceUltraplanKeyword(text) {
|
|
2531
|
-
const [trigger] = findUltraplanTriggerPositions(text);
|
|
2532
|
-
if (!trigger)
|
|
2533
|
-
return text;
|
|
2534
|
-
const before = text.slice(0, trigger.start);
|
|
2535
|
-
const after = text.slice(trigger.end);
|
|
2536
|
-
if (!(before + after).trim())
|
|
2537
|
-
return "";
|
|
2538
|
-
return before + trigger.word.slice("ultra".length) + after;
|
|
2539
|
-
}
|
|
2540
|
-
|
|
2541
|
-
// src/utils/processUserInput/processUserInput.ts
|
|
2542
|
-
init_analytics();
|
|
2543
|
-
init_messages();
|
|
2544
|
-
init_commands();
|
|
2545
|
-
init_textInputTypes();
|
|
2546
|
-
init_attachments();
|
|
2547
|
-
init_generators();
|
|
2548
|
-
init_hooks2();
|
|
2549
|
-
init_imageResizer();
|
|
2550
|
-
init_imageStore();
|
|
2551
|
-
init_messages();
|
|
2552
|
-
init_queryProfiler();
|
|
2553
|
-
init_slashCommandParsing();
|
|
2554
|
-
import { randomUUID as randomUUID5 } from "crypto";
|
|
2555
|
-
|
|
2556
|
-
// src/utils/processUserInput/processTextPrompt.ts
|
|
2557
|
-
init_state();
|
|
2558
|
-
init_analytics();
|
|
2559
|
-
init_messages();
|
|
2560
|
-
init_events();
|
|
2561
|
-
init_sessionTracing();
|
|
2562
|
-
import { randomUUID as randomUUID4 } from "crypto";
|
|
2563
|
-
|
|
2564
|
-
// src/utils/userPromptKeywords.ts
|
|
2565
|
-
function matchesNegativeKeyword(input) {
|
|
2566
|
-
const lowerInput = input.toLowerCase();
|
|
2567
|
-
const negativePattern = /\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/;
|
|
2568
|
-
return negativePattern.test(lowerInput);
|
|
2569
|
-
}
|
|
2570
|
-
function matchesKeepGoingKeyword(input) {
|
|
2571
|
-
const lowerInput = input.toLowerCase().trim();
|
|
2572
|
-
if (lowerInput === "continue") {
|
|
2573
|
-
return true;
|
|
2574
|
-
}
|
|
2575
|
-
const keepGoingPattern = /\b(keep going|go on)\b/;
|
|
2576
|
-
return keepGoingPattern.test(lowerInput);
|
|
2577
|
-
}
|
|
2578
|
-
|
|
2579
|
-
// src/utils/processUserInput/processTextPrompt.ts
|
|
2580
|
-
function processTextPrompt(input, imageContentBlocks, imagePasteIds, attachmentMessages, uuid, permissionMode, isMeta) {
|
|
2581
|
-
const promptId = randomUUID4();
|
|
2582
|
-
setPromptId(promptId);
|
|
2583
|
-
const userPromptText = typeof input === "string" ? input : input.find((block) => block.type === "text")?.text || "";
|
|
2584
|
-
startInteractionSpan(userPromptText);
|
|
2585
|
-
const otelPromptText = typeof input === "string" ? input : input.findLast((block) => block.type === "text")?.text || "";
|
|
2586
|
-
if (otelPromptText) {
|
|
2587
|
-
logOTelEvent("user_prompt", {
|
|
2588
|
-
prompt_length: String(otelPromptText.length),
|
|
2589
|
-
prompt: redactIfDisabled(otelPromptText),
|
|
2590
|
-
"prompt.id": promptId
|
|
2591
|
-
});
|
|
2592
|
-
}
|
|
2593
|
-
const isNegative = matchesNegativeKeyword(userPromptText);
|
|
2594
|
-
const isKeepGoing = matchesKeepGoingKeyword(userPromptText);
|
|
2595
|
-
logEvent("tengu_input_prompt", {
|
|
2596
|
-
is_negative: isNegative,
|
|
2597
|
-
is_keep_going: isKeepGoing
|
|
2598
|
-
});
|
|
2599
|
-
if (imageContentBlocks.length > 0) {
|
|
2600
|
-
const textContent = typeof input === "string" ? input.trim() ? [{ type: "text", text: input }] : [] : input;
|
|
2601
|
-
const userMessage2 = createUserMessage({
|
|
2602
|
-
content: [...textContent, ...imageContentBlocks],
|
|
2603
|
-
uuid,
|
|
2604
|
-
imagePasteIds: imagePasteIds.length > 0 ? imagePasteIds : undefined,
|
|
2605
|
-
permissionMode,
|
|
2606
|
-
isMeta: isMeta || undefined
|
|
2607
|
-
});
|
|
2608
|
-
return {
|
|
2609
|
-
messages: [userMessage2, ...attachmentMessages],
|
|
2610
|
-
shouldQuery: true
|
|
2611
|
-
};
|
|
2612
|
-
}
|
|
2613
|
-
const userMessage = createUserMessage({
|
|
2614
|
-
content: input,
|
|
2615
|
-
uuid,
|
|
2616
|
-
permissionMode,
|
|
2617
|
-
isMeta: isMeta || undefined
|
|
2618
|
-
});
|
|
2619
|
-
return {
|
|
2620
|
-
messages: [userMessage, ...attachmentMessages],
|
|
2621
|
-
shouldQuery: true
|
|
2622
|
-
};
|
|
2623
|
-
}
|
|
2624
|
-
|
|
2625
|
-
// src/utils/processUserInput/processUserInput.ts
|
|
2626
|
-
async function processUserInput({
|
|
2627
|
-
input,
|
|
2628
|
-
preExpansionInput,
|
|
2629
|
-
mode,
|
|
2630
|
-
setToolJSX,
|
|
2631
|
-
context,
|
|
2632
|
-
pastedContents,
|
|
2633
|
-
ideSelection,
|
|
2634
|
-
messages,
|
|
2635
|
-
setUserInputOnProcessing,
|
|
2636
|
-
uuid,
|
|
2637
|
-
isAlreadyProcessing,
|
|
2638
|
-
querySource,
|
|
2639
|
-
canUseTool,
|
|
2640
|
-
skipSlashCommands,
|
|
2641
|
-
bridgeOrigin,
|
|
2642
|
-
isMeta,
|
|
2643
|
-
skipAttachments
|
|
2644
|
-
}) {
|
|
2645
|
-
const inputString = typeof input === "string" ? input : null;
|
|
2646
|
-
if (mode === "prompt" && inputString !== null && !isMeta) {
|
|
2647
|
-
setUserInputOnProcessing?.(inputString);
|
|
2648
|
-
}
|
|
2649
|
-
queryCheckpoint("query_process_user_input_base_start");
|
|
2650
|
-
const appState = context.getAppState();
|
|
2651
|
-
const result = await processUserInputBase(input, mode, setToolJSX, context, pastedContents, ideSelection, messages, uuid, isAlreadyProcessing, querySource, canUseTool, appState.toolPermissionContext.mode, skipSlashCommands, bridgeOrigin, isMeta, skipAttachments, preExpansionInput);
|
|
2652
|
-
queryCheckpoint("query_process_user_input_base_end");
|
|
2653
|
-
if (!result.shouldQuery) {
|
|
2654
|
-
return result;
|
|
2655
|
-
}
|
|
2656
|
-
queryCheckpoint("query_hooks_start");
|
|
2657
|
-
const inputMessage = getContentText(input) || "";
|
|
2658
|
-
for await (const hookResult of executeUserPromptSubmitHooks(inputMessage, appState.toolPermissionContext.mode, context, context.requestPrompt)) {
|
|
2659
|
-
if (hookResult.message?.type === "progress") {
|
|
2660
|
-
continue;
|
|
2661
|
-
}
|
|
2662
|
-
if (hookResult.blockingError) {
|
|
2663
|
-
const blockingMessage = getUserPromptSubmitHookBlockingMessage(hookResult.blockingError);
|
|
2664
|
-
return {
|
|
2665
|
-
messages: [
|
|
2666
|
-
createSystemMessage(`${blockingMessage}
|
|
2667
|
-
|
|
2668
|
-
Original prompt: ${input}`, "warning")
|
|
2669
|
-
],
|
|
2670
|
-
shouldQuery: false,
|
|
2671
|
-
allowedTools: result.allowedTools
|
|
2672
|
-
};
|
|
2673
|
-
}
|
|
2674
|
-
if (hookResult.preventContinuation) {
|
|
2675
|
-
const message = hookResult.stopReason ? `Operation stopped by hook: ${hookResult.stopReason}` : "Operation stopped by hook";
|
|
2676
|
-
result.messages.push(createUserMessage({
|
|
2677
|
-
content: message
|
|
2678
|
-
}));
|
|
2679
|
-
result.shouldQuery = false;
|
|
2680
|
-
return result;
|
|
2681
|
-
}
|
|
2682
|
-
if (hookResult.additionalContexts && hookResult.additionalContexts.length > 0) {
|
|
2683
|
-
result.messages.push(createAttachmentMessage({
|
|
2684
|
-
type: "hook_additional_context",
|
|
2685
|
-
content: hookResult.additionalContexts.map(applyTruncation),
|
|
2686
|
-
hookName: "UserPromptSubmit",
|
|
2687
|
-
toolUseID: `hook-${randomUUID5()}`,
|
|
2688
|
-
hookEvent: "UserPromptSubmit"
|
|
2689
|
-
}));
|
|
2690
|
-
}
|
|
2691
|
-
if (hookResult.message) {
|
|
2692
|
-
switch (hookResult.message.attachment.type) {
|
|
2693
|
-
case "hook_success":
|
|
2694
|
-
if (!hookResult.message.attachment.content) {
|
|
2695
|
-
break;
|
|
2696
|
-
}
|
|
2697
|
-
result.messages.push({
|
|
2698
|
-
...hookResult.message,
|
|
2699
|
-
attachment: {
|
|
2700
|
-
...hookResult.message.attachment,
|
|
2701
|
-
content: applyTruncation(hookResult.message.attachment.content)
|
|
2702
|
-
}
|
|
2703
|
-
});
|
|
2704
|
-
break;
|
|
2705
|
-
default:
|
|
2706
|
-
result.messages.push(hookResult.message);
|
|
2707
|
-
break;
|
|
2708
|
-
}
|
|
2709
|
-
}
|
|
2710
|
-
}
|
|
2711
|
-
queryCheckpoint("query_hooks_end");
|
|
2712
|
-
return result;
|
|
2713
|
-
}
|
|
2714
|
-
var MAX_HOOK_OUTPUT_LENGTH = 1e4;
|
|
2715
|
-
function applyTruncation(content) {
|
|
2716
|
-
if (content.length > MAX_HOOK_OUTPUT_LENGTH) {
|
|
2717
|
-
return `${content.substring(0, MAX_HOOK_OUTPUT_LENGTH)}\u2026 [output truncated - exceeded ${MAX_HOOK_OUTPUT_LENGTH} characters]`;
|
|
2718
|
-
}
|
|
2719
|
-
return content;
|
|
2720
|
-
}
|
|
2721
|
-
async function processUserInputBase(input, mode, setToolJSX, context, pastedContents, ideSelection, messages, uuid, isAlreadyProcessing, querySource, canUseTool, permissionMode, skipSlashCommands, bridgeOrigin, isMeta, skipAttachments, preExpansionInput) {
|
|
2722
|
-
let inputString = null;
|
|
2723
|
-
let precedingInputBlocks = [];
|
|
2724
|
-
const imageMetadataTexts = [];
|
|
2725
|
-
let normalizedInput = input;
|
|
2726
|
-
if (typeof input === "string") {
|
|
2727
|
-
inputString = input;
|
|
2728
|
-
} else if (input.length > 0) {
|
|
2729
|
-
queryCheckpoint("query_image_processing_start");
|
|
2730
|
-
const processedBlocks = [];
|
|
2731
|
-
for (const block of input) {
|
|
2732
|
-
if (block.type === "image") {
|
|
2733
|
-
const resized = await maybeResizeAndDownsampleImageBlock(block);
|
|
2734
|
-
if (resized.dimensions) {
|
|
2735
|
-
const metadataText = createImageMetadataText(resized.dimensions);
|
|
2736
|
-
if (metadataText) {
|
|
2737
|
-
imageMetadataTexts.push(metadataText);
|
|
2738
|
-
}
|
|
2739
|
-
}
|
|
2740
|
-
processedBlocks.push(resized.block);
|
|
2741
|
-
} else {
|
|
2742
|
-
processedBlocks.push(block);
|
|
2743
|
-
}
|
|
2744
|
-
}
|
|
2745
|
-
normalizedInput = processedBlocks;
|
|
2746
|
-
queryCheckpoint("query_image_processing_end");
|
|
2747
|
-
const lastBlock = processedBlocks[processedBlocks.length - 1];
|
|
2748
|
-
if (lastBlock?.type === "text") {
|
|
2749
|
-
inputString = lastBlock.text;
|
|
2750
|
-
precedingInputBlocks = processedBlocks.slice(0, -1);
|
|
2751
|
-
} else {
|
|
2752
|
-
precedingInputBlocks = processedBlocks;
|
|
2753
|
-
}
|
|
2754
|
-
}
|
|
2755
|
-
if (inputString === null && mode !== "prompt") {
|
|
2756
|
-
throw new Error(`Mode: ${mode} requires a string input.`);
|
|
2757
|
-
}
|
|
2758
|
-
const imageContents = pastedContents ? Object.values(pastedContents).filter(isValidImagePaste) : [];
|
|
2759
|
-
const imagePasteIds = imageContents.map((img) => img.id);
|
|
2760
|
-
const storedImagePaths = pastedContents ? await storeImages(pastedContents) : new Map;
|
|
2761
|
-
queryCheckpoint("query_pasted_image_processing_start");
|
|
2762
|
-
const imageProcessingResults = await Promise.all(imageContents.map(async (pastedImage) => {
|
|
2763
|
-
const imageBlock = {
|
|
2764
|
-
type: "image",
|
|
2765
|
-
source: {
|
|
2766
|
-
type: "base64",
|
|
2767
|
-
media_type: pastedImage.mediaType || "image/png",
|
|
2768
|
-
data: pastedImage.content
|
|
2769
|
-
}
|
|
2770
|
-
};
|
|
2771
|
-
logEvent("tengu_pasted_image_resize_attempt", {
|
|
2772
|
-
original_size_bytes: pastedImage.content.length
|
|
2773
|
-
});
|
|
2774
|
-
const resized = await maybeResizeAndDownsampleImageBlock(imageBlock);
|
|
2775
|
-
return {
|
|
2776
|
-
resized,
|
|
2777
|
-
originalDimensions: pastedImage.dimensions,
|
|
2778
|
-
sourcePath: pastedImage.sourcePath ?? storedImagePaths.get(pastedImage.id)
|
|
2779
|
-
};
|
|
2780
|
-
}));
|
|
2781
|
-
const imageContentBlocks = [];
|
|
2782
|
-
for (const {
|
|
2783
|
-
resized,
|
|
2784
|
-
originalDimensions,
|
|
2785
|
-
sourcePath
|
|
2786
|
-
} of imageProcessingResults) {
|
|
2787
|
-
if (resized.dimensions) {
|
|
2788
|
-
const metadataText = createImageMetadataText(resized.dimensions, sourcePath);
|
|
2789
|
-
if (metadataText) {
|
|
2790
|
-
imageMetadataTexts.push(metadataText);
|
|
2791
|
-
}
|
|
2792
|
-
} else if (originalDimensions) {
|
|
2793
|
-
const metadataText = createImageMetadataText(originalDimensions, sourcePath);
|
|
2794
|
-
if (metadataText) {
|
|
2795
|
-
imageMetadataTexts.push(metadataText);
|
|
2796
|
-
}
|
|
2797
|
-
} else if (sourcePath) {
|
|
2798
|
-
imageMetadataTexts.push(`[Image source: ${sourcePath}]`);
|
|
2799
|
-
}
|
|
2800
|
-
imageContentBlocks.push(resized.block);
|
|
2801
|
-
}
|
|
2802
|
-
queryCheckpoint("query_pasted_image_processing_end");
|
|
2803
|
-
let effectiveSkipSlash = skipSlashCommands;
|
|
2804
|
-
if (bridgeOrigin && inputString !== null && inputString.startsWith("/")) {
|
|
2805
|
-
const parsed = parseSlashCommand(inputString);
|
|
2806
|
-
const cmd = parsed ? findCommand(parsed.commandName, context.options.commands) : undefined;
|
|
2807
|
-
if (cmd) {
|
|
2808
|
-
if (isBridgeSafeCommand(cmd)) {
|
|
2809
|
-
effectiveSkipSlash = false;
|
|
2810
|
-
} else {
|
|
2811
|
-
const msg = `/${getCommandName(cmd)} isn't available over Remote Control.`;
|
|
2812
|
-
return {
|
|
2813
|
-
messages: [
|
|
2814
|
-
createUserMessage({ content: inputString, uuid }),
|
|
2815
|
-
createCommandInputMessage(`<local-command-stdout>${msg}</local-command-stdout>`)
|
|
2816
|
-
],
|
|
2817
|
-
shouldQuery: false,
|
|
2818
|
-
resultText: msg
|
|
2819
|
-
};
|
|
2820
|
-
}
|
|
2821
|
-
}
|
|
2822
|
-
}
|
|
2823
|
-
if (mode === "prompt" && !context.options.isNonInteractiveSession && inputString !== null && !effectiveSkipSlash && !inputString.startsWith("/") && !context.getAppState().ultraplanSessionUrl && !context.getAppState().ultraplanLaunching && hasUltraplanKeyword(preExpansionInput ?? inputString)) {
|
|
2824
|
-
logEvent("tengu_ultraplan_keyword", {});
|
|
2825
|
-
const rewritten = replaceUltraplanKeyword(inputString).trim();
|
|
2826
|
-
const { processSlashCommand } = await import("./chunk-7jsk6wen.js");
|
|
2827
|
-
const slashResult = await processSlashCommand(`/ultraplan ${rewritten}`, precedingInputBlocks, imageContentBlocks, [], context, setToolJSX, uuid, isAlreadyProcessing, canUseTool);
|
|
2828
|
-
return addImageMetadataMessage(slashResult, imageMetadataTexts);
|
|
2829
|
-
}
|
|
2830
|
-
const shouldExtractAttachments = !skipAttachments && inputString !== null && (mode !== "prompt" || effectiveSkipSlash || !inputString.startsWith("/"));
|
|
2831
|
-
queryCheckpoint("query_attachment_loading_start");
|
|
2832
|
-
const attachmentMessages = shouldExtractAttachments ? await toArray(getAttachmentMessages(inputString, context, ideSelection ?? null, [], messages, querySource)) : [];
|
|
2833
|
-
queryCheckpoint("query_attachment_loading_end");
|
|
2834
|
-
if (inputString !== null && mode === "bash") {
|
|
2835
|
-
const { processBashCommand } = await import("./chunk-eqn3qmfz.js");
|
|
2836
|
-
return addImageMetadataMessage(await processBashCommand(inputString, precedingInputBlocks, attachmentMessages, context, setToolJSX), imageMetadataTexts);
|
|
2837
|
-
}
|
|
2838
|
-
if (inputString !== null && !effectiveSkipSlash && inputString.startsWith("/")) {
|
|
2839
|
-
const { processSlashCommand } = await import("./chunk-7jsk6wen.js");
|
|
2840
|
-
const slashResult = await processSlashCommand(inputString, precedingInputBlocks, imageContentBlocks, attachmentMessages, context, setToolJSX, uuid, isAlreadyProcessing, canUseTool);
|
|
2841
|
-
return addImageMetadataMessage(slashResult, imageMetadataTexts);
|
|
2842
|
-
}
|
|
2843
|
-
if (inputString !== null && mode === "prompt") {
|
|
2844
|
-
const trimmedInput = inputString.trim();
|
|
2845
|
-
const agentMention = attachmentMessages.find((m) => m.attachment.type === "agent_mention");
|
|
2846
|
-
if (agentMention) {
|
|
2847
|
-
const agentMentionString = `@agent-${agentMention.attachment.agentType}`;
|
|
2848
|
-
const isSubagentOnly = trimmedInput === agentMentionString;
|
|
2849
|
-
const isPrefix = trimmedInput.startsWith(agentMentionString) && !isSubagentOnly;
|
|
2850
|
-
logEvent("tengu_subagent_at_mention", {
|
|
2851
|
-
is_subagent_only: isSubagentOnly,
|
|
2852
|
-
is_prefix: isPrefix
|
|
2853
|
-
});
|
|
2854
|
-
}
|
|
2855
|
-
}
|
|
2856
|
-
return addImageMetadataMessage(processTextPrompt(normalizedInput, imageContentBlocks, imagePasteIds, attachmentMessages, uuid, permissionMode, isMeta), imageMetadataTexts);
|
|
2857
|
-
}
|
|
2858
|
-
function addImageMetadataMessage(result, imageMetadataTexts) {
|
|
2859
|
-
if (imageMetadataTexts.length > 0) {
|
|
2860
|
-
result.messages.push(createUserMessage({
|
|
2861
|
-
content: imageMetadataTexts.map((text) => ({ type: "text", text })),
|
|
2862
|
-
isMeta: true
|
|
2863
|
-
}));
|
|
2864
|
-
}
|
|
2865
|
-
return result;
|
|
2866
|
-
}
|
|
2867
|
-
|
|
2868
1498
|
// src/utils/plugins/reconciler.ts
|
|
2869
1499
|
init_isEqual();
|
|
2870
1500
|
init_state();
|
|
@@ -2994,4 +1624,4 @@ function normalizeSource(source, projectRoot) {
|
|
|
2994
1624
|
return source;
|
|
2995
1625
|
}
|
|
2996
1626
|
|
|
2997
|
-
export { extractInboundMessageFields,
|
|
1627
|
+
export { extractInboundMessageFields, outputSchema, permissionPromptToolResultToPermissionDecision, ndjsonSafeStringify, StructuredIO, diffMarketplaces, reconcileMarketplaces, getCronJitterConfig, exports_cronJitterConfig, init_cronJitterConfig, createCronScheduler, exports_cronScheduler, init_cronScheduler };
|