nolo-cli 0.251.0-alpha.1 → 0.252.0-alpha.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/{_executeModel-55PHWQWB.js → _executeModel-D6G3B45S.js} +44 -44
- package/{action-WZTKEF5H.js → action-QQOQ2LP3.js} +3 -3
- package/{addContentAction-LBVAQUF7.js → addContentAction-MB22YIDV.js} +6 -6
- package/{addDialogAgentAction-6WAUSUSZ.js → addDialogAgentAction-KNTBVVGY.js} +5 -5
- package/{agentDeleteCommand-KEO3KDK3.js → agentDeleteCommand-YCWDGJSF.js} +66 -65
- package/{agentEmailCommands-RWJQQRNT.js → agentEmailCommands-DTWD5FWC.js} +66 -65
- package/{agentListCommands-L3TLPLNH.js → agentListCommands-JTOONLYL.js} +224 -37
- package/{agentMachineCommands-EZWWXWDH.js → agentMachineCommands-25X7OTLQ.js} +29 -27
- package/{agentProviderCommands-C5T7C5KZ.js → agentProviderCommands-QLTABYR7.js} +2 -2
- package/{agentRecordCommands-7W2CGHJJ.js → agentRecordCommands-SXE3WV2X.js} +65 -64
- package/{agentRunCommand-POL6B6BO.js → agentRunCommand-QSIED54S.js} +65 -64
- package/{agentRunControl-FKSXBUAF.js → agentRunControl-KNNDEEDI.js} +8 -6
- package/{agentRuntimeLocal-WSHWNIMF.js → agentRuntimeLocal-HVJJMB4W.js} +24 -23
- package/{agentSlice-3G2YLTA4.js → agentSlice-NBUJJVRI.js} +6 -6
- package/{appDeleteCommands-DZZQCVYH.js → appDeleteCommands-YU6TT6VN.js} +31 -29
- package/{appDeployCommands-NJJBVNH5.js → appDeployCommands-4DEIX7YP.js} +31 -29
- package/{appDeployStatusCommands-GBOAFEYG.js → appDeployStatusCommands-3VKS6GBQ.js} +31 -29
- package/{appGetCommands-GOOKYMKO.js → appGetCommands-22FNNROT.js} +31 -29
- package/{appListCommands-OBCGUG3S.js → appListCommands-FVGMLHVU.js} +31 -29
- package/{authCommand-77CRN332.js → authCommand-5DC3ES4Q.js} +12 -12
- package/{chromeOpsCommands-6RLEBBJJ.js → chromeOpsCommands-AA555ANS.js} +1 -1
- package/{chunk-MAA42MMV.js → chunk-2FZVXOFX.js} +4 -4
- package/chunk-2GAUJDA5.js +594 -0
- package/{chunk-ESN4WNWU.js → chunk-2JHGUL5K.js} +2 -2
- package/{chunk-222CJNC2.js → chunk-2LANL4B5.js} +3 -3
- package/{chunk-PKMDYRAM.js → chunk-2PB653F5.js} +171 -237
- package/{chunk-GMWZRXRM.js → chunk-3272HU62.js} +1 -1
- package/{chunk-3ZWJVKFB.js → chunk-3N3JPQBQ.js} +82 -38
- package/{chunk-LXKK7QFI.js → chunk-4HAOOY6G.js} +53 -23
- package/{chunk-ZQ6K57FJ.js → chunk-4YPH5KRA.js} +1 -1
- package/{chunk-T4V6C3J3.js → chunk-52M4RYVP.js} +1 -1
- package/{chunk-6UNJ6JGR.js → chunk-5IN2NBDX.js} +4 -4
- package/{chunk-OQCAHPDQ.js → chunk-5QEOTC35.js} +4 -4
- package/{chunk-R7D5SRAZ.js → chunk-5UYDG6HP.js} +17 -0
- package/{chunk-Z7A2ZQ5X.js → chunk-64ACTEAE.js} +1 -1
- package/{chunk-CTWCZKNS.js → chunk-6SOWMEAY.js} +4 -4
- package/{chunk-UCMUXZJV.js → chunk-7XO73H5X.js} +111 -1
- package/{chunk-N3SEV3CG.js → chunk-7ZOVFB2H.js} +79 -30
- package/{chunk-UR4ZMRV3.js → chunk-A5F6DYP2.js} +1 -1
- package/{chunk-FAFDIQJG.js → chunk-A6VIMCWI.js} +3 -3
- package/{chunk-SX6AWTNK.js → chunk-BZLGPM5B.js} +3 -3
- package/{chunk-LTVEOOZL.js → chunk-CIAV4WK2.js} +14 -1
- package/{chunk-IFJ6OTI6.js → chunk-CO2NXG2J.js} +32 -10
- package/{chunk-D3E5MYXO.js → chunk-CYGFNMCH.js} +1 -1
- package/{chunk-MZVCFV3T.js → chunk-D3WOFN6N.js} +3 -3
- package/{chunk-VUHKG4KS.js → chunk-DNNPARJK.js} +9 -5
- package/{chunk-PLS2MJVW.js → chunk-DU3DJYVA.js} +4 -4
- package/{chunk-MTS5DCL2.js → chunk-EG3JTV7H.js} +2 -2
- package/{chunk-6ASGEP5D.js → chunk-EJQE5HB7.js} +1 -1
- package/{chunk-CD64YXRB.js → chunk-F6Q64KRV.js} +1 -1
- package/{chunk-L5HV76QT.js → chunk-FRC2DNTN.js} +1 -1
- package/{chunk-W3HSD32M.js → chunk-FXEPZKNJ.js} +2 -2
- package/{chunk-D35TOEMM.js → chunk-FZI2P64R.js} +137 -53
- package/{chunk-WWTSEBDF.js → chunk-GIXWVN2W.js} +1 -1
- package/{chunk-CUYFRVJF.js → chunk-GO7UC5VH.js} +5 -5
- package/{chunk-KZVRPCOR.js → chunk-GVH2IP2M.js} +4 -4
- package/{chunk-KGOBJAWC.js → chunk-GWS2X7TX.js} +206 -93
- package/{chunk-KHVTT4WW.js → chunk-HF4C5WIU.js} +81 -542
- package/{chunk-Q5KZ6F55.js → chunk-HMREADP6.js} +19 -17
- package/{chunk-X337N4D6.js → chunk-ITCOQAHS.js} +3 -3
- package/{chunk-BQ4CZEVZ.js → chunk-ITMBFT35.js} +1 -1
- package/chunk-IVK2KT3H.js +209 -0
- package/{chunk-IXAGRTAR.js → chunk-JAYPSNGR.js} +1 -1
- package/{chunk-LOXR4TQN.js → chunk-JF5QT3YY.js} +2 -2
- package/{chunk-QLGL43SI.js → chunk-JKALGWDL.js} +2 -2
- package/{chunk-PQ63BDV3.js → chunk-JPXACKSW.js} +9 -1
- package/{chunk-HS7MLR74.js → chunk-KZ4A7EIV.js} +3 -5
- package/{chunk-3KWJPTVP.js → chunk-LAQC5FAP.js} +4 -4
- package/{chunk-NTNX77FI.js → chunk-LNIA5JVX.js} +6 -6
- package/{chunk-QJTZ76CP.js → chunk-LS5KAVFQ.js} +1 -0
- package/{chunk-K26XPZRB.js → chunk-LVZVSLKO.js} +29 -9
- package/{chunk-ZSRR6HCH.js → chunk-N2ZAY2DK.js} +1 -1
- package/{chunk-MTM4LRVG.js → chunk-NNUIVAC2.js} +1 -1
- package/{chunk-HD5EKSLF.js → chunk-NPUHKEOB.js} +2 -2
- package/{chunk-OARYOLF3.js → chunk-O6LPLIRS.js} +11 -11
- package/{chunk-HQLCYPL4.js → chunk-OB4FBZXJ.js} +4 -4
- package/{chunk-CD2DK5JA.js → chunk-OKH74FML.js} +2 -1
- package/{chunk-IZWGO2ZS.js → chunk-OMIXG25B.js} +1 -1
- package/{chunk-CJ2BP6V7.js → chunk-OOV5JN25.js} +2 -2
- package/{chunk-AS6L5KSD.js → chunk-P4R5KXU7.js} +2 -2
- package/{chunk-K5CIMK3R.js → chunk-P6HMEKLL.js} +114 -56
- package/{chunk-VTHWBTRE.js → chunk-PENRYZ4D.js} +1 -1
- package/{chunk-WZPG63Q4.js → chunk-PIVTQRX6.js} +43 -13
- package/{chunk-KJDN2YRH.js → chunk-QMKWSKWA.js} +4 -4
- package/{chunk-XC5RPSXK.js → chunk-QV32GSVO.js} +2 -2
- package/{chunk-XJSEST7D.js → chunk-SMCKJJXI.js} +2 -2
- package/{chunk-KRAPKTAS.js → chunk-SMZFWEMX.js} +1 -1
- package/{chunk-43VT5PLM.js → chunk-T4VVQHSE.js} +1 -1
- package/{chunk-W2N4OAKM.js → chunk-TDI7ARZO.js} +3 -3
- package/{chunk-TGKAUEV3.js → chunk-TDLZA6LJ.js} +13 -10
- package/{chunk-LMMRWGGJ.js → chunk-TTUIM3PJ.js} +2 -2
- package/{chunk-5IKKSJYX.js → chunk-TTWNTFTO.js} +35 -2
- package/{chunk-ZM5AZTQG.js → chunk-U7BP25PE.js} +18 -6
- package/{chunk-X3OZ655T.js → chunk-UI3Z3HDK.js} +1 -1
- package/{chunk-GX6DITLQ.js → chunk-UUCYUN6Y.js} +1 -1
- package/{chunk-U2OWDHDE.js → chunk-VH7AQEEF.js} +2 -2
- package/{chunk-ZKKJZBNO.js → chunk-WAOHK3NJ.js} +9 -9
- package/{chunk-2FK2KZSL.js → chunk-WLHUANWZ.js} +1 -1
- package/{chunk-JUYI2D7J.js → chunk-WNIBQBOR.js} +1 -1
- package/{chunk-SLUZ6FBJ.js → chunk-XBCADGK2.js} +1 -1
- package/{chunk-6XVPMGXK.js → chunk-YB5D2GK4.js} +9 -3
- package/{chunk-QJ5YDTEF.js → chunk-YQYYYATY.js} +42 -24
- package/{chunk-WQDTSK5U.js → chunk-ZMFA2TLE.js} +1 -1
- package/{chunk-CFDOIIOZ.js → chunk-ZMXO5G3E.js} +29 -23
- package/{chunk-A55E2OCP.js → chunk-ZNOXY73P.js} +632 -124
- package/{cliAgentConfigHelpers-N6LTB7UY.js → cliAgentConfigHelpers-FKBPFPKR.js} +6 -6
- package/{cliLocalAgentRecordReader-NFNGYOOW.js → cliLocalAgentRecordReader-DWU3LBO2.js} +28 -27
- package/{commandRegistry-OM5DU4DS.js → commandRegistry-7FVATZS2.js} +70 -70
- package/{contentThunks-7URM43ET.js → contentThunks-25XCB7VY.js} +18 -18
- package/{cooldownCommands-JEEV75B7.js → cooldownCommands-PT5L4LNB.js} +3 -3
- package/{createAgentAutomationAction-GGEXIKMC.js → createAgentAutomationAction-FC5RI2LW.js} +18 -18
- package/{createDialogAction-IXXEMFRQ.js → createDialogAction-IL3ISSQQ.js} +19 -19
- package/{createPageAction-IXIVLIOO.js → createPageAction-RVYBEYZV.js} +19 -19
- package/{db-J5KE7XRI.js → db-JMGVD4TB.js} +2 -1
- package/{dbSlice-IE4ADINL.js → dbSlice-WG3ZG6PZ.js} +5 -5
- package/{deleteFile-ZCQESEEQ.js → deleteFile-4TIG54YN.js} +3 -3
- package/{dialogCommands-RPBHOZB6.js → dialogCommands-VUJISJZF.js} +33 -31
- package/{dialogNotifyCommand-ECKI5MMA.js → dialogNotifyCommand-JKYVSR6K.js} +7 -7
- package/{dialogSlice-5FQB2TNN.js → dialogSlice-UMP55UAW.js} +16 -16
- package/{docCreateCommands-XJ2X57DW.js → docCreateCommands-S46F6GKP.js} +30 -28
- package/{docDeleteCommands-45WGFFEB.js → docDeleteCommands-LJG4NK6J.js} +31 -29
- package/{docReadCommands-LRRVDS46.js → docReadCommands-YPAYGHNM.js} +30 -28
- package/{docStore-SUAVM24F.js → docStore-VK3MVJ5Q.js} +6 -6
- package/{docUpdateCommands-QUYX6BVR.js → docUpdateCommands-MPTM6267.js} +30 -28
- package/{getPricing-FCHYVRJU.js → getPricing-5BLZRPTM.js} +3 -3
- package/{handleSendMessageAction-FDIWBQUB.js → handleSendMessageAction-VPKVNKBU.js} +33 -33
- package/{hostCredentialCreate-CEXQHYT4.js → hostCredentialCreate-K56HWPNY.js} +65 -64
- package/index.js +8 -8
- package/{localDialogRead-USDZXKIL.js → localDialogRead-NXILOV3T.js} +1 -1
- package/{localRuntimeAdapter-O3JBRK6S.js → localRuntimeAdapter-KVU72FWT.js} +64 -63
- package/{machineCommands-I3YA7TNC.js → machineCommands-C3O5RKNJ.js} +65 -64
- package/{machineWsRunDispatch-E5CIE2OJ.js → machineWsRunDispatch-ZLART7ZA.js} +65 -64
- package/{mcpLocalAuthorizeCommand-K5J2VMG6.js → mcpLocalAuthorizeCommand-LO7E4VQ5.js} +6 -6
- package/{memberThunks-T7EAZE6A.js → memberThunks-7DNR6DRD.js} +7 -7
- package/{models-EP7VG6N2.js → models-ZX2BYIMB.js} +2 -2
- package/package.json +1 -1
- package/{projectArchive-A7E65AZO.js → projectArchive-UBJFYRL7.js} +19 -19
- package/{providerPresetApply-4H7YP5D7.js → providerPresetApply-NTJUINI6.js} +35 -16
- package/{providerRegistry-F3UPOTIY.js → providerRegistry-W45SLUV6.js} +5 -5
- package/{read-BRZHXUJ6.js → read-Z2JOK6F6.js} +3 -3
- package/{readDocTool-N7RVFQEE.js → readDocTool-3QYSVWBT.js} +1 -1
- package/{readlineWorkspace-2O65NBFG.js → readlineWorkspace-TSIYF7C6.js} +610 -206
- package/{removeDialogAgentAction-GRT72HLK.js → removeDialogAgentAction-LRKDU4RI.js} +7 -7
- package/{runAgentClientLoop-NWCZIXCG.js → runAgentClientLoop-YAHGOWXN.js} +41 -41
- package/{runtimeDoctorCommands-26HYHFTK.js → runtimeDoctorCommands-QGZSKNSE.js} +5 -5
- package/{secretCommands-XR72SHLK.js → secretCommands-BXAQEOES.js} +2 -2
- package/{setDialogExtraReferencesAction-CBG3X46B.js → setDialogExtraReferencesAction-KIITOCFP.js} +6 -6
- package/{setPrimaryDialogAgentAction-EWTDZOAX.js → setPrimaryDialogAgentAction-Y36PKFFB.js} +7 -7
- package/{settingThunks-X4PT66J2.js → settingThunks-YQNG5L6K.js} +5 -5
- package/{spaceCommands-EVSNTGRS.js → spaceCommands-P644AAZZ.js} +29 -27
- package/{streamAgentChatTurn-SYP3OEM5.js → streamAgentChatTurn-5CSYAUAY.js} +54 -50
- package/{switchDialogAgentAction-YHPZ7K6E.js → switchDialogAgentAction-U2VLPPVO.js} +5 -5
- package/{tools-2AO2SK4L.js → tools-UZ3CDIR2.js} +34 -34
- package/{tuiRestart-HBQDF4AE.js → tuiRestart-GF4DGAAN.js} +7 -7
- package/{tuiSummaryLlmCaller-Q2PNR63K.js → tuiSummaryLlmCaller-HROLGN4F.js} +12 -12
- package/{updateCommands-6SI7NWVC.js → updateCommands-BZ4YDHNM.js} +3 -3
- package/{updateDialogTitleAction-MWVMBIPZ.js → updateDialogTitleAction-53XCCDK2.js} +18 -18
- package/{usageCommand-D44AOTMH.js → usageCommand-XVJ7ZUTM.js} +1 -1
- package/{usageRebuildCommand-IRIMKDI5.js → usageRebuildCommand-NK6S3D4J.js} +2 -2
- package/{windowsSelfUpdate-BJIJKKIS.js → windowsSelfUpdate-4BAXX7C3.js} +2 -2
- package/{workloadLifecycle-ZCSQCHG3.js → workloadLifecycle-DYX5ZMAT.js} +2 -2
- package/chunk-FGHEF6WI.js +0 -34
- package/{chunk-ANUP75N2.js → chunk-2E4BYAUE.js} +0 -0
- package/{chunk-CDIRKCPD.js → chunk-6HL6E7ZD.js} +152 -152
- package/{dialogUsageCommand-TBIA2QAF.js → dialogUsageCommand-IHAXS7DW.js} +3 -3
package/chunk-FGHEF6WI.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolveModelReasoningCapability
|
|
3
|
-
} from "./chunk-CD2DK5JA.js";
|
|
4
|
-
|
|
5
|
-
// packages/ai/agent/defaultReasoningEffort.ts
|
|
6
|
-
var defaults = {
|
|
7
|
-
"gpt-6.2-sol": "medium",
|
|
8
|
-
"gpt-6.2-astra": "high",
|
|
9
|
-
"gpt-6.1-sol": "medium",
|
|
10
|
-
"gpt-6.1-terra": "medium",
|
|
11
|
-
"gpt-6-luna": "medium",
|
|
12
|
-
"gpt-6-astra": "high",
|
|
13
|
-
"claude-opus-5-5": "medium",
|
|
14
|
-
"claude-sonnet-5-5": "high",
|
|
15
|
-
"deepseek-flash": "high",
|
|
16
|
-
"deepseek-v4-flash": "high",
|
|
17
|
-
"deepseek-v4.1-flash": "high"
|
|
18
|
-
};
|
|
19
|
-
var deepseekChannels = /* @__PURE__ */ new Set(["opendesign", "ollama-cloud", "lithosai"]);
|
|
20
|
-
var providers = /* @__PURE__ */ new Set(["nolo", "openai", "openrouter", "anthropic", "deepseek", "commandcode", "opencode-go", "stepfun"]);
|
|
21
|
-
function resolveDefaultReasoningEffort(input) {
|
|
22
|
-
const provider = (input.provider ?? "").toLowerCase();
|
|
23
|
-
const model = (input.model ?? "").toLowerCase().split("/").pop() ?? "";
|
|
24
|
-
const isDeepseekFlash = ["deepseek-flash", "deepseek-v4-flash", "deepseek-v4.1-flash"].includes(model);
|
|
25
|
-
const effort = providers.has(provider) || deepseekChannels.has(provider) && isDeepseekFlash ? defaults[model] : void 0;
|
|
26
|
-
if (!effort) return input.fallback;
|
|
27
|
-
if (provider === "nolo" && model.startsWith("claude-") && input.model?.startsWith("anthropic/")) return effort;
|
|
28
|
-
if (provider === "anthropic" && model.startsWith("claude-")) return effort;
|
|
29
|
-
return resolveModelReasoningCapability(provider, input.model).efforts.includes(effort) ? effort : input.fallback;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export {
|
|
33
|
-
resolveDefaultReasoningEffort
|
|
34
|
-
};
|
|
File without changes
|
|
@@ -6,44 +6,116 @@ import {
|
|
|
6
6
|
asTrimmedNonEmptyStringArray
|
|
7
7
|
} from "./chunk-I42VC5KR.js";
|
|
8
8
|
|
|
9
|
-
// packages/
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
// packages/agent-runtime/secretScrubber.ts
|
|
10
|
+
var SECRET_PATTERNS = [
|
|
11
|
+
// 1. PEM 私钥块(高危硬拦截)
|
|
12
|
+
{
|
|
13
|
+
kind: "PRIVATE_KEY",
|
|
14
|
+
placeholder: "[REDACTED:PRIVATE_KEY]",
|
|
15
|
+
regex: /-----BEGIN (?:[A-Z0-9 ]+)?PRIVATE KEY-----[\s\S]+?-----END (?:[A-Z0-9 ]+)?PRIVATE KEY-----/g
|
|
16
|
+
},
|
|
17
|
+
// 2. Anthropic API Key (sk-ant-...)
|
|
18
|
+
{
|
|
19
|
+
kind: "ANTHROPIC_KEY",
|
|
20
|
+
placeholder: "[REDACTED:ANTHROPIC_KEY]",
|
|
21
|
+
regex: /\bsk-ant-[a-zA-Z0-9_\-]{20,}\b/g
|
|
22
|
+
},
|
|
23
|
+
// 3. OpenAI / DeepSeek / 通用 API Key (sk-...)
|
|
24
|
+
{
|
|
25
|
+
kind: "API_KEY",
|
|
26
|
+
placeholder: "[REDACTED:API_KEY]",
|
|
27
|
+
regex: /\bsk-[a-zA-Z0-9_\-]{24,}\b/g
|
|
28
|
+
},
|
|
29
|
+
// 3b. BigModel / 智谱(GLM)API Key:32 位 hex + "." + 16 位字母数字
|
|
30
|
+
// (2026-11 实证:这类 key 没有任何可辨识前缀,此前漏在清洗与入路隔离之外,
|
|
31
|
+
// 用户贴进对话后明文直接进了 prompt / 历史 / 工具日志。)
|
|
32
|
+
{
|
|
33
|
+
kind: "BIGMODEL_KEY",
|
|
34
|
+
placeholder: "[REDACTED:BIGMODEL_KEY]",
|
|
35
|
+
regex: /\b[0-9a-fA-F]{32}\.[A-Za-z0-9]{16}\b/g
|
|
36
|
+
},
|
|
37
|
+
// 4. GitHub 访问令牌 (ghp_..., gho_..., github_pat_...)
|
|
38
|
+
{
|
|
39
|
+
kind: "GITHUB_TOKEN",
|
|
40
|
+
placeholder: "[REDACTED:GITHUB_TOKEN]",
|
|
41
|
+
regex: /\b(?:gh[pousr]_[a-zA-Z0-9]{30,}|github_pat_[a-zA-Z0-9_]{40,})\b/g
|
|
42
|
+
},
|
|
43
|
+
// 5. Bearer Token (JWT / Authorization Bearer)
|
|
44
|
+
{
|
|
45
|
+
kind: "BEARER_TOKEN",
|
|
46
|
+
placeholder: "Bearer [REDACTED:BEARER_TOKEN]",
|
|
47
|
+
regex: /\bBearer\s+[a-zA-Z0-9_\-\.]{25,}\b/gi
|
|
48
|
+
},
|
|
49
|
+
// 6. 常见环境变量或配置中的密码赋值 (PASSWORD=..., PASSWD=...)
|
|
50
|
+
{
|
|
51
|
+
kind: "PASSWORD",
|
|
52
|
+
placeholder: "$1=[REDACTED:PASSWORD]",
|
|
53
|
+
regex: /\b((?:DB_|DATABASE_|ADMIN_|ROOT_|MYSQL_|POSTGRES_)?(?:PASSWORD|PASSWD|SECRET_KEY))\s*=\s*['"]?([^\s'"]{4,})['"]?/gi
|
|
54
|
+
}
|
|
14
55
|
];
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
56
|
+
var QUICK_PROBE_SUBSTRINGS = [
|
|
57
|
+
"sk-",
|
|
58
|
+
"ghp_",
|
|
59
|
+
"gho_",
|
|
60
|
+
"ghu_",
|
|
61
|
+
"ghs_",
|
|
62
|
+
"ghr_",
|
|
63
|
+
"github_pat_",
|
|
64
|
+
"PRIVATE KEY",
|
|
65
|
+
"Bearer ",
|
|
66
|
+
"bearer ",
|
|
67
|
+
"PASSWORD",
|
|
68
|
+
"password",
|
|
69
|
+
"PASSWD",
|
|
70
|
+
"SECRET_KEY"
|
|
71
|
+
];
|
|
72
|
+
var UNPREFIXED_PROBE_REGEX = /\b[0-9a-fA-F]{32}\.[A-Za-z0-9]{16}\b/;
|
|
73
|
+
function hasPotentialSecrets(text) {
|
|
74
|
+
if (typeof text !== "string" || text.length === 0) return false;
|
|
75
|
+
if (QUICK_PROBE_SUBSTRINGS.some((probe) => text.includes(probe))) return true;
|
|
76
|
+
return UNPREFIXED_PROBE_REGEX.test(text);
|
|
77
|
+
}
|
|
78
|
+
function scrubSecrets(text) {
|
|
79
|
+
if (typeof text !== "string" || text.length === 0) {
|
|
80
|
+
return { cleaned: text, redactedCount: 0, matchedKinds: [] };
|
|
22
81
|
}
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
let text;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
82
|
+
if (!hasPotentialSecrets(text)) {
|
|
83
|
+
return { cleaned: text, redactedCount: 0, matchedKinds: [] };
|
|
84
|
+
}
|
|
85
|
+
let cleaned = text;
|
|
86
|
+
let redactedCount = 0;
|
|
87
|
+
const matchedKinds = [];
|
|
88
|
+
for (const pattern of SECRET_PATTERNS) {
|
|
89
|
+
pattern.regex.lastIndex = 0;
|
|
90
|
+
const matches = cleaned.match(pattern.regex);
|
|
91
|
+
if (matches && matches.length > 0) {
|
|
92
|
+
redactedCount += matches.length;
|
|
93
|
+
if (!matchedKinds.includes(pattern.kind)) {
|
|
94
|
+
matchedKinds.push(pattern.kind);
|
|
95
|
+
}
|
|
96
|
+
cleaned = cleaned.replace(pattern.regex, pattern.placeholder);
|
|
37
97
|
}
|
|
38
98
|
}
|
|
39
|
-
return
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
99
|
+
return { cleaned, redactedCount, matchedKinds };
|
|
100
|
+
}
|
|
101
|
+
function scrubObjectSecrets(val) {
|
|
102
|
+
if (val === null || val === void 0) return val;
|
|
103
|
+
if (typeof val === "string") {
|
|
104
|
+
return scrubSecrets(val).cleaned;
|
|
105
|
+
}
|
|
106
|
+
if (Array.isArray(val)) {
|
|
107
|
+
return val.map((item) => scrubObjectSecrets(item));
|
|
108
|
+
}
|
|
109
|
+
if (typeof val === "object") {
|
|
110
|
+
if (val instanceof Date || val instanceof RegExp) return val;
|
|
111
|
+
const result = {};
|
|
112
|
+
for (const [k, v] of Object.entries(val)) {
|
|
113
|
+
result[k] = scrubObjectSecrets(v);
|
|
114
|
+
}
|
|
115
|
+
return result;
|
|
116
|
+
}
|
|
117
|
+
return val;
|
|
118
|
+
}
|
|
47
119
|
|
|
48
120
|
// packages/agent-runtime/toolOutputSanitizer.ts
|
|
49
121
|
var SANITIZE_REPLACEMENT_CHAR = "\uFFFD";
|
|
@@ -183,117 +255,6 @@ function sanitizeToolOutputContent(content) {
|
|
|
183
255
|
return typeof content === "string" ? sanitizeToolOutputText(content) : content;
|
|
184
256
|
}
|
|
185
257
|
|
|
186
|
-
// packages/agent-runtime/secretScrubber.ts
|
|
187
|
-
var SECRET_PATTERNS = [
|
|
188
|
-
// 1. PEM 私钥块(高危硬拦截)
|
|
189
|
-
{
|
|
190
|
-
kind: "PRIVATE_KEY",
|
|
191
|
-
placeholder: "[REDACTED:PRIVATE_KEY]",
|
|
192
|
-
regex: /-----BEGIN (?:[A-Z0-9 ]+)?PRIVATE KEY-----[\s\S]+?-----END (?:[A-Z0-9 ]+)?PRIVATE KEY-----/g
|
|
193
|
-
},
|
|
194
|
-
// 2. Anthropic API Key (sk-ant-...)
|
|
195
|
-
{
|
|
196
|
-
kind: "ANTHROPIC_KEY",
|
|
197
|
-
placeholder: "[REDACTED:ANTHROPIC_KEY]",
|
|
198
|
-
regex: /\bsk-ant-[a-zA-Z0-9_\-]{20,}\b/g
|
|
199
|
-
},
|
|
200
|
-
// 3. OpenAI / DeepSeek / 通用 API Key (sk-...)
|
|
201
|
-
{
|
|
202
|
-
kind: "API_KEY",
|
|
203
|
-
placeholder: "[REDACTED:API_KEY]",
|
|
204
|
-
regex: /\bsk-[a-zA-Z0-9_\-]{24,}\b/g
|
|
205
|
-
},
|
|
206
|
-
// 3b. BigModel / 智谱(GLM)API Key:32 位 hex + "." + 16 位字母数字
|
|
207
|
-
// (2026-11 实证:这类 key 没有任何可辨识前缀,此前漏在清洗与入路隔离之外,
|
|
208
|
-
// 用户贴进对话后明文直接进了 prompt / 历史 / 工具日志。)
|
|
209
|
-
{
|
|
210
|
-
kind: "BIGMODEL_KEY",
|
|
211
|
-
placeholder: "[REDACTED:BIGMODEL_KEY]",
|
|
212
|
-
regex: /\b[0-9a-fA-F]{32}\.[A-Za-z0-9]{16}\b/g
|
|
213
|
-
},
|
|
214
|
-
// 4. GitHub 访问令牌 (ghp_..., gho_..., github_pat_...)
|
|
215
|
-
{
|
|
216
|
-
kind: "GITHUB_TOKEN",
|
|
217
|
-
placeholder: "[REDACTED:GITHUB_TOKEN]",
|
|
218
|
-
regex: /\b(?:gh[pousr]_[a-zA-Z0-9]{30,}|github_pat_[a-zA-Z0-9_]{40,})\b/g
|
|
219
|
-
},
|
|
220
|
-
// 5. Bearer Token (JWT / Authorization Bearer)
|
|
221
|
-
{
|
|
222
|
-
kind: "BEARER_TOKEN",
|
|
223
|
-
placeholder: "Bearer [REDACTED:BEARER_TOKEN]",
|
|
224
|
-
regex: /\bBearer\s+[a-zA-Z0-9_\-\.]{25,}\b/gi
|
|
225
|
-
},
|
|
226
|
-
// 6. 常见环境变量或配置中的密码赋值 (PASSWORD=..., PASSWD=...)
|
|
227
|
-
{
|
|
228
|
-
kind: "PASSWORD",
|
|
229
|
-
placeholder: "$1=[REDACTED:PASSWORD]",
|
|
230
|
-
regex: /\b((?:DB_|DATABASE_|ADMIN_|ROOT_|MYSQL_|POSTGRES_)?(?:PASSWORD|PASSWD|SECRET_KEY))\s*=\s*['"]?([^\s'"]{4,})['"]?/gi
|
|
231
|
-
}
|
|
232
|
-
];
|
|
233
|
-
var QUICK_PROBE_SUBSTRINGS = [
|
|
234
|
-
"sk-",
|
|
235
|
-
"ghp_",
|
|
236
|
-
"gho_",
|
|
237
|
-
"ghu_",
|
|
238
|
-
"ghs_",
|
|
239
|
-
"ghr_",
|
|
240
|
-
"github_pat_",
|
|
241
|
-
"PRIVATE KEY",
|
|
242
|
-
"Bearer ",
|
|
243
|
-
"bearer ",
|
|
244
|
-
"PASSWORD",
|
|
245
|
-
"password",
|
|
246
|
-
"PASSWD",
|
|
247
|
-
"SECRET_KEY"
|
|
248
|
-
];
|
|
249
|
-
var UNPREFIXED_PROBE_REGEX = /\b[0-9a-fA-F]{32}\.[A-Za-z0-9]{16}\b/;
|
|
250
|
-
function hasPotentialSecrets(text) {
|
|
251
|
-
if (typeof text !== "string" || text.length === 0) return false;
|
|
252
|
-
if (QUICK_PROBE_SUBSTRINGS.some((probe) => text.includes(probe))) return true;
|
|
253
|
-
return UNPREFIXED_PROBE_REGEX.test(text);
|
|
254
|
-
}
|
|
255
|
-
function scrubSecrets(text) {
|
|
256
|
-
if (typeof text !== "string" || text.length === 0) {
|
|
257
|
-
return { cleaned: text, redactedCount: 0, matchedKinds: [] };
|
|
258
|
-
}
|
|
259
|
-
if (!hasPotentialSecrets(text)) {
|
|
260
|
-
return { cleaned: text, redactedCount: 0, matchedKinds: [] };
|
|
261
|
-
}
|
|
262
|
-
let cleaned = text;
|
|
263
|
-
let redactedCount = 0;
|
|
264
|
-
const matchedKinds = [];
|
|
265
|
-
for (const pattern of SECRET_PATTERNS) {
|
|
266
|
-
pattern.regex.lastIndex = 0;
|
|
267
|
-
const matches = cleaned.match(pattern.regex);
|
|
268
|
-
if (matches && matches.length > 0) {
|
|
269
|
-
redactedCount += matches.length;
|
|
270
|
-
if (!matchedKinds.includes(pattern.kind)) {
|
|
271
|
-
matchedKinds.push(pattern.kind);
|
|
272
|
-
}
|
|
273
|
-
cleaned = cleaned.replace(pattern.regex, pattern.placeholder);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
return { cleaned, redactedCount, matchedKinds };
|
|
277
|
-
}
|
|
278
|
-
function scrubObjectSecrets(val) {
|
|
279
|
-
if (val === null || val === void 0) return val;
|
|
280
|
-
if (typeof val === "string") {
|
|
281
|
-
return scrubSecrets(val).cleaned;
|
|
282
|
-
}
|
|
283
|
-
if (Array.isArray(val)) {
|
|
284
|
-
return val.map((item) => scrubObjectSecrets(item));
|
|
285
|
-
}
|
|
286
|
-
if (typeof val === "object") {
|
|
287
|
-
if (val instanceof Date || val instanceof RegExp) return val;
|
|
288
|
-
const result = {};
|
|
289
|
-
for (const [k, v] of Object.entries(val)) {
|
|
290
|
-
result[k] = scrubObjectSecrets(v);
|
|
291
|
-
}
|
|
292
|
-
return result;
|
|
293
|
-
}
|
|
294
|
-
return val;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
258
|
// packages/ai/agent/toolOutputPolicy.ts
|
|
298
259
|
var PROJECT_INSTRUCTION_MAX_BYTES = 24 * 1024;
|
|
299
260
|
var PROJECT_INSTRUCTION_MAX_CHARS = PROJECT_INSTRUCTION_MAX_BYTES + 2048;
|
|
@@ -354,6 +315,45 @@ function clipToolText(content, maxChars, headRatio, marker = "\n\n[... tool outp
|
|
|
354
315
|
return `${normalized.slice(0, headChars)}${marker}${normalized.slice(-tailChars)}`;
|
|
355
316
|
}
|
|
356
317
|
|
|
318
|
+
// packages/core/agentSkillModes.ts
|
|
319
|
+
var AGENT_SKILL_MODES = [
|
|
320
|
+
"required",
|
|
321
|
+
"recommended",
|
|
322
|
+
"disabled"
|
|
323
|
+
];
|
|
324
|
+
var isAgentSkillMode = (value) => typeof value === "string" && AGENT_SKILL_MODES.includes(value);
|
|
325
|
+
var collectInvalidAgentSkillModes = (skills) => {
|
|
326
|
+
if (!skills || typeof skills !== "object" || Array.isArray(skills)) return [];
|
|
327
|
+
const out = [];
|
|
328
|
+
for (const [slug, value] of Object.entries(skills)) {
|
|
329
|
+
if (value === null) continue;
|
|
330
|
+
if (!isAgentSkillMode(value)) out.push({ slug, value });
|
|
331
|
+
}
|
|
332
|
+
return out;
|
|
333
|
+
};
|
|
334
|
+
var describeAgentSkillModeValue = (value) => {
|
|
335
|
+
let text;
|
|
336
|
+
if (typeof value === "string") {
|
|
337
|
+
text = JSON.stringify(value.length > 40 ? `${value.slice(0, 40)}\u2026` : value);
|
|
338
|
+
} else if (value === void 0) {
|
|
339
|
+
text = "undefined";
|
|
340
|
+
} else {
|
|
341
|
+
try {
|
|
342
|
+
const serialized = JSON.stringify(value);
|
|
343
|
+
text = typeof serialized === "string" ? serialized : String(value);
|
|
344
|
+
} catch {
|
|
345
|
+
text = typeof value;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return text.length > 60 ? `${text.slice(0, 60)}\u2026` : text;
|
|
349
|
+
};
|
|
350
|
+
var formatInvalidAgentSkillModeMessage = (invalid, allowed = AGENT_SKILL_MODES) => `Invalid agent skill mode for "${invalid.slug}": ${describeAgentSkillModeValue(invalid.value)}. Allowed values: ${allowed.join(", ")}.`;
|
|
351
|
+
var isAgentSkillModesFieldShapeValid = (skills) => {
|
|
352
|
+
if (skills === null || skills === void 0) return true;
|
|
353
|
+
return typeof skills === "object" && !Array.isArray(skills);
|
|
354
|
+
};
|
|
355
|
+
var formatInvalidAgentSkillModesFieldMessage = (allowed = AGENT_SKILL_MODES) => `Invalid agent skills field: expected an object mapping slug \u2192 mode (${allowed.join(" | ")}).`;
|
|
356
|
+
|
|
357
357
|
// packages/ai/tools/agentSkillConfig.ts
|
|
358
358
|
var MODES = AGENT_SKILL_MODES;
|
|
359
359
|
var DEFAULT_RECOMMENDED_SKILL_SLUGS = [
|
|
@@ -438,17 +438,12 @@ var defaultSkillTitleLookup = (slug) => {
|
|
|
438
438
|
var isAgentSkillDisabled = (source, slug) => resolveAgentSkillConfig(source)[slug] === "disabled";
|
|
439
439
|
|
|
440
440
|
export {
|
|
441
|
-
collectInvalidAgentSkillModes,
|
|
442
|
-
describeAgentSkillModeValue,
|
|
443
|
-
formatInvalidAgentSkillModeMessage,
|
|
444
|
-
isAgentSkillModesFieldShapeValid,
|
|
445
|
-
formatInvalidAgentSkillModesFieldMessage,
|
|
446
|
-
sanitizeToolOutputText,
|
|
447
|
-
sanitizeToolOutputContent,
|
|
448
441
|
SECRET_PATTERNS,
|
|
449
442
|
hasPotentialSecrets,
|
|
450
443
|
scrubSecrets,
|
|
451
444
|
scrubObjectSecrets,
|
|
445
|
+
sanitizeToolOutputText,
|
|
446
|
+
sanitizeToolOutputContent,
|
|
452
447
|
PROJECT_INSTRUCTION_MAX_BYTES,
|
|
453
448
|
PROJECT_INSTRUCTION_MAX_CHARS,
|
|
454
449
|
isCompleteInstructionOutput,
|
|
@@ -458,6 +453,11 @@ export {
|
|
|
458
453
|
resolveHistoricalToolContentCap,
|
|
459
454
|
projectToolMessageContent,
|
|
460
455
|
clipToolText,
|
|
456
|
+
collectInvalidAgentSkillModes,
|
|
457
|
+
describeAgentSkillModeValue,
|
|
458
|
+
formatInvalidAgentSkillModeMessage,
|
|
459
|
+
isAgentSkillModesFieldShapeValid,
|
|
460
|
+
formatInvalidAgentSkillModesFieldMessage,
|
|
461
461
|
resolveAgentSkillConfig,
|
|
462
462
|
collectAgentSkillConfigIssues,
|
|
463
463
|
resolveAgentRequiredPackIds,
|