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
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
scheduleExistingRecordReplication,
|
|
8
8
|
shouldReplaceLocalWithRemoteRecord,
|
|
9
9
|
shouldReplicateLocalRecord
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OOM6SJNR.js";
|
|
11
11
|
import {
|
|
12
12
|
fetchFromClientDb,
|
|
13
13
|
fetchFromServer,
|
|
14
14
|
isAbortError,
|
|
15
15
|
isReadTimeoutError,
|
|
16
16
|
logger
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-OOSFSFMA.js";
|
|
18
18
|
import {
|
|
19
19
|
shouldReplaceWithNextRecord
|
|
20
20
|
} from "./chunk-GBRG75BQ.js";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateContentTitle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5MOUAAMK.js";
|
|
4
4
|
import {
|
|
5
5
|
require_date_fns
|
|
6
6
|
} from "./chunk-M76ECQRD.js";
|
|
7
|
+
import {
|
|
8
|
+
patch,
|
|
9
|
+
readAndWait
|
|
10
|
+
} from "./chunk-O26GI2JP.js";
|
|
7
11
|
import {
|
|
8
12
|
require_react
|
|
9
13
|
} from "./chunk-3ASDTTEI.js";
|
|
10
14
|
import {
|
|
11
15
|
toErrorMessage
|
|
12
16
|
} from "./chunk-HNMXYYJR.js";
|
|
13
|
-
import {
|
|
14
|
-
patch,
|
|
15
|
-
readAndWait
|
|
16
|
-
} from "./chunk-COMXDWNM.js";
|
|
17
17
|
import {
|
|
18
18
|
asOptionalTrimmedString
|
|
19
19
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -367,7 +367,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
async function createDocState(args, thunkApi) {
|
|
370
|
-
const { createPageAction } = await import("./createPageAction-
|
|
370
|
+
const { createPageAction } = await import("./createPageAction-5MXWVRGY.js");
|
|
371
371
|
return createPageAction(args, thunkApi);
|
|
372
372
|
}
|
|
373
373
|
function subscribe(listener) {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
spawnLocalBackgroundRun
|
|
5
|
-
} from "./chunk-2FTTDCD4.js";
|
|
2
|
+
resolveMachineId
|
|
3
|
+
} from "./chunk-6HYVJV7B.js";
|
|
6
4
|
import {
|
|
7
5
|
buildLocalRunEnv,
|
|
8
6
|
isFullstackCodingAgentRef,
|
|
@@ -11,127 +9,126 @@ import {
|
|
|
11
9
|
resolveRawAgentInput,
|
|
12
10
|
resolveServerUrl,
|
|
13
11
|
writeUsage
|
|
14
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3QAF2LTL.js";
|
|
15
13
|
import {
|
|
16
14
|
createCliCallAgentToolExecutor,
|
|
17
15
|
createCliLocalRuntimeAdapter,
|
|
18
16
|
isBuiltinNoloAgentRef
|
|
19
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-X2S7JTIG.js";
|
|
18
|
+
import {
|
|
19
|
+
CliProviderQuotaError
|
|
20
|
+
} from "./chunk-CMKUBIGW.js";
|
|
20
21
|
import {
|
|
21
22
|
getReadableCliDb
|
|
22
23
|
} from "./chunk-W4NVOSFF.js";
|
|
23
24
|
import {
|
|
24
25
|
readDbRecord,
|
|
25
26
|
resolveAgentRecordFromHybridStore
|
|
26
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-AEZAORLG.js";
|
|
27
28
|
import {
|
|
28
29
|
normalizeAgentHandle
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-C2MDQQ4O.js";
|
|
30
31
|
import {
|
|
31
32
|
NOLO_PROJECT_MANAGER_AGENT_KEY,
|
|
32
33
|
isLocalCliAgentKey
|
|
33
34
|
} from "./chunk-VHBWHNVT.js";
|
|
34
35
|
import {
|
|
35
36
|
applyModelLayerOverride,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
buildModelLayerOverride,
|
|
39
|
-
buildSkillDiscoveryLayer
|
|
40
|
-
} from "./chunk-SL35K7AH.js";
|
|
41
|
-
import {
|
|
42
|
-
CliProviderQuotaError
|
|
43
|
-
} from "./chunk-X7W4TNB4.js";
|
|
44
|
-
import {
|
|
45
|
-
resolveMachineId
|
|
46
|
-
} from "./chunk-6HYVJV7B.js";
|
|
37
|
+
buildModelLayerOverride
|
|
38
|
+
} from "./chunk-LTRXGFMS.js";
|
|
47
39
|
import {
|
|
48
40
|
isGatewayHttpStatus
|
|
49
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-D6OQHXVG.js";
|
|
50
42
|
import {
|
|
51
43
|
buildMemorySubjectsForAgent,
|
|
52
44
|
resolveAgentMemoryPolicy
|
|
53
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-E4HNJSHC.js";
|
|
54
46
|
import {
|
|
55
|
-
load,
|
|
56
47
|
parseExternalSkillMarkdown,
|
|
57
48
|
parseSkillDocProtocol
|
|
58
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-VC6OZXO5.js";
|
|
50
|
+
import {
|
|
51
|
+
getModelContextWindow,
|
|
52
|
+
parseUiAskChoiceContent
|
|
53
|
+
} from "./chunk-5MOUAAMK.js";
|
|
54
|
+
import {
|
|
55
|
+
parsePositiveFiniteNumberOrFallback
|
|
56
|
+
} from "./chunk-Y5GCAMGP.js";
|
|
59
57
|
import {
|
|
60
58
|
touchMemoryItemsInDb
|
|
61
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-HNW7IJSK.js";
|
|
62
60
|
import {
|
|
63
61
|
chooseMemoryOwners,
|
|
64
62
|
loadMemoryCandidatesFromDb
|
|
65
|
-
} from "./chunk-
|
|
66
|
-
import {
|
|
67
|
-
getModelContextWindow,
|
|
68
|
-
parseUiAskChoiceContent
|
|
69
|
-
} from "./chunk-ZIG5LJ7X.js";
|
|
63
|
+
} from "./chunk-XENYHRUE.js";
|
|
70
64
|
import {
|
|
71
65
|
readPipeText,
|
|
72
66
|
spawnProcess
|
|
73
67
|
} from "./chunk-IDZTNRP2.js";
|
|
74
68
|
import {
|
|
75
|
-
|
|
76
|
-
} from "./chunk-
|
|
69
|
+
buildSkillDiscoveryContextBlock
|
|
70
|
+
} from "./chunk-AFON4QUU.js";
|
|
71
|
+
import {
|
|
72
|
+
buildMemoryOverlayLayer,
|
|
73
|
+
buildMemoryUseGuidanceLayer
|
|
74
|
+
} from "./chunk-C4FTUXVF.js";
|
|
77
75
|
import {
|
|
78
76
|
buildPlatformChatCompletionRequest,
|
|
79
77
|
parsePlatformChatCompletionData
|
|
80
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-ZPRK73XY.js";
|
|
81
79
|
import {
|
|
82
80
|
resolveAgentRuntimeConfigFromRecord
|
|
83
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-YOCHZD7D.js";
|
|
84
82
|
import {
|
|
85
83
|
LOCAL_AGENT_CONFIG_MISSING_CODE,
|
|
86
84
|
LOCAL_TURN_ABORTED_CODE,
|
|
87
85
|
readActionGate,
|
|
88
86
|
readCommandActionGatePayload
|
|
89
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-S3GS2PRL.js";
|
|
90
88
|
import {
|
|
91
89
|
resolvePlatformChatCompletionsEndpoint
|
|
92
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-YTBMA7NO.js";
|
|
93
91
|
import {
|
|
94
92
|
clipCompactText
|
|
95
93
|
} from "./chunk-5MMAK75Q.js";
|
|
96
94
|
import {
|
|
97
95
|
findModelConfig
|
|
98
96
|
} from "./chunk-BBYVOSU2.js";
|
|
97
|
+
import {
|
|
98
|
+
asTrimmedLowercaseString
|
|
99
|
+
} from "./chunk-QSJ3HFEF.js";
|
|
99
100
|
import {
|
|
100
101
|
compactWhitespace
|
|
101
102
|
} from "./chunk-DWLEOOGR.js";
|
|
103
|
+
import {
|
|
104
|
+
createRunActivityTracker,
|
|
105
|
+
finalizeRunRecord,
|
|
106
|
+
spawnLocalBackgroundRun
|
|
107
|
+
} from "./chunk-2FTTDCD4.js";
|
|
108
|
+
import {
|
|
109
|
+
resolveAuthToken
|
|
110
|
+
} from "./chunk-ISNCLGUZ.js";
|
|
102
111
|
import {
|
|
103
112
|
toErrorMessage
|
|
104
113
|
} from "./chunk-HNMXYYJR.js";
|
|
105
114
|
import {
|
|
106
115
|
getDefaultCliLocalRuntimeDb
|
|
107
116
|
} from "./chunk-H33743XH.js";
|
|
108
|
-
import {
|
|
109
|
-
parsePositiveFiniteNumberOrFallback
|
|
110
|
-
} from "./chunk-Y5GCAMGP.js";
|
|
111
|
-
import {
|
|
112
|
-
require_index_umd
|
|
113
|
-
} from "./chunk-SH2CFQOH.js";
|
|
114
|
-
import {
|
|
115
|
-
asTrimmedLowercaseString
|
|
116
|
-
} from "./chunk-QSJ3HFEF.js";
|
|
117
117
|
import {
|
|
118
118
|
PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
|
|
119
119
|
PUBLIC_DEEPSEEK_V4_PRO_AGENT_KEY,
|
|
120
120
|
PUBLIC_GLM_52_AGENT_KEY,
|
|
121
121
|
PUBLIC_KIMI_K26_IMAGE_AGENT_KEY
|
|
122
|
-
} from "./chunk-
|
|
123
|
-
import {
|
|
124
|
-
isLoopbackUrl
|
|
125
|
-
} from "./chunk-4SN6J65J.js";
|
|
122
|
+
} from "./chunk-XFOLQLDN.js";
|
|
126
123
|
import {
|
|
127
124
|
asTrimmedString
|
|
128
125
|
} from "./chunk-3EUW3WEO.js";
|
|
126
|
+
import {
|
|
127
|
+
isLoopbackUrl
|
|
128
|
+
} from "./chunk-4SN6J65J.js";
|
|
129
129
|
import {
|
|
130
130
|
asOptionalTrimmedString
|
|
131
131
|
} from "./chunk-G3SUCT4W.js";
|
|
132
|
-
import {
|
|
133
|
-
__toESM
|
|
134
|
-
} from "./chunk-4VNS5WPM.js";
|
|
135
132
|
|
|
136
133
|
// packages/cli/client/tokenUsage.ts
|
|
137
134
|
var PROVIDER_LOOKUP_ORDER = [
|
|
@@ -1468,6 +1465,18 @@ var STRINGS = {
|
|
|
1468
1465
|
en: "[nolo] This agent seems to have hit a quota/rate limit (HTTP 429).\nUse /agent to switch to another agent and keep going \u2014 the dialog context is preserved.",
|
|
1469
1466
|
zh: "[nolo] \u5F53\u524D agent \u4F3C\u4E4E\u989D\u5EA6/\u901F\u7387\u53D7\u9650\uFF08429\uFF09\u3002\n\u53EF\u4EE5\u7528 /agent \u5207\u6362\u5230\u5176\u4ED6 agent \u540E\u7EE7\u7EED\uFF0C\u540C\u4E00\u5BF9\u8BDD\u4F1A\u4FDD\u7559\u4E0A\u4E0B\u6587\u3002"
|
|
1470
1467
|
},
|
|
1468
|
+
balanceExhaustedHint: {
|
|
1469
|
+
en: '[nolo] Insufficient balance. Your message is saved in this dialog \u2014 top up, then send again or say "continue".',
|
|
1470
|
+
zh: "[nolo] \u4F59\u989D\u4E0D\u8DB3\u3002\u4F60\u521A\u53D1\u7684\u8BDD\u5DF2\u4FDD\u5B58\u5728\u5F53\u524D\u5BF9\u8BDD\u91CC\u2014\u2014\u5145\u503C\u540E\u76F4\u63A5\u518D\u8BF4\u4E00\u53E5\u6216\u8BF4\u300C\u7EE7\u7EED\u300D\u5373\u53EF\uFF0C\u4E0D\u4F1A\u4E22\u4E0A\u4E0B\u6587\u3002"
|
|
1471
|
+
},
|
|
1472
|
+
dialogPreservedHint: {
|
|
1473
|
+
en: '[nolo] This turn failed, but the dialog is kept. Send another message (or say "continue") to keep going in the same conversation.',
|
|
1474
|
+
zh: "[nolo] \u672C\u8F6E\u5931\u8D25\u4E86\uFF0C\u4F46\u5BF9\u8BDD\u5DF2\u4FDD\u7559\u3002\u76F4\u63A5\u518D\u8BF4\u4E00\u53E5\uFF08\u6216\u8BF4\u300C\u7EE7\u7EED\u300D\uFF09\u5373\u53EF\u5728\u540C\u4E00\u5BF9\u8BDD\u91CC\u63A5\u7740\u804A\u3002"
|
|
1475
|
+
},
|
|
1476
|
+
dialogNotSavedHint: {
|
|
1477
|
+
en: "[nolo] This turn did not create a dialog. Your next message will start a new conversation \u2014 restate what you need.",
|
|
1478
|
+
zh: "[nolo] \u672C\u8F6E\u6CA1\u6709\u5EFA\u6210\u5BF9\u8BDD\u3002\u4E0B\u4E00\u53E5\u4F1A\u662F\u65B0\u5BF9\u8BDD\u2014\u2014\u8BF7\u628A\u4F60\u60F3\u505A\u7684\u4E8B\u518D\u8BF4\u4E00\u904D\u3002"
|
|
1479
|
+
},
|
|
1471
1480
|
copiedLastReply: {
|
|
1472
1481
|
en: "Copied the last reply to the clipboard.",
|
|
1473
1482
|
zh: "\u5DF2\u590D\u5236\u6700\u540E\u4E00\u6761\u56DE\u590D\u5230\u526A\u8D34\u677F\u3002"
|
|
@@ -1789,7 +1798,9 @@ var TOOL_LABELS = {
|
|
|
1789
1798
|
// Web
|
|
1790
1799
|
fetchWebpage: { en: "Fetch page", zh: "\u6293\u53D6\u7F51\u9875" },
|
|
1791
1800
|
readPage: { en: "Read page", zh: "\u8BFB\u53D6\u7F51\u9875" },
|
|
1792
|
-
exaSearch: { en: "Web search", zh: "\u8054\u7F51\u641C\u7D22" }
|
|
1801
|
+
exaSearch: { en: "Web search", zh: "\u8054\u7F51\u641C\u7D22" },
|
|
1802
|
+
// Skill loading
|
|
1803
|
+
loadSkill: { en: "Used Skill", zh: "\u4F7F\u7528\u6280\u80FD" }
|
|
1793
1804
|
};
|
|
1794
1805
|
function toolLabel(name) {
|
|
1795
1806
|
return TOOL_LABELS[name]?.[currentLocale] ?? name;
|
|
@@ -2084,6 +2095,16 @@ function formatFetchTreeBlockForCli(items, colorEnabled) {
|
|
|
2084
2095
|
return `${headerLine}${treeLines}
|
|
2085
2096
|
`;
|
|
2086
2097
|
}
|
|
2098
|
+
function resolveLoadSkillName(event) {
|
|
2099
|
+
const metaName = typeof event.metadata?.name === "string" ? event.metadata.name : void 0;
|
|
2100
|
+
if (metaName) return metaName;
|
|
2101
|
+
const argName = event.argumentsPreview?.trim();
|
|
2102
|
+
if (argName && !argName.startsWith("{")) return argName;
|
|
2103
|
+
const content = typeof event.content === "string" ? event.content : "";
|
|
2104
|
+
const match = content.match(/Skill "([^"]+)" loaded inline/);
|
|
2105
|
+
if (match?.[1]) return match[1];
|
|
2106
|
+
return argName || "skill";
|
|
2107
|
+
}
|
|
2087
2108
|
function formatCompactToolLine(event, pending, colorEnabled) {
|
|
2088
2109
|
const toolName = event.toolName || pending?.toolName || "tool";
|
|
2089
2110
|
if (isReadToolName(toolName) && event.type === "tool-result") {
|
|
@@ -2112,6 +2133,28 @@ function formatCompactToolLine(event, pending, colorEnabled) {
|
|
|
2112
2133
|
const message = clip(event.message ?? t("toolFailed"), 96);
|
|
2113
2134
|
return formatToolTraceLine(`\u25B8 ${label} \u2717 ${message}`, colorEnabled, "error");
|
|
2114
2135
|
}
|
|
2136
|
+
if (event.type === "tool-result" && toolName === "loadSkill") {
|
|
2137
|
+
const skillName = resolveLoadSkillName(event);
|
|
2138
|
+
const content = typeof event.content === "string" ? event.content : "";
|
|
2139
|
+
const failed2 = /^Skill\s+"[^"]*"\s+not found/.test(content) || isFailedToolResult(event);
|
|
2140
|
+
if (failed2) {
|
|
2141
|
+
const message = clip(content.split("\n")[0] || t("toolFailed"), 96);
|
|
2142
|
+
return formatToolTraceLine(`\u25B8 Used Skill (${skillName}) \u2717 ${message}`, colorEnabled, "error");
|
|
2143
|
+
}
|
|
2144
|
+
const resultLine = `Skill "${skillName}" loaded inline. Follow its instructions.`;
|
|
2145
|
+
if (!colorEnabled) {
|
|
2146
|
+
return `\u25CF Used Skill (${skillName})
|
|
2147
|
+
${resultLine}
|
|
2148
|
+
`;
|
|
2149
|
+
}
|
|
2150
|
+
const bullet = themeText("\u25CF", "success", true);
|
|
2151
|
+
const labelPart = themeText("Used Skill", "muted", true);
|
|
2152
|
+
const namePart = themeText(`(${skillName})`, "chrome", true);
|
|
2153
|
+
const detail = themeText(` ${resultLine}`, "muted", true);
|
|
2154
|
+
return `${bullet} ${labelPart} ${namePart}
|
|
2155
|
+
${detail}
|
|
2156
|
+
`;
|
|
2157
|
+
}
|
|
2115
2158
|
if (event.type === "tool-result" && (event.toolName === "ui_ask_choice" || event.metadata?.uiAskChoice)) {
|
|
2116
2159
|
const block = formatUiAskChoiceBlock(event, colorEnabled);
|
|
2117
2160
|
if (block) return block;
|
|
@@ -2793,9 +2836,9 @@ function isKnownServerPlatformAgent(options) {
|
|
|
2793
2836
|
}
|
|
2794
2837
|
|
|
2795
2838
|
// packages/cli/client/agentRun.ts
|
|
2796
|
-
|
|
2839
|
+
import { ulid } from "ulid";
|
|
2797
2840
|
async function loadRunLocalAgentTurn() {
|
|
2798
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
2841
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-UQBMQI2M.js");
|
|
2799
2842
|
return runLocalAgentTurn;
|
|
2800
2843
|
}
|
|
2801
2844
|
async function resolveCurrentMachineId(options) {
|
|
@@ -2954,6 +2997,35 @@ function isMissingLocalAgentConfigError(error, agentRef) {
|
|
|
2954
2997
|
error && typeof error === "object" && "code" in error && error.code === LOCAL_AGENT_CONFIG_MISSING_CODE && error.agentRef === agentRef
|
|
2955
2998
|
);
|
|
2956
2999
|
}
|
|
3000
|
+
var PLATFORM_PROVIDER_FAILED_RE = /platform provider failed:\s*HTTP\s+(\d+)\b/i;
|
|
3001
|
+
function classifyLocalRunError(message) {
|
|
3002
|
+
const m = message.match(PLATFORM_PROVIDER_FAILED_RE);
|
|
3003
|
+
if (!m) return { kind: "generic" };
|
|
3004
|
+
const status = Number(m[1]);
|
|
3005
|
+
if (status >= 500 && status <= 599) {
|
|
3006
|
+
return { kind: "platform-proxy-transient", status };
|
|
3007
|
+
}
|
|
3008
|
+
return { kind: "platform-proxy-upstream", status };
|
|
3009
|
+
}
|
|
3010
|
+
function describeLocalRunFailure(message) {
|
|
3011
|
+
if (/UPSTREAM_402|Insufficient Balance|余额不足|insufficient\s+balance/i.test(
|
|
3012
|
+
message
|
|
3013
|
+
)) {
|
|
3014
|
+
return `[nolo] auto runtime: local run unavailable (${message}). Not falling back to server. Top up your balance, then send again (or say "\u7EE7\u7EED") \u2014 if a dialog was kept, context is preserved.
|
|
3015
|
+
`;
|
|
3016
|
+
}
|
|
3017
|
+
const cls = classifyLocalRunError(message);
|
|
3018
|
+
if (cls.kind === "platform-proxy-transient") {
|
|
3019
|
+
return `[nolo] auto runtime: local run unavailable (server chat proxy returned HTTP ${cls.status}; this is an upstream/gateway issue, not your local credential or config).${message ? ` Detail: ${message}` : ""} Not falling back to server. Retry shortly, or use --server to run on the server explicitly.
|
|
3020
|
+
`;
|
|
3021
|
+
}
|
|
3022
|
+
if (cls.kind === "platform-proxy-upstream") {
|
|
3023
|
+
return `[nolo] auto runtime: local run unavailable (server chat proxy returned HTTP ${cls.status}).${message ? ` Detail: ${message}` : ""} Not falling back to server. Check the agent's provider/api-key settings on nolo.chat, or use --server to run on the server explicitly.
|
|
3024
|
+
`;
|
|
3025
|
+
}
|
|
3026
|
+
return `[nolo] auto runtime: local run unavailable (${message}). Not falling back to server. Fix the local credential/config and retry, or use --server to run on the server explicitly.
|
|
3027
|
+
`;
|
|
3028
|
+
}
|
|
2957
3029
|
function shouldAttemptAutoLocal(options) {
|
|
2958
3030
|
if (options.localRuntimeAdapter || options.localRuntimeAdapterFactory)
|
|
2959
3031
|
return true;
|
|
@@ -3191,9 +3263,9 @@ async function runLocalAgentTurnForCli(options, settings) {
|
|
|
3191
3263
|
...options.parentWakeOnTerminal ? { parentWakeOnTerminal: true } : {},
|
|
3192
3264
|
...options.parentDialogId ? { parentThreadId: options.parentDialogId } : {}
|
|
3193
3265
|
} : void 0;
|
|
3194
|
-
const currentDialogId = options.continueDialogId ??
|
|
3266
|
+
const currentDialogId = options.continueDialogId ?? ulid();
|
|
3195
3267
|
const runChildTurn = async (input) => {
|
|
3196
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
3268
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-UQBMQI2M.js");
|
|
3197
3269
|
return runLocalAgentTurn(input);
|
|
3198
3270
|
};
|
|
3199
3271
|
const createFreshChildBaseAdapter = () => {
|
|
@@ -3296,12 +3368,12 @@ async function runLocalAgentTurnForCli(options, settings) {
|
|
|
3296
3368
|
};
|
|
3297
3369
|
} catch (error) {
|
|
3298
3370
|
turnOutput.spinner.stop();
|
|
3371
|
+
const savedDialogId = error?.dialogId;
|
|
3299
3372
|
if (error?.code === LOCAL_TURN_ABORTED_CODE || options.abortSignal?.aborted) {
|
|
3300
|
-
const stoppedDialogId = error?.dialogId;
|
|
3301
3373
|
return {
|
|
3302
3374
|
exitCode: 0,
|
|
3303
3375
|
streamInterrupted: true,
|
|
3304
|
-
...
|
|
3376
|
+
...savedDialogId ? { dialogId: savedDialogId } : {}
|
|
3305
3377
|
};
|
|
3306
3378
|
}
|
|
3307
3379
|
if (settings.reportFailure) {
|
|
@@ -3310,7 +3382,11 @@ async function runLocalAgentTurnForCli(options, settings) {
|
|
|
3310
3382
|
`
|
|
3311
3383
|
);
|
|
3312
3384
|
}
|
|
3313
|
-
return {
|
|
3385
|
+
return {
|
|
3386
|
+
exitCode: 1,
|
|
3387
|
+
localError: error,
|
|
3388
|
+
...savedDialogId ? { dialogId: savedDialogId } : {}
|
|
3389
|
+
};
|
|
3314
3390
|
}
|
|
3315
3391
|
}
|
|
3316
3392
|
async function runAgentTurn(options) {
|
|
@@ -3356,13 +3432,13 @@ async function runAgentTurn(options) {
|
|
|
3356
3432
|
}
|
|
3357
3433
|
}
|
|
3358
3434
|
const localErrorMessage = localResult.localError ? toErrorMessage(localResult.localError) : "local runtime failed";
|
|
3359
|
-
options.output.write(
|
|
3360
|
-
`[nolo] auto runtime: local run unavailable (${localErrorMessage}). Not falling back to server. Fix the local credential/config and retry, or use --server to run on the server explicitly.
|
|
3361
|
-
`
|
|
3362
|
-
);
|
|
3435
|
+
options.output.write(describeLocalRunFailure(localErrorMessage));
|
|
3363
3436
|
return {
|
|
3364
3437
|
exitCode: 1,
|
|
3365
|
-
...localResult.dialogId ? { dialogId: localResult.dialogId } : {}
|
|
3438
|
+
...localResult.dialogId ? { dialogId: localResult.dialogId } : {},
|
|
3439
|
+
// Keep localError so TUI can show balance/quota/dialog-preserved hints
|
|
3440
|
+
// instead of only the raw auto-runtime line.
|
|
3441
|
+
...localResult.localError ? { localError: localResult.localError } : {}
|
|
3366
3442
|
};
|
|
3367
3443
|
}
|
|
3368
3444
|
}
|
|
@@ -3381,8 +3457,8 @@ async function runAgentTurn(options) {
|
|
|
3381
3457
|
}
|
|
3382
3458
|
|
|
3383
3459
|
// packages/cli/agentRunCommand.ts
|
|
3384
|
-
import { existsSync as
|
|
3385
|
-
import { join as
|
|
3460
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
|
|
3461
|
+
import { join as join2 } from "node:path";
|
|
3386
3462
|
|
|
3387
3463
|
// packages/agent-runtime/quickChatIntentCore.ts
|
|
3388
3464
|
var INTENT_MODEL = "deepseek-v4-flash";
|
|
@@ -3574,72 +3650,15 @@ async function classifyCliAutoRoute(text, options) {
|
|
|
3574
3650
|
}
|
|
3575
3651
|
}
|
|
3576
3652
|
|
|
3577
|
-
// packages/agent-runtime/skillDiscovery.ts
|
|
3578
|
-
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
3579
|
-
import { join } from "node:path";
|
|
3580
|
-
var SKILL_SCAN_DIRS = [".agents/skills", "docs/skills"];
|
|
3581
|
-
var MAX_DISCOVERED_SKILLS = 50;
|
|
3582
|
-
function parseSkillFrontmatter(filePath) {
|
|
3583
|
-
try {
|
|
3584
|
-
const content = readFileSync(filePath, "utf8").slice(0, 2048);
|
|
3585
|
-
const fmMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
3586
|
-
if (!fmMatch) return {};
|
|
3587
|
-
const fm = load(fmMatch[1]);
|
|
3588
|
-
if (!fm || typeof fm !== "object") return {};
|
|
3589
|
-
const name = typeof fm.name === "string" ? fm.name : void 0;
|
|
3590
|
-
const rawDesc = fm.description;
|
|
3591
|
-
const description = typeof rawDesc === "string" ? rawDesc : rawDesc == null ? void 0 : String(rawDesc);
|
|
3592
|
-
const sanitize = (s) => s?.trim().replace(/^["']|["']$/g, "").replace(/[\n\r]+/g, " ").slice(0, 200);
|
|
3593
|
-
return { name: sanitize(name), description: sanitize(description) };
|
|
3594
|
-
} catch {
|
|
3595
|
-
return {};
|
|
3596
|
-
}
|
|
3597
|
-
}
|
|
3598
|
-
function discoverSkills(cwd) {
|
|
3599
|
-
const skills = [];
|
|
3600
|
-
for (const dir of SKILL_SCAN_DIRS) {
|
|
3601
|
-
if (skills.length >= MAX_DISCOVERED_SKILLS) break;
|
|
3602
|
-
const absDir = join(cwd, dir);
|
|
3603
|
-
if (!existsSync(absDir) || !statSync(absDir).isDirectory()) continue;
|
|
3604
|
-
try {
|
|
3605
|
-
for (const entry of readdirSync(absDir)) {
|
|
3606
|
-
if (skills.length >= MAX_DISCOVERED_SKILLS) break;
|
|
3607
|
-
const skillMdPath = join(absDir, entry, "SKILL.md");
|
|
3608
|
-
if (existsSync(skillMdPath)) {
|
|
3609
|
-
const { name, description } = parseSkillFrontmatter(skillMdPath);
|
|
3610
|
-
skills.push({ name: name ?? entry, description: description ?? "", relativePath: join(dir, entry, "SKILL.md") });
|
|
3611
|
-
continue;
|
|
3612
|
-
}
|
|
3613
|
-
if (dir === "docs/skills" && entry.endsWith(".md")) {
|
|
3614
|
-
const flatPath = join(absDir, entry);
|
|
3615
|
-
const { name, description } = parseSkillFrontmatter(flatPath);
|
|
3616
|
-
skills.push({ name: name ?? entry.replace(/\.md$/, ""), description: description ?? "", relativePath: join(dir, entry) });
|
|
3617
|
-
}
|
|
3618
|
-
}
|
|
3619
|
-
} catch {
|
|
3620
|
-
}
|
|
3621
|
-
}
|
|
3622
|
-
return skills;
|
|
3623
|
-
}
|
|
3624
|
-
function buildSkillDiscoveryContextBlock(cwd) {
|
|
3625
|
-
try {
|
|
3626
|
-
const discovered = discoverSkills(cwd);
|
|
3627
|
-
const layer = buildSkillDiscoveryLayer(discovered, cwd);
|
|
3628
|
-
return layer?.content ?? null;
|
|
3629
|
-
} catch {
|
|
3630
|
-
return null;
|
|
3631
|
-
}
|
|
3632
|
-
}
|
|
3633
|
-
|
|
3634
3653
|
// packages/cli/agentRunPrompts.ts
|
|
3635
|
-
import { existsSync
|
|
3636
|
-
import { dirname, extname, isAbsolute, join
|
|
3654
|
+
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
3655
|
+
import { dirname, extname, isAbsolute, join, relative as relativePath, resolve, sep } from "node:path";
|
|
3637
3656
|
function workflowRefToCandidatePath(cwd, ref) {
|
|
3638
3657
|
const normalized = ref.trim();
|
|
3639
3658
|
if (!normalized) return "";
|
|
3640
3659
|
if (normalized.endsWith(".md") || normalized.includes("/") || normalized.includes("\\")) {
|
|
3641
3660
|
const directPath = resolve(cwd, normalized);
|
|
3642
|
-
if (
|
|
3661
|
+
if (existsSync(directPath)) return directPath;
|
|
3643
3662
|
}
|
|
3644
3663
|
const fileName = normalized.replace(/[^a-zA-Z0-9一-鿿]+/g, "-").replace(/^-+|-+$/g, "");
|
|
3645
3664
|
return resolve(cwd, "docs", "workflows", `${fileName}.md`);
|
|
@@ -3653,26 +3672,26 @@ function skillRefToCandidatePath(cwd, ref) {
|
|
|
3653
3672
|
if (!normalized) return "";
|
|
3654
3673
|
if (normalized.endsWith(".md") || normalized.includes("/") || normalized.includes("\\")) {
|
|
3655
3674
|
const directPath = resolve(cwd, normalized);
|
|
3656
|
-
if (
|
|
3675
|
+
if (existsSync(directPath)) return directPath;
|
|
3657
3676
|
}
|
|
3658
3677
|
const fileName = normalized.replace(/[^a-zA-Z0-9一-鿿]+/g, "-").replace(/^-+|-+$/g, "");
|
|
3659
3678
|
for (const dir of SKILL_SEARCH_DIRS) {
|
|
3660
3679
|
if (dir === "docs/skills") {
|
|
3661
3680
|
const flatPath = resolve(cwd, dir, `${fileName}.md`);
|
|
3662
|
-
if (
|
|
3681
|
+
if (existsSync(flatPath)) return flatPath;
|
|
3663
3682
|
} else {
|
|
3664
3683
|
const skillMdPath = resolve(cwd, dir, fileName, "SKILL.md");
|
|
3665
|
-
if (
|
|
3684
|
+
if (existsSync(skillMdPath)) return skillMdPath;
|
|
3666
3685
|
}
|
|
3667
3686
|
}
|
|
3668
3687
|
return resolve(cwd, "docs", "skills", `${fileName}.md`);
|
|
3669
3688
|
}
|
|
3670
3689
|
async function resolveWorkflowReference(ref, cwd = process.cwd()) {
|
|
3671
3690
|
const path = workflowRefToCandidatePath(cwd, ref);
|
|
3672
|
-
if (!path || !
|
|
3691
|
+
if (!path || !existsSync(path)) {
|
|
3673
3692
|
throw new Error(`Workflow reference not found: ${ref}`);
|
|
3674
3693
|
}
|
|
3675
|
-
const markdown =
|
|
3694
|
+
const markdown = readFileSync(path, "utf8");
|
|
3676
3695
|
const parsed = parseSkillDocProtocol(markdown);
|
|
3677
3696
|
return {
|
|
3678
3697
|
ref,
|
|
@@ -3689,8 +3708,8 @@ function inlineRelativeRefs(body, skillDir) {
|
|
|
3689
3708
|
const absPath = resolve(skillDir, cleaned);
|
|
3690
3709
|
const relative = relativePath(normalizedSkillDir, absPath);
|
|
3691
3710
|
if (relative.startsWith("..") || isAbsolute(relative)) return match;
|
|
3692
|
-
if (!
|
|
3693
|
-
const refContent =
|
|
3711
|
+
if (!existsSync(absPath) || !absPath.endsWith(".md")) return match;
|
|
3712
|
+
const refContent = readFileSync(absPath, "utf8");
|
|
3694
3713
|
return `
|
|
3695
3714
|
|
|
3696
3715
|
### ${label}
|
|
@@ -3701,9 +3720,9 @@ ${refContent}
|
|
|
3701
3720
|
});
|
|
3702
3721
|
}
|
|
3703
3722
|
function listSkillScripts(skillDir) {
|
|
3704
|
-
const scriptsDir =
|
|
3705
|
-
if (!
|
|
3706
|
-
const entries =
|
|
3723
|
+
const scriptsDir = join(skillDir, "scripts");
|
|
3724
|
+
if (!existsSync(scriptsDir) || !statSync(scriptsDir).isDirectory()) return null;
|
|
3725
|
+
const entries = readdirSync(scriptsDir).filter((e) => !e.startsWith("."));
|
|
3707
3726
|
if (entries.length === 0) return null;
|
|
3708
3727
|
return [
|
|
3709
3728
|
"",
|
|
@@ -3729,10 +3748,10 @@ async function resolveSkillReference(ref, options = {}) {
|
|
|
3729
3748
|
} else {
|
|
3730
3749
|
const cwd = options.cwd ?? process.cwd();
|
|
3731
3750
|
const path = skillRefToCandidatePath(cwd, ref);
|
|
3732
|
-
if (!path || !
|
|
3751
|
+
if (!path || !existsSync(path)) {
|
|
3733
3752
|
throw new Error(`Skill reference not found: ${ref}`);
|
|
3734
3753
|
}
|
|
3735
|
-
markdown =
|
|
3754
|
+
markdown = readFileSync(path, "utf8");
|
|
3736
3755
|
filePath = path;
|
|
3737
3756
|
skillDir = dirname(path);
|
|
3738
3757
|
}
|
|
@@ -3823,8 +3842,8 @@ function prependSubjectDialogMarker(message, subjectDialogKey) {
|
|
|
3823
3842
|
function normalizeCliImageInput(input) {
|
|
3824
3843
|
if (/^(https?:|data:|file:)/i.test(input)) return input;
|
|
3825
3844
|
const absolutePath = resolve(input);
|
|
3826
|
-
if (!
|
|
3827
|
-
const base64 =
|
|
3845
|
+
if (!existsSync(absolutePath)) return input;
|
|
3846
|
+
const base64 = readFileSync(absolutePath).toString("base64");
|
|
3828
3847
|
return `data:${imageMimeTypeForPath(absolutePath)};base64,${base64}`;
|
|
3829
3848
|
}
|
|
3830
3849
|
function imageMimeTypeForPath(path) {
|
|
@@ -4473,10 +4492,10 @@ async function runAgentRunCommand(args, deps) {
|
|
|
4473
4492
|
const extraContextBlocks = [];
|
|
4474
4493
|
const AGENTS_MD_MAX = 8192;
|
|
4475
4494
|
for (const name of ["AGENTS.md", "CLAUDE.md"]) {
|
|
4476
|
-
const agentsMdPath =
|
|
4477
|
-
if (
|
|
4495
|
+
const agentsMdPath = join2(cliCwd, name);
|
|
4496
|
+
if (existsSync2(agentsMdPath)) {
|
|
4478
4497
|
try {
|
|
4479
|
-
let mdContent =
|
|
4498
|
+
let mdContent = readFileSync2(agentsMdPath, "utf8").trim();
|
|
4480
4499
|
if (!mdContent) continue;
|
|
4481
4500
|
if (Buffer.byteLength(mdContent, "utf8") > AGENTS_MD_MAX) {
|
|
4482
4501
|
mdContent = Buffer.from(mdContent, "utf8").subarray(0, AGENTS_MD_MAX).toString("utf8") + "\n\n<!-- AGENTS.md truncated -->";
|
|
@@ -4613,12 +4632,20 @@ ${mdContent}`);
|
|
|
4613
4632
|
`[nolo] quota exhausted on ${agentKey}, falling back to ${fallbackAgentKey}
|
|
4614
4633
|
`
|
|
4615
4634
|
);
|
|
4616
|
-
const fallbackResult = await raceWithWatchdog(
|
|
4635
|
+
const fallbackResult = await raceWithWatchdog(
|
|
4636
|
+
runner({
|
|
4637
|
+
...buildRunOptions(fallbackAgentKey),
|
|
4638
|
+
...result.dialogId ? { continueDialogId: result.dialogId } : {}
|
|
4639
|
+
})
|
|
4640
|
+
);
|
|
4617
4641
|
clearWatchdogs();
|
|
4618
4642
|
if (fallbackResult.exitCode === 0) {
|
|
4619
4643
|
result = fallbackResult;
|
|
4620
4644
|
} else {
|
|
4621
|
-
result =
|
|
4645
|
+
result = {
|
|
4646
|
+
...fallbackResult,
|
|
4647
|
+
...fallbackResult.dialogId || result.dialogId ? { dialogId: fallbackResult.dialogId ?? result.dialogId } : {}
|
|
4648
|
+
};
|
|
4622
4649
|
output.write(
|
|
4623
4650
|
`[nolo] fallback to ${fallbackAgentKey} also failed: ${fallbackResult.localError instanceof Error ? fallbackResult.localError.message : String(fallbackResult.localError ?? "unknown error")}
|
|
4624
4651
|
`
|
|
@@ -4708,6 +4735,17 @@ function isQuotaExhaustedError(error) {
|
|
|
4708
4735
|
if (typeof maybeStatusCode === "number" && maybeStatusCode === 429) return true;
|
|
4709
4736
|
return false;
|
|
4710
4737
|
}
|
|
4738
|
+
var BALANCE_ERROR_PATTERNS = [
|
|
4739
|
+
/UPSTREAM_402/i,
|
|
4740
|
+
/Insufficient Balance/i,
|
|
4741
|
+
/insufficient\s+balance/i,
|
|
4742
|
+
/余额不足/
|
|
4743
|
+
];
|
|
4744
|
+
function isBalanceExhaustedError(error) {
|
|
4745
|
+
if (!error) return false;
|
|
4746
|
+
const message = error instanceof Error ? error.message : typeof error === "string" ? error : String(error?.message ?? "");
|
|
4747
|
+
return BALANCE_ERROR_PATTERNS.some((pattern) => pattern.test(message));
|
|
4748
|
+
}
|
|
4711
4749
|
|
|
4712
4750
|
export {
|
|
4713
4751
|
formatTokenCount,
|
|
@@ -4738,7 +4776,6 @@ export {
|
|
|
4738
4776
|
CLI_IMAGE_AGENT_KEY,
|
|
4739
4777
|
CLI_AUTO_TIER_AGENT_KEY_TABLE,
|
|
4740
4778
|
classifyCliAutoRoute,
|
|
4741
|
-
buildSkillDiscoveryContextBlock,
|
|
4742
4779
|
resolveWorkflowReference,
|
|
4743
4780
|
resolveSkillReference,
|
|
4744
4781
|
buildSkillContextBlocks,
|
|
@@ -4746,5 +4783,6 @@ export {
|
|
|
4746
4783
|
normalizeCliImageInput,
|
|
4747
4784
|
inspectLocalRunWorkspace,
|
|
4748
4785
|
runAgentRunCommand,
|
|
4749
|
-
isQuotaExhaustedError
|
|
4786
|
+
isQuotaExhaustedError,
|
|
4787
|
+
isBalanceExhaustedError
|
|
4750
4788
|
};
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
resolvePlatformServerUrl,
|
|
16
16
|
resolveProviderTransportDecision,
|
|
17
17
|
toResponsesTools
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-YTBMA7NO.js";
|
|
19
19
|
|
|
20
20
|
// packages/agent-runtime/openAiCompatibleMessages.ts
|
|
21
21
|
function toOpenAiCompatibleMessages(messages) {
|
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
isBufferedCliStreamingProvider,
|
|
13
13
|
materializeCliImageInputs,
|
|
14
14
|
startCliSession
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-CMKUBIGW.js";
|
|
16
|
+
import "./chunk-JBTJAPUF.js";
|
|
16
17
|
import {
|
|
17
18
|
buildCliPrompt
|
|
18
19
|
} from "./chunk-ATNTHIZI.js";
|
|
19
|
-
import "./chunk-JBTJAPUF.js";
|
|
20
20
|
import "./chunk-4VNS5WPM.js";
|
|
21
21
|
export {
|
|
22
22
|
CLI_PROBE_BINARIES,
|