nolo-cli 0.172.0-alpha.3 → 0.173.0-alpha.2

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 (83) hide show
  1. package/{_executeModel-P7OE5QLM.js → _executeModel-557MGBNC.js} +20 -19
  2. package/{agentDeleteCommand-3CCYENZM.js → agentDeleteCommand-HG5EDCO6.js} +25 -24
  3. package/{agentEmailCommands-VH6GRZ4S.js → agentEmailCommands-7YX27N6M.js} +27 -26
  4. package/{agentListCommands-FCSA7YV3.js → agentListCommands-AT5IGY5W.js} +16 -15
  5. package/{agentMachineCommands-VEBNXOLD.js → agentMachineCommands-WR3IFBB6.js} +14 -13
  6. package/{agentProviderCommands-TWVILNAN.js → agentProviderCommands-FXEMNSZ2.js} +2 -2
  7. package/{agentRecordCommands-MGCNHOJ3.js → agentRecordCommands-T6PXLK4B.js} +25 -24
  8. package/{agentRunCommand-UMVA6KSF.js → agentRunCommand-RB3TFF6O.js} +26 -25
  9. package/{agentRuntimeLocal-2JOFHEXA.js → agentRuntimeLocal-72TUBESS.js} +12 -11
  10. package/{agentSlice-AXI53QZB.js → agentSlice-YQHUKPIF.js} +1 -1
  11. package/{appDeleteCommands-BNQKVEIA.js → appDeleteCommands-THIHX7BV.js} +15 -14
  12. package/{appDeployCommands-V5WQ2ZBR.js → appDeployCommands-5JA5DDMR.js} +15 -14
  13. package/{appDeployStatusCommands-QA5GFIUU.js → appDeployStatusCommands-EHFPCQHM.js} +15 -14
  14. package/{appGetCommands-U3SDB4TE.js → appGetCommands-4HSRXSYD.js} +15 -14
  15. package/{appListCommands-DMHPABYC.js → appListCommands-TD7BQFWQ.js} +15 -14
  16. package/{authCommand-BSOLJFPV.js → authCommand-CVKPVPHN.js} +8 -4
  17. package/{chunk-6KS4TTCI.js → chunk-24VDDKCB.js} +10 -10
  18. package/{chunk-4TTEZGP3.js → chunk-2OWYKHKI.js} +65 -30
  19. package/{chunk-3RF4DIQW.js → chunk-4NYYWHM7.js} +7 -7
  20. package/{chunk-I33CJERI.js → chunk-7QQOOHDG.js} +2 -2
  21. package/{chunk-BKCR2JHG.js → chunk-7ZGMQZ5D.js} +0 -45
  22. package/chunk-A6B3LSDB.js +151 -0
  23. package/{chunk-XWEAIAO2.js → chunk-BAXCQF6H.js} +1 -1
  24. package/{chunk-AJ52EA72.js → chunk-D2J22QSE.js} +1 -1
  25. package/{chunk-XWX5ZGWR.js → chunk-DWFRZ3UI.js} +89 -24
  26. package/{chunk-CDDFEVZ5.js → chunk-EGT6ORP5.js} +10 -10
  27. package/{chunk-2FOT26E6.js → chunk-ENIQIEAF.js} +1 -1
  28. package/{chunk-55HS2GQD.js → chunk-EVW2U6RH.js} +3 -3
  29. package/{chunk-CRQGEMKZ.js → chunk-EY3QEZZR.js} +13 -13
  30. package/{chunk-U4C2R3PV.js → chunk-FDPODXE3.js} +3 -3
  31. package/{chunk-EW6GOYKQ.js → chunk-HHEM4TV3.js} +2 -2
  32. package/{chunk-QPUKYKMH.js → chunk-ISIFZP3N.js} +4 -101
  33. package/{chunk-7YN3HYWC.js → chunk-IVPXG433.js} +30 -15
  34. package/{chunk-RU4KURIK.js → chunk-J63HVOSX.js} +2 -2
  35. package/{chunk-OQ3DOBYB.js → chunk-JOUFPRE4.js} +178 -2
  36. package/{chunk-CK4GWPSD.js → chunk-KPSNHLFI.js} +3 -5
  37. package/{chunk-SIZPFDPU.js → chunk-KXIJYPVC.js} +2 -2
  38. package/{chunk-3SF6NB4R.js → chunk-L7ZCLG72.js} +2 -2
  39. package/{chunk-KSCX7GME.js → chunk-LCCULKPJ.js} +3 -3
  40. package/{chunk-XKL2RXV6.js → chunk-LTWBOZE6.js} +13 -11
  41. package/{chunk-ZQ545VNM.js → chunk-ONQ2APOE.js} +4 -4
  42. package/{chunk-UVP7VL6F.js → chunk-P34IX26T.js} +1 -1
  43. package/{chunk-U5UZ7IPM.js → chunk-QFAISMV5.js} +3 -3
  44. package/{chunk-TZ6CCFRL.js → chunk-QWNMFO5E.js} +3 -3
  45. package/{chunk-TOLFIE2I.js → chunk-RABMW33C.js} +3 -3
  46. package/{chunk-TY7GIRX6.js → chunk-RUKAOMXD.js} +1 -1
  47. package/{chunk-S4SA4INB.js → chunk-RYBZM4A2.js} +2 -2
  48. package/{chunk-7TBARDLF.js → chunk-T7HBI3WZ.js} +1 -1
  49. package/{chunk-ZCXK773F.js → chunk-TMAQFKHS.js} +2 -2
  50. package/chunk-UKZX3NHN.js +48 -0
  51. package/{chunk-EEFX46WP.js → chunk-VJ52BYBK.js} +1 -1
  52. package/{chunk-XBJIESNS.js → chunk-XAFCJN32.js} +2 -2
  53. package/{chunk-VVMACDVS.js → chunk-Y3BUTWUJ.js} +1 -1
  54. package/{chunk-KNDA4K34.js → chunk-YBTP3PUM.js} +1 -1
  55. package/{chunk-BIF4B4ON.js → chunk-Z4HDFBYK.js} +1 -1
  56. package/{commandRegistry-FDWLTWIQ.js → commandRegistry-PJ3EQ6U7.js} +49 -49
  57. package/{contentThunks-AAGKCQCZ.js → contentThunks-NVX3NBHZ.js} +6 -5
  58. package/{createAgentAutomationAction-2K7M6ACJ.js → createAgentAutomationAction-EONFRZYA.js} +6 -5
  59. package/{createDialogAction-RFQJMLEO.js → createDialogAction-ZVY45CNY.js} +7 -6
  60. package/{createPageAction-MBDADKFQ.js → createPageAction-N5XSWPN2.js} +6 -5
  61. package/{dialogCommands-E5I4ORXJ.js → dialogCommands-CPK6MUIJ.js} +15 -14
  62. package/{dialogSlice-MHZCAC4E.js → dialogSlice-ST2FXOF3.js} +5 -4
  63. package/{docCreateCommands-SMX7DXUS.js → docCreateCommands-GLR2HLYH.js} +14 -13
  64. package/{docDeleteCommands-MFPBAHFH.js → docDeleteCommands-MPE53Z5W.js} +15 -14
  65. package/{docReadCommands-ZOWLKFAF.js → docReadCommands-MFKWAFDI.js} +14 -13
  66. package/{docStore-IUFAMRVZ.js → docStore-PPUT7MQV.js} +1 -1
  67. package/{docUpdateCommands-4THL5VLI.js → docUpdateCommands-3QBT2XTK.js} +14 -13
  68. package/{handleSendMessageAction-OS6NNC3U.js → handleSendMessageAction-74EKQW4M.js} +13 -13
  69. package/index.js +4 -4
  70. package/{localRuntimeAdapter-XQ4PAAIT.js → localRuntimeAdapter-KQHAGAXR.js} +23 -22
  71. package/{machineCommands-UHGFVPD2.js → machineCommands-DMPHPCQS.js} +24 -23
  72. package/{machineWsRunDispatch-BAFZOC6Z.js → machineWsRunDispatch-736CCGUF.js} +24 -23
  73. package/package.json +1 -1
  74. package/{providerPresetApply-5K4PBX4J.js → providerPresetApply-MBMGCNKZ.js} +1 -2
  75. package/{providerRegistry-K5MSZ3Y5.js → providerRegistry-P4KYS6SE.js} +1 -2
  76. package/{readlineWorkspace-ISBZZPR2.js → readlineWorkspace-K4WNNW2D.js} +29 -28
  77. package/{runAgentClientLoop-H4KCCJOV.js → runAgentClientLoop-Z6STKR3Z.js} +18 -17
  78. package/{spaceCommands-PVEPGFHX.js → spaceCommands-U4UYF6IB.js} +14 -13
  79. package/{streamAgentChatTurn-4PX74Z36.js → streamAgentChatTurn-2ON7E6LT.js} +24 -22
  80. package/{tools-546KDFWP.js → tools-ZB2YBHSS.js} +12 -12
  81. package/{tuiSummaryLlmCaller-LA7NUKUJ.js → tuiSummaryLlmCaller-I2MRY6T5.js} +8 -7
  82. package/{updateDialogTitleAction-LIS3EPHP.js → updateDialogTitleAction-YMQAOVJ2.js} +6 -5
  83. package/chunk-TSCI6X6C.js +0 -185
@@ -1,11 +1,17 @@
1
1
  import {
2
2
  streamSseDataValues
3
3
  } from "./chunk-HNUWUO75.js";
4
+ import {
5
+ resolveAgentImageInputSupport
6
+ } from "./chunk-7QQOOHDG.js";
7
+ import {
8
+ projectOpenAiToolImages
9
+ } from "./chunk-A6B3LSDB.js";
4
10
  import {
5
11
  getAntigravityUserAgent,
6
12
  readAntigravityProjectId,
7
13
  resolveAntigravityCloudCodeBaseUrl
8
- } from "./chunk-TSCI6X6C.js";
14
+ } from "./chunk-JOUFPRE4.js";
9
15
  import {
10
16
  asOptionalTrimmedString
11
17
  } from "./chunk-G3SUCT4W.js";
@@ -145,20 +151,60 @@ function parseDataUrlToInlineData(url) {
145
151
  if (!match) return null;
146
152
  return { mimeType: match[1], data: match[2] };
147
153
  }
148
- function extractInlineDataParts(content) {
149
- if (!Array.isArray(content)) return [];
150
- const parts = [];
151
- for (const part of content) {
152
- if (!part || typeof part !== "object") continue;
153
- if (part.type !== "image_url") continue;
154
- const url = part.image_url?.url;
155
- if (typeof url !== "string" || !url.trim()) continue;
156
- const inline = parseDataUrlToInlineData(url);
157
- if (inline) parts.push({ inlineData: inline });
154
+ function filterOrphanedToolMessages(messages) {
155
+ if (!Array.isArray(messages)) return [];
156
+ const result = [];
157
+ let pendingFunctionCalls = [];
158
+ let toolCallIndex = 0;
159
+ for (const raw of messages) {
160
+ if (!raw || typeof raw !== "object" || !("role" in raw)) continue;
161
+ const role = String(raw.role);
162
+ if (role === "system") {
163
+ result.push(raw);
164
+ continue;
165
+ }
166
+ if (role === "user") {
167
+ pendingFunctionCalls = [];
168
+ result.push(raw);
169
+ continue;
170
+ }
171
+ if (role === "assistant" || role === "model") {
172
+ pendingFunctionCalls = [];
173
+ const calls = "tool_calls" in raw && Array.isArray(raw.tool_calls) ? raw.tool_calls : [];
174
+ for (const call of calls) {
175
+ if (!call || typeof call !== "object") continue;
176
+ const name = call.function?.name || `tool_${++toolCallIndex}`;
177
+ const id = typeof call.id === "string" ? call.id : "";
178
+ pendingFunctionCalls.push({ name, id });
179
+ }
180
+ result.push(raw);
181
+ continue;
182
+ }
183
+ if (role === "tool") {
184
+ const toolCallId = "tool_call_id" in raw && typeof raw.tool_call_id === "string" ? raw.tool_call_id : "";
185
+ const rawName = "name" in raw && typeof raw.name === "string" ? raw.name.trim() : "";
186
+ const pendingIndex = pendingFunctionCalls.findIndex(
187
+ (p) => toolCallId ? p.id === toolCallId : rawName ? p.name === rawName : true
188
+ );
189
+ if (pendingIndex === -1) {
190
+ continue;
191
+ }
192
+ pendingFunctionCalls.splice(pendingIndex, 1);
193
+ result.push(raw);
194
+ continue;
195
+ }
196
+ result.push(raw);
158
197
  }
159
- return parts;
198
+ return result;
160
199
  }
161
200
  function convertOpenAiMessagesToGemini(messages, options) {
201
+ const sanitizedMessages = filterOrphanedToolMessages(
202
+ messages ?? []
203
+ );
204
+ const effectiveMessages = projectOpenAiToolImages(
205
+ sanitizedMessages,
206
+ options.supportsToolImages === true
207
+ );
162
208
  const contents = [];
163
209
  const systemTexts = [];
164
210
  let toolCallIndex = 0;
@@ -186,7 +232,7 @@ function convertOpenAiMessagesToGemini(messages, options) {
186
232
  pendingFunctionCalls = [];
187
233
  pushOrMergeContent("user", dummyResponses);
188
234
  };
189
- for (const raw of messages) {
235
+ for (const raw of effectiveMessages) {
190
236
  if (!raw || typeof raw !== "object" || !("role" in raw)) continue;
191
237
  const role = String(raw.role);
192
238
  const content = "content" in raw ? raw.content : null;
@@ -199,16 +245,25 @@ function convertOpenAiMessagesToGemini(messages, options) {
199
245
  }
200
246
  if (role === "user") {
201
247
  flushPendingFunctionCalls();
202
- const text = messageText(
203
- content
204
- );
205
- const imageParts = extractInlineDataParts(
206
- content
207
- );
208
- if (!text && imageParts.length === 0) continue;
209
248
  const parts = [];
210
- if (text) parts.push({ text });
211
- for (const img of imageParts) parts.push(img);
249
+ if (typeof content === "string") {
250
+ const text = content.trim();
251
+ if (text) parts.push({ text });
252
+ } else if (Array.isArray(content)) {
253
+ for (const part of content) {
254
+ if (!part || typeof part !== "object") continue;
255
+ if (part.type === "text" && typeof part.text === "string" && part.text.trim()) {
256
+ parts.push({ text: part.text });
257
+ } else if (part.type === "image_url") {
258
+ const url = part.image_url?.url;
259
+ if (typeof url === "string" && url.trim()) {
260
+ const inline = parseDataUrlToInlineData(url);
261
+ if (inline) parts.push({ inlineData: inline });
262
+ }
263
+ }
264
+ }
265
+ }
266
+ if (parts.length === 0) continue;
212
267
  pushOrMergeContent("user", parts);
213
268
  continue;
214
269
  }
@@ -585,9 +640,13 @@ function shouldUseGeminiNativeToolRoute(provider, model, tools, isImageModel) {
585
640
  return provider === "google" && !isImageModel(model) && isGemini3Model(model) && Array.isArray(tools) && tools.length > 0;
586
641
  }
587
642
  function buildGeminiGenerateContentRequest(args) {
643
+ const supportsToolImages = args.supportsToolImages ?? false;
588
644
  const { contents, systemTexts } = convertOpenAiMessagesToGemini(
589
645
  args.messages,
590
- { attachSkipThoughtSignature: args.attachSkipThoughtSignature }
646
+ {
647
+ attachSkipThoughtSignature: args.attachSkipThoughtSignature,
648
+ supportsToolImages
649
+ }
591
650
  );
592
651
  const request = { contents };
593
652
  if (systemTexts.length > 0) {
@@ -628,8 +687,14 @@ function buildCloudCodeAssistPayload(args) {
628
687
  const rawMessages = Array.isArray(args.openAiBody.messages) ? args.openAiBody.messages : [];
629
688
  const quirks = resolveGeminiModelQuirks(model);
630
689
  const isClaude = quirks.isClaudeCrossModel;
690
+ const supportsToolImages = resolveAgentImageInputSupport({
691
+ ...args.agentConfig,
692
+ model,
693
+ hasVision: args.agentConfig.hasVision ?? false
694
+ });
631
695
  const { contents, systemTexts } = convertOpenAiMessagesToGemini(rawMessages, {
632
- attachSkipThoughtSignature: quirks.allowsThoughtSignatureSentinel
696
+ attachSkipThoughtSignature: quirks.allowsThoughtSignatureSentinel,
697
+ supportsToolImages
633
698
  });
634
699
  if (contents.length === 0) {
635
700
  throw new Error("Antigravity Cloud Code Assist request has no user/model contents.");
@@ -5,7 +5,7 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-ZCXK773F.js";
8
+ } from "./chunk-TMAQFKHS.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-ZQ545VNM.js";
17
+ } from "./chunk-ONQ2APOE.js";
18
18
  import {
19
19
  findToolExecutor,
20
20
  toolDefinitionsByName
21
- } from "./chunk-6KS4TTCI.js";
21
+ } from "./chunk-24VDDKCB.js";
22
22
  import {
23
23
  classifyApiError,
24
24
  classifyGenerationError,
25
25
  extractErrorDiagnostics
26
- } from "./chunk-RU4KURIK.js";
26
+ } from "./chunk-J63HVOSX.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-SIZPFDPU.js";
35
+ } from "./chunk-KXIJYPVC.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-XKL2RXV6.js";
45
+ } from "./chunk-LTWBOZE6.js";
46
46
  import {
47
47
  streamAgentChatTurn
48
- } from "./chunk-TOLFIE2I.js";
48
+ } from "./chunk-RABMW33C.js";
49
49
  import {
50
50
  getCurrentSpaceId
51
51
  } from "./chunk-ZJ7UHBJS.js";
@@ -85,13 +85,13 @@ import {
85
85
  } from "./chunk-56GBUMO5.js";
86
86
  import {
87
87
  normalizeChatCompletionsBodyForProvider
88
- } from "./chunk-QPUKYKMH.js";
88
+ } from "./chunk-ISIFZP3N.js";
89
89
  import {
90
90
  EMPTY_ASSISTANT_REPAIR_PROMPT
91
- } from "./chunk-7TBARDLF.js";
91
+ } from "./chunk-T7HBI3WZ.js";
92
92
  import {
93
93
  getModelInfo
94
- } from "./chunk-BKCR2JHG.js";
94
+ } from "./chunk-7ZGMQZ5D.js";
95
95
  import {
96
96
  isAbortError
97
97
  } from "./chunk-7DPNBQSV.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  requireTokenUser
3
- } from "./chunk-XWEAIAO2.js";
3
+ } from "./chunk-BAXCQF6H.js";
4
4
  import {
5
5
  t
6
6
  } from "./chunk-TDX2L4W2.js";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-4TTEZGP3.js";
4
+ } from "./chunk-2OWYKHKI.js";
5
5
  import {
6
6
  t
7
7
  } from "./chunk-TDX2L4W2.js";
8
8
  import {
9
9
  clipMultilineText
10
- } from "./chunk-SIZPFDPU.js";
10
+ } from "./chunk-KXIJYPVC.js";
11
11
  import {
12
12
  runLocalAgentTurn
13
- } from "./chunk-7YN3HYWC.js";
13
+ } from "./chunk-IVPXG433.js";
14
14
  import {
15
15
  applyToolSurfaceConstraints
16
16
  } from "./chunk-2GRXE3YJ.js";
@@ -9,7 +9,7 @@ import {
9
9
  resolveRawAgentInput,
10
10
  resolveServerUrl,
11
11
  writeUsage
12
- } from "./chunk-EEFX46WP.js";
12
+ } from "./chunk-VJ52BYBK.js";
13
13
  import {
14
14
  getReadableCliDb
15
15
  } from "./chunk-62TBKWTV.js";
@@ -31,7 +31,7 @@ import {
31
31
  resolveFileWriteGateEnabled,
32
32
  resolveLocalUserId,
33
33
  validateInstaboxWorkspaceSelection
34
- } from "./chunk-4TTEZGP3.js";
34
+ } from "./chunk-2OWYKHKI.js";
35
35
  import {
36
36
  clearCredentialAvailability,
37
37
  readEffectiveCredentialEntry,
@@ -64,7 +64,7 @@ import {
64
64
  import {
65
65
  readDbRecord,
66
66
  resolveAgentRecordFromHybridStore
67
- } from "./chunk-UVP7VL6F.js";
67
+ } from "./chunk-P34IX26T.js";
68
68
  import {
69
69
  isLocalCliAgentKey
70
70
  } from "./chunk-NBTY7YJF.js";
@@ -79,14 +79,14 @@ import {
79
79
  } from "./chunk-BMQ2MJUK.js";
80
80
  import {
81
81
  resolveCliLocalRuntimeKeyCapability
82
- } from "./chunk-6KS4TTCI.js";
82
+ } from "./chunk-24VDDKCB.js";
83
83
  import {
84
84
  isTransientFetchError
85
85
  } from "./chunk-KFHREHUQ.js";
86
86
  import {
87
87
  parseUiCard,
88
88
  uiCardFallback
89
- } from "./chunk-SIZPFDPU.js";
89
+ } from "./chunk-KXIJYPVC.js";
90
90
  import {
91
91
  isGatewayHttpStatus
92
92
  } from "./chunk-NF64D32W.js";
@@ -95,7 +95,7 @@ import {
95
95
  chooseMemoryOwners,
96
96
  loadMemoryCandidatesFromDb,
97
97
  resolveAgentMemoryPolicy
98
- } from "./chunk-S4SA4INB.js";
98
+ } from "./chunk-RYBZM4A2.js";
99
99
  import {
100
100
  API_REPORTED_COST_MULTIPLIER,
101
101
  estimateMessagesTokens,
@@ -103,7 +103,7 @@ import {
103
103
  resolveAgentContextWindow,
104
104
  resolveOccupancy,
105
105
  resolveOccupancyWindow
106
- } from "./chunk-XKL2RXV6.js";
106
+ } from "./chunk-LTWBOZE6.js";
107
107
  import {
108
108
  buildSkillDiscoveryContextLayer
109
109
  } from "./chunk-AU7AXHUL.js";
@@ -115,10 +115,10 @@ import {
115
115
  LOCAL_AGENT_CONFIG_MISSING_CODE,
116
116
  LOCAL_TURN_ABORTED_CODE,
117
117
  readActionGate
118
- } from "./chunk-7YN3HYWC.js";
118
+ } from "./chunk-IVPXG433.js";
119
119
  import {
120
120
  resolveAgentRuntimeConfigFromRecord
121
- } from "./chunk-EW6GOYKQ.js";
121
+ } from "./chunk-HHEM4TV3.js";
122
122
  import {
123
123
  createThinkParserState,
124
124
  flushThinkParser,
@@ -143,10 +143,10 @@ import {
143
143
  } from "./chunk-JLR5NWP2.js";
144
144
  import {
145
145
  normalizeUsage
146
- } from "./chunk-7TBARDLF.js";
146
+ } from "./chunk-T7HBI3WZ.js";
147
147
  import {
148
148
  isOAuthApiKeyRef
149
- } from "./chunk-BKCR2JHG.js";
149
+ } from "./chunk-UKZX3NHN.js";
150
150
  import {
151
151
  clipCompactText
152
152
  } from "./chunk-5MMAK75Q.js";
@@ -223,7 +223,7 @@ import {
223
223
  } from "./chunk-Y6ROFCZO.js";
224
224
  import {
225
225
  isAntigravityOAuthAgent
226
- } from "./chunk-TSCI6X6C.js";
226
+ } from "./chunk-JOUFPRE4.js";
227
227
  import {
228
228
  resolveClientVersion
229
229
  } from "./chunk-I2QHI2XM.js";
@@ -11376,7 +11376,7 @@ function isBalanceExhaustedError(error) {
11376
11376
 
11377
11377
  // packages/cli/client/agentRun.ts
11378
11378
  async function loadRunLocalAgentTurn() {
11379
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-2JOFHEXA.js");
11379
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-72TUBESS.js");
11380
11380
  return runLocalAgentTurn;
11381
11381
  }
11382
11382
  var stripDebugNoise = (s) => s.replace(/\s*raw="[\s\S]*"/g, "").replace(/\s*raw=\S+/g, "").replace(/\s*headers=\[[^\]]*\]/g, "").replace(/\s*headers=\S+/g, "").trim();
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-62TBKWTV.js";
7
7
  import {
8
8
  clearCliLocalRuntimePreparedAgentCache
9
- } from "./chunk-4TTEZGP3.js";
9
+ } from "./chunk-2OWYKHKI.js";
10
10
  import {
11
11
  readCredentialAvailability
12
12
  } from "./chunk-R4BMKAR5.js";
@@ -19,7 +19,7 @@ import {
19
19
  resolveAgentRecordFromHybridStore,
20
20
  sanitizeAgentRecordForCliOutput,
21
21
  writeAgentRecord
22
- } from "./chunk-UVP7VL6F.js";
22
+ } from "./chunk-P34IX26T.js";
23
23
  import {
24
24
  resolveCliAgentKeyInput
25
25
  } from "./chunk-NBTY7YJF.js";
@@ -244,7 +244,7 @@ async function runAgentCreateCommand(args, deps = {}) {
244
244
  let verifyResult;
245
245
  if (parsed.verify) {
246
246
  try {
247
- const { verifyCustomProvider } = await import("./agentProviderCommands-TWVILNAN.js");
247
+ const { verifyCustomProvider } = await import("./agentProviderCommands-FXEMNSZ2.js");
248
248
  const rec = built.nextRecord;
249
249
  verifyResult = await verifyCustomProvider({
250
250
  providerUrl: rec.customProviderUrl,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  resolveAgentImageInputSupport
3
- } from "./chunk-I33CJERI.js";
3
+ } from "./chunk-7QQOOHDG.js";
4
4
  import {
5
5
  TOOL_HAD_IMAGES,
6
6
  hadToolImages
7
- } from "./chunk-QPUKYKMH.js";
7
+ } from "./chunk-A6B3LSDB.js";
8
8
  import {
9
9
  asOptionalFiniteNumber
10
10
  } from "./chunk-WWC7I6TA.js";
@@ -1,6 +1,9 @@
1
+ import {
2
+ projectOpenAiToolImages
3
+ } from "./chunk-A6B3LSDB.js";
1
4
  import {
2
5
  getModelContextWindow
3
- } from "./chunk-BKCR2JHG.js";
6
+ } from "./chunk-7ZGMQZ5D.js";
4
7
  import {
5
8
  isRecord
6
9
  } from "./chunk-KUG52IAP.js";
@@ -232,54 +235,6 @@ var extractToolCallsFromResponseOutput = (response) => {
232
235
  return calls;
233
236
  };
234
237
 
235
- // packages/agent-runtime/toolImages.ts
236
- var EMPTY_TOOL_RESULT_TEXT = "[Tool completed without output]";
237
- var TOOL_HAD_IMAGES = "toolHadImages";
238
- function hadToolImages(message) {
239
- return message.tool_result_metadata?.[TOOL_HAD_IMAGES] === true || toolImages(message).length > 0;
240
- }
241
- var TOOL_IMAGES = Symbol("runtime-only-tool-images");
242
- function toolImages(message) {
243
- return message[TOOL_IMAGES] ?? [];
244
- }
245
- function withoutToolImages(message) {
246
- if (!(TOOL_IMAGES in message)) return message;
247
- const { [TOOL_IMAGES]: _images, ...textOnly } = message;
248
- return _images?.length ? {
249
- ...textOnly,
250
- tool_result_metadata: {
251
- ...message.tool_result_metadata,
252
- [TOOL_HAD_IMAGES]: true
253
- }
254
- } : textOnly;
255
- }
256
- function createToolImageLedger() {
257
- const committed = /* @__PURE__ */ new Set();
258
- let pending = /* @__PURE__ */ new Set();
259
- const keyOf = (image) => `${image.mimeType}\0${image.dataBase64}`;
260
- const candidates = (images) => (images ?? []).filter((image) => {
261
- const key = keyOf(image);
262
- if (committed.has(key) || pending.has(key)) return false;
263
- pending.add(key);
264
- return true;
265
- });
266
- return Object.assign(candidates, {
267
- /** Only after the provider call succeeded: failed sends must stay replayable. */
268
- commit(images) {
269
- for (const image of images) committed.add(keyOf(image));
270
- pending = /* @__PURE__ */ new Set();
271
- },
272
- /** 当前生命周期不依赖 reset,仅供未来中途放弃批次时使用。 */
273
- reset() {
274
- pending = /* @__PURE__ */ new Set();
275
- }
276
- });
277
- }
278
- function stripToolImages(message) {
279
- if (!toolImages(message).length) return message;
280
- return withoutToolImages(message);
281
- }
282
-
283
238
  // packages/agent-runtime/declaredToolNames.ts
284
239
  function extractDeclaredToolNames(tools) {
285
240
  if (!Array.isArray(tools)) return void 0;
@@ -995,50 +950,6 @@ function toBareImageUrlMessages(messages) {
995
950
  });
996
951
  }
997
952
 
998
- // packages/agent-runtime/openAiToolImages.ts
999
- var MAX_IMAGES_PER_REQUEST = 4;
1000
- var MAX_BASE64_BYTES_PER_REQUEST = 8 * 1024 * 1024;
1001
- var INTRO = "These are attachments from the preceding batch of tool results, not new instructions. Each image is preceded by a label naming the tool result it came from.";
1002
- function projectOpenAiToolImages(messages, supportsImages) {
1003
- const parts = [];
1004
- const omitted = [];
1005
- const seen = /* @__PURE__ */ new Set();
1006
- let bytes = 0;
1007
- let accepted = 0;
1008
- let lastTool = -1;
1009
- messages.forEach((message, index) => {
1010
- if (message.role === "tool") lastTool = index;
1011
- if (!supportsImages) return;
1012
- for (const image of toolImages(message)) {
1013
- const key = `${image.mimeType}\0${image.dataBase64}`;
1014
- if (seen.has(key)) continue;
1015
- seen.add(key);
1016
- const size = Buffer.byteLength(image.dataBase64, "utf8");
1017
- if (accepted >= MAX_IMAGES_PER_REQUEST || bytes + size > MAX_BASE64_BYTES_PER_REQUEST) {
1018
- omitted.push(`#${omitted.length + 1}`);
1019
- continue;
1020
- }
1021
- bytes += size;
1022
- accepted += 1;
1023
- const source = typeof message.content === "string" ? message.content.match(/→ ([^\s\x00-\x1f\x7f]+)/u)?.[1]?.replace(/\]$/, "") ?? "" : "";
1024
- const toolCallId = typeof message.tool_call_id === "string" ? message.tool_call_id : "unknown";
1025
- parts.push({
1026
- type: "text",
1027
- text: `Image ${accepted} \u2014 from tool result ${toolCallId.replace(/[\x00-\x1f\x7f]/g, "")}${source ? ` (${source})` : ""}`
1028
- });
1029
- parts.push({ type: "image_url", image_url: { url: `data:${image.mimeType};base64,${image.dataBase64}` } });
1030
- }
1031
- });
1032
- if (lastTool < 0) return messages;
1033
- if (!parts.length && !omitted.length) return messages;
1034
- const note = omitted.length ? ` Note: ${omitted.length} image(s) omitted (request budget: ${MAX_IMAGES_PER_REQUEST} images / 8 MiB base64) \u2014 they were NOT delivered, do not guess their content.` : "";
1035
- const attachment = {
1036
- role: "user",
1037
- content: [{ type: "text", text: `${INTRO}${note}` }, ...parts]
1038
- };
1039
- return [...messages.slice(0, lastTool + 1), attachment, ...messages.slice(lastTool + 1)];
1040
- }
1041
-
1042
953
  // packages/agent-runtime/openAiCompatibleMessages.ts
1043
954
  function isGeminiCompatibleTarget(provider, model) {
1044
955
  const p = (provider ?? "").trim().toLowerCase();
@@ -1268,14 +1179,6 @@ var normalizeChatCompletionsBodyForProvider = ({
1268
1179
  };
1269
1180
 
1270
1181
  export {
1271
- EMPTY_TOOL_RESULT_TEXT,
1272
- TOOL_HAD_IMAGES,
1273
- hadToolImages,
1274
- TOOL_IMAGES,
1275
- toolImages,
1276
- withoutToolImages,
1277
- createToolImageLedger,
1278
- stripToolImages,
1279
1182
  scanTruncation,
1280
1183
  classifyUnparsableToolArgs,
1281
1184
  markDowngradedToolTurnOrigin,
@@ -2,7 +2,7 @@ import {
2
2
  DEVIN_CONNECT_URL,
3
3
  parseSseDataLineJson,
4
4
  parseSseDataLineObject
5
- } from "./chunk-XWX5ZGWR.js";
5
+ } from "./chunk-DWFRZ3UI.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-KSCX7GME.js";
14
+ } from "./chunk-LCCULKPJ.js";
15
15
  import {
16
16
  readSseFrames
17
17
  } from "./chunk-HNUWUO75.js";
@@ -28,7 +28,7 @@ import {
28
28
  import {
29
29
  hasImageInRuntimeMessages,
30
30
  stripImagePartsFromMessages
31
- } from "./chunk-EW6GOYKQ.js";
31
+ } from "./chunk-HHEM4TV3.js";
32
32
  import {
33
33
  clipToolText,
34
34
  resolveHistoricalToolContentCap,
@@ -36,7 +36,7 @@ import {
36
36
  } from "./chunk-2WZXXAQD.js";
37
37
  import {
38
38
  resolveAgentImageInputSupport
39
- } from "./chunk-I33CJERI.js";
39
+ } from "./chunk-7QQOOHDG.js";
40
40
  import {
41
41
  applyShapingCounts,
42
42
  attachProjectionFacts,
@@ -73,18 +73,14 @@ import {
73
73
  resolveToolGuidedSections
74
74
  } from "./chunk-ZEOR6XPJ.js";
75
75
  import {
76
- TOOL_HAD_IMAGES,
77
- TOOL_IMAGES,
78
76
  classifyUnparsableToolArgs,
79
77
  collectStablePromptPrefix,
80
78
  convertMessagesToResponsesInput,
81
- createToolImageLedger,
82
79
  downgradeUnparsableToolCalls,
83
80
  extractReasoningFromResponseOutput,
84
81
  extractTextFromResponseOutput,
85
82
  extractToolCallsFromResponseOutput,
86
83
  getUsageRequestOptions,
87
- hadToolImages,
88
84
  hasParsableObjectArguments,
89
85
  markDowngradedToolTurnOrigin,
90
86
  normalizeChatCompletionsBodyForProvider,
@@ -95,14 +91,24 @@ import {
95
91
  scanTruncation,
96
92
  shouldStripReasoningContentForOutbound,
97
93
  stablePromptCacheKey,
98
- stripToolImages,
99
94
  toBareImageUrlMessages,
100
95
  toOpenAiCompatibleMessages,
101
96
  toResponsesTools,
97
+ transferDowngradedToolTurnOrigin
98
+ } from "./chunk-ISIFZP3N.js";
99
+ import {
100
+ TOOL_HAD_IMAGES,
101
+ TOOL_IMAGES,
102
+ TOOL_IMAGE_NOTICES,
103
+ createToolImageLedger,
104
+ createToolImageNotices,
105
+ hadToolImages,
106
+ resetToolImageDelivery,
107
+ stripToolImages,
108
+ toolImageDelivery,
102
109
  toolImages,
103
- transferDowngradedToolTurnOrigin,
104
110
  withoutToolImages
105
- } from "./chunk-QPUKYKMH.js";
111
+ } from "./chunk-A6B3LSDB.js";
106
112
  import {
107
113
  BRIDGE_STREAM_MAX_CHARS,
108
114
  CLI_NOLO_WORKSPACE_TOOL_NAMES,
@@ -137,7 +143,7 @@ import {
137
143
  resolveEmptyAssistantFallbackMessage,
138
144
  resolveEmptyAssistantOutcome,
139
145
  resolveTruncatedReasoningTailLog
140
- } from "./chunk-7TBARDLF.js";
146
+ } from "./chunk-T7HBI3WZ.js";
141
147
  import {
142
148
  COMPACTION_SUMMARY_SCHEMA_VERSION,
143
149
  COMPACTION_SUMMARY_SYSTEM_PROMPT,
@@ -160,7 +166,7 @@ import {
160
166
  sha256Hex,
161
167
  truncateToolOutputForContext,
162
168
  withProviderCallTimingFields
163
- } from "./chunk-BKCR2JHG.js";
169
+ } from "./chunk-7ZGMQZ5D.js";
164
170
  import {
165
171
  clipCompactText
166
172
  } from "./chunk-5MMAK75Q.js";
@@ -20215,6 +20221,7 @@ async function runLocalAgentTurn(input) {
20215
20221
  if (!budgetAdmissionGate()) {
20216
20222
  break;
20217
20223
  }
20224
+ resetToolImageDelivery(requestMessages.flatMap(toolImages));
20218
20225
  result4 = await runCompleteWithTimeout({
20219
20226
  provider,
20220
20227
  messages: requestMessages,
@@ -20266,8 +20273,15 @@ async function runLocalAgentTurn(input) {
20266
20273
  providerName: agentConfig.provider,
20267
20274
  model: provider.model
20268
20275
  });
20269
- acceptToolImages.commit(requestMessages.flatMap(toolImages));
20270
- transcript.replaceWorkingHistory(transcript.working().map((message) => stripToolImages(message)));
20276
+ acceptToolImages.discard(requestMessages.flatMap(toolImages).filter((image) => toolImageDelivery(image) === "impossible"));
20277
+ acceptToolImages.commit(
20278
+ requestMessages.flatMap(toolImages).filter((image) => toolImageDelivery(image) === "delivered"),
20279
+ requestMessages.flatMap(toolImages).filter((image) => !toolImageDelivery(image))
20280
+ );
20281
+ transcript.replaceWorkingHistory(transcript.working().map((message) => {
20282
+ const pending = toolImages(message).filter((image) => supportsImages && !toolImageDelivery(image));
20283
+ return pending.length ? { ...message, [TOOL_IMAGES]: pending } : stripToolImages(message);
20284
+ }));
20271
20285
  loopTiming.mark("llmCall", round);
20272
20286
  usageLedger.recordProviderCall({
20273
20287
  usage: result4.usage,
@@ -20453,6 +20467,7 @@ ${reasoningTailLog}
20453
20467
  tool_call_id: toolCall.id,
20454
20468
  toolName,
20455
20469
  [TOOL_IMAGES]: acceptToolImages(toolResult.images),
20470
+ [TOOL_IMAGE_NOTICES]: createToolImageNotices(),
20456
20471
  ...observedMetadata || toolResult.images?.length ? { tool_result_metadata: {
20457
20472
  ...observedMetadata,
20458
20473
  ...toolResult.images?.length ? { [TOOL_HAD_IMAGES]: true } : {}
@@ -2,7 +2,7 @@ import {
2
2
  clipMultilineText,
3
3
  fetchAndSerializeTable,
4
4
  waitForAbortableDelay
5
- } from "./chunk-SIZPFDPU.js";
5
+ } from "./chunk-KXIJYPVC.js";
6
6
  import {
7
7
  isGatewayHttpStatus
8
8
  } from "./chunk-NF64D32W.js";
@@ -21,7 +21,7 @@ import {
21
21
  } from "./chunk-AGIM7IMJ.js";
22
22
  import {
23
23
  fetchAndCacheMessages
24
- } from "./chunk-XKL2RXV6.js";
24
+ } from "./chunk-LTWBOZE6.js";
25
25
  import {
26
26
  createSpaceKey
27
27
  } from "./chunk-UAD2WT54.js";