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.
Files changed (70) hide show
  1. package/{_executeModel-557MGBNC.js → _executeModel-6WX5JUK7.js} +14 -14
  2. package/{accountResolver-YGMLY3WW.js → accountResolver-OHS53Q75.js} +2 -2
  3. package/{agentDeleteCommand-WI6U4NFI.js → agentDeleteCommand-JQG2LSA5.js} +18 -18
  4. package/{agentEmailCommands-Z3TNB4JY.js → agentEmailCommands-OXTDO2NF.js} +20 -20
  5. package/{agentListCommands-UHHP6HFB.js → agentListCommands-4EXK3SYL.js} +8 -8
  6. package/{agentMachineCommands-FIUBHYRT.js → agentMachineCommands-EY7STQGY.js} +9 -9
  7. package/{agentRecordCommands-EQDWG4RY.js → agentRecordCommands-YBMNP36Y.js} +19 -19
  8. package/{agentRunCommand-WZCHXCYS.js → agentRunCommand-RLLMSTZO.js} +20 -20
  9. package/{agentRuntimeLocal-VQZCOFTL.js → agentRuntimeLocal-JNX6T5PK.js} +8 -8
  10. package/{agentSlice-YQHUKPIF.js → agentSlice-FYQAPKX5.js} +1 -1
  11. package/{appDeleteCommands-3QISRABE.js → appDeleteCommands-26FQDO25.js} +8 -8
  12. package/{appDeployCommands-UIMXDPOG.js → appDeployCommands-SUWSMHNK.js} +8 -8
  13. package/{appDeployStatusCommands-D2ZA54DA.js → appDeployStatusCommands-KQ7ENQE4.js} +8 -8
  14. package/{appGetCommands-QH2XYWOK.js → appGetCommands-HGMGWU5B.js} +8 -8
  15. package/{appListCommands-HH2HYJDZ.js → appListCommands-2N6XHLGI.js} +8 -8
  16. package/{authCommand-CVKPVPHN.js → authCommand-44AMFHPM.js} +3 -3
  17. package/{chromeCommands-Z5LDHMYN.js → chromeCommands-VANHVOCE.js} +2 -2
  18. package/{chromeOpsCommands-CHBIUDJD.js → chromeOpsCommands-RY776THN.js} +2 -2
  19. package/{chunk-MG63GUYM.js → chunk-33BY55WF.js} +3 -3
  20. package/{chunk-Z4UP2EDE.js → chunk-3MZ33FL7.js} +1 -1
  21. package/{chunk-RABMW33C.js → chunk-4NB4XLNL.js} +3 -3
  22. package/{chunk-HHEM4TV3.js → chunk-5VNY3X7V.js} +2 -2
  23. package/{chunk-KXIJYPVC.js → chunk-5ZTCH2Y6.js} +2 -2
  24. package/{chunk-UILL43UU.js → chunk-72ILVFRF.js} +35 -27
  25. package/{chunk-RNIZNIVT.js → chunk-ABEZP6S7.js} +9 -9
  26. package/{chunk-ISIFZP3N.js → chunk-AEZBL2MY.js} +64 -3
  27. package/{chunk-24VDDKCB.js → chunk-C2M3QZBC.js} +8 -8
  28. package/{chunk-LCCULKPJ.js → chunk-CY2NSJL5.js} +24 -5
  29. package/{chunk-Z4HDFBYK.js → chunk-DN2DBFJ2.js} +1 -1
  30. package/{chunk-4NYYWHM7.js → chunk-E23Y7NIR.js} +5 -5
  31. package/{chunk-EGT6ORP5.js → chunk-FR2AHCB6.js} +8 -8
  32. package/{chunk-SRZ6BQIP.js → chunk-HIVDQPQR.js} +9 -1
  33. package/{chunk-DWFRZ3UI.js → chunk-ITSMLMHJ.js} +12 -7
  34. package/{chunk-TMAQFKHS.js → chunk-IZAL4EF7.js} +2 -2
  35. package/{chunk-A6B3LSDB.js → chunk-KYAMW3AY.js} +10 -6
  36. package/{chunk-QFAISMV5.js → chunk-LP4XBYE7.js} +3 -3
  37. package/{chunk-LTWBOZE6.js → chunk-MBFXRU2T.js} +8 -8
  38. package/{chunk-VJ52BYBK.js → chunk-NF5NWGPH.js} +1 -1
  39. package/{chunk-L7ZCLG72.js → chunk-NRO3AZRC.js} +2 -2
  40. package/{chunk-FGSVT353.js → chunk-PAI4KXWW.js} +74 -25
  41. package/{chunk-RYBZM4A2.js → chunk-PN2D6STE.js} +2 -2
  42. package/{chunk-ONQ2APOE.js → chunk-RX7AYZIB.js} +3 -3
  43. package/{chunk-7QQOOHDG.js → chunk-XRU4QTSX.js} +24 -8
  44. package/{chunk-DPQYIS6D.js → chunk-YUXSWHQC.js} +3 -2
  45. package/{chunk-J63HVOSX.js → chunk-YWEMVIRS.js} +2 -2
  46. package/{commandRegistry-S54U5ZHX.js → commandRegistry-VUSP6YAY.js} +51 -51
  47. package/{contentThunks-NVX3NBHZ.js → contentThunks-HLBN6LDG.js} +3 -3
  48. package/{createAgentAutomationAction-EONFRZYA.js → createAgentAutomationAction-KZHZ7RGX.js} +3 -3
  49. package/{createDialogAction-ZVY45CNY.js → createDialogAction-R4QDGQPX.js} +4 -4
  50. package/{createPageAction-N5XSWPN2.js → createPageAction-BEQBAYSA.js} +3 -3
  51. package/{dialogCommands-A5CHG67A.js → dialogCommands-TH32KIJ4.js} +8 -8
  52. package/{dialogSlice-ST2FXOF3.js → dialogSlice-XUN4AEE6.js} +2 -2
  53. package/{docCreateCommands-BF354FQW.js → docCreateCommands-DU2MJR2G.js} +8 -8
  54. package/{docDeleteCommands-3K5K4XFO.js → docDeleteCommands-6POYBBEE.js} +8 -8
  55. package/{docReadCommands-A7ZDZIQV.js → docReadCommands-SN2JJSMI.js} +8 -8
  56. package/{docStore-PPUT7MQV.js → docStore-YGM3R64V.js} +1 -1
  57. package/{docUpdateCommands-5MGDR5ME.js → docUpdateCommands-JBC4GWE6.js} +8 -8
  58. package/{handleSendMessageAction-74EKQW4M.js → handleSendMessageAction-I3TYJFAZ.js} +8 -8
  59. package/index.js +4 -4
  60. package/{localRuntimeAdapter-ZAXRSVWI.js → localRuntimeAdapter-MUGE4TRL.js} +18 -18
  61. package/{machineCommands-MT4FDVVG.js → machineCommands-EEFNO3WU.js} +19 -19
  62. package/{machineWsRunDispatch-7T3SEMB6.js → machineWsRunDispatch-SXNCWZNO.js} +19 -19
  63. package/package.json +1 -1
  64. package/{readlineWorkspace-MTYLMWBM.js → readlineWorkspace-W23GKNU7.js} +20 -20
  65. package/{runAgentClientLoop-Z6STKR3Z.js → runAgentClientLoop-HZU57DWI.js} +12 -12
  66. package/{spaceCommands-M44RQPCK.js → spaceCommands-2D7RAC6A.js} +8 -8
  67. package/{streamAgentChatTurn-2ON7E6LT.js → streamAgentChatTurn-YGVG54KM.js} +16 -16
  68. package/{tools-ZB2YBHSS.js → tools-EHK4XG4X.js} +7 -7
  69. package/{tuiSummaryLlmCaller-I2MRY6T5.js → tuiSummaryLlmCaller-2MLU3QOG.js} +4 -4
  70. 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
- resolveAgentImageInputSupport
6
- } from "./chunk-7QQOOHDG.js";
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-ISIFZP3N.js";
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
- input: convertMessagesToResponsesInput(sanitizedMessages)
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: resolveAgentImageInputSupport({ provider: args.providerConfig.usageProvider ?? args.providerConfig.provider, model: args.providerConfig.model, customProviderUrl: args.providerConfig.endpoint, hasVision: args.providerConfig.hasVision ?? false }),
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
  },
@@ -2,7 +2,7 @@ import {
2
2
  deleteDialog,
3
3
  runtime_default,
4
4
  toast
5
- } from "./chunk-LTWBOZE6.js";
5
+ } from "./chunk-MBFXRU2T.js";
6
6
  import {
7
7
  getCurrentSpaceId,
8
8
  getCurrentSpaceIdRaw,
@@ -7,7 +7,7 @@ import {
7
7
  mergeReferences,
8
8
  resolveReferenceAssets,
9
9
  resolveToolsFromKeys
10
- } from "./chunk-J63HVOSX.js";
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-KXIJYPVC.js";
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-L7ZCLG72.js";
35
+ } from "./chunk-NRO3AZRC.js";
36
36
  import {
37
37
  getTableState
38
- } from "./chunk-Z4HDFBYK.js";
38
+ } from "./chunk-DN2DBFJ2.js";
39
39
  import {
40
40
  PERSONALIZATION_DIALOG_CATEGORY,
41
41
  buildPersonalizationDialogPolicyContext,
42
42
  selectAllMsgs
43
- } from "./chunk-LTWBOZE6.js";
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-TMAQFKHS.js";
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-ONQ2APOE.js";
17
+ } from "./chunk-RX7AYZIB.js";
18
18
  import {
19
19
  findToolExecutor,
20
20
  toolDefinitionsByName
21
- } from "./chunk-24VDDKCB.js";
21
+ } from "./chunk-C2M3QZBC.js";
22
22
  import {
23
23
  classifyApiError,
24
24
  classifyGenerationError,
25
25
  extractErrorDiagnostics
26
- } from "./chunk-J63HVOSX.js";
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-KXIJYPVC.js";
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-LTWBOZE6.js";
45
+ } from "./chunk-MBFXRU2T.js";
46
46
  import {
47
47
  streamAgentChatTurn
48
- } from "./chunk-RABMW33C.js";
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-ISIFZP3N.js";
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
- content: `[image ${width}x${height} ${output.length} bytes \u2192 ${path}]`,
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
- resolveAgentImageInputSupport
6
- } from "./chunk-7QQOOHDG.js";
5
+ resolveToolImagePolicy
6
+ } from "./chunk-XRU4QTSX.js";
7
7
  import {
8
8
  projectOpenAiToolImages
9
- } from "./chunk-A6B3LSDB.js";
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.supportsToolImages ?? false;
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 = resolveAgentImageInputSupport({
694
+ const supportsToolImages = resolveToolImagePolicy({
691
695
  ...args.agentConfig,
696
+ routeKind: "antigravity",
692
697
  model,
693
- hasVision: args.agentConfig.hasVision ?? false
694
- });
698
+ hasVision: args.agentConfig.hasVision
699
+ }).supportsToolImages;
695
700
  const { contents, systemTexts } = convertOpenAiMessagesToGemini(rawMessages, {
696
701
  attachSkipThoughtSignature: quirks.allowsThoughtSignatureSentinel,
697
702
  supportsToolImages
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  toolRegistry
3
- } from "./chunk-24VDDKCB.js";
3
+ } from "./chunk-C2M3QZBC.js";
4
4
  import {
5
5
  runtime_default
6
- } from "./chunk-LTWBOZE6.js";
6
+ } from "./chunk-MBFXRU2T.js";
7
7
  import {
8
8
  canonicalizeToolNames
9
9
  } from "./chunk-5EBLANFT.js";
@@ -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 > 8 * 1024 * 1024) {
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 >= 4 || bytes + size > 8 * 1024 * 1024) return "pending";
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-J63HVOSX.js";
4
+ } from "./chunk-YWEMVIRS.js";
5
5
  import {
6
6
  updateTokensAction
7
- } from "./chunk-LTWBOZE6.js";
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-ISIFZP3N.js";
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-RABMW33C.js";
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-YQHUKPIF.js");
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-ST2FXOF3.js");
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-ZVY45CNY.js");
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-EONFRZYA.js");
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-YMQAOVJ2.js");
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-74EKQW4M.js");
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-PPUT7MQV.js");
13937
+ const { createDocState } = await import("./docStore-YGM3R64V.js");
13938
13938
  const pageKey = await createDocState(
13939
13939
  { slateData, title },
13940
13940
  { dispatch, getState }
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-NBTY7YJF.js";
6
6
  import {
7
7
  resolveCliLocalRuntimeKeyCapability
8
- } from "./chunk-24VDDKCB.js";
8
+ } from "./chunk-C2M3QZBC.js";
9
9
  import {
10
10
  HIGH_RISK_MUTATION_TOOL_NAMES
11
11
  } from "./chunk-2GRXE3YJ.js";
@@ -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-NVX3NBHZ.js");
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-N5XSWPN2.js");
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-DWFRZ3UI.js";
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-LCCULKPJ.js";
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-SRZ6BQIP.js";
28
+ } from "./chunk-HIVDQPQR.js";
28
29
  import {
29
30
  hasImageInRuntimeMessages,
30
31
  stripImagePartsFromMessages
31
- } from "./chunk-HHEM4TV3.js";
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
- } from "./chunk-7QQOOHDG.js";
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-ISIFZP3N.js";
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-A6B3LSDB.js";
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: `[screenshot ${dimensions[1]} ${Math.round(Number(dimensions[2]) / 1024)}KB \u2192 ${path}]
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 one local PNG/JPEG/WebP/GIF image. Long edges above 1568px are resized to JPEG q80. Maximum encoded base64 size is 2MiB.",
16889
- parameters: { type: "object", properties: { path: buildWorkspacePathProperty() }, required: ["path"], additionalProperties: false }
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
- image.content.replace("[image ", "[screenshot ").replace(/(\d+) bytes/, (_, bytes) => `${Math.ceil(Number(bytes) / 1024)}KB`)
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")) throw new Error("read_image accepts exactly one path");
18301
- const absolutePath = await resolveLocalWorkspaceToolPath({
18302
- workspaceRoot: args2.workspaceRoot,
18303
- requestedPath: requireWorkspaceToolPath(parsed),
18304
- ...fileAccess
18305
- });
18306
- return readLocalImage(absolutePath);
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 && resolveAgentImageInputSupport({ provider: args2.providerConfig.usageProvider ?? args2.providerConfig.provider, model: args2.providerConfig.model, customProviderUrl: args2.providerConfig.endpoint, hasVision: args2.providerConfig.hasVision ?? false }),
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) : normalizeChatCompletionsBodyForProvider({
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-Z4HDFBYK.js";
3
+ } from "./chunk-DN2DBFJ2.js";
4
4
  import {
5
5
  format,
6
6
  prepareAndPersistMessage,
7
7
  uiAskChoiceFunc,
8
8
  uiAskChoiceFunctionSchema
9
- } from "./chunk-LTWBOZE6.js";
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-J63HVOSX.js";
6
+ } from "./chunk-YWEMVIRS.js";
7
7
  import {
8
8
  fetchServerSyncedCredential
9
- } from "./chunk-RABMW33C.js";
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-ISIFZP3N.js";
35
+ } from "./chunk-AEZBL2MY.js";
36
36
  import {
37
37
  resolveAgentCallPlan,
38
38
  resolveClientWire