@octocodeai/octocode-core 16.3.0 → 16.5.0

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 (44) hide show
  1. package/README.md +22 -0
  2. package/dist/data/compressed.js +1 -1
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.js +1 -0
  5. package/dist/resources/global.d.ts +17 -0
  6. package/dist/resources/global.js +1 -0
  7. package/dist/resources/tools/_toolkit.d.ts +87 -0
  8. package/dist/resources/tools/_toolkit.js +1 -0
  9. package/dist/resources/tools/ghCloneRepo.d.ts +27 -0
  10. package/dist/resources/tools/ghCloneRepo.js +1 -0
  11. package/dist/resources/tools/ghGetFileContent.d.ts +32 -0
  12. package/dist/resources/tools/ghGetFileContent.js +1 -0
  13. package/dist/resources/tools/ghHistoryResearch.d.ts +133 -0
  14. package/dist/resources/tools/ghHistoryResearch.js +1 -0
  15. package/dist/resources/tools/ghSearchCode.d.ts +23 -0
  16. package/dist/resources/tools/ghSearchCode.js +1 -0
  17. package/dist/resources/tools/ghSearchRepos.d.ts +40 -0
  18. package/dist/resources/tools/ghSearchRepos.js +1 -0
  19. package/dist/resources/tools/ghViewRepoStructure.d.ts +17 -0
  20. package/dist/resources/tools/ghViewRepoStructure.js +1 -0
  21. package/dist/resources/tools/localBinaryInspect.d.ts +42 -0
  22. package/dist/resources/tools/localBinaryInspect.js +1 -0
  23. package/dist/resources/tools/localFindFiles.d.ts +41 -0
  24. package/dist/resources/tools/localFindFiles.js +1 -0
  25. package/dist/resources/tools/localGetFileContent.d.ts +24 -0
  26. package/dist/resources/tools/localGetFileContent.js +1 -0
  27. package/dist/resources/tools/localSearchCode.d.ts +73 -0
  28. package/dist/resources/tools/localSearchCode.js +1 -0
  29. package/dist/resources/tools/localViewStructure.d.ts +29 -0
  30. package/dist/resources/tools/localViewStructure.js +1 -0
  31. package/dist/resources/tools/lspGetSemantics.d.ts +79 -0
  32. package/dist/resources/tools/lspGetSemantics.js +1 -0
  33. package/dist/resources/tools/npmSearch.d.ts +11 -0
  34. package/dist/resources/tools/npmSearch.js +1 -0
  35. package/dist/schemas/extraTypes.d.ts +178 -0
  36. package/dist/schemas/extraTypes.js +1 -0
  37. package/dist/schemas/outputs.d.ts +843 -0
  38. package/dist/schemas/outputs.js +1 -0
  39. package/dist/schemas/runtime.d.ts +11 -0
  40. package/dist/schemas/runtime.js +1 -0
  41. package/dist/schemas.d.ts +514 -0
  42. package/dist/schemas.js +1 -0
  43. package/dist/types/index.d.ts +9 -0
  44. package/package.json +26 -2
@@ -0,0 +1,40 @@
1
+ import { z } from "zod";
2
+ import type { ToolSpec } from "../../types/index.js";
3
+ export declare const ghSearchRepos: ToolSpec;
4
+ export declare const GitHubReposSearchSingleQuerySchema: z.ZodObject<{
5
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
6
+ topicsToSearch: z.ZodOptional<z.ZodArray<z.ZodString>>;
7
+ language: z.ZodOptional<z.ZodString>;
8
+ owner: z.ZodOptional<z.ZodString>;
9
+ stars: z.ZodOptional<z.ZodString>;
10
+ size: z.ZodOptional<z.ZodString>;
11
+ created: z.ZodOptional<z.ZodString>;
12
+ updated: z.ZodOptional<z.ZodString>;
13
+ match: z.ZodOptional<z.ZodArray<z.ZodEnum<{
14
+ description: "description";
15
+ name: "name";
16
+ readme: "readme";
17
+ }>>>;
18
+ sort: z.ZodDefault<z.ZodEnum<{
19
+ stars: "stars";
20
+ updated: "updated";
21
+ forks: "forks";
22
+ "help-wanted-issues": "help-wanted-issues";
23
+ "best-match": "best-match";
24
+ }>>;
25
+ limit: z.ZodDefault<z.ZodNumber>;
26
+ page: z.ZodDefault<z.ZodNumber>;
27
+ archived: z.ZodOptional<z.ZodBoolean>;
28
+ visibility: z.ZodOptional<z.ZodEnum<{
29
+ public: "public";
30
+ private: "private";
31
+ }>>;
32
+ forks: z.ZodOptional<z.ZodString>;
33
+ license: z.ZodOptional<z.ZodString>;
34
+ goodFirstIssues: z.ZodOptional<z.ZodString>;
35
+ concise: z.ZodOptional<z.ZodBoolean>;
36
+ id: z.ZodOptional<z.ZodString>;
37
+ mainResearchGoal: z.ZodOptional<z.ZodString>;
38
+ researchGoal: z.ZodOptional<z.ZodString>;
39
+ reasoning: z.ZodOptional<z.ZodString>;
40
+ }, z.core.$strip>;
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";import{buildObject as t,DEFAULT_GITHUB_SEARCH_LIMIT as o,defineTool as r,intRange as s,MAX_GITHUB_SEARCH_LIMIT as i,metaFields as a,pageNumber as n,StringArray as p}from"./_toolkit.js";export const ghSearchRepos=r({name:"ghSearchRepos",type:"Github",shortDescription:"Discover GitHub repositories by name, topic, language, or popularity.",instructions:"Best practice: start with concise:true to scan candidates (\"owner/repo\" strings), then re-run without it (or ghViewRepoStructure) on the pick; use full objects only to compare/filter on stars, language, topics, dates.\nOwner alone enumerates that owner's repos; keywords AND together. Supplying both topicsToSearch and keywords runs two parallel searches merged with OR semantics — use keywords alone for strict AND. topicsToSearch is sparse (few repos tag topics), so pair it with keywords or language.\nRange filters use GitHub syntax: '>100', '50..500', '>2023-01-01'.\nBatch independent discovery queries in one queries:[...] call.\nNext: ghViewRepoStructure or ghSearchCode/ghGetFileContent on a pick; npmSearch to resolve an npm name first.",schema:{keywords:"Search terms. One term per array item for broad matching; keep a phrase in one item for exact wording.",topicsToSearch:"GitHub topic tags to require — all listed topics must be present. Sparse (most repos set no topics), so pair with keywords or language rather than using alone.",language:"Repository language qualifier (GitHub detection).",owner:"User/org scope. Without keywords it enumerates that owner's repos; with keywords it scopes the search to them.",stars:"Star-count filter using GitHub range syntax: '>100', '<1000', '50..500', '>=500'.",size:"Repository size in KB (sources + history): '<1000' for small repos, '>10000' for large codebases.",created:"Creation-date filter (GitHub range syntax): '>2023-01-01', '<2020-01-01', '2022-01-01..2023-01-01'.",updated:"Last-push-date filter (GitHub's pushed: qualifier, not metadata updates): '>2024-01-01'. Finds actively maintained repos.",match:"Which text fields to search: name, description, and/or readme. Defaults to name+description; add 'readme' for broader, slower full-text search.",sort:"Result ordering. 'stars': most-starred first. 'forks': most-forked first. 'updated': most-recently-pushed first. 'help-wanted-issues': repos seeking contributors. 'best-match': GitHub relevance.",limit:"Results to return per page.",page:"Result page.",archived:"Include archived repos (excluded by default).",visibility:"'public' or 'private' (private needs a repo-scoped token). Omit to include both.",forks:"Fork-count filter (GitHub range syntax): '>100', '<1000', '50..500'.",license:"Exact lowercase SPDX license id, e.g. 'mit', 'apache-2.0', 'gpl-3.0'.",goodFirstIssues:"Filters by count of open 'good first issue' labels ('>5') — finds repos inviting contributors.",concise:'Prefer true by default to scan candidates: a flat list of "owner/repo" strings only, the cheapest first pass; then re-run without it (or ghViewRepoStructure) on the one you pick. Omit only when you need structured objects (stars, language, topics, dates) to compare or filter.'}});export const GitHubReposSearchSingleQuerySchema=t(ghSearchRepos.schema,{...a,keywords:p,topicsToSearch:p,language:e.string().optional(),owner:e.string().optional(),stars:e.string().optional(),size:e.string().optional(),created:e.string().optional(),updated:e.string().optional(),match:e.array(e.enum(["name","description","readme"])).optional(),sort:e.enum(["stars","forks","help-wanted-issues","updated","best-match"]).default("best-match"),limit:s(1,i).default(o),page:n(),archived:e.boolean().optional(),visibility:e.enum(["public","private"]).optional(),forks:e.string().optional(),license:e.string().optional(),goodFirstIssues:e.string().optional(),concise:e.boolean().optional()});
@@ -0,0 +1,17 @@
1
+ import { z } from "zod";
2
+ import type { ToolSpec } from "../../types/index.js";
3
+ export declare const ghViewRepoStructure: ToolSpec;
4
+ export declare const GitHubViewRepoStructureQuerySchema: z.ZodObject<{
5
+ owner: z.ZodString;
6
+ repo: z.ZodString;
7
+ branch: z.ZodOptional<z.ZodString>;
8
+ path: z.ZodOptional<z.ZodString>;
9
+ maxDepth: z.ZodOptional<z.ZodNumber>;
10
+ page: z.ZodDefault<z.ZodNumber>;
11
+ itemsPerPage: z.ZodDefault<z.ZodNumber>;
12
+ includeSizes: z.ZodOptional<z.ZodBoolean>;
13
+ id: z.ZodOptional<z.ZodString>;
14
+ mainResearchGoal: z.ZodOptional<z.ZodString>;
15
+ researchGoal: z.ZodOptional<z.ZodString>;
16
+ reasoning: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$strip>;
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";import{buildObject as t,DEFAULT_GITHUB_STRUCTURE_ITEMS_PER_PAGE as r,defineTool as o,intRange as i,MAX_GITHUB_STRUCTURE_DEPTH as a,MAX_GITHUB_STRUCTURE_ITEMS_PER_PAGE as n,metaFields as s,pageNumber as h}from"./_toolkit.js";export const ghViewRepoStructure=o({name:"ghViewRepoStructure",type:"Github",shortDescription:"Browse a GitHub repository's directory tree.",instructions:'Best practice: map an unknown repo here before searching; when you already know a partial filename, ghSearchCode(match:"path") is faster.\nnode_modules, .git, dist, build and similar artifacts are auto-excluded.\nOutput is structure[] ({dir, files[], folders[]}); paginate with page=N while pagination.hasMore.\nBatch several {owner,repo,path} objects in one queries:[...] call to explore multiple paths at once.\nNext: ghGetFileContent(path) to read; ghSearchCode to search within a known path.',schema:{owner:"Repository owner or org.",repo:"Repository name, without the owner.",branch:"Branch, tag, or commit SHA. Omit for the default branch; if the ref isn't found the default branch is used and a warning hint is emitted.",path:'Repo-relative directory to browse. "" or "." for the root, or a subdirectory (e.g. "src/utils") to scope the tree. No leading slash.',maxDepth:"How deep to recurse — immediate children only unless raised. Set 2+ to descend into subdirectories.",page:"Result page. Advance only when pagination.hasMore is true.",itemsPerPage:"Entries per page. Raise to cut round-trips on large repos.",includeSizes:"Adds file sizes (bytes) in a fileSizes field alongside the structure."}});export const GitHubViewRepoStructureQuerySchema=t(ghViewRepoStructure.schema,{...s,owner:e.string(),repo:e.string(),branch:e.string().optional(),path:e.string().optional(),maxDepth:i(0,a).optional(),page:h(),itemsPerPage:i(1,n).default(r),includeSizes:e.boolean().optional()});
@@ -0,0 +1,42 @@
1
+ import { z } from "zod";
2
+ import type { ToolSpec } from "../../types/index.js";
3
+ export declare const localBinaryInspect: ToolSpec;
4
+ export declare const LocalBinaryInspectQuerySchema: z.ZodObject<{
5
+ path: z.ZodString;
6
+ mode: z.ZodEnum<{
7
+ list: "list";
8
+ inspect: "inspect";
9
+ extract: "extract";
10
+ decompress: "decompress";
11
+ strings: "strings";
12
+ unpack: "unpack";
13
+ }>;
14
+ detailed: z.ZodOptional<z.ZodBoolean>;
15
+ verbose: z.ZodOptional<z.ZodBoolean>;
16
+ maxEntries: z.ZodDefault<z.ZodNumber>;
17
+ entriesPerPage: z.ZodOptional<z.ZodNumber>;
18
+ entryPageNumber: z.ZodDefault<z.ZodNumber>;
19
+ archiveFile: z.ZodOptional<z.ZodString>;
20
+ matchString: z.ZodOptional<z.ZodString>;
21
+ matchStringContextLines: z.ZodDefault<z.ZodNumber>;
22
+ charOffset: z.ZodOptional<z.ZodNumber>;
23
+ charLength: z.ZodOptional<z.ZodNumber>;
24
+ format: z.ZodDefault<z.ZodEnum<{
25
+ auto: "auto";
26
+ gzip: "gzip";
27
+ bzip2: "bzip2";
28
+ xz: "xz";
29
+ lzma: "lzma";
30
+ zstd: "zstd";
31
+ lz4: "lz4";
32
+ brotli: "brotli";
33
+ lzfse: "lzfse";
34
+ }>>;
35
+ minLength: z.ZodDefault<z.ZodNumber>;
36
+ includeOffsets: z.ZodOptional<z.ZodBoolean>;
37
+ scanOffset: z.ZodOptional<z.ZodNumber>;
38
+ id: z.ZodOptional<z.ZodString>;
39
+ mainResearchGoal: z.ZodOptional<z.ZodString>;
40
+ researchGoal: z.ZodOptional<z.ZodString>;
41
+ reasoning: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>;
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";import{buildObject as t,charLength as s,charOffset as a,DEFAULT_BINARY_CONTEXT_LINES as r,DEFAULT_BINARY_ENTRIES as i,DEFAULT_STRINGS_MIN_LENGTH as n,defineTool as o,intRange as c,MAX_BINARY_CONTEXT_LINES as l,MAX_BINARY_ENTRIES as d,MAX_BINARY_ENTRIES_PER_PAGE as h,MAX_STRINGS_MIN_LENGTH as m,metaFields as p,pageNumber as u}from"./_toolkit.js";export const localBinaryInspect=o({name:"localBinaryInspect",type:"Local",shortDescription:"Inspect archives, compressed streams, and binaries — list, extract, decompress, strings.",instructions:"Availability: needs ENABLE_BINARY + ENABLE_LOCAL; when off, use localSearchCode(searchBinary:true) for pattern sweeps. For plain text use localGetFileContent.\nPick mode by goal (see the mode field): inspect (native binary → format/arch/counts/deps; add detailed:true for full symbols/imports/exports/sections), list (archive entries), extract (one entry), decompress (single-stream .gz/.xz/… → text), unpack (whole archive to a localPath), strings (readable text in a native binary). Run list before extract to get exact entry names.\nBest practice: this tool only unpacks — chain it: discover (localFindFiles/localViewStructure) → unpack here → read (localGetFileContent) → search (localSearchCode) → analyze (lspGetSemantics).\nSignals: totalEntries above the returned count = truncated (page with entryPageNumber); extract/decompress/strings output is char-paginated — advance charOffset from hints. unpack returns localPath — point local tools at it. If decompress rejects a multi-entry archive, use list/extract or unpack.",schema:{path:"Path to the archive, compressed file, or binary — absolute or workspace-relative.",mode:'Pick by what you have and what you want back. "inspect": a native binary / object file (.so/.dylib/.node/.exe/.dll/.wasm/.o, ELF/Mach-O/PE) → concise structure: format, architecture, bits, endianness, symbol/import/export counts, and dynamic library dependencies (plus type + magic bytes). Add detailed:true only when you need full symbols/imports/exports/sections arrays. Start here for any compiled artifact when you are not sure what it is. "list": an archive (.zip/.jar/.tar.*/.7z/.deb/.dmg…) → its entry names, so you can see what is inside before pulling anything out. "extract": an archive → one entry\'s content; set archiveFile to an exact name from a prior list. "decompress": a single-stream compressed file (.gz/.bz2/.xz/.zst/.lz4/.br/.lzfse — one payload, not a multi-entry archive) → its text. "strings": a native binary (.so/.dylib/.node/.exe/.wasm) → its readable strings (symbols, URLs, version markers), ASCII and UTF-16. "unpack": an archive → ALL entries extracted to a cached local directory; returns localPath so you can then run localViewStructure / localSearchCode / localGetFileContent on the unpacked tree. Use for multi-file work inside an archive (extract is for a single entry). Required — there is no default.',verbose:"list: include each entry's size and mtime (names only otherwise).",detailed:"inspect: include full symbols/imports/exports/sections arrays. Default inspect output is concise: identity, counts, dependencies, and hints.",maxEntries:"list: caps how many entries are returned; totalEntries still reports the full archive count.",entriesPerPage:"list: entries per page; pair with entryPageNumber.",entryPageNumber:"list: which entry page to return; pair with entriesPerPage.",archiveFile:'extract: exact entry path to stream out (case-sensitive, must not start with "-"). Run mode="list" first — do not guess entry names.',matchString:"extract/decompress: keeps only streamed lines matching this text, with matchStringContextLines around each.",matchStringContextLines:"extract/decompress: context lines kept around each matchString hit.",charOffset:"extract/decompress: continuation offset for the next page; take it from hints[] — do not compute it yourself.",charLength:"extract/decompress: page size in characters. Auto-paginates when unset.",format:'decompress: compression format. "auto" detects from the file extension; override when the extension is wrong: gzip|bzip2|xz|lzma|zstd|lz4|brotli|lzfse.',minLength:"strings: shortest printable run to keep. Raise (e.g. 12–16) to surface only symbols/URLs.",includeOffsets:"strings: prefixes each string with its hex byte offset — handy for pivoting to localSearchCode(searchBinary:true).",scanOffset:"strings: absolute byte offset to start the scan window. Take nextScanOffset from the result to page through a large binary losslessly (no string is split across windows). Omit/0 for the first window."}});const f=[".tar.gz",".tgz",".tar.bz2",".tbz2",".tbz",".tar.xz",".txz",".tar.zst",".tzst",".zip",".jar",".war",".apk",".7z"];export const LocalBinaryInspectQuerySchema=t(localBinaryInspect.schema,{...p,path:e.string(),mode:e.enum(["inspect","list","extract","decompress","strings","unpack"]),detailed:e.boolean().optional(),verbose:e.boolean().optional(),maxEntries:c(1,d).default(i),entriesPerPage:c(1,h).optional(),entryPageNumber:u(),archiveFile:e.string().optional(),matchString:e.string().optional(),matchStringContextLines:c(0,l).default(r),charOffset:a(),charLength:s(),format:e.enum(["auto","gzip","bzip2","xz","lzma","zstd","lz4","brotli","lzfse"]).default("auto"),minLength:c(1,m).default(n),includeOffsets:e.boolean().optional(),scanOffset:c(0,Number.MAX_SAFE_INTEGER).optional()}).superRefine((e,t)=>{"extract"!==e.mode||e.archiveFile||t.addIssue({code:"custom",path:["archiveFile"],message:'archiveFile is required for mode="extract" — run mode="list" first to get exact entry names'}),e.archiveFile?.startsWith("-")&&t.addIssue({code:"custom",path:["archiveFile"],message:'archiveFile must not start with "-" (prevents flag injection)'}),"decompress"===e.mode&&f.some(t=>e.path.toLowerCase().endsWith(t))&&t.addIssue({code:"custom",path:["mode"],message:'This path looks like a multi-entry archive — use mode="list" or mode="extract" instead of mode="decompress". decompress is for single-stream files only (.gz, .bz2, .xz, .zst, .lz4, .br, .lzfse).'})});
@@ -0,0 +1,41 @@
1
+ import { z } from "zod";
2
+ import type { ToolSpec } from "../../types/index.js";
3
+ export declare const localFindFiles: ToolSpec;
4
+ export declare const FindFilesQuerySchema: z.ZodObject<{
5
+ path: z.ZodString;
6
+ maxDepth: z.ZodOptional<z.ZodNumber>;
7
+ minDepth: z.ZodOptional<z.ZodNumber>;
8
+ names: z.ZodOptional<z.ZodArray<z.ZodString>>;
9
+ pathPattern: z.ZodOptional<z.ZodString>;
10
+ regex: z.ZodOptional<z.ZodString>;
11
+ empty: z.ZodOptional<z.ZodBoolean>;
12
+ modifiedWithin: z.ZodOptional<z.ZodString>;
13
+ modifiedBefore: z.ZodOptional<z.ZodString>;
14
+ accessedWithin: z.ZodOptional<z.ZodString>;
15
+ sizeGreater: z.ZodOptional<z.ZodString>;
16
+ sizeLess: z.ZodOptional<z.ZodString>;
17
+ permissions: z.ZodOptional<z.ZodString>;
18
+ executable: z.ZodOptional<z.ZodBoolean>;
19
+ readable: z.ZodOptional<z.ZodBoolean>;
20
+ writable: z.ZodOptional<z.ZodBoolean>;
21
+ excludeDir: z.ZodOptional<z.ZodArray<z.ZodString>>;
22
+ limit: z.ZodOptional<z.ZodNumber>;
23
+ details: z.ZodOptional<z.ZodBoolean>;
24
+ showFileLastModified: z.ZodOptional<z.ZodBoolean>;
25
+ sortBy: z.ZodDefault<z.ZodEnum<{
26
+ path: "path";
27
+ size: "size";
28
+ name: "name";
29
+ modified: "modified";
30
+ }>>;
31
+ entryType: z.ZodOptional<z.ZodEnum<{
32
+ f: "f";
33
+ d: "d";
34
+ }>>;
35
+ page: z.ZodDefault<z.ZodNumber>;
36
+ itemsPerPage: z.ZodOptional<z.ZodNumber>;
37
+ id: z.ZodOptional<z.ZodString>;
38
+ mainResearchGoal: z.ZodOptional<z.ZodString>;
39
+ researchGoal: z.ZodOptional<z.ZodString>;
40
+ reasoning: z.ZodOptional<z.ZodString>;
41
+ }, z.core.$strip>;
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";import{buildObject as t,defineTool as i,intRange as s,MAX_FIND_DEPTH as o,MAX_LOCAL_ITEMS_PER_PAGE as a,MAX_LOCAL_LIMIT as n,metaFields as r,pageNumber as l,StringArray as d}from"./_toolkit.js";export const localFindFiles=i({name:"localFindFiles",type:"Local",shortDescription:"Find local files and directories by name, size, time, or permissions.",instructions:'Returns paths + metadata, not content — more efficient than localSearchCode when you only need locations.\nRecipes: recently changed → modifiedWithin:"24h" + sortBy:"modified" + showFileLastModified:true; test files → names:["*.test.ts"] + pathPattern:"src/**"; large files → sizeGreater:"1m" + sortBy:"size"; index files → regex:"^index\\."; directories → entryType:"d".\nTime units: d/h/w/m. Default excludeDir skips node_modules, dist, .git, build, .next, coverage, IDE dirs — pass excludeDir:[] to search everything.\nBatch independent queries in one call.\nNext: localGetFileContent(path) to read; localSearchCode(keywords, path) to search content; localViewStructure(path) to browse.',schema:{path:"Directory to search from (absolute or workspace-relative).",maxDepth:"Deepest directory level to descend (0 = root only, 1 = root + immediate children). Pair with minDepth for a depth window.",minDepth:"Shallowest level to include; must be <= maxDepth. Pair with maxDepth for an exact band (e.g. minDepth:2 + maxDepth:2 = exactly two levels deep).",names:'Basename globs; a file matches if it matches ANY listed glob (OR). E.g. ["*.ts", "*.tsx", "package.json"]. Use for extension- or name-pattern discovery.',pathPattern:"Glob over the full path. Use for monorepo slicing, e.g. 'packages/*/src/**' to reach src across all packages.",regex:"Rust regex over the basename only (not the full path) — more precise than names[]. E.g. '^(index|main)\\.(ts|js)$'.",empty:"Matches empty files (0 bytes) or childless directories.",modifiedWithin:"Keeps files modified within the past window: '7d', '2h', '1w', '30m'. Use for 'what changed recently'.",modifiedBefore:"Keeps files last modified longer ago than the window (same format as modifiedWithin) — finds stale or abandoned files.",accessedWithin:"Keeps files accessed within the past window (same format as modifiedWithin).",sizeGreater:"Keeps files larger than this size: '100k', '1m', '500b'. Use to find bundles, generated files, or assets.",sizeLess:"Keeps files smaller than this size (same format as sizeGreater).",executable:"Keeps files executable by the current process.",readable:"Keeps files readable by the current process.",writable:"Keeps files writable by the current process.",excludeDir:"Directory names to skip. Defaults to [node_modules, dist, .git, build, .next, coverage, IDE dirs] when omitted; pass [] to search everything.",limit:"Caps how many entries are discovered before pagination. Distinct from page size.",details:"Adds size and permissions per entry. Does NOT add timestamps — set showFileLastModified for those.",showFileLastModified:"Adds last-modified timestamps per entry. Required for real time ordering with sortBy:'modified'. Independent of details.",sortBy:"Ordering. 'modified': newest first — needs showFileLastModified for true time order, else falls back to path. 'size': largest first. 'name': basename A–Z. 'path': full path A–Z.",entryType:'"f" matches files only, "d" directories only; omit to match both.',permissions:"Permission filter (e.g. '755', '-u+x'). Omit unless filtering by exact permission bits.",page:"Result page.",itemsPerPage:"Entries per page."}});export const FindFilesQuerySchema=t(localFindFiles.schema,{...r,path:e.string(),maxDepth:s(0,o).optional(),minDepth:s(0,o).optional(),names:d,pathPattern:e.string().optional(),regex:e.string().optional(),empty:e.boolean().optional(),modifiedWithin:e.string().optional(),modifiedBefore:e.string().optional(),accessedWithin:e.string().optional(),sizeGreater:e.string().optional(),sizeLess:e.string().optional(),permissions:e.string().optional(),executable:e.boolean().optional(),readable:e.boolean().optional(),writable:e.boolean().optional(),excludeDir:d,limit:s(1,n).optional(),details:e.boolean().optional(),showFileLastModified:e.boolean().optional(),sortBy:e.enum(["modified","name","path","size"]).default("modified"),entryType:e.enum(["f","d"]).optional(),page:l(),itemsPerPage:s(1,a).optional()}).superRefine((e,t)=>{void 0!==e.minDepth&&void 0!==e.maxDepth&&e.minDepth>e.maxDepth&&t.addIssue({code:"custom",message:"minDepth must be less than or equal to maxDepth.",path:["minDepth"]})});
@@ -0,0 +1,24 @@
1
+ import { z } from "zod";
2
+ import type { ToolSpec } from "../../types/index.js";
3
+ export declare const localGetFileContent: ToolSpec;
4
+ export declare const FetchContentQuerySchema: z.ZodObject<{
5
+ path: z.ZodString;
6
+ fullContent: z.ZodOptional<z.ZodBoolean>;
7
+ matchString: z.ZodOptional<z.ZodString>;
8
+ matchStringIsRegex: z.ZodOptional<z.ZodBoolean>;
9
+ matchStringCaseSensitive: z.ZodOptional<z.ZodBoolean>;
10
+ startLine: z.ZodOptional<z.ZodNumber>;
11
+ endLine: z.ZodOptional<z.ZodNumber>;
12
+ contextLines: z.ZodDefault<z.ZodNumber>;
13
+ charOffset: z.ZodOptional<z.ZodNumber>;
14
+ charLength: z.ZodOptional<z.ZodNumber>;
15
+ minify: z.ZodDefault<z.ZodEnum<{
16
+ none: "none";
17
+ standard: "standard";
18
+ symbols: "symbols";
19
+ }>>;
20
+ id: z.ZodOptional<z.ZodString>;
21
+ mainResearchGoal: z.ZodOptional<z.ZodString>;
22
+ researchGoal: z.ZodOptional<z.ZodString>;
23
+ reasoning: z.ZodOptional<z.ZodString>;
24
+ }, z.core.$strip>;
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";import{buildObject as t,charLength as n,charOffset as a,defineTool as i,intRange as s,lineNumber as o,MAX_CONTEXT_LINES as r,metaFields as l,validateFileContentExtractionMode as c}from"./_toolkit.js";export const localGetFileContent=i({name:"localGetFileContent",type:"Local",shortDescription:"Read a local file or a specific region.",instructions:'Best practice: start minify:"symbols" on any unknown file to orient, then read with "standard", or "none" to quote/match whitespace exactly.\nChoose one extraction mode (mutually exclusive): matchString, startLine+endLine, fullContent, or default — see those fields.\nSignals: isPartial:true → next charOffset is in hints[] (\'charOffset=N\'); matchRanges[i]={start,end} are 1-based lines → pass matchRanges[0].start as lineHint to lspGetSemantics; warnings[] → redaction, auto-pagination, or symbols fallback. evidence.answerReady:true means content returned (check isPartial separately).\nNext: lspGetSemantics(uri=path, symbolName, lineHint=matchRanges[0].start) for semantics; localSearchCode first when the symbol\'s location is unknown. Batch files in one queries:[...] call.',schema:{path:"File to read (absolute or workspace-relative). For directories, use localViewStructure.",fullContent:"Returns the whole file. Reserve for small files; for large ones use matchString or startLine/endLine. Mutually exclusive with both.",matchString:'Anchor text (or regex) to locate; all occurrences come back as merged slices, with matchRanges[i]={start,end} as 1-based line numbers — pass matchRanges[0].start as lineHint to lspGetSemantics. Case-insensitive unless matchStringCaseSensitive:true; regex when matchStringIsRegex:true. Mutually exclusive with startLine/endLine and fullContent; ignored when minify:"symbols".',matchStringIsRegex:"Treats matchString as a regex — use for flexible anchors like function signatures, imports, or JSDoc tags.",matchStringCaseSensitive:"Makes matchString matching case-sensitive (case-insensitive otherwise).",startLine:"First line of the range. Required together with endLine — sending only one is an error. Mutually exclusive with fullContent and matchString.",endLine:"Last line of the range; must be >= startLine. Required together with startLine. Mutually exclusive with fullContent and matchString.",contextLines:"Extra source lines around each matchString hit. Raise to capture a full function body without a follow-up read.",charOffset:"Continuation offset for the next page; take it from hints[] ('charOffset=N') — do not compute it yourself.",charLength:"Page size in characters. Auto-paginates when unset; set it explicitly for normal source files.",minify:'"symbols": structural skeleton with line numbers in the gutter — much smaller. Use this first to orient on any unknown file before reading its body. matchString and charLength are ignored in symbols mode. "standard": strips comments and blank lines. "none": exact raw text — use when quoting or matching whitespace precisely.'}});export const FetchContentQuerySchema=t(localGetFileContent.schema,{...l,path:e.string(),fullContent:e.boolean().optional(),matchString:e.string().optional(),matchStringIsRegex:e.boolean().optional(),matchStringCaseSensitive:e.boolean().optional(),startLine:o(),endLine:o(),contextLines:s(0,r).default(5),charOffset:a(),charLength:n(),minify:e.enum(["none","standard","symbols"]).default("standard")}).superRefine(c);
@@ -0,0 +1,73 @@
1
+ import { z } from "zod";
2
+ import type { ToolSpec } from "../../types/index.js";
3
+ export declare const localSearchCode: ToolSpec;
4
+ export declare const RipgrepQuerySchema: z.ZodObject<{
5
+ keywords: z.ZodOptional<z.ZodString>;
6
+ path: z.ZodString;
7
+ mode: z.ZodDefault<z.ZodEnum<{
8
+ paginated: "paginated";
9
+ discovery: "discovery";
10
+ detailed: "detailed";
11
+ structural: "structural";
12
+ }>>;
13
+ pattern: z.ZodOptional<z.ZodString>;
14
+ rule: z.ZodOptional<z.ZodString>;
15
+ fixedString: z.ZodOptional<z.ZodBoolean>;
16
+ perlRegex: z.ZodOptional<z.ZodBoolean>;
17
+ caseInsensitive: z.ZodOptional<z.ZodBoolean>;
18
+ caseSensitive: z.ZodOptional<z.ZodBoolean>;
19
+ wholeWord: z.ZodOptional<z.ZodBoolean>;
20
+ invertMatch: z.ZodOptional<z.ZodBoolean>;
21
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
22
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
23
+ excludeDir: z.ZodOptional<z.ZodArray<z.ZodString>>;
24
+ noIgnore: z.ZodOptional<z.ZodBoolean>;
25
+ hidden: z.ZodOptional<z.ZodBoolean>;
26
+ filesOnly: z.ZodOptional<z.ZodBoolean>;
27
+ filesWithoutMatch: z.ZodOptional<z.ZodBoolean>;
28
+ contextLines: z.ZodOptional<z.ZodNumber>;
29
+ matchContentLength: z.ZodDefault<z.ZodNumber>;
30
+ maxMatchesPerFile: z.ZodOptional<z.ZodNumber>;
31
+ maxFiles: z.ZodOptional<z.ZodNumber>;
32
+ multiline: z.ZodOptional<z.ZodBoolean>;
33
+ multilineDotall: z.ZodOptional<z.ZodBoolean>;
34
+ sort: z.ZodDefault<z.ZodEnum<{
35
+ path: "path";
36
+ created: "created";
37
+ relevance: "relevance";
38
+ matchCount: "matchCount";
39
+ modified: "modified";
40
+ accessed: "accessed";
41
+ }>>;
42
+ sortReverse: z.ZodOptional<z.ZodBoolean>;
43
+ rankingProfile: z.ZodDefault<z.ZodEnum<{
44
+ auto: "auto";
45
+ typescript: "typescript";
46
+ javascript: "javascript";
47
+ rust: "rust";
48
+ python: "python";
49
+ go: "go";
50
+ java: "java";
51
+ scala: "scala";
52
+ markdown: "markdown";
53
+ json: "json";
54
+ yaml: "yaml";
55
+ generic: "generic";
56
+ }>>;
57
+ debugRanking: z.ZodOptional<z.ZodBoolean>;
58
+ semanticRanking: z.ZodOptional<z.ZodBoolean>;
59
+ langType: z.ZodOptional<z.ZodString>;
60
+ countLinesPerFile: z.ZodOptional<z.ZodBoolean>;
61
+ countMatchesPerFile: z.ZodOptional<z.ZodBoolean>;
62
+ onlyMatching: z.ZodOptional<z.ZodBoolean>;
63
+ unique: z.ZodOptional<z.ZodBoolean>;
64
+ countUnique: z.ZodOptional<z.ZodBoolean>;
65
+ matchWindow: z.ZodOptional<z.ZodNumber>;
66
+ matchPage: z.ZodOptional<z.ZodNumber>;
67
+ itemsPerPage: z.ZodOptional<z.ZodNumber>;
68
+ page: z.ZodDefault<z.ZodNumber>;
69
+ id: z.ZodOptional<z.ZodString>;
70
+ mainResearchGoal: z.ZodOptional<z.ZodString>;
71
+ researchGoal: z.ZodOptional<z.ZodString>;
72
+ reasoning: z.ZodOptional<z.ZodString>;
73
+ }, z.core.$strip>;
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";import{buildObject as t,contextLines as a,DEFAULT_MATCH_CONTENT_LENGTH as n,defineTool as i,intRange as o,MAX_MATCH_COUNT as s,MAX_MATCH_CONTENT_LENGTH as l,MAX_SEARCH_ITEMS_PER_PAGE as r,metaFields as c,optionalPageNumber as u,pageNumber as d,StringArray as h}from"./_toolkit.js";export const localSearchCode=i({name:"localSearchCode",type:"Local",shortDescription:"Search local files for text, regex, or AST patterns to find file and line.",instructions:'Pick a mode: "discovery" (paths only, cheapest orientation), "paginated" (snippets), "detailed" (snippets + context). For counts use countLinesPerFile/countMatchesPerFile — there is no mode:"count".\nmode:"structural" (set pattern OR rule) handles AST/shape queries regex can\'t express — e.g. eval($X) call sites, async fns lacking try/catch. keywords is ignored there; matches[].line still works as a lineHint.\nBest practice: narrow with include/exclude/excludeDir/langType before paging noisy results; page only when hasMore, and use matchPage to walk one file\'s matches.\nSignals: searchEngine flags a reduced-capability fallback (perlRegex dropped, countMatchesPerFile becomes line counts). evidence.answerReady:true means ≥1 result — still check pagination.hasMore before stopping.\nNext: localGetFileContent(path, matchString=keyword) to read; lspGetSemantics(uri=files[0].path, symbolName, lineHint=matches[0].line) for semantics; localViewStructure if root unknown; localFindFiles to search by filename/metadata.',schema:{keywords:"The search pattern (text or regex). Set fixedString:true for a literal match, or perlRegex:true for advanced regex features (lookaheads, backreferences).",path:"File or directory to search (absolute paths are safest).",mode:'"paginated": matches with snippets. "discovery": file paths only — cheapest, for orienting before you read. "detailed": snippets with surrounding context, for deep reading without a follow-up read. "structural": AST/shape search (set pattern OR rule) for queries regex can\'t express. For counts only, set countLinesPerFile or countMatchesPerFile.',pattern:'mode:"structural" only. An ast-grep code-shaped pattern. Metavariables: $X matches a single node (captured), $$$ARGS matches a list of nodes. E.g. eval($X) / console.log($$$) / oldApi.foo($X). Matches code structure, so comments and strings never false-positive. Mutually exclusive with rule.',rule:'mode:"structural" only. A YAML relational/composite ast-grep rule blob for what plain patterns can\'t express — negation and parent/child relations (not/inside/has/all/any). E.g. "rule:\\n pattern: await $C\\n inside:\\n kind: for_statement\\n stopBy: end". NOTE: relational sub-rules need stopBy: end to walk all ancestors/descendants, else they silently match nothing. Mutually exclusive with pattern.',fixedString:"Literal match (disables regex). Mutually exclusive with perlRegex.",perlRegex:"Advanced regex (lookaheads, backreferences). Mutually exclusive with fixedString.",caseInsensitive:"Case-insensitive matching. Mutually exclusive with caseSensitive.",caseSensitive:"Case-sensitive matching. Mutually exclusive with caseInsensitive.",wholeWord:"Matches whole words only.",invertMatch:"Returns non-matching lines. To list files lacking the pattern, use filesWithoutMatch instead.",include:"Globs of files to search, e.g. '*.ts', 'src/**/*.tsx'. Only files matching any glob are searched.",exclude:"Globs of files to skip, e.g. '*.min.js', 'dist/**'.",excludeDir:"Directory names to skip entirely (e.g. 'node_modules', 'dist', '.git') — faster than exclude globs for whole directories.",noIgnore:"Searches files normally hidden by .gitignore/.ignore.",hidden:"Includes hidden (dot) files.",filesOnly:"Returns matching file paths without line content. Mutually exclusive with filesWithoutMatch.",filesWithoutMatch:"Returns files that do NOT contain the pattern — useful to find files missing a required import or header. Mutually exclusive with filesOnly.",contextLines:"Lines of context around each match. Pair with mode:'detailed' for self-contained snippets.",matchContentLength:"Characters kept per match snippet. Raise for minified code or JSON, or when truncation hides matches.",maxMatchesPerFile:"Caps matches per file and sets the per-file page size; when a file has more, file.pagination.hasMore appears — page it with matchPage. No effect in filesOnly/count modes.",maxFiles:"Caps how many matched files are returned.",multiline:"Lets a match span lines. Add multilineDotall to let . cross newlines.",multilineDotall:"Lets . match newlines too. Requires multiline:true.",sort:"Result ordering. 'relevance' (default): language-aware deterministic score — exact/declaration/export/import lines, query token in path, source-dir affinity, saturated match count; surfaces the most contextually relevant files first for broad terms. TO TURN OFF relevance ranking (and skip its AST classification cost), pass 'matchCount' (most matches first, legacy behavior) or 'path' (alphabetical) — both are deterministic and do no language-aware scoring. 'modified'/'accessed'/'created': filesystem time.",sortReverse:"Reverses the sort (e.g. sort:'modified' + sortReverse:true = oldest first). No effect on 'relevance'/'matchCount'.",rankingProfile:"Language ranking profile used by sort:'relevance'. 'auto' (default) selects by langType then file extension; pass an explicit profile (typescript, rust, python, go, markdown, …) to force one.",debugRanking:"When true, include per-file ranking { score, profile, pathRole, reasons } so the relevance order is inspectable. Off by default to keep output compact.",semanticRanking:"When true (with sort:'relevance'), apply a bounded, capped LSP boost to the top relevance candidates — definitions, exported/public symbols, and symbols with callers rank higher. Optional and deterministic: LSP never gates results and failures degrade to text/AST ranking.",langType:"Language filter (ts, js, py, go, rust, …) — more precise than include globs.",countLinesPerFile:"Returns the count of matching lines per file instead of content — good for orientation (which files have the most hits). Mutually exclusive with countMatchesPerFile.",countMatchesPerFile:"Returns the total match count per file (counts multiple hits on one line). Mutually exclusive with countLinesPerFile.",onlyMatching:"Returns only the matched substring(s), one entry per hit, instead of the whole line. The way to enumerate every hit on a minified one-liner (line mode can only count them). Pair with matchWindow for surrounding context.",unique:"With onlyMatching, returns each distinct matched value once per file while keeping the first occurrence as the line/column anchor.",countUnique:"With onlyMatching, returns each distinct matched value once per file with a count field sorted by frequency descending.",matchWindow:"With onlyMatching, widen each matched span by this many characters on each side for context (trimmed sides marked with …). 0 = the bare match. Requires onlyMatching.",matchPage:"Page within one file's matches; pair with maxMatchesPerFile to walk a noisy file.",itemsPerPage:"Files per page.",page:"Result page."}});export const RipgrepQuerySchema=t(localSearchCode.schema,{...c,keywords:e.string().optional(),path:e.string(),mode:e.enum(["paginated","discovery","detailed","structural"]).default("paginated"),pattern:e.string().optional(),rule:e.string().optional(),fixedString:e.boolean().optional(),perlRegex:e.boolean().optional(),caseInsensitive:e.boolean().optional(),caseSensitive:e.boolean().optional(),wholeWord:e.boolean().optional(),invertMatch:e.boolean().optional(),include:h,exclude:h,excludeDir:h,noIgnore:e.boolean().optional(),hidden:e.boolean().optional(),filesOnly:e.boolean().optional(),filesWithoutMatch:e.boolean().optional(),contextLines:a(),matchContentLength:o(1,l).default(n),maxMatchesPerFile:o(1,s).optional(),maxFiles:o(1,s).optional(),multiline:e.boolean().optional(),multilineDotall:e.boolean().optional(),sort:e.enum(["relevance","matchCount","path","modified","accessed","created"]).default("relevance"),sortReverse:e.boolean().optional(),rankingProfile:e.enum(["auto","typescript","javascript","rust","python","go","java","scala","markdown","json","yaml","generic"]).default("auto"),debugRanking:e.boolean().optional(),semanticRanking:e.boolean().optional(),langType:e.string().optional(),countLinesPerFile:e.boolean().optional(),countMatchesPerFile:e.boolean().optional(),onlyMatching:e.boolean().optional(),unique:e.boolean().optional(),countUnique:e.boolean().optional(),matchWindow:o(0,200).optional(),matchPage:u(),itemsPerPage:o(1,r).optional(),page:d()}).superRefine((e,t)=>{if("structural"===e.mode){e.pattern||e.rule||t.addIssue({code:"custom",message:'mode:"structural" requires `pattern` (a code-shaped query) or `rule` (a YAML relational rule).',path:["pattern"]}),e.pattern&&e.rule&&t.addIssue({code:"custom",message:"`pattern` and `rule` are mutually exclusive.",path:["rule"]});for(const a of["fixedString","perlRegex","wholeWord","invertMatch","multiline","multilineDotall","onlyMatching","unique","countUnique"])e[a]&&t.addIssue({code:"custom",message:`\`${a}\` is not valid with mode:"structural".`,path:[a]})}else(e.pattern||e.rule)&&t.addIssue({code:"custom",message:'`pattern`/`rule` require mode:"structural".',path:[e.pattern?"pattern":"rule"]}),e.keywords||t.addIssue({code:"custom",message:'`keywords` is required unless mode:"structural".',path:["keywords"]});e.filesOnly&&e.filesWithoutMatch&&t.addIssue({code:"custom",message:"filesOnly and filesWithoutMatch are mutually exclusive.",path:["filesWithoutMatch"]}),e.fixedString&&e.perlRegex&&t.addIssue({code:"custom",message:"fixedString and perlRegex are mutually exclusive.",path:["perlRegex"]}),e.caseSensitive&&e.caseInsensitive&&t.addIssue({code:"custom",message:"caseSensitive and caseInsensitive are mutually exclusive.",path:["caseInsensitive"]}),e.multilineDotall&&!e.multiline&&t.addIssue({code:"custom",message:"multilineDotall requires multiline=true.",path:["multilineDotall"]}),e.countLinesPerFile&&e.countMatchesPerFile&&t.addIssue({code:"custom",message:"countLinesPerFile and countMatchesPerFile are mutually exclusive.",path:["countMatchesPerFile"]}),void 0===e.matchWindow||e.onlyMatching||t.addIssue({code:"custom",message:"matchWindow requires onlyMatching:true.",path:["matchWindow"]}),e.unique&&!e.onlyMatching&&t.addIssue({code:"custom",message:"unique requires onlyMatching:true.",path:["unique"]}),e.countUnique&&!e.onlyMatching&&t.addIssue({code:"custom",message:"countUnique requires onlyMatching:true.",path:["countUnique"]})});
@@ -0,0 +1,29 @@
1
+ import { z } from "zod";
2
+ import type { ToolSpec } from "../../types/index.js";
3
+ export declare const localViewStructure: ToolSpec;
4
+ export declare const ViewStructureQuerySchema: z.ZodObject<{
5
+ path: z.ZodString;
6
+ details: z.ZodOptional<z.ZodBoolean>;
7
+ hidden: z.ZodOptional<z.ZodBoolean>;
8
+ sortBy: z.ZodDefault<z.ZodEnum<{
9
+ extension: "extension";
10
+ size: "size";
11
+ name: "name";
12
+ time: "time";
13
+ }>>;
14
+ reverse: z.ZodOptional<z.ZodBoolean>;
15
+ pattern: z.ZodOptional<z.ZodString>;
16
+ directoriesOnly: z.ZodOptional<z.ZodBoolean>;
17
+ filesOnly: z.ZodOptional<z.ZodBoolean>;
18
+ recursive: z.ZodOptional<z.ZodBoolean>;
19
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
20
+ maxDepth: z.ZodOptional<z.ZodNumber>;
21
+ limit: z.ZodOptional<z.ZodNumber>;
22
+ showFileLastModified: z.ZodOptional<z.ZodBoolean>;
23
+ page: z.ZodDefault<z.ZodNumber>;
24
+ itemsPerPage: z.ZodOptional<z.ZodNumber>;
25
+ id: z.ZodOptional<z.ZodString>;
26
+ mainResearchGoal: z.ZodOptional<z.ZodString>;
27
+ researchGoal: z.ZodOptional<z.ZodString>;
28
+ reasoning: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strip>;
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";import{buildObject as t,defineTool as i,intRange as o,MAX_LOCAL_DEPTH as s,MAX_LOCAL_ITEMS_PER_PAGE as r,MAX_LOCAL_LIMIT as a,metaFields as n,pageNumber as l,StringArray as d}from"./_toolkit.js";export const localViewStructure=i({name:"localViewStructure",type:"Local",shortDescription:"Browse a local directory tree.",instructions:'Returns files[], folders[], links[]; details:true or showFileLastModified:true switches to entries[] with size, permissions, timestamps.\nBest practice: map a directory here before searching. Use localFindFiles instead when you need metadata or filename patterns, and localSearchCode(mode:"discovery") to find which files contain a pattern.\nPaginate with page=N while pagination.hasMore; batch multiple paths in one queries:[...] call.\nNext: localGetFileContent(path) to read; localSearchCode to search; lspGetSemantics once localSearchCode gives uri/symbolName/lineHint.',schema:{path:"Directory to browse (absolute or workspace-relative). Defaults to the workspace root.",details:"Returns per-entry objects with size, permissions, and dates (structured entries[] output).",hidden:"Includes hidden (dot) files and directories, e.g. .env, .git, .github.",sortBy:"Ordering. 'name': A–Z. 'size': by bytes. 'time': by last-modified (implicitly enables showFileLastModified). 'extension': grouped by file type.",reverse:"Reverses the sort (e.g. sortBy:'time' + reverse:true = oldest first).",pattern:"Name filter — a glob (e.g. '*.ts') or plain substring; only matching entries are returned. For regex, use localFindFiles.",directoriesOnly:"Returns directories only. Mutually exclusive with filesOnly.",filesOnly:"Returns files only. Mutually exclusive with directoriesOnly.",recursive:"Descends into subdirectories (top level only when off). When on without maxDepth, depth is capped automatically; set maxDepth to control cost.",extensions:"Extension whitelist, without dots, e.g. ['ts', 'tsx', 'js']. Only matching files are returned; directories always appear.",maxDepth:"Recursion depth when recursive is on (0 = immediate children). Start shallow on large monorepos, then drill in.",limit:"Caps how many entries are discovered before pagination — guards against huge scans. Distinct from page size.",showFileLastModified:"Adds last-modified timestamps per file. Independent of details. Use to spot recently changed files without switching to localFindFiles.",page:"Result page.",itemsPerPage:"Entries per page."}});export const ViewStructureQuerySchema=t(localViewStructure.schema,{...n,path:e.string(),details:e.boolean().optional(),hidden:e.boolean().optional(),sortBy:e.enum(["name","size","time","extension"]).default("name"),reverse:e.boolean().optional(),pattern:e.string().optional(),directoriesOnly:e.boolean().optional(),filesOnly:e.boolean().optional(),recursive:e.boolean().optional(),extensions:d,maxDepth:o(0,s).optional(),limit:o(1,a).optional(),showFileLastModified:e.boolean().optional(),page:l(),itemsPerPage:o(1,r).optional()}).superRefine((e,t)=>{e.filesOnly&&e.directoriesOnly&&t.addIssue({code:"custom",message:"filesOnly and directoriesOnly are mutually exclusive.",path:["directoriesOnly"]})});
@@ -0,0 +1,79 @@
1
+ import { z } from "zod";
2
+ import type { ToolSpec } from "../../types/index.js";
3
+ export declare const lspGetSemantics: ToolSpec;
4
+ export declare const LSPGotoDefinitionQuerySchema: z.ZodObject<{
5
+ contextLines: z.ZodOptional<z.ZodNumber>;
6
+ uri: z.ZodString;
7
+ symbolName: z.ZodString;
8
+ lineHint: z.ZodNumber;
9
+ orderHint: z.ZodDefault<z.ZodNumber>;
10
+ id: z.ZodOptional<z.ZodString>;
11
+ mainResearchGoal: z.ZodOptional<z.ZodString>;
12
+ researchGoal: z.ZodOptional<z.ZodString>;
13
+ reasoning: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strip>;
15
+ export declare const LSPFindReferencesQuerySchema: z.ZodObject<{
16
+ includeDeclaration: z.ZodOptional<z.ZodBoolean>;
17
+ contextLines: z.ZodOptional<z.ZodNumber>;
18
+ itemsPerPage: z.ZodOptional<z.ZodNumber>;
19
+ page: z.ZodDefault<z.ZodNumber>;
20
+ groupByFile: z.ZodOptional<z.ZodBoolean>;
21
+ uri: z.ZodString;
22
+ symbolName: z.ZodString;
23
+ lineHint: z.ZodNumber;
24
+ orderHint: z.ZodDefault<z.ZodNumber>;
25
+ id: z.ZodOptional<z.ZodString>;
26
+ mainResearchGoal: z.ZodOptional<z.ZodString>;
27
+ researchGoal: z.ZodOptional<z.ZodString>;
28
+ reasoning: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strip>;
30
+ export declare const LSPCallHierarchyQuerySchema: z.ZodObject<{
31
+ direction: z.ZodEnum<{
32
+ incoming: "incoming";
33
+ outgoing: "outgoing";
34
+ }>;
35
+ depth: z.ZodOptional<z.ZodNumber>;
36
+ contextLines: z.ZodOptional<z.ZodNumber>;
37
+ itemsPerPage: z.ZodOptional<z.ZodNumber>;
38
+ page: z.ZodDefault<z.ZodNumber>;
39
+ uri: z.ZodString;
40
+ symbolName: z.ZodString;
41
+ lineHint: z.ZodNumber;
42
+ orderHint: z.ZodDefault<z.ZodNumber>;
43
+ id: z.ZodOptional<z.ZodString>;
44
+ mainResearchGoal: z.ZodOptional<z.ZodString>;
45
+ researchGoal: z.ZodOptional<z.ZodString>;
46
+ reasoning: z.ZodOptional<z.ZodString>;
47
+ }, z.core.$strip>;
48
+ export declare const LspGetSemanticsQuerySchema: z.ZodObject<{
49
+ uri: z.ZodString;
50
+ type: z.ZodDefault<z.ZodEnum<{
51
+ definition: "definition";
52
+ references: "references";
53
+ callers: "callers";
54
+ callees: "callees";
55
+ callHierarchy: "callHierarchy";
56
+ hover: "hover";
57
+ documentSymbols: "documentSymbols";
58
+ typeDefinition: "typeDefinition";
59
+ implementation: "implementation";
60
+ }>>;
61
+ symbolName: z.ZodOptional<z.ZodString>;
62
+ lineHint: z.ZodOptional<z.ZodNumber>;
63
+ orderHint: z.ZodDefault<z.ZodNumber>;
64
+ depth: z.ZodOptional<z.ZodNumber>;
65
+ includeDeclaration: z.ZodDefault<z.ZodBoolean>;
66
+ groupByFile: z.ZodOptional<z.ZodBoolean>;
67
+ page: z.ZodDefault<z.ZodNumber>;
68
+ itemsPerPage: z.ZodOptional<z.ZodNumber>;
69
+ contextLines: z.ZodOptional<z.ZodNumber>;
70
+ format: z.ZodDefault<z.ZodEnum<{
71
+ structured: "structured";
72
+ compact: "compact";
73
+ }>>;
74
+ workspaceRoot: z.ZodOptional<z.ZodString>;
75
+ id: z.ZodOptional<z.ZodString>;
76
+ mainResearchGoal: z.ZodOptional<z.ZodString>;
77
+ researchGoal: z.ZodOptional<z.ZodString>;
78
+ reasoning: z.ZodOptional<z.ZodString>;
79
+ }, z.core.$strip>;
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";import{buildObject as t,contextLines as o,defineTool as n,intRange as i,MAX_LINE_NUMBER as a,MAX_LSP_DEPTH as s,MAX_LSP_ITEMS_PER_PAGE as l,MAX_ORDER_HINT as r,metaFields as c,pageNumber as m}from"./_toolkit.js";export const lspGetSemantics=n({name:"lspGetSemantics",type:"Local",shortDescription:"Run LSP semantic queries — definitions, references, call hierarchy, symbols.",instructions:'Default type is definition. Every type except documentSymbols needs symbolName + lineHint, and lineHint MUST come from a real localSearchCode match (matches[0].line) — a guessed line silently returns nothing. No lineHint yet? Run documentSymbols (uri only) or localSearchCode first.\nType routing: documentSymbols=file outline; hover=signature+docs; definition=declaration; typeDefinition=generic type; implementation=abstract member impl; references=same-package usages (NOT cross-package — zero ≠ unused; try callers); callers=cross-package incoming calls; callees=outgoing; callHierarchy=both.\nCapability varies by language server: TS/JS/Go/Rust usually support all; Python/C++ often lack callHierarchy/callers/callees (use references). An unsupported type isn\'t rejected — payload.kind=\'empty\' (serverUnavailable) means "not supported here", not "no results"; re-route, don\'t conclude absence.\nBest practice: format:"compact" on call queries and groupByFile:true on references cut tokens sharply; contextLines embeds source so you skip a follow-up read.\nSignals: resolvedSymbol.foundAtLine confirms the resolved line (far from lineHint → re-anchor via localSearchCode); each ranges[].line is the next lineHint.\nNext: localGetFileContent(startLine/endLine) to read a definition; lspGetSemantics(callers) for impact. Batch related queries (definition+hover, definition+callers) in one call.',schema:{uri:"Target source file as an absolute path or file:/// URI.",type:"Which query to run — see the type-routing list in the instructions.",symbolName:"Exact identifier sitting at lineHint — bare name only, no parentheses or type annotations (e.g. 'fetchPRDetail', not 'fetchPRDetail()'). Case-sensitive, must match the token exactly. Required for every type except documentSymbols.",lineHint:"Line where symbolName appears. Must come from a real localSearchCode match (matches[0].line) — never guess; a wrong value silently returns nothing. Required for every type except documentSymbols.",orderHint:"Disambiguates when symbolName occurs multiple times on lineHint (e.g. overloads, chained calls) — increment if you get the wrong symbol.",depth:"Recursion depth for callHierarchy/callers/callees — immediate calls only unless raised. Raise for full chains; pair high depth on hot symbols with format:'compact' to limit size.",includeDeclaration:"references: whether to include the symbol's own declaration. Set false to get only usages, not the definition site.",groupByFile:"references: returns a per-file summary (path + count + all line numbers in lines[]) instead of per-location rows — ideal for blast radius; each line is a valid lineHint for follow-ups.",page:"Result page for documentSymbols and call-flow results.",itemsPerPage:"Items per page (symbol/location lists get a larger page than call-flow results).",contextLines:"Source lines around each call site in callers/callees/callHierarchy (locations only unless set). Raise to embed calling context and skip a follow-up localGetFileContent.",format:'"structured": typed objects with full location metadata. "compact": line-oriented strings, far fewer tokens. Prefer "compact" for navigation; use "structured" only when parsing locations programmatically.',workspaceRoot:"Overrides the LSP workspace root (absolute path). Omit to auto-resolve from uri; needed only when the server spans multiple roots."}});const u={...c,uri:e.string(),symbolName:e.string(),lineHint:i(1,a),orderHint:i(0,r).default(0)};export const LSPGotoDefinitionQuerySchema=t(lspGetSemantics.schema,{...u,contextLines:o()});export const LSPFindReferencesQuerySchema=t(lspGetSemantics.schema,{...u,includeDeclaration:e.boolean().optional(),contextLines:o(),itemsPerPage:i(1,l).optional(),page:m(),groupByFile:e.boolean().optional()});export const LSPCallHierarchyQuerySchema=t(lspGetSemantics.schema,{...u,direction:e.enum(["incoming","outgoing"]).describe('Call direction: "incoming" (who calls this symbol) or "outgoing" (what this symbol calls).'),depth:i(0,s).optional(),contextLines:o(),itemsPerPage:i(1,l).optional(),page:m()});export const LspGetSemanticsQuerySchema=t(lspGetSemantics.schema,{...c,uri:e.string(),type:e.enum(["definition","references","callers","callees","callHierarchy","hover","documentSymbols","typeDefinition","implementation"]).default("definition"),symbolName:e.string().min(1).optional(),lineHint:i(1,a).optional(),orderHint:i(0,r).default(0),depth:i(0,s).optional(),includeDeclaration:e.boolean().default(!0),groupByFile:e.boolean().optional(),page:m(),itemsPerPage:i(1,l).optional(),contextLines:o(),format:e.enum(["structured","compact"]).default("structured"),workspaceRoot:e.string().optional()}).superRefine((e,t)=>{"documentSymbols"!==e.type&&(e.symbolName||t.addIssue({code:"custom",path:["symbolName"],message:"symbolName is required unless type is documentSymbols"}),Number.isInteger(e.lineHint)||t.addIssue({code:"custom",path:["lineHint"],message:"lineHint is required unless type is documentSymbols"}))});
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ import type { ToolSpec } from "../../types/index.js";
3
+ export declare const npmSearch: ToolSpec;
4
+ export declare const NpmPackageQuerySchema: z.ZodObject<{
5
+ packageName: z.ZodString;
6
+ page: z.ZodDefault<z.ZodNumber>;
7
+ id: z.ZodOptional<z.ZodString>;
8
+ mainResearchGoal: z.ZodOptional<z.ZodString>;
9
+ researchGoal: z.ZodOptional<z.ZodString>;
10
+ reasoning: z.ZodOptional<z.ZodString>;
11
+ }, z.core.$strip>;
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";import{buildObject as r,defineTool as t,metaFields as o,pageNumber as a}from"./_toolkit.js";export const npmSearch=t({name:"npmSearch",type:"NPM",shortDescription:"Look up npm packages and find their source repositories.",instructions:"An exact package name returns one rich result (version, keywords, repository owner/repo); a keyword query returns a lean list — paginate with page while pagination.hasMore.\nBest practice: skip this tool when owner/repo is already known — go straight to ghViewRepoStructure. Use it mainly to resolve a package to its source repo.\nWhen the result has owner/repo, hand off to ghViewRepoStructure or ghSearchCode; if a repositoryDirectory is present, pass it as path= to scope the tree to the package subdirectory.\nBatch multiple packages in one queries:[...] call.\nNext: ghViewRepoStructure/ghSearchCode when owner/repo exists; ghSearchRepos when it's absent or non-GitHub.",schema:{packageName:"An exact npm package name or a keyword query. An exact name (e.g. 'react', '@octokit/rest') returns one rich result, or empty if it doesn't exist (check spelling before assuming it's private). A keyword query returns a lean list. Scoped packages need the full scope: '@octokit/rest', not 'rest'.",page:"Page for keyword results; exact-name lookups always return page 1. Paginate while pagination.hasMore."}});export const NpmPackageQuerySchema=r(npmSearch.schema,{...o,packageName:e.string(),page:a()});