nolo-cli 0.9.1 → 0.11.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/README.md +1 -1
- package/{_executeModel-UD44KGZ4.js → _executeModel-ZEDPX6OF.js} +50 -48
- package/{action-ZJWE3Y5S.js → action-AA4IJ5K2.js} +11 -11
- package/{addContentAction-TVDBNJM5.js → addContentAction-QYVO4SYP.js} +10 -10
- package/{addDialogAgentAction-EKH774VT.js → addDialogAgentAction-WVVKT5WQ.js} +12 -12
- package/{agentDeleteCommand-TCPEFJTF.js → agentDeleteCommand-RDPGYIWF.js} +25 -25
- package/{agentEmailCommands-CZ3UILZ4.js → agentEmailCommands-2HJJKS5F.js} +62 -59
- package/{agentListCommands-SJKO2FFB.js → agentListCommands-HFEVV3ZW.js} +30 -29
- package/{agentMachineCommands-PSNABISZ.js → agentMachineCommands-25ZOENJU.js} +29 -29
- package/{agentRecordCommands-MH2JKFHS.js → agentRecordCommands-GTCOAM3L.js} +53 -50
- package/{agentRunCommand-4KH6MIZR.js → agentRunCommand-YBS3JDLD.js} +62 -56
- package/{agentRuntimeLocal-SKHJUWSS.js → agentRuntimeLocal-UQBMQI2M.js} +12 -12
- package/{agentSlice-3WXXN4VK.js → agentSlice-6EKOBCCS.js} +11 -11
- package/{authCommand-PXFX6JDT.js → authCommand-O2OWACN4.js} +12 -12
- package/{authCommands-356AYWEK.js → authCommands-H7365TZP.js} +6 -6
- package/{chunk-MKMWT7SA.js → chunk-2W2VYVI5.js} +336 -92
- package/{chunk-TSS3XJY4.js → chunk-3NSIQZZ6.js} +5 -5
- package/{chunk-AUQ747NZ.js → chunk-4SOKXIW4.js} +70 -6
- package/{chunk-ZIG5LJ7X.js → chunk-5MOUAAMK.js} +106 -2342
- package/{chunk-6GANEXVO.js → chunk-5OIFWVX7.js} +1 -1
- package/{chunk-MGOJ5R6J.js → chunk-7D3JY6C2.js} +2 -2
- package/{chunk-7OOXPE3N.js → chunk-AEZAORLG.js} +4 -4
- package/chunk-AFON4QUU.js +112 -0
- package/{chunk-YBWOP46I.js → chunk-BX6U3ETE.js} +20 -13
- package/{chunk-2PUGVR6E.js → chunk-C2MDQQ4O.js} +1 -1
- package/{chunk-SL35K7AH.js → chunk-C4FTUXVF.js} +2 -82
- package/{chunk-GAKEBQD6.js → chunk-D6OQHXVG.js} +11 -7
- package/{chunk-WKM6FH35.js → chunk-DWGAEFJL.js} +1 -1
- package/{chunk-PG5PNA7Y.js → chunk-E4HNJSHC.js} +20 -20
- package/{chunk-SBR32ZZS.js → chunk-EVZKZF32.js} +73 -40
- package/{chunk-C3RUNRHT.js → chunk-FXXSGWAJ.js} +1 -1
- package/{chunk-KTVVPRJS.js → chunk-GBDSZATH.js} +4 -4
- package/{chunk-3TZDXYSF.js → chunk-HNW7IJSK.js} +1 -1
- package/{chunk-2EISRLRC.js → chunk-IPYUUY4E.js} +2 -2
- package/{chunk-2K2ECKSG.js → chunk-KJR5KAUQ.js} +2 -2
- package/{chunk-XE635NI4.js → chunk-KQQVGRA3.js} +24 -24
- package/{chunk-AVMKZHBC.js → chunk-L53FGHA4.js} +3 -2
- package/{chunk-GG4AJPSR.js → chunk-LAX2JSTX.js} +2 -2
- package/{chunk-5PJ3VWCS.js → chunk-LP65VRCI.js} +7 -13
- package/chunk-LTRXGFMS.js +83 -0
- package/{chunk-63SLEOLK.js → chunk-MQI77IRB.js} +4 -4
- package/{chunk-PCWC3JTN.js → chunk-MTU75CZ2.js} +1 -1
- package/{chunk-3WYQEUBI.js → chunk-NEM67FX7.js} +1 -1
- package/{chunk-COMXDWNM.js → chunk-O26GI2JP.js} +10 -10
- package/{chunk-SH2CFQOH.js → chunk-O4BU24WZ.js} +2 -181
- package/{chunk-EYEEHCU4.js → chunk-OOM6SJNR.js} +10 -10
- package/chunk-OOSFSFMA.js +271 -0
- package/{chunk-PAKN26FP.js → chunk-OUI3ZHYD.js} +1 -1
- package/{chunk-EXTIQUCI.js → chunk-PNEW2Z3T.js} +9 -9
- package/{chunk-CPB2YM4D.js → chunk-PXQN7IBQ.js} +2 -2
- package/{chunk-4IJYA27C.js → chunk-PXZAAB4L.js} +4 -4
- package/{chunk-4K2KKCSD.js → chunk-Q3UKJVU4.js} +12 -16
- package/{chunk-XKIMRZO2.js → chunk-QNMFBBZK.js} +1 -1
- package/{chunk-XS466O7S.js → chunk-S3GS2PRL.js} +65 -30
- package/{chunk-YYUCRDOK.js → chunk-SOTZ6RDN.js} +1 -1
- package/{chunk-G43KEVSC.js → chunk-SV5MWASH.js} +17 -17
- package/{chunk-7QRKCBOP.js → chunk-TACHTH5D.js} +15 -15
- package/chunk-VC6OZXO5.js +298 -0
- package/{chunk-ZQ2UM4KG.js → chunk-WZSRQNQG.js} +1 -292
- package/{chunk-LARL2V6G.js → chunk-X2S7JTIG.js} +298 -66
- package/{chunk-Q2YZULBH.js → chunk-XENYHRUE.js} +1 -1
- package/{chunk-ELRRLDWI.js → chunk-XFOLQLDN.js} +2 -2
- package/{chunk-UUJDGGAK.js → chunk-XYZA7S7V.js} +6 -6
- package/{chunk-KOCA5FCS.js → chunk-ZEYDOXHF.js} +185 -147
- package/{chunk-5KLGBAAR.js → chunk-ZPRK73XY.js} +1 -1
- package/{cliExecutor-DNE7TCC4.js → cliExecutor-K3F7DMRO.js} +2 -2
- package/{createAgentAutomationAction-63OIP6X5.js → createAgentAutomationAction-LTI5QU35.js} +25 -25
- package/{createDialogAction-ZLYZDYBB.js → createDialogAction-OJJ7L3L3.js} +26 -25
- package/{createPageAction-AL5FSDCK.js → createPageAction-5MXWVRGY.js} +30 -29
- package/{dbSlice-PR44QPXY.js → dbSlice-RQFQQVHT.js} +9 -9
- package/{deleteFile-4SKGPHOZ.js → deleteFile-7XP5BGC7.js} +6 -6
- package/{dialogCommands-F6YI5742.js → dialogCommands-JTJ3RPPW.js} +23 -23
- package/{dialogSlice-JSBNZRLR.js → dialogSlice-OWROKURJ.js} +22 -22
- package/{docCreateCommands-4CTO7ERT.js → docCreateCommands-WJBEW2V7.js} +23 -22
- package/{docDeleteCommands-VBWERDRG.js → docDeleteCommands-BVEHJOY5.js} +25 -24
- package/{docReadCommands-KNP4MFYB.js → docReadCommands-NEWOZIJV.js} +23 -22
- package/{docStore-ADP5VYY4.js → docStore-3DXRYBMD.js} +23 -23
- package/{docUpdateCommands-4BCBJQHA.js → docUpdateCommands-C7WHT7UU.js} +23 -22
- package/{fetchMessages-U6ZHN56A.js → fetchMessages-KTNM7QAR.js} +3 -3
- package/{handleSendMessageAction-IJDQ6ARA.js → handleSendMessageAction-B5PRR7BE.js} +27 -27
- package/index.js +58 -58
- package/{localDialogRead-Z5UTAJPU.js → localDialogRead-YSKFFRTT.js} +2 -2
- package/{machineCommands-EA3M4XTN.js → machineCommands-IIIREAEK.js} +67 -62
- package/{machineWsRunDispatch-NAPKE5ZA.js → machineWsRunDispatch-3SIU6ILW.js} +52 -49
- package/package.json +4 -2
- package/{read-RIJCIVKX.js → read-QJNKRROM.js} +6 -6
- package/{readDocTool-GZD2N3LO.js → readDocTool-H6X6KO6X.js} +1 -1
- package/{readlineWorkspace-KMWT4T4S.js → readlineWorkspace-HGP3I3OC.js} +97 -79
- package/{removeDialogAgentAction-GJQJNDW6.js → removeDialogAgentAction-TCT35SOF.js} +14 -14
- package/{runAgentClientLoop-U5Q6NDTJ.js → runAgentClientLoop-EFM4PTVI.js} +46 -44
- package/{setDialogExtraReferencesAction-M7OQG54N.js → setDialogExtraReferencesAction-CGYLZMFH.js} +12 -12
- package/{setPrimaryDialogAgentAction-46UNFJDL.js → setPrimaryDialogAgentAction-F6BFQDJU.js} +14 -14
- package/{settingSlice-FVUUH4JA.js → settingSlice-2I5HMG47.js} +10 -10
- package/skillDiscovery-UGSQGX2U.js +16 -0
- package/{spaceCommands-E2CFRPZJ.js → spaceCommands-MT7BWCIL.js} +32 -36
- package/{spaceSlice-L3R6IMXE.js → spaceSlice-BS5TSW3W.js} +22 -22
- package/{streamAgentChatTurn-UBDAOQWE.js → streamAgentChatTurn-I3VBFNR3.js} +85 -81
- package/{tableCommands-GOFP7QKA.js → tableCommands-M3DJUETS.js} +11 -11
- package/{toolApiClient-QI3YBNWB.js → toolApiClient-C7P7YSE4.js} +2 -2
- package/{tools-TMJXZTCA.js → tools-XSD2BOEN.js} +34 -32
- package/{tuiSummaryLlmCaller-RV3THLZF.js → tuiSummaryLlmCaller-32NRHTT2.js} +3 -3
- package/{understanding-GQKNDDWM.js → understanding-ZOESBLF3.js} +5 -5
- package/{updateDialogTitleAction-ZTWRDXI2.js → updateDialogTitleAction-7FYNJOGP.js} +25 -25
- package/chunk-QYXLLLGL.js +0 -4519
- package/{agentPullCommand-O2MTUAFR.js → agentPullCommand-GOL2S4W2.js} +1 -1
- package/{chunk-DZ3XJVET.js → chunk-3QAF2LTL.js} +3 -3
- package/{chunk-EHLHSX7R.js → chunk-5MMZUWSG.js} +3 -3
- package/{chunk-X7W4TNB4.js → chunk-CMKUBIGW.js} +3 -3
- package/{chunk-4CQLVGRV.js → chunk-ID4G2MAR.js} +3 -3
- package/{chunk-5MIDPSSK.js → chunk-JK7VW2FN.js} +3 -3
- package/{chunk-TILFE6LV.js → chunk-YOCHZD7D.js} +3 -3
- package/{chunk-JRKKFRAV.js → chunk-YTBMA7NO.js} +3 -3
- package/{db-HCJ5PRB5.js → db-6QED3ZVO.js} +3 -3
- package/{runtimeDoctorCommands-LRHLPDRC.js → runtimeDoctorCommands-ID43Z7VX.js} +3 -3
|
@@ -3,12 +3,16 @@ import {
|
|
|
3
3
|
refreshAntigravityOAuthToken,
|
|
4
4
|
refreshOpenAiCodexToken,
|
|
5
5
|
refreshXaiOAuthToken
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5MMZUWSG.js";
|
|
7
|
+
import {
|
|
8
|
+
CliProviderQuotaError,
|
|
9
|
+
executeCli
|
|
10
|
+
} from "./chunk-CMKUBIGW.js";
|
|
7
11
|
import {
|
|
8
12
|
buildLocalAgentLookupKeys,
|
|
9
13
|
normalizeAgentHandle,
|
|
10
14
|
shouldReadAgentKeyRemotely
|
|
11
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-C2MDQQ4O.js";
|
|
12
16
|
import {
|
|
13
17
|
LOCAL_CODEX_AGENT_ID,
|
|
14
18
|
LOCAL_CODEX_AGENT_KEY,
|
|
@@ -17,23 +21,19 @@ import {
|
|
|
17
21
|
} from "./chunk-VHBWHNVT.js";
|
|
18
22
|
import {
|
|
19
23
|
inferCaptureIntent
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import {
|
|
22
|
-
CliProviderQuotaError,
|
|
23
|
-
executeCli
|
|
24
|
-
} from "./chunk-X7W4TNB4.js";
|
|
24
|
+
} from "./chunk-5OIFWVX7.js";
|
|
25
25
|
import {
|
|
26
26
|
buildCliPrompt
|
|
27
27
|
} from "./chunk-ATNTHIZI.js";
|
|
28
28
|
import {
|
|
29
29
|
prepareTools
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-PXQN7IBQ.js";
|
|
31
31
|
import {
|
|
32
32
|
getAntigravityUserAgent,
|
|
33
33
|
isAntigravityOAuthAgent,
|
|
34
34
|
readAntigravityProjectId,
|
|
35
35
|
resolveAntigravityCloudCodeBaseUrl
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-FXXSGWAJ.js";
|
|
37
37
|
import {
|
|
38
38
|
FORCED_TOOLS,
|
|
39
39
|
addDefaultLightWebToolsForConfiguredAgents,
|
|
@@ -43,7 +43,10 @@ import {
|
|
|
43
43
|
readXPostFunctionSchema,
|
|
44
44
|
readXhsProfileFunc,
|
|
45
45
|
readXhsProfileFunctionSchema
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-2W2VYVI5.js";
|
|
47
|
+
import {
|
|
48
|
+
CORE_DRAIN_REASON
|
|
49
|
+
} from "./chunk-D6OQHXVG.js";
|
|
47
50
|
import {
|
|
48
51
|
normalizeDialogTitle
|
|
49
52
|
} from "./chunk-OWOHNGCN.js";
|
|
@@ -52,14 +55,7 @@ import {
|
|
|
52
55
|
} from "./chunk-4ZDM73SD.js";
|
|
53
56
|
import {
|
|
54
57
|
fetchServerSyncedCredential
|
|
55
|
-
} from "./chunk-
|
|
56
|
-
import {
|
|
57
|
-
isCompiledBinary,
|
|
58
|
-
parseUserIdFromAuthToken
|
|
59
|
-
} from "./chunk-ISNCLGUZ.js";
|
|
60
|
-
import {
|
|
61
|
-
DEFAULT_NOLO_SERVER_URL
|
|
62
|
-
} from "./chunk-OLZBQWZU.js";
|
|
58
|
+
} from "./chunk-Q3UKJVU4.js";
|
|
63
59
|
import {
|
|
64
60
|
buildAgentRuntimeDialogWritePlan,
|
|
65
61
|
buildLocalWorkspaceOpenAiTools,
|
|
@@ -73,7 +69,7 @@ import {
|
|
|
73
69
|
parseSseDataLineJson,
|
|
74
70
|
readOpenAiCompatibleSseCompletion,
|
|
75
71
|
resolveOpenAiCompatibleProviderConfig
|
|
76
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-BX6U3ETE.js";
|
|
77
73
|
import {
|
|
78
74
|
buildPlatformChatCompletionRequest,
|
|
79
75
|
canUsePlatformChatProvider,
|
|
@@ -82,22 +78,23 @@ import {
|
|
|
82
78
|
readSseDataValues,
|
|
83
79
|
resolvePlatformChatProviderConfig,
|
|
84
80
|
shouldUsePlatformChatProvider
|
|
85
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-ZPRK73XY.js";
|
|
86
82
|
import {
|
|
87
83
|
resolveAgentRuntimeConfigFromRecord
|
|
88
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-YOCHZD7D.js";
|
|
89
85
|
import {
|
|
90
86
|
parseToolArgumentsJson,
|
|
91
87
|
summarizeToolArguments
|
|
92
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-S3GS2PRL.js";
|
|
93
89
|
import {
|
|
90
|
+
buildLoadSkillExecutor,
|
|
94
91
|
buildNoloWorkspaceCliToolExecutors,
|
|
95
92
|
buildNoloWorkspaceOpenAiTools,
|
|
96
93
|
canonicalizeToolNames,
|
|
97
94
|
filterNoloWorkspaceToolNames,
|
|
98
95
|
parseNoloWorkspaceToolArguments,
|
|
99
96
|
resolveRuntimeToolSurfaceForAgent
|
|
100
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-4SOKXIW4.js";
|
|
101
98
|
import {
|
|
102
99
|
clipCompactText
|
|
103
100
|
} from "./chunk-5MMAK75Q.js";
|
|
@@ -113,25 +110,38 @@ import {
|
|
|
113
110
|
readOAuthCredential,
|
|
114
111
|
resolveFreshAccessToken
|
|
115
112
|
} from "./chunk-JZPBVBIY.js";
|
|
116
|
-
import {
|
|
117
|
-
toErrorMessage
|
|
118
|
-
} from "./chunk-HNMXYYJR.js";
|
|
119
|
-
import {
|
|
120
|
-
getDefaultCliLocalRuntimeDb
|
|
121
|
-
} from "./chunk-H33743XH.js";
|
|
122
113
|
import {
|
|
123
114
|
asRecordOrEmpty
|
|
124
115
|
} from "./chunk-KX6YBIHG.js";
|
|
125
116
|
import {
|
|
126
|
-
dialogMessageRange
|
|
127
|
-
|
|
128
|
-
} from "./chunk-SH2CFQOH.js";
|
|
117
|
+
dialogMessageRange
|
|
118
|
+
} from "./chunk-O4BU24WZ.js";
|
|
129
119
|
import {
|
|
130
120
|
asTrimmedNonEmptyStringArray
|
|
131
121
|
} from "./chunk-I42VC5KR.js";
|
|
132
122
|
import {
|
|
133
123
|
asOptionalFiniteNumber
|
|
134
124
|
} from "./chunk-WWC7I6TA.js";
|
|
125
|
+
import {
|
|
126
|
+
checkStaleRun,
|
|
127
|
+
finalizeRunRecord,
|
|
128
|
+
findRunRecord,
|
|
129
|
+
listRunRecords,
|
|
130
|
+
spawnLocalBackgroundRun
|
|
131
|
+
} from "./chunk-2FTTDCD4.js";
|
|
132
|
+
import {
|
|
133
|
+
isCompiledBinary,
|
|
134
|
+
parseUserIdFromAuthToken
|
|
135
|
+
} from "./chunk-ISNCLGUZ.js";
|
|
136
|
+
import {
|
|
137
|
+
DEFAULT_NOLO_SERVER_URL
|
|
138
|
+
} from "./chunk-OLZBQWZU.js";
|
|
139
|
+
import {
|
|
140
|
+
toErrorMessage
|
|
141
|
+
} from "./chunk-HNMXYYJR.js";
|
|
142
|
+
import {
|
|
143
|
+
getDefaultCliLocalRuntimeDb
|
|
144
|
+
} from "./chunk-H33743XH.js";
|
|
135
145
|
import {
|
|
136
146
|
BUILTIN_NOLO_AGENT_KEY,
|
|
137
147
|
PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
|
|
@@ -139,28 +149,25 @@ import {
|
|
|
139
149
|
PUBLIC_GLM_52_AGENT_KEY,
|
|
140
150
|
PUBLIC_KIMI_K26_IMAGE_AGENT_KEY,
|
|
141
151
|
PUBLIC_KIMI_K27_CODING_AGENT_KEY
|
|
142
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-XFOLQLDN.js";
|
|
153
|
+
import {
|
|
154
|
+
asTrimmedString
|
|
155
|
+
} from "./chunk-3EUW3WEO.js";
|
|
156
|
+
import {
|
|
157
|
+
isRecord
|
|
158
|
+
} from "./chunk-KUG52IAP.js";
|
|
143
159
|
import {
|
|
144
160
|
isLoopbackHostname
|
|
145
161
|
} from "./chunk-4SN6J65J.js";
|
|
146
162
|
import {
|
|
147
163
|
NOLO_CLUSTER_SERVERS
|
|
148
164
|
} from "./chunk-LCBAMY2M.js";
|
|
149
|
-
import {
|
|
150
|
-
asTrimmedString
|
|
151
|
-
} from "./chunk-3EUW3WEO.js";
|
|
152
165
|
import {
|
|
153
166
|
normalizeServerOrigin
|
|
154
167
|
} from "./chunk-CF7PE763.js";
|
|
155
168
|
import {
|
|
156
169
|
asOptionalTrimmedString
|
|
157
170
|
} from "./chunk-G3SUCT4W.js";
|
|
158
|
-
import {
|
|
159
|
-
isRecord
|
|
160
|
-
} from "./chunk-KUG52IAP.js";
|
|
161
|
-
import {
|
|
162
|
-
__toESM
|
|
163
|
-
} from "./chunk-4VNS5WPM.js";
|
|
164
171
|
|
|
165
172
|
// packages/cli/client/localRuntimeAdapter.ts
|
|
166
173
|
import { dirname, extname, join } from "node:path";
|
|
@@ -195,6 +202,7 @@ import { request as httpRequest } from "node:http";
|
|
|
195
202
|
import { request as httpsRequest } from "node:https";
|
|
196
203
|
var TRANSIENT_FETCH_MAX_ATTEMPTS = 3;
|
|
197
204
|
var TRANSIENT_FETCH_RETRY_BASE_DELAY_MS = 250;
|
|
205
|
+
var CORE_DRAINING_MAX_ATTEMPTS = 30;
|
|
198
206
|
var RETRYABLE_HTTP_STATUSES = /* @__PURE__ */ new Set([429, 503]);
|
|
199
207
|
function isTransientFetchError(error) {
|
|
200
208
|
const message = toErrorMessage(error);
|
|
@@ -285,26 +293,44 @@ async function defaultLoopbackRequest(input, init) {
|
|
|
285
293
|
req.end();
|
|
286
294
|
});
|
|
287
295
|
}
|
|
296
|
+
async function isCoreDrainingResponse(response) {
|
|
297
|
+
if (response.status !== 503) return false;
|
|
298
|
+
try {
|
|
299
|
+
const body = await response.clone().json();
|
|
300
|
+
return body?.reason === CORE_DRAIN_REASON;
|
|
301
|
+
} catch {
|
|
302
|
+
return false;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
288
305
|
async function fetchWithTransientRetry(fetchImpl, input, init, options = {}) {
|
|
289
306
|
const retryableStatuses = options.retryableStatuses ?? RETRYABLE_HTTP_STATUSES;
|
|
307
|
+
const requestedMaxAttempts = Number(options.maxAttempts);
|
|
308
|
+
const maxAttempts = Number.isFinite(requestedMaxAttempts) ? Math.min(100, Math.max(1, Math.floor(requestedMaxAttempts))) : TRANSIENT_FETCH_MAX_ATTEMPTS;
|
|
309
|
+
const requestedCoreDrainingMaxAttempts = Number(options.coreDrainingMaxAttempts);
|
|
310
|
+
const coreDrainingMaxAttempts = Number.isFinite(requestedCoreDrainingMaxAttempts) ? Math.min(100, Math.max(1, Math.floor(requestedCoreDrainingMaxAttempts))) : CORE_DRAINING_MAX_ATTEMPTS;
|
|
311
|
+
const loopMaxAttempts = Math.max(maxAttempts, coreDrainingMaxAttempts);
|
|
290
312
|
let lastError;
|
|
291
|
-
for (let attempt = 1; attempt <=
|
|
313
|
+
for (let attempt = 1; attempt <= loopMaxAttempts; attempt += 1) {
|
|
292
314
|
try {
|
|
293
315
|
if (options.loopbackRequest && isLoopbackUrl(input)) {
|
|
294
316
|
return await options.loopbackRequest(input, init);
|
|
295
317
|
}
|
|
296
318
|
const response = await fetchImpl(input, init);
|
|
297
|
-
if (retryableStatuses.has(response.status) &&
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
|
|
319
|
+
if (retryableStatuses.has(response.status) && !init?.signal?.aborted) {
|
|
320
|
+
const coreDraining = await isCoreDrainingResponse(response);
|
|
321
|
+
const attemptBudget = coreDraining ? coreDrainingMaxAttempts : maxAttempts;
|
|
322
|
+
if (attempt < attemptBudget) {
|
|
323
|
+
const delayMs = await resolveRetryAfterMs(response, attempt);
|
|
324
|
+
await (options.sleep ?? defaultSleep)(delayMs);
|
|
325
|
+
continue;
|
|
326
|
+
}
|
|
301
327
|
}
|
|
302
328
|
return response;
|
|
303
329
|
} catch (error) {
|
|
304
330
|
if (init?.signal?.aborted) throw error;
|
|
305
331
|
if (!isTransientFetchError(error)) throw error;
|
|
306
332
|
lastError = error;
|
|
307
|
-
if (attempt <
|
|
333
|
+
if (attempt < maxAttempts) {
|
|
308
334
|
await (options.sleep ?? defaultSleep)(transientFetchRetryDelayMs(attempt));
|
|
309
335
|
}
|
|
310
336
|
}
|
|
@@ -1146,6 +1172,132 @@ function buildServerPlatformToolExecutors(args) {
|
|
|
1146
1172
|
return { ...tableExecutors, ...webExecutors };
|
|
1147
1173
|
}
|
|
1148
1174
|
|
|
1175
|
+
// packages/cli/client/cliAgentRunToolExecutors.ts
|
|
1176
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
1177
|
+
var noopOutput = { write: () => {
|
|
1178
|
+
} };
|
|
1179
|
+
var parseCallArgs = (call) => {
|
|
1180
|
+
try {
|
|
1181
|
+
return JSON.parse(call?.arguments || "{}");
|
|
1182
|
+
} catch {
|
|
1183
|
+
return {};
|
|
1184
|
+
}
|
|
1185
|
+
};
|
|
1186
|
+
var resolveFs = (deps) => deps.fs ?? { existsSync, readFileSync };
|
|
1187
|
+
var tailFile = (logPath, tailLines, fs) => {
|
|
1188
|
+
if (!fs.existsSync(logPath)) return void 0;
|
|
1189
|
+
try {
|
|
1190
|
+
const content = fs.readFileSync(logPath, "utf8");
|
|
1191
|
+
const lines = String(content).split(/\r?\n/);
|
|
1192
|
+
if (lines.length > 0 && lines[lines.length - 1] === "") lines.pop();
|
|
1193
|
+
return lines.slice(Math.max(0, lines.length - tailLines)).join("\n");
|
|
1194
|
+
} catch {
|
|
1195
|
+
return void 0;
|
|
1196
|
+
}
|
|
1197
|
+
};
|
|
1198
|
+
function createCliStartAgentRunExecutor(deps = {}) {
|
|
1199
|
+
return async (call) => {
|
|
1200
|
+
const args = parseCallArgs(call);
|
|
1201
|
+
const agentKey = typeof args.agentKey === "string" ? args.agentKey.trim() : "";
|
|
1202
|
+
const task = typeof args.task === "string" ? args.task.trim() : "";
|
|
1203
|
+
if (!agentKey) throw new Error("startAgentRun: \u7F3A\u5C11 agentKey \u53C2\u6570\u3002");
|
|
1204
|
+
if (!task) throw new Error("startAgentRun: \u7F3A\u5C11\u6709\u6548\u7684 task \u6587\u672C\u63CF\u8FF0\u3002");
|
|
1205
|
+
const message = typeof args.input === "undefined" ? task : `${task}
|
|
1206
|
+
|
|
1207
|
+
--- \u9644\u52A0\u8F93\u5165 ---
|
|
1208
|
+
${JSON.stringify(args.input)}`;
|
|
1209
|
+
const rawArgs = ["--agent", agentKey, "--msg-file", "PLACEHOLDER", "--bg"];
|
|
1210
|
+
const { runId, pid } = await spawnLocalBackgroundRun(
|
|
1211
|
+
{
|
|
1212
|
+
rawArgs,
|
|
1213
|
+
commandPath: ["agent", "run"],
|
|
1214
|
+
cliEntrypointPath: deps.cliEntrypoint,
|
|
1215
|
+
agentKey,
|
|
1216
|
+
cwd: deps.cwd ?? process.cwd(),
|
|
1217
|
+
message,
|
|
1218
|
+
output: noopOutput
|
|
1219
|
+
},
|
|
1220
|
+
deps
|
|
1221
|
+
);
|
|
1222
|
+
return {
|
|
1223
|
+
content: JSON.stringify({ runId, status: "running" }),
|
|
1224
|
+
metadata: {
|
|
1225
|
+
displayData: `\u23F3 \u540E\u53F0 run \u5DF2\u542F\u52A8\uFF0CrunId: ${runId}\uFF08pid ${pid ?? "-"}\uFF09\u3002\u7528 controlAgentRun(action:"status", runId:"${runId}") \u67E5\u8FDB\u5EA6\u3002`
|
|
1226
|
+
}
|
|
1227
|
+
};
|
|
1228
|
+
};
|
|
1229
|
+
}
|
|
1230
|
+
function createCliControlAgentRunExecutor(deps = {}) {
|
|
1231
|
+
return async (call) => {
|
|
1232
|
+
const args = parseCallArgs(call);
|
|
1233
|
+
const action = typeof args.action === "string" ? args.action : "";
|
|
1234
|
+
const tailLines = typeof args.tailLines === "number" ? args.tailLines : 0;
|
|
1235
|
+
if (action === "list") {
|
|
1236
|
+
const runs = listRunRecords(deps).map((record2) => ({
|
|
1237
|
+
runId: record2.runId,
|
|
1238
|
+
status: record2.status,
|
|
1239
|
+
agentKey: record2.agentKey,
|
|
1240
|
+
pid: record2.pid ?? null,
|
|
1241
|
+
startedAt: record2.startedAt
|
|
1242
|
+
}));
|
|
1243
|
+
return {
|
|
1244
|
+
content: JSON.stringify({ runs, count: runs.length }),
|
|
1245
|
+
metadata: {
|
|
1246
|
+
displayData: runs.length > 0 ? `\u{1F4CB} \u627E\u5230 ${runs.length} \u4E2A run\uFF1A
|
|
1247
|
+
${runs.map((r) => `${r.runId} [${r.status}] ${r.agentKey}`).join("\n")}` : "\u{1F4CB} \u6CA1\u6709\u627E\u5230 run\u3002"
|
|
1248
|
+
}
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1251
|
+
if (action !== "status" && action !== "stop") {
|
|
1252
|
+
throw new Error(`controlAgentRun: \u672A\u77E5 action "${action}"\u3002`);
|
|
1253
|
+
}
|
|
1254
|
+
if (!args.runId) throw new Error(`controlAgentRun(action:"${action}"): \u7F3A\u5C11 runId\u3002`);
|
|
1255
|
+
const record = findRunRecord(String(args.runId), deps);
|
|
1256
|
+
if (!record) {
|
|
1257
|
+
return {
|
|
1258
|
+
content: JSON.stringify({ runId: args.runId, found: false }),
|
|
1259
|
+
metadata: { displayData: `\u2753 run ${args.runId} \u672A\u627E\u5230\u3002\u53EF\u80FD\u5DF2\u5B8C\u6210\u5E76\u88AB\u6E05\u7406\uFF0C\u6216 ID \u9519\u8BEF\u3002` }
|
|
1260
|
+
};
|
|
1261
|
+
}
|
|
1262
|
+
if (action === "status") {
|
|
1263
|
+
const reconciled = checkStaleRun(record.runId, deps) ?? record;
|
|
1264
|
+
const logTail = tailLines > 0 ? tailFile(record.logPath, tailLines, resolveFs(deps)) : void 0;
|
|
1265
|
+
return {
|
|
1266
|
+
content: JSON.stringify({
|
|
1267
|
+
runId: reconciled.runId,
|
|
1268
|
+
found: true,
|
|
1269
|
+
status: reconciled.status,
|
|
1270
|
+
pid: reconciled.pid ?? null,
|
|
1271
|
+
agentKey: reconciled.agentKey,
|
|
1272
|
+
startedAt: reconciled.startedAt,
|
|
1273
|
+
endedAt: reconciled.endedAt ?? null,
|
|
1274
|
+
exitCode: reconciled.exitCode ?? null,
|
|
1275
|
+
...logTail !== void 0 ? { logTail } : {}
|
|
1276
|
+
}),
|
|
1277
|
+
metadata: {
|
|
1278
|
+
displayData: `\u{1F4CC} run ${reconciled.runId} status=${reconciled.status}` + (logTail ? `
|
|
1279
|
+
--- \u65E5\u5FD7\uFF08\u672B ${tailLines} \u884C\uFF09---
|
|
1280
|
+
${logTail}` : "")
|
|
1281
|
+
}
|
|
1282
|
+
};
|
|
1283
|
+
}
|
|
1284
|
+
if (typeof record.pid === "number") {
|
|
1285
|
+
try {
|
|
1286
|
+
(deps.kill ?? ((pid, signal) => process.kill(pid, signal)))(
|
|
1287
|
+
record.pid,
|
|
1288
|
+
"SIGTERM"
|
|
1289
|
+
);
|
|
1290
|
+
} catch {
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
finalizeRunRecord(record.runId, { status: "killed" }, deps);
|
|
1294
|
+
return {
|
|
1295
|
+
content: JSON.stringify({ runId: record.runId, found: true, status: "killed" }),
|
|
1296
|
+
metadata: { displayData: `\u{1F6D1} run ${record.runId} \u5DF2\u505C\u6B62\uFF08killed\uFF09\u3002` }
|
|
1297
|
+
};
|
|
1298
|
+
};
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1149
1301
|
// packages/cli/client/cliLocalToolExecutors.ts
|
|
1150
1302
|
function buildCliWorkspaceToolExecutors(args) {
|
|
1151
1303
|
return buildNoloWorkspaceCliToolExecutors({
|
|
@@ -1170,6 +1322,10 @@ function buildLocalToolExecutors(args) {
|
|
|
1170
1322
|
env: args.env,
|
|
1171
1323
|
cliEntrypoint: args.cliEntrypoint
|
|
1172
1324
|
}),
|
|
1325
|
+
// loadSkill resolves SKILL.md from the agent's workspace root (local-fs,
|
|
1326
|
+
// no `nolo` CLI subcommand), so it is wired here instead of inside
|
|
1327
|
+
// buildCliWorkspaceToolExecutors.
|
|
1328
|
+
loadSkill: buildLoadSkillExecutor({ cwd: args.workspaceRoot }),
|
|
1173
1329
|
read_x_post: async (call) => {
|
|
1174
1330
|
const parsedArgs = (() => {
|
|
1175
1331
|
try {
|
|
@@ -1296,6 +1452,16 @@ function buildLocalToolExecutors(args) {
|
|
|
1296
1452
|
metadata: { uiAskChoice: true }
|
|
1297
1453
|
};
|
|
1298
1454
|
},
|
|
1455
|
+
// agent-orchestration 能力包:startAgentRun / controlAgentRun 本地 --bg 执行器
|
|
1456
|
+
// (复用 ~/.nolo/runs/ 注册表,MED-1 修复)。
|
|
1457
|
+
startAgentRun: createCliStartAgentRunExecutor({
|
|
1458
|
+
env: args.env,
|
|
1459
|
+
cliEntrypoint: args.cliEntrypoint,
|
|
1460
|
+
cwd: args.workspaceRoot
|
|
1461
|
+
}),
|
|
1462
|
+
controlAgentRun: createCliControlAgentRunExecutor({
|
|
1463
|
+
env: args.env
|
|
1464
|
+
}),
|
|
1299
1465
|
...args.localToolExecutors ?? {}
|
|
1300
1466
|
};
|
|
1301
1467
|
}
|
|
@@ -6329,6 +6495,24 @@ var CURSOR_CLIENT_VERSION = "cli-2026.01.09-231024f";
|
|
|
6329
6495
|
var CURSOR_REQUEST_PATH = "/agent.v1.AgentService/Run";
|
|
6330
6496
|
var CONNECT_END_STREAM_FLAG = 2;
|
|
6331
6497
|
var HEARTBEAT_INTERVAL_MS = 5e3;
|
|
6498
|
+
var CURSOR_WIRE_MODEL_ALIASES = {
|
|
6499
|
+
// First-party — Cursor Models pool
|
|
6500
|
+
"cursor-grok-4.5": "cursor-grok-4.5-high",
|
|
6501
|
+
"cursor-grok-4.5-fast": "cursor-grok-4.5-high-fast",
|
|
6502
|
+
"grok-4.5": "cursor-grok-4.5-high",
|
|
6503
|
+
"grok-4.5-fast": "cursor-grok-4.5-high-fast",
|
|
6504
|
+
"cursor-composer-2.5": "composer-2.5-fast",
|
|
6505
|
+
"composer-2.5": "composer-2.5",
|
|
6506
|
+
// Third-party convenience aliases we previously published in the registry
|
|
6507
|
+
"cursor-claude-4.6-sonnet": "claude-4.6-sonnet-medium",
|
|
6508
|
+
"cursor-claude-4.6-opus": "claude-4.6-opus-high",
|
|
6509
|
+
"cursor-gemini-3.1-pro": "gemini-3.1-pro"
|
|
6510
|
+
};
|
|
6511
|
+
function resolveCursorWireModelId(model) {
|
|
6512
|
+
const trimmed = model.trim();
|
|
6513
|
+
if (!trimmed) return trimmed;
|
|
6514
|
+
return CURSOR_WIRE_MODEL_ALIASES[trimmed] ?? trimmed;
|
|
6515
|
+
}
|
|
6332
6516
|
function createBlobId(data) {
|
|
6333
6517
|
return new Uint8Array(createHash("sha256").update(data).digest());
|
|
6334
6518
|
}
|
|
@@ -6624,11 +6808,11 @@ function buildCursorRunRequestBytes(args) {
|
|
|
6624
6808
|
selfSummaryCount: 0,
|
|
6625
6809
|
readPaths: []
|
|
6626
6810
|
});
|
|
6627
|
-
const wireModelId = args.model;
|
|
6811
|
+
const wireModelId = resolveCursorWireModelId(args.model);
|
|
6628
6812
|
const modelDetails = create(ModelDetailsSchema, {
|
|
6629
6813
|
modelId: wireModelId,
|
|
6630
|
-
displayModelId:
|
|
6631
|
-
displayName:
|
|
6814
|
+
displayModelId: wireModelId,
|
|
6815
|
+
displayName: wireModelId
|
|
6632
6816
|
});
|
|
6633
6817
|
const requestedModel = create(RequestedModelSchema, {
|
|
6634
6818
|
modelId: wireModelId,
|
|
@@ -6901,6 +7085,7 @@ function toolResultText(result) {
|
|
|
6901
7085
|
function toolResultIsError(result) {
|
|
6902
7086
|
const meta = result.metadata;
|
|
6903
7087
|
if (!meta) return false;
|
|
7088
|
+
if (meta.error === true) return true;
|
|
6904
7089
|
if (typeof meta.error === "string" && meta.error.length > 0) return true;
|
|
6905
7090
|
if (typeof meta.exitCode === "number" && meta.exitCode !== 0) return true;
|
|
6906
7091
|
if (typeof meta.reason === "string" && meta.reason === "error") return true;
|
|
@@ -7207,6 +7392,28 @@ function synthesizeCursorExecToolCall(ctx, toolCallId, toolName, args) {
|
|
|
7207
7392
|
ctx.blocks.push(block);
|
|
7208
7393
|
return block;
|
|
7209
7394
|
}
|
|
7395
|
+
function toErrorMessage2(e) {
|
|
7396
|
+
if (e instanceof Error) return e.message;
|
|
7397
|
+
if (typeof e === "string") return e;
|
|
7398
|
+
try {
|
|
7399
|
+
return JSON.stringify(e);
|
|
7400
|
+
} catch {
|
|
7401
|
+
return String(e);
|
|
7402
|
+
}
|
|
7403
|
+
}
|
|
7404
|
+
function fillToolCallBlockError(toolCallBlock, error, extras) {
|
|
7405
|
+
const message = toErrorMessage2(error);
|
|
7406
|
+
const result = {
|
|
7407
|
+
content: message,
|
|
7408
|
+
metadata: {
|
|
7409
|
+
error: true,
|
|
7410
|
+
message,
|
|
7411
|
+
...extras ?? {}
|
|
7412
|
+
}
|
|
7413
|
+
};
|
|
7414
|
+
toolCallBlock.result = result;
|
|
7415
|
+
return result;
|
|
7416
|
+
}
|
|
7210
7417
|
function decodeMcpArgValue(value) {
|
|
7211
7418
|
try {
|
|
7212
7419
|
const parsed = fromBinary(ValueSchema, value);
|
|
@@ -7288,6 +7495,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
7288
7495
|
...toolResult.metadata ? { metadata: toolResult.metadata } : {}
|
|
7289
7496
|
});
|
|
7290
7497
|
} catch (e) {
|
|
7498
|
+
fillToolCallBlockError(toolCallBlock, e);
|
|
7291
7499
|
result = create(ReadResultSchema, {
|
|
7292
7500
|
result: {
|
|
7293
7501
|
case: "error",
|
|
@@ -7303,6 +7511,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
7303
7511
|
});
|
|
7304
7512
|
}
|
|
7305
7513
|
} else {
|
|
7514
|
+
fillToolCallBlockError(toolCallBlock, "Tool execution not configured", { reason: "rejected" });
|
|
7306
7515
|
result = create(ReadResultSchema, {
|
|
7307
7516
|
result: {
|
|
7308
7517
|
case: "rejected",
|
|
@@ -7356,6 +7565,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
7356
7565
|
...toolResult.metadata ? { metadata: toolResult.metadata } : {}
|
|
7357
7566
|
});
|
|
7358
7567
|
} catch (e) {
|
|
7568
|
+
fillToolCallBlockError(toolCallBlock, e);
|
|
7359
7569
|
result = create(ShellResultSchema, {
|
|
7360
7570
|
result: {
|
|
7361
7571
|
case: "failure",
|
|
@@ -7380,6 +7590,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
7380
7590
|
});
|
|
7381
7591
|
}
|
|
7382
7592
|
} else {
|
|
7593
|
+
fillToolCallBlockError(toolCallBlock, "Tool execution not configured", { reason: "rejected" });
|
|
7383
7594
|
result = create(ShellResultSchema, {
|
|
7384
7595
|
result: {
|
|
7385
7596
|
case: "rejected",
|
|
@@ -7455,6 +7666,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
7455
7666
|
...toolResult.metadata ? { metadata: toolResult.metadata } : {}
|
|
7456
7667
|
});
|
|
7457
7668
|
} catch (e) {
|
|
7669
|
+
fillToolCallBlockError(toolCallBlock, e);
|
|
7458
7670
|
result = create(GrepResultSchema, {
|
|
7459
7671
|
result: {
|
|
7460
7672
|
case: "error",
|
|
@@ -7470,6 +7682,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
7470
7682
|
});
|
|
7471
7683
|
}
|
|
7472
7684
|
} else {
|
|
7685
|
+
fillToolCallBlockError(toolCallBlock, "Tool execution not configured", { reason: "rejected" });
|
|
7473
7686
|
result = create(GrepResultSchema, {
|
|
7474
7687
|
result: {
|
|
7475
7688
|
case: "error",
|
|
@@ -7516,6 +7729,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
7516
7729
|
...toolResult.metadata ? { metadata: toolResult.metadata } : {}
|
|
7517
7730
|
});
|
|
7518
7731
|
} catch (e) {
|
|
7732
|
+
fillToolCallBlockError(toolCallBlock, e);
|
|
7519
7733
|
result = create(WriteResultSchema, {
|
|
7520
7734
|
result: {
|
|
7521
7735
|
case: "error",
|
|
@@ -7531,6 +7745,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
7531
7745
|
});
|
|
7532
7746
|
}
|
|
7533
7747
|
} else {
|
|
7748
|
+
fillToolCallBlockError(toolCallBlock, "Tool execution not configured", { reason: "rejected" });
|
|
7534
7749
|
result = create(WriteResultSchema, {
|
|
7535
7750
|
result: {
|
|
7536
7751
|
case: "rejected",
|
|
@@ -7573,6 +7788,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
7573
7788
|
...toolResult.metadata ? { metadata: toolResult.metadata } : {}
|
|
7574
7789
|
});
|
|
7575
7790
|
} catch (e) {
|
|
7791
|
+
fillToolCallBlockError(toolCallBlock, e);
|
|
7576
7792
|
result = create(DeleteResultSchema, {
|
|
7577
7793
|
result: {
|
|
7578
7794
|
case: "error",
|
|
@@ -7588,6 +7804,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
7588
7804
|
});
|
|
7589
7805
|
}
|
|
7590
7806
|
} else {
|
|
7807
|
+
fillToolCallBlockError(toolCallBlock, "Tool execution not configured", { reason: "rejected" });
|
|
7591
7808
|
result = create(DeleteResultSchema, {
|
|
7592
7809
|
result: {
|
|
7593
7810
|
case: "rejected",
|
|
@@ -7630,6 +7847,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
7630
7847
|
...toolResult.metadata ? { metadata: toolResult.metadata } : {}
|
|
7631
7848
|
});
|
|
7632
7849
|
} catch (e) {
|
|
7850
|
+
fillToolCallBlockError(toolCallBlock, e);
|
|
7633
7851
|
result = create(LsResultSchema, {
|
|
7634
7852
|
result: {
|
|
7635
7853
|
case: "error",
|
|
@@ -7645,6 +7863,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
7645
7863
|
});
|
|
7646
7864
|
}
|
|
7647
7865
|
} else {
|
|
7866
|
+
fillToolCallBlockError(toolCallBlock, "Tool execution not configured", { reason: "rejected" });
|
|
7648
7867
|
result = create(LsResultSchema, {
|
|
7649
7868
|
result: {
|
|
7650
7869
|
case: "rejected",
|
|
@@ -7691,6 +7910,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
7691
7910
|
...toolResult.metadata ? { metadata: toolResult.metadata } : {}
|
|
7692
7911
|
});
|
|
7693
7912
|
} catch (e) {
|
|
7913
|
+
fillToolCallBlockError(toolCallBlock, e);
|
|
7694
7914
|
result = create(McpResultSchema, {
|
|
7695
7915
|
result: {
|
|
7696
7916
|
case: "error",
|
|
@@ -7706,6 +7926,10 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
7706
7926
|
});
|
|
7707
7927
|
}
|
|
7708
7928
|
} else {
|
|
7929
|
+
fillToolCallBlockError(toolCallBlock, `Tool not found: ${toolName}`, {
|
|
7930
|
+
reason: "toolNotFound",
|
|
7931
|
+
toolName
|
|
7932
|
+
});
|
|
7709
7933
|
result = buildMcpToolNotFoundResult(toolName);
|
|
7710
7934
|
}
|
|
7711
7935
|
sendExecClientMessage(h2Request, execMsg, "mcpResult", result);
|
|
@@ -7717,15 +7941,6 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
7717
7941
|
}
|
|
7718
7942
|
}
|
|
7719
7943
|
}
|
|
7720
|
-
function toErrorMessage2(e) {
|
|
7721
|
-
if (e instanceof Error) return e.message;
|
|
7722
|
-
if (typeof e === "string") return e;
|
|
7723
|
-
try {
|
|
7724
|
-
return JSON.stringify(e);
|
|
7725
|
-
} catch {
|
|
7726
|
-
return String(e);
|
|
7727
|
-
}
|
|
7728
|
-
}
|
|
7729
7944
|
function clipArgumentsPreview(toolName, rawArgs) {
|
|
7730
7945
|
return summarizeToolArguments(toolName, rawArgs);
|
|
7731
7946
|
}
|
|
@@ -7976,7 +8191,7 @@ function createCliHybridRecordStore(deps) {
|
|
|
7976
8191
|
}
|
|
7977
8192
|
|
|
7978
8193
|
// packages/cli/client/localRuntimeAdapter.ts
|
|
7979
|
-
|
|
8194
|
+
import { ulid } from "ulid";
|
|
7980
8195
|
var resolveRuntimeAuthToken2 = resolveRuntimeAuthToken;
|
|
7981
8196
|
var currentMetaFile = fileURLToPath(import.meta.url);
|
|
7982
8197
|
var isJsBundle = extname(currentMetaFile) === ".js";
|
|
@@ -7999,7 +8214,7 @@ async function defaultLocalRuntimeDb() {
|
|
|
7999
8214
|
return getDefaultCliLocalRuntimeDb();
|
|
8000
8215
|
}
|
|
8001
8216
|
function createFallbackId() {
|
|
8002
|
-
return
|
|
8217
|
+
return ulid();
|
|
8003
8218
|
}
|
|
8004
8219
|
function logLocalRuntimeDiagnostic(event, fields) {
|
|
8005
8220
|
if (process.env.NOLO_LOCAL_RUNTIME_DEBUG !== "1" && process.env.NOLO_DEBUG !== "1") {
|
|
@@ -8038,7 +8253,13 @@ function buildOpenAiTools(args) {
|
|
|
8038
8253
|
searchFilesParameterVariant: resolveSearchFilesParameterVariant(args.env)
|
|
8039
8254
|
}),
|
|
8040
8255
|
...buildServerPlatformOpenAiTools({ toolNames: args.toolNames }),
|
|
8041
|
-
...buildNoloWorkspaceOpenAiTools({ toolNames: args.toolNames })
|
|
8256
|
+
...buildNoloWorkspaceOpenAiTools({ toolNames: args.toolNames }),
|
|
8257
|
+
// startAgentRun/controlAgentRun:CLI 本地 --bg 执行器已就绪(MED-1 修复,
|
|
8258
|
+
// cliAgentRunToolExecutors),只要 agent 声明(agent-orchestration 包展开)
|
|
8259
|
+
// 就注入 schema。
|
|
8260
|
+
...prepareTools(
|
|
8261
|
+
["startAgentRun", "controlAgentRun"].filter((name) => toolNameSet.has(name))
|
|
8262
|
+
)
|
|
8042
8263
|
];
|
|
8043
8264
|
}
|
|
8044
8265
|
var CLI_DEFAULT_TOOLS = ["exa_search", "fetchWebpage"];
|
|
@@ -8053,9 +8274,10 @@ function resolveCliEffectiveEnabledPacks(args) {
|
|
|
8053
8274
|
}
|
|
8054
8275
|
const base = args.enabledPacks ?? [];
|
|
8055
8276
|
if (base.length === 0) {
|
|
8056
|
-
return ["code"];
|
|
8277
|
+
return ["code", "agent-orchestration", "skills"];
|
|
8057
8278
|
}
|
|
8058
|
-
|
|
8279
|
+
const withOrchestration = base.includes("agent-orchestration") ? base : [...base, "agent-orchestration"];
|
|
8280
|
+
return withOrchestration.includes("skills") ? withOrchestration : [...withOrchestration, "skills"];
|
|
8059
8281
|
}
|
|
8060
8282
|
function resolveCliRequestedToolNames(agentConfig, env) {
|
|
8061
8283
|
const declaredOnly = shouldUseDeclaredOnlyLocalWorkspaceTools(env);
|
|
@@ -8870,8 +9092,18 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
8870
9092
|
if (!res.ok) {
|
|
8871
9093
|
const raw2 = await res.text().catch(() => "");
|
|
8872
9094
|
const data2 = parsePlatformChatCompletionData(raw2);
|
|
9095
|
+
const rawPreview = raw2.length > 200 ? `${raw2.slice(0, 200)}\u2026(${raw2.length}b)` : raw2;
|
|
9096
|
+
const gatewayHeaders = [
|
|
9097
|
+
"server",
|
|
9098
|
+
"cf-ray",
|
|
9099
|
+
"cf-cache-status",
|
|
9100
|
+
"content-length"
|
|
9101
|
+
].map((h) => {
|
|
9102
|
+
const v = res.headers.get(h);
|
|
9103
|
+
return v ? `${h}=${v}` : null;
|
|
9104
|
+
}).filter(Boolean).join(" ");
|
|
8873
9105
|
throw new Error(
|
|
8874
|
-
`platform provider failed: HTTP ${res.status} ${JSON.stringify(data2)}`
|
|
9106
|
+
`platform provider failed: HTTP ${res.status} ${JSON.stringify(data2)}` + (rawPreview ? ` raw="${rawPreview}"` : "") + (gatewayHeaders ? ` headers=[${gatewayHeaders}]` : "")
|
|
8875
9107
|
);
|
|
8876
9108
|
}
|
|
8877
9109
|
const contentType = res.headers.get("content-type") ?? "";
|