nolo-cli 0.228.0 → 0.228.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-GIFVXKDT.js → _executeModel-AKCTHGMP.js} +62 -61
- package/{action-WZTKEF5H.js → action-C6IQAKN4.js} +6 -6
- package/{addContentAction-MLI6GOBV.js → addContentAction-53364YDW.js} +10 -10
- package/{addDialogAgentAction-ARGQM22H.js → addDialogAgentAction-U5DD5EN5.js} +9 -9
- package/{agentDeleteCommand-UF7XVELS.js → agentDeleteCommand-2E5FAGUO.js} +99 -93
- package/{agentEmailCommands-SFHRPQYC.js → agentEmailCommands-UGZZAH7E.js} +99 -93
- package/{agentListCommands-IXKBP3W5.js → agentListCommands-JCTW3J2K.js} +240 -52
- package/{agentMachineCommands-7NX6PWQ6.js → agentMachineCommands-QPG5ZXF4.js} +45 -41
- package/{agentProviderCommands-C5T7C5KZ.js → agentProviderCommands-QLTABYR7.js} +2 -2
- package/{agentPullCommand-4EQZYHU4.js → agentPullCommand-2EYJ5ENC.js} +1 -1
- package/{agentRecordCommands-IUNX6XD6.js → agentRecordCommands-4NTVR6MZ.js} +98 -92
- package/{agentRunCommand-LCR4XADM.js → agentRunCommand-VHF34PYC.js} +103 -94
- package/{agentRunControl-RN2P6AOD.js → agentRunControl-QYTXUQGY.js} +10 -7
- package/{agentRuntimeLocal-LVXPQ7QA.js → agentRuntimeLocal-U54AKHXH.js} +38 -36
- package/{agentSlice-ZGMOH6TE.js → agentSlice-4JGDEXWK.js} +10 -10
- package/{appDeleteCommands-BESCJOQM.js → appDeleteCommands-XBE5QJ6P.js} +46 -42
- package/{appDeployCommands-LPTR6IOX.js → appDeployCommands-QIYLXXGA.js} +46 -42
- package/{appDeployStatusCommands-BZ7KZ5RD.js → appDeployStatusCommands-JXS6ZQZZ.js} +46 -42
- package/{appGetCommands-EDWGJV4S.js → appGetCommands-SZS7SJPK.js} +46 -42
- package/{appListCommands-OPRWYPM6.js → appListCommands-B3GBJSNV.js} +46 -42
- package/{authCommand-3C3RN4OU.js → authCommand-V6EOMZX6.js} +15 -15
- package/{authCommands-ZMVEDCQD.js → authCommands-T5FODCEG.js} +2 -2
- package/{builtinSkillRegistry-VRCMQ77Q.js → builtinSkillRegistry-ZQC3IIO2.js} +4 -3
- package/{chromeOpsCommands-NZITLHWO.js → chromeOpsCommands-OFX7ZGKP.js} +2 -2
- package/{chunk-MZVCFV3T.js → chunk-223KZUJ6.js} +4 -4
- package/{chunk-UF6J7NXV.js → chunk-2C5VN7NH.js} +1 -1
- package/{chunk-MAA42MMV.js → chunk-2FZVXOFX.js} +4 -4
- package/{chunk-ESN4WNWU.js → chunk-2JHGUL5K.js} +2 -2
- package/chunk-3A5NNQCN.js +64 -0
- package/chunk-3F2FRLIO.js +372 -0
- package/{chunk-V4IYI3SB.js → chunk-46FETNLF.js} +2 -2
- package/{chunk-RR3MB26M.js → chunk-4GYVS4PM.js} +8 -6
- package/{chunk-ZQ6K57FJ.js → chunk-4YPH5KRA.js} +1 -1
- package/{chunk-Y4NPF2UN.js → chunk-5AYP5QBB.js} +5 -5
- package/{chunk-4OXPN3WC.js → chunk-5ISNPTQH.js} +4 -4
- package/{chunk-CO6E7YK6.js → chunk-5P3PPQVP.js} +1 -1
- package/{chunk-6TVYUQRM.js → chunk-6BMTKYAO.js} +2 -2
- package/{chunk-KLAMJNKQ.js → chunk-6PAHSSD2.js} +15 -8
- package/{chunk-CTWCZKNS.js → chunk-6SOWMEAY.js} +4 -4
- package/{chunk-ARFCL53U.js → chunk-6VEO7Z3Y.js} +5 -5
- package/{chunk-ZM5AZTQG.js → chunk-7BIJFGKS.js} +20 -8
- package/{chunk-BAH3BAUZ.js → chunk-7OVOZRZF.js} +5 -5
- package/{chunk-N74XL3NI.js → chunk-7PON4LBY.js} +42 -24
- package/{chunk-LTVEOOZL.js → chunk-7WHCIA5V.js} +16 -3
- package/{chunk-HZDK56EK.js → chunk-ADYWV732.js} +34 -12
- package/{chunk-2FK2KZSL.js → chunk-AIFQKNPP.js} +1 -1
- package/{chunk-VTHWBTRE.js → chunk-BPB3T5EU.js} +5 -8
- package/{chunk-SX6AWTNK.js → chunk-BZLGPM5B.js} +3 -3
- package/{chunk-MTM4LRVG.js → chunk-BZMDWGQQ.js} +2 -2
- package/{chunk-JP2BH4NC.js → chunk-CEKRIR22.js} +1 -1
- package/{chunk-5HUO7SEX.js → chunk-D634SL2Y.js} +1 -1
- package/{chunk-SCMYAGQE.js → chunk-DHRPLRIR.js} +294 -159
- package/{chunk-VUHKG4KS.js → chunk-DNNPARJK.js} +9 -5
- package/{chunk-X22AUZKL.js → chunk-E3LSO6EI.js} +189 -88
- package/{chunk-LHCGKAFO.js → chunk-EHFBP6IK.js} +100 -48
- package/{chunk-6ASGEP5D.js → chunk-EJQE5HB7.js} +1 -1
- package/{chunk-2BKNICGK.js → chunk-EL5NRJHI.js} +1 -1
- package/chunk-EUGTFFO6.js +42 -0
- package/{chunk-YFW4H6DL.js → chunk-EVHTYVD2.js} +821 -131
- package/{chunk-6XRPBZRS.js → chunk-EYLGAEB4.js} +0 -134
- package/{chunk-E5RYFR7E.js → chunk-FEIVARWR.js} +49 -15
- package/{chunk-3DJJ4CFG.js → chunk-FLBJ7IJI.js} +9 -9
- package/{chunk-W3HSD32M.js → chunk-FXEPZKNJ.js} +2 -2
- package/{chunk-VKCPKCSS.js → chunk-FYAMUU55.js} +625 -62
- package/{chunk-JEWMQR6J.js → chunk-FZANZZ63.js} +1 -1
- package/{chunk-WWTSEBDF.js → chunk-GIXWVN2W.js} +1 -1
- package/{chunk-YHNUDTU4.js → chunk-HDKMVYNJ.js} +4 -4
- package/chunk-HEVRQGGH.js +106 -0
- package/{chunk-PBPXXMWZ.js → chunk-HFHJPHFK.js} +1 -1
- package/{chunk-WQDTSK5U.js → chunk-HPDLPEUG.js} +11 -5
- package/{chunk-SPU3L3OR.js → chunk-HQUGB2HM.js} +3 -3
- package/chunk-IVK2KT3H.js +209 -0
- package/{chunk-73PZD7JZ.js → chunk-IYLUK67R.js} +2 -2
- package/{chunk-BFKJ2RS3.js → chunk-J55F3IEZ.js} +1 -1
- package/{chunk-ADOOL3PG.js → chunk-J7JRCOIW.js} +1 -1
- package/{chunk-AEZBAFC6.js → chunk-JAKRY74O.js} +138 -8
- package/{chunk-NEG5LYK5.js → chunk-JCQ3WCQ3.js} +3 -1
- package/{chunk-W6T4FNZP.js → chunk-JLZJL3WC.js} +219 -351
- package/{chunk-PQ63BDV3.js → chunk-JPXACKSW.js} +9 -1
- package/{chunk-IIOSZAJX.js → chunk-KDBDOXOM.js} +137 -53
- package/{chunk-CIGCTSBF.js → chunk-KDDHQMSH.js} +1 -1
- package/{chunk-OAZP4TSA.js → chunk-KG27JIG4.js} +2 -2
- package/{chunk-RHBD22LV.js → chunk-KHYSFS3W.js} +80 -4
- package/{chunk-7UVVLYKC.js → chunk-KKIQAVDR.js} +5 -5
- package/{chunk-HS7MLR74.js → chunk-KZ4A7EIV.js} +3 -5
- package/{chunk-OLGFIQN2.js → chunk-LLUBUHNT.js} +1 -1
- package/{chunk-QJTZ76CP.js → chunk-LS5KAVFQ.js} +1 -0
- package/{chunk-K26XPZRB.js → chunk-LVZVSLKO.js} +29 -9
- package/{chunk-XJSEST7D.js → chunk-MNFUKRRU.js} +3 -3
- package/{chunk-R5NRFXGD.js → chunk-O3A2CHAL.js} +5 -5
- package/{chunk-4IQN6FWY.js → chunk-OB4FBZXJ.js} +4 -4
- package/{chunk-J2VIGDJN.js → chunk-OJSJJKHF.js} +3 -3
- package/{chunk-OHUYN3YU.js → chunk-OKAXQFON.js} +1 -1
- package/{chunk-CD2DK5JA.js → chunk-OKH74FML.js} +2 -1
- package/{chunk-MYYNZG2M.js → chunk-OOV5JN25.js} +4 -4
- package/{chunk-TMRJGSK2.js → chunk-OOVOAG4Q.js} +1 -1
- package/chunk-OQFOE4SJ.js +405 -0
- package/{chunk-AS6L5KSD.js → chunk-P4R5KXU7.js} +2 -2
- package/{chunk-VIYVRPMJ.js → chunk-PHREU2KZ.js} +5 -3
- package/{chunk-EDT65EUE.js → chunk-PIVTQRX6.js} +45 -15
- package/{chunk-QMNVV3YM.js → chunk-PJL7OJRC.js} +12 -11
- package/{chunk-XCA4WHX5.js → chunk-PNLDLUMO.js} +315 -360
- package/{chunk-UPOW5HTG.js → chunk-QGFLVQ6E.js} +3 -3
- package/{chunk-JU7VN4LF.js → chunk-QONAOHVW.js} +6 -6
- package/{chunk-UOUMPHS5.js → chunk-R3FZHW4Q.js} +13 -13
- package/{chunk-K7VIXYTZ.js → chunk-R3MV2GII.js} +1 -45
- package/{chunk-FE7G6DSP.js → chunk-R72QWIFO.js} +14 -4
- package/{chunk-KZAT2M2V.js → chunk-RIWKZT7E.js} +22 -0
- package/{chunk-RMWDKLBE.js → chunk-S7H4KTMB.js} +1099 -71
- package/{chunk-IJZC2KIJ.js → chunk-SA356NGW.js} +1 -1
- package/{chunk-BVEDT6DM.js → chunk-SCAC3NM5.js} +3 -3
- package/{chunk-EQZQUQ33.js → chunk-SLUN7W6S.js} +5 -5
- package/{chunk-KK3FCYZM.js → chunk-SQL7YNED.js} +7 -4
- package/{chunk-LMGFVH65.js → chunk-SSOR2EDT.js} +10 -10
- package/chunk-TRRXYFTR.js +46 -0
- package/{chunk-XNTZD4AE.js → chunk-TUOHSUK5.js} +19367 -17503
- package/chunk-TYJCIA2O.js +835 -0
- package/{chunk-FTWAOKFU.js → chunk-U3BUWDUP.js} +415 -1962
- package/{chunk-CD64YXRB.js → chunk-U6QNVOR5.js} +1 -1
- package/chunk-UAF5VQCE.js +77 -0
- package/{chunk-CIUZXD5D.js → chunk-UFGUJ2IH.js} +5 -5
- package/{chunk-CTIEJRTP.js → chunk-UP7KBWLE.js} +81 -29
- package/{chunk-GX6DITLQ.js → chunk-UUCYUN6Y.js} +1 -1
- package/{chunk-UHW6SCVK.js → chunk-UZKBVQUX.js} +1 -1
- package/{chunk-XSRSAU3O.js → chunk-V5TI7HJH.js} +3 -3
- package/{chunk-WFGNWWJI.js → chunk-VH7UO6E5.js} +252 -114
- package/{chunk-ITBX27W6.js → chunk-VJFDG3ZG.js} +30 -122
- package/{chunk-6MTVACLN.js → chunk-WC3J5SL2.js} +277 -293
- package/{chunk-HCCQEMTK.js → chunk-WD5547ZF.js} +15 -12
- package/{chunk-X3OZ655T.js → chunk-WS36XPJD.js} +2 -2
- package/{chunk-JFRJEPFI.js → chunk-WSLL7VV4.js} +2 -2
- package/chunk-XRGBJHZX.js +136 -0
- package/{chunk-KZ5OD2MO.js → chunk-Y2KWJTOZ.js} +3 -3
- package/{dialogUsageCommand-6RW2FY6K.js → chunk-Y2TCTNUD.js} +24 -17
- package/{chunk-FFFKAOJN.js → chunk-YN23INFZ.js} +1 -1
- package/{chunk-ODBYGVO2.js → chunk-YXK3GJF5.js} +5 -5
- package/{chunk-6CXQ3YNJ.js → chunk-Z2OWAYMI.js} +53 -31
- package/{chunk-6XVPMGXK.js → chunk-ZTHAJU3O.js} +10 -4
- package/{chunk-D25ONVOH.js → chunk-ZYPXOQS2.js} +1 -1
- package/{cliAgentConfigHelpers-37ZNEY5Y.js → cliAgentConfigHelpers-BXHQ3PXP.js} +8 -8
- package/{cliAuthorityBrokerClient-SFPC3WVK.js → cliAuthorityBrokerClient-TFNXJLXL.js} +1 -1
- package/cliAuthorityBrokerProcess-5ZFBTHLB.js +22 -0
- package/{cliLocalAgentRecordReader-MCQVRWBR.js → cliLocalAgentRecordReader-47PXMHPH.js} +43 -41
- package/{commandRegistry-NTH5IAN5.js → commandRegistry-CTMPAQH2.js} +93 -156
- package/{contentThunks-SPXTX5U2.js → contentThunks-CAHIIZO5.js} +25 -25
- package/{cooldownCommands-TIFCHCUN.js → cooldownCommands-WDOI5VD7.js} +3 -3
- package/{createAgentAutomationAction-KUQKCOXB.js → createAgentAutomationAction-M25XZSPD.js} +25 -25
- package/{createDialogAction-HJN5U3XS.js → createDialogAction-4SN7FKI7.js} +26 -26
- package/{createPageAction-ZAHRDOAU.js → createPageAction-N7QPDN3M.js} +28 -28
- package/{db-CMUTP3W5.js → db-VR74ADGC.js} +7 -2
- package/{dbSlice-656PMWR2.js → dbSlice-RWPSVHBC.js} +9 -9
- package/{deleteFile-ZCQESEEQ.js → deleteFile-ECU6FU5C.js} +12 -7
- package/{dialogCommands-KZTZLWPZ.js → dialogCommands-BBHWCKDP.js} +57 -47
- package/{dialogNotifyCommand-PST75COP.js → dialogNotifyCommand-IASQGEMW.js} +9 -9
- package/{dialogSlice-BXIERQHO.js → dialogSlice-JI3J22RV.js} +23 -23
- package/dialogTraceCommand-EW2KK6A4.js +961 -0
- package/dialogUsageCommand-WJ3U6KZU.js +27 -0
- package/{docCreateCommands-26HJ5NAY.js → docCreateCommands-QSX3X5U4.js} +45 -41
- package/{docDeleteCommands-UAOHH5XK.js → docDeleteCommands-63JBG2HQ.js} +46 -42
- package/{docReadCommands-4ADG7YE6.js → docReadCommands-CQFKRQUI.js} +45 -41
- package/{docStore-FZ75HWP2.js → docStore-XLBKGGNM.js} +10 -10
- package/{docUpdateCommands-OGFJZENF.js → docUpdateCommands-534LUK25.js} +45 -41
- package/ebookDownloaderAgentCommand-DYSKF5ZY.js +677 -0
- package/{getPricing-FCHYVRJU.js → getPricing-5BLZRPTM.js} +3 -3
- package/{handleSendMessageAction-KP6GGBFY.js → handleSendMessageAction-Q2VMEVOR.js} +90 -48
- package/{hostCredentialCreate-23TX56G7.js → hostCredentialCreate-C57T7YPE.js} +99 -93
- package/index.js +23 -11
- package/{localDialogRead-CIOTQM5T.js → localDialogRead-BJJT3TF5.js} +1 -1
- package/{localRuntimeAdapter-MTUWOYPN.js → localRuntimeAdapter-OALZPFZU.js} +96 -90
- package/{localRuntimeAuthority-TYHQCTZN.js → localRuntimeAuthority-UF2DAQ3F.js} +13 -3
- package/{localRuntimeDb-BO7IVWAZ.js → localRuntimeDb-ZJFGNHML.js} +1 -1
- package/{machineCommands-4WJUJQHW.js → machineCommands-N6IVWRZT.js} +109 -92
- package/{machineWsRunDispatch-V3U4JM67.js → machineWsRunDispatch-PDWYB33B.js} +97 -91
- package/{markdownToSlate-KIYM7B3P.js → markdownToSlate-PXYAIBVL.js} +1 -1
- package/{mcpLocalAuthorizeCommand-TI656UWC.js → mcpLocalAuthorizeCommand-KYI4EGF5.js} +17 -13
- package/{memberThunks-JFYC4Z5L.js → memberThunks-43B7UYC5.js} +11 -11
- package/{models-EP7VG6N2.js → models-ZX2BYIMB.js} +2 -2
- package/package.json +2 -1
- package/{projectArchive-NU2Z5HOR.js → projectArchive-TJNW5DLM.js} +28 -28
- package/{providerPresetApply-4H7YP5D7.js → providerPresetApply-NTJUINI6.js} +35 -16
- package/{providerRegistry-F3UPOTIY.js → providerRegistry-W45SLUV6.js} +5 -5
- package/{read-BRZHXUJ6.js → read-KG6INYUT.js} +12 -7
- package/{readDocTool-N7RVFQEE.js → readDocTool-N3GA52JR.js} +1 -1
- package/{readlineWorkspace-T56MRMS5.js → readlineWorkspace-PJZJVGA5.js} +1296 -1056
- package/{removeDialogAgentAction-J7XU7OUX.js → removeDialogAgentAction-EEVSOQOJ.js} +11 -11
- package/{runAgentClientLoop-O2GRCGRZ.js → runAgentClientLoop-3VC5TCDW.js} +69 -58
- package/{runtimeDoctorCommands-RDRJXMXC.js → runtimeDoctorCommands-V3M3JTUV.js} +14 -11
- package/{secretCommands-2FEMRUFM.js → secretCommands-KVVZS7A6.js} +2 -2
- package/{setDialogExtraReferencesAction-Q4V2ZZW2.js → setDialogExtraReferencesAction-DNO5POHA.js} +10 -10
- package/{setPrimaryDialogAgentAction-742H5S6T.js → setPrimaryDialogAgentAction-QABBEO4C.js} +11 -11
- package/{settingThunks-T4FXSV6M.js → settingThunks-DVKG4X4S.js} +13 -17
- package/{skillDiscovery-MDDKPTW3.js → skillDiscovery-ZMJH36AK.js} +3 -3
- package/{spaceCommands-W5TAVFDT.js → spaceCommands-AGGZXPY3.js} +218 -77
- package/{streamAgentChatTurn-OWDJMU5E.js → streamAgentChatTurn-4GTLL2OF.js} +111 -95
- package/{switchDialogAgentAction-HLDLHRRA.js → switchDialogAgentAction-KYWJSGOO.js} +9 -9
- package/{tableCommands-44GC4N6J.js → tableCommands-EFA754RE.js} +3 -3
- package/{tools-O7SGGVA3.js → tools-5AGPOPLW.js} +48 -47
- package/{tuiRestart-EOGC2BYY.js → tuiRestart-77E7PL4R.js} +9 -8
- package/{tuiSummaryLlmCaller-TM5BU73J.js → tuiSummaryLlmCaller-HROLGN4F.js} +12 -12
- package/{updateCommands-FBYA5WVG.js → updateCommands-GJGRS6JK.js} +3 -3
- package/{updateDialogTitleAction-EXSZGTLL.js → updateDialogTitleAction-5OSEDGRK.js} +25 -25
- package/{usageCommand-L4OFWXEU.js → usageCommand-WI6SQOPB.js} +2 -2
- package/{usageRebuildCommand-7JR33UHS.js → usageRebuildCommand-WQRLLZAT.js} +3 -3
- package/{windowsSelfUpdate-M4V77OUB.js → windowsSelfUpdate-C7LGVWYX.js} +2 -2
- package/{workloadLifecycle-ZCSQCHG3.js → workloadLifecycle-P2SJVV3S.js} +2 -2
- package/chunk-FGHEF6WI.js +0 -34
- package/chunk-U5LOKQ2R.js +0 -176
- package/chunk-YDRRGVT5.js +0 -142
- package/chunk-YGDYYFRX.js +0 -86
- package/chunk-Z7KE4K3H.js +0 -758
- package/lib-62SWPXNF.js +0 -21042
- /package/{chunk-ANUP75N2.js → chunk-2E4BYAUE.js} +0 -0
|
@@ -1,3 +1,118 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveBuiltinCapability,
|
|
3
|
+
resolveBuiltinSkillEntry
|
|
4
|
+
} from "./chunk-WC3J5SL2.js";
|
|
5
|
+
import {
|
|
6
|
+
asTrimmedNonEmptyStringArray
|
|
7
|
+
} from "./chunk-I42VC5KR.js";
|
|
8
|
+
|
|
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
|
+
}
|
|
55
|
+
];
|
|
56
|
+
var QUICK_PROBE_SUBSTRINGS = [
|
|
57
|
+
"sk-",
|
|
58
|
+
"ghp_",
|
|
59
|
+
"gho_",
|
|
60
|
+
"ghu_",
|
|
61
|
+
"ghs_",
|
|
62
|
+
"ghr_",
|
|
63
|
+
"github_pat_",
|
|
64
|
+
"PRIVATE KEY"
|
|
65
|
+
];
|
|
66
|
+
var CASE_INSENSITIVE_PROBE_REGEX = /bearer|password|passwd|secret_key/i;
|
|
67
|
+
var UNPREFIXED_PROBE_REGEX = /\b[0-9a-fA-F]{32}\.[A-Za-z0-9]{16}\b/;
|
|
68
|
+
function hasPotentialSecrets(text) {
|
|
69
|
+
if (typeof text !== "string" || text.length === 0) return false;
|
|
70
|
+
if (QUICK_PROBE_SUBSTRINGS.some((probe) => text.includes(probe))) return true;
|
|
71
|
+
if (CASE_INSENSITIVE_PROBE_REGEX.test(text)) return true;
|
|
72
|
+
return UNPREFIXED_PROBE_REGEX.test(text);
|
|
73
|
+
}
|
|
74
|
+
function scrubSecrets(text) {
|
|
75
|
+
if (typeof text !== "string" || text.length === 0) {
|
|
76
|
+
return { cleaned: text, redactedCount: 0, matchedKinds: [] };
|
|
77
|
+
}
|
|
78
|
+
if (!hasPotentialSecrets(text)) {
|
|
79
|
+
return { cleaned: text, redactedCount: 0, matchedKinds: [] };
|
|
80
|
+
}
|
|
81
|
+
let cleaned = text;
|
|
82
|
+
let redactedCount = 0;
|
|
83
|
+
const matchedKinds = [];
|
|
84
|
+
for (const pattern of SECRET_PATTERNS) {
|
|
85
|
+
pattern.regex.lastIndex = 0;
|
|
86
|
+
const matches = cleaned.match(pattern.regex);
|
|
87
|
+
if (matches && matches.length > 0) {
|
|
88
|
+
redactedCount += matches.length;
|
|
89
|
+
if (!matchedKinds.includes(pattern.kind)) {
|
|
90
|
+
matchedKinds.push(pattern.kind);
|
|
91
|
+
}
|
|
92
|
+
cleaned = cleaned.replace(pattern.regex, pattern.placeholder);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return { cleaned, redactedCount, matchedKinds };
|
|
96
|
+
}
|
|
97
|
+
function scrubObjectSecrets(val) {
|
|
98
|
+
if (val === null || val === void 0) return val;
|
|
99
|
+
if (typeof val === "string") {
|
|
100
|
+
return scrubSecrets(val).cleaned;
|
|
101
|
+
}
|
|
102
|
+
if (Array.isArray(val)) {
|
|
103
|
+
return val.map((item) => scrubObjectSecrets(item));
|
|
104
|
+
}
|
|
105
|
+
if (typeof val === "object") {
|
|
106
|
+
if (val instanceof Date || val instanceof RegExp) return val;
|
|
107
|
+
const result = {};
|
|
108
|
+
for (const [k, v] of Object.entries(val)) {
|
|
109
|
+
result[k] = scrubObjectSecrets(v);
|
|
110
|
+
}
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
return val;
|
|
114
|
+
}
|
|
115
|
+
|
|
1
116
|
// packages/agent-runtime/toolOutputSanitizer.ts
|
|
2
117
|
var SANITIZE_REPLACEMENT_CHAR = "\uFFFD";
|
|
3
118
|
var MAX_CONTROL_SEQUENCE_CHARS = 256;
|
|
@@ -136,117 +251,6 @@ function sanitizeToolOutputContent(content) {
|
|
|
136
251
|
return typeof content === "string" ? sanitizeToolOutputText(content) : content;
|
|
137
252
|
}
|
|
138
253
|
|
|
139
|
-
// packages/agent-runtime/secretScrubber.ts
|
|
140
|
-
var SECRET_PATTERNS = [
|
|
141
|
-
// 1. PEM 私钥块(高危硬拦截)
|
|
142
|
-
{
|
|
143
|
-
kind: "PRIVATE_KEY",
|
|
144
|
-
placeholder: "[REDACTED:PRIVATE_KEY]",
|
|
145
|
-
regex: /-----BEGIN (?:[A-Z0-9 ]+)?PRIVATE KEY-----[\s\S]+?-----END (?:[A-Z0-9 ]+)?PRIVATE KEY-----/g
|
|
146
|
-
},
|
|
147
|
-
// 2. Anthropic API Key (sk-ant-...)
|
|
148
|
-
{
|
|
149
|
-
kind: "ANTHROPIC_KEY",
|
|
150
|
-
placeholder: "[REDACTED:ANTHROPIC_KEY]",
|
|
151
|
-
regex: /\bsk-ant-[a-zA-Z0-9_\-]{20,}\b/g
|
|
152
|
-
},
|
|
153
|
-
// 3. OpenAI / DeepSeek / 通用 API Key (sk-...)
|
|
154
|
-
{
|
|
155
|
-
kind: "API_KEY",
|
|
156
|
-
placeholder: "[REDACTED:API_KEY]",
|
|
157
|
-
regex: /\bsk-[a-zA-Z0-9_\-]{24,}\b/g
|
|
158
|
-
},
|
|
159
|
-
// 3b. BigModel / 智谱(GLM)API Key:32 位 hex + "." + 16 位字母数字
|
|
160
|
-
// (2026-11 实证:这类 key 没有任何可辨识前缀,此前漏在清洗与入路隔离之外,
|
|
161
|
-
// 用户贴进对话后明文直接进了 prompt / 历史 / 工具日志。)
|
|
162
|
-
{
|
|
163
|
-
kind: "BIGMODEL_KEY",
|
|
164
|
-
placeholder: "[REDACTED:BIGMODEL_KEY]",
|
|
165
|
-
regex: /\b[0-9a-fA-F]{32}\.[A-Za-z0-9]{16}\b/g
|
|
166
|
-
},
|
|
167
|
-
// 4. GitHub 访问令牌 (ghp_..., gho_..., github_pat_...)
|
|
168
|
-
{
|
|
169
|
-
kind: "GITHUB_TOKEN",
|
|
170
|
-
placeholder: "[REDACTED:GITHUB_TOKEN]",
|
|
171
|
-
regex: /\b(?:gh[pousr]_[a-zA-Z0-9]{30,}|github_pat_[a-zA-Z0-9_]{40,})\b/g
|
|
172
|
-
},
|
|
173
|
-
// 5. Bearer Token (JWT / Authorization Bearer)
|
|
174
|
-
{
|
|
175
|
-
kind: "BEARER_TOKEN",
|
|
176
|
-
placeholder: "Bearer [REDACTED:BEARER_TOKEN]",
|
|
177
|
-
regex: /\bBearer\s+[a-zA-Z0-9_\-\.]{25,}\b/gi
|
|
178
|
-
},
|
|
179
|
-
// 6. 常见环境变量或配置中的密码赋值 (PASSWORD=..., PASSWD=...)
|
|
180
|
-
{
|
|
181
|
-
kind: "PASSWORD",
|
|
182
|
-
placeholder: "$1=[REDACTED:PASSWORD]",
|
|
183
|
-
regex: /\b((?:DB_|DATABASE_|ADMIN_|ROOT_|MYSQL_|POSTGRES_)?(?:PASSWORD|PASSWD|SECRET_KEY))\s*=\s*['"]?([^\s'"]{4,})['"]?/gi
|
|
184
|
-
}
|
|
185
|
-
];
|
|
186
|
-
var QUICK_PROBE_SUBSTRINGS = [
|
|
187
|
-
"sk-",
|
|
188
|
-
"ghp_",
|
|
189
|
-
"gho_",
|
|
190
|
-
"ghu_",
|
|
191
|
-
"ghs_",
|
|
192
|
-
"ghr_",
|
|
193
|
-
"github_pat_",
|
|
194
|
-
"PRIVATE KEY",
|
|
195
|
-
"Bearer ",
|
|
196
|
-
"bearer ",
|
|
197
|
-
"PASSWORD",
|
|
198
|
-
"password",
|
|
199
|
-
"PASSWD",
|
|
200
|
-
"SECRET_KEY"
|
|
201
|
-
];
|
|
202
|
-
var UNPREFIXED_PROBE_REGEX = /\b[0-9a-fA-F]{32}\.[A-Za-z0-9]{16}\b/;
|
|
203
|
-
function hasPotentialSecrets(text) {
|
|
204
|
-
if (typeof text !== "string" || text.length === 0) return false;
|
|
205
|
-
if (QUICK_PROBE_SUBSTRINGS.some((probe) => text.includes(probe))) return true;
|
|
206
|
-
return UNPREFIXED_PROBE_REGEX.test(text);
|
|
207
|
-
}
|
|
208
|
-
function scrubSecrets(text) {
|
|
209
|
-
if (typeof text !== "string" || text.length === 0) {
|
|
210
|
-
return { cleaned: text, redactedCount: 0, matchedKinds: [] };
|
|
211
|
-
}
|
|
212
|
-
if (!hasPotentialSecrets(text)) {
|
|
213
|
-
return { cleaned: text, redactedCount: 0, matchedKinds: [] };
|
|
214
|
-
}
|
|
215
|
-
let cleaned = text;
|
|
216
|
-
let redactedCount = 0;
|
|
217
|
-
const matchedKinds = [];
|
|
218
|
-
for (const pattern of SECRET_PATTERNS) {
|
|
219
|
-
pattern.regex.lastIndex = 0;
|
|
220
|
-
const matches = cleaned.match(pattern.regex);
|
|
221
|
-
if (matches && matches.length > 0) {
|
|
222
|
-
redactedCount += matches.length;
|
|
223
|
-
if (!matchedKinds.includes(pattern.kind)) {
|
|
224
|
-
matchedKinds.push(pattern.kind);
|
|
225
|
-
}
|
|
226
|
-
cleaned = cleaned.replace(pattern.regex, pattern.placeholder);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
return { cleaned, redactedCount, matchedKinds };
|
|
230
|
-
}
|
|
231
|
-
function scrubObjectSecrets(val) {
|
|
232
|
-
if (val === null || val === void 0) return val;
|
|
233
|
-
if (typeof val === "string") {
|
|
234
|
-
return scrubSecrets(val).cleaned;
|
|
235
|
-
}
|
|
236
|
-
if (Array.isArray(val)) {
|
|
237
|
-
return val.map((item) => scrubObjectSecrets(item));
|
|
238
|
-
}
|
|
239
|
-
if (typeof val === "object") {
|
|
240
|
-
if (val instanceof Date || val instanceof RegExp) return val;
|
|
241
|
-
const result = {};
|
|
242
|
-
for (const [k, v] of Object.entries(val)) {
|
|
243
|
-
result[k] = scrubObjectSecrets(v);
|
|
244
|
-
}
|
|
245
|
-
return result;
|
|
246
|
-
}
|
|
247
|
-
return val;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
254
|
// packages/ai/agent/toolOutputPolicy.ts
|
|
251
255
|
var PROJECT_INSTRUCTION_MAX_BYTES = 24 * 1024;
|
|
252
256
|
var PROJECT_INSTRUCTION_MAX_CHARS = PROJECT_INSTRUCTION_MAX_BYTES + 2048;
|
|
@@ -307,13 +311,137 @@ function clipToolText(content, maxChars, headRatio, marker = "\n\n[... tool outp
|
|
|
307
311
|
return `${normalized.slice(0, headChars)}${marker}${normalized.slice(-tailChars)}`;
|
|
308
312
|
}
|
|
309
313
|
|
|
314
|
+
// packages/core/agentSkillModes.ts
|
|
315
|
+
var AGENT_SKILL_MODES = [
|
|
316
|
+
"required",
|
|
317
|
+
"recommended",
|
|
318
|
+
"disabled"
|
|
319
|
+
];
|
|
320
|
+
var isAgentSkillMode = (value) => typeof value === "string" && AGENT_SKILL_MODES.includes(value);
|
|
321
|
+
var collectInvalidAgentSkillModes = (skills) => {
|
|
322
|
+
if (!skills || typeof skills !== "object" || Array.isArray(skills)) return [];
|
|
323
|
+
const out = [];
|
|
324
|
+
for (const [slug, value] of Object.entries(skills)) {
|
|
325
|
+
if (value === null) continue;
|
|
326
|
+
if (!isAgentSkillMode(value)) out.push({ slug, value });
|
|
327
|
+
}
|
|
328
|
+
return out;
|
|
329
|
+
};
|
|
330
|
+
var describeAgentSkillModeValue = (value) => {
|
|
331
|
+
let text;
|
|
332
|
+
if (typeof value === "string") {
|
|
333
|
+
text = JSON.stringify(value.length > 40 ? `${value.slice(0, 40)}\u2026` : value);
|
|
334
|
+
} else if (value === void 0) {
|
|
335
|
+
text = "undefined";
|
|
336
|
+
} else {
|
|
337
|
+
try {
|
|
338
|
+
const serialized = JSON.stringify(value);
|
|
339
|
+
text = typeof serialized === "string" ? serialized : String(value);
|
|
340
|
+
} catch {
|
|
341
|
+
text = typeof value;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return text.length > 60 ? `${text.slice(0, 60)}\u2026` : text;
|
|
345
|
+
};
|
|
346
|
+
var formatInvalidAgentSkillModeMessage = (invalid, allowed = AGENT_SKILL_MODES) => `Invalid agent skill mode for "${invalid.slug}": ${describeAgentSkillModeValue(invalid.value)}. Allowed values: ${allowed.join(", ")}.`;
|
|
347
|
+
var isAgentSkillModesFieldShapeValid = (skills) => {
|
|
348
|
+
if (skills === null || skills === void 0) return true;
|
|
349
|
+
return typeof skills === "object" && !Array.isArray(skills);
|
|
350
|
+
};
|
|
351
|
+
var formatInvalidAgentSkillModesFieldMessage = (allowed = AGENT_SKILL_MODES) => `Invalid agent skills field: expected an object mapping slug \u2192 mode (${allowed.join(" | ")}).`;
|
|
352
|
+
|
|
353
|
+
// packages/ai/tools/agentSkillConfig.ts
|
|
354
|
+
var MODES = AGENT_SKILL_MODES;
|
|
355
|
+
var DEFAULT_RECOMMENDED_SKILL_SLUGS = [
|
|
356
|
+
// `worktree-isolation` 已上移为系统层固定前置(agent-runtime/worktreeIsolationPrelude),
|
|
357
|
+
// 不再依赖「相关技能」提示行被发现,也不再是用户可关项——见 skillExploreDirectory 的
|
|
358
|
+
// PLATFORM_CORE_SKILL_SLUGS。注册表解析与 legacy 读取保留。
|
|
359
|
+
"systematic-investigation",
|
|
360
|
+
"show-me",
|
|
361
|
+
// 凭据管理:仓库已有 nolo secret(set/list/run/bind),但技能发现只扫
|
|
362
|
+
// `.agents/skills`,内置的 secrets-manager 不会出现在"可用技能"里。放进默认
|
|
363
|
+
// 提示名单让它至少以一行提示出现(不授工具、不放宽权限)。
|
|
364
|
+
"secrets-manager"
|
|
365
|
+
];
|
|
366
|
+
var asMode = (value) => typeof value === "string" && MODES.includes(value) ? value : null;
|
|
367
|
+
var resolveAgentSkillConfig = (source) => {
|
|
368
|
+
const out = {};
|
|
369
|
+
const skills = source?.skills;
|
|
370
|
+
if (skills && typeof skills === "object" && !Array.isArray(skills)) {
|
|
371
|
+
for (const [rawSlug, rawMode] of Object.entries(skills)) {
|
|
372
|
+
const slug = typeof rawSlug === "string" ? rawSlug.trim() : "";
|
|
373
|
+
const mode = asMode(rawMode);
|
|
374
|
+
if (slug && mode) out[slug] = mode;
|
|
375
|
+
}
|
|
376
|
+
return out;
|
|
377
|
+
}
|
|
378
|
+
for (const slug of asTrimmedNonEmptyStringArray(source?.enabledPacks) ?? []) {
|
|
379
|
+
out[slug] = "required";
|
|
380
|
+
}
|
|
381
|
+
return out;
|
|
382
|
+
};
|
|
383
|
+
var collectAgentSkillConfigIssues = (source) => {
|
|
384
|
+
const issues = [];
|
|
385
|
+
const skills = source?.skills;
|
|
386
|
+
if (skills === void 0 || skills === null) return issues;
|
|
387
|
+
if (typeof skills !== "object" || Array.isArray(skills)) {
|
|
388
|
+
issues.push({ slug: "", value: skills, reason: "invalid-skills-field" });
|
|
389
|
+
return issues;
|
|
390
|
+
}
|
|
391
|
+
for (const [rawSlug, rawMode] of Object.entries(skills)) {
|
|
392
|
+
const slug = rawSlug.trim();
|
|
393
|
+
if (!slug) {
|
|
394
|
+
issues.push({ slug: rawSlug, value: rawMode, reason: "invalid-slug" });
|
|
395
|
+
continue;
|
|
396
|
+
}
|
|
397
|
+
if (!isAgentSkillMode(rawMode)) {
|
|
398
|
+
issues.push({ slug, value: rawMode, reason: "invalid-mode" });
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
return issues;
|
|
402
|
+
};
|
|
403
|
+
var resolveAgentRequiredPackIds = (source) => {
|
|
404
|
+
const config = resolveAgentSkillConfig(source);
|
|
405
|
+
return Object.keys(config).filter((slug) => config[slug] === "required");
|
|
406
|
+
};
|
|
407
|
+
var resolveAgentRecommendedSkillNames = (source, lookup) => {
|
|
408
|
+
const config = resolveAgentSkillConfig(source);
|
|
409
|
+
const resolve = lookup ?? defaultSkillTitleLookup;
|
|
410
|
+
const seen = /* @__PURE__ */ new Set();
|
|
411
|
+
const out = [];
|
|
412
|
+
const push = (slug) => {
|
|
413
|
+
const title = resolve(slug)?.title || slug;
|
|
414
|
+
if (seen.has(title)) return;
|
|
415
|
+
seen.add(title);
|
|
416
|
+
out.push(title);
|
|
417
|
+
};
|
|
418
|
+
for (const slug of Object.keys(config)) {
|
|
419
|
+
if (config[slug] !== "recommended") continue;
|
|
420
|
+
push(slug);
|
|
421
|
+
}
|
|
422
|
+
for (const slug of DEFAULT_RECOMMENDED_SKILL_SLUGS) {
|
|
423
|
+
if (Object.hasOwn(config, slug)) continue;
|
|
424
|
+
push(slug);
|
|
425
|
+
}
|
|
426
|
+
return out;
|
|
427
|
+
};
|
|
428
|
+
var defaultSkillTitleLookup = (slug) => {
|
|
429
|
+
const cap = resolveBuiltinCapability(slug);
|
|
430
|
+
if (cap) return { title: cap.title };
|
|
431
|
+
const skill = resolveBuiltinSkillEntry(slug);
|
|
432
|
+
return skill ? { title: skill.title } : null;
|
|
433
|
+
};
|
|
434
|
+
var isAgentSkillDisabled = (source, slug) => resolveAgentSkillConfig(source)[slug] === "disabled";
|
|
435
|
+
|
|
310
436
|
export {
|
|
311
|
-
sanitizeToolOutputText,
|
|
312
|
-
sanitizeToolOutputContent,
|
|
313
437
|
SECRET_PATTERNS,
|
|
314
438
|
hasPotentialSecrets,
|
|
315
439
|
scrubSecrets,
|
|
316
440
|
scrubObjectSecrets,
|
|
441
|
+
SANITIZE_REPLACEMENT_CHAR,
|
|
442
|
+
MAX_CONTROL_SEQUENCE_CHARS,
|
|
443
|
+
sanitizeToolOutputText,
|
|
444
|
+
sanitizeToolOutputContent,
|
|
317
445
|
PROJECT_INSTRUCTION_MAX_BYTES,
|
|
318
446
|
PROJECT_INSTRUCTION_MAX_CHARS,
|
|
319
447
|
isCompleteInstructionOutput,
|
|
@@ -322,5 +450,15 @@ export {
|
|
|
322
450
|
resolveToolOutputProfile,
|
|
323
451
|
resolveHistoricalToolContentCap,
|
|
324
452
|
projectToolMessageContent,
|
|
325
|
-
clipToolText
|
|
453
|
+
clipToolText,
|
|
454
|
+
collectInvalidAgentSkillModes,
|
|
455
|
+
describeAgentSkillModeValue,
|
|
456
|
+
formatInvalidAgentSkillModeMessage,
|
|
457
|
+
isAgentSkillModesFieldShapeValid,
|
|
458
|
+
formatInvalidAgentSkillModesFieldMessage,
|
|
459
|
+
resolveAgentSkillConfig,
|
|
460
|
+
collectAgentSkillConfigIssues,
|
|
461
|
+
resolveAgentRequiredPackIds,
|
|
462
|
+
resolveAgentRecommendedSkillNames,
|
|
463
|
+
isAgentSkillDisabled
|
|
326
464
|
};
|
|
@@ -5,6 +5,9 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
asRecordOrEmpty
|
|
7
7
|
} from "./chunk-KX6YBIHG.js";
|
|
8
|
+
import {
|
|
9
|
+
MODEL_TIER_GUIDANCE
|
|
10
|
+
} from "./chunk-HEVRQGGH.js";
|
|
8
11
|
import {
|
|
9
12
|
dialogIdFromKey,
|
|
10
13
|
isSupportedDialogId,
|
|
@@ -581,101 +584,6 @@ function shouldFetchAgentRuntimeRecordRemotely(dbKey) {
|
|
|
581
584
|
return /^agent(-pub)?-/.test(dbKey);
|
|
582
585
|
}
|
|
583
586
|
|
|
584
|
-
// packages/ai/agent/dispatchSelectionPolicy.ts
|
|
585
|
-
var MODEL_TIERS = [
|
|
586
|
-
{
|
|
587
|
-
tier: "extreme",
|
|
588
|
-
models: ["GPT-6.2 Astra", "GPT-6 Astra", "Claude Opus 5.5"],
|
|
589
|
-
pattern: /^(?:gpt-6(?:[.-]2)?-astra|claude-opus-5[.-]5)(?:$|[-@])/
|
|
590
|
-
},
|
|
591
|
-
{
|
|
592
|
-
tier: "complex",
|
|
593
|
-
models: [
|
|
594
|
-
"GPT-6.2 Sol",
|
|
595
|
-
"GPT-6.1 Sol",
|
|
596
|
-
"Gemini 4 Carbon",
|
|
597
|
-
"Gemini 4 Argon",
|
|
598
|
-
"Claude Fable 5.1",
|
|
599
|
-
"Claude Sonnet 5.5",
|
|
600
|
-
"MiMo V2.6 Pro",
|
|
601
|
-
"Kimi K3",
|
|
602
|
-
"Gemini 2.5 Pro"
|
|
603
|
-
],
|
|
604
|
-
pattern: /^(?:gpt-6[.-](?:2|1)-sol|gemini-4-(?:carbon|argon)|claude-fable-5[.-]1|claude-sonnet-5[.-]5|mimo-v2[.-]6-pro|kimi-k3|gemini-2[.-]5-pro)(?:$|[-@])/
|
|
605
|
-
},
|
|
606
|
-
{
|
|
607
|
-
tier: "normal",
|
|
608
|
-
models: [
|
|
609
|
-
"Gemini 4 Hydrogen",
|
|
610
|
-
"DeepSeek Flash\uFF08\u5404\u4EE3\uFF09",
|
|
611
|
-
"LongCat 2.5",
|
|
612
|
-
"Gemini 3.8 Flash",
|
|
613
|
-
"GLM 5.3 Flash"
|
|
614
|
-
],
|
|
615
|
-
pattern: /^(?:gemini-4-hydrogen|deepseek-(?:[a-z0-9.-]+-)?flash(?:[-@].*)?|longcat-2[.-]5|gemini-3[.-]8-flash|glm-5[.-]3-flash)(?:$|[-@])/
|
|
616
|
-
},
|
|
617
|
-
{
|
|
618
|
-
tier: "easy",
|
|
619
|
-
models: ["MiniMax M3.1 Flash", "GPT-6 Luna"],
|
|
620
|
-
pattern: /^(?:(?:minimax-)?m3[.-]1-flash|gpt-6-luna)(?:$|[-@])/
|
|
621
|
-
}
|
|
622
|
-
];
|
|
623
|
-
var MODEL_TIER_GUIDANCE = MODEL_TIERS.map(
|
|
624
|
-
({ tier, models }) => `${tier}: ${models.join("\u3001")}`
|
|
625
|
-
).join("\n");
|
|
626
|
-
var DIFFICULTY_GRADING_ORDER = `- **\u5148\u5224\u6863\u518D\u9009\u6A21\u578B**\uFF08\u89C4\u5212\u590D\u6742\u2260\u6267\u884C\u590D\u6742\uFF09\uFF1A\u5148\u5B9A\u5B50\u4EFB\u52A1 difficulty \u518D\u9009\u8BE5\u6863\u80DC\u4EFB\u6A21\u578B\uFF1B\u91CD\u8981\u5EA6\u3001\u6587\u4EF6\u6570\u3001\u8017\u65F6\u3001\u53D1\u5E03\u5B89\u5168\u76EE\u5F55\u4E0D\u5347\u6863\uFF0C\u300C\u66F4\u7A33\u59A5/\u66F4\u5B89\u5168/\u72EC\u7ACB review\u300D\u4E0D\u662F\u5347\u6863\u7406\u7531\uFF0C\u9009\u8DB3\u591F\u80DC\u4EFB\u7684\u6700\u4F4E\u6863\uFF0C\u4E0D\u4E3A\u964D\u6863\u62C6\u788E\u3002`;
|
|
627
|
-
var DIFFICULTY_GRADING_TIERS = ` - \u56DB\u6863\uFF1Aeasy\uFF1D\u6839\u56E0\u4E0E\u505A\u6CD5\u660E\u786E\u3001\u5C40\u90E8\u53EF\u9A8C\uFF1Bnormal\uFF1D\u6309\u65E2\u5B9A\u5951\u7EA6\u5B9E\u73B0/\u9A8C\u8BC1\u6216\u5C40\u90E8\u5B9A\u4F4D\uFF1Bcomplex\uFF1D\u591A\u6839\u56E0\u3001\u8DE8\u72B6\u6001\u6216\u5E76\u53D1\u517C\u5BB9\u53D6\u820D\uFF1Bextreme\uFF1D\u67B6\u6784\u672A\u5B9A\u6216\u5B89\u5168/\u5B8C\u6574\u6027\u91CD\u5927\u53D6\u820D\u3002\u5347\u6863\u987B\u6307\u51FA\u672C\u5757\u672A\u51B3\u70B9\uFF0C\u4E0D\u6309\u9879\u76EE\u6574\u4F53\u5B9A\u6863\u3002\u5B9E\u73B0\u4E0E\u590D\u5BA1\u91CD\u5224\uFF0C\u4E0D\u7EE7\u627F\u89C4\u5212\u6863\u3002`;
|
|
628
|
-
function resolveModelTier(model) {
|
|
629
|
-
if (typeof model !== "string") return "unknown";
|
|
630
|
-
const id = model.trim().toLowerCase().split("/").at(-1).replace(/\s+/g, "-");
|
|
631
|
-
return MODEL_TIERS.find(({ pattern }) => pattern.test(id))?.tier ?? "unknown";
|
|
632
|
-
}
|
|
633
|
-
function normalizeDispatchDifficulty(value) {
|
|
634
|
-
if (value === "easy" || value === "\u7B80\u5355") return "easy";
|
|
635
|
-
if (value === "complex" || value === "\u590D\u6742") return "complex";
|
|
636
|
-
if (value === "extreme" || value === "\u6781\u7AEF\u590D\u6742" || value === "\u6781\u5176\u590D\u6742")
|
|
637
|
-
return "extreme";
|
|
638
|
-
return "normal";
|
|
639
|
-
}
|
|
640
|
-
function normalizeSelectionReason(value) {
|
|
641
|
-
if (typeof value !== "string") return void 0;
|
|
642
|
-
const trimmed = value.trim();
|
|
643
|
-
return trimmed.length > 0 ? trimmed : void 0;
|
|
644
|
-
}
|
|
645
|
-
function checkDispatchSelection(input) {
|
|
646
|
-
const dimension = input.dimension === "design_frontend" || input.dimension === "writing" ? input.dimension : "general";
|
|
647
|
-
const difficulty = normalizeDispatchDifficulty(input.difficulty);
|
|
648
|
-
const modelTier = resolveModelTier(input.model);
|
|
649
|
-
const status = modelTier === "unknown" ? "unknown" : modelTier === difficulty ? "matched" : "mismatch";
|
|
650
|
-
const selectionReason = normalizeSelectionReason(input.selectionReason);
|
|
651
|
-
const message = status === "matched" ? void 0 : status === "unknown" ? "\u6A21\u578B\u6863\u4F4D\u672A\u77E5\uFF1B\u6309\u9886\u57DF\u4E0E\u53EF\u7528\u6027\u5224\u65AD\uFF0C\u4E0D\u963B\u65AD\uFF0C\u5DF2\u542F\u52A8\u52FF\u81EA\u52A8\u91CD\u6D3E\u3002" : selectionReason ? "\u6863\u4F4D\u4E0E\u96BE\u5EA6\u4E0D\u4E00\u81F4\uFF1B\u5DF2\u7ED9\u51FA\u8DE8\u6863\u7406\u7531\uFF0C\u4E0D\u963B\u65AD\uFF0C\u5DF2\u542F\u52A8\u52FF\u81EA\u52A8\u91CD\u6D3E\u3002" : "\u6863\u4F4D\u4E0E\u96BE\u5EA6\u4E0D\u4E00\u81F4\uFF1B\u8DE8\u6863\u6D3E\u53D1\u9700\u5728 selectionReason \u8BF4\u660E\u7406\u7531\u3002";
|
|
652
|
-
return {
|
|
653
|
-
dimension,
|
|
654
|
-
difficulty,
|
|
655
|
-
modelTier,
|
|
656
|
-
status,
|
|
657
|
-
...message ? { message } : {},
|
|
658
|
-
...selectionReason ? { selectionReason } : {}
|
|
659
|
-
};
|
|
660
|
-
}
|
|
661
|
-
function checkDispatchSelectionAdmission(input) {
|
|
662
|
-
const check = checkDispatchSelection(input);
|
|
663
|
-
if (check.status !== "mismatch" || check.selectionReason)
|
|
664
|
-
return { ok: true, check };
|
|
665
|
-
const error = {
|
|
666
|
-
code: "selection_reason_required",
|
|
667
|
-
message: `\u8DE8\u6863\u9009\u62E9\u7F3A\u5C11 selectionReason\uFF1A\u6863\u4F4D ${check.modelTier} \u4E0E\u96BE\u5EA6 ${check.difficulty} \u4E0D\u4E00\u81F4\uFF0C\u8BF7\u8865\u5145\u672C\u6B21\u8DE8\u6863\u7684\u5177\u4F53\u7406\u7531\u540E\u518D\u542F\u52A8\u3002`,
|
|
668
|
-
hint: "\u8865\u4E00\u53E5\u672C\u6B21\u4E3A\u4EC0\u4E48\u8FD9\u6837\u8DE8\u6863\uFF08\u5982\u9886\u57DF\u4F18\u52BF\u3001\u7528\u6237\u660E\u786E\u6307\u5B9A\uFF09\u5373\u53EF\uFF1B\u53EA\u6821\u9A8C\u7406\u7531\u662F\u5426\u5B58\u5728\uFF0C\u4E0D\u4EE3\u8868\u5DF2\u6838\u5B9E\u7528\u6237\u6388\u6743\u3001\u989D\u5EA6/\u8D39\u7528\u6743\u9650\u6216\u7F51\u7EDC\u53EF\u7528\u6027\u3002"
|
|
669
|
-
};
|
|
670
|
-
return { ok: false, check, error };
|
|
671
|
-
}
|
|
672
|
-
function assertDispatchSelectionAdmission(input) {
|
|
673
|
-
const admission = checkDispatchSelectionAdmission(input);
|
|
674
|
-
if (!admission.ok && admission.error)
|
|
675
|
-
throw new Error(`${admission.error.message} ${admission.error.hint}`);
|
|
676
|
-
return admission.check;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
587
|
// packages/ai/agent/agentSelectionPriority.ts
|
|
680
588
|
function parseAgentTimestamp(value) {
|
|
681
589
|
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
@@ -726,7 +634,7 @@ ${AGENT_SELECTION_PRIORITY_GROUPS.map((group, index) => ` (${index + 1})
|
|
|
726
634
|
\u6B64\u6392\u5E8F\u662F\u5019\u9009\u4F18\u5148\u7EA7\u5206\u7EC4\uFF08\u4E0D\u662F\u6A21\u578B\u80FD\u529B tier\uFF09\uFF0C\u4E0D\u4EE3\u8868\u300C\u6392\u7B2C\u4E00\u7684\u5C31\u8BE5\u9009\u300D\uFF1B\u7ED3\u5408\u4E0B\u8FF0\u9886\u57DF\u5339\u914D\u3001\u6863\u4F4D\u53C2\u8003\u4E0E\u5F53\u6B21\u53EF\u7528\u6027\u6311\u9009\uFF08reviewer \u89C1\u300Creviewer \u9009\u4EBA\u300D\uFF09\u3002
|
|
727
635
|
- \u6536\u85CF\u4F18\u5148\u786C\u95E8\uFF08\u8986\u76D6\u9AD8\u590D\u6742\u5EA6\u6863\u6210\u672C\u95E8\uFF09\uFF1A\u5B58\u5728\u53EF\u7528\u4E14\u9002\u5408\u4EFB\u52A1\u3001requiresPaidApproval=false \u7684\u6536\u85CF\u5019\u9009\u65F6\uFF0C\u4E0D\u6539\u6D3E\u9700\u5E73\u53F0\u8D39\u7528\u786E\u8BA4\u7684\u5019\u9009\uFF1B\u53EA\u6709\u6536\u85CF Agent \u786E\u8BA4\u4E0D\u53EF\u7528\u540E\u624D\u5141\u8BB8\u6D3E\u5E73\u53F0 Agent\uFF0C\u4E14\u5F53\u6B21\u8BF4\u660E\u5E76\u83B7\u8D39\u7528\u6388\u6743\u3002favorite + platform_credits \u53EA\u8868\u793A\u504F\u597D\uFF0C\u4E0D\u4EE3\u8868\u514D\u8D39\u6216\u5DF2\u6388\u6743\uFF1B\u8D39\u7528\u5224\u636E\u89C1\u4E0A\u3002\u6BCF\u6B21 startAgentRun \u90FD\u521B\u5EFA\u72EC\u7ACB\u7684 run/dialog\uFF0C\u5E76\u884C\u7528\u5404\u81EA runId\u3001\u540C\u4E00 batchId\u3002
|
|
728
636
|
- \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
|
|
729
|
-
- reset-aware economics\
|
|
637
|
+
- reset-aware economics\uFF1A\u4F18\u5148\u53C2\u8003 listAgents \u6309\u8BA2\u9605\u91CD\u7F6E\u7A97\u53E3\u6216\u6309\u91CF\u5355\u4EF7\u8BA1\u7B97\u7684 tierHints\uFF0C\u4EC5\u4F5C\u540C\u6863\u3001\u53EF\u7528\u4E14\u65E0\u9700\u6263\u8D39\u786E\u8BA4\u7684\u7ECF\u6D4E\u504F\u597D\uFF1B\u4E0D\u8986\u76D6\u6536\u85CF\u786C\u95E8\u3001\u9886\u57DF\u80DC\u4EFB\u6216\u6263\u8D39\u6388\u6743\u3002
|
|
730
638
|
- isOwned=true\u3001isOAuth=true \u6216 apiSource="custom" \u4E0D\u8BC1\u660E\u8D39\u7528\u6388\u6743\u3002
|
|
731
639
|
- \u514D\u8BE2\u95EE\u8FB9\u754C\uFF08\u6307\u9488\uFF09\uFF1A\u6392\u5E8F\u540E\u4E0D\u4E3A\u300C\u9009\u8C01\u300D\u518D\u95EE\u7528\u6237\uFF1B\u4EC5\u5728 requiresPaidApproval=false \u7684\u5019\u9009\u95F4\u9759\u9ED8\u6362\u4EE3\uFF08\u4E0D\u5F97\u56E0\u6B64\u9759\u9ED8\u6539\u6D3E platform_credits \u5F52\u5C5E\u4E14\u9700\u786E\u8BA4\u7684\u901A\u9053\uFF09\u3002\u5E73\u53F0\u8D39\u7528\u6388\u6743\u3001429 \u6539\u6D3E\u544A\u77E5\u4E0E\u672A\u77E5\u8D39\u7528\u5148\u95EE\u7167\u65E7\uFF0C\u89C1\u540C\u6CE8\u5165\u5B89\u5168\u95E8\u3002
|
|
732
640
|
- \u89C4\u5212\u5373\u9009\u4EBA\uFF1A\u8DE8\u6863\u5199\u5177\u4F53 selectionReason\uFF08\u7528\u6237\u6307\u5B9A/\u9886\u57DF\u4F18\u52BF/\u771F\u5B9E\u901A\u9053\u5931\u8D25/\u65E0\u5408\u9002\u5019\u9009\u7B49\uFF09\uFF0C\u4FDD\u7559\u771F\u5B9E\u96BE\u5EA6\u3001\u4E0D\u6539\u5199 difficulty \u53BB\u8FC1\u5C31\u73B0\u6210\u901A\u9053\uFF1B\u53EA\u6821\u9A8C\u7406\u7531\u5B58\u5728\u3001\u4E0D\u4F2A\u79F0\u5DF2\u6838\u5B9E\u4E8B\u5B9E\uFF0C\u4E0D\u987B\u5148\u5236\u9020\u4F4E\u6863\u5931\u8D25\uFF0C\u4E5F\u4E0D\u4F5C\u4E3A\u963B\u65AD\u6216\u81EA\u52A8\u53D6\u6D88\u6D3E\u53D1\u7684\u6761\u4EF6\u3002
|
|
@@ -737,8 +645,9 @@ ${MODEL_TIER_GUIDANCE}
|
|
|
737
645
|
\u56FE\u50CF\u6A21\u578B\u53EA\u7528\u4E8E\u56FE\u50CF\u4EFB\u52A1\uFF0C\u4E0D\u7528\u4E8E\u4EE3\u7801 / \u6587\u672C\u4EFB\u52A1\u3002
|
|
738
646
|
\u6A21\u578B\u6863\u4F4D\u53EA\u53D6\u5171\u4EAB\u4EBA\u5DE5\u6620\u5C04\uFF1B\u672A\u77E5\u6A21\u578B\u4FDD\u6301 unknown \u4E14\u4ECD\u53EF\u7528\uFF0C\u4E0D\u7531 LLM \u81EA\u5C01\u6863\u4F4D\uFF0C\u4E0D\u9ED8\u8BA4\u9876\u6863\u3001\u4E0D\u5411\u7528\u6237\u7D22\u8981\u5B9A\u6863\u3002
|
|
739
647
|
\u9886\u57DF\u5177\u4F53\u504F\u597D\u4EC5\u9002\u7528\u4E8E\u5BF9\u5E94 dimension\uFF1Adesign_frontend\uFF08\u8BBE\u8BA1 / \u524D\u7AEF\uFF09\u9886\u57DF\u5185\u9ED8\u8BA4\u6A21\u578B\u5BB6\u65CF\u504F\u597D\u4E3A Claude \u2192 Gemini \u2192 GPT\uFF1B\u6309\u4EFB\u52A1 difficulty \u4E0E\u5171\u4EAB\u4EBA\u5DE5\u6A21\u578B\u6863\u4F4D\u6620\u5C04\uFF0C\u5728\u504F\u597D\u5BB6\u65CF\u4E2D\u9009\u80DC\u4EFB\u7684\u5408\u9002\u6863\u4F4D\uFF0C\u5BB6\u65CF\u987A\u5E8F\u4E0D\u4EE3\u8868\u667A\u80FD\u6863\u4F4D\u6392\u540D\u3002general\uFF08\u901A\u7528\uFF09\u4E0D\u9002\u7528\u6B64\u5BB6\u65CF\u987A\u5E8F\uFF1Bwriting\uFF08\u5199\u4F5C\uFF09\u4ECD\u4E3A Gemini \u4F18\u5148\u4E8E\u5176\u4ED6\u6A21\u578B\u3002\u672A\u77E5\u6863\u4F4D\u4FDD\u6301 unknown\uFF0C\u4E0D\u63A8\u5B9A\u5BB6\u65CF\u5185\u80FD\u529B\u6392\u540D\u3002\u5176\u4F59\u6A21\u578B\u5728\u5BF9\u5E94\u7EF4\u5EA6\u672A\u77E5\uFF0C\u4E0D\u63A8\u5B9A\u5B8C\u6574\u6392\u540D\u3002
|
|
648
|
+
\u540C\u6863\u53EF\u7528\u4E14\u65E0\u9700\u5E73\u53F0\u6263\u8D39\u65F6\uFF1A\u72EC\u7ACB\u5BA1\u67E5/\u5B89\u5168\u5951\u7EA6\u6311\u523A\u504F\u4E25\u82DB GPT\uFF1B\u524D\u7AEF\u8BBE\u8BA1/\u7CBE\u7EC6\u91CD\u6784\u504F Claude\uFF1B\u5168\u5C40\u7EDF\u7B79/\u957F\u4E0A\u4E0B\u6587\u4E32\u8054\u504F Gemini\u3002
|
|
740
649
|
\u9886\u57DF\u504F\u597D\u53EF\u4F5C\u4E3A\u8DE8\u6863\u9009\u62E9\u7406\u7531\uFF0C\u4E0D\u8868\u793A\u4E0D\u80FD\u6362\u6863\uFF1B\u504F\u597D\u4E0D\u8986\u76D6\u771F\u5B9E\u80FD\u529B\u9650\u5236\u3001\u8D39\u7528\u6388\u6743\u3001\u4F5C\u8005\u56DE\u907F\u4E0E\u5F53\u6B21\u53EF\u7528\u6027\uFF0C\u4E0D\u5F97\u56E0\u4E3A\u300C\u8BBE\u8BA1\u4EFB\u52A1\u504F\u597D Opus\u300D\u5C31\u81EA\u52A8\u6D88\u8017\u5E73\u53F0\u79EF\u5206\u3002
|
|
741
|
-
\u5DE5\u5177\u4EC5\
|
|
650
|
+
\u5DE5\u5177\u4EC5\u5347 \u22652 \u6863\u987B\u5148\u6709 selectionReason\uFF0C\u5176\u4F59\u4E0D\u7B26\u53EA\u63D0\u9192\u3001\u7167\u5E38\u542F\u52A8\uFF0C\u4E0D\u5F3A\u5236\u9009\u4EBA\u3001\u4E0D\u81EA\u52A8\u53D6\u6D88\u91CD\u6D3E\uFF1B\u6D3E\u53D1 Agent \u81EA\u884C\u7ED3\u5408\u9886\u57DF\u4F18\u52BF\u3001\u771F\u5B9E\u989D\u5EA6/\u7F51\u7EDC\u4E0E\u5019\u9009\u53EF\u7528\u6027\u3001\u7528\u6237\u6307\u5B9A\u4F5C\u5224\u65AD\u3002\u901F\u5EA6\u89C4\u5219\u7EDF\u4E00\u89C1\u5E38\u9A7B\u300C\u6D3E\u53D1\u9009\u4EBA \xB7 \u53EF\u7528\u6027\u4E0E\u901F\u5EA6\u300D\uFF0C\u4E0D\u5F97\u636E\u901F\u5EA6\u63A8\u5BFC\u6A21\u578B\u6863\u4F4D\u3002
|
|
742
651
|
- \u53EF\u7528\u6027\u8BC1\u636E\uFF1A\u533A\u5206\u5F53\u6B21\u771F\u5B9E\u5931\u8D25\u3001\u9002\u7528\u4E14\u4ECD\u6709\u6548\u7684 quota\u3001\u8FC7\u671F\u53C2\u8003\u548C\u672A\u77E5\u3002\u89C4\u5212\u5217\u8868\u4E0E\u63A8\u8350\u4E0D\u6309\u51B7\u5374\u786C\u8FC7\u6EE4\uFF1B\u901A\u7528\u6267\u884C\u53EF\u7528\u4E0A\u9762\u7684\u6709\u6548 quota \u89C4\u5219\uFF1Breview \u81EA\u8EAB\u515C\u5E95\u4ECD\u987B\u5176\u4ED6\u5408\u89C4\u5019\u9009\u7684\u5F53\u6B21\u9519\u8BEF\u8BC1\u636E\uFF0C\u4E0D\u7528 quota \u6807\u6CE8\u66FF\u4EE3\u3002
|
|
743
652
|
- 429 \u9650\u6D41\u4E0E\u77E5\u60C5\u6743\u5951\u7EA6\uFF1A\u4EFB\u4F55\u7528\u6237\u79C1\u6709\u51ED\u636E\u4E0E\u81EA\u5EFA Agent\uFF08billingSource \u4E3A user_subscription / owner_subscription / user_api / local\uFF0C\u6216 isOwned=true\uFF09\u5728 listAgents \u7684 agents[].availabilityStatus \u4E3A rate_limited \u6216 quota_exhausted \u65F6\uFF0C\u7981\u6B62\u9759\u9ED8\u8DF3\u8FC7\uFF1B\u6539\u6D3E\u5E73\u53F0 Agent\uFF08\u6D88\u8017\u5E73\u53F0\u79EF\u5206\uFF09\u524D\u5FC5\u987B\u5728\u56DE\u590D\u4E2D\u544A\u77E5\u7528\u6237\uFF1A\u54EA\u4E2A\u8BA2\u9605/\u81EA\u5EFA agent \u9650\u6D41\u3001\u9884\u8BA1\u4F55\u65F6\u6062\u590D\uFF08nextAvailableAt\uFF09\u3001\u672C\u6B21\u5C06\u6263\u5E73\u53F0\u79EF\u5206\uFF1BavailabilityStatus \u4E0E nextAvailableAt \u4EC5\u662F\u53C2\u8003\u4FE1\u606F\uFF0C\u4E0D\u62E6\u6D3E\u53D1\uFF0C\u4E0D\u5F97\u4EC5\u51ED\u51B7\u5374\u6807\u6CE8\u6392\u9664\u5019\u9009\uFF1B\u7528\u6237\u4ECD\u53EF\u7167\u5E38\u6D3E\u53D1\u5E76\u83B7\u5F97\u4E0A\u6E38\u771F\u5B9E\u7ED3\u679C\u3002`;
|
|
744
653
|
|
|
@@ -791,6 +700,8 @@ var CLOSED_OBJECT_SCHEMA_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
|
791
700
|
function stringToolParam(description) {
|
|
792
701
|
return { type: "string", description };
|
|
793
702
|
}
|
|
703
|
+
var READ_DIALOG_TOOL_DESCRIPTION = `Read a persisted dialog (meta + messages) by full dbKey (dialog-<userId>-<id>) or dialog URL; use listDialogs when unclear. A bare id only resolves for the currently logged-in user \u2014 pass user/server. For runs, do not poll a running dialog's full transcript: prefer controlAgentRun, else mode="status" for a compact snapshot; read the transcript only after done/failed/cancelled. Responses are budgeted: reasoning_content, tool_calls, tool results and metadata are head-truncated (truncated, messagesTotal/messagesReturned, omittedChars). For review or verification take diffs from the worktree instead of the full transcript.`;
|
|
704
|
+
var LIST_AGENTS_TOOL_DESCRIPTION = "Default scope='all': dedupe own/favorites + marketplace. scope='public': shared/marketplace only; check billingSource for credits. Copy runnable agentKey verbatim into startAgentRun, never infer from display name. planningRecommendation incl. requiresPaidApproval advises, never authorizes. availabilityStatus/availabilityReason/nextAvailableAt advisory, not gates (unavailableCount). Same-batch unknown-credential fan-out is guarded; sharing a credential alone is not a dependency. allowUnknownCredential only if credentials are confirmed independent.";
|
|
794
705
|
function buildNoloWorkspaceOpenAiTools(args) {
|
|
795
706
|
const toolNames = new Set(args.toolNames ?? []);
|
|
796
707
|
const tools = [];
|
|
@@ -816,7 +727,7 @@ function buildNoloWorkspaceOpenAiTools(args) {
|
|
|
816
727
|
limit: { type: "integer", description: "Maximum dialogs to return." },
|
|
817
728
|
space: stringToolParam("Optional space id or URL.")
|
|
818
729
|
});
|
|
819
|
-
add("readDialog",
|
|
730
|
+
add("readDialog", READ_DIALOG_TOOL_DESCRIPTION, {
|
|
820
731
|
dialog: stringToolParam("Dialog dbKey (dialog-<userId>-<id>), dialog URL, or bare id (resolved against user/current account)."),
|
|
821
732
|
mode: {
|
|
822
733
|
type: "string",
|
|
@@ -851,19 +762,19 @@ function buildNoloWorkspaceOpenAiTools(args) {
|
|
|
851
762
|
description: "Confirmed dialog ids or dbKeys to delete."
|
|
852
763
|
}
|
|
853
764
|
}, ["query"]);
|
|
854
|
-
add("listAgents",
|
|
855
|
-
query: stringToolParam("
|
|
856
|
-
scope: { type: "string", enum: ["all", "public"], description: "
|
|
857
|
-
publicOnly: { type: "boolean", description: "Deprecated
|
|
858
|
-
showUnavailable: { type: "boolean", description: "Deprecated no-op
|
|
859
|
-
verbose: { type: "boolean", description: "
|
|
860
|
-
compact: { type: "boolean", description: "
|
|
861
|
-
limit: { type: "number", description: "
|
|
862
|
-
offset: { type: "number", description: "
|
|
863
|
-
fragmentOffset: { type: "integer", description: "
|
|
864
|
-
fragmentAgentKey: stringToolParam("Exact
|
|
865
|
-
fragmentDigest: stringToolParam("SHA-256
|
|
866
|
-
space: stringToolParam("
|
|
765
|
+
add("listAgents", LIST_AGENTS_TOOL_DESCRIPTION, {
|
|
766
|
+
query: stringToolParam("Case-insensitive substring: name/model/provider/handle/agentKey."),
|
|
767
|
+
scope: { type: "string", enum: ["all", "public"], description: "all (default) or public only." },
|
|
768
|
+
publicOnly: { type: "boolean", description: "Deprecated alias for scope='public'." },
|
|
769
|
+
showUnavailable: { type: "boolean", description: "Deprecated no-op; cooldown agents remain listed." },
|
|
770
|
+
verbose: { type: "boolean", description: "Full safe-summary details when supported." },
|
|
771
|
+
compact: { type: "boolean", description: "Compact selection/admission fields; omit verbose text." },
|
|
772
|
+
limit: { type: "number", description: "Page size." },
|
|
773
|
+
offset: { type: "number", description: "Candidate offset." },
|
|
774
|
+
fragmentOffset: { type: "integer", description: "Oversized: 0 then nextFragmentOffset; same offset, filters, fragmentAgentKey and returned fragmentDigest." },
|
|
775
|
+
fragmentAgentKey: stringToolParam("Exact oversized response agentKey."),
|
|
776
|
+
fragmentDigest: stringToolParam("First-fragment SHA-256; required later to detect changes."),
|
|
777
|
+
space: stringToolParam("Space ID or URL.")
|
|
867
778
|
});
|
|
868
779
|
add("readAgent", "Read one agent's full config by exact agentKey returned by listAgents (agent-<userId>-<id> or agent-pub-<id>); do not use the display name.", {
|
|
869
780
|
agent: stringToolParam("Exact agentKey from listAgents (preferred; copy verbatim; plain id or URL are compatibility fallbacks).")
|
|
@@ -880,17 +791,17 @@ function buildNoloWorkspaceOpenAiTools(args) {
|
|
|
880
791
|
add("readSkillDoc", "Read one skill doc in the Nolo workspace.", {
|
|
881
792
|
doc: stringToolParam("Skill doc/page key.")
|
|
882
793
|
}, ["doc"]);
|
|
883
|
-
add("loadSkill", "
|
|
884
|
-
name: stringToolParam("Legacy
|
|
794
|
+
add("loadSkill", "Return full skill instructions inline. Use legacy name alone (lists skills if missing), or one exact source without name: space+dbKey, builtin+slug, project+projectBinding+relativePath. Do not mix selectors. Server: space/builtin; CLI/desktop: builtin/project.", {
|
|
795
|
+
name: stringToolParam("Legacy discovery name only."),
|
|
885
796
|
source: {
|
|
886
797
|
type: "string",
|
|
887
798
|
enum: ["space", "builtin", "project"],
|
|
888
|
-
description: "Exact
|
|
799
|
+
description: "Exact source; omit name."
|
|
889
800
|
},
|
|
890
|
-
dbKey: stringToolParam("
|
|
891
|
-
slug: stringToolParam("
|
|
892
|
-
projectBinding: stringToolParam("
|
|
893
|
-
relativePath: stringToolParam("Project-relative
|
|
801
|
+
dbKey: stringToolParam("Space skill document dbKey."),
|
|
802
|
+
slug: stringToolParam("Builtin skill slug."),
|
|
803
|
+
projectBinding: stringToolParam("Project: authorized absolute root matching executor cwd."),
|
|
804
|
+
relativePath: stringToolParam("Project-relative SKILL.md under .agents/skills/.")
|
|
894
805
|
});
|
|
895
806
|
add("listTables", "List tables in the current user scope or an optional space scope.", {
|
|
896
807
|
limit: { type: "integer", description: "Maximum tables to return." },
|
|
@@ -1347,10 +1258,7 @@ var AGENT_THREAD_ACTIVE_STATUSES = ["pending", "running"];
|
|
|
1347
1258
|
var AGENT_THREAD_TERMINAL_STATUSES = ["done", "failed", "cancelled", "orphaned"];
|
|
1348
1259
|
|
|
1349
1260
|
export {
|
|
1350
|
-
|
|
1351
|
-
DIFFICULTY_GRADING_TIERS,
|
|
1352
|
-
resolveModelTier,
|
|
1353
|
-
assertDispatchSelectionAdmission,
|
|
1261
|
+
resolveAgentSelectionPriority,
|
|
1354
1262
|
compareAgentSelection,
|
|
1355
1263
|
AGENT_SELECTION_PRIORITY_INSTRUCTIONS,
|
|
1356
1264
|
DEFAULT_READ_DIALOG_MAX_RESPONSE_CHARS,
|