nolo-cli 0.83.0-alpha.1 → 0.83.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 +2 -2
- package/{_executeModel-TRYFRXDJ.js → _executeModel-LUNEV235.js} +48 -48
- package/{action-D22U6CTH.js → action-YVYQEAAV.js} +11 -11
- package/{addContentAction-XAPUTGL4.js → addContentAction-O7R66HEX.js} +9 -9
- package/{addDialogAgentAction-M7VLLBZM.js → addDialogAgentAction-74OA7KYP.js} +8 -8
- package/{agentDeleteCommand-EKSPHWHV.js → agentDeleteCommand-2YAHAZFJ.js} +31 -30
- package/{agentEmailCommands-QD2K4YG6.js → agentEmailCommands-G6A7IRPQ.js} +67 -64
- package/{agentGrantCommands-R3VQEZJR.js → agentGrantCommands-M3XFO6EN.js} +2 -2
- package/{agentListCommands-WFBYAQKO.js → agentListCommands-KMS675GZ.js} +40 -33
- package/{agentMachineCommands-F5DKXCQP.js → agentMachineCommands-W2SMNSQ3.js} +31 -30
- package/{agentProviderCommands-65ZC2WB4.js → agentProviderCommands-GNPTL5XR.js} +87 -0
- package/{agentPullCommand-N7L2CT7L.js → agentPullCommand-O5MPVJ5E.js} +3 -3
- package/agentRecordCommands-D7BRMFNI.js +128 -0
- package/{agentRunCommand-4VMDFEQF.js → agentRunCommand-VL6MMEUB.js} +65 -62
- package/{agentRunControl-T44MESII.js → agentRunControl-AVJR4JW4.js} +2 -2
- package/{agentRuntimeLocal-FMOEMRUU.js → agentRuntimeLocal-VXZSDIGT.js} +27 -26
- package/{agentSlice-Q5XOM2PN.js → agentSlice-5YJHUO47.js} +10 -10
- package/{appDeleteCommands-AXB7XZE7.js → appDeleteCommands-32MHLR4L.js} +31 -30
- package/{appDeployCommands-ZLWI4QUC.js → appDeployCommands-WCQOUSOB.js} +31 -30
- package/{appDeployStatusCommands-2RAEYJQF.js → appDeployStatusCommands-6QKB7DYN.js} +31 -30
- package/{appGetCommands-QYUXS4W4.js → appGetCommands-SFAPP5PB.js} +31 -30
- package/{appListCommands-GQLN4J5X.js → appListCommands-EKUBDRUO.js} +31 -30
- package/{authCommand-7N2G6MXP.js → authCommand-F4EFRRX6.js} +89 -24
- package/{authCommands-ILTBI6JV.js → authCommands-RGOGCPP6.js} +4 -5
- package/builtinSkillRegistry-FUAVTRVZ.js +33 -0
- package/{chatQueueReduxAdapter-WICMMQZT.js → chatQueueReduxAdapter-PQMRR2PK.js} +24 -24
- package/{chromeCommands-VOIRNJBL.js → chromeCommands-FZYAU75D.js} +1 -1
- package/{chromeOpsCommands-M7DPCX2T.js → chromeOpsCommands-62P2Q2YB.js} +31 -1
- package/{chunk-C3FZR5EC.js → chunk-2F7RJC6L.js} +1 -1
- package/{chunk-HQUORJTM.js → chunk-3BMYXEUW.js} +1 -1
- package/{chunk-3QPYFHAH.js → chunk-3DII57IT.js} +1 -1
- package/{chunk-NTW5GWDM.js → chunk-3VNWWVKB.js} +2 -0
- package/{chunk-DWUCB2A3.js → chunk-42V6BK2E.js} +1 -1
- package/{chunk-XRMBP7IW.js → chunk-45C5ER5U.js} +10 -10
- package/{chunk-DSRXPQWA.js → chunk-4OEFYTWL.js} +43 -43
- package/{chunk-6RUOYAPM.js → chunk-4S5QUMJP.js} +7 -7
- package/{chunk-GBPZKFYK.js → chunk-53HEEOTT.js} +4 -4
- package/{chunk-5Q5LYRJH.js → chunk-5FBTLSFG.js} +155 -795
- package/{chunk-KIS76A2P.js → chunk-5H7KJX7J.js} +38 -4
- package/{chunk-5XTOKQLW.js → chunk-5UTFL4QJ.js} +6 -2
- package/chunk-5ZUL4CUO.js +10 -0
- package/{chunk-E6RGHPDR.js → chunk-6D6VBVEW.js} +4 -6
- package/{chunk-KVDUCO4Q.js → chunk-6IG4XSS6.js} +16 -12
- package/{chunk-CMH2SYHX.js → chunk-6OZ36FXI.js} +2 -2
- package/{chunk-5BVAAVIF.js → chunk-6Q33GUCC.js} +1 -1
- package/{chunk-EWRS6HJ3.js → chunk-6VFARHZW.js} +625 -303
- package/{chunk-BYEJ7K2Z.js → chunk-7S4YWN7P.js} +1 -1
- package/{chunk-SREASRV5.js → chunk-ABQYVJBJ.js} +1 -1
- package/chunk-ACTMNVHM.js +93 -0
- package/{chunk-NRALD3CC.js → chunk-AEOE4Z6Q.js} +54 -10
- package/{chunk-XWNRAIUL.js → chunk-AFUORTY4.js} +6 -16
- package/chunk-BNGW5ASC.js +344 -0
- package/{chunk-SZLVDREM.js → chunk-BP4XNZRM.js} +3 -3
- package/{chunk-JZYXSXMZ.js → chunk-BTI7PJDX.js} +15 -15
- package/{chunk-2KDR4CWE.js → chunk-BYMV6QZG.js} +24 -1
- package/{chunk-GCJ3IS5M.js → chunk-DHDMC6FO.js} +175 -6
- package/{chunk-E36HZARC.js → chunk-DNCEALKX.js} +93 -17
- package/{chunk-N5KGQ5AD.js → chunk-DRGSDQBL.js} +3 -3
- package/{chunk-D6XYLSOS.js → chunk-ETI2NYVF.js} +1 -1
- package/{chunk-EXMHJN7C.js → chunk-EYAQT56M.js} +4 -3
- package/{chunk-CJCJF5XB.js → chunk-FDTR4QJ6.js} +4 -2
- package/{chunk-JPVNC5B2.js → chunk-G2O6V3HJ.js} +3 -3
- package/{chunk-WL2RKIBF.js → chunk-GEPUP7OO.js} +1 -1
- package/{chunk-PYXL2CJL.js → chunk-GPCZ7UXG.js} +1 -1
- package/{chunk-K7AG465Q.js → chunk-GQBOR3G6.js} +4 -2
- package/{chunk-YFADVSZE.js → chunk-H62HCIUP.js} +6 -6
- package/{chunk-PZM3EENV.js → chunk-HJUYAD4A.js} +1 -1
- package/{chunk-3JQ2NRYU.js → chunk-HVURBGF3.js} +4 -4
- package/{chunk-HH65VA5U.js → chunk-I3TQJXQ7.js} +109 -6
- package/{chunk-ZVN6I33J.js → chunk-IIVGDG4I.js} +6 -5
- package/{chunk-UDQWGU7F.js → chunk-J4MOO56S.js} +1 -1
- package/{chunk-KC5FAHVS.js → chunk-JEDZAO7L.js} +1 -1
- package/{chunk-6XIE5ZGI.js → chunk-JPGCXHNM.js} +1 -1
- package/chunk-JRQFUXY7.js +1625 -0
- package/chunk-KQ4ONNQD.js +677 -0
- package/{chunk-CPSZJBLK.js → chunk-L5UXH3B2.js} +105 -26
- package/{chunk-RXX4GDIH.js → chunk-LS2ZANRJ.js} +1 -1
- package/{chunk-BJIRLHJR.js → chunk-M2EJHDJP.js} +4 -0
- package/{chunk-EVBFYPDC.js → chunk-MC4XLIJ7.js} +6 -2
- package/{chunk-DUJWWUGV.js → chunk-NA35QHCF.js} +1 -1
- package/{chunk-FNGAF7C4.js → chunk-OEVAY4J6.js} +137 -12
- package/{chunk-UJ63UXGE.js → chunk-OIVSQH2O.js} +1006 -801
- package/{chunk-LZIMZZYT.js → chunk-ORYWEJO4.js} +13 -15
- package/{chunk-LKSDMMY2.js → chunk-Q2XN3EOZ.js} +40 -30
- package/{chunk-AETZ7AD6.js → chunk-Q554LLSI.js} +1 -1
- package/{chunk-FMODTASJ.js → chunk-Q5FJJ6XI.js} +1 -7
- package/{chunk-AJHEFRGJ.js → chunk-Q67DOFOO.js} +214 -5
- package/{chunk-UZ6XXCVR.js → chunk-QDSINZM3.js} +15 -2
- package/{chunk-BHXK3KPV.js → chunk-QVKRR2SS.js} +2314 -66
- package/{chunk-BNQK6UPC.js → chunk-RFCKMYDK.js} +11 -173
- package/{chunk-YWG6EMH3.js → chunk-RG6JBBX5.js} +10 -6
- package/{chunk-QCZX4FTW.js → chunk-SH43IESU.js} +173 -15
- package/{chunk-YIR5OYHU.js → chunk-SSDAAEC2.js} +1235 -59
- package/{chunk-SPAQ4PVV.js → chunk-SV5IJK6K.js} +1 -1
- package/{chunk-BJCWNHVU.js → chunk-TOP2VXOR.js} +2 -2
- package/{chunk-4EJ5QYB5.js → chunk-UKZDAFYT.js} +1 -1
- package/{chunk-PGSKWZCB.js → chunk-UZGQNTVW.js} +1 -1
- package/{chunk-ZZCJUXUI.js → chunk-V4MJDUSR.js} +2 -2
- package/{chunk-JYYZCK2Z.js → chunk-V7E4PXQD.js} +1 -1
- package/{chunk-OZX2IPKM.js → chunk-VLTIYV3X.js} +1 -1
- package/{chunk-NHRQCXIQ.js → chunk-VMFTFOWF.js} +13 -3
- package/{chunk-5J7W2VWW.js → chunk-WV42OMV7.js} +6 -265
- package/{chunk-PFDKB7IZ.js → chunk-X6DN5HBD.js} +6 -6
- package/{chunk-Q7TA25PG.js → chunk-YFE4A4O7.js} +731 -90
- package/{chunk-BOYUESO7.js → chunk-Z77CRGTW.js} +1 -1
- package/{chunk-QC5LGHYP.js → chunk-ZCYXJSTU.js} +10 -5
- package/{contentThunks-A2ZG3SW6.js → contentThunks-GJV22WVZ.js} +25 -25
- package/{cooldownCommands-BSCH2W7P.js → cooldownCommands-REAWYVTY.js} +2 -2
- package/{createAgentAutomationAction-QFQQPG35.js → createAgentAutomationAction-6V25TZEO.js} +25 -25
- package/{createDialogAction-WI73R5EQ.js → createDialogAction-SX36BGSX.js} +28 -28
- package/{createPageAction-XN237WPJ.js → createPageAction-IR4BGJSI.js} +26 -26
- package/{dbSlice-GKGGFNOB.js → dbSlice-XVWBAGYN.js} +8 -8
- package/{deleteFile-LWSR674W.js → deleteFile-YG6QMJLU.js} +3 -3
- package/{dialogCommands-SFRDEMB3.js → dialogCommands-5J56DFWN.js} +35 -32
- package/{dialogSlice-56G4Q4RU.js → dialogSlice-UNX2FAPZ.js} +24 -24
- package/{docCreateCommands-OMQLZ3OW.js → docCreateCommands-KYI2DC2U.js} +32 -31
- package/{docDeleteCommands-7RCC6P23.js → docDeleteCommands-67REUSRY.js} +33 -32
- package/{docReadCommands-5FABO4UV.js → docReadCommands-HOSVSBDJ.js} +32 -31
- package/{docStore-PZSZWXX3.js → docStore-JWVG5NDO.js} +9 -9
- package/{docUpdateCommands-P5AQI6HB.js → docUpdateCommands-EMGCSMXY.js} +32 -31
- package/{fetchMessages-DRABNDPZ.js → fetchMessages-EIU7UFFK.js} +3 -4
- package/{getPricing-HRMSOF3E.js → getPricing-LUSEABA6.js} +4 -4
- package/{handleSendMessageAction-MHKC4R3Q.js → handleSendMessageAction-B75UOJKF.js} +24 -24
- package/index.js +99 -86
- package/{localDialogRead-PUQKFI73.js → localDialogRead-BTFJ4V2I.js} +2 -2
- package/{localRuntimeDb-P37ZTX55.js → localRuntimeDb-SYQGUF4U.js} +1 -1
- package/{machineCommands-VJABZGD2.js → machineCommands-GFPTOY6L.js} +64 -61
- package/{machineWsRunDispatch-5SPILS2O.js → machineWsRunDispatch-46PSZ3DJ.js} +62 -59
- package/{memberThunks-KATHH3F4.js → memberThunks-QGFLFVCI.js} +9 -9
- package/{models-GS72DVJS.js → models-T3SG6MJ5.js} +2 -2
- package/{offlineMarxistsAgentCommand-GEH6SNNA.js → offlineMarxistsAgentCommand-HGXZV4XJ.js} +1 -1
- package/package.json +1 -1
- package/providerPresetApply-FG6NZ57W.js +214 -0
- package/providerRegistry-757OWH3O.js +31 -0
- package/{read-LC6HVYBN.js → read-COE3ZYR6.js} +5 -4
- package/{readDocTool-N3ERJHHF.js → readDocTool-5USN4A6V.js} +1 -1
- package/{readlineWorkspace-GMYIPMRU.js → readlineWorkspace-UFSWHFKD.js} +144 -109
- package/{removeDialogAgentAction-F5GPTALR.js → removeDialogAgentAction-IX3MN2ZO.js} +11 -11
- package/{runAgentClientLoop-U3GEPCQI.js → runAgentClientLoop-25LJ4XGV.js} +47 -47
- package/{runtimeDoctorCommands-CROTMULY.js → runtimeDoctorCommands-X6WDBEQX.js} +2 -2
- package/{setDialogExtraReferencesAction-AY4ZCF3A.js → setDialogExtraReferencesAction-X4HCPNZL.js} +9 -9
- package/{setPrimaryDialogAgentAction-HPMG7V3R.js → setPrimaryDialogAgentAction-4GMIQLOD.js} +11 -11
- package/{settingSlice-OEJA4NQO.js → settingSlice-ZQZVUPKK.js} +10 -10
- package/{spaceCommands-FNXBNF5X.js → spaceCommands-NKJVJCQQ.js} +30 -29
- package/{streamAgentChatTurn-DAGDJH3L.js → streamAgentChatTurn-A46QFV4O.js} +59 -58
- package/{switchDialogAgentAction-HMDZTZ4I.js → switchDialogAgentAction-N52LRPA3.js} +8 -8
- package/{tableCommands-SUNTHAYX.js → tableCommands-O6NWHFKV.js} +1 -1
- package/{toolApiClient-VGYUB4P5.js → toolApiClient-QVJ6HDNN.js} +2 -2
- package/{tools-73VPBNX3.js → tools-TTDGRNY6.js} +43 -43
- package/tuiSummaryLlmCaller-WFRWERGK.js +127 -0
- package/{updateCommands-Y363MC3L.js → updateCommands-2M74UL7P.js} +2 -2
- package/{updateDialogTitleAction-RFQONESQ.js → updateDialogTitleAction-QJPZGF52.js} +45 -28
- package/agentRecordCommands-DAZ2FDZP.js +0 -125
- package/chunk-I42VC5KR.js +0 -15
- package/chunk-NB5SIWC4.js +0 -611
- package/chunk-NG4UT4K4.js +0 -79
- package/codingSkills-7S6523WH.js +0 -48
- package/tuiSummaryLlmCaller-3Z24VUWM.js +0 -116
- package/{chunk-3RAG2NAD.js → chunk-UKWGR5SS.js} +3 -3
- package/{db-VQSAOWAO.js → db-WK5MDZVN.js} +1 -1
- package/{localRuntimeAuthority-R5UBODT3.js → localRuntimeAuthority-6IR6BBXE.js} +3 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getModelConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OIVSQH2O.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlatformHostedDeepseekModel,
|
|
6
6
|
isPlatformHostedOpenAIImageModel,
|
|
7
7
|
resolvePlatformHostedRouting
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-Q67DOFOO.js";
|
|
9
9
|
import {
|
|
10
10
|
asTrimmedLowercaseString
|
|
11
11
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -25,6 +25,8 @@ var PLATFORM_CHAT_COMPLETIONS_ENDPOINTS = {
|
|
|
25
25
|
qwen: "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions",
|
|
26
26
|
// Moonshot AI(月之暗面)开放平台 OpenAI 兼容模式(按量计费)
|
|
27
27
|
moonshot: "https://api.moonshot.cn/v1/chat/completions",
|
|
28
|
+
// 阶跃星辰(StepFun)开放平台 OpenAI 兼容模式
|
|
29
|
+
stepfun: "https://api.stepfun.com/v1/chat/completions",
|
|
28
30
|
// 平台托管 GLM 5.3 Flash 的实际上游(RunInfra 独家廉价快档)
|
|
29
31
|
runinfra: "https://api.runinfra.ai/v1/chat/completions"
|
|
30
32
|
// 无 nolo 默认上游:平台托管模型全部显式分流,未识别模型返回 undefined
|
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
fileKey,
|
|
3
3
|
getFileIdFromKey,
|
|
4
4
|
ulid
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-VMFTFOWF.js";
|
|
6
6
|
import {
|
|
7
7
|
loadFileFromIndexedDb,
|
|
8
8
|
removeAction,
|
|
9
9
|
saveFileToIndexedDb
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ABQYVJBJ.js";
|
|
11
11
|
import {
|
|
12
12
|
readAction,
|
|
13
13
|
readRequestManager,
|
|
14
14
|
resolveAgentReadServers
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WV42OMV7.js";
|
|
16
16
|
import {
|
|
17
17
|
asyncThunkCreator,
|
|
18
18
|
buildCreateSlice,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
shouldReplaceLocalWithRemoteRecord,
|
|
33
33
|
shouldReplicateLocalRecord,
|
|
34
34
|
uploadToCurrentServer
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-UKWGR5SS.js";
|
|
36
36
|
import {
|
|
37
37
|
fetchFromClientDb,
|
|
38
38
|
fetchFromServer,
|
|
@@ -712,7 +712,7 @@ var dbSlice = createSliceWithThunks({
|
|
|
712
712
|
// 动态 import 在调用期解析,避开 TDZ/求值顺序问题(同下方 share)。
|
|
713
713
|
read: create.asyncThunk(
|
|
714
714
|
async (payload, thunkApi) => {
|
|
715
|
-
const { readAction: readAction2 } = await import("./read-
|
|
715
|
+
const { readAction: readAction2 } = await import("./read-COE3ZYR6.js");
|
|
716
716
|
return readAction2(payload, thunkApi);
|
|
717
717
|
},
|
|
718
718
|
{
|
|
@@ -786,7 +786,7 @@ var dbSlice = createSliceWithThunks({
|
|
|
786
786
|
// 这里改成动态 import,运行期才解析,彻底断开这条边。
|
|
787
787
|
share: create.asyncThunk(
|
|
788
788
|
async (config, thunkApi) => {
|
|
789
|
-
const { shareResourceAction } = await import("./action-
|
|
789
|
+
const { shareResourceAction } = await import("./action-YVYQEAAV.js");
|
|
790
790
|
return shareResourceAction(config, thunkApi);
|
|
791
791
|
}
|
|
792
792
|
),
|
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
} from "./chunk-ONXOABJR.js";
|
|
6
6
|
import {
|
|
7
7
|
asNonEmptyStringArray
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-VMFTFOWF.js";
|
|
9
|
+
import {
|
|
10
|
+
isRecord
|
|
11
|
+
} from "./chunk-KUG52IAP.js";
|
|
9
12
|
import {
|
|
10
13
|
asTrimmedString
|
|
11
14
|
} from "./chunk-3EUW3WEO.js";
|
|
12
15
|
import {
|
|
13
16
|
asOptionalPositiveFiniteNumber
|
|
14
17
|
} from "./chunk-U6VC4MU4.js";
|
|
15
|
-
import {
|
|
16
|
-
isRecord
|
|
17
|
-
} from "./chunk-KUG52IAP.js";
|
|
18
18
|
|
|
19
19
|
// packages/agent-runtime/fileCredentialBroker.ts
|
|
20
20
|
import {
|
|
@@ -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",
|
|
@@ -405,6 +459,8 @@ function createRunActivityTracker(runId, deps = {}, options = {}) {
|
|
|
405
459
|
const fs = deps.fs ?? nodeFs;
|
|
406
460
|
const now = deps.now ?? (() => /* @__PURE__ */ new Date());
|
|
407
461
|
const minWriteIntervalMs = options.minWriteIntervalMs ?? DEFAULT_ACTIVITY_WRITE_INTERVAL_MS;
|
|
462
|
+
const keepAlive = options.keepAlive ?? true;
|
|
463
|
+
let disposed = false;
|
|
408
464
|
let lastEventAt = now().toISOString();
|
|
409
465
|
let inFlight = null;
|
|
410
466
|
const counters = { llmCalls: 0, toolCalls: 0, fileEdits: 0 };
|
|
@@ -425,7 +481,9 @@ function createRunActivityTracker(runId, deps = {}, options = {}) {
|
|
|
425
481
|
};
|
|
426
482
|
}
|
|
427
483
|
function doWrite() {
|
|
484
|
+
if (disposed) return;
|
|
428
485
|
writeTimer = void 0;
|
|
486
|
+
const attemptAt = now().getTime();
|
|
429
487
|
withRunRecordLock(
|
|
430
488
|
runId,
|
|
431
489
|
deps,
|
|
@@ -438,7 +496,10 @@ function createRunActivityTracker(runId, deps = {}, options = {}) {
|
|
|
438
496
|
},
|
|
439
497
|
{ strict: true }
|
|
440
498
|
);
|
|
499
|
+
if (lastWriteAt < attemptAt) lastWriteAt = attemptAt;
|
|
500
|
+
if (keepAlive) scheduleWrite();
|
|
441
501
|
}
|
|
502
|
+
scheduleWrite();
|
|
442
503
|
function scheduleWrite() {
|
|
443
504
|
if (writeTimer !== void 0) return;
|
|
444
505
|
const elapsed = now().getTime() - lastWriteAt;
|
|
@@ -446,6 +507,7 @@ function createRunActivityTracker(runId, deps = {}, options = {}) {
|
|
|
446
507
|
writeTimer = setTimeout(doWrite, delay);
|
|
447
508
|
}
|
|
448
509
|
function onLoopEvent(event) {
|
|
510
|
+
if (disposed) return;
|
|
449
511
|
lastEventAt = new Date(event.atMs).toISOString();
|
|
450
512
|
switch (event.kind) {
|
|
451
513
|
case "llm-start":
|
|
@@ -480,6 +542,7 @@ function createRunActivityTracker(runId, deps = {}, options = {}) {
|
|
|
480
542
|
doWrite();
|
|
481
543
|
}
|
|
482
544
|
function dispose() {
|
|
545
|
+
disposed = true;
|
|
483
546
|
if (writeTimer !== void 0) {
|
|
484
547
|
clearTimeout(writeTimer);
|
|
485
548
|
writeTimer = void 0;
|
|
@@ -785,6 +848,7 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
|
|
|
785
848
|
logPath,
|
|
786
849
|
queuePath,
|
|
787
850
|
batchId,
|
|
851
|
+
...typeof input.credentialGroup === "string" && input.credentialGroup.trim() ? { credentialGroup: input.credentialGroup.trim() } : {},
|
|
788
852
|
...typeof input.parentDialogId === "string" && input.parentDialogId.trim() ? { parentDialogId: input.parentDialogId.trim() } : {},
|
|
789
853
|
...dodCommands && dodCommands.length > 0 ? { dodCommands } : {},
|
|
790
854
|
...spawnHead ? { spawnHead } : {},
|
|
@@ -817,10 +881,13 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
|
|
|
817
881
|
});
|
|
818
882
|
proc.unref();
|
|
819
883
|
if (typeof proc.pid === "number") {
|
|
820
|
-
record.pid = proc.pid;
|
|
821
884
|
const processStartedAt = (deps.getProcessStartTime ?? defaultGetProcessStartTime)(proc.pid);
|
|
822
|
-
|
|
823
|
-
|
|
885
|
+
withRunRecordLock(runId, deps, () => {
|
|
886
|
+
const latest = readRunRecord(runId, deps) ?? record;
|
|
887
|
+
latest.pid = proc.pid;
|
|
888
|
+
if (processStartedAt) latest.processStartedAt = processStartedAt.toISOString();
|
|
889
|
+
writeRunRecord(latest, deps);
|
|
890
|
+
});
|
|
824
891
|
}
|
|
825
892
|
return { runId, pid: proc.pid, logPath, queuePath, batchId };
|
|
826
893
|
}
|
|
@@ -913,6 +980,15 @@ function transitionRunToTerminal(runId, update, deps = {}, options = {}) {
|
|
|
913
980
|
} else if (update.status === "killed") {
|
|
914
981
|
record2.failureReason = "cancelled";
|
|
915
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
|
+
}
|
|
916
992
|
const resolvedToolCount = typeof update.toolCallCount === "number" ? update.toolCallCount : record2.activity?.counters?.toolCalls;
|
|
917
993
|
if (typeof resolvedToolCount === "number") {
|
|
918
994
|
record2.toolCallCount = resolvedToolCount;
|
|
@@ -1032,6 +1108,15 @@ function checkStaleRun(runId, deps = {}) {
|
|
|
1032
1108
|
const at = now().toISOString();
|
|
1033
1109
|
latest.status = "orphaned";
|
|
1034
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
|
+
}
|
|
1035
1120
|
latest.endedAt = at;
|
|
1036
1121
|
latest.reconciledAt = at;
|
|
1037
1122
|
latest.pid = void 0;
|
|
@@ -1247,6 +1332,18 @@ function printStatusOnce(record, deps) {
|
|
|
1247
1332
|
}
|
|
1248
1333
|
if (record.note) deps.output.write(`note: ${record.note}
|
|
1249
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
|
+
}
|
|
1250
1347
|
const activitySummary = formatActivitySummary(record.activity);
|
|
1251
1348
|
if (activitySummary) deps.output.write(`${activitySummary}
|
|
1252
1349
|
`);
|
|
@@ -1376,14 +1473,20 @@ async function terminateRunProcess(record, initialSignal, deps) {
|
|
|
1376
1473
|
signalGroup(initialSignal);
|
|
1377
1474
|
if (initialSignal === "SIGTERM") {
|
|
1378
1475
|
const deadline = nowMs() + TERMINATE_GRACE_MS;
|
|
1379
|
-
|
|
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;
|
|
1380
1480
|
await sleep(TERMINATE_POLL_MS);
|
|
1381
1481
|
}
|
|
1382
1482
|
}
|
|
1383
1483
|
if (!isPidGone(pid, deps)) {
|
|
1384
1484
|
signalGroup("SIGKILL");
|
|
1385
1485
|
const killDeadline = nowMs() + TERMINATE_KILL_GRACE_MS;
|
|
1386
|
-
|
|
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;
|
|
1387
1490
|
await sleep(TERMINATE_POLL_MS);
|
|
1388
1491
|
}
|
|
1389
1492
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
asRecordOrEmpty
|
|
3
3
|
} from "./chunk-KX6YBIHG.js";
|
|
4
|
-
import {
|
|
5
|
-
asOptionalFiniteNumber
|
|
6
|
-
} from "./chunk-WWC7I6TA.js";
|
|
7
4
|
import {
|
|
8
5
|
asNonEmptyStringArray,
|
|
9
6
|
asTrimmedNonEmptyStringArray
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VMFTFOWF.js";
|
|
8
|
+
import {
|
|
9
|
+
asOptionalFiniteNumber
|
|
10
|
+
} from "./chunk-WWC7I6TA.js";
|
|
11
11
|
import {
|
|
12
12
|
isOwnedAgentKey,
|
|
13
13
|
ownedAgentKey,
|
|
14
14
|
publicAgentKey
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-M2EJHDJP.js";
|
|
16
16
|
import {
|
|
17
17
|
isRecord
|
|
18
18
|
} from "./chunk-KUG52IAP.js";
|
|
@@ -25,6 +25,7 @@ var DEFAULT_PRIVATE_NOLO_WORKSPACE_TOOLS = [
|
|
|
25
25
|
"listDialogs",
|
|
26
26
|
"readDialog",
|
|
27
27
|
"queryDialogsBySubjectRef",
|
|
28
|
+
"deleteDialogs",
|
|
28
29
|
"listAgents",
|
|
29
30
|
"readAgent",
|
|
30
31
|
"listSpaces",
|
|
@@ -199,7 +199,7 @@ async function readDocFunc(args, thunkApi) {
|
|
|
199
199
|
throw new Error(`\u65E0\u6548\u7684\u9875\u9762 ID: ${id}\u3002\u9875\u9762 ID \u901A\u5E38\u4EE5 "page-" \u5F00\u5934\u3002`);
|
|
200
200
|
}
|
|
201
201
|
try {
|
|
202
|
-
const { readAction } = await import("./read-
|
|
202
|
+
const { readAction } = await import("./read-COE3ZYR6.js");
|
|
203
203
|
const pageData = await readAction({ dbKey: id }, thunkApi);
|
|
204
204
|
if (!pageData) {
|
|
205
205
|
throw new Error(`\u672A\u627E\u5230 ID \u4E3A ${id} \u7684\u9875\u9762\u3002`);
|