@octocodeai/octocode-core 16.2.1 → 16.3.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 (48) hide show
  1. package/dist/cli.d.ts +9 -0
  2. package/dist/cli.js +1 -0
  3. package/dist/data/compressed.js +1 -1
  4. package/dist/mcp.d.ts +18 -0
  5. package/dist/mcp.js +1 -0
  6. package/dist/types/index.d.ts +60 -7
  7. package/package.json +9 -29
  8. package/dist/data/default.json +0 -353
  9. package/dist/index.d.ts +0 -3
  10. package/dist/index.js +0 -1
  11. package/dist/resources/global.d.ts +0 -3
  12. package/dist/resources/global.js +0 -1
  13. package/dist/resources/tools/_toolkit.d.ts +0 -55
  14. package/dist/resources/tools/_toolkit.js +0 -1
  15. package/dist/resources/tools/ghCloneRepo.d.ts +0 -27
  16. package/dist/resources/tools/ghCloneRepo.js +0 -1
  17. package/dist/resources/tools/ghGetFileContent.d.ts +0 -32
  18. package/dist/resources/tools/ghGetFileContent.js +0 -1
  19. package/dist/resources/tools/ghHistoryResearch.d.ts +0 -133
  20. package/dist/resources/tools/ghHistoryResearch.js +0 -1
  21. package/dist/resources/tools/ghSearchCode.d.ts +0 -23
  22. package/dist/resources/tools/ghSearchCode.js +0 -1
  23. package/dist/resources/tools/ghSearchRepos.d.ts +0 -40
  24. package/dist/resources/tools/ghSearchRepos.js +0 -1
  25. package/dist/resources/tools/ghViewRepoStructure.d.ts +0 -17
  26. package/dist/resources/tools/ghViewRepoStructure.js +0 -1
  27. package/dist/resources/tools/localBinaryInspect.d.ts +0 -40
  28. package/dist/resources/tools/localBinaryInspect.js +0 -1
  29. package/dist/resources/tools/localFindFiles.d.ts +0 -41
  30. package/dist/resources/tools/localFindFiles.js +0 -1
  31. package/dist/resources/tools/localGetFileContent.d.ts +0 -24
  32. package/dist/resources/tools/localGetFileContent.js +0 -1
  33. package/dist/resources/tools/localSearchCode.d.ts +0 -51
  34. package/dist/resources/tools/localSearchCode.js +0 -1
  35. package/dist/resources/tools/localViewStructure.d.ts +0 -29
  36. package/dist/resources/tools/localViewStructure.js +0 -1
  37. package/dist/resources/tools/lspGetSemantics.d.ts +0 -79
  38. package/dist/resources/tools/lspGetSemantics.js +0 -1
  39. package/dist/resources/tools/npmSearch.d.ts +0 -11
  40. package/dist/resources/tools/npmSearch.js +0 -1
  41. package/dist/schemas/extraTypes.d.ts +0 -178
  42. package/dist/schemas/extraTypes.js +0 -1
  43. package/dist/schemas/index.d.ts +0 -13
  44. package/dist/schemas/index.js +0 -1
  45. package/dist/schemas/outputs.d.ts +0 -837
  46. package/dist/schemas/outputs.js +0 -1
  47. package/dist/schemas/runtime.d.ts +0 -11
  48. package/dist/schemas/runtime.js +0 -1
@@ -1 +0,0 @@
1
- import{z as e}from"zod";import{buildObject as t,contextLines as n,intRange as o,MAX_LINE_NUMBER as i,MAX_LOCAL_DEPTH as l,MAX_ORDER_HINT as a,MAX_PR_ITEMS_PER_PAGE as s,metaFields as r,pageNumber as c}from"./_toolkit.js";export const lspGetSemantics={name:"lspGetSemantics",description:"Typed LSP queries for semantic navigation (default type: definition).\nPrerequisites: all types except documentSymbols require symbolName + lineHint. lineHint must come from a real localSearchCode match (matches[0].line) — never guess. A wrong lineHint causes silent empty results. If lineHint is unknown: run documentSymbols (uri only) or localSearchCode first.\nType routing: documentSymbols=file outline (uri only); hover=signature+JSDoc; definition=jump to decl; typeDefinition=generic types; implementation=abstract member impl (member name, not class); references=same-package usages (bounded by the language server's open files, NOT cross-package — zero results does NOT mean unused, try callers); callers=cross-package incoming calls (TS/JS/Go/Rust only — Python/C++ use references instead); callees=outgoing calls; callHierarchy=both.\nToken efficiency: format:\"compact\" on callers/callees/callHierarchy → significantly fewer tokens. groupByFile:true on references → per-file summary with lines[] (each is a valid lineHint for follow-up calls). contextLines=3–10 on callers/callees embeds source context, reducing follow-up localGetFileContent calls.\nLanguage tiers — Tier 1 all types: TS/JS/Go/Rust. Tier 2 no callHierarchy: Python/C++. Tier 3 documentSymbols+hover+definition only: Shell/HTML/CSS/YAML/TOML.\nOutput signal: resolvedSymbol.foundAtLine confirms which line LSP resolved — if far from lineHint, re-run localSearchCode to get an accurate anchor. payload.kind='empty' means LSP returned no results (symbolNotFound → re-anchor with localSearchCode; serverUnavailable → fall back to localSearchCode). In callers/callees results, each ranges[].line is the lineHint for the next lspGetSemantics call on that symbol.\nevidence.answerReady:true — stop calling.\nNext: localGetFileContent(startLine/endLine) to read the definition; lspGetSemantics(callers) for impact analysis. Batch: up to 5 queries per call — combine definition+hover or definition+callers in one request.",schema:{uri:"Target source file as an absolute path or file:/// URI.",type:"Which query to run — see the type-routing list in the description.",symbolName:"Exact identifier sitting at lineHint — bare name only, no parentheses or type annotations (e.g. 'fetchPRDetail', not 'fetchPRDetail()'). Case-sensitive, must match the token exactly. Required for every type except documentSymbols.",lineHint:"Line where symbolName appears. Must come from a real localSearchCode match (matches[0].line) — never guess; a wrong value silently returns nothing. Required for every type except documentSymbols.",orderHint:"Disambiguates when symbolName occurs multiple times on lineHint (e.g. overloads, chained calls) — increment if you get the wrong symbol.",depth:"Recursion depth for callHierarchy/callers/callees — immediate calls only unless raised. Raise for full chains; pair high depth on hot symbols with format:'compact' to limit size.",includeDeclaration:"references: whether to include the symbol's own declaration. Set false to get only usages, not the definition site.",groupByFile:"references: returns a per-file summary (path + count + all line numbers in lines[]) instead of per-location rows — ideal for blast radius; each line is a valid lineHint for follow-ups.",page:"Result page for documentSymbols and call-flow results.",itemsPerPage:"Items per page (symbol/location lists get a larger page than call-flow results).",contextLines:"Source lines around each call site in callers/callees/callHierarchy (locations only unless set). Raise to embed calling context and skip a follow-up localGetFileContent.",format:'"structured": typed objects with full location metadata. "compact": line-oriented strings, far fewer tokens. Prefer "compact" for navigation; use "structured" only when parsing locations programmatically.',workspaceRoot:"Overrides the LSP workspace root (absolute path). Omit to auto-resolve from uri; needed only when the server spans multiple roots."}};const m={...r,uri:e.string(),symbolName:e.string(),lineHint:o(1,i),orderHint:o(0,a).default(0)};export const LSPGotoDefinitionQuerySchema=t(lspGetSemantics.schema,{...m,contextLines:n()});export const LSPFindReferencesQuerySchema=t(lspGetSemantics.schema,{...m,includeDeclaration:e.boolean().optional(),contextLines:n(),itemsPerPage:o(1,s).optional(),page:c(),groupByFile:e.boolean().optional()});export const LSPCallHierarchyQuerySchema=t(lspGetSemantics.schema,{...m,direction:e.enum(["incoming","outgoing"]),depth:o(0,l).optional(),contextLines:n(),itemsPerPage:o(1,s).optional(),page:c()});export const LspGetSemanticsQuerySchema=t(lspGetSemantics.schema,{...r,uri:e.string(),type:e.enum(["definition","references","callers","callees","callHierarchy","hover","documentSymbols","typeDefinition","implementation"]).default("definition"),symbolName:e.string().min(1).optional(),lineHint:o(1,i).optional(),orderHint:o(0,a).default(0),depth:o(0,l).optional(),includeDeclaration:e.boolean().default(!0),groupByFile:e.boolean().optional(),page:c(),itemsPerPage:o(1,s).optional(),contextLines:n(),format:e.enum(["structured","compact"]).default("structured"),workspaceRoot:e.string().optional()}).superRefine((e,t)=>{"documentSymbols"!==e.type&&(e.symbolName||t.addIssue({code:"custom",path:["symbolName"],message:"symbolName is required unless type is documentSymbols"}),Number.isInteger(e.lineHint)||t.addIssue({code:"custom",path:["lineHint"],message:"lineHint is required unless type is documentSymbols"}))});
@@ -1,11 +0,0 @@
1
- import { z } from "zod";
2
- import type { ToolSpec } from "../../types/index.js";
3
- export declare const npmSearch: ToolSpec;
4
- export declare const NpmPackageQuerySchema: z.ZodObject<{
5
- packageName: z.ZodString;
6
- page: z.ZodDefault<z.ZodNumber>;
7
- id: z.ZodOptional<z.ZodString>;
8
- mainResearchGoal: z.ZodOptional<z.ZodString>;
9
- researchGoal: z.ZodOptional<z.ZodString>;
10
- reasoning: z.ZodOptional<z.ZodString>;
11
- }, z.core.$strip>;
@@ -1 +0,0 @@
1
- import{z as e}from"zod";import{buildObject as r,metaFields as t,pageNumber as a}from"./_toolkit.js";export const npmSearch={name:"npmSearch",description:'npm package lookup and keyword search. Returns package metadata and source repository handoff.\nExact package name (e.g. "react", "@octokit/rest") returns one rich result with version, description, keywords, and repository owner/repo for GitHub handoff.\nKeyword query (e.g. "http client typescript") returns lean results — paginate with page; pagination.hasMore and totalFound available in output.\nWhen owner+repo is present in the result, pass directly to ghViewRepoStructure or ghSearchCode. If a repositoryDirectory path follows owner/repo in the result, pass it as path= to ghViewRepoStructure to scope the tree to the package subdirectory.\nSkip if owner/repo is already known — go directly to ghViewRepoStructure.\nBatch up to 5 packages in one call: queries:[{packageName:"react"},{packageName:"lodash"}].\nNext: ghViewRepoStructure or ghSearchCode when owner/repo exists; ghSearchRepos when owner/repo is absent or non-GitHub.',schema:{packageName:"An exact npm package name or a keyword query. An exact name (e.g. 'react', '@octokit/rest') returns one rich result, or empty if it doesn't exist (check spelling before assuming it's private). A keyword query returns a lean list. Scoped packages need the full scope: '@octokit/rest', not 'rest'.",page:"Page for keyword results; exact-name lookups always return page 1. Paginate while pagination.hasMore."}};export const NpmPackageQuerySchema=r(npmSearch.schema,{...t,packageName:e.string(),page:a()});
@@ -1,178 +0,0 @@
1
- import type { CharPagination, LspRange, LspLocation, LspMode, PaginationInfo, LocalSearchCodeFile, LocalFindFilesEntry, GitHubRepositoryItem, GitHubPullRequestItem, GitHubSearchCodeGroup, GitHubFileContentData } from "../types/index.js";
2
- export interface BaseQuery {
3
- id?: string;
4
- mainResearchGoal?: string;
5
- researchGoal?: string;
6
- reasoning?: string;
7
- verbose?: boolean;
8
- }
9
- export interface BaseQueryLocal extends BaseQuery {
10
- path?: string;
11
- }
12
- export interface LspExactPosition {
13
- uri: string;
14
- line: number;
15
- character: number;
16
- }
17
- export interface LspCallHierarchyItem {
18
- name: string;
19
- uri: string;
20
- range: LspRange;
21
- content?: string;
22
- }
23
- export interface LspIncomingCall {
24
- from: LspCallHierarchyItem;
25
- fromRanges?: LspRange[];
26
- }
27
- export interface LspOutgoingCall {
28
- to: LspCallHierarchyItem;
29
- fromRanges?: LspRange[];
30
- }
31
- interface BaseToolResult {
32
- status?: "empty" | "error";
33
- hints?: readonly string[] | string[];
34
- warnings?: string[];
35
- error?: string;
36
- errorCode?: string;
37
- rawResponseChars?: number;
38
- [key: string]: unknown;
39
- }
40
- export interface LocalSearchCodeToolResult extends BaseToolResult {
41
- files?: LocalSearchCodeFile[];
42
- pagination?: PaginationInfo;
43
- searchEngine?: string;
44
- }
45
- export interface LocalFindFilesToolResult extends BaseToolResult {
46
- files?: LocalFindFilesEntry[];
47
- pagination?: PaginationInfo;
48
- }
49
- export interface MatchRange {
50
- start: number;
51
- end: number;
52
- }
53
- export interface LocalGetFileContentToolResult extends BaseToolResult {
54
- content?: string;
55
- contentView?: "none" | "standard" | "symbols";
56
- isSkeleton?: boolean;
57
- totalLines?: number;
58
- startLine?: number;
59
- endLine?: number;
60
- isPartial?: boolean;
61
- matchRanges?: MatchRange[];
62
- pagination?: CharPagination | PaginationInfo;
63
- modified?: string;
64
- lastModified?: string;
65
- lastModifiedBy?: string;
66
- filePath?: string;
67
- }
68
- export interface LocalViewStructureEntryFlat {
69
- name?: string;
70
- type: "file" | "dir" | "link" | "directory" | "symlink";
71
- path?: string;
72
- depth?: number;
73
- size?: number | string;
74
- modified?: string;
75
- permissions?: string;
76
- }
77
- export interface LocalViewStructureToolResult extends BaseToolResult {
78
- entries?: LocalViewStructureEntryFlat[];
79
- path?: string;
80
- files?: string[];
81
- folders?: string[];
82
- links?: string[];
83
- summary?: string | Record<string, unknown>;
84
- pagination?: PaginationInfo;
85
- }
86
- export interface LspGotoDefinitionToolResult extends BaseToolResult {
87
- locations?: LspLocation[];
88
- lspMode?: LspMode;
89
- }
90
- export interface LspFindReferencesToolResult extends BaseToolResult {
91
- locations?: LspLocation[];
92
- references?: LspLocation[];
93
- pagination?: PaginationInfo;
94
- lspMode?: LspMode;
95
- }
96
- export interface LspCallHierarchyToolResult extends BaseToolResult {
97
- item?: LspCallHierarchyItem;
98
- incomingCalls?: LspIncomingCall[];
99
- outgoingCalls?: LspOutgoingCall[];
100
- direction?: "incoming" | "outgoing";
101
- depth?: number;
102
- pagination?: PaginationInfo;
103
- lspMode?: LspMode;
104
- }
105
- export interface GitHubRepoStructureDirectoryEntry {
106
- files: string[];
107
- folders: string[];
108
- }
109
- export interface GitHubDirectoryFileEntry {
110
- path: string;
111
- size: number;
112
- type: string;
113
- }
114
- export interface GitHubSearchCodeToolResult extends BaseToolResult {
115
- results?: GitHubSearchCodeGroup[];
116
- pagination?: PaginationInfo;
117
- outputPagination?: CharPagination;
118
- }
119
- export interface GitHubFetchContentToolResult extends BaseToolResult {
120
- results?: GitHubFileContentData[];
121
- pagination?: CharPagination;
122
- }
123
- export interface GitHubViewRepoStructureToolResult extends BaseToolResult {
124
- resolvedBranch?: string;
125
- branchFallback?: {
126
- requestedBranch: string;
127
- actualBranch: string;
128
- };
129
- structure?: Record<string, GitHubRepoStructureDirectoryEntry>;
130
- summary?: {
131
- totalFiles?: number;
132
- totalFolders?: number;
133
- truncated?: boolean;
134
- filtered?: boolean;
135
- originalCount?: number;
136
- };
137
- pagination?: PaginationInfo;
138
- }
139
- export interface GitHubSearchRepositoriesToolResult extends BaseToolResult {
140
- repositories?: GitHubRepositoryItem[];
141
- pagination?: PaginationInfo;
142
- }
143
- export interface GitHubSearchPullRequestsToolResult extends BaseToolResult {
144
- pull_requests?: GitHubPullRequestItem[];
145
- total_count?: number;
146
- pagination?: PaginationInfo;
147
- outputPagination?: {
148
- charOffset: number;
149
- charLength: number;
150
- totalChars: number;
151
- hasMore: boolean;
152
- currentPage: number;
153
- totalPages: number;
154
- };
155
- }
156
- export interface GitHubRepositoryOutput {
157
- owner: string;
158
- repo: string;
159
- defaultBranch: string;
160
- stars: number;
161
- description: string;
162
- url: string;
163
- createdAt: string;
164
- updatedAt: string;
165
- pushedAt: string;
166
- visibility: "public" | "private" | "internal";
167
- topics: string[];
168
- forksCount: number;
169
- openIssuesCount?: number;
170
- language?: string;
171
- license?: string;
172
- homepage?: string;
173
- }
174
- export interface GitHubSearchRepositoriesData {
175
- repositories: GitHubRepositoryOutput[];
176
- pagination?: PaginationInfo;
177
- }
178
- export {};
@@ -1 +0,0 @@
1
- export{};
@@ -1,13 +0,0 @@
1
- export { GitHubCodeSearchQuerySchema } from "../resources/tools/ghSearchCode.js";
2
- export { FileContentQuerySchema } from "../resources/tools/ghGetFileContent.js";
3
- export { GitHubViewRepoStructureQuerySchema } from "../resources/tools/ghViewRepoStructure.js";
4
- export { GitHubReposSearchSingleQuerySchema } from "../resources/tools/ghSearchRepos.js";
5
- export { GitHubPullRequestSearchQuerySchema } from "../resources/tools/ghHistoryResearch.js";
6
- export { NpmPackageQuerySchema } from "../resources/tools/npmSearch.js";
7
- export { CloneRepoQuerySchema, BulkCloneRepoSchema, } from "../resources/tools/ghCloneRepo.js";
8
- export { RipgrepQuerySchema } from "../resources/tools/localSearchCode.js";
9
- export { FetchContentQuerySchema } from "../resources/tools/localGetFileContent.js";
10
- export { FindFilesQuerySchema } from "../resources/tools/localFindFiles.js";
11
- export { ViewStructureQuerySchema } from "../resources/tools/localViewStructure.js";
12
- export { LspGetSemanticsQuerySchema, LSPGotoDefinitionQuerySchema, LSPFindReferencesQuerySchema, LSPCallHierarchyQuerySchema, } from "../resources/tools/lspGetSemantics.js";
13
- export { LocalBinaryInspectQuerySchema } from "../resources/tools/localBinaryInspect.js";
@@ -1 +0,0 @@
1
- export{GitHubCodeSearchQuerySchema}from"../resources/tools/ghSearchCode.js";export{FileContentQuerySchema}from"../resources/tools/ghGetFileContent.js";export{GitHubViewRepoStructureQuerySchema}from"../resources/tools/ghViewRepoStructure.js";export{GitHubReposSearchSingleQuerySchema}from"../resources/tools/ghSearchRepos.js";export{GitHubPullRequestSearchQuerySchema}from"../resources/tools/ghHistoryResearch.js";export{NpmPackageQuerySchema}from"../resources/tools/npmSearch.js";export{CloneRepoQuerySchema,BulkCloneRepoSchema}from"../resources/tools/ghCloneRepo.js";export{RipgrepQuerySchema}from"../resources/tools/localSearchCode.js";export{FetchContentQuerySchema}from"../resources/tools/localGetFileContent.js";export{FindFilesQuerySchema}from"../resources/tools/localFindFiles.js";export{ViewStructureQuerySchema}from"../resources/tools/localViewStructure.js";export{LspGetSemanticsQuerySchema,LSPGotoDefinitionQuerySchema,LSPFindReferencesQuerySchema,LSPCallHierarchyQuerySchema}from"../resources/tools/lspGetSemantics.js";export{LocalBinaryInspectQuerySchema}from"../resources/tools/localBinaryInspect.js";