@probelabs/probe 0.6.0-rc227 → 0.6.0-rc229

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.
@@ -10288,6 +10288,7 @@ function buildSearchDelegateTask({ searchQuery, searchPath, exact, language, all
10288
10288
  `Options: exact=${exact ? "true" : "false"}, language=${language || "auto"}, allow_tests=${allowTests ? "true" : "false"}.`,
10289
10289
  "",
10290
10290
  'Return ONLY valid JSON: {"targets": ["path/to/file.ext#Symbol", "path/to/file.ext:line", "path/to/file.ext:start-end"]}',
10291
+ 'IMPORTANT: Use ABSOLUTE file paths in targets (e.g., "/full/path/to/file.ext#Symbol"). If you only have relative paths, make them relative to the search path above.',
10291
10292
  "Prefer #Symbol when a function/class name is clear; otherwise use line numbers.",
10292
10293
  "Deduplicate targets. Do NOT explain or answer - ONLY return the JSON targets."
10293
10294
  ].join("\n");
@@ -10409,11 +10410,11 @@ var init_vercel = __esm({
10409
10410
  }
10410
10411
  return await runRawSearch();
10411
10412
  }
10412
- const effectiveCwd = options.cwd || ".";
10413
- const resolvedTargets = targets.map((target) => resolveTargetPath(target, effectiveCwd));
10413
+ const resolutionBase = searchPaths[0] || options.cwd || ".";
10414
+ const resolvedTargets = targets.map((target) => resolveTargetPath(target, resolutionBase));
10414
10415
  const extractOptions = {
10415
10416
  files: resolvedTargets,
10416
- cwd: effectiveCwd,
10417
+ cwd: resolutionBase,
10417
10418
  allowTests: allow_tests ?? true
10418
10419
  };
10419
10420
  if (outline) {
@@ -68681,8 +68682,6 @@ async function truncateIfNeeded(content, tokenCounter, sessionId, maxTokens) {
68681
68682
  if (tokenCount <= limit) {
68682
68683
  return { truncated: false, content };
68683
68684
  }
68684
- const maxChars = limit * CHARS_PER_TOKEN2;
68685
- const truncatedContent = content.substring(0, maxChars);
68686
68685
  let tempFilePath = null;
68687
68686
  let fileError = null;
68688
68687
  try {
@@ -68694,22 +68693,38 @@ async function truncateIfNeeded(content, tokenCounter, sessionId, maxTokens) {
68694
68693
  fileError = err.message || "Unknown file system error";
68695
68694
  tempFilePath = null;
68696
68695
  }
68696
+ let truncatedBody;
68697
+ const useTail = limit >= MIN_LIMIT_FOR_TAIL;
68698
+ if (useTail) {
68699
+ const headTokens = limit - TAIL_TOKENS;
68700
+ const headChars = headTokens * CHARS_PER_TOKEN2;
68701
+ const tailChars = TAIL_TOKENS * CHARS_PER_TOKEN2;
68702
+ const headContent = content.substring(0, headChars);
68703
+ const tailContent = content.substring(content.length - tailChars);
68704
+ const omittedTokens = tokenCount - headTokens - TAIL_TOKENS;
68705
+ truncatedBody = `${headContent}
68706
+
68707
+ ... ${omittedTokens} tokens omitted ...
68708
+
68709
+ ${tailContent}`;
68710
+ } else {
68711
+ const maxChars = limit * CHARS_PER_TOKEN2;
68712
+ truncatedBody = content.substring(0, maxChars);
68713
+ }
68697
68714
  let message;
68698
68715
  if (tempFilePath) {
68699
68716
  message = `Output exceeded maximum size (${tokenCount} tokens, limit: ${limit}).
68700
68717
  Full output saved to: ${tempFilePath}
68701
68718
 
68702
- --- Truncated Output (first ${limit} tokens approx) ---
68703
- ${truncatedContent}
68704
- ...
68719
+ --- Truncated Output ---
68720
+ ${truncatedBody}
68705
68721
  --- End of Truncated Output ---`;
68706
68722
  } else {
68707
68723
  message = `Output exceeded maximum size (${tokenCount} tokens, limit: ${limit}).
68708
68724
  Warning: Could not save full output to file (${fileError}).
68709
68725
 
68710
- --- Truncated Output (first ${limit} tokens approx) ---
68711
- ${truncatedContent}
68712
- ...
68726
+ --- Truncated Output ---
68727
+ ${truncatedBody}
68713
68728
  --- End of Truncated Output ---`;
68714
68729
  }
68715
68730
  return {
@@ -68720,12 +68735,14 @@ ${truncatedContent}
68720
68735
  error: fileError || void 0
68721
68736
  };
68722
68737
  }
68723
- var DEFAULT_MAX_OUTPUT_TOKENS, CHARS_PER_TOKEN2;
68738
+ var DEFAULT_MAX_OUTPUT_TOKENS, CHARS_PER_TOKEN2, TAIL_TOKENS, MIN_LIMIT_FOR_TAIL;
68724
68739
  var init_outputTruncator = __esm({
68725
68740
  "src/agent/outputTruncator.js"() {
68726
68741
  "use strict";
68727
68742
  DEFAULT_MAX_OUTPUT_TOKENS = 2e4;
68728
68743
  CHARS_PER_TOKEN2 = 4;
68744
+ TAIL_TOKENS = 1e3;
68745
+ MIN_LIMIT_FOR_TAIL = 2e3;
68729
68746
  }
68730
68747
  });
68731
68748
 
@@ -5,6 +5,8 @@ import { randomUUID } from 'crypto';
5
5
 
6
6
  const DEFAULT_MAX_OUTPUT_TOKENS = 20000;
7
7
  const CHARS_PER_TOKEN = 4; // Conservative approximation
8
+ const TAIL_TOKENS = 1000; // Number of tokens to show from the end of truncated output
9
+ const MIN_LIMIT_FOR_TAIL = 2000; // Minimum token limit to use head+tail split
8
10
 
9
11
  /**
10
12
  * Validate and normalize a token limit value.
@@ -61,10 +63,6 @@ export async function truncateIfNeeded(content, tokenCounter, sessionId, maxToke
61
63
  return { truncated: false, content };
62
64
  }
63
65
 
64
- // Truncate to approximately maxTokens worth of characters
65
- const maxChars = limit * CHARS_PER_TOKEN;
66
- const truncatedContent = content.substring(0, maxChars);
67
-
68
66
  // Try to write full output to temp file
69
67
  let tempFilePath = null;
70
68
  let fileError = null;
@@ -79,22 +77,37 @@ export async function truncateIfNeeded(content, tokenCounter, sessionId, maxToke
79
77
  tempFilePath = null;
80
78
  }
81
79
 
80
+ // Build truncated content with head + tail for better context
81
+ let truncatedBody;
82
+ const useTail = limit >= MIN_LIMIT_FOR_TAIL;
83
+
84
+ if (useTail) {
85
+ const headTokens = limit - TAIL_TOKENS;
86
+ const headChars = headTokens * CHARS_PER_TOKEN;
87
+ const tailChars = TAIL_TOKENS * CHARS_PER_TOKEN;
88
+ const headContent = content.substring(0, headChars);
89
+ const tailContent = content.substring(content.length - tailChars);
90
+ const omittedTokens = tokenCount - headTokens - TAIL_TOKENS;
91
+ truncatedBody = `${headContent}\n\n... ${omittedTokens} tokens omitted ...\n\n${tailContent}`;
92
+ } else {
93
+ const maxChars = limit * CHARS_PER_TOKEN;
94
+ truncatedBody = content.substring(0, maxChars);
95
+ }
96
+
82
97
  let message;
83
98
  if (tempFilePath) {
84
99
  message = `Output exceeded maximum size (${tokenCount} tokens, limit: ${limit}).
85
100
  Full output saved to: ${tempFilePath}
86
101
 
87
- --- Truncated Output (first ${limit} tokens approx) ---
88
- ${truncatedContent}
89
- ...
102
+ --- Truncated Output ---
103
+ ${truncatedBody}
90
104
  --- End of Truncated Output ---`;
91
105
  } else {
92
106
  message = `Output exceeded maximum size (${tokenCount} tokens, limit: ${limit}).
93
107
  Warning: Could not save full output to file (${fileError}).
94
108
 
95
- --- Truncated Output (first ${limit} tokens approx) ---
96
- ${truncatedContent}
97
- ...
109
+ --- Truncated Output ---
110
+ ${truncatedBody}
98
111
  --- End of Truncated Output ---`;
99
112
  }
100
113
 
@@ -140,6 +140,7 @@ function buildSearchDelegateTask({ searchQuery, searchPath, exact, language, all
140
140
  `Options: exact=${exact ? 'true' : 'false'}, language=${language || 'auto'}, allow_tests=${allowTests ? 'true' : 'false'}.`,
141
141
  '',
142
142
  'Return ONLY valid JSON: {"targets": ["path/to/file.ext#Symbol", "path/to/file.ext:line", "path/to/file.ext:start-end"]}',
143
+ 'IMPORTANT: Use ABSOLUTE file paths in targets (e.g., "/full/path/to/file.ext#Symbol"). If you only have relative paths, make them relative to the search path above.',
143
144
  'Prefer #Symbol when a function/class name is clear; otherwise use line numbers.',
144
145
  'Deduplicate targets. Do NOT explain or answer - ONLY return the JSON targets.'
145
146
  ].join('\n');
@@ -267,11 +268,14 @@ export const searchTool = (options = {}) => {
267
268
  return await runRawSearch();
268
269
  }
269
270
 
270
- const effectiveCwd = options.cwd || '.';
271
- const resolvedTargets = targets.map(target => resolveTargetPath(target, effectiveCwd));
271
+ // Resolve relative paths against the actual search directory, not the general cwd.
272
+ // The delegate returns paths relative to where the search was performed (searchPaths[0]),
273
+ // which may differ from options.cwd when the user specifies a path parameter.
274
+ const resolutionBase = searchPaths[0] || options.cwd || '.';
275
+ const resolvedTargets = targets.map(target => resolveTargetPath(target, resolutionBase));
272
276
  const extractOptions = {
273
277
  files: resolvedTargets,
274
- cwd: effectiveCwd,
278
+ cwd: resolutionBase,
275
279
  allowTests: allow_tests ?? true
276
280
  };
277
281
 
@@ -13932,6 +13932,17 @@ var init_AwsRestXmlProtocol = __esm({
13932
13932
  }
13933
13933
  async handleError(operationSchema, context, response, dataObject, metadata) {
13934
13934
  const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? "Unknown";
13935
+ if (dataObject.Error && typeof dataObject.Error === "object") {
13936
+ for (const key of Object.keys(dataObject.Error)) {
13937
+ dataObject[key] = dataObject.Error[key];
13938
+ if (key.toLowerCase() === "message") {
13939
+ dataObject.message = dataObject.Error[key];
13940
+ }
13941
+ }
13942
+ }
13943
+ if (dataObject.RequestId && !metadata.requestId) {
13944
+ metadata.requestId = dataObject.RequestId;
13945
+ }
13935
13946
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
13936
13947
  const ns = NormalizedSchema.of(errorSchema);
13937
13948
  const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown";
@@ -17448,7 +17459,7 @@ var require_package2 = __commonJS({
17448
17459
  module2.exports = {
17449
17460
  name: "@aws-sdk/client-bedrock-runtime",
17450
17461
  description: "AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",
17451
- version: "3.984.0",
17462
+ version: "3.986.0",
17452
17463
  scripts: {
17453
17464
  build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
17454
17465
  "build:cjs": "node ../../scripts/compilation/inline client-bedrock-runtime",
@@ -17468,23 +17479,23 @@ var require_package2 = __commonJS({
17468
17479
  dependencies: {
17469
17480
  "@aws-crypto/sha256-browser": "5.2.0",
17470
17481
  "@aws-crypto/sha256-js": "5.2.0",
17471
- "@aws-sdk/core": "^3.973.6",
17472
- "@aws-sdk/credential-provider-node": "^3.972.5",
17482
+ "@aws-sdk/core": "^3.973.7",
17483
+ "@aws-sdk/credential-provider-node": "^3.972.6",
17473
17484
  "@aws-sdk/eventstream-handler-node": "^3.972.5",
17474
17485
  "@aws-sdk/middleware-eventstream": "^3.972.3",
17475
17486
  "@aws-sdk/middleware-host-header": "^3.972.3",
17476
17487
  "@aws-sdk/middleware-logger": "^3.972.3",
17477
17488
  "@aws-sdk/middleware-recursion-detection": "^3.972.3",
17478
- "@aws-sdk/middleware-user-agent": "^3.972.6",
17479
- "@aws-sdk/middleware-websocket": "^3.972.5",
17489
+ "@aws-sdk/middleware-user-agent": "^3.972.7",
17490
+ "@aws-sdk/middleware-websocket": "^3.972.6",
17480
17491
  "@aws-sdk/region-config-resolver": "^3.972.3",
17481
- "@aws-sdk/token-providers": "3.984.0",
17492
+ "@aws-sdk/token-providers": "3.986.0",
17482
17493
  "@aws-sdk/types": "^3.973.1",
17483
- "@aws-sdk/util-endpoints": "3.984.0",
17494
+ "@aws-sdk/util-endpoints": "3.986.0",
17484
17495
  "@aws-sdk/util-user-agent-browser": "^3.972.3",
17485
- "@aws-sdk/util-user-agent-node": "^3.972.4",
17496
+ "@aws-sdk/util-user-agent-node": "^3.972.5",
17486
17497
  "@smithy/config-resolver": "^4.4.6",
17487
- "@smithy/core": "^3.22.0",
17498
+ "@smithy/core": "^3.22.1",
17488
17499
  "@smithy/eventstream-serde-browser": "^4.2.8",
17489
17500
  "@smithy/eventstream-serde-config-resolver": "^4.3.8",
17490
17501
  "@smithy/eventstream-serde-node": "^4.2.8",
@@ -17492,25 +17503,25 @@ var require_package2 = __commonJS({
17492
17503
  "@smithy/hash-node": "^4.2.8",
17493
17504
  "@smithy/invalid-dependency": "^4.2.8",
17494
17505
  "@smithy/middleware-content-length": "^4.2.8",
17495
- "@smithy/middleware-endpoint": "^4.4.12",
17496
- "@smithy/middleware-retry": "^4.4.29",
17506
+ "@smithy/middleware-endpoint": "^4.4.13",
17507
+ "@smithy/middleware-retry": "^4.4.30",
17497
17508
  "@smithy/middleware-serde": "^4.2.9",
17498
17509
  "@smithy/middleware-stack": "^4.2.8",
17499
17510
  "@smithy/node-config-provider": "^4.3.8",
17500
- "@smithy/node-http-handler": "^4.4.8",
17511
+ "@smithy/node-http-handler": "^4.4.9",
17501
17512
  "@smithy/protocol-http": "^5.3.8",
17502
- "@smithy/smithy-client": "^4.11.1",
17513
+ "@smithy/smithy-client": "^4.11.2",
17503
17514
  "@smithy/types": "^4.12.0",
17504
17515
  "@smithy/url-parser": "^4.2.8",
17505
17516
  "@smithy/util-base64": "^4.3.0",
17506
17517
  "@smithy/util-body-length-browser": "^4.2.0",
17507
17518
  "@smithy/util-body-length-node": "^4.2.1",
17508
- "@smithy/util-defaults-mode-browser": "^4.3.28",
17509
- "@smithy/util-defaults-mode-node": "^4.2.31",
17519
+ "@smithy/util-defaults-mode-browser": "^4.3.29",
17520
+ "@smithy/util-defaults-mode-node": "^4.2.32",
17510
17521
  "@smithy/util-endpoints": "^3.2.8",
17511
17522
  "@smithy/util-middleware": "^4.2.8",
17512
17523
  "@smithy/util-retry": "^4.2.8",
17513
- "@smithy/util-stream": "^4.5.10",
17524
+ "@smithy/util-stream": "^4.5.11",
17514
17525
  "@smithy/util-utf8": "^4.2.0",
17515
17526
  tslib: "^2.6.2"
17516
17527
  },
@@ -18229,7 +18240,7 @@ var init_package = __esm({
18229
18240
  "node_modules/@aws-sdk/nested-clients/package.json"() {
18230
18241
  package_default = {
18231
18242
  name: "@aws-sdk/nested-clients",
18232
- version: "3.982.0",
18243
+ version: "3.985.0",
18233
18244
  description: "Nested clients for AWS SDK packages.",
18234
18245
  main: "./dist-cjs/index.js",
18235
18246
  module: "./dist-es/index.js",
@@ -18258,37 +18269,37 @@ var init_package = __esm({
18258
18269
  dependencies: {
18259
18270
  "@aws-crypto/sha256-browser": "5.2.0",
18260
18271
  "@aws-crypto/sha256-js": "5.2.0",
18261
- "@aws-sdk/core": "^3.973.6",
18272
+ "@aws-sdk/core": "^3.973.7",
18262
18273
  "@aws-sdk/middleware-host-header": "^3.972.3",
18263
18274
  "@aws-sdk/middleware-logger": "^3.972.3",
18264
18275
  "@aws-sdk/middleware-recursion-detection": "^3.972.3",
18265
- "@aws-sdk/middleware-user-agent": "^3.972.6",
18276
+ "@aws-sdk/middleware-user-agent": "^3.972.7",
18266
18277
  "@aws-sdk/region-config-resolver": "^3.972.3",
18267
18278
  "@aws-sdk/types": "^3.973.1",
18268
- "@aws-sdk/util-endpoints": "3.982.0",
18279
+ "@aws-sdk/util-endpoints": "3.985.0",
18269
18280
  "@aws-sdk/util-user-agent-browser": "^3.972.3",
18270
- "@aws-sdk/util-user-agent-node": "^3.972.4",
18281
+ "@aws-sdk/util-user-agent-node": "^3.972.5",
18271
18282
  "@smithy/config-resolver": "^4.4.6",
18272
- "@smithy/core": "^3.22.0",
18283
+ "@smithy/core": "^3.22.1",
18273
18284
  "@smithy/fetch-http-handler": "^5.3.9",
18274
18285
  "@smithy/hash-node": "^4.2.8",
18275
18286
  "@smithy/invalid-dependency": "^4.2.8",
18276
18287
  "@smithy/middleware-content-length": "^4.2.8",
18277
- "@smithy/middleware-endpoint": "^4.4.12",
18278
- "@smithy/middleware-retry": "^4.4.29",
18288
+ "@smithy/middleware-endpoint": "^4.4.13",
18289
+ "@smithy/middleware-retry": "^4.4.30",
18279
18290
  "@smithy/middleware-serde": "^4.2.9",
18280
18291
  "@smithy/middleware-stack": "^4.2.8",
18281
18292
  "@smithy/node-config-provider": "^4.3.8",
18282
- "@smithy/node-http-handler": "^4.4.8",
18293
+ "@smithy/node-http-handler": "^4.4.9",
18283
18294
  "@smithy/protocol-http": "^5.3.8",
18284
- "@smithy/smithy-client": "^4.11.1",
18295
+ "@smithy/smithy-client": "^4.11.2",
18285
18296
  "@smithy/types": "^4.12.0",
18286
18297
  "@smithy/url-parser": "^4.2.8",
18287
18298
  "@smithy/util-base64": "^4.3.0",
18288
18299
  "@smithy/util-body-length-browser": "^4.2.0",
18289
18300
  "@smithy/util-body-length-node": "^4.2.1",
18290
- "@smithy/util-defaults-mode-browser": "^4.3.28",
18291
- "@smithy/util-defaults-mode-node": "^4.2.31",
18301
+ "@smithy/util-defaults-mode-browser": "^4.3.29",
18302
+ "@smithy/util-defaults-mode-node": "^4.2.32",
18292
18303
  "@smithy/util-endpoints": "^3.2.8",
18293
18304
  "@smithy/util-middleware": "^4.2.8",
18294
18305
  "@smithy/util-retry": "^4.2.8",
@@ -20027,7 +20038,7 @@ var require_package3 = __commonJS({
20027
20038
  module2.exports = {
20028
20039
  name: "@aws-sdk/client-sso",
20029
20040
  description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",
20030
- version: "3.982.0",
20041
+ version: "3.985.0",
20031
20042
  scripts: {
20032
20043
  build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
20033
20044
  "build:cjs": "node ../../scripts/compilation/inline client-sso",
@@ -20047,37 +20058,37 @@ var require_package3 = __commonJS({
20047
20058
  dependencies: {
20048
20059
  "@aws-crypto/sha256-browser": "5.2.0",
20049
20060
  "@aws-crypto/sha256-js": "5.2.0",
20050
- "@aws-sdk/core": "^3.973.6",
20061
+ "@aws-sdk/core": "^3.973.7",
20051
20062
  "@aws-sdk/middleware-host-header": "^3.972.3",
20052
20063
  "@aws-sdk/middleware-logger": "^3.972.3",
20053
20064
  "@aws-sdk/middleware-recursion-detection": "^3.972.3",
20054
- "@aws-sdk/middleware-user-agent": "^3.972.6",
20065
+ "@aws-sdk/middleware-user-agent": "^3.972.7",
20055
20066
  "@aws-sdk/region-config-resolver": "^3.972.3",
20056
20067
  "@aws-sdk/types": "^3.973.1",
20057
- "@aws-sdk/util-endpoints": "3.982.0",
20068
+ "@aws-sdk/util-endpoints": "3.985.0",
20058
20069
  "@aws-sdk/util-user-agent-browser": "^3.972.3",
20059
- "@aws-sdk/util-user-agent-node": "^3.972.4",
20070
+ "@aws-sdk/util-user-agent-node": "^3.972.5",
20060
20071
  "@smithy/config-resolver": "^4.4.6",
20061
- "@smithy/core": "^3.22.0",
20072
+ "@smithy/core": "^3.22.1",
20062
20073
  "@smithy/fetch-http-handler": "^5.3.9",
20063
20074
  "@smithy/hash-node": "^4.2.8",
20064
20075
  "@smithy/invalid-dependency": "^4.2.8",
20065
20076
  "@smithy/middleware-content-length": "^4.2.8",
20066
- "@smithy/middleware-endpoint": "^4.4.12",
20067
- "@smithy/middleware-retry": "^4.4.29",
20077
+ "@smithy/middleware-endpoint": "^4.4.13",
20078
+ "@smithy/middleware-retry": "^4.4.30",
20068
20079
  "@smithy/middleware-serde": "^4.2.9",
20069
20080
  "@smithy/middleware-stack": "^4.2.8",
20070
20081
  "@smithy/node-config-provider": "^4.3.8",
20071
- "@smithy/node-http-handler": "^4.4.8",
20082
+ "@smithy/node-http-handler": "^4.4.9",
20072
20083
  "@smithy/protocol-http": "^5.3.8",
20073
- "@smithy/smithy-client": "^4.11.1",
20084
+ "@smithy/smithy-client": "^4.11.2",
20074
20085
  "@smithy/types": "^4.12.0",
20075
20086
  "@smithy/url-parser": "^4.2.8",
20076
20087
  "@smithy/util-base64": "^4.3.0",
20077
20088
  "@smithy/util-body-length-browser": "^4.2.0",
20078
20089
  "@smithy/util-body-length-node": "^4.2.1",
20079
- "@smithy/util-defaults-mode-browser": "^4.3.28",
20080
- "@smithy/util-defaults-mode-node": "^4.2.31",
20090
+ "@smithy/util-defaults-mode-browser": "^4.3.29",
20091
+ "@smithy/util-defaults-mode-node": "^4.2.32",
20081
20092
  "@smithy/util-endpoints": "^3.2.8",
20082
20093
  "@smithy/util-middleware": "^4.2.8",
20083
20094
  "@smithy/util-retry": "^4.2.8",
@@ -23983,7 +23994,7 @@ var init_package2 = __esm({
23983
23994
  "node_modules/@aws-sdk/token-providers/node_modules/@aws-sdk/nested-clients/package.json"() {
23984
23995
  package_default2 = {
23985
23996
  name: "@aws-sdk/nested-clients",
23986
- version: "3.984.0",
23997
+ version: "3.986.0",
23987
23998
  description: "Nested clients for AWS SDK packages.",
23988
23999
  main: "./dist-cjs/index.js",
23989
24000
  module: "./dist-es/index.js",
@@ -24012,37 +24023,37 @@ var init_package2 = __esm({
24012
24023
  dependencies: {
24013
24024
  "@aws-crypto/sha256-browser": "5.2.0",
24014
24025
  "@aws-crypto/sha256-js": "5.2.0",
24015
- "@aws-sdk/core": "^3.973.6",
24026
+ "@aws-sdk/core": "^3.973.7",
24016
24027
  "@aws-sdk/middleware-host-header": "^3.972.3",
24017
24028
  "@aws-sdk/middleware-logger": "^3.972.3",
24018
24029
  "@aws-sdk/middleware-recursion-detection": "^3.972.3",
24019
- "@aws-sdk/middleware-user-agent": "^3.972.6",
24030
+ "@aws-sdk/middleware-user-agent": "^3.972.7",
24020
24031
  "@aws-sdk/region-config-resolver": "^3.972.3",
24021
24032
  "@aws-sdk/types": "^3.973.1",
24022
- "@aws-sdk/util-endpoints": "3.984.0",
24033
+ "@aws-sdk/util-endpoints": "3.986.0",
24023
24034
  "@aws-sdk/util-user-agent-browser": "^3.972.3",
24024
- "@aws-sdk/util-user-agent-node": "^3.972.4",
24035
+ "@aws-sdk/util-user-agent-node": "^3.972.5",
24025
24036
  "@smithy/config-resolver": "^4.4.6",
24026
- "@smithy/core": "^3.22.0",
24037
+ "@smithy/core": "^3.22.1",
24027
24038
  "@smithy/fetch-http-handler": "^5.3.9",
24028
24039
  "@smithy/hash-node": "^4.2.8",
24029
24040
  "@smithy/invalid-dependency": "^4.2.8",
24030
24041
  "@smithy/middleware-content-length": "^4.2.8",
24031
- "@smithy/middleware-endpoint": "^4.4.12",
24032
- "@smithy/middleware-retry": "^4.4.29",
24042
+ "@smithy/middleware-endpoint": "^4.4.13",
24043
+ "@smithy/middleware-retry": "^4.4.30",
24033
24044
  "@smithy/middleware-serde": "^4.2.9",
24034
24045
  "@smithy/middleware-stack": "^4.2.8",
24035
24046
  "@smithy/node-config-provider": "^4.3.8",
24036
- "@smithy/node-http-handler": "^4.4.8",
24047
+ "@smithy/node-http-handler": "^4.4.9",
24037
24048
  "@smithy/protocol-http": "^5.3.8",
24038
- "@smithy/smithy-client": "^4.11.1",
24049
+ "@smithy/smithy-client": "^4.11.2",
24039
24050
  "@smithy/types": "^4.12.0",
24040
24051
  "@smithy/url-parser": "^4.2.8",
24041
24052
  "@smithy/util-base64": "^4.3.0",
24042
24053
  "@smithy/util-body-length-browser": "^4.2.0",
24043
24054
  "@smithy/util-body-length-node": "^4.2.1",
24044
- "@smithy/util-defaults-mode-browser": "^4.3.28",
24045
- "@smithy/util-defaults-mode-node": "^4.2.31",
24055
+ "@smithy/util-defaults-mode-browser": "^4.3.29",
24056
+ "@smithy/util-defaults-mode-node": "^4.2.32",
24046
24057
  "@smithy/util-endpoints": "^3.2.8",
24047
24058
  "@smithy/util-middleware": "^4.2.8",
24048
24059
  "@smithy/util-retry": "^4.2.8",
@@ -39710,6 +39721,7 @@ function buildSearchDelegateTask({ searchQuery, searchPath, exact, language, all
39710
39721
  `Options: exact=${exact ? "true" : "false"}, language=${language || "auto"}, allow_tests=${allowTests ? "true" : "false"}.`,
39711
39722
  "",
39712
39723
  'Return ONLY valid JSON: {"targets": ["path/to/file.ext#Symbol", "path/to/file.ext:line", "path/to/file.ext:start-end"]}',
39724
+ 'IMPORTANT: Use ABSOLUTE file paths in targets (e.g., "/full/path/to/file.ext#Symbol"). If you only have relative paths, make them relative to the search path above.',
39713
39725
  "Prefer #Symbol when a function/class name is clear; otherwise use line numbers.",
39714
39726
  "Deduplicate targets. Do NOT explain or answer - ONLY return the JSON targets."
39715
39727
  ].join("\n");
@@ -39832,11 +39844,11 @@ var init_vercel = __esm({
39832
39844
  }
39833
39845
  return await runRawSearch();
39834
39846
  }
39835
- const effectiveCwd = options.cwd || ".";
39836
- const resolvedTargets = targets.map((target) => resolveTargetPath(target, effectiveCwd));
39847
+ const resolutionBase = searchPaths[0] || options.cwd || ".";
39848
+ const resolvedTargets = targets.map((target) => resolveTargetPath(target, resolutionBase));
39837
39849
  const extractOptions = {
39838
39850
  files: resolvedTargets,
39839
- cwd: effectiveCwd,
39851
+ cwd: resolutionBase,
39840
39852
  allowTests: allow_tests ?? true
39841
39853
  };
39842
39854
  if (outline) {
@@ -97667,8 +97679,6 @@ async function truncateIfNeeded(content, tokenCounter, sessionId, maxTokens) {
97667
97679
  if (tokenCount <= limit) {
97668
97680
  return { truncated: false, content };
97669
97681
  }
97670
- const maxChars = limit * CHARS_PER_TOKEN2;
97671
- const truncatedContent = content.substring(0, maxChars);
97672
97682
  let tempFilePath = null;
97673
97683
  let fileError = null;
97674
97684
  try {
@@ -97680,22 +97690,38 @@ async function truncateIfNeeded(content, tokenCounter, sessionId, maxTokens) {
97680
97690
  fileError = err.message || "Unknown file system error";
97681
97691
  tempFilePath = null;
97682
97692
  }
97693
+ let truncatedBody;
97694
+ const useTail = limit >= MIN_LIMIT_FOR_TAIL;
97695
+ if (useTail) {
97696
+ const headTokens = limit - TAIL_TOKENS;
97697
+ const headChars = headTokens * CHARS_PER_TOKEN2;
97698
+ const tailChars = TAIL_TOKENS * CHARS_PER_TOKEN2;
97699
+ const headContent = content.substring(0, headChars);
97700
+ const tailContent = content.substring(content.length - tailChars);
97701
+ const omittedTokens = tokenCount - headTokens - TAIL_TOKENS;
97702
+ truncatedBody = `${headContent}
97703
+
97704
+ ... ${omittedTokens} tokens omitted ...
97705
+
97706
+ ${tailContent}`;
97707
+ } else {
97708
+ const maxChars = limit * CHARS_PER_TOKEN2;
97709
+ truncatedBody = content.substring(0, maxChars);
97710
+ }
97683
97711
  let message;
97684
97712
  if (tempFilePath) {
97685
97713
  message = `Output exceeded maximum size (${tokenCount} tokens, limit: ${limit}).
97686
97714
  Full output saved to: ${tempFilePath}
97687
97715
 
97688
- --- Truncated Output (first ${limit} tokens approx) ---
97689
- ${truncatedContent}
97690
- ...
97716
+ --- Truncated Output ---
97717
+ ${truncatedBody}
97691
97718
  --- End of Truncated Output ---`;
97692
97719
  } else {
97693
97720
  message = `Output exceeded maximum size (${tokenCount} tokens, limit: ${limit}).
97694
97721
  Warning: Could not save full output to file (${fileError}).
97695
97722
 
97696
- --- Truncated Output (first ${limit} tokens approx) ---
97697
- ${truncatedContent}
97698
- ...
97723
+ --- Truncated Output ---
97724
+ ${truncatedBody}
97699
97725
  --- End of Truncated Output ---`;
97700
97726
  }
97701
97727
  return {
@@ -97706,7 +97732,7 @@ ${truncatedContent}
97706
97732
  error: fileError || void 0
97707
97733
  };
97708
97734
  }
97709
- var import_promises4, import_os4, import_path15, import_crypto5, DEFAULT_MAX_OUTPUT_TOKENS, CHARS_PER_TOKEN2;
97735
+ var import_promises4, import_os4, import_path15, import_crypto5, DEFAULT_MAX_OUTPUT_TOKENS, CHARS_PER_TOKEN2, TAIL_TOKENS, MIN_LIMIT_FOR_TAIL;
97710
97736
  var init_outputTruncator = __esm({
97711
97737
  "src/agent/outputTruncator.js"() {
97712
97738
  "use strict";
@@ -97716,6 +97742,8 @@ var init_outputTruncator = __esm({
97716
97742
  import_crypto5 = require("crypto");
97717
97743
  DEFAULT_MAX_OUTPUT_TOKENS = 2e4;
97718
97744
  CHARS_PER_TOKEN2 = 4;
97745
+ TAIL_TOKENS = 1e3;
97746
+ MIN_LIMIT_FOR_TAIL = 2e3;
97719
97747
  }
97720
97748
  });
97721
97749
 
package/cjs/index.cjs CHANGED
@@ -15766,6 +15766,17 @@ var init_AwsRestXmlProtocol = __esm({
15766
15766
  }
15767
15767
  async handleError(operationSchema, context, response, dataObject, metadata) {
15768
15768
  const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? "Unknown";
15769
+ if (dataObject.Error && typeof dataObject.Error === "object") {
15770
+ for (const key of Object.keys(dataObject.Error)) {
15771
+ dataObject[key] = dataObject.Error[key];
15772
+ if (key.toLowerCase() === "message") {
15773
+ dataObject.message = dataObject.Error[key];
15774
+ }
15775
+ }
15776
+ }
15777
+ if (dataObject.RequestId && !metadata.requestId) {
15778
+ metadata.requestId = dataObject.RequestId;
15779
+ }
15769
15780
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
15770
15781
  const ns = NormalizedSchema.of(errorSchema);
15771
15782
  const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown";
@@ -19282,7 +19293,7 @@ var require_package2 = __commonJS({
19282
19293
  module2.exports = {
19283
19294
  name: "@aws-sdk/client-bedrock-runtime",
19284
19295
  description: "AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",
19285
- version: "3.984.0",
19296
+ version: "3.986.0",
19286
19297
  scripts: {
19287
19298
  build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
19288
19299
  "build:cjs": "node ../../scripts/compilation/inline client-bedrock-runtime",
@@ -19302,23 +19313,23 @@ var require_package2 = __commonJS({
19302
19313
  dependencies: {
19303
19314
  "@aws-crypto/sha256-browser": "5.2.0",
19304
19315
  "@aws-crypto/sha256-js": "5.2.0",
19305
- "@aws-sdk/core": "^3.973.6",
19306
- "@aws-sdk/credential-provider-node": "^3.972.5",
19316
+ "@aws-sdk/core": "^3.973.7",
19317
+ "@aws-sdk/credential-provider-node": "^3.972.6",
19307
19318
  "@aws-sdk/eventstream-handler-node": "^3.972.5",
19308
19319
  "@aws-sdk/middleware-eventstream": "^3.972.3",
19309
19320
  "@aws-sdk/middleware-host-header": "^3.972.3",
19310
19321
  "@aws-sdk/middleware-logger": "^3.972.3",
19311
19322
  "@aws-sdk/middleware-recursion-detection": "^3.972.3",
19312
- "@aws-sdk/middleware-user-agent": "^3.972.6",
19313
- "@aws-sdk/middleware-websocket": "^3.972.5",
19323
+ "@aws-sdk/middleware-user-agent": "^3.972.7",
19324
+ "@aws-sdk/middleware-websocket": "^3.972.6",
19314
19325
  "@aws-sdk/region-config-resolver": "^3.972.3",
19315
- "@aws-sdk/token-providers": "3.984.0",
19326
+ "@aws-sdk/token-providers": "3.986.0",
19316
19327
  "@aws-sdk/types": "^3.973.1",
19317
- "@aws-sdk/util-endpoints": "3.984.0",
19328
+ "@aws-sdk/util-endpoints": "3.986.0",
19318
19329
  "@aws-sdk/util-user-agent-browser": "^3.972.3",
19319
- "@aws-sdk/util-user-agent-node": "^3.972.4",
19330
+ "@aws-sdk/util-user-agent-node": "^3.972.5",
19320
19331
  "@smithy/config-resolver": "^4.4.6",
19321
- "@smithy/core": "^3.22.0",
19332
+ "@smithy/core": "^3.22.1",
19322
19333
  "@smithy/eventstream-serde-browser": "^4.2.8",
19323
19334
  "@smithy/eventstream-serde-config-resolver": "^4.3.8",
19324
19335
  "@smithy/eventstream-serde-node": "^4.2.8",
@@ -19326,25 +19337,25 @@ var require_package2 = __commonJS({
19326
19337
  "@smithy/hash-node": "^4.2.8",
19327
19338
  "@smithy/invalid-dependency": "^4.2.8",
19328
19339
  "@smithy/middleware-content-length": "^4.2.8",
19329
- "@smithy/middleware-endpoint": "^4.4.12",
19330
- "@smithy/middleware-retry": "^4.4.29",
19340
+ "@smithy/middleware-endpoint": "^4.4.13",
19341
+ "@smithy/middleware-retry": "^4.4.30",
19331
19342
  "@smithy/middleware-serde": "^4.2.9",
19332
19343
  "@smithy/middleware-stack": "^4.2.8",
19333
19344
  "@smithy/node-config-provider": "^4.3.8",
19334
- "@smithy/node-http-handler": "^4.4.8",
19345
+ "@smithy/node-http-handler": "^4.4.9",
19335
19346
  "@smithy/protocol-http": "^5.3.8",
19336
- "@smithy/smithy-client": "^4.11.1",
19347
+ "@smithy/smithy-client": "^4.11.2",
19337
19348
  "@smithy/types": "^4.12.0",
19338
19349
  "@smithy/url-parser": "^4.2.8",
19339
19350
  "@smithy/util-base64": "^4.3.0",
19340
19351
  "@smithy/util-body-length-browser": "^4.2.0",
19341
19352
  "@smithy/util-body-length-node": "^4.2.1",
19342
- "@smithy/util-defaults-mode-browser": "^4.3.28",
19343
- "@smithy/util-defaults-mode-node": "^4.2.31",
19353
+ "@smithy/util-defaults-mode-browser": "^4.3.29",
19354
+ "@smithy/util-defaults-mode-node": "^4.2.32",
19344
19355
  "@smithy/util-endpoints": "^3.2.8",
19345
19356
  "@smithy/util-middleware": "^4.2.8",
19346
19357
  "@smithy/util-retry": "^4.2.8",
19347
- "@smithy/util-stream": "^4.5.10",
19358
+ "@smithy/util-stream": "^4.5.11",
19348
19359
  "@smithy/util-utf8": "^4.2.0",
19349
19360
  tslib: "^2.6.2"
19350
19361
  },
@@ -20063,7 +20074,7 @@ var init_package = __esm({
20063
20074
  "node_modules/@aws-sdk/nested-clients/package.json"() {
20064
20075
  package_default = {
20065
20076
  name: "@aws-sdk/nested-clients",
20066
- version: "3.982.0",
20077
+ version: "3.985.0",
20067
20078
  description: "Nested clients for AWS SDK packages.",
20068
20079
  main: "./dist-cjs/index.js",
20069
20080
  module: "./dist-es/index.js",
@@ -20092,37 +20103,37 @@ var init_package = __esm({
20092
20103
  dependencies: {
20093
20104
  "@aws-crypto/sha256-browser": "5.2.0",
20094
20105
  "@aws-crypto/sha256-js": "5.2.0",
20095
- "@aws-sdk/core": "^3.973.6",
20106
+ "@aws-sdk/core": "^3.973.7",
20096
20107
  "@aws-sdk/middleware-host-header": "^3.972.3",
20097
20108
  "@aws-sdk/middleware-logger": "^3.972.3",
20098
20109
  "@aws-sdk/middleware-recursion-detection": "^3.972.3",
20099
- "@aws-sdk/middleware-user-agent": "^3.972.6",
20110
+ "@aws-sdk/middleware-user-agent": "^3.972.7",
20100
20111
  "@aws-sdk/region-config-resolver": "^3.972.3",
20101
20112
  "@aws-sdk/types": "^3.973.1",
20102
- "@aws-sdk/util-endpoints": "3.982.0",
20113
+ "@aws-sdk/util-endpoints": "3.985.0",
20103
20114
  "@aws-sdk/util-user-agent-browser": "^3.972.3",
20104
- "@aws-sdk/util-user-agent-node": "^3.972.4",
20115
+ "@aws-sdk/util-user-agent-node": "^3.972.5",
20105
20116
  "@smithy/config-resolver": "^4.4.6",
20106
- "@smithy/core": "^3.22.0",
20117
+ "@smithy/core": "^3.22.1",
20107
20118
  "@smithy/fetch-http-handler": "^5.3.9",
20108
20119
  "@smithy/hash-node": "^4.2.8",
20109
20120
  "@smithy/invalid-dependency": "^4.2.8",
20110
20121
  "@smithy/middleware-content-length": "^4.2.8",
20111
- "@smithy/middleware-endpoint": "^4.4.12",
20112
- "@smithy/middleware-retry": "^4.4.29",
20122
+ "@smithy/middleware-endpoint": "^4.4.13",
20123
+ "@smithy/middleware-retry": "^4.4.30",
20113
20124
  "@smithy/middleware-serde": "^4.2.9",
20114
20125
  "@smithy/middleware-stack": "^4.2.8",
20115
20126
  "@smithy/node-config-provider": "^4.3.8",
20116
- "@smithy/node-http-handler": "^4.4.8",
20127
+ "@smithy/node-http-handler": "^4.4.9",
20117
20128
  "@smithy/protocol-http": "^5.3.8",
20118
- "@smithy/smithy-client": "^4.11.1",
20129
+ "@smithy/smithy-client": "^4.11.2",
20119
20130
  "@smithy/types": "^4.12.0",
20120
20131
  "@smithy/url-parser": "^4.2.8",
20121
20132
  "@smithy/util-base64": "^4.3.0",
20122
20133
  "@smithy/util-body-length-browser": "^4.2.0",
20123
20134
  "@smithy/util-body-length-node": "^4.2.1",
20124
- "@smithy/util-defaults-mode-browser": "^4.3.28",
20125
- "@smithy/util-defaults-mode-node": "^4.2.31",
20135
+ "@smithy/util-defaults-mode-browser": "^4.3.29",
20136
+ "@smithy/util-defaults-mode-node": "^4.2.32",
20126
20137
  "@smithy/util-endpoints": "^3.2.8",
20127
20138
  "@smithy/util-middleware": "^4.2.8",
20128
20139
  "@smithy/util-retry": "^4.2.8",
@@ -21861,7 +21872,7 @@ var require_package3 = __commonJS({
21861
21872
  module2.exports = {
21862
21873
  name: "@aws-sdk/client-sso",
21863
21874
  description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",
21864
- version: "3.982.0",
21875
+ version: "3.985.0",
21865
21876
  scripts: {
21866
21877
  build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
21867
21878
  "build:cjs": "node ../../scripts/compilation/inline client-sso",
@@ -21881,37 +21892,37 @@ var require_package3 = __commonJS({
21881
21892
  dependencies: {
21882
21893
  "@aws-crypto/sha256-browser": "5.2.0",
21883
21894
  "@aws-crypto/sha256-js": "5.2.0",
21884
- "@aws-sdk/core": "^3.973.6",
21895
+ "@aws-sdk/core": "^3.973.7",
21885
21896
  "@aws-sdk/middleware-host-header": "^3.972.3",
21886
21897
  "@aws-sdk/middleware-logger": "^3.972.3",
21887
21898
  "@aws-sdk/middleware-recursion-detection": "^3.972.3",
21888
- "@aws-sdk/middleware-user-agent": "^3.972.6",
21899
+ "@aws-sdk/middleware-user-agent": "^3.972.7",
21889
21900
  "@aws-sdk/region-config-resolver": "^3.972.3",
21890
21901
  "@aws-sdk/types": "^3.973.1",
21891
- "@aws-sdk/util-endpoints": "3.982.0",
21902
+ "@aws-sdk/util-endpoints": "3.985.0",
21892
21903
  "@aws-sdk/util-user-agent-browser": "^3.972.3",
21893
- "@aws-sdk/util-user-agent-node": "^3.972.4",
21904
+ "@aws-sdk/util-user-agent-node": "^3.972.5",
21894
21905
  "@smithy/config-resolver": "^4.4.6",
21895
- "@smithy/core": "^3.22.0",
21906
+ "@smithy/core": "^3.22.1",
21896
21907
  "@smithy/fetch-http-handler": "^5.3.9",
21897
21908
  "@smithy/hash-node": "^4.2.8",
21898
21909
  "@smithy/invalid-dependency": "^4.2.8",
21899
21910
  "@smithy/middleware-content-length": "^4.2.8",
21900
- "@smithy/middleware-endpoint": "^4.4.12",
21901
- "@smithy/middleware-retry": "^4.4.29",
21911
+ "@smithy/middleware-endpoint": "^4.4.13",
21912
+ "@smithy/middleware-retry": "^4.4.30",
21902
21913
  "@smithy/middleware-serde": "^4.2.9",
21903
21914
  "@smithy/middleware-stack": "^4.2.8",
21904
21915
  "@smithy/node-config-provider": "^4.3.8",
21905
- "@smithy/node-http-handler": "^4.4.8",
21916
+ "@smithy/node-http-handler": "^4.4.9",
21906
21917
  "@smithy/protocol-http": "^5.3.8",
21907
- "@smithy/smithy-client": "^4.11.1",
21918
+ "@smithy/smithy-client": "^4.11.2",
21908
21919
  "@smithy/types": "^4.12.0",
21909
21920
  "@smithy/url-parser": "^4.2.8",
21910
21921
  "@smithy/util-base64": "^4.3.0",
21911
21922
  "@smithy/util-body-length-browser": "^4.2.0",
21912
21923
  "@smithy/util-body-length-node": "^4.2.1",
21913
- "@smithy/util-defaults-mode-browser": "^4.3.28",
21914
- "@smithy/util-defaults-mode-node": "^4.2.31",
21924
+ "@smithy/util-defaults-mode-browser": "^4.3.29",
21925
+ "@smithy/util-defaults-mode-node": "^4.2.32",
21915
21926
  "@smithy/util-endpoints": "^3.2.8",
21916
21927
  "@smithy/util-middleware": "^4.2.8",
21917
21928
  "@smithy/util-retry": "^4.2.8",
@@ -25817,7 +25828,7 @@ var init_package2 = __esm({
25817
25828
  "node_modules/@aws-sdk/token-providers/node_modules/@aws-sdk/nested-clients/package.json"() {
25818
25829
  package_default2 = {
25819
25830
  name: "@aws-sdk/nested-clients",
25820
- version: "3.984.0",
25831
+ version: "3.986.0",
25821
25832
  description: "Nested clients for AWS SDK packages.",
25822
25833
  main: "./dist-cjs/index.js",
25823
25834
  module: "./dist-es/index.js",
@@ -25846,37 +25857,37 @@ var init_package2 = __esm({
25846
25857
  dependencies: {
25847
25858
  "@aws-crypto/sha256-browser": "5.2.0",
25848
25859
  "@aws-crypto/sha256-js": "5.2.0",
25849
- "@aws-sdk/core": "^3.973.6",
25860
+ "@aws-sdk/core": "^3.973.7",
25850
25861
  "@aws-sdk/middleware-host-header": "^3.972.3",
25851
25862
  "@aws-sdk/middleware-logger": "^3.972.3",
25852
25863
  "@aws-sdk/middleware-recursion-detection": "^3.972.3",
25853
- "@aws-sdk/middleware-user-agent": "^3.972.6",
25864
+ "@aws-sdk/middleware-user-agent": "^3.972.7",
25854
25865
  "@aws-sdk/region-config-resolver": "^3.972.3",
25855
25866
  "@aws-sdk/types": "^3.973.1",
25856
- "@aws-sdk/util-endpoints": "3.984.0",
25867
+ "@aws-sdk/util-endpoints": "3.986.0",
25857
25868
  "@aws-sdk/util-user-agent-browser": "^3.972.3",
25858
- "@aws-sdk/util-user-agent-node": "^3.972.4",
25869
+ "@aws-sdk/util-user-agent-node": "^3.972.5",
25859
25870
  "@smithy/config-resolver": "^4.4.6",
25860
- "@smithy/core": "^3.22.0",
25871
+ "@smithy/core": "^3.22.1",
25861
25872
  "@smithy/fetch-http-handler": "^5.3.9",
25862
25873
  "@smithy/hash-node": "^4.2.8",
25863
25874
  "@smithy/invalid-dependency": "^4.2.8",
25864
25875
  "@smithy/middleware-content-length": "^4.2.8",
25865
- "@smithy/middleware-endpoint": "^4.4.12",
25866
- "@smithy/middleware-retry": "^4.4.29",
25876
+ "@smithy/middleware-endpoint": "^4.4.13",
25877
+ "@smithy/middleware-retry": "^4.4.30",
25867
25878
  "@smithy/middleware-serde": "^4.2.9",
25868
25879
  "@smithy/middleware-stack": "^4.2.8",
25869
25880
  "@smithy/node-config-provider": "^4.3.8",
25870
- "@smithy/node-http-handler": "^4.4.8",
25881
+ "@smithy/node-http-handler": "^4.4.9",
25871
25882
  "@smithy/protocol-http": "^5.3.8",
25872
- "@smithy/smithy-client": "^4.11.1",
25883
+ "@smithy/smithy-client": "^4.11.2",
25873
25884
  "@smithy/types": "^4.12.0",
25874
25885
  "@smithy/url-parser": "^4.2.8",
25875
25886
  "@smithy/util-base64": "^4.3.0",
25876
25887
  "@smithy/util-body-length-browser": "^4.2.0",
25877
25888
  "@smithy/util-body-length-node": "^4.2.1",
25878
- "@smithy/util-defaults-mode-browser": "^4.3.28",
25879
- "@smithy/util-defaults-mode-node": "^4.2.31",
25889
+ "@smithy/util-defaults-mode-browser": "^4.3.29",
25890
+ "@smithy/util-defaults-mode-node": "^4.2.32",
25880
25891
  "@smithy/util-endpoints": "^3.2.8",
25881
25892
  "@smithy/util-middleware": "^4.2.8",
25882
25893
  "@smithy/util-retry": "^4.2.8",
@@ -94401,8 +94412,6 @@ async function truncateIfNeeded(content, tokenCounter, sessionId, maxTokens) {
94401
94412
  if (tokenCount <= limit) {
94402
94413
  return { truncated: false, content };
94403
94414
  }
94404
- const maxChars = limit * CHARS_PER_TOKEN;
94405
- const truncatedContent = content.substring(0, maxChars);
94406
94415
  let tempFilePath = null;
94407
94416
  let fileError = null;
94408
94417
  try {
@@ -94414,22 +94423,38 @@ async function truncateIfNeeded(content, tokenCounter, sessionId, maxTokens) {
94414
94423
  fileError = err.message || "Unknown file system error";
94415
94424
  tempFilePath = null;
94416
94425
  }
94426
+ let truncatedBody;
94427
+ const useTail = limit >= MIN_LIMIT_FOR_TAIL;
94428
+ if (useTail) {
94429
+ const headTokens = limit - TAIL_TOKENS;
94430
+ const headChars = headTokens * CHARS_PER_TOKEN;
94431
+ const tailChars = TAIL_TOKENS * CHARS_PER_TOKEN;
94432
+ const headContent = content.substring(0, headChars);
94433
+ const tailContent = content.substring(content.length - tailChars);
94434
+ const omittedTokens = tokenCount - headTokens - TAIL_TOKENS;
94435
+ truncatedBody = `${headContent}
94436
+
94437
+ ... ${omittedTokens} tokens omitted ...
94438
+
94439
+ ${tailContent}`;
94440
+ } else {
94441
+ const maxChars = limit * CHARS_PER_TOKEN;
94442
+ truncatedBody = content.substring(0, maxChars);
94443
+ }
94417
94444
  let message;
94418
94445
  if (tempFilePath) {
94419
94446
  message = `Output exceeded maximum size (${tokenCount} tokens, limit: ${limit}).
94420
94447
  Full output saved to: ${tempFilePath}
94421
94448
 
94422
- --- Truncated Output (first ${limit} tokens approx) ---
94423
- ${truncatedContent}
94424
- ...
94449
+ --- Truncated Output ---
94450
+ ${truncatedBody}
94425
94451
  --- End of Truncated Output ---`;
94426
94452
  } else {
94427
94453
  message = `Output exceeded maximum size (${tokenCount} tokens, limit: ${limit}).
94428
94454
  Warning: Could not save full output to file (${fileError}).
94429
94455
 
94430
- --- Truncated Output (first ${limit} tokens approx) ---
94431
- ${truncatedContent}
94432
- ...
94456
+ --- Truncated Output ---
94457
+ ${truncatedBody}
94433
94458
  --- End of Truncated Output ---`;
94434
94459
  }
94435
94460
  return {
@@ -94440,7 +94465,7 @@ ${truncatedContent}
94440
94465
  error: fileError || void 0
94441
94466
  };
94442
94467
  }
94443
- var import_promises4, import_os4, import_path11, import_crypto4, DEFAULT_MAX_OUTPUT_TOKENS, CHARS_PER_TOKEN;
94468
+ var import_promises4, import_os4, import_path11, import_crypto4, DEFAULT_MAX_OUTPUT_TOKENS, CHARS_PER_TOKEN, TAIL_TOKENS, MIN_LIMIT_FOR_TAIL;
94444
94469
  var init_outputTruncator = __esm({
94445
94470
  "src/agent/outputTruncator.js"() {
94446
94471
  "use strict";
@@ -94450,6 +94475,8 @@ var init_outputTruncator = __esm({
94450
94475
  import_crypto4 = require("crypto");
94451
94476
  DEFAULT_MAX_OUTPUT_TOKENS = 2e4;
94452
94477
  CHARS_PER_TOKEN = 4;
94478
+ TAIL_TOKENS = 1e3;
94479
+ MIN_LIMIT_FOR_TAIL = 2e3;
94453
94480
  }
94454
94481
  });
94455
94482
 
@@ -100723,6 +100750,7 @@ function buildSearchDelegateTask({ searchQuery, searchPath, exact, language, all
100723
100750
  `Options: exact=${exact ? "true" : "false"}, language=${language || "auto"}, allow_tests=${allowTests ? "true" : "false"}.`,
100724
100751
  "",
100725
100752
  'Return ONLY valid JSON: {"targets": ["path/to/file.ext#Symbol", "path/to/file.ext:line", "path/to/file.ext:start-end"]}',
100753
+ 'IMPORTANT: Use ABSOLUTE file paths in targets (e.g., "/full/path/to/file.ext#Symbol"). If you only have relative paths, make them relative to the search path above.',
100726
100754
  "Prefer #Symbol when a function/class name is clear; otherwise use line numbers.",
100727
100755
  "Deduplicate targets. Do NOT explain or answer - ONLY return the JSON targets."
100728
100756
  ].join("\n");
@@ -100845,11 +100873,11 @@ var init_vercel = __esm({
100845
100873
  }
100846
100874
  return await runRawSearch();
100847
100875
  }
100848
- const effectiveCwd = options.cwd || ".";
100849
- const resolvedTargets = targets.map((target) => resolveTargetPath(target, effectiveCwd));
100876
+ const resolutionBase = searchPaths[0] || options.cwd || ".";
100877
+ const resolvedTargets = targets.map((target) => resolveTargetPath(target, resolutionBase));
100850
100878
  const extractOptions = {
100851
100879
  files: resolvedTargets,
100852
- cwd: effectiveCwd,
100880
+ cwd: resolutionBase,
100853
100881
  allowTests: allow_tests ?? true
100854
100882
  };
100855
100883
  if (outline) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@probelabs/probe",
3
- "version": "0.6.0-rc227",
3
+ "version": "0.6.0-rc229",
4
4
  "description": "Node.js wrapper for the probe code search tool",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
@@ -5,6 +5,8 @@ import { randomUUID } from 'crypto';
5
5
 
6
6
  const DEFAULT_MAX_OUTPUT_TOKENS = 20000;
7
7
  const CHARS_PER_TOKEN = 4; // Conservative approximation
8
+ const TAIL_TOKENS = 1000; // Number of tokens to show from the end of truncated output
9
+ const MIN_LIMIT_FOR_TAIL = 2000; // Minimum token limit to use head+tail split
8
10
 
9
11
  /**
10
12
  * Validate and normalize a token limit value.
@@ -61,10 +63,6 @@ export async function truncateIfNeeded(content, tokenCounter, sessionId, maxToke
61
63
  return { truncated: false, content };
62
64
  }
63
65
 
64
- // Truncate to approximately maxTokens worth of characters
65
- const maxChars = limit * CHARS_PER_TOKEN;
66
- const truncatedContent = content.substring(0, maxChars);
67
-
68
66
  // Try to write full output to temp file
69
67
  let tempFilePath = null;
70
68
  let fileError = null;
@@ -79,22 +77,37 @@ export async function truncateIfNeeded(content, tokenCounter, sessionId, maxToke
79
77
  tempFilePath = null;
80
78
  }
81
79
 
80
+ // Build truncated content with head + tail for better context
81
+ let truncatedBody;
82
+ const useTail = limit >= MIN_LIMIT_FOR_TAIL;
83
+
84
+ if (useTail) {
85
+ const headTokens = limit - TAIL_TOKENS;
86
+ const headChars = headTokens * CHARS_PER_TOKEN;
87
+ const tailChars = TAIL_TOKENS * CHARS_PER_TOKEN;
88
+ const headContent = content.substring(0, headChars);
89
+ const tailContent = content.substring(content.length - tailChars);
90
+ const omittedTokens = tokenCount - headTokens - TAIL_TOKENS;
91
+ truncatedBody = `${headContent}\n\n... ${omittedTokens} tokens omitted ...\n\n${tailContent}`;
92
+ } else {
93
+ const maxChars = limit * CHARS_PER_TOKEN;
94
+ truncatedBody = content.substring(0, maxChars);
95
+ }
96
+
82
97
  let message;
83
98
  if (tempFilePath) {
84
99
  message = `Output exceeded maximum size (${tokenCount} tokens, limit: ${limit}).
85
100
  Full output saved to: ${tempFilePath}
86
101
 
87
- --- Truncated Output (first ${limit} tokens approx) ---
88
- ${truncatedContent}
89
- ...
102
+ --- Truncated Output ---
103
+ ${truncatedBody}
90
104
  --- End of Truncated Output ---`;
91
105
  } else {
92
106
  message = `Output exceeded maximum size (${tokenCount} tokens, limit: ${limit}).
93
107
  Warning: Could not save full output to file (${fileError}).
94
108
 
95
- --- Truncated Output (first ${limit} tokens approx) ---
96
- ${truncatedContent}
97
- ...
109
+ --- Truncated Output ---
110
+ ${truncatedBody}
98
111
  --- End of Truncated Output ---`;
99
112
  }
100
113
 
@@ -140,6 +140,7 @@ function buildSearchDelegateTask({ searchQuery, searchPath, exact, language, all
140
140
  `Options: exact=${exact ? 'true' : 'false'}, language=${language || 'auto'}, allow_tests=${allowTests ? 'true' : 'false'}.`,
141
141
  '',
142
142
  'Return ONLY valid JSON: {"targets": ["path/to/file.ext#Symbol", "path/to/file.ext:line", "path/to/file.ext:start-end"]}',
143
+ 'IMPORTANT: Use ABSOLUTE file paths in targets (e.g., "/full/path/to/file.ext#Symbol"). If you only have relative paths, make them relative to the search path above.',
143
144
  'Prefer #Symbol when a function/class name is clear; otherwise use line numbers.',
144
145
  'Deduplicate targets. Do NOT explain or answer - ONLY return the JSON targets.'
145
146
  ].join('\n');
@@ -267,11 +268,14 @@ export const searchTool = (options = {}) => {
267
268
  return await runRawSearch();
268
269
  }
269
270
 
270
- const effectiveCwd = options.cwd || '.';
271
- const resolvedTargets = targets.map(target => resolveTargetPath(target, effectiveCwd));
271
+ // Resolve relative paths against the actual search directory, not the general cwd.
272
+ // The delegate returns paths relative to where the search was performed (searchPaths[0]),
273
+ // which may differ from options.cwd when the user specifies a path parameter.
274
+ const resolutionBase = searchPaths[0] || options.cwd || '.';
275
+ const resolvedTargets = targets.map(target => resolveTargetPath(target, resolutionBase));
272
276
  const extractOptions = {
273
277
  files: resolvedTargets,
274
- cwd: effectiveCwd,
278
+ cwd: resolutionBase,
275
279
  allowTests: allow_tests ?? true
276
280
  };
277
281