@octocodeai/octocode-core 4.0.0 → 4.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 +305 -224
- package/dist/index.js +1 -1
- package/dist/schemas/extraTypes.d.ts +2 -7
- package/dist/schemas/index.d.ts +1 -96
- package/dist/schemas/index.js +1 -1
- package/dist/types/index.d.ts +11 -31
- package/dist/types/index.js +1 -1
- package/package.json +3 -2
- package/dist/schemas/descriptions.d.ts +0 -17
- package/dist/schemas/descriptions.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{config as e}from"./configLoader.js";export const octocodeConfig=e;export const completeMetadata={instructions:e.instructions,toolNames:e.toolNames,baseSchema:{mainResearchGoal:e.baseSchema.mainResearchGoal,researchGoal:e.baseSchema.researchGoal,reasoning:e.baseSchema.reasoning,...e.baseSchema.
|
|
1
|
+
import{config as e}from"./configLoader.js";export const octocodeConfig=e;export const completeMetadata={instructions:e.instructions,toolNames:e.toolNames,baseSchema:{id:e.baseSchema.id,mainResearchGoal:e.baseSchema.mainResearchGoal,researchGoal:e.baseSchema.researchGoal,reasoning:e.baseSchema.reasoning,...e.baseSchema.verbose&&{verbose:e.baseSchema.verbose}},tools:e.tools,baseHints:e.baseHints??{},genericErrorHints:e.genericErrorHints??[]};
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
* - provider-mapper shapes (`GitHubRepositoryOutput`,
|
|
10
10
|
* `GitHubSearchRepositoriesData`).
|
|
11
11
|
*/
|
|
12
|
-
import type { CharPagination, LspRange, LspLocation, LspMode,
|
|
12
|
+
import type { CharPagination, LspRange, LspLocation, LspMode, PaginationInfo, LocalSearchCodeFile, LocalFindFilesEntry, GitHubRepositoryItem, GitHubPullRequestItem, GitHubSearchCodeGroup, GitHubFileContentData } from "../types/index.js";
|
|
13
13
|
export interface BaseQuery {
|
|
14
14
|
id?: string;
|
|
15
15
|
mainResearchGoal?: string;
|
|
16
16
|
researchGoal?: string;
|
|
17
17
|
reasoning?: string;
|
|
18
|
-
|
|
18
|
+
verbose?: boolean;
|
|
19
19
|
}
|
|
20
20
|
/** Local-tool flavour — adds the conventional `path` field. */
|
|
21
21
|
export interface BaseQueryLocal extends BaseQuery {
|
|
@@ -59,12 +59,10 @@ export interface LocalSearchCodeToolResult extends BaseToolResult {
|
|
|
59
59
|
files?: LocalSearchCodeFile[];
|
|
60
60
|
pagination?: PaginationInfo;
|
|
61
61
|
searchEngine?: string;
|
|
62
|
-
charPagination?: CharPagination;
|
|
63
62
|
}
|
|
64
63
|
export interface LocalFindFilesToolResult extends BaseToolResult {
|
|
65
64
|
files?: LocalFindFilesEntry[];
|
|
66
65
|
pagination?: PaginationInfo;
|
|
67
|
-
charPagination?: CharPagination | PaginationInfo;
|
|
68
66
|
}
|
|
69
67
|
/** Char-range pair carried by `LocalGetFileContentToolResult.matchRanges`. */
|
|
70
68
|
export interface MatchRange {
|
|
@@ -102,7 +100,6 @@ export interface LocalViewStructureToolResult extends BaseToolResult {
|
|
|
102
100
|
entries?: LocalViewStructureEntryFlat[];
|
|
103
101
|
summary?: string | Record<string, unknown>;
|
|
104
102
|
pagination?: PaginationInfo;
|
|
105
|
-
charPagination?: CharPagination;
|
|
106
103
|
}
|
|
107
104
|
export interface LspGotoDefinitionToolResult extends BaseToolResult {
|
|
108
105
|
locations?: LspLocation[];
|
|
@@ -113,7 +110,6 @@ export interface LspFindReferencesToolResult extends BaseToolResult {
|
|
|
113
110
|
references?: LspLocation[];
|
|
114
111
|
pagination?: PaginationInfo;
|
|
115
112
|
lspMode?: LspMode;
|
|
116
|
-
charPagination?: CharPagination;
|
|
117
113
|
}
|
|
118
114
|
export interface LspCallHierarchyToolResult extends BaseToolResult {
|
|
119
115
|
item?: LspCallHierarchyItem;
|
|
@@ -123,7 +119,6 @@ export interface LspCallHierarchyToolResult extends BaseToolResult {
|
|
|
123
119
|
depth?: number;
|
|
124
120
|
pagination?: PaginationInfo;
|
|
125
121
|
lspMode?: LspMode;
|
|
126
|
-
charPagination?: CharPagination;
|
|
127
122
|
}
|
|
128
123
|
export interface GitHubRepoStructureDirectoryEntry {
|
|
129
124
|
files: string[];
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Zod input schemas — the canonical schemas every tool exposes to MCP
|
|
3
3
|
* clients. The mcp-host overlay extends these with default pagination
|
|
4
|
-
* values,
|
|
4
|
+
* values, detail controls, and meta fields (id/researchGoal/etc.).
|
|
5
5
|
*
|
|
6
6
|
* All schemas are intentionally loose at this layer:
|
|
7
7
|
* - String enums use `z.string()` so the overlay can tighten via
|
|
@@ -60,11 +60,6 @@ export declare const RipgrepQuerySchema: z.ZodObject<{
|
|
|
60
60
|
noUnicode: z.ZodOptional<z.ZodBoolean>;
|
|
61
61
|
threads: z.ZodOptional<z.ZodNumber>;
|
|
62
62
|
mmap: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
-
verbosity: z.ZodOptional<z.ZodEnum<{
|
|
64
|
-
basic: import("../types/index.js").Verbosity.Basic;
|
|
65
|
-
compact: import("../types/index.js").Verbosity.Compact;
|
|
66
|
-
concise: import("../types/index.js").Verbosity.Concise;
|
|
67
|
-
}>>;
|
|
68
63
|
id: z.ZodOptional<z.ZodString>;
|
|
69
64
|
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
70
65
|
researchGoal: z.ZodOptional<z.ZodString>;
|
|
@@ -97,14 +92,7 @@ export declare const FindFilesQuerySchema: z.ZodObject<{
|
|
|
97
92
|
filesPerPage: z.ZodOptional<z.ZodNumber>;
|
|
98
93
|
filePageNumber: z.ZodOptional<z.ZodNumber>;
|
|
99
94
|
showFileLastModified: z.ZodOptional<z.ZodBoolean>;
|
|
100
|
-
charOffset: z.ZodOptional<z.ZodNumber>;
|
|
101
|
-
charLength: z.ZodOptional<z.ZodNumber>;
|
|
102
95
|
sortBy: z.ZodOptional<z.ZodString>;
|
|
103
|
-
verbosity: z.ZodOptional<z.ZodEnum<{
|
|
104
|
-
basic: import("../types/index.js").Verbosity.Basic;
|
|
105
|
-
compact: import("../types/index.js").Verbosity.Compact;
|
|
106
|
-
concise: import("../types/index.js").Verbosity.Concise;
|
|
107
|
-
}>>;
|
|
108
96
|
id: z.ZodOptional<z.ZodString>;
|
|
109
97
|
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
110
98
|
researchGoal: z.ZodOptional<z.ZodString>;
|
|
@@ -127,14 +115,7 @@ export declare const ViewStructureQuerySchema: z.ZodObject<{
|
|
|
127
115
|
depth: z.ZodOptional<z.ZodNumber>;
|
|
128
116
|
recursive: z.ZodOptional<z.ZodBoolean>;
|
|
129
117
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
130
|
-
charOffset: z.ZodOptional<z.ZodNumber>;
|
|
131
|
-
charLength: z.ZodOptional<z.ZodNumber>;
|
|
132
118
|
showFileLastModified: z.ZodOptional<z.ZodBoolean>;
|
|
133
|
-
verbosity: z.ZodOptional<z.ZodEnum<{
|
|
134
|
-
basic: import("../types/index.js").Verbosity.Basic;
|
|
135
|
-
compact: import("../types/index.js").Verbosity.Compact;
|
|
136
|
-
concise: import("../types/index.js").Verbosity.Concise;
|
|
137
|
-
}>>;
|
|
138
119
|
id: z.ZodOptional<z.ZodString>;
|
|
139
120
|
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
140
121
|
researchGoal: z.ZodOptional<z.ZodString>;
|
|
@@ -147,15 +128,8 @@ export declare const FetchContentQuerySchema: z.ZodObject<{
|
|
|
147
128
|
matchStringContextLines: z.ZodOptional<z.ZodNumber>;
|
|
148
129
|
matchStringIsRegex: z.ZodOptional<z.ZodBoolean>;
|
|
149
130
|
matchStringCaseSensitive: z.ZodOptional<z.ZodBoolean>;
|
|
150
|
-
charOffset: z.ZodOptional<z.ZodNumber>;
|
|
151
|
-
charLength: z.ZodOptional<z.ZodNumber>;
|
|
152
131
|
startLine: z.ZodOptional<z.ZodNumber>;
|
|
153
132
|
endLine: z.ZodOptional<z.ZodNumber>;
|
|
154
|
-
verbosity: z.ZodOptional<z.ZodEnum<{
|
|
155
|
-
basic: import("../types/index.js").Verbosity.Basic;
|
|
156
|
-
compact: import("../types/index.js").Verbosity.Compact;
|
|
157
|
-
concise: import("../types/index.js").Verbosity.Concise;
|
|
158
|
-
}>>;
|
|
159
133
|
id: z.ZodOptional<z.ZodString>;
|
|
160
134
|
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
161
135
|
researchGoal: z.ZodOptional<z.ZodString>;
|
|
@@ -173,15 +147,8 @@ export declare const FileContentQuerySchema: z.ZodObject<{
|
|
|
173
147
|
matchStringContextLines: z.ZodOptional<z.ZodNumber>;
|
|
174
148
|
matchStringIsRegex: z.ZodOptional<z.ZodBoolean>;
|
|
175
149
|
matchStringCaseSensitive: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
-
charOffset: z.ZodOptional<z.ZodNumber>;
|
|
177
|
-
charLength: z.ZodOptional<z.ZodNumber>;
|
|
178
150
|
forceRefresh: z.ZodOptional<z.ZodBoolean>;
|
|
179
151
|
type: z.ZodOptional<z.ZodString>;
|
|
180
|
-
verbosity: z.ZodOptional<z.ZodEnum<{
|
|
181
|
-
basic: import("../types/index.js").Verbosity.Basic;
|
|
182
|
-
compact: import("../types/index.js").Verbosity.Compact;
|
|
183
|
-
concise: import("../types/index.js").Verbosity.Concise;
|
|
184
|
-
}>>;
|
|
185
152
|
id: z.ZodOptional<z.ZodString>;
|
|
186
153
|
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
187
154
|
researchGoal: z.ZodOptional<z.ZodString>;
|
|
@@ -200,11 +167,6 @@ export declare const GitHubCodeSearchQuerySchema: z.ZodObject<{
|
|
|
200
167
|
}>>;
|
|
201
168
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
202
169
|
page: z.ZodOptional<z.ZodNumber>;
|
|
203
|
-
verbosity: z.ZodOptional<z.ZodEnum<{
|
|
204
|
-
basic: import("../types/index.js").Verbosity.Basic;
|
|
205
|
-
compact: import("../types/index.js").Verbosity.Compact;
|
|
206
|
-
concise: import("../types/index.js").Verbosity.Concise;
|
|
207
|
-
}>>;
|
|
208
170
|
id: z.ZodOptional<z.ZodString>;
|
|
209
171
|
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
210
172
|
researchGoal: z.ZodOptional<z.ZodString>;
|
|
@@ -227,11 +189,6 @@ export declare const GitHubReposSearchSingleQuerySchema: z.ZodObject<{
|
|
|
227
189
|
sort: z.ZodOptional<z.ZodString>;
|
|
228
190
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
229
191
|
page: z.ZodOptional<z.ZodNumber>;
|
|
230
|
-
verbosity: z.ZodOptional<z.ZodEnum<{
|
|
231
|
-
basic: import("../types/index.js").Verbosity.Basic;
|
|
232
|
-
compact: import("../types/index.js").Verbosity.Compact;
|
|
233
|
-
concise: import("../types/index.js").Verbosity.Concise;
|
|
234
|
-
}>>;
|
|
235
192
|
id: z.ZodOptional<z.ZodString>;
|
|
236
193
|
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
237
194
|
researchGoal: z.ZodOptional<z.ZodString>;
|
|
@@ -274,18 +231,11 @@ export declare const GitHubPullRequestSearchQuerySchema: z.ZodObject<{
|
|
|
274
231
|
withComments: z.ZodOptional<z.ZodBoolean>;
|
|
275
232
|
withCommits: z.ZodOptional<z.ZodBoolean>;
|
|
276
233
|
type: z.ZodOptional<z.ZodString>;
|
|
277
|
-
charOffset: z.ZodOptional<z.ZodNumber>;
|
|
278
|
-
charLength: z.ZodOptional<z.ZodNumber>;
|
|
279
234
|
partialContentMetadata: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
280
235
|
file: z.ZodString;
|
|
281
236
|
additions: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
282
237
|
deletions: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
283
238
|
}, z.core.$strip>>>;
|
|
284
|
-
verbosity: z.ZodOptional<z.ZodEnum<{
|
|
285
|
-
basic: import("../types/index.js").Verbosity.Basic;
|
|
286
|
-
compact: import("../types/index.js").Verbosity.Compact;
|
|
287
|
-
concise: import("../types/index.js").Verbosity.Concise;
|
|
288
|
-
}>>;
|
|
289
239
|
id: z.ZodOptional<z.ZodString>;
|
|
290
240
|
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
291
241
|
researchGoal: z.ZodOptional<z.ZodString>;
|
|
@@ -299,11 +249,6 @@ export declare const GitHubViewRepoStructureQuerySchema: z.ZodObject<{
|
|
|
299
249
|
depth: z.ZodOptional<z.ZodNumber>;
|
|
300
250
|
entriesPerPage: z.ZodOptional<z.ZodNumber>;
|
|
301
251
|
entryPageNumber: z.ZodOptional<z.ZodNumber>;
|
|
302
|
-
verbosity: z.ZodOptional<z.ZodEnum<{
|
|
303
|
-
basic: import("../types/index.js").Verbosity.Basic;
|
|
304
|
-
compact: import("../types/index.js").Verbosity.Compact;
|
|
305
|
-
concise: import("../types/index.js").Verbosity.Concise;
|
|
306
|
-
}>>;
|
|
307
252
|
id: z.ZodOptional<z.ZodString>;
|
|
308
253
|
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
309
254
|
researchGoal: z.ZodOptional<z.ZodString>;
|
|
@@ -314,11 +259,6 @@ export declare const NpmPackageQuerySchema: z.ZodObject<{
|
|
|
314
259
|
name: z.ZodString;
|
|
315
260
|
searchLimit: z.ZodOptional<z.ZodNumber>;
|
|
316
261
|
npmFetchMetadata: z.ZodOptional<z.ZodBoolean>;
|
|
317
|
-
verbosity: z.ZodOptional<z.ZodEnum<{
|
|
318
|
-
basic: import("../types/index.js").Verbosity.Basic;
|
|
319
|
-
compact: import("../types/index.js").Verbosity.Compact;
|
|
320
|
-
concise: import("../types/index.js").Verbosity.Concise;
|
|
321
|
-
}>>;
|
|
322
262
|
id: z.ZodOptional<z.ZodString>;
|
|
323
263
|
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
324
264
|
researchGoal: z.ZodOptional<z.ZodString>;
|
|
@@ -330,13 +270,6 @@ export declare const CloneRepoQuerySchema: z.ZodObject<{
|
|
|
330
270
|
branch: z.ZodOptional<z.ZodString>;
|
|
331
271
|
sparse_path: z.ZodOptional<z.ZodString>;
|
|
332
272
|
forceRefresh: z.ZodOptional<z.ZodBoolean>;
|
|
333
|
-
charOffset: z.ZodOptional<z.ZodNumber>;
|
|
334
|
-
charLength: z.ZodOptional<z.ZodNumber>;
|
|
335
|
-
verbosity: z.ZodOptional<z.ZodEnum<{
|
|
336
|
-
basic: import("../types/index.js").Verbosity.Basic;
|
|
337
|
-
compact: import("../types/index.js").Verbosity.Compact;
|
|
338
|
-
concise: import("../types/index.js").Verbosity.Concise;
|
|
339
|
-
}>>;
|
|
340
273
|
id: z.ZodOptional<z.ZodString>;
|
|
341
274
|
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
342
275
|
researchGoal: z.ZodOptional<z.ZodString>;
|
|
@@ -349,13 +282,6 @@ export declare const BulkCloneRepoSchema: z.ZodObject<{
|
|
|
349
282
|
branch: z.ZodOptional<z.ZodString>;
|
|
350
283
|
sparse_path: z.ZodOptional<z.ZodString>;
|
|
351
284
|
forceRefresh: z.ZodOptional<z.ZodBoolean>;
|
|
352
|
-
charOffset: z.ZodOptional<z.ZodNumber>;
|
|
353
|
-
charLength: z.ZodOptional<z.ZodNumber>;
|
|
354
|
-
verbosity: z.ZodOptional<z.ZodEnum<{
|
|
355
|
-
basic: import("../types/index.js").Verbosity.Basic;
|
|
356
|
-
compact: import("../types/index.js").Verbosity.Compact;
|
|
357
|
-
concise: import("../types/index.js").Verbosity.Concise;
|
|
358
|
-
}>>;
|
|
359
285
|
id: z.ZodOptional<z.ZodString>;
|
|
360
286
|
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
361
287
|
researchGoal: z.ZodOptional<z.ZodString>;
|
|
@@ -364,13 +290,6 @@ export declare const BulkCloneRepoSchema: z.ZodObject<{
|
|
|
364
290
|
}, z.core.$strip>;
|
|
365
291
|
export declare const LSPGotoDefinitionQuerySchema: z.ZodObject<{
|
|
366
292
|
contextLines: z.ZodOptional<z.ZodNumber>;
|
|
367
|
-
charOffset: z.ZodOptional<z.ZodNumber>;
|
|
368
|
-
charLength: z.ZodOptional<z.ZodNumber>;
|
|
369
|
-
verbosity: z.ZodOptional<z.ZodEnum<{
|
|
370
|
-
basic: import("../types/index.js").Verbosity.Basic;
|
|
371
|
-
compact: import("../types/index.js").Verbosity.Compact;
|
|
372
|
-
concise: import("../types/index.js").Verbosity.Concise;
|
|
373
|
-
}>>;
|
|
374
293
|
uri: z.ZodString;
|
|
375
294
|
symbolName: z.ZodString;
|
|
376
295
|
lineHint: z.ZodNumber;
|
|
@@ -388,13 +307,6 @@ export declare const LSPFindReferencesQuerySchema: z.ZodObject<{
|
|
|
388
307
|
groupByFile: z.ZodOptional<z.ZodBoolean>;
|
|
389
308
|
includePattern: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
390
309
|
excludePattern: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
391
|
-
charOffset: z.ZodOptional<z.ZodNumber>;
|
|
392
|
-
charLength: z.ZodOptional<z.ZodNumber>;
|
|
393
|
-
verbosity: z.ZodOptional<z.ZodEnum<{
|
|
394
|
-
basic: import("../types/index.js").Verbosity.Basic;
|
|
395
|
-
compact: import("../types/index.js").Verbosity.Compact;
|
|
396
|
-
concise: import("../types/index.js").Verbosity.Concise;
|
|
397
|
-
}>>;
|
|
398
310
|
uri: z.ZodString;
|
|
399
311
|
symbolName: z.ZodString;
|
|
400
312
|
lineHint: z.ZodNumber;
|
|
@@ -413,13 +325,6 @@ export declare const LSPCallHierarchyQuerySchema: z.ZodObject<{
|
|
|
413
325
|
contextLines: z.ZodOptional<z.ZodNumber>;
|
|
414
326
|
callsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
415
327
|
page: z.ZodOptional<z.ZodNumber>;
|
|
416
|
-
charOffset: z.ZodOptional<z.ZodNumber>;
|
|
417
|
-
charLength: z.ZodOptional<z.ZodNumber>;
|
|
418
|
-
verbosity: z.ZodOptional<z.ZodEnum<{
|
|
419
|
-
basic: import("../types/index.js").Verbosity.Basic;
|
|
420
|
-
compact: import("../types/index.js").Verbosity.Compact;
|
|
421
|
-
concise: import("../types/index.js").Verbosity.Concise;
|
|
422
|
-
}>>;
|
|
423
328
|
uri: z.ZodString;
|
|
424
329
|
symbolName: z.ZodString;
|
|
425
330
|
lineHint: z.ZodNumber;
|
package/dist/schemas/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as o}from"zod";
|
|
1
|
+
import{z as o}from"zod";const n=o.array(o.string()).optional(),t={id:o.string().optional(),mainResearchGoal:o.string().optional(),researchGoal:o.string().optional(),reasoning:o.string().optional()};export const RipgrepQuerySchema=o.object({...t,pattern:o.string(),path:o.string(),mode:o.string().optional(),fixedString:o.boolean().optional(),perlRegex:o.boolean().optional(),smartCase:o.boolean().optional(),caseInsensitive:o.boolean().optional(),caseSensitive:o.boolean().optional(),wholeWord:o.boolean().optional(),invertMatch:o.boolean().optional(),type:o.string().optional(),include:n,exclude:n,excludeDir:n,noIgnore:o.boolean().optional(),hidden:o.boolean().optional(),followSymlinks:o.boolean().optional(),filesOnly:o.boolean().optional(),filesWithoutMatch:o.boolean().optional(),count:o.boolean().optional(),countMatches:o.boolean().optional(),contextLines:o.number().int().optional(),beforeContext:o.number().int().optional(),afterContext:o.number().int().optional(),matchContentLength:o.number().int().optional(),maxMatchesPerFile:o.number().int().optional(),maxFiles:o.number().int().optional(),filesPerPage:o.number().int().optional(),filePageNumber:o.number().int().optional(),matchesPerPage:o.number().int().optional(),multiline:o.boolean().optional(),multilineDotall:o.boolean().optional(),binaryFiles:o.string().optional(),includeStats:o.boolean().optional(),encoding:o.string().optional(),sort:o.string().optional(),sortReverse:o.boolean().optional(),noMessages:o.boolean().optional(),lineRegexp:o.boolean().optional(),passthru:o.boolean().optional(),debug:o.boolean().optional(),showFileLastModified:o.boolean().optional(),noUnicode:o.boolean().optional(),threads:o.number().int().optional(),mmap:o.boolean().optional()});export const FindFilesQuerySchema=o.object({...t,path:o.string(),maxDepth:o.number().int().optional(),minDepth:o.number().int().optional(),name:o.string().optional(),iname:o.string().optional(),names:n,pathPattern:o.string().optional(),regex:o.string().optional(),regexType:o.string().optional(),type:o.string().optional(),empty:o.boolean().optional(),modifiedWithin:o.string().optional(),modifiedBefore:o.string().optional(),accessedWithin:o.string().optional(),sizeGreater:o.string().optional(),sizeLess:o.string().optional(),permissions:o.string().optional(),executable:o.boolean().optional(),readable:o.boolean().optional(),writable:o.boolean().optional(),excludeDir:n,limit:o.number().int().optional(),details:o.boolean().optional(),filesPerPage:o.number().int().optional(),filePageNumber:o.number().int().optional(),showFileLastModified:o.boolean().optional(),sortBy:o.string().optional()});export const ViewStructureQuerySchema=o.object({...t,path:o.string(),details:o.boolean().optional(),hidden:o.boolean().optional(),humanReadable:o.boolean().optional(),sortBy:o.string().optional(),reverse:o.boolean().optional(),entriesPerPage:o.number().int().optional(),entryPageNumber:o.number().int().optional(),pattern:o.string().optional(),directoriesOnly:o.boolean().optional(),filesOnly:o.boolean().optional(),extension:o.string().optional(),extensions:n,depth:o.number().int().optional(),recursive:o.boolean().optional(),limit:o.number().int().optional(),showFileLastModified:o.boolean().optional()});export const FetchContentQuerySchema=o.object({...t,path:o.string(),fullContent:o.boolean().optional(),matchString:o.string().optional(),matchStringContextLines:o.number().int().optional(),matchStringIsRegex:o.boolean().optional(),matchStringCaseSensitive:o.boolean().optional(),startLine:o.number().int().optional(),endLine:o.number().int().optional()});export const FileContentQuerySchema=o.object({...t,owner:o.string(),repo:o.string(),branch:o.string().optional(),path:o.string(),startLine:o.number().int().optional(),endLine:o.number().int().optional(),fullContent:o.boolean().optional(),matchString:o.string().optional(),matchStringContextLines:o.number().int().optional(),matchStringIsRegex:o.boolean().optional(),matchStringCaseSensitive:o.boolean().optional(),forceRefresh:o.boolean().optional(),type:o.string().optional()});export const GitHubCodeSearchQuerySchema=o.object({...t,keywordsToSearch:n,owner:o.string().optional(),repo:o.string().optional(),extension:o.string().optional(),filename:o.string().optional(),path:o.string().optional(),match:o.enum(["file","path"]).optional(),limit:o.number().int().optional(),page:o.number().int().optional()});export const GitHubReposSearchSingleQuerySchema=o.object({...t,keywordsToSearch:n,topicsToSearch:n,language:o.string().optional(),owner:o.string().optional(),stars:o.string().optional(),size:o.string().optional(),created:o.string().optional(),updated:o.string().optional(),match:o.array(o.enum(["name","description","readme"])).optional(),sort:o.string().optional(),limit:o.number().int().optional(),page:o.number().int().optional()});export const GitHubPullRequestSearchQuerySchema=o.object({...t,query:o.string().optional(),prNumber:o.number().int().optional(),owner:o.string().optional(),repo:o.string().optional(),state:o.string().optional(),assignee:o.string().optional(),author:o.string().optional(),commenter:o.string().optional(),involves:o.string().optional(),mentions:o.string().optional(),"review-requested":o.string().optional(),"reviewed-by":o.string().optional(),label:o.union([o.string(),o.array(o.string())]).optional(),"no-label":o.boolean().optional(),"no-milestone":o.boolean().optional(),"no-project":o.boolean().optional(),"no-assignee":o.boolean().optional(),head:o.string().optional(),base:o.string().optional(),created:o.string().optional(),updated:o.string().optional(),closed:o.string().optional(),"merged-at":o.string().optional(),comments:o.string().optional(),reactions:o.string().optional(),interactions:o.string().optional(),draft:o.boolean().optional(),merged:o.boolean().optional(),matchScope:n,sort:o.string().optional(),order:o.string().optional(),limit:o.number().int().optional(),page:o.number().int().optional(),withComments:o.boolean().optional(),withCommits:o.boolean().optional(),type:o.string().optional(),partialContentMetadata:o.array(o.object({file:o.string(),additions:o.array(o.number().int()).optional(),deletions:o.array(o.number().int()).optional()})).optional()});export const GitHubViewRepoStructureQuerySchema=o.object({...t,owner:o.string(),repo:o.string(),branch:o.string().optional(),path:o.string().optional(),depth:o.number().int().optional(),entriesPerPage:o.number().int().optional(),entryPageNumber:o.number().int().optional()});export const NpmPackageQuerySchema=o.object({...t,ecosystem:o.literal("npm").optional(),name:o.string(),searchLimit:o.number().int().optional(),npmFetchMetadata:o.boolean().optional()});export const CloneRepoQuerySchema=o.object({...t,owner:o.string(),repo:o.string(),branch:o.string().optional(),sparse_path:o.string().optional(),forceRefresh:o.boolean().optional()});export const BulkCloneRepoSchema=o.object({queries:o.array(CloneRepoQuerySchema).min(1)});const e={...t,uri:o.string(),symbolName:o.string(),lineHint:o.number().int(),orderHint:o.number().int().optional()};export const LSPGotoDefinitionQuerySchema=o.object({...e,contextLines:o.number().int().optional()});export const LSPFindReferencesQuerySchema=o.object({...e,includeDeclaration:o.boolean().optional(),contextLines:o.number().int().optional(),referencesPerPage:o.number().int().optional(),page:o.number().int().optional(),groupByFile:o.boolean().optional(),includePattern:n,excludePattern:n});export const LSPCallHierarchyQuerySchema=o.object({...e,direction:o.enum(["incoming","outgoing"]),depth:o.number().int().optional(),contextLines:o.number().int().optional(),callsPerPage:o.number().int().optional(),page:o.number().int().optional()});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -21,20 +21,22 @@ export interface ToolNames {
|
|
|
21
21
|
}
|
|
22
22
|
export interface ToolHints {
|
|
23
23
|
readonly empty: readonly string[];
|
|
24
|
-
readonly dynamic?: Readonly<Record<string, readonly string[] | undefined>>;
|
|
25
24
|
}
|
|
26
25
|
export interface ToolSchema {
|
|
27
26
|
readonly [param: string]: string;
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
30
|
-
* Authoring type for resource files — carries
|
|
31
|
-
* (name, description, schema)
|
|
32
|
-
*
|
|
29
|
+
* Authoring type for resource files — carries the static definition
|
|
30
|
+
* (name, description, schema) plus optional empty-result hints authored
|
|
31
|
+
* alongside the tool. Runtime hints from the MCP server response layer
|
|
32
|
+
* are additive; these provide pre-call and empty-result guidance.
|
|
33
33
|
*/
|
|
34
34
|
export interface ToolSpec {
|
|
35
35
|
readonly name: string;
|
|
36
36
|
readonly description: string;
|
|
37
37
|
readonly schema: ToolSchema;
|
|
38
|
+
/** Hints authored in the resource file. Defaults to `{ empty: [] }` when absent. */
|
|
39
|
+
readonly hints?: ToolHints;
|
|
38
40
|
}
|
|
39
41
|
/**
|
|
40
42
|
* Full tool descriptor stored in the config blob and consumed by MCP clients.
|
|
@@ -50,41 +52,19 @@ export interface ToolMetadata extends ToolSpec {
|
|
|
50
52
|
*/
|
|
51
53
|
readonly hints: ToolHints;
|
|
52
54
|
}
|
|
53
|
-
/**
|
|
54
|
-
* Canonical verbosity enum values. Mirrored at runtime as `VERBOSITY_VALUES`
|
|
55
|
-
* so consumers can `import { VERBOSITY_VALUES, Verbosity } from
|
|
56
|
-
* '@octocodeai/octocode-core'` instead of re-declaring locally.
|
|
57
|
-
*
|
|
58
|
-
* basic — full content + full hints/metadata (default).
|
|
59
|
-
* compact — full content + trimmed hints/metadata.
|
|
60
|
-
* concise — counts/top refs only, snippets dropped.
|
|
61
|
-
*/
|
|
62
|
-
export declare enum Verbosity {
|
|
63
|
-
Basic = "basic",
|
|
64
|
-
Compact = "compact",
|
|
65
|
-
Concise = "concise"
|
|
66
|
-
}
|
|
67
|
-
export declare const VERBOSITY_VALUES: readonly [Verbosity.Basic, Verbosity.Compact, Verbosity.Concise];
|
|
68
|
-
export interface VerbosityEnum {
|
|
69
|
-
readonly enum: readonly [
|
|
70
|
-
Verbosity.Basic,
|
|
71
|
-
Verbosity.Compact,
|
|
72
|
-
Verbosity.Concise
|
|
73
|
-
];
|
|
74
|
-
readonly default: Verbosity.Basic;
|
|
75
|
-
readonly description: string;
|
|
76
|
-
}
|
|
77
55
|
export interface BaseSchema {
|
|
56
|
+
readonly id: string;
|
|
78
57
|
readonly mainResearchGoal: string;
|
|
79
58
|
readonly researchGoal: string;
|
|
80
59
|
readonly reasoning: string;
|
|
81
|
-
|
|
60
|
+
/** Description string for the boolean verbose field shown in tool schemas. */
|
|
61
|
+
readonly verbose?: string;
|
|
82
62
|
}
|
|
83
63
|
export interface OctocodeConfig {
|
|
84
64
|
readonly instructions: string;
|
|
85
65
|
readonly toolNames: ToolNames;
|
|
86
66
|
readonly baseSchema: BaseSchema;
|
|
87
|
-
readonly tools: Record<ToolNames[keyof ToolNames], ToolSpec>;
|
|
67
|
+
readonly tools: Record<ToolNames[keyof ToolNames], ToolSpec | ToolMetadata>;
|
|
88
68
|
readonly baseHints?: Readonly<Record<string, readonly string[]>>;
|
|
89
69
|
readonly genericErrorHints?: readonly string[];
|
|
90
70
|
}
|
|
@@ -143,7 +123,7 @@ export declare const LSP_MODES: readonly [LspMode.Semantic, LspMode.Fallback];
|
|
|
143
123
|
* agent-facing wire contract stable across consumers.
|
|
144
124
|
*/
|
|
145
125
|
export interface ToolWarning {
|
|
146
|
-
readonly kind: "match-value-truncated" | "content-truncated"
|
|
126
|
+
readonly kind: "match-value-truncated" | "content-truncated";
|
|
147
127
|
readonly truncatedAt?: number;
|
|
148
128
|
readonly field?: string;
|
|
149
129
|
readonly path?: string;
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export var
|
|
1
|
+
export var ToolStatus;!function(o){o.Empty="empty",o.Error="error"}(ToolStatus||(ToolStatus={}));export const STATUS_VALUES=[ToolStatus.Empty,ToolStatus.Error];export var LspMode;!function(o){o.Semantic="semantic",o.Fallback="fallback"}(LspMode||(LspMode={}));export const LSP_MODES=[LspMode.Semantic,LspMode.Fallback];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octocodeai/octocode-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Core config, prompts, tools, and schemas for Octocode MCP",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"scripts": {
|
|
45
45
|
"generate": "tsx src/octocode-scripts/generateDefaultJson.ts",
|
|
46
46
|
"compress": "yarn generate && node scripts/compress-config.mjs",
|
|
47
|
-
"build": "yarn generate && node scripts/compress-config.mjs && tsc && node scripts/minify-dist.mjs",
|
|
47
|
+
"build": "rm -rf dist && yarn generate && node scripts/compress-config.mjs && tsc && node scripts/minify-dist.mjs",
|
|
48
48
|
"lint": "eslint src/**/*.ts",
|
|
49
49
|
"lint:fix": "eslint src/**/*.ts --fix",
|
|
50
50
|
"typecheck": "yarn compress && tsc --noEmit",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"eslint-plugin-prettier": "^5.4.1",
|
|
76
76
|
"prettier": "^3.5.3",
|
|
77
77
|
"terser": "^5.46.1",
|
|
78
|
+
"tiktoken": "^1.0.22",
|
|
78
79
|
"tsx": "^4.19.2",
|
|
79
80
|
"typescript": "^5.8.3",
|
|
80
81
|
"vitest": "^3.2.4",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool description constants — the verbatim `description` text each
|
|
3
|
-
* `ToolSpec` exposes in `src/resources/tools/*.ts`. The resources tree
|
|
4
|
-
* is excluded from the build (`src/resources/**` in tsconfig), so the
|
|
5
|
-
* canonical strings live here and the resource files import these
|
|
6
|
-
* constants when generating the compressed config blob.
|
|
7
|
-
*
|
|
8
|
-
* Keep these in sync with `src/resources/tools/*.ts`.
|
|
9
|
-
*/
|
|
10
|
-
export declare const LOCAL_RIPGREP_DESCRIPTION = "## Search code patterns [LOCAL: ripgrep]\n <when>\n - Find local code by text, regex, symbol, import, or constant\n - Get file paths and lineHint values for LSP tools\n - Discover matching files fast with filesOnly=true\n </when>\n <fromTool>\n - localViewStructure: after identifying candidate directories\n - localFindFiles: after narrowing by filename/metadata\n </fromTool>\n <toTool>\n - lspGotoDefinition: jump to a definition using returned lineHint\n - lspFindReferences: semantic usages of the matched symbol\n - lspCallHierarchy: trace callers/callees of matched functions/methods\n - localGetFileContent: read matches when LSP isn't needed\n </toTool>";
|
|
11
|
-
export declare const LOCAL_FIND_FILES_DESCRIPTION = "## Find files by metadata [LOCAL: filesystem]\n <when>\n - Find files/dirs by name, path, time, size, type, or permissions\n - Narrow scope before content search\n - Locate recently changed files with modifiedWithin\n </when>";
|
|
12
|
-
export declare const LOCAL_VIEW_STRUCTURE_DESCRIPTION = "## View directory structure [LOCAL: filesystem]\n <when>\n - Understand local directory layout\n - Discover candidate source/test/config/docs paths\n - Inspect siblings around a known path\n </when>";
|
|
13
|
-
export declare const LOCAL_FETCH_CONTENT_DESCRIPTION = "## Read file content [LOCAL: filesystem]\n <when>\n - Read a known local path after discovery or LSP navigation\n - Extract a section via matchString or line range\n - Read small config/docs/manifest/JSON/Markdown/YAML directly\n </when>";
|
|
14
|
-
export declare const GITHUB_CLONE_REPO_DESCRIPTION = "## Clone GitHub repository to local filesystem\n <when>\n - Need full local access to a repository (large-scale analysis, offline work)\n - Want to run LSP tools against an external GitHub repository\n - Repository is too large to explore efficiently via GitHub API\n </when>";
|
|
15
|
-
export declare const LSP_GOTO_DEFINITION_DESCRIPTION = "## Navigate to symbol definition [LOCAL: LSP]\n <when>\n - Jump from a usage to its definition/declaration\n - Resolve imports, exports, classes, methods, variables, or types\n - Confirm canonical implementation before reading source\n </when>";
|
|
16
|
-
export declare const LSP_FIND_REFERENCES_DESCRIPTION = "## Find all usages of a symbol [LOCAL: LSP]\n <when>\n - Find semantic refs to a function, class, variable, type, property, or interface\n - Assess impact before changing a symbol\n - Separate real refs from same-text matches\n </when>";
|
|
17
|
-
export declare const LSP_CALL_HIERARCHY_DESCRIPTION = "## Trace function call relationships [LOCAL: LSP]\n <when>\n - \"Who calls this function/method?\" \u2192 direction=\"incoming\"\n - \"What does this function/method call?\" \u2192 direction=\"outgoing\"\n - Trace execution flow or impact\n </when>";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const LOCAL_RIPGREP_DESCRIPTION="## Search code patterns [LOCAL: ripgrep]\n <when>\n - Find local code by text, regex, symbol, import, or constant\n - Get file paths and lineHint values for LSP tools\n - Discover matching files fast with filesOnly=true\n </when>\n <fromTool>\n - localViewStructure: after identifying candidate directories\n - localFindFiles: after narrowing by filename/metadata\n </fromTool>\n <toTool>\n - lspGotoDefinition: jump to a definition using returned lineHint\n - lspFindReferences: semantic usages of the matched symbol\n - lspCallHierarchy: trace callers/callees of matched functions/methods\n - localGetFileContent: read matches when LSP isn't needed\n </toTool>";export const LOCAL_FIND_FILES_DESCRIPTION="## Find files by metadata [LOCAL: filesystem]\n <when>\n - Find files/dirs by name, path, time, size, type, or permissions\n - Narrow scope before content search\n - Locate recently changed files with modifiedWithin\n </when>";export const LOCAL_VIEW_STRUCTURE_DESCRIPTION="## View directory structure [LOCAL: filesystem]\n <when>\n - Understand local directory layout\n - Discover candidate source/test/config/docs paths\n - Inspect siblings around a known path\n </when>";export const LOCAL_FETCH_CONTENT_DESCRIPTION="## Read file content [LOCAL: filesystem]\n <when>\n - Read a known local path after discovery or LSP navigation\n - Extract a section via matchString or line range\n - Read small config/docs/manifest/JSON/Markdown/YAML directly\n </when>";export const GITHUB_CLONE_REPO_DESCRIPTION="## Clone GitHub repository to local filesystem\n <when>\n - Need full local access to a repository (large-scale analysis, offline work)\n - Want to run LSP tools against an external GitHub repository\n - Repository is too large to explore efficiently via GitHub API\n </when>";export const LSP_GOTO_DEFINITION_DESCRIPTION="## Navigate to symbol definition [LOCAL: LSP]\n <when>\n - Jump from a usage to its definition/declaration\n - Resolve imports, exports, classes, methods, variables, or types\n - Confirm canonical implementation before reading source\n </when>";export const LSP_FIND_REFERENCES_DESCRIPTION="## Find all usages of a symbol [LOCAL: LSP]\n <when>\n - Find semantic refs to a function, class, variable, type, property, or interface\n - Assess impact before changing a symbol\n - Separate real refs from same-text matches\n </when>";export const LSP_CALL_HIERARCHY_DESCRIPTION='## Trace function call relationships [LOCAL: LSP]\n <when>\n - "Who calls this function/method?" → direction="incoming"\n - "What does this function/method call?" → direction="outgoing"\n - Trace execution flow or impact\n </when>';
|