@namzu/cli 42.0.0 → 44.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (412) hide show
  1. package/CHANGELOG.md +132 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/chunks/{acp-ADQ2PRAY.js → acp-3D2PPXYC.js} +39 -38
  4. package/dist/chunks/acp-3D2PPXYC.js.map +6 -0
  5. package/dist/chunks/{activity-command-JROQLBPA.js → activity-command-WE45L6EF.js} +12 -12
  6. package/dist/chunks/{add-ILLLF6YP.js → add-RLDOB23V.js} +14 -14
  7. package/dist/chunks/{agent-YQI5KOPV.js → agent-VXVUHPUF.js} +30 -29
  8. package/dist/chunks/agent-session-HLH4P7W4.js +59 -0
  9. package/dist/chunks/{archive-55KJKGJB.js → archive-M5SZWEBT.js} +10 -10
  10. package/dist/chunks/{bin-main-332F5KRZ.js → bin-main-HCAGOSEJ.js} +4 -4
  11. package/dist/chunks/{browser-C6AOJ3CH.js → browser-GO5REABI.js} +6 -6
  12. package/dist/chunks/{chat-45H5F3KI.js → chat-ZV3OQQRQ.js} +15 -15
  13. package/dist/chunks/{chunk-6GBZAUYW.js → chunk-2343E2J7.js} +2 -2
  14. package/dist/chunks/{chunk-4TS6ZPOZ.js → chunk-26VFNQCY.js} +3 -3
  15. package/dist/chunks/{chunk-GOGBOZKO.js → chunk-2AUFXSKS.js} +254 -21
  16. package/dist/chunks/chunk-2AUFXSKS.js.map +6 -0
  17. package/dist/chunks/{chunk-A4CKLHKM.js → chunk-2QWVT55W.js} +441 -88
  18. package/dist/chunks/chunk-2QWVT55W.js.map +6 -0
  19. package/dist/chunks/{chunk-XXUL6HHM.js → chunk-3IPE4LDE.js} +2 -2
  20. package/dist/chunks/{chunk-QRGO6R2O.js → chunk-3J4ALTG2.js} +6 -4
  21. package/dist/chunks/chunk-3J4ALTG2.js.map +6 -0
  22. package/dist/chunks/{chunk-L3QW53QL.js → chunk-3PSNEUBW.js} +7 -7
  23. package/dist/chunks/{chunk-YM4DUQ3P.js → chunk-44OG65HR.js} +3 -3
  24. package/dist/chunks/{chunk-AZPS37AQ.js → chunk-4C6462L3.js} +2 -2
  25. package/dist/chunks/{chunk-YPHXWFKQ.js → chunk-4NBV2LZS.js} +2 -2
  26. package/dist/chunks/{chunk-RVSVVL6O.js → chunk-4PSNBASI.js} +3 -3
  27. package/dist/chunks/{chunk-HO2ZUI5Y.js → chunk-4TBPO43I.js} +2 -2
  28. package/dist/chunks/{chunk-URJ7TITR.js → chunk-5OVJ2ZCX.js} +8 -8
  29. package/dist/chunks/{chunk-HXAWIWOZ.js → chunk-5WHSDJCC.js} +2 -2
  30. package/dist/chunks/{chunk-EWSIGY2A.js → chunk-5WJAAPVQ.js} +3 -3
  31. package/dist/chunks/{chunk-BDLDDNNO.js → chunk-5WJXI4JR.js} +2 -2
  32. package/dist/chunks/{chunk-Y3I7AAD6.js → chunk-6LLUYDBO.js} +4 -4
  33. package/dist/chunks/{chunk-FSKJ3EZC.js → chunk-7M6ZU2NT.js} +2 -2
  34. package/dist/chunks/{chunk-Y74CPWYC.js → chunk-7QFW6TV7.js} +49 -23
  35. package/dist/chunks/chunk-7QFW6TV7.js.map +6 -0
  36. package/dist/chunks/{chunk-W2PJ6ZHY.js → chunk-7S2H77Y7.js} +3 -3
  37. package/dist/chunks/{chunk-CW2N2QS2.js → chunk-AN3DBA6N.js} +4 -4
  38. package/dist/chunks/chunk-ARCMOPO3.js +157 -0
  39. package/dist/chunks/chunk-ARCMOPO3.js.map +6 -0
  40. package/dist/chunks/{chunk-FMEGRBJP.js → chunk-AX7KHJVF.js} +2 -2
  41. package/dist/chunks/{chunk-XMOKHCPV.js → chunk-B6QM5F2E.js} +87 -39
  42. package/dist/chunks/chunk-B6QM5F2E.js.map +6 -0
  43. package/dist/chunks/{chunk-XGVCAMNT.js → chunk-CC2HK5I5.js} +2 -2
  44. package/dist/chunks/{chunk-4IIEEOCA.js → chunk-CECVIOY5.js} +3 -3
  45. package/dist/chunks/{chunk-QWBR6FBY.js → chunk-CLXRRUDH.js} +149 -17
  46. package/dist/chunks/chunk-CLXRRUDH.js.map +6 -0
  47. package/dist/chunks/{chunk-N4OY22M2.js → chunk-CQC6GJQE.js} +2 -2
  48. package/dist/chunks/{chunk-DLL2FPUY.js → chunk-DU27LH3W.js} +2 -2
  49. package/dist/chunks/{chunk-Y2DZ27P6.js → chunk-DW3ML3PZ.js} +4 -4
  50. package/dist/chunks/{chunk-RGVJHSMU.js → chunk-E2F7P6GI.js} +2 -2
  51. package/dist/chunks/{chunk-23NRJ2RC.js → chunk-FVYKDRVT.js} +5 -5
  52. package/dist/chunks/{chunk-JD2HLKFO.js → chunk-G7D7FNRZ.js} +2 -2
  53. package/dist/chunks/{chunk-HOY7BUGW.js → chunk-GLCZ7227.js} +207 -8
  54. package/dist/chunks/chunk-GLCZ7227.js.map +6 -0
  55. package/dist/chunks/{chunk-N56FVHCU.js → chunk-GQ6ZQA7C.js} +2 -2
  56. package/dist/chunks/{chunk-7E3V7NNN.js → chunk-GYW5IJ5R.js} +75586 -73631
  57. package/dist/chunks/chunk-GYW5IJ5R.js.map +6 -0
  58. package/dist/chunks/{chunk-YP7AINGL.js → chunk-HOWIEIPK.js} +9 -9
  59. package/dist/chunks/{chunk-FTMTO72X.js → chunk-HSEIISLI.js} +2 -1
  60. package/dist/chunks/{chunk-WHOSI6UQ.js → chunk-I7HAYS6Z.js} +15 -3
  61. package/dist/chunks/chunk-I7HAYS6Z.js.map +6 -0
  62. package/dist/chunks/{chunk-F6WVRMVY.js → chunk-J6LQJ3H4.js} +1610 -488
  63. package/dist/chunks/chunk-J6LQJ3H4.js.map +6 -0
  64. package/dist/chunks/{chunk-ESZ7X37S.js → chunk-JLZP3PRV.js} +4 -4
  65. package/dist/chunks/{chunk-6S4R2USK.js → chunk-JWFCCQGM.js} +6 -5
  66. package/dist/chunks/chunk-JWFCCQGM.js.map +6 -0
  67. package/dist/chunks/{chunk-A3AF5WXZ.js → chunk-LAAQCLVV.js} +6 -6
  68. package/dist/chunks/{chunk-K6LLMOB2.js → chunk-LC4R7FEV.js} +2 -2
  69. package/dist/chunks/{chunk-SIWZZF4M.js → chunk-LEVQANRZ.js} +15 -15
  70. package/dist/chunks/chunk-LEVQANRZ.js.map +6 -0
  71. package/dist/chunks/{chunk-HQZ3GBQI.js → chunk-LYI2HXN4.js} +6 -6
  72. package/dist/chunks/{chunk-S4KDR6G5.js → chunk-ON4RSB2L.js} +4 -4
  73. package/dist/chunks/{chunk-IQQ6TY4W.js → chunk-OQMQL3WF.js} +3 -3
  74. package/dist/chunks/{chunk-YVIM3MXU.js → chunk-PAB3MJVU.js} +2 -2
  75. package/dist/chunks/{chunk-HOIDWHGC.js → chunk-PLYCCNXW.js} +6 -6
  76. package/dist/chunks/{chunk-6PNBIMWH.js → chunk-PYMCT4ZA.js} +3 -3
  77. package/dist/chunks/{chunk-R2LYGFCI.js → chunk-Q7NNEWMZ.js} +4 -4
  78. package/dist/chunks/{chunk-3LNTQLQ4.js → chunk-QRC4LSKT.js} +7 -7
  79. package/dist/chunks/{chunk-BRKD6FMO.js → chunk-QXRLKALD.js} +2 -2
  80. package/dist/chunks/{chunk-XCMCPWMB.js → chunk-R4MQECAY.js} +4 -4
  81. package/dist/chunks/{chunk-M46GKTOI.js → chunk-R7IUMUGJ.js} +2 -2
  82. package/dist/chunks/{chunk-N3C5X6BW.js → chunk-SLVAGDHU.js} +5 -5
  83. package/dist/chunks/{chunk-SRYIMLOK.js → chunk-UFSCA2XZ.js} +2 -2
  84. package/dist/chunks/{chunk-6LVWHXT6.js → chunk-UQKTVCUV.js} +8 -8
  85. package/dist/chunks/{chunk-QT6KYBCC.js → chunk-USAZW2SV.js} +3 -3
  86. package/dist/chunks/{chunk-TW5BCDA5.js → chunk-V3P5BZE4.js} +3 -3
  87. package/dist/chunks/{chunk-JXT47VT6.js → chunk-VESQFRF3.js} +821 -33
  88. package/dist/chunks/chunk-VESQFRF3.js.map +6 -0
  89. package/dist/chunks/{chunk-35VTE7V5.js → chunk-VHS5I4HA.js} +2 -2
  90. package/dist/chunks/{chunk-5XWMKWQQ.js → chunk-W4B3XGK5.js} +45 -3
  91. package/dist/chunks/chunk-W4B3XGK5.js.map +6 -0
  92. package/dist/chunks/{chunk-J4IES4SO.js → chunk-WALXUBIZ.js} +2 -2
  93. package/dist/chunks/{chunk-QUELENQP.js → chunk-WPECMU3F.js} +4 -4
  94. package/dist/chunks/{chunk-SNC5D5UG.js → chunk-XS2JWCGM.js} +13 -13
  95. package/dist/chunks/{chunk-4NO5XFK2.js → chunk-YV227DWZ.js} +2 -2
  96. package/dist/chunks/cli-runtime-35A3RAU6.js +337 -0
  97. package/dist/chunks/cli-runtime-35A3RAU6.js.map +6 -0
  98. package/dist/chunks/{commands-JZT6JJY5.js → commands-OWQUB7JT.js} +5 -5
  99. package/dist/chunks/{crash-report-TWMWHNKY.js → crash-report-KDMLQRS6.js} +6 -6
  100. package/dist/chunks/{dist-AZ5T257L.js → dist-4LKH4B3B.js} +4 -3
  101. package/dist/chunks/dist-4LKH4B3B.js.map +6 -0
  102. package/dist/chunks/{dist-POSMI3PI.js → dist-5A3XKURK.js} +2 -2
  103. package/dist/chunks/{dist-CLKFY67B.js → dist-FURVCE4N.js} +2 -2
  104. package/dist/chunks/{dist-4EGZFRWY.js → dist-RS5H5LHE.js} +2 -2
  105. package/dist/chunks/{dist-6ORFQIRV.js → dist-VKC2OF2P.js} +2 -2
  106. package/dist/chunks/{dist-K5JIOWIQ.js → dist-WPETBMRE.js} +2 -2
  107. package/dist/chunks/{dist-MVLQAON2.js → dist-XFPIH4KV.js} +2 -2
  108. package/dist/chunks/{doctor-UVZBNUNF.js → doctor-ZDM3LGPR.js} +13 -13
  109. package/dist/chunks/{drain-27E6XUNK.js → drain-BCDD6WT4.js} +10 -10
  110. package/dist/chunks/{eval-NRRIWDET.js → eval-CWHRB4CM.js} +2 -2
  111. package/dist/chunks/{exec-KX46LZ36.js → exec-ZL7XCVPV.js} +290 -88
  112. package/dist/chunks/exec-ZL7XCVPV.js.map +6 -0
  113. package/dist/chunks/github-FH7PPWVW.js +347 -0
  114. package/dist/chunks/github-FH7PPWVW.js.map +6 -0
  115. package/dist/chunks/{home-RT2I6VTQ.js → home-B3DTR4JZ.js} +3 -3
  116. package/dist/chunks/{host-queries-ZXGOA6ZL.js → host-queries-RIHABSRA.js} +15 -15
  117. package/dist/chunks/{learn-5KKZ4ZFX.js → learn-FVDHNZ3E.js} +13 -13
  118. package/dist/chunks/{learn-builtin-MSUF4MEJ.js → learn-builtin-DIGVMU2K.js} +16 -16
  119. package/dist/chunks/{lifecycle-TZU6D46R.js → lifecycle-T5KZCOME.js} +23 -23
  120. package/dist/chunks/{list-QCWNMQED.js → list-ALYIIETE.js} +10 -10
  121. package/dist/chunks/{live-V7HRF5KR.js → live-QYXRKG27.js} +12 -12
  122. package/dist/chunks/{login-QFP3PIXG.js → login-YYDHSXYZ.js} +8 -8
  123. package/dist/chunks/{logs-XTXMS4JF.js → logs-HGYW5QG6.js} +4 -4
  124. package/dist/chunks/{mcp-WQFJJ4NO.js → mcp-DXCRUYBA.js} +15 -15
  125. package/dist/chunks/{message-command-QVNUJN47.js → message-command-7A2FC7PW.js} +36 -35
  126. package/dist/chunks/message-command-7A2FC7PW.js.map +6 -0
  127. package/dist/chunks/{operator-tools-2OYRNPCH.js → operator-tools-HM2DKEA3.js} +13 -13
  128. package/dist/chunks/{output-schema-ETVPLUXE.js → output-schema-S4OZKHPX.js} +3 -3
  129. package/dist/chunks/{pal-BYFZCLE2.js → pal-PISV32OY.js} +11 -11
  130. package/dist/chunks/{plain-report-73WHPLHX.js → plain-report-IOYN4O6N.js} +10 -2
  131. package/dist/chunks/{plain-report-73WHPLHX.js.map → plain-report-IOYN4O6N.js.map} +2 -2
  132. package/dist/chunks/{providers-KP5JHTTK.js → providers-UCHYI3MC.js} +6 -6
  133. package/dist/chunks/{resident-BROBTK35.js → resident-Y3WMPAB4.js} +24 -24
  134. package/dist/chunks/{resident-BROBTK35.js.map → resident-Y3WMPAB4.js.map} +1 -1
  135. package/dist/chunks/resume-PM73RFB2.js +23 -0
  136. package/dist/chunks/{resume-command-OKJ2MJPB.js → resume-command-TNYIW6PZ.js} +4 -4
  137. package/dist/chunks/{schedule-TVR3FE32.js → schedule-PPTJ3BJ7.js} +8 -8
  138. package/dist/chunks/{service-6A3TOQKV.js → service-OMRDQOPM.js} +22 -22
  139. package/dist/chunks/{session-step-N4GHA2YE.js → session-step-C54ZEOLL.js} +16 -16
  140. package/dist/chunks/{skills-WXYSPDKL.js → skills-CNZMMJFB.js} +8 -8
  141. package/dist/chunks/{start-check-BUCN5MCU.js → start-check-H4GSB34J.js} +2 -2
  142. package/dist/chunks/{state-PVAVIXHK.js → state-VEYKYIIF.js} +2 -2
  143. package/dist/chunks/{store-O3KC2PPZ.js → store-BGVZ7PVQ.js} +4 -4
  144. package/dist/chunks/{store-NB3KR4XA.js → store-FW3TZA4K.js} +14 -10
  145. package/dist/chunks/{store-D3XUEEAF.js → store-S3M6B7JR.js} +6 -6
  146. package/dist/chunks/{tui-2XOSCALL.js → tui-XJNDU54J.js} +1797 -875
  147. package/dist/chunks/tui-XJNDU54J.js.map +6 -0
  148. package/dist/chunks/{upgrade-FY5ULZQF.js → upgrade-XRCA3O4X.js} +6 -6
  149. package/dist/chunks/{worktree-MVW62U5G.js → worktree-C6G5PFNW.js} +12 -12
  150. package/dist/cli-runtime.d.ts +2 -0
  151. package/dist/cli-runtime.d.ts.map +1 -1
  152. package/dist/cli.d.ts.map +1 -1
  153. package/dist/commands/desktop-host.d.ts +3 -0
  154. package/dist/commands/desktop-host.d.ts.map +1 -1
  155. package/dist/commands/exec-flags.d.ts +14 -0
  156. package/dist/commands/exec-flags.d.ts.map +1 -1
  157. package/dist/commands/exec-json.d.ts +8 -1
  158. package/dist/commands/exec-json.d.ts.map +1 -1
  159. package/dist/commands/exec.d.ts.map +1 -1
  160. package/dist/commands/github.d.ts +20 -0
  161. package/dist/commands/github.d.ts.map +1 -0
  162. package/dist/commands/manifest.d.ts +1 -0
  163. package/dist/commands/manifest.d.ts.map +1 -1
  164. package/dist/commands/resident-flags.d.ts.map +1 -1
  165. package/dist/commands/resume.d.ts +4 -0
  166. package/dist/commands/resume.d.ts.map +1 -1
  167. package/dist/commands/stream-input.d.ts +4 -0
  168. package/dist/commands/stream-input.d.ts.map +1 -0
  169. package/dist/config/load.d.ts.map +1 -1
  170. package/dist/config/schema.d.ts +28 -2
  171. package/dist/config/schema.d.ts.map +1 -1
  172. package/dist/context/environment.d.ts +17 -4
  173. package/dist/context/environment.d.ts.map +1 -1
  174. package/dist/context/system-prompt.d.ts +2 -2
  175. package/dist/context/system-prompt.d.ts.map +1 -1
  176. package/dist/index.js +16 -16
  177. package/dist/integrations/github/pull-request.d.ts +64 -0
  178. package/dist/integrations/github/pull-request.d.ts.map +1 -0
  179. package/dist/integrations/github/workflows.d.ts +49 -0
  180. package/dist/integrations/github/workflows.d.ts.map +1 -0
  181. package/dist/integrations/mcp/elicitation.d.ts +40 -0
  182. package/dist/integrations/mcp/elicitation.d.ts.map +1 -0
  183. package/dist/integrations/mcp/output.d.ts +9 -0
  184. package/dist/integrations/mcp/output.d.ts.map +1 -0
  185. package/dist/integrations/mcp/person-commands.d.ts +18 -0
  186. package/dist/integrations/mcp/person-commands.d.ts.map +1 -0
  187. package/dist/integrations/mcp/person-session.d.ts +15 -0
  188. package/dist/integrations/mcp/person-session.d.ts.map +1 -0
  189. package/dist/integrations/mcp/prompts.d.ts +18 -0
  190. package/dist/integrations/mcp/prompts.d.ts.map +1 -0
  191. package/dist/integrations/mcp/servers.d.ts +70 -3
  192. package/dist/integrations/mcp/servers.d.ts.map +1 -1
  193. package/dist/integrations/peers/runtime.d.ts.map +1 -1
  194. package/dist/integrations/plugins/files.d.ts +43 -0
  195. package/dist/integrations/plugins/files.d.ts.map +1 -0
  196. package/dist/integrations/plugins/runtime.d.ts +5 -1
  197. package/dist/integrations/plugins/runtime.d.ts.map +1 -1
  198. package/dist/integrations/resident/runner-worker.js +21 -21
  199. package/dist/integrations/resident/session-step.d.ts.map +1 -1
  200. package/dist/integrations/sessions/side-question.d.ts +46 -0
  201. package/dist/integrations/sessions/side-question.d.ts.map +1 -0
  202. package/dist/integrations/sessions/store.d.ts +23 -1
  203. package/dist/integrations/sessions/store.d.ts.map +1 -1
  204. package/dist/integrations/small-model/side-model.d.ts +13 -0
  205. package/dist/integrations/small-model/side-model.d.ts.map +1 -1
  206. package/dist/integrations/subagents/activity.d.ts.map +1 -1
  207. package/dist/integrations/subagents/agent-names.d.ts +21 -0
  208. package/dist/integrations/subagents/agent-names.d.ts.map +1 -0
  209. package/dist/integrations/subagents/definitions.d.ts +24 -2
  210. package/dist/integrations/subagents/definitions.d.ts.map +1 -1
  211. package/dist/integrations/subagents/failure-words.d.ts +2 -0
  212. package/dist/integrations/subagents/failure-words.d.ts.map +1 -0
  213. package/dist/integrations/subagents/fork.d.ts +29 -0
  214. package/dist/integrations/subagents/fork.d.ts.map +1 -0
  215. package/dist/integrations/subagents/runtime.d.ts +21 -0
  216. package/dist/integrations/subagents/runtime.d.ts.map +1 -1
  217. package/dist/integrations/telemetry/otlp-export.d.ts +67 -0
  218. package/dist/integrations/telemetry/otlp-export.d.ts.map +1 -0
  219. package/dist/permissions/auto-classifier.d.ts +12 -1
  220. package/dist/permissions/auto-classifier.d.ts.map +1 -1
  221. package/dist/permissions/delegated-mode.d.ts +25 -0
  222. package/dist/permissions/delegated-mode.d.ts.map +1 -0
  223. package/dist/permissions/live-mode.d.ts +5 -0
  224. package/dist/permissions/live-mode.d.ts.map +1 -1
  225. package/dist/permissions/live-rules.d.ts +12 -0
  226. package/dist/permissions/live-rules.d.ts.map +1 -0
  227. package/dist/permissions/path-rules.d.ts +43 -0
  228. package/dist/permissions/path-rules.d.ts.map +1 -0
  229. package/dist/permissions/rule-screen.d.ts +36 -0
  230. package/dist/permissions/rule-screen.d.ts.map +1 -0
  231. package/dist/permissions/rule-strings.d.ts +50 -0
  232. package/dist/permissions/rule-strings.d.ts.map +1 -0
  233. package/dist/permissions/rules.d.ts +7 -2
  234. package/dist/permissions/rules.d.ts.map +1 -1
  235. package/dist/permissions/session-allow.d.ts +2 -0
  236. package/dist/permissions/session-allow.d.ts.map +1 -1
  237. package/dist/reminders/changed-files.d.ts +24 -0
  238. package/dist/reminders/changed-files.d.ts.map +1 -0
  239. package/dist/reminders/frame.d.ts +1 -1
  240. package/dist/reminders/frame.d.ts.map +1 -1
  241. package/dist/reminders/index.d.ts +30 -0
  242. package/dist/reminders/index.d.ts.map +1 -1
  243. package/dist/reminders/mcp-instructions.d.ts +27 -0
  244. package/dist/reminders/mcp-instructions.d.ts.map +1 -0
  245. package/dist/reminders/memory-index.d.ts +28 -0
  246. package/dist/reminders/memory-index.d.ts.map +1 -0
  247. package/dist/reminders/model.d.ts +9 -0
  248. package/dist/reminders/model.d.ts.map +1 -0
  249. package/dist/reminders/skills.d.ts +27 -0
  250. package/dist/reminders/skills.d.ts.map +1 -0
  251. package/dist/skills/catalog.d.ts.map +1 -1
  252. package/dist/skills/store.d.ts.map +1 -1
  253. package/dist/tui/App.d.ts +2 -0
  254. package/dist/tui/App.d.ts.map +1 -1
  255. package/dist/tui/Composer.d.ts +17 -4
  256. package/dist/tui/Composer.d.ts.map +1 -1
  257. package/dist/tui/LiveActivity.d.ts.map +1 -1
  258. package/dist/tui/ResumePicker.d.ts.map +1 -1
  259. package/dist/tui/agent.d.ts +42 -1
  260. package/dist/tui/agent.d.ts.map +1 -1
  261. package/dist/tui/composer-undo.d.ts +31 -0
  262. package/dist/tui/composer-undo.d.ts.map +1 -0
  263. package/dist/tui/external-editor.d.ts +5 -1
  264. package/dist/tui/external-editor.d.ts.map +1 -1
  265. package/dist/tui/keymap.d.ts +152 -0
  266. package/dist/tui/keymap.d.ts.map +1 -0
  267. package/dist/tui/mention-file.d.ts +10 -0
  268. package/dist/tui/mention-file.d.ts.map +1 -0
  269. package/dist/tui/mention-sources.d.ts +31 -0
  270. package/dist/tui/mention-sources.d.ts.map +1 -0
  271. package/dist/tui/mentions.d.ts +55 -1
  272. package/dist/tui/mentions.d.ts.map +1 -1
  273. package/dist/tui/plugin-view.d.ts.map +1 -1
  274. package/dist/tui/resume-empty.d.ts +7 -0
  275. package/dist/tui/resume-empty.d.ts.map +1 -1
  276. package/dist/tui/resume-picker-state.d.ts +3 -0
  277. package/dist/tui/resume-picker-state.d.ts.map +1 -1
  278. package/dist/tui/self-mending-pause-row.d.ts +17 -0
  279. package/dist/tui/self-mending-pause-row.d.ts.map +1 -0
  280. package/dist/tui/slashCommands.d.ts +18 -0
  281. package/dist/tui/slashCommands.d.ts.map +1 -1
  282. package/dist/tui/thinking-label.d.ts +24 -0
  283. package/dist/tui/thinking-label.d.ts.map +1 -0
  284. package/dist/tui/tool-server-rows.d.ts +23 -0
  285. package/dist/tui/tool-server-rows.d.ts.map +1 -0
  286. package/dist/tui/types.d.ts +4 -0
  287. package/dist/tui/types.d.ts.map +1 -1
  288. package/dist/user-commands/store.d.ts +10 -1
  289. package/dist/user-commands/store.d.ts.map +1 -1
  290. package/package.json +6 -5
  291. package/dist/chunks/acp-ADQ2PRAY.js.map +0 -6
  292. package/dist/chunks/agent-session-3MUZCWQ4.js +0 -58
  293. package/dist/chunks/chunk-5XWMKWQQ.js.map +0 -6
  294. package/dist/chunks/chunk-6S4R2USK.js.map +0 -6
  295. package/dist/chunks/chunk-7E3V7NNN.js.map +0 -6
  296. package/dist/chunks/chunk-A4CKLHKM.js.map +0 -6
  297. package/dist/chunks/chunk-F6WVRMVY.js.map +0 -6
  298. package/dist/chunks/chunk-GOGBOZKO.js.map +0 -6
  299. package/dist/chunks/chunk-HOY7BUGW.js.map +0 -6
  300. package/dist/chunks/chunk-JXT47VT6.js.map +0 -6
  301. package/dist/chunks/chunk-QRGO6R2O.js.map +0 -6
  302. package/dist/chunks/chunk-QWBR6FBY.js.map +0 -6
  303. package/dist/chunks/chunk-SIWZZF4M.js.map +0 -6
  304. package/dist/chunks/chunk-WHOSI6UQ.js.map +0 -6
  305. package/dist/chunks/chunk-XMOKHCPV.js.map +0 -6
  306. package/dist/chunks/chunk-Y74CPWYC.js.map +0 -6
  307. package/dist/chunks/cli-runtime-HW6GQKC6.js +0 -186
  308. package/dist/chunks/cli-runtime-HW6GQKC6.js.map +0 -6
  309. package/dist/chunks/dist-AZ5T257L.js.map +0 -6
  310. package/dist/chunks/exec-KX46LZ36.js.map +0 -6
  311. package/dist/chunks/message-command-QVNUJN47.js.map +0 -6
  312. package/dist/chunks/resume-7V44GSEU.js +0 -23
  313. package/dist/chunks/tui-2XOSCALL.js.map +0 -6
  314. /package/dist/chunks/{activity-command-JROQLBPA.js.map → activity-command-WE45L6EF.js.map} +0 -0
  315. /package/dist/chunks/{add-ILLLF6YP.js.map → add-RLDOB23V.js.map} +0 -0
  316. /package/dist/chunks/{agent-YQI5KOPV.js.map → agent-VXVUHPUF.js.map} +0 -0
  317. /package/dist/chunks/{agent-session-3MUZCWQ4.js.map → agent-session-HLH4P7W4.js.map} +0 -0
  318. /package/dist/chunks/{archive-55KJKGJB.js.map → archive-M5SZWEBT.js.map} +0 -0
  319. /package/dist/chunks/{bin-main-332F5KRZ.js.map → bin-main-HCAGOSEJ.js.map} +0 -0
  320. /package/dist/chunks/{browser-C6AOJ3CH.js.map → browser-GO5REABI.js.map} +0 -0
  321. /package/dist/chunks/{chat-45H5F3KI.js.map → chat-ZV3OQQRQ.js.map} +0 -0
  322. /package/dist/chunks/{chunk-6GBZAUYW.js.map → chunk-2343E2J7.js.map} +0 -0
  323. /package/dist/chunks/{chunk-4TS6ZPOZ.js.map → chunk-26VFNQCY.js.map} +0 -0
  324. /package/dist/chunks/{chunk-XXUL6HHM.js.map → chunk-3IPE4LDE.js.map} +0 -0
  325. /package/dist/chunks/{chunk-L3QW53QL.js.map → chunk-3PSNEUBW.js.map} +0 -0
  326. /package/dist/chunks/{chunk-YM4DUQ3P.js.map → chunk-44OG65HR.js.map} +0 -0
  327. /package/dist/chunks/{chunk-AZPS37AQ.js.map → chunk-4C6462L3.js.map} +0 -0
  328. /package/dist/chunks/{chunk-YPHXWFKQ.js.map → chunk-4NBV2LZS.js.map} +0 -0
  329. /package/dist/chunks/{chunk-RVSVVL6O.js.map → chunk-4PSNBASI.js.map} +0 -0
  330. /package/dist/chunks/{chunk-HO2ZUI5Y.js.map → chunk-4TBPO43I.js.map} +0 -0
  331. /package/dist/chunks/{chunk-URJ7TITR.js.map → chunk-5OVJ2ZCX.js.map} +0 -0
  332. /package/dist/chunks/{chunk-HXAWIWOZ.js.map → chunk-5WHSDJCC.js.map} +0 -0
  333. /package/dist/chunks/{chunk-EWSIGY2A.js.map → chunk-5WJAAPVQ.js.map} +0 -0
  334. /package/dist/chunks/{chunk-BDLDDNNO.js.map → chunk-5WJXI4JR.js.map} +0 -0
  335. /package/dist/chunks/{chunk-Y3I7AAD6.js.map → chunk-6LLUYDBO.js.map} +0 -0
  336. /package/dist/chunks/{chunk-FSKJ3EZC.js.map → chunk-7M6ZU2NT.js.map} +0 -0
  337. /package/dist/chunks/{chunk-W2PJ6ZHY.js.map → chunk-7S2H77Y7.js.map} +0 -0
  338. /package/dist/chunks/{chunk-CW2N2QS2.js.map → chunk-AN3DBA6N.js.map} +0 -0
  339. /package/dist/chunks/{chunk-FMEGRBJP.js.map → chunk-AX7KHJVF.js.map} +0 -0
  340. /package/dist/chunks/{chunk-XGVCAMNT.js.map → chunk-CC2HK5I5.js.map} +0 -0
  341. /package/dist/chunks/{chunk-4IIEEOCA.js.map → chunk-CECVIOY5.js.map} +0 -0
  342. /package/dist/chunks/{chunk-N4OY22M2.js.map → chunk-CQC6GJQE.js.map} +0 -0
  343. /package/dist/chunks/{chunk-DLL2FPUY.js.map → chunk-DU27LH3W.js.map} +0 -0
  344. /package/dist/chunks/{chunk-Y2DZ27P6.js.map → chunk-DW3ML3PZ.js.map} +0 -0
  345. /package/dist/chunks/{chunk-RGVJHSMU.js.map → chunk-E2F7P6GI.js.map} +0 -0
  346. /package/dist/chunks/{chunk-23NRJ2RC.js.map → chunk-FVYKDRVT.js.map} +0 -0
  347. /package/dist/chunks/{chunk-JD2HLKFO.js.map → chunk-G7D7FNRZ.js.map} +0 -0
  348. /package/dist/chunks/{chunk-N56FVHCU.js.map → chunk-GQ6ZQA7C.js.map} +0 -0
  349. /package/dist/chunks/{chunk-YP7AINGL.js.map → chunk-HOWIEIPK.js.map} +0 -0
  350. /package/dist/chunks/{chunk-FTMTO72X.js.map → chunk-HSEIISLI.js.map} +0 -0
  351. /package/dist/chunks/{chunk-ESZ7X37S.js.map → chunk-JLZP3PRV.js.map} +0 -0
  352. /package/dist/chunks/{chunk-A3AF5WXZ.js.map → chunk-LAAQCLVV.js.map} +0 -0
  353. /package/dist/chunks/{chunk-K6LLMOB2.js.map → chunk-LC4R7FEV.js.map} +0 -0
  354. /package/dist/chunks/{chunk-HQZ3GBQI.js.map → chunk-LYI2HXN4.js.map} +0 -0
  355. /package/dist/chunks/{chunk-S4KDR6G5.js.map → chunk-ON4RSB2L.js.map} +0 -0
  356. /package/dist/chunks/{chunk-IQQ6TY4W.js.map → chunk-OQMQL3WF.js.map} +0 -0
  357. /package/dist/chunks/{chunk-YVIM3MXU.js.map → chunk-PAB3MJVU.js.map} +0 -0
  358. /package/dist/chunks/{chunk-HOIDWHGC.js.map → chunk-PLYCCNXW.js.map} +0 -0
  359. /package/dist/chunks/{chunk-6PNBIMWH.js.map → chunk-PYMCT4ZA.js.map} +0 -0
  360. /package/dist/chunks/{chunk-R2LYGFCI.js.map → chunk-Q7NNEWMZ.js.map} +0 -0
  361. /package/dist/chunks/{chunk-3LNTQLQ4.js.map → chunk-QRC4LSKT.js.map} +0 -0
  362. /package/dist/chunks/{chunk-BRKD6FMO.js.map → chunk-QXRLKALD.js.map} +0 -0
  363. /package/dist/chunks/{chunk-XCMCPWMB.js.map → chunk-R4MQECAY.js.map} +0 -0
  364. /package/dist/chunks/{chunk-M46GKTOI.js.map → chunk-R7IUMUGJ.js.map} +0 -0
  365. /package/dist/chunks/{chunk-N3C5X6BW.js.map → chunk-SLVAGDHU.js.map} +0 -0
  366. /package/dist/chunks/{chunk-SRYIMLOK.js.map → chunk-UFSCA2XZ.js.map} +0 -0
  367. /package/dist/chunks/{chunk-6LVWHXT6.js.map → chunk-UQKTVCUV.js.map} +0 -0
  368. /package/dist/chunks/{chunk-QT6KYBCC.js.map → chunk-USAZW2SV.js.map} +0 -0
  369. /package/dist/chunks/{chunk-TW5BCDA5.js.map → chunk-V3P5BZE4.js.map} +0 -0
  370. /package/dist/chunks/{chunk-35VTE7V5.js.map → chunk-VHS5I4HA.js.map} +0 -0
  371. /package/dist/chunks/{chunk-J4IES4SO.js.map → chunk-WALXUBIZ.js.map} +0 -0
  372. /package/dist/chunks/{chunk-QUELENQP.js.map → chunk-WPECMU3F.js.map} +0 -0
  373. /package/dist/chunks/{chunk-SNC5D5UG.js.map → chunk-XS2JWCGM.js.map} +0 -0
  374. /package/dist/chunks/{chunk-4NO5XFK2.js.map → chunk-YV227DWZ.js.map} +0 -0
  375. /package/dist/chunks/{commands-JZT6JJY5.js.map → commands-OWQUB7JT.js.map} +0 -0
  376. /package/dist/chunks/{crash-report-TWMWHNKY.js.map → crash-report-KDMLQRS6.js.map} +0 -0
  377. /package/dist/chunks/{dist-POSMI3PI.js.map → dist-5A3XKURK.js.map} +0 -0
  378. /package/dist/chunks/{dist-CLKFY67B.js.map → dist-FURVCE4N.js.map} +0 -0
  379. /package/dist/chunks/{dist-4EGZFRWY.js.map → dist-RS5H5LHE.js.map} +0 -0
  380. /package/dist/chunks/{dist-6ORFQIRV.js.map → dist-VKC2OF2P.js.map} +0 -0
  381. /package/dist/chunks/{dist-K5JIOWIQ.js.map → dist-WPETBMRE.js.map} +0 -0
  382. /package/dist/chunks/{dist-MVLQAON2.js.map → dist-XFPIH4KV.js.map} +0 -0
  383. /package/dist/chunks/{doctor-UVZBNUNF.js.map → doctor-ZDM3LGPR.js.map} +0 -0
  384. /package/dist/chunks/{drain-27E6XUNK.js.map → drain-BCDD6WT4.js.map} +0 -0
  385. /package/dist/chunks/{eval-NRRIWDET.js.map → eval-CWHRB4CM.js.map} +0 -0
  386. /package/dist/chunks/{home-RT2I6VTQ.js.map → home-B3DTR4JZ.js.map} +0 -0
  387. /package/dist/chunks/{host-queries-ZXGOA6ZL.js.map → host-queries-RIHABSRA.js.map} +0 -0
  388. /package/dist/chunks/{learn-5KKZ4ZFX.js.map → learn-FVDHNZ3E.js.map} +0 -0
  389. /package/dist/chunks/{learn-builtin-MSUF4MEJ.js.map → learn-builtin-DIGVMU2K.js.map} +0 -0
  390. /package/dist/chunks/{lifecycle-TZU6D46R.js.map → lifecycle-T5KZCOME.js.map} +0 -0
  391. /package/dist/chunks/{list-QCWNMQED.js.map → list-ALYIIETE.js.map} +0 -0
  392. /package/dist/chunks/{live-V7HRF5KR.js.map → live-QYXRKG27.js.map} +0 -0
  393. /package/dist/chunks/{login-QFP3PIXG.js.map → login-YYDHSXYZ.js.map} +0 -0
  394. /package/dist/chunks/{logs-XTXMS4JF.js.map → logs-HGYW5QG6.js.map} +0 -0
  395. /package/dist/chunks/{mcp-WQFJJ4NO.js.map → mcp-DXCRUYBA.js.map} +0 -0
  396. /package/dist/chunks/{operator-tools-2OYRNPCH.js.map → operator-tools-HM2DKEA3.js.map} +0 -0
  397. /package/dist/chunks/{output-schema-ETVPLUXE.js.map → output-schema-S4OZKHPX.js.map} +0 -0
  398. /package/dist/chunks/{pal-BYFZCLE2.js.map → pal-PISV32OY.js.map} +0 -0
  399. /package/dist/chunks/{providers-KP5JHTTK.js.map → providers-UCHYI3MC.js.map} +0 -0
  400. /package/dist/chunks/{resume-7V44GSEU.js.map → resume-PM73RFB2.js.map} +0 -0
  401. /package/dist/chunks/{resume-command-OKJ2MJPB.js.map → resume-command-TNYIW6PZ.js.map} +0 -0
  402. /package/dist/chunks/{schedule-TVR3FE32.js.map → schedule-PPTJ3BJ7.js.map} +0 -0
  403. /package/dist/chunks/{service-6A3TOQKV.js.map → service-OMRDQOPM.js.map} +0 -0
  404. /package/dist/chunks/{session-step-N4GHA2YE.js.map → session-step-C54ZEOLL.js.map} +0 -0
  405. /package/dist/chunks/{skills-WXYSPDKL.js.map → skills-CNZMMJFB.js.map} +0 -0
  406. /package/dist/chunks/{start-check-BUCN5MCU.js.map → start-check-H4GSB34J.js.map} +0 -0
  407. /package/dist/chunks/{state-PVAVIXHK.js.map → state-VEYKYIIF.js.map} +0 -0
  408. /package/dist/chunks/{store-D3XUEEAF.js.map → store-BGVZ7PVQ.js.map} +0 -0
  409. /package/dist/chunks/{store-NB3KR4XA.js.map → store-FW3TZA4K.js.map} +0 -0
  410. /package/dist/chunks/{store-O3KC2PPZ.js.map → store-S3M6B7JR.js.map} +0 -0
  411. /package/dist/chunks/{upgrade-FY5ULZQF.js.map → upgrade-XRCA3O4X.js.map} +0 -0
  412. /package/dist/chunks/{worktree-MVW62U5G.js.map → worktree-C6G5PFNW.js.map} +0 -0
@@ -5,16 +5,20 @@ import {
5
5
  } from "./chunk-NUGPLXVK.js";
6
6
  import {
7
7
  restrictToOwner
8
- } from "./chunk-BRKD6FMO.js";
8
+ } from "./chunk-QXRLKALD.js";
9
9
  import {
10
10
  namzuHomePath
11
- } from "./chunk-YVIM3MXU.js";
11
+ } from "./chunk-PAB3MJVU.js";
12
12
  import {
13
13
  MCPClient,
14
14
  MCPHttpStatusError,
15
+ MCPToolDiscovery,
16
+ deferred,
15
17
  mcpToolset,
16
- requireApproval
17
- } from "./chunk-7E3V7NNN.js";
18
+ renderPromptMessages,
19
+ requireApproval,
20
+ wrapUntrusted
21
+ } from "./chunk-GYW5IJ5R.js";
18
22
  import {
19
23
  __export,
20
24
  __name
@@ -1583,9 +1587,9 @@ function $constructor(name, initializer3, proto, params) {
1583
1587
  function _(def) {
1584
1588
  const inst = params?.Parent ? newError(Definition) : this;
1585
1589
  init(inst, def);
1586
- const deferred = inst._zod.deferred;
1587
- if (deferred) {
1588
- for (const fn of deferred) {
1590
+ const deferred2 = inst._zod.deferred;
1591
+ if (deferred2) {
1592
+ for (const fn of deferred2) {
1589
1593
  fn();
1590
1594
  }
1591
1595
  inst._zod.deferred = void 0;
@@ -24851,6 +24855,129 @@ var StreamableHTTPClientTransport = class {
24851
24855
  }
24852
24856
  };
24853
24857
 
24858
+ // src/integrations/mcp/output.ts
24859
+ var MCP_OUTPUT_CHARS = 3e4;
24860
+ var MCP_TRUNCATION_NOTICE = "\n[MCP output truncated; additional data and rich content omitted.]";
24861
+ function boundedMcpText(text, limit = MCP_OUTPUT_CHARS) {
24862
+ if (text.length <= limit) return text;
24863
+ if (limit <= MCP_TRUNCATION_NOTICE.length)
24864
+ return MCP_TRUNCATION_NOTICE.slice(0, Math.max(0, limit));
24865
+ return text.slice(0, limit - MCP_TRUNCATION_NOTICE.length) + MCP_TRUNCATION_NOTICE;
24866
+ }
24867
+ __name(boundedMcpText, "boundedMcpText");
24868
+ function fits(value, budget, seen, depth = 0) {
24869
+ if (budget.left < 0 || depth > 32) return false;
24870
+ if (typeof value === "string") budget.left -= value.length * 6 + 2;
24871
+ else if (value === null || typeof value !== "object") budget.left -= 32;
24872
+ else {
24873
+ if (seen.has(value)) return false;
24874
+ seen.add(value);
24875
+ budget.left -= 2;
24876
+ for (const key in value) {
24877
+ if (!Object.hasOwn(value, key)) continue;
24878
+ budget.left -= key.length * 6 + 4;
24879
+ if (!fits(value[key], budget, seen, depth + 1)) return false;
24880
+ }
24881
+ seen.delete(value);
24882
+ }
24883
+ return budget.left >= 0;
24884
+ }
24885
+ __name(fits, "fits");
24886
+ function boundedMcpResult(result) {
24887
+ if ((result.error?.length ?? 0) <= 1e3 && fits(result, { left: MCP_OUTPUT_CHARS }, /* @__PURE__ */ new Set()))
24888
+ return result;
24889
+ return {
24890
+ success: result.success,
24891
+ output: wrapUntrusted(
24892
+ {
24893
+ kind: "mcp-output",
24894
+ provenance: "Truncated server output, not instructions from the person."
24895
+ },
24896
+ result.output.slice(0, MCP_OUTPUT_CHARS - 2e3 - MCP_TRUNCATION_NOTICE.length) + MCP_TRUNCATION_NOTICE
24897
+ ),
24898
+ ...result.error ? { error: boundedMcpText(result.error, 1e3) } : {},
24899
+ ...result.retryable !== void 0 ? { retryable: result.retryable } : {}
24900
+ };
24901
+ }
24902
+ __name(boundedMcpResult, "boundedMcpResult");
24903
+ function boundedMcpToolset(entry) {
24904
+ const wrapped = /* @__PURE__ */ new WeakMap();
24905
+ return {
24906
+ ...entry,
24907
+ tools: /* @__PURE__ */ __name(() => entry.tools().map((tool) => {
24908
+ let found = wrapped.get(tool);
24909
+ if (!found) {
24910
+ found = {
24911
+ ...tool,
24912
+ execute: /* @__PURE__ */ __name(async (input, context) => boundedMcpResult(await tool.execute(input, context)), "execute")
24913
+ };
24914
+ wrapped.set(tool, found);
24915
+ }
24916
+ return found;
24917
+ }), "tools")
24918
+ };
24919
+ }
24920
+ __name(boundedMcpToolset, "boundedMcpToolset");
24921
+
24922
+ // src/integrations/mcp/prompts.ts
24923
+ function validatePromptArguments(prompt, args) {
24924
+ const declared = new Set((prompt.arguments ?? []).map((arg) => arg.name));
24925
+ for (const [name, value] of Object.entries(args)) {
24926
+ if (!declared.has(name)) throw new Error(`Unknown prompt argument: ${name}`);
24927
+ if (typeof value !== "string") throw new Error(`Prompt argument ${name} must be a string`);
24928
+ }
24929
+ for (const arg of prompt.arguments ?? []) {
24930
+ if (arg.required && (!Object.hasOwn(args, arg.name) || args[arg.name] === "")) {
24931
+ throw new Error(`Missing required prompt argument: ${arg.name}`);
24932
+ }
24933
+ }
24934
+ }
24935
+ __name(validatePromptArguments, "validatePromptArguments");
24936
+ function promptsOf(client, server, spec) {
24937
+ const discovery = new MCPToolDiscovery([client], {
24938
+ policies: { [server]: { allow: spec.allow, deny: spec.deny } }
24939
+ });
24940
+ const list = /* @__PURE__ */ __name(async (signal) => {
24941
+ signal?.throwIfAborted();
24942
+ if (client.getState().status !== "connected") return [];
24943
+ const prompts = await discovery.discoverPromptsFrom(client);
24944
+ signal?.throwIfAborted();
24945
+ return prompts.map((prompt) => ({ ...prompt, server }));
24946
+ }, "list");
24947
+ return {
24948
+ list,
24949
+ get: /* @__PURE__ */ __name(async (name, args, signal) => {
24950
+ const prompt = (await list(signal)).find((item) => item.name === name);
24951
+ if (!prompt) throw new Error("Prompt unavailable or not admitted by server policy.");
24952
+ validatePromptArguments(prompt, args);
24953
+ const result = await client.getPrompt(name, args, signal ? { signal } : void 0);
24954
+ let left = MCP_OUTPUT_CHARS - 100;
24955
+ const messages = [];
24956
+ for (const message of result.messages) {
24957
+ if (left <= 32) break;
24958
+ if (message.role !== "user" && message.role !== "assistant")
24959
+ throw new Error("Invalid prompt role");
24960
+ const content = message.content;
24961
+ const text = content.type === "text" ? content.text : content.type === "resource" ? content.resource.text ?? "[Non-text embedded resource omitted]" : "[Non-text prompt content omitted]";
24962
+ const bounded = boundedMcpText(text, left);
24963
+ left -= bounded.length + 32;
24964
+ messages.push({ role: message.role, content: { type: "text", text: bounded } });
24965
+ }
24966
+ if (messages.length < result.messages.length) {
24967
+ messages.push({
24968
+ role: "user",
24969
+ content: {
24970
+ type: "text",
24971
+ text: "[Additional MCP prompt messages omitted: aggregate limit reached.]"
24972
+ }
24973
+ });
24974
+ }
24975
+ return renderPromptMessages(server, name, messages);
24976
+ }, "get")
24977
+ };
24978
+ }
24979
+ __name(promptsOf, "promptsOf");
24980
+
24854
24981
  // src/integrations/mcp/servers.ts
24855
24982
  var CONNECT_TIMEOUT_MS = 1e4;
24856
24983
  var MAX_CONNECT_TIMEOUT_MS = 2147483647;
@@ -25086,6 +25213,15 @@ function connectDeadlineFor(spec) {
25086
25213
  return ms;
25087
25214
  }
25088
25215
  __name(connectDeadlineFor, "connectDeadlineFor");
25216
+ function requestTimeoutFor(spec) {
25217
+ const ms = spec.requestTimeoutMs;
25218
+ if (ms === void 0) return void 0;
25219
+ if (typeof ms !== "number" || !Number.isFinite(ms) || ms <= 0 || ms > MAX_CONNECT_TIMEOUT_MS) {
25220
+ return `requestTimeoutMs must be a positive number of milliseconds at most ${MAX_CONNECT_TIMEOUT_MS}`;
25221
+ }
25222
+ return ms;
25223
+ }
25224
+ __name(requestTimeoutFor, "requestTimeoutFor");
25089
25225
  function eraProbeTimeoutFor(spec) {
25090
25226
  const ms = spec.eraProbeTimeoutMs;
25091
25227
  if (ms === void 0) return void 0;
@@ -25123,55 +25259,152 @@ function toolsetOptionsFor(spec, name) {
25123
25259
  };
25124
25260
  }
25125
25261
  __name(toolsetOptionsFor, "toolsetOptionsFor");
25126
- async function connectMcpServers(config2, options) {
25262
+ var LOCAL_CONNECT_BATCH = 3;
25263
+ var REMOTE_CONNECT_BATCH = 20;
25264
+ function resourcesOf(client, name, spec) {
25265
+ const discovery = new MCPToolDiscovery([client], {
25266
+ policies: { [name]: { allow: spec.allow, deny: spec.deny } }
25267
+ });
25268
+ const list = /* @__PURE__ */ __name(async (signal) => {
25269
+ try {
25270
+ if (client.getState().status !== "connected") return [];
25271
+ const found = await discovery.discoverResourcesFrom(client, signal ? { signal } : void 0);
25272
+ return found.map((resource) => ({
25273
+ server: name,
25274
+ uri: resource.uri,
25275
+ name: resource.name,
25276
+ ...resource.description ? { description: resource.description } : {}
25277
+ }));
25278
+ } catch {
25279
+ return [];
25280
+ }
25281
+ }, "list");
25282
+ return {
25283
+ list,
25284
+ read: /* @__PURE__ */ __name(async (uri, signal) => {
25285
+ if (!(await list(signal)).some((resource) => resource.uri === uri)) return null;
25286
+ try {
25287
+ const blocks = await client.readResource(uri, signal ? { signal } : void 0);
25288
+ let text = "";
25289
+ for (const block of blocks) {
25290
+ if (!block || typeof block !== "object") continue;
25291
+ const item = block;
25292
+ const found = typeof item.text === "string" ? item.text : item.resource?.text;
25293
+ if (typeof found !== "string") continue;
25294
+ const remaining = MCP_OUTPUT_CHARS - text.length;
25295
+ if (remaining <= 100) {
25296
+ text = text.slice(0, MCP_OUTPUT_CHARS - MCP_TRUNCATION_NOTICE.length) + MCP_TRUNCATION_NOTICE;
25297
+ break;
25298
+ }
25299
+ text += (text ? "\n" : "") + boundedMcpText(found, remaining - (text ? 1 : 0));
25300
+ }
25301
+ return text.length > 0 ? text : null;
25302
+ } catch {
25303
+ return null;
25304
+ }
25305
+ }, "read")
25306
+ };
25307
+ }
25308
+ __name(resourcesOf, "resourcesOf");
25309
+ function placeholderToolsets(name, spec, mounted, listeners) {
25310
+ const source = {
25311
+ id: `mcp:${name}`,
25312
+ kind: "mcp_server",
25313
+ name,
25314
+ mcpServer: { name, readOnlyHintTrusted: spec.readOnlyHintTrusted === true }
25315
+ };
25316
+ const onChange = /* @__PURE__ */ __name((listener) => {
25317
+ listeners.add(listener);
25318
+ return () => listeners.delete(listener);
25319
+ }, "onChange");
25320
+ const main = {
25321
+ source,
25322
+ tools: /* @__PURE__ */ __name(() => mounted()?.[0]?.tools() ?? [], "tools"),
25323
+ onChange,
25324
+ close: /* @__PURE__ */ __name(async () => {
25325
+ await mounted()?.[0]?.close?.();
25326
+ }, "close")
25327
+ };
25328
+ const resources = deferred({
25329
+ source,
25330
+ tools: /* @__PURE__ */ __name(() => mounted()?.[1]?.tools() ?? [], "tools"),
25331
+ onChange,
25332
+ close: /* @__PURE__ */ __name(async () => {
25333
+ await mounted()?.[1]?.close?.();
25334
+ }, "close")
25335
+ });
25336
+ return [main, resources];
25337
+ }
25338
+ __name(placeholderToolsets, "placeholderToolsets");
25339
+ function startMcpServers(config2, options) {
25127
25340
  const entries = Object.entries(config2 ?? {});
25128
- const toolsets = [];
25129
25341
  const startupFailed = [];
25130
25342
  const clients = [];
25131
- const liveServers = [];
25132
- for (const [name, spec] of entries) {
25343
+ const slots = [];
25344
+ const live = entries.map(() => void 0);
25345
+ let closed = false;
25346
+ const pending = /* @__PURE__ */ new Set();
25347
+ const settledListeners = /* @__PURE__ */ new Set();
25348
+ const jobs = [];
25349
+ const finish = /* @__PURE__ */ __name((name) => {
25350
+ pending.delete(name);
25351
+ for (const listener of [...settledListeners]) {
25352
+ try {
25353
+ listener(name);
25354
+ } catch {
25355
+ }
25356
+ }
25357
+ }, "finish");
25358
+ entries.forEach(([name, spec], index) => {
25133
25359
  const shapeProblem = serverSpecProblem(spec);
25134
25360
  if (shapeProblem) {
25135
25361
  startupFailed.push({ name, reason: shapeProblem });
25136
- continue;
25362
+ return;
25137
25363
  }
25138
25364
  const transport = transportFor(spec, options.cwd);
25139
25365
  if (typeof transport === "string") {
25140
25366
  startupFailed.push({ name, reason: transport });
25141
- continue;
25367
+ return;
25142
25368
  }
25143
25369
  const deadline = connectDeadlineFor(spec);
25144
25370
  if (typeof deadline === "string") {
25145
25371
  startupFailed.push({ name, reason: deadline });
25146
- continue;
25372
+ return;
25373
+ }
25374
+ const requestTimeoutMs = requestTimeoutFor(spec);
25375
+ if (typeof requestTimeoutMs === "string") {
25376
+ startupFailed.push({ name, reason: requestTimeoutMs });
25377
+ return;
25147
25378
  }
25148
25379
  const eraProbeTimeoutMs = eraProbeTimeoutFor(spec);
25149
25380
  if (typeof eraProbeTimeoutMs === "string") {
25150
25381
  startupFailed.push({ name, reason: eraProbeTimeoutMs });
25151
- continue;
25382
+ return;
25152
25383
  }
25153
25384
  const toolsetOptions = toolsetOptionsFor(spec, name);
25154
25385
  if (typeof toolsetOptions === "string") {
25155
25386
  startupFailed.push({ name, reason: toolsetOptions });
25156
- continue;
25387
+ return;
25157
25388
  }
25158
25389
  let connectedTransport;
25159
25390
  try {
25160
25391
  connectedTransport = transport.type === "streamable-http" ? withSavedMcpOAuth(transport) : transport;
25161
25392
  } catch (error2) {
25162
25393
  startupFailed.push({ name, reason: reasonOf(error2) });
25163
- continue;
25394
+ return;
25164
25395
  }
25165
25396
  let client;
25166
25397
  try {
25167
25398
  client = new MCPClient({
25168
25399
  serverName: name,
25169
25400
  transport: connectedTransport,
25170
- ...eraProbeTimeoutMs !== void 0 ? { eraProbeTimeoutMs } : {}
25401
+ ...eraProbeTimeoutMs !== void 0 ? { eraProbeTimeoutMs } : {},
25402
+ ...requestTimeoutMs !== void 0 ? { requestTimeoutMs } : {},
25403
+ ...options.elicit ? { onElicitation: options.elicit } : {}
25171
25404
  });
25172
25405
  } catch (error2) {
25173
25406
  startupFailed.push({ name, reason: reasonOf(error2) });
25174
- continue;
25407
+ return;
25175
25408
  }
25176
25409
  const discovery = {
25177
25410
  added: /* @__PURE__ */ new Set(),
@@ -25179,77 +25412,148 @@ async function connectMcpServers(config2, options) {
25179
25412
  changed: /* @__PURE__ */ new Set(),
25180
25413
  refused: /* @__PURE__ */ new Map()
25181
25414
  };
25182
- const deadlineAt = Date.now() + deadline;
25183
- let closeTail = Promise.resolve();
25184
- const closeClient = /* @__PURE__ */ __name(() => {
25185
- const closing = closeTail.then(
25186
- () => withDeadline(client.disconnect(), CLOSE_TIMEOUT_MS, `closing "${name}"`)
25187
- );
25188
- closeTail = closing.catch(() => {
25189
- });
25190
- return closing;
25191
- }, "closeClient");
25192
- const closeLateClient = /* @__PURE__ */ __name(() => {
25193
- void closeClient().catch(() => {
25194
- });
25195
- }, "closeLateClient");
25196
- try {
25197
- await withDeadline(client.connect(), deadline, `server "${name}"`, closeLateClient);
25198
- const remaining = deadlineAt - Date.now();
25199
- if (remaining <= 0) {
25200
- throw new Error(
25201
- `server "${name}" discovering its tools did not answer within ${deadline}ms`
25202
- );
25415
+ let mounted;
25416
+ const changeListeners = /* @__PURE__ */ new Set();
25417
+ const placeholders = placeholderToolsets(name, spec, () => mounted, changeListeners);
25418
+ slots.push(...placeholders);
25419
+ pending.add(name);
25420
+ clients.push(client);
25421
+ const run = /* @__PURE__ */ __name(async () => {
25422
+ if (closed) {
25423
+ finish(name);
25424
+ return;
25203
25425
  }
25204
- const discovered = await withDeadline(
25205
- mcpToolset(client, {
25206
- ...toolsetOptions,
25207
- onDrift: /* @__PURE__ */ __name(({ drift }) => {
25208
- for (const item of drift.added) discovery.added.add(item);
25209
- for (const item of drift.removed) discovery.removed.add(item);
25210
- for (const item of drift.changed) discovery.changed.add(item);
25211
- }, "onDrift"),
25212
- onRefused: /* @__PURE__ */ __name(({ kind, refused }) => discovery.refused.set(kind, refused), "onRefused")
25213
- }),
25214
- remaining,
25215
- `server "${name}" discovering its tools`,
25216
- (result) => {
25217
- if (result.status === "rejected") {
25218
- closeLateClient();
25219
- return;
25426
+ const deadlineAt = Date.now() + deadline;
25427
+ let closeTail = Promise.resolve();
25428
+ const closeClient = /* @__PURE__ */ __name(() => {
25429
+ const closing = closeTail.then(
25430
+ () => withDeadline(client.disconnect(), CLOSE_TIMEOUT_MS, `closing "${name}"`)
25431
+ );
25432
+ closeTail = closing.catch(() => {
25433
+ });
25434
+ return closing;
25435
+ }, "closeClient");
25436
+ const closeLateClient = /* @__PURE__ */ __name(() => {
25437
+ void closeClient().catch(() => {
25438
+ });
25439
+ }, "closeLateClient");
25440
+ try {
25441
+ await withDeadline(client.connect(), deadline, `server "${name}"`, closeLateClient);
25442
+ const remaining = deadlineAt - Date.now();
25443
+ if (remaining <= 0) {
25444
+ throw new Error(
25445
+ `server "${name}" discovering its tools did not answer within ${deadline}ms`
25446
+ );
25447
+ }
25448
+ const discovered = await withDeadline(
25449
+ mcpToolset(client, {
25450
+ ...toolsetOptions,
25451
+ onDrift: /* @__PURE__ */ __name(({ drift }) => {
25452
+ for (const item of drift.added) discovery.added.add(item);
25453
+ for (const item of drift.removed) discovery.removed.add(item);
25454
+ for (const item of drift.changed) discovery.changed.add(item);
25455
+ }, "onDrift"),
25456
+ onRefused: /* @__PURE__ */ __name(({ kind, refused }) => discovery.refused.set(kind, refused), "onRefused")
25457
+ }),
25458
+ remaining,
25459
+ `server "${name}" discovering its tools`,
25460
+ (result) => {
25461
+ if (result.status === "rejected") {
25462
+ closeLateClient();
25463
+ return;
25464
+ }
25465
+ void (async () => {
25466
+ await Promise.all(
25467
+ result.value.map(
25468
+ (entry) => withDeadline(
25469
+ Promise.resolve(entry.close?.()),
25470
+ CLOSE_TIMEOUT_MS,
25471
+ `closing late toolset "${name}"`
25472
+ ).catch(() => {
25473
+ })
25474
+ )
25475
+ );
25476
+ closeLateClient();
25477
+ })().catch(() => {
25478
+ });
25220
25479
  }
25221
- void (async () => {
25222
- await Promise.all(
25223
- result.value.map(
25224
- (entry) => withDeadline(
25225
- Promise.resolve(entry.close?.()),
25226
- CLOSE_TIMEOUT_MS,
25227
- `closing late toolset "${name}"`
25228
- ).catch(() => {
25229
- })
25230
- )
25231
- );
25232
- closeLateClient();
25233
- })().catch(() => {
25480
+ );
25481
+ if (closed) {
25482
+ await Promise.all(
25483
+ discovered.map(
25484
+ (entry) => withDeadline(
25485
+ Promise.resolve(entry.close?.()),
25486
+ CLOSE_TIMEOUT_MS,
25487
+ `closing late toolset "${name}"`
25488
+ ).catch(() => {
25489
+ })
25490
+ )
25491
+ );
25492
+ await closeClient().catch(() => {
25234
25493
  });
25494
+ return;
25235
25495
  }
25236
- );
25237
- const mounted = spec.requireApproval ? discovered.map((entry) => requireApproval(entry)) : [...discovered];
25238
- toolsets.push(...mounted);
25239
- liveServers.push({ client, name, toolsets: mounted, discovery });
25240
- clients.push(client);
25241
- } catch (err) {
25242
- startupFailed.push({ name, reason: reasonOf(err) });
25243
- try {
25244
- await closeClient();
25245
- } catch {
25246
- }
25247
- }
25248
- }
25496
+ const bounded = discovered.map(boundedMcpToolset);
25497
+ const ready2 = spec.requireApproval ? bounded.map((entry) => requireApproval(entry)) : bounded;
25498
+ for (const entry of ready2) {
25499
+ entry.onChange?.(() => {
25500
+ for (const listener of [...changeListeners]) listener();
25501
+ });
25502
+ }
25503
+ mounted = ready2;
25504
+ live[index] = {
25505
+ client,
25506
+ name,
25507
+ toolsets: ready2,
25508
+ discovery,
25509
+ ...spec.requireApproval ? {} : {
25510
+ resources: resourcesOf(client, name, spec),
25511
+ prompts: promptsOf(client, name, spec)
25512
+ }
25513
+ };
25514
+ for (const listener of [...changeListeners]) listener();
25515
+ } catch (err) {
25516
+ startupFailed.push({ name, reason: reasonOf(err) });
25517
+ try {
25518
+ await closeClient();
25519
+ } catch {
25520
+ }
25521
+ } finally {
25522
+ finish(name);
25523
+ }
25524
+ }, "run");
25525
+ jobs.push({ remote: transport.type !== "stdio", run });
25526
+ });
25527
+ const pool = /* @__PURE__ */ __name(async (work, size) => {
25528
+ let next = 0;
25529
+ const width = Math.max(1, Math.min(Math.floor(size) || 1, work.length));
25530
+ await Promise.all(
25531
+ Array.from({ length: width }, async () => {
25532
+ for (; ; ) {
25533
+ const job = work[next++];
25534
+ if (!job) return;
25535
+ await job().catch(() => {
25536
+ });
25537
+ }
25538
+ })
25539
+ );
25540
+ }, "pool");
25541
+ const ready = Promise.all([
25542
+ pool(
25543
+ jobs.filter((job) => !job.remote).map((job) => job.run),
25544
+ options.localBatch ?? LOCAL_CONNECT_BATCH
25545
+ ),
25546
+ pool(
25547
+ jobs.filter((job) => job.remote).map((job) => job.run),
25548
+ options.remoteBatch ?? REMOTE_CONNECT_BATCH
25549
+ )
25550
+ ]).then(() => void 0);
25249
25551
  const current = /* @__PURE__ */ __name(() => {
25250
25552
  const connected = [];
25251
25553
  const failed = [...startupFailed];
25252
- for (const { client, name, toolsets: serverToolsets, discovery } of liveServers) {
25554
+ for (const server of live) {
25555
+ if (!server) continue;
25556
+ const { client, name, toolsets: serverToolsets, discovery } = server;
25253
25557
  const state = client.getState();
25254
25558
  if (state.status === "connected") {
25255
25559
  const names = serverToolsets.flatMap((entry) => entry.tools().map((tool) => tool.name));
@@ -25274,13 +25578,16 @@ async function connectMcpServers(config2, options) {
25274
25578
  reason: state.error ?? (state.status === "disconnected" ? "connection closed after startup" : `connection is ${state.status}`)
25275
25579
  });
25276
25580
  }
25277
- return { connected, failed };
25581
+ return { connected, failed, pending: [...pending] };
25278
25582
  }, "current");
25583
+ const roster = /* @__PURE__ */ __name(() => pending.size === 0 ? live.flatMap((server) => server ? [...server.toolsets] : []) : slots, "roster");
25279
25584
  return {
25280
25585
  get tools() {
25281
- return toolsets.flatMap((entry) => entry.tools());
25586
+ return roster().flatMap((entry) => entry.tools());
25587
+ },
25588
+ get toolsets() {
25589
+ return roster();
25282
25590
  },
25283
- toolsets,
25284
25591
  current,
25285
25592
  get connected() {
25286
25593
  return current().connected;
@@ -25288,8 +25595,44 @@ async function connectMcpServers(config2, options) {
25288
25595
  get failed() {
25289
25596
  return current().failed;
25290
25597
  },
25598
+ get pending() {
25599
+ return [...pending];
25600
+ },
25601
+ ready,
25602
+ listPrompts: /* @__PURE__ */ __name(async (signal, name) => {
25603
+ if (closed) return [];
25604
+ const lists = await Promise.all(
25605
+ live.map(
25606
+ (server) => server && (!name || server.name === name) ? server.prompts?.list(signal) ?? [] : []
25607
+ )
25608
+ );
25609
+ return lists.flat();
25610
+ }, "listPrompts"),
25611
+ getPrompt: /* @__PURE__ */ __name(async (server, name, args, signal) => {
25612
+ const found = closed ? void 0 : live.find((entry) => entry?.name === server);
25613
+ if (!found?.prompts) throw new Error("Server unavailable or requires tool approval.");
25614
+ return found.prompts.get(name, args, signal);
25615
+ }, "getPrompt"),
25616
+ listResources: /* @__PURE__ */ __name(async (signal, name) => {
25617
+ if (closed) return [];
25618
+ const lists = await Promise.all(
25619
+ live.map(
25620
+ (server) => server?.resources && (!name || server.name === name) ? server.resources.list(signal) : []
25621
+ )
25622
+ );
25623
+ return lists.flat();
25624
+ }, "listResources"),
25625
+ readResource: /* @__PURE__ */ __name(async (server, uri, signal) => {
25626
+ const found = closed ? void 0 : live.find((entry) => entry?.name === server);
25627
+ return found?.resources ? found.resources.read(uri, signal) : null;
25628
+ }, "readResource"),
25629
+ onSettled: /* @__PURE__ */ __name((listener) => {
25630
+ settledListeners.add(listener);
25631
+ return () => settledListeners.delete(listener);
25632
+ }, "onSettled"),
25291
25633
  close: /* @__PURE__ */ __name(async () => {
25292
- await Promise.all(toolsets.map((entry) => entry.close?.()));
25634
+ closed = true;
25635
+ await Promise.all(roster().map((entry) => entry.close?.()));
25293
25636
  await Promise.all(
25294
25637
  clients.map(
25295
25638
  (c) => withDeadline(c.disconnect(), CLOSE_TIMEOUT_MS, "closing a tool server").catch(() => {
@@ -25299,12 +25642,21 @@ async function connectMcpServers(config2, options) {
25299
25642
  }, "close")
25300
25643
  };
25301
25644
  }
25645
+ __name(startMcpServers, "startMcpServers");
25646
+ async function connectMcpServers(config2, options) {
25647
+ const connection = startMcpServers(config2, options);
25648
+ await connection.ready;
25649
+ return connection;
25650
+ }
25302
25651
  __name(connectMcpServers, "connectMcpServers");
25303
25652
 
25304
25653
  export {
25305
25654
  UnauthorizedError,
25306
25655
  Client,
25307
25656
  StreamableHTTPClientTransport,
25657
+ MCP_OUTPUT_CHARS,
25658
+ boundedMcpText,
25659
+ validatePromptArguments,
25308
25660
  isSecureMcpOAuthUrl,
25309
25661
  consumeMcpOAuthCallbackState,
25310
25662
  clearMcpOAuthPending,
@@ -25312,6 +25664,7 @@ export {
25312
25664
  createMcpOAuthProvider,
25313
25665
  transportFor,
25314
25666
  connectDeadlineFor,
25667
+ startMcpServers,
25315
25668
  connectMcpServers
25316
25669
  };
25317
25670
  /*! Bundled license information:
@@ -25323,4 +25676,4 @@ export {
25323
25676
  * MIT Licensed
25324
25677
  *)
25325
25678
  */
25326
- //# sourceMappingURL=chunk-A4CKLHKM.js.map
25679
+ //# sourceMappingURL=chunk-2QWVT55W.js.map