UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

2 lines • 1.29 kB
import{z}from"#compiled/zod/index.js";import{defineTool}from"#tools/definition.js";import{toolLabel}from"#tools/tool-label.js";import{executeGlobOnSandbox}from"#execution/sandbox/glob-tool.js";const GLOB_INPUT_SCHEMA=z.strictObject({limit:z.number().int().min(1).max(1e3).describe(`Maximum number of results to return. Defaults to 100.`).optional(),path:z.string().describe(`The directory to search in. Defaults to /workspace. Must be an absolute path or begin with $HOME/. Omit to use the default.`).optional(),pattern:z.string().describe(`The glob pattern to match files against (e.g. "**/*.ts", "src/**/*.js").`)}),GLOB_OUTPUT_SCHEMA=z.strictObject({content:z.string(),count:z.number().int(),path:z.string(),truncated:z.boolean()}),glob=defineTool({label:{start:e=>toolLabel(`Find`,e.pattern)},description:[`Fast file pattern matching tool that works with any codebase size.`,``,`Usage:`,`- Supports glob patterns like "**/*.js" or "src/**/*.ts".`,`- Returns matching file paths.`,`- Call this tool in parallel when you know there are multiple patterns to search for.`].join(` `),async execute(e,t){return await executeGlobOnSandbox(await t.getSandbox(),e)},inputSchema:GLOB_INPUT_SCHEMA,outputSchema:GLOB_OUTPUT_SCHEMA});export{GLOB_INPUT_SCHEMA,GLOB_OUTPUT_SCHEMA,glob as default,glob};