nolo-cli 0.264.0-alpha.2 → 0.266.0-alpha.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 (538) hide show
  1. package/{chunk-LXP53WGF.js → chunk-05wkntba.js} +44 -40
  2. package/{chunk-XFYFMTOM.js → chunk-08ts2q1n.js} +9 -11
  3. package/{chromeCommands-MVEEIY4R.js → chunk-0a3m1n6h.js} +182 -238
  4. package/chunk-0gfvc7g8.js +13 -0
  5. package/{chunk-CF7PE763.js → chunk-0h0sncy4.js} +3 -4
  6. package/{chunk-3UH7SS4W.js → chunk-0nsxwrge.js} +232 -241
  7. package/chunk-0ra8cne4.js +11 -0
  8. package/{chunk-MRACVEPZ.js → chunk-0sgwk7am.js} +1 -3
  9. package/{chunk-PEXGRTTQ.js → chunk-0tsfn0dk.js} +44 -45
  10. package/{chunk-WOAZVUSN.js → chunk-0y8cbwzy.js} +26 -30
  11. package/chunk-12gz55kk.js +6 -0
  12. package/{chunk-GLKOYSRU.js → chunk-186gshgw.js} +3 -6
  13. package/chunk-19w4ss38.js +44 -0
  14. package/{chunk-RF576RYE.js → chunk-1cakzp6r.js} +23 -23
  15. package/chunk-1fbfwbzp.js +27 -0
  16. package/{chunk-4IVMDQBA.js → chunk-1fv9k8zt.js} +103 -68
  17. package/{chunk-Q5FJJ6XI.js → chunk-1js4cdzp.js} +11 -19
  18. package/{chunk-YECCIUYU.js → chunk-1nhx0er5.js} +63 -63
  19. package/chunk-1p152b7g.js +12 -0
  20. package/{chunk-HXEO5DNV.js → chunk-1ynbq3yr.js} +322 -353
  21. package/{chunk-6UBGXX2W.js → chunk-1zrg4h5n.js} +3 -4
  22. package/{chunk-Y5GCAMGP.js → chunk-2g6zsfq8.js} +1 -3
  23. package/chunk-2hekb0eh.js +17 -0
  24. package/chunk-2pj6qzq5.js +12 -0
  25. package/chunk-2tvd4jyp.js +226 -0
  26. package/chunk-2ygg7azv.js +846 -0
  27. package/chunk-33405wtv.js +50 -0
  28. package/chunk-34axejtd.js +30 -0
  29. package/{tableCommands-FCPDULSU.js → chunk-3700dvt3.js} +224 -276
  30. package/{pdf-KE3QI2V7.js → chunk-3j08t1nm.js} +12505 -10133
  31. package/chunk-3j9gq18v.js +111 -0
  32. package/{chunk-LYPJYBE5.js → chunk-3qfpcdkm.js} +486 -505
  33. package/{settingThunks-PNC7ZISV.js → chunk-3r2x7h64.js} +189 -272
  34. package/{agentGrantCommands-2VLLXGIU.js → chunk-3tbj5fxt.js} +61 -56
  35. package/chunk-40whhjj5.js +168 -0
  36. package/chunk-4301919y.js +7 -0
  37. package/chunk-43adz39e.js +77 -0
  38. package/{chunk-5ZUL4CUO.js → chunk-49v3zc4g.js} +1 -3
  39. package/chunk-4dd7mxkb.js +72 -0
  40. package/{chunk-BKP325XS.js → chunk-4hapfzpq.js} +66 -62
  41. package/chunk-4mm7dz0m.js +95 -0
  42. package/chunk-4pqxempz.js +440 -0
  43. package/chunk-4x9zf5pv.js +10 -0
  44. package/{chunk-CA7LGAHV.js → chunk-511q8qzv.js} +66 -57
  45. package/{chunk-U7OULUMF.js → chunk-53v9g0np.js} +49 -64
  46. package/chunk-572mg6q5.js +19 -0
  47. package/{chunk-QAW6BEWQ.js → chunk-57eyhmwr.js} +17173 -16165
  48. package/chunk-5hsr0zjm.js +156 -0
  49. package/chunk-5k883yyd.js +20 -0
  50. package/chunk-5m0wsee4.js +639 -0
  51. package/{memberThunks-NEZRAW5K.js → chunk-5r1sq2gt.js} +299 -373
  52. package/chunk-648rq4np.js +255 -0
  53. package/{chunk-IYRZKHA6.js → chunk-666yjw5c.js} +63 -86
  54. package/{chunk-4O22PGNQ.js → chunk-6cdcbmtp.js} +19 -19
  55. package/chunk-6dbyqcf7.js +59 -0
  56. package/{agentProviderCommands-2W3VXDLV.js → chunk-6e8mgp1x.js} +82 -105
  57. package/chunk-6n0pw7sx.js +44 -0
  58. package/chunk-6q1b7381.js +361 -0
  59. package/chunk-6sj756ry.js +23 -0
  60. package/{chunk-4UNN45DS.js → chunk-6t7a7zck.js} +14785 -14454
  61. package/chunk-6yarwtxh.js +776 -0
  62. package/chunk-708h542p.js +18 -0
  63. package/chunk-76f076t8.js +266 -0
  64. package/chunk-782rrrwv.js +523 -0
  65. package/{workloadLifecycle-P2SJVV3S.js → chunk-7gk330wp.js} +77 -84
  66. package/{chunk-EZKIRVLJ.js → chunk-7ks60vxy.js} +146 -128
  67. package/{chunk-FI4DPLR7.js → chunk-7mrqbxe8.js} +342 -228
  68. package/chunk-7sztayrd.js +169 -0
  69. package/chunk-7vgt2mxz.js +15 -0
  70. package/{localFirstLog-OIETGK66.js → chunk-7z8y4k6y.js} +0 -2
  71. package/{chunk-KDDXC2IH.js → chunk-82htft2m.js} +49 -11
  72. package/{updateDialogTitleAction-XOSLNRT3.js → chunk-88vrtxxg.js} +65 -137
  73. package/{chunk-LS5KAVFQ.js → chunk-8dtjbp79.js} +293 -229
  74. package/chunk-8fajbkaz.js +50 -0
  75. package/chunk-8m1ebxpw.js +65 -0
  76. package/{accountResolver-JYG5L7YP.js → chunk-8mgfeg0w.js} +37 -30
  77. package/{chunk-LPXBBC32.js → chunk-8myksy35.js} +156 -160
  78. package/{chunk-BMQ2MJUK.js → chunk-8nrj7dc7.js} +75 -66
  79. package/{commandRegistry-ENNFT77C.js → chunk-8t8x64ec.js} +228 -286
  80. package/chunk-8yj4pq79.js +458 -0
  81. package/{chunk-5MKPNTJP.js → chunk-8z6pepcx.js} +43 -48
  82. package/{chunk-UYQILGDR.js → chunk-90egc9vb.js} +122 -102
  83. package/{chunk-EODBQPRM.js → chunk-91q5dc5r.js} +10 -14
  84. package/{chunk-U6VC4MU4.js → chunk-96jtrqk1.js} +2 -4
  85. package/{chunk-H57T64RA.js → chunk-996j61av.js} +28 -31
  86. package/{chunk-Q6FKWH66.js → chunk-9cxgb9jy.js} +137 -243
  87. package/{chunk-2ZBPWX7N.js → chunk-9q1gbmet.js} +62 -104
  88. package/chunk-9qtjh73q.js +344 -0
  89. package/{chunk-SR57FDTX.js → chunk-9raka469.js} +72 -155
  90. package/{chunk-V6K5U4YE.js → chunk-9vh4v046.js} +32 -41
  91. package/{chunk-AGIM7IMJ.js → chunk-9yr1fy7j.js} +14 -49
  92. package/{chunk-FGFJUFPS.js → chunk-a16x0wt6.js} +11 -18
  93. package/chunk-a5b2rvzs.js +131 -0
  94. package/{chunk-7DPNBQSV.js → chunk-a7bz6nc3.js} +3 -4
  95. package/chunk-ac85azv9.js +29 -0
  96. package/{chunk-VXL2FZTP.js → chunk-ahhbkad4.js} +16 -20
  97. package/{chunk-37DGW762.js → chunk-anhksj2j.js} +16 -29
  98. package/{cliAuthorityBrokerServer-27C5YBYP.js → chunk-atvmx76t.js} +180 -186
  99. package/{chunk-E6A5NHDH.js → chunk-av2mzeqz.js} +16 -17
  100. package/chunk-avbwrb0z.js +614 -0
  101. package/chunk-avr6rqe5.js +544 -0
  102. package/{workContextQueryProjection-CACY5VFE.js → chunk-axx60d5a.js} +7 -7
  103. package/{chunk-EWQ3HGNZ.js → chunk-b00vzjkb.js} +30 -23
  104. package/chunk-b0m6ezxr.js +132 -0
  105. package/chunk-bbd5mgdt.js +47 -0
  106. package/chunk-bcecft0r.js +28 -0
  107. package/chunk-beyr4pyp.js +33 -0
  108. package/{chunk-BR3GT6MR.js → chunk-bge0cagn.js} +7 -18
  109. package/{offlineMarxistsAgentCommand-MFURGWHL.js → chunk-bh53zg3t.js} +33 -43
  110. package/chunk-bmx1cw89.js +37 -0
  111. package/chunk-br2195h4.js +22 -0
  112. package/chunk-bsqkwveq.js +56 -0
  113. package/{chunk-QAU6KM2U.js → chunk-c09s2z1m.js} +139 -98
  114. package/chunk-c235kypv.js +24636 -0
  115. package/{chunk-2JMYAH5O.js → chunk-c30j6pyh.js} +213 -256
  116. package/chunk-c3v6r6sq.js +29 -0
  117. package/{chunk-PDSXYHNI.js → chunk-c5z7qspt.js} +1177 -1196
  118. package/{chunk-GWB6AGME.js → chunk-c6jvz0mp.js} +34 -50
  119. package/{chunk-PRJ473FK.js → chunk-cd6h9qqs.js} +14 -12
  120. package/chunk-cdt0amyy.js +37 -0
  121. package/{chunk-2AJLG6PY.js → chunk-cfh6tfc3.js} +73 -86
  122. package/{chunk-WIVVNJUS.js → chunk-ch4ck1yz.js} +38 -68
  123. package/chunk-chtvrtp5.js +55 -0
  124. package/{chunk-EYLGAEB4.js → chunk-ckvz7abv.js} +170 -165
  125. package/{chunk-YZMNK53S.js → chunk-csf18m5w.js} +32 -25
  126. package/{chunk-C36L6ZID.js → chunk-cwnvf8dt.js} +2 -10
  127. package/chunk-cy7thb6n.js +19877 -0
  128. package/{dialogPortabilityCommands-YQJNB2KL.js → chunk-d61q9nah.js} +439 -487
  129. package/chunk-d6xdy0gp.js +142 -0
  130. package/{chunk-EBH4RFJ6.js → chunk-dh69vqbd.js} +6390 -6496
  131. package/{chunk-KJ4J2XQB.js → chunk-dj4ggbc6.js} +17 -19
  132. package/{chunk-LISC7BD4.js → chunk-djrrhbk3.js} +29 -37
  133. package/chunk-drqzzzvr.js +822 -0
  134. package/chunk-e1n7edjk.js +33 -0
  135. package/chunk-e3atr4hk.js +59 -0
  136. package/chunk-e9bn2aav.js +13 -0
  137. package/chunk-ed396rfq.js +87 -0
  138. package/chunk-eha8ggh6.js +10 -0
  139. package/{chunk-MALPQFGT.js → chunk-ek122zzt.js} +893 -948
  140. package/chunk-epnmvek4.js +22 -0
  141. package/{chunk-S25VJYXV.js → chunk-eqzvk3xm.js} +69 -80
  142. package/chunk-ex34n71b.js +2874 -0
  143. package/{chunk-56OAS5RZ.js → chunk-f3ad6q4h.js} +7 -11
  144. package/{chunk-3PVYUPXK.js → chunk-f8jepva1.js} +6 -7
  145. package/{chunk-GH34JXNV.js → chunk-f9yvy9t9.js} +114 -92
  146. package/chunk-fbdz4f0j.js +90 -0
  147. package/{chunk-J44TXB4J.js → chunk-fcsc2day.js} +216 -164
  148. package/chunk-fevdhnbh.js +19 -0
  149. package/chunk-fkrgqq8w.js +3300 -0
  150. package/{chunk-TSBJVMNW.js → chunk-fs3bvh2p.js} +42 -57
  151. package/chunk-fvwzyhah.js +134 -0
  152. package/chunk-g0mpxdp9.js +101 -0
  153. package/{chunk-LTQ6ECCF.js → chunk-g35f20d1.js} +450 -414
  154. package/{chunk-3L2WKC3W.js → chunk-g5fhtjqg.js} +13 -16
  155. package/{chunk-DBEOW57U.js → chunk-gcq01td7.js} +270 -227
  156. package/{chunk-ADMRXWXJ.js → chunk-ge97b11r.js} +121 -42
  157. package/chunk-ghjtgbkw.js +180 -0
  158. package/chunk-gkra36c1.js +16 -0
  159. package/chunk-gmz86t60.js +1000 -0
  160. package/{localDialogRead-GWGWSL5K.js → chunk-gszpesze.js} +5 -12
  161. package/chunk-gvsfec9m.js +16536 -0
  162. package/{chunk-QSJ3HFEF.js → chunk-h1hzmqph.js} +1 -3
  163. package/chunk-h30dg154.js +17 -0
  164. package/chunk-h3hkb7cw.js +241 -0
  165. package/chunk-h40py996.js +28 -0
  166. package/{chunk-47T3QP4V.js → chunk-h60gnewh.js} +112 -116
  167. package/{agentPullCommand-XEGOUYQT.js → chunk-hkwsv9xf.js} +33 -45
  168. package/chunk-hnyg0gwj.js +28 -0
  169. package/{chunk-KSV6T4AH.js → chunk-hqqqph5w.js} +12 -4
  170. package/{chunk-YQJEXXDK.js → chunk-hrngs1wy.js} +157 -246
  171. package/{chunk-LRLLWD4P.js → chunk-htf69s94.js} +14 -12
  172. package/chunk-j0yxesh3.js +83 -0
  173. package/{chunk-VF4K2QE6.js → chunk-j22t9g05.js} +3 -6
  174. package/{chunk-3R4AYHJR.js → chunk-j4a8m2zn.js} +5 -34
  175. package/chunk-j9p4jnwg.js +27 -0
  176. package/{chunk-R72QWIFO.js → chunk-jdycmfsm.js} +9 -9
  177. package/chunk-jdyvrne0.js +52 -0
  178. package/{spacePruneCommand-YKIEUIDQ.js → chunk-je0b66qf.js} +44 -62
  179. package/{chunk-HNMXYYJR.js → chunk-jec44fkj.js} +3 -4
  180. package/{chunk-526GLZJE.js → chunk-jf1ex00r.js} +107 -73
  181. package/chunk-jgqdec9b.js +31 -0
  182. package/{chunk-56GBUMO5.js → chunk-jkw9n4h5.js} +16 -25
  183. package/{chunk-7422ZLGL.js → chunk-jmnzdwjt.js} +867 -965
  184. package/chunk-jqq57s0a.js +58 -0
  185. package/{chunk-OKUSDVRS.js → chunk-jtkn5aj6.js} +27 -38
  186. package/chunk-jwvzn9r0.js +316 -0
  187. package/chunk-k1re0fc7.js +107 -0
  188. package/chunk-k2ep3rb2.js +103 -0
  189. package/{chunk-JEXVIMYZ.js → chunk-k6ycb24w.js} +5 -8
  190. package/{chunk-RI7SXDJW.js → chunk-kawvydbk.js} +383 -195
  191. package/chunk-kf2ghpzh.js +10 -0
  192. package/{chunk-S6FAHQDH.js → chunk-kgah9e46.js} +28 -59
  193. package/{chunk-T3MWVUBE.js → chunk-kjjepkvc.js} +71 -82
  194. package/chunk-kn4dgg4j.js +4113 -0
  195. package/{chunk-2LFYMWM3.js → chunk-kn5p91n8.js} +43 -53
  196. package/{chunk-MVOZ22RZ.js → chunk-kntqrbwc.js} +8 -12
  197. package/{chunk-I6YIA2TY.js → chunk-kq3vr7mx.js} +25 -20
  198. package/chunk-kz1x1d8n.js +15 -0
  199. package/{mcpLocalAuthorizeCommand-IKOFKY5U.js → chunk-m22e7tt2.js} +53 -71
  200. package/{chunk-ZNFJWEN4.js → chunk-m32rwr4d.js} +11 -8
  201. package/chunk-m39e9m18.js +93 -0
  202. package/{chunk-4D4QD7FT.js → chunk-m5518371.js} +64 -56
  203. package/{chunk-LHTXSC2E.js → chunk-mb5hnfyp.js} +9 -11
  204. package/chunk-mexet11v.js +11 -0
  205. package/chunk-mg2hgfgh.js +185 -0
  206. package/chunk-mmdhm4kx.js +10317 -0
  207. package/chunk-mz002yz8.js +2821 -0
  208. package/chunk-mzadqnyq.js +56 -0
  209. package/{chunk-VIDPVFP3.js → chunk-n3r1ebdm.js} +5 -6
  210. package/chunk-n438qea7.js +33 -0
  211. package/chunk-n5ffnhnb.js +93 -0
  212. package/chunk-nbvd87fy.js +9 -0
  213. package/{chunk-E36V7MPY.js → chunk-ndej7jc9.js} +53 -43
  214. package/{chunk-B767MA64.js → chunk-nen6rwe4.js} +62 -22
  215. package/chunk-nf06tr3v.js +16 -0
  216. package/chunk-ng8z355q.js +16 -0
  217. package/{chunk-4MEKE5D3.js → chunk-nhtxfv8k.js} +78 -63
  218. package/{runAgentClientLoop-2SFASHDS.js → chunk-nj62jscj.js} +132 -214
  219. package/{chunk-GBWGPTA7.js → chunk-nkryrkyp.js} +16 -19
  220. package/chunk-nmesxem8.js +197 -0
  221. package/{chunk-YR4J7RFS.js → chunk-nmq0qwbn.js} +117 -164
  222. package/chunk-nph8brvw.js +7 -0
  223. package/chunk-nr8fees9.js +10 -0
  224. package/{chunk-DFI7MVCQ.js → chunk-nvewvf7h.js} +1441 -1427
  225. package/{chunk-G7Y4GXTY.js → chunk-nyamhphs.js} +70 -79
  226. package/chunk-nz1c8tcg.js +111 -0
  227. package/{chunk-GPLUFN2E.js → chunk-nzc5yffh.js} +176 -217
  228. package/{chunk-G3SUCT4W.js → chunk-p1vg4bx8.js} +2 -4
  229. package/chunk-p3k3abe8.js +202 -0
  230. package/chunk-p4zy30q5.js +8 -0
  231. package/{chunk-ZJACPM5O.js → chunk-p6se1rx0.js} +102 -102
  232. package/chunk-p9dpshev.js +6968 -0
  233. package/chunk-pa42wxr0.js +116 -0
  234. package/{chunk-TA5QI4MM.js → chunk-paxthgqp.js} +56 -107
  235. package/{readlineWorkspace-ZH5FGDMI.js → chunk-pb35s8d9.js} +5395 -5786
  236. package/{chunk-XT6C2QZW.js → chunk-pbebzbcq.js} +8 -8
  237. package/chunk-pbx7e1mb.js +11 -0
  238. package/chunk-pe5czfn9.js +8 -0
  239. package/chunk-pextk1j4.js +62 -0
  240. package/chunk-pf5rywc6.js +575 -0
  241. package/chunk-pjfhd3fz.js +136 -0
  242. package/{chunk-ZCMAKAZM.js → chunk-pkhqb0fs.js} +118 -59
  243. package/chunk-pm5xb9jh.js +26 -0
  244. package/{chunk-Y3KGWZKF.js → chunk-ppdmmdkx.js} +110 -97
  245. package/chunk-pqp6y2hs.js +9 -0
  246. package/{chunk-QHEN7NZ7.js → chunk-ptz8fm2n.js} +12 -17
  247. package/{chunk-EUHMI5KG.js → chunk-pwqnvbt7.js} +65 -46
  248. package/chunk-pzr31nz7.js +12 -0
  249. package/{chunk-WWC7I6TA.js → chunk-q3cx89sw.js} +2 -4
  250. package/chunk-q5pe7be3.js +78 -0
  251. package/{chunk-ZHWTBHT3.js → chunk-q6zqbxp2.js} +418 -409
  252. package/chunk-q7r0e1p3.js +15 -0
  253. package/chunk-q8t2fecd.js +6 -0
  254. package/{chunk-2QAZCYOM.js → chunk-q94zx4d0.js} +721 -753
  255. package/{runtimeDoctorCommands-52MBG5JN.js → chunk-qarz1az1.js} +65 -85
  256. package/{chunk-4INJGWE3.js → chunk-qdcvr25b.js} +72 -53
  257. package/{streamAgentChatTurn-KOUWITHH.js → chunk-qxs27wfg.js} +1079 -1475
  258. package/{chunk-GIXWVN2W.js → chunk-r06ycjjr.js} +50 -47
  259. package/{chunk-63W5N6P3.js → chunk-r20jw5hb.js} +57 -38
  260. package/{chunk-I5BYFTYK.js → chunk-r7sfwdka.js} +1201 -1142
  261. package/{chunk-UMADT6B2.js → chunk-r9sp1yyb.js} +6 -8
  262. package/{handleSendMessageAction-FHGUFT2X.js → chunk-rbd2vgb3.js} +627 -757
  263. package/chunk-rc37js46.js +12 -0
  264. package/{chunk-5YI447UL.js → chunk-rmngk6r3.js} +67 -76
  265. package/chunk-rnhbnbrq.js +15 -0
  266. package/{chunk-WRHVVIGI.js → chunk-rsfnmrt5.js} +111 -131
  267. package/{chunk-YFSM2366.js → chunk-rvvn2rhj.js} +28 -22
  268. package/{chunk-4Y6CZ2N4.js → chunk-s0fpz7ht.js} +37 -33
  269. package/{chunk-VI4SWTUO.js → chunk-s1cqzb2r.js} +77 -65
  270. package/{chunk-6QDYSCPW.js → chunk-s8q81tda.js} +73 -65
  271. package/chunk-s9hy639e.js +6 -0
  272. package/{chunk-R5GO3YZP.js → chunk-s9vbwme8.js} +115 -106
  273. package/chunk-sger1m1b.js +20 -0
  274. package/chunk-spe6crvk.js +60 -0
  275. package/chunk-spwsrvh9.js +70 -0
  276. package/chunk-sr05zpk7.js +573 -0
  277. package/{chunk-M2EJHDJP.js → chunk-srncrd3f.js} +1 -12
  278. package/{chunk-QXHFIX7W.js → chunk-sry80bpx.js} +71 -53
  279. package/{chunk-PSCNXBYA.js → chunk-t6q69p83.js} +3 -4
  280. package/{chunk-UAD2WT54.js → chunk-t714r4q0.js} +9 -28
  281. package/chunk-t7vbraqe.js +42 -0
  282. package/{chunk-CVMMWN6P.js → chunk-td7653rr.js} +10 -20
  283. package/{chunk-3BQDF4QB.js → chunk-tmytcetz.js} +17 -21
  284. package/{chunk-AMWMV56B.js → chunk-tta4prwg.js} +16 -15
  285. package/chunk-tvh8azgq.js +4829 -0
  286. package/{chunk-ID4G2MAR.js → chunk-v08kbfm8.js} +10 -11
  287. package/{chunk-OKPOQGQJ.js → chunk-v1x702q8.js} +801 -852
  288. package/{chunk-KHCLMKZZ.js → chunk-v39fea91.js} +576 -247
  289. package/{chunk-OW765XBU.js → chunk-vejtd8p2.js} +3 -4
  290. package/chunk-vep7zkha.js +368 -0
  291. package/chunk-vfwn1k7n.js +142 -0
  292. package/chunk-vg68vxhx.js +20 -0
  293. package/chunk-vgcqgnsm.js +31 -0
  294. package/{chunk-NF64D32W.js → chunk-vnzyjdea.js} +1 -3
  295. package/{chunk-ZCLSM5AK.js → chunk-vqgtw1px.js} +800 -717
  296. package/chunk-vv1gr5xz.js +76 -0
  297. package/{spaceCommands-Z2CTQD6G.js → chunk-w1qeadpq.js} +176 -242
  298. package/chunk-w468ez1p.js +13 -0
  299. package/chunk-w49s0t79.js +14 -0
  300. package/{mcpLocalManageCommands-KUDZQRM4.js → chunk-w58zhfbn.js} +91 -93
  301. package/chunk-w5b74aq6.js +11 -0
  302. package/chunk-w7y41qyw.js +117 -0
  303. package/chunk-w820gg1w.js +4165 -0
  304. package/{chunk-DBJAJ4UD.js → chunk-wdsmaqmt.js} +399 -453
  305. package/{chunk-3EUW3WEO.js → chunk-wfvvnmmj.js} +1 -3
  306. package/{chunk-QY4NZCDA.js → chunk-wkr04bhk.js} +432 -651
  307. package/{chunk-KUG52IAP.js → chunk-ws402twv.js} +1 -3
  308. package/chunk-wzwh311q.js +164 -0
  309. package/{runtimeModeArgs-X7DL7PUN.js → chunk-x5vtgvwn.js} +6 -5
  310. package/{agentMachineCommands-COJD2KPZ.js → chunk-x8h2csmq.js} +152 -195
  311. package/{chunk-BAZCS5XG.js → chunk-x9zfjnrc.js} +59 -47
  312. package/{chunk-WTIJKWCI.js → chunk-xcarc2rf.js} +50 -56
  313. package/chunk-xf33gz0a.js +8 -0
  314. package/{chunk-PVFYPUIM.js → chunk-y7b3gwx1.js} +78 -71
  315. package/{memoryCommands-SVLAVFCV.js → chunk-y7sphmnh.js} +119 -95
  316. package/{agentListCommands-436FHOIT.js → chunk-ycvaafhc.js} +260 -374
  317. package/chunk-yd7zprb0.js +9 -0
  318. package/chunk-yfz3d27k.js +40 -0
  319. package/{chunk-MKR6KDD3.js → chunk-ykv9g3m4.js} +141 -125
  320. package/chunk-ystjgb9e.js +544 -0
  321. package/chunk-yysxn7ep.js +12 -0
  322. package/{chunk-AL3TYDIF.js → chunk-z17eyawk.js} +18 -16
  323. package/{machineCommands-RVB5OG2X.js → chunk-z17q416p.js} +442 -563
  324. package/chunk-z1n98pcf.js +12 -0
  325. package/{dialogTraceCommand-HWXGIGZX.js → chunk-z566jx5r.js} +292 -397
  326. package/chunk-zjxd6942.js +6 -0
  327. package/{versionChangeNotice-RFABJGJE.js → chunk-zk11x9y5.js} +7 -9
  328. package/{chunk-TEFD5E2D.js → chunk-zt73yc33.js} +48 -51
  329. package/chunk-zvs2fra1.js +5 -0
  330. package/{chunk-SVFFKLMR.js → chunk-zwee84rh.js} +117 -141
  331. package/chunk-zxgfqv72.js +8 -0
  332. package/index.js +53 -69
  333. package/package.json +4 -4
  334. package/_executeModel-YQNZNR2Y.js +0 -341
  335. package/action-UK3HXGXF.js +0 -30
  336. package/addContentAction-CAKFVBDM.js +0 -38
  337. package/addDialogAgentAction-KLJ2YWWM.js +0 -77
  338. package/agentDeleteCommand-S5FVPYKT.js +0 -523
  339. package/agentEmailCommands-ZEFMGVKM.js +0 -742
  340. package/agentRecordCommands-JZ35AC5A.js +0 -211
  341. package/agentRun-UIO43TUG.js +0 -251
  342. package/agentRunCommand-ATLKKD6O.js +0 -249
  343. package/agentRunControl-U2MV74WR.js +0 -211
  344. package/agentRuntimeLocal-P4MMGIR6.js +0 -189
  345. package/agentSlice-HHNKNNYM.js +0 -52
  346. package/appConfigCommands-W4JQHMOJ.js +0 -417
  347. package/appDeleteCommands-IXR47IAV.js +0 -183
  348. package/appDeployCommands-LB6DHDF4.js +0 -232
  349. package/appDeployStatusCommands-UQ6MJL6D.js +0 -204
  350. package/appGetCommands-M5JCTDDQ.js +0 -185
  351. package/appListCommands-TE3ZHE3I.js +0 -186
  352. package/appMigrateCommands-FOXH6R4B.js +0 -230
  353. package/appSourceCommands-3ACYB6I7.js +0 -279
  354. package/authCommand-I5OBJP5S.js +0 -66
  355. package/authCommands-I6KCGOCN.js +0 -54
  356. package/builtinSkillRegistry-MIXYSZUU.js +0 -35
  357. package/chromeOpsCommands-IZRCYDSW.js +0 -579
  358. package/chunk-24BICQPB.js +0 -25
  359. package/chunk-2E4BYAUE.js +0 -69
  360. package/chunk-2O72G3U2.js +0 -17157
  361. package/chunk-2OROOEOQ.js +0 -229
  362. package/chunk-2R6M34JP.js +0 -27225
  363. package/chunk-2SXN7LAY.js +0 -15
  364. package/chunk-35JIFLIG.js +0 -30
  365. package/chunk-3VXVE2LF.js +0 -12
  366. package/chunk-4DBTBNTX.js +0 -477
  367. package/chunk-4JH2UMJR.js +0 -40
  368. package/chunk-4RUQ2PFX.js +0 -432
  369. package/chunk-4SN6J65J.js +0 -38
  370. package/chunk-5MMAK75Q.js +0 -15
  371. package/chunk-6NYQHXMV.js +0 -1737
  372. package/chunk-6R4IY46J.js +0 -14
  373. package/chunk-7E6YXSFZ.js +0 -441
  374. package/chunk-7K4J76JQ.js +0 -917
  375. package/chunk-7LR2IFUH.js +0 -100
  376. package/chunk-AETZ7AD6.js +0 -274
  377. package/chunk-ATNTHIZI.js +0 -13
  378. package/chunk-BPB3T5EU.js +0 -791
  379. package/chunk-BV3FLP2L.js +0 -133
  380. package/chunk-BVYHE6QD.js +0 -110
  381. package/chunk-BWJLEN6X.js +0 -1388
  382. package/chunk-CHOZJMJS.js +0 -78
  383. package/chunk-D2LTQAGN.js +0 -464
  384. package/chunk-DALXH7BG.js +0 -3392
  385. package/chunk-DBCWXGOC.js +0 -15210
  386. package/chunk-DLXL4NSL.js +0 -1179
  387. package/chunk-DSBRIUX5.js +0 -23
  388. package/chunk-DWLEOOGR.js +0 -8
  389. package/chunk-E2KZNP6C.js +0 -13
  390. package/chunk-E5JV4DCB.js +0 -272
  391. package/chunk-EUGTFFO6.js +0 -42
  392. package/chunk-FBNVJ2TO.js +0 -294
  393. package/chunk-FGXG6OLW.js +0 -34
  394. package/chunk-G22P2J7O.js +0 -1775
  395. package/chunk-HEVRQGGH.js +0 -106
  396. package/chunk-HHXF57CL.js +0 -180
  397. package/chunk-HI5RS2O4.js +0 -2109
  398. package/chunk-HJTI7RZV.js +0 -94
  399. package/chunk-HRWRIPTB.js +0 -531
  400. package/chunk-HYCVEESH.js +0 -2824
  401. package/chunk-I42VC5KR.js +0 -15
  402. package/chunk-IB5AR52X.js +0 -15
  403. package/chunk-IIRJ4P4I.js +0 -24
  404. package/chunk-IT3ZZRJE.js +0 -12
  405. package/chunk-IV6VUVLJ.js +0 -88
  406. package/chunk-J42X32PV.js +0 -472
  407. package/chunk-JDMWYVUF.js +0 -449
  408. package/chunk-JKVOKKMQ.js +0 -53
  409. package/chunk-JRTNUU5Z.js +0 -54
  410. package/chunk-K7HLFORE.js +0 -226
  411. package/chunk-KGBASAB5.js +0 -74
  412. package/chunk-KGKTN2NX.js +0 -25
  413. package/chunk-KX6YBIHG.js +0 -8
  414. package/chunk-KYHNSSL2.js +0 -62
  415. package/chunk-KZO2MTVM.js +0 -140
  416. package/chunk-LKZPX6YH.js +0 -0
  417. package/chunk-LLP2NDED.js +0 -201
  418. package/chunk-LOFRSJX2.js +0 -47
  419. package/chunk-M75RM77T.js +0 -3970
  420. package/chunk-MDAYRIP7.js +0 -1889
  421. package/chunk-MI6HRMCK.js +0 -25
  422. package/chunk-MTNQNLSE.js +0 -1029
  423. package/chunk-NH4PUEWK.js +0 -762
  424. package/chunk-NHLLXINQ.js +0 -8
  425. package/chunk-NTUNHTJV.js +0 -40
  426. package/chunk-OJKUU3LP.js +0 -67
  427. package/chunk-OQH3TAB7.js +0 -299
  428. package/chunk-P62DHV4F.js +0 -443
  429. package/chunk-PHIERFHT.js +0 -574
  430. package/chunk-PKDFU6MY.js +0 -102
  431. package/chunk-PL5RKESU.js +0 -40
  432. package/chunk-PSJJBBWV.js +0 -42
  433. package/chunk-QKM55LP2.js +0 -739
  434. package/chunk-QQ56R7KS.js +0 -88
  435. package/chunk-QYPE3TS3.js +0 -43
  436. package/chunk-REAE2SZK.js +0 -62
  437. package/chunk-RGQ4UUWZ.js +0 -208
  438. package/chunk-RIRFHJTW.js +0 -353
  439. package/chunk-RYMLMTPZ.js +0 -547
  440. package/chunk-SSGTV4FC.js +0 -303
  441. package/chunk-SVKWZ3EG.js +0 -607
  442. package/chunk-T7KODHYS.js +0 -317
  443. package/chunk-TGVVE5BA.js +0 -3085
  444. package/chunk-TKLBBR7P.js +0 -779
  445. package/chunk-TZXPT53C.js +0 -8
  446. package/chunk-U67V476Y.js +0 -35
  447. package/chunk-UEILX4EV.js +0 -15
  448. package/chunk-VIWDGTDA.js +0 -8
  449. package/chunk-VXUQWCEZ.js +0 -138
  450. package/chunk-W5GKF5ZW.js +0 -32
  451. package/chunk-WDWZPASX.js +0 -29
  452. package/chunk-WX266G2C.js +0 -9594
  453. package/chunk-YCITCYSJ.js +0 -356
  454. package/chunk-Z3KTXWWB.js +0 -76
  455. package/chunk-ZC3CMUKU.js +0 -322
  456. package/chunk-ZSZBHRLP.js +0 -1710
  457. package/chunk-ZV7ZY46L.js +0 -1343
  458. package/cliAgentConfigHelpers-WB2S7PDO.js +0 -47
  459. package/cliAuthorityBrokerClient-3SKOA7OZ.js +0 -23
  460. package/cliAuthorityBrokerProcess-BMBVXPKU.js +0 -24
  461. package/cliAuthorityStoreDriver-6FE3BJNB.js +0 -20
  462. package/cliEnvHelpers-7V5ZWUJA.js +0 -34
  463. package/cliExecutor-N3445G2Z.js +0 -45
  464. package/cliLocalAgentRecordReader-QKKRK53P.js +0 -113
  465. package/cloudAutomationCommands-S52NKCLL.js +0 -310
  466. package/contentThunks-ERA42OXW.js +0 -100
  467. package/cooldownCommands-ZFDAL4MR.js +0 -79
  468. package/createAgentAutomationAction-DMD2VDPI.js +0 -173
  469. package/createDialogAction-3SPOJQAK.js +0 -87
  470. package/createPageAction-AVXUMZVT.js +0 -91
  471. package/cursorProvider-2RACMEMF.js +0 -6123
  472. package/db-LTHLW7QA.js +0 -178
  473. package/dbSlice-WNUHTF4C.js +0 -76
  474. package/deleteDbKey-KV6MYBAI.js +0 -87
  475. package/desktopFolderProjects-4POAMVJN.js +0 -45
  476. package/dialogCommands-4MOLJW4G.js +0 -165
  477. package/dialogMessageRecord-2HJTEXQX.js +0 -7
  478. package/dialogNotifyCommand-YL2GFKLO.js +0 -45
  479. package/dialogSlice-Q7H2YVNO.js +0 -200
  480. package/dialogUsageCommand-IO2BQKL2.js +0 -31
  481. package/docCreateCommands-OYLRBK2M.js +0 -255
  482. package/docDeleteCommands-3NF6QPJU.js +0 -226
  483. package/docReadCommands-CBAERJAP.js +0 -184
  484. package/docStore-GWPFDV6Y.js +0 -89
  485. package/docUpdateCommands-BAMCGX6F.js +0 -326
  486. package/ebookDownloaderAgentCommand-NOIZ6U7Y.js +0 -675
  487. package/fetchMessages-P7FSCSXV.js +0 -19
  488. package/getPricing-KNXVEIUI.js +0 -40
  489. package/hostCredentialCreate-2VEYBXJV.js +0 -402
  490. package/i18n-SAK6DDY4.js +0 -51
  491. package/keys-FXEGMKSG.js +0 -183
  492. package/legacyMigration-TF4SYJCZ.js +0 -19
  493. package/levelAuthorityStore-L5SVDM5O.js +0 -10
  494. package/localAutomationCommands-XSK7SM7I.js +0 -199
  495. package/localAutomationRuntime-5WBO7HGQ.js +0 -61
  496. package/localRecall-BDYKXB46.js +0 -17
  497. package/localRuntimeAdapter-Y6H6XRIH.js +0 -310
  498. package/localRuntimeAuthority-Q5C2KWGF.js +0 -45
  499. package/localRuntimeDb-MM3DINZM.js +0 -12
  500. package/machineInfo-HNPJHQFU.js +0 -14
  501. package/machineWsRunDispatch-Y5SJGCEE.js +0 -228
  502. package/models-TOXYINNM.js +0 -10
  503. package/oauthTokenStore-RUYNYALS.js +0 -24
  504. package/overlay-JA3SPVUS.js +0 -15
  505. package/parityCommands-5OCBPVES.js +0 -613
  506. package/processSpawn-6GEO77KV.js +0 -11
  507. package/profileConfig-KOWK4HOG.js +0 -49
  508. package/projectArchive-WE3VVPZ2.js +0 -132
  509. package/providerPresetApply-YCVSP2WX.js +0 -235
  510. package/providerRegistry-26PAUYH2.js +0 -24
  511. package/read-D4WYJQJQ.js +0 -32
  512. package/readDocTool-3S3OQFOH.js +0 -22
  513. package/rememberExplicit-ZPI6KK5M.js +0 -16
  514. package/remove-AHRMUDMH.js +0 -32
  515. package/removeDialogAgentAction-AALRBFSA.js +0 -81
  516. package/secretCommands-2PSS3QNZ.js +0 -24
  517. package/setDialogExtraReferencesAction-SLHQ3GYL.js +0 -39
  518. package/setPrimaryDialogAgentAction-XKCSGJ7M.js +0 -96
  519. package/skillDiscovery-IUEZZG2B.js +0 -29
  520. package/skillSummaryMarker-62UW7HI7.js +0 -9
  521. package/slateToRenderMarkdown-R3X74MCX.js +0 -7
  522. package/slateUtils-ESQAJ6RN.js +0 -19
  523. package/store-WSAVTR32.js +0 -50
  524. package/switchDialogAgentAction-YJIWQGIR.js +0 -70
  525. package/tombstones-FQQMEDOW.js +0 -32
  526. package/toolApiClient-FVXTIIEN.js +0 -42
  527. package/tools-WN4AVSNS.js +0 -147
  528. package/tuiRestart-LU2BDLAW.js +0 -50
  529. package/tuiSummaryLlmCaller-Z2ZVBIGN.js +0 -53
  530. package/updateCommands-4QP7WJLA.js +0 -63
  531. package/usageCommand-AZX7D3LB.js +0 -31
  532. package/usageRebuildCommand-XV5QQCHK.js +0 -623
  533. package/userDataMerge-HT2ZVHBJ.js +0 -13
  534. package/windowsSelfUpdate-5OFKSW6Y.js +0 -14
  535. package/workContext-ZAW6VXT7.js +0 -18
  536. package/workContextAccess-VU5I4LKZ.js +0 -11
  537. package/workContextWriteNotice-YCSSMHN4.js +0 -7
  538. /package/{chunk-BYXBJQAS.js → chunk-0bcc25vg.js} +0 -0
@@ -1,90 +1,152 @@
1
1
  import {
2
- createCliLocalRuntimeAdapter,
2
+ isAgyAcpEnabled2,
3
+ isAgyAcpSharedDaemonEnabled2,
4
+ attachExecutionStoppedPromise2,
5
+ getExecutionStoppedPromise2
6
+ } from "./chunk-tvh8azgq.js";
7
+ import {
8
+ parseUserIdFromAuthToken2
9
+ } from "./chunk-cfh6tfc3.js";
10
+ import {
11
+ withQueueLock2
12
+ } from "./chunk-r7sfwdka.js";
13
+ import {
3
14
  getOrCreateSharedStore,
4
15
  isCliProviderAgentConfig,
5
- summarizeEndpoint
6
- } from "./chunk-QAW6BEWQ.js";
16
+ summarizeEndpoint,
17
+ isCursorOAuthAgent,
18
+ createCliLocalRuntimeAdapter2
19
+ } from "./chunk-57eyhmwr.js";
7
20
  import {
8
- attachExecutionStoppedPromise,
9
- getExecutionStoppedPromise
10
- } from "./chunk-DALXH7BG.js";
21
+ isPathInsideRoot,
22
+ createLocalWorkspaceToolExecutors,
23
+ executeLocalToolWithPolicy2,
24
+ runLocalAgentTurn2
25
+ } from "./chunk-cy7thb6n.js";
11
26
  import {
12
- isCursorOAuthAgent
13
- } from "./chunk-VIWDGTDA.js";
27
+ spawnProcess2,
28
+ readPipeText2
29
+ } from "./chunk-6cdcbmtp.js";
14
30
  import {
15
- clipMultilineText
16
- } from "./chunk-ZSZBHRLP.js";
31
+ asRecordOrEmpty,
32
+ resolveLocalRuntimeEnvFromPolicy
33
+ } from "./chunk-2ygg7azv.js";
34
+ import {
35
+ applyToolSurfaceConstraints
36
+ } from "./chunk-fs3bvh2p.js";
37
+ import {
38
+ isDialogTurnRef
39
+ } from "./chunk-pwqnvbt7.js";
17
40
  import {
18
41
  DialogTurnBusyError,
19
- acquireLocalDialogTurnLease,
20
42
  propagateLocalDialogTurnAuthority,
21
43
  resolveLocalDialogTurnAuthority,
22
44
  sanitizeDialogTurnIdentifier,
45
+ acquireLocalDialogTurnLease,
23
46
  startDialogTurnHeartbeat
24
- } from "./chunk-J44TXB4J.js";
25
- import {
26
- withQueueLock
27
- } from "./chunk-I5BYFTYK.js";
47
+ } from "./chunk-fcsc2day.js";
28
48
  import {
29
- createLocalWorkspaceToolExecutors,
30
- executeLocalToolWithPolicy,
31
- isPathInsideRoot,
32
- runLocalAgentTurn
33
- } from "./chunk-2R6M34JP.js";
34
- import {
35
- resolveLocalRuntimeEnvFromPolicy
36
- } from "./chunk-SSGTV4FC.js";
37
- import {
38
- asRecordOrEmpty
39
- } from "./chunk-KX6YBIHG.js";
49
+ clipMultilineText
50
+ } from "./chunk-ex34n71b.js";
40
51
  import {
41
- resolveLocalUserId
42
- } from "./chunk-KGBASAB5.js";
52
+ resolveLocalUserId2
53
+ } from "./chunk-spwsrvh9.js";
43
54
  import {
44
- applyToolSurfaceConstraints
45
- } from "./chunk-TSBJVMNW.js";
55
+ t2
56
+ } from "./chunk-kn4dgg4j.js";
46
57
  import {
47
58
  ownedAgentKey
48
- } from "./chunk-M2EJHDJP.js";
59
+ } from "./chunk-srncrd3f.js";
49
60
  import {
50
61
  isRecord
51
- } from "./chunk-KUG52IAP.js";
52
- import {
53
- readPipeText,
54
- spawnProcess
55
- } from "./chunk-4O22PGNQ.js";
56
- import {
57
- isDialogTurnRef
58
- } from "./chunk-EUHMI5KG.js";
62
+ } from "./chunk-ws402twv.js";
59
63
  import {
60
64
  toErrorMessage
61
- } from "./chunk-HNMXYYJR.js";
65
+ } from "./chunk-jec44fkj.js";
62
66
  import {
63
67
  asTrimmedNonEmptyStringArray
64
- } from "./chunk-I42VC5KR.js";
65
- import {
66
- asTrimmedString
67
- } from "./chunk-3EUW3WEO.js";
68
+ } from "./chunk-w5b74aq6.js";
68
69
  import {
69
70
  asOptionalPositiveFiniteNumber
70
- } from "./chunk-U6VC4MU4.js";
71
+ } from "./chunk-96jtrqk1.js";
71
72
  import {
72
- parseUserIdFromAuthToken
73
- } from "./chunk-2AJLG6PY.js";
73
+ asTrimmedString
74
+ } from "./chunk-wfvvnmmj.js";
74
75
  import {
75
76
  DEFAULT_NOLO_SERVER_URL
76
- } from "./chunk-RF576RYE.js";
77
+ } from "./chunk-1cakzp6r.js";
77
78
  import {
78
79
  asOptionalTrimmedString
79
- } from "./chunk-G3SUCT4W.js";
80
- import {
81
- t
82
- } from "./chunk-M75RM77T.js";
80
+ } from "./chunk-p1vg4bx8.js";
83
81
 
84
- // packages/cli/machineWsRunDispatch.ts
85
- import { randomUUID } from "node:crypto";
86
- import { readFileSync as readFileSync3, renameSync as renameSync2, writeFileSync as writeFileSync4 } from "node:fs";
87
- import { join as join4, resolve as resolve2 } from "node:path";
82
+ // packages/ai/agent/machineRunPermissions.ts
83
+ var DEFAULT_POLICY = {
84
+ mode: "read_only",
85
+ allowFilesystemRead: true,
86
+ allowFilesystemWrite: false,
87
+ allowShell: false,
88
+ writableRoots: []
89
+ };
90
+ var WRITE_DENIED = "Machine permission denied: this bound machine agent is read-only for filesystem writes. Enable machine write permission for this agent before asking it to modify files.";
91
+ var SHELL_DENIED = "Machine permission denied: this bound machine agent cannot run arbitrary shell commands. Enable machine shell permission for this agent before asking it to execute commands.";
92
+ function normalizeWritableRoots(value) {
93
+ return asTrimmedNonEmptyStringArray(value);
94
+ }
95
+ function resolveMachineRunPermissionPolicy(agentConfig) {
96
+ const runtimeBinding = asRecordOrEmpty(agentConfig?.runtimeBinding);
97
+ const raw = asRecordOrEmpty(agentConfig?.machinePermissions ?? runtimeBinding.permissions ?? runtimeBinding.machinePermissions);
98
+ const mode = raw.mode === "full_access" || raw.allowFilesystemWrite === true || raw.allowShell === true ? "full_access" : "read_only";
99
+ if (mode === "full_access") {
100
+ return {
101
+ mode,
102
+ allowFilesystemRead: raw.allowFilesystemRead !== false,
103
+ allowFilesystemWrite: raw.allowFilesystemWrite !== false,
104
+ allowShell: raw.allowShell !== false,
105
+ writableRoots: normalizeWritableRoots(raw.writableRoots)
106
+ };
107
+ }
108
+ return {
109
+ ...DEFAULT_POLICY,
110
+ allowFilesystemRead: raw.allowFilesystemRead !== false
111
+ };
112
+ }
113
+ var WRITE_INTENT_RE = /\b(write|overwrite|edit|modify|delete|remove|rename|move|create|save|patch|apply patch|mkdir|touch|rm|rmdir|del|erase|copy-item|move-item|remove-item|set-content|add-content|new-item)\b|(\u5199\u5165|\u5199\u6587\u4EF6|\u5220\u9664|\u79FB\u9664|\u91CD\u547D\u540D|\u79FB\u52A8|\u521B\u5EFA|\u65B0\u5EFA|\u4FDD\u5B58|\u4FEE\u6539|\u7F16\u8F91|\u6253\u8865\u4E01|\u5E94\u7528\u8865\u4E01)/i;
114
+ var SHELL_INTENT_RE = /\b(run|execute|exec)\s+(?:a\s+)?(?:shell|command|terminal|powershell|pwsh|bash|zsh|cmd\.exe|npm|bun|node|python|git|curl|wget|ssh|scp|chmod|chown|sudo|tests?|test suite)\b|\b(open|start)\s+(?:a\s+)?(?:shell|terminal)\b|\b(powershell|pwsh|bash|zsh|cmd\.exe|ssh|sudo)\b|(\u8FD0\u884C\u547D\u4EE4|\u6267\u884C\u547D\u4EE4|\u547D\u4EE4\u884C|\u7EC8\u7AEF|\u63A7\u5236\u53F0)/i;
115
+ var NEGATION_RE = /\b(do not|don't|dont|never|no need to|without|非目标|不要|不需要|禁止|无需)\b|[\u4E0D\u975E]/i;
116
+ function stripNegatedPolicySentences(task) {
117
+ return task.split(/([\n.;!?。;!?])/).reduce((segments, part, index, parts) => {
118
+ if (index % 2 === 1)
119
+ return segments;
120
+ const separator = parts[index + 1] ?? "";
121
+ const segment = `${part}${separator}`;
122
+ const mentionsRestrictedAction = WRITE_INTENT_RE.test(segment) || SHELL_INTENT_RE.test(segment);
123
+ if (mentionsRestrictedAction && NEGATION_RE.test(segment))
124
+ return segments;
125
+ segments.push(segment);
126
+ return segments;
127
+ }, []).join("");
128
+ }
129
+ function assertMachineRunAllowed(userInput, policy) {
130
+ const task = stripNegatedPolicySentences(String(userInput || ""));
131
+ if (!policy.allowFilesystemWrite && WRITE_INTENT_RE.test(task)) {
132
+ throw new Error(WRITE_DENIED);
133
+ }
134
+ if (!policy.allowShell && SHELL_INTENT_RE.test(task)) {
135
+ throw new Error(SHELL_DENIED);
136
+ }
137
+ }
138
+ function buildMachinePermissionPromptBlock(policy) {
139
+ return [
140
+ "--- Machine permission policy ---",
141
+ `Mode: ${policy.mode}`,
142
+ `Filesystem reads are ${policy.allowFilesystemRead ? "allowed" : "not allowed"}.`,
143
+ `File writes are ${policy.allowFilesystemWrite ? "allowed" : "not allowed"}.`,
144
+ `Arbitrary shell commands are ${policy.allowShell ? "allowed" : "not allowed"}.`,
145
+ policy.writableRoots.length ? `Writable roots: ${policy.writableRoots.join(", ")}` : "Writable roots: none.",
146
+ "If the user asks for an operation outside this policy, refuse instead of attempting it."
147
+ ].join(`
148
+ `);
149
+ }
88
150
 
89
151
  // packages/cli/connectorInstanceLock.ts
90
152
  import {
@@ -101,9 +163,11 @@ import { homedir } from "node:os";
101
163
  import { join } from "node:path";
102
164
  function resolveConnectorStateDir(args = {}) {
103
165
  const homeDir = args.homeDir?.trim();
104
- if (homeDir) return join(homeDir, ".nolo", "connector");
166
+ if (homeDir)
167
+ return join(homeDir, ".nolo", "connector");
105
168
  const noloHome = args.noloHome?.trim() || process.env.NOLO_HOME?.trim();
106
- if (noloHome) return join(noloHome, "connector");
169
+ if (noloHome)
170
+ return join(noloHome, "connector");
107
171
  return join(homedir(), ".nolo", "connector");
108
172
  }
109
173
  function sanitizeMachineId(machineId) {
@@ -117,7 +181,8 @@ function connectorAliveSignalPath(args) {
117
181
  return join(resolveConnectorStateDir(args), `${sanitizeMachineId(args.machineId)}.alive`);
118
182
  }
119
183
  function isProcessAlive(pid) {
120
- if (!Number.isInteger(pid) || pid <= 0) return false;
184
+ if (!Number.isInteger(pid) || pid <= 0)
185
+ return false;
121
186
  try {
122
187
  process.kill(pid, 0);
123
188
  return true;
@@ -148,10 +213,11 @@ function inspectCorruptLock(lockPath, now = Date.now()) {
148
213
  try {
149
214
  const stat = statSync(lockPath);
150
215
  const ageMs = now - stat.mtimeMs;
151
- return ageMs > CONNECTOR_LOCK_CORRUPT_RECLAIM_SECONDS * 1e3 ? "expired" : "fresh";
216
+ return ageMs > CONNECTOR_LOCK_CORRUPT_RECLAIM_SECONDS * 1000 ? "expired" : "fresh";
152
217
  } catch (error) {
153
218
  const code = error?.code;
154
- if (code === "ENOENT") return "gone";
219
+ if (code === "ENOENT")
220
+ return "gone";
155
221
  return "fresh";
156
222
  }
157
223
  }
@@ -159,21 +225,21 @@ function acquireConnectorInstanceLock(args) {
159
225
  const lockPath = connectorInstanceLockPath(args);
160
226
  mkdirSync(resolveConnectorStateDir(args), { recursive: true });
161
227
  let reclaimed;
162
- for (let attempt = 0; attempt < 2; attempt += 1) {
228
+ for (let attempt = 0;attempt < 2; attempt += 1) {
163
229
  let fd = null;
164
230
  try {
165
231
  fd = openSync(lockPath, "wx");
166
232
  } catch (error) {
167
- if (!isEexist(error)) throw error;
168
- const ownerPid2 = readLockPid(lockPath);
169
- if (ownerPid2 !== null) {
170
- if (isProcessAlive(ownerPid2)) {
171
- return { ok: false, pid: ownerPid2 };
233
+ if (!isEexist(error))
234
+ throw error;
235
+ const ownerPid = readLockPid(lockPath);
236
+ if (ownerPid !== null) {
237
+ if (isProcessAlive(ownerPid)) {
238
+ return { ok: false, pid: ownerPid };
172
239
  }
173
240
  try {
174
241
  unlinkSync(lockPath);
175
- } catch {
176
- }
242
+ } catch {}
177
243
  continue;
178
244
  }
179
245
  const state = inspectCorruptLock(lockPath);
@@ -185,8 +251,7 @@ function acquireConnectorInstanceLock(args) {
185
251
  }
186
252
  try {
187
253
  unlinkSync(lockPath);
188
- } catch {
189
- }
254
+ } catch {}
190
255
  reclaimed = "corrupt";
191
256
  continue;
192
257
  }
@@ -206,11 +271,11 @@ function acquireConnectorInstanceLock(args) {
206
271
  }
207
272
  function releaseConnectorInstanceLock(lockPath) {
208
273
  const ownerPid = readLockPid(lockPath);
209
- if (ownerPid !== process.pid) return;
274
+ if (ownerPid !== process.pid)
275
+ return;
210
276
  try {
211
277
  unlinkSync(lockPath);
212
- } catch {
213
- }
278
+ } catch {}
214
279
  }
215
280
  function markConnectorAlive(args) {
216
281
  const path = connectorAliveSignalPath(args);
@@ -223,18 +288,15 @@ function markConnectorAlive(args) {
223
288
  } catch (error) {
224
289
  try {
225
290
  unlinkSync(tmpPath);
226
- } catch {
227
- }
291
+ } catch {}
228
292
  throw error;
229
293
  }
230
- } catch {
231
- }
294
+ } catch {}
232
295
  }
233
296
  function clearConnectorAlive(args) {
234
297
  try {
235
298
  unlinkSync(connectorAliveSignalPath(args));
236
- } catch {
237
- }
299
+ } catch {}
238
300
  }
239
301
  function withConnectorAliveSignal(sendHeartbeat, args) {
240
302
  return async () => {
@@ -244,12 +306,18 @@ function withConnectorAliveSignal(sendHeartbeat, args) {
244
306
  };
245
307
  }
246
308
 
309
+ // packages/cli/machineWsRunDispatch.ts
310
+ import { randomUUID } from "node:crypto";
311
+ import { readFileSync as readFileSync3, renameSync as renameSync2, writeFileSync as writeFileSync4 } from "node:fs";
312
+ import { join as join4, resolve as resolve2 } from "node:path";
313
+
247
314
  // packages/agent-runtime/connectorWorkspaceRequest.ts
248
315
  function isConnectorWorkspacePathHint(value) {
249
- return typeof value === "string" && value.trim().length > 0 && !value.includes("\0");
316
+ return typeof value === "string" && value.trim().length > 0 && !value.includes("\x00");
250
317
  }
251
318
  function isConnectorWorkspaceRequest(value) {
252
- if (!value || typeof value !== "object") return false;
319
+ if (!value || typeof value !== "object")
320
+ return false;
253
321
  const request = value;
254
322
  return request.mode === "strict" && isConnectorWorkspacePathHint(request.path);
255
323
  }
@@ -257,18 +325,21 @@ function isConnectorWorkspaceRequest(value) {
257
325
  // packages/cli/connectorWorkspaceCwd.ts
258
326
  import { realpathSync, statSync as statSync2 } from "node:fs";
259
327
  import { isAbsolute } from "node:path";
260
- var ConnectorWorkspaceError = class extends Error {
328
+ class ConnectorWorkspaceError extends Error {
329
+ code;
261
330
  constructor(code, message) {
262
331
  super(message);
263
332
  this.code = code;
264
333
  this.name = "ConnectorWorkspaceError";
265
334
  }
266
- };
335
+ }
267
336
  function realDirectory(path) {
268
- if (!isAbsolute(path)) throw new ConnectorWorkspaceError("workspace_path_unauthorized", "Workspace directory must be absolute.");
337
+ if (!isAbsolute(path))
338
+ throw new ConnectorWorkspaceError("workspace_path_unauthorized", "Workspace directory must be absolute.");
269
339
  try {
270
340
  const real = realpathSync(path);
271
- if (statSync2(real).isDirectory()) return real;
341
+ if (statSync2(real).isDirectory())
342
+ return real;
272
343
  } catch (err) {
273
344
  const code = err.code;
274
345
  if (code !== "ENOENT" && code !== "ENOTDIR") {
@@ -294,78 +365,10 @@ function resolveAuthorizedConnectorWorkspaceCwd(path, roots) {
294
365
  return realCwd;
295
366
  }
296
367
 
297
- // packages/ai/agent/machineRunPermissions.ts
298
- var DEFAULT_POLICY = {
299
- mode: "read_only",
300
- allowFilesystemRead: true,
301
- allowFilesystemWrite: false,
302
- allowShell: false,
303
- writableRoots: []
304
- };
305
- var WRITE_DENIED = "Machine permission denied: this bound machine agent is read-only for filesystem writes. Enable machine write permission for this agent before asking it to modify files.";
306
- var SHELL_DENIED = "Machine permission denied: this bound machine agent cannot run arbitrary shell commands. Enable machine shell permission for this agent before asking it to execute commands.";
307
- function normalizeWritableRoots(value) {
308
- return asTrimmedNonEmptyStringArray(value);
309
- }
310
- function resolveMachineRunPermissionPolicy(agentConfig) {
311
- const runtimeBinding = asRecordOrEmpty(agentConfig?.runtimeBinding);
312
- const raw = asRecordOrEmpty(
313
- agentConfig?.machinePermissions ?? runtimeBinding.permissions ?? runtimeBinding.machinePermissions
314
- );
315
- const mode = raw.mode === "full_access" || raw.allowFilesystemWrite === true || raw.allowShell === true ? "full_access" : "read_only";
316
- if (mode === "full_access") {
317
- return {
318
- mode,
319
- allowFilesystemRead: raw.allowFilesystemRead !== false,
320
- allowFilesystemWrite: raw.allowFilesystemWrite !== false,
321
- allowShell: raw.allowShell !== false,
322
- writableRoots: normalizeWritableRoots(raw.writableRoots)
323
- };
324
- }
325
- return {
326
- ...DEFAULT_POLICY,
327
- allowFilesystemRead: raw.allowFilesystemRead !== false
328
- };
329
- }
330
- var WRITE_INTENT_RE = /\b(write|overwrite|edit|modify|delete|remove|rename|move|create|save|patch|apply patch|mkdir|touch|rm|rmdir|del|erase|copy-item|move-item|remove-item|set-content|add-content|new-item)\b|(\u5199\u5165|\u5199\u6587\u4EF6|\u5220\u9664|\u79FB\u9664|\u91CD\u547D\u540D|\u79FB\u52A8|\u521B\u5EFA|\u65B0\u5EFA|\u4FDD\u5B58|\u4FEE\u6539|\u7F16\u8F91|\u6253\u8865\u4E01|\u5E94\u7528\u8865\u4E01)/i;
331
- var SHELL_INTENT_RE = /\b(run|execute|exec)\s+(?:a\s+)?(?:shell|command|terminal|powershell|pwsh|bash|zsh|cmd\.exe|npm|bun|node|python|git|curl|wget|ssh|scp|chmod|chown|sudo|tests?|test suite)\b|\b(open|start)\s+(?:a\s+)?(?:shell|terminal)\b|\b(powershell|pwsh|bash|zsh|cmd\.exe|ssh|sudo)\b|(\u8FD0\u884C\u547D\u4EE4|\u6267\u884C\u547D\u4EE4|\u547D\u4EE4\u884C|\u7EC8\u7AEF|\u63A7\u5236\u53F0)/i;
332
- var NEGATION_RE = /\b(do not|don't|dont|never|no need to|without|非目标|不要|不需要|禁止|无需)\b|[\u4E0D\u975E]/i;
333
- function stripNegatedPolicySentences(task) {
334
- return task.split(/([\n.;!?。;!?])/).reduce((segments, part, index, parts) => {
335
- if (index % 2 === 1) return segments;
336
- const separator = parts[index + 1] ?? "";
337
- const segment = `${part}${separator}`;
338
- const mentionsRestrictedAction = WRITE_INTENT_RE.test(segment) || SHELL_INTENT_RE.test(segment);
339
- if (mentionsRestrictedAction && NEGATION_RE.test(segment)) return segments;
340
- segments.push(segment);
341
- return segments;
342
- }, []).join("");
343
- }
344
- function assertMachineRunAllowed(userInput, policy) {
345
- const task = stripNegatedPolicySentences(String(userInput || ""));
346
- if (!policy.allowFilesystemWrite && WRITE_INTENT_RE.test(task)) {
347
- throw new Error(WRITE_DENIED);
348
- }
349
- if (!policy.allowShell && SHELL_INTENT_RE.test(task)) {
350
- throw new Error(SHELL_DENIED);
351
- }
352
- }
353
- function buildMachinePermissionPromptBlock(policy) {
354
- return [
355
- "--- Machine permission policy ---",
356
- `Mode: ${policy.mode}`,
357
- `Filesystem reads are ${policy.allowFilesystemRead ? "allowed" : "not allowed"}.`,
358
- `File writes are ${policy.allowFilesystemWrite ? "allowed" : "not allowed"}.`,
359
- `Arbitrary shell commands are ${policy.allowShell ? "allowed" : "not allowed"}.`,
360
- policy.writableRoots.length ? `Writable roots: ${policy.writableRoots.join(", ")}` : "Writable roots: none.",
361
- "If the user asks for an operation outside this policy, refuse instead of attempting it."
362
- ].join("\n");
363
- }
364
-
365
368
  // packages/cli/connectorRunArtifact.ts
366
369
  import { existsSync } from "node:fs";
367
370
  import { resolve } from "node:path";
368
- var MAX_PATCH_PREVIEW_CHARS = 24e3;
371
+ var MAX_PATCH_PREVIEW_CHARS = 24000;
369
372
  function normalizePath(value) {
370
373
  return resolve(value.trim());
371
374
  }
@@ -380,7 +383,7 @@ function resolveConnectorRunCwd(args) {
380
383
  }
381
384
  var RUN_GIT_TIMEOUT_MS = 1e4;
382
385
  async function runGit(args, cwd, options = {}) {
383
- const proc = spawnProcess({
386
+ const proc = spawnProcess2({
384
387
  cmd: options.workspaceOnly ? ["git", "--literal-pathspecs", "-c", "core.fsmonitor=false", "-c", "core.hooksPath=", ...args] : ["git", ...args],
385
388
  cwd,
386
389
  stdout: "pipe",
@@ -388,32 +391,30 @@ async function runGit(args, cwd, options = {}) {
388
391
  stdin: "ignore"
389
392
  });
390
393
  const [stdout, , exitCode] = await Promise.all([
391
- readPipeText(proc.stdout),
392
- // git 在非仓库目录对 diff 系子命令会向 stderr 打印整段 usage(数十 KB):
393
- // 不消费 stderr 会让 git 阻塞在写满的 stderr 管道上永不退出(bun:child_process),
394
- // proc.exited 随之永不 resolve——connector 收尾整体挂死(2026-09-16 实测)。
395
- readPipeText(proc.stderr),
396
- // 超时保险丝:该路径历史上出过「进程不退出」类挂死(见上);超时 kill 后流关闭、
397
- // Promise.all 收敛,-1 与真实非零退出一样走「无数据」降级。
398
- new Promise((resolve3) => {
394
+ readPipeText2(proc.stdout),
395
+ readPipeText2(proc.stderr),
396
+ new Promise((resolve) => {
399
397
  const timer = setTimeout(() => {
400
398
  proc.kill();
401
- resolve3(-1);
399
+ resolve(-1);
402
400
  }, RUN_GIT_TIMEOUT_MS);
403
- void proc.exited.then((code) => {
401
+ proc.exited.then((code) => {
404
402
  clearTimeout(timer);
405
- resolve3(code);
403
+ resolve(code);
406
404
  });
407
405
  })
408
406
  ]);
409
- if (exitCode !== 0) return null;
407
+ if (exitCode !== 0)
408
+ return null;
410
409
  return options.trim === false ? stdout.replace(/\r?\n$/, "") : stdout.trim();
411
410
  }
412
411
  function parseStatusChangedFiles(statusShort) {
413
- if (!statusShort) return [];
412
+ if (!statusShort)
413
+ return [];
414
414
  return [...new Set(statusShort.split(/\r?\n/).map((line) => {
415
415
  const porcelainMatch = line.match(/^.{2} (.+)$/);
416
- if (porcelainMatch?.[1]) return porcelainMatch[1].trim();
416
+ if (porcelainMatch?.[1])
417
+ return porcelainMatch[1].trim();
417
418
  const trimmedMatch = line.match(/^[MADRCU?!]{1,2}\s+(.+)$/);
418
419
  return trimmedMatch?.[1]?.trim() ?? "";
419
420
  }).map((line) => line.includes(" -> ") ? line.split(" -> ").at(-1) ?? line : line).filter(Boolean))];
@@ -422,7 +423,7 @@ async function readConnectorGitHead(cwd, options) {
422
423
  return runGit(["rev-parse", "HEAD"], cwd, options);
423
424
  }
424
425
  async function collectConnectorRunArtifact(args) {
425
- const collectedAt = (/* @__PURE__ */ new Date()).toISOString();
426
+ const collectedAt = new Date().toISOString();
426
427
  try {
427
428
  const scope = args.workspaceOnly ? ["--", "."] : [];
428
429
  const submoduleOptions = args.workspaceOnly ? ["--ignore-submodules=all"] : [];
@@ -435,7 +436,7 @@ async function collectConnectorRunArtifact(args) {
435
436
  runGit(["diff", "--stat", ...diffOptions, ...scope], args.cwd, options),
436
437
  runGit(["diff", "--no-color", "--unified=3", ...diffOptions, ...scope], args.cwd, options)
437
438
  ]);
438
- const patchPreview = patchText ? clipMultilineText(patchText, MAX_PATCH_PREVIEW_CHARS) || void 0 : void 0;
439
+ const patchPreview = patchText ? clipMultilineText(patchText, MAX_PATCH_PREVIEW_CHARS) || undefined : undefined;
439
440
  return {
440
441
  cwd: args.cwd,
441
442
  exitStatus: args.exitStatus,
@@ -473,7 +474,7 @@ function shortHash(value) {
473
474
  }
474
475
  function resolvePromptInlineMaxBytes(env) {
475
476
  const raw = Number(env.NOLO_CONNECTOR_PROMPT_INLINE_MAX_BYTES);
476
- return Number.isFinite(raw) && raw >= 1024 ? raw : 32e3;
477
+ return Number.isFinite(raw) && raw >= 1024 ? raw : 32000;
477
478
  }
478
479
  function materializeLargeConnectorPrompt(args) {
479
480
  const promptBytes = byteLength(args.prompt);
@@ -509,7 +510,8 @@ function materializeLargeConnectorPrompt(args) {
509
510
  "Prefer the cloud prompt page for shared context when readable; use the local prompt file as fallback.",
510
511
  "Local repository edits, diffs, test output, and commits are still authoritative for local execution facts.",
511
512
  "If neither source is readable, stop and report PROMPT_REF_UNREADABLE with both references."
512
- ].join("\n"),
513
+ ].join(`
514
+ `),
513
515
  promptBytes,
514
516
  promptHash,
515
517
  promptRef
@@ -517,21 +519,22 @@ function materializeLargeConnectorPrompt(args) {
517
519
  }
518
520
  function readRuntimePromptPageMeta(parsed) {
519
521
  const page = parsed?.payload?.meta?.runtimePromptPage;
520
- if (!page || typeof page !== "object") return null;
522
+ if (!page || typeof page !== "object")
523
+ return null;
521
524
  return {
522
- dbKey: typeof page.dbKey === "string" ? page.dbKey : void 0,
523
- promptHash: typeof page.promptHash === "string" ? page.promptHash : void 0,
524
- contentBytes: typeof page.contentBytes === "number" ? page.contentBytes : void 0
525
+ dbKey: typeof page.dbKey === "string" ? page.dbKey : undefined,
526
+ promptHash: typeof page.promptHash === "string" ? page.promptHash : undefined,
527
+ contentBytes: typeof page.contentBytes === "number" ? page.contentBytes : undefined
525
528
  };
526
529
  }
527
530
 
528
531
  // packages/cli/machineWsRunDispatchPurity.ts
529
- var WindowsConnectorCliFencingUnsupportedError = class extends Error {
532
+ class WindowsConnectorCliFencingUnsupportedError extends Error {
530
533
  code = "connector_windows_cli_fencing_unsupported";
531
534
  constructor() {
532
535
  super("Windows Connector CLI process-tree isolation is not enabled; Windows Job Object support is required for dialog turns.");
533
536
  }
534
- };
537
+ }
535
538
  function logConnectorRun(message, fields = {}) {
536
539
  console.error(`[nolo-connector] ${message} ${JSON.stringify(fields)}`);
537
540
  }
@@ -568,7 +571,8 @@ function summarizeAgentConfigForLogs(agentConfig) {
568
571
  };
569
572
  }
570
573
  function readField(record, key) {
571
- if (!isRecord(record)) return void 0;
574
+ if (!isRecord(record))
575
+ return;
572
576
  return record[key];
573
577
  }
574
578
  function runtimePolicyFromConnectorPayload(parsed) {
@@ -579,12 +583,10 @@ function runtimePolicyFromConnectorPayload(parsed) {
579
583
  const agentConfig = asRecordOrEmpty(payload.agentConfig);
580
584
  const fromAgent = readField(agentConfig, "runtimeToolPolicy");
581
585
  const policy = isRecord(fromMeta) ? fromMeta : isRecord(fromAgent) ? fromAgent : null;
582
- return policy ? policy : void 0;
586
+ return policy ? policy : undefined;
583
587
  }
584
588
  function requestsLocalWorkspaceRuntime(policy) {
585
- return Boolean(
586
- Array.isArray(policy?.runtimeTools) && policy.runtimeTools.length > 0
587
- );
589
+ return Boolean(Array.isArray(policy?.runtimeTools) && policy.runtimeTools.length > 0);
588
590
  }
589
591
  function isMachineBoundLocalCustomProvider(agentConfig) {
590
592
  const config = asRecordOrEmpty(agentConfig);
@@ -593,7 +595,8 @@ function isMachineBoundLocalCustomProvider(agentConfig) {
593
595
  const machineId = asTrimmedString(machineIdRaw);
594
596
  const providerUrlRaw = readField(config, "customProviderUrl");
595
597
  const providerUrl = asTrimmedString(providerUrlRaw);
596
- if (!machineId || !providerUrl) return false;
598
+ if (!machineId || !providerUrl)
599
+ return false;
597
600
  try {
598
601
  const hostname = new URL(providerUrl).hostname.toLowerCase();
599
602
  return hostname === "127.0.0.1" || hostname === "localhost" || hostname === "::1";
@@ -604,12 +607,11 @@ function isMachineBoundLocalCustomProvider(agentConfig) {
604
607
  function hasExplicitMachinePermissions(agentConfig) {
605
608
  const config = asRecordOrEmpty(agentConfig);
606
609
  const runtimeBinding = asRecordOrEmpty(config.runtimeBinding);
607
- return Boolean(
608
- isRecord(readField(config, "machinePermissions")) || isRecord(readField(runtimeBinding, "permissions")) || isRecord(readField(runtimeBinding, "machinePermissions")) || isRecord(readField(readField(config, "boundRuntimeMachine"), "permissions"))
609
- );
610
+ return Boolean(isRecord(readField(config, "machinePermissions")) || isRecord(readField(runtimeBinding, "permissions")) || isRecord(readField(runtimeBinding, "machinePermissions")) || isRecord(readField(readField(config, "boundRuntimeMachine"), "permissions")));
610
611
  }
611
612
  function runtimeWorkspacePermissionPolicy(runtimePolicy, runtimeEnv, cwd) {
612
- if (!requestsLocalWorkspaceRuntime(runtimePolicy)) return null;
613
+ if (!requestsLocalWorkspaceRuntime(runtimePolicy))
614
+ return null;
613
615
  return {
614
616
  mode: "full_access",
615
617
  allowFilesystemRead: true,
@@ -622,7 +624,7 @@ var STRICT_READ_TOOLS = ["readFile"];
622
624
  var STRICT_WRITE_TOOLS = ["writeFile", "editFile"];
623
625
  function strictConnectorWorkspacePolicy(machine, runtime, cwd) {
624
626
  const runtimeTools = Array.isArray(runtime?.runtimeTools) ? runtime.runtimeTools : [];
625
- const withinRuntimeRoots = (roots) => roots === void 0 || Array.isArray(roots) && connectorWorkspaceIsWithinRoots(cwd, roots);
627
+ const withinRuntimeRoots = (roots) => roots === undefined || Array.isArray(roots) && connectorWorkspaceIsWithinRoots(cwd, roots);
626
628
  const allowFilesystemWrite = machine.allowFilesystemWrite && connectorWorkspaceIsWithinRoots(cwd, machine.writableRoots) && withinRuntimeRoots(runtime?.workspace?.writableRoots) && STRICT_WRITE_TOOLS.some((tool) => runtimeTools.includes(tool));
627
629
  return {
628
630
  mode: allowFilesystemWrite ? "full_access" : "read_only",
@@ -639,7 +641,8 @@ function strictConnectorWorkspaceToolNames(permission, runtime) {
639
641
  ].filter((tool) => Array.isArray(runtime?.runtimeTools) && runtime.runtimeTools.includes(tool));
640
642
  }
641
643
  function scopePermissionPolicyToRuntimeWorkspace(policy, runtimePolicy, cwd) {
642
- if (!requestsLocalWorkspaceRuntime(runtimePolicy)) return policy;
644
+ if (!requestsLocalWorkspaceRuntime(runtimePolicy))
645
+ return policy;
643
646
  return {
644
647
  ...policy,
645
648
  writableRoots: policy.allowFilesystemWrite ? [cwd] : []
@@ -649,24 +652,30 @@ function isNonEmptyString(value) {
649
652
  return typeof value === "string" && value.length > 0;
650
653
  }
651
654
  function readToolName(item) {
652
- if (typeof item === "string") return item;
653
- if (!isRecord(item)) return "";
655
+ if (typeof item === "string")
656
+ return item;
657
+ if (!isRecord(item))
658
+ return "";
654
659
  const direct = readField(item, "name");
655
- if (isNonEmptyString(direct)) return direct;
660
+ if (isNonEmptyString(direct))
661
+ return direct;
656
662
  const functionField = readField(item, "function");
657
663
  if (isRecord(functionField)) {
658
664
  const inner = readField(functionField, "name");
659
- if (isNonEmptyString(inner)) return inner;
665
+ if (isNonEmptyString(inner))
666
+ return inner;
660
667
  }
661
668
  return "";
662
669
  }
663
670
  function mergeToolNames(...values) {
664
671
  const names = [];
665
672
  for (const value of values) {
666
- if (!Array.isArray(value)) continue;
673
+ if (!Array.isArray(value))
674
+ continue;
667
675
  for (const item of value) {
668
676
  const name = readToolName(item);
669
- if (name && !names.includes(name)) names.push(name);
677
+ if (name && !names.includes(name))
678
+ names.push(name);
670
679
  }
671
680
  }
672
681
  return names;
@@ -686,24 +695,29 @@ function withForwardedUserAuthToken(runtimeEnv, parsed) {
686
695
  return userAuthToken ? { ...runtimeEnv, AUTH_TOKEN: userAuthToken } : runtimeEnv;
687
696
  }
688
697
  function runtimeWorkspaceRootFromTrace(trace) {
689
- if (!Array.isArray(trace)) return void 0;
698
+ if (!Array.isArray(trace))
699
+ return;
690
700
  for (const message of trace) {
691
- if (!isRecord(message)) continue;
701
+ if (!isRecord(message))
702
+ continue;
692
703
  const metadataValue = readField(message, "tool_result_metadata");
693
704
  const metadata = isRecord(metadataValue) ? metadataValue : null;
694
- const rootRaw = metadata ? readField(metadata, "workspaceRoot") : void 0;
705
+ const rootRaw = metadata ? readField(metadata, "workspaceRoot") : undefined;
695
706
  const workspaceRoot = asTrimmedString(rootRaw);
696
- if (workspaceRoot) return workspaceRoot;
707
+ if (workspaceRoot)
708
+ return workspaceRoot;
697
709
  }
698
- return void 0;
710
+ return;
699
711
  }
700
712
  function buildArtifactProgress(args) {
701
- if (!isRecord(args.artifacts)) return null;
713
+ if (!isRecord(args.artifacts))
714
+ return null;
702
715
  const changedFilesRaw = readField(args.artifacts, "changedFiles");
703
716
  const changedFiles = Array.isArray(changedFilesRaw) ? changedFilesRaw : [];
704
717
  const statusShortRaw = readField(args.artifacts, "statusShort");
705
718
  const statusShort = asTrimmedString(statusShortRaw);
706
- if (changedFiles.length === 0 && !statusShort) return null;
719
+ if (changedFiles.length === 0 && !statusShort)
720
+ return null;
707
721
  const runtimeToolsRaw = args.runtimePolicy?.runtimeTools;
708
722
  const runtimeTools = Array.isArray(runtimeToolsRaw) ? runtimeToolsRaw : [];
709
723
  const shellTool = runtimeTools.includes("execShell") ? "execShell" : "workspaceArtifact";
@@ -725,7 +739,7 @@ function createStrictConnectorWorkspaceExecutor(cwd, env, toolNames) {
725
739
  denyExternalReadSpills: true
726
740
  });
727
741
  const allowedExecutors = Object.fromEntries(Object.entries(executors).filter(([name]) => toolNames.includes(name)));
728
- return (call, opts) => executeLocalToolWithPolicy({
742
+ return (call, opts) => executeLocalToolWithPolicy2({
729
743
  env,
730
744
  call,
731
745
  runToolNames: toolNames,
@@ -751,22 +765,14 @@ async function defaultRunConnectorLocalRuntimeAgent(args) {
751
765
  const agentConfigRaw = readField(payload, "agentConfig");
752
766
  const payloadAgentConfig = asRecordOrEmpty(agentConfigRaw);
753
767
  const runtimePolicy = runtimePolicyFromConnectorPayload(args.parsed);
754
- const strictNames = args.strictPermission ? strictConnectorWorkspaceToolNames(args.strictPermission, runtimePolicy) : void 0;
768
+ const strictNames = args.strictPermission ? strictConnectorWorkspaceToolNames(args.strictPermission, runtimePolicy) : undefined;
755
769
  const policy = strictNames ? { ...runtimePolicy, runtimeTools: strictNames, agentTools: [], workspace: { mode: "current", cwd: args.cwd }, shell: { enabled: false } } : runtimePolicy;
756
- const candidateToolNames = mergeToolNames(
757
- readField(payloadAgentConfig, "toolNames"),
758
- readField(payloadAgentConfig, "tools"),
759
- policy?.agentTools,
760
- policy?.runtimeTools
761
- );
770
+ const candidateToolNames = mergeToolNames(readField(payloadAgentConfig, "toolNames"), readField(payloadAgentConfig, "tools"), policy?.agentTools, policy?.runtimeTools);
762
771
  const runtimeContext = asRecordOrEmpty(readField(payload, "runtimeContext"));
763
- const requestedSurface = applyToolSurfaceConstraints(
764
- { explicitToolNames: candidateToolNames, injectedToolNames: [], finalToolNames: candidateToolNames },
765
- {
766
- allowedToolNames: Array.isArray(readField(runtimeContext, "allowedToolNames")) ? readField(runtimeContext, "allowedToolNames") : void 0,
767
- blockedToolNames: Array.isArray(readField(runtimeContext, "blockedToolNames")) ? readField(runtimeContext, "blockedToolNames") : void 0
768
- }
769
- );
772
+ const requestedSurface = applyToolSurfaceConstraints({ explicitToolNames: candidateToolNames, injectedToolNames: [], finalToolNames: candidateToolNames }, {
773
+ allowedToolNames: Array.isArray(readField(runtimeContext, "allowedToolNames")) ? readField(runtimeContext, "allowedToolNames") : undefined,
774
+ blockedToolNames: Array.isArray(readField(runtimeContext, "blockedToolNames")) ? readField(runtimeContext, "blockedToolNames") : undefined
775
+ });
770
776
  const constrainedSurface = strictNames ? applyToolSurfaceConstraints(requestedSurface, { allowedToolNames: strictNames }) : requestedSurface;
771
777
  const toolNames = constrainedSurface.finalToolNames;
772
778
  const agentRecord = {
@@ -779,18 +785,13 @@ async function defaultRunConnectorLocalRuntimeAgent(args) {
779
785
  ...policy ? { runtimeToolPolicy: policy } : {}
780
786
  };
781
787
  const dispatchUserId = String(args.runtimeEnv.NOLO_USER_ID || "local");
782
- const localUserId = String(
783
- args.runtimeEnv.NOLO_LOCAL_USER_ID || args.runtimeEnv.NOLO_USER_ID || "local"
784
- );
785
- const store = /* @__PURE__ */ new Map([
788
+ const localUserId = String(args.runtimeEnv.NOLO_LOCAL_USER_ID || args.runtimeEnv.NOLO_USER_ID || "local");
789
+ const store = new Map([
786
790
  [agentKey, agentRecord],
787
791
  [ownedAgentKey(dispatchUserId, agentKey), agentRecord],
788
792
  [ownedAgentKey(localUserId, agentKey), agentRecord]
789
793
  ]);
790
- const env = localRuntimeEnvFromPolicy(
791
- withForwardedUserAuthToken(args.runtimeEnv, args.parsed),
792
- policy
793
- );
794
+ const env = localRuntimeEnvFromPolicy(withForwardedUserAuthToken(args.runtimeEnv, args.parsed), policy);
794
795
  logConnectorRun("agent.run.local-runtime.env", {
795
796
  requestId: readField(obj, "requestId"),
796
797
  agentKey,
@@ -810,7 +811,8 @@ async function defaultRunConnectorLocalRuntimeAgent(args) {
810
811
  const isAgentOverrideKey = (key) => store.has(key) || key.startsWith("agent-");
811
812
  const compositeStore = propagateLocalDialogTurnAuthority(persistentStore, {
812
813
  read: async (key, options) => {
813
- if (store.has(key)) return store.get(key) ?? null;
814
+ if (store.has(key))
815
+ return store.get(key) ?? null;
814
816
  return persistentStore.read(key, key === leasedDialogKey ? { ...options, remote: false } : options);
815
817
  },
816
818
  write: async (key, value) => {
@@ -834,7 +836,7 @@ async function defaultRunConnectorLocalRuntimeAgent(args) {
834
836
  }
835
837
  },
836
838
  iterator: async function* (options) {
837
- const yielded = /* @__PURE__ */ new Set();
839
+ const yielded = new Set;
838
840
  for await (const [key, value] of persistentStore.iterator(options)) {
839
841
  yielded.add(key);
840
842
  if (store.has(key)) {
@@ -845,10 +847,14 @@ async function defaultRunConnectorLocalRuntimeAgent(args) {
845
847
  }
846
848
  const keys = [...store.keys()].sort();
847
849
  for (const key of keys) {
848
- if (yielded.has(key)) continue;
849
- if (key < options.gte) continue;
850
- if (options.lte && key > options.lte) continue;
851
- if (options.lt && key >= options.lt) continue;
850
+ if (yielded.has(key))
851
+ continue;
852
+ if (key < options.gte)
853
+ continue;
854
+ if (options.lte && key > options.lte)
855
+ continue;
856
+ if (options.lt && key >= options.lt)
857
+ continue;
852
858
  yield [key, store.get(key)];
853
859
  }
854
860
  },
@@ -861,7 +867,7 @@ async function defaultRunConnectorLocalRuntimeAgent(args) {
861
867
  }
862
868
  } : {}
863
869
  });
864
- const baseAdapter = createCliLocalRuntimeAdapter({
870
+ const baseAdapter = createCliLocalRuntimeAdapter2({
865
871
  env,
866
872
  cwd: args.cwd,
867
873
  fetchImpl: args.fetchImpl ?? fetch,
@@ -881,20 +887,22 @@ async function defaultRunConnectorLocalRuntimeAgent(args) {
881
887
  let runtimeWorkspaceRoot;
882
888
  let runtimeWorkspaceKind;
883
889
  const noteToolName = (toolName) => {
884
- if (!toolName) return;
890
+ if (!toolName)
891
+ return;
885
892
  const existingIndex = lastToolNames.indexOf(toolName);
886
- if (existingIndex >= 0) lastToolNames.splice(existingIndex, 1);
893
+ if (existingIndex >= 0)
894
+ lastToolNames.splice(existingIndex, 1);
887
895
  lastToolNames.push(toolName);
888
- while (lastToolNames.length > 8) lastToolNames.shift();
896
+ while (lastToolNames.length > 8)
897
+ lastToolNames.shift();
889
898
  };
890
899
  const userInputRaw = readField(payload, "userInput");
891
900
  const continueDialogIdRaw = readField(payload, "continueDialogId");
892
- const pending = /* @__PURE__ */ new Set();
901
+ const pending = new Set;
893
902
  const track = (operation) => {
894
- const stopped2 = operation.then((value) => getExecutionStoppedPromise(value), (error) => getExecutionStoppedPromise(error) ?? Promise.resolve());
895
- pending.add(stopped2);
896
- void stopped2.then(() => pending.delete(stopped2), () => {
897
- });
903
+ const stopped = operation.then((value) => getExecutionStoppedPromise2(value), (error) => getExecutionStoppedPromise2(error) ?? Promise.resolve());
904
+ pending.add(stopped);
905
+ stopped.then(() => pending.delete(stopped), () => {});
898
906
  return operation;
899
907
  };
900
908
  const trackedAdapter = {
@@ -902,18 +910,18 @@ async function defaultRunConnectorLocalRuntimeAgent(args) {
902
910
  resolveProvider: async (...params) => {
903
911
  const provider = await adapter.resolveProvider(...params);
904
912
  if (args.blockLocalCli && provider.transport === "local-cli") {
905
- throw new WindowsConnectorCliFencingUnsupportedError();
913
+ throw new WindowsConnectorCliFencingUnsupportedError;
906
914
  }
907
915
  return { ...provider, complete: (...input) => track(provider.complete(...input)) };
908
916
  },
909
917
  executeTool: (...params) => track(adapter.executeTool(...params))
910
918
  };
911
- const result = await runLocalAgentTurn({
919
+ const result = await runLocalAgentTurn2({
912
920
  adapter: trackedAdapter,
913
921
  userLanguage: args.runtimeEnv.NOLO_LANG ?? null,
914
922
  agentRef: agentKey,
915
923
  input: typeof userInputRaw === "string" ? userInputRaw : "",
916
- continueDialogId: typeof continueDialogIdRaw === "string" ? continueDialogIdRaw : args.onStreamEvent ? args.dialogTurnLease?.dialogRef.dialogId : void 0,
924
+ continueDialogId: typeof continueDialogIdRaw === "string" ? continueDialogIdRaw : args.onStreamEvent ? args.dialogTurnLease?.dialogRef.dialogId : undefined,
917
925
  ...args.abortSignal ? { abortSignal: args.abortSignal } : {},
918
926
  ...args.onStreamEvent ? {
919
927
  onTextDelta: (content) => args.onStreamEvent?.({ type: "text", content }),
@@ -921,14 +929,18 @@ async function defaultRunConnectorLocalRuntimeAgent(args) {
921
929
  } : {},
922
930
  onToolEvent: (event) => {
923
931
  args.onStreamEvent?.({ type: event.type, toolCallId: event.toolCallId, toolName: event.toolName });
924
- if (event.type === "tool-call") toolCallCount += 1;
925
- if (event.type === "tool-result") toolResultCount += 1;
932
+ if (event.type === "tool-call")
933
+ toolCallCount += 1;
934
+ if (event.type === "tool-result")
935
+ toolResultCount += 1;
926
936
  noteToolName(event.toolName);
927
937
  const metadata = asRecordOrEmpty(event.metadata);
928
938
  const rootRaw = asOptionalTrimmedString(readField(metadata, "workspaceRoot"));
929
- if (rootRaw) runtimeWorkspaceRoot = rootRaw;
939
+ if (rootRaw)
940
+ runtimeWorkspaceRoot = rootRaw;
930
941
  const kindRaw = asOptionalTrimmedString(readField(metadata, "workspaceKind"));
931
- if (kindRaw) runtimeWorkspaceKind = kindRaw;
942
+ if (kindRaw)
943
+ runtimeWorkspaceKind = kindRaw;
932
944
  args.onProgress?.({
933
945
  eventType: event.type,
934
946
  toolCallCount,
@@ -941,34 +953,34 @@ async function defaultRunConnectorLocalRuntimeAgent(args) {
941
953
  });
942
954
  }
943
955
  }).catch((error) => {
944
- if (!pending.size) throw error;
945
- const stopped2 = Promise.all(pending).then(() => {
946
- });
947
- void stopped2.catch(() => {
948
- });
949
- throw attachExecutionStoppedPromise(error instanceof Error ? error : new Error(String(error)), stopped2);
956
+ if (!pending.size)
957
+ throw error;
958
+ const stopped = Promise.all(pending).then(() => {});
959
+ stopped.catch(() => {});
960
+ throw attachExecutionStoppedPromise2(error instanceof Error ? error : new Error(String(error)), stopped);
950
961
  });
951
962
  const outcome = {
952
963
  ...result,
953
964
  runtimeWorkspaceRoot: runtimeWorkspaceRootFromTrace(result.trace) ?? runtimeWorkspaceRoot
954
965
  };
955
- if (!pending.size) return outcome;
956
- const stopped = Promise.all(pending).then(() => {
957
- });
958
- void stopped.catch(() => {
959
- });
960
- return attachExecutionStoppedPromise(outcome, stopped);
966
+ if (!pending.size)
967
+ return outcome;
968
+ const stopped = Promise.all(pending).then(() => {});
969
+ stopped.catch(() => {});
970
+ return attachExecutionStoppedPromise2(outcome, stopped);
961
971
  }
962
972
  function normalizeConnectorRunTimeoutMs(value) {
963
973
  const finite = asOptionalPositiveFiniteNumber(value);
964
- if (finite === void 0) return void 0;
974
+ if (finite === undefined)
975
+ return;
965
976
  return Math.floor(finite);
966
977
  }
967
978
  function isConnectorUserInput(value) {
968
979
  return Array.isArray(value);
969
980
  }
970
981
  function readConnectorTextPart(part) {
971
- if (!isRecord(part)) return null;
982
+ if (!isRecord(part))
983
+ return null;
972
984
  const text = readField(part, "text");
973
985
  if (readField(part, "type") === "text" && isNonEmptyString(text)) {
974
986
  return text;
@@ -976,12 +988,16 @@ function readConnectorTextPart(part) {
976
988
  return null;
977
989
  }
978
990
  function readConnectorImageUrlPart(part) {
979
- if (!isRecord(part)) return null;
980
- if (readField(part, "type") !== "image_url") return null;
991
+ if (!isRecord(part))
992
+ return null;
993
+ if (readField(part, "type") !== "image_url")
994
+ return null;
981
995
  const imageUrlValue = readField(part, "image_url");
982
- if (!isRecord(imageUrlValue)) return null;
996
+ if (!isRecord(imageUrlValue))
997
+ return null;
983
998
  const url = readField(imageUrlValue, "url");
984
- if (typeof url !== "string" || !url.trim()) return null;
999
+ if (typeof url !== "string" || !url.trim())
1000
+ return null;
985
1001
  return url.trim();
986
1002
  }
987
1003
  function extractMultimodalUserInput(userInput) {
@@ -1000,9 +1016,11 @@ function extractMultimodalUserInput(userInput) {
1000
1016
  continue;
1001
1017
  }
1002
1018
  const url = readConnectorImageUrlPart(part);
1003
- if (url !== null) imageUrls.push(url);
1019
+ if (url !== null)
1020
+ imageUrls.push(url);
1004
1021
  }
1005
- return { text: textParts.join("\n"), imageUrls };
1022
+ return { text: textParts.join(`
1023
+ `), imageUrls };
1006
1024
  }
1007
1025
 
1008
1026
  // packages/cli/chatgptWebImageLocalJob.ts
@@ -1017,9 +1035,11 @@ import { homedir as homedir2 } from "node:os";
1017
1035
  import { basename, dirname, join as join3 } from "node:path";
1018
1036
  var CHATGPT_WEB_IMAGE_LOCAL_JOB = "chatgptWebImageGenerate";
1019
1037
  function readChatgptWebImageLocalJobMeta(payload) {
1020
- if (!isRecord(payload)) return null;
1038
+ if (!isRecord(payload))
1039
+ return null;
1021
1040
  const meta = isRecord(payload.meta) ? payload.meta : null;
1022
- if (!meta || meta.localJob !== CHATGPT_WEB_IMAGE_LOCAL_JOB) return null;
1041
+ if (!meta || meta.localJob !== CHATGPT_WEB_IMAGE_LOCAL_JOB)
1042
+ return null;
1023
1043
  const prompt = asTrimmedString(meta.prompt);
1024
1044
  const userAuthToken = asTrimmedString(meta.userAuthToken);
1025
1045
  const serverBase = asTrimmedString(meta.serverBase);
@@ -1042,17 +1062,16 @@ function acquireChatgptWebImageLock(lockPath) {
1042
1062
  ${Date.now()}
1043
1063
  `, { flag: "wx" });
1044
1064
  } catch (error) {
1045
- const code = error && typeof error === "object" && "code" in error ? error.code : void 0;
1065
+ const code = error && typeof error === "object" && "code" in error ? error.code : undefined;
1046
1066
  if (code === "EEXIST") {
1047
- throw new Error(t("chatgptWebImage.jobInProgress"));
1067
+ throw new Error(t2("chatgptWebImage.jobInProgress"));
1048
1068
  }
1049
1069
  throw error;
1050
1070
  }
1051
1071
  return () => {
1052
1072
  try {
1053
1073
  unlinkSync2(lockPath);
1054
- } catch {
1055
- }
1074
+ } catch {}
1056
1075
  };
1057
1076
  }
1058
1077
  async function runOracleGenerateImage(args) {
@@ -1081,14 +1100,12 @@ async function runOracleGenerateImage(args) {
1081
1100
  });
1082
1101
  const [exitCode, stdout, stderr] = await Promise.all([
1083
1102
  proc.exited,
1084
- readPipeText(proc.stdout),
1085
- readPipeText(proc.stderr)
1103
+ readPipeText2(proc.stdout),
1104
+ readPipeText2(proc.stderr)
1086
1105
  ]);
1087
1106
  if (exitCode !== 0) {
1088
1107
  const detail = (stderr || stdout || "").trim().slice(0, 800);
1089
- throw new Error(
1090
- detail ? `ChatGPT \u7F51\u9875\u751F\u56FE\u5931\u8D25\uFF08oracle exit ${exitCode}\uFF09\uFF1A${detail}` : `ChatGPT \u7F51\u9875\u751F\u56FE\u5931\u8D25\uFF08oracle exit ${exitCode}\uFF09`
1091
- );
1108
+ throw new Error(detail ? `ChatGPT 网页生图失败(oracle exit ${exitCode}):${detail}` : `ChatGPT 网页生图失败(oracle exit ${exitCode})`);
1092
1109
  }
1093
1110
  }
1094
1111
  function assertOutputImage(outPath) {
@@ -1096,34 +1113,27 @@ function assertOutputImage(outPath) {
1096
1113
  try {
1097
1114
  st = statSync3(outPath);
1098
1115
  } catch {
1099
- throw new Error(t("chatgptWebImage.noOutputFile", outPath));
1116
+ throw new Error(t2("chatgptWebImage.noOutputFile", outPath));
1100
1117
  }
1101
1118
  if (!st.isFile() || st.size <= 0) {
1102
- throw new Error(t("chatgptWebImage.outputFileInvalid", outPath));
1119
+ throw new Error(t2("chatgptWebImage.outputFileInvalid", outPath));
1103
1120
  }
1104
1121
  }
1105
1122
  async function uploadPngToNoloFs(args) {
1106
1123
  const bytes = readFileSync2(args.outPath);
1107
- const form = new FormData();
1124
+ const form = new FormData;
1108
1125
  const fileName = basename(args.outPath) || "chatgpt-web.png";
1109
- form.append(
1110
- "file",
1111
- new Blob([bytes], { type: "image/png" }),
1112
- fileName
1113
- );
1114
- form.append(
1115
- "metadata",
1116
- JSON.stringify({
1117
- type: "file",
1118
- fileCategory: "image",
1119
- ownerType: "user",
1120
- userId: args.userId,
1121
- source: "chatgpt-web-image",
1122
- model: "chatgpt-web",
1123
- prompt: args.prompt,
1124
- tags: ["ai-generated", "chatgpt-web", "image"]
1125
- })
1126
- );
1126
+ form.append("file", new Blob([bytes], { type: "image/png" }), fileName);
1127
+ form.append("metadata", JSON.stringify({
1128
+ type: "file",
1129
+ fileCategory: "image",
1130
+ ownerType: "user",
1131
+ userId: args.userId,
1132
+ source: "chatgpt-web-image",
1133
+ model: "chatgpt-web",
1134
+ prompt: args.prompt,
1135
+ tags: ["ai-generated", "chatgpt-web", "image"]
1136
+ }));
1127
1137
  form.append("userId", args.userId);
1128
1138
  form.append("ownerType", "user");
1129
1139
  form.append("ownerId", args.userId);
@@ -1142,11 +1152,11 @@ async function uploadPngToNoloFs(args) {
1142
1152
  if (!response.ok) {
1143
1153
  const errField = body.error;
1144
1154
  const message = typeof errField === "string" && errField || isRecord(errField) && typeof errField.message === "string" && errField.message || typeof body.details === "string" && body.details || `HTTP ${response.status}`;
1145
- throw new Error(t("chatgptWebImage.uploadFailed", message));
1155
+ throw new Error(t2("chatgptWebImage.uploadFailed", message));
1146
1156
  }
1147
1157
  const fileId = asTrimmedString(body.fileId);
1148
1158
  if (!fileId) {
1149
- throw new Error(t("chatgptWebImage.missingUploadFileId"));
1159
+ throw new Error(t2("chatgptWebImage.missingUploadFileId"));
1150
1160
  }
1151
1161
  const metadata = asRecordOrEmpty(body.metadata);
1152
1162
  return { fileId, metadata };
@@ -1154,7 +1164,7 @@ async function uploadPngToNoloFs(args) {
1154
1164
  async function runChatgptWebImageLocalJob(input, deps = {}) {
1155
1165
  const prompt = asTrimmedString(input.prompt);
1156
1166
  if (!prompt) {
1157
- throw new Error(t("chatgptWebImage.missingPrompt"));
1167
+ throw new Error(t2("chatgptWebImage.missingPrompt"));
1158
1168
  }
1159
1169
  const home = (deps.homedir ?? homedir2)();
1160
1170
  const lockPath = deps.lockPath ?? defaultLockPath(home);
@@ -1167,13 +1177,15 @@ async function runChatgptWebImageLocalJob(input, deps = {}) {
1167
1177
  await runOracleGenerateImage({
1168
1178
  prompt,
1169
1179
  outPath,
1170
- spawn: deps.spawn ?? spawnProcess
1180
+ spawn: deps.spawn ?? spawnProcess2
1171
1181
  });
1172
1182
  assertOutputImage(outPath);
1173
1183
  const userAuthToken = input.userAuthToken?.trim() || "";
1174
- if (!userAuthToken) throw new Error("Cannot upload generated image without a user authentication token.");
1175
- const userId = parseUserIdFromAuthToken(userAuthToken);
1176
- if (!userId) throw new Error("Cannot determine authenticated user from the user authentication token.");
1184
+ if (!userAuthToken)
1185
+ throw new Error("Cannot upload generated image without a user authentication token.");
1186
+ const userId = parseUserIdFromAuthToken2(userAuthToken);
1187
+ if (!userId)
1188
+ throw new Error("Cannot determine authenticated user from the user authentication token.");
1177
1189
  const serverBase = (input.serverBase?.trim() || DEFAULT_NOLO_SERVER_URL).replace(/\/+$/, "");
1178
1190
  const uploaded = await uploadPngToNoloFs({
1179
1191
  outPath,
@@ -1184,7 +1196,7 @@ async function runChatgptWebImageLocalJob(input, deps = {}) {
1184
1196
  fetchImpl: deps.fetchImpl ?? fetch
1185
1197
  });
1186
1198
  const rawData = {
1187
- text: `\u5DF2\u751F\u6210 1 \u5F20\u56FE\u7247\u3002`,
1199
+ text: `已生成 1 张图片。`,
1188
1200
  imageCount: 1,
1189
1201
  files: [
1190
1202
  {
@@ -1208,12 +1220,9 @@ async function runChatgptWebImageLocalJob(input, deps = {}) {
1208
1220
  }
1209
1221
 
1210
1222
  // packages/cli/machineWsRunDispatch.ts
1211
- var activeRunAbortControllers = /* @__PURE__ */ new Map();
1212
- var pendingLeaseReleases = /* @__PURE__ */ new Map();
1223
+ var activeRunAbortControllers = new Map;
1224
+ var pendingLeaseReleases = new Map;
1213
1225
  var maxPendingLeaseReleases = 1024;
1214
- function __setConnectorLeaseRecoveryCapacityForTest(capacity) {
1215
- maxPendingLeaseReleases = capacity;
1216
- }
1217
1226
  var pendingLeaseReleaseCount = 0;
1218
1227
  var releaseKey = (file, { userId, dialogId }) => JSON.stringify([file, userId, dialogId]);
1219
1228
  function readPendingReleases(file) {
@@ -1221,19 +1230,22 @@ function readPendingReleases(file) {
1221
1230
  try {
1222
1231
  raw = readFileSync3(file, "utf8");
1223
1232
  } catch (error) {
1224
- if (error.code === "ENOENT") return [];
1233
+ if (error.code === "ENOENT")
1234
+ return [];
1225
1235
  throw error;
1226
1236
  }
1227
1237
  const value = JSON.parse(raw);
1228
- if (!Array.isArray(value)) throw new Error("Invalid Connector pending lease release file");
1238
+ if (!Array.isArray(value))
1239
+ throw new Error("Invalid Connector pending lease release file");
1229
1240
  return value.filter((entry) => isRecord(entry) && isDialogTurnRef(entry.dialogRef) && typeof entry.runToken === "string" && entry.runToken.length > 0);
1230
1241
  }
1231
1242
  async function updatePendingReleases(file, update) {
1232
1243
  try {
1233
- await withQueueLock(file, () => {
1244
+ await withQueueLock2(file, () => {
1234
1245
  const entries = readPendingReleases(file);
1235
1246
  const next = update(entries);
1236
- if (entries === next || !entries.length && !next.length) return;
1247
+ if (entries === next || !entries.length && !next.length)
1248
+ return;
1237
1249
  const temp = `${file}.${randomUUID()}.tmp`;
1238
1250
  writeFileSync4(temp, JSON.stringify(next), { encoding: "utf8", mode: 384, flag: "wx" });
1239
1251
  renameSync2(temp, file);
@@ -1254,32 +1266,37 @@ async function recoverPendingLeaseReleases(authority, dialogRef, file) {
1254
1266
  const tokens = new Set(cached);
1255
1267
  try {
1256
1268
  for (const entry of readPendingReleases(file)) {
1257
- if (releaseKey(file, entry.dialogRef) === key) tokens.add(entry.runToken);
1269
+ if (releaseKey(file, entry.dialogRef) === key)
1270
+ tokens.add(entry.runToken);
1258
1271
  }
1259
1272
  } catch (error) {
1260
1273
  logConnectorRun("agent.run.recovery.file_error", { error: toErrorMessage(error) });
1261
1274
  }
1262
- const cleared = /* @__PURE__ */ new Set();
1275
+ const cleared = new Set;
1263
1276
  for (const token of tokens) {
1264
1277
  try {
1265
1278
  await endConnectorTurn(authority, dialogRef, token, "pending_release_recovery");
1266
1279
  cleared.add(token);
1267
- if (cached?.delete(token)) pendingLeaseReleaseCount--;
1268
- } catch {
1269
- }
1280
+ if (cached?.delete(token))
1281
+ pendingLeaseReleaseCount--;
1282
+ } catch {}
1270
1283
  }
1271
- if (cached && !cached.size && pendingLeaseReleases.get(key) === cached) pendingLeaseReleases.delete(key);
1272
- if (cleared.size) await updatePendingReleases(file, (entries) => entries.filter((entry) => releaseKey(file, entry.dialogRef) !== key || !cleared.has(entry.runToken)));
1284
+ if (cached && !cached.size && pendingLeaseReleases.get(key) === cached)
1285
+ pendingLeaseReleases.delete(key);
1286
+ if (cleared.size)
1287
+ await updatePendingReleases(file, (entries) => entries.filter((entry) => releaseKey(file, entry.dialogRef) !== key || !cleared.has(entry.runToken)));
1273
1288
  }
1274
- async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv, fetchImpl, deps = {}, sessionSignal) {
1275
- if (sessionSignal?.aborted) return;
1289
+ async function handleConnectorRunMessage2(message, send, executeCli, runtimeEnv, fetchImpl, deps = {}, sessionSignal) {
1290
+ if (sessionSignal?.aborted)
1291
+ return;
1276
1292
  let parsed;
1277
1293
  try {
1278
1294
  parsed = JSON.parse(message);
1279
1295
  } catch {
1280
1296
  return;
1281
1297
  }
1282
- if (!isRecord(parsed) || typeof parsed.requestId !== "string") return;
1298
+ if (!isRecord(parsed) || typeof parsed.requestId !== "string")
1299
+ return;
1283
1300
  const requestId = parsed.requestId;
1284
1301
  if (parsed.type === "agent.run.cancel") {
1285
1302
  const run = activeRunAbortControllers.get(requestId);
@@ -1289,10 +1306,11 @@ async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv,
1289
1306
  return;
1290
1307
  }
1291
1308
  const strictFrame = parsed.type === "agent.run.strict-workspace";
1292
- if (parsed.type !== "agent.run" && !strictFrame) return;
1309
+ if (parsed.type !== "agent.run" && !strictFrame)
1310
+ return;
1293
1311
  const payload = asRecordOrEmpty(parsed.payload);
1294
1312
  const agentConfig = asRecordOrEmpty(payload.agentConfig);
1295
- const runAbortController = new AbortController();
1313
+ const runAbortController = new AbortController;
1296
1314
  const activeRun = { controller: runAbortController, sessionSignal };
1297
1315
  activeRunAbortControllers.set(requestId, activeRun);
1298
1316
  const abortRunOnDisconnect = () => runAbortController.abort(sessionSignal?.reason);
@@ -1324,7 +1342,7 @@ async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv,
1324
1342
  };
1325
1343
  const releaseConnectorTurnLeaseWithRecovery = async (authority, { dialogRef, runToken }) => {
1326
1344
  const reason = runAbortController.signal.aborted ? "connector_aborted" : "connector_finally";
1327
- for (let attempt = 1; ; attempt++) {
1345
+ for (let attempt = 1;; attempt++) {
1328
1346
  try {
1329
1347
  await endConnectorTurn(authority, dialogRef, runToken, reason);
1330
1348
  return;
@@ -1333,7 +1351,7 @@ async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv,
1333
1351
  if (pendingReleaseFile) {
1334
1352
  const file = pendingReleaseFile;
1335
1353
  const key = releaseKey(file, dialogRef);
1336
- const tokens = pendingLeaseReleases.get(key) ?? /* @__PURE__ */ new Set();
1354
+ const tokens = pendingLeaseReleases.get(key) ?? new Set;
1337
1355
  if (!tokens.has(runToken) && pendingLeaseReleaseCount < maxPendingLeaseReleases) {
1338
1356
  tokens.add(runToken);
1339
1357
  pendingLeaseReleases.set(key, tokens);
@@ -1343,19 +1361,20 @@ async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv,
1343
1361
  }
1344
1362
  throw error;
1345
1363
  }
1346
- await new Promise((resolve3) => setTimeout(resolve3, 15 * attempt));
1364
+ await new Promise((resolve) => setTimeout(resolve, 15 * attempt));
1347
1365
  }
1348
1366
  }
1349
1367
  };
1350
1368
  try {
1351
1369
  const strictRequest = payload.workspaceRequest;
1352
- if ((strictFrame || strictRequest !== void 0) && !isConnectorWorkspaceRequest(strictRequest)) {
1370
+ if ((strictFrame || strictRequest !== undefined) && !isConnectorWorkspaceRequest(strictRequest)) {
1353
1371
  throw new ConnectorWorkspaceError("workspace_path_unauthorized", "Invalid strict workspace request.");
1354
1372
  }
1355
- const workspaceRequest = isConnectorWorkspaceRequest(strictRequest) ? strictRequest : void 0;
1373
+ const workspaceRequest = isConnectorWorkspaceRequest(strictRequest) ? strictRequest : undefined;
1356
1374
  const chatgptWebImageJob = readChatgptWebImageLocalJobMeta(payload);
1357
1375
  if (chatgptWebImageJob) {
1358
- if (workspaceRequest) throw new ConnectorWorkspaceError("workspace_execution_unsupported", "Local jobs cannot honor strict workspaces.");
1376
+ if (workspaceRequest)
1377
+ throw new ConnectorWorkspaceError("workspace_execution_unsupported", "Local jobs cannot honor strict workspaces.");
1359
1378
  logConnectorRun("agent.run.local-job.start", {
1360
1379
  requestId,
1361
1380
  localJob: "chatgptWebImageGenerate",
@@ -1391,16 +1410,16 @@ async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv,
1391
1410
  const timeout = normalizeConnectorRunTimeoutMs(payload.timeoutMs);
1392
1411
  const hostRoot = runtimeEnv.NOLO_CONNECTOR_WORKDIR;
1393
1412
  const cwd = workspaceRequest ? resolveAuthorizedConnectorWorkspaceCwd(workspaceRequest.path, hostRoot ? [hostRoot] : machinePermissionPolicy.writableRoots) : resolveConnectorRunCwd2({ env: runtimeEnv, policy: machinePermissionPolicy });
1394
- const strictPermission = workspaceRequest ? strictConnectorWorkspacePolicy(machinePermissionPolicy, runtimePolicy, cwd) : void 0;
1413
+ const strictPermission = workspaceRequest ? strictConnectorWorkspacePolicy(machinePermissionPolicy, runtimePolicy, cwd) : undefined;
1395
1414
  const effectiveRuntimeEnv = withForwardedUserAuthToken(runtimeEnv, parsed);
1396
1415
  const metaRecord = asRecordOrEmpty(readField2(payload, "meta"));
1397
1416
  const targetDialogId = asOptionalTrimmedString(readField2(payload, "continueDialogId")) ?? asOptionalTrimmedString(readField2(payload, "dialogId")) ?? asOptionalTrimmedString(readField2(metaRecord, "continueDialogId")) ?? asOptionalTrimmedString(readField2(metaRecord, "dialogId"));
1398
- const targetUserId = resolveLocalUserId(effectiveRuntimeEnv);
1417
+ const targetUserId = resolveLocalUserId2(effectiveRuntimeEnv);
1399
1418
  const dialogRef = { userId: targetUserId, dialogId: targetDialogId };
1400
1419
  const requiresLocalLease = isDialogTurnRef(dialogRef);
1401
1420
  const blockLocalCli = (deps.platform ?? process.platform) === "win32" && requiresLocalLease;
1402
1421
  if (blockLocalCli && isCliProviderAgentConfig(normalizeConnectorLocalAgentConfig(agentConfig))) {
1403
- throw new WindowsConnectorCliFencingUnsupportedError();
1422
+ throw new WindowsConnectorCliFencingUnsupportedError;
1404
1423
  }
1405
1424
  if (strictPermission && (isCliProviderAgentConfig(agentConfig) || isCursorOAuthAgent({ apiKeyRef: asOptionalTrimmedString(agentConfig.apiKeyRef) }))) {
1406
1425
  throw new ConnectorWorkspaceError("workspace_execution_unsupported", "Provider cannot enforce strict workspace permissions.");
@@ -1423,14 +1442,8 @@ async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv,
1423
1442
  authority = resolveLocalDialogTurnAuthority(connectorSharedStore);
1424
1443
  }
1425
1444
  connectorTurnAuthority = authority;
1426
- const runId = sanitizeDialogTurnIdentifier(
1427
- asOptionalTrimmedString(readField2(payload, "runId")) ?? `conn-${requestId}`,
1428
- "conn"
1429
- );
1430
- pendingReleaseFile = resolve2(deps.pendingLeaseReleaseFilePath ?? join4(
1431
- resolveConnectorStateDir({ noloHome: effectiveRuntimeEnv.NOLO_HOME }),
1432
- "connector-pending-lease-releases.json"
1433
- ));
1445
+ const runId = sanitizeDialogTurnIdentifier(asOptionalTrimmedString(readField2(payload, "runId")) ?? `conn-${requestId}`, "conn");
1446
+ pendingReleaseFile = resolve2(deps.pendingLeaseReleaseFilePath ?? join4(resolveConnectorStateDir({ noloHome: effectiveRuntimeEnv.NOLO_HOME }), "connector-pending-lease-releases.json"));
1434
1447
  await recoverPendingLeaseReleases(authority, dialogRef, pendingReleaseFile);
1435
1448
  runAbortController.signal.throwIfAborted();
1436
1449
  const acquired = await acquireLocalDialogTurnLease({
@@ -1460,7 +1473,8 @@ async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv,
1460
1473
  throw new Error(`Dialog turn rejected (${acquired.status})`);
1461
1474
  }
1462
1475
  connectorTurnLease = acquired.lease;
1463
- if (keepTurnActive) connectorTurnLease.keepTurnActive = true;
1476
+ if (keepTurnActive)
1477
+ connectorTurnLease.keepTurnActive = true;
1464
1478
  connectorTurnHeartbeat = startDialogTurnHeartbeat({
1465
1479
  authority,
1466
1480
  dialogRef,
@@ -1473,7 +1487,7 @@ async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv,
1473
1487
  if (!await connectorSharedStore.read(dialogKey, { remote: false })) {
1474
1488
  await connectorSharedStore.read(dialogKey);
1475
1489
  const state = await authority.getDialogTurnState({ dialogRef });
1476
- if (!("ok" in state && state.ok) || state.activeTurn?.runId !== acquired.activeTurn.runId || state.activeTurn.holder !== acquired.activeTurn.holder || state.activeTurn.startedAt !== acquired.activeTurn.startedAt) {
1490
+ if (!(("ok" in state) && state.ok) || state.activeTurn?.runId !== acquired.activeTurn.runId || state.activeTurn.holder !== acquired.activeTurn.holder || state.activeTurn.startedAt !== acquired.activeTurn.startedAt) {
1477
1491
  throw new Error("Dialog turn lease lost during Connector header hydration");
1478
1492
  }
1479
1493
  connectorTurnLease.baseRevision = state.dialogRevision;
@@ -1484,21 +1498,19 @@ async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv,
1484
1498
  let runContent = "";
1485
1499
  let runModel = (() => {
1486
1500
  const value = readField2(agentConfig, "model");
1487
- return typeof value === "string" ? value : void 0;
1501
+ return typeof value === "string" ? value : undefined;
1488
1502
  })();
1489
1503
  let runTrace = [];
1490
1504
  let artifactCwd = cwd;
1491
1505
  let baseSha = null;
1492
- if (agentConfig.apiSource === "cli") {
1506
+ const normalizedApiSource = asOptionalTrimmedString(agentConfig.apiSource)?.toLowerCase();
1507
+ const isLegacyCliAgentWithoutApiSource = normalizedApiSource !== "platform" && normalizedApiSource !== "custom" && !asOptionalTrimmedString(agentConfig.customProviderUrl) && !asOptionalTrimmedString(agentConfig.provider) && isCliProviderAgentConfig(agentConfig);
1508
+ if (normalizedApiSource === "cli" || isLegacyCliAgentWithoutApiSource) {
1493
1509
  if (!deps.buildConnectorCliPrompt) {
1494
1510
  throw new Error("buildConnectorCliPrompt is required for CLI connector runs.");
1495
1511
  }
1496
1512
  const runtimePermissionPolicy = !hasExplicitMachinePermissions(agentConfig) ? runtimeWorkspacePermissionPolicy(runtimePolicy, runtimeEnv, cwd) : null;
1497
- const effectivePermissionPolicy = scopePermissionPolicyToRuntimeWorkspace(
1498
- runtimePermissionPolicy ?? machinePermissionPolicy,
1499
- runtimePolicy,
1500
- cwd
1501
- );
1513
+ const effectivePermissionPolicy = scopePermissionPolicyToRuntimeWorkspace(runtimePermissionPolicy ?? machinePermissionPolicy, runtimePolicy, cwd);
1502
1514
  assertMachineRunAllowed2(userInput, effectivePermissionPolicy);
1503
1515
  if (!await acquireConnectorTurnIfNeeded()) {
1504
1516
  return;
@@ -1559,57 +1571,100 @@ async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv,
1559
1571
  message: "cli-running",
1560
1572
  updatedAt: Date.now()
1561
1573
  });
1562
- }, 15e3);
1563
- const effectiveRuntimeEnv2 = withForwardedUserAuthToken(runtimeEnv, parsed);
1574
+ }, 15000);
1575
+ const effectiveRuntimeEnv = withForwardedUserAuthToken(runtimeEnv, parsed);
1564
1576
  const reasoningEffortRaw = readField2(agentConfig, "reasoning_effort");
1565
1577
  const reasoningEffortFallback = readField2(agentConfig, "reasoningEffort");
1566
- const reasoningEffort = typeof reasoningEffortRaw === "string" && reasoningEffortRaw || typeof reasoningEffortFallback === "string" && reasoningEffortFallback || void 0;
1578
+ const reasoningEffort = typeof reasoningEffortRaw === "string" && reasoningEffortRaw || typeof reasoningEffortFallback === "string" && reasoningEffortFallback || undefined;
1567
1579
  const modelValue = readField2(agentConfig, "model");
1568
- const result2 = await executeCli(finalProvider, materializedPrompt.prompt, {
1580
+ const cliEnv = {
1581
+ NOLO_SERVER: effectiveRuntimeEnv.NOLO_SERVER || effectiveRuntimeEnv.NOLO_SERVER_URL || effectiveRuntimeEnv.BASE_URL,
1582
+ NOLO_SERVER_URL: effectiveRuntimeEnv.NOLO_SERVER_URL || effectiveRuntimeEnv.NOLO_SERVER || effectiveRuntimeEnv.BASE_URL,
1583
+ BASE_URL: effectiveRuntimeEnv.BASE_URL || effectiveRuntimeEnv.NOLO_SERVER || effectiveRuntimeEnv.NOLO_SERVER_URL,
1584
+ AUTH_TOKEN: effectiveRuntimeEnv.AUTH_TOKEN || effectiveRuntimeEnv.AUTH || effectiveRuntimeEnv.NOLO_MACHINE_API_KEY,
1585
+ NOLO_MACHINE_API_KEY: effectiveRuntimeEnv.NOLO_MACHINE_API_KEY || effectiveRuntimeEnv.AUTH_TOKEN || effectiveRuntimeEnv.AUTH
1586
+ };
1587
+ const emitCliDelta = (event) => {
1588
+ if (!runAbortController.signal.aborted) {
1589
+ send(JSON.stringify({ type: "agent.run.delta", requestId, event }));
1590
+ }
1591
+ };
1592
+ const connectorDialogId = asOptionalTrimmedString(payload.continueDialogId) ?? asOptionalTrimmedString(payload.dialogId);
1593
+ const baseCliOptions = {
1569
1594
  signal: runAbortController.signal,
1570
- model: typeof modelValue === "string" ? modelValue : void 0,
1595
+ model: typeof modelValue === "string" ? modelValue : undefined,
1571
1596
  timeout,
1572
1597
  cwd,
1573
1598
  yolo: true,
1574
1599
  ...reasoningEffort ? { reasoningEffort } : {},
1575
- env: {
1576
- NOLO_SERVER: effectiveRuntimeEnv2.NOLO_SERVER || effectiveRuntimeEnv2.NOLO_SERVER_URL || effectiveRuntimeEnv2.BASE_URL,
1577
- NOLO_SERVER_URL: effectiveRuntimeEnv2.NOLO_SERVER_URL || effectiveRuntimeEnv2.NOLO_SERVER || effectiveRuntimeEnv2.BASE_URL,
1578
- BASE_URL: effectiveRuntimeEnv2.BASE_URL || effectiveRuntimeEnv2.NOLO_SERVER || effectiveRuntimeEnv2.NOLO_SERVER_URL,
1579
- AUTH_TOKEN: effectiveRuntimeEnv2.AUTH_TOKEN || effectiveRuntimeEnv2.AUTH || effectiveRuntimeEnv2.NOLO_MACHINE_API_KEY,
1580
- NOLO_MACHINE_API_KEY: effectiveRuntimeEnv2.NOLO_MACHINE_API_KEY || effectiveRuntimeEnv2.AUTH_TOKEN || effectiveRuntimeEnv2.AUTH
1581
- },
1600
+ env: cliEnv,
1582
1601
  ...connectorImageUrls.length > 0 ? { imageInputs: connectorImageUrls.map((url) => ({ source: url })) } : {}
1583
- }).finally(() => clearInterval(heartbeat));
1584
- executionStopped = getExecutionStoppedPromise(result2);
1602
+ };
1603
+ const useConnectorAgyAcp = finalProvider === "agy" && Boolean(deps.executeAgyAcp) && Boolean(connectorDialogId) && isAgyAcpEnabled2(effectiveRuntimeEnv);
1604
+ const useConnectorAgyOneShot = !useConnectorAgyAcp && finalProvider === "agy" && Boolean(deps.executeAgyAcpOneShot) && isAgyAcpSharedDaemonEnabled2(effectiveRuntimeEnv);
1605
+ const useConnectorAgyStreaming = !useConnectorAgyAcp && !useConnectorAgyOneShot && finalProvider === "agy" && Boolean(deps.executeCliStreaming);
1606
+ const onAgyToolEvent = (toolEvent) => {
1607
+ if ((toolEvent.type === "tool-call" || toolEvent.type === "tool-result" || toolEvent.type === "tool-error") && toolEvent.toolCallId && toolEvent.toolName) {
1608
+ emitCliDelta({
1609
+ type: toolEvent.type,
1610
+ toolCallId: toolEvent.toolCallId,
1611
+ toolName: toolEvent.toolName
1612
+ });
1613
+ sendProgress({
1614
+ ...progressBase,
1615
+ eventType: toolEvent.type,
1616
+ lastToolNames: [toolEvent.toolName],
1617
+ message: toolEvent.summary,
1618
+ updatedAt: Date.now()
1619
+ });
1620
+ }
1621
+ };
1622
+ const result = await (useConnectorAgyAcp && deps.executeAgyAcp && connectorDialogId ? deps.executeAgyAcp(`connector-acp:${connectorDialogId}:${payloadAgentKey || "agy"}:${cwd}`, asOptionalTrimmedString(payload.userInput) ?? materializedPrompt.prompt, {
1623
+ ...baseCliOptions,
1624
+ systemPrompt: asOptionalTrimmedString(readField2(agentConfig, "prompt")),
1625
+ onChunk: (content) => emitCliDelta({ type: "text", content }),
1626
+ onThoughtChunk: (content) => emitCliDelta({ type: "reasoning", content }),
1627
+ onToolEvent: onAgyToolEvent
1628
+ }) : useConnectorAgyOneShot && deps.executeAgyAcpOneShot ? deps.executeAgyAcpOneShot(asOptionalTrimmedString(payload.userInput) ?? materializedPrompt.prompt, {
1629
+ ...baseCliOptions,
1630
+ systemPrompt: asOptionalTrimmedString(readField2(agentConfig, "prompt")),
1631
+ onChunk: (content) => emitCliDelta({ type: "text", content }),
1632
+ onThoughtChunk: (content) => emitCliDelta({ type: "reasoning", content }),
1633
+ onToolEvent: onAgyToolEvent
1634
+ }) : useConnectorAgyStreaming && deps.executeCliStreaming ? deps.executeCliStreaming(finalProvider, materializedPrompt.prompt, {
1635
+ ...baseCliOptions,
1636
+ onChunk: (content) => emitCliDelta({ type: "text", content })
1637
+ }) : executeCli(finalProvider, materializedPrompt.prompt, baseCliOptions)).finally(() => clearInterval(heartbeat));
1638
+ executionStopped = getExecutionStoppedPromise2(result);
1585
1639
  logConnectorRun("agent.run.cli.result", {
1586
1640
  requestId,
1587
1641
  provider: finalProvider,
1588
- elapsed: result2.elapsed,
1589
- outputBytes: byteLengthLocal(result2.raw ?? result2.text ?? "")
1642
+ elapsed: result.elapsed,
1643
+ outputBytes: byteLengthLocal(result.raw ?? result.text ?? "")
1590
1644
  });
1591
- runContent = result2.text;
1645
+ runContent = result.text;
1592
1646
  const explicitModel = readField2(agentConfig, "model");
1593
1647
  runModel = asOptionalTrimmedString(explicitModel) ?? finalProvider;
1594
- runTrace = [{ role: "assistant", content: result2.text }];
1595
- const artifacts2 = await collectConnectorRunArtifact2({
1648
+ runTrace = [{ role: "assistant", content: result.text }];
1649
+ const artifacts = await collectConnectorRunArtifact2({
1596
1650
  cwd: artifactCwd,
1597
1651
  baseSha,
1598
1652
  exitStatus: "completed"
1599
1653
  });
1600
- const artifactProgress2 = buildArtifactProgress({
1601
- artifacts: artifacts2,
1654
+ const artifactProgress = buildArtifactProgress({
1655
+ artifacts,
1602
1656
  runtimePolicy,
1603
1657
  workspaceRoot: artifactCwd,
1604
1658
  workspaceKind: "current"
1605
1659
  });
1606
- if (artifactProgress2) sendProgress(artifactProgress2);
1660
+ if (artifactProgress)
1661
+ sendProgress(artifactProgress);
1607
1662
  stageTerminalResult({
1608
1663
  result: {
1609
1664
  content: runContent,
1610
1665
  model: runModel,
1611
1666
  trace: runTrace,
1612
- artifacts: artifacts2
1667
+ artifacts
1613
1668
  }
1614
1669
  });
1615
1670
  return;
@@ -1633,12 +1688,12 @@ async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv,
1633
1688
  return;
1634
1689
  }
1635
1690
  runAbortController.signal.throwIfAborted();
1636
- const streamLease = payload.stream === true ? connectorTurnLease : void 0;
1691
+ const streamLease = payload.stream === true ? connectorTurnLease : undefined;
1637
1692
  if (streamLease) {
1638
1693
  send(JSON.stringify({ type: "agent.run.accepted", requestId, dialogId: streamLease.dialogRef.dialogId }));
1639
1694
  }
1640
1695
  if (!strictPermission || strictPermission.allowFilesystemRead) {
1641
- baseSha = await readConnectorGitHead2(cwd, strictPermission ? { workspaceOnly: true } : void 0);
1696
+ baseSha = await readConnectorGitHead2(cwd, strictPermission ? { workspaceOnly: true } : undefined);
1642
1697
  }
1643
1698
  runAbortController.signal.throwIfAborted();
1644
1699
  const result = await runConnectorLocalRuntimeAgent({
@@ -1658,7 +1713,7 @@ async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv,
1658
1713
  } } : {},
1659
1714
  abortSignal: runAbortController.signal
1660
1715
  });
1661
- executionStopped = getExecutionStoppedPromise(result);
1716
+ executionStopped = getExecutionStoppedPromise2(result);
1662
1717
  runContent = result.content;
1663
1718
  runModel = result.model;
1664
1719
  runTrace = result.trace ?? [];
@@ -1668,22 +1723,21 @@ async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv,
1668
1723
  baseSha,
1669
1724
  exitStatus: "completed",
1670
1725
  ...strictPermission ? { workspaceOnly: true } : {}
1671
- }) : void 0;
1726
+ }) : undefined;
1672
1727
  const artifactProgress = artifacts && buildArtifactProgress({
1673
1728
  artifacts,
1674
1729
  runtimePolicy,
1675
1730
  workspaceRoot: artifactCwd,
1676
1731
  workspaceKind: "current"
1677
1732
  });
1678
- if (artifactProgress) sendProgress(artifactProgress);
1733
+ if (artifactProgress)
1734
+ sendProgress(artifactProgress);
1679
1735
  stageTerminalResult({
1680
1736
  result: {
1681
1737
  content: runContent,
1682
1738
  model: runModel,
1683
1739
  trace: runTrace,
1684
1740
  artifacts,
1685
- // Preserve host facts across the JSON transport. In particular do not
1686
- // turn missing stopReason into success for legacy local runtimes.
1687
1741
  stopReason: result.stopReason,
1688
1742
  pending: result.pending,
1689
1743
  hasPendingInteraction: result.hasPendingInteraction,
@@ -1696,9 +1750,9 @@ async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv,
1696
1750
  }
1697
1751
  });
1698
1752
  } catch (error) {
1699
- const errorStopped = getExecutionStoppedPromise(error);
1700
- if (errorStopped) executionStopped = executionStopped ? Promise.all([executionStopped, errorStopped]).then(() => {
1701
- }) : errorStopped;
1753
+ const errorStopped = getExecutionStoppedPromise2(error);
1754
+ if (errorStopped)
1755
+ executionStopped = executionStopped ? Promise.all([executionStopped, errorStopped]).then(() => {}) : errorStopped;
1702
1756
  logConnectorRun("agent.run.error", {
1703
1757
  requestId,
1704
1758
  agentKey: readField2(payload, "agentKey"),
@@ -1733,7 +1787,7 @@ async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv,
1733
1787
  const release = () => releaseConnectorTurnLeaseWithRecovery(authority, lease);
1734
1788
  const reportReleaseError = (error) => logConnectorRun("agent.run.settlement.error", { requestId, error: toErrorMessage(error) });
1735
1789
  if (executionStopped) {
1736
- void executionStopped.then(release).catch(reportReleaseError);
1790
+ executionStopped.then(release).catch(reportReleaseError);
1737
1791
  } else {
1738
1792
  try {
1739
1793
  await release();
@@ -1747,7 +1801,8 @@ async function handleConnectorRunMessage(message, send, executeCli, runtimeEnv,
1747
1801
  }
1748
1802
  }
1749
1803
  }
1750
- if (terminalMessage !== void 0) send(terminalMessage);
1804
+ if (terminalMessage !== undefined)
1805
+ send(terminalMessage);
1751
1806
  } finally {
1752
1807
  sessionSignal?.removeEventListener("abort", abortRunOnDisconnect);
1753
1808
  if (activeRunAbortControllers.get(requestId) === activeRun) {
@@ -1760,28 +1815,9 @@ function byteLengthLocal(value) {
1760
1815
  return Buffer.byteLength(value, "utf8");
1761
1816
  }
1762
1817
  function readField2(record, key) {
1763
- if (!isRecord(record)) return void 0;
1818
+ if (!isRecord(record))
1819
+ return;
1764
1820
  return record[key];
1765
1821
  }
1766
1822
 
1767
- export {
1768
- CONNECTOR_LOCK_CORRUPT_RECLAIM_SECONDS,
1769
- acquireConnectorInstanceLock,
1770
- clearConnectorAlive,
1771
- withConnectorAliveSignal,
1772
- resolveMachineRunPermissionPolicy,
1773
- buildMachinePermissionPromptBlock,
1774
- summarizeAgentConfigForLogs,
1775
- runtimePolicyFromConnectorPayload,
1776
- requestsLocalWorkspaceRuntime,
1777
- isMachineBoundLocalCustomProvider,
1778
- hasExplicitMachinePermissions,
1779
- runtimeWorkspacePermissionPolicy,
1780
- scopePermissionPolicyToRuntimeWorkspace,
1781
- localRuntimeEnvFromPolicy,
1782
- buildArtifactProgress,
1783
- defaultRunConnectorLocalRuntimeAgent,
1784
- extractMultimodalUserInput,
1785
- __setConnectorLeaseRecoveryCapacityForTest,
1786
- handleConnectorRunMessage
1787
- };
1823
+ export { CONNECTOR_LOCK_CORRUPT_RECLAIM_SECONDS, acquireConnectorInstanceLock, clearConnectorAlive, withConnectorAliveSignal, resolveMachineRunPermissionPolicy, buildMachinePermissionPromptBlock, handleConnectorRunMessage2 };