@costrict/csc 4.1.1 → 4.1.2

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.
Files changed (413) hide show
  1. package/dist/{chunk-456jxy81.js → chunk-03g34taj.js} +55 -52
  2. package/dist/{chunk-mdmh4hh4.js → chunk-04h1dzn8.js} +58 -55
  3. package/dist/{chunk-3xwn1ww1.js → chunk-04js9982.js} +14 -14
  4. package/dist/{chunk-gfsh3syp.js → chunk-0cm9fcaq.js} +4 -4
  5. package/dist/{chunk-fnjqn6ez.js → chunk-0d8p649e.js} +200 -1296
  6. package/dist/{chunk-vtwf9pyn.js → chunk-0ftbdtb6.js} +2 -2
  7. package/dist/{chunk-7kznscxn.js → chunk-0kv76cch.js} +69 -66
  8. package/dist/{chunk-cp4da168.js → chunk-0q8601fc.js} +56 -53
  9. package/dist/{chunk-vhnm2h49.js → chunk-0s2qjxt0.js} +2 -2
  10. package/dist/{chunk-wvexwzsv.js → chunk-0vjhwg78.js} +4 -4
  11. package/dist/{chunk-wvh4g9jt.js → chunk-0wfby4jk.js} +55 -52
  12. package/dist/{chunk-d9tcjh43.js → chunk-0wzfz235.js} +55 -52
  13. package/dist/{chunk-8py19hja.js → chunk-0z3swktk.js} +58 -55
  14. package/dist/{chunk-na7nxj7y.js → chunk-0zwtzj7s.js} +4 -4
  15. package/dist/{chunk-304wjbyj.js → chunk-12b1dsca.js} +3 -3
  16. package/dist/{chunk-c05zaj6g.js → chunk-172aq1cm.js} +3 -3
  17. package/dist/{chunk-emvhjwh9.js → chunk-1928vvnf.js} +16 -16
  18. package/dist/{chunk-3yc8k84c.js → chunk-1gta3pqg.js} +26 -1390
  19. package/dist/{chunk-wn11yvgy.js → chunk-1hr30g9j.js} +56 -53
  20. package/dist/{chunk-hyptxmaj.js → chunk-1ta87008.js} +13 -13
  21. package/dist/{chunk-pjvthvm1.js → chunk-1tsg5bqp.js} +7 -7
  22. package/dist/{chunk-9ey1xvcm.js → chunk-1xdybmyp.js} +2 -2
  23. package/dist/{chunk-bz6pjkch.js → chunk-1xqh8b38.js} +2 -2
  24. package/dist/{chunk-p2r92sj1.js → chunk-1z6393pz.js} +55 -52
  25. package/dist/{chunk-js10hr63.js → chunk-20rdctr8.js} +59 -56
  26. package/dist/{chunk-78kph36p.js → chunk-2278qvvz.js} +82 -69
  27. package/dist/{chunk-krmmbjp9.js → chunk-27rca2qk.js} +14 -14
  28. package/dist/{chunk-b1my2ag9.js → chunk-28p3x5mq.js} +58 -55
  29. package/dist/{chunk-5nnjgn3n.js → chunk-29n8fs0h.js} +3 -3
  30. package/dist/{chunk-4xbk1cv1.js → chunk-2bahqsy8.js} +5 -5
  31. package/dist/{chunk-b0hjzm3t.js → chunk-2d4az1sb.js} +1051 -213
  32. package/dist/{chunk-bbm8cs3b.js → chunk-2dtsff0m.js} +2 -2
  33. package/dist/{chunk-hjfabpxk.js → chunk-2dvsb5m8.js} +3 -3
  34. package/dist/{chunk-fkjqakzs.js → chunk-2ea63hn5.js} +55 -52
  35. package/dist/{chunk-tbx1hn1a.js → chunk-2heyngx7.js} +55 -52
  36. package/dist/{chunk-cb3vp4tb.js → chunk-2n4jnkr3.js} +5 -5
  37. package/dist/{chunk-04fesxxb.js → chunk-2npy5n4d.js} +3 -3
  38. package/dist/{chunk-5bw23taw.js → chunk-2yz7ej7r.js} +3 -3
  39. package/dist/{chunk-naenwsts.js → chunk-347n8wrb.js} +56 -53
  40. package/dist/{chunk-qzwja18r.js → chunk-365z3p8q.js} +4 -4
  41. package/dist/{chunk-pathr6ec.js → chunk-3ax3g4ky.js} +5 -5
  42. package/dist/{chunk-6nqv04m4.js → chunk-3c22f5y8.js} +4 -4
  43. package/dist/{chunk-5x884kq9.js → chunk-3ed5qycn.js} +59 -56
  44. package/dist/{chunk-ctw9a4hh.js → chunk-3hw6pcqt.js} +12 -12
  45. package/dist/chunk-3j0f3yyd.js +20 -0
  46. package/dist/{chunk-g2r5nsx7.js → chunk-3keyh8d3.js} +2 -2
  47. package/dist/{chunk-hegr0s7q.js → chunk-3n8prx9k.js} +3 -3
  48. package/dist/{chunk-cqnfwapm.js → chunk-3tnabt1t.js} +2 -2
  49. package/dist/{chunk-837h4x1j.js → chunk-3ydfy1vc.js} +2 -2
  50. package/dist/{chunk-1qw175nj.js → chunk-41ncbfk7.js} +3 -3
  51. package/dist/{chunk-60731s4z.js → chunk-45ynv6r6.js} +2 -2
  52. package/dist/chunk-46sfycpp.js +125 -0
  53. package/dist/{chunk-cg0h6vpf.js → chunk-496449vy.js} +2 -2
  54. package/dist/{chunk-qhpnsf4r.js → chunk-49z79885.js} +3 -3
  55. package/dist/{chunk-25j8nzw3.js → chunk-4c8mdzm1.js} +4 -4
  56. package/dist/{chunk-3dkccqes.js → chunk-4f56n8y8.js} +4 -4
  57. package/dist/{chunk-1mft5mam.js → chunk-4ffz1d36.js} +4 -4
  58. package/dist/{chunk-4zqzdz62.js → chunk-4hgk89n9.js} +59 -56
  59. package/dist/{chunk-exag2njg.js → chunk-4k4kn7h2.js} +18 -18
  60. package/dist/{chunk-1yzryj0w.js → chunk-4ks3c21q.js} +64 -61
  61. package/dist/{chunk-e29wgmh7.js → chunk-4v3p8phf.js} +15 -15
  62. package/dist/chunk-4vzg1cn7.js +264 -0
  63. package/dist/{chunk-cxktxwv9.js → chunk-4xp653hr.js} +55 -52
  64. package/dist/{chunk-r1sfk1j6.js → chunk-4zvptd40.js} +60 -57
  65. package/dist/{chunk-v2gsemps.js → chunk-503675yy.js} +2 -2
  66. package/dist/{chunk-gf3t5h70.js → chunk-52d0caw3.js} +58 -55
  67. package/dist/{chunk-x0vsajns.js → chunk-56speggn.js} +3 -3
  68. package/dist/{chunk-rhndt0ek.js → chunk-58jcwxyh.js} +14 -14
  69. package/dist/{chunk-pv7jrynh.js → chunk-5bd0sf0q.js} +2 -2
  70. package/dist/chunk-5cxetff3.js +443 -0
  71. package/dist/{chunk-q0j190dz.js → chunk-5dm3xwms.js} +6 -6
  72. package/dist/{chunk-gn0d6g6p.js → chunk-5e4sk6wr.js} +3 -3
  73. package/dist/{chunk-a66xp7jk.js → chunk-5fny1a0a.js} +37 -13
  74. package/dist/{chunk-57h3kd2w.js → chunk-5hn85d4q.js} +58 -55
  75. package/dist/{chunk-jxefgv2b.js → chunk-5p3bwhcw.js} +5 -5
  76. package/dist/{chunk-09af0bmq.js → chunk-5r57a99p.js} +15 -15
  77. package/dist/{chunk-egv3k4gg.js → chunk-5thf5z45.js} +136 -44
  78. package/dist/chunk-5vbtjcd2.js +624 -0
  79. package/dist/{chunk-jpd98chs.js → chunk-5w9qcjjt.js} +61 -58
  80. package/dist/{chunk-wvevgh1a.js → chunk-5xj3z42h.js} +5 -5
  81. package/dist/{chunk-0hr0mh6d.js → chunk-62r8rxkw.js} +4 -4
  82. package/dist/chunk-64wm5777.js +85 -0
  83. package/dist/{chunk-sk9mmh7x.js → chunk-6a32d602.js} +55 -52
  84. package/dist/{chunk-1wxx3s6s.js → chunk-6aevda19.js} +2 -2
  85. package/dist/{chunk-2km8scdk.js → chunk-6bb0gyhh.js} +55 -52
  86. package/dist/{chunk-ancr20tb.js → chunk-6d9njm1w.js} +2 -2
  87. package/dist/{chunk-p3erbvbz.js → chunk-6fbvxhan.js} +3 -3
  88. package/dist/{chunk-7t9j97cz.js → chunk-6kddkcqk.js} +57 -54
  89. package/dist/{chunk-7nyptyee.js → chunk-6sytfk68.js} +5 -5
  90. package/dist/{chunk-8z5fmqh3.js → chunk-6ypvw68g.js} +55 -52
  91. package/dist/{chunk-z763jd56.js → chunk-6zkxtny0.js} +4 -4
  92. package/dist/{chunk-p60wnp9a.js → chunk-6zn0szv5.js} +19 -17
  93. package/dist/{chunk-s3tdz6j0.js → chunk-71053xes.js} +14 -14
  94. package/dist/chunk-758qmraw.js +66 -0
  95. package/dist/{chunk-25a6cm96.js → chunk-76g1m8sa.js} +16 -4
  96. package/dist/{chunk-xgjs3rkr.js → chunk-7b1ze28c.js} +55 -52
  97. package/dist/{chunk-a3m8brwc.js → chunk-7bq6az8b.js} +3 -3
  98. package/dist/{chunk-yjmtjd5c.js → chunk-7ckqn3c3.js} +55 -52
  99. package/dist/chunk-7d5gzxsx.js +145 -0
  100. package/dist/{chunk-rv57x1qr.js → chunk-7gyjd00q.js} +3 -3
  101. package/dist/{chunk-hn438x41.js → chunk-7hnmt967.js} +84 -80
  102. package/dist/{chunk-rmfp4mf2.js → chunk-7jbeh3g8.js} +3 -3
  103. package/dist/{chunk-kymq7j5k.js → chunk-7k0h27s8.js} +7 -7
  104. package/dist/{chunk-2fnpj7fv.js → chunk-7myptjaa.js} +5 -5
  105. package/dist/{chunk-s81bx611.js → chunk-7yq22pd2.js} +57 -54
  106. package/dist/{chunk-dk8te1zz.js → chunk-7zxvjs3d.js} +2 -2
  107. package/dist/{chunk-mwky1mwc.js → chunk-83v18n96.js} +14 -14
  108. package/dist/{chunk-f1az36w2.js → chunk-84a79s9g.js} +124 -150
  109. package/dist/{chunk-x0nt6xta.js → chunk-86n03xsk.js} +60 -57
  110. package/dist/{chunk-4aqc3s2f.js → chunk-87ddk39d.js} +6 -6
  111. package/dist/{chunk-vnsmwwcx.js → chunk-89jrgnx3.js} +15 -15
  112. package/dist/{chunk-3fs4xc9h.js → chunk-8dehkx39.js} +5 -5
  113. package/dist/{chunk-wwt8x57q.js → chunk-8fm77brm.js} +59 -56
  114. package/dist/{chunk-z9ezvde9.js → chunk-8fqa9v4h.js} +55 -52
  115. package/dist/{chunk-etqmgb7b.js → chunk-8pqe4w62.js} +62 -59
  116. package/dist/{chunk-xqzmd8rx.js → chunk-8qp0ytjr.js} +2 -2
  117. package/dist/{chunk-xt7g86gj.js → chunk-8v8n8gxv.js} +3 -3
  118. package/dist/{chunk-jq30e6rg.js → chunk-94jqjx3g.js} +59 -56
  119. package/dist/chunk-9663bsk0.js +18 -0
  120. package/dist/{chunk-dnp096zb.js → chunk-96gwphgv.js} +3 -3
  121. package/dist/{chunk-sq5fyhqd.js → chunk-9bf696cj.js} +95 -87
  122. package/dist/{chunk-eje4tzhm.js → chunk-9cw6etxe.js} +56 -53
  123. package/dist/{chunk-r7a5cqdw.js → chunk-9dwdn2sk.js} +7 -7
  124. package/dist/{chunk-ejfvtxhc.js → chunk-9ggwn844.js} +29 -64
  125. package/dist/{chunk-n08zma6t.js → chunk-9gxdrrd5.js} +55 -52
  126. package/dist/{chunk-cvr6at4f.js → chunk-9q952pw0.js} +2 -2
  127. package/dist/{chunk-ab8c2gs2.js → chunk-9qgzdk8y.js} +7 -7
  128. package/dist/{chunk-tjc1tx3q.js → chunk-9qj9t1g4.js} +2 -2
  129. package/dist/{chunk-hm9rq604.js → chunk-9sr5cheh.js} +55 -52
  130. package/dist/{chunk-3tm5sns7.js → chunk-9vvffdb6.js} +64 -61
  131. package/dist/chunk-a18ypbnr.js +151 -0
  132. package/dist/{chunk-80yycsam.js → chunk-a80y3b1p.js} +3 -3
  133. package/dist/{chunk-bdhx8k7k.js → chunk-a96dsyhm.js} +59 -56
  134. package/dist/{chunk-pgjmgh51.js → chunk-a97kj439.js} +2 -2
  135. package/dist/chunk-aggcq5pt.js +16 -0
  136. package/dist/{chunk-5wvcws9f.js → chunk-am5zfwnf.js} +19 -19
  137. package/dist/{chunk-56djb736.js → chunk-b21j3y4h.js} +2 -2
  138. package/dist/{chunk-jdvx0xe9.js → chunk-b52sketm.js} +55 -52
  139. package/dist/{chunk-xzw0ettz.js → chunk-b7fcydvv.js} +18 -18
  140. package/dist/{chunk-y90gh0z2.js → chunk-bb9h35x7.js} +55 -52
  141. package/dist/{chunk-07vfsvas.js → chunk-bbpnmz87.js} +2 -2
  142. package/dist/chunk-bcfd2zw7.js +23 -0
  143. package/dist/chunk-bdy3869e.js +35 -0
  144. package/dist/{chunk-g6vvs0w9.js → chunk-be8pcep0.js} +2 -2
  145. package/dist/{chunk-2vfcftww.js → chunk-bgpftrxc.js} +56 -53
  146. package/dist/{chunk-ne02d12y.js → chunk-bh4k9q9y.js} +4 -4
  147. package/dist/{chunk-841eka5g.js → chunk-bjc8f709.js} +62 -59
  148. package/dist/{chunk-00f3aac0.js → chunk-bm5370d5.js} +14 -14
  149. package/dist/{chunk-kfdgw9j2.js → chunk-br1qf4bc.js} +12 -21
  150. package/dist/{chunk-vempyean.js → chunk-bxmc7435.js} +7 -7
  151. package/dist/chunk-c36xznt7.js +1045 -0
  152. package/dist/{chunk-cjg9tm4d.js → chunk-c3z2f4aq.js} +58 -55
  153. package/dist/chunk-cchv4yn8.js +214 -0
  154. package/dist/{chunk-qdfqack5.js → chunk-cewbt8ah.js} +2 -2
  155. package/dist/{chunk-7npzwf36.js → chunk-cfeakba6.js} +55 -52
  156. package/dist/{chunk-5c1ym1nc.js → chunk-ckh1zt0n.js} +65 -62
  157. package/dist/{chunk-xcm658wm.js → chunk-ckq5d8ev.js} +3 -3
  158. package/dist/chunk-cnfzmqr8.js +115 -0
  159. package/dist/chunk-crchz5q8.js +16 -0
  160. package/dist/{chunk-mf1n757j.js → chunk-cwpxrn2d.js} +17 -17
  161. package/dist/chunk-cy223s48.js +881 -0
  162. package/dist/{chunk-7c4fsh0s.js → chunk-cydd546q.js} +57 -54
  163. package/dist/{chunk-a35q4knx.js → chunk-cz5ycdta.js} +3 -3
  164. package/dist/{chunk-k8a68cwg.js → chunk-da7f9a81.js} +105 -29
  165. package/dist/{chunk-kexhnah5.js → chunk-dfzfxt1y.js} +7 -7
  166. package/dist/{chunk-4c56f6d2.js → chunk-dj6y2sr8.js} +3 -3
  167. package/dist/{chunk-cph4yr50.js → chunk-djbawqmw.js} +55 -52
  168. package/dist/{chunk-17j9hb87.js → chunk-dpb1kvb9.js} +56 -53
  169. package/dist/{chunk-xn02xqxj.js → chunk-dt5c48mh.js} +2 -2
  170. package/dist/{chunk-yephhrfa.js → chunk-e1m95nec.js} +6 -6
  171. package/dist/{chunk-bxfv6aew.js → chunk-e26hypm4.js} +56 -53
  172. package/dist/{chunk-a9garrrp.js → chunk-e5kn4hwp.js} +56 -53
  173. package/dist/{chunk-tn5b34gd.js → chunk-e6dq8apj.js} +55 -52
  174. package/dist/{chunk-rqn40hvy.js → chunk-e6p5x2p4.js} +4 -4
  175. package/dist/{chunk-5yjm9yth.js → chunk-eb6x30zz.js} +57 -54
  176. package/dist/{chunk-352yw5fs.js → chunk-ebfv6acv.js} +12 -12
  177. package/dist/{chunk-1h952cez.js → chunk-egkwv0bp.js} +2 -2
  178. package/dist/{chunk-rqfzhr9m.js → chunk-ennzq1s5.js} +14 -4
  179. package/dist/{chunk-ec3vxfsp.js → chunk-envqyd27.js} +59 -55
  180. package/dist/{chunk-yk99hmx2.js → chunk-epprxdgg.js} +2 -2
  181. package/dist/{chunk-cea3mepz.js → chunk-et42fzf1.js} +22 -22
  182. package/dist/{chunk-h0rbjg6x.js → chunk-f2mhrmww.js} +10 -3
  183. package/dist/{chunk-rg3c0e6m.js → chunk-fb5ehysd.js} +57 -54
  184. package/dist/chunk-fbtp7vga.js +37 -0
  185. package/dist/{chunk-n3xd3ev4.js → chunk-fgna18nd.js} +6 -6
  186. package/dist/{chunk-26w1pqen.js → chunk-fknjgxt4.js} +56 -53
  187. package/dist/{chunk-xj7nr4b8.js → chunk-fpb43g1s.js} +6 -6
  188. package/dist/{chunk-d24kfzcv.js → chunk-ftfz2eh3.js} +2 -2
  189. package/dist/{chunk-xbc1xb90.js → chunk-fv94gm4h.js} +56 -53
  190. package/dist/{chunk-732ycv3a.js → chunk-fx7pr1g4.js} +13 -13
  191. package/dist/{chunk-fxg6tk9f.js → chunk-g0axk7cx.js} +56 -53
  192. package/dist/chunk-g6d9avms.js +205 -0
  193. package/dist/{chunk-vwpr34gb.js → chunk-g9caj6wj.js} +66 -63
  194. package/dist/{chunk-jjjrmgee.js → chunk-gbekxw41.js} +56 -53
  195. package/dist/{chunk-dawa3bxd.js → chunk-gcpc6b2z.js} +2 -2
  196. package/dist/{chunk-7qq9wgng.js → chunk-gfycetpg.js} +5 -5
  197. package/dist/{chunk-snjbtcsd.js → chunk-gn0ja3k5.js} +5 -5
  198. package/dist/{chunk-cf98rrym.js → chunk-gt9gwwdh.js} +5 -5
  199. package/dist/{chunk-1qdm27em.js → chunk-gz0nj0mm.js} +55 -52
  200. package/dist/{chunk-jcfp9q8e.js → chunk-gz6pze8f.js} +57 -54
  201. package/dist/{chunk-kankxtem.js → chunk-h1frxdrg.js} +56 -54
  202. package/dist/{chunk-t8bj4y17.js → chunk-h93ve2g2.js} +14 -14
  203. package/dist/{chunk-b00v4z7e.js → chunk-h9mr8ey4.js} +13 -13
  204. package/dist/{chunk-fgfvmggw.js → chunk-hd8ydnzq.js} +15 -15
  205. package/dist/{chunk-szkay129.js → chunk-hebz2z6z.js} +58 -55
  206. package/dist/chunk-hgxb4qn5.js +390 -0
  207. package/dist/{chunk-h1e34028.js → chunk-hh6kgtq5.js} +3 -3
  208. package/dist/{chunk-srrcngcy.js → chunk-hhcx2jjn.js} +3 -3
  209. package/dist/{chunk-dvp0xagf.js → chunk-hjp1yckp.js} +56 -53
  210. package/dist/{chunk-jsfytv0f.js → chunk-hjxz7a04.js} +58 -55
  211. package/dist/{chunk-zdnv8fvz.js → chunk-hkkz8rde.js} +55 -52
  212. package/dist/{chunk-677p38pg.js → chunk-hnms0snx.js} +2 -2
  213. package/dist/{chunk-yydr31ss.js → chunk-hq4jd1fy.js} +23 -23
  214. package/dist/{chunk-gqxam9dm.js → chunk-hthfhdty.js} +15 -15
  215. package/dist/{chunk-98204r0v.js → chunk-hy5vd50e.js} +3 -3
  216. package/dist/{chunk-ck1qvj5k.js → chunk-hyztfnyq.js} +463 -225
  217. package/dist/{chunk-m4wfythr.js → chunk-j5rnevxw.js} +62 -59
  218. package/dist/{chunk-eeee4v34.js → chunk-j74ctwq9.js} +3 -3
  219. package/dist/{chunk-d9tbq3h3.js → chunk-jcdv05ym.js} +33 -5
  220. package/dist/{chunk-ga5v18wb.js → chunk-jd5xs374.js} +55 -52
  221. package/dist/{chunk-rz56zge4.js → chunk-jgbz49jh.js} +6 -4
  222. package/dist/{chunk-y9g1ynzy.js → chunk-jhdtyhk5.js} +57 -54
  223. package/dist/{chunk-aq0t16sn.js → chunk-jkbkp0ek.js} +14 -14
  224. package/dist/{chunk-7nwehwa4.js → chunk-jkyn6ge9.js} +5 -5
  225. package/dist/{chunk-nb02zd8m.js → chunk-jn7qa13m.js} +3 -3
  226. package/dist/{chunk-evmvnppx.js → chunk-jt7ea6rq.js} +55 -52
  227. package/dist/{chunk-9khxkxz7.js → chunk-jt7wch8z.js} +2 -2
  228. package/dist/{chunk-0j3jy5jp.js → chunk-jv7tn7yh.js} +55 -52
  229. package/dist/chunk-jx80x2sn.js +267 -0
  230. package/dist/{chunk-03fdnx3e.js → chunk-jy13c47g.js} +5 -5
  231. package/dist/{chunk-75q1d027.js → chunk-k11m1rfc.js} +57 -54
  232. package/dist/{chunk-x7t8wrq1.js → chunk-k3mghke5.js} +57 -86
  233. package/dist/{chunk-jcd8qmcc.js → chunk-k5rrrd0q.js} +78 -75
  234. package/dist/{chunk-8zdrypte.js → chunk-kbbjfeb8.js} +2 -2
  235. package/dist/chunk-kcz5b7xv.js +73 -0
  236. package/dist/{chunk-87s3zt6w.js → chunk-khnxj5vx.js} +3 -3
  237. package/dist/{chunk-g6eqgh16.js → chunk-kkwym2b7.js} +5 -5
  238. package/dist/{chunk-hvve83a7.js → chunk-kn345s2x.js} +2 -2
  239. package/dist/{chunk-x07xwqrj.js → chunk-kpqx95pr.js} +2 -2
  240. package/dist/{chunk-wfyhm9cg.js → chunk-kszphewb.js} +63 -54
  241. package/dist/{chunk-5kcmmrbe.js → chunk-kxn6mzy3.js} +4 -4
  242. package/dist/{chunk-tc848afj.js → chunk-m0zzdgkt.js} +31 -26
  243. package/dist/{chunk-gmsb3jtb.js → chunk-m7qa1fqb.js} +3 -3
  244. package/dist/{chunk-qph8gdxy.js → chunk-mdm5cbxy.js} +55 -52
  245. package/dist/chunk-mnqvtfd5.js +78 -0
  246. package/dist/{chunk-fstr76j0.js → chunk-mp5km99q.js} +20 -20
  247. package/dist/{chunk-8ehewpj6.js → chunk-mpxcgg5f.js} +6 -6
  248. package/dist/{chunk-zffnk5t6.js → chunk-mqr18cwx.js} +4 -4
  249. package/dist/chunk-n014czx3.js +18 -0
  250. package/dist/{chunk-ytzqmbt0.js → chunk-n40kbp9f.js} +55 -52
  251. package/dist/{chunk-8n28z1eg.js → chunk-n51s6m60.js} +14 -14
  252. package/dist/{chunk-c9gga8sn.js → chunk-n87c314c.js} +56 -53
  253. package/dist/{chunk-7jkb3tck.js → chunk-nevf0mb9.js} +15 -15
  254. package/dist/{chunk-zxhtrvtt.js → chunk-nkeknzb2.js} +4 -4
  255. package/dist/{chunk-4fjgdmr9.js → chunk-nkgq6a5q.js} +28 -28
  256. package/dist/{chunk-9ds6nhgx.js → chunk-nmj9qx2x.js} +65 -62
  257. package/dist/{chunk-4pf098nn.js → chunk-nmyfe9j9.js} +57 -54
  258. package/dist/{chunk-b1dyfwm2.js → chunk-nmzy0qjn.js} +7 -7
  259. package/dist/{chunk-51pkqrja.js → chunk-np05dg07.js} +55 -52
  260. package/dist/{chunk-w51sng2s.js → chunk-npgyhaqc.js} +2 -2
  261. package/dist/{chunk-61008xjm.js → chunk-nr2skyv7.js} +56 -53
  262. package/dist/{chunk-w6x102n9.js → chunk-nv5rddp1.js} +55 -52
  263. package/dist/{chunk-naqmbswb.js → chunk-p10xajeq.js} +69 -66
  264. package/dist/{chunk-vgzdtvca.js → chunk-p1wxbhgj.js} +4 -4
  265. package/dist/{chunk-rs2skqcv.js → chunk-p6fhtt1h.js} +4 -4
  266. package/dist/{chunk-m5daf1hp.js → chunk-p8d1q69a.js} +55 -52
  267. package/dist/{chunk-t66dy38x.js → chunk-pbmy8ktp.js} +7 -7
  268. package/dist/{chunk-ssnp42gc.js → chunk-pqrb30bj.js} +2 -2
  269. package/dist/{chunk-6dhkeb6t.js → chunk-pr321r8d.js} +3 -3
  270. package/dist/{chunk-7d5yfjs6.js → chunk-psq9gtg7.js} +2 -2
  271. package/dist/{chunk-193vfma7.js → chunk-ptermrp1.js} +60 -57
  272. package/dist/{chunk-q9fppwnq.js → chunk-pyfrphvc.js} +57 -54
  273. package/dist/{chunk-vajyw4ea.js → chunk-pzb2zc4x.js} +6 -6
  274. package/dist/{chunk-k1pjc56n.js → chunk-q0w614e1.js} +3 -3
  275. package/dist/{chunk-34merw4c.js → chunk-q110twdj.js} +59 -116
  276. package/dist/{chunk-je4jw9pe.js → chunk-q72dtjqy.js} +2 -2
  277. package/dist/{chunk-551jxdwj.js → chunk-q90bcq6v.js} +59 -56
  278. package/dist/{chunk-sm0ak846.js → chunk-qavfmmqd.js} +6 -6
  279. package/dist/{chunk-qvzvzzdw.js → chunk-qjx52q61.js} +2 -2
  280. package/dist/{chunk-72cez8rw.js → chunk-qk2tvn8y.js} +56 -53
  281. package/dist/{chunk-mt0hyhtp.js → chunk-qm3k6vez.js} +13 -13
  282. package/dist/{chunk-fkpm0dka.js → chunk-qmp50hjb.js} +19 -19
  283. package/dist/{chunk-qezmm114.js → chunk-qnztz65r.js} +56 -53
  284. package/dist/{chunk-23nwpyay.js → chunk-qpatv1ep.js} +13 -13
  285. package/dist/{chunk-dsdbya1y.js → chunk-qwtfyr6d.js} +2 -2
  286. package/dist/{chunk-nz9rqw9y.js → chunk-qxp3d963.js} +2 -2
  287. package/dist/{chunk-xq92sh7h.js → chunk-qzp51m93.js} +3 -3
  288. package/dist/{chunk-8dtk8ma2.js → chunk-r3fadmd6.js} +5 -5
  289. package/dist/{chunk-9eervnn3.js → chunk-r4mec6w5.js} +3 -3
  290. package/dist/chunk-r6g3xx75.js +415 -0
  291. package/dist/{chunk-avaa7ds2.js → chunk-r8ywba1h.js} +14 -14
  292. package/dist/{chunk-raftjwkd.js → chunk-r974358t.js} +13 -13
  293. package/dist/{chunk-w4bqdhna.js → chunk-r9qnxgqt.js} +5 -5
  294. package/dist/{chunk-7v874g5h.js → chunk-rasdgp8g.js} +4 -4
  295. package/dist/{chunk-dwkc1vgf.js → chunk-rbr0tsrz.js} +55 -52
  296. package/dist/{chunk-63hz4ckd.js → chunk-re5p7q2e.js} +4 -4
  297. package/dist/{chunk-gytaebn1.js → chunk-rfvzhq5x.js} +55 -52
  298. package/dist/{chunk-s4akexsk.js → chunk-rfxctace.js} +3 -4
  299. package/dist/chunk-rhqffqzf.js +189 -0
  300. package/dist/{chunk-xb6r5wtg.js → chunk-rnjtkqzg.js} +4 -4
  301. package/dist/{chunk-wpm7sbfe.js → chunk-rqa3fz1t.js} +55 -52
  302. package/dist/{chunk-y7q1vtv4.js → chunk-rtgff67y.js} +63 -60
  303. package/dist/{chunk-q4v51jm6.js → chunk-rw1070pc.js} +4 -4
  304. package/dist/{chunk-cxkxps51.js → chunk-rzrm7j9x.js} +2 -2
  305. package/dist/{chunk-spd5z6xd.js → chunk-s262tfgm.js} +3 -3
  306. package/dist/{chunk-9tkrb3jy.js → chunk-s4pjm9jw.js} +55 -52
  307. package/dist/chunk-s5pnejsn.js +216 -0
  308. package/dist/{chunk-4157n57z.js → chunk-sczmmmvj.js} +2 -2
  309. package/dist/{chunk-7h13c72t.js → chunk-sd2g0s0k.js} +9 -9
  310. package/dist/{chunk-rnsws47e.js → chunk-sg5nsm4p.js} +3 -3
  311. package/dist/{chunk-7cgjgppb.js → chunk-stqsfa68.js} +3 -3
  312. package/dist/{chunk-hdx2p9h7.js → chunk-svb5eqfz.js} +14 -14
  313. package/dist/{chunk-ybzc4vyc.js → chunk-swr65v0j.js} +10 -10
  314. package/dist/{chunk-dkzq1yj3.js → chunk-swtk97hy.js} +14 -14
  315. package/dist/{chunk-qy3bd939.js → chunk-sx4gbak5.js} +56 -53
  316. package/dist/{chunk-p83fdzct.js → chunk-t12d6tby.js} +3 -3
  317. package/dist/{chunk-v91g64jx.js → chunk-t20f5mnk.js} +14 -14
  318. package/dist/{chunk-g410gawd.js → chunk-t408adb9.js} +56 -53
  319. package/dist/{chunk-4k2ztys5.js → chunk-t7434h4s.js} +55 -52
  320. package/dist/{chunk-0qa1hgxp.js → chunk-t7y6mg54.js} +13 -13
  321. package/dist/{chunk-a9pqw4tk.js → chunk-tdkwcv57.js} +4 -4
  322. package/dist/{chunk-sqnghamc.js → chunk-tfew976a.js} +55 -52
  323. package/dist/{chunk-83m8mxaj.js → chunk-thzmxfnt.js} +2 -2
  324. package/dist/{chunk-gwfv9a10.js → chunk-tmedrj3f.js} +4 -4
  325. package/dist/{chunk-j9q7p2m5.js → chunk-tmscbs2k.js} +4 -4
  326. package/dist/chunk-tnk7s4ed.js +22 -0
  327. package/dist/{chunk-dw1cwmt3.js → chunk-tnqjynvy.js} +14 -14
  328. package/dist/{chunk-ztqe8k2y.js → chunk-tq32b105.js} +3 -3
  329. package/dist/{chunk-hp6ym2xt.js → chunk-tr448vwb.js} +3 -3
  330. package/dist/{chunk-xdfcfm69.js → chunk-tr4hszme.js} +3 -3
  331. package/dist/{chunk-5nzjxkj9.js → chunk-traxf72w.js} +2 -2
  332. package/dist/{chunk-f2d9gmzw.js → chunk-ttzyw0y7.js} +17 -17
  333. package/dist/{chunk-y1cqsd0p.js → chunk-tw0b366n.js} +55 -52
  334. package/dist/{chunk-ng7nkgv1.js → chunk-txync4kd.js} +7 -7
  335. package/dist/chunk-v060k07j.js +416 -0
  336. package/dist/chunk-v1rkrwwv.js +146 -0
  337. package/dist/{chunk-0p6e05c5.js → chunk-v21ssxkp.js} +2 -2
  338. package/dist/{chunk-zpte5txk.js → chunk-v2vzfj4h.js} +55 -52
  339. package/dist/{chunk-3s7v8tsk.js → chunk-v4h7dscd.js} +26 -44
  340. package/dist/{chunk-90qefxa4.js → chunk-v522k1r4.js} +70 -67
  341. package/dist/{chunk-rdmen6bn.js → chunk-v9b2rh8h.js} +58 -55
  342. package/dist/{chunk-g8e4wwak.js → chunk-vacje5g9.js} +4 -4
  343. package/dist/{chunk-t2r4qham.js → chunk-vetj2j2n.js} +60 -57
  344. package/dist/{chunk-fr84aysg.js → chunk-vpn54vqg.js} +6 -6
  345. package/dist/{chunk-yvsb81fm.js → chunk-vqhgs52z.js} +7 -7
  346. package/dist/{chunk-t802hx06.js → chunk-vtnm80k9.js} +13 -13
  347. package/dist/{chunk-dmsc23kp.js → chunk-vvk6wx6b.js} +14 -14
  348. package/dist/{chunk-t9z3edw6.js → chunk-vym5zrn6.js} +4895 -2486
  349. package/dist/{chunk-pxzawaw7.js → chunk-vzxtxv4a.js} +56 -53
  350. package/dist/{chunk-x59dmzab.js → chunk-w3wdqhv0.js} +62 -59
  351. package/dist/{chunk-61xprjs1.js → chunk-w59jkye4.js} +56 -53
  352. package/dist/{chunk-amnaevyb.js → chunk-w60fa5cj.js} +65 -62
  353. package/dist/{chunk-16waz3fy.js → chunk-w8xchcwf.js} +3 -3
  354. package/dist/{chunk-fv8tcte1.js → chunk-w9fptpp9.js} +64 -61
  355. package/dist/{chunk-3d8ccn91.js → chunk-wa7g3yv7.js} +13 -13
  356. package/dist/{chunk-wbwzf5z4.js → chunk-wdn3pb9r.js} +3 -3
  357. package/dist/{chunk-ccqk19v9.js → chunk-wqk03hpc.js} +55 -52
  358. package/dist/{chunk-ycjjsnm4.js → chunk-wvs8wv8t.js} +2 -2
  359. package/dist/{chunk-6hnqaxvs.js → chunk-wwfe7gg7.js} +58 -55
  360. package/dist/{chunk-nmaxmbg9.js → chunk-wz18c465.js} +4 -4
  361. package/dist/{chunk-08wf7txh.js → chunk-wz34c685.js} +15 -15
  362. package/dist/{chunk-587dvnad.js → chunk-wzzaxwej.js} +2 -2
  363. package/dist/chunk-x1wk407b.js +516 -0
  364. package/dist/{chunk-jysm93mk.js → chunk-x2taqvwd.js} +5 -5
  365. package/dist/{chunk-dt0y1vkc.js → chunk-x41dz9y9.js} +2 -2
  366. package/dist/chunk-x48x54hx.js +3942 -0
  367. package/dist/{chunk-q0ks2prw.js → chunk-x6cjkxqe.js} +5 -5
  368. package/dist/{chunk-f6v5bq78.js → chunk-x89sscn0.js} +2 -2
  369. package/dist/chunk-x9qqj8wc.js +153 -0
  370. package/dist/{chunk-6ka2mh69.js → chunk-xa9xpah3.js} +3037 -2505
  371. package/dist/{chunk-644422j5.js → chunk-xcxcysx3.js} +2 -2
  372. package/dist/{chunk-0fq3smhy.js → chunk-xftqvncz.js} +9 -46
  373. package/dist/{chunk-hnh89cye.js → chunk-xhnmweqe.js} +64 -61
  374. package/dist/{chunk-7s3wyn34.js → chunk-xm6t6khx.js} +56 -53
  375. package/dist/chunk-xt65mfby.js +1395 -0
  376. package/dist/{chunk-31fcazbn.js → chunk-xvmtyz8q.js} +2 -2
  377. package/dist/{chunk-1mf9624z.js → chunk-xxfz08mf.js} +55 -52
  378. package/dist/{chunk-wgvazba2.js → chunk-y061xbn9.js} +5 -5
  379. package/dist/{chunk-mzh12ebc.js → chunk-y0z468z2.js} +56 -53
  380. package/dist/{chunk-7ghq231e.js → chunk-y3cshvgb.js} +2 -2
  381. package/dist/{chunk-kqt7same.js → chunk-y6ce2s1q.js} +59 -55
  382. package/dist/chunk-y9bpc4a6.js +97 -0
  383. package/dist/{chunk-8c4wbrma.js → chunk-y9mnawak.js} +4 -4
  384. package/dist/{chunk-whbkstfm.js → chunk-ycdbp5q4.js} +55 -52
  385. package/dist/{chunk-1dg4nrws.js → chunk-ycsh7pst.js} +13 -13
  386. package/dist/{chunk-s41zt5kj.js → chunk-yedzdc0a.js} +14 -8
  387. package/dist/{chunk-jw0ky94p.js → chunk-yrr4d26k.js} +56 -53
  388. package/dist/{chunk-myysj9vz.js → chunk-yt5gwdg5.js} +7 -60
  389. package/dist/{chunk-yaefwx7d.js → chunk-yteefw26.js} +55 -52
  390. package/dist/{chunk-rhjbecsk.js → chunk-yvjzex9w.js} +6 -82
  391. package/dist/{chunk-5n19f2r9.js → chunk-z124zj20.js} +4 -4
  392. package/dist/{chunk-sa5fj0d3.js → chunk-z92c7wdq.js} +4 -4
  393. package/dist/{chunk-etcypdxa.js → chunk-zb7ctc11.js} +55 -52
  394. package/dist/{chunk-2wbgexnn.js → chunk-zc2mfxy0.js} +58 -55
  395. package/dist/{chunk-hhdbv9eg.js → chunk-zdsqreyq.js} +3 -3
  396. package/dist/chunk-zf5btqc3.js +54 -0
  397. package/dist/{chunk-sxgc1sm1.js → chunk-zfwgjjde.js} +2 -2
  398. package/dist/{chunk-nfaj0b7z.js → chunk-zgvyn6yk.js} +55 -52
  399. package/dist/{chunk-gcrf35hk.js → chunk-zmj9sehj.js} +56 -53
  400. package/dist/{chunk-hq20dsgb.js → chunk-zr750mg3.js} +93 -57
  401. package/dist/{chunk-yjyaq9ja.js → chunk-zshw91dr.js} +5 -5
  402. package/dist/{chunk-azbndvdt.js → chunk-zyhpq0w1.js} +7 -4
  403. package/dist/{chunk-ky41ddym.js → chunk-zzac564h.js} +15 -15
  404. package/dist/cli.js +94 -28
  405. package/dist/services/rawDump/batchWorker.js +3 -3
  406. package/package.json +1 -1
  407. package/dist/chunk-0paqc2yw.js +0 -18
  408. package/dist/chunk-ac3vxv72.js +0 -99
  409. package/dist/chunk-ctaxszne.js +0 -183
  410. package/dist/chunk-f9vf3z7d.js +0 -57
  411. package/dist/chunk-q2pkj7sp.js +0 -18
  412. package/dist/chunk-wmd102c3.js +0 -138
  413. package/dist/chunk-zzjq53z6.js +0 -198
@@ -2,6 +2,9 @@
2
2
  import {
3
3
  createCapacityWake
4
4
  } from "./chunk-ae76ded0.js";
5
+ import {
6
+ getPollIntervalConfig
7
+ } from "./chunk-7zxvjs3d.js";
5
8
  import {
6
9
  buildCCRv2SdkUrl,
7
10
  buildSdkUrl,
@@ -9,182 +12,103 @@ import {
9
12
  registerWorker,
10
13
  sameSessionId
11
14
  } from "./chunk-jmpcw0yt.js";
12
- import {
13
- getPollIntervalConfig
14
- } from "./chunk-dk8te1zz.js";
15
15
  import {
16
16
  createTokenRefreshScheduler
17
- } from "./chunk-a3m8brwc.js";
17
+ } from "./chunk-7bq6az8b.js";
18
18
  import {
19
19
  getBootstrapArgs,
20
20
  getScriptPath,
21
21
  init_cliLaunch
22
22
  } from "./chunk-4xa1510e.js";
23
23
  import {
24
+ $toString,
24
25
  init_server
25
26
  } from "./chunk-jdgeec04.js";
26
27
  import {
27
- BRIDGE_LOGIN_ERROR,
28
28
  BridgeFatalError,
29
- DEFAULT_SESSION_TIMEOUT_MS,
29
+ FAILED_FOOTER_TEXT,
30
+ TOOL_DISPLAY_EXPIRY_MS,
31
+ buildActiveFooterText,
32
+ buildBridgeConnectUrl,
33
+ buildBridgeSessionUrl,
34
+ buildIdleFooterText,
30
35
  createAgentWorktree,
31
36
  createBridgeApiClient,
32
37
  getRemoteSessionUrl,
33
38
  init_bridgeApi,
34
39
  init_bridgeStatusUtil,
35
40
  init_product,
36
- init_types4 as init_types,
37
41
  init_worktree,
38
42
  isExpiredErrorType,
39
43
  isSuppressible403,
40
44
  removeAgentWorktree,
41
- validateBridgeId
42
- } from "./chunk-t9z3edw6.js";
43
- import"./chunk-j7g5prq1.js";
45
+ timestamp,
46
+ validateBridgeId,
47
+ wrapWithOsc8Link
48
+ } from "./chunk-vym5zrn6.js";
44
49
  import {
45
50
  init_rcDebugLog,
46
51
  rcLog
47
- } from "./chunk-ejfvtxhc.js";
52
+ } from "./chunk-9ggwn844.js";
48
53
  import {
49
54
  getTrustedDeviceToken,
50
55
  init_trustedDevice
51
- } from "./chunk-cg0h6vpf.js";
52
- import"./chunk-ssnp42gc.js";
53
- import"./chunk-dawa3bxd.js";
54
- import"./chunk-dj0c74sd.js";
55
- import"./chunk-et824jj8.js";
56
- import"./chunk-7cpxexw0.js";
57
- import"./chunk-c05zaj6g.js";
58
- import"./chunk-cqnfwapm.js";
59
- import"./chunk-2gzv8nrw.js";
60
- import"./chunk-ehtwnxpg.js";
61
- import"./chunk-jxefgv2b.js";
62
- import"./chunk-x6pa9me9.js";
63
- import"./chunk-2f6hs25r.js";
64
- import"./chunk-vempyean.js";
65
- import"./chunk-ycjjsnm4.js";
66
- import"./chunk-h1e34028.js";
67
- import"./chunk-cgfdkzhb.js";
68
- import"./chunk-677p38pg.js";
69
- import"./chunk-25a6cm96.js";
70
- import"./chunk-dg8c6j5q.js";
71
- import"./chunk-q0ks2prw.js";
72
- import"./chunk-xq92sh7h.js";
73
- import"./chunk-4aqc3s2f.js";
74
- import"./chunk-eeee4v34.js";
56
+ } from "./chunk-496449vy.js";
57
+ import {
58
+ BRIDGE_LOGIN_ERROR,
59
+ DEFAULT_SESSION_TIMEOUT_MS,
60
+ init_types
61
+ } from "./chunk-9663bsk0.js";
75
62
  import {
76
63
  debugTruncate,
77
64
  describeAxiosError,
78
65
  init_debugUtils,
79
66
  init_sessionIdCompat,
80
- toCompatSessionId
81
- } from "./chunk-pgjmgh51.js";
82
- import"./chunk-pdkfgve3.js";
83
- import"./chunk-tjc1tx3q.js";
84
- import"./chunk-8zdrypte.js";
85
- import"./chunk-t4kcvmes.js";
86
- import"./chunk-587dvnad.js";
87
- import"./chunk-dx4aw2jf.js";
88
- import"./chunk-rqfzhr9m.js";
89
- import"./chunk-14ya36qs.js";
90
- import"./chunk-edqtm6y0.js";
91
- import"./chunk-4157n57z.js";
92
- import"./chunk-4vbza3s0.js";
93
- import"./chunk-0p6e05c5.js";
94
- import"./chunk-644422j5.js";
95
- import"./chunk-4jm600zv.js";
96
- import"./chunk-1h952cez.js";
97
- import"./chunk-mh90mtzg.js";
98
- import"./chunk-a9pqw4tk.js";
99
- import"./chunk-wbwzf5z4.js";
100
- import"./chunk-vhnm2h49.js";
101
- import"./chunk-0k1kkyw8.js";
67
+ toCompatSessionId,
68
+ toInfraSessionId
69
+ } from "./chunk-a97kj439.js";
102
70
  import {
103
- init_datadog
104
- } from "./chunk-ancr20tb.js";
105
- import"./chunk-bbm8cs3b.js";
106
- import"./chunk-2w8qb2c2.js";
107
- import"./chunk-26jcng1n.js";
108
- import"./chunk-h6hgwf7t.js";
109
- import"./chunk-sq54cby2.js";
110
- import"./chunk-gmsb3jtb.js";
111
- import"./chunk-9ey1xvcm.js";
112
- import"./chunk-8ye7m55r.js";
113
- import"./chunk-7v874g5h.js";
114
- import"./chunk-nvce80tx.js";
71
+ init_datadog,
72
+ shutdownDatadog
73
+ } from "./chunk-6d9njm1w.js";
115
74
  import {
116
- getClaudeAIOAuthTokens,
117
- init_auth,
75
+ BRIDGE_FAILED_INDICATOR,
76
+ BRIDGE_READY_INDICATOR,
77
+ BRIDGE_SPINNER_FRAMES,
78
+ checkGate_CACHED_OR_BLOCKING,
118
79
  init_figures,
119
80
  init_firstPartyEventLogger,
120
- init_growthbook
121
- } from "./chunk-egv3k4gg.js";
122
- import"./chunk-fs34dpdm.js";
123
- import"./chunk-r7a5cqdw.js";
124
- import"./chunk-00e8e1k5.js";
125
- import"./chunk-4bvckeaj.js";
126
- import"./chunk-zwarn9h7.js";
127
- import"./chunk-jakx4th4.js";
128
- import"./chunk-pe9b769s.js";
129
- import"./chunk-cxkxps51.js";
130
- import"./chunk-64c1avct.js";
131
- import"./chunk-nz9rqw9y.js";
81
+ init_growthbook,
82
+ shutdown1PEventLogging
83
+ } from "./chunk-5thf5z45.js";
132
84
  import {
133
85
  init_sleep,
134
86
  sleep
135
87
  } from "./chunk-8g5pe1gr.js";
136
- import"./chunk-nq504fa3.js";
137
- import"./chunk-xt7g86gj.js";
138
- import"./chunk-6dpcm4za.js";
139
- import"./chunk-p26t5d5e.js";
140
- import"./chunk-hs71mwbj.js";
141
- import"./chunk-3c25bcsw.js";
142
- import"./chunk-j9zpgw9b.js";
143
- import"./chunk-xhesahm0.js";
144
- import"./chunk-rh5a2rg9.js";
145
- import"./chunk-w51sng2s.js";
146
- import"./chunk-6ws6m83v.js";
147
- import"./chunk-a4wjqc9g.js";
148
- import"./chunk-0f6syxra.js";
149
- import"./chunk-4f8eq6n2.js";
150
- import"./chunk-v9smspw2.js";
151
- import"./chunk-v1kzp02e.js";
152
- import"./chunk-p2816w9z.js";
153
88
  import {
154
89
  formatDuration,
155
90
  init_format,
156
91
  truncateToWidth
157
- } from "./chunk-gn0d6g6p.js";
158
- import"./chunk-crmjpsqe.js";
92
+ } from "./chunk-5e4sk6wr.js";
159
93
  import {
160
- init_src
161
- } from "./chunk-azbndvdt.js";
162
- import"./chunk-64k6ybmm.js";
163
- import"./chunk-qr5vq8ys.js";
94
+ init_source,
95
+ init_src,
96
+ source_default,
97
+ stringWidth
98
+ } from "./chunk-zyhpq0w1.js";
164
99
  import {
165
100
  init_analytics,
166
- logEvent
167
- } from "./chunk-h0rbjg6x.js";
168
- import"./chunk-kenv28g4.js";
169
- import"./chunk-nbq5dw92.js";
170
- import"./chunk-xcm658wm.js";
101
+ logEvent,
102
+ logEventAsync
103
+ } from "./chunk-f2mhrmww.js";
171
104
  import {
172
105
  init_diagLogs,
173
106
  logForDiagnosticsNoPII
174
- } from "./chunk-g8e4wwak.js";
175
- import"./chunk-nrcew0nb.js";
176
- import"./chunk-gagn0nrq.js";
177
- import"./chunk-dsdbya1y.js";
178
- import"./chunk-d24kfzcv.js";
107
+ } from "./chunk-vacje5g9.js";
179
108
  import {
180
109
  init_log,
181
110
  logError
182
111
  } from "./chunk-vtcqe66h.js";
183
- import"./chunk-8tnsngw2.js";
184
- import"./chunk-my6j0dd8.js";
185
- import"./chunk-84a2gymg.js";
186
- import"./chunk-5z28bqne.js";
187
- import"./chunk-qajrkk97.js";
188
112
  import {
189
113
  errorMessage,
190
114
  init_debug,
@@ -194,27 +118,15 @@ import {
194
118
  jsonStringify,
195
119
  logForDebugging
196
120
  } from "./chunk-dea6k409.js";
197
- import"./chunk-fbv4apne.js";
198
- import"./chunk-rcxtkewg.js";
199
- import"./chunk-50dgek10.js";
200
- import"./chunk-7wm5s02e.js";
201
121
  import {
202
122
  init_envUtils,
203
123
  isEnvTruthy,
204
124
  isInProtectedNamespace
205
125
  } from "./chunk-hxhwzgnn.js";
206
- import"./chunk-qx8z601m.js";
207
- import"./chunk-cgm6758j.js";
208
- import"./chunk-ncpa00h9.js";
209
- import"./chunk-8pn8tvgg.js";
210
- import"./chunk-netzwgv1.js";
211
126
  import {
212
127
  __require
213
128
  } from "./chunk-qp2qdcda.js";
214
129
 
215
- // src/daemon/workerRegistry.ts
216
- import { resolve as resolve2 } from "path";
217
-
218
130
  // src/bridge/bridgeMain.ts
219
131
  init_product();
220
132
  init_datadog();
@@ -238,11 +150,366 @@ import { hostname, tmpdir as tmpdir2 } from "os";
238
150
  import { basename, join as join2, resolve } from "path";
239
151
 
240
152
  // src/bridge/bridgeUI.ts
153
+ init_source();
241
154
  init_server();
242
155
  init_figures();
243
156
  init_src();
244
157
  init_debug();
245
158
  init_bridgeStatusUtil();
159
+ var QR_OPTIONS = {
160
+ type: "utf8",
161
+ errorCorrectionLevel: "L",
162
+ small: true
163
+ };
164
+ async function generateQr(url) {
165
+ const qr = await $toString(url, QR_OPTIONS);
166
+ return qr.split(`
167
+ `).filter((line) => line.length > 0);
168
+ }
169
+ function createBridgeLogger(options) {
170
+ const write = options.write ?? ((s) => process.stdout.write(s));
171
+ const verbose = options.verbose;
172
+ let statusLineCount = 0;
173
+ let currentState = "idle";
174
+ let currentStateText = "Ready";
175
+ let repoName = "";
176
+ let branch = "";
177
+ let debugLogPath = "";
178
+ let connectUrl = "";
179
+ let cachedIngressUrl = "";
180
+ let cachedEnvironmentId = "";
181
+ let activeSessionUrl = null;
182
+ let qrLines = [];
183
+ let qrVisible = false;
184
+ let lastToolSummary = null;
185
+ let lastToolTime = 0;
186
+ let sessionActive = 0;
187
+ let sessionMax = 1;
188
+ let spawnModeDisplay = null;
189
+ let spawnMode = "single-session";
190
+ const sessionDisplayInfo = new Map;
191
+ let connectingTimer = null;
192
+ let connectingTick = 0;
193
+ function countVisualLines(text) {
194
+ const cols = process.stdout.columns || 80;
195
+ let count = 0;
196
+ for (const logical of text.split(`
197
+ `)) {
198
+ if (logical.length === 0) {
199
+ count++;
200
+ continue;
201
+ }
202
+ const width = stringWidth(logical);
203
+ count += Math.max(1, Math.ceil(width / cols));
204
+ }
205
+ if (text.endsWith(`
206
+ `)) {
207
+ count--;
208
+ }
209
+ return count;
210
+ }
211
+ function writeStatus(text) {
212
+ write(text);
213
+ statusLineCount += countVisualLines(text);
214
+ }
215
+ function clearStatusLines() {
216
+ if (statusLineCount <= 0)
217
+ return;
218
+ logForDebugging(`[bridge:ui] clearStatusLines count=${statusLineCount}`);
219
+ write(`\x1B[${statusLineCount}A`);
220
+ write("\x1B[J");
221
+ statusLineCount = 0;
222
+ }
223
+ function printLog(line) {
224
+ clearStatusLines();
225
+ write(line);
226
+ }
227
+ function regenerateQr(url) {
228
+ generateQr(url).then((lines) => {
229
+ qrLines = lines;
230
+ renderStatusLine();
231
+ }).catch((e) => {
232
+ logForDebugging(`QR code generation failed: ${e}`, { level: "error" });
233
+ });
234
+ }
235
+ function renderConnectingLine() {
236
+ clearStatusLines();
237
+ const frame = BRIDGE_SPINNER_FRAMES[connectingTick % BRIDGE_SPINNER_FRAMES.length];
238
+ let suffix = "";
239
+ if (repoName) {
240
+ suffix += source_default.dim(" \xB7 ") + source_default.dim(repoName);
241
+ }
242
+ if (branch) {
243
+ suffix += source_default.dim(" \xB7 ") + source_default.dim(branch);
244
+ }
245
+ writeStatus(`${source_default.yellow(frame)} ${source_default.yellow("Connecting")}${suffix}
246
+ `);
247
+ }
248
+ function startConnecting() {
249
+ stopConnecting();
250
+ renderConnectingLine();
251
+ connectingTimer = setInterval(() => {
252
+ connectingTick++;
253
+ renderConnectingLine();
254
+ }, 150);
255
+ }
256
+ function stopConnecting() {
257
+ if (connectingTimer) {
258
+ clearInterval(connectingTimer);
259
+ connectingTimer = null;
260
+ }
261
+ }
262
+ function renderStatusLine() {
263
+ if (currentState === "reconnecting" || currentState === "failed") {
264
+ return;
265
+ }
266
+ clearStatusLines();
267
+ const isIdle = currentState === "idle";
268
+ if (qrVisible) {
269
+ for (const line of qrLines) {
270
+ writeStatus(`${source_default.dim(line)}
271
+ `);
272
+ }
273
+ }
274
+ const indicator = BRIDGE_READY_INDICATOR;
275
+ const indicatorColor = isIdle ? source_default.green : source_default.cyan;
276
+ const baseColor = isIdle ? source_default.green : source_default.cyan;
277
+ const stateText = baseColor(currentStateText);
278
+ let suffix = "";
279
+ if (repoName) {
280
+ suffix += source_default.dim(" \xB7 ") + source_default.dim(repoName);
281
+ }
282
+ if (branch && spawnMode !== "worktree") {
283
+ suffix += source_default.dim(" \xB7 ") + source_default.dim(branch);
284
+ }
285
+ if (process.env.USER_TYPE === "ant" && debugLogPath) {
286
+ writeStatus(`${source_default.yellow("[ANT-ONLY] Logs:")} ${source_default.dim(debugLogPath)}
287
+ `);
288
+ }
289
+ writeStatus(`${indicatorColor(indicator)} ${stateText}${suffix}
290
+ `);
291
+ if (sessionMax > 1) {
292
+ const modeHint = spawnMode === "worktree" ? "New sessions will be created in an isolated worktree" : "New sessions will be created in the current directory";
293
+ writeStatus(` ${source_default.dim(`Capacity: ${sessionActive}/${sessionMax} \xB7 ${modeHint}`)}
294
+ `);
295
+ for (const [, info] of sessionDisplayInfo) {
296
+ const titleText = info.title ? truncateToWidth(info.title, 35) : source_default.dim("Attached");
297
+ const titleLinked = wrapWithOsc8Link(titleText, info.url);
298
+ const act = info.activity;
299
+ const showAct = act && act.type !== "result" && act.type !== "error";
300
+ const actText = showAct ? source_default.dim(` ${truncateToWidth(act.summary, 40)}`) : "";
301
+ writeStatus(` ${titleLinked}${actText}
302
+ `);
303
+ }
304
+ }
305
+ if (sessionMax === 1) {
306
+ const modeText = spawnMode === "single-session" ? "Single session \xB7 exits when complete" : spawnMode === "worktree" ? `Capacity: ${sessionActive}/1 \xB7 New sessions will be created in an isolated worktree` : `Capacity: ${sessionActive}/1 \xB7 New sessions will be created in the current directory`;
307
+ writeStatus(` ${source_default.dim(modeText)}
308
+ `);
309
+ }
310
+ if (sessionMax === 1 && !isIdle && lastToolSummary && Date.now() - lastToolTime < TOOL_DISPLAY_EXPIRY_MS) {
311
+ writeStatus(` ${source_default.dim(truncateToWidth(lastToolSummary, 60))}
312
+ `);
313
+ }
314
+ const url = activeSessionUrl ?? connectUrl;
315
+ if (url) {
316
+ writeStatus(`
317
+ `);
318
+ const footerText = isIdle ? buildIdleFooterText(url) : buildActiveFooterText(url);
319
+ const qrHint = qrVisible ? source_default.dim.italic("space to hide QR code") : source_default.dim.italic("space to show QR code");
320
+ const toggleHint = spawnModeDisplay ? source_default.dim.italic(" \xB7 w to toggle spawn mode") : "";
321
+ writeStatus(`${source_default.dim(footerText)}
322
+ `);
323
+ writeStatus(`${qrHint}${toggleHint}
324
+ `);
325
+ }
326
+ }
327
+ return {
328
+ printBanner(config, environmentId) {
329
+ cachedIngressUrl = config.sessionIngressUrl;
330
+ cachedEnvironmentId = environmentId;
331
+ connectUrl = buildBridgeConnectUrl(environmentId, cachedIngressUrl);
332
+ regenerateQr(connectUrl);
333
+ if (verbose) {
334
+ write(source_default.dim(`Remote Control`) + ` v${"4.1.2"}
335
+ `);
336
+ }
337
+ if (verbose) {
338
+ if (config.spawnMode !== "single-session") {
339
+ write(source_default.dim(`Spawn mode: `) + `${config.spawnMode}
340
+ `);
341
+ write(source_default.dim(`Max concurrent sessions: `) + `${config.maxSessions}
342
+ `);
343
+ }
344
+ write(source_default.dim(`Environment ID: `) + `${environmentId}
345
+ `);
346
+ }
347
+ if (config.sandbox) {
348
+ write(source_default.dim(`Sandbox: `) + `${source_default.green("Enabled")}
349
+ `);
350
+ }
351
+ write(`
352
+ `);
353
+ startConnecting();
354
+ },
355
+ logSessionStart(sessionId, prompt) {
356
+ if (verbose) {
357
+ const short = truncateToWidth(prompt, 80);
358
+ printLog(source_default.dim(`[${timestamp()}]`) + ` Session started: ${source_default.white(`"${short}"`)} (${source_default.dim(sessionId)})
359
+ `);
360
+ }
361
+ },
362
+ logSessionComplete(sessionId, durationMs) {
363
+ printLog(source_default.dim(`[${timestamp()}]`) + ` Session ${source_default.green("completed")} (${formatDuration(durationMs)}) ${source_default.dim(sessionId)}
364
+ `);
365
+ },
366
+ logSessionFailed(sessionId, error) {
367
+ printLog(source_default.dim(`[${timestamp()}]`) + ` Session ${source_default.red("failed")}: ${error} ${source_default.dim(sessionId)}
368
+ `);
369
+ },
370
+ logStatus(message) {
371
+ printLog(source_default.dim(`[${timestamp()}]`) + ` ${message}
372
+ `);
373
+ },
374
+ logVerbose(message) {
375
+ if (verbose) {
376
+ printLog(source_default.dim(`[${timestamp()}] ${message}`) + `
377
+ `);
378
+ }
379
+ },
380
+ logError(message) {
381
+ printLog(source_default.red(`[${timestamp()}] Error: ${message}`) + `
382
+ `);
383
+ },
384
+ logReconnected(disconnectedMs) {
385
+ printLog(source_default.dim(`[${timestamp()}]`) + ` ${source_default.green("Reconnected")} after ${formatDuration(disconnectedMs)}
386
+ `);
387
+ },
388
+ setRepoInfo(repo, branchName) {
389
+ repoName = repo;
390
+ branch = branchName;
391
+ },
392
+ setDebugLogPath(path) {
393
+ debugLogPath = path;
394
+ },
395
+ updateIdleStatus() {
396
+ stopConnecting();
397
+ currentState = "idle";
398
+ currentStateText = "Ready";
399
+ lastToolSummary = null;
400
+ lastToolTime = 0;
401
+ activeSessionUrl = null;
402
+ regenerateQr(connectUrl);
403
+ renderStatusLine();
404
+ },
405
+ setAttached(sessionId) {
406
+ stopConnecting();
407
+ currentState = "attached";
408
+ currentStateText = "Connected";
409
+ lastToolSummary = null;
410
+ lastToolTime = 0;
411
+ if (sessionMax <= 1) {
412
+ activeSessionUrl = buildBridgeSessionUrl(sessionId, cachedEnvironmentId, cachedIngressUrl);
413
+ regenerateQr(activeSessionUrl);
414
+ }
415
+ renderStatusLine();
416
+ },
417
+ updateReconnectingStatus(delayStr, elapsedStr) {
418
+ stopConnecting();
419
+ clearStatusLines();
420
+ currentState = "reconnecting";
421
+ if (qrVisible) {
422
+ for (const line of qrLines) {
423
+ writeStatus(`${source_default.dim(line)}
424
+ `);
425
+ }
426
+ }
427
+ const frame = BRIDGE_SPINNER_FRAMES[connectingTick % BRIDGE_SPINNER_FRAMES.length];
428
+ connectingTick++;
429
+ writeStatus(`${source_default.yellow(frame)} ${source_default.yellow("Reconnecting")} ${source_default.dim("\xB7")} ${source_default.dim(`retrying in ${delayStr}`)} ${source_default.dim("\xB7")} ${source_default.dim(`disconnected ${elapsedStr}`)}
430
+ `);
431
+ },
432
+ updateFailedStatus(error) {
433
+ stopConnecting();
434
+ clearStatusLines();
435
+ currentState = "failed";
436
+ let suffix = "";
437
+ if (repoName) {
438
+ suffix += source_default.dim(" \xB7 ") + source_default.dim(repoName);
439
+ }
440
+ if (branch) {
441
+ suffix += source_default.dim(" \xB7 ") + source_default.dim(branch);
442
+ }
443
+ writeStatus(`${source_default.red(BRIDGE_FAILED_INDICATOR)} ${source_default.red("Remote Control Failed")}${suffix}
444
+ `);
445
+ writeStatus(`${source_default.dim(FAILED_FOOTER_TEXT)}
446
+ `);
447
+ if (error) {
448
+ writeStatus(`${source_default.red(error)}
449
+ `);
450
+ }
451
+ },
452
+ updateSessionStatus(_sessionId, _elapsed, activity, _trail) {
453
+ if (activity.type === "tool_start") {
454
+ lastToolSummary = activity.summary;
455
+ lastToolTime = Date.now();
456
+ }
457
+ renderStatusLine();
458
+ },
459
+ clearStatus() {
460
+ stopConnecting();
461
+ clearStatusLines();
462
+ },
463
+ toggleQr() {
464
+ qrVisible = !qrVisible;
465
+ renderStatusLine();
466
+ },
467
+ updateSessionCount(active, max, mode) {
468
+ if (sessionActive === active && sessionMax === max && spawnMode === mode)
469
+ return;
470
+ sessionActive = active;
471
+ sessionMax = max;
472
+ spawnMode = mode;
473
+ },
474
+ setSpawnModeDisplay(mode) {
475
+ if (spawnModeDisplay === mode)
476
+ return;
477
+ spawnModeDisplay = mode;
478
+ if (mode)
479
+ spawnMode = mode;
480
+ },
481
+ addSession(sessionId, url) {
482
+ sessionDisplayInfo.set(sessionId, { url });
483
+ },
484
+ updateSessionActivity(sessionId, activity) {
485
+ const info = sessionDisplayInfo.get(sessionId);
486
+ if (!info)
487
+ return;
488
+ info.activity = activity;
489
+ },
490
+ setSessionTitle(sessionId, title) {
491
+ const info = sessionDisplayInfo.get(sessionId);
492
+ if (!info)
493
+ return;
494
+ info.title = title;
495
+ if (currentState === "reconnecting" || currentState === "failed")
496
+ return;
497
+ if (sessionMax === 1) {
498
+ currentState = "titled";
499
+ currentStateText = truncateToWidth(title, 40);
500
+ }
501
+ renderStatusLine();
502
+ },
503
+ removeSession(sessionId) {
504
+ sessionDisplayInfo.delete(sessionId);
505
+ },
506
+ refreshDisplay() {
507
+ if (currentState === "reconnecting" || currentState === "failed")
508
+ return;
509
+ renderStatusLine();
510
+ }
511
+ };
512
+ }
246
513
 
247
514
  // src/bridge/bridgeMain.ts
248
515
  init_debugUtils();
@@ -609,6 +876,10 @@ var DEFAULT_BACKOFF = {
609
876
  generalGiveUpMs: 600000
610
877
  };
611
878
  var STATUS_UPDATE_INTERVAL_MS = 1000;
879
+ var SPAWN_SESSIONS_DEFAULT = 32;
880
+ async function isMultiSessionSpawnEnabled() {
881
+ return checkGate_CACHED_OR_BLOCKING("tengu_ccr_bridge_multi_session");
882
+ }
612
883
  function pollSleepDetectionThresholdMs(backoff) {
613
884
  return backoff.connCapMs * 2;
614
885
  }
@@ -1084,7 +1355,7 @@ async function runBridgeLoop(config, environmentId, environmentSecret, api, spaw
1084
1355
  const title = deriveSessionTitle(text);
1085
1356
  logger.setSessionTitle(compatSessionId, title);
1086
1357
  logForDebugging(`[bridge:title] derived title for ${compatSessionId}: ${title}`);
1087
- import("./chunk-6nqv04m4.js").then(({ updateBridgeSessionTitle }) => updateBridgeSessionTitle(compatSessionId, title, {
1358
+ import("./chunk-3c22f5y8.js").then(({ updateBridgeSessionTitle }) => updateBridgeSessionTitle(compatSessionId, title, {
1088
1359
  baseUrl: config.apiBaseUrl
1089
1360
  })).catch((err) => logForDebugging(`[bridge:title] failed to update title for ${compatSessionId}: ${err}`, { level: "error" }));
1090
1361
  }
@@ -1418,16 +1689,651 @@ function onSessionTimeout(sessionId, timeoutMs, logger, timedOutSessions, handle
1418
1689
  timedOutSessions.add(sessionId);
1419
1690
  handle.kill();
1420
1691
  }
1692
+ var SPAWN_FLAG_VALUES = ["session", "same-dir", "worktree"];
1693
+ function parseSpawnValue(raw) {
1694
+ if (raw === "session")
1695
+ return "single-session";
1696
+ if (raw === "same-dir")
1697
+ return "same-dir";
1698
+ if (raw === "worktree")
1699
+ return "worktree";
1700
+ return `--spawn requires one of: ${SPAWN_FLAG_VALUES.join(", ")} (got: ${raw ?? "<missing>"})`;
1701
+ }
1702
+ function parseCapacityValue(raw) {
1703
+ const n = raw === undefined ? NaN : parseInt(raw, 10);
1704
+ if (isNaN(n) || n < 1) {
1705
+ return `--capacity requires a positive integer (got: ${raw ?? "<missing>"})`;
1706
+ }
1707
+ return n;
1708
+ }
1709
+ function parseArgs(args) {
1710
+ let verbose = false;
1711
+ let sandbox = false;
1712
+ let debugFile;
1713
+ let sessionTimeoutMs;
1714
+ let permissionMode;
1715
+ let name;
1716
+ let help = false;
1717
+ let spawnMode;
1718
+ let capacity;
1719
+ let createSessionInDir;
1720
+ let sessionId;
1721
+ let continueSession = false;
1722
+ for (let i = 0;i < args.length; i++) {
1723
+ const arg = args[i];
1724
+ if (arg === "--help" || arg === "-h") {
1725
+ help = true;
1726
+ } else if (arg === "--verbose" || arg === "-v") {
1727
+ verbose = true;
1728
+ } else if (arg === "--sandbox") {
1729
+ sandbox = true;
1730
+ } else if (arg === "--no-sandbox") {
1731
+ sandbox = false;
1732
+ } else if (arg === "--debug-file" && i + 1 < args.length) {
1733
+ debugFile = resolve(args[++i]);
1734
+ } else if (arg.startsWith("--debug-file=")) {
1735
+ debugFile = resolve(arg.slice("--debug-file=".length));
1736
+ } else if (arg === "--session-timeout" && i + 1 < args.length) {
1737
+ sessionTimeoutMs = parseInt(args[++i], 10) * 1000;
1738
+ } else if (arg.startsWith("--session-timeout=")) {
1739
+ sessionTimeoutMs = parseInt(arg.slice("--session-timeout=".length), 10) * 1000;
1740
+ } else if (arg === "--permission-mode" && i + 1 < args.length) {
1741
+ permissionMode = args[++i];
1742
+ } else if (arg.startsWith("--permission-mode=")) {
1743
+ permissionMode = arg.slice("--permission-mode=".length);
1744
+ } else if (arg === "--name" && i + 1 < args.length) {
1745
+ name = args[++i];
1746
+ } else if (arg.startsWith("--name=")) {
1747
+ name = arg.slice("--name=".length);
1748
+ } else if (arg === "--session-id" && i + 1 < args.length) {
1749
+ sessionId = args[++i];
1750
+ if (!sessionId) {
1751
+ return makeError("--session-id requires a value");
1752
+ }
1753
+ } else if (arg.startsWith("--session-id=")) {
1754
+ sessionId = arg.slice("--session-id=".length);
1755
+ if (!sessionId) {
1756
+ return makeError("--session-id requires a value");
1757
+ }
1758
+ } else if (arg === "--continue" || arg === "-c") {
1759
+ continueSession = true;
1760
+ } else if (arg === "--spawn" || arg.startsWith("--spawn=")) {
1761
+ if (spawnMode !== undefined) {
1762
+ return makeError("--spawn may only be specified once");
1763
+ }
1764
+ const raw = arg.startsWith("--spawn=") ? arg.slice("--spawn=".length) : args[++i];
1765
+ const v = parseSpawnValue(raw);
1766
+ if (v === "single-session" || v === "same-dir" || v === "worktree") {
1767
+ spawnMode = v;
1768
+ } else {
1769
+ return makeError(v);
1770
+ }
1771
+ } else if (arg === "--capacity" || arg.startsWith("--capacity=")) {
1772
+ if (capacity !== undefined) {
1773
+ return makeError("--capacity may only be specified once");
1774
+ }
1775
+ const raw = arg.startsWith("--capacity=") ? arg.slice("--capacity=".length) : args[++i];
1776
+ const v = parseCapacityValue(raw);
1777
+ if (typeof v === "number")
1778
+ capacity = v;
1779
+ else
1780
+ return makeError(v);
1781
+ } else if (arg === "--create-session-in-dir") {
1782
+ createSessionInDir = true;
1783
+ } else if (arg === "--no-create-session-in-dir") {
1784
+ createSessionInDir = false;
1785
+ } else {
1786
+ return makeError(`Unknown argument: ${arg}
1787
+ Run 'claude remote-control --help' for usage.`);
1788
+ }
1789
+ }
1790
+ if (spawnMode === "single-session" && capacity !== undefined) {
1791
+ return makeError(`--capacity cannot be used with --spawn=session (single-session mode has fixed capacity 1).`);
1792
+ }
1793
+ if ((sessionId || continueSession) && (spawnMode !== undefined || capacity !== undefined || createSessionInDir !== undefined)) {
1794
+ return makeError(`--session-id and --continue cannot be used with --spawn, --capacity, or --create-session-in-dir.`);
1795
+ }
1796
+ if (sessionId && continueSession) {
1797
+ return makeError(`--session-id and --continue cannot be used together.`);
1798
+ }
1799
+ return {
1800
+ verbose,
1801
+ sandbox,
1802
+ debugFile,
1803
+ sessionTimeoutMs,
1804
+ permissionMode,
1805
+ name,
1806
+ spawnMode,
1807
+ capacity,
1808
+ createSessionInDir,
1809
+ sessionId,
1810
+ continueSession,
1811
+ help
1812
+ };
1813
+ function makeError(error) {
1814
+ return {
1815
+ verbose,
1816
+ sandbox,
1817
+ debugFile,
1818
+ sessionTimeoutMs,
1819
+ permissionMode,
1820
+ name,
1821
+ spawnMode,
1822
+ capacity,
1823
+ createSessionInDir,
1824
+ sessionId,
1825
+ continueSession,
1826
+ help,
1827
+ error
1828
+ };
1829
+ }
1830
+ }
1831
+ async function printHelp() {
1832
+ const { EXTERNAL_PERMISSION_MODES } = await import("./chunk-k2nysd2c.js");
1833
+ const modes = EXTERNAL_PERMISSION_MODES.join(", ");
1834
+ const showServer = await isMultiSessionSpawnEnabled();
1835
+ const serverOptions = showServer ? ` --spawn <mode> Spawn mode: same-dir, worktree, session
1836
+ (default: same-dir)
1837
+ --capacity <N> Max concurrent sessions in worktree or
1838
+ same-dir mode (default: ${SPAWN_SESSIONS_DEFAULT})
1839
+ --[no-]create-session-in-dir Pre-create a session in the current
1840
+ directory; in worktree mode this session
1841
+ stays in cwd while on-demand sessions get
1842
+ isolated worktrees (default: on)
1843
+ ` : "";
1844
+ const serverDescription = showServer ? `
1845
+ Remote Control runs as a persistent server that accepts multiple concurrent
1846
+ sessions in the current directory. One session is pre-created on start so
1847
+ you have somewhere to type immediately. Use --spawn=worktree to isolate
1848
+ each on-demand session in its own git worktree, or --spawn=session for
1849
+ the classic single-session mode (exits when that session ends). Press 'w'
1850
+ during runtime to toggle between same-dir and worktree.
1851
+ ` : "";
1852
+ const serverNote = showServer ? ` - Worktree mode requires a git repository or WorktreeCreate/WorktreeRemove hooks
1853
+ ` : "";
1854
+ const help = `
1855
+ Remote Control - Connect your local environment to costrict.ai
1856
+
1857
+ USAGE
1858
+ claude remote-control [options]
1859
+ OPTIONS
1860
+ --name <name> Name for the session (shown in costrict.ai)
1861
+ -c, --continue Resume the last session in this directory
1862
+ --session-id <id> Resume a specific session by ID (cannot be
1863
+ used with spawn flags or --continue)
1864
+ --permission-mode <mode> Permission mode for spawned sessions
1865
+ (${modes})
1866
+ --debug-file <path> Write debug logs to file
1867
+ -v, --verbose Enable verbose output
1868
+ -h, --help Show this help
1869
+ ${serverOptions}
1870
+ DESCRIPTION
1871
+ Remote Control allows you to control sessions on your local device from
1872
+ costrict.ai (https://costrict.ai). Run this command in the
1873
+ directory you want to work in, then connect from the Claude app or web.
1874
+ ${serverDescription}
1875
+ NOTES
1876
+ - You must be logged in with a Claude account that has a subscription
1877
+ - Run \`claude\` first in the directory to accept the workspace trust dialog
1878
+ ${serverNote}`;
1879
+ console.log(help);
1880
+ }
1421
1881
  var TITLE_MAX_LEN = 80;
1422
1882
  function deriveSessionTitle(text) {
1423
1883
  const flat = text.replace(/\s+/g, " ").trim();
1424
1884
  return truncateToWidth(flat, TITLE_MAX_LEN);
1425
1885
  }
1426
1886
  async function fetchSessionTitle(compatSessionId, baseUrl) {
1427
- const { getBridgeSession } = await import("./chunk-6nqv04m4.js");
1887
+ const { getBridgeSession } = await import("./chunk-3c22f5y8.js");
1428
1888
  const session = await getBridgeSession(compatSessionId, { baseUrl });
1429
1889
  return session?.title || undefined;
1430
1890
  }
1891
+ async function bridgeMain(args) {
1892
+ const parsed = parseArgs(args);
1893
+ if (parsed.help) {
1894
+ await printHelp();
1895
+ return;
1896
+ }
1897
+ if (parsed.error) {
1898
+ console.error(`Error: ${parsed.error}`);
1899
+ process.exit(1);
1900
+ }
1901
+ const {
1902
+ verbose,
1903
+ sandbox,
1904
+ debugFile,
1905
+ sessionTimeoutMs,
1906
+ permissionMode,
1907
+ name,
1908
+ spawnMode: parsedSpawnMode,
1909
+ capacity: parsedCapacity,
1910
+ createSessionInDir: parsedCreateSessionInDir,
1911
+ sessionId: parsedSessionId,
1912
+ continueSession
1913
+ } = parsed;
1914
+ let resumeSessionId = parsedSessionId;
1915
+ let resumePointerDir;
1916
+ const usedMultiSessionFeature = parsedSpawnMode !== undefined || parsedCapacity !== undefined || parsedCreateSessionInDir !== undefined;
1917
+ if (permissionMode !== undefined) {
1918
+ const { PERMISSION_MODES } = await import("./chunk-k2nysd2c.js");
1919
+ const valid = PERMISSION_MODES;
1920
+ if (!valid.includes(permissionMode)) {
1921
+ console.error(`Error: Invalid permission mode '${permissionMode}'. Valid modes: ${valid.join(", ")}`);
1922
+ process.exit(1);
1923
+ }
1924
+ }
1925
+ const dir = resolve(".");
1926
+ const { enableConfigs, checkHasTrustDialogAccepted } = await import("./chunk-ycsh7pst.js");
1927
+ enableConfigs();
1928
+ const { initSinks } = await import("./chunk-ttzyw0y7.js");
1929
+ initSinks();
1930
+ const multiSessionEnabled = await isMultiSessionSpawnEnabled();
1931
+ if (usedMultiSessionFeature && !multiSessionEnabled) {
1932
+ await logEventAsync("tengu_bridge_multi_session_denied", {
1933
+ used_spawn: parsedSpawnMode !== undefined,
1934
+ used_capacity: parsedCapacity !== undefined,
1935
+ used_create_session_in_dir: parsedCreateSessionInDir !== undefined
1936
+ });
1937
+ await Promise.race([
1938
+ Promise.all([shutdown1PEventLogging(), shutdownDatadog()]),
1939
+ sleep(500, undefined, { unref: true })
1940
+ ]).catch(() => {});
1941
+ console.error("Error: Multi-session Remote Control is not enabled for your account yet.");
1942
+ process.exit(1);
1943
+ }
1944
+ const { setOriginalCwd, setCwdState } = await import("./chunk-3pb880dx.js");
1945
+ setOriginalCwd(dir);
1946
+ setCwdState(dir);
1947
+ if (!checkHasTrustDialogAccepted()) {
1948
+ console.error(`Error: Workspace not trusted. Please run \`claude\` in ${dir} first to review and accept the workspace trust dialog.`);
1949
+ process.exit(1);
1950
+ }
1951
+ const { clearOAuthTokenCache, checkAndRefreshOAuthTokenIfNeeded } = await import("./chunk-t7y6mg54.js");
1952
+ const { getBridgeAccessToken, getBridgeBaseUrl } = await import("./chunk-swtk97hy.js");
1953
+ const bridgeToken = getBridgeAccessToken();
1954
+ if (!bridgeToken) {
1955
+ console.error(BRIDGE_LOGIN_ERROR);
1956
+ process.exit(1);
1957
+ }
1958
+ const {
1959
+ getGlobalConfig,
1960
+ saveGlobalConfig,
1961
+ getCurrentProjectConfig,
1962
+ saveCurrentProjectConfig
1963
+ } = await import("./chunk-ycsh7pst.js");
1964
+ if (!getGlobalConfig().remoteDialogSeen) {
1965
+ const readline = await import("readline");
1966
+ const rl = readline.createInterface({
1967
+ input: process.stdin,
1968
+ output: process.stdout
1969
+ });
1970
+ console.log(`
1971
+ Remote Control lets you access this CLI session from the web (costrict.ai)
1972
+ or the Claude app, so you can pick up where you left off on any device.
1973
+
1974
+ You can disconnect remote access anytime by running /remote-control again.
1975
+ `);
1976
+ const answer = await new Promise((resolve2) => {
1977
+ rl.question("Enable Remote Control? (y/n) ", resolve2);
1978
+ });
1979
+ rl.close();
1980
+ saveGlobalConfig((current) => {
1981
+ if (current.remoteDialogSeen)
1982
+ return current;
1983
+ return { ...current, remoteDialogSeen: true };
1984
+ });
1985
+ if (answer.toLowerCase() !== "y" && answer.toLowerCase() !== "yes") {
1986
+ process.exit(0);
1987
+ }
1988
+ }
1989
+ if (continueSession) {
1990
+ const { readBridgePointerAcrossWorktrees } = await import("./chunk-4pj7g85r.js");
1991
+ const found = await readBridgePointerAcrossWorktrees(dir);
1992
+ if (!found) {
1993
+ console.error(`Error: No recent session found in this directory or its worktrees. Run \`claude remote-control\` to start a new one.`);
1994
+ process.exit(1);
1995
+ }
1996
+ const { pointer, dir: pointerDir } = found;
1997
+ const ageMin = Math.round(pointer.ageMs / 60000);
1998
+ const ageStr = ageMin < 60 ? `${ageMin}m` : `${Math.round(ageMin / 60)}h`;
1999
+ const fromWt = pointerDir !== dir ? ` from worktree ${pointerDir}` : "";
2000
+ console.error(`Resuming session ${pointer.sessionId} (${ageStr} ago)${fromWt}\u2026`);
2001
+ resumeSessionId = pointer.sessionId;
2002
+ resumePointerDir = pointerDir;
2003
+ }
2004
+ const baseUrl = getBridgeBaseUrl();
2005
+ if (baseUrl.startsWith("http://") && !baseUrl.includes("localhost") && !baseUrl.includes("127.0.0.1")) {
2006
+ console.error("Error: Remote Control base URL uses HTTP. Only HTTPS or localhost HTTP is allowed.");
2007
+ process.exit(1);
2008
+ }
2009
+ const sessionIngressUrl = process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL || baseUrl;
2010
+ const { getBranch, getRemoteUrl, findGitRoot } = await import("./chunk-z124zj20.js");
2011
+ const { hasWorktreeCreateHook } = await import("./chunk-1z6393pz.js");
2012
+ const worktreeAvailable = hasWorktreeCreateHook() || findGitRoot(dir) !== null;
2013
+ let savedSpawnMode = multiSessionEnabled ? getCurrentProjectConfig().remoteControlSpawnMode : undefined;
2014
+ if (savedSpawnMode === "worktree" && !worktreeAvailable) {
2015
+ console.error("Warning: Saved spawn mode is worktree but this directory is not a git repository. Falling back to same-dir.");
2016
+ savedSpawnMode = undefined;
2017
+ saveCurrentProjectConfig((current) => {
2018
+ if (current.remoteControlSpawnMode === undefined)
2019
+ return current;
2020
+ return { ...current, remoteControlSpawnMode: undefined };
2021
+ });
2022
+ }
2023
+ if (multiSessionEnabled && !savedSpawnMode && worktreeAvailable && parsedSpawnMode === undefined && !resumeSessionId && process.stdin.isTTY) {
2024
+ const readline = await import("readline");
2025
+ const rl = readline.createInterface({
2026
+ input: process.stdin,
2027
+ output: process.stdout
2028
+ });
2029
+ console.log(`
2030
+ Claude Remote Control is launching in spawn mode which lets you create new sessions in this project from CoStrict on Web or your Mobile app. Learn more here: https://costrict.ai/docs/en/remote-control
2031
+
2032
+ Spawn mode for this project:
2033
+ ` + ` [1] same-dir \u2014 sessions share the current directory (default)
2034
+ ` + ` [2] worktree \u2014 each session gets an isolated git worktree
2035
+
2036
+ ` + `This can be changed later or explicitly set with --spawn=same-dir or --spawn=worktree.
2037
+ `);
2038
+ const answer = await new Promise((resolve2) => {
2039
+ rl.question("Choose [1/2] (default: 1): ", resolve2);
2040
+ });
2041
+ rl.close();
2042
+ const chosen = answer.trim() === "2" ? "worktree" : "same-dir";
2043
+ savedSpawnMode = chosen;
2044
+ logEvent("tengu_bridge_spawn_mode_chosen", {
2045
+ spawn_mode: chosen
2046
+ });
2047
+ saveCurrentProjectConfig((current) => {
2048
+ if (current.remoteControlSpawnMode === chosen)
2049
+ return current;
2050
+ return { ...current, remoteControlSpawnMode: chosen };
2051
+ });
2052
+ }
2053
+ let spawnModeSource;
2054
+ let spawnMode;
2055
+ if (resumeSessionId) {
2056
+ spawnMode = "single-session";
2057
+ spawnModeSource = "resume";
2058
+ } else if (parsedSpawnMode !== undefined) {
2059
+ spawnMode = parsedSpawnMode;
2060
+ spawnModeSource = "flag";
2061
+ } else if (savedSpawnMode !== undefined) {
2062
+ spawnMode = savedSpawnMode;
2063
+ spawnModeSource = "saved";
2064
+ } else {
2065
+ spawnMode = multiSessionEnabled ? "same-dir" : "single-session";
2066
+ spawnModeSource = "gate_default";
2067
+ }
2068
+ const maxSessions = spawnMode === "single-session" ? 1 : parsedCapacity ?? SPAWN_SESSIONS_DEFAULT;
2069
+ const preCreateSession = parsedCreateSessionInDir ?? true;
2070
+ if (!resumeSessionId) {
2071
+ const { clearBridgePointer } = await import("./chunk-4pj7g85r.js");
2072
+ await clearBridgePointer(dir);
2073
+ }
2074
+ if (spawnMode === "worktree" && !worktreeAvailable) {
2075
+ console.error(`Error: Worktree mode requires a git repository or WorktreeCreate hooks configured. Use --spawn=session for single-session mode.`);
2076
+ process.exit(1);
2077
+ }
2078
+ const branch = await getBranch();
2079
+ const gitRepoUrl = await getRemoteUrl();
2080
+ const machineName = hostname();
2081
+ const bridgeId = randomUUID();
2082
+ const { handleOAuth401Error } = await import("./chunk-t7y6mg54.js");
2083
+ const api = createBridgeApiClient({
2084
+ baseUrl,
2085
+ getAccessToken: getBridgeAccessToken,
2086
+ runnerVersion: "4.1.2",
2087
+ onDebug: logForDebugging,
2088
+ onAuth401: handleOAuth401Error,
2089
+ getTrustedDeviceToken
2090
+ });
2091
+ let reuseEnvironmentId;
2092
+ if (resumeSessionId) {
2093
+ try {
2094
+ validateBridgeId(resumeSessionId, "sessionId");
2095
+ } catch {
2096
+ console.error(`Error: Invalid session ID "${resumeSessionId}". Session IDs must not contain unsafe characters.`);
2097
+ process.exit(1);
2098
+ }
2099
+ await checkAndRefreshOAuthTokenIfNeeded();
2100
+ clearOAuthTokenCache();
2101
+ const { getBridgeSession } = await import("./chunk-3c22f5y8.js");
2102
+ const session = await getBridgeSession(resumeSessionId, {
2103
+ baseUrl,
2104
+ getAccessToken: getBridgeAccessToken
2105
+ });
2106
+ if (!session) {
2107
+ if (resumePointerDir) {
2108
+ const { clearBridgePointer } = await import("./chunk-4pj7g85r.js");
2109
+ await clearBridgePointer(resumePointerDir);
2110
+ }
2111
+ console.error(`Error: Session ${resumeSessionId} not found. It may have been archived or expired, or your login may have lapsed (run \`claude /login\`).`);
2112
+ process.exit(1);
2113
+ }
2114
+ if (!session.environment_id) {
2115
+ if (resumePointerDir) {
2116
+ const { clearBridgePointer } = await import("./chunk-4pj7g85r.js");
2117
+ await clearBridgePointer(resumePointerDir);
2118
+ }
2119
+ console.error(`Error: Session ${resumeSessionId} has no environment_id. It may never have been attached to a bridge.`);
2120
+ process.exit(1);
2121
+ }
2122
+ reuseEnvironmentId = session.environment_id;
2123
+ logForDebugging(`[bridge:init] Resuming session ${resumeSessionId} on environment ${reuseEnvironmentId}`);
2124
+ }
2125
+ const config = {
2126
+ dir,
2127
+ machineName,
2128
+ branch,
2129
+ gitRepoUrl,
2130
+ maxSessions,
2131
+ spawnMode,
2132
+ verbose,
2133
+ sandbox,
2134
+ bridgeId,
2135
+ workerType: "claude_code",
2136
+ environmentId: randomUUID(),
2137
+ reuseEnvironmentId,
2138
+ apiBaseUrl: baseUrl,
2139
+ sessionIngressUrl,
2140
+ debugFile,
2141
+ sessionTimeoutMs
2142
+ };
2143
+ logForDebugging(`[bridge:init] bridgeId=${bridgeId}${reuseEnvironmentId ? ` reuseEnvironmentId=${reuseEnvironmentId}` : ""} dir=${dir} branch=${branch} gitRepoUrl=${gitRepoUrl} machine=${machineName}`);
2144
+ logForDebugging(`[bridge:init] apiBaseUrl=${baseUrl} sessionIngressUrl=${sessionIngressUrl}`);
2145
+ logForDebugging(`[bridge:init] sandbox=${sandbox}${debugFile ? ` debugFile=${debugFile}` : ""}`);
2146
+ let environmentId;
2147
+ let environmentSecret;
2148
+ try {
2149
+ const reg = await api.registerBridgeEnvironment(config);
2150
+ environmentId = reg.environment_id;
2151
+ environmentSecret = reg.environment_secret;
2152
+ } catch (err) {
2153
+ logEvent("tengu_bridge_registration_failed", {
2154
+ status: err instanceof BridgeFatalError ? err.status : undefined
2155
+ });
2156
+ console.error(err instanceof BridgeFatalError && err.status === 404 ? "Remote Control environments are not available for your account." : `Error: ${errorMessage(err)}`);
2157
+ process.exit(1);
2158
+ }
2159
+ let effectiveResumeSessionId;
2160
+ if (resumeSessionId) {
2161
+ if (reuseEnvironmentId && environmentId !== reuseEnvironmentId) {
2162
+ logError(new Error(`Bridge resume env mismatch: requested ${reuseEnvironmentId}, backend returned ${environmentId}. Falling back to fresh session.`));
2163
+ console.warn(`Warning: Could not resume session ${resumeSessionId} \u2014 its environment has expired. Creating a fresh session instead.`);
2164
+ } else {
2165
+ const infraResumeId = toInfraSessionId(resumeSessionId);
2166
+ const reconnectCandidates = infraResumeId === resumeSessionId ? [resumeSessionId] : [resumeSessionId, infraResumeId];
2167
+ let reconnected = false;
2168
+ let lastReconnectErr;
2169
+ for (const candidateId of reconnectCandidates) {
2170
+ try {
2171
+ await api.reconnectSession(environmentId, candidateId);
2172
+ logForDebugging(`[bridge:init] Session ${candidateId} re-queued via bridge/reconnect`);
2173
+ effectiveResumeSessionId = resumeSessionId;
2174
+ reconnected = true;
2175
+ break;
2176
+ } catch (err) {
2177
+ lastReconnectErr = err;
2178
+ logForDebugging(`[bridge:init] reconnectSession(${candidateId}) failed: ${errorMessage(err)}`);
2179
+ }
2180
+ }
2181
+ if (!reconnected) {
2182
+ const err = lastReconnectErr;
2183
+ const isFatal = err instanceof BridgeFatalError;
2184
+ if (resumePointerDir && isFatal) {
2185
+ const { clearBridgePointer } = await import("./chunk-4pj7g85r.js");
2186
+ await clearBridgePointer(resumePointerDir);
2187
+ }
2188
+ console.error(isFatal ? `Error: ${errorMessage(err)}` : `Error: Failed to reconnect session ${resumeSessionId}: ${errorMessage(err)}
2189
+ The session may still be resumable \u2014 try running the same command again.`);
2190
+ process.exit(1);
2191
+ }
2192
+ }
2193
+ }
2194
+ logForDebugging(`[bridge:init] Registered, server environmentId=${environmentId}`);
2195
+ const startupPollConfig = getPollIntervalConfig();
2196
+ logEvent("tengu_bridge_started", {
2197
+ max_sessions: config.maxSessions,
2198
+ has_debug_file: !!config.debugFile,
2199
+ sandbox: config.sandbox,
2200
+ verbose: config.verbose,
2201
+ heartbeat_interval_ms: startupPollConfig.non_exclusive_heartbeat_interval_ms,
2202
+ spawn_mode: config.spawnMode,
2203
+ spawn_mode_source: spawnModeSource,
2204
+ multi_session_gate: multiSessionEnabled,
2205
+ pre_create_session: preCreateSession,
2206
+ worktree_available: worktreeAvailable
2207
+ });
2208
+ logForDiagnosticsNoPII("info", "bridge_started", {
2209
+ max_sessions: config.maxSessions,
2210
+ sandbox: config.sandbox,
2211
+ spawn_mode: config.spawnMode
2212
+ });
2213
+ const spawner = createSessionSpawner({
2214
+ execPath: process.execPath,
2215
+ scriptArgs: spawnScriptArgs(),
2216
+ env: process.env,
2217
+ verbose,
2218
+ sandbox,
2219
+ debugFile,
2220
+ permissionMode,
2221
+ onDebug: logForDebugging,
2222
+ onActivity: (sessionId, activity) => {
2223
+ logForDebugging(`[bridge:activity] sessionId=${sessionId} ${activity.type} ${activity.summary}`);
2224
+ },
2225
+ onPermissionRequest: (sessionId, request, _accessToken) => {
2226
+ logForDebugging(`[bridge:perm] sessionId=${sessionId} tool=${request.request.tool_name} request_id=${request.request_id} (not auto-approving)`);
2227
+ }
2228
+ });
2229
+ const logger = createBridgeLogger({ verbose });
2230
+ const { parseGitHubRepository } = await import("./chunk-x2taqvwd.js");
2231
+ const ownerRepo = gitRepoUrl ? parseGitHubRepository(gitRepoUrl) : null;
2232
+ const repoName = ownerRepo ? ownerRepo.split("/").pop() : basename(dir);
2233
+ logger.setRepoInfo(repoName, branch);
2234
+ const toggleAvailable = spawnMode !== "single-session" && worktreeAvailable;
2235
+ if (toggleAvailable) {
2236
+ logger.setSpawnModeDisplay(spawnMode);
2237
+ }
2238
+ const onStdinData = (data) => {
2239
+ if (data[0] === 3 || data[0] === 4) {
2240
+ process.emit("SIGINT");
2241
+ return;
2242
+ }
2243
+ if (data[0] === 32) {
2244
+ logger.toggleQr();
2245
+ return;
2246
+ }
2247
+ if (data[0] === 119) {
2248
+ if (!toggleAvailable)
2249
+ return;
2250
+ const newMode = config.spawnMode === "same-dir" ? "worktree" : "same-dir";
2251
+ config.spawnMode = newMode;
2252
+ logEvent("tengu_bridge_spawn_mode_toggled", {
2253
+ spawn_mode: newMode
2254
+ });
2255
+ logger.logStatus(newMode === "worktree" ? "Spawn mode: worktree (new sessions get isolated git worktrees)" : "Spawn mode: same-dir (new sessions share the current directory)");
2256
+ logger.setSpawnModeDisplay(newMode);
2257
+ logger.refreshDisplay();
2258
+ saveCurrentProjectConfig((current) => {
2259
+ if (current.remoteControlSpawnMode === newMode)
2260
+ return current;
2261
+ return { ...current, remoteControlSpawnMode: newMode };
2262
+ });
2263
+ return;
2264
+ }
2265
+ };
2266
+ if (process.stdin.isTTY) {
2267
+ process.stdin.setRawMode(true);
2268
+ process.stdin.resume();
2269
+ process.stdin.on("data", onStdinData);
2270
+ }
2271
+ const controller = new AbortController;
2272
+ const onSigint = () => {
2273
+ logForDebugging("[bridge:shutdown] SIGINT received, shutting down");
2274
+ controller.abort();
2275
+ };
2276
+ const onSigterm = () => {
2277
+ logForDebugging("[bridge:shutdown] SIGTERM received, shutting down");
2278
+ controller.abort();
2279
+ };
2280
+ process.on("SIGINT", onSigint);
2281
+ process.on("SIGTERM", onSigterm);
2282
+ let initialSessionId = effectiveResumeSessionId ? effectiveResumeSessionId : null;
2283
+ if (preCreateSession && !effectiveResumeSessionId) {
2284
+ const { createBridgeSession } = await import("./chunk-3c22f5y8.js");
2285
+ try {
2286
+ initialSessionId = await createBridgeSession({
2287
+ environmentId,
2288
+ title: name,
2289
+ events: [],
2290
+ gitRepoUrl,
2291
+ branch,
2292
+ signal: controller.signal,
2293
+ baseUrl,
2294
+ getAccessToken: getBridgeAccessToken,
2295
+ permissionMode
2296
+ });
2297
+ if (initialSessionId) {
2298
+ logForDebugging(`[bridge:init] Created initial session ${initialSessionId}`);
2299
+ }
2300
+ } catch (err) {
2301
+ logForDebugging(`[bridge:init] Session creation failed (non-fatal): ${errorMessage(err)}`);
2302
+ }
2303
+ }
2304
+ let pointerRefreshTimer = null;
2305
+ if (initialSessionId && spawnMode === "single-session") {
2306
+ const { writeBridgePointer } = await import("./chunk-4pj7g85r.js");
2307
+ const pointerPayload = {
2308
+ sessionId: initialSessionId,
2309
+ environmentId,
2310
+ source: "standalone"
2311
+ };
2312
+ await writeBridgePointer(config.dir, pointerPayload);
2313
+ pointerRefreshTimer = setInterval(writeBridgePointer, 3600000, config.dir, pointerPayload);
2314
+ pointerRefreshTimer.unref?.();
2315
+ }
2316
+ try {
2317
+ await runBridgeLoop(config, environmentId, environmentSecret, api, spawner, logger, controller.signal, undefined, initialSessionId ?? undefined, async () => {
2318
+ clearOAuthTokenCache();
2319
+ await checkAndRefreshOAuthTokenIfNeeded();
2320
+ return getBridgeAccessToken();
2321
+ });
2322
+ } finally {
2323
+ if (pointerRefreshTimer !== null) {
2324
+ clearInterval(pointerRefreshTimer);
2325
+ }
2326
+ process.off("SIGINT", onSigint);
2327
+ process.off("SIGTERM", onSigterm);
2328
+ process.stdin.off("data", onStdinData);
2329
+ if (process.stdin.isTTY) {
2330
+ process.stdin.setRawMode(false);
2331
+ }
2332
+ process.stdin.pause();
2333
+ }
2334
+ process.exit(0);
2335
+ }
2336
+
1431
2337
  class BridgeHeadlessPermanentError extends Error {
1432
2338
  constructor(message) {
1433
2339
  super(message);
@@ -1440,9 +2346,9 @@ async function runBridgeHeadless(opts, signal) {
1440
2346
  const { setOriginalCwd, setCwdState } = await import("./chunk-3pb880dx.js");
1441
2347
  setOriginalCwd(dir);
1442
2348
  setCwdState(dir);
1443
- const { enableConfigs, checkHasTrustDialogAccepted } = await import("./chunk-1dg4nrws.js");
2349
+ const { enableConfigs, checkHasTrustDialogAccepted } = await import("./chunk-ycsh7pst.js");
1444
2350
  enableConfigs();
1445
- const { initSinks } = await import("./chunk-f2d9gmzw.js");
2351
+ const { initSinks } = await import("./chunk-ttzyw0y7.js");
1446
2352
  initSinks();
1447
2353
  if (!checkHasTrustDialogAccepted()) {
1448
2354
  throw new BridgeHeadlessPermanentError(`Workspace not trusted: ${dir}. Run \`claude\` in that directory first to accept the trust dialog.`);
@@ -1450,14 +2356,14 @@ async function runBridgeHeadless(opts, signal) {
1450
2356
  if (!opts.getAccessToken()) {
1451
2357
  throw new Error(BRIDGE_LOGIN_ERROR);
1452
2358
  }
1453
- const { getBridgeBaseUrl } = await import("./chunk-dkzq1yj3.js");
2359
+ const { getBridgeBaseUrl } = await import("./chunk-swtk97hy.js");
1454
2360
  const baseUrl = getBridgeBaseUrl();
1455
2361
  if (baseUrl.startsWith("http://") && !baseUrl.includes("localhost") && !baseUrl.includes("127.0.0.1")) {
1456
2362
  throw new BridgeHeadlessPermanentError("Remote Control base URL uses HTTP. Only HTTPS or localhost HTTP is allowed.");
1457
2363
  }
1458
2364
  const sessionIngressUrl = process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL || baseUrl;
1459
- const { getBranch, getRemoteUrl, findGitRoot } = await import("./chunk-5n19f2r9.js");
1460
- const { hasWorktreeCreateHook } = await import("./chunk-p2r92sj1.js");
2365
+ const { getBranch, getRemoteUrl, findGitRoot } = await import("./chunk-z124zj20.js");
2366
+ const { hasWorktreeCreateHook } = await import("./chunk-1z6393pz.js");
1461
2367
  if (opts.spawnMode === "worktree") {
1462
2368
  const worktreeAvailable = hasWorktreeCreateHook() || findGitRoot(dir) !== null;
1463
2369
  if (!worktreeAvailable) {
@@ -1487,7 +2393,7 @@ async function runBridgeHeadless(opts, signal) {
1487
2393
  const api = createBridgeApiClient({
1488
2394
  baseUrl,
1489
2395
  getAccessToken: opts.getAccessToken,
1490
- runnerVersion: "4.1.1",
2396
+ runnerVersion: "4.1.2",
1491
2397
  onDebug: log,
1492
2398
  onAuth401: opts.onAuth401,
1493
2399
  getTrustedDeviceToken
@@ -1514,7 +2420,7 @@ async function runBridgeHeadless(opts, signal) {
1514
2420
  logger.printBanner(config, environmentId);
1515
2421
  let initialSessionId;
1516
2422
  if (opts.createSessionOnStart) {
1517
- const { createBridgeSession } = await import("./chunk-6nqv04m4.js");
2423
+ const { createBridgeSession } = await import("./chunk-3c22f5y8.js");
1518
2424
  try {
1519
2425
  const sid = await createBridgeSession({
1520
2426
  environmentId,
@@ -1567,75 +2473,7 @@ function createHeadlessBridgeLogger(log) {
1567
2473
  };
1568
2474
  }
1569
2475
 
1570
- // src/daemon/workerRegistry.ts
1571
- init_auth();
1572
- init_errors();
1573
- var EXIT_CODE_PERMANENT = 78;
1574
- var EXIT_CODE_TRANSIENT = 1;
1575
- async function runDaemonWorker(kind) {
1576
- if (!kind) {
1577
- console.error("Error: --daemon-worker requires a worker kind");
1578
- process.exitCode = EXIT_CODE_PERMANENT;
1579
- return;
1580
- }
1581
- switch (kind) {
1582
- case "remoteControl":
1583
- await runRemoteControlWorker();
1584
- break;
1585
- default:
1586
- console.error(`Error: unknown daemon worker kind '${kind}'`);
1587
- process.exitCode = EXIT_CODE_PERMANENT;
1588
- }
1589
- }
1590
- async function runRemoteControlWorker() {
1591
- const dir = process.env.DAEMON_WORKER_DIR || resolve2(".");
1592
- const name = process.env.DAEMON_WORKER_NAME || undefined;
1593
- const spawnMode = process.env.DAEMON_WORKER_SPAWN_MODE || "same-dir";
1594
- const capacity = parseInt(process.env.DAEMON_WORKER_CAPACITY || "4", 10);
1595
- const permissionMode = process.env.DAEMON_WORKER_PERMISSION || undefined;
1596
- const sandbox = process.env.DAEMON_WORKER_SANDBOX === "1";
1597
- const sessionTimeoutMs = process.env.DAEMON_WORKER_TIMEOUT_MS ? parseInt(process.env.DAEMON_WORKER_TIMEOUT_MS, 10) : undefined;
1598
- const createSessionOnStart = process.env.DAEMON_WORKER_CREATE_SESSION !== "0";
1599
- const controller = new AbortController;
1600
- const onSignal = () => controller.abort();
1601
- process.on("SIGTERM", onSignal);
1602
- process.on("SIGINT", onSignal);
1603
- const opts = {
1604
- dir,
1605
- name,
1606
- spawnMode,
1607
- capacity,
1608
- permissionMode,
1609
- sandbox,
1610
- sessionTimeoutMs,
1611
- createSessionOnStart,
1612
- getAccessToken: () => getClaudeAIOAuthTokens()?.accessToken,
1613
- onAuth401: async (_failedToken) => {
1614
- const tokens = getClaudeAIOAuthTokens();
1615
- return !!tokens?.accessToken;
1616
- },
1617
- log: (s) => {
1618
- console.log(`[remoteControl] ${s}`);
1619
- }
1620
- };
1621
- try {
1622
- await runBridgeHeadless(opts, controller.signal);
1623
- } catch (err) {
1624
- if (err instanceof BridgeHeadlessPermanentError) {
1625
- console.error(`[remoteControl] permanent error: ${err.message}`);
1626
- process.exitCode = EXIT_CODE_PERMANENT;
1627
- } else {
1628
- console.error(`[remoteControl] transient error: ${errorMessage(err)}`);
1629
- process.exitCode = EXIT_CODE_TRANSIENT;
1630
- }
1631
- } finally {
1632
- process.off("SIGTERM", onSignal);
1633
- process.off("SIGINT", onSignal);
1634
- }
1635
- }
1636
- export {
1637
- runDaemonWorker
1638
- };
2476
+ export { runBridgeLoop, isConnectionError, isServerError, parseArgs, bridgeMain, BridgeHeadlessPermanentError, runBridgeHeadless };
1639
2477
 
1640
- //# debugId=9F3830CC65D0283B64756E2164756E21
1641
- //# sourceMappingURL=chunk-b0hjzm3t.js.map
2478
+ //# debugId=3A29E5A56587758664756E2164756E21
2479
+ //# sourceMappingURL=chunk-2d4az1sb.js.map