nolo-cli 0.154.0-alpha.1 → 0.154.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-SDGDBNX5.js → _executeModel-3HHZYHHB.js} +54 -54
- package/{accountResolver-7RYB4D2P.js → accountResolver-55EDKEIK.js} +1 -1
- package/{action-SXJD5N5R.js → action-GPPJC5TI.js} +5 -5
- package/{addContentAction-65ONHX2T.js → addContentAction-XJQEJ4XW.js} +8 -8
- package/{addDialogAgentAction-WOLK7RB4.js → addDialogAgentAction-5WZX5CAY.js} +7 -7
- package/{agentDeleteCommand-W2XXF27A.js → agentDeleteCommand-ON2KVSJ5.js} +74 -75
- package/{agentEmailCommands-MSFGRDUZ.js → agentEmailCommands-2QPD5VP3.js} +77 -78
- package/{agentListCommands-G36AMSBR.js → agentListCommands-L33M3I6V.js} +35 -35
- package/{agentMachineCommands-YVVPDIHJ.js → agentMachineCommands-V44DPSED.js} +34 -31
- package/{agentProviderCommands-X2HQE6HY.js → agentProviderCommands-CXBHNONN.js} +5 -5
- package/{agentPullCommand-FA43RBRU.js → agentPullCommand-GXXEDOSA.js} +4 -4
- package/{agentRecordCommands-7G3DDI4L.js → agentRecordCommands-CKILCNQZ.js} +71 -72
- package/{agentRunCommand-ET7LIY7J.js → agentRunCommand-6IN7NK7H.js} +74 -74
- package/{agentRunControl-2C5GM3BW.js → agentRunControl-XBSNHHZE.js} +7 -7
- package/{agentRuntimeLocal-Q7ZOMZC7.js → agentRuntimeLocal-XCKO5FVP.js} +20 -18
- package/{agentSlice-MK5JTSZR.js → agentSlice-YT3VCCEW.js} +8 -8
- package/{appDeleteCommands-MMWT54BR.js → appDeleteCommands-2PJFNLAJ.js} +30 -28
- package/{appDeployCommands-OIFXVDOF.js → appDeployCommands-AZCMCMK6.js} +30 -28
- package/{appDeployStatusCommands-OTXMSDFB.js → appDeployStatusCommands-HSIKPVJN.js} +30 -28
- package/{appGetCommands-JPY36ANL.js → appGetCommands-IUZCPAP7.js} +30 -28
- package/{appListCommands-IHJGN36O.js → appListCommands-JLFVS44M.js} +30 -28
- package/{authCommand-J3XILHWW.js → authCommand-3Z52KJID.js} +22 -302
- package/{authCommands-77CHYBGF.js → authCommands-QOCKVPX3.js} +5 -5
- package/{builtinSkillRegistry-A6VSPJEJ.js → builtinSkillRegistry-LJV7FHNI.js} +4 -4
- package/{chromeCommands-OBBNJCLS.js → chromeCommands-IY4NVSXZ.js} +17 -10
- package/{chunk-SW4S4XYB.js → chunk-2AB2HA4M.js} +84 -34
- package/{chunk-YBNHPX4S.js → chunk-2ODX2C4E.js} +155 -31
- package/{chunk-FDT27L7S.js → chunk-2XDQAWBM.js} +18 -16
- package/{chunk-UGN77YJU.js → chunk-2ZYCNT2O.js} +232 -76
- package/{chunk-QFEW2ULV.js → chunk-32ZKZET7.js} +1 -1
- package/{chunk-QRRFQFFU.js → chunk-3GTVM7NJ.js} +22 -22
- package/{chunk-XPWGOTBQ.js → chunk-3L2WKC3W.js} +1 -8
- package/{chunk-LGCICX53.js → chunk-3L5MSPWX.js} +1 -1
- package/{chunk-4YRTZIVN.js → chunk-43OFVLWJ.js} +6 -6
- package/{chunk-6TF64IF2.js → chunk-4L4K6YR7.js} +16 -2
- package/{chunk-P5QACQDK.js → chunk-62TBKWTV.js} +1 -1
- package/{chunk-TRW43TSC.js → chunk-6EQD4AQL.js} +41 -1
- package/{chunk-YLMMECCH.js → chunk-6XIE5ZGI.js} +1 -1
- package/{chunk-UUPR3TD7.js → chunk-7RF4O6AT.js} +1 -3
- package/{chunk-OGI4JKBD.js → chunk-BAWAKW7X.js} +2 -2
- package/{chunk-2GGXHQIW.js → chunk-BLVSFYQ3.js} +4 -2
- package/{chunk-A7HQF6YH.js → chunk-CDLP56BS.js} +9 -9
- package/{chunk-5MM7NNO6.js → chunk-CNWKLQRL.js} +8 -3
- package/{chunk-TJ2VPCBE.js → chunk-DD2EOI6S.js} +2 -2
- package/{chunk-36OMEXXR.js → chunk-DLV3H464.js} +8 -8
- package/{chunk-4WLENVCW.js → chunk-DT7EWFTY.js} +6 -6
- package/{chunk-C5DLHL3R.js → chunk-ESMZW5PE.js} +3 -3
- package/{chunk-FJRGRIVL.js → chunk-EVPKKBSI.js} +17 -16
- package/{chunk-PSJWPSKS.js → chunk-EWO77ZGF.js} +9 -43
- package/{chunk-ZWG3C7VI.js → chunk-F3SOW2EU.js} +81 -1
- package/{chunk-RGBBF2RB.js → chunk-F5WASHQA.js} +279 -138
- package/{chunk-GJRCYN5X.js → chunk-FB5WLEOD.js} +21 -17
- package/{chunk-HHC5FJHS.js → chunk-FCUKCVKN.js} +12 -8
- package/{chunk-FY4SDK2E.js → chunk-FDLDMJTM.js} +1 -1
- package/{chunk-EM3YOZJ4.js → chunk-FFHV45HO.js} +3 -3
- package/{chunk-SWZEIKWQ.js → chunk-FZYKQFBQ.js} +3 -3
- package/{chunk-7KYVUFDG.js → chunk-G3VYRPTV.js} +5 -267
- package/{chunk-6MJNEXUU.js → chunk-HGDKT2D6.js} +4 -0
- package/{chunk-LXTNZVD4.js → chunk-HW7EBEC5.js} +35 -207
- package/{chunk-B2EGWZJG.js → chunk-I7S63QUU.js} +1 -1
- package/{chunk-PDJ6ZODI.js → chunk-IF7V3CBU.js} +1 -1
- package/{chunk-T6CBQ6BN.js → chunk-INFHX73M.js} +1 -1
- package/{chunk-N37ERV4O.js → chunk-JDKSYQQN.js} +5 -5
- package/{chunk-K43ZF2C3.js → chunk-JPPQ3GUO.js} +1 -1
- package/{chunk-PSYTZ4LK.js → chunk-JSB2OPQT.js} +134 -126
- package/{chunk-VEJFPTX7.js → chunk-JWEXJ573.js} +3 -3
- package/{chunk-ZG73GDYU.js → chunk-K25WQPP3.js} +253 -57
- package/{chunk-HKT6QXP3.js → chunk-KABQ74UQ.js} +5 -5
- package/{chunk-I2ZMGXXF.js → chunk-KFHREHUQ.js} +1 -1
- package/{chunk-3C2QLERX.js → chunk-KMDDG73K.js} +1 -1
- package/{chunk-AIZE5TDM.js → chunk-MAYW6V3E.js} +2 -2
- package/{chunk-IPAW7XLD.js → chunk-MFVOJ6KF.js} +2 -2
- package/{chunk-CBHGZRCE.js → chunk-MYOH447Z.js} +1 -1
- package/{chunk-TPG4CZHI.js → chunk-NHEWV5FD.js} +17 -3
- package/{chunk-G47IPDOK.js → chunk-O2IWR23M.js} +1 -1
- package/{chunk-OU7WCUB5.js → chunk-OLVOR45M.js} +2 -2
- package/{chunk-SUKSWFLP.js → chunk-PIG2IUVZ.js} +1 -1
- package/{chunk-SEJ5OS6F.js → chunk-PXYBUFDB.js} +4 -0
- package/{chunk-2MTE2PEH.js → chunk-QA2C5NKI.js} +5 -739
- package/{chunk-TYND6RDQ.js → chunk-QI2WVWXV.js} +73 -2
- package/{chunk-L6EQV5OC.js → chunk-QXZH5UDF.js} +3 -3
- package/{chunk-24UXUXPR.js → chunk-QZIOZDM6.js} +10 -10
- package/{chunk-C7M4N5RA.js → chunk-R2KWTENX.js} +3 -3
- package/{chunk-TNIX77YM.js → chunk-R5GO3YZP.js} +34 -1
- package/{chunk-UTIMX333.js → chunk-RIHQGFFA.js} +1 -1
- package/{chunk-4Z245KOA.js → chunk-SH3XD4E2.js} +8 -4
- package/{chunk-MM3662RS.js → chunk-SNAWGDXT.js} +263 -4
- package/{chunk-JGRPBIZZ.js → chunk-SQX235S2.js} +1 -1
- package/chunk-TT644UJD.js +188 -0
- package/{chunk-IYBIRCQV.js → chunk-U34KT53V.js} +29 -11
- package/{chunk-ANJTRG52.js → chunk-ULQAD7ZY.js} +18 -43
- package/{chunk-LOLOIIIP.js → chunk-UY73HNIN.js} +704 -663
- package/{chunk-I2RMFLLH.js → chunk-V7PCFWX3.js} +1 -1
- package/{chunk-KX6LPG7W.js → chunk-VXS4YYJ2.js} +8 -8
- package/{chunk-HXHSTRGH.js → chunk-VYNMQ6HW.js} +0 -27
- package/{chunk-IJERIUXS.js → chunk-WRCZXJ4N.js} +6 -3
- package/chunk-Y5GCAMGP.js +9 -0
- package/{chunk-JZX2XLKC.js → chunk-YCRROBDY.js} +1 -1
- package/{chunk-EYWJT7A2.js → chunk-YPG7TUQD.js} +3 -3
- package/chunk-YR47Y7CN.js +2685 -0
- package/{chunk-NEJZ5GLD.js → chunk-ZAV4YVEA.js} +18 -2
- package/{chunk-YANF2RR4.js → chunk-ZPKUJROL.js} +1 -1
- package/{chunk-WUR6LY7R.js → chunk-ZSLIYVIQ.js} +7 -7
- package/{commandRegistry-VSJPFX6B.js → commandRegistry-4LWXIPNX.js} +88 -96
- package/{contentThunks-65BTQQQE.js → contentThunks-QBL5NK2W.js} +21 -21
- package/{createAgentAutomationAction-SRMBZTAO.js → createAgentAutomationAction-5UWBLR2N.js} +21 -21
- package/{createDialogAction-OWAU72JP.js → createDialogAction-NJ2LE7KC.js} +25 -25
- package/{createPageAction-D4XGNX3P.js → createPageAction-7T3RINS2.js} +24 -25
- package/{dbSlice-S2HYXURM.js → dbSlice-6PVPY44C.js} +7 -7
- package/{deleteFile-6JWDDRVP.js → deleteFile-YM6NDPAR.js} +5 -5
- package/{dialogCommands-H3K7PTF6.js → dialogCommands-KMECTGCW.js} +34 -31
- package/{dialogSlice-GEBK3X5L.js → dialogSlice-GQMTD4HR.js} +20 -20
- package/{dist-NJC2W7I4.js → dist-Q2JSMAKA.js} +7 -361
- package/{docCreateCommands-KP64KMVL.js → docCreateCommands-4IT5PUAL.js} +31 -29
- package/{docDeleteCommands-C3F4SZSR.js → docDeleteCommands-QS66YNZV.js} +32 -30
- package/{docReadCommands-7H6BDOUR.js → docReadCommands-3SAI46YC.js} +31 -29
- package/{docStore-ARTZTJRA.js → docStore-PM5PYKPZ.js} +8 -8
- package/{docUpdateCommands-JDW4BRBH.js → docUpdateCommands-OGYG5BRC.js} +31 -29
- package/{getPricing-TX35D7PI.js → getPricing-XQ3N3RBP.js} +2 -2
- package/{handleSendMessageAction-SPGAO47U.js → handleSendMessageAction-EQ3U6K5N.js} +43 -39
- package/index.js +8 -8
- package/{localRuntimeAdapter-CHLHJSA3.js → localRuntimeAdapter-MO64KEOS.js} +69 -68
- package/{localRuntimeAuthority-JDAD7CB6.js → localRuntimeAuthority-BPN5OAQG.js} +2 -2
- package/{localRuntimeDb-CVC62PM5.js → localRuntimeDb-QIVAXMUL.js} +1 -1
- package/{machineCommands-GVFN64CM.js → machineCommands-7MBJJY4K.js} +79 -78
- package/{machineWsRunDispatch-3WXQ57DN.js → machineWsRunDispatch-T4LFRJL3.js} +69 -70
- package/{memberThunks-VPTET5M2.js → memberThunks-AZINUM4S.js} +10 -10
- package/package.json +6 -2
- package/{profileConfig-ZGOFORWV.js → profileConfig-KN3N2BLF.js} +7 -1
- package/{providerPresetApply-CRZFMQD5.js → providerPresetApply-PKUOHQJT.js} +5 -5
- package/{providerRegistry-7IS43D3X.js → providerRegistry-HNQLIFN2.js} +5 -5
- package/{read-VMMIHEAK.js → read-7JPIWRBQ.js} +5 -5
- package/{readDocTool-4XSLKYSQ.js → readDocTool-AAQTB2Y3.js} +1 -1
- package/{readlineWorkspace-2WGUU7KH.js → readlineWorkspace-2DR5GHLQ.js} +374 -199
- package/{removeDialogAgentAction-YIV37ENV.js → removeDialogAgentAction-RMVRILLK.js} +9 -9
- package/{runAgentClientLoop-WS2HFGIR.js → runAgentClientLoop-EXIQDX7G.js} +58 -53
- package/{runtimeDoctorCommands-56NWKNON.js → runtimeDoctorCommands-MMCP4B4U.js} +12 -12
- package/{secretCommands-ZXZRLR3R.js → secretCommands-DNY56NSU.js} +11 -1
- package/{setDialogExtraReferencesAction-FWVD656I.js → setDialogExtraReferencesAction-L3V7JTMG.js} +8 -8
- package/{setPrimaryDialogAgentAction-HIPQTT6N.js → setPrimaryDialogAgentAction-X52JQGTJ.js} +9 -9
- package/settingThunks-N6XFWPOU.js +923 -0
- package/{spaceCommands-JQN7D4FE.js → spaceCommands-WQMUCGV7.js} +28 -26
- package/{streamAgentChatTurn-OSGLMHT6.js → streamAgentChatTurn-DI2334G3.js} +153 -94
- package/{switchDialogAgentAction-SLTPB635.js → switchDialogAgentAction-ZJ5CGU7J.js} +7 -7
- package/{tableCommands-U3QDY4L6.js → tableCommands-IVC5S7Y3.js} +11 -11
- package/{toolApiClient-7WSJJJBV.js → toolApiClient-HGNO53TC.js} +2 -2
- package/{tools-XF5A6N2B.js → tools-23VQGJOX.js} +42 -43
- package/{tuiSummaryLlmCaller-KLK6K3Q3.js → tuiSummaryLlmCaller-FESHBDTT.js} +7 -7
- package/{updateCommands-NQXAGFM7.js → updateCommands-ODWC7SK7.js} +5 -3
- package/{updateDialogTitleAction-IN5TBR23.js → updateDialogTitleAction-AGAYHWS7.js} +21 -21
- package/{workloadLifecycle-36DXRZKU.js → workloadLifecycle-6O6PMISX.js} +2 -2
- package/chunk-IA7TRNNR.js +0 -11
- package/chunk-ON3WLDG2.js +0 -7012
- package/chunk-UKZX3NHN.js +0 -48
- package/chunk-W4S6OTSC.js +0 -35
- package/clipboardy-GCO3GT3I.js +0 -11793
- package/settingThunks-SB37UY4C.js +0 -1371
- package/{agentGrantCommands-HOJ3JBBQ.js → agentGrantCommands-5DPHYEKP.js} +3 -3
- package/{chromeOpsCommands-3Z34RKSE.js → chromeOpsCommands-GZVVK7HU.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
|
@@ -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-QXZH5UDF.js";
|
|
15
15
|
import {
|
|
16
16
|
readSseFrames
|
|
17
17
|
} from "./chunk-HNUWUO75.js";
|
|
@@ -24,15 +24,14 @@ import {
|
|
|
24
24
|
} from "./chunk-PWTNI4N7.js";
|
|
25
25
|
import {
|
|
26
26
|
hasImageInRuntimeMessages,
|
|
27
|
-
resolveAgentContextWindow,
|
|
28
27
|
stripImagePartsFromMessages
|
|
29
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-ULQAD7ZY.js";
|
|
30
29
|
import {
|
|
31
30
|
clipToolText,
|
|
32
31
|
resolveAgentImageInputSupport,
|
|
33
32
|
resolveHistoricalToolContentCap,
|
|
34
33
|
resolveToolOutputProfile
|
|
35
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-U34KT53V.js";
|
|
36
35
|
import {
|
|
37
36
|
applyShapingCounts,
|
|
38
37
|
attachProjectionFacts,
|
|
@@ -52,7 +51,9 @@ import {
|
|
|
52
51
|
finalizeAccumulatedToolCalls
|
|
53
52
|
} from "./chunk-56GBUMO5.js";
|
|
54
53
|
import {
|
|
54
|
+
CREDENTIAL_HYGIENE_RULE,
|
|
55
55
|
DELETE_SAFETY_RED_LINE,
|
|
56
|
+
DISPATCH_BACKEND_POLICY,
|
|
56
57
|
PARALLEL_DISPATCH_DEFAULT_RULE,
|
|
57
58
|
PLATFORM_RISK_CONTROL_RULE,
|
|
58
59
|
TOOL_GUIDED_SECTION_ORDER,
|
|
@@ -63,8 +64,9 @@ import {
|
|
|
63
64
|
detectDispatchIntentFromMessages,
|
|
64
65
|
estimateContextTokens,
|
|
65
66
|
hashStablePrefixContent,
|
|
67
|
+
resolveResponseGuidelines,
|
|
66
68
|
resolveToolGuidedSections
|
|
67
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-QI2WVWXV.js";
|
|
68
70
|
import {
|
|
69
71
|
classifyUnparsableToolArgs,
|
|
70
72
|
collectStablePromptPrefix,
|
|
@@ -88,7 +90,7 @@ import {
|
|
|
88
90
|
toOpenAiCompatibleMessages,
|
|
89
91
|
toResponsesTools,
|
|
90
92
|
transferDowngradedToolTurnOrigin
|
|
91
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-4L4K6YR7.js";
|
|
92
94
|
import {
|
|
93
95
|
BRIDGE_STREAM_MAX_CHARS,
|
|
94
96
|
DEFAULT_READ_DIALOG_MAX_RESPONSE_CHARS,
|
|
@@ -114,10 +116,11 @@ import {
|
|
|
114
116
|
normalizeUsage,
|
|
115
117
|
readCacheCreationInputTokens,
|
|
116
118
|
readCacheReadInputTokens,
|
|
119
|
+
resolveAgentContextWindow,
|
|
117
120
|
resolveEmptyAssistantFallbackMessage,
|
|
118
121
|
resolveEmptyAssistantOutcome,
|
|
119
122
|
resolveTruncatedReasoningTailLog
|
|
120
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-F3SOW2EU.js";
|
|
121
124
|
import {
|
|
122
125
|
COMPACTION_SUMMARY_SCHEMA_VERSION,
|
|
123
126
|
COMPACTION_SUMMARY_SYSTEM_PROMPT,
|
|
@@ -140,7 +143,7 @@ import {
|
|
|
140
143
|
sha256Hex,
|
|
141
144
|
truncateToolOutputForContext,
|
|
142
145
|
withProviderCallTimingFields
|
|
143
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-QA2C5NKI.js";
|
|
144
147
|
import {
|
|
145
148
|
clipCompactText
|
|
146
149
|
} from "./chunk-5MMAK75Q.js";
|
|
@@ -150,6 +153,12 @@ import {
|
|
|
150
153
|
import {
|
|
151
154
|
isAbortError
|
|
152
155
|
} from "./chunk-7DPNBQSV.js";
|
|
156
|
+
import {
|
|
157
|
+
buildDialogSummaryLayer
|
|
158
|
+
} from "./chunk-VEA7H5FG.js";
|
|
159
|
+
import {
|
|
160
|
+
buildUserResponseLanguageContext
|
|
161
|
+
} from "./chunk-4VJAC32I.js";
|
|
153
162
|
import {
|
|
154
163
|
canonicalizeToolName,
|
|
155
164
|
canonicalizeToolNames
|
|
@@ -164,16 +173,16 @@ import {
|
|
|
164
173
|
import {
|
|
165
174
|
asOptionalPositiveFiniteNumber
|
|
166
175
|
} from "./chunk-U6VC4MU4.js";
|
|
167
|
-
import {
|
|
168
|
-
asOptionalFiniteNumber
|
|
169
|
-
} from "./chunk-WWC7I6TA.js";
|
|
170
176
|
import {
|
|
171
177
|
estimateTokenCount
|
|
172
178
|
} from "./chunk-PSCNXBYA.js";
|
|
179
|
+
import {
|
|
180
|
+
asOptionalFiniteNumber
|
|
181
|
+
} from "./chunk-WWC7I6TA.js";
|
|
173
182
|
import {
|
|
174
183
|
buildProviderAuthHeaders,
|
|
175
184
|
buildProviderExecutionPlan
|
|
176
|
-
} from "./chunk-
|
|
185
|
+
} from "./chunk-PIG2IUVZ.js";
|
|
177
186
|
import {
|
|
178
187
|
isRecord
|
|
179
188
|
} from "./chunk-KUG52IAP.js";
|
|
@@ -195,12 +204,6 @@ import {
|
|
|
195
204
|
import {
|
|
196
205
|
resolveNoloStateDir
|
|
197
206
|
} from "./chunk-ZWQUWF6W.js";
|
|
198
|
-
import {
|
|
199
|
-
buildDialogSummaryLayer
|
|
200
|
-
} from "./chunk-VEA7H5FG.js";
|
|
201
|
-
import {
|
|
202
|
-
buildUserResponseLanguageContext
|
|
203
|
-
} from "./chunk-4VJAC32I.js";
|
|
204
207
|
import {
|
|
205
208
|
__export
|
|
206
209
|
} from "./chunk-4VNS5WPM.js";
|
|
@@ -14047,8 +14050,11 @@ function detectExecShellSynchronousWarnings(command, shell) {
|
|
|
14047
14050
|
}
|
|
14048
14051
|
|
|
14049
14052
|
// packages/agent-runtime/workspaceShell.ts
|
|
14050
|
-
import {
|
|
14053
|
+
import { createWriteStream, mkdirSync as mkdirSync2 } from "node:fs";
|
|
14054
|
+
import { dirname, join as join4, resolve } from "node:path";
|
|
14051
14055
|
import { spawn as spawnChildProcess } from "node:child_process";
|
|
14056
|
+
import { randomUUID } from "node:crypto";
|
|
14057
|
+
import { tmpdir } from "node:os";
|
|
14052
14058
|
|
|
14053
14059
|
// packages/agent-runtime/runtimeCompat.ts
|
|
14054
14060
|
import { existsSync as existsSync2, readdirSync as readdirSync2, statSync as statSync2 } from "node:fs";
|
|
@@ -14984,39 +14990,168 @@ function truncateToolOutput(value, limit = 2e4, options) {
|
|
|
14984
14990
|
${tail}`;
|
|
14985
14991
|
}
|
|
14986
14992
|
var DEFAULT_MAX_STREAM_BUFFER_BYTES = 5 * 1024 * 1024;
|
|
14987
|
-
function readNodeStream(stream,
|
|
14993
|
+
function readNodeStream(stream, maxBytesOrOptions = DEFAULT_MAX_STREAM_BUFFER_BYTES) {
|
|
14988
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));
|
|
14989
14999
|
return new Promise((resolveStream, rejectStream) => {
|
|
14990
15000
|
const chunks2 = [];
|
|
14991
15001
|
let totalBytes = 0;
|
|
14992
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;
|
|
14993
15009
|
const formatLimit = maxBytes >= 1024 * 1024 ? `${Math.round(maxBytes / (1024 * 1024))}MB` : `${Math.round(maxBytes / 1024)}KB`;
|
|
14994
|
-
const
|
|
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) => {
|
|
14995
15087
|
if (settled) return;
|
|
14996
15088
|
settled = true;
|
|
14997
|
-
|
|
14998
|
-
|
|
14999
|
-
|
|
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 += `
|
|
15000
15103
|
|
|
15001
|
-
[stream pipe truncated:
|
|
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);
|
|
15002
15137
|
}
|
|
15003
|
-
resolveStream(text2);
|
|
15004
15138
|
};
|
|
15005
15139
|
stream.on("data", (chunk) => {
|
|
15006
15140
|
if (settled) return;
|
|
15007
15141
|
const buf = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
15142
|
+
if (truncated) {
|
|
15143
|
+
writeToSink(buf);
|
|
15144
|
+
return;
|
|
15145
|
+
}
|
|
15008
15146
|
if (totalBytes + buf.length >= maxBytes) {
|
|
15009
15147
|
const remaining = Math.max(0, maxBytes - totalBytes);
|
|
15148
|
+
const headChunks = chunks2.slice();
|
|
15010
15149
|
if (remaining > 0) {
|
|
15011
15150
|
chunks2.push(buf.subarray(0, remaining));
|
|
15012
15151
|
}
|
|
15013
|
-
|
|
15014
|
-
|
|
15015
|
-
|
|
15016
|
-
}
|
|
15017
|
-
} catch {
|
|
15018
|
-
}
|
|
15019
|
-
finalize2(true);
|
|
15152
|
+
totalBytes += buf.length;
|
|
15153
|
+
truncated = true;
|
|
15154
|
+
openSpill(headChunks, buf);
|
|
15020
15155
|
return;
|
|
15021
15156
|
}
|
|
15022
15157
|
totalBytes += buf.length;
|
|
@@ -15025,6 +15160,19 @@ function readNodeStream(stream, maxBytes = DEFAULT_MAX_STREAM_BUFFER_BYTES) {
|
|
|
15025
15160
|
stream.on("error", (error) => {
|
|
15026
15161
|
if (settled) return;
|
|
15027
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();
|
|
15028
15176
|
rejectStream(error);
|
|
15029
15177
|
});
|
|
15030
15178
|
stream.on("end", () => finalize2(false));
|
|
@@ -15099,7 +15247,7 @@ async function runWorkspaceCommand(args2) {
|
|
|
15099
15247
|
proc.stdin.write(args2.stdin);
|
|
15100
15248
|
proc.stdin.end();
|
|
15101
15249
|
}
|
|
15102
|
-
const label = deriveLabel(args2.command.join(" "));
|
|
15250
|
+
const label = args2.label?.trim() || deriveLabel(args2.command.join(" "));
|
|
15103
15251
|
const registry2 = getProcessRegistry();
|
|
15104
15252
|
if (typeof proc.pid === "number") {
|
|
15105
15253
|
registry2.add({
|
|
@@ -15137,8 +15285,12 @@ async function runWorkspaceCommand(args2) {
|
|
|
15137
15285
|
process.removeListener("SIGINT", cleanupChildOnHostSignal);
|
|
15138
15286
|
};
|
|
15139
15287
|
exitPromise.then(detachSignalCleanup, detachSignalCleanup);
|
|
15140
|
-
const stdoutCapture = stdoutPromiseResult(
|
|
15141
|
-
|
|
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
|
+
);
|
|
15142
15294
|
const killChild = (signal) => {
|
|
15143
15295
|
if (detached && typeof proc.pid === "number") {
|
|
15144
15296
|
try {
|
|
@@ -15344,6 +15496,10 @@ function buildExecShellToolDefinition(toolName = "execShell") {
|
|
|
15344
15496
|
background: {
|
|
15345
15497
|
type: "boolean",
|
|
15346
15498
|
description: "Immediately detach this command into a tracked background task (no 120s synchronous wait): returns {detached: true, taskId}, and on completion the platform resumes this conversation with a bounded result capsule (exitCode, duration, stdout/stderr tail). Default false. Use for finite jobs (tests, builds, batch) whose result you need later; NOT for dev servers/watchers \u2014 use launchProcess for those."
|
|
15499
|
+
},
|
|
15500
|
+
label: {
|
|
15501
|
+
type: "string",
|
|
15502
|
+
description: "Optional human-readable label for the resulting background task, shown in the task list and completion notices. Defaults to the command's last token, which is unhelpful for pipelines (e.g. '| tail -25' yields '-25')."
|
|
15347
15503
|
}
|
|
15348
15504
|
}
|
|
15349
15505
|
}
|
|
@@ -15392,7 +15548,8 @@ function normalizeExecShellInput(input) {
|
|
|
15392
15548
|
...login !== void 0 ? { login } : {},
|
|
15393
15549
|
...activity ? { activity } : {},
|
|
15394
15550
|
...record2.input !== void 0 ? { input: record2.input } : {},
|
|
15395
|
-
...background ? { background: true } : {}
|
|
15551
|
+
...background ? { background: true } : {},
|
|
15552
|
+
...typeof record2.label === "string" && record2.label.trim() ? { label: record2.label.trim() } : {}
|
|
15396
15553
|
};
|
|
15397
15554
|
}
|
|
15398
15555
|
throw new Error("execShell requires a non-empty command.");
|
|
@@ -15457,6 +15614,7 @@ var execShellCapability = {
|
|
|
15457
15614
|
abortSignal: ctx.abortSignal,
|
|
15458
15615
|
detachMs: background ? 0 : isImmediateDetachShellCommand({ command }) ? 0 : ctx.detachMs,
|
|
15459
15616
|
stdin: typeof normalized.input === "string" ? normalized.input : void 0,
|
|
15617
|
+
label: typeof normalized.label === "string" ? normalized.label : void 0,
|
|
15460
15618
|
// Ownership of the turn that invoked this command: an auto-detached
|
|
15461
15619
|
// command keeps its parent dialog so its terminal can resume that
|
|
15462
15620
|
// conversation (see processOwnership.ts). Absent ctx.owner = unowned.
|
|
@@ -15541,11 +15699,11 @@ async function invokeCapability(capabilityOrName, input, ctx = {}) {
|
|
|
15541
15699
|
}
|
|
15542
15700
|
|
|
15543
15701
|
// packages/agent-runtime/localWorkspaceTools.ts
|
|
15544
|
-
import { existsSync as
|
|
15702
|
+
import { existsSync as existsSync4 } from "node:fs";
|
|
15545
15703
|
import { createHash as createHash4 } from "node:crypto";
|
|
15546
15704
|
import { lstat, mkdir, readdir as readdir2, readFile as readFile3, realpath, stat as stat3, writeFile } from "node:fs/promises";
|
|
15547
15705
|
import { homedir } from "node:os";
|
|
15548
|
-
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";
|
|
15549
15707
|
import { spawn as spawnChildProcess3 } from "node:child_process";
|
|
15550
15708
|
|
|
15551
15709
|
// packages/core/readRangeLedger.ts
|
|
@@ -16827,7 +16985,7 @@ function resolveRipgrepBinary(env = process.env) {
|
|
|
16827
16985
|
const fromEnv = asOptionalTrimmedString(env.NOLO_BUNDLED_RG);
|
|
16828
16986
|
if (fromEnv) {
|
|
16829
16987
|
try {
|
|
16830
|
-
if (
|
|
16988
|
+
if (existsSync4(fromEnv)) return fromEnv;
|
|
16831
16989
|
} catch {
|
|
16832
16990
|
}
|
|
16833
16991
|
}
|
|
@@ -16933,6 +17091,7 @@ ${tail}`,
|
|
|
16933
17091
|
};
|
|
16934
17092
|
}
|
|
16935
17093
|
var READ_FILE_LEDGER_MAX_RECORDS = 64;
|
|
17094
|
+
var READ_FILE_LEDGER_MAX_KEYS = 256;
|
|
16936
17095
|
async function readFileTool(args2) {
|
|
16937
17096
|
const parsed = parseWorkspaceToolArguments(args2.call.arguments);
|
|
16938
17097
|
const requestedPath = requireWorkspaceToolPath(parsed);
|
|
@@ -16971,6 +17130,8 @@ async function readFileTool(args2) {
|
|
|
16971
17130
|
const retainedCap = resolveHistoricalToolContentCap("readFile", 0);
|
|
16972
17131
|
const retained = filterRetainedLedgerRecords(entry.records, retainedCap);
|
|
16973
17132
|
if (retained.length > 0 && isLineRangeCovered(requestRange, retained)) {
|
|
17133
|
+
ledger.delete(relativePath);
|
|
17134
|
+
ledger.set(relativePath, entry);
|
|
16974
17135
|
return {
|
|
16975
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.`,
|
|
16976
17137
|
metadata: {
|
|
@@ -17003,10 +17164,16 @@ async function readFileTool(args2) {
|
|
|
17003
17164
|
const persistedChars = truncatedRead.content.length + "\n\n[tool metadata]\n".length + JSON.stringify(metadata).length;
|
|
17004
17165
|
const records = entry?.records ?? [];
|
|
17005
17166
|
records.push({ ...requestRange, chars: persistedChars });
|
|
17167
|
+
ledger.delete(relativePath);
|
|
17006
17168
|
ledger.set(relativePath, {
|
|
17007
17169
|
fingerprint,
|
|
17008
17170
|
records: records.slice(-READ_FILE_LEDGER_MAX_RECORDS)
|
|
17009
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
|
+
}
|
|
17010
17177
|
}
|
|
17011
17178
|
return { content: truncatedRead.content, metadata };
|
|
17012
17179
|
}
|
|
@@ -17019,7 +17186,7 @@ async function writeFileTool(args2) {
|
|
|
17019
17186
|
requestedPath,
|
|
17020
17187
|
...args2.confirmExternalFileAccess ? { confirmExternalFileAccess: args2.confirmExternalFileAccess } : {}
|
|
17021
17188
|
});
|
|
17022
|
-
await mkdir(
|
|
17189
|
+
await mkdir(dirname2(absolutePath), { recursive: true });
|
|
17023
17190
|
await writeFile(absolutePath, content, "utf8");
|
|
17024
17191
|
const relativePath = normalizeWorkspaceRelativePath({
|
|
17025
17192
|
workspaceRoot: resolve4(args2.workspaceRoot),
|
|
@@ -17476,7 +17643,7 @@ async function execShellTool(args2) {
|
|
|
17476
17643
|
);
|
|
17477
17644
|
}
|
|
17478
17645
|
var LAUNCH_PROCESS_STREAM_RING_CHARS = 65536;
|
|
17479
|
-
var LAUNCH_PROCESS_STREAM_CAPTURE_MAX_CHARS =
|
|
17646
|
+
var LAUNCH_PROCESS_STREAM_CAPTURE_MAX_CHARS = 1e6;
|
|
17480
17647
|
function createLaunchProcessStreamCapture() {
|
|
17481
17648
|
let ring = "";
|
|
17482
17649
|
let full = null;
|
|
@@ -18457,7 +18624,11 @@ async function executeToolCall(args2) {
|
|
|
18457
18624
|
...userInputText ? { userInput: userInputText } : {},
|
|
18458
18625
|
...input.runtimeContext ? { runtimeContext: input.runtimeContext } : {},
|
|
18459
18626
|
...args2.runToolNames ? { runToolNames: args2.runToolNames } : {},
|
|
18460
|
-
...input.abortSignal ? { abortSignal: input.abortSignal } : {}
|
|
18627
|
+
...input.abortSignal ? { abortSignal: input.abortSignal } : {},
|
|
18628
|
+
// 定档信号:来源只由 turn 输入推导,不让模型/参数层参与。
|
|
18629
|
+
// 三级判据见 plan §10——后台运行优先于子 run(后台派发的子 run 仍是
|
|
18630
|
+
// 无人值守的,按 automation 报更保守)。
|
|
18631
|
+
origin: input.background ? "automation" : input.runKind === "subtask" ? "agent" : "chat"
|
|
18461
18632
|
}, {
|
|
18462
18633
|
...input.abortSignal ? { abortSignal: input.abortSignal } : {},
|
|
18463
18634
|
...input.runtimeContext ? { runtimeContext: input.runtimeContext } : {}
|
|
@@ -18696,7 +18867,7 @@ var normalizeContextBlockScopes = (legacyBlocks = void 0, scopes = void 0) => {
|
|
|
18696
18867
|
};
|
|
18697
18868
|
|
|
18698
18869
|
// packages/agent-runtime/localAutoCompaction.ts
|
|
18699
|
-
import { randomUUID } from "node:crypto";
|
|
18870
|
+
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
18700
18871
|
function toPlanCompressionMessages(history) {
|
|
18701
18872
|
return history.map((message, index) => ({
|
|
18702
18873
|
id: typeof message.id === "string" && message.id.length > 0 ? message.id : `local-${index}`,
|
|
@@ -18931,7 +19102,7 @@ async function maybeAutoCompactLocalHistory(args2) {
|
|
|
18931
19102
|
};
|
|
18932
19103
|
}
|
|
18933
19104
|
emitPhase({ kind: "compaction-start" });
|
|
18934
|
-
const compactionAttemptId =
|
|
19105
|
+
const compactionAttemptId = randomUUID2();
|
|
18935
19106
|
let compactionT0 = Date.now();
|
|
18936
19107
|
let compactionInputTokens;
|
|
18937
19108
|
let compactionPrevSummaryTokens;
|
|
@@ -19750,18 +19921,38 @@ async function runLocalAgentTurn(input) {
|
|
|
19750
19921
|
input.contextBlocks,
|
|
19751
19922
|
input.contextBlockScopes
|
|
19752
19923
|
);
|
|
19924
|
+
const responseGuidelines = resolveResponseGuidelines(
|
|
19925
|
+
input.responseViewport ?? "unknown"
|
|
19926
|
+
);
|
|
19927
|
+
const responseGuidelineScopes = [
|
|
19928
|
+
{ content: responseGuidelines.behavior, cacheScope: "session" },
|
|
19929
|
+
...responseGuidelines.presentation.trim().length > 0 ? [
|
|
19930
|
+
{
|
|
19931
|
+
content: responseGuidelines.presentation,
|
|
19932
|
+
cacheScope: "session"
|
|
19933
|
+
}
|
|
19934
|
+
] : []
|
|
19935
|
+
];
|
|
19753
19936
|
const mergedContextBlockScopes = [
|
|
19754
19937
|
// 删除安全红线:系统层最高优先级约束,位于所有块之前(含身份信息块),
|
|
19755
19938
|
// owner 要求常驻「根本提示词」的最顶部(2026-09-26 批量误删事故)。
|
|
19756
19939
|
{ content: DELETE_SAFETY_RED_LINE, cacheScope: "session" },
|
|
19940
|
+
// 凭据纪律:与红线同为系统层固定块,紧随其后(四条装配线同源)。
|
|
19941
|
+
{ content: CREDENTIAL_HYGIENE_RULE, cacheScope: "session" },
|
|
19757
19942
|
// 并行是默认:系统层固定块,紧随红线(localLoop 无 static 作用域,用 session 占位,
|
|
19758
19943
|
// 「最顶」由数组首位保证——与红线同一约定)。
|
|
19759
19944
|
{ content: PARALLEL_DISPATCH_DEFAULT_RULE, cacheScope: "session" },
|
|
19945
|
+
// 派发落点:并行派发纪律的下一层(派到哪个执行后端),沿用 session 占位约定。
|
|
19946
|
+
{ content: DISPATCH_BACKEND_POLICY, cacheScope: "session" },
|
|
19760
19947
|
// 平台风控纪律:无条件系统层块,沿用 session 占位约定。
|
|
19761
19948
|
{ content: PLATFORM_RISK_CONTROL_RULE, cacheScope: "session" },
|
|
19762
19949
|
{ content: buildConsultationModeBlock(), cacheScope: "session" },
|
|
19763
19950
|
{ content: identityBlock, cacheScope: "session" },
|
|
19764
19951
|
...guidanceScopes,
|
|
19952
|
+
// 回复行为准则:local 线(CLI 非交互 / 桌面 / TUI)的唯一注入边界。
|
|
19953
|
+
// 行为段恒注入;排版段只在宿主声明了可确认的展示能力时追加一份
|
|
19954
|
+
// (unknown = 拿不到视口信息,不得猜成宽屏或窄屏)。两块同属 session scope。
|
|
19955
|
+
...responseGuidelineScopes,
|
|
19765
19956
|
...callerScopes
|
|
19766
19957
|
];
|
|
19767
19958
|
loopTiming.mark("buildContextBlocks", 0);
|
|
@@ -19826,12 +20017,8 @@ async function runLocalAgentTurn(input) {
|
|
|
19826
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`
|
|
19827
20018
|
);
|
|
19828
20019
|
}
|
|
19829
|
-
const supportsImages = resolveAgentImageInputSupport(
|
|
19830
|
-
|
|
19831
|
-
provider: agentConfig.provider,
|
|
19832
|
-
model: agentConfig.model,
|
|
19833
|
-
hasVision: agentConfig.hasVision
|
|
19834
|
-
});
|
|
20020
|
+
const supportsImages = resolveAgentImageInputSupport(agentConfig);
|
|
20021
|
+
let imageDowngradeEmitted = false;
|
|
19835
20022
|
if (!supportsImages && hasImageInRuntimeMessages(messages)) {
|
|
19836
20023
|
messages = filterImagePartsFromMessages(messages, false);
|
|
19837
20024
|
emitLoopEvent(observationBoundary, {
|
|
@@ -19839,6 +20026,7 @@ async function runLocalAgentTurn(input) {
|
|
|
19839
20026
|
reason: "no-vision",
|
|
19840
20027
|
atMs: Date.now()
|
|
19841
20028
|
});
|
|
20029
|
+
imageDowngradeEmitted = true;
|
|
19842
20030
|
}
|
|
19843
20031
|
const prefixCount = builtMessages.prefixCount;
|
|
19844
20032
|
const capToolMessage = (msg) => msg.role === "tool" && typeof msg.content === "string" ? {
|
|
@@ -19905,6 +20093,14 @@ async function runLocalAgentTurn(input) {
|
|
|
19905
20093
|
roundBudgetWarningInjected = true;
|
|
19906
20094
|
}
|
|
19907
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
|
+
}
|
|
19908
20104
|
const baseRequestMessages = filterImagePartsFromMessages(
|
|
19909
20105
|
preparedMessages.messages,
|
|
19910
20106
|
supportsImages
|
|
@@ -21671,7 +21867,7 @@ function buildLoadSkillExecutor(args2) {
|
|
|
21671
21867
|
const { resolveSkillByName } = await import("./skillDiscovery-QC35EQY4.js");
|
|
21672
21868
|
const resolved = resolveSkillByName(args2.cwd, name);
|
|
21673
21869
|
if (!resolved) {
|
|
21674
|
-
const { resolveBuiltinSkillByName } = await import("./builtinSkillRegistry-
|
|
21870
|
+
const { resolveBuiltinSkillByName } = await import("./builtinSkillRegistry-LJV7FHNI.js");
|
|
21675
21871
|
const builtin = resolveBuiltinSkillByName(name);
|
|
21676
21872
|
if (builtin) {
|
|
21677
21873
|
return {
|
|
@@ -21749,7 +21945,7 @@ function resolveSessionKey(args2) {
|
|
|
21749
21945
|
}
|
|
21750
21946
|
|
|
21751
21947
|
// packages/agent-runtime/devin/devinProvider.ts
|
|
21752
|
-
import { randomBytes, randomUUID as
|
|
21948
|
+
import { randomBytes, randomUUID as randomUUID3 } from "node:crypto";
|
|
21753
21949
|
var CLIENT_NAME = "chisel";
|
|
21754
21950
|
var CLIENT_VERSION = "3000.11.3";
|
|
21755
21951
|
function writeVarint(fieldNum, value) {
|
|
@@ -21809,7 +22005,7 @@ function encodeDevinClientMetadata(token) {
|
|
|
21809
22005
|
]);
|
|
21810
22006
|
}
|
|
21811
22007
|
function devinId(id, purpose) {
|
|
21812
|
-
return id?.sessionKey && isStableSessionIdentityEnabled() ? deriveStableUuid(id.sessionKey, purpose) :
|
|
22008
|
+
return id?.sessionKey && isStableSessionIdentityEnabled() ? deriveStableUuid(id.sessionKey, purpose) : randomUUID3();
|
|
21813
22009
|
}
|
|
21814
22010
|
function encodeDevinChatMessage(msg, identity2, index = 0) {
|
|
21815
22011
|
const source = msg.role === "assistant" ? 2 : msg.role === "tool" ? 4 : 1;
|
|
@@ -21903,7 +22099,7 @@ ${item.text}`;
|
|
|
21903
22099
|
const chatMessageBuffers = coalesced.map((m, i) => encodeDevinChatMessage(m, identity2, i));
|
|
21904
22100
|
const completionConfig = buildCompletionConfig({ temperature });
|
|
21905
22101
|
const modelConfig = Buffer.concat([
|
|
21906
|
-
writeStringField(1,
|
|
22102
|
+
writeStringField(1, randomUUID3()),
|
|
21907
22103
|
writeVarint(2, 1),
|
|
21908
22104
|
writeVarint(3, 4)
|
|
21909
22105
|
]);
|
|
@@ -21915,7 +22111,7 @@ ${item.text}`;
|
|
|
21915
22111
|
writeMessageField(8, completionConfig),
|
|
21916
22112
|
...tools.map((tool) => writeMessageField(10, encodeDevinToolDefinition(tool))),
|
|
21917
22113
|
writeMessageField(15, modelConfig),
|
|
21918
|
-
writeStringField(16,
|
|
22114
|
+
writeStringField(16, randomUUID3()),
|
|
21919
22115
|
writeVarint(20, 1),
|
|
21920
22116
|
writeStringField(21, model)
|
|
21921
22117
|
]);
|
|
@@ -3,16 +3,13 @@ import {
|
|
|
3
3
|
classifyAgentApiKeyRef,
|
|
4
4
|
formatUnsupportedAgentApiKeyRefMessage,
|
|
5
5
|
shouldReadAgentKeyRemotely
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7RF4O6AT.js";
|
|
7
7
|
import {
|
|
8
8
|
resolveCliAgentKeyInput
|
|
9
9
|
} from "./chunk-NBTY7YJF.js";
|
|
10
10
|
import {
|
|
11
11
|
createAgentKey
|
|
12
12
|
} from "./chunk-5EMSBTQ6.js";
|
|
13
|
-
import {
|
|
14
|
-
toErrorMessage
|
|
15
|
-
} from "./chunk-HNMXYYJR.js";
|
|
16
13
|
import {
|
|
17
14
|
parseUserIdFromAuthToken,
|
|
18
15
|
readOption,
|
|
@@ -24,6 +21,9 @@ import {
|
|
|
24
21
|
readPipeText,
|
|
25
22
|
spawnProcess
|
|
26
23
|
} from "./chunk-Y6ROFCZO.js";
|
|
24
|
+
import {
|
|
25
|
+
toErrorMessage
|
|
26
|
+
} from "./chunk-HNMXYYJR.js";
|
|
27
27
|
|
|
28
28
|
// packages/cli/agentRecordHelpers.ts
|
|
29
29
|
import { readFileSync } from "node:fs";
|
|
@@ -556,7 +556,7 @@ async function buildCreatedAgentRecord(args) {
|
|
|
556
556
|
const resolvedAgentInput = resolveCliAgentKeyInput(args.parsed.agentInput);
|
|
557
557
|
const agentKey = resolvedAgentInput.startsWith("agent-") ? resolvedAgentInput : createAgentKey.private(userId || "local", resolvedAgentInput);
|
|
558
558
|
if (args.parsed.presetId) {
|
|
559
|
-
const { resolveProviderPresetFields } = await import("./providerPresetApply-
|
|
559
|
+
const { resolveProviderPresetFields } = await import("./providerPresetApply-PKUOHQJT.js");
|
|
560
560
|
const fields = resolveProviderPresetFields(args.parsed.presetId);
|
|
561
561
|
if (fields.kind === "manual") {
|
|
562
562
|
throw new Error(
|