nolo-cli 0.32.0 → 0.33.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -12
- package/{_executeModel-LTMSIBS4.js → _executeModel-YXWAXPWQ.js} +77 -67
- package/{action-HI3VRQLP.js → action-OQWPNKAH.js} +17 -15
- package/{addContentAction-NCURJ6PK.js → addContentAction-YVINZQTF.js} +14 -13
- package/{addDialogAgentAction-RCY4ECF4.js → addDialogAgentAction-6IOCIEPI.js} +14 -13
- package/{agentDeleteCommand-D3MYZK6E.js → agentDeleteCommand-VGHWJN5T.js} +44 -60
- package/{agentEmailCommands-6BXS574I.js → agentEmailCommands-ZLRF35I3.js} +91 -81
- package/{agentGrantCommands-E7ZZFRHK.js → agentGrantCommands-2LEZDADN.js} +2 -2
- package/{agentListCommands-SF3HEUTT.js → agentListCommands-OHZJ7AFP.js} +75 -79
- package/{agentMachineCommands-YARVXRR6.js → agentMachineCommands-62PHPGTK.js} +43 -59
- package/{agentPullCommand-ARSIDNVC.js → agentPullCommand-TSWAJPS2.js} +5 -5
- package/agentRecordCommands-CW2JWERD.js +113 -0
- package/agentRunCommand-O4HV7YWA.js +131 -0
- package/{agentRuntimeLocal-ATGJY6WC.js → agentRuntimeLocal-4PSBNUOE.js} +37 -51
- package/{agentSlice-4XWW344Y.js → agentSlice-OUTQ5O72.js} +16 -14
- package/{appDeleteCommands-63JO7RXS.js → appDeleteCommands-VTDBVHYR.js} +40 -56
- package/{appDeployCommands-Y7EWYUGM.js → appDeployCommands-WOUP7MDA.js} +40 -56
- package/{appDeployStatusCommands-ZBEY3DWB.js → appDeployStatusCommands-N2NWZKEN.js} +40 -56
- package/{appGetCommands-QSSOSEYL.js → appGetCommands-GYKLWWCA.js} +40 -56
- package/{appListCommands-PH3XWNDX.js → appListCommands-RUWBSEJK.js} +40 -56
- package/{authCommand-BBDHMSO6.js → authCommand-YVXVH25I.js} +21 -20
- package/{authCommands-4UDEKRE6.js → authCommands-WTW6MEYS.js} +10 -10
- package/chatQueueReduxAdapter-2QJAD4KQ.js +181 -0
- package/{chunk-EEF23OOK.js → chunk-266VUBLK.js} +7 -7
- package/{chunk-TEYN42N3.js → chunk-2IVEXF7P.js} +11 -4
- package/{chunk-2HXKAPH7.js → chunk-2QLAVHVK.js} +6 -6
- package/{chunk-WTGCTVJG.js → chunk-2QTEYCR7.js} +3 -6
- package/{chunk-DOISARTV.js → chunk-2UECQ7RE.js} +1 -1
- package/{chunk-E3APEOIM.js → chunk-3GZXL6FM.js} +4 -19
- package/{chunk-KGEVMUMI.js → chunk-3RUW3ONU.js} +11 -11
- package/{chunk-RXVX5LFR.js → chunk-3UG2IIZ3.js} +1 -1
- package/{chunk-O5OMJPPF.js → chunk-3WXRAHCG.js} +6 -5
- package/{chunk-V54H24CQ.js → chunk-4F5M2MW5.js} +3 -3
- package/{chunk-2ZRP5RUG.js → chunk-4OV7DXFJ.js} +12 -11
- package/{chunk-W367V5CH.js → chunk-54BAYVCY.js} +404 -117
- package/{chunk-GAF5X6B7.js → chunk-5QW3O3ET.js} +284 -310
- package/{chunk-DLWCWUNW.js → chunk-64OVNZXE.js} +1197 -757
- package/{chunk-ODS2MVMU.js → chunk-66CWPJK2.js} +19 -303
- package/{chunk-PTHDLIRB.js → chunk-6KOS7ZBZ.js} +1 -1
- package/{chunk-MXFQHRSS.js → chunk-6XIE5ZGI.js} +1 -1
- package/{chunk-ATK5WJOA.js → chunk-6YXDOOSH.js} +4 -4
- package/{chunk-SWYMCHM7.js → chunk-75U775RZ.js} +69 -1
- package/{chunk-UDA3ZYLW.js → chunk-7YYHKBJP.js} +31 -72
- package/chunk-ADLYMQB6.js +642 -0
- package/{chunk-ZWJOGMKH.js → chunk-AETZ7AD6.js} +1 -1
- package/{chunk-43EPBPZ2.js → chunk-ASDXPOJH.js} +2 -2
- package/{chunk-44HACRCK.js → chunk-BANYWEYY.js} +4 -4
- package/chunk-BFPSVRCQ.js +1799 -0
- package/{chunk-TOW4E763.js → chunk-BJIRLHJR.js} +2 -0
- package/{chunk-ZJ2WITOO.js → chunk-BQXOGBFN.js} +2 -2
- package/{chunk-4PNU7W7K.js → chunk-C7H5GMXT.js} +107 -125
- package/chunk-CPYYM4RJ.js +98 -0
- package/{chunk-3GZT3L6F.js → chunk-DDVIBKIB.js} +326 -481
- package/{chunk-2K4NDPT5.js → chunk-DFUPZE6V.js} +20 -12
- package/{chunk-BGTUGS3T.js → chunk-DKMOY3QI.js} +4 -30
- package/chunk-EGRJC4ZN.js +91 -0
- package/{chunk-K6QEHQZ3.js → chunk-EKLRRZIN.js} +1 -1
- package/{chunk-6HYVJV7B.js → chunk-ESHYE7WU.js} +2 -1
- package/{chunk-XFG3BAKN.js → chunk-FMEVI5TG.js} +65 -0
- package/{chunk-U4TRT5V4.js → chunk-GEPHJJW4.js} +1 -1
- package/chunk-GJXRIOLS.js +241 -0
- package/{chunk-VP4WJWKW.js → chunk-GM6PU7B6.js} +431 -345
- package/chunk-HS7MLR74.js +38 -0
- package/{chunk-3AUWC6EM.js → chunk-HUCT7HID.js} +5 -84
- package/chunk-IDAU4UFS.js +437 -0
- package/{chunk-Q76I4SXI.js → chunk-IHEC7VBF.js} +1 -1
- package/{chunk-OWHNFZNW.js → chunk-IKWTTKWG.js} +4 -4
- package/{chunk-3LY4F7SV.js → chunk-INZZJSQF.js} +348 -331
- package/{chunk-ZJH3LKEW.js → chunk-IR6W62Q6.js} +102 -15
- package/{chunk-RH53LMEJ.js → chunk-J44TVX2O.js} +2 -4
- package/{chunk-CF2WZF4N.js → chunk-J6WH4PYZ.js} +0 -8
- package/chunk-KHCLMKZZ.js +3062 -0
- package/{chunk-WHLVPK32.js → chunk-KMSZPTM6.js} +27 -3
- package/{chunk-L3GCUVOH.js → chunk-KSRFVP36.js} +1 -1
- package/{chunk-XDHHF73Q.js → chunk-LUIHOUZC.js} +95 -95
- package/{chunk-UOJRKY5J.js → chunk-M2YMQOLC.js} +44 -53
- package/chunk-M3JEW6N6.js +193 -0
- package/{chunk-MITD7CON.js → chunk-MDIAECHA.js} +1461 -301
- package/{chunk-IXZX5CJK.js → chunk-MQRZ5QUH.js} +1 -1
- package/{chunk-3ASDTTEI.js → chunk-MRWGHF56.js} +2 -0
- package/{chunk-Q3CSL43H.js → chunk-N4XRDM26.js} +1 -1
- package/{chunk-D34RI6NI.js → chunk-NNWHHCVP.js} +75 -1
- package/{chunk-CAENRKNJ.js → chunk-OR2HNLVO.js} +126 -88
- package/chunk-OW765XBU.js +10 -0
- package/{chunk-VMWR7VNI.js → chunk-PRMMCFIN.js} +13 -9
- package/{chunk-JZPBVBIY.js → chunk-QTZD6HBK.js} +18 -8
- package/chunk-RCFIB45Q.js +28 -0
- package/{chunk-7S54ZGF6.js → chunk-RJKIB55Y.js} +256 -12
- package/chunk-RPRRIFXV.js +231 -0
- package/chunk-RQFO3CAF.js +300 -0
- package/chunk-RY57GLGW.js +188 -0
- package/{chunk-YHGHADBQ.js → chunk-SCUETSRP.js} +4 -4
- package/{chunk-TA6EA2A3.js → chunk-TFK3HUNQ.js} +182 -20
- package/{chunk-LAXMH7JY.js → chunk-UM4H3URE.js} +18 -15
- package/{chunk-6YABCOFU.js → chunk-UNHKVD2N.js} +1 -1
- package/{chunk-G5GVZAXF.js → chunk-UNOTBWZZ.js} +15 -19
- package/{chunk-GE6IWA5N.js → chunk-UNZDCI3O.js} +126 -1
- package/chunk-URMS4XY2.js +10 -0
- package/{chunk-SFWZUTCI.js → chunk-VBUQYOX7.js} +2 -2
- package/{chunk-FXFGNOT2.js → chunk-VFVCYIRQ.js} +1 -1
- package/chunk-VIDPVFP3.js +20 -0
- package/{chunk-5RDLGLAP.js → chunk-WJSW43QZ.js} +4 -7
- package/{chunk-CF7S2RYZ.js → chunk-WLH5BAKX.js} +6 -6
- package/{chunk-VVEH6XUE.js → chunk-X2DAEZ3X.js} +1 -1
- package/{chunk-2IJAKBK2.js → chunk-X664KVEV.js} +426 -246
- package/{chunk-3FCNXC2J.js → chunk-XRO5VGQ6.js} +3735 -1394
- package/chunk-Y5GCAMGP.js +9 -0
- package/{chunk-O3JR45Q2.js → chunk-YBMI5JAH.js} +44 -44
- package/{chunk-V42OE5HT.js → chunk-YDTYDA5W.js} +3 -3
- package/chunk-YYLHWIW6.js +48 -0
- package/{chunk-AOS5IN2I.js → chunk-ZHYK3N56.js} +1 -1
- package/{chunk-PJ2DDQQM.js → chunk-ZURFOV5J.js} +2 -2
- package/{chunk-3UGKATZQ.js → chunk-ZWS6DUHX.js} +26 -435
- package/chunk-ZZ2MH7LE.js +84 -0
- package/{cliExecutor-BBUVQU4L.js → cliExecutor-DW3PHGEL.js} +2 -2
- package/{clipboardy-BVE3LVEH.js → clipboardy-MMBYVRLF.js} +166 -372
- package/{codingSkills-V35TRR4Y.js → codingSkills-DY5MINPG.js} +5 -4
- package/{createAgentAutomationAction-WLRNE7C4.js → createAgentAutomationAction-H6ZRPXBR.js} +41 -31
- package/createDialogAction-UJ6LFJYM.js +61 -0
- package/{createPageAction-7YROVZ3W.js → createPageAction-KVPT3IRK.js} +57 -47
- package/{db-6DPSJ6WT.js → db-3H3JECGY.js} +45 -5
- package/{dbSlice-BBL3PEVW.js → dbSlice-UI2VCBLG.js} +13 -12
- package/{deleteFile-RJTEPOT4.js → deleteFile-XQXPBFFB.js} +7 -6
- package/dialogCommands-6ASXJP3H.js +82 -0
- package/{dialogSlice-N4HPG6HM.js → dialogSlice-B7KCGHMY.js} +37 -29
- package/{docCreateCommands-GRA5BHSA.js → docCreateCommands-S4E4MKVC.js} +42 -56
- package/{docDeleteCommands-ONIJM5MD.js → docDeleteCommands-M7XLKWRM.js} +44 -58
- package/{docReadCommands-H55VQ2US.js → docReadCommands-LSCMW2FR.js} +42 -56
- package/{docStore-B5AHDNW5.js → docStore-ZYWZWIRB.js} +40 -30
- package/{docUpdateCommands-ZQIQVGC2.js → docUpdateCommands-OMRBAFOB.js} +45 -59
- package/{fetchMessages-VPPQDDZ4.js → fetchMessages-7QRCCRYK.js} +3 -3
- package/{getPricing-QO5TYNCK.js → getPricing-L2ENXWHV.js} +7 -6
- package/{handleSendMessageAction-IN5XX5U7.js → handleSendMessageAction-Y2XKODRT.js} +39 -31
- package/index.js +74 -74
- package/{lib-FYYBQIXS.js → lib-2ZTNRXR4.js} +432 -183
- package/{localDialogRead-3DBXVYXS.js → localDialogRead-SLMPV5SK.js} +2 -2
- package/{localRuntimeAuthority-NDUA2D7Y.js → localRuntimeAuthority-S77B5QVB.js} +10 -4
- package/{localRuntimeDb-GKYRBWLQ.js → localRuntimeDb-N3H3HQ7G.js} +1 -1
- package/{machineCommands-H3UMKE76.js → machineCommands-62RUZVSW.js} +95 -85
- package/{machineInfo-M6KB6HZN.js → machineInfo-66ZFUMLE.js} +1 -1
- package/machineWsRunDispatch-L3HD3FSF.js +129 -0
- package/{models-WDUTTYFS.js → models-OX2S5C6Q.js} +2 -2
- package/{offlineMarxistsAgentCommand-E6LUG63A.js → offlineMarxistsAgentCommand-GEH6SNNA.js} +1 -1
- package/package.json +1 -4
- package/{read-64OQDO3I.js → read-2VHEHCAN.js} +8 -7
- package/{readDocTool-MXM3T6PE.js → readDocTool-CSWD6NPC.js} +1 -2
- package/{readlineWorkspace-XVJZDCSC.js → readlineWorkspace-3MOJWFM7.js} +3358 -3409
- package/{removeDialogAgentAction-NEKVAMSH.js → removeDialogAgentAction-2T7BPM3T.js} +19 -17
- package/{runAgentClientLoop-H7U53QB6.js → runAgentClientLoop-Y5UW544I.js} +73 -64
- package/{runtimeDoctorCommands-WI2YZUSJ.js → runtimeDoctorCommands-KHGQKT3B.js} +6 -6
- package/{setDialogExtraReferencesAction-WTOHQDIV.js → setDialogExtraReferencesAction-GPT37HTW.js} +15 -14
- package/{setPrimaryDialogAgentAction-LDJOYC4F.js → setPrimaryDialogAgentAction-3746P7IW.js} +19 -17
- package/{settingSlice-4M37TN7V.js → settingSlice-FIFOQ6OR.js} +16 -14
- package/{skillDiscovery-5U6RYAHN.js → skillDiscovery-KLLKXPUO.js} +4 -4
- package/{slateUtils-2M7MUTWX.js → slateUtils-VO2FU36K.js} +1 -1
- package/{spaceCommands-7VVKJBDV.js → spaceCommands-NKSBD5G3.js} +45 -241
- package/{spaceSlice-T6YK6D34.js → spaceSlice-L44CI2QR.js} +39 -61
- package/{streamAgentChatTurn-RQ63QFQ7.js → streamAgentChatTurn-7DU4Z2VJ.js} +1262 -150
- package/{switchDialogAgentAction-XVWGKR2Z.js → switchDialogAgentAction-MQTUTQHL.js} +14 -13
- package/syncMapping-RK2MANUX.js +43 -0
- package/{tableCommands-RJZ3V4TF.js → tableCommands-64FZBAI3.js} +9 -8
- package/{toolApiClient-ARGFDJAG.js → toolApiClient-B2MFXMEG.js} +3 -3
- package/tools-2JI52WJP.js +99 -0
- package/{tuiSummaryLlmCaller-SRZ4QQUP.js → tuiSummaryLlmCaller-EAWQ3IZX.js} +25 -21
- package/{updateCommands-AK2RDOFR.js → updateCommands-MNDUIKN7.js} +2 -2
- package/{updateDialogTitleAction-BBDSWHNG.js → updateDialogTitleAction-HW33OIJI.js} +49 -38
- package/agentRecordCommands-JFZRQJQ4.js +0 -103
- package/agentRunCommand-NOX5FLKO.js +0 -121
- package/chunk-AYMOSAHE.js +0 -3158
- package/chunk-D2BPX6DQ.js +0 -1707
- package/chunk-DCDL3GC4.js +0 -171
- package/chunk-F3MP7CP6.js +0 -73
- package/chunk-WZSRQNQG.js +0 -2587
- package/createDialogAction-Y6YV64QB.js +0 -52
- package/dialogCommands-XLO5CAHZ.js +0 -95
- package/machineWsRunDispatch-HONRUK3R.js +0 -119
- package/tools-KYZX3BGO.js +0 -90
- package/{chunk-Z5MXSEOJ.js → chunk-RQSOAMPJ.js} +2 -2
- package/{chunk-JDSUTNYY.js → chunk-SAQQLJZ5.js} +3 -3
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GMI_CHAT_COMPLETIONS_URL,
|
|
3
|
-
|
|
4
|
-
PLATFORM_HOSTED_KIMI_K26_MODEL,
|
|
3
|
+
PLATFORM_HOSTED_DEEPSEEK_FLASH_VISION_EXP_MODEL,
|
|
5
4
|
PLATFORM_HOSTED_KIMI_PROVIDER,
|
|
6
5
|
cloudflareModels,
|
|
7
6
|
deepinfraModels,
|
|
@@ -14,7 +13,7 @@ import {
|
|
|
14
13
|
platformHostedModels,
|
|
15
14
|
xaiModels,
|
|
16
15
|
zaiModels
|
|
17
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OR2HNLVO.js";
|
|
18
17
|
|
|
19
18
|
// packages/integrations/anthropic/anthropicModels.ts
|
|
20
19
|
var anthropicModels = [
|
|
@@ -1207,6 +1206,7 @@ var referenceItemSchema = pipe(
|
|
|
1207
1206
|
// packages/ai/llm/reasoningModels.ts
|
|
1208
1207
|
var REASONING_MODEL_NAMES = /* @__PURE__ */ new Set([
|
|
1209
1208
|
"deepseek-v4-flash",
|
|
1209
|
+
"deepseek-v4-flash-vision-exp",
|
|
1210
1210
|
"deepseek-v4-pro",
|
|
1211
1211
|
"gemini-3.7-flash",
|
|
1212
1212
|
"gemini-3.6-flash",
|
|
@@ -1219,6 +1219,7 @@ var REASONING_MODEL_NAMES = /* @__PURE__ */ new Set([
|
|
|
1219
1219
|
"gpt-5.6-sol",
|
|
1220
1220
|
"gpt-5.6-terra",
|
|
1221
1221
|
"gpt-5.6-luna",
|
|
1222
|
+
"glm-5.3",
|
|
1222
1223
|
"glm-5.2",
|
|
1223
1224
|
"kimi-k3",
|
|
1224
1225
|
// Legacy OpenAI catalog ids — still support reasoning UI for agents that
|
|
@@ -1316,10 +1317,13 @@ var ANTHROPIC_MODEL_ALIASES = {
|
|
|
1316
1317
|
"claude-sonnet-4.6": "claude-3-7-sonnet-latest",
|
|
1317
1318
|
"claude-sonnet-4.5": "claude-3-5-sonnet-latest"
|
|
1318
1319
|
};
|
|
1320
|
+
var NOLO_MODEL_ALIASES = {
|
|
1321
|
+
"glm-5.2": "glm-5.3"
|
|
1322
|
+
};
|
|
1319
1323
|
var normalizeLookupProvider = (provider) => {
|
|
1320
1324
|
if (!provider) return null;
|
|
1321
1325
|
const normalized = provider.toLowerCase();
|
|
1322
|
-
if (normalized === "ollama-cloud") {
|
|
1326
|
+
if (normalized === "ollama-cloud" || normalized === "deepseek") {
|
|
1323
1327
|
return "nolo";
|
|
1324
1328
|
}
|
|
1325
1329
|
if (normalized in MODEL_LOOKUP_MAP) {
|
|
@@ -1331,6 +1335,9 @@ var normalizeLookupModelName = (provider, name) => {
|
|
|
1331
1335
|
if (provider === "anthropic") {
|
|
1332
1336
|
return ANTHROPIC_MODEL_ALIASES[name] ?? name;
|
|
1333
1337
|
}
|
|
1338
|
+
if (provider === "nolo") {
|
|
1339
|
+
return NOLO_MODEL_ALIASES[name] ?? name;
|
|
1340
|
+
}
|
|
1334
1341
|
return name;
|
|
1335
1342
|
};
|
|
1336
1343
|
var toModel = (candidate) => ({
|
|
@@ -1339,6 +1346,8 @@ var toModel = (candidate) => ({
|
|
|
1339
1346
|
hasVision: typeof candidate.hasVision === "boolean" ? candidate.hasVision : !!candidate.supportVision,
|
|
1340
1347
|
contextWindow: candidate.contextWindow,
|
|
1341
1348
|
price: candidate.price ?? candidate.pricing ?? { input: 0, output: 0 },
|
|
1349
|
+
peakPrice: candidate.peakPrice,
|
|
1350
|
+
offPeakPrice: candidate.offPeakPrice,
|
|
1342
1351
|
pricingStrategy: candidate.pricingStrategy,
|
|
1343
1352
|
serviceTierPriceMultipliers: candidate.serviceTierPriceMultipliers,
|
|
1344
1353
|
maxOutputTokens: candidate.maxOutputTokens ?? candidate.maxTokens,
|
|
@@ -1413,13 +1422,9 @@ var API_ENDPOINTS = {
|
|
|
1413
1422
|
fireworks: {
|
|
1414
1423
|
default: "https://api.fireworks.ai/inference/v1/chat/completions"
|
|
1415
1424
|
},
|
|
1416
|
-
nolo
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
// Legacy agent records may still store provider=ollama-cloud
|
|
1420
|
-
"ollama-cloud": {
|
|
1421
|
-
default: PLATFORM_HOSTED_CHAT_COMPLETIONS_URL
|
|
1422
|
-
},
|
|
1425
|
+
/* 平台托管 provider(nolo / legacy ollama-cloud / deepseek)不放本地默认端点:
|
|
1426
|
+
* 直连语义已移除(历史 ollama.com 兜底废弃),端点由服务端按模型决议;
|
|
1427
|
+
* getApiEndpoint 对它们直接返回 ""。 */
|
|
1423
1428
|
cloudflare: {
|
|
1424
1429
|
default: "__cloudflare_workers_ai_chat_completions__"
|
|
1425
1430
|
},
|
|
@@ -1452,7 +1457,7 @@ function getProviderByModelName(modelName) {
|
|
|
1452
1457
|
}
|
|
1453
1458
|
var DEFAULT_MODEL = {
|
|
1454
1459
|
provider: PLATFORM_HOSTED_KIMI_PROVIDER,
|
|
1455
|
-
name:
|
|
1460
|
+
name: PLATFORM_HOSTED_DEEPSEEK_FLASH_VISION_EXP_MODEL
|
|
1456
1461
|
};
|
|
1457
1462
|
function getApiEndpoint(agent) {
|
|
1458
1463
|
const { provider, customProviderUrl, endpointKey, model } = agent;
|
|
@@ -1477,6 +1482,9 @@ function getApiEndpoint(agent) {
|
|
|
1477
1482
|
"claude",
|
|
1478
1483
|
"cursor"
|
|
1479
1484
|
]);
|
|
1485
|
+
if (effectiveProvider === "nolo" || effectiveProvider === "ollama-cloud" || effectiveProvider === "deepseek") {
|
|
1486
|
+
return "";
|
|
1487
|
+
}
|
|
1480
1488
|
if (!effectiveProvider || effectiveProvider.toLowerCase() === "custom" || agent.apiSource === "custom") {
|
|
1481
1489
|
if (agent.useServerProxy) {
|
|
1482
1490
|
return "";
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-DWLEOOGR.js";
|
|
4
4
|
import {
|
|
5
5
|
addContentAction
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4F5M2MW5.js";
|
|
7
7
|
import {
|
|
8
8
|
upload
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UM4H3URE.js";
|
|
10
10
|
import {
|
|
11
11
|
getRuntimeServerContext
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-X664KVEV.js";
|
|
13
13
|
import {
|
|
14
14
|
API_ENDPOINTS
|
|
15
15
|
} from "./chunk-LCBAMY2M.js";
|
|
@@ -25,30 +25,6 @@ var estimateTokenCount = (text) => {
|
|
|
25
25
|
return Math.ceil(chineseChars * 1.5 + otherChars * 0.25);
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
// packages/chat/dialog/actions/builtinDialogLlm.ts
|
|
29
|
-
var BASE_BUILTIN_DIALOG_LLM_CONFIG = {
|
|
30
|
-
apiSource: "platform",
|
|
31
|
-
useServerProxy: true
|
|
32
|
-
};
|
|
33
|
-
var BUILTIN_TITLE_LLM_CONFIG = {
|
|
34
|
-
...BASE_BUILTIN_DIALOG_LLM_CONFIG,
|
|
35
|
-
provider: "nolo",
|
|
36
|
-
id: "builtin-dialog-title-llm",
|
|
37
|
-
name: "Builtin Dialog Title LLM",
|
|
38
|
-
model: "deepseek-v4-flash",
|
|
39
|
-
prompt: "You are a title generator for chat history. \u4F60\u53EA\u505A\u4E00\u4EF6\u4E8B\uFF1A\u6839\u636E\u5BF9\u8BDD\u5185\u5BB9\u8F93\u51FA\u6700\u7EC8\u6807\u9898\u3002\u786C\u6027\u89C4\u5219\uFF1A1) \u53EA\u8F93\u51FA\u6807\u9898\u8FD9\u4E00\u884C\uFF1B\u4E25\u7981\u8F93\u51FA\u63A8\u7406\u3001\u5206\u6790\u3001\u6B65\u9AA4\u3001\u89E3\u91CA\u3001\u524D\u8A00\u3001\u540E\u8BB0\u3001\u7FFB\u8BD1\u3001\u81F4\u6B49\u6216\u4EFB\u4F55\u989D\u5916\u8BF4\u660E\u30022) \u4E0D\u8981\u56DE\u7B54\u7528\u6237\u8BF7\u6C42\uFF0C\u4E0D\u8981\u5199\u6458\u8981\uFF0C\u53EA\u7ED9\u6807\u9898\u7ED3\u679C\u30023) \u6807\u9898\u5C3D\u91CF\u77ED\uFF1A\u901A\u5E38 2-5 \u4E2A\u8BCD\uFF0C\u82F1\u6587\u4E0D\u8D85\u8FC7 6 \u4E2A\u8BCD\u30024) \u4F7F\u7528\u5BF9\u8BDD\u4E3B\u8BED\u8A00\uFF1B\u6DF7\u5408\u8BED\u8A00\u65F6\u4F18\u5148\u7528\u6237\u4E3B\u8981\u8BED\u8A00\u30025) \u4F18\u5148\u590D\u7528\u5BF9\u8BDD\u4E2D\u7684\u5177\u4F53\u4E3B\u9898\u8BCD\uFF0C\u907F\u514D issue\u3001help\u3001discussion\u3001analysis\u3001update \u8FD9\u7C7B\u7A7A\u6CDB\u8BCD\u30026) \u5FFD\u7565 tool JSON\u3001\u51FD\u6570\u540D\u3001branch label\u3001agent \u540D\u3001\u7CFB\u7EDF\u6307\u4EE4\u548C\u7F16\u6392\u75D5\u8FF9\uFF08\u5982 GPT\u3001Claude\u3001Gemini\uFF09\uFF1B\u6807\u9898\u8981\u843D\u5728\u7528\u6237\u771F\u6B63\u8BA8\u8BBA\u7684\u5BF9\u8C61\u6216\u51B3\u7B56\u4E0A\u30027) \u66F4\u504F\u597D\u201C\u5BF9\u8C61 + \u52A8\u4F5C/\u5224\u65AD\u201D\u7684\u77ED\u6807\u9898\uFF0C\u4F8B\u5982\u201CAI \u90AE\u4EF6\u52A9\u624B\u53D6\u820D\u201D\u201C\u4E1C\u4EAC\u56DB\u65E5\u6162\u65C5\u884C\u201D\u201C\u91CD\u590D\u6263\u8D39\u9000\u6B3E\u201D\u30028) \u7EAF\u6587\u672C\uFF0C\u4E0D\u8981\u9879\u76EE\u7B26\u53F7\u3001\u7F16\u53F7\u3001markdown\u3001emoji\u3002\u6700\u7EC8\u53EA\u8FD4\u56DE\u6807\u9898\u6587\u672C\u3002 Output only the title text."
|
|
40
|
-
};
|
|
41
|
-
var BUILTIN_SUMMARY_LLM_CONFIG = {
|
|
42
|
-
...BASE_BUILTIN_DIALOG_LLM_CONFIG,
|
|
43
|
-
provider: "nolo",
|
|
44
|
-
id: "builtin-dialog-summary-llm",
|
|
45
|
-
name: "Builtin Dialog Summary LLM",
|
|
46
|
-
model: "deepseek-v4-flash",
|
|
47
|
-
// @deprecated 用 COMPACTION_SUMMARY_SYSTEM_PROMPT(packages/ai/context/compactionShared.ts)。
|
|
48
|
-
// 生产代码已全部迁移;此旧两段式 prompt 仅被 scripts/probes/dialog 探针脚本使用,待探针迁移后删除。
|
|
49
|
-
prompt: "\u4F60\u662F\u4E00\u4E2A\u4E13\u4E1A\u7684\u5BF9\u8BDD\u8BB0\u5FC6\u52A9\u7406\u3002\u8BF7\u57FA\u4E8E\u3010\u73B0\u6709\u8BB0\u5FC6\u3011\u548C\u3010\u65B0\u589E\u5BF9\u8BDD\u3011\uFF0C\u8F93\u51FA\u4E00\u4EFD\u66F4\u65B0\u540E\u7684\u5BF9\u8BDD\u8BB0\u5FC6\u6863\u6848\u3002\u4E25\u683C\u53EA\u8F93\u51FA\u4E0B\u9762\u4E24\u90E8\u5206\uFF0C\u6807\u9898\u5FC5\u987B\u5B8C\u5168\u4E00\u81F4\uFF1A\n\u5173\u952E\u4E8B\u5B9E\u6863\u6848\n- ...\n\u5BF9\u8BDD\u5267\u60C5\u6458\u8981\n- ...\n\u8981\u6C42\uFF1A1) \u4F7F\u7528\u5BF9\u8BDD\u4E3B\u8BED\u8A00\uFF1B\u6DF7\u5408\u8BED\u8A00\u65F6\u4F18\u5148\u8DDF\u968F\u7528\u6237\u4E3B\u8981\u8BED\u8A00\uFF0C\u4E13\u6709\u540D\u8BCD\u4FDD\u7559\u539F\u6587\u30022) \u5173\u952E\u4E8B\u5B9E\u6863\u6848\u53EA\u4FDD\u7559\u4E4B\u540E\u7EE7\u7EED\u5BF9\u8BDD\u4ECD\u6709\u4EF7\u503C\u7684\u4FE1\u606F\uFF0C\u4F8B\u5982\u7528\u6237\u504F\u597D\u3001\u76EE\u6807\u3001\u7EA6\u675F\u3001\u6280\u672F\u6808\u3001\u786E\u5B9A\u7684\u6587\u4EF6\u540D/\u53D8\u91CF\u540D\u3001\u6838\u5FC3\u51B3\u7B56\u3001\u5F85\u529E\u4E8B\u9879\u30023) \u5BF9\u8BDD\u5267\u60C5\u6458\u8981\u5148\u6781\u7B80\u6982\u62EC\u65E7\u4E0A\u4E0B\u6587\uFF0C\u518D\u66F4\u8BE6\u7EC6\u8BB0\u5F55\u6700\u8FD1\u65B0\u589E\u7684\u8FDB\u5C55\u3001\u5206\u6B67\u3001\u7ED3\u8BBA\u548C\u4E0B\u4E00\u6B65\u30024) \u5FFD\u7565\u5BD2\u6684\u3001\u91CD\u590D\u5C1D\u8BD5\u3001\u5DF2\u653E\u5F03\u65B9\u6848\u548C\u65E0\u4EF7\u503C\u5E9F\u8BDD\u30025) \u4E0D\u8981\u7F16\u9020\u672A\u51FA\u73B0\u7684\u4FE1\u606F\uFF0C\u4E0D\u8981\u8F93\u51FA\u5F00\u573A\u767D\u3001\u7ED3\u675F\u8BED\u3001markdown \u4EE3\u7801\u5757\u6216\u989D\u5916\u7AE0\u8282\u3002"
|
|
50
|
-
};
|
|
51
|
-
|
|
52
28
|
// packages/core/chat/messageContentSerialize.ts
|
|
53
29
|
var serializeMessageContent = (content, imagePlaceholder = "[\u56FE\u7247]") => {
|
|
54
30
|
if (typeof content === "string") {
|
|
@@ -685,13 +661,11 @@ function clipCompactText(value, max, ellipsis = "...") {
|
|
|
685
661
|
|
|
686
662
|
export {
|
|
687
663
|
clipCompactText,
|
|
664
|
+
planContextUsage,
|
|
688
665
|
estimateTokenCount,
|
|
689
666
|
buildDatabaseFileContentUrl,
|
|
690
|
-
BUILTIN_TITLE_LLM_CONFIG,
|
|
691
|
-
BUILTIN_SUMMARY_LLM_CONFIG,
|
|
692
667
|
serializeMessageContent,
|
|
693
668
|
normalizeAssistantContentBuffer,
|
|
694
|
-
planContextUsage,
|
|
695
669
|
planCompression,
|
|
696
670
|
COMPACTION_SUMMARY_SYSTEM_PROMPT,
|
|
697
671
|
buildCompactionUserContent,
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import {
|
|
2
|
+
dialogMessageKey
|
|
3
|
+
} from "./chunk-KMSZPTM6.js";
|
|
4
|
+
import {
|
|
5
|
+
asOptionalFiniteNumber
|
|
6
|
+
} from "./chunk-WWC7I6TA.js";
|
|
7
|
+
import {
|
|
8
|
+
asOptionalTrimmedString
|
|
9
|
+
} from "./chunk-G3SUCT4W.js";
|
|
10
|
+
|
|
11
|
+
// packages/core/chat/dialogAttachmentCleanup.ts
|
|
12
|
+
var FILE_CONTENT_RE = /(?:https?:\/\/[^/"'\s]+)?\/api\/v1\/db\/file\/content\/([^?#"'\s)]+)/g;
|
|
13
|
+
function extractFileContentIds(value) {
|
|
14
|
+
const ids = /* @__PURE__ */ new Set();
|
|
15
|
+
const visit = (input) => {
|
|
16
|
+
if (typeof input === "string") {
|
|
17
|
+
for (const match of input.matchAll(FILE_CONTENT_RE)) {
|
|
18
|
+
const fileId = decodeURIComponent(match[1] ?? "").trim();
|
|
19
|
+
if (fileId) ids.add(fileId);
|
|
20
|
+
}
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (Array.isArray(input)) {
|
|
24
|
+
for (const item of input) visit(item);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (input && typeof input === "object") {
|
|
28
|
+
for (const item of Object.values(input)) visit(item);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
visit(value);
|
|
32
|
+
return [...ids];
|
|
33
|
+
}
|
|
34
|
+
function messageDbKey(dialogId, message) {
|
|
35
|
+
const dbKey = asOptionalTrimmedString(message.dbKey);
|
|
36
|
+
if (dbKey) return dbKey;
|
|
37
|
+
const id = asOptionalTrimmedString(message.id);
|
|
38
|
+
if (id) return dialogMessageKey(dialogId, id);
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
function asText(value) {
|
|
42
|
+
return asOptionalTrimmedString(value) ?? null;
|
|
43
|
+
}
|
|
44
|
+
function buildDialogAttachmentPlan(args) {
|
|
45
|
+
const messageKeys = new Set(
|
|
46
|
+
args.messages.map((message) => messageDbKey(args.dialogId, message)).filter((key) => Boolean(key))
|
|
47
|
+
);
|
|
48
|
+
const referencedFileIds = [
|
|
49
|
+
...new Set(args.messages.flatMap((message) => extractFileContentIds(message)))
|
|
50
|
+
];
|
|
51
|
+
const candidates = referencedFileIds.map((fileId) => {
|
|
52
|
+
const metadata = args.metadataByFileId[fileId];
|
|
53
|
+
const ownerType = asText(metadata?.ownerType);
|
|
54
|
+
const ownerId = asText(metadata?.ownerId);
|
|
55
|
+
const ownerDbKey = asText(metadata?.ownerDbKey);
|
|
56
|
+
const fileDbKey = asText(metadata?.dbKey);
|
|
57
|
+
const source = asText(metadata?.source);
|
|
58
|
+
const ownedByDialog = ownerType === "dialog" && ownerId === args.dialogId;
|
|
59
|
+
const ownedByMessage = Boolean(ownerDbKey && messageKeys.has(ownerDbKey));
|
|
60
|
+
const userOwnedReferenced = args.includeUserOwnedReferenced === true && Boolean(args.ownerId) && ownerType === "user" && ownerId === args.ownerId;
|
|
61
|
+
const canDelete = Boolean(fileDbKey && (ownedByDialog || ownedByMessage || userOwnedReferenced));
|
|
62
|
+
return {
|
|
63
|
+
fileId,
|
|
64
|
+
fileDbKey,
|
|
65
|
+
size: asOptionalFiniteNumber(metadata?.size) ?? null,
|
|
66
|
+
ownerType,
|
|
67
|
+
ownerId,
|
|
68
|
+
ownerDbKey,
|
|
69
|
+
source,
|
|
70
|
+
status: canDelete ? "delete" : "retain",
|
|
71
|
+
reason: canDelete ? ownedByMessage ? "ownerDbKey matches a message in this dialog" : userOwnedReferenced ? "user-owned file is referenced by this dialog and explicit referenced-attachment deletion is enabled" : "ownerType/ownerId matches this dialog" : fileDbKey ? "file ownership is not exclusive to this dialog" : "file metadata not found"
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
const deleteCandidates = candidates.filter((candidate) => candidate.status === "delete");
|
|
75
|
+
const retainedCandidates = candidates.filter((candidate) => candidate.status === "retain");
|
|
76
|
+
return {
|
|
77
|
+
dialogId: args.dialogId,
|
|
78
|
+
messageCount: args.messages.length,
|
|
79
|
+
referencedFileIds,
|
|
80
|
+
candidates,
|
|
81
|
+
deleteCandidates,
|
|
82
|
+
retainedCandidates,
|
|
83
|
+
bytesToDelete: deleteCandidates.reduce((sum, candidate) => sum + (candidate.size ?? 0), 0),
|
|
84
|
+
metadataReadFailures: args.metadataReadFailures ?? []
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
extractFileContentIds,
|
|
90
|
+
buildDialogAttachmentPlan
|
|
91
|
+
};
|
|
@@ -66,7 +66,8 @@ function detectRuntimeCapabilities(options = {}) {
|
|
|
66
66
|
// packages/connector-experimental/machineInfo.ts
|
|
67
67
|
var CONNECTOR_VERSION = "0.1.0-experimental";
|
|
68
68
|
function defaultMachineIdPath() {
|
|
69
|
-
|
|
69
|
+
const noloHome = process.env.NOLO_HOME?.trim();
|
|
70
|
+
return noloHome ? join2(noloHome, "machine-id") : join2(homedir(), ".nolo", "machine-id");
|
|
70
71
|
}
|
|
71
72
|
function resolveMachineId(path = defaultMachineIdPath()) {
|
|
72
73
|
try {
|
|
@@ -1,3 +1,67 @@
|
|
|
1
|
+
// packages/agent-runtime/userResponseLanguage.ts
|
|
2
|
+
var LANGUAGE_NAMES = {
|
|
3
|
+
en: "English",
|
|
4
|
+
"en-US": "English",
|
|
5
|
+
"en-GB": "English",
|
|
6
|
+
zh: "Simplified Chinese",
|
|
7
|
+
"zh-CN": "Simplified Chinese",
|
|
8
|
+
"zh-TW": "Traditional Chinese",
|
|
9
|
+
"zh-HK": "Traditional Chinese",
|
|
10
|
+
ja: "Japanese",
|
|
11
|
+
"ja-JP": "Japanese",
|
|
12
|
+
ko: "Korean",
|
|
13
|
+
"ko-KR": "Korean",
|
|
14
|
+
fr: "French",
|
|
15
|
+
de: "German",
|
|
16
|
+
es: "Spanish",
|
|
17
|
+
pt: "Portuguese",
|
|
18
|
+
ru: "Russian"
|
|
19
|
+
};
|
|
20
|
+
var LANGUAGE_DISPLAY_NAMES = new Intl.DisplayNames(["en"], {
|
|
21
|
+
type: "language"
|
|
22
|
+
});
|
|
23
|
+
var asLocale = (value) => typeof value === "string" ? value.trim().split(".", 1)[0]?.replace(/_/g, "-") ?? "" : "";
|
|
24
|
+
var normalizeLocale = (value) => {
|
|
25
|
+
if (!value) return "en-US";
|
|
26
|
+
let locale;
|
|
27
|
+
try {
|
|
28
|
+
locale = new Intl.Locale(value);
|
|
29
|
+
} catch {
|
|
30
|
+
return "en-US";
|
|
31
|
+
}
|
|
32
|
+
const language = locale.language.toLowerCase();
|
|
33
|
+
const region = locale.region?.toUpperCase();
|
|
34
|
+
const script = locale.script;
|
|
35
|
+
if (language === "zh") {
|
|
36
|
+
if (script === "Hant" || region === "TW" || region === "HK" || region === "MO") {
|
|
37
|
+
return "zh-TW";
|
|
38
|
+
}
|
|
39
|
+
return "zh-CN";
|
|
40
|
+
}
|
|
41
|
+
if (language === "en") return region === "GB" ? "en-GB" : "en-US";
|
|
42
|
+
if (region) return `${language}-${region}`;
|
|
43
|
+
return language;
|
|
44
|
+
};
|
|
45
|
+
var resolveUserResponseLanguage = (input = {}) => {
|
|
46
|
+
const raw = asLocale(input.responseLanguage) || asLocale(input.language) || asLocale(input.fallbackLanguage) || "en-US";
|
|
47
|
+
const locale = normalizeLocale(raw);
|
|
48
|
+
return {
|
|
49
|
+
locale,
|
|
50
|
+
languageName: LANGUAGE_NAMES[locale] ?? LANGUAGE_NAMES[locale.split("-")[0]] ?? LANGUAGE_DISPLAY_NAMES.of(locale) ?? locale
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
var buildUserResponseLanguageContext = (input = {}) => {
|
|
54
|
+
const { locale, languageName } = resolveUserResponseLanguage(input);
|
|
55
|
+
return [
|
|
56
|
+
"--- \u5E73\u53F0\u56DE\u590D\u8BED\u8A00\u7B56\u7565 ---",
|
|
57
|
+
`\u7528\u6237\u5BA2\u6237\u7AEF\u8BED\u8A00\uFF1A${languageName}\uFF08${locale}\uFF09`,
|
|
58
|
+
"\u9ED8\u8BA4\u4F7F\u7528\u7528\u6237\u5BA2\u6237\u7AEF\u8BED\u8A00\u56DE\u590D\u3002",
|
|
59
|
+
"\u7528\u6237\u5728\u5F53\u524D\u5BF9\u8BDD\u4E2D\u660E\u786E\u8981\u6C42\u4F7F\u7528\u5176\u4ED6\u8BED\u8A00\u65F6\uFF0C\u9075\u5FAA\u7528\u6237\u7684\u660E\u786E\u8981\u6C42\u3002",
|
|
60
|
+
"\u5355\u4E2A\u901A\u7528\u8BCD\u6216\u77ED\u8BED\uFF08\u4F8B\u5982 hi\u3001ok\u3001thanks\uFF09\u4E0D\u6539\u53D8\u5DF2\u7ECF\u5EFA\u7ACB\u7684\u4EA4\u6D41\u8BED\u8A00\u3002",
|
|
61
|
+
"Agent \u7684\u89D2\u8272\u3001skill\u3001model \u4E0D\u5F97\u81EA\u884C\u8986\u76D6\u8FD9\u6761\u5E73\u53F0\u56DE\u590D\u8BED\u8A00\u7B56\u7565\u3002"
|
|
62
|
+
].join("\n");
|
|
63
|
+
};
|
|
64
|
+
|
|
1
65
|
// packages/agent-runtime/staleReplayGuard.ts
|
|
2
66
|
var wrapHistoricalSummaryWithReplayGuard = (summary) => {
|
|
3
67
|
const trimmed = summary.trim();
|
|
@@ -20,6 +84,7 @@ var MEMORY_USE_GUIDANCE = `--- \u8BB0\u5FC6\u4F7F\u7528\u65B9\u5F0F ---
|
|
|
20
84
|
- \u3010\u964D\u6743/\u5F52\u6863\u3011\u8BB0\u5FC6\u4E0D\u53EF\u7269\u7406\u5220\u9664\uFF0C\u53EA\u80FD\u964D\u6743/\u5F52\u6863\u3002\u9519\u8BEF\u7684\u8BB0\u5FC6\u5E94\u4FEE\u6B63\u5E76\u964D\u4F4E\u7F6E\u4FE1\u5EA6\uFF0C\u800C\u4E0D\u662F\u5220\u9664\u2014\u2014\u4FDD\u7559\u6863\u6848\u4F9B\u5BA1\u8BA1\u3002`;
|
|
21
85
|
|
|
22
86
|
export {
|
|
87
|
+
buildUserResponseLanguageContext,
|
|
23
88
|
wrapHistoricalSummaryWithReplayGuard,
|
|
24
89
|
MEMORY_USE_GUIDANCE
|
|
25
90
|
};
|
|
@@ -194,7 +194,7 @@ function readCliAuthorityDriver(env) {
|
|
|
194
194
|
function resolveCliAuthorityRunDir(options = {}) {
|
|
195
195
|
return path.join(resolveNoloHome({
|
|
196
196
|
...options,
|
|
197
|
-
env: options.env ??
|
|
197
|
+
env: options.env ?? process.env
|
|
198
198
|
}), "run");
|
|
199
199
|
}
|
|
200
200
|
function hashString(value) {
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MODEL_LOOKUP_MAP
|
|
3
|
+
} from "./chunk-DFUPZE6V.js";
|
|
4
|
+
import {
|
|
5
|
+
ALL_MODELS
|
|
6
|
+
} from "./chunk-2QTEYCR7.js";
|
|
7
|
+
import {
|
|
8
|
+
PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
|
|
9
|
+
builtinAgentCatalogEntryById,
|
|
10
|
+
builtinRuntimeFallbackEntries,
|
|
11
|
+
isBuiltinPlatformAgentKey
|
|
12
|
+
} from "./chunk-IR6W62Q6.js";
|
|
13
|
+
import {
|
|
14
|
+
parsePublicAgentId,
|
|
15
|
+
publicAgentKey
|
|
16
|
+
} from "./chunk-BJIRLHJR.js";
|
|
17
|
+
|
|
18
|
+
// packages/agent-runtime/builtinPlatformAgentRoute.ts
|
|
19
|
+
function resolveBuiltinAgentRuntimeFields(agentKey) {
|
|
20
|
+
if (!isBuiltinPlatformAgentKey(agentKey)) return null;
|
|
21
|
+
const entry = builtinAgentCatalogEntryById(parsePublicAgentId(agentKey));
|
|
22
|
+
if (!entry) return null;
|
|
23
|
+
return { provider: entry.provider, model: entry.model };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// packages/agent-runtime/builtinPlatformAgentConfigs.ts
|
|
27
|
+
function buildConfig(e) {
|
|
28
|
+
const key = publicAgentKey(e.id);
|
|
29
|
+
const rawRecord = {
|
|
30
|
+
dbKey: key,
|
|
31
|
+
isPublic: true,
|
|
32
|
+
provider: e.provider,
|
|
33
|
+
model: e.model,
|
|
34
|
+
apiSource: e.apiSource ?? "platform",
|
|
35
|
+
useServerProxy: e.useServerProxy ?? true
|
|
36
|
+
};
|
|
37
|
+
if (e.hasImageOutput) rawRecord.hasImageOutput = true;
|
|
38
|
+
if (e.imageModel) rawRecord.imageModel = e.imageModel;
|
|
39
|
+
if (e.imageWorkflow) rawRecord.imageWorkflow = e.imageWorkflow;
|
|
40
|
+
if (e.imageConfig) rawRecord.imageConfig = e.imageConfig;
|
|
41
|
+
return {
|
|
42
|
+
key,
|
|
43
|
+
name: e.name,
|
|
44
|
+
provider: e.provider,
|
|
45
|
+
model: e.model,
|
|
46
|
+
apiSource: e.apiSource ?? "platform",
|
|
47
|
+
useServerProxy: e.useServerProxy ?? true,
|
|
48
|
+
rawRecord
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
var BUILTIN_PLATFORM_AGENT_CONFIGS = Object.fromEntries(
|
|
52
|
+
builtinRuntimeFallbackEntries().map((e) => [publicAgentKey(e.id), buildConfig(e)])
|
|
53
|
+
);
|
|
54
|
+
function resolveBuiltinPlatformAgentConfig(agentRef) {
|
|
55
|
+
return BUILTIN_PLATFORM_AGENT_CONFIGS[agentRef] ?? null;
|
|
56
|
+
}
|
|
57
|
+
function resolveBuiltinPlatformAgentRecord(agentRef) {
|
|
58
|
+
const config = resolveBuiltinPlatformAgentConfig(agentRef);
|
|
59
|
+
if (!config) return null;
|
|
60
|
+
return {
|
|
61
|
+
...config.rawRecord,
|
|
62
|
+
dbKey: agentRef,
|
|
63
|
+
...config.name ? { name: config.name } : {}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function applyBuiltinAgentRuntimeOverride(agentKey, record) {
|
|
67
|
+
const fields = resolveBuiltinAgentRuntimeFields(agentKey);
|
|
68
|
+
if (!fields) return record;
|
|
69
|
+
const current = record;
|
|
70
|
+
const rawNeedsOverride = current.rawRecord != null && (current.rawRecord.provider !== fields.provider || current.rawRecord.model !== fields.model);
|
|
71
|
+
if (current.provider === fields.provider && current.model === fields.model && !rawNeedsOverride) {
|
|
72
|
+
return record;
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
...record,
|
|
76
|
+
provider: fields.provider,
|
|
77
|
+
model: fields.model,
|
|
78
|
+
...current.rawRecord ? {
|
|
79
|
+
rawRecord: {
|
|
80
|
+
...current.rawRecord,
|
|
81
|
+
provider: fields.provider,
|
|
82
|
+
model: fields.model
|
|
83
|
+
}
|
|
84
|
+
} : {}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// packages/ai/llm/getModelContextWindow.ts
|
|
89
|
+
var DEFAULT_CONTEXT_WINDOW = 256e3;
|
|
90
|
+
var QWEN_3_6_CONTEXT_WINDOW = 262144;
|
|
91
|
+
var GLM_5_2_CONTEXT_WINDOW = 1e6;
|
|
92
|
+
var ANTIGRAVITY_EFFORT_SUFFIXES = [
|
|
93
|
+
"-tiered",
|
|
94
|
+
"-extra-low",
|
|
95
|
+
"-low",
|
|
96
|
+
"-medium",
|
|
97
|
+
"-high"
|
|
98
|
+
];
|
|
99
|
+
function stripEffortSuffix(model) {
|
|
100
|
+
for (const suffix of ANTIGRAVITY_EFFORT_SUFFIXES) {
|
|
101
|
+
if (model.endsWith(suffix) && model.length > suffix.length) {
|
|
102
|
+
return model.slice(0, -suffix.length);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return model;
|
|
106
|
+
}
|
|
107
|
+
function stripPreviewSuffix(model) {
|
|
108
|
+
const suffix = "-preview";
|
|
109
|
+
if (model.endsWith(suffix) && model.length > suffix.length) {
|
|
110
|
+
return model.slice(0, -suffix.length);
|
|
111
|
+
}
|
|
112
|
+
return model;
|
|
113
|
+
}
|
|
114
|
+
var fullModelMap = null;
|
|
115
|
+
var getFullModelMap = () => {
|
|
116
|
+
if (!fullModelMap) {
|
|
117
|
+
fullModelMap = /* @__PURE__ */ new Map();
|
|
118
|
+
for (const [provider, models] of Object.entries(MODEL_LOOKUP_MAP)) {
|
|
119
|
+
for (const model of models) {
|
|
120
|
+
const entry = { ...model, provider };
|
|
121
|
+
fullModelMap.set(model.name, entry);
|
|
122
|
+
if (model.displayName) {
|
|
123
|
+
fullModelMap.set(model.displayName.toLowerCase(), entry);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return fullModelMap;
|
|
129
|
+
};
|
|
130
|
+
var legacyModelMap = null;
|
|
131
|
+
var getLegacyModelMap = () => {
|
|
132
|
+
if (!legacyModelMap) {
|
|
133
|
+
legacyModelMap = /* @__PURE__ */ new Map();
|
|
134
|
+
for (const model of ALL_MODELS) {
|
|
135
|
+
legacyModelMap.set(model.name, model);
|
|
136
|
+
if (model.displayName) {
|
|
137
|
+
legacyModelMap.set(model.displayName.toLowerCase(), model);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return legacyModelMap;
|
|
142
|
+
};
|
|
143
|
+
function fuzzyContextWindow(normalizedName) {
|
|
144
|
+
if (normalizedName.includes("qwen-long") || normalizedName.includes("qwen3-long")) return 10485760;
|
|
145
|
+
if (normalizedName.includes("qwen-coder") || normalizedName.includes("qwen3-coder")) return 1048576;
|
|
146
|
+
if (normalizedName.includes("qwen3.8") || normalizedName.includes("qwen3p8")) return 1e6;
|
|
147
|
+
if (normalizedName.includes("minimax-m3") || normalizedName.includes("minimax_m3")) return 1e6;
|
|
148
|
+
if (normalizedName.includes("glm-5.3") || normalizedName.includes("glm5.3")) return 105e4;
|
|
149
|
+
if (normalizedName.includes("glm-5.2") || normalizedName.includes("glm5.2")) return GLM_5_2_CONTEXT_WINDOW;
|
|
150
|
+
if (normalizedName.includes("deepseek")) return 1e6;
|
|
151
|
+
if (normalizedName.includes("gpt-5") || normalizedName.includes("gpt-4.1")) return 1047576;
|
|
152
|
+
if (normalizedName.startsWith("cursor-grok-4.5")) return 1e6;
|
|
153
|
+
if (normalizedName.includes("claude-4.6")) return 1e6;
|
|
154
|
+
if (normalizedName.includes("gemini-3.1")) return 1e6;
|
|
155
|
+
if (normalizedName.includes("gemini")) return 1048576;
|
|
156
|
+
if (normalizedName.includes("qwen3.6") || normalizedName.includes("qwen3p6")) return QWEN_3_6_CONTEXT_WINDOW;
|
|
157
|
+
if (normalizedName.includes("qwen3.7") || normalizedName.includes("qwen3p7")) return 262144;
|
|
158
|
+
if (normalizedName.includes("minimax-m2") || normalizedName.includes("minimax_m2")) return 262144;
|
|
159
|
+
if (normalizedName.includes("claude")) return 2e5;
|
|
160
|
+
return void 0;
|
|
161
|
+
}
|
|
162
|
+
var getModelContextWindow = (modelName) => {
|
|
163
|
+
if (!modelName) return DEFAULT_CONTEXT_WINDOW;
|
|
164
|
+
const normalizedName = modelName.toLowerCase();
|
|
165
|
+
const map = getFullModelMap();
|
|
166
|
+
const candidates = [modelName, normalizedName];
|
|
167
|
+
const strippedEffort = stripEffortSuffix(modelName);
|
|
168
|
+
if (strippedEffort !== modelName) {
|
|
169
|
+
candidates.push(strippedEffort, strippedEffort.toLowerCase());
|
|
170
|
+
}
|
|
171
|
+
const strippedPreview = stripPreviewSuffix(modelName);
|
|
172
|
+
if (strippedPreview !== modelName) {
|
|
173
|
+
candidates.push(strippedPreview, strippedPreview.toLowerCase());
|
|
174
|
+
}
|
|
175
|
+
if (strippedEffort !== modelName) {
|
|
176
|
+
const strippedBoth = stripPreviewSuffix(strippedEffort);
|
|
177
|
+
if (strippedBoth !== strippedEffort) {
|
|
178
|
+
candidates.push(strippedBoth, strippedBoth.toLowerCase());
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
for (const candidate of candidates) {
|
|
182
|
+
const model = map.get(candidate);
|
|
183
|
+
if (model?.contextWindow) {
|
|
184
|
+
return typeof model.contextWindow === "number" ? model.contextWindow : DEFAULT_CONTEXT_WINDOW;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return fuzzyContextWindow(normalizedName) ?? DEFAULT_CONTEXT_WINDOW;
|
|
188
|
+
};
|
|
189
|
+
var getModelInfo = (modelName) => {
|
|
190
|
+
if (!modelName) return null;
|
|
191
|
+
const map = getLegacyModelMap();
|
|
192
|
+
return map.get(modelName) || map.get(modelName.toLowerCase()) || null;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
// packages/agent-runtime/autoExecutionProfiles.ts
|
|
196
|
+
var createProfile = (input) => ({
|
|
197
|
+
id: input.id,
|
|
198
|
+
tier: input.tier,
|
|
199
|
+
legacyAgentKey: input.legacyAgentKey,
|
|
200
|
+
key: input.legacyAgentKey,
|
|
201
|
+
name: input.name,
|
|
202
|
+
provider: "nolo",
|
|
203
|
+
model: input.model,
|
|
204
|
+
apiSource: "platform",
|
|
205
|
+
useServerProxy: true,
|
|
206
|
+
rawRecord: {
|
|
207
|
+
dbKey: input.legacyAgentKey,
|
|
208
|
+
isPublic: true,
|
|
209
|
+
provider: "nolo",
|
|
210
|
+
model: input.model,
|
|
211
|
+
apiSource: "platform",
|
|
212
|
+
useServerProxy: true
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
var FLASH_PROFILE = createProfile({
|
|
216
|
+
id: "builtin:auto:deepseek-v4-flash",
|
|
217
|
+
tier: "flash",
|
|
218
|
+
legacyAgentKey: PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
|
|
219
|
+
name: "DeepSeek V4 Flash",
|
|
220
|
+
model: "deepseek-v4-flash"
|
|
221
|
+
});
|
|
222
|
+
var AUTO_EXECUTION_PROFILES = {
|
|
223
|
+
flash: FLASH_PROFILE,
|
|
224
|
+
balanced: { ...FLASH_PROFILE, tier: "balanced" },
|
|
225
|
+
quality: { ...FLASH_PROFILE, tier: "quality" },
|
|
226
|
+
image: { ...FLASH_PROFILE, tier: "image" }
|
|
227
|
+
};
|
|
228
|
+
var DEFAULT_AUTO_EXECUTION_TIER = "flash";
|
|
229
|
+
var DEFAULT_AUTO_EXECUTION_PROFILE = AUTO_EXECUTION_PROFILES[DEFAULT_AUTO_EXECUTION_TIER];
|
|
230
|
+
var resolveAutoExecutionProfile = (tier) => AUTO_EXECUTION_PROFILES[tier ?? DEFAULT_AUTO_EXECUTION_TIER] ?? DEFAULT_AUTO_EXECUTION_PROFILE;
|
|
231
|
+
|
|
232
|
+
export {
|
|
233
|
+
resolveBuiltinPlatformAgentConfig,
|
|
234
|
+
resolveBuiltinPlatformAgentRecord,
|
|
235
|
+
applyBuiltinAgentRuntimeOverride,
|
|
236
|
+
DEFAULT_CONTEXT_WINDOW,
|
|
237
|
+
getModelContextWindow,
|
|
238
|
+
getModelInfo,
|
|
239
|
+
DEFAULT_AUTO_EXECUTION_PROFILE,
|
|
240
|
+
resolveAutoExecutionProfile
|
|
241
|
+
};
|