@probelabs/probe 0.6.0-rc258 → 0.6.0-rc260

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 (33) hide show
  1. package/bin/binaries/probe-v0.6.0-rc260-aarch64-apple-darwin.tar.gz +0 -0
  2. package/bin/binaries/probe-v0.6.0-rc260-aarch64-unknown-linux-musl.tar.gz +0 -0
  3. package/bin/binaries/probe-v0.6.0-rc260-x86_64-apple-darwin.tar.gz +0 -0
  4. package/bin/binaries/{probe-v0.6.0-rc258-x86_64-pc-windows-msvc.zip → probe-v0.6.0-rc260-x86_64-pc-windows-msvc.zip} +0 -0
  5. package/bin/binaries/probe-v0.6.0-rc260-x86_64-unknown-linux-musl.tar.gz +0 -0
  6. package/build/agent/ProbeAgent.js +13 -0
  7. package/build/agent/bashCommandUtils.js +3 -0
  8. package/build/agent/bashPermissions.js +23 -0
  9. package/build/agent/index.js +223 -26
  10. package/build/agent/probeTool.js +9 -0
  11. package/build/agent/schemaUtils.js +40 -4
  12. package/build/agent/tools.js +8 -0
  13. package/build/index.js +7 -2
  14. package/build/tools/common.js +56 -23
  15. package/build/tools/edit.js +139 -6
  16. package/build/tools/index.js +5 -2
  17. package/cjs/agent/ProbeAgent.cjs +296 -99
  18. package/cjs/index.cjs +306 -99
  19. package/package.json +1 -1
  20. package/src/agent/ProbeAgent.js +13 -0
  21. package/src/agent/bashCommandUtils.js +3 -0
  22. package/src/agent/bashPermissions.js +23 -0
  23. package/src/agent/probeTool.js +9 -0
  24. package/src/agent/schemaUtils.js +40 -4
  25. package/src/agent/tools.js +8 -0
  26. package/src/index.js +7 -2
  27. package/src/tools/common.js +56 -23
  28. package/src/tools/edit.js +139 -6
  29. package/src/tools/index.js +5 -2
  30. package/bin/binaries/probe-v0.6.0-rc258-aarch64-apple-darwin.tar.gz +0 -0
  31. package/bin/binaries/probe-v0.6.0-rc258-aarch64-unknown-linux-musl.tar.gz +0 -0
  32. package/bin/binaries/probe-v0.6.0-rc258-x86_64-apple-darwin.tar.gz +0 -0
  33. package/bin/binaries/probe-v0.6.0-rc258-x86_64-unknown-linux-musl.tar.gz +0 -0
@@ -17506,7 +17506,7 @@ var require_package2 = __commonJS({
17506
17506
  module2.exports = {
17507
17507
  name: "@aws-sdk/client-bedrock-runtime",
17508
17508
  description: "AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",
17509
- version: "3.997.0",
17509
+ version: "3.998.0",
17510
17510
  scripts: {
17511
17511
  build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
17512
17512
  "build:cjs": "node ../../scripts/compilation/inline client-bedrock-runtime",
@@ -17526,49 +17526,49 @@ var require_package2 = __commonJS({
17526
17526
  dependencies: {
17527
17527
  "@aws-crypto/sha256-browser": "5.2.0",
17528
17528
  "@aws-crypto/sha256-js": "5.2.0",
17529
- "@aws-sdk/core": "^3.973.13",
17530
- "@aws-sdk/credential-provider-node": "^3.972.12",
17531
- "@aws-sdk/eventstream-handler-node": "^3.972.7",
17532
- "@aws-sdk/middleware-eventstream": "^3.972.4",
17533
- "@aws-sdk/middleware-host-header": "^3.972.4",
17534
- "@aws-sdk/middleware-logger": "^3.972.4",
17535
- "@aws-sdk/middleware-recursion-detection": "^3.972.4",
17536
- "@aws-sdk/middleware-user-agent": "^3.972.13",
17537
- "@aws-sdk/middleware-websocket": "^3.972.8",
17538
- "@aws-sdk/region-config-resolver": "^3.972.4",
17539
- "@aws-sdk/token-providers": "3.997.0",
17540
- "@aws-sdk/types": "^3.973.2",
17541
- "@aws-sdk/util-endpoints": "^3.996.1",
17542
- "@aws-sdk/util-user-agent-browser": "^3.972.4",
17543
- "@aws-sdk/util-user-agent-node": "^3.972.12",
17544
- "@smithy/config-resolver": "^4.4.7",
17545
- "@smithy/core": "^3.23.4",
17546
- "@smithy/eventstream-serde-browser": "^4.2.9",
17547
- "@smithy/eventstream-serde-config-resolver": "^4.3.9",
17548
- "@smithy/eventstream-serde-node": "^4.2.9",
17549
- "@smithy/fetch-http-handler": "^5.3.10",
17550
- "@smithy/hash-node": "^4.2.9",
17551
- "@smithy/invalid-dependency": "^4.2.9",
17552
- "@smithy/middleware-content-length": "^4.2.9",
17553
- "@smithy/middleware-endpoint": "^4.4.18",
17554
- "@smithy/middleware-retry": "^4.4.35",
17555
- "@smithy/middleware-serde": "^4.2.10",
17556
- "@smithy/middleware-stack": "^4.2.9",
17557
- "@smithy/node-config-provider": "^4.3.9",
17558
- "@smithy/node-http-handler": "^4.4.11",
17559
- "@smithy/protocol-http": "^5.3.9",
17560
- "@smithy/smithy-client": "^4.11.7",
17561
- "@smithy/types": "^4.12.1",
17562
- "@smithy/url-parser": "^4.2.9",
17529
+ "@aws-sdk/core": "^3.973.14",
17530
+ "@aws-sdk/credential-provider-node": "^3.972.13",
17531
+ "@aws-sdk/eventstream-handler-node": "^3.972.8",
17532
+ "@aws-sdk/middleware-eventstream": "^3.972.5",
17533
+ "@aws-sdk/middleware-host-header": "^3.972.5",
17534
+ "@aws-sdk/middleware-logger": "^3.972.5",
17535
+ "@aws-sdk/middleware-recursion-detection": "^3.972.5",
17536
+ "@aws-sdk/middleware-user-agent": "^3.972.14",
17537
+ "@aws-sdk/middleware-websocket": "^3.972.9",
17538
+ "@aws-sdk/region-config-resolver": "^3.972.5",
17539
+ "@aws-sdk/token-providers": "3.998.0",
17540
+ "@aws-sdk/types": "^3.973.3",
17541
+ "@aws-sdk/util-endpoints": "^3.996.2",
17542
+ "@aws-sdk/util-user-agent-browser": "^3.972.5",
17543
+ "@aws-sdk/util-user-agent-node": "^3.972.13",
17544
+ "@smithy/config-resolver": "^4.4.9",
17545
+ "@smithy/core": "^3.23.6",
17546
+ "@smithy/eventstream-serde-browser": "^4.2.10",
17547
+ "@smithy/eventstream-serde-config-resolver": "^4.3.10",
17548
+ "@smithy/eventstream-serde-node": "^4.2.10",
17549
+ "@smithy/fetch-http-handler": "^5.3.11",
17550
+ "@smithy/hash-node": "^4.2.10",
17551
+ "@smithy/invalid-dependency": "^4.2.10",
17552
+ "@smithy/middleware-content-length": "^4.2.10",
17553
+ "@smithy/middleware-endpoint": "^4.4.20",
17554
+ "@smithy/middleware-retry": "^4.4.37",
17555
+ "@smithy/middleware-serde": "^4.2.11",
17556
+ "@smithy/middleware-stack": "^4.2.10",
17557
+ "@smithy/node-config-provider": "^4.3.10",
17558
+ "@smithy/node-http-handler": "^4.4.12",
17559
+ "@smithy/protocol-http": "^5.3.10",
17560
+ "@smithy/smithy-client": "^4.12.0",
17561
+ "@smithy/types": "^4.13.0",
17562
+ "@smithy/url-parser": "^4.2.10",
17563
17563
  "@smithy/util-base64": "^4.3.1",
17564
17564
  "@smithy/util-body-length-browser": "^4.2.1",
17565
17565
  "@smithy/util-body-length-node": "^4.2.2",
17566
- "@smithy/util-defaults-mode-browser": "^4.3.34",
17567
- "@smithy/util-defaults-mode-node": "^4.2.37",
17568
- "@smithy/util-endpoints": "^3.2.9",
17569
- "@smithy/util-middleware": "^4.2.9",
17570
- "@smithy/util-retry": "^4.2.9",
17571
- "@smithy/util-stream": "^4.5.14",
17566
+ "@smithy/util-defaults-mode-browser": "^4.3.36",
17567
+ "@smithy/util-defaults-mode-node": "^4.2.39",
17568
+ "@smithy/util-endpoints": "^3.3.1",
17569
+ "@smithy/util-middleware": "^4.2.10",
17570
+ "@smithy/util-retry": "^4.2.10",
17571
+ "@smithy/util-stream": "^4.5.15",
17572
17572
  "@smithy/util-utf8": "^4.2.1",
17573
17573
  tslib: "^2.6.2"
17574
17574
  },
@@ -18287,7 +18287,7 @@ var init_package = __esm({
18287
18287
  "node_modules/@aws-sdk/nested-clients/package.json"() {
18288
18288
  package_default = {
18289
18289
  name: "@aws-sdk/nested-clients",
18290
- version: "3.996.1",
18290
+ version: "3.996.2",
18291
18291
  description: "Nested clients for AWS SDK packages.",
18292
18292
  main: "./dist-cjs/index.js",
18293
18293
  module: "./dist-es/index.js",
@@ -18316,40 +18316,40 @@ var init_package = __esm({
18316
18316
  dependencies: {
18317
18317
  "@aws-crypto/sha256-browser": "5.2.0",
18318
18318
  "@aws-crypto/sha256-js": "5.2.0",
18319
- "@aws-sdk/core": "^3.973.13",
18320
- "@aws-sdk/middleware-host-header": "^3.972.4",
18321
- "@aws-sdk/middleware-logger": "^3.972.4",
18322
- "@aws-sdk/middleware-recursion-detection": "^3.972.4",
18323
- "@aws-sdk/middleware-user-agent": "^3.972.13",
18324
- "@aws-sdk/region-config-resolver": "^3.972.4",
18325
- "@aws-sdk/types": "^3.973.2",
18326
- "@aws-sdk/util-endpoints": "^3.996.1",
18327
- "@aws-sdk/util-user-agent-browser": "^3.972.4",
18328
- "@aws-sdk/util-user-agent-node": "^3.972.12",
18329
- "@smithy/config-resolver": "^4.4.7",
18330
- "@smithy/core": "^3.23.4",
18331
- "@smithy/fetch-http-handler": "^5.3.10",
18332
- "@smithy/hash-node": "^4.2.9",
18333
- "@smithy/invalid-dependency": "^4.2.9",
18334
- "@smithy/middleware-content-length": "^4.2.9",
18335
- "@smithy/middleware-endpoint": "^4.4.18",
18336
- "@smithy/middleware-retry": "^4.4.35",
18337
- "@smithy/middleware-serde": "^4.2.10",
18338
- "@smithy/middleware-stack": "^4.2.9",
18339
- "@smithy/node-config-provider": "^4.3.9",
18340
- "@smithy/node-http-handler": "^4.4.11",
18341
- "@smithy/protocol-http": "^5.3.9",
18342
- "@smithy/smithy-client": "^4.11.7",
18343
- "@smithy/types": "^4.12.1",
18344
- "@smithy/url-parser": "^4.2.9",
18319
+ "@aws-sdk/core": "^3.973.14",
18320
+ "@aws-sdk/middleware-host-header": "^3.972.5",
18321
+ "@aws-sdk/middleware-logger": "^3.972.5",
18322
+ "@aws-sdk/middleware-recursion-detection": "^3.972.5",
18323
+ "@aws-sdk/middleware-user-agent": "^3.972.14",
18324
+ "@aws-sdk/region-config-resolver": "^3.972.5",
18325
+ "@aws-sdk/types": "^3.973.3",
18326
+ "@aws-sdk/util-endpoints": "^3.996.2",
18327
+ "@aws-sdk/util-user-agent-browser": "^3.972.5",
18328
+ "@aws-sdk/util-user-agent-node": "^3.972.13",
18329
+ "@smithy/config-resolver": "^4.4.9",
18330
+ "@smithy/core": "^3.23.6",
18331
+ "@smithy/fetch-http-handler": "^5.3.11",
18332
+ "@smithy/hash-node": "^4.2.10",
18333
+ "@smithy/invalid-dependency": "^4.2.10",
18334
+ "@smithy/middleware-content-length": "^4.2.10",
18335
+ "@smithy/middleware-endpoint": "^4.4.20",
18336
+ "@smithy/middleware-retry": "^4.4.37",
18337
+ "@smithy/middleware-serde": "^4.2.11",
18338
+ "@smithy/middleware-stack": "^4.2.10",
18339
+ "@smithy/node-config-provider": "^4.3.10",
18340
+ "@smithy/node-http-handler": "^4.4.12",
18341
+ "@smithy/protocol-http": "^5.3.10",
18342
+ "@smithy/smithy-client": "^4.12.0",
18343
+ "@smithy/types": "^4.13.0",
18344
+ "@smithy/url-parser": "^4.2.10",
18345
18345
  "@smithy/util-base64": "^4.3.1",
18346
18346
  "@smithy/util-body-length-browser": "^4.2.1",
18347
18347
  "@smithy/util-body-length-node": "^4.2.2",
18348
- "@smithy/util-defaults-mode-browser": "^4.3.34",
18349
- "@smithy/util-defaults-mode-node": "^4.2.37",
18350
- "@smithy/util-endpoints": "^3.2.9",
18351
- "@smithy/util-middleware": "^4.2.9",
18352
- "@smithy/util-retry": "^4.2.9",
18348
+ "@smithy/util-defaults-mode-browser": "^4.3.36",
18349
+ "@smithy/util-defaults-mode-node": "^4.2.39",
18350
+ "@smithy/util-endpoints": "^3.3.1",
18351
+ "@smithy/util-middleware": "^4.2.10",
18352
+ "@smithy/util-retry": "^4.2.10",
18353
18353
  "@smithy/util-utf8": "^4.2.1",
18354
18354
  tslib: "^2.6.2"
18355
18355
  },
@@ -36704,7 +36704,7 @@ async function handleLineEdit({ resolvedPath: resolvedPath2, file_path, start_li
36704
36704
  return buildLineEditResponse(file_path, startLine, endLine, newLines.length, fileLines, startLine - 1, action, modifications);
36705
36705
  }
36706
36706
  }
36707
- var import_ai, import_fs4, import_path5, import_fs5, editTool, createTool, editSchema, createSchema, editDescription, createDescription, editToolDefinition, createToolDefinition;
36707
+ var import_ai, import_fs4, import_path5, import_fs5, editTool, createTool, multiEditTool, editSchema, createSchema, multiEditSchema, editDescription, createDescription, multiEditDescription, editToolDefinition, createToolDefinition, multiEditToolDefinition;
36708
36708
  var init_edit = __esm({
36709
36709
  "src/tools/edit.js"() {
36710
36710
  "use strict";
@@ -36778,7 +36778,7 @@ Parameters:
36778
36778
  },
36779
36779
  required: ["file_path", "new_string"]
36780
36780
  },
36781
- execute: async ({ file_path, old_string, new_string, replace_all = false, symbol: symbol15, position, start_line, end_line }) => {
36781
+ execute: async ({ file_path, old_string, new_string, replace_all = false, symbol: symbol15, position, start_line, end_line, workingDirectory }) => {
36782
36782
  try {
36783
36783
  if (!file_path || typeof file_path !== "string" || file_path.trim() === "") {
36784
36784
  return `Error editing file: Invalid file_path - must be a non-empty string. Provide an absolute path or a path relative to the working directory (e.g. "src/main.js").`;
@@ -36786,7 +36786,8 @@ Parameters:
36786
36786
  if (new_string === void 0 || new_string === null || typeof new_string !== "string") {
36787
36787
  return `Error editing file: Invalid new_string - must be a string. Provide the replacement content as a string value (empty string "" is valid for deletions).`;
36788
36788
  }
36789
- const resolvedPath2 = (0, import_path5.isAbsolute)(file_path) ? file_path : (0, import_path5.resolve)(cwd || process.cwd(), file_path);
36789
+ const effectiveCwd = workingDirectory || cwd || process.cwd();
36790
+ const resolvedPath2 = (0, import_path5.isAbsolute)(file_path) ? file_path : (0, import_path5.resolve)(effectiveCwd, file_path);
36790
36791
  if (debug) {
36791
36792
  console.error(`[Edit] Attempting to edit file: ${resolvedPath2}`);
36792
36793
  }
@@ -36893,7 +36894,7 @@ Important:
36893
36894
  },
36894
36895
  required: ["file_path", "content"]
36895
36896
  },
36896
- execute: async ({ file_path, content, overwrite = false }) => {
36897
+ execute: async ({ file_path, content, overwrite = false, workingDirectory }) => {
36897
36898
  try {
36898
36899
  if (!file_path || typeof file_path !== "string" || file_path.trim() === "") {
36899
36900
  return `Error creating file: Invalid file_path - must be a non-empty string. Provide an absolute path or a path relative to the working directory (e.g. "src/newFile.js").`;
@@ -36901,7 +36902,8 @@ Important:
36901
36902
  if (content === void 0 || content === null || typeof content !== "string") {
36902
36903
  return `Error creating file: Invalid content - must be a string. Provide the file content as a string value (empty string "" is valid for an empty file).`;
36903
36904
  }
36904
- const resolvedPath2 = (0, import_path5.isAbsolute)(file_path) ? file_path : (0, import_path5.resolve)(cwd || process.cwd(), file_path);
36905
+ const effectiveCwd = workingDirectory || cwd || process.cwd();
36906
+ const resolvedPath2 = (0, import_path5.isAbsolute)(file_path) ? file_path : (0, import_path5.resolve)(effectiveCwd, file_path);
36905
36907
  if (debug) {
36906
36908
  console.error(`[Create] Attempting to create file: ${resolvedPath2}`);
36907
36909
  }
@@ -36930,6 +36932,70 @@ Important:
36930
36932
  }
36931
36933
  });
36932
36934
  };
36935
+ multiEditTool = (options = {}) => {
36936
+ const editInstance = editTool(options);
36937
+ return (0, import_ai.tool)({
36938
+ name: "multi_edit",
36939
+ description: "Apply multiple file edits in a single tool call. Accepts a JSON array of edit operations.",
36940
+ inputSchema: {
36941
+ type: "object",
36942
+ properties: {
36943
+ edits: {
36944
+ type: "string",
36945
+ description: "JSON array of edit operations. Each object supports: file_path, old_string, new_string, replace_all, symbol, position, start_line, end_line."
36946
+ }
36947
+ },
36948
+ required: ["edits"]
36949
+ },
36950
+ execute: async ({ edits: rawEdits }) => {
36951
+ let edits;
36952
+ if (typeof rawEdits === "string") {
36953
+ try {
36954
+ edits = JSON.parse(rawEdits);
36955
+ } catch (e5) {
36956
+ return `Error: Invalid JSON in edits parameter - ${e5.message}. Provide a raw JSON array between <edits> tags.`;
36957
+ }
36958
+ } else if (Array.isArray(rawEdits)) {
36959
+ edits = rawEdits;
36960
+ } else {
36961
+ return "Error: edits must be a JSON array of edit operations.";
36962
+ }
36963
+ if (!Array.isArray(edits) || edits.length === 0) {
36964
+ return "Error: edits must be a non-empty JSON array.";
36965
+ }
36966
+ if (edits.length > 50) {
36967
+ return `Error: Too many edits (${edits.length}). Maximum 50 per batch.`;
36968
+ }
36969
+ const results = [];
36970
+ let successCount = 0;
36971
+ let failCount = 0;
36972
+ for (let i5 = 0; i5 < edits.length; i5++) {
36973
+ const editOp = edits[i5];
36974
+ if (!editOp || typeof editOp !== "object" || Array.isArray(editOp)) {
36975
+ results.push(`[${i5 + 1}] FAIL: Invalid edit operation - must be an object`);
36976
+ failCount++;
36977
+ continue;
36978
+ }
36979
+ try {
36980
+ const result = await editInstance.execute(editOp);
36981
+ const isError = typeof result === "string" && result.startsWith("Error");
36982
+ if (isError) {
36983
+ results.push(`[${i5 + 1}] FAIL: ${result}`);
36984
+ failCount++;
36985
+ } else {
36986
+ results.push(`[${i5 + 1}] OK: ${result}`);
36987
+ successCount++;
36988
+ }
36989
+ } catch (error2) {
36990
+ results.push(`[${i5 + 1}] FAIL: ${error2.message}`);
36991
+ failCount++;
36992
+ }
36993
+ }
36994
+ const summary = `Multi-edit: ${successCount}/${edits.length} succeeded` + (failCount > 0 ? `, ${failCount} failed` : "");
36995
+ return summary + "\n\n" + results.join("\n");
36996
+ }
36997
+ });
36998
+ };
36933
36999
  editSchema = {
36934
37000
  type: "object",
36935
37001
  properties: {
@@ -36987,8 +37053,19 @@ Important:
36987
37053
  },
36988
37054
  required: ["file_path", "content"]
36989
37055
  };
37056
+ multiEditSchema = {
37057
+ type: "object",
37058
+ properties: {
37059
+ edits: {
37060
+ type: "string",
37061
+ description: "JSON array of edit operations"
37062
+ }
37063
+ },
37064
+ required: ["edits"]
37065
+ };
36990
37066
  editDescription = "Edit files using text replacement, AST-aware symbol operations, or line-targeted editing. Supports fuzzy matching for text edits and optional hash-based integrity verification for line edits.";
36991
37067
  createDescription = "Create new files with specified content. Will create parent directories if needed.";
37068
+ multiEditDescription = "Apply multiple file edits in a single tool call. Accepts a JSON array of edit operations, each supporting the same modes as the edit tool.";
36992
37069
  editToolDefinition = `
36993
37070
  ## edit
36994
37071
  Description: ${editDescription}
@@ -37144,6 +37221,44 @@ Examples:
37144
37221
  This is a new project.</content>
37145
37222
  <overwrite>true</overwrite>
37146
37223
  </create>`;
37224
+ multiEditToolDefinition = `
37225
+ ## multi_edit
37226
+ Description: ${multiEditDescription}
37227
+
37228
+ Apply multiple edits in one call. Each operation in the array uses the same parameters as the edit tool:
37229
+ - file_path, old_string, new_string (text mode)
37230
+ - file_path, symbol, new_string (symbol replace)
37231
+ - file_path, symbol, new_string, position (symbol insert)
37232
+ - file_path, start_line, new_string (line-targeted)
37233
+
37234
+ Edits are applied sequentially. Failures do not stop remaining edits. Maximum 50 edits per call.
37235
+
37236
+ Parameters:
37237
+ - edits: (required) JSON array of edit objects. Place raw JSON between tags.
37238
+
37239
+ When to use multi_edit vs edit:
37240
+ - Use edit for a single change to one file
37241
+ - Use multi_edit when making 2+ related changes across files (e.g., rename a function and update all call sites)
37242
+ - Use multi_edit for coordinated multi-file refactoring where order matters
37243
+
37244
+ Examples:
37245
+
37246
+ Multiple text replacements across files:
37247
+ <multi_edit>
37248
+ <edits>[
37249
+ {"file_path": "src/main.js", "old_string": "return false;", "new_string": "return true;"},
37250
+ {"file_path": "src/config.js", "old_string": "debug: false", "new_string": "debug: true"}
37251
+ ]</edits>
37252
+ </multi_edit>
37253
+
37254
+ Mixed edit modes in one batch:
37255
+ <multi_edit>
37256
+ <edits>[
37257
+ {"file_path": "src/utils.js", "symbol": "oldHelper", "new_string": "function newHelper() { return 42; }"},
37258
+ {"file_path": "src/main.js", "old_string": "oldHelper()", "new_string": "newHelper()", "replace_all": true},
37259
+ {"file_path": "src/index.js", "start_line": "10", "end_line": "12", "new_string": "export { newHelper };"}
37260
+ ]</edits>
37261
+ </multi_edit>`;
37147
37262
  }
37148
37263
  });
37149
37264
 
@@ -37636,7 +37751,8 @@ function getValidParamsForTool(toolName) {
37636
37751
  task: taskSchema,
37637
37752
  attempt_completion: attemptCompletionSchema,
37638
37753
  edit: editSchema,
37639
- create: createSchema
37754
+ create: createSchema,
37755
+ multi_edit: multiEditSchema
37640
37756
  };
37641
37757
  const schema = schemaMap[toolName];
37642
37758
  if (!schema) {
@@ -37676,7 +37792,7 @@ function parseXmlToolCall(xmlString, validTools = DEFAULT_VALID_TOOLS) {
37676
37792
  const closeTag = `</${toolName}>`;
37677
37793
  const openIndex = earliestOpenIndex;
37678
37794
  let closeIndex;
37679
- if (toolName === "attempt_completion") {
37795
+ if (LAST_INDEX_TOOLS.has(toolName)) {
37680
37796
  closeIndex = xmlString.lastIndexOf(closeTag);
37681
37797
  if (closeIndex !== -1 && closeIndex <= openIndex + openTag.length) {
37682
37798
  closeIndex = -1;
@@ -37701,7 +37817,15 @@ function parseXmlToolCall(xmlString, validTools = DEFAULT_VALID_TOOLS) {
37701
37817
  if (paramOpenIndex === -1) {
37702
37818
  continue;
37703
37819
  }
37704
- let paramCloseIndex = innerContent.indexOf(paramCloseTag, paramOpenIndex + paramOpenTag.length);
37820
+ let paramCloseIndex;
37821
+ if (RAW_CONTENT_PARAMS.has(paramName)) {
37822
+ paramCloseIndex = innerContent.lastIndexOf(paramCloseTag);
37823
+ if (paramCloseIndex !== -1 && paramCloseIndex <= paramOpenIndex + paramOpenTag.length) {
37824
+ paramCloseIndex = -1;
37825
+ }
37826
+ } else {
37827
+ paramCloseIndex = innerContent.indexOf(paramCloseTag, paramOpenIndex + paramOpenTag.length);
37828
+ }
37705
37829
  if (paramCloseIndex === -1) {
37706
37830
  let nextTagIndex = innerContent.length;
37707
37831
  for (const nextParam of validParams) {
@@ -37713,18 +37837,26 @@ function parseXmlToolCall(xmlString, validTools = DEFAULT_VALID_TOOLS) {
37713
37837
  }
37714
37838
  paramCloseIndex = nextTagIndex;
37715
37839
  }
37716
- let paramValue = unescapeXmlEntities(innerContent.substring(
37840
+ const rawValue = innerContent.substring(
37717
37841
  paramOpenIndex + paramOpenTag.length,
37718
37842
  paramCloseIndex
37719
- ).trim());
37720
- if (paramValue.toLowerCase() === "true") {
37721
- paramValue = true;
37722
- } else if (paramValue.toLowerCase() === "false") {
37723
- paramValue = false;
37724
- } else if (!isNaN(paramValue) && paramValue.trim() !== "") {
37725
- const num = Number(paramValue);
37726
- if (Number.isFinite(num)) {
37727
- paramValue = num;
37843
+ );
37844
+ let paramValue;
37845
+ if (RAW_CONTENT_PARAMS.has(paramName)) {
37846
+ paramValue = unescapeXmlEntities(rawValue.replace(/^\n/, "").replace(/\n$/, ""));
37847
+ } else {
37848
+ paramValue = unescapeXmlEntities(rawValue.trim());
37849
+ }
37850
+ if (!RAW_CONTENT_PARAMS.has(paramName)) {
37851
+ if (paramValue.toLowerCase() === "true") {
37852
+ paramValue = true;
37853
+ } else if (paramValue.toLowerCase() === "false") {
37854
+ paramValue = false;
37855
+ } else if (!isNaN(paramValue) && paramValue.trim() !== "") {
37856
+ const num = Number(paramValue);
37857
+ if (Number.isFinite(num)) {
37858
+ paramValue = num;
37859
+ }
37728
37860
  }
37729
37861
  }
37730
37862
  params[paramName] = paramValue;
@@ -37767,6 +37899,7 @@ function detectUnrecognizedToolCall(xmlString, validTools) {
37767
37899
  "readImage",
37768
37900
  "edit",
37769
37901
  "create",
37902
+ "multi_edit",
37770
37903
  "delegate",
37771
37904
  "bash",
37772
37905
  "task",
@@ -37896,7 +38029,7 @@ function resolveTargetPath(target, cwd) {
37896
38029
  }
37897
38030
  return filePart + suffix;
37898
38031
  }
37899
- var import_path6, searchSchema, searchAllSchema, querySchema, extractSchema, delegateSchema, listSkillsSchema, useSkillSchema, bashSchema, analyzeAllSchema, executePlanSchema, cleanupExecutePlanSchema, attemptCompletionSchema, searchToolDefinition, queryToolDefinition, extractToolDefinition, delegateToolDefinition, attemptCompletionToolDefinition, analyzeAllToolDefinition, bashToolDefinition, googleSearchToolDefinition, urlContextToolDefinition, searchDescription, queryDescription, extractDescription, delegateDescription, analyzeAllDescription, DEFAULT_VALID_TOOLS;
38032
+ var import_path6, searchSchema, searchAllSchema, querySchema, extractSchema, delegateSchema, listSkillsSchema, useSkillSchema, bashSchema, analyzeAllSchema, executePlanSchema, cleanupExecutePlanSchema, attemptCompletionSchema, searchToolDefinition, queryToolDefinition, extractToolDefinition, delegateToolDefinition, attemptCompletionToolDefinition, analyzeAllToolDefinition, bashToolDefinition, googleSearchToolDefinition, urlContextToolDefinition, searchDescription, queryDescription, extractDescription, delegateDescription, analyzeAllDescription, DEFAULT_VALID_TOOLS, RAW_CONTENT_PARAMS, LAST_INDEX_TOOLS;
37900
38033
  var init_common2 = __esm({
37901
38034
  "src/tools/common.js"() {
37902
38035
  "use strict";
@@ -38315,6 +38448,8 @@ Capabilities:
38315
38448
  "task",
38316
38449
  "attempt_completion"
38317
38450
  ];
38451
+ RAW_CONTENT_PARAMS = /* @__PURE__ */ new Set(["content", "new_string", "old_string"]);
38452
+ LAST_INDEX_TOOLS = /* @__PURE__ */ new Set(["attempt_completion", "create", "edit"]);
38318
38453
  }
38319
38454
  });
38320
38455
 
@@ -39384,6 +39519,10 @@ function parseSimpleCommand(command) {
39384
39519
  // Logical OR
39385
39520
  /(?<!\\);/,
39386
39521
  // Command separator (but not escaped \;)
39522
+ /\n/,
39523
+ // Newline command separator (multi-line commands)
39524
+ /\r/,
39525
+ // Carriage return (CRLF line endings)
39387
39526
  /&$/,
39388
39527
  // Background execution
39389
39528
  /\$\(/,
@@ -39490,6 +39629,8 @@ function isComplexPattern(pattern) {
39490
39629
  // Logical OR
39491
39630
  /;/,
39492
39631
  // Command separator
39632
+ /\n/,
39633
+ // Newline command separator
39493
39634
  /&$/,
39494
39635
  // Background execution
39495
39636
  /\$\(/,
@@ -39862,6 +40003,26 @@ var init_bashPermissions = __esm({
39862
40003
  i5++;
39863
40004
  continue;
39864
40005
  }
40006
+ if (char === "\n" || char === "\r" && nextChar === "\n") {
40007
+ if (current2.trim()) {
40008
+ components.push(current2.trim());
40009
+ }
40010
+ current2 = "";
40011
+ if (char === "\r") {
40012
+ i5 += 2;
40013
+ } else {
40014
+ i5++;
40015
+ }
40016
+ continue;
40017
+ }
40018
+ if (char === "\r") {
40019
+ if (current2.trim()) {
40020
+ components.push(current2.trim());
40021
+ }
40022
+ current2 = "";
40023
+ i5++;
40024
+ continue;
40025
+ }
39865
40026
  }
39866
40027
  current2 += char;
39867
40028
  i5++;
@@ -51941,7 +52102,11 @@ var init_esm3 = __esm({
51941
52102
  #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
51942
52103
  const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
51943
52104
  const lastgs = pattern.lastIndexOf(GLOBSTAR);
51944
- const [head2, body, tail] = [
52105
+ const [head2, body, tail] = partial ? [
52106
+ pattern.slice(patternIndex, firstgs),
52107
+ pattern.slice(firstgs + 1),
52108
+ []
52109
+ ] : [
51945
52110
  pattern.slice(patternIndex, firstgs),
51946
52111
  pattern.slice(firstgs + 1, lastgs),
51947
52112
  pattern.slice(lastgs + 1)
@@ -51978,7 +52143,7 @@ var init_esm3 = __esm({
51978
52143
  return false;
51979
52144
  }
51980
52145
  }
51981
- return sawSome;
52146
+ return partial || sawSome;
51982
52147
  }
51983
52148
  const bodySegments = [[[], 0]];
51984
52149
  let currentBody = bodySegments[0];
@@ -52027,7 +52192,7 @@ var init_esm3 = __esm({
52027
52192
  }
52028
52193
  fileIndex++;
52029
52194
  }
52030
- return null;
52195
+ return partial || null;
52031
52196
  }
52032
52197
  #matchOne(file, pattern, partial, fileIndex, patternIndex) {
52033
52198
  let fi;
@@ -58876,6 +59041,13 @@ function createWrappedTools(baseTools) {
58876
59041
  baseTools.createTool.execute
58877
59042
  );
58878
59043
  }
59044
+ if (baseTools.multiEditTool) {
59045
+ wrappedTools.multiEditToolInstance = wrapToolWithEmitter(
59046
+ baseTools.multiEditTool,
59047
+ "multi_edit",
59048
+ baseTools.multiEditTool.execute
59049
+ );
59050
+ }
58879
59051
  return wrappedTools;
58880
59052
  }
58881
59053
  var import_child_process8, import_util12, import_crypto4, import_events, import_fs10, import_fs11, import_path12, toolCallEmitter, activeToolExecutions, wrapToolWithEmitter, listFilesTool, searchFilesTool, listFilesToolInstance, searchFilesToolInstance;
@@ -59801,6 +59973,9 @@ function createTools(configOptions) {
59801
59973
  if (configOptions.allowEdit && isToolAllowed("create")) {
59802
59974
  tools2.createTool = createTool(configOptions);
59803
59975
  }
59976
+ if (configOptions.allowEdit && isToolAllowed("multi_edit")) {
59977
+ tools2.multiEditTool = multiEditTool(configOptions);
59978
+ }
59804
59979
  return tools2;
59805
59980
  }
59806
59981
  function parseXmlToolCallWithThinking(xmlString, validTools) {
@@ -96813,6 +96988,15 @@ function normalizeJsonQuotes(str) {
96813
96988
  }
96814
96989
  return result;
96815
96990
  }
96991
+ function isCodeBlockEmbeddedInDocument(text, match2) {
96992
+ const beforeBlock = text.substring(0, match2.index).trim();
96993
+ const afterBlock = text.substring(match2.index + match2[0].length).trim();
96994
+ const hasMarkdownHeadings = /^#{1,6}\s/m.test(beforeBlock) || /^#{1,6}\s/m.test(afterBlock);
96995
+ if (hasMarkdownHeadings) {
96996
+ return true;
96997
+ }
96998
+ return false;
96999
+ }
96816
97000
  function cleanSchemaResponse(response) {
96817
97001
  if (!response || typeof response !== "string") {
96818
97002
  return response;
@@ -96832,11 +97016,11 @@ function cleanSchemaResponse(response) {
96832
97016
  return cleanSchemaResponse(innerContent);
96833
97017
  }
96834
97018
  const jsonBlockMatch = trimmed.match(/```json\s*\n([\s\S]*?)\n```/);
96835
- if (jsonBlockMatch) {
97019
+ if (jsonBlockMatch && !isCodeBlockEmbeddedInDocument(trimmed, jsonBlockMatch)) {
96836
97020
  return normalizeJsonQuotes(jsonBlockMatch[1].trim());
96837
97021
  }
96838
97022
  const anyBlockMatch = trimmed.match(/```\s*\n([{\[][\s\S]*?[}\]])\s*```/);
96839
- if (anyBlockMatch) {
97023
+ if (anyBlockMatch && !isCodeBlockEmbeddedInDocument(trimmed, anyBlockMatch)) {
96840
97024
  return normalizeJsonQuotes(anyBlockMatch[1].trim());
96841
97025
  }
96842
97026
  const codeBlockPatterns = [
@@ -96845,7 +97029,7 @@ function cleanSchemaResponse(response) {
96845
97029
  ];
96846
97030
  for (const pattern of codeBlockPatterns) {
96847
97031
  const match2 = trimmed.match(pattern);
96848
- if (match2) {
97032
+ if (match2 && !isCodeBlockEmbeddedInDocument(trimmed, match2)) {
96849
97033
  return normalizeJsonQuotes(match2[1].trim());
96850
97034
  }
96851
97035
  }
@@ -96856,7 +97040,7 @@ function cleanSchemaResponse(response) {
96856
97040
  }
96857
97041
  const codeBlockStartPattern = /```(?:json)?\s*\n?\s*([{\[])/;
96858
97042
  const codeBlockMatch = trimmed.match(codeBlockStartPattern);
96859
- if (codeBlockMatch) {
97043
+ if (codeBlockMatch && !isCodeBlockEmbeddedInDocument(trimmed, codeBlockMatch)) {
96860
97044
  const startIndex = codeBlockMatch.index + codeBlockMatch[0].length - 1;
96861
97045
  const openChar = codeBlockMatch[1];
96862
97046
  const closeChar = openChar === "{" ? "}" : "]";
@@ -110299,6 +110483,9 @@ var init_ProbeAgent = __esm({
110299
110483
  if (wrappedTools.createToolInstance && isToolAllowed("create")) {
110300
110484
  this.toolImplementations.create = wrappedTools.createToolInstance;
110301
110485
  }
110486
+ if (wrappedTools.multiEditToolInstance && isToolAllowed("multi_edit")) {
110487
+ this.toolImplementations.multi_edit = wrappedTools.multiEditToolInstance;
110488
+ }
110302
110489
  }
110303
110490
  this.wrappedTools = wrappedTools;
110304
110491
  if (this.debug) {
@@ -111588,6 +111775,10 @@ Workspace: ${this.allowedFolders.join(", ")}`;
111588
111775
  }
111589
111776
  if (this.allowEdit && isToolAllowed("create")) {
111590
111777
  toolDefinitions += `${createToolDefinition}
111778
+ `;
111779
+ }
111780
+ if (this.allowEdit && isToolAllowed("multi_edit")) {
111781
+ toolDefinitions += `${multiEditToolDefinition}
111591
111782
  `;
111592
111783
  }
111593
111784
  if (this.enableBash && isToolAllowed("bash")) {
@@ -111684,6 +111875,9 @@ The configuration is loaded from src/config.js lines 15-25 which contains the da
111684
111875
  if (this.allowEdit && isToolAllowed("create")) {
111685
111876
  availableToolsList += "- create: Create new files with specified content.\n";
111686
111877
  }
111878
+ if (this.allowEdit && isToolAllowed("multi_edit")) {
111879
+ availableToolsList += "- multi_edit: Apply multiple file edits in one call using a JSON array of operations.\n";
111880
+ }
111687
111881
  if (this.enableDelegate && isToolAllowed("delegate")) {
111688
111882
  availableToolsList += "- delegate: Delegate big distinct tasks to specialized probe subagents.\n";
111689
111883
  }
@@ -112278,6 +112472,9 @@ You are working with a workspace. Available paths: ${workspaceDesc}
112278
112472
  if (this.allowEdit && this.allowedTools.isEnabled("create")) {
112279
112473
  validTools.push("create");
112280
112474
  }
112475
+ if (this.allowEdit && this.allowedTools.isEnabled("multi_edit")) {
112476
+ validTools.push("multi_edit");
112477
+ }
112281
112478
  if (this.enableBash && this.allowedTools.isEnabled("bash")) {
112282
112479
  validTools.push("bash");
112283
112480
  }