nolo-cli 0.13.0 → 0.14.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 (89) hide show
  1. package/{_executeModel-4F7VZR5U.js → _executeModel-SQVV6CXR.js} +27 -28
  2. package/{action-OTOWUMPW.js → action-Q5CBVUV5.js} +7 -7
  3. package/{addContentAction-JGBUVR7K.js → addContentAction-ZCJJ3XOL.js} +6 -6
  4. package/{addDialogAgentAction-V6CL2UCF.js → addDialogAgentAction-ROUQPBVI.js} +5 -5
  5. package/{agentDeleteCommand-MMRSG6AB.js → agentDeleteCommand-TSY5OSG7.js} +18 -18
  6. package/{agentEmailCommands-VQENDYL5.js → agentEmailCommands-YX57M3P7.js} +34 -35
  7. package/{agentListCommands-2PZHIQ3I.js → agentListCommands-S65H4AVT.js} +19 -19
  8. package/{agentMachineCommands-Q3I3VDWS.js → agentMachineCommands-ELNLSTE4.js} +18 -18
  9. package/{agentRecordCommands-RY7CSPPL.js → agentRecordCommands-HVCGO2XK.js} +32 -33
  10. package/{agentRunCommand-U76NZ2G6.js → agentRunCommand-EOFDKKFI.js} +33 -35
  11. package/{agentRuntimeLocal-QDJCBXM2.js → agentRuntimeLocal-F4FWS5Z4.js} +16 -16
  12. package/{agentSlice-6JAJOU3X.js → agentSlice-R3WAV3VG.js} +7 -7
  13. package/{authCommand-DMW336GT.js → authCommand-O7SL3WW5.js} +4 -4
  14. package/{chunk-2BVGERJ2.js → chunk-2KNEWIDU.js} +106 -11
  15. package/{chunk-WVTBAALN.js → chunk-2MW6QFIQ.js} +2 -2
  16. package/{chunk-UWNSWEEC.js → chunk-3DKS6UER.js} +71 -29
  17. package/{chunk-3MI5LDDU.js → chunk-4GXQ74DF.js} +2 -2
  18. package/{chunk-4LG74DRG.js → chunk-4IJYA27C.js} +1 -1
  19. package/{chunk-TA7VKOHU.js → chunk-7H3O7ZA2.js} +6 -3
  20. package/{chunk-YUMYYXPI.js → chunk-7ULBTAQK.js} +16 -16
  21. package/{chunk-KGI44L4E.js → chunk-ACPNKI3V.js} +7 -7
  22. package/{chunk-5V524MHX.js → chunk-AEMXZOAK.js} +14 -13
  23. package/{chunk-OPM2DE2J.js → chunk-AGUNTRZV.js} +4 -4
  24. package/{chunk-Y5P3ZRGC.js → chunk-BHKOPLWJ.js} +6 -6
  25. package/{chunk-IVAOVLM7.js → chunk-BOJVWKNA.js} +1 -1
  26. package/{chunk-MG6BVV3T.js → chunk-BRODTPXY.js} +170 -98
  27. package/{chunk-C3BFP57W.js → chunk-CANREHJB.js} +1 -1
  28. package/{chunk-DPFWKRHG.js → chunk-CFX7LP6W.js} +2 -2
  29. package/{chunk-QJSTNKJY.js → chunk-DSCG2DY5.js} +1 -1
  30. package/{chunk-JU7J7EAV.js → chunk-EC2EU2F4.js} +3 -3
  31. package/{chunk-VBSWHE5W.js → chunk-FLY6L3KA.js} +1 -1
  32. package/{chunk-MZHSAPZP.js → chunk-HXPBV44X.js} +33 -29
  33. package/{chunk-TQYYGE6G.js → chunk-IVOFAQ5R.js} +3 -3
  34. package/{chunk-WPHL6ALY.js → chunk-JTINRTBT.js} +1 -1
  35. package/{chunk-QAJWQTLB.js → chunk-K4S6CYKK.js} +39 -27
  36. package/{chunk-XHQWJUW4.js → chunk-NJVPXLRY.js} +1 -1
  37. package/{chunk-BTYBYAMP.js → chunk-O2S35KSZ.js} +2 -2
  38. package/{chunk-H5Y2H2N6.js → chunk-OIMX7MM4.js} +1 -1
  39. package/{chunk-5S4SWV5G.js → chunk-PB2DHBEQ.js} +1 -1
  40. package/{chunk-QUHUVG6Y.js → chunk-QRBZS6G4.js} +2 -2
  41. package/{chunk-RWO5DGXI.js → chunk-QV25QXE2.js} +3 -3
  42. package/{chunk-JFANOO7I.js → chunk-SJQVOEIV.js} +3 -3
  43. package/{chunk-CGDQDXKZ.js → chunk-TSJBYH7X.js} +1 -1
  44. package/{chunk-LUKQQJFL.js → chunk-UW3WOIWJ.js} +1 -1
  45. package/{chunk-VKG4HXYV.js → chunk-V6PGKRZC.js} +9 -9
  46. package/{chunk-ARSC56DC.js → chunk-XZY4TCZO.js} +1 -1
  47. package/{chunk-O4FOPRCP.js → chunk-YX4H7EP4.js} +1 -1
  48. package/{chunk-FSUZIGIG.js → chunk-ZEYSZ5WG.js} +76 -62
  49. package/{createAgentAutomationAction-4NY4JLOK.js → createAgentAutomationAction-LL2UAZL3.js} +13 -13
  50. package/{createDialogAction-I5WUWFJ6.js → createDialogAction-MSMUS4NO.js} +14 -15
  51. package/{createPageAction-HFTIQ7TW.js → createPageAction-MGN4CQWL.js} +13 -13
  52. package/{dbSlice-J4PUZ6Y5.js → dbSlice-35VY6LYX.js} +5 -5
  53. package/{deleteFile-M7UNIUOO.js → deleteFile-WPWVZE4B.js} +3 -3
  54. package/{dialogCommands-SVXRJFZS.js → dialogCommands-7EKKHEGO.js} +19 -19
  55. package/{dialogSlice-35LA3ZRG.js → dialogSlice-ZRYCGVVH.js} +13 -13
  56. package/{docCreateCommands-Z7RIAYKQ.js → docCreateCommands-YCU2BINI.js} +18 -18
  57. package/{docDeleteCommands-NEYHUVZF.js → docDeleteCommands-CEB54GNO.js} +19 -19
  58. package/{docReadCommands-I4US2SDE.js → docReadCommands-Z2OZTAIA.js} +18 -18
  59. package/{docStore-3CP2IO6M.js → docStore-AYLR7HES.js} +14 -14
  60. package/{docUpdateCommands-UU5HQBRP.js → docUpdateCommands-VU2TNBPM.js} +18 -18
  61. package/fetchMessages-KTNM7QAR.js +1 -1
  62. package/getPricing-UGDJHI7M.js +1 -1
  63. package/{handleSendMessageAction-FWTLQGOZ.js → handleSendMessageAction-D4UALBU5.js} +13 -13
  64. package/index.js +42 -42
  65. package/{machineCommands-NGE4ZARV.js → machineCommands-65QZPPET.js} +33 -34
  66. package/{machineWsRunDispatch-FISQUBI2.js → machineWsRunDispatch-35QVFHKA.js} +31 -32
  67. package/package.json +1 -1
  68. package/{read-2MIMRBZ2.js → read-SIWMJRHC.js} +3 -3
  69. package/{readDocTool-QHVGQHUJ.js → readDocTool-TCYJY4PP.js} +1 -1
  70. package/{readlineWorkspace-JK6P56TT.js → readlineWorkspace-U4PN6GH2.js} +38 -40
  71. package/{removeDialogAgentAction-XUZYQBV4.js → removeDialogAgentAction-DPSDJL5F.js} +7 -7
  72. package/{runAgentClientLoop-FP2K33ZO.js → runAgentClientLoop-HND2XKNI.js} +24 -25
  73. package/{setDialogExtraReferencesAction-PTAIFKGM.js → setDialogExtraReferencesAction-6UPTOPJA.js} +5 -5
  74. package/{setPrimaryDialogAgentAction-HRFTDB44.js → setPrimaryDialogAgentAction-PFDHN53I.js} +7 -7
  75. package/{settingSlice-VGRJUSE5.js → settingSlice-6M2BKFW5.js} +6 -6
  76. package/{spaceCommands-GN73BCOB.js → spaceCommands-NP75DOJW.js} +18 -18
  77. package/{spaceSlice-WTFNKOVA.js → spaceSlice-J44RNCGS.js} +13 -13
  78. package/{streamAgentChatTurn-HBAQQVNK.js → streamAgentChatTurn-MNBTNJDU.js} +44 -41
  79. package/{tools-TPQYTLQZ.js → tools-R2M77NZJ.js} +18 -19
  80. package/{tuiSummaryLlmCaller-XDC7WG4K.js → tuiSummaryLlmCaller-2D65LKWM.js} +3 -3
  81. package/{updateDialogTitleAction-AWXNPUQJ.js → updateDialogTitleAction-ERVV47T7.js} +13 -13
  82. package/chunk-HNW7IJSK.js +0 -71
  83. package/chunk-XENYHRUE.js +0 -104
  84. package/understanding-3CUQQ6SV.js +0 -271
  85. package/{chunk-PDL2AV3E.js → chunk-5CS33IBL.js} +3 -3
  86. package/{chunk-TSUJOM6N.js → chunk-DVRHHFEA.js} +3 -3
  87. package/{chunk-TOILAPLH.js → chunk-EHLHSX7R.js} +3 -3
  88. package/{chunk-TYPHUVK5.js → chunk-KTFJUPDW.js} +3 -3
  89. package/{chunk-NCGFB7NN.js → chunk-OIQPORYI.js} +3 -3
@@ -4,10 +4,10 @@ import {
4
4
  providerHttpFailure,
5
5
  readSseFrames,
6
6
  throwIfChatCompletionStreamFailed
7
- } from "./chunk-5S4SWV5G.js";
7
+ } from "./chunk-PB2DHBEQ.js";
8
8
  import {
9
9
  parseToolArgumentsJson
10
- } from "./chunk-TA7VKOHU.js";
10
+ } from "./chunk-7H3O7ZA2.js";
11
11
  import {
12
12
  createThinkParserState,
13
13
  createToolCallAccumulator,
@@ -17,12 +17,12 @@ import {
17
17
  import {
18
18
  requiresBareImageUrl,
19
19
  toBareImageUrlMessages
20
- } from "./chunk-LUKQQJFL.js";
20
+ } from "./chunk-UW3WOIWJ.js";
21
21
  import {
22
22
  buildProviderAuthHeaders,
23
23
  buildProviderExecutionPlan,
24
24
  toOpenAiCompatibleMessages
25
- } from "./chunk-TYPHUVK5.js";
25
+ } from "./chunk-KTFJUPDW.js";
26
26
  import {
27
27
  canonicalizeToolName,
28
28
  createGlob,
@@ -46,15 +46,15 @@ import {
46
46
  import {
47
47
  asTrimmedLowercaseString
48
48
  } from "./chunk-QSJ3HFEF.js";
49
- import {
50
- isRecord
51
- } from "./chunk-KUG52IAP.js";
52
49
  import {
53
50
  asTrimmedString
54
51
  } from "./chunk-3EUW3WEO.js";
55
52
  import {
56
53
  asOptionalPositiveFiniteNumber
57
54
  } from "./chunk-U6VC4MU4.js";
55
+ import {
56
+ isRecord
57
+ } from "./chunk-KUG52IAP.js";
58
58
  import {
59
59
  normalizeServerOrigin
60
60
  } from "./chunk-CF7PE763.js";
@@ -1225,30 +1225,18 @@ function buildReadWorkspaceDescription(variant) {
1225
1225
  return "Read a UTF-8 text file inside the workspace.";
1226
1226
  }
1227
1227
  if (variant === "workflow") {
1228
- return "Read a UTF-8 text file inside the workspace after listFiles, globFiles, or searchFiles has narrowed the target. Use line ranges from searchFiles matches and tailLines for logs or generated output. Read the whole file only when the task truly needs all content or exact edit context.";
1228
+ return 'Read a UTF-8 text file inside the workspace after listFiles, globFiles, or searchFiles has narrowed the target. Use lines with a range from searchFiles matches, or lines: "-50" for logs and generated output. Read the whole file only when the task truly needs all content or exact edit context.';
1229
1229
  }
1230
1230
  if (variant === "antiShell") {
1231
1231
  return "Read a UTF-8 text file inside the workspace. Do not use execShell with cat/sed/head/tail for normal text reads when readFile can return the needed file or line range. Use searchFiles first for content search, then readFile only the relevant lines when possible.";
1232
1232
  }
1233
- return "Read a UTF-8 text file inside the workspace. Read before editing when you need exact text for editFile. For discovery or classification tasks, avoid batch-reading every candidate; report candidate paths first, or read only one to three representative files with maxLines or focused line ranges. Use line ranges for large code, docs, data, configs, and logs after searchFiles returns line numbers. Read the whole file only when the task truly needs all content or exact edit context.";
1233
+ return "Read a UTF-8 text file inside the workspace. Read before editing when you need exact text for editFile. For discovery or classification tasks, avoid batch-reading every candidate; report candidate paths first, or read only one to three representative files with a small lines count. Use lines ranges for large code, docs, data, configs, and logs after searchFiles returns line numbers. Read the whole file only when the task truly needs all content or exact edit context.";
1234
1234
  }
1235
1235
  function buildReadWorkspaceParameters(variant) {
1236
1236
  const path = buildWorkspacePathProperty();
1237
- const startLine = {
1238
- type: "integer",
1239
- description: "1-based first line to return. Use with endLine or maxLines after searchFiles gives a line number."
1240
- };
1241
- const endLine = {
1242
- type: "integer",
1243
- description: "1-based last line to return, inclusive."
1244
- };
1245
- const maxLines = {
1246
- type: "integer",
1247
- description: "Maximum number of lines to return starting at startLine, or from the start of the file when startLine is omitted. Use for lightweight previews of candidate configs, docs, data, and logs instead of reading many whole files. When the user gives a read/preview budget, each readFile preview consumes one budget slot."
1248
- };
1249
- const tailLines = {
1250
- type: "integer",
1251
- description: "Return only the last N lines, useful for logs and generated text."
1237
+ const lines = {
1238
+ type: "string",
1239
+ description: 'Which lines to return: "40-120" for a range (1-based, inclusive), "120-" from a line to the end, "-50" for the last N lines (logs, generated output), "50" for the first N. Omit to read the whole file. Use a range after searchFiles gives a line number, and a small count to preview candidates instead of reading many whole files. When the user gives a read/preview budget, each readFile preview consumes one budget slot.'
1252
1240
  };
1253
1241
  if (variant === "minimal") {
1254
1242
  return {
@@ -1257,27 +1245,9 @@ function buildReadWorkspaceParameters(variant) {
1257
1245
  required: ["path"]
1258
1246
  };
1259
1247
  }
1260
- if (variant === "rich") {
1261
- return {
1262
- type: "object",
1263
- properties: {
1264
- path,
1265
- startLine,
1266
- endLine,
1267
- maxLines,
1268
- tailLines
1269
- },
1270
- required: ["path"]
1271
- };
1272
- }
1273
1248
  return {
1274
1249
  type: "object",
1275
- properties: {
1276
- path,
1277
- startLine,
1278
- endLine,
1279
- maxLines
1280
- },
1250
+ properties: { path, lines },
1281
1251
  required: ["path"]
1282
1252
  };
1283
1253
  }
@@ -2014,31 +1984,120 @@ function readExpectedReplacementCount(args) {
2014
1984
  }
2015
1985
  return value;
2016
1986
  }
2017
- function readPositiveIntegerArg(args) {
2018
- if (args.value === void 0) return void 0;
1987
+ var READ_FILE_SLICE_FALLBACK_LINES = 200;
1988
+ var LEGACY_SLICE_ARG_NAMES = ["startLine", "endLine", "maxLines", "tailLines"];
1989
+ function isAbsentArg(value) {
1990
+ return value === void 0 || value === null;
1991
+ }
1992
+ function describeRejectedArgValue(value) {
1993
+ if (typeof value === "string") return JSON.stringify(value);
1994
+ if (typeof value === "number" || typeof value === "boolean") {
1995
+ return String(value);
1996
+ }
1997
+ if (Array.isArray(value)) return "an array";
1998
+ return `a value of type ${typeof value}`;
1999
+ }
2000
+ function readIntegerArg(args) {
2001
+ if (isAbsentArg(args.value)) return {};
2002
+ const min = args.min ?? 1;
2019
2003
  const value = Number(args.value);
2020
- if (!Number.isInteger(value) || value < 1) {
2021
- throw new Error(`${args.name} must be a positive integer.`);
2004
+ if (!Number.isInteger(value) || value < min) {
2005
+ const expected = min === 0 ? "a non-negative integer" : "a positive integer";
2006
+ return {
2007
+ warning: `Ignored ${args.name}: expected ${expected}, received ${describeRejectedArgValue(args.value)}.`
2008
+ };
2022
2009
  }
2023
- return args.max ? Math.min(value, args.max) : value;
2010
+ return { value: args.max ? Math.min(value, args.max) : value };
2024
2011
  }
2025
- function readFileSliceArgs(args) {
2026
- const startLine = readPositiveIntegerArg({ value: args.startLine, name: "startLine" });
2027
- const endLine = readPositiveIntegerArg({ value: args.endLine, name: "endLine" });
2028
- const maxLines = readPositiveIntegerArg({ value: args.maxLines, name: "maxLines", max: 2e3 });
2029
- const tailLines = readPositiveIntegerArg({ value: args.tailLines, name: "tailLines", max: 2e3 });
2030
- if (tailLines !== void 0 && (startLine !== void 0 || endLine !== void 0)) {
2031
- throw new Error("tailLines cannot be combined with startLine or endLine.");
2012
+ function collectIntegerArg(args) {
2013
+ const { value, warning } = readIntegerArg(args);
2014
+ if (warning) {
2015
+ args.warnings.push(
2016
+ args.fallback === void 0 ? warning : `${warning} Using ${args.fallback} instead.`
2017
+ );
2032
2018
  }
2033
- if (endLine !== void 0 && startLine !== void 0 && endLine < startLine) {
2034
- throw new Error("endLine must be greater than or equal to startLine.");
2019
+ return value ?? args.fallback;
2020
+ }
2021
+ var LINES_ARG_SYNTAX = '"40-120", "120-", "-50", or "50"';
2022
+ var LINES_RANGE_FORMAT = /^(\d+)?\s*-\s*(\d+)?$/;
2023
+ function parseLinesArg(value) {
2024
+ const text = typeof value === "string" ? value.trim() : "";
2025
+ if (!text) {
2026
+ return {
2027
+ warning: `Ignored lines: expected ${LINES_ARG_SYNTAX}, received ${describeRejectedArgValue(value)}.`
2028
+ };
2035
2029
  }
2036
- return {
2037
- startLine,
2038
- endLine,
2039
- maxLines,
2040
- tailLines
2030
+ const reject = {
2031
+ warning: `Ignored lines: expected ${LINES_ARG_SYNTAX}, received ${JSON.stringify(text)}.`
2032
+ };
2033
+ if (/^\d+$/.test(text)) {
2034
+ const count = Number(text);
2035
+ return count > 0 ? { slice: { maxLines: Math.min(count, 2e3) } } : reject;
2036
+ }
2037
+ const range = LINES_RANGE_FORMAT.exec(text);
2038
+ if (!range) return reject;
2039
+ const [, rawStart, rawEnd] = range;
2040
+ if (rawStart === void 0 && rawEnd === void 0) return reject;
2041
+ if (rawStart === void 0) {
2042
+ const tail = Number(rawEnd);
2043
+ return tail > 0 ? { slice: { tailLines: Math.min(tail, 2e3) } } : reject;
2044
+ }
2045
+ const startLine = Number(rawStart);
2046
+ if (startLine < 1) return reject;
2047
+ if (rawEnd === void 0) return { slice: { startLine } };
2048
+ const endLine = Number(rawEnd);
2049
+ if (endLine < startLine) {
2050
+ return {
2051
+ warning: `Ignored lines ${JSON.stringify(text)}: the end line must be greater than or equal to the start line.`
2052
+ };
2053
+ }
2054
+ return { slice: { startLine, endLine } };
2055
+ }
2056
+ function readFileSliceArgs(args) {
2057
+ const warnings = [];
2058
+ const legacyUsed = LEGACY_SLICE_ARG_NAMES.filter((name) => !isAbsentArg(args[name]));
2059
+ const withFallback = (slice) => {
2060
+ warnings.push(
2061
+ `No usable line range remained; returned the first ${READ_FILE_SLICE_FALLBACK_LINES} lines instead of the whole file.`
2062
+ );
2063
+ return { ...slice, maxLines: READ_FILE_SLICE_FALLBACK_LINES, warnings };
2041
2064
  };
2065
+ if (!isAbsentArg(args.lines)) {
2066
+ if (legacyUsed.length > 0) {
2067
+ warnings.push(`Ignored ${legacyUsed.join(", ")}: superseded by lines.`);
2068
+ }
2069
+ const { slice, warning } = parseLinesArg(args.lines);
2070
+ if (warning) warnings.push(warning);
2071
+ return slice ? { ...slice, warnings } : withFallback({});
2072
+ }
2073
+ if (legacyUsed.length === 0) return { warnings };
2074
+ warnings.push(
2075
+ `${legacyUsed.join(", ")} ${legacyUsed.length > 1 ? "are" : "is"} deprecated; use lines instead (${LINES_ARG_SYNTAX}).`
2076
+ );
2077
+ const take = (name, max) => collectIntegerArg({ value: args[name], name, max, warnings });
2078
+ const resolved = {
2079
+ startLine: take("startLine"),
2080
+ endLine: take("endLine"),
2081
+ maxLines: take("maxLines", 2e3),
2082
+ tailLines: take("tailLines", 2e3)
2083
+ };
2084
+ if (resolved.endLine !== void 0 && resolved.startLine !== void 0 && resolved.endLine < resolved.startLine) {
2085
+ warnings.push(
2086
+ `Ignored endLine (${resolved.endLine}): endLine must be greater than or equal to startLine (${resolved.startLine}).`
2087
+ );
2088
+ resolved.endLine = void 0;
2089
+ }
2090
+ if (resolved.tailLines !== void 0 && (resolved.startLine !== void 0 || resolved.endLine !== void 0)) {
2091
+ warnings.push(
2092
+ `Ignored tailLines (${resolved.tailLines}): tailLines cannot be combined with startLine or endLine.`
2093
+ );
2094
+ resolved.tailLines = void 0;
2095
+ }
2096
+ const nothingUsable = LEGACY_SLICE_ARG_NAMES.every((name) => resolved[name] === void 0);
2097
+ return nothingUsable ? withFallback(resolved) : { ...resolved, warnings };
2098
+ }
2099
+ function buildReadFileSliceHint(totalLines) {
2100
+ return `File has ${totalLines} lines. Use lines: ${LINES_ARG_SYNTAX}, or omit it for the whole file.`;
2042
2101
  }
2043
2102
  function splitTextLines(content) {
2044
2103
  const lines = content.split(/\r?\n/);
@@ -2128,36 +2187,42 @@ function requireWorkspaceGlobPattern(args) {
2128
2187
  if (!pattern) throw new Error("globFiles requires a non-empty pattern.");
2129
2188
  return pattern;
2130
2189
  }
2131
- function readWorkspaceMaxResults(args, defaultValue) {
2132
- if (args.maxResults === void 0) return defaultValue;
2133
- const value = Number(args.maxResults);
2134
- if (!Number.isInteger(value) || value < 1) {
2135
- throw new Error("maxResults must be a positive integer.");
2136
- }
2137
- return Math.min(value, 500);
2138
- }
2139
- function readWorkspaceMaxDepth(args) {
2140
- if (args.maxDepth === void 0) return 1;
2141
- const value = Number(args.maxDepth);
2142
- if (!Number.isInteger(value) || value < 1) {
2143
- throw new Error("maxDepth must be a positive integer.");
2144
- }
2145
- return Math.min(value, 10);
2190
+ function readWorkspaceMaxResults(args, warnings, defaultValue) {
2191
+ return collectIntegerArg({
2192
+ value: args.maxResults,
2193
+ name: "maxResults",
2194
+ max: 500,
2195
+ fallback: defaultValue,
2196
+ warnings
2197
+ });
2146
2198
  }
2147
- function readWorkspaceEntryType(args) {
2148
- if (args.entryType === void 0) return "all";
2149
- if (args.entryType === "all" || args.entryType === "files" || args.entryType === "directories") {
2150
- return args.entryType;
2151
- }
2152
- throw new Error("entryType must be one of all, files, or directories.");
2199
+ function readWorkspaceMaxDepth(args, warnings) {
2200
+ return collectIntegerArg({
2201
+ value: args.maxDepth,
2202
+ name: "maxDepth",
2203
+ max: 10,
2204
+ fallback: 1,
2205
+ warnings
2206
+ });
2153
2207
  }
2154
- function readWorkspaceContextLines(args) {
2155
- if (args.contextLines === void 0) return void 0;
2156
- const value = Number(args.contextLines);
2157
- if (!Number.isInteger(value) || value < 0) {
2158
- throw new Error("contextLines must be a non-negative integer.");
2159
- }
2160
- return Math.min(value, 20);
2208
+ var WORKSPACE_ENTRY_TYPES = ["all", "files", "directories"];
2209
+ function readWorkspaceEntryType(args, warnings) {
2210
+ if (isAbsentArg(args.entryType)) return "all";
2211
+ const entryType = WORKSPACE_ENTRY_TYPES.find((value) => value === args.entryType);
2212
+ if (entryType) return entryType;
2213
+ warnings.push(
2214
+ `Ignored entryType: expected one of ${WORKSPACE_ENTRY_TYPES.join(", ")}, received ${describeRejectedArgValue(args.entryType)}. Using all instead.`
2215
+ );
2216
+ return "all";
2217
+ }
2218
+ function readWorkspaceContextLines(args, warnings) {
2219
+ return collectIntegerArg({
2220
+ value: args.contextLines,
2221
+ name: "contextLines",
2222
+ min: 0,
2223
+ max: 20,
2224
+ warnings
2225
+ });
2161
2226
  }
2162
2227
  function readWorkspaceExcludeGlobs(args) {
2163
2228
  if (args.exclude === void 0) return [];
@@ -2632,7 +2697,7 @@ async function resolveLocalWorkspaceToolPath(args) {
2632
2697
  async function readFileTool(args) {
2633
2698
  const parsed = parseWorkspaceToolArguments(args.call.arguments);
2634
2699
  const requestedPath = requireWorkspaceToolPath(parsed);
2635
- const sliceArgs = readFileSliceArgs(parsed);
2700
+ const { warnings, ...sliceArgs } = readFileSliceArgs(parsed);
2636
2701
  const absolutePath = await resolveLocalWorkspaceToolPath({
2637
2702
  workspaceRoot: args.workspaceRoot,
2638
2703
  requestedPath,
@@ -2659,6 +2724,7 @@ async function readFileTool(args) {
2659
2724
  truncated: sliced.truncated,
2660
2725
  ...sliceArgs.maxLines ? { maxLines: sliceArgs.maxLines } : {},
2661
2726
  ...sliceArgs.tailLines ? { tailLines: sliceArgs.tailLines } : {},
2727
+ ...warnings.length ? { warnings: [...warnings, buildReadFileSliceHint(sliced.totalLines)] } : {},
2662
2728
  ...activity ? { activity } : {}
2663
2729
  }
2664
2730
  };
@@ -2789,10 +2855,11 @@ async function listWorkspaceEntries(args) {
2789
2855
  }
2790
2856
  async function listFilesTool(args) {
2791
2857
  const parsed = parseWorkspaceToolArguments(args.call.arguments);
2858
+ const warnings = [];
2792
2859
  const requestedPath = readWorkspacePathAlias(parsed) ?? ".";
2793
- const maxDepth = readWorkspaceMaxDepth(parsed);
2794
- const maxResults = readWorkspaceMaxResults(parsed);
2795
- const entryType = readWorkspaceEntryType(parsed);
2860
+ const maxDepth = readWorkspaceMaxDepth(parsed, warnings);
2861
+ const maxResults = readWorkspaceMaxResults(parsed, warnings);
2862
+ const entryType = readWorkspaceEntryType(parsed, warnings);
2796
2863
  const dirPath = await resolveLocalWorkspaceToolPath({
2797
2864
  workspaceRoot: args.workspaceRoot,
2798
2865
  requestedPath,
@@ -2816,16 +2883,18 @@ async function listFilesTool(args) {
2816
2883
  limitedByMaxResults: listed.truncated,
2817
2884
  limitedByMaxDepth: listed.limitedByMaxDepth,
2818
2885
  visitedEntries: listed.visitedEntries,
2819
- ...maxResults ? { maxResults } : {}
2886
+ ...maxResults ? { maxResults } : {},
2887
+ ...warnings.length ? { warnings } : {}
2820
2888
  }
2821
2889
  };
2822
2890
  }
2823
2891
  async function searchFilesTool(args) {
2824
2892
  const parsed = parseWorkspaceToolArguments(args.call.arguments);
2893
+ const warnings = [];
2825
2894
  const query = requireWorkspaceSearchQuery(parsed);
2826
2895
  const exclude = readWorkspaceExcludeGlobs(parsed);
2827
- const maxResults = readWorkspaceMaxResults(parsed, DEFAULT_SEARCH_MAX_RESULTS);
2828
- const contextLines = readWorkspaceContextLines(parsed);
2896
+ const maxResults = readWorkspaceMaxResults(parsed, warnings, DEFAULT_SEARCH_MAX_RESULTS);
2897
+ const contextLines = readWorkspaceContextLines(parsed, warnings);
2829
2898
  const literal = parsed.literal === true;
2830
2899
  const caseSensitive = parsed.caseSensitive === false ? false : true;
2831
2900
  const requestedPath = readWorkspacePathAlias(parsed) ?? ".";
@@ -2983,6 +3052,7 @@ async function searchFilesTool(args) {
2983
3052
  ...maxResults ? { maxResults } : {},
2984
3053
  exitCode: result.exitCode,
2985
3054
  searchEngine,
3055
+ ...warnings.length ? { warnings } : {},
2986
3056
  ...extractActivity(parsed) ? { activity: extractActivity(parsed) } : {}
2987
3057
  }
2988
3058
  };
@@ -3099,9 +3169,10 @@ async function scanWorkspaceTextMatches(args) {
3099
3169
  }
3100
3170
  async function globFilesTool(args) {
3101
3171
  const parsed = parseWorkspaceToolArguments(args.call.arguments);
3172
+ const warnings = [];
3102
3173
  const pattern = requireWorkspaceGlobPattern(parsed);
3103
3174
  const exclude = readWorkspaceExcludeGlobs(parsed);
3104
- const maxResults = readWorkspaceMaxResults(parsed);
3175
+ const maxResults = readWorkspaceMaxResults(parsed, warnings);
3105
3176
  const requestedPath = readWorkspacePathAlias(parsed) ?? ".";
3106
3177
  const includeIgnored = parsed.includeIgnored === true;
3107
3178
  const searchPath = await resolveLocalWorkspaceToolPath({
@@ -3205,6 +3276,7 @@ async function globFilesTool(args) {
3205
3276
  ...maxResults ? { maxResults } : {},
3206
3277
  exitCode,
3207
3278
  searchEngine,
3279
+ ...warnings.length ? { warnings } : {},
3208
3280
  ...activity ? { activity } : {}
3209
3281
  }
3210
3282
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  i18n_default,
3
3
  toolRegistry
4
- } from "./chunk-MZHSAPZP.js";
4
+ } from "./chunk-HXPBV44X.js";
5
5
  import {
6
6
  canonicalizeToolNames
7
7
  } from "./chunk-B4KT7RN2.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  selectCurrentServer,
3
3
  selectRemoteServers
4
- } from "./chunk-JU7J7EAV.js";
4
+ } from "./chunk-EC2EU2F4.js";
5
5
  import {
6
6
  createUserKey,
7
7
  extractAgentInfo,
@@ -16,7 +16,7 @@ import {
16
16
  noloWriteRequest,
17
17
  selectIdentityUser,
18
18
  selectIdentityUserId
19
- } from "./chunk-TSUJOM6N.js";
19
+ } from "./chunk-DVRHHFEA.js";
20
20
  import {
21
21
  normalizeTimeFields
22
22
  } from "./chunk-OOSFSFMA.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_AGENT_BASE_POLICY,
3
3
  DEFAULT_USER_PREFERENCE_PROFILE
4
- } from "./chunk-JU7J7EAV.js";
4
+ } from "./chunk-EC2EU2F4.js";
5
5
 
6
6
  // packages/ai/policy/runtimePolicy.ts
7
7
  var clampLevel = (value, fallback) => {
@@ -10,7 +10,7 @@ import {
10
10
  toTimestampMs,
11
11
  upsert,
12
12
  write
13
- } from "./chunk-VKG4HXYV.js";
13
+ } from "./chunk-V6PGKRZC.js";
14
14
  import {
15
15
  createUserKey,
16
16
  createUserPreferenceKey,
@@ -21,7 +21,7 @@ import {
21
21
  } from "./chunk-QSJ3HFEF.js";
22
22
  import {
23
23
  BUILTIN_NOLO_AGENT_KEY
24
- } from "./chunk-XHQWJUW4.js";
24
+ } from "./chunk-NJVPXLRY.js";
25
25
  import {
26
26
  asyncThunkCreator,
27
27
  buildCreateSlice,
@@ -29,7 +29,7 @@ import {
29
29
  createAsyncThunk,
30
30
  createSelector,
31
31
  selectIdentityUserId
32
- } from "./chunk-TSUJOM6N.js";
32
+ } from "./chunk-DVRHHFEA.js";
33
33
  import {
34
34
  getAllServers,
35
35
  getIsDesktopApp,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildAgentRuntimeAgentLookupKeys,
3
3
  shouldFetchAgentRuntimeRecordRemotely
4
- } from "./chunk-MG6BVV3T.js";
4
+ } from "./chunk-BRODTPXY.js";
5
5
 
6
6
  // packages/cli/client/localAgentRecords.ts
7
7
  var buildLocalAgentLookupKeys = buildAgentRuntimeAgentLookupKeys;