summaryrefslogtreecommitdiff
path: root/packages/core/src/tools/glob.ts
diff options
context:
space:
mode:
authormoon jooho <[email protected]>2025-07-04 09:13:02 +0900
committerGitHub <[email protected]>2025-07-04 00:13:02 +0000
commit8d3fec08e59b100da036b685d20b080203ba3a4c (patch)
treefdfb31c69d8cf15a536e650fb0fdd148d14051ae /packages/core/src/tools/glob.ts
parent654f8aeb614c3e5129f33d93aa9cfa06d347e3a0 (diff)
Add and improve JSDoc comments for core tool methods (#3128)
Diffstat (limited to 'packages/core/src/tools/glob.ts')
-rw-r--r--packages/core/src/tools/glob.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/core/src/tools/glob.ts b/packages/core/src/tools/glob.ts
index 0dd2f411..22dacc83 100644
--- a/packages/core/src/tools/glob.ts
+++ b/packages/core/src/tools/glob.ts
@@ -122,7 +122,11 @@ export class GlobTool extends BaseTool<GlobToolParams, ToolResult> {
}
/**
- * Checks if a path is within the root directory.
+ * Checks if a given path is within the root directory bounds.
+ * This security check prevents accessing files outside the designated root directory.
+ *
+ * @param pathToCheck The absolute path to validate
+ * @returns True if the path is within the root directory, false otherwise
*/
private isWithinRoot(pathToCheck: string): boolean {
const absolutePathToCheck = path.resolve(pathToCheck);