nolo-cli 0.157.0-alpha.1 → 0.157.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/{_executeModel-5WS2PA62.js → _executeModel-ZIQHOREX.js} +55 -55
- package/{accountResolver-7RYB4D2P.js → accountResolver-55EDKEIK.js} +1 -1
- package/{action-ZJYUBXFC.js → action-GPPJC5TI.js} +5 -5
- package/{addContentAction-TVHB4526.js → addContentAction-XJQEJ4XW.js} +8 -8
- package/{addDialogAgentAction-FDPBU6K6.js → addDialogAgentAction-5WZX5CAY.js} +7 -7
- package/{agentDeleteCommand-Q6M4F3U6.js → agentDeleteCommand-LQSOJEXY.js} +75 -76
- package/{agentEmailCommands-FNH6FEHS.js → agentEmailCommands-HTPKXONW.js} +78 -79
- package/{agentListCommands-JUNMFS6E.js → agentListCommands-GOCGOQUB.js} +36 -36
- package/{agentMachineCommands-VNLDEKNT.js → agentMachineCommands-T7DAZG77.js} +35 -32
- package/{agentProviderCommands-X2HQE6HY.js → agentProviderCommands-CXBHNONN.js} +5 -5
- package/{agentPullCommand-FA43RBRU.js → agentPullCommand-GXXEDOSA.js} +4 -4
- package/{agentRecordCommands-47XXRVPI.js → agentRecordCommands-HSW3RJ4H.js} +72 -73
- package/{agentRunCommand-QEXFJUXQ.js → agentRunCommand-TIRJ57DK.js} +75 -75
- package/{agentRunControl-2C5GM3BW.js → agentRunControl-QWFFIAQY.js} +9 -7
- package/{agentRuntimeLocal-O5GDAFTN.js → agentRuntimeLocal-J6I63NZC.js} +21 -19
- package/{agentSlice-E3XS5FTQ.js → agentSlice-JNM3HF3V.js} +8 -8
- package/{appDeleteCommands-C2J5RQ3I.js → appDeleteCommands-KKLAK2UR.js} +31 -29
- package/{appDeployCommands-3YRK7PSU.js → appDeployCommands-PXWK4FAX.js} +31 -29
- package/{appDeployStatusCommands-FPAX7MOK.js → appDeployStatusCommands-3NGWDZTX.js} +31 -29
- package/{appGetCommands-XAC2V766.js → appGetCommands-APWYPEO3.js} +31 -29
- package/{appListCommands-ZJL2W5O7.js → appListCommands-OP7IRALO.js} +31 -29
- package/{authCommand-J3XILHWW.js → authCommand-3Z52KJID.js} +22 -302
- package/{authCommands-77CHYBGF.js → authCommands-QOCKVPX3.js} +5 -5
- package/{builtinSkillRegistry-A6VSPJEJ.js → builtinSkillRegistry-LJV7FHNI.js} +4 -4
- package/{chromeCommands-OBBNJCLS.js → chromeCommands-IY4NVSXZ.js} +17 -10
- package/{chunk-SW4S4XYB.js → chunk-2AB2HA4M.js} +84 -34
- package/{chunk-C5VPAHIU.js → chunk-32ZKZET7.js} +1 -1
- package/{chunk-XPWGOTBQ.js → chunk-3L2WKC3W.js} +1 -8
- package/{chunk-3XZKV7QQ.js → chunk-3L5MSPWX.js} +1 -1
- package/{chunk-QLQ573SU.js → chunk-3M52COK5.js} +120 -0
- package/{chunk-VSOWPETY.js → chunk-4226O6F7.js} +10 -10
- package/{chunk-Z6KQDSZW.js → chunk-43OFVLWJ.js} +6 -6
- package/{chunk-TJ2VPCBE.js → chunk-4JCAW7TO.js} +2 -2
- package/{chunk-6TF64IF2.js → chunk-4L4K6YR7.js} +16 -2
- package/{chunk-PEO24UB5.js → chunk-5E5VB7PS.js} +324 -57
- package/{chunk-ZD2BLOY6.js → chunk-5EDQTOUR.js} +7 -7
- package/{chunk-HKT6QXP3.js → chunk-5IKRTRRR.js} +5 -5
- package/{chunk-P5QACQDK.js → chunk-62TBKWTV.js} +1 -1
- package/{chunk-TRW43TSC.js → chunk-6EQD4AQL.js} +41 -1
- package/{chunk-YLMMECCH.js → chunk-6XIE5ZGI.js} +1 -1
- package/{chunk-OH2M7WEU.js → chunk-6Y3ETA2Y.js} +3 -3
- package/{chunk-7A4LJCDR.js → chunk-B3ZIFOFI.js} +5 -5
- package/{chunk-WZ6OU4NX.js → chunk-BAWAKW7X.js} +2 -2
- package/{chunk-UUPR3TD7.js → chunk-BL4HFN6L.js} +2 -4
- package/{chunk-2GGXHQIW.js → chunk-BLVSFYQ3.js} +4 -2
- package/{chunk-HP6O6LTV.js → chunk-CDLP56BS.js} +9 -9
- package/{chunk-UTIMX333.js → chunk-DJ2BOPJY.js} +1 -1
- package/{chunk-36OMEXXR.js → chunk-DLV3H464.js} +8 -8
- package/{chunk-CE7PIHQD.js → chunk-ESMZW5PE.js} +3 -3
- package/{chunk-PSJWPSKS.js → chunk-EWO77ZGF.js} +9 -43
- package/{chunk-ZWG3C7VI.js → chunk-F3SOW2EU.js} +81 -1
- package/{chunk-FY4SDK2E.js → chunk-FDLDMJTM.js} +1 -1
- package/{chunk-KOB75UNU.js → chunk-FHG46N5C.js} +53 -4
- package/{chunk-7KYVUFDG.js → chunk-G3VYRPTV.js} +5 -267
- package/{chunk-DW7MGLMG.js → chunk-GGUTTH6C.js} +35 -207
- package/{chunk-6MJNEXUU.js → chunk-HGDKT2D6.js} +4 -0
- package/{chunk-B2EGWZJG.js → chunk-I7S63QUU.js} +1 -1
- package/{chunk-ROPSATAB.js → chunk-IF7V3CBU.js} +1 -1
- package/chunk-IKOKYBYJ.js +2685 -0
- package/{chunk-T6CBQ6BN.js → chunk-INFHX73M.js} +1 -1
- package/{chunk-YBNHPX4S.js → chunk-IW64YHXL.js} +155 -31
- package/{chunk-K43ZF2C3.js → chunk-JPPQ3GUO.js} +1 -1
- package/{chunk-TZTWMGE3.js → chunk-JWEXJ573.js} +3 -3
- package/{chunk-RUNKPFM5.js → chunk-K6Y5T4GE.js} +12 -8
- package/{chunk-MVJVF4ED.js → chunk-KESKU5BG.js} +18 -17
- package/{chunk-I2ZMGXXF.js → chunk-KFHREHUQ.js} +1 -1
- package/{chunk-3C2QLERX.js → chunk-KMDDG73K.js} +1 -1
- package/{chunk-5MM7NNO6.js → chunk-KSTEXKL6.js} +78 -39
- package/{chunk-EM3YOZJ4.js → chunk-L2JMH4I5.js} +3 -3
- package/{chunk-MM3662RS.js → chunk-LPO6AMQU.js} +780 -64
- package/{chunk-D4OWHT5Y.js → chunk-MAYW6V3E.js} +2 -2
- package/{chunk-IPAW7XLD.js → chunk-MFVOJ6KF.js} +2 -2
- package/{chunk-FDT27L7S.js → chunk-MLEANT7D.js} +19 -17
- package/{chunk-7GC3EKUG.js → chunk-MMSQTZCJ.js} +3 -3
- package/{chunk-XFKZ3MCV.js → chunk-MR3ITQEV.js} +344 -88
- package/{chunk-CBHGZRCE.js → chunk-MYOH447Z.js} +1 -1
- package/{chunk-6MPAEODB.js → chunk-NHEWV5FD.js} +17 -3
- package/{chunk-ZEHTARJA.js → chunk-NLFTBC6S.js} +321 -150
- package/{chunk-SKPPKHD3.js → chunk-OLUKIUX6.js} +2 -2
- package/{chunk-SUKSWFLP.js → chunk-PIG2IUVZ.js} +1 -1
- package/{chunk-SEJ5OS6F.js → chunk-PXYBUFDB.js} +4 -0
- package/{chunk-2MTE2PEH.js → chunk-QA2C5NKI.js} +5 -739
- package/{chunk-L6EQV5OC.js → chunk-QXZH5UDF.js} +3 -3
- package/{chunk-TNIX77YM.js → chunk-R5GO3YZP.js} +34 -1
- package/{chunk-X5SUT4CN.js → chunk-R7GCGOGZ.js} +6 -6
- package/{chunk-4Z245KOA.js → chunk-SH3XD4E2.js} +8 -4
- package/{chunk-JGRPBIZZ.js → chunk-SQX235S2.js} +1 -1
- package/chunk-TT644UJD.js +188 -0
- package/{chunk-IYBIRCQV.js → chunk-U34KT53V.js} +29 -11
- package/{chunk-ANJTRG52.js → chunk-ULQAD7ZY.js} +18 -43
- package/{chunk-QDA4Y5O6.js → chunk-UVYSBQ2M.js} +21 -17
- package/{chunk-I2RMFLLH.js → chunk-V7PCFWX3.js} +1 -1
- package/{chunk-HXHSTRGH.js → chunk-VYNMQ6HW.js} +0 -27
- package/{chunk-G47IPDOK.js → chunk-W7FGZRLK.js} +1 -1
- package/{chunk-7BSQK2UC.js → chunk-WRCZXJ4N.js} +2 -2
- package/{chunk-KX6LPG7W.js → chunk-WYJTNSVL.js} +9 -9
- package/{chunk-H4KACZMG.js → chunk-XZIW3Q5B.js} +271 -138
- package/chunk-Y5GCAMGP.js +9 -0
- package/{chunk-JZX2XLKC.js → chunk-YCRROBDY.js} +1 -1
- package/{chunk-FPWT3RH2.js → chunk-YN5DT4JS.js} +22 -22
- package/{chunk-SCJD2PNK.js → chunk-YPG7TUQD.js} +3 -3
- package/{chunk-EJU23ST5.js → chunk-ZKVS36H3.js} +5069 -3730
- package/{chunk-YANF2RR4.js → chunk-ZPKUJROL.js} +1 -1
- package/{chunk-TYND6RDQ.js → chunk-ZZDVBZOP.js} +74 -3
- package/{commandRegistry-OUBQIF62.js → commandRegistry-DR2RPWK6.js} +88 -96
- package/{contentThunks-B3FRQGP7.js → contentThunks-CSJDJDEJ.js} +21 -21
- package/{createAgentAutomationAction-T2YFJ6MY.js → createAgentAutomationAction-ISEUEQSY.js} +21 -21
- package/{createDialogAction-2NFGFBXW.js → createDialogAction-HUCFOZY3.js} +25 -25
- package/{createPageAction-LDAVZDN7.js → createPageAction-DT5CYXCL.js} +24 -25
- package/{dbSlice-5QGKMQLO.js → dbSlice-6PVPY44C.js} +7 -7
- package/{deleteFile-EW6QNRRT.js → deleteFile-YM6NDPAR.js} +5 -5
- package/{dialogCommands-ZLBEAQHE.js → dialogCommands-3W6AIUXT.js} +35 -32
- package/{dialogSlice-64S3J6CP.js → dialogSlice-WJEEPG4W.js} +20 -20
- package/{dist-NJC2W7I4.js → dist-Q2JSMAKA.js} +7 -361
- package/{docCreateCommands-XOG5BBFQ.js → docCreateCommands-KQHQNLRX.js} +32 -30
- package/{docDeleteCommands-NCW3BBRX.js → docDeleteCommands-O3DWFX2W.js} +33 -31
- package/{docReadCommands-OT7X44Y3.js → docReadCommands-2U2BUONC.js} +32 -30
- package/{docStore-NIP7OO4I.js → docStore-7JPYT25V.js} +8 -8
- package/{docUpdateCommands-JW7OWW2J.js → docUpdateCommands-MF3C52XI.js} +32 -30
- package/{getPricing-TX35D7PI.js → getPricing-XQ3N3RBP.js} +2 -2
- package/{handleSendMessageAction-TOKA7ED7.js → handleSendMessageAction-BV5FMID4.js} +43 -39
- package/index.js +8 -8
- package/{localRuntimeAdapter-EQM6LFYC.js → localRuntimeAdapter-6FBEJJ4D.js} +70 -69
- package/{localRuntimeAuthority-JDAD7CB6.js → localRuntimeAuthority-BPN5OAQG.js} +2 -2
- package/{localRuntimeDb-CVC62PM5.js → localRuntimeDb-QIVAXMUL.js} +1 -1
- package/{machineCommands-WJ7FZ67T.js → machineCommands-WCAFDI5N.js} +80 -79
- package/{machineWsRunDispatch-BQT4DEA2.js → machineWsRunDispatch-ZF6BBQ3X.js} +70 -71
- package/{memberThunks-KRV5YXOB.js → memberThunks-AZINUM4S.js} +10 -10
- package/package.json +6 -2
- package/{profileConfig-ZGOFORWV.js → profileConfig-KN3N2BLF.js} +7 -1
- package/{providerPresetApply-CRZFMQD5.js → providerPresetApply-PKUOHQJT.js} +5 -5
- package/{providerRegistry-7IS43D3X.js → providerRegistry-HNQLIFN2.js} +5 -5
- package/{read-5KAZHHDM.js → read-7JPIWRBQ.js} +5 -5
- package/{readDocTool-5QO34OSX.js → readDocTool-AAQTB2Y3.js} +1 -1
- package/{readlineWorkspace-JHJSU5DS.js → readlineWorkspace-I5MHMEUE.js} +375 -200
- package/{removeDialogAgentAction-6X63HMI3.js → removeDialogAgentAction-RMVRILLK.js} +9 -9
- package/{runAgentClientLoop-5QIGEALK.js → runAgentClientLoop-TSNSRQEP.js} +59 -54
- package/{runtimeDoctorCommands-56NWKNON.js → runtimeDoctorCommands-MMCP4B4U.js} +12 -12
- package/{secretCommands-ZXZRLR3R.js → secretCommands-DNY56NSU.js} +11 -1
- package/{setDialogExtraReferencesAction-4MAYKKYW.js → setDialogExtraReferencesAction-L3V7JTMG.js} +8 -8
- package/{setPrimaryDialogAgentAction-EGBAMREH.js → setPrimaryDialogAgentAction-X52JQGTJ.js} +9 -9
- package/settingThunks-N6XFWPOU.js +923 -0
- package/{spaceCommands-ZWDPTURU.js → spaceCommands-NDPGHDMD.js} +29 -27
- package/{streamAgentChatTurn-456DWXNY.js → streamAgentChatTurn-RJLDV4WZ.js} +154 -95
- package/{switchDialogAgentAction-YBKTD6DO.js → switchDialogAgentAction-ZJ5CGU7J.js} +7 -7
- package/{tableCommands-U3QDY4L6.js → tableCommands-IVC5S7Y3.js} +11 -11
- package/{toolApiClient-7WSJJJBV.js → toolApiClient-HGNO53TC.js} +2 -2
- package/{tools-IWNXKK4Y.js → tools-X6QNIYFJ.js} +43 -44
- package/{tuiSummaryLlmCaller-KLK6K3Q3.js → tuiSummaryLlmCaller-FESHBDTT.js} +7 -7
- package/{updateCommands-NQXAGFM7.js → updateCommands-FJHGWD3Q.js} +5 -3
- package/{updateDialogTitleAction-SX53FZWO.js → updateDialogTitleAction-6LURCTMG.js} +21 -21
- package/{workloadLifecycle-36DXRZKU.js → workloadLifecycle-6O6PMISX.js} +2 -2
- package/chunk-IA7TRNNR.js +0 -11
- package/chunk-UKZX3NHN.js +0 -48
- package/chunk-VAZHH6FO.js +0 -7012
- package/chunk-W4S6OTSC.js +0 -35
- package/clipboardy-GCO3GT3I.js +0 -11793
- package/settingThunks-FTDRZNSJ.js +0 -1371
- package/{agentGrantCommands-HOJ3JBBQ.js → agentGrantCommands-5DPHYEKP.js} +3 -3
- package/{chromeOpsCommands-3Z34RKSE.js → chromeOpsCommands-GZVVK7HU.js} +4 -4
- package/{chunk-XETG4RIX.js → chunk-AETZ7AD6.js} +4 -4
- package/{chunk-2IXDJNZI.js → chunk-GAGGEA7D.js} +3 -3
- package/{memoryCommands-CUNBFRVS.js → memoryCommands-ZS3VQJAL.js} +3 -3
- package/{offlineMarxistsAgentCommand-2QTHJCHV.js → offlineMarxistsAgentCommand-3GLX4QQY.js} +3 -3
|
@@ -27,11 +27,11 @@ import {
|
|
|
27
27
|
stablePromptCacheKey,
|
|
28
28
|
toOpenAiCompatibleMessages,
|
|
29
29
|
toResponsesTools
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-4L4K6YR7.js";
|
|
31
31
|
import {
|
|
32
32
|
isMeaningfulChatCompletionOutput,
|
|
33
33
|
isMeaningfulResponsesOutput
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-QA2C5NKI.js";
|
|
35
35
|
import {
|
|
36
36
|
clipCompactText
|
|
37
37
|
} from "./chunk-5MMAK75Q.js";
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
resolvePlatformAuthToken,
|
|
45
45
|
resolvePlatformServerUrl,
|
|
46
46
|
resolveProviderTransportDecision
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-PIG2IUVZ.js";
|
|
48
48
|
import {
|
|
49
49
|
isRecord
|
|
50
50
|
} from "./chunk-KUG52IAP.js";
|
|
@@ -34,6 +34,10 @@ function canonicalizeNoloServerUrl(value) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// packages/cli/client/profileConfig.ts
|
|
37
|
+
var PERMISSION_GRANT_KINDS = ["local", "remote"];
|
|
38
|
+
function permissionGrantList(grants) {
|
|
39
|
+
return PERMISSION_GRANT_KINDS.filter((kind) => grants?.[kind] === true);
|
|
40
|
+
}
|
|
37
41
|
var normalizeProfileServerUrl = canonicalizeNoloServerUrl;
|
|
38
42
|
function isProtectedHomeProfileWrite(path) {
|
|
39
43
|
if (process.env.NODE_ENV !== "test") return false;
|
|
@@ -129,7 +133,11 @@ function buildEnvFromProfile(config) {
|
|
|
129
133
|
...getProfileTokens(config)[0] ? { AUTH_TOKEN: getProfileTokens(config)[0] } : {},
|
|
130
134
|
...profile.agentKey ? { NOLO_AGENT: profile.agentKey } : {},
|
|
131
135
|
...profile.agentName ? { NOLO_AGENT_NAME: profile.agentName } : {},
|
|
132
|
-
...profile.locale ? { NOLO_LANG: profile.locale } : {}
|
|
136
|
+
...profile.locale ? { NOLO_LANG: profile.locale } : {},
|
|
137
|
+
...(() => {
|
|
138
|
+
const granted = permissionGrantList(profile.permissionGrants);
|
|
139
|
+
return granted.length > 0 ? { NOLO_PERMISSION_GRANTS: granted.join(",") } : {};
|
|
140
|
+
})()
|
|
133
141
|
};
|
|
134
142
|
}
|
|
135
143
|
function buildCliRuntimeEnv(processEnv, config) {
|
|
@@ -164,6 +172,28 @@ function saveProfileLocale(locale, path = getDefaultProfileConfigPath()) {
|
|
|
164
172
|
`, "utf8");
|
|
165
173
|
return config;
|
|
166
174
|
}
|
|
175
|
+
function saveProfilePermissionGrant(kind, value, path = getDefaultProfileConfigPath()) {
|
|
176
|
+
if (isProtectedHomeProfileWrite(path)) return null;
|
|
177
|
+
const config = loadProfileConfig(path);
|
|
178
|
+
if (!config) return null;
|
|
179
|
+
const profile = config.profiles[config.currentProfile];
|
|
180
|
+
if (!profile) return null;
|
|
181
|
+
const grants = { ...profile.permissionGrants ?? {} };
|
|
182
|
+
if (value === true) {
|
|
183
|
+
grants[kind] = true;
|
|
184
|
+
} else {
|
|
185
|
+
delete grants[kind];
|
|
186
|
+
}
|
|
187
|
+
if (permissionGrantList(grants).length > 0) {
|
|
188
|
+
profile.permissionGrants = grants;
|
|
189
|
+
} else {
|
|
190
|
+
delete profile.permissionGrants;
|
|
191
|
+
}
|
|
192
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
193
|
+
writeFileSync(path, `${JSON.stringify(config, null, 2)}
|
|
194
|
+
`, "utf8");
|
|
195
|
+
return config;
|
|
196
|
+
}
|
|
167
197
|
function getAgentSelectionAuditPath(configPath = getDefaultProfileConfigPath()) {
|
|
168
198
|
return join(dirname(configPath), "agent-selection.log");
|
|
169
199
|
}
|
|
@@ -308,6 +338,8 @@ function saveProfileOAuthSync(provider, sync, path = getDefaultProfileConfigPath
|
|
|
308
338
|
}
|
|
309
339
|
|
|
310
340
|
export {
|
|
341
|
+
PERMISSION_GRANT_KINDS,
|
|
342
|
+
permissionGrantList,
|
|
311
343
|
normalizeProfileServerUrl,
|
|
312
344
|
isProtectedHomeProfileWrite,
|
|
313
345
|
getDefaultProfileConfigPath,
|
|
@@ -320,6 +352,7 @@ export {
|
|
|
320
352
|
buildCliRuntimeEnv,
|
|
321
353
|
getCurrentProfile,
|
|
322
354
|
saveProfileLocale,
|
|
355
|
+
saveProfilePermissionGrant,
|
|
323
356
|
getAgentSelectionAuditPath,
|
|
324
357
|
redactArgvSecrets,
|
|
325
358
|
appendAgentSelectionAudit,
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
patch,
|
|
3
3
|
remove,
|
|
4
4
|
write
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CDLP56BS.js";
|
|
6
6
|
import {
|
|
7
7
|
getRuntimeServerContext
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-43OFVLWJ.js";
|
|
9
9
|
import {
|
|
10
10
|
asyncThunkCreator,
|
|
11
11
|
buildCreateSlice
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WRCZXJ4N.js";
|
|
13
13
|
import {
|
|
14
14
|
applyAgentSecretMigrationUpdates,
|
|
15
15
|
migrateAgentSecrets,
|
|
@@ -308,7 +308,7 @@ var slice = createSliceWithThunks({
|
|
|
308
308
|
const overrides = {};
|
|
309
309
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
310
310
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
311
|
-
const { _executeModel } = await import("./_executeModel-
|
|
311
|
+
const { _executeModel } = await import("./_executeModel-ZIQHOREX.js");
|
|
312
312
|
return _executeModel(
|
|
313
313
|
{
|
|
314
314
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -329,7 +329,7 @@ var slice = createSliceWithThunks({
|
|
|
329
329
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
330
330
|
*/
|
|
331
331
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
332
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
332
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-TSNSRQEP.js");
|
|
333
333
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
334
334
|
{
|
|
335
335
|
agentKey: args.agentKey,
|
|
@@ -345,7 +345,7 @@ var slice = createSliceWithThunks({
|
|
|
345
345
|
* 聊天轮次流式 Agent 调用
|
|
346
346
|
*/
|
|
347
347
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
348
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
348
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-RJLDV4WZ.js");
|
|
349
349
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
350
350
|
}),
|
|
351
351
|
/**
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
buildBuiltinObjectSkillDbKey,
|
|
7
7
|
buildBuiltinObjectSkillPageContent,
|
|
8
8
|
buildCodeWorkDiscipline
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YCRROBDY.js";
|
|
10
10
|
import {
|
|
11
11
|
buildSkillDocMarkdown,
|
|
12
12
|
resolvePageSkillMetadata
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-AETZ7AD6.js";
|
|
14
14
|
import {
|
|
15
15
|
nolotusId
|
|
16
16
|
} from "./chunk-Y6ORVLSS.js";
|
|
@@ -1295,7 +1295,7 @@ var SECRETS_MANAGER_SKILL_DEFINITIONS = {
|
|
|
1295
1295
|
1. **\u7EDD\u5BF9\u5B58\u50A8\u8DEF\u5F84**\uFF1A\`$NOLO_HOME/credentials/secrets.json\`\uFF08\u672A\u8BBE \`NOLO_HOME\` \u65F6\u56DE\u843D \`~/.nolo/credentials/secrets.json\`\uFF09\uFF0C\u6743\u9650\u4E25\u683C\u9501\u5B9A\u4E3A \`0600\`\uFF0C\u7236\u76EE\u5F55 \`0700\`\u3002
|
|
1296
1296
|
2. **\u7981\u6B62\u56DE\u663E\u539F\u5219**\uFF1A
|
|
1297
1297
|
- Agent \u65E0\u8BBA\u5728\u4EFB\u4F55\u60C5\u51B5\u4E0B\uFF0C**\u7EDD\u4E0D\u5728\u5BF9\u8BDD\u6D88\u606F\u3001\u65E5\u5FD7\u6216\u62A5\u544A\u4E2D\u6253\u5370\u4EFB\u4F55\u5BC6\u94A5\u660E\u6587**\uFF1B
|
|
1298
|
-
- \u67E5\u770B\u5DF2\u4FDD\u5B58\u7684\u51ED\u636E\u4E00\u5F8B\u4F7F\u7528 \`nolo secret list\`\uFF08\u4EC5\u8F93\u51FA\u51ED\u636E\u540D\u79F0\uFF0C\u4E0D\u8F93\u51FA\u5185\u5BB9\uFF09\uFF1B
|
|
1298
|
+
- \u67E5\u770B\u5DF2\u4FDD\u5B58\u7684\u51ED\u636E\u4E00\u5F8B\u4F7F\u7528 \`nolo secret list\`\uFF08\u4EBA\u7C7B\u53EF\u8BFB\uFF09\u6216 \`nolo secret list --json\`\uFF08\u673A\u5668\u53EF\u8BFB\uFF0C\u4EC5\u8F93\u51FA\u51ED\u636E\u540D\u79F0\u4E0E\u5F62\u6001\uFF0C\u4E0D\u8F93\u51FA\u5185\u5BB9\uFF09\uFF1B
|
|
1299
1299
|
- Agent **\u4E0D\u5F97**\u6267\u884C \`nolo secret get\`\uFF08\u8BE5\u5B50\u547D\u4EE4\u53EA\u4F9B\u4EBA\u7C7B\u8C03\u8BD5\uFF09\uFF0C\u53EA\u5141\u8BB8 \`nolo secret run --with\`\u3002
|
|
1300
1300
|
3. **\u7528\u6237\u6388\u6743\u95E8\u7981**\uFF1A
|
|
1301
1301
|
- \u53EA\u6709\u5F53\u7528\u6237\u5728\u5BF9\u8BDD\u4E2D\u660E\u786E\u63D0\u5230\u201C\u5141\u8BB8\u83B7\u53D6 / \u4F7F\u7528\u672C\u5730\u4FDD\u5B58\u7684 xxx \u51ED\u636E\u201D\u65F6\uFF0CAgent \u624D\u88AB\u6388\u6743\u8C03\u7528\u8BE5\u51ED\u636E\uFF1B\u672A\u83B7\u7528\u6237\u660E\u786E\u6307\u793A\u65F6\uFF0C\u4E0D\u5F97\u8BFB\u53D6\u6216\u6CE8\u5165\u3002
|
|
@@ -1305,6 +1305,8 @@ var SECRETS_MANAGER_SKILL_DEFINITIONS = {
|
|
|
1305
1305
|
\`\`\`bash
|
|
1306
1306
|
# 1. \u67E5\u770B\u5DF2\u6709\u79D8\u5BC6\uFF08\u5B89\u5168\uFF0C\u4EC5\u8F93\u51FA\u540D\u79F0\u5217\u8868\uFF0C\u7EDD\u4E0D\u6253\u5370\u5BC6\u94A5\u503C\uFF09
|
|
1307
1307
|
nolo secret list
|
|
1308
|
+
# \u673A\u5668\u53EF\u8BFB\u7248\uFF08\u4EC5\u540D\u79F0\u4E0E\u5F62\u6001\uFF0Cagent \u7528\u5B83\u6765\u53D1\u73B0"\u6211\u4EEC\u6709\u6CA1\u6709\u76F8\u5173\u51ED\u636E"\uFF09
|
|
1309
|
+
nolo secret list --json
|
|
1308
1310
|
|
|
1309
1311
|
# 2. \u8BBE\u7F6E\u6216\u66F4\u65B0\u51ED\u636E\uFF08\u652F\u6301\u5B57\u7B26\u4E32\u6216 JSON \u5BF9\u8C61\uFF09
|
|
1310
1312
|
nolo secret set amo '{"issuer":"user:<account-id>:<key-id>","secret":"<key>"}'
|
|
@@ -1338,7 +1340,9 @@ function buildSecretsManagerSkillConfig(slug) {
|
|
|
1338
1340
|
id: buildSecretsManagerSkillId(slug),
|
|
1339
1341
|
name: seed.title,
|
|
1340
1342
|
description: seed.description,
|
|
1341
|
-
|
|
1343
|
+
// 合法枚举是 explicit / required / recommended;"manual" 会被
|
|
1344
|
+
// normalizeSkillEnumValue 静默丢弃,导致 front-matter 的 triggerMode 为空。
|
|
1345
|
+
triggerMode: "explicit"
|
|
1342
1346
|
};
|
|
1343
1347
|
}
|
|
1344
1348
|
function buildSecretsManagerSkillContentBySlug(slug) {
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import {
|
|
2
|
+
shouldUseServerProxy
|
|
3
|
+
} from "./chunk-F3SOW2EU.js";
|
|
4
|
+
import {
|
|
5
|
+
ANTIGRAVITY_CLOUD_CODE_BASE_URL,
|
|
6
|
+
isAntigravityCloudCodeBaseUrl,
|
|
7
|
+
isAntigravityOAuthAgent
|
|
8
|
+
} from "./chunk-SQX235S2.js";
|
|
9
|
+
import {
|
|
10
|
+
isOpenAiResponsesModel,
|
|
11
|
+
resolvePlatformChatCompletionsEndpoint,
|
|
12
|
+
resolvePlatformResponsesEndpoint
|
|
13
|
+
} from "./chunk-V7PCFWX3.js";
|
|
14
|
+
import {
|
|
15
|
+
findModelConfig
|
|
16
|
+
} from "./chunk-6EQD4AQL.js";
|
|
17
|
+
import {
|
|
18
|
+
asOptionalTrimmedString
|
|
19
|
+
} from "./chunk-G3SUCT4W.js";
|
|
20
|
+
import {
|
|
21
|
+
asTrimmedLowercaseString
|
|
22
|
+
} from "./chunk-QSJ3HFEF.js";
|
|
23
|
+
|
|
24
|
+
// packages/agent-runtime/agentCallPlan.ts
|
|
25
|
+
var CODEX_RESPONSES_URL = "https://chatgpt.com/backend-api/codex/responses";
|
|
26
|
+
var CURSOR_AGENT_URL = "https://api2.cursor.sh/agent.v1.AgentService/Run";
|
|
27
|
+
var DEVIN_CONNECT_URL = "https://server.codeium.com/exa.api_server_pb.ApiServerService/GetChatMessage";
|
|
28
|
+
function resolveClientWire(plan) {
|
|
29
|
+
if (plan.upstreamWire === "gemini-cca") return "chat.completions";
|
|
30
|
+
if (plan.upstreamWire === "anthropic-messages") return "chat.completions";
|
|
31
|
+
if (plan.upstreamWire === "cursor-connect") return "chat.completions";
|
|
32
|
+
if (plan.upstreamWire === "devin-connect") return "chat.completions";
|
|
33
|
+
if (plan.upstreamWire === "custom-gemini") return "chat.completions";
|
|
34
|
+
if (plan.upstreamWire === "custom-openai-responses") return "chat.completions";
|
|
35
|
+
if (plan.upstreamWire === "custom-anthropic-messages") return "chat.completions";
|
|
36
|
+
if (plan.upstreamWire === "responses" && plan.authMethod.kind === "oauth" && plan.authMethod.ref === "chatgpt") {
|
|
37
|
+
return "chat.completions";
|
|
38
|
+
}
|
|
39
|
+
return plan.upstreamWire;
|
|
40
|
+
}
|
|
41
|
+
var XAI_CHAT_COMPLETIONS_URL = "https://api.x.ai/v1/chat/completions";
|
|
42
|
+
var ANTHROPIC_MESSAGES_URL = "https://api.anthropic.com/v1/messages";
|
|
43
|
+
var CODEX_REQUIRED_HEADERS = [
|
|
44
|
+
"chatgpt-account-id",
|
|
45
|
+
"OpenAI-Beta",
|
|
46
|
+
"originator",
|
|
47
|
+
"version"
|
|
48
|
+
];
|
|
49
|
+
var ANTIGRAVITY_REQUIRED_HEADERS = [
|
|
50
|
+
"User-Agent"
|
|
51
|
+
// antigravity-specific UA (matches getAntigravityUserAgent)
|
|
52
|
+
];
|
|
53
|
+
function agentShouldUseServerProxy(agentConfig) {
|
|
54
|
+
return shouldUseServerProxy(agentConfig);
|
|
55
|
+
}
|
|
56
|
+
function resolveCustomUpstreamWire(endpoint, nativeProtocol) {
|
|
57
|
+
const responsesEndpoint = endpoint.includes("/responses");
|
|
58
|
+
if (nativeProtocol === "openai-responses" && responsesEndpoint) return "responses";
|
|
59
|
+
if (nativeProtocol === "gemini") return "custom-gemini";
|
|
60
|
+
if (nativeProtocol === "openai-responses") return "custom-openai-responses";
|
|
61
|
+
if (nativeProtocol === "anthropic-messages") return "custom-anthropic-messages";
|
|
62
|
+
return responsesEndpoint ? "responses" : "chat.completions";
|
|
63
|
+
}
|
|
64
|
+
function hasOwnCustomProviderKey(agentConfig) {
|
|
65
|
+
const endpoint = asOptionalTrimmedString(agentConfig.customProviderUrl);
|
|
66
|
+
if (!endpoint) return false;
|
|
67
|
+
if (isAntigravityCloudCodeBaseUrl(endpoint)) return false;
|
|
68
|
+
return Boolean(asOptionalTrimmedString(agentConfig.apiKey));
|
|
69
|
+
}
|
|
70
|
+
function resolveAgentCallPlan(agentConfig, _env) {
|
|
71
|
+
const apiKeyRef = asTrimmedLowercaseString(agentConfig.apiKeyRef);
|
|
72
|
+
const provider = asTrimmedLowercaseString(
|
|
73
|
+
agentConfig.provider ?? agentConfig.apiSource
|
|
74
|
+
);
|
|
75
|
+
const ownCustomKeyWins = hasOwnCustomProviderKey(agentConfig);
|
|
76
|
+
const oauthApiKeyRef = ownCustomKeyWins ? "" : apiKeyRef;
|
|
77
|
+
if (!ownCustomKeyWins && isAntigravityOAuthAgent(agentConfig)) {
|
|
78
|
+
return {
|
|
79
|
+
authMethod: { kind: "oauth", ref: "antigravity" },
|
|
80
|
+
transport: "server-proxy",
|
|
81
|
+
upstreamWire: "gemini-cca",
|
|
82
|
+
endpoint: ANTIGRAVITY_CLOUD_CODE_BASE_URL,
|
|
83
|
+
requiredHeaders: [...ANTIGRAVITY_REQUIRED_HEADERS],
|
|
84
|
+
vendor: provider || "google-antigravity"
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
if (oauthApiKeyRef === "chatgpt") {
|
|
88
|
+
return {
|
|
89
|
+
authMethod: { kind: "oauth", ref: "chatgpt" },
|
|
90
|
+
transport: "server-proxy",
|
|
91
|
+
upstreamWire: "responses",
|
|
92
|
+
endpoint: CODEX_RESPONSES_URL,
|
|
93
|
+
requiredHeaders: [...CODEX_REQUIRED_HEADERS],
|
|
94
|
+
vendor: provider || "openai"
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
if (oauthApiKeyRef === "claude") {
|
|
98
|
+
return {
|
|
99
|
+
authMethod: { kind: "oauth", ref: "claude" },
|
|
100
|
+
transport: "server-proxy",
|
|
101
|
+
upstreamWire: "anthropic-messages",
|
|
102
|
+
endpoint: ANTHROPIC_MESSAGES_URL,
|
|
103
|
+
requiredHeaders: ["anthropic-version", "anthropic-beta"],
|
|
104
|
+
vendor: provider || "anthropic"
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
if (oauthApiKeyRef === "xai") {
|
|
108
|
+
return {
|
|
109
|
+
authMethod: { kind: "oauth", ref: "xai" },
|
|
110
|
+
transport: "server-proxy",
|
|
111
|
+
upstreamWire: "chat.completions",
|
|
112
|
+
endpoint: XAI_CHAT_COMPLETIONS_URL,
|
|
113
|
+
requiredHeaders: [],
|
|
114
|
+
vendor: provider || "xai"
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
if (oauthApiKeyRef === "cursor") {
|
|
118
|
+
return {
|
|
119
|
+
authMethod: { kind: "oauth", ref: "cursor" },
|
|
120
|
+
transport: "server-proxy",
|
|
121
|
+
upstreamWire: "cursor-connect",
|
|
122
|
+
endpoint: CURSOR_AGENT_URL,
|
|
123
|
+
requiredHeaders: [
|
|
124
|
+
"x-cursor-client-version",
|
|
125
|
+
"x-cursor-client-type",
|
|
126
|
+
"x-ghost-mode"
|
|
127
|
+
],
|
|
128
|
+
vendor: provider || "cursor"
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (oauthApiKeyRef === "devin" || !ownCustomKeyWins && provider === "devin") {
|
|
132
|
+
return {
|
|
133
|
+
authMethod: { kind: "oauth", ref: "devin" },
|
|
134
|
+
transport: "server-proxy",
|
|
135
|
+
upstreamWire: "devin-connect",
|
|
136
|
+
endpoint: DEVIN_CONNECT_URL,
|
|
137
|
+
requiredHeaders: ["connect-protocol-version"],
|
|
138
|
+
vendor: provider || "devin"
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
if (agentConfig.cliProvider || agentConfig.apiSource === "cli" || provider === "cli") {
|
|
142
|
+
return {
|
|
143
|
+
authMethod: { kind: "cli", provider: agentConfig.cliProvider || provider || "codex" },
|
|
144
|
+
transport: "direct",
|
|
145
|
+
upstreamWire: "cli",
|
|
146
|
+
endpoint: "",
|
|
147
|
+
requiredHeaders: [],
|
|
148
|
+
vendor: provider || "cli"
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
if (agentConfig.customProviderUrl || agentConfig.apiSource === "custom") {
|
|
152
|
+
const transport2 = agentShouldUseServerProxy(agentConfig) ? "server-proxy" : "direct";
|
|
153
|
+
const endpoint2 = asOptionalTrimmedString(agentConfig.customProviderUrl) ?? "";
|
|
154
|
+
const upstreamWire2 = resolveCustomUpstreamWire(
|
|
155
|
+
endpoint2,
|
|
156
|
+
findModelConfig(provider, agentConfig.model ?? "")?.nativeProtocol
|
|
157
|
+
);
|
|
158
|
+
return {
|
|
159
|
+
authMethod: { kind: "custom-key" },
|
|
160
|
+
transport: transport2,
|
|
161
|
+
upstreamWire: upstreamWire2,
|
|
162
|
+
endpoint: endpoint2,
|
|
163
|
+
requiredHeaders: [],
|
|
164
|
+
vendor: provider || "custom"
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
const transport = agentShouldUseServerProxy(agentConfig) ? "server-proxy" : "direct";
|
|
168
|
+
const useResponses = isOpenAiResponsesModel({
|
|
169
|
+
provider,
|
|
170
|
+
model: agentConfig.model,
|
|
171
|
+
endpointKey: agentConfig.endpointKey
|
|
172
|
+
});
|
|
173
|
+
const upstreamWire = useResponses ? "responses" : "chat.completions";
|
|
174
|
+
const endpoint = upstreamWire === "responses" ? resolvePlatformResponsesEndpoint(provider, agentConfig.model) ?? "" : resolvePlatformChatCompletionsEndpoint(provider, agentConfig.model) ?? "";
|
|
175
|
+
return {
|
|
176
|
+
authMethod: { kind: "platform-key" },
|
|
177
|
+
transport,
|
|
178
|
+
upstreamWire,
|
|
179
|
+
endpoint,
|
|
180
|
+
requiredHeaders: [],
|
|
181
|
+
vendor: provider || "openai"
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export {
|
|
186
|
+
resolveClientWire,
|
|
187
|
+
resolveAgentCallPlan
|
|
188
|
+
};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveAgentCallPlan
|
|
3
|
+
} from "./chunk-TT644UJD.js";
|
|
4
|
+
import {
|
|
5
|
+
SUBSCRIPTION_OAUTH_PROVIDERS
|
|
6
|
+
} from "./chunk-EWO77ZGF.js";
|
|
1
7
|
import {
|
|
2
8
|
findModelConfig,
|
|
3
9
|
getProviderByModelName
|
|
4
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6EQD4AQL.js";
|
|
5
11
|
import {
|
|
6
12
|
asOptionalTrimmedString
|
|
7
13
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -90,16 +96,18 @@ var lookupKnownModelVision = (provider, model) => {
|
|
|
90
96
|
if (provider && provider !== "custom") {
|
|
91
97
|
const direct = findModelConfig(provider, candidate);
|
|
92
98
|
if (direct && typeof direct.hasVision === "boolean") return direct.hasVision;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
} else {
|
|
100
|
+
const detected = getProviderByModelName(candidate);
|
|
101
|
+
if (detected) {
|
|
102
|
+
const found = findModelConfig(detected, candidate)?.hasVision;
|
|
103
|
+
if (found !== void 0) return found;
|
|
104
|
+
}
|
|
98
105
|
}
|
|
99
106
|
if (candidate.includes("/")) {
|
|
100
107
|
const slash = candidate.indexOf("/");
|
|
101
108
|
const modelProvider = candidate.slice(0, slash).toLowerCase();
|
|
102
109
|
const modelName = candidate.slice(slash + 1);
|
|
110
|
+
if (provider && provider !== "custom" && provider !== modelProvider) continue;
|
|
103
111
|
const nested = findModelConfig(modelProvider, modelName);
|
|
104
112
|
if (nested && typeof nested.hasVision === "boolean") return nested.hasVision;
|
|
105
113
|
}
|
|
@@ -108,12 +116,22 @@ var lookupKnownModelVision = (provider, model) => {
|
|
|
108
116
|
};
|
|
109
117
|
var resolveAgentImageInputSupport = (agent) => {
|
|
110
118
|
if (!agent) return true;
|
|
111
|
-
const provider = asTrimmedLowercaseString(agent.provider) || null;
|
|
119
|
+
const provider = asTrimmedLowercaseString(agent.provider) || asTrimmedLowercaseString(agent.apiSource) || null;
|
|
112
120
|
const model = asOptionalTrimmedString(agent.model) ?? "";
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
121
|
+
const { authMethod } = resolveAgentCallPlan({
|
|
122
|
+
key: "",
|
|
123
|
+
provider: agent.provider ?? void 0,
|
|
124
|
+
apiSource: agent.apiSource ?? void 0,
|
|
125
|
+
cliProvider: agent.cliProvider ?? void 0,
|
|
126
|
+
model,
|
|
127
|
+
apiKeyRef: agent.apiKeyRef ?? void 0,
|
|
128
|
+
customProviderUrl: agent.customProviderUrl ?? void 0,
|
|
129
|
+
apiKey: agent.apiKey ?? void 0,
|
|
130
|
+
useServerProxy: agent.useServerProxy ?? void 0
|
|
131
|
+
});
|
|
132
|
+
const catalogHasVision = authMethod.kind === "oauth" ? SUBSCRIPTION_OAUTH_PROVIDERS.find((entry) => entry.apiKeyRef === authMethod.ref)?.modelOptions.find(
|
|
133
|
+
(entry) => [model, stripEffortSuffix(model), stripPreviewSuffix(model)].includes(entry.id)
|
|
134
|
+
)?.hasVision : lookupKnownModelVision(provider, model);
|
|
117
135
|
if (catalogHasVision !== void 0) {
|
|
118
136
|
return catalogHasVision;
|
|
119
137
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isDevinOAuthAgent
|
|
3
|
-
} from "./chunk-5ZUL4CUO.js";
|
|
4
1
|
import {
|
|
5
2
|
resolveAgentImageInputSupport
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
getModelContextWindow
|
|
9
|
-
} from "./chunk-2MTE2PEH.js";
|
|
3
|
+
} from "./chunk-U34KT53V.js";
|
|
10
4
|
import {
|
|
11
5
|
asOptionalFiniteNumber
|
|
12
6
|
} from "./chunk-WWC7I6TA.js";
|
|
@@ -39,9 +33,13 @@ function hasImageInRuntimeMessages(messages) {
|
|
|
39
33
|
var IMAGE_OMITTED_PLACEHOLDER = "[Image content omitted: model does not support image input]";
|
|
40
34
|
function stripImagePartsFromContent(content) {
|
|
41
35
|
if (!Array.isArray(content)) return content;
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
|
|
36
|
+
const hasImage = content.some((part) => part && typeof part === "object" && part.type === "image_url");
|
|
37
|
+
if (!hasImage) return content;
|
|
38
|
+
const hasNonImage = content.some((part) => part && typeof part === "object" && part.type !== "image_url");
|
|
39
|
+
if (!hasNonImage) return IMAGE_OMITTED_PLACEHOLDER;
|
|
40
|
+
return content.map(
|
|
41
|
+
(part) => part && typeof part === "object" && part.type === "image_url" ? { type: "text", text: IMAGE_OMITTED_PLACEHOLDER } : part
|
|
42
|
+
);
|
|
45
43
|
}
|
|
46
44
|
function stripImagePartsFromMessages(messages) {
|
|
47
45
|
return messages.map((msg) => ({
|
|
@@ -51,39 +49,17 @@ function stripImagePartsFromMessages(messages) {
|
|
|
51
49
|
}
|
|
52
50
|
async function stripImagePartsForTextOnlyAgent(messages, agentConfig) {
|
|
53
51
|
const supportsVision = resolveAgentImageInputSupport(agentConfig);
|
|
54
|
-
const
|
|
55
|
-
|
|
52
|
+
const runtimeMessages = messages;
|
|
53
|
+
const hasImages = hasImageInRuntimeMessages(runtimeMessages);
|
|
54
|
+
const shouldStrip = !supportsVision && hasImages;
|
|
55
|
+
const omittedImageCount = shouldStrip ? extractImageUrlsFromMessages(runtimeMessages).length : 0;
|
|
56
|
+
return {
|
|
57
|
+
messages: shouldStrip ? stripImagePartsFromMessages(messages) : messages,
|
|
58
|
+
downgraded: shouldStrip,
|
|
59
|
+
omittedImageCount
|
|
60
|
+
};
|
|
56
61
|
}
|
|
57
62
|
|
|
58
|
-
// packages/agent-runtime/devin/devinChannelWindows.ts
|
|
59
|
-
var DEVIN_CHANNEL_CONTEXT_WINDOWS = {
|
|
60
|
-
// SWE-2 家族(catalog 无裸 swe-2 selector;旧点号/裸写法如 swe-2、
|
|
61
|
-
// swe-1.7 实测均 permission_denied,已不是可用 selector)。
|
|
62
|
-
"swe-2-max": 262e3,
|
|
63
|
-
"swe-2-high": 262e3,
|
|
64
|
-
"swe-2-medium": 262e3,
|
|
65
|
-
// SWE-1.7 家族。
|
|
66
|
-
"swe-1-7": 262e3,
|
|
67
|
-
"swe-1-7-medium": 262e3,
|
|
68
|
-
"swe-1-7-lightning": 202752,
|
|
69
|
-
// SWE-1.6 家族(免费档默认)。
|
|
70
|
-
"swe-1-6": 2e5,
|
|
71
|
-
"swe-1-6-fast": 2e5,
|
|
72
|
-
// 经 devin 通道转售、且与厂商原生窗口不同的模型(catalog 枚举型 selector)。
|
|
73
|
-
"MODEL_GPT_5_2_LOW": 384e3,
|
|
74
|
-
"MODEL_GPT_5_2_MEDIUM": 384e3,
|
|
75
|
-
"MODEL_GPT_5_2_HIGH": 384e3,
|
|
76
|
-
"MODEL_GPT_5_2_XHIGH": 384e3
|
|
77
|
-
};
|
|
78
|
-
var devinChannelContextWindow = (model) => {
|
|
79
|
-
const raw = model?.trim();
|
|
80
|
-
if (!raw) return void 0;
|
|
81
|
-
return DEVIN_CHANNEL_CONTEXT_WINDOWS[raw];
|
|
82
|
-
};
|
|
83
|
-
var resolveAgentContextWindow = (agent) => (isDevinOAuthAgent(agent) ? devinChannelContextWindow(agent.model) : void 0) ?? // provider 透传给全局解析:平台托管通道(CF)与 Codex OAuth 等通道对同一 id
|
|
84
|
-
// 窗口不同,按通道取真值,不做全局取大/取小。
|
|
85
|
-
getModelContextWindow(agent.model ?? "", agent.provider);
|
|
86
|
-
|
|
87
63
|
// packages/agent-runtime/agentRecordConfig.ts
|
|
88
64
|
function stringField(record, key) {
|
|
89
65
|
const value = record[key];
|
|
@@ -449,11 +425,10 @@ function assertDesktopAgentRuntimeTurnBodyHasNoRawSecrets(body) {
|
|
|
449
425
|
}
|
|
450
426
|
|
|
451
427
|
export {
|
|
428
|
+
extractImageUrlsFromMessages,
|
|
452
429
|
hasImageInRuntimeMessages,
|
|
453
430
|
stripImagePartsFromMessages,
|
|
454
431
|
stripImagePartsForTextOnlyAgent,
|
|
455
|
-
devinChannelContextWindow,
|
|
456
|
-
resolveAgentContextWindow,
|
|
457
432
|
resolveAgentRuntimeConfigFromRecord,
|
|
458
433
|
buildDesktopAgentRuntimeAgentConfigSnapshot,
|
|
459
434
|
buildDesktopAgentRuntimeDialogHistorySnapshot,
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
inlineImageUrlsForCustomProvider,
|
|
6
6
|
prepareTools,
|
|
7
7
|
shouldInlineImageUrlsForAgent
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OLUKIUX6.js";
|
|
9
9
|
import {
|
|
10
10
|
CONFIRMATION_INPUT_KEYS,
|
|
11
11
|
INVALID_TOOL_ARGS_REPLACEMENT,
|
|
@@ -14,16 +14,16 @@ import {
|
|
|
14
14
|
performFetchRequest,
|
|
15
15
|
sanitizeOutboundMessages,
|
|
16
16
|
stripModelToolArgs
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-GGUTTH6C.js";
|
|
18
18
|
import {
|
|
19
19
|
findToolExecutor,
|
|
20
20
|
toolDefinitionsByName
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-MR3ITQEV.js";
|
|
22
22
|
import {
|
|
23
23
|
classifyApiError,
|
|
24
24
|
classifyGenerationError,
|
|
25
25
|
extractErrorDiagnostics
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-4226O6F7.js";
|
|
27
27
|
import {
|
|
28
28
|
createSSEParser,
|
|
29
29
|
createToolRunId,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
toolRunSetPending,
|
|
33
33
|
toolRunStarted,
|
|
34
34
|
toolRunSucceeded
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-K6Y5T4GE.js";
|
|
36
36
|
import {
|
|
37
37
|
getPublicImageAgentMode
|
|
38
38
|
} from "./chunk-VIDPVFP3.js";
|
|
@@ -42,10 +42,10 @@ import {
|
|
|
42
42
|
messageStreaming,
|
|
43
43
|
toolResultNeedsUserConfirmation,
|
|
44
44
|
updateToolMessage
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-XZIW3Q5B.js";
|
|
46
46
|
import {
|
|
47
47
|
streamAgentChatTurn
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-R7GCGOGZ.js";
|
|
49
49
|
import {
|
|
50
50
|
getCurrentSpaceId
|
|
51
51
|
} from "./chunk-ZJ7UHBJS.js";
|
|
@@ -56,16 +56,16 @@ import {
|
|
|
56
56
|
} from "./chunk-OWYYDMGJ.js";
|
|
57
57
|
import {
|
|
58
58
|
selectCurrentServer
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-32ZKZET7.js";
|
|
60
60
|
import {
|
|
61
61
|
write
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-CDLP56BS.js";
|
|
63
63
|
import {
|
|
64
64
|
createAsyncThunk
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-WRCZXJ4N.js";
|
|
66
66
|
import {
|
|
67
67
|
selectIdentityToken
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-PXYBUFDB.js";
|
|
69
69
|
import {
|
|
70
70
|
classifyOutboundErrorCategory,
|
|
71
71
|
createOutboundDiagnosticCall,
|
|
@@ -85,13 +85,13 @@ import {
|
|
|
85
85
|
} from "./chunk-56GBUMO5.js";
|
|
86
86
|
import {
|
|
87
87
|
normalizeChatCompletionsBodyForProvider
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-4L4K6YR7.js";
|
|
89
89
|
import {
|
|
90
90
|
EMPTY_ASSISTANT_REPAIR_PROMPT
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-F3SOW2EU.js";
|
|
92
92
|
import {
|
|
93
93
|
getModelInfo
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-QA2C5NKI.js";
|
|
95
95
|
import {
|
|
96
96
|
isAbortError
|
|
97
97
|
} from "./chunk-7DPNBQSV.js";
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
} from "./chunk-5EMSBTQ6.js";
|
|
106
106
|
import {
|
|
107
107
|
getApiEndpoint
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-6EQD4AQL.js";
|
|
109
109
|
import {
|
|
110
110
|
isRecord
|
|
111
111
|
} from "./chunk-KUG52IAP.js";
|
|
@@ -573,7 +573,10 @@ var processToolData = createAsyncThunk(
|
|
|
573
573
|
const toolResult = await found.executor(executionToolArgs, thunkApi, {
|
|
574
574
|
parentMessageId,
|
|
575
575
|
toolRunId,
|
|
576
|
-
agentKey
|
|
576
|
+
agentKey,
|
|
577
|
+
// 定档信号:这里是前台对话流式路径,来源恒为 chat;对话 id 用于数历史搜索。
|
|
578
|
+
...args.dialogId ? { dialogId: args.dialogId } : {},
|
|
579
|
+
origin: "chat"
|
|
577
580
|
});
|
|
578
581
|
const rawData = toolResult?.rawData ?? toolResult;
|
|
579
582
|
const llmContext = asOptionalTrimmedString(toolResult?.llmContext);
|
|
@@ -750,7 +753,8 @@ var handleToolCalls = createAsyncThunk(
|
|
|
750
753
|
toolCall: { ...toolCall, id: toolCallId },
|
|
751
754
|
parentMessageId: messageId,
|
|
752
755
|
toolRunId,
|
|
753
|
-
agentKey: agentConfig.dbKey
|
|
756
|
+
agentKey: agentConfig.dbKey,
|
|
757
|
+
dialogId
|
|
754
758
|
})
|
|
755
759
|
).unwrap();
|
|
756
760
|
const toolName = result.toolName;
|