nolo-cli 0.227.0-alpha.1 → 0.228.0-alpha.2

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 (199) hide show
  1. package/{_executeModel-JKQGZ3HU.js → _executeModel-VYCHHZVT.js} +78 -77
  2. package/{action-CK64LS6S.js → action-GDZDXPMB.js} +9 -9
  3. package/{addContentAction-CARFID6E.js → addContentAction-7RO4AMRI.js} +14 -14
  4. package/{addDialogAgentAction-APLZLFW5.js → addDialogAgentAction-EVYBGTXB.js} +16 -16
  5. package/{agentDeleteCommand-NVR2V2HH.js → agentDeleteCommand-QWQKT54A.js} +116 -115
  6. package/{agentEmailCommands-UCVOWD3S.js → agentEmailCommands-EISMBIRE.js} +119 -118
  7. package/{agentFavoriteCommands-4PDOP3GW.js → agentFavoriteCommands-7LOP3HUD.js} +6 -6
  8. package/{agentGrantCommands-FLCEXLUH.js → agentGrantCommands-L6O2HVJI.js} +7 -7
  9. package/{agentListCommands-C65UESYM.js → agentListCommands-4WLG32IW.js} +79 -470
  10. package/{agentMachineCommands-V3DGEJU4.js → agentMachineCommands-DC6NKWTU.js} +59 -57
  11. package/{agentProviderCommands-7QBFRFRK.js → agentProviderCommands-STI3DQ6A.js} +7 -7
  12. package/{agentPullCommand-E6JBGBVG.js → agentPullCommand-KHV4EELF.js} +6 -6
  13. package/{agentRecordCommands-6RCJS2EY.js → agentRecordCommands-IZYUVHME.js} +107 -106
  14. package/{agentRunCommand-P3GRKXKS.js → agentRunCommand-QM7ETUTX.js} +113 -112
  15. package/{agentRunControl-SNZZ5XP4.js → agentRunControl-MBG4U6SL.js} +23 -17
  16. package/{agentRuntimeLocal-GOX2DIY7.js → agentRuntimeLocal-HOXKWCYO.js} +46 -45
  17. package/{agentSlice-N7H2FRJA.js → agentSlice-UG76KEBH.js} +17 -17
  18. package/{appDeleteCommands-LZDN26FU.js → appDeleteCommands-WWCC6WA5.js} +54 -52
  19. package/{appDeployCommands-6IO6TTZH.js → appDeployCommands-AU4IUN33.js} +54 -52
  20. package/{appDeployStatusCommands-FG3LX24J.js → appDeployStatusCommands-STUW7WXL.js} +54 -52
  21. package/{appGetCommands-NAKVDVD4.js → appGetCommands-BGTLIQ4K.js} +54 -52
  22. package/{appListCommands-KL56RN73.js → appListCommands-CUCPRUXW.js} +54 -52
  23. package/{authCommand-AUN5MXV2.js → authCommand-OZ2KTP4Z.js} +30 -31
  24. package/{authCommands-D2IPS6ES.js → authCommands-55OGQGCR.js} +12 -13
  25. package/{builtinSkillRegistry-UQGLKRYP.js → builtinSkillRegistry-BAE2LDXF.js} +4 -4
  26. package/{chromeOpsCommands-UJWN5HWH.js → chromeOpsCommands-WAA45NCS.js} +8 -8
  27. package/{chunk-OB6DVWPF.js → chunk-262R3XNN.js} +16 -2
  28. package/{chunk-UN7HIYMH.js → chunk-2X7WFDT6.js} +1 -1
  29. package/{chunk-XI2BWJM5.js → chunk-324FWHUA.js} +20 -3
  30. package/{chunk-CVERLOJM.js → chunk-3QIYD3VM.js} +639 -513
  31. package/{chunk-RU6DULV4.js → chunk-3U44JB3O.js} +1 -1
  32. package/{chunk-IAJJYHIB.js → chunk-3VZLEKV2.js} +7 -7
  33. package/{chunk-JWXITTQB.js → chunk-42OKN2LI.js} +1 -1
  34. package/{chunk-UAPNPNSG.js → chunk-45CAVC35.js} +1072 -859
  35. package/{chunk-EUCFKKDM.js → chunk-4I2MXV5Q.js} +38 -10
  36. package/{chunk-SW6OD4KE.js → chunk-4QYJPWHH.js} +123 -12
  37. package/{chunk-PLPLH2XZ.js → chunk-4ZGPHFLE.js} +2 -2
  38. package/{chunk-NO3VBWTL.js → chunk-547ENH5T.js} +1 -1
  39. package/{chunk-CKT6QUE2.js → chunk-5YMA6DDZ.js} +1 -1
  40. package/chunk-5ZUOVCKT.js +32 -0
  41. package/{chunk-XZODOEKU.js → chunk-6QHKRARD.js} +2 -2
  42. package/{chunk-YGMBIXCF.js → chunk-6XRPBZRS.js} +4 -2
  43. package/{chunk-PVAWNHP5.js → chunk-7BCG67EI.js} +295 -102
  44. package/{chunk-VZW34YUL.js → chunk-7FEP5USX.js} +8 -5
  45. package/{chunk-VPAZ6BEN.js → chunk-7JGMNKKG.js} +18 -14
  46. package/{chunk-5HL4KC4A.js → chunk-ALAES342.js} +57 -86
  47. package/{chunk-VREDDN25.js → chunk-ATEKLSLR.js} +1 -1
  48. package/chunk-BIDSIRTS.js +307 -0
  49. package/chunk-BIWI5M4E.js +62 -0
  50. package/{chunk-UCFPVYP7.js → chunk-BP5ZJ6B4.js} +1 -1
  51. package/{chunk-2G3YSVO6.js → chunk-CBUZ6DKA.js} +3 -3
  52. package/{chunk-KYH7XW3K.js → chunk-CD3RU7XL.js} +16 -1
  53. package/{chunk-SFTTXGPM.js → chunk-CMMI3DAT.js} +16 -16
  54. package/{chunk-VIHDJ3FK.js → chunk-CNMY2XM6.js} +14 -14
  55. package/{chunk-UVUVQVZ6.js → chunk-DBUR22G5.js} +2 -2
  56. package/{chunk-G6HJUMST.js → chunk-DEA37IUY.js} +2 -2
  57. package/{chunk-5RKRXQ2H.js → chunk-DGYCDA6W.js} +2 -2
  58. package/{chunk-FKEZOMIF.js → chunk-DLXMMTGM.js} +523 -202
  59. package/{chunk-3HTP4WZQ.js → chunk-DUUDXSLX.js} +21 -7
  60. package/{chunk-KFHREHUQ.js → chunk-DXWGFL2Z.js} +89 -1
  61. package/{chunk-TOKPHZ55.js → chunk-EEOOBRA7.js} +5 -5
  62. package/{chunk-ZI5SZ3MV.js → chunk-EGHP7KOY.js} +20 -20
  63. package/{chunk-OXA5GWHU.js → chunk-F6Z6ZCUV.js} +2 -2
  64. package/{chunk-X2KRQP7V.js → chunk-FJSNBZXR.js} +1 -1
  65. package/{chunk-3VFYQH3I.js → chunk-FPBJM2BW.js} +17 -39
  66. package/{chunk-KRRE4A7D.js → chunk-G7IUT2V3.js} +3 -2
  67. package/{chunk-LXTC53TN.js → chunk-GAYNXB6T.js} +184 -153
  68. package/{chunk-45LZIYXB.js → chunk-HBRDSQ3M.js} +1 -1
  69. package/{chunk-GRXSJR2Z.js → chunk-HF7BLF3F.js} +21 -21
  70. package/{chunk-T5N6NHAT.js → chunk-HHFGE2WF.js} +3 -3
  71. package/{chunk-IX2BXN2K.js → chunk-HSSBDZLD.js} +3 -3
  72. package/{chunk-TINJKQSO.js → chunk-HXB4VDGK.js} +20 -20
  73. package/{chunk-MWHOH4RJ.js → chunk-HYLRQDEE.js} +4 -4
  74. package/{chunk-L5I543VB.js → chunk-JQZRSXS5.js} +23 -23
  75. package/{chunk-T2BEPTAG.js → chunk-L32W3PRP.js} +47 -17
  76. package/{chunk-LA7JYAKF.js → chunk-LYD6C7OU.js} +3 -3
  77. package/{chunk-PHOSZT3E.js → chunk-M3OZRQNH.js} +1 -1
  78. package/{chunk-M3Y4IBIR.js → chunk-M4SFKP5L.js} +4 -4
  79. package/{chunk-7Z3WUZ4Q.js → chunk-MJI3UAXN.js} +52 -28
  80. package/{chunk-YOT437BH.js → chunk-MNEZUL5S.js} +137 -118
  81. package/{chunk-GOLPOTG5.js → chunk-MZG5CETE.js} +3 -3
  82. package/{chunk-KJAAPGBE.js → chunk-OBIC6EG7.js} +6 -6
  83. package/{chunk-CLCXHIBS.js → chunk-OJ45MEEI.js} +1 -1
  84. package/{chunk-AXYH4734.js → chunk-OOJNQK6V.js} +13 -13
  85. package/{chunk-2SKTCNWO.js → chunk-OTKSESZR.js} +2 -2
  86. package/{chunk-XIEYGCN6.js → chunk-OWKNSIXL.js} +149 -48
  87. package/{chunk-6XIE5ZGI.js → chunk-PDCV7P5W.js} +1 -1
  88. package/{chunk-HOCHUZQ7.js → chunk-QJTZ76CP.js} +24 -6
  89. package/{chunk-YQETUZ5V.js → chunk-QRGDJA4B.js} +11 -11
  90. package/{chunk-ULAQPRHX.js → chunk-QYB23WUH.js} +1 -1
  91. package/{chunk-CSW7IPVD.js → chunk-R6Z5S5GA.js} +11 -11
  92. package/{chunk-MK2Q7ZJD.js → chunk-R7XWZDOH.js} +58 -24
  93. package/{chunk-GUVXQSFZ.js → chunk-RBPUNSG5.js} +1 -1
  94. package/{chunk-GOQ6ZVTN.js → chunk-RG2DGNL6.js} +3 -3
  95. package/{chunk-F5AY2UZL.js → chunk-RRDRQOEC.js} +515 -9
  96. package/{chunk-6EDAMVG6.js → chunk-RTHFJZ6M.js} +10 -10
  97. package/{chunk-WJP4TH6U.js → chunk-S6FDXXZV.js} +1 -1
  98. package/{chunk-LJSNEV7M.js → chunk-SRCCSTIM.js} +7 -7
  99. package/{chunk-KMRKZNGT.js → chunk-TCZ2VJZQ.js} +13 -12
  100. package/{chunk-AK5O76CC.js → chunk-TI2EPRHE.js} +2 -2
  101. package/{chunk-5LQDHFBN.js → chunk-TQEKUOTI.js} +14 -11
  102. package/{chunk-SRG5CNLC.js → chunk-TSPMLCWI.js} +6 -6
  103. package/{chunk-YGILMZ7N.js → chunk-TUSTONB3.js} +1 -1
  104. package/{chunk-YPPKC6FL.js → chunk-U2HBB7RS.js} +17 -17
  105. package/{chunk-HVUDBOQG.js → chunk-VMJVAJ6W.js} +9 -6
  106. package/{chunk-CQVGR3MX.js → chunk-VQ5N5GSV.js} +8 -8
  107. package/{chunk-ABGULE7H.js → chunk-WCFFRBL5.js} +12 -12
  108. package/{chunk-NAOO4PVX.js → chunk-WFDNADFX.js} +16 -16
  109. package/chunk-WFGNWWJI.js +326 -0
  110. package/{chunk-FIYSMXHY.js → chunk-WWTSEBDF.js} +1 -1
  111. package/{chunk-JHF6VLVL.js → chunk-X3E6EHJW.js} +32 -31
  112. package/{chunk-E2BESSAW.js → chunk-X4O7FJF5.js} +2 -0
  113. package/{chunk-C2B7M567.js → chunk-XAG3FWBE.js} +15 -4
  114. package/{chunk-4OKTPFNX.js → chunk-XFXFPUO7.js} +105 -37
  115. package/{chunk-HYKGIXNO.js → chunk-XSW4EXQV.js} +85 -21
  116. package/{chunk-ZADGPNTV.js → chunk-XTJKU3Z4.js} +29 -29
  117. package/{chunk-T43K75CK.js → chunk-YKY4OVOX.js} +15 -15
  118. package/{chunk-ZYA2YDB6.js → chunk-YVFH2MFB.js} +16 -16
  119. package/{chunk-L42CBKBZ.js → chunk-ZEVQHCLM.js} +3 -3
  120. package/{chunk-5RKUPJYL.js → chunk-ZH3KXFHS.js} +11 -3
  121. package/chunk-ZOHO6MOF.js +376 -0
  122. package/{chunk-PXKF5CV4.js → chunk-ZXF6D3I6.js} +10 -8
  123. package/{cliAgentConfigHelpers-QVSQYTKC.js → cliAgentConfigHelpers-BTRHMPW2.js} +14 -14
  124. package/{cliEnvHelpers-D6HMC46Z.js → cliEnvHelpers-CNMP3RDX.js} +2 -2
  125. package/{cliExecutor-4MAX3PZL.js → cliExecutor-K6FDZTQ2.js} +3 -1
  126. package/{cliLocalAgentRecordReader-SPKAJYME.js → cliLocalAgentRecordReader-H3HYQRRR.js} +48 -47
  127. package/{commandRegistry-TKR6OWXP.js → commandRegistry-FVYPE2IN.js} +93 -93
  128. package/{contentThunks-BQWRPCTM.js → contentThunks-GNFPG32S.js} +36 -35
  129. package/{cooldownCommands-FZYQOWI5.js → cooldownCommands-YB5H5BBK.js} +3 -3
  130. package/{createAgentAutomationAction-GFI6SJZV.js → createAgentAutomationAction-PB4QIFQ4.js} +36 -35
  131. package/{createDialogAction-MMBIHFFU.js → createDialogAction-EVTOPY7A.js} +37 -37
  132. package/{createPageAction-EEYUE5FB.js → createPageAction-2UYF2IDZ.js} +39 -38
  133. package/{db-CS4ZJQKV.js → db-M7FU2GNK.js} +9 -6
  134. package/{dbSlice-X4Z4E4QU.js → dbSlice-XRUZOGSU.js} +13 -13
  135. package/{deleteFile-QOOP2UK7.js → deleteFile-6URDHYRB.js} +9 -9
  136. package/{dialogCommands-OXBQ73DD.js → dialogCommands-6SZD4TYP.js} +58 -57
  137. package/{dialogNotifyCommand-VWS5G4OO.js → dialogNotifyCommand-SHGPCU22.js} +17 -17
  138. package/{dialogSlice-KGYIABDY.js → dialogSlice-5EQ2A6LY.js} +34 -33
  139. package/{dialogUsageCommand-FEWCN7IA.js → dialogUsageCommand-W2WCSGKF.js} +6 -6
  140. package/{docCreateCommands-LS32VKY3.js → docCreateCommands-25E6PGN3.js} +53 -51
  141. package/{docDeleteCommands-JTYR5RPH.js → docDeleteCommands-F7ZVGEHW.js} +55 -53
  142. package/{docReadCommands-E5LTVKWN.js → docReadCommands-JY2E5XEN.js} +53 -51
  143. package/{docStore-TVS2FNER.js → docStore-OKKIKLT3.js} +15 -15
  144. package/{docUpdateCommands-I3J3JDZ2.js → docUpdateCommands-OZ4CUSIQ.js} +53 -51
  145. package/{fetchMessages-Q3INLN5F.js → fetchMessages-TQEUZD7H.js} +3 -3
  146. package/{getPricing-VNGFM4PN.js → getPricing-LF5C4XSI.js} +6 -6
  147. package/{handleSendMessageAction-SSON36TJ.js → handleSendMessageAction-LNT7SZND.js} +68 -67
  148. package/{hostCredentialCreate-WTW4THJF.js → hostCredentialCreate-XUU2CSHI.js} +107 -106
  149. package/index.js +54 -16
  150. package/keys-RWF7UCB4.js +1 -1
  151. package/{localDialogRead-V36DX2Q2.js → localDialogRead-CCOCVGAP.js} +2 -2
  152. package/{localRuntimeAdapter-MI2JGXSF.js → localRuntimeAdapter-IBSTMSX7.js} +114 -113
  153. package/{machineCommands-3LROJZDK.js → machineCommands-HSQHDHOT.js} +135 -119
  154. package/{machineWsRunDispatch-BUUJRUUB.js → machineWsRunDispatch-L6H7J66T.js} +105 -104
  155. package/{memberThunks-CFEPHAND.js → memberThunks-7Y3OYSJQ.js} +17 -17
  156. package/{memoryCommands-JQMEJO7J.js → memoryCommands-BC6REPQB.js} +6 -6
  157. package/{overlay-THLKYIWY.js → overlay-BBQZXGYI.js} +5 -3
  158. package/package.json +1 -1
  159. package/{projectArchive-3X54XFVN.js → projectArchive-FQO654Z3.js} +44 -43
  160. package/{providerPresetApply-FO36N5TX.js → providerPresetApply-WHAMP2D5.js} +9 -9
  161. package/{providerRegistry-U2BSFE6K.js → providerRegistry-ZI2KORJ7.js} +9 -9
  162. package/{read-KA3L2V7O.js → read-TYMBGEXO.js} +9 -9
  163. package/{readDocTool-AMAZAPAW.js → readDocTool-SKQVHBLO.js} +1 -1
  164. package/{readlineWorkspace-Z3YUH4SX.js → readlineWorkspace-7U272DSA.js} +4398 -4165
  165. package/{removeDialogAgentAction-JQOJSUM7.js → removeDialogAgentAction-F5QE2O2B.js} +19 -19
  166. package/{runAgentClientLoop-4FCFLMDJ.js → runAgentClientLoop-AF4JQIJ7.js} +72 -71
  167. package/{runtimeDoctorCommands-CXOCVDPU.js → runtimeDoctorCommands-RRKPBGVO.js} +16 -16
  168. package/{secretCommands-GGUAWAE7.js → secretCommands-KZWBZIYS.js} +2 -2
  169. package/{setDialogExtraReferencesAction-YXQTGXIN.js → setDialogExtraReferencesAction-72L27ERM.js} +15 -15
  170. package/{setPrimaryDialogAgentAction-YNLB66WE.js → setPrimaryDialogAgentAction-GJJDUSGJ.js} +19 -19
  171. package/{settingThunks-E6N7RSSS.js → settingThunks-ZRGWVGZD.js} +18 -18
  172. package/{skillDiscovery-B5V23AXP.js → skillDiscovery-BHHPCUHZ.js} +3 -3
  173. package/{spaceCommands-DB5DKC2J.js → spaceCommands-5VNWMDBE.js} +55 -53
  174. package/{store-JRVN62NM.js → store-Z53ICFL3.js} +3 -1
  175. package/{streamAgentChatTurn-FCBGMD4D.js → streamAgentChatTurn-YSPEFY4K.js} +97 -95
  176. package/{switchDialogAgentAction-LAHLUECU.js → switchDialogAgentAction-IIJBPND3.js} +16 -16
  177. package/{tableCommands-VNSXHAMG.js → tableCommands-FTAOCBTX.js} +12 -12
  178. package/{tools-6JD36D6K.js → tools-M35PTIFB.js} +61 -60
  179. package/tuiRestart-2IL37YIB.js +41 -0
  180. package/{tuiSummaryLlmCaller-UHZIPGAX.js → tuiSummaryLlmCaller-W2QN4VAC.js} +21 -21
  181. package/{updateCommands-KZ54HCU5.js → updateCommands-CPATDG6J.js} +8 -6
  182. package/{updateDialogTitleAction-RV3EUEN3.js → updateDialogTitleAction-IMIRJRQQ.js} +36 -35
  183. package/{usageCommand-KFVV6UL3.js → usageCommand-2BF74MKF.js} +2 -2
  184. package/{usageRebuildCommand-HHFSNK46.js → usageRebuildCommand-UHB55BQM.js} +3 -3
  185. package/{windowsSelfUpdate-KERHIAB4.js → windowsSelfUpdate-ZFD6J5HF.js} +2 -2
  186. package/chunk-2WZXXAQD.js +0 -57
  187. package/chunk-BJF2MHJ3.js +0 -118
  188. package/chunk-KEPOVMF4.js +0 -91
  189. package/chunk-PMDVQBGA.js +0 -100
  190. package/chunk-WACI5I6V.js +0 -147
  191. package/{accountResolver-EK2S4PWF.js → accountResolver-QETKNC7T.js} +4 -4
  192. package/{chunk-AGP3YSEC.js → chunk-4N6G2CKP.js} +3 -3
  193. package/{chunk-VXL2FZTP.js → chunk-HXER7YJF.js} +3 -3
  194. package/{chunk-BLVSFYQ3.js → chunk-LISC7BD4.js} +3 -3
  195. package/{chunk-SSGTV4FC.js → chunk-USGHJSGO.js} +5 -5
  196. package/{chunk-IC2I373Q.js → chunk-VS276URX.js} +3 -3
  197. package/{chunk-AETZ7AD6.js → chunk-W6RFEDN4.js} +3 -3
  198. package/{offlineMarxistsAgentCommand-AGA2X5E4.js → offlineMarxistsAgentCommand-XVXUE6G5.js} +5 -5
  199. package/{workloadLifecycle-O2I3NZ2Q.js → workloadLifecycle-HFJIN5IZ.js} +8 -8
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  toolRegistry
3
- } from "./chunk-LXTC53TN.js";
3
+ } from "./chunk-GAYNXB6T.js";
4
4
  import {
5
5
  runtime_default
6
- } from "./chunk-PVAWNHP5.js";
6
+ } from "./chunk-7BCG67EI.js";
7
7
  import {
8
8
  canonicalizeToolNames
9
9
  } from "./chunk-6OVNSQHN.js";
@@ -1,25 +1,30 @@
1
1
  import {
2
2
  resolveRuntimeAuthToken,
3
3
  resolveRuntimeServerUrl
4
- } from "./chunk-UN7HIYMH.js";
4
+ } from "./chunk-2X7WFDT6.js";
5
5
  import {
6
6
  isAgentRunTerminalStatus,
7
7
  normalizeRunTitle,
8
8
  shortAgentKey
9
- } from "./chunk-AXYH4734.js";
9
+ } from "./chunk-OOJNQK6V.js";
10
10
  import {
11
11
  findPowerShellExecutable
12
- } from "./chunk-HVUDBOQG.js";
12
+ } from "./chunk-VMJVAJ6W.js";
13
13
  import {
14
14
  AUTH_ERROR_PATTERNS
15
15
  } from "./chunk-EWQ3HGNZ.js";
16
+ import {
17
+ AGENT_RUN_PROTOCOL,
18
+ HOST_RUNTIME_CONTENT_IDENTITY,
19
+ RuntimeVersionMismatchError,
20
+ getHostRuntimeExecutable,
21
+ isCompiledBinary,
22
+ resolveCliEntrypointPath,
23
+ resolveExactRuntimeEntrypoint
24
+ } from "./chunk-BIDSIRTS.js";
16
25
  import {
17
26
  isRecord
18
27
  } from "./chunk-KUG52IAP.js";
19
- import {
20
- isCompiledBinary,
21
- resolveCliEntrypointPath
22
- } from "./chunk-WACI5I6V.js";
23
28
 
24
29
  // packages/cli/client/originShellApprovalTransport.ts
25
30
  import { realpathSync } from "node:fs";
@@ -2022,6 +2027,34 @@ function listRunRecords(deps = {}) {
2022
2027
  (a, b) => new Date(b.startedAt).getTime() - new Date(a.startedAt).getTime()
2023
2028
  );
2024
2029
  }
2030
+ async function listRunRecordsAsync(deps = {}) {
2031
+ const dir = resolveRunsDir(deps.env, deps.homedir);
2032
+ let entries;
2033
+ try {
2034
+ entries = await nodeFs2.promises.readdir(dir);
2035
+ } catch {
2036
+ return [];
2037
+ }
2038
+ const records = new Array(entries.length);
2039
+ let next = 0;
2040
+ const readNext = async () => {
2041
+ while (next < entries.length) {
2042
+ const index = next++;
2043
+ const entry = entries[index];
2044
+ if (!entry.endsWith(".json")) continue;
2045
+ const path = resolveRunRecordPath(entry.slice(0, -5), deps.env, deps.homedir);
2046
+ for (let attempt = 0; attempt < 2; attempt++) {
2047
+ try {
2048
+ records[index] = JSON.parse(await nodeFs2.promises.readFile(path, "utf8"));
2049
+ break;
2050
+ } catch {
2051
+ }
2052
+ }
2053
+ }
2054
+ };
2055
+ await Promise.all(Array.from({ length: Math.min(16, entries.length) }, readNext));
2056
+ return records.filter((record) => Boolean(record)).sort((a, b) => new Date(b.startedAt).getTime() - new Date(a.startedAt).getTime());
2057
+ }
2025
2058
  function findRunRecordByPid(pid, deps = {}) {
2026
2059
  return listRunRecords(deps).find((record) => record.pid === pid);
2027
2060
  }
@@ -2215,38 +2248,22 @@ function rewriteMsgFileArg(args, messagePath) {
2215
2248
  return result;
2216
2249
  }
2217
2250
  function resolveValidCliEntrypoint(cliEntrypointPath, fs = nodeFs2) {
2218
- if (cliEntrypointPath && fs.existsSync(cliEntrypointPath)) {
2219
- return cliEntrypointPath;
2220
- }
2221
- const fallback = resolveCliEntrypointPath();
2222
- if (fs.existsSync(fallback)) {
2223
- return fallback;
2224
- }
2225
- const candidates = [
2226
- join2(dirname(fallback), "cli", "index.ts"),
2227
- join2(dirname(fallback), "cli", "index.js"),
2228
- join2(dirname(fallback), "..", "packages", "cli", "index.ts"),
2229
- join2(dirname(fallback), "..", "packages", "cli", "index.js"),
2230
- join2(dirname(fallback), "..", "index.js")
2231
- ];
2232
- for (const cand of candidates) {
2233
- if (fs.existsSync(cand)) {
2234
- return cand;
2235
- }
2236
- }
2237
- return fallback;
2251
+ const entrypoint = cliEntrypointPath ?? resolveCliEntrypointPath();
2252
+ if (!fs.existsSync(entrypoint)) throw new RuntimeVersionMismatchError("runtime entrypoint missing");
2253
+ return fs === nodeFs2 ? resolveExactRuntimeEntrypoint(entrypoint) : String(fs.realpathSync?.(entrypoint) ?? entrypoint);
2238
2254
  }
2239
2255
  function buildAgentRunChildCommand(options, deps = {}) {
2240
2256
  const fs = deps.fs ?? nodeFs2;
2241
- const execPath = process.execPath;
2257
+ const execPath = getHostRuntimeExecutable();
2242
2258
  const commandParts = options.commandPath ?? [];
2243
2259
  let strippedArgs = stripBackgroundFlag(options.rawArgs);
2244
2260
  if (options.messagePath) {
2245
2261
  strippedArgs = rewriteMsgFileArg(strippedArgs, options.messagePath);
2246
2262
  }
2247
2263
  strippedArgs = absolutizeSkillArgs(strippedArgs);
2248
- if (isCompiledBinary() || options.cliEntrypointPath === execPath) {
2249
- return { execPath, childArgs: [...commandParts, ...strippedArgs] };
2264
+ if (isCompiledBinary() || options.cliEntrypointPath === process.execPath || options.cliEntrypointPath === execPath) {
2265
+ const fixed = resolveValidCliEntrypoint(isCompiledBinary() ? execPath : options.cliEntrypointPath ?? execPath, fs);
2266
+ return { execPath: fixed, childArgs: [...commandParts, ...strippedArgs] };
2250
2267
  }
2251
2268
  const entrypoint = resolveValidCliEntrypoint(options.cliEntrypointPath, fs);
2252
2269
  if (entrypoint === execPath) {
@@ -2534,6 +2551,48 @@ function releaseUnspawnedLocalWriterClaim(runId, deps) {
2534
2551
  }, { strict: true });
2535
2552
  if (!released) throw new Error(`[local-writer-resource] release lock busy: ${runId}`);
2536
2553
  }
2554
+ async function recordRunStartup(runId, phase, deps = {}) {
2555
+ const attempt = () => withRunRecordLock(runId, deps, () => {
2556
+ const record = readRunRecord(runId, deps);
2557
+ if (!record || isRunTerminalStatus(record.status)) return true;
2558
+ record.startup = { protocol: AGENT_RUN_PROTOCOL, phase };
2559
+ writeRunRecord(record, deps);
2560
+ return true;
2561
+ }, { strict: true });
2562
+ const deadline = Date.now() + 2e3;
2563
+ while (!attempt()) {
2564
+ if (Date.now() >= deadline) throw new Error(`Startup evidence lock busy: ${runId}`);
2565
+ await new Promise((resolve2) => setTimeout(resolve2, 20));
2566
+ }
2567
+ }
2568
+ async function settleBackgroundProcessExit(runId, code, signal, deps = {}) {
2569
+ const deadline = Date.now() + 2e3;
2570
+ while (true) {
2571
+ const settled = withRunRecordLock(runId, deps, () => {
2572
+ const record = readRunRecord(runId, deps);
2573
+ if (!record) return true;
2574
+ if (isRunTerminalStatus(record.status)) {
2575
+ record.processExit = { code, signal };
2576
+ writeRunRecord(record, deps);
2577
+ return true;
2578
+ }
2579
+ return false;
2580
+ }, { strict: true });
2581
+ if (settled === true) return;
2582
+ if (settled === false) {
2583
+ const result = transitionRunToTerminal(runId, {
2584
+ status: signal === "SIGTERM" || signal === "SIGKILL" ? "killed" : "failed",
2585
+ exitCode: code ?? 1,
2586
+ processExit: { code, signal },
2587
+ failureReason: signal === "SIGTERM" || signal === "SIGKILL" ? "cancelled" : "startup_failed",
2588
+ note: `Child exited without terminal result (code=${code}, signal=${signal})`
2589
+ }, deps);
2590
+ if (result.kind !== "contended") return;
2591
+ }
2592
+ if (Date.now() >= deadline) throw new Error(`Process exit settlement lock busy: ${runId}`);
2593
+ await (deps.sleep ?? defaultSleep)(20);
2594
+ }
2595
+ }
2537
2596
  async function spawnLocalBackgroundRun(input, deps = {}) {
2538
2597
  const homedir = deps.homedir ?? nodeHomedir;
2539
2598
  const env = deps.env ?? (deps.homedir ? { ...process.env, NOLO_HOME: join2(homedir(), ".nolo") } : process.env);
@@ -2606,6 +2665,7 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
2606
2665
  ...input.evidenceScope ? { evidenceScope: input.evidenceScope } : {},
2607
2666
  ...input.dispatchSpeedProvenance ? { dispatchSpeedProvenance: input.dispatchSpeedProvenance } : {},
2608
2667
  runId,
2668
+ startup: { protocol: AGENT_RUN_PROTOCOL, phase: "spawn" },
2609
2669
  agentKey: input.agentKey,
2610
2670
  agentName: input.agentName?.trim() || shortAgentKey(input.agentKey),
2611
2671
  ...title ? { title } : {},
@@ -2636,17 +2696,32 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
2636
2696
  const rawArgsWithQueue = (input.rawArgs ?? []).some(
2637
2697
  (arg) => arg === "--queue-file" || arg.startsWith("--queue-file=")
2638
2698
  ) ? input.rawArgs : [...input.rawArgs ?? [], "--queue-file", queuePath];
2639
- const { execPath, childArgs } = buildAgentRunChildCommand(
2640
- {
2641
- rawArgs: rawArgsWithQueue,
2642
- commandPath: input.commandPath,
2643
- cliEntrypointPath: input.cliEntrypointPath,
2644
- messagePath
2645
- },
2646
- deps
2647
- );
2699
+ let childCommand;
2700
+ try {
2701
+ childCommand = buildAgentRunChildCommand(
2702
+ {
2703
+ rawArgs: rawArgsWithQueue,
2704
+ commandPath: input.commandPath,
2705
+ cliEntrypointPath: input.cliEntrypointPath,
2706
+ messagePath
2707
+ },
2708
+ deps
2709
+ );
2710
+ } catch (error) {
2711
+ const result = await settleRunTerminalAuthoritatively(runId, {
2712
+ status: "failed",
2713
+ exitCode: 1,
2714
+ failureReason: error instanceof RuntimeVersionMismatchError ? "runtime_version_mismatch" : "startup_failed",
2715
+ note: String(error)
2716
+ }, resolvedDeps, (id, update, d) => transitionRunToTerminal(id, update, d));
2717
+ if (result.kind === "contended") throw new Error(`Startup settlement lock busy: ${runId}; ${error}`);
2718
+ throw error;
2719
+ }
2720
+ const { execPath, childArgs } = childCommand;
2648
2721
  const childEnv = {
2649
2722
  ...env,
2723
+ NOLO_AGENT_RUN_PROTOCOL: AGENT_RUN_PROTOCOL,
2724
+ NOLO_AGENT_RUN_CONTENT_IDENTITY: HOST_RUNTIME_CONTENT_IDENTITY,
2650
2725
  NOLO_AGENT_RUN_CHILD: "1",
2651
2726
  NOLO_AGENT_RUN_ID: runId,
2652
2727
  ...record.writerLaunch ? { NOLO_WRITER_LAUNCH_ATTEMPT: record.writerLaunch.attemptId } : {}
@@ -2699,24 +2774,42 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
2699
2774
  reservation?.release("spawn_sync_failed");
2700
2775
  if (input.claimLocalWrites) releaseUnspawnedLocalWriterClaim(runId, resolvedDeps);
2701
2776
  } finally {
2702
- finalizeRunRecord(runId, { status: "failed", exitCode: 1, note: String(error) }, resolvedDeps);
2777
+ finalizeRunRecord(runId, { status: "failed", exitCode: 1, failureReason: error instanceof RuntimeVersionMismatchError ? "runtime_version_mismatch" : "startup_failed", note: String(error) }, resolvedDeps);
2703
2778
  }
2704
2779
  throw error;
2705
2780
  } finally {
2706
2781
  fs.closeSync?.(logFd);
2707
2782
  }
2708
2783
  proc.once?.("error", (error) => {
2784
+ let note = String(error);
2709
2785
  try {
2710
2786
  reservation.release("child_error");
2711
2787
  } catch (releaseError) {
2712
- finalizeRunRecord(runId, {
2713
- status: "failed",
2714
- exitCode: 1,
2715
- note: `${error}; reservation release failed: ${releaseError}`
2716
- }, resolvedDeps);
2717
- return;
2788
+ note += `; reservation release failed: ${releaseError}`;
2789
+ }
2790
+ void settleRunTerminalAuthoritatively(runId, {
2791
+ status: "failed",
2792
+ exitCode: 1,
2793
+ failureReason: "startup_failed",
2794
+ note
2795
+ }, resolvedDeps, (id, update, d) => transitionRunToTerminal(id, update, d)).then((result) => {
2796
+ if (result.kind === "contended") throw new Error(`Startup settlement lock busy: ${runId}`);
2797
+ }).catch((error2) => {
2798
+ input.output?.write(`[nolo] background error settlement failed: ${error2}
2799
+ `);
2800
+ });
2801
+ });
2802
+ proc.once?.("exit", (code, signal) => {
2803
+ void settleBackgroundProcessExit(runId, code, signal, resolvedDeps).catch((error) => {
2804
+ input.output?.write(`[nolo] background exit settlement failed: ${error}
2805
+ `);
2806
+ });
2807
+ try {
2808
+ reservation.release("child_exit");
2809
+ } catch (error) {
2810
+ input.output?.write(`[nolo] reservation release failed: ${error}
2811
+ `);
2718
2812
  }
2719
- finalizeRunRecord(runId, { status: "failed", exitCode: 1, note: String(error) }, resolvedDeps);
2720
2813
  });
2721
2814
  const hostMemoryNotice = emitHostMemoryNotice(hostMemory, input.output);
2722
2815
  if (typeof proc.pid === "number") {
@@ -2871,10 +2964,15 @@ function transitionRunToTerminal(runId, update, deps = {}, options = {}) {
2871
2964
  if (!record2) return { kind: "not_found" };
2872
2965
  const orphanCorrection = options.allowOverOrphaned === true && record2.status === "orphaned" && (update.status === "done" || update.status === "failed");
2873
2966
  if (isAgentRunTerminalStatus(record2.status) && !orphanCorrection) {
2967
+ if (update.processExit) {
2968
+ record2.processExit = update.processExit;
2969
+ writeRunRecord(record2, deps);
2970
+ }
2874
2971
  return { kind: "kept", record: record2 };
2875
2972
  }
2876
2973
  const now = deps.now ?? (() => /* @__PURE__ */ new Date());
2877
2974
  record2.status = update.status;
2975
+ if (update.processExit) record2.processExit = update.processExit;
2878
2976
  if (typeof update.exitCode === "number") record2.exitCode = update.exitCode;
2879
2977
  if (update.dialogId) record2.dialogId = update.dialogId;
2880
2978
  if (typeof update.credits === "number" && Number.isFinite(update.credits)) {
@@ -2928,7 +3026,7 @@ function transitionRunToTerminal(runId, update, deps = {}, options = {}) {
2928
3026
  };
2929
3027
  record2.resultArtifacts = [...(record2.resultArtifacts ?? []).filter((a) => a.path !== path), artifact];
2930
3028
  };
2931
- if (typeof update.lastAssistantText === "string" && update.lastAssistantText || update.acceptance?.checks.observations?.length) {
3029
+ if (typeof update.lastAssistantText === "string" && update.lastAssistantText || update.acceptance?.checks.observations?.length || update.failureReason === "startup_failed" || update.failureReason === "runtime_protocol_mismatch" || update.failureReason === "runtime_version_mismatch") {
2932
3030
  try {
2933
3031
  const fs = deps.fs ?? nodeFs2;
2934
3032
  const resultFile = join2(resolveRunsDir(deps.env, deps.homedir), `${runId}.result.md`);
@@ -3678,6 +3776,7 @@ export {
3678
3776
  readRunRecord,
3679
3777
  backfillRunRecordParentDialog,
3680
3778
  listRunRecords,
3779
+ listRunRecordsAsync,
3681
3780
  findRunRecordByPid,
3682
3781
  findRunRecord,
3683
3782
  DEFAULT_LIST_LIMIT,
@@ -3695,6 +3794,8 @@ export {
3695
3794
  awaitLocalWriterChild,
3696
3795
  resolveLocalContinuation,
3697
3796
  registerLocalForegroundWriter,
3797
+ recordRunStartup,
3798
+ settleBackgroundProcessExit,
3698
3799
  spawnLocalBackgroundRun,
3699
3800
  ackRunRecord,
3700
3801
  DEFAULT_ACK_LEASE_TTL_MS,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildSkillDocMarkdown
3
- } from "./chunk-AETZ7AD6.js";
3
+ } from "./chunk-W6RFEDN4.js";
4
4
 
5
5
  // packages/cli/docPageHelpers.ts
6
6
  import { readFileSync } from "node:fs";
@@ -79,14 +79,17 @@ function mergeWindow(into, win) {
79
79
  existing.source = win.source;
80
80
  }
81
81
  function parseQuotaWindowScope(scope) {
82
- const matched = /^(gemini|3p)-(.+)$/.exec(scope);
82
+ const matched = /^(gemini|3p|hydrogen|argon)-(.+)$/.exec(scope);
83
83
  return matched ? { family: matched[1], period: matched[2] } : { period: scope };
84
84
  }
85
85
  function resolveQuotaWindowFamily(model) {
86
86
  if (typeof model !== "string" || !model.trim()) return void 0;
87
+ if (/(?:^|[/-])gemini-[^/]*hydrogen(?:-|$)/i.test(model)) return "hydrogen";
88
+ if (/(?:^|[/-])gemini-[^/]*argon(?:-|$)/i.test(model)) return "argon";
87
89
  return /gemini/i.test(model) ? "gemini" : "3p";
88
90
  }
89
- function isQuotaWindowRelevantToFamily(scope, family) {
91
+ function isQuotaWindowRelevantToFamily(scope, family, source) {
92
+ if (scope === "gemini-5h" && source?.endsWith(":fetchAvailableModels")) return false;
90
93
  if (typeof scope !== "string") return true;
91
94
  const scopeFamily = parseQuotaWindowScope(scope).family;
92
95
  return scopeFamily === void 0 || family === void 0 || scopeFamily === family;
@@ -95,7 +98,7 @@ function selectQuotaWindowsForModel(quota, now, model) {
95
98
  if (!quota || !Array.isArray(quota.windows)) return [];
96
99
  const family = resolveQuotaWindowFamily(model);
97
100
  return quota.windows.filter(
98
- (window) => !isQuotaWindowExpired(window, now) && isQuotaWindowRelevantToFamily(window?.scope, family)
101
+ (window) => !isQuotaWindowExpired(window, now) && isQuotaWindowRelevantToFamily(window?.scope, family, window?.source)
99
102
  );
100
103
  }
101
104
  function isQuotaWindowExpired(window, now) {
@@ -373,7 +376,7 @@ function shouldClearCooldownFromQuota(entry, quota, now, options) {
373
376
  if (!quota || !(quota.observedAt > entry.markedAt)) return false;
374
377
  const family = resolveQuotaWindowFamily(options?.model);
375
378
  const relevantWindows = quota.windows.filter(
376
- (window) => isQuotaWindowRelevantToFamily(window.scope, family)
379
+ (window) => isQuotaWindowRelevantToFamily(window.scope, family, window.source)
377
380
  );
378
381
  const subscriptionWindows = relevantWindows.filter(isSubscriptionPeriodWindow);
379
382
  if (subscriptionWindows.length === 0) return false;
@@ -409,7 +412,7 @@ function resolveAgentAvailability(agent, now = Date.now()) {
409
412
  const hasObservedAt = Boolean(quota) && typeof quota?.observedAt === "number" && Number.isFinite(quota.observedAt);
410
413
  const family = resolveQuotaWindowFamily(agent?.model);
411
414
  const relevantWindows = (quota?.windows ?? []).filter(
412
- (window) => isQuotaWindowRelevantToFamily(window?.scope, family)
415
+ (window) => isQuotaWindowRelevantToFamily(window?.scope, family, window?.source)
413
416
  );
414
417
  const hasWindows = relevantWindows.length > 0;
415
418
  const hasValidQuota = isAdmissible && hasWindows;
@@ -647,6 +650,7 @@ function resolveCredentialCandidateKeys(key) {
647
650
  if (!key) return [];
648
651
  const trimmed = key.trim();
649
652
  if (!trimmed) return [];
653
+ if (/\|quota:(?:gemini|3p|hydrogen|argon)$/.test(trimmed)) return [trimmed];
650
654
  const candidates = [trimmed];
651
655
  const atIndex = trimmed.lastIndexOf("@");
652
656
  if (atIndex > 0) {
@@ -677,7 +681,21 @@ function resolveCredentialKey(agent) {
677
681
  function resolveCredentialKeyWithFallback(agent) {
678
682
  if (isPublicOrSystemAgentRecord(agent)) return void 0;
679
683
  const byRef = resolveCredentialKey(agent);
680
- if (byRef) return byRef;
684
+ if (byRef) {
685
+ const ref = byRef.split("@")[0]?.trim().toLowerCase();
686
+ const provider = agent?.provider;
687
+ let cloudCode = false;
688
+ try {
689
+ const host = new URL(String(agent?.customProviderUrl ?? "")).hostname;
690
+ cloudCode = /^(?:daily-|daily-sandbox-)?cloudcode-pa\.googleapis\.com$/.test(host);
691
+ } catch {
692
+ }
693
+ if (ref === "antigravity" || ref === "gemini" || provider === "google-antigravity" || cloudCode) {
694
+ const family = resolveQuotaWindowFamily(typeof agent?.model === "string" ? agent.model : void 0);
695
+ if (family) return `${byRef}|quota:${family}`;
696
+ }
697
+ return byRef;
698
+ }
681
699
  if (!agent || typeof agent !== "object") return void 0;
682
700
  const endpoint = agent.customProviderUrl;
683
701
  if (typeof endpoint === "string") {
@@ -3,13 +3,10 @@ import {
3
3
  } from "./chunk-5ZUL4CUO.js";
4
4
  import {
5
5
  getModelContextWindow
6
- } from "./chunk-T2BEPTAG.js";
6
+ } from "./chunk-L32W3PRP.js";
7
7
  import {
8
8
  BUILTIN_NOLO_AGENT_KEY
9
9
  } from "./chunk-ILHQ2AXT.js";
10
- import {
11
- isRecord
12
- } from "./chunk-KUG52IAP.js";
13
10
  import {
14
11
  isPageKey,
15
12
  isTableMetaKey
@@ -20,6 +17,9 @@ import {
20
17
  import {
21
18
  asTrimmedString
22
19
  } from "./chunk-3EUW3WEO.js";
20
+ import {
21
+ isRecord
22
+ } from "./chunk-KUG52IAP.js";
23
23
  import {
24
24
  asOptionalTrimmedString
25
25
  } from "./chunk-G3SUCT4W.js";
@@ -493,13 +493,6 @@ function resolveTruncatedReasoningTailLog(reason, reasoning_content) {
493
493
  }
494
494
 
495
495
  export {
496
- DEFAULT_AUTO_EXECUTION_PROFILE,
497
- resolveAutoExecutionProfile,
498
- ATTACHMENT_PART_TYPE,
499
- ATTACHMENT_PART_VERSION,
500
- normalizeAttachmentPart,
501
- attachmentKind,
502
- describeAttachmentForModel,
503
496
  isCodexOAuthAgent,
504
497
  resolveCodexOAuthEffectiveModel,
505
498
  CODEX_OAUTH_CATALOG_TTL_MS,
@@ -511,6 +504,13 @@ export {
511
504
  codexOAuthCatalogWindow,
512
505
  devinChannelContextWindow,
513
506
  resolveAgentContextWindow,
507
+ DEFAULT_AUTO_EXECUTION_PROFILE,
508
+ resolveAutoExecutionProfile,
509
+ ATTACHMENT_PART_TYPE,
510
+ ATTACHMENT_PART_VERSION,
511
+ normalizeAttachmentPart,
512
+ attachmentKind,
513
+ describeAttachmentForModel,
514
514
  asOptionalJsonRecord,
515
515
  extractReferenceKeysFromMessage,
516
516
  EMPTY_ASSISTANT_REPAIR_PROMPT,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  describeAttachmentForModel
3
- } from "./chunk-YQETUZ5V.js";
3
+ } from "./chunk-QRGDJA4B.js";
4
4
 
5
5
  // packages/ai/attachments/projectUserPart.ts
6
6
  var isRecord = (value) => typeof value === "object" && value !== null;
@@ -12,7 +12,7 @@ import {
12
12
  import {
13
13
  getAllServers,
14
14
  getIsDesktopApp
15
- } from "./chunk-AGP3YSEC.js";
15
+ } from "./chunk-4N6G2CKP.js";
16
16
  import {
17
17
  selectIdentityToken,
18
18
  selectIdentityUser,
@@ -22,27 +22,27 @@ import {
22
22
  isTombstoneRecord
23
23
  } from "./chunk-BV3FLP2L.js";
24
24
  import {
25
- isRecord
26
- } from "./chunk-KUG52IAP.js";
25
+ asOptionalPositiveFiniteNumber
26
+ } from "./chunk-U6VC4MU4.js";
27
27
  import {
28
28
  SERVERS,
29
29
  normalizeKnownServerOrigin
30
30
  } from "./chunk-LCBAMY2M.js";
31
- import {
32
- isLocalServerUrl
33
- } from "./chunk-4SN6J65J.js";
34
- import {
35
- normalizeServerOrigin
36
- } from "./chunk-CF7PE763.js";
37
31
  import {
38
32
  asTrimmedString
39
33
  } from "./chunk-3EUW3WEO.js";
40
34
  import {
41
- asOptionalPositiveFiniteNumber
42
- } from "./chunk-U6VC4MU4.js";
35
+ isRecord
36
+ } from "./chunk-KUG52IAP.js";
43
37
  import {
44
38
  asOptionalTrimmedString
45
39
  } from "./chunk-G3SUCT4W.js";
40
+ import {
41
+ isLocalServerUrl
42
+ } from "./chunk-4SN6J65J.js";
43
+ import {
44
+ normalizeServerOrigin
45
+ } from "./chunk-CF7PE763.js";
46
46
 
47
47
  // packages/app/stateViews/runtime.ts
48
48
  var selectCurrentToken = (state) => {
@@ -7,10 +7,10 @@ import {
7
7
  } from "./chunk-ATNTHIZI.js";
8
8
 
9
9
  // packages/ai/agent/cliExecutor.ts
10
- import { exec, spawn as spawn2 } from "child_process";
10
+ import { execFile, spawn as spawn2 } from "child_process";
11
11
  import { randomUUID as randomUUID2 } from "node:crypto";
12
- import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
13
- import { isAbsolute, join, resolve } from "node:path";
12
+ import { existsSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
13
+ import { isAbsolute, join, relative, resolve } from "node:path";
14
14
  import { tmpdir } from "node:os";
15
15
  import { StringDecoder } from "node:string_decoder";
16
16
 
@@ -817,22 +817,24 @@ function executeCopilot(prompt, options) {
817
817
  } = options;
818
818
  return new Promise((resolve2, reject) => {
819
819
  const args = [
820
- "NO_COLOR=1",
821
- "gh copilot --",
822
- `-p ${JSON.stringify(prompt)}`,
820
+ "copilot",
821
+ "--",
822
+ "-p",
823
+ prompt,
823
824
  "--silent",
824
825
  "--disable-builtin-mcps",
825
- "--stream off",
826
+ "--stream",
827
+ "off",
826
828
  "--no-color"
827
829
  ];
828
- if (model) args.push(`--model ${model}`);
829
- if (reasoningEffort) args.push(`--reasoning-effort ${reasoningEffort}`);
830
+ if (model) args.push("--model", model);
831
+ if (reasoningEffort) args.push("--reasoning-effort", reasoningEffort);
830
832
  if (yolo) args.push("--yolo");
831
- const cmd = args.join(" ");
832
833
  const start = Date.now();
833
- exec(
834
- cmd,
835
- { timeout, cwd, env: buildCliProcessEnv(options.env) },
834
+ execFile(
835
+ "gh",
836
+ args,
837
+ { timeout, cwd, env: { ...buildCliProcessEnv(options.env), NO_COLOR: "1" } },
836
838
  (error, stdout, stderr) => {
837
839
  if (error) {
838
840
  if (error.killed && error.signal === "SIGTERM") {
@@ -888,6 +890,35 @@ function parseGeminiStreamJson(stdout) {
888
890
  }
889
891
  return parts.join("");
890
892
  }
893
+ function resolveGeminiCommand(env, platform = process.platform) {
894
+ if (platform !== "win32") return { command: "gemini", args: [] };
895
+ const path = Object.entries(env).find(([key]) => key.toLowerCase() === "path")?.[1] ?? "";
896
+ for (const directory of path.split(";")) {
897
+ if (!directory || !isAbsolute(directory)) continue;
898
+ if (existsSync(join(directory, "gemini.exe"))) {
899
+ return { command: join(directory, "gemini.exe"), args: [] };
900
+ }
901
+ if (!existsSync(join(directory, "gemini.cmd"))) continue;
902
+ try {
903
+ const root = realpathSync(join(directory, "node_modules", "@google", "gemini-cli"));
904
+ const manifest = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
905
+ const bin = typeof manifest.bin === "string" ? manifest.bin : manifest.bin?.gemini;
906
+ if (manifest.name !== "@google/gemini-cli" || typeof bin !== "string" || !bin) {
907
+ throw new Error("missing package bin");
908
+ }
909
+ const entry = realpathSync(resolve(root, bin));
910
+ const withinPackage = relative(root, entry);
911
+ if (withinPackage.startsWith("..") || isAbsolute(withinPackage) || !/\.[cm]?js$/i.test(entry)) {
912
+ throw new Error("package bin is not a contained JavaScript entry");
913
+ }
914
+ const node = join(directory, "node.exe");
915
+ return { command: existsSync(node) ? node : "node", args: [entry] };
916
+ } catch (error) {
917
+ throw new Error(`Gemini npm entry could not be resolved: ${String(error)}`);
918
+ }
919
+ }
920
+ return { command: "gemini", args: [] };
921
+ }
891
922
  function executeGemini(prompt, options) {
892
923
  const {
893
924
  model = "gemini-3.8-flash",
@@ -897,20 +928,22 @@ function executeGemini(prompt, options) {
897
928
  } = options;
898
929
  return new Promise((resolve2, reject) => {
899
930
  const args = [
900
- "NO_COLOR=1",
901
- "NODE_OPTIONS='--no-deprecation'",
902
- "gemini",
903
- `-p ${JSON.stringify(prompt)}`,
904
- "--output-format stream-json",
905
- `-m ${JSON.stringify(model)}`
931
+ "-p",
932
+ prompt,
933
+ "--output-format",
934
+ "stream-json",
935
+ "-m",
936
+ model
906
937
  ];
907
938
  if (yolo) args.push("--yolo");
908
- args.push("-e none");
909
- const cmd = args.join(" ");
939
+ args.push("-e", "none");
910
940
  const start = Date.now();
911
- exec(
912
- cmd,
913
- { timeout, cwd, env: buildCliProcessEnv(options.env) },
941
+ const env = { ...buildCliProcessEnv(options.env), NO_COLOR: "1", NODE_OPTIONS: "--no-deprecation" };
942
+ const launcher = resolveGeminiCommand(env);
943
+ execFile(
944
+ launcher.command,
945
+ [...launcher.args, ...args],
946
+ { timeout, cwd, env },
914
947
  (error, stdout, stderr) => {
915
948
  if (error) {
916
949
  if (error.killed && error.signal === "SIGTERM") {
@@ -2173,6 +2206,7 @@ export {
2173
2206
  isBufferedCliStreamingProvider,
2174
2207
  CLI_PROBE_BINARIES,
2175
2208
  materializeCliImageInputs,
2209
+ resolveGeminiCommand,
2176
2210
  executeCli,
2177
2211
  startCliSession,
2178
2212
  getCliSession,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  WORKFLOW_GUIDANCE_SKILL_SLUGS
3
- } from "./chunk-KRRE4A7D.js";
3
+ } from "./chunk-G7IUT2V3.js";
4
4
  import {
5
5
  noloAgentId
6
6
  } from "./chunk-EVGU5P4U.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  selectCurrentServer
3
- } from "./chunk-VREDDN25.js";
3
+ } from "./chunk-ATEKLSLR.js";
4
4
  import {
5
5
  patch
6
- } from "./chunk-SFTTXGPM.js";
6
+ } from "./chunk-CMMI3DAT.js";
7
7
  import {
8
8
  getIsDesktopApp
9
- } from "./chunk-AGP3YSEC.js";
9
+ } from "./chunk-4N6G2CKP.js";
10
10
  import {
11
11
  selectIdentityToken
12
12
  } from "./chunk-PXYBUFDB.js";