@octocodeai/octocode-tools-core 18.1.2 → 18.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/README.md +113 -162
  2. package/dist/cacheMaintenance.d.ts +8 -0
  3. package/dist/direct.js +41 -51
  4. package/dist/github/client.d.ts +1 -1
  5. package/dist/github/codeSearch.d.ts +2 -2
  6. package/dist/github/commit.d.ts +48 -0
  7. package/dist/github/compare.d.ts +2 -2
  8. package/dist/github/directoryFetch/fetchDirectoryContents.d.ts +1 -1
  9. package/dist/github/directoryFetch/fetchFileContentToDisk.d.ts +1 -1
  10. package/dist/github/directoryFetch/refResolution.d.ts +6 -0
  11. package/dist/github/fileContent.d.ts +1 -1
  12. package/dist/github/fileContentRaw/fetch.d.ts +2 -2
  13. package/dist/github/githubAPI.d.ts +1 -2
  14. package/dist/github/history/commitFiles.d.ts +5 -0
  15. package/dist/github/history.d.ts +1 -1
  16. package/dist/github/issues/fetchers.d.ts +1 -1
  17. package/dist/github/issues/orchestrator.d.ts +1 -1
  18. package/dist/github/issues/types.d.ts +5 -0
  19. package/dist/github/prByNumber.d.ts +1 -1
  20. package/dist/github/prContentFetcher/commits.d.ts +1 -1
  21. package/dist/github/prContentFetcher/transform.d.ts +1 -1
  22. package/dist/github/pullRequestSearch.d.ts +1 -1
  23. package/dist/github/queryBuilders/codeAndRepo.d.ts +1 -1
  24. package/dist/github/repoSearch.d.ts +2 -2
  25. package/dist/github/repoStructure/contentResolution.d.ts +1 -1
  26. package/dist/github/repoStructure/fetchOrchestration.d.ts +2 -2
  27. package/dist/github/repoStructurePagination.d.ts +1 -1
  28. package/dist/graph/advancedOperations.d.ts +22 -0
  29. package/dist/{tools/local_dead_code/graphBuilder.d.ts → graph/buildFileGraph.d.ts} +6 -5
  30. package/dist/graph/cycleOperations.d.ts +12 -0
  31. package/dist/{tools/local_dead_code → graph}/importResolver.d.ts +1 -1
  32. package/dist/graph/operations.d.ts +7 -0
  33. package/dist/{tools/local_dead_code → graph}/reachability.d.ts +1 -1
  34. package/dist/{tools/local_dead_code → graph}/types.d.ts +11 -0
  35. package/dist/graph/workspacePackageResolver.d.ts +2 -0
  36. package/dist/index.d.ts +11 -30
  37. package/dist/index.js +45 -55
  38. package/dist/providers/github/githubContent.d.ts +1 -1
  39. package/dist/providers/github/githubPullRequests.d.ts +1 -1
  40. package/dist/providers/github/githubSearch.d.ts +1 -1
  41. package/dist/providers/github/githubStructure.d.ts +1 -1
  42. package/dist/providers/github/paginationMetadata.d.ts +4 -5
  43. package/dist/providers/providerQueries.d.ts +1 -3
  44. package/dist/providers/providerResults.d.ts +4 -0
  45. package/dist/providers/types.d.ts +1 -1
  46. package/dist/responses.d.ts +1 -1
  47. package/dist/schema.d.ts +2 -0
  48. package/dist/schema.js +13 -1
  49. package/dist/scheme/conditionalSchemas.d.ts +12 -0
  50. package/dist/scheme/fields.d.ts +2 -1
  51. package/dist/security/bridge.d.ts +7 -10
  52. package/dist/shared/credentials/index.js +2 -2
  53. package/dist/shared/paths.d.ts +1 -0
  54. package/dist/shared/paths.js +1 -1
  55. package/dist/shared/session/index.js +1 -1
  56. package/dist/toolContract/descriptions.d.ts +14 -0
  57. package/dist/toolContract/input/resources/global.d.ts +15 -0
  58. package/dist/toolContract/input/resources/toolRelations.d.ts +1 -0
  59. package/dist/toolContract/input/resources/toolVariants.d.ts +9 -0
  60. package/dist/toolContract/input/resources/tools/_toolkit.d.ts +75 -0
  61. package/dist/toolContract/input/resources/tools/ghCloneRepo.d.ts +12 -0
  62. package/dist/toolContract/input/resources/tools/ghGetFileContent.d.ts +30 -0
  63. package/dist/toolContract/input/resources/tools/ghSearch.d.ts +76 -0
  64. package/dist/toolContract/input/resources/tools/githubCodeOperation.d.ts +29 -0
  65. package/dist/toolContract/input/resources/tools/githubHistorySchema.d.ts +114 -0
  66. package/dist/toolContract/input/resources/tools/githubRepositoriesOperation.d.ts +54 -0
  67. package/dist/toolContract/input/resources/tools/githubTreeOperation.d.ts +26 -0
  68. package/dist/toolContract/input/resources/tools/historyCommitInput.d.ts +21 -0
  69. package/dist/toolContract/input/resources/tools/historyIssueInput.d.ts +59 -0
  70. package/dist/toolContract/input/resources/tools/historyPullRequestInput.d.ts +98 -0
  71. package/dist/toolContract/input/resources/tools/localAnalyzeGraph.d.ts +75 -0
  72. package/dist/toolContract/input/resources/tools/localFilesOperation.d.ts +70 -0
  73. package/dist/toolContract/input/resources/tools/localGetFileContent.d.ts +22 -0
  74. package/dist/toolContract/input/resources/tools/localSearch.d.ts +258 -0
  75. package/dist/toolContract/input/resources/tools/localTextOperation.d.ts +113 -0
  76. package/dist/toolContract/input/resources/tools/localTreeOperation.d.ts +44 -0
  77. package/dist/toolContract/input/resources/tools/lspGetSemantics.d.ts +37 -0
  78. package/dist/toolContract/input/resources/tools/npmSearch.d.ts +10 -0
  79. package/dist/toolContract/input/types/index.d.ts +24 -0
  80. package/dist/toolContract/metadata.d.ts +11 -0
  81. package/dist/toolContract/runtime.d.ts +11 -0
  82. package/dist/toolContract/schemas.d.ts +31 -0
  83. package/dist/toolContract/types.d.ts +11 -0
  84. package/dist/tools/directToolCatalog/toolCatalogDefinitions.d.ts +6 -16
  85. package/dist/tools/directToolCatalog/toolCatalogFormatters.d.ts +1 -1
  86. package/dist/tools/directToolCatalog/toolCommandPatternUnifiedSearchQueries.d.ts +6 -0
  87. package/dist/tools/directToolCatalog/toolInputPreparation.d.ts +2 -2
  88. package/dist/tools/directToolCatalog/toolSchemaIntrospection.d.ts +10 -0
  89. package/dist/tools/directToolCatalog/toolSchemaRelations.d.ts +9 -0
  90. package/dist/tools/directToolCatalog/toolSpecifications.d.ts +13 -0
  91. package/dist/tools/directToolCatalog.exec.d.ts +1 -1
  92. package/dist/tools/directToolCatalog.meta.d.ts +1 -0
  93. package/dist/tools/executionGuard.d.ts +1 -2
  94. package/dist/tools/github_clone_repo/cache.d.ts +1 -2
  95. package/dist/tools/github_clone_repo/cacheArtifacts.d.ts +3 -0
  96. package/dist/tools/github_clone_repo/cachePaths.d.ts +1 -1
  97. package/dist/tools/github_clone_repo/cloneRepo.d.ts +1 -1
  98. package/dist/tools/github_clone_repo/execution.d.ts +1 -1
  99. package/dist/tools/github_clone_repo/scheme.d.ts +24 -24
  100. package/dist/tools/github_fetch_content/execution.d.ts +1 -1
  101. package/dist/tools/github_fetch_content/finalizer/types.d.ts +19 -16
  102. package/dist/tools/github_fetch_content/scheme.d.ts +19 -16
  103. package/dist/tools/github_fetch_content/types.d.ts +4 -3
  104. package/dist/tools/github_search/execution.d.ts +4 -0
  105. package/dist/tools/github_search/finalizer.d.ts +3 -0
  106. package/dist/tools/github_search/scheme.d.ts +79 -0
  107. package/dist/tools/github_search_code/execution.d.ts +4 -2
  108. package/dist/tools/github_search_code/finalizer/groups.d.ts +3 -3
  109. package/dist/tools/github_search_code/finalizer/ranking.d.ts +1 -2
  110. package/dist/tools/github_search_code/scheme.d.ts +10 -16
  111. package/dist/tools/github_search_pull_requests/contentRequest.d.ts +1 -4
  112. package/dist/tools/github_search_pull_requests/contentResponse/commentsShaping.d.ts +8 -4
  113. package/dist/tools/github_search_pull_requests/contentResponse/fileSurfaces.d.ts +13 -10
  114. package/dist/tools/github_search_pull_requests/contentResponse/nextCalls.d.ts +3 -2
  115. package/dist/tools/github_search_pull_requests/contentResponse/pagination.d.ts +10 -3
  116. package/dist/tools/github_search_pull_requests/execution/commitsMode.d.ts +2 -2
  117. package/dist/tools/github_search_pull_requests/execution/issuesMode.d.ts +2 -2
  118. package/dist/tools/github_search_pull_requests/execution/pullRequestsMode.d.ts +1 -1
  119. package/dist/tools/github_search_pull_requests/execution.d.ts +1 -1
  120. package/dist/tools/github_search_pull_requests/historyContinuations.d.ts +15 -0
  121. package/dist/tools/github_search_pull_requests/historyExecutions.d.ts +6 -0
  122. package/dist/tools/github_search_pull_requests/historyPartialContinuations.d.ts +5 -0
  123. package/dist/tools/github_search_pull_requests/historySchemes.d.ts +58 -0
  124. package/dist/tools/github_search_pull_requests/historySearchPagination.d.ts +3 -0
  125. package/dist/tools/github_search_pull_requests/scheme.d.ts +14 -30
  126. package/dist/tools/github_search_pull_requests/splitExecutions.d.ts +1 -2
  127. package/dist/tools/github_search_pull_requests/splitSchemes.d.ts +197 -181
  128. package/dist/tools/github_search_repos/execution/pagination.d.ts +4 -4
  129. package/dist/tools/github_search_repos/execution/queryVariants.d.ts +3 -1
  130. package/dist/tools/github_search_repos/execution.d.ts +3 -1
  131. package/dist/tools/github_search_repos/scheme.d.ts +5 -7
  132. package/dist/tools/github_view_repo_structure/execution.d.ts +4 -2
  133. package/dist/tools/github_view_repo_structure/scheme.d.ts +2 -4
  134. package/dist/tools/github_view_repo_structure/types.d.ts +3 -0
  135. package/dist/tools/local_analyze_graph/analysisTypes.d.ts +46 -0
  136. package/dist/tools/local_analyze_graph/analyzeGraph.d.ts +3 -0
  137. package/dist/tools/{local_dead_code → local_analyze_graph}/deadCodeScan.d.ts +2 -1
  138. package/dist/tools/{local_dead_code → local_analyze_graph}/entrypoints.d.ts +1 -0
  139. package/dist/tools/local_analyze_graph/execution.d.ts +4 -0
  140. package/dist/tools/local_analyze_graph/pagination.d.ts +3 -0
  141. package/dist/tools/{local_dead_code → local_analyze_graph}/retention.d.ts +1 -1
  142. package/dist/tools/{local_dead_code → local_analyze_graph}/scheme.d.ts +31 -15
  143. package/dist/tools/local_fetch_content/execution.d.ts +1 -1
  144. package/dist/tools/local_fetch_content/scheme.d.ts +2 -4
  145. package/dist/tools/local_find_files/execution.d.ts +1 -1
  146. package/dist/tools/local_find_files/findFiles.d.ts +1 -1
  147. package/dist/tools/local_find_files/findFilesNext.d.ts +3 -3
  148. package/dist/tools/local_find_files/scheme.d.ts +6 -2
  149. package/dist/tools/local_ripgrep/captureBudget.d.ts +1 -0
  150. package/dist/tools/local_ripgrep/execution.d.ts +1 -1
  151. package/dist/tools/local_ripgrep/rankingProfile/rankingLexical.d.ts +20 -0
  152. package/dist/tools/local_ripgrep/rankingProfile/rankingResults.d.ts +1 -18
  153. package/dist/tools/local_ripgrep/rankingProfile.d.ts +5 -4
  154. package/dist/tools/local_ripgrep/ripgrepResultBuilder/searchNext.d.ts +4 -1
  155. package/dist/tools/local_ripgrep/scheme.d.ts +9 -7
  156. package/dist/tools/local_ripgrep/structuralSearch.d.ts +1 -1
  157. package/dist/tools/local_search/execution.d.ts +5 -0
  158. package/dist/tools/local_search/scheme.d.ts +260 -0
  159. package/dist/tools/local_view_structure/execution.d.ts +1 -1
  160. package/dist/tools/local_view_structure/scheme.d.ts +8 -5
  161. package/dist/tools/local_view_structure/viewStructureNext.d.ts +3 -3
  162. package/dist/tools/lsp/semantic_content/execution.d.ts +1 -1
  163. package/dist/tools/lsp/semantic_content/scheme.d.ts +4 -42
  164. package/dist/tools/lsp/semantic_content/semanticEnvelopes/envelopeHelpers.d.ts +1 -1
  165. package/dist/tools/lsp/semantic_content/semanticFileOps/anchor.d.ts +1 -1
  166. package/dist/tools/lsp/semantic_content/semanticPresentation.d.ts +0 -1
  167. package/dist/tools/lsp/shared/semanticTypes.d.ts +6 -3
  168. package/dist/tools/package_search/execution.d.ts +6 -13
  169. package/dist/tools/package_search/pagination.d.ts +21 -0
  170. package/dist/tools/package_search/queryHelpers.d.ts +3 -5
  171. package/dist/tools/package_search/scheme.d.ts +12 -7
  172. package/dist/tools/providerExecution.d.ts +3 -4
  173. package/dist/tools/providerMappers/codeSearch.d.ts +3 -4
  174. package/dist/tools/providerMappers/fileContent.d.ts +1 -2
  175. package/dist/tools/providerMappers/pullRequests.d.ts +6 -6
  176. package/dist/tools/providerMappers/repoSearch.d.ts +7 -4
  177. package/dist/tools/providerMappers/repoStructure.d.ts +2 -3
  178. package/dist/tools/toolCatalogFactory.d.ts +5 -6
  179. package/dist/tools/toolConfig.d.ts +6 -17
  180. package/dist/tools/toolMetadata/baseSchema.d.ts +1 -2
  181. package/dist/tools/toolMetadata/descriptions.d.ts +1 -1
  182. package/dist/tools/toolMetadata/names.d.ts +18 -2
  183. package/dist/tools/toolMetadata/state.d.ts +3 -3
  184. package/dist/tools/toolMetadata/types.d.ts +1 -1
  185. package/dist/tools/toolNames.d.ts +16 -3
  186. package/dist/tools/toolSchemaImports.d.ts +5 -4
  187. package/dist/tools/utils.d.ts +3 -6
  188. package/dist/types/bulk.d.ts +11 -1
  189. package/dist/types/execution.d.ts +6 -1
  190. package/dist/types/server.d.ts +0 -2
  191. package/dist/types/toolOutput.d.ts +10 -9
  192. package/dist/types/toolResults.d.ts +17 -1
  193. package/dist/utils/contextUtils.d.ts +4 -2
  194. package/dist/utils/file/toolHelpers.d.ts +1 -1
  195. package/dist/utils/http/cache/conditional.d.ts +9 -4
  196. package/dist/utils/http/cache/dataCache.d.ts +7 -2
  197. package/dist/utils/http/cache/diskStore.d.ts +30 -0
  198. package/dist/utils/http/cache/management.d.ts +5 -0
  199. package/dist/utils/http/cache/store.d.ts +1 -0
  200. package/dist/utils/http/cache/trace.d.ts +10 -0
  201. package/dist/utils/http/cache.d.ts +1 -0
  202. package/dist/utils/package/types.d.ts +5 -2
  203. package/dist/utils/pagination/charLimit.d.ts +0 -2
  204. package/dist/utils/response/bulk/pagination.d.ts +2 -1
  205. package/dist/utils/response/bulk/paginationDiagnostics.d.ts +2 -0
  206. package/dist/utils/response/bulk/queries.d.ts +0 -9
  207. package/dist/utils/response/bulk/response.d.ts +3 -2
  208. package/dist/utils/response/bulk.d.ts +1 -1
  209. package/dist/utils/response/callToolResult.d.ts +1 -1
  210. package/dist/utils/response/error.d.ts +3 -4
  211. package/dist/utils/response/groupedFinalizer.d.ts +2 -6
  212. package/dist/utils/response/normalizedError.d.ts +6 -0
  213. package/dist/utils/response/responseChannels.d.ts +4 -0
  214. package/package.json +7 -6
  215. package/dist/github/discussions.d.ts +0 -45
  216. package/dist/github/releases.d.ts +0 -45
  217. package/dist/scheme/responseEnvelope.d.ts +0 -88
  218. package/dist/tools/github_search_discussions/execution.d.ts +0 -15
  219. package/dist/tools/github_search_discussions/scheme.d.ts +0 -16
  220. package/dist/tools/github_search_pull_requests/execution/releasesMode.d.ts +0 -4
  221. package/dist/tools/local_dead_code/execution.d.ts +0 -4
  222. package/dist/tools/local_dead_code/local_dead_code.d.ts +0 -5
  223. package/dist/tools/local_find_files/pathPatternBraces.d.ts +0 -20
  224. package/dist/tools/toolMetadata/gateway.d.ts +0 -7
@@ -5,4 +5,4 @@ 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{randomUUID as nt}from"node:crypto";import{existsSync as M,readFileSync as Se,writeFileSync as Ye,unlinkSync as Ze,renameSync as Qe}from"node:fs";import{isStatsEnabled as ge}from"@octocodeai/config";function p(e){return e.toLowerCase().replace(/^https?:\/\//,"").replace(/\/$/,"")}function w(e){if(!e.token.expiresAt)return!1;let t=new Date(e.token.expiresAt);if(isNaN(t.getTime()))return!0;let r=new Date;return t.getTime()-r.getTime()<300*1e3}function B(e){if(!e.token.refreshTokenExpiresAt)return!1;let t=new Date(e.token.refreshTokenExpiresAt);return isNaN(t.getTime())?!0:new Date>=t}var P=new Map,ve=300*1e3;function Re(e){let t=p(e),r=P.get(t);return!r||Date.now()-r.cachedAt>=ve?!1:r.credentials?!w(r.credentials):!0}function q(e){e?P.delete(p(e)):P.clear()}function V(e){let t=p(e);if(Re(t))return P.get(t).credentials}function Y(e,t){let r=p(e);P.set(r,{credentials:t,cachedAt:Date.now()})}import{existsSync as X,readFileSync as ee,writeFileSync as te,unlinkSync as _t,statSync as He,chmodSync as Oe}from"node:fs";import{createCipheriv as De,createDecipheriv as Ie,randomBytes as re}from"node:crypto";import{existsSync as be,mkdirSync as we}from"node:fs";import{join as u}from"node:path";import{getOctocodeHome as Pe}from"@octocodeai/config";var Ee=448;function Ae(){return Pe(process.env)}var c=Ae(),d={home:c,config:u(c,".octocoderc"),credentials:u(c,"credentials.json"),key:u(c,".key"),session:u(c,"session.json"),stats:u(c,"stats.json"),tmp:u(c,"tmp"),clone:u(c,"tmp","clone"),tree:u(c,"tmp","tree"),repos:u(c,"tmp","clone"),cliConfig:u(c,"config.json"),lspConfig:u(c,"lsp-servers.json")};function Z(){be(d.home)||we(d.home,{recursive:!0,mode:Ee})}import{z as a}from"zod";var Le=a.object({token:a.string(),tokenType:a.literal("oauth"),scopes:a.array(a.string()).optional(),refreshToken:a.string().optional(),expiresAt:a.string().optional(),refreshTokenExpiresAt:a.string().optional()}),Fe=a.object({hostname:a.string(),username:a.string(),token:Le,gitProtocol:a.enum(["ssh","https"]),createdAt:a.string(),updatedAt:a.string()}),Q=a.object({version:a.number(),credentials:a.record(a.string(),Fe)});var _e=d.home,D=d.credentials,T=d.key,se="aes-256-gcm",Ge=16;function y(){Z()}function ne(){if(y(),X(T))return He(T).mode&511&63&&Oe(T,384),Buffer.from(ee(T,"utf8"),"hex");let e=re(32);return te(T,e.toString("hex"),{mode:384}),e}function oe(e){let t=ne(),r=re(Ge),s=De(se,t,r),n=s.update(e,"utf8","hex");n+=s.final("hex");let i=s.getAuthTag();return`${r.toString("hex")}:${i.toString("hex")}:${n}`}function ie(e){let t=ne(),[r,s,n]=e.split(":");if(!r||!s||!n)throw new Error("Invalid encrypted data format");let i=Buffer.from(r,"hex"),k=Buffer.from(s,"hex"),h=Ie(se,t,i);h.setAuthTag(k);let J=h.update(n,"hex","utf8");return J+=h.final("utf8"),J}function N(){if(y(),!X(D))return{version:1,credentials:{}};try{let e=ee(D,"utf8"),t=ie(e),r=JSON.parse(t),s=Q.safeParse(r);return s.success?s.data:{version:1,credentials:{}}}catch{return{version:1,credentials:{}}}}function ae(e){y();let t=oe(JSON.stringify(e,null,2));te(D,t,{mode:384})}import{refreshToken as Ue}from"@octokit/oauth-methods";import{request as je}from"@octokit/request";var I="178c6fc778ccc68e1d6a",E="github.com";function Be(e){return e.replace(/\b(ghp_|gho_|ghu_|ghs_|ghr_)[a-zA-Z0-9]{36,}\b/g,"***MASKED***").replace(/\b[a-zA-Z0-9]{40,}\b/g,"***MASKED***")}function Ne(e){return e==="github.com"||e===E?"https://api.github.com":`https://${e}/api/v3`}async function ce(e,t=E,r=I){let s=await e.getCredentials(t);if(!s)return{success:!1,error:`Not logged in to ${t}`};if(!s.token.refreshToken)return{success:!1,error:"Token does not support refresh (OAuth App tokens do not expire)"};if(B(s))return{success:!1,error:"Refresh token has expired. Please login again."};try{let n=await Ue({clientType:"github-app",clientId:r,clientSecret:"",refreshToken:s.token.refreshToken,request:je.defaults({baseUrl:Ne(t)})}),i={token:n.authentication.token,tokenType:"oauth",refreshToken:n.authentication.refreshToken,expiresAt:n.authentication.expiresAt,refreshTokenExpiresAt:n.authentication.refreshTokenExpiresAt};return await e.updateToken(t,i),{success:!0,username:s.username,hostname:t}}catch(n){return{success:!1,error:n instanceof Error?Be(n.message):"Token refresh failed"}}}async function ue(e,t=E,r=I){let s=await e.getCredentials(t);if(!s||!s.token)return{token:null,source:"none"};if(!w(s))return{token:s.token.token,source:"stored",username:s.username};if(s.token.refreshToken){let n=await ce(e,t,r);if(n.success){let i=await e.getCredentials(t);if(i?.token.token)return{token:i.token.token,source:"refreshed",username:i.username}}return{token:null,source:"none",refreshError:n.error}}return{token:null,source:"none",refreshError:"Token expired and no refresh token available"}}import{resolveEnvToken as Qt}from"@octocodeai/config";import{execFile as qt}from"child_process";var Me=null;function le(e){Me=e}async function ze(e){let t=p(e.hostname),r={...e,hostname:t,updatedAt:new Date().toISOString()};try{let s=N();return s.credentials[t]=r,ae(s),q(t),{success:!0}}catch{throw new Error("Failed to store credentials")}}async function de(e="github.com",t){let r=p(e);if(!t?.bypassCache){let i=V(r);if(i!==void 0)return i}let n=N().credentials[r]||null;return Y(r,n),n}async function We(e,t){let r=await de(e);return r?(r.token=t,r.updatedAt=new Date().toISOString(),await ze(r),!0):!1}async function $e(e,t){return ue({getCredentials:de,updateToken:We},e,t)}le({getTokenWithRefresh:$e});import{z as o}from"zod";var Ke=o.object({rawChars:o.number(),responseChars:o.number(),savedChars:o.number(),calls:o.number()}),Je=o.object({hits:o.record(o.string(),o.number()).default({}),rateLimits:o.number().default(0)}),_=o.record(o.string(),o.number()).default({}),qe=o.object({toolCalls:o.number(),errors:o.number(),rateLimits:o.number(),rateLimitsByProvider:_,rawChars:o.number(),responseChars:o.number(),savedChars:o.number(),charSavingsCalls:o.number(),githubCacheHits:o.number(),githubCacheRateLimits:o.number(),packageRegistryFailures:o.number().default(0),packageRegistryFailuresByRegistry:_}),G=o.object({toolCalls:o.number(),errors:o.number(),rateLimits:o.number(),rateLimitsByProvider:_,charsSavedByTool:o.record(o.string(),Ke).default({}),githubCacheHits:Je.default({hits:{},rateLimits:0}),packageRegistryFailures:_,totalUsage:qe.optional()}),fe=o.object({version:o.literal(1),sessionId:o.string(),createdAt:o.string(),lastActiveAt:o.string(),stats:G.optional()}),he=o.object({version:o.literal(1),stats:G});function pe(e){return Object.values(e).reduce((t,r)=>t+r,0)}function Ve(e){let t=e.charsSavedByTool??{},r=e.githubCacheHits??{hits:{},rateLimits:0},s=e.rateLimitsByProvider??{},n=e.packageRegistryFailures??{},i=Object.values(t).reduce((k,h)=>({rawChars:k.rawChars+h.rawChars,responseChars:k.responseChars+h.responseChars,savedChars:k.savedChars+h.savedChars,charSavingsCalls:k.charSavingsCalls+h.calls}),{rawChars:0,responseChars:0,savedChars:0,charSavingsCalls:0});return{toolCalls:e.toolCalls,errors:e.errors,rateLimits:e.rateLimits,rateLimitsByProvider:s,...i,githubCacheHits:pe(r.hits),githubCacheRateLimits:r.rateLimits,packageRegistryFailures:pe(n),packageRegistryFailuresByRegistry:n}}function m(e){let t={...e,rateLimitsByProvider:e.rateLimitsByProvider??{},charsSavedByTool:e.charsSavedByTool??{},githubCacheHits:e.githubCacheHits??{hits:{},rateLimits:0},packageRegistryFailures:e.packageRegistryFailures??{}};return{...t,totalUsage:Ve(t)}}function S(){return m({toolCalls:0,errors:0,rateLimits:0,rateLimitsByProvider:{},charsSavedByTool:{},githubCacheHits:{hits:{},rateLimits:0},packageRegistryFailures:{}})}var x=d.session,v=d.stats;function me(e,t){let r=`${e}.tmp`;Ye(r,JSON.stringify(t,null,2),{mode:384}),Qe(r,e)}function Xe(e){let t=JSON.parse(e),r=he.safeParse(t);if(r.success)return m(r.data.stats);let s=G.safeParse(t);return s.success?m(s.data):null}function et(){if(!M(v))return S();try{let e=Se(v,"utf8");return Xe(e)??S()}catch{return S()}}function U(e){y(),ge()&&me(v,{version:e.version,stats:m(e.stats)});let{stats:t,...r}=e;me(x,r)}function Ce(){if(!M(x))return null;try{let e=Se(x,"utf8"),t=JSON.parse(e),r=fe.safeParse(t);return r.success?{...r.data,stats:ge()?et():S()}:null}catch{return null}}function ke(){let e=!1;for(let t of[x,v])if(M(t))try{Ze(t),e=!0}catch{return!1}return e}var tt=6e4,l=null,g=!1,R=null,z=!1,A=null,L=null,F=null,j=!1;function rt(){z||(z=!0,A=()=>{H()},L=()=>{H()},F=()=>{H()},process.on("exit",A),process.on("SIGINT",L),process.on("SIGTERM",F))}function W(){A&&(process.removeListener("exit",A),A=null),L&&(process.removeListener("SIGINT",L),L=null),F&&(process.removeListener("SIGTERM",F),F=null),z=!1}function st(){R||(R=setInterval(()=>{g&&l&&(U(l),g=!1)},tt),R.unref())}function $(){R&&(clearInterval(R),R=null)}function b(){if(l)return l;let e=Ce();return e&&(l=e),e}function C(e){l=e,g=!0,rt(),st()}function O(){g&&l&&(U(l),g=!1)}function H(){if(!j&&g&&l){j=!0;try{U(l),g=!1}catch{}finally{j=!1}}}function K(){l=null,g=!1,j=!1}function Te(){K(),$(),W()}var ot=1;function it(e){return m(e)}function at(e,t){if(!t)return e;let r={...e};for(let[s,n]of Object.entries(t)){let i=r[s]??{rawChars:0,responseChars:0,savedChars:0,calls:0};r[s]={rawChars:i.rawChars+n.rawChars,responseChars:i.responseChars+n.responseChars,savedChars:i.savedChars+n.savedChars,calls:i.calls+n.calls}}return r}function ye(e,t){if(!t)return e;let r={...e};for(let[s,n]of Object.entries(t))r[s]=(r[s]??0)+n;return r}function ct(e,t){if(!t)return e;let r={...e.hits};for(let[s,n]of Object.entries(t.hits??{}))r[s]=(r[s]??0)+n;return{hits:r,rateLimits:e.rateLimits+(t.rateLimits??0)}}function xe(){let e=new Date().toISOString();return{version:ot,sessionId:nt(),createdAt:e,lastActiveAt:e,stats:S()}}function ut(){return b()}function lt(e){C(e)}function dt(){O()}function ft(){H()}function ht(e){if(e?.forceNew){let s=xe();return C(s),O(),s}let t=b();if(t){let s={...t,lastActiveAt:new Date().toISOString()};return C(s),O(),s}let r=xe();return C(r),O(),r}function pt(){return b()?.sessionId??null}function f(e){let t=b();if(!t)return{success:!1,session:null};let r=it(t.stats),s=m({toolCalls:r.toolCalls+(e.toolCalls??0),errors:r.errors+(e.errors??0),rateLimits:r.rateLimits+(e.rateLimits??0),rateLimitsByProvider:ye(r.rateLimitsByProvider,e.rateLimitsByProvider),charsSavedByTool:at(r.charsSavedByTool,e.charsSavedByTool),githubCacheHits:ct(r.githubCacheHits,e.githubCacheHits),packageRegistryFailures:ye(r.packageRegistryFailures,e.packageRegistryFailures)}),n={...t,lastActiveAt:new Date().toISOString(),stats:s};return C(n),{success:!0,session:n}}function mt(e=1){return f({toolCalls:e})}function St(e=1){return f({errors:e})}function gt(e=1){return f({rateLimits:e})}function Ct(e,t=1){return f({rateLimits:t,rateLimitsByProvider:{[e]:t}})}function kt(e,t,r){let s=Number.isFinite(t)?Math.max(0,t):0,n=Number.isFinite(r)?Math.max(0,r):0;return f({charsSavedByTool:{[e]:{rawChars:s,responseChars:n,savedChars:Math.max(0,s-n),calls:1}}})}function Tt(e,t=1){return f({githubCacheHits:{hits:{[e]:t},rateLimits:0}})}function yt(e=1){return f({githubCacheHits:{hits:{},rateLimits:e}})}function xt(e,t=1){return f({packageRegistryFailures:{[e]:t}})}function vt(){let e=b();if(!e)return{success:!1,session:null};let t={...e,lastActiveAt:new Date().toISOString(),stats:S()};return C(t),{success:!0,session:t}}function Rt(){return K(),$(),W(),ke()}function bt(){Te()}export{x as SESSION_FILE,v as STATS_FILE,bt as _resetSessionState,Rt as deleteSession,dt as flushSession,ft as flushSessionSync,ht as getOrCreateSession,pt as getSessionId,St as incrementErrors,Tt as incrementGitHubCacheHits,yt as incrementGitHubCacheRateLimits,xt as incrementPackageRegistryFailures,Ct as incrementRateLimitByProvider,gt as incrementRateLimits,mt as incrementToolCalls,kt as incrementToolCharSavings,ut as readSession,vt as resetSessionStats,f as updateSessionStats,lt as writeSession};
8
+ import{randomUUID as ot}from"node:crypto";import{existsSync as M,readFileSync as Se,writeFileSync as Ze,unlinkSync as Qe,renameSync as Xe}from"node:fs";import{isPersistentStorageEnabled as ge,isStatsEnabled as Ce}from"@octocodeai/config";function p(e){return e.toLowerCase().replace(/^https?:\/\//,"").replace(/\/$/,"")}function w(e){if(!e.token.expiresAt)return!1;let t=new Date(e.token.expiresAt);if(isNaN(t.getTime()))return!0;let r=new Date;return t.getTime()-r.getTime()<300*1e3}function B(e){if(!e.token.refreshTokenExpiresAt)return!1;let t=new Date(e.token.refreshTokenExpiresAt);return isNaN(t.getTime())?!0:new Date>=t}var P=new Map,Re=300*1e3;function be(e){let t=p(e),r=P.get(t);return!r||Date.now()-r.cachedAt>=Re?!1:r.credentials?!w(r.credentials):!0}function q(e){e?P.delete(p(e)):P.clear()}function V(e){let t=p(e);if(be(t))return P.get(t).credentials}function Y(e,t){let r=p(e);P.set(r,{credentials:t,cachedAt:Date.now()})}import{existsSync as X,readFileSync as ee,writeFileSync as te,unlinkSync as Gt,statSync as Oe,chmodSync as De}from"node:fs";import{createCipheriv as Ie,createDecipheriv as _e,randomBytes as re}from"node:crypto";import{existsSync as we,mkdirSync as Pe}from"node:fs";import{join as u}from"node:path";import{getOctocodeHome as Ee}from"@octocodeai/config";var Ae=448;function Le(){return Ee(process.env)}var c=Le(),d={home:c,config:u(c,".octocoderc"),credentials:u(c,"credentials.json"),key:u(c,".key"),session:u(c,"session.json"),stats:u(c,"stats.json"),tmp:u(c,"tmp"),clone:u(c,"tmp","clone"),tree:u(c,"tmp","tree"),response:u(c,"tmp","response"),repos:u(c,"tmp","clone"),cliConfig:u(c,"config.json"),lspConfig:u(c,"lsp-servers.json")};function Z(){we(d.home)||Pe(d.home,{recursive:!0,mode:Ae})}import{z as a}from"zod";var Fe=a.object({token:a.string(),tokenType:a.literal("oauth"),scopes:a.array(a.string()).optional(),refreshToken:a.string().optional(),expiresAt:a.string().optional(),refreshTokenExpiresAt:a.string().optional()}),He=a.object({hostname:a.string(),username:a.string(),token:Fe,gitProtocol:a.enum(["ssh","https"]),createdAt:a.string(),updatedAt:a.string()}),Q=a.object({version:a.number(),credentials:a.record(a.string(),He)});var Ge=d.home,D=d.credentials,T=d.key,se="aes-256-gcm",Ue=16;function y(){Z()}function ne(){if(y(),X(T))return Oe(T).mode&511&63&&De(T,384),Buffer.from(ee(T,"utf8"),"hex");let e=re(32);return te(T,e.toString("hex"),{mode:384}),e}function oe(e){let t=ne(),r=re(Ue),s=Ie(se,t,r),n=s.update(e,"utf8","hex");n+=s.final("hex");let i=s.getAuthTag();return`${r.toString("hex")}:${i.toString("hex")}:${n}`}function ie(e){let t=ne(),[r,s,n]=e.split(":");if(!r||!s||!n)throw new Error("Invalid encrypted data format");let i=Buffer.from(r,"hex"),k=Buffer.from(s,"hex"),h=_e(se,t,i);h.setAuthTag(k);let J=h.update(n,"hex","utf8");return J+=h.final("utf8"),J}function N(){if(y(),!X(D))return{version:1,credentials:{}};try{let e=ee(D,"utf8"),t=ie(e),r=JSON.parse(t),s=Q.safeParse(r);return s.success?s.data:{version:1,credentials:{}}}catch{return{version:1,credentials:{}}}}function ae(e){y();let t=oe(JSON.stringify(e,null,2));te(D,t,{mode:384})}import{refreshToken as je}from"@octokit/oauth-methods";import{request as Be}from"@octokit/request";var I="178c6fc778ccc68e1d6a",E="github.com";function Ne(e){return e.replace(/\b(ghp_|gho_|ghu_|ghs_|ghr_)[a-zA-Z0-9]{36,}\b/g,"***MASKED***").replace(/\b[a-zA-Z0-9]{40,}\b/g,"***MASKED***")}function Me(e){return e==="github.com"||e===E?"https://api.github.com":`https://${e}/api/v3`}async function ce(e,t=E,r=I){let s=await e.getCredentials(t);if(!s)return{success:!1,error:`Not logged in to ${t}`};if(!s.token.refreshToken)return{success:!1,error:"Token does not support refresh (OAuth App tokens do not expire)"};if(B(s))return{success:!1,error:"Refresh token has expired. Please login again."};try{let n=await je({clientType:"github-app",clientId:r,clientSecret:"",refreshToken:s.token.refreshToken,request:Be.defaults({baseUrl:Me(t)})}),i={token:n.authentication.token,tokenType:"oauth",refreshToken:n.authentication.refreshToken,expiresAt:n.authentication.expiresAt,refreshTokenExpiresAt:n.authentication.refreshTokenExpiresAt};return await e.updateToken(t,i),{success:!0,username:s.username,hostname:t}}catch(n){return{success:!1,error:n instanceof Error?Ne(n.message):"Token refresh failed"}}}async function ue(e,t=E,r=I){let s=await e.getCredentials(t);if(!s||!s.token)return{token:null,source:"none"};if(!w(s))return{token:s.token.token,source:"stored",username:s.username};if(s.token.refreshToken){let n=await ce(e,t,r);if(n.success){let i=await e.getCredentials(t);if(i?.token.token)return{token:i.token.token,source:"refreshed",username:i.username}}return{token:null,source:"none",refreshError:n.error}}return{token:null,source:"none",refreshError:"Token expired and no refresh token available"}}import{resolveEnvToken as Xt}from"@octocodeai/config";import{execFile as Vt}from"child_process";var ze=null;function le(e){ze=e}async function We(e){let t=p(e.hostname),r={...e,hostname:t,updatedAt:new Date().toISOString()};try{let s=N();return s.credentials[t]=r,ae(s),q(t),{success:!0}}catch{throw new Error("Failed to store credentials")}}async function de(e="github.com",t){let r=p(e);if(!t?.bypassCache){let i=V(r);if(i!==void 0)return i}let n=N().credentials[r]||null;return Y(r,n),n}async function $e(e,t){let r=await de(e);return r?(r.token=t,r.updatedAt=new Date().toISOString(),await We(r),!0):!1}async function Ke(e,t){return ue({getCredentials:de,updateToken:$e},e,t)}le({getTokenWithRefresh:Ke});import{z as o}from"zod";var Je=o.object({rawChars:o.number(),responseChars:o.number(),savedChars:o.number(),calls:o.number()}),qe=o.object({hits:o.record(o.string(),o.number()).default({}),rateLimits:o.number().default(0)}),_=o.record(o.string(),o.number()).default({}),Ve=o.object({toolCalls:o.number(),errors:o.number(),rateLimits:o.number(),rateLimitsByProvider:_,rawChars:o.number(),responseChars:o.number(),savedChars:o.number(),charSavingsCalls:o.number(),githubCacheHits:o.number(),githubCacheRateLimits:o.number(),packageRegistryFailures:o.number().default(0),packageRegistryFailuresByRegistry:_}),G=o.object({toolCalls:o.number(),errors:o.number(),rateLimits:o.number(),rateLimitsByProvider:_,charsSavedByTool:o.record(o.string(),Je).default({}),githubCacheHits:qe.default({hits:{},rateLimits:0}),packageRegistryFailures:_,totalUsage:Ve.optional()}),fe=o.object({version:o.literal(1),sessionId:o.string(),createdAt:o.string(),lastActiveAt:o.string(),stats:G.optional()}),he=o.object({version:o.literal(1),stats:G});function pe(e){return Object.values(e).reduce((t,r)=>t+r,0)}function Ye(e){let t=e.charsSavedByTool??{},r=e.githubCacheHits??{hits:{},rateLimits:0},s=e.rateLimitsByProvider??{},n=e.packageRegistryFailures??{},i=Object.values(t).reduce((k,h)=>({rawChars:k.rawChars+h.rawChars,responseChars:k.responseChars+h.responseChars,savedChars:k.savedChars+h.savedChars,charSavingsCalls:k.charSavingsCalls+h.calls}),{rawChars:0,responseChars:0,savedChars:0,charSavingsCalls:0});return{toolCalls:e.toolCalls,errors:e.errors,rateLimits:e.rateLimits,rateLimitsByProvider:s,...i,githubCacheHits:pe(r.hits),githubCacheRateLimits:r.rateLimits,packageRegistryFailures:pe(n),packageRegistryFailuresByRegistry:n}}function m(e){let t={...e,rateLimitsByProvider:e.rateLimitsByProvider??{},charsSavedByTool:e.charsSavedByTool??{},githubCacheHits:e.githubCacheHits??{hits:{},rateLimits:0},packageRegistryFailures:e.packageRegistryFailures??{}};return{...t,totalUsage:Ye(t)}}function S(){return m({toolCalls:0,errors:0,rateLimits:0,rateLimitsByProvider:{},charsSavedByTool:{},githubCacheHits:{hits:{},rateLimits:0},packageRegistryFailures:{}})}var x=d.session,v=d.stats;function me(e,t){let r=`${e}.tmp`;Ze(r,JSON.stringify(t,null,2),{mode:384}),Xe(r,e)}function et(e){let t=JSON.parse(e),r=he.safeParse(t);if(r.success)return m(r.data.stats);let s=G.safeParse(t);return s.success?m(s.data):null}function tt(){if(!M(v))return S();try{let e=Se(v,"utf8");return et(e)??S()}catch{return S()}}function U(e){if(!ge())return;y(),Ce()&&me(v,{version:e.version,stats:m(e.stats)});let{stats:t,...r}=e;me(x,r)}function ke(){if(!ge()||!M(x))return null;try{let e=Se(x,"utf8"),t=JSON.parse(e),r=fe.safeParse(t);return r.success?{...r.data,stats:Ce()?tt():S()}:null}catch{return null}}function Te(){let e=!1;for(let t of[x,v])if(M(t))try{Qe(t),e=!0}catch{return!1}return e}var rt=6e4,l=null,g=!1,R=null,z=!1,A=null,L=null,F=null,j=!1;function st(){z||(z=!0,A=()=>{H()},L=()=>{H()},F=()=>{H()},process.on("exit",A),process.on("SIGINT",L),process.on("SIGTERM",F))}function W(){A&&(process.removeListener("exit",A),A=null),L&&(process.removeListener("SIGINT",L),L=null),F&&(process.removeListener("SIGTERM",F),F=null),z=!1}function nt(){R||(R=setInterval(()=>{g&&l&&(U(l),g=!1)},rt),R.unref())}function $(){R&&(clearInterval(R),R=null)}function b(){if(l)return l;let e=ke();return e&&(l=e),e}function C(e){l=e,g=!0,st(),nt()}function O(){g&&l&&(U(l),g=!1)}function H(){if(!j&&g&&l){j=!0;try{U(l),g=!1}catch{}finally{j=!1}}}function K(){l=null,g=!1,j=!1}function ye(){K(),$(),W()}var it=1;function at(e){return m(e)}function ct(e,t){if(!t)return e;let r={...e};for(let[s,n]of Object.entries(t)){let i=r[s]??{rawChars:0,responseChars:0,savedChars:0,calls:0};r[s]={rawChars:i.rawChars+n.rawChars,responseChars:i.responseChars+n.responseChars,savedChars:i.savedChars+n.savedChars,calls:i.calls+n.calls}}return r}function xe(e,t){if(!t)return e;let r={...e};for(let[s,n]of Object.entries(t))r[s]=(r[s]??0)+n;return r}function ut(e,t){if(!t)return e;let r={...e.hits};for(let[s,n]of Object.entries(t.hits??{}))r[s]=(r[s]??0)+n;return{hits:r,rateLimits:e.rateLimits+(t.rateLimits??0)}}function ve(){let e=new Date().toISOString();return{version:it,sessionId:ot(),createdAt:e,lastActiveAt:e,stats:S()}}function lt(){return b()}function dt(e){C(e)}function ft(){O()}function ht(){H()}function pt(e){if(e?.forceNew){let s=ve();return C(s),O(),s}let t=b();if(t){let s={...t,lastActiveAt:new Date().toISOString()};return C(s),O(),s}let r=ve();return C(r),O(),r}function mt(){return b()?.sessionId??null}function f(e){let t=b();if(!t)return{success:!1,session:null};let r=at(t.stats),s=m({toolCalls:r.toolCalls+(e.toolCalls??0),errors:r.errors+(e.errors??0),rateLimits:r.rateLimits+(e.rateLimits??0),rateLimitsByProvider:xe(r.rateLimitsByProvider,e.rateLimitsByProvider),charsSavedByTool:ct(r.charsSavedByTool,e.charsSavedByTool),githubCacheHits:ut(r.githubCacheHits,e.githubCacheHits),packageRegistryFailures:xe(r.packageRegistryFailures,e.packageRegistryFailures)}),n={...t,lastActiveAt:new Date().toISOString(),stats:s};return C(n),{success:!0,session:n}}function St(e=1){return f({toolCalls:e})}function gt(e=1){return f({errors:e})}function Ct(e=1){return f({rateLimits:e})}function kt(e,t=1){return f({rateLimits:t,rateLimitsByProvider:{[e]:t}})}function Tt(e,t,r){let s=Number.isFinite(t)?Math.max(0,t):0,n=Number.isFinite(r)?Math.max(0,r):0;return f({charsSavedByTool:{[e]:{rawChars:s,responseChars:n,savedChars:Math.max(0,s-n),calls:1}}})}function yt(e,t=1){return f({githubCacheHits:{hits:{[e]:t},rateLimits:0}})}function xt(e=1){return f({githubCacheHits:{hits:{},rateLimits:e}})}function vt(e,t=1){return f({packageRegistryFailures:{[e]:t}})}function Rt(){let e=b();if(!e)return{success:!1,session:null};let t={...e,lastActiveAt:new Date().toISOString(),stats:S()};return C(t),{success:!0,session:t}}function bt(){return K(),$(),W(),Te()}function wt(){ye()}export{x as SESSION_FILE,v as STATS_FILE,wt as _resetSessionState,bt as deleteSession,ft as flushSession,ht as flushSessionSync,pt as getOrCreateSession,mt as getSessionId,gt as incrementErrors,yt as incrementGitHubCacheHits,xt as incrementGitHubCacheRateLimits,vt as incrementPackageRegistryFailures,kt as incrementRateLimitByProvider,Ct as incrementRateLimits,St as incrementToolCalls,Tt as incrementToolCharSavings,lt as readSession,Rt as resetSessionStats,f as updateSessionStats,dt as writeSession};
@@ -0,0 +1,14 @@
1
+ /** Canonical agent-facing descriptions for the public direct tools. */
2
+ export declare const PUBLIC_TOOL_DESCRIPTIONS: {
3
+ readonly ghSearch: "Choose operation:\"code\" for code contents or file paths, \"repositories\" to discover repositories, or \"tree\" to browse a known repository.\nEach 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.";
4
+ readonly 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\".\nOptionally 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\".";
5
+ readonly 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.";
6
+ readonly 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.";
7
+ readonly 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.";
8
+ readonly 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.";
9
+ readonly 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.";
10
+ readonly 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—verify changes and deletions with exact reads plus LSP.";
11
+ readonly 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\".\nOptionally 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.";
12
+ readonly 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.\ndocumentSymbols/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.";
13
+ };
14
+ export type PublicToolName = keyof typeof PUBLIC_TOOL_DESCRIPTIONS;
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ import type { ToolNames } from '../types/index.js';
3
+ export declare const toolNames: ToolNames;
4
+ export declare const baseSchema: z.ZodObject<{
5
+ goal: z.ZodOptional<z.ZodString>;
6
+ reasoning: z.ZodOptional<z.ZodString>;
7
+ }, z.core.$strip>;
8
+ export type BaseSchemaShape = typeof baseSchema.shape;
9
+ /**
10
+ * Flat `field -> description` map derived from the Zod `baseSchema`. Consumed by
11
+ * `generateDefaultJson` (serialized verbatim under the `baseSchema` JSON key)
12
+ * and by `buildObject`, which merges these onto each tool's meta fields. Keeps
13
+ * the shipped JSON a plain string map while the source of truth stays Zod.
14
+ */
15
+ export declare const baseSchemaDescriptions: Record<keyof BaseSchemaShape, string>;
@@ -0,0 +1 @@
1
+ export declare function getToolSchemaRelations(toolName: string): string[];
@@ -0,0 +1,9 @@
1
+ export interface ToolSchemaVariant {
2
+ name: string;
3
+ when: string;
4
+ requires: string[];
5
+ fields?: string[];
6
+ excludes?: string[];
7
+ example: Record<string, unknown>;
8
+ }
9
+ export declare function getToolSchemaVariants(name: string): ToolSchemaVariant[];
@@ -0,0 +1,75 @@
1
+ import { z } from 'zod';
2
+ import type { ToolSchema, ToolSpec, ToolType } from '../../types/index.js';
3
+ export declare const MAX_CONTEXT_LINES = 100;
4
+ export declare const MAX_PAGE_NUMBER = 1000;
5
+ export declare const MAX_CHAR_OFFSET = 100000000;
6
+ export declare const MAX_CHAR_LENGTH = 50000;
7
+ export declare const MAX_LINE_NUMBER = 1000000000;
8
+ export declare const MAX_ORDER_HINT = 100000;
9
+ export declare const MAX_LOCAL_DEPTH = 20;
10
+ export declare const MAX_FIND_DEPTH = 100;
11
+ export declare const MAX_LOCAL_LIMIT = 10000;
12
+ export declare const MAX_LOCAL_ITEMS_PER_PAGE = 50;
13
+ export declare const MAX_GITHUB_SEARCH_LIMIT = 100;
14
+ export declare const DEFAULT_GITHUB_SEARCH_LIMIT = 30;
15
+ export declare const MAX_GITHUB_STRUCTURE_ITEMS_PER_PAGE = 200;
16
+ export declare const DEFAULT_GITHUB_STRUCTURE_ITEMS_PER_PAGE = 100;
17
+ export declare const MAX_PR_ITEMS_PER_PAGE = 100;
18
+ export declare const DEFAULT_PR_ITEMS_PER_PAGE = 20;
19
+ export declare const MAX_MATCH_CONTENT_LENGTH = 100000;
20
+ export declare const DEFAULT_MATCH_CONTENT_LENGTH = 500;
21
+ export declare const MAX_MATCH_COUNT = 100000;
22
+ export declare const MAX_SEARCH_ITEMS_PER_PAGE = 1000;
23
+ export declare const MAX_LSP_DEPTH = 20;
24
+ export declare const MAX_LSP_ITEMS_PER_PAGE = 100;
25
+ export declare const MAX_GITHUB_STRUCTURE_DEPTH = 20;
26
+ export declare const MAX_BINARY_ENTRIES = 10000;
27
+ export declare const DEFAULT_BINARY_ENTRIES = 1000;
28
+ export declare const MAX_BINARY_ENTRIES_PER_PAGE = 100;
29
+ export declare const MAX_BINARY_CONTEXT_LINES = 50;
30
+ export declare const DEFAULT_BINARY_CONTEXT_LINES = 3;
31
+ export declare const MAX_STRINGS_MIN_LENGTH = 128;
32
+ export declare const DEFAULT_STRINGS_MIN_LENGTH = 8;
33
+ /**
34
+ * Authoring shape for a tool: the three human-written fields plus its schema.
35
+ * `description` is NOT authored — `defineTool` composes it from the others.
36
+ */
37
+ export interface ToolDefinition {
38
+ readonly name: string;
39
+ readonly type: ToolType;
40
+ readonly shortDescription: string;
41
+ readonly instructions: string;
42
+ readonly schema: ToolSchema;
43
+ }
44
+ /**
45
+ * Build a {@link ToolSpec}, deriving the client-facing `description` as
46
+ * `instructions`. The tool name identifies the operation and
47
+ * `shortDescription` remains separately available for catalogs, so repeating
48
+ * either in every MCP description wastes context. Clients that only read
49
+ * `description` still get the routing contract, while the
50
+ * three parts stay individually addressable and can't drift out of sync.
51
+ */
52
+ export declare function defineTool(def: ToolDefinition): ToolSpec;
53
+ export declare function intRange(min: number, max: number): z.ZodNumber;
54
+ export declare const StringArray: z.ZodOptional<z.ZodArray<z.ZodString>>;
55
+ export declare function pageNumber(): z.ZodDefault<z.ZodNumber>;
56
+ export declare function optionalPageNumber(): z.ZodOptional<z.ZodNumber>;
57
+ export declare function contextLines(): z.ZodOptional<z.ZodNumber>;
58
+ export declare function lineNumber(): z.ZodOptional<z.ZodNumber>;
59
+ export declare function charOffset(): z.ZodOptional<z.ZodNumber>;
60
+ export declare function charLength(): z.ZodOptional<z.ZodNumber>;
61
+ export declare const metaFields: {
62
+ goal: z.ZodOptional<z.ZodString>;
63
+ reasoning: z.ZodOptional<z.ZodString>;
64
+ };
65
+ export declare function buildObject<S extends z.ZodRawShape>(prose: ToolSchema, shape: S, prefix?: string): z.ZodObject<S>;
66
+ /** Shared refinement: fullContent / matchString / startLine+endLine are
67
+ * mutually exclusive extraction modes; startLine and endLine must be supplied
68
+ * together; and endLine must be >= startLine. Used by both the local and
69
+ * GitHub file-content readers. */
70
+ export declare function validateFileContentExtractionMode(data: {
71
+ fullContent?: boolean | undefined;
72
+ matchString?: string | undefined;
73
+ startLine?: number | undefined;
74
+ endLine?: number | undefined;
75
+ }, ctx: z.RefinementCtx): void;
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ import type { ToolSpec } from '../../types/index.js';
3
+ export declare const ghCloneRepo: ToolSpec;
4
+ export declare const CloneRepoQuerySchema: z.ZodObject<{
5
+ owner: z.ZodString;
6
+ repo: z.ZodString;
7
+ branch: z.ZodOptional<z.ZodString>;
8
+ sparsePath: z.ZodOptional<z.ZodString>;
9
+ forceRefresh: z.ZodOptional<z.ZodBoolean>;
10
+ goal: z.ZodOptional<z.ZodString>;
11
+ reasoning: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strip>;
@@ -0,0 +1,30 @@
1
+ import { z } from 'zod';
2
+ import type { ToolSpec } from '../../types/index.js';
3
+ export declare const ghGetFileContent: ToolSpec;
4
+ export declare const FileContentQuerySchema: z.ZodObject<{
5
+ owner: z.ZodString;
6
+ repo: z.ZodString;
7
+ branch: z.ZodOptional<z.ZodString>;
8
+ path: z.ZodString;
9
+ startLine: z.ZodOptional<z.ZodNumber>;
10
+ endLine: z.ZodOptional<z.ZodNumber>;
11
+ fullContent: z.ZodOptional<z.ZodBoolean>;
12
+ matchString: z.ZodOptional<z.ZodString>;
13
+ matchStringIsRegex: z.ZodOptional<z.ZodBoolean>;
14
+ matchStringCaseSensitive: z.ZodOptional<z.ZodBoolean>;
15
+ forceRefresh: z.ZodOptional<z.ZodBoolean>;
16
+ type: z.ZodDefault<z.ZodEnum<{
17
+ file: "file";
18
+ directory: "directory";
19
+ }>>;
20
+ contextLines: z.ZodDefault<z.ZodNumber>;
21
+ charOffset: z.ZodOptional<z.ZodNumber>;
22
+ charLength: z.ZodOptional<z.ZodNumber>;
23
+ minify: z.ZodDefault<z.ZodEnum<{
24
+ none: "none";
25
+ standard: "standard";
26
+ symbols: "symbols";
27
+ }>>;
28
+ goal: z.ZodOptional<z.ZodString>;
29
+ reasoning: z.ZodOptional<z.ZodString>;
30
+ }, z.core.$strip>;
@@ -0,0 +1,76 @@
1
+ import { z } from 'zod';
2
+ import type { ToolSpec } from '../../types/index.js';
3
+ export declare const ghSearch: ToolSpec;
4
+ export declare const GitHubSearchQuerySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
5
+ path: z.ZodOptional<z.ZodString>;
6
+ owner: z.ZodOptional<z.ZodString>;
7
+ repo: z.ZodOptional<z.ZodString>;
8
+ language: z.ZodOptional<z.ZodString>;
9
+ goal: z.ZodOptional<z.ZodString>;
10
+ reasoning: z.ZodOptional<z.ZodString>;
11
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
12
+ extension: z.ZodOptional<z.ZodString>;
13
+ filename: z.ZodOptional<z.ZodString>;
14
+ page: z.ZodDefault<z.ZodNumber>;
15
+ concise: z.ZodOptional<z.ZodBoolean>;
16
+ match: z.ZodDefault<z.ZodEnum<{
17
+ file: "file";
18
+ path: "path";
19
+ }>>;
20
+ pageSize: z.ZodDefault<z.ZodNumber>;
21
+ operation: z.ZodLiteral<"code">;
22
+ }, z.core.$strict>, z.ZodObject<{
23
+ sort: z.ZodDefault<z.ZodEnum<{
24
+ updated: "updated";
25
+ "best-match": "best-match";
26
+ stars: "stars";
27
+ forks: "forks";
28
+ "help-wanted-issues": "help-wanted-issues";
29
+ }>>;
30
+ owner: z.ZodOptional<z.ZodString>;
31
+ language: z.ZodOptional<z.ZodString>;
32
+ created: z.ZodOptional<z.ZodString>;
33
+ updated: z.ZodOptional<z.ZodString>;
34
+ goal: z.ZodOptional<z.ZodString>;
35
+ reasoning: z.ZodOptional<z.ZodString>;
36
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
37
+ page: z.ZodDefault<z.ZodNumber>;
38
+ concise: z.ZodOptional<z.ZodBoolean>;
39
+ stars: z.ZodOptional<z.ZodString>;
40
+ forks: z.ZodOptional<z.ZodString>;
41
+ goodFirstIssues: z.ZodOptional<z.ZodString>;
42
+ size: z.ZodOptional<z.ZodString>;
43
+ archived: z.ZodOptional<z.ZodBoolean>;
44
+ visibility: z.ZodOptional<z.ZodEnum<{
45
+ public: "public";
46
+ private: "private";
47
+ }>>;
48
+ license: z.ZodOptional<z.ZodString>;
49
+ topics: z.ZodOptional<z.ZodArray<z.ZodString>>;
50
+ pageSize: z.ZodDefault<z.ZodNumber>;
51
+ match: z.ZodOptional<z.ZodArray<z.ZodEnum<{
52
+ name: "name";
53
+ description: "description";
54
+ readme: "readme";
55
+ }>>>;
56
+ operation: z.ZodLiteral<"repositories">;
57
+ }, z.core.$strict>, z.ZodObject<{
58
+ path: z.ZodOptional<z.ZodString>;
59
+ owner: z.ZodString;
60
+ repo: z.ZodString;
61
+ branch: z.ZodOptional<z.ZodString>;
62
+ goal: z.ZodOptional<z.ZodString>;
63
+ reasoning: z.ZodOptional<z.ZodString>;
64
+ page: z.ZodDefault<z.ZodNumber>;
65
+ maxDepth: z.ZodOptional<z.ZodNumber>;
66
+ include: z.ZodOptional<z.ZodArray<z.ZodEnum<{
67
+ sizes: "sizes";
68
+ languages: "languages";
69
+ contributors: "contributors";
70
+ branches: "branches";
71
+ tags: "tags";
72
+ }>>>;
73
+ operation: z.ZodLiteral<"tree">;
74
+ pageSize: z.ZodDefault<z.ZodNumber>;
75
+ }, z.core.$strict>], "operation">;
76
+ export type GitHubSearchQuery = z.infer<typeof GitHubSearchQuerySchema>;
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ export declare const githubCodeOperationDescriptions: {
3
+ keywords: string;
4
+ path: string;
5
+ match: string;
6
+ extension: string;
7
+ filename: string;
8
+ language: string;
9
+ concise: string;
10
+ limit: string;
11
+ };
12
+ export declare const GitHubCodeSearchQuerySchema: z.ZodObject<{
13
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
+ owner: z.ZodOptional<z.ZodString>;
15
+ repo: z.ZodOptional<z.ZodString>;
16
+ extension: z.ZodOptional<z.ZodString>;
17
+ filename: z.ZodOptional<z.ZodString>;
18
+ path: z.ZodOptional<z.ZodString>;
19
+ language: z.ZodOptional<z.ZodString>;
20
+ match: z.ZodDefault<z.ZodEnum<{
21
+ file: "file";
22
+ path: "path";
23
+ }>>;
24
+ limit: z.ZodDefault<z.ZodNumber>;
25
+ page: z.ZodDefault<z.ZodNumber>;
26
+ concise: z.ZodOptional<z.ZodBoolean>;
27
+ goal: z.ZodOptional<z.ZodString>;
28
+ reasoning: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strip>;
@@ -0,0 +1,114 @@
1
+ import { z } from 'zod';
2
+ export declare const GitHubPullRequestSearchQuerySchema: z.ZodObject<{
3
+ type: z.ZodDefault<z.ZodEnum<{
4
+ prs: "prs";
5
+ commits: "commits";
6
+ }>>;
7
+ since: z.ZodOptional<z.ZodString>;
8
+ until: z.ZodOptional<z.ZodString>;
9
+ path: z.ZodOptional<z.ZodString>;
10
+ branch: z.ZodOptional<z.ZodString>;
11
+ includeDiff: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
12
+ includeAssets: z.ZodOptional<z.ZodBoolean>;
13
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
+ prNumber: z.ZodOptional<z.ZodNumber>;
15
+ issueNumber: z.ZodOptional<z.ZodNumber>;
16
+ owner: z.ZodOptional<z.ZodString>;
17
+ repo: z.ZodOptional<z.ZodString>;
18
+ concise: z.ZodOptional<z.ZodBoolean>;
19
+ state: z.ZodOptional<z.ZodEnum<{
20
+ open: "open";
21
+ closed: "closed";
22
+ merged: "merged";
23
+ }>>;
24
+ assignee: z.ZodOptional<z.ZodString>;
25
+ author: z.ZodOptional<z.ZodString>;
26
+ committer: z.ZodOptional<z.ZodString>;
27
+ commenter: z.ZodOptional<z.ZodString>;
28
+ mentions: z.ZodOptional<z.ZodString>;
29
+ 'review-requested': z.ZodOptional<z.ZodString>;
30
+ 'reviewed-by': z.ZodOptional<z.ZodString>;
31
+ label: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
32
+ checks: z.ZodOptional<z.ZodEnum<{
33
+ success: "success";
34
+ pending: "pending";
35
+ failure: "failure";
36
+ }>>;
37
+ review: z.ZodOptional<z.ZodEnum<{
38
+ none: "none";
39
+ required: "required";
40
+ approved: "approved";
41
+ changes_requested: "changes_requested";
42
+ }>>;
43
+ head: z.ZodOptional<z.ZodString>;
44
+ base: z.ZodOptional<z.ZodString>;
45
+ created: z.ZodOptional<z.ZodString>;
46
+ updated: z.ZodOptional<z.ZodString>;
47
+ closed: z.ZodOptional<z.ZodString>;
48
+ 'merged-at': z.ZodOptional<z.ZodString>;
49
+ comments: z.ZodOptional<z.ZodString>;
50
+ reactions: z.ZodOptional<z.ZodString>;
51
+ draft: z.ZodOptional<z.ZodBoolean>;
52
+ match: z.ZodOptional<z.ZodArray<z.ZodEnum<{
53
+ body: "body";
54
+ title: "title";
55
+ comments: "comments";
56
+ }>>>;
57
+ sort: z.ZodOptional<z.ZodEnum<{
58
+ comments: "comments";
59
+ reactions: "reactions";
60
+ created: "created";
61
+ updated: "updated";
62
+ "best-match": "best-match";
63
+ }>>;
64
+ order: z.ZodOptional<z.ZodEnum<{
65
+ asc: "asc";
66
+ desc: "desc";
67
+ }>>;
68
+ limit: z.ZodDefault<z.ZodNumber>;
69
+ page: z.ZodDefault<z.ZodNumber>;
70
+ archived: z.ZodOptional<z.ZodBoolean>;
71
+ filePage: z.ZodOptional<z.ZodNumber>;
72
+ commentPage: z.ZodOptional<z.ZodNumber>;
73
+ commitPage: z.ZodOptional<z.ZodNumber>;
74
+ reviewMode: z.ZodOptional<z.ZodLiteral<"full">>;
75
+ content: z.ZodOptional<z.ZodObject<{
76
+ metadata: z.ZodOptional<z.ZodBoolean>;
77
+ body: z.ZodOptional<z.ZodBoolean>;
78
+ changedFiles: z.ZodOptional<z.ZodBoolean>;
79
+ patches: z.ZodOptional<z.ZodObject<{
80
+ mode: z.ZodDefault<z.ZodEnum<{
81
+ none: "none";
82
+ selected: "selected";
83
+ all: "all";
84
+ }>>;
85
+ files: z.ZodOptional<z.ZodArray<z.ZodString>>;
86
+ ranges: z.ZodOptional<z.ZodArray<z.ZodObject<{
87
+ file: z.ZodString;
88
+ additions: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
89
+ deletions: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
90
+ }, z.core.$strip>>>;
91
+ }, z.core.$strip>>;
92
+ comments: z.ZodOptional<z.ZodObject<{
93
+ discussion: z.ZodOptional<z.ZodBoolean>;
94
+ reviewInline: z.ZodOptional<z.ZodBoolean>;
95
+ includeBots: z.ZodDefault<z.ZodBoolean>;
96
+ file: z.ZodOptional<z.ZodString>;
97
+ }, z.core.$strip>>;
98
+ reviews: z.ZodOptional<z.ZodBoolean>;
99
+ commits: z.ZodOptional<z.ZodObject<{
100
+ list: z.ZodOptional<z.ZodBoolean>;
101
+ includeFiles: z.ZodOptional<z.ZodBoolean>;
102
+ }, z.core.$strip>>;
103
+ }, z.core.$strip>>;
104
+ matchString: z.ZodOptional<z.ZodString>;
105
+ commentBodyOffset: z.ZodOptional<z.ZodNumber>;
106
+ charOffset: z.ZodOptional<z.ZodNumber>;
107
+ charLength: z.ZodOptional<z.ZodNumber>;
108
+ minify: z.ZodDefault<z.ZodEnum<{
109
+ none: "none";
110
+ standard: "standard";
111
+ }>>;
112
+ goal: z.ZodOptional<z.ZodString>;
113
+ reasoning: z.ZodOptional<z.ZodString>;
114
+ }, z.core.$strip>;
@@ -0,0 +1,54 @@
1
+ import { z } from 'zod';
2
+ export declare const githubRepositoriesOperationDescriptions: {
3
+ keywords: string;
4
+ topicsToSearch: string;
5
+ match: string;
6
+ sort: string;
7
+ language: string;
8
+ stars: string;
9
+ forks: string;
10
+ goodFirstIssues: string;
11
+ updated: string;
12
+ created: string;
13
+ size: string;
14
+ license: string;
15
+ archived: string;
16
+ visibility: string;
17
+ concise: string;
18
+ limit: string;
19
+ };
20
+ export declare const GitHubReposSearchSingleQuerySchema: z.ZodObject<{
21
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
22
+ topicsToSearch: z.ZodOptional<z.ZodArray<z.ZodString>>;
23
+ language: z.ZodOptional<z.ZodString>;
24
+ owner: z.ZodOptional<z.ZodString>;
25
+ stars: z.ZodOptional<z.ZodString>;
26
+ forks: z.ZodOptional<z.ZodString>;
27
+ goodFirstIssues: z.ZodOptional<z.ZodString>;
28
+ updated: z.ZodOptional<z.ZodString>;
29
+ created: z.ZodOptional<z.ZodString>;
30
+ size: z.ZodOptional<z.ZodString>;
31
+ match: z.ZodOptional<z.ZodArray<z.ZodEnum<{
32
+ name: "name";
33
+ description: "description";
34
+ readme: "readme";
35
+ }>>>;
36
+ sort: z.ZodDefault<z.ZodEnum<{
37
+ updated: "updated";
38
+ "best-match": "best-match";
39
+ stars: "stars";
40
+ forks: "forks";
41
+ "help-wanted-issues": "help-wanted-issues";
42
+ }>>;
43
+ limit: z.ZodDefault<z.ZodNumber>;
44
+ page: z.ZodDefault<z.ZodNumber>;
45
+ archived: z.ZodOptional<z.ZodBoolean>;
46
+ visibility: z.ZodOptional<z.ZodEnum<{
47
+ public: "public";
48
+ private: "private";
49
+ }>>;
50
+ license: z.ZodOptional<z.ZodString>;
51
+ concise: z.ZodOptional<z.ZodBoolean>;
52
+ goal: z.ZodOptional<z.ZodString>;
53
+ reasoning: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strip>;
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ export declare const githubTreeOperationDescriptions: {
3
+ path: string;
4
+ branch: string;
5
+ maxDepth: string;
6
+ page: string;
7
+ include: string;
8
+ };
9
+ export declare const GitHubViewRepoStructureQuerySchema: z.ZodObject<{
10
+ owner: z.ZodString;
11
+ repo: z.ZodString;
12
+ branch: z.ZodOptional<z.ZodString>;
13
+ path: z.ZodOptional<z.ZodString>;
14
+ maxDepth: z.ZodOptional<z.ZodNumber>;
15
+ page: z.ZodDefault<z.ZodNumber>;
16
+ itemsPerPage: z.ZodDefault<z.ZodNumber>;
17
+ include: z.ZodOptional<z.ZodArray<z.ZodEnum<{
18
+ sizes: "sizes";
19
+ languages: "languages";
20
+ contributors: "contributors";
21
+ branches: "branches";
22
+ tags: "tags";
23
+ }>>>;
24
+ goal: z.ZodOptional<z.ZodString>;
25
+ reasoning: z.ZodOptional<z.ZodString>;
26
+ }, z.core.$strip>;
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ export declare const SearchCommitsQuerySchema: z.ZodObject<{
3
+ owner: z.ZodString;
4
+ repo: z.ZodString;
5
+ path: z.ZodOptional<z.ZodString>;
6
+ since: z.ZodOptional<z.ZodString>;
7
+ until: z.ZodOptional<z.ZodString>;
8
+ branch: z.ZodOptional<z.ZodString>;
9
+ author: z.ZodOptional<z.ZodString>;
10
+ committer: z.ZodOptional<z.ZodString>;
11
+ base: z.ZodOptional<z.ZodString>;
12
+ head: z.ZodOptional<z.ZodString>;
13
+ pageSize: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
14
+ includeDiff: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
15
+ page: z.ZodDefault<z.ZodNumber>;
16
+ filePage: z.ZodOptional<z.ZodNumber>;
17
+ charOffset: z.ZodOptional<z.ZodNumber>;
18
+ charLength: z.ZodOptional<z.ZodNumber>;
19
+ goal: z.ZodOptional<z.ZodString>;
20
+ reasoning: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strip>;
@@ -0,0 +1,59 @@
1
+ import { z } from 'zod';
2
+ export declare const SearchIssuesQuerySchema: z.ZodObject<{
3
+ owner: z.ZodString;
4
+ repo: z.ZodString;
5
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
6
+ issueNumber: z.ZodOptional<z.ZodNumber>;
7
+ concise: z.ZodOptional<z.ZodBoolean>;
8
+ state: z.ZodOptional<z.ZodEnum<{
9
+ open: "open";
10
+ closed: "closed";
11
+ }>>;
12
+ assignee: z.ZodOptional<z.ZodString>;
13
+ author: z.ZodOptional<z.ZodString>;
14
+ commenter: z.ZodOptional<z.ZodString>;
15
+ mentions: z.ZodOptional<z.ZodString>;
16
+ label: z.ZodOptional<z.ZodArray<z.ZodString>>;
17
+ created: z.ZodOptional<z.ZodString>;
18
+ updated: z.ZodOptional<z.ZodString>;
19
+ closed: z.ZodOptional<z.ZodString>;
20
+ comments: z.ZodOptional<z.ZodString>;
21
+ reactions: z.ZodOptional<z.ZodString>;
22
+ match: z.ZodOptional<z.ZodArray<z.ZodEnum<{
23
+ body: "body";
24
+ title: "title";
25
+ comments: "comments";
26
+ }>>>;
27
+ sort: z.ZodOptional<z.ZodEnum<{
28
+ comments: "comments";
29
+ reactions: "reactions";
30
+ created: "created";
31
+ updated: "updated";
32
+ "best-match": "best-match";
33
+ }>>;
34
+ order: z.ZodOptional<z.ZodEnum<{
35
+ asc: "asc";
36
+ desc: "desc";
37
+ }>>;
38
+ pageSize: z.ZodDefault<z.ZodNumber>;
39
+ page: z.ZodOptional<z.ZodNumber>;
40
+ archived: z.ZodOptional<z.ZodBoolean>;
41
+ commentPage: z.ZodOptional<z.ZodNumber>;
42
+ content: z.ZodOptional<z.ZodObject<{
43
+ body: z.ZodOptional<z.ZodLiteral<true>>;
44
+ comments: z.ZodOptional<z.ZodObject<{
45
+ discussion: z.ZodOptional<z.ZodLiteral<true>>;
46
+ includeBots: z.ZodOptional<z.ZodLiteral<true>>;
47
+ }, z.core.$strip>>;
48
+ }, z.core.$strip>>;
49
+ matchString: z.ZodOptional<z.ZodString>;
50
+ commentBodyOffset: z.ZodOptional<z.ZodNumber>;
51
+ charOffset: z.ZodOptional<z.ZodNumber>;
52
+ charLength: z.ZodOptional<z.ZodNumber>;
53
+ minify: z.ZodDefault<z.ZodEnum<{
54
+ none: "none";
55
+ standard: "standard";
56
+ }>>;
57
+ goal: z.ZodOptional<z.ZodString>;
58
+ reasoning: z.ZodOptional<z.ZodString>;
59
+ }, z.core.$strip>;