@agentforge/tools 0.16.77 → 0.16.79

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.
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import { EventEmitter } from 'events';
14
14
  import { Readable } from 'stream';
15
15
  import { createHash, randomUUID } from 'crypto';
16
16
  import { promises } from 'fs';
17
- import * as path7 from 'path';
17
+ import * as path from 'path';
18
18
  import { format, parse as parse$1, isValid, add, sub, differenceInDays, differenceInHours, differenceInMinutes, isAfter, isBefore } from 'date-fns';
19
19
 
20
20
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
@@ -670,7 +670,7 @@ function isRetryableError(error) {
670
670
  return false;
671
671
  }
672
672
  function sleep(ms) {
673
- return new Promise((resolve2) => setTimeout(resolve2, ms));
673
+ return new Promise((resolve3) => setTimeout(resolve3, ms));
674
674
  }
675
675
  async function retryWithBackoff(fn, config = DEFAULT_RETRY_CONFIG) {
676
676
  let lastError;
@@ -2179,8 +2179,8 @@ var objectOmitSchema = z.object({
2179
2179
  });
2180
2180
 
2181
2181
  // src/data/transformer/tools/shared.ts
2182
- function getNestedValue(value, path12) {
2183
- return path12.split(".").reduce((current, key) => {
2182
+ function getNestedValue(value, path13) {
2183
+ return path13.split(".").reduce((current, key) => {
2184
2184
  if (current == null) {
2185
2185
  return void 0;
2186
2186
  }
@@ -2570,7 +2570,7 @@ function isRetryableError2(error) {
2570
2570
  return false;
2571
2571
  }
2572
2572
  function sleep2(ms) {
2573
- return new Promise((resolve2) => setTimeout(resolve2, ms));
2573
+ return new Promise((resolve3) => setTimeout(resolve3, ms));
2574
2574
  }
2575
2575
  async function retryWithBackoff2(fn, config = DEFAULT_RETRY_CONFIG2) {
2576
2576
  let lastError;
@@ -3469,16 +3469,16 @@ function formatRelationship(rel) {
3469
3469
  properties: formatValue(rel.properties)
3470
3470
  };
3471
3471
  }
3472
- function formatPath(path12) {
3472
+ function formatPath(path13) {
3473
3473
  return {
3474
- start: formatNode(path12.start),
3475
- end: formatNode(path12.end),
3476
- segments: path12.segments.map((segment) => ({
3474
+ start: formatNode(path13.start),
3475
+ end: formatNode(path13.end),
3476
+ segments: path13.segments.map((segment) => ({
3477
3477
  start: formatNode(segment.start),
3478
3478
  relationship: formatRelationship(segment.relationship),
3479
3479
  end: formatNode(segment.end)
3480
3480
  })),
3481
- length: path12.length
3481
+ length: path13.length
3482
3482
  };
3483
3483
  }
3484
3484
  function formatResults(records) {
@@ -5655,8 +5655,8 @@ function toBatchErrorMessage(error) {
5655
5655
  return error instanceof Error ? error.message : String(error);
5656
5656
  }
5657
5657
  function delayBatchRetry(ms) {
5658
- return new Promise((resolve2) => {
5659
- setTimeout(resolve2, ms);
5658
+ return new Promise((resolve3) => {
5659
+ setTimeout(resolve3, ms);
5660
5660
  });
5661
5661
  }
5662
5662
 
@@ -6082,7 +6082,7 @@ function withTransactionTimeout(operation, timeoutMs, onTimeout) {
6082
6082
  if (!timeoutMs) {
6083
6083
  return operation;
6084
6084
  }
6085
- return new Promise((resolve2, reject) => {
6085
+ return new Promise((resolve3, reject) => {
6086
6086
  let timedOut = false;
6087
6087
  const timer = setTimeout(() => {
6088
6088
  timedOut = true;
@@ -6094,7 +6094,7 @@ function withTransactionTimeout(operation, timeoutMs, onTimeout) {
6094
6094
  return;
6095
6095
  }
6096
6096
  clearTimeout(timer);
6097
- resolve2(result);
6097
+ resolve3(result);
6098
6098
  }).catch((error) => {
6099
6099
  if (timedOut) {
6100
6100
  return;
@@ -9327,11 +9327,135 @@ var fileDeleteSchema = z.object({
9327
9327
  var fileExistsSchema = z.object({
9328
9328
  path: z.string().describe("Path to check")
9329
9329
  });
9330
- function createFileReaderTool(defaultEncoding = "utf8") {
9330
+ var FileSystemPolicyError = class extends Error {
9331
+ constructor(message, operation, inputPath) {
9332
+ super(message);
9333
+ this.operation = operation;
9334
+ this.inputPath = inputPath;
9335
+ this.name = "FileSystemPolicyError";
9336
+ }
9337
+ code = "FILE_SYSTEM_POLICY_VIOLATION";
9338
+ };
9339
+ function containsTraversal(inputPath) {
9340
+ return inputPath.split(/[\\/]+/).includes("..");
9341
+ }
9342
+ function isWithinRoot(root, target) {
9343
+ const relative4 = path.relative(root, target);
9344
+ return relative4 === "" || !relative4.startsWith(`..${path.sep}`) && relative4 !== ".." && !path.isAbsolute(relative4);
9345
+ }
9346
+ async function resolveWithMissingTail(inputPath) {
9347
+ let currentPath = inputPath;
9348
+ const missingSegments = [];
9349
+ while (true) {
9350
+ try {
9351
+ const resolvedPath = await promises.realpath(currentPath);
9352
+ return path.join(resolvedPath, ...missingSegments);
9353
+ } catch (error) {
9354
+ const code = error.code;
9355
+ if (code !== "ENOENT" && code !== "ENOTDIR") {
9356
+ throw error;
9357
+ }
9358
+ const parentPath = path.dirname(currentPath);
9359
+ if (parentPath === currentPath) {
9360
+ throw error;
9361
+ }
9362
+ missingSegments.unshift(path.basename(currentPath));
9363
+ currentPath = parentPath;
9364
+ }
9365
+ }
9366
+ }
9367
+ var FileSystemPolicy = class {
9368
+ allowedRoots;
9369
+ allowOutsideRoots;
9370
+ allowRootDeletion;
9371
+ baseDirectory;
9372
+ constructor(options = {}) {
9373
+ const configuredRoots = [
9374
+ ...options.allowedRoots ?? [],
9375
+ ...options.workspaceRoot ? [options.workspaceRoot] : []
9376
+ ];
9377
+ this.allowedRoots = [...new Set(configuredRoots.map((root) => path.resolve(root)))];
9378
+ this.baseDirectory = path.resolve(options.workspaceRoot ?? process.cwd());
9379
+ this.allowOutsideRoots = options.allowOutsideRoots ?? this.allowedRoots.length === 0;
9380
+ this.allowRootDeletion = options.allowRootDeletion ?? this.allowOutsideRoots;
9381
+ }
9382
+ async resolvePath(inputPath, operation) {
9383
+ const { resolvedPath } = await this.resolvePathWithRoots(inputPath, operation);
9384
+ return resolvedPath;
9385
+ }
9386
+ async resolveDeletePath(inputPath, recursive) {
9387
+ const { resolvedPath, resolvedRoots } = await this.resolvePathWithRoots(inputPath, "directory deletion");
9388
+ if (recursive && !this.allowRootDeletion && resolvedRoots.some((root) => root === resolvedPath)) {
9389
+ throw new FileSystemPolicyError(
9390
+ "Filesystem policy blocked directory deletion: recursive deletion of an allowed root is not permitted",
9391
+ "directory deletion",
9392
+ inputPath
9393
+ );
9394
+ }
9395
+ return resolvedPath;
9396
+ }
9397
+ async resolvePathWithRoots(inputPath, operation) {
9398
+ const absolutePath = path.resolve(this.baseDirectory, inputPath);
9399
+ if (this.allowOutsideRoots) {
9400
+ return { resolvedPath: absolutePath, resolvedRoots: [] };
9401
+ }
9402
+ if (containsTraversal(inputPath)) {
9403
+ throw new FileSystemPolicyError(
9404
+ `Filesystem policy blocked ${operation}: path traversal is not allowed`,
9405
+ operation,
9406
+ inputPath
9407
+ );
9408
+ }
9409
+ let resolvedPath;
9410
+ try {
9411
+ resolvedPath = await resolveWithMissingTail(absolutePath);
9412
+ } catch {
9413
+ throw new FileSystemPolicyError(
9414
+ `Filesystem policy could not resolve ${operation} path`,
9415
+ operation,
9416
+ inputPath
9417
+ );
9418
+ }
9419
+ const resolvedRoots = await this.resolveRoots(operation, inputPath);
9420
+ if (!resolvedRoots.some((root) => isWithinRoot(root, resolvedPath))) {
9421
+ throw new FileSystemPolicyError(
9422
+ `Filesystem policy blocked ${operation}: path is outside the allowed roots`,
9423
+ operation,
9424
+ inputPath
9425
+ );
9426
+ }
9427
+ return { resolvedPath, resolvedRoots };
9428
+ }
9429
+ async resolveRoots(operation, inputPath) {
9430
+ try {
9431
+ return await Promise.all(this.allowedRoots.map((root) => promises.realpath(root)));
9432
+ } catch {
9433
+ throw new FileSystemPolicyError(
9434
+ `Filesystem policy could not resolve an allowed root for ${operation}`,
9435
+ operation,
9436
+ inputPath
9437
+ );
9438
+ }
9439
+ }
9440
+ };
9441
+ var DEFAULT_FILE_SYSTEM_POLICY = new FileSystemPolicy();
9442
+ function createFileSystemPolicy(options = {}) {
9443
+ return new FileSystemPolicy(options);
9444
+ }
9445
+ function resolveFileSystemPolicy(policy) {
9446
+ if (!policy) {
9447
+ return DEFAULT_FILE_SYSTEM_POLICY;
9448
+ }
9449
+ return policy instanceof FileSystemPolicy ? policy : createFileSystemPolicy(policy);
9450
+ }
9451
+
9452
+ // src/file/operations/tools/file-reader.ts
9453
+ function createFileReaderTool(defaultEncoding = "utf8", policy = DEFAULT_FILE_SYSTEM_POLICY) {
9331
9454
  return toolBuilder().name("file-reader").description("Read the contents of a file from the file system. Supports text and binary files with various encodings.").category(ToolCategory.FILE_SYSTEM).tags(["file", "read", "io", "filesystem"]).schema(fileReaderSchema).implementSafe(async (input) => {
9332
9455
  const encoding = input.encoding || defaultEncoding;
9333
- const content = await promises.readFile(input.path, encoding);
9334
- const stats = await promises.stat(input.path);
9456
+ const safePath = await policy.resolvePath(input.path, "file read");
9457
+ const content = await promises.readFile(safePath, encoding);
9458
+ const stats = await promises.stat(safePath);
9335
9459
  return {
9336
9460
  content,
9337
9461
  size: stats.size,
@@ -9340,16 +9464,17 @@ function createFileReaderTool(defaultEncoding = "utf8") {
9340
9464
  };
9341
9465
  }).build();
9342
9466
  }
9343
- function createFileWriterTool(defaultEncoding = "utf8", createDirsDefault = false) {
9467
+ function createFileWriterTool(defaultEncoding = "utf8", createDirsDefault = false, policy = DEFAULT_FILE_SYSTEM_POLICY) {
9344
9468
  return toolBuilder().name("file-writer").description("Write content to a file. Creates the file if it doesn't exist, or overwrites it if it does.").category(ToolCategory.FILE_SYSTEM).tags(["file", "write", "io", "filesystem"]).schema(fileWriterSchema).implementSafe(async (input) => {
9345
9469
  const encoding = input.encoding || defaultEncoding;
9346
9470
  const createDirs = input.createDirs ?? createDirsDefault;
9471
+ const safePath = await policy.resolvePath(input.path, "file write");
9347
9472
  if (createDirs) {
9348
- const dir = path7.dirname(input.path);
9473
+ const dir = path.dirname(safePath);
9349
9474
  await promises.mkdir(dir, { recursive: true });
9350
9475
  }
9351
- await promises.writeFile(input.path, input.content, encoding);
9352
- const stats = await promises.stat(input.path);
9476
+ await promises.writeFile(safePath, input.content, encoding);
9477
+ const stats = await promises.stat(safePath);
9353
9478
  return {
9354
9479
  path: input.path,
9355
9480
  size: stats.size,
@@ -9357,31 +9482,34 @@ function createFileWriterTool(defaultEncoding = "utf8", createDirsDefault = fals
9357
9482
  };
9358
9483
  }).build();
9359
9484
  }
9360
- function createFileAppendTool(defaultEncoding = "utf8") {
9485
+ function createFileAppendTool(defaultEncoding = "utf8", policy = DEFAULT_FILE_SYSTEM_POLICY) {
9361
9486
  return toolBuilder().name("file-append").description("Append content to the end of a file. Creates the file if it doesn't exist.").category(ToolCategory.FILE_SYSTEM).tags(["file", "append", "io", "filesystem"]).schema(fileAppendSchema).implementSafe(async (input) => {
9362
9487
  const encoding = input.encoding || defaultEncoding;
9363
- await promises.appendFile(input.path, input.content, encoding);
9364
- const stats = await promises.stat(input.path);
9488
+ const safePath = await policy.resolvePath(input.path, "file append");
9489
+ await promises.appendFile(safePath, input.content, encoding);
9490
+ const stats = await promises.stat(safePath);
9365
9491
  return {
9366
9492
  path: input.path,
9367
9493
  size: stats.size
9368
9494
  };
9369
9495
  }).build();
9370
9496
  }
9371
- function createFileDeleteTool() {
9497
+ function createFileDeleteTool(policy = DEFAULT_FILE_SYSTEM_POLICY) {
9372
9498
  return toolBuilder().name("file-delete").description("Delete a file from the file system. Returns an error if the file doesn't exist.").category(ToolCategory.FILE_SYSTEM).tags(["file", "delete", "remove", "filesystem"]).schema(fileDeleteSchema).implementSafe(async (input) => {
9373
- await promises.unlink(input.path);
9499
+ const safePath = await policy.resolvePath(input.path, "file deletion");
9500
+ await promises.unlink(safePath);
9374
9501
  return {
9375
9502
  path: input.path,
9376
9503
  message: "File deleted successfully"
9377
9504
  };
9378
9505
  }).build();
9379
9506
  }
9380
- function createFileExistsTool() {
9507
+ function createFileExistsTool(policy = DEFAULT_FILE_SYSTEM_POLICY) {
9381
9508
  return toolBuilder().name("file-exists").description("Check if a file or directory exists at the specified path.").category(ToolCategory.FILE_SYSTEM).tags(["file", "exists", "check", "filesystem"]).schema(fileExistsSchema).implement(async (input) => {
9382
9509
  try {
9383
- await promises.access(input.path);
9384
- const stats = await promises.stat(input.path);
9510
+ const safePath = await policy.resolvePath(input.path, "file existence check");
9511
+ await promises.access(safePath);
9512
+ const stats = await promises.stat(safePath);
9385
9513
  return {
9386
9514
  exists: true,
9387
9515
  path: input.path,
@@ -9390,7 +9518,13 @@ function createFileExistsTool() {
9390
9518
  size: stats.size,
9391
9519
  modified: stats.mtime.toISOString()
9392
9520
  };
9393
- } catch {
9521
+ } catch (error) {
9522
+ if (error instanceof FileSystemPolicyError) {
9523
+ return {
9524
+ success: false,
9525
+ error: error.message
9526
+ };
9527
+ }
9394
9528
  return {
9395
9529
  exists: false,
9396
9530
  path: input.path
@@ -9415,14 +9549,16 @@ var fileOperationTools = [
9415
9549
  function createFileOperationTools(config = {}) {
9416
9550
  const {
9417
9551
  defaultEncoding = "utf8",
9418
- createDirsDefault = false
9552
+ createDirsDefault = false,
9553
+ policy: policyInput
9419
9554
  } = config;
9555
+ const policy = resolveFileSystemPolicy(policyInput);
9420
9556
  return [
9421
- createFileReaderTool(defaultEncoding),
9422
- createFileWriterTool(defaultEncoding, createDirsDefault),
9423
- createFileAppendTool(defaultEncoding),
9424
- createFileDeleteTool(),
9425
- createFileExistsTool()
9557
+ createFileReaderTool(defaultEncoding, policy),
9558
+ createFileWriterTool(defaultEncoding, createDirsDefault, policy),
9559
+ createFileAppendTool(defaultEncoding, policy),
9560
+ createFileDeleteTool(policy),
9561
+ createFileExistsTool(policy)
9426
9562
  ];
9427
9563
  }
9428
9564
  var directoryListSchema = z.object({
@@ -9445,21 +9581,23 @@ var fileSearchSchema = z.object({
9445
9581
  recursive: z.boolean().default(true).describe("Search in subdirectories"),
9446
9582
  caseSensitive: z.boolean().default(false).describe("Case-sensitive pattern matching")
9447
9583
  });
9448
- function createDirectoryListTool(defaultRecursive = false, defaultIncludeDetails = false) {
9584
+ function createDirectoryListTool(defaultRecursive = false, defaultIncludeDetails = false, policy = DEFAULT_FILE_SYSTEM_POLICY) {
9449
9585
  return toolBuilder().name("directory-list").description("List all files and directories in a directory. Can optionally include file details and filter by extension.").category(ToolCategory.FILE_SYSTEM).tags(["directory", "list", "files", "filesystem"]).schema(directoryListSchema).implementSafe(async (input) => {
9586
+ const safePath = await policy.resolvePath(input.path, "directory listing");
9587
+ const includeDetails = input.includeDetails ?? defaultIncludeDetails;
9450
9588
  const listFiles = async (dir, recursive2) => {
9451
9589
  const entries = await promises.readdir(dir, { withFileTypes: true });
9452
9590
  const files2 = [];
9453
9591
  for (const entry of entries) {
9454
- const fullPath = path7.join(dir, entry.name);
9455
- const relativePath = path7.relative(input.path, fullPath);
9592
+ const fullPath = path.join(dir, entry.name);
9593
+ const relativePath = path.relative(safePath, fullPath);
9456
9594
  if (input.extension && !entry.name.endsWith(input.extension)) {
9457
9595
  if (!entry.isDirectory() || !recursive2) {
9458
9596
  continue;
9459
9597
  }
9460
9598
  }
9461
- if (input.includeDetails) {
9462
- const stats = await promises.stat(fullPath);
9599
+ if (includeDetails) {
9600
+ const stats = await promises.lstat(fullPath);
9463
9601
  files2.push({
9464
9602
  name: entry.name,
9465
9603
  path: relativePath,
@@ -9485,7 +9623,7 @@ function createDirectoryListTool(defaultRecursive = false, defaultIncludeDetails
9485
9623
  return files2;
9486
9624
  };
9487
9625
  const recursive = input.recursive ?? defaultRecursive;
9488
- const files = await listFiles(input.path, recursive);
9626
+ const files = await listFiles(safePath, recursive);
9489
9627
  return {
9490
9628
  path: input.path,
9491
9629
  files,
@@ -9493,37 +9631,40 @@ function createDirectoryListTool(defaultRecursive = false, defaultIncludeDetails
9493
9631
  };
9494
9632
  }).build();
9495
9633
  }
9496
- function createDirectoryCreateTool(defaultRecursive = true) {
9634
+ function createDirectoryCreateTool(defaultRecursive = true, policy = DEFAULT_FILE_SYSTEM_POLICY) {
9497
9635
  return toolBuilder().name("directory-create").description("Create a new directory. Can optionally create parent directories if they don't exist.").category(ToolCategory.FILE_SYSTEM).tags(["directory", "create", "mkdir", "filesystem"]).schema(directoryCreateSchema).implementSafe(async (input) => {
9498
9636
  const recursive = input.recursive ?? defaultRecursive;
9499
- await promises.mkdir(input.path, { recursive });
9637
+ const safePath = await policy.resolvePath(input.path, "directory creation");
9638
+ await promises.mkdir(safePath, { recursive });
9500
9639
  return {
9501
9640
  path: input.path,
9502
9641
  message: "Directory created successfully"
9503
9642
  };
9504
9643
  }).build();
9505
9644
  }
9506
- function createDirectoryDeleteTool(defaultRecursive = false) {
9645
+ function createDirectoryDeleteTool(defaultRecursive = false, policy = DEFAULT_FILE_SYSTEM_POLICY) {
9507
9646
  return toolBuilder().name("directory-delete").description("Delete a directory. Can optionally delete non-empty directories recursively.").category(ToolCategory.FILE_SYSTEM).tags(["directory", "delete", "remove", "filesystem"]).schema(directoryDeleteSchema).implementSafe(async (input) => {
9508
9647
  const recursive = input.recursive ?? defaultRecursive;
9509
- await promises.rm(input.path, { recursive, force: false });
9648
+ const safePath = await policy.resolveDeletePath(input.path, recursive);
9649
+ await promises.rm(safePath, { recursive, force: false });
9510
9650
  return {
9511
9651
  path: input.path,
9512
9652
  message: "Directory deleted successfully"
9513
9653
  };
9514
9654
  }).build();
9515
9655
  }
9516
- function createFileSearchTool(defaultRecursive = true, defaultCaseSensitive = false) {
9656
+ function createFileSearchTool(defaultRecursive = true, defaultCaseSensitive = false, policy = DEFAULT_FILE_SYSTEM_POLICY) {
9517
9657
  return toolBuilder().name("file-search").description("Search for files by name pattern in a directory. Supports wildcards and recursive search.").category(ToolCategory.FILE_SYSTEM).tags(["file", "search", "find", "filesystem"]).schema(fileSearchSchema).implementSafe(async (input) => {
9518
9658
  const recursive = input.recursive ?? defaultRecursive;
9519
9659
  const caseSensitive = input.caseSensitive ?? defaultCaseSensitive;
9660
+ const safeDirectory = await policy.resolvePath(input.directory, "file search");
9520
9661
  const searchFiles = async (dir) => {
9521
9662
  const entries = await promises.readdir(dir, { withFileTypes: true });
9522
9663
  const matches2 = [];
9523
9664
  const regexPattern = input.pattern.replace(/\./g, "\\.").replace(/\*/g, ".*");
9524
9665
  const regex = new RegExp(`^${regexPattern}$`, caseSensitive ? "" : "i");
9525
9666
  for (const entry of entries) {
9526
- const fullPath = path7.join(dir, entry.name);
9667
+ const fullPath = path.join(dir, entry.name);
9527
9668
  if (entry.isFile() && regex.test(entry.name)) {
9528
9669
  matches2.push(fullPath);
9529
9670
  }
@@ -9534,7 +9675,7 @@ function createFileSearchTool(defaultRecursive = true, defaultCaseSensitive = fa
9534
9675
  }
9535
9676
  return matches2;
9536
9677
  };
9537
- const matches = await searchFiles(input.directory);
9678
+ const matches = await searchFiles(safeDirectory);
9538
9679
  return {
9539
9680
  directory: input.directory,
9540
9681
  pattern: input.pattern,
@@ -9559,15 +9700,17 @@ function createDirectoryOperationTools(config = {}) {
9559
9700
  const {
9560
9701
  defaultRecursive = false,
9561
9702
  defaultIncludeDetails = false,
9562
- defaultCaseSensitive = false
9703
+ defaultCaseSensitive = false,
9704
+ policy: policyInput
9563
9705
  } = config;
9706
+ const policy = resolveFileSystemPolicy(policyInput);
9564
9707
  return [
9565
- createDirectoryListTool(defaultRecursive, defaultIncludeDetails),
9566
- createDirectoryCreateTool(true),
9708
+ createDirectoryListTool(defaultRecursive, defaultIncludeDetails, policy),
9709
+ createDirectoryCreateTool(true, policy),
9567
9710
  // Always default to true for create
9568
- createDirectoryDeleteTool(false),
9711
+ createDirectoryDeleteTool(false, policy),
9569
9712
  // Always default to false for delete (safety)
9570
- createFileSearchTool(defaultRecursive, defaultCaseSensitive)
9713
+ createFileSearchTool(defaultRecursive, defaultCaseSensitive, policy)
9571
9714
  ];
9572
9715
  }
9573
9716
  var pathJoinSchema = z.object({
@@ -9598,7 +9741,7 @@ var pathNormalizeSchema = z.object({
9598
9741
  });
9599
9742
  function createPathJoinTool() {
9600
9743
  return toolBuilder().name("path-join").description("Join multiple path segments into a single path. Handles platform-specific separators.").category(ToolCategory.FILE_SYSTEM).tags(["path", "join", "filesystem"]).schema(pathJoinSchema).implement(async (input) => {
9601
- const joined = path7.join(...input.segments);
9744
+ const joined = path.join(...input.segments);
9602
9745
  return {
9603
9746
  path: joined,
9604
9747
  segments: input.segments
@@ -9607,59 +9750,59 @@ function createPathJoinTool() {
9607
9750
  }
9608
9751
  function createPathResolveTool() {
9609
9752
  return toolBuilder().name("path-resolve").description("Resolve a sequence of paths into an absolute path. Resolves relative paths from the current working directory.").category(ToolCategory.FILE_SYSTEM).tags(["path", "resolve", "absolute", "filesystem"]).schema(pathResolveSchema).implement(async (input) => {
9610
- const resolved = path7.resolve(...input.paths);
9753
+ const resolved = path.resolve(...input.paths);
9611
9754
  return {
9612
9755
  path: resolved,
9613
- isAbsolute: path7.isAbsolute(resolved)
9756
+ isAbsolute: path.isAbsolute(resolved)
9614
9757
  };
9615
9758
  }).build();
9616
9759
  }
9617
9760
  function createPathParseTool() {
9618
9761
  return toolBuilder().name("path-parse").description("Parse a file path into its components (directory, filename, extension, etc.).").category(ToolCategory.FILE_SYSTEM).tags(["path", "parse", "filesystem"]).schema(pathParseSchema).implement(async (input) => {
9619
- const parsed = path7.parse(input.path);
9762
+ const parsed = path.parse(input.path);
9620
9763
  return {
9621
9764
  root: parsed.root,
9622
9765
  dir: parsed.dir,
9623
9766
  base: parsed.base,
9624
9767
  name: parsed.name,
9625
9768
  ext: parsed.ext,
9626
- isAbsolute: path7.isAbsolute(input.path)
9769
+ isAbsolute: path.isAbsolute(input.path)
9627
9770
  };
9628
9771
  }).build();
9629
9772
  }
9630
9773
  function createPathBasenameTool() {
9631
9774
  return toolBuilder().name("path-basename").description("Get the last portion of a path (filename with extension). Optionally remove the extension.").category(ToolCategory.FILE_SYSTEM).tags(["path", "basename", "filename", "filesystem"]).schema(pathBasenameSchema).implement(async (input) => {
9632
- const basename4 = input.removeExtension ? path7.basename(input.path, path7.extname(input.path)) : path7.basename(input.path);
9775
+ const basename5 = input.removeExtension ? path.basename(input.path, path.extname(input.path)) : path.basename(input.path);
9633
9776
  return {
9634
- basename: basename4,
9635
- extension: path7.extname(input.path)
9777
+ basename: basename5,
9778
+ extension: path.extname(input.path)
9636
9779
  };
9637
9780
  }).build();
9638
9781
  }
9639
9782
  function createPathDirnameTool() {
9640
9783
  return toolBuilder().name("path-dirname").description("Get the directory name of a path (everything except the last portion).").category(ToolCategory.FILE_SYSTEM).tags(["path", "dirname", "directory", "filesystem"]).schema(pathDirnameSchema).implement(async (input) => {
9641
- const dirname3 = path7.dirname(input.path);
9784
+ const dirname4 = path.dirname(input.path);
9642
9785
  return {
9643
- dirname: dirname3,
9644
- basename: path7.basename(input.path)
9786
+ dirname: dirname4,
9787
+ basename: path.basename(input.path)
9645
9788
  };
9646
9789
  }).build();
9647
9790
  }
9648
9791
  function createPathExtensionTool() {
9649
9792
  return toolBuilder().name("path-extension").description('Get the file extension from a path (including the dot, e.g., ".txt").').category(ToolCategory.FILE_SYSTEM).tags(["path", "extension", "ext", "filesystem"]).schema(pathExtensionSchema).implement(async (input) => {
9650
- const ext = path7.extname(input.path);
9793
+ const ext = path.extname(input.path);
9651
9794
  return {
9652
9795
  extension: ext,
9653
9796
  hasExtension: ext.length > 0,
9654
- filename: path7.basename(input.path, ext)
9797
+ filename: path.basename(input.path, ext)
9655
9798
  };
9656
9799
  }).build();
9657
9800
  }
9658
9801
  function createPathRelativeTool() {
9659
9802
  return toolBuilder().name("path-relative").description("Get the relative path from one path to another.").category(ToolCategory.FILE_SYSTEM).tags(["path", "relative", "filesystem"]).schema(pathRelativeSchema).implement(async (input) => {
9660
- const relative3 = path7.relative(input.from, input.to);
9803
+ const relative4 = path.relative(input.from, input.to);
9661
9804
  return {
9662
- relativePath: relative3,
9805
+ relativePath: relative4,
9663
9806
  from: input.from,
9664
9807
  to: input.to
9665
9808
  };
@@ -9667,7 +9810,7 @@ function createPathRelativeTool() {
9667
9810
  }
9668
9811
  function createPathNormalizeTool() {
9669
9812
  return toolBuilder().name("path-normalize").description('Normalize a path by resolving ".." and "." segments and removing duplicate separators.').category(ToolCategory.FILE_SYSTEM).tags(["path", "normalize", "filesystem"]).schema(pathNormalizeSchema).implement(async (input) => {
9670
- const normalized = path7.normalize(input.path);
9813
+ const normalized = path.normalize(input.path);
9671
9814
  return {
9672
9815
  normalized,
9673
9816
  original: input.path
@@ -10567,6 +10710,6 @@ function createAskHumanTool() {
10567
10710
  }
10568
10711
  var askHumanTool = createAskHumanTool();
10569
10712
 
10570
- export { AskHumanInputSchema, CalculatorSchema, ConnectionManager, ConnectionState, CreditCardValidatorSchema, CurrentDateTimeSchema, DEFAULT_BATCH_SIZE, DEFAULT_CHUNK_SIZE, DEFAULT_DESTINATION_POLICY, DEFAULT_RETRY_CONFIG2 as DEFAULT_RETRY_CONFIG, DateArithmeticSchema, DateComparisonSchema, DateDifferenceSchema, DateFormatterSchema, DestinationPolicyError, DuckDuckGoProvider, EmailValidatorSchema, EmbeddingManager, HttpMethod, IpValidatorSchema, MAX_BATCH_SIZE, MathFunctionsSchema, MissingPeerDependencyError, OpenAIEmbeddingProvider, PhoneValidatorSchema, RandomNumberSchema, SchemaInspector, SerperProvider, StatisticsSchema, StringCaseConverterSchema, StringJoinSchema, StringLengthSchema, StringReplaceSchema, StringSplitSchema, StringSubstringSchema, StringTrimSchema, UrlValidatorSimpleSchema, UuidValidatorSchema, archiveConfluencePage, arrayFilter, arrayFilterSchema, arrayGroupBy, arrayGroupBySchema, arrayMap, arrayMapSchema, arraySort, arraySortSchema, askHumanTool, assertDestinationAllowed, benchmarkBatchExecution, benchmarkStreamingSelectMemory, buildDeleteQuery, buildInsertQuery, buildSelectQuery, buildUpdateQuery, calculator, checkPeerDependency, confluenceTools, createArrayFilterTool, createArrayGroupByTool, createArrayMapTool, createArraySortTool, createAskHumanTool, createCalculatorTool, createConfluencePage, createConfluenceTools, createCreditCardValidatorTool, createCsvGeneratorTool, createCsvParserTool, createCsvToJsonTool, createCsvTools, createCurrentDateTimeTool, createDateArithmeticTool, createDateComparisonTool, createDateDifferenceTool, createDateFormatterTool, createDateTimeTools, createDirectoryCreateTool, createDirectoryDeleteTool, createDirectoryListTool, createDirectoryOperationTools, createDuckDuckGoProvider, createEmailValidatorTool, createExtractImagesTool, createExtractLinksTool, createFileAppendTool, createFileDeleteTool, createFileExistsTool, createFileOperationTools, createFileReaderTool, createFileSearchTool, createFileWriterTool, createHtmlParserTool, createHtmlParserTools, createHttpTools, createIpValidatorTool, createJsonMergeTool, createJsonParserTool, createJsonQueryTool, createJsonStringifyTool, createJsonToCsvTool, createJsonToXmlTool, createJsonTools, createJsonValidatorTool, createMathFunctionsTool, createMathOperationTools, createNeo4jCreateNodeWithEmbeddingTool, createNeo4jFindNodesTool, createNeo4jGetSchemaTool, createNeo4jQueryTool, createNeo4jTools, createNeo4jTraverseTool, createNeo4jVectorSearchTool, createNeo4jVectorSearchWithEmbeddingTool, createObjectOmitTool, createObjectPickTool, createPathBasenameTool, createPathDirnameTool, createPathExtensionTool, createPathJoinTool, createPathNormalizeTool, createPathParseTool, createPathRelativeTool, createPathResolveTool, createPathUtilityTools, createPhoneValidatorTool, createRandomNumberTool, createScraperTools, createSelectReadableStream, createSerperProvider, createSlackTools, createStatisticsTool, createStringCaseConverterTool, createStringJoinTool, createStringLengthTool, createStringReplaceTool, createStringSplitTool, createStringSubstringTool, createStringTrimTool, createStringUtilityTools, createTransformerTools, createUrlBuilderTool, createUrlQueryParserTool, createUrlValidatorSimpleTool, createUrlValidatorTool, createUrlValidatorTools, createUuidValidatorTool, createValidationTools, createWebScraperTool, createXmlGeneratorTool, createXmlParserTool, createXmlToJsonTool, createXmlTools, creditCardValidator, csvGenerator, csvGeneratorSchema, csvParser, csvParserSchema, csvToJson, csvToJsonSchema, csvTools, currentDateTime, dateArithmetic, dateComparison, dateDifference, dateFormatter, dateTimeTools, diffSchemas, directoryCreate, directoryCreateSchema, directoryDelete, directoryDeleteSchema, directoryList, directoryListSchema, directoryOperationTools, emailValidator, embeddingManager, executeBatchedTask, executeQuery2 as executeQuery, executeStreamingSelect, exportSchemaToJson, extractImages, extractImagesSchema, extractLinks, extractLinksSchema, fileAppend, fileAppendSchema, fileDelete, fileDeleteSchema, fileExists, fileExistsSchema, fileOperationTools, fileReader, fileReaderSchema, fileSearch, fileSearchSchema, fileWriter, fileWriterSchema, generateBatchEmbeddings, generateEmbedding, getCohereApiKey, getConfluencePage, getEmbeddingModel, getEmbeddingProvider, getHuggingFaceApiKey, getInstallationInstructions, getOllamaBaseUrl, getOpenAIApiKey, getPeerDependencyName, getSlackChannels, getSlackMessages, getSpacePages, getVendorTypeMap, getVoyageApiKey, htmlParser, htmlParserSchema, htmlParserTools, httpClient, httpGet, httpGetSchema, httpPost, httpPostSchema, httpRequestSchema, httpTools, importSchemaFromJson, initializeEmbeddings, initializeEmbeddingsWithConfig, initializeFromEnv, initializeNeo4jTools, ipValidator, isRetryableError2 as isRetryableError, jsonMerge, jsonMergeSchema, jsonParser, jsonParserSchema, jsonQuery, jsonQuerySchema, jsonStringify, jsonStringifySchema, jsonToCsv, jsonToCsvSchema, jsonToXml, jsonToXmlSchema, jsonTools, jsonValidator, jsonValidatorSchema, listConfluenceSpaces, mapColumnType, mapSchemaTypes, mathFunctions, mathOperationTools, neo4jCoreTools, neo4jCreateNodeWithEmbedding, neo4jCreateNodeWithEmbeddingSchema, neo4jFindNodes, neo4jFindNodesSchema, neo4jGetSchema, neo4jGetSchemaSchema, neo4jPool, neo4jQuery, neo4jQuerySchema, neo4jTools, neo4jTraverse, neo4jTraverseSchema, neo4jVectorSearch, neo4jVectorSearchSchema, neo4jVectorSearchWithEmbedding, neo4jVectorSearchWithEmbeddingSchema, notifySlack, objectOmit, objectOmitSchema, objectPick, objectPickSchema, pathBasename, pathBasenameSchema, pathDirname, pathDirnameSchema, pathExtension, pathExtensionSchema, pathJoin, pathJoinSchema, pathNormalize, pathNormalizeSchema, pathParse, pathParseSchema, pathRelative, pathRelativeSchema, pathResolve, pathResolveSchema, pathUtilityTools, phoneValidator, randomNumber, relationalDelete, relationalGetSchema, relationalInsert, relationalQuery, relationalSelect, relationalUpdate, requestWithDestinationPolicy, retryWithBackoff2 as retryWithBackoff, scraperTools, searchConfluence, searchResultSchema, sendSlackMessage, slackTools, statistics, streamSelectChunks, stringCaseConverter, stringJoin, stringLength, stringReplace, stringSplit, stringSubstring, stringTrim, stringUtilityTools, transformerArraySchema, transformerObjectSchema, transformerTools, transformerValueSchema, updateConfluencePage, urlBuilder, urlBuilderSchema, urlQueryParser, urlQueryParserSchema, urlValidator, urlValidatorSchema, urlValidatorSimple, urlValidatorTools, uuidValidator, validateBatch, validateColumnTypes, validateColumnsExist, validateTableExists, validateText, validationTools, webScraper, webScraperSchema, webSearch, webSearchOutputSchema, webSearchSchema, withTransaction, xmlGenerator, xmlGeneratorSchema, xmlParser, xmlParserSchema, xmlToJson, xmlToJsonSchema, xmlTools };
10713
+ export { AskHumanInputSchema, CalculatorSchema, ConnectionManager, ConnectionState, CreditCardValidatorSchema, CurrentDateTimeSchema, DEFAULT_BATCH_SIZE, DEFAULT_CHUNK_SIZE, DEFAULT_DESTINATION_POLICY, DEFAULT_FILE_SYSTEM_POLICY, DEFAULT_RETRY_CONFIG2 as DEFAULT_RETRY_CONFIG, DateArithmeticSchema, DateComparisonSchema, DateDifferenceSchema, DateFormatterSchema, DestinationPolicyError, DuckDuckGoProvider, EmailValidatorSchema, EmbeddingManager, FileSystemPolicy, FileSystemPolicyError, HttpMethod, IpValidatorSchema, MAX_BATCH_SIZE, MathFunctionsSchema, MissingPeerDependencyError, OpenAIEmbeddingProvider, PhoneValidatorSchema, RandomNumberSchema, SchemaInspector, SerperProvider, StatisticsSchema, StringCaseConverterSchema, StringJoinSchema, StringLengthSchema, StringReplaceSchema, StringSplitSchema, StringSubstringSchema, StringTrimSchema, UrlValidatorSimpleSchema, UuidValidatorSchema, archiveConfluencePage, arrayFilter, arrayFilterSchema, arrayGroupBy, arrayGroupBySchema, arrayMap, arrayMapSchema, arraySort, arraySortSchema, askHumanTool, assertDestinationAllowed, benchmarkBatchExecution, benchmarkStreamingSelectMemory, buildDeleteQuery, buildInsertQuery, buildSelectQuery, buildUpdateQuery, calculator, checkPeerDependency, confluenceTools, createArrayFilterTool, createArrayGroupByTool, createArrayMapTool, createArraySortTool, createAskHumanTool, createCalculatorTool, createConfluencePage, createConfluenceTools, createCreditCardValidatorTool, createCsvGeneratorTool, createCsvParserTool, createCsvToJsonTool, createCsvTools, createCurrentDateTimeTool, createDateArithmeticTool, createDateComparisonTool, createDateDifferenceTool, createDateFormatterTool, createDateTimeTools, createDirectoryCreateTool, createDirectoryDeleteTool, createDirectoryListTool, createDirectoryOperationTools, createDuckDuckGoProvider, createEmailValidatorTool, createExtractImagesTool, createExtractLinksTool, createFileAppendTool, createFileDeleteTool, createFileExistsTool, createFileOperationTools, createFileReaderTool, createFileSearchTool, createFileSystemPolicy, createFileWriterTool, createHtmlParserTool, createHtmlParserTools, createHttpTools, createIpValidatorTool, createJsonMergeTool, createJsonParserTool, createJsonQueryTool, createJsonStringifyTool, createJsonToCsvTool, createJsonToXmlTool, createJsonTools, createJsonValidatorTool, createMathFunctionsTool, createMathOperationTools, createNeo4jCreateNodeWithEmbeddingTool, createNeo4jFindNodesTool, createNeo4jGetSchemaTool, createNeo4jQueryTool, createNeo4jTools, createNeo4jTraverseTool, createNeo4jVectorSearchTool, createNeo4jVectorSearchWithEmbeddingTool, createObjectOmitTool, createObjectPickTool, createPathBasenameTool, createPathDirnameTool, createPathExtensionTool, createPathJoinTool, createPathNormalizeTool, createPathParseTool, createPathRelativeTool, createPathResolveTool, createPathUtilityTools, createPhoneValidatorTool, createRandomNumberTool, createScraperTools, createSelectReadableStream, createSerperProvider, createSlackTools, createStatisticsTool, createStringCaseConverterTool, createStringJoinTool, createStringLengthTool, createStringReplaceTool, createStringSplitTool, createStringSubstringTool, createStringTrimTool, createStringUtilityTools, createTransformerTools, createUrlBuilderTool, createUrlQueryParserTool, createUrlValidatorSimpleTool, createUrlValidatorTool, createUrlValidatorTools, createUuidValidatorTool, createValidationTools, createWebScraperTool, createXmlGeneratorTool, createXmlParserTool, createXmlToJsonTool, createXmlTools, creditCardValidator, csvGenerator, csvGeneratorSchema, csvParser, csvParserSchema, csvToJson, csvToJsonSchema, csvTools, currentDateTime, dateArithmetic, dateComparison, dateDifference, dateFormatter, dateTimeTools, diffSchemas, directoryCreate, directoryCreateSchema, directoryDelete, directoryDeleteSchema, directoryList, directoryListSchema, directoryOperationTools, emailValidator, embeddingManager, executeBatchedTask, executeQuery2 as executeQuery, executeStreamingSelect, exportSchemaToJson, extractImages, extractImagesSchema, extractLinks, extractLinksSchema, fileAppend, fileAppendSchema, fileDelete, fileDeleteSchema, fileExists, fileExistsSchema, fileOperationTools, fileReader, fileReaderSchema, fileSearch, fileSearchSchema, fileWriter, fileWriterSchema, generateBatchEmbeddings, generateEmbedding, getCohereApiKey, getConfluencePage, getEmbeddingModel, getEmbeddingProvider, getHuggingFaceApiKey, getInstallationInstructions, getOllamaBaseUrl, getOpenAIApiKey, getPeerDependencyName, getSlackChannels, getSlackMessages, getSpacePages, getVendorTypeMap, getVoyageApiKey, htmlParser, htmlParserSchema, htmlParserTools, httpClient, httpGet, httpGetSchema, httpPost, httpPostSchema, httpRequestSchema, httpTools, importSchemaFromJson, initializeEmbeddings, initializeEmbeddingsWithConfig, initializeFromEnv, initializeNeo4jTools, ipValidator, isRetryableError2 as isRetryableError, jsonMerge, jsonMergeSchema, jsonParser, jsonParserSchema, jsonQuery, jsonQuerySchema, jsonStringify, jsonStringifySchema, jsonToCsv, jsonToCsvSchema, jsonToXml, jsonToXmlSchema, jsonTools, jsonValidator, jsonValidatorSchema, listConfluenceSpaces, mapColumnType, mapSchemaTypes, mathFunctions, mathOperationTools, neo4jCoreTools, neo4jCreateNodeWithEmbedding, neo4jCreateNodeWithEmbeddingSchema, neo4jFindNodes, neo4jFindNodesSchema, neo4jGetSchema, neo4jGetSchemaSchema, neo4jPool, neo4jQuery, neo4jQuerySchema, neo4jTools, neo4jTraverse, neo4jTraverseSchema, neo4jVectorSearch, neo4jVectorSearchSchema, neo4jVectorSearchWithEmbedding, neo4jVectorSearchWithEmbeddingSchema, notifySlack, objectOmit, objectOmitSchema, objectPick, objectPickSchema, pathBasename, pathBasenameSchema, pathDirname, pathDirnameSchema, pathExtension, pathExtensionSchema, pathJoin, pathJoinSchema, pathNormalize, pathNormalizeSchema, pathParse, pathParseSchema, pathRelative, pathRelativeSchema, pathResolve, pathResolveSchema, pathUtilityTools, phoneValidator, randomNumber, relationalDelete, relationalGetSchema, relationalInsert, relationalQuery, relationalSelect, relationalUpdate, requestWithDestinationPolicy, resolveFileSystemPolicy, retryWithBackoff2 as retryWithBackoff, scraperTools, searchConfluence, searchResultSchema, sendSlackMessage, slackTools, statistics, streamSelectChunks, stringCaseConverter, stringJoin, stringLength, stringReplace, stringSplit, stringSubstring, stringTrim, stringUtilityTools, transformerArraySchema, transformerObjectSchema, transformerTools, transformerValueSchema, updateConfluencePage, urlBuilder, urlBuilderSchema, urlQueryParser, urlQueryParserSchema, urlValidator, urlValidatorSchema, urlValidatorSimple, urlValidatorTools, uuidValidator, validateBatch, validateColumnTypes, validateColumnsExist, validateTableExists, validateText, validationTools, webScraper, webScraperSchema, webSearch, webSearchOutputSchema, webSearchSchema, withTransaction, xmlGenerator, xmlGeneratorSchema, xmlParser, xmlParserSchema, xmlToJson, xmlToJsonSchema, xmlTools };
10571
10714
  //# sourceMappingURL=index.js.map
10572
10715
  //# sourceMappingURL=index.js.map