@unieai/code 0.0.10 → 0.0.12

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 (486) hide show
  1. package/README.en.md +6 -59
  2. package/README.md +5 -59
  3. package/dist/chunks/App-s5ex5j86.js +2 -0
  4. package/dist/chunks/ApproveApiKey-b4z6h2gn.js +2 -0
  5. package/dist/chunks/{assistant-yvtpv5sv.js → AssistantSessionChooser-g1vsya6h.js} +1 -1
  6. package/dist/chunks/BypassPermissionsModeDialog-jbg97eja.js +2 -0
  7. package/dist/chunks/ClaudeInChromeOnboarding-qa0pvwfw.js +2 -0
  8. package/dist/chunks/ClaudeMdExternalIncludesDialog-gqmed78y.js +2 -0
  9. package/dist/chunks/ConsoleOAuthFlow-yh72vs8j.js +2 -0
  10. package/dist/chunks/{DiffDialog-v8smgzpd.js → DiffDialog-t6vvtbb2.js} +1 -1
  11. package/dist/chunks/Doctor-k08ggw2j.js +2 -0
  12. package/dist/chunks/Grove-tkkskg8n.js +2 -0
  13. package/dist/chunks/ITermBackend-73waaahf.js +2 -0
  14. package/dist/chunks/{InProcessTransport-57c2w5v4.js → InProcessTransport-qwjgb17j.js} +1 -1
  15. package/dist/chunks/InvalidConfigDialog-zmqw3fj1.js +2 -0
  16. package/dist/chunks/InvalidSettingsDialog-tnd5hymg.js +2 -0
  17. package/dist/chunks/Onboarding-p0tq6pgz.js +2 -0
  18. package/dist/chunks/REPL-hjjz80kq.js +2 -0
  19. package/dist/chunks/ResumeConversation-krn9hqb1.js +2 -0
  20. package/dist/chunks/{SnapshotUpdateDialog-5yvfnp0q.js → SnapshotUpdateDialog-raq029pd.js} +1 -1
  21. package/dist/chunks/TeleportProgress-vyy2k3bv.js +2 -0
  22. package/dist/chunks/TeleportRepoMismatchDialog-ff0h2cnq.js +2 -0
  23. package/dist/chunks/TeleportResumeWrapper-esjykret.js +2 -0
  24. package/dist/chunks/{TmuxBackend-j665sv6f.js → TmuxBackend-14kmnkcb.js} +1 -1
  25. package/dist/chunks/ToolSearchTool-w4t61c7d.js +2 -0
  26. package/dist/chunks/TrustDialog-7fvaze2x.js +2 -0
  27. package/dist/chunks/TungstenTool-rv96z549.js +2 -0
  28. package/dist/chunks/add-dir-kqw72mky.js +2 -0
  29. package/dist/chunks/agents-3exybgtb.js +4 -0
  30. package/dist/chunks/{agents-e7x38q37.js → agents-z66twpqr.js} +1 -1
  31. package/dist/chunks/ant-claude-for-chrome-mcp-712xg07f.js +2 -0
  32. package/dist/chunks/api-z8svc3xt.js +2 -0
  33. package/dist/chunks/asciicast-vzd7qjbb.js +2 -0
  34. package/dist/chunks/{AssistantSessionChooser-0r5zamt1.js → assistant-ftzr3mjp.js} +1 -1
  35. package/dist/chunks/auth-gbyfq0g2.js +2 -0
  36. package/dist/chunks/auth-wk077awh.js +2 -0
  37. package/dist/chunks/backgroundHousekeeping-m8gthtkh.js +2 -0
  38. package/dist/chunks/branch-1d0b8590.js +5 -0
  39. package/dist/chunks/{bridgePointer-9q6wh2ct.js → bridgePointer-vhd47np6.js} +1 -1
  40. package/dist/chunks/btw-s3r5jhyd.js +2 -0
  41. package/dist/chunks/buddy-xzm5npk8.js +2 -0
  42. package/dist/chunks/{cachedMicrocompact-thnhx1zt.js → cachedMicrocompact-6j3zxr4g.js} +1 -1
  43. package/dist/chunks/caches-fbggdeq7.js +2 -0
  44. package/dist/chunks/chrome-mdyx0s5j.js +2 -0
  45. package/dist/chunks/{chromeNativeHost-nnjkj164.js → chromeNativeHost-8wc6wcr6.js} +1 -1
  46. package/dist/chunks/{claudeDesktop-nsangyk5.js → claudeDesktop-p5bfxmvz.js} +1 -1
  47. package/dist/chunks/{cleanup-mv462dsh.js → cleanup-q46nbce1.js} +1 -1
  48. package/dist/chunks/clear-fwad6zxy.js +2 -0
  49. package/dist/chunks/{cli-sbp2221d.js → cli-0dc8sd37.js} +2 -2
  50. package/dist/chunks/{cli-3xhqacdd.js → cli-0qt9btbe.js} +2 -2
  51. package/dist/chunks/{cli-4j5yyvek.js → cli-0w4wc1z0.js} +2 -2
  52. package/dist/chunks/{cli-r6hm1q63.js → cli-15sqp3mq.js} +2 -2
  53. package/dist/chunks/{cli-45ftgn85.js → cli-15w3eaed.js} +1 -1
  54. package/dist/chunks/{cli-b7wx1479.js → cli-19ncan36.js} +1 -1
  55. package/dist/chunks/{cli-hx28w3cq.js → cli-1jp3rm7n.js} +1 -1
  56. package/dist/chunks/{cli-90b87f45.js → cli-1n8he7s8.js} +2 -2
  57. package/dist/chunks/{cli-bthzmdgv.js → cli-1ny2386w.js} +2 -2
  58. package/dist/chunks/{cli-vq899n8p.js → cli-27mzrnr8.js} +1 -1
  59. package/dist/chunks/{cli-gnjff7md.js → cli-2rw44zfx.js} +2 -2
  60. package/dist/chunks/{cli-7gpep1x5.js → cli-2rwjx3w0.js} +1 -1
  61. package/dist/chunks/{cli-jqppy97b.js → cli-2wd8eaac.js} +2 -2
  62. package/dist/chunks/{cli-3hwpymrd.js → cli-350pymj4.js} +2 -2
  63. package/dist/chunks/{cli-w754xmyv.js → cli-3ac555qw.js} +2 -2
  64. package/dist/chunks/{cli-8kyjh67j.js → cli-3gwqrmcd.js} +1 -1
  65. package/dist/chunks/{cli-msr9n6da.js → cli-3m8n808e.js} +2 -2
  66. package/dist/chunks/{cli-ptv3h2tx.js → cli-42kma5r3.js} +1 -1
  67. package/dist/chunks/{cli-r9p0g894.js → cli-49m97nbg.js} +2 -2
  68. package/dist/chunks/{cli-bkxwwj81.js → cli-4a4bb1kf.js} +1 -1
  69. package/dist/chunks/{cli-3bxtq5dc.js → cli-4ewb3q42.js} +2 -2
  70. package/dist/chunks/{cli-v3mf1g0z.js → cli-4mvvtchx.js} +2 -2
  71. package/dist/chunks/{cli-r2p5bkx5.js → cli-4nejhkd0.js} +2 -2
  72. package/dist/chunks/{cli-dx46fn1w.js → cli-51720d82.js} +2 -2
  73. package/dist/chunks/cli-55jdp9ky.js +3 -0
  74. package/dist/chunks/{cli-6vwdnz9p.js → cli-55ntywtj.js} +1 -1
  75. package/dist/chunks/{cli-pz8vxqw0.js → cli-57yrpnaq.js} +2 -2
  76. package/dist/chunks/{cli-59ysj9y4.js → cli-5dt9yjha.js} +2 -2
  77. package/dist/chunks/{cli-e37w9dxm.js → cli-5f0w3fy6.js} +1 -1
  78. package/dist/chunks/{cli-z9jm4xjn.js → cli-5vsnhp97.js} +2 -2
  79. package/dist/chunks/{cli-x758qvv7.js → cli-61x73ksv.js} +1 -1
  80. package/dist/chunks/{cli-ye3qk73s.js → cli-66jj9zj3.js} +1 -1
  81. package/dist/chunks/{cli-zac1afnb.js → cli-6bxfdgv1.js} +1 -1
  82. package/dist/chunks/{cli-md1h6sbv.js → cli-6pdpyz1a.js} +1 -1
  83. package/dist/chunks/{cli-mejr8b5m.js → cli-6yprtw88.js} +2 -2
  84. package/dist/chunks/{cli-qs0v3mf6.js → cli-73jf8hyz.js} +2 -2
  85. package/dist/chunks/{cli-948we41z.js → cli-749tdaqc.js} +2 -2
  86. package/dist/chunks/{cli-vxxkrd5y.js → cli-764c4bsm.js} +2 -2
  87. package/dist/chunks/cli-78apjp3t.js +3 -0
  88. package/dist/chunks/{cli-k0jpcxwa.js → cli-7c99j0pt.js} +2 -2
  89. package/dist/chunks/{cli-by5b2216.js → cli-89x414pj.js} +2 -2
  90. package/dist/chunks/{cli-fqb71hy3.js → cli-8dmy2s42.js} +1 -1
  91. package/dist/chunks/cli-8hxz2qs6.js +3 -0
  92. package/dist/chunks/cli-8mk2zg4a.js +4 -0
  93. package/dist/chunks/{cli-29gcax34.js → cli-8qd16mt4.js} +2 -2
  94. package/dist/chunks/cli-95wg48h9.js +3 -0
  95. package/dist/chunks/{cli-wz9r5s81.js → cli-99mqr54v.js} +2 -2
  96. package/dist/chunks/{cli-8qk46mt3.js → cli-9aq7vxaq.js} +1 -1
  97. package/dist/chunks/{cli-zcpjf07m.js → cli-9z9r2set.js} +2 -2
  98. package/dist/chunks/{cli-2wvsym16.js → cli-a52ra30v.js} +1 -1
  99. package/dist/chunks/{cli-s6qk3rbv.js → cli-akcxtvv9.js} +2 -2
  100. package/dist/chunks/{cli-h3kcprht.js → cli-bmk0rb5v.js} +2 -2
  101. package/dist/chunks/{cli-pmzht94n.js → cli-br6zjh6x.js} +2 -2
  102. package/dist/chunks/{cli-z8hqtyjg.js → cli-c22wpdk4.js} +1 -1
  103. package/dist/chunks/{cli-zbt28krs.js → cli-c60c9qvm.js} +1 -1
  104. package/dist/chunks/{cli-3357rxva.js → cli-cqkne34j.js} +2 -2
  105. package/dist/chunks/{cli-0s65jzgr.js → cli-cwbxhdt1.js} +1 -1
  106. package/dist/chunks/{cli-xsap3gxj.js → cli-d0hzw78c.js} +1 -1
  107. package/dist/chunks/{cli-0b4dmvvw.js → cli-d53fhs6v.js} +2 -2
  108. package/dist/chunks/{cli-extf4h54.js → cli-dbdqrqmt.js} +1 -1
  109. package/dist/chunks/{cli-yf3sh3aw.js → cli-de1hwp88.js} +1 -1
  110. package/dist/chunks/cli-edkqs0ge.js +3 -0
  111. package/dist/chunks/{cli-dsnjsvqs.js → cli-er7z496e.js} +2 -2
  112. package/dist/chunks/{cli-atpfeg28.js → cli-eyw3czmn.js} +2 -2
  113. package/dist/chunks/{cli-tyxvdf66.js → cli-ezs5sney.js} +2 -2
  114. package/dist/chunks/{cli-tn47e131.js → cli-f63fdj4w.js} +2 -2
  115. package/dist/chunks/cli-fakdskp6.js +3 -0
  116. package/dist/chunks/{cli-nj726gac.js → cli-fdya77ch.js} +3 -3
  117. package/dist/chunks/{cli-b1dptek2.js → cli-fghyxar5.js} +2 -2
  118. package/dist/chunks/{cli-g1spmn9n.js → cli-fm14mg07.js} +1 -1
  119. package/dist/chunks/{cli-cr1hvkmz.js → cli-fs7yttfp.js} +2 -2
  120. package/dist/chunks/{cli-rcvta3zk.js → cli-fwrj8ybs.js} +2 -2
  121. package/dist/chunks/{cli-v77avvvk.js → cli-g4n9das2.js} +1 -1
  122. package/dist/chunks/{cli-cbdrqqf2.js → cli-g5wq5ptg.js} +2 -2
  123. package/dist/chunks/{cli-yrk194b9.js → cli-gq5fve62.js} +1 -1
  124. package/dist/chunks/{cli-nykt265k.js → cli-grxvgq2n.js} +1 -1
  125. package/dist/chunks/{cli-ffjjv4j8.js → cli-gtm212j6.js} +2 -2
  126. package/dist/chunks/{cli-skq9ktf8.js → cli-gxgdnjfn.js} +1 -1
  127. package/dist/chunks/{cli-x5z5m6y7.js → cli-h120wpk2.js} +1 -1
  128. package/dist/chunks/{cli-58t6a5n6.js → cli-h4a90xbh.js} +1 -1
  129. package/dist/chunks/cli-h4dspaac.js +3 -0
  130. package/dist/chunks/{cli-a98b285v.js → cli-hke6r0q8.js} +2 -2
  131. package/dist/chunks/{cli-jxwm52wg.js → cli-hzr2zraz.js} +1 -1
  132. package/dist/chunks/{cli-x4a9geyz.js → cli-j08dmxw5.js} +1 -1
  133. package/dist/chunks/{cli-jvs98a70.js → cli-ja540nr7.js} +1 -1
  134. package/dist/chunks/{cli-dr1ph0pp.js → cli-jegyadmb.js} +2 -2
  135. package/dist/chunks/{cli-xjx11p6m.js → cli-jgn9jprh.js} +2 -2
  136. package/dist/chunks/{cli-n3m134cf.js → cli-jj93qmmc.js} +2 -2
  137. package/dist/chunks/{cli-kje3t5yg.js → cli-jkj867t1.js} +3 -3
  138. package/dist/chunks/{cli-6he3kpeb.js → cli-k2nh5cby.js} +2 -2
  139. package/dist/chunks/{cli-3je4vtx7.js → cli-k4v08k8t.js} +2 -2
  140. package/dist/chunks/{cli-c2pn6csk.js → cli-khs3sj9k.js} +1 -1
  141. package/dist/chunks/{cli-shz2e0q5.js → cli-kq16afrr.js} +2 -2
  142. package/dist/chunks/{cli-2zh6c5xz.js → cli-kqv5b8zh.js} +1 -1
  143. package/dist/chunks/{cli-k8fd74g6.js → cli-m0z3rmf0.js} +2 -2
  144. package/dist/chunks/{cli-a72n4ej7.js → cli-m12smc5e.js} +1 -1
  145. package/dist/chunks/{cli-15zbq52w.js → cli-m8fq163z.js} +1 -1
  146. package/dist/chunks/{cli-1215h20m.js → cli-mb1qrqw1.js} +2 -2
  147. package/dist/chunks/{cli-50wh7ttg.js → cli-mbp8f3f3.js} +2 -2
  148. package/dist/chunks/{cli-5pb6kdxn.js → cli-me4e2p3e.js} +595 -595
  149. package/dist/chunks/{cli-vz1j9n38.js → cli-mj03488e.js} +2 -2
  150. package/dist/chunks/{cli-6dcra6rs.js → cli-ms5j6fff.js} +2 -2
  151. package/dist/chunks/{cli-0v6qg4zv.js → cli-msgx4pnp.js} +2 -2
  152. package/dist/chunks/cli-msmzt4c3.js +130 -0
  153. package/dist/chunks/{cli-h5yfk29j.js → cli-msw0vv86.js} +2 -2
  154. package/dist/chunks/{cli-ewts4g0p.js → cli-mzcsnm06.js} +2 -2
  155. package/dist/chunks/{cli-wr4k6ngg.js → cli-n5s5fnyj.js} +2 -2
  156. package/dist/chunks/{cli-ygq3fy9g.js → cli-ns0aaggm.js} +1 -1
  157. package/dist/chunks/{cli-1a2nss2m.js → cli-nvnj7r73.js} +1 -1
  158. package/dist/chunks/{cli-hpzy0mat.js → cli-p0vh69b9.js} +2 -2
  159. package/dist/chunks/{cli-zf7yzkn6.js → cli-p2cqnrnp.js} +2 -2
  160. package/dist/chunks/{cli-px7jhzgq.js → cli-pbc8sk2d.js} +2 -2
  161. package/dist/chunks/{cli-29078yxj.js → cli-pgg33dhw.js} +2 -2
  162. package/dist/chunks/cli-przq3zk6.js +3 -0
  163. package/dist/chunks/{cli-q9fn82b1.js → cli-q0156x0d.js} +2 -2
  164. package/dist/chunks/{cli-zdy5bccv.js → cli-q46epwyh.js} +1 -1
  165. package/dist/chunks/{cli-v8w48y51.js → cli-qaxvg7gv.js} +1 -1
  166. package/dist/chunks/{cli-ytj910yt.js → cli-qm684n63.js} +1 -1
  167. package/dist/chunks/{cli-2qec7gn4.js → cli-r3etpht1.js} +1 -1
  168. package/dist/chunks/{cli-amy2yafd.js → cli-r83ttew2.js} +2 -2
  169. package/dist/chunks/{cli-22zbzzap.js → cli-r9db9mqv.js} +1 -1
  170. package/dist/chunks/{cli-3q7meftn.js → cli-rjerv816.js} +2 -2
  171. package/dist/chunks/{cli-mx6xk0dw.js → cli-rvad3yhg.js} +2 -2
  172. package/dist/chunks/{cli-wfqsfwa2.js → cli-rxb5q8zw.js} +2 -2
  173. package/dist/chunks/{cli-7cn4gwqc.js → cli-s160fqyz.js} +2 -2
  174. package/dist/chunks/{cli-v2hg35qk.js → cli-s6vr7213.js} +2 -2
  175. package/dist/chunks/{cli-49dqgzsg.js → cli-s9fhtgmz.js} +2 -2
  176. package/dist/chunks/{cli-tezq577c.js → cli-scaqq0v9.js} +2 -2
  177. package/dist/chunks/{cli-15tr7ade.js → cli-sh9w2tbd.js} +1 -1
  178. package/dist/chunks/{cli-zd2e6bq1.js → cli-sycqd3xe.js} +4 -4
  179. package/dist/chunks/{cli-d06qr5p3.js → cli-t4j047cx.js} +2 -2
  180. package/dist/chunks/{cli-s5epnnj5.js → cli-t9jht3kb.js} +2 -2
  181. package/dist/chunks/{cli-bd1ryrzd.js → cli-tckzkegq.js} +1 -1
  182. package/dist/chunks/{cli-p2gt60aj.js → cli-tfv2qcgf.js} +1 -1
  183. package/dist/chunks/{cli-1qszxdan.js → cli-tq5z9qv3.js} +2 -2
  184. package/dist/chunks/{cli-wthnf2t5.js → cli-tt9a4124.js} +1 -1
  185. package/dist/chunks/{cli-8v5ajztt.js → cli-tyqh91zq.js} +1 -1
  186. package/dist/chunks/cli-v943fd6a.js +3 -0
  187. package/dist/chunks/{cli-wn4ywgbv.js → cli-v9f860t5.js} +2 -2
  188. package/dist/chunks/{cli-qc7zfabw.js → cli-vkvmhjha.js} +2 -2
  189. package/dist/chunks/{cli-6b6e5zj9.js → cli-vkzp66cm.js} +2 -2
  190. package/dist/chunks/{cli-6qhwqfwp.js → cli-vwg0v35a.js} +2 -2
  191. package/dist/chunks/{cli-x514vyva.js → cli-w1d8n9g3.js} +1 -1
  192. package/dist/chunks/cli-w52yvzkn.js +3 -0
  193. package/dist/chunks/{cli-et2cj5dc.js → cli-wbe1p8n2.js} +2 -2
  194. package/dist/chunks/{cli-5mdbbvnv.js → cli-wm8qb6j3.js} +1 -1
  195. package/dist/chunks/{cli-1tq57kq0.js → cli-wn2srq2e.js} +1 -1
  196. package/dist/chunks/{cli-088ac95n.js → cli-wt2bfbn0.js} +2 -2
  197. package/dist/chunks/{cli-jmypsed1.js → cli-x70v8rsj.js} +2 -2
  198. package/dist/chunks/{cli-5wh173wa.js → cli-x8xgga1a.js} +3 -3
  199. package/dist/chunks/{cli-2vc9kv40.js → cli-xfsqvp8r.js} +2 -2
  200. package/dist/chunks/{cli-6xmbrh42.js → cli-xmgm2573.js} +2 -2
  201. package/dist/chunks/{cli-d58ptbve.js → cli-xpa1neza.js} +2 -2
  202. package/dist/chunks/{cli-6bxmycm6.js → cli-yqbvprz7.js} +1 -1
  203. package/dist/chunks/{cli-bz32070f.js → cli-yrwenjxs.js} +1 -1
  204. package/dist/chunks/{cli-3p0mfsqg.js → cli-z5e72gsd.js} +1 -1
  205. package/dist/chunks/{cli-z2jpyr57.js → cli-zev50xap.js} +1 -1
  206. package/dist/chunks/{cli-mjz85907.js → cli-zjbzak9n.js} +1 -1
  207. package/dist/chunks/{cli-h2dynmt7.js → cli-zjfya500.js} +1 -1
  208. package/dist/chunks/{cli-60mdvk6q.js → cli-zp8s7q5w.js} +1 -1
  209. package/dist/chunks/{cli-znz72ctn.js → cli-zpcncwrv.js} +1 -1
  210. package/dist/chunks/{cli-ew59cmn3.js → cli-zxdnz6vp.js} +1 -1
  211. package/dist/chunks/client-dkpgx025.js +2 -0
  212. package/dist/chunks/color-zrm6r755.js +2 -0
  213. package/dist/chunks/commitAttribution-3y6pessz.js +2 -0
  214. package/dist/chunks/common-0bee37at.js +2 -0
  215. package/dist/chunks/compact-zmvj1pk0.js +4 -0
  216. package/dist/chunks/config-gj0gbg5g.js +2 -0
  217. package/dist/chunks/config-hbq35b68.js +2 -0
  218. package/dist/chunks/context-h1qc69rg.js +2 -0
  219. package/dist/chunks/context-noninteractive-7wbe6qvd.js +2 -0
  220. package/dist/chunks/conversation-fwnfp0p5.js +2 -0
  221. package/dist/chunks/{copy-bpypgpy8.js → copy-76r9v46d.js} +1 -1
  222. package/dist/chunks/cost-56r5xxqy.js +5 -0
  223. package/dist/chunks/createSession-m5y8fjy4.js +2 -0
  224. package/dist/chunks/desktop-z3jqgnw7.js +2 -0
  225. package/dist/chunks/detectRepository-w6wawmmg.js +2 -0
  226. package/dist/chunks/detection-1yb2c7hh.js +2 -0
  227. package/dist/chunks/{devtools-mt3vnaw3.js → devtools-10ba48t9.js} +1 -1
  228. package/dist/chunks/{diff-bcdc10jv.js → diff-05xxjeqc.js} +1 -1
  229. package/dist/chunks/doctor-hgwjdraj.js +2 -0
  230. package/dist/chunks/earlyInput-navj6cdn.js +2 -0
  231. package/dist/chunks/effort-a190c878.js +9 -0
  232. package/dist/chunks/executor-s42mdmqs.js +2 -0
  233. package/dist/chunks/exit-kyrjy6hb.js +2 -0
  234. package/dist/chunks/export-ct4sty4d.js +3 -0
  235. package/dist/chunks/extra-usage-noninteractive-byts9mme.js +2 -0
  236. package/dist/chunks/extra-usage-xh1mkrca.js +2 -0
  237. package/dist/chunks/fast-g4aa49jf.js +2 -0
  238. package/dist/chunks/feedback-m5r66qd5.js +2 -0
  239. package/dist/chunks/{files-fx3xz1bj.js → files-qrrrkjke.js} +1 -1
  240. package/dist/chunks/firstPartyEventLogger-mthxtmgc.js +2 -0
  241. package/dist/chunks/gates-yhakv4vb.js +2 -0
  242. package/dist/chunks/git-c39vd9dm.js +2 -0
  243. package/dist/chunks/goal-24dr7fwz.js +2 -0
  244. package/dist/chunks/growthbook-f7ag30hy.js +2 -0
  245. package/dist/chunks/heapdump-16gnh3zm.js +7 -0
  246. package/dist/chunks/help-rgcakcxe.js +2 -0
  247. package/dist/chunks/hooks-8dh43zmv.js +2 -0
  248. package/dist/chunks/{hooks-7kspbr6v.js → hooks-c7fqwas5.js} +1 -1
  249. package/dist/chunks/{ide-5bsqkr23.js → ide-q83qr9cn.js} +1 -1
  250. package/dist/chunks/index-v875zpde.js +2 -0
  251. package/dist/chunks/initReplBridge-zfwxgpsm.js +2 -0
  252. package/dist/chunks/ink-vkxsn90v.js +2 -0
  253. package/dist/chunks/{insights-z9edzgf1.js → insights-4fwap4e5.js} +1 -1
  254. package/dist/chunks/install-7nxzmgp5.js +2 -0
  255. package/dist/chunks/{install-github-app-918fh4r2.js → install-github-app-djzea7r4.js} +1 -1
  256. package/dist/chunks/install-slack-app-3rde0k08.js +2 -0
  257. package/dist/chunks/{instrumentation-b8ysw74t.js → instrumentation-223qqr23.js} +1 -1
  258. package/dist/chunks/keybindings-6t5f69wx.js +3 -0
  259. package/dist/chunks/loadAgentsDir-f8shfnw3.js +2 -0
  260. package/dist/chunks/loadPluginHooks-mdwjrjtp.js +2 -0
  261. package/dist/chunks/login-34j3xdr9.js +2 -0
  262. package/dist/chunks/logout-yew8mymc.js +2 -0
  263. package/dist/chunks/{main-sqrzjvg9.js → main-0b8hyp8h.js} +79 -79
  264. package/dist/chunks/mcp-9enw5a8j.js +2 -0
  265. package/dist/chunks/mcp-fn4yrf5y.js +3 -0
  266. package/dist/chunks/{mcp-dqh1vtvf.js → mcp-yymqpmv6.js} +3 -3
  267. package/dist/chunks/mcpServer-60jg9v58.js +2 -0
  268. package/dist/chunks/mcpServer-85gt8ypc.js +2 -0
  269. package/dist/chunks/memory-kam5z1cw.js +4 -0
  270. package/dist/chunks/{mobile-9m41g9bp.js → mobile-7zsgawnb.js} +1 -1
  271. package/dist/chunks/model-03987182.js +2 -0
  272. package/dist/chunks/model-wbxx5kcd.js +3 -0
  273. package/dist/chunks/{oauth-98khjrd8.js → oauth-y0p2y1w5.js} +1 -1
  274. package/dist/chunks/{output-style-1h6b2zf8.js → output-style-x148mzhn.js} +1 -1
  275. package/dist/chunks/parser-4y4b0e6b.js +2 -0
  276. package/dist/chunks/passes-jrmjk5zk.js +2 -0
  277. package/dist/chunks/permissions-karmgb0m.js +4 -0
  278. package/dist/chunks/plan-w0beh9bh.js +2 -0
  279. package/dist/chunks/plugin-6nwptn3s.js +2 -0
  280. package/dist/chunks/pluginStartupCheck-0nzv1ae9.js +2 -0
  281. package/dist/chunks/{plugins-pe89pa7p.js → plugins-vvf897b4.js} +2 -2
  282. package/dist/chunks/{preauthorizedConfig-g0aq6f03.js → preauthorizedConfig-p02f23jb.js} +1 -1
  283. package/dist/chunks/{print-cjjnhg9d.js → print-krwpbp2j.js} +4 -4
  284. package/dist/chunks/privacy-settings-m0mfykh0.js +2 -0
  285. package/dist/chunks/process-26nny2p0.js +2 -0
  286. package/dist/chunks/processBashCommand-8fqgv2ec.js +2 -0
  287. package/dist/chunks/{processSlashCommand-6d8rnm8v.js → processSlashCommand-q32wy80b.js} +1 -1
  288. package/dist/chunks/prompt-gw1e1gef.js +2 -0
  289. package/dist/chunks/prompt-xgw2hxrc.js +2 -0
  290. package/dist/chunks/provider-prompt-s26vatcw.js +2 -0
  291. package/dist/chunks/rate-limit-options-rd4rjfv5.js +2 -0
  292. package/dist/chunks/registry-fp7x9ekd.js +2 -0
  293. package/dist/chunks/release-notes-76y1r2s1.js +6 -0
  294. package/dist/chunks/reload-plugins-z0fepkva.js +3 -0
  295. package/dist/chunks/remote-env-nn9ngr99.js +2 -0
  296. package/dist/chunks/remoteBridgeCore-cg7qd8m4.js +2 -0
  297. package/dist/chunks/rename-fdjzyjar.js +2 -0
  298. package/dist/chunks/resume-4rvj8jbz.js +3 -0
  299. package/dist/chunks/{rewind-cpv2pwfx.js → rewind-r4g5njsg.js} +1 -1
  300. package/dist/chunks/sandbox-adapter-craea9vm.js +2 -0
  301. package/dist/chunks/sandbox-toggle-620bkz9q.js +2 -0
  302. package/dist/chunks/session-5vm1vwv1.js +3 -0
  303. package/dist/chunks/sessionFileAccessHooks-5jbvwabj.js +2 -0
  304. package/dist/chunks/sessionStorage-ffkhmn5q.js +2 -0
  305. package/dist/chunks/settings-s2bcajs6.js +2 -0
  306. package/dist/chunks/setup-fwcttwbm.js +2 -0
  307. package/dist/chunks/setup-pf09nfsj.js +7 -0
  308. package/dist/chunks/{setup-mecsw2ye.js → setup-vegs56f5.js} +1 -1
  309. package/dist/chunks/sinks-wd4ccgbf.js +2 -0
  310. package/dist/chunks/skills-evga8f7n.js +2 -0
  311. package/dist/chunks/startupProfiler-x5zbs2j7.js +2 -0
  312. package/dist/chunks/state-qpmfrvsv.js +2 -0
  313. package/dist/chunks/{stats-3v0r4e1v.js → stats-mgqf6r7c.js} +1 -1
  314. package/dist/chunks/status-78yks3jw.js +2 -0
  315. package/dist/chunks/stickers-bdp8w2gr.js +2 -0
  316. package/dist/chunks/subprocessEnv-s797f06r.js +2 -0
  317. package/dist/chunks/{systemPromptSections-htbs443y.js → systemPromptSections-07y2z2wn.js} +1 -1
  318. package/dist/chunks/tag-gd73kstd.js +12 -0
  319. package/dist/chunks/tasks-63qaca0z.js +2 -0
  320. package/dist/chunks/{teamHelpers-dddedf19.js → teamHelpers-8ykc4bxa.js} +1 -1
  321. package/dist/chunks/teammateModeSnapshot-ae9r29dy.js +2 -0
  322. package/dist/chunks/teleport-es58k4xz.js +2 -0
  323. package/dist/chunks/terminalSetup-gyh5z5e2.js +2 -0
  324. package/dist/chunks/theme-qrhbaht6.js +2 -0
  325. package/dist/chunks/thinkback-5bs7ezv5.js +2 -0
  326. package/dist/chunks/thinkback-play-1dy160y5.js +2 -0
  327. package/dist/chunks/toolSearch-6cv284b7.js +2 -0
  328. package/dist/chunks/trustedDevice-77ketbgg.js +2 -0
  329. package/dist/chunks/{ultrareviewCommand-jtmh2xb1.js → ultrareviewCommand-j23bjbf8.js} +1 -1
  330. package/dist/chunks/{update-mkzzbt54.js → update-w8wdxh3m.js} +1 -1
  331. package/dist/chunks/upgrade-nft7c1yk.js +2 -0
  332. package/dist/chunks/{upstreamproxy-hbbvxzb5.js → upstreamproxy-x405ef9p.js} +1 -1
  333. package/dist/chunks/usage-s5qgc615.js +2 -0
  334. package/dist/chunks/util-1geb93kp.js +2 -0
  335. package/dist/chunks/utils-6sb44pg8.js +2 -0
  336. package/dist/chunks/vim-kq91w44a.js +2 -0
  337. package/dist/chunks/worktree-0af6b1mt.js +2 -0
  338. package/dist/chunks/worktreeModeEnabled-ea6wb7aj.js +2 -0
  339. package/dist/cli.js +1 -1
  340. package/package.json +4 -1
  341. package/preload.ts +24 -2
  342. package/dist/chunks/App-skattzvx.js +0 -2
  343. package/dist/chunks/ApproveApiKey-1zk1g80v.js +0 -2
  344. package/dist/chunks/BypassPermissionsModeDialog-4bd5a65d.js +0 -2
  345. package/dist/chunks/ClaudeInChromeOnboarding-jrj410t2.js +0 -2
  346. package/dist/chunks/ClaudeMdExternalIncludesDialog-2bn5pwwr.js +0 -2
  347. package/dist/chunks/ConsoleOAuthFlow-8hn6958t.js +0 -2
  348. package/dist/chunks/Doctor-w0eqwfzb.js +0 -2
  349. package/dist/chunks/Grove-ygg0z9mr.js +0 -2
  350. package/dist/chunks/ITermBackend-ht0ds6se.js +0 -2
  351. package/dist/chunks/InvalidConfigDialog-h2jkde64.js +0 -2
  352. package/dist/chunks/InvalidSettingsDialog-3p7ehs0t.js +0 -2
  353. package/dist/chunks/Onboarding-np5yfyy1.js +0 -2
  354. package/dist/chunks/REPL-8811fta4.js +0 -2
  355. package/dist/chunks/ResumeConversation-d03pbgnw.js +0 -2
  356. package/dist/chunks/TeleportProgress-ghjbbh9h.js +0 -2
  357. package/dist/chunks/TeleportRepoMismatchDialog-hhcyekar.js +0 -2
  358. package/dist/chunks/TeleportResumeWrapper-66e7dnk5.js +0 -2
  359. package/dist/chunks/ToolSearchTool-dgwhh0gd.js +0 -2
  360. package/dist/chunks/TrustDialog-w9tj4t8r.js +0 -2
  361. package/dist/chunks/TungstenTool-7k2gt6pa.js +0 -2
  362. package/dist/chunks/add-dir-pg1rb88e.js +0 -2
  363. package/dist/chunks/agents-mcbqv3h3.js +0 -4
  364. package/dist/chunks/ant-claude-for-chrome-mcp-c765s2bt.js +0 -2
  365. package/dist/chunks/api-qvdz0vdp.js +0 -2
  366. package/dist/chunks/asciicast-ygqjzj6w.js +0 -2
  367. package/dist/chunks/auth-gkfrn4ga.js +0 -2
  368. package/dist/chunks/auth-y1hqesm6.js +0 -2
  369. package/dist/chunks/backgroundHousekeeping-wk8ne1wg.js +0 -2
  370. package/dist/chunks/branch-yre4hh7s.js +0 -5
  371. package/dist/chunks/btw-091q02sh.js +0 -2
  372. package/dist/chunks/buddy-5xd2vjhm.js +0 -2
  373. package/dist/chunks/caches-g4cc992y.js +0 -2
  374. package/dist/chunks/chrome-rd8crze6.js +0 -2
  375. package/dist/chunks/clear-25jzke5j.js +0 -2
  376. package/dist/chunks/cli-6hvqmebc.js +0 -3
  377. package/dist/chunks/cli-9hskw92e.js +0 -130
  378. package/dist/chunks/cli-avcnnw0n.js +0 -3
  379. package/dist/chunks/cli-e9pafjv1.js +0 -4
  380. package/dist/chunks/cli-gyp5wyzg.js +0 -3
  381. package/dist/chunks/cli-jbbxj53h.js +0 -3
  382. package/dist/chunks/cli-pbp5hza0.js +0 -3
  383. package/dist/chunks/cli-tzaj50bd.js +0 -3
  384. package/dist/chunks/cli-xzsc9n84.js +0 -3
  385. package/dist/chunks/cli-yv1znypb.js +0 -3
  386. package/dist/chunks/client-037bm52v.js +0 -2
  387. package/dist/chunks/color-ceqfke15.js +0 -2
  388. package/dist/chunks/commitAttribution-3ewwca68.js +0 -2
  389. package/dist/chunks/common-jn8w5r1w.js +0 -2
  390. package/dist/chunks/compact-631qpkbp.js +0 -4
  391. package/dist/chunks/config-6em7qq45.js +0 -2
  392. package/dist/chunks/config-h2e5ra49.js +0 -2
  393. package/dist/chunks/context-31c3znwn.js +0 -2
  394. package/dist/chunks/context-noninteractive-q418vz0p.js +0 -2
  395. package/dist/chunks/conversation-yz22h1cb.js +0 -2
  396. package/dist/chunks/cost-8rr9expn.js +0 -5
  397. package/dist/chunks/createSession-jratqxvc.js +0 -2
  398. package/dist/chunks/desktop-zq22ksq3.js +0 -2
  399. package/dist/chunks/detectRepository-djxyq37h.js +0 -2
  400. package/dist/chunks/detection-b18r43da.js +0 -2
  401. package/dist/chunks/doctor-cs43t62h.js +0 -2
  402. package/dist/chunks/earlyInput-361tx72y.js +0 -2
  403. package/dist/chunks/effort-qw83nert.js +0 -9
  404. package/dist/chunks/executor-rvxyyheh.js +0 -2
  405. package/dist/chunks/exit-kynz824m.js +0 -2
  406. package/dist/chunks/export-95j3srp6.js +0 -3
  407. package/dist/chunks/extra-usage-hxyp53v5.js +0 -2
  408. package/dist/chunks/extra-usage-noninteractive-53w28t1j.js +0 -2
  409. package/dist/chunks/fast-ec1hxnv7.js +0 -2
  410. package/dist/chunks/feedback-qtsk3t9f.js +0 -2
  411. package/dist/chunks/firstPartyEventLogger-4yfx731e.js +0 -2
  412. package/dist/chunks/gates-85t459a0.js +0 -2
  413. package/dist/chunks/git-e0mvprv8.js +0 -2
  414. package/dist/chunks/goal-ywc7exvv.js +0 -2
  415. package/dist/chunks/growthbook-ykj8089v.js +0 -2
  416. package/dist/chunks/heapdump-w6a13cfe.js +0 -7
  417. package/dist/chunks/help-enq1htxe.js +0 -2
  418. package/dist/chunks/hooks-wxm384wn.js +0 -2
  419. package/dist/chunks/initReplBridge-acrf7hyb.js +0 -2
  420. package/dist/chunks/ink-9vrw9yhe.js +0 -2
  421. package/dist/chunks/install-c8gv4wfg.js +0 -2
  422. package/dist/chunks/install-slack-app-1aqgxsb6.js +0 -2
  423. package/dist/chunks/keybindings-v92d2xht.js +0 -3
  424. package/dist/chunks/loadAgentsDir-k53rdwbr.js +0 -2
  425. package/dist/chunks/loadPluginHooks-rmzgs29p.js +0 -2
  426. package/dist/chunks/login-j9bz1g34.js +0 -2
  427. package/dist/chunks/logout-58wm6hsc.js +0 -2
  428. package/dist/chunks/mcp-z3j236hk.js +0 -3
  429. package/dist/chunks/mcp-zryxxcaz.js +0 -2
  430. package/dist/chunks/mcpServer-b2m7ewct.js +0 -2
  431. package/dist/chunks/mcpServer-xpq096r4.js +0 -2
  432. package/dist/chunks/memory-5tvqvktk.js +0 -4
  433. package/dist/chunks/model-cta1svwb.js +0 -3
  434. package/dist/chunks/model-d96jkka7.js +0 -2
  435. package/dist/chunks/parser-jpf6bfmz.js +0 -2
  436. package/dist/chunks/passes-reh6ja9j.js +0 -2
  437. package/dist/chunks/permissions-xgydmrq2.js +0 -4
  438. package/dist/chunks/plan-z4k8zj56.js +0 -2
  439. package/dist/chunks/plugin-0tztmcsg.js +0 -2
  440. package/dist/chunks/pluginStartupCheck-vxmkvt40.js +0 -2
  441. package/dist/chunks/privacy-settings-zbrc40a1.js +0 -2
  442. package/dist/chunks/process-msr26xa0.js +0 -2
  443. package/dist/chunks/processBashCommand-hnhy8brr.js +0 -2
  444. package/dist/chunks/prompt-cfaneybz.js +0 -2
  445. package/dist/chunks/prompt-wg6hfj0k.js +0 -2
  446. package/dist/chunks/provider-prompt-c8wew66t.js +0 -2
  447. package/dist/chunks/rate-limit-options-fyjqpxp3.js +0 -2
  448. package/dist/chunks/registry-ht9aazng.js +0 -2
  449. package/dist/chunks/release-notes-5v16zb9c.js +0 -6
  450. package/dist/chunks/reload-plugins-apyma8vs.js +0 -3
  451. package/dist/chunks/remote-env-p6ym55w6.js +0 -2
  452. package/dist/chunks/remoteBridgeCore-0v9x8112.js +0 -2
  453. package/dist/chunks/rename-j9rc9dwj.js +0 -2
  454. package/dist/chunks/resume-tbr3mkch.js +0 -3
  455. package/dist/chunks/sandbox-adapter-qh943bs4.js +0 -2
  456. package/dist/chunks/sandbox-toggle-1f70ejwk.js +0 -2
  457. package/dist/chunks/session-42zhjgd2.js +0 -3
  458. package/dist/chunks/sessionFileAccessHooks-1nh915er.js +0 -2
  459. package/dist/chunks/sessionStorage-j5m0nf55.js +0 -2
  460. package/dist/chunks/settings-c709knqg.js +0 -2
  461. package/dist/chunks/setup-0n2p20yw.js +0 -7
  462. package/dist/chunks/setup-2hqyyxff.js +0 -2
  463. package/dist/chunks/sinks-q6etaenz.js +0 -2
  464. package/dist/chunks/skills-xads3027.js +0 -2
  465. package/dist/chunks/startupProfiler-4wmjq0yd.js +0 -2
  466. package/dist/chunks/state-edaz98bj.js +0 -2
  467. package/dist/chunks/status-9rtty0ee.js +0 -2
  468. package/dist/chunks/stickers-m73qwecp.js +0 -2
  469. package/dist/chunks/subprocessEnv-rass28aq.js +0 -2
  470. package/dist/chunks/tag-vj93fgp6.js +0 -12
  471. package/dist/chunks/tasks-avbqta2s.js +0 -2
  472. package/dist/chunks/teammateModeSnapshot-32yfa4hf.js +0 -2
  473. package/dist/chunks/teleport-jw6w0rn4.js +0 -2
  474. package/dist/chunks/terminalSetup-ppt6v9xf.js +0 -2
  475. package/dist/chunks/theme-2csrfbca.js +0 -2
  476. package/dist/chunks/thinkback-2ahfejyt.js +0 -2
  477. package/dist/chunks/thinkback-play-kffa7rdp.js +0 -2
  478. package/dist/chunks/toolSearch-ptrcr8ec.js +0 -2
  479. package/dist/chunks/trustedDevice-xvtp79f1.js +0 -2
  480. package/dist/chunks/upgrade-c4argpvv.js +0 -2
  481. package/dist/chunks/usage-w30yajzy.js +0 -2
  482. package/dist/chunks/util-zkawe0w0.js +0 -2
  483. package/dist/chunks/utils-v86tf27x.js +0 -2
  484. package/dist/chunks/vim-3stm1kbg.js +0 -2
  485. package/dist/chunks/worktree-pbeayfjp.js +0 -2
  486. package/dist/chunks/worktreeModeEnabled-ysks760x.js +0 -2
@@ -1,11 +1,11 @@
1
1
  // @bun
2
- import"./cli-jxwm52wg.js";import{g as K,h as xe}from"./cli-fb5y5qhv.js";import{A as ts,B as tu,C as au}from"./cli-7gpep1x5.js";import{I as ns}from"./cli-v77avvvk.js";import{K as ur,L as Ne,N as Rn}from"./cli-v8w48y51.js";import{$ as nu,R as jd,T as Jd,U as Zd,_ as eu}from"./cli-e37w9dxm.js";import{Fa as ja,za as Qd}from"./cli-px7jhzgq.js";import"./cli-a72n4ej7.js";import"./cli-p2gt60aj.js";import{rb as Bd,sb as bn,tb as Ua,vb as ma}from"./cli-r2p5bkx5.js";import{yd as za,zd as Od}from"./cli-zdy5bccv.js";import"./cli-ye3qk73s.js";import{$d as Qh,Td as Fd}from"./cli-h2dynmt7.js";import"./cli-6vwdnz9p.js";import"./cli-z2jpyr57.js";import"./cli-2zh6c5xz.js";import"./cli-g1spmn9n.js";import{vg as wo,xg as Cm}from"./cli-bd1ryrzd.js";import{Ag as ah,yg as gc}from"./cli-jvs98a70.js";import{$G as Gd,$I as cr,$i as oo,$m as wp,$n as $c,$q as ed,$z as Cd,AB as Hh,AK as ag,Ao as ga,Aq as jc,Bm as Dc,Bo as fa,Bq as Ah,Bw as At,CD as Kh,CF as In,Cm as Pc,Cn as Fc,Cw as cd,DD as Ed,Dm as bh,Dw as Nh,ED as jh,EK as Kd,Ei as ph,Em as Mc,Eo as Rm,Ep as Ir,Ev as od,FK as ig,Fn as Ch,Fw as Wa,GF as _r,Gm as vh,Gn as _a,Gv as ld,Gw as Oh,Hn as Lc,Hv as Mh,Hw as dd,In as Ba,Ip as Yc,Iw as ud,Jm as lo,Jn as ut,Jq as Qi,Jw as Fh,KG as N,Km as lm,Kq as He,Kr as ad,Kw as pd,LG as me,Lm as co,Ln as Fr,Lw as Lh,Mm as cm,Mq as Ce,Mw as md,Mx as vd,Nn as _c,Nq as Kt,Nw as hd,Nx as Bh,OE as Rd,Oj as Ur,Ow as gd,Pm as uo,Pn as Bc,Pp as Hc,Pw as fd,Qm as dm,Qn as Gc,Qp as qa,RC as Va,RI as tg,Rn as Ga,Rq as Zr,Rw as yd,SC as Uh,Sj as Kr,Sn as qc,Sp as zc,TD as xd,Tr as Sh,Ty as $a,UD as Id,UE as Ks,UG as Ka,Uj as jr,VD as Jh,Vj as sp,Vl as Sc,Vn as ta,Vq as op,Vy as Gh,Wl as hh,Wq as er,Ww as _h,XG as Io,Xg as vc,Xl as Ec,Xq as nr,YE as js,YF as Nd,Yg as sh,Yj as fn,Ym as La,Yq as Jc,Yz as wd,Zi as qs,Zj as ei,Zm as wh,Zq as Zc,Zz as kd,_F as Zh,_i as zp,_j as Jr,_m as ys,_n as Wc,_q as Qc,aA as Vh,ah as wc,ai as kt,am as gh,an as bs,ar as tr,bJ as dr,bh as oh,bi as ch,bj as om,bm as Ic,bn as vs,br as Nr,cj as Oa,cm as Rc,cn as ws,co as Mo,cr as Qu,di as Cc,dm as yh,dr as Uu,eH as Ro,eJ as Ou,en as kp,eo as No,fj as Xc,fn as ks,fo as Oo,go as ha,hi as dh,ho as Lr,ij as Fa,iq as Ct,jh as Ns,jn as Cp,jo as aa,kA as Td,kh as $p,kk as Us,ko as Mn,kq as Xh,kx as bd,lE as Ha,lj as Ac,lo as je,lr as Ue,ls as es,mA as Yh,mI as Wd,mh as kc,mi as Tc,mo as ba,mr as ia,ms as lp,mx as or,nI as $d,nK as Hd,nh as lh,ni as uh,nj as mh,no as va,nr as Dn,nx as lr,oF as Dd,oK as zd,oo as Lo,or as Qr,ou as xh,pK as Ud,po as Nn,pu as Ih,qF as Pd,qI as Vd,qo as _o,rC as Sd,rG as Ld,ro as wa,rr as ar,sC as zh,sG as eg,si as Ma,sj as xo,so as pt,sr as jt,tI as Yd,tk as Qp,to as Bo,tr as ir,ui as Na,uo as ya,ur as nd,vH as qd,vr as td,wF as Md,wq as Tt,wr as rr,xD as Ya,xq as Xt,xz as qh,yq as Uc,yz as Wh,zB as Xd,zF as al,zj as Im,zq as Kc}from"./cli-5pb6kdxn.js";import{PK as Vc,SK as Th}from"./cli-49dqgzsg.js";import"./cli-6b6e5zj9.js";import{lL as Rh,mL as Dh}from"./cli-d06qr5p3.js";import{NL as fh,yL as xc}from"./cli-r9p0g894.js";import"./cli-amy2yafd.js";import{$L as at,VL as na,WL as ju,XL as Pr,YL as Ju,ZL as Mr,_L as Zu,aM as xr,bM as ko,eM as Ad,fM as Co}from"./cli-2vc9kv40.js";import{yM as id,zM as Eh}from"./cli-xsap3gxj.js";import{ZM as St,_M as $h}from"./cli-tzaj50bd.js";import"./cli-z9jm4xjn.js";import"./cli-msr9n6da.js";import{DN as Nc,HN as Oc,NN as kh}from"./cli-29gcax34.js";import{UN as _d,VN as ng}from"./cli-cbdrqqf2.js";import"./cli-mejr8b5m.js";import"./cli-vxxkrd5y.js";import"./cli-atpfeg28.js";import"./cli-gnjff7md.js";import"./cli-s6qk3rbv.js";import{GQ as Dr,IQ as nt,MQ as Sr,RP as bc,WP as rh,dQ as zr,gQ as rp,iR as Er}from"./cli-5wh173wa.js";import{kR as fc,nR as yc,pR as ih}from"./cli-wz9r5s81.js";import"./cli-wn4ywgbv.js";import"./cli-tezq577c.js";import"./cli-0v6qg4zv.js";import"./cli-59ysj9y4.js";import"./cli-0b4dmvvw.js";import"./cli-088ac95n.js";import{fS as rd,iS as sd,mS as Ph}from"./cli-pmzht94n.js";import"./cli-6dcra6rs.js";import"./cli-rcvta3zk.js";import"./cli-md1h6sbv.js";import"./cli-zf7yzkn6.js";import"./cli-ffjjv4j8.js";import"./cli-3xhqacdd.js";import{TS as Zi,US as Mu,cT as sr,dT as Nu}from"./cli-dr1ph0pp.js";import{$V as Wm,AW as Hl,AY as Da,BW as Je,BY as jl,C1 as oc,CV as ct,CW as Le,CY as Hm,D1 as el,EW as zl,EX as Ui,F1 as nl,FW as it,GV as to,GX as Du,H1 as ht,H3 as rt,I0 as Km,J0 as tc,K0 as ac,K3 as _,KU as $l,KW as Z,L0 as jm,LX as $r,MX as ip,N3 as L,O3 as mc,P3 as Hr,Q3 as ji,R0 as br,RY as Jl,S3 as $o,T1 as Pa,T3 as Vo,TV as Fn,U3 as hc,UW as Fe,V1 as Jn,VU as qm,W1 as vr,X1 as Bu,XW as jn,YY as Uo,Z3 as Ji,ZW as Ul,ZY as Ln,_W as Ym,bW as ds,c3 as Vr,d2 as wr,dZ as Ko,e2 as Gu,e3 as wt,e4 as ae,f2 as lc,fW as mp,g0 as Ql,g2 as cc,h0 as zm,hU as Gl,i2 as Jm,iW as Vl,iY as Kl,iZ as _e,j1 as ic,j2 as dc,j3 as pc,jW as $m,k1 as rc,k3 as Yr,kW as Yl,kZ as Ho,l2 as Zm,lU as Bm,nY as Ra,nZ as Zl,oZ as Ca,p0 as ec,pW as Vm,q2 as Ki,q3 as oa,r1 as Jt,r3 as Qs,s2 as Pu,t2 as uc,u2 as Qm,uW as ot,v0 as Um,v2 as wn,w1 as sc,w2 as eh,wW as J,x1 as Zt,x3 as am,y0 as nc,yW as M}from"./cli-9hskw92e.js";import{h4 as Et,m4 as _m}from"./cli-h5yfk29j.js";import{S4 as nh,T4 as th,t4 as Ll,u4 as Ia,v4 as Fm}from"./cli-v2hg35qk.js";import{U4 as Vi,Y4 as Eu}from"./cli-b1dptek2.js";import"./cli-bthzmdgv.js";import{E5 as zi,H5 as Ru,v5 as Hi,w5 as Iu}from"./cli-tn47e131.js";import{I5 as ze,J5 as Qt}from"./cli-avcnnw0n.js";import{L5 as et,P5 as Cr}from"./cli-1215h20m.js";import"./cli-3je4vtx7.js";import"./cli-29078yxj.js";import{b6 as Bs,l6 as Gs,q6 as v,r6 as Fl,v6 as Wi}from"./cli-dx46fn1w.js";import"./cli-tyxvdf66.js";import{E6 as Yi,J6 as xu}from"./cli-wr4k6ngg.js";import{K6 as ce,M6 as $i,Y6 as Sm,a7 as dt,f7 as _l,p7 as Bl,w7 as pa}from"./cli-nj726gac.js";import"./cli-ewts4g0p.js";import"./cli-hpzy0mat.js";import{B8 as hn,p8 as yr,s8 as _u,w8 as V}from"./cli-3bxtq5dc.js";import"./cli-6xmbrh42.js";import{I8 as _n,J8 as Lm}from"./cli-mx6xk0dw.js";import"./cli-cr1hvkmz.js";import{U8 as f,V8 as oe}from"./cli-s5epnnj5.js";import"./cli-3hwpymrd.js";import"./cli-wfqsfwa2.js";import{f9 as ql,g9 as Wl,h9 as Gm}from"./cli-n3m134cf.js";import{s9 as fr,x9 as mn,y9 as Ht}from"./cli-shz2e0q5.js";import{B9 as Em,z9 as So}from"./cli-d58ptbve.js";import"./cli-3q7meftn.js";import{$9 as Te,G9 as Sn,I9 as Gi,N9 as qi,P9 as vt,S9 as Il,T9 as H,U9 as Ea,V9 as lt,Z9 as En,a_ as Rl,c_ as Dl,d_ as Pn,e_ as Pl,h_ as Ml,l_ as Nm,n_ as Ls,p_ as Ol,r_ as h,s_ as _s,u_ as $e}from"./cli-a98b285v.js";import{A_ as Om,x_ as xa,z_ as Nl}from"./cli-jmypsed1.js";import{D_ as Sa,E_ as B,G_ as Re,H_ as Po,L_ as Wr,M_ as xl,O_ as pn}from"./cli-1qszxdan.js";import{Bba as vl,Dba as wl,Fba as kl,Fca as El,J$ as Gr,Jba as Cl,Paa as Ve,Qba as qr,Raa as hl,Sba as Tl,Taa as gl,V_ as Za,Z_ as Mm,Zca as Ye,a$ as ol,bba as fl,d$ as ll,dba as yl,fba as Aa,g$ as cl,i$ as Xa,iba as bl,j$ as dl,laa as Zo,lca as Xl,maa as Qa,naa as mt,oaa as ul,paa as pl,qaa as ml,wca as Al,xaa as _i,yca as Sl,zaa as Bi}from"./cli-w754xmyv.js";import{_ca as Q,ada as pe,bda as U,cda as m}from"./cli-x514vyva.js";var ms={};pe(ms,{registerUpdateConfigSkill:()=>bp});import{toJSONSchema as hp}from"zod/v4";function gp(){let n=hp(ds(),{io:"input"});return Te(n,null,2)}function bp(){N({name:"update-config",description:'Use this skill to configure the UnieAI Code harness via settings.json. Automated behaviors ("from now on when X", "each time X", "whenever X", "before/after X") require hooks configured in settings.json - the harness executes these, not Claude, so memory/preferences cannot fulfill them. Also use for: permissions ("allow X", "add permission", "move permission to"), env vars ("set X=Y"), hook troubleshooting, or any changes to settings.json/settings.local.json files. Examples: "allow npm commands", "add bq permission to global settings", "move permission to user settings", "set DEBUG=true", "when claude stops show X". For simple settings like theme/model, use Config tool.',allowedTools:["Read"],userInvocable:!0,async getPromptForCommand(n){if(n.startsWith("[hooks-only]")){let i=n.slice(12).trim(),o=us+`
2
+ import"./cli-hzr2zraz.js";import{g as j,h as xe}from"./cli-fb5y5qhv.js";import{A as ts,B as iu,C as ru}from"./cli-2rwjx3w0.js";import{I as ns}from"./cli-g4n9das2.js";import{K as ur,L as Ne,N as Rn}from"./cli-qaxvg7gv.js";import{$ as au,R as Zd,T as Qd,U as eu,_ as tu}from"./cli-5f0w3fy6.js";import{ra as nu,xa as ja}from"./cli-pbc8sk2d.js";import"./cli-m12smc5e.js";import"./cli-tfv2qcgf.js";import{ab as qd,bb as bn,cb as Ua,eb as ma}from"./cli-4nejhkd0.js";import{yd as za,zd as Ld}from"./cli-q46epwyh.js";import"./cli-66jj9zj3.js";import{$d as ag,Td as _d}from"./cli-zjfya500.js";import"./cli-55ntywtj.js";import"./cli-zev50xap.js";import"./cli-kqv5b8zh.js";import"./cli-fm14mg07.js";import{vg as Co,xg as Sm}from"./cli-tckzkegq.js";import{Ag as oh,yg as yc}from"./cli-ja540nr7.js";import{$i as oo,$m as Cp,$n as Yc,$q as td,AD as Id,Ao as ga,Aq as Zc,Aw as _h,BD as eg,BK as Jd,Bm as Mc,Bo as fa,Bq as Ih,Bv as cd,CK as lg,Cm as Nc,Cn as _c,Cw as Wa,DF as _r,Dm as Ch,Dv as dd,Dw as Bh,Ei as fh,Em as Oc,Eo as Nm,Ep as Ir,Ev as Lh,Ew as pd,Fn as Sh,Fw as md,Gm as Th,Gn as _a,Gw as Gh,HG as R,Hn as Bc,Hr as rd,Hw as hd,IG as ue,In as Ba,Ip as zc,Iw as qh,Jm as lo,Jn as ut,Jq as Qi,Jw as gd,Jx as kd,Km as dm,Kq as He,Kw as fd,Kx as $h,LE as Pd,Lm as co,Ln as Fr,Lw as yd,Mm as um,Mq as Ce,Mw as bd,Nn as Gc,Nq as Kt,OC as Va,OI as sg,Oj as Ur,Ow as vd,PC as Zh,Pm as uo,Pn as qc,Pp as Uc,QD as Rd,Qm as pm,Qn as Wc,Qp as qa,Qr as Rh,Qy as $a,RD as Dd,RE as Ks,RG as Ka,Rn as Ga,Rq as Zr,SD as ng,Sj as Kr,Sn as $c,Sp as Kc,Sy as Vh,Tw as Wh,UG as Do,Uj as jr,VE as js,VF as Fd,Vj as lp,Vl as xc,Vn as ta,Vq as cp,Vz as Cd,Wl as bh,Wq as er,Wz as Td,XF as tg,Xg as kc,Xl as Ic,Xq as nr,YG as Wd,YI as cr,Yg as dh,Yj as fn,Ym as La,Yq as Qc,Yz as Xd,Zi as qs,Zj as ei,Zm as Xh,Zq as ed,Zz as Uh,_I as dr,_i as Kp,_j as Jr,_m as ys,_n as Vc,_q as nd,ah as Cc,ai as kt,am as vh,an as bs,ar as tr,bH as Po,bJ as Lu,bh as uh,bi as mh,bj as cm,bm as Dc,bn as vs,br as Nr,cj as Oa,cm as Pc,cn as ws,co as Oo,cr as np,di as Xc,dm as kh,dr as ju,en as Tp,eo as Fo,fj as Sc,fn as ks,fo as Lo,go as ha,hA as Ad,hi as hh,ho as Lr,hx as wd,iE as Ha,ij as Fa,iq as Ct,is as es,jA as Kh,jI as Vd,jh as Ns,jn as Xp,jo as aa,js as dp,jx as or,kI as Yd,kK as Ud,kh as Yp,kk as Us,ko as Mn,kq as xh,kx as lr,lF as Md,lK as Kd,lj as Ec,lo as je,lr as Ue,lu as Ph,mK as jd,mh as Tc,mi as Ac,mo as ba,mr as ia,mu as Mh,nF as Nd,nI as Hd,nh as ph,ni as gh,nj as yh,no as va,nr as Dn,oC as xd,oG as Bd,oo as Bo,or as Qr,pC as Jh,pG as ig,po as Nn,qI as zd,qo as Go,ro as wa,rr as ar,sH as $d,si as Ma,sj as Ro,so as pt,sr as jt,tF as Od,tk as nm,to as qo,tr as ir,uD as Ya,ui as Na,uo as ya,ur as ad,uz as Yh,vr as id,vz as Hh,wB as Sd,wF as rl,wq as Tt,wr as rr,xB as jh,xK as og,xq as Xt,yq as jc,yw as At,zD as Qh,zF as In,zj as Mm,zq as Jc,zw as ud}from"./cli-me4e2p3e.js";import{MK as Hc,PK as Eh}from"./cli-s9fhtgmz.js";import"./cli-vkzp66cm.js";import{iL as Nh,jL as Oh}from"./cli-t4j047cx.js";import{KL as wh,vL as Rc}from"./cli-49m97nbg.js";import"./cli-r83ttew2.js";import{SL as na,TL as Zu,UL as Pr,VL as Qu,WL as Mr,XL as ep,YL as at,ZL as xr,_L as To,bM as Ed,cM as Xo}from"./cli-xfsqvp8r.js";import"./cli-5vsnhp97.js";import{yM as sd,zM as Dh}from"./cli-d0hzw78c.js";import{ZM as Fc,bN as Lc,hN as Ah}from"./cli-8qd16mt4.js";import{iN as St,jN as zh}from"./cli-95wg48h9.js";import"./cli-3m8n808e.js";import"./cli-764c4bsm.js";import{YN as Gd,ZN as rg}from"./cli-g5wq5ptg.js";import"./cli-6yprtw88.js";import"./cli-eyw3czmn.js";import"./cli-2rw44zfx.js";import"./cli-akcxtvv9.js";import{DQ as Dr,FQ as nt,JQ as Sr,OP as wc,TP as ch,aQ as zr,dQ as op,fR as Er}from"./cli-x8xgga1a.js";import{hR as bc,kR as vc,mR as lh}from"./cli-99mqr54v.js";import"./cli-v9f860t5.js";import"./cli-scaqq0v9.js";import"./cli-msgx4pnp.js";import"./cli-5dt9yjha.js";import"./cli-8hxz2qs6.js";import"./cli-d53fhs6v.js";import"./cli-wt2bfbn0.js";import{iS as od,lS as ld,pS as Fh}from"./cli-br6zjh6x.js";import"./cli-ms5j6fff.js";import"./cli-6pdpyz1a.js";import"./cli-fwrj8ybs.js";import"./cli-p2cqnrnp.js";import"./cli-gtm212j6.js";import"./cli-0qt9btbe.js";import{WS as Zi,XS as Ou,fT as sr,gT as Fu}from"./cli-jegyadmb.js";import{$Y as jo,$Z as tc,A3 as ji,B0 as br,BW as N,C3 as Yo,D1 as Pa,D3 as Ho,DW as Ul,DY as Da,E3 as fc,EW as Je,EY as Zl,F1 as Jn,FV as ct,FW as Le,FY as jm,G1 as vr,H1 as qu,HW as Kl,HX as Ui,IW as it,J3 as Ji,JV as to,JX as Mu,NU as Yl,NW as Q,O2 as Vr,OX as $r,P1 as wr,PX as sp,Q1 as Wu,Q2 as wt,Q3 as ae,R1 as dc,S1 as uc,SZ as nc,TZ as Jm,U1 as nh,UY as Ql,V0 as sc,V1 as pc,V2 as hc,W0 as oc,W2 as Yr,WV as Fn,X1 as th,XW as Fe,YU as Ym,_W as jn,a2 as Ki,a3 as oa,aX as jl,aZ as Ln,b1 as Jt,b3 as Qs,bX as Km,c2 as Nu,cW as Hm,d2 as mc,e2 as ah,eW as ds,f0 as Zm,f2 as wn,g1 as lc,g2 as ih,gZ as Jo,h1 as Zt,h3 as rm,i0 as ac,iW as gp,kU as Wl,lW as Hl,lY as Jl,lZ as _e,m1 as cc,mW as zm,n1 as tl,nW as zl,nZ as Uo,oU as $m,p1 as al,qY as Ra,qZ as ec,r1 as ht,r3 as rt,rZ as Ca,s0 as Qm,sW as Um,t0 as ic,u0 as rc,u3 as _,v0 as eh,x3 as L,xW as ot,y3 as gc,z3 as Hr,zW as Z}from"./cli-msmzt4c3.js";import{T3 as Et,Y3 as Wm}from"./cli-msw0vv86.js";import{C4 as rh,D4 as sh,d4 as Bl,e4 as Ia,f4 as Gm}from"./cli-s6vr7213.js";import{E4 as Vi,I4 as Iu}from"./cli-fghyxar5.js";import"./cli-1ny2386w.js";import{$4 as ze,a5 as Qt}from"./cli-fakdskp6.js";import{c5 as et,g5 as Cr}from"./cli-mb1qrqw1.js";import{n5 as Hi,o5 as Du,w5 as zi,z5 as Pu}from"./cli-f63fdj4w.js";import"./cli-k4v08k8t.js";import"./cli-pgg33dhw.js";import"./cli-w52yvzkn.js";import{f6 as Bs,p6 as Gs,u6 as v,v6 as _l,z6 as Wi}from"./cli-51720d82.js";import"./cli-ezs5sney.js";import{I6 as Yi,N6 as Ru}from"./cli-n5s5fnyj.js";import{A7 as pa,O6 as ce,Q6 as $i,a7 as Rm,e7 as dt,j7 as Gl,t7 as ql}from"./cli-fdya77ch.js";import"./cli-mzcsnm06.js";import"./cli-p0vh69b9.js";import{L7 as _n,M7 as qm}from"./cli-rvad3yhg.js";import{A8 as Gu,E8 as V,J8 as hn,x8 as yr}from"./cli-4ewb3q42.js";import"./cli-xmgm2573.js";import"./cli-fs7yttfp.js";import{Y8 as f,Z8 as oe}from"./cli-t9jht3kb.js";import"./cli-350pymj4.js";import"./cli-rxb5q8zw.js";import{j9 as $l,k9 as Vl,l9 as Vm}from"./cli-jj93qmmc.js";import{B9 as mn,C9 as Ht,w9 as fr}from"./cli-kq16afrr.js";import{D9 as xo,F9 as Dm}from"./cli-xpa1neza.js";import"./cli-rjerv816.js";import{K9 as Sn,M9 as Gi,R9 as qi,T9 as vt,W9 as Dl,X9 as H,Y9 as Ea,Z9 as lt,b_ as En,d_ as Te,e_ as Pl,g_ as Ml,h_ as Pn,i_ as Nl,l_ as Ol,p_ as _m,r_ as Ls,t_ as Ll,v_ as h,w_ as _s,y_ as $e}from"./cli-hke6r0q8.js";import{B_ as xa,D_ as Fl,E_ as Bm}from"./cli-x70v8rsj.js";import{H_ as Sa,I_ as B,K_ as Re,L_ as No,P_ as Wr,Q_ as Rl,S_ as pn}from"./cli-tq5z9qv3.js";import{Aca as El,Baa as _i,Cca as xl,Daa as Bi,Fba as kl,Hba as Cl,Jba as Tl,Jca as Il,N$ as Gr,Nba as Xl,Taa as Ve,Uba as qr,Vaa as fl,Wba as Al,Xaa as yl,Z_ as Za,b$ as Lm,bda as Ye,e$ as cl,fba as bl,h$ as dl,hba as vl,jba as Aa,k$ as ul,m$ as Xa,mba as wl,n$ as pl,paa as el,pca as Sl,qaa as Qa,raa as mt,saa as ml,taa as hl,uaa as gl}from"./cli-3ac555qw.js";import{cda as K,eda as de,fda as z,gda as m}from"./cli-w1d8n9g3.js";var ms={};de(ms,{registerUpdateConfigSkill:()=>wp});import{toJSONSchema as fp}from"zod/v4";function yp(){let n=fp(ds(),{io:"input"});return Te(n,null,2)}function wp(){R({name:"update-config",description:'Use this skill to configure the UnieAI Code harness via settings.json. Automated behaviors ("from now on when X", "each time X", "whenever X", "before/after X") require hooks configured in settings.json - the harness executes these, not Claude, so memory/preferences cannot fulfill them. Also use for: permissions ("allow X", "add permission", "move permission to"), env vars ("set X=Y"), hook troubleshooting, or any changes to settings.json/settings.local.json files. Examples: "allow npm commands", "add bq permission to global settings", "move permission to user settings", "set DEBUG=true", "when claude stops show X". For simple settings like theme/model, use Config tool.',allowedTools:["Read"],userInvocable:!0,async getPromptForCommand(n){if(n.startsWith("[hooks-only]")){let i=n.slice(12).trim(),o=us+`
3
3
 
4
4
  `+ps;if(i)o+=`
5
5
 
6
6
  ## Task
7
7
 
8
- ${i}`;return[{type:"text",text:o}]}let e=gp(),a=yp;if(a+=`
8
+ ${i}`;return[{type:"text",text:o}]}let e=yp(),a=vp;if(a+=`
9
9
 
10
10
  ## Full Settings JSON Schema
11
11
 
@@ -15,7 +15,7 @@ ${e}
15
15
 
16
16
  ## User Request
17
17
 
18
- ${n}`;return[{type:"text",text:a}]}})}var fp=`## Settings File Locations
18
+ ${n}`;return[{type:"text",text:a}]}})}var bp=`## Settings File Locations
19
19
 
20
20
  Choose the appropriate file based on scope:
21
21
 
@@ -297,7 +297,7 @@ Given an event, matcher, target file, and desired behavior, follow this flow. Ea
297
297
  **If proof fails but pipe-test passed and \`jq -e\` passed**: the settings watcher isn't watching \`.claude/\` \u2014 it only watches directories that had a settings file when this session started. The hook is written correctly. Tell the user to open \`/hooks\` once (reloads config) or restart \u2014 you can't do this yourself; \`/hooks\` is a user UI menu and opening it ends this turn.
298
298
 
299
299
  7. **Handoff.** Tell the user the hook is live (or needs \`/hooks\`/restart per the watcher caveat). Point them at \`/hooks\` to review, edit, or disable it later. The UI only shows "Ran N hooks" if a hook errors or is slow \u2014 silent success is invisible by design.
300
- `,yp;var hs=U(()=>{mp();Pn();me();yp=`# Update Config Skill
300
+ `,vp;var hs=z(()=>{gp();Pn();ue();vp=`# Update Config Skill
301
301
 
302
302
  Modify UnieAI Code configuration by updating settings.json files.
303
303
 
@@ -368,7 +368,7 @@ When adding to permission arrays or hook arrays, **merge with existing**, don't
368
368
  }
369
369
  \`\`\`
370
370
 
371
- ${fp}
371
+ ${bp}
372
372
 
373
373
  ${us}
374
374
 
@@ -433,8 +433,8 @@ If a hook isn't running:
433
433
  4. **Check hook type** - Is it "command", "prompt", or "agent"?
434
434
  5. **Test the command** - Run the hook command manually to see if it works
435
435
  6. **Use --debug** - Run \`claude --debug\` to see hook execution logs
436
- `});import{z as fe}from"zod/v4";var ca,gs,da,vp,db;var fs=U(()=>{Qt();ca=["Global","Chat","Autocomplete","Confirmation","Help","Transcript","HistorySearch","Task","ThemePicker","Settings","Tabs","Attachments","Footer","MessageSelector","DiffDialog","ModelPicker","Select","Plugin"],gs={Global:"Active everywhere, regardless of focus",Chat:"When the chat input is focused",Autocomplete:"When autocomplete menu is visible",Confirmation:"When a confirmation/permission dialog is shown",Help:"When the help overlay is open",Transcript:"When viewing the transcript",HistorySearch:"When searching command history (ctrl+r)",Task:"When a task/agent is running in the foreground",ThemePicker:"When the theme picker is open",Settings:"When the settings menu is open",Tabs:"When tab navigation is active",Attachments:"When navigating image attachments in a select dialog",Footer:"When footer indicators are focused",MessageSelector:"When the message selector (rewind) is open",DiffDialog:"When the diff dialog is open",ModelPicker:"When the model picker is open",Select:"When a select/list component is focused",Plugin:"When the plugin dialog is open"},da=["app:interrupt","app:exit","app:toggleTodos","app:toggleTranscript","app:toggleBrief","app:toggleTeammatePreview","app:toggleTerminal","app:redraw","app:globalSearch","app:quickOpen","history:search","history:previous","history:next","chat:cancel","chat:killAgents","chat:cycleMode","chat:modelPicker","chat:fastMode","chat:thinkingToggle","chat:submit","chat:newline","chat:undo","chat:externalEditor","chat:stash","chat:imagePaste","chat:messageActions","autocomplete:accept","autocomplete:dismiss","autocomplete:previous","autocomplete:next","confirm:yes","confirm:no","confirm:previous","confirm:next","confirm:nextField","confirm:previousField","confirm:cycleMode","confirm:toggle","confirm:toggleExplanation","tabs:next","tabs:previous","transcript:toggleShowAll","transcript:exit","historySearch:next","historySearch:accept","historySearch:cancel","historySearch:execute","task:background","theme:toggleSyntaxHighlighting","help:dismiss","attachments:next","attachments:previous","attachments:remove","attachments:exit","footer:up","footer:down","footer:next","footer:previous","footer:openSelected","footer:clearSelection","footer:close","messageSelector:up","messageSelector:down","messageSelector:top","messageSelector:bottom","messageSelector:select","diff:dismiss","diff:previousSource","diff:nextSource","diff:back","diff:viewDetails","diff:previousFile","diff:nextFile","modelPicker:decreaseEffort","modelPicker:increaseEffort","select:next","select:previous","select:accept","select:cancel","plugin:toggle","plugin:install","permission:toggleDebug","settings:search","settings:retry","settings:close","voice:pushToTalk"],vp=ze(()=>fe.object({context:fe.enum(ca).describe("UI context where these bindings apply. Global bindings work everywhere."),bindings:fe.record(fe.string().describe('Keystroke pattern (e.g., "ctrl+k", "shift+tab")'),fe.union([fe.enum(da),fe.string().regex(/^command:[a-zA-Z0-9:\-_]+$/).describe('Command binding (e.g., "command:help", "command:compact"). Executes the slash command as if typed.'),fe.null().describe("Set to null to unbind a default shortcut")]).describe("Action to trigger, command to invoke, or null to unbind")).describe("Map of keystroke patterns to actions")}).describe("A block of keybindings for a specific context")),db=ze(()=>fe.object({$schema:fe.string().optional().describe("JSON Schema URL for editor validation"),$docs:fe.string().optional().describe("Documentation URL"),bindings:fe.array(vp()).describe("Array of keybinding blocks by context")}).describe("Claude Code keybindings configuration. Customize keyboard shortcuts by context."))});var Cs={};pe(Cs,{registerKeybindingsSkill:()=>Bp});function Tp(){return ua(["Context","Description"],ca.map((n)=>[`\`${n}\``,gs[n]]))}function Xp(){let n={};for(let e of ys)for(let[a,i]of Object.entries(e.bindings))if(i){if(!n[i])n[i]={keys:[],context:e.context};n[i].keys.push(a)}return ua(["Action","Default Key(s)","Context"],da.map((e)=>{let a=n[e],i=a?a.keys.map((l)=>`\`${l}\``).join(", "):"(none)",o=a?a.context:Ap(e);return[`\`${e}\``,i,o]}))}function Ap(n){let e=n.split(":")[0];return{app:"Global",history:"Global or Chat",chat:"Chat",autocomplete:"Autocomplete",confirm:"Confirmation",tabs:"Tabs",transcript:"Transcript",historySearch:"HistorySearch",task:"Task",theme:"ThemePicker",help:"Help",attachments:"Attachments",footer:"Footer",messageSelector:"MessageSelector",diff:"DiffDialog",modelPicker:"ModelPicker",select:"Select",permission:"Confirmation"}[e??""]??"Unknown"}function Sp(){let n=[];n.push("### Non-rebindable (errors)");for(let e of bs)n.push(`- \`${e.key}\` \u2014 ${e.reason}`);n.push(""),n.push("### Terminal reserved (errors/warnings)");for(let e of vs)n.push(`- \`${e.key}\` \u2014 ${e.reason} (${e.severity==="error"?"will not work":"may conflict"})`);n.push(""),n.push("### macOS reserved (errors)");for(let e of ws)n.push(`- \`${e.key}\` \u2014 ${e.reason}`);return n.join(`
437
- `)}function Bp(){N({name:"keybindings-help",description:'Use when the user wants to customize keyboard shortcuts, rebind keys, add chord bindings, or modify ~/.claude/keybindings.json. Examples: "rebind ctrl+s", "add a chord shortcut", "change the submit key", "customize keybindings".',allowedTools:["Read"],userInvocable:!1,isEnabled:ks,async getPromptForCommand(n){let e=Tp(),a=Xp(),i=Sp(),o=[Dp,Pp,Mp,Np,Op,Fp,Lp,_p,`## Reserved Shortcuts
436
+ `});import{z as fe}from"zod/v4";var ca,gs,da,kp,hb;var fs=z(()=>{Qt();ca=["Global","Chat","Autocomplete","Confirmation","Help","Transcript","HistorySearch","Task","ThemePicker","Settings","Tabs","Attachments","Footer","MessageSelector","DiffDialog","ModelPicker","Select","Plugin"],gs={Global:"Active everywhere, regardless of focus",Chat:"When the chat input is focused",Autocomplete:"When autocomplete menu is visible",Confirmation:"When a confirmation/permission dialog is shown",Help:"When the help overlay is open",Transcript:"When viewing the transcript",HistorySearch:"When searching command history (ctrl+r)",Task:"When a task/agent is running in the foreground",ThemePicker:"When the theme picker is open",Settings:"When the settings menu is open",Tabs:"When tab navigation is active",Attachments:"When navigating image attachments in a select dialog",Footer:"When footer indicators are focused",MessageSelector:"When the message selector (rewind) is open",DiffDialog:"When the diff dialog is open",ModelPicker:"When the model picker is open",Select:"When a select/list component is focused",Plugin:"When the plugin dialog is open"},da=["app:interrupt","app:exit","app:toggleTodos","app:toggleTranscript","app:toggleBrief","app:toggleTeammatePreview","app:toggleTerminal","app:redraw","app:globalSearch","app:quickOpen","history:search","history:previous","history:next","chat:cancel","chat:killAgents","chat:cycleMode","chat:modelPicker","chat:fastMode","chat:thinkingToggle","chat:submit","chat:newline","chat:undo","chat:externalEditor","chat:stash","chat:imagePaste","chat:messageActions","autocomplete:accept","autocomplete:dismiss","autocomplete:previous","autocomplete:next","confirm:yes","confirm:no","confirm:previous","confirm:next","confirm:nextField","confirm:previousField","confirm:cycleMode","confirm:toggle","confirm:toggleExplanation","tabs:next","tabs:previous","transcript:toggleShowAll","transcript:exit","historySearch:next","historySearch:accept","historySearch:cancel","historySearch:execute","task:background","theme:toggleSyntaxHighlighting","help:dismiss","attachments:next","attachments:previous","attachments:remove","attachments:exit","footer:up","footer:down","footer:next","footer:previous","footer:openSelected","footer:clearSelection","footer:close","messageSelector:up","messageSelector:down","messageSelector:top","messageSelector:bottom","messageSelector:select","diff:dismiss","diff:previousSource","diff:nextSource","diff:back","diff:viewDetails","diff:previousFile","diff:nextFile","modelPicker:decreaseEffort","modelPicker:increaseEffort","select:next","select:previous","select:accept","select:cancel","plugin:toggle","plugin:install","permission:toggleDebug","settings:search","settings:retry","settings:close","voice:pushToTalk"],kp=ze(()=>fe.object({context:fe.enum(ca).describe("UI context where these bindings apply. Global bindings work everywhere."),bindings:fe.record(fe.string().describe('Keystroke pattern (e.g., "ctrl+k", "shift+tab")'),fe.union([fe.enum(da),fe.string().regex(/^command:[a-zA-Z0-9:\-_]+$/).describe('Command binding (e.g., "command:help", "command:compact"). Executes the slash command as if typed.'),fe.null().describe("Set to null to unbind a default shortcut")]).describe("Action to trigger, command to invoke, or null to unbind")).describe("Map of keystroke patterns to actions")}).describe("A block of keybindings for a specific context")),hb=ze(()=>fe.object({$schema:fe.string().optional().describe("JSON Schema URL for editor validation"),$docs:fe.string().optional().describe("Documentation URL"),bindings:fe.array(kp()).describe("Array of keybinding blocks by context")}).describe("Claude Code keybindings configuration. Customize keyboard shortcuts by context."))});var Cs={};de(Cs,{registerKeybindingsSkill:()=>qp});function Ap(){return ua(["Context","Description"],ca.map((n)=>[`\`${n}\``,gs[n]]))}function Sp(){let n={};for(let e of ys)for(let[a,i]of Object.entries(e.bindings))if(i){if(!n[i])n[i]={keys:[],context:e.context};n[i].keys.push(a)}return ua(["Action","Default Key(s)","Context"],da.map((e)=>{let a=n[e],i=a?a.keys.map((l)=>`\`${l}\``).join(", "):"(none)",o=a?a.context:Ep(e);return[`\`${e}\``,i,o]}))}function Ep(n){let e=n.split(":")[0];return{app:"Global",history:"Global or Chat",chat:"Chat",autocomplete:"Autocomplete",confirm:"Confirmation",tabs:"Tabs",transcript:"Transcript",historySearch:"HistorySearch",task:"Task",theme:"ThemePicker",help:"Help",attachments:"Attachments",footer:"Footer",messageSelector:"MessageSelector",diff:"DiffDialog",modelPicker:"ModelPicker",select:"Select",permission:"Confirmation"}[e??""]??"Unknown"}function xp(){let n=[];n.push("### Non-rebindable (errors)");for(let e of bs)n.push(`- \`${e.key}\` \u2014 ${e.reason}`);n.push(""),n.push("### Terminal reserved (errors/warnings)");for(let e of vs)n.push(`- \`${e.key}\` \u2014 ${e.reason} (${e.severity==="error"?"will not work":"may conflict"})`);n.push(""),n.push("### macOS reserved (errors)");for(let e of ws)n.push(`- \`${e.key}\` \u2014 ${e.reason}`);return n.join(`
437
+ `)}function qp(){R({name:"keybindings-help",description:'Use when the user wants to customize keyboard shortcuts, rebind keys, add chord bindings, or modify ~/.claude/keybindings.json. Examples: "rebind ctrl+s", "add a chord shortcut", "change the submit key", "customize keybindings".',allowedTools:["Read"],userInvocable:!1,isEnabled:ks,async getPromptForCommand(n){let e=Ap(),a=Sp(),i=xp(),o=[Mp,Np,Op,Fp,Lp,_p,Bp,Gp,`## Reserved Shortcuts
438
438
 
439
439
  ${i}`,`## Available Contexts
440
440
 
@@ -445,25 +445,25 @@ ${a}`];if(n)o.push(`## User Request
445
445
  ${n}`);return[{type:"text",text:o.join(`
446
446
 
447
447
  `)}]}})}function ua(n,e){let a=n.map(()=>"---");return[`| ${n.join(" | ")} |`,`| ${a.join(" | ")} |`,...e.map((i)=>`| ${i.join(" | ")} |`)].join(`
448
- `)}var Ep,xp,Ip,Rp,Dp,Pp,Mp,Np,Op,Fp,Lp,_p;var Ts=U(()=>{wp();Cp();kp();fs();Pn();me();Ep={$schema:"https://www.schemastore.org/claude-code-keybindings.json",$docs:"https://code.claude.com/docs/en/keybindings",bindings:[{context:"Chat",bindings:{"ctrl+e":"chat:externalEditor"}}]},xp={context:"Chat",bindings:{"ctrl+s":null}},Ip={context:"Chat",bindings:{"ctrl+g":null,"ctrl+e":"chat:externalEditor"}},Rp={context:"Global",bindings:{"ctrl+k ctrl+t":"app:toggleTodos"}},Dp=["# Keybindings Skill","","Create or modify `~/.claude/keybindings.json` to customize keyboard shortcuts.","","## CRITICAL: Read Before Write","","**Always read `~/.claude/keybindings.json` first** (it may not exist yet). Merge changes with existing bindings \u2014 never replace the entire file.","","- Use **Edit** tool for modifications to existing files","- Use **Write** tool only if the file does not exist yet"].join(`
449
- `),Pp=["## File Format","","```json",Te(Ep,null,2),"```","","Always include the `$schema` and `$docs` fields."].join(`
450
- `),Mp=["## Keystroke Syntax","","**Modifiers** (combine with `+`):","- `ctrl` (alias: `control`)","- `alt` (aliases: `opt`, `option`) \u2014 note: `alt` and `meta` are identical in terminals","- `shift`","- `meta` (aliases: `cmd`, `command`)","","**Special keys**: `escape`/`esc`, `enter`/`return`, `tab`, `space`, `backspace`, `delete`, `up`, `down`, `left`, `right`","","**Chords**: Space-separated keystrokes, e.g. `ctrl+k ctrl+s` (1-second timeout between keystrokes)","","**Examples**: `ctrl+shift+p`, `alt+enter`, `ctrl+k ctrl+n`"].join(`
451
- `),Np=["## Unbinding Default Shortcuts","","Set a key to `null` to remove its default binding:","","```json",Te(xp,null,2),"```"].join(`
452
- `),Op=["## How User Bindings Interact with Defaults","","- User bindings are **additive** \u2014 they are appended after the default bindings","- To **move** a binding to a different key: unbind the old key (`null`) AND add the new binding","- A context only needs to appear in the user's file if they want to change something in that context"].join(`
453
- `),Fp=["## Common Patterns","","### Rebind a key","To change the external editor shortcut from `ctrl+g` to `ctrl+e`:","```json",Te(Ip,null,2),"```","","### Add a chord binding","```json",Te(Rp,null,2),"```"].join(`
454
- `),Lp=["## Behavioral Rules","","1. Only include contexts the user wants to change (minimal overrides)","2. Validate that actions and contexts are from the known lists below","3. Warn the user proactively if they choose a key that conflicts with reserved shortcuts or common tools like tmux (`ctrl+b`) and screen (`ctrl+a`)","4. When adding a new binding for an existing action, the new binding is additive (existing default still works unless explicitly unbound)","5. To fully replace a default binding, unbind the old key AND add the new one"].join(`
455
- `),_p=["## Validation with /doctor","",'The `/doctor` command includes a "Keybinding Configuration Issues" section that validates `~/.claude/keybindings.json`.',"","### Common Issues and Fixes","",ua(["Issue","Cause","Fix"],[['`keybindings.json must have a "bindings" array`',"Missing wrapper object",'Wrap bindings in `{ "bindings": [...] }`'],['`"bindings" must be an array`',"`bindings` is not an array",'Set `"bindings"` to an array: `[{ context: ..., bindings: ... }]`'],['`Unknown context "X"`',"Typo or invalid context name","Use exact context names from the Available Contexts table"],['`Duplicate key "X" in Y bindings`',"Same key defined twice in one context","Remove the duplicate; JSON uses only the last value"],['`"X" may not work: ...`',"Key conflicts with terminal/OS reserved shortcut","Choose a different key (see Reserved Shortcuts section)"],['`Could not parse keystroke "X"`',"Invalid key syntax","Check syntax: use `+` between modifiers, valid key names"],['`Invalid action for "X"`',"Action value is not a string or null",'Actions must be strings like `"app:help"` or `null` to unbind']]),"","### Example /doctor Output","","```","Keybinding Configuration Issues","Location: ~/.claude/keybindings.json",' \u2514 [Error] Unknown context "chat"'," \u2192 Valid contexts: Global, Chat, Autocomplete, ...",' \u2514 [Warning] "ctrl+c" may not work: Terminal interrupt (SIGINT)',"```","","**Errors** prevent bindings from working and must be fixed. **Warnings** indicate potential conflicts but the binding may still work."].join(`
448
+ `)}var Ip,Rp,Dp,Pp,Mp,Np,Op,Fp,Lp,_p,Bp,Gp;var Ts=z(()=>{Cp();Xp();Tp();fs();Pn();ue();Ip={$schema:"https://www.schemastore.org/claude-code-keybindings.json",$docs:"https://code.claude.com/docs/en/keybindings",bindings:[{context:"Chat",bindings:{"ctrl+e":"chat:externalEditor"}}]},Rp={context:"Chat",bindings:{"ctrl+s":null}},Dp={context:"Chat",bindings:{"ctrl+g":null,"ctrl+e":"chat:externalEditor"}},Pp={context:"Global",bindings:{"ctrl+k ctrl+t":"app:toggleTodos"}},Mp=["# Keybindings Skill","","Create or modify `~/.claude/keybindings.json` to customize keyboard shortcuts.","","## CRITICAL: Read Before Write","","**Always read `~/.claude/keybindings.json` first** (it may not exist yet). Merge changes with existing bindings \u2014 never replace the entire file.","","- Use **Edit** tool for modifications to existing files","- Use **Write** tool only if the file does not exist yet"].join(`
449
+ `),Np=["## File Format","","```json",Te(Ip,null,2),"```","","Always include the `$schema` and `$docs` fields."].join(`
450
+ `),Op=["## Keystroke Syntax","","**Modifiers** (combine with `+`):","- `ctrl` (alias: `control`)","- `alt` (aliases: `opt`, `option`) \u2014 note: `alt` and `meta` are identical in terminals","- `shift`","- `meta` (aliases: `cmd`, `command`)","","**Special keys**: `escape`/`esc`, `enter`/`return`, `tab`, `space`, `backspace`, `delete`, `up`, `down`, `left`, `right`","","**Chords**: Space-separated keystrokes, e.g. `ctrl+k ctrl+s` (1-second timeout between keystrokes)","","**Examples**: `ctrl+shift+p`, `alt+enter`, `ctrl+k ctrl+n`"].join(`
451
+ `),Fp=["## Unbinding Default Shortcuts","","Set a key to `null` to remove its default binding:","","```json",Te(Rp,null,2),"```"].join(`
452
+ `),Lp=["## How User Bindings Interact with Defaults","","- User bindings are **additive** \u2014 they are appended after the default bindings","- To **move** a binding to a different key: unbind the old key (`null`) AND add the new binding","- A context only needs to appear in the user's file if they want to change something in that context"].join(`
453
+ `),_p=["## Common Patterns","","### Rebind a key","To change the external editor shortcut from `ctrl+g` to `ctrl+e`:","```json",Te(Dp,null,2),"```","","### Add a chord binding","```json",Te(Pp,null,2),"```"].join(`
454
+ `),Bp=["## Behavioral Rules","","1. Only include contexts the user wants to change (minimal overrides)","2. Validate that actions and contexts are from the known lists below","3. Warn the user proactively if they choose a key that conflicts with reserved shortcuts or common tools like tmux (`ctrl+b`) and screen (`ctrl+a`)","4. When adding a new binding for an existing action, the new binding is additive (existing default still works unless explicitly unbound)","5. To fully replace a default binding, unbind the old key AND add the new one"].join(`
455
+ `),Gp=["## Validation with /doctor","",'The `/doctor` command includes a "Keybinding Configuration Issues" section that validates `~/.claude/keybindings.json`.',"","### Common Issues and Fixes","",ua(["Issue","Cause","Fix"],[['`keybindings.json must have a "bindings" array`',"Missing wrapper object",'Wrap bindings in `{ "bindings": [...] }`'],['`"bindings" must be an array`',"`bindings` is not an array",'Set `"bindings"` to an array: `[{ context: ..., bindings: ... }]`'],['`Unknown context "X"`',"Typo or invalid context name","Use exact context names from the Available Contexts table"],['`Duplicate key "X" in Y bindings`',"Same key defined twice in one context","Remove the duplicate; JSON uses only the last value"],['`"X" may not work: ...`',"Key conflicts with terminal/OS reserved shortcut","Choose a different key (see Reserved Shortcuts section)"],['`Could not parse keystroke "X"`',"Invalid key syntax","Check syntax: use `+` between modifiers, valid key names"],['`Invalid action for "X"`',"Action value is not a string or null",'Actions must be strings like `"app:help"` or `null` to unbind']]),"","### Example /doctor Output","","```","Keybinding Configuration Issues","Location: ~/.claude/keybindings.json",' \u2514 [Error] Unknown context "chat"'," \u2192 Valid contexts: Global, Chat, Autocomplete, ...",' \u2514 [Warning] "ctrl+c" may not work: Terminal interrupt (SIGINT)',"```","","**Errors** prevent bindings from working and must be fixed. **Warnings** indicate potential conflicts but the binding may still work."].join(`
456
456
  `)});var As=`<h1>CLI verification example</h1>
457
457
  `;var Xs=()=>{};var Es=`<h1>Server verification example</h1>
458
458
  `;var Ss=()=>{};var Is=`<hr />
459
459
  <h2>name: verify
460
460
  description: Verify a code change does what it should by running the app.</h2>
461
461
  <p>Verify the code change works as expected.</p>
462
- `;var xs=()=>{};var Rs,Ds;var Ps=U(()=>{Xs();Ss();xs();Rs=Is,Ds={"examples/cli.md":As,"examples/server.md":Es}});var Os={};pe(Os,{registerVerifySkill:()=>Hp});function Hp(){if(process.env.USER_TYPE!=="ant")return;N({name:"verify",description:Yp,userInvocable:!0,files:Ds,async getPromptForCommand(n){let e=[Vp.trimStart()];if(n)e.push(`## User Request
462
+ `;var xs=()=>{};var Rs,Ds;var Ps=z(()=>{Xs();Ss();xs();Rs=Is,Ds={"examples/cli.md":As,"examples/server.md":Es}});var Os={};de(Os,{registerVerifySkill:()=>Up});function Up(){if(process.env.USER_TYPE!=="ant")return;R({name:"verify",description:zp,userInvocable:!0,files:Ds,async getPromptForCommand(n){let e=[Hp.trimStart()];if(n)e.push(`## User Request
463
463
 
464
464
  ${n}`);return[{type:"text",text:e.join(`
465
465
 
466
- `)}]}})}var Ms,Vp,Yp;var Fs=U(()=>{$p();me();Ps();({frontmatter:Ms,content:Vp}=Ns(Rs)),Yp=typeof Ms.description==="string"?Ms.description:"Verify a code change does what it should by running the app."});var Ws={};pe(Ws,{registerDebugSkill:()=>Jp});import{open as Up,stat as Kp}from"fs/promises";function Jp(){N({name:"debug",description:process.env.USER_TYPE==="ant"?"Debug your current UnieAI Code session by reading the session debug log. Includes all event logging":"Enable debug logging for this session and help diagnose issues",allowedTools:["Read","Grep","Glob"],argumentHint:"[issue description]",disableModelInvocation:!0,userInvocable:!0,async getPromptForCommand(n){let e=Ls(),a=_s(),i;try{let u=await Kp(a),p=Math.min(u.size,jp),y=u.size-p,r=await Up(a,"r");try{let{buffer:t,bytesRead:c}=await r.read({buffer:Buffer.alloc(p),position:y}),b=t.toString("utf-8",0,c).split(`
466
+ `)}]}})}var Ms,Hp,zp;var Fs=z(()=>{Yp();ue();Ps();({frontmatter:Ms,content:Hp}=Ns(Rs)),zp=typeof Ms.description==="string"?Ms.description:"Verify a code change does what it should by running the app."});var Ws={};de(Ws,{registerDebugSkill:()=>Qp});import{open as jp,stat as Jp}from"fs/promises";function Qp(){R({name:"debug",description:process.env.USER_TYPE==="ant"?"Debug your current UnieAI Code session by reading the session debug log. Includes all event logging":"Enable debug logging for this session and help diagnose issues",allowedTools:["Read","Grep","Glob"],argumentHint:"[issue description]",disableModelInvocation:!0,userInvocable:!0,async getPromptForCommand(n){let e=Ls(),a=_s(),i;try{let u=await Jp(a),p=Math.min(u.size,Zp),y=u.size-p,r=await jp(a,"r");try{let{buffer:t,bytesRead:c}=await r.read({buffer:Buffer.alloc(p),position:y}),b=t.toString("utf-8",0,c).split(`
467
467
  `).slice(-st).join(`
468
468
  `);i=`Log size: ${Bs(u.size)}
469
469
 
@@ -507,16 +507,16 @@ Remember that settings are in:
507
507
  3. Consider launching the ${qs} subagent to understand the relevant UnieAI Code features
508
508
  4. Explain what you found in plain language
509
509
  5. Suggest concrete fixes or next steps
510
- `}]}})}var st=20,jp=65536;var $s=U(()=>{zp();Z();$e();En();Gs();me()});var Hs={};pe(Hs,{registerLoremIpsumSkill:()=>Zp});function Ys(n){let e=0,a="";while(e<n){let i=10+Math.floor(Math.random()*11),o=0;for(let l=0;l<i&&e<n;l++){let u=Vs[Math.floor(Math.random()*Vs.length)];if(a+=u,e++,o++,l===i-1||e>=n)a+=". ";else a+=" "}if(o>0&&Math.random()<0.2&&e<n)a+=`
510
+ `}]}})}var st=20,Zp=65536;var $s=z(()=>{Kp();Q();$e();En();Gs();ue()});var Hs={};de(Hs,{registerLoremIpsumSkill:()=>em});function Ys(n){let e=0,a="";while(e<n){let i=10+Math.floor(Math.random()*11),o=0;for(let l=0;l<i&&e<n;l++){let u=Vs[Math.floor(Math.random()*Vs.length)];if(a+=u,e++,o++,l===i-1||e>=n)a+=". ";else a+=" "}if(o>0&&Math.random()<0.2&&e<n)a+=`
511
511
 
512
- `}return a.trim()}function Zp(){if(process.env.USER_TYPE!=="ant")return;N({name:"lorem-ipsum",description:"Generate filler text for long context testing. Specify token count as argument (e.g., /lorem-ipsum 50000). Outputs approximately the requested number of tokens. Ant-only.",argumentHint:"[token_count]",userInvocable:!0,async getPromptForCommand(n){let e=parseInt(n);if(n&&(isNaN(e)||e<=0))return[{type:"text",text:"Invalid token count. Please provide a positive number (e.g., /lorem-ipsum 10000)."}];let a=e||1e4,i=Math.min(a,500000);if(i<a)return[{type:"text",text:`Requested ${a} tokens, but capped at 500,000 for safety.
512
+ `}return a.trim()}function em(){if(process.env.USER_TYPE!=="ant")return;R({name:"lorem-ipsum",description:"Generate filler text for long context testing. Specify token count as argument (e.g., /lorem-ipsum 50000). Outputs approximately the requested number of tokens. Ant-only.",argumentHint:"[token_count]",userInvocable:!0,async getPromptForCommand(n){let e=parseInt(n);if(n&&(isNaN(e)||e<=0))return[{type:"text",text:"Invalid token count. Please provide a positive number (e.g., /lorem-ipsum 10000)."}];let a=e||1e4,i=Math.min(a,500000);if(i<a)return[{type:"text",text:`Requested ${a} tokens, but capped at 500,000 for safety.
513
513
 
514
- ${Ys(i)}`}];return[{type:"text",text:Ys(i)}]}})}var Vs;var zs=U(()=>{me();Vs=["the","a","an","I","you","he","she","it","we","they","me","him","her","us","them","my","your","his","its","our","this","that","what","who","is","are","was","were","be","been","have","has","had","do","does","did","will","would","can","could","may","might","must","shall","should","make","made","get","got","go","went","come","came","see","saw","know","take","think","look","want","use","find","give","tell","work","call","try","ask","need","feel","seem","leave","put","time","year","day","way","man","thing","life","hand","part","place","case","point","fact","good","new","first","last","long","great","little","own","other","old","right","big","high","small","large","next","early","young","few","public","bad","same","able","in","on","at","to","for","of","with","from","by","about","like","through","over","before","between","under","since","without","and","or","but","if","than","because","as","until","while","so","though","both","each","when","where","why","how","not","now","just","more","also","here","there","then","only","very","well","back","still","even","much","too","such","never","again","most","once","off","away","down","out","up","test","code","data","file","line","text","word","number","system","program","set","run","value","name","type","state","end","start"]});var Js={};pe(Js,{registerSkillifySkill:()=>tm});function em(n){return n.filter((e)=>e.type==="user").map((e)=>{let a=e.message.content;if(typeof a==="string")return a;return a.filter((i)=>i.type==="text").map((i)=>i.text).join(`
515
- `)}).filter((e)=>e.trim().length>0)}function tm(){if(process.env.USER_TYPE!=="ant")return;N({name:"skillify",description:"Capture this session's repeatable process into a skill. Call at end of the process you want to capture with an optional description.",allowedTools:["Read","Write","Edit","Glob","Grep","AskUserQuestion","Bash(mkdir:*)"],userInvocable:!0,disableModelInvocation:!0,argumentHint:"[description of the process you want to capture]",async getPromptForCommand(n,e){let a=await Us()??"No session memory available.",i=em(Ks(e.messages)),o=n?`The user described this process as: "${n}"`:"";return[{type:"text",text:nm.replace("{{sessionMemory}}",a).replace("{{userMessages}}",i.join(`
514
+ ${Ys(i)}`}];return[{type:"text",text:Ys(i)}]}})}var Vs;var zs=z(()=>{ue();Vs=["the","a","an","I","you","he","she","it","we","they","me","him","her","us","them","my","your","his","its","our","this","that","what","who","is","are","was","were","be","been","have","has","had","do","does","did","will","would","can","could","may","might","must","shall","should","make","made","get","got","go","went","come","came","see","saw","know","take","think","look","want","use","find","give","tell","work","call","try","ask","need","feel","seem","leave","put","time","year","day","way","man","thing","life","hand","part","place","case","point","fact","good","new","first","last","long","great","little","own","other","old","right","big","high","small","large","next","early","young","few","public","bad","same","able","in","on","at","to","for","of","with","from","by","about","like","through","over","before","between","under","since","without","and","or","but","if","than","because","as","until","while","so","though","both","each","when","where","why","how","not","now","just","more","also","here","there","then","only","very","well","back","still","even","much","too","such","never","again","most","once","off","away","down","out","up","test","code","data","file","line","text","word","number","system","program","set","run","value","name","type","state","end","start"]});var Js={};de(Js,{registerSkillifySkill:()=>im});function tm(n){return n.filter((e)=>e.type==="user").map((e)=>{let a=e.message.content;if(typeof a==="string")return a;return a.filter((i)=>i.type==="text").map((i)=>i.text).join(`
515
+ `)}).filter((e)=>e.trim().length>0)}function im(){if(process.env.USER_TYPE!=="ant")return;R({name:"skillify",description:"Capture this session's repeatable process into a skill. Call at end of the process you want to capture with an optional description.",allowedTools:["Read","Write","Edit","Glob","Grep","AskUserQuestion","Bash(mkdir:*)"],userInvocable:!0,disableModelInvocation:!0,argumentHint:"[description of the process you want to capture]",async getPromptForCommand(n,e){let a=await Us()??"No session memory available.",i=tm(Ks(e.messages)),o=n?`The user described this process as: "${n}"`:"";return[{type:"text",text:am.replace("{{sessionMemory}}",a).replace("{{userMessages}}",i.join(`
516
516
 
517
517
  ---
518
518
 
519
- `)).replace("{{userDescriptionBlock}}",o)}]}})}var nm=`# Skillify {{userDescriptionBlock}}
519
+ `)).replace("{{userDescriptionBlock}}",o)}]}})}var am=`# Skillify {{userDescriptionBlock}}
520
520
 
521
521
  You are capturing this session's repeatable process as a reusable skill.
522
522
 
@@ -650,7 +650,7 @@ After writing, tell the user:
650
650
  - Where the skill was saved
651
651
  - How to invoke it: \`/{{skill-name}} [arguments]\`
652
652
  - That they can edit the SKILL.md directly to refine it
653
- `;var Zs=U(()=>{Qp();js();me()});var eo={};pe(eo,{registerRememberSkill:()=>im});function im(){if(process.env.USER_TYPE!=="ant")return;let n=`# Memory Review
653
+ `;var Zs=z(()=>{nm();js();ue()});var eo={};de(eo,{registerRememberSkill:()=>sm});function sm(){if(process.env.USER_TYPE!=="ant")return;let n=`# Memory Review
654
654
 
655
655
  ## Goal
656
656
  Review the user's memory landscape and produce a clear report of proposed changes, grouped by action type. Do NOT apply changes \u2014 present proposals for user approval.
@@ -703,14 +703,14 @@ If auto-memory is empty, say so and offer to review CLAUDE.md for cleanup.
703
703
  - Do NOT modify files without explicit user approval
704
704
  - Do NOT create new files unless the target doesn't exist yet
705
705
  - Ask about ambiguous entries \u2014 don't guess
706
- `;N({name:"remember",description:"Review auto-memory entries and propose promotions to CLAUDE.md, CLAUDE.local.md, or shared memory. Also detects outdated, conflicting, and duplicate entries across memory layers.",whenToUse:"Use when the user wants to review, organize, or promote their auto-memory entries. Also useful for cleaning up outdated or conflicting entries across CLAUDE.md, CLAUDE.local.md, and auto-memory.",userInvocable:!0,isEnabled:()=>Qs(),async getPromptForCommand(e){let a=n;if(e)a+=`
706
+ `;R({name:"remember",description:"Review auto-memory entries and propose promotions to CLAUDE.md, CLAUDE.local.md, or shared memory. Also detects outdated, conflicting, and duplicate entries across memory layers.",whenToUse:"Use when the user wants to review, organize, or promote their auto-memory entries. Also useful for cleaning up outdated or conflicting entries across CLAUDE.md, CLAUDE.local.md, and auto-memory.",userInvocable:!0,isEnabled:()=>Qs(),async getPromptForCommand(e){let a=n;if(e)a+=`
707
707
  ## Additional context from user
708
708
 
709
- ${e}`;return[{type:"text",text:a}]}})}var no=U(()=>{am();me()});var ao={};pe(ao,{registerSimplifySkill:()=>sm});function sm(){N({name:"simplify",description:"Review changed code for reuse, quality, and efficiency, then fix any issues found.",userInvocable:!0,async getPromptForCommand(n){let e=rm;if(n)e+=`
709
+ ${e}`;return[{type:"text",text:a}]}})}var no=z(()=>{rm();ue()});var ao={};de(ao,{registerSimplifySkill:()=>lm});function lm(){R({name:"simplify",description:"Review changed code for reuse, quality, and efficiency, then fix any issues found.",userInvocable:!0,async getPromptForCommand(n){let e=om;if(n)e+=`
710
710
 
711
711
  ## Additional Focus
712
712
 
713
- ${n}`;return[{type:"text",text:e}]}})}var rm;var io=U(()=>{to();me();rm=`# Simplify: Code Review and Cleanup
713
+ ${n}`;return[{type:"text",text:e}]}})}var om;var io=z(()=>{to();ue();om=`# Simplify: Code Review and Cleanup
714
714
 
715
715
  Review all changed files for reuse, quality, and efficiency. Fix any issues found.
716
716
 
@@ -759,7 +759,7 @@ Review the same changes for efficiency:
759
759
  Wait for all three agents to complete. Aggregate their findings and fix each issue directly. If a finding is a false positive or not worth addressing, note it and move on \u2014 do not argue with the finding, just skip it.
760
760
 
761
761
  When done, briefly summarize what was fixed (or confirm the code was already clean).
762
- `});var po={};pe(po,{registerBatchSkill:()=>gm});function pm(n){return`# Batch: Parallel Work Orchestration
762
+ `});var po={};de(po,{registerBatchSkill:()=>ym});function hm(n){return`# Batch: Parallel Work Orchestration
763
763
 
764
764
  You are orchestrating a large, parallelizable change across this codebase.
765
765
 
@@ -810,7 +810,7 @@ For each agent, the prompt must be fully self-contained. Include:
810
810
  - The worker instructions below, copied verbatim:
811
811
 
812
812
  \`\`\`
813
- ${um}
813
+ ${mm}
814
814
  \`\`\`
815
815
 
816
816
  Use \`subagent_type: "general-purpose"\` unless a more specific agent type fits.
@@ -827,21 +827,21 @@ After launching all workers, render an initial status table:
827
827
  As background-agent completion notifications arrive, parse the \`PR: <url>\` line from each agent's result and re-render the table with updated status (\`done\` / \`failed\`) and PR links. Keep a brief failure note for any agent that did not produce a PR.
828
828
 
829
829
  When all agents have reported, render the final table and a one-line summary (e.g., "22/24 units landed as PRs").
830
- `}function gm(){N({name:"batch",description:"Research and plan a large-scale change, then execute it in parallel across 5\u201330 isolated worktree agents that each open a PR.",whenToUse:"Use when the user wants to make a sweeping, mechanical change across many files (migrations, refactors, bulk renames) that can be decomposed into independent parallel units.",argumentHint:"<instruction>",userInvocable:!0,disableModelInvocation:!0,async getPromptForCommand(n){let e=n.trim();if(!e)return[{type:"text",text:hm}];if(!await dt())return[{type:"text",text:mm}];return[{type:"text",text:pm(e)}]}})}var ro=5,so=30,um,mm="This is not a git repository. The `/batch` command requires a git repo because it spawns agents in isolated git worktrees and creates PRs from each. Initialize a repo first, or run this from inside an existing one.",hm=`Provide an instruction describing the batch change you want to make.
830
+ `}function ym(){R({name:"batch",description:"Research and plan a large-scale change, then execute it in parallel across 5\u201330 isolated worktree agents that each open a PR.",whenToUse:"Use when the user wants to make a sweeping, mechanical change across many files (migrations, refactors, bulk renames) that can be decomposed into independent parallel units.",argumentHint:"<instruction>",userInvocable:!0,disableModelInvocation:!0,async getPromptForCommand(n){let e=n.trim();if(!e)return[{type:"text",text:fm}];if(!await dt())return[{type:"text",text:gm}];return[{type:"text",text:hm(e)}]}})}var ro=5,so=30,mm,gm="This is not a git repository. The `/batch` command requires a git repo because it spawns agents in isolated git worktrees and creates PRs from each. Initialize a repo first, or run this from inside an existing one.",fm=`Provide an instruction describing the batch change you want to make.
831
831
 
832
832
  Examples:
833
833
  /batch migrate from react to vue
834
834
  /batch replace all uses of lodash with native equivalents
835
- /batch add type annotations to all untyped function parameters`;var mo=U(()=>{to();cm();lm();om();dm();pa();me();um=`After you finish implementing the change:
835
+ /batch add type annotations to all untyped function parameters`;var mo=z(()=>{to();um();dm();cm();pm();pa();ue();mm=`After you finish implementing the change:
836
836
  1. **Simplify** \u2014 Invoke the \`${uo}\` tool with \`skill: "simplify"\` to review and clean up your changes.
837
837
  2. **Run unit tests** \u2014 Run the project's test suite (check for package.json scripts, Makefile targets, or common commands like \`npm test\`, \`bun test\`, \`pytest\`, \`go test\`). If tests fail, fix them.
838
838
  3. **Test end-to-end** \u2014 Follow the e2e test recipe from the coordinator's prompt (below). If the recipe says to skip e2e for this unit, skip it.
839
839
  4. **Commit and push** \u2014 Commit all changes with a clear message, push the branch, and create a PR with \`gh pr create\`. Use a descriptive title. If \`gh\` is not available or the push fails, note it in your final message.
840
- 5. **Report** \u2014 End with a single line: \`PR: <url>\` so the coordinator can track it. If no PR was created, end with \`PR: none \u2014 <reason>\`.`});var ho={};pe(ho,{registerStuckSkill:()=>ym});function ym(){if(process.env.USER_TYPE!=="ant")return;N({name:"stuck",description:"[ANT-ONLY] Investigate frozen/stuck/slow UnieAI Code sessions on this machine and post a diagnostic report to #claude-code-feedback.",userInvocable:!0,async getPromptForCommand(n){let e=fm;if(n)e+=`
840
+ 5. **Report** \u2014 End with a single line: \`PR: <url>\` so the coordinator can track it. If no PR was created, end with \`PR: none \u2014 <reason>\`.`});var ho={};de(ho,{registerStuckSkill:()=>vm});function vm(){if(process.env.USER_TYPE!=="ant")return;R({name:"stuck",description:"[ANT-ONLY] Investigate frozen/stuck/slow UnieAI Code sessions on this machine and post a diagnostic report to #claude-code-feedback.",userInvocable:!0,async getPromptForCommand(n){let e=bm;if(n)e+=`
841
841
  ## User-provided context
842
842
 
843
843
  ${n}
844
- `;return[{type:"text",text:e}]}})}var fm="# /stuck \u2014 diagnose frozen/slow UnieAI Code sessions\n\nThe user thinks another UnieAI Code session on this machine is frozen, stuck, or very slow. Investigate and post a report to #claude-code-feedback.\n\n## What to look for\n\nScan for other UnieAI Code processes (excluding the current one \u2014 PID is in `process.pid` but for shell commands just exclude the PID you see running this prompt). Process names are typically `claude` (installed) or `cli` (native dev build).\n\nSigns of a stuck session:\n- **High CPU (\u226590%) sustained** \u2014 likely an infinite loop. Sample twice, 1-2s apart, to confirm it's not a transient spike.\n- **Process state `D` (uninterruptible sleep)** \u2014 often an I/O hang. The `state` column in `ps` output; first character matters (ignore modifiers like `+`, `s`, `<`).\n- **Process state `T` (stopped)** \u2014 user probably hit Ctrl+Z by accident.\n- **Process state `Z` (zombie)** \u2014 parent isn't reaping.\n- **Very high RSS (\u22654GB)** \u2014 possible memory leak making the session sluggish.\n- **Stuck child process** \u2014 a hung `git`, `node`, or shell subprocess can freeze the parent. Check `pgrep -lP <pid>` for each session.\n\n## Investigation steps\n\n1. **List all UnieAI Code processes** (macOS/Linux):\n ```\n ps -axo pid=,pcpu=,rss=,etime=,state=,comm=,command= | grep -E '(claude|cli)' | grep -v grep\n ```\n Filter to rows where `comm` is `claude` or (`cli` AND the command path contains \"claude\").\n\n2. **For anything suspicious**, gather more context:\n - Child processes: `pgrep -lP <pid>`\n - If high CPU: sample again after 1-2s to confirm it's sustained\n - If a child looks hung (e.g., a git command), note its full command line with `ps -p <child_pid> -o command=`\n - Check the session's debug log if you can infer the session ID: `~/.claude/debug/<session-id>.txt` (the last few hundred lines often show what it was doing before hanging)\n\n3. **Consider a stack dump** for a truly frozen process (advanced, optional):\n - macOS: `sample <pid> 3` gives a 3-second native stack sample\n - This is big \u2014 only grab it if the process is clearly hung and you want to know *why*\n\n## Report\n\n**Only post to Slack if you actually found something stuck.** If every session looks healthy, tell the user that directly \u2014 do not post an all-clear to the channel.\n\nIf you did find a stuck/slow session, post to **#claude-code-feedback** (channel ID: `C07VBSHV7EV`) using the Slack MCP tool. Use ToolSearch to find `slack_send_message` if it's not already loaded.\n\n**Use a two-message structure** to keep the channel scannable:\n\n1. **Top-level message** \u2014 one short line: hostname, UnieAI Code version, and a terse symptom (e.g. \"session PID 12345 pegged at 100% CPU for 10min\" or \"git subprocess hung in D state\"). No code blocks, no details.\n2. **Thread reply** \u2014 the full diagnostic dump. Pass the top-level message's `ts` as `thread_ts`. Include:\n - PID, CPU%, RSS, state, uptime, command line, child processes\n - Your diagnosis of what's likely wrong\n - Relevant debug log tail or `sample` output if you captured it\n\nIf Slack MCP isn't available, format the report as a message the user can copy-paste into #claude-code-feedback (and let them know to thread the details themselves).\n\n## Notes\n- Don't kill or signal any processes \u2014 this is diagnostic only.\n- If the user gave an argument (e.g., a specific PID or symptom), focus there first.\n";var go=U(()=>{me()});var fo={};pe(fo,{registerTasteSkills:()=>vm});function vm(){for(let n of bm){let e=Object.keys(n.files).length>0;N({name:n.name,description:n.description,userInvocable:!0,...e?{files:n.files}:{},getPromptForCommand:async()=>[{type:"text",text:n.body}]})}}var bm;var yo=U(()=>{me();bm=[{name:"design-taste-frontend",description:"Anti-slop frontend skill for landing pages, portfolios, and redesigns. The agent reads the brief, infers the right design direction, and ships interfaces that do not look templated. Real design systems when applicable, audit-first on redesigns, strict pre-flight check.",body:`# tasteskill: Anti-Slop Frontend Skill
844
+ `;return[{type:"text",text:e}]}})}var bm="# /stuck \u2014 diagnose frozen/slow UnieAI Code sessions\n\nThe user thinks another UnieAI Code session on this machine is frozen, stuck, or very slow. Investigate and post a report to #claude-code-feedback.\n\n## What to look for\n\nScan for other UnieAI Code processes (excluding the current one \u2014 PID is in `process.pid` but for shell commands just exclude the PID you see running this prompt). Process names are typically `claude` (installed) or `cli` (native dev build).\n\nSigns of a stuck session:\n- **High CPU (\u226590%) sustained** \u2014 likely an infinite loop. Sample twice, 1-2s apart, to confirm it's not a transient spike.\n- **Process state `D` (uninterruptible sleep)** \u2014 often an I/O hang. The `state` column in `ps` output; first character matters (ignore modifiers like `+`, `s`, `<`).\n- **Process state `T` (stopped)** \u2014 user probably hit Ctrl+Z by accident.\n- **Process state `Z` (zombie)** \u2014 parent isn't reaping.\n- **Very high RSS (\u22654GB)** \u2014 possible memory leak making the session sluggish.\n- **Stuck child process** \u2014 a hung `git`, `node`, or shell subprocess can freeze the parent. Check `pgrep -lP <pid>` for each session.\n\n## Investigation steps\n\n1. **List all UnieAI Code processes** (macOS/Linux):\n ```\n ps -axo pid=,pcpu=,rss=,etime=,state=,comm=,command= | grep -E '(claude|cli)' | grep -v grep\n ```\n Filter to rows where `comm` is `claude` or (`cli` AND the command path contains \"claude\").\n\n2. **For anything suspicious**, gather more context:\n - Child processes: `pgrep -lP <pid>`\n - If high CPU: sample again after 1-2s to confirm it's sustained\n - If a child looks hung (e.g., a git command), note its full command line with `ps -p <child_pid> -o command=`\n - Check the session's debug log if you can infer the session ID: `~/.claude/debug/<session-id>.txt` (the last few hundred lines often show what it was doing before hanging)\n\n3. **Consider a stack dump** for a truly frozen process (advanced, optional):\n - macOS: `sample <pid> 3` gives a 3-second native stack sample\n - This is big \u2014 only grab it if the process is clearly hung and you want to know *why*\n\n## Report\n\n**Only post to Slack if you actually found something stuck.** If every session looks healthy, tell the user that directly \u2014 do not post an all-clear to the channel.\n\nIf you did find a stuck/slow session, post to **#claude-code-feedback** (channel ID: `C07VBSHV7EV`) using the Slack MCP tool. Use ToolSearch to find `slack_send_message` if it's not already loaded.\n\n**Use a two-message structure** to keep the channel scannable:\n\n1. **Top-level message** \u2014 one short line: hostname, UnieAI Code version, and a terse symptom (e.g. \"session PID 12345 pegged at 100% CPU for 10min\" or \"git subprocess hung in D state\"). No code blocks, no details.\n2. **Thread reply** \u2014 the full diagnostic dump. Pass the top-level message's `ts` as `thread_ts`. Include:\n - PID, CPU%, RSS, state, uptime, command line, child processes\n - Your diagnosis of what's likely wrong\n - Relevant debug log tail or `sample` output if you captured it\n\nIf Slack MCP isn't available, format the report as a message the user can copy-paste into #claude-code-feedback (and let them know to thread the details themselves).\n\n## Notes\n- Don't kill or signal any processes \u2014 this is diagnostic only.\n- If the user gave an argument (e.g., a specific PID or symptom), focus there first.\n";var go=z(()=>{ue()});var fo={};de(fo,{registerTasteSkills:()=>km});function km(){for(let n of wm){let e=Object.keys(n.files).length>0;R({name:n.name,description:n.description,userInvocable:!0,...e?{files:n.files}:{},getPromptForCommand:async()=>[{type:"text",text:n.body}]})}}var wm;var yo=z(()=>{ue();wm=[{name:"design-taste-frontend",description:"Anti-slop frontend skill for landing pages, portfolios, and redesigns. The agent reads the brief, infers the right design direction, and ships interfaces that do not look templated. Real design systems when applicable, audit-first on redesigns, strict pre-flight check.",body:`# tasteskill: Anti-Slop Frontend Skill
845
845
 
846
846
  > Landing pages, portfolios, and redesigns. Not dashboards, not data tables, not multi-step product UI.
847
847
  > Every rule below is **contextual**. None of it fires automatically. First read the brief, then pull only what fits.
@@ -3178,7 +3178,7 @@ This skill generates \`DESIGN.md\` files optimized for Google Stitch screen gene
3178
3178
  The generated \`DESIGN.md\` serves as the **single source of truth** for prompting Stitch to generate new screens that align with a curated, high-agency design language. Stitch interprets design through **"Visual Descriptions"** supported by specific color values, typography specs, and component behaviors.
3179
3179
 
3180
3180
  ## Prerequisites
3181
- - Access to Google Stitch via [labs.google.com/stitch](https://labs.google.com/stitch)
3181
+ - Access to Google Stitch via [labs.google/stitch](https://labs.google/stitch)
3182
3182
  - Optionally: Stitch MCP Server for programmatic integration with Cursor, Antigravity, or Gemini CLI
3183
3183
 
3184
3184
  ## The Goal
@@ -7010,7 +7010,7 @@ It should actively avoid:
7010
7010
  - sloppy or missing phone mockups
7011
7011
  - oversized device framing that distracts from the design
7012
7012
 
7013
- The final result should look like a high-end mobile app concept with clean hierarchy, good flow logic, strong visual taste, richer image direction, a clean controlled color palette, non-generic art direction, strong multi-screen consistency, readable typography, premium phone mockup framing, and clear platform-aware structure.`,files:{}}]});var bo={};pe(bo,{registerFinanceSkills:()=>km});function km(){for(let n of wm){let e=Object.keys(n.files).length>0;N({name:n.name,description:n.description,userInvocable:!0,...e?{files:n.files}:{},getPromptForCommand:async()=>[{type:"text",text:n.body}]})}}var wm;var vo=U(()=>{me();wm=[{name:"3-statement-model",description:"Complete, populate and fill out 3-statement financial model templates (Income Statement, Balance Sheet, Cash Flow Statement) . Use when asked to fill out model templates, complete existing model frameworks, populate financial models with data, complete a partially filled IS/BS/CF framework, or link integrated financial statements within an existing template structure. Triggers include requests to fill in, complete, or populate a 3-statement model template",body:'# 3-Statement Financial Model Template Completion\n\nComplete and populate integrated financial model templates with proper linkages between Income Statement, Balance Sheet, and Cash Flow Statement.\n\n## \u26A0\uFE0F CRITICAL PRINCIPLES \u2014 Read Before Populating Any Template\n\n**Environment \u2014 Office JS vs Python:**\n- **If running inside Excel (Office Add-in / Office JS):** Use Office JS directly. Write formulas via `range.formulas = [["=D14*(1+Assumptions!$B$5)"]]` \u2014 never `range.values` for derived cells. No separate recalc; Excel computes natively. Use `context.workbook.worksheets.getItem(...)` to navigate tabs.\n- **If generating a standalone .xlsx file:** Use Python/openpyxl. Write `ws["D15"] = "=D14*(1+Assumptions!$B$5)"`, then run `recalc.py` before delivery.\n- **Office JS merged cell pitfall:** Do NOT call `.merge()` then set `.values` on the merged range \u2014 throws `InvalidArgument` because the range still reports its pre-merge dimensions. Instead write value to top-left cell alone, then merge + format the full range: `ws.getRange("A1").values = [["INCOME STATEMENT"]]; const h = ws.getRange("A1:G1"); h.merge(); h.format.fill.color = "#1F4E79";`\n- All principles below apply identically in either environment.\n\n**Formulas over hardcodes (non-negotiable):**\n- Every projection cell, roll-forward, linkage, and subtotal MUST be an Excel formula \u2014 never a pre-computed value\n- When using Python/openpyxl: write formula strings (`ws["D15"] = "=D14*(1+Assumptions!$B$5)"`), NOT computed results (`ws["D15"] = 12500`)\n- The ONLY cells that should contain hardcoded numbers are: (1) historical actuals, (2) assumption drivers in the Assumptions tab\n- If you find yourself computing a value in Python and writing the result to a cell \u2014 STOP. Write the formula instead.\n- Why: the model must flex when scenarios toggle or assumptions change. Hardcodes break every downstream integrity check silently.\n\n**Verify step-by-step with the user:**\n1. **After mapping the template** \u2192 show the user which tabs/sections you\'ve identified and confirm before touching any cells\n2. **After populating historicals** \u2192 show the user the historical block and confirm values/periods match source data\n3. **After building IS projections** \u2192 run the subtotal checks, show the user the projected IS, confirm before moving to BS\n4. **After building BS** \u2192 show the user the balance check (Assets = L+E) for every period, confirm before moving to CF\n5. **After building CF** \u2192 show the user the cash tie-out (CF ending cash = BS cash), confirm before finalizing\n6. **Do NOT populate the entire model end-to-end and present it complete** \u2014 break at each statement, show the work, catch errors early\n\n## Formatting \u2014 Professional Blue/Grey Palette (Default unless template/user specifies otherwise)\n\n**Keep colors minimal.** Use only blues and greys for cell fills. Do NOT introduce greens, yellows, oranges, or multiple accent colors \u2014 a clean model uses restraint.\n\n| Element | Fill | Font |\n|---|---|---|\n| Section headers (IS / BS / CF titles) | Dark blue `#1F4E79` | White bold |\n| Column headers (FY2024A, FY2025E, etc.) | Light blue `#D9E1F2` | Black bold |\n| Input cells (historicals, assumption drivers) | Light grey `#F2F2F2` or white | Blue `#0000FF` |\n| Formula cells | White | Black |\n| Cross-tab links | White | Green `#008000` |\n| Check rows / key totals | Medium blue `#BDD7EE` | Black bold |\n\n**That\'s 3 blues + 1 grey + white.** If the template has its own color scheme, follow the template instead.\n\nFont color signals *what* a cell is (input/formula/link). Fill color signals *where* you are (header/data/check).\n\n## Model Structure\n\n### Identifying Template Tab Organization\n\nTemplates vary in their tab naming conventions and organization. Before populating, review all tabs to understand the template\'s structure. Below are common tab names and their typical contents:\n\n| Common Tab Names | Contents to Look For |\n|------------------|----------------------|\n| IS, P&L, Income Statement | Income Statement |\n| BS, Balance Sheet | Balance Sheet |\n| CF, CFS, Cash Flow | Cash Flow Statement |\n| WC, Working Capital | Working Capital Schedule |\n| DA, D&A, Depreciation, PP&E | Depreciation & Amortization Schedule |\n| Debt, Debt Schedule | Debt Schedule |\n| NOL, Tax, DTA | Net Operating Loss Schedule |\n| Assumptions, Inputs, Drivers | Driver assumptions and inputs |\n| Checks, Audit, Validation | Error-checking dashboard |\n\n**Template Review Checklist**\n- Identify which tabs exist in the template (not all templates include every schedule)\n- Note any template-specific tabs not listed above\n- Understand tab dependencies (e.g., which schedules feed into the main statements)\n- Locate input cells vs. formula cells on each tab\n\n### Understanding Template Structure\n\nBefore populating a template, familiarize yourself with its existing layout to ensure data is entered in the correct locations and formulas remain intact.\n\n**Identifying Row Structure**\n- Locate the model title at top of each tab\n- Identify section headers and their visual separation\n- Find the units row indicating $ millions, %, x, etc.\n- Note column headers distinguishing Actuals vs. Estimates periods\n- Confirm period labels (e.g., FY2024A, FY2025E)\n- Identify input cells vs. formula cells (typically distinguished by font color)\n\n**Identifying Column Structure**\n- Confirm line item labels in leftmost column\n- Verify historical years precede projection years\n- Note the visual border separating historical from projected periods\n- Check for consistent column order across all tabs\n\n**Working with Named Ranges**\nTemplates often use named ranges for key inputs and outputs. Before entering data:\n- Review existing named ranges in the template (Formulas \u2192 Name Manager in Excel)\n- Common named ranges include: Revenue growth rates, cost percentages, key outputs (Net Income, EBITDA, Total Debt, Cash), scenario selector cell\n- Ensure inputs are entered in cells that feed into these named ranges\n\n### Projection Period\n- Templates typically project 5 years forward from last historical year\n- Verify historical (A) vs. projected (E) columns are clearly separated\n- Confirm columns use fiscal year notation (e.g., FY2024A, FY2025E)\n\n## Margin Analysis\n\n**Note: The following margin analysis should only be performed if prompted by the user or if the template explicitly requires it. If no prompt is given, skip this section.**\n\nCalculate and display profitability margins on the Income Statement (IS) tab to track operational efficiency and enable peer comparison.\n\n### Core Margins to Include\n\n| Margin | Formula | What It Measures |\n|--------|---------|------------------|\n| Gross Margin | Gross Profit / Revenue | Pricing power, production efficiency |\n| EBITDA Margin | EBITDA / Revenue | Core operating profitability |\n| EBIT Margin | EBIT / Revenue | Operating profitability after D&A |\n| Net Income Margin | Net Income / Revenue | Bottom-line profitability |\n\n### Income Statement Layout with Margins\n\nDisplay margin percentages directly below each profit line item:\n- Gross Margin % below Gross Profit\n- EBIT Margin % below EBIT\n- EBITDA Margin % below EBITDA\n- Net Income Margin % below Net Income\n\n## Credit Metrics\n\n**Note: The following Credit analysis should only be performed if prompted by the user or if the template explicitly requires it. If no prompt is given, skip this section.**\n\nCalculate and display credit/leverage metrics on the Balance Sheet (BS) tab to assess financial health, debt capacity, and covenant compliance.\n\n### Core Credit Metrics to Include\n\n| Metric | Formula | What It Measures |\n|--------|---------|------------------|\n| Total Debt / EBITDA | Total Debt / LTM EBITDA | Leverage multiple |\n| Net Debt / EBITDA | (Total Debt - Cash) / LTM EBITDA | Leverage net of cash |\n| Interest Coverage | EBITDA / Interest Expense | Ability to service debt |\n| Debt / Total Cap | Total Debt / (Total Debt + Equity) | Capital structure |\n| Debt / Equity | Total Debt / Total Equity | Financial leverage |\n| Current Ratio | Current Assets / Current Liabilities | Short-term liquidity |\n| Quick Ratio | (Current Assets - Inventory) / Current Liabilities | Immediate liquidity |\n\n### Credit Metric Hierarchy Checks\n\nValidate that Upside shows strongest credit profile:\n- Leverage: Upside < Base < Downside (lower is better)\n- Coverage: Upside > Base > Downside (higher is better)\n- Liquidity: Upside > Base > Downside (higher is better)\n\n### Covenant Compliance Tracking\n\nIf debt covenants are known, add explicit compliance checks comparing actual metrics to covenant thresholds.\n\n## Scenario Analysis (Base / Upside / Downside)\n\nUse a scenario toggle (dropdown) in the Assumptions tab with CHOOSE or INDEX/MATCH formulas.\n\n| Scenario | Description |\n|----------|-------------|\n| Base Case | Management guidance or consensus estimates |\n| Upside Case | Above-guidance growth, margin expansion |\n| Downside Case | Below-trend growth, margin compression |\n\n**Key Drivers to Sensitize**: Revenue growth, Gross margin, SG&A %, DSO/DIO/DPO, CapEx %, Interest rate, Tax rate.\n\n**Scenario Audit Checks**: Toggle switches all statements, BS balances in all scenarios, Cash ties out, Hierarchy holds (Upside > Base > Downside for NI, EBITDA, FCF, margins).\n\n## SEC Filings Data Extraction\n\nIf the template specifically requires pulling data from SEC filings (10-K, 10-Q), see [references/sec-filings.md](references/sec-filings.md) for detailed extraction guidance. This reference is only needed when populating templates with public company data from regulatory filings.\n\n## Completing Model Templates\n\nThis section provides general guidance for completing any 3-statement financial model template while preserving existing formulas and ensuring data integrity.\n\n### Step 1: Analyze the Template Structure\n\nBefore entering any data, thoroughly review the template to understand its architecture:\n\n**Identify Input vs. Formula Cells**\n- Look for visual cues (font color, cell shading) that distinguish input cells from formula cells\n- Common conventions: Blue font = inputs, Black font = formulas, Green font = links to other sheets\n- Use Excel\'s Trace Precedents/Dependents (Formulas \u2192 Trace Precedents) to understand cell relationships\n- Check for named ranges that may control key inputs (Formulas \u2192 Name Manager)\n\n**Map the Template\'s Flow**\n- Identify which tabs feed into others (e.g., Assumptions \u2192 IS \u2192 BS \u2192 CF)\n- Note any supporting schedules and their linkages to main statements\n- Document the template\'s specific line items and structure before populating\n\n### Step 2: Filling in Data Without Breaking Formulas\n\n**Golden Rules for Data Entry**\n\n| Rule | Description |\n|------|-------------|\n| Only edit input cells | Never overwrite cells containing formulas unless intentionally replacing the formula |\n| Preserve cell references | When copying data, use Paste Values (Ctrl+Shift+V) to avoid overwriting formulas with source formatting |\n| Match the template\'s units | Verify if template uses thousands, millions, or actual values before entering data |\n| Respect sign conventions | Follow the template\'s existing sign convention (e.g., expenses as positive or negative) |\n| Check for circular references | If the template uses iterative calculations, ensure Enable Iterative Calculation is turned on |\n\n**Safe Data Entry Process**\n1. Identify the exact cells designated for input (usually highlighted or labeled)\n2. Enter historical data first, then verify formulas are calculating correctly for those periods\n3. Enter assumption drivers that feed forecast calculations\n4. Review calculated outputs to confirm formulas are working as intended\n5. If a formula cell must be modified, document the original formula before making changes\n\n**Handling Pre-Built Formulas**\n- If formulas reference cells you haven\'t populated yet, expect temporary errors (#REF!, #DIV/0!) until all inputs are complete\n- When formulas produce unexpected results, trace precedents to identify missing or incorrect inputs\n- Never delete rows/columns without checking for formula dependencies across all tabs\n\n### Step 3: Validating Formulas\n\n**Formula Integrity Checks**\n\nBefore relying on template outputs, validate that formulas are functioning correctly:\n\n| Check Type | Method |\n|------------|--------|\n| Trace precedents | Select a formula cell \u2192 Formulas \u2192 Trace Precedents to verify it references correct inputs |\n| Trace dependents | Verify key inputs flow to expected output cells |\n| Evaluate formula | Use Formulas \u2192 Evaluate Formula to step through complex calculations |\n| Check for hardcodes | Projection formulas should reference assumptions, not contain hardcoded values |\n| Test with known values | Input simple test values to verify formulas produce expected results |\n| Cross-tab consistency | Ensure the same formula logic applies across all projection periods |\n\n**Common Formula Issues to Watch For**\n- Mixed absolute/relative references causing incorrect results when copied across periods\n- Broken links to external files or deleted ranges (#REF! errors)\n- Division by zero in early periods before revenue ramps (#DIV/0! errors)\n- Circular reference warnings (may be intentional for interest calculations)\n- Inconsistent formulas across projection columns (use Ctrl+\\ to find differences)\n\n**Validating Cross-Tab Linkages**\n- Confirm values that appear on multiple tabs are linked (not duplicated)\n- Verify schedule totals tie to corresponding line items on main statements\n- Check that period labels align across all tabs\n\n### Step 4: Quality Checks by Sheet\n\nPerform these validation checks on each sheet after populating the template:\n\n**Income Statement (IS) Quality Checks**\n- Revenue figures match source data for historical periods\n- All expense line items sum to reported totals\n- Subtotals (Gross Profit, EBIT, EBT, Net Income) calculate correctly\n- Tax calculation logic is appropriate (handles losses correctly)\n- Forecast drivers reference assumptions tab (no hardcodes)\n- Period-over-period changes are directionally reasonable\n\n**Balance Sheet (BS) Quality Checks**\n- Assets = Liabilities + Equity for every period (primary check)\n- Cash balance matches Cash Flow Statement ending cash\n- Working capital accounts tie to supporting schedules (if applicable)\n- Retained Earnings rolls forward correctly: Prior RE + Net Income - Dividends +/- Adjustments = Ending RE\n- Debt balances tie to debt schedule (if applicable)\n- All balance sheet items have appropriate signs (assets positive, most liabilities positive)\n\n**Cash Flow Statement (CF) Quality Checks**\n- Net Income at top of CFO matches Income Statement Net Income\n- Non-cash add-backs (D&A, SBC, etc.) tie to their source schedules/statements\n- Working capital changes have correct signs (increase in asset = use of cash = negative)\n- CapEx ties to PP&E schedule or fixed asset roll-forward\n- Financing activities tie to changes in debt and equity accounts on BS\n- Ending Cash matches Balance Sheet Cash\n- Beginning Cash equals prior period Ending Cash\n\n**Supporting Schedule Quality Checks**\n- Opening balances equal prior period closing balances\n- Roll-forward logic is complete (Beginning + Additions - Deductions = Ending)\n- Schedule totals tie to main statement line items\n- Assumptions used in calculations match Assumptions tab\n\n### Step 5: Cross-Statement Integrity Checks\n\nAfter validating individual sheets, confirm the three statements are properly integrated:\n\n| Check | Formula | Expected Result |\n|-------|---------|-----------------|\n| Balance Sheet Balance | Assets - Liabilities - Equity | = 0 |\n| Cash Tie-Out | CF Ending Cash - BS Cash | = 0 |\n| Net Income Link | IS Net Income - CF Starting Net Income | = 0 |\n| Retained Earnings | Prior RE + NI - Dividends - BS Ending RE | = 0 (adjust for SBC/other items as needed) |\n\n### Step 6: Final Review\n\nBefore considering the model complete:\n- Toggle through all scenarios (if applicable) to verify checks pass in each case\n- Review all #REF!, #DIV/0!, #VALUE!, and #NAME? errors and resolve or document\n- Confirm all input cells have been populated (search for placeholder values)\n- Verify units are consistent across all tabs\n- Save a clean version before making any additional modifications\n\n## Model Validation and Audit\n\nThis section consolidates all validation checks and audit procedures for completed templates.\n\n### Core Linkages (Must Always Hold)\n\nSee [references/formulas.md](references/formulas.md) for all formula details.\n\n| Check | Formula | Expected Result |\n|-------|---------|-----------------|\n| Balance Sheet Balance | Assets - Liabilities - Equity | = 0 |\n| Cash Tie-Out | CF Ending Cash - BS Cash | = 0 |\n| Cash Monthly vs Annual | Closing Cash (Monthly) - Closing Cash (Annual) | = 0 |\n| Net Income Link | IS Net Income - CF Starting Net Income | = 0 |\n| Retained Earnings | Prior RE + NI + SBC - Dividends - BS Ending RE | = 0 |\n| Equity Financing | \u0394Common Stock/APIC (BS) - Equity Issuance (CFF) | = 0 |\n| Year 0 Equity | Equity Raised (Year 0) - Beginning Equity Capital (Year 1) | = 0 |\n\n### Sign Convention Reference\n\n| Statement | Item | Sign Convention |\n|-----------|------|-----------------|\n| CFO | D&A, SBC | Positive (add-back) |\n| CFO | \u0394AR (increase) | Negative (use of cash) |\n| CFO | \u0394AP (increase) | Positive (source of cash) |\n| CFI | CapEx | Negative |\n| CFF | Debt issuance | Positive |\n| CFF | Debt repayments | Negative |\n| CFF | Dividends | Negative |\n\n### Circular Reference Handling\n\nInterest expense creates circularity: Interest \u2192 Net Income \u2192 Cash \u2192 Debt Balance \u2192 Interest\n\nEnable iterative calculation in Excel: File \u2192 Options \u2192 Formulas \u2192 Enable iterative calculation. Set maximum iterations to 100, maximum change to 0.001. Add a circuit breaker toggle in Assumptions tab.\n\n### Check Categories\n\n**Section 1: Currency Consistency**\n- Currency identified and documented in Assumptions\n- All tabs use consistent currency symbol and scale\n- Units row matches model currency\n\n**Section 2: Balance Sheet Integrity**\n- Assets = Liabilities + Equity (for each period)\n- Formula: Assets - Liabilities - Equity (must = 0)\n\n**Section 3: Cash Flow Integrity**\n- Cash ties to BS (CF Ending Cash = BS Cash)\n- Cash Monthly vs Annual: Closing Cash (Monthly) = Closing Cash (Annual)\n- NI ties to IS (CF Net Income = IS Net Income)\n- D&A ties to schedule\n- SBC ties to IS\n- \u0394AR, \u0394Inventory, \u0394AP tie to WC schedule\n- CapEx ties to DA schedule\n\n**Section 4: Retained Earnings**\n- RE roll-forward check: Prior RE + NI + SBC - Dividends = Ending RE\n- Show component breakdown for debugging\n\n**Section 5: Working Capital**\n- AR, Inventory, AP tie to BS\n- DSO, DIO, DPO reasonability checks (flag if outside normal ranges)\n\n**Section 6: Debt Schedule**\n- Total Debt ties to BS (Current + LT Debt)\n- Interest calculation ties to IS\n\n**Section 6b: Equity Financing**\n- Equity issuance proceeds tie to BS Common Stock/APIC increase\n- Cash increase from equity = Equity account increase (must balance)\n- Equity Raise Tie-Out: \u0394Common Stock/APIC (BS) = Equity Issuance (CFF) (must = 0)\n- Year 0 Equity Tie-Out: Equity Raised (Year 0) = Beginning Equity Capital (Year 1)\n\n**Section 6c: NOL Schedule**\n- Beginning NOL (Year 1 / Formation) = 0 (new business starts with zero NOL)\n- NOL increases only when EBT < 0 (losses must be realized to generate NOL)\n- DTA ties to BS (NOL Schedule DTA = BS Deferred Tax Asset)\n- NOL utilization \u2264 80% of EBT (post-2017 federal limitation)\n- NOL balance is non-negative (cannot utilize more than available)\n- NOL generated only when EBT < 0\n- Tax expense = 0 when taxable income \u2264 0\n\n**Section 7: Scenario Hierarchy**\n- Absolute metrics: Upside > Base > Downside (NI, EBITDA, FCF)\n- Margins: Upside > Base > Downside (GM%, EBITDA%, NI%)\n- Credit metrics: Upside < Base < Downside for leverage (inverted)\n\n**Section 8: Formula Integrity**\n- COGS, S&M, G&A, R&D, SBC driven by % of Revenue (no hardcodes)\n- Consistent formulas across projection years\n- No #REF!, #DIV/0!, #VALUE! errors\n\n**Section 9: Credit Metric Thresholds**\n- Flag metrics as Green/Yellow/Red based on covenant thresholds\n- Summary of any red flags\n\n### Master Check Formula\n\nAggregate all section statuses into a single master check:\n- If all sections pass \u2192 "\u2713 ALL CHECKS PASS"\n- If any section fails \u2192 "\u2717 ERRORS DETECTED - REVIEW BELOW"\n\n### Quick Debug Workflow\n\nWhen Master Status shows errors:\n1. Scroll to find red-highlighted sections\n2. Identify which check category has failures\n3. Navigate to source tab to investigate\n4. Fix the underlying issue\n5. Return to Checks tab to verify resolution',files:{"references/sec-filings.md":`# SEC Filings Data Extraction Reference
7013
+ The final result should look like a high-end mobile app concept with clean hierarchy, good flow logic, strong visual taste, richer image direction, a clean controlled color palette, non-generic art direction, strong multi-screen consistency, readable typography, premium phone mockup framing, and clear platform-aware structure.`,files:{}}]});var bo={};de(bo,{registerFinanceSkills:()=>Tm});function Tm(){for(let n of Cm){let e=Object.keys(n.files).length>0;R({name:n.name,description:n.description,userInvocable:!0,...e?{files:n.files}:{},getPromptForCommand:async()=>[{type:"text",text:n.body}]})}}var Cm;var vo=z(()=>{ue();Cm=[{name:"3-statement-model",description:"Complete, populate and fill out 3-statement financial model templates (Income Statement, Balance Sheet, Cash Flow Statement) . Use when asked to fill out model templates, complete existing model frameworks, populate financial models with data, complete a partially filled IS/BS/CF framework, or link integrated financial statements within an existing template structure. Triggers include requests to fill in, complete, or populate a 3-statement model template",body:'# 3-Statement Financial Model Template Completion\n\nComplete and populate integrated financial model templates with proper linkages between Income Statement, Balance Sheet, and Cash Flow Statement.\n\n## \u26A0\uFE0F CRITICAL PRINCIPLES \u2014 Read Before Populating Any Template\n\n**Environment \u2014 Office JS vs Python:**\n- **If running inside Excel (Office Add-in / Office JS):** Use Office JS directly. Write formulas via `range.formulas = [["=D14*(1+Assumptions!$B$5)"]]` \u2014 never `range.values` for derived cells. No separate recalc; Excel computes natively. Use `context.workbook.worksheets.getItem(...)` to navigate tabs.\n- **If generating a standalone .xlsx file:** Use Python/openpyxl. Write `ws["D15"] = "=D14*(1+Assumptions!$B$5)"`, then run `recalc.py` before delivery.\n- **Office JS merged cell pitfall:** Do NOT call `.merge()` then set `.values` on the merged range \u2014 throws `InvalidArgument` because the range still reports its pre-merge dimensions. Instead write value to top-left cell alone, then merge + format the full range: `ws.getRange("A1").values = [["INCOME STATEMENT"]]; const h = ws.getRange("A1:G1"); h.merge(); h.format.fill.color = "#1F4E79";`\n- All principles below apply identically in either environment.\n\n**Formulas over hardcodes (non-negotiable):**\n- Every projection cell, roll-forward, linkage, and subtotal MUST be an Excel formula \u2014 never a pre-computed value\n- When using Python/openpyxl: write formula strings (`ws["D15"] = "=D14*(1+Assumptions!$B$5)"`), NOT computed results (`ws["D15"] = 12500`)\n- The ONLY cells that should contain hardcoded numbers are: (1) historical actuals, (2) assumption drivers in the Assumptions tab\n- If you find yourself computing a value in Python and writing the result to a cell \u2014 STOP. Write the formula instead.\n- Why: the model must flex when scenarios toggle or assumptions change. Hardcodes break every downstream integrity check silently.\n\n**Verify step-by-step with the user:**\n1. **After mapping the template** \u2192 show the user which tabs/sections you\'ve identified and confirm before touching any cells\n2. **After populating historicals** \u2192 show the user the historical block and confirm values/periods match source data\n3. **After building IS projections** \u2192 run the subtotal checks, show the user the projected IS, confirm before moving to BS\n4. **After building BS** \u2192 show the user the balance check (Assets = L+E) for every period, confirm before moving to CF\n5. **After building CF** \u2192 show the user the cash tie-out (CF ending cash = BS cash), confirm before finalizing\n6. **Do NOT populate the entire model end-to-end and present it complete** \u2014 break at each statement, show the work, catch errors early\n\n## Formatting \u2014 Professional Blue/Grey Palette (Default unless template/user specifies otherwise)\n\n**Keep colors minimal.** Use only blues and greys for cell fills. Do NOT introduce greens, yellows, oranges, or multiple accent colors \u2014 a clean model uses restraint.\n\n| Element | Fill | Font |\n|---|---|---|\n| Section headers (IS / BS / CF titles) | Dark blue `#1F4E79` | White bold |\n| Column headers (FY2024A, FY2025E, etc.) | Light blue `#D9E1F2` | Black bold |\n| Input cells (historicals, assumption drivers) | Light grey `#F2F2F2` or white | Blue `#0000FF` |\n| Formula cells | White | Black |\n| Cross-tab links | White | Green `#008000` |\n| Check rows / key totals | Medium blue `#BDD7EE` | Black bold |\n\n**That\'s 3 blues + 1 grey + white.** If the template has its own color scheme, follow the template instead.\n\nFont color signals *what* a cell is (input/formula/link). Fill color signals *where* you are (header/data/check).\n\n## Model Structure\n\n### Identifying Template Tab Organization\n\nTemplates vary in their tab naming conventions and organization. Before populating, review all tabs to understand the template\'s structure. Below are common tab names and their typical contents:\n\n| Common Tab Names | Contents to Look For |\n|------------------|----------------------|\n| IS, P&L, Income Statement | Income Statement |\n| BS, Balance Sheet | Balance Sheet |\n| CF, CFS, Cash Flow | Cash Flow Statement |\n| WC, Working Capital | Working Capital Schedule |\n| DA, D&A, Depreciation, PP&E | Depreciation & Amortization Schedule |\n| Debt, Debt Schedule | Debt Schedule |\n| NOL, Tax, DTA | Net Operating Loss Schedule |\n| Assumptions, Inputs, Drivers | Driver assumptions and inputs |\n| Checks, Audit, Validation | Error-checking dashboard |\n\n**Template Review Checklist**\n- Identify which tabs exist in the template (not all templates include every schedule)\n- Note any template-specific tabs not listed above\n- Understand tab dependencies (e.g., which schedules feed into the main statements)\n- Locate input cells vs. formula cells on each tab\n\n### Understanding Template Structure\n\nBefore populating a template, familiarize yourself with its existing layout to ensure data is entered in the correct locations and formulas remain intact.\n\n**Identifying Row Structure**\n- Locate the model title at top of each tab\n- Identify section headers and their visual separation\n- Find the units row indicating $ millions, %, x, etc.\n- Note column headers distinguishing Actuals vs. Estimates periods\n- Confirm period labels (e.g., FY2024A, FY2025E)\n- Identify input cells vs. formula cells (typically distinguished by font color)\n\n**Identifying Column Structure**\n- Confirm line item labels in leftmost column\n- Verify historical years precede projection years\n- Note the visual border separating historical from projected periods\n- Check for consistent column order across all tabs\n\n**Working with Named Ranges**\nTemplates often use named ranges for key inputs and outputs. Before entering data:\n- Review existing named ranges in the template (Formulas \u2192 Name Manager in Excel)\n- Common named ranges include: Revenue growth rates, cost percentages, key outputs (Net Income, EBITDA, Total Debt, Cash), scenario selector cell\n- Ensure inputs are entered in cells that feed into these named ranges\n\n### Projection Period\n- Templates typically project 5 years forward from last historical year\n- Verify historical (A) vs. projected (E) columns are clearly separated\n- Confirm columns use fiscal year notation (e.g., FY2024A, FY2025E)\n\n## Margin Analysis\n\n**Note: The following margin analysis should only be performed if prompted by the user or if the template explicitly requires it. If no prompt is given, skip this section.**\n\nCalculate and display profitability margins on the Income Statement (IS) tab to track operational efficiency and enable peer comparison.\n\n### Core Margins to Include\n\n| Margin | Formula | What It Measures |\n|--------|---------|------------------|\n| Gross Margin | Gross Profit / Revenue | Pricing power, production efficiency |\n| EBITDA Margin | EBITDA / Revenue | Core operating profitability |\n| EBIT Margin | EBIT / Revenue | Operating profitability after D&A |\n| Net Income Margin | Net Income / Revenue | Bottom-line profitability |\n\n### Income Statement Layout with Margins\n\nDisplay margin percentages directly below each profit line item:\n- Gross Margin % below Gross Profit\n- EBIT Margin % below EBIT\n- EBITDA Margin % below EBITDA\n- Net Income Margin % below Net Income\n\n## Credit Metrics\n\n**Note: The following Credit analysis should only be performed if prompted by the user or if the template explicitly requires it. If no prompt is given, skip this section.**\n\nCalculate and display credit/leverage metrics on the Balance Sheet (BS) tab to assess financial health, debt capacity, and covenant compliance.\n\n### Core Credit Metrics to Include\n\n| Metric | Formula | What It Measures |\n|--------|---------|------------------|\n| Total Debt / EBITDA | Total Debt / LTM EBITDA | Leverage multiple |\n| Net Debt / EBITDA | (Total Debt - Cash) / LTM EBITDA | Leverage net of cash |\n| Interest Coverage | EBITDA / Interest Expense | Ability to service debt |\n| Debt / Total Cap | Total Debt / (Total Debt + Equity) | Capital structure |\n| Debt / Equity | Total Debt / Total Equity | Financial leverage |\n| Current Ratio | Current Assets / Current Liabilities | Short-term liquidity |\n| Quick Ratio | (Current Assets - Inventory) / Current Liabilities | Immediate liquidity |\n\n### Credit Metric Hierarchy Checks\n\nValidate that Upside shows strongest credit profile:\n- Leverage: Upside < Base < Downside (lower is better)\n- Coverage: Upside > Base > Downside (higher is better)\n- Liquidity: Upside > Base > Downside (higher is better)\n\n### Covenant Compliance Tracking\n\nIf debt covenants are known, add explicit compliance checks comparing actual metrics to covenant thresholds.\n\n## Scenario Analysis (Base / Upside / Downside)\n\nUse a scenario toggle (dropdown) in the Assumptions tab with CHOOSE or INDEX/MATCH formulas.\n\n| Scenario | Description |\n|----------|-------------|\n| Base Case | Management guidance or consensus estimates |\n| Upside Case | Above-guidance growth, margin expansion |\n| Downside Case | Below-trend growth, margin compression |\n\n**Key Drivers to Sensitize**: Revenue growth, Gross margin, SG&A %, DSO/DIO/DPO, CapEx %, Interest rate, Tax rate.\n\n**Scenario Audit Checks**: Toggle switches all statements, BS balances in all scenarios, Cash ties out, Hierarchy holds (Upside > Base > Downside for NI, EBITDA, FCF, margins).\n\n## SEC Filings Data Extraction\n\nIf the template specifically requires pulling data from SEC filings (10-K, 10-Q), see [references/sec-filings.md](references/sec-filings.md) for detailed extraction guidance. This reference is only needed when populating templates with public company data from regulatory filings.\n\n## Completing Model Templates\n\nThis section provides general guidance for completing any 3-statement financial model template while preserving existing formulas and ensuring data integrity.\n\n### Step 1: Analyze the Template Structure\n\nBefore entering any data, thoroughly review the template to understand its architecture:\n\n**Identify Input vs. Formula Cells**\n- Look for visual cues (font color, cell shading) that distinguish input cells from formula cells\n- Common conventions: Blue font = inputs, Black font = formulas, Green font = links to other sheets\n- Use Excel\'s Trace Precedents/Dependents (Formulas \u2192 Trace Precedents) to understand cell relationships\n- Check for named ranges that may control key inputs (Formulas \u2192 Name Manager)\n\n**Map the Template\'s Flow**\n- Identify which tabs feed into others (e.g., Assumptions \u2192 IS \u2192 BS \u2192 CF)\n- Note any supporting schedules and their linkages to main statements\n- Document the template\'s specific line items and structure before populating\n\n### Step 2: Filling in Data Without Breaking Formulas\n\n**Golden Rules for Data Entry**\n\n| Rule | Description |\n|------|-------------|\n| Only edit input cells | Never overwrite cells containing formulas unless intentionally replacing the formula |\n| Preserve cell references | When copying data, use Paste Values (Ctrl+Shift+V) to avoid overwriting formulas with source formatting |\n| Match the template\'s units | Verify if template uses thousands, millions, or actual values before entering data |\n| Respect sign conventions | Follow the template\'s existing sign convention (e.g., expenses as positive or negative) |\n| Check for circular references | If the template uses iterative calculations, ensure Enable Iterative Calculation is turned on |\n\n**Safe Data Entry Process**\n1. Identify the exact cells designated for input (usually highlighted or labeled)\n2. Enter historical data first, then verify formulas are calculating correctly for those periods\n3. Enter assumption drivers that feed forecast calculations\n4. Review calculated outputs to confirm formulas are working as intended\n5. If a formula cell must be modified, document the original formula before making changes\n\n**Handling Pre-Built Formulas**\n- If formulas reference cells you haven\'t populated yet, expect temporary errors (#REF!, #DIV/0!) until all inputs are complete\n- When formulas produce unexpected results, trace precedents to identify missing or incorrect inputs\n- Never delete rows/columns without checking for formula dependencies across all tabs\n\n### Step 3: Validating Formulas\n\n**Formula Integrity Checks**\n\nBefore relying on template outputs, validate that formulas are functioning correctly:\n\n| Check Type | Method |\n|------------|--------|\n| Trace precedents | Select a formula cell \u2192 Formulas \u2192 Trace Precedents to verify it references correct inputs |\n| Trace dependents | Verify key inputs flow to expected output cells |\n| Evaluate formula | Use Formulas \u2192 Evaluate Formula to step through complex calculations |\n| Check for hardcodes | Projection formulas should reference assumptions, not contain hardcoded values |\n| Test with known values | Input simple test values to verify formulas produce expected results |\n| Cross-tab consistency | Ensure the same formula logic applies across all projection periods |\n\n**Common Formula Issues to Watch For**\n- Mixed absolute/relative references causing incorrect results when copied across periods\n- Broken links to external files or deleted ranges (#REF! errors)\n- Division by zero in early periods before revenue ramps (#DIV/0! errors)\n- Circular reference warnings (may be intentional for interest calculations)\n- Inconsistent formulas across projection columns (use Ctrl+\\ to find differences)\n\n**Validating Cross-Tab Linkages**\n- Confirm values that appear on multiple tabs are linked (not duplicated)\n- Verify schedule totals tie to corresponding line items on main statements\n- Check that period labels align across all tabs\n\n### Step 4: Quality Checks by Sheet\n\nPerform these validation checks on each sheet after populating the template:\n\n**Income Statement (IS) Quality Checks**\n- Revenue figures match source data for historical periods\n- All expense line items sum to reported totals\n- Subtotals (Gross Profit, EBIT, EBT, Net Income) calculate correctly\n- Tax calculation logic is appropriate (handles losses correctly)\n- Forecast drivers reference assumptions tab (no hardcodes)\n- Period-over-period changes are directionally reasonable\n\n**Balance Sheet (BS) Quality Checks**\n- Assets = Liabilities + Equity for every period (primary check)\n- Cash balance matches Cash Flow Statement ending cash\n- Working capital accounts tie to supporting schedules (if applicable)\n- Retained Earnings rolls forward correctly: Prior RE + Net Income - Dividends +/- Adjustments = Ending RE\n- Debt balances tie to debt schedule (if applicable)\n- All balance sheet items have appropriate signs (assets positive, most liabilities positive)\n\n**Cash Flow Statement (CF) Quality Checks**\n- Net Income at top of CFO matches Income Statement Net Income\n- Non-cash add-backs (D&A, SBC, etc.) tie to their source schedules/statements\n- Working capital changes have correct signs (increase in asset = use of cash = negative)\n- CapEx ties to PP&E schedule or fixed asset roll-forward\n- Financing activities tie to changes in debt and equity accounts on BS\n- Ending Cash matches Balance Sheet Cash\n- Beginning Cash equals prior period Ending Cash\n\n**Supporting Schedule Quality Checks**\n- Opening balances equal prior period closing balances\n- Roll-forward logic is complete (Beginning + Additions - Deductions = Ending)\n- Schedule totals tie to main statement line items\n- Assumptions used in calculations match Assumptions tab\n\n### Step 5: Cross-Statement Integrity Checks\n\nAfter validating individual sheets, confirm the three statements are properly integrated:\n\n| Check | Formula | Expected Result |\n|-------|---------|-----------------|\n| Balance Sheet Balance | Assets - Liabilities - Equity | = 0 |\n| Cash Tie-Out | CF Ending Cash - BS Cash | = 0 |\n| Net Income Link | IS Net Income - CF Starting Net Income | = 0 |\n| Retained Earnings | Prior RE + NI - Dividends - BS Ending RE | = 0 (adjust for SBC/other items as needed) |\n\n### Step 6: Final Review\n\nBefore considering the model complete:\n- Toggle through all scenarios (if applicable) to verify checks pass in each case\n- Review all #REF!, #DIV/0!, #VALUE!, and #NAME? errors and resolve or document\n- Confirm all input cells have been populated (search for placeholder values)\n- Verify units are consistent across all tabs\n- Save a clean version before making any additional modifications\n\n## Model Validation and Audit\n\nThis section consolidates all validation checks and audit procedures for completed templates.\n\n### Core Linkages (Must Always Hold)\n\nSee [references/formulas.md](references/formulas.md) for all formula details.\n\n| Check | Formula | Expected Result |\n|-------|---------|-----------------|\n| Balance Sheet Balance | Assets - Liabilities - Equity | = 0 |\n| Cash Tie-Out | CF Ending Cash - BS Cash | = 0 |\n| Cash Monthly vs Annual | Closing Cash (Monthly) - Closing Cash (Annual) | = 0 |\n| Net Income Link | IS Net Income - CF Starting Net Income | = 0 |\n| Retained Earnings | Prior RE + NI + SBC - Dividends - BS Ending RE | = 0 |\n| Equity Financing | \u0394Common Stock/APIC (BS) - Equity Issuance (CFF) | = 0 |\n| Year 0 Equity | Equity Raised (Year 0) - Beginning Equity Capital (Year 1) | = 0 |\n\n### Sign Convention Reference\n\n| Statement | Item | Sign Convention |\n|-----------|------|-----------------|\n| CFO | D&A, SBC | Positive (add-back) |\n| CFO | \u0394AR (increase) | Negative (use of cash) |\n| CFO | \u0394AP (increase) | Positive (source of cash) |\n| CFI | CapEx | Negative |\n| CFF | Debt issuance | Positive |\n| CFF | Debt repayments | Negative |\n| CFF | Dividends | Negative |\n\n### Circular Reference Handling\n\nInterest expense creates circularity: Interest \u2192 Net Income \u2192 Cash \u2192 Debt Balance \u2192 Interest\n\nEnable iterative calculation in Excel: File \u2192 Options \u2192 Formulas \u2192 Enable iterative calculation. Set maximum iterations to 100, maximum change to 0.001. Add a circuit breaker toggle in Assumptions tab.\n\n### Check Categories\n\n**Section 1: Currency Consistency**\n- Currency identified and documented in Assumptions\n- All tabs use consistent currency symbol and scale\n- Units row matches model currency\n\n**Section 2: Balance Sheet Integrity**\n- Assets = Liabilities + Equity (for each period)\n- Formula: Assets - Liabilities - Equity (must = 0)\n\n**Section 3: Cash Flow Integrity**\n- Cash ties to BS (CF Ending Cash = BS Cash)\n- Cash Monthly vs Annual: Closing Cash (Monthly) = Closing Cash (Annual)\n- NI ties to IS (CF Net Income = IS Net Income)\n- D&A ties to schedule\n- SBC ties to IS\n- \u0394AR, \u0394Inventory, \u0394AP tie to WC schedule\n- CapEx ties to DA schedule\n\n**Section 4: Retained Earnings**\n- RE roll-forward check: Prior RE + NI + SBC - Dividends = Ending RE\n- Show component breakdown for debugging\n\n**Section 5: Working Capital**\n- AR, Inventory, AP tie to BS\n- DSO, DIO, DPO reasonability checks (flag if outside normal ranges)\n\n**Section 6: Debt Schedule**\n- Total Debt ties to BS (Current + LT Debt)\n- Interest calculation ties to IS\n\n**Section 6b: Equity Financing**\n- Equity issuance proceeds tie to BS Common Stock/APIC increase\n- Cash increase from equity = Equity account increase (must balance)\n- Equity Raise Tie-Out: \u0394Common Stock/APIC (BS) = Equity Issuance (CFF) (must = 0)\n- Year 0 Equity Tie-Out: Equity Raised (Year 0) = Beginning Equity Capital (Year 1)\n\n**Section 6c: NOL Schedule**\n- Beginning NOL (Year 1 / Formation) = 0 (new business starts with zero NOL)\n- NOL increases only when EBT < 0 (losses must be realized to generate NOL)\n- DTA ties to BS (NOL Schedule DTA = BS Deferred Tax Asset)\n- NOL utilization \u2264 80% of EBT (post-2017 federal limitation)\n- NOL balance is non-negative (cannot utilize more than available)\n- NOL generated only when EBT < 0\n- Tax expense = 0 when taxable income \u2264 0\n\n**Section 7: Scenario Hierarchy**\n- Absolute metrics: Upside > Base > Downside (NI, EBITDA, FCF)\n- Margins: Upside > Base > Downside (GM%, EBITDA%, NI%)\n- Credit metrics: Upside < Base < Downside for leverage (inverted)\n\n**Section 8: Formula Integrity**\n- COGS, S&M, G&A, R&D, SBC driven by % of Revenue (no hardcodes)\n- Consistent formulas across projection years\n- No #REF!, #DIV/0!, #VALUE! errors\n\n**Section 9: Credit Metric Thresholds**\n- Flag metrics as Green/Yellow/Red based on covenant thresholds\n- Summary of any red flags\n\n### Master Check Formula\n\nAggregate all section statuses into a single master check:\n- If all sections pass \u2192 "\u2713 ALL CHECKS PASS"\n- If any section fails \u2192 "\u2717 ERRORS DETECTED - REVIEW BELOW"\n\n### Quick Debug Workflow\n\nWhen Master Status shows errors:\n1. Scroll to find red-highlighted sections\n2. Identify which check category has failures\n3. Navigate to source tab to investigate\n4. Fix the underlying issue\n5. Return to Checks tab to verify resolution',files:{"references/sec-filings.md":`# SEC Filings Data Extraction Reference
7014
7014
 
7015
7015
  **When to Use:** Only reference this file when a model template specifically requires pulling data from SEC filings (10-K, 10-Q). For templates that provide data directly or use other data sources, this reference is not needed.
7016
7016
 
@@ -25832,17 +25832,17 @@ For every rule in the grid that applies, output one row: rule id, rule text, out
25832
25832
  }
25833
25833
  \`\`\`
25834
25834
 
25835
- \`clear\` only if rating is low/medium, all required docs received, and no escalation rule fired. Otherwise route \u2014 **this skill never approves**; the escalator and a human reviewer do.`,files:{}}]});var To={};pe(To,{registerClaudeInChromeSkill:()=>Am});function Am(){N({name:"claude-in-chrome",description:"Automates your Chrome browser to interact with web pages - clicking elements, filling forms, capturing screenshots, reading console logs, and navigating sites. Opens pages in new tabs within your existing Chrome session. Requires site-level permissions before executing (configured in the extension).",whenToUse:"When the user wants to interact with web pages, automate browser tasks, capture screenshots, read console logs, or perform any browser-based actions. Always invoke BEFORE attempting to use any mcp__claude-in-chrome__* tools.",allowedTools:Tm,userInvocable:!0,isEnabled:()=>bn(),async getPromptForCommand(n){let e=`${ko}
25836
- ${Xm}`;if(n)e+=`
25835
+ \`clear\` only if rating is low/medium, all required docs received, and no escalation rule fired. Otherwise route \u2014 **this skill never approves**; the escalator and a human reviewer do.`,files:{}}]});var wo={};de(wo,{registerBrowserHarnessSkills:()=>Am});function Am(){for(let n of Xm){let e=Object.keys(n.files).length>0;R({name:n.name,description:n.description,userInvocable:!0,...e?{files:n.files}:{},getPromptForCommand:async()=>[{type:"text",text:n.body}]})}}var Xm;var ko=z(()=>{ue();Xm=[{name:"browser-harness",description:"Always use browser-harness for any web interaction: automation, scraping, testing, or site/app work.",body:"# browser-harness\n\nDirect browser control via CDP. For task-specific edits, use `agent-workspace/agent_helpers.py`. For setup, install, or connection problems, read https://github.com/browser-use/browser-harness/blob/main/install.md.\n\nDomain skills are off by default. Set `BH_DOMAIN_SKILLS=1` to enable them; see the bottom section.\n\n**If `BH_DOMAIN_SKILLS=1` and the task is site-specific, read every file in the matching `$BH_AGENT_WORKSPACE/domain-skills/<site>/` directory before inventing an approach.**\n\n## Usage\n\n```bash\nbrowser-harness <<'PY'\nprint(page_info())\nPY\n```\n\n- Invoke as `browser-harness`. Use heredocs for multi-line commands.\n- Helpers are pre-imported. `run.py` calls `ensure_daemon()` before `exec`.\n- First navigation is `new_tab(url)`, not `goto_url(url)`.\n- The normal local flow attaches to the running Chrome/Chromium CDP endpoint. No browser ids or local profile selection.\n\n## Local Chrome\n\nIf the daemon cannot connect, run diagnostics:\n\n```bash\nbrowser-harness --doctor\n```\n\nIf Chrome remote debugging is not enabled, the harness opens:\n\n```text\nchrome://inspect/#remote-debugging\n```\n\nAsk the user to tick \"Allow remote debugging for this browser instance\" and click Allow if Chrome shows a permission popup. Then retry the same `browser-harness` command.\n\n## Remote Browsers\n\nUse Browser Use cloud for headless servers, parallel sub-agents, or isolated work. Authenticate once:\n\n```bash\nbrowser-harness auth login\n```\n\nOr import a key safely:\n\n```bash\nbrowser-harness auth login --api-key-stdin\n```\n\nPick a short made-up name; `r7k2` below is just a placeholder:\n\n```bash\nbrowser-harness <<'PY'\nstart_remote_daemon(\"r7k2\")\nPY\n\nBU_NAME=r7k2 browser-harness <<'PY'\nnew_tab(\"https://example.com\")\nprint(page_info())\nPY\n```\n\nWhen the task is done and a cloud browser is still running, ask directly: \"Should I close this browser now?\" If yes, run `stop_remote_daemon(name)`. Remote daemons bill until they stop or time out.\n\nDo not start a remote daemon and then keep using the default daemon. Use the same name for `BU_NAME`.\n\nCloud profile cookie sync reference: https://github.com/browser-use/browser-harness/blob/main/interaction-skills/profile-sync.md.\n\n## Page Workflow\n\n- Screenshots first: use `capture_screenshot()` to understand visible state.\n- Clicking: screenshot -> read pixel -> `click_at_xy(x, y)` -> screenshot again.\n- After navigation, call `wait_for_load()`.\n- If the current tab is stale or internal, call `ensure_real_tab()`.\n- Use `js(...)` for DOM inspection or extraction when coordinates are the wrong tool.\n- Login walls: stop and ask. Exception: use available SSO automatically when Chrome is already signed in; still stop for passwords, MFA, consent, or ambiguous account choice.\n- Raw CDP is available with `cdp(\"Domain.method\", ...)`.\n\n## Interaction Skills\n\nIf you get stuck on a browser mechanic, check https://github.com/browser-use/browser-harness/tree/main/interaction-skills.\n\n- connection.md\n- cookies.md\n- cross-origin-iframes.md\n- dialogs.md\n- downloads.md\n- drag-and-drop.md\n- dropdowns.md\n- iframes.md\n- network-requests.md\n- print-as-pdf.md\n- profile-sync.md\n- screenshots.md\n- scrolling.md\n- shadow-dom.md\n- tabs.md\n- uploads.md\n- viewport.md\n\n## Design Constraints\n\n- Coordinate clicks default. CDP mouse events pass through iframes/shadow/cross-origin at the compositor level.\n- Keep the connection model simple: use the default daemon, `BU_NAME`, `BU_CDP_URL`, `BU_CDP_WS`, or `start_remote_daemon(...)`.\n- Core helpers stay short. Put task-specific helper additions in `$BH_AGENT_WORKSPACE/agent_helpers.py`.\n\n## Gotchas\n\n- `chrome://inspect/#remote-debugging` must be enabled for local Chrome control.\n- Chrome may show an \"Allow remote debugging?\" popup; wait for the user to click Allow.\n- Omnibox popups are not real work tabs.\n- CDP target order is not Chrome's visible tab-strip order.\n- `BU_CDP_URL` is an HTTP DevTools endpoint; the daemon resolves it to WebSocket.\n- Ask before leaving cloud browsers running; stop them with `stop_remote_daemon(name)` or `PATCH /browsers/{id} {\"action\":\"stop\"}`.\n\n## Domain Skills\n\nOnly applies when `BH_DOMAIN_SKILLS=1`. Otherwise ignore domain skills.\n\nWhen enabled, search `$BH_AGENT_WORKSPACE/domain-skills/<host>/` before inventing an approach. `goto_url(...)` returns up to 10 skill filenames for the navigated host.",files:{"references/install.md":'# browser-harness CLI \u2014 one-time install prerequisite\n\nThis is a **one-time prerequisite**, not part of the regular AI workflow. Do it once; after `browser-harness` prints page info, never repeat install/connection steps during normal browser work.\n\n## Install the command\n\n```bash\nuv tool install --python 3.12 --upgrade --force browser-harness\ncommand -v browser-harness # should print a path\n```\n\n`--python 3.12` prevents uv from selecting old releases that support older Python versions. `--upgrade --force` replaces any previous `browser-harness` tool install with the latest stable release. It does not uninstall unrelated commands such as `browser-use-Browser` or `browser-use-Terminal`.\n\nFor browser-harness development, clone the repo into a durable path and run `uv tool install -e .` from the checkout.\n\n## Register the skill\n\nInstall/register a skill named `browser-harness` using this command for the body:\n\n```bash\nbrowser-harness skill\n```\n\nFor Codex:\n\n```bash\nmkdir -p "${CODEX_HOME:-$HOME/.codex}/skills/browser-harness"\nbrowser-harness skill > "${CODEX_HOME:-$HOME/.codex}/skills/browser-harness/SKILL.md"\n```\n\nIf an old user-installed `browser` or `browser-use` skill is being picked instead, remove that stale skill directory manually. Never edit bundled/vendor plugin caches.\n\n## Connect to a browser\n\n`browser-harness` attaches to a Chrome you already have running, or to a Browser Use cloud browser. Quick check:\n\n```bash\nbrowser-harness <<\'PY\'\nprint(page_info())\nPY\n```\n\nIf that prints page info, you\'re done. If not, run `browser-harness --doctor` and follow the connection cases. The two connection methods:\n\n- **Way 1 (real browser):** open Chrome normally, then open `chrome://inspect/#remote-debugging` and tick "Allow remote debugging for this browser instance". On Chrome 144+, click Allow on the first-attach popup. Inherits your logins/extensions \u2014 best when the agent acts in your everyday browser.\n- **Way 2 (isolated profile, no popups):** launch Chrome with `--remote-debugging-port=9222 --user-data-dir=<non-default path>`, then set `BU_CDP_URL=http://127.0.0.1:9222`. Best for unattended automation.\n\nIf the quick path fails after `--doctor`, inspect `src/browser_harness/admin.py`, `src/browser_harness/daemon.py`, and `src/browser_harness/_ipc.py`.\n\n## Keeping current\n\n`browser-harness` prints an update banner when a newer PyPI release exists; run `browser-harness --update -y` when you decide to upgrade. `browser-harness --doctor` also checks the latest version. Telemetry is anonymous and opt-out with `browser-harness telemetry disable`.\n\nState lives under `${XDG_CONFIG_HOME:-~/.config}/browser-harness` by default: auth, agent workspace, runtime sockets, logs, screenshots, and temp files. Override with `BH_HOME` or `BROWSER_HARNESS_HOME`.\n'}}]});var Ao={};de(Ao,{registerClaudeInChromeSkill:()=>Im});function Im(){R({name:"claude-in-chrome",description:"Automates your Chrome browser to interact with web pages - clicking elements, filling forms, capturing screenshots, reading console logs, and navigating sites. Opens pages in new tabs within your existing Chrome session. Requires site-level permissions before executing (configured in the extension).",whenToUse:"When the user wants to interact with web pages, automate browser tasks, capture screenshots, read console logs, or perform any browser-based actions. Always invoke BEFORE attempting to use any mcp__claude-in-chrome__* tools.",allowedTools:Em,userInvocable:!0,isEnabled:()=>bn(),async getPromptForCommand(n){let e=`${To}
25836
+ ${xm}`;if(n)e+=`
25837
25837
  ## Task
25838
25838
 
25839
- ${n}`;return[{type:"text",text:e}]}})}var Tm,Xm=`
25839
+ ${n}`;return[{type:"text",text:e}]}})}var Em,xm=`
25840
25840
  Now that this skill is invoked, you have access to Chrome browser automation tools. You can now use the mcp__claude-in-chrome__* tools to interact with web pages.
25841
25841
 
25842
25842
  IMPORTANT: Start by calling mcp__claude-in-chrome__tabs_context_mcp to get information about the user's current browser tabs.
25843
- `;var Xo=U(()=>{Cm();Co();ma();me();Tm=wo.map((n)=>`mcp__claude-in-chrome__${n.name}`)});Wi();$m();jm();Ht();wh();Jr();import{Command as rg,InvalidArgumentError as sg,Option as T}from"@commander-js/extra-typings";import x from"chalk";import{readFileSync as Ja}from"fs";import og from"lodash-es/mapValues.js";import lg from"lodash-es/pickBy.js";import ft from"lodash-es/uniqBy.js";Wi();Ye();ae();Ye();Ye();lr();Du();tr();rr();import Fu from"lodash-es/memoize.js";Ht();pn();var Oi=!1;function Fi(){if(Oi)return;if(Oi=!0,B(process.env.CLAUDE_CODE_USE_BEDROCK)||B(process.env.CLAUDE_CODE_USE_VERTEX)||B(process.env.CLAUDE_CODE_USE_FOUNDRY)||B(process.env.CLAUDE_CODE_USE_AZURE_OPENAI))return;if(process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy||process.env.ANTHROPIC_UNIX_SOCKET||process.env.CLAUDE_CODE_CLIENT_CERT||process.env.CLAUDE_CODE_CLIENT_KEY)return;let n=process.env.ANTHROPIC_BASE_URL||mn().BASE_API_URL;fetch(n,{method:"HEAD",signal:AbortSignal.timeout(1e4)}).catch(()=>{})}ae();$e();Z();function Li(){if(process.env.NODE_EXTRA_CA_CERTS)return;let n=Su();if(n)process.env.NODE_EXTRA_CA_CERTS=n,h(`CA certs: Applied NODE_EXTRA_CA_CERTS from config to process.env: ${n}`)}function Su(){try{let e=L()?.env,i=J("userSettings")?.env;h(`CA certs: Config fallback - globalEnv keys: ${e?Object.keys(e).join(","):"none"}, settingsEnv keys: ${i?Object.keys(i).join(","):"none"}`);let o=i?.NODE_EXTRA_CA_CERTS||e?.NODE_EXTRA_CA_CERTS;if(o)h(`CA certs: Found NODE_EXTRA_CA_CERTS in config/settings: ${o}`);return o}catch(n){h(`CA certs: Config fallback failed: ${n}`,{level:"error"});return}}Gi();ae();$e();xu();$i();Pu();pn();En();Kt();Iu();Ou();Ru();Nu();Mu();Eu();var zt=!1,pr=Fu(async()=>{let n=Date.now();ce("info","init_started"),v("init_function_start");try{let e=Date.now();ji(),ce("info","init_configs_enabled",{duration_ms:Date.now()-e}),v("init_configs_enabled");let a=Date.now();if(ur(),Li(),ce("info","init_safe_env_vars_applied",{duration_ms:Date.now()-a}),v("init_safe_env_vars_applied"),Qi(),v("init_after_graceful_shutdown"),Promise.all([import("./firstPartyEventLogger-4yfx731e.js"),import("./growthbook-ykj8089v.js")]).then(([l,u])=>{l.initialize1PEventLogging(),u.onGrowthBookRefresh(()=>{l.reinitialize1PEventLoggingIfConfigChanged()})}),v("init_after_1p_event_logging"),Ui(),v("init_after_oauth_populate"),Ki(),v("init_after_jetbrains_detection"),Yi(),jt())ar();if(nr())er();v("init_after_remote_settings_check"),Ji();let i=Date.now();h("[init] configureGlobalMTLS starting"),Hi(),ce("info","init_mtls_configured",{duration_ms:Date.now()-i}),h("[init] configureGlobalMTLS complete");let o=Date.now();if(h("[init] configureGlobalAgents starting"),zi(),ce("info","init_proxy_configured",{duration_ms:Date.now()-o}),h("[init] configureGlobalAgents complete"),v("init_network_configured"),Fi(),B(process.env.CLAUDE_CODE_REMOTE))try{let{initUpstreamProxy:l,getUpstreamProxyEnv:u}=await import("./upstreamproxy-hbbvxzb5.js"),{registerUpstreamProxyEnvFn:p}=await import("./subprocessEnv-rass28aq.js");p(u),await l()}catch(l){h(`[init] upstreamproxy init failed: ${l instanceof Error?l.message:String(l)}; continuing without proxy`,{level:"warn"})}if(Vi(),Sn(or),Sn(async()=>{let{cleanupSessionTeams:l}=await import("./teamHelpers-dddedf19.js");await l()}),cr()){let l=Date.now();await dr(),ce("info","init_scratchpad_created",{duration_ms:Date.now()-l})}ce("info","init_completed",{duration_ms:Date.now()-n}),v("init_function_end")}catch(e){if(e instanceof qi){if(Ve()){process.stderr.write(`Configuration error in ${e.filePath}: ${e.message}
25844
- `),He(1);return}return import("./InvalidConfigDialog-h2jkde64.js").then((a)=>a.showInvalidConfigDialog({error:e}))}else throw e}});function Kn(){if(jt()){if(Ve()&&sr())Ut().catch((n)=>{h(`[3P telemetry] Eager telemetry init failed (beta tracing): ${H(n)}`,{level:"error"})});h("[3P telemetry] Waiting for remote managed settings before telemetry init"),ir().then(async()=>{h("[3P telemetry] Remote managed settings loaded, initializing telemetry"),Ne(),await Ut()}).catch((n)=>{h(`[3P telemetry] Telemetry init failed (remote settings path): ${H(n)}`,{level:"error"})})}else Ut().catch((n)=>{h(`[3P telemetry] Telemetry init failed: ${H(n)}`,{level:"error"})})}async function Ut(){if(zt)return;zt=!0;try{await Lu()}catch(n){throw zt=!1,n}}async function Lu(){let{initializeTelemetry:n}=await import("./instrumentation-b8ysw74t.js"),e=await n();if(e)_i(e,(i,o)=>{let l=e?.createCounter(i,o);return{add(u,p={}){let r={...Zi(),...p};l?.add(u,r)}}}),Bi()?.add(1)}Zh();import{jsxDEV as mr}from"react/jsx-dev-runtime";async function xn(n,e,a,i){let{App:o}=await import("./App-skattzvx.js"),{REPL:l}=await import("./REPL-8811fta4.js");await i(n,mr(o,{...e,children:mr(l,{...a},void 0,!1,void 0,this)},void 0,!1,void 0,this))}oa();Jn();Ht();ae();$e();Gu();Qt();hn();jn();_u();Bu();import hr from"axios";import gr from"lodash-es/isEqual.js";import{z as Oe}from"zod";var qu=ze(()=>Oe.object({client_data:Oe.record(Oe.unknown()).nullish(),additional_model_options:Oe.array(Oe.object({model:Oe.string(),name:Oe.string(),description:Oe.string()}).transform(({model:n,name:e,description:a})=>({value:n,label:e,description:a}))).nullish()}));async function Wu(){if(yr())return h("[Bootstrap] Skipped: Nonessential traffic disabled"),null;if(Fe()!=="firstParty")return h("[Bootstrap] Skipped: 3P provider"),null;let n=br();if(!(Jt()?.accessToken&&Zt())&&!n)return h("[Bootstrap] Skipped: no usable OAuth or API key"),null;let a=`${mn().BASE_API_URL}/api/claude_cli/bootstrap`;try{return await wr(async()=>{let i=Jt()?.accessToken,o;if(i&&Zt())o={Authorization:`Bearer ${i}`,"anthropic-beta":fr};else if(n)o={"x-api-key":n};else return h("[Bootstrap] No auth available on retry, aborting"),null;h("[Bootstrap] Fetching");let l=await hr.get(a,{headers:{"Content-Type":"application/json","User-Agent":vr(),...o},timeout:5000}),u=qu().safeParse(l.data);if(!u.success)return h(`[Bootstrap] Response failed validation: ${u.error.message}`),null;return h("[Bootstrap] Fetch ok"),u.data})}catch(i){throw h(`[Bootstrap] Fetch failed: ${hr.isAxiosError(i)?i.response?.status??i.code:"unknown"}`),i}}async function kr(){try{let n=await Wu();if(!n)return;let e=n.client_data??null,a=n.additional_model_options??[],i=L();if(gr(i.clientDataCache,e)&&gr(i.additionalModelOptionsCache,a)){h("[Bootstrap] Cache unchanged, skipping write");return}h("[Bootstrap] Cache updated, persisting to disk"),_((o)=>({...o,clientDataCache:e,additionalModelOptionsCache:a}))}catch(n){V(n)}}Fh();ng();Qm();tr();rr();bh();Yh();Ah();eh();Fm();Jn();ae();ih();ph();Hm();js();Cr();Qr();Th();oh();Pn();oe();$e();pn();Cr();var $u=1000,Zn=new Map;var Vu=[/MaxListenersExceededWarning.*AbortSignal/,/MaxListenersExceededWarning.*EventTarget/];function Yu(n){let e=`${n.name}: ${n.message}`;return Vu.some((a)=>a.test(e))}var Qn=null;function Tr(){let n=process.listeners("warning");if(Qn&&n.includes(Qn))return;if(!1)process.removeAllListeners("warning");Qn=(a)=>{try{let i=`${a.name}: ${a.message.slice(0,50)}`,o=Zn.get(i)||0;if(Zn.has(i)||Zn.size<$u)Zn.set(i,o+1);let l=Yu(a);if(f("tengu_node_warning",{is_internal:l?1:0,occurrence_count:o+1,classname:a.name,...process.env.USER_TYPE==="ant"&&{message:a.message}}),B(process.env.CLAUDE_DEBUG))h(`${l?"[Internal Warning]":"[Warning]"} ${a.toString()}`,{level:"warn"})}catch{}},process.on("warning",Qn)}$h();Zm();oa();oe();ah();Ye();Ro();import{resolve as On}from"path";function Hu(n){if(n.type==="prompt")return n.disableNonInteractive!==!0;if(n.type==="local")return n.supportsNonInteractive;return n.supportsNonInteractive===!0}function Xr(n){return n.filter(Hu)}oe();Kt();Ye();import{appendFileSync as cp}from"fs";Jr();rp();ia();oa();op();oe();Z();Uu();xr();import{c as Ku}from"react/compiler-runtime";Er();import{c as zu}from"react/compiler-runtime";import{jsxDEV as Ar}from"react/jsx-dev-runtime";function tt(){let n=zu(1),e;if(n[0]===Symbol.for("react.memo_cache_sentinel"))e=Ar(nt,{children:["MCP servers may execute code or access system resources. All tool calls require approval. Learn more in the"," ",Ar(Sr,{url:"https://code.claude.com/docs/en/mcp",children:"MCP documentation"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this),n[0]=e;else e=n[0];return e}import{jsxDEV as ea}from"react/jsx-dev-runtime";function Rr(n){let e=Ku(13),{serverName:a,onDone:i}=n,o;if(e[0]!==i||e[1]!==a)o=function(A){f("tengu_mcp_dialog_choice",{choice:A});e:switch(A){case"yes":case"yes_all":{let R=(Le()||{}).enabledMcpjsonServers||[];if(!R.includes(a))M("localSettings",{enabledMcpjsonServers:[...R,a]});if(A==="yes_all")M("localSettings",{enableAllProjectMcpServers:!0});i();break e}case"no":{let R=(Le()||{}).disabledMcpjsonServers||[];if(!R.includes(a))M("localSettings",{disabledMcpjsonServers:[...R,a]});i()}}},e[0]=i,e[1]=a,e[2]=o;else o=e[2];let l=o,u=`New MCP server found in .mcp.json: ${a}`,p;if(e[3]!==l)p=()=>l("no"),e[3]=l,e[4]=p;else p=e[4];let y;if(e[5]===Symbol.for("react.memo_cache_sentinel"))y=ea(tt,{},void 0,!1,void 0,this),e[5]=y;else y=e[5];let r;if(e[6]===Symbol.for("react.memo_cache_sentinel"))r=[{label:"Use this and all future MCP servers in this project",value:"yes_all"},{label:"Use this MCP server",value:"yes"},{label:"Continue without using this MCP server",value:"no"}],e[6]=r;else r=e[6];let t;if(e[7]!==l)t=ea(Ir,{options:r,onChange:(b)=>l(b),onCancel:()=>l("no")},void 0,!1,void 0,this),e[7]=l,e[8]=t;else t=e[8];let c;if(e[9]!==u||e[10]!==p||e[11]!==t)c=ea(at,{title:u,color:"warning",onCancel:p,children:[y,t]},void 0,!0,void 0,this),e[9]=u,e[10]=p,e[11]=t,e[12]=c;else c=e[12];return c}oe();Er();Z();Ju();Qu();Zu();xr();ju();import{c as ep}from"react/compiler-runtime";import np from"lodash-es/partition.js";import{jsxDEV as Se,Fragment as ap}from"react/jsx-dev-runtime";function Or(n){let e=ep(21),{serverNames:a,onDone:i}=n,o;if(e[0]!==i||e[1]!==a)o=function(G){let ye=Le()||{},ie=ye.enabledMcpjsonServers||[],De=ye.disabledMcpjsonServers||[],[Xe,Ie]=np(a,(he)=>G.includes(he));if(f("tengu_mcp_multidialog_choice",{approved:Xe.length,rejected:Ie.length}),Xe.length>0){let he=[...new Set([...ie,...Xe])];M("localSettings",{enabledMcpjsonServers:he})}if(Ie.length>0){let he=[...new Set([...De,...Ie])];M("localSettings",{disabledMcpjsonServers:he})}i()},e[0]=i,e[1]=a,e[2]=o;else o=e[2];let l=o,u;if(e[3]!==i||e[4]!==a)u=()=>{let G=(Le()||{}).disabledMcpjsonServers||[],ye=[...new Set([...G,...a])];M("localSettings",{disabledMcpjsonServers:ye}),i()},e[3]=i,e[4]=a,e[5]=u;else u=e[5];let p=u,y=`${a.length} new MCP servers found in .mcp.json`,r;if(e[6]===Symbol.for("react.memo_cache_sentinel"))r=Se(tt,{},void 0,!1,void 0,this),e[6]=r;else r=e[6];let t;if(e[7]!==a)t=a.map(tp),e[7]=a,e[8]=t;else t=e[8];let c;if(e[9]!==p||e[10]!==l||e[11]!==a||e[12]!==t)c=Se(Nr,{options:t,defaultValue:a,onSubmit:l,onCancel:p,hideIndexes:!0},void 0,!1,void 0,this),e[9]=p,e[10]=l,e[11]=a,e[12]=t,e[13]=c;else c=e[13];let b;if(e[14]!==p||e[15]!==y||e[16]!==c)b=Se(at,{title:y,subtitle:"Select any you wish to enable.",color:"warning",onCancel:p,hideInputGuide:!0,children:[r,c]},void 0,!0,void 0,this),e[14]=p,e[15]=y,e[16]=c,e[17]=b;else b=e[17];let A;if(e[18]===Symbol.for("react.memo_cache_sentinel"))A=Se(Dr,{paddingX:1,children:Se(nt,{dimColor:!0,italic:!0,children:Se(Mr,{children:[Se(na,{shortcut:"Space",action:"select"},void 0,!1,void 0,this),Se(na,{shortcut:"Enter",action:"confirm"},void 0,!1,void 0,this),Se(Pr,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"reject all"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),e[18]=A;else A=e[18];let D;if(e[19]!==b)D=Se(ap,{children:[b,A]},void 0,!0,void 0,this),e[19]=b,e[20]=D;else D=e[20];return D}function tp(n){return{label:n,value:n}}ia();_r();ta();aa();import{jsxDEV as gn}from"react/jsx-dev-runtime";async function Br(n){let{servers:e}=Fr("project"),a=Object.keys(e).filter((i)=>Lr(i)==="pending");if(a.length===0)return;await new Promise((i)=>{let o=()=>void i();if(a.length===1&&a[0]!==void 0){let l=a[0];n.render(gn(In,{children:gn(Ue,{children:gn(Rr,{serverName:l,onDone:o},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this))}else n.render(gn(In,{children:gn(Ue,{children:gn(Or,{serverNames:a,onDone:o},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this))})}_r();ip();sp();ae();ae();$e();pn();class ra{frameDurations=[];firstRenderTime;lastRenderTime;record(n){let e=performance.now();if(this.firstRenderTime===void 0)this.firstRenderTime=e;this.lastRenderTime=e,this.frameDurations.push(n)}getMetrics(){if(this.frameDurations.length===0||this.firstRenderTime===void 0||this.lastRenderTime===void 0)return;let n=this.lastRenderTime-this.firstRenderTime;if(n<=0)return;let a=this.frameDurations.length/(n/1000),i=this.frameDurations.slice().sort((p,y)=>y-p),o=Math.max(0,Math.ceil(i.length*0.01)-1),l=i[o],u=l>0?1000/l:0;return{averageFps:Math.round(a*100)/100,low1PctFps:Math.round(u*100)/100}}}Qr();lp();Z();import{jsxDEV as ke}from"react/jsx-dev-runtime";function dp(){_((n)=>({...n,hasCompletedOnboarding:!0,lastOnboardingVersion:MACRO.VERSION}))}function up(n,e){return new Promise((a)=>{let i=(o)=>void a(o);n.render(e(i))})}async function Ee(n,e,a){return pp(n,e,{color:"error",beforeExit:a})}async function pp(n,e,a){let{Text:i}=await import("./ink-9vrw9yhe.js"),o=a?.color,l=a?.exitCode??1;n.render(o?ke(i,{color:o,children:e},void 0,!1,void 0,this):ke(i,{children:e},void 0,!1,void 0,this)),n.unmount(),await a?.beforeExit?.(),process.exit(l)}function we(n,e,a){return up(n,(i)=>ke(In,{onChangeAppState:a?.onChangeAppState,children:ke(Ue,{children:e(i)},void 0,!1,void 0,this)},void 0,!1,void 0,this))}async function Ke(n,e){n.render(e),la(),await n.waitUntilExit(),await Ce(0)}async function as(n,e,a,i,o,l){if(B(!1)||process.env.IS_DEMO)return!1;let u=L(),p=!1;if(!u.theme||!u.hasCompletedOnboarding){p=!0;let{Onboarding:y}=await import("./Onboarding-np5yfyy1.js");await we(n,(r)=>ke(y,{onDone:()=>{dp(),r()}},void 0,!1,void 0,this),{onChangeAppState:Rn})}if(!B(process.env.CLAUBBIT)){if(!rt()){let{TrustDialog:r}=await import("./TrustDialog-w9tj4t8r.js");await we(n,(t)=>ke(r,{commands:i,onDone:t},void 0,!1,void 0,this))}qr(!0),Yr(),Vr(),fn();let{errors:y}=es();if(y.length===0)await Br(n);if(await jr()){let r=Kr(await Ur(!0)),{ClaudeMdExternalIncludesDialog:t}=await import("./ClaudeMdExternalIncludesDialog-2bn5pwwr.js");await we(n,(c)=>ke(t,{onDone:c,isStandaloneDialog:!0,externalIncludes:r},void 0,!1,void 0,this))}}if(ts(),Ne(),setImmediate(()=>Kn()),await Zr()){let{GroveDialog:y}=await import("./Grove-ygg0z9mr.js");if(await we(n,(t)=>ke(y,{showIfAlreadyViewed:!1,location:p?"onboarding":"policy_update_modal",onDone:t},void 0,!1,void 0,this))==="escape")return f("tengu_grove_policy_exited",{}),He(0),!1}if(process.env.ANTHROPIC_API_KEY&&!Wr()){let y=$r(process.env.ANTHROPIC_API_KEY);if(Hr(y)==="new"){let{ApproveApiKey:t}=await import("./ApproveApiKey-1zk1g80v.js");await we(n,(c)=>ke(t,{customApiKeyTruncated:y,onDone:c},void 0,!1,void 0,this),{onChangeAppState:Rn})}}if((e==="bypassPermissions"||a)&&!it()){let{BypassPermissionsModeDialog:y}=await import("./BypassPermissionsModeDialog-4bd5a65d.js");await we(n,(r)=>ke(y,{onAccept:r},void 0,!1,void 0,this))}if(o&&!L().hasCompletedClaudeInChromeOnboarding){let{ClaudeInChromeOnboarding:y}=await import("./ClaudeInChromeOnboarding-jrj410t2.js");await we(n,(r)=>ke(y,{onDone:r},void 0,!1,void 0,this))}return p}function is(n){let e=0,a=Dn(n);if(a.stdin)f("tengu_stdin_interactive",{});let i=new ra,o=ns();Gr(o);let l=process.env.CLAUDE_CODE_FRAME_TIMING_LOG;return{getFpsMetrics:()=>i.getMetrics(),stats:o,renderOptions:{...a,onFrame:(u)=>{if(i.record(u.durationMs),o.observe("frame_duration_ms",u.durationMs),l&&u.phases){let p=JSON.stringify({total:u.durationMs,...u.phases,rss:process.memoryUsage.rss(),cpu:process.cpuUsage()})+`
25845
- `;cp(l,p)}if(zr())return;for(let p of u.flickers){if(p.reason==="resize")continue;let y=Date.now();if(y-e<1000)f("tengu_flicker",{desiredHeight:p.desiredHeight,actualHeight:p.availableHeight,reason:p.reason});e=y}}}}}ia();import{jsxDEV as yn}from"react/jsx-dev-runtime";async function rs(n,e){let{InvalidSettingsDialog:a}=await import("./InvalidSettingsDialog-3p7ehs0t.js");return we(n,(i)=>yn(a,{settingsErrors:e.settingsErrors,onContinue:i,onExit:e.onExit},void 0,!1,void 0,this))}async function ss(n){let{TeleportResumeWrapper:e}=await import("./TeleportResumeWrapper-66e7dnk5.js");return we(n,(a)=>yn(e,{onComplete:a,onCancel:()=>a(null),source:"cliArg"},void 0,!1,void 0,this))}async function os(n,e){let{TeleportRepoMismatchDialog:a}=await import("./TeleportRepoMismatchDialog-hhcyekar.js");return we(n,(i)=>yn(a,{targetRepo:e.targetRepo,initialPaths:e.initialPaths,onSelectPath:i,onCancel:()=>i(null)},void 0,!1,void 0,this))}async function ls(n,e,a,i){let[o,{ResumeConversation:l},{App:u}]=await Promise.all([a,import("./ResumeConversation-d03pbgnw.js"),import("./App-skattzvx.js")]);await Ke(n,yn(u,{getFpsMetrics:e.getFpsMetrics,stats:e.stats,initialState:e.initialState,children:yn(Ue,{children:yn(l,{...i,worktreePaths:o},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this))}rh();function cs(){}hh();zc();ma();function Ao(){if((hs(),Q(ms)).registerUpdateConfigSkill(),(Ts(),Q(Cs)).registerKeybindingsSkill(),(Fs(),Q(Os)).registerVerifySkill(),($s(),Q(Ws)).registerDebugSkill(),(zs(),Q(Hs)).registerLoremIpsumSkill(),(Zs(),Q(Js)).registerSkillifySkill(),(no(),Q(eo)).registerRememberSkill(),(io(),Q(ao)).registerSimplifySkill(),(mo(),Q(po)).registerBatchSkill(),(go(),Q(ho)).registerStuckSkill(),(yo(),Q(fo)).registerTasteSkills(),(vo(),Q(bo)).registerFinanceSkills(),bn())(Xo(),Q(To)).registerClaudeInChromeSkill()}mh();Sh();Co();ma();Um();Oh();Gs();Sm();pa();pn();eg();pa();Em();import{execa as xm}from"execa";async function Eo(){if(!await So("gh"))return"not_installed";let{exitCode:e}=await xm("gh",["auth","token"],{stdout:"ignore",stderr:"ignore",timeout:5000,reject:!1});return e===0?"authenticated":"not_authenticated"}_m();hn();Ca();Ym();qm();al();Uh();Kh();jh();Gh();dh();lh();Nh();tg();Vm();Z();Mm();Eh();Mh();Ro();oe();Im();async function Do(n,e){let a=await Io(n),i=xo(e);for(let o of a){if(o.type!=="prompt")continue;f("tengu_skill_loaded",{_PROTO_skill_name:o.name,skill_source:o.source,skill_loaded_from:o.loadedFrom,skill_budget:i,...o.kind&&{skill_kind:o.kind}})}}Lh();Xh();import{Option as Dm}from"@commander-js/extra-typings";oe();Rm();ta();aa();ya();pn();Pn();function Fo(n){n.command("add <name> <commandOrUrl> [args...]").description(`Add an MCP server to Claude Code.
25843
+ `;var So=z(()=>{Sm();Xo();ma();ue();Em=Co.map((n)=>`mcp__claude-in-chrome__${n.name}`)});Wi();zm();eh();Ht();Xh();Jr();import{Command as cg,InvalidArgumentError as dg,Option as T}from"@commander-js/extra-typings";import x from"chalk";import{readFileSync as Ja}from"fs";import ug from"lodash-es/mapValues.js";import pg from"lodash-es/pickBy.js";import ft from"lodash-es/uniqBy.js";Wi();Ye();ae();Ye();Ye();lr();Mu();tr();rr();import _u from"lodash-es/memoize.js";Ht();pn();var Oi=!1;function Fi(){if(Oi)return;if(Oi=!0,B(process.env.CLAUDE_CODE_USE_BEDROCK)||B(process.env.CLAUDE_CODE_USE_VERTEX)||B(process.env.CLAUDE_CODE_USE_FOUNDRY)||B(process.env.CLAUDE_CODE_USE_AZURE_OPENAI))return;if(process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy||process.env.ANTHROPIC_UNIX_SOCKET||process.env.CLAUDE_CODE_CLIENT_CERT||process.env.CLAUDE_CODE_CLIENT_KEY)return;let n=process.env.ANTHROPIC_BASE_URL||mn().BASE_API_URL;fetch(n,{method:"HEAD",signal:AbortSignal.timeout(1e4)}).catch(()=>{})}ae();$e();Q();function Li(){if(process.env.NODE_EXTRA_CA_CERTS)return;let n=xu();if(n)process.env.NODE_EXTRA_CA_CERTS=n,h(`CA certs: Applied NODE_EXTRA_CA_CERTS from config to process.env: ${n}`)}function xu(){try{let e=L()?.env,i=Z("userSettings")?.env;h(`CA certs: Config fallback - globalEnv keys: ${e?Object.keys(e).join(","):"none"}, settingsEnv keys: ${i?Object.keys(i).join(","):"none"}`);let o=i?.NODE_EXTRA_CA_CERTS||e?.NODE_EXTRA_CA_CERTS;if(o)h(`CA certs: Found NODE_EXTRA_CA_CERTS in config/settings: ${o}`);return o}catch(n){h(`CA certs: Config fallback failed: ${n}`,{level:"error"});return}}Gi();ae();$e();Ru();$i();Nu();pn();En();Kt();Du();Lu();Pu();Fu();Ou();Iu();var zt=!1,pr=_u(async()=>{let n=Date.now();ce("info","init_started"),v("init_function_start");try{let e=Date.now();ji(),ce("info","init_configs_enabled",{duration_ms:Date.now()-e}),v("init_configs_enabled");let a=Date.now();if(ur(),Li(),ce("info","init_safe_env_vars_applied",{duration_ms:Date.now()-a}),v("init_safe_env_vars_applied"),Qi(),v("init_after_graceful_shutdown"),Promise.all([import("./firstPartyEventLogger-mthxtmgc.js"),import("./growthbook-f7ag30hy.js")]).then(([l,u])=>{l.initialize1PEventLogging(),u.onGrowthBookRefresh(()=>{l.reinitialize1PEventLoggingIfConfigChanged()})}),v("init_after_1p_event_logging"),Ui(),v("init_after_oauth_populate"),Ki(),v("init_after_jetbrains_detection"),Yi(),jt())ar();if(nr())er();v("init_after_remote_settings_check"),Ji();let i=Date.now();h("[init] configureGlobalMTLS starting"),Hi(),ce("info","init_mtls_configured",{duration_ms:Date.now()-i}),h("[init] configureGlobalMTLS complete");let o=Date.now();if(h("[init] configureGlobalAgents starting"),zi(),ce("info","init_proxy_configured",{duration_ms:Date.now()-o}),h("[init] configureGlobalAgents complete"),v("init_network_configured"),Fi(),B(process.env.CLAUDE_CODE_REMOTE))try{let{initUpstreamProxy:l,getUpstreamProxyEnv:u}=await import("./upstreamproxy-x405ef9p.js"),{registerUpstreamProxyEnvFn:p}=await import("./subprocessEnv-s797f06r.js");p(u),await l()}catch(l){h(`[init] upstreamproxy init failed: ${l instanceof Error?l.message:String(l)}; continuing without proxy`,{level:"warn"})}if(Vi(),Sn(or),Sn(async()=>{let{cleanupSessionTeams:l}=await import("./teamHelpers-8ykc4bxa.js");await l()}),cr()){let l=Date.now();await dr(),ce("info","init_scratchpad_created",{duration_ms:Date.now()-l})}ce("info","init_completed",{duration_ms:Date.now()-n}),v("init_function_end")}catch(e){if(e instanceof qi){if(Ve()){process.stderr.write(`Configuration error in ${e.filePath}: ${e.message}
25844
+ `),He(1);return}return import("./InvalidConfigDialog-zmqw3fj1.js").then((a)=>a.showInvalidConfigDialog({error:e}))}else throw e}});function Kn(){if(jt()){if(Ve()&&sr())Ut().catch((n)=>{h(`[3P telemetry] Eager telemetry init failed (beta tracing): ${H(n)}`,{level:"error"})});h("[3P telemetry] Waiting for remote managed settings before telemetry init"),ir().then(async()=>{h("[3P telemetry] Remote managed settings loaded, initializing telemetry"),Ne(),await Ut()}).catch((n)=>{h(`[3P telemetry] Telemetry init failed (remote settings path): ${H(n)}`,{level:"error"})})}else Ut().catch((n)=>{h(`[3P telemetry] Telemetry init failed: ${H(n)}`,{level:"error"})})}async function Ut(){if(zt)return;zt=!0;try{await Bu()}catch(n){throw zt=!1,n}}async function Bu(){let{initializeTelemetry:n}=await import("./instrumentation-223qqr23.js"),e=await n();if(e)_i(e,(i,o)=>{let l=e?.createCounter(i,o);return{add(u,p={}){let r={...Zi(),...p};l?.add(u,r)}}}),Bi()?.add(1)}tg();import{jsxDEV as mr}from"react/jsx-dev-runtime";async function xn(n,e,a,i){let{App:o}=await import("./App-s5ex5j86.js"),{REPL:l}=await import("./REPL-hjjz80kq.js");await i(n,mr(o,{...e,children:mr(l,{...a},void 0,!1,void 0,this)},void 0,!1,void 0,this))}oa();Jn();Ht();ae();$e();Wu();Qt();hn();jn();Gu();qu();import hr from"axios";import gr from"lodash-es/isEqual.js";import{z as Oe}from"zod";var $u=ze(()=>Oe.object({client_data:Oe.record(Oe.unknown()).nullish(),additional_model_options:Oe.array(Oe.object({model:Oe.string(),name:Oe.string(),description:Oe.string()}).transform(({model:n,name:e,description:a})=>({value:n,label:e,description:a}))).nullish()}));async function Vu(){if(yr())return h("[Bootstrap] Skipped: Nonessential traffic disabled"),null;if(Fe()!=="firstParty")return h("[Bootstrap] Skipped: 3P provider"),null;let n=br();if(!(Jt()?.accessToken&&Zt())&&!n)return h("[Bootstrap] Skipped: no usable OAuth or API key"),null;let a=`${mn().BASE_API_URL}/api/claude_cli/bootstrap`;try{return await wr(async()=>{let i=Jt()?.accessToken,o;if(i&&Zt())o={Authorization:`Bearer ${i}`,"anthropic-beta":fr};else if(n)o={"x-api-key":n};else return h("[Bootstrap] No auth available on retry, aborting"),null;h("[Bootstrap] Fetching");let l=await hr.get(a,{headers:{"Content-Type":"application/json","User-Agent":vr(),...o},timeout:5000}),u=$u().safeParse(l.data);if(!u.success)return h(`[Bootstrap] Response failed validation: ${u.error.message}`),null;return h("[Bootstrap] Fetch ok"),u.data})}catch(i){throw h(`[Bootstrap] Fetch failed: ${hr.isAxiosError(i)?i.response?.status??i.code:"unknown"}`),i}}async function kr(){try{let n=await Vu();if(!n)return;let e=n.client_data??null,a=n.additional_model_options??[],i=L();if(gr(i.clientDataCache,e)&&gr(i.additionalModelOptionsCache,a)){h("[Bootstrap] Cache unchanged, skipping write");return}h("[Bootstrap] Cache updated, persisting to disk"),_((o)=>({...o,clientDataCache:e,additionalModelOptionsCache:a}))}catch(n){V(n)}}Gh();rg();ah();tr();rr();Ch();Kh();Ih();ih();Gm();Jn();ae();lh();fh();jm();js();Cr();Qr();Eh();uh();Pn();oe();$e();pn();Cr();var Yu=1000,Zn=new Map;var Hu=[/MaxListenersExceededWarning.*AbortSignal/,/MaxListenersExceededWarning.*EventTarget/];function zu(n){let e=`${n.name}: ${n.message}`;return Hu.some((a)=>a.test(e))}var Qn=null;function Tr(){let n=process.listeners("warning");if(Qn&&n.includes(Qn))return;if(!1)process.removeAllListeners("warning");Qn=(a)=>{try{let i=`${a.name}: ${a.message.slice(0,50)}`,o=Zn.get(i)||0;if(Zn.has(i)||Zn.size<Yu)Zn.set(i,o+1);let l=zu(a);if(f("tengu_node_warning",{is_internal:l?1:0,occurrence_count:o+1,classname:a.name,...process.env.USER_TYPE==="ant"&&{message:a.message}}),B(process.env.CLAUDE_DEBUG))h(`${l?"[Internal Warning]":"[Warning]"} ${a.toString()}`,{level:"warn"})}catch{}},process.on("warning",Qn)}zh();th();oa();oe();oh();Ye();Po();import{resolve as On}from"path";function Uu(n){if(n.type==="prompt")return n.disableNonInteractive!==!0;if(n.type==="local")return n.supportsNonInteractive;return n.supportsNonInteractive===!0}function Xr(n){return n.filter(Uu)}oe();Kt();Ye();import{appendFileSync as up}from"fs";Jr();op();ia();oa();cp();oe();Q();ju();xr();import{c as Ju}from"react/compiler-runtime";Er();import{c as Ku}from"react/compiler-runtime";import{jsxDEV as Ar}from"react/jsx-dev-runtime";function tt(){let n=Ku(1),e;if(n[0]===Symbol.for("react.memo_cache_sentinel"))e=Ar(nt,{children:["MCP servers may execute code or access system resources. All tool calls require approval. Learn more in the"," ",Ar(Sr,{url:"https://code.claude.com/docs/en/mcp",children:"MCP documentation"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this),n[0]=e;else e=n[0];return e}import{jsxDEV as ea}from"react/jsx-dev-runtime";function Rr(n){let e=Ju(13),{serverName:a,onDone:i}=n,o;if(e[0]!==i||e[1]!==a)o=function(A){f("tengu_mcp_dialog_choice",{choice:A});e:switch(A){case"yes":case"yes_all":{let D=(Le()||{}).enabledMcpjsonServers||[];if(!D.includes(a))N("localSettings",{enabledMcpjsonServers:[...D,a]});if(A==="yes_all")N("localSettings",{enableAllProjectMcpServers:!0});i();break e}case"no":{let D=(Le()||{}).disabledMcpjsonServers||[];if(!D.includes(a))N("localSettings",{disabledMcpjsonServers:[...D,a]});i()}}},e[0]=i,e[1]=a,e[2]=o;else o=e[2];let l=o,u=`New MCP server found in .mcp.json: ${a}`,p;if(e[3]!==l)p=()=>l("no"),e[3]=l,e[4]=p;else p=e[4];let y;if(e[5]===Symbol.for("react.memo_cache_sentinel"))y=ea(tt,{},void 0,!1,void 0,this),e[5]=y;else y=e[5];let r;if(e[6]===Symbol.for("react.memo_cache_sentinel"))r=[{label:"Use this and all future MCP servers in this project",value:"yes_all"},{label:"Use this MCP server",value:"yes"},{label:"Continue without using this MCP server",value:"no"}],e[6]=r;else r=e[6];let t;if(e[7]!==l)t=ea(Ir,{options:r,onChange:(b)=>l(b),onCancel:()=>l("no")},void 0,!1,void 0,this),e[7]=l,e[8]=t;else t=e[8];let c;if(e[9]!==u||e[10]!==p||e[11]!==t)c=ea(at,{title:u,color:"warning",onCancel:p,children:[y,t]},void 0,!0,void 0,this),e[9]=u,e[10]=p,e[11]=t,e[12]=c;else c=e[12];return c}oe();Er();Q();Qu();np();ep();xr();Zu();import{c as tp}from"react/compiler-runtime";import ap from"lodash-es/partition.js";import{jsxDEV as Se,Fragment as rp}from"react/jsx-dev-runtime";function Or(n){let e=tp(21),{serverNames:a,onDone:i}=n,o;if(e[0]!==i||e[1]!==a)o=function(G){let ye=Le()||{},ie=ye.enabledMcpjsonServers||[],De=ye.disabledMcpjsonServers||[],[Xe,Ie]=ap(a,(he)=>G.includes(he));if(f("tengu_mcp_multidialog_choice",{approved:Xe.length,rejected:Ie.length}),Xe.length>0){let he=[...new Set([...ie,...Xe])];N("localSettings",{enabledMcpjsonServers:he})}if(Ie.length>0){let he=[...new Set([...De,...Ie])];N("localSettings",{disabledMcpjsonServers:he})}i()},e[0]=i,e[1]=a,e[2]=o;else o=e[2];let l=o,u;if(e[3]!==i||e[4]!==a)u=()=>{let G=(Le()||{}).disabledMcpjsonServers||[],ye=[...new Set([...G,...a])];N("localSettings",{disabledMcpjsonServers:ye}),i()},e[3]=i,e[4]=a,e[5]=u;else u=e[5];let p=u,y=`${a.length} new MCP servers found in .mcp.json`,r;if(e[6]===Symbol.for("react.memo_cache_sentinel"))r=Se(tt,{},void 0,!1,void 0,this),e[6]=r;else r=e[6];let t;if(e[7]!==a)t=a.map(ip),e[7]=a,e[8]=t;else t=e[8];let c;if(e[9]!==p||e[10]!==l||e[11]!==a||e[12]!==t)c=Se(Nr,{options:t,defaultValue:a,onSubmit:l,onCancel:p,hideIndexes:!0},void 0,!1,void 0,this),e[9]=p,e[10]=l,e[11]=a,e[12]=t,e[13]=c;else c=e[13];let b;if(e[14]!==p||e[15]!==y||e[16]!==c)b=Se(at,{title:y,subtitle:"Select any you wish to enable.",color:"warning",onCancel:p,hideInputGuide:!0,children:[r,c]},void 0,!0,void 0,this),e[14]=p,e[15]=y,e[16]=c,e[17]=b;else b=e[17];let A;if(e[18]===Symbol.for("react.memo_cache_sentinel"))A=Se(Dr,{paddingX:1,children:Se(nt,{dimColor:!0,italic:!0,children:Se(Mr,{children:[Se(na,{shortcut:"Space",action:"select"},void 0,!1,void 0,this),Se(na,{shortcut:"Enter",action:"confirm"},void 0,!1,void 0,this),Se(Pr,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"reject all"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),e[18]=A;else A=e[18];let P;if(e[19]!==b)P=Se(rp,{children:[b,A]},void 0,!0,void 0,this),e[19]=b,e[20]=P;else P=e[20];return P}function ip(n){return{label:n,value:n}}ia();_r();ta();aa();import{jsxDEV as gn}from"react/jsx-dev-runtime";async function Br(n){let{servers:e}=Fr("project"),a=Object.keys(e).filter((i)=>Lr(i)==="pending");if(a.length===0)return;await new Promise((i)=>{let o=()=>void i();if(a.length===1&&a[0]!==void 0){let l=a[0];n.render(gn(In,{children:gn(Ue,{children:gn(Rr,{serverName:l,onDone:o},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this))}else n.render(gn(In,{children:gn(Ue,{children:gn(Or,{serverNames:a,onDone:o},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this))})}_r();sp();lp();ae();ae();$e();pn();class ra{frameDurations=[];firstRenderTime;lastRenderTime;record(n){let e=performance.now();if(this.firstRenderTime===void 0)this.firstRenderTime=e;this.lastRenderTime=e,this.frameDurations.push(n)}getMetrics(){if(this.frameDurations.length===0||this.firstRenderTime===void 0||this.lastRenderTime===void 0)return;let n=this.lastRenderTime-this.firstRenderTime;if(n<=0)return;let a=this.frameDurations.length/(n/1000),i=this.frameDurations.slice().sort((p,y)=>y-p),o=Math.max(0,Math.ceil(i.length*0.01)-1),l=i[o],u=l>0?1000/l:0;return{averageFps:Math.round(a*100)/100,low1PctFps:Math.round(u*100)/100}}}Qr();dp();Q();import{jsxDEV as ke}from"react/jsx-dev-runtime";function pp(){_((n)=>({...n,hasCompletedOnboarding:!0,lastOnboardingVersion:MACRO.VERSION}))}function mp(n,e){return new Promise((a)=>{let i=(o)=>void a(o);n.render(e(i))})}async function Ee(n,e,a){return hp(n,e,{color:"error",beforeExit:a})}async function hp(n,e,a){let{Text:i}=await import("./ink-vkxsn90v.js"),o=a?.color,l=a?.exitCode??1;n.render(o?ke(i,{color:o,children:e},void 0,!1,void 0,this):ke(i,{children:e},void 0,!1,void 0,this)),n.unmount(),await a?.beforeExit?.(),process.exit(l)}function we(n,e,a){return mp(n,(i)=>ke(In,{onChangeAppState:a?.onChangeAppState,children:ke(Ue,{children:e(i)},void 0,!1,void 0,this)},void 0,!1,void 0,this))}async function Ke(n,e){n.render(e),la(),await n.waitUntilExit(),await Ce(0)}async function as(n,e,a,i,o,l){if(B(!1)||process.env.IS_DEMO)return!1;let u=L(),p=!1;if(!u.theme||!u.hasCompletedOnboarding){p=!0;let{Onboarding:y}=await import("./Onboarding-p0tq6pgz.js");await we(n,(r)=>ke(y,{onDone:()=>{pp(),r()}},void 0,!1,void 0,this),{onChangeAppState:Rn})}if(!B(process.env.CLAUBBIT)){if(!rt()){let{TrustDialog:r}=await import("./TrustDialog-7fvaze2x.js");await we(n,(t)=>ke(r,{commands:i,onDone:t},void 0,!1,void 0,this))}qr(!0),Yr(),Vr(),fn();let{errors:y}=es();if(y.length===0)await Br(n);if(await jr()){let r=Kr(await Ur(!0)),{ClaudeMdExternalIncludesDialog:t}=await import("./ClaudeMdExternalIncludesDialog-gqmed78y.js");await we(n,(c)=>ke(t,{onDone:c,isStandaloneDialog:!0,externalIncludes:r},void 0,!1,void 0,this))}}if(ts(),Ne(),setImmediate(()=>Kn()),await Zr()){let{GroveDialog:y}=await import("./Grove-tkkskg8n.js");if(await we(n,(t)=>ke(y,{showIfAlreadyViewed:!1,location:p?"onboarding":"policy_update_modal",onDone:t},void 0,!1,void 0,this))==="escape")return f("tengu_grove_policy_exited",{}),He(0),!1}if(process.env.ANTHROPIC_API_KEY&&!Wr()){let y=$r(process.env.ANTHROPIC_API_KEY);if(Hr(y)==="new"){let{ApproveApiKey:t}=await import("./ApproveApiKey-b4z6h2gn.js");await we(n,(c)=>ke(t,{customApiKeyTruncated:y,onDone:c},void 0,!1,void 0,this),{onChangeAppState:Rn})}}if((e==="bypassPermissions"||a)&&!it()){let{BypassPermissionsModeDialog:y}=await import("./BypassPermissionsModeDialog-jbg97eja.js");await we(n,(r)=>ke(y,{onAccept:r},void 0,!1,void 0,this))}if(o&&!L().hasCompletedClaudeInChromeOnboarding){let{ClaudeInChromeOnboarding:y}=await import("./ClaudeInChromeOnboarding-qa0pvwfw.js");await we(n,(r)=>ke(y,{onDone:r},void 0,!1,void 0,this))}return p}function is(n){let e=0,a=Dn(n);if(a.stdin)f("tengu_stdin_interactive",{});let i=new ra,o=ns();Gr(o);let l=process.env.CLAUDE_CODE_FRAME_TIMING_LOG;return{getFpsMetrics:()=>i.getMetrics(),stats:o,renderOptions:{...a,onFrame:(u)=>{if(i.record(u.durationMs),o.observe("frame_duration_ms",u.durationMs),l&&u.phases){let p=JSON.stringify({total:u.durationMs,...u.phases,rss:process.memoryUsage.rss(),cpu:process.cpuUsage()})+`
25845
+ `;up(l,p)}if(zr())return;for(let p of u.flickers){if(p.reason==="resize")continue;let y=Date.now();if(y-e<1000)f("tengu_flicker",{desiredHeight:p.desiredHeight,actualHeight:p.availableHeight,reason:p.reason});e=y}}}}}ia();import{jsxDEV as yn}from"react/jsx-dev-runtime";async function rs(n,e){let{InvalidSettingsDialog:a}=await import("./InvalidSettingsDialog-tnd5hymg.js");return we(n,(i)=>yn(a,{settingsErrors:e.settingsErrors,onContinue:i,onExit:e.onExit},void 0,!1,void 0,this))}async function ss(n){let{TeleportResumeWrapper:e}=await import("./TeleportResumeWrapper-esjykret.js");return we(n,(a)=>yn(e,{onComplete:a,onCancel:()=>a(null),source:"cliArg"},void 0,!1,void 0,this))}async function os(n,e){let{TeleportRepoMismatchDialog:a}=await import("./TeleportRepoMismatchDialog-ff0h2cnq.js");return we(n,(i)=>yn(a,{targetRepo:e.targetRepo,initialPaths:e.initialPaths,onSelectPath:i,onCancel:()=>i(null)},void 0,!1,void 0,this))}async function ls(n,e,a,i){let[o,{ResumeConversation:l},{App:u}]=await Promise.all([a,import("./ResumeConversation-krn9hqb1.js"),import("./App-s5ex5j86.js")]);await Ke(n,yn(u,{getFpsMetrics:e.getFpsMetrics,stats:e.stats,initialState:e.initialState,children:yn(Ue,{children:yn(l,{...i,worktreePaths:o},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this))}ch();function cs(){}bh();Kc();ma();function Eo(){if((hs(),K(ms)).registerUpdateConfigSkill(),(Ts(),K(Cs)).registerKeybindingsSkill(),(Fs(),K(Os)).registerVerifySkill(),($s(),K(Ws)).registerDebugSkill(),(zs(),K(Hs)).registerLoremIpsumSkill(),(Zs(),K(Js)).registerSkillifySkill(),(no(),K(eo)).registerRememberSkill(),(io(),K(ao)).registerSimplifySkill(),(mo(),K(po)).registerBatchSkill(),(go(),K(ho)).registerStuckSkill(),(yo(),K(fo)).registerTasteSkills(),(vo(),K(bo)).registerFinanceSkills(),(ko(),K(wo)).registerBrowserHarnessSkills(),bn())(So(),K(Ao)).registerClaudeInChromeSkill()}yh();Rh();Xo();ma();Zm();Bh();Gs();Rm();pa();pn();ig();pa();Dm();import{execa as Pm}from"execa";async function Io(){if(!await xo("gh"))return"not_installed";let{exitCode:e}=await Pm("gh",["auth","token"],{stdout:"ignore",stderr:"ignore",timeout:5000,reject:!1});return e===0?"authenticated":"not_authenticated"}Wm();hn();Ca();Km();Ym();rl();Zh();Qh();eg();Vh();hh();ph();_h();sg();Um();Q();Lm();Dh();Lh();Po();oe();Mm();async function Mo(n,e){let a=await Do(n),i=Ro(e);for(let o of a){if(o.type!=="prompt")continue;f("tengu_skill_loaded",{_PROTO_skill_name:o.name,skill_source:o.source,skill_loaded_from:o.loadedFrom,skill_budget:i,...o.kind&&{skill_kind:o.kind}})}}qh();xh();import{Option as Om}from"@commander-js/extra-typings";oe();Nm();ta();aa();ya();pn();Pn();function _o(n){n.command("add <name> <commandOrUrl> [args...]").description(`Add an MCP server to Claude Code.
25846
25846
 
25847
25847
  Examples:
25848
25848
  # Add HTTP server:
@@ -25855,76 +25855,76 @@ Examples:
25855
25855
  claude mcp add -e API_KEY=xxx my-server -- npx my-mcp-server
25856
25856
 
25857
25857
  # Add stdio server with subprocess flags:
25858
- claude mcp add my-server -- my-command --some-flag arg1`).option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").option("-t, --transport <transport>","Transport type (stdio, sse, http). Defaults to stdio if not specified.").option("-e, --env <env...>","Set environment variables (e.g. -e KEY=value)").option("-H, --header <header...>",'Set WebSocket headers (e.g. -H "X-Api-Key: abc123" -H "X-Custom: value")').option("--client-id <clientId>","OAuth client ID for HTTP/SSE servers").option("--client-secret","Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)").option("--callback-port <port>","Fixed port for OAuth callback (for servers requiring pre-registered redirect URIs)").helpOption("-h, --help","Display help for command").addOption(new Dm("--xaa","Enable XAA (SEP-990) for this server. Requires 'claude mcp xaa setup' first. Also requires --client-id and --client-secret (for the MCP server's AS).").hideHelp(!Mn())).action(async(e,a,i,o)=>{let l=a,u=i;if(!e)K(`Error: Server name is required.
25859
- Usage: claude mcp add <name> <command> [args...]`);else if(!l)K(`Error: Command is required when server name is provided.
25860
- Usage: claude mcp add <name> <command> [args...]`);try{let p=No(o.scope),y=Oo(o.transport);if(o.xaa&&!Mn())K("Error: --xaa requires CLAUDE_CODE_ENABLE_XAA=1 in your environment");let r=Boolean(o.xaa);if(r){let b=[];if(!o.clientId)b.push("--client-id");if(!o.clientSecret)b.push("--client-secret");if(!je())b.push("'claude mcp xaa setup' (settings.xaaIdp not configured)");if(b.length)K(`Error: --xaa requires: ${b.join(", ")}`)}let t=o.transport!==void 0,c=l.startsWith("http://")||l.startsWith("https://")||l.startsWith("localhost")||l.endsWith("/sse")||l.endsWith("/mcp");if(f("tengu_mcp_add",{type:y,scope:p,source:"command",transport:y,transportExplicit:t,looksLikeUrl:c}),y==="sse"){if(!l)K("Error: URL is required for SSE transport.");let b=o.header?ha(o.header):void 0,A=o.callbackPort?parseInt(o.callbackPort,10):void 0,D=o.clientId||A||r?{...o.clientId?{clientId:o.clientId}:{},...A?{callbackPort:A}:{},...r?{xaa:!0}:{}}:void 0,R=o.clientSecret&&o.clientId?await ga():void 0,G={type:"sse",url:l,headers:b,oauth:D};if(await ut(e,G,p),R)fa(e,G,R);if(process.stdout.write(`Added SSE MCP server ${e} with URL: ${l} to ${p} config
25858
+ claude mcp add my-server -- my-command --some-flag arg1`).option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").option("-t, --transport <transport>","Transport type (stdio, sse, http). Defaults to stdio if not specified.").option("-e, --env <env...>","Set environment variables (e.g. -e KEY=value)").option("-H, --header <header...>",'Set WebSocket headers (e.g. -H "X-Api-Key: abc123" -H "X-Custom: value")').option("--client-id <clientId>","OAuth client ID for HTTP/SSE servers").option("--client-secret","Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)").option("--callback-port <port>","Fixed port for OAuth callback (for servers requiring pre-registered redirect URIs)").helpOption("-h, --help","Display help for command").addOption(new Om("--xaa","Enable XAA (SEP-990) for this server. Requires 'claude mcp xaa setup' first. Also requires --client-id and --client-secret (for the MCP server's AS).").hideHelp(!Mn())).action(async(e,a,i,o)=>{let l=a,u=i;if(!e)j(`Error: Server name is required.
25859
+ Usage: claude mcp add <name> <command> [args...]`);else if(!l)j(`Error: Command is required when server name is provided.
25860
+ Usage: claude mcp add <name> <command> [args...]`);try{let p=Fo(o.scope),y=Lo(o.transport);if(o.xaa&&!Mn())j("Error: --xaa requires CLAUDE_CODE_ENABLE_XAA=1 in your environment");let r=Boolean(o.xaa);if(r){let b=[];if(!o.clientId)b.push("--client-id");if(!o.clientSecret)b.push("--client-secret");if(!je())b.push("'claude mcp xaa setup' (settings.xaaIdp not configured)");if(b.length)j(`Error: --xaa requires: ${b.join(", ")}`)}let t=o.transport!==void 0,c=l.startsWith("http://")||l.startsWith("https://")||l.startsWith("localhost")||l.endsWith("/sse")||l.endsWith("/mcp");if(f("tengu_mcp_add",{type:y,scope:p,source:"command",transport:y,transportExplicit:t,looksLikeUrl:c}),y==="sse"){if(!l)j("Error: URL is required for SSE transport.");let b=o.header?ha(o.header):void 0,A=o.callbackPort?parseInt(o.callbackPort,10):void 0,P=o.clientId||A||r?{...o.clientId?{clientId:o.clientId}:{},...A?{callbackPort:A}:{},...r?{xaa:!0}:{}}:void 0,D=o.clientSecret&&o.clientId?await ga():void 0,G={type:"sse",url:l,headers:b,oauth:P};if(await ut(e,G,p),D)fa(e,G,D);if(process.stdout.write(`Added SSE MCP server ${e} with URL: ${l} to ${p} config
25861
25861
  `),b)process.stdout.write(`Headers: ${Te(b,null,2)}
25862
- `)}else if(y==="http"){if(!l)K("Error: URL is required for HTTP transport.");let b=o.header?ha(o.header):void 0,A=o.callbackPort?parseInt(o.callbackPort,10):void 0,D=o.clientId||A||r?{...o.clientId?{clientId:o.clientId}:{},...A?{callbackPort:A}:{},...r?{xaa:!0}:{}}:void 0,R=o.clientSecret&&o.clientId?await ga():void 0,G={type:"http",url:l,headers:b,oauth:D};if(await ut(e,G,p),R)fa(e,G,R);if(process.stdout.write(`Added HTTP MCP server ${e} with URL: ${l} to ${p} config
25862
+ `)}else if(y==="http"){if(!l)j("Error: URL is required for HTTP transport.");let b=o.header?ha(o.header):void 0,A=o.callbackPort?parseInt(o.callbackPort,10):void 0,P=o.clientId||A||r?{...o.clientId?{clientId:o.clientId}:{},...A?{callbackPort:A}:{},...r?{xaa:!0}:{}}:void 0,D=o.clientSecret&&o.clientId?await ga():void 0,G={type:"http",url:l,headers:b,oauth:P};if(await ut(e,G,p),D)fa(e,G,D);if(process.stdout.write(`Added HTTP MCP server ${e} with URL: ${l} to ${p} config
25863
25863
  `),b)process.stdout.write(`Headers: ${Te(b,null,2)}
25864
25864
  `)}else{if(o.clientId||o.clientSecret||o.callbackPort||o.xaa)process.stderr.write(`Warning: --client-id, --client-secret, --callback-port, and --xaa are only supported for HTTP/SSE transports and will be ignored for stdio.
25865
25865
  `);if(!t&&c)process.stderr.write(`
25866
25866
  Warning: The command "${l}" looks like a URL, but is being interpreted as a stdio server as --transport was not specified.
25867
25867
  `),process.stderr.write(`If this is an HTTP server, use: claude mcp add --transport http ${e} ${l}
25868
25868
  `),process.stderr.write(`If this is an SSE server, use: claude mcp add --transport sse ${e} ${l}
25869
- `);let b=Po(o.env);await ut(e,{type:"stdio",command:l,args:u,env:b},p),process.stdout.write(`Added stdio MCP server ${e} with command: ${l} ${u.join(" ")} to ${p} config
25870
- `)}xe(`File modified: ${Mo(p)}`)}catch(p){K(p.message)}})}ya();En();Z();function Go(n){let e=n.command("xaa").description("Manage the XAA (SEP-990) IdP connection");e.command("setup").description("Configure the IdP connection (one-time setup for all XAA-enabled servers)").requiredOption("--issuer <url>","IdP issuer URL (OIDC discovery)").requiredOption("--client-id <id>","Claude Code's client_id at the IdP").option("--client-secret","Read IdP client secret from MCP_XAA_IDP_CLIENT_SECRET env var").option("--callback-port <port>","Fixed loopback callback port (only if IdP does not honor RFC 8252 port-any matching)").action((a)=>{let i;try{i=new URL(a.issuer)}catch{return K(`Error: --issuer must be a valid URL (got "${a.issuer}")`)}if(i.protocol!=="https:"&&!(i.protocol==="http:"&&(i.hostname==="localhost"||i.hostname==="127.0.0.1"||i.hostname==="[::1]")))return K(`Error: --issuer must use https:// (got "${i.protocol}//${i.host}")`);let o=a.callbackPort?parseInt(a.callbackPort,10):void 0;if(o!==void 0&&(!Number.isInteger(o)||o<=0))return K("Error: --callback-port must be a positive integer");let l=a.clientSecret?process.env.MCP_XAA_IDP_CLIENT_SECRET:void 0;if(a.clientSecret&&!l)return K("Error: --client-secret requires MCP_XAA_IDP_CLIENT_SECRET env var");let u=je(),p=u?.issuer,y=u?.clientId,{error:r}=M("userSettings",{xaaIdp:{issuer:a.issuer,clientId:a.clientId,callbackPort:o}});if(r)return K(`Error writing settings: ${r.message}`);if(p){if(ba(p)!==ba(a.issuer))Nn(p),pt(p);else if(y!==a.clientId)Nn(p),pt(p)}if(l){let{success:t,warning:c}=_o(a.issuer,l);if(!t)return K(`Error: settings written but keychain save failed${c?` \u2014 ${c}`:""}. Re-run with --client-secret once keychain is available.`)}xe(`XAA IdP connection configured for ${a.issuer}`)}),e.command("login").description("Cache an IdP id_token so XAA-enabled MCP servers authenticate silently. Default: run the OIDC browser login. With --id-token: write a pre-obtained JWT directly (used by conformance/e2e tests where the mock IdP does not serve /authorize).").option("--force","Ignore any cached id_token and re-login (useful after IdP-side revocation)").option("--id-token <jwt>","Write this pre-obtained id_token directly to cache, skipping the OIDC browser login").action(async(a)=>{let i=je();if(!i)return K("Error: no XAA IdP connection. Run 'claude mcp xaa setup' first.");if(a.idToken){let l=Lo(i.issuer,a.idToken);return xe(`id_token cached for ${i.issuer} (expires ${new Date(l).toISOString()})`)}if(a.force)Nn(i.issuer);if(va(i.issuer)!==void 0)return xe(`Already logged in to ${i.issuer} (cached id_token still valid). Use --force to re-login.`);process.stdout.write(`Opening browser for IdP login at ${i.issuer}\u2026
25871
- `);try{await Bo({idpIssuer:i.issuer,idpClientId:i.clientId,idpClientSecret:wa(i.issuer),callbackPort:i.callbackPort,onAuthorizationUrl:(l)=>{process.stdout.write(`If the browser did not open, visit:
25869
+ `);let b=No(o.env);await ut(e,{type:"stdio",command:l,args:u,env:b},p),process.stdout.write(`Added stdio MCP server ${e} with command: ${l} ${u.join(" ")} to ${p} config
25870
+ `)}xe(`File modified: ${Oo(p)}`)}catch(p){j(p.message)}})}ya();En();Q();function Wo(n){let e=n.command("xaa").description("Manage the XAA (SEP-990) IdP connection");e.command("setup").description("Configure the IdP connection (one-time setup for all XAA-enabled servers)").requiredOption("--issuer <url>","IdP issuer URL (OIDC discovery)").requiredOption("--client-id <id>","Claude Code's client_id at the IdP").option("--client-secret","Read IdP client secret from MCP_XAA_IDP_CLIENT_SECRET env var").option("--callback-port <port>","Fixed loopback callback port (only if IdP does not honor RFC 8252 port-any matching)").action((a)=>{let i;try{i=new URL(a.issuer)}catch{return j(`Error: --issuer must be a valid URL (got "${a.issuer}")`)}if(i.protocol!=="https:"&&!(i.protocol==="http:"&&(i.hostname==="localhost"||i.hostname==="127.0.0.1"||i.hostname==="[::1]")))return j(`Error: --issuer must use https:// (got "${i.protocol}//${i.host}")`);let o=a.callbackPort?parseInt(a.callbackPort,10):void 0;if(o!==void 0&&(!Number.isInteger(o)||o<=0))return j("Error: --callback-port must be a positive integer");let l=a.clientSecret?process.env.MCP_XAA_IDP_CLIENT_SECRET:void 0;if(a.clientSecret&&!l)return j("Error: --client-secret requires MCP_XAA_IDP_CLIENT_SECRET env var");let u=je(),p=u?.issuer,y=u?.clientId,{error:r}=N("userSettings",{xaaIdp:{issuer:a.issuer,clientId:a.clientId,callbackPort:o}});if(r)return j(`Error writing settings: ${r.message}`);if(p){if(ba(p)!==ba(a.issuer))Nn(p),pt(p);else if(y!==a.clientId)Nn(p),pt(p)}if(l){let{success:t,warning:c}=Go(a.issuer,l);if(!t)return j(`Error: settings written but keychain save failed${c?` \u2014 ${c}`:""}. Re-run with --client-secret once keychain is available.`)}xe(`XAA IdP connection configured for ${a.issuer}`)}),e.command("login").description("Cache an IdP id_token so XAA-enabled MCP servers authenticate silently. Default: run the OIDC browser login. With --id-token: write a pre-obtained JWT directly (used by conformance/e2e tests where the mock IdP does not serve /authorize).").option("--force","Ignore any cached id_token and re-login (useful after IdP-side revocation)").option("--id-token <jwt>","Write this pre-obtained id_token directly to cache, skipping the OIDC browser login").action(async(a)=>{let i=je();if(!i)return j("Error: no XAA IdP connection. Run 'claude mcp xaa setup' first.");if(a.idToken){let l=Bo(i.issuer,a.idToken);return xe(`id_token cached for ${i.issuer} (expires ${new Date(l).toISOString()})`)}if(a.force)Nn(i.issuer);if(va(i.issuer)!==void 0)return xe(`Already logged in to ${i.issuer} (cached id_token still valid). Use --force to re-login.`);process.stdout.write(`Opening browser for IdP login at ${i.issuer}\u2026
25871
+ `);try{await qo({idpIssuer:i.issuer,idpClientId:i.clientId,idpClientSecret:wa(i.issuer),callbackPort:i.callbackPort,onAuthorizationUrl:(l)=>{process.stdout.write(`If the browser did not open, visit:
25872
25872
  ${l}
25873
- `)}}),xe("Logged in. MCP servers with --xaa will now authenticate silently.")}catch(l){K(`IdP login failed: ${H(l)}`)}}),e.command("show").description("Show the current IdP connection config").action(()=>{let a=je();if(!a)return xe("No XAA IdP connection configured.");let i=wa(a.issuer)!==void 0,o=va(a.issuer)!==void 0;if(process.stdout.write(`Issuer: ${a.issuer}
25873
+ `)}}),xe("Logged in. MCP servers with --xaa will now authenticate silently.")}catch(l){j(`IdP login failed: ${H(l)}`)}}),e.command("show").description("Show the current IdP connection config").action(()=>{let a=je();if(!a)return xe("No XAA IdP connection configured.");let i=wa(a.issuer)!==void 0,o=va(a.issuer)!==void 0;if(process.stdout.write(`Issuer: ${a.issuer}
25874
25874
  `),process.stdout.write(`Client ID: ${a.clientId}
25875
25875
  `),a.callbackPort!==void 0)process.stdout.write(`Callback port: ${a.callbackPort}
25876
25876
  `);process.stdout.write(`Client secret: ${i?"(stored in keychain)":"(not set \u2014 PKCE-only)"}
25877
25877
  `),process.stdout.write(`Logged in: ${o?"yes (id_token cached)":"no \u2014 run 'claude mcp xaa login'"}
25878
- `),xe()}),e.command("clear").description("Clear the IdP connection config and cached id_token").action(()=>{let a=je(),{error:i}=M("userSettings",{xaaIdp:void 0});if(i)return K(`Error writing settings: ${i.message}`);if(a)Nn(a.issuer),pt(a.issuer);xe("XAA IdP connection cleared")})}Hh();Ch();zc();ta();aa();ya();ig();kh();Gi();function ka(n,e=process.argv){for(let a=0;a<e.length;a++){let i=e[a];if(i?.startsWith(`${n}=`))return i.slice(n.length+1);if(i===n&&a+1<e.length)return e[a+1]}return}fh();Vh();Lm();$e();En();Nm();Kt();zh();zm();Om();Bh();Bm();Wm();Ye();oe();ae();hn();Z();function qo(){let n=L();if(n.autoUpdates!==!1||n.autoUpdatesProtectedForNative===!0)return;try{let e=J("userSettings")||{};M("userSettings",{...e,env:{...e.env,DISABLE_AUTOUPDATER:"1"}}),f("tengu_migrate_autoupdates_to_settings",{was_user_preference:!0,already_had_env_var:!!e.env?.DISABLE_AUTOUPDATER}),process.env.DISABLE_AUTOUPDATER="1",_((a)=>{let{autoUpdates:i,autoUpdatesProtectedForNative:o,...l}=a;return l})}catch(e){V(Error(`Failed to migrate auto-updates: ${e}`)),f("tengu_migrate_autoupdates_error",{has_error:!0})}}oe();ae();hn();Z();function Wo(){if(!L().bypassPermissionsModeAccepted)return;try{if(!it())M("userSettings",{skipDangerousModePermissionPrompt:!0});f("tengu_migrate_bypass_permissions_accepted",{}),_((e)=>{if(!("bypassPermissionsModeAccepted"in e))return e;let{bypassPermissionsModeAccepted:a,...i}=e;return i})}catch(e){V(Error(`Failed to migrate bypass permissions accepted: ${e}`))}}oe();ae();hn();Z();function Yo(){let n=$o(),e=n.enableAllProjectMcpServers!==void 0,a=n.enabledMcpjsonServers&&n.enabledMcpjsonServers.length>0,i=n.disabledMcpjsonServers&&n.disabledMcpjsonServers.length>0;if(!e&&!a&&!i)return;try{let o=J("localSettings")||{},l={},u=[];if(e&&o.enableAllProjectMcpServers===void 0)l.enableAllProjectMcpServers=n.enableAllProjectMcpServers,u.push("enableAllProjectMcpServers");else if(e)u.push("enableAllProjectMcpServers");if(a&&n.enabledMcpjsonServers){let p=o.enabledMcpjsonServers||[];l.enabledMcpjsonServers=[...new Set([...p,...n.enabledMcpjsonServers])],u.push("enabledMcpjsonServers")}if(i&&n.disabledMcpjsonServers){let p=o.disabledMcpjsonServers||[];l.disabledMcpjsonServers=[...new Set([...p,...n.disabledMcpjsonServers])],u.push("disabledMcpjsonServers")}if(Object.keys(l).length>0)M("localSettings",l);if(u.includes("enableAllProjectMcpServers")||u.includes("enabledMcpjsonServers")||u.includes("disabledMcpjsonServers"))Vo((p)=>{let{enableAllProjectMcpServers:y,enabledMcpjsonServers:r,disabledMcpjsonServers:t,...c}=p;return c});f("tengu_migrate_mcp_approval_fields_success",{migratedCount:u.length})}catch(o){V(o),f("tengu_migrate_mcp_approval_fields_error",{})}}Z();oe();ae();Ca();jn();Z();function zo(){if(Fe()!=="firstParty")return;if(!Ho())return;let n=J("userSettings")?.model;if(n!=="claude-opus-4-20250514"&&n!=="claude-opus-4-1-20250805"&&n!=="claude-opus-4-0"&&n!=="claude-opus-4-1")return;M("userSettings",{model:"opus"}),_((e)=>({...e,legacyOpusMigrationTimestamp:Date.now()})),f("tengu_legacy_opus_migration",{from_model:n})}oe();Ca();Z();function jo(){if(!Ko())return;if(J("userSettings")?.model!=="opus")return;let e="opus[1m]",a=_e(e)===_e(Uo())?void 0:e;M("userSettings",{model:a}),f("tengu_opus_to_opus1m_migration",{})}ae();function Jo(){_((n)=>{let e=n.replBridgeEnabled;if(e===void 0)return n;if(n.remoteControlAtStartup!==void 0)return n;let a={...n,remoteControlAtStartup:Boolean(e)};return delete a.replBridgeEnabled,a})}Ye();ae();Z();function Qo(){if(L().sonnet1m45MigrationComplete)return;if(J("userSettings")?.model==="sonnet[1m]")M("userSettings",{model:"sonnet-4-5-20250929[1m]"});if(Zo()==="sonnet[1m]")mt("sonnet-4-5-20250929[1m]");_((i)=>({...i,sonnet1m45MigrationComplete:!0}))}oe();Jn();ae();jn();Z();function tl(){if(Fe()!=="firstParty")return;if(!ht()&&!el()&&!nl())return;let n=J("userSettings")?.model;if(n!=="claude-sonnet-4-5-20250929"&&n!=="claude-sonnet-4-5-20250929[1m]"&&n!=="sonnet-4-5-20250929"&&n!=="sonnet-4-5-20250929[1m]")return;let e=n.endsWith("[1m]");if(M("userSettings",{model:e?"sonnet[1m]":"sonnet"}),L().numStartups>1)_((i)=>({...i,sonnet45To46MigrationTimestamp:Date.now()}));f("tengu_sonnet45_to_46_migration",{from_model:n,has_1m:e})}oe();ae();hn();al();Z();oe();Jn();ae();jn();Z();function il(){if(L().opusProMigrationComplete)return;if(Fe()!=="firstParty"||!ht()){_((i)=>({...i,opusProMigrationComplete:!0})),f("tengu_reset_pro_to_opus_default",{skipped:!0});return}if(Le()?.model===void 0){let i=Date.now();_((o)=>({...o,opusProMigrationComplete:!0,opusProMigrationTimestamp:i})),f("tengu_reset_pro_to_opus_default",{skipped:!1,had_custom_model:!1})}else _((i)=>({...i,opusProMigrationComplete:!0})),f("tengu_reset_pro_to_opus_default",{skipped:!1,had_custom_model:!0})}En();Pn();Qt();import{z as gt}from"zod/v4";var Pm=ze(()=>gt.object({session_id:gt.string(),ws_url:gt.string(),work_dir:gt.string().optional()}));lr();gh();yh();sh();vh();Km();Gm();$i();Jh();Qh();ch();Ph();_h();uh();Jm();ag();v("main_tsx_entry");Vl();tc();var rl=()=>(th(),Q(nh)),cg=()=>(Ih(),Q(xh)),dg=()=>(Dh(),Q(Rh)),ug=null;v("main_tsx_imports_loaded");function pg(){try{let n=J("policySettings");if(n){let e=Hl(n);f("tengu_managed_settings_loaded",{keyCount:e.length,keys:e.join(",")})}}catch{}}function mg(){let n=ql(),e=process.execArgv.some((i)=>{if(n)return/--inspect(-brk)?/.test(i);else return/--inspect(-brk)?|--debug(-brk)?/.test(i)}),a=process.env.NODE_OPTIONS&&/--inspect(-brk)?|--debug(-brk)?/.test(process.env.NODE_OPTIONS);try{return!!global.require("inspector").url()||e||a}catch{return e||a}}if(mg())process.exit(1);function sl(){let n=_e(Qa()??Ln());Do(_n(),ec(n,pl())),xd().then(({enabled:e,errors:a})=>{let i=Ed();od(e,i,Cc()),ld(a,i)}).catch((e)=>V(e))}function hg(){let n={};if(process.env.NODE_EXTRA_CA_CERTS)n.has_node_extra_ca_certs=!0;if(process.env.CLAUDE_CODE_CLIENT_CERT)n.has_client_cert=!0;if(Sa("--use-system-ca"))n.has_use_system_ca=!0;if(Sa("--use-openssl-ca"))n.has_use_openssl_ca=!0;return n}async function gg(){if(dc())return;let[n,e,a]=await Promise.all([dt(),Bl(),Eo()]);f("tengu_startup_telemetry",{is_git:n,worktree_count:e,gh_auth_status:a,sandbox_enabled:kt.isSandboxingEnabled(),are_unsandboxed_commands_allowed:kt.areUnsandboxedCommandsAllowed(),is_auto_bash_allowed_if_sandbox_enabled:kt.isAutoAllowBashIfSandboxedEnabled(),auto_updater_disabled:hc(),prefers_reduced_motion:Je().prefersReducedMotion??!1,...hg()})}var Ta=11;function fg(){if(L().migrationVersion!==Ta)qo(),Wo(),Yo(),il(),Qo(),zo(),tl(),jo(),Jo(),_((n)=>n.migrationVersion===Ta?n:{...n,migrationVersion:Ta});Fd().catch(()=>{})}function yg(){if(Ve()){ce("info","prefetch_system_context_non_interactive"),fn();return}if(rt())ce("info","prefetch_system_context_has_trust"),fn();else ce("info","prefetch_system_context_skipped_no_trust")}function la(){if(B(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)||Re())return;if(lc(),ei(),yg(),eu(),B(process.env.CLAUDE_CODE_USE_BEDROCK)&&!B(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH))rc();if(B(process.env.CLAUDE_CODE_USE_VERTEX)&&!B(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH))ic();if(kc(_n(),AbortSignal.timeout(3000),[]),gc(),uc(),Ql(),wc.initialize(),!Re())Qd.initialize()}function bg(n){try{let e=n.trim(),a=e.startsWith("{")&&e.endsWith("}"),i;if(a){if(!Et(e))process.stderr.write(x.red(`Error: Invalid JSON provided to --settings
25879
- `)),process.exit(1);i=pd("claude-settings",".json",{contentHash:e}),Dl(i,e,"utf8")}else{let{resolvedPath:o}=Pl(Ml(),n);try{Ja(o,"utf8")}catch(l){if(lt(l))process.stderr.write(x.red(`Error: Settings file not found: ${o}
25880
- `)),process.exit(1);throw l}i=o}bl(i),Za()}catch(e){if(e instanceof Error)V(e);process.stderr.write(x.red(`Error processing settings: ${H(e)}
25881
- `)),process.exit(1)}}function vg(n){try{let e=Gl(n);vl(e),Za()}catch(e){if(e instanceof Error)V(e);process.stderr.write(x.red(`Error processing --setting-sources: ${H(e)}
25882
- `)),process.exit(1)}}function wg(){v("eagerLoadSettings_start");let n=ka("--settings");if(n)bg(n);let e=ka("--setting-sources");if(e!==void 0)vg(e);v("eagerLoadSettings_end")}function kg(n){if(process.env.CLAUDE_CODE_ENTRYPOINT)return;let e=process.argv.slice(2),a=e.indexOf("mcp");if(a!==-1&&e[a+1]==="serve"){process.env.CLAUDE_CODE_ENTRYPOINT="mcp";return}if(B(process.env.CLAUDE_CODE_ACTION)){process.env.CLAUDE_CODE_ENTRYPOINT="claude-code-github-action";return}process.env.CLAUDE_CODE_ENTRYPOINT=n?"sdk-cli":"cli"}async function gX(){v("main_function_start"),process.env.NoDefaultCurrentDirectoryInExePath="1",Tr(),process.on("exit",()=>{Ag()}),process.on("SIGINT",()=>{if(process.argv.includes("-p")||process.argv.includes("--print"))return;process.exit(0)}),v("main_warning_handler_initialized");let n=process.argv.slice(2),e=n.includes("-p")||n.includes("--print"),a=n.includes("--init-only"),i=n.some((y)=>y.startsWith("--sdk-url")),o=e||a||i||!process.stdout.isTTY;if(o)fc();hl(!o),kg(o);let u=(()=>{if(B(process.env.GITHUB_ACTIONS))return"github-action";if(process.env.CLAUDE_CODE_ENTRYPOINT==="sdk-ts")return"sdk-typescript";if(process.env.CLAUDE_CODE_ENTRYPOINT==="sdk-py")return"sdk-python";if(process.env.CLAUDE_CODE_ENTRYPOINT==="sdk-cli")return"sdk-cli";if(process.env.CLAUDE_CODE_ENTRYPOINT==="claude-vscode")return"claude-vscode";if(process.env.CLAUDE_CODE_ENTRYPOINT==="local-agent")return"local-agent";if(process.env.CLAUDE_CODE_ENTRYPOINT==="claude-desktop")return"claude-desktop";let y=process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN||process.env.CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR;if(process.env.CLAUDE_CODE_ENTRYPOINT==="remote"||y)return"remote";return"cli"})();gl(u);let p=process.env.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT;if(p==="markdown"||p==="html")Aa(p);else if(!u.startsWith("sdk-")&&u!=="claude-desktop"&&u!=="local-agent"&&u!=="remote")Aa("markdown");if(process.env.CLAUDE_CODE_ENVIRONMENT_KIND==="bridge")yl("remote-control");v("main_client_type_determined"),wg(),v("main_before_run"),await Tg(),v("main_after_run")}async function Cg(n,e){if(!process.stdin.isTTY&&!process.argv.includes("mcp")){if(e==="stream-json")return process.stdin;process.stdin.setEncoding("utf8");let a="",i=(l)=>{a+=l};process.stdin.on("data",i);let o=await Nl(process.stdin,3000);if(process.stdin.off("data",i),o)process.stderr.write(`Warning: no stdin data received in 3s, proceeding without it. If piping from a slow command, redirect stdin explicitly: < /dev/null to skip, or wait longer.
25878
+ `),xe()}),e.command("clear").description("Clear the IdP connection config and cached id_token").action(()=>{let a=je(),{error:i}=N("userSettings",{xaaIdp:void 0});if(i)return j(`Error writing settings: ${i.message}`);if(a)Nn(a.issuer),pt(a.issuer);xe("XAA IdP connection cleared")})}jh();Sh();Kc();ta();aa();ya();lg();Ah();Gi();function ka(n,e=process.argv){for(let a=0;a<e.length;a++){let i=e[a];if(i?.startsWith(`${n}=`))return i.slice(n.length+1);if(i===n&&a+1<e.length)return e[a+1]}return}wh();Uh();qm();$e();En();_m();Kt();Jh();Jm();Bm();$h();$m();Hm();Ye();oe();ae();hn();Q();function $o(){let n=L();if(n.autoUpdates!==!1||n.autoUpdatesProtectedForNative===!0)return;try{let e=Z("userSettings")||{};N("userSettings",{...e,env:{...e.env,DISABLE_AUTOUPDATER:"1"}}),f("tengu_migrate_autoupdates_to_settings",{was_user_preference:!0,already_had_env_var:!!e.env?.DISABLE_AUTOUPDATER}),process.env.DISABLE_AUTOUPDATER="1",_((a)=>{let{autoUpdates:i,autoUpdatesProtectedForNative:o,...l}=a;return l})}catch(e){V(Error(`Failed to migrate auto-updates: ${e}`)),f("tengu_migrate_autoupdates_error",{has_error:!0})}}oe();ae();hn();Q();function Vo(){if(!L().bypassPermissionsModeAccepted)return;try{if(!it())N("userSettings",{skipDangerousModePermissionPrompt:!0});f("tengu_migrate_bypass_permissions_accepted",{}),_((e)=>{if(!("bypassPermissionsModeAccepted"in e))return e;let{bypassPermissionsModeAccepted:a,...i}=e;return i})}catch(e){V(Error(`Failed to migrate bypass permissions accepted: ${e}`))}}oe();ae();hn();Q();function zo(){let n=Yo(),e=n.enableAllProjectMcpServers!==void 0,a=n.enabledMcpjsonServers&&n.enabledMcpjsonServers.length>0,i=n.disabledMcpjsonServers&&n.disabledMcpjsonServers.length>0;if(!e&&!a&&!i)return;try{let o=Z("localSettings")||{},l={},u=[];if(e&&o.enableAllProjectMcpServers===void 0)l.enableAllProjectMcpServers=n.enableAllProjectMcpServers,u.push("enableAllProjectMcpServers");else if(e)u.push("enableAllProjectMcpServers");if(a&&n.enabledMcpjsonServers){let p=o.enabledMcpjsonServers||[];l.enabledMcpjsonServers=[...new Set([...p,...n.enabledMcpjsonServers])],u.push("enabledMcpjsonServers")}if(i&&n.disabledMcpjsonServers){let p=o.disabledMcpjsonServers||[];l.disabledMcpjsonServers=[...new Set([...p,...n.disabledMcpjsonServers])],u.push("disabledMcpjsonServers")}if(Object.keys(l).length>0)N("localSettings",l);if(u.includes("enableAllProjectMcpServers")||u.includes("enabledMcpjsonServers")||u.includes("disabledMcpjsonServers"))Ho((p)=>{let{enableAllProjectMcpServers:y,enabledMcpjsonServers:r,disabledMcpjsonServers:t,...c}=p;return c});f("tengu_migrate_mcp_approval_fields_success",{migratedCount:u.length})}catch(o){V(o),f("tengu_migrate_mcp_approval_fields_error",{})}}Q();oe();ae();Ca();jn();Q();function Ko(){if(Fe()!=="firstParty")return;if(!Uo())return;let n=Z("userSettings")?.model;if(n!=="claude-opus-4-20250514"&&n!=="claude-opus-4-1-20250805"&&n!=="claude-opus-4-0"&&n!=="claude-opus-4-1")return;N("userSettings",{model:"opus"}),_((e)=>({...e,legacyOpusMigrationTimestamp:Date.now()})),f("tengu_legacy_opus_migration",{from_model:n})}oe();Ca();Q();function Zo(){if(!Jo())return;if(Z("userSettings")?.model!=="opus")return;let e="opus[1m]",a=_e(e)===_e(jo())?void 0:e;N("userSettings",{model:a}),f("tengu_opus_to_opus1m_migration",{})}ae();function Qo(){_((n)=>{let e=n.replBridgeEnabled;if(e===void 0)return n;if(n.remoteControlAtStartup!==void 0)return n;let a={...n,remoteControlAtStartup:Boolean(e)};return delete a.replBridgeEnabled,a})}Ye();ae();Q();function nl(){if(L().sonnet1m45MigrationComplete)return;if(Z("userSettings")?.model==="sonnet[1m]")N("userSettings",{model:"sonnet-4-5-20250929[1m]"});if(el()==="sonnet[1m]")mt("sonnet-4-5-20250929[1m]");_((i)=>({...i,sonnet1m45MigrationComplete:!0}))}oe();Jn();ae();jn();Q();function il(){if(Fe()!=="firstParty")return;if(!ht()&&!tl()&&!al())return;let n=Z("userSettings")?.model;if(n!=="claude-sonnet-4-5-20250929"&&n!=="claude-sonnet-4-5-20250929[1m]"&&n!=="sonnet-4-5-20250929"&&n!=="sonnet-4-5-20250929[1m]")return;let e=n.endsWith("[1m]");if(N("userSettings",{model:e?"sonnet[1m]":"sonnet"}),L().numStartups>1)_((i)=>({...i,sonnet45To46MigrationTimestamp:Date.now()}));f("tengu_sonnet45_to_46_migration",{from_model:n,has_1m:e})}oe();ae();hn();rl();Q();oe();Jn();ae();jn();Q();function sl(){if(L().opusProMigrationComplete)return;if(Fe()!=="firstParty"||!ht()){_((i)=>({...i,opusProMigrationComplete:!0})),f("tengu_reset_pro_to_opus_default",{skipped:!0});return}if(Le()?.model===void 0){let i=Date.now();_((o)=>({...o,opusProMigrationComplete:!0,opusProMigrationTimestamp:i})),f("tengu_reset_pro_to_opus_default",{skipped:!1,had_custom_model:!1})}else _((i)=>({...i,opusProMigrationComplete:!0})),f("tengu_reset_pro_to_opus_default",{skipped:!1,had_custom_model:!0})}En();Pn();Qt();import{z as gt}from"zod/v4";var Fm=ze(()=>gt.object({session_id:gt.string(),ws_url:gt.string(),work_dir:gt.string().optional()}));lr();vh();kh();dh();Th();Qm();Vm();$i();ng();ag();mh();Fh();Wh();gh();nh();og();v("main_tsx_entry");Hl();ic();var ol=()=>(sh(),K(rh)),mg=()=>(Mh(),K(Ph)),hg=()=>(Oh(),K(Nh)),gg=null;v("main_tsx_imports_loaded");function fg(){try{let n=Z("policySettings");if(n){let e=Ul(n);f("tengu_managed_settings_loaded",{keyCount:e.length,keys:e.join(",")})}}catch{}}function yg(){let n=$l(),e=process.execArgv.some((i)=>{if(n)return/--inspect(-brk)?/.test(i);else return/--inspect(-brk)?|--debug(-brk)?/.test(i)}),a=process.env.NODE_OPTIONS&&/--inspect(-brk)?|--debug(-brk)?/.test(process.env.NODE_OPTIONS);try{return!!global.require("inspector").url()||e||a}catch{return e||a}}if(yg())process.exit(1);function ll(){let n=_e(Qa()??Ln());Mo(_n(),tc(n,hl())),Rd().then(({enabled:e,errors:a})=>{let i=Id();cd(e,i,Xc()),dd(a,i)}).catch((e)=>V(e))}function bg(){let n={};if(process.env.NODE_EXTRA_CA_CERTS)n.has_node_extra_ca_certs=!0;if(process.env.CLAUDE_CODE_CLIENT_CERT)n.has_client_cert=!0;if(Sa("--use-system-ca"))n.has_use_system_ca=!0;if(Sa("--use-openssl-ca"))n.has_use_openssl_ca=!0;return n}async function vg(){if(pc())return;let[n,e,a]=await Promise.all([dt(),ql(),Io()]);f("tengu_startup_telemetry",{is_git:n,worktree_count:e,gh_auth_status:a,sandbox_enabled:kt.isSandboxingEnabled(),are_unsandboxed_commands_allowed:kt.areUnsandboxedCommandsAllowed(),is_auto_bash_allowed_if_sandbox_enabled:kt.isAutoAllowBashIfSandboxedEnabled(),auto_updater_disabled:fc(),prefers_reduced_motion:Je().prefersReducedMotion??!1,...bg()})}var Ta=11;function wg(){if(L().migrationVersion!==Ta)$o(),Vo(),zo(),sl(),nl(),Ko(),il(),Zo(),Qo(),_((n)=>n.migrationVersion===Ta?n:{...n,migrationVersion:Ta});_d().catch(()=>{})}function kg(){if(Ve()){ce("info","prefetch_system_context_non_interactive"),fn();return}if(rt())ce("info","prefetch_system_context_has_trust"),fn();else ce("info","prefetch_system_context_skipped_no_trust")}function la(){if(B(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)||Re())return;if(dc(),ei(),kg(),tu(),B(process.env.CLAUDE_CODE_USE_BEDROCK)&&!B(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH))oc();if(B(process.env.CLAUDE_CODE_USE_VERTEX)&&!B(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH))sc();if(Tc(_n(),AbortSignal.timeout(3000),[]),yc(),mc(),nc(),Cc.initialize(),!Re())nu.initialize()}function Cg(n){try{let e=n.trim(),a=e.startsWith("{")&&e.endsWith("}"),i;if(a){if(!Et(e))process.stderr.write(x.red(`Error: Invalid JSON provided to --settings
25879
+ `)),process.exit(1);i=hd("claude-settings",".json",{contentHash:e}),Ml(i,e,"utf8")}else{let{resolvedPath:o}=Nl(Ol(),n);try{Ja(o,"utf8")}catch(l){if(lt(l))process.stderr.write(x.red(`Error: Settings file not found: ${o}
25880
+ `)),process.exit(1);throw l}i=o}wl(i),Za()}catch(e){if(e instanceof Error)V(e);process.stderr.write(x.red(`Error processing settings: ${H(e)}
25881
+ `)),process.exit(1)}}function Tg(n){try{let e=Wl(n);kl(e),Za()}catch(e){if(e instanceof Error)V(e);process.stderr.write(x.red(`Error processing --setting-sources: ${H(e)}
25882
+ `)),process.exit(1)}}function Xg(){v("eagerLoadSettings_start");let n=ka("--settings");if(n)Cg(n);let e=ka("--setting-sources");if(e!==void 0)Tg(e);v("eagerLoadSettings_end")}function Ag(n){if(process.env.CLAUDE_CODE_ENTRYPOINT)return;let e=process.argv.slice(2),a=e.indexOf("mcp");if(a!==-1&&e[a+1]==="serve"){process.env.CLAUDE_CODE_ENTRYPOINT="mcp";return}if(B(process.env.CLAUDE_CODE_ACTION)){process.env.CLAUDE_CODE_ENTRYPOINT="claude-code-github-action";return}process.env.CLAUDE_CODE_ENTRYPOINT=n?"sdk-cli":"cli"}async function wX(){v("main_function_start"),process.env.NoDefaultCurrentDirectoryInExePath="1",Tr(),process.on("exit",()=>{Ig()}),process.on("SIGINT",()=>{if(process.argv.includes("-p")||process.argv.includes("--print"))return;process.exit(0)}),v("main_warning_handler_initialized");let n=process.argv.slice(2),e=n.includes("-p")||n.includes("--print"),a=n.includes("--init-only"),i=n.some((y)=>y.startsWith("--sdk-url")),o=e||a||i||!process.stdout.isTTY;if(o)bc();fl(!o),Ag(o);let u=(()=>{if(B(process.env.GITHUB_ACTIONS))return"github-action";if(process.env.CLAUDE_CODE_ENTRYPOINT==="sdk-ts")return"sdk-typescript";if(process.env.CLAUDE_CODE_ENTRYPOINT==="sdk-py")return"sdk-python";if(process.env.CLAUDE_CODE_ENTRYPOINT==="sdk-cli")return"sdk-cli";if(process.env.CLAUDE_CODE_ENTRYPOINT==="claude-vscode")return"claude-vscode";if(process.env.CLAUDE_CODE_ENTRYPOINT==="local-agent")return"local-agent";if(process.env.CLAUDE_CODE_ENTRYPOINT==="claude-desktop")return"claude-desktop";let y=process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN||process.env.CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR;if(process.env.CLAUDE_CODE_ENTRYPOINT==="remote"||y)return"remote";return"cli"})();yl(u);let p=process.env.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT;if(p==="markdown"||p==="html")Aa(p);else if(!u.startsWith("sdk-")&&u!=="claude-desktop"&&u!=="local-agent"&&u!=="remote")Aa("markdown");if(process.env.CLAUDE_CODE_ENVIRONMENT_KIND==="bridge")vl("remote-control");v("main_client_type_determined"),Xg(),v("main_before_run"),await Eg(),v("main_after_run")}async function Sg(n,e){if(!process.stdin.isTTY&&!process.argv.includes("mcp")){if(e==="stream-json")return process.stdin;process.stdin.setEncoding("utf8");let a="",i=(l)=>{a+=l};process.stdin.on("data",i);let o=await Fl(process.stdin,3000);if(process.stdin.off("data",i),o)process.stderr.write(`Warning: no stdin data received in 3s, proceeding without it. If piping from a slow command, redirect stdin explicitly: < /dev/null to skip, or wait longer.
25883
25883
  `);return[n,a].filter(Boolean).join(`
25884
- `)}return n}async function Tg(){v("run_function_start");function n(){let r=(t)=>t.long?.replace(/^--/,"")??t.short?.replace(/^-/,"")??"";return Object.assign({sortSubcommands:!0,sortOptions:!0},{compareOptions:(t,c)=>r(t).localeCompare(r(c))})}let e=new rg().configureHelp(n()).enablePositionalOptions();if(v("run_commander_initialized"),e.hook("preAction",async(r)=>{if(v("preAction_start"),await Promise.all([Yl(),ac()]),v("preAction_after_mdm"),await pr(),v("preAction_after_init"),!B(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE))process.title="claude";let{initSinks:t}=await import("./sinks-q6etaenz.js");t(),v("preAction_after_sinks");let c=r.getOptionValue("pluginDir");if(Array.isArray(c)&&c.length>0&&c.every((b)=>typeof b==="string"))wl(c),Id("preAction: --plugin-dir inline plugins");fg(),v("preAction_after_migrations"),nd(),Qc(),v("preAction_after_remote_settings"),v("preAction_after_settings_sync")}),e.name("unieai").description("UnieAI Code - starts an interactive session by default, use -p/--print for non-interactive output").argument("[prompt]","Your prompt",String).helpOption("-h, --help","Display help for command").option("-d, --debug [filter]",'Enable debug mode with optional category filtering (e.g., "api,hooks" or "!1p,!file")',(r)=>{return!0}).addOption(new T("--debug-to-stderr","Enable debug mode (to stderr)").argParser(Boolean).hideHelp()).option("--debug-file <path>","Write debug logs to a specific file path (implicitly enables debug mode)",()=>!0).option("--verbose","Override verbose mode setting from config",()=>!0).option("-p, --print","Print response and exit (useful for pipes). Note: The workspace trust dialog is skipped when Claude is run with the -p mode. Only use this flag in directories you trust.",()=>!0).option("--bare","Minimal mode: skip hooks, LSP, plugin sync, attribution, auto-memory, background prefetches, keychain reads, and CLAUDE.md auto-discovery. Sets CLAUDE_CODE_SIMPLE=1. Anthropic auth is strictly ANTHROPIC_API_KEY or apiKeyHelper via --settings (OAuth and keychain are never read). 3P providers (Bedrock/Vertex/Foundry) use their own credentials. Skills still resolve via /skill-name. Explicitly provide context via: --system-prompt[-file], --append-system-prompt[-file], --add-dir (CLAUDE.md dirs), --mcp-config, --settings, --agents, --plugin-dir.",()=>!0).addOption(new T("--init","Run Setup hooks with init trigger, then continue").hideHelp()).addOption(new T("--init-only","Run Setup and SessionStart:startup hooks, then exit").hideHelp()).addOption(new T("--maintenance","Run Setup hooks with maintenance trigger, then continue").hideHelp()).addOption(new T("--output-format <format>",'Output format (only works with --print): "text" (default), "json" (single result), or "stream-json" (realtime streaming)').choices(["text","json","stream-json"])).addOption(new T("--json-schema <schema>",'JSON Schema for structured output validation. Example: {"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}').argParser(String)).option("--include-hook-events","Include all hook lifecycle events in the output stream (only works with --output-format=stream-json)",()=>!0).option("--include-partial-messages","Include partial message chunks as they arrive (only works with --print and --output-format=stream-json)",()=>!0).addOption(new T("--input-format <format>",'Input format (only works with --print): "text" (default), or "stream-json" (realtime streaming input)').choices(["text","stream-json"])).option("--mcp-debug","[DEPRECATED. Use --debug instead] Enable MCP debug mode (shows MCP server errors)",()=>!0).option("--dangerously-skip-permissions","Bypass all permission checks. Recommended only for sandboxes with no internet access.",()=>!0).option("--allow-dangerously-skip-permissions","Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.",()=>!0).addOption(new T("--thinking <mode>","Thinking mode: enabled (equivalent to adaptive), disabled").choices(["enabled","adaptive","disabled"]).hideHelp()).addOption(new T("--max-thinking-tokens <tokens>","[DEPRECATED. Use --thinking instead for newer models] Maximum number of thinking tokens (only works with --print)").argParser(Number).hideHelp()).addOption(new T("--max-turns <turns>","Maximum number of agentic turns in non-interactive mode. This will early exit the conversation after the specified number of turns. (only works with --print)").argParser(Number).hideHelp()).addOption(new T("--max-budget-usd <amount>","Maximum dollar amount to spend on API calls (only works with --print)").argParser((r)=>{let t=Number(r);if(isNaN(t)||t<=0)throw Error("--max-budget-usd must be a positive number greater than 0");return t})).addOption(new T("--task-budget <tokens>","API-side task budget in tokens (output_config.task_budget)").argParser((r)=>{let t=Number(r);if(isNaN(t)||t<=0||!Number.isInteger(t))throw Error("--task-budget must be a positive integer");return t}).hideHelp()).option("--replay-user-messages","Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and --output-format=stream-json)",()=>!0).addOption(new T("--enable-auth-status","Enable auth status messages in SDK mode").default(!1).hideHelp()).option("--allowedTools, --allowed-tools <tools...>",'Comma or space-separated list of tool names to allow (e.g. "Bash(git:*) Edit")').option("--tools <tools...>",'Specify the list of available tools from the built-in set. Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read").').option("--disallowedTools, --disallowed-tools <tools...>",'Comma or space-separated list of tool names to deny (e.g. "Bash(git:*) Edit")').option("--mcp-config <configs...>","Load MCP servers from JSON files or strings (space-separated)").addOption(new T("--permission-prompt-tool <tool>","MCP tool to use for permission prompts (only works with --print)").argParser(String).hideHelp()).addOption(new T("--system-prompt <prompt>","System prompt to use for the session").argParser(String)).addOption(new T("--system-prompt-file <file>","Read system prompt from a file").argParser(String).hideHelp()).addOption(new T("--append-system-prompt <prompt>","Append a system prompt to the default system prompt").argParser(String)).addOption(new T("--append-system-prompt-file <file>","Read system prompt from a file and append to the default system prompt").argParser(String).hideHelp()).addOption(new T("--permission-mode <mode>","Permission mode to use for the session").argParser(String).choices($l)).option("-c, --continue","Continue the most recent conversation in the current directory",()=>!0).option("-r, --resume [value]","Resume a conversation by session ID, or open interactive picker with optional search term",(r)=>r||!0).option("--fork-session","When resuming, create a new session ID instead of reusing the original (use with --resume or --continue)",()=>!0).addOption(new T("--prefill <text>","Pre-fill the prompt input with text without submitting it").hideHelp()).addOption(new T("--deep-link-origin","Signal that this session was launched from a deep link").hideHelp()).addOption(new T("--deep-link-repo <slug>","Repo slug the deep link ?repo= parameter resolved to the current cwd").hideHelp()).addOption(new T("--deep-link-last-fetch <ms>","FETCH_HEAD mtime in epoch ms, precomputed by the deep link trampoline").argParser((r)=>{let t=Number(r);return Number.isFinite(t)?t:void 0}).hideHelp()).option("--from-pr [value]","Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term",(r)=>r||!0).option("--no-session-persistence","Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print)").addOption(new T("--resume-session-at <message id>","When resuming, only messages up to and including the assistant message with <message.id> (use with --resume in print mode)").argParser(String).hideHelp()).addOption(new T("--rewind-files <user-message-id>","Restore files to state at the specified user message and exit (requires --resume)").hideHelp()).option("--model <model>","Model for the current session. Provide an alias for the latest model (e.g. 'sonnet' or 'opus') or a model's full name (e.g. 'claude-sonnet-4-6').").addOption(new T("--effort <level>","Effort level for the current session (low, medium, high, max)").argParser((r)=>{let t=r.toLowerCase(),c=["low","medium","high","max"];if(!c.includes(t))throw new sg(`It must be one of: ${c.join(", ")}`);return t})).option("--agent <agent>","Agent for the current session. Overrides the 'agent' setting.").option("--betas <betas...>","Beta headers to include in API requests (API key users only)").option("--fallback-model <model>","Enable automatic fallback to specified model when default model is overloaded (only works with --print)").addOption(new T("--workload <tag>","Workload tag for billing-header attribution (cc_workload). Process-scoped; set by SDK daemon callers that spawn subprocesses for cron work. (only works with --print)").hideHelp()).option("--settings <file-or-json>","Path to a settings JSON file or a JSON string to load additional settings from").option("--add-dir <directories...>","Additional directories to allow tool access to").option("--ide","Automatically connect to IDE on startup if exactly one valid IDE is available",()=>!0).option("--strict-mcp-config","Only use MCP servers from --mcp-config, ignoring all other MCP configurations",()=>!0).option("--session-id <uuid>","Use a specific session ID for the conversation (must be a valid UUID)").option("-n, --name <name>","Set a display name for this session (shown in /resume and terminal title)").option("--agents <json>",`JSON object defining custom agents (e.g. '{"reviewer": {"description": "Reviews code", "prompt": "You are a code reviewer"}}')`).option("--setting-sources <sources>","Comma-separated list of setting sources to load (user, project, local).").option("--plugin-dir <path>","Load plugins from a directory for this session only (repeatable: --plugin-dir A --plugin-dir B)",(r,t)=>[...t,r],[]).option("--disable-slash-commands","Disable all skills",()=>!0).option("--chrome","Enable Claude in Chrome integration").option("--no-chrome","Disable Claude in Chrome integration").option("--no-computer-use","Disable Computer Use MCP for this session").option("--file <specs...>","File resources to download at startup. Format: file_id:relative_path (e.g., --file file_abc:doc.txt file_def:img.png)").action(async(r,t)=>{if(v("action_handler_start"),t.bare)process.env.CLAUDE_CODE_SIMPLE="1";if(r==="code")f("tengu_code_prompt_ignored",{}),console.warn(x.yellow("Tip: You can launch UnieAI Code with just `unieai`")),r=void 0;if(r&&typeof r==="string"&&!/\s/.test(r)&&r.length>0)f("tengu_single_word_prompt",{length:r.length});let c=!1,b,{debug:A=!1,debugToStderr:D=!1,dangerouslySkipPermissions:R,allowDangerouslySkipPermissions:G=!1,tools:ye=[],allowedTools:ie=[],disallowedTools:De=[],mcpConfig:Xe=[],permissionMode:Ie,addDir:he=[],fallbackModel:Ze,betas:xt=[],ide:It=!1,sessionId:kn,includeHookEvents:ni,includePartialMessages:ti}=t;if(t.prefill)yc(t.prefill);let Rt,ai=t.agents,Dt=t.agent,Ae=t.outputFormat,be=t.inputFormat,Bn=t.verbose??L().verbose,ii=t.print,ri=t.init??!1,Pt=t.initOnly??!1,si=t.maintenance??!1,Mt=t.disableSlashCommands||!1,Nt=!1,iu=Nt?typeof Nt==="string"?Nt:id:void 0,Ot=St()?t.worktree:void 0,ru=St()?t.worktreeBaseRef:void 0,Gn=typeof Ot==="string"?Ot:void 0,Qe=Ot!==void 0,oi;if(Gn){let s=Hd(Gn);if(s!==null)oi=s,Gn=void 0}let li=St()&&t.tmux===!0;if(li){if(!Qe)process.stderr.write(x.red(`Error: --tmux requires --worktree
25884
+ `)}return n}async function Eg(){v("run_function_start");function n(){let r=(t)=>t.long?.replace(/^--/,"")??t.short?.replace(/^-/,"")??"";return Object.assign({sortSubcommands:!0,sortOptions:!0},{compareOptions:(t,c)=>r(t).localeCompare(r(c))})}let e=new cg().configureHelp(n()).enablePositionalOptions();if(v("run_commander_initialized"),e.hook("preAction",async(r)=>{if(v("preAction_start"),await Promise.all([zl(),rc()]),v("preAction_after_mdm"),await pr(),v("preAction_after_init"),!B(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE))process.title="claude";let{initSinks:t}=await import("./sinks-wd4ccgbf.js");t(),v("preAction_after_sinks");let c=r.getOptionValue("pluginDir");if(Array.isArray(c)&&c.length>0&&c.every((b)=>typeof b==="string"))Cl(c),Dd("preAction: --plugin-dir inline plugins");wg(),v("preAction_after_migrations"),ad(),nd(),v("preAction_after_remote_settings"),v("preAction_after_settings_sync")}),e.name("unieai").description("UnieAI Code - starts an interactive session by default, use -p/--print for non-interactive output").argument("[prompt]","Your prompt",String).helpOption("-h, --help","Display help for command").option("-d, --debug [filter]",'Enable debug mode with optional category filtering (e.g., "api,hooks" or "!1p,!file")',(r)=>{return!0}).addOption(new T("--debug-to-stderr","Enable debug mode (to stderr)").argParser(Boolean).hideHelp()).option("--debug-file <path>","Write debug logs to a specific file path (implicitly enables debug mode)",()=>!0).option("--verbose","Override verbose mode setting from config",()=>!0).option("-p, --print","Print response and exit (useful for pipes). Note: The workspace trust dialog is skipped when Claude is run with the -p mode. Only use this flag in directories you trust.",()=>!0).option("--bare","Minimal mode: skip hooks, LSP, plugin sync, attribution, auto-memory, background prefetches, keychain reads, and CLAUDE.md auto-discovery. Sets CLAUDE_CODE_SIMPLE=1. Anthropic auth is strictly ANTHROPIC_API_KEY or apiKeyHelper via --settings (OAuth and keychain are never read). 3P providers (Bedrock/Vertex/Foundry) use their own credentials. Skills still resolve via /skill-name. Explicitly provide context via: --system-prompt[-file], --append-system-prompt[-file], --add-dir (CLAUDE.md dirs), --mcp-config, --settings, --agents, --plugin-dir.",()=>!0).addOption(new T("--init","Run Setup hooks with init trigger, then continue").hideHelp()).addOption(new T("--init-only","Run Setup and SessionStart:startup hooks, then exit").hideHelp()).addOption(new T("--maintenance","Run Setup hooks with maintenance trigger, then continue").hideHelp()).addOption(new T("--output-format <format>",'Output format (only works with --print): "text" (default), "json" (single result), or "stream-json" (realtime streaming)').choices(["text","json","stream-json"])).addOption(new T("--json-schema <schema>",'JSON Schema for structured output validation. Example: {"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}').argParser(String)).option("--include-hook-events","Include all hook lifecycle events in the output stream (only works with --output-format=stream-json)",()=>!0).option("--include-partial-messages","Include partial message chunks as they arrive (only works with --print and --output-format=stream-json)",()=>!0).addOption(new T("--input-format <format>",'Input format (only works with --print): "text" (default), or "stream-json" (realtime streaming input)').choices(["text","stream-json"])).option("--mcp-debug","[DEPRECATED. Use --debug instead] Enable MCP debug mode (shows MCP server errors)",()=>!0).option("--dangerously-skip-permissions","Bypass all permission checks. Recommended only for sandboxes with no internet access.",()=>!0).option("--allow-dangerously-skip-permissions","Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.",()=>!0).addOption(new T("--thinking <mode>","Thinking mode: enabled (equivalent to adaptive), disabled").choices(["enabled","adaptive","disabled"]).hideHelp()).addOption(new T("--max-thinking-tokens <tokens>","[DEPRECATED. Use --thinking instead for newer models] Maximum number of thinking tokens (only works with --print)").argParser(Number).hideHelp()).addOption(new T("--max-turns <turns>","Maximum number of agentic turns in non-interactive mode. This will early exit the conversation after the specified number of turns. (only works with --print)").argParser(Number).hideHelp()).addOption(new T("--max-budget-usd <amount>","Maximum dollar amount to spend on API calls (only works with --print)").argParser((r)=>{let t=Number(r);if(isNaN(t)||t<=0)throw Error("--max-budget-usd must be a positive number greater than 0");return t})).addOption(new T("--task-budget <tokens>","API-side task budget in tokens (output_config.task_budget)").argParser((r)=>{let t=Number(r);if(isNaN(t)||t<=0||!Number.isInteger(t))throw Error("--task-budget must be a positive integer");return t}).hideHelp()).option("--replay-user-messages","Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and --output-format=stream-json)",()=>!0).addOption(new T("--enable-auth-status","Enable auth status messages in SDK mode").default(!1).hideHelp()).option("--allowedTools, --allowed-tools <tools...>",'Comma or space-separated list of tool names to allow (e.g. "Bash(git:*) Edit")').option("--tools <tools...>",'Specify the list of available tools from the built-in set. Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read").').option("--disallowedTools, --disallowed-tools <tools...>",'Comma or space-separated list of tool names to deny (e.g. "Bash(git:*) Edit")').option("--mcp-config <configs...>","Load MCP servers from JSON files or strings (space-separated)").addOption(new T("--permission-prompt-tool <tool>","MCP tool to use for permission prompts (only works with --print)").argParser(String).hideHelp()).addOption(new T("--system-prompt <prompt>","System prompt to use for the session").argParser(String)).addOption(new T("--system-prompt-file <file>","Read system prompt from a file").argParser(String).hideHelp()).addOption(new T("--append-system-prompt <prompt>","Append a system prompt to the default system prompt").argParser(String)).addOption(new T("--append-system-prompt-file <file>","Read system prompt from a file and append to the default system prompt").argParser(String).hideHelp()).addOption(new T("--permission-mode <mode>","Permission mode to use for the session").argParser(String).choices(Yl)).option("-c, --continue","Continue the most recent conversation in the current directory",()=>!0).option("-r, --resume [value]","Resume a conversation by session ID, or open interactive picker with optional search term",(r)=>r||!0).option("--fork-session","When resuming, create a new session ID instead of reusing the original (use with --resume or --continue)",()=>!0).addOption(new T("--prefill <text>","Pre-fill the prompt input with text without submitting it").hideHelp()).addOption(new T("--deep-link-origin","Signal that this session was launched from a deep link").hideHelp()).addOption(new T("--deep-link-repo <slug>","Repo slug the deep link ?repo= parameter resolved to the current cwd").hideHelp()).addOption(new T("--deep-link-last-fetch <ms>","FETCH_HEAD mtime in epoch ms, precomputed by the deep link trampoline").argParser((r)=>{let t=Number(r);return Number.isFinite(t)?t:void 0}).hideHelp()).option("--from-pr [value]","Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term",(r)=>r||!0).option("--no-session-persistence","Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print)").addOption(new T("--resume-session-at <message id>","When resuming, only messages up to and including the assistant message with <message.id> (use with --resume in print mode)").argParser(String).hideHelp()).addOption(new T("--rewind-files <user-message-id>","Restore files to state at the specified user message and exit (requires --resume)").hideHelp()).option("--model <model>","Model for the current session. Provide an alias for the latest model (e.g. 'sonnet' or 'opus') or a model's full name (e.g. 'claude-sonnet-4-6').").addOption(new T("--effort <level>","Effort level for the current session (low, medium, high, max)").argParser((r)=>{let t=r.toLowerCase(),c=["low","medium","high","max"];if(!c.includes(t))throw new dg(`It must be one of: ${c.join(", ")}`);return t})).option("--agent <agent>","Agent for the current session. Overrides the 'agent' setting.").option("--betas <betas...>","Beta headers to include in API requests (API key users only)").option("--fallback-model <model>","Enable automatic fallback to specified model when default model is overloaded (only works with --print)").addOption(new T("--workload <tag>","Workload tag for billing-header attribution (cc_workload). Process-scoped; set by SDK daemon callers that spawn subprocesses for cron work. (only works with --print)").hideHelp()).option("--settings <file-or-json>","Path to a settings JSON file or a JSON string to load additional settings from").option("--add-dir <directories...>","Additional directories to allow tool access to").option("--ide","Automatically connect to IDE on startup if exactly one valid IDE is available",()=>!0).option("--strict-mcp-config","Only use MCP servers from --mcp-config, ignoring all other MCP configurations",()=>!0).option("--session-id <uuid>","Use a specific session ID for the conversation (must be a valid UUID)").option("-n, --name <name>","Set a display name for this session (shown in /resume and terminal title)").option("--agents <json>",`JSON object defining custom agents (e.g. '{"reviewer": {"description": "Reviews code", "prompt": "You are a code reviewer"}}')`).option("--setting-sources <sources>","Comma-separated list of setting sources to load (user, project, local).").option("--plugin-dir <path>","Load plugins from a directory for this session only (repeatable: --plugin-dir A --plugin-dir B)",(r,t)=>[...t,r],[]).option("--disable-slash-commands","Disable all skills",()=>!0).option("--chrome","Enable Claude in Chrome integration").option("--no-chrome","Disable Claude in Chrome integration").option("--no-computer-use","Disable Computer Use MCP for this session").option("--file <specs...>","File resources to download at startup. Format: file_id:relative_path (e.g., --file file_abc:doc.txt file_def:img.png)").action(async(r,t)=>{if(v("action_handler_start"),t.bare)process.env.CLAUDE_CODE_SIMPLE="1";if(r==="code")f("tengu_code_prompt_ignored",{}),console.warn(x.yellow("Tip: You can launch UnieAI Code with just `unieai`")),r=void 0;if(r&&typeof r==="string"&&!/\s/.test(r)&&r.length>0)f("tengu_single_word_prompt",{length:r.length});let c=!1,b,{debug:A=!1,debugToStderr:P=!1,dangerouslySkipPermissions:D,allowDangerouslySkipPermissions:G=!1,tools:ye=[],allowedTools:ie=[],disallowedTools:De=[],mcpConfig:Xe=[],permissionMode:Ie,addDir:he=[],fallbackModel:Ze,betas:xt=[],ide:It=!1,sessionId:kn,includeHookEvents:ni,includePartialMessages:ti}=t;if(t.prefill)vc(t.prefill);let Rt,ai=t.agents,Dt=t.agent,Ae=t.outputFormat,be=t.inputFormat,Bn=t.verbose??L().verbose,ii=t.print,ri=t.init??!1,Pt=t.initOnly??!1,si=t.maintenance??!1,Mt=t.disableSlashCommands||!1,Nt=!1,su=Nt?typeof Nt==="string"?Nt:sd:void 0,Ot=St()?t.worktree:void 0,ou=St()?t.worktreeBaseRef:void 0,Gn=typeof Ot==="string"?Ot:void 0,Qe=Ot!==void 0,oi;if(Gn){let s=Ud(Gn);if(s!==null)oi=s,Gn=void 0}let li=St()&&t.tmux===!0;if(li){if(!Qe)process.stderr.write(x.red(`Error: --tmux requires --worktree
25885
25885
  `)),process.exit(1);if(et()==="windows")process.stderr.write(x.red(`Error: --tmux is not supported on Windows
25886
- `)),process.exit(1);if(!await zd())process.stderr.write(x.red(`Error: tmux is not installed.
25887
- ${Ud()}
25888
- `)),process.exit(1)}let ve;if(wn()){let s=Sg(t);ve=s;let d=s.agentId||s.agentName||s.teamName,k=s.agentId&&s.agentName&&s.teamName;if(d&&!k)process.stderr.write(x.red(`Error: --agent-id, --agent-name, and --team-name must all be provided together
25889
- `)),process.exit(1);if(s.agentId&&s.agentName&&s.teamName)rl().setDynamicTeamContext?.({agentId:s.agentId,agentName:s.agentName,teamName:s.teamName,color:s.agentColor,planModeRequired:s.planModeRequired??!1,parentSessionId:s.parentSessionId});if(s.teammateMode)dg().setCliTeammateModeOverride?.(s.teammateMode)}let Cn=t.sdkUrl??void 0,ci=ti||B(process.env.CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES);if(ni||B(process.env.CLAUDE_CODE_REMOTE))Sd(!0);if(Cn){if(!be)be="stream-json";if(!Ae)Ae="stream-json";if(t.verbose===void 0)Bn=!0;if(!t.print)ii=!0}let de=t.teleport??null,di=t.remote,en=di===!0?"":di??null,Ft=t.remoteControl??t.rc,ui=!1,su=typeof Ft==="string"&&Ft.length>0?Ft:void 0;if(kn){if((t.continue||t.resume)&&!t.forkSession)process.stderr.write(x.red(`Error: --session-id can only be used with --continue or --resume if --fork-session is also specified.
25886
+ `)),process.exit(1);if(!await Kd())process.stderr.write(x.red(`Error: tmux is not installed.
25887
+ ${jd()}
25888
+ `)),process.exit(1)}let ve;if(wn()){let s=Rg(t);ve=s;let d=s.agentId||s.agentName||s.teamName,k=s.agentId&&s.agentName&&s.teamName;if(d&&!k)process.stderr.write(x.red(`Error: --agent-id, --agent-name, and --team-name must all be provided together
25889
+ `)),process.exit(1);if(s.agentId&&s.agentName&&s.teamName)ol().setDynamicTeamContext?.({agentId:s.agentId,agentName:s.agentName,teamName:s.teamName,color:s.agentColor,planModeRequired:s.planModeRequired??!1,parentSessionId:s.parentSessionId});if(s.teammateMode)hg().setCliTeammateModeOverride?.(s.teammateMode)}let Cn=t.sdkUrl??void 0,ci=ti||B(process.env.CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES);if(ni||B(process.env.CLAUDE_CODE_REMOTE))xd(!0);if(Cn){if(!be)be="stream-json";if(!Ae)Ae="stream-json";if(t.verbose===void 0)Bn=!0;if(!t.print)ii=!0}let pe=t.teleport??null,di=t.remote,en=di===!0?"":di??null,Ft=t.remoteControl??t.rc,ui=!1,lu=typeof Ft==="string"&&Ft.length>0?Ft:void 0;if(kn){if((t.continue||t.resume)&&!t.forkSession)process.stderr.write(x.red(`Error: --session-id can only be used with --continue or --resume if --fork-session is also specified.
25890
25890
  `)),process.exit(1);if(!Cn){let s=Ct(kn);if(!s)process.stderr.write(x.red(`Error: Invalid session ID. Must be a valid UUID.
25891
- `)),process.exit(1);if(qd(s))process.stderr.write(x.red(`Error: Session ID ${s} is already in use.
25892
- `)),process.exit(1)}}let Lt=t.file;if(Lt&&Lt.length>0){let s=Vc();if(!s)process.stderr.write(x.red(`Error: Session token required for file downloads. CLAUDE_CODE_SESSION_ACCESS_TOKEN must be set.
25893
- `)),process.exit(1);let d=process.env.CLAUDE_CODE_REMOTE_SESSION_ID||ol(),k=ud(Lt);if(k.length>0){let C={baseUrl:process.env.ANTHROPIC_BASE_URL||mn().BASE_API_URL,oauthToken:s,sessionId:d};Rt=dd(k,C)}}let ue=Ve();if(Ze&&t.model&&Ze===t.model)process.stderr.write(x.red(`Error: Fallback model cannot be the same as the main model. Please specify a different model for --fallback-model.
25891
+ `)),process.exit(1);if($d(s))process.stderr.write(x.red(`Error: Session ID ${s} is already in use.
25892
+ `)),process.exit(1)}}let Lt=t.file;if(Lt&&Lt.length>0){let s=Hc();if(!s)process.stderr.write(x.red(`Error: Session token required for file downloads. CLAUDE_CODE_SESSION_ACCESS_TOKEN must be set.
25893
+ `)),process.exit(1);let d=process.env.CLAUDE_CODE_REMOTE_SESSION_ID||cl(),k=md(Lt);if(k.length>0){let C={baseUrl:process.env.ANTHROPIC_BASE_URL||mn().BASE_API_URL,oauthToken:s,sessionId:d};Rt=pd(k,C)}}let me=Ve();if(Ze&&t.model&&Ze===t.model)process.stderr.write(x.red(`Error: Fallback model cannot be the same as the main model. Please specify a different model for --fallback-model.
25894
25894
  `)),process.exit(1);let nn=t.systemPrompt;if(t.systemPromptFile){if(t.systemPrompt)process.stderr.write(x.red(`Error: Cannot use both --system-prompt and --system-prompt-file. Please use only one.
25895
25895
  `)),process.exit(1);try{let s=On(t.systemPromptFile);nn=Ja(s,"utf8")}catch(s){if(Ea(s)==="ENOENT")process.stderr.write(x.red(`Error: System prompt file not found: ${On(t.systemPromptFile)}
25896
25896
  `)),process.exit(1);process.stderr.write(x.red(`Error reading system prompt file: ${H(s)}
25897
25897
  `)),process.exit(1)}}let ee=t.appendSystemPrompt;if(t.appendSystemPromptFile){if(t.appendSystemPrompt)process.stderr.write(x.red(`Error: Cannot use both --append-system-prompt and --append-system-prompt-file. Please use only one.
25898
25898
  `)),process.exit(1);try{let s=On(t.appendSystemPromptFile);ee=Ja(s,"utf8")}catch(s){if(Ea(s)==="ENOENT")process.stderr.write(x.red(`Error: Append system prompt file not found: ${On(t.appendSystemPromptFile)}
25899
25899
  `)),process.exit(1);process.stderr.write(x.red(`Error reading append system prompt file: ${H(s)}
25900
- `)),process.exit(1)}}if(wn()&&ve?.agentId&&ve?.agentName&&ve?.teamName){let s=cg().TEAMMATE_SYSTEM_PROMPT_ADDENDUM;ee=ee?`${ee}
25900
+ `)),process.exit(1)}}if(wn()&&ve?.agentId&&ve?.agentName&&ve?.teamName){let s=mg().TEAMMATE_SYSTEM_PROMPT_ADDENDUM;ee=ee?`${ee}
25901
25901
 
25902
- ${s}`:s}let{mode:tn,notification:pi}=Dd({permissionModeCli:Ie,dangerouslySkipPermissions:R});Cl(tn==="bypassPermissions");let re={};if(Xe&&Xe.length>0){let s=Xe.map((C)=>C.trim()).filter((C)=>C.length>0),d={},k=[];for(let C of s){let X=null,S=[],Y=Et(C);if(Y){let O=Bc({configObject:Y,filePath:"command line",expandVars:!0,scope:"dynamic"});if(O.config)X=O.config.mcpServers;else S=O.errors}else{let O=On(C),w=Gc({filePath:O,expandVars:!0,scope:"dynamic"});if(w.config)X=w.config.mcpServers;else S=w.errors}if(S.length>0)k.push(...S);else if(X)d={...d,...X}}if(k.length>0){let C=k.map((X)=>`${X.path?X.path+": ":""}${X.message}`).join(`
25902
+ ${s}`:s}let{mode:tn,notification:pi}=Md({permissionModeCli:Ie,dangerouslySkipPermissions:D});Xl(tn==="bypassPermissions");let re={};if(Xe&&Xe.length>0){let s=Xe.map((C)=>C.trim()).filter((C)=>C.length>0),d={},k=[];for(let C of s){let X=null,S=[],Y=Et(C);if(Y){let O=qc({configObject:Y,filePath:"command line",expandVars:!0,scope:"dynamic"});if(O.config)X=O.config.mcpServers;else S=O.errors}else{let O=On(C),w=Wc({filePath:O,expandVars:!0,scope:"dynamic"});if(w.config)X=w.config.mcpServers;else S=w.errors}if(S.length>0)k.push(...S);else if(X)d={...d,...X}}if(k.length>0){let C=k.map((X)=>`${X.path?X.path+": ":""}${X.message}`).join(`
25903
25903
  `);h(`--mcp-config validation failed (${k.length} errors): ${C}`,{level:"error"}),process.stderr.write(`Error: Invalid MCP configuration:
25904
25904
  ${C}
25905
- `),process.exit(1)}if(Object.keys(d).length>0){let C=Object.entries(d).filter(([,w])=>w.type!=="sdk").map(([w])=>w),X=null;if(C.some(Oc))X=`Invalid MCP configuration: "${Nc}" is a reserved MCP name.`;else{let{isComputerUseMCPServer:w,COMPUTER_USE_MCP_SERVER_NAME:E}=await import("./common-jn8w5r1w.js");if(C.some(w))X=`Invalid MCP configuration: "${E}" is a reserved MCP name.`}if(X)process.stderr.write(`Error: ${X}
25906
- `),process.exit(1);let S=og(d,(w)=>({...w,scope:"dynamic"})),{allowed:Y,blocked:O}=Ba(S);if(O.length>0)process.stderr.write(`Warning: MCP ${Fn(O.length,"server")} blocked by enterprise policy: ${O.join(", ")}
25907
- `);re={...re,...Y}}}let mi=t;kl(mi.chrome);let _t=Bd(mi.chrome)&&sc(),ou=!_t&&bn();if(_t){let s=et();try{f("tengu_claude_in_chrome_setup",{platform:s});let{mcpConfig:d,allowedTools:k,systemPrompt:C}=Ua();if(re={...re,...d},ie.push(...k),C)ee=ee?`${C}
25905
+ `),process.exit(1)}if(Object.keys(d).length>0){let C=Object.entries(d).filter(([,w])=>w.type!=="sdk").map(([w])=>w),X=null;if(C.some(Lc))X=`Invalid MCP configuration: "${Fc}" is a reserved MCP name.`;else{let{isComputerUseMCPServer:w,COMPUTER_USE_MCP_SERVER_NAME:E}=await import("./common-0bee37at.js");if(C.some(w))X=`Invalid MCP configuration: "${E}" is a reserved MCP name.`}if(X)process.stderr.write(`Error: ${X}
25906
+ `),process.exit(1);let S=ug(d,(w)=>({...w,scope:"dynamic"})),{allowed:Y,blocked:O}=Ba(S);if(O.length>0)process.stderr.write(`Warning: MCP ${Fn(O.length,"server")} blocked by enterprise policy: ${O.join(", ")}
25907
+ `);re={...re,...Y}}}let mi=t;Tl(mi.chrome);let _t=qd(mi.chrome)&&lc(),cu=!_t&&bn();if(_t){let s=et();try{f("tengu_claude_in_chrome_setup",{platform:s});let{mcpConfig:d,allowedTools:k,systemPrompt:C}=Ua();if(re={...re,...d},ie.push(...k),C)ee=ee?`${C}
25908
25908
 
25909
- ${ee}`:C}catch(d){f("tengu_claude_in_chrome_setup_failed",{platform:s}),h(`[Claude in Chrome] Error: ${d}`),V(d),console.error("Error: Failed to run with Claude in Chrome."),process.exit(1)}}else if(ou)try{let{mcpConfig:s}=Ua();re={...re,...s};let d=Ad;ee=ee?`${ee}
25909
+ ${ee}`:C}catch(d){f("tengu_claude_in_chrome_setup_failed",{platform:s}),h(`[Claude in Chrome] Error: ${d}`),V(d),console.error("Error: Failed to run with Claude in Chrome."),process.exit(1)}}else if(cu)try{let{mcpConfig:s}=Ua();re={...re,...s};let d=Ed;ee=ee?`${ee}
25910
25910
 
25911
- ${d}`:d}catch(s){h(`[Claude in Chrome] Error (auto-enable): ${s}`)}let qn=t.strictMcpConfig||!1;if(Ga()){if(qn)process.stderr.write(x.red("You cannot use --strict-mcp-config when an enterprise MCP config is present")),process.exit(1);if(re&&!qc(re))process.stderr.write(x.red("You cannot dynamically configure MCP servers when an enterprise MCP config is present")),process.exit(1)}if(process.platform==="darwin"||process.platform==="win32")try{let{getChicagoEnabled:s}=await import("./gates-85t459a0.js"),d=t.computerUse!==!1;if(s()&&d){let{loadStoredComputerUseConfig:k}=await import("./preauthorizedConfig-g0aq6f03.js");if(!(await k()).enabled)h("[Computer Use MCP] Skipped: disabled in computer-use-config.json");else{let{setupComputerUseMCP:X}=await import("./setup-2hqyyxff.js"),{mcpConfig:S,allowedTools:Y}=X();re={...re,...S},ie.push(...Y)}}else if(!d)h("[Computer Use MCP] Skipped: disabled by --no-computer-use")}catch(s){h(`[Computer Use MCP] Setup failed: ${H(s)}`)}try{let{setupSolidworksMCP:s}=await import("./setup-mecsw2ye.js"),d=s();if(d)re={...re,...d.mcpConfig},h("[SolidWorks MCP] Registered built-in server")}catch(s){h(`[SolidWorks MCP] Setup failed: ${H(s)}`)}El(he);let lu,hi=await Pd({allowedToolsCli:ie,disallowedToolsCli:De,baseToolsCli:ye,permissionMode:tn,allowDangerouslySkipPermissions:G,addDirs:he}),Be=hi.toolPermissionContext,{warnings:cu,dangerousPermissions:Eg,overlyBroadBashPermissions:Bt}=hi;cu.forEach((s)=>{console.error(s)}),ad();let gi=ue&&!qn&&!Ga()&&!Re()?Fc().then((s)=>{let{allowed:d,blocked:k}=Ba(s);if(k.length>0)process.stderr.write(`Warning: claude.ai MCP ${Fn(k.length,"server")} blocked by enterprise policy: ${k.join(", ")}
25912
- `);return d}):Promise.resolve({});h("[STARTUP] Loading MCP configs...");let fi=Date.now(),yi,du=(qn||Re()?Promise.resolve({servers:{}}):_c(re)).then((s)=>{return yi=Date.now()-fi,s});if(be&&be!=="text"&&be!=="stream-json")console.error(`Error: Invalid input format "${be}".`),process.exit(1);if(be==="stream-json"&&Ae!=="stream-json")console.error("Error: --input-format=stream-json requires output-format=stream-json."),process.exit(1);if(Cn){if(be!=="stream-json"||Ae!=="stream-json")console.error("Error: --sdk-url requires both --input-format=stream-json and --output-format=stream-json."),process.exit(1)}if(t.replayUserMessages){if(be!=="stream-json"||Ae!=="stream-json")console.error("Error: --replay-user-messages requires both --input-format=stream-json and --output-format=stream-json."),process.exit(1)}if(ci){if(!ue||Ae!=="stream-json")xa("Error: --include-partial-messages requires --print and --output-format=stream-json."),process.exit(1)}if(t.sessionPersistence===!1&&!ue)xa("Error: --no-session-persistence can only be used with --print mode."),process.exit(1);let ge=await Cg(r||"",be??"text");v("action_after_input_prompt"),yt(t);let Gt=Td(Be);v("action_tools_loaded");let an;if(Dc({isNonInteractiveSession:ue})&&t.jsonSchema)an=Rl(t.jsonSchema);if(an){let s=Pc(an);if("tool"in s)Gt=[...Gt,s.tool],f("tengu_structured_output_enabled",{schema_property_count:Object.keys(an.properties||{}).length,has_required_fields:Boolean(an.required)});else f("tengu_structured_output_failure",{error:"Invalid JSON schema"})}v("action_before_setup"),h("[STARTUP] Running setup()...");let uu=Date.now(),pu=void 0,rn=_n();if(process.env.CLAUDE_CODE_ENTRYPOINT!=="local-agent")cs(),Ao();let mu=process.env.CLAUDE_CODE_LOCAL_RECOVERY==="1"?(async()=>{Xa(rn),dl(rn),h("[STARTUP] setup() skipped in local recovery mode")})():(async()=>{let{setup:s}=await import("./setup-0n2p20yw.js");await s(rn,tn,G,Qe,Gn,li,kn?Ct(kn):void 0,oi,ru,pu)})(),bi=Qe?null:Ka(rn),vi=Qe?null:Fa(rn);bi?.catch(()=>{}),vi?.catch(()=>{}),await mu,h(`[STARTUP] setup() completed in ${Date.now()-uu}ms`),v("action_after_setup");let hu=!!t.replayUserMessages;if(Ve())Ne(),fn(),ei(),Ul();let Wn=t.name?.trim();if(Wn)$d(Wn);let Ig=t.model||process.env.ANTHROPIC_MODEL,gu=t.model==="default"?Ln():t.model,fu=Ze==="default"?Ln():Ze,qt=Qe?_n():rn;h("[STARTUP] Loading commands and agents...");let yu=Date.now(),[$n,wi]=await Promise.all([bi??Ka(qt),vi??Fa(qt)]);h(`[STARTUP] Commands and agents loaded in ${Date.now()-yu}ms`),v("action_commands_loaded");let Wt=[];if(ai)try{let s=Et(ai);if(s)Wt=Ac(s,"flagSettings")}catch(s){V(s)}let ki=[...wi.allAgents,...Wt],sn={...wi,allAgents:ki,activeAgents:Xc(ki)},Vn=Dt??Je().agent,I;if(Vn){if(I=sn.activeAgents.find((s)=>s.agentType===Vn),!I)h(`Warning: agent "${Vn}" not found. Available agents: ${sn.activeAgents.map((s)=>s.agentType).join(", ")}. Using default behavior.`)}if(Al(I?.agentType),I)f("tengu_agent_flag",{agentType:Oa(I)?I.agentType:"custom",...Dt&&{source:"cli"}});if(I?.agentType)Wd(I.agentType);if(ue&&I&&!nn&&!Oa(I)){let s=I.getSystemPrompt();if(s)nn=s}if(I?.initialPrompt){if(typeof ge==="string")ge=ge?`${I.initialPrompt}
25911
+ ${d}`:d}catch(s){h(`[Claude in Chrome] Error (auto-enable): ${s}`)}let qn=t.strictMcpConfig||!1;if(Ga()){if(qn)process.stderr.write(x.red("You cannot use --strict-mcp-config when an enterprise MCP config is present")),process.exit(1);if(re&&!$c(re))process.stderr.write(x.red("You cannot dynamically configure MCP servers when an enterprise MCP config is present")),process.exit(1)}if(process.platform==="darwin"||process.platform==="win32")try{let{getChicagoEnabled:s}=await import("./gates-yhakv4vb.js"),d=t.computerUse!==!1;if(s()&&d){let{loadStoredComputerUseConfig:k}=await import("./preauthorizedConfig-p02f23jb.js");if(!(await k()).enabled)h("[Computer Use MCP] Skipped: disabled in computer-use-config.json");else{let{setupComputerUseMCP:X}=await import("./setup-fwcttwbm.js"),{mcpConfig:S,allowedTools:Y}=X();re={...re,...S},ie.push(...Y)}}else if(!d)h("[Computer Use MCP] Skipped: disabled by --no-computer-use")}catch(s){h(`[Computer Use MCP] Setup failed: ${H(s)}`)}try{let{setupSolidworksMCP:s}=await import("./setup-vegs56f5.js"),d=s();if(d)re={...re,...d.mcpConfig},h("[SolidWorks MCP] Registered built-in server")}catch(s){h(`[SolidWorks MCP] Setup failed: ${H(s)}`)}Il(he);let du,hi=await Nd({allowedToolsCli:ie,disallowedToolsCli:De,baseToolsCli:ye,permissionMode:tn,allowDangerouslySkipPermissions:G,addDirs:he}),Be=hi.toolPermissionContext,{warnings:uu,dangerousPermissions:Dg,overlyBroadBashPermissions:Bt}=hi;uu.forEach((s)=>{console.error(s)}),rd();let gi=me&&!qn&&!Ga()&&!Re()?_c().then((s)=>{let{allowed:d,blocked:k}=Ba(s);if(k.length>0)process.stderr.write(`Warning: claude.ai MCP ${Fn(k.length,"server")} blocked by enterprise policy: ${k.join(", ")}
25912
+ `);return d}):Promise.resolve({});h("[STARTUP] Loading MCP configs...");let fi=Date.now(),yi,pu=(qn||Re()?Promise.resolve({servers:{}}):Gc(re)).then((s)=>{return yi=Date.now()-fi,s});if(be&&be!=="text"&&be!=="stream-json")console.error(`Error: Invalid input format "${be}".`),process.exit(1);if(be==="stream-json"&&Ae!=="stream-json")console.error("Error: --input-format=stream-json requires output-format=stream-json."),process.exit(1);if(Cn){if(be!=="stream-json"||Ae!=="stream-json")console.error("Error: --sdk-url requires both --input-format=stream-json and --output-format=stream-json."),process.exit(1)}if(t.replayUserMessages){if(be!=="stream-json"||Ae!=="stream-json")console.error("Error: --replay-user-messages requires both --input-format=stream-json and --output-format=stream-json."),process.exit(1)}if(ci){if(!me||Ae!=="stream-json")xa("Error: --include-partial-messages requires --print and --output-format=stream-json."),process.exit(1)}if(t.sessionPersistence===!1&&!me)xa("Error: --no-session-persistence can only be used with --print mode."),process.exit(1);let ge=await Sg(r||"",be??"text");v("action_after_input_prompt"),yt(t);let Gt=Ad(Be);v("action_tools_loaded");let an;if(Mc({isNonInteractiveSession:me})&&t.jsonSchema)an=Pl(t.jsonSchema);if(an){let s=Nc(an);if("tool"in s)Gt=[...Gt,s.tool],f("tengu_structured_output_enabled",{schema_property_count:Object.keys(an.properties||{}).length,has_required_fields:Boolean(an.required)});else f("tengu_structured_output_failure",{error:"Invalid JSON schema"})}v("action_before_setup"),h("[STARTUP] Running setup()...");let mu=Date.now(),hu=void 0,rn=_n();if(process.env.CLAUDE_CODE_ENTRYPOINT!=="local-agent")cs(),Eo();let gu=process.env.CLAUDE_CODE_LOCAL_RECOVERY==="1"?(async()=>{Xa(rn),pl(rn),h("[STARTUP] setup() skipped in local recovery mode")})():(async()=>{let{setup:s}=await import("./setup-pf09nfsj.js");await s(rn,tn,G,Qe,Gn,li,kn?Ct(kn):void 0,oi,ou,hu)})(),bi=Qe?null:Ka(rn),vi=Qe?null:Fa(rn);bi?.catch(()=>{}),vi?.catch(()=>{}),await gu,h(`[STARTUP] setup() completed in ${Date.now()-mu}ms`),v("action_after_setup");let fu=!!t.replayUserMessages;if(Ve())Ne(),fn(),ei(),jl();let Wn=t.name?.trim();if(Wn)Yd(Wn);let Mg=t.model||process.env.ANTHROPIC_MODEL,yu=t.model==="default"?Ln():t.model,bu=Ze==="default"?Ln():Ze,qt=Qe?_n():rn;h("[STARTUP] Loading commands and agents...");let vu=Date.now(),[$n,wi]=await Promise.all([bi??Ka(qt),vi??Fa(qt)]);h(`[STARTUP] Commands and agents loaded in ${Date.now()-vu}ms`),v("action_commands_loaded");let Wt=[];if(ai)try{let s=Et(ai);if(s)Wt=Ec(s,"flagSettings")}catch(s){V(s)}let ki=[...wi.allAgents,...Wt],sn={...wi,allAgents:ki,activeAgents:Sc(ki)},Vn=Dt??Je().agent,I;if(Vn){if(I=sn.activeAgents.find((s)=>s.agentType===Vn),!I)h(`Warning: agent "${Vn}" not found. Available agents: ${sn.activeAgents.map((s)=>s.agentType).join(", ")}. Using default behavior.`)}if(El(I?.agentType),I)f("tengu_agent_flag",{agentType:Oa(I)?I.agentType:"custom",...Dt&&{source:"cli"}});if(I?.agentType)Vd(I.agentType);if(me&&I&&!nn&&!Oa(I)){let s=I.getSystemPrompt();if(s)nn=s}if(I?.initialPrompt){if(typeof ge==="string")ge=ge?`${I.initialPrompt}
25913
25913
 
25914
- ${ge}`:I.initialPrompt;else if(!ge)ge=I.initialPrompt}let Tn=gu;if(!Tn&&I?.model&&I.model!=="inherit")Tn=_e(I.model);mt(Tn),ul(Jl()||null);let Ci=Qa(),Xn=_e(Ci??Ln()),Ge;if(Tt()){let s=Xt()?t.advisor:void 0;if(s){if(h(`[AdvisorTool] --advisor ${s}`),!Uc(Xn))process.stderr.write(x.red(`Error: The model "${Xn}" does not support the advisor tool.
25915
- `)),process.exit(1);let d=Zl(_e(s));if(!Kc(d))process.stderr.write(x.red(`Error: The model "${s}" cannot be used as an advisor.
25916
- `)),process.exit(1)}if(Ge=Xt()?s??jc():s,Ge)h(`[AdvisorTool] Advisor model: ${Ge}`)}if(wn()&&ve?.agentId&&ve?.agentName&&ve?.teamName&&ve?.agentType){let s=sn.activeAgents.find((d)=>d.agentType===ve.agentType);if(s){let d;if(s.source==="built-in")h(`[teammate] Built-in agent ${ve.agentType} - skipping custom prompt (not supported)`);else d=s.getSystemPrompt();if(s.memory)f("tengu_agent_memory_loaded",{...!1,scope:s.memory,source:"teammate"});if(d){let k=`
25914
+ ${ge}`:I.initialPrompt;else if(!ge)ge=I.initialPrompt}let Tn=yu;if(!Tn&&I?.model&&I.model!=="inherit")Tn=_e(I.model);mt(Tn),ml(Ql()||null);let Ci=Qa(),Xn=_e(Ci??Ln()),Ge;if(Tt()){let s=Xt()?t.advisor:void 0;if(s){if(h(`[AdvisorTool] --advisor ${s}`),!jc(Xn))process.stderr.write(x.red(`Error: The model "${Xn}" does not support the advisor tool.
25915
+ `)),process.exit(1);let d=ec(_e(s));if(!Jc(d))process.stderr.write(x.red(`Error: The model "${s}" cannot be used as an advisor.
25916
+ `)),process.exit(1)}if(Ge=Xt()?s??Zc():s,Ge)h(`[AdvisorTool] Advisor model: ${Ge}`)}if(wn()&&ve?.agentId&&ve?.agentName&&ve?.teamName&&ve?.agentType){let s=sn.activeAgents.find((d)=>d.agentType===ve.agentType);if(s){let d;if(s.source==="built-in")h(`[teammate] Built-in agent ${ve.agentType} - skipping custom prompt (not supported)`);else d=s.getSystemPrompt();if(s.memory)f("tengu_agent_memory_loaded",{...!1,scope:s.memory,source:"teammate"});if(d){let k=`
25917
25917
  # Custom Agent Instructions
25918
25918
  ${d}`;ee=ee?`${ee}
25919
25919
 
25920
- ${k}`:k}}else h(`[teammate] Custom agent ${ve.agentType} not found in available agents`)}bt(t);let q,on,ln;if(!ue){let s=is(!1);on=s.getFpsMetrics,ln=s.stats;let{createRoot:d}=await import("./ink-9vrw9yhe.js");q=await d(s.renderOptions),f("tengu_timer",{event:"startup",durationMs:Math.round(process.uptime()*1000)}),h("[STARTUP] Running showSetupScreens()...");let k=Date.now(),C=await as(q,tn,G,$n,_t,lu);if(h(`[STARTUP] showSetupScreens() completed in ${Date.now()-k}ms`),C&&r?.trim().toLowerCase()==="/login")r="";if(C)td(),ed(),cc(),pc(),import("./trustedDevice-xvtp79f1.js").then((S)=>{return S.clearTrustedDeviceToken(),S.enrollTrustedDevice()});let X=await Pa();if(!X.valid)await Ee(q,X.message)}if(process.exitCode!==void 0){h("Graceful shutdown initiated, skipping further initialization");return}if(bd(),!ue){let{errors:s}=zl(),d=s.filter((k)=>!k.mcpErrorMetadata);if(d.length>0)await rs(q,{settingsErrors:d,onExit:()=>He(1)})}let $t=wt("tengu_cicada_nap_ms",0),Yn=L().startupPrefetchedAt??0;if(!(Re()||$t>0&&Date.now()-Yn<$t)){let s=Yn>0?` last ran ${Math.round((Date.now()-Yn)/1000)}s ago`:"";if(h(`Starting background startup prefetches${s}`),Sc().catch((d)=>V(d)),kr(),_d(),!wt("tengu_miraculo_the_bard",!1))jl();else Da();if($t>0)_((d)=>({...d,startupPrefetchedAt:Date.now()}))}else h(`Skipping startup prefetches, last ran ${Math.round((Date.now()-Yn)/1000)}s ago`),Da();if(!ue)jd();let{servers:bu}=await du;h(`[STARTUP] MCP configs resolved in ${yi}ms (awaited at +${Date.now()-fi}ms)`);let Ti={...bu,...re},Xi={},cn={};for(let[s,d]of Object.entries(Ti)){let k=d;if(k.type==="sdk")Xi[s]=k;else cn[s]=k}v("action_mcp_configs_loaded");let vu=ue?Promise.resolve({clients:[],tools:[],commands:[]}):qa(cn),wu=ue?Promise.resolve({clients:[],tools:[],commands:[]}):gi.then((s)=>Object.keys(s).length>0?qa(s):{clients:[],tools:[],commands:[]}),ku=Promise.all([vu,wu]).then(([s,d])=>({clients:[...s.clients,...d.clients],tools:ft([...s.tools,...d.tools],"name"),commands:ft([...s.commands,...d.commands],"name")})),Ai=Pt||ri||si||ue||t.continue||t.resume?null:At("startup",{agentType:I?.agentType,model:Xn}),Hn=[];ku.catch(()=>{});let Si=[],Ei=[],xi=[],dn=Tc(),Pe=dn!==!1?{type:"adaptive"}:{type:"disabled"};if(t.thinking==="adaptive"||t.thinking==="enabled")dn=!0,Pe={type:"adaptive"};else if(t.thinking==="disabled")dn=!1,Pe={type:"disabled"};else{let s=process.env.MAX_THINKING_TOKENS?parseInt(process.env.MAX_THINKING_TOKENS,10):t.maxThinkingTokens;if(s!==void 0){if(s>0)dn=!0,Pe={type:"enabled",budgetTokens:s};else if(s===0)dn=!1,Pe={type:"disabled"}}}if(ce("info","started",{version:MACRO.VERSION,is_native_binary:Wl()}),Sn(async()=>{ce("info","exited")}),Xg({hasInitialPrompt:Boolean(r),hasStdin:Boolean(ge),verbose:Bn,debug:A,debugToStderr:D,print:ii??!1,outputFormat:Ae??"text",inputFormat:be??"text",numAllowedTools:ie.length,numDisallowedTools:De.length,mcpClientCount:Object.keys(Ti).length,worktreeEnabled:Qe,skipWebFetchPreflight:Je().skipWebFetchPreflight,githubActionInputs:process.env.GITHUB_ACTION_INPUTS,dangerouslySkipPermissionsPassed:R??!1,permissionMode:tn,modeIsBypass:tn==="bypassPermissions",allowDangerouslySkipPermissionsPassed:G,systemPromptFlag:nn?t.systemPromptFile?"file":"flag":void 0,appendSystemPromptFlag:ee?t.appendSystemPromptFile?"file":"flag":void 0,thinkingConfig:Pe,assistantActivationPath:void 0}),Kd(cn,Be),Xd(null,"initialization"),pg(),wd().then((s)=>{if(!s)return;if(Wn)kd(Wn);Cd().then((d)=>{if(d>=2)f("tengu_concurrent_sessions",{num_sessions:d})})}),Re());else if(ue)await Ya(),v("action_after_plugins_init"),Va().then(()=>$a());else Ya().then(async()=>{v("action_after_plugins_init"),await Va(),$a()});let Ii=Pt||ri?"init":si?"maintenance":null;if(Pt){Ne(),await cd("init",{forceSyncExecution:!0}),await At("startup",{forceSyncExecution:!0}),He(0);return}if(ue){if(Ae==="stream-json"||Ae==="json")Ol(!0);Ne(),Kn();let s=t.continue||t.resume||de||Ii?void 0:At("startup");s?.catch(()=>{}),v("before_validateForceLoginOrg");let d=await Pa();if(!d.valid)process.stderr.write(d.message+`
25921
- `),process.exit(1);let k=Mt?[]:Xr($n),C=Rc(),X={...C,mcp:{...C.mcp,clients:Si,commands:xi,tools:Ei},toolPermissionContext:Be,effortValue:Ma(t.effort)??Na(),...Kl()&&{fastMode:Ra(Tn??null)},...Tt()&&Ge&&{advisorModel:Ge},...{}},S=vc(X,Rn);if(Be.mode==="bypassPermissions"||G)Md(Be);if(t.sessionPersistence===!1)Tl(!0);ml(nc(xt));let Y=(F,se)=>{if(Object.keys(F).length===0)return Promise.resolve();return S.setState(($)=>({...$,mcp:{...$.mcp,clients:[...$.mcp.clients,...Object.entries(F).map(([le,z])=>({name:le,type:"pending",config:z}))]}})),Hc(({client:$,tools:le,commands:z})=>{S.setState((P)=>({...P,mcp:{...P.mcp,clients:P.mcp.clients.some((te)=>te.name===$.name)?P.mcp.clients.map((te)=>te.name===$.name?$:te):[...P.mcp.clients,$],tools:ft([...P.mcp.tools,...le],"name"),commands:ft([...P.mcp.commands,...z],"name")}}))},F).catch(($)=>h(`[MCP] ${se} connect error: ${$}`))},O=()=>{let F=process.env.CC_HAHA_DESKTOP_AWAIT_MCP_TIMEOUT_MS;if(F===void 0)return 5000;let se=Number.parseInt(F,10);if(!Number.isFinite(se)||se<0)return 5000;return se},w=async(F,se)=>{let $=O();if($===0)return;let le,z=await Promise.race([F.then(()=>!1),new Promise((P)=>{le=setTimeout(P,$,!0)})]);if(le)clearTimeout(le);if(z)h(`[MCP] ${se} servers not ready after ${$}ms \u2014 proceeding; background connection continues`)};v("before_connectMcp");let E=Y(cn,"regular");if(Cn){if(process.env.CC_HAHA_DESKTOP_AWAIT_MCP==="1")await w(E,"regular MCP")}else await E;v("after_connectMcp");let ne=5000,W=gi.then((F)=>{if(Object.keys(F).length>0){let le=new Set;for(let P of Object.values(F)){let te=_a(P);if(te)le.add(te)}let z=new Set;for(let[P,te]of Object.entries(cn)){if(!P.startsWith("plugin:"))continue;let un=_a(te);if(un&&le.has(un))z.add(P)}if(z.size>0){h(`[MCP] Lazy dedup: suppressing ${z.size} plugin server(s) that duplicate claude.ai connectors: ${[...z].join(", ")}`);for(let P of S.getState().mcp.clients){if(!z.has(P.name)||P.type!=="connected")continue;P.client.onclose=void 0,Yc(P.name,P.config).catch(()=>{})}S.setState((P)=>{let{clients:te,tools:un,commands:Vt,resources:Yt}=P.mcp;te=te.filter((We)=>!z.has(We.name)),un=un.filter((We)=>!We.mcpInfo||!z.has(We.mcpInfo.serverName));for(let We of z)Vt=Wc(Vt,We),Yt=$c(Yt,We);return{...P,mcp:{...P.mcp,clients:te,tools:un,commands:Vt,resources:Yt}}})}}let se=lg(cn,(le,z)=>!z.startsWith("plugin:")),{servers:$}=Lc(F,se);return Y($,"claudeai")}),j,qe=await Promise.race([W.then(()=>!1),new Promise((F)=>{j=setTimeout((se)=>se(!0),ne,F)})]);if(j)clearTimeout(j);if(qe)h(`[MCP] claude.ai connectors not ready after ${ne}ms \u2014 proceeding; background connection continues`);if(v("after_connectMcp_claudeai"),!Re())la(),import("./backgroundHousekeeping-wk8ne1wg.js").then((F)=>F.startBackgroundHousekeeping());sl(),v("before_print_import");let{runHeadless:Me}=await import("./print-cjjnhg9d.js");v("after_print_import"),Me(ge,()=>S.getState(),S.setState,k,Gt,Xi,sn.activeAgents,{continue:t.continue,resume:t.resume,verbose:Bn,outputFormat:Ae,jsonSchema:an,permissionPromptToolName:t.permissionPromptTool,allowedTools:ie,thinkingConfig:Pe,maxTurns:t.maxTurns,maxBudgetUsd:t.maxBudgetUsd,taskBudget:t.taskBudget?{total:t.taskBudget}:void 0,systemPrompt:nn,appendSystemPrompt:ee,userSpecifiedModel:Tn,fallbackModel:fu,teleport:de,sdkUrl:Cn,replayUserMessages:hu,includePartialMessages:ci,forkSession:t.forkSession||!1,resumeSessionAt:t.resumeSessionAt||void 0,rewindFiles:t.rewindFiles,enableAuthStatus:t.enableAuthStatus,agent:Dt,workload:t.workload,setupTrigger:Ii??void 0,sessionStartHooksPromise:s});return}f("tengu_startup_manual_model_config",{cli_flag:t.model,env_var:process.env.ANTHROPIC_MODEL,settings_file:(Je()||{}).model,subscriptionType:oc(),agent:Vn});let Ri=nu(Xn),zn=[];if(pi)zn.push({key:"permission-mode-notification",text:pi,priority:"high"});if(Ri)zn.push({key:"model-deprecation-warning",text:Ri,color:"warning",priority:"high"});if(Bt.length>0){let s=Ia(Bt.map((X)=>X.ruleDisplay)),d=s.join(", "),k=Ia(Bt.map((X)=>X.sourceDisplay)).join(", "),C=s.length;zn.push({key:"overly-broad-bash-notification",text:`${d} allow ${Fn(C,"rule")} from ${k} ${Fn(C,"was","were")} ignored \u2014 not available for Ants, please use auto-mode instead`,color:"warning",priority:"high"})}let Cu={...Be,mode:wn()&&rl().isPlanModeRequired()?"plan":Be.mode},Tu=!1,Xu=ui||mc()||c,Di=!1,An={settings:Je(),tasks:{},agentNameRegistry:new Map,verbose:Bn??L().verbose??!1,mainLoopModel:Ci,mainLoopModelForSession:null,isBriefOnly:Tu,expandedView:L().showSpinnerTree?"teammates":L().showExpandedTodos?"tasks":"none",showTeammateMessagePreview:wn()?!1:void 0,selectedIPAgentIndex:-1,coordinatorTaskIndex:-1,viewSelectionMode:"none",footerSelection:null,toolPermissionContext:Cu,agent:I?.agentType,agentDefinitions:sn,mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:0},plugins:{enabled:[],disabled:[],commands:[],errors:[],installationStatus:{marketplaces:[],plugins:[]},needsRefresh:!1},statusLineText:void 0,kairosEnabled:c,remoteSessionUrl:void 0,remoteConnectionStatus:"connecting",remoteBackgroundTaskCount:0,replBridgeEnabled:Xu||Di,replBridgeExplicit:ui,replBridgeOutboundOnly:Di,replBridgeConnected:!1,replBridgeSessionActive:!1,replBridgeReconnecting:!1,replBridgeConnectUrl:void 0,replBridgeSessionUrl:void 0,replBridgeEnvironmentId:void 0,replBridgeSessionId:void 0,replBridgeError:void 0,replBridgeInitialName:su,showRemoteCallout:!1,notifications:{current:null,queue:zn},elicitation:{queue:[]},todos:{},remoteAgentTaskSuggestions:[],fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},attribution:xc(),thinkingEnabled:dn,promptSuggestionEnabled:Ec(),sessionHooks:new Map,inbox:{messages:[]},promptSuggestion:{text:null,promptId:null,shownAt:0,acceptedAt:0,generationRequestId:null},speculation:Ic,speculationSessionTimeSavedMs:0,skillImprovement:{suggestion:null},workerSandboxPermissions:{queue:[],selectedIndex:0},pendingWorkerRequest:null,pendingSandboxRequest:null,authVersion:0,initialMessage:ge?{message:Ha({content:String(ge)})}:null,effortValue:Ma(t.effort)??Na(),activeOverlays:new Set,fastMode:Ra(Xn),...Tt()&&Ge&&{advisorModel:Ge},teamContext:Zd?.()};if(ge)Nd(String(ge));let Au=Ei;_((s)=>({...s,numStartups:(s.numStartups??0)+1})),setImmediate(()=>{gg(),sl()});let Pi=null,Mi=Pi?Pi.then((s)=>s.createSessionTurnUploader()).catch(()=>null):null,Un={debug:A||D,commands:[...$n,...xi],initialTools:Au,mcpClients:Si,autoConnectIdeFlag:It,mainThreadAgentDefinition:I,disableSlashCommands:Mt,dynamicMcpConfig:re,strictMcpConfig:qn,systemPrompt:nn,appendSystemPrompt:ee,taskListId:iu,thinkingConfig:Pe,...Mi&&{onTurnComplete:(s)=>{Mi.then((d)=>d?.(s))}}},Ni={modeApi:ug,mainThreadAgentDefinition:I,agentDefinitions:sn,currentCwd:qt,cliAgents:Wt,initialState:An};if(t.continue){let s=!1;try{let d=performance.now(),{clearSessionCaches:k}=await import("./caches-g4cc992y.js");k();let C=await Wa(void 0,void 0);if(!C)return f("tengu_continue",{success:!1}),await Ee(q,"No conversation found to continue");let X=await ja(C,{forkSession:!!t.forkSession,includeAttribution:!0,transcriptPath:C.fullPath},Ni);if(X.restoredAgentDef)I=X.restoredAgentDef;yt(t),bt(t),f("tengu_continue",{success:!0,resume_duration_ms:Math.round(performance.now()-d)}),s=!0,await xn(q,{getFpsMetrics:on,stats:ln,initialState:X.initialState},{...Un,mainThreadAgentDefinition:X.restoredAgentDef??I,initialMessages:X.messages,initialFileHistorySnapshots:X.fileHistorySnapshots,initialContentReplacements:X.contentReplacements,initialAgentName:X.agentName,initialAgentColor:X.agentColor},Ke)}catch(d){if(!s)f("tengu_continue",{success:!1});V(d),process.exit(1)}}else if(t.resume||t.fromPr||de||en!==null){let{clearSessionCaches:s}=await import("./caches-g4cc992y.js");s();let d=null,k=void 0,C=Ct(t.resume),X=void 0,S=null,Y=void 0;if(t.fromPr){if(t.fromPr===!0)Y=!0;else if(typeof t.fromPr==="string")Y=t.fromPr}if(t.resume&&typeof t.resume==="string"&&!C){let w=t.resume.trim();if(w){let E=await Yd(w,{exact:!0});if(E.length===1)S=E[0],C=Vd(S)??null;else X=w}}if(en!==null||de){if(await Jc(),!Zc("allow_remote_sessions"))return await Ee(q,"Error: Remote sessions are disabled by your organization's policy.",()=>Ce(1))}if(en!==null){let w=en.length>0,E=wt("tengu_remote_backend",!1);if(!E&&!w)return await Ee(q,`Error: --remote requires a description.
25922
- Usage: claude --remote "your task description"`,()=>Ce(1));f("tengu_remote_create_session",{has_initial_prompt:String(w)});let ne=await _l(),W=await yd(q,w?en:null,new AbortController().signal,ne||void 0);if(!W)return f("tengu_remote_create_session_error",{error:"unable_to_create_session"}),await Ee(q,"Error: Unable to create remote session",()=>Ce(1));if(f("tengu_remote_create_session_success",{session_id:W.id}),!E)process.stdout.write(`Created remote session: ${W.title}
25920
+ ${k}`:k}}else h(`[teammate] Custom agent ${ve.agentType} not found in available agents`)}bt(t);let q,on,ln;if(!me){let s=is(!1);on=s.getFpsMetrics,ln=s.stats;let{createRoot:d}=await import("./ink-vkxsn90v.js");q=await d(s.renderOptions),f("tengu_timer",{event:"startup",durationMs:Math.round(process.uptime()*1000)}),h("[STARTUP] Running showSetupScreens()...");let k=Date.now(),C=await as(q,tn,G,$n,_t,du);if(h(`[STARTUP] showSetupScreens() completed in ${Date.now()-k}ms`),C&&r?.trim().toLowerCase()==="/login")r="";if(C)id(),td(),uc(),hc(),import("./trustedDevice-77ketbgg.js").then((S)=>{return S.clearTrustedDeviceToken(),S.enrollTrustedDevice()});let X=await Pa();if(!X.valid)await Ee(q,X.message)}if(process.exitCode!==void 0){h("Graceful shutdown initiated, skipping further initialization");return}if(wd(),!me){let{errors:s}=Kl(),d=s.filter((k)=>!k.mcpErrorMetadata);if(d.length>0)await rs(q,{settingsErrors:d,onExit:()=>He(1)})}let $t=wt("tengu_cicada_nap_ms",0),Yn=L().startupPrefetchedAt??0;if(!(Re()||$t>0&&Date.now()-Yn<$t)){let s=Yn>0?` last ran ${Math.round((Date.now()-Yn)/1000)}s ago`:"";if(h(`Starting background startup prefetches${s}`),xc().catch((d)=>V(d)),kr(),Gd(),!wt("tengu_miraculo_the_bard",!1))Zl();else Da();if($t>0)_((d)=>({...d,startupPrefetchedAt:Date.now()}))}else h(`Skipping startup prefetches, last ran ${Math.round((Date.now()-Yn)/1000)}s ago`),Da();if(!me)Zd();let{servers:wu}=await pu;h(`[STARTUP] MCP configs resolved in ${yi}ms (awaited at +${Date.now()-fi}ms)`);let Ti={...wu,...re},Xi={},cn={};for(let[s,d]of Object.entries(Ti)){let k=d;if(k.type==="sdk")Xi[s]=k;else cn[s]=k}v("action_mcp_configs_loaded");let ku=me?Promise.resolve({clients:[],tools:[],commands:[]}):qa(cn),Cu=me?Promise.resolve({clients:[],tools:[],commands:[]}):gi.then((s)=>Object.keys(s).length>0?qa(s):{clients:[],tools:[],commands:[]}),Tu=Promise.all([ku,Cu]).then(([s,d])=>({clients:[...s.clients,...d.clients],tools:ft([...s.tools,...d.tools],"name"),commands:ft([...s.commands,...d.commands],"name")})),Ai=Pt||ri||si||me||t.continue||t.resume?null:At("startup",{agentType:I?.agentType,model:Xn}),Hn=[];Tu.catch(()=>{});let Si=[],Ei=[],xi=[],dn=Ac(),Pe=dn!==!1?{type:"adaptive"}:{type:"disabled"};if(t.thinking==="adaptive"||t.thinking==="enabled")dn=!0,Pe={type:"adaptive"};else if(t.thinking==="disabled")dn=!1,Pe={type:"disabled"};else{let s=process.env.MAX_THINKING_TOKENS?parseInt(process.env.MAX_THINKING_TOKENS,10):t.maxThinkingTokens;if(s!==void 0){if(s>0)dn=!0,Pe={type:"enabled",budgetTokens:s};else if(s===0)dn=!1,Pe={type:"disabled"}}}if(ce("info","started",{version:MACRO.VERSION,is_native_binary:Vl()}),Sn(async()=>{ce("info","exited")}),xg({hasInitialPrompt:Boolean(r),hasStdin:Boolean(ge),verbose:Bn,debug:A,debugToStderr:P,print:ii??!1,outputFormat:Ae??"text",inputFormat:be??"text",numAllowedTools:ie.length,numDisallowedTools:De.length,mcpClientCount:Object.keys(Ti).length,worktreeEnabled:Qe,skipWebFetchPreflight:Je().skipWebFetchPreflight,githubActionInputs:process.env.GITHUB_ACTION_INPUTS,dangerouslySkipPermissionsPassed:D??!1,permissionMode:tn,modeIsBypass:tn==="bypassPermissions",allowDangerouslySkipPermissionsPassed:G,systemPromptFlag:nn?t.systemPromptFile?"file":"flag":void 0,appendSystemPromptFlag:ee?t.appendSystemPromptFile?"file":"flag":void 0,thinkingConfig:Pe,assistantActivationPath:void 0}),Jd(cn,Be),Sd(null,"initialization"),fg(),Cd().then((s)=>{if(!s)return;if(Wn)Td(Wn);Xd().then((d)=>{if(d>=2)f("tengu_concurrent_sessions",{num_sessions:d})})}),Re());else if(me)await Ya(),v("action_after_plugins_init"),Va().then(()=>$a());else Ya().then(async()=>{v("action_after_plugins_init"),await Va(),$a()});let Ii=Pt||ri?"init":si?"maintenance":null;if(Pt){Ne(),await ud("init",{forceSyncExecution:!0}),await At("startup",{forceSyncExecution:!0}),He(0);return}if(me){if(Ae==="stream-json"||Ae==="json")Ll(!0);Ne(),Kn();let s=t.continue||t.resume||pe||Ii?void 0:At("startup");s?.catch(()=>{}),v("before_validateForceLoginOrg");let d=await Pa();if(!d.valid)process.stderr.write(d.message+`
25921
+ `),process.exit(1);let k=Mt?[]:Xr($n),C=Pc(),X={...C,mcp:{...C.mcp,clients:Si,commands:xi,tools:Ei},toolPermissionContext:Be,effortValue:Ma(t.effort)??Na(),...Jl()&&{fastMode:Ra(Tn??null)},...Tt()&&Ge&&{advisorModel:Ge},...{}},S=kc(X,Rn);if(Be.mode==="bypassPermissions"||G)Od(Be);if(t.sessionPersistence===!1)Al(!0);gl(ac(xt));let Y=(F,se)=>{if(Object.keys(F).length===0)return Promise.resolve();return S.setState(($)=>({...$,mcp:{...$.mcp,clients:[...$.mcp.clients,...Object.entries(F).map(([le,U])=>({name:le,type:"pending",config:U}))]}})),Uc(({client:$,tools:le,commands:U})=>{S.setState((M)=>({...M,mcp:{...M.mcp,clients:M.mcp.clients.some((te)=>te.name===$.name)?M.mcp.clients.map((te)=>te.name===$.name?$:te):[...M.mcp.clients,$],tools:ft([...M.mcp.tools,...le],"name"),commands:ft([...M.mcp.commands,...U],"name")}}))},F).catch(($)=>h(`[MCP] ${se} connect error: ${$}`))},O=()=>{let F=process.env.CC_HAHA_DESKTOP_AWAIT_MCP_TIMEOUT_MS;if(F===void 0)return 5000;let se=Number.parseInt(F,10);if(!Number.isFinite(se)||se<0)return 5000;return se},w=async(F,se)=>{let $=O();if($===0)return;let le,U=await Promise.race([F.then(()=>!1),new Promise((M)=>{le=setTimeout(M,$,!0)})]);if(le)clearTimeout(le);if(U)h(`[MCP] ${se} servers not ready after ${$}ms \u2014 proceeding; background connection continues`)};v("before_connectMcp");let E=Y(cn,"regular");if(Cn){if(process.env.CC_HAHA_DESKTOP_AWAIT_MCP==="1")await w(E,"regular MCP")}else await E;v("after_connectMcp");let ne=5000,W=gi.then((F)=>{if(Object.keys(F).length>0){let le=new Set;for(let M of Object.values(F)){let te=_a(M);if(te)le.add(te)}let U=new Set;for(let[M,te]of Object.entries(cn)){if(!M.startsWith("plugin:"))continue;let un=_a(te);if(un&&le.has(un))U.add(M)}if(U.size>0){h(`[MCP] Lazy dedup: suppressing ${U.size} plugin server(s) that duplicate claude.ai connectors: ${[...U].join(", ")}`);for(let M of S.getState().mcp.clients){if(!U.has(M.name)||M.type!=="connected")continue;M.client.onclose=void 0,zc(M.name,M.config).catch(()=>{})}S.setState((M)=>{let{clients:te,tools:un,commands:Vt,resources:Yt}=M.mcp;te=te.filter((We)=>!U.has(We.name)),un=un.filter((We)=>!We.mcpInfo||!U.has(We.mcpInfo.serverName));for(let We of U)Vt=Vc(Vt,We),Yt=Yc(Yt,We);return{...M,mcp:{...M.mcp,clients:te,tools:un,commands:Vt,resources:Yt}}})}}let se=pg(cn,(le,U)=>!U.startsWith("plugin:")),{servers:$}=Bc(F,se);return Y($,"claudeai")}),J,qe=await Promise.race([W.then(()=>!1),new Promise((F)=>{J=setTimeout((se)=>se(!0),ne,F)})]);if(J)clearTimeout(J);if(qe)h(`[MCP] claude.ai connectors not ready after ${ne}ms \u2014 proceeding; background connection continues`);if(v("after_connectMcp_claudeai"),!Re())la(),import("./backgroundHousekeeping-m8gthtkh.js").then((F)=>F.startBackgroundHousekeeping());ll(),v("before_print_import");let{runHeadless:Me}=await import("./print-krwpbp2j.js");v("after_print_import"),Me(ge,()=>S.getState(),S.setState,k,Gt,Xi,sn.activeAgents,{continue:t.continue,resume:t.resume,verbose:Bn,outputFormat:Ae,jsonSchema:an,permissionPromptToolName:t.permissionPromptTool,allowedTools:ie,thinkingConfig:Pe,maxTurns:t.maxTurns,maxBudgetUsd:t.maxBudgetUsd,taskBudget:t.taskBudget?{total:t.taskBudget}:void 0,systemPrompt:nn,appendSystemPrompt:ee,userSpecifiedModel:Tn,fallbackModel:bu,teleport:pe,sdkUrl:Cn,replayUserMessages:fu,includePartialMessages:ci,forkSession:t.forkSession||!1,resumeSessionAt:t.resumeSessionAt||void 0,rewindFiles:t.rewindFiles,enableAuthStatus:t.enableAuthStatus,agent:Dt,workload:t.workload,setupTrigger:Ii??void 0,sessionStartHooksPromise:s});return}f("tengu_startup_manual_model_config",{cli_flag:t.model,env_var:process.env.ANTHROPIC_MODEL,settings_file:(Je()||{}).model,subscriptionType:cc(),agent:Vn});let Ri=au(Xn),zn=[];if(pi)zn.push({key:"permission-mode-notification",text:pi,priority:"high"});if(Ri)zn.push({key:"model-deprecation-warning",text:Ri,color:"warning",priority:"high"});if(Bt.length>0){let s=Ia(Bt.map((X)=>X.ruleDisplay)),d=s.join(", "),k=Ia(Bt.map((X)=>X.sourceDisplay)).join(", "),C=s.length;zn.push({key:"overly-broad-bash-notification",text:`${d} allow ${Fn(C,"rule")} from ${k} ${Fn(C,"was","were")} ignored \u2014 not available for Ants, please use auto-mode instead`,color:"warning",priority:"high"})}let Xu={...Be,mode:wn()&&ol().isPlanModeRequired()?"plan":Be.mode},Au=!1,Su=ui||gc()||c,Di=!1,An={settings:Je(),tasks:{},agentNameRegistry:new Map,verbose:Bn??L().verbose??!1,mainLoopModel:Ci,mainLoopModelForSession:null,isBriefOnly:Au,expandedView:L().showSpinnerTree?"teammates":L().showExpandedTodos?"tasks":"none",showTeammateMessagePreview:wn()?!1:void 0,selectedIPAgentIndex:-1,coordinatorTaskIndex:-1,viewSelectionMode:"none",footerSelection:null,toolPermissionContext:Xu,agent:I?.agentType,agentDefinitions:sn,mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:0},plugins:{enabled:[],disabled:[],commands:[],errors:[],installationStatus:{marketplaces:[],plugins:[]},needsRefresh:!1},statusLineText:void 0,kairosEnabled:c,remoteSessionUrl:void 0,remoteConnectionStatus:"connecting",remoteBackgroundTaskCount:0,replBridgeEnabled:Su||Di,replBridgeExplicit:ui,replBridgeOutboundOnly:Di,replBridgeConnected:!1,replBridgeSessionActive:!1,replBridgeReconnecting:!1,replBridgeConnectUrl:void 0,replBridgeSessionUrl:void 0,replBridgeEnvironmentId:void 0,replBridgeSessionId:void 0,replBridgeError:void 0,replBridgeInitialName:lu,showRemoteCallout:!1,notifications:{current:null,queue:zn},elicitation:{queue:[]},todos:{},remoteAgentTaskSuggestions:[],fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},attribution:Rc(),thinkingEnabled:dn,promptSuggestionEnabled:Ic(),sessionHooks:new Map,inbox:{messages:[]},promptSuggestion:{text:null,promptId:null,shownAt:0,acceptedAt:0,generationRequestId:null},speculation:Dc,speculationSessionTimeSavedMs:0,skillImprovement:{suggestion:null},workerSandboxPermissions:{queue:[],selectedIndex:0},pendingWorkerRequest:null,pendingSandboxRequest:null,authVersion:0,initialMessage:ge?{message:Ha({content:String(ge)})}:null,effortValue:Ma(t.effort)??Na(),activeOverlays:new Set,fastMode:Ra(Xn),...Tt()&&Ge&&{advisorModel:Ge},teamContext:eu?.()};if(ge)Fd(String(ge));let Eu=Ei;_((s)=>({...s,numStartups:(s.numStartups??0)+1})),setImmediate(()=>{vg(),ll()});let Pi=null,Mi=Pi?Pi.then((s)=>s.createSessionTurnUploader()).catch(()=>null):null,Un={debug:A||P,commands:[...$n,...xi],initialTools:Eu,mcpClients:Si,autoConnectIdeFlag:It,mainThreadAgentDefinition:I,disableSlashCommands:Mt,dynamicMcpConfig:re,strictMcpConfig:qn,systemPrompt:nn,appendSystemPrompt:ee,taskListId:su,thinkingConfig:Pe,...Mi&&{onTurnComplete:(s)=>{Mi.then((d)=>d?.(s))}}},Ni={modeApi:gg,mainThreadAgentDefinition:I,agentDefinitions:sn,currentCwd:qt,cliAgents:Wt,initialState:An};if(t.continue){let s=!1;try{let d=performance.now(),{clearSessionCaches:k}=await import("./caches-fbggdeq7.js");k();let C=await Wa(void 0,void 0);if(!C)return f("tengu_continue",{success:!1}),await Ee(q,"No conversation found to continue");let X=await ja(C,{forkSession:!!t.forkSession,includeAttribution:!0,transcriptPath:C.fullPath},Ni);if(X.restoredAgentDef)I=X.restoredAgentDef;yt(t),bt(t),f("tengu_continue",{success:!0,resume_duration_ms:Math.round(performance.now()-d)}),s=!0,await xn(q,{getFpsMetrics:on,stats:ln,initialState:X.initialState},{...Un,mainThreadAgentDefinition:X.restoredAgentDef??I,initialMessages:X.messages,initialFileHistorySnapshots:X.fileHistorySnapshots,initialContentReplacements:X.contentReplacements,initialAgentName:X.agentName,initialAgentColor:X.agentColor},Ke)}catch(d){if(!s)f("tengu_continue",{success:!1});V(d),process.exit(1)}}else if(t.resume||t.fromPr||pe||en!==null){let{clearSessionCaches:s}=await import("./caches-fbggdeq7.js");s();let d=null,k=void 0,C=Ct(t.resume),X=void 0,S=null,Y=void 0;if(t.fromPr){if(t.fromPr===!0)Y=!0;else if(typeof t.fromPr==="string")Y=t.fromPr}if(t.resume&&typeof t.resume==="string"&&!C){let w=t.resume.trim();if(w){let E=await zd(w,{exact:!0});if(E.length===1)S=E[0],C=Hd(S)??null;else X=w}}if(en!==null||pe){if(await Qc(),!ed("allow_remote_sessions"))return await Ee(q,"Error: Remote sessions are disabled by your organization's policy.",()=>Ce(1))}if(en!==null){let w=en.length>0,E=wt("tengu_remote_backend",!1);if(!E&&!w)return await Ee(q,`Error: --remote requires a description.
25922
+ Usage: claude --remote "your task description"`,()=>Ce(1));f("tengu_remote_create_session",{has_initial_prompt:String(w)});let ne=await Gl(),W=await vd(q,w?en:null,new AbortController().signal,ne||void 0);if(!W)return f("tengu_remote_create_session_error",{error:"unable_to_create_session"}),await Ee(q,"Error: Unable to create remote session",()=>Ce(1));if(f("tengu_remote_create_session_success",{session_id:W.id}),!E)process.stdout.write(`Created remote session: ${W.title}
25923
25923
  `),process.stdout.write(`View: ${La(W.id)}?m=0
25924
25924
  `),process.stdout.write(`Resume with: claude --teleport ${W.id}
25925
- `),await Ce(0),process.exit(0);Sl(!0),ll(Mc(W.id));let j;try{j=await rd()}catch(te){return V(Il(te)),await Ee(q,`Error: ${H(te)||"Failed to authenticate"}`,()=>Ce(1))}let{getClaudeAIOAuthTokens:qe}=await import("./auth-y1hqesm6.js"),Me=()=>qe()?.accessToken??j.accessToken,F=Jd(W.id,Me,j.orgUUID,w),se=`${La(W.id)}?m=0`,$=Rd(`/remote-control is active. Code in CLI or at ${se}`,"info"),le=w?Ha({content:en}):null,z={...An,remoteSessionUrl:se},P=Gd($n);await xn(q,{getFpsMetrics:on,stats:ln,initialState:z},{debug:A||D,commands:P,initialTools:[],initialMessages:le?[$,le]:[$],mcpClients:[],autoConnectIdeFlag:It,mainThreadAgentDefinition:I,disableSlashCommands:Mt,remoteSessionConfig:F,thinkingConfig:Pe},Ke);return}else if(de){if(de===!0||de===""){f("tengu_teleport_interactive_mode",{}),h("selectAndResumeTeleportTask: Starting teleport flow...");let w=await ss(q);if(!w)await Ce(0),process.exit(0);let{branchError:E}=await gd(w.branch);d=hd(w.log,E)}else if(typeof de==="string"){f("tengu_teleport_resume_session",{mode:"direct"});try{let w=await sd(de),E=await fd(w);if(E.status==="mismatch"||E.status==="not_in_repo"){let j=E.sessionRepo;if(j){let qe=tu(j),Me=await au(qe);if(Me.length>0){let F=await os(q,{targetRepo:j,initialPaths:Me});if(F)process.chdir(F),vd(F),Xa(F);else await Ce(0)}else throw new vt(`You must run claude --teleport ${de} from a checkout of ${j}.`,x.red(`You must run claude --teleport ${de} from a checkout of ${x.bold(j)}.
25925
+ `),await Ce(0),process.exit(0);xl(!0),dl(Oc(W.id));let J;try{J=await od()}catch(te){return V(Dl(te)),await Ee(q,`Error: ${H(te)||"Failed to authenticate"}`,()=>Ce(1))}let{getClaudeAIOAuthTokens:qe}=await import("./auth-wk077awh.js"),Me=()=>qe()?.accessToken??J.accessToken,F=Qd(W.id,Me,J.orgUUID,w),se=`${La(W.id)}?m=0`,$=Pd(`/remote-control is active. Code in CLI or at ${se}`,"info"),le=w?Ha({content:en}):null,U={...An,remoteSessionUrl:se},M=Wd($n);await xn(q,{getFpsMetrics:on,stats:ln,initialState:U},{debug:A||P,commands:M,initialTools:[],initialMessages:le?[$,le]:[$],mcpClients:[],autoConnectIdeFlag:It,mainThreadAgentDefinition:I,disableSlashCommands:Mt,remoteSessionConfig:F,thinkingConfig:Pe},Ke);return}else if(pe){if(pe===!0||pe===""){f("tengu_teleport_interactive_mode",{}),h("selectAndResumeTeleportTask: Starting teleport flow...");let w=await ss(q);if(!w)await Ce(0),process.exit(0);let{branchError:E}=await yd(w.branch);d=fd(w.log,E)}else if(typeof pe==="string"){f("tengu_teleport_resume_session",{mode:"direct"});try{let w=await ld(pe),E=await bd(w);if(E.status==="mismatch"||E.status==="not_in_repo"){let J=E.sessionRepo;if(J){let qe=iu(J),Me=await ru(qe);if(Me.length>0){let F=await os(q,{targetRepo:J,initialPaths:Me});if(F)process.chdir(F),kd(F),Xa(F);else await Ce(0)}else throw new vt(`You must run claude --teleport ${pe} from a checkout of ${J}.`,x.red(`You must run claude --teleport ${pe} from a checkout of ${x.bold(J)}.
25926
25926
  `))}}else if(E.status==="error")throw new vt(E.errorMessage||"Failed to validate session",x.red(`Error: ${E.errorMessage||"Failed to validate session"}
25927
- `));await md();let{teleportWithProgress:ne}=await import("./TeleportProgress-ghjbbh9h.js"),W=await ne(q,de);Xl({sessionId:de}),d=W.messages}catch(w){if(w instanceof vt)process.stderr.write(w.formattedMessage+`
25927
+ `));await gd();let{teleportWithProgress:ne}=await import("./TeleportProgress-vyy2k3bv.js"),W=await ne(q,pe);Sl({sessionId:pe}),d=W.messages}catch(w){if(w instanceof vt)process.stderr.write(w.formattedMessage+`
25928
25928
  `);else V(w),process.stderr.write(x.red(`Error: ${H(w)}
25929
- `));await Ce(1)}}}if(C){let w=C;try{let E=performance.now(),ne=await Wa(S??w,void 0);if(!ne)return f("tengu_session_resumed",{entrypoint:"cli_flag",success:!1}),await Ee(q,`No conversation found with session ID: ${w}`);let W=S?.fullPath??ne.fullPath;if(k=await ja(ne,{forkSession:!!t.forkSession,sessionIdOverride:w,transcriptPath:W},Ni),k.restoredAgentDef)I=k.restoredAgentDef;f("tengu_session_resumed",{entrypoint:"cli_flag",success:!0,resume_duration_ms:Math.round(performance.now()-E)})}catch(E){f("tengu_session_resumed",{entrypoint:"cli_flag",success:!1}),V(E),await Ee(q,`Failed to resume session ${w}`)}}if(Rt)try{let w=await Rt,E=Ll(w,(ne)=>!ne.success);if(E>0)process.stderr.write(x.yellow(`Warning: ${E}/${w.length} file(s) failed to download.
25930
- `))}catch(w){return await Ee(q,`Error downloading files: ${H(w)}`)}let O=k??(Array.isArray(d)?{messages:d,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:I,initialState:An,contentReplacements:void 0}:void 0);if(O)yt(t),bt(t),await xn(q,{getFpsMetrics:on,stats:ln,initialState:O.initialState},{...Un,mainThreadAgentDefinition:O.restoredAgentDef??I,initialMessages:O.messages,initialFileHistorySnapshots:O.fileHistorySnapshots,initialContentReplacements:O.contentReplacements,initialAgentName:O.agentName,initialAgentColor:O.agentColor},Ke);else await ls(q,{getFpsMetrics:on,stats:ln,initialState:An},Ld(cl()),{...Un,initialSearchQuery:X,forkSession:t.forkSession,filterByPr:Y})}else{let s=Ai&&Hn.length===0?Ai:void 0;v("action_after_hooks"),yt(t),bt(t);let d=null,k=d?[d,...Hn]:Hn.length>0?Hn:void 0;await xn(q,{getFpsMetrics:on,stats:ln,initialState:An},{...Un,initialMessages:k,pendingHookMessages:s},Ke)}}).version(`${MACRO.VERSION} (UnieAI Code)`,"-v, --version","Output the version number"),e.option("-w, --worktree [name]","Create a new git worktree for this session (optionally specify a name)"),e.addOption(new T("--worktree-base-ref <ref>","Create --worktree from this git ref instead of the default branch").hideHelp()),e.option("--tmux","Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux."),Xt())e.addOption(new T("--advisor <model>","Enable the server-side advisor tool with the specified model (alias or full ID).").hideHelp());e.addOption(new T("--agent-id <id>","Teammate agent ID").hideHelp()),e.addOption(new T("--agent-name <name>","Teammate display name").hideHelp()),e.addOption(new T("--team-name <name>","Team name for swarm coordination").hideHelp()),e.addOption(new T("--agent-color <color>","Teammate UI color").hideHelp()),e.addOption(new T("--plan-mode-required","Require plan mode before implementation").hideHelp()),e.addOption(new T("--parent-session-id <id>","Parent session ID for analytics correlation").hideHelp()),e.addOption(new T("--teammate-mode <mode>",'How to spawn teammates: "tmux", "in-process", or "auto"').choices(["auto","tmux","in-process"]).hideHelp()),e.addOption(new T("--agent-type <type>","Custom agent type for this teammate").hideHelp()),e.addOption(new T("--sdk-url <url>","Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)").hideHelp()),e.addOption(new T("--teleport [session]","Resume a teleport session, optionally specify session ID").hideHelp()),e.addOption(new T("--remote [description]","Create a remote session with the given description").hideHelp()),v("run_main_options_built");let a=process.argv.includes("-p")||process.argv.includes("--print"),i=process.argv.some((r)=>r.startsWith("cc://")||r.startsWith("cc+unix://"));if(a&&!i)return v("run_before_parse"),await e.parseAsync(process.argv),v("run_after_parse"),e;let o=e.command("mcp").description("Configure and manage MCP servers").configureHelp(n()).enablePositionalOptions();if(o.command("serve").description("Start the UnieAI Code MCP server").option("-d, --debug","Enable debug mode",()=>!0).option("--verbose","Override verbose mode setting from config",()=>!0).action(async({debug:r,verbose:t})=>{let{mcpServeHandler:c}=await import("./mcp-dqh1vtvf.js");await c({debug:r,verbose:t})}),Fo(o),Mn())Go(o);o.command("remove <name>").description("Remove an MCP server").option("-s, --scope <scope>","Configuration scope (local, user, or project) - if not specified, removes from whichever scope it exists in").action(async(r,t)=>{let{mcpRemoveHandler:c}=await import("./mcp-dqh1vtvf.js");await c(r,t)}),o.command("list").description("List configured MCP servers. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async()=>{let{mcpListHandler:r}=await import("./mcp-dqh1vtvf.js");await r()}),o.command("get <name>").description("Get details about an MCP server. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async(r)=>{let{mcpGetHandler:t}=await import("./mcp-dqh1vtvf.js");await t(r)}),o.command("add-json <name> <json>").description("Add an MCP server (stdio or SSE) with a JSON string").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").option("--client-secret","Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)").action(async(r,t,c)=>{let{mcpAddJsonHandler:b}=await import("./mcp-dqh1vtvf.js");await b(r,t,c)}),o.command("add-from-claude-desktop").description("Import MCP servers from Claude Desktop (Mac and WSL only)").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").action(async(r)=>{let{mcpAddFromDesktopHandler:t}=await import("./mcp-dqh1vtvf.js");await t(r)}),o.command("reset-project-choices").description("Reset all approved and rejected project-scoped (.mcp.json) servers within this project").action(async()=>{let{mcpResetChoicesHandler:r}=await import("./mcp-dqh1vtvf.js");await r()});let l=e.command("auth").description("Manage authentication").configureHelp(n());l.command("login").description("Sign in to UnieAI Studio (default), Anthropic, or OpenAI").option("--email <email>","Pre-populate email address on the login page").option("--sso","Force SSO login flow").option("--console","Use Anthropic Console (API usage billing) instead of Claude subscription").option("--claudeai","Use Claude subscription").option("--openai","Use OpenAI ChatGPT/Codex OAuth login").option("--unieai","Use UnieAI Studio device authentication (default)").action(async({email:r,sso:t,console:c,claudeai:b,openai:A,unieai:D})=>{let{authLogin:R}=await import("./auth-gkfrn4ga.js");await R({email:r,sso:t,console:c,claudeai:b,openai:A,unieai:D})}),l.command("status").description("Show authentication status").option("--json","Output as JSON (default)").option("--text","Output as human-readable text").option("--openai","Show OpenAI OAuth status").option("--unieai","Show UnieAI Studio auth status").action(async(r)=>{let{authStatus:t}=await import("./auth-gkfrn4ga.js");await t(r)}),l.command("logout").description("Log out from your Anthropic, OpenAI, or UnieAI Studio account").option("--openai","Log out from OpenAI OAuth only").option("--unieai","Log out from UnieAI Studio only").action(async(r)=>{let{authLogout:t}=await import("./auth-gkfrn4ga.js");await t(r)}),l.command("orgs").description("List UnieAI Studio organizations available to the current account").option("--json","Output as JSON (default)").option("--text","Output as human-readable text").option("--unieai","Target UnieAI Studio (required)").option("--use <orgId>","Set the active organization").action(async(r)=>{let{authOrgs:t}=await import("./auth-gkfrn4ga.js");await t(r)}),l.command("models").description("List models available to the current UnieAI Studio account").option("--json","Output as JSON (default)").option("--text","Output as human-readable text").option("--unieai","Target UnieAI Studio (required)").option("--org <orgId>","Override the active organization for this lookup").action(async(r)=>{let{authModels:t}=await import("./auth-gkfrn4ga.js");await t(r)}),e.command("login").description('Sign in to UnieAI Studio (alias of "auth login")').option("--email <email>","Pre-populate email address on the login page").option("--sso","Force SSO login flow").option("--console","Use Anthropic Console (API usage billing) instead of Claude subscription").option("--claudeai","Use Claude subscription").option("--openai","Use OpenAI ChatGPT/Codex OAuth login").option("--unieai","Use UnieAI Studio device authentication (default)").action(async({email:r,sso:t,console:c,claudeai:b,openai:A,unieai:D})=>{let{authLogin:R}=await import("./auth-gkfrn4ga.js");await R({email:r,sso:t,console:c,claudeai:b,openai:A,unieai:D})}),e.command("logout").description('Log out (alias of "auth logout")').option("--openai","Log out from OpenAI OAuth only").option("--unieai","Log out from UnieAI Studio only").action(async(r)=>{let{authLogout:t}=await import("./auth-gkfrn4ga.js");await t({...r,unieai:r.unieai??!r.openai})}),e.command("status").description('Show authentication status (alias of "auth status")').option("--json","Output as JSON (default)").option("--text","Output as human-readable text").option("--openai","Show OpenAI OAuth status").option("--unieai","Show UnieAI Studio auth status").action(async(r)=>{let{authStatus:t}=await import("./auth-gkfrn4ga.js");await t({...r,unieai:r.unieai??!r.openai})}),e.command("orgs").description('List UnieAI Studio organizations (alias of "auth orgs --unieai")').option("--json","Output as JSON (default)").option("--text","Output as human-readable text").option("--use <orgId>","Set the active organization").action(async(r)=>{let{authOrgs:t}=await import("./auth-gkfrn4ga.js");await t({...r,unieai:!0})}),e.command("models").description('List UnieAI Studio models (alias of "auth models --unieai")').option("--json","Output as JSON (default)").option("--text","Output as human-readable text").option("--org <orgId>","Override the active organization for this lookup").action(async(r)=>{let{authModels:t}=await import("./auth-gkfrn4ga.js");await t({...r,unieai:!0})});let u=()=>new T("--cowork","Use cowork_plugins directory").hideHelp(),p=e.command("plugin").alias("plugins").description("Manage UnieAI Code plugins").configureHelp(n());p.command("validate <path>").description("Validate a plugin or marketplace manifest").addOption(u()).action(async(r,t)=>{let{pluginValidateHandler:c}=await import("./plugins-pe89pa7p.js");await c(r,t)}),p.command("list").description("List installed plugins").option("--json","Output as JSON").option("--available","Include available plugins from marketplaces (requires --json)").addOption(u()).action(async(r)=>{let{pluginListHandler:t}=await import("./plugins-pe89pa7p.js");await t(r)});let y=p.command("marketplace").description("Manage UnieAI Code marketplaces").configureHelp(n());return y.command("add <source>").description("Add a marketplace from a URL, path, or GitHub repo").addOption(u()).option("--sparse <paths...>","Limit checkout to specific directories via git sparse-checkout (for monorepos). Example: --sparse .claude-plugin plugins").option("--scope <scope>","Where to declare the marketplace: user (default), project, or local").action(async(r,t)=>{let{marketplaceAddHandler:c}=await import("./plugins-pe89pa7p.js");await c(r,t)}),y.command("list").description("List all configured marketplaces").option("--json","Output as JSON").addOption(u()).action(async(r)=>{let{marketplaceListHandler:t}=await import("./plugins-pe89pa7p.js");await t(r)}),y.command("remove <name>").alias("rm").description("Remove a configured marketplace").addOption(u()).action(async(r,t)=>{let{marketplaceRemoveHandler:c}=await import("./plugins-pe89pa7p.js");await c(r,t)}),y.command("update [name]").description("Update marketplace(s) from their source - updates all if no name specified").addOption(u()).action(async(r,t)=>{let{marketplaceUpdateHandler:c}=await import("./plugins-pe89pa7p.js");await c(r,t)}),p.command("install <plugin>").alias("i").description("Install a plugin from available marketplaces (use plugin@marketplace for specific marketplace)").option("-s, --scope <scope>","Installation scope: user, project, or local","user").addOption(u()).action(async(r,t)=>{let{pluginInstallHandler:c}=await import("./plugins-pe89pa7p.js");await c(r,t)}),p.command("uninstall <plugin>").alias("remove").alias("rm").description("Uninstall an installed plugin").option("-s, --scope <scope>","Uninstall from scope: user, project, or local","user").option("--keep-data","Preserve the plugin's persistent data directory (~/.claude/plugins/data/{id}/)").addOption(u()).action(async(r,t)=>{let{pluginUninstallHandler:c}=await import("./plugins-pe89pa7p.js");await c(r,t)}),p.command("enable <plugin>").description("Enable a disabled plugin").option("-s, --scope <scope>",`Installation scope: ${za.join(", ")} (default: auto-detect)`).addOption(u()).action(async(r,t)=>{let{pluginEnableHandler:c}=await import("./plugins-pe89pa7p.js");await c(r,t)}),p.command("disable [plugin]").description("Disable an enabled plugin").option("-a, --all","Disable all enabled plugins").option("-s, --scope <scope>",`Installation scope: ${za.join(", ")} (default: auto-detect)`).addOption(u()).action(async(r,t)=>{let{pluginDisableHandler:c}=await import("./plugins-pe89pa7p.js");await c(r,t)}),p.command("update <plugin>").description("Update a plugin to the latest version (restart required to apply)").option("-s, --scope <scope>",`Installation scope: ${Od.join(", ")} (default: user)`).addOption(u()).action(async(r,t)=>{let{pluginUpdateHandler:c}=await import("./plugins-pe89pa7p.js");await c(r,t)}),e.command("setup-token").description("Set up a long-lived authentication token (requires Claude subscription)").action(async()=>{let[{setupTokenHandler:r},{createRoot:t}]=await Promise.all([import("./util-zkawe0w0.js"),import("./ink-9vrw9yhe.js")]),c=await t(Dn(!1));await r(c)}),e.command("agents").description("List configured agents").option("--setting-sources <sources>","Comma-separated list of setting sources to load (user, project, local).").action(async()=>{let{agentsHandler:r}=await import("./agents-mcbqv3h3.js");await r(),process.exit(0)}),e.command("doctor").description("Check the health of your UnieAI Code auto-updater. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async()=>{let[{doctorHandler:r},{createRoot:t}]=await Promise.all([import("./util-zkawe0w0.js"),import("./ink-9vrw9yhe.js")]),c=await t(Dn(!1));await r(c)}),e.command("update").alias("upgrade").description("Check for updates and install if available").action(async()=>{let{update:r}=await import("./update-mkzzbt54.js");await r()}),e.command("install [target]").description("Install UnieAI Code native build. Use [target] to specify version (stable, latest, or specific version)").option("--force","Force installation even if already installed").action(async(r,t)=>{let{installHandler:c}=await import("./util-zkawe0w0.js");await c(r,t)}),v("run_before_parse"),await e.parseAsync(process.argv),v("run_after_parse"),v("main_after_run"),Fl(),e}async function Xg({hasInitialPrompt:n,hasStdin:e,verbose:a,debug:i,debugToStderr:o,print:l,outputFormat:u,inputFormat:p,numAllowedTools:y,numDisallowedTools:r,mcpClientCount:t,worktreeEnabled:c,skipWebFetchPreflight:b,githubActionInputs:A,dangerouslySkipPermissionsPassed:D,permissionMode:R,modeIsBypass:G,allowDangerouslySkipPermissionsPassed:ye,systemPromptFlag:ie,appendSystemPromptFlag:De,thinkingConfig:Xe,assistantActivationPath:Ie}){try{f("tengu_init",{entrypoint:"claude",hasInitialPrompt:n,hasStdin:e,verbose:a,debug:i,debugToStderr:o,print:l,outputFormat:u,inputFormat:p,numAllowedTools:y,numDisallowedTools:r,mcpClientCount:t,worktree:c,skipWebFetchPreflight:b,...A&&{githubActionInputs:A},dangerouslySkipPermissionsPassed:D,permissionMode:R,modeIsBypass:G,inProtectedNamespace:xl(),allowDangerouslySkipPermissionsPassed:ye,thinkingType:Xe.type,...ie&&{systemPromptFlag:ie},...De&&{appendSystemPromptFlag:De},is_simple:Re()||void 0,is_coordinator:void 0,...Ie&&{assistantActivationPath:Ie},autoUpdatesChannel:Je().autoUpdatesChannel??"latest",...{}})}catch(he){V(he)}}function yt(n){}function bt(n){return}function Ag(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(bc)}function Sg(n){if(typeof n!=="object"||n===null)return{};let e=n,a=e.teammateMode;return{agentId:typeof e.agentId==="string"?e.agentId:void 0,agentName:typeof e.agentName==="string"?e.agentName:void 0,teamName:typeof e.teamName==="string"?e.teamName:void 0,agentColor:typeof e.agentColor==="string"?e.agentColor:void 0,planModeRequired:typeof e.planModeRequired==="boolean"?e.planModeRequired:void 0,parentSessionId:typeof e.parentSessionId==="string"?e.parentSessionId:void 0,teammateMode:a==="auto"||a==="tmux"||a==="in-process"?a:void 0,agentType:typeof e.agentType==="string"?e.agentType:void 0}}export{la as startDeferredPrefetches,gX as main};
25929
+ `));await Ce(1)}}}if(C){let w=C;try{let E=performance.now(),ne=await Wa(S??w,void 0);if(!ne)return f("tengu_session_resumed",{entrypoint:"cli_flag",success:!1}),await Ee(q,`No conversation found with session ID: ${w}`);let W=S?.fullPath??ne.fullPath;if(k=await ja(ne,{forkSession:!!t.forkSession,sessionIdOverride:w,transcriptPath:W},Ni),k.restoredAgentDef)I=k.restoredAgentDef;f("tengu_session_resumed",{entrypoint:"cli_flag",success:!0,resume_duration_ms:Math.round(performance.now()-E)})}catch(E){f("tengu_session_resumed",{entrypoint:"cli_flag",success:!1}),V(E),await Ee(q,`Failed to resume session ${w}`)}}if(Rt)try{let w=await Rt,E=Bl(w,(ne)=>!ne.success);if(E>0)process.stderr.write(x.yellow(`Warning: ${E}/${w.length} file(s) failed to download.
25930
+ `))}catch(w){return await Ee(q,`Error downloading files: ${H(w)}`)}let O=k??(Array.isArray(d)?{messages:d,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:I,initialState:An,contentReplacements:void 0}:void 0);if(O)yt(t),bt(t),await xn(q,{getFpsMetrics:on,stats:ln,initialState:O.initialState},{...Un,mainThreadAgentDefinition:O.restoredAgentDef??I,initialMessages:O.messages,initialFileHistorySnapshots:O.fileHistorySnapshots,initialContentReplacements:O.contentReplacements,initialAgentName:O.agentName,initialAgentColor:O.agentColor},Ke);else await ls(q,{getFpsMetrics:on,stats:ln,initialState:An},Bd(ul()),{...Un,initialSearchQuery:X,forkSession:t.forkSession,filterByPr:Y})}else{let s=Ai&&Hn.length===0?Ai:void 0;v("action_after_hooks"),yt(t),bt(t);let d=null,k=d?[d,...Hn]:Hn.length>0?Hn:void 0;await xn(q,{getFpsMetrics:on,stats:ln,initialState:An},{...Un,initialMessages:k,pendingHookMessages:s},Ke)}}).version(`${MACRO.VERSION} (UnieAI Code)`,"-v, --version","Output the version number"),e.option("-w, --worktree [name]","Create a new git worktree for this session (optionally specify a name)"),e.addOption(new T("--worktree-base-ref <ref>","Create --worktree from this git ref instead of the default branch").hideHelp()),e.option("--tmux","Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux."),Xt())e.addOption(new T("--advisor <model>","Enable the server-side advisor tool with the specified model (alias or full ID).").hideHelp());e.addOption(new T("--agent-id <id>","Teammate agent ID").hideHelp()),e.addOption(new T("--agent-name <name>","Teammate display name").hideHelp()),e.addOption(new T("--team-name <name>","Team name for swarm coordination").hideHelp()),e.addOption(new T("--agent-color <color>","Teammate UI color").hideHelp()),e.addOption(new T("--plan-mode-required","Require plan mode before implementation").hideHelp()),e.addOption(new T("--parent-session-id <id>","Parent session ID for analytics correlation").hideHelp()),e.addOption(new T("--teammate-mode <mode>",'How to spawn teammates: "tmux", "in-process", or "auto"').choices(["auto","tmux","in-process"]).hideHelp()),e.addOption(new T("--agent-type <type>","Custom agent type for this teammate").hideHelp()),e.addOption(new T("--sdk-url <url>","Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)").hideHelp()),e.addOption(new T("--teleport [session]","Resume a teleport session, optionally specify session ID").hideHelp()),e.addOption(new T("--remote [description]","Create a remote session with the given description").hideHelp()),v("run_main_options_built");let a=process.argv.includes("-p")||process.argv.includes("--print"),i=process.argv.some((r)=>r.startsWith("cc://")||r.startsWith("cc+unix://"));if(a&&!i)return v("run_before_parse"),await e.parseAsync(process.argv),v("run_after_parse"),e;let o=e.command("mcp").description("Configure and manage MCP servers").configureHelp(n()).enablePositionalOptions();if(o.command("serve").description("Start the UnieAI Code MCP server").option("-d, --debug","Enable debug mode",()=>!0).option("--verbose","Override verbose mode setting from config",()=>!0).action(async({debug:r,verbose:t})=>{let{mcpServeHandler:c}=await import("./mcp-yymqpmv6.js");await c({debug:r,verbose:t})}),_o(o),Mn())Wo(o);o.command("remove <name>").description("Remove an MCP server").option("-s, --scope <scope>","Configuration scope (local, user, or project) - if not specified, removes from whichever scope it exists in").action(async(r,t)=>{let{mcpRemoveHandler:c}=await import("./mcp-yymqpmv6.js");await c(r,t)}),o.command("list").description("List configured MCP servers. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async()=>{let{mcpListHandler:r}=await import("./mcp-yymqpmv6.js");await r()}),o.command("get <name>").description("Get details about an MCP server. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async(r)=>{let{mcpGetHandler:t}=await import("./mcp-yymqpmv6.js");await t(r)}),o.command("add-json <name> <json>").description("Add an MCP server (stdio or SSE) with a JSON string").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").option("--client-secret","Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)").action(async(r,t,c)=>{let{mcpAddJsonHandler:b}=await import("./mcp-yymqpmv6.js");await b(r,t,c)}),o.command("add-from-claude-desktop").description("Import MCP servers from Claude Desktop (Mac and WSL only)").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").action(async(r)=>{let{mcpAddFromDesktopHandler:t}=await import("./mcp-yymqpmv6.js");await t(r)}),o.command("reset-project-choices").description("Reset all approved and rejected project-scoped (.mcp.json) servers within this project").action(async()=>{let{mcpResetChoicesHandler:r}=await import("./mcp-yymqpmv6.js");await r()});let l=e.command("auth").description("Manage authentication").configureHelp(n());l.command("login").description("Sign in to UnieAI Studio (default), Anthropic, or OpenAI").option("--email <email>","Pre-populate email address on the login page").option("--sso","Force SSO login flow").option("--console","Use Anthropic Console (API usage billing) instead of Claude subscription").option("--claudeai","Use Claude subscription").option("--openai","Use OpenAI ChatGPT/Codex OAuth login").option("--unieai","Use UnieAI Studio device authentication (default)").action(async({email:r,sso:t,console:c,claudeai:b,openai:A,unieai:P})=>{let{authLogin:D}=await import("./auth-gbyfq0g2.js");await D({email:r,sso:t,console:c,claudeai:b,openai:A,unieai:P})}),l.command("status").description("Show authentication status").option("--json","Output as JSON (default)").option("--text","Output as human-readable text").option("--openai","Show OpenAI OAuth status").option("--unieai","Show UnieAI Studio auth status").action(async(r)=>{let{authStatus:t}=await import("./auth-gbyfq0g2.js");await t(r)}),l.command("logout").description("Log out from your Anthropic, OpenAI, or UnieAI Studio account").option("--openai","Log out from OpenAI OAuth only").option("--unieai","Log out from UnieAI Studio only").action(async(r)=>{let{authLogout:t}=await import("./auth-gbyfq0g2.js");await t(r)}),l.command("orgs").description("List UnieAI Studio organizations available to the current account").option("--json","Output as JSON (default)").option("--text","Output as human-readable text").option("--unieai","Target UnieAI Studio (required)").option("--use <orgId>","Set the active organization").action(async(r)=>{let{authOrgs:t}=await import("./auth-gbyfq0g2.js");await t(r)}),l.command("models").description("List models available to the current UnieAI Studio account").option("--json","Output as JSON (default)").option("--text","Output as human-readable text").option("--unieai","Target UnieAI Studio (required)").option("--org <orgId>","Override the active organization for this lookup").action(async(r)=>{let{authModels:t}=await import("./auth-gbyfq0g2.js");await t(r)}),e.command("login").description('Sign in to UnieAI Studio (alias of "auth login")').option("--email <email>","Pre-populate email address on the login page").option("--sso","Force SSO login flow").option("--console","Use Anthropic Console (API usage billing) instead of Claude subscription").option("--claudeai","Use Claude subscription").option("--openai","Use OpenAI ChatGPT/Codex OAuth login").option("--unieai","Use UnieAI Studio device authentication (default)").action(async({email:r,sso:t,console:c,claudeai:b,openai:A,unieai:P})=>{let{authLogin:D}=await import("./auth-gbyfq0g2.js");await D({email:r,sso:t,console:c,claudeai:b,openai:A,unieai:P})}),e.command("logout").description('Log out (alias of "auth logout")').option("--openai","Log out from OpenAI OAuth only").option("--unieai","Log out from UnieAI Studio only").action(async(r)=>{let{authLogout:t}=await import("./auth-gbyfq0g2.js");await t({...r,unieai:r.unieai??!r.openai})}),e.command("status").description('Show authentication status (alias of "auth status")').option("--json","Output as JSON (default)").option("--text","Output as human-readable text").option("--openai","Show OpenAI OAuth status").option("--unieai","Show UnieAI Studio auth status").action(async(r)=>{let{authStatus:t}=await import("./auth-gbyfq0g2.js");await t({...r,unieai:r.unieai??!r.openai})}),e.command("orgs").description('List UnieAI Studio organizations (alias of "auth orgs --unieai")').option("--json","Output as JSON (default)").option("--text","Output as human-readable text").option("--use <orgId>","Set the active organization").action(async(r)=>{let{authOrgs:t}=await import("./auth-gbyfq0g2.js");await t({...r,unieai:!0})}),e.command("models").description('List UnieAI Studio models (alias of "auth models --unieai")').option("--json","Output as JSON (default)").option("--text","Output as human-readable text").option("--org <orgId>","Override the active organization for this lookup").action(async(r)=>{let{authModels:t}=await import("./auth-gbyfq0g2.js");await t({...r,unieai:!0})});let u=()=>new T("--cowork","Use cowork_plugins directory").hideHelp(),p=e.command("plugin").alias("plugins").description("Manage UnieAI Code plugins").configureHelp(n());p.command("validate <path>").description("Validate a plugin or marketplace manifest").addOption(u()).action(async(r,t)=>{let{pluginValidateHandler:c}=await import("./plugins-vvf897b4.js");await c(r,t)}),p.command("list").description("List installed plugins").option("--json","Output as JSON").option("--available","Include available plugins from marketplaces (requires --json)").addOption(u()).action(async(r)=>{let{pluginListHandler:t}=await import("./plugins-vvf897b4.js");await t(r)});let y=p.command("marketplace").description("Manage UnieAI Code marketplaces").configureHelp(n());return y.command("add <source>").description("Add a marketplace from a URL, path, or GitHub repo").addOption(u()).option("--sparse <paths...>","Limit checkout to specific directories via git sparse-checkout (for monorepos). Example: --sparse .claude-plugin plugins").option("--scope <scope>","Where to declare the marketplace: user (default), project, or local").action(async(r,t)=>{let{marketplaceAddHandler:c}=await import("./plugins-vvf897b4.js");await c(r,t)}),y.command("list").description("List all configured marketplaces").option("--json","Output as JSON").addOption(u()).action(async(r)=>{let{marketplaceListHandler:t}=await import("./plugins-vvf897b4.js");await t(r)}),y.command("remove <name>").alias("rm").description("Remove a configured marketplace").addOption(u()).action(async(r,t)=>{let{marketplaceRemoveHandler:c}=await import("./plugins-vvf897b4.js");await c(r,t)}),y.command("update [name]").description("Update marketplace(s) from their source - updates all if no name specified").addOption(u()).action(async(r,t)=>{let{marketplaceUpdateHandler:c}=await import("./plugins-vvf897b4.js");await c(r,t)}),p.command("install <plugin>").alias("i").description("Install a plugin from available marketplaces (use plugin@marketplace for specific marketplace)").option("-s, --scope <scope>","Installation scope: user, project, or local","user").addOption(u()).action(async(r,t)=>{let{pluginInstallHandler:c}=await import("./plugins-vvf897b4.js");await c(r,t)}),p.command("uninstall <plugin>").alias("remove").alias("rm").description("Uninstall an installed plugin").option("-s, --scope <scope>","Uninstall from scope: user, project, or local","user").option("--keep-data","Preserve the plugin's persistent data directory (~/.claude/plugins/data/{id}/)").addOption(u()).action(async(r,t)=>{let{pluginUninstallHandler:c}=await import("./plugins-vvf897b4.js");await c(r,t)}),p.command("enable <plugin>").description("Enable a disabled plugin").option("-s, --scope <scope>",`Installation scope: ${za.join(", ")} (default: auto-detect)`).addOption(u()).action(async(r,t)=>{let{pluginEnableHandler:c}=await import("./plugins-vvf897b4.js");await c(r,t)}),p.command("disable [plugin]").description("Disable an enabled plugin").option("-a, --all","Disable all enabled plugins").option("-s, --scope <scope>",`Installation scope: ${za.join(", ")} (default: auto-detect)`).addOption(u()).action(async(r,t)=>{let{pluginDisableHandler:c}=await import("./plugins-vvf897b4.js");await c(r,t)}),p.command("update <plugin>").description("Update a plugin to the latest version (restart required to apply)").option("-s, --scope <scope>",`Installation scope: ${Ld.join(", ")} (default: user)`).addOption(u()).action(async(r,t)=>{let{pluginUpdateHandler:c}=await import("./plugins-vvf897b4.js");await c(r,t)}),e.command("setup-token").description("Set up a long-lived authentication token (requires Claude subscription)").action(async()=>{let[{setupTokenHandler:r},{createRoot:t}]=await Promise.all([import("./util-1geb93kp.js"),import("./ink-vkxsn90v.js")]),c=await t(Dn(!1));await r(c)}),e.command("agents").description("List configured agents").option("--setting-sources <sources>","Comma-separated list of setting sources to load (user, project, local).").action(async()=>{let{agentsHandler:r}=await import("./agents-3exybgtb.js");await r(),process.exit(0)}),e.command("doctor").description("Check the health of your UnieAI Code auto-updater. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async()=>{let[{doctorHandler:r},{createRoot:t}]=await Promise.all([import("./util-1geb93kp.js"),import("./ink-vkxsn90v.js")]),c=await t(Dn(!1));await r(c)}),e.command("update").alias("upgrade").description("Check for updates and install if available").action(async()=>{let{update:r}=await import("./update-w8wdxh3m.js");await r()}),e.command("install [target]").description("Install UnieAI Code native build. Use [target] to specify version (stable, latest, or specific version)").option("--force","Force installation even if already installed").action(async(r,t)=>{let{installHandler:c}=await import("./util-1geb93kp.js");await c(r,t)}),v("run_before_parse"),await e.parseAsync(process.argv),v("run_after_parse"),v("main_after_run"),_l(),e}async function xg({hasInitialPrompt:n,hasStdin:e,verbose:a,debug:i,debugToStderr:o,print:l,outputFormat:u,inputFormat:p,numAllowedTools:y,numDisallowedTools:r,mcpClientCount:t,worktreeEnabled:c,skipWebFetchPreflight:b,githubActionInputs:A,dangerouslySkipPermissionsPassed:P,permissionMode:D,modeIsBypass:G,allowDangerouslySkipPermissionsPassed:ye,systemPromptFlag:ie,appendSystemPromptFlag:De,thinkingConfig:Xe,assistantActivationPath:Ie}){try{f("tengu_init",{entrypoint:"claude",hasInitialPrompt:n,hasStdin:e,verbose:a,debug:i,debugToStderr:o,print:l,outputFormat:u,inputFormat:p,numAllowedTools:y,numDisallowedTools:r,mcpClientCount:t,worktree:c,skipWebFetchPreflight:b,...A&&{githubActionInputs:A},dangerouslySkipPermissionsPassed:P,permissionMode:D,modeIsBypass:G,inProtectedNamespace:Rl(),allowDangerouslySkipPermissionsPassed:ye,thinkingType:Xe.type,...ie&&{systemPromptFlag:ie},...De&&{appendSystemPromptFlag:De},is_simple:Re()||void 0,is_coordinator:void 0,...Ie&&{assistantActivationPath:Ie},autoUpdatesChannel:Je().autoUpdatesChannel??"latest",...{}})}catch(he){V(he)}}function yt(n){}function bt(n){return}function Ig(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(wc)}function Rg(n){if(typeof n!=="object"||n===null)return{};let e=n,a=e.teammateMode;return{agentId:typeof e.agentId==="string"?e.agentId:void 0,agentName:typeof e.agentName==="string"?e.agentName:void 0,teamName:typeof e.teamName==="string"?e.teamName:void 0,agentColor:typeof e.agentColor==="string"?e.agentColor:void 0,planModeRequired:typeof e.planModeRequired==="boolean"?e.planModeRequired:void 0,parentSessionId:typeof e.parentSessionId==="string"?e.parentSessionId:void 0,teammateMode:a==="auto"||a==="tmux"||a==="in-process"?a:void 0,agentType:typeof e.agentType==="string"?e.agentType:void 0}}export{la as startDeferredPrefetches,wX as main};