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

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 (76) hide show
  1. package/{_executeModel-IABRBGAE.js → _executeModel-P7OE5QLM.js} +16 -16
  2. package/{accountResolver-JS7QDNNL.js → accountResolver-YGMLY3WW.js} +2 -1
  3. package/{agentDeleteCommand-ATU2HZT2.js → agentDeleteCommand-3CCYENZM.js} +21 -20
  4. package/{agentEmailCommands-YTKUTNLR.js → agentEmailCommands-VH6GRZ4S.js} +22 -21
  5. package/{agentListCommands-ZBA5JTWP.js → agentListCommands-FCSA7YV3.js} +12 -11
  6. package/{agentMachineCommands-ZSKWBVPO.js → agentMachineCommands-VEBNXOLD.js} +10 -9
  7. package/{agentRecordCommands-KVN6OF4P.js → agentRecordCommands-MGCNHOJ3.js} +21 -20
  8. package/{agentRunCommand-CC6JZOGT.js → agentRunCommand-UMVA6KSF.js} +22 -21
  9. package/{agentRuntimeLocal-JA2Q6UBJ.js → agentRuntimeLocal-2JOFHEXA.js} +7 -6
  10. package/{agentSlice-RVJDFNRB.js → agentSlice-AXI53QZB.js} +1 -1
  11. package/{appDeleteCommands-4XONJLO7.js → appDeleteCommands-BNQKVEIA.js} +11 -10
  12. package/{appDeployCommands-SDGJMAUG.js → appDeployCommands-V5WQ2ZBR.js} +11 -10
  13. package/{appDeployStatusCommands-A6O3FEEW.js → appDeployStatusCommands-QA5GFIUU.js} +11 -10
  14. package/{appGetCommands-U4Z5HSNF.js → appGetCommands-U3SDB4TE.js} +11 -10
  15. package/{appListCommands-T4HVTIUC.js → appListCommands-DMHPABYC.js} +11 -10
  16. package/{chromeCommands-IY4NVSXZ.js → chromeCommands-Z5LDHMYN.js} +2 -1
  17. package/{chromeOpsCommands-6JHNTKXU.js → chromeOpsCommands-CHBIUDJD.js} +2 -1
  18. package/{chunk-TYQZRSL6.js → chunk-2FOT26E6.js} +1 -1
  19. package/{chunk-6J227QXV.js → chunk-2GRXE3YJ.js} +21 -0
  20. package/{chunk-X7KVZ2OK.js → chunk-3RF4DIQW.js} +5 -5
  21. package/{chunk-O4H4HD4X.js → chunk-3SF6NB4R.js} +2 -2
  22. package/{chunk-74PQM3XI.js → chunk-4TTEZGP3.js} +46 -27
  23. package/{chunk-6BDTSKUT.js → chunk-55HS2GQD.js} +4 -4
  24. package/{chunk-SDAIVJZG.js → chunk-6KS4TTCI.js} +10 -10
  25. package/{chunk-2EC6FNS4.js → chunk-7YN3HYWC.js} +17 -81
  26. package/{chunk-MYZHJKLG.js → chunk-BIF4B4ON.js} +1 -1
  27. package/{chunk-CZLO63PE.js → chunk-CDDFEVZ5.js} +8 -8
  28. package/{chunk-BE42X662.js → chunk-CK4GWPSD.js} +1 -1
  29. package/{chunk-UG3UI4Z7.js → chunk-CRQGEMKZ.js} +10 -10
  30. package/{chunk-BU2YQBV4.js → chunk-DPQYIS6D.js} +41 -1
  31. package/{chunk-AKXKBNLQ.js → chunk-EEFX46WP.js} +2 -2
  32. package/{chunk-5WOL7BUP.js → chunk-EW6GOYKQ.js} +1 -1
  33. package/{chunk-R2RDXNEE.js → chunk-KSCX7GME.js} +1 -1
  34. package/{chunk-FZSVCJUU.js → chunk-QPUKYKMH.js} +1 -1
  35. package/{chunk-PJVGNB4L.js → chunk-RPZNVBA5.js} +1 -1
  36. package/{chunk-TCWK2EQX.js → chunk-RU4KURIK.js} +2 -2
  37. package/{chunk-F3F3ARBN.js → chunk-S4SA4INB.js} +2 -2
  38. package/{chunk-UA4VAUQL.js → chunk-SIZPFDPU.js} +2 -2
  39. package/chunk-SRZ6BQIP.js +68 -0
  40. package/{chunk-ORKQ3T5D.js → chunk-TOLFIE2I.js} +3 -3
  41. package/{chunk-SUBKVXFM.js → chunk-TY7GIRX6.js} +1 -1
  42. package/{chunk-ISMHFI2Y.js → chunk-TZ6CCFRL.js} +3 -3
  43. package/{chunk-WKF6C3X5.js → chunk-U4C2R3PV.js} +2 -2
  44. package/{chunk-ZB4JKLJM.js → chunk-U5UZ7IPM.js} +3 -3
  45. package/{chunk-OPNHKULV.js → chunk-UVP7VL6F.js} +1 -1
  46. package/{chunk-CAAH5LNN.js → chunk-VVMACDVS.js} +2 -2
  47. package/{chunk-ULE7ABRN.js → chunk-XKL2RXV6.js} +8 -8
  48. package/{chunk-EWLPIR2S.js → chunk-XWEAIAO2.js} +1 -1
  49. package/{chunk-BW3LCST7.js → chunk-ZCXK773F.js} +2 -2
  50. package/{chunk-RATR6VCP.js → chunk-ZEOR6XPJ.js} +1 -1
  51. package/{chunk-WW5MNBTZ.js → chunk-ZQ545VNM.js} +4 -4
  52. package/{commandRegistry-ICL67WF7.js → commandRegistry-FDWLTWIQ.js} +44 -44
  53. package/{contentThunks-SM5FP7FM.js → contentThunks-AAGKCQCZ.js} +3 -3
  54. package/{createAgentAutomationAction-ECWLREQU.js → createAgentAutomationAction-2K7M6ACJ.js} +3 -3
  55. package/{createDialogAction-LROHLFQ2.js → createDialogAction-RFQJMLEO.js} +4 -4
  56. package/{createPageAction-KUQVLZMZ.js → createPageAction-MBDADKFQ.js} +3 -3
  57. package/{dialogCommands-T5JYBPS6.js → dialogCommands-E5I4ORXJ.js} +11 -10
  58. package/{dialogSlice-2FWQCZDB.js → dialogSlice-MHZCAC4E.js} +2 -2
  59. package/{docCreateCommands-7F4ICTJQ.js → docCreateCommands-SMX7DXUS.js} +10 -9
  60. package/{docDeleteCommands-4INN7EWS.js → docDeleteCommands-MFPBAHFH.js} +11 -10
  61. package/{docReadCommands-7PZZR3C3.js → docReadCommands-ZOWLKFAF.js} +10 -9
  62. package/{docStore-WUR5MNKF.js → docStore-IUFAMRVZ.js} +1 -1
  63. package/{docUpdateCommands-H2YXAGOV.js → docUpdateCommands-4THL5VLI.js} +10 -9
  64. package/{handleSendMessageAction-DVXNAQ2V.js → handleSendMessageAction-OS6NNC3U.js} +7 -7
  65. package/index.js +4 -4
  66. package/{localRuntimeAdapter-M64P55I7.js → localRuntimeAdapter-XQ4PAAIT.js} +19 -18
  67. package/{machineCommands-2H7QW35Q.js → machineCommands-UHGFVPD2.js} +20 -19
  68. package/{machineWsRunDispatch-4L2DSIMF.js → machineWsRunDispatch-BAFZOC6Z.js} +20 -19
  69. package/package.json +1 -1
  70. package/{readlineWorkspace-KNE2THUN.js → readlineWorkspace-ISBZZPR2.js} +25 -24
  71. package/{runAgentClientLoop-34ME2HDT.js → runAgentClientLoop-H4KCCJOV.js} +14 -14
  72. package/{spaceCommands-HAVZ3PQN.js → spaceCommands-PVEPGFHX.js} +10 -9
  73. package/{streamAgentChatTurn-YXFJ3UWD.js → streamAgentChatTurn-4PX74Z36.js} +17 -17
  74. package/{tools-M7H7Z44Z.js → tools-546KDFWP.js} +9 -9
  75. package/{tuiSummaryLlmCaller-KVAXEH7O.js → tuiSummaryLlmCaller-LA7NUKUJ.js} +2 -2
  76. package/{updateDialogTitleAction-YXQ2AJVK.js → updateDialogTitleAction-LIS3EPHP.js} +3 -3
@@ -11,7 +11,7 @@ import {
11
11
  flushChatCompletionStream,
12
12
  providerHttpFailure,
13
13
  throwIfChatCompletionStreamFailed
14
- } from "./chunk-R2RDXNEE.js";
14
+ } from "./chunk-KSCX7GME.js";
15
15
  import {
16
16
  readSseFrames
17
17
  } from "./chunk-HNUWUO75.js";
@@ -22,10 +22,13 @@ import {
22
22
  import {
23
23
  EXECUTION_BACKEND_KINDS
24
24
  } from "./chunk-PWTNI4N7.js";
25
+ import {
26
+ readLocalImage
27
+ } from "./chunk-SRZ6BQIP.js";
25
28
  import {
26
29
  hasImageInRuntimeMessages,
27
30
  stripImagePartsFromMessages
28
- } from "./chunk-5WOL7BUP.js";
31
+ } from "./chunk-EW6GOYKQ.js";
29
32
  import {
30
33
  clipToolText,
31
34
  resolveHistoricalToolContentCap,
@@ -68,7 +71,7 @@ import {
68
71
  hashStablePrefixContent,
69
72
  resolveResponseGuidelines,
70
73
  resolveToolGuidedSections
71
- } from "./chunk-RATR6VCP.js";
74
+ } from "./chunk-ZEOR6XPJ.js";
72
75
  import {
73
76
  TOOL_HAD_IMAGES,
74
77
  TOOL_IMAGES,
@@ -99,7 +102,7 @@ import {
99
102
  toolImages,
100
103
  transferDowngradedToolTurnOrigin,
101
104
  withoutToolImages
102
- } from "./chunk-FZSVCJUU.js";
105
+ } from "./chunk-QPUKYKMH.js";
103
106
  import {
104
107
  BRIDGE_STREAM_MAX_CHARS,
105
108
  CLI_NOLO_WORKSPACE_TOOL_NAMES,
@@ -119,7 +122,7 @@ import {
119
122
  parseNoloWorkspaceToolArguments,
120
123
  readTextStreamUpToChars,
121
124
  resolveNoloDialogInput
122
- } from "./chunk-6J227QXV.js";
125
+ } from "./chunk-2GRXE3YJ.js";
123
126
  import {
124
127
  buildDialogFallbackTitleFromUserInput
125
128
  } from "./chunk-2MBTWINN.js";
@@ -15716,74 +15719,7 @@ async function invokeCapability(capabilityOrName, input, ctx = {}) {
15716
15719
  // packages/agent-runtime/localWorkspaceTools.ts
15717
15720
  import { existsSync as existsSync4 } from "node:fs";
15718
15721
  import { createHash as createHash4 } from "node:crypto";
15719
-
15720
- // packages/agent-runtime/readImage.ts
15721
- import { readFile } from "node:fs/promises";
15722
- import { extname } from "node:path";
15723
- var MAX_IMAGE_BASE64_BYTES = 2 * 1024 * 1024;
15724
- var MAX_IMAGE_EDGE = 1568;
15725
- var MIME_BY_EXTENSION = {
15726
- ".png": "image/png",
15727
- ".jpg": "image/jpeg",
15728
- ".jpeg": "image/jpeg",
15729
- ".webp": "image/webp",
15730
- ".gif": "image/gif"
15731
- };
15732
- function detectMime(bytes) {
15733
- if (bytes.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]))) return "image/png";
15734
- if (bytes[0] === 255 && bytes[1] === 216 && bytes[2] === 255) return "image/jpeg";
15735
- if (["GIF87a", "GIF89a"].includes(bytes.toString("ascii", 0, 6))) return "image/gif";
15736
- if (bytes.toString("ascii", 0, 4) === "RIFF" && bytes.toString("ascii", 8, 12) === "WEBP") return "image/webp";
15737
- }
15738
- async function readLocalImage(path, options) {
15739
- const limit = options?.maxBase64Bytes ?? MAX_IMAGE_BASE64_BYTES;
15740
- const expected = MIME_BY_EXTENSION[extname(path).toLowerCase()];
15741
- if (!expected) throw new Error("read_image: unsupported image extension (PNG/JPEG/WebP/GIF only)");
15742
- const bytes = await readFile(path);
15743
- if (detectMime(bytes) !== expected) throw new Error("read_image: image extension and magic bytes do not match");
15744
- const { default: sharp } = await import("./dist-Q2JSMAKA.js");
15745
- const image = sharp(bytes, { limitInputPixels: 4e7, animated: false });
15746
- const meta = await image.metadata();
15747
- if (!meta.width || !meta.height) throw new Error("read_image: invalid image dimensions");
15748
- const encoded = (length) => 4 * Math.ceil(length / 3);
15749
- let output = bytes;
15750
- let mimeType = expected;
15751
- let width = meta.width;
15752
- let height = meta.height;
15753
- if (Math.max(width, height) > MAX_IMAGE_EDGE || encoded(output.length) > limit) {
15754
- const resized = await image.rotate().resize({ width: MAX_IMAGE_EDGE, height: MAX_IMAGE_EDGE, fit: "inside", withoutEnlargement: true }).jpeg({ quality: 80 }).toBuffer({ resolveWithObject: true });
15755
- output = resized.data;
15756
- width = resized.info.width;
15757
- height = resized.info.height;
15758
- mimeType = "image/jpeg";
15759
- }
15760
- while (encoded(output.length) > limit) {
15761
- const current = encoded(output.length);
15762
- if (width === 1 && height === 1) {
15763
- throw new Error(
15764
- `read_image: compressed image ${width}x${height}, ${output.length} bytes (${current} base64 bytes) still exceeds ${limit} base64 bytes`
15765
- );
15766
- }
15767
- const scale = Math.min(0.9, Math.sqrt(limit / current) * 0.95);
15768
- const resized = await image.clone().rotate().resize({
15769
- width: Math.max(1, Math.floor(width * scale)),
15770
- height: Math.max(1, Math.floor(height * scale)),
15771
- fit: "inside",
15772
- withoutEnlargement: true
15773
- }).jpeg({ quality: 80 }).toBuffer({ resolveWithObject: true });
15774
- output = resized.data;
15775
- width = resized.info.width;
15776
- height = resized.info.height;
15777
- mimeType = "image/jpeg";
15778
- }
15779
- return {
15780
- content: `[image ${width}x${height} ${output.length} bytes \u2192 ${path}]`,
15781
- images: [{ mimeType, dataBase64: output.toString("base64") }]
15782
- };
15783
- }
15784
-
15785
- // packages/agent-runtime/localWorkspaceTools.ts
15786
- import { lstat, mkdir, readdir as readdir2, readFile as readFile4, realpath, stat as stat3, writeFile } from "node:fs/promises";
15722
+ import { lstat, mkdir, readdir as readdir2, readFile as readFile3, realpath, stat as stat3, writeFile } from "node:fs/promises";
15787
15723
  import { homedir } from "node:os";
15788
15724
  import { dirname as dirname2, isAbsolute as isAbsolute2, relative as relative3, resolve as resolve4, sep } from "node:path";
15789
15725
  import { spawn as spawnChildProcess3 } from "node:child_process";
@@ -15821,15 +15757,15 @@ function isLineRangeCovered(request3, covered) {
15821
15757
  }
15822
15758
 
15823
15759
  // packages/agent-runtime/fileTextSearch.ts
15824
- import { readdir, readFile as readFile3, stat as stat2 } from "node:fs/promises";
15760
+ import { readdir, readFile as readFile2, stat as stat2 } from "node:fs/promises";
15825
15761
  import { basename, relative as relative2, resolve as resolve3 } from "node:path";
15826
15762
  import { spawn as spawnChildProcess2 } from "node:child_process";
15827
15763
 
15828
15764
  // packages/agent-runtime/gitignore.ts
15829
- import { readFile as readFile2, stat } from "node:fs/promises";
15765
+ import { readFile, stat } from "node:fs/promises";
15830
15766
  import { resolve as resolve2 } from "node:path";
15831
15767
  async function readRootGitignorePatterns(workspaceRoot) {
15832
- const content = await readFile2(resolve2(workspaceRoot, ".gitignore"), "utf8").catch(() => null);
15768
+ const content = await readFile(resolve2(workspaceRoot, ".gitignore"), "utf8").catch(() => null);
15833
15769
  if (content === null) return [];
15834
15770
  return content.split(/\r?\n/).map((line) => line.trim()).filter((line) => line && !line.startsWith("#") && !line.startsWith("!")).flatMap((line) => {
15835
15771
  const unanchored = line.replace(/^\//, "");
@@ -15909,7 +15845,7 @@ async function decorate(root, raw, context3, absolute = false) {
15909
15845
  let lines = cache.get(x.file);
15910
15846
  if (!lines) {
15911
15847
  try {
15912
- lines = (await readFile3(x.file, "utf8")).split(/\r\n|\r|\n/);
15848
+ lines = (await readFile2(x.file, "utf8")).split(/\r\n|\r|\n/);
15913
15849
  } catch {
15914
15850
  continue;
15915
15851
  }
@@ -15938,7 +15874,7 @@ function globMatch(pattern, value) {
15938
15874
  const r = new RegExp(`^${source}$`);
15939
15875
  return r.test(value) || r.test(basename(value));
15940
15876
  }
15941
- var defaultReadTextFile = (filePath) => readFile3(filePath, "utf8").catch(() => "");
15877
+ var defaultReadTextFile = (filePath) => readFile2(filePath, "utf8").catch(() => "");
15942
15878
  async function jsSearch(o, targetPath) {
15943
15879
  const max4 = o.maxResults ?? Number.MAX_SAFE_INTEGER;
15944
15880
  const excludes = o.exclude ?? [];
@@ -17010,7 +16946,7 @@ function readVisualStateCaptureArgs(args2) {
17010
16946
  }
17011
16947
  async function readWorkspacePackageScripts(workspaceRoot) {
17012
16948
  try {
17013
- const raw = await readFile4(resolve4(workspaceRoot, "package.json"), "utf8");
16949
+ const raw = await readFile3(resolve4(workspaceRoot, "package.json"), "utf8");
17014
16950
  const parsed = JSON.parse(raw);
17015
16951
  const scripts = parsed && typeof parsed === "object" && parsed.scripts && typeof parsed.scripts === "object" ? Object.keys(parsed.scripts).sort() : [];
17016
16952
  return { scripts };
@@ -17195,7 +17131,7 @@ async function readFileTool(args2) {
17195
17131
  allowRuntimeOwnedSpill: true,
17196
17132
  ...args2.confirmExternalFileAccess ? { confirmExternalFileAccess: args2.confirmExternalFileAccess } : {}
17197
17133
  });
17198
- const content = await readFile4(absolutePath, "utf8");
17134
+ const content = await readFile3(absolutePath, "utf8");
17199
17135
  const activity = extractActivity(parsed);
17200
17136
  const sliced = sliceReadFileContent({
17201
17137
  content,
@@ -17388,7 +17324,7 @@ async function editFileTool(args2) {
17388
17324
  requestedPath,
17389
17325
  ...args2.confirmExternalFileAccess ? { confirmExternalFileAccess: args2.confirmExternalFileAccess } : {}
17390
17326
  });
17391
- const content = await readFile4(absolutePath, "utf8");
17327
+ const content = await readFile3(absolutePath, "utf8");
17392
17328
  const { count: replacementCount, result: nextContent } = countAndReplaceEolTolerant({
17393
17329
  content,
17394
17330
  oldText,
@@ -2,7 +2,7 @@ import {
2
2
  deleteDialog,
3
3
  runtime_default,
4
4
  toast
5
- } from "./chunk-ULE7ABRN.js";
5
+ } from "./chunk-XKL2RXV6.js";
6
6
  import {
7
7
  getCurrentSpaceId,
8
8
  getCurrentSpaceIdRaw,
@@ -5,7 +5,7 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-BW3LCST7.js";
8
+ } from "./chunk-ZCXK773F.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-WW5MNBTZ.js";
17
+ } from "./chunk-ZQ545VNM.js";
18
18
  import {
19
19
  findToolExecutor,
20
20
  toolDefinitionsByName
21
- } from "./chunk-SDAIVJZG.js";
21
+ } from "./chunk-6KS4TTCI.js";
22
22
  import {
23
23
  classifyApiError,
24
24
  classifyGenerationError,
25
25
  extractErrorDiagnostics
26
- } from "./chunk-TCWK2EQX.js";
26
+ } from "./chunk-RU4KURIK.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-UA4VAUQL.js";
35
+ } from "./chunk-SIZPFDPU.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-ULE7ABRN.js";
45
+ } from "./chunk-XKL2RXV6.js";
46
46
  import {
47
47
  streamAgentChatTurn
48
- } from "./chunk-ORKQ3T5D.js";
48
+ } from "./chunk-TOLFIE2I.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-FZSVCJUU.js";
88
+ } from "./chunk-QPUKYKMH.js";
89
89
  import {
90
90
  EMPTY_ASSISTANT_REPAIR_PROMPT
91
91
  } from "./chunk-7TBARDLF.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-UEILX4EV.js";
4
4
  import {
5
5
  compareAgentSelection
6
- } from "./chunk-6J227QXV.js";
6
+ } from "./chunk-2GRXE3YJ.js";
7
7
  import {
8
8
  DEFAULT_PROVIDER_RETRY_MS,
9
9
  isAgentUnavailableNow,
@@ -9,7 +9,7 @@ import {
9
9
  resolveRawAgentInput,
10
10
  resolveServerUrl,
11
11
  writeUsage
12
- } from "./chunk-AKXKBNLQ.js";
12
+ } from "./chunk-EEFX46WP.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-74PQM3XI.js";
34
+ } from "./chunk-4TTEZGP3.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-OPNHKULV.js";
67
+ } from "./chunk-UVP7VL6F.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-SDAIVJZG.js";
82
+ } from "./chunk-6KS4TTCI.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-UA4VAUQL.js";
89
+ } from "./chunk-SIZPFDPU.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-F3F3ARBN.js";
98
+ } from "./chunk-S4SA4INB.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-ULE7ABRN.js";
106
+ } from "./chunk-XKL2RXV6.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-2EC6FNS4.js";
118
+ } from "./chunk-7YN3HYWC.js";
119
119
  import {
120
120
  resolveAgentRuntimeConfigFromRecord
121
- } from "./chunk-5WOL7BUP.js";
121
+ } from "./chunk-EW6GOYKQ.js";
122
122
  import {
123
123
  createThinkParserState,
124
124
  flushThinkParser,
@@ -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-JA2Q6UBJ.js");
11379
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-2JOFHEXA.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();
@@ -1,3 +1,6 @@
1
+ import {
2
+ readLocalImage
3
+ } from "./chunk-SRZ6BQIP.js";
1
4
  import {
2
5
  isRecord
3
6
  } from "./chunk-KUG52IAP.js";
@@ -220,6 +223,43 @@ function logUploadAudit(entry, logFn = console.warn) {
220
223
 
221
224
  // packages/desktop-chrome-connector/chromeConnector.ts
222
225
  import { existsSync as existsSync2, readFileSync } from "node:fs";
226
+
227
+ // packages/desktop-chrome-connector/screenshotResult.ts
228
+ import { mkdtemp, writeFile } from "node:fs/promises";
229
+ import { tmpdir } from "node:os";
230
+ import { join as join2 } from "node:path";
231
+ async function screenshotResult(result) {
232
+ const source = result;
233
+ if (!source?.savedTo && !source?.dataUrl) {
234
+ return { content: JSON.stringify({ ok: true, result }) };
235
+ }
236
+ let path = typeof source?.savedTo === "string" ? source.savedTo : void 0;
237
+ const { dataUrl: _dataUrl, ...summary } = source && typeof source === "object" ? source : {};
238
+ try {
239
+ if (!path && typeof source?.dataUrl === "string") {
240
+ const match = /^data:image\/(png|jpeg|webp|gif);base64,([\s\S]+)$/.exec(source.dataUrl);
241
+ if (!match) throw new Error("unsupported screenshot data URL");
242
+ const directory = await mkdtemp(join2(tmpdir(), "nolo-screenshot-"));
243
+ path = join2(directory, `screenshot.${match[1] === "jpeg" ? "jpg" : match[1]}`);
244
+ await writeFile(path, Buffer.from(match[2], "base64"));
245
+ }
246
+ if (!path) throw new Error("screenshot result has no savedTo or image data URL");
247
+ const image = await readLocalImage(path);
248
+ return {
249
+ content: `${JSON.stringify({ ok: true, result: { ...summary, savedTo: path } })}
250
+ ${image.content.replace(/^\[image /, "[screenshot ")}`,
251
+ images: image.images
252
+ };
253
+ } catch (error) {
254
+ return {
255
+ content: `${JSON.stringify({ ok: true, result: { ...summary, ...path ? { savedTo: path } : {} } })}
256
+ ${path ? `screenshot saved to ${path}
257
+ ` : ""}Screenshot image not delivered (\u672A\u6295\u9012): ${toErrorMessage(error)}`
258
+ };
259
+ }
260
+ }
261
+
262
+ // packages/desktop-chrome-connector/chromeConnector.ts
223
263
  import { resolve as resolve2 } from "node:path";
224
264
  var NOLO_CHROME_CONNECTOR_EXTENSION_ID = "ahpdoopadkamnglhlacfjdfnonpjdplg";
225
265
  var NOLO_FIREFOX_CONNECTOR_EXTENSION_ID = "nolo-browser-connector@nolo.chat";
@@ -587,7 +627,7 @@ async function executeChromeConnectorTool(args) {
587
627
  }) : args.client ?? createVerifiedChromeConnectorClient({ client: createChromeConnectorClient() }));
588
628
  const result = await client.request(action, payload);
589
629
  return {
590
- content: JSON.stringify({ ok: true, result }),
630
+ ...action === "screenshot" ? await screenshotResult(result) : { content: JSON.stringify({ ok: true, result }) },
591
631
  metadata: {
592
632
  chromeConnector: true,
593
633
  action
@@ -5,10 +5,10 @@ import {
5
5
  } from "./chunk-NBTY7YJF.js";
6
6
  import {
7
7
  resolveCliLocalRuntimeKeyCapability
8
- } from "./chunk-SDAIVJZG.js";
8
+ } from "./chunk-6KS4TTCI.js";
9
9
  import {
10
10
  HIGH_RISK_MUTATION_TOOL_NAMES
11
- } from "./chunk-6J227QXV.js";
11
+ } from "./chunk-2GRXE3YJ.js";
12
12
  import {
13
13
  DEFAULT_NOLO_SERVER_URL
14
14
  } from "./chunk-OLZBQWZU.js";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  TOOL_HAD_IMAGES,
6
6
  hadToolImages
7
- } from "./chunk-FZSVCJUU.js";
7
+ } from "./chunk-QPUKYKMH.js";
8
8
  import {
9
9
  asOptionalFiniteNumber
10
10
  } from "./chunk-WWC7I6TA.js";
@@ -30,7 +30,7 @@ import {
30
30
  stablePromptCacheKey,
31
31
  toOpenAiCompatibleMessages,
32
32
  toResponsesTools
33
- } from "./chunk-FZSVCJUU.js";
33
+ } from "./chunk-QPUKYKMH.js";
34
34
  import {
35
35
  isMeaningfulChatCompletionOutput,
36
36
  isMeaningfulResponsesOutput
@@ -1020,7 +1020,7 @@ function projectOpenAiToolImages(messages, supportsImages) {
1020
1020
  }
1021
1021
  bytes += size;
1022
1022
  accepted += 1;
1023
- const source = typeof message.content === "string" ? message.content.match(/→ ([^\s\x00-\x1f\x7f]+)/u)?.[1] ?? "" : "";
1023
+ const source = typeof message.content === "string" ? message.content.match(/→ ([^\s\x00-\x1f\x7f]+)/u)?.[1]?.replace(/\]$/, "") ?? "" : "";
1024
1024
  const toolCallId = typeof message.tool_call_id === "string" ? message.tool_call_id : "unknown";
1025
1025
  parts.push({
1026
1026
  type: "text",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildAgentRuntimeAgentLookupKeys,
3
3
  shouldFetchAgentRuntimeRecordRemotely
4
- } from "./chunk-6J227QXV.js";
4
+ } from "./chunk-2GRXE3YJ.js";
5
5
 
6
6
  // packages/agent-runtime/oauthProviderRefs.ts
7
7
  var OAUTH_PROVIDER_REFS = [
@@ -2,7 +2,7 @@ import {
2
2
  clipMultilineText,
3
3
  fetchAndSerializeTable,
4
4
  waitForAbortableDelay
5
- } from "./chunk-UA4VAUQL.js";
5
+ } from "./chunk-SIZPFDPU.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-ULE7ABRN.js";
24
+ } from "./chunk-XKL2RXV6.js";
25
25
  import {
26
26
  createSpaceKey
27
27
  } from "./chunk-UAD2WT54.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-MYZHJKLG.js";
3
+ } from "./chunk-BIF4B4ON.js";
4
4
  import {
5
5
  format,
6
6
  prepareAndPersistMessage,
7
7
  uiAskChoiceFunc,
8
8
  uiAskChoiceFunctionSchema
9
- } from "./chunk-ULE7ABRN.js";
9
+ } from "./chunk-XKL2RXV6.js";
10
10
  import {
11
11
  formatISO
12
12
  } from "./chunk-ZRAU6T47.js";
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-VYNMQ6HW.js";
9
9
  import {
10
10
  fetchAndCacheTableRows
11
- } from "./chunk-MYZHJKLG.js";
11
+ } from "./chunk-BIF4B4ON.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-M7H7Z44Z.js");
524
+ const { findToolExecutor } = await import("./tools-546KDFWP.js");
525
525
  const { executor } = findToolExecutor(run.toolName);
526
526
  toolRunStarted({
527
527
  id: run.id,
@@ -0,0 +1,68 @@
1
+ // packages/agent-runtime/readImage.ts
2
+ import { readFile } from "node:fs/promises";
3
+ import { extname } from "node:path";
4
+ var MAX_IMAGE_BASE64_BYTES = 2 * 1024 * 1024;
5
+ var MAX_IMAGE_EDGE = 1568;
6
+ var MIME_BY_EXTENSION = {
7
+ ".png": "image/png",
8
+ ".jpg": "image/jpeg",
9
+ ".jpeg": "image/jpeg",
10
+ ".webp": "image/webp",
11
+ ".gif": "image/gif"
12
+ };
13
+ function detectMime(bytes) {
14
+ if (bytes.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]))) return "image/png";
15
+ if (bytes[0] === 255 && bytes[1] === 216 && bytes[2] === 255) return "image/jpeg";
16
+ if (["GIF87a", "GIF89a"].includes(bytes.toString("ascii", 0, 6))) return "image/gif";
17
+ if (bytes.toString("ascii", 0, 4) === "RIFF" && bytes.toString("ascii", 8, 12) === "WEBP") return "image/webp";
18
+ }
19
+ async function readLocalImage(path, options) {
20
+ const limit = options?.maxBase64Bytes ?? MAX_IMAGE_BASE64_BYTES;
21
+ const expected = MIME_BY_EXTENSION[extname(path).toLowerCase()];
22
+ if (!expected) throw new Error("read_image: unsupported image extension (PNG/JPEG/WebP/GIF only)");
23
+ const bytes = await readFile(path);
24
+ if (detectMime(bytes) !== expected) throw new Error("read_image: image extension and magic bytes do not match");
25
+ const { default: sharp } = await import("./dist-Q2JSMAKA.js");
26
+ const image = sharp(bytes, { limitInputPixels: 4e7, animated: false });
27
+ const meta = await image.metadata();
28
+ if (!meta.width || !meta.height) throw new Error("read_image: invalid image dimensions");
29
+ const encoded = (length) => 4 * Math.ceil(length / 3);
30
+ let output = bytes;
31
+ let mimeType = expected;
32
+ let width = meta.width;
33
+ let height = meta.height;
34
+ if (Math.max(width, height) > MAX_IMAGE_EDGE || encoded(output.length) > limit) {
35
+ const resized = await image.rotate().resize({ width: MAX_IMAGE_EDGE, height: MAX_IMAGE_EDGE, fit: "inside", withoutEnlargement: true }).jpeg({ quality: 80 }).toBuffer({ resolveWithObject: true });
36
+ output = resized.data;
37
+ width = resized.info.width;
38
+ height = resized.info.height;
39
+ mimeType = "image/jpeg";
40
+ }
41
+ while (encoded(output.length) > limit) {
42
+ const current = encoded(output.length);
43
+ if (width === 1 && height === 1) {
44
+ throw new Error(
45
+ `read_image: compressed image ${width}x${height}, ${output.length} bytes (${current} base64 bytes) still exceeds ${limit} base64 bytes`
46
+ );
47
+ }
48
+ const scale = Math.min(0.9, Math.sqrt(limit / current) * 0.95);
49
+ const resized = await image.clone().rotate().resize({
50
+ width: Math.max(1, Math.floor(width * scale)),
51
+ height: Math.max(1, Math.floor(height * scale)),
52
+ fit: "inside",
53
+ withoutEnlargement: true
54
+ }).jpeg({ quality: 80 }).toBuffer({ resolveWithObject: true });
55
+ output = resized.data;
56
+ width = resized.info.width;
57
+ height = resized.info.height;
58
+ mimeType = "image/jpeg";
59
+ }
60
+ return {
61
+ content: `[image ${width}x${height} ${output.length} bytes \u2192 ${path}]`,
62
+ images: [{ mimeType, dataBase64: output.toString("base64") }]
63
+ };
64
+ }
65
+
66
+ export {
67
+ readLocalImage
68
+ };
@@ -347,7 +347,7 @@ var slice = createSliceWithThunks({
347
347
  const overrides = {};
348
348
  if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
349
349
  if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
350
- const { _executeModel } = await import("./_executeModel-IABRBGAE.js");
350
+ const { _executeModel } = await import("./_executeModel-P7OE5QLM.js");
351
351
  return _executeModel(
352
352
  {
353
353
  isStreaming: args.isStreaming ?? false,
@@ -368,7 +368,7 @@ var slice = createSliceWithThunks({
368
368
  * - 循环直到无工具调用或触发其他运行时停止条件
369
369
  */
370
370
  runAgent: create.asyncThunk(async (args, thunkApi) => {
371
- const { runAgentClientLoop } = await import("./runAgentClientLoop-34ME2HDT.js");
371
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-H4KCCJOV.js");
372
372
  const { content: loopContent, toolCallCount } = await runAgentClientLoop(
373
373
  {
374
374
  agentKey: args.agentKey,
@@ -384,7 +384,7 @@ var slice = createSliceWithThunks({
384
384
  * 聊天轮次流式 Agent 调用
385
385
  */
386
386
  streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
387
- const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-YXFJ3UWD.js");
387
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-4PX74Z36.js");
388
388
  return streamAgentChatTurnHandler(args, thunkApi);
389
389
  }),
390
390
  /**
@@ -2,7 +2,7 @@ import {
2
2
  deleteDbRecord,
3
3
  queryUserRecords,
4
4
  readDbRecord
5
- } from "./chunk-OPNHKULV.js";
5
+ } from "./chunk-UVP7VL6F.js";
6
6
  import {
7
7
  mergeAndDedupUserData
8
8
  } from "./chunk-OXME3PEE.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  listUserRecordsFromServers,
3
3
  readLiveDbRecordAfterTombstoneMerge
4
- } from "./chunk-SUBKVXFM.js";
4
+ } from "./chunk-TY7GIRX6.js";
5
5
  import {
6
6
  agentRecordHasConfiguredCredential
7
- } from "./chunk-OPNHKULV.js";
7
+ } from "./chunk-UVP7VL6F.js";
8
8
  import {
9
9
  deriveCredentialGroup
10
- } from "./chunk-BE42X662.js";
10
+ } from "./chunk-CK4GWPSD.js";
11
11
  import {
12
12
  isTombstoneRecord
13
13
  } from "./chunk-D2MDMY2M.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-62TBKWTV.js";
7
7
  import {
8
8
  clearCliLocalRuntimePreparedAgentCache
9
- } from "./chunk-74PQM3XI.js";
9
+ } from "./chunk-4TTEZGP3.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-OPNHKULV.js";
22
+ } from "./chunk-UVP7VL6F.js";
23
23
  import {
24
24
  resolveCliAgentKeyInput
25
25
  } from "./chunk-NBTY7YJF.js";