@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
package/cjs/index.cjs CHANGED
@@ -19363,7 +19363,7 @@ var require_package2 = __commonJS({
19363
19363
  module2.exports = {
19364
19364
  name: "@aws-sdk/client-bedrock-runtime",
19365
19365
  description: "AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",
19366
- version: "3.997.0",
19366
+ version: "3.998.0",
19367
19367
  scripts: {
19368
19368
  build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
19369
19369
  "build:cjs": "node ../../scripts/compilation/inline client-bedrock-runtime",
@@ -19383,49 +19383,49 @@ var require_package2 = __commonJS({
19383
19383
  dependencies: {
19384
19384
  "@aws-crypto/sha256-browser": "5.2.0",
19385
19385
  "@aws-crypto/sha256-js": "5.2.0",
19386
- "@aws-sdk/core": "^3.973.13",
19387
- "@aws-sdk/credential-provider-node": "^3.972.12",
19388
- "@aws-sdk/eventstream-handler-node": "^3.972.7",
19389
- "@aws-sdk/middleware-eventstream": "^3.972.4",
19390
- "@aws-sdk/middleware-host-header": "^3.972.4",
19391
- "@aws-sdk/middleware-logger": "^3.972.4",
19392
- "@aws-sdk/middleware-recursion-detection": "^3.972.4",
19393
- "@aws-sdk/middleware-user-agent": "^3.972.13",
19394
- "@aws-sdk/middleware-websocket": "^3.972.8",
19395
- "@aws-sdk/region-config-resolver": "^3.972.4",
19396
- "@aws-sdk/token-providers": "3.997.0",
19397
- "@aws-sdk/types": "^3.973.2",
19398
- "@aws-sdk/util-endpoints": "^3.996.1",
19399
- "@aws-sdk/util-user-agent-browser": "^3.972.4",
19400
- "@aws-sdk/util-user-agent-node": "^3.972.12",
19401
- "@smithy/config-resolver": "^4.4.7",
19402
- "@smithy/core": "^3.23.4",
19403
- "@smithy/eventstream-serde-browser": "^4.2.9",
19404
- "@smithy/eventstream-serde-config-resolver": "^4.3.9",
19405
- "@smithy/eventstream-serde-node": "^4.2.9",
19406
- "@smithy/fetch-http-handler": "^5.3.10",
19407
- "@smithy/hash-node": "^4.2.9",
19408
- "@smithy/invalid-dependency": "^4.2.9",
19409
- "@smithy/middleware-content-length": "^4.2.9",
19410
- "@smithy/middleware-endpoint": "^4.4.18",
19411
- "@smithy/middleware-retry": "^4.4.35",
19412
- "@smithy/middleware-serde": "^4.2.10",
19413
- "@smithy/middleware-stack": "^4.2.9",
19414
- "@smithy/node-config-provider": "^4.3.9",
19415
- "@smithy/node-http-handler": "^4.4.11",
19416
- "@smithy/protocol-http": "^5.3.9",
19417
- "@smithy/smithy-client": "^4.11.7",
19418
- "@smithy/types": "^4.12.1",
19419
- "@smithy/url-parser": "^4.2.9",
19386
+ "@aws-sdk/core": "^3.973.14",
19387
+ "@aws-sdk/credential-provider-node": "^3.972.13",
19388
+ "@aws-sdk/eventstream-handler-node": "^3.972.8",
19389
+ "@aws-sdk/middleware-eventstream": "^3.972.5",
19390
+ "@aws-sdk/middleware-host-header": "^3.972.5",
19391
+ "@aws-sdk/middleware-logger": "^3.972.5",
19392
+ "@aws-sdk/middleware-recursion-detection": "^3.972.5",
19393
+ "@aws-sdk/middleware-user-agent": "^3.972.14",
19394
+ "@aws-sdk/middleware-websocket": "^3.972.9",
19395
+ "@aws-sdk/region-config-resolver": "^3.972.5",
19396
+ "@aws-sdk/token-providers": "3.998.0",
19397
+ "@aws-sdk/types": "^3.973.3",
19398
+ "@aws-sdk/util-endpoints": "^3.996.2",
19399
+ "@aws-sdk/util-user-agent-browser": "^3.972.5",
19400
+ "@aws-sdk/util-user-agent-node": "^3.972.13",
19401
+ "@smithy/config-resolver": "^4.4.9",
19402
+ "@smithy/core": "^3.23.6",
19403
+ "@smithy/eventstream-serde-browser": "^4.2.10",
19404
+ "@smithy/eventstream-serde-config-resolver": "^4.3.10",
19405
+ "@smithy/eventstream-serde-node": "^4.2.10",
19406
+ "@smithy/fetch-http-handler": "^5.3.11",
19407
+ "@smithy/hash-node": "^4.2.10",
19408
+ "@smithy/invalid-dependency": "^4.2.10",
19409
+ "@smithy/middleware-content-length": "^4.2.10",
19410
+ "@smithy/middleware-endpoint": "^4.4.20",
19411
+ "@smithy/middleware-retry": "^4.4.37",
19412
+ "@smithy/middleware-serde": "^4.2.11",
19413
+ "@smithy/middleware-stack": "^4.2.10",
19414
+ "@smithy/node-config-provider": "^4.3.10",
19415
+ "@smithy/node-http-handler": "^4.4.12",
19416
+ "@smithy/protocol-http": "^5.3.10",
19417
+ "@smithy/smithy-client": "^4.12.0",
19418
+ "@smithy/types": "^4.13.0",
19419
+ "@smithy/url-parser": "^4.2.10",
19420
19420
  "@smithy/util-base64": "^4.3.1",
19421
19421
  "@smithy/util-body-length-browser": "^4.2.1",
19422
19422
  "@smithy/util-body-length-node": "^4.2.2",
19423
- "@smithy/util-defaults-mode-browser": "^4.3.34",
19424
- "@smithy/util-defaults-mode-node": "^4.2.37",
19425
- "@smithy/util-endpoints": "^3.2.9",
19426
- "@smithy/util-middleware": "^4.2.9",
19427
- "@smithy/util-retry": "^4.2.9",
19428
- "@smithy/util-stream": "^4.5.14",
19423
+ "@smithy/util-defaults-mode-browser": "^4.3.36",
19424
+ "@smithy/util-defaults-mode-node": "^4.2.39",
19425
+ "@smithy/util-endpoints": "^3.3.1",
19426
+ "@smithy/util-middleware": "^4.2.10",
19427
+ "@smithy/util-retry": "^4.2.10",
19428
+ "@smithy/util-stream": "^4.5.15",
19429
19429
  "@smithy/util-utf8": "^4.2.1",
19430
19430
  tslib: "^2.6.2"
19431
19431
  },
@@ -20144,7 +20144,7 @@ var init_package = __esm({
20144
20144
  "node_modules/@aws-sdk/nested-clients/package.json"() {
20145
20145
  package_default = {
20146
20146
  name: "@aws-sdk/nested-clients",
20147
- version: "3.996.1",
20147
+ version: "3.996.2",
20148
20148
  description: "Nested clients for AWS SDK packages.",
20149
20149
  main: "./dist-cjs/index.js",
20150
20150
  module: "./dist-es/index.js",
@@ -20173,40 +20173,40 @@ var init_package = __esm({
20173
20173
  dependencies: {
20174
20174
  "@aws-crypto/sha256-browser": "5.2.0",
20175
20175
  "@aws-crypto/sha256-js": "5.2.0",
20176
- "@aws-sdk/core": "^3.973.13",
20177
- "@aws-sdk/middleware-host-header": "^3.972.4",
20178
- "@aws-sdk/middleware-logger": "^3.972.4",
20179
- "@aws-sdk/middleware-recursion-detection": "^3.972.4",
20180
- "@aws-sdk/middleware-user-agent": "^3.972.13",
20181
- "@aws-sdk/region-config-resolver": "^3.972.4",
20182
- "@aws-sdk/types": "^3.973.2",
20183
- "@aws-sdk/util-endpoints": "^3.996.1",
20184
- "@aws-sdk/util-user-agent-browser": "^3.972.4",
20185
- "@aws-sdk/util-user-agent-node": "^3.972.12",
20186
- "@smithy/config-resolver": "^4.4.7",
20187
- "@smithy/core": "^3.23.4",
20188
- "@smithy/fetch-http-handler": "^5.3.10",
20189
- "@smithy/hash-node": "^4.2.9",
20190
- "@smithy/invalid-dependency": "^4.2.9",
20191
- "@smithy/middleware-content-length": "^4.2.9",
20192
- "@smithy/middleware-endpoint": "^4.4.18",
20193
- "@smithy/middleware-retry": "^4.4.35",
20194
- "@smithy/middleware-serde": "^4.2.10",
20195
- "@smithy/middleware-stack": "^4.2.9",
20196
- "@smithy/node-config-provider": "^4.3.9",
20197
- "@smithy/node-http-handler": "^4.4.11",
20198
- "@smithy/protocol-http": "^5.3.9",
20199
- "@smithy/smithy-client": "^4.11.7",
20200
- "@smithy/types": "^4.12.1",
20201
- "@smithy/url-parser": "^4.2.9",
20176
+ "@aws-sdk/core": "^3.973.14",
20177
+ "@aws-sdk/middleware-host-header": "^3.972.5",
20178
+ "@aws-sdk/middleware-logger": "^3.972.5",
20179
+ "@aws-sdk/middleware-recursion-detection": "^3.972.5",
20180
+ "@aws-sdk/middleware-user-agent": "^3.972.14",
20181
+ "@aws-sdk/region-config-resolver": "^3.972.5",
20182
+ "@aws-sdk/types": "^3.973.3",
20183
+ "@aws-sdk/util-endpoints": "^3.996.2",
20184
+ "@aws-sdk/util-user-agent-browser": "^3.972.5",
20185
+ "@aws-sdk/util-user-agent-node": "^3.972.13",
20186
+ "@smithy/config-resolver": "^4.4.9",
20187
+ "@smithy/core": "^3.23.6",
20188
+ "@smithy/fetch-http-handler": "^5.3.11",
20189
+ "@smithy/hash-node": "^4.2.10",
20190
+ "@smithy/invalid-dependency": "^4.2.10",
20191
+ "@smithy/middleware-content-length": "^4.2.10",
20192
+ "@smithy/middleware-endpoint": "^4.4.20",
20193
+ "@smithy/middleware-retry": "^4.4.37",
20194
+ "@smithy/middleware-serde": "^4.2.11",
20195
+ "@smithy/middleware-stack": "^4.2.10",
20196
+ "@smithy/node-config-provider": "^4.3.10",
20197
+ "@smithy/node-http-handler": "^4.4.12",
20198
+ "@smithy/protocol-http": "^5.3.10",
20199
+ "@smithy/smithy-client": "^4.12.0",
20200
+ "@smithy/types": "^4.13.0",
20201
+ "@smithy/url-parser": "^4.2.10",
20202
20202
  "@smithy/util-base64": "^4.3.1",
20203
20203
  "@smithy/util-body-length-browser": "^4.2.1",
20204
20204
  "@smithy/util-body-length-node": "^4.2.2",
20205
- "@smithy/util-defaults-mode-browser": "^4.3.34",
20206
- "@smithy/util-defaults-mode-node": "^4.2.37",
20207
- "@smithy/util-endpoints": "^3.2.9",
20208
- "@smithy/util-middleware": "^4.2.9",
20209
- "@smithy/util-retry": "^4.2.9",
20205
+ "@smithy/util-defaults-mode-browser": "^4.3.36",
20206
+ "@smithy/util-defaults-mode-node": "^4.2.39",
20207
+ "@smithy/util-endpoints": "^3.3.1",
20208
+ "@smithy/util-middleware": "^4.2.10",
20209
+ "@smithy/util-retry": "^4.2.10",
20210
20210
  "@smithy/util-utf8": "^4.2.1",
20211
20211
  tslib: "^2.6.2"
20212
20212
  },
@@ -35867,7 +35867,7 @@ async function handleLineEdit({ resolvedPath: resolvedPath2, file_path, start_li
35867
35867
  return buildLineEditResponse(file_path, startLine, endLine, newLines.length, fileLines, startLine - 1, action, modifications);
35868
35868
  }
35869
35869
  }
35870
- var import_ai, import_fs4, import_path5, import_fs5, editTool, createTool, editSchema, createSchema, editDescription, createDescription, editToolDefinition, createToolDefinition;
35870
+ var import_ai, import_fs4, import_path5, import_fs5, editTool, createTool, multiEditTool, editSchema, createSchema, multiEditSchema, editDescription, createDescription, multiEditDescription, editToolDefinition, createToolDefinition, multiEditToolDefinition;
35871
35871
  var init_edit = __esm({
35872
35872
  "src/tools/edit.js"() {
35873
35873
  "use strict";
@@ -35941,7 +35941,7 @@ Parameters:
35941
35941
  },
35942
35942
  required: ["file_path", "new_string"]
35943
35943
  },
35944
- execute: async ({ file_path, old_string, new_string, replace_all = false, symbol: symbol15, position, start_line, end_line }) => {
35944
+ execute: async ({ file_path, old_string, new_string, replace_all = false, symbol: symbol15, position, start_line, end_line, workingDirectory }) => {
35945
35945
  try {
35946
35946
  if (!file_path || typeof file_path !== "string" || file_path.trim() === "") {
35947
35947
  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").`;
@@ -35949,7 +35949,8 @@ Parameters:
35949
35949
  if (new_string === void 0 || new_string === null || typeof new_string !== "string") {
35950
35950
  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).`;
35951
35951
  }
35952
- const resolvedPath2 = (0, import_path5.isAbsolute)(file_path) ? file_path : (0, import_path5.resolve)(cwd || process.cwd(), file_path);
35952
+ const effectiveCwd = workingDirectory || cwd || process.cwd();
35953
+ const resolvedPath2 = (0, import_path5.isAbsolute)(file_path) ? file_path : (0, import_path5.resolve)(effectiveCwd, file_path);
35953
35954
  if (debug) {
35954
35955
  console.error(`[Edit] Attempting to edit file: ${resolvedPath2}`);
35955
35956
  }
@@ -36056,7 +36057,7 @@ Important:
36056
36057
  },
36057
36058
  required: ["file_path", "content"]
36058
36059
  },
36059
- execute: async ({ file_path, content, overwrite = false }) => {
36060
+ execute: async ({ file_path, content, overwrite = false, workingDirectory }) => {
36060
36061
  try {
36061
36062
  if (!file_path || typeof file_path !== "string" || file_path.trim() === "") {
36062
36063
  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").`;
@@ -36064,7 +36065,8 @@ Important:
36064
36065
  if (content === void 0 || content === null || typeof content !== "string") {
36065
36066
  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).`;
36066
36067
  }
36067
- const resolvedPath2 = (0, import_path5.isAbsolute)(file_path) ? file_path : (0, import_path5.resolve)(cwd || process.cwd(), file_path);
36068
+ const effectiveCwd = workingDirectory || cwd || process.cwd();
36069
+ const resolvedPath2 = (0, import_path5.isAbsolute)(file_path) ? file_path : (0, import_path5.resolve)(effectiveCwd, file_path);
36068
36070
  if (debug) {
36069
36071
  console.error(`[Create] Attempting to create file: ${resolvedPath2}`);
36070
36072
  }
@@ -36093,6 +36095,70 @@ Important:
36093
36095
  }
36094
36096
  });
36095
36097
  };
36098
+ multiEditTool = (options = {}) => {
36099
+ const editInstance = editTool(options);
36100
+ return (0, import_ai.tool)({
36101
+ name: "multi_edit",
36102
+ description: "Apply multiple file edits in a single tool call. Accepts a JSON array of edit operations.",
36103
+ inputSchema: {
36104
+ type: "object",
36105
+ properties: {
36106
+ edits: {
36107
+ type: "string",
36108
+ description: "JSON array of edit operations. Each object supports: file_path, old_string, new_string, replace_all, symbol, position, start_line, end_line."
36109
+ }
36110
+ },
36111
+ required: ["edits"]
36112
+ },
36113
+ execute: async ({ edits: rawEdits }) => {
36114
+ let edits;
36115
+ if (typeof rawEdits === "string") {
36116
+ try {
36117
+ edits = JSON.parse(rawEdits);
36118
+ } catch (e5) {
36119
+ return `Error: Invalid JSON in edits parameter - ${e5.message}. Provide a raw JSON array between <edits> tags.`;
36120
+ }
36121
+ } else if (Array.isArray(rawEdits)) {
36122
+ edits = rawEdits;
36123
+ } else {
36124
+ return "Error: edits must be a JSON array of edit operations.";
36125
+ }
36126
+ if (!Array.isArray(edits) || edits.length === 0) {
36127
+ return "Error: edits must be a non-empty JSON array.";
36128
+ }
36129
+ if (edits.length > 50) {
36130
+ return `Error: Too many edits (${edits.length}). Maximum 50 per batch.`;
36131
+ }
36132
+ const results = [];
36133
+ let successCount = 0;
36134
+ let failCount = 0;
36135
+ for (let i5 = 0; i5 < edits.length; i5++) {
36136
+ const editOp = edits[i5];
36137
+ if (!editOp || typeof editOp !== "object" || Array.isArray(editOp)) {
36138
+ results.push(`[${i5 + 1}] FAIL: Invalid edit operation - must be an object`);
36139
+ failCount++;
36140
+ continue;
36141
+ }
36142
+ try {
36143
+ const result = await editInstance.execute(editOp);
36144
+ const isError = typeof result === "string" && result.startsWith("Error");
36145
+ if (isError) {
36146
+ results.push(`[${i5 + 1}] FAIL: ${result}`);
36147
+ failCount++;
36148
+ } else {
36149
+ results.push(`[${i5 + 1}] OK: ${result}`);
36150
+ successCount++;
36151
+ }
36152
+ } catch (error2) {
36153
+ results.push(`[${i5 + 1}] FAIL: ${error2.message}`);
36154
+ failCount++;
36155
+ }
36156
+ }
36157
+ const summary = `Multi-edit: ${successCount}/${edits.length} succeeded` + (failCount > 0 ? `, ${failCount} failed` : "");
36158
+ return summary + "\n\n" + results.join("\n");
36159
+ }
36160
+ });
36161
+ };
36096
36162
  editSchema = {
36097
36163
  type: "object",
36098
36164
  properties: {
@@ -36150,8 +36216,19 @@ Important:
36150
36216
  },
36151
36217
  required: ["file_path", "content"]
36152
36218
  };
36219
+ multiEditSchema = {
36220
+ type: "object",
36221
+ properties: {
36222
+ edits: {
36223
+ type: "string",
36224
+ description: "JSON array of edit operations"
36225
+ }
36226
+ },
36227
+ required: ["edits"]
36228
+ };
36153
36229
  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.";
36154
36230
  createDescription = "Create new files with specified content. Will create parent directories if needed.";
36231
+ 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.";
36155
36232
  editToolDefinition = `
36156
36233
  ## edit
36157
36234
  Description: ${editDescription}
@@ -36307,6 +36384,44 @@ Examples:
36307
36384
  This is a new project.</content>
36308
36385
  <overwrite>true</overwrite>
36309
36386
  </create>`;
36387
+ multiEditToolDefinition = `
36388
+ ## multi_edit
36389
+ Description: ${multiEditDescription}
36390
+
36391
+ Apply multiple edits in one call. Each operation in the array uses the same parameters as the edit tool:
36392
+ - file_path, old_string, new_string (text mode)
36393
+ - file_path, symbol, new_string (symbol replace)
36394
+ - file_path, symbol, new_string, position (symbol insert)
36395
+ - file_path, start_line, new_string (line-targeted)
36396
+
36397
+ Edits are applied sequentially. Failures do not stop remaining edits. Maximum 50 edits per call.
36398
+
36399
+ Parameters:
36400
+ - edits: (required) JSON array of edit objects. Place raw JSON between tags.
36401
+
36402
+ When to use multi_edit vs edit:
36403
+ - Use edit for a single change to one file
36404
+ - Use multi_edit when making 2+ related changes across files (e.g., rename a function and update all call sites)
36405
+ - Use multi_edit for coordinated multi-file refactoring where order matters
36406
+
36407
+ Examples:
36408
+
36409
+ Multiple text replacements across files:
36410
+ <multi_edit>
36411
+ <edits>[
36412
+ {"file_path": "src/main.js", "old_string": "return false;", "new_string": "return true;"},
36413
+ {"file_path": "src/config.js", "old_string": "debug: false", "new_string": "debug: true"}
36414
+ ]</edits>
36415
+ </multi_edit>
36416
+
36417
+ Mixed edit modes in one batch:
36418
+ <multi_edit>
36419
+ <edits>[
36420
+ {"file_path": "src/utils.js", "symbol": "oldHelper", "new_string": "function newHelper() { return 42; }"},
36421
+ {"file_path": "src/main.js", "old_string": "oldHelper()", "new_string": "newHelper()", "replace_all": true},
36422
+ {"file_path": "src/index.js", "start_line": "10", "end_line": "12", "new_string": "export { newHelper };"}
36423
+ ]</edits>
36424
+ </multi_edit>`;
36310
36425
  }
36311
36426
  });
36312
36427
 
@@ -36799,7 +36914,8 @@ function getValidParamsForTool(toolName) {
36799
36914
  task: taskSchema,
36800
36915
  attempt_completion: attemptCompletionSchema,
36801
36916
  edit: editSchema,
36802
- create: createSchema
36917
+ create: createSchema,
36918
+ multi_edit: multiEditSchema
36803
36919
  };
36804
36920
  const schema = schemaMap[toolName];
36805
36921
  if (!schema) {
@@ -36839,7 +36955,7 @@ function parseXmlToolCall(xmlString, validTools = DEFAULT_VALID_TOOLS) {
36839
36955
  const closeTag = `</${toolName}>`;
36840
36956
  const openIndex = earliestOpenIndex;
36841
36957
  let closeIndex;
36842
- if (toolName === "attempt_completion") {
36958
+ if (LAST_INDEX_TOOLS.has(toolName)) {
36843
36959
  closeIndex = xmlString.lastIndexOf(closeTag);
36844
36960
  if (closeIndex !== -1 && closeIndex <= openIndex + openTag.length) {
36845
36961
  closeIndex = -1;
@@ -36864,7 +36980,15 @@ function parseXmlToolCall(xmlString, validTools = DEFAULT_VALID_TOOLS) {
36864
36980
  if (paramOpenIndex === -1) {
36865
36981
  continue;
36866
36982
  }
36867
- let paramCloseIndex = innerContent.indexOf(paramCloseTag, paramOpenIndex + paramOpenTag.length);
36983
+ let paramCloseIndex;
36984
+ if (RAW_CONTENT_PARAMS.has(paramName)) {
36985
+ paramCloseIndex = innerContent.lastIndexOf(paramCloseTag);
36986
+ if (paramCloseIndex !== -1 && paramCloseIndex <= paramOpenIndex + paramOpenTag.length) {
36987
+ paramCloseIndex = -1;
36988
+ }
36989
+ } else {
36990
+ paramCloseIndex = innerContent.indexOf(paramCloseTag, paramOpenIndex + paramOpenTag.length);
36991
+ }
36868
36992
  if (paramCloseIndex === -1) {
36869
36993
  let nextTagIndex = innerContent.length;
36870
36994
  for (const nextParam of validParams) {
@@ -36876,18 +37000,26 @@ function parseXmlToolCall(xmlString, validTools = DEFAULT_VALID_TOOLS) {
36876
37000
  }
36877
37001
  paramCloseIndex = nextTagIndex;
36878
37002
  }
36879
- let paramValue = unescapeXmlEntities(innerContent.substring(
37003
+ const rawValue = innerContent.substring(
36880
37004
  paramOpenIndex + paramOpenTag.length,
36881
37005
  paramCloseIndex
36882
- ).trim());
36883
- if (paramValue.toLowerCase() === "true") {
36884
- paramValue = true;
36885
- } else if (paramValue.toLowerCase() === "false") {
36886
- paramValue = false;
36887
- } else if (!isNaN(paramValue) && paramValue.trim() !== "") {
36888
- const num = Number(paramValue);
36889
- if (Number.isFinite(num)) {
36890
- paramValue = num;
37006
+ );
37007
+ let paramValue;
37008
+ if (RAW_CONTENT_PARAMS.has(paramName)) {
37009
+ paramValue = unescapeXmlEntities(rawValue.replace(/^\n/, "").replace(/\n$/, ""));
37010
+ } else {
37011
+ paramValue = unescapeXmlEntities(rawValue.trim());
37012
+ }
37013
+ if (!RAW_CONTENT_PARAMS.has(paramName)) {
37014
+ if (paramValue.toLowerCase() === "true") {
37015
+ paramValue = true;
37016
+ } else if (paramValue.toLowerCase() === "false") {
37017
+ paramValue = false;
37018
+ } else if (!isNaN(paramValue) && paramValue.trim() !== "") {
37019
+ const num = Number(paramValue);
37020
+ if (Number.isFinite(num)) {
37021
+ paramValue = num;
37022
+ }
36891
37023
  }
36892
37024
  }
36893
37025
  params[paramName] = paramValue;
@@ -36930,6 +37062,7 @@ function detectUnrecognizedToolCall(xmlString, validTools) {
36930
37062
  "readImage",
36931
37063
  "edit",
36932
37064
  "create",
37065
+ "multi_edit",
36933
37066
  "delegate",
36934
37067
  "bash",
36935
37068
  "task",
@@ -37059,7 +37192,7 @@ function resolveTargetPath(target, cwd) {
37059
37192
  }
37060
37193
  return filePart + suffix;
37061
37194
  }
37062
- 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, bashDescription, analyzeAllDescription, DEFAULT_VALID_TOOLS;
37195
+ 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, bashDescription, analyzeAllDescription, DEFAULT_VALID_TOOLS, RAW_CONTENT_PARAMS, LAST_INDEX_TOOLS;
37063
37196
  var init_common2 = __esm({
37064
37197
  "src/tools/common.js"() {
37065
37198
  "use strict";
@@ -37479,6 +37612,8 @@ Capabilities:
37479
37612
  "task",
37480
37613
  "attempt_completion"
37481
37614
  ];
37615
+ RAW_CONTENT_PARAMS = /* @__PURE__ */ new Set(["content", "new_string", "old_string"]);
37616
+ LAST_INDEX_TOOLS = /* @__PURE__ */ new Set(["attempt_completion", "create", "edit"]);
37482
37617
  }
37483
37618
  });
37484
37619
 
@@ -38144,6 +38279,9 @@ function createTools(configOptions) {
38144
38279
  if (configOptions.allowEdit && isToolAllowed("create")) {
38145
38280
  tools2.createTool = createTool(configOptions);
38146
38281
  }
38282
+ if (configOptions.allowEdit && isToolAllowed("multi_edit")) {
38283
+ tools2.multiEditTool = multiEditTool(configOptions);
38284
+ }
38147
38285
  return tools2;
38148
38286
  }
38149
38287
  function parseXmlToolCallWithThinking(xmlString, validTools) {
@@ -40059,7 +40197,11 @@ var init_esm3 = __esm({
40059
40197
  #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
40060
40198
  const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
40061
40199
  const lastgs = pattern.lastIndexOf(GLOBSTAR);
40062
- const [head2, body, tail] = [
40200
+ const [head2, body, tail] = partial ? [
40201
+ pattern.slice(patternIndex, firstgs),
40202
+ pattern.slice(firstgs + 1),
40203
+ []
40204
+ ] : [
40063
40205
  pattern.slice(patternIndex, firstgs),
40064
40206
  pattern.slice(firstgs + 1, lastgs),
40065
40207
  pattern.slice(lastgs + 1)
@@ -40096,7 +40238,7 @@ var init_esm3 = __esm({
40096
40238
  return false;
40097
40239
  }
40098
40240
  }
40099
- return sawSome;
40241
+ return partial || sawSome;
40100
40242
  }
40101
40243
  const bodySegments = [[[], 0]];
40102
40244
  let currentBody = bodySegments[0];
@@ -40145,7 +40287,7 @@ var init_esm3 = __esm({
40145
40287
  }
40146
40288
  fileIndex++;
40147
40289
  }
40148
- return null;
40290
+ return partial || null;
40149
40291
  }
40150
40292
  #matchOne(file, pattern, partial, fileIndex, patternIndex) {
40151
40293
  let fi;
@@ -45529,6 +45671,13 @@ function createWrappedTools(baseTools) {
45529
45671
  baseTools.createTool.execute
45530
45672
  );
45531
45673
  }
45674
+ if (baseTools.multiEditTool) {
45675
+ wrappedTools.multiEditToolInstance = wrapToolWithEmitter(
45676
+ baseTools.multiEditTool,
45677
+ "multi_edit",
45678
+ baseTools.multiEditTool.execute
45679
+ );
45680
+ }
45532
45681
  return wrappedTools;
45533
45682
  }
45534
45683
  var import_child_process6, import_util11, import_crypto4, import_events, import_fs7, import_fs8, import_path8, toolCallEmitter, activeToolExecutions, wrapToolWithEmitter, listFilesTool, searchFilesTool, listFilesToolInstance, searchFilesToolInstance;
@@ -82622,6 +82771,15 @@ function normalizeJsonQuotes(str) {
82622
82771
  }
82623
82772
  return result;
82624
82773
  }
82774
+ function isCodeBlockEmbeddedInDocument(text, match2) {
82775
+ const beforeBlock = text.substring(0, match2.index).trim();
82776
+ const afterBlock = text.substring(match2.index + match2[0].length).trim();
82777
+ const hasMarkdownHeadings = /^#{1,6}\s/m.test(beforeBlock) || /^#{1,6}\s/m.test(afterBlock);
82778
+ if (hasMarkdownHeadings) {
82779
+ return true;
82780
+ }
82781
+ return false;
82782
+ }
82625
82783
  function cleanSchemaResponse(response) {
82626
82784
  if (!response || typeof response !== "string") {
82627
82785
  return response;
@@ -82641,11 +82799,11 @@ function cleanSchemaResponse(response) {
82641
82799
  return cleanSchemaResponse(innerContent);
82642
82800
  }
82643
82801
  const jsonBlockMatch = trimmed.match(/```json\s*\n([\s\S]*?)\n```/);
82644
- if (jsonBlockMatch) {
82802
+ if (jsonBlockMatch && !isCodeBlockEmbeddedInDocument(trimmed, jsonBlockMatch)) {
82645
82803
  return normalizeJsonQuotes(jsonBlockMatch[1].trim());
82646
82804
  }
82647
82805
  const anyBlockMatch = trimmed.match(/```\s*\n([{\[][\s\S]*?[}\]])\s*```/);
82648
- if (anyBlockMatch) {
82806
+ if (anyBlockMatch && !isCodeBlockEmbeddedInDocument(trimmed, anyBlockMatch)) {
82649
82807
  return normalizeJsonQuotes(anyBlockMatch[1].trim());
82650
82808
  }
82651
82809
  const codeBlockPatterns = [
@@ -82654,7 +82812,7 @@ function cleanSchemaResponse(response) {
82654
82812
  ];
82655
82813
  for (const pattern of codeBlockPatterns) {
82656
82814
  const match2 = trimmed.match(pattern);
82657
- if (match2) {
82815
+ if (match2 && !isCodeBlockEmbeddedInDocument(trimmed, match2)) {
82658
82816
  return normalizeJsonQuotes(match2[1].trim());
82659
82817
  }
82660
82818
  }
@@ -82665,7 +82823,7 @@ function cleanSchemaResponse(response) {
82665
82823
  }
82666
82824
  const codeBlockStartPattern = /```(?:json)?\s*\n?\s*([{\[])/;
82667
82825
  const codeBlockMatch = trimmed.match(codeBlockStartPattern);
82668
- if (codeBlockMatch) {
82826
+ if (codeBlockMatch && !isCodeBlockEmbeddedInDocument(trimmed, codeBlockMatch)) {
82669
82827
  const startIndex = codeBlockMatch.index + codeBlockMatch[0].length - 1;
82670
82828
  const openChar = codeBlockMatch[1];
82671
82829
  const closeChar = openChar === "{" ? "}" : "]";
@@ -104363,6 +104521,10 @@ function parseSimpleCommand(command) {
104363
104521
  // Logical OR
104364
104522
  /(?<!\\);/,
104365
104523
  // Command separator (but not escaped \;)
104524
+ /\n/,
104525
+ // Newline command separator (multi-line commands)
104526
+ /\r/,
104527
+ // Carriage return (CRLF line endings)
104366
104528
  /&$/,
104367
104529
  // Background execution
104368
104530
  /\$\(/,
@@ -104469,6 +104631,8 @@ function isComplexPattern(pattern) {
104469
104631
  // Logical OR
104470
104632
  /;/,
104471
104633
  // Command separator
104634
+ /\n/,
104635
+ // Newline command separator
104472
104636
  /&$/,
104473
104637
  // Background execution
104474
104638
  /\$\(/,
@@ -104841,6 +105005,26 @@ var init_bashPermissions = __esm({
104841
105005
  i5++;
104842
105006
  continue;
104843
105007
  }
105008
+ if (char === "\n" || char === "\r" && nextChar === "\n") {
105009
+ if (current2.trim()) {
105010
+ components.push(current2.trim());
105011
+ }
105012
+ current2 = "";
105013
+ if (char === "\r") {
105014
+ i5 += 2;
105015
+ } else {
105016
+ i5++;
105017
+ }
105018
+ continue;
105019
+ }
105020
+ if (char === "\r") {
105021
+ if (current2.trim()) {
105022
+ components.push(current2.trim());
105023
+ }
105024
+ current2 = "";
105025
+ i5++;
105026
+ continue;
105027
+ }
104844
105028
  }
104845
105029
  current2 += char;
104846
105030
  i5++;
@@ -108617,6 +108801,9 @@ var init_ProbeAgent = __esm({
108617
108801
  if (wrappedTools.createToolInstance && isToolAllowed("create")) {
108618
108802
  this.toolImplementations.create = wrappedTools.createToolInstance;
108619
108803
  }
108804
+ if (wrappedTools.multiEditToolInstance && isToolAllowed("multi_edit")) {
108805
+ this.toolImplementations.multi_edit = wrappedTools.multiEditToolInstance;
108806
+ }
108620
108807
  }
108621
108808
  this.wrappedTools = wrappedTools;
108622
108809
  if (this.debug) {
@@ -109906,6 +110093,10 @@ Workspace: ${this.allowedFolders.join(", ")}`;
109906
110093
  }
109907
110094
  if (this.allowEdit && isToolAllowed("create")) {
109908
110095
  toolDefinitions += `${createToolDefinition}
110096
+ `;
110097
+ }
110098
+ if (this.allowEdit && isToolAllowed("multi_edit")) {
110099
+ toolDefinitions += `${multiEditToolDefinition}
109909
110100
  `;
109910
110101
  }
109911
110102
  if (this.enableBash && isToolAllowed("bash")) {
@@ -110002,6 +110193,9 @@ The configuration is loaded from src/config.js lines 15-25 which contains the da
110002
110193
  if (this.allowEdit && isToolAllowed("create")) {
110003
110194
  availableToolsList += "- create: Create new files with specified content.\n";
110004
110195
  }
110196
+ if (this.allowEdit && isToolAllowed("multi_edit")) {
110197
+ availableToolsList += "- multi_edit: Apply multiple file edits in one call using a JSON array of operations.\n";
110198
+ }
110005
110199
  if (this.enableDelegate && isToolAllowed("delegate")) {
110006
110200
  availableToolsList += "- delegate: Delegate big distinct tasks to specialized probe subagents.\n";
110007
110201
  }
@@ -110596,6 +110790,9 @@ You are working with a workspace. Available paths: ${workspaceDesc}
110596
110790
  if (this.allowEdit && this.allowedTools.isEnabled("create")) {
110597
110791
  validTools.push("create");
110598
110792
  }
110793
+ if (this.allowEdit && this.allowedTools.isEnabled("multi_edit")) {
110794
+ validTools.push("multi_edit");
110795
+ }
110599
110796
  if (this.enableBash && this.allowedTools.isEnabled("bash")) {
110600
110797
  validTools.push("bash");
110601
110798
  }
@@ -113702,6 +113899,10 @@ __export(tools_exports, {
113702
113899
  extractTool: () => extractTool,
113703
113900
  getCleanupExecutePlanToolDefinition: () => getCleanupExecutePlanToolDefinition,
113704
113901
  getExecutePlanToolDefinition: () => getExecutePlanToolDefinition,
113902
+ multiEditDescription: () => multiEditDescription,
113903
+ multiEditSchema: () => multiEditSchema,
113904
+ multiEditTool: () => multiEditTool,
113905
+ multiEditToolDefinition: () => multiEditToolDefinition,
113705
113906
  parseAndResolvePaths: () => parseAndResolvePaths,
113706
113907
  querySchema: () => querySchema,
113707
113908
  queryTool: () => queryTool,
@@ -114353,6 +114554,9 @@ __export(index_exports, {
114353
114554
  initializeSimpleTelemetryFromOptions: () => initializeSimpleTelemetryFromOptions,
114354
114555
  listFilesByLevel: () => listFilesByLevel,
114355
114556
  listFilesToolInstance: () => listFilesToolInstance,
114557
+ multiEditSchema: () => multiEditSchema,
114558
+ multiEditTool: () => multiEditTool,
114559
+ multiEditToolDefinition: () => multiEditToolDefinition,
114356
114560
  parseXmlToolCall: () => parseXmlToolCall,
114357
114561
  query: () => query,
114358
114562
  querySchema: () => querySchema,
@@ -114448,6 +114652,9 @@ init_index();
114448
114652
  initializeSimpleTelemetryFromOptions,
114449
114653
  listFilesByLevel,
114450
114654
  listFilesToolInstance,
114655
+ multiEditSchema,
114656
+ multiEditTool,
114657
+ multiEditToolDefinition,
114451
114658
  parseXmlToolCall,
114452
114659
  query,
114453
114660
  querySchema,