@namzu/cli 39.1.0 → 39.2.1

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 (234) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/chunks/{acp-7MS4QWHQ.js → acp-VDM66X7T.js} +35 -35
  4. package/dist/chunks/{activity-command-ZLQTSOOT.js → activity-command-23DPNYXT.js} +11 -11
  5. package/dist/chunks/{add-I77S5XFR.js → add-Y2UMHBTC.js} +16 -16
  6. package/dist/chunks/{agent-CD2IIXPD.js → agent-LCCOMK5H.js} +26 -26
  7. package/dist/chunks/agent-session-6ZFR55NO.js +53 -0
  8. package/dist/chunks/{archive-JRJTOPHL.js → archive-YUZ62G7R.js} +9 -9
  9. package/dist/chunks/{bin-main-KTQUVYIP.js → bin-main-LFPYUV3K.js} +3 -3
  10. package/dist/chunks/{browser-OKCFCNCP.js → browser-X6UIDIQQ.js} +6 -6
  11. package/dist/chunks/{chat-LTGXH6SR.js → chat-EMEYQKRR.js} +14 -14
  12. package/dist/chunks/{chunk-A7F56OV6.js → chunk-2L3JDLC5.js} +12 -12
  13. package/dist/chunks/{chunk-4UYGMFWB.js → chunk-2PH7EQQP.js} +2 -2
  14. package/dist/chunks/{chunk-QFAZWIVS.js → chunk-363DTX3M.js} +4 -4
  15. package/dist/chunks/{chunk-6MRGH7S5.js → chunk-37YQDLHZ.js} +673 -151
  16. package/dist/chunks/chunk-37YQDLHZ.js.map +6 -0
  17. package/dist/chunks/{chunk-IAA2O76K.js → chunk-3MT5KLBF.js} +2 -2
  18. package/dist/chunks/{chunk-XLPUR46F.js → chunk-45GT626R.js} +2 -2
  19. package/dist/chunks/{chunk-HZH2LZR3.js → chunk-5NVONQBW.js} +2 -2
  20. package/dist/chunks/{chunk-JBYO5UWH.js → chunk-6YFMOYKD.js} +6 -6
  21. package/dist/chunks/{chunk-YH7CW765.js → chunk-7C6DG66T.js} +4 -4
  22. package/dist/chunks/{chunk-7K7VDUT3.js → chunk-7OXYUJSY.js} +28 -28
  23. package/dist/chunks/{chunk-67YTCGFQ.js → chunk-7WUSJ454.js} +5 -5
  24. package/dist/chunks/{chunk-VUBQ6IRM.js → chunk-A25FQQTW.js} +2 -2
  25. package/dist/chunks/{chunk-2TEGJRBM.js → chunk-A34Y6ZPM.js} +2 -2
  26. package/dist/chunks/{chunk-5BULAR3C.js → chunk-AP4B5Z3D.js} +2 -2
  27. package/dist/chunks/{chunk-SYMXDX7F.js → chunk-AURV7PCK.js} +2 -2
  28. package/dist/chunks/{chunk-XOIV3R6O.js → chunk-B2GM4GON.js} +6 -6
  29. package/dist/chunks/{chunk-VIRFJSX6.js → chunk-B4DC7NC7.js} +8 -8
  30. package/dist/chunks/{chunk-HYJTH4L6.js → chunk-BPDKRVGW.js} +2 -2
  31. package/dist/chunks/{chunk-DCAKHMT4.js → chunk-BZIUFNYR.js} +4 -4
  32. package/dist/chunks/{chunk-CYGNCTMI.js → chunk-DNHHMNVG.js} +2 -2
  33. package/dist/chunks/{chunk-SVTNQGLN.js → chunk-E6LQB5Z7.js} +13 -13
  34. package/dist/chunks/{chunk-L5EE2M32.js → chunk-EGP3MB37.js} +3 -3
  35. package/dist/chunks/{chunk-H2SFQIVZ.js → chunk-ESMVELWA.js} +5 -5
  36. package/dist/chunks/{chunk-JDS4SYAJ.js → chunk-EXVGLN6V.js} +2 -2
  37. package/dist/chunks/{chunk-NXLK7UAG.js → chunk-FKSIOYXA.js} +4 -4
  38. package/dist/chunks/{chunk-D7UUTTLG.js → chunk-FXMJ5NVM.js} +3 -3
  39. package/dist/chunks/{chunk-5GVYGWMK.js → chunk-HBTPB6ON.js} +2 -2
  40. package/dist/chunks/{chunk-6AH52DNV.js → chunk-HHOTJDZW.js} +2 -2
  41. package/dist/chunks/{chunk-QX6YDLUD.js → chunk-HLIXL5RK.js} +7 -7
  42. package/dist/chunks/{chunk-NFCBNDBG.js → chunk-HWM73622.js} +12 -12
  43. package/dist/chunks/{chunk-CI3SKMXQ.js → chunk-ISN4VZCX.js} +2 -2
  44. package/dist/chunks/{chunk-VMJWG5TF.js → chunk-IVZB7YKX.js} +3 -3
  45. package/dist/chunks/{chunk-BGI5U5XL.js → chunk-JEHKZEIB.js} +4 -4
  46. package/dist/chunks/{chunk-WUBN6DXH.js → chunk-JII5GOH2.js} +2 -2
  47. package/dist/chunks/{chunk-YVJTVJN4.js → chunk-KS5X3GMX.js} +2 -2
  48. package/dist/chunks/{chunk-NNSCLV6S.js → chunk-LS7PT6RY.js} +3 -3
  49. package/dist/chunks/{chunk-ECO3KP5U.js → chunk-M2PQMMDW.js} +3 -3
  50. package/dist/chunks/{chunk-RI5G5NS3.js → chunk-MCXVRO4B.js} +4 -4
  51. package/dist/chunks/{chunk-64WCX6UV.js → chunk-MEHYOYTW.js} +3 -3
  52. package/dist/chunks/{chunk-5CKCYCPL.js → chunk-MIM4YRP2.js} +2 -2
  53. package/dist/chunks/{chunk-X62U63KJ.js → chunk-N3JNFZOW.js} +3 -3
  54. package/dist/chunks/{chunk-44JEVSTR.js → chunk-NUJCTZOM.js} +7 -7
  55. package/dist/chunks/{chunk-2GO7AWHX.js → chunk-ONKQPPSY.js} +2 -2
  56. package/dist/chunks/{chunk-FTZT4UAB.js → chunk-OPIC6ZIL.js} +596 -320
  57. package/dist/chunks/chunk-OPIC6ZIL.js.map +6 -0
  58. package/dist/chunks/{chunk-MBGTDQFF.js → chunk-OT5X76XI.js} +3 -3
  59. package/dist/chunks/{chunk-ERSRQ6QN.js → chunk-OVG3QY7U.js} +3 -3
  60. package/dist/chunks/{chunk-EXL2ALVX.js → chunk-PV4ZAFVQ.js} +2 -2
  61. package/dist/chunks/{chunk-WICKQJR4.js → chunk-QENCNE7Q.js} +5 -5
  62. package/dist/chunks/{chunk-BYJ4AGMC.js → chunk-QR5YS5QW.js} +2 -2
  63. package/dist/chunks/{chunk-DXQQSQQ3.js → chunk-T64F5OER.js} +9 -9
  64. package/dist/chunks/{chunk-PWO4HKDQ.js → chunk-TACSPIUK.js} +2 -2
  65. package/dist/chunks/{chunk-CL475F3V.js → chunk-V6UEMLTT.js} +2 -2
  66. package/dist/chunks/{chunk-UB6WVOKM.js → chunk-W6JEZMOJ.js} +4 -4
  67. package/dist/chunks/{chunk-QYIY7Q5R.js → chunk-WNVYEZUQ.js} +4 -4
  68. package/dist/chunks/{chunk-6A5BVWEI.js → chunk-XJT5DL3I.js} +2 -2
  69. package/dist/chunks/{chunk-24FWPXME.js → chunk-XNQI4ZDH.js} +3 -3
  70. package/dist/chunks/{chunk-GQBSRXFY.js → chunk-YIFOFVWM.js} +4 -4
  71. package/dist/chunks/{chunk-PAJTVGYM.js → chunk-YZOR7643.js} +3 -3
  72. package/dist/chunks/{cli-runtime-KLGRRAPC.js → cli-runtime-XHGO7QSK.js} +10 -10
  73. package/dist/chunks/{commands-UQGS6244.js → commands-GDF5OOXO.js} +5 -5
  74. package/dist/chunks/{crash-report-F3CLYQ6A.js → crash-report-N7ZQ2UB4.js} +6 -6
  75. package/dist/chunks/{dist-FE7KZYMC.js → dist-36LBIFJ6.js} +2 -2
  76. package/dist/chunks/{dist-BF3HQ6PJ.js → dist-547VSBMV.js} +2 -2
  77. package/dist/chunks/{dist-MMWDBT7P.js → dist-IJ3AAED4.js} +2 -2
  78. package/dist/chunks/{dist-TZU45EHB.js → dist-MZNKQTW4.js} +2 -2
  79. package/dist/chunks/{dist-BYIBYB4E.js → dist-T2NJ6SVO.js} +2 -2
  80. package/dist/chunks/{dist-SGU5HCLT.js → dist-TCIDRGW5.js} +2 -2
  81. package/dist/chunks/{dist-FFM3ZZQ4.js → dist-TCILCQPG.js} +2 -2
  82. package/dist/chunks/{doctor-6ZZOTVMF.js → doctor-T7SC3VSE.js} +8 -8
  83. package/dist/chunks/{drain-XK5PA7E5.js → drain-OA5MO7SQ.js} +10 -10
  84. package/dist/chunks/{eval-RPKIJFAB.js → eval-D5Q2WZ7S.js} +2 -2
  85. package/dist/chunks/{exec-DJ4ECSDD.js → exec-MG5S7OJN.js} +25 -25
  86. package/dist/chunks/{home-ZAIMBEH7.js → home-Z7L4BJTW.js} +3 -3
  87. package/dist/chunks/{host-queries-AMSRIPNG.js → host-queries-LL56A6NY.js} +14 -14
  88. package/dist/chunks/{lifecycle-L4E6FPYN.js → lifecycle-TCRLU6B5.js} +23 -23
  89. package/dist/chunks/{list-2QTHV4YO.js → list-RBOLXDHG.js} +11 -11
  90. package/dist/chunks/{login-QMOTL6Y5.js → login-RZCJNDAJ.js} +8 -8
  91. package/dist/chunks/{logs-JIQJGYVR.js → logs-KDEGF3FA.js} +4 -4
  92. package/dist/chunks/{mcp-ZCRO5DB3.js → mcp-7L7NYLKG.js} +16 -16
  93. package/dist/chunks/{message-command-2SCMXO4D.js → message-command-NTLYNKUW.js} +32 -32
  94. package/dist/chunks/{operator-tools-23FYQ5OE.js → operator-tools-DXU6UK4S.js} +12 -12
  95. package/dist/chunks/{output-schema-RTXHP2NW.js → output-schema-UMOAOTW2.js} +3 -3
  96. package/dist/chunks/{pal-AC73MLO6.js → pal-FDOF3S5J.js} +11 -11
  97. package/dist/chunks/{providers-SUXIFNA4.js → providers-HOY5QHWL.js} +6 -6
  98. package/dist/chunks/{resident-VFEZDABF.js → resident-XIM5KNNX.js} +20 -20
  99. package/dist/chunks/resume-3OP5GB7S.js +22 -0
  100. package/dist/chunks/{resume-command-PZ3NLBOR.js → resume-command-DIVGMVMA.js} +4 -4
  101. package/dist/chunks/{schedule-4KYTYQML.js → schedule-YRHGK6CD.js} +8 -8
  102. package/dist/chunks/{service-NI46RYPW.js → service-DRXVEYFA.js} +22 -22
  103. package/dist/chunks/session-step-ZD3D55SM.js +29 -0
  104. package/dist/chunks/{skills-OYRPNK3I.js → skills-C5ZXOJEA.js} +8 -8
  105. package/dist/chunks/{state-ULVIHH2M.js → state-BVKWZF6F.js} +2 -2
  106. package/dist/chunks/{store-EOHDDBM7.js → store-A4VHV4I2.js} +6 -6
  107. package/dist/chunks/{store-3LVJZEHS.js → store-GKY55UEV.js} +4 -4
  108. package/dist/chunks/{store-W2VNXICH.js → store-ZXFXXY4S.js} +9 -9
  109. package/dist/chunks/{tui-GEHRYWRG.js → tui-PY2FQXVO.js} +46 -46
  110. package/dist/chunks/{upgrade-LSB2KNDF.js → upgrade-WSBGA3FW.js} +2 -2
  111. package/dist/chunks/{worktree-PZU6IAUF.js → worktree-HLE7PBLL.js} +11 -11
  112. package/dist/index.js +12 -12
  113. package/dist/integrations/resident/runner-worker.js +18 -18
  114. package/dist/integrations/sessions/conversation-search.d.ts +10 -1
  115. package/dist/integrations/sessions/conversation-search.d.ts.map +1 -1
  116. package/dist/integrations/subagents/runtime.d.ts +3 -1
  117. package/dist/integrations/subagents/runtime.d.ts.map +1 -1
  118. package/dist/integrations/subagents/saved-agents.d.ts +7 -5
  119. package/dist/integrations/subagents/saved-agents.d.ts.map +1 -1
  120. package/dist/tui/agent.d.ts.map +1 -1
  121. package/package.json +5 -5
  122. package/skills/browser-automation/SKILL.md +2 -2
  123. package/skills/schedule-task/SKILL.md +7 -7
  124. package/skills/skill-creator/SKILL.md +1 -1
  125. package/dist/chunks/agent-session-6F55DYFA.js +0 -53
  126. package/dist/chunks/chunk-6MRGH7S5.js.map +0 -6
  127. package/dist/chunks/chunk-FTZT4UAB.js.map +0 -6
  128. package/dist/chunks/resume-I3YLV7D3.js +0 -22
  129. package/dist/chunks/session-step-IR57BRZX.js +0 -29
  130. /package/dist/chunks/{acp-7MS4QWHQ.js.map → acp-VDM66X7T.js.map} +0 -0
  131. /package/dist/chunks/{activity-command-ZLQTSOOT.js.map → activity-command-23DPNYXT.js.map} +0 -0
  132. /package/dist/chunks/{add-I77S5XFR.js.map → add-Y2UMHBTC.js.map} +0 -0
  133. /package/dist/chunks/{agent-CD2IIXPD.js.map → agent-LCCOMK5H.js.map} +0 -0
  134. /package/dist/chunks/{agent-session-6F55DYFA.js.map → agent-session-6ZFR55NO.js.map} +0 -0
  135. /package/dist/chunks/{archive-JRJTOPHL.js.map → archive-YUZ62G7R.js.map} +0 -0
  136. /package/dist/chunks/{bin-main-KTQUVYIP.js.map → bin-main-LFPYUV3K.js.map} +0 -0
  137. /package/dist/chunks/{browser-OKCFCNCP.js.map → browser-X6UIDIQQ.js.map} +0 -0
  138. /package/dist/chunks/{chat-LTGXH6SR.js.map → chat-EMEYQKRR.js.map} +0 -0
  139. /package/dist/chunks/{chunk-A7F56OV6.js.map → chunk-2L3JDLC5.js.map} +0 -0
  140. /package/dist/chunks/{chunk-4UYGMFWB.js.map → chunk-2PH7EQQP.js.map} +0 -0
  141. /package/dist/chunks/{chunk-QFAZWIVS.js.map → chunk-363DTX3M.js.map} +0 -0
  142. /package/dist/chunks/{chunk-IAA2O76K.js.map → chunk-3MT5KLBF.js.map} +0 -0
  143. /package/dist/chunks/{chunk-XLPUR46F.js.map → chunk-45GT626R.js.map} +0 -0
  144. /package/dist/chunks/{chunk-HZH2LZR3.js.map → chunk-5NVONQBW.js.map} +0 -0
  145. /package/dist/chunks/{chunk-JBYO5UWH.js.map → chunk-6YFMOYKD.js.map} +0 -0
  146. /package/dist/chunks/{chunk-YH7CW765.js.map → chunk-7C6DG66T.js.map} +0 -0
  147. /package/dist/chunks/{chunk-7K7VDUT3.js.map → chunk-7OXYUJSY.js.map} +0 -0
  148. /package/dist/chunks/{chunk-67YTCGFQ.js.map → chunk-7WUSJ454.js.map} +0 -0
  149. /package/dist/chunks/{chunk-VUBQ6IRM.js.map → chunk-A25FQQTW.js.map} +0 -0
  150. /package/dist/chunks/{chunk-2TEGJRBM.js.map → chunk-A34Y6ZPM.js.map} +0 -0
  151. /package/dist/chunks/{chunk-5BULAR3C.js.map → chunk-AP4B5Z3D.js.map} +0 -0
  152. /package/dist/chunks/{chunk-SYMXDX7F.js.map → chunk-AURV7PCK.js.map} +0 -0
  153. /package/dist/chunks/{chunk-XOIV3R6O.js.map → chunk-B2GM4GON.js.map} +0 -0
  154. /package/dist/chunks/{chunk-VIRFJSX6.js.map → chunk-B4DC7NC7.js.map} +0 -0
  155. /package/dist/chunks/{chunk-HYJTH4L6.js.map → chunk-BPDKRVGW.js.map} +0 -0
  156. /package/dist/chunks/{chunk-DCAKHMT4.js.map → chunk-BZIUFNYR.js.map} +0 -0
  157. /package/dist/chunks/{chunk-CYGNCTMI.js.map → chunk-DNHHMNVG.js.map} +0 -0
  158. /package/dist/chunks/{chunk-SVTNQGLN.js.map → chunk-E6LQB5Z7.js.map} +0 -0
  159. /package/dist/chunks/{chunk-L5EE2M32.js.map → chunk-EGP3MB37.js.map} +0 -0
  160. /package/dist/chunks/{chunk-H2SFQIVZ.js.map → chunk-ESMVELWA.js.map} +0 -0
  161. /package/dist/chunks/{chunk-JDS4SYAJ.js.map → chunk-EXVGLN6V.js.map} +0 -0
  162. /package/dist/chunks/{chunk-NXLK7UAG.js.map → chunk-FKSIOYXA.js.map} +0 -0
  163. /package/dist/chunks/{chunk-D7UUTTLG.js.map → chunk-FXMJ5NVM.js.map} +0 -0
  164. /package/dist/chunks/{chunk-5GVYGWMK.js.map → chunk-HBTPB6ON.js.map} +0 -0
  165. /package/dist/chunks/{chunk-6AH52DNV.js.map → chunk-HHOTJDZW.js.map} +0 -0
  166. /package/dist/chunks/{chunk-QX6YDLUD.js.map → chunk-HLIXL5RK.js.map} +0 -0
  167. /package/dist/chunks/{chunk-NFCBNDBG.js.map → chunk-HWM73622.js.map} +0 -0
  168. /package/dist/chunks/{chunk-CI3SKMXQ.js.map → chunk-ISN4VZCX.js.map} +0 -0
  169. /package/dist/chunks/{chunk-VMJWG5TF.js.map → chunk-IVZB7YKX.js.map} +0 -0
  170. /package/dist/chunks/{chunk-BGI5U5XL.js.map → chunk-JEHKZEIB.js.map} +0 -0
  171. /package/dist/chunks/{chunk-WUBN6DXH.js.map → chunk-JII5GOH2.js.map} +0 -0
  172. /package/dist/chunks/{chunk-YVJTVJN4.js.map → chunk-KS5X3GMX.js.map} +0 -0
  173. /package/dist/chunks/{chunk-NNSCLV6S.js.map → chunk-LS7PT6RY.js.map} +0 -0
  174. /package/dist/chunks/{chunk-ECO3KP5U.js.map → chunk-M2PQMMDW.js.map} +0 -0
  175. /package/dist/chunks/{chunk-RI5G5NS3.js.map → chunk-MCXVRO4B.js.map} +0 -0
  176. /package/dist/chunks/{chunk-64WCX6UV.js.map → chunk-MEHYOYTW.js.map} +0 -0
  177. /package/dist/chunks/{chunk-5CKCYCPL.js.map → chunk-MIM4YRP2.js.map} +0 -0
  178. /package/dist/chunks/{chunk-X62U63KJ.js.map → chunk-N3JNFZOW.js.map} +0 -0
  179. /package/dist/chunks/{chunk-44JEVSTR.js.map → chunk-NUJCTZOM.js.map} +0 -0
  180. /package/dist/chunks/{chunk-2GO7AWHX.js.map → chunk-ONKQPPSY.js.map} +0 -0
  181. /package/dist/chunks/{chunk-MBGTDQFF.js.map → chunk-OT5X76XI.js.map} +0 -0
  182. /package/dist/chunks/{chunk-ERSRQ6QN.js.map → chunk-OVG3QY7U.js.map} +0 -0
  183. /package/dist/chunks/{chunk-EXL2ALVX.js.map → chunk-PV4ZAFVQ.js.map} +0 -0
  184. /package/dist/chunks/{chunk-WICKQJR4.js.map → chunk-QENCNE7Q.js.map} +0 -0
  185. /package/dist/chunks/{chunk-BYJ4AGMC.js.map → chunk-QR5YS5QW.js.map} +0 -0
  186. /package/dist/chunks/{chunk-DXQQSQQ3.js.map → chunk-T64F5OER.js.map} +0 -0
  187. /package/dist/chunks/{chunk-PWO4HKDQ.js.map → chunk-TACSPIUK.js.map} +0 -0
  188. /package/dist/chunks/{chunk-CL475F3V.js.map → chunk-V6UEMLTT.js.map} +0 -0
  189. /package/dist/chunks/{chunk-UB6WVOKM.js.map → chunk-W6JEZMOJ.js.map} +0 -0
  190. /package/dist/chunks/{chunk-QYIY7Q5R.js.map → chunk-WNVYEZUQ.js.map} +0 -0
  191. /package/dist/chunks/{chunk-6A5BVWEI.js.map → chunk-XJT5DL3I.js.map} +0 -0
  192. /package/dist/chunks/{chunk-24FWPXME.js.map → chunk-XNQI4ZDH.js.map} +0 -0
  193. /package/dist/chunks/{chunk-GQBSRXFY.js.map → chunk-YIFOFVWM.js.map} +0 -0
  194. /package/dist/chunks/{chunk-PAJTVGYM.js.map → chunk-YZOR7643.js.map} +0 -0
  195. /package/dist/chunks/{cli-runtime-KLGRRAPC.js.map → cli-runtime-XHGO7QSK.js.map} +0 -0
  196. /package/dist/chunks/{commands-UQGS6244.js.map → commands-GDF5OOXO.js.map} +0 -0
  197. /package/dist/chunks/{crash-report-F3CLYQ6A.js.map → crash-report-N7ZQ2UB4.js.map} +0 -0
  198. /package/dist/chunks/{dist-FE7KZYMC.js.map → dist-36LBIFJ6.js.map} +0 -0
  199. /package/dist/chunks/{dist-BF3HQ6PJ.js.map → dist-547VSBMV.js.map} +0 -0
  200. /package/dist/chunks/{dist-MMWDBT7P.js.map → dist-IJ3AAED4.js.map} +0 -0
  201. /package/dist/chunks/{dist-TZU45EHB.js.map → dist-MZNKQTW4.js.map} +0 -0
  202. /package/dist/chunks/{dist-BYIBYB4E.js.map → dist-T2NJ6SVO.js.map} +0 -0
  203. /package/dist/chunks/{dist-SGU5HCLT.js.map → dist-TCIDRGW5.js.map} +0 -0
  204. /package/dist/chunks/{dist-FFM3ZZQ4.js.map → dist-TCILCQPG.js.map} +0 -0
  205. /package/dist/chunks/{doctor-6ZZOTVMF.js.map → doctor-T7SC3VSE.js.map} +0 -0
  206. /package/dist/chunks/{drain-XK5PA7E5.js.map → drain-OA5MO7SQ.js.map} +0 -0
  207. /package/dist/chunks/{eval-RPKIJFAB.js.map → eval-D5Q2WZ7S.js.map} +0 -0
  208. /package/dist/chunks/{exec-DJ4ECSDD.js.map → exec-MG5S7OJN.js.map} +0 -0
  209. /package/dist/chunks/{home-ZAIMBEH7.js.map → home-Z7L4BJTW.js.map} +0 -0
  210. /package/dist/chunks/{host-queries-AMSRIPNG.js.map → host-queries-LL56A6NY.js.map} +0 -0
  211. /package/dist/chunks/{lifecycle-L4E6FPYN.js.map → lifecycle-TCRLU6B5.js.map} +0 -0
  212. /package/dist/chunks/{list-2QTHV4YO.js.map → list-RBOLXDHG.js.map} +0 -0
  213. /package/dist/chunks/{login-QMOTL6Y5.js.map → login-RZCJNDAJ.js.map} +0 -0
  214. /package/dist/chunks/{logs-JIQJGYVR.js.map → logs-KDEGF3FA.js.map} +0 -0
  215. /package/dist/chunks/{mcp-ZCRO5DB3.js.map → mcp-7L7NYLKG.js.map} +0 -0
  216. /package/dist/chunks/{message-command-2SCMXO4D.js.map → message-command-NTLYNKUW.js.map} +0 -0
  217. /package/dist/chunks/{operator-tools-23FYQ5OE.js.map → operator-tools-DXU6UK4S.js.map} +0 -0
  218. /package/dist/chunks/{output-schema-RTXHP2NW.js.map → output-schema-UMOAOTW2.js.map} +0 -0
  219. /package/dist/chunks/{pal-AC73MLO6.js.map → pal-FDOF3S5J.js.map} +0 -0
  220. /package/dist/chunks/{providers-SUXIFNA4.js.map → providers-HOY5QHWL.js.map} +0 -0
  221. /package/dist/chunks/{resident-VFEZDABF.js.map → resident-XIM5KNNX.js.map} +0 -0
  222. /package/dist/chunks/{resume-I3YLV7D3.js.map → resume-3OP5GB7S.js.map} +0 -0
  223. /package/dist/chunks/{resume-command-PZ3NLBOR.js.map → resume-command-DIVGMVMA.js.map} +0 -0
  224. /package/dist/chunks/{schedule-4KYTYQML.js.map → schedule-YRHGK6CD.js.map} +0 -0
  225. /package/dist/chunks/{service-NI46RYPW.js.map → service-DRXVEYFA.js.map} +0 -0
  226. /package/dist/chunks/{session-step-IR57BRZX.js.map → session-step-ZD3D55SM.js.map} +0 -0
  227. /package/dist/chunks/{skills-OYRPNK3I.js.map → skills-C5ZXOJEA.js.map} +0 -0
  228. /package/dist/chunks/{state-ULVIHH2M.js.map → state-BVKWZF6F.js.map} +0 -0
  229. /package/dist/chunks/{store-3LVJZEHS.js.map → store-A4VHV4I2.js.map} +0 -0
  230. /package/dist/chunks/{store-EOHDDBM7.js.map → store-GKY55UEV.js.map} +0 -0
  231. /package/dist/chunks/{store-W2VNXICH.js.map → store-ZXFXXY4S.js.map} +0 -0
  232. /package/dist/chunks/{tui-GEHRYWRG.js.map → tui-PY2FQXVO.js.map} +0 -0
  233. /package/dist/chunks/{upgrade-LSB2KNDF.js.map → upgrade-WSBGA3FW.js.map} +0 -0
  234. /package/dist/chunks/{worktree-PZU6IAUF.js.map → worktree-HLE7PBLL.js.map} +0 -0
@@ -641,8 +641,8 @@ function windowsEnv(env, name2) {
641
641
  }
642
642
  __name(windowsEnv, "windowsEnv");
643
643
  function insideDirectory(path2, directory) {
644
- const relative10 = win32.relative(directory, path2);
645
- return relative10 === "" || !relative10.startsWith("..") && !win32.isAbsolute(relative10);
644
+ const relative11 = win32.relative(directory, path2);
645
+ return relative11 === "" || !relative11.startsWith("..") && !win32.isAbsolute(relative11);
646
646
  }
647
647
  __name(insideDirectory, "insideDirectory");
648
648
  function findGitBash(probe2) {
@@ -1366,13 +1366,13 @@ var GuardedFetchProvider = class {
1366
1366
  operation.throwIfStopped();
1367
1367
  return url;
1368
1368
  }
1369
- const resolve27 = this.config.resolve ?? (async (name2) => (await lookup(name2, { all: true })).map((r) => r.address));
1369
+ const resolve28 = this.config.resolve ?? (async (name2) => (await lookup(name2, { all: true })).map((r) => r.address));
1370
1370
  let addresses;
1371
1371
  if (isIP(hostname)) {
1372
1372
  addresses = [hostname];
1373
1373
  } else {
1374
1374
  try {
1375
- addresses = await operation.run(() => resolve27(hostname, operation.signal));
1375
+ addresses = await operation.run(() => resolve28(hostname, operation.signal));
1376
1376
  } catch (err) {
1377
1377
  operation.throwIfStopped();
1378
1378
  throw new WebFetchRefusedError(`Refused "${hostname}" \u2014 it could not be resolved (${err instanceof Error ? err.message : String(err)}), so nothing here can say where it points.`, { url: rawUrl, reason: "private-address" });
@@ -6392,9 +6392,9 @@ async function vetWebSocketTarget(raw, options = {}) {
6392
6392
  if (literal !== 0) {
6393
6393
  addresses = [hostname];
6394
6394
  } else {
6395
- const resolve27 = options.resolve ?? (async (name2) => (await dnsLookup(name2, { all: true })).map((r) => r.address));
6395
+ const resolve28 = options.resolve ?? (async (name2) => (await dnsLookup(name2, { all: true })).map((r) => r.address));
6396
6396
  try {
6397
- addresses = await resolve27(hostname);
6397
+ addresses = await resolve28(hostname);
6398
6398
  } catch (err) {
6399
6399
  throw new WebSocketRefusedError(`Refused "${hostname}": it could not be resolved (${err instanceof Error ? err.message : String(err)}), so nothing here can say where it points.`);
6400
6400
  }
@@ -6820,8 +6820,8 @@ var BackgroundJobRegistry = class {
6820
6820
  };
6821
6821
  let startError;
6822
6822
  let settleStarted;
6823
- const startedPromise = new Promise((resolve27) => {
6824
- settleStarted = /* @__PURE__ */ __name(() => resolve27(startError === void 0 ? {} : { error: startError }), "settleStarted");
6823
+ const startedPromise = new Promise((resolve28) => {
6824
+ settleStarted = /* @__PURE__ */ __name(() => resolve28(startError === void 0 ? {} : { error: startError }), "settleStarted");
6825
6825
  });
6826
6826
  if (params.spawn || child.pid !== void 0)
6827
6827
  settleStarted();
@@ -6867,7 +6867,7 @@ var BackgroundJobRegistry = class {
6867
6867
  outputChunks: [],
6868
6868
  outputObservers: /* @__PURE__ */ new Set(),
6869
6869
  started: startedPromise,
6870
- exit: new Promise((resolve27) => {
6870
+ exit: new Promise((resolve28) => {
6871
6871
  let spawned = child.pid !== void 0;
6872
6872
  let failedToSpawn = false;
6873
6873
  let finalized = false;
@@ -6885,7 +6885,7 @@ var BackgroundJobRegistry = class {
6885
6885
  ...code === null ? {} : { exitCode: code },
6886
6886
  ...signal ? { signal } : {}
6887
6887
  };
6888
- resolve27();
6888
+ resolve28();
6889
6889
  for (const observer of entry.outputObservers)
6890
6890
  observer();
6891
6891
  if (entry.monitor) {
@@ -7058,7 +7058,7 @@ var BackgroundJobRegistry = class {
7058
7058
  const signal = opts.signal;
7059
7059
  if (signal.aborted)
7060
7060
  return Promise.reject(signal.reason);
7061
- return new Promise((resolve27, reject2) => {
7061
+ return new Promise((resolve28, reject2) => {
7062
7062
  let disposeAbort = /* @__PURE__ */ __name(() => {
7063
7063
  }, "disposeAbort");
7064
7064
  const unsubscribe = this.onExit((job) => {
@@ -7066,7 +7066,7 @@ var BackgroundJobRegistry = class {
7066
7066
  return;
7067
7067
  unsubscribe();
7068
7068
  disposeAbort();
7069
- resolve27(job);
7069
+ resolve28(job);
7070
7070
  });
7071
7071
  disposeAbort = subscribeToAbort(signal, () => {
7072
7072
  unsubscribe();
@@ -7163,7 +7163,7 @@ var BackgroundJobRegistry = class {
7163
7163
  throw new BackgroundJobOutputWaitLimitError({ owner, limit: globalLimit, scope: "registry" });
7164
7164
  this.outputWaiters++;
7165
7165
  this.outputWaitersByOwner.set(owner, ownerCount + 1);
7166
- return new Promise((resolve27) => {
7166
+ return new Promise((resolve28) => {
7167
7167
  const startedAt = Date.now();
7168
7168
  let settled = false;
7169
7169
  let disposeAbort = /* @__PURE__ */ __name(() => {
@@ -7183,7 +7183,7 @@ var BackgroundJobRegistry = class {
7183
7183
  this.outputWaitersByOwner.delete(owner);
7184
7184
  else
7185
7185
  this.outputWaitersByOwner.set(owner, remaining);
7186
- resolve27(result);
7186
+ resolve28(result);
7187
7187
  }, "finish");
7188
7188
  const timeout = /* @__PURE__ */ __name((cause) => {
7189
7189
  read();
@@ -9604,7 +9604,7 @@ async function renameWithRetry(from, to) {
9604
9604
  const code = err.code ?? "";
9605
9605
  if (!CONTENDED.has(code) || attempt >= RENAME_ATTEMPTS)
9606
9606
  throw err;
9607
- await new Promise((resolve27) => setTimeout(resolve27, attempt));
9607
+ await new Promise((resolve28) => setTimeout(resolve28, attempt));
9608
9608
  }
9609
9609
  }
9610
9610
  }
@@ -12572,8 +12572,8 @@ async function releaseHeldSessionLeases(options = {}) {
12572
12572
  }, () => {
12573
12573
  })));
12574
12574
  let timer;
12575
- const deadline = new Promise((resolve27) => {
12576
- timer = setTimeout(resolve27, options.timeoutMs ?? 2e3);
12575
+ const deadline = new Promise((resolve28) => {
12576
+ timer = setTimeout(resolve28, options.timeoutMs ?? 2e3);
12577
12577
  });
12578
12578
  await Promise.race([all, deadline]);
12579
12579
  clearTimeout(timer);
@@ -13591,7 +13591,18 @@ var ChildSessionMetaSchema = external_exports.object({
13591
13591
  description: text2,
13592
13592
  status: turnExecutionStatus,
13593
13593
  createdAt: isoUtc,
13594
- endedAt: isoUtc.optional()
13594
+ endedAt: isoUtc.optional(),
13595
+ /**
13596
+ * What a later process needs to continue this child from its saved log:
13597
+ * the filesystem policy it ran under and a small host-defined profile
13598
+ * (which agent to rebuild, which model). Absent on children saved before
13599
+ * this field existed and on children whose host recorded no profile; those
13600
+ * cannot be continued from disk.
13601
+ */
13602
+ continuation: external_exports.object({
13603
+ workspace: external_exports.enum(["shared", "isolated"]),
13604
+ profile: external_exports.record(external_exports.string().min(1).max(64), external_exports.string().max(256)).refine((value) => Object.keys(value).length <= 16, "At most 16 profile entries")
13605
+ }).strict().optional()
13595
13606
  }).strict();
13596
13607
  var SessionLeaseDocumentSchema = external_exports.object({
13597
13608
  v: external_exports.literal(1),
@@ -14273,7 +14284,7 @@ async function renameWithRetry2(from, to) {
14273
14284
  const code = err.code ?? "";
14274
14285
  if (!CONTENDED2.has(code) || attempt >= RENAME_ATTEMPTS2)
14275
14286
  throw err;
14276
- await new Promise((resolve27) => setTimeout(resolve27, attempt));
14287
+ await new Promise((resolve28) => setTimeout(resolve28, attempt));
14277
14288
  }
14278
14289
  }
14279
14290
  }
@@ -16610,25 +16621,28 @@ function buildTaskTools(taskStore, scope) {
16610
16621
  }
16611
16622
  __name(buildTaskTools, "buildTaskTools");
16612
16623
 
16613
- // ../sdk/dist/types/permission/index.js
16614
- var PLAN_MODE_REFUSAL = "Refused: plan mode is read-only. Explore with the reading tools, then present the plan as your reply \u2014 what you would change, in which files, and in what order. The user will switch out of plan mode to have it carried out.";
16615
-
16616
16624
  // ../sdk/dist/compaction/summary.js
16617
16625
  var COMPACTION_HEADER = "[COMPACTED CONTEXT] The following is a structured summary of the conversation so far.";
16618
16626
  function isCompactionMessage(content) {
16619
16627
  return typeof content === "string" && content.startsWith(COMPACTION_HEADER);
16620
16628
  }
16621
16629
  __name(isCompactionMessage, "isCompactionMessage");
16622
- function buildCompactionMessage(body) {
16630
+ var COMPACTION_RECOVERY_NOTE = "Earlier output was cut from this summary. To get exact earlier text, call search_conversation, then read_conversation.";
16631
+ function buildCompactionMessage(body, recoveryNote) {
16623
16632
  return {
16624
16633
  ...createSystemMessage(`${COMPACTION_HEADER}
16625
16634
 
16626
- ${body}`),
16635
+ ${body}${recoveryNote ? `
16636
+
16637
+ ${recoveryNote}` : ""}`),
16627
16638
  source: { type: "compaction-summary" }
16628
16639
  };
16629
16640
  }
16630
16641
  __name(buildCompactionMessage, "buildCompactionMessage");
16631
16642
 
16643
+ // ../sdk/dist/types/permission/index.js
16644
+ var PLAN_MODE_REFUSAL = "Refused: plan mode is read-only. Explore with the reading tools, then present the plan as your reply \u2014 what you would change, in which files, and in what order. The user will switch out of plan mode to have it carried out.";
16645
+
16632
16646
  // ../sdk/dist/provider/strict-schema.js
16633
16647
  var NO_CONDITIONALS = "strict mode has no conditional schemas; flatten the object";
16634
16648
  var NO_NUMERIC_BOUNDS = "numeric bounds are not in the subset; enforce at execution";
@@ -18300,7 +18314,7 @@ function buildAskUserQuestionTool(config) {
18300
18314
  const { questionParks, pendingAnswers } = config;
18301
18315
  return defineTool({
18302
18316
  name: ASK_USER_QUESTION_TOOL_NAME,
18303
- description: `Ask the user when you are blocked on a decision that is genuinely theirs to make \u2014 one you cannot resolve from their request, your tools, the files you can read, or sensible defaults. The question must be the genuinely undecidable thing in THIS task. Never ask for information a tool can discover (do not ask what you can read, list, or search), never re-ask what the conversation already answers, and never ask meta-questions like "Shall I proceed?" \u2014 plan ratification goes through approve_plan. Provide 2-4 genuinely distinct options derived from the actual context \u2014 concrete paths, never generic placeholders (for example, asked to prepare a presentation, ask "Who is the audience?" with options like Board / Engineering team / Customer); keep labels short (1-5 words) and give each option a one-line description of what practically changes if it is chosen. If you recommend an option, put it FIRST and set recommended: true on it; the host marks it for the user, so never write "(Recommended)" or any translation of it into a label, and never end a label with a parenthesised note (put qualifiers in the description). Set multiSelect: true only when several options can apply at once. An option may carry a preview (plain text or markdown) that the host shows beside the list while it is focused; use it only when seeing the thing helps the choice. A free-text "Something else" escape hatch is always shown automatically \u2014 do not add your own "Other" option. Put the questions in the questions array. Use ONE entry for a single decision. Put several entries in the same call only when they are related decisions that ALL block your next step and the user can answer them together (for example which account, for what purpose, which environment before a credentialed step), at most 4, each with a short unique header; the user answers them all in one card and you get one answer per question. Never batch questions that depend on one another's answers \u2014 ask the first, then decide. Most work needs at most 2-3 questions in all, so prefer proceeding on stated defaults over interrogating the user. Never invent answers or synthetic content on the user's behalf unless they explicitly asked for a random/test scenario. The answers arrive as this tool's result; a question the result says was not answered must not be assumed, and if the result says the user did not answer at all, do not ask again \u2014 proceed on your best judgment without assuming consent.`,
18317
+ description: `Ask the user when you are blocked on a decision that is genuinely theirs to make \u2014 one you cannot resolve from their request, your tools, the files you can read, or sensible defaults. The question must be the genuinely undecidable thing in THIS task. Never ask for information a tool can discover (do not ask what you can read, list, or search), never re-ask what the conversation already answers, and never ask meta-questions like "Shall I proceed?" \u2014 plan ratification goes through approve_plan. Provide 2-4 genuinely distinct options derived from the actual context \u2014 concrete paths, never generic placeholders (for example, asked to prepare a presentation, ask who the audience is, with an option for each plausible audience); keep labels short (1-5 words) and give each option a one-line description of what practically changes if it is chosen. If you recommend an option, put it FIRST and set recommended: true on it; the host marks it for the user, so never write "(Recommended)" or any translation of it into a label, and never end a label with a parenthesised note (put qualifiers in the description). Set multiSelect: true only when several options can apply at once. An option may carry a preview (plain text or markdown) that the host shows beside the list while it is focused; use it only when seeing the thing helps the choice. A free-text "Something else" escape hatch is always shown automatically \u2014 do not add your own "Other" option. Put the questions in the questions array. Use ONE entry for a single decision. Put several entries in the same call only when they are related decisions that ALL block your next step and the user can answer them together (for example which account, for what purpose, which environment before a credentialed step), at most 4, each with a short unique header; the user answers them all in one card and you get one answer per question. Never batch questions that depend on one another's answers \u2014 ask the first, then decide. Most work needs at most 2-3 questions in all, so prefer proceeding on stated defaults over interrogating the user. Never invent answers or synthetic content on the user's behalf unless they explicitly asked for a random/test scenario. The answers arrive as this tool's result; a question the result says was not answered must not be assumed, and if the result says the user did not answer at all, do not ask again \u2014 proceed on your best judgment without assuming consent.`,
18304
18318
  inputSchema: inputSchema2,
18305
18319
  modelInputSchema: structuredClone(askUserQuestionModelInputSchema),
18306
18320
  enforceModelInput: true,
@@ -22630,14 +22644,14 @@ __name(backoffProportional, "backoffProportional");
22630
22644
  function sleep(ms, signal) {
22631
22645
  if (ms <= 0)
22632
22646
  return Promise.resolve();
22633
- return new Promise((resolve27, reject2) => {
22647
+ return new Promise((resolve28, reject2) => {
22634
22648
  if (signal?.aborted) {
22635
22649
  reject2(signal.reason);
22636
22650
  return;
22637
22651
  }
22638
22652
  const timer = setTimeout(() => {
22639
22653
  signal?.removeEventListener("abort", onAbort);
22640
- resolve27();
22654
+ resolve28();
22641
22655
  }, ms);
22642
22656
  const onAbort = /* @__PURE__ */ __name(() => {
22643
22657
  clearTimeout(timer);
@@ -23371,11 +23385,11 @@ __name(checkRemoval, "checkRemoval");
23371
23385
  var GLOB_TAIL = /[\\/]\.?\*$/;
23372
23386
  function checkTarget(program, args, spelled, word2, scope) {
23373
23387
  const expanded = expandTilde(spelled, scope.home);
23374
- const relative10 = !isAbsolute3(expanded);
23388
+ const relative11 = !isAbsolute3(expanded);
23375
23389
  if (expandsAtRuntime(word2) && /[$`]/.test(expanded)) {
23376
23390
  return void 0;
23377
23391
  }
23378
- const absolute = relative10 ? resolve2(scope.cwd, expanded) : resolve2(expanded);
23392
+ const absolute = relative11 ? resolve2(scope.cwd, expanded) : resolve2(expanded);
23379
23393
  let settled = absolute;
23380
23394
  for (let previous = ""; previous !== settled; ) {
23381
23395
  previous = settled;
@@ -23385,18 +23399,18 @@ function checkTarget(program, args, spelled, word2, scope) {
23385
23399
  }
23386
23400
  const globbed = settled !== absolute;
23387
23401
  const original = expanded;
23388
- if (scope.changesDirectory && globbed && relative10 && GLOB_TAIL.test(absolute)) {
23402
+ if (scope.changesDirectory && globbed && relative11 && GLOB_TAIL.test(absolute)) {
23389
23403
  return `${program} ${spelled}: a relative glob after a cd cannot be resolved before the line runs`;
23390
23404
  }
23391
23405
  let below = settled;
23392
- if (relative10) {
23406
+ if (relative11) {
23393
23407
  const prefix = scope.cwd.endsWith(sep3) ? scope.cwd : scope.cwd + sep3;
23394
23408
  if (settled.startsWith(prefix))
23395
23409
  below = settled.slice(prefix.length);
23396
23410
  else if (settled === scope.cwd)
23397
23411
  below = "";
23398
23412
  }
23399
- if (globbed && (hasParentAfterName(original) || original.startsWith("~") || /^[\\/]{2}/.test(original) || relative10 && /(^|[\\/])\.\.([\\/]|$)/.test(original) && GLOB_TAIL.test(absolute) || program === "rmdir" && GLOB_TAIL.test(absolute) && args.some((a) => /^--p/.test(a.value) || /^-[a-z]*p/.test(a.value)) || relative10 && /\*[\\/]+$/.test(original) && GLOB_TAIL.test(absolute))) {
23413
+ if (globbed && (hasParentAfterName(original) || original.startsWith("~") || /^[\\/]{2}/.test(original) || relative11 && /(^|[\\/])\.\.([\\/]|$)/.test(original) && GLOB_TAIL.test(absolute) || program === "rmdir" && GLOB_TAIL.test(absolute) && args.some((a) => /^--p/.test(a.value) || /^-[a-z]*p/.test(a.value)) || relative11 && /\*[\\/]+$/.test(original) && GLOB_TAIL.test(absolute))) {
23400
23414
  return `${program} ${spelled}: the target cannot be resolved to a directory before the line runs`;
23401
23415
  }
23402
23416
  if (!globbed || !/[*?[]/.test(below)) {
@@ -23417,8 +23431,8 @@ function checkTarget(program, args, spelled, word2, scope) {
23417
23431
  if (globbed && GLOB_TAIL.test(absolute)) {
23418
23432
  const segments = /* @__PURE__ */ __name((value) => value.split(/[\\/]+/).filter((s) => s !== "" && s !== ".").length, "segments");
23419
23433
  const crossed = segments(absolute) - segments(settled);
23420
- const inside = below.split(/[\\/]+/).filter((s) => /[*?[]/.test(s)).length;
23421
- if (crossed + inside > 1) {
23434
+ const inside2 = below.split(/[\\/]+/).filter((s) => /[*?[]/.test(s)).length;
23435
+ if (crossed + inside2 > 1) {
23422
23436
  return `${program} ${spelled}: the glob crosses directories that cannot be listed before the line runs`;
23423
23437
  }
23424
23438
  }
@@ -24792,7 +24806,7 @@ function createFileReadTracker() {
24792
24806
  __name(createFileReadTracker, "createFileReadTracker");
24793
24807
 
24794
24808
  // ../sdk/dist/runtime/query/file-evidence-replay.js
24795
- import { resolve as resolve6 } from "node:path";
24809
+ import { resolve as resolve7 } from "node:path";
24796
24810
 
24797
24811
  // ../sdk/dist/constants/limits.js
24798
24812
  var ZERO_COST2 = {
@@ -24971,6 +24985,30 @@ var DEFAULT_MAX_TOOL_OUTPUT_CHARS = 4e4;
24971
24985
  var DEFAULT_MAX_TOOL_OUTPUT_CHARS_PER_MESSAGE = 2e5;
24972
24986
  var MESSAGE_BUDGET_PREVIEW_CHARS = 2e3;
24973
24987
  var SPILL_MARKER = "The full output was written to:";
24988
+ var RETAINED_OUTPUT_NOTE = "This path identifies retained output, not the original input.";
24989
+ var REPLAY_WARNING = "A fresh observation of the original input cannot recover its earlier contents. If recovery is unavailable, report the missing detail; do not replay the original action.";
24990
+ function describeRetainedOutputRecovery(routes) {
24991
+ const read = routes?.read === true;
24992
+ const conversation = routes?.conversation === true;
24993
+ const how = [
24994
+ read ? "To read more of it, open this file with the read tool (offset and limit)." : "",
24995
+ conversation ? read ? "For anything else from earlier in this conversation, call search_conversation with a phrase from it, then read_conversation with the seq and part it returns." : "To read more of it, call search_conversation with a phrase from it, then read_conversation with the seq and part it returns. The path is not a workspace file, so read and grep cannot open it." : ""
24996
+ ].filter(Boolean);
24997
+ if (how.length === 0)
24998
+ return `${RETAINED_OUTPUT_NOTE} Use the host-authorized retained-output recovery tools when available; the path does not grant filesystem access. ${REPLAY_WARNING}`;
24999
+ return [RETAINED_OUTPUT_NOTE, ...how, REPLAY_WARNING].join(" ");
25000
+ }
25001
+ __name(describeRetainedOutputRecovery, "describeRetainedOutputRecovery");
25002
+ function retainedOutputPointer(text9) {
25003
+ const lines = text9.split(/\r\n|\r|\n/);
25004
+ const at = lines.findIndex((line) => line.startsWith(SPILL_MARKER));
25005
+ if (at < 0)
25006
+ return void 0;
25007
+ const next = lines[at + 1];
25008
+ return next?.startsWith(RETAINED_OUTPUT_NOTE) ? `${lines[at]}
25009
+ ${next}` : lines[at];
25010
+ }
25011
+ __name(retainedOutputPointer, "retainedOutputPointer");
24974
25012
  var HEAD_SHARE = 0.75;
24975
25013
  function safeHead(text9, maxChars2) {
24976
25014
  let end = Math.min(text9.length, Math.max(0, maxChars2));
@@ -25000,7 +25038,7 @@ function boundedPreview(output, maxChars2, toolName, recovery) {
25000
25038
  ""
25001
25039
  ].join("\n");
25002
25040
  const compactMiddle = "\n[... omitted ...]\n";
25003
- const spillLine = recovery.split("\n").find((line) => line.startsWith(SPILL_MARKER));
25041
+ const spillLine = recovery.split(/\r\n|\r|\n/).find((line) => line.startsWith(SPILL_MARKER));
25004
25042
  const compactRecovery = spillLine ? `${compactMiddle}${spillLine}
25005
25043
  ` : compactMiddle;
25006
25044
  const middle = detailedMiddle.length < maxChars2 ? detailedMiddle : compactRecovery.length < maxChars2 ? compactRecovery : compactMiddle;
@@ -25052,10 +25090,7 @@ function applyToolOutputBudget(opts) {
25052
25090
  }
25053
25091
  const retained = opts.spillDir ? spill2(opts.spillDir, opts.toolUseId, output, opts.onError) : void 0;
25054
25092
  const spillPath = retained?.path;
25055
- const recovery = spillPath ? [
25056
- `${SPILL_MARKER} ${spillPath}`,
25057
- "This path identifies retained output, not the original input. Use the host-authorized retained-output recovery tools when available; the path does not grant filesystem access. A fresh observation of the original input cannot recover its earlier contents. If recovery is unavailable, report the missing detail; do not replay the original action."
25058
- ].join("\n") : "The full output was not retained. Use a saved artifact or a read-only observation; do not repeat a state-changing action to recover its output.";
25093
+ const recovery = spillPath ? [`${SPILL_MARKER} ${spillPath}`, describeRetainedOutputRecovery(opts.recoveryRoutes)].join("\n") : "The full output was not retained. Use a saved artifact or a read-only observation; do not repeat a state-changing action to recover its output.";
25059
25094
  const requestedPreview = opts.retainedPreviewChars;
25060
25095
  const previewLimit = retained?.integrity && requestedPreview !== void 0 && Number.isFinite(requestedPreview) && requestedPreview > 0 ? Math.min(limit, Math.floor(requestedPreview)) : limit;
25061
25096
  const previewTextBudget = Math.max(0, previewLimit - notice.length - (notice && output ? 2 : 0));
@@ -25114,7 +25149,6 @@ function spill2(dir, toolUseId3, content, onError) {
25114
25149
  }
25115
25150
  }
25116
25151
  __name(spill2, "spill");
25117
- var SPILL_LINE = new RegExp(`^${SPILL_MARKER} .+$`, "m");
25118
25152
  function fitResultsToMessageBudget(items, opts) {
25119
25153
  const replaced = /* @__PURE__ */ new Map();
25120
25154
  if (!Number.isFinite(opts.maxChars) || opts.maxChars <= 0)
@@ -25137,7 +25171,7 @@ function fitResultsToMessageBudget(items, opts) {
25137
25171
  }
25138
25172
  __name(fitResultsToMessageBudget, "fitResultsToMessageBudget");
25139
25173
  function previewForMessageBudget(item, opts) {
25140
- const spilledAt = SPILL_LINE.exec(item.output)?.[0];
25174
+ const spilledAt = retainedOutputPointer(item.output);
25141
25175
  if (spilledAt !== void 0) {
25142
25176
  const output = [
25143
25177
  safeHead(item.output, MESSAGE_BUDGET_PREVIEW_CHARS / 2),
@@ -25148,7 +25182,7 @@ function previewForMessageBudget(item, opts) {
25148
25182
  return {
25149
25183
  output,
25150
25184
  originalLength: item.output.length,
25151
- spillPath: spilledAt.slice(SPILL_MARKER.length + 1)
25185
+ spillPath: spilledAt.split("\n")[0].slice(SPILL_MARKER.length + 1)
25152
25186
  };
25153
25187
  }
25154
25188
  const budgeted = applyToolOutputBudget({
@@ -25158,6 +25192,7 @@ function previewForMessageBudget(item, opts) {
25158
25192
  output: item.output,
25159
25193
  maxChars: MESSAGE_BUDGET_PREVIEW_CHARS,
25160
25194
  spillDir: opts.spillDir,
25195
+ ...opts.recoveryRoutes ? { recoveryRoutes: opts.recoveryRoutes } : {},
25161
25196
  ...opts.onError ? { onError: opts.onError } : {}
25162
25197
  });
25163
25198
  return {
@@ -25301,9 +25336,10 @@ function clearedPlaceholder(content, toolName, size) {
25301
25336
  const parts = [
25302
25337
  `${CLEARED_PREFIX} ${toolName} returned ${size.toLocaleString("en-US")} characters, cleared to reclaim context.`
25303
25338
  ];
25304
- const spillLine = text9.split("\n").find((line) => line.startsWith(SPILL_MARKER));
25305
- if (spillLine) {
25306
- parts.push(spillLine, "Read a window of it with `read` (offset/limit) or search it with `grep`.");
25339
+ const pointer2 = retainedOutputPointer(text9);
25340
+ if (pointer2) {
25341
+ parts.push(pointer2.includes("\n") ? pointer2 : `${pointer2}
25342
+ ${describeRetainedOutputRecovery()}`);
25307
25343
  } else {
25308
25344
  parts.push("Full result unavailable here. Recover from a saved artifact or a read-only observation; do not repeat a state-changing action to recover its output.");
25309
25345
  }
@@ -25866,8 +25902,8 @@ async function withFileMutationLock(key5, operation) {
25866
25902
  const previous = mutationTails.get(key5) ?? Promise.resolve();
25867
25903
  let release = /* @__PURE__ */ __name(() => {
25868
25904
  }, "release");
25869
- const current = new Promise((resolve27) => {
25870
- release = resolve27;
25905
+ const current = new Promise((resolve28) => {
25906
+ release = resolve28;
25871
25907
  });
25872
25908
  const tail = previous.then(() => current);
25873
25909
  mutationTails.set(key5, tail);
@@ -27004,7 +27040,38 @@ var EditTool = defineTool({
27004
27040
 
27005
27041
  // ../sdk/dist/tools/builtins/read-file.js
27006
27042
  import { readFile as readFile7, stat as stat4 } from "node:fs/promises";
27007
- import { extname } from "node:path";
27043
+ import { extname as extname2 } from "node:path";
27044
+
27045
+ // ../sdk/dist/tools/retained-output.js
27046
+ import { lstat as lstat2, realpath as realpath4 } from "node:fs/promises";
27047
+ import { dirname as dirname9, extname, isAbsolute as isAbsolute6, relative as relative3, resolve as resolve6 } from "node:path";
27048
+ function inside(root, path2) {
27049
+ const rel = relative3(root, path2);
27050
+ return rel !== "" && !rel.startsWith("..") && !isAbsolute6(rel);
27051
+ }
27052
+ __name(inside, "inside");
27053
+ async function resolveRetainedOutput(directory, candidate) {
27054
+ if (!directory || !candidate || !isAbsolute6(candidate) || candidate.includes("\0"))
27055
+ return void 0;
27056
+ try {
27057
+ const base3 = await realpath4(directory);
27058
+ const lexical = resolve6(candidate);
27059
+ if (extname(lexical).toLowerCase() !== ".txt")
27060
+ return void 0;
27061
+ if (!inside(resolve6(directory), lexical) && !inside(base3, lexical))
27062
+ return void 0;
27063
+ const stat15 = await lstat2(lexical);
27064
+ if (stat15.isSymbolicLink() || !stat15.isFile() || stat15.nlink !== 1)
27065
+ return void 0;
27066
+ const real = await realpath4(lexical);
27067
+ if (!inside(base3, real) || dirname9(real) === real)
27068
+ return void 0;
27069
+ return real;
27070
+ } catch {
27071
+ return void 0;
27072
+ }
27073
+ }
27074
+ __name(resolveRetainedOutput, "resolveRetainedOutput");
27008
27075
 
27009
27076
  // ../sdk/dist/tools/text-window.js
27010
27077
  var WINDOW_HEAD_LINES = 80;
@@ -27264,7 +27331,8 @@ var ReadFileTool = defineTool({
27264
27331
  };
27265
27332
  },
27266
27333
  async execute(input, context2) {
27267
- if (context2.sandbox) {
27334
+ const retained = await resolveRetainedOutput(context2.retainedOutputDirectory, input.path);
27335
+ if (context2.sandbox && retained === void 0) {
27268
27336
  const buffer2 = await context2.sandbox.readFile(input.path);
27269
27337
  const binaryGuidance2 = describeStructuredBinaryRead(input.path, buffer2);
27270
27338
  if (binaryGuidance2) {
@@ -27303,7 +27371,7 @@ var ReadFileTool = defineTool({
27303
27371
  facts: readFacts(input.path, buffer2, content2, rendered2)
27304
27372
  };
27305
27373
  }
27306
- const filePath = await resolveWithinAnyReal(toolRoots(context2), input.path);
27374
+ const filePath = retained ?? await resolveWithinAnyReal(toolRoots(context2), input.path);
27307
27375
  if (input.readRange === void 0 && input.limit === void 0) {
27308
27376
  const { size } = await stat4(filePath);
27309
27377
  const early = renderCappedRead("", size, input, capOptions(input, context2));
@@ -27351,7 +27419,7 @@ function capOptions(input, context2) {
27351
27419
  const tokens = Number(context2.env?.NAMZU_FILE_READ_MAX_OUTPUT_TOKENS);
27352
27420
  return {
27353
27421
  path: input.path,
27354
- ext: extname(input.path).toLowerCase(),
27422
+ ext: extname2(input.path).toLowerCase(),
27355
27423
  ...input.allow_large === true ? { allowLarge: true } : {},
27356
27424
  ...Number.isFinite(tokens) && tokens > 0 ? { caps: { maxTokens: tokens } } : {}
27357
27425
  };
@@ -27392,7 +27460,7 @@ function recordObservedRead(context2, key5, content, rendered) {
27392
27460
  }
27393
27461
  __name(recordObservedRead, "recordObservedRead");
27394
27462
  function describeStructuredBinaryRead(path2, buffer) {
27395
- const ext2 = extname(path2).toLowerCase();
27463
+ const ext2 = extname2(path2).toLowerCase();
27396
27464
  const image = buffer.subarray(0, 8).equals(Buffer.from("89504e470d0a1a0a", "hex")) ? "PNG" : buffer[0] === 255 && buffer[1] === 216 ? "JPEG" : buffer.toString("ascii", 0, 4) === "RIFF" && buffer.toString("ascii", 8, 12) === "WEBP" ? "WebP" : null;
27397
27465
  if (image) {
27398
27466
  return [
@@ -27429,7 +27497,7 @@ __name(buildStructuredBinaryGuidance, "buildStructuredBinaryGuidance");
27429
27497
 
27430
27498
  // ../sdk/dist/tools/builtins/write-file.js
27431
27499
  import { mkdir as mkdir8, readFile as readFile8 } from "node:fs/promises";
27432
- import { dirname as dirname9 } from "node:path";
27500
+ import { dirname as dirname10 } from "node:path";
27433
27501
 
27434
27502
  // ../sdk/dist/tools/builtins/file-write-result.js
27435
27503
  import { createHash as createHash8 } from "node:crypto";
@@ -27590,7 +27658,7 @@ var WriteFileTool = defineTool({
27590
27658
  if (guard)
27591
27659
  return guard;
27592
27660
  }
27593
- await mkdir8(dirname9(hostPath), { recursive: true });
27661
+ await mkdir8(dirname10(hostPath), { recursive: true });
27594
27662
  await atomicWriteFile2(hostPath, content);
27595
27663
  context2.fileReadTracker?.recordRead(hostPath, content, context2.toolUseId);
27596
27664
  return fileWriteResult(hostPath, current, content);
@@ -27725,7 +27793,7 @@ function parseArguments2(call2) {
27725
27793
  }
27726
27794
  __name(parseArguments2, "parseArguments");
27727
27795
  function lexicalFileKeys(workingDirectory, sandboxed) {
27728
- return (path2) => sandboxed ? path2 : resolve6(workingDirectory, path2);
27796
+ return (path2) => sandboxed ? path2 : resolve7(workingDirectory, path2);
27729
27797
  }
27730
27798
  __name(lexicalFileKeys, "lexicalFileKeys");
27731
27799
  function indexVisibleHistory(messages, keyOf) {
@@ -30670,7 +30738,7 @@ var RUNTIME_DEFAULTS = RuntimeConfigSchema.parse({});
30670
30738
 
30671
30739
  // ../sdk/dist/manager/agent/child-session.js
30672
30740
  import { mkdir as mkdir9, readFile as readFile9 } from "node:fs/promises";
30673
- import { dirname as dirname10 } from "node:path";
30741
+ import { dirname as dirname11 } from "node:path";
30674
30742
  async function childSessionEnded(childLog) {
30675
30743
  let ended = null;
30676
30744
  for await (const { record: record3 } of childLog.read({ mode: "tolerant" })) {
@@ -30702,7 +30770,7 @@ async function writeChildSessionMeta(path2, meta) {
30702
30770
  if (current !== null && (current.sessionId !== next.sessionId || current.parentSessionId !== next.parentSessionId || current.parentTurnId !== next.parentTurnId)) {
30703
30771
  throw new ChildSessionMetaOwnerError(`${path2} describes child session ${current.sessionId} of ${current.parentSessionId}; refusing to overwrite it with ${next.sessionId} of ${next.parentSessionId}.`);
30704
30772
  }
30705
- await mkdir9(dirname10(path2), { recursive: true, mode: 448 });
30773
+ await mkdir9(dirname11(path2), { recursive: true, mode: 448 });
30706
30774
  await atomicWriteFile(path2, `${JSON.stringify(next)}
30707
30775
  `, { mode: 384 });
30708
30776
  }
@@ -32601,12 +32669,12 @@ var AwaitedJobs = class {
32601
32669
  return Promise.resolve();
32602
32670
  if (this.outstanding.size === 0 && this.monitors.size === 0)
32603
32671
  return Promise.resolve();
32604
- return new Promise((resolve27) => {
32672
+ return new Promise((resolve28) => {
32605
32673
  const finish2 = /* @__PURE__ */ __name(() => {
32606
32674
  clearTimeout(timer);
32607
32675
  this.arrivals.delete(finish2);
32608
32676
  signal?.removeEventListener("abort", finish2);
32609
- resolve27();
32677
+ resolve28();
32610
32678
  }, "finish");
32611
32679
  const timer = setTimeout(finish2, timeoutMs);
32612
32680
  timer.unref?.();
@@ -34616,12 +34684,12 @@ var CompletionInbox = class {
34616
34684
  return Promise.resolve();
34617
34685
  if (!this.hasPendingWork)
34618
34686
  return Promise.resolve();
34619
- return new Promise((resolve27) => {
34687
+ return new Promise((resolve28) => {
34620
34688
  const finish2 = /* @__PURE__ */ __name(() => {
34621
34689
  clearTimeout(timer);
34622
34690
  this.arrivals.delete(finish2);
34623
34691
  signal?.removeEventListener("abort", finish2);
34624
- resolve27();
34692
+ resolve28();
34625
34693
  }, "finish");
34626
34694
  const timer = setTimeout(finish2, timeoutMs);
34627
34695
  timer.unref?.();
@@ -34746,11 +34814,11 @@ ${JSON.stringify({ tasks: tasks2, omitted: this.ours.size - ids.length })}`;
34746
34814
  });
34747
34815
  if (settlements.length === 0)
34748
34816
  return this.drain();
34749
- await new Promise((resolve27) => {
34817
+ await new Promise((resolve28) => {
34750
34818
  const finish2 = /* @__PURE__ */ __name(() => {
34751
34819
  signal?.removeEventListener("abort", finish2);
34752
34820
  this.drains.delete(finish2);
34753
- resolve27();
34821
+ resolve28();
34754
34822
  }, "finish");
34755
34823
  this.drains.add(finish2);
34756
34824
  signal?.addEventListener("abort", finish2, { once: true });
@@ -35740,15 +35808,26 @@ var STOP_WORDS = /* @__PURE__ */ new Set([
35740
35808
  "you"
35741
35809
  ]);
35742
35810
  var WORD = /[\p{L}\p{N}_$][\p{L}\p{N}_$.\-/\\:]*/gu;
35811
+ var SEPARATORS = /* @__PURE__ */ new Set([".", "-", "/", "\\", ":"]);
35812
+ function trimSeparators(token) {
35813
+ let start = 0;
35814
+ let end = token.length;
35815
+ while (start < end && SEPARATORS.has(token[start]))
35816
+ start++;
35817
+ while (end > start && SEPARATORS.has(token[end - 1]))
35818
+ end--;
35819
+ return start === 0 && end === token.length ? token : token.slice(start, end);
35820
+ }
35821
+ __name(trimSeparators, "trimSeparators");
35743
35822
  function splitIdentifier(raw) {
35744
- const parts = raw.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[_\s]+/).filter((p) => p.length > 0);
35823
+ const parts = raw.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/(?<=[A-Z])(?=[A-Z][a-z])/g, " ").split(/[_\s]+/).filter((p) => p.length > 0);
35745
35824
  return parts.length > 1 ? parts : [];
35746
35825
  }
35747
35826
  __name(splitIdentifier, "splitIdentifier");
35748
35827
  function tokenize2(text9) {
35749
35828
  const out = [];
35750
35829
  for (const match2 of text9.matchAll(WORD)) {
35751
- const raw = match2[0].replace(/^[.\-/\\:]+|[.\-/\\:]+$/g, "");
35830
+ const raw = trimSeparators(match2[0]);
35752
35831
  if (raw.length === 0)
35753
35832
  continue;
35754
35833
  const whole = raw.toLowerCase();
@@ -35785,8 +35864,7 @@ __name(termFrequencies, "termFrequencies");
35785
35864
  // ../sdk/dist/compaction/salience/bm25.js
35786
35865
  var K1 = 1.2;
35787
35866
  var B = 0.75;
35788
- function indexDocument(text9) {
35789
- const tokens = tokenize2(text9);
35867
+ function indexDocument(text9, tokens = tokenize2(text9)) {
35790
35868
  return { tf: termFrequencies(tokens), length: tokens.length };
35791
35869
  }
35792
35870
  __name(indexDocument, "indexDocument");
@@ -35925,7 +36003,7 @@ function scoreMessages(messages, options) {
35925
36003
  const texts = messages.map(messageText);
35926
36004
  const richContent = messages.map(hasRichContent);
35927
36005
  const tokenLists = texts.map(tokenize2);
35928
- const documents = texts.map(indexDocument);
36006
+ const documents = texts.map((text9, i) => indexDocument(text9, tokenLists[i]));
35929
36007
  const index = buildIndex(documents);
35930
36008
  const goalTokens = tokenize2(options.goal);
35931
36009
  const rawRelevance = documents.map((doc) => bm25Score(index, doc, goalTokens));
@@ -37444,7 +37522,8 @@ async function runCompactionCheckInner(ctx, pass, options) {
37444
37522
  } else {
37445
37523
  compactedContent = serializeState(manager.getState());
37446
37524
  }
37447
- const compactionMessage = buildCompactionMessage(compactedContent);
37525
+ const mounted = new Set(ctx.tools?.listNames?.() ?? []);
37526
+ const compactionMessage = buildCompactionMessage(compactedContent, mounted.has("search_conversation") && mounted.has("read_conversation") ? COMPACTION_RECOVERY_NOTE : void 0);
37448
37527
  const preservedSystem = systemMessages.filter((m) => !isCompactionMessage(typeof m.content === "string" ? m.content : null) || m.retain === true);
37449
37528
  const retained = findRetainedIndices(messages);
37450
37529
  const retainedOlder = retained.size === 0 ? [] : messages.slice(systemMessages.length, keepStart).filter((_, offset) => retained.has(systemMessages.length + offset));
@@ -37695,14 +37774,14 @@ async function awaitDecisionDurably(ctx, checkpoint, request) {
37695
37774
  }, "record");
37696
37775
  let parkTimer;
37697
37776
  let recording = false;
37698
- const recordIfSlow = new Promise((resolve27) => {
37777
+ const recordIfSlow = new Promise((resolve28) => {
37699
37778
  parkTimer = setTimeout(() => {
37700
37779
  if (settled) {
37701
- resolve27();
37780
+ resolve28();
37702
37781
  return;
37703
37782
  }
37704
37783
  recording = true;
37705
- record3().then(resolve27, resolve27);
37784
+ record3().then(resolve28, resolve28);
37706
37785
  }, delay2);
37707
37786
  });
37708
37787
  try {
@@ -37752,13 +37831,13 @@ async function awaitDecisionOrAbort(ctx, request) {
37752
37831
  };
37753
37832
  if (signal.aborted)
37754
37833
  return abortDecision;
37755
- return new Promise((resolve27) => {
37834
+ return new Promise((resolve28) => {
37756
37835
  let settled = false;
37757
37836
  const onAbort = /* @__PURE__ */ __name(() => {
37758
37837
  if (settled)
37759
37838
  return;
37760
37839
  settled = true;
37761
- resolve27(abortDecision);
37840
+ resolve28(abortDecision);
37762
37841
  }, "onAbort");
37763
37842
  signal.addEventListener("abort", onAbort, { once: true });
37764
37843
  Promise.resolve(ctx.resumeHandler(request, resumeContext)).then((decision2) => {
@@ -37766,13 +37845,13 @@ async function awaitDecisionOrAbort(ctx, request) {
37766
37845
  return;
37767
37846
  settled = true;
37768
37847
  signal.removeEventListener("abort", onAbort);
37769
- resolve27(decision2);
37848
+ resolve28(decision2);
37770
37849
  }, (err) => {
37771
37850
  if (settled)
37772
37851
  return;
37773
37852
  settled = true;
37774
37853
  signal.removeEventListener("abort", onAbort);
37775
- resolve27({
37854
+ resolve28({
37776
37855
  action: "abort",
37777
37856
  reason: err instanceof Error ? err.message : "resume handler failed"
37778
37857
  });
@@ -37975,7 +38054,7 @@ __name(runPlanGate, "runPlanGate");
37975
38054
  import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
37976
38055
  async function awaitProjectInstructionCallback(signal, start) {
37977
38056
  signal.throwIfAborted();
37978
- return new Promise((resolve27, reject2) => {
38057
+ return new Promise((resolve28, reject2) => {
37979
38058
  let settled = false;
37980
38059
  const cleanup = /* @__PURE__ */ __name(() => signal.removeEventListener("abort", onAbort), "cleanup");
37981
38060
  const rejectOnce = /* @__PURE__ */ __name((reason2) => {
@@ -37990,7 +38069,7 @@ async function awaitProjectInstructionCallback(signal, start) {
37990
38069
  return;
37991
38070
  settled = true;
37992
38071
  cleanup();
37993
- resolve27(value);
38072
+ resolve28(value);
37994
38073
  }, "resolveOnce");
37995
38074
  const onAbort = /* @__PURE__ */ __name(() => rejectOnce(signal.reason), "onAbort");
37996
38075
  signal.addEventListener("abort", onAbort, { once: true });
@@ -38424,8 +38503,8 @@ async function* runToolReview(ctx, response, iterationNum) {
38424
38503
  }
38425
38504
  const wakeup = /* @__PURE__ */ __name(() => {
38426
38505
  let notify;
38427
- const promise = new Promise((resolve27) => {
38428
- notify = resolve27;
38506
+ const promise = new Promise((resolve28) => {
38507
+ notify = resolve28;
38429
38508
  });
38430
38509
  return { promise, notify };
38431
38510
  }, "wakeup");
@@ -42992,7 +43071,7 @@ async function awaitStoreRead(signal, start) {
42992
43071
  if (!signal)
42993
43072
  return await start();
42994
43073
  signal.throwIfAborted();
42995
- return new Promise((resolve27, reject2) => {
43074
+ return new Promise((resolve28, reject2) => {
42996
43075
  let settled = false;
42997
43076
  const cleanup = /* @__PURE__ */ __name(() => signal.removeEventListener("abort", onAbort), "cleanup");
42998
43077
  const rejectOnce = /* @__PURE__ */ __name((reason2) => {
@@ -43007,7 +43086,7 @@ async function awaitStoreRead(signal, start) {
43007
43086
  return;
43008
43087
  settled = true;
43009
43088
  cleanup();
43010
- resolve27(value);
43089
+ resolve28(value);
43011
43090
  }, "resolveOnce");
43012
43091
  const onAbort = /* @__PURE__ */ __name(() => rejectOnce(signal.reason), "onAbort");
43013
43092
  signal.addEventListener("abort", onAbort, { once: true });
@@ -43848,8 +43927,8 @@ var ProbeRegistry = class {
43848
43927
  var probe = new ProbeRegistry();
43849
43928
 
43850
43929
  // ../sdk/dist/store/evidence/disk.js
43851
- import { lstat as lstat3 } from "node:fs/promises";
43852
- import { resolve as resolve7 } from "node:path";
43930
+ import { lstat as lstat4 } from "node:fs/promises";
43931
+ import { resolve as resolve8 } from "node:path";
43853
43932
 
43854
43933
  // ../sdk/dist/store/evidence/index-page.js
43855
43934
  import { createHash as createHash15, createHmac, timingSafeEqual } from "node:crypto";
@@ -44210,7 +44289,7 @@ function excludesSuccessfulTool(entry, names) {
44210
44289
  __name(excludesSuccessfulTool, "excludesSuccessfulTool");
44211
44290
 
44212
44291
  // ../sdk/dist/store/evidence/source-text.js
44213
- import { lstat as lstat2 } from "node:fs/promises";
44292
+ import { lstat as lstat3 } from "node:fs/promises";
44214
44293
  import { join as join14 } from "node:path";
44215
44294
 
44216
44295
  // ../sdk/dist/utils/evidence-time.js
@@ -44334,7 +44413,7 @@ async function sourceText(pointer2, sessionDir, budget, { event, parts }) {
44334
44413
  throw new Error("Retained output bytes changed.");
44335
44414
  pieces.push(bytes);
44336
44415
  }
44337
- if (stamp2(before) !== stamp2(await file.stat()) || stamp2(before) !== stamp2(await lstat2(path2)))
44416
+ if (stamp2(before) !== stamp2(await file.stat()) || stamp2(before) !== stamp2(await lstat3(path2)))
44338
44417
  throw new Error("Retained output changed during read.");
44339
44418
  const all = Buffer.concat(pieces);
44340
44419
  const ownedStart = (chunk - first) * EVIDENCE_CHUNK_BYTES;
@@ -44362,15 +44441,33 @@ async function sourceText(pointer2, sessionDir, budget, { event, parts }) {
44362
44441
  };
44363
44442
  }
44364
44443
  __name(sourceText, "sourceText");
44444
+ var SessionEvidenceOffsetError = class extends Error {
44445
+ static {
44446
+ __name(this, "SessionEvidenceOffsetError");
44447
+ }
44448
+ code;
44449
+ totalBytes;
44450
+ scannedBytes;
44451
+ constructor(code, message, totalBytes, scannedBytes) {
44452
+ super(message);
44453
+ this.code = code;
44454
+ this.totalBytes = totalBytes;
44455
+ this.scannedBytes = scannedBytes;
44456
+ this.name = "SessionEvidenceOffsetError";
44457
+ }
44458
+ };
44365
44459
  async function readTextPage(source, scope, offset, budget) {
44366
44460
  const entry = source.entry;
44367
44461
  if (offset > source.bytes)
44368
- throw new Error("Offset exceeds retained text.");
44462
+ throw new SessionEvidenceOffsetError("past_end", "Offset exceeds retained text.", source.bytes, budget.bytes);
44369
44463
  const chunk = entry.spill ? Math.min(Math.floor(offset / EVIDENCE_CHUNK_BYTES), source.chunks - 1) : 0;
44370
44464
  const window2 = await source.window(chunk);
44465
+ const splits = /* @__PURE__ */ __name(() => new SessionEvidenceOffsetError("inside_character", "Offset splits a UTF-8 character.", source.bytes, budget.bytes), "splits");
44371
44466
  if (offset < window2.offset)
44372
- throw new Error("Offset splits a UTF-8 character.");
44467
+ throw splits();
44373
44468
  const bytes = window2.bytes.subarray(offset - window2.offset);
44469
+ if (bytes.length && ((bytes[0] ?? 0) & 192) === 128)
44470
+ throw splits();
44374
44471
  let text9 = decode(utf8Page(bytes, 24e3));
44375
44472
  if (text9.length > 6e3) {
44376
44473
  let end = 6e3;
@@ -44526,7 +44623,7 @@ function createSource(options, mode, anchor) {
44526
44623
  const consistency = external_exports.enum(["closed", "snapshot"]).parse(options.consistency ?? "closed");
44527
44624
  const maxReadBytes = external_exports.number().int().min(1024 * 1024).max(PAGE_BYTES).parse(options.maxReadBytes ?? PAGE_BYTES);
44528
44625
  const scope = Object.freeze(scopeSchema.parse(options.scope));
44529
- const logPath = resolve7(options.logPath);
44626
+ const logPath = resolve8(options.logPath);
44530
44627
  if (!logPath.endsWith(".jsonl"))
44531
44628
  throw new Error("A session log path ends in .jsonl.");
44532
44629
  const sessionDir = logPath.slice(0, -".jsonl".length);
@@ -44556,14 +44653,14 @@ function createSource(options, mode, anchor) {
44556
44653
  throw new Error("Evidence scope has an active turn; it is not closed.");
44557
44654
  }
44558
44655
  const anchorKey = anchor ? await verifyAnchor(handle, anchor) : void 0;
44559
- const sourceKey = digest2(`session-v1:${consistency}:${mode}:${scopeKey}:${anchorKey ?? stamp2(before)}`);
44656
+ const sourceKey = digest2(`session-v1:${consistency}:${mode}:${scopeKey}:${fileIdentity(before)}`);
44560
44657
  const seal = evidenceSeal(state.first, sourceKey);
44561
44658
  const value = await action(handle, size, seal, sourceKey, budget, !state.closed);
44562
44659
  signal?.throwIfAborted();
44563
44660
  if (anchor) {
44564
44661
  if (await verifyAnchor(handle, anchor) !== anchorKey)
44565
44662
  throw new Error("Evidence source changed during retrieval.");
44566
- } else if (stamp2(before) !== stamp2(await handle.stat()) || stamp2(before) !== stamp2(await lstat3(logPath))) {
44663
+ } else if (stamp2(before) !== stamp2(await handle.stat()) || stamp2(before) !== stamp2(await lstat4(logPath))) {
44567
44664
  throw new Error("Evidence source changed during retrieval.");
44568
44665
  }
44569
44666
  return value;
@@ -44761,6 +44858,10 @@ function createSource(options, mode, anchor) {
44761
44858
  });
44762
44859
  }
44763
44860
  __name(createSource, "createSource");
44861
+ function fileIdentity(stats) {
44862
+ return Number(stats.ino) === 0 ? `${stats.dev}:0:${stats.birthtimeMs}` : `${stats.dev}:${stats.ino}`;
44863
+ }
44864
+ __name(fileIdentity, "fileIdentity");
44764
44865
  async function verifyAnchor(handle, anchor) {
44765
44866
  const bytes = await readBytes(handle, anchor.offset, anchor.length, {
44766
44867
  bytes: 0,
@@ -44811,8 +44912,8 @@ var EventTranslator = class {
44811
44912
  async withLogLock(operation) {
44812
44913
  const previous = this.appendChain;
44813
44914
  let release;
44814
- this.appendChain = new Promise((resolve27) => {
44815
- release = resolve27;
44915
+ this.appendChain = new Promise((resolve28) => {
44916
+ release = resolve28;
44816
44917
  });
44817
44918
  try {
44818
44919
  await previous;
@@ -45207,11 +45308,11 @@ async function teardownSandbox(sandbox, timeoutMs) {
45207
45308
  return await operation;
45208
45309
  let timer;
45209
45310
  let timedOut;
45210
- const deadline = new Promise((resolve27) => {
45311
+ const deadline = new Promise((resolve28) => {
45211
45312
  timer = setTimeout(() => {
45212
45313
  timedOut = teardownTimeoutError(timeoutMs);
45213
45314
  controller.abort(timedOut);
45214
- resolve27({ kind: "timed_out", error: timedOut });
45315
+ resolve28({ kind: "timed_out", error: timedOut });
45215
45316
  }, timeoutMs);
45216
45317
  });
45217
45318
  try {
@@ -45239,20 +45340,20 @@ async function acquireSandbox(options) {
45239
45340
  let timeoutError2;
45240
45341
  let timer;
45241
45342
  let onAbort;
45242
- const aborted = new Promise((resolve27) => {
45343
+ const aborted = new Promise((resolve28) => {
45243
45344
  onAbort = /* @__PURE__ */ __name(() => {
45244
45345
  operationController.abort(runSignal.reason);
45245
- resolve27({ kind: "cancelled" });
45346
+ resolve28({ kind: "cancelled" });
45246
45347
  }, "onAbort");
45247
45348
  runSignal.addEventListener("abort", onAbort, { once: true });
45248
45349
  });
45249
- const timedOut = new Promise((resolve27) => {
45350
+ const timedOut = new Promise((resolve28) => {
45250
45351
  if (options.timeoutMs === Number.POSITIVE_INFINITY)
45251
45352
  return;
45252
45353
  timer = setTimeout(() => {
45253
45354
  timeoutError2 = acquisitionTimeoutError(options.timeoutMs);
45254
45355
  operationController.abort(timeoutError2);
45255
- resolve27({ kind: "timed_out", error: timeoutError2 });
45356
+ resolve28({ kind: "timed_out", error: timeoutError2 });
45256
45357
  }, options.timeoutMs);
45257
45358
  });
45258
45359
  if (runSignal.aborted) {
@@ -45301,8 +45402,8 @@ async function acquireSandbox(options) {
45301
45402
  __name(acquireSandbox, "acquireSandbox");
45302
45403
 
45303
45404
  // ../sdk/dist/runtime/query/session-storage.js
45304
- import { readdir as readdir4, realpath as realpath4 } from "node:fs/promises";
45305
- import { basename as basename6, dirname as dirname12, join as join15, resolve as resolve8 } from "node:path";
45405
+ import { readdir as readdir4, realpath as realpath5 } from "node:fs/promises";
45406
+ import { basename as basename6, dirname as dirname13, join as join15, resolve as resolve9 } from "node:path";
45306
45407
 
45307
45408
  // ../sdk/dist/store/budget/ledger.js
45308
45409
  var SESSION_TOKEN_BUDGET_VERSION = 2;
@@ -45992,7 +46093,7 @@ var SessionTokenBudget = class _SessionTokenBudget {
45992
46093
 
45993
46094
  // ../sdk/dist/store/budget/disk.js
45994
46095
  import { mkdir as mkdir10, readFile as readFile10, rename as rename4, unlink as unlink8, writeFile as writeFile4 } from "node:fs/promises";
45995
- import { dirname as dirname11 } from "node:path";
46096
+ import { dirname as dirname12 } from "node:path";
45996
46097
  var DiskSessionTokenBudgetStore = class {
45997
46098
  static {
45998
46099
  __name(this, "DiskSessionTokenBudgetStore");
@@ -46020,7 +46121,7 @@ var DiskSessionTokenBudgetStore = class {
46020
46121
  const existing = await this.#read(path2, checkedScope);
46021
46122
  if (existing)
46022
46123
  assertSameRoot(existing, checked2);
46023
- await mkdir10(dirname11(path2), { recursive: true, mode: 448 });
46124
+ await mkdir10(dirname12(path2), { recursive: true, mode: 448 });
46024
46125
  const temporary = temporaryPathFor(path2);
46025
46126
  try {
46026
46127
  await writeFile4(temporary, `${JSON.stringify(checked2)}
@@ -46196,15 +46297,15 @@ async function placeInLayout(paths2, log) {
46196
46297
  }
46197
46298
  __name(placeInLayout, "placeInLayout");
46198
46299
  async function canonicalPath(path2) {
46199
- let existing = resolve8(path2);
46300
+ let existing = resolve9(path2);
46200
46301
  let remainder = "";
46201
46302
  for (; ; ) {
46202
- const found = await realpath4(existing).catch(() => void 0);
46303
+ const found = await realpath5(existing).catch(() => void 0);
46203
46304
  if (found !== void 0)
46204
46305
  return remainder ? join15(found, remainder) : found;
46205
- const parent = dirname12(existing);
46306
+ const parent = dirname13(existing);
46206
46307
  if (parent === existing)
46207
- return resolve8(path2);
46308
+ return resolve9(path2);
46208
46309
  remainder = remainder ? join15(basename6(existing), remainder) : basename6(existing);
46209
46310
  existing = parent;
46210
46311
  }
@@ -46433,8 +46534,8 @@ var ToolCallBudget = class {
46433
46534
  signal.throwIfAborted();
46434
46535
  const previous = this.chain;
46435
46536
  let release;
46436
- this.chain = new Promise((resolve27) => {
46437
- release = resolve27;
46537
+ this.chain = new Promise((resolve28) => {
46538
+ release = resolve28;
46438
46539
  });
46439
46540
  try {
46440
46541
  await previous;
@@ -46509,8 +46610,8 @@ async function resolveProviderContextWindow(provider, model, signal, timeoutMs,
46509
46610
  const resolverSignal = signal ? AbortSignal.any([signal, deadline.signal]) : deadline.signal;
46510
46611
  const interrupted = /* @__PURE__ */ Symbol("provider-context-window-interrupted");
46511
46612
  let onAbort;
46512
- const interruption = new Promise((resolve27) => {
46513
- onAbort = /* @__PURE__ */ __name(() => resolve27(interrupted), "onAbort");
46613
+ const interruption = new Promise((resolve28) => {
46614
+ onAbort = /* @__PURE__ */ __name(() => resolve28(interrupted), "onAbort");
46514
46615
  resolverSignal.addEventListener("abort", onAbort, { once: true });
46515
46616
  });
46516
46617
  const deadlineMs = timeoutMs === 0 ? 5e3 : Math.min(Math.max(0, timeoutMs), 2147483647);
@@ -49006,6 +49107,14 @@ var ToolExecutor = class {
49006
49107
  static {
49007
49108
  __name(this, "ToolExecutor");
49008
49109
  }
49110
+ /** The recovery routes this turn actually has, so a pointer never names a missing tool. */
49111
+ recoveryRoutes() {
49112
+ const tools = this.config.tools;
49113
+ return {
49114
+ read: tools.get("read") !== void 0,
49115
+ conversation: tools.get("search_conversation") !== void 0 && tools.get("read_conversation") !== void 0
49116
+ };
49117
+ }
49009
49118
  outputDirectory() {
49010
49119
  return typeof this.config.toolOutputDir === "function" ? this.config.toolOutputDir() : this.config.toolOutputDir;
49011
49120
  }
@@ -49349,7 +49458,8 @@ var ToolExecutor = class {
49349
49458
  if (this.config.outsideRootAccess === "review" && !sandboxed && tool.pathArgument !== void 0) {
49350
49459
  const value = input[tool.pathArgument];
49351
49460
  if (typeof value === "string") {
49352
- const outside = await pathOutsideRoots(toolRoots(this.config), value);
49461
+ const retained = tool.name === "read" && await resolveRetainedOutput(this.outputDirectory(), value);
49462
+ const outside = retained ? void 0 : await pathOutsideRoots(toolRoots(this.config), value);
49353
49463
  if (outside !== void 0)
49354
49464
  outsidePaths = [outside];
49355
49465
  }
@@ -49662,6 +49772,7 @@ var ToolExecutor = class {
49662
49772
  })), {
49663
49773
  maxChars: maxChars2,
49664
49774
  spillDir: this.outputDirectory(),
49775
+ recoveryRoutes: this.recoveryRoutes(),
49665
49776
  onError: /* @__PURE__ */ __name((message) => this.log.warn("Failed to retain a tool output replaced for the message budget", {
49666
49777
  [NAMZU.TURN_ID]: this.config.turnId,
49667
49778
  "exception.message": message
@@ -49866,6 +49977,7 @@ var ToolExecutor = class {
49866
49977
  maxChars: this.config.maxToolOutputChars ?? DEFAULT_MAX_TOOL_OUTPUT_CHARS,
49867
49978
  retainedPreviewChars: this.config.retainedToolPreviewChars,
49868
49979
  spillDir: this.outputDirectory(),
49980
+ recoveryRoutes: this.recoveryRoutes(),
49869
49981
  onError: /* @__PURE__ */ __name((message) => this.log.warn("Failed to spill oversized nested tool output", {
49870
49982
  [NAMZU.TURN_ID]: this.config.turnId,
49871
49983
  [GENAI.TOOL_NAME]: name2,
@@ -49942,6 +50054,7 @@ var ToolExecutor = class {
49942
50054
  turnId: this.config.turnId,
49943
50055
  workingDirectory: this.config.workingDirectory,
49944
50056
  ...this.config.additionalDirectories?.length ? { additionalDirectories: this.config.additionalDirectories } : {},
50057
+ ...this.outputDirectory() ? { retainedOutputDirectory: this.outputDirectory() } : {},
49945
50058
  abortSignal: this.config.abortSignal,
49946
50059
  env: this.config.env,
49947
50060
  log: /* @__PURE__ */ __name((level, message) => this.log[level](message), "log"),
@@ -50207,6 +50320,7 @@ var ToolExecutor = class {
50207
50320
  maxChars: maxToolOutputChars,
50208
50321
  retainedPreviewChars: this.config.retainedToolPreviewChars,
50209
50322
  spillDir: this.outputDirectory(),
50323
+ recoveryRoutes: this.recoveryRoutes(),
50210
50324
  onError: /* @__PURE__ */ __name((message) => this.log.warn("Failed to retain original tool output", {
50211
50325
  [NAMZU.TURN_ID]: this.config.turnId,
50212
50326
  [GENAI.TOOL_NAME]: toolName,
@@ -50371,21 +50485,21 @@ ${note}`;
50371
50485
  let invocationOpen = true;
50372
50486
  const nestedDispatches = /* @__PURE__ */ new Set();
50373
50487
  try {
50374
- const expired = Number.isFinite(timeoutMs) && timeoutMs > 0 ? new Promise((resolve27) => {
50488
+ const expired = Number.isFinite(timeoutMs) && timeoutMs > 0 ? new Promise((resolve28) => {
50375
50489
  timer = setTimeout(() => {
50376
50490
  timedOut = true;
50377
50491
  controller.abort(new Error(`Tool "${toolName}" exceeded ${timeoutMs}ms`));
50378
- resolve27("timeout");
50492
+ resolve28("timeout");
50379
50493
  }, timeoutMs);
50380
50494
  }) : void 0;
50381
- const aborted = new Promise((resolve27) => {
50495
+ const aborted = new Promise((resolve28) => {
50382
50496
  if (controller.signal.aborted && !timedOut) {
50383
- resolve27("aborted");
50497
+ resolve28("aborted");
50384
50498
  return;
50385
50499
  }
50386
50500
  controller.signal.addEventListener("abort", () => {
50387
50501
  if (!timedOut)
50388
- resolve27("aborted");
50502
+ resolve28("aborted");
50389
50503
  }, { once: true });
50390
50504
  });
50391
50505
  const inheritedDispatch = toolContext.dispatchTool;
@@ -50872,6 +50986,7 @@ ${note}`;
50872
50986
  // A tool may return different host and model text. They must
50873
50987
  // never compete for the same exclusive spill filename.
50874
50988
  spillDir: this.outputDirectory() ? join16(this.outputDirectory(), "content") : void 0,
50989
+ recoveryRoutes: this.recoveryRoutes(),
50875
50990
  onError: /* @__PURE__ */ __name((message) => this.log.warn("Failed to spill oversized model tool content", {
50876
50991
  [NAMZU.TURN_ID]: this.config.turnId,
50877
50992
  [GENAI.TOOL_NAME]: toolName,
@@ -50926,8 +51041,8 @@ var Semaphore = class {
50926
51041
  this.available--;
50927
51042
  return Promise.resolve();
50928
51043
  }
50929
- return new Promise((resolve27) => {
50930
- this.waiters.push(resolve27);
51044
+ return new Promise((resolve28) => {
51045
+ this.waiters.push(resolve28);
50931
51046
  });
50932
51047
  }
50933
51048
  release() {
@@ -53316,7 +53431,7 @@ var ScanSessionIndex = class _ScanSessionIndex extends SessionIndexBase {
53316
53431
  // ../sdk/dist/store/session-index/sqlite.js
53317
53432
  import { mkdir as mkdir11, readdir as readdir6, rename as rename5, rm, stat as stat6 } from "node:fs/promises";
53318
53433
  import { createRequire } from "node:module";
53319
- import { basename as basename7, dirname as dirname13, join as join18 } from "node:path";
53434
+ import { basename as basename7, dirname as dirname14, join as join18 } from "node:path";
53320
53435
  var SESSION_INDEX_VERSION = 1;
53321
53436
  var sqliteModule;
53322
53437
  function loadSqlite() {
@@ -53507,7 +53622,7 @@ async function modifiedAt(path2) {
53507
53622
  }
53508
53623
  __name(modifiedAt, "modifiedAt");
53509
53624
  async function sweepAbandonedRebuilds(path2) {
53510
- const directory = dirname13(path2);
53625
+ const directory = dirname14(path2);
53511
53626
  const prefix = `${basename7(path2)}.tmp-`;
53512
53627
  let names;
53513
53628
  try {
@@ -53638,7 +53753,7 @@ var SqliteSessionIndex = class _SqliteSessionIndex extends SessionIndexBase {
53638
53753
  /** See {@link rebuildSqliteSessionIndex}. */
53639
53754
  static async rebuild(options) {
53640
53755
  const { DatabaseSync } = requireSqlite();
53641
- await mkdir11(dirname13(options.path), { recursive: true });
53756
+ await mkdir11(dirname14(options.path), { recursive: true });
53642
53757
  await sweepAbandonedRebuilds(options.path);
53643
53758
  const temporary = `${options.path}.tmp-${process.pid}-${uuidv7()}`;
53644
53759
  try {
@@ -53889,8 +54004,8 @@ function preservedSystemFloor(systemMessages) {
53889
54004
  return systemMessages.filter((m) => !isCompactionMessage(typeof m.content === "string" ? m.content : null) || m.retain === true);
53890
54005
  }
53891
54006
  __name(preservedSystemFloor, "preservedSystemFloor");
53892
- function splice(preservedSystem, summaryBody, retainedOlder, recentMessages) {
53893
- const summary2 = { ...buildCompactionMessage(summaryBody), retain: true };
54007
+ function splice(preservedSystem, summaryBody, retainedOlder, recentMessages, recoveryNote) {
54008
+ const summary2 = { ...buildCompactionMessage(summaryBody, recoveryNote), retain: true };
53894
54009
  return { messages: [...preservedSystem, summary2, ...retainedOlder, ...recentMessages], summary: summary2 };
53895
54010
  }
53896
54011
  __name(splice, "splice");
@@ -53950,7 +54065,7 @@ async function compactNow(input) {
53950
54065
  streamIdleTimeoutMs: input.streamIdleTimeoutMs,
53951
54066
  instructions: input.instructions
53952
54067
  });
53953
- const { messages, summary: summary2 } = splice(preservedSystem, body, retainedOlder, plan.recentMessages);
54068
+ const { messages, summary: summary2 } = splice(preservedSystem, body, retainedOlder, plan.recentMessages, input.recoveryNote);
53954
54069
  return publishManualCompaction(input, {
53955
54070
  messages,
53956
54071
  shed: input.messages.length - messages.length,
@@ -54607,7 +54722,7 @@ __name(createMemoryRecallStep, "createMemoryRecallStep");
54607
54722
  // ../sdk/dist/execution/local.js
54608
54723
  import { spawn } from "node:child_process";
54609
54724
  import { existsSync as existsSync3 } from "node:fs";
54610
- import { resolve as resolve9 } from "node:path";
54725
+ import { resolve as resolve10 } from "node:path";
54611
54726
 
54612
54727
  // ../sdk/dist/execution/base.js
54613
54728
  var InitializationSupersededError = class extends Error {
@@ -54898,7 +55013,7 @@ var LocalExecutionContext = class extends BaseExecutionContext {
54898
55013
  constructor(options) {
54899
55014
  super(options.log);
54900
55015
  this.id = options.id;
54901
- this.cwd = resolve9(options.cwd);
55016
+ this.cwd = resolve10(options.cwd);
54902
55017
  this.fsAccess = options.fsAccess ?? true;
54903
55018
  this.envVars = options.envVars ?? {};
54904
55019
  this.capabilities = options.capabilities ?? ["filesystem", "process", "shell"];
@@ -54934,7 +55049,7 @@ var LocalExecutionContext = class extends BaseExecutionContext {
54934
55049
  return this.cwd;
54935
55050
  }
54936
55051
  setCwd(newCwd) {
54937
- const resolved2 = resolve9(newCwd);
55052
+ const resolved2 = resolve10(newCwd);
54938
55053
  if (!existsSync3(resolved2)) {
54939
55054
  throw new Error(`Working directory does not exist: ${resolved2}`);
54940
55055
  }
@@ -54944,7 +55059,7 @@ var LocalExecutionContext = class extends BaseExecutionContext {
54944
55059
  return this.fsAccess;
54945
55060
  }
54946
55061
  resolvePath(relativePath) {
54947
- return resolve9(this.cwd, relativePath);
55062
+ return resolve10(this.cwd, relativePath);
54948
55063
  }
54949
55064
  getEnvVar(key5) {
54950
55065
  return this.envVars[key5] ?? process.env[key5];
@@ -54972,7 +55087,7 @@ var LocalExecutionContext = class extends BaseExecutionContext {
54972
55087
  durationMs: 0
54973
55088
  };
54974
55089
  }
54975
- const cwd = options?.cwd ? resolve9(this.cwd, options.cwd) : this.cwd;
55090
+ const cwd = options?.cwd ? resolve10(this.cwd, options.cwd) : this.cwd;
54976
55091
  const env = { ...process.env, ...this.envVars, ...options?.env };
54977
55092
  const timeoutMs = options?.timeoutMs ?? LOCAL_COMMAND_DEFAULT_TIMEOUT_MS;
54978
55093
  if (!Number.isInteger(timeoutMs) || timeoutMs < 0) {
@@ -55103,9 +55218,9 @@ var LocalExecutionContext = class extends BaseExecutionContext {
55103
55218
 
55104
55219
  // ../sdk/dist/turn/workspace-fingerprint.js
55105
55220
  import { createHash as createHash17 } from "node:crypto";
55106
- import { lstat as lstat4, readFile as readFile11, readlink } from "node:fs/promises";
55221
+ import { lstat as lstat5, readFile as readFile11, readlink } from "node:fs/promises";
55107
55222
  import { join as join20 } from "node:path";
55108
- var NODE_FS = { lstat: lstat4, readlink, readFile: readFile11 };
55223
+ var NODE_FS = { lstat: lstat5, readlink, readFile: readFile11 };
55109
55224
  var FINGERPRINT_MAX_BYTES = 4 * 1024 * 1024;
55110
55225
  var FINGERPRINT_TIMEOUT_MS = 2e4;
55111
55226
  async function untrackedEntry(cwd, rel, fs) {
@@ -56032,15 +56147,15 @@ var DiskTaskStore = class {
56032
56147
  break;
56033
56148
  await existing.catch(() => void 0);
56034
56149
  }
56035
- let resolve27;
56150
+ let resolve28;
56036
56151
  const lock = new Promise((r) => {
56037
- resolve27 = r;
56152
+ resolve28 = r;
56038
56153
  });
56039
56154
  this.locks.set(taskId, lock);
56040
56155
  try {
56041
56156
  return await fn();
56042
56157
  } finally {
56043
- resolve27?.();
56158
+ resolve28?.();
56044
56159
  if (this.locks.get(taskId) === lock) {
56045
56160
  this.locks.delete(taskId);
56046
56161
  }
@@ -56360,8 +56475,8 @@ var DiskTaskStore = class {
56360
56475
 
56361
56476
  // ../sdk/dist/store/memory/markdown.js
56362
56477
  import { createHash as createHash20 } from "node:crypto";
56363
- import { lstat as lstat6, mkdir as mkdir13, readFile as readFile14, readdir as readdir8, realpath as realpath5, rename as rename6, unlink as unlink11 } from "node:fs/promises";
56364
- import { dirname as dirname14, join as join24, resolve as resolve10 } from "node:path";
56478
+ import { lstat as lstat7, mkdir as mkdir13, readFile as readFile14, readdir as readdir8, realpath as realpath6, rename as rename6, unlink as unlink11 } from "node:fs/promises";
56479
+ import { dirname as dirname15, join as join24, resolve as resolve11 } from "node:path";
56365
56480
 
56366
56481
  // ../sdk/dist/store/memory/index-file.js
56367
56482
  var MEMORY_INDEX_MAX_LINES = 200;
@@ -56578,7 +56693,7 @@ __name(formatMemoryFile, "formatMemoryFile");
56578
56693
 
56579
56694
  // ../sdk/dist/store/memory/operation-lock.js
56580
56695
  import { randomUUID as randomUUID4 } from "node:crypto";
56581
- import { lstat as lstat5, open as open9, readFile as readFile13, unlink as unlink10 } from "node:fs/promises";
56696
+ import { lstat as lstat6, open as open9, readFile as readFile13, unlink as unlink10 } from "node:fs/promises";
56582
56697
  import { setTimeout as delay } from "node:timers/promises";
56583
56698
  var DEFAULT_MEMORY_LOCK_TIMEOUT_MS = 1e4;
56584
56699
  function validateMemoryLockTimeout(timeoutMs) {
@@ -56614,7 +56729,7 @@ async function acquireMemoryOperationLock(path2, timeoutMs) {
56614
56729
  } catch (error) {
56615
56730
  if (error.code !== "EEXIST")
56616
56731
  throw error;
56617
- const existing = await lstat5(path2).catch((statError) => {
56732
+ const existing = await lstat6(path2).catch((statError) => {
56618
56733
  if (statError.code === "ENOENT")
56619
56734
  return void 0;
56620
56735
  throw statError;
@@ -56641,7 +56756,7 @@ async function acquireMemoryOperationLock(path2, timeoutMs) {
56641
56756
  await handle.sync();
56642
56757
  } catch (error) {
56643
56758
  await handle.close();
56644
- const current = await lstat5(path2).catch(() => void 0);
56759
+ const current = await lstat6(path2).catch(() => void 0);
56645
56760
  if (current?.dev === identity.dev && current.ino === identity.ino) {
56646
56761
  await unlink10(path2).catch(() => void 0);
56647
56762
  }
@@ -56649,7 +56764,7 @@ async function acquireMemoryOperationLock(path2, timeoutMs) {
56649
56764
  }
56650
56765
  await handle.close();
56651
56766
  return async () => {
56652
- const current = await lstat5(path2);
56767
+ const current = await lstat6(path2);
56653
56768
  if (!current.isFile() || current.isSymbolicLink() || current.dev !== identity.dev || current.ino !== identity.ino || await readFile13(path2, "utf8") !== owner) {
56654
56769
  throw lockError(path2, "the lock owner changed before release", timeoutMs);
56655
56770
  }
@@ -56935,7 +57050,7 @@ var MarkdownMemoryStore = class {
56935
57050
  lockTimeoutMs;
56936
57051
  canonical;
56937
57052
  constructor(config) {
56938
- this.directory = resolve10(config.directory);
57053
+ this.directory = resolve11(config.directory);
56939
57054
  this.log = resolveLogger(config.logger).child({
56940
57055
  [SCOPE_ATTRIBUTE]: "store/memory/markdown"
56941
57056
  });
@@ -56950,14 +57065,14 @@ var MarkdownMemoryStore = class {
56950
57065
  if (this.canonical)
56951
57066
  return this.canonical;
56952
57067
  await mkdir13(this.directory, { recursive: true, mode: DIRECTORY_MODE });
56953
- this.canonical = await realpath5(this.directory);
57068
+ this.canonical = await realpath6(this.directory);
56954
57069
  return this.canonical;
56955
57070
  }
56956
57071
  memoryPath(dir, name2) {
56957
57072
  if (!isMemoryName(name2))
56958
57073
  invalidFile(join24(dir, `${name2}.md`), "name is not a memory name");
56959
- const path2 = resolve10(entryPath(dir, name2, ".md"));
56960
- if (dirname14(path2) !== dir)
57074
+ const path2 = resolve11(entryPath(dir, name2, ".md"));
57075
+ if (dirname15(path2) !== dir)
56961
57076
  invalidFile(path2, "resolved path escapes the memory directory");
56962
57077
  return path2;
56963
57078
  }
@@ -56973,7 +57088,7 @@ var MarkdownMemoryStore = class {
56973
57088
  if (!fileName2.endsWith(".md") || fileName2 === MEMORY_INDEX_FILE)
56974
57089
  continue;
56975
57090
  const path2 = join24(dir, fileName2);
56976
- const stat15 = await lstat6(path2).catch((error) => {
57091
+ const stat15 = await lstat7(path2).catch((error) => {
56977
57092
  if (error.code === "ENOENT")
56978
57093
  return void 0;
56979
57094
  throw error;
@@ -57036,7 +57151,7 @@ var MarkdownMemoryStore = class {
57036
57151
  }
57037
57152
  async setAside(path2) {
57038
57153
  let target = `${path2}${SUPERSEDED_SUFFIX}`;
57039
- const taken = /* @__PURE__ */ __name((candidate) => lstat6(candidate).then(() => true, () => false), "taken");
57154
+ const taken = /* @__PURE__ */ __name((candidate) => lstat7(candidate).then(() => true, () => false), "taken");
57040
57155
  for (let n = 2; await taken(target); n++)
57041
57156
  target = `${path2}${SUPERSEDED_SUFFIX}-${n}`;
57042
57157
  await rename6(path2, target);
@@ -57329,8 +57444,8 @@ ${text9 ? `${text9}
57329
57444
  };
57330
57445
 
57331
57446
  // ../sdk/dist/store/memory/disk.js
57332
- import { mkdir as mkdir14, realpath as realpath6, unlink as unlink12 } from "node:fs/promises";
57333
- import { dirname as dirname15, join as join25, resolve as resolve11 } from "node:path";
57447
+ import { mkdir as mkdir14, realpath as realpath7, unlink as unlink12 } from "node:fs/promises";
57448
+ import { dirname as dirname16, join as join25, resolve as resolve12 } from "node:path";
57334
57449
  var SCHEMA5 = defineSchema({ kind: "memory-store", current: 1, migrations: {} });
57335
57450
  function invalidIndex(reason2, details = {}) {
57336
57451
  throw new NamzuError({
@@ -57446,7 +57561,7 @@ var DiskMemoryStore = class {
57446
57561
  records = new DiskRecordStore(SCHEMA5);
57447
57562
  indexRecords = new DiskRecordStore(SCHEMA5);
57448
57563
  constructor(config) {
57449
- this.baseDir = config.directory === void 0 ? join25(config.baseDir, "memory") : resolve11(config.directory);
57564
+ this.baseDir = config.directory === void 0 ? join25(config.baseDir, "memory") : resolve12(config.directory);
57450
57565
  this.log = resolveLogger(config.logger).child({ [SCOPE_ATTRIBUTE]: "store/memory/disk" });
57451
57566
  this.lockTimeoutMs = config.lockTimeoutMs ?? DEFAULT_MEMORY_LOCK_TIMEOUT_MS;
57452
57567
  validateMemoryLockTimeout(this.lockTimeoutMs);
@@ -57459,10 +57574,10 @@ var DiskMemoryStore = class {
57459
57574
  return this.location;
57460
57575
  await mkdir14(this.contentDir, { recursive: true });
57461
57576
  const [canonicalBaseDir, canonicalContentDir] = await Promise.all([
57462
- realpath6(this.baseDir),
57463
- realpath6(this.contentDir)
57577
+ realpath7(this.baseDir),
57578
+ realpath7(this.contentDir)
57464
57579
  ]);
57465
- if (dirname15(canonicalContentDir) !== canonicalBaseDir) {
57580
+ if (dirname16(canonicalContentDir) !== canonicalBaseDir) {
57466
57581
  invalidIndex("the content directory resolves outside the memory store");
57467
57582
  }
57468
57583
  this.location = {
@@ -57473,8 +57588,8 @@ var DiskMemoryStore = class {
57473
57588
  }
57474
57589
  contentPath(location, id3) {
57475
57590
  assertStorageMemoryId(id3, (reason2) => invalidContent(id3, reason2, { field: "id" }));
57476
- const path2 = resolve11(entryPath(location.contentDir, id3, ".json"));
57477
- if (dirname15(path2) !== location.contentDir) {
57591
+ const path2 = resolve12(entryPath(location.contentDir, id3, ".json"));
57592
+ if (dirname16(path2) !== location.contentDir) {
57478
57593
  invalidContent(id3, "resolved path escapes the content directory", { field: "id" });
57479
57594
  }
57480
57595
  return path2;
@@ -57498,7 +57613,7 @@ var DiskMemoryStore = class {
57498
57613
  }
57499
57614
  async withAuthoritativeIndex(operation) {
57500
57615
  const location = await this.storageLocation();
57501
- const release = await acquireMemoryOperationLock(join25(dirname15(location.indexPath), "operation.lock"), this.lockTimeoutMs);
57616
+ const release = await acquireMemoryOperationLock(join25(dirname16(location.indexPath), "operation.lock"), this.lockTimeoutMs);
57502
57617
  try {
57503
57618
  await this.reloadIndex(location);
57504
57619
  return await operation(location);
@@ -60479,7 +60594,7 @@ var MockLLMProvider = class {
60479
60594
  async delay() {
60480
60595
  if (this.responseDelayMs <= 0)
60481
60596
  return;
60482
- await new Promise((resolve27) => setTimeout(resolve27, this.responseDelayMs));
60597
+ await new Promise((resolve28) => setTimeout(resolve28, this.responseDelayMs));
60483
60598
  }
60484
60599
  /**
60485
60600
  * The turn to play. A script shorter than the turn repeats its last
@@ -60857,7 +60972,7 @@ var StdioTransport = class {
60857
60972
  this.exitPending = false;
60858
60973
  return;
60859
60974
  }
60860
- await new Promise((resolve27) => {
60975
+ await new Promise((resolve28) => {
60861
60976
  let settled = false;
60862
60977
  const finish2 = /* @__PURE__ */ __name(() => {
60863
60978
  if (settled)
@@ -60865,7 +60980,7 @@ var StdioTransport = class {
60865
60980
  settled = true;
60866
60981
  clearTimeout(escalate);
60867
60982
  clearTimeout(giveUp);
60868
- resolve27();
60983
+ resolve28();
60869
60984
  }, "finish");
60870
60985
  child.once("close", finish2);
60871
60986
  child.once("error", finish2);
@@ -62140,7 +62255,7 @@ async function resolveMcpEra(input) {
62140
62255
  __name(resolveMcpEra, "resolveMcpEra");
62141
62256
 
62142
62257
  // ../sdk/dist/version.js
62143
- var VERSION2 = "53.1.0";
62258
+ var VERSION2 = "53.2.2";
62144
62259
 
62145
62260
  // ../sdk/dist/connector/mcp/client.js
62146
62261
  var MAX_LIST_PAGES = 100;
@@ -62464,7 +62579,7 @@ var MCPClient = class {
62464
62579
  capabilities: this.config.capabilities ?? {}
62465
62580
  });
62466
62581
  const controller = new AbortController();
62467
- return new Promise((resolve27) => {
62582
+ return new Promise((resolve28) => {
62468
62583
  let settled = false;
62469
62584
  const finish2 = /* @__PURE__ */ __name((answer) => {
62470
62585
  if (settled)
@@ -62473,7 +62588,7 @@ var MCPClient = class {
62473
62588
  clearTimeout(timer);
62474
62589
  if (this.pendingRequests.get(id3) === entry)
62475
62590
  this.pendingRequests.delete(id3);
62476
- resolve27(answer);
62591
+ resolve28(answer);
62477
62592
  }, "finish");
62478
62593
  const entry = {
62479
62594
  resolve: /* @__PURE__ */ __name((value) => finish2({ kind: "result", result: value }), "resolve"),
@@ -63047,8 +63162,8 @@ var MCPClient = class {
63047
63162
  let settled = false;
63048
63163
  let resolvePublic;
63049
63164
  let rejectPublic;
63050
- const result = new Promise((resolve27, reject2) => {
63051
- resolvePublic = resolve27;
63165
+ const result = new Promise((resolve28, reject2) => {
63166
+ resolvePublic = resolve28;
63052
63167
  rejectPublic = reject2;
63053
63168
  });
63054
63169
  const entry = {
@@ -63892,14 +64007,14 @@ var MCPReconnectSupervisor = class {
63892
64007
  });
63893
64008
  }
63894
64009
  wait(ms) {
63895
- return new Promise((resolve27) => {
64010
+ return new Promise((resolve28) => {
63896
64011
  const finish2 = /* @__PURE__ */ __name(() => {
63897
64012
  if (this.timer)
63898
64013
  clearTimeout(this.timer);
63899
64014
  this.timer = void 0;
63900
64015
  if (this.finishWait === finish2)
63901
64016
  this.finishWait = void 0;
63902
- resolve27();
64017
+ resolve28();
63903
64018
  }, "finish");
63904
64019
  this.finishWait = finish2;
63905
64020
  this.timer = setTimeout(finish2, ms);
@@ -64199,7 +64314,7 @@ async function mcpToolset(client, options = {}) {
64199
64314
  __name(mcpToolset, "mcpToolset");
64200
64315
 
64201
64316
  // ../sdk/dist/bridge/acp/server.js
64202
- import { isAbsolute as isAbsolute6 } from "node:path";
64317
+ import { isAbsolute as isAbsolute7 } from "node:path";
64203
64318
 
64204
64319
  // ../sdk/dist/constants/acp/index.js
64205
64320
  var ACP_PROTOCOL_VERSION = 1;
@@ -64530,7 +64645,7 @@ var ACPServer = class {
64530
64645
  request(method, params, signal) {
64531
64646
  this.requestSeq += 1;
64532
64647
  const id3 = `agent_${this.requestSeq}`;
64533
- return new Promise((resolve27, reject2) => {
64648
+ return new Promise((resolve28, reject2) => {
64534
64649
  const finish2 = /* @__PURE__ */ __name(() => {
64535
64650
  if (this.pending.get(id3) !== entry)
64536
64651
  return false;
@@ -64545,7 +64660,7 @@ var ACPServer = class {
64545
64660
  const entry = {
64546
64661
  resolve: /* @__PURE__ */ __name((value) => {
64547
64662
  if (finish2())
64548
- resolve27(value);
64663
+ resolve28(value);
64549
64664
  }, "resolve"),
64550
64665
  reject: /* @__PURE__ */ __name((error) => {
64551
64666
  if (finish2())
@@ -64692,7 +64807,7 @@ var ACPServer = class {
64692
64807
  }
64693
64808
  requireAbsoluteCwd(cwd) {
64694
64809
  const resolved2 = cwd ?? process.cwd();
64695
- if (!isAbsolute6(resolved2)) {
64810
+ if (!isAbsolute7(resolved2)) {
64696
64811
  throw new AcpError(ACP_ERROR_CODES.INVALID_PARAMS, `ACP session cwd must be an absolute path; received ${JSON.stringify(resolved2)}.`);
64697
64812
  }
64698
64813
  return resolved2;
@@ -66891,7 +67006,7 @@ __name(createResidentEvidenceRecallStep, "createResidentEvidenceRecallStep");
66891
67006
  // ../sdk/dist/pals/store.js
66892
67007
  import { randomUUID as randomUUID7 } from "node:crypto";
66893
67008
  import { chmodSync, closeSync, fsyncSync, linkSync, lstatSync as lstatSync3, mkdirSync as mkdirSync3, openSync, readFileSync, readdirSync, realpathSync as realpathSync3, unlinkSync, writeSync } from "node:fs";
66894
- import { dirname as dirname16, isAbsolute as isAbsolute7, join as join27, relative as relative3, resolve as resolve12, sep as sep6 } from "node:path";
67009
+ import { dirname as dirname17, isAbsolute as isAbsolute8, join as join27, relative as relative4, resolve as resolve13, sep as sep6 } from "node:path";
66895
67010
  var ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u;
66896
67011
  var REVISION_FILE = /^[1-9][0-9]*\.json$/u;
66897
67012
  var PalConflictError = class extends Error {
@@ -66912,7 +67027,7 @@ function palId(id3) {
66912
67027
  }
66913
67028
  __name(palId, "palId");
66914
67029
  function homePath(home) {
66915
- const path2 = resolve12(home);
67030
+ const path2 = resolve13(home);
66916
67031
  mkdirSync3(path2, { recursive: true, mode: 448 });
66917
67032
  const entry = lstatSync3(path2);
66918
67033
  if (!entry.isDirectory() || entry.isSymbolicLink())
@@ -66924,8 +67039,8 @@ function homePath(home) {
66924
67039
  }
66925
67040
  __name(homePath, "homePath");
66926
67041
  function contained(path2, root) {
66927
- const rel = relative3(root, path2);
66928
- return rel === "" || !isAbsolute7(rel) && rel !== ".." && !rel.startsWith(`..${sep6}`);
67042
+ const rel = relative4(root, path2);
67043
+ return rel === "" || !isAbsolute8(rel) && rel !== ".." && !rel.startsWith(`..${sep6}`);
66929
67044
  }
66930
67045
  __name(contained, "contained");
66931
67046
  function paths(home, workspaceRoot, id3) {
@@ -67159,7 +67274,7 @@ var DiskPalStore = class {
67159
67274
  }
67160
67275
  /** Exact validated host control directory; never an execution-computer claim. */
67161
67276
  atWorkspace(cwd) {
67162
- const lexical = resolve12(cwd);
67277
+ const lexical = resolve13(cwd);
67163
67278
  const canonical2 = realpathSync3(lexical);
67164
67279
  const lexicalReserved = contained(lexical, this.workspaceRoot);
67165
67280
  const canonicalReserved = contained(canonical2, this.workspaceRoot);
@@ -67167,7 +67282,7 @@ var DiskPalStore = class {
67167
67282
  return null;
67168
67283
  if (lexical !== canonical2)
67169
67284
  throw new Error("Pal workspace is a symlink alias.");
67170
- const rel = relative3(this.workspaceRoot, canonical2);
67285
+ const rel = relative4(this.workspaceRoot, canonical2);
67171
67286
  if (!ID.test(rel))
67172
67287
  throw new Error("Reserved Pal control directories cannot run ordinary host sessions. Open the exact Pal workspace.");
67173
67288
  const pal = this.get(rel);
@@ -67183,7 +67298,7 @@ function assertDirectory(path2) {
67183
67298
  }
67184
67299
  __name(assertDirectory, "assertDirectory");
67185
67300
  function publishExclusive(path2, value) {
67186
- const temporary = join27(dirname16(path2), `.pal-${randomUUID7()}.tmp`);
67301
+ const temporary = join27(dirname17(path2), `.pal-${randomUUID7()}.tmp`);
67187
67302
  const fd = openSync(temporary, "wx", 384);
67188
67303
  try {
67189
67304
  writeSync(fd, `${JSON.stringify(value)}
@@ -68676,10 +68791,10 @@ var ExternalHarnessSession = class {
68676
68791
  }
68677
68792
  }
68678
68793
  makeActive(turnId6, operationId, startedAt) {
68679
- let resolve27;
68794
+ let resolve28;
68680
68795
  let reject2;
68681
68796
  const done = new Promise((yes, no) => {
68682
- resolve27 = yes;
68797
+ resolve28 = yes;
68683
68798
  reject2 = no;
68684
68799
  });
68685
68800
  void done.catch(() => void 0);
@@ -68689,7 +68804,7 @@ var ExternalHarnessSession = class {
68689
68804
  startedAt,
68690
68805
  items: /* @__PURE__ */ new Map(),
68691
68806
  reviews: /* @__PURE__ */ new Map(),
68692
- resolve: resolve27,
68807
+ resolve: resolve28,
68693
68808
  reject: reject2,
68694
68809
  done
68695
68810
  };
@@ -69900,7 +70015,7 @@ ${line}`;
69900
70015
  stdout: true,
69901
70016
  stderr: true
69902
70017
  });
69903
- return await new Promise((resolve27) => {
70018
+ return await new Promise((resolve28) => {
69904
70019
  let settled = false;
69905
70020
  let terminal;
69906
70021
  const inFlight = /* @__PURE__ */ new Set();
@@ -69915,7 +70030,7 @@ ${line}`;
69915
70030
  clearTimeout(deadline);
69916
70031
  options.signal?.removeEventListener("abort", onAbort);
69917
70032
  void worker.terminate();
69918
- resolve27({ ...result, calls: [...calls] });
70033
+ resolve28({ ...result, calls: [...calls] });
69919
70034
  }, "finish");
69920
70035
  const finishTerminalWhenHostCallsSettle = /* @__PURE__ */ __name(() => {
69921
70036
  if (terminal && inFlight.size === 0)
@@ -71344,8 +71459,8 @@ ${body}`,
71344
71459
  let timer;
71345
71460
  await Promise.race([
71346
71461
  Promise.allSettled([...inFlight]),
71347
- new Promise((resolve27) => {
71348
- timer = setTimeout(resolve27, grace);
71462
+ new Promise((resolve28) => {
71463
+ timer = setTimeout(resolve28, grace);
71349
71464
  })
71350
71465
  ]);
71351
71466
  clearTimeout(timer);
@@ -72197,6 +72312,7 @@ var LocalTaskScheduler = class {
72197
72312
  {
72198
72313
  agentId: options.agentId,
72199
72314
  ...options.resumeSessionId ? { resumeSessionId: options.resumeSessionId } : {},
72315
+ ...options.continuationProfile ? { continuationProfile: options.continuationProfile } : {},
72200
72316
  beforeStart: options.beforeStart,
72201
72317
  ...options.workspace ? { workspace: options.workspace } : {},
72202
72318
  ...options.planId ? { planId: options.planId } : {},
@@ -72398,6 +72514,11 @@ var LocalTaskScheduler = class {
72398
72514
  async continueTask(taskId, message) {
72399
72515
  await this.agentManager.continueTask(taskId, message);
72400
72516
  }
72517
+ async restoreChild(options) {
72518
+ if (!this.agentManager.restoreChildConversation)
72519
+ return { status: "refused", reason: "no-layout" };
72520
+ return this.agentManager.restoreChildConversation(options, this.taskContext);
72521
+ }
72401
72522
  cancelTask(taskId, cause) {
72402
72523
  this.agentManager.cancel(taskId, cause);
72403
72524
  }
@@ -72695,9 +72816,9 @@ var PluginRegistry = class extends ManagedRegistry {
72695
72816
  };
72696
72817
 
72697
72818
  // ../sdk/dist/plugin/loader.js
72698
- import { lstat as lstat7, readFile as readFile16, readdir as readdir10, realpath as realpath7 } from "node:fs/promises";
72819
+ import { lstat as lstat8, readFile as readFile16, readdir as readdir10, realpath as realpath8 } from "node:fs/promises";
72699
72820
  import { homedir as homedir4, platform } from "node:os";
72700
- import { join as join30, resolve as resolve13 } from "node:path";
72821
+ import { join as join30, resolve as resolve14 } from "node:path";
72701
72822
 
72702
72823
  // ../sdk/dist/types/plugin/index.js
72703
72824
  var RENAMED_PLUGIN_HOOK_EVENTS = {
@@ -72763,7 +72884,7 @@ async function discoverPlugins(parentDir, log) {
72763
72884
  const logger = resolveLogger(log).child({ [SCOPE_ATTRIBUTE]: "plugin/loader" });
72764
72885
  const dirs = [];
72765
72886
  try {
72766
- const parent = await lstat7(parentDir);
72887
+ const parent = await lstat8(parentDir);
72767
72888
  if (parent.isSymbolicLink() || !parent.isDirectory()) {
72768
72889
  logger.warn("Refusing a non-regular plugins directory", {
72769
72890
  "namzu.plugin.parent_dir": parentDir
@@ -72775,7 +72896,7 @@ async function discoverPlugins(parentDir, log) {
72775
72896
  if (entry.startsWith(".") || entry.startsWith("_"))
72776
72897
  continue;
72777
72898
  const fullPath = join30(parentDir, entry);
72778
- const s = await lstat7(fullPath);
72899
+ const s = await lstat8(fullPath);
72779
72900
  if (s.isSymbolicLink()) {
72780
72901
  logger.warn("Refusing a symlinked plugin directory", { "namzu.plugin.path": fullPath });
72781
72902
  continue;
@@ -72784,7 +72905,7 @@ async function discoverPlugins(parentDir, log) {
72784
72905
  continue;
72785
72906
  const manifestPath = join30(fullPath, PLUGIN_MANIFEST_FILENAME);
72786
72907
  try {
72787
- const manifest = await lstat7(manifestPath);
72908
+ const manifest = await lstat8(manifestPath);
72788
72909
  if (manifest.isSymbolicLink() || !manifest.isFile()) {
72789
72910
  logger.warn("Refusing a non-regular plugin manifest", {
72790
72911
  "namzu.plugin.path": fullPath,
@@ -72803,12 +72924,12 @@ async function discoverPlugins(parentDir, log) {
72803
72924
  }
72804
72925
  __name(discoverPlugins, "discoverPlugins");
72805
72926
  async function loadPluginManifest(pluginDir, capabilities2 = {}) {
72806
- const root = await lstat7(pluginDir);
72927
+ const root = await lstat8(pluginDir);
72807
72928
  if (root.isSymbolicLink() || !root.isDirectory()) {
72808
72929
  throw new Error(`Plugin root must be a regular directory: ${pluginDir}`);
72809
72930
  }
72810
72931
  const manifestPath = join30(pluginDir, PLUGIN_MANIFEST_FILENAME);
72811
- const manifestEntry = await lstat7(manifestPath);
72932
+ const manifestEntry = await lstat8(manifestPath);
72812
72933
  if (manifestEntry.isSymbolicLink() || !manifestEntry.isFile()) {
72813
72934
  throw new Error(`Plugin manifest must be a regular file, not a symlink: ${manifestPath}`);
72814
72935
  }
@@ -72878,9 +72999,9 @@ async function samePhysicalDirectory(left, right) {
72878
72999
  const canonical2 = /* @__PURE__ */ __name(async (path2) => {
72879
73000
  let value;
72880
73001
  try {
72881
- value = await realpath7(path2);
73002
+ value = await realpath8(path2);
72882
73003
  } catch {
72883
- value = resolve13(path2);
73004
+ value = resolve14(path2);
72884
73005
  }
72885
73006
  return platform() === "win32" ? value.toLocaleLowerCase("en-US") : value;
72886
73007
  }, "canonical");
@@ -73837,7 +73958,7 @@ function runShellHook(entry, input, signal) {
73837
73958
  });
73838
73959
  const toolPath = pathOf(input.toolInput);
73839
73960
  const { NAMZU_TURN_ID: _inheritedTurnId, ...inherited } = process.env;
73840
- return new Promise((resolve27) => {
73961
+ return new Promise((resolve28) => {
73841
73962
  let child;
73842
73963
  try {
73843
73964
  child = spawnHostShell(entry.command, {
@@ -73864,7 +73985,7 @@ function runShellHook(entry, input, signal) {
73864
73985
  ...process.platform === "win32" ? {} : { shell: { path: "sh", dialect: "sh", source: "sh" } }
73865
73986
  });
73866
73987
  } catch (error) {
73867
- resolve27({
73988
+ resolve28({
73868
73989
  exitCode: null,
73869
73990
  timedOut: false,
73870
73991
  stdout: "",
@@ -73890,7 +74011,7 @@ function runShellHook(entry, input, signal) {
73890
74011
  settled = true;
73891
74012
  clearTimeout(timer);
73892
74013
  signal?.removeEventListener("abort", onAbort);
73893
- resolve27(outcome);
74014
+ resolve28(outcome);
73894
74015
  }, "finish");
73895
74016
  const killTree2 = /* @__PURE__ */ __name(() => {
73896
74017
  if (child.pid !== void 0 && process.platform !== "win32") {
@@ -74441,8 +74562,8 @@ function summarizeBlocking(sessions) {
74441
74562
  __name(summarizeBlocking, "summarizeBlocking");
74442
74563
 
74443
74564
  // ../sdk/dist/manager/agent/lifecycle.js
74444
- import { realpath as realpath8, rm as rm2, stat as stat10 } from "node:fs/promises";
74445
- import { isAbsolute as isAbsolute8, relative as relative4, resolve as resolve14, sep as sep7 } from "node:path";
74565
+ import { realpath as realpath9, rm as rm2, stat as stat10 } from "node:fs/promises";
74566
+ import { isAbsolute as isAbsolute9, relative as relative5, resolve as resolve15, sep as sep7 } from "node:path";
74446
74567
 
74447
74568
  // ../sdk/dist/session/handoff/capacity.js
74448
74569
  var DelegationCapacityExceeded = class extends Error {
@@ -74533,14 +74654,14 @@ function mergeEnv(base3, override) {
74533
74654
  __name(mergeEnv, "mergeEnv");
74534
74655
  async function requireIsolatedWorktreePath(ref, callerCwd, subdirectory) {
74535
74656
  const meta = ref?.meta;
74536
- if (typeof ref?.id !== "string" || ref.id.length === 0 || meta?.backend !== "git-worktree" || typeof meta.repoRoot !== "string" || !isAbsolute8(meta.repoRoot) || typeof meta.branch !== "string" || meta.branch.length === 0 || typeof meta.worktreePath !== "string" || !isAbsolute8(meta.worktreePath) || resolve14(meta.worktreePath) === resolve14(callerCwd ?? process.cwd())) {
74657
+ if (typeof ref?.id !== "string" || ref.id.length === 0 || meta?.backend !== "git-worktree" || typeof meta.repoRoot !== "string" || !isAbsolute9(meta.repoRoot) || typeof meta.branch !== "string" || meta.branch.length === 0 || typeof meta.worktreePath !== "string" || !isAbsolute9(meta.worktreePath) || resolve15(meta.worktreePath) === resolve15(callerCwd ?? process.cwd())) {
74537
74658
  throw new Error("Isolated git-worktree driver returned an invalid workspace ref or path");
74538
74659
  }
74539
74660
  let physicalPaths;
74540
74661
  try {
74541
74662
  physicalPaths = await Promise.all([
74542
- realpath8(meta.worktreePath),
74543
- realpath8(resolve14(callerCwd ?? process.cwd()))
74663
+ realpath9(meta.worktreePath),
74664
+ realpath9(resolve15(callerCwd ?? process.cwd()))
74544
74665
  ]);
74545
74666
  if (!(await stat10(physicalPaths[0])).isDirectory()) {
74546
74667
  throw new Error("The worktree path is not a directory");
@@ -74555,25 +74676,25 @@ async function requireIsolatedWorktreePath(ref, callerCwd, subdirectory) {
74555
74676
  }
74556
74677
  if (subdirectory === void 0)
74557
74678
  return meta.worktreePath;
74558
- if (typeof subdirectory !== "string" || subdirectory.length === 0 || isAbsolute8(subdirectory)) {
74679
+ if (typeof subdirectory !== "string" || subdirectory.length === 0 || isAbsolute9(subdirectory)) {
74559
74680
  throw new Error("Isolated workspace subdirectory must be a nonempty relative path");
74560
74681
  }
74561
- const lexicalChild = resolve14(meta.worktreePath, subdirectory);
74562
- const lexicalRelative = relative4(resolve14(meta.worktreePath), lexicalChild);
74563
- if (isAbsolute8(lexicalRelative) || lexicalRelative === ".." || lexicalRelative.startsWith(`..${sep7}`)) {
74682
+ const lexicalChild = resolve15(meta.worktreePath, subdirectory);
74683
+ const lexicalRelative = relative5(resolve15(meta.worktreePath), lexicalChild);
74684
+ if (isAbsolute9(lexicalRelative) || lexicalRelative === ".." || lexicalRelative.startsWith(`..${sep7}`)) {
74564
74685
  throw new Error("Isolated workspace subdirectory escapes the worktree");
74565
74686
  }
74566
74687
  let physicalChild;
74567
74688
  try {
74568
- physicalChild = await realpath8(lexicalChild);
74689
+ physicalChild = await realpath9(lexicalChild);
74569
74690
  if (!(await stat10(physicalChild)).isDirectory()) {
74570
74691
  throw new Error("The selected worktree path is not a directory");
74571
74692
  }
74572
74693
  } catch (cause) {
74573
74694
  throw new Error("Isolated workspace subdirectory is missing or not a directory", { cause });
74574
74695
  }
74575
- const physicalRelative = relative4(physicalPaths[0], physicalChild);
74576
- if (physicalRelative === "" || isAbsolute8(physicalRelative) || physicalRelative === ".." || physicalRelative.startsWith(`..${sep7}`)) {
74696
+ const physicalRelative = relative5(physicalPaths[0], physicalChild);
74697
+ if (physicalRelative === "" || isAbsolute9(physicalRelative) || physicalRelative === ".." || physicalRelative.startsWith(`..${sep7}`)) {
74577
74698
  throw new Error("Isolated workspace subdirectory resolves outside its worktree");
74578
74699
  }
74579
74700
  return physicalChild;
@@ -75208,7 +75329,8 @@ var AgentManager = class {
75208
75329
  agentType: placement.agentType,
75209
75330
  description: placement.description,
75210
75331
  status: "running",
75211
- createdAt: placement.createdAt
75332
+ createdAt: placement.createdAt,
75333
+ ...placement.continuation ? { continuation: placement.continuation } : {}
75212
75334
  };
75213
75335
  }
75214
75336
  /**
@@ -75259,7 +75381,13 @@ var AgentManager = class {
75259
75381
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
75260
75382
  toolCallId: spawnToolCallId(taskId),
75261
75383
  agentType: options.agentId,
75262
- description: describeSpawn(options)
75384
+ description: describeSpawn(options),
75385
+ ...options.continuationProfile ? {
75386
+ continuation: {
75387
+ workspace: options.workspace?.mode === "isolated" ? "isolated" : "shared",
75388
+ profile: { ...options.continuationProfile }
75389
+ }
75390
+ } : {}
75263
75391
  };
75264
75392
  await writeChildSessionMeta(spawnRecord.placement.metaPath, this.childMeta(spawnRecord));
75265
75393
  return DiskSessionLog.at(paths2, {
@@ -75361,9 +75489,9 @@ var AgentManager = class {
75361
75489
  if (isTerminalAgentTaskState(agentTask.state)) {
75362
75490
  return Promise.resolve();
75363
75491
  }
75364
- return new Promise((resolve27) => {
75492
+ return new Promise((resolve28) => {
75365
75493
  const existing = this.completionCallbacks.get(taskId) ?? [];
75366
- existing.push(resolve27);
75494
+ existing.push(resolve28);
75367
75495
  this.completionCallbacks.set(taskId, existing);
75368
75496
  });
75369
75497
  }
@@ -75570,11 +75698,156 @@ var AgentManager = class {
75570
75698
  origin,
75571
75699
  topicId: context2.topicId,
75572
75700
  projectId: context2.projectId,
75573
- cwd: resolve14(options.input.workingDirectory ?? process.cwd()),
75701
+ cwd: resolve15(options.input.workingDirectory ?? process.cwd()),
75574
75702
  log,
75575
75703
  activeSubSessionId: origin.subSessionId
75576
75704
  });
75577
75705
  }
75706
+ /**
75707
+ * Make a child saved by an earlier process continuable again.
75708
+ *
75709
+ * Reads the child's meta document and log from the project layout under the
75710
+ * invoking parent, checks they describe a settled, shared-workspace child of
75711
+ * this very parent session, then re-creates the in-memory session and edge
75712
+ * and the retained conversation that {@link provisionContinuation} requires.
75713
+ * It runs nothing; the caller continues the child with `sendMessage` and
75714
+ * `resumeSessionId`, so the invoking turn's authority, limits and review
75715
+ * channel apply exactly as for a child that finished in this process.
75716
+ */
75717
+ async restoreChildConversation(options, context2) {
75718
+ const refuse3 = /* @__PURE__ */ __name((reason2) => ({
75719
+ status: "refused",
75720
+ reason: reason2
75721
+ }), "refuse");
75722
+ const id3 = options.childSessionId;
75723
+ const retained = this.childConversations.get(id3);
75724
+ if (retained?.activeSubSessionId)
75725
+ return refuse3("running");
75726
+ const paths2 = context2.childStorage?.kind === "disk" ? context2.childStorage.paths : this.deps.paths;
75727
+ if (!paths2)
75728
+ return refuse3("no-layout");
75729
+ const store = this.deps.sessionStore;
75730
+ if (store.supportsInvocationSummaries !== true || store.supportsOwnerVersionCas !== true)
75731
+ return refuse3("not-resumable");
75732
+ const ancestry = await store.getAncestry(context2.sessionId, context2.tenantId);
75733
+ const parentLocator = {
75734
+ sessionId: context2.sessionId,
75735
+ ancestors: ancestry.slice(0, -1)
75736
+ };
75737
+ let meta;
75738
+ try {
75739
+ meta = await readChildSessionMeta(paths2.subagentMeta(parentLocator, id3));
75740
+ } catch {
75741
+ return refuse3("not-saved");
75742
+ }
75743
+ if (!meta)
75744
+ return refuse3("not-saved");
75745
+ if (meta.sessionId !== id3 || meta.parentSessionId !== context2.sessionId)
75746
+ return refuse3("foreign");
75747
+ const continuation = meta.continuation;
75748
+ if (!continuation || continuation.workspace !== "shared")
75749
+ return refuse3("not-resumable");
75750
+ const agentId = options.agentFor(continuation.profile);
75751
+ if (agentId === void 0 || !this.registry.has(agentId))
75752
+ return refuse3("not-resumable");
75753
+ const log = retained?.log ?? DiskSessionLog.at(paths2, { sessionId: id3, ancestors: ancestry });
75754
+ const ended = await childSessionEnded(log);
75755
+ if (!ended)
75756
+ return refuse3("unsettled");
75757
+ if (ended.status === "cancelled" || meta.status === "cancelled")
75758
+ return refuse3("stopped");
75759
+ const started = await log.head();
75760
+ if (started === null)
75761
+ return refuse3("unsettled");
75762
+ for await (const { record: record3 } of log.read({ mode: "tolerant" })) {
75763
+ if (record3.type !== "session_started")
75764
+ continue;
75765
+ if (record3.projectId !== context2.projectId || record3.topicId !== context2.topicId)
75766
+ return refuse3("foreign");
75767
+ break;
75768
+ }
75769
+ const placement = {
75770
+ paths: paths2,
75771
+ metaPath: paths2.subagentMeta(parentLocator, id3),
75772
+ createdAt: meta.createdAt,
75773
+ toolCallId: meta.toolCallId,
75774
+ agentType: meta.agentType,
75775
+ description: meta.description,
75776
+ continuation
75777
+ };
75778
+ const restored = {
75779
+ status: "restored",
75780
+ childSessionId: id3,
75781
+ agentId,
75782
+ profile: continuation.profile,
75783
+ description: meta.description
75784
+ };
75785
+ if (retained)
75786
+ return restored;
75787
+ if (this.childConversations.size >= RETAINED_CHILD_CONVERSATION_CAP) {
75788
+ const oldest = [...this.childConversations].find(([, value]) => !value.activeSubSessionId);
75789
+ if (!oldest)
75790
+ return refuse3("full");
75791
+ this.childConversations.delete(oldest[0]);
75792
+ }
75793
+ const childActor = {
75794
+ kind: "agent",
75795
+ agentId,
75796
+ tenantId: context2.tenantId,
75797
+ parentActor: context2.parentActor
75798
+ };
75799
+ let child = await store.getSession(id3, context2.tenantId);
75800
+ let createdChild = false;
75801
+ let edge;
75802
+ let createdEdge = false;
75803
+ try {
75804
+ if (child) {
75805
+ if (child.status === "active" || child.status === "archived" || child.status === "locked" || child.projectId !== context2.projectId || child.topicId !== context2.topicId || child.currentActor?.kind !== "agent" || child.currentActor.agentId !== agentId)
75806
+ return refuse3("running");
75807
+ } else {
75808
+ child = await store.createSession({ id: id3, topicId: context2.topicId, projectId: context2.projectId, currentActor: childActor }, context2.tenantId);
75809
+ createdChild = true;
75810
+ }
75811
+ edge = (await store.getChildren(context2.sessionId, context2.tenantId)).find((candidate) => candidate.childSessionId === id3);
75812
+ if (!edge) {
75813
+ edge = await store.createSubSession({
75814
+ parentSessionId: context2.sessionId,
75815
+ childSessionId: id3,
75816
+ kind: "agent_spawn",
75817
+ spawnedBy: context2.parentActor,
75818
+ failureMode: "delegate",
75819
+ completionMode: "summary_ref"
75820
+ }, context2.tenantId);
75821
+ createdEdge = true;
75822
+ }
75823
+ } catch (error) {
75824
+ if (edge && createdEdge)
75825
+ await store.deleteSubSession(edge.id, context2.tenantId).catch(() => void 0);
75826
+ if (child && createdChild)
75827
+ await store.deleteSession(id3, context2.tenantId).catch(() => void 0);
75828
+ throw error;
75829
+ }
75830
+ this.childConversations.set(id3, {
75831
+ definition: this.registry.getOrThrow(agentId),
75832
+ origin: {
75833
+ subSessionId: edge.id,
75834
+ childSessionId: id3,
75835
+ tenantId: context2.tenantId,
75836
+ parentSessionId: context2.sessionId,
75837
+ parentTurnId: meta.parentTurnId,
75838
+ rootSessionId: meta.rootSessionId,
75839
+ ancestry,
75840
+ childDepth: meta.depth,
75841
+ childOwnerVersion: child.ownerVersion,
75842
+ placement
75843
+ },
75844
+ topicId: context2.topicId,
75845
+ projectId: context2.projectId,
75846
+ cwd: resolve15(options.workingDirectory),
75847
+ log
75848
+ });
75849
+ return restored;
75850
+ }
75578
75851
  releaseChildConversation(record3) {
75579
75852
  const conversation = this.childConversations.get(record3.childSessionId);
75580
75853
  if (conversation?.activeSubSessionId !== record3.subSessionId)
@@ -75598,7 +75871,7 @@ var AgentManager = class {
75598
75871
  throw new Error("Child conversation is still running or settling");
75599
75872
  if (origin.workspaceRef || options.workspace?.mode === "isolated" || options.workspaceBackend)
75600
75873
  throw new Error("Child continuation requires a shared workspace; isolated leases cannot be resumed");
75601
- if (resolve14(options.input.workingDirectory ?? process.cwd()) !== conversation.cwd)
75874
+ if (resolve15(options.input.workingDirectory ?? process.cwd()) !== conversation.cwd)
75602
75875
  throw new Error("Child continuation cannot change its working directory");
75603
75876
  const store = this.deps.sessionStore;
75604
75877
  if (store.supportsInvocationSummaries !== true || store.supportsOwnerVersionCas !== true)
@@ -75937,8 +76210,8 @@ var AgentManager = class {
75937
76210
  resolveCompletionCallbacks(taskId) {
75938
76211
  const callbacks = this.completionCallbacks.get(taskId);
75939
76212
  if (callbacks) {
75940
- for (const resolve27 of callbacks)
75941
- resolve27();
76213
+ for (const resolve28 of callbacks)
76214
+ resolve28();
75942
76215
  this.completionCallbacks.delete(taskId);
75943
76216
  }
75944
76217
  }
@@ -76132,11 +76405,11 @@ import { spawn as spawn3, spawnSync } from "node:child_process";
76132
76405
  import { constants as constants3, accessSync as accessSync2, existsSync as existsSync4, realpathSync as realpathSync4 } from "node:fs";
76133
76406
  import { readFile as fsReadFile, writeFile as fsWriteFile, mkdir as mkdir16, open as open10, readdir as readdir11, rename as rename7, rm as rm3, stat as stat11 } from "node:fs/promises";
76134
76407
  import { tmpdir as tmpdir2 } from "node:os";
76135
- import { dirname as dirname17, isAbsolute as isAbsolute10, join as join31, parse as parse3, resolve as resolve15 } from "node:path";
76408
+ import { dirname as dirname18, isAbsolute as isAbsolute11, join as join31, parse as parse3, resolve as resolve16 } from "node:path";
76136
76409
 
76137
76410
  // ../sdk/dist/sandbox/file-walk.js
76138
76411
  var import_brace_expansion2 = __toESM(require_brace_expansion(), 1);
76139
- import { isAbsolute as isAbsolute9, posix as posix3 } from "node:path";
76412
+ import { isAbsolute as isAbsolute10, posix as posix3 } from "node:path";
76140
76413
 
76141
76414
  // ../../node_modules/.pnpm/minimatch@9.0.9/node_modules/minimatch/dist/esm/index.js
76142
76415
  var import_brace_expansion = __toESM(require_brace_expansion(), 1);
@@ -77693,7 +77966,7 @@ function positiveInteger(value, name2) {
77693
77966
  }
77694
77967
  __name(positiveInteger, "positiveInteger");
77695
77968
  function planWalk(root, options) {
77696
- if (!isAbsolute9(root) && !posix3.isAbsolute(root)) {
77969
+ if (!isAbsolute10(root) && !posix3.isAbsolute(root)) {
77697
77970
  throw new Error("File walk root must be an absolute path");
77698
77971
  }
77699
77972
  let pattern = options.pattern ?? "**/*";
@@ -77750,7 +78023,7 @@ function planWalk(root, options) {
77750
78023
  __name(planWalk, "planWalk");
77751
78024
  function directoryMatcher(plan) {
77752
78025
  const patterns = plan.patterns.map((set3) => set3.map((part2) => typeof part2 === "object" && part2 !== null ? new RegExp(part2.source, `${part2.flags}s`) : part2));
77753
- return (relative10) => patterns.some((pattern) => {
78026
+ return (relative11) => patterns.some((pattern) => {
77754
78027
  const closure = /* @__PURE__ */ __name((states2) => {
77755
78028
  for (const index of states2)
77756
78029
  if (pattern[index] === null)
@@ -77758,7 +78031,7 @@ function directoryMatcher(plan) {
77758
78031
  return states2;
77759
78032
  }, "closure");
77760
78033
  let states = closure(/* @__PURE__ */ new Set([0]));
77761
- for (const name2 of relative10.split("/")) {
78034
+ for (const name2 of relative11.split("/")) {
77762
78035
  const next = /* @__PURE__ */ new Set();
77763
78036
  for (const index of states) {
77764
78037
  const segment2 = pattern[index];
@@ -77878,14 +78151,14 @@ async function* executeWalk(plan, signal) {
77878
78151
  }
77879
78152
  if (plan.prefix.length >= maxDepth)
77880
78153
  return;
77881
- const openDirectory = /* @__PURE__ */ __name(async (absolute, relative10, depth) => {
78154
+ const openDirectory = /* @__PURE__ */ __name(async (absolute, relative11, depth) => {
77882
78155
  check2();
77883
78156
  try {
77884
78157
  const dir = await wait(fs.opendir(absolute), (late2) => {
77885
78158
  void close(late2).catch(() => {
77886
78159
  });
77887
78160
  });
77888
- open13.push({ dir, relative: relative10, depth });
78161
+ open13.push({ dir, relative: relative11, depth });
77889
78162
  } catch (error) {
77890
78163
  if (!missing(error))
77891
78164
  throw error;
@@ -77903,15 +78176,15 @@ async function* executeWalk(plan, signal) {
77903
78176
  continue;
77904
78177
  }
77905
78178
  noteVisit();
77906
- const relative10 = frame.relative ? `${frame.relative}/${entry.name}` : entry.name;
77907
- const absolute = path2.join(plan.root, relative10);
78179
+ const relative11 = frame.relative ? `${frame.relative}/${entry.name}` : entry.name;
78180
+ const absolute = path2.join(plan.root, relative11);
77908
78181
  const depth = frame.depth + 1;
77909
78182
  if (entry.isDirectory()) {
77910
- if (depth < maxDepth && canDescend(relative10))
77911
- await openDirectory(absolute, relative10, depth);
78183
+ if (depth < maxDepth && canDescend(relative11))
78184
+ await openDirectory(absolute, relative11, depth);
77912
78185
  continue;
77913
78186
  }
77914
- if (!entry.isFile() || !matchers.some((matcher) => matcher.test(relative10)))
78187
+ if (!entry.isFile() || !matchers.some((matcher) => matcher.test(relative11)))
77915
78188
  continue;
77916
78189
  let info;
77917
78190
  try {
@@ -78043,7 +78316,7 @@ var CappedStream = class {
78043
78316
  }
78044
78317
  };
78045
78318
  function requiredWrapper(request) {
78046
- if (request.wrapperCommand === void 0 || !isAbsolute10(request.wrapperCommand)) {
78319
+ if (request.wrapperCommand === void 0 || !isAbsolute11(request.wrapperCommand)) {
78047
78320
  throw new Error(`Sandbox environment ${request.environment} requires the absolute wrapper path that was probed`);
78048
78321
  }
78049
78322
  return request.wrapperCommand;
@@ -78141,7 +78414,7 @@ function buildBwrapArgs(sandboxRoot, additionalDirectories = []) {
78141
78414
  if (existsSync4(path2))
78142
78415
  args.push("--ro-bind", path2, path2);
78143
78416
  }
78144
- const interpreterPrefix = dirname17(dirname17(canonicalizePath(process.execPath)));
78417
+ const interpreterPrefix = dirname18(dirname18(canonicalizePath(process.execPath)));
78145
78418
  const alreadyCovered = BWRAP_SYSTEM_PATHS.some((path2) => interpreterPrefix === path2 || interpreterPrefix.startsWith(`${path2}/`));
78146
78419
  if (!alreadyCovered && existsSync4(interpreterPrefix)) {
78147
78420
  args.push("--ro-bind", interpreterPrefix, interpreterPrefix);
@@ -78312,7 +78585,7 @@ var LocalSandbox = class {
78312
78585
  this.rootDir = rootDir;
78313
78586
  this.environment = environment;
78314
78587
  this.config = config;
78315
- this.additionalDirectories = (config.additionalDirectories ?? []).map((dir) => canonicalizePath(resolve15(dir))).filter((dir) => dir !== rootDir);
78588
+ this.additionalDirectories = (config.additionalDirectories ?? []).map((dir) => canonicalizePath(resolve16(dir))).filter((dir) => dir !== rootDir);
78316
78589
  this._status = "ready";
78317
78590
  this.log = log.child({
78318
78591
  [SCOPE_ATTRIBUTE]: "sandbox/provider/local",
@@ -78356,7 +78629,7 @@ var LocalSandbox = class {
78356
78629
  throw new Error(`Sandbox ${this.id} is destroyed`);
78357
78630
  }
78358
78631
  const resolved2 = await resolveWithinAnyReal(this.roots, path2);
78359
- await mkdir16(dirname17(resolved2), { recursive: true });
78632
+ await mkdir16(dirname18(resolved2), { recursive: true });
78360
78633
  const tmpPath = `${resolved2}.tmp.${Date.now()}`;
78361
78634
  await fsWriteFile(tmpPath, content);
78362
78635
  await rename7(tmpPath, resolved2);
@@ -78705,7 +78978,7 @@ var LocalSandboxProvider = class {
78705
78978
  let rootDir;
78706
78979
  let removeRootOnDestroy;
78707
78980
  if (config?.workingDirectory !== void 0) {
78708
- const requested = resolve15(config.workingDirectory);
78981
+ const requested = resolve16(config.workingDirectory);
78709
78982
  let entry;
78710
78983
  try {
78711
78984
  entry = await stat11(requested);
@@ -78728,9 +79001,9 @@ var LocalSandboxProvider = class {
78728
79001
  }
78729
79002
  removeRootOnDestroy = false;
78730
79003
  for (const dir of config.additionalDirectories ?? []) {
78731
- const entry2 = await stat11(resolve15(dir)).catch(() => null);
79004
+ const entry2 = await stat11(resolve16(dir)).catch(() => null);
78732
79005
  if (!entry2?.isDirectory()) {
78733
- throw new Error(`Sandbox additional directory is not a directory: ${resolve15(dir)}`);
79006
+ throw new Error(`Sandbox additional directory is not a directory: ${resolve16(dir)}`);
78734
79007
  }
78735
79008
  }
78736
79009
  } else {
@@ -78787,8 +79060,8 @@ var WorkspaceBackendRegistry = class {
78787
79060
  // ../sdk/dist/session/workspace/git-worktree.js
78788
79061
  import { execFile } from "node:child_process";
78789
79062
  import { readFileSync as readFileSync2, realpathSync as realpathSync5 } from "node:fs";
78790
- import { realpath as realpath9 } from "node:fs/promises";
78791
- import { basename as basename9, dirname as dirname18, isAbsolute as isAbsolute11, join as join32, relative as relative5, resolve as resolve16, sep as sep9 } from "node:path";
79063
+ import { realpath as realpath10 } from "node:fs/promises";
79064
+ import { basename as basename9, dirname as dirname19, isAbsolute as isAbsolute12, join as join32, relative as relative6, resolve as resolve17, sep as sep9 } from "node:path";
78792
79065
  import { promisify } from "node:util";
78793
79066
  var execFileAsync = promisify(execFile);
78794
79067
  var defaultExecFile = /* @__PURE__ */ __name(async (file, args) => execFileAsync(file, [...args]), "defaultExecFile");
@@ -78802,8 +79075,8 @@ var GitWorktreeDriver = class {
78802
79075
  log;
78803
79076
  exec;
78804
79077
  constructor(config) {
78805
- this.repoRoot = resolve16(config.repoRoot);
78806
- this.worktreesDir = resolve16(config.worktreesDir ?? defaultWorktreesDir(config.repoRoot));
79078
+ this.repoRoot = resolve17(config.repoRoot);
79079
+ this.worktreesDir = resolve17(config.worktreesDir ?? defaultWorktreesDir(config.repoRoot));
78807
79080
  this.log = config.logger.child({ [SCOPE_ATTRIBUTE]: "session/workspace/git-worktree" });
78808
79081
  this.exec = config.execFile ?? defaultExecFile;
78809
79082
  }
@@ -78816,7 +79089,7 @@ var GitWorktreeDriver = class {
78816
79089
  try {
78817
79090
  repoRoot = await canonicalizeThroughExisting(this.repoRoot);
78818
79091
  worktreesDir = await canonicalizeThroughExisting(this.worktreesDir);
78819
- const lexicalPath = resolve16(worktreesDir, label5);
79092
+ const lexicalPath = resolve17(worktreesDir, label5);
78820
79093
  if (!isStrictDescendant(worktreesDir, lexicalPath)) {
78821
79094
  throw new Error(`Workspace label escapes the managed worktree directory: ${label5}`);
78822
79095
  }
@@ -78824,13 +79097,13 @@ var GitWorktreeDriver = class {
78824
79097
  if (!isStrictDescendant(worktreesDir, worktreePath)) {
78825
79098
  throw new Error(`Workspace label resolves through a link outside the managed worktree directory: ${label5}`);
78826
79099
  }
78827
- if (relative5(worktreesDir, lexicalPath) !== relative5(worktreesDir, worktreePath)) {
79100
+ if (relative6(worktreesDir, lexicalPath) !== relative6(worktreesDir, worktreePath)) {
78828
79101
  throw new Error(`Workspace label resolves through a link to a different managed path: ${label5}`);
78829
79102
  }
78830
79103
  } catch (cause) {
78831
79104
  throw new WorkspaceBackendError({ op: "create:ownership", kind: this.kind, cause });
78832
79105
  }
78833
- const relativePath = relative5(worktreesDir, worktreePath).split(sep9).join("/");
79106
+ const relativePath = relative6(worktreesDir, worktreePath).split(sep9).join("/");
78834
79107
  const branch = `namzu/${relativePath}`;
78835
79108
  const argv = ["-C", repoRoot, "worktree", "add", "-b", branch, "--", worktreePath];
78836
79109
  if (params.baseRef !== void 0) {
@@ -78985,7 +79258,7 @@ var GitWorktreeDriver = class {
78985
79258
  if (!isStrictDescendant(worktreesDir, worktreePath)) {
78986
79259
  throw new Error("Workspace reference escapes the managed worktree directory");
78987
79260
  }
78988
- const label5 = relative5(worktreesDir, worktreePath).split(sep9).join("/");
79261
+ const label5 = relative6(worktreesDir, worktreePath).split(sep9).join("/");
78989
79262
  const branch = `namzu/${label5}`;
78990
79263
  if (ref.meta.branch !== branch) {
78991
79264
  throw new Error("Workspace reference branch does not match its managed path");
@@ -79019,28 +79292,28 @@ var GitWorktreeDriver = class {
79019
79292
  }
79020
79293
  };
79021
79294
  async function canonicalizeThroughExisting(input) {
79022
- let existing = resolve16(input);
79295
+ let existing = resolve17(input);
79023
79296
  const remainder = [];
79024
79297
  for (; ; ) {
79025
79298
  try {
79026
- const canonical2 = await realpath9(existing);
79027
- return resolve16(canonical2, ...remainder);
79299
+ const canonical2 = await realpath10(existing);
79300
+ return resolve17(canonical2, ...remainder);
79028
79301
  } catch (cause) {
79029
79302
  const code = cause.code;
79030
79303
  if (code !== "ENOENT" && code !== "ENOTDIR")
79031
79304
  throw cause;
79032
79305
  }
79033
- const parent = dirname18(existing);
79306
+ const parent = dirname19(existing);
79034
79307
  if (parent === existing)
79035
- return resolve16(existing, ...remainder);
79308
+ return resolve17(existing, ...remainder);
79036
79309
  remainder.unshift(basename9(existing));
79037
79310
  existing = parent;
79038
79311
  }
79039
79312
  }
79040
79313
  __name(canonicalizeThroughExisting, "canonicalizeThroughExisting");
79041
79314
  function isStrictDescendant(root, candidate) {
79042
- const rel = relative5(root, candidate);
79043
- return rel !== "" && rel !== ".." && !rel.startsWith(`..${sep9}`) && !isAbsolute11(rel);
79315
+ const rel = relative6(root, candidate);
79316
+ return rel !== "" && rel !== ".." && !rel.startsWith(`..${sep9}`) && !isAbsolute12(rel);
79044
79317
  }
79045
79318
  __name(isStrictDescendant, "isStrictDescendant");
79046
79319
  function parseWorktreeList(stdout, worktreePath) {
@@ -79074,7 +79347,7 @@ function defaultWorktreesDir(repoRoot) {
79074
79347
  try {
79075
79348
  cwd = realpathSync5(repoRoot);
79076
79349
  } catch {
79077
- cwd = resolve16(repoRoot);
79350
+ cwd = resolve17(repoRoot);
79078
79351
  }
79079
79352
  const home = resolveNamzuHome();
79080
79353
  let slug = slugForCwd(cwd);
@@ -79235,15 +79508,15 @@ var SessionSummaryMaterializer = class {
79235
79508
 
79236
79509
  // ../sdk/dist/store/session/memory.js
79237
79510
  import { realpathSync as realpathSync6 } from "node:fs";
79238
- import { resolve as resolve18 } from "node:path";
79511
+ import { resolve as resolve19 } from "node:path";
79239
79512
 
79240
79513
  // ../sdk/dist/store/session/canonical-path.js
79241
- import { realpath as realpath10 } from "node:fs/promises";
79242
- import { resolve as resolve17 } from "node:path";
79514
+ import { realpath as realpath11 } from "node:fs/promises";
79515
+ import { resolve as resolve18 } from "node:path";
79243
79516
  async function canonicalizePath2(input) {
79244
- const absolute = resolve17(input);
79517
+ const absolute = resolve18(input);
79245
79518
  try {
79246
- return await realpath10(absolute);
79519
+ return await realpath11(absolute);
79247
79520
  } catch (err) {
79248
79521
  if (err.code === "ENOENT")
79249
79522
  return absolute;
@@ -79331,7 +79604,7 @@ var InMemorySessionStore = class {
79331
79604
  } catch (error) {
79332
79605
  if (error.code !== "ENOENT")
79333
79606
  throw error;
79334
- rootPath = resolve18(project.rootPath);
79607
+ rootPath = resolve19(project.rootPath);
79335
79608
  }
79336
79609
  const key5 = `${project.tenantId}\0${rootPath}`;
79337
79610
  const existingProjectId = roots.get(key5);
@@ -79782,13 +80055,13 @@ __name(stepResident, "stepResident");
79782
80055
 
79783
80056
  // ../sdk/dist/manager/resident/agenda.js
79784
80057
  import { randomUUID as randomUUID11 } from "node:crypto";
79785
- import { join as join34, resolve as resolve20 } from "node:path";
80058
+ import { join as join34, resolve as resolve21 } from "node:path";
79786
80059
  import { isDeepStrictEqual as isDeepStrictEqual6 } from "node:util";
79787
80060
 
79788
80061
  // ../sdk/dist/manager/resident/history-disk.js
79789
80062
  import { constants as constants4 } from "node:fs";
79790
- import { lstat as lstat8, open as open11 } from "node:fs/promises";
79791
- import { join as join33, relative as relative6, resolve as resolve19, sep as sep10 } from "node:path";
80063
+ import { lstat as lstat9, open as open11 } from "node:fs/promises";
80064
+ import { join as join33, relative as relative7, resolve as resolve20, sep as sep10 } from "node:path";
79792
80065
  var RECORD_BYTES2 = 4 * 1024 * 1024;
79793
80066
  var ResidentHistoryPageLimit = class extends Error {
79794
80067
  static {
@@ -79797,14 +80070,14 @@ var ResidentHistoryPageLimit = class extends Error {
79797
80070
  };
79798
80071
  async function readResidentHistoryRecord(root, path2, budget) {
79799
80072
  budget.signal?.throwIfAborted();
79800
- const base3 = resolve19(root);
79801
- const suffix = relative6(base3, resolve19(path2));
80073
+ const base3 = resolve20(root);
80074
+ const suffix = relative7(base3, resolve20(path2));
79802
80075
  if (suffix === ".." || suffix.startsWith(`..${sep10}`))
79803
80076
  throw new Error("Invalid history path.");
79804
80077
  let current = base3;
79805
80078
  for (const part2 of ["", ...suffix.split(sep10).filter(Boolean)]) {
79806
80079
  current = join33(current, part2);
79807
- if ((await lstat8(current)).isSymbolicLink())
80080
+ if ((await lstat9(current)).isSymbolicLink())
79808
80081
  throw new Error("History symlinks are refused.");
79809
80082
  }
79810
80083
  const handle = await open11(path2, constants4.O_RDONLY | constants4.O_NOFOLLOW | constants4.O_NONBLOCK);
@@ -80373,8 +80646,8 @@ var DiskResidentAgenda = class {
80373
80646
  revisionsDir: join34(directory, "revisions"),
80374
80647
  publishLegacyProjection: false
80375
80648
  };
80376
- this.historyRoot = resolve20(root);
80377
- this.historyRevisions = resolve20(this.location.revisionsDir);
80649
+ this.historyRoot = resolve21(root);
80650
+ this.historyRevisions = resolve21(this.location.revisionsDir);
80378
80651
  }
80379
80652
  checked(record3) {
80380
80653
  const agenda = agendaSchema.parse(record3);
@@ -81719,7 +81992,7 @@ __name(createResidentToolEvidenceSource, "createResidentToolEvidenceSource");
81719
81992
  import { createHash as createHash30, randomUUID as randomUUID13 } from "node:crypto";
81720
81993
  import { closeSync as closeSync2, existsSync as existsSync5, fsyncSync as fsyncSync2, linkSync as linkSync2, lstatSync as lstatSync4, mkdirSync as mkdirSync4, openSync as openSync2, readFileSync as readFileSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "node:fs";
81721
81994
  import { createRequire as createRequire3 } from "node:module";
81722
- import { dirname as dirname19, join as join35, resolve as resolve21 } from "node:path";
81995
+ import { dirname as dirname20, join as join35, resolve as resolve22 } from "node:path";
81723
81996
 
81724
81997
  // ../sdk/dist/manager/resident/learning-observation.js
81725
81998
  var label4 = external_exports.string().trim().min(1).max(256);
@@ -81849,8 +82122,8 @@ var SqliteResidentLearningStore = class {
81849
82122
  scope;
81850
82123
  readOnly;
81851
82124
  constructor(options) {
81852
- this.databasePath = resolve21(options.databasePath);
81853
- this.artifactsPath = resolve21(options.artifactsPath);
82125
+ this.databasePath = resolve22(options.databasePath);
82126
+ this.artifactsPath = resolve22(options.artifactsPath);
81854
82127
  this.scope = Object.freeze({
81855
82128
  tenantId: asTenantId(options.scope.tenantId.toLowerCase()),
81856
82129
  projectId: asProjectId(options.scope.projectId.toLowerCase()),
@@ -81870,7 +82143,7 @@ var SqliteResidentLearningStore = class {
81870
82143
  });
81871
82144
  }
81872
82145
  if (!this.readOnly)
81873
- mkdirSync4(dirname19(this.databasePath), { recursive: true, mode: 448 });
82146
+ mkdirSync4(dirname20(this.databasePath), { recursive: true, mode: 448 });
81874
82147
  const db = new Database(this.databasePath, { readOnly: this.readOnly });
81875
82148
  try {
81876
82149
  db.exec("PRAGMA busy_timeout = 5000; PRAGMA foreign_keys = ON;");
@@ -82485,7 +82758,7 @@ __name(derivePeerRef, "derivePeerRef");
82485
82758
  // ../sdk/dist/peers/registry.js
82486
82759
  import { randomBytes as randomBytes6 } from "node:crypto";
82487
82760
  import { closeSync as closeSync3, fsyncSync as fsyncSync3, lstatSync as lstatSync6, openSync as openSync3, readFileSync as readFileSync4, readdirSync as readdirSync2, renameSync, unlinkSync as unlinkSync3, writeSync as writeSync2 } from "node:fs";
82488
- import { basename as basename10, dirname as dirname20, join as join38 } from "node:path";
82761
+ import { basename as basename10, dirname as dirname21, join as join38 } from "node:path";
82489
82762
 
82490
82763
  // ../sdk/dist/peers/client.js
82491
82764
  import { createConnection } from "node:net";
@@ -82505,7 +82778,7 @@ function connectPath(address2) {
82505
82778
  }
82506
82779
  __name(connectPath, "connectPath");
82507
82780
  function sendPeerRequest(address2, request, parseResponse, timeoutMs) {
82508
- return new Promise((resolve27) => {
82781
+ return new Promise((resolve28) => {
82509
82782
  let settled = false;
82510
82783
  const finish2 = /* @__PURE__ */ __name((result) => {
82511
82784
  if (settled)
@@ -82513,7 +82786,7 @@ function sendPeerRequest(address2, request, parseResponse, timeoutMs) {
82513
82786
  settled = true;
82514
82787
  clearTimeout(timer);
82515
82788
  socket.destroy();
82516
- resolve27(result);
82789
+ resolve28(result);
82517
82790
  }, "finish");
82518
82791
  const unreachable = /* @__PURE__ */ __name((error) => finish2({
82519
82792
  kind: "unreachable",
@@ -82525,7 +82798,7 @@ function sendPeerRequest(address2, request, parseResponse, timeoutMs) {
82525
82798
  path2 = connectPath(address2);
82526
82799
  } catch (error) {
82527
82800
  clearTimeout(timer);
82528
- resolve27({
82801
+ resolve28({
82529
82802
  kind: "unreachable",
82530
82803
  reason: error instanceof Error ? error.message : String(error)
82531
82804
  });
@@ -82617,7 +82890,7 @@ function recordPath(sessionsDir, sessionId5) {
82617
82890
  }
82618
82891
  __name(recordPath, "recordPath");
82619
82892
  function temporaryPathBeside(path2) {
82620
- return join38(dirname20(path2), `.${basename10(path2)}.${process.pid}.${randomBytes6(6).toString("hex")}.tmp`);
82893
+ return join38(dirname21(path2), `.${basename10(path2)}.${process.pid}.${randomBytes6(6).toString("hex")}.tmp`);
82621
82894
  }
82622
82895
  __name(temporaryPathBeside, "temporaryPathBeside");
82623
82896
  function writePeerRecord(sessionsDir, record3) {
@@ -83034,23 +83307,23 @@ async function createPeerEndpoint(options) {
83034
83307
  void handleLine(buffered.subarray(0, newline)).catch(() => socket.destroy());
83035
83308
  });
83036
83309
  });
83037
- await new Promise((resolve27, reject2) => {
83310
+ await new Promise((resolve28, reject2) => {
83038
83311
  const failed = /* @__PURE__ */ __name((error) => reject2(error), "failed");
83039
83312
  server.once("error", failed);
83040
83313
  server.listen({ path: listenPath }, () => {
83041
83314
  server.removeListener("error", failed);
83042
- resolve27();
83315
+ resolve28();
83043
83316
  });
83044
83317
  });
83045
83318
  server.on("error", () => {
83046
83319
  });
83047
83320
  if (parsed.scheme === "uds")
83048
83321
  chmodSync3(listenPath, 384);
83049
- const close = /* @__PURE__ */ __name(() => new Promise((resolve27) => {
83322
+ const close = /* @__PURE__ */ __name(() => new Promise((resolve28) => {
83050
83323
  closing = true;
83051
83324
  for (const socket of sockets)
83052
83325
  socket.destroy();
83053
- server.close(() => resolve27());
83326
+ server.close(() => resolve28());
83054
83327
  }), "close");
83055
83328
  return {
83056
83329
  address: options.address,
@@ -83654,7 +83927,7 @@ var PalRuntime = class {
83654
83927
  // ../sdk/dist/pals/communication/store.js
83655
83928
  import { randomUUID as randomUUID14 } from "node:crypto";
83656
83929
  import { chmodSync as chmodSync4, lstatSync as lstatSync8, mkdirSync as mkdirSync6, readdirSync as readdirSync3, realpathSync as realpathSync7 } from "node:fs";
83657
- import { join as join39, resolve as resolve22 } from "node:path";
83930
+ import { join as join39, resolve as resolve23 } from "node:path";
83658
83931
  import { isDeepStrictEqual as isDeepStrictEqual8 } from "node:util";
83659
83932
 
83660
83933
  // ../sdk/dist/pals/communication/ingress-types.js
@@ -83888,7 +84161,7 @@ var DiskPalCommunicationStore = class {
83888
84161
  migrations: { 1: (value) => value }
83889
84162
  }), "Pal communication", (record3) => record3.revision);
83890
84163
  constructor(options) {
83891
- this.root = resolve22(options.root);
84164
+ this.root = resolve23(options.root);
83892
84165
  this.secure = options.secureDirectory ?? ((path2) => {
83893
84166
  if (process.platform !== "win32")
83894
84167
  chmodSync4(path2, 448);
@@ -84363,7 +84636,7 @@ var PalMessageBroker = class {
84363
84636
 
84364
84637
  // ../sdk/dist/pals/communication/policy.js
84365
84638
  import { chmodSync as chmodSync5, lstatSync as lstatSync9, mkdirSync as mkdirSync7, readdirSync as readdirSync4, realpathSync as realpathSync8 } from "node:fs";
84366
- import { join as join40, resolve as resolve23 } from "node:path";
84639
+ import { join as join40, resolve as resolve24 } from "node:path";
84367
84640
  var PalMessagePermissionConflictError = class extends Error {
84368
84641
  static {
84369
84642
  __name(this, "PalMessagePermissionConflictError");
@@ -84399,7 +84672,7 @@ var DiskPalMessagePolicy = class {
84399
84672
  secure;
84400
84673
  records = new DiskRevisionRecordStore(defineSchema({ kind: "pal-message-permission", current: 1, migrations: {} }), "Pal message permission", (value) => value.revision);
84401
84674
  constructor(options) {
84402
- this.root = resolve23(options.root);
84675
+ this.root = resolve24(options.root);
84403
84676
  this.secure = options.secureDirectory ?? ((path2) => {
84404
84677
  if (process.platform !== "win32")
84405
84678
  chmodSync5(path2, 448);
@@ -85040,7 +85313,7 @@ __name(dispatchPalIngressOnce, "dispatchPalIngressOnce");
85040
85313
 
85041
85314
  // ../sdk/dist/pals/activity/subscription-store.js
85042
85315
  import { chmodSync as chmodSync6, lstatSync as lstatSync10, mkdirSync as mkdirSync8, readdirSync as readdirSync5, realpathSync as realpathSync9 } from "node:fs";
85043
- import { join as join41, resolve as resolve24 } from "node:path";
85316
+ import { join as join41, resolve as resolve25 } from "node:path";
85044
85317
  import { isDeepStrictEqual as isDeepStrictEqual9 } from "node:util";
85045
85318
 
85046
85319
  // ../sdk/dist/pals/activity/subscription-schema.js
@@ -85079,7 +85352,7 @@ var DiskPalActivitySubscriptionStore = class {
85079
85352
  migrations: {}
85080
85353
  }), "Pal activity subscription", (value) => value.revision);
85081
85354
  constructor(options) {
85082
- this.root = resolve24(options.root);
85355
+ this.root = resolve25(options.root);
85083
85356
  this.secure = options.secureDirectory ?? ((path2) => {
85084
85357
  if (process.platform !== "win32")
85085
85358
  chmodSync6(path2, 448);
@@ -85201,7 +85474,7 @@ var DiskPalActivitySubscriptionStore = class {
85201
85474
 
85202
85475
  // ../sdk/dist/pals/activity/subscription-policy.js
85203
85476
  import { chmodSync as chmodSync7, lstatSync as lstatSync11, mkdirSync as mkdirSync9, readdirSync as readdirSync6, realpathSync as realpathSync10 } from "node:fs";
85204
- import { join as join42, resolve as resolve25 } from "node:path";
85477
+ import { join as join42, resolve as resolve26 } from "node:path";
85205
85478
  import { isDeepStrictEqual as isDeepStrictEqual10 } from "node:util";
85206
85479
  var PalActivitySubscriptionPermissionConflictError = class extends Error {
85207
85480
  static {
@@ -85236,7 +85509,7 @@ var DiskPalActivitySubscriptionPolicy = class {
85236
85509
  migrations: {}
85237
85510
  }), "Pal activity subscription permission", (value) => value.revision);
85238
85511
  constructor(options) {
85239
- this.root = resolve25(options.root);
85512
+ this.root = resolve26(options.root);
85240
85513
  this.subscriptions = options.subscriptions;
85241
85514
  this.secure = options.secureDirectory ?? ((path2) => {
85242
85515
  if (process.platform !== "win32")
@@ -86603,7 +86876,7 @@ function shellProgress(report) {
86603
86876
  __name(shellProgress, "shellProgress");
86604
86877
  function execHostShell(command, options) {
86605
86878
  options.signal?.throwIfAborted();
86606
- return new Promise((resolve27, reject2) => {
86879
+ return new Promise((resolve28, reject2) => {
86607
86880
  const child = spawnHostShell(command, {
86608
86881
  cwd: options.cwd,
86609
86882
  env: options.env,
@@ -86704,7 +86977,7 @@ function execHostShell(command, options) {
86704
86977
  const stdout = decodeCapture("stdout");
86705
86978
  const stderr = decodeCapture("stderr");
86706
86979
  if (!failure2 && cause === void 0 && code === 0 && signal === null) {
86707
- resolve27({
86980
+ resolve28({
86708
86981
  stdout,
86709
86982
  stderr,
86710
86983
  stdoutBytes: captures.stdout.bytes,
@@ -86751,7 +87024,7 @@ ${stderr}`));
86751
87024
  child.off("close", onClose);
86752
87025
  child.off("error", onError);
86753
87026
  child.off("spawn", onSpawn);
86754
- resolve27({
87027
+ resolve28({
86755
87028
  backgroundedJobId: jobId,
86756
87029
  stdout: decodeCapture("stdout"),
86757
87030
  stderr: decodeCapture("stderr")
@@ -87081,8 +87354,8 @@ var BashTool = Object.defineProperty({ ...BashToolBase }, "description", {
87081
87354
  });
87082
87355
 
87083
87356
  // ../sdk/dist/tools/builtins/code-analysis.js
87084
- import { realpath as realpath11, stat as stat12 } from "node:fs/promises";
87085
- import { isAbsolute as isAbsolute12, relative as relative7, sep as sep11 } from "node:path";
87357
+ import { realpath as realpath12, stat as stat12 } from "node:fs/promises";
87358
+ import { isAbsolute as isAbsolute13, relative as relative8, sep as sep11 } from "node:path";
87086
87359
  var DEFAULT_LIMIT = 50;
87087
87360
  var MAX_LIMIT = 200;
87088
87361
  var DEFAULT_MAX_CHARS = 2e4;
@@ -87219,8 +87492,8 @@ var CodeAnalysisTool = defineTool({
87219
87492
  return renderPage(result, (hit) => {
87220
87493
  const shown = JSON.stringify(hit.value) + (hit.valueTruncated ? " (cut)" : "");
87221
87494
  const kind = hit.kind === "string" ? "" : ` (${hit.kind})`;
87222
- const inside = hit.function ? ` in ${shortFunction(hit.function)}` : " at top level";
87223
- return `${hit.line}:${hit.column} ${shown}${kind}${inside}${staleMark(hit.stale)}`;
87495
+ const inside2 = hit.function ? ` in ${shortFunction(hit.function)}` : " at top level";
87496
+ return `${hit.line}:${hit.column} ${shown}${kind}${inside2}${staleMark(hit.stale)}`;
87224
87497
  }, (hit) => relativeTo(root, hit.path));
87225
87498
  }
87226
87499
  case "enclosing_function": {
@@ -87287,11 +87560,11 @@ var CodeAnalysisTool = defineTool({
87287
87560
  ...signalOf(context2)
87288
87561
  });
87289
87562
  return renderPage(result, (site) => {
87290
- const inside = site.caller ? ` in ${shortFunction(site.caller)}` : " at top level";
87563
+ const inside2 = site.caller ? ` in ${shortFunction(site.caller)}` : " at top level";
87291
87564
  const how = site.kind === "new" ? "new " : "";
87292
87565
  const tag = site.kind === "call-via" ? " [call/apply/bind]" : site.kind === "tagged" ? " [tagged template]" : "";
87293
87566
  const label5 = site.resolution === "text-only" ? " [text-only]" : "";
87294
- return `${site.line}:${site.column} ${how}${site.callee}(${site.argumentCount} arg${site.argumentCount === 1 ? "" : "s"})${tag}${label5}${inside}${staleMark(site.stale)}`;
87567
+ return `${site.line}:${site.column} ${how}${site.callee}(${site.argumentCount} arg${site.argumentCount === 1 ? "" : "s"})${tag}${label5}${inside2}${staleMark(site.stale)}`;
87295
87568
  }, (site) => relativeTo(root, site.path));
87296
87569
  }
87297
87570
  case "imports": {
@@ -87346,7 +87619,7 @@ async function owningRoot(roots, target) {
87346
87619
  for (const candidate of roots) {
87347
87620
  let real;
87348
87621
  try {
87349
- real = await realpath11(candidate);
87622
+ real = await realpath12(candidate);
87350
87623
  if (!(await stat12(real)).isDirectory()) {
87351
87624
  if (isWithin(real, target) || real === target)
87352
87625
  sawFile = true;
@@ -87362,8 +87635,8 @@ async function owningRoot(roots, target) {
87362
87635
  }
87363
87636
  __name(owningRoot, "owningRoot");
87364
87637
  function relativeTo(root, path2) {
87365
- const rel = relative7(root, path2);
87366
- if (rel === "" || rel === ".." || rel.startsWith(`..${sep11}`) || isAbsolute12(rel))
87638
+ const rel = relative8(root, path2);
87639
+ if (rel === "" || rel === ".." || rel.startsWith(`..${sep11}`) || isAbsolute13(rel))
87367
87640
  return path2;
87368
87641
  return sep11 === "/" ? rel : rel.split(sep11).join("/");
87369
87642
  }
@@ -89016,7 +89289,7 @@ var MAX_LISTED_WINDOWS = 50;
89016
89289
  var MAX_UI_SNAPSHOT_CHARS = 14e3;
89017
89290
  function computerUseUnavailableReason(provider, model) {
89018
89291
  if (!resolveProviderCapabilities(provider).supportsToolResultImages) {
89019
- return `The ${provider.id} provider cannot return images in tool results, so the model would never see a screenshot. Use a provider that can (for example Anthropic, Codex or Google) for computer use.`;
89292
+ return `The ${provider.id} provider cannot return images in tool results, so the model would never see a screenshot. Use a provider that can return images in tool results for computer use.`;
89020
89293
  }
89021
89294
  if (model !== void 0 && !modelReadsImages(provider, model)) {
89022
89295
  return `The model ${model} cannot read images, so it would never see a screenshot. Use a model that reads images for computer use.`;
@@ -89317,7 +89590,7 @@ function buildDescription(host, caps, settings) {
89317
89590
  if (available.includes("batch"))
89318
89591
  lines.push(`batch: {"type":"batch","actions":[...]} runs up to ${settings.maxBatchActions} actions in order, stops at the first one that fails, and returns one screenshot at the end. Every call costs a model round trip of several seconds, so put the steps you can already predict into one batch (click a field, type, press ENTER) rather than one call each \u2014 but end the batch at any step that should bring up a new window, and look before typing into it. A batch cannot contain screenshot${available.includes("ui_snapshot") ? ", zoom or ui_snapshot" : " or zoom"}.`);
89319
89592
  if (caps.displayServer === "win32" && available.includes("key") && available.includes("type_text"))
89320
- lines.push("To start a Windows program, a shell command (Start-Process notepad, or cmd.exe /c start calc) is surest when you have a shell tool. The Start menu searches by display names in the system language, and ENTER on a name it does not find opens a web search in the browser.");
89593
+ lines.push("To start a Windows program, a shell command (Start-Process <program>, or cmd.exe /c start <program>) is surest when you have a shell tool. The Start menu searches by display names in the system language, and ENTER on a name it does not find opens a web search in the browser.");
89321
89594
  if (available.includes("list_windows"))
89322
89595
  lines.push("list_windows names the open windows with their ids; focus_window brings one to the front.");
89323
89596
  if (windowCaptureAvailable(host, caps))
@@ -90332,7 +90605,7 @@ ${wrapUntrusted({
90332
90605
  __name(createComputerUseTool, "createComputerUseTool");
90333
90606
 
90334
90607
  // ../sdk/dist/tools/builtins/glob.js
90335
- import { isAbsolute as isAbsolute13, join as join43, relative as relative8, sep as sep12 } from "node:path";
90608
+ import { isAbsolute as isAbsolute14, join as join43, relative as relative9, sep as sep12 } from "node:path";
90336
90609
 
90337
90610
  // ../sdk/dist/tools/posix-path.js
90338
90611
  function normalizeSegments(path2) {
@@ -90394,9 +90667,9 @@ function relativePattern(pattern, root, sandboxed) {
90394
90667
  if (result.split("/").includes("..")) {
90395
90668
  throw new Error('Glob pattern escapes the search directory through "..". Choose a contained path and a relative pattern.');
90396
90669
  }
90397
- if (sandboxed ? result.startsWith("/") : isAbsolute13(pattern)) {
90670
+ if (sandboxed ? result.startsWith("/") : isAbsolute14(pattern)) {
90398
90671
  const contained2 = sandboxed ? resolveWithinPosix(root, result) : resolveWithin(root, pattern);
90399
- result = sandboxed ? relativePosix(root, contained2) : relative8(root, contained2).split(sep12).join("/");
90672
+ result = sandboxed ? relativePosix(root, contained2) : relative9(root, contained2).split(sep12).join("/");
90400
90673
  }
90401
90674
  while (result.startsWith("./"))
90402
90675
  result = result.slice(2);
@@ -90468,7 +90741,7 @@ var GlobTool = defineTool({
90468
90741
  truncated = true;
90469
90742
  break;
90470
90743
  }
90471
- const file = sandbox ? relativePosix(sandbox.rootDir, absolute) : relative8(context2.workingDirectory, join43(lexicalRoot, relative8(root, absolute)));
90744
+ const file = sandbox ? relativePosix(sandbox.rootDir, absolute) : relative9(context2.workingDirectory, join43(lexicalRoot, relative9(root, absolute)));
90472
90745
  files.push(`./${sandbox ? file : file.split(sep12).join("/")}`);
90473
90746
  }
90474
90747
  } catch (error) {
@@ -90496,7 +90769,7 @@ var GlobTool = defineTool({
90496
90769
 
90497
90770
  // ../sdk/dist/tools/builtins/grep.js
90498
90771
  import { readFile as readFile17, stat as stat13 } from "node:fs/promises";
90499
- import { isAbsolute as isAbsolute14, join as join44, relative as relative9, sep as sep13 } from "node:path";
90772
+ import { isAbsolute as isAbsolute15, join as join44, relative as relative10, sep as sep13 } from "node:path";
90500
90773
  async function readWithSignal(read, signal) {
90501
90774
  signal?.throwIfAborted();
90502
90775
  if (!signal)
@@ -90522,9 +90795,9 @@ function relativeInclude(include, root, sandboxed) {
90522
90795
  let pattern = sandboxed ? include : include.split(sep13).join("/");
90523
90796
  if (pattern.split("/").includes(".."))
90524
90797
  throw new Error("Include pattern escapes the search directory");
90525
- if (sandboxed ? pattern.startsWith("/") : isAbsolute14(include)) {
90798
+ if (sandboxed ? pattern.startsWith("/") : isAbsolute15(include)) {
90526
90799
  const absolute = sandboxed ? resolveWithinPosix(root, pattern) : resolveWithin(root, include);
90527
- pattern = sandboxed ? relativePosix(root, absolute) : relative9(root, absolute).split(sep13).join("/");
90800
+ pattern = sandboxed ? relativePosix(root, absolute) : relative10(root, absolute).split(sep13).join("/");
90528
90801
  }
90529
90802
  while (pattern.startsWith("./"))
90530
90803
  pattern = pattern.slice(2);
@@ -90660,7 +90933,7 @@ var GrepTool = defineTool({
90660
90933
  }
90661
90934
  const lines = content.split("\n");
90662
90935
  let fileMatches = 0;
90663
- const relPath = sandbox ? `./${relativePosix(sandbox.rootDir, filePath)}` : `./${relative9(context2.workingDirectory, join44(lexicalRoot, relative9(root, filePath))).split(sep13).join("/")}`;
90936
+ const relPath = sandbox ? `./${relativePosix(sandbox.rootDir, filePath)}` : `./${relative10(context2.workingDirectory, join44(lexicalRoot, relative10(root, filePath))).split(sep13).join("/")}`;
90664
90937
  for (let i = 0; i < lines.length; i++) {
90665
90938
  context2.abortSignal?.throwIfAborted();
90666
90939
  const line = lines[i] ?? "";
@@ -90943,7 +91216,7 @@ async function waitForJobWithBounds(jobs, id3, options, now = Date.now) {
90943
91216
  omittedOutputBytes
90944
91217
  };
90945
91218
  });
90946
- const expiry = new Promise((resolve27) => {
91219
+ const expiry = new Promise((resolve28) => {
90947
91220
  const tick = setInterval(() => {
90948
91221
  if (settled)
90949
91222
  return;
@@ -90951,7 +91224,7 @@ async function waitForJobWithBounds(jobs, id3, options, now = Date.now) {
90951
91224
  const elapsed = now() - startedAt;
90952
91225
  if (elapsed >= options.wallMs) {
90953
91226
  clearInterval(tick);
90954
- resolve27({
91227
+ resolve28({
90955
91228
  kind: "timeout",
90956
91229
  cause: "wall",
90957
91230
  elapsedMs: elapsed,
@@ -90966,7 +91239,7 @@ async function waitForJobWithBounds(jobs, id3, options, now = Date.now) {
90966
91239
  const quietFor = now() - lastProgressAt;
90967
91240
  if (quietFor >= options.idleMs) {
90968
91241
  clearInterval(tick);
90969
- resolve27({
91242
+ resolve28({
90970
91243
  kind: "timeout",
90971
91244
  cause: "idle",
90972
91245
  elapsedMs: elapsed,
@@ -91197,7 +91470,7 @@ ${observed}
91197
91470
 
91198
91471
  // ../sdk/dist/tools/builtins/verify-outputs.js
91199
91472
  import { stat as stat14 } from "node:fs/promises";
91200
- import { resolve as resolve26 } from "node:path";
91473
+ import { resolve as resolve27 } from "node:path";
91201
91474
  var inputSchema15 = external_exports.object({
91202
91475
  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."),
91203
91476
  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).")
@@ -91253,7 +91526,7 @@ async function verifyOne(input) {
91253
91526
  };
91254
91527
  }
91255
91528
  }
91256
- const filePath = resolve26(context2.workingDirectory, path2);
91529
+ const filePath = resolve27(context2.workingDirectory, path2);
91257
91530
  try {
91258
91531
  const info = await stat14(filePath);
91259
91532
  if (!info.isFile()) {
@@ -91843,7 +92116,7 @@ function actModelSchema(actions) {
91843
92116
  },
91844
92117
  origin: {
91845
92118
  type: "string",
91846
- description: 'REQUIRED. The origin from the latest snapshot header ("Page: <origin> \u2014 \u2026"), e.g. https://github.com. The call is refused if the page is no longer there.'
92119
+ description: 'REQUIRED. The origin from the latest snapshot header ("Page: <origin> \u2014 \u2026"), e.g. https://example.com. The call is refused if the page is no longer there.'
91847
92120
  },
91848
92121
  ref: { type: "string", description: "Element ref from the latest snapshot, like e12." },
91849
92122
  text: { type: "string" },
@@ -92431,7 +92704,7 @@ __name(buildReadMemoryTool, "buildReadMemoryTool");
92431
92704
 
92432
92705
  // ../sdk/dist/tools/memory/fields.js
92433
92706
  var memoryFieldsSchema = {
92434
- name: external_exports.string().max(MEMORY_NAME_MAX_LENGTH).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional().describe('Unique kebab-case slug, e.g. "deploys-need-a-changeset"; other memories link to it as [[name]]'),
92707
+ name: external_exports.string().max(MEMORY_NAME_MAX_LENGTH).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional().describe('Unique kebab-case slug, e.g. "prefers-short-answers"; other memories link to it as [[name]]'),
92435
92708
  description: external_exports.string().max(300).regex(/^[^\r\n]*$/).optional().describe("One line saying what this memory is for, used to decide whether to read it"),
92436
92709
  type: external_exports.enum(["user", "feedback", "project", "reference"]).optional().describe("user, feedback, project or reference; stores that require a type use project when omitted")
92437
92710
  };
@@ -92794,10 +93067,10 @@ var inputSchema16 = external_exports.object({
92794
93067
  preset: external_exports.enum(["read-only", "edit-in-folder"]).optional().describe("read-only: read/glob/grep/ls only; its bash deny blocks every script. edit-in-folder: also edit and write, bash asks. For a pure script, omit the preset and set rules to {} with unmatched: deny"),
92795
93068
  unmatched: external_exports.enum(["park", "deny"]).describe("A call no rule covers: park (wait for the operator) or deny"),
92796
93069
  execution: external_exports.enum(["host", "sandbox"]).optional().describe("Where commands run; leave unset (this machine) unless the user asked for a sandbox"),
92797
- rules: external_exports.record(external_exports.string(), external_exports.union([EFFECT, external_exports.record(external_exports.string(), EFFECT)])).optional().describe('Extra rules, e.g. {"bash": {"npm test*": "allow"}}'),
93070
+ rules: external_exports.record(external_exports.string(), external_exports.union([EFFECT, external_exports.record(external_exports.string(), EFFECT)])).optional().describe('Extra rules, e.g. {"bash": {"<command> *": "allow"}}'),
92798
93071
  browser: external_exports.object({
92799
93072
  profile: external_exports.string().regex(BROWSER_PROFILE).describe('Browser profile the operator signed in with, e.g. "work"'),
92800
- sites: external_exports.record(external_exports.string(), external_exports.enum(["read", "ask", "act"])).describe('Site to level, e.g. {"https://github.com": "read"}. read: open and read only; ask: changes wait for the operator; act: changes run unasked. Unlisted sites are denied; there is no "*".'),
93073
+ sites: external_exports.record(external_exports.string(), external_exports.enum(["read", "ask", "act"])).describe('Site to level, e.g. {"https://example.com": "read"}. read: open and read only; ask: changes wait for the operator; act: changes run unasked. Unlisted sites are denied; there is no "*".'),
92801
93074
  headed: external_exports.boolean().optional().describe("Show the browser window; default no window")
92802
93075
  }).optional().describe("Browser access; omit for none")
92803
93076
  }).optional().describe('create: REQUIRED explicit permission set; there is no default. For a pure script, use {rules:{}, unmatched:"deny"} without a preset unless you intend deny rules: read-only denies bash and blocks every script. A pure script cannot use a browser grant. update: the whole new set, only when the permissions change'),
@@ -92845,7 +93118,7 @@ function browserGrant(host, proposed) {
92845
93118
  if (entries2.length === 0) {
92846
93119
  return {
92847
93120
  ok: false,
92848
- error: 'permissions.browser.sites is empty; list each site the run may open, e.g. {"https://github.com": "read"}.'
93121
+ error: 'permissions.browser.sites is empty; list each site the run may open, e.g. {"https://example.com": "read"}.'
92849
93122
  };
92850
93123
  }
92851
93124
  const sites = {};
@@ -93539,6 +93812,7 @@ export {
93539
93812
  generateTopicId,
93540
93813
  generateTurnId,
93541
93814
  generateSessionId,
93815
+ generateTaskId,
93542
93816
  generateTenantId,
93543
93817
  generateWorkspaceId,
93544
93818
  generateSummaryId,
@@ -93655,6 +93929,7 @@ export {
93655
93929
  selectTaskContext,
93656
93930
  buildTaskTools,
93657
93931
  isCompactionMessage,
93932
+ COMPACTION_RECOVERY_NOTE,
93658
93933
  PLAN_MODE_REFUSAL,
93659
93934
  toToolSourceRef,
93660
93935
  ToolManager,
@@ -93693,6 +93968,7 @@ export {
93693
93968
  withProviderFallback,
93694
93969
  buildProbeContext,
93695
93970
  probe,
93971
+ SessionEvidenceOffsetError,
93696
93972
  createSessionTextEvidenceSource,
93697
93973
  createSessionEvidenceSource,
93698
93974
  NamzuHomeError,
@@ -93865,4 +94141,4 @@ export {
93865
94141
  buildResidentToolEvidenceTools,
93866
94142
  createPalMessagingTools
93867
94143
  };
93868
- //# sourceMappingURL=chunk-FTZT4UAB.js.map
94144
+ //# sourceMappingURL=chunk-OPIC6ZIL.js.map