nolo-cli 0.175.0-alpha.1 → 0.176.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 (65) hide show
  1. package/{_executeModel-557MGBNC.js → _executeModel-OV72YSE4.js} +14 -14
  2. package/{agentDeleteCommand-WI6U4NFI.js → agentDeleteCommand-HOWS5BAT.js} +16 -16
  3. package/{agentEmailCommands-Z3TNB4JY.js → agentEmailCommands-3EETPZFC.js} +18 -18
  4. package/{agentListCommands-UHHP6HFB.js → agentListCommands-7ZZHM4GC.js} +7 -7
  5. package/{agentMachineCommands-FIUBHYRT.js → agentMachineCommands-BGQVXERS.js} +8 -8
  6. package/{agentRecordCommands-EQDWG4RY.js → agentRecordCommands-L2O46J54.js} +17 -17
  7. package/{agentRunCommand-WZCHXCYS.js → agentRunCommand-7HDQ4RLO.js} +18 -18
  8. package/{agentRuntimeLocal-VQZCOFTL.js → agentRuntimeLocal-3QX3FMER.js} +7 -7
  9. package/{agentSlice-YQHUKPIF.js → agentSlice-VC7BZD5N.js} +1 -1
  10. package/{appDeleteCommands-3QISRABE.js → appDeleteCommands-NJAVC6F4.js} +7 -7
  11. package/{appDeployCommands-UIMXDPOG.js → appDeployCommands-POTCQDWQ.js} +7 -7
  12. package/{appDeployStatusCommands-D2ZA54DA.js → appDeployStatusCommands-YIG5S2ET.js} +7 -7
  13. package/{appGetCommands-QH2XYWOK.js → appGetCommands-HSXKEA64.js} +7 -7
  14. package/{appListCommands-HH2HYJDZ.js → appListCommands-GKLZKGKZ.js} +7 -7
  15. package/{authCommand-CVKPVPHN.js → authCommand-2IUG2PX7.js} +3 -3
  16. package/{chunk-Z4UP2EDE.js → chunk-33AGCT5W.js} +1 -1
  17. package/{chunk-RNIZNIVT.js → chunk-36OQE7ZU.js} +9 -9
  18. package/{chunk-QFAISMV5.js → chunk-3ERN2PSD.js} +3 -3
  19. package/{chunk-RYBZM4A2.js → chunk-73FHDE7C.js} +2 -2
  20. package/{chunk-TMAQFKHS.js → chunk-CCWUO2ZE.js} +2 -2
  21. package/{chunk-HHEM4TV3.js → chunk-CS4FUKMG.js} +2 -2
  22. package/{chunk-LCCULKPJ.js → chunk-DRR5E2EM.js} +24 -5
  23. package/{chunk-ONQ2APOE.js → chunk-GA4NE7QH.js} +3 -3
  24. package/{chunk-RABMW33C.js → chunk-GHNRJ3TK.js} +3 -3
  25. package/{chunk-Z4HDFBYK.js → chunk-GJU7F5IR.js} +1 -1
  26. package/{chunk-A6B3LSDB.js → chunk-IJOJMOCX.js} +6 -2
  27. package/{chunk-MG63GUYM.js → chunk-IR55JAHL.js} +3 -3
  28. package/{chunk-4NYYWHM7.js → chunk-JJE5HQ6M.js} +5 -5
  29. package/{chunk-LTWBOZE6.js → chunk-LQRXBYTS.js} +8 -8
  30. package/{chunk-UILL43UU.js → chunk-MR7SWXO4.js} +31 -23
  31. package/{chunk-VJ52BYBK.js → chunk-P3KTMRQ2.js} +1 -1
  32. package/{chunk-FGSVT353.js → chunk-QA5LXQFO.js} +24 -11
  33. package/{chunk-DWFRZ3UI.js → chunk-QMFYP3O4.js} +12 -7
  34. package/{chunk-L7ZCLG72.js → chunk-S4SXPMPC.js} +2 -2
  35. package/{chunk-KXIJYPVC.js → chunk-SYIWIP4D.js} +2 -2
  36. package/{chunk-24VDDKCB.js → chunk-TV6QW46C.js} +8 -8
  37. package/{chunk-ISIFZP3N.js → chunk-U3YGSKXD.js} +64 -3
  38. package/{chunk-J63HVOSX.js → chunk-UPJVQK5J.js} +2 -2
  39. package/{chunk-EGT6ORP5.js → chunk-XIM37FAU.js} +8 -8
  40. package/{chunk-7QQOOHDG.js → chunk-XRU4QTSX.js} +24 -8
  41. package/{commandRegistry-S54U5ZHX.js → commandRegistry-B24YK3LB.js} +47 -47
  42. package/{contentThunks-NVX3NBHZ.js → contentThunks-F4Y7V4IH.js} +3 -3
  43. package/{createAgentAutomationAction-EONFRZYA.js → createAgentAutomationAction-7K5M7ULU.js} +3 -3
  44. package/{createDialogAction-ZVY45CNY.js → createDialogAction-SYA2LFEN.js} +4 -4
  45. package/{createPageAction-N5XSWPN2.js → createPageAction-FAYZZVYI.js} +3 -3
  46. package/{dialogCommands-A5CHG67A.js → dialogCommands-K6AQZTAS.js} +7 -7
  47. package/{dialogSlice-ST2FXOF3.js → dialogSlice-QRWP73XJ.js} +2 -2
  48. package/{docCreateCommands-BF354FQW.js → docCreateCommands-3ZDCDYLH.js} +7 -7
  49. package/{docDeleteCommands-3K5K4XFO.js → docDeleteCommands-O74MHZEA.js} +7 -7
  50. package/{docReadCommands-A7ZDZIQV.js → docReadCommands-QJPAFQS3.js} +7 -7
  51. package/{docStore-PPUT7MQV.js → docStore-TABPPAGD.js} +1 -1
  52. package/{docUpdateCommands-5MGDR5ME.js → docUpdateCommands-M3THSN6V.js} +7 -7
  53. package/{handleSendMessageAction-74EKQW4M.js → handleSendMessageAction-FRBUFXEC.js} +8 -8
  54. package/index.js +4 -4
  55. package/{localRuntimeAdapter-ZAXRSVWI.js → localRuntimeAdapter-2YSA5D7P.js} +16 -16
  56. package/{machineCommands-MT4FDVVG.js → machineCommands-LVRRVNPD.js} +17 -17
  57. package/{machineWsRunDispatch-7T3SEMB6.js → machineWsRunDispatch-HUQ6HPSC.js} +17 -17
  58. package/package.json +1 -1
  59. package/{readlineWorkspace-MTYLMWBM.js → readlineWorkspace-N74QNU7H.js} +18 -18
  60. package/{runAgentClientLoop-Z6STKR3Z.js → runAgentClientLoop-NYZWX6JF.js} +12 -12
  61. package/{spaceCommands-M44RQPCK.js → spaceCommands-5ZN5J2X3.js} +7 -7
  62. package/{streamAgentChatTurn-2ON7E6LT.js → streamAgentChatTurn-LP3RQ3K5.js} +16 -16
  63. package/{tools-ZB2YBHSS.js → tools-KYFVARQ5.js} +7 -7
  64. package/{tuiSummaryLlmCaller-I2MRY6T5.js → tuiSummaryLlmCaller-OM3V6TZG.js} +4 -4
  65. package/{updateDialogTitleAction-YMQAOVJ2.js → updateDialogTitleAction-4ESKJ7L6.js} +3 -3
@@ -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-TV6QW46C.js";
9
9
  import {
10
10
  HIGH_RISK_MUTATION_TOOL_NAMES
11
11
  } from "./chunk-2GRXE3YJ.js";
@@ -2,7 +2,7 @@ import {
2
2
  DEVIN_CONNECT_URL,
3
3
  parseSseDataLineJson,
4
4
  parseSseDataLineObject
5
- } from "./chunk-DWFRZ3UI.js";
5
+ } from "./chunk-QMFYP3O4.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-DRR5E2EM.js";
15
15
  import {
16
16
  readSseFrames
17
17
  } from "./chunk-HNUWUO75.js";
@@ -28,15 +28,16 @@ import {
28
28
  import {
29
29
  hasImageInRuntimeMessages,
30
30
  stripImagePartsFromMessages
31
- } from "./chunk-HHEM4TV3.js";
31
+ } from "./chunk-CS4FUKMG.js";
32
32
  import {
33
33
  clipToolText,
34
34
  resolveHistoricalToolContentCap,
35
35
  resolveToolOutputProfile
36
36
  } from "./chunk-2WZXXAQD.js";
37
37
  import {
38
- resolveAgentImageInputSupport
39
- } from "./chunk-7QQOOHDG.js";
38
+ resolveAgentImageInputSupport,
39
+ resolveToolImagePolicy
40
+ } from "./chunk-XRU4QTSX.js";
40
41
  import {
41
42
  applyShapingCounts,
42
43
  attachProjectionFacts,
@@ -95,7 +96,7 @@ import {
95
96
  toOpenAiCompatibleMessages,
96
97
  toResponsesTools,
97
98
  transferDowngradedToolTurnOrigin
98
- } from "./chunk-ISIFZP3N.js";
99
+ } from "./chunk-U3YGSKXD.js";
99
100
  import {
100
101
  TOOL_HAD_IMAGES,
101
102
  TOOL_IMAGES,
@@ -108,7 +109,7 @@ import {
108
109
  toolImageDelivery,
109
110
  toolImages,
110
111
  withoutToolImages
111
- } from "./chunk-A6B3LSDB.js";
112
+ } from "./chunk-IJOJMOCX.js";
112
113
  import {
113
114
  BRIDGE_STREAM_MAX_CHARS,
114
115
  CLI_NOLO_WORKSPACE_TOOL_NAMES,
@@ -20913,13 +20914,15 @@ ${reasoningTailLog}
20913
20914
  }
20914
20915
 
20915
20916
  // packages/integrations/openai/responsesRequestBody.ts
20916
- function buildResponsesRequestBody(body, model) {
20917
+ function buildResponsesRequestBody(body, model, options) {
20917
20918
  const tools = Array.isArray(body.tools) ? toResponsesTools(body.tools) : void 0;
20918
20919
  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
20920
  return {
20920
20921
  ...body,
20921
20922
  model,
20922
- input: Array.isArray(body.input) && body.input.length > 0 ? body.input : convertMessagesToResponsesInput(body.messages ?? []),
20923
+ input: Array.isArray(body.input) && body.input.length > 0 ? body.input : convertMessagesToResponsesInput(body.messages ?? [], {
20924
+ supportsToolImages: options?.supportsToolImages
20925
+ }),
20923
20926
  ...Array.isArray(body.tools) ? { tools: tools ?? void 0 } : {},
20924
20927
  ...typeof body.max_tokens === "number" ? { max_output_tokens: body.max_tokens } : {},
20925
20928
  ...reasoningEffort ? { reasoning: { effort: reasoningEffort } } : {},
@@ -21250,8 +21253,16 @@ function buildOpenAiCompatibleChatCompletionRequest(args2) {
21250
21253
  args2.providerConfig.model
21251
21254
  );
21252
21255
  const sanitizedMessages = sanitizeForOutbound(args2.messages, args2.tools);
21256
+ const toolImagePolicy = resolveToolImagePolicy({
21257
+ routeKind: isResponses ? "responses" : "openai-compatible",
21258
+ legacySupportsToolImages: isResponses ? false : void 0,
21259
+ provider: args2.providerConfig.usageProvider ?? args2.providerConfig.provider,
21260
+ model: args2.providerConfig.model,
21261
+ customProviderUrl: args2.providerConfig.endpoint,
21262
+ hasVision: args2.providerConfig.hasVision
21263
+ });
21253
21264
  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 }),
21265
+ supportsToolImages: !isResponses && toolImagePolicy.supportsToolImages,
21255
21266
  stripReasoningContent: shouldStripReasoning,
21256
21267
  ...args2.shapingCounts ? { shapingCounts: args2.shapingCounts } : {},
21257
21268
  ...resolveReasoningReplayOptions(
@@ -21288,7 +21299,9 @@ function buildOpenAiCompatibleChatCompletionRequest(args2) {
21288
21299
  )
21289
21300
  } : {}
21290
21301
  };
21291
- const body = isResponses ? buildResponsesRequestBody(rawBody, args2.providerConfig.model) : normalizeChatCompletionsBodyForProvider({
21302
+ const body = isResponses ? buildResponsesRequestBody(rawBody, args2.providerConfig.model, {
21303
+ supportsToolImages: toolImagePolicy.supportsToolImages
21304
+ }) : normalizeChatCompletionsBodyForProvider({
21292
21305
  body: rawBody,
21293
21306
  provider: args2.providerConfig.provider,
21294
21307
  model: args2.providerConfig.model,
@@ -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-IJOJMOCX.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
@@ -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-F4Y7V4IH.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-FAYZZVYI.js");
376
376
  return createPageAction(args, thunkApi);
377
377
  }
378
378
  function subscribe(listener) {
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-VYNMQ6HW.js";
9
9
  import {
10
10
  fetchAndCacheTableRows
11
- } from "./chunk-Z4HDFBYK.js";
11
+ } from "./chunk-GJU7F5IR.js";
12
12
  import {
13
13
  require_react
14
14
  } from "./chunk-YDH3FDFQ.js";
@@ -521,7 +521,7 @@ var executeToolRun = createAsyncThunk(
521
521
  if (!executionInput) {
522
522
  throw new Error(`ToolRun ${id} has no input to execute with.`);
523
523
  }
524
- const { findToolExecutor } = await import("./tools-ZB2YBHSS.js");
524
+ const { findToolExecutor } = await import("./tools-KYFVARQ5.js");
525
525
  const { executor } = findToolExecutor(run.toolName);
526
526
  toolRunStarted({
527
527
  id: run.id,
@@ -20,7 +20,7 @@ import {
20
20
  toolRunUpdated,
21
21
  uiCardFallback,
22
22
  waitForAbortableDelay
23
- } from "./chunk-KXIJYPVC.js";
23
+ } from "./chunk-SYIWIP4D.js";
24
24
  import {
25
25
  isGatewayHttpStatus
26
26
  } from "./chunk-NF64D32W.js";
@@ -64,7 +64,7 @@ import {
64
64
  } from "./chunk-VF4K2QE6.js";
65
65
  import {
66
66
  createDocState
67
- } from "./chunk-L7ZCLG72.js";
67
+ } from "./chunk-S4SXPMPC.js";
68
68
  import {
69
69
  addMemberSpace,
70
70
  fetchAuthoritativeRemoteSpace,
@@ -79,7 +79,7 @@ import {
79
79
  } from "./chunk-BAWAKW7X.js";
80
80
  import {
81
81
  createDialogAction
82
- } from "./chunk-RYBZM4A2.js";
82
+ } from "./chunk-73FHDE7C.js";
83
83
  import {
84
84
  setDialogExtraReferencesAction
85
85
  } from "./chunk-IF7V3CBU.js";
@@ -102,7 +102,7 @@ import {
102
102
  updateContentCategory,
103
103
  updateContentTitle,
104
104
  writeStoredCollapsedCategories
105
- } from "./chunk-Z4HDFBYK.js";
105
+ } from "./chunk-GJU7F5IR.js";
106
106
  import {
107
107
  buildDatabaseFileContentUrl,
108
108
  deleteDialog,
@@ -115,7 +115,7 @@ import {
115
115
  selectMsgById,
116
116
  uiAskChoiceFunc,
117
117
  uiAskChoiceFunctionSchema
118
- } from "./chunk-LTWBOZE6.js";
118
+ } from "./chunk-LQRXBYTS.js";
119
119
  import {
120
120
  buildMediaToolConfirmation,
121
121
  normalizeMediaConfirmExecutionRevision
@@ -126,7 +126,7 @@ import {
126
126
  runLlm,
127
127
  streamAgentChatTurn,
128
128
  updateAgent
129
- } from "./chunk-RABMW33C.js";
129
+ } from "./chunk-GHNRJ3TK.js";
130
130
  import {
131
131
  getCurrentSpaceId,
132
132
  getCurrentSpaceIdRaw,
@@ -3882,7 +3882,7 @@ async function deleteDialogsFunc(args, thunkApi) {
3882
3882
  const deletedDialogIds = [];
3883
3883
  const deletedDialogKeys = [];
3884
3884
  const failures = [];
3885
- const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-ST2FXOF3.js");
3885
+ const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-QRWP73XJ.js");
3886
3886
  for (const target of targets) {
3887
3887
  try {
3888
3888
  await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
@@ -18563,7 +18563,7 @@ async function updateDocFunc(args, thunkApi) {
18563
18563
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
18564
18564
  };
18565
18565
  await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
18566
- const { getDocState, applyExternalDocUpdate } = await import("./docStore-PPUT7MQV.js");
18566
+ const { getDocState, applyExternalDocUpdate } = await import("./docStore-TABPPAGD.js");
18567
18567
  if (getDocState().pageKey === id) {
18568
18568
  applyExternalDocUpdate({
18569
18569
  slateData: finalSlateData,
@@ -1,6 +1,13 @@
1
1
  import {
2
- projectOpenAiToolImages
3
- } from "./chunk-A6B3LSDB.js";
2
+ EMPTY_TOOL_RESULT_TEXT,
3
+ TOOL_HAD_IMAGES,
4
+ TOOL_IMAGES,
5
+ createToolImageBudget,
6
+ formatToolImageBudgetNote,
7
+ hadToolImages,
8
+ projectOpenAiToolImages,
9
+ toolImages
10
+ } from "./chunk-IJOJMOCX.js";
4
11
  import {
5
12
  getModelContextWindow
6
13
  } from "./chunk-7ZGMQZ5D.js";
@@ -92,14 +99,57 @@ var toResponsesTools = (tools) => {
92
99
  };
93
100
  var convertMessagesToResponsesInput = (messages, options) => {
94
101
  const input = [];
102
+ const imageBudget = createToolImageBudget();
103
+ let acceptedImages = 0;
95
104
  for (const message of messages) {
96
105
  if (!message?.role) continue;
97
106
  if (message.role === "tool") {
98
107
  if (!message.tool_call_id) continue;
108
+ if (!options?.supportsToolImages || !hadToolImages(message)) {
109
+ input.push({
110
+ type: "function_call_output",
111
+ call_id: message.tool_call_id,
112
+ output: normalizeToolOutput(message.content)
113
+ });
114
+ continue;
115
+ }
116
+ const images = toolImages(message);
117
+ const text = typeof message.content === "string" ? message.content : normalizeToolOutput(message.content);
118
+ const effectiveText = text.trim() ? text : EMPTY_TOOL_RESULT_TEXT;
119
+ const outputParts = [
120
+ { type: "input_text", text: effectiveText }
121
+ ];
122
+ let toolOmitted = 0;
123
+ for (const image of images) {
124
+ const decision = imageBudget(image);
125
+ if (decision === "duplicate") continue;
126
+ if (decision !== "delivered") {
127
+ toolOmitted += 1;
128
+ continue;
129
+ }
130
+ acceptedImages += 1;
131
+ outputParts.push({
132
+ type: "input_text",
133
+ text: `Image ${acceptedImages}`
134
+ });
135
+ outputParts.push({
136
+ type: "input_image",
137
+ image_url: `data:${image.mimeType};base64,${image.dataBase64}`
138
+ });
139
+ }
140
+ if (toolOmitted > 0) {
141
+ outputParts.push({
142
+ type: "input_text",
143
+ text: formatToolImageBudgetNote(toolOmitted)
144
+ });
145
+ }
146
+ const hadPersistedImages = message?.tool_result_metadata?.[TOOL_HAD_IMAGES] === true;
147
+ const hasInjectedParts = outputParts.some((p) => p.type === "input_image") || toolOmitted > 0;
148
+ const shouldUseArray = hadPersistedImages || hasInjectedParts;
99
149
  input.push({
100
150
  type: "function_call_output",
101
151
  call_id: message.tool_call_id,
102
- output: normalizeToolOutput(message.content)
152
+ output: shouldUseArray ? outputParts : normalizeToolOutput(message.content)
103
153
  });
104
154
  continue;
105
155
  }
@@ -1000,6 +1050,17 @@ function preserveAgentStateFields(source, target, options) {
1000
1050
  }
1001
1051
  }
1002
1052
  if (source.role === "tool") {
1053
+ if (TOOL_IMAGES in source) {
1054
+ mutableTarget[TOOL_IMAGES] = source[TOOL_IMAGES];
1055
+ }
1056
+ if (source.tool_result_metadata) {
1057
+ Object.defineProperty(mutableTarget, "tool_result_metadata", {
1058
+ value: source.tool_result_metadata,
1059
+ enumerable: false,
1060
+ configurable: true,
1061
+ writable: true
1062
+ });
1063
+ }
1003
1064
  const toolCallId = typeof source.tool_call_id === "string" ? source.tool_call_id.trim() : typeof source.toolCallId === "string" ? source.toolCallId.trim() : "";
1004
1065
  if (toolCallId) mutableTarget.tool_call_id = toolCallId;
1005
1066
  }
@@ -2,7 +2,7 @@ import {
2
2
  clipMultilineText,
3
3
  fetchAndSerializeTable,
4
4
  waitForAbortableDelay
5
- } from "./chunk-KXIJYPVC.js";
5
+ } from "./chunk-SYIWIP4D.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-LTWBOZE6.js";
24
+ } from "./chunk-LQRXBYTS.js";
25
25
  import {
26
26
  createSpaceKey
27
27
  } from "./chunk-UAD2WT54.js";
@@ -5,7 +5,7 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-TMAQFKHS.js";
8
+ } from "./chunk-CCWUO2ZE.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-GA4NE7QH.js";
18
18
  import {
19
19
  findToolExecutor,
20
20
  toolDefinitionsByName
21
- } from "./chunk-24VDDKCB.js";
21
+ } from "./chunk-TV6QW46C.js";
22
22
  import {
23
23
  classifyApiError,
24
24
  classifyGenerationError,
25
25
  extractErrorDiagnostics
26
- } from "./chunk-J63HVOSX.js";
26
+ } from "./chunk-UPJVQK5J.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-SYIWIP4D.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-LQRXBYTS.js";
46
46
  import {
47
47
  streamAgentChatTurn
48
- } from "./chunk-RABMW33C.js";
48
+ } from "./chunk-GHNRJ3TK.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-U3YGSKXD.js";
89
89
  import {
90
90
  EMPTY_ASSISTANT_REPAIR_PROMPT
91
91
  } from "./chunk-T7HBI3WZ.js";
@@ -67,8 +67,7 @@ var lookupKnownModelVision = (provider, model) => {
67
67
  }
68
68
  return void 0;
69
69
  };
70
- var resolveAgentImageInputSupport = (agent) => {
71
- if (!agent) return true;
70
+ var resolveCatalogImageSupport = (agent) => {
72
71
  const provider = asTrimmedLowercaseString(agent.provider) || asTrimmedLowercaseString(agent.apiSource) || null;
73
72
  const model = asOptionalTrimmedString(agent.model) ?? "";
74
73
  const { authMethod } = resolveAgentCallPlan({
@@ -85,15 +84,32 @@ var resolveAgentImageInputSupport = (agent) => {
85
84
  const catalogHasVision = authMethod.kind === "oauth" ? SUBSCRIPTION_OAUTH_PROVIDERS.find((entry) => entry.apiKeyRef === authMethod.ref)?.modelOptions.find(
86
85
  (entry) => [model, stripEffortSuffix(model), stripPreviewSuffix(model)].includes(entry.id)
87
86
  )?.hasVision : lookupKnownModelVision(provider, model);
88
- if (catalogHasVision !== void 0) {
89
- return catalogHasVision;
87
+ return catalogHasVision;
88
+ };
89
+ var resolveAgentImageInputSupport = (agent) => {
90
+ if (!agent) return true;
91
+ return resolveCatalogImageSupport(agent) ?? agent.hasVision ?? true;
92
+ };
93
+ var resolveToolImagePolicy = (input) => {
94
+ const env = typeof process !== "undefined" ? process.env : void 0;
95
+ if (env?.NOLO_TOOL_IMAGE_POLICY === "legacy") {
96
+ return {
97
+ supportsToolImages: input.legacySupportsToolImages ?? resolveAgentImageInputSupport({ ...input, hasVision: input.hasVision ?? false }),
98
+ reason: "legacy"
99
+ };
100
+ }
101
+ if (input.routeKind === "antigravity" && env?.NOLO_TOOL_IMAGES_ALLOW_ANTIGRAVITY !== "1") {
102
+ return { supportsToolImages: false, reason: "route-unsupported" };
90
103
  }
91
- if (typeof agent.hasVision === "boolean") {
92
- return agent.hasVision;
104
+ const catalog = resolveCatalogImageSupport(input);
105
+ if (catalog !== void 0) return { supportsToolImages: catalog, reason: "catalog" };
106
+ if (typeof input.hasVision === "boolean") {
107
+ return { supportsToolImages: input.hasVision, reason: "agent-declaration" };
93
108
  }
94
- return true;
109
+ return { supportsToolImages: false, reason: "unknown" };
95
110
  };
96
111
 
97
112
  export {
98
- resolveAgentImageInputSupport
113
+ resolveAgentImageInputSupport,
114
+ resolveToolImagePolicy
99
115
  };