@octocodeai/octocode-core 4.2.0 → 16.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/dist/data/compressed.js +1 -1
- package/dist/data/default.json +210 -299
- package/dist/resources/global.d.ts +3 -0
- package/dist/resources/global.js +1 -0
- package/dist/resources/tools/githubCloneRepo.d.ts +2 -0
- package/dist/resources/tools/githubCloneRepo.js +1 -0
- package/dist/resources/tools/githubGetFileContent.d.ts +2 -0
- package/dist/resources/tools/githubGetFileContent.js +1 -0
- package/dist/resources/tools/githubSearchCode.d.ts +2 -0
- package/dist/resources/tools/githubSearchCode.js +1 -0
- package/dist/resources/tools/githubSearchPullRequests.d.ts +2 -0
- package/dist/resources/tools/githubSearchPullRequests.js +1 -0
- package/dist/resources/tools/githubSearchRepositories.d.ts +2 -0
- package/dist/resources/tools/githubSearchRepositories.js +1 -0
- package/dist/resources/tools/githubViewRepoStructure.d.ts +2 -0
- package/dist/resources/tools/githubViewRepoStructure.js +1 -0
- package/dist/resources/tools/localFindFiles.d.ts +2 -0
- package/dist/resources/tools/localFindFiles.js +1 -0
- package/dist/resources/tools/localGetFileContent.d.ts +2 -0
- package/dist/resources/tools/localGetFileContent.js +1 -0
- package/dist/resources/tools/localSearchCode.d.ts +2 -0
- package/dist/resources/tools/localSearchCode.js +1 -0
- package/dist/resources/tools/localViewStructure.d.ts +2 -0
- package/dist/resources/tools/localViewStructure.js +1 -0
- package/dist/resources/tools/lspGetSemanticContent.d.ts +2 -0
- package/dist/resources/tools/lspGetSemanticContent.js +1 -0
- package/dist/resources/tools/packageSearch.d.ts +2 -0
- package/dist/resources/tools/packageSearch.js +1 -0
- package/dist/schemas/extraTypes.d.ts +15 -1
- package/dist/schemas/index.d.ts +207 -88
- package/dist/schemas/index.js +1 -1
- package/dist/schemas/outputs.d.ts +34 -2
- package/dist/schemas/outputs.js +1 -1
- package/dist/schemas/runtime.js +1 -1
- package/dist/types/index.d.ts +17 -5
- package/package.json +2 -1
package/dist/schemas/outputs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as t}from"zod";import{STATUS_VALUES as o}from"../types/index.js";export const ErrorDataSchema=t.object({id:t.string().optional(),error:t.string(),hints:t.array(t.string()).optional()});const n=t.object({currentPage:t.number(),totalPages:t.number(),hasMore:t.boolean(),perPage:t.number().optional(),totalMatches:t.number().optional(),totalFiles:t.number().optional(),totalEntries:t.number().optional(),totalResults:t.number().optional(),entriesPerPage:t.number().optional(),filesPerPage:t.number().optional(),matchesPerPage:t.number().optional()}),a=t.object({currentPage:t.number(),totalPages:t.number(),hasMore:t.boolean(),charOffset:t.number(),charLength:t.number(),totalChars:t.number()}),i=t.array(t.string()).optional(),
|
|
1
|
+
import{z as t}from"zod";import{STATUS_VALUES as o}from"../types/index.js";export const ErrorDataSchema=t.object({id:t.string().optional(),error:t.string(),hints:t.array(t.string()).optional()});const n=t.object({currentPage:t.number(),totalPages:t.number(),hasMore:t.boolean(),perPage:t.number().optional(),totalMatches:t.number().optional(),totalFiles:t.number().optional(),totalEntries:t.number().optional(),totalResults:t.number().optional(),entriesPerPage:t.number().optional(),filesPerPage:t.number().optional(),matchesPerPage:t.number().optional()}),a=t.object({currentPage:t.number(),totalPages:t.number(),hasMore:t.boolean(),charOffset:t.number(),charLength:t.number(),totalChars:t.number()}),i=t.enum(["none","standard","symbols"]),r=t.array(t.string()).optional(),e=t.array(t.union([t.string(),t.object({kind:t.string()}).passthrough()])).optional(),s=t.enum([...o]),p=t.object({line:t.number(),value:t.string().optional(),column:t.number().optional()}),l=t.object({path:t.string(),matchCount:t.number(),matches:t.array(p).optional(),modified:t.string().optional()});export const LocalSearchCodeOutputSchema=t.object({status:s.optional(),data:t.object({files:t.array(l),pagination:n.optional(),searchEngine:t.string().optional()}).optional(),files:t.array(l).optional(),pagination:n.optional(),searchEngine:t.string().optional(),hints:r,warnings:e,error:t.string().optional()}).passthrough();const g=t.object({path:t.string(),type:t.string().optional(),size:t.number().optional(),modified:t.string().optional(),permissions:t.string().optional()});export const LocalFindFilesOutputSchema=t.object({status:s.optional(),data:t.object({files:t.array(g),pagination:n.optional()}).optional(),files:t.array(g).optional(),pagination:n.optional(),hints:r,warnings:e,error:t.string().optional()}).passthrough();const c=t.object({path:t.string(),name:t.string(),type:t.string(),size:t.number().optional(),modified:t.string().optional()});export const LocalViewStructureOutputSchema=t.object({status:s.optional(),data:t.object({path:t.string().optional(),files:t.array(t.string()).optional(),folders:t.array(t.string()).optional(),links:t.array(t.string()).optional(),entries:t.array(c).optional(),summary:t.string().optional(),pagination:n.optional()}).optional(),path:t.string().optional(),files:t.array(t.string()).optional(),folders:t.array(t.string()).optional(),links:t.array(t.string()).optional(),entries:t.array(c).optional(),summary:t.string().optional(),pagination:n.optional(),hints:r,warnings:e,error:t.string().optional()}).passthrough();export const LocalGetFileContentOutputSchema=t.object({status:s.optional(),data:t.object({path:t.string(),content:t.string(),contentView:i.optional(),isSkeleton:t.boolean().optional(),totalLines:t.number().optional(),startLine:t.number().optional(),endLine:t.number().optional(),isPartial:t.boolean().optional(),matchRanges:t.array(t.array(t.number())).optional(),pagination:a.optional(),lastModified:t.string().optional(),lastModifiedBy:t.string().optional()}).optional(),path:t.string().optional(),content:t.string().optional(),contentView:i.optional(),isSkeleton:t.boolean().optional(),pagination:a.optional(),hints:r,warnings:e,error:t.string().optional()}).passthrough();const u=t.object({start:t.object({line:t.number(),character:t.number()}),end:t.object({line:t.number(),character:t.number()})}),h=t.object({uri:t.string(),range:u,content:t.string().optional()});export const LspGotoDefinitionOutputSchema=t.object({status:s.optional(),data:t.object({locations:t.array(h),lspMode:t.string().optional()}).optional(),locations:t.array(h).optional(),lspMode:t.string().optional(),hints:r,warnings:e,error:t.string().optional()}).passthrough();export const LspFindReferencesOutputSchema=t.object({status:s.optional(),data:t.object({locations:t.array(h),pagination:n.optional(),lspMode:t.string().optional()}).optional(),locations:t.array(h).optional(),pagination:n.optional(),lspMode:t.string().optional(),hints:r,warnings:e,error:t.string().optional()}).passthrough();export const LspCallHierarchyOutputSchema=t.object({status:s.optional(),data:t.object({item:t.object({name:t.string(),uri:t.string(),range:u,content:t.string().optional()}).optional(),incomingCalls:t.array(t.object({from:t.object({name:t.string(),uri:t.string(),range:u,content:t.string().optional()}).optional(),to:t.object({name:t.string(),uri:t.string(),range:u,content:t.string().optional()}).optional(),fromRanges:t.array(u).optional()}).passthrough()).optional(),outgoingCalls:t.array(t.object({from:t.object({name:t.string(),uri:t.string(),range:u,content:t.string().optional()}).optional(),to:t.object({name:t.string(),uri:t.string(),range:u,content:t.string().optional()}).optional(),fromRanges:t.array(u).optional()}).passthrough()).optional(),direction:t.string().optional(),depth:t.number().optional(),pagination:n.optional(),lspMode:t.string().optional()}).optional(),pagination:n.optional(),hints:r,warnings:e,error:t.string().optional()}).passthrough();const b=t.object({owner:t.string().optional(),repo:t.string().optional(),full_name:t.string().optional(),url:t.string().optional(),stars:t.number().optional(),language:t.string().optional(),pushed_at:t.string().optional(),description:t.string().optional(),topics:t.array(t.string()).optional(),license:t.string().optional()}).passthrough();export const GitHubSearchRepositoriesOutputSchema=t.object({status:s.optional(),data:t.object({repositories:t.array(b),pagination:n.optional()}).optional(),repositories:t.array(b).optional(),pagination:n.optional(),hints:r,warnings:e,error:t.string().optional()}).passthrough();const m=t.object({number:t.number(),title:t.string(),url:t.string().optional(),state:t.string().optional(),draft:t.boolean().optional(),merged:t.boolean().optional(),created_at:t.string().optional(),updated_at:t.string().optional(),closed_at:t.string().optional(),merged_at:t.string().optional(),author:t.string().optional(),head_ref:t.string().optional(),base_ref:t.string().optional()}).passthrough(),d=t.object({path:t.string(),value:t.string().optional()}).passthrough(),j=t.object({id:t.string(),owner:t.string(),repo:t.string(),matches:t.array(d)}).passthrough();export const GitHubSearchCodeOutputSchema=t.object({status:s.optional(),data:t.object({results:t.array(j),pagination:n.optional()}).optional(),results:t.array(j).optional(),pagination:n.optional(),hints:r,warnings:e,error:t.string().optional()}).passthrough();export const GitHubSearchPullRequestsOutputSchema=t.object({status:s.optional(),data:t.object({pull_requests:t.array(m),total_count:t.number().optional(),pagination:n.optional()}).optional(),pull_requests:t.array(m).optional(),pagination:n.optional(),hints:r,warnings:e,error:t.string().optional()}).passthrough();const y=t.object({path:t.string(),name:t.string().optional(),type:t.string().optional(),size:t.number().optional()}).passthrough();export const GitHubFileContentOutputSchema=t.object({status:s.optional(),data:t.object({path:t.string(),content:t.string(),contentView:i.optional(),isSkeleton:t.boolean().optional(),totalLines:t.number().optional(),startLine:t.number().optional(),endLine:t.number().optional(),isPartial:t.boolean().optional(),resolvedBranch:t.string().optional(),pagination:a.optional(),lastModified:t.string().optional(),lastModifiedBy:t.string().optional()}).optional(),path:t.string().optional(),content:t.string().optional(),contentView:i.optional(),isSkeleton:t.boolean().optional(),pagination:a.optional(),hints:r,warnings:e,error:t.string().optional()}).passthrough();export const GitHubViewRepoStructureOutputSchema=t.object({status:s.optional(),data:t.object({entries:t.array(y),pagination:n.optional()}).optional(),entries:t.array(y).optional(),pagination:n.optional(),hints:r,warnings:e,error:t.string().optional()}).passthrough();export const GitHubCloneRepoOutputSchema=t.object({status:s.optional(),data:t.object({localPath:t.string(),branch:t.string(),cached:t.boolean(),sparsePath:t.string().optional(),cloneTimeMs:t.number().optional(),totalSize:t.number().optional(),fileCount:t.number().optional()}).optional(),localPath:t.string().optional(),branch:t.string().optional(),cached:t.boolean().optional(),hints:r,warnings:e,error:t.string().optional()}).passthrough();const f=t.object({name:t.string(),version:t.string().optional(),repository:t.string().optional(),license:t.string().optional(),description:t.string().optional(),deprecated:t.union([t.boolean(),t.string()]).optional(),downloads:t.number().optional(),recentVersions:t.array(t.string()).optional()}).passthrough();export const PackageSearchOutputSchema=t.object({status:s.optional(),data:t.object({packages:t.array(f)}).optional(),packages:t.array(f).optional(),hints:r,warnings:e,error:t.string().optional()}).passthrough();
|
package/dist/schemas/runtime.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function validateRipgrepQuery(e){const
|
|
1
|
+
export function validateRipgrepQuery(e){const i=[],t=[];return e&&"object"==typeof e?(e.keywords&&"string"==typeof e.keywords||i.push("`keywords` is required"),e.filesOnly&&e.filesWithoutMatch&&i.push("`filesOnly` and `filesWithoutMatch` are mutually exclusive"),e.countLinesPerFile&&e.countMatchesPerFile&&i.push("`countLinesPerFile` and `countMatchesPerFile` are mutually exclusive"),e.fixedString&&e.perlRegex&&i.push("`fixedString` and `perlRegex` are mutually exclusive"),e.caseSensitive&&e.caseInsensitive&&i.push("`caseSensitive` and `caseInsensitive` are mutually exclusive"),e.multilineDotall&&!e.multiline&&i.push("`multilineDotall` requires `multiline=true`"),{isValid:0===i.length,errors:i,warnings:t}):(i.push("Query must be an object"),{isValid:!1,errors:i,warnings:t})}export function applyWorkflowMode(e){if(!e||"object"!=typeof e)return e;const i=e.mode;if(!i||"string"!=typeof i)return e;const t={...e};return"discovery"===i?void 0===t.filesOnly&&(t.filesOnly=!0):"detailed"===i&&void 0===t.contextLines&&(t.contextLines=3),t}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,9 +15,7 @@ export interface ToolNames {
|
|
|
15
15
|
LOCAL_FETCH_CONTENT: "localGetFileContent";
|
|
16
16
|
LOCAL_FIND_FILES: "localFindFiles";
|
|
17
17
|
LOCAL_VIEW_STRUCTURE: "localViewStructure";
|
|
18
|
-
|
|
19
|
-
LSP_FIND_REFERENCES: "lspFindReferences";
|
|
20
|
-
LSP_CALL_HIERARCHY: "lspCallHierarchy";
|
|
18
|
+
LSP_GET_SEMANTIC_CONTENT: "lspGetSemanticContent";
|
|
21
19
|
}
|
|
22
20
|
export interface ToolHints {
|
|
23
21
|
readonly empty: readonly string[];
|
|
@@ -110,6 +108,13 @@ export interface CharPagination {
|
|
|
110
108
|
readonly charOffset: number;
|
|
111
109
|
readonly charLength: number;
|
|
112
110
|
readonly totalChars: number;
|
|
111
|
+
/** How the page boundary was chosen.
|
|
112
|
+
* `'semantic'` — snapped to a tree-sitter/heuristic block boundary.
|
|
113
|
+
* `'char-limit'` — fixed char-size cut; may end mid-block (see nextBlockChar). */
|
|
114
|
+
readonly chunkMode?: "semantic" | "char-limit";
|
|
115
|
+
/** Set when `chunkMode` is `'char-limit'` and the cut is mid-block.
|
|
116
|
+
* Char offset of the next top-level block start; extend charLength to reach it. */
|
|
117
|
+
readonly nextBlockChar?: number;
|
|
113
118
|
}
|
|
114
119
|
/** LSP semantic vs. fallback mode marker. */
|
|
115
120
|
export declare enum LspMode {
|
|
@@ -137,6 +142,7 @@ export interface ToolResultEnvelope<TData> {
|
|
|
137
142
|
readonly warnings?: readonly ToolWarning[];
|
|
138
143
|
readonly error?: string;
|
|
139
144
|
}
|
|
145
|
+
export type ContentView = "none" | "standard" | "symbols";
|
|
140
146
|
/** Per-file match pagination — for paging matches *within* a single file. */
|
|
141
147
|
export interface LocalSearchCodeMatchPagination {
|
|
142
148
|
readonly currentPage: number;
|
|
@@ -152,8 +158,10 @@ export interface LocalSearchCodeMatch {
|
|
|
152
158
|
}
|
|
153
159
|
export interface LocalSearchCodeFile {
|
|
154
160
|
path: string;
|
|
155
|
-
|
|
156
|
-
|
|
161
|
+
/** Omitted in filesOnly/discovery mode — rg -l reports no per-file counts. */
|
|
162
|
+
matchCount?: number;
|
|
163
|
+
/** Omitted in discovery/filesOnly mode — empty arrays are noise. */
|
|
164
|
+
matches?: LocalSearchCodeMatch[];
|
|
157
165
|
modified?: string;
|
|
158
166
|
pagination?: LocalSearchCodeMatchPagination;
|
|
159
167
|
}
|
|
@@ -179,6 +187,8 @@ export interface LocalFindFilesData {
|
|
|
179
187
|
export interface LocalGetFileContentData {
|
|
180
188
|
readonly path: string;
|
|
181
189
|
readonly content: string;
|
|
190
|
+
readonly contentView?: ContentView;
|
|
191
|
+
readonly isSkeleton?: boolean;
|
|
182
192
|
readonly totalLines?: number;
|
|
183
193
|
readonly startLine?: number;
|
|
184
194
|
readonly endLine?: number;
|
|
@@ -268,6 +278,8 @@ export interface GitHubSearchCodeData {
|
|
|
268
278
|
export interface GitHubFileContentData {
|
|
269
279
|
readonly path: string;
|
|
270
280
|
readonly content: string;
|
|
281
|
+
readonly contentView?: ContentView;
|
|
282
|
+
readonly isSkeleton?: boolean;
|
|
271
283
|
readonly totalLines?: number;
|
|
272
284
|
readonly startLine?: number;
|
|
273
285
|
readonly endLine?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octocodeai/octocode-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.1.0",
|
|
4
4
|
"description": "Core config, prompts, tools, and schemas for Octocode MCP",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"generate": "tsx src/octocode-scripts/generateDefaultJson.ts",
|
|
46
|
+
"dump:agent-context": "tsx src/octocode-scripts/dumpAgentContext.ts",
|
|
46
47
|
"compress": "yarn generate && node scripts/compress-config.mjs",
|
|
47
48
|
"build": "rm -rf dist && yarn generate && node scripts/compress-config.mjs && tsc && node scripts/minify-dist.mjs",
|
|
48
49
|
"lint": "eslint src/**/*.ts",
|