nolo-cli 0.157.0-alpha.1 → 0.157.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/{_executeModel-5WS2PA62.js → _executeModel-ZIQHOREX.js} +55 -55
  2. package/{accountResolver-7RYB4D2P.js → accountResolver-55EDKEIK.js} +1 -1
  3. package/{action-ZJYUBXFC.js → action-GPPJC5TI.js} +5 -5
  4. package/{addContentAction-TVHB4526.js → addContentAction-XJQEJ4XW.js} +8 -8
  5. package/{addDialogAgentAction-FDPBU6K6.js → addDialogAgentAction-5WZX5CAY.js} +7 -7
  6. package/{agentDeleteCommand-Q6M4F3U6.js → agentDeleteCommand-LQSOJEXY.js} +75 -76
  7. package/{agentEmailCommands-FNH6FEHS.js → agentEmailCommands-HTPKXONW.js} +78 -79
  8. package/{agentListCommands-JUNMFS6E.js → agentListCommands-GOCGOQUB.js} +36 -36
  9. package/{agentMachineCommands-VNLDEKNT.js → agentMachineCommands-T7DAZG77.js} +35 -32
  10. package/{agentProviderCommands-X2HQE6HY.js → agentProviderCommands-CXBHNONN.js} +5 -5
  11. package/{agentPullCommand-FA43RBRU.js → agentPullCommand-GXXEDOSA.js} +4 -4
  12. package/{agentRecordCommands-47XXRVPI.js → agentRecordCommands-HSW3RJ4H.js} +72 -73
  13. package/{agentRunCommand-QEXFJUXQ.js → agentRunCommand-TIRJ57DK.js} +75 -75
  14. package/{agentRunControl-2C5GM3BW.js → agentRunControl-QWFFIAQY.js} +9 -7
  15. package/{agentRuntimeLocal-O5GDAFTN.js → agentRuntimeLocal-J6I63NZC.js} +21 -19
  16. package/{agentSlice-E3XS5FTQ.js → agentSlice-JNM3HF3V.js} +8 -8
  17. package/{appDeleteCommands-C2J5RQ3I.js → appDeleteCommands-KKLAK2UR.js} +31 -29
  18. package/{appDeployCommands-3YRK7PSU.js → appDeployCommands-PXWK4FAX.js} +31 -29
  19. package/{appDeployStatusCommands-FPAX7MOK.js → appDeployStatusCommands-3NGWDZTX.js} +31 -29
  20. package/{appGetCommands-XAC2V766.js → appGetCommands-APWYPEO3.js} +31 -29
  21. package/{appListCommands-ZJL2W5O7.js → appListCommands-OP7IRALO.js} +31 -29
  22. package/{authCommand-J3XILHWW.js → authCommand-3Z52KJID.js} +22 -302
  23. package/{authCommands-77CHYBGF.js → authCommands-QOCKVPX3.js} +5 -5
  24. package/{builtinSkillRegistry-A6VSPJEJ.js → builtinSkillRegistry-LJV7FHNI.js} +4 -4
  25. package/{chromeCommands-OBBNJCLS.js → chromeCommands-IY4NVSXZ.js} +17 -10
  26. package/{chunk-SW4S4XYB.js → chunk-2AB2HA4M.js} +84 -34
  27. package/{chunk-C5VPAHIU.js → chunk-32ZKZET7.js} +1 -1
  28. package/{chunk-XPWGOTBQ.js → chunk-3L2WKC3W.js} +1 -8
  29. package/{chunk-3XZKV7QQ.js → chunk-3L5MSPWX.js} +1 -1
  30. package/{chunk-QLQ573SU.js → chunk-3M52COK5.js} +120 -0
  31. package/{chunk-VSOWPETY.js → chunk-4226O6F7.js} +10 -10
  32. package/{chunk-Z6KQDSZW.js → chunk-43OFVLWJ.js} +6 -6
  33. package/{chunk-TJ2VPCBE.js → chunk-4JCAW7TO.js} +2 -2
  34. package/{chunk-6TF64IF2.js → chunk-4L4K6YR7.js} +16 -2
  35. package/{chunk-PEO24UB5.js → chunk-5E5VB7PS.js} +324 -57
  36. package/{chunk-ZD2BLOY6.js → chunk-5EDQTOUR.js} +7 -7
  37. package/{chunk-HKT6QXP3.js → chunk-5IKRTRRR.js} +5 -5
  38. package/{chunk-P5QACQDK.js → chunk-62TBKWTV.js} +1 -1
  39. package/{chunk-TRW43TSC.js → chunk-6EQD4AQL.js} +41 -1
  40. package/{chunk-YLMMECCH.js → chunk-6XIE5ZGI.js} +1 -1
  41. package/{chunk-OH2M7WEU.js → chunk-6Y3ETA2Y.js} +3 -3
  42. package/{chunk-7A4LJCDR.js → chunk-B3ZIFOFI.js} +5 -5
  43. package/{chunk-WZ6OU4NX.js → chunk-BAWAKW7X.js} +2 -2
  44. package/{chunk-UUPR3TD7.js → chunk-BL4HFN6L.js} +2 -4
  45. package/{chunk-2GGXHQIW.js → chunk-BLVSFYQ3.js} +4 -2
  46. package/{chunk-HP6O6LTV.js → chunk-CDLP56BS.js} +9 -9
  47. package/{chunk-UTIMX333.js → chunk-DJ2BOPJY.js} +1 -1
  48. package/{chunk-36OMEXXR.js → chunk-DLV3H464.js} +8 -8
  49. package/{chunk-CE7PIHQD.js → chunk-ESMZW5PE.js} +3 -3
  50. package/{chunk-PSJWPSKS.js → chunk-EWO77ZGF.js} +9 -43
  51. package/{chunk-ZWG3C7VI.js → chunk-F3SOW2EU.js} +81 -1
  52. package/{chunk-FY4SDK2E.js → chunk-FDLDMJTM.js} +1 -1
  53. package/{chunk-KOB75UNU.js → chunk-FHG46N5C.js} +53 -4
  54. package/{chunk-7KYVUFDG.js → chunk-G3VYRPTV.js} +5 -267
  55. package/{chunk-DW7MGLMG.js → chunk-GGUTTH6C.js} +35 -207
  56. package/{chunk-6MJNEXUU.js → chunk-HGDKT2D6.js} +4 -0
  57. package/{chunk-B2EGWZJG.js → chunk-I7S63QUU.js} +1 -1
  58. package/{chunk-ROPSATAB.js → chunk-IF7V3CBU.js} +1 -1
  59. package/chunk-IKOKYBYJ.js +2685 -0
  60. package/{chunk-T6CBQ6BN.js → chunk-INFHX73M.js} +1 -1
  61. package/{chunk-YBNHPX4S.js → chunk-IW64YHXL.js} +155 -31
  62. package/{chunk-K43ZF2C3.js → chunk-JPPQ3GUO.js} +1 -1
  63. package/{chunk-TZTWMGE3.js → chunk-JWEXJ573.js} +3 -3
  64. package/{chunk-RUNKPFM5.js → chunk-K6Y5T4GE.js} +12 -8
  65. package/{chunk-MVJVF4ED.js → chunk-KESKU5BG.js} +18 -17
  66. package/{chunk-I2ZMGXXF.js → chunk-KFHREHUQ.js} +1 -1
  67. package/{chunk-3C2QLERX.js → chunk-KMDDG73K.js} +1 -1
  68. package/{chunk-5MM7NNO6.js → chunk-KSTEXKL6.js} +78 -39
  69. package/{chunk-EM3YOZJ4.js → chunk-L2JMH4I5.js} +3 -3
  70. package/{chunk-MM3662RS.js → chunk-LPO6AMQU.js} +780 -64
  71. package/{chunk-D4OWHT5Y.js → chunk-MAYW6V3E.js} +2 -2
  72. package/{chunk-IPAW7XLD.js → chunk-MFVOJ6KF.js} +2 -2
  73. package/{chunk-FDT27L7S.js → chunk-MLEANT7D.js} +19 -17
  74. package/{chunk-7GC3EKUG.js → chunk-MMSQTZCJ.js} +3 -3
  75. package/{chunk-XFKZ3MCV.js → chunk-MR3ITQEV.js} +344 -88
  76. package/{chunk-CBHGZRCE.js → chunk-MYOH447Z.js} +1 -1
  77. package/{chunk-6MPAEODB.js → chunk-NHEWV5FD.js} +17 -3
  78. package/{chunk-ZEHTARJA.js → chunk-NLFTBC6S.js} +321 -150
  79. package/{chunk-SKPPKHD3.js → chunk-OLUKIUX6.js} +2 -2
  80. package/{chunk-SUKSWFLP.js → chunk-PIG2IUVZ.js} +1 -1
  81. package/{chunk-SEJ5OS6F.js → chunk-PXYBUFDB.js} +4 -0
  82. package/{chunk-2MTE2PEH.js → chunk-QA2C5NKI.js} +5 -739
  83. package/{chunk-L6EQV5OC.js → chunk-QXZH5UDF.js} +3 -3
  84. package/{chunk-TNIX77YM.js → chunk-R5GO3YZP.js} +34 -1
  85. package/{chunk-X5SUT4CN.js → chunk-R7GCGOGZ.js} +6 -6
  86. package/{chunk-4Z245KOA.js → chunk-SH3XD4E2.js} +8 -4
  87. package/{chunk-JGRPBIZZ.js → chunk-SQX235S2.js} +1 -1
  88. package/chunk-TT644UJD.js +188 -0
  89. package/{chunk-IYBIRCQV.js → chunk-U34KT53V.js} +29 -11
  90. package/{chunk-ANJTRG52.js → chunk-ULQAD7ZY.js} +18 -43
  91. package/{chunk-QDA4Y5O6.js → chunk-UVYSBQ2M.js} +21 -17
  92. package/{chunk-I2RMFLLH.js → chunk-V7PCFWX3.js} +1 -1
  93. package/{chunk-HXHSTRGH.js → chunk-VYNMQ6HW.js} +0 -27
  94. package/{chunk-G47IPDOK.js → chunk-W7FGZRLK.js} +1 -1
  95. package/{chunk-7BSQK2UC.js → chunk-WRCZXJ4N.js} +2 -2
  96. package/{chunk-KX6LPG7W.js → chunk-WYJTNSVL.js} +9 -9
  97. package/{chunk-H4KACZMG.js → chunk-XZIW3Q5B.js} +271 -138
  98. package/chunk-Y5GCAMGP.js +9 -0
  99. package/{chunk-JZX2XLKC.js → chunk-YCRROBDY.js} +1 -1
  100. package/{chunk-FPWT3RH2.js → chunk-YN5DT4JS.js} +22 -22
  101. package/{chunk-SCJD2PNK.js → chunk-YPG7TUQD.js} +3 -3
  102. package/{chunk-EJU23ST5.js → chunk-ZKVS36H3.js} +5069 -3730
  103. package/{chunk-YANF2RR4.js → chunk-ZPKUJROL.js} +1 -1
  104. package/{chunk-TYND6RDQ.js → chunk-ZZDVBZOP.js} +74 -3
  105. package/{commandRegistry-OUBQIF62.js → commandRegistry-DR2RPWK6.js} +88 -96
  106. package/{contentThunks-B3FRQGP7.js → contentThunks-CSJDJDEJ.js} +21 -21
  107. package/{createAgentAutomationAction-T2YFJ6MY.js → createAgentAutomationAction-ISEUEQSY.js} +21 -21
  108. package/{createDialogAction-2NFGFBXW.js → createDialogAction-HUCFOZY3.js} +25 -25
  109. package/{createPageAction-LDAVZDN7.js → createPageAction-DT5CYXCL.js} +24 -25
  110. package/{dbSlice-5QGKMQLO.js → dbSlice-6PVPY44C.js} +7 -7
  111. package/{deleteFile-EW6QNRRT.js → deleteFile-YM6NDPAR.js} +5 -5
  112. package/{dialogCommands-ZLBEAQHE.js → dialogCommands-3W6AIUXT.js} +35 -32
  113. package/{dialogSlice-64S3J6CP.js → dialogSlice-WJEEPG4W.js} +20 -20
  114. package/{dist-NJC2W7I4.js → dist-Q2JSMAKA.js} +7 -361
  115. package/{docCreateCommands-XOG5BBFQ.js → docCreateCommands-KQHQNLRX.js} +32 -30
  116. package/{docDeleteCommands-NCW3BBRX.js → docDeleteCommands-O3DWFX2W.js} +33 -31
  117. package/{docReadCommands-OT7X44Y3.js → docReadCommands-2U2BUONC.js} +32 -30
  118. package/{docStore-NIP7OO4I.js → docStore-7JPYT25V.js} +8 -8
  119. package/{docUpdateCommands-JW7OWW2J.js → docUpdateCommands-MF3C52XI.js} +32 -30
  120. package/{getPricing-TX35D7PI.js → getPricing-XQ3N3RBP.js} +2 -2
  121. package/{handleSendMessageAction-TOKA7ED7.js → handleSendMessageAction-BV5FMID4.js} +43 -39
  122. package/index.js +8 -8
  123. package/{localRuntimeAdapter-EQM6LFYC.js → localRuntimeAdapter-6FBEJJ4D.js} +70 -69
  124. package/{localRuntimeAuthority-JDAD7CB6.js → localRuntimeAuthority-BPN5OAQG.js} +2 -2
  125. package/{localRuntimeDb-CVC62PM5.js → localRuntimeDb-QIVAXMUL.js} +1 -1
  126. package/{machineCommands-WJ7FZ67T.js → machineCommands-WCAFDI5N.js} +80 -79
  127. package/{machineWsRunDispatch-BQT4DEA2.js → machineWsRunDispatch-ZF6BBQ3X.js} +70 -71
  128. package/{memberThunks-KRV5YXOB.js → memberThunks-AZINUM4S.js} +10 -10
  129. package/package.json +6 -2
  130. package/{profileConfig-ZGOFORWV.js → profileConfig-KN3N2BLF.js} +7 -1
  131. package/{providerPresetApply-CRZFMQD5.js → providerPresetApply-PKUOHQJT.js} +5 -5
  132. package/{providerRegistry-7IS43D3X.js → providerRegistry-HNQLIFN2.js} +5 -5
  133. package/{read-5KAZHHDM.js → read-7JPIWRBQ.js} +5 -5
  134. package/{readDocTool-5QO34OSX.js → readDocTool-AAQTB2Y3.js} +1 -1
  135. package/{readlineWorkspace-JHJSU5DS.js → readlineWorkspace-I5MHMEUE.js} +375 -200
  136. package/{removeDialogAgentAction-6X63HMI3.js → removeDialogAgentAction-RMVRILLK.js} +9 -9
  137. package/{runAgentClientLoop-5QIGEALK.js → runAgentClientLoop-TSNSRQEP.js} +59 -54
  138. package/{runtimeDoctorCommands-56NWKNON.js → runtimeDoctorCommands-MMCP4B4U.js} +12 -12
  139. package/{secretCommands-ZXZRLR3R.js → secretCommands-DNY56NSU.js} +11 -1
  140. package/{setDialogExtraReferencesAction-4MAYKKYW.js → setDialogExtraReferencesAction-L3V7JTMG.js} +8 -8
  141. package/{setPrimaryDialogAgentAction-EGBAMREH.js → setPrimaryDialogAgentAction-X52JQGTJ.js} +9 -9
  142. package/settingThunks-N6XFWPOU.js +923 -0
  143. package/{spaceCommands-ZWDPTURU.js → spaceCommands-NDPGHDMD.js} +29 -27
  144. package/{streamAgentChatTurn-456DWXNY.js → streamAgentChatTurn-RJLDV4WZ.js} +154 -95
  145. package/{switchDialogAgentAction-YBKTD6DO.js → switchDialogAgentAction-ZJ5CGU7J.js} +7 -7
  146. package/{tableCommands-U3QDY4L6.js → tableCommands-IVC5S7Y3.js} +11 -11
  147. package/{toolApiClient-7WSJJJBV.js → toolApiClient-HGNO53TC.js} +2 -2
  148. package/{tools-IWNXKK4Y.js → tools-X6QNIYFJ.js} +43 -44
  149. package/{tuiSummaryLlmCaller-KLK6K3Q3.js → tuiSummaryLlmCaller-FESHBDTT.js} +7 -7
  150. package/{updateCommands-NQXAGFM7.js → updateCommands-FJHGWD3Q.js} +5 -3
  151. package/{updateDialogTitleAction-SX53FZWO.js → updateDialogTitleAction-6LURCTMG.js} +21 -21
  152. package/{workloadLifecycle-36DXRZKU.js → workloadLifecycle-6O6PMISX.js} +2 -2
  153. package/chunk-IA7TRNNR.js +0 -11
  154. package/chunk-UKZX3NHN.js +0 -48
  155. package/chunk-VAZHH6FO.js +0 -7012
  156. package/chunk-W4S6OTSC.js +0 -35
  157. package/clipboardy-GCO3GT3I.js +0 -11793
  158. package/settingThunks-FTDRZNSJ.js +0 -1371
  159. package/{agentGrantCommands-HOJ3JBBQ.js → agentGrantCommands-5DPHYEKP.js} +3 -3
  160. package/{chromeOpsCommands-3Z34RKSE.js → chromeOpsCommands-GZVVK7HU.js} +4 -4
  161. package/{chunk-XETG4RIX.js → chunk-AETZ7AD6.js} +4 -4
  162. package/{chunk-2IXDJNZI.js → chunk-GAGGEA7D.js} +3 -3
  163. package/{memoryCommands-CUNBFRVS.js → memoryCommands-ZS3VQJAL.js} +3 -3
  164. package/{offlineMarxistsAgentCommand-2QTHJCHV.js → offlineMarxistsAgentCommand-3GLX4QQY.js} +3 -3
@@ -9,16 +9,19 @@ import {
9
9
  resolveRawAgentInput,
10
10
  resolveServerUrl,
11
11
  writeUsage
12
- } from "./chunk-KOB75UNU.js";
12
+ } from "./chunk-FHG46N5C.js";
13
13
  import {
14
14
  getReadableCliDb
15
- } from "./chunk-P5QACQDK.js";
15
+ } from "./chunk-62TBKWTV.js";
16
16
  import {
17
+ INSTABOX_RUN_CONFIG_ENV,
17
18
  createCliLocalRuntimeAdapter,
18
19
  detectCurrentMachineId,
20
+ hashInstaboxDeliveryManifest,
19
21
  isBuiltinNoloAgentRef,
20
22
  isCliProviderAgentConfig,
21
23
  isDockerRuntimeKey,
24
+ isInstaboxBillingPolicy,
22
25
  isLiveAgentRunObservation,
23
26
  isMachineBoundLocalhostCustomProvider,
24
27
  isSubtaskRun,
@@ -26,8 +29,9 @@ import {
26
29
  resolveAuthToken as resolveAuthToken2,
27
30
  resolveBoundMachineId,
28
31
  resolveFileWriteGateEnabled,
29
- resolveLocalUserId
30
- } from "./chunk-EJU23ST5.js";
32
+ resolveLocalUserId,
33
+ validateInstaboxWorkspaceSelection
34
+ } from "./chunk-ZKVS36H3.js";
31
35
  import {
32
36
  clearCredentialAvailability,
33
37
  readCredentialEntry,
@@ -39,7 +43,7 @@ import {
39
43
  t,
40
44
  toolLabel,
41
45
  toolLabelVariants
42
- } from "./chunk-SW4S4XYB.js";
46
+ } from "./chunk-2AB2HA4M.js";
43
47
  import {
44
48
  _appendEntityBatch,
45
49
  _appendEvidenceBatch,
@@ -54,10 +58,13 @@ import {
54
58
  loadMemoryVNextCatalog,
55
59
  putMemoryEvidenceVNext
56
60
  } from "./chunk-TY3TIUJK.js";
61
+ import {
62
+ parsePositiveFiniteNumberOrFallback
63
+ } from "./chunk-Y5GCAMGP.js";
57
64
  import {
58
65
  readDbRecord,
59
66
  resolveAgentRecordFromHybridStore
60
- } from "./chunk-HKT6QXP3.js";
67
+ } from "./chunk-5IKRTRRR.js";
61
68
  import {
62
69
  isLocalCliAgentKey
63
70
  } from "./chunk-NBTY7YJF.js";
@@ -72,49 +79,46 @@ import {
72
79
  } from "./chunk-BMQ2MJUK.js";
73
80
  import {
74
81
  resolveCliLocalRuntimeKeyCapability
75
- } from "./chunk-XFKZ3MCV.js";
82
+ } from "./chunk-MR3ITQEV.js";
76
83
  import {
77
84
  isTransientFetchError
78
- } from "./chunk-I2ZMGXXF.js";
85
+ } from "./chunk-KFHREHUQ.js";
79
86
  import {
80
87
  parseUiCard,
81
88
  uiCardFallback
82
- } from "./chunk-RUNKPFM5.js";
89
+ } from "./chunk-K6Y5T4GE.js";
83
90
  import {
84
91
  isGatewayHttpStatus
85
92
  } from "./chunk-NF64D32W.js";
86
- import {
87
- parsePositiveFiniteNumberOrFallback
88
- } from "./chunk-XPWGOTBQ.js";
89
93
  import {
90
94
  buildMemorySubjectsForAgent,
91
95
  chooseMemoryOwners,
92
96
  loadMemoryCandidatesFromDb,
93
97
  resolveAgentMemoryPolicy
94
- } from "./chunk-7A4LJCDR.js";
98
+ } from "./chunk-B3ZIFOFI.js";
95
99
  import {
96
100
  API_REPORTED_COST_MULTIPLIER,
97
- parseUiAskChoiceContent
98
- } from "./chunk-H4KACZMG.js";
101
+ estimateMessagesTokens,
102
+ parseUiAskChoiceContent,
103
+ resolveAgentContextWindow,
104
+ resolveOccupancy,
105
+ resolveOccupancyWindow
106
+ } from "./chunk-XZIW3Q5B.js";
99
107
  import {
100
- isOAuthApiKeyRef
101
- } from "./chunk-UKZX3NHN.js";
108
+ buildSkillDiscoveryContextLayer
109
+ } from "./chunk-AU7AXHUL.js";
102
110
  import {
103
111
  parseExternalSkillMarkdown,
104
112
  parseSkillDocProtocol
105
- } from "./chunk-XETG4RIX.js";
113
+ } from "./chunk-AETZ7AD6.js";
106
114
  import {
107
115
  LOCAL_AGENT_CONFIG_MISSING_CODE,
108
116
  LOCAL_TURN_ABORTED_CODE,
109
117
  readActionGate
110
- } from "./chunk-PEO24UB5.js";
118
+ } from "./chunk-5E5VB7PS.js";
111
119
  import {
112
- devinChannelContextWindow,
113
120
  resolveAgentRuntimeConfigFromRecord
114
- } from "./chunk-ANJTRG52.js";
115
- import {
116
- isDevinOAuthAgent
117
- } from "./chunk-5ZUL4CUO.js";
121
+ } from "./chunk-ULQAD7ZY.js";
118
122
  import {
119
123
  createThinkParserState,
120
124
  flushThinkParser,
@@ -136,11 +140,9 @@ import {
136
140
  resolveCredentialKeyWithFallback
137
141
  } from "./chunk-3MZAGMYY.js";
138
142
  import {
143
+ isOAuthApiKeyRef,
139
144
  normalizeUsage
140
- } from "./chunk-ZWG3C7VI.js";
141
- import {
142
- findModelContextWindow
143
- } from "./chunk-2MTE2PEH.js";
145
+ } from "./chunk-F3SOW2EU.js";
144
146
  import {
145
147
  clipCompactText
146
148
  } from "./chunk-5MMAK75Q.js";
@@ -151,6 +153,13 @@ import {
151
153
  normalizeRuntimeToolPolicyOverride,
152
154
  resolveEffectiveRuntimeToolPolicy
153
155
  } from "./chunk-LIQJTQRN.js";
156
+ import {
157
+ buildAgentsMdLayer,
158
+ buildMemoryOverlayLayer,
159
+ buildMemoryUseGuidanceLayer,
160
+ partitionScopedBlocks,
161
+ renderTurnContextBlocksWithScope
162
+ } from "./chunk-VEA7H5FG.js";
154
163
  import {
155
164
  BUILTIN_NOLO_AGENT_KEY,
156
165
  BUILTIN_NOLO_AGENT_NAME,
@@ -164,9 +173,6 @@ import {
164
173
  createMemoryKey,
165
174
  ulid
166
175
  } from "./chunk-5EMSBTQ6.js";
167
- import {
168
- isAntigravityOAuthAgent
169
- } from "./chunk-JGRPBIZZ.js";
170
176
  import {
171
177
  createRunActivityTracker,
172
178
  createShellApprovalChild,
@@ -176,10 +182,11 @@ import {
176
182
  recordRunResultHeaderMeta,
177
183
  resolveResultServerMeta,
178
184
  resolveRunQueuePath,
185
+ resolveRunsDir,
179
186
  serverOriginForDialog,
180
187
  settleRunTerminalAuthoritatively,
181
188
  spawnLocalBackgroundRun
182
- } from "./chunk-MM3662RS.js";
189
+ } from "./chunk-LPO6AMQU.js";
183
190
  import {
184
191
  formatAgentListCard,
185
192
  formatFinishedRunCard,
@@ -190,29 +197,14 @@ import {
190
197
  formatStopRunCard,
191
198
  isAgentRunTerminalStatus
192
199
  } from "./chunk-PJNFNEJE.js";
193
- import {
194
- estimateTokenCount
195
- } from "./chunk-PSCNXBYA.js";
196
- import {
197
- resolveClientVersion
198
- } from "./chunk-SUKSWFLP.js";
199
- import {
200
- findModelConfig
201
- } from "./chunk-TRW43TSC.js";
202
- import {
203
- asTrimmedString
204
- } from "./chunk-3EUW3WEO.js";
205
200
  import {
206
201
  isCliAuthorityBrokerProtocolError,
207
202
  isCliAuthorityBrokerTimeoutError,
208
203
  isCliAuthorityBrokerUnavailableError
209
204
  } from "./chunk-EXAJ6DCR.js";
210
- import {
211
- toErrorMessage
212
- } from "./chunk-HNMXYYJR.js";
213
205
  import {
214
206
  getDefaultCliLocalRuntimeDb
215
- } from "./chunk-FY4SDK2E.js";
207
+ } from "./chunk-FDLDMJTM.js";
216
208
  import {
217
209
  getLogger,
218
210
  normalizeError
@@ -220,13 +212,28 @@ import {
220
212
  import {
221
213
  resolveAuthToken
222
214
  } from "./chunk-A7GB5UGH.js";
223
- import {
224
- asOptionalTrimmedString
225
- } from "./chunk-G3SUCT4W.js";
226
215
  import {
227
216
  readPipeText,
228
217
  spawnProcess
229
218
  } from "./chunk-Y6ROFCZO.js";
219
+ import {
220
+ isAntigravityOAuthAgent
221
+ } from "./chunk-SQX235S2.js";
222
+ import {
223
+ resolveClientVersion
224
+ } from "./chunk-PIG2IUVZ.js";
225
+ import {
226
+ findModelConfig
227
+ } from "./chunk-6EQD4AQL.js";
228
+ import {
229
+ asTrimmedString
230
+ } from "./chunk-3EUW3WEO.js";
231
+ import {
232
+ toErrorMessage
233
+ } from "./chunk-HNMXYYJR.js";
234
+ import {
235
+ asOptionalTrimmedString
236
+ } from "./chunk-G3SUCT4W.js";
230
237
  import {
231
238
  CLIENT_VERSION_TOO_OLD_CODE,
232
239
  NOLO_CLIENT_VERSION_HEADER,
@@ -235,16 +242,148 @@ import {
235
242
  import {
236
243
  asTrimmedLowercaseString
237
244
  } from "./chunk-QSJ3HFEF.js";
238
- import {
239
- buildSkillDiscoveryContextLayer
240
- } from "./chunk-AU7AXHUL.js";
241
- import {
242
- buildAgentsMdLayer,
243
- buildMemoryOverlayLayer,
244
- buildMemoryUseGuidanceLayer,
245
- partitionScopedBlocks,
246
- renderTurnContextBlocksWithScope
247
- } from "./chunk-VEA7H5FG.js";
245
+
246
+ // packages/cli/client/instaboxRunConfigWrite.ts
247
+ import { randomUUID } from "node:crypto";
248
+ import { lstatSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
249
+ import { isAbsolute, join, normalize, resolve } from "node:path";
250
+ var InstaboxRunConfigWriteError = class extends Error {
251
+ code;
252
+ constructor(code, message) {
253
+ super(`instabox_run_config_write:${code}: ${message}`);
254
+ this.name = "InstaboxRunConfigWriteError";
255
+ this.code = `instabox_run_config_write:${code}`;
256
+ }
257
+ };
258
+ var fail = (code, msg) => {
259
+ throw new InstaboxRunConfigWriteError(code, msg);
260
+ };
261
+ function writeInstaboxRunConfig(options) {
262
+ const { workspaceMode, artifactDir, manifestPath, allowRemoteRelease } = options;
263
+ if (workspaceMode !== "empty" && workspaceMode !== "snapshot") {
264
+ fail("invalid_workspace_mode", 'workspaceMode \u5FC5\u987B\u662F "empty" \u6216 "snapshot"');
265
+ }
266
+ const trimmedArtifactDir = artifactDir?.trim();
267
+ if (!trimmedArtifactDir) {
268
+ fail("missing_artifact_dir", "artifactDir \u5FC5\u987B\u662F\u975E\u7A7A\u7EDD\u5BF9\u8DEF\u5F84\uFF0C\u672A\u914D\u7F6E\u6216\u9ED8\u8BA4\u5747\u88AB\u62D2\u7EDD");
269
+ }
270
+ if (!isAbsolute(trimmedArtifactDir) || trimmedArtifactDir.includes("\0") || trimmedArtifactDir.split("/").includes("..")) {
271
+ fail("invalid_artifact_dir", `artifactDir \u5FC5\u987B\u4E3A\u5408\u6CD5\u7684\u7EDD\u5BF9\u8DEF\u5F84\u4E14\u4E0D\u80FD\u5305\u542B .. \u6216\u7A7A\u5B57\u7B26: "${trimmedArtifactDir}"`);
272
+ }
273
+ const approvalId = `appr-${randomUUID()}`;
274
+ const bindingId = `bind-${randomUUID()}`;
275
+ const freeCreateEvidenceId = `fce-${randomUUID()}`;
276
+ const workspaceAuthorizationId = `wauth-${randomUUID()}`;
277
+ const recoverySupportId = `rcv-${randomUUID()}`;
278
+ let manifest = null;
279
+ let manifestSha256 = null;
280
+ let allowedPaths = [];
281
+ if (workspaceMode === "snapshot") {
282
+ const rawPath = manifestPath ? manifestPath.trim() : "";
283
+ if (!rawPath) {
284
+ fail("missing_manifest_path", 'workspaceMode \u4E3A "snapshot" \u65F6\u5FC5\u987B\u63D0\u4F9B manifest \u6587\u4EF6\u8DEF\u5F84');
285
+ }
286
+ const resolvedManifestPath = resolve(rawPath);
287
+ let rawText = "";
288
+ try {
289
+ const reader = options.readTextFile ?? ((p) => readFileSync(p, "utf8"));
290
+ rawText = reader(resolvedManifestPath);
291
+ } catch (err) {
292
+ fail(
293
+ "manifest_read_failed",
294
+ `\u8BFB\u53D6 manifest \u6587\u4EF6\u5931\u8D25: ${err instanceof Error ? err.message : String(err)}`
295
+ );
296
+ }
297
+ let parsedManifest;
298
+ try {
299
+ parsedManifest = JSON.parse(rawText);
300
+ } catch (err) {
301
+ fail(
302
+ "invalid_manifest_json",
303
+ `manifest \u6587\u4EF6 JSON \u89E3\u6790\u5931\u8D25: ${err instanceof Error ? err.message : String(err)}`
304
+ );
305
+ }
306
+ try {
307
+ manifestSha256 = hashInstaboxDeliveryManifest(parsedManifest);
308
+ validateInstaboxWorkspaceSelection({
309
+ workspaceMode: "approved-snapshot",
310
+ manifest: parsedManifest,
311
+ approval: {
312
+ id: approvalId,
313
+ manifestSha256
314
+ }
315
+ });
316
+ } catch (err) {
317
+ fail(
318
+ "invalid_manifest_selection",
319
+ `manifest \u6821\u9A8C\u672A\u901A\u8FC7: ${err instanceof Error ? err.message : String(err)}`
320
+ );
321
+ }
322
+ manifest = parsedManifest;
323
+ allowedPaths = parsedManifest.files.map((f) => f.path);
324
+ } else {
325
+ if (manifestPath && manifestPath.trim()) {
326
+ fail("unexpected_manifest", 'workspaceMode \u4E3A "empty" \u65F6\u4E0D\u5F97\u63D0\u4F9B manifest');
327
+ }
328
+ }
329
+ const rawBillingPolicy = options.billingPolicy ?? (options.allowPaid ? "allow-paid" : "free-only");
330
+ if (!isInstaboxBillingPolicy(rawBillingPolicy)) {
331
+ fail("invalid_billing_policy", `billingPolicy \u5FC5\u987B\u4E3A "free-only" \u6216 "allow-paid"\uFF0C\u6536\u5230 "${rawBillingPolicy}"`);
332
+ }
333
+ const billingPolicy = rawBillingPolicy;
334
+ const env = options.env ?? process.env;
335
+ const isPaid = options.isPaidAccount === true || options.account?.isPaid === true || options.account?.kind === "paid" || options.account?.accountKind === "paid" || env?.INSTABOX_ACCOUNT_KIND === "paid" || env?.INSTABOX_ACCOUNT_TYPE === "paid" || env?.INSTABOX_PAID_ACCOUNT === "true" || env?.INSTABOX_PAID_ACCOUNT === "1";
336
+ if (isPaid && billingPolicy !== "allow-paid") {
337
+ fail("paid_account_disallowed", "\u4ED8\u8D39 Instabox \u8D26\u53F7\u9700\u663E\u5F0F --instabox-allow-paid");
338
+ }
339
+ const config = {
340
+ bindingId,
341
+ freeCreateEvidenceId,
342
+ workspaceAuthorizationId,
343
+ recoverySupportId,
344
+ workspaceMode: workspaceMode === "snapshot" ? "approved-snapshot" : "empty",
345
+ billingPolicy,
346
+ approvalId,
347
+ artifactRoot: trimmedArtifactDir,
348
+ allowRemoteRelease: Boolean(allowRemoteRelease),
349
+ allowedPaths
350
+ };
351
+ if (workspaceMode === "snapshot" && manifest && manifestSha256) {
352
+ config.manifest = manifest;
353
+ config.manifestSha256 = manifestSha256;
354
+ }
355
+ const runsDir = options.runsDir ?? resolveRunsDir(env);
356
+ const normalizedRunsDir = normalize(resolve(runsDir));
357
+ try {
358
+ mkdirSync(normalizedRunsDir, { recursive: true, mode: 448 });
359
+ } catch (err) {
360
+ fail("mkdir_failed", `\u521B\u5EFA runs \u76EE\u5F55\u5931\u8D25: ${err instanceof Error ? err.message : String(err)}`);
361
+ }
362
+ const fileName = `instabox-run-${randomUUID()}.json`;
363
+ const targetPath = join(normalizedRunsDir, fileName);
364
+ try {
365
+ writeFileSync(targetPath, JSON.stringify(config, null, 2), {
366
+ flag: "wx",
367
+ mode: 384
368
+ });
369
+ } catch (err) {
370
+ fail("file_write_failed", `\u72EC\u5360\u521B\u5EFA\u53D7\u63A7\u914D\u7F6E\u6587\u4EF6\u5931\u8D25: ${err instanceof Error ? err.message : String(err)}`);
371
+ }
372
+ try {
373
+ const stats = lstatSync(targetPath);
374
+ if (stats.isSymbolicLink() || !stats.isFile()) {
375
+ fail("symlink_rejected", `\u914D\u7F6E\u6587\u4EF6\u4E0D\u80FD\u662F\u7B26\u53F7\u94FE\u63A5\u6216\u975E\u5E38\u89C4\u6587\u4EF6: ${targetPath}`);
376
+ }
377
+ } catch (err) {
378
+ if (err instanceof InstaboxRunConfigWriteError) throw err;
379
+ fail("file_stat_failed", `\u68C0\u9A8C\u914D\u7F6E\u6587\u4EF6\u72B6\u6001\u5931\u8D25: ${err instanceof Error ? err.message : String(err)}`);
380
+ }
381
+ process.env[INSTABOX_RUN_CONFIG_ENV] = targetPath;
382
+ if (options.env) {
383
+ options.env[INSTABOX_RUN_CONFIG_ENV] = targetPath;
384
+ }
385
+ return { configPath: targetPath, config };
386
+ }
248
387
 
249
388
  // packages/agent-runtime/modelLayerOverride.ts
250
389
  var MODEL_LAYER_KEYS = [
@@ -434,40 +573,6 @@ ${cardText}` : cardText;
434
573
  // packages/chat/messages/attachmentWriteRollout.ts
435
574
  var ENABLE_REMOTE_ATTACHMENT_PART_WRITES = false;
436
575
 
437
- // packages/ai/context/contextOccupancy.ts
438
- function estimateMessagesTokens(messages) {
439
- return messages.reduce((total, message) => {
440
- const content = typeof message.content === "string" ? message.content : message.content == null ? "" : JSON.stringify(message.content);
441
- return total + estimateTokenCount(content) + 4;
442
- }, 0);
443
- }
444
- function historyTokensBeforeLatestAssistant(messages) {
445
- const total = estimateMessagesTokens(messages);
446
- const latest = messages[messages.length - 1];
447
- if (latest?.role !== "assistant") return total;
448
- return Math.max(0, total - estimateMessagesTokens([latest]));
449
- }
450
- function resolveOccupancy(input) {
451
- if (input.authoritativeInput !== void 0 && input.authoritativeInput > 0) {
452
- const generated = Math.max(0, input.generatedSinceAuthority ?? 0);
453
- return {
454
- tokens: input.authoritativeInput + generated,
455
- estimated: generated > 0
456
- };
457
- }
458
- return {
459
- tokens: Math.max(0, input.baselineEstimate ?? 0),
460
- estimated: true
461
- };
462
- }
463
- function resolveOccupancyWindow(ref) {
464
- if (!ref.model) return void 0;
465
- if (isDevinOAuthAgent(ref)) {
466
- return devinChannelContextWindow(ref.model) ?? findModelContextWindow(ref.model, ref.provider);
467
- }
468
- return findModelContextWindow(ref.model, ref.provider);
469
- }
470
-
471
576
  // packages/cli/client/tokenUsage.ts
472
577
  var PLATFORM_CREDIT_UNIT = "credits";
473
578
  var isUsableModelId = (model) => {
@@ -491,34 +596,10 @@ function resolveAgentModelIdentity(opts) {
491
596
  ...model ? { model } : {}
492
597
  };
493
598
  }
494
- function resolveAgentContextWindow(opts) {
599
+ function resolveAgentContextWindow2(opts) {
495
600
  const model = resolveEffectiveModel(opts);
496
601
  if (model) return resolveContextWindow(model);
497
- const byName = opts.agentName?.trim() ? resolveOccupancyWindow({ model: opts.agentName }) : void 0;
498
- if (byName !== void 0) return byName;
499
- const candidates = [
500
- ...modelSlugCandidates(opts.agentKey, 2),
501
- ...modelSlugCandidates(opts.agentName, 1)
502
- ];
503
- for (const candidate of candidates) {
504
- const window = resolveOccupancyWindow({ model: candidate });
505
- if (window !== void 0) return window;
506
- }
507
- return void 0;
508
- }
509
- var AGENT_KEY_PREFIX = /^agent-[a-z0-9]+-/i;
510
- function modelSlugCandidates(source, maxDrop) {
511
- const raw = source?.trim();
512
- if (!raw) return [];
513
- const base = raw.replace(/\s+/g, "-").toLowerCase();
514
- const seed = base.replace(AGENT_KEY_PREFIX, "");
515
- const out = [seed];
516
- if (seed !== base) out.push(base);
517
- const segments = seed.split("-");
518
- for (let drop = 1; drop <= maxDrop && drop < segments.length; drop++) {
519
- out.push(segments.slice(drop).join("-"));
520
- }
521
- return [...new Set(out.filter(Boolean))];
602
+ return resolveAgentContextWindow(opts);
522
603
  }
523
604
  var PROVIDER_LOOKUP_ORDER = [
524
605
  "openrouter",
@@ -11204,6 +11285,51 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
11204
11285
  return null;
11205
11286
  }
11206
11287
 
11288
+ // packages/cli/idleHeapRelease.ts
11289
+ var IDLE_HEAP_RELEASE_DELAY_MS = 2e3;
11290
+ function releaseHeapPages(options = {}) {
11291
+ const env = options.env ?? process.env;
11292
+ if (env.NOLO_TUI_IDLE_HEAP_RELEASE === "0") return;
11293
+ const bun = "bun" in options ? options.bun : globalThis.Bun;
11294
+ if (typeof bun?.gc !== "function" || typeof bun?.shrink !== "function") return;
11295
+ try {
11296
+ bun.gc(true);
11297
+ bun.shrink();
11298
+ } catch {
11299
+ }
11300
+ }
11301
+ function createIdleHeapReleaser(options = {}) {
11302
+ const env = options.env ?? process.env;
11303
+ const bun = "bun" in options ? options.bun : globalThis.Bun;
11304
+ const disabled = env.NOLO_TUI_IDLE_HEAP_RELEASE === "0" || typeof bun?.gc !== "function" || typeof bun?.shrink !== "function";
11305
+ if (disabled) return { schedule() {
11306
+ }, cancel() {
11307
+ } };
11308
+ const delayMs = options.delayMs ?? IDLE_HEAP_RELEASE_DELAY_MS;
11309
+ const setTimer = options.setTimer ?? ((fn, ms) => {
11310
+ const handle = setTimeout(fn, ms);
11311
+ handle.unref?.();
11312
+ return handle;
11313
+ });
11314
+ const clearTimer = options.clearTimer ?? ((handle) => clearTimeout(handle));
11315
+ let pending = null;
11316
+ const release = () => {
11317
+ pending = null;
11318
+ releaseHeapPages({ env, bun });
11319
+ };
11320
+ return {
11321
+ schedule() {
11322
+ if (pending !== null) clearTimer(pending);
11323
+ pending = setTimer(release, delayMs);
11324
+ },
11325
+ cancel() {
11326
+ if (pending === null) return;
11327
+ clearTimer(pending);
11328
+ pending = null;
11329
+ }
11330
+ };
11331
+ }
11332
+
11207
11333
  // packages/cli/client/agentRun.ts
11208
11334
  import { ulid as ulid2 } from "ulid";
11209
11335
 
@@ -11245,7 +11371,7 @@ function isBalanceExhaustedError(error) {
11245
11371
 
11246
11372
  // packages/cli/client/agentRun.ts
11247
11373
  async function loadRunLocalAgentTurn() {
11248
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-O5GDAFTN.js");
11374
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-J6I63NZC.js");
11249
11375
  return runLocalAgentTurn;
11250
11376
  }
11251
11377
  var stripDebugNoise = (s) => s.replace(/\s*raw="[\s\S]*"/g, "").replace(/\s*raw=\S+/g, "").replace(/\s*headers=\[[^\]]*\]/g, "").replace(/\s*headers=\S+/g, "").trim();
@@ -11342,7 +11468,8 @@ function buildDefaultLocalRuntimeAdapter(options) {
11342
11468
  // runtimeKey 接线:不传下去则本地 run 的 runtimeKey 在 agentRun 层就断了
11343
11469
  // ——adapter 收不到 → docker workload 永不创建,非 docker 云后端也不会
11344
11470
  // fail-closed(死代码)。
11345
- ...options.runtimeKey ? { runtimeKey: options.runtimeKey } : {}
11471
+ ...options.runtimeKey ? { runtimeKey: options.runtimeKey } : {},
11472
+ ...options.dockerWorkspaceMode ? { dockerWorkspaceMode: options.dockerWorkspaceMode } : {}
11346
11473
  });
11347
11474
  }
11348
11475
  function resolveLocalRuntimeAdapter(options) {
@@ -11350,7 +11477,8 @@ function resolveLocalRuntimeAdapter(options) {
11350
11477
  cwd: options.localRuntimeCwd,
11351
11478
  // 与 buildDefaultLocalRuntimeAdapter 同口径:注入式 factory 也必须拿到
11352
11479
  // runtimeKey,否则注入了 adapter 的本地 run 会静默丢掉 docker 语义。
11353
- ...options.runtimeKey ? { runtimeKey: options.runtimeKey } : {}
11480
+ ...options.runtimeKey ? { runtimeKey: options.runtimeKey } : {},
11481
+ ...options.dockerWorkspaceMode ? { dockerWorkspaceMode: options.dockerWorkspaceMode } : {}
11354
11482
  }) || buildDefaultLocalRuntimeAdapter(options);
11355
11483
  }
11356
11484
  function wrapAdapterEphemeral(adapter) {
@@ -12247,6 +12375,24 @@ async function runLocalAgentTurnForCli(options, settings) {
12247
12375
  }
12248
12376
  }
12249
12377
  async function runLocalAgentTurnForCliWithAdapter(options, settings, resolvedBaseAdapter) {
12378
+ try {
12379
+ return await executeLocalAgentTurnForCliWithAdapter(
12380
+ options,
12381
+ settings,
12382
+ resolvedBaseAdapter
12383
+ );
12384
+ } finally {
12385
+ try {
12386
+ if (typeof options.releaseHeapPages === "function") {
12387
+ options.releaseHeapPages();
12388
+ } else {
12389
+ releaseHeapPages({ env: options.env });
12390
+ }
12391
+ } catch {
12392
+ }
12393
+ }
12394
+ }
12395
+ async function executeLocalAgentTurnForCliWithAdapter(options, settings, resolvedBaseAdapter) {
12250
12396
  const baseAdapter = (() => {
12251
12397
  let adapter2 = resolvedBaseAdapter && options.modelOverride ? wrapLoadAgentConfigWithModelOverride(
12252
12398
  resolvedBaseAdapter,
@@ -12341,6 +12487,9 @@ async function runLocalAgentTurnForCliWithAdapter(options, settings, resolvedBas
12341
12487
  parentDialogId: options.parentDialogId,
12342
12488
  runtimeContext: runtimeContextWithOwnership,
12343
12489
  runKind: options.env.NOLO_AGENT_RUN_CHILD === "1" ? "subtask" : "interactive",
12490
+ // 展示能力由宿主声明(TUI=narrow),非交互 CLI/后台留空 → unknown;
12491
+ // 排版段只在能力已知时由 localLoop 注入,server 线不读该字段。
12492
+ ...options.responseViewport ? { responseViewport: options.responseViewport } : {},
12344
12493
  background: options.background,
12345
12494
  noStream: options.noStream,
12346
12495
  ...options.contextBlockScopes?.length ? { contextBlockScopes: options.contextBlockScopes } : options.extraContextBlocks?.length ? { contextBlocks: options.extraContextBlocks } : {},
@@ -12726,7 +12875,7 @@ import * as nodeFs from "node:fs";
12726
12875
  var CLI_AUTO_ROUTE_AGENT_KEY = BUILTIN_NOLO_AGENT_KEY;
12727
12876
 
12728
12877
  // packages/agent-runtime/hostEnvironment.ts
12729
- import { existsSync, readFileSync } from "node:fs";
12878
+ import { existsSync, readFileSync as readFileSync2 } from "node:fs";
12730
12879
  import os from "node:os";
12731
12880
  function parseLinuxOsRelease(content) {
12732
12881
  let prettyName;
@@ -12765,9 +12914,9 @@ function probeHostEnvironment(options) {
12765
12914
  if (osReleaseText === void 0) {
12766
12915
  try {
12767
12916
  if (existsSync("/etc/os-release")) {
12768
- osReleaseText = readFileSync("/etc/os-release", "utf8");
12917
+ osReleaseText = readFileSync2("/etc/os-release", "utf8");
12769
12918
  } else if (existsSync("/usr/lib/os-release")) {
12770
- osReleaseText = readFileSync("/usr/lib/os-release", "utf8");
12919
+ osReleaseText = readFileSync2("/usr/lib/os-release", "utf8");
12771
12920
  }
12772
12921
  } catch {
12773
12922
  }
@@ -12833,16 +12982,16 @@ function buildHostEnvironmentLayer(options) {
12833
12982
  }
12834
12983
 
12835
12984
  // packages/agent-runtime/agentsMd.ts
12836
- import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
12837
- import { join } from "node:path";
12985
+ import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
12986
+ import { join as join2 } from "node:path";
12838
12987
  var AGENTS_MD_MAX_BYTES = 8192;
12839
12988
  var AGENTS_MD_CANDIDATES = ["AGENTS.md", "CLAUDE.md"];
12840
12989
  function readAgentsMdLayerFromDisk(cwd) {
12841
12990
  for (const name of AGENTS_MD_CANDIDATES) {
12842
- const filePath = join(cwd, name);
12991
+ const filePath = join2(cwd, name);
12843
12992
  if (!existsSync2(filePath)) continue;
12844
12993
  try {
12845
- let content = readFileSync2(filePath, "utf8").trim();
12994
+ let content = readFileSync3(filePath, "utf8").trim();
12846
12995
  if (!content) continue;
12847
12996
  if (Buffer.byteLength(content, "utf8") > AGENTS_MD_MAX_BYTES) {
12848
12997
  content = Buffer.from(content, "utf8").subarray(0, AGENTS_MD_MAX_BYTES).toString("utf8") + "\n\n<!-- AGENTS.md truncated -->";
@@ -12912,17 +13061,17 @@ function runDoDCommands(commands, cwd, deps = {}) {
12912
13061
  }
12913
13062
 
12914
13063
  // packages/cli/agentRunPrompts.ts
12915
- import { existsSync as existsSync3, readFileSync as readFileSync3, readdirSync, statSync as statSync2 } from "node:fs";
12916
- import { dirname, extname, isAbsolute, join as join2, relative as relativePath, resolve, sep } from "node:path";
13064
+ import { existsSync as existsSync3, readFileSync as readFileSync4, readdirSync, statSync as statSync2 } from "node:fs";
13065
+ import { dirname, extname, isAbsolute as isAbsolute2, join as join3, relative as relativePath, resolve as resolve2, sep } from "node:path";
12917
13066
  function workflowRefToCandidatePath(cwd, ref) {
12918
13067
  const normalized = ref.trim();
12919
13068
  if (!normalized) return "";
12920
13069
  if (normalized.endsWith(".md") || normalized.includes("/") || normalized.includes("\\")) {
12921
- const directPath = resolve(cwd, normalized);
13070
+ const directPath = resolve2(cwd, normalized);
12922
13071
  if (existsSync3(directPath)) return directPath;
12923
13072
  }
12924
13073
  const fileName = normalized.replace(/[^a-zA-Z0-9一-鿿]+/g, "-").replace(/^-+|-+$/g, "");
12925
- return resolve(cwd, "docs", "workflows", `${fileName}.md`);
13074
+ return resolve2(cwd, "docs", "workflows", `${fileName}.md`);
12926
13075
  }
12927
13076
  var SKILL_SEARCH_DIRS = [
12928
13077
  ".agents/skills"
@@ -12931,22 +13080,22 @@ function skillRefToCandidatePath(cwd, ref) {
12931
13080
  const normalized = ref.trim();
12932
13081
  if (!normalized) return "";
12933
13082
  if (normalized.endsWith(".md") || normalized.includes("/") || normalized.includes("\\")) {
12934
- const directPath = resolve(cwd, normalized);
13083
+ const directPath = resolve2(cwd, normalized);
12935
13084
  if (existsSync3(directPath)) return directPath;
12936
13085
  }
12937
13086
  const fileName = normalized.replace(/[^a-zA-Z0-9一-鿿]+/g, "-").replace(/^-+|-+$/g, "");
12938
13087
  for (const dir of SKILL_SEARCH_DIRS) {
12939
- const skillMdPath = resolve(cwd, dir, fileName, "SKILL.md");
13088
+ const skillMdPath = resolve2(cwd, dir, fileName, "SKILL.md");
12940
13089
  if (existsSync3(skillMdPath)) return skillMdPath;
12941
13090
  }
12942
- return resolve(cwd, ".agents", "skills", fileName, "SKILL.md");
13091
+ return resolve2(cwd, ".agents", "skills", fileName, "SKILL.md");
12943
13092
  }
12944
13093
  async function resolveWorkflowReference(ref, cwd = process.cwd()) {
12945
13094
  const path2 = workflowRefToCandidatePath(cwd, ref);
12946
13095
  if (!path2 || !existsSync3(path2)) {
12947
13096
  throw new Error(`Workflow reference not found: ${ref}`);
12948
13097
  }
12949
- const markdown = readFileSync3(path2, "utf8");
13098
+ const markdown = readFileSync4(path2, "utf8");
12950
13099
  const parsed = parseSkillDocProtocol(markdown);
12951
13100
  return {
12952
13101
  ref,
@@ -12956,15 +13105,15 @@ async function resolveWorkflowReference(ref, cwd = process.cwd()) {
12956
13105
  }
12957
13106
  function inlineRelativeRefs(body, skillDir) {
12958
13107
  const refPattern = /\[([^\]]+)\]\((\.\/[^)]+|[^)]+\/[^)]+)\)/g;
12959
- const normalizedSkillDir = resolve(skillDir) + sep;
13108
+ const normalizedSkillDir = resolve2(skillDir) + sep;
12960
13109
  return body.replace(refPattern, (match, label, relPath) => {
12961
13110
  const cleaned = relPath.trim();
12962
13111
  if (!cleaned.startsWith("./") && !cleaned.startsWith("../")) return match;
12963
- const absPath = resolve(skillDir, cleaned);
13112
+ const absPath = resolve2(skillDir, cleaned);
12964
13113
  const relative = relativePath(normalizedSkillDir, absPath);
12965
- if (relative.startsWith("..") || isAbsolute(relative)) return match;
13114
+ if (relative.startsWith("..") || isAbsolute2(relative)) return match;
12966
13115
  if (!existsSync3(absPath) || !absPath.endsWith(".md")) return match;
12967
- const refContent = readFileSync3(absPath, "utf8");
13116
+ const refContent = readFileSync4(absPath, "utf8");
12968
13117
  return `
12969
13118
 
12970
13119
  ### ${label}
@@ -12975,7 +13124,7 @@ ${refContent}
12975
13124
  });
12976
13125
  }
12977
13126
  function listSkillScripts(skillDir) {
12978
- const scriptsDir = join2(skillDir, "scripts");
13127
+ const scriptsDir = join3(skillDir, "scripts");
12979
13128
  if (!existsSync3(scriptsDir) || !statSync2(scriptsDir).isDirectory()) return null;
12980
13129
  const entries = readdirSync(scriptsDir).filter((e) => !e.startsWith("."));
12981
13130
  if (entries.length === 0) return null;
@@ -13006,7 +13155,7 @@ async function resolveSkillReference(ref, options = {}) {
13006
13155
  if (!path2 || !existsSync3(path2)) {
13007
13156
  throw new Error(`Skill reference not found: ${ref}`);
13008
13157
  }
13009
- markdown = readFileSync3(path2, "utf8");
13158
+ markdown = readFileSync4(path2, "utf8");
13010
13159
  filePath = path2;
13011
13160
  skillDir = dirname(path2);
13012
13161
  }
@@ -13110,9 +13259,9 @@ function prependSubjectDialogMarker(message, subjectDialogKey) {
13110
13259
  }
13111
13260
  function normalizeCliImageInput(input) {
13112
13261
  if (/^(https?:|data:|file:)/i.test(input)) return input;
13113
- const absolutePath = resolve(input);
13262
+ const absolutePath = resolve2(input);
13114
13263
  if (!existsSync3(absolutePath)) return input;
13115
- const base64 = readFileSync3(absolutePath).toString("base64");
13264
+ const base64 = readFileSync4(absolutePath).toString("base64");
13116
13265
  return `data:${imageMimeTypeForPath(absolutePath)};base64,${base64}`;
13117
13266
  }
13118
13267
  function imageMimeTypeForPath(path2) {
@@ -15656,6 +15805,22 @@ async function runAgentRunCommand(args, deps) {
15656
15805
  if (!localRuntimeCwd && (parsed.runtimeMode === "local" || hostRuntimeLocal)) {
15657
15806
  localRuntimeCwd = process.cwd();
15658
15807
  }
15808
+ if (parsed.runtimeKey === "instabox") {
15809
+ try {
15810
+ writeInstaboxRunConfig({
15811
+ workspaceMode: parsed.instaboxWorkspace,
15812
+ artifactDir: parsed.instaboxArtifactDir,
15813
+ manifestPath: parsed.instaboxManifestPath,
15814
+ allowRemoteRelease: parsed.instaboxAllowRemoteRelease,
15815
+ allowPaid: parsed.instaboxAllowPaid,
15816
+ env
15817
+ });
15818
+ } catch (err) {
15819
+ output.write(`[nolo] instabox \u914D\u7F6E\u751F\u6210\u5931\u8D25: ${toErrorMessage(err)}
15820
+ `);
15821
+ return 1;
15822
+ }
15823
+ }
15659
15824
  const runEnv = buildLocalRunEnv({
15660
15825
  env,
15661
15826
  allowShell: parsed.allowShell
@@ -15770,6 +15935,12 @@ async function runAgentRunCommand(args, deps) {
15770
15935
  } } : {},
15771
15936
  agentName: targetAgentKey,
15772
15937
  agentKey: targetAgentKey,
15938
+ // 当前执行链未提供可靠的最终展示能力,按约定使用 unknown(只注入行为段,不猜
15939
+ // 宽/窄屏;`stdout.isTTY` 只说明是不是终端,说明不了宽度)。这不表示宿主永远
15940
+ // 无法获得尺寸:将来接入时应传展示能力,不应由调用方拼接准则文本。
15941
+ // 放在 buildRunOptions 这个唯一构造点上,首轮 / quota fallback / 队列 drain
15942
+ // 三处 runner(...) 调用自动一致;远端分支走 server 线,不读该字段。
15943
+ responseViewport: "unknown",
15773
15944
  serverUrl: resolveServerUrl(env),
15774
15945
  message: formatTurnMessage(turnMessage),
15775
15946
  imageUrls: parsed.imageUrls.map(normalizeCliImageInput),
@@ -15789,6 +15960,7 @@ async function runAgentRunCommand(args, deps) {
15789
15960
  // runtimeKey 与 machine-shell 的组合已在 parseAgentRunArgs 入口显式拒绝,
15790
15961
  // 这里直接透传即可(不再静默丢弃参数)。
15791
15962
  ...parsed.runtimeKey ? { runtimeKey: parsed.runtimeKey } : {},
15963
+ ...parsed.dockerWorkspaceMode ? { dockerWorkspaceMode: parsed.dockerWorkspaceMode } : {},
15792
15964
  ...parsed.continueDialogId ? { continueDialogId: parsed.continueDialogId } : {},
15793
15965
  ...parsed.strictContinueHistory ? { strictContinueHistory: true } : {},
15794
15966
  ...parsed.spaceId ? { spaceId: parsed.spaceId } : {},
@@ -16059,10 +16231,8 @@ export {
16059
16231
  redactSecrets,
16060
16232
  safeAskText,
16061
16233
  TUI_TREE_MARKER,
16062
- estimateMessagesTokens,
16063
- historyTokensBeforeLatestAssistant,
16064
16234
  resolveAgentModelIdentity,
16065
- resolveAgentContextWindow,
16235
+ resolveAgentContextWindow2 as resolveAgentContextWindow,
16066
16236
  platformCreditsFromUsage,
16067
16237
  formatCreditsChip,
16068
16238
  formatTokenCount,
@@ -16070,6 +16240,7 @@ export {
16070
16240
  computeBaselineContextTokens,
16071
16241
  resolveContextUsage,
16072
16242
  renderTokenStatus,
16243
+ createIdleHeapReleaser,
16073
16244
  COLLAPSED_PASTE_PLACEHOLDER_RE,
16074
16245
  shouldCollapsePaste,
16075
16246
  createCollapsedPasteStore,