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,45 +1,28 @@
1
1
  import {
2
2
  BROWSER_SHELL_BRIDGE_ENV
3
3
  } from "./chunk-2YGBI2XB.js";
4
- import {
5
- defaultLoopbackRequest
6
- } from "./chunk-VP3BINY7.js";
7
- import {
8
- clearCredentialAvailability,
9
- markCredentialUnavailable,
10
- readCredentialEntry
11
- } from "./chunk-FIYSMXHY.js";
12
- import {
13
- CREDENTIAL_STORE_SESSION_FALLBACK_WARNING,
14
- OAUTH_PROVIDER_REFS,
15
- getSharedSessionCredentialBroker
16
- } from "./chunk-5LQDHFBN.js";
17
- import {
18
- customNativeAuthHeaders,
19
- detectDeclaredCustomNativeWire,
20
- isCallerCancellation,
21
- resolveCustomNativeApiKeyHeader,
22
- resolveCustomNativeEndpoint
23
- } from "./chunk-WOAZVUSN.js";
24
4
  import {
25
5
  adoptRequiredClaudeCodeVersion,
26
6
  anthropicRefresh,
27
7
  cursorRefresh,
8
+ fetchAntigravityAvailableModels,
28
9
  getClaudeCodeUserAgent,
29
10
  refreshAntigravityOAuthToken,
30
11
  refreshOpenAiCodexToken,
31
12
  resolveClaudeCodeVersion,
32
13
  resolveServerSyncConfig,
33
14
  xaiRefresh
34
- } from "./chunk-HYKGIXNO.js";
15
+ } from "./chunk-XSW4EXQV.js";
35
16
  import {
36
- isCursorOAuthAgent
37
- } from "./chunk-VIWDGTDA.js";
17
+ clearCredentialAvailability,
18
+ markCredentialUnavailable,
19
+ readCredentialEntry
20
+ } from "./chunk-WWTSEBDF.js";
38
21
  import {
39
22
  DialogNotifyError,
40
23
  deliverDialogNotification,
41
24
  sha256Hex
42
- } from "./chunk-M3Y4IBIR.js";
25
+ } from "./chunk-M4SFKP5L.js";
43
26
  import {
44
27
  SANDBOX_HELPER_PATH,
45
28
  SANDBOX_OUTPUT_LIMITS,
@@ -56,30 +39,40 @@ import {
56
39
  validateChromeConnectorPayload
57
40
  } from "./chunk-UAIHKQIA.js";
58
41
  import {
59
- extractLastUserText,
60
- localTurnHasSubjectRefs,
61
- resolveLocalUserId,
62
- withResolvedRuntimeToolSurface
63
- } from "./chunk-T5N6NHAT.js";
42
+ customNativeAuthHeaders,
43
+ detectDeclaredCustomNativeWire,
44
+ isCallerCancellation,
45
+ resolveCustomNativeApiKeyHeader,
46
+ resolveCustomNativeEndpoint
47
+ } from "./chunk-WOAZVUSN.js";
64
48
  import {
65
49
  createTuiSummaryLlmCaller
66
- } from "./chunk-SRG5CNLC.js";
50
+ } from "./chunk-TSPMLCWI.js";
67
51
  import {
68
52
  CliProviderQuotaError,
69
53
  executeCli,
70
54
  executeCliStreaming
71
- } from "./chunk-MK2Q7ZJD.js";
55
+ } from "./chunk-R7XWZDOH.js";
56
+ import {
57
+ isCursorOAuthAgent
58
+ } from "./chunk-VIWDGTDA.js";
72
59
  import {
73
60
  buildCliPrompt
74
61
  } from "./chunk-ATNTHIZI.js";
62
+ import {
63
+ extractLastUserText,
64
+ localTurnHasSubjectRefs,
65
+ resolveLocalUserId,
66
+ withResolvedRuntimeToolSurface
67
+ } from "./chunk-HHFGE2WF.js";
75
68
  import {
76
69
  inferCaptureIntent,
77
70
  resolveUserSkillRuntime
78
- } from "./chunk-PXKF5CV4.js";
71
+ } from "./chunk-ZXF6D3I6.js";
79
72
  import {
80
73
  inlineImageUrlsForCustomProvider,
81
74
  prepareTools
82
- } from "./chunk-2SKTCNWO.js";
75
+ } from "./chunk-OTKSESZR.js";
83
76
  import {
84
77
  getServerProviderSecret
85
78
  } from "./chunk-HS7MLR74.js";
@@ -102,24 +95,20 @@ import {
102
95
  resolveCliLocalSpawnDispatch,
103
96
  resolveRunContextFacts,
104
97
  resolveStartAgentRunCwd
105
- } from "./chunk-LXTC53TN.js";
106
- import {
107
- fetchWithTransientRetry,
108
- isTransientFetchError
109
- } from "./chunk-KFHREHUQ.js";
98
+ } from "./chunk-GAYNXB6T.js";
110
99
  import {
111
100
  deriveCredentialGroup,
112
101
  deriveCustomProviderCredentialGroup
113
- } from "./chunk-F5AY2UZL.js";
102
+ } from "./chunk-RRDRQOEC.js";
114
103
  import {
115
104
  normalizeEnabledPromptSkills,
116
105
  resolveUserEnabledSkills
117
- } from "./chunk-GUVXQSFZ.js";
106
+ } from "./chunk-RBPUNSG5.js";
118
107
  import {
119
108
  prepareTokenUsageData,
120
109
  runKeyed,
121
110
  validateAskChoiceInput
122
- } from "./chunk-PVAWNHP5.js";
111
+ } from "./chunk-7BCG67EI.js";
123
112
  import {
124
113
  applyTokenUsageToDayStats,
125
114
  require_format
@@ -130,7 +119,22 @@ import {
130
119
  } from "./chunk-523DITKR.js";
131
120
  import {
132
121
  fetchServerSyncedCredential
133
- } from "./chunk-ABGULE7H.js";
122
+ } from "./chunk-WCFFRBL5.js";
123
+ import {
124
+ defaultLoopbackRequest
125
+ } from "./chunk-VP3BINY7.js";
126
+ import {
127
+ CREDENTIAL_STORE_SESSION_FALLBACK_WARNING,
128
+ OAUTH_PROVIDER_REFS,
129
+ getSharedSessionCredentialBroker
130
+ } from "./chunk-TQEKUOTI.js";
131
+ import {
132
+ fetchWithTransientRetry,
133
+ isTransientFetchError
134
+ } from "./chunk-DXWGFL2Z.js";
135
+ import {
136
+ getDefaultCliLocalRuntimeDb
137
+ } from "./chunk-N5Z2V73W.js";
134
138
  import {
135
139
  _readQueueEntriesLocked,
136
140
  ackRunRecord,
@@ -155,12 +159,12 @@ import {
155
159
  terminateRunProcess,
156
160
  transitionRunToTerminal,
157
161
  withQueueLock
158
- } from "./chunk-XIEYGCN6.js";
162
+ } from "./chunk-OWKNSIXL.js";
159
163
  import {
160
164
  remoteDialogSyncTimeout,
161
165
  resolveRuntimeAuthToken,
162
166
  resolveRuntimeServerUrl
163
- } from "./chunk-UN7HIYMH.js";
167
+ } from "./chunk-2X7WFDT6.js";
164
168
  import {
165
169
  TASK_PREVIEW_MAX,
166
170
  formatControlRunMessageCard,
@@ -177,10 +181,7 @@ import {
177
181
  resolveAgentRunName,
178
182
  resolveRunLabel,
179
183
  shortRunId
180
- } from "./chunk-AXYH4734.js";
181
- import {
182
- getDefaultCliLocalRuntimeDb
183
- } from "./chunk-N5Z2V73W.js";
184
+ } from "./chunk-OOJNQK6V.js";
184
185
  import {
185
186
  isTombstoneRecord
186
187
  } from "./chunk-BV3FLP2L.js";
@@ -189,7 +190,7 @@ import {
189
190
  readDialogMessageRecords,
190
191
  readDialogMessages,
191
192
  resolveBuiltinLocalCliAgentConfig
192
- } from "./chunk-KMRKZNGT.js";
193
+ } from "./chunk-TCZ2VJZQ.js";
193
194
  import {
194
195
  LOCAL_CODEX_AGENT_KEY,
195
196
  isLocalCliAgentKey,
@@ -231,6 +232,7 @@ import {
231
232
  isLineRangeCovered,
232
233
  isStableSessionIdentityEnabled,
233
234
  normalizeLocalToolName,
235
+ orderDialogHistory,
234
236
  parseSyncServersEnv,
235
237
  projectToolExecutionLocation,
236
238
  readDevinUpstreamFailure,
@@ -244,7 +246,7 @@ import {
244
246
  runExecShellGates,
245
247
  validateConfiguredRootExecutionLease,
246
248
  verifyOwnerRouteAck
247
- } from "./chunk-CVERLOJM.js";
249
+ } from "./chunk-3QIYD3VM.js";
248
250
  import {
249
251
  accumulateGeminiChunks,
250
252
  buildGeminiGenerateContentRequest,
@@ -256,7 +258,10 @@ import {
256
258
  resolveAntigravityFinishReason,
257
259
  resolveGeminiModelQuirks,
258
260
  shouldUseGeminiNativeToolRoute
259
- } from "./chunk-YPPKC6FL.js";
261
+ } from "./chunk-U2HBB7RS.js";
262
+ import {
263
+ readLocalImage
264
+ } from "./chunk-AL3TYDIF.js";
260
265
  import {
261
266
  PlatformStreamInterruptedError,
262
267
  buildPlatformChatCompletionRequest,
@@ -268,54 +273,62 @@ import {
268
273
  readPlatformChatSseCompletion,
269
274
  resolvePlatformChatProviderConfig,
270
275
  shouldUsePlatformChatProvider
271
- } from "./chunk-IX2BXN2K.js";
276
+ } from "./chunk-HSSBDZLD.js";
272
277
  import {
273
278
  readSseDataValues,
274
279
  readSseFrames
275
280
  } from "./chunk-HNUWUO75.js";
276
281
  import {
277
- resolveHistoricalToolContentCap
278
- } from "./chunk-2WZXXAQD.js";
282
+ resolveAgentImageInputSupport,
283
+ resolveCatalogImageSupport,
284
+ resolveToolImagePolicy,
285
+ withLiveImageSupport
286
+ } from "./chunk-DUUDXSLX.js";
279
287
  import {
280
- resolveToolImagePolicy
281
- } from "./chunk-3HTP4WZQ.js";
288
+ collectStablePromptPrefix,
289
+ convertMessagesToResponsesInput,
290
+ findAgentStatePairingIssues,
291
+ stablePromptCacheKey,
292
+ toResponsesTools
293
+ } from "./chunk-EEOOBRA7.js";
294
+ import {
295
+ EMPTY_TOOL_RESULT_TEXT,
296
+ MAX_TOOL_IMAGES_PER_REQUEST,
297
+ MAX_TOOL_IMAGE_BASE64_BYTES_PER_REQUEST,
298
+ createToolImageBudget,
299
+ hadToolImages,
300
+ toolImageNotices,
301
+ toolImageOmission,
302
+ toolImageSource,
303
+ toolImages
304
+ } from "./chunk-X4O7FJF5.js";
282
305
  import {
283
306
  assertDispatchSelectionAdmission,
284
307
  buildNoloWorkspaceOpenAiTools,
285
308
  filterClientNoloWorkspaceToolNames,
286
309
  parseNoloWorkspaceToolArguments
287
- } from "./chunk-YOT437BH.js";
310
+ } from "./chunk-MNEZUL5S.js";
288
311
  import {
289
312
  extractQuotaSnapshot,
290
313
  isCapacitySaturatedRateLimit,
291
314
  mergeAvailabilityDeadline,
292
315
  resolveAvailabilityAction,
293
316
  resolveCredentialKeyWithFallback
294
- } from "./chunk-HOCHUZQ7.js";
317
+ } from "./chunk-QJTZ76CP.js";
295
318
  import {
296
319
  HIGH_RISK_MUTATION_TOOL_NAMES,
297
320
  resolveRequestToolSurface
298
- } from "./chunk-IC2I373Q.js";
321
+ } from "./chunk-VS276URX.js";
299
322
  import {
300
- collectStablePromptPrefix,
301
- convertMessagesToResponsesInput,
302
- findAgentStatePairingIssues,
303
- stablePromptCacheKey,
304
- toResponsesTools
305
- } from "./chunk-TOKPHZ55.js";
323
+ resolveAgentCallPlan
324
+ } from "./chunk-OBIC6EG7.js";
306
325
  import {
307
- EMPTY_TOOL_RESULT_TEXT,
308
- createToolImageBudget,
309
- hadToolImages,
310
- toolImageNotices,
311
- toolImageOmission,
312
- toolImageSource,
313
- toolImages
314
- } from "./chunk-E2BESSAW.js";
326
+ resolveHistoricalToolContentCap
327
+ } from "./chunk-WFGNWWJI.js";
315
328
  import {
316
329
  resolveAgentRequiredPackIds,
317
330
  resolveAgentSkillConfig
318
- } from "./chunk-X2KRQP7V.js";
331
+ } from "./chunk-FJSNBZXR.js";
319
332
  import {
320
333
  buildDialogFallbackTitleFromUserInput,
321
334
  normalizeDialogTitle
@@ -329,13 +342,13 @@ import {
329
342
  isCodexOAuthAgent,
330
343
  markCodexOAuthCatalogFailure,
331
344
  resolveCodexOAuthEffectiveModel
332
- } from "./chunk-YQETUZ5V.js";
345
+ } from "./chunk-QRGDJA4B.js";
333
346
  import {
334
347
  isDevinOAuthAgent
335
348
  } from "./chunk-5ZUL4CUO.js";
336
349
  import {
337
350
  normalizeUsage
338
- } from "./chunk-T2BEPTAG.js";
351
+ } from "./chunk-L32W3PRP.js";
339
352
  import {
340
353
  createProviderCallTimingTracker,
341
354
  finalizeProviderCallTiming,
@@ -353,7 +366,7 @@ import {
353
366
  resolveCurrentRunRuntimeToolPolicy,
354
367
  resolveLocalWorkspaceExecutorOptionsFromPolicy,
355
368
  resolveRequestedRuntimeToolNames
356
- } from "./chunk-SSGTV4FC.js";
369
+ } from "./chunk-USGHJSGO.js";
357
370
  import {
358
371
  asRecordOrEmpty
359
372
  } from "./chunk-KX6YBIHG.js";
@@ -365,20 +378,16 @@ import {
365
378
  } from "./chunk-DWLEOOGR.js";
366
379
  import {
367
380
  withShellChildEnvironment
368
- } from "./chunk-HVUDBOQG.js";
381
+ } from "./chunk-VMJVAJ6W.js";
369
382
  import {
370
383
  estimateTokenCount
371
384
  } from "./chunk-PSCNXBYA.js";
372
385
  import {
373
- isAntigravityOAuthAgent
374
- } from "./chunk-VPAZ6BEN.js";
375
- import {
376
- buildProviderSessionHeaders,
377
- resolvePlatformAuthToken
378
- } from "./chunk-6EDAMVG6.js";
379
- import {
380
- toErrorMessage
381
- } from "./chunk-HNMXYYJR.js";
386
+ createOAuthTokenStore,
387
+ isTokenExpired,
388
+ readOAuthCredential,
389
+ resolveFreshAccessToken
390
+ } from "./chunk-G7Y4GXTY.js";
382
391
  import {
383
392
  FORCED_TOOLS,
384
393
  addDefaultLightWebToolsForConfiguredAgents,
@@ -390,85 +399,111 @@ import {
390
399
  expandEnabledPacks,
391
400
  resolveBuiltinSkillEntry,
392
401
  resolveEffectiveEnabledPacks
393
- } from "./chunk-KRRE4A7D.js";
402
+ } from "./chunk-G7IUT2V3.js";
394
403
  import {
395
404
  CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES,
396
405
  canonicalizeChromeConnectorToolNames,
397
406
  canonicalizeToolNames
398
407
  } from "./chunk-6OVNSQHN.js";
399
408
  import {
400
- anthropicOAuthModelMaxOutputTokens,
401
- findModelConfig,
402
- isAdaptiveThinkingModelId
403
- } from "./chunk-KYH7XW3K.js";
409
+ createTokenDialogIndexKey,
410
+ createTokenKey,
411
+ createTokenStatsKey,
412
+ createUserKey
413
+ } from "./chunk-SYTHYBMI.js";
404
414
  import {
405
- CLI_PROVIDER_VALUES,
406
- isCliProvider
407
- } from "./chunk-JRTNUU5Z.js";
415
+ dialogMessageKey
416
+ } from "./chunk-OJKUU3LP.js";
408
417
  import {
409
- isRecord
410
- } from "./chunk-KUG52IAP.js";
418
+ dialogIdFromKey
419
+ } from "./chunk-YZMNK53S.js";
411
420
  import {
412
- asTrimmedLowercaseString
413
- } from "./chunk-QSJ3HFEF.js";
421
+ asOptionalPositiveFiniteNumber
422
+ } from "./chunk-U6VC4MU4.js";
414
423
  import {
415
424
  classifyDialogSyncFailure,
416
425
  getLogger,
417
426
  startOwnedDialogSync
418
- } from "./chunk-YGMBIXCF.js";
427
+ } from "./chunk-6XRPBZRS.js";
419
428
  import {
429
+ getHostRuntimeExecutable,
420
430
  isCompiledBinary,
421
431
  parseUserIdFromAuthToken,
422
432
  resolveAuthToken,
423
433
  resolveServerUrl
424
- } from "./chunk-WACI5I6V.js";
434
+ } from "./chunk-BIDSIRTS.js";
425
435
  import {
426
436
  DEFAULT_NOLO_SERVER_URL
427
437
  } from "./chunk-OLZBQWZU.js";
428
438
  import {
429
439
  NOLO_CLUSTER_SERVERS
430
440
  } from "./chunk-LCBAMY2M.js";
431
- import {
432
- isLoopbackUrl
433
- } from "./chunk-4SN6J65J.js";
434
- import {
435
- normalizeServerOrigin
436
- } from "./chunk-CF7PE763.js";
437
441
  import {
438
442
  agentRunCardLabels,
439
443
  t
440
- } from "./chunk-OB6DVWPF.js";
444
+ } from "./chunk-262R3XNN.js";
441
445
  import {
442
- createOAuthTokenStore,
443
- isTokenExpired,
444
- readOAuthCredential,
445
- resolveFreshAccessToken
446
- } from "./chunk-G7Y4GXTY.js";
447
- import {
448
- createTokenDialogIndexKey,
449
- createTokenKey,
450
- createTokenStatsKey,
451
- createUserKey
452
- } from "./chunk-SYTHYBMI.js";
446
+ isAntigravityOAuthAgent
447
+ } from "./chunk-7JGMNKKG.js";
453
448
  import {
454
- dialogMessageKey
455
- } from "./chunk-OJKUU3LP.js";
449
+ buildProviderSessionHeaders,
450
+ resolvePlatformAuthToken
451
+ } from "./chunk-RTHFJZ6M.js";
456
452
  import {
457
- dialogIdFromKey
458
- } from "./chunk-YZMNK53S.js";
453
+ toErrorMessage
454
+ } from "./chunk-HNMXYYJR.js";
459
455
  import {
460
456
  asTrimmedString
461
457
  } from "./chunk-3EUW3WEO.js";
462
458
  import {
463
- asOptionalPositiveFiniteNumber
464
- } from "./chunk-U6VC4MU4.js";
459
+ anthropicOAuthModelMaxOutputTokens,
460
+ findModelConfig,
461
+ isAdaptiveThinkingModelId
462
+ } from "./chunk-CD3RU7XL.js";
463
+ import {
464
+ CLI_PROVIDER_VALUES,
465
+ isCliProvider
466
+ } from "./chunk-JRTNUU5Z.js";
467
+ import {
468
+ isRecord
469
+ } from "./chunk-KUG52IAP.js";
465
470
  import {
466
471
  asOptionalTrimmedString
467
472
  } from "./chunk-G3SUCT4W.js";
473
+ import {
474
+ isLoopbackUrl
475
+ } from "./chunk-4SN6J65J.js";
476
+ import {
477
+ normalizeServerOrigin
478
+ } from "./chunk-CF7PE763.js";
479
+ import {
480
+ asTrimmedLowercaseString
481
+ } from "./chunk-QSJ3HFEF.js";
468
482
  import {
469
483
  __toESM
470
484
  } from "./chunk-U67V476Y.js";
471
485
 
486
+ // packages/cli/client/liveImageSupport.ts
487
+ function createLiveImageSupportResolver(userId, discover, timeoutMs = 5e3) {
488
+ let discovery;
489
+ return async (config) => {
490
+ if (resolveCatalogImageSupport(config) !== void 0) return config;
491
+ const plan = resolveAgentCallPlan({ ...config, key: config.key ?? "" });
492
+ if (plan.authMethod.kind !== "oauth" || plan.authMethod.ref !== "antigravity") return config;
493
+ const raw = config.rawRecord ?? config;
494
+ const owner = typeof raw.userId === "string" && raw.userId.trim() ? raw.userId.trim() : typeof raw.ownerUserId === "string" ? raw.ownerUserId.trim() : void 0;
495
+ if (!userId || owner !== userId) return withLiveImageSupport(config, false);
496
+ discovery ??= new Promise((resolve7) => {
497
+ const timer = setTimeout(() => resolve7({}), timeoutMs);
498
+ Promise.resolve().then(discover).then(resolve7, () => resolve7({})).finally(() => clearTimeout(timer));
499
+ });
500
+ const models = await discovery;
501
+ const model = config.model?.trim() ?? "";
502
+ const entry = Object.hasOwn(models, model) ? models[model] : void 0;
503
+ return withLiveImageSupport(config, entry?.supportsImages === true && entry.disabled !== true);
504
+ };
505
+ }
506
+
472
507
  // packages/agent-runtime/anthropicMessagesProvider.ts
473
508
  import { randomUUID } from "node:crypto";
474
509
 
@@ -4326,9 +4361,14 @@ function resolveProviderResolveOverrides(agentConfig, options) {
4326
4361
  // packages/cli/client/localRuntimePaths.ts
4327
4362
  import { dirname, extname, join } from "node:path";
4328
4363
  import { fileURLToPath } from "node:url";
4364
+ import { existsSync, realpathSync } from "node:fs";
4329
4365
  function resolveLocalRuntimePaths(moduleUrl, compiled, execPath) {
4330
- if (compiled) return { cliDir: dirname(execPath), cliEntrypoint: execPath };
4331
- const modulePath = fileURLToPath(moduleUrl);
4366
+ if (compiled) {
4367
+ const entry = execPath === process.execPath ? getHostRuntimeExecutable() : realpathSync(execPath);
4368
+ return { cliDir: dirname(entry), cliEntrypoint: entry };
4369
+ }
4370
+ const path = fileURLToPath(moduleUrl);
4371
+ const modulePath = existsSync(path) ? realpathSync(path) : path;
4332
4372
  const extension = extname(modulePath) === ".js" ? ".js" : ".ts";
4333
4373
  const cliDir = extension === ".js" ? dirname(modulePath) : dirname(dirname(modulePath));
4334
4374
  return { cliDir, cliEntrypoint: join(cliDir, `index${extension}`) };
@@ -5024,13 +5064,68 @@ function mergeNoticeGroup(turns, noticeTasks, styleContent) {
5024
5064
  }
5025
5065
 
5026
5066
  // packages/cli/client/cliRemoteDialogSync.ts
5027
- function prepareRemoteDialogEvidenceRecord(key, value) {
5067
+ var RESERVED_AUTHORITY_FIELDS = [
5068
+ "userBatchOwner",
5069
+ "userBatchPhase",
5070
+ "userBatchReceipt",
5071
+ "acceptedUserBatchId"
5072
+ ];
5073
+ function hasReservedBatchAuthority(metadata) {
5074
+ if (!isRecord(metadata)) return false;
5075
+ return Object.keys(metadata).some((key) => RESERVED_AUTHORITY_FIELDS.some(
5076
+ (field) => key === field || key.startsWith(`${field}.`) || key === `metadata.${field}` || key.startsWith(`metadata.${field}.`)
5077
+ ));
5078
+ }
5079
+ function prepareRemoteDialogEvidenceRecord(key, value, options) {
5028
5080
  const record = isRecord(value) ? { ...value } : {};
5029
5081
  if (key.includes("-msg-") && typeof record.type !== "string") {
5030
5082
  record.type = "msg";
5031
5083
  }
5084
+ const metadata = record.metadata;
5085
+ if (key.includes("-msg-") && record.role === "user" && isRecord(metadata) && metadata.queueState === "accepted" && (metadata.cliBatchPhase === "requested" || metadata.cliBatchPhase === "completed" || typeof metadata.cliBatchId === "string" && metadata.cliBatchId.length > 0 || options?.isAcceptedBatchMember === true) && !hasReservedBatchAuthority(metadata)) {
5086
+ const { queueState: _localQueueState, ...evidenceMetadata } = metadata;
5087
+ record.metadata = evidenceMetadata;
5088
+ }
5032
5089
  return record;
5033
5090
  }
5091
+ async function collectAcceptedUserBatchMessageKeys(ops, localStore) {
5092
+ const memberKeys = /* @__PURE__ */ new Set();
5093
+ const collectReceipt = (op) => {
5094
+ if (op.type !== "put" || !op.key.includes("-msg-")) return;
5095
+ const record = op.value;
5096
+ if (!isRecord(record) || record.role !== "user" || !isRecord(record.metadata)) return;
5097
+ const metadata = record.metadata;
5098
+ if (metadata.cliBatchPhase !== "requested" && metadata.cliBatchPhase !== "completed") {
5099
+ return;
5100
+ }
5101
+ if (hasReservedBatchAuthority(record) || hasReservedBatchAuthority(metadata)) return;
5102
+ if (!Array.isArray(metadata.acceptedUserMessageIds)) return;
5103
+ const match = /^((?:dialog-[^]+?)-msg-)[^]+$/.exec(op.key);
5104
+ if (!match) return;
5105
+ const prefix = match[1];
5106
+ for (const memberId of metadata.acceptedUserMessageIds) {
5107
+ if (typeof memberId === "string" && memberId.length > 0) {
5108
+ memberKeys.add(`${prefix}${memberId}`);
5109
+ }
5110
+ }
5111
+ };
5112
+ for (const op of ops) collectReceipt(op);
5113
+ const prefixes = /* @__PURE__ */ new Set();
5114
+ for (const op of ops) {
5115
+ const record = op.value;
5116
+ if (op.type !== "put" || memberKeys.has(op.key) || record?.role !== "user" || record?.metadata?.queueState !== "accepted" || hasReservedBatchAuthority(record.metadata) || record.metadata.cliBatchPhase === "requested" || record.metadata.cliBatchPhase === "completed" || typeof record.metadata.cliBatchId === "string" && record.metadata.cliBatchId.length > 0) continue;
5117
+ const prefix = typeof record.dialogId === "string" ? `dialog-${record.dialogId}-msg-` : /^((?:dialog-[^]+?)-msg-)[^]+$/.exec(op.key)?.[1];
5118
+ if (prefix && op.key.startsWith(prefix)) prefixes.add(prefix);
5119
+ }
5120
+ if (localStore) {
5121
+ for (const prefix of prefixes) {
5122
+ for await (const [key, value] of localStore.iterator({ gte: prefix, lt: `${prefix}\uFFFF` })) {
5123
+ if (key.startsWith(prefix)) collectReceipt({ type: "put", key, value });
5124
+ }
5125
+ }
5126
+ }
5127
+ return memberKeys;
5128
+ }
5034
5129
  function normalizeRemoteSubjectRef(value) {
5035
5130
  if (!isRecord(value)) return null;
5036
5131
  const kind = asOptionalTrimmedString(value.kind);
@@ -5123,7 +5218,9 @@ async function postRemoteRecord(args) {
5123
5218
  body: JSON.stringify({
5124
5219
  customKey: args.key,
5125
5220
  userId: args.userId,
5126
- data: prepareRemoteDialogEvidenceRecord(args.key, args.data)
5221
+ data: prepareRemoteDialogEvidenceRecord(args.key, args.data, {
5222
+ isAcceptedBatchMember: args.isAcceptedBatchMember
5223
+ })
5127
5224
  }),
5128
5225
  signal: AbortSignal.timeout(remoteDialogSyncTimeout())
5129
5226
  },
@@ -5256,12 +5353,14 @@ async function syncLocalDialogEvidenceToRemote(args) {
5256
5353
  }
5257
5354
  }
5258
5355
  orderedOps.push(...nonMsgOps);
5356
+ const acceptedBatchKeys = await collectAcceptedUserBatchMessageKeys(orderedOps, args.localStore);
5259
5357
  await runThrottledBatches(
5260
5358
  orderedOps.filter((op) => op.type === "put"),
5261
5359
  (op) => postRemoteRecord({
5262
5360
  authToken,
5263
5361
  data: op.value,
5264
5362
  fetchImpl: args.fetchImpl,
5363
+ isAcceptedBatchMember: acceptedBatchKeys.has(op.key),
5265
5364
  key: op.key,
5266
5365
  serverUrl,
5267
5366
  userId: args.userId
@@ -5567,7 +5666,7 @@ function entriesToMessages(entries) {
5567
5666
  const message = dialogMessageRecordToAgentRuntimeMessage(entry.record);
5568
5667
  if (message) messages.push(message);
5569
5668
  }
5570
- return messages;
5669
+ return orderDialogHistory(messages);
5571
5670
  }
5572
5671
  async function persistIncompleteState(args) {
5573
5672
  const persisted = await writeCliDialogHistoryState({
@@ -5668,7 +5767,7 @@ function analyzeRemoteDialogRecords(args) {
5668
5767
  }
5669
5768
  entries.push({ key, messageId, record, message });
5670
5769
  }
5671
- const messages = entries.map((entry) => entry.message);
5770
+ const messages = orderDialogHistory(entries.map((entry) => entry.message));
5672
5771
  for (const detail of findAgentStatePairingIssues(messages)) {
5673
5772
  issues.push({ code: "tool-pairing", detail });
5674
5773
  }
@@ -6459,8 +6558,8 @@ function buildServerPlatformToolExecutors(args) {
6459
6558
  return null;
6460
6559
  }
6461
6560
  const remoteItems = Array.isArray(remote?.selectedItems) ? remote.selectedItems : [];
6462
- const [{ loadMemoryVNextCatalog }, { recallMemoryVNextLocal }] = await Promise.all([
6463
- import("./store-JRVN62NM.js"),
6561
+ const [{ loadMemoryVNextCatalog, getMemoryEvidenceVNextStrict }, { recallMemoryVNextLocal }] = await Promise.all([
6562
+ import("./store-Z53ICFL3.js"),
6464
6563
  import("./localRecall-BDYKXB46.js")
6465
6564
  ]);
6466
6565
  const catalog = await loadMemoryVNextCatalog(ctx.db, ctx.principal);
@@ -6471,8 +6570,11 @@ function buildServerPlatformToolExecutors(args) {
6471
6570
  });
6472
6571
  if (hits.length === 0) return null;
6473
6572
  const { mergeAndDedupUserData } = await import("./userDataMerge-HT2ZVHBJ.js");
6474
- const localItems = hits.map((hit) => {
6573
+ const localItems = await Promise.all(hits.map(async (hit) => {
6475
6574
  const value = hit.state.value ?? {};
6575
+ const evidence = (await Promise.all((hit.state.evidenceIds ?? []).map(
6576
+ (id) => getMemoryEvidenceVNextStrict(ctx.db, ctx.principal, id)
6577
+ ))).filter((item) => item != null && item.ownerId === ctx.principal);
6476
6578
  return {
6477
6579
  id: `vnext-state-${hit.state.id}`,
6478
6580
  ownerType: "user",
@@ -6486,10 +6588,13 @@ function buildServerPlatformToolExecutors(args) {
6486
6588
  lastActivatedAt: hit.state.createdAt,
6487
6589
  activationCount: 1,
6488
6590
  importance: typeof value.importance === "number" ? value.importance : 0.9,
6489
- confidence: typeof value.confidence === "number" ? value.confidence : 0.9,
6591
+ ...typeof value.confidence === "number" && Number.isFinite(value.confidence) ? { confidence: value.confidence } : {},
6592
+ ...typeof value.sourceKind === "string" ? { sourceKind: value.sourceKind } : {},
6593
+ ...typeof value.sourceDialogId === "string" ? { sourceDialogId: value.sourceDialogId } : {},
6594
+ evidence,
6490
6595
  sourceOrigin: "local"
6491
6596
  };
6492
- });
6597
+ }));
6493
6598
  const merged = mergeAndDedupUserData(localItems, [{ data: { data: remoteItems } }]);
6494
6599
  const hasNewLocal = merged.some((item) => item.sourceOrigin === "local");
6495
6600
  if (!hasNewLocal) return null;
@@ -6511,7 +6616,7 @@ function buildServerPlatformToolExecutors(args) {
6511
6616
  for (let i = ordered.length - 1; i >= 0; i -= 1) {
6512
6617
  if (isTombstoneRecord2(ordered[i])) ordered.splice(i, 1);
6513
6618
  }
6514
- const { buildMemoryOverlay, DEFAULT_MEMORY_OVERLAY_TOKEN_BUDGET } = await import("./overlay-THLKYIWY.js");
6619
+ const { buildMemoryOverlay, DEFAULT_MEMORY_OVERLAY_TOKEN_BUDGET } = await import("./overlay-BBQZXGYI.js");
6515
6620
  const promptBlock = buildMemoryOverlay(ordered, {
6516
6621
  maxTokens: DEFAULT_MEMORY_OVERLAY_TOKEN_BUDGET
6517
6622
  });
@@ -6521,7 +6626,7 @@ function buildServerPlatformToolExecutors(args) {
6521
6626
  const ctx = await localMemoryContext();
6522
6627
  if (!ctx) return false;
6523
6628
  const [{ putMemoryEntityVNext, putMemoryStateVNext, putMemoryEvidenceVNext }, { buildLegacyMemoryEvidence }] = await Promise.all([
6524
- import("./store-JRVN62NM.js"),
6629
+ import("./store-Z53ICFL3.js"),
6525
6630
  import("./legacyMigration-TF4SYJCZ.js")
6526
6631
  ]);
6527
6632
  const contentKey = `mem-${shortHash(
@@ -6574,7 +6679,7 @@ function buildServerPlatformToolExecutors(args) {
6574
6679
  const retireLocalMemory = async (filter) => {
6575
6680
  const ctx = await localMemoryContext();
6576
6681
  if (!ctx) return { retired: 0, localOnlyRetired: 0, skippedRemoteMiss: 0 };
6577
- const { loadMemoryVNextCatalog, retireMemoryStateVNext } = await import("./store-JRVN62NM.js");
6682
+ const { loadMemoryVNextCatalog, retireMemoryStateVNext } = await import("./store-Z53ICFL3.js");
6578
6683
  const catalog = await loadMemoryVNextCatalog(ctx.db, ctx.principal);
6579
6684
  if (catalog.states.length === 0) {
6580
6685
  return { retired: 0, localOnlyRetired: 0, skippedRemoteMiss: 0 };
@@ -6626,14 +6731,25 @@ function buildServerPlatformToolExecutors(args) {
6626
6731
  metadata: { serverPlatformTool: true, memoryRead: false }
6627
6732
  };
6628
6733
  }
6734
+ if (parsed.source !== void 0 && parsed.source !== "archive") {
6735
+ return { content: JSON.stringify({ error: "Invalid memory source" }), metadata: { serverPlatformTool: true, memoryRead: false } };
6736
+ }
6737
+ if (parsed.source === void 0 && (parsed.limit !== void 0 || parsed.cursor !== void 0)) {
6738
+ return { content: JSON.stringify({ error: "Pagination requires source archive" }), metadata: { serverPlatformTool: true, memoryRead: false } };
6739
+ }
6629
6740
  const body = { userInput: query };
6741
+ if (parsed.source === "archive") {
6742
+ body.source = parsed.source;
6743
+ if (parsed.limit !== void 0) body.limit = parsed.limit;
6744
+ if (parsed.cursor !== void 0) body.cursor = parsed.cursor;
6745
+ }
6630
6746
  if (args.agentKey) body.agentKey = args.agentKey;
6631
6747
  const raw = await postServer("/api/memory/query", body, {
6632
6748
  retryTransient: true
6633
6749
  });
6634
6750
  let content = raw;
6635
6751
  try {
6636
- const merged = await mergeLocalMemoryIntoQuery(query, raw);
6752
+ const merged = parsed.source === "archive" ? null : await mergeLocalMemoryIntoQuery(query, raw);
6637
6753
  if (merged) content = merged;
6638
6754
  } catch {
6639
6755
  }
@@ -6813,9 +6929,45 @@ function buildServerPlatformToolExecutors(args) {
6813
6929
  };
6814
6930
  }
6815
6931
 
6932
+ // packages/cli/client/childRunImages.ts
6933
+ import { isAbsolute } from "node:path";
6934
+ function validateChildImagePaths(value) {
6935
+ if (value === void 0) return [];
6936
+ if (!Array.isArray(value) || value.length < 1 || value.length > MAX_TOOL_IMAGES_PER_REQUEST || value.some((path) => typeof path !== "string" || !isAbsolute(path) || path.includes("\0"))) {
6937
+ throw new Error("image_input_invalid: expected 1\u20134 absolute local image paths");
6938
+ }
6939
+ return value;
6940
+ }
6941
+ async function validateChildImages(paths) {
6942
+ let total = 0;
6943
+ const urls = [];
6944
+ for (let index = 0; index < paths.length; index++) {
6945
+ try {
6946
+ const result = await readLocalImage(paths[index]);
6947
+ const image = result.images?.[0];
6948
+ if (!image) throw new Error();
6949
+ total += image.dataBase64.length;
6950
+ if (total > MAX_TOOL_IMAGE_BASE64_BYTES_PER_REQUEST) throw new Error();
6951
+ urls.push(`data:${image.mimeType};base64,${image.dataBase64}`);
6952
+ } catch (error) {
6953
+ const code = error?.code;
6954
+ const reason = code === "ENOENT" ? "not found" : code === "EACCES" || code === "EPERM" ? "not accessible" : "invalid type/content or exceeds image budget";
6955
+ throw new Error(`image_input_invalid: image ${index + 1} unreadable (${reason})`);
6956
+ }
6957
+ }
6958
+ return urls;
6959
+ }
6960
+ async function normalizeCliRunImages(inputs, normalizeRemote) {
6961
+ const local = inputs.filter((input) => !/^(https?:|data:|file:)/i.test(input));
6962
+ if (local.length > MAX_TOOL_IMAGES_PER_REQUEST) throw new Error("image_input_invalid: expected at most 4 local images");
6963
+ const urls = await validateChildImages(local);
6964
+ let index = 0;
6965
+ return inputs.map((input) => /^(https?:|data:|file:)/i.test(input) ? normalizeRemote(input) : urls[index++]);
6966
+ }
6967
+
6816
6968
  // packages/cli/agentRunArgs.ts
6817
6969
  import { readFileSync } from "node:fs";
6818
- import { isAbsolute } from "node:path";
6970
+ import { isAbsolute as isAbsolute2 } from "node:path";
6819
6971
  function readFlagValue(args, flag) {
6820
6972
  const index = args.indexOf(flag);
6821
6973
  if (index < 0) return void 0;
@@ -7017,7 +7169,7 @@ function parseAgentRunArgs(args, options = {}) {
7017
7169
  if (!rawInstaboxArtifactDir) {
7018
7170
  throw new Error("--runtime-key instabox \u5FC5\u987B\u6307\u5B9A --instabox-artifact-dir <\u7EDD\u5BF9\u8DEF\u5F84>");
7019
7171
  }
7020
- if (!isAbsolute(rawInstaboxArtifactDir) || rawInstaboxArtifactDir.includes("\0") || rawInstaboxArtifactDir.split("/").includes("..")) {
7172
+ if (!isAbsolute2(rawInstaboxArtifactDir) || rawInstaboxArtifactDir.includes("\0") || rawInstaboxArtifactDir.split("/").includes("..")) {
7021
7173
  throw new Error(`--instabox-artifact-dir \u5FC5\u987B\u4E3A\u5408\u6CD5\u7EDD\u5BF9\u8DEF\u5F84\uFF0C\u4E14\u4E0D\u80FD\u5305\u542B .. \u6216\u7A7A\u5B57\u7B26: "${rawInstaboxArtifactDir}"`);
7022
7174
  }
7023
7175
  if (rawInstaboxWorkspace === "snapshot" && !rawInstaboxManifest) {
@@ -7186,7 +7338,7 @@ function waitForRunTerminal(args) {
7186
7338
  }
7187
7339
 
7188
7340
  // packages/cli/client/cliAgentRunToolExecutors.ts
7189
- import { existsSync as existsSync2, readFileSync as readFileSync4 } from "node:fs";
7341
+ import { existsSync as existsSync3, readFileSync as readFileSync4 } from "node:fs";
7190
7342
 
7191
7343
  // packages/cli/client/agentRunSnapshot.ts
7192
7344
  function readString(value) {
@@ -7432,14 +7584,14 @@ function deriveAgentRunTodoStatus(input) {
7432
7584
  }
7433
7585
 
7434
7586
  // packages/cli/client/fileSystemStores.ts
7435
- import { existsSync, mkdirSync, readFileSync as readFileSync2, writeFileSync } from "node:fs";
7587
+ import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, writeFileSync } from "node:fs";
7436
7588
  import { homedir as nodeHomedir } from "node:os";
7437
7589
  import { dirname as dirname2, join as join2 } from "node:path";
7438
7590
  var nodeFs = {
7439
7591
  mkdirSync,
7440
7592
  writeFileSync,
7441
7593
  readFileSync: readFileSync2,
7442
- existsSync
7594
+ existsSync: existsSync2
7443
7595
  };
7444
7596
  function resolveNoloHome(env, homedir2) {
7445
7597
  const custom = env?.NOLO_HOME;
@@ -7539,8 +7691,8 @@ function createFileSystemTodoStore(opts = {}) {
7539
7691
  }
7540
7692
 
7541
7693
  // packages/cli/client/instaboxRunConfig.ts
7542
- import { lstatSync, readFileSync as readFileSync3, realpathSync } from "node:fs";
7543
- import { isAbsolute as isAbsolute2, normalize, resolve as resolve2 } from "node:path";
7694
+ import { lstatSync, readFileSync as readFileSync3, realpathSync as realpathSync2 } from "node:fs";
7695
+ import { isAbsolute as isAbsolute3, normalize, resolve as resolve2 } from "node:path";
7544
7696
 
7545
7697
  // packages/cli/client/localInstaboxWorkspaceDelivery.ts
7546
7698
  import { constants } from "node:fs";
@@ -7553,6 +7705,7 @@ var INSTABOX_DEFAULT_BASE_URL = "https://api.instabox.sh/v1";
7553
7705
  var INSTABOX_MAX_EXEC_SECONDS = 600;
7554
7706
  var INSTABOX_MAX_STDIN_BYTES = 1024 * 1024;
7555
7707
  var SAFE_MESSAGE = {
7708
+ instabox_download_failed: "Instabox file download failed",
7556
7709
  instabox_upload_failed: "Instabox file upload failed",
7557
7710
  instabox_recovery_failed: "Instabox recovery persistence or authority validation failed",
7558
7711
  instabox_recovery_unknown: "Instabox machine identity is unknown; manual reconciliation required",
@@ -7894,7 +8047,7 @@ var InstaboxBackend = class {
7894
8047
  if (machine.name !== plan.name) mismatches.push("name mismatch");
7895
8048
  if (template?.id !== plan.templateId) mismatches.push("template mismatch");
7896
8049
  if (spec?.vcpus !== plan.vcpus || spec?.memMiB !== plan.memMiB || spec?.persistentDiskGiB !== expectedSpec.persistentDiskGiB) mismatches.push("spec mismatch");
7897
- if (this.#billingPolicy === "free-only" && machine.maxRunMinutes !== 480) mismatches.push("maxRunMinutes mismatch");
8050
+ if (this.#billingPolicy === "free-only" && (!Number.isSafeInteger(machine.maxRunMinutes) || machine.maxRunMinutes < 0 || machine.maxRunMinutes > plan.maxRunMinutes)) mismatches.push("maxRunMinutes mismatch");
7898
8051
  if (mismatches.length > 0) {
7899
8052
  const reason = mismatches.join("; ");
7900
8053
  this.#assertDeletionAllowed(machineId, reason);
@@ -7943,6 +8096,7 @@ var InstaboxBackend = class {
7943
8096
  const usageBaselineRunningMs = baseline === null ? null : Math.round(baseline.runningSeconds * 1e3);
7944
8097
  const leaseId = `${machineId}:${ticket.ticketId}`;
7945
8098
  this.#leases.set(leaseId, {
8099
+ ciWritableRoots: [...ticket.filesystem.writableRoots],
7946
8100
  recovery: context.record,
7947
8101
  machineId,
7948
8102
  ticketId: ticket.ticketId,
@@ -7989,7 +8143,7 @@ var InstaboxBackend = class {
7989
8143
  };
7990
8144
  const fail5 = () => new InstaboxBackendError("instabox_upload_failed");
7991
8145
  checkLease();
7992
- if (!input || typeof input.path !== "string" || !input.path.startsWith("/workspace/") || input.path.endsWith("/") || input.path.split("/").some((p, i) => i > 0 && (!p || p === "." || p === "..")) || /[\\\x00-\x1f\x7f]/.test(input.path) || !(input.bytes instanceof Uint8Array) || input.bytes.byteLength > INSTABOX_MAX_UPLOAD_BYTES || !input.signal || !Number.isFinite(input.deadlineAt)) throw fail5();
8146
+ if (!input || typeof input.path !== "string" || !(input.path.startsWith("/workspace/") || (entry.ciWritableRoots ?? []).some((root) => root.startsWith("/data/home/nolo-ci/") && input.path.startsWith(root + "/"))) || input.path.endsWith("/") || input.path.split("/").some((p, i) => i > 0 && (!p || p === "." || p === "..")) || /[\\\x00-\x1f\x7f]/.test(input.path) || !(input.bytes instanceof Uint8Array) || input.bytes.byteLength > INSTABOX_MAX_UPLOAD_BYTES || !input.signal || !Number.isFinite(input.deadlineAt)) throw fail5();
7993
8147
  let base;
7994
8148
  try {
7995
8149
  base = new URL(this.#baseUrl);
@@ -8054,6 +8208,44 @@ var InstaboxBackend = class {
8054
8208
  controller.abort();
8055
8209
  }
8056
8210
  }
8211
+ /** Raw binary download, bounded and confined to a task-owned lease root. */
8212
+ async downloadFile(lease, input) {
8213
+ const entry = this.#requireEntry(lease);
8214
+ const fail5 = () => new InstaboxBackendError("instabox_download_failed");
8215
+ if (entry.releasedAt !== null || entry.stopState !== null || !Number.isSafeInteger(input.maxBytes) || input.maxBytes < 0 || input.maxBytes > INSTABOX_MAX_UPLOAD_BYTES || !(entry.ciWritableRoots ?? []).some((root) => root.startsWith("/data/home/nolo-ci/") && input.path.startsWith(root + "/")) || input.path.split("/").some((p, i) => i > 0 && (!p || p === "." || p === "..")) || /[\\\x00-\x1f\x7f]/.test(input.path)) throw fail5();
8216
+ const remaining = input.deadlineAt - this.#now();
8217
+ if (input.signal.aborted || remaining <= 0) throw fail5();
8218
+ const signal = AbortSignal.any([input.signal, AbortSignal.timeout(Math.min(remaining, 2147483647))]);
8219
+ const base = new URL(this.#baseUrl);
8220
+ if (base.protocol !== "https:" || base.username || base.password || base.search || base.hash) throw fail5();
8221
+ const response = await this.#fetch(`${this.#baseUrl}/machines/${encodeURIComponent(entry.machineId)}/files/content?path=${encodeURIComponent(input.path)}`, {
8222
+ method: "GET",
8223
+ headers: { "X-API-Key": this.#apiKey },
8224
+ signal,
8225
+ redirect: "error"
8226
+ });
8227
+ const length = response.headers?.get("Content-Length");
8228
+ if (response.status !== 200 || response.redirected || !length || !/^\d+$/.test(length) || Number(length) > input.maxBytes || decodeURIComponent(response.headers?.get("X-Instabox-File-Path") ?? "") !== input.path || !response.body) throw fail5();
8229
+ const reader = response.body.getReader();
8230
+ const chunks = [];
8231
+ let count2 = 0;
8232
+ try {
8233
+ for (; ; ) {
8234
+ signal.throwIfAborted();
8235
+ const part = await reader.read();
8236
+ if (part.done) break;
8237
+ count2 += part.value.byteLength;
8238
+ if (count2 > input.maxBytes || count2 > Number(length)) throw fail5();
8239
+ chunks.push(part.value);
8240
+ }
8241
+ if (count2 !== Number(length)) throw fail5();
8242
+ return Buffer.concat(chunks);
8243
+ } finally {
8244
+ await reader.cancel().catch(() => {
8245
+ });
8246
+ reader.releaseLock();
8247
+ }
8248
+ }
8057
8249
  async execute(lease, request, onEvent) {
8058
8250
  const entry = this.#requireEntry(lease);
8059
8251
  if (entry.releasedAt !== null) {
@@ -8418,12 +8610,13 @@ var InstaboxBackend = class {
8418
8610
  const response = await this.#call({ method: "GET", path: `/machines/${encodeURIComponent(machineId)}` });
8419
8611
  const machine = asRecord(response.payload);
8420
8612
  const spec = asRecord(machine?.spec);
8421
- if (response.status !== 200 || machine?.id !== machineId || machine.orgId !== plan.orgId || machine.name !== plan.name || asRecord(machine.template)?.id !== plan.templateId || spec?.vcpus !== plan.vcpus || spec?.memMiB !== plan.memMiB || spec?.persistentDiskGiB !== record.persistentDiskGiB || typeof machine.free !== "boolean" || record.billingPolicy === "free-only" && (machine.free !== true || machine.maxRunMinutes !== plan.maxRunMinutes)) {
8613
+ if (response.status !== 200 || machine?.id !== machineId || machine.orgId !== plan.orgId || machine.name !== plan.name || asRecord(machine.template)?.id !== plan.templateId || spec?.vcpus !== plan.vcpus || spec?.memMiB !== plan.memMiB || spec?.persistentDiskGiB !== record.persistentDiskGiB || typeof machine.free !== "boolean" || record.billingPolicy === "free-only" && machine.free !== true) {
8422
8614
  throw this.#withRecovery(new InstaboxBackendError("instabox_recovery_failed"), record);
8423
8615
  }
8424
8616
  const leaseId = `${machineId}:${record.ticketId}`;
8425
8617
  if (this.#leases.has(leaseId)) throw this.#withRecovery(new InstaboxBackendError("instabox_lease_mismatch"), record);
8426
8618
  this.#leases.set(leaseId, {
8619
+ ciWritableRoots: [],
8427
8620
  recovery: structuredClone(record),
8428
8621
  machineId,
8429
8622
  ticketId: record.ticketId,
@@ -8902,7 +9095,7 @@ function resolveInstaboxRunConfigPath(options) {
8902
9095
  }
8903
9096
  const runsDir = options?.runsDir ?? resolveRunsDir(env);
8904
9097
  const normalizedRunsDir = normalize(resolve2(runsDir));
8905
- const resolvedTarget = isAbsolute2(explicitPath) ? normalize(explicitPath) : normalize(resolve2(normalizedRunsDir, explicitPath));
9098
+ const resolvedTarget = isAbsolute3(explicitPath) ? normalize(explicitPath) : normalize(resolve2(normalizedRunsDir, explicitPath));
8906
9099
  if (resolvedTarget !== normalizedRunsDir && !resolvedTarget.startsWith(normalizedRunsDir.endsWith("/") ? normalizedRunsDir : `${normalizedRunsDir}/`)) {
8907
9100
  fail2("path_traversal", `\u914D\u7F6E\u8DEF\u5F84 "${explicitPath}" \u8D8A\u51FA\u4E86\u9650\u5B9A\u7684 runs \u76EE\u5F55 "${normalizedRunsDir}"`);
8908
9101
  }
@@ -8922,8 +9115,8 @@ function resolveInstaboxRunConfigPath(options) {
8922
9115
  fail2("file_too_large", `\u914D\u7F6E\u6587\u4EF6\u5927\u5C0F (${stats.size} \u5B57\u8282) \u8D85\u8FC7\u4E0A\u9650 (${INSTABOX_RUN_CONFIG_MAX_BYTES} \u5B57\u8282)`);
8923
9116
  }
8924
9117
  try {
8925
- const realTarget = realpathSync(resolvedTarget);
8926
- const realRuns = realpathSync(normalizedRunsDir);
9118
+ const realTarget = realpathSync2(resolvedTarget);
9119
+ const realRuns = realpathSync2(normalizedRunsDir);
8927
9120
  if (realTarget !== realRuns && !realTarget.startsWith(realRuns.endsWith("/") ? realRuns : `${realRuns}/`)) {
8928
9121
  fail2("symlink_traversal", `\u914D\u7F6E\u771F\u5B9E\u8DEF\u5F84 "${realTarget}" \u8D8A\u51FA runs \u771F\u5B9E\u76EE\u5F55 "${realRuns}"`);
8929
9122
  }
@@ -8984,7 +9177,7 @@ function loadInstaboxRunConfig(options) {
8984
9177
  if (!artifactRootRaw) {
8985
9178
  fail2("missing_artifact_root", "artifactRoot (artifact\u76EE\u7684\u76EE\u5F55) \u5FC5\u987B\u4E3A\u975E\u7A7A\u5B57\u7B26\u4E32\uFF0C\u672A\u914D\u7F6E\u6216\u9ED8\u8BA4\u5747\u88AB\u62D2\u7EDD");
8986
9179
  }
8987
- if (!isAbsolute2(artifactRootRaw) || artifactRootRaw.includes("\0") || artifactRootRaw.split("/").includes("..")) {
9180
+ if (!isAbsolute3(artifactRootRaw) || artifactRootRaw.includes("\0") || artifactRootRaw.split("/").includes("..")) {
8988
9181
  fail2("invalid_artifact_root", `artifactRoot \u5FC5\u987B\u4E3A\u5408\u6CD5\u7EDD\u5BF9\u8DEF\u5F84: "${artifactRootRaw}"`);
8989
9182
  }
8990
9183
  const artifactRoot = normalize(artifactRootRaw);
@@ -9217,7 +9410,7 @@ var parseCallArgs = (call) => {
9217
9410
  return {};
9218
9411
  }
9219
9412
  };
9220
- var resolveFs = (deps) => deps.fs ?? { existsSync: existsSync2, readFileSync: readFileSync4 };
9413
+ var resolveFs = (deps) => deps.fs ?? { existsSync: existsSync3, readFileSync: readFileSync4 };
9221
9414
  var probeRunCwd = (deps) => {
9222
9415
  const fs = deps.fs;
9223
9416
  const stat = fs?.statSync ?? nodeFs2.statSync;
@@ -9302,6 +9495,8 @@ function buildRunStatusPayload(reconciled, deps, opts = {}) {
9302
9495
  // 排在 2000 字 lastAssistantText 之后的键会被整段省略,模型连路径都看
9303
9496
  // 不到。挂在头部才能保证「结论在哪」永远可见。
9304
9497
  ...reconciled.resultFile ? { resultFile: reconciled.resultFile } : {},
9498
+ ...reconciled.continuedFrom ? { continuedFrom: reconciled.continuedFrom } : {},
9499
+ ...isAgentRunTerminalStatus(reconciled.status) ? { resultNote: "Process terminal status is not delivery, test, review, user acceptance or integration/release approval. lastAssistantText is a preview, not a complete report; read resultFile for current scope, blockers and evidence. Runtime acceptance contains observations only; unknown stays unknown. continuedFrom is lineage, not inherited approval." } : {},
9305
9500
  ...typeof reconciled.toolCallCount === "number" ? { toolCallCount: reconciled.toolCallCount } : {},
9306
9501
  ...reconciled.lastAssistantText ? { lastAssistantText: reconciled.lastAssistantText } : {},
9307
9502
  // Non-ephemeral runs expose dialogId so the caller can read the
@@ -9373,6 +9568,8 @@ async function assertCredentialFanoutAllowed(deps, args) {
9373
9568
  function createCliStartAgentRunExecutor(deps = {}) {
9374
9569
  return async (call) => {
9375
9570
  const args = parseCallArgs(call);
9571
+ const imagePaths = validateChildImagePaths(args.imagePaths);
9572
+ if (imagePaths.length && args.runtimeKey !== "local") throw new Error("image_backend_unsupported: imagePaths requires explicit host-local runtimeKey=local");
9376
9573
  const continueDialogId = normalizeContinueDialogId(args.continueDialogId);
9377
9574
  const continuedRecord = continueDialogId ? await deps.dialogExistsForCurrentUser?.(continueDialogId) : void 0;
9378
9575
  if (continueDialogId && !continuedRecord) {
@@ -9490,6 +9687,15 @@ function createCliStartAgentRunExecutor(deps = {}) {
9490
9687
  selectedModel = await deps.resolveAgentModel?.(agentKey);
9491
9688
  } catch {
9492
9689
  }
9690
+ if (imagePaths.length) {
9691
+ let imageSupport = false;
9692
+ try {
9693
+ imageSupport = await deps.resolveAgentImageSupport?.(agentKey) === true;
9694
+ } catch {
9695
+ }
9696
+ if (!imageSupport) throw new Error("image_model_unsupported: child model image capability is unsupported or unknown");
9697
+ await validateChildImages(imagePaths);
9698
+ }
9493
9699
  const selectionCheck = assertDispatchSelectionAdmission({
9494
9700
  dimension: args.dimension,
9495
9701
  difficulty: args.difficulty,
@@ -9542,7 +9748,8 @@ function createCliStartAgentRunExecutor(deps = {}) {
9542
9748
  // 执行后端(默认 docker 沙盒;只读派发留宿主):唯一产出 `--runtime-key`
9543
9749
  // 的地方,成对不变式在 buildCliLocalRuntimeForwardArgs 内机械断言。
9544
9750
  ...buildCliLocalRuntimeForwardArgs(dispatch),
9545
- ...instaboxArgs
9751
+ ...instaboxArgs,
9752
+ ...imagePaths.flatMap((path) => ["--image", path])
9546
9753
  ];
9547
9754
  const agentName = await resolveAgentRunName(
9548
9755
  agentKey,
@@ -10269,6 +10476,7 @@ function pickAgentRunResolverDeps(args) {
10269
10476
  return {
10270
10477
  ...args.resolveAgentCredentialGroup ? { resolveAgentCredentialGroup: args.resolveAgentCredentialGroup } : {},
10271
10478
  ...args.dialogExistsForCurrentUser ? { dialogExistsForCurrentUser: args.dialogExistsForCurrentUser } : {},
10479
+ ...args.resolveAgentImageSupport ? { resolveAgentImageSupport: args.resolveAgentImageSupport } : {},
10272
10480
  ...args.resolveAgentModel ? { resolveAgentModel: args.resolveAgentModel } : {},
10273
10481
  ...args.resolveAgentDisplayName ? { resolveAgentDisplayName: args.resolveAgentDisplayName } : {},
10274
10482
  ...args.resolveAgentRuntimeBindingMachineId ? { resolveAgentRuntimeBindingMachineId: args.resolveAgentRuntimeBindingMachineId } : {},
@@ -10645,7 +10853,7 @@ function createOAuthApiKeyRefResolver(options = {}) {
10645
10853
  }
10646
10854
 
10647
10855
  // packages/agent-runtime/localSandboxWorkload.ts
10648
- import { existsSync as existsSync3 } from "node:fs";
10856
+ import { existsSync as existsSync4 } from "node:fs";
10649
10857
  import { resolve as resolve5 } from "node:path";
10650
10858
 
10651
10859
  // packages/agent-runtime/executionChannel.ts
@@ -10737,7 +10945,7 @@ import {
10737
10945
  } from "node:fs";
10738
10946
  import { access } from "node:fs/promises";
10739
10947
  import { tmpdir } from "node:os";
10740
- import { isAbsolute as isAbsolute3, join as join4, relative, resolve as resolve4 } from "node:path";
10948
+ import { isAbsolute as isAbsolute4, join as join4, relative, resolve as resolve4 } from "node:path";
10741
10949
 
10742
10950
  // packages/agent-runtime/linuxSandboxSeccomp.ts
10743
10951
  var AUDIT_ARCH_X86_64 = 3221225534;
@@ -10831,10 +11039,10 @@ var PSEUDO_FS = ["/proc", "/sys", "/dev", "/run"];
10831
11039
  var SANDBOX_MOUNTS = ["/", "/usr", "/bin", "/lib", "/lib64", "/tmp"];
10832
11040
  var inside = (parent, child) => {
10833
11041
  const rel = relative(parent, child);
10834
- return rel === "" || rel !== ".." && !rel.startsWith("../") && !isAbsolute3(rel);
11042
+ return rel === "" || rel !== ".." && !rel.startsWith("../") && !isAbsolute4(rel);
10835
11043
  };
10836
11044
  function openRootHandle(path) {
10837
- if (typeof path !== "string" || !isAbsolute3(path) || path.includes("\0")) {
11045
+ if (typeof path !== "string" || !isAbsolute4(path) || path.includes("\0")) {
10838
11046
  throw new Error("Sandbox root must be absolute");
10839
11047
  }
10840
11048
  const expected = resolve4(path);
@@ -11020,7 +11228,7 @@ var LinuxBubblewrapBackend = class {
11020
11228
  if (request.timeoutMs !== void 0 && (!Number.isFinite(request.timeoutMs) || request.timeoutMs <= 0)) {
11021
11229
  throw new Error("Sandbox timeout must be finite and positive");
11022
11230
  }
11023
- if (request.cwd && !active.writable.some(({ path: root }) => isAbsolute3(request.cwd) && inside(root, resolve4(request.cwd)))) {
11231
+ if (request.cwd && !active.writable.some(({ path: root }) => isAbsolute4(request.cwd) && inside(root, resolve4(request.cwd)))) {
11024
11232
  throw new Error("Command cwd outside writable sandbox roots");
11025
11233
  }
11026
11234
  if (!validateConfiguredRootExecutionLease(active.ticket, active.lease)) {
@@ -11225,7 +11433,7 @@ async function createLocalSandboxWorkload(args) {
11225
11433
  if (canonicalToolName(toolName) !== EXECUTION_SHELL_TOOL) return null;
11226
11434
  const callArgs = toolArgs ?? {};
11227
11435
  const command = typeof callArgs.command === "string" ? callArgs.command : "";
11228
- const mountedBins = readableRoots.map((root) => `${root}/bin`).filter((dir) => existsSync3(dir));
11436
+ const mountedBins = readableRoots.map((root) => `${root}/bin`).filter((dir) => existsSync4(dir));
11229
11437
  const sandboxPath = [
11230
11438
  ...mountedBins,
11231
11439
  process.env.PATH ?? "/usr/local/bin:/usr/bin:/bin"
@@ -12071,8 +12279,8 @@ async function createLocalDockerWorkload(args) {
12071
12279
  }
12072
12280
  const createLifecycle = args.createLifecycle ?? (async () => {
12073
12281
  const [{ DockerWorkloadLifecycle, createDockerBindingAuthorizer }, accounts] = await Promise.all([
12074
- import("./workloadLifecycle-O2I3NZ2Q.js"),
12075
- import("./accountResolver-EK2S4PWF.js")
12282
+ import("./workloadLifecycle-HFJIN5IZ.js"),
12283
+ import("./accountResolver-QETKNC7T.js")
12076
12284
  ]);
12077
12285
  const resolveAccount = args.resolveAccount ?? accounts.createDockerAccountResolver({
12078
12286
  env: args.env,
@@ -13890,6 +14098,75 @@ var import_format = __toESM(require_format(), 1);
13890
14098
  import { appendFileSync, mkdirSync as mkdirSync3 } from "fs";
13891
14099
  import { homedir } from "os";
13892
14100
  import { join as join7 } from "path";
14101
+
14102
+ // packages/cli/client/cliCompletedTurnCapture.ts
14103
+ async function readCliCaptureSources(args) {
14104
+ if (args.input.result.stopReason !== "done" || args.input.result.error) return [];
14105
+ const explicitIds = args.input.cliCaptureUserMessageIds;
14106
+ const ids = [...new Set([
14107
+ ...args.input.messages.filter((message) => message.role === "user").map((message) => message.cliMessageId),
14108
+ ...Array.isArray(explicitIds) ? explicitIds : [],
14109
+ ...args.persistedUserMessageIds ?? []
14110
+ ].filter((id) => typeof id === "string" && /^[A-Za-z0-9_-]{1,128}$/.test(id)))];
14111
+ const sources = [];
14112
+ for (const id of ids) {
14113
+ const key = `dialog-${args.dialogId}-msg-${id}`;
14114
+ const record = await args.read(key);
14115
+ if (record?.id !== id || record?.dialogId !== args.dialogId || record?.userId !== args.userId || record?.role !== "user" || isTombstoneRecord(record) || typeof record?.content !== "string" || !record.content.trim() || typeof record?.createdAt !== "string" || !Number.isFinite(Date.parse(record.createdAt))) continue;
14116
+ sources.push({ type: "put", key, value: record });
14117
+ }
14118
+ return sources;
14119
+ }
14120
+ async function captureCliCompletedTurn(args) {
14121
+ if (args.input.result.stopReason !== "done" || args.input.result.error) {
14122
+ return [{ status: "skipped", reason: "turn_not_completed" }];
14123
+ }
14124
+ if (!args.sources.length) return [{ status: "deferred", reason: "missing_persisted_source" }];
14125
+ const serverUrl = resolveRuntimeServerUrl(args.env);
14126
+ if (!serverUrl) return [{ status: "deferred", reason: "server_not_configured" }];
14127
+ const authToken = resolveRuntimeAuthToken(args.env);
14128
+ if (!authToken) return [{ status: "deferred", reason: "not_authenticated" }];
14129
+ const results = [];
14130
+ for (const source of args.sources) {
14131
+ const userMessageId = source.value.id;
14132
+ try {
14133
+ const response = await fetchWithTransientRetry(
14134
+ args.fetchImpl,
14135
+ `${serverUrl}/api/memory/capture-turn`,
14136
+ {
14137
+ method: "POST",
14138
+ headers: { "Content-Type": "application/json", Authorization: `Bearer ${authToken}` },
14139
+ // The transitional validator requires nonempty userInput; native capture ignores it.
14140
+ // A short inert marker also avoids legacy text extraction on older servers.
14141
+ body: JSON.stringify({
14142
+ agentKey: args.input.agentKey,
14143
+ dialogId: args.dialogId,
14144
+ userMessageId,
14145
+ userInput: "native source"
14146
+ }),
14147
+ signal: AbortSignal.timeout(remoteDialogSyncTimeout())
14148
+ },
14149
+ { retryableStatuses: /* @__PURE__ */ new Set([429, 502, 503]) }
14150
+ );
14151
+ if (!response.ok) {
14152
+ results.push({ status: "deferred", reason: `http_${response.status}`, userMessageId });
14153
+ continue;
14154
+ }
14155
+ const body = await response.json();
14156
+ const native = body?.protocol === "native" ? body.nativeCapture : null;
14157
+ if (!native || !["captured", "skipped"].includes(native.capture) || !["applied", "no_op", "deferred", "failed"].includes(native.formation)) {
14158
+ results.push({ status: "deferred", reason: "native_capture_unconfirmed", userMessageId });
14159
+ } else {
14160
+ results.push({ status: native.capture, reason: `formation_${native.formation}`, userMessageId });
14161
+ }
14162
+ } catch {
14163
+ results.push({ status: "deferred", reason: "transport_or_response_error", userMessageId });
14164
+ }
14165
+ }
14166
+ return results;
14167
+ }
14168
+
14169
+ // packages/cli/client/localRuntimeDialog.ts
13893
14170
  var diagLog = {
13894
14171
  warn: (msg) => getLogger("cli.localRuntimeDialog").warn(msg),
13895
14172
  info: (msg) => getLogger("cli.localRuntimeDialog").info(msg)
@@ -14187,6 +14464,16 @@ async function writeDialog(args) {
14187
14464
  existingDialog,
14188
14465
  cwd: args.cwd
14189
14466
  });
14467
+ for (const id of plan.captureUserMessageIds) {
14468
+ const op = plan.ops.find((op2) => op2.value.id === id && op2.value.role === "user");
14469
+ const existing = await args.store.read(op.key, { remote: false });
14470
+ if (existing) {
14471
+ if (existing.id !== id || existing.dialogId !== plan.dialogId || existing.userId !== args.userId || existing.role !== "user" || JSON.stringify(existing.content) !== JSON.stringify(op.value.content)) {
14472
+ throw new Error("CLI persisted turn source conflict");
14473
+ }
14474
+ op.value = existing;
14475
+ }
14476
+ }
14190
14477
  const lastInputTokens = extractLastProviderInputTokens(args.input) ?? (typeof existingDialog?.lastInputTokens === "number" && Number.isFinite(existingDialog.lastInputTokens) && existingDialog.lastInputTokens > 0 ? existingDialog.lastInputTokens : void 0);
14191
14478
  if (typeof lastInputTokens === "number" && lastInputTokens > 0) {
14192
14479
  const dialogOp = plan.ops.find(
@@ -14235,40 +14522,56 @@ async function writeDialog(args) {
14235
14522
  diagLog.info(`perf writeDialog D:token-record (cumulative): ${ms}ms`);
14236
14523
  }
14237
14524
  const hasSubjectRefs = localTurnHasSubjectRefs(args.input);
14238
- const isLocalUser = args.userId === "local";
14239
- let remoteSyncPromise;
14240
- if (!isLocalUser) {
14241
- if (hasSubjectRefs) {
14242
- remoteSyncPromise = (async () => {
14243
- const syncResult = await syncLocalDialogEvidenceToRemote({
14244
- env: args.env,
14245
- fetchImpl: args.fetchImpl,
14246
- input: args.input,
14247
- ops: [...plan.ops, ...tokenOps],
14248
- output: args.output,
14249
- userId: args.userId
14250
- });
14251
- if (!syncResult.attempted) {
14252
- args.output?.write(
14253
- "[nolo] Local dialog evidence is local-only; set NOLO_SERVER and AUTH_TOKEN to make subjectRefs remotely queryable.\n"
14254
- );
14255
- }
14256
- })();
14257
- await remoteSyncPromise;
14258
- } else {
14259
- remoteSyncPromise = startOwnedDialogSync(args.fetchImpl, (fetchImpl) => syncLocalDialogEvidenceToRemote({
14525
+ let memoryCaptureResults = [];
14526
+ const reportCapture = (results) => {
14527
+ memoryCaptureResults = results;
14528
+ for (const result of results) {
14529
+ diagLog.info(`memory_capture ${result.status}: ${result.reason}`);
14530
+ }
14531
+ };
14532
+ const captureSources = await readCliCaptureSources({
14533
+ input: args.input,
14534
+ dialogId: plan.dialogId,
14535
+ userId: args.userId,
14536
+ persistedUserMessageIds: plan.captureUserMessageIds,
14537
+ read: (key) => args.store.read(key, { remote: false })
14538
+ }).catch(() => []);
14539
+ const syncAndCapture = async (fetchImpl) => {
14540
+ try {
14541
+ const syncResult = args.userId === "local" ? { attempted: false } : await syncLocalDialogEvidenceToRemote({
14260
14542
  env: args.env,
14261
14543
  fetchImpl,
14262
14544
  input: args.input,
14263
- ops: [...plan.ops, ...tokenOps],
14545
+ ops: [...plan.ops, ...tokenOps, ...captureSources],
14546
+ localStore: args.store,
14264
14547
  output: args.output,
14265
14548
  userId: args.userId
14266
- })).catch((error) => {
14267
- args.output?.write(`[nolo] Remote dialog evidence sync failed; class=${classifyDialogSyncFailure(error)}; local history retained; remote sync incomplete.
14268
- `);
14269
14549
  });
14550
+ if (!syncResult.attempted) {
14551
+ if (hasSubjectRefs) args.output?.write(
14552
+ "[nolo] Local dialog evidence is local-only; set NOLO_SERVER and AUTH_TOKEN to make subjectRefs remotely queryable.\n"
14553
+ );
14554
+ const result = args.input.result.stopReason !== "done" || args.input.result.error ? { status: "skipped", reason: "turn_not_completed" } : { status: "deferred", reason: !resolveRuntimeServerUrl(args.env) ? "server_not_configured" : args.userId === "local" || !resolveRuntimeAuthToken(args.env) ? "not_authenticated" : "remote_sync_unavailable" };
14555
+ reportCapture([result]);
14556
+ return;
14557
+ }
14558
+ reportCapture(await captureCliCompletedTurn({
14559
+ input: args.input,
14560
+ dialogId: plan.dialogId,
14561
+ sources: captureSources,
14562
+ env: args.env,
14563
+ fetchImpl
14564
+ }));
14565
+ } catch (error) {
14566
+ reportCapture([{ status: "deferred", reason: "remote_sync_failed" }]);
14567
+ throw error;
14270
14568
  }
14271
- }
14569
+ };
14570
+ const remoteSyncPromise = hasSubjectRefs ? syncAndCapture(args.fetchImpl) : startOwnedDialogSync(args.fetchImpl, syncAndCapture).catch((error) => {
14571
+ args.output?.write(`[nolo] Remote dialog evidence sync failed; class=${classifyDialogSyncFailure(error)}; local history retained; remote sync incomplete.
14572
+ `);
14573
+ });
14574
+ if (hasSubjectRefs) await remoteSyncPromise;
14272
14575
  let titlePatchPromise;
14273
14576
  if (titlePromise) {
14274
14577
  const dialogKey = `dialog-${args.userId}-${plan.dialogId}`;
@@ -14296,7 +14599,9 @@ async function writeDialog(args) {
14296
14599
  const ms = (performance.now() - __perfT0).toFixed(1);
14297
14600
  diagLog.info(`perf writeDialog total (blocking): ${ms}ms`);
14298
14601
  }
14299
- return { dialogId: plan.dialogId, title: plan.title, titlePatchPromise, remoteSyncPromise };
14602
+ return { dialogId: plan.dialogId, title: plan.title, titlePatchPromise, remoteSyncPromise, get memoryCaptureResults() {
14603
+ return memoryCaptureResults;
14604
+ } };
14300
14605
  }
14301
14606
  function resolveCliDialogRecordKey(userId, dialogId) {
14302
14607
  if (dialogId.startsWith("dialog-") && !dialogId.includes("-msg-")) {
@@ -14616,6 +14921,14 @@ function createCliLocalRuntimeAdapter(deps) {
14616
14921
  const defaultCompactionSummary = createTuiSummaryLlmCaller(deps.env, { fetchImpl, platformPrimary: true });
14617
14922
  const loopbackRequest = deps.loopbackRequest ?? (deps.fetchImpl ? void 0 : defaultLoopbackRequest);
14618
14923
  const userId = resolveLocalUserId(deps.env);
14924
+ const resolveLiveImageSupport = createLiveImageSupportResolver(userId, async () => {
14925
+ const token = await createOAuthApiKeyRefResolver({
14926
+ migration: { enableLegacyMigration: true },
14927
+ localUserId: userId
14928
+ })("antigravity");
14929
+ if (!token) return {};
14930
+ return fetchAntigravityAvailableModels(fetchImpl, token);
14931
+ });
14619
14932
  const localToolBudgets = parseLocalToolBudgets(deps.env);
14620
14933
  const localToolUsage = /* @__PURE__ */ new Map();
14621
14934
  const buildProviderOpenAiTools = deps.buildProviderOpenAiTools ?? buildOpenAiTools;
@@ -14784,7 +15097,7 @@ function createCliLocalRuntimeAdapter(deps) {
14784
15097
  emitRunIsolationNotice(fact, { runId });
14785
15098
  try {
14786
15099
  const { writeFileSync: writeFileSync4, mkdirSync: mkdirSync4 } = await import("node:fs");
14787
- const { resolveRunsDir: resolveRunsDir2 } = await import("./agentRunControl-SNZZ5XP4.js");
15100
+ const { resolveRunsDir: resolveRunsDir2 } = await import("./agentRunControl-MBG4U6SL.js");
14788
15101
  recordLocalRunExecutionIsolation({
14789
15102
  runId,
14790
15103
  runsDir: resolveRunsDir2(deps.env),
@@ -14809,7 +15122,7 @@ function createCliLocalRuntimeAdapter(deps) {
14809
15122
  dockerWorkloadReleased = true;
14810
15123
  dockerWorkloadLoad = null;
14811
15124
  if (loaded) {
14812
- const { resolveRunsDir: resolveRunsDir2 } = await import("./agentRunControl-SNZZ5XP4.js");
15125
+ const { resolveRunsDir: resolveRunsDir2 } = await import("./agentRunControl-MBG4U6SL.js");
14813
15126
  const exportRunDiff = deps.exportDockerRunDiffArtifact ?? exportDockerRunDiffArtifact;
14814
15127
  const warn = (message) => process.stderr.write(`[nolo] ${message}
14815
15128
  `);
@@ -14924,6 +15237,10 @@ function createCliLocalRuntimeAdapter(deps) {
14924
15237
  const deleted = Boolean(rec?.deletedAt || rec?.deleted || rec?.isDeleted);
14925
15238
  return !deleted && typeof rec?.name === "string" && rec.name.trim() ? rec.name.trim() : void 0;
14926
15239
  },
15240
+ resolveAgentImageSupport: async (agentRef) => {
15241
+ const record = await readAgentFromStore({ agentRef, store: await getOrCreateSharedStore(deps), userId });
15242
+ return !!record && resolveAgentImageInputSupport(await resolveLiveImageSupport({ ...record, hasVision: record.hasVision ?? false }));
15243
+ },
14927
15244
  resolveAgentModel,
14928
15245
  dialogExistsForCurrentUser: async (dialogId) => {
14929
15246
  const store = await getOrCreateSharedStore(deps);
@@ -15109,7 +15426,7 @@ function createCliLocalRuntimeAdapter(deps) {
15109
15426
  runtimeToolExecutionLimits = cached.runtimeToolExecutionLimits;
15110
15427
  reviewAgentConfig = cached.agentConfig;
15111
15428
  localToolExecutors = buildCurrentToolExecutors(cached.agentConfig);
15112
- return cached.agentConfig;
15429
+ return resolveLiveImageSupport(cached.agentConfig);
15113
15430
  }
15114
15431
  }
15115
15432
  const storedAgentConfig = await readAgentFromStore({
@@ -15195,7 +15512,7 @@ function createCliLocalRuntimeAdapter(deps) {
15195
15512
  runtimeToolExecutionLimits
15196
15513
  });
15197
15514
  }
15198
- return exposedAgentConfig;
15515
+ return exposedAgentConfig ? resolveLiveImageSupport(exposedAgentConfig) : exposedAgentConfig;
15199
15516
  },
15200
15517
  loadDialogHistory: async (dialogId) => {
15201
15518
  const loaded = await loadCliDialogHistoryWithSource({
@@ -15411,6 +15728,9 @@ function createCliLocalRuntimeAdapter(deps) {
15411
15728
  ...ownerOriginExecution ? { ownerOriginExecution } : {}
15412
15729
  });
15413
15730
  },
15731
+ onWorkingHistoryReplaced: () => {
15732
+ localToolExecutors.readFile?.resetReadLedger?.();
15733
+ },
15414
15734
  executeTool: async (call, opts) => {
15415
15735
  const contextualCall = opts?.runtimeContext ? { ...call, runtimeContext: opts.runtimeContext } : call;
15416
15736
  let injectedCall = contextualCall;
@@ -15655,12 +15975,6 @@ function createCliLocalRuntimeAdapter(deps) {
15655
15975
  }
15656
15976
 
15657
15977
  export {
15658
- readTimestamp,
15659
- parseAgentRunEvent,
15660
- isLiveAgentRunObservation,
15661
- formatApprovalRemaining,
15662
- createHostApprovalCardQueue,
15663
- registerHostApprovalRenderer,
15664
15978
  matchContextualFragment,
15665
15979
  renderNoticeElements,
15666
15980
  renderCliNotice,
@@ -15669,6 +15983,12 @@ export {
15669
15983
  buildNoticeTasksFromRuns,
15670
15984
  setTurnNoticeMeta,
15671
15985
  mergeNoticeGroup,
15986
+ readTimestamp,
15987
+ parseAgentRunEvent,
15988
+ isLiveAgentRunObservation,
15989
+ formatApprovalRemaining,
15990
+ createHostApprovalCardQueue,
15991
+ registerHostApprovalRenderer,
15672
15992
  isSubtaskRun,
15673
15993
  RUN_WAKE_CHANNEL_ENV,
15674
15994
  createOriginShellGrant,
@@ -15713,6 +16033,7 @@ export {
15713
16033
  resolveBoundMachineId,
15714
16034
  isCliProviderAgentConfig,
15715
16035
  detectCurrentMachineId,
16036
+ normalizeCliRunImages,
15716
16037
  readFlagValue,
15717
16038
  isFullstackCodingAgentRef,
15718
16039
  positionalArgs,