nolo-cli 0.159.0-alpha.3 → 0.160.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/{_executeModel-SHA5BWRT.js → _executeModel-3HHZYHHB.js} +38 -37
  2. package/accountResolver-55EDKEIK.js +1 -1
  3. package/action-GPPJC5TI.js +1 -1
  4. package/{addContentAction-BI6RDRTQ.js → addContentAction-XJQEJ4XW.js} +6 -6
  5. package/{addDialogAgentAction-4RJYUSIK.js → addDialogAgentAction-5WZX5CAY.js} +5 -5
  6. package/{agentDeleteCommand-VU3BA264.js → agentDeleteCommand-ON2KVSJ5.js} +55 -55
  7. package/{agentEmailCommands-WUANEGTM.js → agentEmailCommands-2QPD5VP3.js} +55 -55
  8. package/{agentListCommands-3YNO6UP4.js → agentListCommands-L33M3I6V.js} +30 -30
  9. package/{agentMachineCommands-ONGZXXQW.js → agentMachineCommands-V44DPSED.js} +25 -23
  10. package/{agentPullCommand-FA43RBRU.js → agentPullCommand-GXXEDOSA.js} +4 -4
  11. package/{agentRecordCommands-DXXA2RET.js → agentRecordCommands-CKILCNQZ.js} +49 -49
  12. package/{agentRunCommand-WY77TJ72.js → agentRunCommand-6IN7NK7H.js} +52 -52
  13. package/{agentRunControl-PPYWJRIJ.js → agentRunControl-XBSNHHZE.js} +4 -4
  14. package/{agentRuntimeLocal-NHC5DQPJ.js → agentRuntimeLocal-XCKO5FVP.js} +13 -11
  15. package/{agentSlice-MIOEV36T.js → agentSlice-YT3VCCEW.js} +6 -6
  16. package/{appDeleteCommands-VQYCXZRF.js → appDeleteCommands-2PJFNLAJ.js} +22 -20
  17. package/{appDeployCommands-OKSJDVEY.js → appDeployCommands-AZCMCMK6.js} +22 -20
  18. package/{appDeployStatusCommands-UFGNZS6G.js → appDeployStatusCommands-HSIKPVJN.js} +22 -20
  19. package/{appGetCommands-3HNO5WLF.js → appGetCommands-IUZCPAP7.js} +22 -20
  20. package/{appListCommands-H33BIZHJ.js → appListCommands-JLFVS44M.js} +22 -20
  21. package/{authCommand-MSINEFHH.js → authCommand-3Z52KJID.js} +14 -14
  22. package/{authCommands-AMNIAKEG.js → authCommands-QOCKVPX3.js} +5 -5
  23. package/{builtinSkillRegistry-H3AY27TR.js → builtinSkillRegistry-LJV7FHNI.js} +4 -4
  24. package/{chunk-MJKKEGF5.js → chunk-2XDQAWBM.js} +12 -12
  25. package/{chunk-GCLZBOB6.js → chunk-2ZYCNT2O.js} +29 -29
  26. package/{chunk-XBLZ5IFE.js → chunk-3GTVM7NJ.js} +17 -17
  27. package/{chunk-US6MKPE7.js → chunk-3L5MSPWX.js} +1 -1
  28. package/{chunk-QYAYO5JA.js → chunk-4L4K6YR7.js} +1 -1
  29. package/{chunk-P5QACQDK.js → chunk-62TBKWTV.js} +1 -1
  30. package/{chunk-YLMMECCH.js → chunk-6XIE5ZGI.js} +1 -1
  31. package/{chunk-J2ATF74A.js → chunk-BAWAKW7X.js} +1 -1
  32. package/{chunk-ZVQHBIWV.js → chunk-CDLP56BS.js} +7 -7
  33. package/{chunk-ZIGIN5IX.js → chunk-DD2EOI6S.js} +1 -1
  34. package/{chunk-OON4OBWI.js → chunk-DLV3H464.js} +7 -7
  35. package/{chunk-DWBY333O.js → chunk-DT7EWFTY.js} +5 -5
  36. package/{chunk-IRTOYSA2.js → chunk-ESMZW5PE.js} +1 -1
  37. package/{chunk-E46SJRWA.js → chunk-EVPKKBSI.js} +13 -13
  38. package/{chunk-ZJG7YU3I.js → chunk-F3SOW2EU.js} +46 -1
  39. package/{chunk-FZYTJOAQ.js → chunk-F5WASHQA.js} +27 -29
  40. package/{chunk-BFI6JGF6.js → chunk-FB5WLEOD.js} +11 -11
  41. package/{chunk-FBSDWUOJ.js → chunk-FCUKCVKN.js} +4 -4
  42. package/{chunk-FY4SDK2E.js → chunk-FDLDMJTM.js} +1 -1
  43. package/{chunk-PKC7D6SX.js → chunk-FFHV45HO.js} +3 -3
  44. package/{chunk-TMYAT2MD.js → chunk-FZYKQFBQ.js} +3 -3
  45. package/{chunk-CSCSMGQI.js → chunk-HW7EBEC5.js} +15 -191
  46. package/{chunk-5MPS5OOY.js → chunk-I7S63QUU.js} +1 -1
  47. package/{chunk-CON6SI7N.js → chunk-IF7V3CBU.js} +1 -1
  48. package/{chunk-GSKVOMBU.js → chunk-JDKSYQQN.js} +4 -4
  49. package/{chunk-RJBHRIEL.js → chunk-JSB2OPQT.js} +107 -45
  50. package/{chunk-M2P3OGXZ.js → chunk-JWEXJ573.js} +2 -2
  51. package/{chunk-NT3LMOSE.js → chunk-K25WQPP3.js} +213 -50
  52. package/{chunk-SPKLALBU.js → chunk-MAYW6V3E.js} +1 -1
  53. package/{chunk-NDZOXXIM.js → chunk-NHEWV5FD.js} +1 -1
  54. package/{chunk-NUE735UT.js → chunk-O2IWR23M.js} +1 -1
  55. package/{chunk-NNE5NIW2.js → chunk-OLVOR45M.js} +2 -2
  56. package/{chunk-CVSKYIXX.js → chunk-QXZH5UDF.js} +2 -2
  57. package/{chunk-QO436IJ5.js → chunk-QZIOZDM6.js} +9 -9
  58. package/{chunk-V4AK4IVZ.js → chunk-R2KWTENX.js} +3 -3
  59. package/{chunk-C3WXTFRP.js → chunk-RIHQGFFA.js} +1 -1
  60. package/{chunk-DC3SZCRR.js → chunk-SH3XD4E2.js} +2 -2
  61. package/{chunk-42W7LKBM.js → chunk-SNAWGDXT.js} +263 -4
  62. package/chunk-TT644UJD.js +188 -0
  63. package/{chunk-QOYJE6NX.js → chunk-U34KT53V.js} +28 -10
  64. package/{chunk-DFWLD7WU.js → chunk-ULQAD7ZY.js} +18 -6
  65. package/{chunk-ZAB4R7LU.js → chunk-UY73HNIN.js} +40 -42
  66. package/{chunk-RE5I35J7.js → chunk-VXS4YYJ2.js} +6 -6
  67. package/{chunk-JZX2XLKC.js → chunk-YCRROBDY.js} +1 -1
  68. package/{chunk-6MH6PWVJ.js → chunk-YR47Y7CN.js} +6 -6
  69. package/{chunk-C47WM5SD.js → chunk-ZAV4YVEA.js} +1 -1
  70. package/{chunk-2NROMJBM.js → chunk-ZSLIYVIQ.js} +7 -7
  71. package/{commandRegistry-DAM7RV6E.js → commandRegistry-A4OR4B4L.js} +83 -83
  72. package/{contentThunks-WLKR5KQ6.js → contentThunks-QBL5NK2W.js} +14 -15
  73. package/{createAgentAutomationAction-AI2HZHLE.js → createAgentAutomationAction-5UWBLR2N.js} +14 -15
  74. package/{createDialogAction-AU4IWDR3.js → createDialogAction-NJ2LE7KC.js} +18 -19
  75. package/{createPageAction-CAXS6ZUJ.js → createPageAction-7T3RINS2.js} +16 -17
  76. package/{dbSlice-DC2J53RC.js → dbSlice-6PVPY44C.js} +5 -5
  77. package/{deleteFile-KYWEMNFX.js → deleteFile-YM6NDPAR.js} +3 -3
  78. package/{dialogCommands-2QMR63AY.js → dialogCommands-KMECTGCW.js} +27 -25
  79. package/{dialogSlice-QEP5EUON.js → dialogSlice-GQMTD4HR.js} +13 -14
  80. package/{docCreateCommands-EG3KFJGO.js → docCreateCommands-4IT5PUAL.js} +24 -22
  81. package/{docDeleteCommands-MAM2BLCP.js → docDeleteCommands-QS66YNZV.js} +25 -23
  82. package/{docReadCommands-XVX2VLVM.js → docReadCommands-3SAI46YC.js} +24 -22
  83. package/{docStore-WTXUKAQB.js → docStore-PM5PYKPZ.js} +6 -6
  84. package/{docUpdateCommands-JURMHPS5.js → docUpdateCommands-OGYG5BRC.js} +24 -22
  85. package/{handleSendMessageAction-7MAFLFOD.js → handleSendMessageAction-EQ3U6K5N.js} +31 -28
  86. package/index.js +7 -7
  87. package/{localRuntimeAdapter-DSO3Y5ZS.js → localRuntimeAdapter-MO64KEOS.js} +46 -46
  88. package/{localRuntimeAuthority-JDAD7CB6.js → localRuntimeAuthority-BPN5OAQG.js} +2 -2
  89. package/{localRuntimeDb-CVC62PM5.js → localRuntimeDb-QIVAXMUL.js} +1 -1
  90. package/{machineCommands-DWILXGTZ.js → machineCommands-7MBJJY4K.js} +51 -51
  91. package/{machineWsRunDispatch-NJJZ34JJ.js → machineWsRunDispatch-T4LFRJL3.js} +47 -47
  92. package/{memberThunks-2DWKLE6W.js → memberThunks-AZINUM4S.js} +8 -8
  93. package/package.json +1 -1
  94. package/{read-L7QEJETH.js → read-7JPIWRBQ.js} +3 -3
  95. package/{readDocTool-QELXV2GW.js → readDocTool-AAQTB2Y3.js} +1 -1
  96. package/{readlineWorkspace-STK57SSQ.js → readlineWorkspace-QHPB5LUC.js} +81 -118
  97. package/{removeDialogAgentAction-376XSUP2.js → removeDialogAgentAction-RMVRILLK.js} +6 -6
  98. package/{runAgentClientLoop-6OD2CTYG.js → runAgentClientLoop-EXIQDX7G.js} +36 -35
  99. package/{runtimeDoctorCommands-HEN5IPIH.js → runtimeDoctorCommands-MMCP4B4U.js} +11 -11
  100. package/{setDialogExtraReferencesAction-QBDSH63D.js → setDialogExtraReferencesAction-L3V7JTMG.js} +6 -6
  101. package/{setPrimaryDialogAgentAction-537QFGW3.js → setPrimaryDialogAgentAction-X52JQGTJ.js} +6 -6
  102. package/{settingThunks-4Z43ZSAT.js → settingThunks-N6XFWPOU.js} +5 -5
  103. package/{spaceCommands-WPCHZKEY.js → spaceCommands-WQMUCGV7.js} +24 -22
  104. package/{streamAgentChatTurn-BOATI5H3.js → streamAgentChatTurn-DI2334G3.js} +132 -72
  105. package/{switchDialogAgentAction-CSO6AKRL.js → switchDialogAgentAction-ZJ5CGU7J.js} +5 -5
  106. package/{tools-FPKQX2J6.js → tools-23VQGJOX.js} +27 -28
  107. package/{tuiSummaryLlmCaller-PEYFTAVL.js → tuiSummaryLlmCaller-FESHBDTT.js} +4 -4
  108. package/{updateCommands-LXZLG44Y.js → updateCommands-KALLBWJE.js} +3 -3
  109. package/{updateDialogTitleAction-WAH5KADA.js → updateDialogTitleAction-AGAYHWS7.js} +14 -15
  110. package/chunk-UKZX3NHN.js +0 -48
  111. package/{agentGrantCommands-HOJ3JBBQ.js → agentGrantCommands-5DPHYEKP.js} +3 -3
  112. package/{agentProviderCommands-CUBOAVPB.js → agentProviderCommands-CXBHNONN.js} +3 -3
  113. package/{chromeOpsCommands-3Z34RKSE.js → chromeOpsCommands-GZVVK7HU.js} +4 -4
  114. package/{chunk-2SGAI64X.js → chunk-43OFVLWJ.js} +4 -4
  115. package/{chunk-XETG4RIX.js → chunk-AETZ7AD6.js} +4 -4
  116. package/{chunk-YNCJYU4X.js → chunk-G3VYRPTV.js} +4 -4
  117. package/{chunk-2IXDJNZI.js → chunk-GAGGEA7D.js} +3 -3
  118. package/{chunk-O4KVUI4W.js → chunk-KABQ74UQ.js} +3 -3
  119. package/{chunk-TCQPBZUL.js → chunk-QA2C5NKI.js} +3 -3
  120. package/{chunk-4RJJDA57.js → chunk-WR37DI7R.js} +3 -3
  121. package/{memoryCommands-CUNBFRVS.js → memoryCommands-ZS3VQJAL.js} +3 -3
  122. package/{offlineMarxistsAgentCommand-2QTHJCHV.js → offlineMarxistsAgentCommand-3GLX4QQY.js} +3 -3
  123. package/{tableCommands-LBH3QPPO.js → tableCommands-IVC5S7Y3.js} +11 -11
@@ -11,7 +11,7 @@ import {
11
11
  flushChatCompletionStream,
12
12
  providerHttpFailure,
13
13
  throwIfChatCompletionStreamFailed
14
- } from "./chunk-CVSKYIXX.js";
14
+ } from "./chunk-QXZH5UDF.js";
15
15
  import {
16
16
  readSseFrames
17
17
  } from "./chunk-HNUWUO75.js";
@@ -25,13 +25,13 @@ import {
25
25
  import {
26
26
  hasImageInRuntimeMessages,
27
27
  stripImagePartsFromMessages
28
- } from "./chunk-DFWLD7WU.js";
28
+ } from "./chunk-ULQAD7ZY.js";
29
29
  import {
30
30
  clipToolText,
31
31
  resolveAgentImageInputSupport,
32
32
  resolveHistoricalToolContentCap,
33
33
  resolveToolOutputProfile
34
- } from "./chunk-QOYJE6NX.js";
34
+ } from "./chunk-U34KT53V.js";
35
35
  import {
36
36
  applyShapingCounts,
37
37
  attachProjectionFacts,
@@ -90,7 +90,7 @@ import {
90
90
  toOpenAiCompatibleMessages,
91
91
  toResponsesTools,
92
92
  transferDowngradedToolTurnOrigin
93
- } from "./chunk-QYAYO5JA.js";
93
+ } from "./chunk-4L4K6YR7.js";
94
94
  import {
95
95
  BRIDGE_STREAM_MAX_CHARS,
96
96
  DEFAULT_READ_DIALOG_MAX_RESPONSE_CHARS,
@@ -120,7 +120,7 @@ import {
120
120
  resolveEmptyAssistantFallbackMessage,
121
121
  resolveEmptyAssistantOutcome,
122
122
  resolveTruncatedReasoningTailLog
123
- } from "./chunk-ZJG7YU3I.js";
123
+ } from "./chunk-F3SOW2EU.js";
124
124
  import {
125
125
  COMPACTION_SUMMARY_SCHEMA_VERSION,
126
126
  COMPACTION_SUMMARY_SYSTEM_PROMPT,
@@ -143,7 +143,7 @@ import {
143
143
  sha256Hex,
144
144
  truncateToolOutputForContext,
145
145
  withProviderCallTimingFields
146
- } from "./chunk-TCQPBZUL.js";
146
+ } from "./chunk-QA2C5NKI.js";
147
147
  import {
148
148
  clipCompactText
149
149
  } from "./chunk-5MMAK75Q.js";
@@ -153,6 +153,12 @@ import {
153
153
  import {
154
154
  isAbortError
155
155
  } from "./chunk-7DPNBQSV.js";
156
+ import {
157
+ buildDialogSummaryLayer
158
+ } from "./chunk-VEA7H5FG.js";
159
+ import {
160
+ buildUserResponseLanguageContext
161
+ } from "./chunk-4VJAC32I.js";
156
162
  import {
157
163
  canonicalizeToolName,
158
164
  canonicalizeToolNames
@@ -167,12 +173,12 @@ import {
167
173
  import {
168
174
  asOptionalPositiveFiniteNumber
169
175
  } from "./chunk-U6VC4MU4.js";
170
- import {
171
- asOptionalFiniteNumber
172
- } from "./chunk-WWC7I6TA.js";
173
176
  import {
174
177
  estimateTokenCount
175
178
  } from "./chunk-PSCNXBYA.js";
179
+ import {
180
+ asOptionalFiniteNumber
181
+ } from "./chunk-WWC7I6TA.js";
176
182
  import {
177
183
  buildProviderAuthHeaders,
178
184
  buildProviderExecutionPlan
@@ -198,12 +204,6 @@ import {
198
204
  import {
199
205
  resolveNoloStateDir
200
206
  } from "./chunk-ZWQUWF6W.js";
201
- import {
202
- buildDialogSummaryLayer
203
- } from "./chunk-VEA7H5FG.js";
204
- import {
205
- buildUserResponseLanguageContext
206
- } from "./chunk-4VJAC32I.js";
207
207
  import {
208
208
  __export
209
209
  } from "./chunk-4VNS5WPM.js";
@@ -14050,8 +14050,11 @@ function detectExecShellSynchronousWarnings(command, shell) {
14050
14050
  }
14051
14051
 
14052
14052
  // packages/agent-runtime/workspaceShell.ts
14053
- import { resolve } from "node:path";
14053
+ import { createWriteStream, mkdirSync as mkdirSync2 } from "node:fs";
14054
+ import { dirname, join as join4, resolve } from "node:path";
14054
14055
  import { spawn as spawnChildProcess } from "node:child_process";
14056
+ import { randomUUID } from "node:crypto";
14057
+ import { tmpdir } from "node:os";
14055
14058
 
14056
14059
  // packages/agent-runtime/runtimeCompat.ts
14057
14060
  import { existsSync as existsSync2, readdirSync as readdirSync2, statSync as statSync2 } from "node:fs";
@@ -14987,39 +14990,168 @@ function truncateToolOutput(value, limit = 2e4, options) {
14987
14990
  ${tail}`;
14988
14991
  }
14989
14992
  var DEFAULT_MAX_STREAM_BUFFER_BYTES = 5 * 1024 * 1024;
14990
- function readNodeStream(stream, maxBytes = DEFAULT_MAX_STREAM_BUFFER_BYTES) {
14993
+ function readNodeStream(stream, maxBytesOrOptions = DEFAULT_MAX_STREAM_BUFFER_BYTES) {
14991
14994
  if (!stream) return Promise.resolve("");
14995
+ const options = typeof maxBytesOrOptions === "number" ? { maxBytes: maxBytesOrOptions } : maxBytesOrOptions ?? {};
14996
+ const maxBytes = typeof options.maxBytes === "number" && Number.isFinite(options.maxBytes) && options.maxBytes >= 0 ? options.maxBytes : DEFAULT_MAX_STREAM_BUFFER_BYTES;
14997
+ const spillPath = asOptionalTrimmedString(options.spillPath);
14998
+ const createSink = options.spillSinkFactory ?? ((path) => createWriteStream(path));
14992
14999
  return new Promise((resolveStream, rejectStream) => {
14993
15000
  const chunks2 = [];
14994
15001
  let totalBytes = 0;
14995
15002
  let settled = false;
15003
+ let truncated = false;
15004
+ let spillState = spillPath ? "idle" : "disabled";
15005
+ let spillError = null;
15006
+ let spillSink = null;
15007
+ let sourcePausedForSpill = false;
15008
+ let sinkFinished = false;
14996
15009
  const formatLimit = maxBytes >= 1024 * 1024 ? `${Math.round(maxBytes / (1024 * 1024))}MB` : `${Math.round(maxBytes / 1024)}KB`;
14997
- const finalize2 = (truncated = false) => {
15010
+ const resumeSourceIfPaused = () => {
15011
+ if (!sourcePausedForSpill) return;
15012
+ sourcePausedForSpill = false;
15013
+ try {
15014
+ stream.resume?.();
15015
+ } catch {
15016
+ }
15017
+ };
15018
+ const markSpillFailed = (error) => {
15019
+ if (spillState === "failed") return;
15020
+ spillState = "failed";
15021
+ if (!spillError) {
15022
+ spillError = toErrorMessage(error);
15023
+ }
15024
+ const sink = spillSink;
15025
+ spillSink = null;
15026
+ if (sink) {
15027
+ try {
15028
+ sink.destroy?.();
15029
+ } catch {
15030
+ }
15031
+ }
15032
+ resumeSourceIfPaused();
15033
+ };
15034
+ const writeToSink = (buf) => {
15035
+ const sink = spillSink;
15036
+ if (!sink || spillState !== "open") return;
15037
+ if (sink.destroyed === true) {
15038
+ markSpillFailed(new Error("spill writable closed before finish"));
15039
+ return;
15040
+ }
15041
+ let accepted = true;
15042
+ try {
15043
+ accepted = sink.write(buf) !== false;
15044
+ } catch (error) {
15045
+ markSpillFailed(error);
15046
+ return;
15047
+ }
15048
+ if (!accepted && !sourcePausedForSpill) {
15049
+ sourcePausedForSpill = true;
15050
+ try {
15051
+ stream.pause?.();
15052
+ } catch {
15053
+ sourcePausedForSpill = false;
15054
+ }
15055
+ }
15056
+ };
15057
+ const openSpill = (headChunks, crossingChunk) => {
15058
+ if (!spillPath || spillState !== "idle") return;
15059
+ let sink;
15060
+ try {
15061
+ mkdirSync2(dirname(spillPath), { recursive: true });
15062
+ sink = createSink(spillPath);
15063
+ sink.on("error", (error) => markSpillFailed(error));
15064
+ sink.on("drain", () => {
15065
+ if (settled) return;
15066
+ resumeSourceIfPaused();
15067
+ });
15068
+ sink.on("finish", () => {
15069
+ sinkFinished = true;
15070
+ });
15071
+ sink.on("close", () => {
15072
+ if (sinkFinished || spillState !== "open") return;
15073
+ markSpillFailed(new Error("spill writable closed before finish"));
15074
+ });
15075
+ } catch (error) {
15076
+ spillState = "failed";
15077
+ spillError = toErrorMessage(error);
15078
+ spillSink = null;
15079
+ return;
15080
+ }
15081
+ spillSink = sink;
15082
+ spillState = "open";
15083
+ for (const head3 of headChunks) writeToSink(head3);
15084
+ writeToSink(crossingChunk);
15085
+ };
15086
+ const finalize2 = (wasTruncated) => {
14998
15087
  if (settled) return;
14999
15088
  settled = true;
15000
- let text2 = Buffer.concat(chunks2).toString("utf8");
15001
- if (truncated) {
15002
- text2 += `
15089
+ const truncatedNow = wasTruncated || truncated;
15090
+ const baseText = Buffer.concat(chunks2).toString("utf8");
15091
+ const done4 = () => {
15092
+ let text2 = baseText;
15093
+ if (truncatedNow) {
15094
+ const notes = [`output exceeded ${formatLimit} buffer limit`];
15095
+ if (spillState === "ok") {
15096
+ notes.push(`full output: ${spillPath}`);
15097
+ } else if (spillPath) {
15098
+ notes.push(
15099
+ `spill failed${spillError ? ` (${spillError})` : ""}; output incomplete`
15100
+ );
15101
+ }
15102
+ text2 += `
15003
15103
 
15004
- [stream pipe truncated: output exceeded ${formatLimit} buffer limit]`;
15104
+ [stream pipe truncated: ${notes.join("; ")}]`;
15105
+ }
15106
+ resolveStream(text2);
15107
+ };
15108
+ const sink = spillSink;
15109
+ if (!sink || spillState !== "open") {
15110
+ done4();
15111
+ return;
15112
+ }
15113
+ let closed = false;
15114
+ const settleSink = (failed, error) => {
15115
+ if (closed) return;
15116
+ closed = true;
15117
+ if (failed) {
15118
+ markSpillFailed(error ?? new Error("spill write failed"));
15119
+ } else if (spillState === "open") {
15120
+ spillState = "ok";
15121
+ }
15122
+ done4();
15123
+ };
15124
+ if (sink.destroyed === true) {
15125
+ settleSink(true, new Error("spill writable closed before finish"));
15126
+ return;
15127
+ }
15128
+ sink.once("error", (error) => settleSink(true, error));
15129
+ sink.once("finish", () => settleSink(false));
15130
+ sink.once("close", () => {
15131
+ settleSink(!sinkFinished, new Error("spill writable closed before finish"));
15132
+ });
15133
+ try {
15134
+ sink.end?.();
15135
+ } catch (error) {
15136
+ settleSink(true, error);
15005
15137
  }
15006
- resolveStream(text2);
15007
15138
  };
15008
15139
  stream.on("data", (chunk) => {
15009
15140
  if (settled) return;
15010
15141
  const buf = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
15142
+ if (truncated) {
15143
+ writeToSink(buf);
15144
+ return;
15145
+ }
15011
15146
  if (totalBytes + buf.length >= maxBytes) {
15012
15147
  const remaining = Math.max(0, maxBytes - totalBytes);
15148
+ const headChunks = chunks2.slice();
15013
15149
  if (remaining > 0) {
15014
15150
  chunks2.push(buf.subarray(0, remaining));
15015
15151
  }
15016
- try {
15017
- if (typeof stream.destroy === "function") {
15018
- stream.destroy();
15019
- }
15020
- } catch {
15021
- }
15022
- finalize2(true);
15152
+ totalBytes += buf.length;
15153
+ truncated = true;
15154
+ openSpill(headChunks, buf);
15023
15155
  return;
15024
15156
  }
15025
15157
  totalBytes += buf.length;
@@ -15028,6 +15160,19 @@ function readNodeStream(stream, maxBytes = DEFAULT_MAX_STREAM_BUFFER_BYTES) {
15028
15160
  stream.on("error", (error) => {
15029
15161
  if (settled) return;
15030
15162
  settled = true;
15163
+ const sink = spillSink;
15164
+ spillSink = null;
15165
+ if (!spillError) spillError = toErrorMessage(error);
15166
+ if (spillState !== "failed" && spillState !== "disabled") {
15167
+ spillState = "failed";
15168
+ }
15169
+ if (sink) {
15170
+ try {
15171
+ sink.destroy?.();
15172
+ } catch {
15173
+ }
15174
+ }
15175
+ resumeSourceIfPaused();
15031
15176
  rejectStream(error);
15032
15177
  });
15033
15178
  stream.on("end", () => finalize2(false));
@@ -15140,8 +15285,12 @@ async function runWorkspaceCommand(args2) {
15140
15285
  process.removeListener("SIGINT", cleanupChildOnHostSignal);
15141
15286
  };
15142
15287
  exitPromise.then(detachSignalCleanup, detachSignalCleanup);
15143
- const stdoutCapture = stdoutPromiseResult(readNodeStream(proc.stdout));
15144
- const stderrCapture = stdoutPromiseResult(readNodeStream(proc.stderr));
15288
+ const stdoutCapture = stdoutPromiseResult(
15289
+ readNodeStream(proc.stdout, { spillPath: join4(tmpdir(), `nolo-stream-${randomUUID()}.log`) })
15290
+ );
15291
+ const stderrCapture = stdoutPromiseResult(
15292
+ readNodeStream(proc.stderr, { spillPath: join4(tmpdir(), `nolo-stream-${randomUUID()}-stderr.log`) })
15293
+ );
15145
15294
  const killChild = (signal) => {
15146
15295
  if (detached && typeof proc.pid === "number") {
15147
15296
  try {
@@ -15550,11 +15699,11 @@ async function invokeCapability(capabilityOrName, input, ctx = {}) {
15550
15699
  }
15551
15700
 
15552
15701
  // packages/agent-runtime/localWorkspaceTools.ts
15553
- import { existsSync as existsSync3 } from "node:fs";
15702
+ import { existsSync as existsSync4 } from "node:fs";
15554
15703
  import { createHash as createHash4 } from "node:crypto";
15555
15704
  import { lstat, mkdir, readdir as readdir2, readFile as readFile3, realpath, stat as stat3, writeFile } from "node:fs/promises";
15556
15705
  import { homedir } from "node:os";
15557
- import { dirname, isAbsolute as isAbsolute2, relative as relative3, resolve as resolve4, sep } from "node:path";
15706
+ import { dirname as dirname2, isAbsolute as isAbsolute2, relative as relative3, resolve as resolve4, sep } from "node:path";
15558
15707
  import { spawn as spawnChildProcess3 } from "node:child_process";
15559
15708
 
15560
15709
  // packages/core/readRangeLedger.ts
@@ -16836,7 +16985,7 @@ function resolveRipgrepBinary(env = process.env) {
16836
16985
  const fromEnv = asOptionalTrimmedString(env.NOLO_BUNDLED_RG);
16837
16986
  if (fromEnv) {
16838
16987
  try {
16839
- if (existsSync3(fromEnv)) return fromEnv;
16988
+ if (existsSync4(fromEnv)) return fromEnv;
16840
16989
  } catch {
16841
16990
  }
16842
16991
  }
@@ -16942,6 +17091,7 @@ ${tail}`,
16942
17091
  };
16943
17092
  }
16944
17093
  var READ_FILE_LEDGER_MAX_RECORDS = 64;
17094
+ var READ_FILE_LEDGER_MAX_KEYS = 256;
16945
17095
  async function readFileTool(args2) {
16946
17096
  const parsed = parseWorkspaceToolArguments(args2.call.arguments);
16947
17097
  const requestedPath = requireWorkspaceToolPath(parsed);
@@ -16980,6 +17130,8 @@ async function readFileTool(args2) {
16980
17130
  const retainedCap = resolveHistoricalToolContentCap("readFile", 0);
16981
17131
  const retained = filterRetainedLedgerRecords(entry.records, retainedCap);
16982
17132
  if (retained.length > 0 && isLineRangeCovered(requestRange, retained)) {
17133
+ ledger.delete(relativePath);
17134
+ ledger.set(relativePath, entry);
16983
17135
  return {
16984
17136
  content: `[readFile] ${relativePath} lines ${requestRange.startLine}-${requestRange.endLine} were already delivered earlier and the file is unchanged; not resending. Pass force:true to refetch.`,
16985
17137
  metadata: {
@@ -17012,10 +17164,16 @@ async function readFileTool(args2) {
17012
17164
  const persistedChars = truncatedRead.content.length + "\n\n[tool metadata]\n".length + JSON.stringify(metadata).length;
17013
17165
  const records = entry?.records ?? [];
17014
17166
  records.push({ ...requestRange, chars: persistedChars });
17167
+ ledger.delete(relativePath);
17015
17168
  ledger.set(relativePath, {
17016
17169
  fingerprint,
17017
17170
  records: records.slice(-READ_FILE_LEDGER_MAX_RECORDS)
17018
17171
  });
17172
+ while (ledger.size > READ_FILE_LEDGER_MAX_KEYS) {
17173
+ const oldestKey = ledger.keys().next().value;
17174
+ if (oldestKey === void 0) break;
17175
+ ledger.delete(oldestKey);
17176
+ }
17019
17177
  }
17020
17178
  return { content: truncatedRead.content, metadata };
17021
17179
  }
@@ -17028,7 +17186,7 @@ async function writeFileTool(args2) {
17028
17186
  requestedPath,
17029
17187
  ...args2.confirmExternalFileAccess ? { confirmExternalFileAccess: args2.confirmExternalFileAccess } : {}
17030
17188
  });
17031
- await mkdir(dirname(absolutePath), { recursive: true });
17189
+ await mkdir(dirname2(absolutePath), { recursive: true });
17032
17190
  await writeFile(absolutePath, content, "utf8");
17033
17191
  const relativePath = normalizeWorkspaceRelativePath({
17034
17192
  workspaceRoot: resolve4(args2.workspaceRoot),
@@ -17485,7 +17643,7 @@ async function execShellTool(args2) {
17485
17643
  );
17486
17644
  }
17487
17645
  var LAUNCH_PROCESS_STREAM_RING_CHARS = 65536;
17488
- var LAUNCH_PROCESS_STREAM_CAPTURE_MAX_CHARS = 4e6;
17646
+ var LAUNCH_PROCESS_STREAM_CAPTURE_MAX_CHARS = 1e6;
17489
17647
  function createLaunchProcessStreamCapture() {
17490
17648
  let ring = "";
17491
17649
  let full = null;
@@ -18709,7 +18867,7 @@ var normalizeContextBlockScopes = (legacyBlocks = void 0, scopes = void 0) => {
18709
18867
  };
18710
18868
 
18711
18869
  // packages/agent-runtime/localAutoCompaction.ts
18712
- import { randomUUID } from "node:crypto";
18870
+ import { randomUUID as randomUUID2 } from "node:crypto";
18713
18871
  function toPlanCompressionMessages(history) {
18714
18872
  return history.map((message, index) => ({
18715
18873
  id: typeof message.id === "string" && message.id.length > 0 ? message.id : `local-${index}`,
@@ -18944,7 +19102,7 @@ async function maybeAutoCompactLocalHistory(args2) {
18944
19102
  };
18945
19103
  }
18946
19104
  emitPhase({ kind: "compaction-start" });
18947
- const compactionAttemptId = randomUUID();
19105
+ const compactionAttemptId = randomUUID2();
18948
19106
  let compactionT0 = Date.now();
18949
19107
  let compactionInputTokens;
18950
19108
  let compactionPrevSummaryTokens;
@@ -19859,12 +20017,8 @@ async function runLocalAgentTurn(input) {
19859
20017
  `[nolo] rewrote ${stats.rewrittenToolCalls} tool calls in ${stats.rewrittenAssistantMessages} assistant messages and ${stats.rewrittenToolMessages} tool-result messages (bad arguments: truncated=${stats.badArguments.truncated}, malformed=${stats.badArguments.malformed}); persisted history untouched`
19860
20018
  );
19861
20019
  }
19862
- const supportsImages = resolveAgentImageInputSupport({
19863
- apiSource: agentConfig.apiSource,
19864
- provider: agentConfig.provider,
19865
- model: agentConfig.model,
19866
- hasVision: agentConfig.hasVision
19867
- });
20020
+ const supportsImages = resolveAgentImageInputSupport(agentConfig);
20021
+ let imageDowngradeEmitted = false;
19868
20022
  if (!supportsImages && hasImageInRuntimeMessages(messages)) {
19869
20023
  messages = filterImagePartsFromMessages(messages, false);
19870
20024
  emitLoopEvent(observationBoundary, {
@@ -19872,6 +20026,7 @@ async function runLocalAgentTurn(input) {
19872
20026
  reason: "no-vision",
19873
20027
  atMs: Date.now()
19874
20028
  });
20029
+ imageDowngradeEmitted = true;
19875
20030
  }
19876
20031
  const prefixCount = builtMessages.prefixCount;
19877
20032
  const capToolMessage = (msg) => msg.role === "tool" && typeof msg.content === "string" ? {
@@ -19938,6 +20093,14 @@ async function runLocalAgentTurn(input) {
19938
20093
  roundBudgetWarningInjected = true;
19939
20094
  }
19940
20095
  const preparedMessages = prepareMessagesForProviderCall(transcript.working());
20096
+ if (!supportsImages && hasImageInRuntimeMessages(preparedMessages.messages) && !imageDowngradeEmitted) {
20097
+ emitLoopEvent(observationBoundary, {
20098
+ kind: "image-downgraded",
20099
+ reason: "no-vision",
20100
+ atMs: Date.now()
20101
+ });
20102
+ imageDowngradeEmitted = true;
20103
+ }
19941
20104
  const baseRequestMessages = filterImagePartsFromMessages(
19942
20105
  preparedMessages.messages,
19943
20106
  supportsImages
@@ -21704,7 +21867,7 @@ function buildLoadSkillExecutor(args2) {
21704
21867
  const { resolveSkillByName } = await import("./skillDiscovery-QC35EQY4.js");
21705
21868
  const resolved = resolveSkillByName(args2.cwd, name);
21706
21869
  if (!resolved) {
21707
- const { resolveBuiltinSkillByName } = await import("./builtinSkillRegistry-H3AY27TR.js");
21870
+ const { resolveBuiltinSkillByName } = await import("./builtinSkillRegistry-LJV7FHNI.js");
21708
21871
  const builtin = resolveBuiltinSkillByName(name);
21709
21872
  if (builtin) {
21710
21873
  return {
@@ -21782,7 +21945,7 @@ function resolveSessionKey(args2) {
21782
21945
  }
21783
21946
 
21784
21947
  // packages/agent-runtime/devin/devinProvider.ts
21785
- import { randomBytes, randomUUID as randomUUID2 } from "node:crypto";
21948
+ import { randomBytes, randomUUID as randomUUID3 } from "node:crypto";
21786
21949
  var CLIENT_NAME = "chisel";
21787
21950
  var CLIENT_VERSION = "3000.11.3";
21788
21951
  function writeVarint(fieldNum, value) {
@@ -21842,7 +22005,7 @@ function encodeDevinClientMetadata(token) {
21842
22005
  ]);
21843
22006
  }
21844
22007
  function devinId(id, purpose) {
21845
- return id?.sessionKey && isStableSessionIdentityEnabled() ? deriveStableUuid(id.sessionKey, purpose) : randomUUID2();
22008
+ return id?.sessionKey && isStableSessionIdentityEnabled() ? deriveStableUuid(id.sessionKey, purpose) : randomUUID3();
21846
22009
  }
21847
22010
  function encodeDevinChatMessage(msg, identity2, index = 0) {
21848
22011
  const source = msg.role === "assistant" ? 2 : msg.role === "tool" ? 4 : 1;
@@ -21936,7 +22099,7 @@ ${item.text}`;
21936
22099
  const chatMessageBuffers = coalesced.map((m, i) => encodeDevinChatMessage(m, identity2, i));
21937
22100
  const completionConfig = buildCompletionConfig({ temperature });
21938
22101
  const modelConfig = Buffer.concat([
21939
- writeStringField(1, randomUUID2()),
22102
+ writeStringField(1, randomUUID3()),
21940
22103
  writeVarint(2, 1),
21941
22104
  writeVarint(3, 4)
21942
22105
  ]);
@@ -21948,7 +22111,7 @@ ${item.text}`;
21948
22111
  writeMessageField(8, completionConfig),
21949
22112
  ...tools.map((tool) => writeMessageField(10, encodeDevinToolDefinition(tool))),
21950
22113
  writeMessageField(15, modelConfig),
21951
- writeStringField(16, randomUUID2()),
22114
+ writeStringField(16, randomUUID3()),
21952
22115
  writeVarint(20, 1),
21953
22116
  writeStringField(21, model)
21954
22117
  ]);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getRuntimeServerContext,
3
3
  scheduleDeleteReplication
4
- } from "./chunk-2SGAI64X.js";
4
+ } from "./chunk-43OFVLWJ.js";
5
5
  import {
6
6
  fetchFromClientDb
7
7
  } from "./chunk-6Q7UTJKR.js";
@@ -7,7 +7,7 @@ import {
7
7
  scheduleExistingRecordReplication,
8
8
  shouldReplaceLocalWithRemoteRecord,
9
9
  shouldReplicateLocalRecord
10
- } from "./chunk-2SGAI64X.js";
10
+ } from "./chunk-43OFVLWJ.js";
11
11
  import {
12
12
  fetchFromClientDb,
13
13
  fetchFromServer,
@@ -2,7 +2,7 @@ import {
2
2
  deleteDbRecord,
3
3
  queryUserRecords,
4
4
  readDbRecord
5
- } from "./chunk-O4KVUI4W.js";
5
+ } from "./chunk-KABQ74UQ.js";
6
6
  import {
7
7
  mergeAndDedupUserData
8
8
  } from "./chunk-OXME3PEE.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  toolRegistry
3
- } from "./chunk-GCLZBOB6.js";
3
+ } from "./chunk-2ZYCNT2O.js";
4
4
  import {
5
5
  runtime_default
6
- } from "./chunk-FZYTJOAQ.js";
6
+ } from "./chunk-F5WASHQA.js";
7
7
  import {
8
8
  canonicalizeToolNames
9
9
  } from "./chunk-5EBLANFT.js";
@@ -27,11 +27,11 @@ import {
27
27
  stablePromptCacheKey,
28
28
  toOpenAiCompatibleMessages,
29
29
  toResponsesTools
30
- } from "./chunk-QYAYO5JA.js";
30
+ } from "./chunk-4L4K6YR7.js";
31
31
  import {
32
32
  isMeaningfulChatCompletionOutput,
33
33
  isMeaningfulResponsesOutput
34
- } from "./chunk-TCQPBZUL.js";
34
+ } from "./chunk-QA2C5NKI.js";
35
35
  import {
36
36
  clipCompactText
37
37
  } from "./chunk-5MMAK75Q.js";
@@ -2,7 +2,7 @@ import {
2
2
  clipMultilineText,
3
3
  fetchAndSerializeTable,
4
4
  waitForAbortableDelay
5
- } from "./chunk-FBSDWUOJ.js";
5
+ } from "./chunk-FCUKCVKN.js";
6
6
  import {
7
7
  isGatewayHttpStatus
8
8
  } from "./chunk-NF64D32W.js";
@@ -15,30 +15,33 @@ import {
15
15
  import {
16
16
  resolvePageReadMarkdown,
17
17
  slateToSimplifiedMarkdown
18
- } from "./chunk-US6MKPE7.js";
18
+ } from "./chunk-3L5MSPWX.js";
19
19
  import {
20
20
  extractCategorizedMentions
21
21
  } from "./chunk-AGIM7IMJ.js";
22
22
  import {
23
23
  fetchAndCacheMessages
24
- } from "./chunk-FZYTJOAQ.js";
24
+ } from "./chunk-F5WASHQA.js";
25
25
  import {
26
26
  createSpaceKey
27
27
  } from "./chunk-UAD2WT54.js";
28
28
  import {
29
29
  read
30
- } from "./chunk-ZVQHBIWV.js";
30
+ } from "./chunk-CDLP56BS.js";
31
31
  import {
32
32
  getRuntimeServerContext
33
- } from "./chunk-2SGAI64X.js";
33
+ } from "./chunk-43OFVLWJ.js";
34
34
  import {
35
35
  extractRuntimePageCapabilities,
36
36
  resolveBuiltinSkillPage,
37
37
  resolveSkillGraphFromRoots
38
- } from "./chunk-DC3SZCRR.js";
38
+ } from "./chunk-SH3XD4E2.js";
39
39
  import {
40
40
  isAbortError
41
41
  } from "./chunk-7DPNBQSV.js";
42
+ import {
43
+ wrapHistoricalSummaryWithReplayGuard
44
+ } from "./chunk-4VJAC32I.js";
42
45
  import {
43
46
  extractCustomId
44
47
  } from "./chunk-M2EJHDJP.js";
@@ -51,9 +54,6 @@ import {
51
54
  import {
52
55
  asTrimmedString
53
56
  } from "./chunk-3EUW3WEO.js";
54
- import {
55
- wrapHistoricalSummaryWithReplayGuard
56
- } from "./chunk-4VJAC32I.js";
57
57
 
58
58
  // packages/ai/chat/errorDiagnostics.ts
59
59
  var record = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  patch,
9
9
  readAndWait
10
- } from "./chunk-ZVQHBIWV.js";
10
+ } from "./chunk-CDLP56BS.js";
11
11
  import {
12
12
  toErrorMessage
13
13
  } from "./chunk-HNMXYYJR.js";
@@ -333,7 +333,7 @@ async function saveDocState(arg, { dispatch, getState }) {
333
333
  ).unwrap();
334
334
  if (dbSpaceId) {
335
335
  try {
336
- const { updateContentTitle } = await import("./contentThunks-WLKR5KQ6.js");
336
+ const { updateContentTitle } = await import("./contentThunks-QBL5NK2W.js");
337
337
  await dispatch(
338
338
  updateContentTitle({
339
339
  spaceId: dbSpaceId,
@@ -372,7 +372,7 @@ async function saveDocState(arg, { dispatch, getState }) {
372
372
  }
373
373
  }
374
374
  async function createDocState(args, thunkApi) {
375
- const { createPageAction } = await import("./createPageAction-CAXS6ZUJ.js");
375
+ const { createPageAction } = await import("./createPageAction-7T3RINS2.js");
376
376
  return createPageAction(args, thunkApi);
377
377
  }
378
378
  function subscribe(listener) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readDbRecord,
3
3
  writeAgentRecord
4
- } from "./chunk-O4KVUI4W.js";
4
+ } from "./chunk-KABQ74UQ.js";
5
5
  import {
6
6
  buildSkillSummaryMarker
7
7
  } from "./chunk-VF4K2QE6.js";
@@ -6,11 +6,11 @@ import {
6
6
  buildBuiltinObjectSkillDbKey,
7
7
  buildBuiltinObjectSkillPageContent,
8
8
  buildCodeWorkDiscipline
9
- } from "./chunk-JZX2XLKC.js";
9
+ } from "./chunk-YCRROBDY.js";
10
10
  import {
11
11
  buildSkillDocMarkdown,
12
12
  resolvePageSkillMetadata
13
- } from "./chunk-XETG4RIX.js";
13
+ } from "./chunk-AETZ7AD6.js";
14
14
  import {
15
15
  nolotusId
16
16
  } from "./chunk-Y6ORVLSS.js";