@morphllm/morphsdk 0.2.125 → 0.2.127
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/{chunk-DGYWACHC.js → chunk-3ZA7Y66U.js} +2 -2
- package/dist/{chunk-5L3TPS6A.js → chunk-6DRIR7AI.js} +5 -4
- package/dist/chunk-6DRIR7AI.js.map +1 -0
- package/dist/{chunk-G5YJDK5S.js → chunk-ADHGSV2D.js} +2 -2
- package/dist/{chunk-5PNMAWLC.js → chunk-DKODF3YG.js} +2 -2
- package/dist/{chunk-5PNMAWLC.js.map → chunk-DKODF3YG.js.map} +1 -1
- package/dist/{chunk-BQO3WODX.js → chunk-DS7YL4V3.js} +8 -13
- package/dist/chunk-DS7YL4V3.js.map +1 -0
- package/dist/{chunk-FEQJCZJQ.js → chunk-EGOCFCAH.js} +2 -2
- package/dist/{chunk-TFK4UOUE.js → chunk-EL6CCK7C.js} +6 -6
- package/dist/{chunk-IB4MEIQG.js → chunk-GDCVK6SP.js} +2 -2
- package/dist/{chunk-UGSV5LPO.js → chunk-GVF4Q75N.js} +2 -2
- package/dist/{chunk-TS3E6IRI.js → chunk-GWKCMFD6.js} +2 -2
- package/dist/{chunk-WZAZFW77.js → chunk-HZK5TEUK.js} +1 -1
- package/dist/{chunk-EF7ZYLA2.js → chunk-HZOTLGJH.js} +19 -12
- package/dist/chunk-HZOTLGJH.js.map +1 -0
- package/dist/{chunk-3MLWXJTJ.js → chunk-K2FXHDX2.js} +15 -10
- package/dist/chunk-K2FXHDX2.js.map +1 -0
- package/dist/{chunk-FAZO2LNY.js → chunk-K6YSD3DR.js} +2 -2
- package/dist/{chunk-ACHEU2V3.js → chunk-LX34ZO3N.js} +2 -2
- package/dist/{chunk-OFQRY3RM.js → chunk-LXBIP5FI.js} +18 -23
- package/dist/chunk-LXBIP5FI.js.map +1 -0
- package/dist/{chunk-F6HNFC2H.js → chunk-MJHAVXFK.js} +2 -2
- package/dist/{chunk-PUGSTXLO.js → chunk-NF2QWJDY.js} +6 -7
- package/dist/chunk-NF2QWJDY.js.map +1 -0
- package/dist/{chunk-6TH3VNCF.js → chunk-NQQS5BZZ.js} +3 -3
- package/dist/{chunk-V3HLOZK2.js → chunk-QLBRTLEI.js} +1 -1
- package/dist/{chunk-V3HLOZK2.js.map → chunk-QLBRTLEI.js.map} +1 -1
- package/dist/{chunk-57PXQ6IS.js → chunk-QOE522DB.js} +15 -15
- package/dist/chunk-QRXG5CAZ.js +27 -0
- package/dist/chunk-QRXG5CAZ.js.map +1 -0
- package/dist/{chunk-7RTJCQWB.js → chunk-QUULFOWB.js} +10 -5
- package/dist/chunk-QUULFOWB.js.map +1 -0
- package/dist/{chunk-33CP5QCC.js → chunk-R5IFI552.js} +3 -3
- package/dist/{chunk-33CP5QCC.js.map → chunk-R5IFI552.js.map} +1 -1
- package/dist/{chunk-IRNUW2DB.js → chunk-REJNS3OW.js} +8 -13
- package/dist/chunk-REJNS3OW.js.map +1 -0
- package/dist/{chunk-2S7ZQFIB.js → chunk-U73OIAJC.js} +2 -2
- package/dist/{chunk-OQGX4RZP.js → chunk-UAQ7UWZB.js} +2 -2
- package/dist/chunk-VCKJ22DX.js +131 -0
- package/dist/chunk-VCKJ22DX.js.map +1 -0
- package/dist/{chunk-2MK64KK4.js → chunk-YTUQEDWH.js} +2 -2
- package/dist/{chunk-H6KT7IXW.js → chunk-ZVAXTR2V.js} +2 -2
- package/dist/{chunk-BGL35LL6.js → chunk-ZYD2SEQK.js} +2 -2
- package/dist/{client-JHPwle1Z.d.ts → client-CNYzlN_6.d.ts} +6 -7
- package/dist/client.cjs +166 -579
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.ts +1 -2
- package/dist/client.js +27 -28
- package/dist/edge.cjs +2 -2
- package/dist/edge.cjs.map +1 -1
- package/dist/edge.js +4 -4
- package/dist/{finish-pPJfB0uO.d.ts → finish-DBKuo8yj.d.ts} +2 -0
- package/dist/index.cjs +166 -579
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +29 -30
- package/dist/modelrouter/core.cjs +2 -2
- package/dist/modelrouter/core.cjs.map +1 -1
- package/dist/modelrouter/core.js +3 -3
- package/dist/modelrouter/index.cjs +2 -2
- package/dist/modelrouter/index.cjs.map +1 -1
- package/dist/modelrouter/index.js +3 -3
- package/dist/tools/browser/anthropic.cjs +2 -2
- package/dist/tools/browser/anthropic.cjs.map +1 -1
- package/dist/tools/browser/anthropic.js +5 -5
- package/dist/tools/browser/core.cjs +2 -2
- package/dist/tools/browser/core.cjs.map +1 -1
- package/dist/tools/browser/core.js +4 -4
- package/dist/tools/browser/index.cjs +2 -2
- package/dist/tools/browser/index.cjs.map +1 -1
- package/dist/tools/browser/index.js +7 -7
- package/dist/tools/browser/openai.cjs +2 -2
- package/dist/tools/browser/openai.cjs.map +1 -1
- package/dist/tools/browser/openai.js +5 -5
- package/dist/tools/browser/profiles/core.cjs +2 -2
- package/dist/tools/browser/profiles/core.cjs.map +1 -1
- package/dist/tools/browser/profiles/core.js +3 -3
- package/dist/tools/browser/profiles/index.cjs +2 -2
- package/dist/tools/browser/profiles/index.cjs.map +1 -1
- package/dist/tools/browser/profiles/index.js +3 -3
- package/dist/tools/browser/vercel.cjs +2 -2
- package/dist/tools/browser/vercel.cjs.map +1 -1
- package/dist/tools/browser/vercel.js +5 -5
- package/dist/tools/codebase_search/anthropic.cjs +2 -2
- package/dist/tools/codebase_search/anthropic.cjs.map +1 -1
- package/dist/tools/codebase_search/anthropic.js +4 -4
- package/dist/tools/codebase_search/core.cjs +2 -2
- package/dist/tools/codebase_search/core.cjs.map +1 -1
- package/dist/tools/codebase_search/core.js +3 -3
- package/dist/tools/codebase_search/index.cjs +2 -2
- package/dist/tools/codebase_search/index.cjs.map +1 -1
- package/dist/tools/codebase_search/index.js +6 -6
- package/dist/tools/codebase_search/openai.cjs +2 -2
- package/dist/tools/codebase_search/openai.cjs.map +1 -1
- package/dist/tools/codebase_search/openai.js +4 -4
- package/dist/tools/codebase_search/vercel.cjs +2 -2
- package/dist/tools/codebase_search/vercel.cjs.map +1 -1
- package/dist/tools/codebase_search/vercel.js +4 -4
- package/dist/tools/fastapply/anthropic.cjs +2 -2
- package/dist/tools/fastapply/anthropic.cjs.map +1 -1
- package/dist/tools/fastapply/anthropic.js +4 -4
- package/dist/tools/fastapply/apply.cjs +2 -2
- package/dist/tools/fastapply/apply.cjs.map +1 -1
- package/dist/tools/fastapply/apply.js +2 -2
- package/dist/tools/fastapply/core.cjs +2 -2
- package/dist/tools/fastapply/core.cjs.map +1 -1
- package/dist/tools/fastapply/core.js +3 -3
- package/dist/tools/fastapply/index.cjs +2 -2
- package/dist/tools/fastapply/index.cjs.map +1 -1
- package/dist/tools/fastapply/index.js +6 -6
- package/dist/tools/fastapply/openai.cjs +2 -2
- package/dist/tools/fastapply/openai.cjs.map +1 -1
- package/dist/tools/fastapply/openai.js +4 -4
- package/dist/tools/fastapply/vercel.cjs +2 -2
- package/dist/tools/fastapply/vercel.cjs.map +1 -1
- package/dist/tools/fastapply/vercel.js +4 -4
- package/dist/tools/index.cjs +2 -2
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.js +6 -6
- package/dist/tools/utils/resilience.cjs +2 -2
- package/dist/tools/utils/resilience.cjs.map +1 -1
- package/dist/tools/utils/resilience.js +2 -2
- package/dist/tools/warp_grep/agent/config.cjs +1 -1
- package/dist/tools/warp_grep/agent/config.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/config.d.ts +1 -1
- package/dist/tools/warp_grep/agent/config.js +1 -1
- package/dist/tools/warp_grep/agent/formatter.cjs +3 -74
- package/dist/tools/warp_grep/agent/formatter.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/formatter.d.ts +1 -5
- package/dist/tools/warp_grep/agent/formatter.js +1 -1
- package/dist/tools/warp_grep/agent/parser.cjs +91 -242
- package/dist/tools/warp_grep/agent/parser.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/parser.d.ts +0 -8
- package/dist/tools/warp_grep/agent/parser.js +1 -1
- package/dist/tools/warp_grep/agent/runner.cjs +122 -543
- package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/runner.js +6 -7
- package/dist/tools/warp_grep/agent/types.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/types.d.ts +2 -0
- package/dist/tools/warp_grep/anthropic.cjs +152 -570
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.d.ts +2 -4
- package/dist/tools/warp_grep/anthropic.js +11 -15
- package/dist/tools/warp_grep/client.cjs +143 -558
- package/dist/tools/warp_grep/client.cjs.map +1 -1
- package/dist/tools/warp_grep/client.js +9 -10
- package/dist/tools/warp_grep/gemini.cjs +152 -570
- package/dist/tools/warp_grep/gemini.cjs.map +1 -1
- package/dist/tools/warp_grep/gemini.d.ts +2 -4
- package/dist/tools/warp_grep/gemini.js +18 -23
- package/dist/tools/warp_grep/gemini.js.map +1 -1
- package/dist/tools/warp_grep/harness.cjs +124 -540
- package/dist/tools/warp_grep/harness.cjs.map +1 -1
- package/dist/tools/warp_grep/harness.d.ts +4 -5
- package/dist/tools/warp_grep/harness.js +5 -11
- package/dist/tools/warp_grep/harness.js.map +1 -1
- package/dist/tools/warp_grep/index.cjs +147 -565
- package/dist/tools/warp_grep/index.cjs.map +1 -1
- package/dist/tools/warp_grep/index.d.ts +7 -4
- package/dist/tools/warp_grep/index.js +14 -20
- package/dist/tools/warp_grep/openai.cjs +152 -570
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.d.ts +2 -4
- package/dist/tools/warp_grep/openai.js +11 -15
- package/dist/tools/warp_grep/providers/local.cjs +17 -10
- package/dist/tools/warp_grep/providers/local.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/local.d.ts +6 -1
- package/dist/tools/warp_grep/providers/local.js +2 -2
- package/dist/tools/warp_grep/providers/remote.cjs +4 -5
- package/dist/tools/warp_grep/providers/remote.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/remote.js +2 -2
- package/dist/tools/warp_grep/providers/types.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/types.d.ts +2 -0
- package/dist/tools/warp_grep/vercel.cjs +151 -563
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.d.ts +2 -2
- package/dist/tools/warp_grep/vercel.js +11 -15
- package/dist/version.cjs +2 -2
- package/dist/version.cjs.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-3MLWXJTJ.js.map +0 -1
- package/dist/chunk-5L3TPS6A.js.map +0 -1
- package/dist/chunk-7RTJCQWB.js.map +0 -1
- package/dist/chunk-APP75CBN.js +0 -98
- package/dist/chunk-APP75CBN.js.map +0 -1
- package/dist/chunk-BQO3WODX.js.map +0 -1
- package/dist/chunk-EF7ZYLA2.js.map +0 -1
- package/dist/chunk-FMLHRJDF.js +0 -207
- package/dist/chunk-FMLHRJDF.js.map +0 -1
- package/dist/chunk-GHGJAQSJ.js +0 -282
- package/dist/chunk-GHGJAQSJ.js.map +0 -1
- package/dist/chunk-IRNUW2DB.js.map +0 -1
- package/dist/chunk-OFQRY3RM.js.map +0 -1
- package/dist/chunk-PUGSTXLO.js.map +0 -1
- package/dist/tools/warp_grep/agent/prompt.cjs +0 -232
- package/dist/tools/warp_grep/agent/prompt.cjs.map +0 -1
- package/dist/tools/warp_grep/agent/prompt.d.ts +0 -4
- package/dist/tools/warp_grep/agent/prompt.js +0 -10
- package/dist/tools/warp_grep/agent/prompt.js.map +0 -1
- /package/dist/{chunk-DGYWACHC.js.map → chunk-3ZA7Y66U.js.map} +0 -0
- /package/dist/{chunk-G5YJDK5S.js.map → chunk-ADHGSV2D.js.map} +0 -0
- /package/dist/{chunk-FEQJCZJQ.js.map → chunk-EGOCFCAH.js.map} +0 -0
- /package/dist/{chunk-TFK4UOUE.js.map → chunk-EL6CCK7C.js.map} +0 -0
- /package/dist/{chunk-IB4MEIQG.js.map → chunk-GDCVK6SP.js.map} +0 -0
- /package/dist/{chunk-UGSV5LPO.js.map → chunk-GVF4Q75N.js.map} +0 -0
- /package/dist/{chunk-TS3E6IRI.js.map → chunk-GWKCMFD6.js.map} +0 -0
- /package/dist/{chunk-WZAZFW77.js.map → chunk-HZK5TEUK.js.map} +0 -0
- /package/dist/{chunk-FAZO2LNY.js.map → chunk-K6YSD3DR.js.map} +0 -0
- /package/dist/{chunk-ACHEU2V3.js.map → chunk-LX34ZO3N.js.map} +0 -0
- /package/dist/{chunk-F6HNFC2H.js.map → chunk-MJHAVXFK.js.map} +0 -0
- /package/dist/{chunk-6TH3VNCF.js.map → chunk-NQQS5BZZ.js.map} +0 -0
- /package/dist/{chunk-57PXQ6IS.js.map → chunk-QOE522DB.js.map} +0 -0
- /package/dist/{chunk-2S7ZQFIB.js.map → chunk-U73OIAJC.js.map} +0 -0
- /package/dist/{chunk-OQGX4RZP.js.map → chunk-UAQ7UWZB.js.map} +0 -0
- /package/dist/{chunk-2MK64KK4.js.map → chunk-YTUQEDWH.js.map} +0 -0
- /package/dist/{chunk-H6KT7IXW.js.map → chunk-ZVAXTR2V.js.map} +0 -0
- /package/dist/{chunk-BGL35LL6.js.map → chunk-ZYD2SEQK.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../tools/warp_grep/providers/remote.ts"],"sourcesContent":["/**\n * RemoteCommandsProvider - wraps simple RemoteCommands into WarpGrepProvider\n * \n * Handles parsing of raw stdout from grep/read/listDir commands.\n * Users just return stdout, SDK handles all format conversion.\n */\n\nimport type { WarpGrepProvider, GrepResult, ReadResult, ListDirectoryEntry } from './types.js';\nimport type { RemoteCommands } from '../types.js';\nimport { AGENT_CONFIG } from '../agent/config.js';\n\n/**\n * Directories/files to always skip (exact name match)\n */\nconst SKIP_NAMES = new Set([\n // Version control\n '.git', '.svn', '.hg', '.bzr',\n // Dependencies\n 'node_modules', 'bower_components', '.pnpm', '.yarn',\n 'vendor', 'Pods', '.bundle',\n // Python\n '__pycache__', '.pytest_cache', '.mypy_cache', '.ruff_cache',\n '.venv', 'venv', '.tox', '.nox', '.eggs',\n // Build outputs\n 'dist', 'build', 'out', 'output', 'target', '_build',\n '.next', '.nuxt', '.output', '.vercel', '.netlify',\n // Cache\n '.cache', '.parcel-cache', '.turbo', '.nx', '.gradle',\n // IDE\n '.idea', '.vscode', '.vs',\n // Coverage\n 'coverage', '.coverage', 'htmlcov', '.nyc_output',\n // Temp\n 'tmp', 'temp', '.tmp', '.temp',\n // Lock files\n 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb',\n 'Cargo.lock', 'Gemfile.lock', 'poetry.lock',\n]);\n\n/**\n * File extensions to skip\n */\nconst SKIP_EXTENSIONS = new Set([\n '.min.js', '.min.css', '.bundle.js',\n '.wasm', '.so', '.dll', '.pyc',\n '.map', '.js.map',\n]);\n\n/**\n * Check if a filename should be skipped\n */\nfunction shouldSkip(name: string): boolean {\n // Skip exact name matches\n if (SKIP_NAMES.has(name)) return true;\n \n // Skip hidden files/directories (start with .)\n if (name.startsWith('.')) return true;\n \n // Skip files with certain extensions\n for (const ext of SKIP_EXTENSIONS) {\n if (name.endsWith(ext)) return true;\n }\n \n return false;\n}\n\n/**\n * Wraps simple RemoteCommands functions into a full WarpGrepProvider.\n * \n * This allows users to provide three simple functions that return raw stdout,\n * and the SDK handles all parsing internally.\n * \n * @example\n * ```typescript\n * const provider = new RemoteCommandsProvider('/home/repo', {\n * grep: async (pattern, path) => {\n * const r = await sandbox.run(`rg '${pattern}' '${path}'`);\n * return r.stdout;\n * },\n * read: async (path, start, end) => {\n * const r = await sandbox.run(`sed -n '${start},${end}p' '${path}'`);\n * return r.stdout;\n * },\n * listDir: async (path, maxDepth) => {\n * const r = await sandbox.run(`find '${path}' -maxdepth ${maxDepth}`);\n * return r.stdout;\n * },\n * });\n * ```\n */\nexport class RemoteCommandsProvider implements WarpGrepProvider {\n constructor(\n private readonly repoRoot: string,\n private readonly commands: RemoteCommands\n ) {}\n\n /**\n * Run grep command and parse ripgrep output\n */\n async grep(params: { pattern: string; path: string; glob?: string }): Promise<GrepResult> {\n try {\n const stdout = await this.commands.grep(params.pattern, params.path, params.glob);\n \n // Parse ripgrep output: each line is \"path:line:content\" or \"path-line-content\" for context\n const lines = (stdout || '')\n .trim()\n .split(/\\r?\\n/)\n .filter((l) => l.length > 0);\n \n // Check if output is too large\n if (lines.length > AGENT_CONFIG.MAX_OUTPUT_LINES) {\n return {\n lines: [],\n error: 'Query not specific enough - too many results returned. Try a more specific pattern.',\n };\n }\n \n return { lines };\n } catch (error) {\n return {\n lines: [],\n error: `[GREP ERROR] ${error instanceof Error ? error.message : String(error)}`,\n };\n }\n }\n\n /**\n * Read file and add line numbers\n */\n async read(params: { path: string; start?: number; end?: number }): Promise<ReadResult> {\n const rawStart = params.start;\n const rawEnd = params.end;\n \n const startValid = rawStart === undefined || (Number.isFinite(rawStart) && rawStart > 0);\n const endValid = rawEnd === undefined || (Number.isFinite(rawEnd) && rawEnd > 0);\n const rangeValid = startValid && endValid && \n (rawStart === undefined || rawEnd === undefined || rawStart <= rawEnd);\n \n const start = rangeValid && rawStart !== undefined ? rawStart : 1;\n const end = rangeValid && rawEnd !== undefined ? rawEnd : 1_000_000;\n \n try {\n const stdout = await this.commands.read(params.path, start, end);\n \n // Split content into lines and add line numbers\n const contentLines = (stdout || '').split('\\n');\n \n // Remove trailing empty line if present (common with sed output)\n if (contentLines.length > 0 && contentLines[contentLines.length - 1] === '') {\n contentLines.pop();\n }\n \n // Format as \"lineNumber|content\"\n const lines = contentLines.map((content, idx) => `${start + idx}|${content}`);\n \n // Check if output is too large\n if (lines.length > AGENT_CONFIG.MAX_READ_LINES) {\n const truncated = lines.slice(0, AGENT_CONFIG.MAX_READ_LINES);\n truncated.push(`... [truncated: showing ${AGENT_CONFIG.MAX_READ_LINES} of ${lines.length} lines]`);\n return { lines: truncated };\n }\n \n return { lines };\n } catch (error) {\n return {\n lines: [],\n error: `[READ ERROR] ${error instanceof Error ? error.message : String(error)}`,\n };\n }\n }\n\n /**\n * List directory and parse find output\n */\n async listDirectory(params: { \n path: string; \n pattern?: string | null; \n maxResults?: number; \n maxDepth?: number;\n }): Promise<ListDirectoryEntry[]> {\n const maxDepth = params.maxDepth ?? AGENT_CONFIG.MAX_LIST_DEPTH;\n const maxResults = params.maxResults ?? AGENT_CONFIG.MAX_OUTPUT_LINES;\n \n try {\n const stdout = await this.commands.listDir(params.path, maxDepth);\n \n // Parse find output: one path per line\n const paths = (stdout || '')\n .trim()\n .split(/\\r?\\n/)\n .filter((p) => p.length > 0);\n \n const regex = params.pattern ? new RegExp(params.pattern) : null;\n const entries: ListDirectoryEntry[] = [];\n \n for (const fullPath of paths) {\n // Skip the root path itself\n if (fullPath === params.path || fullPath === this.repoRoot) continue;\n \n const name = fullPath.split('/').pop() || '';\n \n // Simple name-based filtering - skip junk dirs/files\n if (shouldSkip(name)) continue;\n \n // Apply pattern filter if provided\n if (regex && !regex.test(name)) continue;\n \n // Determine relative path\n let relativePath = fullPath;\n if (fullPath.startsWith(this.repoRoot)) {\n relativePath = fullPath.slice(this.repoRoot.length).replace(/^\\//, '');\n }\n \n // Calculate depth based on path separators\n const depth = relativePath.split('/').filter(Boolean).length - 1;\n \n // Determine if it's a directory (ends with / or infer from path structure)\n // Note: Most sandbox find commands don't indicate type, so we guess based on extension\n const hasExtension = name.includes('.') && !name.startsWith('.');\n const type: 'file' | 'dir' = hasExtension ? 'file' : 'dir';\n \n entries.push({\n name,\n path: relativePath,\n type,\n depth: Math.max(0, depth),\n });\n \n if (entries.length >= maxResults) break;\n }\n \n return entries;\n } catch (error) {\n // Return empty array on error (consistent with LocalRipgrepProvider)\n return [];\n }\n }\n}\n\n\n\n\n"],"mappings":";;;;;AAcA,IAAM,aAAa,oBAAI,IAAI;AAAA;AAAA,EAEzB;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAO;AAAA;A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,UACA,OAAO,KAAK,IAAI,GAAG,KAAK;AAAA,QAC1B,CAAC;AAED,YAAI,QAAQ,UAAU,WAAY;AAAA,MACpC;AAEA,aAAO;AAAA,IACT,SAAS,OAAO;AAEd,aAAO,CAAC;AAAA,IACV;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// tools/warp_grep/agent/prompt.ts
|
|
21
|
-
var prompt_exports = {};
|
|
22
|
-
__export(prompt_exports, {
|
|
23
|
-
SYSTEM_PROMPT: () => SYSTEM_PROMPT,
|
|
24
|
-
getSystemPrompt: () => getSystemPrompt
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(prompt_exports);
|
|
27
|
-
var SYSTEM_PROMPT = `You are a code search agent. Your task is to find all relevant code for a given search_string.
|
|
28
|
-
|
|
29
|
-
### workflow
|
|
30
|
-
You have exactly 4 turns. The 4th turn MUST be a \`finish\` call. Each turn allows up to 8 parallel tool calls.
|
|
31
|
-
|
|
32
|
-
- Turn 1: Map the territory OR dive deep (based on search_string specificity)
|
|
33
|
-
- Turn 2-3: Refine based on findings
|
|
34
|
-
- Turn 4: MUST call \`finish\` with all relevant code locations
|
|
35
|
-
- You MAY call \`finish\` early if confident\u2014but never before at least 1 search turn.
|
|
36
|
-
- The user strongly prefers if you can call the finish tool early, but you must be correct
|
|
37
|
-
|
|
38
|
-
Remember, if the task feels easy to you, it is strongly desirable to call 'finish' early using fewer turns, but quality over speed
|
|
39
|
-
|
|
40
|
-
### tools
|
|
41
|
-
Tool calls use nested XML elements:
|
|
42
|
-
\`\`\`xml
|
|
43
|
-
<tool_name>
|
|
44
|
-
<parameter>value</parameter>
|
|
45
|
-
</tool_name>
|
|
46
|
-
\`\`\`
|
|
47
|
-
|
|
48
|
-
### \`list_directory\`
|
|
49
|
-
Directory tree view. Shows structure of a path, optionally filtered by regex pattern.
|
|
50
|
-
|
|
51
|
-
Elements:
|
|
52
|
-
- \`<path>\` (required): Directory path to list (use \`.\` for repo root)
|
|
53
|
-
- \`<pattern>\` (optional): Regex to filter results
|
|
54
|
-
|
|
55
|
-
Examples:
|
|
56
|
-
\`\`\`
|
|
57
|
-
<list_directory>
|
|
58
|
-
<path>src/services</path>
|
|
59
|
-
</list_directory>
|
|
60
|
-
|
|
61
|
-
<list_directory>
|
|
62
|
-
<path>lib/utils</path>
|
|
63
|
-
<pattern>.*\\.(ts|js)$</pattern>
|
|
64
|
-
</list_directory>
|
|
65
|
-
\`\`\`
|
|
66
|
-
|
|
67
|
-
### \`read\`
|
|
68
|
-
Read file contents. Supports multiple line ranges.
|
|
69
|
-
- Returns numbered lines for easy reference
|
|
70
|
-
- ALWAYS include import statements (usually lines 1-20). Better to over-include than miss context.
|
|
71
|
-
|
|
72
|
-
Elements:
|
|
73
|
-
- \`<path>\` (required): File path to read
|
|
74
|
-
- \`<lines>\` (optional): Line ranges like "1-50,75-80,100-120" (omit to read entire file)
|
|
75
|
-
|
|
76
|
-
Examples:
|
|
77
|
-
\`\`\`
|
|
78
|
-
<read>
|
|
79
|
-
<path>src/main.py</path>
|
|
80
|
-
</read>
|
|
81
|
-
|
|
82
|
-
<read>
|
|
83
|
-
<path>src/auth.py</path>
|
|
84
|
-
<lines>1-20,45-80,150-200</lines>
|
|
85
|
-
</read>
|
|
86
|
-
\`\`\`
|
|
87
|
-
|
|
88
|
-
### \`grep\`
|
|
89
|
-
Search for pattern matches across files. Returns matches with 1 line of context above and below.
|
|
90
|
-
- Match lines use \`:\` separator \u2192 \`filepath:linenum:content\`
|
|
91
|
-
- Context lines use \`-\` separator \u2192 \`filepath-linenum-content\`
|
|
92
|
-
|
|
93
|
-
Elements:
|
|
94
|
-
- \`<pattern>\` (required): Search pattern (regex). Use \`(a|b)\` for OR patterns.
|
|
95
|
-
- \`<sub_dir>\` (optional): Subdirectory to search in (defaults to \`.\`)
|
|
96
|
-
- \`<glob>\` (optional): File pattern filter like \`*.py\` or \`*.{ts,tsx}\`
|
|
97
|
-
|
|
98
|
-
Examples:
|
|
99
|
-
\`\`\`
|
|
100
|
-
<grep>
|
|
101
|
-
<pattern>(authenticate|authorize|login)</pattern>
|
|
102
|
-
<sub_dir>src/auth/</sub_dir>
|
|
103
|
-
</grep>
|
|
104
|
-
|
|
105
|
-
<grep>
|
|
106
|
-
<pattern>class.*(Service|Controller)</pattern>
|
|
107
|
-
<glob>*.{ts,js}</glob>
|
|
108
|
-
</grep>
|
|
109
|
-
|
|
110
|
-
<grep>
|
|
111
|
-
<pattern>(DB_HOST|DATABASE_URL|connection)</pattern>
|
|
112
|
-
<glob>*.{py,yaml,env}</glob>
|
|
113
|
-
<sub_dir>lib/</sub_dir>
|
|
114
|
-
</grep>
|
|
115
|
-
\`\`\`
|
|
116
|
-
|
|
117
|
-
### \`finish\`
|
|
118
|
-
Submit final answer with all relevant code locations. Uses nested \`<file>\` elements.
|
|
119
|
-
|
|
120
|
-
File elements:
|
|
121
|
-
- \`<path>\` (required): File path
|
|
122
|
-
- \`<lines>\` (optional): Line ranges like "1-50,75-80" (\`*\` for entire file)
|
|
123
|
-
|
|
124
|
-
ALWAYS include import statements (usually lines 1-20). Better to over-include than miss context.
|
|
125
|
-
|
|
126
|
-
Examples:
|
|
127
|
-
\`\`\`
|
|
128
|
-
<finish>
|
|
129
|
-
<file>
|
|
130
|
-
<path>src/auth.py</path>
|
|
131
|
-
<lines>1-15,25-50,75-80</lines>
|
|
132
|
-
</file>
|
|
133
|
-
<file>
|
|
134
|
-
<path>src/models/user.py</path>
|
|
135
|
-
<lines>*</lines>
|
|
136
|
-
</file>
|
|
137
|
-
</finish>
|
|
138
|
-
\`\`\`
|
|
139
|
-
</tools>
|
|
140
|
-
|
|
141
|
-
<strategy>
|
|
142
|
-
**Before your first tool call, classify the search_string:**
|
|
143
|
-
|
|
144
|
-
| Search_string Type | Round 1 Strategy | Early Finish? |
|
|
145
|
-
|------------|------------------|---------------|
|
|
146
|
-
| **Specific** (function name, error string, unique identifier) | 8 parallel greps on likely paths | Often by round 2 |
|
|
147
|
-
| **Conceptual** (how does X work, where is Y handled) | list_directory + 2-3 broad greps | Rarely early |
|
|
148
|
-
| **Exploratory** (find all tests, list API endpoints) | list_directory at multiple depths | Usually needs 3 rounds |
|
|
149
|
-
|
|
150
|
-
**Parallel call patterns:**
|
|
151
|
-
- **Shotgun grep**: Same pattern, 8 different directories\u2014fast coverage
|
|
152
|
-
- **Variant grep**: 8 pattern variations (synonyms, naming conventions)\u2014catches inconsistent codebases
|
|
153
|
-
- **Funnel**: 1 list_directory + 7 greps\u2014orient and search simultaneously
|
|
154
|
-
- **Deep read**: 8 reads on files you already identified\u2014gather full context fast
|
|
155
|
-
|
|
156
|
-
**Tool call expectations:**
|
|
157
|
-
- Low quality tool calls are ones that give back sparse information. This either means they are not well thought out and are not educated guesses OR, they are too broad and give back too many results.
|
|
158
|
-
- High quality tool calls strike a balance between complexity in the tool call to exclude results we know we don't want, and how wide the search space is so that we don't miss anything. It is ok to start off with wider search spaces, but is imperative that you use your intuition from there on out and seek high quality tool calls only.
|
|
159
|
-
- You are not starting blind, you have some information about root level repo structure going in, so use that to prevent making trivial repo wide queries.
|
|
160
|
-
- The grep tool shows you which file path and line numbers the pattern was found in, use this information smartly when trying to read the file.
|
|
161
|
-
</strategy>
|
|
162
|
-
|
|
163
|
-
<output_format>
|
|
164
|
-
EVERY response MUST follow this exact format:
|
|
165
|
-
|
|
166
|
-
1. First, wrap your reasoning in \`<think>...</think>\` tags containing:
|
|
167
|
-
- Search_string classification (specific/conceptual/exploratory)
|
|
168
|
-
- Confidence estimate (can I finish in 1-2 rounds?)
|
|
169
|
-
- This round's parallel strategy
|
|
170
|
-
- What signals would let me finish early?
|
|
171
|
-
|
|
172
|
-
2. Then, output up to 8 tool calls using nested XML elements.
|
|
173
|
-
|
|
174
|
-
Example:
|
|
175
|
-
\`\`\`
|
|
176
|
-
<think>
|
|
177
|
-
This is a specific search_string about authentication. I'll grep for auth-related patterns.
|
|
178
|
-
High confidence I can finish in 2 rounds if I find the auth module. I have already been shown the repo's structure at root
|
|
179
|
-
Strategy: Shotgun grep across likely directories.
|
|
180
|
-
</think>
|
|
181
|
-
<grep>
|
|
182
|
-
<pattern>(authenticate|login|session)</pattern>
|
|
183
|
-
<sub_dir>src/auth/</sub_dir>
|
|
184
|
-
</grep>
|
|
185
|
-
<grep>
|
|
186
|
-
<pattern>(middleware|interceptor)</pattern>
|
|
187
|
-
<glob>*.{ts,js}</glob>
|
|
188
|
-
</grep>
|
|
189
|
-
<list_directory>
|
|
190
|
-
<path>src/auth</path>
|
|
191
|
-
</list_directory>
|
|
192
|
-
\`\`\`
|
|
193
|
-
|
|
194
|
-
Finishing example:
|
|
195
|
-
\`\`\`
|
|
196
|
-
<think>
|
|
197
|
-
I think I have a rough idea, but this is my last turn so I must call the finish tool regardless.
|
|
198
|
-
</think>
|
|
199
|
-
<finish>
|
|
200
|
-
<file>
|
|
201
|
-
<path>src/auth/login.py</path>
|
|
202
|
-
<lines>1-50</lines>
|
|
203
|
-
</file>
|
|
204
|
-
<file>
|
|
205
|
-
<path>src/middleware/session.py</path>
|
|
206
|
-
<lines>10-80</lines>
|
|
207
|
-
</file>
|
|
208
|
-
</finish>
|
|
209
|
-
\`\`\`
|
|
210
|
-
|
|
211
|
-
No commentary outside \`<think>\`. No explanations after tool calls.
|
|
212
|
-
</output_format>
|
|
213
|
-
|
|
214
|
-
use as all 8 tool calls to be optimal
|
|
215
|
-
|
|
216
|
-
<finishing_requirements>
|
|
217
|
-
When calling \`finish\`:
|
|
218
|
-
- Include the import section (typically lines 1-20) of each file
|
|
219
|
-
- Include all function/class definitions that are relevant
|
|
220
|
-
- Include any type definitions, interfaces, or constants used
|
|
221
|
-
- Better to over-include than leave the user missing context
|
|
222
|
-
- If unsure about boundaries, include more rather than less
|
|
223
|
-
</finishing_requirements>`;
|
|
224
|
-
function getSystemPrompt() {
|
|
225
|
-
return SYSTEM_PROMPT;
|
|
226
|
-
}
|
|
227
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
228
|
-
0 && (module.exports = {
|
|
229
|
-
SYSTEM_PROMPT,
|
|
230
|
-
getSystemPrompt
|
|
231
|
-
});
|
|
232
|
-
//# sourceMappingURL=prompt.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../tools/warp_grep/agent/prompt.ts"],"sourcesContent":["export const SYSTEM_PROMPT = `You are a code search agent. Your task is to find all relevant code for a given search_string.\n\n### workflow\nYou have exactly 4 turns. The 4th turn MUST be a \\`finish\\` call. Each turn allows up to 8 parallel tool calls.\n\n- Turn 1: Map the territory OR dive deep (based on search_string specificity)\n- Turn 2-3: Refine based on findings\n- Turn 4: MUST call \\`finish\\` with all relevant code locations\n- You MAY call \\`finish\\` early if confident—but never before at least 1 search turn.\n- The user strongly prefers if you can call the finish tool early, but you must be correct\n\nRemember, if the task feels easy to you, it is strongly desirable to call 'finish' early using fewer turns, but quality over speed\n\n### tools\nTool calls use nested XML elements:\n\\`\\`\\`xml\n<tool_name>\n <parameter>value</parameter>\n</tool_name>\n\\`\\`\\`\n\n### \\`list_directory\\`\nDirectory tree view. Shows structure of a path, optionally filtered by regex pattern.\n\nElements:\n- \\`<path>\\` (required): Directory path to list (use \\`.\\` for repo root)\n- \\`<pattern>\\` (optional): Regex to filter results\n\nExamples:\n\\`\\`\\`\n<list_directory>\n <path>src/services</path>\n</list_directory>\n\n<list_directory>\n <path>lib/utils</path>\n <pattern>.*\\\\.(ts|js)$</pattern>\n</list_directory>\n\\`\\`\\`\n\n### \\`read\\`\nRead file contents. Supports multiple line ranges.\n- Returns numbered lines for easy reference\n- ALWAYS include import statements (usually lines 1-20). Better to over-include than miss context.\n\nElements:\n- \\`<path>\\` (required): File path to read\n- \\`<lines>\\` (optional): Line ranges like \"1-50,75-80,100-120\" (omit to read entire file)\n\nExamples:\n\\`\\`\\`\n<read>\n <path>src/main.py</path>\n</read>\n\n<read>\n <path>src/auth.py</path>\n <lines>1-20,45-80,150-200</lines>\n</read>\n\\`\\`\\`\n\n### \\`grep\\`\nSearch for pattern matches across files. Returns matches with 1 line of context above and below.\n- Match lines use \\`:\\` separator → \\`filepath:linenum:content\\`\n- Context lines use \\`-\\` separator → \\`filepath-linenum-content\\`\n\nElements:\n- \\`<pattern>\\` (required): Search pattern (regex). Use \\`(a|b)\\` for OR patterns.\n- \\`<sub_dir>\\` (optional): Subdirectory to search in (defaults to \\`.\\`)\n- \\`<glob>\\` (optional): File pattern filter like \\`*.py\\` or \\`*.{ts,tsx}\\`\n\nExamples:\n\\`\\`\\`\n<grep>\n <pattern>(authenticate|authorize|login)</pattern>\n <sub_dir>src/auth/</sub_dir>\n</grep>\n\n<grep>\n <pattern>class.*(Service|Controller)</pattern>\n <glob>*.{ts,js}</glob>\n</grep>\n\n<grep>\n <pattern>(DB_HOST|DATABASE_URL|connection)</pattern>\n <glob>*.{py,yaml,env}</glob>\n <sub_dir>lib/</sub_dir>\n</grep>\n\\`\\`\\`\n\n### \\`finish\\`\nSubmit final answer with all relevant code locations. Uses nested \\`<file>\\` elements.\n\nFile elements:\n- \\`<path>\\` (required): File path\n- \\`<lines>\\` (optional): Line ranges like \"1-50,75-80\" (\\`*\\` for entire file)\n\nALWAYS include import statements (usually lines 1-20). Better to over-include than miss context.\n\nExamples:\n\\`\\`\\`\n<finish>\n <file>\n <path>src/auth.py</path>\n <lines>1-15,25-50,75-80</lines>\n </file>\n <file>\n <path>src/models/user.py</path>\n <lines>*</lines>\n </file>\n</finish>\n\\`\\`\\`\n</tools>\n\n<strategy>\n**Before your first tool call, classify the search_string:**\n\n| Search_string Type | Round 1 Strategy | Early Finish? |\n|------------|------------------|---------------|\n| **Specific** (function name, error string, unique identifier) | 8 parallel greps on likely paths | Often by round 2 |\n| **Conceptual** (how does X work, where is Y handled) | list_directory + 2-3 broad greps | Rarely early |\n| **Exploratory** (find all tests, list API endpoints) | list_directory at multiple depths | Usually needs 3 rounds |\n\n**Parallel call patterns:**\n- **Shotgun grep**: Same pattern, 8 different directories—fast coverage\n- **Variant grep**: 8 pattern variations (synonyms, naming conventions)—catches inconsistent codebases\n- **Funnel**: 1 list_directory + 7 greps—orient and search simultaneously\n- **Deep read**: 8 reads on files you already identified—gather full context fast\n\n**Tool call expectations:**\n- Low quality tool calls are ones that give back sparse information. This either means they are not well thought out and are not educated guesses OR, they are too broad and give back too many results.\n- High quality tool calls strike a balance between complexity in the tool call to exclude results we know we don't want, and how wide the search space is so that we don't miss anything. It is ok to start off with wider search spaces, but is imperative that you use your intuition from there on out and seek high quality tool calls only.\n- You are not starting blind, you have some information about root level repo structure going in, so use that to prevent making trivial repo wide queries.\n- The grep tool shows you which file path and line numbers the pattern was found in, use this information smartly when trying to read the file.\n</strategy>\n\n<output_format>\nEVERY response MUST follow this exact format:\n\n1. First, wrap your reasoning in \\`<think>...</think>\\` tags containing:\n - Search_string classification (specific/conceptual/exploratory)\n - Confidence estimate (can I finish in 1-2 rounds?)\n - This round's parallel strategy\n - What signals would let me finish early?\n\n2. Then, output up to 8 tool calls using nested XML elements.\n\nExample:\n\\`\\`\\`\n<think>\nThis is a specific search_string about authentication. I'll grep for auth-related patterns.\nHigh confidence I can finish in 2 rounds if I find the auth module. I have already been shown the repo's structure at root\nStrategy: Shotgun grep across likely directories.\n</think>\n<grep>\n <pattern>(authenticate|login|session)</pattern>\n <sub_dir>src/auth/</sub_dir>\n</grep>\n<grep>\n <pattern>(middleware|interceptor)</pattern>\n <glob>*.{ts,js}</glob>\n</grep>\n<list_directory>\n <path>src/auth</path>\n</list_directory>\n\\`\\`\\`\n\nFinishing example:\n\\`\\`\\`\n<think>\nI think I have a rough idea, but this is my last turn so I must call the finish tool regardless.\n</think>\n<finish>\n <file>\n <path>src/auth/login.py</path>\n <lines>1-50</lines>\n </file>\n <file>\n <path>src/middleware/session.py</path>\n <lines>10-80</lines>\n </file>\n</finish>\n\\`\\`\\`\n\nNo commentary outside \\`<think>\\`. No explanations after tool calls.\n</output_format>\n\nuse as all 8 tool calls to be optimal\n\n<finishing_requirements>\nWhen calling \\`finish\\`:\n- Include the import section (typically lines 1-20) of each file\n- Include all function/class definitions that are relevant\n- Include any type definitions, interfaces, or constants used\n- Better to over-include than leave the user missing context\n- If unsure about boundaries, include more rather than less\n</finishing_requirements>`;\n\nexport function getSystemPrompt(): string {\n return SYSTEM_PROMPT;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsMtB,SAAS,kBAA0B;AACxC,SAAO;AACT;","names":[]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
declare const SYSTEM_PROMPT = "You are a code search agent. Your task is to find all relevant code for a given search_string.\n\n### workflow\nYou have exactly 4 turns. The 4th turn MUST be a `finish` call. Each turn allows up to 8 parallel tool calls.\n\n- Turn 1: Map the territory OR dive deep (based on search_string specificity)\n- Turn 2-3: Refine based on findings\n- Turn 4: MUST call `finish` with all relevant code locations\n- You MAY call `finish` early if confident\u2014but never before at least 1 search turn.\n- The user strongly prefers if you can call the finish tool early, but you must be correct\n\nRemember, if the task feels easy to you, it is strongly desirable to call 'finish' early using fewer turns, but quality over speed\n\n### tools\nTool calls use nested XML elements:\n```xml\n<tool_name>\n <parameter>value</parameter>\n</tool_name>\n```\n\n### `list_directory`\nDirectory tree view. Shows structure of a path, optionally filtered by regex pattern.\n\nElements:\n- `<path>` (required): Directory path to list (use `.` for repo root)\n- `<pattern>` (optional): Regex to filter results\n\nExamples:\n```\n<list_directory>\n <path>src/services</path>\n</list_directory>\n\n<list_directory>\n <path>lib/utils</path>\n <pattern>.*\\.(ts|js)$</pattern>\n</list_directory>\n```\n\n### `read`\nRead file contents. Supports multiple line ranges.\n- Returns numbered lines for easy reference\n- ALWAYS include import statements (usually lines 1-20). Better to over-include than miss context.\n\nElements:\n- `<path>` (required): File path to read\n- `<lines>` (optional): Line ranges like \"1-50,75-80,100-120\" (omit to read entire file)\n\nExamples:\n```\n<read>\n <path>src/main.py</path>\n</read>\n\n<read>\n <path>src/auth.py</path>\n <lines>1-20,45-80,150-200</lines>\n</read>\n```\n\n### `grep`\nSearch for pattern matches across files. Returns matches with 1 line of context above and below.\n- Match lines use `:` separator \u2192 `filepath:linenum:content`\n- Context lines use `-` separator \u2192 `filepath-linenum-content`\n\nElements:\n- `<pattern>` (required): Search pattern (regex). Use `(a|b)` for OR patterns.\n- `<sub_dir>` (optional): Subdirectory to search in (defaults to `.`)\n- `<glob>` (optional): File pattern filter like `*.py` or `*.{ts,tsx}`\n\nExamples:\n```\n<grep>\n <pattern>(authenticate|authorize|login)</pattern>\n <sub_dir>src/auth/</sub_dir>\n</grep>\n\n<grep>\n <pattern>class.*(Service|Controller)</pattern>\n <glob>*.{ts,js}</glob>\n</grep>\n\n<grep>\n <pattern>(DB_HOST|DATABASE_URL|connection)</pattern>\n <glob>*.{py,yaml,env}</glob>\n <sub_dir>lib/</sub_dir>\n</grep>\n```\n\n### `finish`\nSubmit final answer with all relevant code locations. Uses nested `<file>` elements.\n\nFile elements:\n- `<path>` (required): File path\n- `<lines>` (optional): Line ranges like \"1-50,75-80\" (`*` for entire file)\n\nALWAYS include import statements (usually lines 1-20). Better to over-include than miss context.\n\nExamples:\n```\n<finish>\n <file>\n <path>src/auth.py</path>\n <lines>1-15,25-50,75-80</lines>\n </file>\n <file>\n <path>src/models/user.py</path>\n <lines>*</lines>\n </file>\n</finish>\n```\n</tools>\n\n<strategy>\n**Before your first tool call, classify the search_string:**\n\n| Search_string Type | Round 1 Strategy | Early Finish? |\n|------------|------------------|---------------|\n| **Specific** (function name, error string, unique identifier) | 8 parallel greps on likely paths | Often by round 2 |\n| **Conceptual** (how does X work, where is Y handled) | list_directory + 2-3 broad greps | Rarely early |\n| **Exploratory** (find all tests, list API endpoints) | list_directory at multiple depths | Usually needs 3 rounds |\n\n**Parallel call patterns:**\n- **Shotgun grep**: Same pattern, 8 different directories\u2014fast coverage\n- **Variant grep**: 8 pattern variations (synonyms, naming conventions)\u2014catches inconsistent codebases\n- **Funnel**: 1 list_directory + 7 greps\u2014orient and search simultaneously\n- **Deep read**: 8 reads on files you already identified\u2014gather full context fast\n\n**Tool call expectations:**\n- Low quality tool calls are ones that give back sparse information. This either means they are not well thought out and are not educated guesses OR, they are too broad and give back too many results.\n- High quality tool calls strike a balance between complexity in the tool call to exclude results we know we don't want, and how wide the search space is so that we don't miss anything. It is ok to start off with wider search spaces, but is imperative that you use your intuition from there on out and seek high quality tool calls only.\n- You are not starting blind, you have some information about root level repo structure going in, so use that to prevent making trivial repo wide queries.\n- The grep tool shows you which file path and line numbers the pattern was found in, use this information smartly when trying to read the file.\n</strategy>\n\n<output_format>\nEVERY response MUST follow this exact format:\n\n1. First, wrap your reasoning in `<think>...</think>` tags containing:\n - Search_string classification (specific/conceptual/exploratory)\n - Confidence estimate (can I finish in 1-2 rounds?)\n - This round's parallel strategy\n - What signals would let me finish early?\n\n2. Then, output up to 8 tool calls using nested XML elements.\n\nExample:\n```\n<think>\nThis is a specific search_string about authentication. I'll grep for auth-related patterns.\nHigh confidence I can finish in 2 rounds if I find the auth module. I have already been shown the repo's structure at root\nStrategy: Shotgun grep across likely directories.\n</think>\n<grep>\n <pattern>(authenticate|login|session)</pattern>\n <sub_dir>src/auth/</sub_dir>\n</grep>\n<grep>\n <pattern>(middleware|interceptor)</pattern>\n <glob>*.{ts,js}</glob>\n</grep>\n<list_directory>\n <path>src/auth</path>\n</list_directory>\n```\n\nFinishing example:\n```\n<think>\nI think I have a rough idea, but this is my last turn so I must call the finish tool regardless.\n</think>\n<finish>\n <file>\n <path>src/auth/login.py</path>\n <lines>1-50</lines>\n </file>\n <file>\n <path>src/middleware/session.py</path>\n <lines>10-80</lines>\n </file>\n</finish>\n```\n\nNo commentary outside `<think>`. No explanations after tool calls.\n</output_format>\n\nuse as all 8 tool calls to be optimal\n\n<finishing_requirements>\nWhen calling `finish`:\n- Include the import section (typically lines 1-20) of each file\n- Include all function/class definitions that are relevant\n- Include any type definitions, interfaces, or constants used\n- Better to over-include than leave the user missing context\n- If unsure about boundaries, include more rather than less\n</finishing_requirements>";
|
|
2
|
-
declare function getSystemPrompt(): string;
|
|
3
|
-
|
|
4
|
-
export { SYSTEM_PROMPT, getSystemPrompt };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|