nolo-cli 0.158.0-alpha.1 → 0.158.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.
- package/{_executeModel-6BMU3URY.js → _executeModel-AGVQAILR.js} +47 -47
- package/accountResolver-55EDKEIK.js +1 -1
- package/action-GPPJC5TI.js +1 -1
- package/{addContentAction-BI6RDRTQ.js → addContentAction-XJQEJ4XW.js} +6 -6
- package/{addDialogAgentAction-4RJYUSIK.js → addDialogAgentAction-5WZX5CAY.js} +5 -5
- package/{agentDeleteCommand-Q2XWGBC2.js → agentDeleteCommand-56DO7V2R.js} +66 -67
- package/{agentEmailCommands-XFBE2A3F.js → agentEmailCommands-BPUATKQ6.js} +69 -70
- package/{agentListCommands-OROMT4P3.js → agentListCommands-KS5VUGOW.js} +63 -40
- package/{agentMachineCommands-ULK5YKKJ.js → agentMachineCommands-HSJS7IQK.js} +32 -30
- package/{agentProviderCommands-MKG2OOEY.js → agentProviderCommands-CXBHNONN.js} +5 -5
- package/{agentPullCommand-FA43RBRU.js → agentPullCommand-GXXEDOSA.js} +4 -4
- package/{agentRecordCommands-3VHBLS6P.js → agentRecordCommands-IDGVLDMB.js} +63 -64
- package/{agentRunCommand-LCIMEAQY.js → agentRunCommand-LGMDPPPA.js} +65 -66
- package/{agentRunControl-2C5GM3BW.js → agentRunControl-QWFFIAQY.js} +9 -7
- package/{agentRuntimeLocal-NPJS2QDP.js → agentRuntimeLocal-QL4SHNJJ.js} +21 -19
- package/{agentSlice-VRAPG6CH.js → agentSlice-WPXWY6BV.js} +6 -6
- package/{appDeleteCommands-AZ3KS4HK.js → appDeleteCommands-FLCTFYZB.js} +31 -29
- package/{appDeployCommands-BTV22ICJ.js → appDeployCommands-UU4Z7DT3.js} +31 -29
- package/{appDeployStatusCommands-JSW3HPIW.js → appDeployStatusCommands-GKLZTHTX.js} +31 -29
- package/{appGetCommands-5KTTFIMV.js → appGetCommands-DPQ2MVJC.js} +31 -29
- package/{appListCommands-3BJPAE2U.js → appListCommands-J6QMEBNL.js} +31 -29
- package/{authCommand-NIV3DKPF.js → authCommand-OVBMDPIF.js} +20 -20
- package/{authCommands-AMNIAKEG.js → authCommands-QOCKVPX3.js} +5 -5
- package/{builtinSkillRegistry-H3AY27TR.js → builtinSkillRegistry-LJV7FHNI.js} +4 -4
- package/{chunk-O4ZERG3M.js → chunk-2HG7O7QF.js} +8 -8
- package/{chunk-EQGFFDNA.js → chunk-323QA7RW.js} +3 -3
- package/{chunk-2SOS7OSQ.js → chunk-3GCLICFW.js} +37 -4
- package/{chunk-US6MKPE7.js → chunk-3L5MSPWX.js} +1 -1
- package/{chunk-QLQ573SU.js → chunk-3M52COK5.js} +120 -0
- package/{chunk-2BKUVRC5.js → chunk-4VDSF5NQ.js} +9 -9
- package/{chunk-NKPAHRMA.js → chunk-4XHZ4QXL.js} +15 -15
- package/{chunk-ZEY4NJRE.js → chunk-5IKRTRRR.js} +5 -5
- package/{chunk-P5QACQDK.js → chunk-62TBKWTV.js} +1 -1
- package/{chunk-IYBIRCQV.js → chunk-6BNW7WC4.js} +29 -11
- package/{chunk-TRW43TSC.js → chunk-6EQD4AQL.js} +41 -1
- package/{chunk-YLMMECCH.js → chunk-6XIE5ZGI.js} +1 -1
- package/{chunk-JPJGMOIM.js → chunk-7JO3ZACS.js} +2 -2
- package/{chunk-L6EQV5OC.js → chunk-7NKZA46B.js} +3 -3
- package/{chunk-WXFZ4P6O.js → chunk-AO2T6MWY.js} +12 -12
- package/{chunk-2MTE2PEH.js → chunk-ASSNAASW.js} +5 -739
- package/{chunk-J2ATF74A.js → chunk-BAWAKW7X.js} +1 -1
- package/{chunk-7RF4O6AT.js → chunk-BL4HFN6L.js} +1 -1
- package/{chunk-ICRRXBRN.js → chunk-BWIR5QBI.js} +6 -3
- package/{chunk-ZVQHBIWV.js → chunk-CDLP56BS.js} +7 -7
- package/{chunk-6TF64IF2.js → chunk-DI7ZFGDQ.js} +16 -2
- package/{chunk-C3OK72G3.js → chunk-DJ2BOPJY.js} +1 -1
- package/{chunk-OON4OBWI.js → chunk-DLV3H464.js} +7 -7
- package/{chunk-LV4LV2B4.js → chunk-DOBOKBKS.js} +7 -5
- package/{chunk-IRTOYSA2.js → chunk-ESMZW5PE.js} +1 -1
- package/{chunk-HB4XPBC7.js → chunk-EWO77ZGF.js} +9 -11
- package/{chunk-FY4SDK2E.js → chunk-FDLDMJTM.js} +1 -1
- package/{chunk-IE5PXKVU.js → chunk-G3VYRPTV.js} +5 -5
- package/{chunk-AJ4V34SG.js → chunk-HCZOSYTL.js} +19 -19
- package/{chunk-C6FY7HWI.js → chunk-HEC32F3G.js} +46 -1
- package/{chunk-WTFRBJT5.js → chunk-HSY7F4PP.js} +32 -34
- package/{chunk-UFYBYB26.js → chunk-I7S63QUU.js} +1 -1
- package/{chunk-CON6SI7N.js → chunk-IF7V3CBU.js} +1 -1
- package/{chunk-4RJJDA57.js → chunk-IW64YHXL.js} +154 -30
- package/chunk-JLR5NWP2.js +548 -0
- package/{chunk-K43ZF2C3.js → chunk-JPPQ3GUO.js} +1 -1
- package/{chunk-M2P3OGXZ.js → chunk-JWEXJ573.js} +2 -2
- package/{chunk-3C2QLERX.js → chunk-KMDDG73K.js} +1 -1
- package/{chunk-KKKHAF3P.js → chunk-KMKVQNFH.js} +3 -3
- package/{chunk-ZBXIKCZ4.js → chunk-KQT46A27.js} +368 -91
- package/{chunk-5MM7NNO6.js → chunk-KSTEXKL6.js} +78 -39
- package/{chunk-MM3662RS.js → chunk-LPO6AMQU.js} +780 -64
- package/{chunk-YTXQ2U2X.js → chunk-M3IBEHBT.js} +144 -44
- package/{chunk-SPKLALBU.js → chunk-MAYW6V3E.js} +1 -1
- package/{chunk-IPAW7XLD.js → chunk-MFVOJ6KF.js} +2 -2
- package/{chunk-UCLSOLX4.js → chunk-MLEANT7D.js} +13 -13
- package/{chunk-NDZOXXIM.js → chunk-NHEWV5FD.js} +1 -1
- package/{chunk-4UOEOHY3.js → chunk-OE4FM66I.js} +5 -5
- package/chunk-OHRQXEON.js +2685 -0
- package/{chunk-SUKSWFLP.js → chunk-PIG2IUVZ.js} +1 -1
- package/{chunk-6MXDOUMH.js → chunk-R4BMKAR5.js} +70 -8
- package/{chunk-S72LMV7T.js → chunk-RCZMREV2.js} +4793 -3390
- package/chunk-SAZSXMTR.js +188 -0
- package/{chunk-DC3SZCRR.js → chunk-SH3XD4E2.js} +2 -2
- package/{chunk-JGRPBIZZ.js → chunk-SQX235S2.js} +1 -1
- package/{chunk-2AB2HA4M.js → chunk-TDX2L4W2.js} +8 -2
- package/{chunk-G476FQ7Q.js → chunk-TSTLLGAC.js} +4 -4
- package/{chunk-3TBHZPNG.js → chunk-TTVMMYVH.js} +295 -55
- package/{chunk-I2RMFLLH.js → chunk-V7PCFWX3.js} +1 -1
- package/{chunk-QPY264HO.js → chunk-W7FGZRLK.js} +1 -1
- package/{chunk-BYQOCH75.js → chunk-XYW6JSRD.js} +2 -2
- package/{chunk-KLA62VVE.js → chunk-Y45LLH6C.js} +42 -11
- package/{chunk-CDWHHLK5.js → chunk-Y7F4Q7YP.js} +4 -4
- package/{chunk-JZX2XLKC.js → chunk-YCRROBDY.js} +1 -1
- package/{chunk-GAVUTXM5.js → chunk-YFEVODB4.js} +18 -194
- package/{chunk-G2WP7VPD.js → chunk-YKTAUOS7.js} +18 -6
- package/{chunk-YANF2RR4.js → chunk-ZPKUJROL.js} +1 -1
- package/{commandRegistry-D6JTVYKG.js → commandRegistry-HHTMBO55.js} +85 -85
- package/{contentThunks-DYQO4CTI.js → contentThunks-ZSKJTGS7.js} +17 -18
- package/{cooldownCommands-JFKTYS2D.js → cooldownCommands-NS63RGBO.js} +2 -2
- package/{createAgentAutomationAction-LW26KIBP.js → createAgentAutomationAction-KYHXEVZF.js} +17 -18
- package/{createDialogAction-VLLBRD52.js → createDialogAction-JKB3V4YP.js} +21 -22
- package/{createPageAction-PDACOLI6.js → createPageAction-CRVW6Z65.js} +20 -22
- package/{dbSlice-DC2J53RC.js → dbSlice-6PVPY44C.js} +5 -5
- package/{deleteFile-KYWEMNFX.js → deleteFile-YM6NDPAR.js} +3 -3
- package/{dialogCommands-F3Y4KCPZ.js → dialogCommands-2NVLHDZP.js} +32 -30
- package/{dialogSlice-ERMZYMS6.js → dialogSlice-SOEMTPH4.js} +16 -17
- package/{dist-NJC2W7I4.js → dist-Q2JSMAKA.js} +7 -361
- package/{docCreateCommands-YMWZLW64.js → docCreateCommands-BL4YBQOD.js} +32 -30
- package/{docDeleteCommands-6KJ3ESK4.js → docDeleteCommands-NTRYV5OH.js} +33 -31
- package/{docReadCommands-YQGFVLWI.js → docReadCommands-MJGISD7D.js} +32 -30
- package/{docStore-HXKI6W5D.js → docStore-YXIN3UVQ.js} +6 -6
- package/{docUpdateCommands-QLSGXUEX.js → docUpdateCommands-C2AIMWBR.js} +32 -30
- package/{getPricing-TX35D7PI.js → getPricing-XQ3N3RBP.js} +2 -2
- package/{handleSendMessageAction-2XCOZPXY.js → handleSendMessageAction-JXA7PBY2.js} +35 -32
- package/index.js +7 -7
- package/{localRuntimeAdapter-VOFUPXNF.js → localRuntimeAdapter-QAXXJCDM.js} +61 -60
- package/{localRuntimeAuthority-JDAD7CB6.js → localRuntimeAuthority-BPN5OAQG.js} +2 -2
- package/{localRuntimeDb-CVC62PM5.js → localRuntimeDb-QIVAXMUL.js} +1 -1
- package/{machineCommands-IN5O7CIO.js → machineCommands-TKOOPU7X.js} +66 -67
- package/{machineWsRunDispatch-TH3GMSR3.js → machineWsRunDispatch-AQ3KTB7U.js} +61 -62
- package/{memberThunks-2DWKLE6W.js → memberThunks-AZINUM4S.js} +8 -8
- package/package.json +6 -2
- package/{providerPresetApply-GSJI4JBJ.js → providerPresetApply-PKUOHQJT.js} +5 -5
- package/{providerRegistry-TSSTPGWF.js → providerRegistry-HNQLIFN2.js} +5 -5
- package/{read-L7QEJETH.js → read-7JPIWRBQ.js} +3 -3
- package/{readDocTool-QELXV2GW.js → readDocTool-AAQTB2Y3.js} +1 -1
- package/{readlineWorkspace-EIEQUTEZ.js → readlineWorkspace-7G2FBC53.js} +96 -134
- package/{removeDialogAgentAction-376XSUP2.js → removeDialogAgentAction-RMVRILLK.js} +6 -6
- package/{runAgentClientLoop-3KHKKBZI.js → runAgentClientLoop-NKCVEOOU.js} +45 -45
- package/{runtimeDoctorCommands-56NWKNON.js → runtimeDoctorCommands-MMCP4B4U.js} +12 -12
- package/{setDialogExtraReferencesAction-QBDSH63D.js → setDialogExtraReferencesAction-L3V7JTMG.js} +6 -6
- package/{setPrimaryDialogAgentAction-537QFGW3.js → setPrimaryDialogAgentAction-X52JQGTJ.js} +6 -6
- package/{settingThunks-4Z43ZSAT.js → settingThunks-N6XFWPOU.js} +5 -5
- package/{spaceCommands-T5Z4U7HP.js → spaceCommands-44R7DU34.js} +29 -27
- package/{streamAgentChatTurn-DMXXSEVX.js → streamAgentChatTurn-V7GZPMO4.js} +143 -84
- package/{switchDialogAgentAction-CSO6AKRL.js → switchDialogAgentAction-ZJ5CGU7J.js} +5 -5
- package/{tools-RMT7NAMC.js → tools-SNXGTJMT.js} +35 -37
- package/{tuiSummaryLlmCaller-KLK6K3Q3.js → tuiSummaryLlmCaller-FQOEF4IE.js} +7 -7
- package/{updateCommands-LXZLG44Y.js → updateCommands-FJHGWD3Q.js} +5 -3
- package/{updateDialogTitleAction-Z4WNUH6Y.js → updateDialogTitleAction-QKWRDIK3.js} +17 -18
- package/chunk-3MZAGMYY.js +0 -239
- package/chunk-IA7TRNNR.js +0 -11
- package/chunk-UKZX3NHN.js +0 -48
- package/chunk-VDEVDGEM.js +0 -7018
- package/clipboardy-GCO3GT3I.js +0 -11793
- package/{agentGrantCommands-HOJ3JBBQ.js → agentGrantCommands-5DPHYEKP.js} +3 -3
- package/{chromeOpsCommands-3Z34RKSE.js → chromeOpsCommands-GZVVK7HU.js} +4 -4
- package/{chunk-2SGAI64X.js → chunk-43OFVLWJ.js} +4 -4
- package/{chunk-XETG4RIX.js → chunk-AETZ7AD6.js} +4 -4
- package/{chunk-2IXDJNZI.js → chunk-GAGGEA7D.js} +3 -3
- package/{memoryCommands-CUNBFRVS.js → memoryCommands-ZS3VQJAL.js} +3 -3
- package/{offlineMarxistsAgentCommand-2QTHJCHV.js → offlineMarxistsAgentCommand-3GLX4QQY.js} +3 -3
- package/{tableCommands-LBH3QPPO.js → tableCommands-IVC5S7Y3.js} +11 -11
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DEVIN_CONNECT_URL,
|
|
3
3
|
parseSseDataLineJson,
|
|
4
4
|
parseSseDataLineObject
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KMDDG73K.js";
|
|
6
6
|
import {
|
|
7
7
|
applyChatCompletionDelta,
|
|
8
8
|
applyResponsesToolEvent,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
flushChatCompletionStream,
|
|
12
12
|
providerHttpFailure,
|
|
13
13
|
throwIfChatCompletionStreamFailed
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7NKZA46B.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-
|
|
28
|
+
} from "./chunk-YKTAUOS7.js";
|
|
29
29
|
import {
|
|
30
30
|
clipToolText,
|
|
31
31
|
resolveAgentImageInputSupport,
|
|
32
32
|
resolveHistoricalToolContentCap,
|
|
33
33
|
resolveToolOutputProfile
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-6BNW7WC4.js";
|
|
35
35
|
import {
|
|
36
36
|
applyShapingCounts,
|
|
37
37
|
attachProjectionFacts,
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
hashStablePrefixContent,
|
|
67
67
|
resolveResponseGuidelines,
|
|
68
68
|
resolveToolGuidedSections
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-DOBOKBKS.js";
|
|
70
70
|
import {
|
|
71
71
|
classifyUnparsableToolArgs,
|
|
72
72
|
collectStablePromptPrefix,
|
|
@@ -90,22 +90,26 @@ import {
|
|
|
90
90
|
toOpenAiCompatibleMessages,
|
|
91
91
|
toResponsesTools,
|
|
92
92
|
transferDowngradedToolTurnOrigin
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-DI7ZFGDQ.js";
|
|
94
94
|
import {
|
|
95
95
|
BRIDGE_STREAM_MAX_CHARS,
|
|
96
96
|
DEFAULT_READ_DIALOG_MAX_RESPONSE_CHARS,
|
|
97
|
+
DEFAULT_SUBTASK_MAX_TOOL_CALLS,
|
|
98
|
+
DEFAULT_SUBTASK_MAX_WALL_CLOCK_MS,
|
|
97
99
|
NOLO_WORKSPACE_TOOL_NAMES,
|
|
98
100
|
applyToolSurfaceConstraints,
|
|
99
101
|
buildDialogReadEnvelope,
|
|
100
102
|
buildNoloWorkspaceCommandArgs,
|
|
101
103
|
buildNoloWorkspaceOpenAiTools,
|
|
104
|
+
buildSubtaskBudgetExhaustedContent,
|
|
102
105
|
createStreamingDialogReadProjector,
|
|
106
|
+
createSubtaskBudgetTracker,
|
|
103
107
|
noloPositiveIntegerString,
|
|
104
108
|
noloStringArg,
|
|
105
109
|
parseNoloWorkspaceToolArguments,
|
|
106
110
|
readTextStreamUpToChars,
|
|
107
111
|
resolveNoloDialogInput
|
|
108
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-3M52COK5.js";
|
|
109
113
|
import {
|
|
110
114
|
buildDialogFallbackTitleFromUserInput
|
|
111
115
|
} from "./chunk-2MBTWINN.js";
|
|
@@ -120,7 +124,7 @@ import {
|
|
|
120
124
|
resolveEmptyAssistantFallbackMessage,
|
|
121
125
|
resolveEmptyAssistantOutcome,
|
|
122
126
|
resolveTruncatedReasoningTailLog
|
|
123
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-HEC32F3G.js";
|
|
124
128
|
import {
|
|
125
129
|
COMPACTION_SUMMARY_SCHEMA_VERSION,
|
|
126
130
|
COMPACTION_SUMMARY_SYSTEM_PROMPT,
|
|
@@ -143,7 +147,7 @@ import {
|
|
|
143
147
|
sha256Hex,
|
|
144
148
|
truncateToolOutputForContext,
|
|
145
149
|
withProviderCallTimingFields
|
|
146
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-ASSNAASW.js";
|
|
147
151
|
import {
|
|
148
152
|
clipCompactText
|
|
149
153
|
} from "./chunk-5MMAK75Q.js";
|
|
@@ -153,6 +157,12 @@ import {
|
|
|
153
157
|
import {
|
|
154
158
|
isAbortError
|
|
155
159
|
} from "./chunk-7DPNBQSV.js";
|
|
160
|
+
import {
|
|
161
|
+
buildDialogSummaryLayer
|
|
162
|
+
} from "./chunk-VEA7H5FG.js";
|
|
163
|
+
import {
|
|
164
|
+
buildUserResponseLanguageContext
|
|
165
|
+
} from "./chunk-4VJAC32I.js";
|
|
156
166
|
import {
|
|
157
167
|
canonicalizeToolName,
|
|
158
168
|
canonicalizeToolNames
|
|
@@ -167,16 +177,16 @@ import {
|
|
|
167
177
|
import {
|
|
168
178
|
asOptionalPositiveFiniteNumber
|
|
169
179
|
} from "./chunk-U6VC4MU4.js";
|
|
170
|
-
import {
|
|
171
|
-
asOptionalFiniteNumber
|
|
172
|
-
} from "./chunk-WWC7I6TA.js";
|
|
173
180
|
import {
|
|
174
181
|
estimateTokenCount
|
|
175
182
|
} from "./chunk-PSCNXBYA.js";
|
|
183
|
+
import {
|
|
184
|
+
asOptionalFiniteNumber
|
|
185
|
+
} from "./chunk-WWC7I6TA.js";
|
|
176
186
|
import {
|
|
177
187
|
buildProviderAuthHeaders,
|
|
178
188
|
buildProviderExecutionPlan
|
|
179
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-PIG2IUVZ.js";
|
|
180
190
|
import {
|
|
181
191
|
isRecord
|
|
182
192
|
} from "./chunk-KUG52IAP.js";
|
|
@@ -198,12 +208,6 @@ import {
|
|
|
198
208
|
import {
|
|
199
209
|
resolveNoloStateDir
|
|
200
210
|
} from "./chunk-ZWQUWF6W.js";
|
|
201
|
-
import {
|
|
202
|
-
buildDialogSummaryLayer
|
|
203
|
-
} from "./chunk-VEA7H5FG.js";
|
|
204
|
-
import {
|
|
205
|
-
buildUserResponseLanguageContext
|
|
206
|
-
} from "./chunk-4VJAC32I.js";
|
|
207
211
|
import {
|
|
208
212
|
__export
|
|
209
213
|
} from "./chunk-4VNS5WPM.js";
|
|
@@ -14050,8 +14054,11 @@ function detectExecShellSynchronousWarnings(command, shell) {
|
|
|
14050
14054
|
}
|
|
14051
14055
|
|
|
14052
14056
|
// packages/agent-runtime/workspaceShell.ts
|
|
14053
|
-
import {
|
|
14057
|
+
import { createWriteStream, mkdirSync as mkdirSync2 } from "node:fs";
|
|
14058
|
+
import { dirname, join as join4, resolve } from "node:path";
|
|
14054
14059
|
import { spawn as spawnChildProcess } from "node:child_process";
|
|
14060
|
+
import { randomUUID } from "node:crypto";
|
|
14061
|
+
import { tmpdir } from "node:os";
|
|
14055
14062
|
|
|
14056
14063
|
// packages/agent-runtime/runtimeCompat.ts
|
|
14057
14064
|
import { existsSync as existsSync2, readdirSync as readdirSync2, statSync as statSync2 } from "node:fs";
|
|
@@ -14987,39 +14994,168 @@ function truncateToolOutput(value, limit = 2e4, options) {
|
|
|
14987
14994
|
${tail}`;
|
|
14988
14995
|
}
|
|
14989
14996
|
var DEFAULT_MAX_STREAM_BUFFER_BYTES = 5 * 1024 * 1024;
|
|
14990
|
-
function readNodeStream(stream,
|
|
14997
|
+
function readNodeStream(stream, maxBytesOrOptions = DEFAULT_MAX_STREAM_BUFFER_BYTES) {
|
|
14991
14998
|
if (!stream) return Promise.resolve("");
|
|
14999
|
+
const options = typeof maxBytesOrOptions === "number" ? { maxBytes: maxBytesOrOptions } : maxBytesOrOptions ?? {};
|
|
15000
|
+
const maxBytes = typeof options.maxBytes === "number" && Number.isFinite(options.maxBytes) && options.maxBytes >= 0 ? options.maxBytes : DEFAULT_MAX_STREAM_BUFFER_BYTES;
|
|
15001
|
+
const spillPath = asOptionalTrimmedString(options.spillPath);
|
|
15002
|
+
const createSink = options.spillSinkFactory ?? ((path) => createWriteStream(path));
|
|
14992
15003
|
return new Promise((resolveStream, rejectStream) => {
|
|
14993
15004
|
const chunks2 = [];
|
|
14994
15005
|
let totalBytes = 0;
|
|
14995
15006
|
let settled = false;
|
|
15007
|
+
let truncated = false;
|
|
15008
|
+
let spillState = spillPath ? "idle" : "disabled";
|
|
15009
|
+
let spillError = null;
|
|
15010
|
+
let spillSink = null;
|
|
15011
|
+
let sourcePausedForSpill = false;
|
|
15012
|
+
let sinkFinished = false;
|
|
14996
15013
|
const formatLimit = maxBytes >= 1024 * 1024 ? `${Math.round(maxBytes / (1024 * 1024))}MB` : `${Math.round(maxBytes / 1024)}KB`;
|
|
14997
|
-
const
|
|
15014
|
+
const resumeSourceIfPaused = () => {
|
|
15015
|
+
if (!sourcePausedForSpill) return;
|
|
15016
|
+
sourcePausedForSpill = false;
|
|
15017
|
+
try {
|
|
15018
|
+
stream.resume?.();
|
|
15019
|
+
} catch {
|
|
15020
|
+
}
|
|
15021
|
+
};
|
|
15022
|
+
const markSpillFailed = (error) => {
|
|
15023
|
+
if (spillState === "failed") return;
|
|
15024
|
+
spillState = "failed";
|
|
15025
|
+
if (!spillError) {
|
|
15026
|
+
spillError = toErrorMessage(error);
|
|
15027
|
+
}
|
|
15028
|
+
const sink = spillSink;
|
|
15029
|
+
spillSink = null;
|
|
15030
|
+
if (sink) {
|
|
15031
|
+
try {
|
|
15032
|
+
sink.destroy?.();
|
|
15033
|
+
} catch {
|
|
15034
|
+
}
|
|
15035
|
+
}
|
|
15036
|
+
resumeSourceIfPaused();
|
|
15037
|
+
};
|
|
15038
|
+
const writeToSink = (buf) => {
|
|
15039
|
+
const sink = spillSink;
|
|
15040
|
+
if (!sink || spillState !== "open") return;
|
|
15041
|
+
if (sink.destroyed === true) {
|
|
15042
|
+
markSpillFailed(new Error("spill writable closed before finish"));
|
|
15043
|
+
return;
|
|
15044
|
+
}
|
|
15045
|
+
let accepted = true;
|
|
15046
|
+
try {
|
|
15047
|
+
accepted = sink.write(buf) !== false;
|
|
15048
|
+
} catch (error) {
|
|
15049
|
+
markSpillFailed(error);
|
|
15050
|
+
return;
|
|
15051
|
+
}
|
|
15052
|
+
if (!accepted && !sourcePausedForSpill) {
|
|
15053
|
+
sourcePausedForSpill = true;
|
|
15054
|
+
try {
|
|
15055
|
+
stream.pause?.();
|
|
15056
|
+
} catch {
|
|
15057
|
+
sourcePausedForSpill = false;
|
|
15058
|
+
}
|
|
15059
|
+
}
|
|
15060
|
+
};
|
|
15061
|
+
const openSpill = (headChunks, crossingChunk) => {
|
|
15062
|
+
if (!spillPath || spillState !== "idle") return;
|
|
15063
|
+
let sink;
|
|
15064
|
+
try {
|
|
15065
|
+
mkdirSync2(dirname(spillPath), { recursive: true });
|
|
15066
|
+
sink = createSink(spillPath);
|
|
15067
|
+
sink.on("error", (error) => markSpillFailed(error));
|
|
15068
|
+
sink.on("drain", () => {
|
|
15069
|
+
if (settled) return;
|
|
15070
|
+
resumeSourceIfPaused();
|
|
15071
|
+
});
|
|
15072
|
+
sink.on("finish", () => {
|
|
15073
|
+
sinkFinished = true;
|
|
15074
|
+
});
|
|
15075
|
+
sink.on("close", () => {
|
|
15076
|
+
if (sinkFinished || spillState !== "open") return;
|
|
15077
|
+
markSpillFailed(new Error("spill writable closed before finish"));
|
|
15078
|
+
});
|
|
15079
|
+
} catch (error) {
|
|
15080
|
+
spillState = "failed";
|
|
15081
|
+
spillError = toErrorMessage(error);
|
|
15082
|
+
spillSink = null;
|
|
15083
|
+
return;
|
|
15084
|
+
}
|
|
15085
|
+
spillSink = sink;
|
|
15086
|
+
spillState = "open";
|
|
15087
|
+
for (const head3 of headChunks) writeToSink(head3);
|
|
15088
|
+
writeToSink(crossingChunk);
|
|
15089
|
+
};
|
|
15090
|
+
const finalize2 = (wasTruncated) => {
|
|
14998
15091
|
if (settled) return;
|
|
14999
15092
|
settled = true;
|
|
15000
|
-
|
|
15001
|
-
|
|
15002
|
-
|
|
15093
|
+
const truncatedNow = wasTruncated || truncated;
|
|
15094
|
+
const baseText = Buffer.concat(chunks2).toString("utf8");
|
|
15095
|
+
const done4 = () => {
|
|
15096
|
+
let text2 = baseText;
|
|
15097
|
+
if (truncatedNow) {
|
|
15098
|
+
const notes = [`output exceeded ${formatLimit} buffer limit`];
|
|
15099
|
+
if (spillState === "ok") {
|
|
15100
|
+
notes.push(`full output: ${spillPath}`);
|
|
15101
|
+
} else if (spillPath) {
|
|
15102
|
+
notes.push(
|
|
15103
|
+
`spill failed${spillError ? ` (${spillError})` : ""}; output incomplete`
|
|
15104
|
+
);
|
|
15105
|
+
}
|
|
15106
|
+
text2 += `
|
|
15003
15107
|
|
|
15004
|
-
[stream pipe truncated:
|
|
15108
|
+
[stream pipe truncated: ${notes.join("; ")}]`;
|
|
15109
|
+
}
|
|
15110
|
+
resolveStream(text2);
|
|
15111
|
+
};
|
|
15112
|
+
const sink = spillSink;
|
|
15113
|
+
if (!sink || spillState !== "open") {
|
|
15114
|
+
done4();
|
|
15115
|
+
return;
|
|
15116
|
+
}
|
|
15117
|
+
let closed = false;
|
|
15118
|
+
const settleSink = (failed, error) => {
|
|
15119
|
+
if (closed) return;
|
|
15120
|
+
closed = true;
|
|
15121
|
+
if (failed) {
|
|
15122
|
+
markSpillFailed(error ?? new Error("spill write failed"));
|
|
15123
|
+
} else if (spillState === "open") {
|
|
15124
|
+
spillState = "ok";
|
|
15125
|
+
}
|
|
15126
|
+
done4();
|
|
15127
|
+
};
|
|
15128
|
+
if (sink.destroyed === true) {
|
|
15129
|
+
settleSink(true, new Error("spill writable closed before finish"));
|
|
15130
|
+
return;
|
|
15131
|
+
}
|
|
15132
|
+
sink.once("error", (error) => settleSink(true, error));
|
|
15133
|
+
sink.once("finish", () => settleSink(false));
|
|
15134
|
+
sink.once("close", () => {
|
|
15135
|
+
settleSink(!sinkFinished, new Error("spill writable closed before finish"));
|
|
15136
|
+
});
|
|
15137
|
+
try {
|
|
15138
|
+
sink.end?.();
|
|
15139
|
+
} catch (error) {
|
|
15140
|
+
settleSink(true, error);
|
|
15005
15141
|
}
|
|
15006
|
-
resolveStream(text2);
|
|
15007
15142
|
};
|
|
15008
15143
|
stream.on("data", (chunk) => {
|
|
15009
15144
|
if (settled) return;
|
|
15010
15145
|
const buf = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
15146
|
+
if (truncated) {
|
|
15147
|
+
writeToSink(buf);
|
|
15148
|
+
return;
|
|
15149
|
+
}
|
|
15011
15150
|
if (totalBytes + buf.length >= maxBytes) {
|
|
15012
15151
|
const remaining = Math.max(0, maxBytes - totalBytes);
|
|
15152
|
+
const headChunks = chunks2.slice();
|
|
15013
15153
|
if (remaining > 0) {
|
|
15014
15154
|
chunks2.push(buf.subarray(0, remaining));
|
|
15015
15155
|
}
|
|
15016
|
-
|
|
15017
|
-
|
|
15018
|
-
|
|
15019
|
-
}
|
|
15020
|
-
} catch {
|
|
15021
|
-
}
|
|
15022
|
-
finalize2(true);
|
|
15156
|
+
totalBytes += buf.length;
|
|
15157
|
+
truncated = true;
|
|
15158
|
+
openSpill(headChunks, buf);
|
|
15023
15159
|
return;
|
|
15024
15160
|
}
|
|
15025
15161
|
totalBytes += buf.length;
|
|
@@ -15028,6 +15164,19 @@ function readNodeStream(stream, maxBytes = DEFAULT_MAX_STREAM_BUFFER_BYTES) {
|
|
|
15028
15164
|
stream.on("error", (error) => {
|
|
15029
15165
|
if (settled) return;
|
|
15030
15166
|
settled = true;
|
|
15167
|
+
const sink = spillSink;
|
|
15168
|
+
spillSink = null;
|
|
15169
|
+
if (!spillError) spillError = toErrorMessage(error);
|
|
15170
|
+
if (spillState !== "failed" && spillState !== "disabled") {
|
|
15171
|
+
spillState = "failed";
|
|
15172
|
+
}
|
|
15173
|
+
if (sink) {
|
|
15174
|
+
try {
|
|
15175
|
+
sink.destroy?.();
|
|
15176
|
+
} catch {
|
|
15177
|
+
}
|
|
15178
|
+
}
|
|
15179
|
+
resumeSourceIfPaused();
|
|
15031
15180
|
rejectStream(error);
|
|
15032
15181
|
});
|
|
15033
15182
|
stream.on("end", () => finalize2(false));
|
|
@@ -15140,8 +15289,12 @@ async function runWorkspaceCommand(args2) {
|
|
|
15140
15289
|
process.removeListener("SIGINT", cleanupChildOnHostSignal);
|
|
15141
15290
|
};
|
|
15142
15291
|
exitPromise.then(detachSignalCleanup, detachSignalCleanup);
|
|
15143
|
-
const stdoutCapture = stdoutPromiseResult(
|
|
15144
|
-
|
|
15292
|
+
const stdoutCapture = stdoutPromiseResult(
|
|
15293
|
+
readNodeStream(proc.stdout, { spillPath: join4(tmpdir(), `nolo-stream-${randomUUID()}.log`) })
|
|
15294
|
+
);
|
|
15295
|
+
const stderrCapture = stdoutPromiseResult(
|
|
15296
|
+
readNodeStream(proc.stderr, { spillPath: join4(tmpdir(), `nolo-stream-${randomUUID()}-stderr.log`) })
|
|
15297
|
+
);
|
|
15145
15298
|
const killChild = (signal) => {
|
|
15146
15299
|
if (detached && typeof proc.pid === "number") {
|
|
15147
15300
|
try {
|
|
@@ -15550,11 +15703,11 @@ async function invokeCapability(capabilityOrName, input, ctx = {}) {
|
|
|
15550
15703
|
}
|
|
15551
15704
|
|
|
15552
15705
|
// packages/agent-runtime/localWorkspaceTools.ts
|
|
15553
|
-
import { existsSync as
|
|
15706
|
+
import { existsSync as existsSync4 } from "node:fs";
|
|
15554
15707
|
import { createHash as createHash4 } from "node:crypto";
|
|
15555
15708
|
import { lstat, mkdir, readdir as readdir2, readFile as readFile3, realpath, stat as stat3, writeFile } from "node:fs/promises";
|
|
15556
15709
|
import { homedir } from "node:os";
|
|
15557
|
-
import { dirname, isAbsolute as isAbsolute2, relative as relative3, resolve as resolve4, sep } from "node:path";
|
|
15710
|
+
import { dirname as dirname2, isAbsolute as isAbsolute2, relative as relative3, resolve as resolve4, sep } from "node:path";
|
|
15558
15711
|
import { spawn as spawnChildProcess3 } from "node:child_process";
|
|
15559
15712
|
|
|
15560
15713
|
// packages/core/readRangeLedger.ts
|
|
@@ -16836,7 +16989,7 @@ function resolveRipgrepBinary(env = process.env) {
|
|
|
16836
16989
|
const fromEnv = asOptionalTrimmedString(env.NOLO_BUNDLED_RG);
|
|
16837
16990
|
if (fromEnv) {
|
|
16838
16991
|
try {
|
|
16839
|
-
if (
|
|
16992
|
+
if (existsSync4(fromEnv)) return fromEnv;
|
|
16840
16993
|
} catch {
|
|
16841
16994
|
}
|
|
16842
16995
|
}
|
|
@@ -16942,6 +17095,7 @@ ${tail}`,
|
|
|
16942
17095
|
};
|
|
16943
17096
|
}
|
|
16944
17097
|
var READ_FILE_LEDGER_MAX_RECORDS = 64;
|
|
17098
|
+
var READ_FILE_LEDGER_MAX_KEYS = 256;
|
|
16945
17099
|
async function readFileTool(args2) {
|
|
16946
17100
|
const parsed = parseWorkspaceToolArguments(args2.call.arguments);
|
|
16947
17101
|
const requestedPath = requireWorkspaceToolPath(parsed);
|
|
@@ -16980,6 +17134,8 @@ async function readFileTool(args2) {
|
|
|
16980
17134
|
const retainedCap = resolveHistoricalToolContentCap("readFile", 0);
|
|
16981
17135
|
const retained = filterRetainedLedgerRecords(entry.records, retainedCap);
|
|
16982
17136
|
if (retained.length > 0 && isLineRangeCovered(requestRange, retained)) {
|
|
17137
|
+
ledger.delete(relativePath);
|
|
17138
|
+
ledger.set(relativePath, entry);
|
|
16983
17139
|
return {
|
|
16984
17140
|
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
17141
|
metadata: {
|
|
@@ -17012,10 +17168,16 @@ async function readFileTool(args2) {
|
|
|
17012
17168
|
const persistedChars = truncatedRead.content.length + "\n\n[tool metadata]\n".length + JSON.stringify(metadata).length;
|
|
17013
17169
|
const records = entry?.records ?? [];
|
|
17014
17170
|
records.push({ ...requestRange, chars: persistedChars });
|
|
17171
|
+
ledger.delete(relativePath);
|
|
17015
17172
|
ledger.set(relativePath, {
|
|
17016
17173
|
fingerprint,
|
|
17017
17174
|
records: records.slice(-READ_FILE_LEDGER_MAX_RECORDS)
|
|
17018
17175
|
});
|
|
17176
|
+
while (ledger.size > READ_FILE_LEDGER_MAX_KEYS) {
|
|
17177
|
+
const oldestKey = ledger.keys().next().value;
|
|
17178
|
+
if (oldestKey === void 0) break;
|
|
17179
|
+
ledger.delete(oldestKey);
|
|
17180
|
+
}
|
|
17019
17181
|
}
|
|
17020
17182
|
return { content: truncatedRead.content, metadata };
|
|
17021
17183
|
}
|
|
@@ -17028,7 +17190,7 @@ async function writeFileTool(args2) {
|
|
|
17028
17190
|
requestedPath,
|
|
17029
17191
|
...args2.confirmExternalFileAccess ? { confirmExternalFileAccess: args2.confirmExternalFileAccess } : {}
|
|
17030
17192
|
});
|
|
17031
|
-
await mkdir(
|
|
17193
|
+
await mkdir(dirname2(absolutePath), { recursive: true });
|
|
17032
17194
|
await writeFile(absolutePath, content, "utf8");
|
|
17033
17195
|
const relativePath = normalizeWorkspaceRelativePath({
|
|
17034
17196
|
workspaceRoot: resolve4(args2.workspaceRoot),
|
|
@@ -17485,7 +17647,7 @@ async function execShellTool(args2) {
|
|
|
17485
17647
|
);
|
|
17486
17648
|
}
|
|
17487
17649
|
var LAUNCH_PROCESS_STREAM_RING_CHARS = 65536;
|
|
17488
|
-
var LAUNCH_PROCESS_STREAM_CAPTURE_MAX_CHARS =
|
|
17650
|
+
var LAUNCH_PROCESS_STREAM_CAPTURE_MAX_CHARS = 1e6;
|
|
17489
17651
|
function createLaunchProcessStreamCapture() {
|
|
17490
17652
|
let ring = "";
|
|
17491
17653
|
let full = null;
|
|
@@ -18709,7 +18871,7 @@ var normalizeContextBlockScopes = (legacyBlocks = void 0, scopes = void 0) => {
|
|
|
18709
18871
|
};
|
|
18710
18872
|
|
|
18711
18873
|
// packages/agent-runtime/localAutoCompaction.ts
|
|
18712
|
-
import { randomUUID } from "node:crypto";
|
|
18874
|
+
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
18713
18875
|
function toPlanCompressionMessages(history) {
|
|
18714
18876
|
return history.map((message, index) => ({
|
|
18715
18877
|
id: typeof message.id === "string" && message.id.length > 0 ? message.id : `local-${index}`,
|
|
@@ -18944,7 +19106,7 @@ async function maybeAutoCompactLocalHistory(args2) {
|
|
|
18944
19106
|
};
|
|
18945
19107
|
}
|
|
18946
19108
|
emitPhase({ kind: "compaction-start" });
|
|
18947
|
-
const compactionAttemptId =
|
|
19109
|
+
const compactionAttemptId = randomUUID2();
|
|
18948
19110
|
let compactionT0 = Date.now();
|
|
18949
19111
|
let compactionInputTokens;
|
|
18950
19112
|
let compactionPrevSummaryTokens;
|
|
@@ -19624,6 +19786,17 @@ async function runLocalAgentTurn(input) {
|
|
|
19624
19786
|
observationBoundary.attachCallbacks(legacyCallbacks);
|
|
19625
19787
|
}
|
|
19626
19788
|
const loopTiming = createLoopTiming();
|
|
19789
|
+
const subtaskBudgetClock = input.subtaskBudgetNow ?? (() => Date.now());
|
|
19790
|
+
const subtaskBudgetLimits = {
|
|
19791
|
+
maxToolCalls: input.subtaskMaxToolCalls ?? input.subtaskBudgetLimits?.maxToolCalls ?? DEFAULT_SUBTASK_MAX_TOOL_CALLS,
|
|
19792
|
+
maxWallClockMs: input.subtaskMaxWallClockMs ?? input.subtaskBudgetLimits?.maxWallClockMs ?? DEFAULT_SUBTASK_MAX_WALL_CLOCK_MS
|
|
19793
|
+
};
|
|
19794
|
+
const subtaskBudgetTracker = input.runKind === "subtask" ? createSubtaskBudgetTracker({
|
|
19795
|
+
limits: subtaskBudgetLimits,
|
|
19796
|
+
now: subtaskBudgetClock,
|
|
19797
|
+
// 墙钟从 run 开始计(含 provider 初始化与首轮前的准备)。
|
|
19798
|
+
startedAtMs: subtaskBudgetClock()
|
|
19799
|
+
}) : null;
|
|
19627
19800
|
try {
|
|
19628
19801
|
loopTiming.mark("turnStart", 0);
|
|
19629
19802
|
let agentConfig = await input.adapter.loadAgentConfig(input.agentRef);
|
|
@@ -19859,12 +20032,8 @@ async function runLocalAgentTurn(input) {
|
|
|
19859
20032
|
`[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
20033
|
);
|
|
19861
20034
|
}
|
|
19862
|
-
const supportsImages = resolveAgentImageInputSupport(
|
|
19863
|
-
|
|
19864
|
-
provider: agentConfig.provider,
|
|
19865
|
-
model: agentConfig.model,
|
|
19866
|
-
hasVision: agentConfig.hasVision
|
|
19867
|
-
});
|
|
20035
|
+
const supportsImages = resolveAgentImageInputSupport(agentConfig);
|
|
20036
|
+
let imageDowngradeEmitted = false;
|
|
19868
20037
|
if (!supportsImages && hasImageInRuntimeMessages(messages)) {
|
|
19869
20038
|
messages = filterImagePartsFromMessages(messages, false);
|
|
19870
20039
|
emitLoopEvent(observationBoundary, {
|
|
@@ -19872,6 +20041,7 @@ async function runLocalAgentTurn(input) {
|
|
|
19872
20041
|
reason: "no-vision",
|
|
19873
20042
|
atMs: Date.now()
|
|
19874
20043
|
});
|
|
20044
|
+
imageDowngradeEmitted = true;
|
|
19875
20045
|
}
|
|
19876
20046
|
const prefixCount = builtMessages.prefixCount;
|
|
19877
20047
|
const capToolMessage = (msg) => msg.role === "tool" && typeof msg.content === "string" ? {
|
|
@@ -19886,7 +20056,7 @@ async function runLocalAgentTurn(input) {
|
|
|
19886
20056
|
});
|
|
19887
20057
|
const userInputText = extractUserInputText(input.input);
|
|
19888
20058
|
let toolCallCount = 0;
|
|
19889
|
-
let result4;
|
|
20059
|
+
let result4 = { content: "" };
|
|
19890
20060
|
const usageLedger = createTurnUsageLedger({
|
|
19891
20061
|
model: agentConfig.model,
|
|
19892
20062
|
provider: agentConfig.provider,
|
|
@@ -19898,12 +20068,36 @@ async function runLocalAgentTurn(input) {
|
|
|
19898
20068
|
if (initialCompactionUsage) usageLedger.addCompaction(initialCompactionUsage);
|
|
19899
20069
|
let loopError;
|
|
19900
20070
|
let round = 0;
|
|
20071
|
+
let budgetExhaustion = null;
|
|
20072
|
+
const executedToolNameLog = [];
|
|
20073
|
+
const markBudgetExhausted = () => {
|
|
20074
|
+
if (!subtaskBudgetTracker || budgetExhaustion) return;
|
|
20075
|
+
const exhaustion = subtaskBudgetTracker.exhaustion();
|
|
20076
|
+
if (!exhaustion) return;
|
|
20077
|
+
budgetExhaustion = exhaustion;
|
|
20078
|
+
emitLoopEvent(observationBoundary, {
|
|
20079
|
+
kind: "budget-exhausted",
|
|
20080
|
+
limit: exhaustion.limit,
|
|
20081
|
+
atMs: exhaustion.atMs,
|
|
20082
|
+
maxToolCalls: exhaustion.limits.maxToolCalls,
|
|
20083
|
+
maxWallClockMs: exhaustion.limits.maxWallClockMs,
|
|
20084
|
+
toolCallsExecuted: exhaustion.toolCallsExecuted,
|
|
20085
|
+
elapsedMs: exhaustion.elapsedMs,
|
|
20086
|
+
round
|
|
20087
|
+
});
|
|
20088
|
+
};
|
|
19901
20089
|
let emptyAssistantRepairPending = false;
|
|
19902
20090
|
let emptyAssistantRepairUsed = false;
|
|
19903
20091
|
let reasoningEmptyRepairCount = 0;
|
|
19904
20092
|
let skipFinalAppend = false;
|
|
19905
20093
|
let partialContent = "";
|
|
19906
20094
|
const progressGuard = createLocalLoopProgressGuard(input.progressGuardConfig);
|
|
20095
|
+
const budgetAdmissionGate = () => {
|
|
20096
|
+
if (!subtaskBudgetTracker) return true;
|
|
20097
|
+
if (!subtaskBudgetTracker.isExhausted()) return true;
|
|
20098
|
+
markBudgetExhausted();
|
|
20099
|
+
return false;
|
|
20100
|
+
};
|
|
19907
20101
|
try {
|
|
19908
20102
|
const provider = await resolveProviderOnce();
|
|
19909
20103
|
const applyPendingInjections = () => {
|
|
@@ -19938,6 +20132,14 @@ async function runLocalAgentTurn(input) {
|
|
|
19938
20132
|
roundBudgetWarningInjected = true;
|
|
19939
20133
|
}
|
|
19940
20134
|
const preparedMessages = prepareMessagesForProviderCall(transcript.working());
|
|
20135
|
+
if (!supportsImages && hasImageInRuntimeMessages(preparedMessages.messages) && !imageDowngradeEmitted) {
|
|
20136
|
+
emitLoopEvent(observationBoundary, {
|
|
20137
|
+
kind: "image-downgraded",
|
|
20138
|
+
reason: "no-vision",
|
|
20139
|
+
atMs: Date.now()
|
|
20140
|
+
});
|
|
20141
|
+
imageDowngradeEmitted = true;
|
|
20142
|
+
}
|
|
19941
20143
|
const baseRequestMessages = filterImagePartsFromMessages(
|
|
19942
20144
|
preparedMessages.messages,
|
|
19943
20145
|
supportsImages
|
|
@@ -19972,6 +20174,9 @@ async function runLocalAgentTurn(input) {
|
|
|
19972
20174
|
messages: requestMessages,
|
|
19973
20175
|
toolsHash: safeToolNamesHash(agentTools)
|
|
19974
20176
|
});
|
|
20177
|
+
if (!budgetAdmissionGate()) {
|
|
20178
|
+
break;
|
|
20179
|
+
}
|
|
19975
20180
|
result4 = await runCompleteWithTimeout({
|
|
19976
20181
|
provider,
|
|
19977
20182
|
messages: requestMessages,
|
|
@@ -20160,6 +20365,11 @@ ${reasoningTailLog}
|
|
|
20160
20365
|
const slotResults = new Array(toolCalls.length);
|
|
20161
20366
|
const runSingleTool = async ({ index, toolCall }) => {
|
|
20162
20367
|
throwIfAborted(input);
|
|
20368
|
+
if (!budgetAdmissionGate()) {
|
|
20369
|
+
skippedToolCalls.push(toolCall);
|
|
20370
|
+
return;
|
|
20371
|
+
}
|
|
20372
|
+
subtaskBudgetTracker?.recordToolCallExecuted();
|
|
20163
20373
|
const { toolResult, toolExecMs } = await executeToolCall({
|
|
20164
20374
|
input,
|
|
20165
20375
|
toolCall,
|
|
@@ -20179,6 +20389,7 @@ ${reasoningTailLog}
|
|
|
20179
20389
|
toolResult,
|
|
20180
20390
|
toolExecMs
|
|
20181
20391
|
};
|
|
20392
|
+
executedToolNameLog.push(toolCall.function.name);
|
|
20182
20393
|
};
|
|
20183
20394
|
const commitSlot = (i) => {
|
|
20184
20395
|
const toolCall = toolCalls[i];
|
|
@@ -20204,6 +20415,7 @@ ${reasoningTailLog}
|
|
|
20204
20415
|
...observedMetadata ? { tool_result_metadata: observedMetadata } : {}
|
|
20205
20416
|
});
|
|
20206
20417
|
};
|
|
20418
|
+
const skippedToolCalls = [];
|
|
20207
20419
|
const batches = partitionToolCallsIntoBatches(toolCalls);
|
|
20208
20420
|
for (const batch of batches) {
|
|
20209
20421
|
throwIfAborted(input);
|
|
@@ -20227,6 +20439,17 @@ ${reasoningTailLog}
|
|
|
20227
20439
|
}
|
|
20228
20440
|
if (batchError) throw batchError;
|
|
20229
20441
|
}
|
|
20442
|
+
for (const skipped of skippedToolCalls) {
|
|
20443
|
+
transcript.pushTool({
|
|
20444
|
+
role: "tool",
|
|
20445
|
+
content: "[\u5B50\u4EFB\u52A1\u9884\u7B97\u4E0A\u9650\u5DF2\u89E6\u53D1] \u8BE5\u5DE5\u5177\u8C03\u7528\u672A\u6267\u884C\uFF1A\u5DF2\u8FBE\u5B50\u4EFB\u52A1\u9884\u7B97\u4E0A\u9650\uFF0C\u672C\u8F6E\u4E0D\u518D\u53D1\u8D77\u65B0\u7684\u5DE5\u5177\u8C03\u7528\u3002",
|
|
20446
|
+
tool_call_id: skipped.id,
|
|
20447
|
+
toolName: skipped.function.name
|
|
20448
|
+
});
|
|
20449
|
+
}
|
|
20450
|
+
if (budgetExhaustion) {
|
|
20451
|
+
break;
|
|
20452
|
+
}
|
|
20230
20453
|
const toolExecutionGuardVerdict = progressGuard.observeToolExecution(
|
|
20231
20454
|
toolCalls,
|
|
20232
20455
|
executedToolResults
|
|
@@ -20248,12 +20471,29 @@ ${reasoningTailLog}
|
|
|
20248
20471
|
break;
|
|
20249
20472
|
}
|
|
20250
20473
|
await compaction.maybeCompactInLoop();
|
|
20474
|
+
if (!budgetAdmissionGate()) {
|
|
20475
|
+
break;
|
|
20476
|
+
}
|
|
20251
20477
|
loopTiming.mark("roundEnd", round);
|
|
20252
20478
|
round += 1;
|
|
20253
20479
|
}
|
|
20254
20480
|
} catch (error) {
|
|
20255
20481
|
loopError = error;
|
|
20256
20482
|
}
|
|
20483
|
+
if (budgetExhaustion) {
|
|
20484
|
+
const previousContent = typeof result4?.content === "string" ? result4.content.trim() : "";
|
|
20485
|
+
result4 = {
|
|
20486
|
+
...result4,
|
|
20487
|
+
content: [
|
|
20488
|
+
previousContent,
|
|
20489
|
+
buildSubtaskBudgetExhaustedContent({
|
|
20490
|
+
exhaustion: budgetExhaustion,
|
|
20491
|
+
roundsCompleted: round,
|
|
20492
|
+
recentToolNames: executedToolNameLog
|
|
20493
|
+
})
|
|
20494
|
+
].filter((part) => part.length > 0).join("\n\n")
|
|
20495
|
+
};
|
|
20496
|
+
}
|
|
20257
20497
|
if (loopError) {
|
|
20258
20498
|
const turnMessages2 = transcript.persisted(
|
|
20259
20499
|
sanitizedPersistedInput,
|
|
@@ -21704,7 +21944,7 @@ function buildLoadSkillExecutor(args2) {
|
|
|
21704
21944
|
const { resolveSkillByName } = await import("./skillDiscovery-QC35EQY4.js");
|
|
21705
21945
|
const resolved = resolveSkillByName(args2.cwd, name);
|
|
21706
21946
|
if (!resolved) {
|
|
21707
|
-
const { resolveBuiltinSkillByName } = await import("./builtinSkillRegistry-
|
|
21947
|
+
const { resolveBuiltinSkillByName } = await import("./builtinSkillRegistry-LJV7FHNI.js");
|
|
21708
21948
|
const builtin = resolveBuiltinSkillByName(name);
|
|
21709
21949
|
if (builtin) {
|
|
21710
21950
|
return {
|
|
@@ -21782,7 +22022,7 @@ function resolveSessionKey(args2) {
|
|
|
21782
22022
|
}
|
|
21783
22023
|
|
|
21784
22024
|
// packages/agent-runtime/devin/devinProvider.ts
|
|
21785
|
-
import { randomBytes, randomUUID as
|
|
22025
|
+
import { randomBytes, randomUUID as randomUUID3 } from "node:crypto";
|
|
21786
22026
|
var CLIENT_NAME = "chisel";
|
|
21787
22027
|
var CLIENT_VERSION = "3000.11.3";
|
|
21788
22028
|
function writeVarint(fieldNum, value) {
|
|
@@ -21842,7 +22082,7 @@ function encodeDevinClientMetadata(token) {
|
|
|
21842
22082
|
]);
|
|
21843
22083
|
}
|
|
21844
22084
|
function devinId(id, purpose) {
|
|
21845
|
-
return id?.sessionKey && isStableSessionIdentityEnabled() ? deriveStableUuid(id.sessionKey, purpose) :
|
|
22085
|
+
return id?.sessionKey && isStableSessionIdentityEnabled() ? deriveStableUuid(id.sessionKey, purpose) : randomUUID3();
|
|
21846
22086
|
}
|
|
21847
22087
|
function encodeDevinChatMessage(msg, identity2, index = 0) {
|
|
21848
22088
|
const source = msg.role === "assistant" ? 2 : msg.role === "tool" ? 4 : 1;
|
|
@@ -21936,7 +22176,7 @@ ${item.text}`;
|
|
|
21936
22176
|
const chatMessageBuffers = coalesced.map((m, i) => encodeDevinChatMessage(m, identity2, i));
|
|
21937
22177
|
const completionConfig = buildCompletionConfig({ temperature });
|
|
21938
22178
|
const modelConfig = Buffer.concat([
|
|
21939
|
-
writeStringField(1,
|
|
22179
|
+
writeStringField(1, randomUUID3()),
|
|
21940
22180
|
writeVarint(2, 1),
|
|
21941
22181
|
writeVarint(3, 4)
|
|
21942
22182
|
]);
|
|
@@ -21948,7 +22188,7 @@ ${item.text}`;
|
|
|
21948
22188
|
writeMessageField(8, completionConfig),
|
|
21949
22189
|
...tools.map((tool) => writeMessageField(10, encodeDevinToolDefinition(tool))),
|
|
21950
22190
|
writeMessageField(15, modelConfig),
|
|
21951
|
-
writeStringField(16,
|
|
22191
|
+
writeStringField(16, randomUUID3()),
|
|
21952
22192
|
writeVarint(20, 1),
|
|
21953
22193
|
writeStringField(21, model)
|
|
21954
22194
|
]);
|