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
|
@@ -0,0 +1,1396 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
init_slashCommandParsing,
|
|
4
|
+
parseSlashCommand
|
|
5
|
+
} from "./chunk-rn0v1hk8.js";
|
|
6
|
+
import {
|
|
7
|
+
DEFAULT_OUTPUT_STYLE_NAME,
|
|
8
|
+
Select,
|
|
9
|
+
Spinner,
|
|
10
|
+
createAttachmentMessage,
|
|
11
|
+
createCommandInputMessage,
|
|
12
|
+
createImageMetadataText,
|
|
13
|
+
createSystemMessage,
|
|
14
|
+
createUserMessage,
|
|
15
|
+
executeUserPromptSubmitHooks,
|
|
16
|
+
extractTag,
|
|
17
|
+
fileHistoryCanRestore,
|
|
18
|
+
fileHistoryEnabled,
|
|
19
|
+
fileHistoryGetDiffStats,
|
|
20
|
+
findCommand,
|
|
21
|
+
getAttachmentMessages,
|
|
22
|
+
getCommandName,
|
|
23
|
+
getContentText,
|
|
24
|
+
getUserPromptSubmitHookBlockingMessage,
|
|
25
|
+
init_AppState,
|
|
26
|
+
init_Spinner,
|
|
27
|
+
init_attachments,
|
|
28
|
+
init_commands1 as init_commands,
|
|
29
|
+
init_fileHistory,
|
|
30
|
+
init_generators,
|
|
31
|
+
init_hooks1 as init_hooks,
|
|
32
|
+
init_imageResizer,
|
|
33
|
+
init_imageStore,
|
|
34
|
+
init_messages1 as init_messages,
|
|
35
|
+
init_outputStyles,
|
|
36
|
+
init_queryProfiler,
|
|
37
|
+
init_select,
|
|
38
|
+
init_textInputTypes,
|
|
39
|
+
init_useTerminalSize,
|
|
40
|
+
isBridgeSafeCommand,
|
|
41
|
+
isEmptyMessageText,
|
|
42
|
+
isSyntheticMessage,
|
|
43
|
+
isToolUseResultMessage,
|
|
44
|
+
isValidImagePaste,
|
|
45
|
+
maybeResizeAndDownsampleImageBlock,
|
|
46
|
+
queryCheckpoint,
|
|
47
|
+
storeImages,
|
|
48
|
+
toArray,
|
|
49
|
+
useAppState
|
|
50
|
+
} from "./chunk-mmc59v16.js";
|
|
51
|
+
import {
|
|
52
|
+
init_useExitOnCtrlCDWithKeybindings,
|
|
53
|
+
useExitOnCtrlCDWithKeybindings
|
|
54
|
+
} from "./chunk-4169yf5x.js";
|
|
55
|
+
import {
|
|
56
|
+
init_useKeybinding
|
|
57
|
+
} from "./chunk-t0twk3e5.js";
|
|
58
|
+
import {
|
|
59
|
+
init_events,
|
|
60
|
+
init_sessionTracing,
|
|
61
|
+
logOTelEvent,
|
|
62
|
+
redactIfDisabled,
|
|
63
|
+
startInteractionSpan
|
|
64
|
+
} from "./chunk-mhd4n6av.js";
|
|
65
|
+
import {
|
|
66
|
+
AGENT_TOOL_NAME,
|
|
67
|
+
LEGACY_AGENT_TOOL_NAME,
|
|
68
|
+
getAnthropicApiKeyWithSource,
|
|
69
|
+
getFastModeState,
|
|
70
|
+
getSettings_DEPRECATED,
|
|
71
|
+
init_auth,
|
|
72
|
+
init_constants1 as init_constants,
|
|
73
|
+
init_fastMode,
|
|
74
|
+
init_settings1 as init_settings
|
|
75
|
+
} from "./chunk-4581z0wr.js";
|
|
76
|
+
import {
|
|
77
|
+
count,
|
|
78
|
+
init_array
|
|
79
|
+
} from "./chunk-zwarn9h7.js";
|
|
80
|
+
import {
|
|
81
|
+
formatRelativeTimeAgo,
|
|
82
|
+
init_format,
|
|
83
|
+
truncate
|
|
84
|
+
} from "./chunk-prgsmrmy.js";
|
|
85
|
+
import {
|
|
86
|
+
Divider,
|
|
87
|
+
ThemedBox_default,
|
|
88
|
+
ThemedText,
|
|
89
|
+
init_src,
|
|
90
|
+
useKeybinding,
|
|
91
|
+
useKeybindings,
|
|
92
|
+
useTerminalSize
|
|
93
|
+
} from "./chunk-e4jqbn4d.js";
|
|
94
|
+
import {
|
|
95
|
+
require_jsx_dev_runtime
|
|
96
|
+
} from "./chunk-vxnvzfnv.js";
|
|
97
|
+
import {
|
|
98
|
+
require_react
|
|
99
|
+
} from "./chunk-ns3babbs.js";
|
|
100
|
+
import {
|
|
101
|
+
init_analytics,
|
|
102
|
+
logEvent
|
|
103
|
+
} from "./chunk-h0rbjg6x.js";
|
|
104
|
+
import {
|
|
105
|
+
getCwd,
|
|
106
|
+
init_cwd
|
|
107
|
+
} from "./chunk-tv74hgw9.js";
|
|
108
|
+
import {
|
|
109
|
+
BASH_STDERR_TAG,
|
|
110
|
+
BASH_STDOUT_TAG,
|
|
111
|
+
COMMAND_MESSAGE_TAG,
|
|
112
|
+
LOCAL_COMMAND_STDERR_TAG,
|
|
113
|
+
LOCAL_COMMAND_STDOUT_TAG,
|
|
114
|
+
TASK_NOTIFICATION_TAG,
|
|
115
|
+
TEAMMATE_MESSAGE_TAG,
|
|
116
|
+
TICK_TAG,
|
|
117
|
+
init_displayTags,
|
|
118
|
+
init_log,
|
|
119
|
+
init_xml,
|
|
120
|
+
logError,
|
|
121
|
+
stripDisplayTags
|
|
122
|
+
} from "./chunk-d2vb6m9e.js";
|
|
123
|
+
import {
|
|
124
|
+
figures_default,
|
|
125
|
+
init_figures
|
|
126
|
+
} from "./chunk-qajrkk97.js";
|
|
127
|
+
import {
|
|
128
|
+
getSdkBetas,
|
|
129
|
+
getSessionId,
|
|
130
|
+
init_state,
|
|
131
|
+
setPromptId
|
|
132
|
+
} from "./chunk-gzp6rza1.js";
|
|
133
|
+
import {
|
|
134
|
+
__esm,
|
|
135
|
+
__export,
|
|
136
|
+
__require,
|
|
137
|
+
__toESM
|
|
138
|
+
} from "./chunk-qp2qdcda.js";
|
|
139
|
+
|
|
140
|
+
// src/components/MessageSelector.tsx
|
|
141
|
+
var exports_MessageSelector = {};
|
|
142
|
+
__export(exports_MessageSelector, {
|
|
143
|
+
selectableUserMessagesFilter: () => selectableUserMessagesFilter,
|
|
144
|
+
messagesAfterAreOnlySynthetic: () => messagesAfterAreOnlySynthetic,
|
|
145
|
+
MessageSelector: () => MessageSelector
|
|
146
|
+
});
|
|
147
|
+
import { randomUUID } from "crypto";
|
|
148
|
+
import * as path from "path";
|
|
149
|
+
function isTextBlock(block) {
|
|
150
|
+
return block.type === "text";
|
|
151
|
+
}
|
|
152
|
+
function isSummarizeOption(option) {
|
|
153
|
+
return option === "summarize" || option === "summarize_up_to";
|
|
154
|
+
}
|
|
155
|
+
function MessageSelector({
|
|
156
|
+
messages,
|
|
157
|
+
onPreRestore,
|
|
158
|
+
onRestoreMessage,
|
|
159
|
+
onRestoreCode,
|
|
160
|
+
onSummarize,
|
|
161
|
+
onClose,
|
|
162
|
+
preselectedMessage
|
|
163
|
+
}) {
|
|
164
|
+
const fileHistory = useAppState((s) => s.fileHistory);
|
|
165
|
+
const [error, setError] = import_react.useState(undefined);
|
|
166
|
+
const isFileHistoryEnabled = fileHistoryEnabled();
|
|
167
|
+
const currentUUID = import_react.useMemo(randomUUID, []);
|
|
168
|
+
const messageOptions = import_react.useMemo(() => [
|
|
169
|
+
...messages.filter(selectableUserMessagesFilter),
|
|
170
|
+
{
|
|
171
|
+
...createUserMessage({
|
|
172
|
+
content: ""
|
|
173
|
+
}),
|
|
174
|
+
uuid: currentUUID
|
|
175
|
+
}
|
|
176
|
+
], [messages, currentUUID]);
|
|
177
|
+
const [selectedIndex, setSelectedIndex] = import_react.useState(messageOptions.length - 1);
|
|
178
|
+
const firstVisibleIndex = Math.max(0, Math.min(selectedIndex - Math.floor(MAX_VISIBLE_MESSAGES / 2), messageOptions.length - MAX_VISIBLE_MESSAGES));
|
|
179
|
+
const hasMessagesToSelect = messageOptions.length > 1;
|
|
180
|
+
const [messageToRestore, setMessageToRestore] = import_react.useState(preselectedMessage);
|
|
181
|
+
const [diffStatsForRestore, setDiffStatsForRestore] = import_react.useState(undefined);
|
|
182
|
+
import_react.useEffect(() => {
|
|
183
|
+
if (!preselectedMessage || !isFileHistoryEnabled)
|
|
184
|
+
return;
|
|
185
|
+
let cancelled = false;
|
|
186
|
+
fileHistoryGetDiffStats(fileHistory, preselectedMessage.uuid).then((stats) => {
|
|
187
|
+
if (!cancelled)
|
|
188
|
+
setDiffStatsForRestore(stats);
|
|
189
|
+
});
|
|
190
|
+
return () => {
|
|
191
|
+
cancelled = true;
|
|
192
|
+
};
|
|
193
|
+
}, [preselectedMessage, isFileHistoryEnabled, fileHistory]);
|
|
194
|
+
const [isRestoring, setIsRestoring] = import_react.useState(false);
|
|
195
|
+
const [restoringOption, setRestoringOption] = import_react.useState(null);
|
|
196
|
+
const [selectedRestoreOption, setSelectedRestoreOption] = import_react.useState("both");
|
|
197
|
+
const [summarizeFromFeedback, setSummarizeFromFeedback] = import_react.useState("");
|
|
198
|
+
const [summarizeUpToFeedback, setSummarizeUpToFeedback] = import_react.useState("");
|
|
199
|
+
function getRestoreOptions(canRestoreCode2) {
|
|
200
|
+
const baseOptions = canRestoreCode2 ? [
|
|
201
|
+
{ value: "both", label: "Restore code and conversation" },
|
|
202
|
+
{ value: "conversation", label: "Restore conversation" },
|
|
203
|
+
{ value: "code", label: "Restore code" }
|
|
204
|
+
] : [{ value: "conversation", label: "Restore conversation" }];
|
|
205
|
+
const summarizeInputProps = {
|
|
206
|
+
type: "input",
|
|
207
|
+
placeholder: "add context (optional)",
|
|
208
|
+
initialValue: "",
|
|
209
|
+
allowEmptySubmitToCancel: true,
|
|
210
|
+
showLabelWithValue: true,
|
|
211
|
+
labelValueSeparator: ": "
|
|
212
|
+
};
|
|
213
|
+
baseOptions.push({
|
|
214
|
+
value: "summarize",
|
|
215
|
+
label: "Summarize from here",
|
|
216
|
+
...summarizeInputProps,
|
|
217
|
+
onChange: setSummarizeFromFeedback
|
|
218
|
+
});
|
|
219
|
+
if (process.env.USER_TYPE === "ant") {
|
|
220
|
+
baseOptions.push({
|
|
221
|
+
value: "summarize_up_to",
|
|
222
|
+
label: "Summarize up to here",
|
|
223
|
+
...summarizeInputProps,
|
|
224
|
+
onChange: setSummarizeUpToFeedback
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
baseOptions.push({ value: "nevermind", label: "Never mind" });
|
|
228
|
+
return baseOptions;
|
|
229
|
+
}
|
|
230
|
+
import_react.useEffect(() => {
|
|
231
|
+
logEvent("tengu_message_selector_opened", {});
|
|
232
|
+
}, []);
|
|
233
|
+
async function restoreConversationDirectly(message) {
|
|
234
|
+
onPreRestore();
|
|
235
|
+
setIsRestoring(true);
|
|
236
|
+
try {
|
|
237
|
+
await onRestoreMessage(message);
|
|
238
|
+
setIsRestoring(false);
|
|
239
|
+
onClose();
|
|
240
|
+
} catch (error2) {
|
|
241
|
+
logError(error2);
|
|
242
|
+
setIsRestoring(false);
|
|
243
|
+
setError(`Failed to restore the conversation:
|
|
244
|
+
${error2}`);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
async function handleSelect(message) {
|
|
248
|
+
const index = messages.indexOf(message);
|
|
249
|
+
const indexFromEnd = messages.length - 1 - index;
|
|
250
|
+
logEvent("tengu_message_selector_selected", {
|
|
251
|
+
index_from_end: indexFromEnd,
|
|
252
|
+
message_type: message.type,
|
|
253
|
+
is_current_prompt: false
|
|
254
|
+
});
|
|
255
|
+
if (!messages.includes(message)) {
|
|
256
|
+
onClose();
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (!isFileHistoryEnabled) {
|
|
260
|
+
await restoreConversationDirectly(message);
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
const diffStats = await fileHistoryGetDiffStats(fileHistory, message.uuid);
|
|
264
|
+
setMessageToRestore(message);
|
|
265
|
+
setDiffStatsForRestore(diffStats);
|
|
266
|
+
}
|
|
267
|
+
async function onSelectRestoreOption(option) {
|
|
268
|
+
logEvent("tengu_message_selector_restore_option_selected", {
|
|
269
|
+
option
|
|
270
|
+
});
|
|
271
|
+
if (!messageToRestore) {
|
|
272
|
+
setError("Message not found.");
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
if (option === "nevermind") {
|
|
276
|
+
if (preselectedMessage)
|
|
277
|
+
onClose();
|
|
278
|
+
else
|
|
279
|
+
setMessageToRestore(undefined);
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
if (isSummarizeOption(option)) {
|
|
283
|
+
onPreRestore();
|
|
284
|
+
setIsRestoring(true);
|
|
285
|
+
setRestoringOption(option);
|
|
286
|
+
setError(undefined);
|
|
287
|
+
try {
|
|
288
|
+
const direction = option === "summarize_up_to" ? "up_to" : "from";
|
|
289
|
+
const feedback = (direction === "up_to" ? summarizeUpToFeedback : summarizeFromFeedback).trim() || undefined;
|
|
290
|
+
await onSummarize(messageToRestore, feedback, direction);
|
|
291
|
+
setIsRestoring(false);
|
|
292
|
+
setRestoringOption(null);
|
|
293
|
+
setMessageToRestore(undefined);
|
|
294
|
+
onClose();
|
|
295
|
+
} catch (error2) {
|
|
296
|
+
logError(error2);
|
|
297
|
+
setIsRestoring(false);
|
|
298
|
+
setRestoringOption(null);
|
|
299
|
+
setMessageToRestore(undefined);
|
|
300
|
+
setError(`Failed to summarize:
|
|
301
|
+
${error2}`);
|
|
302
|
+
}
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
onPreRestore();
|
|
306
|
+
setIsRestoring(true);
|
|
307
|
+
setError(undefined);
|
|
308
|
+
let codeError = null;
|
|
309
|
+
let conversationError = null;
|
|
310
|
+
if (option === "code" || option === "both") {
|
|
311
|
+
try {
|
|
312
|
+
await onRestoreCode(messageToRestore);
|
|
313
|
+
} catch (error2) {
|
|
314
|
+
codeError = error2;
|
|
315
|
+
logError(codeError);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
if (option === "conversation" || option === "both") {
|
|
319
|
+
try {
|
|
320
|
+
await onRestoreMessage(messageToRestore);
|
|
321
|
+
} catch (error2) {
|
|
322
|
+
conversationError = error2;
|
|
323
|
+
logError(conversationError);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
setIsRestoring(false);
|
|
327
|
+
setMessageToRestore(undefined);
|
|
328
|
+
if (conversationError && codeError) {
|
|
329
|
+
setError(`Failed to restore the conversation and code:
|
|
330
|
+
${conversationError}
|
|
331
|
+
${codeError}`);
|
|
332
|
+
} else if (conversationError) {
|
|
333
|
+
setError(`Failed to restore the conversation:
|
|
334
|
+
${conversationError}`);
|
|
335
|
+
} else if (codeError) {
|
|
336
|
+
setError(`Failed to restore the code:
|
|
337
|
+
${codeError}`);
|
|
338
|
+
} else {
|
|
339
|
+
onClose();
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
const exitState = useExitOnCtrlCDWithKeybindings();
|
|
343
|
+
const handleEscape = import_react.useCallback(() => {
|
|
344
|
+
if (messageToRestore && !preselectedMessage) {
|
|
345
|
+
setMessageToRestore(undefined);
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
logEvent("tengu_message_selector_cancelled", {});
|
|
349
|
+
onClose();
|
|
350
|
+
}, [onClose, messageToRestore, preselectedMessage]);
|
|
351
|
+
const moveUp = import_react.useCallback(() => setSelectedIndex((prev) => Math.max(0, prev - 1)), []);
|
|
352
|
+
const moveDown = import_react.useCallback(() => setSelectedIndex((prev) => Math.min(messageOptions.length - 1, prev + 1)), [messageOptions.length]);
|
|
353
|
+
const jumpToTop = import_react.useCallback(() => setSelectedIndex(0), []);
|
|
354
|
+
const jumpToBottom = import_react.useCallback(() => setSelectedIndex(messageOptions.length - 1), [messageOptions.length]);
|
|
355
|
+
const handleSelectCurrent = import_react.useCallback(() => {
|
|
356
|
+
const selected = messageOptions[selectedIndex];
|
|
357
|
+
if (selected) {
|
|
358
|
+
handleSelect(selected);
|
|
359
|
+
}
|
|
360
|
+
}, [messageOptions, selectedIndex, handleSelect]);
|
|
361
|
+
useKeybinding("confirm:no", handleEscape, {
|
|
362
|
+
context: "Confirmation",
|
|
363
|
+
isActive: !messageToRestore
|
|
364
|
+
});
|
|
365
|
+
useKeybindings({
|
|
366
|
+
"messageSelector:up": moveUp,
|
|
367
|
+
"messageSelector:down": moveDown,
|
|
368
|
+
"messageSelector:top": jumpToTop,
|
|
369
|
+
"messageSelector:bottom": jumpToBottom,
|
|
370
|
+
"messageSelector:select": handleSelectCurrent
|
|
371
|
+
}, {
|
|
372
|
+
context: "MessageSelector",
|
|
373
|
+
isActive: !isRestoring && !error && !messageToRestore && hasMessagesToSelect
|
|
374
|
+
});
|
|
375
|
+
const [fileHistoryMetadata, setFileHistoryMetadata] = import_react.useState({});
|
|
376
|
+
import_react.useEffect(() => {
|
|
377
|
+
async function loadFileHistoryMetadata() {
|
|
378
|
+
if (!isFileHistoryEnabled) {
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
Promise.all(messageOptions.map(async (userMessage, itemIndex) => {
|
|
382
|
+
if (userMessage.uuid !== currentUUID) {
|
|
383
|
+
const canRestore = fileHistoryCanRestore(fileHistory, userMessage.uuid);
|
|
384
|
+
const nextUserMessage = messageOptions.at(itemIndex + 1);
|
|
385
|
+
const diffStats = canRestore ? computeDiffStatsBetweenMessages(messages, userMessage.uuid, nextUserMessage?.uuid !== currentUUID ? nextUserMessage?.uuid : undefined) : undefined;
|
|
386
|
+
if (diffStats !== undefined) {
|
|
387
|
+
setFileHistoryMetadata((prev) => ({
|
|
388
|
+
...prev,
|
|
389
|
+
[itemIndex]: diffStats
|
|
390
|
+
}));
|
|
391
|
+
} else {
|
|
392
|
+
setFileHistoryMetadata((prev) => ({
|
|
393
|
+
...prev,
|
|
394
|
+
[itemIndex]: undefined
|
|
395
|
+
}));
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}));
|
|
399
|
+
}
|
|
400
|
+
loadFileHistoryMetadata();
|
|
401
|
+
}, [messageOptions, messages, currentUUID, fileHistory, isFileHistoryEnabled]);
|
|
402
|
+
const canRestoreCode = isFileHistoryEnabled && diffStatsForRestore?.filesChanged && diffStatsForRestore.filesChanged.length > 0;
|
|
403
|
+
const showPickList = !error && !messageToRestore && !preselectedMessage && hasMessagesToSelect;
|
|
404
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
405
|
+
flexDirection: "column",
|
|
406
|
+
width: "100%",
|
|
407
|
+
children: [
|
|
408
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(Divider, {
|
|
409
|
+
color: "suggestion"
|
|
410
|
+
}, undefined, false, undefined, this),
|
|
411
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
412
|
+
flexDirection: "column",
|
|
413
|
+
marginX: 1,
|
|
414
|
+
gap: 1,
|
|
415
|
+
children: [
|
|
416
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
417
|
+
bold: true,
|
|
418
|
+
color: "suggestion",
|
|
419
|
+
children: "Rewind"
|
|
420
|
+
}, undefined, false, undefined, this),
|
|
421
|
+
error && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
422
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
423
|
+
color: "error",
|
|
424
|
+
children: [
|
|
425
|
+
"Error: ",
|
|
426
|
+
error
|
|
427
|
+
]
|
|
428
|
+
}, undefined, true, undefined, this)
|
|
429
|
+
}, undefined, false, undefined, this),
|
|
430
|
+
!hasMessagesToSelect && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
431
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
432
|
+
children: "Nothing to rewind to yet."
|
|
433
|
+
}, undefined, false, undefined, this)
|
|
434
|
+
}, undefined, false, undefined, this),
|
|
435
|
+
!error && messageToRestore && hasMessagesToSelect && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
436
|
+
children: [
|
|
437
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
438
|
+
children: [
|
|
439
|
+
"Confirm you want to restore",
|
|
440
|
+
" ",
|
|
441
|
+
!diffStatsForRestore && "the conversation ",
|
|
442
|
+
"to the point before you sent this message:"
|
|
443
|
+
]
|
|
444
|
+
}, undefined, true, undefined, this),
|
|
445
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
446
|
+
flexDirection: "column",
|
|
447
|
+
paddingLeft: 1,
|
|
448
|
+
borderStyle: "single",
|
|
449
|
+
borderRight: false,
|
|
450
|
+
borderTop: false,
|
|
451
|
+
borderBottom: false,
|
|
452
|
+
borderLeft: true,
|
|
453
|
+
borderLeftDimColor: true,
|
|
454
|
+
children: [
|
|
455
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(UserMessageOption, {
|
|
456
|
+
userMessage: messageToRestore,
|
|
457
|
+
color: "text",
|
|
458
|
+
isCurrent: false
|
|
459
|
+
}, undefined, false, undefined, this),
|
|
460
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
461
|
+
dimColor: true,
|
|
462
|
+
children: [
|
|
463
|
+
"(",
|
|
464
|
+
formatRelativeTimeAgo(new Date(messageToRestore.timestamp)),
|
|
465
|
+
")"
|
|
466
|
+
]
|
|
467
|
+
}, undefined, true, undefined, this)
|
|
468
|
+
]
|
|
469
|
+
}, undefined, true, undefined, this),
|
|
470
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(RestoreOptionDescription, {
|
|
471
|
+
selectedRestoreOption,
|
|
472
|
+
canRestoreCode: !!canRestoreCode,
|
|
473
|
+
diffStatsForRestore
|
|
474
|
+
}, undefined, false, undefined, this),
|
|
475
|
+
isRestoring && isSummarizeOption(restoringOption) ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
476
|
+
flexDirection: "row",
|
|
477
|
+
gap: 1,
|
|
478
|
+
children: [
|
|
479
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(Spinner, {}, undefined, false, undefined, this),
|
|
480
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
481
|
+
children: "Summarizing\u2026"
|
|
482
|
+
}, undefined, false, undefined, this)
|
|
483
|
+
]
|
|
484
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Select, {
|
|
485
|
+
isDisabled: isRestoring,
|
|
486
|
+
options: getRestoreOptions(!!canRestoreCode),
|
|
487
|
+
defaultFocusValue: canRestoreCode ? "both" : "conversation",
|
|
488
|
+
onFocus: (value) => setSelectedRestoreOption(value),
|
|
489
|
+
onChange: (value) => onSelectRestoreOption(value),
|
|
490
|
+
onCancel: () => preselectedMessage ? onClose() : setMessageToRestore(undefined)
|
|
491
|
+
}, undefined, false, undefined, this),
|
|
492
|
+
canRestoreCode && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
493
|
+
marginBottom: 1,
|
|
494
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
495
|
+
dimColor: true,
|
|
496
|
+
children: [
|
|
497
|
+
figures_default.warning,
|
|
498
|
+
" Rewinding does not affect files edited manually or via bash."
|
|
499
|
+
]
|
|
500
|
+
}, undefined, true, undefined, this)
|
|
501
|
+
}, undefined, false, undefined, this)
|
|
502
|
+
]
|
|
503
|
+
}, undefined, true, undefined, this),
|
|
504
|
+
showPickList && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
505
|
+
children: [
|
|
506
|
+
isFileHistoryEnabled ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
507
|
+
children: "Restore the code and/or conversation to the point before\u2026"
|
|
508
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
509
|
+
children: "Restore and fork the conversation to the point before\u2026"
|
|
510
|
+
}, undefined, false, undefined, this),
|
|
511
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
512
|
+
width: "100%",
|
|
513
|
+
flexDirection: "column",
|
|
514
|
+
children: messageOptions.slice(firstVisibleIndex, firstVisibleIndex + MAX_VISIBLE_MESSAGES).map((msg, visibleOptionIndex) => {
|
|
515
|
+
const optionIndex = firstVisibleIndex + visibleOptionIndex;
|
|
516
|
+
const isSelected = optionIndex === selectedIndex;
|
|
517
|
+
const isCurrent = msg.uuid === currentUUID;
|
|
518
|
+
const metadataLoaded = optionIndex in fileHistoryMetadata;
|
|
519
|
+
const metadata = fileHistoryMetadata[optionIndex];
|
|
520
|
+
const numFilesChanged = metadata?.filesChanged && metadata.filesChanged.length;
|
|
521
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
522
|
+
height: isFileHistoryEnabled ? 3 : 2,
|
|
523
|
+
overflow: "hidden",
|
|
524
|
+
width: "100%",
|
|
525
|
+
flexDirection: "row",
|
|
526
|
+
children: [
|
|
527
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
528
|
+
width: 2,
|
|
529
|
+
minWidth: 2,
|
|
530
|
+
children: isSelected ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
531
|
+
color: "permission",
|
|
532
|
+
bold: true,
|
|
533
|
+
children: [
|
|
534
|
+
figures_default.pointer,
|
|
535
|
+
" "
|
|
536
|
+
]
|
|
537
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
538
|
+
children: " "
|
|
539
|
+
}, undefined, false, undefined, this)
|
|
540
|
+
}, undefined, false, undefined, this),
|
|
541
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
542
|
+
flexDirection: "column",
|
|
543
|
+
children: [
|
|
544
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
545
|
+
flexShrink: 1,
|
|
546
|
+
height: 1,
|
|
547
|
+
overflow: "hidden",
|
|
548
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(UserMessageOption, {
|
|
549
|
+
userMessage: msg,
|
|
550
|
+
color: isSelected ? "suggestion" : undefined,
|
|
551
|
+
isCurrent,
|
|
552
|
+
paddingRight: 10
|
|
553
|
+
}, undefined, false, undefined, this)
|
|
554
|
+
}, undefined, false, undefined, this),
|
|
555
|
+
isFileHistoryEnabled && metadataLoaded && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
556
|
+
height: 1,
|
|
557
|
+
flexDirection: "row",
|
|
558
|
+
children: metadata ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
559
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
560
|
+
dimColor: !isSelected,
|
|
561
|
+
color: "inactive",
|
|
562
|
+
children: numFilesChanged ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
563
|
+
children: [
|
|
564
|
+
numFilesChanged === 1 && metadata.filesChanged[0] ? `${path.basename(metadata.filesChanged[0])} ` : `${numFilesChanged} files changed `,
|
|
565
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(DiffStatsText, {
|
|
566
|
+
diffStats: metadata
|
|
567
|
+
}, undefined, false, undefined, this)
|
|
568
|
+
]
|
|
569
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
570
|
+
children: "No code changes"
|
|
571
|
+
}, undefined, false, undefined, this)
|
|
572
|
+
}, undefined, false, undefined, this)
|
|
573
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
574
|
+
dimColor: true,
|
|
575
|
+
color: "warning",
|
|
576
|
+
children: [
|
|
577
|
+
figures_default.warning,
|
|
578
|
+
" No code restore"
|
|
579
|
+
]
|
|
580
|
+
}, undefined, true, undefined, this)
|
|
581
|
+
}, undefined, false, undefined, this)
|
|
582
|
+
]
|
|
583
|
+
}, undefined, true, undefined, this)
|
|
584
|
+
]
|
|
585
|
+
}, msg.uuid, true, undefined, this);
|
|
586
|
+
})
|
|
587
|
+
}, undefined, false, undefined, this)
|
|
588
|
+
]
|
|
589
|
+
}, undefined, true, undefined, this),
|
|
590
|
+
!messageToRestore && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
591
|
+
dimColor: true,
|
|
592
|
+
italic: true,
|
|
593
|
+
children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
594
|
+
children: [
|
|
595
|
+
"Press ",
|
|
596
|
+
exitState.keyName,
|
|
597
|
+
" again to exit"
|
|
598
|
+
]
|
|
599
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
600
|
+
children: [
|
|
601
|
+
!error && hasMessagesToSelect && "Enter to continue \xB7 ",
|
|
602
|
+
"Esc to exit"
|
|
603
|
+
]
|
|
604
|
+
}, undefined, true, undefined, this)
|
|
605
|
+
}, undefined, false, undefined, this)
|
|
606
|
+
]
|
|
607
|
+
}, undefined, true, undefined, this)
|
|
608
|
+
]
|
|
609
|
+
}, undefined, true, undefined, this);
|
|
610
|
+
}
|
|
611
|
+
function getRestoreOptionConversationText(option) {
|
|
612
|
+
switch (option) {
|
|
613
|
+
case "summarize":
|
|
614
|
+
return "Messages after this point will be summarized.";
|
|
615
|
+
case "summarize_up_to":
|
|
616
|
+
return "Preceding messages will be summarized. This and subsequent messages will remain unchanged \u2014 you will stay at the end of the conversation.";
|
|
617
|
+
case "both":
|
|
618
|
+
case "conversation":
|
|
619
|
+
return "The conversation will be forked.";
|
|
620
|
+
case "code":
|
|
621
|
+
case "nevermind":
|
|
622
|
+
return "The conversation will be unchanged.";
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
function RestoreOptionDescription({
|
|
626
|
+
selectedRestoreOption,
|
|
627
|
+
canRestoreCode,
|
|
628
|
+
diffStatsForRestore
|
|
629
|
+
}) {
|
|
630
|
+
const showCodeRestore = canRestoreCode && (selectedRestoreOption === "both" || selectedRestoreOption === "code");
|
|
631
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
632
|
+
flexDirection: "column",
|
|
633
|
+
children: [
|
|
634
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
635
|
+
dimColor: true,
|
|
636
|
+
children: getRestoreOptionConversationText(selectedRestoreOption)
|
|
637
|
+
}, undefined, false, undefined, this),
|
|
638
|
+
!isSummarizeOption(selectedRestoreOption) && (showCodeRestore ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(RestoreCodeConfirmation, {
|
|
639
|
+
diffStatsForRestore
|
|
640
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
641
|
+
dimColor: true,
|
|
642
|
+
children: "The code will be unchanged."
|
|
643
|
+
}, undefined, false, undefined, this))
|
|
644
|
+
]
|
|
645
|
+
}, undefined, true, undefined, this);
|
|
646
|
+
}
|
|
647
|
+
function RestoreCodeConfirmation({
|
|
648
|
+
diffStatsForRestore
|
|
649
|
+
}) {
|
|
650
|
+
if (diffStatsForRestore === undefined) {
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
if (!diffStatsForRestore.filesChanged || !diffStatsForRestore.filesChanged[0]) {
|
|
654
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
655
|
+
dimColor: true,
|
|
656
|
+
children: "The code has not changed (nothing will be restored)."
|
|
657
|
+
}, undefined, false, undefined, this);
|
|
658
|
+
}
|
|
659
|
+
const numFilesChanged = diffStatsForRestore.filesChanged.length;
|
|
660
|
+
let fileLabel = "";
|
|
661
|
+
if (numFilesChanged === 1) {
|
|
662
|
+
fileLabel = path.basename(diffStatsForRestore.filesChanged[0] || "");
|
|
663
|
+
} else if (numFilesChanged === 2) {
|
|
664
|
+
const file1 = path.basename(diffStatsForRestore.filesChanged[0] || "");
|
|
665
|
+
const file2 = path.basename(diffStatsForRestore.filesChanged[1] || "");
|
|
666
|
+
fileLabel = `${file1} and ${file2}`;
|
|
667
|
+
} else {
|
|
668
|
+
const file1 = path.basename(diffStatsForRestore.filesChanged[0] || "");
|
|
669
|
+
fileLabel = `${file1} and ${diffStatsForRestore.filesChanged.length - 1} other files`;
|
|
670
|
+
}
|
|
671
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
672
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
673
|
+
dimColor: true,
|
|
674
|
+
children: [
|
|
675
|
+
"The code will be restored",
|
|
676
|
+
" ",
|
|
677
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(DiffStatsText, {
|
|
678
|
+
diffStats: diffStatsForRestore
|
|
679
|
+
}, undefined, false, undefined, this),
|
|
680
|
+
" in ",
|
|
681
|
+
fileLabel,
|
|
682
|
+
"."
|
|
683
|
+
]
|
|
684
|
+
}, undefined, true, undefined, this)
|
|
685
|
+
}, undefined, false, undefined, this);
|
|
686
|
+
}
|
|
687
|
+
function DiffStatsText({
|
|
688
|
+
diffStats
|
|
689
|
+
}) {
|
|
690
|
+
if (!diffStats || !diffStats.filesChanged) {
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
|
694
|
+
children: [
|
|
695
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
696
|
+
color: "diffAddedWord",
|
|
697
|
+
children: [
|
|
698
|
+
"+",
|
|
699
|
+
diffStats.insertions,
|
|
700
|
+
" "
|
|
701
|
+
]
|
|
702
|
+
}, undefined, true, undefined, this),
|
|
703
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
704
|
+
color: "diffRemovedWord",
|
|
705
|
+
children: [
|
|
706
|
+
"-",
|
|
707
|
+
diffStats.deletions
|
|
708
|
+
]
|
|
709
|
+
}, undefined, true, undefined, this)
|
|
710
|
+
]
|
|
711
|
+
}, undefined, true, undefined, this);
|
|
712
|
+
}
|
|
713
|
+
function UserMessageOption({
|
|
714
|
+
userMessage,
|
|
715
|
+
color,
|
|
716
|
+
dimColor,
|
|
717
|
+
isCurrent,
|
|
718
|
+
paddingRight
|
|
719
|
+
}) {
|
|
720
|
+
const { columns } = useTerminalSize();
|
|
721
|
+
if (isCurrent) {
|
|
722
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
723
|
+
width: "100%",
|
|
724
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
725
|
+
italic: true,
|
|
726
|
+
color,
|
|
727
|
+
dimColor,
|
|
728
|
+
children: "(current)"
|
|
729
|
+
}, undefined, false, undefined, this)
|
|
730
|
+
}, undefined, false, undefined, this);
|
|
731
|
+
}
|
|
732
|
+
const content = userMessage.message.content;
|
|
733
|
+
const lastBlock = typeof content === "string" ? null : content[content.length - 1];
|
|
734
|
+
const rawMessageText = typeof content === "string" ? content.trim() : lastBlock && isTextBlock(lastBlock) ? lastBlock.text.trim() : "(no prompt)";
|
|
735
|
+
const messageText = stripDisplayTags(rawMessageText);
|
|
736
|
+
if (isEmptyMessageText(messageText)) {
|
|
737
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
738
|
+
flexDirection: "row",
|
|
739
|
+
width: "100%",
|
|
740
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
741
|
+
italic: true,
|
|
742
|
+
color,
|
|
743
|
+
dimColor,
|
|
744
|
+
children: "((empty message))"
|
|
745
|
+
}, undefined, false, undefined, this)
|
|
746
|
+
}, undefined, false, undefined, this);
|
|
747
|
+
}
|
|
748
|
+
if (messageText.includes("<bash-input>")) {
|
|
749
|
+
const input = extractTag(messageText, "bash-input");
|
|
750
|
+
if (input) {
|
|
751
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
752
|
+
flexDirection: "row",
|
|
753
|
+
width: "100%",
|
|
754
|
+
children: [
|
|
755
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
756
|
+
color: "bashBorder",
|
|
757
|
+
children: "!"
|
|
758
|
+
}, undefined, false, undefined, this),
|
|
759
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
760
|
+
color,
|
|
761
|
+
dimColor,
|
|
762
|
+
children: [
|
|
763
|
+
" ",
|
|
764
|
+
input
|
|
765
|
+
]
|
|
766
|
+
}, undefined, true, undefined, this)
|
|
767
|
+
]
|
|
768
|
+
}, undefined, true, undefined, this);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
if (messageText.includes(`<${COMMAND_MESSAGE_TAG}>`)) {
|
|
772
|
+
const commandMessage = extractTag(messageText, COMMAND_MESSAGE_TAG);
|
|
773
|
+
const args = extractTag(messageText, "command-args");
|
|
774
|
+
const isSkillFormat = extractTag(messageText, "skill-format") === "true";
|
|
775
|
+
if (commandMessage) {
|
|
776
|
+
if (isSkillFormat) {
|
|
777
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
778
|
+
flexDirection: "row",
|
|
779
|
+
width: "100%",
|
|
780
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
781
|
+
color,
|
|
782
|
+
dimColor,
|
|
783
|
+
children: [
|
|
784
|
+
"Skill(",
|
|
785
|
+
commandMessage,
|
|
786
|
+
")"
|
|
787
|
+
]
|
|
788
|
+
}, undefined, true, undefined, this)
|
|
789
|
+
}, undefined, false, undefined, this);
|
|
790
|
+
} else {
|
|
791
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
792
|
+
flexDirection: "row",
|
|
793
|
+
width: "100%",
|
|
794
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
795
|
+
color,
|
|
796
|
+
dimColor,
|
|
797
|
+
children: [
|
|
798
|
+
"/",
|
|
799
|
+
commandMessage,
|
|
800
|
+
" ",
|
|
801
|
+
args
|
|
802
|
+
]
|
|
803
|
+
}, undefined, true, undefined, this)
|
|
804
|
+
}, undefined, false, undefined, this);
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
809
|
+
flexDirection: "row",
|
|
810
|
+
width: "100%",
|
|
811
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
812
|
+
color,
|
|
813
|
+
dimColor,
|
|
814
|
+
children: paddingRight ? truncate(messageText, columns - paddingRight, true) : messageText.slice(0, 500).split(`
|
|
815
|
+
`).slice(0, 4).join(`
|
|
816
|
+
`)
|
|
817
|
+
}, undefined, false, undefined, this)
|
|
818
|
+
}, undefined, false, undefined, this);
|
|
819
|
+
}
|
|
820
|
+
function computeDiffStatsBetweenMessages(messages, fromMessageId, toMessageId) {
|
|
821
|
+
const startIndex = messages.findIndex((msg) => msg.uuid === fromMessageId);
|
|
822
|
+
if (startIndex === -1) {
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
let endIndex = toMessageId ? messages.findIndex((msg) => msg.uuid === toMessageId) : messages.length;
|
|
826
|
+
if (endIndex === -1) {
|
|
827
|
+
endIndex = messages.length;
|
|
828
|
+
}
|
|
829
|
+
const filesChanged = [];
|
|
830
|
+
let insertions = 0;
|
|
831
|
+
let deletions = 0;
|
|
832
|
+
for (let i = startIndex + 1;i < endIndex; i++) {
|
|
833
|
+
const msg = messages[i];
|
|
834
|
+
if (!msg || !isToolUseResultMessage(msg)) {
|
|
835
|
+
continue;
|
|
836
|
+
}
|
|
837
|
+
const result = msg.toolUseResult;
|
|
838
|
+
if (!result || !result.filePath || !result.structuredPatch) {
|
|
839
|
+
continue;
|
|
840
|
+
}
|
|
841
|
+
if (!filesChanged.includes(result.filePath)) {
|
|
842
|
+
filesChanged.push(result.filePath);
|
|
843
|
+
}
|
|
844
|
+
try {
|
|
845
|
+
if ("type" in result && result.type === "create") {
|
|
846
|
+
insertions += result.content.split(/\r?\n/).length;
|
|
847
|
+
} else {
|
|
848
|
+
for (const hunk of result.structuredPatch) {
|
|
849
|
+
const additions = count(hunk.lines, (line) => line.startsWith("+"));
|
|
850
|
+
const removals = count(hunk.lines, (line) => line.startsWith("-"));
|
|
851
|
+
insertions += additions;
|
|
852
|
+
deletions += removals;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
} catch {
|
|
856
|
+
continue;
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
return {
|
|
860
|
+
filesChanged,
|
|
861
|
+
insertions,
|
|
862
|
+
deletions
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
function selectableUserMessagesFilter(message) {
|
|
866
|
+
if (message.type !== "user") {
|
|
867
|
+
return false;
|
|
868
|
+
}
|
|
869
|
+
if (Array.isArray(message.message.content) && message.message.content[0]?.type === "tool_result") {
|
|
870
|
+
return false;
|
|
871
|
+
}
|
|
872
|
+
if (isSyntheticMessage(message)) {
|
|
873
|
+
return false;
|
|
874
|
+
}
|
|
875
|
+
if (message.isMeta) {
|
|
876
|
+
return false;
|
|
877
|
+
}
|
|
878
|
+
if (message.isCompactSummary || message.isVisibleInTranscriptOnly) {
|
|
879
|
+
return false;
|
|
880
|
+
}
|
|
881
|
+
const content = message.message.content;
|
|
882
|
+
const lastBlock = typeof content === "string" ? null : content[content.length - 1];
|
|
883
|
+
const messageText = typeof content === "string" ? content.trim() : lastBlock && isTextBlock(lastBlock) ? lastBlock.text.trim() : "";
|
|
884
|
+
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) {
|
|
885
|
+
return false;
|
|
886
|
+
}
|
|
887
|
+
return true;
|
|
888
|
+
}
|
|
889
|
+
function messagesAfterAreOnlySynthetic(messages, fromIndex) {
|
|
890
|
+
for (let i = fromIndex + 1;i < messages.length; i++) {
|
|
891
|
+
const msg = messages[i];
|
|
892
|
+
if (!msg)
|
|
893
|
+
continue;
|
|
894
|
+
if (isSyntheticMessage(msg))
|
|
895
|
+
continue;
|
|
896
|
+
if (isToolUseResultMessage(msg))
|
|
897
|
+
continue;
|
|
898
|
+
if (msg.type === "progress")
|
|
899
|
+
continue;
|
|
900
|
+
if (msg.type === "system")
|
|
901
|
+
continue;
|
|
902
|
+
if (msg.type === "attachment")
|
|
903
|
+
continue;
|
|
904
|
+
if (msg.type === "user" && msg.isMeta)
|
|
905
|
+
continue;
|
|
906
|
+
if (msg.type === "assistant") {
|
|
907
|
+
const content = msg.message.content;
|
|
908
|
+
if (Array.isArray(content)) {
|
|
909
|
+
const hasMeaningfulContent = content.some((block) => block.type === "text" && block.text.trim() || block.type === "tool_use");
|
|
910
|
+
if (hasMeaningfulContent)
|
|
911
|
+
return false;
|
|
912
|
+
}
|
|
913
|
+
continue;
|
|
914
|
+
}
|
|
915
|
+
if (msg.type === "user") {
|
|
916
|
+
return false;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
return true;
|
|
920
|
+
}
|
|
921
|
+
var import_react, jsx_dev_runtime, MAX_VISIBLE_MESSAGES = 7;
|
|
922
|
+
var init_MessageSelector = __esm(() => {
|
|
923
|
+
init_figures();
|
|
924
|
+
init_analytics();
|
|
925
|
+
init_AppState();
|
|
926
|
+
init_fileHistory();
|
|
927
|
+
init_log();
|
|
928
|
+
init_useExitOnCtrlCDWithKeybindings();
|
|
929
|
+
init_src();
|
|
930
|
+
init_useKeybinding();
|
|
931
|
+
init_displayTags();
|
|
932
|
+
init_messages();
|
|
933
|
+
init_select();
|
|
934
|
+
init_Spinner();
|
|
935
|
+
init_useTerminalSize();
|
|
936
|
+
init_xml();
|
|
937
|
+
init_array();
|
|
938
|
+
init_format();
|
|
939
|
+
import_react = __toESM(require_react(), 1);
|
|
940
|
+
jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
|
|
941
|
+
});
|
|
942
|
+
|
|
943
|
+
// src/utils/ultraplan/keyword.ts
|
|
944
|
+
var OPEN_TO_CLOSE = {
|
|
945
|
+
"`": "`",
|
|
946
|
+
'"': '"',
|
|
947
|
+
"<": ">",
|
|
948
|
+
"{": "}",
|
|
949
|
+
"[": "]",
|
|
950
|
+
"(": ")",
|
|
951
|
+
"'": "'"
|
|
952
|
+
};
|
|
953
|
+
function findKeywordTriggerPositions(text, keyword) {
|
|
954
|
+
const re = new RegExp(keyword, "i");
|
|
955
|
+
if (!re.test(text))
|
|
956
|
+
return [];
|
|
957
|
+
if (text.startsWith("/"))
|
|
958
|
+
return [];
|
|
959
|
+
const quotedRanges = [];
|
|
960
|
+
let openQuote = null;
|
|
961
|
+
let openAt = 0;
|
|
962
|
+
const isWord = (ch) => !!ch && /[\p{L}\p{N}_]/u.test(ch);
|
|
963
|
+
for (let i = 0;i < text.length; i++) {
|
|
964
|
+
const ch = text[i];
|
|
965
|
+
if (openQuote) {
|
|
966
|
+
if (openQuote === "[" && ch === "[") {
|
|
967
|
+
openAt = i;
|
|
968
|
+
continue;
|
|
969
|
+
}
|
|
970
|
+
if (ch !== OPEN_TO_CLOSE[openQuote])
|
|
971
|
+
continue;
|
|
972
|
+
if (openQuote === "'" && isWord(text[i + 1]))
|
|
973
|
+
continue;
|
|
974
|
+
quotedRanges.push({ start: openAt, end: i + 1 });
|
|
975
|
+
openQuote = null;
|
|
976
|
+
} 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) {
|
|
977
|
+
openQuote = ch;
|
|
978
|
+
openAt = i;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
const positions = [];
|
|
982
|
+
const wordRe = new RegExp(`\\b${keyword}\\b`, "gi");
|
|
983
|
+
const matches = text.matchAll(wordRe);
|
|
984
|
+
for (const match of matches) {
|
|
985
|
+
if (match.index === undefined)
|
|
986
|
+
continue;
|
|
987
|
+
const start = match.index;
|
|
988
|
+
const end = start + match[0].length;
|
|
989
|
+
if (quotedRanges.some((r) => start >= r.start && start < r.end))
|
|
990
|
+
continue;
|
|
991
|
+
const before = text[start - 1];
|
|
992
|
+
const after = text[end];
|
|
993
|
+
if (before === "/" || before === "\\" || before === "-")
|
|
994
|
+
continue;
|
|
995
|
+
if (after === "/" || after === "\\" || after === "-" || after === "?")
|
|
996
|
+
continue;
|
|
997
|
+
if (after === "." && isWord(text[end + 1]))
|
|
998
|
+
continue;
|
|
999
|
+
positions.push({ word: match[0], start, end });
|
|
1000
|
+
}
|
|
1001
|
+
return positions;
|
|
1002
|
+
}
|
|
1003
|
+
function findUltraplanTriggerPositions(text) {
|
|
1004
|
+
return findKeywordTriggerPositions(text, "ultraplan");
|
|
1005
|
+
}
|
|
1006
|
+
function findUltrareviewTriggerPositions(text) {
|
|
1007
|
+
return findKeywordTriggerPositions(text, "ultrareview");
|
|
1008
|
+
}
|
|
1009
|
+
function hasUltraplanKeyword(text) {
|
|
1010
|
+
return findUltraplanTriggerPositions(text).length > 0;
|
|
1011
|
+
}
|
|
1012
|
+
function replaceUltraplanKeyword(text) {
|
|
1013
|
+
const [trigger] = findUltraplanTriggerPositions(text);
|
|
1014
|
+
if (!trigger)
|
|
1015
|
+
return text;
|
|
1016
|
+
const before = text.slice(0, trigger.start);
|
|
1017
|
+
const after = text.slice(trigger.end);
|
|
1018
|
+
if (!(before + after).trim())
|
|
1019
|
+
return "";
|
|
1020
|
+
return before + trigger.word.slice("ultra".length) + after;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
// src/utils/processUserInput/processUserInput.ts
|
|
1024
|
+
init_analytics();
|
|
1025
|
+
init_messages();
|
|
1026
|
+
init_commands();
|
|
1027
|
+
init_textInputTypes();
|
|
1028
|
+
init_attachments();
|
|
1029
|
+
init_generators();
|
|
1030
|
+
init_hooks();
|
|
1031
|
+
init_imageResizer();
|
|
1032
|
+
init_imageStore();
|
|
1033
|
+
init_messages();
|
|
1034
|
+
init_queryProfiler();
|
|
1035
|
+
init_slashCommandParsing();
|
|
1036
|
+
import { randomUUID as randomUUID3 } from "crypto";
|
|
1037
|
+
|
|
1038
|
+
// src/utils/processUserInput/processTextPrompt.ts
|
|
1039
|
+
init_state();
|
|
1040
|
+
init_analytics();
|
|
1041
|
+
init_messages();
|
|
1042
|
+
init_events();
|
|
1043
|
+
init_sessionTracing();
|
|
1044
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
1045
|
+
|
|
1046
|
+
// src/utils/userPromptKeywords.ts
|
|
1047
|
+
function matchesNegativeKeyword(input) {
|
|
1048
|
+
const lowerInput = input.toLowerCase();
|
|
1049
|
+
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/;
|
|
1050
|
+
return negativePattern.test(lowerInput);
|
|
1051
|
+
}
|
|
1052
|
+
function matchesKeepGoingKeyword(input) {
|
|
1053
|
+
const lowerInput = input.toLowerCase().trim();
|
|
1054
|
+
if (lowerInput === "continue") {
|
|
1055
|
+
return true;
|
|
1056
|
+
}
|
|
1057
|
+
const keepGoingPattern = /\b(keep going|go on)\b/;
|
|
1058
|
+
return keepGoingPattern.test(lowerInput);
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
// src/utils/processUserInput/processTextPrompt.ts
|
|
1062
|
+
function processTextPrompt(input, imageContentBlocks, imagePasteIds, attachmentMessages, uuid, permissionMode, isMeta) {
|
|
1063
|
+
const promptId = randomUUID2();
|
|
1064
|
+
setPromptId(promptId);
|
|
1065
|
+
const userPromptText = typeof input === "string" ? input : input.find((block) => block.type === "text")?.text || "";
|
|
1066
|
+
startInteractionSpan(userPromptText);
|
|
1067
|
+
const otelPromptText = typeof input === "string" ? input : input.findLast((block) => block.type === "text")?.text || "";
|
|
1068
|
+
if (otelPromptText) {
|
|
1069
|
+
logOTelEvent("user_prompt", {
|
|
1070
|
+
prompt_length: String(otelPromptText.length),
|
|
1071
|
+
prompt: redactIfDisabled(otelPromptText),
|
|
1072
|
+
"prompt.id": promptId
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
const isNegative = matchesNegativeKeyword(userPromptText);
|
|
1076
|
+
const isKeepGoing = matchesKeepGoingKeyword(userPromptText);
|
|
1077
|
+
logEvent("tengu_input_prompt", {
|
|
1078
|
+
is_negative: isNegative,
|
|
1079
|
+
is_keep_going: isKeepGoing
|
|
1080
|
+
});
|
|
1081
|
+
if (imageContentBlocks.length > 0) {
|
|
1082
|
+
const textContent = typeof input === "string" ? input.trim() ? [{ type: "text", text: input }] : [] : input;
|
|
1083
|
+
const userMessage2 = createUserMessage({
|
|
1084
|
+
content: [...textContent, ...imageContentBlocks],
|
|
1085
|
+
uuid,
|
|
1086
|
+
imagePasteIds: imagePasteIds.length > 0 ? imagePasteIds : undefined,
|
|
1087
|
+
permissionMode,
|
|
1088
|
+
isMeta: isMeta || undefined
|
|
1089
|
+
});
|
|
1090
|
+
return {
|
|
1091
|
+
messages: [userMessage2, ...attachmentMessages],
|
|
1092
|
+
shouldQuery: true
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
const userMessage = createUserMessage({
|
|
1096
|
+
content: input,
|
|
1097
|
+
uuid,
|
|
1098
|
+
permissionMode,
|
|
1099
|
+
isMeta: isMeta || undefined
|
|
1100
|
+
});
|
|
1101
|
+
return {
|
|
1102
|
+
messages: [userMessage, ...attachmentMessages],
|
|
1103
|
+
shouldQuery: true
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
// src/utils/processUserInput/processUserInput.ts
|
|
1108
|
+
async function processUserInput({
|
|
1109
|
+
input,
|
|
1110
|
+
preExpansionInput,
|
|
1111
|
+
mode,
|
|
1112
|
+
setToolJSX,
|
|
1113
|
+
context,
|
|
1114
|
+
pastedContents,
|
|
1115
|
+
ideSelection,
|
|
1116
|
+
messages,
|
|
1117
|
+
setUserInputOnProcessing,
|
|
1118
|
+
uuid,
|
|
1119
|
+
isAlreadyProcessing,
|
|
1120
|
+
querySource,
|
|
1121
|
+
canUseTool,
|
|
1122
|
+
skipSlashCommands,
|
|
1123
|
+
bridgeOrigin,
|
|
1124
|
+
isMeta,
|
|
1125
|
+
skipAttachments
|
|
1126
|
+
}) {
|
|
1127
|
+
const inputString = typeof input === "string" ? input : null;
|
|
1128
|
+
if (mode === "prompt" && inputString !== null && !isMeta) {
|
|
1129
|
+
setUserInputOnProcessing?.(inputString);
|
|
1130
|
+
}
|
|
1131
|
+
queryCheckpoint("query_process_user_input_base_start");
|
|
1132
|
+
const appState = context.getAppState();
|
|
1133
|
+
const result = await processUserInputBase(input, mode, setToolJSX, context, pastedContents, ideSelection, messages, uuid, isAlreadyProcessing, querySource, canUseTool, appState.toolPermissionContext.mode, skipSlashCommands, bridgeOrigin, isMeta, skipAttachments, preExpansionInput);
|
|
1134
|
+
queryCheckpoint("query_process_user_input_base_end");
|
|
1135
|
+
if (!result.shouldQuery) {
|
|
1136
|
+
return result;
|
|
1137
|
+
}
|
|
1138
|
+
queryCheckpoint("query_hooks_start");
|
|
1139
|
+
const inputMessage = getContentText(input) || "";
|
|
1140
|
+
for await (const hookResult of executeUserPromptSubmitHooks(inputMessage, appState.toolPermissionContext.mode, context, context.requestPrompt)) {
|
|
1141
|
+
if (hookResult.message?.type === "progress") {
|
|
1142
|
+
continue;
|
|
1143
|
+
}
|
|
1144
|
+
if (hookResult.blockingError) {
|
|
1145
|
+
const blockingMessage = getUserPromptSubmitHookBlockingMessage(hookResult.blockingError);
|
|
1146
|
+
return {
|
|
1147
|
+
messages: [
|
|
1148
|
+
createSystemMessage(`${blockingMessage}
|
|
1149
|
+
|
|
1150
|
+
Original prompt: ${input}`, "warning")
|
|
1151
|
+
],
|
|
1152
|
+
shouldQuery: false,
|
|
1153
|
+
allowedTools: result.allowedTools
|
|
1154
|
+
};
|
|
1155
|
+
}
|
|
1156
|
+
if (hookResult.preventContinuation) {
|
|
1157
|
+
const message = hookResult.stopReason ? `Operation stopped by hook: ${hookResult.stopReason}` : "Operation stopped by hook";
|
|
1158
|
+
result.messages.push(createUserMessage({
|
|
1159
|
+
content: message
|
|
1160
|
+
}));
|
|
1161
|
+
result.shouldQuery = false;
|
|
1162
|
+
return result;
|
|
1163
|
+
}
|
|
1164
|
+
if (hookResult.additionalContexts && hookResult.additionalContexts.length > 0) {
|
|
1165
|
+
result.messages.push(createAttachmentMessage({
|
|
1166
|
+
type: "hook_additional_context",
|
|
1167
|
+
content: hookResult.additionalContexts.map(applyTruncation),
|
|
1168
|
+
hookName: "UserPromptSubmit",
|
|
1169
|
+
toolUseID: `hook-${randomUUID3()}`,
|
|
1170
|
+
hookEvent: "UserPromptSubmit"
|
|
1171
|
+
}));
|
|
1172
|
+
}
|
|
1173
|
+
if (hookResult.message) {
|
|
1174
|
+
switch (hookResult.message.attachment.type) {
|
|
1175
|
+
case "hook_success":
|
|
1176
|
+
if (!hookResult.message.attachment.content) {
|
|
1177
|
+
break;
|
|
1178
|
+
}
|
|
1179
|
+
result.messages.push({
|
|
1180
|
+
...hookResult.message,
|
|
1181
|
+
attachment: {
|
|
1182
|
+
...hookResult.message.attachment,
|
|
1183
|
+
content: applyTruncation(hookResult.message.attachment.content)
|
|
1184
|
+
}
|
|
1185
|
+
});
|
|
1186
|
+
break;
|
|
1187
|
+
default:
|
|
1188
|
+
result.messages.push(hookResult.message);
|
|
1189
|
+
break;
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
queryCheckpoint("query_hooks_end");
|
|
1194
|
+
return result;
|
|
1195
|
+
}
|
|
1196
|
+
var MAX_HOOK_OUTPUT_LENGTH = 1e4;
|
|
1197
|
+
function applyTruncation(content) {
|
|
1198
|
+
if (content.length > MAX_HOOK_OUTPUT_LENGTH) {
|
|
1199
|
+
return `${content.substring(0, MAX_HOOK_OUTPUT_LENGTH)}\u2026 [output truncated - exceeded ${MAX_HOOK_OUTPUT_LENGTH} characters]`;
|
|
1200
|
+
}
|
|
1201
|
+
return content;
|
|
1202
|
+
}
|
|
1203
|
+
async function processUserInputBase(input, mode, setToolJSX, context, pastedContents, ideSelection, messages, uuid, isAlreadyProcessing, querySource, canUseTool, permissionMode, skipSlashCommands, bridgeOrigin, isMeta, skipAttachments, preExpansionInput) {
|
|
1204
|
+
let inputString = null;
|
|
1205
|
+
let precedingInputBlocks = [];
|
|
1206
|
+
const imageMetadataTexts = [];
|
|
1207
|
+
let normalizedInput = input;
|
|
1208
|
+
if (typeof input === "string") {
|
|
1209
|
+
inputString = input;
|
|
1210
|
+
} else if (input.length > 0) {
|
|
1211
|
+
queryCheckpoint("query_image_processing_start");
|
|
1212
|
+
const processedBlocks = [];
|
|
1213
|
+
for (const block of input) {
|
|
1214
|
+
if (block.type === "image") {
|
|
1215
|
+
const resized = await maybeResizeAndDownsampleImageBlock(block);
|
|
1216
|
+
if (resized.dimensions) {
|
|
1217
|
+
const metadataText = createImageMetadataText(resized.dimensions);
|
|
1218
|
+
if (metadataText) {
|
|
1219
|
+
imageMetadataTexts.push(metadataText);
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
processedBlocks.push(resized.block);
|
|
1223
|
+
} else {
|
|
1224
|
+
processedBlocks.push(block);
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
normalizedInput = processedBlocks;
|
|
1228
|
+
queryCheckpoint("query_image_processing_end");
|
|
1229
|
+
const lastBlock = processedBlocks[processedBlocks.length - 1];
|
|
1230
|
+
if (lastBlock?.type === "text") {
|
|
1231
|
+
inputString = lastBlock.text;
|
|
1232
|
+
precedingInputBlocks = processedBlocks.slice(0, -1);
|
|
1233
|
+
} else {
|
|
1234
|
+
precedingInputBlocks = processedBlocks;
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
if (inputString === null && mode !== "prompt") {
|
|
1238
|
+
throw new Error(`Mode: ${mode} requires a string input.`);
|
|
1239
|
+
}
|
|
1240
|
+
const imageContents = pastedContents ? Object.values(pastedContents).filter(isValidImagePaste) : [];
|
|
1241
|
+
const imagePasteIds = imageContents.map((img) => img.id);
|
|
1242
|
+
const storedImagePaths = pastedContents ? await storeImages(pastedContents) : new Map;
|
|
1243
|
+
queryCheckpoint("query_pasted_image_processing_start");
|
|
1244
|
+
const imageProcessingResults = await Promise.all(imageContents.map(async (pastedImage) => {
|
|
1245
|
+
const imageBlock = {
|
|
1246
|
+
type: "image",
|
|
1247
|
+
source: {
|
|
1248
|
+
type: "base64",
|
|
1249
|
+
media_type: pastedImage.mediaType || "image/png",
|
|
1250
|
+
data: pastedImage.content
|
|
1251
|
+
}
|
|
1252
|
+
};
|
|
1253
|
+
logEvent("tengu_pasted_image_resize_attempt", {
|
|
1254
|
+
original_size_bytes: pastedImage.content.length
|
|
1255
|
+
});
|
|
1256
|
+
const resized = await maybeResizeAndDownsampleImageBlock(imageBlock);
|
|
1257
|
+
return {
|
|
1258
|
+
resized,
|
|
1259
|
+
originalDimensions: pastedImage.dimensions,
|
|
1260
|
+
sourcePath: pastedImage.sourcePath ?? storedImagePaths.get(pastedImage.id)
|
|
1261
|
+
};
|
|
1262
|
+
}));
|
|
1263
|
+
const imageContentBlocks = [];
|
|
1264
|
+
for (const {
|
|
1265
|
+
resized,
|
|
1266
|
+
originalDimensions,
|
|
1267
|
+
sourcePath
|
|
1268
|
+
} of imageProcessingResults) {
|
|
1269
|
+
if (resized.dimensions) {
|
|
1270
|
+
const metadataText = createImageMetadataText(resized.dimensions, sourcePath);
|
|
1271
|
+
if (metadataText) {
|
|
1272
|
+
imageMetadataTexts.push(metadataText);
|
|
1273
|
+
}
|
|
1274
|
+
} else if (originalDimensions) {
|
|
1275
|
+
const metadataText = createImageMetadataText(originalDimensions, sourcePath);
|
|
1276
|
+
if (metadataText) {
|
|
1277
|
+
imageMetadataTexts.push(metadataText);
|
|
1278
|
+
}
|
|
1279
|
+
} else if (sourcePath) {
|
|
1280
|
+
imageMetadataTexts.push(`[Image source: ${sourcePath}]`);
|
|
1281
|
+
}
|
|
1282
|
+
imageContentBlocks.push(resized.block);
|
|
1283
|
+
}
|
|
1284
|
+
queryCheckpoint("query_pasted_image_processing_end");
|
|
1285
|
+
let effectiveSkipSlash = skipSlashCommands;
|
|
1286
|
+
if (bridgeOrigin && inputString !== null && inputString.startsWith("/")) {
|
|
1287
|
+
const parsed = parseSlashCommand(inputString);
|
|
1288
|
+
const cmd = parsed ? findCommand(parsed.commandName, context.options.commands) : undefined;
|
|
1289
|
+
if (cmd) {
|
|
1290
|
+
if (isBridgeSafeCommand(cmd)) {
|
|
1291
|
+
effectiveSkipSlash = false;
|
|
1292
|
+
} else {
|
|
1293
|
+
const msg = `/${getCommandName(cmd)} isn't available over Remote Control.`;
|
|
1294
|
+
return {
|
|
1295
|
+
messages: [
|
|
1296
|
+
createUserMessage({ content: inputString, uuid }),
|
|
1297
|
+
createCommandInputMessage(`<local-command-stdout>${msg}</local-command-stdout>`)
|
|
1298
|
+
],
|
|
1299
|
+
shouldQuery: false,
|
|
1300
|
+
resultText: msg
|
|
1301
|
+
};
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
if (mode === "prompt" && !context.options.isNonInteractiveSession && inputString !== null && !effectiveSkipSlash && !inputString.startsWith("/") && !context.getAppState().ultraplanSessionUrl && !context.getAppState().ultraplanLaunching && hasUltraplanKeyword(preExpansionInput ?? inputString)) {
|
|
1306
|
+
logEvent("tengu_ultraplan_keyword", {});
|
|
1307
|
+
const rewritten = replaceUltraplanKeyword(inputString).trim();
|
|
1308
|
+
const { processSlashCommand } = await import("./chunk-crvsdcfv.js");
|
|
1309
|
+
const slashResult = await processSlashCommand(`/ultraplan ${rewritten}`, precedingInputBlocks, imageContentBlocks, [], context, setToolJSX, uuid, isAlreadyProcessing, canUseTool);
|
|
1310
|
+
return addImageMetadataMessage(slashResult, imageMetadataTexts);
|
|
1311
|
+
}
|
|
1312
|
+
const shouldExtractAttachments = !skipAttachments && inputString !== null && (mode !== "prompt" || effectiveSkipSlash || !inputString.startsWith("/"));
|
|
1313
|
+
queryCheckpoint("query_attachment_loading_start");
|
|
1314
|
+
const attachmentMessages = shouldExtractAttachments ? await toArray(getAttachmentMessages(inputString, context, ideSelection ?? null, [], messages, querySource)) : [];
|
|
1315
|
+
queryCheckpoint("query_attachment_loading_end");
|
|
1316
|
+
if (inputString !== null && mode === "bash") {
|
|
1317
|
+
const { processBashCommand } = await import("./chunk-mg88phh5.js");
|
|
1318
|
+
return addImageMetadataMessage(await processBashCommand(inputString, precedingInputBlocks, attachmentMessages, context, setToolJSX), imageMetadataTexts);
|
|
1319
|
+
}
|
|
1320
|
+
if (inputString !== null && !effectiveSkipSlash && inputString.startsWith("/")) {
|
|
1321
|
+
const { processSlashCommand } = await import("./chunk-crvsdcfv.js");
|
|
1322
|
+
const slashResult = await processSlashCommand(inputString, precedingInputBlocks, imageContentBlocks, attachmentMessages, context, setToolJSX, uuid, isAlreadyProcessing, canUseTool);
|
|
1323
|
+
return addImageMetadataMessage(slashResult, imageMetadataTexts);
|
|
1324
|
+
}
|
|
1325
|
+
if (inputString !== null && mode === "prompt") {
|
|
1326
|
+
const trimmedInput = inputString.trim();
|
|
1327
|
+
const agentMention = attachmentMessages.find((m) => m.attachment.type === "agent_mention");
|
|
1328
|
+
if (agentMention) {
|
|
1329
|
+
const agentMentionString = `@agent-${agentMention.attachment.agentType}`;
|
|
1330
|
+
const isSubagentOnly = trimmedInput === agentMentionString;
|
|
1331
|
+
const isPrefix = trimmedInput.startsWith(agentMentionString) && !isSubagentOnly;
|
|
1332
|
+
logEvent("tengu_subagent_at_mention", {
|
|
1333
|
+
is_subagent_only: isSubagentOnly,
|
|
1334
|
+
is_prefix: isPrefix
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
return addImageMetadataMessage(processTextPrompt(normalizedInput, imageContentBlocks, imagePasteIds, attachmentMessages, uuid, permissionMode, isMeta), imageMetadataTexts);
|
|
1339
|
+
}
|
|
1340
|
+
function addImageMetadataMessage(result, imageMetadataTexts) {
|
|
1341
|
+
if (imageMetadataTexts.length > 0) {
|
|
1342
|
+
result.messages.push(createUserMessage({
|
|
1343
|
+
content: imageMetadataTexts.map((text) => ({ type: "text", text })),
|
|
1344
|
+
isMeta: true
|
|
1345
|
+
}));
|
|
1346
|
+
}
|
|
1347
|
+
return result;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
// src/utils/messages/systemInit.ts
|
|
1351
|
+
init_state();
|
|
1352
|
+
init_outputStyles();
|
|
1353
|
+
init_constants();
|
|
1354
|
+
init_auth();
|
|
1355
|
+
init_cwd();
|
|
1356
|
+
init_fastMode();
|
|
1357
|
+
init_settings();
|
|
1358
|
+
import { randomUUID as randomUUID4 } from "crypto";
|
|
1359
|
+
function sdkCompatToolName(name) {
|
|
1360
|
+
return name === AGENT_TOOL_NAME ? LEGACY_AGENT_TOOL_NAME : name;
|
|
1361
|
+
}
|
|
1362
|
+
function buildSystemInitMessage(inputs) {
|
|
1363
|
+
const settings = getSettings_DEPRECATED();
|
|
1364
|
+
const outputStyle = settings?.outputStyle ?? DEFAULT_OUTPUT_STYLE_NAME;
|
|
1365
|
+
const initMessage = {
|
|
1366
|
+
type: "system",
|
|
1367
|
+
subtype: "init",
|
|
1368
|
+
cwd: getCwd(),
|
|
1369
|
+
session_id: getSessionId(),
|
|
1370
|
+
tools: inputs.tools.map((tool) => sdkCompatToolName(tool.name)),
|
|
1371
|
+
mcp_servers: inputs.mcpClients.map((client) => ({
|
|
1372
|
+
name: client.name,
|
|
1373
|
+
status: client.type
|
|
1374
|
+
})),
|
|
1375
|
+
model: inputs.model,
|
|
1376
|
+
permissionMode: inputs.permissionMode,
|
|
1377
|
+
slash_commands: inputs.commands.filter((c) => c.userInvocable !== false).map((c) => c.name),
|
|
1378
|
+
apiKeySource: getAnthropicApiKeyWithSource().source,
|
|
1379
|
+
betas: getSdkBetas(),
|
|
1380
|
+
claude_code_version: "2.1.888",
|
|
1381
|
+
output_style: outputStyle,
|
|
1382
|
+
agents: inputs.agents.map((agent) => agent.agentType),
|
|
1383
|
+
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
|
|
1384
|
+
plugins: inputs.plugins.map((plugin) => ({
|
|
1385
|
+
name: plugin.name,
|
|
1386
|
+
path: plugin.path,
|
|
1387
|
+
source: plugin.source
|
|
1388
|
+
})),
|
|
1389
|
+
uuid: randomUUID4()
|
|
1390
|
+
};
|
|
1391
|
+
if (false) {}
|
|
1392
|
+
initMessage.fast_mode_state = getFastModeState(inputs.model, inputs.fastMode);
|
|
1393
|
+
return initMessage;
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
export { findUltraplanTriggerPositions, findUltrareviewTriggerPositions, processUserInput, sdkCompatToolName, buildSystemInitMessage, MessageSelector, selectableUserMessagesFilter, messagesAfterAreOnlySynthetic, exports_MessageSelector, init_MessageSelector };
|