nolo-cli 0.175.0-alpha.1 → 0.177.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-557MGBNC.js → _executeModel-6WX5JUK7.js} +14 -14
- package/{accountResolver-YGMLY3WW.js → accountResolver-OHS53Q75.js} +2 -2
- package/{agentDeleteCommand-WI6U4NFI.js → agentDeleteCommand-JQG2LSA5.js} +18 -18
- package/{agentEmailCommands-Z3TNB4JY.js → agentEmailCommands-OXTDO2NF.js} +20 -20
- package/{agentListCommands-UHHP6HFB.js → agentListCommands-4EXK3SYL.js} +8 -8
- package/{agentMachineCommands-FIUBHYRT.js → agentMachineCommands-EY7STQGY.js} +9 -9
- package/{agentRecordCommands-EQDWG4RY.js → agentRecordCommands-YBMNP36Y.js} +19 -19
- package/{agentRunCommand-WZCHXCYS.js → agentRunCommand-RLLMSTZO.js} +20 -20
- package/{agentRuntimeLocal-VQZCOFTL.js → agentRuntimeLocal-JNX6T5PK.js} +8 -8
- package/{agentSlice-YQHUKPIF.js → agentSlice-FYQAPKX5.js} +1 -1
- package/{appDeleteCommands-3QISRABE.js → appDeleteCommands-26FQDO25.js} +8 -8
- package/{appDeployCommands-UIMXDPOG.js → appDeployCommands-SUWSMHNK.js} +8 -8
- package/{appDeployStatusCommands-D2ZA54DA.js → appDeployStatusCommands-KQ7ENQE4.js} +8 -8
- package/{appGetCommands-QH2XYWOK.js → appGetCommands-HGMGWU5B.js} +8 -8
- package/{appListCommands-HH2HYJDZ.js → appListCommands-2N6XHLGI.js} +8 -8
- package/{authCommand-CVKPVPHN.js → authCommand-44AMFHPM.js} +3 -3
- package/{chromeCommands-Z5LDHMYN.js → chromeCommands-VANHVOCE.js} +2 -2
- package/{chromeOpsCommands-CHBIUDJD.js → chromeOpsCommands-RY776THN.js} +2 -2
- package/{chunk-MG63GUYM.js → chunk-33BY55WF.js} +3 -3
- package/{chunk-Z4UP2EDE.js → chunk-3MZ33FL7.js} +1 -1
- package/{chunk-RABMW33C.js → chunk-4NB4XLNL.js} +3 -3
- package/{chunk-HHEM4TV3.js → chunk-5VNY3X7V.js} +2 -2
- package/{chunk-KXIJYPVC.js → chunk-5ZTCH2Y6.js} +2 -2
- package/{chunk-UILL43UU.js → chunk-72ILVFRF.js} +35 -27
- package/{chunk-RNIZNIVT.js → chunk-ABEZP6S7.js} +9 -9
- package/{chunk-ISIFZP3N.js → chunk-AEZBL2MY.js} +64 -3
- package/{chunk-24VDDKCB.js → chunk-C2M3QZBC.js} +8 -8
- package/{chunk-LCCULKPJ.js → chunk-CY2NSJL5.js} +24 -5
- package/{chunk-Z4HDFBYK.js → chunk-DN2DBFJ2.js} +1 -1
- package/{chunk-4NYYWHM7.js → chunk-E23Y7NIR.js} +5 -5
- package/{chunk-EGT6ORP5.js → chunk-FR2AHCB6.js} +8 -8
- package/{chunk-SRZ6BQIP.js → chunk-HIVDQPQR.js} +9 -1
- package/{chunk-DWFRZ3UI.js → chunk-ITSMLMHJ.js} +12 -7
- package/{chunk-TMAQFKHS.js → chunk-IZAL4EF7.js} +2 -2
- package/{chunk-A6B3LSDB.js → chunk-KYAMW3AY.js} +10 -6
- package/{chunk-QFAISMV5.js → chunk-LP4XBYE7.js} +3 -3
- package/{chunk-LTWBOZE6.js → chunk-MBFXRU2T.js} +8 -8
- package/{chunk-VJ52BYBK.js → chunk-NF5NWGPH.js} +1 -1
- package/{chunk-L7ZCLG72.js → chunk-NRO3AZRC.js} +2 -2
- package/{chunk-FGSVT353.js → chunk-PAI4KXWW.js} +74 -25
- package/{chunk-RYBZM4A2.js → chunk-PN2D6STE.js} +2 -2
- package/{chunk-ONQ2APOE.js → chunk-RX7AYZIB.js} +3 -3
- package/{chunk-7QQOOHDG.js → chunk-XRU4QTSX.js} +24 -8
- package/{chunk-DPQYIS6D.js → chunk-YUXSWHQC.js} +3 -2
- package/{chunk-J63HVOSX.js → chunk-YWEMVIRS.js} +2 -2
- package/{commandRegistry-S54U5ZHX.js → commandRegistry-VUSP6YAY.js} +51 -51
- package/{contentThunks-NVX3NBHZ.js → contentThunks-HLBN6LDG.js} +3 -3
- package/{createAgentAutomationAction-EONFRZYA.js → createAgentAutomationAction-KZHZ7RGX.js} +3 -3
- package/{createDialogAction-ZVY45CNY.js → createDialogAction-R4QDGQPX.js} +4 -4
- package/{createPageAction-N5XSWPN2.js → createPageAction-BEQBAYSA.js} +3 -3
- package/{dialogCommands-A5CHG67A.js → dialogCommands-TH32KIJ4.js} +8 -8
- package/{dialogSlice-ST2FXOF3.js → dialogSlice-XUN4AEE6.js} +2 -2
- package/{docCreateCommands-BF354FQW.js → docCreateCommands-DU2MJR2G.js} +8 -8
- package/{docDeleteCommands-3K5K4XFO.js → docDeleteCommands-6POYBBEE.js} +8 -8
- package/{docReadCommands-A7ZDZIQV.js → docReadCommands-SN2JJSMI.js} +8 -8
- package/{docStore-PPUT7MQV.js → docStore-YGM3R64V.js} +1 -1
- package/{docUpdateCommands-5MGDR5ME.js → docUpdateCommands-JBC4GWE6.js} +8 -8
- package/{handleSendMessageAction-74EKQW4M.js → handleSendMessageAction-I3TYJFAZ.js} +8 -8
- package/index.js +4 -4
- package/{localRuntimeAdapter-ZAXRSVWI.js → localRuntimeAdapter-MUGE4TRL.js} +18 -18
- package/{machineCommands-MT4FDVVG.js → machineCommands-EEFNO3WU.js} +19 -19
- package/{machineWsRunDispatch-7T3SEMB6.js → machineWsRunDispatch-SXNCWZNO.js} +19 -19
- package/package.json +1 -1
- package/{readlineWorkspace-MTYLMWBM.js → readlineWorkspace-W23GKNU7.js} +20 -20
- package/{runAgentClientLoop-Z6STKR3Z.js → runAgentClientLoop-HZU57DWI.js} +12 -12
- package/{spaceCommands-M44RQPCK.js → spaceCommands-2D7RAC6A.js} +8 -8
- package/{streamAgentChatTurn-2ON7E6LT.js → streamAgentChatTurn-YGVG54KM.js} +16 -16
- package/{tools-ZB2YBHSS.js → tools-EHK4XG4X.js} +7 -7
- package/{tuiSummaryLlmCaller-I2MRY6T5.js → tuiSummaryLlmCaller-2MLU3QOG.js} +4 -4
- package/{updateDialogTitleAction-YMQAOVJ2.js → updateDialogTitleAction-FRLRJMQY.js} +3 -3
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
readSseFrames
|
|
3
3
|
} from "./chunk-HNUWUO75.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
resolveToolImagePolicy
|
|
6
|
+
} from "./chunk-XRU4QTSX.js";
|
|
7
7
|
import {
|
|
8
8
|
accumulateToolCallDelta,
|
|
9
9
|
createThinkParserState,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
stablePromptCacheKey,
|
|
31
31
|
toOpenAiCompatibleMessages,
|
|
32
32
|
toResponsesTools
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-AEZBL2MY.js";
|
|
34
34
|
import {
|
|
35
35
|
isMeaningfulChatCompletionOutput,
|
|
36
36
|
isMeaningfulResponsesOutput
|
|
@@ -526,10 +526,29 @@ function buildPlatformChatCompletionRequest(args) {
|
|
|
526
526
|
const body = {
|
|
527
527
|
model: args.providerConfig.model,
|
|
528
528
|
...usesResponsesApi ? {
|
|
529
|
-
|
|
529
|
+
// 平台代理路径:网关中转通常仅支持字符串形态的 function_call_output.output,
|
|
530
|
+
// 保持「合成 user 消息」方案传递图片附件。
|
|
531
|
+
// Responses 协议天然支持 reasoning 数组回放,因此不 stripReasoningContent。
|
|
532
|
+
input: convertMessagesToResponsesInput(
|
|
533
|
+
toOpenAiCompatibleMessages(sanitizedMessages, {
|
|
534
|
+
supportsToolImages: resolveToolImagePolicy({
|
|
535
|
+
routeKind: "platform",
|
|
536
|
+
provider: args.providerConfig.usageProvider ?? args.providerConfig.provider,
|
|
537
|
+
model: args.providerConfig.model,
|
|
538
|
+
customProviderUrl: args.providerConfig.endpoint,
|
|
539
|
+
hasVision: args.providerConfig.hasVision
|
|
540
|
+
}).supportsToolImages
|
|
541
|
+
})
|
|
542
|
+
)
|
|
530
543
|
} : {
|
|
531
544
|
messages: toOpenAiCompatibleMessages(sanitizedMessages, {
|
|
532
|
-
supportsToolImages:
|
|
545
|
+
supportsToolImages: resolveToolImagePolicy({
|
|
546
|
+
routeKind: "platform",
|
|
547
|
+
provider: args.providerConfig.usageProvider ?? args.providerConfig.provider,
|
|
548
|
+
model: args.providerConfig.model,
|
|
549
|
+
customProviderUrl: args.providerConfig.endpoint,
|
|
550
|
+
hasVision: args.providerConfig.hasVision
|
|
551
|
+
}).supportsToolImages,
|
|
533
552
|
stripReasoningContent: shouldStripReasoning
|
|
534
553
|
})
|
|
535
554
|
},
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
mergeReferences,
|
|
8
8
|
resolveReferenceAssets,
|
|
9
9
|
resolveToolsFromKeys
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YWEMVIRS.js";
|
|
11
11
|
import {
|
|
12
12
|
UI_CARD_ENVELOPE_MAX_BYTES,
|
|
13
13
|
getAllToolRuns,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
selectSpaceContextLevel,
|
|
21
21
|
selectUserTonePreset,
|
|
22
22
|
uiCardFallback
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5ZTCH2Y6.js";
|
|
24
24
|
import {
|
|
25
25
|
resolveToolBaseUrl
|
|
26
26
|
} from "./chunk-MYOH447Z.js";
|
|
@@ -32,15 +32,15 @@ import {
|
|
|
32
32
|
} from "./chunk-TDNAAXUQ.js";
|
|
33
33
|
import {
|
|
34
34
|
getDocState
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-NRO3AZRC.js";
|
|
36
36
|
import {
|
|
37
37
|
getTableState
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-DN2DBFJ2.js";
|
|
39
39
|
import {
|
|
40
40
|
PERSONALIZATION_DIALOG_CATEGORY,
|
|
41
41
|
buildPersonalizationDialogPolicyContext,
|
|
42
42
|
selectAllMsgs
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-MBFXRU2T.js";
|
|
44
44
|
import {
|
|
45
45
|
getCurrentSpaceIdRaw,
|
|
46
46
|
getViewMode
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
inlineImageUrlsForCustomProvider,
|
|
6
6
|
prepareTools,
|
|
7
7
|
shouldInlineImageUrlsForAgent
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IZAL4EF7.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-RX7AYZIB.js";
|
|
18
18
|
import {
|
|
19
19
|
findToolExecutor,
|
|
20
20
|
toolDefinitionsByName
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-C2M3QZBC.js";
|
|
22
22
|
import {
|
|
23
23
|
classifyApiError,
|
|
24
24
|
classifyGenerationError,
|
|
25
25
|
extractErrorDiagnostics
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-YWEMVIRS.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-5ZTCH2Y6.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-MBFXRU2T.js";
|
|
46
46
|
import {
|
|
47
47
|
streamAgentChatTurn
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-4NB4XLNL.js";
|
|
49
49
|
import {
|
|
50
50
|
getCurrentSpaceId
|
|
51
51
|
} from "./chunk-ZJ7UHBJS.js";
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
} from "./chunk-56GBUMO5.js";
|
|
86
86
|
import {
|
|
87
87
|
normalizeChatCompletionsBodyForProvider
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-AEZBL2MY.js";
|
|
89
89
|
import {
|
|
90
90
|
EMPTY_ASSISTANT_REPAIR_PROMPT
|
|
91
91
|
} from "./chunk-T7HBI3WZ.js";
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// packages/agent-runtime/imageSummary.ts
|
|
2
|
+
function formatImageSummary(summary) {
|
|
3
|
+
return `[${summary.kind} ${summary.width}x${summary.height} ${summary.bytes} bytes \u2192 ${summary.path}]`;
|
|
4
|
+
}
|
|
5
|
+
|
|
1
6
|
// packages/agent-runtime/readImage.ts
|
|
2
7
|
import { readFile } from "node:fs/promises";
|
|
3
8
|
import { extname } from "node:path";
|
|
@@ -57,12 +62,15 @@ async function readLocalImage(path, options) {
|
|
|
57
62
|
height = resized.info.height;
|
|
58
63
|
mimeType = "image/jpeg";
|
|
59
64
|
}
|
|
65
|
+
const imageSummary = { width, height, bytes: output.length, path };
|
|
60
66
|
return {
|
|
61
|
-
|
|
67
|
+
imageSummary,
|
|
68
|
+
content: formatImageSummary({ kind: "image", ...imageSummary }),
|
|
62
69
|
images: [{ mimeType, dataBase64: output.toString("base64") }]
|
|
63
70
|
};
|
|
64
71
|
}
|
|
65
72
|
|
|
66
73
|
export {
|
|
74
|
+
formatImageSummary,
|
|
67
75
|
readLocalImage
|
|
68
76
|
};
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
streamSseDataValues
|
|
3
3
|
} from "./chunk-HNUWUO75.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
resolveToolImagePolicy
|
|
6
|
+
} from "./chunk-XRU4QTSX.js";
|
|
7
7
|
import {
|
|
8
8
|
projectOpenAiToolImages
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KYAMW3AY.js";
|
|
10
10
|
import {
|
|
11
11
|
getAntigravityUserAgent,
|
|
12
12
|
readAntigravityProjectId,
|
|
@@ -640,7 +640,11 @@ function shouldUseGeminiNativeToolRoute(provider, model, tools, isImageModel) {
|
|
|
640
640
|
return provider === "google" && !isImageModel(model) && isGemini3Model(model) && Array.isArray(tools) && tools.length > 0;
|
|
641
641
|
}
|
|
642
642
|
function buildGeminiGenerateContentRequest(args) {
|
|
643
|
-
const supportsToolImages = args.
|
|
643
|
+
const supportsToolImages = resolveToolImagePolicy(args.toolImagePolicy ?? {
|
|
644
|
+
routeKind: "gemini-native",
|
|
645
|
+
hasVision: args.supportsToolImages,
|
|
646
|
+
legacySupportsToolImages: args.supportsToolImages ?? false
|
|
647
|
+
}).supportsToolImages;
|
|
644
648
|
const { contents, systemTexts } = convertOpenAiMessagesToGemini(
|
|
645
649
|
args.messages,
|
|
646
650
|
{
|
|
@@ -687,11 +691,12 @@ function buildCloudCodeAssistPayload(args) {
|
|
|
687
691
|
const rawMessages = Array.isArray(args.openAiBody.messages) ? args.openAiBody.messages : [];
|
|
688
692
|
const quirks = resolveGeminiModelQuirks(model);
|
|
689
693
|
const isClaude = quirks.isClaudeCrossModel;
|
|
690
|
-
const supportsToolImages =
|
|
694
|
+
const supportsToolImages = resolveToolImagePolicy({
|
|
691
695
|
...args.agentConfig,
|
|
696
|
+
routeKind: "antigravity",
|
|
692
697
|
model,
|
|
693
|
-
hasVision: args.agentConfig.hasVision
|
|
694
|
-
});
|
|
698
|
+
hasVision: args.agentConfig.hasVision
|
|
699
|
+
}).supportsToolImages;
|
|
695
700
|
const { contents, systemTexts } = convertOpenAiMessagesToGemini(rawMessages, {
|
|
696
701
|
attachSkipThoughtSignature: quirks.allowsThoughtSignatureSentinel,
|
|
697
702
|
supportsToolImages
|
|
@@ -34,6 +34,9 @@ function resetToolImageDelivery(images) {
|
|
|
34
34
|
function toolImageDelivery(image) {
|
|
35
35
|
return delivery.get(image);
|
|
36
36
|
}
|
|
37
|
+
var MAX_TOOL_IMAGES_PER_REQUEST = 4;
|
|
38
|
+
var MAX_TOOL_IMAGE_BASE64_BYTES_PER_REQUEST = 8 * 1024 * 1024;
|
|
39
|
+
var formatToolImageBudgetNote = (omittedCount) => `Note: ${omittedCount} image(s) omitted (request budget: ${MAX_TOOL_IMAGES_PER_REQUEST} images / 8 MiB base64) \u2014 they were NOT delivered, do not guess their content.`;
|
|
37
40
|
function createToolImageBudget() {
|
|
38
41
|
let count = 0;
|
|
39
42
|
let bytes = 0;
|
|
@@ -43,19 +46,19 @@ function createToolImageBudget() {
|
|
|
43
46
|
if (seen.has(key)) return "duplicate";
|
|
44
47
|
seen.add(key);
|
|
45
48
|
const size = Buffer.byteLength(image.dataBase64, "utf8");
|
|
46
|
-
if (size >
|
|
49
|
+
if (size > MAX_TOOL_IMAGE_BASE64_BYTES_PER_REQUEST) {
|
|
47
50
|
delivery.set(image, "impossible");
|
|
48
51
|
return "impossible";
|
|
49
52
|
}
|
|
50
|
-
if (count >=
|
|
53
|
+
if (count >= MAX_TOOL_IMAGES_PER_REQUEST || bytes + size > MAX_TOOL_IMAGE_BASE64_BYTES_PER_REQUEST) return "pending";
|
|
51
54
|
count += 1;
|
|
52
55
|
bytes += size;
|
|
53
56
|
delivery.set(image, "delivered");
|
|
54
57
|
return "delivered";
|
|
55
58
|
};
|
|
56
59
|
}
|
|
57
|
-
function toolImageSource(message) {
|
|
58
|
-
const path = typeof message.content === "string" ? message.content.match(/→ ([^\s\x00-\x1f\x7f]+)/u)?.[1]?.replace(/\]$/, "") : void 0;
|
|
60
|
+
function toolImageSource(message, imageIndex = 0) {
|
|
61
|
+
const path = typeof message.content === "string" ? (Array.from(message.content.matchAll(/→ ([^\s\x00-\x1f\x7f]+)/gu))[imageIndex]?.[1] ?? message.content.match(/→ ([^\s\x00-\x1f\x7f]+)/u)?.[1])?.replace(/\]$/, "") : void 0;
|
|
59
62
|
return `${(message.tool_call_id ?? "unknown").replace(/[\x00-\x1f\x7f]/g, "")}${path ? ` (${path})` : ""}`;
|
|
60
63
|
}
|
|
61
64
|
function toolImageOmission(source, impossible) {
|
|
@@ -104,10 +107,10 @@ function projectOpenAiToolImages(messages, supportsImages) {
|
|
|
104
107
|
messages.forEach((message, index) => {
|
|
105
108
|
if (message.role === "tool") lastTool = index;
|
|
106
109
|
if (!supportsImages) return;
|
|
107
|
-
for (const image of toolImages(message)) {
|
|
110
|
+
for (const [imageIndex, image] of toolImages(message).entries()) {
|
|
108
111
|
const decision = budget(image);
|
|
109
112
|
if (decision === "duplicate") continue;
|
|
110
|
-
const source = toolImageSource(message);
|
|
113
|
+
const source = toolImageSource(message, imageIndex);
|
|
111
114
|
if (decision !== "delivered") {
|
|
112
115
|
omitted.push(toolImageOmission(source, decision === "impossible"));
|
|
113
116
|
continue;
|
|
@@ -142,6 +145,7 @@ export {
|
|
|
142
145
|
toolImageNotices,
|
|
143
146
|
resetToolImageDelivery,
|
|
144
147
|
toolImageDelivery,
|
|
148
|
+
formatToolImageBudgetNote,
|
|
145
149
|
createToolImageBudget,
|
|
146
150
|
toolImageSource,
|
|
147
151
|
toolImageOmission,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fetchReferenceContents,
|
|
3
3
|
resolveReferenceAssets
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YWEMVIRS.js";
|
|
5
5
|
import {
|
|
6
6
|
updateTokensAction
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MBFXRU2T.js";
|
|
8
8
|
import {
|
|
9
9
|
applyUpdateTokensFulfilled
|
|
10
10
|
} from "./chunk-OWYYDMGJ.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
extractReasoningFromResponseOutput,
|
|
13
13
|
extractTextFromResponseOutput,
|
|
14
14
|
extractToolCallsFromResponseOutput
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-AEZBL2MY.js";
|
|
16
16
|
import {
|
|
17
17
|
isRecord
|
|
18
18
|
} from "./chunk-KUG52IAP.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-QYPE3TS3.js";
|
|
12
12
|
import {
|
|
13
13
|
runLlm
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-4NB4XLNL.js";
|
|
15
15
|
import {
|
|
16
16
|
getApproxPricePerImage
|
|
17
17
|
} from "./chunk-4JH2UMJR.js";
|
|
@@ -11064,7 +11064,7 @@ var messageSlice = createSliceWithThunks({
|
|
|
11064
11064
|
runtimeOptions: args.runtimeOptions
|
|
11065
11065
|
});
|
|
11066
11066
|
if (agentKeyToUse) {
|
|
11067
|
-
const { streamAgentChatTurn } = await import("./agentSlice-
|
|
11067
|
+
const { streamAgentChatTurn } = await import("./agentSlice-FYQAPKX5.js");
|
|
11068
11068
|
await dispatch(
|
|
11069
11069
|
streamAgentChatTurn({
|
|
11070
11070
|
agentKey: agentKeyToUse,
|
|
@@ -13881,7 +13881,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
|
|
|
13881
13881
|
}
|
|
13882
13882
|
if (isCurrentDialog) {
|
|
13883
13883
|
await thunkApi.dispatch(resetMsgs());
|
|
13884
|
-
const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-
|
|
13884
|
+
const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-XUN4AEE6.js");
|
|
13885
13885
|
dispatch(clearPendingAttachments2());
|
|
13886
13886
|
}
|
|
13887
13887
|
return { dialogKey, isCurrentDialog, attachmentPlan };
|
|
@@ -13889,15 +13889,15 @@ var deleteDialogThunk = async (payload, thunkApi) => {
|
|
|
13889
13889
|
|
|
13890
13890
|
// packages/chat/dialog/dialogSlice.ts
|
|
13891
13891
|
var runCreateDialogAction = async (args, thunkApi) => {
|
|
13892
|
-
const { createDialogAction } = await import("./createDialogAction-
|
|
13892
|
+
const { createDialogAction } = await import("./createDialogAction-R4QDGQPX.js");
|
|
13893
13893
|
return createDialogAction(args, thunkApi);
|
|
13894
13894
|
};
|
|
13895
13895
|
var runCreateAgentAutomationAction = async (args, thunkApi) => {
|
|
13896
|
-
const { createAgentAutomationAction } = await import("./createAgentAutomationAction-
|
|
13896
|
+
const { createAgentAutomationAction } = await import("./createAgentAutomationAction-KZHZ7RGX.js");
|
|
13897
13897
|
return createAgentAutomationAction(args, thunkApi);
|
|
13898
13898
|
};
|
|
13899
13899
|
var runUpdateDialogTitleAction = async (args, thunkApi) => {
|
|
13900
|
-
const { updateDialogTitleAction } = await import("./updateDialogTitleAction-
|
|
13900
|
+
const { updateDialogTitleAction } = await import("./updateDialogTitleAction-FRLRJMQY.js");
|
|
13901
13901
|
return updateDialogTitleAction(args, thunkApi);
|
|
13902
13902
|
};
|
|
13903
13903
|
var runAddDialogAgentAction = async (args, thunkApi) => {
|
|
@@ -13921,7 +13921,7 @@ var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
|
|
|
13921
13921
|
return setDialogExtraReferencesAction(args, thunkApi);
|
|
13922
13922
|
};
|
|
13923
13923
|
var runHandleSendMessageAction = async (args, thunkApi) => {
|
|
13924
|
-
const { handleSendMessageAction } = await import("./handleSendMessageAction-
|
|
13924
|
+
const { handleSendMessageAction } = await import("./handleSendMessageAction-I3TYJFAZ.js");
|
|
13925
13925
|
return handleSendMessageAction(args, thunkApi);
|
|
13926
13926
|
};
|
|
13927
13927
|
function clearDialogState() {
|
|
@@ -13934,7 +13934,7 @@ var createPageAndAddReference = createAsyncThunk(
|
|
|
13934
13934
|
async (payload, { dispatch, getState, rejectWithValue }) => {
|
|
13935
13935
|
const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
|
|
13936
13936
|
try {
|
|
13937
|
-
const { createDocState } = await import("./docStore-
|
|
13937
|
+
const { createDocState } = await import("./docStore-YGM3R64V.js");
|
|
13938
13938
|
const pageKey = await createDocState(
|
|
13939
13939
|
{ slateData, title },
|
|
13940
13940
|
{ dispatch, getState }
|
|
@@ -333,7 +333,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
333
333
|
).unwrap();
|
|
334
334
|
if (dbSpaceId) {
|
|
335
335
|
try {
|
|
336
|
-
const { updateContentTitle } = await import("./contentThunks-
|
|
336
|
+
const { updateContentTitle } = await import("./contentThunks-HLBN6LDG.js");
|
|
337
337
|
await dispatch(
|
|
338
338
|
updateContentTitle({
|
|
339
339
|
spaceId: dbSpaceId,
|
|
@@ -372,7 +372,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
async function createDocState(args, thunkApi) {
|
|
375
|
-
const { createPageAction } = await import("./createPageAction-
|
|
375
|
+
const { createPageAction } = await import("./createPageAction-BEQBAYSA.js");
|
|
376
376
|
return createPageAction(args, thunkApi);
|
|
377
377
|
}
|
|
378
378
|
function subscribe(listener) {
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DEVIN_CONNECT_URL,
|
|
3
3
|
parseSseDataLineJson,
|
|
4
4
|
parseSseDataLineObject
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ITSMLMHJ.js";
|
|
6
6
|
import {
|
|
7
7
|
applyChatCompletionDelta,
|
|
8
8
|
applyResponsesToolEvent,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
flushChatCompletionStream,
|
|
12
12
|
providerHttpFailure,
|
|
13
13
|
throwIfChatCompletionStreamFailed
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CY2NSJL5.js";
|
|
15
15
|
import {
|
|
16
16
|
readSseFrames
|
|
17
17
|
} from "./chunk-HNUWUO75.js";
|
|
@@ -23,20 +23,22 @@ import {
|
|
|
23
23
|
EXECUTION_BACKEND_KINDS
|
|
24
24
|
} from "./chunk-PWTNI4N7.js";
|
|
25
25
|
import {
|
|
26
|
+
formatImageSummary,
|
|
26
27
|
readLocalImage
|
|
27
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-HIVDQPQR.js";
|
|
28
29
|
import {
|
|
29
30
|
hasImageInRuntimeMessages,
|
|
30
31
|
stripImagePartsFromMessages
|
|
31
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-5VNY3X7V.js";
|
|
32
33
|
import {
|
|
33
34
|
clipToolText,
|
|
34
35
|
resolveHistoricalToolContentCap,
|
|
35
36
|
resolveToolOutputProfile
|
|
36
37
|
} from "./chunk-2WZXXAQD.js";
|
|
37
38
|
import {
|
|
38
|
-
resolveAgentImageInputSupport
|
|
39
|
-
|
|
39
|
+
resolveAgentImageInputSupport,
|
|
40
|
+
resolveToolImagePolicy
|
|
41
|
+
} from "./chunk-XRU4QTSX.js";
|
|
40
42
|
import {
|
|
41
43
|
applyShapingCounts,
|
|
42
44
|
attachProjectionFacts,
|
|
@@ -95,7 +97,7 @@ import {
|
|
|
95
97
|
toOpenAiCompatibleMessages,
|
|
96
98
|
toResponsesTools,
|
|
97
99
|
transferDowngradedToolTurnOrigin
|
|
98
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-AEZBL2MY.js";
|
|
99
101
|
import {
|
|
100
102
|
TOOL_HAD_IMAGES,
|
|
101
103
|
TOOL_IMAGES,
|
|
@@ -108,7 +110,7 @@ import {
|
|
|
108
110
|
toolImageDelivery,
|
|
109
111
|
toolImages,
|
|
110
112
|
withoutToolImages
|
|
111
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-KYAMW3AY.js";
|
|
112
114
|
import {
|
|
113
115
|
BRIDGE_STREAM_MAX_CHARS,
|
|
114
116
|
CLI_NOLO_WORKSPACE_TOOL_NAMES,
|
|
@@ -16016,11 +16018,9 @@ function createHostWindowCapture(options = {}) {
|
|
|
16016
16018
|
const path = fileURLToPath2(uri);
|
|
16017
16019
|
const image = await (options.readImage ?? readLocalImage)(path);
|
|
16018
16020
|
if (!image.images?.length) throw new Error("portal image could not be decoded");
|
|
16019
|
-
const dimensions = /\[image (\d+x\d+) (\d+) bytes/.exec(image.content);
|
|
16020
|
-
if (!dimensions) throw new Error("invalid image summary");
|
|
16021
16021
|
return {
|
|
16022
16022
|
...image,
|
|
16023
|
-
content:
|
|
16023
|
+
content: `${formatImageSummary({ kind: "screenshot", ...image.imageSummary })}
|
|
16024
16024
|
\u6765\u6E90\uFF1A\u5BBF\u4E3B portal \u5168\u5C4F/\u4EA4\u4E92\u9009\u62E9\u7ED3\u679C\uFF1Bportal \u672A\u63D0\u4F9B\u5E94\u7528/\u7A97\u53E3\u8EAB\u4EFD\uFF0C\u65E0\u6CD5\u786E\u8BA4\u7A97\u53E3\u540D\u3002`
|
|
16025
16025
|
};
|
|
16026
16026
|
} finally {
|
|
@@ -16885,8 +16885,17 @@ function buildWorkspaceToolDefinition(toolName) {
|
|
|
16885
16885
|
type: "function",
|
|
16886
16886
|
function: {
|
|
16887
16887
|
name: "read_image",
|
|
16888
|
-
description: "Read
|
|
16889
|
-
parameters: {
|
|
16888
|
+
description: "Read 1 to 4 local PNG/JPEG/WebP/GIF images in one call. Supply either path (one image) or paths (1\u20134 images), never both. Any failure rejects the entire batch. Long edges above 1568px are resized to JPEG q80. Maximum encoded base64 size is 2MiB per image; request budget remains 4 images / 8MiB.",
|
|
16889
|
+
parameters: {
|
|
16890
|
+
type: "object",
|
|
16891
|
+
properties: {
|
|
16892
|
+
path: buildWorkspacePathProperty(),
|
|
16893
|
+
paths: { type: "array", items: buildWorkspacePathProperty(), minItems: 1, maxItems: 4 }
|
|
16894
|
+
},
|
|
16895
|
+
// 不用 oneOf:不少兼容网关/严格模式不支持参数级组合子,模型会两个都传 →
|
|
16896
|
+
// 执行器拒绝 → 反复重试形成死循环(2026-10-27 实测)。互斥由执行器校验。
|
|
16897
|
+
additionalProperties: false
|
|
16898
|
+
}
|
|
16890
16899
|
}
|
|
16891
16900
|
};
|
|
16892
16901
|
}
|
|
@@ -17897,7 +17906,7 @@ async function captureVisualStateTool(args2) {
|
|
|
17897
17906
|
`waitSelector: ${captureArgs.waitSelector}`,
|
|
17898
17907
|
...captureArgs.focusSelector ? [`focusSelector: ${captureArgs.focusSelector}`] : [],
|
|
17899
17908
|
...captureArgs.expectText ? [`expectText: ${captureArgs.expectText}`] : [],
|
|
17900
|
-
|
|
17909
|
+
formatImageSummary({ kind: "screenshot", ...image.imageSummary })
|
|
17901
17910
|
].join("\n"),
|
|
17902
17911
|
images: image.images,
|
|
17903
17912
|
metadata: {
|
|
@@ -18297,13 +18306,41 @@ function createLocalWorkspaceToolExecutors(args2) {
|
|
|
18297
18306
|
},
|
|
18298
18307
|
read_image: async (call) => {
|
|
18299
18308
|
const parsed = parseWorkspaceToolArguments(call.arguments);
|
|
18300
|
-
if (Object.keys(parsed).some((key) => key !== "path"
|
|
18301
|
-
|
|
18302
|
-
|
|
18303
|
-
|
|
18304
|
-
|
|
18305
|
-
|
|
18306
|
-
|
|
18309
|
+
if (Object.keys(parsed).some((key) => key !== "path" && key !== "paths")) {
|
|
18310
|
+
throw new Error("read_image accepts only path or paths");
|
|
18311
|
+
}
|
|
18312
|
+
const mergedPaths = [];
|
|
18313
|
+
if ("paths" in parsed) {
|
|
18314
|
+
if (!Array.isArray(parsed.paths)) throw new Error("read_image: paths must be an array of strings");
|
|
18315
|
+
mergedPaths.push(...parsed.paths);
|
|
18316
|
+
}
|
|
18317
|
+
if ("path" in parsed) mergedPaths.unshift(requireWorkspaceToolPath(parsed));
|
|
18318
|
+
if (mergedPaths.length === 0) {
|
|
18319
|
+
throw new Error("read_image requires path or paths");
|
|
18320
|
+
}
|
|
18321
|
+
if (mergedPaths.length > 4) {
|
|
18322
|
+
throw new Error(`read_image: maximum 4 images; received ${mergedPaths.length}`);
|
|
18323
|
+
}
|
|
18324
|
+
const paths = mergedPaths;
|
|
18325
|
+
if (!Array.isArray(paths) || paths.length === 0 || paths.some((path) => typeof path !== "string" || !path.trim())) {
|
|
18326
|
+
throw new Error("read_image: paths must contain 1 to 4 non-empty string paths (maximum 4 images)");
|
|
18327
|
+
}
|
|
18328
|
+
const results2 = await Promise.all(paths.map(async (path) => {
|
|
18329
|
+
try {
|
|
18330
|
+
const absolutePath = await resolveLocalWorkspaceToolPath({
|
|
18331
|
+
workspaceRoot: args2.workspaceRoot,
|
|
18332
|
+
requestedPath: path,
|
|
18333
|
+
...fileAccess
|
|
18334
|
+
});
|
|
18335
|
+
return await readLocalImage(absolutePath);
|
|
18336
|
+
} catch (error) {
|
|
18337
|
+
throw new Error(`read_image: failed to read ${JSON.stringify(path)}: ${error instanceof Error ? error.message : String(error)}`);
|
|
18338
|
+
}
|
|
18339
|
+
}));
|
|
18340
|
+
return {
|
|
18341
|
+
content: results2.map((result4) => result4.content).join("\n"),
|
|
18342
|
+
images: results2.flatMap((result4) => result4.images ?? [])
|
|
18343
|
+
};
|
|
18307
18344
|
},
|
|
18308
18345
|
readFile: (call) => readFileTool({
|
|
18309
18346
|
call,
|
|
@@ -20913,13 +20950,15 @@ ${reasoningTailLog}
|
|
|
20913
20950
|
}
|
|
20914
20951
|
|
|
20915
20952
|
// packages/integrations/openai/responsesRequestBody.ts
|
|
20916
|
-
function buildResponsesRequestBody(body, model) {
|
|
20953
|
+
function buildResponsesRequestBody(body, model, options) {
|
|
20917
20954
|
const tools = Array.isArray(body.tools) ? toResponsesTools(body.tools) : void 0;
|
|
20918
20955
|
const reasoningEffort = body.reasoning && typeof body.reasoning === "object" ? void 0 : typeof body.reasoning_effort === "string" && body.reasoning_effort.trim() ? body.reasoning_effort : void 0;
|
|
20919
20956
|
return {
|
|
20920
20957
|
...body,
|
|
20921
20958
|
model,
|
|
20922
|
-
input: Array.isArray(body.input) && body.input.length > 0 ? body.input : convertMessagesToResponsesInput(body.messages ?? []
|
|
20959
|
+
input: Array.isArray(body.input) && body.input.length > 0 ? body.input : convertMessagesToResponsesInput(body.messages ?? [], {
|
|
20960
|
+
supportsToolImages: options?.supportsToolImages
|
|
20961
|
+
}),
|
|
20923
20962
|
...Array.isArray(body.tools) ? { tools: tools ?? void 0 } : {},
|
|
20924
20963
|
...typeof body.max_tokens === "number" ? { max_output_tokens: body.max_tokens } : {},
|
|
20925
20964
|
...reasoningEffort ? { reasoning: { effort: reasoningEffort } } : {},
|
|
@@ -21250,8 +21289,16 @@ function buildOpenAiCompatibleChatCompletionRequest(args2) {
|
|
|
21250
21289
|
args2.providerConfig.model
|
|
21251
21290
|
);
|
|
21252
21291
|
const sanitizedMessages = sanitizeForOutbound(args2.messages, args2.tools);
|
|
21292
|
+
const toolImagePolicy = resolveToolImagePolicy({
|
|
21293
|
+
routeKind: isResponses ? "responses" : "openai-compatible",
|
|
21294
|
+
legacySupportsToolImages: isResponses ? false : void 0,
|
|
21295
|
+
provider: args2.providerConfig.usageProvider ?? args2.providerConfig.provider,
|
|
21296
|
+
model: args2.providerConfig.model,
|
|
21297
|
+
customProviderUrl: args2.providerConfig.endpoint,
|
|
21298
|
+
hasVision: args2.providerConfig.hasVision
|
|
21299
|
+
});
|
|
21253
21300
|
const messages = toOpenAiCompatibleMessages(sanitizedMessages, {
|
|
21254
|
-
supportsToolImages: !isResponses &&
|
|
21301
|
+
supportsToolImages: !isResponses && toolImagePolicy.supportsToolImages,
|
|
21255
21302
|
stripReasoningContent: shouldStripReasoning,
|
|
21256
21303
|
...args2.shapingCounts ? { shapingCounts: args2.shapingCounts } : {},
|
|
21257
21304
|
...resolveReasoningReplayOptions(
|
|
@@ -21288,7 +21335,9 @@ function buildOpenAiCompatibleChatCompletionRequest(args2) {
|
|
|
21288
21335
|
)
|
|
21289
21336
|
} : {}
|
|
21290
21337
|
};
|
|
21291
|
-
const body = isResponses ? buildResponsesRequestBody(rawBody, args2.providerConfig.model
|
|
21338
|
+
const body = isResponses ? buildResponsesRequestBody(rawBody, args2.providerConfig.model, {
|
|
21339
|
+
supportsToolImages: toolImagePolicy.supportsToolImages
|
|
21340
|
+
}) : normalizeChatCompletionsBodyForProvider({
|
|
21292
21341
|
body: rawBody,
|
|
21293
21342
|
provider: args2.providerConfig.provider,
|
|
21294
21343
|
model: args2.providerConfig.model,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DN2DBFJ2.js";
|
|
4
4
|
import {
|
|
5
5
|
format,
|
|
6
6
|
prepareAndPersistMessage,
|
|
7
7
|
uiAskChoiceFunc,
|
|
8
8
|
uiAskChoiceFunctionSchema
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MBFXRU2T.js";
|
|
10
10
|
import {
|
|
11
11
|
formatISO
|
|
12
12
|
} from "./chunk-ZRAU6T47.js";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-HS7MLR74.js";
|
|
4
4
|
import {
|
|
5
5
|
performServerProxyFetchWithRetry
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YWEMVIRS.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchServerSyncedCredential
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4NB4XLNL.js";
|
|
10
10
|
import {
|
|
11
11
|
buildSkillGuidancePromptBlock
|
|
12
12
|
} from "./chunk-3LNVSFTH.js";
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
resolveReasoningReplayOptions,
|
|
33
33
|
shouldStripReasoningContentForOutbound,
|
|
34
34
|
stablePromptCacheKey
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-AEZBL2MY.js";
|
|
36
36
|
import {
|
|
37
37
|
resolveAgentCallPlan,
|
|
38
38
|
resolveClientWire
|