@octocodeai/octocode-tools-core 18.2.0 → 19.1.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.
- package/README.md +19 -19
- package/dist/chunks/direct/chunk-3AA4F3QO.js +10 -0
- package/dist/chunks/direct/chunk-43RVQWTG.js +8 -0
- package/dist/chunks/direct/chunk-7DYE654A.js +8 -0
- package/dist/chunks/direct/chunk-A4WMBDEC.js +8 -0
- package/dist/chunks/direct/chunk-AWZG43MA.js +8 -0
- package/dist/chunks/direct/chunk-BICVXQ5F.js +8 -0
- package/dist/chunks/direct/chunk-BMM5H6QF.js +11 -0
- package/dist/chunks/direct/chunk-C6HFNIDL.js +8 -0
- package/dist/chunks/direct/chunk-CBCZVCTZ.js +8 -0
- package/dist/chunks/direct/chunk-CBIKUVP6.js +11 -0
- package/dist/chunks/direct/chunk-CKB2ME2J.js +8 -0
- package/dist/chunks/direct/chunk-DBI23PBG.js +9 -0
- package/dist/chunks/direct/chunk-DBSQWRFS.js +9 -0
- package/dist/chunks/direct/chunk-DKGYPFGX.js +8 -0
- package/dist/chunks/direct/chunk-EOLHXX5I.js +8 -0
- package/dist/chunks/direct/chunk-IFPXDKUV.js +8 -0
- package/dist/chunks/direct/chunk-J3WYA3IJ.js +8 -0
- package/dist/chunks/direct/chunk-MCMOWPYL.js +8 -0
- package/dist/chunks/direct/chunk-MPTAIBY7.js +8 -0
- package/dist/chunks/direct/chunk-NQRDACK3.js +8 -0
- package/dist/chunks/direct/chunk-O5ETB2W5.js +8 -0
- package/dist/chunks/direct/chunk-OA6NU4KO.js +8 -0
- package/dist/chunks/direct/chunk-QKDE2HIF.js +10 -0
- package/dist/chunks/direct/chunk-RRSY2ZPX.js +13 -0
- package/dist/chunks/direct/chunk-UKQLRZEW.js +8 -0
- package/dist/chunks/direct/chunk-USZL65FN.js +8 -0
- package/dist/chunks/direct/chunk-WH6GL3J2.js +8 -0
- package/dist/chunks/direct/chunk-Y5OCKUQX.js +9 -0
- package/dist/chunks/direct/chunk-ZO44CZN5.js +8 -0
- package/dist/chunks/direct/chunk-ZSXRT7JL.js +12 -0
- package/dist/chunks/direct/chunk-ZUNPQVMO.js +8 -0
- package/dist/chunks/direct/execution-3T4B776P.js +9 -0
- package/dist/chunks/direct/execution-5BJNS7D7.js +8 -0
- package/dist/chunks/direct/execution-5O6QHKBR.js +8 -0
- package/dist/chunks/direct/execution-A4NK3BQO.js +8 -0
- package/dist/chunks/direct/execution-K4UOPXRQ.js +9 -0
- package/dist/chunks/direct/execution-SWWZOOA7.js +13 -0
- package/dist/chunks/direct/execution-X4MUJL4L.js +8 -0
- package/dist/chunks/direct/execution-XA6PXPRB.js +8 -0
- package/dist/chunks/direct/historyExecutions-6F3AA5PY.js +14 -0
- package/dist/direct.d.ts +6 -1
- package/dist/direct.js +2 -46
- package/dist/github/canonicalRepo.d.ts +2 -1
- package/dist/github/client.d.ts +3 -8
- package/dist/github/codeSearch/compactFragment.d.ts +7 -0
- package/dist/github/codeSearch.d.ts +2 -3
- package/dist/github/commit.d.ts +8 -0
- package/dist/github/commitDetail.d.ts +20 -0
- package/dist/github/commitSearch.d.ts +17 -0
- package/dist/github/compare.d.ts +15 -0
- package/dist/github/directoryFetch/cacheMetadata.d.ts +25 -0
- package/dist/github/directoryFetch/helpers.d.ts +1 -3
- package/dist/github/directoryFetch/snapshot.d.ts +10 -0
- package/dist/github/fileContentProcess.d.ts +0 -1
- package/dist/github/fileContentRaw/cache.d.ts +9 -0
- package/dist/github/fileContentRaw/fetch.d.ts +1 -1
- package/dist/github/githubAPI.d.ts +19 -2
- package/dist/github/history/commitFiles.d.ts +12 -0
- package/dist/github/issues/fetchers.d.ts +1 -1
- package/dist/github/issues/types.d.ts +3 -1
- package/dist/github/prContentFetcher/collectionPaging.d.ts +27 -0
- package/dist/github/prContentFetcher/comments.d.ts +7 -5
- package/dist/github/prContentFetcher/commits.d.ts +13 -14
- package/dist/github/prContentFetcher/flags.d.ts +0 -1
- package/dist/github/prContentFetcher/transform.d.ts +1 -1
- package/dist/github/prTransformation.d.ts +3 -1
- package/dist/github/queryBuilders/codeAndRepo.d.ts +2 -1
- package/dist/github/repoSearch.d.ts +2 -1
- package/dist/github/repoStructure/fetchOrchestration.d.ts +1 -1
- package/dist/github/repoStructurePagination.d.ts +1 -1
- package/dist/github/repoStructureTree.d.ts +4 -2
- package/dist/graph/advancedOperations.d.ts +2 -2
- package/dist/graph/buildFileGraph.d.ts +8 -13
- package/dist/graph/coverage.d.ts +6 -0
- package/dist/graph/diagnosticSnapshot.d.ts +10 -0
- package/dist/graph/fileImportLinker.d.ts +28 -0
- package/dist/graph/importResolver.d.ts +1 -1
- package/dist/graph/languageImportResolver.d.ts +5 -0
- package/dist/graph/metadataImports.d.ts +7 -0
- package/dist/graph/packageExportTargets.d.ts +11 -0
- package/dist/graph/rustCargoMetadata.d.ts +31 -0
- package/dist/graph/rustCargoProcess.d.ts +16 -0
- package/dist/graph/rustModules.d.ts +7 -0
- package/dist/graph/rustWorkspace.d.ts +5 -0
- package/dist/graph/types.d.ts +94 -3
- package/dist/graph/workspacePackageResolver.d.ts +7 -2
- package/dist/index.d.ts +46 -19
- package/dist/index.js +36 -45
- package/dist/providers/github/GitHubProvider.d.ts +3 -1
- package/dist/providers/github/githubContent.d.ts +3 -2
- package/dist/providers/github/githubPullRequests.d.ts +3 -2
- package/dist/providers/github/githubSearch.d.ts +6 -3
- package/dist/providers/github/githubStructure.d.ts +3 -2
- package/dist/providers/providerQueries.d.ts +4 -0
- package/dist/providers/providerResults.d.ts +29 -1
- package/dist/providers/types.d.ts +0 -2
- package/dist/schema.d.ts +9 -3
- package/dist/schema.js +4 -12
- package/dist/scheme/fields.d.ts +8 -8
- package/dist/scheme/pagination.d.ts +1 -0
- package/dist/serverConfig.d.ts +1 -1
- package/dist/shared/session/index.d.ts +1 -1
- package/dist/shared/session/index.js +1 -1
- package/dist/shared/session/storage.d.ts +0 -1
- package/dist/toolContract/descriptions.d.ts +6 -6
- package/dist/toolContract/input/resources/tools/ghSearch.d.ts +21 -20
- package/dist/toolContract/input/resources/tools/githubHistorySchema.d.ts +14 -6
- package/dist/toolContract/input/resources/tools/githubRepositoriesOperation.d.ts +3 -3
- package/dist/toolContract/input/resources/tools/githubTreeOperation.d.ts +4 -2
- package/dist/toolContract/input/resources/tools/historyCommitInput.d.ts +9 -0
- package/dist/toolContract/input/resources/tools/historyIssueInput.d.ts +4 -4
- package/dist/toolContract/input/resources/tools/historyPullRequestInput.d.ts +13 -5
- package/dist/toolContract/input/resources/tools/localAnalyzeGraph.d.ts +74 -32
- package/dist/toolContract/input/resources/tools/localFilesOperation.d.ts +2 -2
- package/dist/toolContract/input/resources/tools/localSearch.d.ts +44 -44
- package/dist/toolContract/input/resources/tools/localTextOperation.d.ts +1 -1
- package/dist/toolContract/input/resources/tools/localTreeOperation.d.ts +2 -2
- package/dist/toolContract/input/resources/tools/lspGetSemantics.d.ts +11 -2
- package/dist/toolContract/input/resources/tools/npmSearch.d.ts +2 -1
- package/dist/toolContract/metadata.d.ts +1 -1
- package/dist/toolContract/runtime.d.ts +1 -1
- package/dist/toolContract/types.d.ts +0 -1
- package/dist/tools/directToolCatalog/toolCatalogDefinitions.d.ts +2 -4
- package/dist/tools/directToolCatalog/toolInputPreparation.d.ts +2 -5
- package/dist/tools/directToolCatalog.exec.d.ts +10 -7
- package/dist/tools/github_clone_repo/cache.d.ts +0 -2
- package/dist/tools/github_clone_repo/cacheArtifacts.d.ts +3 -1
- package/dist/tools/github_clone_repo/cachePaths.d.ts +3 -2
- package/dist/tools/github_clone_repo/gitCheckout.d.ts +5 -0
- package/dist/tools/github_clone_repo/scheme.d.ts +3 -3
- package/dist/tools/github_clone_repo/types.d.ts +6 -1
- package/dist/tools/github_fetch_content/finalizer/types.d.ts +10 -2
- package/dist/tools/github_fetch_content/scheme.d.ts +3 -4
- package/dist/tools/github_fetch_content/types.d.ts +4 -3
- package/dist/tools/github_search/scheme.d.ts +24 -23
- package/dist/tools/github_search_code/execution.d.ts +1 -1
- package/dist/tools/github_search_code/finalizer/groups.d.ts +1 -1
- package/dist/tools/github_search_code/finalizer/ranking.d.ts +1 -1
- package/dist/tools/github_search_code/scheme.d.ts +3 -3
- package/dist/tools/github_search_pull_requests/contentResponse/commentsShaping.d.ts +4 -1
- package/dist/tools/github_search_pull_requests/contentResponse/contentView.d.ts +3 -0
- package/dist/tools/github_search_pull_requests/contentResponse/fileSurfaces.d.ts +30 -2
- package/dist/tools/github_search_pull_requests/contentResponse/nextCalls.d.ts +1 -7
- package/dist/tools/github_search_pull_requests/contentResponse/pagination.d.ts +14 -2
- package/dist/tools/github_search_pull_requests/historyContinuations.d.ts +1 -1
- package/dist/tools/github_search_pull_requests/historyDiffContinuations.d.ts +2 -0
- package/dist/tools/github_search_pull_requests/historySchemes.d.ts +23 -22
- package/dist/tools/github_search_pull_requests/scheme.d.ts +17 -9
- package/dist/tools/github_search_pull_requests/splitSchemes.d.ts +35 -26
- package/dist/tools/github_search_pull_requests/types.d.ts +5 -0
- package/dist/tools/github_search_repos/execution/pagination.d.ts +0 -17
- package/dist/tools/github_search_repos/execution/queryVariants.d.ts +1 -23
- package/dist/tools/github_search_repos/execution.d.ts +0 -1
- package/dist/tools/github_search_repos/scheme.d.ts +6 -6
- package/dist/tools/github_view_repo_structure/execution.d.ts +1 -1
- package/dist/tools/github_view_repo_structure/scheme.d.ts +6 -5
- package/dist/tools/local_analyze_graph/analysisTypes.d.ts +16 -3
- package/dist/tools/local_analyze_graph/analyzeGraph.d.ts +1 -1
- package/dist/tools/local_analyze_graph/completeness.d.ts +3 -0
- package/dist/tools/local_analyze_graph/deadCodeScan.d.ts +9 -5
- package/dist/tools/local_analyze_graph/rootInference.d.ts +2 -0
- package/dist/tools/local_analyze_graph/scheme.d.ts +13 -25
- package/dist/tools/local_fetch_content/fetchContent/pagination.d.ts +7 -0
- package/dist/tools/local_fetch_content/scheme.d.ts +3 -3
- package/dist/tools/local_find_files/findFiles.d.ts +1 -1
- package/dist/tools/local_find_files/scheme.d.ts +4 -4
- package/dist/tools/local_ripgrep/execution.d.ts +0 -1
- package/dist/tools/local_ripgrep/rankingProfile/rankingProfiles.d.ts +1 -2
- package/dist/tools/local_ripgrep/rankingProfile/rankingResults.d.ts +2 -2
- package/dist/tools/local_ripgrep/rankingProfile/rankingScoring.d.ts +1 -3
- package/dist/tools/local_ripgrep/ripgrepResultBuilder/buildResult.d.ts +0 -4
- package/dist/tools/local_ripgrep/ripgrepResultBuilder/searchNext.d.ts +1 -0
- package/dist/tools/local_ripgrep/scheme.d.ts +13 -5
- package/dist/tools/local_ripgrep/structuralCompleteness.d.ts +9 -0
- package/dist/tools/local_search/execution.d.ts +0 -1
- package/dist/tools/local_search/scheme.d.ts +47 -47
- package/dist/tools/local_view_structure/scheme.d.ts +5 -5
- package/dist/tools/lsp/semantic_content/scheme.d.ts +29 -7
- package/dist/tools/lsp/semantic_content/semanticAnchored.d.ts +2 -9
- package/dist/tools/lsp/semantic_content/semanticEnvelopes/callEnvelopes.d.ts +2 -2
- package/dist/tools/lsp/semantic_content/semanticEnvelopes/envelopeHelpers.d.ts +2 -1
- package/dist/tools/lsp/semantic_content/semanticEnvelopes/locationEnvelopes.d.ts +2 -3
- package/dist/tools/lsp/semantic_content/semanticFileOps/anchor.d.ts +0 -1
- package/dist/tools/lsp/semantic_content/semanticPresentation.d.ts +1 -0
- package/dist/tools/lsp/semantic_content/semanticSnapshot.d.ts +16 -0
- package/dist/tools/lsp/shared/callHierarchyTraversal.d.ts +2 -1
- package/dist/tools/lsp/shared/semanticTypes.d.ts +19 -10
- package/dist/tools/package_search/execution.d.ts +3 -4
- package/dist/tools/package_search/pagination.d.ts +1 -0
- package/dist/tools/package_search/scheme.d.ts +5 -4
- package/dist/tools/providerMappers/codeSearch.d.ts +2 -9
- package/dist/tools/providerMappers/fileContent.d.ts +1 -1
- package/dist/tools/providerMappers/pullRequests.d.ts +24 -4
- package/dist/tools/providerMappers/repoSearch.d.ts +4 -4
- package/dist/tools/providerMappers/repoStructure.d.ts +4 -3
- package/dist/tools/toolAvailability.d.ts +19 -0
- package/dist/tools/toolConfig.d.ts +1 -3
- package/dist/types/toolResults.d.ts +1 -0
- package/dist/utils/contextUtils.d.ts +1 -1
- package/dist/utils/core/types.d.ts +0 -2
- package/dist/utils/exec/npm.d.ts +2 -0
- package/dist/utils/file/byteOffset.d.ts +1 -1
- package/dist/utils/package/common.d.ts +0 -3
- package/dist/utils/package/npm/npmDeprecation.d.ts +1 -2
- package/dist/utils/package/npm/npmDetailsFetchers.d.ts +3 -15
- package/dist/utils/package/npm/npmMappers.d.ts +0 -4
- package/dist/utils/package/npm/npmRegistry.d.ts +9 -1
- package/dist/utils/package/npm/npmSearchStrategies.d.ts +2 -5
- package/dist/utils/package/types.d.ts +3 -0
- package/dist/utils/pagination/types.d.ts +1 -0
- package/dist/utils/response/callToolResult.d.ts +3 -1
- package/package.json +23 -19
- package/dist/errors/pathUtils.d.ts +0 -1
- package/dist/github/directoryFetch.d.ts +0 -3
- package/dist/github/fileContentRaw.d.ts +0 -2
- package/dist/github/issues.d.ts +0 -3
- package/dist/github/prContentFetcher.d.ts +0 -2
- package/dist/github/queryBuilders.d.ts +0 -4
- package/dist/github/repoStructure.d.ts +0 -1
- package/dist/shared/index.d.ts +0 -6
- package/dist/shared/languageSelectors.d.ts +0 -3
- package/dist/toolContract/schemas.d.ts +0 -31
- package/dist/tools/directToolCatalog.d.ts +0 -15
- package/dist/tools/directToolCatalog.meta.d.ts +0 -28
- package/dist/tools/github_search_code/finalizer.d.ts +0 -2
- package/dist/tools/github_search_repos/execution/ranking.d.ts +0 -4
- package/dist/tools/local_ripgrep/rankingProfile.d.ts +0 -35
- package/dist/tools/local_ripgrep/ripgrepResultBuilder.d.ts +0 -2
- package/dist/tools/lsp/semantic_content/index.d.ts +0 -3
- package/dist/tools/lsp/semantic_content/semanticEnvelopes.d.ts +0 -3
- package/dist/tools/lsp/semantic_content/semanticFileOps.d.ts +0 -8
- package/dist/tools/providerMappers.d.ts +0 -11
- package/dist/tools/toolMetadata/baseSchema.d.ts +0 -1
- package/dist/tools/toolMetadata/descriptions.d.ts +0 -1
- package/dist/tools/toolMetadata/proxies.d.ts +0 -4
- package/dist/tools/toolSchemaImports.d.ts +0 -16
- package/dist/utils/exec/spawn.d.ts +0 -2
- package/dist/utils/file/filters.d.ts +0 -2
- package/dist/utils/http/cache.d.ts +0 -5
- package/dist/utils/package/npm.d.ts +0 -2
- package/dist/utils/response/bulk.d.ts +0 -2
package/dist/schema.js
CHANGED
|
@@ -5,16 +5,8 @@ import { dirname as __dirname_fn } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __dirname_fn(__filename);
|
|
8
|
-
import{z as Et}from"zod";var G={GITHUB_SEARCH:"ghSearch",GITHUB_FETCH_CONTENT:"ghGetFileContent",GITHUB_SEARCH_HISTORY:"ghSearchHistory",GITHUB_GET_HISTORY_ITEM:"ghGetHistoryItem",PACKAGE_SEARCH:"npmSearch",GITHUB_CLONE_REPO:"ghCloneRepo",LOCAL_SEARCH:"localSearch",LOCAL_ANALYZE_GRAPH:"localAnalyzeGraph",LOCAL_FETCH_CONTENT:"localGetFileContent",LSP_GET_SEMANTIC_CONTENT:"lspGetSemantics"},We=Et.object({goal:Et.string().optional().describe("What this query should accomplish."),reasoning:Et.string().optional().describe("Why this query advances the goal.")}),Be=Object.fromEntries(Object.entries(We.shape).map(([e,t])=>[e,t.description??""]));var jr={ghSearch:["Use only fields listed for the selected operation.","match: code=file|path; repositories=name|description|readme.","code cannot select branch; it searches GitHub's indexed default branch."],localSearch:["text needs searchText.","structural needs exactly one of pattern or rule.","Fields from different operations cannot be mixed."],localAnalyzeGraph:["dependencies | dependents -> requires file; depth applies.","path -> requires file + target.","deadCode/reachability use entrypoints and includeTests as roots."],localGetFileContent:["Choose fullContent, a line range, or matchString.","A line range needs startLine and endLine.","matchString options apply with matchString."],lspGetSemantics:["workspaceSymbol needs symbolName and may use workspaceRoot.","documentSymbols/diagnostic need uri.","definition | references | hover | callers | callees | callHierarchy | implementation | typeDefinition | supertypes | subtypes -> requires uri + symbolName + lineHint."],ghGetFileContent:["Choose fullContent, a line range, or matchString.","A line range needs startLine and endLine.","matchString options apply with matchString.",'type:"directory" materializes; extraction fields read files.'],npmSearch:["Set exactly one of packageName or keywords."]};function Ye(e){return[...jr[e]??[]]}var Ur={ghSearch:[{name:"code",when:"Search code contents or file paths",requires:["operation"],excludes:["branch"],fields:["keywords","owner","repo","extension","filename","path","language","match","pageSize","page","concise"],example:{operation:"code",keywords:["toolSchemas"],owner:"bgauryy",repo:"octocode"}},{name:"repositories",when:"Discover repositories",requires:["operation"],fields:["keywords","topics","language","owner","stars","forks","goodFirstIssues","updated","created","size","match","sort","pageSize","page","archived","visibility","license","concise"],example:{operation:"repositories",keywords:["octocode"]}},{name:"tree",when:"Browse a known repository tree",requires:["operation","owner","repo"],fields:["owner","repo","branch","path","maxDepth","page","pageSize","include"],example:{operation:"tree",owner:"bgauryy",repo:"octocode",path:"packages",maxDepth:2}}],localSearch:[{name:"text",when:"Search lexical text or regular expressions",requires:["operation","path","searchText"],example:{operation:"text",path:".",searchText:"toolSchemas"}},{name:"structural",when:"Match AST structure",requires:["operation","path","pattern"],example:{operation:"structural",path:".",pattern:"console.log($A)",langType:"typescript"}},{name:"files",when:"Discover paths by name or metadata",requires:["operation","path"],example:{operation:"files",path:".",names:["*.ts"]}},{name:"tree",when:"Browse a directory tree",requires:["operation","path"],example:{operation:"tree",path:".",maxDepth:5}}],localAnalyzeGraph:[{name:"dependencies",when:"Find files imported by a file",requires:["path","operation","file"],example:{path:".",operation:"dependencies",file:"src/index.ts"}},{name:"dependents",when:"Find files importing a file",requires:["path","operation","file"],example:{path:".",operation:"dependents",file:"src/index.ts"}},{name:"path",when:"Find a shortest dependency path",requires:["path","operation","file","target"],example:{path:".",operation:"path",file:"src/a.ts",target:"src/b.ts"}},{name:"cycles",when:"Find dependency cycles",requires:["path","operation"],example:{path:".",operation:"cycles"}},{name:"deadCode",when:"Find unreachable file candidates",requires:["path","operation"],example:{path:".",operation:"deadCode"}},{name:"reachability",when:"Find files unreachable from selected roots",requires:["path","operation","entrypoints"],example:{path:".",operation:"reachability",entrypoints:["src/index.ts"]}}],lspGetSemantics:[{name:"anchored",when:"Query a named symbol near a source line",requires:["uri","type","symbolName","lineHint"],example:{uri:"src/index.ts",type:"definition",symbolName:"main",lineHint:1}},{name:"document",when:"Query a whole document",requires:["uri","type"],example:{uri:"src/index.ts",type:"documentSymbols"}},{name:"workspace",when:"Search symbols across the workspace",requires:["workspaceRoot","type","symbolName"],example:{workspaceRoot:".",type:"workspaceSymbol",symbolName:"Schema"}}]};function Ot(e){return Ur[e]??[]}import{z as Je}from"zod";var xe=100,ze=1e3,ko=1e8,Ho=5e4,P=1e9,It=1e5,je=20,Ke=100,Ue=1e4,ce=50,U=100,q=30,Pt=200,kt=100;var Ht=1e5,Ft=500,et=1e5,Dt=1e3,Nt=20,Mt=100,Gt=20;function b(e){return{...e,description:e.instructions}}function l(e,t){return Je.number().int().min(e).max(t)}var L=Je.array(Je.string()).optional();function _(){return l(1,ze).default(1)}function O(){return l(1,ze).optional()}function tt(){return l(0,xe).optional()}function Re(){return l(1,P).optional()}function k(){return l(0,ko).optional()}function B(){return l(1,Ho).optional()}var h=We.shape,qr=new Set(Object.keys(h)),Xr={owner:"Repository owner (user or org).",repo:"Repository name, without the owner.",branch:"Branch, tag, or commit SHA; omit for the default branch.",path:"Target path. GitHub tools: repo-relative, exact case, no leading slash. Local tools: absolute path.",page:"Result page, 1-based. Advance only while pagination.hasMore.",itemsPerPage:"Items per result page.",limit:"Total result cap applied before pagination.",pageSize:"Results returned in one page.",contextLines:"Extra source lines around each match/anchor.",charLength:"Content-window length; continue with the returned offset when partial.",charOffset:"Content-window start; copy the returned offset. A partial window cannot prove absence."};function u(e,t,o=""){let r={};for(let n of Object.keys(t)){let i=t[n],a=o?`${o}.${n}`:n,f=o===""&&qr.has(n)?Be[a]:e[a]??(i.description?void 0:Xr[n]);r[n]=f?i.describe(f):i}return Je.object(r).strict()}function ot(e,t){let o=e.fullContent===!0,r=e.matchString!==void 0,n=e.startLine!==void 0||e.endLine!==void 0;o&&r&&t.addIssue({code:"custom",message:"Choose fullContent or matchString.",path:["matchString"]}),o&&n&&t.addIssue({code:"custom",message:"Choose fullContent or startLine/endLine.",path:["startLine"]}),r&&n&&t.addIssue({code:"custom",message:"Choose matchString or startLine/endLine.",path:["startLine"]}),e.startLine===void 0!=(e.endLine===void 0)&&t.addIssue({code:"custom",message:"Set startLine and endLine together.",path:[e.startLine===void 0?"startLine":"endLine"]}),e.startLine!==void 0&&e.endLine!==void 0&&e.endLine<e.startLine&&t.addIssue({code:"custom",message:"Set endLine greater than or equal to startLine.",path:["endLine"]})}import{z as rt}from"zod";import{z as te}from"zod";var Zr={keywords:"ANDed; keep a phrase as one item; alternatives need separate queries.",path:"Repo path prefix, not a full file path.",match:'For ghSearch operation:"code": "file" returns snippets and character matchIndices; "path" returns paths only. Operation:"repositories" uses text-field names.',extension:'File extension filter, e.g. "ts" (no dot).',filename:"Exact filename filter.",language:'GitHub language filter, e.g. "typescript".',concise:'Flat "owner/repo:path" rows.',limit:"Results per page (paginate with page)."},oe=u(Zr,{...h,keywords:L,owner:te.string().optional(),repo:te.string().optional(),extension:te.string().optional(),filename:te.string().optional(),path:te.string().optional(),language:te.string().optional(),match:te.enum(["file","path"]).default("file"),limit:l(1,U).default(q),page:_(),concise:te.boolean().optional()});import{z as H}from"zod";var Vr={keywords:"ANDed; keep a phrase as one item; alternatives need separate queries.",topicsToSearch:"ANDed topic filters; metadata can be sparse.",match:'For ghSearch operation:"repositories": text fields to search are name, description, and readme; readme is broader and slower. Operation:"code" uses "file" or "path".',sort:"stars, forks, updated, help-wanted-issues, best-match.",language:'Primary language filter, e.g. "rust".',stars:'Star range: ">100", "10..50".',forks:'Fork range: ">50", "10..100".',goodFirstIssues:'Good-first-issue count range, e.g. ">5".',updated:'Last push date: ">2024-01-01" or "a..b".',created:'Creation date: ">2023-01-01" or "a..b".',size:'Repo size in KB: ">1000", "50..500".',license:'SPDX id, e.g. "mit".',archived:"true = archived only; default excludes archived.",visibility:'"public" or "private" (private needs token scope).',concise:'Flat "owner/repo" rows for triage.',limit:"Results per page (paginate with page)."},ee=u(Vr,{...h,keywords:L,topicsToSearch:L,language:H.string().optional(),owner:H.string().optional(),stars:H.string().optional(),forks:H.string().optional(),goodFirstIssues:H.string().optional(),updated:H.string().optional(),created:H.string().optional(),size:H.string().optional(),match:H.array(H.enum(["name","description","readme"])).optional(),sort:H.enum(["stars","forks","help-wanted-issues","updated","best-match"]).default("best-match"),limit:l(1,U).default(q),page:_(),archived:H.boolean().optional(),visibility:H.enum(["public","private"]).optional(),license:H.string().optional(),concise:H.boolean().optional()});import{z as Le}from"zod";var $r={path:'Repo-relative directory; ""/"." for root.',branch:"Ref; fallback warning means default branch was used.",maxDepth:"Tree recursion depth.",page:"Advance only on hasMore.",include:"Optional sizes, languages, contributors, branches, or tags; each adds an API call."},le=u($r,{...h,owner:Le.string(),repo:Le.string(),branch:Le.string().optional(),path:Le.string().optional(),maxDepth:l(0,Gt).optional(),page:_(),itemsPerPage:l(1,Pt).default(kt),include:Le.array(Le.enum(["sizes","languages","contributors","branches","tags"])).optional()});var Pa=b({name:"ghSearch",type:"Github",shortDescription:"Search GitHub code or repositories, or browse a repository tree.",instructions:`Choose operation:"code" for code contents or file paths, "repositories" to discover repositories, or "tree" to browse a known repository.
|
|
9
|
-
Each operation has a strict input branch; fields from other operations are rejected. Use ghGetFileContent only after a path is known. Empty GitHub search results do not prove absence.`,schema:{operation:'Required: "code", "repositories", or "tree".'}}),Wr=oe.omit({limit:!0}).extend({match:oe.shape.match.describe('For operation:"code": "file" returns snippets; "path" returns paths only.'),pageSize:oe.shape.limit.describe("Results returned per page."),operation:rt.literal("code").describe("Search code contents or file paths.")}).strict(),Yr=ee.omit({topicsToSearch:!0,limit:!0}).extend({topics:ee.shape.topicsToSearch.describe("Repository topics; all must match."),pageSize:ee.shape.limit.describe("Results returned per page."),match:ee.shape.match.describe('For operation:"repositories": fields to search: name, description, or readme.'),operation:rt.literal("repositories").describe("Discover repositories by keywords and repository filters.")}).strict(),Jr=le.omit({itemsPerPage:!0}).extend({operation:rt.literal("tree").describe("Browse the tree of a known repository."),pageSize:le.shape.itemsPerPage.describe("Tree entries returned per page.")}).strict(),vt=rt.discriminatedUnion("operation",[Wr,Yr,Jr]);import{z as X}from"zod";var Kr=b({name:"ghGetFileContent",type:"Github",shortDescription:"Read a file or a specific region from a GitHub repository.",instructions:`Read a known GitHub path after search or structure discovery; a complete search snippet needs no reread. For large files, get a symbols outline, then an exact range or match. Read small config files whole with minify:"none".
|
|
10
|
-
Choose fullContent, matchString, or startLine+endLine. Partial content cannot prove absence; continue with the returned charOffset. matchedLines are LSP anchors; match ranges and offsets are not. type:"directory" returns localPath when local access is enabled; otherwise use ghSearch operation:"tree".`,schema:{startLine:"Requires endLine; exclusive with fullContent/matchString.",endLine:"Requires startLine; must be >= startLine.",fullContent:"Whole small file; exclusive with range/match.",matchString:"Anchor returning padded matchRanges and exact matchedLines.",matchStringIsRegex:"Makes matchString a regex.",matchStringCaseSensitive:"Case-sensitive matchString.",type:'"file" reads; "directory" materializes localPath when clone/local access is enabled\u2014otherwise use ghSearch operation:"tree".',forceRefresh:"Bypass the 24h fetch cache and re-read from GitHub.",charOffset:"Copy pagination.nextCharOffset.",minify:'"symbols" outline, "standard" compact, "none" exact.'}}),nt=u(Kr.schema,{...h,owner:X.string(),repo:X.string(),branch:X.string().optional(),path:X.string(),startLine:Re(),endLine:Re(),fullContent:X.boolean().optional(),matchString:X.string().optional(),matchStringIsRegex:X.boolean().optional(),matchStringCaseSensitive:X.boolean().optional(),forceRefresh:X.boolean().optional(),type:X.enum(["file","directory"]).default("file"),contextLines:l(0,xe).default(5),charOffset:k(),charLength:B(),minify:X.enum(["none","standard","symbols"]).default("standard")}).superRefine(ot);import{z as s}from"zod";var en=b({name:"githubHistory",type:"Github",shortDescription:"Search and read GitHub pull requests and commit history.",instructions:`Use for PR/commit archaeology \u2014 not current code (ghSearch operation:"code"/ghGetFileContent). type:"prs" lists/reads PRs; type:"commits" walks history.
|
|
11
|
-
Param relations: list mode uses filters+sort/page; detail mode needs owner+repo+prNumber and content selectors. patches.mode:"selected" requires files or ranges. Body/patch/comment windows continue via returned charOffset/commentBodyOffset; file/comment/commit lists use their page fields. For code identity, clone and use local/LSP.`,schema:{type:'"prs" for pull requests; "commits" for commit history.',keywords:"PR search terms; ignored in commits mode.",match:'PR text fields searched by keywords; ghSearch operation:"code" instead uses match to select file content or paths.',prNumber:"Switches to PR detail mode; needs owner+repo.",issueNumber:"Switches to issue detail mode; needs owner+repo.",concise:"PR list triage; ignored with prNumber.",path:"Commit-mode file/dir prefix; trailing / scopes subtree.",includeDiff:"Commit-mode diffs; costly.",order:"asc+created helps archaeology.",comments:'Comment-count range filter (">5"); not comment content.',reactions:'Reaction-count range filter (">10").',interactions:'Combined comment+reaction count range (">20").',project:'Project board: "owner/number".',"team-mentions":'Team mention: "org/team-slug".',filePage:"Changed-files page from contentPagination.",commentPage:"Comments page from contentPagination.",commitPage:"PR commits page from contentPagination.",reviewMode:'"full" fetches all PR detail surfaces.',content:"Detail selector for prNumber.","content.body":"Full PR description; windowed by charOffset.","content.changedFiles":"File list with status and +/- counts.","content.patches.mode":'"none", "selected" (cheapest; needs files or ranges), or "all".',"content.patches.ranges":"Line ranges for selected patch hunks.","content.comments.reviewInline":"Inline review comments; in_reply_to_id marks threads.","content.comments.includeBots":"Include bot/CI comments.","content.reviews":"Review verdicts per reviewer.","content.commits":"PR-bound commits selector.",matchString:"Substring filter for body/patch/comment windows.",charOffset:"Body/patch continuation offset from nextQuery.",commentBodyOffset:"Comment-body continuation offset from nextQuery.",minify:'"standard" compact patches; "none" exact diff; "symbols" not available.'}}),_e=en.schema,it=u(_e,{...h,type:s.enum(["prs","commits"]).default("prs"),since:s.string().optional(),until:s.string().optional(),path:s.string().optional(),branch:s.string().optional(),includeDiff:s.boolean().optional().default(!1),includeAssets:s.boolean().optional(),keywords:s.array(s.string()).optional(),prNumber:l(1,P).optional(),issueNumber:l(1,P).optional(),owner:s.string().optional(),repo:s.string().optional(),concise:s.boolean().optional(),state:s.enum(["open","closed","merged"]).optional(),assignee:s.string().optional(),author:s.string().optional(),committer:s.string().optional(),commenter:s.string().optional(),mentions:s.string().optional(),"review-requested":s.string().optional(),"reviewed-by":s.string().optional(),label:s.union([s.string(),s.array(s.string())]).optional(),checks:s.enum(["success","failure","pending"]).optional(),review:s.enum(["approved","changes_requested","required","none"]).optional(),head:s.string().optional(),base:s.string().optional(),created:s.string().optional(),updated:s.string().optional(),closed:s.string().optional(),"merged-at":s.string().optional(),comments:s.string().optional(),reactions:s.string().optional(),draft:s.boolean().optional(),match:s.array(s.enum(["title","body","comments"])).optional(),sort:s.enum(["created","updated","best-match","comments","reactions"]).optional(),order:s.enum(["asc","desc"]).optional(),limit:l(1,U).default(q),page:_(),archived:s.boolean().optional(),filePage:O(),commentPage:O(),commitPage:O(),reviewMode:s.literal("full").optional(),content:u(_e,{metadata:s.boolean().optional(),body:s.boolean().optional(),changedFiles:s.boolean().optional(),patches:u(_e,{mode:s.enum(["none","selected","all"]).default("none"),files:L,ranges:s.array(u(_e,{file:s.string(),additions:s.array(l(1,P)).optional(),deletions:s.array(l(1,P)).optional()},"content.patches.ranges")).optional()},"content.patches").optional(),comments:u(_e,{discussion:s.boolean().optional(),reviewInline:s.boolean().optional(),includeBots:s.boolean().default(!1),file:s.string().optional()},"content.comments").optional(),reviews:s.boolean().optional(),commits:u(_e,{list:s.boolean().optional(),includeFiles:s.boolean().optional()},"content.commits").optional()},"content").optional(),matchString:s.string().optional(),commentBodyOffset:k(),charOffset:k(),charLength:B(),minify:s.enum(["none","standard"]).default("standard")}).superRefine((e,t)=>{let o=e.content?.patches;if(!o)return;let r=(o.files?.length??0)>0,n=(o.ranges?.length??0)>0,i=r||n;o.mode==="selected"&&!i&&t.addIssue({code:"custom",message:'content.patches.mode="selected" requires non-empty files or ranges.',path:["content","patches","files"]}),o.mode!=="selected"&&i&&t.addIssue({code:"custom",message:'content.patches.files and content.patches.ranges require mode="selected".',path:["content","patches","mode"]})});import{z as p}from"zod";var tn=b({name:"ghSearchHistory",type:"Github",shortDescription:"Search GitHub pull requests, or read one PR's files, diffs, and reviews.",instructions:`Use for PR history, diffs, and review context; use code tools for current bytes, commits for history, and issues for issue threads. Conversation is context: prove landed behavior from selected patches or the merge SHA.
|
|
12
|
-
List mode uses search filters; detail mode needs owner, repo, prNumber, and explicit content selectors. Selected patches need files or ranges. Continue windows and lists with returned offsets/pages. Use local/LSP for symbol identity.`,schema:{keywords:"PR search terms.",match:'PR text fields searched by keywords: title, body, comments. ghSearch operation:"code" instead uses match to select file content or paths.',prNumber:"PR detail mode; requires owner+repo.",concise:"PR list triage; list mode only.",state:"open, closed, or merged.",assignee:"Assigned GitHub login.",author:"PR author login.",commenter:"Commenter login.",mentions:"Mentioned login.","review-requested":"Requested reviewer login.","reviewed-by":"Reviewer login.",checks:"success, failure, or pending.",review:"approved, changes_requested, required, or none.",comments:'Comment-count range filter (">5"); not comment content.',reactions:'Reaction-count range filter (">10").',created:'Created date/range, e.g. ">2024-01-01" or "a..b".',updated:"Updated-date filter (same format as created).",closed:"Closed-date filter (same format as created).","merged-at":"Merged-date filter (same format as created).",head:"Head branch name filter.",base:"Base branch name filter.",label:"Label name(s); multiple are ANDed.",draft:"true = only drafts; false = exclude drafts.",archived:"Include PRs from archived repos.",sort:"created, updated, comments, reactions, best-match.",order:"asc/desc; asc+created helps archaeology.",filePage:"Changed-files page from contentPagination.",commentPage:"Comments page from contentPagination.",commitPage:"PR commits page from contentPagination.",content:"Detail selector for prNumber.","content.body":"Include the PR description body.","content.changedFiles":"Include changed files and +/- counts.","content.patches":"Patch selector for changed files.","content.patches.mode":'"selected" or "all"; selected is cheapest.',"content.patches.files":'Restrict selected patches to these files (mode:"selected").',"content.patches.ranges":"Line ranges for selected patch hunks.","content.patches.ranges.file":"File the line range applies to.","content.patches.ranges.additions":"Added-side line numbers to include.","content.patches.ranges.deletions":"Deleted-side line numbers to include.","content.comments":"Conversation and inline-review selectors.","content.comments.discussion":"Include the PR conversation timeline.","content.comments.reviewInline":"Include inline review threads.","content.comments.includeBots":"Include bot/CI comments.","content.comments.file":"Filter comments to one file path.","content.reviews":"Include review verdicts per reviewer.","content.commits":"PR-bound commits selector.","content.commits.includeFiles":"Attach per-commit file changes.",matchString:"Substring filter for body/patch/comment windows.",charOffset:"Body/patch continuation offset from nextQuery.",commentBodyOffset:"Comment-body continuation offset from nextQuery.",minify:'"standard" compact patches; "none" exact diff; "symbols" not available.',pageSize:"PRs or detail-list items returned per page."}}),Ce=tn.schema,pe=u(Ce,{...h,keywords:p.array(p.string()).optional(),prNumber:l(1,P).optional(),owner:p.string().optional(),repo:p.string().optional(),concise:p.boolean().optional(),state:p.enum(["open","closed","merged"]).optional(),assignee:p.string().optional(),author:p.string().optional(),commenter:p.string().optional(),mentions:p.string().optional(),"review-requested":p.string().optional(),"reviewed-by":p.string().optional(),label:p.array(p.string()).optional(),checks:p.enum(["success","failure","pending"]).optional(),review:p.enum(["approved","changes_requested","required","none"]).optional(),head:p.string().optional(),base:p.string().optional(),created:p.string().optional(),updated:p.string().optional(),closed:p.string().optional(),"merged-at":p.string().optional(),comments:p.string().optional(),reactions:p.string().optional(),draft:p.boolean().optional(),match:p.array(p.enum(["title","body","comments"])).optional(),sort:p.enum(["created","updated","best-match","comments","reactions"]).optional(),order:p.enum(["asc","desc"]).optional(),pageSize:l(1,U).default(q),page:O(),archived:p.boolean().optional(),filePage:O(),commentPage:O(),commitPage:O(),content:u(Ce,{body:p.literal(!0).optional(),changedFiles:p.literal(!0).optional(),patches:u(Ce,{mode:p.enum(["selected","all"]),files:L,ranges:p.array(u(Ce,{file:p.string(),additions:p.array(l(1,P)).optional(),deletions:p.array(l(1,P)).optional()},"content.patches.ranges")).optional()},"content.patches").optional(),comments:u(Ce,{discussion:p.literal(!0).optional(),reviewInline:p.literal(!0).optional(),includeBots:p.literal(!0).optional(),file:p.string().optional()},"content.comments").optional(),reviews:p.literal(!0).optional(),commits:u(Ce,{includeFiles:p.literal(!0).optional()},"content.commits").optional()},"content").optional(),matchString:p.string().optional(),commentBodyOffset:k(),charOffset:k(),charLength:B(),minify:p.enum(["none","standard"]).default("standard")}).superRefine((e,t)=>{let o=["content","filePage","commentPage","commitPage","matchString","commentBodyOffset","charOffset","charLength"],r=["keywords","concise","state","assignee","author","commenter","mentions","review-requested","reviewed-by","label","checks","review","head","base","created","updated","closed","merged-at","comments","reactions","draft","match","sort","order","page","archived"];if(e.prNumber===void 0)for(let f of o)e[f]!==void 0&&t.addIssue({code:"custom",message:`${f} requires prNumber detail mode.`,path:[f]});else{e.owner?.trim()||t.addIssue({code:"custom",message:"owner is required with prNumber.",path:["owner"]}),e.repo?.trim()||t.addIssue({code:"custom",message:"repo is required with prNumber.",path:["repo"]});for(let f of r)e[f]!==void 0&&t.addIssue({code:"custom",message:`${f} is only available in list mode.`,path:[f]})}e.content&&Object.keys(e.content).length===0&&t.addIssue({code:"custom",message:"content needs at least one selector.",path:["content"]});let n=e.content?.patches;if(!n)return;let i=(n.files?.length??0)>0,a=(n.ranges?.length??0)>0,m=i||a;n.mode==="selected"&&!m&&t.addIssue({code:"custom",message:'content.patches.mode="selected" requires non-empty files or ranges.',path:["content","patches","files"]}),n.mode!=="selected"&&m&&t.addIssue({code:"custom",message:'content.patches.files and content.patches.ranges require mode="selected".',path:["content","patches","mode"]})});import{z as y}from"zod";var on=b({name:"ghSearchHistory",type:"Github",shortDescription:"Search GitHub issues, or read one issue's body and comments.",instructions:`Use for bug reports and feature threads; use PR or code tools for those surfaces. List mode uses search filters. Detail mode needs owner, repo, issueNumber, and content selectors; continue bodies/comments with returned offsets and pages.
|
|
13
|
-
GitHub issue search also finds PRs, which are filtered out. totalCount is present only for a complete page; an empty page with hasMore still has a nextPage.`,schema:{keywords:"Issue search terms.",match:"Keyword fields: title, body, comments.",issueNumber:"Issue detail mode; requires owner+repo.",concise:"Issue list triage; list mode only.",state:"open or closed.",assignee:"Assigned GitHub login.",author:"Issue author login.",commenter:"Commenter login.",mentions:"Mentioned login.",archived:"Include issues from archived repos.",comments:'Comment-count range filter (">5"); not comment content.',reactions:'Reaction-count range filter (">10").',created:'Created date/range, e.g. ">2024-01-01" or "a..b".',updated:"Updated-date filter (same format as created).",closed:"Closed-date filter (same format as created).",label:"Label name(s); multiple are ANDed.",sort:"created, updated, comments, reactions, best-match.",order:"asc/desc; asc+created helps archaeology.",commentPage:"Comments page from contentPagination.",content:"Detail selector for issueNumber.","content.body":"Include the issue description body.","content.comments":"Comment-thread selector.","content.comments.discussion":"Include the comment thread.","content.comments.includeBots":"Include bot/CI comments.",matchString:"Substring filter for body/comment windows.",charOffset:"Body continuation offset from nextQuery.",commentBodyOffset:"Comment-body continuation offset from nextQuery.",minify:'"standard" (default) compacts body/comment text; "none" keeps it exact.',pageSize:"Issues or detail comments returned per page."}}),Qt=on.schema,ue=u(Qt,{...h,owner:y.string(),repo:y.string(),keywords:y.array(y.string()).optional(),issueNumber:l(1,P).optional(),concise:y.boolean().optional(),state:y.enum(["open","closed"]).optional(),assignee:y.string().optional(),author:y.string().optional(),commenter:y.string().optional(),mentions:y.string().optional(),label:y.array(y.string()).optional(),created:y.string().optional(),updated:y.string().optional(),closed:y.string().optional(),comments:y.string().optional(),reactions:y.string().optional(),match:y.array(y.enum(["title","body","comments"])).optional(),sort:y.enum(["created","updated","best-match","comments","reactions"]).optional(),order:y.enum(["asc","desc"]).optional(),pageSize:l(1,U).default(q),page:O(),archived:y.boolean().optional(),commentPage:O(),content:u(Qt,{body:y.literal(!0).optional(),comments:u(Qt,{discussion:y.literal(!0).optional(),includeBots:y.literal(!0).optional()},"content.comments").optional()},"content").optional(),matchString:y.string().optional(),commentBodyOffset:k(),charOffset:k(),charLength:B(),minify:y.enum(["none","standard"]).default("standard")}).superRefine((e,t)=>{let o=["content","commentPage","matchString","commentBodyOffset","charOffset","charLength"],r=["keywords","concise","state","assignee","author","commenter","mentions","label","created","updated","closed","comments","reactions","match","sort","order","page","archived"];if(e.issueNumber===void 0)for(let n of o)e[n]!==void 0&&t.addIssue({code:"custom",message:`${n} requires issueNumber detail mode.`,path:[n]});else{e.owner?.trim()||t.addIssue({code:"custom",message:"owner is required with issueNumber.",path:["owner"]}),e.repo?.trim()||t.addIssue({code:"custom",message:"repo is required with issueNumber.",path:["repo"]});for(let n of r)e[n]!==void 0&&t.addIssue({code:"custom",message:`${n} is only available in list mode.`,path:[n]})}e.content&&Object.keys(e.content).length===0&&t.addIssue({code:"custom",message:"content needs at least one selector.",path:["content"]})});import{z as Z}from"zod";var rn=b({name:"ghSearchHistory",type:"Github",shortDescription:"Walk a GitHub repository's commit history for a path or range.",instructions:`Trace when or why code changed; use code tools for current bytes and PR search for review context. History mode filters by path/date/ref/author; compare mode needs base+head. This tool does not search commit messages.
|
|
14
|
-
For one commit's changes, compare base:"SHA^" to head:"SHA" with includeDiff. Scope diffs to one commit or a tight window. Use a clone and LSP for symbol identity.`,schema:{pageSize:"Commits returned per page (walk with page).",owner:"Repository owner.",repo:"Repository name.",path:"File/dir prefix; trailing / scopes the subtree.",since:'Lower date bound: ISO date or relative window such as "30d".',until:"Upper date bound; same formats as since.",branch:"Ref to walk; defaults to the default branch.",includeDiff:"Attach diffs; prefer one commit or a tight window.",author:"Author login or email.",committer:"Committer login or email.",base:"Compare-mode base ref; set with head.",head:"Compare-mode head ref; set with base.",filePage:"Changed-file page from pagination.nextFilePage.",charOffset:"Patch offset from patchPagination.nextCharOffset.",charLength:"Patch-window length."}}),at=u(rn.schema,{...h,owner:Z.string(),repo:Z.string(),path:Z.string().optional(),since:Z.string().optional(),until:Z.string().optional(),branch:Z.string().optional(),author:Z.string().optional(),committer:Z.string().optional(),base:Z.string().optional(),head:Z.string().optional(),pageSize:l(1,100).optional().default(30),includeDiff:Z.boolean().optional().default(!1),page:_(),filePage:O(),charOffset:k(),charLength:B()}).superRefine((e,t)=>{(e.base&&!e.head||e.head&&!e.base)&&t.addIssue({code:"custom",path:[e.base?"head":"base"],message:"Set base and head together for compare mode."})});import{z as Bt}from"zod";var nn=b({name:"npmSearch",type:"NPM",shortDescription:"Look up npm packages and find their source repositories.",instructions:"Resolve npm packages to source repositories. Set exactly one of packageName for exact lookup or keywords for discovery. Follow the repository into GitHub tools.",schema:{keywords:"Discovery terms joined with spaces. Mutually exclusive with packageName.",packageName:"Exact package name; include scope for scoped packages.",page:"Keyword-result page only."}}),st=u(nn.schema,{...h,packageName:Bt.string().optional(),keywords:Bt.array(Bt.string()).optional(),page:_()}).superRefine((e,t)=>{let o=e.keywords?.join(" ").trim();!e.packageName?.trim()&&!o&&t.addIssue({code:"custom",path:["packageName"],message:"Set packageName or keywords."}),e.packageName?.trim()&&o&&t.addIssue({code:"custom",path:["keywords"],message:"Set packageName or keywords, not both."})});import{z as qe}from"zod";var an=b({name:"ghCloneRepo",type:"Github",shortDescription:"Clone a GitHub repo or subtree locally for repeated reads, search, or LSP.",instructions:"Best for repeated reads, local AST/regex, or LSP; use ghGetFileContent for one read. Discover a bounded sparsePath first. branch selects the ref and forceRefresh bypasses the cached clone. Pass results[].data.location.localPath to local tools.",schema:{sparsePath:"Bound checkout to a repo-relative file/dir.",forceRefresh:"Bypass cached clone."}}),zt=u(an.schema,{...h,owner:qe.string(),repo:qe.string(),branch:qe.string().optional(),sparsePath:qe.string().optional(),forceRefresh:qe.boolean().optional()});import{z}from"zod";import{z as C}from"zod";var jt={searchText:'Single lexical pattern. regex:"fixed" is literal and "perl" enables advanced syntax.',mode:'Search mode: "discovery" paths; "paginated" snippets; "detailed" context; "structural" AST.',pattern:"Structural code pattern: $X matches one node; $$$ARGS matches a list. Include modifiers or use a kind rule.",rule:"Structural YAML ast-grep rule for relational matches.",regex:'"smart" (default), "fixed" (literal), or "perl" (advanced).',caseMode:'"smart" (default), "sensitive", or "insensitive".',wholeWord:"Match whole words only (text/regex modes).",invertMatch:"Return non-matching lines (text/regex modes).",multiline:'"off" (default), "on", or "dotall" (. spans newlines).',include:"Glob(s) of files to include.",exclude:"Glob(s) of files to exclude.",excludeDir:"Directory names to prune from the walk.",noIgnore:"Also search .gitignored files.",hidden:"Include dot-files.",matchContentLength:"Matched-line characters kept per hit; longer lines are truncated.",maxFiles:"Text: page ceiling. Structural: scan cap; stats report truncation.",maxDepth:"Maximum levels below the search root; 0 means root files.",output:'"content" lines; "files"/"filesWithout" paths; count modes totals; "matchOnly" substrings.',unique:'With output:"matchOnly", deduplicate values or count frequency.',sort:'"relevance" (default), "matchCount", "path", "modified", "accessed", or "created".',sortReverse:"Reverse the sort order.",rankingProfile:'Language tuning for sort:"relevance"; "auto" detects.',langType:'Language/file type, e.g. "ts"; structural mode maps it to include globs.',captureText:"Structural: include verbatim $$$ list captures; ranges remain available when omitted.",maxMatchesPerFile:"Pairs with matchPage.",matchWindow:'Requires output:"matchOnly".',matchPage:"Per-file match page."},v=u(jt,{...h,searchText:C.string().optional(),path:C.string(),mode:C.enum(["paginated","discovery","detailed","structural"]).default("paginated"),pattern:C.string().optional(),rule:C.string().optional(),regex:C.enum(["smart","fixed","perl"]).default("smart"),caseMode:C.enum(["smart","sensitive","insensitive"]).default("smart"),wholeWord:C.boolean().optional(),invertMatch:C.boolean().optional(),include:L,exclude:L,excludeDir:L,noIgnore:C.boolean().optional(),hidden:C.boolean().optional(),contextLines:tt(),matchContentLength:l(1,Ht).default(Ft),maxMatchesPerFile:l(1,et).optional(),maxFiles:l(1,et).optional(),maxDepth:l(0,je).optional(),multiline:C.enum(["off","on","dotall"]).default("off"),sort:C.enum(["relevance","matchCount","path","modified","accessed","created"]).default("relevance"),sortReverse:C.boolean().optional(),rankingProfile:C.enum(["auto","typescript","javascript","rust","python","go","java","scala","markdown","json","yaml","generic"]).default("auto"),langType:C.string().optional(),captureText:C.boolean().optional(),output:C.enum(["content","files","filesWithout","countLines","countMatches","matchOnly"]).default("content"),unique:C.enum(["off","list","count"]).default("off"),matchWindow:l(0,200).optional(),matchPage:O(),itemsPerPage:l(1,Dt).optional(),page:_()}).superRefine((e,t)=>{if(e.mode==="structural"){!e.pattern&&!e.rule&&t.addIssue({code:"custom",message:"Set pattern or rule for structural mode.",path:["pattern"]}),e.pattern&&e.rule&&t.addIssue({code:"custom",message:"Choose pattern or rule, not both.",path:["rule"]}),e.wholeWord&&t.addIssue({code:"custom",message:"Remove wholeWord in structural mode.",path:["wholeWord"]}),e.invertMatch&&t.addIssue({code:"custom",message:"Remove invertMatch in structural mode.",path:["invertMatch"]});for(let r of["regex","caseMode","multiline"]){let n=r==="multiline"?"off":"smart";e[r]!==n&&t.addIssue({code:"custom",message:`Remove ${r} in structural mode.`,path:[r]})}e.output!=="content"&&t.addIssue({code:"custom",message:"Remove output in structural mode.",path:["output"]}),e.unique!=="off"&&t.addIssue({code:"custom",message:"Remove unique in structural mode.",path:["unique"]})}else(e.pattern||e.rule)&&t.addIssue({code:"custom",message:"Use structural mode with pattern or rule.",path:[e.pattern?"pattern":"rule"]}),e.searchText||t.addIssue({code:"custom",message:"Set searchText for text modes.",path:["searchText"]});e.matchWindow!==void 0&&e.output!=="matchOnly"&&t.addIssue({code:"custom",message:'Use output:"matchOnly" with matchWindow.',path:["matchWindow"]}),e.unique!=="off"&&e.output!=="matchOnly"&&t.addIssue({code:"custom",message:'Use output:"matchOnly" with unique.',path:["unique"]})});import{z as N}from"zod";var qt={maxDepth:"Maximum levels below path; 0 is direct entries.",minDepth:"Requires <= maxDepth when both set.",names:"Basename globs; ORed.",pathPattern:"Full-path glob.",regex:"Basename Rust regex.",empty:"Match only empty files/dirs.",time:"Time filters using d/h/w/m durations.","time.modifiedWithin":"Modified within this duration, e.g. 2d or 6h.","time.modifiedBefore":"Modified before this duration ago, e.g. 30d.","time.accessedWithin":"Accessed within this duration, e.g. 1w.",size:"Size range, e.g. 100k or 1m.","size.greater":"Minimum file size, e.g. 100k or 1m.","size.less":"Maximum file size, e.g. 500b or 2m.",extensions:'Extensions without dots, e.g. ["ts","tsx"].',excludeDir:"Directory names; generated/vendor dirs are pruned by default. Pass [] to prune nothing.",entryType:'"f" files, "d" dirs.',permissions:"Exact permission filter.",access:'"executable", "readable", or "writable" filter.',detail:'"basic" (default), "modified" (+mtime), or "full" (all metadata).',sortBy:'"modified" (default), "name", "path", or "size".',limit:"Post-sort result cap; pagination stays within it."},Ut=qt,W=u(Ut,{...h,path:N.string(),maxDepth:l(0,Ke).optional(),minDepth:l(0,Ke).optional(),names:L,pathPattern:N.string().optional(),regex:N.string().optional(),empty:N.boolean().optional(),time:u(Ut,{modifiedWithin:N.string().optional(),modifiedBefore:N.string().optional(),accessedWithin:N.string().optional()},"time").optional(),size:u(Ut,{greater:N.string().optional(),less:N.string().optional()},"size").optional(),permissions:N.string().optional(),access:N.enum(["executable","readable","writable"]).optional(),extensions:L,excludeDir:L,limit:l(1,Ue).optional(),detail:N.enum(["basic","modified","full"]).default("basic"),sortBy:N.enum(["modified","name","path","size"]).default("modified"),entryType:N.enum(["f","d"]).optional(),page:_(),itemsPerPage:l(1,ce).optional()}).superRefine((e,t)=>{e.minDepth!==void 0&&e.maxDepth!==void 0&&e.minDepth>e.maxDepth&&t.addIssue({code:"custom",message:"minDepth must be less than or equal to maxDepth.",path:["minDepth"]})});import{z as re}from"zod";var Xt={pattern:"Name glob or substring; use the files operation for regex.",entryType:'"f" files only, "d" dirs only; omit for both.',detail:'"basic" (default), "modified" (+mtime), or "full" (size/perms).',hidden:"Include dot-files/dirs.",recursive:"true enables the default recursive depth; omit with maxDepth for immediate children.",maxDepth:"Recursion depth. Omitted: immediate children, or 5 if recursive:true; maxDepth alone enables recursion, so recursive:true is not required. 0 uses those defaults.",extensions:"Allowlist without dots.",excludeDir:"Directories to prune; [] includes generated/vendor directories.",sortBy:'"name" (default), "size", "time", or "extension".',reverse:"Reverse the sort order.",limit:"Discovery cap before pagination."},Y=u(Xt,{...h,path:re.string(),detail:re.enum(["basic","modified","full"]).default("basic"),hidden:re.boolean().optional(),sortBy:re.enum(["name","size","time","extension"]).default("name"),reverse:re.boolean().optional(),pattern:re.string().optional(),entryType:re.enum(["f","d"]).optional(),recursive:re.boolean().optional(),extensions:L,excludeDir:L,maxDepth:l(0,je).optional(),limit:l(1,Ue).optional(),page:_(),itemsPerPage:l(1,ce).optional()});var Xe={...jt};delete Xe.mode;delete Xe.output;delete Xe.itemsPerPage;delete Xe.sortReverse;var Do={...Xt};delete Do.recursive;var hs=b({name:"localSearch",type:"Local",shortDescription:"Search local text, syntax, paths, or directory trees through one operation.",instructions:'Choose operation:"text" for lexical anchors, "structural" for AST matches, "files" for path or metadata discovery, and "tree" for directory orientation. Each operation has a strict branch, so do not mix fields across operations. Files/tree prune common generated and vendor directories by default; pass excludeDir:[] to prune nothing. Read exact hits with localGetFileContent and prove symbol identity with lspGetSemantics.',schema:{...qt,...Do,...Xe,operation:'Required branch: "text", "structural", "files", or "tree".',resultView:'Text/structural result shape. Text also supports "paginated", "discovery", and "detailed".',pattern:"Structural AST pattern.",namePattern:"Tree entry name glob or substring.",pathRegex:"Files operation: basename Rust regex.",limit:"Files/tree discovery cap before pagination.",pageSize:"Results returned per page.",sort:"Operation-specific sort order.",reverse:"Reverse the selected sort order."}}),No=z.object(v.shape),sn=z.object(W.shape),cn=z.enum(["paginated","discovery","detailed","content","files","filesWithout","countLines","countMatches","matchOnly"]),ln=z.enum(["content","files","countLines","countMatches","matchOnly"]),pn=No.omit({pattern:!0,rule:!0,captureText:!0,mode:!0,output:!0,itemsPerPage:!0,sortReverse:!0}).extend({operation:z.literal("text").describe('Use "text" for lexical search.'),searchText:z.string().describe("Single lexical pattern."),resultView:cn.optional().default("paginated").describe("Text result shape; paginated is the default."),pageSize:v.shape.itemsPerPage.describe("Matches returned per page."),reverse:v.shape.sortReverse.describe("Reverse the selected sort order."),unique:v.shape.unique.describe('With resultView:"matchOnly", deduplicate values or count frequency.'),matchWindow:v.shape.matchWindow.describe('Requires resultView:"matchOnly".')}).strict(),Mo=No.omit({searchText:!0,pattern:!0,rule:!0,mode:!0,regex:!0,caseMode:!0,wholeWord:!0,invertMatch:!0,multiline:!0,unique:!0,matchWindow:!0,output:!0,itemsPerPage:!0,sortReverse:!0}).extend({operation:z.literal("structural").describe('Use "structural" for AST matching.'),resultView:ln.optional().default("content").describe("Structural result shape; content is the default."),pageSize:v.shape.itemsPerPage.describe("Matches returned per page."),reverse:v.shape.sortReverse.describe("Reverse the selected sort order.")}).strict(),un=Mo.extend({pattern:z.string().describe("Structural AST pattern.")}).strict(),mn=Mo.extend({rule:z.string().describe("Structural YAML ast-grep rule.")}).strict(),dn=sn.omit({regex:!0,limit:!0,sortBy:!0,itemsPerPage:!0}).extend({operation:z.literal("files").describe('Use "files" for path and metadata discovery.'),pathRegex:W.shape.regex.describe("Basename Rust regex."),limit:W.shape.limit.describe("Post-sort discovery cap."),sort:W.shape.sortBy.describe("File sort order."),pageSize:W.shape.itemsPerPage.describe("Files returned per page.")}).strict(),hn=Y.omit({pattern:!0,recursive:!0,limit:!0,sortBy:!0,itemsPerPage:!0}).extend({operation:z.literal("tree").describe('Use "tree" for directory orientation.'),namePattern:Y.shape.pattern.describe("Entry name glob or substring."),limit:Y.shape.limit.describe("Discovery cap before pagination."),sort:Y.shape.sortBy.describe("Tree sort order."),pageSize:Y.shape.itemsPerPage.describe("Entries returned per page.")}).strict();function Fo(e,t){if("error"in e)for(let o of e.error.issues)o.code==="custom"&&t.addIssue({code:"custom",message:o.message,path:o.path})}var Zt=z.union([pn,un,mn,dn,hn]).superRefine((e,t)=>{if(e.operation==="text"){let o=e.resultView,r={...e,itemsPerPage:e.pageSize,sortReverse:e.reverse};delete r.operation,delete r.resultView,delete r.pageSize,delete r.reverse;let n=["paginated","discovery","detailed"].includes(o)?{...r,mode:o}:{...r,mode:"paginated",output:o};Fo(v.safeParse(n),t);return}if(e.operation!=="structural"&&e.operation==="files"){let o={...e,regex:e.pathRegex,limit:e.limit,sortBy:e.sort,itemsPerPage:e.pageSize};delete o.operation,delete o.pathRegex,delete o.pageSize,delete o.sort,Fo(W.safeParse(o),t)}});import{z as w}from"zod";var fn="localAnalyzeGraph",Ss=b({name:fn,type:"Local",shortDescription:"Analyze a repository file graph through one bounded operation.",instructions:"Map file topology, not symbol identity. dependencies/dependents need file; path needs file+target; deadCode/reachability accept roots; cycles needs no selector. Import edges and dead-code results are candidates\u2014verify changes and deletions with exact reads plus LSP.",schema:{path:"Absolute repository or package root to scan.",operation:"One bounded operation: deadCode, cycles, dependencies, dependents, path, or reachability.",file:"Repository-relative source file for dependencies, dependents, or path.",target:"Repository-relative destination file for path.",depth:"Traversal depth for dependencies or dependents.",entrypoints:"Repository-relative roots for deadCode or reachability.",includeTests:"Treat test files as reachability roots.",excludeDir:"Directory names to prune from graph construction.",maxFiles:"Maximum source files scanned; truncation is reported.",limit:"Result cap applied before pagination.",page:"Result page, 1-based; advance only while pagination.hasMore.",pageSize:"Results returned per page."}}),Ze=(e,t)=>w.preprocess(o=>typeof o=="number"&&Number.isFinite(o)?Math.min(Math.max(o,e),t):o,w.number().int().min(e).max(t)),we=(e,t)=>w.literal(e).describe(t),Ae={...h,path:w.string().describe("Absolute repository or package root to scan."),excludeDir:w.array(w.string()).optional().describe("Directory names to prune from graph construction."),maxFiles:Ze(1,5e4).optional().describe("Maximum source files scanned; truncation is reported."),limit:Ze(1,5e3).optional().describe("Result cap applied before pagination."),page:Ze(1,ze).optional().default(1).describe("Result page, 1-based."),pageSize:Ze(1,ce).optional().describe("Results returned per page.")},Go={entrypoints:w.array(w.string()).optional().describe("Repo-relative reachability roots; omit to detect package.json main/exports/bin."),includeTests:w.boolean().optional().default(!0).describe("Treat tests as reachability roots (default true).")},vo={file:w.string().describe("Repo-relative source file."),depth:Ze(1,50).optional().default(1).describe("Maximum traversal depth (default 1).")},Ee=w.discriminatedUnion("operation",[w.object({...Ae,...Go,operation:we("deadCode","Find unreachable or unretained exported symbols and dead SCCs.")}).strict(),w.object({...Ae,operation:we("cycles","Find strongly connected file components.")}).strict(),w.object({...Ae,...vo,operation:we("dependencies","Traverse files imported or re-exported by the source file; results include edgeKinds and syntactic confidence.")}).strict(),w.object({...Ae,...vo,operation:we("dependents","Traverse files that import or re-export the source file; results include edgeKinds and syntactic confidence.")}).strict(),w.object({...Ae,file:w.string().describe("Repo-relative source file."),target:w.string().describe("Repo-relative destination file."),operation:we("path","Find the shortest directed import/re-export path with per-edge provenance.")}).strict(),w.object({...Ae,...Go,operation:we("reachability","Classify scanned files by reachability from entrypoints.")}).strict()]);import{z as Oe}from"zod";var gn=b({name:"localGetFileContent",type:"Local",shortDescription:"Read a local file or a specific region.",instructions:`Read a known local path after search, find, or structure discovery. For large files, get a symbols outline, then an exact range or match. Read small config files whole with minify:"none".
|
|
15
|
-
Choose fullContent, matchString, or startLine+endLine. Partial content cannot prove absence; continue with the returned charOffset. matchedLines are LSP anchors; match ranges and character offsets are not. Report fetched bytes only.`,schema:{fullContent:"Whole file; small files only; exclusive with range/match.",matchString:"Anchor returning padded matchRanges and exact matchedLines.",matchStringIsRegex:"Makes matchString a regex.",matchStringCaseSensitive:"Case-sensitive matchString.",startLine:"Requires endLine; exclusive with fullContent/matchString.",endLine:"Requires startLine; must be >= startLine.",charOffset:"Copy pagination.nextCharOffset.",minify:'"symbols" outline, "standard" compact, "none" exact.'}}),ct=u(gn.schema,{...h,path:Oe.string(),fullContent:Oe.boolean().optional(),matchString:Oe.string().optional(),matchStringIsRegex:Oe.boolean().optional(),matchStringCaseSensitive:Oe.boolean().optional(),startLine:Re(),endLine:Re(),contextLines:l(0,xe).default(5),charOffset:k(),charLength:B(),minify:Oe.enum(["none","standard","symbols"]).default("standard")}).superRefine(ot);import{z as me}from"zod";var yn=b({name:"lspGetSemantics",type:"Local",shortDescription:"Run LSP semantic queries \u2014 definitions, references, call hierarchy, symbols, type hierarchy, diagnostics.",instructions:`Use a real search/read line anchor for semantic proof. references finds usages; callers incoming calls; callees outgoing calls; callHierarchy both. Fall back to references if call hierarchy is unavailable.
|
|
16
|
-
documentSymbols/diagnostic need uri; workspaceSymbol needs symbolName; other operations need uri+symbolName+lineHint. orderHint resolves same-line names. format:"compact" saves tokens. Empty/unavailable results call for a new anchor or text search.`,schema:{pageSize:"References or symbols returned per page.",page:"Reference/symbol result page.",type:"Identity, usage, hierarchy, hover, symbol, or diagnostic operation.",uri:"Target file path/URI; required for every type except workspaceSymbol.",symbolName:"Bare anchored identifier, or fuzzy workspace symbol query.",lineHint:"Observed line containing symbolName.",orderHint:"Disambiguate repeated symbols on one line.",depth:"Call/type hierarchy depth; 0 is direct only.",includeDeclaration:"references: include the declaration; disable before unused analysis.",groupByFile:"references summary mode.",contextLines:"Lines of surrounding source shown around each result location.",format:'"compact" saves tokens; "structured" has typed locations.',workspaceRoot:"Use when auto-root is wrong."}}),lt=u(yn.schema,{...h,uri:me.string().optional(),type:me.enum(["definition","references","callers","callees","callHierarchy","hover","documentSymbols","typeDefinition","implementation","workspaceSymbol","supertypes","subtypes","diagnostic"]).default("definition"),symbolName:me.string().min(1).optional(),lineHint:l(1,P).optional(),orderHint:l(0,It).default(0),depth:l(0,Nt).optional(),includeDeclaration:me.boolean().default(!0),groupByFile:me.boolean().optional(),page:_(),pageSize:l(1,Mt).optional(),contextLines:tt(),format:me.enum(["structured","compact"]).default("structured"),workspaceRoot:me.string().optional()}).superRefine((e,t)=>{if(e.type==="workspaceSymbol"){e.symbolName||t.addIssue({code:"custom",path:["symbolName"],message:"Set symbolName for workspaceSymbol."});return}e.uri||t.addIssue({code:"custom",path:["uri"],message:"Set uri for file-scoped operations."}),!(e.type==="documentSymbols"||e.type==="diagnostic")&&(e.symbolName||t.addIssue({code:"custom",path:["symbolName"],message:"Set symbolName for anchored operations."}),Number.isInteger(e.lineHint)||t.addIssue({code:"custom",path:["lineHint"],message:"Set lineHint for anchored operations."}))});var de=G.LOCAL_ANALYZE_GRAPH,he="localSearch",Ie=G.GITHUB_SEARCH,fe="ghSearchHistory",ge="ghGetHistoryItem",A={GITHUB_SEARCH:G.GITHUB_SEARCH,GITHUB_FETCH_CONTENT:G.GITHUB_FETCH_CONTENT,PACKAGE_SEARCH:G.PACKAGE_SEARCH,GITHUB_CLONE_REPO:G.GITHUB_CLONE_REPO,LOCAL_FETCH_CONTENT:G.LOCAL_FETCH_CONTENT,LOCAL_ANALYZE_GRAPH:G.LOCAL_ANALYZE_GRAPH,LSP_GET_SEMANTIC_CONTENT:G.LSP_GET_SEMANTIC_CONTENT,GITHUB_SEARCH_HISTORY:fe,GITHUB_GET_HISTORY_ITEM:ge},J=A.LSP_GET_SEMANTIC_CONTENT,Js=new Set([he,A.LOCAL_FETCH_CONTENT,de,J]);var Qo=["definition","references","callers","callees","callHierarchy","hover","documentSymbols","typeDefinition","implementation","workspaceSymbol","supertypes","subtypes","diagnostic"];var V={ghSearch:`Choose operation:"code" for code contents or file paths, "repositories" to discover repositories, or "tree" to browse a known repository.
|
|
17
|
-
Each operation has a strict input branch; fields from other operations are rejected. Use ghGetFileContent only after a path is known. Empty GitHub search results do not prove absence.`,ghGetFileContent:`Read a known GitHub path after search or structure discovery; a complete search snippet needs no reread. A path-only call returns a bounded standard-minified view. For large files, get a symbols outline, then an exact range or match. Read small config files whole with minify:"none".
|
|
18
|
-
Optionally choose fullContent, matchString, or startLine+endLine. Partial content cannot prove absence; run the returned continuation. matchedLines are LSP anchors; match ranges and offsets are not. type:"directory" returns localPath when local access is enabled; otherwise use ghSearch operation:"tree".`,ghSearchHistory:'Search or list repository history. Choose operation:"pullRequests", "issues", or "commits"; fields from other operations are rejected. Pull-request search may be global, while issue and commit history require owner+repo. Search branches never accept detail identities, content selectors, or diff pagination. Follow a result with ghGetHistoryItem.',ghGetHistoryItem:'Retrieve exact GitHub history. Choose operation:"pullRequest" or "issue" with number, "commit" with ref, or "compare" with base+head. Every branch requires owner+repo and rejects fields from other branches. PR/issue content and commit/compare diffs keep their branch-specific page and character windows; copy returned continuations exactly.',npmSearch:"Resolve npm packages to source repositories. Set exactly one of packageName for exact lookup or keywords for discovery. Follow the repository into GitHub tools.",ghCloneRepo:"Best for repeated reads, local AST/regex, or LSP; use ghGetFileContent for one read. Discover a bounded sparsePath first; complete is relative to that requested scope. branch selects the ref and forceRefresh bypasses the cached clone. Pass results[].data.location.localPath to local tools.",localSearch:'Choose operation:"text" for lexical anchors, "structural" for AST matches, "files" for path or metadata discovery, and "tree" for directory orientation. Each operation has a strict branch, so do not mix fields across operations. Files/tree prune common generated and vendor directories by default; pass excludeDir:[] to prune nothing. Read exact hits with localGetFileContent and prove symbol identity with lspGetSemantics.',localAnalyzeGraph:"Map file topology, not symbol identity. dependencies/dependents need file; path needs file+target; deadCode/reachability accept roots; cycles needs no selector. Import edges and dead-code results are candidates\u2014verify changes and deletions with exact reads plus LSP.",localGetFileContent:`Read a known local path after search, find, or structure discovery. A path-only call returns a bounded standard-minified view. For large files, get a symbols outline, then an exact range or match. Read small config files whole with minify:"none".
|
|
8
|
+
import{z as st}from"zod";var v={GITHUB_SEARCH:"ghSearch",GITHUB_FETCH_CONTENT:"ghGetFileContent",GITHUB_SEARCH_HISTORY:"ghSearchHistory",GITHUB_GET_HISTORY_ITEM:"ghGetHistoryItem",PACKAGE_SEARCH:"npmSearch",GITHUB_CLONE_REPO:"ghCloneRepo",LOCAL_SEARCH:"localSearch",LOCAL_ANALYZE_GRAPH:"localAnalyzeGraph",LOCAL_FETCH_CONTENT:"localGetFileContent",LSP_GET_SEMANTIC_CONTENT:"lspGetSemantics"},ct=st.object({goal:st.string().optional().describe("What this query should accomplish."),reasoning:st.string().optional().describe("Why this query advances the goal.")}),ze=Object.fromEntries(Object.entries(ct.shape).map(([e,t])=>[e,t.description??""]));var oe=v.LOCAL_ANALYZE_GRAPH,ne="localSearch",ue=v.GITHUB_SEARCH,re="ghSearchHistory",ie="ghGetHistoryItem",y={GITHUB_SEARCH:v.GITHUB_SEARCH,GITHUB_FETCH_CONTENT:v.GITHUB_FETCH_CONTENT,PACKAGE_SEARCH:v.PACKAGE_SEARCH,GITHUB_CLONE_REPO:v.GITHUB_CLONE_REPO,LOCAL_FETCH_CONTENT:v.LOCAL_FETCH_CONTENT,LOCAL_ANALYZE_GRAPH:v.LOCAL_ANALYZE_GRAPH,LSP_GET_SEMANTIC_CONTENT:v.LSP_GET_SEMANTIC_CONTENT,GITHUB_SEARCH_HISTORY:re,GITHUB_GET_HISTORY_ITEM:ie},Z=y.LSP_GET_SEMANTIC_CONTENT,Ci=new Set([ne,y.LOCAL_FETCH_CONTENT,oe,Z]);var T={ghSearch:'Discover GitHub code with operation:"code", repositories with "repositories", or a known repository tree with "tree". Code search covers the default branch; tree accepts branch. Read known paths with ghGetFileContent. Empty or incomplete search results do not prove absence.',ghGetFileContent:'Read a known GitHub path. branch is honored when supplied; omission uses the default branch. A path-only call returns bounded, standard-minified content; optionally select fullContent, matchString, or startLine+endLine. minify:"none" preserves text; "symbols" returns an outline. Run returned continuations for partial content. matchedLines are exact source-line anchors. type:"directory" materializes localPath with persistent local access; use ghSearch operation:"tree" to browse remotely.',ghSearchHistory:'Discover history metadata with operation:"pullRequests", "issues", or "commits". Pull requests may be searched globally; issues and commits require owner+repo. Commit keywords search messages on the default branch; omit keywords to walk history by path/ref/date. Retrieve a known number or commit ref with ghGetHistoryItem.',ghGetHistoryItem:'Read known history with owner+repo: operation:"pullRequest" or "issue" takes number, "commit" takes ref, and "compare" takes base+head. PR/issue content selectors request bodies, comments, or review/change details; commit/compare includeDiff requests patches. Follow returned continuations for each partial surface.',npmSearch:"Look up npm package metadata with packageName, or discover npm packages with keywords. Uses npm configuration and registry-scoped credentials; exact scoped names honor scope mappings. Optional registry overrides routing. Keyword search targets one registry and supports page; follow returned continuations. Use returned repository links for source-code research.",ghCloneRepo:"Create a cached, shallow checkout for repeated reads, local AST/regex, or LSP. Optional sparsePath scopes a file/subtree; complete refers to that scope. branch selects a branch, tag, or full commit SHA; omission uses the default branch. location.commitSha identifies HEAD; cached working-tree contents are not reverified. forceRefresh renews the checkout. Requires git and persistent local storage. Pass results[].data.location.localPath to local tools; ghGetFileContent also supports individual remote reads.",localSearch:'Choose operation:"text" for lexical anchors, "structural" for AST matches, "files" for path or metadata discovery, and "tree" for directory orientation. Each operation has a strict branch, so do not mix fields across operations. Files/tree prune common generated and vendor directories by default; pass excludeDir:[] to prune nothing. Read exact hits with localGetFileContent and prove symbol identity with lspGetSemantics.',localAnalyzeGraph:"Map file topology, not symbol identity. dependencies/dependents need file; path needs file+target; deadCode/reachability accept roots; cycles needs no selector. Import edges and dead-code results are candidates\u2014verify changes and deletions with exact reads plus LSP.",localGetFileContent:`Read a known local path after search, find, or structure discovery. A path-only call returns a bounded standard-minified view. For large files, get a symbols outline, then an exact range or match. Read small config files whole with minify:"none".
|
|
19
9
|
Optionally choose fullContent, matchString, or startLine+endLine. Partial content cannot prove absence; run the returned continuation. matchedLines are LSP anchors; match ranges and character offsets are not. Report fetched bytes only.`,lspGetSemantics:`Use a real search/read line anchor for semantic proof. references finds usages; callers incoming calls; callees outgoing calls; callHierarchy both. Fall back to references if call hierarchy is unavailable.
|
|
20
|
-
documentSymbols/diagnostic need uri; workspaceSymbol needs symbolName; other operations need uri+symbolName+lineHint. orderHint resolves same-line names. format:"compact" saves tokens. Empty/unavailable results call for a new anchor or text search.`};import{z as Pe}from"zod";function c(e,t){return Pe.preprocess(o=>typeof o=="number"&&Number.isFinite(o)?Math.min(Math.max(o,e),t):o,Pe.number().int().min(e).max(t))}var T=c(1,1e3).optional().default(1),ke=c(0,100).optional(),He=c(1,1e9).optional(),M=Pe.preprocess(e=>typeof e=="number"&&Number.isFinite(e)?Math.max(e,0):e,Pe.number().nonnegative().refine(Number.isSafeInteger,"Expected a safe non-negative integer")),bn={responseCharOffset:M.optional().describe("Full-response char offset; re-call with returned value when hasMore."),responseCharLength:c(1,5e4).optional().describe("Full-response char window.")};function d(e,t={}){let{maxQueries:o=5}=t;return Pe.object({queries:Pe.array(e).min(1).max(o).describe("Parallel queries; response rows use matching zero-based indexes."),...bn}).strict()}import{z as Bo}from"zod";function Tn(e,t){return e?.description&&!t.description?t.describe(e.description):t}function zo(e,t){let o={};for(let[r,n]of Object.entries(t))o[r]=Tn(e.shape[r],n);return o}function xn(e,t){let o=e;return o.safeExtend?o.safeExtend(t):e.extend(t)}function jo(e,t){if(!t?.length)return e;let o=new Set(t);return Bo.object(Object.fromEntries(Object.entries(e.shape).filter(([r])=>!o.has(r))))}function g(e,t={},o={}){let r=jo(e,o.omit);return xn(r,zo(r,t)).strict()}function S(e,t={},o={}){let r=jo(e,o.omit);return Bo.object({...r.shape,...zo(r,t)}).strict()}var pt=g(zt),$t=d(pt);import{z as Ln}from"zod";import{z as $}from"zod";var qo=["fullContent","matchString","matchStringIsRegex","matchStringCaseSensitive","startLine","endLine"],Rn=[...qo,"contextLines","charOffset","charLength","minify"];function Xo(e,t){let o=new Set(t);return Object.fromEntries(Object.entries(e).filter(([r])=>!o.has(r)))}function ut(e,t){return e.description?t.describe(e.description):t}function x(e,t){let o=e[t];if(!o)throw new TypeError(`Expected schema field: ${t}`);return o}function R(e,t){return x(e,t).nonoptional()}function Uo(e,t){let o=Xo(e.shape,[...qo,...t?["type"]:[]]),r=t?{type:t}:{},n=ut(x(e.shape,"fullContent"),$.literal(!1).optional()),i=ut(x(e.shape,"fullContent"),$.literal(!0)),a=$.object({...o,...r,fullContent:n}).strict(),m=$.object({...o,...r,fullContent:i}).strict(),f=$.object({...o,...r,fullContent:n,matchString:R(e.shape,"matchString"),matchStringIsRegex:x(e.shape,"matchStringIsRegex"),matchStringCaseSensitive:x(e.shape,"matchStringCaseSensitive")}).strict(),I=$.object({...o,...r,fullContent:n,startLine:R(e.shape,"startLine"),endLine:R(e.shape,"endLine")}).strict().superRefine((E,Io)=>{typeof E.startLine=="number"&&typeof E.endLine=="number"&&E.endLine<E.startLine&&Io.addIssue({code:"custom",path:["endLine"],message:"Set endLine greater than or equal to startLine."})});return[a,m,f,I]}function mt(e,t={}){if(!t.githubDirectoryMode)return $.union(Uo(e));let o=ut(x(e.shape,"type"),$.literal("file").optional()),r=ut(x(e.shape,"type"),$.literal("directory")),n=Xo(e.shape,[...Rn,"type"]),i=$.object({...n,type:r}).strict();return $.union([...Uo(e,o),i])}var _n=Ln.enum(["none","standard","symbols"]).optional(),Zo={startLine:He,endLine:He,contextLines:ke,charOffset:M.optional(),charLength:c(1,5e4).optional(),minify:_n},Cn=S(nt,Zo),Wt=g(nt,Zo),Yt=d(mt(Cn,{githubDirectoryMode:!0}));function Kt(e){return typeof e=="string"&&e.trim().length>0}function Jt(e){return Array.isArray(e)&&e.some(Kt)}function wn(e){return e.operation==="code"?Jt(e.keywords)||["owner","path","extension","filename","language"].some(t=>Kt(e[t])):e.operation==="repositories"?Jt(e.keywords)||Jt(e.topics)||["owner","language","stars","forks","goodFirstIssues","updated","created","size","visibility","license"].some(t=>Kt(e[t]))||typeof e.archived=="boolean":!0}var dt=vt.superRefine((e,t)=>{wn(e)||t.addIssue({code:"custom",path:["operation"],message:`${e.operation} needs at least one search term or scope filter`})}),eo=d(dt,{maxQueries:5});import{z as An}from"zod";var Vo={limit:c(1,100).optional(),page:T.default(1),match:An.enum(["file","path"]).default("file")},En=g(oe,Vo),On=d(S(oe,Vo));import{z as to}from"zod";var $o={type:to.enum(["prs","commits","issues"]).optional(),prNumber:c(1,1e9).optional(),issueNumber:c(1,1e9).optional(),pageSize:c(1,100).optional().default(30),match:to.array(to.enum(["title","body","comments"])).optional(),page:T.default(1),filePage:c(1,1e3).optional(),commentPage:c(1,1e3).optional(),commitPage:c(1,1e3).optional(),charOffset:M.optional(),commentBodyOffset:M.optional(),charLength:c(1,5e4).optional()},In=S(it,$o),Pn=g(it,$o),kn=d(In);import{z as St}from"zod";import{z as F}from"zod";function De(e,t,o){let r=e.safeParse(t);if(!r.success)for(let n of r.error.issues)o.addIssue({code:"custom",message:n.message,path:n.path})}function Wo(e){let t=e;for(;t instanceof F.ZodOptional||t instanceof F.ZodDefault;)t=t.unwrap();if(!(t instanceof F.ZodObject))throw new TypeError("Expected an object schema");return t}function Yo(e){let t=e;for(;t instanceof F.ZodOptional||t instanceof F.ZodDefault;)t=t.unwrap();if(!(t instanceof F.ZodArray))throw new TypeError("Expected an array schema");return t}function Ne(e,t){return e.description?t.describe(e.description):t}var Jo={pageSize:c(1,100).optional().default(30),page:c(1,1e3).optional()},Ko={...Jo,filePage:c(1,1e3).optional(),commentPage:c(1,1e3).optional(),commitPage:c(1,1e3).optional(),charOffset:M.optional(),commentBodyOffset:M.optional(),charLength:c(1,1e5).optional()},jc=g(pe,Ko).superRefine((e,t)=>De(pe,e,t)),Fe=S(pe,Ko),er=x(Fe.shape,"content"),tr=Wo(er),or=x(tr.shape,"patches"),ne=Wo(or),rr=Ne(x(ne.shape,"mode"),F.literal("selected")),Fn=Ne(x(ne.shape,"mode"),F.literal("all")),Dn=Ne(x(ne.shape,"files"),Yo(x(ne.shape,"files")).min(1)),Nn=Ne(x(ne.shape,"ranges"),Yo(x(ne.shape,"ranges")).min(1)),Mn=F.object({mode:rr,files:Dn,ranges:x(ne.shape,"ranges")}).strict(),Gn=F.object({mode:rr,files:x(ne.shape,"files"),ranges:Nn}).strict(),vn=F.object({mode:Fn}).strict(),Qn=tr.extend({patches:Ne(or,F.union([Mn,Gn,vn]).optional())}),ro=Fe.omit({prNumber:!0,filePage:!0,commentPage:!0,commitPage:!0,content:!0,matchString:!0,commentBodyOffset:!0,charOffset:!0,charLength:!0}),Bn=ro.superRefine((e,t)=>De(pe,e,t)),gt=Fe.omit({keywords:!0,concise:!0,state:!0,assignee:!0,author:!0,commenter:!0,mentions:!0,"review-requested":!0,"reviewed-by":!0,label:!0,checks:!0,review:!0,head:!0,base:!0,created:!0,updated:!0,closed:!0,"merged-at":!0,comments:!0,reactions:!0,draft:!0,match:!0,sort:!0,order:!0,page:!0,archived:!0}).extend({owner:R(Fe.shape,"owner"),repo:R(Fe.shape,"repo"),prNumber:R(Fe.shape,"prNumber"),content:Ne(er,Qn.optional())}),zn=gt.superRefine((e,t)=>De(pe,e,t)),Uc=d(F.union([Bn,zn])),nr={...Jo,commentPage:c(1,1e3).optional(),charOffset:M.optional(),commentBodyOffset:M.optional(),charLength:c(1,1e5).optional()},qc=g(ue,nr).superRefine((e,t)=>De(ue,e,t)),oo=S(ue,nr),$e=oo.omit({issueNumber:!0,commentPage:!0,content:!0,matchString:!0,commentBodyOffset:!0,charOffset:!0,charLength:!0}),jn=$e.superRefine((e,t)=>De(ue,e,t)),yt=oo.omit({keywords:!0,concise:!0,state:!0,assignee:!0,author:!0,commenter:!0,mentions:!0,label:!0,created:!0,updated:!0,closed:!0,comments:!0,reactions:!0,match:!0,sort:!0,order:!0,page:!0,archived:!0}).extend({issueNumber:R(oo.shape,"issueNumber")}),Un=yt.superRefine((e,t)=>De(ue,e,t)),Xc=d(F.union([jn,Un])),ir={page:T.default(1),pageSize:c(1,100).optional().default(30),filePage:T.optional(),charOffset:M.optional(),charLength:c(1,1e5).optional()};function qn(e,t){(e.base&&!e.head||e.head&&!e.base)&&t.addIssue({code:"custom",path:[e.base?"head":"base"],message:"compare mode requires base and head together"})}var Zc=g(at,ir).superRefine(qn),ft=S(at,ir),no=ft.omit({base:!0,head:!0}),Xn=no,Me=ft.omit({branch:!0,since:!0,until:!0,author:!0,committer:!0,page:!0}).extend({base:R(ft.shape,"base"),head:R(ft.shape,"head")}),Zn=Me,Vc=d(F.union([Xn,Zn]));var Se=e=>St.literal(e).describe("Required operation selector."),Ge=e=>R(e,"owner"),ve=e=>R(e,"repo"),Vn=ro.extend({operation:Se("pullRequests")}).strict(),$n=$e.extend({operation:Se("issues"),owner:Ge($e.shape),repo:ve($e.shape)}).strict(),io=no.omit({includeDiff:!0,filePage:!0,charOffset:!0,charLength:!0}),Wn=io.extend({operation:Se("commits"),owner:Ge(io.shape),repo:ve(io.shape)}).strict(),bt=St.discriminatedUnion("operation",[Vn,$n,Wn]).describe("Search or list GitHub pull requests, issues, or commits using one strict operation branch."),lo=d(bt),ao=gt.omit({prNumber:!0}),Yn=ao.extend({operation:Se("pullRequest"),owner:Ge(ao.shape),repo:ve(ao.shape),number:gt.shape.prNumber}).strict(),so=yt.omit({issueNumber:!0}),Jn=so.extend({operation:Se("issue"),owner:Ge(so.shape),repo:ve(so.shape),number:yt.shape.issueNumber}).strict(),co=Me.omit({base:!0,head:!0}),Kn=co.extend({operation:Se("commit"),owner:Ge(co.shape),repo:ve(co.shape),ref:St.string().min(1).describe("Commit SHA or ref to retrieve exactly.")}).strict(),ei=Me.extend({operation:Se("compare"),owner:Ge(Me.shape),repo:ve(Me.shape)}).strict(),Tt=St.discriminatedUnion("operation",[Yn,Jn,Kn,ei]).describe("Retrieve one GitHub pull request, issue, commit, or ref comparison using one strict operation branch."),po=d(Tt);import{z as ar}from"zod";var sr={limit:c(1,100).optional(),page:T.default(1),match:ar.array(ar.enum(["name","description","readme"])).optional()},ti=g(ee,sr),oi=d(S(ee,sr));var cr={maxDepth:c(0,20).optional(),page:T.default(1),itemsPerPage:c(1,200).optional()},ni=g(le,cr),ii=d(S(le,cr));import{z as Te}from"zod";var lr={page:T,pageSize:c(1,100).optional().describe("Packages returned per keyword-discovery page."),keywords:Te.array(Te.string()).optional()};function uo(e,t){let o=Array.isArray(e.keywords)?e.keywords.join(" ").trim():e.keywords?.trim();!e.packageName?.trim()&&!o&&t.addIssue({code:"custom",path:["packageName"],message:"provide packageName or keywords"}),e.packageName?.trim()&&o&&t.addIssue({code:"custom",path:["keywords"],message:"provide packageName or keywords, not both"}),e.packageName?.trim()&&e.pageSize!==void 0&&t.addIssue({code:"custom",path:["pageSize"],message:"pageSize is only available for keyword discovery"})}var mo=g(st,lr).superRefine(uo),xt=S(st,lr,{strict:!0}),pr=xt.omit({packageName:!0,keywords:!0,pageSize:!0}).shape,ai=Te.object({...pr,packageName:R(xt.shape,"packageName")}).strict().superRefine((e,t)=>uo(e,t)),si=Te.object({...pr,keywords:Te.array(Te.string()).min(1).describe(x(xt.shape,"keywords").description??""),pageSize:x(xt.shape,"pageSize")}).strict().superRefine((e,t)=>uo(e,t)),ho=d(Te.union([ai,si]),{maxQueries:5});import{z as ci}from"zod";var li=ci.enum(["none","standard","symbols"]).optional(),ur={startLine:He,endLine:He,contextLines:ke.default(5),charOffset:M.optional(),charLength:c(1,5e4).optional(),minify:li},pi=S(ct,ur),fo=g(ct,ur),go=d(mt(pi),{maxQueries:5});import{z as yo}from"zod";var mr={maxDepth:c(0,100).optional(),minDepth:c(0,100).optional(),limit:c(1,1e4).optional(),page:T.default(1),itemsPerPage:c(1,50).optional(),excludeDir:yo.array(yo.string()).optional()},dr=yo.object(Object.fromEntries(Object.entries(W.shape).filter(([e])=>e!=="regexType")));function ui(e,t){e.minDepth!==void 0&&e.maxDepth!==void 0&&e.minDepth>e.maxDepth&&t.addIssue({code:"custom",message:"minDepth must be less than or equal to maxDepth.",path:["minDepth"]})}var mi=S(dr,mr),di=g(dr,mr).superRefine(ui),hi=d(mi,{maxQueries:5});var To=d(Ee,{maxQueries:5});import{z as ie}from"zod";var fi=["paginated","discovery","detailed","structural"],gi=["semanticRanking"],hr={mode:ie.enum(fi).optional().default("paginated"),searchText:ie.string().optional(),output:ie.enum(["content","files","filesWithout","countLines","countMatches","matchOnly"]).optional().default("content"),pattern:ie.string().optional(),maxDepth:c(0,20).optional(),rule:ie.string().optional(),captureText:ie.boolean().optional(),contextLines:ke,matchContentLength:c(1,1e5).optional().default(500),maxMatchesPerFile:c(1,1e5).optional(),maxFiles:c(1,1e5).optional(),matchPage:T.optional(),itemsPerPage:c(1,1e3).optional(),page:T.default(1),unique:ie.enum(["off","list","count"]).optional().default("off")},yi={...hr,semanticRanking:ie.unknown().optional().superRefine((e,t)=>{e!==void 0&&t.addIssue({code:"custom",message:'semanticRanking is disabled in this build \u2014 sort:"relevance" already includes declaration/export/AST signals; remove this field.'})}).describe('DISABLED in this build \u2014 do not pass. sort:"relevance" already includes declaration/export/AST signals.')},Si=S(v,yi),bi=g(v,hr,{strict:!0,omit:gi}),Ti=bi.superRefine((e,t)=>{if(e.mode==="structural"){!e.pattern&&!e.rule&&t.addIssue({code:"custom",message:'mode:"structural" requires `pattern` or `rule`.',path:["pattern"]}),e.pattern&&e.rule&&t.addIssue({code:"custom",message:"`pattern` and `rule` are mutually exclusive.",path:["rule"]}),e.wholeWord&&t.addIssue({code:"custom",message:'`wholeWord` is not valid with mode:"structural".',path:["wholeWord"]}),e.invertMatch&&t.addIssue({code:"custom",message:'`invertMatch` is not valid with mode:"structural".',path:["invertMatch"]}),e.regex&&e.regex!=="smart"&&t.addIssue({code:"custom",message:'`regex` is not valid with mode:"structural".',path:["regex"]}),e.caseMode&&e.caseMode!=="smart"&&t.addIssue({code:"custom",message:'`caseMode` is not valid with mode:"structural".',path:["caseMode"]}),e.multiline&&e.multiline!=="off"&&t.addIssue({code:"custom",message:'`multiline` is not valid with mode:"structural".',path:["multiline"]}),e.output&&e.output!=="content"&&e.output!=="countMatches"&&e.output!=="files"&&t.addIssue({code:"custom",message:'With mode:"structural", `output` supports only "content" (default), "countMatches" (per-file counts, no match content \u2014 cheapest for counting), or "files" (paths only).',path:["output"]}),e.unique&&e.unique!=="off"&&t.addIssue({code:"custom",message:'`unique` is not valid with mode:"structural".',path:["unique"]});let o=e.pattern&&!["php","bash","sh","zsh"].includes(e.langType??"")?/(?<!\$)\$\$(?!\$)[A-Z_][A-Z0-9_]*/.exec(e.pattern):null;if(o){let r=o[0].slice(2);t.addIssue({code:"custom",message:`\`${o[0]}\` is not a metavariable and matches nothing \u2014 use \`$${r}\` for one node or \`$$$${r}\` for a list of nodes.`,path:["pattern"]})}return}(e.pattern||e.rule)&&t.addIssue({code:"custom",message:'`pattern`/`rule` require mode:"structural".',path:[e.pattern?"pattern":"rule"]}),e.searchText||t.addIssue({code:"custom",message:'`searchText` is required unless mode:"structural".',path:["searchText"]}),e.matchWindow!==void 0&&e.output!=="matchOnly"&&t.addIssue({code:"custom",message:'matchWindow requires output:"matchOnly".',path:["matchWindow"]}),(e.unique==="list"||e.unique==="count")&&e.output!=="matchOnly"&&t.addIssue({code:"custom",message:'unique requires output:"matchOnly".',path:["unique"]})}),xi=d(Si,{maxQueries:5});import{z as fr}from"zod";var gr={excludeDir:fr.array(fr.string()).optional(),maxDepth:c(0,20).optional(),limit:c(1,1e4).optional(),page:T.default(1),itemsPerPage:c(1,50).optional()},Ri=S(Y,gr),Li=g(Y,gr),_i=d(Ri,{maxQueries:5});import{z as Sr}from"zod";var[Ci,wi,Ai,Ei,Oi]=Zt.options,yr=Sr.enum(["content","files","countMatches"]).optional().default("content").describe("Structural result shape; content is the default."),Rt=Sr.union([Ci,wi.extend({resultView:yr}),Ai.extend({resultView:yr}),Ei,Oi]),Ro=d(Rt,{maxQueries:5});import{z as ae}from"zod";var Ii=c(1,1e9),Pi=c(0,1e5).optional(),ki=["structured","compact"],br={type:ae.enum(Qo).default("definition"),symbolName:ae.string().min(1).max(1024).optional(),lineHint:Ii.optional(),orderHint:Pi,depth:c(0,20).optional(),includeDeclaration:ae.boolean().optional().default(!0),page:T,pageSize:c(1,100).optional(),contextLines:c(0,100).optional(),format:ae.enum(ki).optional().default("structured")},se=S(lt,br),Hi=["definition","references","callers","callees","callHierarchy","hover","typeDefinition","implementation","supertypes","subtypes"],Fi=["documentSymbols","diagnostic"],Di=se.extend({type:ae.enum(Hi).optional(),uri:R(se.shape,"uri"),symbolName:R(se.shape,"symbolName"),lineHint:R(se.shape,"lineHint")}),Ni=se.extend({type:ae.enum(Fi),uri:R(se.shape,"uri")}),Mi=se.extend({type:ae.literal("workspaceSymbol"),symbolName:R(se.shape,"symbolName")}),Lo=g(lt,br),_o=d(ae.union([Di,Ni,Mi]),{maxQueries:5});var Tr=[{name:Ie,title:"GitHub Search",description:V.ghSearch,schema:dt,inputSchema:eo},{name:A.GITHUB_FETCH_CONTENT,title:"GitHub File Content Fetch",description:V.ghGetFileContent,schema:Wt,inputSchema:Yt},{name:fe,title:"GitHub History Search",description:V.ghSearchHistory,schema:bt,inputSchema:lo},{name:ge,title:"GitHub History Item",description:V.ghGetHistoryItem,schema:Tt,inputSchema:po},{name:A.PACKAGE_SEARCH,title:"Package Search",description:V.npmSearch,schema:mo,inputSchema:ho},{name:A.GITHUB_CLONE_REPO,title:"Clone / Fetch GitHub Repository Locally",description:V.ghCloneRepo,schema:pt,inputSchema:$t},{name:he,title:"Local Search",description:V.localSearch,schema:Rt,inputSchema:Ro},{name:de,title:"Local Analyze Graph",description:V.localAnalyzeGraph,schema:Ee,inputSchema:To},{name:A.LOCAL_FETCH_CONTENT,title:"Local Fetch Content",description:V.localGetFileContent,schema:fo,inputSchema:go},{name:J,title:"Get Semantic Content",description:V.lspGetSemantics,schema:Lo,inputSchema:_o}];var xr=["GitHub","Local Code","Package","Other"],Rr=new Map([Ie,fe,ge,A.GITHUB_FETCH_CONTENT,A.GITHUB_CLONE_REPO,he,de,A.LOCAL_FETCH_CONTENT,J,A.PACKAGE_SEARCH].map((e,t)=>[e,t])),K=class extends Error{constructor(o,r=[]){super(o);this.details=r;this.name="DirectToolInputError"}details},Gi=["goal","reasoning"],Qe=new Set([...Gi]);function vi(e){return{name:e.name,title:e.title,description:e.description,schema:e.schema,inputSchema:e.inputSchema}}var _r=Tr.map(e=>vi(e)),Cr=[..._r];function D(e){return _r.find(t=>t.name===e)}function Lr(e){return e.startsWith("gh")?"GitHub":e.startsWith("local")||e.startsWith("lsp")?"Local Code":e===A.PACKAGE_SEARCH?"Package":"Other"}function Ip(e){return[...e].sort((t,o)=>{let r=xr.indexOf(Lr(t)),n=xr.indexOf(Lr(o));if(r!==n)return r-n;let i=Rr.get(t)??Number.MAX_SAFE_INTEGER,a=Rr.get(o)??Number.MAX_SAFE_INTEGER;return i!==a?i-a:t.localeCompare(o)})}import{z as wr}from"zod";var Qi=["goal","reasoning"];function Fp(e){let t=D(e);if(!t)return"{}";try{return JSON.stringify(wr.toJSONSchema(t.inputSchema,{io:"input"}),null,2)}catch{return JSON.stringify(wr.toJSONSchema(t.schema,{io:"input"}),null,2)}}function Dp(e){return JSON.stringify(e??{},null,2)}function Np(e){return D(e)?[...Qi]:[]}function Mp(e,t){return D(e)?.description??e}import{z as wo}from"zod";function Ct(e){let t=D(e);if(!t)return[];let o=wo.toJSONSchema(t.schema,{io:"input"});if(!j(o))return[];let r=wt(o),n=Or(r),i=Ir(r,n);return _t(n,i)}function Bp(e){let t=D(e);if(!t)return{};let o=wo.toJSONSchema(t.schema,{io:"input"});if(!j(o))return{};let r=new Map;for(let n of wt(o)){if(!Q(n.properties))continue;let i=n.properties.operation;if(!j(i)||typeof i.const!="string")continue;let a=r.get(i.const)??[];a.push(n),r.set(i.const,a)}return Object.fromEntries([...r].map(([n,i])=>{let a=Or(i),m=Ir(i,a);return[n,_t(a,m).filter(f=>!Qe.has(f.name)&&f.name!=="operation")]}))}function Er(e,t){let o=D(e);if(!o)return new Set;let r=wo.toJSONSchema(o.schema,{io:"input"});if(!j(r))return new Set;let n=wt(r),i=n.filter(m=>Bi(m,t)),a=i.length>0?i:n;return new Set(a.flatMap(m=>Q(m.properties)?Object.keys(m.properties):[]))}function Bi(e,t){if(!Q(e.properties))return!0;for(let[o,r]of Object.entries(t)){let n=e.properties[o];if(j(n)&&("const"in n&&r!==n.const||Array.isArray(n.enum)&&!n.enum.some(i=>i===r)))return!1}return!0}function zi(e){let t=[],o=typeof e.minimum=="number"?e.minimum:void 0,r=typeof e.maximum=="number"?e.maximum:void 0;return o!==void 0&&r!==void 0?t.push(`${o}-${r}`):o!==void 0?t.push(`>=${o}`):r!==void 0&&t.push(`<=${r}`),"default"in e&&t.push(`default ${JSON.stringify(e.default)}`),t.length>0?t.join(", "):void 0}function Lt(e){if("const"in e)return`enum(${String(e.const)})`;if(Array.isArray(e.enum)&&e.enum.length>0)return`enum(${e.enum.map(String).join(", ")})`;if(e.type==="array"){let o=j(e.items)?e.items:void 0;return`array<${o?Lt(o):"value"}>`}let t=Array.isArray(e.anyOf)?e.anyOf:Array.isArray(e.oneOf)?e.oneOf:void 0;if(t){let o=t.filter(j).map(Lt).filter(r=>r!=="value");if(o.length>0)return[...new Set(o)].join(" | ")}return Array.isArray(e.type)?e.type.join(" | "):typeof e.type=="string"?e.type:"value"}function wt(e){return Q(e.properties)?[e]:(Array.isArray(e.anyOf)?e.anyOf:Array.isArray(e.oneOf)?e.oneOf:[]).filter(j).flatMap(o=>wt(o))}function Or(e){let t=new Map;for(let o of e)if(Q(o.properties))for(let[r,n]of Object.entries(o.properties)){if(!j(n))continue;let i=t.get(r)??[];i.push(n),t.set(r,i)}return Object.fromEntries([...t].map(([o,r])=>{let n=r.filter(a=>"const"in a).map(a=>a.const);return n.length===r.length?[o,{enum:[...new Set(n)],description:o==="operation"?"Required operation selector.":r[0]?.description}]:new Set(r.map(Lt)).size>1?[o,{anyOf:r}]:[o,r[0]??{}]}))}function Ir(e,t){if(e.length===0)return new Set;let o=e.map(n=>new Set(Array.isArray(n.required)?n.required:[])),r=[...o[0]??new Set].filter(n=>o.every(i=>i.has(n)));return new Set(r.filter(n=>!Qe.has(n)&&!Co(t[n])))}function _t(e,t,o=""){let r=[];for(let[n,i]of Object.entries(e)){if(!o&&Qe.has(n))continue;let a=j(i)?i:{},m=o?`${o}.${n}`:n;if(r.push({name:m,required:t.has(n),type:Lt(a),constraints:zi(a),description:typeof a.description=="string"?a.description:void 0}),Q(a.properties)){let I=new Set(Array.isArray(a.required)?a.required.filter(E=>typeof E=="string"?!Co(a.properties?.[E]):!1):[]);r.push(..._t(a.properties,I,m))}let f=a.type==="array"&&j(a.items)?a.items:void 0;if(f&&Q(f.properties)){let I=new Set(Array.isArray(f.required)?f.required.filter(E=>typeof E=="string"?!Co(f.properties?.[E]):!1):[]);r.push(..._t(f.properties,I,m))}}return r}function Pr(e,t){if(t.startsWith("array<")){let o=t.slice(6,-1);return[Ar(e,o)]}return Ar(e,t)}function Ar(e,t){if(t.startsWith("enum("))return/^enum\(([^,)]+)/.exec(t)?.[1]??e;if(t==="integer"||t==="number")return e==="lineHint"?42:5;if(t==="boolean")return!0;switch(e){case"keywords":case"keywordsToSearch":case"query":case"text":return"runCLI";case"path":return".";case"uri":return"/path/to/file.ts";case"owner":return"bgauryy";case"repo":return"octocode";case"extension":return"ts";case"filename":return"package.json";case"language":return"TypeScript";case"symbolName":return"myFunction";case"name":case"packageName":return"zod";default:return e}}function Q(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function j(e){return Q(e)}function Co(e){return j(e)&&"default"in e}function kr(e){return e!==Ie?[]:[{label:"code search",query:{operation:"code",keywords:["localSearch"],owner:"bgauryy",repo:"octocode",pageSize:5}},{label:"repository search",query:{operation:"repositories",keywords:["code research"],language:"TypeScript",pageSize:5}},{label:"repository tree",query:{operation:"tree",owner:"bgauryy",repo:"octocode",path:"packages",maxDepth:2}}]}function Hr(e){let t=kr(e);return t.length>0?t:e===fe?[{label:"PR search (list)",query:{operation:"pullRequests",owner:"bgauryy",repo:"octocode",keywords:["localSearch"],concise:!0,pageSize:5}},{label:"issue search (list)",query:{operation:"issues",owner:"bgauryy",repo:"octocode",keywords:["schema"],state:"open",pageSize:5}},{label:"commit history",query:{operation:"commits",owner:"bgauryy",repo:"octocode",path:"packages/octocode-tools-core/src",since:"6m",pageSize:10}}]:e===A.GITHUB_CLONE_REPO?[{label:"full repo clone",query:{owner:"bgauryy",repo:"octocode"}},{label:"subtree clone",query:{owner:"bgauryy",repo:"octocode",sparsePath:"packages/octocode-tools-core"}}]:e===he?[{label:"text anchors",query:{operation:"text",path:"/ABS/repo/src",searchText:"buildDirectToolCommandPatterns",maxFiles:20}},{label:"structural matches",query:{operation:"structural",path:"/ABS/repo/src",pattern:"eval($X)",langType:"typescript"}},{label:"file discovery",query:{operation:"files",path:"/ABS/repo",names:["package.json"],entryType:"f"}},{label:"tree orientation",query:{operation:"tree",path:"/ABS/repo/src",maxDepth:2}}]:e===A.LOCAL_FETCH_CONTENT?[{label:"exact line range",query:{path:"/ABS/repo/packages/octocode-tools-core/package.json",startLine:1,endLine:30,minify:"none"}},{label:"matched slice",query:{path:"/ABS/repo/packages/octocode-tools-core/src/tools/directToolCatalog.meta.ts",matchString:"buildKnownDirectToolCommandPatternQueries",contextLines:8,minify:"standard"}}]:e===de?[{label:"dead code from detected entrypoints",query:{operation:"deadCode",path:"/ABS/repo",limit:20}},{label:"cycles",query:{operation:"cycles",path:"/ABS/repo",limit:20}},{label:"dependencies of one file",query:{operation:"dependencies",path:"/ABS/repo",file:"src/index.ts",depth:2}},{label:"dependents of one file",query:{operation:"dependents",path:"/ABS/repo",file:"src/index.ts",depth:2}},{label:"shortest dependency path",query:{operation:"path",path:"/ABS/repo",file:"src/index.ts",target:"src/responses.ts"}},{label:"reachability from detected entrypoints",query:{operation:"reachability",path:"/ABS/repo",limit:20}}]:e===A.GITHUB_FETCH_CONTENT?[{label:"matched slice (cheap read of one function)",query:{owner:"bgauryy",repo:"octocode",path:"packages/octocode-tools-core/src/responses.ts",matchString:"export function cleanJsonObject",contextLines:8}},{label:"symbols outline (unknown/large file)",query:{owner:"bgauryy",repo:"octocode",path:"packages/octocode-tools-core/src/responses.ts",minify:"symbols"}}]:e===ge?[{label:"pull request detail",query:{operation:"pullRequest",owner:"bgauryy",repo:"octocode",number:1,content:{body:!0,patches:{mode:"all"}}}},{label:"issue detail",query:{operation:"issue",owner:"bgauryy",repo:"octocode",number:1,content:{body:!0,comments:{discussion:!0}}}},{label:"exact commit",query:{operation:"commit",owner:"bgauryy",repo:"octocode",ref:"main"}},{label:"compare two refs (base...head)",query:{operation:"compare",owner:"bgauryy",repo:"octocode",base:"main",head:"update-tools"}}]:e===A.PACKAGE_SEARCH?[{label:"exact package \u2192 source repo",query:{packageName:"zod"}},{label:"keyword discovery (paged candidates)",query:{keywords:["schema","validation"],page:1}}]:e===J?[{label:"symbol outline (absolute uri)",query:{uri:"/ABS/packages/octocode-tools-core/src/scheme/pagination.ts",type:"documentSymbols"}},{label:"semantic definition (absolute uri + lineHint)",query:{uri:"/ABS/packages/octocode-tools-core/src/scheme/pagination.ts",type:"definition",symbolName:"buildNextPageContinuation",lineHint:72}}]:[]}function Fr(e,t){return`tools ${e} --queries '${JSON.stringify(t)}'`}function ji(e){let t=Hr(e);if(t.length>0)return t.map(r=>({...r,command:Fr(e,r.query)}));let o=Ui(e);return Object.keys(o).length===0?[]:[{label:"schema-derived",query:o,command:Fr(e,o)}]}function Jp(e){return ji(e)[0]?.query??{}}function Ui(e){if(!D(e))return{};let t=Ct(e),o=t.filter(i=>!i.name.includes(".")),r=qi(o),n={};for(let i of r)n[i.name]=Pr(i.name,i.type);return e.startsWith("lsp")&&t.some(i=>i.name==="uri")&&(n.uri??="uri"),e===J&&(n.type??="definition",n.symbolName??="symbolName",n.lineHint??=1),n}var Dr=4,Ao=new Map([["keywords",10],["keywordsToSearch",11],["query",12],["text",13],["packageName",14],["name",15],["uri",20],["type",21],["owner",30],["repo",31],["extension",32],["filename",33],["language",34],["path",40],["target",50],["from",51],["scope",52],["pattern",60],["rule",61],["op",80],["operation",81],["minify",90]]),Nr=new Set(["page","itemsPerPage","limit","pageSize","matchPage","maxFiles","maxMatchesPerFile","matchContentLength","responseCharLength","responseCharOffset"]);function qi(e){let t=e.filter(i=>i.required),o=new Map;for(let i of t)o.set(i.name,i);let r=e.filter(i=>!i.required&&Xi(i)).sort(Zi),n=Math.max(Dr,t.length);for(let i of r){if(o.size>=n)break;o.set(i.name,i)}return o.size>0?[...o.values()]:e.filter(i=>!Nr.has(i.name)).filter(i=>i.type!=="boolean").slice(0,Dr)}function Xi(e){return Nr.has(e.name)||e.type==="boolean"?!1:Vi(e)?Ao.has(e.name):!0}function Zi(e,t){let o=Ao.get(e.name)??Number.MAX_SAFE_INTEGER,r=Ao.get(t.name)??Number.MAX_SAFE_INTEGER;return o!==r?o-r:e.name.localeCompare(t.name)}function Vi(e){return e.constraints?.includes("default ")===!0}import{z as vr}from"zod";import{z as $i}from"zod";function At(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Mr(e){return At(e.properties)?[e]:(Array.isArray(e.anyOf)?e.anyOf:Array.isArray(e.oneOf)?e.oneOf:[]).filter(At).flatMap(Mr)}function Wi(e){let t=D(e)?.schema;if(!t)return new Map;let o=$i.toJSONSchema(t),r=new Map;for(let n of Mr(o)){if(!At(n.properties))continue;let i=n.properties.operation;if(!At(i)||typeof i.const!="string")continue;let a=r.get(i.const)??new Set;for(let m of Object.keys(n.properties))["goal","reasoning","operation"].includes(m)||a.add(m);r.set(i.const,a)}return new Map([...r].map(([n,i])=>[n,[...i]]))}function Eo(e){if(e==="ghSearch"){let[t,...o]=Ye(e);return[...t?[t]:[],"code and repositories need at least one search term or scope filter.",...o]}return e==="localSearch"?["text needs searchText.","structural needs exactly one of pattern or rule.","Fields from different operations cannot be mixed."]:e==="ghSearchHistory"?["Choose pullRequests, issues, or commits; fields cannot cross operations.","issues and commits require owner+repo; pullRequests may search globally.","Search/list operations reject exact identities, content, and diff pagination."]:e==="ghGetHistoryItem"?["Every operation requires owner+repo.","pullRequest and issue need number; commit needs ref; compare needs base+head.","Fields and pagination axes cannot cross operations."]:Ye(e)}function Gr(e){let t=Wi(e);return(e==="ghSearchHistory"?[{name:"pullRequests",when:"Search or list pull requests",requires:["operation"],example:{operation:"pullRequests",keywords:["schema"]}},{name:"issues",when:"Search or list issues",requires:["operation","owner","repo"],example:{operation:"issues",owner:"o",repo:"r"}},{name:"commits",when:"List commit history",requires:["operation","owner","repo"],example:{operation:"commits",owner:"o",repo:"r"}}]:e==="ghGetHistoryItem"?[{name:"pullRequest",when:"Retrieve one pull request",requires:["operation","owner","repo","number"],example:{operation:"pullRequest",owner:"o",repo:"r",number:1}},{name:"issue",when:"Retrieve one issue",requires:["operation","owner","repo","number"],example:{operation:"issue",owner:"o",repo:"r",number:1}},{name:"commit",when:"Retrieve one commit",requires:["operation","owner","repo","ref"],example:{operation:"commit",owner:"o",repo:"r",ref:"main"}},{name:"compare",when:"Compare two refs",requires:["operation","owner","repo","base","head"],example:{operation:"compare",owner:"o",repo:"r",base:"main",head:"next"}}]:Ot(e)).map(r=>({...r,...e==="localSearch"&&r.name==="structural"?{requires:["operation","path"]}:{},...e==="lspGetSemantics"&&r.name==="workspace"?{requires:["type","symbolName"]}:{},...t.has(r.name)?{fields:t.get(r.name)}:{}}))}function cu(e,t,o={}){if(typeof t!="string")return null;let r;try{r=JSON.parse(t)}catch{throw new K("Tool input must be valid JSON.")}return Yi(e,r,o)}function Yi(e,t,o={}){let r=ea(e,t,o),n=D(e);if(!n)throw new K(`Unknown tool: ${e}`);let i=n.inputSchema.safeParse(r);if(!i.success)throw new K("Check the query fields.",[...Ji(e),...Ki(i.error)]);return i.data}function Ji(e){if(e==="npmSearch")return Eo(e).slice(0,1);if(e==="localSearch"){let t=Gr(e).map(o=>o.name);return t.length>0?[`operation must be one of ${t.map((o,r)=>r===t.length-1&&t.length>1?`or ${o}`:o).join(", ")}.`]:[]}if(e==="lspGetSemantics"){let t=Eo(e);return t.length>0?[t.join(" ")]:[]}return[]}function Ki(e){let t=o=>{let r=o.errors;if(o.code!=="invalid_union"||!Array.isArray(r))return[o];let n=r.filter(a=>Array.isArray(a));return n.length===0?[o]:n.reduce((a,m)=>m.length<a.length?m:a).map(a=>({...a,path:[...o.path,...a.path]}))};return e.issues.flatMap(t).map(o=>`${o.path.length>0?o.path.join("."):"input"}: ${o.message}`)}function ea(e,t,o){let r=[];if(Array.isArray(t))r=t;else if(Q(t)&&Array.isArray(t.queries))r=t.queries;else if(Q(t))r=[t];else throw new K('Tool input must be a JSON object, an array of query objects, or { "queries": [...] }.');if(r.length===0)throw new K("At least one query is required.");let n=Q(t)&&Array.isArray(t.queries)?Object.fromEntries(Object.entries(t).filter(([a])=>a!=="queries")):{},i=r.map((a,m)=>ta(e,aa(e,a,m,o),{sourceLabel:o.sourceLabel}));return{...n,queries:i}}function ta(e,t,o){let r={...t},n=o.sourceLabel??"direct tool execution",i=oa(e,n);return(typeof r.goal!="string"||r.goal.trim().length===0)&&(r.goal=i),(typeof r.reasoning!="string"||r.reasoning.trim().length===0)&&(r.reasoning=`Executed via ${n} tool command`),r}function oa(e,t){return`Execute ${e} via ${t}`}function ra(e,t){let o=e.length+1,r=t.length+1,n=Array.from({length:o*r},()=>0);for(let i=0;i<o;i++)n[i*r]=i;for(let i=0;i<r;i++)n[i]=i;for(let i=1;i<o;i++)for(let a=1;a<r;a++){let m=e[i-1]===t[a-1]?0:1;n[i*r+a]=Math.min(n[(i-1)*r+a]+1,n[i*r+a-1]+1,n[(i-1)*r+a-1]+m)}return n[o*r-1]}function na(e,t){let o=e.toLowerCase(),r,n=Number.POSITIVE_INFINITY,i,a=Number.POSITIVE_INFINITY;for(let m of t){let f=m.toLowerCase(),I=ra(o,f);if(f.includes(o)||o.includes(f)){I<n&&(r=m,n=I);continue}if(o.length<3)continue;let E=Math.max(2,Math.floor(m.length/3));I<=E&&I<a&&(i=m,a=I)}return r??i}var ia={npmSearch:{name:"packageName"},lspGetSemantics:{op:"type",line:"lineHint",path:"uri",itemsPerPage:"pageSize",limit:""},localGetFileContent:{filePath:"path"},localSearch:{itemsPerPage:"pageSize",maxResults:["maxFiles","limit","pageSize"],keywords:"searchText",language:"langType",regexType:"regex",sortBy:"sort",sortReverse:"reverse"},ghGetFileContent:{matchStringContextLines:"contextLines",minified:"minify"},ghSearch:{itemsPerPage:"pageSize",limit:"",topicsToSearch:"topics"},localAnalyzeGraph:{itemsPerPage:"pageSize",maxResults:"limit",maxDepth:"depth"}};function aa(e,t,o,r={}){if(!Q(t))throw new K("Tool input must be a JSON object or an array of objects.");let n=new Set([...Ct(e).filter(m=>!m.name.includes(".")).map(m=>m.name),...Qr(D(e)?.schema),...Qe]),i={},a=[];for(let[m,f]of Object.entries(t)){if(n.has(m)){i[m]=f;continue}a.push(m)}if(a.length>0&&n.size>0&&(r.onUnknownFields?.(a,o),r.rejectUnknownFields===!0)){let m=Er(e,t),f=a.map(I=>{let E=ia[e]?.[I],Po=(Array.isArray(E)?E:E===void 0?[]:[E]).find(zr=>m.has(zr))??na(I,m);return Po?`'${I}' \u2192 did you mean '${Po}'?`:""}).filter(Boolean);throw new K(`Unknown field(s): ${a.join(", ")}`,[...f,`Remove unknown field(s) from query ${o+1}: ${a.join(", ")}`,`Run tools ${e} --scheme to see valid fields.`])}return i}function Qr(e){if(!e)return[];if(e instanceof vr.ZodObject)return Object.keys(e.shape);let t=e.options,o=e instanceof vr.ZodUnion?e.options:Array.isArray(t)?t:[];return o.length>0?[...new Set(o.flatMap(r=>Qr(r)))]:[]}function yu(e){let t=[],o=[];return!e||typeof e!="object"?(t.push("Query must be an object"),{isValid:!1,errors:t,warnings:o}):(e.mode!=="structural"&&(!e.searchText||typeof e.searchText!="string")&&t.push("`searchText` is required"),e.matchWindow!==void 0&&e.output!=="matchOnly"&&t.push('`matchWindow` requires output:"matchOnly"'),(e.unique==="list"||e.unique==="count")&&e.output!=="matchOnly"&&t.push('`unique` requires output:"matchOnly"'),{isValid:t.length===0,errors:t,warnings:o})}function Su(e){if(!e||typeof e!="object")return e;let t=e.mode;if(!t||typeof t!="string")return e;let o={...e};return t==="discovery"?o.output==="content"&&(o.output="files"):t==="detailed"&&o.contextLines===void 0&&(o.contextLines=3),o}import{SYSTEM_PROMPT as sa}from"@octocodeai/octocode-core";var Br={systemPrompt:sa,toolNames:G,baseSchema:Be,tools:Object.fromEntries(Cr.map(e=>[e.name,{description:e.description}]))};var Oo=null;function ca(){return Oo||(Oo=Br),Oo}async function la(){return ca()}export{Qe as DIRECT_TOOL_AUTO_FILLED_FIELDS,xr as DIRECT_TOOL_CATEGORIES,_r as DIRECT_TOOL_DEFINITIONS,Cr as DIRECT_TOOL_DISCOVERY_DEFINITIONS,K as DirectToolInputError,A as STATIC_TOOL_NAMES,Su as applyWorkflowMode,ji as buildDirectToolCommandPatterns,Jp as buildDirectToolExampleQuery,Pr as buildExampleValue,Ar as buildScalarExampleValue,_t as collectDisplayFields,zi as describeSchemaConstraints,Lt as describeSchemaType,D as findDirectToolDefinition,Fr as formatDirectToolCommandPattern,Dp as formatDirectToolMetadataSchemaText,Fp as formatDirectToolSchemaText,Ki as formatDirectToolValidationIssues,Er as getDirectToolAllowedFieldNames,Np as getDirectToolAutoFilledFields,Lr as getDirectToolCategory,Mp as getDirectToolDescription,Ct as getDirectToolDisplayFields,Eo as getDirectToolSchemaRelations,Gr as getDirectToolSchemaVariants,Bp as getDirectToolVariantDisplayFields,Co as hasSchemaDefault,j as isJsonSchemaObject,Q as isRecord,la as loadToolContent,Yi as prepareDirectToolInput,cu as prepareDirectToolInputFromJsonText,Ip as sortDirectToolNames,yu as validateRipgrepQuery};
|
|
10
|
+
documentSymbols/diagnostic need uri; workspaceSymbol needs symbolName; other operations need uri+symbolName+lineHint. orderHint resolves same-line names. format:"compact" saves tokens. Empty/unavailable results call for a new anchor or text search.`};import{z as Ne}from"zod";import{z as Be}from"zod";var Pe=100,De=1e3,xn=1e8,Rn=5e4,X=1e9,Zt=1e5,Qe=20,lt=100,je=1e4,me=50,$=100,V=30,Xt=200,Wt=100;var $t=1e5,Vt=500,pt=1e5,Yt=1e3,Jt=20,Kt=100,eo=20;function _(e){return{...e,description:e.instructions}}function c(e,t){return Be.number().int().min(e).max(t)}var C=Be.array(Be.string()).optional();function L(){return c(1,De).default(1)}function E(){return c(1,De).optional()}function Ue(){return c(0,Pe).optional()}function de(){return c(1,X).optional()}function H(){return c(0,xn).optional()}function U(){return c(1,Rn).optional()}var m=ct.shape,Cn=new Set(Object.keys(m)),wn={owner:"Repository owner (user or org).",repo:"Repository name, without the owner.",branch:"Branch, tag, or commit SHA; omit for the default branch.",path:"Target path. GitHub tools: repo-relative, exact case, no leading slash. Local tools: absolute path.",page:"Result page, 1-based. Advance only while pagination.hasMore.",itemsPerPage:"Items per result page.",limit:"Total result cap applied before pagination.",pageSize:"Results returned in one page.",contextLines:"Extra source lines around each match/anchor.",charLength:"Content-window length; continue with the returned offset when partial.",charOffset:"Content-window start; copy the returned offset. A partial window cannot prove absence."};function p(e,t,o=""){let n={};for(let r of Object.keys(t)){let i=t[r],a=o?`${o}.${r}`:r,u=o===""&&Cn.has(r)?ze[a]:e[a]??(i.description?void 0:wn[r]);n[r]=u?i.describe(u):i}return Be.object(n).strict()}function qe(e,t){let o=e.fullContent===!0,n=e.matchString!==void 0,r=e.startLine!==void 0||e.endLine!==void 0;o&&n&&t.addIssue({code:"custom",message:"Choose fullContent or matchString.",path:["matchString"]}),o&&r&&t.addIssue({code:"custom",message:"Choose fullContent or startLine/endLine.",path:["startLine"]}),n&&r&&t.addIssue({code:"custom",message:"Choose matchString or startLine/endLine.",path:["startLine"]}),e.startLine===void 0!=(e.endLine===void 0)&&t.addIssue({code:"custom",message:"Set startLine and endLine together.",path:[e.startLine===void 0?"startLine":"endLine"]}),e.startLine!==void 0&&e.endLine!==void 0&&e.endLine<e.startLine&&t.addIssue({code:"custom",message:"Set endLine greater than or equal to startLine.",path:["endLine"]})}var Ln=_({name:"ghCloneRepo",type:"Github",shortDescription:"Clone a GitHub repo or subtree locally for repeated reads, search, or LSP.",instructions:T.ghCloneRepo,schema:{branch:"Branch, tag, or full 40-character commit SHA to check out; defaults to the repository default branch.",sparsePath:"Bound checkout to a repo-relative file/dir.",forceRefresh:"Bypass cached clone."}}),to=p(Ln.schema,{...m,owner:Ne.string(),repo:Ne.string(),branch:Ne.string().optional(),sparsePath:Ne.string().optional(),forceRefresh:Ne.boolean().optional()});import{z as he}from"zod";function d(e,t){return he.preprocess(o=>typeof o=="number"&&Number.isFinite(o)?Math.min(Math.max(o,e),t):o,he.number().int().min(e).max(t))}var ae=d(1,1e3).optional().default(1),Ze=d(0,100).optional(),fe=d(1,1e9).optional(),B=he.preprocess(e=>typeof e=="number"&&Number.isFinite(e)?Math.max(e,0):e,he.number().nonnegative().refine(Number.isSafeInteger,"Expected a safe non-negative integer")),En={responseCharOffset:B.optional().describe("Full-response char offset; re-call with returned value when hasMore."),responseCharLength:d(1,5e4).optional().describe("Full-response char window.")};function f(e,t={}){let{maxQueries:o=5}=t;return he.object({queries:he.array(e).min(1).max(o).describe("Parallel queries; response rows use matching zero-based indexes."),...En}).strict()}import{z as oo}from"zod";function On(e,t){return e?.description&&!t.description?t.describe(e.description):t}function no(e,t){let o={};for(let[n,r]of Object.entries(t))o[n]=On(e.shape[n],r);return o}function In(e,t){let o=e;return o.safeExtend?o.safeExtend(t):e.extend(t)}function ro(e,t){if(!t?.length)return e;let o=new Set(t);return oo.object(Object.fromEntries(Object.entries(e.shape).filter(([n])=>!o.has(n))))}function P(e,t={},o={}){let n=ro(e,o.omit);return In(n,no(n,t)).strict()}function M(e,t={},o={}){let n=ro(e,o.omit);return oo.object({...n.shape,...no(n,t)}).strict()}var ut=P(to),io=f(ut);import{z as Y}from"zod";import{z as x}from"zod";var kn=_({name:"lspGetSemantics",type:"Local",shortDescription:"Run LSP semantic queries \u2014 definitions, references, call hierarchy, symbols, type hierarchy, diagnostics.",instructions:`Use a real search/read line anchor for semantic proof. references finds usages; callers incoming calls; callees outgoing calls; callHierarchy both. Fall back to references if call hierarchy is unavailable.
|
|
11
|
+
documentSymbols/diagnostic need uri; workspaceSymbol needs symbolName; other operations need uri+symbolName+lineHint. orderHint resolves same-line names. format:"compact" saves tokens. Empty/unavailable results call for a new anchor or text search.`,schema:{pageSize:"References or symbols returned per page.",page:"Reference/symbol result page.",snapshot:"Result-set token from next.nextPage; required after page 1. On paginationChanged, discard prior pages and execute next.restartPagination.",type:"Identity, usage, hierarchy, hover, symbol, or diagnostic operation.",uri:"Target file path/URI; required for every type except workspaceSymbol.",symbolName:"Bare anchored identifier, or fuzzy workspace symbol query.",lineHint:"Observed line containing symbolName.",orderHint:"Disambiguate repeated symbols on one line.",depth:"Call/type hierarchy depth; 0 is direct only.",includeDeclaration:"references: include the declaration; disable before unused analysis.",groupByFile:"references summary mode.",contextLines:"Lines of surrounding source shown around each result location.",format:'"compact" saves tokens; "structured" has typed locations.',workspaceRoot:"Use when auto-root is wrong.",rustContext:"Explicit Rust build context (requires a .rs uri). Features/target/cfgs select rust-analyzer semantics. buildScripts and procMacros default false; enabling either permits workspace code execution. procMacros requires buildScripts:true. Context partitions server reuse and pagination; syntax graphs remain unexpanded."}}),mt=p(kn.schema,{...m,uri:x.string().optional(),type:x.enum(["definition","references","callers","callees","callHierarchy","hover","documentSymbols","typeDefinition","implementation","workspaceSymbol","supertypes","subtypes","diagnostic"]).default("definition"),symbolName:x.string().min(1).optional(),lineHint:c(1,X).optional(),orderHint:c(0,Zt).default(0),depth:c(0,Jt).optional(),includeDeclaration:x.boolean().default(!0),groupByFile:x.boolean().optional(),page:L(),pageSize:c(1,Kt).optional(),snapshot:x.string().min(1).max(128).optional(),contextLines:Ue(),format:x.enum(["structured","compact"]).default("structured"),workspaceRoot:x.string().optional(),rustContext:x.object({features:x.union([x.literal("all"),x.array(x.string().min(1).max(128)).max(128)]).default([]),noDefaultFeatures:x.boolean().default(!1),target:x.string().min(1).max(256).optional(),cfgs:x.array(x.string().min(1).max(256)).max(128).default([]),buildScripts:x.boolean().default(!1),procMacros:x.boolean().default(!1)}).strict().superRefine((e,t)=>{e.procMacros&&!e.buildScripts&&t.addIssue({code:"custom",path:["procMacros"],message:"procMacros requires buildScripts:true because rust-analyzer builds procedural macros through Cargo."})}).optional()}).superRefine((e,t)=>{if(e.rustContext&&!e.uri?.toLowerCase().endsWith(".rs")&&t.addIssue({code:"custom",path:["rustContext"],message:"rustContext requires a Rust .rs uri, including for workspaceSymbol."}),e.type==="workspaceSymbol"){e.symbolName||t.addIssue({code:"custom",path:["symbolName"],message:"Set symbolName for workspaceSymbol."});return}e.uri||t.addIssue({code:"custom",path:["uri"],message:"Set uri for file-scoped operations."}),!(e.type==="documentSymbols"||e.type==="diagnostic")&&(e.symbolName||t.addIssue({code:"custom",path:["symbolName"],message:"Set symbolName for anchored operations."}),Number.isInteger(e.lineHint)||t.addIssue({code:"custom",path:["lineHint"],message:"Set lineHint for anchored operations."}))});import{z as Q}from"zod";var so=["fullContent","matchString","matchStringIsRegex","matchStringCaseSensitive","startLine","endLine"],Pn=[...so,"contextLines","charOffset","charLength","minify"];function co(e,t){let o=new Set(t);return Object.fromEntries(Object.entries(e).filter(([n])=>!o.has(n)))}function Xe(e,t){return e.description?t.describe(e.description):t}function g(e,t){let o=e[t];if(!o)throw new TypeError(`Expected schema field: ${t}`);return o}function b(e,t){return g(e,t).nonoptional()}function ao(e,t){let o=co(e.shape,[...so,...t?["type"]:[]]),n=t?{type:t}:{},r=Xe(g(e.shape,"fullContent"),Q.literal(!1).optional()),i=Xe(g(e.shape,"fullContent"),Q.literal(!0)),a=Q.object({...o,...n,fullContent:r}).strict(),l=Q.object({...o,...n,fullContent:i}).strict(),u=Q.object({...o,...n,fullContent:r,matchString:b(e.shape,"matchString"),matchStringIsRegex:g(e.shape,"matchStringIsRegex"),matchStringCaseSensitive:g(e.shape,"matchStringCaseSensitive")}).strict(),A=Q.object({...o,...n,fullContent:r,startLine:b(e.shape,"startLine"),endLine:b(e.shape,"endLine")}).strict().superRefine((w,Ut)=>{typeof w.startLine=="number"&&typeof w.endLine=="number"&&w.endLine<w.startLine&&Ut.addIssue({code:"custom",path:["endLine"],message:"Set endLine greater than or equal to startLine."})});return[a,l,u,A]}function We(e,t={}){let o=(l,u)=>{l.minify==="symbols"&&(l.matchString!==void 0||l.startLine!==void 0||l.endLine!==void 0)&&u.addIssue({code:"custom",path:["minify"],message:'minify:"symbols" cannot be combined with matchString or startLine/endLine. Read the outline, then request a source slice.'})};if(!t.githubDirectoryMode)return Q.union(ao(e)).superRefine(o);let n=Xe(g(e.shape,"type"),Q.literal("file").optional()),r=Xe(g(e.shape,"type"),Q.literal("directory")),i=co(e.shape,[...Pn,"type"]),a=Q.object({...i,type:r}).strict();return Q.union([...ao(e,n),a]).superRefine(o)}var lo=["definition","references","callers","callees","callHierarchy","hover","documentSymbols","typeDefinition","implementation","workspaceSymbol","supertypes","subtypes","diagnostic"];var Nn=d(1,1e9),Fn=d(0,1e5).optional(),vn=["structured","compact"],po={type:Y.enum(lo).default("definition"),symbolName:Y.string().min(1).max(1024).optional(),lineHint:Nn.optional(),orderHint:Fn,depth:d(0,20).optional(),includeDeclaration:Y.boolean().optional().default(!0),page:ae,pageSize:d(1,100).optional(),contextLines:d(0,100).optional(),format:Y.enum(vn).optional().default("structured")},J=M(mt,po),Hn=["definition","references","callers","callees","callHierarchy","hover","typeDefinition","implementation","supertypes","subtypes"],Mn=["documentSymbols","diagnostic"],Gn=J.extend({type:Y.enum(Hn).optional(),uri:b(J.shape,"uri"),symbolName:b(J.shape,"symbolName"),lineHint:b(J.shape,"lineHint")}),zn=J.extend({type:Y.enum(Mn),uri:b(J.shape,"uri")}),Bn=J.extend({type:Y.literal("workspaceSymbol"),symbolName:b(J.shape,"symbolName")}),uo=P(mt,po),mo=f(Y.union([Gn,zn,Bn]),{maxQueries:5});import{z as jn}from"zod";import{z as j}from"zod";var Qn=_({name:"ghGetFileContent",type:"Github",shortDescription:"Read a file or a specific region from a GitHub repository.",instructions:T.ghGetFileContent,schema:{branch:"Exact branch, tag, or commit ref; defaults to the repository default branch.",startLine:"Requires endLine; exclusive with fullContent/matchString.",endLine:"Requires startLine; must be >= startLine.",fullContent:"Whole file, default minify:none; only explicit character windows paginate. Exclusive with range/match.",matchString:"Anchor returning padded matchRanges and exact matchedLines; preserves matched text without minification.",matchStringIsRegex:"Makes matchString a regex.",matchStringCaseSensitive:"Case-sensitive matchString.",type:'"file" reads; "directory" materializes localPath when clone/local access is enabled\u2014otherwise use ghSearch operation:"tree".',forceRefresh:"Bypass the 24h fetch cache and re-read from GitHub.",charOffset:"Character continuation offset; copy the complete returned next query.",minify:'"symbols" paginated outline (no range/match selectors), "standard" compact source, "none" unminified. Security redaction applies. Default none for fullContent, standard otherwise; matches force none.'}}),dt=p(Qn.schema,{...m,owner:j.string(),repo:j.string(),branch:j.string().optional(),path:j.string(),startLine:de(),endLine:de(),fullContent:j.boolean().optional(),matchString:j.string().optional(),matchStringIsRegex:j.boolean().optional(),matchStringCaseSensitive:j.boolean().optional(),forceRefresh:j.boolean().optional(),type:j.enum(["file","directory"]).default("file"),contextLines:c(0,Pe).default(5),charOffset:H(),charLength:U(),minify:j.enum(["none","standard","symbols"]).default("standard")}).superRefine(qe);var Un=jn.enum(["none","standard","symbols"]).optional(),ho={startLine:fe,endLine:fe,contextLines:Ze,charOffset:B.optional(),charLength:d(1,5e4).optional(),minify:Un},qn=M(dt,ho),fo=P(dt,ho),go=f(We(qn,{githubDirectoryMode:!0}));import{z as Ve}from"zod";import{z as K}from"zod";var Zn={keywords:"ANDed; keep a phrase as one item; alternatives need separate queries.",path:"Repo path prefix, not a full file path.",match:'For ghSearch operation:"code": "file" returns snippets and character matchIndices; "path" returns paths only. Operation:"repositories" uses text-field names.',extension:'File extension filter, e.g. "ts" (no dot).',filename:"Exact filename filter.",language:'GitHub language filter, e.g. "typescript".',concise:'Flat "owner/repo:path" rows.',limit:"Results per page (paginate with page)."},$e=p(Zn,{...m,keywords:C,owner:K.string().optional(),repo:K.string().optional(),extension:K.string().optional(),filename:K.string().optional(),path:K.string().optional(),language:K.string().optional(),match:K.enum(["file","path"]).default("file"),limit:c(1,$).default(V),page:L(),concise:K.boolean().optional()});import{z as O}from"zod";var Xn={keywords:"ANDed; keep a phrase as one item; alternatives need separate queries.",topicsToSearch:"ANDed topic filters; metadata can be sparse.",match:'For ghSearch operation:"repositories": text fields to search are name, description, and readme; readme is broader and slower. Operation:"code" uses "file" or "path".',sort:"stars, forks, updated, help-wanted-issues, best-match.",language:'Primary language filter, e.g. "rust".',stars:'Star range: ">100", "10..50".',forks:'Fork range: ">50", "10..100".',goodFirstIssues:'Good-first-issue count range, e.g. ">5".',updated:'Last push date: ">2024-01-01" or "a..b".',created:'Creation date: ">2023-01-01" or "a..b".',size:'Repo size in KB: ">1000", "50..500".',license:'SPDX id, e.g. "mit".',archived:"true = archived only; default excludes archived.",visibility:'"public" or "private" (private needs token scope).',concise:'Flat "owner/repo" rows for triage.',limit:"Results per page (paginate with page)."},Fe=p(Xn,{...m,keywords:C,topicsToSearch:C,language:O.string().optional(),owner:O.string().optional(),stars:O.string().optional(),forks:O.string().optional(),goodFirstIssues:O.string().optional(),updated:O.string().optional(),created:O.string().optional(),size:O.string().optional(),match:O.array(O.enum(["name","description","readme"])).optional(),sort:O.enum(["stars","forks","help-wanted-issues","updated","best-match"]).default("best-match"),limit:c(1,$).default(V),page:L(),archived:O.boolean().optional(),visibility:O.enum(["public","private"]).optional(),license:O.string().optional(),concise:O.boolean().optional()});import{z as ge}from"zod";var Wn={path:'Repo-relative directory; ""/"." for root.',branch:"Ref; fallback warning means default branch was used.",maxDepth:"Tree recursion depth.",page:"Advance only on hasMore.",metadataPage:"Page of the requested contributors, branches, or tags; follow next for each list independently.",include:"Optional sizes, languages, contributors, branches, or tags; each adds an API call."},ft=p(Wn,{...m,owner:ge.string(),repo:ge.string(),branch:ge.string().optional(),path:ge.string().optional(),maxDepth:c(0,eo).optional(),page:L(),metadataPage:L().optional(),itemsPerPage:c(1,Xt).default(Wt),include:ge.array(ge.enum(["sizes","languages","contributors","branches","tags"])).optional()});var Oa=_({name:"ghSearch",type:"Github",shortDescription:"Search GitHub code or repositories, or browse a repository tree.",instructions:T.ghSearch,schema:{operation:'Required: "code", "repositories", or "tree".'}}),$n=$e.omit({limit:!0}).extend({match:$e.shape.match.describe('For operation:"code": "file" returns snippets; "path" returns paths only.'),pageSize:$e.shape.limit.describe("Results returned per page."),operation:Ve.literal("code").describe("Search code contents or file paths.")}).strict(),Vn=Fe.omit({topicsToSearch:!0,limit:!0}).extend({topics:Fe.shape.topicsToSearch.describe("Repository topics; all must match."),pageSize:Fe.shape.limit.describe("Results returned per page."),match:Fe.shape.match.describe('For operation:"repositories": fields to search: name, description, or readme.'),operation:Ve.literal("repositories").describe("Discover repositories by keywords and repository filters.")}).strict(),Yn=ft.omit({itemsPerPage:!0}).extend({operation:Ve.literal("tree").describe("Browse the tree of a known repository."),pageSize:ft.shape.itemsPerPage.describe("Tree entries returned per page.")}).strict(),yo=Ve.discriminatedUnion("operation",[$n,Vn,Yn]);function yt(e){return typeof e=="string"&&e.trim().length>0}function gt(e){return Array.isArray(e)&&e.some(yt)}function Jn(e){return e.operation==="code"?gt(e.keywords)||["owner","path","extension","filename","language"].some(t=>yt(e[t])):e.operation==="repositories"?gt(e.keywords)||gt(e.topics)||["owner","language","stars","forks","goodFirstIssues","updated","created","size","visibility","license"].some(t=>yt(e[t]))||typeof e.archived=="boolean":!0}var bt=yo.superRefine((e,t)=>{Jn(e)||t.addIssue({code:"custom",path:["operation"],message:`${e.operation} needs at least one search term or scope filter`})}),bo=f(bt,{maxQueries:5});import{z as S}from"zod";var Kn="localAnalyzeGraph",va=_({name:Kn,type:"Local",shortDescription:"Analyze a repository file graph through one bounded operation.",instructions:"Map file topology, not symbol identity. dependencies/dependents need file; path needs file+target; deadCode/reachability accept roots; cycles needs no selector. Read completeness.results, completeness.graph, and completeness.diagnostics independently. Import edges and dead-code results are candidates\u2014verify changes and deletions with exact reads plus LSP.",schema:{path:"Absolute repository or package root to scan.",operation:"One bounded operation: deadCode, cycles, dependencies, dependents, path, or reachability.",file:"Repository-relative source file for dependencies, dependents, or path.",target:"Repository-relative destination file for path.",depth:"Traversal depth for dependencies or dependents.",entrypoints:"Repository-relative file or dynamic asset directory roots for deadCode or reachability.",includeTests:"Treat test files as reachability roots.",excludeDir:"Directory names to prune from graph construction.",maxFiles:"Maximum source files scanned; truncation is reported.",limit:"Result cap applied before pagination.",page:"Result page, 1-based; advance only while pagination.hasMore.",pageSize:"Results returned per page.",diagnosticPage:"Coverage diagnostic page, independent of result pagination.",diagnosticPageSize:"Coverage diagnostics per page (default 25).",diagnosticSnapshot:"Snapshot from next.nextDiagnostics; restart if diagnostics changed.",rustWorkspace:"Rust resolution: syntax (default) or opt-in cargo workspace metadata."}}),se=(e,t)=>S.preprocess(o=>typeof o=="number"&&Number.isFinite(o)?Math.min(Math.max(o,e),t):o,S.number().int().min(e).max(t)),ye=(e,t)=>S.literal(e).describe(t),be={...m,path:S.string().optional().describe("Absolute repository or package root to scan. Omit when file is absolute \u2014 the root is inferred by walking up to the nearest package.json."),excludeDir:S.array(S.string()).optional().describe("Directory names to prune from graph construction."),maxFiles:se(1,5e4).optional().describe("Maximum source files scanned; truncation is reported."),limit:se(1,5e3).optional().describe("Result cap applied before pagination."),page:se(1,De).optional().default(1).describe("Result page, 1-based."),pageSize:se(1,me).optional().describe("Results returned per page."),diagnosticPage:se(1,De).optional().describe("Coverage diagnostic page, 1-based and independent of result page."),diagnosticPageSize:se(1,100).optional().describe("Coverage diagnostics returned per page (default 25, maximum 100)."),diagnosticSnapshot:S.string().regex(/^[a-f0-9]{64}$/).optional().describe("Diagnostic snapshot from next.nextDiagnostics; detects changes between pages."),rustWorkspace:S.enum(["syntax","cargo"]).optional().describe("Rust resolution: syntax by default; cargo opts into workspace metadata.")},So={entrypoints:S.array(S.string()).optional().describe("Repo-relative file or dynamic asset directory roots; omit to detect package.json main/exports/bin."),includeTests:S.boolean().optional().default(!0).describe("Treat tests as reachability roots (default true).")},To={file:S.string().describe("Repo-relative source file."),depth:se(1,50).optional().default(1).describe("Maximum traversal depth (default 1).")},Ye=S.discriminatedUnion("operation",[S.object({...be,...So,operation:ye("deadCode","Find unreachable or unretained exported symbols and dead SCCs.")}).strict(),S.object({...be,operation:ye("cycles","Find strongly connected file components.")}).strict(),S.object({...be,...To,operation:ye("dependencies","Traverse files imported or re-exported by the source file; results include edgeKinds and syntactic confidence.")}).strict(),S.object({...be,...To,operation:ye("dependents","Traverse files that import or re-export the source file; results include edgeKinds and syntactic confidence.")}).strict(),S.object({...be,file:S.string().describe("Repo-relative source file."),target:S.string().describe("Repo-relative destination file."),operation:ye("path","Find the shortest directed import/re-export path with per-edge provenance.")}).strict(),S.object({...be,...So,operation:ye("reachability","Classify scanned files by reachability from entrypoints.")}).strict()]);var xo=f(Ye,{maxQueries:5});import{z as tr}from"zod";import{z as Se}from"zod";var er=_({name:"localGetFileContent",type:"Local",shortDescription:"Read a local file or a specific region.",instructions:`Read a known local path after search, find, or structure discovery. For large files, get a symbols outline, then an exact range or match. Read small config files whole with minify:"none".
|
|
12
|
+
Choose fullContent, matchString, or startLine+endLine. Partial content cannot prove absence; continue with the returned charOffset. matchedLines are LSP anchors; match ranges and character offsets are not. Report fetched bytes only.`,schema:{fullContent:"Whole file; small files only; exclusive with range/match.",matchString:"Anchor returning padded matchRanges and exact matchedLines.",matchStringIsRegex:"Makes matchString a regex.",matchStringCaseSensitive:"Case-sensitive matchString.",startLine:"Requires endLine; exclusive with fullContent/matchString.",endLine:"Requires startLine; must be >= startLine.",charOffset:"Copy the complete returned next query; semantic windows may expand beyond charLength.",minify:'"symbols" paginated outline (no range/match selectors), "standard" compact source, "none" unminified. Security redaction applies. Default none for fullContent/ranges, standard otherwise; matches force none.'}}),St=p(er.schema,{...m,path:Se.string(),fullContent:Se.boolean().optional(),matchString:Se.string().optional(),matchStringIsRegex:Se.boolean().optional(),matchStringCaseSensitive:Se.boolean().optional(),startLine:de(),endLine:de(),contextLines:c(0,Pe).default(5),charOffset:H(),charLength:U(),minify:Se.enum(["none","standard","symbols"]).default("standard")}).superRefine(qe);var or=tr.enum(["none","standard","symbols"]).optional(),Ro={startLine:fe,endLine:fe,contextLines:Ze.default(5),charOffset:B.optional(),charLength:d(1,5e4).optional(),minify:or},nr=M(St,Ro),Co=P(St,Ro),wo=f(We(nr),{maxQueries:5});import{z as ko}from"zod";import{z as G}from"zod";import{z as R}from"zod";var Tt={searchText:'Single lexical pattern. regex:"fixed" is literal and "perl" enables advanced syntax.',mode:'Search mode: "discovery" paths; "paginated" snippets; "detailed" context; "structural" AST.',pattern:"Structural code pattern: $X matches one node; $$$ARGS matches a list. Include modifiers or use a kind rule.",rule:"Structural YAML ast-grep rule for relational matches.",regex:'"smart" (default), "fixed" (literal), or "perl" (advanced).',caseMode:'"smart" (default), "sensitive", or "insensitive".',wholeWord:"Match whole words only (text/regex modes).",invertMatch:"Return non-matching lines (text/regex modes).",multiline:'"off" (default), "on", or "dotall" (. spans newlines).',include:"Glob(s) of files to include.",exclude:"Glob(s) of files to exclude.",excludeDir:"Directory names to prune from the walk.",noIgnore:"Also search .gitignored files.",hidden:"Include dot-files.",matchContentLength:"Matched-line characters kept per hit; longer lines are truncated.",maxFiles:"Text: page ceiling. Structural: scan cap; stats report truncation.",maxDepth:"Maximum levels below the search root; 0 means root files.",output:'"content" lines; "files"/"filesWithout" paths; count modes totals; "matchOnly" substrings.',unique:'With output:"matchOnly", deduplicate values or count frequency.',sort:'"relevance" (default), "matchCount", "path", "modified", "accessed", or "created".',sortReverse:"Reverse the sort order.",rankingProfile:'Language tuning for sort:"relevance"; "auto" detects.',langType:'Language/file type, e.g. "ts"; structural mode maps it to include globs.',captureText:"Structural: include verbatim $$$ list captures; ranges remain available when omitted.",maxMatchesPerFile:"Pairs with matchPage.",matchWindow:'Requires output:"matchOnly".',matchPage:"Per-file match page."},W=p(Tt,{...m,searchText:R.string().optional(),path:R.string(),mode:R.enum(["paginated","discovery","detailed","structural"]).default("paginated"),pattern:R.string().optional(),rule:R.string().optional(),regex:R.enum(["smart","fixed","perl"]).default("smart"),caseMode:R.enum(["smart","sensitive","insensitive"]).default("smart"),wholeWord:R.boolean().optional(),invertMatch:R.boolean().optional(),include:C,exclude:C,excludeDir:C,noIgnore:R.boolean().optional(),hidden:R.boolean().optional(),contextLines:Ue(),matchContentLength:c(1,$t).default(Vt),maxMatchesPerFile:c(1,pt).optional(),maxFiles:c(1,pt).optional(),maxDepth:c(0,Qe).optional(),multiline:R.enum(["off","on","dotall"]).default("off"),sort:R.enum(["relevance","matchCount","path","modified","accessed","created"]).default("relevance"),sortReverse:R.boolean().optional(),rankingProfile:R.enum(["auto","typescript","javascript","rust","python","go","java","scala","markdown","json","yaml","generic"]).default("auto"),langType:R.string().optional(),captureText:R.boolean().optional(),output:R.enum(["content","files","filesWithout","countLines","countMatches","matchOnly"]).default("content"),unique:R.enum(["off","list","count"]).default("off"),matchWindow:c(0,200).optional(),matchPage:E(),itemsPerPage:c(1,Yt).optional(),page:L()}).superRefine((e,t)=>{if(e.mode==="structural"){!e.pattern&&!e.rule&&t.addIssue({code:"custom",message:"Set pattern or rule for structural mode.",path:["pattern"]}),e.pattern&&e.rule&&t.addIssue({code:"custom",message:"Choose pattern or rule, not both.",path:["rule"]}),e.wholeWord&&t.addIssue({code:"custom",message:"Remove wholeWord in structural mode.",path:["wholeWord"]}),e.invertMatch&&t.addIssue({code:"custom",message:"Remove invertMatch in structural mode.",path:["invertMatch"]});for(let n of["regex","caseMode","multiline"]){let r=n==="multiline"?"off":"smart";e[n]!==r&&t.addIssue({code:"custom",message:`Remove ${n} in structural mode.`,path:[n]})}e.output!=="content"&&t.addIssue({code:"custom",message:"Remove output in structural mode.",path:["output"]}),e.unique!=="off"&&t.addIssue({code:"custom",message:"Remove unique in structural mode.",path:["unique"]})}else(e.pattern||e.rule)&&t.addIssue({code:"custom",message:"Use structural mode with pattern or rule.",path:[e.pattern?"pattern":"rule"]}),e.searchText||t.addIssue({code:"custom",message:"Set searchText for text modes.",path:["searchText"]});e.matchWindow!==void 0&&e.output!=="matchOnly"&&t.addIssue({code:"custom",message:'Use output:"matchOnly" with matchWindow.',path:["matchWindow"]}),e.unique!=="off"&&e.output!=="matchOnly"&&t.addIssue({code:"custom",message:'Use output:"matchOnly" with unique.',path:["unique"]})});import{z as D}from"zod";var Rt={maxDepth:"Maximum levels below path; 0 is direct entries.",minDepth:"Requires <= maxDepth when both set.",names:"Basename globs; ORed.",pathPattern:"Full-path glob.",regex:"Basename Rust regex.",empty:"Match only empty files/dirs.",time:"Time filters using d/h/w/m durations.","time.modifiedWithin":"Modified within this duration, e.g. 2d or 6h.","time.modifiedBefore":"Modified before this duration ago, e.g. 30d.","time.accessedWithin":"Accessed within this duration, e.g. 1w.",size:"Size range, e.g. 100k or 1m.","size.greater":"Minimum file size, e.g. 100k or 1m.","size.less":"Maximum file size, e.g. 500b or 2m.",extensions:'Extensions without dots, e.g. ["ts","tsx"].',excludeDir:"Directory names; generated/vendor dirs are pruned by default. Pass [] to prune nothing.",entryType:'"f" files, "d" dirs.',permissions:"Exact permission filter.",access:'"executable", "readable", or "writable" filter.',detail:'"basic" (default), "modified" (+mtime), or "full" (all metadata).',sortBy:'"modified" (default), "name", "path", or "size".',limit:"Post-sort result cap; pagination stays within it."},xt=Rt,ce=p(xt,{...m,path:D.string(),maxDepth:c(0,lt).optional(),minDepth:c(0,lt).optional(),names:C,pathPattern:D.string().optional(),regex:D.string().optional(),empty:D.boolean().optional(),time:p(xt,{modifiedWithin:D.string().optional(),modifiedBefore:D.string().optional(),accessedWithin:D.string().optional()},"time").optional(),size:p(xt,{greater:D.string().optional(),less:D.string().optional()},"size").optional(),permissions:D.string().optional(),access:D.enum(["executable","readable","writable"]).optional(),extensions:C,excludeDir:C,limit:c(1,je).optional(),detail:D.enum(["basic","modified","full"]).default("basic"),sortBy:D.enum(["modified","name","path","size"]).default("modified"),entryType:D.enum(["f","d"]).optional(),page:L(),itemsPerPage:c(1,me).optional()}).superRefine((e,t)=>{e.minDepth!==void 0&&e.maxDepth!==void 0&&e.minDepth>e.maxDepth&&t.addIssue({code:"custom",message:"minDepth must be less than or equal to maxDepth.",path:["minDepth"]})});import{z as ee}from"zod";var Ct={pattern:"Name glob or substring; use the files operation for regex.",entryType:'"f" files only, "d" dirs only; omit for both.',detail:'"basic" (default), "modified" (+mtime), or "full" (size/perms).',hidden:"Include dot-files/dirs.",recursive:"true enables the default recursive depth; omit with maxDepth for immediate children.",maxDepth:"Recursion depth. Omitted: immediate children, or 5 if recursive:true; maxDepth alone enables recursion, so recursive:true is not required. 0 uses those defaults.",extensions:"Allowlist without dots.",excludeDir:"Directories to prune; [] includes generated/vendor directories.",sortBy:'"name" (default), "size", "time", or "extension".',reverse:"Reverse the sort order.",limit:"Discovery cap before pagination."},Te=p(Ct,{...m,path:ee.string(),detail:ee.enum(["basic","modified","full"]).default("basic"),hidden:ee.boolean().optional(),sortBy:ee.enum(["name","size","time","extension"]).default("name"),reverse:ee.boolean().optional(),pattern:ee.string().optional(),entryType:ee.enum(["f","d"]).optional(),recursive:ee.boolean().optional(),extensions:C,excludeDir:C,maxDepth:c(0,Qe).optional(),limit:c(1,je).optional(),page:L(),itemsPerPage:c(1,me).optional()});var ve={...Tt};delete ve.mode;delete ve.output;delete ve.itemsPerPage;delete ve.sortReverse;var _o={...Ct};delete _o.recursive;var us=_({name:"localSearch",type:"Local",shortDescription:"Search local text, syntax, paths, or directory trees through one operation.",instructions:'Choose operation:"text" for lexical anchors, "structural" for AST matches, "files" for path or metadata discovery, and "tree" for directory orientation. Each operation has a strict branch, so do not mix fields across operations. Files/tree prune common generated and vendor directories by default; pass excludeDir:[] to prune nothing. Read exact hits with localGetFileContent and prove symbol identity with lspGetSemantics.',schema:{...Rt,..._o,...ve,operation:'Required branch: "text", "structural", "files", or "tree".',resultView:'Text/structural result shape. Text also supports "paginated", "discovery", and "detailed".',pattern:"Structural AST pattern.",namePattern:"Tree entry name glob or substring.",pathRegex:"Files operation: basename Rust regex.",limit:"Files/tree discovery cap before pagination.",pageSize:"Results returned per page.",sort:"Operation-specific sort order.",reverse:"Reverse the selected sort order."}}),Ao=G.object(W.shape),rr=G.object(ce.shape),ir=G.enum(["paginated","discovery","detailed","content","files","filesWithout","countLines","countMatches","matchOnly"]),ar=G.enum(["content","files","countLines","countMatches","matchOnly"]),sr=Ao.omit({pattern:!0,rule:!0,captureText:!0,mode:!0,output:!0,itemsPerPage:!0,sortReverse:!0}).extend({operation:G.literal("text").describe('Use "text" for lexical search.'),searchText:G.string().describe("Single lexical pattern."),resultView:ir.optional().default("paginated").describe("Text result shape; paginated is the default."),pageSize:W.shape.itemsPerPage.describe("Matches returned per page."),reverse:W.shape.sortReverse.describe("Reverse the selected sort order."),unique:W.shape.unique.describe('With resultView:"matchOnly", deduplicate values or count frequency.'),matchWindow:W.shape.matchWindow.describe('Requires resultView:"matchOnly".')}).strict(),Eo=Ao.omit({searchText:!0,pattern:!0,rule:!0,mode:!0,regex:!0,caseMode:!0,wholeWord:!0,invertMatch:!0,multiline:!0,unique:!0,matchWindow:!0,output:!0,itemsPerPage:!0,sortReverse:!0}).extend({operation:G.literal("structural").describe('Use "structural" for AST matching.'),resultView:ar.optional().default("content").describe("Structural result shape; content is the default."),pageSize:W.shape.itemsPerPage.describe("Matches returned per page."),reverse:W.shape.sortReverse.describe("Reverse the selected sort order.")}).strict(),cr=Eo.extend({pattern:G.string().describe("Structural AST pattern.")}).strict(),lr=Eo.extend({rule:G.string().describe("Structural YAML ast-grep rule.")}).strict(),pr=rr.omit({regex:!0,limit:!0,sortBy:!0,itemsPerPage:!0}).extend({operation:G.literal("files").describe('Use "files" for path and metadata discovery.'),pathRegex:ce.shape.regex.describe("Basename Rust regex."),limit:ce.shape.limit.describe("Post-sort discovery cap."),sort:ce.shape.sortBy.describe("File sort order."),pageSize:ce.shape.itemsPerPage.describe("Files returned per page.")}).strict(),ur=Te.omit({pattern:!0,recursive:!0,limit:!0,sortBy:!0,itemsPerPage:!0}).extend({operation:G.literal("tree").describe('Use "tree" for directory orientation.'),namePattern:Te.shape.pattern.describe("Entry name glob or substring."),limit:Te.shape.limit.describe("Discovery cap before pagination."),sort:Te.shape.sortBy.describe("Tree sort order."),pageSize:Te.shape.itemsPerPage.describe("Entries returned per page.")}).strict();function Lo(e,t){if("error"in e)for(let o of e.error.issues)o.code==="custom"&&t.addIssue({code:"custom",message:o.message,path:o.path})}var Oo=G.union([sr,cr,lr,pr,ur]).superRefine((e,t)=>{if(e.operation==="text"){let o=e.resultView,n={...e,itemsPerPage:e.pageSize,sortReverse:e.reverse};delete n.operation,delete n.resultView,delete n.pageSize,delete n.reverse;let r=["paginated","discovery","detailed"].includes(o)?{...n,mode:o}:{...n,mode:"paginated",output:o};Lo(W.safeParse(r),t);return}if(e.operation!=="structural"&&e.operation==="files"){let o={...e,regex:e.pathRegex,limit:e.limit,sortBy:e.sort,itemsPerPage:e.pageSize};delete o.operation,delete o.pathRegex,delete o.pageSize,delete o.sort,Lo(ce.safeParse(o),t)}});var[mr,dr,hr,fr,gr]=Oo.options,Io=ko.enum(["content","files","countMatches"]).optional().default("content").describe("Structural result shape; content is the default."),wt=ko.union([mr,dr.extend({resultView:Io}),hr.extend({resultView:Io}),fr,gr]),Po=f(wt,{maxQueries:5});import{z as le}from"zod";import{z as Je}from"zod";var yr=_({name:"npmSearch",type:"NPM",shortDescription:"Look up npm packages and find their source repositories.",instructions:T.npmSearch,schema:{keywords:"Discovery terms joined with spaces. Mutually exclusive with packageName.",packageName:"Exact package name; include scope for scoped packages.",page:"Keyword-result page only.",registry:"Optional registry URL overriding npm defaults and scope mappings. Credentials come from npm configuration, never tool arguments."}}),Lt=p(yr.schema,{...m,packageName:Je.string().trim().min(1).optional(),keywords:Je.array(Je.string().trim().min(1)).min(1).optional(),page:E(),registry:Je.string().url().refine(e=>{let t=new URL(e);return["http:","https:"].includes(t.protocol)&&!t.username&&!t.password&&!t.search&&!t.hash},"Use an HTTP(S) registry URL without credentials, query, or fragment.").optional()}).superRefine((e,t)=>{e.packageName===void 0&&e.keywords===void 0&&t.addIssue({code:"custom",path:["packageName"],message:"Set packageName or keywords."}),e.packageName!==void 0&&e.keywords!==void 0&&t.addIssue({code:"custom",path:["keywords"],message:"Set packageName or keywords, not both."}),e.packageName!==void 0&&e.page!==void 0&&t.addIssue({code:"custom",path:["page"],message:"page applies only to keyword discovery; omit it for an exact package lookup."})});var Do={page:ae.removeDefault(),pageSize:d(1,100).optional().describe("Packages returned per keyword-discovery page."),keywords:le.array(le.string()).optional()};function _t(e,t){let o=Array.isArray(e.keywords)?e.keywords.join(" ").trim():e.keywords?.trim();!e.packageName?.trim()&&!o&&t.addIssue({code:"custom",path:["packageName"],message:"provide packageName or keywords"}),e.packageName?.trim()&&o&&t.addIssue({code:"custom",path:["keywords"],message:"provide packageName or keywords, not both"}),e.packageName?.trim()&&e.pageSize!==void 0&&t.addIssue({code:"custom",path:["pageSize"],message:"pageSize is only available for keyword discovery"})}var No=P(Lt,Do).superRefine(_t),He=M(Lt,Do,{strict:!0}),Fo=He.omit({packageName:!0,keywords:!0,pageSize:!0,page:!0}).shape,br=le.object({...Fo,packageName:b(He.shape,"packageName")}).strict().superRefine((e,t)=>_t(e,t)),Sr=le.object({...Fo,keywords:le.array(le.string()).min(1).describe(g(He.shape,"keywords").description??""),pageSize:g(He.shape,"pageSize"),page:g(He.shape,"page")}).strict().superRefine((e,t)=>_t(e,t)),vo=f(le.union([br,Sr]),{maxQueries:5});import{z as Ge}from"zod";import{z as N}from"zod";var Tr={pageSize:"Commits returned per page (walk with page).",owner:"Repository owner.",repo:"Repository name.",keywords:"Commit-message words or phrases on the default branch; cannot combine with path, branch, compare, or diffs.",path:"File/dir prefix; trailing / scopes the subtree.",since:'Lower date bound: ISO date or relative window such as "30d".',until:"Upper date bound; same formats as since.",branch:"Ref to walk; defaults to the default branch.",includeDiff:"Attach diffs; prefer one commit or a tight window.",author:"Author login or email.",committer:"Committer login or email.",base:"Compare-mode base ref; set with head.",head:"Compare-mode head ref; set with base.",filePage:"Changed-file page from pagination.nextFilePage.",charOffset:"Patch offset from patchPagination.nextCharOffset.",charLength:"Patch-window length."},At=p(Tr,{...m,owner:N.string(),repo:N.string(),keywords:N.array(N.string().trim().min(1)).min(1).optional(),path:N.string().optional(),since:N.string().optional(),until:N.string().optional(),branch:N.string().optional(),author:N.string().optional(),committer:N.string().optional(),base:N.string().optional(),head:N.string().optional(),pageSize:c(1,100).optional().default(30),includeDiff:N.boolean().optional().default(!1),page:L(),filePage:E(),charOffset:H(),charLength:U()}).superRefine((e,t)=>{xe(e,t),(e.base&&!e.head||e.head&&!e.base)&&t.addIssue({code:"custom",path:[e.base?"head":"base"],message:"Set base and head together for compare mode."})});function xe(e,t){if(e.keywords?.length)for(let o of["path","branch","base","head","includeDiff"])e[o]!==void 0&&e[o]!==!1&&t.addIssue({code:"custom",path:[o],message:`Commit-message keywords cannot be combined with ${o}; search covers the default branch. Use history without keywords for path/ref filters and ghGetHistoryItem for diffs.`})}import{z as I}from"zod";import{z as s}from"zod";var Re={keywords:"PR search terms.",match:'PR text fields searched by keywords: title, body, comments. ghSearch operation:"code" instead uses match to select file content or paths.',prNumber:"PR detail mode; requires owner+repo.",concise:"PR list triage; list mode only.",state:"open, closed, or merged.",assignee:"Assigned GitHub login.",author:"PR author login.",commenter:"Commenter login.",mentions:"Mentioned login.","review-requested":"Requested reviewer login.","reviewed-by":"Reviewer login.",checks:"success, failure, or pending.",review:"approved, changes_requested, required, or none.",comments:'Comment-count range filter (">5"); not comment content.',reactions:'Reaction-count range filter (">10").',created:'Created date/range, e.g. ">2024-01-01" or "a..b".',updated:"Updated-date filter (same format as created).",closed:"Closed-date filter (same format as created).","merged-at":"Merged-date filter (same format as created).",head:"Head branch name filter.",base:"Base branch name filter.",label:"Label name(s); multiple are ANDed.",draft:"true = only drafts; false = exclude drafts.",archived:"Include PRs from archived repos.",sort:"created, updated, comments, reactions, best-match.",order:"asc/desc; asc+created helps archaeology.",filePage:"Changed-files page from contentPagination.",commentPage:"Comments page from contentPagination.",commitPage:"PR commits page within the current provider batch.",reviewPage:"Reviews page within the current provider batch; copy next.nextReviewsPage.",collectionPages:"Provider batch positions from next.*; copy unchanged. Zero marks an exhausted source. Each call fetches at most one page per requested source.",content:"Detail selector for prNumber.","content.body":"Include the PR description body.","content.changedFiles":"Include changed files and +/- counts.","content.patches":"Patch selector for changed files.","content.patches.mode":'"selected" or "all"; selected is cheapest.',"content.patches.files":'Restrict selected patches to these files (mode:"selected").',"content.patches.ranges":"Line ranges for selected patch hunks.","content.patches.ranges.file":"File the line range applies to.","content.patches.ranges.additions":"Added-side line numbers to include.","content.patches.ranges.deletions":"Deleted-side line numbers to include.","content.comments":"Select discussion and/or reviewInline explicitly; omitted surfaces are not fetched.","content.comments.discussion":"Include the PR conversation timeline.","content.comments.reviewInline":"Include inline review threads.","content.comments.includeBots":"Include bot/CI comments.","content.comments.file":"Filter comments to one file path.","content.reviews":"Include review verdicts per reviewer.","content.commits":"PR-bound commits selector.","content.commits.includeFiles":"Attach per-commit file changes.",matchString:"Substring filter for body/patch/comment windows.",charOffset:"Body/patch continuation offset from nextQuery.",commentBodyOffset:"Comment-body continuation offset from nextQuery.",minify:'"standard" compacts PR body/comments/reviews and trims diff context; "none" preserves selected text after redaction. Match reads retain source text. No symbols mode.',pageSize:"PRs or detail-list items returned per page."},Ce=p(Re,{...m,keywords:s.array(s.string()).optional(),prNumber:c(1,X).optional(),owner:s.string().optional(),repo:s.string().optional(),concise:s.boolean().optional(),state:s.enum(["open","closed","merged"]).optional(),assignee:s.string().optional(),author:s.string().optional(),commenter:s.string().optional(),mentions:s.string().optional(),"review-requested":s.string().optional(),"reviewed-by":s.string().optional(),label:s.array(s.string()).optional(),checks:s.enum(["success","failure","pending"]).optional(),review:s.enum(["approved","changes_requested","required","none"]).optional(),head:s.string().optional(),base:s.string().optional(),created:s.string().optional(),updated:s.string().optional(),closed:s.string().optional(),"merged-at":s.string().optional(),comments:s.string().optional(),reactions:s.string().optional(),draft:s.boolean().optional(),match:s.array(s.enum(["title","body","comments"])).optional(),sort:s.enum(["created","updated","best-match","comments","reactions"]).optional(),order:s.enum(["asc","desc"]).optional(),pageSize:c(1,$).default(V),page:E(),archived:s.boolean().optional(),filePage:E(),commentPage:E(),commitPage:E(),reviewPage:E(),collectionPages:s.object({changedFiles:s.number().int().min(0).max(30).optional(),discussion:s.number().int().min(0).max(Number.MAX_SAFE_INTEGER).optional(),inline:s.number().int().min(0).max(Number.MAX_SAFE_INTEGER).optional(),reviews:s.number().int().min(0).max(Number.MAX_SAFE_INTEGER).optional(),commits:s.number().int().min(0).max(5).optional()}).strict().optional(),content:p(Re,{body:s.literal(!0).optional(),changedFiles:s.literal(!0).optional(),patches:p(Re,{mode:s.enum(["selected","all"]),files:C,ranges:s.array(p(Re,{file:s.string(),additions:s.array(c(1,X)).optional(),deletions:s.array(c(1,X)).optional()},"content.patches.ranges")).optional()},"content.patches").optional(),comments:p(Re,{discussion:s.literal(!0).optional(),reviewInline:s.literal(!0).optional(),includeBots:s.literal(!0).optional(),file:s.string().optional()},"content.comments").refine(e=>e.discussion===!0||e.reviewInline===!0,{message:"content.comments needs discussion:true and/or reviewInline:true."}).optional(),reviews:s.literal(!0).optional(),commits:p(Re,{includeFiles:s.literal(!0).optional()},"content.commits").optional()},"content").optional(),matchString:s.string().optional(),commentBodyOffset:H(),charOffset:H(),charLength:U(),minify:s.enum(["none","standard"]).default("standard")}).superRefine((e,t)=>{let o=["content","filePage","commentPage","commitPage","reviewPage","collectionPages","matchString","commentBodyOffset","charOffset","charLength"],n=["keywords","concise","state","assignee","author","commenter","mentions","review-requested","reviewed-by","label","checks","review","head","base","created","updated","closed","merged-at","comments","reactions","draft","match","sort","order","page","archived"];if(e.prNumber===void 0)for(let u of o)e[u]!==void 0&&t.addIssue({code:"custom",message:`${u} requires prNumber detail mode.`,path:[u]});else{e.owner?.trim()||t.addIssue({code:"custom",message:"owner is required with prNumber.",path:["owner"]}),e.repo?.trim()||t.addIssue({code:"custom",message:"repo is required with prNumber.",path:["repo"]});for(let u of n)e[u]!==void 0&&t.addIssue({code:"custom",message:`${u} is only available in list mode.`,path:[u]})}e.content&&Object.keys(e.content).length===0&&t.addIssue({code:"custom",message:"content needs at least one selector.",path:["content"]});let r=e.content?.patches;if(!r)return;let i=(r.files?.length??0)>0,a=(r.ranges?.length??0)>0,l=i||a;r.mode==="selected"&&!l&&t.addIssue({code:"custom",message:'content.patches.mode="selected" requires non-empty files or ranges.',path:["content","patches","files"]}),r.mode!=="selected"&&l&&t.addIssue({code:"custom",message:'content.patches.files and content.patches.ranges require mode="selected".',path:["content","patches","mode"]})});import{z as h}from"zod";var Et={keywords:"Issue search terms.",match:"Keyword fields: title, body, comments.",issueNumber:"Issue detail mode; requires owner+repo.",concise:"Issue list triage; list mode only.",state:"open or closed.",assignee:"Assigned GitHub login.",author:"Issue author login.",commenter:"Commenter login.",mentions:"Mentioned login.",archived:"Include issues from archived repos.",comments:'Comment-count range filter (">5"); not comment content.',reactions:'Reaction-count range filter (">10").',created:'Created date/range, e.g. ">2024-01-01" or "a..b".',updated:"Updated-date filter (same format as created).",closed:"Closed-date filter (same format as created).",label:"Label name(s); multiple are ANDed.",sort:"created, updated, comments, reactions, best-match.",order:"asc/desc; asc+created helps archaeology.",commentPage:"Comments page from contentPagination.",content:"Detail selector for issueNumber.","content.body":"Include the issue description body.","content.comments":"Comment-thread selector.","content.comments.discussion":"Include the comment thread.","content.comments.includeBots":"Include bot/CI comments.",matchString:"Substring filter for body/comment windows.",charOffset:"Character offset in the selected issue body or comment bodies; follow next calls.",charLength:"Characters per selected body window (default 12000); commentPage selects comment items independently.",commentBodyOffset:"Comment-body continuation offset from nextQuery.",minify:"Search results contain metadata only; this setting does not alter metadata. Exact issue reads do not accept minify.",pageSize:"Issues or detail comments returned per page."},we=p(Et,{...m,owner:h.string(),repo:h.string(),keywords:h.array(h.string()).optional(),issueNumber:c(1,X).optional(),concise:h.boolean().optional(),state:h.enum(["open","closed"]).optional(),assignee:h.string().optional(),author:h.string().optional(),commenter:h.string().optional(),mentions:h.string().optional(),label:h.array(h.string()).optional(),created:h.string().optional(),updated:h.string().optional(),closed:h.string().optional(),comments:h.string().optional(),reactions:h.string().optional(),match:h.array(h.enum(["title","body","comments"])).optional(),sort:h.enum(["created","updated","best-match","comments","reactions"]).optional(),order:h.enum(["asc","desc"]).optional(),pageSize:c(1,$).default(V),page:E(),archived:h.boolean().optional(),commentPage:E(),content:p(Et,{body:h.literal(!0).optional(),comments:p(Et,{discussion:h.literal(!0).optional(),includeBots:h.literal(!0).optional()},"content.comments").optional()},"content").optional(),matchString:h.string().optional(),commentBodyOffset:H(),charOffset:H(),charLength:U(),minify:h.enum(["none","standard"]).default("standard")}).superRefine((e,t)=>{let o=["content","commentPage","matchString","commentBodyOffset","charOffset","charLength"],n=["keywords","concise","state","assignee","author","commenter","mentions","label","created","updated","closed","comments","reactions","match","sort","order","page","archived"];if(e.issueNumber===void 0)for(let r of o)e[r]!==void 0&&t.addIssue({code:"custom",message:`${r} requires issueNumber detail mode.`,path:[r]});else{e.owner?.trim()||t.addIssue({code:"custom",message:"owner is required with issueNumber.",path:["owner"]}),e.repo?.trim()||t.addIssue({code:"custom",message:"repo is required with issueNumber.",path:["repo"]});for(let r of n)e[r]!==void 0&&t.addIssue({code:"custom",message:`${r} is only available in list mode.`,path:[r]})}e.content&&Object.keys(e.content).length===0&&t.addIssue({code:"custom",message:"content needs at least one selector.",path:["content"]})});function _e(e,t,o){let n=e.safeParse(t);if(!n.success)for(let r of n.error.issues)o.addIssue({code:"custom",message:r.message,path:r.path})}function Mo(e){let t=e;for(;t instanceof I.ZodOptional||t instanceof I.ZodDefault;)t=t.unwrap();if(!(t instanceof I.ZodObject))throw new TypeError("Expected an object schema");return t}function Go(e){let t=e;for(;t instanceof I.ZodOptional||t instanceof I.ZodDefault;)t=t.unwrap();if(!(t instanceof I.ZodArray))throw new TypeError("Expected an array schema");return t}function Ae(e,t){return e.description?t.describe(e.description):t}var zo={pageSize:d(1,100).optional().default(30),page:d(1,1e3).optional()},Bo={...zo,filePage:d(1,1e3).optional(),commentPage:d(1,1e3).optional(),commitPage:d(1,1e3).optional(),charOffset:B.optional(),commentBodyOffset:B.optional(),charLength:d(1,1e5).optional()},Us=P(Ce,Bo).superRefine((e,t)=>_e(Ce,e,t)),Le=M(Ce,Bo),Qo=g(Le.shape,"content"),jo=Mo(Qo),Uo=g(jo.shape,"patches"),te=Mo(Uo),qo=Ae(g(te.shape,"mode"),I.literal("selected")),Cr=Ae(g(te.shape,"mode"),I.literal("all")),wr=Ae(g(te.shape,"files"),Go(g(te.shape,"files")).min(1)),Lr=Ae(g(te.shape,"ranges"),Go(g(te.shape,"ranges")).min(1)),_r=I.object({mode:qo,files:wr,ranges:g(te.shape,"ranges")}).strict(),Ar=I.object({mode:qo,files:g(te.shape,"files"),ranges:Lr}).strict(),Er=I.object({mode:Cr}).strict(),Or=jo.extend({patches:Ae(Uo,I.union([_r,Ar,Er]).optional())}),It=Le.omit({minify:!0,prNumber:!0,filePage:!0,commentPage:!0,commitPage:!0,reviewPage:!0,collectionPages:!0,content:!0,matchString:!0,commentBodyOffset:!0,charOffset:!0,charLength:!0}),Ir=It.superRefine((e,t)=>_e(Ce,e,t)),et=Le.omit({keywords:!0,concise:!0,state:!0,assignee:!0,author:!0,commenter:!0,mentions:!0,"review-requested":!0,"reviewed-by":!0,label:!0,checks:!0,review:!0,head:!0,base:!0,created:!0,updated:!0,closed:!0,"merged-at":!0,comments:!0,reactions:!0,draft:!0,match:!0,sort:!0,order:!0,page:!0,archived:!0}).extend({owner:b(Le.shape,"owner"),repo:b(Le.shape,"repo"),prNumber:b(Le.shape,"prNumber"),content:Ae(Qo,Or.optional())}),kr=et.superRefine((e,t)=>_e(Ce,e,t)),qs=f(I.union([Ir,kr])),Zo={...zo,commentPage:d(1,1e3).optional(),charOffset:B.optional(),commentBodyOffset:B.optional(),charLength:d(1,1e5).optional()},Zs=P(we,Zo).superRefine((e,t)=>_e(we,e,t)),Ot=M(we,Zo),Me=Ot.omit({minify:!0,issueNumber:!0,commentPage:!0,content:!0,matchString:!0,commentBodyOffset:!0,charOffset:!0,charLength:!0}),Pr=Me.superRefine((e,t)=>_e(we,e,t)),tt=Ot.omit({keywords:!0,concise:!0,state:!0,assignee:!0,author:!0,commenter:!0,mentions:!0,label:!0,created:!0,updated:!0,closed:!0,comments:!0,reactions:!0,match:!0,sort:!0,order:!0,page:!0,archived:!0}).extend({issueNumber:b(Ot.shape,"issueNumber")}),Dr=tt.superRefine((e,t)=>_e(we,e,t)),Xs=f(I.union([Pr,Dr])),Xo={page:ae.default(1),pageSize:d(1,100).optional().default(30),filePage:ae.optional(),charOffset:B.optional(),charLength:d(1,1e5).optional()};function Nr(e,t){(e.base&&!e.head||e.head&&!e.base)&&t.addIssue({code:"custom",path:[e.base?"head":"base"],message:"compare mode requires base and head together"})}var Ws=P(At,Xo).superRefine(Nr).superRefine(xe),Ke=M(At,Xo),kt=Ke.omit({base:!0,head:!0}),Fr=kt.superRefine(xe),Ee=Ke.omit({keywords:!0,branch:!0,since:!0,until:!0,author:!0,committer:!0}).extend({base:b(Ke.shape,"base"),head:b(Ke.shape,"head")}),vr=Ee,$s=f(I.union([Fr,vr]));var pe=e=>Ge.literal(e).describe("Required operation selector."),Oe=e=>b(e,"owner"),Ie=e=>b(e,"repo"),Hr=It.extend({operation:pe("pullRequests")}).strict(),Mr=Me.extend({operation:pe("issues"),owner:Oe(Me.shape),repo:Ie(Me.shape)}).strict(),Pt=kt.omit({includeDiff:!0,filePage:!0,charOffset:!0,charLength:!0}),Gr=Pt.extend({operation:pe("commits"),owner:Oe(Pt.shape),repo:Ie(Pt.shape)}).strict().superRefine(xe),vt=Ge.discriminatedUnion("operation",[Hr,Mr,Gr]).describe("Search or list GitHub pull requests, issues, or commits using one strict operation branch."),Wo=f(vt),Dt=et.omit({prNumber:!0}),zr=Dt.extend({operation:pe("pullRequest"),owner:Oe(Dt.shape),repo:Ie(Dt.shape),number:et.shape.prNumber}).strict(),Nt=tt.omit({issueNumber:!0,matchString:!0,commentBodyOffset:!0,minify:!0}),Br=Nt.extend({operation:pe("issue"),owner:Oe(Nt.shape),repo:Ie(Nt.shape),number:tt.shape.issueNumber}).strict(),Ft=Ee.omit({base:!0,head:!0,page:!0}),Qr=Ft.extend({operation:pe("commit"),owner:Oe(Ft.shape),repo:Ie(Ft.shape),ref:Ge.string().min(1).describe("Commit SHA or ref to retrieve exactly."),fileBatch:Ge.number().int().min(1).max(30).optional().describe("Provider file batch from next.nextFilePage; copy unchanged.")}).strict(),jr=Ee.extend({operation:pe("compare"),owner:Oe(Ee.shape),repo:Ie(Ee.shape)}).strict(),Ht=Ge.discriminatedUnion("operation",[zr,Br,Qr,jr]).describe("Retrieve one GitHub pull request, issue, commit, or ref comparison using one strict operation branch."),$o=f(Ht);var Vo=[{name:ue,title:"GitHub Search",description:T.ghSearch,schema:bt,inputSchema:bo},{name:y.GITHUB_FETCH_CONTENT,title:"GitHub File Content Fetch",description:T.ghGetFileContent,schema:fo,inputSchema:go},{name:re,title:"GitHub History Search",description:T.ghSearchHistory,schema:vt,inputSchema:Wo},{name:ie,title:"GitHub History Item",description:T.ghGetHistoryItem,schema:Ht,inputSchema:$o},{name:y.PACKAGE_SEARCH,title:"Package Search",description:T.npmSearch,schema:No,inputSchema:vo},{name:y.GITHUB_CLONE_REPO,title:"Clone / Fetch GitHub Repository Locally",description:T.ghCloneRepo,schema:ut,inputSchema:io},{name:ne,title:"Local Search",description:T.localSearch,schema:wt,inputSchema:Po},{name:oe,title:"Local Analyze Graph",description:T.localAnalyzeGraph,schema:Ye,inputSchema:xo},{name:y.LOCAL_FETCH_CONTENT,title:"Local Fetch Content",description:T.localGetFileContent,schema:Co,inputSchema:wo},{name:Z,title:"Get Semantic Content",description:T.lspGetSemantics,schema:uo,inputSchema:mo}];var Yo=["GitHub","Local Code","Package","Other"],Jo=new Map([ue,re,ie,y.GITHUB_FETCH_CONTENT,y.GITHUB_CLONE_REPO,ne,oe,y.LOCAL_FETCH_CONTENT,Z,y.PACKAGE_SEARCH].map((e,t)=>[e,t])),q=class extends Error{constructor(o,n=[]){super(o);this.details=n;this.name="DirectToolInputError"}details},Ur=["goal","reasoning"],ke=new Set([...Ur]);function qr(e){return{name:e.name,title:e.title,description:e.description,schema:e.schema,inputSchema:e.inputSchema}}var en=Vo.map(e=>qr(e)),tn=[...en];function k(e){return en.find(t=>t.name===e)}function Ko(e){return e.startsWith("gh")?"GitHub":e.startsWith("local")||e.startsWith("lsp")?"Local Code":e===y.PACKAGE_SEARCH?"Package":"Other"}function Sc(e){return[...e].sort((t,o)=>{let n=Yo.indexOf(Ko(t)),r=Yo.indexOf(Ko(o));if(n!==r)return n-r;let i=Jo.get(t)??Number.MAX_SAFE_INTEGER,a=Jo.get(o)??Number.MAX_SAFE_INTEGER;return i!==a?i-a:t.localeCompare(o)})}import{z as on}from"zod";var Zr=["goal","reasoning"];function Cc(e){let t=k(e);if(!t)return"{}";try{return JSON.stringify(on.toJSONSchema(t.inputSchema,{io:"input"}),null,2)}catch{return JSON.stringify(on.toJSONSchema(t.schema,{io:"input"}),null,2)}}function wc(e){return JSON.stringify(e??{},null,2)}function Lc(e){return k(e)?[...Zr]:[]}function _c(e,t){return k(e)?.description??e}import{z as Gt}from"zod";function rt(e){let t=k(e);if(!t)return[];let o=Gt.toJSONSchema(t.schema,{io:"input"});if(!z(o))return[];let n=it(o),r=an(n),i=sn(n,r);return nt(r,i)}function Ic(e){let t=k(e);if(!t)return{};let o=Gt.toJSONSchema(t.schema,{io:"input"});if(!z(o))return{};let n=new Map;for(let r of it(o)){if(!F(r.properties))continue;let i=r.properties.operation;if(!z(i)||typeof i.const!="string")continue;let a=n.get(i.const)??[];a.push(r),n.set(i.const,a)}return Object.fromEntries([...n].map(([r,i])=>{let a=an(i),l=sn(i,a);return[r,nt(a,l).filter(u=>!ke.has(u.name)&&u.name!=="operation")]}))}function rn(e,t){let o=k(e);if(!o)return new Set;let n=Gt.toJSONSchema(o.schema,{io:"input"});if(!z(n))return new Set;let r=it(n),i=r.filter(l=>Xr(l,t)),a=i.length>0?i:r;return new Set(a.flatMap(l=>F(l.properties)?Object.keys(l.properties):[]))}function Xr(e,t){if(!F(e.properties))return!0;for(let[o,n]of Object.entries(t)){let r=e.properties[o];if(z(r)&&("const"in r&&n!==r.const||Array.isArray(r.enum)&&!r.enum.some(i=>i===n)))return!1}return!0}function Wr(e){let t=[],o=typeof e.minimum=="number"?e.minimum:void 0,n=typeof e.maximum=="number"?e.maximum:void 0;return o!==void 0&&n!==void 0?t.push(`${o}-${n}`):o!==void 0?t.push(`>=${o}`):n!==void 0&&t.push(`<=${n}`),"default"in e&&t.push(`default ${JSON.stringify(e.default)}`),t.length>0?t.join(", "):void 0}function ot(e){if("const"in e)return`enum(${String(e.const)})`;if(Array.isArray(e.enum)&&e.enum.length>0)return`enum(${e.enum.map(String).join(", ")})`;if(e.type==="array"){let o=z(e.items)?e.items:void 0;return`array<${o?ot(o):"value"}>`}let t=Array.isArray(e.anyOf)?e.anyOf:Array.isArray(e.oneOf)?e.oneOf:void 0;if(t){let o=t.filter(z).map(ot).filter(n=>n!=="value");if(o.length>0)return[...new Set(o)].join(" | ")}return Array.isArray(e.type)?e.type.join(" | "):typeof e.type=="string"?e.type:"value"}function it(e){return F(e.properties)?[e]:(Array.isArray(e.anyOf)?e.anyOf:Array.isArray(e.oneOf)?e.oneOf:[]).filter(z).flatMap(o=>it(o))}function an(e){let t=new Map;for(let o of e)if(F(o.properties))for(let[n,r]of Object.entries(o.properties)){if(!z(r))continue;let i=t.get(n)??[];i.push(r),t.set(n,i)}return Object.fromEntries([...t].map(([o,n])=>{let r=n.filter(a=>"const"in a).map(a=>a.const);return r.length===n.length?[o,{enum:[...new Set(r)],description:o==="operation"?"Required operation selector.":n[0]?.description}]:new Set(n.map(ot)).size>1?[o,{anyOf:n}]:[o,n[0]??{}]}))}function sn(e,t){if(e.length===0)return new Set;let o=e.map(r=>new Set(Array.isArray(r.required)?r.required:[])),n=[...o[0]??new Set].filter(r=>o.every(i=>i.has(r)));return new Set(n.filter(r=>!ke.has(r)&&!Mt(t[r])))}function nt(e,t,o=""){let n=[];for(let[r,i]of Object.entries(e)){if(!o&&ke.has(r))continue;let a=z(i)?i:{},l=o?`${o}.${r}`:r;if(n.push({name:l,required:t.has(r),type:ot(a),constraints:Wr(a),description:typeof a.description=="string"?a.description:void 0}),F(a.properties)){let A=new Set(Array.isArray(a.required)?a.required.filter(w=>typeof w=="string"?!Mt(a.properties?.[w]):!1):[]);n.push(...nt(a.properties,A,l))}let u=a.type==="array"&&z(a.items)?a.items:void 0;if(u&&F(u.properties)){let A=new Set(Array.isArray(u.required)?u.required.filter(w=>typeof w=="string"?!Mt(u.properties?.[w]):!1):[]);n.push(...nt(u.properties,A,l))}}return n}function cn(e,t){if(t.startsWith("array<")){let o=t.slice(6,-1);return[nn(e,o)]}return nn(e,t)}function nn(e,t){if(t.startsWith("enum("))return/^enum\(([^,)]+)/.exec(t)?.[1]??e;if(t==="integer"||t==="number")return e==="lineHint"?42:5;if(t==="boolean")return!0;switch(e){case"keywords":case"keywordsToSearch":case"query":case"text":return"runCLI";case"path":return".";case"uri":return"/path/to/file.ts";case"owner":return"bgauryy";case"repo":return"octocode";case"extension":return"ts";case"filename":return"package.json";case"language":return"TypeScript";case"symbolName":return"myFunction";case"name":case"packageName":return"zod";default:return e}}function F(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function z(e){return F(e)}function Mt(e){return z(e)&&"default"in e}function ln(e){return e!==ue?[]:[{label:"code search",query:{operation:"code",keywords:["localSearch"],owner:"bgauryy",repo:"octocode",pageSize:5}},{label:"repository search",query:{operation:"repositories",keywords:["code research"],language:"TypeScript",pageSize:5}},{label:"repository tree",query:{operation:"tree",owner:"bgauryy",repo:"octocode",path:"packages",maxDepth:2}}]}function pn(e){let t=ln(e);return t.length>0?t:e===re?[{label:"PR search (list)",query:{operation:"pullRequests",owner:"bgauryy",repo:"octocode",keywords:["localSearch"],concise:!0,pageSize:5}},{label:"issue search (list)",query:{operation:"issues",owner:"bgauryy",repo:"octocode",keywords:["schema"],state:"open",pageSize:5}},{label:"commit history",query:{operation:"commits",owner:"bgauryy",repo:"octocode",path:"packages/octocode-tools-core/src",since:"6m",pageSize:10}}]:e===y.GITHUB_CLONE_REPO?[{label:"full repo clone",query:{owner:"bgauryy",repo:"octocode"}},{label:"subtree clone",query:{owner:"bgauryy",repo:"octocode",sparsePath:"packages/octocode-tools-core"}}]:e===ne?[{label:"text anchors",query:{operation:"text",path:"/ABS/repo/src",searchText:"buildDirectToolCommandPatterns",maxFiles:20}},{label:"structural matches",query:{operation:"structural",path:"/ABS/repo/src",pattern:"eval($X)",langType:"typescript"}},{label:"file discovery",query:{operation:"files",path:"/ABS/repo",names:["package.json"],entryType:"f"}},{label:"tree orientation",query:{operation:"tree",path:"/ABS/repo/src",maxDepth:2}}]:e===y.LOCAL_FETCH_CONTENT?[{label:"exact line range",query:{path:"/ABS/repo/packages/octocode-tools-core/package.json",startLine:1,endLine:30,minify:"none"}},{label:"matched slice",query:{path:"/ABS/repo/packages/octocode-tools-core/src/tools/directToolCatalog/toolCommandPatternQueries.ts",matchString:"buildKnownDirectToolCommandPatternQueries",contextLines:8,minify:"standard"}}]:e===oe?[{label:"dead code from detected entrypoints",query:{operation:"deadCode",path:"/ABS/repo",limit:20}},{label:"cycles",query:{operation:"cycles",path:"/ABS/repo",limit:20}},{label:"dependencies of one file",query:{operation:"dependencies",path:"/ABS/repo",file:"src/index.ts",depth:2}},{label:"dependents of one file",query:{operation:"dependents",path:"/ABS/repo",file:"src/index.ts",depth:2}},{label:"shortest dependency path",query:{operation:"path",path:"/ABS/repo",file:"src/index.ts",target:"src/responses.ts"}},{label:"reachability from detected entrypoints",query:{operation:"reachability",path:"/ABS/repo",limit:20}}]:e===y.GITHUB_FETCH_CONTENT?[{label:"matched slice (cheap read of one function)",query:{owner:"bgauryy",repo:"octocode",path:"packages/octocode-tools-core/src/responses.ts",matchString:"export function cleanJsonObject",contextLines:8}},{label:"symbols outline (unknown/large file)",query:{owner:"bgauryy",repo:"octocode",path:"packages/octocode-tools-core/src/responses.ts",minify:"symbols"}}]:e===ie?[{label:"pull request detail",query:{operation:"pullRequest",owner:"bgauryy",repo:"octocode",number:1,content:{body:!0,patches:{mode:"all"}}}},{label:"issue detail",query:{operation:"issue",owner:"bgauryy",repo:"octocode",number:1,content:{body:!0,comments:{discussion:!0}}}},{label:"exact commit",query:{operation:"commit",owner:"bgauryy",repo:"octocode",ref:"main"}},{label:"compare two refs (base...head)",query:{operation:"compare",owner:"bgauryy",repo:"octocode",base:"main",head:"update-tools"}}]:e===y.PACKAGE_SEARCH?[{label:"exact package \u2192 source repo",query:{packageName:"zod"}},{label:"keyword discovery (paged candidates)",query:{keywords:["schema","validation"],page:1}}]:e===Z?[{label:"symbol outline (absolute uri)",query:{uri:"/ABS/packages/octocode-tools-core/src/scheme/pagination.ts",type:"documentSymbols"}},{label:"semantic definition (absolute uri + lineHint)",query:{uri:"/ABS/packages/octocode-tools-core/src/scheme/pagination.ts",type:"definition",symbolName:"buildNextPageContinuation",lineHint:72}}]:[]}function un(e,t){return`tools ${e} --queries '${JSON.stringify(t)}'`}function $r(e){let t=pn(e);if(t.length>0)return t.map(n=>({...n,command:un(e,n.query)}));let o=Vr(e);return Object.keys(o).length===0?[]:[{label:"schema-derived",query:o,command:un(e,o)}]}function Bc(e){return $r(e)[0]?.query??{}}function Vr(e){if(!k(e))return{};let t=rt(e),o=t.filter(i=>!i.name.includes(".")),n=Yr(o),r={};for(let i of n)r[i.name]=cn(i.name,i.type);return e.startsWith("lsp")&&t.some(i=>i.name==="uri")&&(r.uri??="uri"),e===Z&&(r.type??="definition",r.symbolName??="symbolName",r.lineHint??=1),r}var mn=4,zt=new Map([["keywords",10],["keywordsToSearch",11],["query",12],["text",13],["packageName",14],["name",15],["uri",20],["type",21],["owner",30],["repo",31],["extension",32],["filename",33],["language",34],["path",40],["target",50],["from",51],["scope",52],["pattern",60],["rule",61],["op",80],["operation",81],["minify",90]]),dn=new Set(["page","itemsPerPage","limit","pageSize","matchPage","maxFiles","maxMatchesPerFile","matchContentLength","responseCharLength","responseCharOffset"]);function Yr(e){let t=e.filter(i=>i.required),o=new Map;for(let i of t)o.set(i.name,i);let n=e.filter(i=>!i.required&&Jr(i)).sort(Kr),r=Math.max(mn,t.length);for(let i of n){if(o.size>=r)break;o.set(i.name,i)}return o.size>0?[...o.values()]:e.filter(i=>!dn.has(i.name)).filter(i=>i.type!=="boolean").slice(0,mn)}function Jr(e){return dn.has(e.name)||e.type==="boolean"?!1:ei(e)?zt.has(e.name):!0}function Kr(e,t){let o=zt.get(e.name)??Number.MAX_SAFE_INTEGER,n=zt.get(t.name)??Number.MAX_SAFE_INTEGER;return o!==n?o-n:e.name.localeCompare(t.name)}function ei(e){return e.constraints?.includes("default ")===!0}import{z as yn}from"zod";var ti={ghSearch:["Use only fields listed for the selected operation.","match: code=file|path; repositories=name|description|readme.","code cannot select branch; it searches GitHub's indexed default branch."],localSearch:["text needs searchText.","structural needs exactly one of pattern or rule.","Fields from different operations cannot be mixed."],localAnalyzeGraph:["dependencies | dependents -> requires file; depth applies.","path -> requires file + target.","deadCode/reachability use entrypoints and includeTests as roots."],localGetFileContent:["Choose fullContent, a line range, or matchString.","A line range needs startLine and endLine.","matchString options apply with matchString."],lspGetSemantics:["workspaceSymbol needs symbolName and may use workspaceRoot.","documentSymbols/diagnostic need uri.","definition | references | hover | callers | callees | callHierarchy | implementation | typeDefinition | supertypes | subtypes -> requires uri + symbolName + lineHint."],ghGetFileContent:["Optionally choose fullContent, a line range, or matchString; extraction modes are exclusive.","A line range needs startLine and endLine.","matchString options apply with matchString.",'type:"directory" materializes; extraction fields read files.'],npmSearch:["Set exactly one non-empty packageName or keywords.","page applies only to keyword discovery."]};function Bt(e){return[...ti[e]??[]]}var oi={ghSearch:[{name:"code",when:"Search code contents or file paths",requires:["operation"],excludes:["branch"],fields:["keywords","owner","repo","extension","filename","path","language","match","pageSize","page","concise"],example:{operation:"code",keywords:["toolSchemas"],owner:"bgauryy",repo:"octocode"}},{name:"repositories",when:"Discover repositories",requires:["operation"],fields:["keywords","topics","language","owner","stars","forks","goodFirstIssues","updated","created","size","match","sort","pageSize","page","archived","visibility","license","concise"],example:{operation:"repositories",keywords:["octocode"]}},{name:"tree",when:"Browse a known repository tree",requires:["operation","owner","repo"],fields:["owner","repo","branch","path","maxDepth","page","pageSize","include"],example:{operation:"tree",owner:"bgauryy",repo:"octocode",path:"packages",maxDepth:2}}],localSearch:[{name:"text",when:"Search lexical text or regular expressions",requires:["operation","path","searchText"],example:{operation:"text",path:".",searchText:"toolSchemas"}},{name:"structural",when:"Match AST structure",requires:["operation","path","pattern"],example:{operation:"structural",path:".",pattern:"console.log($A)",langType:"typescript"}},{name:"files",when:"Discover paths by name or metadata",requires:["operation","path"],example:{operation:"files",path:".",names:["*.ts"]}},{name:"tree",when:"Browse a directory tree",requires:["operation","path"],example:{operation:"tree",path:".",maxDepth:5}}],localAnalyzeGraph:[{name:"dependencies",when:"Find files imported by a file",requires:["path","operation","file"],example:{path:".",operation:"dependencies",file:"src/index.ts"}},{name:"dependents",when:"Find files importing a file",requires:["path","operation","file"],example:{path:".",operation:"dependents",file:"src/index.ts"}},{name:"path",when:"Find a shortest dependency path",requires:["path","operation","file","target"],example:{path:".",operation:"path",file:"src/a.ts",target:"src/b.ts"}},{name:"cycles",when:"Find dependency cycles",requires:["path","operation"],example:{path:".",operation:"cycles"}},{name:"deadCode",when:"Find unreachable file candidates",requires:["path","operation"],example:{path:".",operation:"deadCode"}},{name:"reachability",when:"Classify files from explicit or inferred roots",requires:["path","operation"],example:{path:".",operation:"reachability",entrypoints:["src/index.ts"]}}],lspGetSemantics:[{name:"anchored",when:"Query a named symbol near a source line",requires:["uri","type","symbolName","lineHint"],example:{uri:"src/index.ts",type:"definition",symbolName:"main",lineHint:1}},{name:"document",when:"Query a whole document",requires:["uri","type"],example:{uri:"src/index.ts",type:"documentSymbols"}},{name:"workspace",when:"Search symbols across the workspace",requires:["workspaceRoot","type","symbolName"],example:{workspaceRoot:".",type:"workspaceSymbol",symbolName:"Schema"}}]};function hn(e){return oi[e]??[]}import{z as ni}from"zod";function at(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function fn(e){return at(e.properties)?[e]:(Array.isArray(e.anyOf)?e.anyOf:Array.isArray(e.oneOf)?e.oneOf:[]).filter(at).flatMap(fn)}function ri(e){let t=k(e)?.schema;if(!t)return new Map;let o=ni.toJSONSchema(t),n=new Map;for(let r of fn(o)){if(!at(r.properties))continue;let i=r.properties.operation;if(!at(i)||typeof i.const!="string")continue;let a=n.get(i.const)??new Set;for(let l of Object.keys(r.properties))["goal","reasoning","operation"].includes(l)||a.add(l);n.set(i.const,a)}return new Map([...n].map(([r,i])=>[r,[...i]]))}function Qt(e){if(e==="ghSearch"){let[t,...o]=Bt(e);return[...t?[t]:[],"code and repositories need at least one search term or scope filter.",...o]}return e==="localSearch"?["text needs searchText.","structural needs exactly one of pattern or rule.","Fields from different operations cannot be mixed."]:e==="ghSearchHistory"?["Choose pullRequests, issues, or commits; fields cannot cross operations.","issues and commits require owner+repo; pullRequests may search globally.","Search/list operations reject exact identities, content, and diff pagination."]:e==="ghGetHistoryItem"?["Every operation requires owner+repo.","pullRequest and issue need number; commit needs ref; compare needs base+head.","Fields and pagination axes cannot cross operations."]:Bt(e)}function gn(e){let t=ri(e);return(e==="ghSearchHistory"?[{name:"pullRequests",when:"Search or list pull requests",requires:["operation"],example:{operation:"pullRequests",keywords:["schema"]}},{name:"issues",when:"Search or list issues",requires:["operation","owner","repo"],example:{operation:"issues",owner:"o",repo:"r"}},{name:"commits",when:"List commit history",requires:["operation","owner","repo"],example:{operation:"commits",owner:"o",repo:"r"}}]:e==="ghGetHistoryItem"?[{name:"pullRequest",when:"Retrieve one pull request",requires:["operation","owner","repo","number"],example:{operation:"pullRequest",owner:"o",repo:"r",number:1}},{name:"issue",when:"Retrieve one issue",requires:["operation","owner","repo","number"],example:{operation:"issue",owner:"o",repo:"r",number:1}},{name:"commit",when:"Retrieve one commit",requires:["operation","owner","repo","ref"],example:{operation:"commit",owner:"o",repo:"r",ref:"main"}},{name:"compare",when:"Compare two refs",requires:["operation","owner","repo","base","head"],example:{operation:"compare",owner:"o",repo:"r",base:"main",head:"next"}}]:hn(e)).map(n=>({...n,...e==="localSearch"&&n.name==="structural"?{requires:["operation","path"]}:{},...e==="lspGetSemantics"&&n.name==="workspace"?{requires:["type","symbolName"]}:{},...t.has(n.name)?{fields:t.get(n.name)}:{}}))}function el(e,t,o={}){if(typeof t!="string")return null;let n;try{n=JSON.parse(t)}catch{throw new q("Tool input must be valid JSON.")}return ii(e,n,o)}function ii(e,t,o={}){let n=ci(e,t,o),r=k(e);if(!r)throw new q(`Unknown tool: ${e}`);let i=r.inputSchema.safeParse(n);if(!i.success)throw new q("Check the query fields.",[...ai(e),...si(i.error)]);return i.data}function ai(e){if(e==="npmSearch")return Qt(e).slice(0,1);if(e==="localSearch"){let t=gn(e).map(o=>o.name);return t.length>0?[`operation must be one of ${t.map((o,n)=>n===t.length-1&&t.length>1?`or ${o}`:o).join(", ")}.`]:[]}if(e==="lspGetSemantics"){let t=Qt(e);return t.length>0?[t.join(" ")]:[]}return[]}function si(e){let t=o=>{let n=o.errors;if(o.code!=="invalid_union"||!Array.isArray(n))return[o];let r=n.filter(a=>Array.isArray(a));return r.length===0?[o]:r.reduce((a,l)=>l.length<a.length?l:a).map(a=>({...a,path:[...o.path,...a.path]}))};return e.issues.flatMap(t).map(o=>`${o.path.length>0?o.path.join("."):"input"}: ${o.message}`)}function ci(e,t,o){let n;if(Array.isArray(t))n=t;else if(F(t)&&Array.isArray(t.queries))n=t.queries;else if(F(t))n=[t];else throw new q('Tool input must be a JSON object, an array of query objects, or { "queries": [...] }.');if(n.length===0)throw new q("At least one query is required.");let r=F(t)&&Array.isArray(t.queries)?Object.fromEntries(Object.entries(t).filter(([a])=>a!=="queries")):{},i=n.map((a,l)=>li(e,hi(e,a,l,o),{sourceLabel:o.sourceLabel}));return{...r,queries:i}}function li(e,t,o){let n={...t},r=o.sourceLabel??"direct tool execution",i=pi(e,r);return(typeof n.goal!="string"||n.goal.trim().length===0)&&(n.goal=i),(typeof n.reasoning!="string"||n.reasoning.trim().length===0)&&(n.reasoning=`Executed via ${r} tool command`),n}function pi(e,t){return`Execute ${e} via ${t}`}function ui(e,t){let o=e.length+1,n=t.length+1,r=Array.from({length:o*n},()=>0);for(let i=0;i<o;i++)r[i*n]=i;for(let i=0;i<n;i++)r[i]=i;for(let i=1;i<o;i++)for(let a=1;a<n;a++){let l=e[i-1]===t[a-1]?0:1;r[i*n+a]=Math.min(r[(i-1)*n+a]+1,r[i*n+a-1]+1,r[(i-1)*n+a-1]+l)}return r[o*n-1]}function mi(e,t){let o=e.toLowerCase(),n,r=Number.POSITIVE_INFINITY,i,a=Number.POSITIVE_INFINITY;for(let l of t){let u=l.toLowerCase(),A=ui(o,u);if(u.includes(o)||o.includes(u)){A<r&&(n=l,r=A);continue}if(o.length<3)continue;let w=Math.max(2,Math.floor(l.length/3));A<=w&&A<a&&(i=l,a=A)}return n??i}var di={npmSearch:{name:"packageName"},lspGetSemantics:{op:"type",line:"lineHint",path:"uri",itemsPerPage:"pageSize",limit:""},localGetFileContent:{filePath:"path"},localSearch:{itemsPerPage:"pageSize",maxResults:["maxFiles","limit","pageSize"],keywords:"searchText",language:"langType",regexType:"regex",sortBy:"sort",sortReverse:"reverse"},ghGetFileContent:{matchStringContextLines:"contextLines",minified:"minify"},ghSearch:{itemsPerPage:"pageSize",limit:"",topicsToSearch:"topics"},localAnalyzeGraph:{itemsPerPage:"pageSize",maxResults:"limit",maxDepth:"depth"}};function hi(e,t,o,n={}){if(!F(t))throw new q("Tool input must be a JSON object or an array of objects.");let r=new Set([...rt(e).filter(l=>!l.name.includes(".")).map(l=>l.name),...bn(k(e)?.schema),...ke]),i={},a=[];for(let[l,u]of Object.entries(t)){if(r.has(l)){i[l]=u;continue}a.push(l)}if(a.length>0&&r.size>0&&(n.onUnknownFields?.(a,o),n.rejectUnknownFields===!0)){let l=rn(e,t),u=a.map(A=>{let w=di[e]?.[A],qt=(Array.isArray(w)?w:w===void 0?[]:[w]).find(Tn=>l.has(Tn))??mi(A,l);return qt?`'${A}' \u2192 did you mean '${qt}'?`:""}).filter(Boolean);throw new q(`Unknown field(s): ${a.join(", ")}`,[...u,`Remove unknown field(s) from query ${o+1}: ${a.join(", ")}`,`Run tools ${e} --scheme to see valid fields.`])}return i}function bn(e){if(!e)return[];if(e instanceof yn.ZodObject)return Object.keys(e.shape);let t=e.options,o=e instanceof yn.ZodUnion?e.options:Array.isArray(t)?t:[];return o.length>0?[...new Set(o.flatMap(n=>bn(n)))]:[]}function ol(e){let t=[],o=[];return!e||typeof e!="object"?(t.push("Query must be an object"),{isValid:!1,errors:t,warnings:o}):(e.mode!=="structural"&&(!e.searchText||typeof e.searchText!="string")&&t.push("`searchText` is required"),e.matchWindow!==void 0&&e.output!=="matchOnly"&&t.push('`matchWindow` requires output:"matchOnly"'),(e.unique==="list"||e.unique==="count")&&e.output!=="matchOnly"&&t.push('`unique` requires output:"matchOnly"'),{isValid:t.length===0,errors:t,warnings:o})}function nl(e){if(!e||typeof e!="object")return e;let t=e.mode;if(!t||typeof t!="string")return e;let o={...e};return t==="discovery"?o.output==="content"&&(o.output="files"):t==="detailed"&&o.contextLines===void 0&&(o.contextLines=3),o}import{SYSTEM_PROMPT as fi}from"@octocodeai/octocode-core";var Sn={systemPrompt:fi,toolNames:v,baseSchema:ze,tools:Object.fromEntries(tn.map(e=>[e.name,{description:e.description}]))};var jt=null;function gi(){return jt||(jt=Sn),jt}async function yi(){return gi()}import{getConfigSync as bi}from"@octocodeai/config";function Si(e,t=bi()){let o=e===y.GITHUB_CLONE_REPO,n=o||e.startsWith("local")||e.startsWith("lsp"),r;return n&&!t.local.enabled?r="ENABLE_LOCAL":o&&t.storage.mode!=="persistent"?r="OCTOCODE_STORAGE_MODE":o&&!t.local.enableClone?r="ENABLE_CLONE":t.tools.enabled?.length?t.tools.enabled.includes(e)||(r="TOOLS_TO_RUN"):t.tools.disabled?.includes(e)&&(r="DISABLE_TOOLS"),r?{enabled:!1,envVar:r}:{enabled:!0}}export{ke as DIRECT_TOOL_AUTO_FILLED_FIELDS,Yo as DIRECT_TOOL_CATEGORIES,en as DIRECT_TOOL_DEFINITIONS,tn as DIRECT_TOOL_DISCOVERY_DEFINITIONS,q as DirectToolInputError,y as STATIC_TOOL_NAMES,nl as applyWorkflowMode,$r as buildDirectToolCommandPatterns,Bc as buildDirectToolExampleQuery,cn as buildExampleValue,nn as buildScalarExampleValue,nt as collectDisplayFields,Wr as describeSchemaConstraints,ot as describeSchemaType,k as findDirectToolDefinition,un as formatDirectToolCommandPattern,wc as formatDirectToolMetadataSchemaText,Cc as formatDirectToolSchemaText,si as formatDirectToolValidationIssues,rn as getDirectToolAllowedFieldNames,Lc as getDirectToolAutoFilledFields,Ko as getDirectToolCategory,_c as getDirectToolDescription,rt as getDirectToolDisplayFields,Qt as getDirectToolSchemaRelations,gn as getDirectToolSchemaVariants,Ic as getDirectToolVariantDisplayFields,Si as getToolAvailability,Mt as hasSchemaDefault,z as isJsonSchemaObject,F as isRecord,yi as loadToolContent,ii as prepareDirectToolInput,el as prepareDirectToolInputFromJsonText,Sc as sortDirectToolNames,ol as validateRipgrepQuery};
|
package/dist/scheme/fields.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare function clampedInt(min: number, max: number): z.ZodPreprocess<z.ZodNumber>;
|
|
2
|
+
export declare function clampedInt(min: number, max: number): z.ZodPreprocess<z.ZodNumber, unknown>;
|
|
3
3
|
export type MinifyMode = 'none' | 'standard' | 'symbols';
|
|
4
|
-
export declare const relaxedPageNumberField: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>>;
|
|
5
|
-
export declare const contextLinesField: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
6
|
-
export declare const lineNumberField: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
7
|
-
export declare const offsetField: z.ZodPreprocess<z.ZodNumber>;
|
|
4
|
+
export declare const relaxedPageNumberField: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodNumber, unknown>>>;
|
|
5
|
+
export declare const contextLinesField: z.ZodOptional<z.ZodPreprocess<z.ZodNumber, unknown>>;
|
|
6
|
+
export declare const lineNumberField: z.ZodOptional<z.ZodPreprocess<z.ZodNumber, unknown>>;
|
|
7
|
+
export declare const offsetField: z.ZodPreprocess<z.ZodNumber, unknown>;
|
|
8
8
|
export declare function createRelaxedBulkQuerySchema(querySchema: z.ZodTypeAny, options?: {
|
|
9
9
|
maxQueries?: number;
|
|
10
10
|
}): z.ZodObject<{
|
|
11
|
-
responseCharOffset: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
12
|
-
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
13
|
-
queries: z.ZodArray<z.
|
|
11
|
+
responseCharOffset: z.ZodOptional<z.ZodPreprocess<z.ZodNumber, unknown>>;
|
|
12
|
+
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber, unknown>>;
|
|
13
|
+
queries: z.ZodArray<z.ZodTypeAny<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
14
14
|
}, z.core.$strict>;
|
|
@@ -40,6 +40,7 @@ export declare const CharPaginationSchema: z.ZodObject<{
|
|
|
40
40
|
semantic: "semantic";
|
|
41
41
|
"char-limit": "char-limit";
|
|
42
42
|
}>>;
|
|
43
|
+
pageCountsKind: z.ZodOptional<z.ZodLiteral<"estimated">>;
|
|
43
44
|
}, z.core.$strip>;
|
|
44
45
|
export type CharPagination = z.infer<typeof CharPaginationSchema>;
|
|
45
46
|
export declare const ToolContinuationSchema: z.ZodObject<{
|
package/dist/serverConfig.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ProviderType } from './providers/types.js';
|
|
2
|
-
import { resolveTokenFull } from './shared/index.js';
|
|
2
|
+
import { resolveTokenFull } from './shared/credentials/index.js';
|
|
3
3
|
import type { ServerConfig, TokenSourceType } from './types/server.js';
|
|
4
4
|
type ResolveTokenFullFn = typeof resolveTokenFull;
|
|
5
5
|
export declare function _setTokenResolvers(resolvers: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { GitHubCacheHitStats, PersistedStats, PersistedSession, SessionStats, SessionTotalUsageStats, SessionUpdateResult, SessionOptions, StatsCounterMap, ToolCharSavingsStats, } from './types.js';
|
|
2
|
-
export { SESSION_FILE, STATS_FILE } from './
|
|
2
|
+
export { SESSION_FILE, STATS_FILE } from './sessionDiskIO.js';
|
|
3
3
|
export { readSession, writeSession, getOrCreateSession, getSessionId, deleteSession, flushSession, flushSessionSync, } from './storage.js';
|
|
4
4
|
export { updateSessionStats, incrementToolCalls, incrementErrors, incrementRateLimits, incrementRateLimitByProvider, incrementToolCharSavings, incrementGitHubCacheHits, incrementGitHubCacheRateLimits, incrementPackageRegistryFailures, resetSessionStats, } from './storage.js';
|
|
5
5
|
export { _resetSessionState } from './storage.js';
|