@namzu/cli 37.0.1 → 37.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +1 -1
  3. package/dist/analysis-host.js +55 -0
  4. package/dist/analysis-host.js.map +6 -0
  5. package/dist/bin.js +1 -1
  6. package/dist/chunks/{acp-KTJZTVUR.js → acp-T46275W3.js} +59 -47
  7. package/dist/chunks/acp-T46275W3.js.map +6 -0
  8. package/dist/chunks/{activity-command-UMTER4IK.js → activity-command-U3KHRDTY.js} +11 -10
  9. package/dist/chunks/activity-command-U3KHRDTY.js.map +6 -0
  10. package/dist/chunks/{add-AIDLR6U4.js → add-Q2HPE26F.js} +19 -19
  11. package/dist/chunks/{agent-C7TDIJ67.js → agent-KSRUGF37.js} +26 -24
  12. package/dist/chunks/agent-session-4G4PKPCR.js +51 -0
  13. package/dist/chunks/{archive-FKUQ77FG.js → archive-NQ527SKW.js} +9 -8
  14. package/dist/chunks/archive-NQ527SKW.js.map +6 -0
  15. package/dist/chunks/{bin-main-BLF3YOHJ.js → bin-main-72QPYEQ5.js} +5 -5
  16. package/dist/chunks/{browser-7P2TABJG.js → browser-NQAXUNRS.js} +7 -7
  17. package/dist/chunks/{chat-YN6WWBI6.js → chat-QSA5IBTG.js} +20 -19
  18. package/dist/chunks/chat-QSA5IBTG.js.map +6 -0
  19. package/dist/chunks/{chunk-Y3UE64PV.js → chunk-2GTBCI2R.js} +3 -3
  20. package/dist/chunks/chunk-3KMW53PV.js +108 -0
  21. package/dist/chunks/chunk-3KMW53PV.js.map +6 -0
  22. package/dist/chunks/{chunk-QCJU5KFR.js → chunk-3TGNRSKG.js} +6 -6
  23. package/dist/chunks/{chunk-3SGEHTJ4.js → chunk-4K3ABOWX.js} +6 -6
  24. package/dist/chunks/{chunk-MVGNG67O.js → chunk-4MZXZCPR.js} +2 -2
  25. package/dist/chunks/{chunk-EBFWNPMU.js → chunk-4WDWLAQ5.js} +11 -11
  26. package/dist/chunks/{chunk-YCVR5E2Z.js → chunk-5EQTZ4HK.js} +30 -4
  27. package/dist/chunks/{chunk-YCVR5E2Z.js.map → chunk-5EQTZ4HK.js.map} +1 -1
  28. package/dist/chunks/{chunk-XDAMUTVR.js → chunk-5LO5YWAO.js} +4 -4
  29. package/dist/chunks/{chunk-OVVIFOAR.js → chunk-5X7RU64G.js} +4 -4
  30. package/dist/chunks/{chunk-I3Q53U6H.js → chunk-6CD4ZJWY.js} +2 -2
  31. package/dist/chunks/{chunk-WRGY7MRU.js → chunk-6SKQVVXO.js} +33 -32
  32. package/dist/chunks/{chunk-WRGY7MRU.js.map → chunk-6SKQVVXO.js.map} +1 -1
  33. package/dist/chunks/{chunk-WWE4W2R6.js → chunk-6USAI7O7.js} +2 -2
  34. package/dist/chunks/{chunk-DFU5KG3V.js → chunk-7INJDLWA.js} +4 -4
  35. package/dist/chunks/chunk-7WKQQOKK.js +430 -0
  36. package/dist/chunks/chunk-7WKQQOKK.js.map +6 -0
  37. package/dist/chunks/{chunk-45MA2WMX.js → chunk-A3TBA7LQ.js} +3 -3
  38. package/dist/chunks/{chunk-5WDPVM7Q.js → chunk-ACJ37X25.js} +2 -2
  39. package/dist/chunks/{chunk-GR452YOE.js → chunk-ADJCEQGK.js} +2 -2
  40. package/dist/chunks/{chunk-SEKX6IR5.js → chunk-AEWKXISZ.js} +13 -13
  41. package/dist/chunks/{chunk-6CQJH56B.js → chunk-AHK44IOS.js} +2 -2
  42. package/dist/chunks/{chunk-74WE6T6M.js → chunk-CBNP2J2W.js} +9 -7
  43. package/dist/chunks/chunk-CBNP2J2W.js.map +6 -0
  44. package/dist/chunks/{chunk-3NCL3Y53.js → chunk-DPCUP4TI.js} +4 -4
  45. package/dist/chunks/{chunk-HHKKHUJK.js → chunk-EKSTG5ZQ.js} +3 -41
  46. package/dist/chunks/chunk-EKSTG5ZQ.js.map +6 -0
  47. package/dist/chunks/{chunk-F2JKDYHA.js → chunk-FUORCVIN.js} +4 -4
  48. package/dist/chunks/{chunk-5GOYK3IN.js → chunk-FXXP6QP6.js} +2 -2
  49. package/dist/chunks/{chunk-X3ZBCYV6.js → chunk-GEPGHAWO.js} +2 -2
  50. package/dist/chunks/{chunk-23SR4YFL.js → chunk-GSZCV2P3.js} +2 -2
  51. package/dist/chunks/{chunk-FKLDO6SF.js → chunk-GXQAMIQA.js} +3 -3
  52. package/dist/chunks/{chunk-HV4SSQ2Y.js → chunk-HKUWS2WO.js} +3 -3
  53. package/dist/chunks/{chunk-FLUVTAXY.js → chunk-HMORKNX3.js} +457 -128
  54. package/dist/chunks/chunk-HMORKNX3.js.map +6 -0
  55. package/dist/chunks/{chunk-2YPMHUI4.js → chunk-HTXPBXXP.js} +2 -2
  56. package/dist/chunks/{chunk-I6XWCKKW.js → chunk-IB7UOMAQ.js} +7 -5
  57. package/dist/chunks/chunk-IB7UOMAQ.js.map +6 -0
  58. package/dist/chunks/{chunk-4GDOFBZF.js → chunk-IVFJXA6P.js} +3 -3
  59. package/dist/chunks/chunk-J4IRSWAS.js +49 -0
  60. package/dist/chunks/chunk-J4IRSWAS.js.map +6 -0
  61. package/dist/chunks/{chunk-D7FPVZDC.js → chunk-KB7EM3DJ.js} +2 -2
  62. package/dist/chunks/{chunk-WMOYTZXD.js → chunk-KSQTOA6I.js} +17 -17
  63. package/dist/chunks/{chunk-BV2SDA2D.js → chunk-LCFHDWTA.js} +3 -3
  64. package/dist/chunks/{chunk-37A6M7P4.js → chunk-LVW3JXVJ.js} +4 -4
  65. package/dist/chunks/{chunk-DBBWIOQS.js → chunk-LZISO3TE.js} +3 -3
  66. package/dist/chunks/{chunk-NKERGDBZ.js → chunk-MB4SLACG.js} +2 -2
  67. package/dist/chunks/{chunk-KQM2NQ2W.js → chunk-MOI4XD5Z.js} +8 -8
  68. package/dist/chunks/{chunk-ZKI3Z4VR.js → chunk-MRQ2UQG5.js} +2 -2
  69. package/dist/chunks/{chunk-JH2O55TT.js → chunk-NIBOMW4E.js} +4 -4
  70. package/dist/chunks/{chunk-XYXPAVPG.js → chunk-OTTDC3KF.js} +4 -4
  71. package/dist/chunks/{chunk-BUQ7VMBS.js → chunk-OYJCMNOO.js} +32 -10
  72. package/dist/chunks/chunk-OYJCMNOO.js.map +6 -0
  73. package/dist/chunks/{chunk-UFZGVNFQ.js → chunk-Q2EWUIIT.js} +2 -2
  74. package/dist/chunks/{chunk-QVMTUMTW.js → chunk-QINC4TIT.js} +3 -3
  75. package/dist/chunks/{chunk-KSFS3BI7.js → chunk-S72MTTOC.js} +2 -2
  76. package/dist/chunks/{chunk-R23DP7S7.js → chunk-TGZ7OLDL.js} +17 -17
  77. package/dist/chunks/{chunk-ZRAALEF2.js → chunk-TI7LE6F5.js} +2 -2
  78. package/dist/chunks/{chunk-QU3LGVTZ.js → chunk-TTCXFX6V.js} +7 -7
  79. package/dist/chunks/{chunk-6HDBRUB7.js → chunk-UC3UARTL.js} +47 -30
  80. package/dist/chunks/chunk-UC3UARTL.js.map +6 -0
  81. package/dist/chunks/{chunk-ZRJYG2F2.js → chunk-VEOIRZH4.js} +2 -2
  82. package/dist/chunks/{chunk-MYRLRBZG.js → chunk-VSLHC665.js} +3 -3
  83. package/dist/chunks/{chunk-OKB66ICJ.js → chunk-WU5K7PF3.js} +13 -11
  84. package/dist/chunks/chunk-WU5K7PF3.js.map +6 -0
  85. package/dist/chunks/{chunk-HXFPEA6Z.js → chunk-XB7HBRSL.js} +2 -2
  86. package/dist/chunks/{chunk-2EDGH6Y3.js → chunk-ZGP5MF2Q.js} +3 -3
  87. package/dist/chunks/{chunk-L7Q7QNNE.js → chunk-ZNO7XIZU.js} +3 -3
  88. package/dist/chunks/{cli-runtime-74KKQHC7.js → cli-runtime-T6ZXKC2O.js} +7 -7
  89. package/dist/chunks/{commands-2Q7KPVLW.js → commands-3RJ5HAMM.js} +6 -6
  90. package/dist/chunks/{crash-report-KDVWQ2RR.js → crash-report-ZUP6NMRJ.js} +6 -6
  91. package/dist/chunks/{dist-674RS73L.js → dist-5D7BTPT2.js} +2 -2
  92. package/dist/chunks/{dist-4TGHKBRS.js → dist-72DFA26L.js} +2 -2
  93. package/dist/chunks/{dist-Q523V5L2.js → dist-GXQCJQ53.js} +2 -2
  94. package/dist/chunks/{dist-OMRUSJ5R.js → dist-HJCEE57U.js} +2 -2
  95. package/dist/chunks/{dist-25C2CYHP.js → dist-I2Q3FRR4.js} +2 -2
  96. package/dist/chunks/dist-KGLSBIES.js +2182 -0
  97. package/dist/chunks/dist-KGLSBIES.js.map +6 -0
  98. package/dist/chunks/{dist-UYD7IXG3.js → dist-PE6GSYDP.js} +2 -2
  99. package/dist/chunks/{dist-ZDSPMZ5S.js → dist-XFIOSXNS.js} +2 -2
  100. package/dist/chunks/{doctor-TFION64N.js → doctor-FPBYPOAK.js} +11 -9
  101. package/dist/chunks/{drain-3W3A4KPX.js → drain-N65CXI5H.js} +13 -13
  102. package/dist/chunks/{eval-TCUVH3S3.js → eval-SYKBFGGU.js} +2 -2
  103. package/dist/chunks/{exec-EIELDRPM.js → exec-INYAGY7Q.js} +30 -29
  104. package/dist/chunks/exec-INYAGY7Q.js.map +6 -0
  105. package/dist/chunks/{home-FYDAEWNW.js → home-FJS5AXFZ.js} +3 -3
  106. package/dist/chunks/{host-queries-WFWM672O.js → host-queries-Q3CDQ5R6.js} +14 -13
  107. package/dist/chunks/host-queries-Q3CDQ5R6.js.map +6 -0
  108. package/dist/chunks/{lifecycle-ALDBR656.js → lifecycle-5RWKT62M.js} +27 -26
  109. package/dist/chunks/{list-Z4XOJJ7V.js → list-FUOU75RU.js} +15 -15
  110. package/dist/chunks/{login-UZONOHHT.js → login-ELQCFAUF.js} +8 -8
  111. package/dist/chunks/{logs-O3NGOQFC.js → logs-OBL6KGPA.js} +5 -5
  112. package/dist/chunks/{mcp-YI6PL4TH.js → mcp-TFWJC56M.js} +16 -16
  113. package/dist/chunks/{message-command-QEQJ25KR.js → message-command-ZNMT76V5.js} +35 -33
  114. package/dist/chunks/message-command-ZNMT76V5.js.map +6 -0
  115. package/dist/chunks/{operator-tools-GKYGHHPM.js → operator-tools-C6OPS77I.js} +13 -12
  116. package/dist/chunks/operator-tools-C6OPS77I.js.map +6 -0
  117. package/dist/chunks/{output-schema-KXKCYDI4.js → output-schema-35YWLD2S.js} +3 -3
  118. package/dist/chunks/{pal-2EYYHPXC.js → pal-TN4YSFO6.js} +13 -13
  119. package/dist/chunks/{providers-JF5SWSTH.js → providers-KC7IQHF7.js} +6 -6
  120. package/dist/chunks/{resident-WHH7YQGZ.js → resident-JZ5AHFMO.js} +24 -23
  121. package/dist/chunks/resident-JZ5AHFMO.js.map +6 -0
  122. package/dist/chunks/resume-ZLGRUFA3.js +22 -0
  123. package/dist/chunks/{resume-command-A3HKQSRH.js → resume-command-5FDSKSZR.js} +4 -4
  124. package/dist/chunks/{schedule-QIJCYWIQ.js → schedule-ZVBIF6JZ.js} +8 -8
  125. package/dist/chunks/{service-IXPGBY3F.js → service-2MS37QMZ.js} +31 -30
  126. package/dist/chunks/service-2MS37QMZ.js.map +6 -0
  127. package/dist/chunks/session-step-XIYPMQA4.js +27 -0
  128. package/dist/chunks/{skills-AGU7FTRG.js → skills-B35Q357B.js} +11 -11
  129. package/dist/chunks/{state-MTHK7DUX.js → state-YXNTJW67.js} +2 -2
  130. package/dist/chunks/{store-EWEKEKSG.js → store-5BLKNUFX.js} +9 -8
  131. package/dist/chunks/{store-XPSGZANO.js → store-5YOZ57L2.js} +6 -6
  132. package/dist/chunks/{store-LPOET7IK.js → store-H5KCO6HN.js} +4 -4
  133. package/dist/chunks/{tui-YMBQLMGW.js → tui-NZUV74RQ.js} +79 -75
  134. package/dist/chunks/tui-NZUV74RQ.js.map +6 -0
  135. package/dist/chunks/{upgrade-3YOFSMAQ.js → upgrade-64USK7BM.js} +2 -2
  136. package/dist/chunks/{worktree-VPD2N53Y.js → worktree-COOGACI6.js} +11 -10
  137. package/dist/chunks/worktree-COOGACI6.js.map +6 -0
  138. package/dist/cli.d.ts.map +1 -1
  139. package/dist/config/load.d.ts +3 -1
  140. package/dist/config/load.d.ts.map +1 -1
  141. package/dist/config/schema.d.ts +16 -0
  142. package/dist/config/schema.d.ts.map +1 -1
  143. package/dist/doctor/checks/code-analysis.d.ts +9 -0
  144. package/dist/doctor/checks/code-analysis.d.ts.map +1 -0
  145. package/dist/doctor/checks/index.d.ts +2 -1
  146. package/dist/doctor/checks/index.d.ts.map +1 -1
  147. package/dist/index.js +16 -14
  148. package/dist/integrations/analysis/host-entry.d.ts +12 -0
  149. package/dist/integrations/analysis/host-entry.d.ts.map +1 -0
  150. package/dist/integrations/analysis/provider.d.ts +42 -0
  151. package/dist/integrations/analysis/provider.d.ts.map +1 -0
  152. package/dist/integrations/resident/runner-worker.js +19 -18
  153. package/dist/integrations/resident/runner-worker.js.map +1 -1
  154. package/dist/terminal/pty.d.ts +8 -0
  155. package/dist/terminal/pty.d.ts.map +1 -1
  156. package/dist/tui/App.d.ts.map +1 -1
  157. package/dist/tui/agent.d.ts +9 -1
  158. package/dist/tui/agent.d.ts.map +1 -1
  159. package/dist/tui/types.d.ts +3 -1
  160. package/dist/tui/types.d.ts.map +1 -1
  161. package/package.json +4 -2
  162. package/dist/chunks/acp-KTJZTVUR.js.map +0 -6
  163. package/dist/chunks/activity-command-UMTER4IK.js.map +0 -6
  164. package/dist/chunks/agent-session-D4Z3TOX3.js +0 -49
  165. package/dist/chunks/archive-FKUQ77FG.js.map +0 -6
  166. package/dist/chunks/chat-YN6WWBI6.js.map +0 -6
  167. package/dist/chunks/chunk-6HDBRUB7.js.map +0 -6
  168. package/dist/chunks/chunk-74WE6T6M.js.map +0 -6
  169. package/dist/chunks/chunk-BUQ7VMBS.js.map +0 -6
  170. package/dist/chunks/chunk-FLUVTAXY.js.map +0 -6
  171. package/dist/chunks/chunk-HHKKHUJK.js.map +0 -6
  172. package/dist/chunks/chunk-I6XWCKKW.js.map +0 -6
  173. package/dist/chunks/chunk-OKB66ICJ.js.map +0 -6
  174. package/dist/chunks/exec-EIELDRPM.js.map +0 -6
  175. package/dist/chunks/host-queries-WFWM672O.js.map +0 -6
  176. package/dist/chunks/message-command-QEQJ25KR.js.map +0 -6
  177. package/dist/chunks/operator-tools-GKYGHHPM.js.map +0 -6
  178. package/dist/chunks/resident-WHH7YQGZ.js.map +0 -6
  179. package/dist/chunks/resume-WR4KOI7Q.js +0 -21
  180. package/dist/chunks/service-IXPGBY3F.js.map +0 -6
  181. package/dist/chunks/session-step-ZZBENVGS.js +0 -26
  182. package/dist/chunks/tui-YMBQLMGW.js.map +0 -6
  183. package/dist/chunks/worktree-VPD2N53Y.js.map +0 -6
  184. /package/dist/chunks/{add-AIDLR6U4.js.map → add-Q2HPE26F.js.map} +0 -0
  185. /package/dist/chunks/{agent-C7TDIJ67.js.map → agent-KSRUGF37.js.map} +0 -0
  186. /package/dist/chunks/{agent-session-D4Z3TOX3.js.map → agent-session-4G4PKPCR.js.map} +0 -0
  187. /package/dist/chunks/{bin-main-BLF3YOHJ.js.map → bin-main-72QPYEQ5.js.map} +0 -0
  188. /package/dist/chunks/{browser-7P2TABJG.js.map → browser-NQAXUNRS.js.map} +0 -0
  189. /package/dist/chunks/{chunk-Y3UE64PV.js.map → chunk-2GTBCI2R.js.map} +0 -0
  190. /package/dist/chunks/{chunk-QCJU5KFR.js.map → chunk-3TGNRSKG.js.map} +0 -0
  191. /package/dist/chunks/{chunk-3SGEHTJ4.js.map → chunk-4K3ABOWX.js.map} +0 -0
  192. /package/dist/chunks/{chunk-MVGNG67O.js.map → chunk-4MZXZCPR.js.map} +0 -0
  193. /package/dist/chunks/{chunk-EBFWNPMU.js.map → chunk-4WDWLAQ5.js.map} +0 -0
  194. /package/dist/chunks/{chunk-XDAMUTVR.js.map → chunk-5LO5YWAO.js.map} +0 -0
  195. /package/dist/chunks/{chunk-OVVIFOAR.js.map → chunk-5X7RU64G.js.map} +0 -0
  196. /package/dist/chunks/{chunk-I3Q53U6H.js.map → chunk-6CD4ZJWY.js.map} +0 -0
  197. /package/dist/chunks/{chunk-WWE4W2R6.js.map → chunk-6USAI7O7.js.map} +0 -0
  198. /package/dist/chunks/{chunk-DFU5KG3V.js.map → chunk-7INJDLWA.js.map} +0 -0
  199. /package/dist/chunks/{chunk-45MA2WMX.js.map → chunk-A3TBA7LQ.js.map} +0 -0
  200. /package/dist/chunks/{chunk-5WDPVM7Q.js.map → chunk-ACJ37X25.js.map} +0 -0
  201. /package/dist/chunks/{chunk-GR452YOE.js.map → chunk-ADJCEQGK.js.map} +0 -0
  202. /package/dist/chunks/{chunk-SEKX6IR5.js.map → chunk-AEWKXISZ.js.map} +0 -0
  203. /package/dist/chunks/{chunk-6CQJH56B.js.map → chunk-AHK44IOS.js.map} +0 -0
  204. /package/dist/chunks/{chunk-3NCL3Y53.js.map → chunk-DPCUP4TI.js.map} +0 -0
  205. /package/dist/chunks/{chunk-F2JKDYHA.js.map → chunk-FUORCVIN.js.map} +0 -0
  206. /package/dist/chunks/{chunk-5GOYK3IN.js.map → chunk-FXXP6QP6.js.map} +0 -0
  207. /package/dist/chunks/{chunk-X3ZBCYV6.js.map → chunk-GEPGHAWO.js.map} +0 -0
  208. /package/dist/chunks/{chunk-23SR4YFL.js.map → chunk-GSZCV2P3.js.map} +0 -0
  209. /package/dist/chunks/{chunk-FKLDO6SF.js.map → chunk-GXQAMIQA.js.map} +0 -0
  210. /package/dist/chunks/{chunk-HV4SSQ2Y.js.map → chunk-HKUWS2WO.js.map} +0 -0
  211. /package/dist/chunks/{chunk-2YPMHUI4.js.map → chunk-HTXPBXXP.js.map} +0 -0
  212. /package/dist/chunks/{chunk-4GDOFBZF.js.map → chunk-IVFJXA6P.js.map} +0 -0
  213. /package/dist/chunks/{chunk-D7FPVZDC.js.map → chunk-KB7EM3DJ.js.map} +0 -0
  214. /package/dist/chunks/{chunk-WMOYTZXD.js.map → chunk-KSQTOA6I.js.map} +0 -0
  215. /package/dist/chunks/{chunk-BV2SDA2D.js.map → chunk-LCFHDWTA.js.map} +0 -0
  216. /package/dist/chunks/{chunk-37A6M7P4.js.map → chunk-LVW3JXVJ.js.map} +0 -0
  217. /package/dist/chunks/{chunk-DBBWIOQS.js.map → chunk-LZISO3TE.js.map} +0 -0
  218. /package/dist/chunks/{chunk-NKERGDBZ.js.map → chunk-MB4SLACG.js.map} +0 -0
  219. /package/dist/chunks/{chunk-KQM2NQ2W.js.map → chunk-MOI4XD5Z.js.map} +0 -0
  220. /package/dist/chunks/{chunk-ZKI3Z4VR.js.map → chunk-MRQ2UQG5.js.map} +0 -0
  221. /package/dist/chunks/{chunk-JH2O55TT.js.map → chunk-NIBOMW4E.js.map} +0 -0
  222. /package/dist/chunks/{chunk-XYXPAVPG.js.map → chunk-OTTDC3KF.js.map} +0 -0
  223. /package/dist/chunks/{chunk-UFZGVNFQ.js.map → chunk-Q2EWUIIT.js.map} +0 -0
  224. /package/dist/chunks/{chunk-QVMTUMTW.js.map → chunk-QINC4TIT.js.map} +0 -0
  225. /package/dist/chunks/{chunk-KSFS3BI7.js.map → chunk-S72MTTOC.js.map} +0 -0
  226. /package/dist/chunks/{chunk-R23DP7S7.js.map → chunk-TGZ7OLDL.js.map} +0 -0
  227. /package/dist/chunks/{chunk-ZRAALEF2.js.map → chunk-TI7LE6F5.js.map} +0 -0
  228. /package/dist/chunks/{chunk-QU3LGVTZ.js.map → chunk-TTCXFX6V.js.map} +0 -0
  229. /package/dist/chunks/{chunk-ZRJYG2F2.js.map → chunk-VEOIRZH4.js.map} +0 -0
  230. /package/dist/chunks/{chunk-MYRLRBZG.js.map → chunk-VSLHC665.js.map} +0 -0
  231. /package/dist/chunks/{chunk-HXFPEA6Z.js.map → chunk-XB7HBRSL.js.map} +0 -0
  232. /package/dist/chunks/{chunk-2EDGH6Y3.js.map → chunk-ZGP5MF2Q.js.map} +0 -0
  233. /package/dist/chunks/{chunk-L7Q7QNNE.js.map → chunk-ZNO7XIZU.js.map} +0 -0
  234. /package/dist/chunks/{cli-runtime-74KKQHC7.js.map → cli-runtime-T6ZXKC2O.js.map} +0 -0
  235. /package/dist/chunks/{commands-2Q7KPVLW.js.map → commands-3RJ5HAMM.js.map} +0 -0
  236. /package/dist/chunks/{crash-report-KDVWQ2RR.js.map → crash-report-ZUP6NMRJ.js.map} +0 -0
  237. /package/dist/chunks/{dist-674RS73L.js.map → dist-5D7BTPT2.js.map} +0 -0
  238. /package/dist/chunks/{dist-4TGHKBRS.js.map → dist-72DFA26L.js.map} +0 -0
  239. /package/dist/chunks/{dist-Q523V5L2.js.map → dist-GXQCJQ53.js.map} +0 -0
  240. /package/dist/chunks/{dist-OMRUSJ5R.js.map → dist-HJCEE57U.js.map} +0 -0
  241. /package/dist/chunks/{dist-25C2CYHP.js.map → dist-I2Q3FRR4.js.map} +0 -0
  242. /package/dist/chunks/{dist-UYD7IXG3.js.map → dist-PE6GSYDP.js.map} +0 -0
  243. /package/dist/chunks/{dist-ZDSPMZ5S.js.map → dist-XFIOSXNS.js.map} +0 -0
  244. /package/dist/chunks/{doctor-TFION64N.js.map → doctor-FPBYPOAK.js.map} +0 -0
  245. /package/dist/chunks/{drain-3W3A4KPX.js.map → drain-N65CXI5H.js.map} +0 -0
  246. /package/dist/chunks/{eval-TCUVH3S3.js.map → eval-SYKBFGGU.js.map} +0 -0
  247. /package/dist/chunks/{home-FYDAEWNW.js.map → home-FJS5AXFZ.js.map} +0 -0
  248. /package/dist/chunks/{lifecycle-ALDBR656.js.map → lifecycle-5RWKT62M.js.map} +0 -0
  249. /package/dist/chunks/{list-Z4XOJJ7V.js.map → list-FUOU75RU.js.map} +0 -0
  250. /package/dist/chunks/{login-UZONOHHT.js.map → login-ELQCFAUF.js.map} +0 -0
  251. /package/dist/chunks/{logs-O3NGOQFC.js.map → logs-OBL6KGPA.js.map} +0 -0
  252. /package/dist/chunks/{mcp-YI6PL4TH.js.map → mcp-TFWJC56M.js.map} +0 -0
  253. /package/dist/chunks/{output-schema-KXKCYDI4.js.map → output-schema-35YWLD2S.js.map} +0 -0
  254. /package/dist/chunks/{pal-2EYYHPXC.js.map → pal-TN4YSFO6.js.map} +0 -0
  255. /package/dist/chunks/{providers-JF5SWSTH.js.map → providers-KC7IQHF7.js.map} +0 -0
  256. /package/dist/chunks/{resume-WR4KOI7Q.js.map → resume-ZLGRUFA3.js.map} +0 -0
  257. /package/dist/chunks/{resume-command-A3HKQSRH.js.map → resume-command-5FDSKSZR.js.map} +0 -0
  258. /package/dist/chunks/{schedule-QIJCYWIQ.js.map → schedule-ZVBIF6JZ.js.map} +0 -0
  259. /package/dist/chunks/{session-step-ZZBENVGS.js.map → session-step-XIYPMQA4.js.map} +0 -0
  260. /package/dist/chunks/{skills-AGU7FTRG.js.map → skills-B35Q357B.js.map} +0 -0
  261. /package/dist/chunks/{state-MTHK7DUX.js.map → state-YXNTJW67.js.map} +0 -0
  262. /package/dist/chunks/{store-EWEKEKSG.js.map → store-5BLKNUFX.js.map} +0 -0
  263. /package/dist/chunks/{store-LPOET7IK.js.map → store-5YOZ57L2.js.map} +0 -0
  264. /package/dist/chunks/{store-XPSGZANO.js.map → store-H5KCO6HN.js.map} +0 -0
  265. /package/dist/chunks/{upgrade-3YOFSMAQ.js.map → upgrade-64USK7BM.js.map} +0 -0
@@ -12568,17 +12568,17 @@ var SessionLogChain = class {
12568
12568
  /** Verify one complete line (newline included) found at `offset`. */
12569
12569
  accept(line, offset) {
12570
12570
  const expectedSeq = (this.#head?.seq ?? 0) + 1;
12571
- const fail = /* @__PURE__ */ __name((reason2, message, cause) => {
12571
+ const fail2 = /* @__PURE__ */ __name((reason2, message, cause) => {
12572
12572
  throw new SessionLogIntegrityError(reason2, expectedSeq, offset, `Session log breaks at seq ${expectedSeq} (byte ${offset}): ${message}`, cause === void 0 ? void 0 : { cause });
12573
12573
  }, "fail");
12574
12574
  if (offset !== this.end) {
12575
- fail("seq-gap", `the line starts at byte ${offset}, not at ${this.end} where the last one ended`);
12575
+ fail2("seq-gap", `the line starts at byte ${offset}, not at ${this.end} where the last one ended`);
12576
12576
  }
12577
12577
  let parsed;
12578
12578
  try {
12579
12579
  parsed = parseSessionLogLine(line);
12580
12580
  } catch (error) {
12581
- return fail("not-a-record", error instanceof SessionLogLineError ? error.message : String(error), error);
12581
+ return fail2("not-a-record", error instanceof SessionLogLineError ? error.message : String(error), error);
12582
12582
  }
12583
12583
  const { record: record3 } = parsed;
12584
12584
  const pointer2 = {
@@ -12589,35 +12589,35 @@ var SessionLogChain = class {
12589
12589
  };
12590
12590
  if (this.#head === null) {
12591
12591
  if (offset !== 0 || record3.seq !== 1 || record3.type !== "session_started") {
12592
- fail("bad-start", "a session log starts with session_started at seq 1, offset 0");
12592
+ fail2("bad-start", "a session log starts with session_started at seq 1, offset 0");
12593
12593
  }
12594
12594
  } else {
12595
12595
  if (record3.seq !== expectedSeq)
12596
- fail("seq-gap", `the record says seq ${record3.seq}`);
12596
+ fail2("seq-gap", `the record says seq ${record3.seq}`);
12597
12597
  if (!samePointer(record3.prev, this.#head)) {
12598
- fail("prev-mismatch", "its prev pointer does not name the bytes of the record before it (that record, or this pointer, was altered)");
12598
+ fail2("prev-mismatch", "its prev pointer does not name the bytes of the record before it (that record, or this pointer, was altered)");
12599
12599
  }
12600
12600
  }
12601
12601
  if (this.#sessionId !== void 0 && record3.sessionId !== this.#sessionId) {
12602
- fail("session-mismatch", `the record names session ${record3.sessionId}, not ${this.#sessionId}`);
12602
+ fail2("session-mismatch", `the record names session ${record3.sessionId}, not ${this.#sessionId}`);
12603
12603
  }
12604
12604
  if (record3.gen < this.#gen) {
12605
- fail("gen-regressed", `gen ${record3.gen} follows gen ${this.#gen}: a writer whose lease had been superseded appended after its successor`);
12605
+ fail2("gen-regressed", `gen ${record3.gen} follows gen ${this.#gen}: a writer whose lease had been superseded appended after its successor`);
12606
12606
  }
12607
- checkTextLink(record3, pointer2, fail);
12607
+ checkTextLink(record3, pointer2, fail2);
12608
12608
  this.#head = pointer2;
12609
12609
  this.#sessionId ??= record3.sessionId;
12610
12610
  this.#gen = record3.gen;
12611
12611
  return { record: record3, pointer: pointer2 };
12612
12612
  }
12613
12613
  };
12614
- function checkTextLink(record3, pointer2, fail) {
12614
+ function checkTextLink(record3, pointer2, fail2) {
12615
12615
  if (!Object.hasOwn(record3, "prevText"))
12616
12616
  return;
12617
12617
  const next = record3.prevText ?? null;
12618
12618
  const previous = record3.prev;
12619
12619
  if (next === null && previous !== null || next !== null && (previous === null || next.seq >= pointer2.seq || next.offset + next.length > pointer2.offset || next.seq === previous.seq && !samePointer(next, previous))) {
12620
- fail("bad-text-link", "its prevText skip link does not name an earlier record");
12620
+ fail2("bad-text-link", "its prevText skip link does not name an earlier record");
12621
12621
  }
12622
12622
  }
12623
12623
  __name(checkTextLink, "checkTextLink");
@@ -12703,8 +12703,8 @@ var EvidencePageLimit = class extends Error {
12703
12703
  __name(this, "EvidencePageLimit");
12704
12704
  }
12705
12705
  };
12706
- function stamp2(stat14) {
12707
- return [stat14.dev, stat14.ino, stat14.size, stat14.mtimeMs, stat14.ctimeMs].join(":");
12706
+ function stamp2(stat15) {
12707
+ return [stat15.dev, stat15.ino, stat15.size, stat15.mtimeMs, stat15.ctimeMs].join(":");
12708
12708
  }
12709
12709
  __name(stamp2, "stamp");
12710
12710
  async function noLinks(path2) {
@@ -13689,7 +13689,7 @@ async function* walkSessionLog(medium, options) {
13689
13689
  let chain;
13690
13690
  let start = 0;
13691
13691
  let brokeAt;
13692
- const fail = /* @__PURE__ */ __name((error) => {
13692
+ const fail2 = /* @__PURE__ */ __name((error) => {
13693
13693
  if (strict)
13694
13694
  throw error;
13695
13695
  brokeAt = error;
@@ -13698,7 +13698,7 @@ async function* walkSessionLog(medium, options) {
13698
13698
  const after = options.after;
13699
13699
  if (!await verifyPointer(medium, after)) {
13700
13700
  const error = new SessionLogIntegrityError("anchor-mismatch", after.seq, after.offset, `The log does not hold the record the cursor names (seq ${after.seq} at byte ${after.offset}).`);
13701
- fail(error);
13701
+ fail2(error);
13702
13702
  return { intact: false, throughSeq: 0, head: null, tornBytes: 0, break: error };
13703
13703
  }
13704
13704
  const parsed = parseSessionLogLine(await medium.read(after.offset, after.length));
@@ -13725,7 +13725,7 @@ async function* walkSessionLog(medium, options) {
13725
13725
  } catch (error) {
13726
13726
  if (!(error instanceof SessionLogIntegrityError))
13727
13727
  throw error;
13728
- fail(error);
13728
+ fail2(error);
13729
13729
  stopped = true;
13730
13730
  break outer;
13731
13731
  }
@@ -13733,7 +13733,7 @@ async function* walkSessionLog(medium, options) {
13733
13733
  anchorSeen = true;
13734
13734
  const e = options.expectHead;
13735
13735
  if (e.offset !== entry.pointer.offset || e.length !== entry.pointer.length || e.sha256 !== entry.pointer.sha256) {
13736
- fail(new SessionLogIntegrityError("anchor-mismatch", e.seq, entry.pointer.offset, `The record at seq ${e.seq} is not the one the anchor names; the log was altered.`));
13736
+ fail2(new SessionLogIntegrityError("anchor-mismatch", e.seq, entry.pointer.offset, `The record at seq ${e.seq} is not the one the anchor names; the log was altered.`));
13737
13737
  stopped = true;
13738
13738
  break outer;
13739
13739
  }
@@ -13747,14 +13747,14 @@ async function* walkSessionLog(medium, options) {
13747
13747
  } catch (error) {
13748
13748
  if (!(error instanceof SessionLogIntegrityError))
13749
13749
  throw error;
13750
- fail(error);
13750
+ fail2(error);
13751
13751
  stopped = true;
13752
13752
  break;
13753
13753
  }
13754
13754
  }
13755
13755
  if (!stopped && options.expectHead !== void 0 && !anchorSeen && brokeAt === void 0) {
13756
13756
  const e = options.expectHead;
13757
- fail(new SessionLogIntegrityError("anchor-mismatch", e.seq, chain.end, `The log ends at seq ${chain.head?.seq ?? 0}, before the anchored seq ${e.seq}; it was truncated.`));
13757
+ fail2(new SessionLogIntegrityError("anchor-mismatch", e.seq, chain.end, `The log ends at seq ${chain.head?.seq ?? 0}, before the anchored seq ${e.seq}; it was truncated.`));
13758
13758
  }
13759
13759
  const pointer2 = chain.head;
13760
13760
  return {
@@ -18010,8 +18010,8 @@ var DEFAULT_MAX_TOOL_OUTPUT_CHARS_PER_MESSAGE = 2e5;
18010
18010
  var MESSAGE_BUDGET_PREVIEW_CHARS = 2e3;
18011
18011
  var SPILL_MARKER = "The full output was written to:";
18012
18012
  var HEAD_SHARE = 0.75;
18013
- function safeHead(text9, maxChars) {
18014
- let end = Math.min(text9.length, Math.max(0, maxChars));
18013
+ function safeHead(text9, maxChars2) {
18014
+ let end = Math.min(text9.length, Math.max(0, maxChars2));
18015
18015
  if (end > 0) {
18016
18016
  const last = text9.charCodeAt(end - 1);
18017
18017
  if (last >= 55296 && last <= 56319)
@@ -18020,8 +18020,8 @@ function safeHead(text9, maxChars) {
18020
18020
  return text9.slice(0, end);
18021
18021
  }
18022
18022
  __name(safeHead, "safeHead");
18023
- function safeTail(text9, maxChars) {
18024
- let start = Math.max(0, text9.length - Math.max(0, maxChars));
18023
+ function safeTail(text9, maxChars2) {
18024
+ let start = Math.max(0, text9.length - Math.max(0, maxChars2));
18025
18025
  if (start < text9.length) {
18026
18026
  const first = text9.charCodeAt(start);
18027
18027
  if (first >= 56320 && first <= 57343)
@@ -18030,10 +18030,10 @@ function safeTail(text9, maxChars) {
18030
18030
  return text9.slice(start);
18031
18031
  }
18032
18032
  __name(safeTail, "safeTail");
18033
- function boundedPreview(output, maxChars, toolName, recovery) {
18033
+ function boundedPreview(output, maxChars2, toolName, recovery) {
18034
18034
  const detailedMiddle = [
18035
18035
  "",
18036
- `[... characters omitted \u2014 "${toolName}" returned ${output.length.toLocaleString()} characters, over the ${maxChars.toLocaleString()}-character budget ...]`,
18036
+ `[... characters omitted \u2014 "${toolName}" returned ${output.length.toLocaleString()} characters, over the ${maxChars2.toLocaleString()}-character budget ...]`,
18037
18037
  recovery,
18038
18038
  ""
18039
18039
  ].join("\n");
@@ -18041,10 +18041,10 @@ function boundedPreview(output, maxChars, toolName, recovery) {
18041
18041
  const spillLine = recovery.split("\n").find((line) => line.startsWith(SPILL_MARKER));
18042
18042
  const compactRecovery = spillLine ? `${compactMiddle}${spillLine}
18043
18043
  ` : compactMiddle;
18044
- const middle = detailedMiddle.length < maxChars ? detailedMiddle : compactRecovery.length < maxChars ? compactRecovery : compactMiddle;
18045
- if (middle.length >= maxChars)
18046
- return safeHead(middle, maxChars);
18047
- const sourceChars = maxChars - middle.length;
18044
+ const middle = detailedMiddle.length < maxChars2 ? detailedMiddle : compactRecovery.length < maxChars2 ? compactRecovery : compactMiddle;
18045
+ if (middle.length >= maxChars2)
18046
+ return safeHead(middle, maxChars2);
18047
+ const sourceChars = maxChars2 - middle.length;
18048
18048
  const headChars = Math.max(1, Math.floor(sourceChars * HEAD_SHARE));
18049
18049
  const tailChars = Math.max(0, sourceChars - headChars);
18050
18050
  return `${safeHead(output, headChars)}${middle}${safeTail(output, tailChars)}`;
@@ -18078,9 +18078,9 @@ function measureContentBytes(content) {
18078
18078
  }
18079
18079
  __name(measureContentBytes, "measureContentBytes");
18080
18080
  function applyToolOutputBudget(opts) {
18081
- const { output, maxChars } = opts;
18081
+ const { output, maxChars: maxChars2 } = opts;
18082
18082
  const originalLength = output.length;
18083
- const limit = Number.isFinite(maxChars) && maxChars > 0 ? Math.floor(maxChars) : void 0;
18083
+ const limit = Number.isFinite(maxChars2) && maxChars2 > 0 ? Math.floor(maxChars2) : void 0;
18084
18084
  const notice = opts.notice ? limit === void 0 ? opts.notice : safeHead(opts.notice, limit) : "";
18085
18085
  const textBudget = limit === void 0 ? void 0 : Math.max(0, limit - notice.length - (notice && output ? 2 : 0));
18086
18086
  const withNotice = /* @__PURE__ */ __name((text9) => [text9, notice].filter(Boolean).join("\n\n"), "withNotice");
@@ -45782,7 +45782,7 @@ var ToolExecutor = class {
45782
45782
  * messages, so what it writes is what every later request replays.
45783
45783
  */
45784
45784
  fitBatchToMessageBudget(results) {
45785
- const maxChars = this.config.maxToolOutputCharsPerMessage ?? DEFAULT_MAX_TOOL_OUTPUT_CHARS_PER_MESSAGE;
45785
+ const maxChars2 = this.config.maxToolOutputCharsPerMessage ?? DEFAULT_MAX_TOOL_OUTPUT_CHARS_PER_MESSAGE;
45786
45786
  const replacements = fitResultsToMessageBudget(results.map((r) => ({
45787
45787
  toolCallId: r.toolCallId,
45788
45788
  toolName: r.toolName,
@@ -45792,7 +45792,7 @@ var ToolExecutor = class {
45792
45792
  // already decided its own size.
45793
45793
  replaceable: r.content === void 0 && r.structuredResultJson === void 0 && this.config.tools.get(r.toolName)?.selfLimitingOutput !== true
45794
45794
  })), {
45795
- maxChars,
45795
+ maxChars: maxChars2,
45796
45796
  spillDir: this.outputDirectory(),
45797
45797
  onError: /* @__PURE__ */ __name((message) => this.log.warn("Failed to retain a tool output replaced for the message budget", {
45798
45798
  [NAMZU.TURN_ID]: this.config.turnId,
@@ -45810,7 +45810,7 @@ var ToolExecutor = class {
45810
45810
  this.log.warn("Tool results exceeded the message's combined budget", {
45811
45811
  [NAMZU.TURN_ID]: this.config.turnId,
45812
45812
  "namzu.runtime.replaced_count": replacements.size,
45813
- "namzu.runtime.message_budget_chars": maxChars
45813
+ "namzu.runtime.message_budget_chars": maxChars2
45814
45814
  });
45815
45815
  }
45816
45816
  /**
@@ -46112,6 +46112,7 @@ var ToolExecutor = class {
46112
46112
  dispatchTool: /* @__PURE__ */ __name((name2, input, options) => this.dispatchNested(name2, input, context2, recordObservation, void 0, options), "dispatchTool"),
46113
46113
  sandbox: this.config.sandbox,
46114
46114
  fileReadTracker: this.fileReadTracker,
46115
+ ...this.config.codeAnalysis ? { codeAnalysis: this.config.codeAnalysis } : {},
46115
46116
  // Bound to this turn, once. Binding here rather than passing the
46116
46117
  // owner from the tool is what makes the scoping structural: there
46117
46118
  // is no argument a tool could pass to reach another turn's jobs.
@@ -47078,6 +47079,7 @@ var ToolingBootstrap = class {
47078
47079
  tools: config.tools,
47079
47080
  ...config.durableStructuredOutputTool ? { durableStructuredOutputTool: config.durableStructuredOutputTool } : {},
47080
47081
  ...config.fileReadTracker ? { fileReadTracker: config.fileReadTracker } : {},
47082
+ ...config.codeAnalysis ? { codeAnalysis: config.codeAnalysis } : {},
47081
47083
  sessionId: config.sessionId,
47082
47084
  turnId: config.turnId,
47083
47085
  workingDirectory: config.workingDirectory,
@@ -47378,6 +47380,7 @@ async function* query(params) {
47378
47380
  ...params.skillRegistry ? { skills: params.skillRegistry } : {},
47379
47381
  ...params.web ? { web: params.web } : {},
47380
47382
  ...params.fileReadTracker ? { fileReadTracker: params.fileReadTracker } : {},
47383
+ ...params.codeAnalysis ? { codeAnalysis: params.codeAnalysis } : {},
47381
47384
  ...params.toolTimeoutMs !== void 0 ? { toolTimeoutMs: params.toolTimeoutMs } : {},
47382
47385
  ...params.toolRetryBackoff !== void 0 ? { toolRetryBackoff: params.toolRetryBackoff } : {},
47383
47386
  ...params.maxToolCalls !== void 0 ? {
@@ -50546,13 +50549,13 @@ __name(positive2, "positive");
50546
50549
  function createMemoryRecallStep(options) {
50547
50550
  const maxMemories = positive2(options.maxMemories ?? 3, "maxMemories");
50548
50551
  const maxScanned = positive2(options.maxScanned ?? 256, "maxScanned");
50549
- const maxChars = positive2(options.maxChars ?? 6e3, "maxChars");
50552
+ const maxChars2 = positive2(options.maxChars ?? 6e3, "maxChars");
50550
50553
  const timeoutMs = positive2(options.timeoutMs ?? 1e3, "timeoutMs");
50551
50554
  const ageNoticeAfterMs = positive2(options.ageNoticeAfterMs ?? 864e5, "ageNoticeAfterMs");
50552
50555
  const now = options.now ?? Date.now;
50553
50556
  return async ({ messages, prepared, latestUserMessage, contextBudget, signal }) => {
50554
50557
  signal?.throwIfAborted();
50555
- const charBudget = Math.min(maxChars, Math.max(0, Math.floor(contextBudget?.remainingTokens ?? maxChars)));
50558
+ const charBudget = Math.min(maxChars2, Math.max(0, Math.floor(contextBudget?.remainingTokens ?? maxChars2)));
50556
50559
  const query2 = latestUserMessage?.content ?? options.query ?? latestQuery(messages) ?? "";
50557
50560
  const anchors = new Set(options.identifierGrounding === true ? identifiers(query2.slice(-4e3)) : []);
50558
50561
  const terms2 = [
@@ -51473,8 +51476,8 @@ function createJsonClaimVerifier(options) {
51473
51476
  }).finally(() => {
51474
51477
  pending2--;
51475
51478
  });
51476
- const aborted = new Promise((_, fail) => {
51477
- const listener = /* @__PURE__ */ __name(() => fail(controller.signal.reason), "listener");
51479
+ const aborted = new Promise((_, fail2) => {
51480
+ const listener = /* @__PURE__ */ __name(() => fail2(controller.signal.reason), "listener");
51478
51481
  controller.signal.addEventListener("abort", listener, { once: true });
51479
51482
  removeAbort = /* @__PURE__ */ __name(() => controller.signal.removeEventListener("abort", listener), "removeAbort");
51480
51483
  });
@@ -53030,18 +53033,18 @@ var MarkdownMemoryStore = class {
53030
53033
  if (!fileName2.endsWith(".md") || fileName2 === MEMORY_INDEX_FILE)
53031
53034
  continue;
53032
53035
  const path2 = join24(dir, fileName2);
53033
- const stat14 = await lstat6(path2).catch((error) => {
53036
+ const stat15 = await lstat6(path2).catch((error) => {
53034
53037
  if (error.code === "ENOENT")
53035
53038
  return void 0;
53036
53039
  throw error;
53037
53040
  });
53038
- if (!stat14)
53041
+ if (!stat15)
53039
53042
  continue;
53040
- if (stat14.isSymbolicLink())
53043
+ if (stat15.isSymbolicLink())
53041
53044
  invalidFile(path2, "a memory file must not be a symlink");
53042
- if (!stat14.isFile())
53045
+ if (!stat15.isFile())
53043
53046
  invalidFile(path2, "a memory file must be a regular file");
53044
- if (stat14.size > MEMORY_FILE_MAX_BYTES) {
53047
+ if (stat15.size > MEMORY_FILE_MAX_BYTES) {
53045
53048
  invalidFile(path2, `larger than the ${MEMORY_FILE_MAX_BYTES}-byte memory file limit`);
53046
53049
  }
53047
53050
  const bytes = await readFile14(path2);
@@ -53053,7 +53056,7 @@ var MarkdownMemoryStore = class {
53053
53056
  }
53054
53057
  if (raw.includes("\0"))
53055
53058
  invalidFile(path2, "contains NUL bytes");
53056
- const record3 = decodeMemoryFile(raw, path2, fileName2, stat14.mtimeMs);
53059
+ const record3 = decodeMemoryFile(raw, path2, fileName2, stat15.mtimeMs);
53057
53060
  const other = loaded.get(record3.entry.id);
53058
53061
  if (other) {
53059
53062
  const renamedHandWritten = /* @__PURE__ */ __name((a, b) => !a.dated && a.derived && b.dated && !b.derived && a.entry.updatedAt < b.entry.updatedAt, "renamedHandWritten");
@@ -55201,7 +55204,7 @@ function enumToZod(values) {
55201
55204
  }
55202
55205
  __name(enumToZod, "enumToZod");
55203
55206
  function mcpToolToToolDefinition(tool, client, serverName, readOnlyHintTrusted = false, maxRetries) {
55204
- const inputSchema16 = mcpJsonSchemaToZod(tool.inputSchema);
55207
+ const inputSchema17 = mcpJsonSchemaToZod(tool.inputSchema);
55205
55208
  const toolName = `mcp_${serverName}_${tool.name}`;
55206
55209
  const mcpMetadata = {};
55207
55210
  if (tool.annotations?.title !== void 0)
@@ -55218,7 +55221,7 @@ function mcpToolToToolDefinition(tool, client, serverName, readOnlyHintTrusted =
55218
55221
  return {
55219
55222
  name: toolName,
55220
55223
  description: tool.description ? `[MCP:${serverName}] ${tool.description}` : `[MCP:${serverName}] ${tool.name}`,
55221
- inputSchema: inputSchema16,
55224
+ inputSchema: inputSchema17,
55222
55225
  // Carried as the server wrote it. It is shown to the model, never
55223
55226
  // validated here, so rebuilding it would only lose fidelity.
55224
55227
  ...tool.outputSchema ? {
@@ -58016,10 +58019,10 @@ function refuse(reason2) {
58016
58019
  return { ok: false, reason: reason2 };
58017
58020
  }
58018
58021
  __name(refuse, "refuse");
58019
- function validateMcpHeaderAnnotations(inputSchema16) {
58020
- if (!isPlainObject4(inputSchema16))
58022
+ function validateMcpHeaderAnnotations(inputSchema17) {
58023
+ if (!isPlainObject4(inputSchema17))
58021
58024
  return NO_BINDINGS;
58022
- const found = annotationsIn(inputSchema16);
58025
+ const found = annotationsIn(inputSchema17);
58023
58026
  if (found.length === 0)
58024
58027
  return NO_BINDINGS;
58025
58028
  const bindings = [];
@@ -58348,7 +58351,7 @@ async function resolveMcpEra(input) {
58348
58351
  __name(resolveMcpEra, "resolveMcpEra");
58349
58352
 
58350
58353
  // ../sdk/dist/version.js
58351
- var VERSION2 = "52.1.0";
58354
+ var VERSION2 = "52.2.0";
58352
58355
 
58353
58356
  // ../sdk/dist/connector/mcp/client.js
58354
58357
  var MAX_LIST_PAGES = 100;
@@ -61943,13 +61946,13 @@ function createResidentStepContext(options) {
61943
61946
  const resolveSources = options.resolveLearningSources;
61944
61947
  const selected = /* @__PURE__ */ new Set();
61945
61948
  const profileChars = projectResidentLearning(learning, { maxChars: 12e3, skillNames: [] }).text.length;
61946
- const project = /* @__PURE__ */ __name((names, maxChars = 12e3) => {
61949
+ const project = /* @__PURE__ */ __name((names, maxChars2 = 12e3) => {
61947
61950
  let sources = [];
61948
61951
  try {
61949
61952
  sources = resolveSources?.() ?? [];
61950
61953
  } catch {
61951
61954
  }
61952
- return projectResidentLearning({ ...learning, identity: void 0, preferences: [] }, { maxChars, skillNames: names, sources });
61955
+ return projectResidentLearning({ ...learning, identity: void 0, preferences: [] }, { maxChars: maxChars2, skillNames: names, sources });
61953
61956
  }, "project");
61954
61957
  const catalogue = taskSkills.map((skill) => ({
61955
61958
  name: skill.name,
@@ -62935,7 +62938,7 @@ function visibleText(messages, prepared) {
62935
62938
  return texts;
62936
62939
  }
62937
62940
  __name(visibleText, "visibleText");
62938
- function continuationHints(batch, maxChars) {
62941
+ function continuationHints(batch, maxChars2) {
62939
62942
  const hints = batch.continuations === void 0 ? [] : batch.continuations;
62940
62943
  if (!Array.isArray(hints) || hints.length > 4 || hints.length && !batch.incomplete)
62941
62944
  throw new Error("Evidence recall returned invalid continuations.");
@@ -62952,7 +62955,7 @@ function continuationHints(batch, maxChars) {
62952
62955
  input: Object.fromEntries(entries2)
62953
62956
  });
62954
62957
  }
62955
- if (JSON.stringify(result).length > maxChars)
62958
+ if (JSON.stringify(result).length > maxChars2)
62956
62959
  throw new Error("Evidence recall continuations exceeded their output bound.");
62957
62960
  return result;
62958
62961
  }
@@ -62977,7 +62980,7 @@ function createScopedEvidenceRecallStep(options, boundary2) {
62977
62980
  const headerText = boundary2.kind === "resident" ? HEADER2.replace("conversation evidence", "resident evidence") : HEADER2;
62978
62981
  const address2 = boundary2.address;
62979
62982
  const retrieve = options.retrieve;
62980
- const maxChars = bounded(options.maxChars ?? 6e3, 12e3, "maxChars");
62983
+ const maxChars2 = bounded(options.maxChars ?? 6e3, 12e3, "maxChars");
62981
62984
  const maxPassages = bounded(options.maxPassages ?? 4, 8, "maxPassages");
62982
62985
  const timeoutMs = bounded(options.timeoutMs ?? 1e3, 1e4, "timeoutMs");
62983
62986
  const fallbackQuery = options.query;
@@ -62985,7 +62988,7 @@ function createScopedEvidenceRecallStep(options, boundary2) {
62985
62988
  return async (context2) => {
62986
62989
  const { sessionId: sessionId5, turnId: turnId6, messages, prepared, latestUserMessage, contextBudget, signal, captureSessionEvidence } = context2;
62987
62990
  signal?.throwIfAborted();
62988
- const charBudget = Math.min(maxChars, Math.max(0, Math.floor(contextBudget?.remainingTokens ?? maxChars)));
62991
+ const charBudget = Math.min(maxChars2, Math.max(0, Math.floor(contextBudget?.remainingTokens ?? maxChars2)));
62989
62992
  const query2 = latestUserMessage?.content ?? fallbackQuery ?? queryFrom(messages);
62990
62993
  const selectedQuery = boundary2.selectQuery?.(context2);
62991
62994
  let terms2 = evidenceRecallQueryTokens(query2).slice(0, 16);
@@ -66366,12 +66369,12 @@ main().catch((error) => parentPort.postMessage({ kind: 'error', error: String(er
66366
66369
  // ../sdk/dist/execution/code-runtime/worker.js
66367
66370
  var WRAPPER_LINES = 1;
66368
66371
  var FRAME_PATTERN = /model-program\.js:(\d+):(\d+)/g;
66369
- function failureLocation(name2, stack, sourceLines) {
66372
+ function failureLocation(name2, stack, sourceLines2) {
66370
66373
  const frames = [];
66371
66374
  if (typeof stack === "string") {
66372
66375
  for (const match2 of stack.matchAll(FRAME_PATTERN)) {
66373
66376
  const line = Number(match2[1]) - WRAPPER_LINES;
66374
- if (line >= 1 && line <= sourceLines)
66377
+ if (line >= 1 && line <= sourceLines2)
66375
66378
  frames.push({ line, column: Number(match2[2]) });
66376
66379
  }
66377
66380
  }
@@ -76546,8 +76549,8 @@ function boundary(text9, offset) {
76546
76549
  return !(current >= 56320 && current <= 57343 && previous >= 55296 && previous <= 56319);
76547
76550
  }
76548
76551
  __name(boundary, "boundary");
76549
- function textSlice(text9, offset, maxChars) {
76550
- let end = Math.min(text9.length, offset + maxChars);
76552
+ function textSlice(text9, offset, maxChars2) {
76553
+ let end = Math.min(text9.length, offset + maxChars2);
76551
76554
  if (!boundary(text9, end))
76552
76555
  end--;
76553
76556
  return text9.slice(offset, end);
@@ -80546,8 +80549,8 @@ var DiskPalCommunicationStore = class {
80546
80549
  }
80547
80550
  directory(path2) {
80548
80551
  mkdirSync6(path2, { recursive: true, mode: 448 });
80549
- const stat14 = lstatSync8(path2);
80550
- if (!stat14.isDirectory() || stat14.isSymbolicLink() || realpathSync7(path2) !== path2)
80552
+ const stat15 = lstatSync8(path2);
80553
+ if (!stat15.isDirectory() || stat15.isSymbolicLink() || realpathSync7(path2) !== path2)
80551
80554
  throw new Error("Pal communication requires a real directory without aliases.");
80552
80555
  this.secure(path2);
80553
80556
  }
@@ -80564,8 +80567,8 @@ var DiskPalCommunicationStore = class {
80564
80567
  for (const name2 of readdirSync3(revisionsDir)) {
80565
80568
  if (!/^[1-9][0-9]*\.json$/u.test(name2))
80566
80569
  continue;
80567
- const stat14 = lstatSync8(join39(revisionsDir, name2));
80568
- if (!stat14.isFile() || stat14.isSymbolicLink())
80570
+ const stat15 = lstatSync8(join39(revisionsDir, name2));
80571
+ if (!stat15.isFile() || stat15.isSymbolicLink())
80569
80572
  throw new Error("Pal communication commit must be a real file.");
80570
80573
  }
80571
80574
  return {
@@ -81734,8 +81737,8 @@ var DiskPalActivitySubscriptionStore = class {
81734
81737
  }
81735
81738
  directory(path2) {
81736
81739
  mkdirSync8(path2, { recursive: true, mode: 448 });
81737
- const stat14 = lstatSync10(path2);
81738
- if (!stat14.isDirectory() || stat14.isSymbolicLink() || realpathSync9(path2) !== path2)
81740
+ const stat15 = lstatSync10(path2);
81741
+ if (!stat15.isDirectory() || stat15.isSymbolicLink() || realpathSync9(path2) !== path2)
81739
81742
  throw new Error("Pal subscriptions require real directories without aliases.");
81740
81743
  this.secure(path2);
81741
81744
  }
@@ -81749,8 +81752,8 @@ var DiskPalActivitySubscriptionStore = class {
81749
81752
  for (const name2 of readdirSync5(revisionsDir)) {
81750
81753
  if (!/^[1-9][0-9]*\.json$/u.test(name2))
81751
81754
  continue;
81752
- const stat14 = lstatSync10(join41(revisionsDir, name2));
81753
- if (!stat14.isFile() || stat14.isSymbolicLink())
81755
+ const stat15 = lstatSync10(join41(revisionsDir, name2));
81756
+ if (!stat15.isFile() || stat15.isSymbolicLink())
81754
81757
  throw new Error("Pal subscription commits must be real files.");
81755
81758
  }
81756
81759
  return {
@@ -81892,8 +81895,8 @@ var DiskPalActivitySubscriptionPolicy = class {
81892
81895
  }
81893
81896
  directory(path2) {
81894
81897
  mkdirSync9(path2, { recursive: true, mode: 448 });
81895
- const stat14 = lstatSync11(path2);
81896
- if (!stat14.isDirectory() || stat14.isSymbolicLink() || realpathSync10(path2) !== path2)
81898
+ const stat15 = lstatSync11(path2);
81899
+ if (!stat15.isDirectory() || stat15.isSymbolicLink() || realpathSync10(path2) !== path2)
81897
81900
  throw new Error("Pal activity permissions require real directories without aliases.");
81898
81901
  this.secure(path2);
81899
81902
  }
@@ -81907,8 +81910,8 @@ var DiskPalActivitySubscriptionPolicy = class {
81907
81910
  for (const name2 of readdirSync6(revisionsDir)) {
81908
81911
  if (!/^[1-9][0-9]*\.json$/u.test(name2))
81909
81912
  continue;
81910
- const stat14 = lstatSync11(join42(revisionsDir, name2));
81911
- if (!stat14.isFile() || stat14.isSymbolicLink())
81913
+ const stat15 = lstatSync11(join42(revisionsDir, name2));
81914
+ if (!stat15.isFile() || stat15.isSymbolicLink())
81912
81915
  throw new Error("Pal permission commits must be real files.");
81913
81916
  }
81914
81917
  return {
@@ -82288,9 +82291,334 @@ function createPalActivityCausalityResolver(options) {
82288
82291
  }
82289
82292
  __name(createPalActivityCausalityResolver, "createPalActivityCausalityResolver");
82290
82293
 
82294
+ // ../sdk/dist/tools/builtins/code-analysis.js
82295
+ import { realpath as realpath11, stat as stat12 } from "node:fs/promises";
82296
+ var DEFAULT_LIMIT = 50;
82297
+ var MAX_LIMIT = 200;
82298
+ var DEFAULT_MAX_CHARS = 2e4;
82299
+ var MAX_MAX_CHARS = 2e5;
82300
+ var paging = {
82301
+ limit: external_exports.number().int().min(1).max(MAX_LIMIT).optional().describe(`Results per page (default ${DEFAULT_LIMIT}, max ${MAX_LIMIT}).`),
82302
+ cursor: external_exports.string().optional().describe("`next cursor` from the previous page, unchanged.")
82303
+ };
82304
+ var maxChars = external_exports.number().int().min(200).max(MAX_MAX_CHARS).optional().describe(`Cap on source shown (default ${DEFAULT_MAX_CHARS}); a cut is reported.`);
82305
+ var indexOp = external_exports.object({
82306
+ operation: external_exports.literal("index").describe("Build or refresh the index (incremental). Other operations build it on first use."),
82307
+ path: external_exports.string().optional().describe("A session directory; defaults to the working directory."),
82308
+ force: external_exports.boolean().optional().describe("Re-read every file.")
82309
+ });
82310
+ var findLiteralOp = external_exports.object({
82311
+ operation: external_exports.literal("find_literal").describe("Find string/template literals containing `text`, each with its enclosing function."),
82312
+ text: external_exports.string().min(1),
82313
+ path: external_exports.string().optional().describe("File or directory to search; defaults to the working directory."),
82314
+ case_sensitive: external_exports.boolean().optional().describe("Default true."),
82315
+ ...paging
82316
+ });
82317
+ var enclosingOp = external_exports.object({
82318
+ operation: external_exports.literal("enclosing_function").describe("The function containing a position: exact source, line range, parent chain."),
82319
+ path: external_exports.string(),
82320
+ line: external_exports.number().int().min(1).describe("1-based."),
82321
+ column: external_exports.number().int().min(1).optional().describe("1-based UTF-16 column (default 1); needed on minified lines."),
82322
+ max_chars: maxChars
82323
+ });
82324
+ var functionSourceOp = external_exports.object({
82325
+ operation: external_exports.literal("function_source").describe("A function's exact source, by `function_id` from a result, or by `path` and `name`."),
82326
+ function_id: external_exports.number().int().min(0).optional(),
82327
+ path: external_exports.string().optional(),
82328
+ name: external_exports.string().min(1).optional(),
82329
+ max_chars: maxChars,
82330
+ ...paging
82331
+ });
82332
+ var callersOp = external_exports.object({
82333
+ operation: external_exports.literal("callers_of").describe("Call sites of a callee TEXT (not scope-aware), each with its caller. Per file by default."),
82334
+ name: external_exports.string().min(1).describe("Callee text: `foo`, `obj.foo`, `this.foo`."),
82335
+ scope: external_exports.enum(["file", "workspace"]).optional().describe("`file` (default) needs `path`; `workspace` mixes same-named functions."),
82336
+ path: external_exports.string().optional(),
82337
+ match: external_exports.enum(["exact", "member"]).optional().describe("`member` also matches `<expr>.name`."),
82338
+ ...paging
82339
+ });
82340
+ var importsOp = external_exports.object({
82341
+ operation: external_exports.literal("imports").describe("One file's imports and exports."),
82342
+ path: external_exports.string(),
82343
+ ...paging
82344
+ });
82345
+ var inputSchema6 = external_exports.discriminatedUnion("operation", [
82346
+ indexOp,
82347
+ findLiteralOp,
82348
+ enclosingOp,
82349
+ functionSourceOp,
82350
+ callersOp,
82351
+ importsOp
82352
+ ]);
82353
+ var CODE_ANALYSIS_TOOL_NAME = "code_analysis";
82354
+ var CodeAnalysisTool = defineTool({
82355
+ name: CODE_ANALYSIS_TOOL_NAME,
82356
+ // The first sentence is the discovery hint a deferred listing shows (about
82357
+ // 100 characters), so it carries the two reasons to reach for this tool.
82358
+ description: "Find which function holds a string in minified or unfamiliar JS/TS bundles; read it, list callers. Paged and cited as path:line:column; each result says what was observed, what was inferred and whether coverage is complete. Also lists a file's imports.",
82359
+ inputSchema: inputSchema6,
82360
+ category: "filesystem",
82361
+ // Declared so a path outside the turn's roots can be reviewed before the
82362
+ // call runs, rather than refused after. See `ToolDefinition.pathArgument`.
82363
+ pathArgument: "path",
82364
+ permissions: ["file_read"],
82365
+ // Reads source files and writes only its own cache, outside the roots.
82366
+ readOnly: true,
82367
+ destructive: false,
82368
+ concurrencySafe: true,
82369
+ async execute(input, context2) {
82370
+ const provider = context2.codeAnalysis;
82371
+ if (!provider) {
82372
+ return fail("This turn has no code analysis provider, so there is no index to query. A host supplies one on the tool context; `grep` is the fallback, and it answers a different question.");
82373
+ }
82374
+ if (context2.sandbox) {
82375
+ return fail("This turn runs in a sandbox, and the code index reads the host file system, not the sandbox workspace. Use `grep` and `read` here.");
82376
+ }
82377
+ const roots = toolRoots(context2);
82378
+ let target;
82379
+ try {
82380
+ target = await resolveWithinAnyReal(roots, input.path);
82381
+ } catch (err) {
82382
+ return fail(err instanceof Error ? err.message : String(err));
82383
+ }
82384
+ const owner = await owningRoot(roots, target);
82385
+ if (owner.kind === "file") {
82386
+ return fail(`${target} was reached as a single file, not through a directory this turn may read, and the index is built over a directory. Ask the user to add its directory to the session.`);
82387
+ }
82388
+ if (owner.kind === "none") {
82389
+ return fail(`No readable directory of this turn contains ${target}.`);
82390
+ }
82391
+ const root = owner.root;
82392
+ switch (input.operation) {
82393
+ case "index": {
82394
+ const result = await provider.index({
82395
+ root,
82396
+ // A narrower path indexes just that part of the root, which is
82397
+ // how a root too big to index whole is covered in steps.
82398
+ ...target !== root ? { scope: target } : {},
82399
+ ...input.force ? { force: true } : {},
82400
+ ...signalOf(context2)
82401
+ });
82402
+ return render3(result, (value) => {
82403
+ const f = value.files;
82404
+ const lines2 = [
82405
+ `Indexed ${value.root}: ${f.indexed} files (${f.parsed} parsed, ${f.unchanged} unchanged, ${f.removed} removed, ${f.skipped} skipped, ${f.withParseErrors} with parse errors) in ${value.durationMs} ms.`,
82406
+ `${value.functions} functions, ${value.strings} string literals, ${value.calls} calls. ${value.persisted ? "Cached on disk." : "Held in memory only; it is gone when this process exits."}`
82407
+ ];
82408
+ if (value.truncated)
82409
+ lines2.push(value.truncated);
82410
+ const reasons = Object.entries(value.skippedReasons);
82411
+ if (reasons.length > 0) {
82412
+ lines2.push(`Skipped: ${reasons.map(([why, n]) => `${n} ${why}`).join(", ")}.`);
82413
+ }
82414
+ return lines2;
82415
+ });
82416
+ }
82417
+ case "find_literal": {
82418
+ const result = await provider.findLiteral({
82419
+ root,
82420
+ text: input.text,
82421
+ path: target,
82422
+ ...input.case_sensitive === false ? { caseSensitive: false } : {},
82423
+ ...pageArgs(input),
82424
+ ...signalOf(context2)
82425
+ });
82426
+ return renderPage(result, (hit) => {
82427
+ const where = `${hit.path}:${hit.line}:${hit.column}`;
82428
+ const shown = JSON.stringify(hit.value) + (hit.valueTruncated ? " (cut)" : "");
82429
+ const inside = hit.function ? ` in ${describeFunction(hit.function)}` : " at top level";
82430
+ return `${where} ${hit.kind} ${shown}${inside}${staleMark(hit.stale)}`;
82431
+ });
82432
+ }
82433
+ case "enclosing_function": {
82434
+ const result = await provider.enclosingFunction({
82435
+ root,
82436
+ path: target,
82437
+ line: input.line,
82438
+ ...input.column !== void 0 ? { column: input.column } : {},
82439
+ maxChars: input.max_chars ?? DEFAULT_MAX_CHARS,
82440
+ ...signalOf(context2)
82441
+ });
82442
+ return render3(result, (value) => {
82443
+ if (!value.function) {
82444
+ return [`${target}:${input.line}:${input.column ?? 1} is not inside any function.`];
82445
+ }
82446
+ const lines2 = [`${describeFunction(value.function)}`];
82447
+ if (value.parents.length > 0) {
82448
+ lines2.push(`parents: ${value.parents.map(describeFunction).join(" < ")}`);
82449
+ }
82450
+ if (value.source)
82451
+ lines2.push(...sourceLines(value.source));
82452
+ return lines2;
82453
+ });
82454
+ }
82455
+ case "function_source": {
82456
+ if (input.function_id === void 0 && !(input.path !== void 0 && input.name)) {
82457
+ return fail("function_source needs `function_id`, or `path` together with `name`.");
82458
+ }
82459
+ const result = await provider.functionSource({
82460
+ root,
82461
+ ...input.function_id !== void 0 ? { id: input.function_id } : {},
82462
+ ...input.name ? { name: input.name, path: target } : {},
82463
+ maxChars: input.max_chars ?? DEFAULT_MAX_CHARS,
82464
+ ...pageArgs(input),
82465
+ ...signalOf(context2)
82466
+ });
82467
+ return renderPage(result, (item) => [
82468
+ describeFunction(item.function),
82469
+ item.parents.length > 0 ? `parents: ${item.parents.map(describeFunction).join(" < ")}` : void 0,
82470
+ ...sourceLines(item.source)
82471
+ ].filter((l) => l !== void 0).join("\n"));
82472
+ }
82473
+ case "callers_of": {
82474
+ const scope = input.scope ?? "file";
82475
+ if (scope === "file" && input.path === void 0) {
82476
+ return fail('callers_of looks in one file by default, so it needs `path`. Pass `scope: "workspace"` to search the whole index; it matches by name only and will mix unrelated functions that share one.');
82477
+ }
82478
+ const result = await provider.callersOf({
82479
+ root,
82480
+ name: input.name,
82481
+ scope,
82482
+ ...input.path !== void 0 ? { path: target } : {},
82483
+ ...input.match ? { match: input.match } : {},
82484
+ ...pageArgs(input),
82485
+ ...signalOf(context2)
82486
+ });
82487
+ return renderPage(result, (site) => {
82488
+ const inside = site.caller ? ` in ${describeFunction(site.caller)}` : " at top level";
82489
+ return `${site.path}:${site.line}:${site.column} ${site.kind === "new" ? "new " : ""}${site.callee}(${site.argumentCount} arg${site.argumentCount === 1 ? "" : "s"})${inside}${staleMark(site.stale)}`;
82490
+ });
82491
+ }
82492
+ case "imports": {
82493
+ const result = await provider.imports({
82494
+ root,
82495
+ path: target,
82496
+ ...pageArgs(input),
82497
+ ...signalOf(context2)
82498
+ });
82499
+ return renderPage(result, (edge) => describeEdge(edge, target));
82500
+ }
82501
+ }
82502
+ }
82503
+ });
82504
+ function signalOf(context2) {
82505
+ return context2.abortSignal ? { signal: context2.abortSignal } : {};
82506
+ }
82507
+ __name(signalOf, "signalOf");
82508
+ function staleMark(stale) {
82509
+ if (stale === "deleted")
82510
+ return " [file deleted since indexed]";
82511
+ if (stale === "changed")
82512
+ return " [file changed since indexed; position may be off]";
82513
+ return "";
82514
+ }
82515
+ __name(staleMark, "staleMark");
82516
+ function fail(error) {
82517
+ return { success: false, output: "", error };
82518
+ }
82519
+ __name(fail, "fail");
82520
+ function pageArgs(input) {
82521
+ return {
82522
+ limit: input.limit ?? DEFAULT_LIMIT,
82523
+ ...input.cursor !== void 0 ? { cursor: input.cursor } : {}
82524
+ };
82525
+ }
82526
+ __name(pageArgs, "pageArgs");
82527
+ async function owningRoot(roots, target) {
82528
+ let sawFile = false;
82529
+ for (const candidate of roots) {
82530
+ let real;
82531
+ try {
82532
+ real = await realpath11(candidate);
82533
+ if (!(await stat12(real)).isDirectory()) {
82534
+ if (isWithin(real, target) || real === target)
82535
+ sawFile = true;
82536
+ continue;
82537
+ }
82538
+ } catch {
82539
+ continue;
82540
+ }
82541
+ if (isWithin(real, target))
82542
+ return { kind: "dir", root: real };
82543
+ }
82544
+ return sawFile ? { kind: "file" } : { kind: "none" };
82545
+ }
82546
+ __name(owningRoot, "owningRoot");
82547
+ function describeFunction(fn) {
82548
+ const lines2 = fn.endLine === fn.line ? `line ${fn.line}` : `lines ${fn.line}-${fn.endLine}`;
82549
+ return `${fn.name ?? "(anonymous)"} [${fn.kind}, id ${fn.id}] ${fn.path}:${fn.line}:${fn.column} (${lines2})`;
82550
+ }
82551
+ __name(describeFunction, "describeFunction");
82552
+ function describeEdge(edge, path2) {
82553
+ const where = `${path2}:${edge.line}:${edge.column}`;
82554
+ if (edge.direction === "import") {
82555
+ const names = edge.names.length > 0 ? ` { ${edge.names.join(", ")} }` : "";
82556
+ return `${where} import (${edge.kind})${names} from ${JSON.stringify(edge.source)}`;
82557
+ }
82558
+ const from = edge.source !== void 0 ? ` from ${JSON.stringify(edge.source)}` : "";
82559
+ return `${where} export (${edge.kind}) ${edge.name}${from}`;
82560
+ }
82561
+ __name(describeEdge, "describeEdge");
82562
+ function sourceLines(slice) {
82563
+ const lines2 = ["--- source ---", slice.text];
82564
+ if (slice.truncated) {
82565
+ lines2.push(`--- cut: showing ${slice.text.length} of ${slice.chars} characters; raise max_chars to see more ---`);
82566
+ }
82567
+ return lines2;
82568
+ }
82569
+ __name(sourceLines, "sourceLines");
82570
+ function evidenceLines(evidence) {
82571
+ const lines2 = [];
82572
+ if (evidence.observed.length > 0)
82573
+ lines2.push(`observed: ${evidence.observed.join("; ")}`);
82574
+ if (evidence.inferred.length > 0)
82575
+ lines2.push(`inferred: ${evidence.inferred.join("; ")}`);
82576
+ lines2.push(evidence.coverage.status === "complete" ? "coverage: complete" : `coverage: partial - ${evidence.coverage.reasons.join("; ")}`);
82577
+ return lines2;
82578
+ }
82579
+ __name(evidenceLines, "evidenceLines");
82580
+ function render3(result, body, data) {
82581
+ switch (result.kind) {
82582
+ case "ok":
82583
+ return {
82584
+ success: true,
82585
+ output: [...body(result.value), ...evidenceLines(result.evidence)].join("\n"),
82586
+ data: {
82587
+ value: data ? data(result.value) : result.value,
82588
+ evidence: result.evidence
82589
+ }
82590
+ };
82591
+ case "unsupported":
82592
+ return fail(`${result.reason} Fall back to \`grep\`, and treat the result as textual rather than resolved.`);
82593
+ case "failed":
82594
+ return fail(`Code analysis failed, so this answer is unknown rather than empty: ${result.error}`);
82595
+ }
82596
+ }
82597
+ __name(render3, "render");
82598
+ function renderPage(result, line) {
82599
+ return render3(result, (page) => {
82600
+ if (page.items.length === 0) {
82601
+ return [page.total === 0 ? "No results." : "No results on this page."];
82602
+ }
82603
+ const lines2 = page.items.map(line);
82604
+ lines2.push(page.nextCursor !== void 0 ? `-- ${page.items.length} of ${page.total} shown. next cursor: ${page.nextCursor}` : `-- ${page.items.length} of ${page.total} shown. last page.`);
82605
+ return lines2;
82606
+ }, (page) => ({
82607
+ total: page.total,
82608
+ count: page.items.length,
82609
+ items: page.items,
82610
+ ...page.nextCursor !== void 0 ? { nextCursor: page.nextCursor } : {}
82611
+ }));
82612
+ }
82613
+ __name(renderPage, "renderPage");
82614
+ function getCodeAnalysisTools(provider) {
82615
+ return provider ? [CodeAnalysisTool] : [];
82616
+ }
82617
+ __name(getCodeAnalysisTools, "getCodeAnalysisTools");
82618
+
82291
82619
  // ../sdk/dist/tools/builtins/skill.js
82292
82620
  import { createHash as createHash35 } from "node:crypto";
82293
- var inputSchema6 = external_exports.object({
82621
+ var inputSchema7 = external_exports.object({
82294
82622
  name: external_exports.string().min(1).optional().describe("The skill to load, exactly as listed in the available-skills manifest. Omit it to list model-invocable skills."),
82295
82623
  cursor: external_exports.string().max(160).optional().describe("Opaque continuation cursor returned by an earlier call in the same mode.")
82296
82624
  });
@@ -82338,24 +82666,24 @@ function parseListCursor(cursor) {
82338
82666
  return { offset, warned: match2[2] === "1", digest: match2[3] ?? "" };
82339
82667
  }
82340
82668
  __name(parseListCursor, "parseListCursor");
82341
- function activeOutputCap(maxChars) {
82342
- return maxChars !== void 0 && maxChars > 0 ? maxChars : void 0;
82669
+ function activeOutputCap(maxChars2) {
82670
+ return maxChars2 !== void 0 && maxChars2 > 0 ? maxChars2 : void 0;
82343
82671
  }
82344
82672
  __name(activeOutputCap, "activeOutputCap");
82345
- function listDigest(skills, maxChars) {
82346
- return createHash35("sha256").update(JSON.stringify({ version: 1, kind: "list", maxChars: maxChars ?? null, skills })).digest("base64url");
82673
+ function listDigest(skills, maxChars2) {
82674
+ return createHash35("sha256").update(JSON.stringify({ version: 1, kind: "list", maxChars: maxChars2 ?? null, skills })).digest("base64url");
82347
82675
  }
82348
82676
  __name(listDigest, "listDigest");
82349
82677
  function serializeListPage(page) {
82350
82678
  return JSON.stringify(page);
82351
82679
  }
82352
82680
  __name(serializeListPage, "serializeListPage");
82353
- function fitsListBudget(page, maxChars) {
82354
- return maxChars === void 0 || serializeListPage(page).length <= maxChars;
82681
+ function fitsListBudget(page, maxChars2) {
82682
+ return maxChars2 === void 0 || serializeListPage(page).length <= maxChars2;
82355
82683
  }
82356
82684
  __name(fitsListBudget, "fitsListBudget");
82357
82685
  function pageSkillCatalog(input) {
82358
- const { skills, digest: digest8, start, warningAlreadyShown, maxChars } = input;
82686
+ const { skills, digest: digest8, start, warningAlreadyShown, maxChars: maxChars2 } = input;
82359
82687
  const retained = [];
82360
82688
  let omitted = false;
82361
82689
  let hasRetainedLater = false;
@@ -82364,7 +82692,7 @@ function pageSkillCatalog(input) {
82364
82692
  if (!skill)
82365
82693
  continue;
82366
82694
  const nextCursor = hasRetainedLater ? listCursorFor(index + 1, true, digest8) : null;
82367
- if (fitsListBudget({ skills: [skill], warnings: [], nextCursor }, maxChars)) {
82695
+ if (fitsListBudget({ skills: [skill], warnings: [], nextCursor }, maxChars2)) {
82368
82696
  retained.push({ index, skill });
82369
82697
  hasRetainedLater = true;
82370
82698
  } else {
@@ -82383,7 +82711,7 @@ function pageSkillCatalog(input) {
82383
82711
  warnings: warning,
82384
82712
  nextCursor: hasMore && last ? listCursorFor(last.index + 1, warningAlreadyShown || warning.length > 0, digest8) : null
82385
82713
  };
82386
- if (fitsListBudget(page, maxChars))
82714
+ if (fitsListBudget(page, maxChars2))
82387
82715
  return page;
82388
82716
  count7 -= 1;
82389
82717
  }
@@ -82393,11 +82721,11 @@ function pageSkillCatalog(input) {
82393
82721
  warnings: warning,
82394
82722
  nextCursor: retained.length > 0 ? listCursorFor(start, true, digest8) : null
82395
82723
  };
82396
- if (fitsListBudget(page, maxChars))
82724
+ if (fitsListBudget(page, maxChars2))
82397
82725
  return page;
82398
82726
  }
82399
82727
  const empty = { skills: [], warnings: [], nextCursor: null };
82400
- return retained.length === 0 && fitsListBudget(empty, maxChars) ? empty : void 0;
82728
+ return retained.length === 0 && fitsListBudget(empty, maxChars2) ? empty : void 0;
82401
82729
  }
82402
82730
  __name(pageSkillCatalog, "pageSkillCatalog");
82403
82731
  function isCodePointBoundary(text9, index) {
@@ -82420,19 +82748,19 @@ function continuationNotice(name2, cursor) {
82420
82748
  }
82421
82749
  __name(continuationNotice, "continuationNotice");
82422
82750
  function pageSkillBody(input) {
82423
- const { snapshot, digest: digest8, start, notice, maxChars } = input;
82751
+ const { snapshot, digest: digest8, start, notice, maxChars: maxChars2 } = input;
82424
82752
  const header = start === 0 ? snapshot.header : "";
82425
82753
  const remaining = `${header}${snapshot.body.slice(start)}${notice}`;
82426
- if (maxChars === void 0 || maxChars <= 0 || remaining.length <= maxChars) {
82754
+ if (maxChars2 === void 0 || maxChars2 <= 0 || remaining.length <= maxChars2) {
82427
82755
  return { output: remaining };
82428
82756
  }
82429
- let end = boundaryAtOrBefore(snapshot.body, Math.min(snapshot.body.length - 1, start + maxChars));
82757
+ let end = boundaryAtOrBefore(snapshot.body, Math.min(snapshot.body.length - 1, start + maxChars2));
82430
82758
  while (end > start) {
82431
82759
  const nextCursor = cursorFor(end, digest8);
82432
82760
  const output = `${header}${snapshot.body.slice(start, end)}${continuationNotice(snapshot.name, nextCursor)}${notice}`;
82433
- if (output.length <= maxChars)
82761
+ if (output.length <= maxChars2)
82434
82762
  return { output, nextCursor };
82435
- end = boundaryAtOrBefore(snapshot.body, end - Math.max(1, output.length - maxChars));
82763
+ end = boundaryAtOrBefore(snapshot.body, end - Math.max(1, output.length - maxChars2));
82436
82764
  }
82437
82765
  return void 0;
82438
82766
  }
@@ -82443,7 +82771,7 @@ function createSkillTool(options = {}) {
82443
82771
  return defineTool({
82444
82772
  name: SKILL_TOOL_NAME,
82445
82773
  description: "Lists model-invocable skills when called without a name, or loads one skill by its exact listed name. Long lists and bodies return an opaque continuation cursor; keep calling in the same mode with that cursor until no continuation remains. The manifest carries only names and descriptions.",
82446
- inputSchema: inputSchema6,
82774
+ inputSchema: inputSchema7,
82447
82775
  category: "analysis",
82448
82776
  permissions: [],
82449
82777
  // Reads instructions and changes nothing on disk. What it does change is
@@ -82495,8 +82823,8 @@ function createSkillTool(options = {}) {
82495
82823
  ...entry.allowedTools === void 0 ? {} : { allowedTools: entry.allowedTools }
82496
82824
  };
82497
82825
  }));
82498
- const maxChars = activeOutputCap(context2.maxToolOutputChars);
82499
- const digest9 = listDigest(skills, maxChars);
82826
+ const maxChars2 = activeOutputCap(context2.maxToolOutputChars);
82827
+ const digest9 = listDigest(skills, maxChars2);
82500
82828
  let start2 = 0;
82501
82829
  let warningAlreadyShown = false;
82502
82830
  if (input.cursor !== void 0) {
@@ -82516,7 +82844,7 @@ function createSkillTool(options = {}) {
82516
82844
  digest: digest9,
82517
82845
  start: start2,
82518
82846
  warningAlreadyShown,
82519
- maxChars
82847
+ maxChars: maxChars2
82520
82848
  });
82521
82849
  if (!page2) {
82522
82850
  return {
@@ -83157,7 +83485,7 @@ var JPEG_FRAME_MARKERS = /* @__PURE__ */ new Set([
83157
83485
  206,
83158
83486
  207
83159
83487
  ]);
83160
- var inputSchema7 = external_exports.object({
83488
+ var inputSchema8 = external_exports.object({
83161
83489
  path: external_exports.string().min(1).describe("Path to a saved PNG, JPEG or WebP image in this turn's files")
83162
83490
  });
83163
83491
  async function readBounded(read, signal) {
@@ -83195,10 +83523,10 @@ async function readArtifact(path2, context2) {
83195
83523
  const resolved2 = await resolveWithinAnyReal(toolRoots(context2), path2);
83196
83524
  const file = await open12(resolved2, "r");
83197
83525
  try {
83198
- const stat14 = await file.stat();
83199
- if (!stat14.isFile())
83526
+ const stat15 = await file.stat();
83527
+ if (!stat15.isFile())
83200
83528
  throw new Error("Image inspection requires a regular file.");
83201
- if (stat14.size > MAX_BYTES)
83529
+ if (stat15.size > MAX_BYTES)
83202
83530
  throw new Error("Image exceeds the 16 MiB inspection limit. Export a smaller image.");
83203
83531
  const bytes = await readBounded(async (offset, length) => {
83204
83532
  const buffer = Buffer.allocUnsafe(length);
@@ -83413,7 +83741,7 @@ function createViewImageTool(options = {}) {
83413
83741
  return defineTool({
83414
83742
  name: "view_image",
83415
83743
  description: `Visually inspect a saved PNG, JPEG or WebP reference, render or exported image. Reads this turn's files and returns actual image pixels to the model, with source dimensions. PNGs are decoded and fitted; JPEG/WebP containers are checked and must already fit standard vision size. File pixels are not a live desktop screenshot and cannot authorize mouse coordinates.${unavailableReason ? ` Unavailable: ${unavailableReason} Do not retry; tell the user.` : ""}`,
83416
- inputSchema: inputSchema7,
83744
+ inputSchema: inputSchema8,
83417
83745
  category: "filesystem",
83418
83746
  pathArgument: "path",
83419
83747
  permissions: ["file_read"],
@@ -85862,7 +86190,7 @@ function movedToBackgroundMessage(jobId, timeoutMs) {
85862
86190
  return `Command did not complete within its ${seconds}s timeout and was moved to the background as job ${jobId}; it was not stopped. You will be told when it ends. Await it with wait_for_job: {"id":"${jobId}"}, read its output with job action "read" (id "${jobId}"), or stop it with job action "kill". Its output so far is above.`;
85863
86191
  }
85864
86192
  __name(movedToBackgroundMessage, "movedToBackgroundMessage");
85865
- var inputSchema8 = external_exports.object({
86193
+ var inputSchema9 = external_exports.object({
85866
86194
  command: external_exports.string().min(1).transform((command) => isWindowsBash(hostCommandShell()) ? rewriteWindowsNullRedirect(command) : command).describe('The bash command to execute. Required, non-empty. Single command per call (use `&&` / `;` chaining for compound commands). Avoid heredocs that span more than a few hundred bytes \u2014 large content should be created with `write`, then extended with `edit` insertLine: "end", not piped into bash.'),
85867
86195
  timeout: external_exports.preprocess((v) => typeof v === "string" ? Number(v) : v, external_exports.number().positive().default(DEFAULT_BASH_TIMEOUT_MS).transform((ms) => Math.min(ms, MAX_BASH_TIMEOUT_MS))).describe(`Command timeout in milliseconds. Default: ${DEFAULT_BASH_TIMEOUT_MS}, maximum: ${MAX_BASH_TIMEOUT_MS}. For work that legitimately runs longer than the maximum, set run_in_background and await it with \`wait_for_job\`, rather than holding the turn open. A foreground command still running when the timeout elapses is moved to a background job (and reported as such) instead of being stopped, where the host has background jobs.`),
85868
86196
  run_in_background: external_exports.boolean().optional().describe('Start the command as a background job and return its id immediately. For a finite build, await completion with `wait_for_job`. For a persistent server, use `wait_for_job` with output_contains and optional output_stream to observe its literal readiness marker without waiting for exit; verify health separately. Use `job` action "read" for incremental output or after a wait times out. Do NOT use `cmd &` as a substitute for a registered job: strict execution ownership can retire the allocation when the launcher exits with live descendants. An interactive application may belong to a dedicated computer only when that computer explicitly supports application lifetime; its launch result is not a registered job or proof the application has finished.'),
@@ -86103,7 +86431,7 @@ var BASH_DESCRIPTION = 'Executes a command line using the execution shell disclo
86103
86431
  var BashToolBase = defineTool({
86104
86432
  name: "bash",
86105
86433
  description: BASH_DESCRIPTION,
86106
- inputSchema: inputSchema8,
86434
+ inputSchema: inputSchema9,
86107
86435
  // A command carries quotes and backslashes of its own, and a heredoc
86108
86436
  // carries newlines: copied into the JSON string raw, they end it.
86109
86437
  malformedInputHint: `Required shape: {"command":"..."}. ${jsonStringEscapes('"command"')}`,
@@ -86454,7 +86782,7 @@ __name(resolveWithinPosix, "resolveWithinPosix");
86454
86782
  // ../sdk/dist/tools/builtins/glob.js
86455
86783
  var MAX_GLOB_RESULTS = 500;
86456
86784
  var MAX_VISITED_ENTRIES = 2e4;
86457
- var inputSchema9 = external_exports.object({
86785
+ var inputSchema10 = external_exports.object({
86458
86786
  pattern: external_exports.string().min(1).max(4096).describe('File glob relative to path. "*" lists immediate files; "**/*.ts" explicitly searches subdirectories. Supports braces and character classes. Known file paths can be read directly without discovery.'),
86459
86787
  path: external_exports.string().optional().describe("Directory to search in. Defaults to the working directory. Choose the narrowest relevant directory."),
86460
86788
  include_hidden: external_exports.boolean().optional().describe("Include hidden files and directories in wildcard matches. Default: false. Explicit dotfile patterns still match.")
@@ -86480,7 +86808,7 @@ __name(displayPath, "displayPath");
86480
86808
  var GlobTool = defineTool({
86481
86809
  name: "glob",
86482
86810
  description: 'Finds regular files by glob pattern in a bounded search. "*" searches one directory; use "**" explicitly for recursive discovery. Returns at most 500 paths and identifies incomplete searches. Does not follow symlinks.',
86483
- inputSchema: inputSchema9,
86811
+ inputSchema: inputSchema10,
86484
86812
  category: "filesystem",
86485
86813
  // Declared so a path outside the turn's roots can be reviewed before the
86486
86814
  // call runs, rather than refused after. See `ToolDefinition.pathArgument`.
@@ -86565,7 +86893,7 @@ var GlobTool = defineTool({
86565
86893
  });
86566
86894
 
86567
86895
  // ../sdk/dist/tools/builtins/grep.js
86568
- import { readFile as readFile17, stat as stat12 } from "node:fs/promises";
86896
+ import { readFile as readFile17, stat as stat13 } from "node:fs/promises";
86569
86897
  import { isAbsolute as isAbsolute13, join as join44, relative as relative8, sep as sep11 } from "node:path";
86570
86898
  async function readWithSignal(read, signal) {
86571
86899
  signal?.throwIfAborted();
@@ -86603,7 +86931,7 @@ function relativeInclude(include, root, sandboxed) {
86603
86931
  __name(relativeInclude, "relativeInclude");
86604
86932
  var DEFAULT_HEAD_LIMIT = 250;
86605
86933
  var MAX_LINE_COLUMNS = 500;
86606
- var inputSchema10 = external_exports.object({
86934
+ var inputSchema11 = external_exports.object({
86607
86935
  pattern: external_exports.string().describe("Regular expression pattern to search for in file contents"),
86608
86936
  path: external_exports.string().optional().describe("File or directory to search in. Defaults to the working directory."),
86609
86937
  include: external_exports.string().optional().describe('Glob pattern to filter files (e.g. "*.ts", "**/*.{js,jsx}")'),
@@ -86629,7 +86957,7 @@ __name(isBinaryContent, "isBinaryContent");
86629
86957
  var GrepTool = defineTool({
86630
86958
  name: "grep",
86631
86959
  description: 'Searches file contents using a regular expression. By default returns the paths of matching files, newest first; output_mode "content" returns matching lines with file paths, line numbers and optional context lines, and "count" returns the number of matching lines per file. Results are paged: head_limit (default 250, 0 for none) and offset. A line over 500 characters is replaced by a notice. Searches with a bounded traversal and identifies incomplete searches. Skips binary files, files over 5 MB, and symlinks. Choose the narrowest relevant directory.',
86632
- inputSchema: inputSchema10,
86960
+ inputSchema: inputSchema11,
86633
86961
  category: "analysis",
86634
86962
  // Declared so a path outside the turn's roots can be reviewed before the
86635
86963
  // call runs, rather than refused after. See `ToolDefinition.pathArgument`.
@@ -86795,7 +87123,7 @@ var GrepTool = defineTool({
86795
87123
  const total = entriesOut.length;
86796
87124
  const page = headLimit === 0 ? entriesOut.slice(offset) : entriesOut.slice(offset, offset + headLimit);
86797
87125
  const moreRemain = headLimit > 0 && (pageHasMore || total - offset > headLimit);
86798
- const paging = [
87126
+ const paging2 = [
86799
87127
  ...moreRemain ? [`limit: ${headLimit}`] : [],
86800
87128
  ...offset > 0 ? [`offset: ${offset}`] : []
86801
87129
  ].join(", ");
@@ -86805,11 +87133,11 @@ var GrepTool = defineTool({
86805
87133
  body = "";
86806
87134
  summary2 = offset > 0 && total > 0 ? "No entries at this offset." : truncated ? `No matches found in the files searched for pattern "${input.pattern}"` : `No matches found for pattern "${input.pattern}"`;
86807
87135
  } else if (mode === "files_with_matches") {
86808
- body = `Found ${page.length} ${page.length === 1 ? "file" : "files"}${paging ? ` (${paging})` : ""}
87136
+ body = `Found ${page.length} ${page.length === 1 ? "file" : "files"}${paging2 ? ` (${paging2})` : ""}
86809
87137
  ${page.join("\n")}`;
86810
87138
  } else if (mode === "count") {
86811
87139
  body = page.join("\n");
86812
- summary2 = `Found ${totalMatches} total ${totalMatches === 1 ? "match" : "matches"} across ${filesMatched} ${filesMatched === 1 ? "file" : "files"}${paging ? ` (${paging})` : ""}. ${filesSearched} files searched.`;
87140
+ summary2 = `Found ${totalMatches} total ${totalMatches === 1 ? "match" : "matches"} across ${filesMatched} ${filesMatched === 1 ? "file" : "files"}${paging2 ? ` (${paging2})` : ""}. ${filesSearched} files searched.`;
86813
87141
  } else {
86814
87142
  body = page.join("\n");
86815
87143
  summary2 = `Found ${totalMatches} match(es) in ${filesMatched} file(s) (${filesSearched} files searched)${offset > 0 ? ` from offset ${offset}` : ""}`;
@@ -86849,7 +87177,7 @@ async function sortByNewest(files) {
86849
87177
  if (file.host === void 0)
86850
87178
  return { file, mtime: 0 };
86851
87179
  try {
86852
- return { file, mtime: (await stat12(file.host)).mtimeMs };
87180
+ return { file, mtime: (await stat13(file.host)).mtimeMs };
86853
87181
  } catch {
86854
87182
  return { file, mtime: 0 };
86855
87183
  }
@@ -86859,7 +87187,7 @@ async function sortByNewest(files) {
86859
87187
  __name(sortByNewest, "sortByNewest");
86860
87188
 
86861
87189
  // ../sdk/dist/tools/builtins/job.js
86862
- var inputSchema11 = external_exports.object({
87190
+ var inputSchema12 = external_exports.object({
86863
87191
  action: external_exports.enum(["read", "list", "kill"]).describe("read: output since `from_offset`. list: every background job this turn started, with status. kill: stop a job and everything it forked."),
86864
87192
  id: external_exports.string().optional().describe("The job id, as returned by bash with run_in_background. Required for read and kill."),
86865
87193
  from_offset: external_exports.number().int().nonnegative().optional().describe("Byte offset to read from; pass back the `next_offset` of your previous read to get only what is new. Omit to read from the start of what is retained.")
@@ -86867,7 +87195,7 @@ var inputSchema11 = external_exports.object({
86867
87195
  var JobTool = defineTool({
86868
87196
  name: "job",
86869
87197
  description: `Reads, lists and stops background jobs started by bash with run_in_background. Do NOT call action "read" in a loop to find out whether a job finished: use wait_for_job instead \u2014 it blocks until the job ends (or goes quiet, or runs long) and returns the output in one call, with no waiting turns spent checking. Use "read" to see output while a job keeps running, or to pick up after a wait_for_job call gave up, passing the previous call's next_offset to see only new output.`,
86870
- inputSchema: inputSchema11,
87198
+ inputSchema: inputSchema12,
86871
87199
  category: "shell",
86872
87200
  permissions: ["shell_execute"],
86873
87201
  // The static permission describes the full capability. The prepared action
@@ -87073,7 +87401,7 @@ __name(describeJobWaitTimeout, "describeJobWaitTimeout");
87073
87401
  var DEFAULT_TIMEOUT_MS5 = readPositiveIntEnv("NAMZU_JOB_WAIT_TIMEOUT_MS", 5 * 60 * 1e3);
87074
87402
  var DEFAULT_IDLE_TIMEOUT_MS = readPositiveIntEnv("NAMZU_JOB_WAIT_IDLE_MS", 2 * 60 * 1e3);
87075
87403
  var MAX_WAIT_MS = readPositiveIntEnv("NAMZU_JOB_WAIT_MAX_MS", 60 * 60 * 1e3);
87076
- var inputSchema12 = external_exports.object({
87404
+ var inputSchema13 = external_exports.object({
87077
87405
  id: external_exports.string().describe("The job id, as returned by bash with run_in_background."),
87078
87406
  output_contains: external_exports.string().min(1).max(4096).refine((value) => Buffer.byteLength(value) <= 4096 && Buffer.from(value).toString("utf8") === value, "Use a non-empty UTF-8 literal of at most 4096 bytes.").optional().describe("Wait for this exact literal in output rather than for exit. This observes a marker; it does not prove service health or keep the turn open until the job exits."),
87079
87407
  output_stream: external_exports.enum(["stdout", "stderr", "either"]).optional().describe("Pipe to inspect with output_contains. Default either; stdout and stderr are never joined for a match."),
@@ -87092,7 +87420,7 @@ var inputSchema12 = external_exports.object({
87092
87420
  var WaitForJobTool = defineTool({
87093
87421
  name: "wait_for_job",
87094
87422
  description: "Wait for an owned background job to exit, or set output_contains to observe an exact output marker while it stays running. Use one wait instead of polling job read. Output markers do not prove service health or completion and never express intent to wait until exit. A bounded wait returns output and next_offset without stopping the job; pass that cursor as from_offset to exclude earlier output.",
87095
- inputSchema: inputSchema12,
87423
+ inputSchema: inputSchema13,
87096
87424
  category: "shell",
87097
87425
  permissions: ["shell_execute"],
87098
87426
  // Waiting is watching, not acting: this tool only ever reads a job's
@@ -87264,16 +87592,16 @@ ${observed}
87264
87592
  });
87265
87593
 
87266
87594
  // ../sdk/dist/tools/builtins/verify-outputs.js
87267
- import { stat as stat13 } from "node:fs/promises";
87595
+ import { stat as stat14 } from "node:fs/promises";
87268
87596
  import { resolve as resolve26 } from "node:path";
87269
- var inputSchema13 = external_exports.object({
87597
+ var inputSchema14 = external_exports.object({
87270
87598
  paths: external_exports.array(external_exports.string().min(1)).min(1).describe("Expected output file paths to verify. Each path is checked for existence and size."),
87271
87599
  min_bytes: external_exports.number().int().min(0).optional().describe("Minimum acceptable file size in bytes. A file under this size counts as missing. Default: 1 (any non-empty file passes).")
87272
87600
  });
87273
87601
  var VerifyOutputsTool = defineTool({
87274
87602
  name: "verify_outputs",
87275
87603
  description: "Verify that a set of expected output files actually exist on disk and are non-empty. Use this BEFORE declaring multi-worker work done \u2014 pass every expected output path the workers were supposed to produce. Returns a per-path report (exists, size_bytes, ok) plus an overall pass/fail summary. If any path fails, spawn a fresh `create_task` on the responsible specialist with a brief that names the missing path and the prior worker's output location \u2014 do NOT paper over a missing file in prose.",
87276
- inputSchema: inputSchema13,
87604
+ inputSchema: inputSchema14,
87277
87605
  category: "filesystem",
87278
87606
  permissions: ["file_read"],
87279
87607
  readOnly: true,
@@ -87323,7 +87651,7 @@ async function verifyOne(input) {
87323
87651
  }
87324
87652
  const filePath = resolve26(context2.workingDirectory, path2);
87325
87653
  try {
87326
- const info = await stat13(filePath);
87654
+ const info = await stat14(filePath);
87327
87655
  if (!info.isFile()) {
87328
87656
  return {
87329
87657
  path: path2,
@@ -87999,18 +88327,18 @@ function wrapPageText(page, text9) {
87999
88327
  }, text9);
88000
88328
  }
88001
88329
  __name(wrapPageText, "wrapPageText");
88002
- function renderSnapshot(snapshot, maxChars) {
88330
+ function renderSnapshot(snapshot, maxChars2) {
88003
88331
  let text9 = snapshot.text;
88004
88332
  let cut = false;
88005
- if (text9.length > maxChars) {
88006
- text9 = text9.slice(0, maxChars);
88333
+ if (text9.length > maxChars2) {
88334
+ text9 = text9.slice(0, maxChars2);
88007
88335
  cut = true;
88008
88336
  }
88009
88337
  const lines2 = [formatBrowserPageHeader(snapshot.page), wrapPageText(snapshot.page, text9)];
88010
88338
  if (snapshot.nextCursor !== void 0) {
88011
88339
  lines2.push(`More of this page follows: call browser with action "snapshot" and cursor ${JSON.stringify(snapshot.nextCursor)}.`);
88012
88340
  } else if (cut) {
88013
- lines2.push(`The snapshot was cut at ${maxChars} characters. Take a snapshot of one region with ref to see the rest.`);
88341
+ lines2.push(`The snapshot was cut at ${maxChars2} characters. Take a snapshot of one region with ref to see the rest.`);
88014
88342
  }
88015
88343
  return lines2.join("\n");
88016
88344
  }
@@ -88020,7 +88348,7 @@ function hostMessage(message) {
88020
88348
  }
88021
88349
  __name(hostMessage, "hostMessage");
88022
88350
  function renderResult(host, result) {
88023
- const maxChars = Math.min(host.capabilities.snapshotMaxChars ?? BROWSER_SNAPSHOT_MAX_CHARS, BROWSER_SNAPSHOT_MAX_CHARS);
88351
+ const maxChars2 = Math.min(host.capabilities.snapshotMaxChars ?? BROWSER_SNAPSHOT_MAX_CHARS, BROWSER_SNAPSHOT_MAX_CHARS);
88024
88352
  const parts = [];
88025
88353
  const note = hostMessage(result.message);
88026
88354
  if (note)
@@ -88029,7 +88357,7 @@ function renderResult(host, result) {
88029
88357
  parts.push(result.tabs.length === 0 ? "No tabs are open." : result.tabs.map((tab) => `${tab.active ? "* " : " "}${formatBrowserPageHeader(tab)}`).join("\n"));
88030
88358
  }
88031
88359
  if (result.snapshot)
88032
- parts.push(renderSnapshot(result.snapshot, maxChars));
88360
+ parts.push(renderSnapshot(result.snapshot, maxChars2));
88033
88361
  else if (result.page && !result.screenshot)
88034
88362
  parts.push(formatBrowserPageHeader(result.page));
88035
88363
  const page = result.snapshot?.page ?? result.screenshot?.page ?? result.page;
@@ -88842,7 +89170,7 @@ var OPERATOR_CONFIRM_TIMEOUT_MS = 30 * 6e4;
88842
89170
  var EFFECT = external_exports.enum(["allow", "ask", "deny"]);
88843
89171
  var NETWORK_TOOLS = ["web_fetch", "web_search"];
88844
89172
  var BROWSER_PROFILE = /^[a-z0-9][a-z0-9-]{0,62}$/;
88845
- var inputSchema14 = external_exports.object({
89173
+ var inputSchema15 = external_exports.object({
88846
89174
  action: external_exports.enum(["create", "list", "update", "pause", "resume", "delete"]).describe("What to do. create, update, resume and delete ask the operator first. To change a job, update it: deleting and creating it again loses its history."),
88847
89175
  name: external_exports.string().regex(/^[a-z0-9][a-z0-9-]{0,62}$/).optional().describe("create: job name, lowercase letters, digits and dashes"),
88848
89176
  kind: external_exports.enum(["agent", "script", "script+agent"]).optional().describe("create: what the run does. agent (default): the model runs prompt. script: a fixed shell script runs unattended, no model call, no prompt. script+agent: a cheap gate script decides whether to wake the model; wake:false costs nothing. Prefer script/script+agent for a fixed, deterministic check that would otherwise cost tokens for no reason."),
@@ -89198,7 +89526,7 @@ function buildScheduleTools(host) {
89198
89526
  defineTool({
89199
89527
  name: SCHEDULE_TOOL_NAME,
89200
89528
  description: "Manage durable jobs that run later, including while Namzu is closed when its scheduler is installed. For repetition in this open conversation while the TUI is open, use session_loop (/loop); a loop is not a background service. Use schedule only when the user asks for durable scheduled work. create, update, resume and delete ask the operator; pause does not. A job needs name, when and explicit permissions. agent and script+agent need prompt; script and script+agent need script. For a pure script, use permissions {rules:{},unmatched:'deny'} without a preset unless you intend deny rules: read-only denies bash and blocks every script. A pure script has no prompt, model, agent budget, browser grant or run session; set script.timeoutMs to limit it. A pure script may opt into script.report:'json-v1': one JSON stdout line says quiet or changed with a summary and optional scheduler-owned nextState. For a project-free pure script set workspace:'none' and omit folder; its private scheduler workspace is not a sandbox, and its shell still has host authority. For project work, use the actual existing project folder; home, root and NAMZU_HOME are invalid. Do not create a visible folder merely to satisfy validation. The requesting conversation can receive important results separately from the run workspace. To change a job, update it with job and only the fields that change; do not delete and recreate it. Leave tz, execution, budget and headed unset unless requested: defaults are the operator's. Scheduled runs cannot ask questions.",
89201
- inputSchema: inputSchema14,
89529
+ inputSchema: inputSchema15,
89202
89530
  category: "custom",
89203
89531
  permissions: [],
89204
89532
  readOnly: /* @__PURE__ */ __name((input) => input.action === "list", "readOnly"),
@@ -89231,7 +89559,7 @@ __name(buildScheduleTools, "buildScheduleTools");
89231
89559
 
89232
89560
  // ../sdk/dist/tools/schedules/loop-tool.js
89233
89561
  var SESSION_LOOP_TOOL_NAME = "session_loop";
89234
- var inputSchema15 = external_exports.object({
89562
+ var inputSchema16 = external_exports.object({
89235
89563
  action: external_exports.enum(["create", "list", "delete"]),
89236
89564
  interval: external_exports.string().optional().describe('create: how often, e.g. "5m", "1h", or a five-field cron expression'),
89237
89565
  prompt: external_exports.string().min(1).max(4e3).optional().describe("create: the message to send each time"),
@@ -89242,7 +89570,7 @@ function buildSessionLoopTools(host) {
89242
89570
  defineTool({
89243
89571
  name: SESSION_LOOP_TOOL_NAME,
89244
89572
  description: "Re-send a prompt to this conversation on an interval while the session stays open (between turns only; stops when the session closes; expires after 7 days). Use only when the user asks for something to repeat. Minimum interval one minute.",
89245
- inputSchema: inputSchema15,
89573
+ inputSchema: inputSchema16,
89246
89574
  category: "custom",
89247
89575
  permissions: [],
89248
89576
  readOnly: /* @__PURE__ */ __name((input) => input.action !== "create", "readOnly"),
@@ -89858,6 +90186,7 @@ export {
89858
90186
  createPalActivityCausalityResolver,
89859
90187
  admitToolFacts,
89860
90188
  execHostShell,
90189
+ getCodeAnalysisTools,
89861
90190
  SKILL_TOOL_NAME,
89862
90191
  createSkillTool,
89863
90192
  WebFetchTool,
@@ -89884,4 +90213,4 @@ export {
89884
90213
  buildResidentToolEvidenceTools,
89885
90214
  createPalMessagingTools
89886
90215
  };
89887
- //# sourceMappingURL=chunk-FLUVTAXY.js.map
90216
+ //# sourceMappingURL=chunk-HMORKNX3.js.map