nolo-cli 0.147.0-alpha.2 → 0.149.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{_executeModel-3OCR5R5P.js → _executeModel-OW3H7ICR.js} +29 -28
- package/{action-3ZOODRBC.js → action-GI44T4DR.js} +6 -6
- package/{addContentAction-IJHG2ZV7.js → addContentAction-B2DRF7P6.js} +5 -5
- package/{addDialogAgentAction-RLPSTAQ2.js → addDialogAgentAction-2P2FLTLD.js} +4 -4
- package/{agentDeleteCommand-6OGADD24.js → agentDeleteCommand-7IDWF6E3.js} +14 -13
- package/{agentEmailCommands-OAPYGNYC.js → agentEmailCommands-A6XBQZBN.js} +31 -30
- package/{agentListCommands-FRJZOOEG.js → agentListCommands-IW3GQVUP.js} +16 -15
- package/{agentMachineCommands-OWLOV5WO.js → agentMachineCommands-DQPUIMAC.js} +14 -13
- package/{agentProviderCommands-TWB6E5WD.js → agentProviderCommands-YK2BIIXZ.js} +1 -1
- package/{agentRecordCommands-BW7HM6VH.js → agentRecordCommands-VCA76W6B.js} +31 -30
- package/{agentRunCommand-O2F3NU2H.js → agentRunCommand-YNLDKVR7.js} +31 -30
- package/{agentRuntimeLocal-QQCDFR7B.js → agentRuntimeLocal-AK2QVJHY.js} +12 -11
- package/{agentSlice-ZOCKW66S.js → agentSlice-O4RUQUMT.js} +5 -5
- package/{appDeleteCommands-OGKQC2AM.js → appDeleteCommands-N3XEVVYC.js} +15 -14
- package/{appDeployCommands-Y2FV4JML.js → appDeployCommands-AWFIXYVW.js} +15 -14
- package/{appDeployStatusCommands-FNML5SUV.js → appDeployStatusCommands-CZRON2FO.js} +15 -14
- package/{appGetCommands-4FOY7W5E.js → appGetCommands-XQIUY4TD.js} +15 -14
- package/{appListCommands-E5SF6SIY.js → appListCommands-NNG4H36Y.js} +15 -14
- package/{chatQueueReduxAdapter-DFZ6QB4K.js → chatQueueReduxAdapter-TJRMXMYA.js} +11 -11
- package/{chunk-27VHPPII.js → chunk-36KZDDO5.js} +6 -6
- package/{chunk-KRC6GI2Q.js → chunk-3DAVPNFT.js} +2 -2
- package/{chunk-T76D3OYX.js → chunk-3SV7RM24.js} +1 -1
- package/{chunk-O7WXJIUI.js → chunk-4H22P2JV.js} +11 -9
- package/{chunk-M2YBIBBS.js → chunk-5TEEECZM.js} +1 -1
- package/{chunk-Z7IZQF56.js → chunk-6FGTMQCL.js} +1 -1
- package/{chunk-ETZWFV6M.js → chunk-7CHC4W22.js} +1 -1
- package/{chunk-PZ3HKBET.js → chunk-ACQD6YI2.js} +19 -19
- package/{chunk-ZSPC3ZTC.js → chunk-AKG5W4LG.js} +1 -1
- package/{chunk-CCOXTK3I.js → chunk-ALFH24P3.js} +26 -0
- package/{chunk-7NANRWL4.js → chunk-ALGORS6Y.js} +1 -1
- package/chunk-ATLTFRYJ.js +411 -0
- package/{chunk-HNRASX3X.js → chunk-CPUFH46E.js} +1 -1
- package/{chunk-GMVELWJG.js → chunk-CU3QB4HW.js} +2 -2
- package/{chunk-LQ6P2MFG.js → chunk-DXHL7G2L.js} +14 -14
- package/{chunk-2EE5UD3N.js → chunk-DY7ANLKG.js} +1 -1
- package/{chunk-I44MDY73.js → chunk-GOH6RW6F.js} +3 -3
- package/chunk-HTVYCXBP.js +681 -0
- package/{chunk-QALRKMHF.js → chunk-HYZIYH2H.js} +5 -5
- package/{chunk-EFZKILX6.js → chunk-IAESIMK7.js} +1 -1
- package/{chunk-OXGHM2WW.js → chunk-ID7LNBWR.js} +27 -257
- package/{chunk-HLUYTEBY.js → chunk-K2CSUCHJ.js} +1 -1
- package/{chunk-JORF7I7F.js → chunk-MST6R3E4.js} +3 -3
- package/{chunk-QJLEMM2V.js → chunk-O2OWEFII.js} +1 -1
- package/{chunk-724HIKHT.js → chunk-OHOVNO7I.js} +4 -127
- package/{chunk-P4CRULYJ.js → chunk-OMRJYNCI.js} +3 -3
- package/chunk-PQWU42UQ.js +132 -0
- package/{chunk-JQ4LUB5I.js → chunk-PZZTFEKK.js} +1 -1
- package/{chunk-QIH323EV.js → chunk-QXGPFY6J.js} +1 -1
- package/{chunk-B7ANJQWZ.js → chunk-RSEEDUMS.js} +2 -2
- package/{chunk-ELYEQNUI.js → chunk-RYZINGPM.js} +3 -3
- package/{chunk-AATZZAZE.js → chunk-SLLGJZDT.js} +1 -1
- package/{chunk-3IYMTWYZ.js → chunk-SONWNI3L.js} +2 -2
- package/chunk-TB3MIBRC.js +1716 -0
- package/{chunk-2B74TU77.js → chunk-TXH4IWJL.js} +3 -3
- package/{chunk-UC3Q7X3J.js → chunk-TZZ2WRBL.js} +5 -5
- package/{chunk-36HTQWBD.js → chunk-UASIEDKM.js} +3 -3
- package/{chunk-BJUDYFV5.js → chunk-UQNS32WZ.js} +1 -1
- package/{chunk-AUXHZ2M5.js → chunk-WIWM4FE3.js} +1 -1
- package/{chunk-YU2THNST.js → chunk-XISEYOGH.js} +1 -1
- package/{chunk-BFLSOVHN.js → chunk-XYJSY4KG.js} +16 -14
- package/{chunk-NU4DCNMR.js → chunk-YAQJJDC2.js} +4 -571
- package/{chunk-D76D3RTR.js → chunk-Z4CSIXYP.js} +2 -2
- package/{chunk-BCJPO6SE.js → chunk-ZUEK6A6C.js} +10 -10
- package/{commandRegistry-OPVCVVOQ.js → commandRegistry-2KBOXZQC.js} +42 -42
- package/{contentThunks-IWXWFN6P.js → contentThunks-BDIQRZR6.js} +12 -12
- package/{createAgentAutomationAction-ROWX5ZPK.js → createAgentAutomationAction-5UGTB26P.js} +12 -12
- package/{createDialogAction-WLVAITHA.js → createDialogAction-B7VGVEVU.js} +13 -13
- package/{createPageAction-DAJL6GES.js → createPageAction-CDLDKPRM.js} +12 -12
- package/{dbSlice-HFPIJT5P.js → dbSlice-DQ32LYTJ.js} +4 -4
- package/{deleteFile-UEAD5A5Z.js → deleteFile-NX6QHCWZ.js} +2 -2
- package/{dialogCommands-KSPH6QOU.js → dialogCommands-G7YBVAMC.js} +15 -14
- package/{dialogSlice-WW75BKLO.js → dialogSlice-N3YB65G5.js} +11 -11
- package/{docCreateCommands-B64BLZVJ.js → docCreateCommands-ZSLGVBZT.js} +14 -13
- package/{docDeleteCommands-UX2GXKUT.js → docDeleteCommands-5N4GVZBG.js} +15 -14
- package/{docReadCommands-5A6GF3XL.js → docReadCommands-YJSAA7AV.js} +14 -13
- package/{docStore-2SADZYLX.js → docStore-E3CEOV5Q.js} +5 -5
- package/{docUpdateCommands-UTBGZPSR.js → docUpdateCommands-WEMLSW6W.js} +14 -13
- package/{handleSendMessageAction-2M57WHLO.js → handleSendMessageAction-DQAD5ERJ.js} +440 -106
- package/index.js +3 -3
- package/{machineCommands-7JUTOZP2.js → machineCommands-HAP75VSG.js} +30 -29
- package/{machineWsRunDispatch-6EETR3RV.js → machineWsRunDispatch-L32G7C4P.js} +30 -29
- package/{memberThunks-SKFZ37VS.js → memberThunks-5ZXPR63F.js} +5 -5
- package/package.json +1 -1
- package/{providerPresetApply-XTEXOH7X.js → providerPresetApply-DD6NGWW6.js} +1 -1
- package/{providerRegistry-ADYDSLKR.js → providerRegistry-XDRLMYGJ.js} +1 -1
- package/{read-IEJLLUXY.js → read-EPTJRAEF.js} +2 -2
- package/{readDocTool-4SPYCP2Y.js → readDocTool-W4NDXNEX.js} +1 -1
- package/{readlineWorkspace-LBLAGNGM.js → readlineWorkspace-7BC66QSX.js} +34 -33
- package/{removeDialogAgentAction-R4RTGM2S.js → removeDialogAgentAction-OSYNZRX7.js} +6 -6
- package/{runAgentClientLoop-RPEULJFS.js → runAgentClientLoop-6E6UC3CE.js} +30 -28
- package/{setDialogExtraReferencesAction-NU2VZ7JZ.js → setDialogExtraReferencesAction-M32UYNCG.js} +5 -5
- package/{setPrimaryDialogAgentAction-VUY2FRVL.js → setPrimaryDialogAgentAction-WZ7KI3YA.js} +6 -6
- package/{settingSlice-CNE75ISY.js → settingSlice-Q6EKL7EQ.js} +5 -5
- package/{spaceCommands-HZUAGZXH.js → spaceCommands-UJOVU4XI.js} +14 -13
- package/{streamAgentChatTurn-D5POCPVX.js → streamAgentChatTurn-3UXPYFNX.js} +71 -1268
- package/{switchDialogAgentAction-JC27CP72.js → switchDialogAgentAction-GMR7WN3P.js} +4 -4
- package/{tools-I6D2B2G6.js → tools-MKYDMWA4.js} +21 -21
- package/{tuiSummaryLlmCaller-RVW6CJSK.js → tuiSummaryLlmCaller-3YFNHCTW.js} +7 -7
- package/{updateDialogTitleAction-7YZ7FNAK.js → updateDialogTitleAction-UPFV7TDT.js} +12 -12
- package/chunk-BJ3KD73I.js +0 -155
- package/chunk-JK5XW3NO.js +0 -108
- package/chunk-YYKMFBK7.js +0 -306
|
@@ -2,18 +2,14 @@ import {
|
|
|
2
2
|
isDevinOAuthAgent
|
|
3
3
|
} from "./chunk-5ZUL4CUO.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
resolveAgentImageInputSupport
|
|
6
|
+
} from "./chunk-PQWU42UQ.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from "./chunk-3BXNTXYI.js";
|
|
8
|
+
getModelContextWindow
|
|
9
|
+
} from "./chunk-AKG5W4LG.js";
|
|
11
10
|
import {
|
|
12
11
|
asOptionalFiniteNumber
|
|
13
12
|
} from "./chunk-WWC7I6TA.js";
|
|
14
|
-
import {
|
|
15
|
-
asTrimmedLowercaseString
|
|
16
|
-
} from "./chunk-QSJ3HFEF.js";
|
|
17
13
|
import {
|
|
18
14
|
isRecord
|
|
19
15
|
} from "./chunk-KUG52IAP.js";
|
|
@@ -24,73 +20,6 @@ import {
|
|
|
24
20
|
asOptionalTrimmedString
|
|
25
21
|
} from "./chunk-G3SUCT4W.js";
|
|
26
22
|
|
|
27
|
-
// packages/ai/llm/agentCapabilities.ts
|
|
28
|
-
var ANTIGRAVITY_EFFORT_SUFFIXES = [
|
|
29
|
-
"-tiered",
|
|
30
|
-
"-extra-low",
|
|
31
|
-
"-low",
|
|
32
|
-
"-medium",
|
|
33
|
-
"-high"
|
|
34
|
-
];
|
|
35
|
-
function stripEffortSuffix(model) {
|
|
36
|
-
for (const suffix of ANTIGRAVITY_EFFORT_SUFFIXES) {
|
|
37
|
-
if (model.endsWith(suffix) && model.length > suffix.length) {
|
|
38
|
-
return model.slice(0, -suffix.length);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return model;
|
|
42
|
-
}
|
|
43
|
-
function stripPreviewSuffix(model) {
|
|
44
|
-
const suffix = "-preview";
|
|
45
|
-
if (model.endsWith(suffix) && model.length > suffix.length) {
|
|
46
|
-
return model.slice(0, -suffix.length);
|
|
47
|
-
}
|
|
48
|
-
return model;
|
|
49
|
-
}
|
|
50
|
-
var lookupKnownModelVision = (provider, model) => {
|
|
51
|
-
if (!model) return void 0;
|
|
52
|
-
const candidates = [model];
|
|
53
|
-
const strippedEffort = stripEffortSuffix(model);
|
|
54
|
-
if (strippedEffort !== model) candidates.push(strippedEffort);
|
|
55
|
-
const strippedPreview = stripPreviewSuffix(model);
|
|
56
|
-
if (strippedPreview !== model) candidates.push(strippedPreview);
|
|
57
|
-
for (const candidate of candidates) {
|
|
58
|
-
if (provider && provider !== "custom") {
|
|
59
|
-
const direct = findModelConfig(provider, candidate);
|
|
60
|
-
if (direct && typeof direct.hasVision === "boolean") return direct.hasVision;
|
|
61
|
-
}
|
|
62
|
-
const detected = getProviderByModelName(candidate);
|
|
63
|
-
if (detected) {
|
|
64
|
-
const found = findModelConfig(detected, candidate)?.hasVision;
|
|
65
|
-
if (found !== void 0) return found;
|
|
66
|
-
}
|
|
67
|
-
if (candidate.includes("/")) {
|
|
68
|
-
const slash = candidate.indexOf("/");
|
|
69
|
-
const modelProvider = candidate.slice(0, slash).toLowerCase();
|
|
70
|
-
const modelName = candidate.slice(slash + 1);
|
|
71
|
-
const nested = findModelConfig(modelProvider, modelName);
|
|
72
|
-
if (nested && typeof nested.hasVision === "boolean") return nested.hasVision;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return void 0;
|
|
76
|
-
};
|
|
77
|
-
var resolveAgentImageInputSupport = (agent) => {
|
|
78
|
-
if (!agent) return true;
|
|
79
|
-
const provider = asTrimmedLowercaseString(agent.provider) || null;
|
|
80
|
-
const model = asOptionalTrimmedString(agent.model) ?? "";
|
|
81
|
-
const catalogHasVision = lookupKnownModelVision(
|
|
82
|
-
provider,
|
|
83
|
-
model
|
|
84
|
-
);
|
|
85
|
-
if (catalogHasVision !== void 0) {
|
|
86
|
-
return catalogHasVision;
|
|
87
|
-
}
|
|
88
|
-
if (typeof agent.hasVision === "boolean") {
|
|
89
|
-
return agent.hasVision;
|
|
90
|
-
}
|
|
91
|
-
return true;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
23
|
// packages/ai/agent/imagePreprocessing.ts
|
|
95
24
|
function extractImageUrlsFromMessages(messages) {
|
|
96
25
|
const urls = [];
|
|
@@ -239,53 +168,6 @@ function resolveAgentRuntimeConfigFromRecord(key, record) {
|
|
|
239
168
|
};
|
|
240
169
|
}
|
|
241
170
|
|
|
242
|
-
// packages/ai/agent/toolOutputPolicy.ts
|
|
243
|
-
var MAX_IN_TURN_TOOL_CONTENT_CHARS = 4e3;
|
|
244
|
-
var DEFAULT_TOOL_OUTPUT_PROFILE = {
|
|
245
|
-
maxChars: MAX_IN_TURN_TOOL_CONTENT_CHARS,
|
|
246
|
-
headRatio: 0.5
|
|
247
|
-
};
|
|
248
|
-
var TOOL_OUTPUT_PROFILES = {
|
|
249
|
-
readFile: { maxChars: 4800, headRatio: 0.68, historicalMaxChars: 4800 },
|
|
250
|
-
read_file: { maxChars: 4800, headRatio: 0.68, historicalMaxChars: 4800 },
|
|
251
|
-
readWorkspaceFile: { maxChars: 4800, headRatio: 0.68, historicalMaxChars: 4800 },
|
|
252
|
-
globFiles: { maxChars: 2800, headRatio: 0.85 },
|
|
253
|
-
execShell: { maxChars: 4e3, headRatio: 0.35 },
|
|
254
|
-
runCommand: { maxChars: 4e3, headRatio: 0.35 },
|
|
255
|
-
launchProcess: { maxChars: 2800, headRatio: 0.35 },
|
|
256
|
-
editFile: { maxChars: 2800, headRatio: 0.62 },
|
|
257
|
-
writeFile: { maxChars: 2400, headRatio: 0.62 },
|
|
258
|
-
readPastedText: { maxChars: 4800, headRatio: 0.5, historicalMaxChars: 4800 }
|
|
259
|
-
};
|
|
260
|
-
function resolveToolOutputProfile(toolName) {
|
|
261
|
-
return (toolName ? TOOL_OUTPUT_PROFILES[toolName] : void 0) ?? DEFAULT_TOOL_OUTPUT_PROFILE;
|
|
262
|
-
}
|
|
263
|
-
function resolveHistoricalToolContentCap(toolName, historicalMaxChars) {
|
|
264
|
-
const profile = toolName ? TOOL_OUTPUT_PROFILES[toolName] : void 0;
|
|
265
|
-
return profile?.historicalMaxChars !== void 0 ? Math.max(historicalMaxChars, profile.historicalMaxChars) : historicalMaxChars;
|
|
266
|
-
}
|
|
267
|
-
function projectToolMessageContent(input) {
|
|
268
|
-
const { content, toolName } = input;
|
|
269
|
-
const maxChars = resolveToolOutputProfile(toolName).maxChars;
|
|
270
|
-
if (content.length <= maxChars) return content;
|
|
271
|
-
return clipToolText(
|
|
272
|
-
content,
|
|
273
|
-
maxChars,
|
|
274
|
-
resolveToolOutputProfile(toolName).headRatio,
|
|
275
|
-
`
|
|
276
|
-
\u2026[\u622A\u65AD\uFF0C\u539F\u59CB\u957F\u5EA6 ${content.length} \u5B57\u7B26]`
|
|
277
|
-
);
|
|
278
|
-
}
|
|
279
|
-
function clipToolText(content, maxChars, headRatio, marker = "\n\n[... tool output middle omitted; head/tail preserved ...]\n\n") {
|
|
280
|
-
const normalized = content.replace(/\r\n/g, "\n").trim();
|
|
281
|
-
if (normalized.length <= maxChars) return normalized;
|
|
282
|
-
if (maxChars <= marker.length + 2) return normalized.slice(0, maxChars);
|
|
283
|
-
const available = maxChars - marker.length;
|
|
284
|
-
const headChars = Math.max(1, Math.floor(available * headRatio));
|
|
285
|
-
const tailChars = Math.max(1, available - headChars);
|
|
286
|
-
return `${normalized.slice(0, headChars)}${marker}${normalized.slice(-tailChars)}`;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
171
|
// packages/agent-runtime/desktopRequestSnapshot.ts
|
|
290
172
|
var DESKTOP_AGENT_CONFIG_SNAPSHOT_STRING_FIELDS = [
|
|
291
173
|
"name",
|
|
@@ -565,11 +447,6 @@ function assertDesktopAgentRuntimeTurnBodyHasNoRawSecrets(body) {
|
|
|
565
447
|
}
|
|
566
448
|
|
|
567
449
|
export {
|
|
568
|
-
resolveToolOutputProfile,
|
|
569
|
-
resolveHistoricalToolContentCap,
|
|
570
|
-
projectToolMessageContent,
|
|
571
|
-
clipToolText,
|
|
572
|
-
resolveAgentImageInputSupport,
|
|
573
450
|
hasImageInRuntimeMessages,
|
|
574
451
|
stripImagePartsFromMessages,
|
|
575
452
|
stripImagePartsForTextOnlyAgent,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-36KZDDO5.js";
|
|
4
4
|
import {
|
|
5
5
|
prepareAndPersistMessage,
|
|
6
6
|
uiAskChoiceFunc,
|
|
7
7
|
uiAskChoiceFunctionSchema
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ACQD6YI2.js";
|
|
9
9
|
import {
|
|
10
10
|
require_date_fns
|
|
11
11
|
} from "./chunk-M76ECQRD.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
removeCachedEntity,
|
|
23
23
|
upsertSSREntity,
|
|
24
24
|
write
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-HYZIYH2H.js";
|
|
26
26
|
import {
|
|
27
27
|
createAgentKey,
|
|
28
28
|
createDialogKey,
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import {
|
|
2
|
+
findModelConfig,
|
|
3
|
+
getProviderByModelName
|
|
4
|
+
} from "./chunk-3BXNTXYI.js";
|
|
5
|
+
import {
|
|
6
|
+
asTrimmedLowercaseString
|
|
7
|
+
} from "./chunk-QSJ3HFEF.js";
|
|
8
|
+
import {
|
|
9
|
+
asOptionalTrimmedString
|
|
10
|
+
} from "./chunk-G3SUCT4W.js";
|
|
11
|
+
|
|
12
|
+
// packages/ai/agent/toolOutputPolicy.ts
|
|
13
|
+
var MAX_IN_TURN_TOOL_CONTENT_CHARS = 4e3;
|
|
14
|
+
var DEFAULT_TOOL_OUTPUT_PROFILE = {
|
|
15
|
+
maxChars: MAX_IN_TURN_TOOL_CONTENT_CHARS,
|
|
16
|
+
headRatio: 0.5
|
|
17
|
+
};
|
|
18
|
+
var TOOL_OUTPUT_PROFILES = {
|
|
19
|
+
readFile: { maxChars: 4800, headRatio: 0.68, historicalMaxChars: 4800 },
|
|
20
|
+
read_file: { maxChars: 4800, headRatio: 0.68, historicalMaxChars: 4800 },
|
|
21
|
+
readWorkspaceFile: { maxChars: 4800, headRatio: 0.68, historicalMaxChars: 4800 },
|
|
22
|
+
globFiles: { maxChars: 2800, headRatio: 0.85 },
|
|
23
|
+
execShell: { maxChars: 4e3, headRatio: 0.35 },
|
|
24
|
+
runCommand: { maxChars: 4e3, headRatio: 0.35 },
|
|
25
|
+
launchProcess: { maxChars: 2800, headRatio: 0.35 },
|
|
26
|
+
editFile: { maxChars: 2800, headRatio: 0.62 },
|
|
27
|
+
writeFile: { maxChars: 2400, headRatio: 0.62 },
|
|
28
|
+
readPastedText: { maxChars: 4800, headRatio: 0.5, historicalMaxChars: 4800 }
|
|
29
|
+
};
|
|
30
|
+
function resolveToolOutputProfile(toolName) {
|
|
31
|
+
return (toolName ? TOOL_OUTPUT_PROFILES[toolName] : void 0) ?? DEFAULT_TOOL_OUTPUT_PROFILE;
|
|
32
|
+
}
|
|
33
|
+
function resolveHistoricalToolContentCap(toolName, historicalMaxChars) {
|
|
34
|
+
const profile = toolName ? TOOL_OUTPUT_PROFILES[toolName] : void 0;
|
|
35
|
+
return profile?.historicalMaxChars !== void 0 ? Math.max(historicalMaxChars, profile.historicalMaxChars) : historicalMaxChars;
|
|
36
|
+
}
|
|
37
|
+
function projectToolMessageContent(input) {
|
|
38
|
+
const { content, toolName } = input;
|
|
39
|
+
const maxChars = resolveToolOutputProfile(toolName).maxChars;
|
|
40
|
+
if (content.length <= maxChars) return content;
|
|
41
|
+
return clipToolText(
|
|
42
|
+
content,
|
|
43
|
+
maxChars,
|
|
44
|
+
resolveToolOutputProfile(toolName).headRatio,
|
|
45
|
+
`
|
|
46
|
+
\u2026[\u622A\u65AD\uFF0C\u539F\u59CB\u957F\u5EA6 ${content.length} \u5B57\u7B26]`
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
function clipToolText(content, maxChars, headRatio, marker = "\n\n[... tool output middle omitted; head/tail preserved ...]\n\n") {
|
|
50
|
+
const normalized = content.replace(/\r\n/g, "\n").trim();
|
|
51
|
+
if (normalized.length <= maxChars) return normalized;
|
|
52
|
+
if (maxChars <= marker.length + 2) return normalized.slice(0, maxChars);
|
|
53
|
+
const available = maxChars - marker.length;
|
|
54
|
+
const headChars = Math.max(1, Math.floor(available * headRatio));
|
|
55
|
+
const tailChars = Math.max(1, available - headChars);
|
|
56
|
+
return `${normalized.slice(0, headChars)}${marker}${normalized.slice(-tailChars)}`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// packages/ai/llm/agentCapabilities.ts
|
|
60
|
+
var ANTIGRAVITY_EFFORT_SUFFIXES = [
|
|
61
|
+
"-tiered",
|
|
62
|
+
"-extra-low",
|
|
63
|
+
"-low",
|
|
64
|
+
"-medium",
|
|
65
|
+
"-high"
|
|
66
|
+
];
|
|
67
|
+
function stripEffortSuffix(model) {
|
|
68
|
+
for (const suffix of ANTIGRAVITY_EFFORT_SUFFIXES) {
|
|
69
|
+
if (model.endsWith(suffix) && model.length > suffix.length) {
|
|
70
|
+
return model.slice(0, -suffix.length);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return model;
|
|
74
|
+
}
|
|
75
|
+
function stripPreviewSuffix(model) {
|
|
76
|
+
const suffix = "-preview";
|
|
77
|
+
if (model.endsWith(suffix) && model.length > suffix.length) {
|
|
78
|
+
return model.slice(0, -suffix.length);
|
|
79
|
+
}
|
|
80
|
+
return model;
|
|
81
|
+
}
|
|
82
|
+
var lookupKnownModelVision = (provider, model) => {
|
|
83
|
+
if (!model) return void 0;
|
|
84
|
+
const candidates = [model];
|
|
85
|
+
const strippedEffort = stripEffortSuffix(model);
|
|
86
|
+
if (strippedEffort !== model) candidates.push(strippedEffort);
|
|
87
|
+
const strippedPreview = stripPreviewSuffix(model);
|
|
88
|
+
if (strippedPreview !== model) candidates.push(strippedPreview);
|
|
89
|
+
for (const candidate of candidates) {
|
|
90
|
+
if (provider && provider !== "custom") {
|
|
91
|
+
const direct = findModelConfig(provider, candidate);
|
|
92
|
+
if (direct && typeof direct.hasVision === "boolean") return direct.hasVision;
|
|
93
|
+
}
|
|
94
|
+
const detected = getProviderByModelName(candidate);
|
|
95
|
+
if (detected) {
|
|
96
|
+
const found = findModelConfig(detected, candidate)?.hasVision;
|
|
97
|
+
if (found !== void 0) return found;
|
|
98
|
+
}
|
|
99
|
+
if (candidate.includes("/")) {
|
|
100
|
+
const slash = candidate.indexOf("/");
|
|
101
|
+
const modelProvider = candidate.slice(0, slash).toLowerCase();
|
|
102
|
+
const modelName = candidate.slice(slash + 1);
|
|
103
|
+
const nested = findModelConfig(modelProvider, modelName);
|
|
104
|
+
if (nested && typeof nested.hasVision === "boolean") return nested.hasVision;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return void 0;
|
|
108
|
+
};
|
|
109
|
+
var resolveAgentImageInputSupport = (agent) => {
|
|
110
|
+
if (!agent) return true;
|
|
111
|
+
const provider = asTrimmedLowercaseString(agent.provider) || null;
|
|
112
|
+
const model = asOptionalTrimmedString(agent.model) ?? "";
|
|
113
|
+
const catalogHasVision = lookupKnownModelVision(
|
|
114
|
+
provider,
|
|
115
|
+
model
|
|
116
|
+
);
|
|
117
|
+
if (catalogHasVision !== void 0) {
|
|
118
|
+
return catalogHasVision;
|
|
119
|
+
}
|
|
120
|
+
if (typeof agent.hasVision === "boolean") {
|
|
121
|
+
return agent.hasVision;
|
|
122
|
+
}
|
|
123
|
+
return true;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export {
|
|
127
|
+
resolveToolOutputProfile,
|
|
128
|
+
resolveHistoricalToolContentCap,
|
|
129
|
+
projectToolMessageContent,
|
|
130
|
+
clipToolText,
|
|
131
|
+
resolveAgentImageInputSupport
|
|
132
|
+
};
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
patch,
|
|
6
6
|
read
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HYZIYH2H.js";
|
|
8
8
|
import {
|
|
9
9
|
DEVICE_LOCAL_OWNER_ID,
|
|
10
10
|
isDeviceLocalSpaceBody
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WIWM4FE3.js";
|
|
12
12
|
import {
|
|
13
13
|
selectIdentityUserId
|
|
14
14
|
} from "./chunk-SEJ5OS6F.js";
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
} from "./chunk-DWLEOOGR.js";
|
|
7
7
|
import {
|
|
8
8
|
addContentAction
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RSEEDUMS.js";
|
|
10
10
|
import {
|
|
11
11
|
upload
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HYZIYH2H.js";
|
|
13
13
|
import {
|
|
14
14
|
getRuntimeServerContext
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WIWM4FE3.js";
|
|
16
16
|
import {
|
|
17
17
|
API_ENDPOINTS
|
|
18
18
|
} from "./chunk-LCBAMY2M.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
toTimestampMs,
|
|
15
15
|
upsert,
|
|
16
16
|
write
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-HYZIYH2H.js";
|
|
18
18
|
import {
|
|
19
19
|
createUserKey,
|
|
20
20
|
createUserPreferenceKey,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
createAction,
|
|
30
30
|
createAsyncThunk,
|
|
31
31
|
createSelector
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-WIWM4FE3.js";
|
|
33
33
|
import {
|
|
34
34
|
getAllServers,
|
|
35
35
|
getIsDesktopApp,
|