nolo-cli 0.92.0-alpha.1 → 0.92.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/{_executeModel-SKXPDRHT.js → _executeModel-SCZL7EYW.js} +63 -61
- package/{action-5DATYWOM.js → action-3ZOODRBC.js} +11 -11
- package/{addContentAction-5OLTVWIE.js → addContentAction-IJHG2ZV7.js} +9 -9
- package/{addDialogAgentAction-BRGMORV4.js → addDialogAgentAction-IGFS2UBX.js} +11 -11
- package/{agentDeleteCommand-KIJCEDIQ.js → agentDeleteCommand-CTZYXUBY.js} +45 -43
- package/{agentEmailCommands-KVJQBG6I.js → agentEmailCommands-M4RKRMV5.js} +84 -79
- package/{agentGrantCommands-YW6PQAQ2.js → agentGrantCommands-M3XFO6EN.js} +2 -2
- package/{agentListCommands-S2WK34WE.js → agentListCommands-QWBMMYNO.js} +74 -81
- package/{agentMachineCommands-ESEVMWBG.js → agentMachineCommands-CFGNRGKC.js} +39 -37
- package/{agentProviderCommands-I26OTLEQ.js → agentProviderCommands-TWB6E5WD.js} +1 -1
- package/{agentPullCommand-GLOOXJ2E.js → agentPullCommand-HF4A42D4.js} +3 -3
- package/agentRecordCommands-ZTUVMJOZ.js +131 -0
- package/{agentRunCommand-PQ2D3MTU.js → agentRunCommand-NARA7GSD.js} +82 -76
- package/{agentRunControl-XLGD3UZ5.js → agentRunControl-AVJR4JW4.js} +2 -2
- package/{agentRuntimeLocal-ZLZCZO3C.js → agentRuntimeLocal-OKYH7XBH.js} +40 -34
- package/{agentSlice-JF7MQKXG.js → agentSlice-L6BEWT2Q.js} +11 -11
- package/{appDeleteCommands-KHSC6H42.js → appDeleteCommands-2D2R56YU.js} +39 -37
- package/{appDeployCommands-KCCU76AG.js → appDeployCommands-R5PAA5YI.js} +39 -37
- package/{appDeployStatusCommands-UBGX7463.js → appDeployStatusCommands-VHTBTS3W.js} +39 -37
- package/{appGetCommands-CGVGNM5J.js → appGetCommands-G35QG2QG.js} +39 -37
- package/{appListCommands-JUVQUOGH.js → appListCommands-YQ2PKESX.js} +39 -37
- package/{authCommand-ETL233F2.js → authCommand-W6I6GD3F.js} +115 -23
- package/{authCommands-RGOGCPP6.js → authCommands-GBIFZWD3.js} +5 -5
- package/{builtinSkillRegistry-PJU2R6ST.js → builtinSkillRegistry-XG6RUDWO.js} +9 -8
- package/{chatQueueReduxAdapter-NIJ6XFDN.js → chatQueueReduxAdapter-OINFB5SN.js} +29 -29
- package/{chromeCommands-FZYAU75D.js → chromeCommands-K27J4OVZ.js} +124 -28
- package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-IXRLN57H.js} +4 -3
- package/{chunk-UYJKSCJ4.js → chunk-27ONFIEY.js} +22 -4
- package/{chunk-2HBFQM4C.js → chunk-2QX2MTNK.js} +25 -6
- package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
- package/{chunk-QTV7ZYBE.js → chunk-3BXNTXYI.js} +310 -136
- package/{chunk-6R425QS6.js → chunk-3IYMTWYZ.js} +22 -22
- package/{chunk-NTW5GWDM.js → chunk-3VNWWVKB.js} +2 -0
- package/{chunk-PNBZBDRM.js → chunk-4DPP773Q.js} +2 -2
- package/chunk-5J3PYNUP.js +255 -0
- package/{chunk-JPGCXHNM.js → chunk-5OA5HMTL.js} +1 -1
- package/{chunk-CDS4FQMP.js → chunk-5RUECWE2.js} +165 -15
- package/{chunk-DWUCB2A3.js → chunk-62IL3KQV.js} +4 -34
- package/{chunk-ZIK2FIX4.js → chunk-66MWFK6R.js} +9 -9
- package/{chunk-6YTOJY35.js → chunk-6D2JFXLY.js} +35 -0
- package/{chunk-3BMYXEUW.js → chunk-6O4IK4V2.js} +1 -1
- package/{chunk-NNJ4EAEH.js → chunk-6PPDYAMH.js} +7517 -1091
- package/{chunk-I2MX6JST.js → chunk-7KVZ5LDQ.js} +2 -2
- package/{chunk-Q554LLSI.js → chunk-AUDNYVRC.js} +1 -1
- package/{chunk-UKWGR5SS.js → chunk-AUXHZ2M5.js} +186 -397
- package/{chunk-TLPTMSX3.js → chunk-AVKLJP6J.js} +94 -94
- package/{chunk-5NHGLCPL.js → chunk-AZRHIN5B.js} +1 -1
- package/{chunk-5LRIZC2W.js → chunk-B7ANJQWZ.js} +2 -2
- package/{chunk-3QC3NGWZ.js → chunk-BDHW7EBD.js} +4 -4
- package/{chunk-HNUNYXYB.js → chunk-BJUDYFV5.js} +10 -2
- package/chunk-BMQ2MJUK.js +153 -0
- package/{chunk-3JIXYIXV.js → chunk-BNGW5ASC.js} +12 -2
- package/{chunk-2D6QK26I.js → chunk-BPCPBG2O.js} +16 -16
- package/{chunk-SATOEEL6.js → chunk-BTSYHR7J.js} +4 -4
- package/{chunk-4B3TDK3S.js → chunk-CCOXTK3I.js} +30 -7
- package/{chunk-LS2ZANRJ.js → chunk-CTUQJVQM.js} +1 -1
- package/{chunk-43WRG6QQ.js → chunk-CUBJUVQS.js} +13 -13
- package/chunk-CYSYR67N.js +93 -0
- package/{chunk-PIOIPOSY.js → chunk-D76D3RTR.js} +2 -2
- package/{chunk-HQCSU3DI.js → chunk-DCLMZ5TX.js} +4 -4
- package/{chunk-UT5NALV3.js → chunk-EFZKILX6.js} +4 -4
- package/{chunk-2L3O7RDP.js → chunk-EMBK4B7D.js} +9 -4
- package/{chunk-HVURBGF3.js → chunk-ESRMFY7G.js} +2 -2
- package/{chunk-ABQYVJBJ.js → chunk-ETZWFV6M.js} +1 -1
- package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
- package/{chunk-RAYTIPJ5.js → chunk-F64B2W3R.js} +110 -34
- package/{chunk-S6SP3GWJ.js → chunk-FIZ5TAVE.js} +1 -1
- package/{chunk-MOH3ETXO.js → chunk-GA77XY7N.js} +542 -447
- package/{chunk-2WHQZTB7.js → chunk-GMVELWJG.js} +3 -3
- package/chunk-GMZLP5DV.js +82 -0
- package/{chunk-CJCJF5XB.js → chunk-H6A6X4EK.js} +36 -3
- package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
- package/{chunk-46TSVHGZ.js → chunk-HNRASX3X.js} +8 -8
- package/{chunk-CPH3W5A7.js → chunk-I3TQJXQ7.js} +94 -3
- package/{chunk-TZB6Y4OD.js → chunk-IBQ6NJI4.js} +34 -20
- package/{chunk-IP2RNQU3.js → chunk-LNPYTNMG.js} +9 -5
- package/{chunk-TLO2X5C6.js → chunk-LNUOUGIY.js} +1 -1
- package/{chunk-GII32WZW.js → chunk-M2EJHDJP.js} +3 -0
- package/{chunk-G3V74DVM.js → chunk-MV26343G.js} +75 -18
- package/{chunk-7S4YWN7P.js → chunk-MX574M24.js} +1 -1
- package/{chunk-U7HSBX3I.js → chunk-O26PCYLS.js} +80 -13
- package/chunk-OCZKATRC.js +129 -0
- package/{chunk-YNI45YOE.js → chunk-P4U2QMT5.js} +65 -37
- package/chunk-P6GMCCAT.js +870 -0
- package/{chunk-YQPWX5EE.js → chunk-PEXU23PJ.js} +23 -76
- package/{chunk-7GDFU22A.js → chunk-PHINMJJZ.js} +983 -226
- package/{chunk-YC2MP5NP.js → chunk-Q3SKC2TQ.js} +7 -7
- package/{chunk-NU2SOATM.js → chunk-Q7JFHTQT.js} +3 -3
- package/{chunk-YNNVVLMV.js → chunk-QALRKMHF.js} +11 -10
- package/{chunk-T67757YH.js → chunk-QDSINZM3.js} +1 -1
- package/{chunk-TUEPUNFO.js → chunk-QJLEMM2V.js} +1 -1
- package/{chunk-FEAPBZQW.js → chunk-QL32RJFG.js} +98 -22
- package/{chunk-EONDQISD.js → chunk-QMQBSKUP.js} +886 -154
- package/{chunk-BJ7HBUL2.js → chunk-QZYL5UNG.js} +1003 -1041
- package/{chunk-YDEMAQEY.js → chunk-R4SQ3LGW.js} +1 -1
- package/{chunk-TSD5BVVP.js → chunk-RESDFLXS.js} +13 -13
- package/{chunk-ZKYHTHNE.js → chunk-S5XGT6GB.js} +5 -3
- package/{chunk-SAFZABH7.js → chunk-SV5IJK6K.js} +1 -1
- package/{chunk-W6MEYAGX.js → chunk-TC6TTNZW.js} +45 -45
- package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
- package/{chunk-S46FYEWL.js → chunk-U7ZDIW37.js} +1 -1
- package/chunk-UNYJU5L6.js +780 -0
- package/{chunk-VUHXTHIK.js → chunk-V2AB7ULS.js} +5 -5
- package/{chunk-QFMFJZLO.js → chunk-V7E4PXQD.js} +1 -1
- package/chunk-VJVNU77E.js +83 -0
- package/{chunk-6D6VBVEW.js → chunk-VPFEPRME.js} +9 -9
- package/{chunk-EKXNV6EM.js → chunk-X5VY2LEV.js} +2 -2
- package/{chunk-O6OSWFZQ.js → chunk-XUWRURDF.js} +6 -0
- package/{chunk-Q67DOFOO.js → chunk-Y3PMXGLH.js} +2 -0
- package/{chunk-IMCXPAQV.js → chunk-YFIUVDQY.js} +6 -83
- package/{chunk-FZGV4FGK.js → chunk-YRRASA5Q.js} +268 -143
- package/{chunk-SH43IESU.js → chunk-YUNJN43V.js} +44 -9
- package/{chunk-2F7RJC6L.js → chunk-ZOVKKMF6.js} +1 -1
- package/commandRegistry-T4PY3XBY.js +833 -0
- package/{contentThunks-N7MGBLZJ.js → contentThunks-7SBK3Y7B.js} +29 -29
- package/{cooldownCommands-BSCH2W7P.js → cooldownCommands-ZLEPIB4A.js} +2 -2
- package/{createAgentAutomationAction-DNOR2HPB.js → createAgentAutomationAction-NPD23L7Y.js} +29 -29
- package/{createDialogAction-Y5CTGDHJ.js → createDialogAction-2JVPW2WV.js} +33 -32
- package/{createPageAction-HIQCWUNG.js → createPageAction-UUIPRGHK.js} +35 -35
- package/{dbSlice-NP52Y5TF.js → dbSlice-HFPIJT5P.js} +8 -8
- package/{deleteFile-YG6QMJLU.js → deleteFile-UEAD5A5Z.js} +3 -3
- package/{dialogCommands-RDCQ2IFS.js → dialogCommands-7JXIBGPD.js} +42 -40
- package/{dialogSlice-CCADNU4F.js → dialogSlice-Q2QUTMHK.js} +35 -29
- package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
- package/{docCreateCommands-7BQO7QFJ.js → docCreateCommands-2JDSCRGB.js} +41 -39
- package/{docDeleteCommands-AXWDDTVX.js → docDeleteCommands-Y4XRBWKE.js} +41 -39
- package/{docReadCommands-NMDWZKZW.js → docReadCommands-35FY3PYU.js} +40 -38
- package/{docStore-RSIMI5PS.js → docStore-FWQIXF33.js} +9 -9
- package/{docUpdateCommands-KFIRA6WM.js → docUpdateCommands-MT7YKSP7.js} +41 -39
- package/{fetchMessages-EIU7UFFK.js → fetchMessages-67MEFPZR.js} +2 -2
- package/{getPricing-SLZYHJXY.js → getPricing-NMMFT3YI.js} +3 -3
- package/{handleSendMessageAction-ZIABBL3A.js → handleSendMessageAction-W33QLNXQ.js} +85 -82
- package/index.js +87 -884
- package/{localDialogRead-BTFJ4V2I.js → localDialogRead-EBRS242U.js} +2 -2
- package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-5W6IJRAD.js} +6 -6
- package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-3LRMNLCM.js} +1 -1
- package/{machineCommands-H6TGKZYD.js → machineCommands-HLEUUEKS.js} +77 -72
- package/{machineWsRunDispatch-YU4MGUB5.js → machineWsRunDispatch-DWBXW7XY.js} +75 -70
- package/{memberThunks-XJFHFZ5M.js → memberThunks-SKFZ37VS.js} +9 -9
- package/{models-WYXEJZAX.js → models-ZPU5EDF4.js} +2 -2
- package/oauthTokenStore-ITEB663N.js +23 -0
- package/{offlineMarxistsAgentCommand-JEWCIAWM.js → offlineMarxistsAgentCommand-HGXZV4XJ.js} +1 -1
- package/package.json +1 -1
- package/pdf-U6KSUEZZ.js +26435 -0
- package/processSpawn-SOAV3FEV.js +11 -0
- package/profileConfig-ZGOFORWV.js +43 -0
- package/{providerPresetApply-RWISXOW7.js → providerPresetApply-XTEXOH7X.js} +7 -7
- package/{providerRegistry-5KY7YV6K.js → providerRegistry-ADYDSLKR.js} +7 -7
- package/{read-KFAALANF.js → read-IEJLLUXY.js} +5 -5
- package/{readDocTool-XNMCT64I.js → readDocTool-4SPYCP2Y.js} +5 -3
- package/{readlineWorkspace-JTU5LTZI.js → readlineWorkspace-32ILQXZJ.js} +2398 -2019
- package/{removeDialogAgentAction-X3IS7JNU.js → removeDialogAgentAction-LILXTOQY.js} +14 -14
- package/{runAgentClientLoop-5TPQBYB6.js → runAgentClientLoop-MSCR5Y3E.js} +57 -56
- package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-3USD722U.js} +3 -3
- package/runtimeModeArgs-2Y7BALTO.js +31 -0
- package/{setDialogExtraReferencesAction-QTV3ZJNH.js → setDialogExtraReferencesAction-LVNHLNT5.js} +10 -10
- package/{setPrimaryDialogAgentAction-EUUISNQ2.js → setPrimaryDialogAgentAction-DCKO5NTW.js} +14 -14
- package/{settingSlice-UMATY3PD.js → settingSlice-CNE75ISY.js} +10 -10
- package/{spaceCommands-PR6QHSEG.js → spaceCommands-UYWX63IP.js} +41 -39
- package/{streamAgentChatTurn-TXMNTXML.js → streamAgentChatTurn-73OAEDOJ.js} +146 -85
- package/{switchDialogAgentAction-HWFDQNY5.js → switchDialogAgentAction-JSYUQ5CG.js} +11 -11
- package/{tableCommands-O6NWHFKV.js → tableCommands-G7RV3RU3.js} +4 -4
- package/{toolApiClient-7PSIFQPJ.js → toolApiClient-INIQCPGY.js} +3 -3
- package/{tools-GEVUKUVY.js → tools-6IUC3EFI.js} +51 -50
- package/{tuiSummaryLlmCaller-PKZYGY3B.js → tuiSummaryLlmCaller-RVWN63CP.js} +16 -15
- package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
- package/{updateDialogTitleAction-MFR3UGL5.js → updateDialogTitleAction-KCAY2OZF.js} +32 -32
- package/agentRecordCommands-TTYG2GYM.js +0 -126
- package/chunk-DMFLXNFM.js +0 -79
- package/chunk-Q5FJJ6XI.js +0 -103
- package/chunk-S7Z2HMCN.js +0 -25
- package/{chunk-VMFTFOWF.js → chunk-3AH7LNUB.js} +7 -7
- package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
- package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
selectCurrentServer,
|
|
3
3
|
selectRemoteServers
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3IYMTWYZ.js";
|
|
5
5
|
import {
|
|
6
6
|
createUserKey,
|
|
7
7
|
extractAgentInfo,
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
sanitizeShareData,
|
|
11
11
|
shareKey,
|
|
12
12
|
toNonEmptyString
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-3AH7LNUB.js";
|
|
14
14
|
import {
|
|
15
15
|
noloDeleteRequest,
|
|
16
16
|
noloWriteRequest
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-AUXHZ2M5.js";
|
|
18
18
|
import {
|
|
19
19
|
normalizeTimeFields
|
|
20
20
|
} from "./chunk-QOKAKDPE.js";
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// packages/agent-runtime/sseFrames.ts
|
|
2
|
+
async function* readSseFrames(response) {
|
|
3
|
+
const reader = response.body?.getReader();
|
|
4
|
+
if (!reader) {
|
|
5
|
+
throw new Error("SSE response did not include a readable body.");
|
|
6
|
+
}
|
|
7
|
+
const decoder = new TextDecoder();
|
|
8
|
+
let buffer = "";
|
|
9
|
+
while (true) {
|
|
10
|
+
const { done, value } = await reader.read();
|
|
11
|
+
if (done) break;
|
|
12
|
+
buffer += decoder.decode(value, { stream: true });
|
|
13
|
+
let boundary = findSseFrameBoundary(buffer);
|
|
14
|
+
while (boundary) {
|
|
15
|
+
yield buffer.slice(0, boundary.index);
|
|
16
|
+
buffer = buffer.slice(boundary.index + boundary.separatorLength);
|
|
17
|
+
boundary = findSseFrameBoundary(buffer);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const remaining = decoder.decode();
|
|
21
|
+
if (remaining) {
|
|
22
|
+
buffer += remaining;
|
|
23
|
+
let boundary = findSseFrameBoundary(buffer);
|
|
24
|
+
while (boundary) {
|
|
25
|
+
yield buffer.slice(0, boundary.index);
|
|
26
|
+
buffer = buffer.slice(boundary.index + boundary.separatorLength);
|
|
27
|
+
boundary = findSseFrameBoundary(buffer);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (buffer.trim()) yield buffer;
|
|
31
|
+
}
|
|
32
|
+
function findSseFrameBoundary(buffer) {
|
|
33
|
+
const lfLf = buffer.indexOf("\n\n");
|
|
34
|
+
const crLfCrLf = buffer.indexOf("\r\n\r\n");
|
|
35
|
+
if (lfLf === -1 && crLfCrLf === -1) return null;
|
|
36
|
+
const useLf = lfLf !== -1 && (crLfCrLf === -1 || lfLf < crLfCrLf);
|
|
37
|
+
return useLf ? { index: lfLf, separatorLength: 2 } : { index: crLfCrLf, separatorLength: 4 };
|
|
38
|
+
}
|
|
39
|
+
async function* streamSseDataValues(response, parse) {
|
|
40
|
+
const reader = response.body?.getReader();
|
|
41
|
+
if (!reader) return;
|
|
42
|
+
const decoder = new TextDecoder();
|
|
43
|
+
let buffer = "";
|
|
44
|
+
while (true) {
|
|
45
|
+
const { done, value } = await reader.read();
|
|
46
|
+
if (done) break;
|
|
47
|
+
buffer += decoder.decode(value, { stream: true });
|
|
48
|
+
const lines = buffer.split("\n");
|
|
49
|
+
buffer = lines.pop() ?? "";
|
|
50
|
+
for (const line of lines) {
|
|
51
|
+
const parsed = parse(line);
|
|
52
|
+
if (parsed) yield parsed;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const remaining = decoder.decode();
|
|
56
|
+
if (remaining) {
|
|
57
|
+
buffer += remaining;
|
|
58
|
+
const lines = buffer.split("\n");
|
|
59
|
+
buffer = lines.pop() ?? "";
|
|
60
|
+
for (const line of lines) {
|
|
61
|
+
const parsed = parse(line);
|
|
62
|
+
if (parsed) yield parsed;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (buffer.trim()) {
|
|
66
|
+
const parsed = parse(buffer);
|
|
67
|
+
if (parsed) yield parsed;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async function readSseDataValues(response, parse) {
|
|
71
|
+
const values = [];
|
|
72
|
+
for await (const value of streamSseDataValues(response, parse)) {
|
|
73
|
+
values.push(value);
|
|
74
|
+
}
|
|
75
|
+
return values;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
readSseFrames,
|
|
80
|
+
streamSseDataValues,
|
|
81
|
+
readSseDataValues
|
|
82
|
+
};
|
|
@@ -46,6 +46,7 @@ function extractMessage(error) {
|
|
|
46
46
|
}
|
|
47
47
|
function parseResetsInMs(text) {
|
|
48
48
|
if (!text) return void 0;
|
|
49
|
+
const sanitized = text.replace(/\btrace[\s_-]?id\b[^)\n]*/gi, " ").replace(/\b[0-9a-f]{16,}\b/gi, " ");
|
|
49
50
|
const unitMs = (n, unit) => {
|
|
50
51
|
if (/^d/.test(unit)) return n * 24 * 3600 * 1e3;
|
|
51
52
|
if (/^h/.test(unit)) return n * 3600 * 1e3;
|
|
@@ -54,12 +55,13 @@ function parseResetsInMs(text) {
|
|
|
54
55
|
return NaN;
|
|
55
56
|
};
|
|
56
57
|
const re = /(\d+)\s*(d(?:ay|ays)?|h(?:r|rs|our|ours)?|m(?:in|ins|inute|inutes)?|s(?:ec|ecs|econd|econds)?)/gi;
|
|
58
|
+
const MAX_SINGLE_MATCH_MS = 7 * 24 * 3600 * 1e3;
|
|
57
59
|
let totalMs = 0;
|
|
58
60
|
let matched = false;
|
|
59
61
|
let m;
|
|
60
|
-
while ((m = re.exec(
|
|
62
|
+
while ((m = re.exec(sanitized)) !== null) {
|
|
61
63
|
const ms = unitMs(Number(m[1]), m[2]);
|
|
62
|
-
if (!Number.isFinite(ms)) continue;
|
|
64
|
+
if (!Number.isFinite(ms) || ms > MAX_SINGLE_MATCH_MS) continue;
|
|
63
65
|
totalMs += ms;
|
|
64
66
|
matched = true;
|
|
65
67
|
}
|
|
@@ -178,6 +180,36 @@ function resolveCooldownGate(input, now) {
|
|
|
178
180
|
}
|
|
179
181
|
return now - lastProbeAt >= PROBE_INTERVAL_MS ? "probe" : "blocked";
|
|
180
182
|
}
|
|
183
|
+
function resolveCredentialKey(agent) {
|
|
184
|
+
if (!agent || typeof agent !== "object") return void 0;
|
|
185
|
+
for (const field of ["apiKeyRef", "credentialRef"]) {
|
|
186
|
+
const value = agent[field];
|
|
187
|
+
if (typeof value === "string") {
|
|
188
|
+
const trimmed = value.trim();
|
|
189
|
+
if (trimmed) return trimmed;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return void 0;
|
|
193
|
+
}
|
|
194
|
+
function resolveCredentialKeyWithFallback(agent) {
|
|
195
|
+
const byRef = resolveCredentialKey(agent);
|
|
196
|
+
if (byRef) return byRef;
|
|
197
|
+
if (!agent || typeof agent !== "object") return void 0;
|
|
198
|
+
const endpoint = agent.customProviderUrl;
|
|
199
|
+
if (typeof endpoint === "string") {
|
|
200
|
+
const trimmed = endpoint.trim();
|
|
201
|
+
if (trimmed) {
|
|
202
|
+
try {
|
|
203
|
+
const origin = new URL(trimmed).origin;
|
|
204
|
+
if (origin && origin !== "null") return `custom-endpoint:${origin}`;
|
|
205
|
+
} catch {
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
const key = agent.key;
|
|
210
|
+
if (typeof key === "string" && key.trim()) return `custom-agent:${key.trim()}`;
|
|
211
|
+
return void 0;
|
|
212
|
+
}
|
|
181
213
|
|
|
182
214
|
export {
|
|
183
215
|
QUOTA_ERROR_PATTERNS,
|
|
@@ -186,5 +218,6 @@ export {
|
|
|
186
218
|
isQuotaLimited403Body,
|
|
187
219
|
resolveAvailabilityAction,
|
|
188
220
|
mergeAvailabilityDeadline,
|
|
189
|
-
resolveCooldownGate
|
|
221
|
+
resolveCooldownGate,
|
|
222
|
+
resolveCredentialKeyWithFallback
|
|
190
223
|
};
|
|
@@ -206,9 +206,12 @@ export {
|
|
|
206
206
|
resolveNoloStateDir,
|
|
207
207
|
getLegacyCredentialPath,
|
|
208
208
|
migrateLegacyCredentialFile,
|
|
209
|
+
DEFAULT_REFRESH_SKEW_MS,
|
|
209
210
|
getCredentialsDir,
|
|
211
|
+
getCredentialPath,
|
|
210
212
|
readOAuthCredential,
|
|
211
213
|
writeOAuthCredential,
|
|
214
|
+
removeOAuthCredential,
|
|
212
215
|
createOAuthTokenStore,
|
|
213
216
|
isTokenExpired,
|
|
214
217
|
resolveFreshAccessToken
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-UAD2WT54.js";
|
|
8
8
|
import {
|
|
9
9
|
toTimestampMs
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QALRKMHF.js";
|
|
11
11
|
import {
|
|
12
12
|
fetchFromServer,
|
|
13
13
|
getAllServers
|
|
@@ -280,12 +280,6 @@ var fetchAuthoritativeRemoteSpace = async ({
|
|
|
280
280
|
};
|
|
281
281
|
|
|
282
282
|
export {
|
|
283
|
-
selectSpaceRemoteAuth,
|
|
284
|
-
spaceListsUser,
|
|
285
|
-
membershipBelongsToUser,
|
|
286
|
-
fetchRemoteUserSpaceMemberships,
|
|
287
|
-
fetchRemoteSpace,
|
|
288
|
-
fetchAuthoritativeRemoteSpace,
|
|
289
283
|
getMemberSpaces,
|
|
290
284
|
getAllMemberSpaces,
|
|
291
285
|
setMemberSpaces,
|
|
@@ -297,5 +291,11 @@ export {
|
|
|
297
291
|
setMembershipLoaded,
|
|
298
292
|
addMemberSpace,
|
|
299
293
|
removeMemberSpace,
|
|
300
|
-
updateMemberSpaceName
|
|
294
|
+
updateMemberSpaceName,
|
|
295
|
+
selectSpaceRemoteAuth,
|
|
296
|
+
spaceListsUser,
|
|
297
|
+
membershipBelongsToUser,
|
|
298
|
+
fetchRemoteUserSpaceMemberships,
|
|
299
|
+
fetchRemoteSpace,
|
|
300
|
+
fetchAuthoritativeRemoteSpace
|
|
301
301
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAgentRunTerminalStatus
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3VNWWVKB.js";
|
|
4
4
|
import {
|
|
5
5
|
isCompiledBinary,
|
|
6
6
|
resolveCliEntrypointPath
|
|
@@ -11,6 +11,60 @@ import { homedir as nodeHomedir } from "node:os";
|
|
|
11
11
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
12
12
|
import * as nodeFs from "node:fs";
|
|
13
13
|
import { execFileSync as nodeExecFileSync, spawn as nodeSpawn } from "node:child_process";
|
|
14
|
+
|
|
15
|
+
// packages/ai/tools/agent/runFailureClass.ts
|
|
16
|
+
var RATE_LIMIT_PATTERN = /429|rate.?limit|quota|insufficient.?balance|UPSTREAM_402|cooling|冷却/i;
|
|
17
|
+
var PROVIDER_ERROR_PATTERN = /provider|upstream|5\d\d|bad.?gateway|service.?unavailable|overloaded/i;
|
|
18
|
+
var MALFORMED_PATTERN = /MALFORMED_FUNCTION_CALL|malformed|invalid.?function.?call|invalid.?tool.?call/i;
|
|
19
|
+
var STALLED_PATTERN = /stall|no.?progress|repetition|stagnant|无进展|卡死/i;
|
|
20
|
+
var TOOL_ERROR_PATTERN = /tool.?error|tool.?fail|工具/i;
|
|
21
|
+
function classifyRunFailure(input) {
|
|
22
|
+
const status = typeof input.status === "string" ? input.status : "";
|
|
23
|
+
if (status === "done" || status === "killed" || status === "cancelled") {
|
|
24
|
+
return void 0;
|
|
25
|
+
}
|
|
26
|
+
const reason = typeof input.failureReason === "string" ? input.failureReason : "";
|
|
27
|
+
const message = typeof input.errorMessage === "string" ? input.errorMessage : "";
|
|
28
|
+
switch (reason) {
|
|
29
|
+
case "provider_rate_limited":
|
|
30
|
+
return { failureClass: "rate_limited", retryable: true };
|
|
31
|
+
case "provider_error":
|
|
32
|
+
return MALFORMED_PATTERN.test(message) ? { failureClass: "provider_error", retryable: false } : { failureClass: "provider_error", retryable: true };
|
|
33
|
+
case "stalled":
|
|
34
|
+
return { failureClass: "stalled", retryable: false };
|
|
35
|
+
case "tool_error":
|
|
36
|
+
return { failureClass: "tool_error", retryable: false };
|
|
37
|
+
case "config_unresolved":
|
|
38
|
+
return { failureClass: "unknown", retryable: false };
|
|
39
|
+
case "cancelled":
|
|
40
|
+
return void 0;
|
|
41
|
+
default:
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
if (message) {
|
|
45
|
+
if (RATE_LIMIT_PATTERN.test(message)) {
|
|
46
|
+
return { failureClass: "rate_limited", retryable: true };
|
|
47
|
+
}
|
|
48
|
+
if (MALFORMED_PATTERN.test(message)) {
|
|
49
|
+
return { failureClass: "provider_error", retryable: false };
|
|
50
|
+
}
|
|
51
|
+
if (STALLED_PATTERN.test(message)) {
|
|
52
|
+
return { failureClass: "stalled", retryable: false };
|
|
53
|
+
}
|
|
54
|
+
if (TOOL_ERROR_PATTERN.test(message)) {
|
|
55
|
+
return { failureClass: "tool_error", retryable: false };
|
|
56
|
+
}
|
|
57
|
+
if (PROVIDER_ERROR_PATTERN.test(message)) {
|
|
58
|
+
return { failureClass: "provider_error", retryable: true };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (status === "failed" || status === "timeout" || status === "orphaned") {
|
|
62
|
+
return { failureClass: "unknown", retryable: false };
|
|
63
|
+
}
|
|
64
|
+
return void 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// packages/cli/agentRunControl.ts
|
|
14
68
|
var RUN_TERMINAL_STATUSES = /* @__PURE__ */ new Set([
|
|
15
69
|
"done",
|
|
16
70
|
"failed",
|
|
@@ -794,6 +848,7 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
|
|
|
794
848
|
logPath,
|
|
795
849
|
queuePath,
|
|
796
850
|
batchId,
|
|
851
|
+
...typeof input.credentialGroup === "string" && input.credentialGroup.trim() ? { credentialGroup: input.credentialGroup.trim() } : {},
|
|
797
852
|
...typeof input.parentDialogId === "string" && input.parentDialogId.trim() ? { parentDialogId: input.parentDialogId.trim() } : {},
|
|
798
853
|
...dodCommands && dodCommands.length > 0 ? { dodCommands } : {},
|
|
799
854
|
...spawnHead ? { spawnHead } : {},
|
|
@@ -925,6 +980,15 @@ function transitionRunToTerminal(runId, update, deps = {}, options = {}) {
|
|
|
925
980
|
} else if (update.status === "killed") {
|
|
926
981
|
record2.failureReason = "cancelled";
|
|
927
982
|
}
|
|
983
|
+
const classification = classifyRunFailure({
|
|
984
|
+
status: update.status,
|
|
985
|
+
failureReason: record2.failureReason,
|
|
986
|
+
errorMessage: update.note ?? record2.note
|
|
987
|
+
});
|
|
988
|
+
if (classification) {
|
|
989
|
+
record2.failureClass = classification.failureClass;
|
|
990
|
+
record2.retryable = classification.retryable;
|
|
991
|
+
}
|
|
928
992
|
const resolvedToolCount = typeof update.toolCallCount === "number" ? update.toolCallCount : record2.activity?.counters?.toolCalls;
|
|
929
993
|
if (typeof resolvedToolCount === "number") {
|
|
930
994
|
record2.toolCallCount = resolvedToolCount;
|
|
@@ -1044,6 +1108,15 @@ function checkStaleRun(runId, deps = {}) {
|
|
|
1044
1108
|
const at = now().toISOString();
|
|
1045
1109
|
latest.status = "orphaned";
|
|
1046
1110
|
latest.note = pidReused ? "orphaned: process gone (pid reused by another process)" : "orphaned: process gone without writing terminal status";
|
|
1111
|
+
const orphanClassification = classifyRunFailure({
|
|
1112
|
+
status: "orphaned",
|
|
1113
|
+
failureReason: latest.failureReason,
|
|
1114
|
+
errorMessage: latest.note
|
|
1115
|
+
});
|
|
1116
|
+
if (orphanClassification) {
|
|
1117
|
+
latest.failureClass = orphanClassification.failureClass;
|
|
1118
|
+
latest.retryable = orphanClassification.retryable;
|
|
1119
|
+
}
|
|
1047
1120
|
latest.endedAt = at;
|
|
1048
1121
|
latest.reconciledAt = at;
|
|
1049
1122
|
latest.pid = void 0;
|
|
@@ -1259,6 +1332,18 @@ function printStatusOnce(record, deps) {
|
|
|
1259
1332
|
}
|
|
1260
1333
|
if (record.note) deps.output.write(`note: ${record.note}
|
|
1261
1334
|
`);
|
|
1335
|
+
if (record.failureReason) deps.output.write(`failure: ${record.failureReason}
|
|
1336
|
+
`);
|
|
1337
|
+
if (record.failureClass) {
|
|
1338
|
+
deps.output.write(
|
|
1339
|
+
`class: ${record.failureClass}${typeof record.retryable === "boolean" ? ` (retryable=${record.retryable})` : ""}
|
|
1340
|
+
`
|
|
1341
|
+
);
|
|
1342
|
+
}
|
|
1343
|
+
if (record.credentialGroup) {
|
|
1344
|
+
deps.output.write(`credGroup: ${record.credentialGroup}
|
|
1345
|
+
`);
|
|
1346
|
+
}
|
|
1262
1347
|
const activitySummary = formatActivitySummary(record.activity);
|
|
1263
1348
|
if (activitySummary) deps.output.write(`${activitySummary}
|
|
1264
1349
|
`);
|
|
@@ -1388,14 +1473,20 @@ async function terminateRunProcess(record, initialSignal, deps) {
|
|
|
1388
1473
|
signalGroup(initialSignal);
|
|
1389
1474
|
if (initialSignal === "SIGTERM") {
|
|
1390
1475
|
const deadline = nowMs() + TERMINATE_GRACE_MS;
|
|
1391
|
-
|
|
1476
|
+
const maxIterations = Math.ceil(TERMINATE_GRACE_MS / TERMINATE_POLL_MS) + 1;
|
|
1477
|
+
let iterations = 0;
|
|
1478
|
+
while (!isPidGone(pid, deps) && nowMs() < deadline && iterations < maxIterations) {
|
|
1479
|
+
iterations += 1;
|
|
1392
1480
|
await sleep(TERMINATE_POLL_MS);
|
|
1393
1481
|
}
|
|
1394
1482
|
}
|
|
1395
1483
|
if (!isPidGone(pid, deps)) {
|
|
1396
1484
|
signalGroup("SIGKILL");
|
|
1397
1485
|
const killDeadline = nowMs() + TERMINATE_KILL_GRACE_MS;
|
|
1398
|
-
|
|
1486
|
+
const maxIterations = Math.ceil(TERMINATE_KILL_GRACE_MS / TERMINATE_POLL_MS) + 1;
|
|
1487
|
+
let iterations = 0;
|
|
1488
|
+
while (!isPidGone(pid, deps) && nowMs() < killDeadline && iterations < maxIterations) {
|
|
1489
|
+
iterations += 1;
|
|
1399
1490
|
await sleep(TERMINATE_POLL_MS);
|
|
1400
1491
|
}
|
|
1401
1492
|
}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildLocalAgentLookupKeys,
|
|
3
3
|
shouldReadAgentKeyRemotely
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-R4SQ3LGW.js";
|
|
5
5
|
import {
|
|
6
6
|
resolveCliAgentKeyInput
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SV5IJK6K.js";
|
|
8
8
|
import {
|
|
9
9
|
toErrorMessage
|
|
10
10
|
} from "./chunk-HNMXYYJR.js";
|
|
11
|
-
import {
|
|
12
|
-
readPipeText,
|
|
13
|
-
spawnProcess
|
|
14
|
-
} from "./chunk-X7HHHIOZ.js";
|
|
15
11
|
import {
|
|
16
12
|
parseUserIdFromAuthToken,
|
|
17
13
|
readOption,
|
|
@@ -19,9 +15,13 @@ import {
|
|
|
19
15
|
resolveServerCandidates,
|
|
20
16
|
resolveServerUrl
|
|
21
17
|
} from "./chunk-A7GB5UGH.js";
|
|
18
|
+
import {
|
|
19
|
+
readPipeText,
|
|
20
|
+
spawnProcess
|
|
21
|
+
} from "./chunk-Y6ROFCZO.js";
|
|
22
22
|
import {
|
|
23
23
|
createAgentKey
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-3AH7LNUB.js";
|
|
25
25
|
|
|
26
26
|
// packages/cli/agentRecordHelpers.ts
|
|
27
27
|
import { readFileSync } from "node:fs";
|
|
@@ -266,18 +266,31 @@ async function resolveAgentRecordFromHybridStore(args) {
|
|
|
266
266
|
if (record && typeof record === "object") {
|
|
267
267
|
const cacheAge = Date.now() - (Number(record?.cachedAt) || 0);
|
|
268
268
|
const STALE_CACHE_MS = 6e4;
|
|
269
|
-
if (record?.serverOrigin && shouldReadAgentKeyRemotely(key) && cacheAge > STALE_CACHE_MS) {
|
|
269
|
+
if (record?.serverOrigin && shouldReadAgentKeyRemotely(key) && (args.fresh === true || cacheAge > STALE_CACHE_MS)) {
|
|
270
270
|
try {
|
|
271
|
-
await readAgentRecord({
|
|
271
|
+
const fresh = await readAgentRecord({
|
|
272
272
|
agentKey: key,
|
|
273
273
|
authToken,
|
|
274
274
|
fallbackFetchImpl: args.fallbackFetchImpl,
|
|
275
275
|
fetchImpl: args.fetchImpl,
|
|
276
276
|
serverUrl: record.serverOrigin
|
|
277
277
|
});
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
278
|
+
if (fresh) {
|
|
279
|
+
try {
|
|
280
|
+
await args.db.put(key, {
|
|
281
|
+
...fresh,
|
|
282
|
+
dbKey: key,
|
|
283
|
+
serverOrigin: record.serverOrigin,
|
|
284
|
+
cachedAt: Date.now()
|
|
285
|
+
});
|
|
286
|
+
} catch {
|
|
287
|
+
}
|
|
288
|
+
return {
|
|
289
|
+
agentKey: key,
|
|
290
|
+
record: { ...fresh, serverOrigin: record.serverOrigin },
|
|
291
|
+
source: record?.serverOrigin ? "remote-cache" : "local-cache",
|
|
292
|
+
cacheHit: false
|
|
293
|
+
};
|
|
281
294
|
}
|
|
282
295
|
} catch (err) {
|
|
283
296
|
const msg = toErrorMessage(err);
|
|
@@ -293,7 +306,10 @@ async function resolveAgentRecordFromHybridStore(args) {
|
|
|
293
306
|
return {
|
|
294
307
|
agentKey: key,
|
|
295
308
|
record,
|
|
296
|
-
source: record?.serverOrigin ? "remote-cache" : "local-cache"
|
|
309
|
+
source: record?.serverOrigin ? "remote-cache" : "local-cache",
|
|
310
|
+
// 明确告知调用方「这是缓存视图」——缓存可能持有字段子集,也可能已过期。
|
|
311
|
+
// 调用方据此决定是否用 fresh 重读,而不是把不完整视图当成真值。
|
|
312
|
+
cacheHit: true
|
|
297
313
|
};
|
|
298
314
|
}
|
|
299
315
|
} catch {
|
|
@@ -495,7 +511,7 @@ function parseAgentUpdateArgs(args) {
|
|
|
495
511
|
updates[entry.slice(0, index)] = parseJsonishValue(entry.slice(index + 1));
|
|
496
512
|
}
|
|
497
513
|
if (Object.keys(updates).length === 0) {
|
|
498
|
-
if (!promptDoc && !copyProviderFrom) {
|
|
514
|
+
if (!promptDoc && !copyProviderFrom && !presetId) {
|
|
499
515
|
throw new Error("No updates provided. Use --model / --cli-provider / --api-source / --field key=value.");
|
|
500
516
|
}
|
|
501
517
|
}
|
|
@@ -507,21 +523,19 @@ async function buildCreatedAgentRecord(args) {
|
|
|
507
523
|
const resolvedAgentInput = resolveCliAgentKeyInput(args.parsed.agentInput);
|
|
508
524
|
const agentKey = resolvedAgentInput.startsWith("agent-") ? resolvedAgentInput : createAgentKey.private(userId || "local", resolvedAgentInput);
|
|
509
525
|
if (args.parsed.presetId) {
|
|
510
|
-
const { resolveProviderPresetFields } = await import("./providerPresetApply-
|
|
526
|
+
const { resolveProviderPresetFields } = await import("./providerPresetApply-XTEXOH7X.js");
|
|
511
527
|
const fields = resolveProviderPresetFields(args.parsed.presetId);
|
|
512
528
|
if (fields.kind === "manual") {
|
|
513
529
|
throw new Error(
|
|
514
530
|
`unknown --preset "${args.parsed.presetId}". Run \`nolo agent providers\` to list preset ids.`
|
|
515
531
|
);
|
|
516
532
|
}
|
|
517
|
-
if (fields.kind === "oauth" || fields.requiresDesktopOAuth) {
|
|
518
|
-
throw new Error(
|
|
519
|
-
`--preset "${args.parsed.presetId}" is an OAuth subscription; create it in Nolo Desktop (OAuth login required).`
|
|
520
|
-
);
|
|
521
|
-
}
|
|
522
533
|
const u = args.parsed.updates;
|
|
523
534
|
u.apiSource = "custom";
|
|
524
535
|
u.provider = u.provider ?? fields.provider;
|
|
536
|
+
if (fields.apiKeyRef && !u.apiKeyRef) {
|
|
537
|
+
u.apiKeyRef = fields.apiKeyRef;
|
|
538
|
+
}
|
|
525
539
|
if (fields.customProviderUrl && !u.customProviderUrl) {
|
|
526
540
|
u.customProviderUrl = fields.customProviderUrl;
|
|
527
541
|
}
|
|
@@ -4,18 +4,18 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
asNonEmptyStringArray,
|
|
6
6
|
asTrimmedNonEmptyStringArray
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3AH7LNUB.js";
|
|
8
8
|
import {
|
|
9
9
|
asOptionalFiniteNumber
|
|
10
10
|
} from "./chunk-WWC7I6TA.js";
|
|
11
|
+
import {
|
|
12
|
+
isRecord
|
|
13
|
+
} from "./chunk-KUG52IAP.js";
|
|
11
14
|
import {
|
|
12
15
|
isOwnedAgentKey,
|
|
13
16
|
ownedAgentKey,
|
|
14
17
|
publicAgentKey
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
isRecord
|
|
18
|
-
} from "./chunk-KUG52IAP.js";
|
|
18
|
+
} from "./chunk-M2EJHDJP.js";
|
|
19
19
|
import {
|
|
20
20
|
asOptionalTrimmedString
|
|
21
21
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -764,6 +764,7 @@ var AGENT_SELECTION_PRIORITY_INSTRUCTIONS = ` - \u4F18\u5148\u7EA7\u5951\u7EA6
|
|
|
764
764
|
4. \u516C\u5F00 Agent \u53D1\u73B0\uFF1A\u4EC5\u5F53 preferred \u5217\u8868\u4E2D\u6CA1\u6709\u9002\u5408\u4E14\u53EF\u7528\u7684\u5019\u9009\uFF0C\u6216\u7528\u6237\u660E\u786E\u8981\u6C42\u63A2\u7D22\u516C\u5F00 Agent \u65F6\uFF0C\u624D\u663E\u5F0F\u8C03\u7528 listAgents({ scope: "public" })\u3002\u516C\u5F00 Agent \u53EF\u80FD\u6D88\u8017 platform_credits\uFF0C\u5FC5\u987B\u5728\u83B7\u5F97\u7528\u6237\u660E\u786E\u6263\u8D39\u6388\u6743\u540E\u624D\u80FD\u8C03\u7528\u3002
|
|
765
765
|
- \u6536\u85CF\u4F18\u5148\u786C\u95E8\uFF08\u7528\u6237\u94A6\u5B9A\uFF0C\u8986\u76D6\u9876\u6863\u6210\u672C\u95E8\uFF09\uFF1A\u5F53\u5B58\u5728\u53EF\u7528\u4E14\u9002\u5408\u4EFB\u52A1\u7684\u6536\u85CF user_subscription / user_api / local Agent \u65F6\uFF0C\u7981\u6B62\u6539\u6D3E platform_credits\u3002favorite + platform_credits \u53EA\u8868\u793A\u7528\u6237\u8868\u8FBE\u8FC7\u504F\u597D\u5E76\u56E0\u6B64\u8FDB\u5165 preferred discovery\uFF0C\u4E0D\u4EE3\u8868\u514D\u8D39\u6216\u514D\u6388\u6743\uFF1B\u4F7F\u7528\u5B83\u4ECD\u987B\u9075\u5B88\u5E73\u53F0\u79EF\u5206\u6263\u8D39\u544A\u77E5/\u6388\u6743\u89C4\u5219\u3002\u4F46\u6CE8\u610F\u533A\u5206\uFF1AbillingSource="owner_subscription" \u7684\u6536\u85CF Agent\uFF08\u975E\u81EA\u6709\u3001\u8DD1 owner \u7684\u8BA2\u9605\u901A\u9053\uFF09\u4E0D\u5C5E\u4E8E\u6B64\u5217\u2014\u2014\u5B83\u662F\u53EF\u76F4\u63A5\u4F7F\u7528\u7684\uFF0C\u4E0D\u4EA7\u751F\u4EFB\u4F55\u6263\u8D39\uFF0C\u4E0D\u8981\u5BF9\u5B83\u7D22\u53D6\u6263\u8D39\u6388\u6743\u3001\u4E5F\u4E0D\u8981\u56E0\u6B64\u6539\u6D3E\u5E73\u53F0 Agent\u3002\u6BCF\u6B21 startAgentRun \u90FD\u521B\u5EFA\u72EC\u7ACB\u7684 run/dialog\uFF1B\u5E76\u884C\u6D3E\u53D1\u65F6\u5FC5\u987B\u7528\u5404\u81EA\u7684 runId\uFF0C\u5E76\u7528 batchId \u7BA1\u7406\u6279\u6B21\uFF0C\u907F\u514D\u7F16\u6392\u5C42\u6DF7\u6DC6\u7ED3\u679C\u3002\u4EC5\u5F53\u6536\u85CF Agent \u786E\u8BA4\u4E0D\u53EF\u7528\u540E\u624D\u5141\u8BB8\u6D3E\u5E73\u53F0 Agent\uFF0C\u4E14\u5FC5\u987B\u5F53\u6B21\u544A\u77E5\u7528\u6237\u5C06\u6D88\u8017\u5E73\u53F0\u79EF\u5206\u3002
|
|
766
766
|
- \u5339\u914D\u53C2\u8003\uFF1A\u6309\u4EFB\u52A1\u6240\u9700\u80FD\u529B\u7B5B tools \u5B57\u6BB5\uFF1B\u540C\u6863\u5019\u9009\u4F18\u5148\u6210\u672C\u4F4E\uFF08\u4F4E inputPrice\uFF09\u6216\u8D70\u7528\u6237\u79C1\u6709\u51ED\u636E\u7684\u901A\u9053\u3002tools \u5B57\u6BB5\u53EA\u53CD\u6620\u989D\u5916\u80FD\u529B\uFF0C\u4E0D\u53CD\u6620 coding \u80FD\u529B\u2014\u2014\u4EE3\u7801\u5DE5\u5177\u7531 host \u81EA\u52A8\u6CE8\u5165\uFF0Ctools=[] \u4E0D\u4EE3\u8868\u4E0D\u80FD\u5199\u4EE3\u7801\uFF0C\u4E0D\u8981\u636E\u6B64\u6392\u9664\u5019\u9009\u3002
|
|
767
|
+
- reset-aware economics\uFF08\u53EA\u4F5C\u540C\u6863\u3001\u9002\u5408\u3001\u5F53\u524D\u53EF\u7528\u5019\u9009\u4E4B\u95F4\u7684\u7ECF\u6D4E\u504F\u597D\uFF0C\u4E0D\u8986\u76D6\u6536\u85CF\u786C\u95E8\u3001\u80FD\u529B\u5339\u914D\u6216\u53EF\u7528\u6027\uFF09\uFF1AlistAgents \u5DF2\u66B4\u9732 economics\uFF08\u5B98\u65B9\u5CF0\u8C37\u4EF7\u683C/\u914D\u989D\u500D\u7387\uFF09\u548C quota\uFF08\u4E0A\u6E38\u771F\u5B9E remaining/limit/utilization/resetAt \u7A97\u53E3\uFF09\u3002\u5BF9\u4E8E billingSource="user_subscription"\uFF0C\u82E5 quota \u7A97\u53E3\u540C\u65F6\u7ED9\u51FA\u672A\u7528\u989D\u5EA6\u4FE1\u53F7\uFF08remaining/limit \u6216 utilization\uFF09\u4E14 resetAt \u5728\u672A\u6765\uFF0C\u4E14\u8BE5\u7A97\u53E3\u4EE3\u8868\u8BA2\u9605\u989D\u5EA6\u672C\u8EAB\uFF08\u5982 Claude \u8BA2\u9605\u7684 5h/7d \u914D\u989D\u7A97\u53E3\u8FD9\u7C7B\u4E0D\u7528\u5C31\u4F5C\u5E9F\u7684\u5DF2\u4ED8\u989D\u5EA6\uFF09\uFF0C\u800C\u4E0D\u662F\u7EAF\u541E\u5410\u5BB9\u91CF\uFF0C\u5219\u8FD9\u90E8\u5206\u5DF2\u4ED8\u989D\u5EA6\u4F1A\u5728 reset \u540E\u5931\u6548\uFF1B\u5728\u8D28\u91CF/\u80FD\u529B\u90FD\u8DB3\u591F\u65F6\uFF0Creset \u8D8A\u8FD1\u4E14\u672A\u7528\u989D\u5EA6\u8D8A\u591A\uFF0C\u8D8A\u5E94\u4F18\u5148\u6D88\u8017\uFF0C\u907F\u514D\u628A\u5DF2\u4ED8\u6B3E\u989D\u5EA6\u767D\u767D\u8FC7\u671F\u540E\u518D\u53BB\u4EA7\u751F PAYG / platform \u6210\u672C\u3002\u4E0D\u8981\u56E0\u4E3A\u53EA\u6709 resetAt \u5C31\u63A8\u65AD\u201C\u8FD8\u6709\u53EF\u7528\u989D\u5EA6\u201D\uFF0C\u4E5F\u4E0D\u8981\u628A billingSource="user_api" \u7684 requests/tokens rate-limit reset\u3001nextAvailableAt\uFF08429 \u51B7\u5374\u6062\u590D\uFF09\u8BEF\u5F53\u6210\u201C\u5DF2\u4ED8\u989D\u5EA6\u8FC7\u671F\u201D\uFF1B\u5B83\u4EEC\u662F\u5BB9\u91CF/\u53EF\u7528\u6027\u4FE1\u53F7\uFF0C\u4E0D\u662F\u7ECF\u6D4E\u4F18\u60E0\u3002\u901A\u7528 requests/tokens rate-limit \u5BB9\u91CF\u7A97\u53E3\u5373\u4F7F\u51FA\u73B0\u5728 billingSource="user_subscription" \u901A\u9053\u4E0A\uFF0C\u4E5F\u53EA\u662F\u901F\u7387\u5BB9\u91CF\u800C\u975E\u4F1A\u8FC7\u671F\u7684\u5DF2\u4ED8\u8D44\u4EA7\uFF0C\u4E0D\u5F97\u89E6\u53D1\u8BE5\u504F\u597D\uFF1B\u5206\u4E0D\u6E05\u7A97\u53E3\u8BED\u4E49\u65F6\u6309\u5BB9\u91CF\u5904\u7406\uFF0C\u4E0D\u6309\u7ECF\u6D4E\u8D44\u4EA7\u5904\u7406\u3002owner_subscription \u4E0D\u5360\u5F53\u524D\u7528\u6237\u989D\u5EA6\uFF0C\u4ECD\u6309\u201C\u8C03\u7528\u8005\u4E0E\u5E73\u53F0\u96F6\u65B0\u589E\u6210\u672C\u201D\u7406\u89E3\uFF0C\u4F46\u4E0D\u8981\u628A owner \u7684 quota \u5F53\u6210\u5F53\u524D\u7528\u6237\u9700\u8981\u4E3B\u52A8\u70E7\u5B8C\u7684\u8D44\u4EA7\u3002\u82E5 economics \u663E\u793A\u5373\u5C06\u8DE8 peak/off_peak \u6216 quotaMultiplier/priceMultiplier \u5C06\u53D8\u5316\uFF0C\u628A changesAt \u4E0E\u4EFB\u52A1\u9884\u8BA1\u65F6\u957F\u4E00\u8D77\u8003\u8651\uFF1B\u8BC1\u636E\u4E0D\u8DB3\u65F6\u4FDD\u6301 neutral\uFF0C\u4E0D\u731C\u3002
|
|
767
768
|
- isOwned=true\u3001isOAuth=true \u6216 apiSource="custom" \u7684\u5019\u9009\u6309\u4F18\u5148\u7EA7\u5951\u7EA6\u5904\u7406\u3002
|
|
768
769
|
- qualityContext \u662F task-domain-specific supporting evidence\uFF1A\u53EA\u5728\u5339\u914D\u7684 task domain \u5185\u3001suitable candidates \u4E2D\uFF0C\u5E76\u4E14\u4ECD\u6392\u5728\u73B0\u6709\u4F18\u5148\u7EA7 / \u6210\u672C / \u53EF\u7528\u6027\u89C4\u5219\u4E4B\u540E\u53C2\u8003\u3002
|
|
769
770
|
\u6BCF\u884C\u5F62\u5982 \`dimension [direction] (benchmark version): model=score\`\u3002\u6BCF\u4E2A dimension\uFF08preference / rubric / slop / repetition / length / task_success \u7B49\uFF09\u90FD\u662F\u4E00\u6761\u72EC\u7ACB evidence\uFF0C\u4E0D\u662F\u603B\u5206\u7684\u4E00\u90E8\u5206\u3002
|
|
@@ -854,6 +855,7 @@ function buildNoloWorkspaceOpenAiTools(args) {
|
|
|
854
855
|
}
|
|
855
856
|
}, ["query"]);
|
|
856
857
|
add("listAgents", "List agents for delegation. Default scope='preferred' returns the user's favorites, owned, OAuth, custom API, and local agents only; scope='public' discovers shared/marketplace agents; scope='all' returns their deduplicated union. Public agents may consume platform credits. Copy the agentKey verbatim; use the runnable agentKey exactly and do not infer it from the display name. publicOnly is deprecated compatibility for scope='public'. Rate-limited agents are hidden unless showUnavailable is true.", {
|
|
858
|
+
query: stringToolParam("Optional case-insensitive search substring matching agent name, model, provider, handle, or agentKey."),
|
|
857
859
|
scope: { type: "string", enum: ["preferred", "public", "all"], description: "Discovery scope; preferred is the default and does not load the public marketplace." },
|
|
858
860
|
publicOnly: { type: "boolean", description: "Deprecated compatibility alias for scope='public'." },
|
|
859
861
|
showUnavailable: { type: "boolean", description: "Include agents currently rate-limited (429). Default false." },
|
|
@@ -1183,6 +1185,8 @@ function buildNoloWorkspaceCommandArgs(call) {
|
|
|
1183
1185
|
}
|
|
1184
1186
|
case "listAgents": {
|
|
1185
1187
|
const cliArgs = ["agent", "list"];
|
|
1188
|
+
const query = noloStringArg(args.query);
|
|
1189
|
+
if (query) cliArgs.push("--query", query);
|
|
1186
1190
|
const space = noloStringArg(args.space);
|
|
1187
1191
|
if (space) cliArgs.push("--space", space);
|
|
1188
1192
|
const scope = noloStringArg(args.scope);
|
|
@@ -24,8 +24,10 @@ var extractCustomId = (key) => {
|
|
|
24
24
|
return extractKeyPart(key, 2);
|
|
25
25
|
};
|
|
26
26
|
var PUBLIC_AGENT_KEY_PREFIX = "agent-pub-";
|
|
27
|
+
var SYSTEM_AGENT_KEY_PREFIX = "agent-system-";
|
|
27
28
|
var publicAgentKey = (id) => `${PUBLIC_AGENT_KEY_PREFIX}${id}`;
|
|
28
29
|
var parsePublicAgentId = (key) => key.startsWith(PUBLIC_AGENT_KEY_PREFIX) ? key.slice(PUBLIC_AGENT_KEY_PREFIX.length) : null;
|
|
30
|
+
var parseSystemAgentId = (key) => key.startsWith(SYSTEM_AGENT_KEY_PREFIX) ? key.slice(SYSTEM_AGENT_KEY_PREFIX.length) : null;
|
|
29
31
|
var ownedAgentKeyPrefix = (userId) => `agent-${userId}-`;
|
|
30
32
|
var ownedAgentKey = (userId, id) => id.startsWith(ownedAgentKeyPrefix(userId)) ? id : `${ownedAgentKeyPrefix(userId)}${id}`;
|
|
31
33
|
var isOwnedAgentKey = (key, userId) => typeof key === "string" && key.startsWith(ownedAgentKeyPrefix(userId));
|
|
@@ -37,6 +39,7 @@ export {
|
|
|
37
39
|
PUBLIC_AGENT_KEY_PREFIX,
|
|
38
40
|
publicAgentKey,
|
|
39
41
|
parsePublicAgentId,
|
|
42
|
+
parseSystemAgentId,
|
|
40
43
|
ownedAgentKeyPrefix,
|
|
41
44
|
ownedAgentKey,
|
|
42
45
|
isOwnedAgentKey,
|