@octocodeai/octocode-tools-core 16.6.2 → 16.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -9
- package/dist/direct.js +37 -34
- package/dist/github/pullRequestSearch.d.ts +1 -0
- package/dist/index.d.ts +6 -4
- package/dist/index.js +39 -43
- package/dist/oql/adapters/graphProof.d.ts +6 -0
- package/dist/oql/adapters/graphView.d.ts +28 -0
- package/dist/oql/adapters/resultMap.d.ts +7 -0
- package/dist/oql/adapters/runner.d.ts +7 -0
- package/dist/oql/index.js +37 -34
- package/dist/oql/schema.d.ts +24 -8
- package/dist/oql/schemeText.d.ts +12 -11
- package/dist/oql/transformers/github/common.d.ts +7 -1
- package/dist/oql/types.d.ts +12 -2
- package/dist/responses.d.ts +4 -35
- package/dist/schema.js +2 -2
- package/dist/scheme/pagination.d.ts +51 -0
- package/dist/scheme/responseEnvelope.d.ts +67 -1
- package/dist/shared/config/index.d.ts +1 -8
- package/dist/shared/config/index.js +1 -2
- package/dist/shared/credentials/index.d.ts +1 -1
- package/dist/shared/credentials/index.js +2 -1
- package/dist/shared/credentials/storage.d.ts +0 -2
- package/dist/shared/credentials/testing.js +1 -1
- package/dist/shared/paths.d.ts +4 -0
- package/dist/shared/paths.js +1 -1
- package/dist/shared/session/index.js +1 -1
- package/dist/tools/directToolCatalog.exec.d.ts +5 -0
- package/dist/tools/github_clone_repo/scheme.d.ts +0 -1
- package/dist/tools/github_fetch_content/scheme.d.ts +6 -7
- package/dist/tools/github_search_code/scheme.d.ts +4 -6
- package/dist/tools/github_search_pull_requests/scheme.d.ts +0 -1
- package/dist/tools/github_search_repos/execution.d.ts +58 -0
- package/dist/tools/github_search_repos/scheme.d.ts +3 -6
- package/dist/tools/github_view_repo_structure/scheme.d.ts +0 -1
- package/dist/tools/local_binary_inspect/scheme.d.ts +97 -0
- package/dist/tools/local_fetch_content/scheme.d.ts +66 -0
- package/dist/tools/local_find_files/scheme.d.ts +49 -0
- package/dist/tools/local_ripgrep/scheme.d.ts +75 -0
- package/dist/tools/local_view_structure/scheme.d.ts +52 -0
- package/dist/tools/lsp/semantic_content/scheme.d.ts +8 -8
- package/dist/tools/lsp/shared/readiness.d.ts +17 -0
- package/dist/tools/package_search/scheme.d.ts +2 -4
- package/dist/tools/toolNames.d.ts +1 -0
- package/dist/utils/response/bulk.d.ts +1 -0
- package/dist/utils/response/groupedFinalizer.d.ts +7 -2
- package/package.json +4 -3
- package/dist/oql/adapters/v2.d.ts +0 -32
- package/dist/oql/v2params.d.ts +0 -22
- package/dist/shared/config/defaults.d.ts +0 -14
- package/dist/shared/config/loader.d.ts +0 -7
- package/dist/shared/config/resolver.d.ts +0 -2
- package/dist/shared/config/resolverCache.d.ts +0 -12
- package/dist/shared/config/resolverSections.d.ts +0 -10
- package/dist/shared/config/runtimeSurface.d.ts +0 -22
- package/dist/shared/config/types.d.ts +0 -92
- package/dist/shared/config/validator.d.ts +0 -2
- package/dist/shared/credentials/envTokens.d.ts +0 -9
|
@@ -78,3 +78,78 @@ export declare const LocalRipgrepBulkQuerySchema: z.ZodObject<{
|
|
|
78
78
|
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
79
79
|
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
80
80
|
}, z.core.$strip>;
|
|
81
|
+
export declare const LocalSearchCodeOutputSchema: z.ZodObject<{
|
|
82
|
+
results: z.ZodArray<z.ZodObject<{
|
|
83
|
+
id: z.ZodString;
|
|
84
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
85
|
+
empty: "empty";
|
|
86
|
+
error: "error";
|
|
87
|
+
}>>;
|
|
88
|
+
data: z.ZodObject<{
|
|
89
|
+
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
90
|
+
path: z.ZodString;
|
|
91
|
+
matches: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
92
|
+
line: z.ZodNumber;
|
|
93
|
+
endLine: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
value: z.ZodOptional<z.ZodString>;
|
|
95
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
metavars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
98
|
+
}, z.core.$strip>>>;
|
|
99
|
+
totalOccurrences: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
totalMatchedLines: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
totalMatchRows: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
returnedMatchRows: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
matchPagination: z.ZodOptional<z.ZodObject<{
|
|
104
|
+
currentPage: z.ZodNumber;
|
|
105
|
+
totalPages: z.ZodNumber;
|
|
106
|
+
hasMore: z.ZodBoolean;
|
|
107
|
+
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
108
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
}, z.core.$strip>>;
|
|
111
|
+
next: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
112
|
+
tool: z.ZodString;
|
|
113
|
+
query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
114
|
+
why: z.ZodOptional<z.ZodString>;
|
|
115
|
+
confidence: z.ZodOptional<z.ZodEnum<{
|
|
116
|
+
exact: "exact";
|
|
117
|
+
heuristic: "heuristic";
|
|
118
|
+
}>>;
|
|
119
|
+
}, z.core.$strip>>>;
|
|
120
|
+
}, z.core.$strip>>>;
|
|
121
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
122
|
+
searchEngine: z.ZodOptional<z.ZodString>;
|
|
123
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
124
|
+
currentPage: z.ZodNumber;
|
|
125
|
+
totalPages: z.ZodNumber;
|
|
126
|
+
hasMore: z.ZodBoolean;
|
|
127
|
+
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
}, z.core.$strip>>;
|
|
131
|
+
next: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
132
|
+
tool: z.ZodString;
|
|
133
|
+
query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
134
|
+
why: z.ZodOptional<z.ZodString>;
|
|
135
|
+
confidence: z.ZodOptional<z.ZodEnum<{
|
|
136
|
+
exact: "exact";
|
|
137
|
+
heuristic: "heuristic";
|
|
138
|
+
}>>;
|
|
139
|
+
}, z.core.$strip>>>;
|
|
140
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
}, z.core.$strip>>;
|
|
143
|
+
base: z.ZodOptional<z.ZodString>;
|
|
144
|
+
shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
145
|
+
responsePagination: z.ZodOptional<z.ZodObject<{
|
|
146
|
+
currentPage: z.ZodNumber;
|
|
147
|
+
totalPages: z.ZodNumber;
|
|
148
|
+
hasMore: z.ZodBoolean;
|
|
149
|
+
charOffset: z.ZodNumber;
|
|
150
|
+
charLength: z.ZodNumber;
|
|
151
|
+
totalChars: z.ZodNumber;
|
|
152
|
+
nextCharOffset: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
}, z.core.$strip>>;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
export type LocalSearchCodeOutput = z.infer<typeof LocalSearchCodeOutputSchema>;
|
|
@@ -31,3 +31,55 @@ export declare const LocalViewStructureBulkQuerySchema: z.ZodObject<{
|
|
|
31
31
|
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
32
32
|
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
33
33
|
}, z.core.$strip>;
|
|
34
|
+
export declare const LocalViewStructureOutputSchema: z.ZodObject<{
|
|
35
|
+
results: z.ZodArray<z.ZodObject<{
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
38
|
+
empty: "empty";
|
|
39
|
+
error: "error";
|
|
40
|
+
}>>;
|
|
41
|
+
data: z.ZodObject<{
|
|
42
|
+
path: z.ZodOptional<z.ZodString>;
|
|
43
|
+
entries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
44
|
+
name: z.ZodOptional<z.ZodString>;
|
|
45
|
+
type: z.ZodEnum<{
|
|
46
|
+
file: "file";
|
|
47
|
+
link: "link";
|
|
48
|
+
directory: "directory";
|
|
49
|
+
dir: "dir";
|
|
50
|
+
symlink: "symlink";
|
|
51
|
+
}>;
|
|
52
|
+
path: z.ZodOptional<z.ZodString>;
|
|
53
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
size: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
55
|
+
modified: z.ZodOptional<z.ZodString>;
|
|
56
|
+
permissions: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strip>>>;
|
|
58
|
+
files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
+
folders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
60
|
+
links: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
61
|
+
summary: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
62
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
63
|
+
currentPage: z.ZodNumber;
|
|
64
|
+
totalPages: z.ZodNumber;
|
|
65
|
+
hasMore: z.ZodBoolean;
|
|
66
|
+
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
}, z.core.$strip>>;
|
|
70
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
base: z.ZodOptional<z.ZodString>;
|
|
74
|
+
shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
75
|
+
responsePagination: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
currentPage: z.ZodNumber;
|
|
77
|
+
totalPages: z.ZodNumber;
|
|
78
|
+
hasMore: z.ZodBoolean;
|
|
79
|
+
charOffset: z.ZodNumber;
|
|
80
|
+
charLength: z.ZodNumber;
|
|
81
|
+
totalChars: z.ZodNumber;
|
|
82
|
+
nextCharOffset: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
}, z.core.$strip>>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
export type LocalViewStructureOutput = z.infer<typeof LocalViewStructureOutputSchema>;
|
|
@@ -95,11 +95,11 @@ export declare const LspGetSemanticsOutputSchema: z.ZodObject<{
|
|
|
95
95
|
foundAtLine: z.ZodNumber;
|
|
96
96
|
orderHint: z.ZodOptional<z.ZodNumber>;
|
|
97
97
|
}, z.core.$strip>>;
|
|
98
|
-
lsp: z.ZodObject<{
|
|
98
|
+
lsp: z.ZodOptional<z.ZodObject<{
|
|
99
99
|
serverAvailable: z.ZodOptional<z.ZodBoolean>;
|
|
100
100
|
provider: z.ZodOptional<z.ZodString>;
|
|
101
101
|
source: z.ZodOptional<z.ZodString>;
|
|
102
|
-
}, z.core.$strip
|
|
102
|
+
}, z.core.$strip>>;
|
|
103
103
|
payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
104
104
|
kind: z.ZodLiteral<"definition">;
|
|
105
105
|
locations: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -356,10 +356,10 @@ export declare const LspGetSemanticsOutputSchema: z.ZodObject<{
|
|
|
356
356
|
pagination: z.ZodOptional<z.ZodObject<{
|
|
357
357
|
currentPage: z.ZodNumber;
|
|
358
358
|
totalPages: z.ZodNumber;
|
|
359
|
-
totalResults: z.ZodNumber;
|
|
360
359
|
hasMore: z.ZodBoolean;
|
|
361
|
-
itemsPerPage: z.ZodNumber;
|
|
362
360
|
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
361
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
362
|
+
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
363
363
|
}, z.core.$strip>>;
|
|
364
364
|
summary: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
365
365
|
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -386,11 +386,11 @@ export declare const LspGetSemanticsOutputSchema: z.ZodObject<{
|
|
|
386
386
|
foundAtLine: z.ZodNumber;
|
|
387
387
|
orderHint: z.ZodOptional<z.ZodNumber>;
|
|
388
388
|
}, z.core.$strip>>;
|
|
389
|
-
lsp: z.ZodObject<{
|
|
389
|
+
lsp: z.ZodOptional<z.ZodObject<{
|
|
390
390
|
serverAvailable: z.ZodOptional<z.ZodBoolean>;
|
|
391
391
|
provider: z.ZodOptional<z.ZodString>;
|
|
392
392
|
source: z.ZodOptional<z.ZodString>;
|
|
393
|
-
}, z.core.$strip
|
|
393
|
+
}, z.core.$strip>>;
|
|
394
394
|
payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
395
395
|
kind: z.ZodLiteral<"definition">;
|
|
396
396
|
locations: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -647,10 +647,10 @@ export declare const LspGetSemanticsOutputSchema: z.ZodObject<{
|
|
|
647
647
|
pagination: z.ZodOptional<z.ZodObject<{
|
|
648
648
|
currentPage: z.ZodNumber;
|
|
649
649
|
totalPages: z.ZodNumber;
|
|
650
|
-
totalResults: z.ZodNumber;
|
|
651
650
|
hasMore: z.ZodBoolean;
|
|
652
|
-
itemsPerPage: z.ZodNumber;
|
|
653
651
|
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
652
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
653
|
+
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
654
654
|
}, z.core.$strip>>;
|
|
655
655
|
summary: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
656
656
|
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { LspReadiness } from '@octocodeai/octocode-engine/lsp/types';
|
|
2
|
+
import type { LspSemanticEnvelope, SemanticEmptyCategory } from './semanticTypes.js';
|
|
3
|
+
/**
|
|
4
|
+
* The "server returned nothing" category of an envelope, whether the emptiness
|
|
5
|
+
* is expressed as an `empty`-kind payload (definition/hover) or a nested
|
|
6
|
+
* `empty` on an otherwise-shaped payload (references/callers). Returns
|
|
7
|
+
* `undefined` when the envelope carries real results.
|
|
8
|
+
*/
|
|
9
|
+
export declare function zeroResultEmptyCategory(envelope: LspSemanticEnvelope): SemanticEmptyCategory | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Attach a caveat when a semantic query came back empty AND the language server
|
|
12
|
+
* never confirmed it finished indexing (readiness other than `progressIdle`).
|
|
13
|
+
* Without this, an agent reads a zero as "symbol is unused" when it may just be
|
|
14
|
+
* "server not indexed yet". `readiness === undefined` means the wait was
|
|
15
|
+
* skipped (servers that answer immediately) — those are trusted, no caveat.
|
|
16
|
+
*/
|
|
17
|
+
export declare function attachReadinessWarning(envelope: LspSemanticEnvelope, readiness: LspReadiness | undefined): LspSemanticEnvelope;
|
|
@@ -37,16 +37,14 @@ export declare const NpmSearchOutputLocalSchema: z.ZodObject<{
|
|
|
37
37
|
pagination: z.ZodOptional<z.ZodObject<{
|
|
38
38
|
currentPage: z.ZodNumber;
|
|
39
39
|
totalPages: z.ZodNumber;
|
|
40
|
-
perPage: z.ZodNumber;
|
|
41
|
-
totalFound: z.ZodNumber;
|
|
42
|
-
returned: z.ZodNumber;
|
|
43
40
|
hasMore: z.ZodBoolean;
|
|
44
41
|
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
45
44
|
}, z.core.$strip>>;
|
|
46
45
|
}, z.core.$loose>>;
|
|
47
46
|
status: z.ZodOptional<z.ZodString>;
|
|
48
47
|
}, z.core.$loose>>>;
|
|
49
|
-
hints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
50
48
|
base: z.ZodOptional<z.ZodString>;
|
|
51
49
|
shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
52
50
|
responsePagination: z.ZodOptional<z.ZodObject<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const STATIC_TOOL_NAMES: import("@octocodeai/octocode-core/types").ToolNames;
|
|
2
2
|
export declare const LSP_GET_SEMANTICS_TOOL_NAME: "lspGetSemantics";
|
|
3
3
|
export declare const OQL_SEARCH_TOOL_NAME = "oqlSearch";
|
|
4
|
+
export declare function isOqlEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
4
5
|
export declare function isLocalTool(toolName: string): boolean;
|
|
@@ -3,3 +3,4 @@ import type { ProcessedBulkResult } from '../../types/toolResults.js';
|
|
|
3
3
|
import type { BulkResponseConfig, BulkResponsePagination } from '../../types/bulk.js';
|
|
4
4
|
export declare function computeQueryTimeout(queryCount: number, concurrency: number, minTimeoutMs?: number): number;
|
|
5
5
|
export declare function executeBulkOperation<TQuery extends object, TOutput extends Record<string, unknown> = Record<string, unknown>>(queries: Array<TQuery>, processor: (query: TQuery, index: number) => Promise<ProcessedBulkResult>, config: BulkResponseConfig<TQuery, TOutput>, pagination?: BulkResponsePagination): Promise<CallToolResult>;
|
|
6
|
+
export declare function resolveQueryId<TQuery extends object>(originalQuery: TQuery, queryIndex: number): string;
|
|
@@ -5,8 +5,13 @@ export type QueryWithPagination = {
|
|
|
5
5
|
charLength?: unknown;
|
|
6
6
|
charOffset?: unknown;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type FlatErrorEntry = {
|
|
9
9
|
id: string;
|
|
10
10
|
error: string;
|
|
11
|
-
|
|
11
|
+
status?: number;
|
|
12
|
+
retryAfterSeconds?: number;
|
|
13
|
+
rateLimitRemaining?: number;
|
|
14
|
+
rateLimitReset?: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function collectFlatErrors(results: readonly FlatQueryResult[]): FlatErrorEntry[];
|
|
12
17
|
export declare function formatFinalizedResponse<T extends Record<string, unknown>>(responseData: T, keysPriority: readonly string[], isError?: boolean): BulkFinalizerOutput<T>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octocodeai/octocode-tools-core",
|
|
3
|
-
"version": "16.6.
|
|
3
|
+
"version": "16.6.3",
|
|
4
4
|
"description": "Core tool implementations for Octocode: GitHub, local filesystem, LSP, and package search tools.",
|
|
5
5
|
"author": "Guy Bary <bgauryy@octocodeai.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
86
|
-
"@octocodeai/octocode-core": "^16.6.
|
|
87
|
-
"@octocodeai/octocode-engine": "^16.
|
|
86
|
+
"@octocodeai/octocode-core": "^16.6.3",
|
|
87
|
+
"@octocodeai/octocode-engine": "^16.7.0",
|
|
88
88
|
"@octokit/oauth-methods": "^6.0.2",
|
|
89
89
|
"@octokit/plugin-throttling": "^11.0.3",
|
|
90
90
|
"@octokit/request": "^10.0.10",
|
|
@@ -93,6 +93,7 @@
|
|
|
93
93
|
"zod": "^4.4.3"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
|
+
"@octocodeai/config": "workspace:*",
|
|
96
97
|
"@octokit/core": "^7.0.6",
|
|
97
98
|
"@octokit/openapi-types": "^27.0.0",
|
|
98
99
|
"@octokit/plugin-rest-endpoint-methods": "^17.0.0",
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { AdapterResult } from './local.js';
|
|
2
|
-
import type { OqlQuery } from '../types.js';
|
|
3
|
-
export declare function executeRepositories(query: OqlQuery): Promise<AdapterResult>;
|
|
4
|
-
export declare function executePackages(query: OqlQuery): Promise<AdapterResult>;
|
|
5
|
-
export declare function executeHistory(query: OqlQuery): Promise<AdapterResult>;
|
|
6
|
-
/**
|
|
7
|
-
* `target:"diff"` has two typed lanes, discriminated by params shape:
|
|
8
|
-
* - PR patch: { prNumber, files? } -> ghHistoryResearch patches
|
|
9
|
-
* - direct file: { baseRef, headRef, path } -> two ghGetFileContent reads
|
|
10
|
-
* + a pure local line diff
|
|
11
|
-
* A request that fits neither returns a repair diagnostic rather than silently
|
|
12
|
-
* falling through to a PR-patch call (see OCTOCODE_SEARCH_PARITY_CHECKLIST.md gap log #8).
|
|
13
|
-
*/
|
|
14
|
-
export declare function executeDiff(query: OqlQuery): Promise<AdapterResult>;
|
|
15
|
-
export interface LineDiff {
|
|
16
|
-
additions: number;
|
|
17
|
-
deletions: number;
|
|
18
|
-
unchanged: number;
|
|
19
|
-
/** Unified-style patch text (`+`/`-`/` ` line prefixes). */
|
|
20
|
-
patch: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Minimal LCS-based line diff between two file bodies. Pure and dependency-free
|
|
24
|
-
* so it is unit-testable without any backend. Not a byte-perfect git patch —
|
|
25
|
-
* a line-granular additions/deletions view for direct two-ref comparison.
|
|
26
|
-
*/
|
|
27
|
-
export declare function computeLineDiff(baseText: string, headText: string): LineDiff;
|
|
28
|
-
export declare function executeArtifacts(query: OqlQuery): Promise<AdapterResult>;
|
|
29
|
-
export declare function executeSemantics(query: OqlQuery): Promise<AdapterResult>;
|
|
30
|
-
export declare function executeResearch(query: OqlQuery): Promise<AdapterResult>;
|
|
31
|
-
/** Dispatch map: V2 target -> adapter. */
|
|
32
|
-
export declare const V2_ADAPTERS: Record<string, (q: OqlQuery) => Promise<AdapterResult>>;
|
package/dist/oql/v2params.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Typed V2-target `params` schemas.
|
|
3
|
-
*
|
|
4
|
-
* V2 research targets (semantics/repositories/packages/pullRequests/commits/
|
|
5
|
-
* artifacts/diff/research) carry a `params` bag that the backing tool validates
|
|
6
|
-
* exhaustively. These schemas type the *documented, commonly-used* fields so a
|
|
7
|
-
* type mistake (e.g. `prNumber:"abc"`) is caught at the OQL layer with a clear
|
|
8
|
-
* `invalidQuery` instead of failing opaquely at the tool — while `.passthrough()`
|
|
9
|
-
* keeps the backing tool the exhaustive source of truth for the rest.
|
|
10
|
-
*
|
|
11
|
-
* This is the typed-contract layer for OCTOCODE_SEARCH_PARITY_CHECKLIST gap #3.
|
|
12
|
-
*/
|
|
13
|
-
import { z } from 'zod';
|
|
14
|
-
import type { OqlActiveTarget } from './types.js';
|
|
15
|
-
/** Per-target params schema; targets without a `params` bag are absent. */
|
|
16
|
-
export declare const V2_PARAM_SCHEMAS: Partial<Record<OqlActiveTarget, z.ZodTypeAny>>;
|
|
17
|
-
/**
|
|
18
|
-
* Validate a target's `params` bag against its typed schema. Returns `null` when
|
|
19
|
-
* valid (or no schema applies), or a Zod-style error message string the caller
|
|
20
|
-
* raises as `invalidQuery`.
|
|
21
|
-
*/
|
|
22
|
-
export declare function validateV2Params(target: OqlActiveTarget, params: unknown): string | null;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { RequiredGitHubConfig, RequiredLocalConfig, RequiredToolsConfig, RequiredNetworkConfig, RequiredLspConfig, RequiredOutputConfig, ResolvedConfig } from './types.js';
|
|
2
|
-
export declare const DEFAULT_GITHUB_CONFIG: RequiredGitHubConfig;
|
|
3
|
-
export declare const DEFAULT_LOCAL_CONFIG: RequiredLocalConfig;
|
|
4
|
-
export declare const DEFAULT_TOOLS_CONFIG: RequiredToolsConfig;
|
|
5
|
-
export declare const DEFAULT_NETWORK_CONFIG: RequiredNetworkConfig;
|
|
6
|
-
export declare const DEFAULT_LSP_CONFIG: RequiredLspConfig;
|
|
7
|
-
export declare const DEFAULT_OUTPUT_CONFIG: RequiredOutputConfig;
|
|
8
|
-
export declare const DEFAULT_CONFIG: Omit<ResolvedConfig, 'source' | 'configPath'>;
|
|
9
|
-
export declare const MIN_TIMEOUT = 5000;
|
|
10
|
-
export declare const MAX_TIMEOUT = 300000;
|
|
11
|
-
export declare const MIN_RETRIES = 0;
|
|
12
|
-
export declare const MAX_RETRIES = 10;
|
|
13
|
-
export declare const MIN_OUTPUT_DEFAULT_CHAR_LENGTH = 1000;
|
|
14
|
-
export declare const MAX_OUTPUT_DEFAULT_CHAR_LENGTH = 50000;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { LoadConfigResult } from './types.js';
|
|
2
|
-
export declare const CONFIG_FILE_PATH: string;
|
|
3
|
-
export declare function configExists(): boolean;
|
|
4
|
-
export declare function loadConfig(): Promise<LoadConfigResult>;
|
|
5
|
-
export declare function loadConfigSync(): LoadConfigResult;
|
|
6
|
-
export declare function getConfigPath(): string;
|
|
7
|
-
export declare function getOctocodeDir(): string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ResolvedConfig } from './types.js';
|
|
2
|
-
export declare function resolveConfigSync(): ResolvedConfig;
|
|
3
|
-
export declare function resolveConfig(): Promise<ResolvedConfig>;
|
|
4
|
-
export declare function getConfigSync(): ResolvedConfig;
|
|
5
|
-
export declare function getConfig(): Promise<ResolvedConfig>;
|
|
6
|
-
export declare function reloadConfig(): Promise<ResolvedConfig>;
|
|
7
|
-
export declare function invalidateConfigCache(): void;
|
|
8
|
-
export declare function _resetConfigCache(): void;
|
|
9
|
-
export declare function _getCacheState(): {
|
|
10
|
-
cached: boolean;
|
|
11
|
-
timestamp: number;
|
|
12
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { OctocodeConfig, RequiredGitHubConfig, RequiredLocalConfig, RequiredToolsConfig, RequiredNetworkConfig, RequiredLspConfig, RequiredOutputConfig } from './types.js';
|
|
2
|
-
export declare function parseBooleanEnv(value: string | undefined): boolean | undefined;
|
|
3
|
-
export declare function parseIntEnv(value: string | undefined): number | undefined;
|
|
4
|
-
export declare function parseStringArrayEnv(value: string | undefined): string[] | undefined;
|
|
5
|
-
export declare function resolveGitHub(fileConfig?: OctocodeConfig['github']): RequiredGitHubConfig;
|
|
6
|
-
export declare function resolveLocal(fileConfig?: OctocodeConfig['local']): RequiredLocalConfig;
|
|
7
|
-
export declare function resolveTools(fileConfig?: OctocodeConfig['tools']): RequiredToolsConfig;
|
|
8
|
-
export declare function resolveNetwork(fileConfig?: OctocodeConfig['network']): RequiredNetworkConfig;
|
|
9
|
-
export declare function resolveLsp(fileConfig?: OctocodeConfig['lsp']): RequiredLspConfig;
|
|
10
|
-
export declare function resolveOutput(fileConfig?: OctocodeConfig['output']): RequiredOutputConfig;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Which interface is driving the shared tool core right now.
|
|
3
|
-
*
|
|
4
|
-
* Some config defaults differ by surface (see `resolveLocal`):
|
|
5
|
-
* - `cli`: local tools default to ENABLED; clone defaults to ENABLED.
|
|
6
|
-
* - `mcp`: local tools default to ENABLED; clone defaults to DISABLED.
|
|
7
|
-
*
|
|
8
|
-
* `ENABLE_LOCAL=false` or `local.enabled=false` explicitly disables local tools
|
|
9
|
-
* on every surface.
|
|
10
|
-
*
|
|
11
|
-
* Defaults to `mcp`, the primary consumer. The CLI binary calls
|
|
12
|
-
* `setRuntimeSurface('cli')` at startup before any tool runs.
|
|
13
|
-
*
|
|
14
|
-
* State lives on `globalThis` (not a module-level variable) so a single shared
|
|
15
|
-
* value is seen even when bundlers (esbuild) inline this module more than once
|
|
16
|
-
* across different package subpath entry points (`/config`, `/direct`, …).
|
|
17
|
-
*/
|
|
18
|
-
export type RuntimeSurface = 'cli' | 'mcp';
|
|
19
|
-
export declare function setRuntimeSurface(surface: RuntimeSurface): void;
|
|
20
|
-
export declare function getRuntimeSurface(): RuntimeSurface;
|
|
21
|
-
/** Test helper: restore the default surface. */
|
|
22
|
-
export declare function _resetRuntimeSurface(): void;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
export declare const CONFIG_SCHEMA_VERSION = 1;
|
|
2
|
-
export declare const CONFIG_FILE_NAME = ".octocoderc";
|
|
3
|
-
export interface GitHubConfigOptions {
|
|
4
|
-
apiUrl?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface LocalConfigOptions {
|
|
7
|
-
enabled?: boolean;
|
|
8
|
-
enableClone?: boolean;
|
|
9
|
-
allowedPaths?: string[];
|
|
10
|
-
workspaceRoot?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface ToolsConfigOptions {
|
|
13
|
-
enabled?: string[] | null;
|
|
14
|
-
enableAdditional?: string[] | null;
|
|
15
|
-
disabled?: string[] | null;
|
|
16
|
-
}
|
|
17
|
-
export interface NetworkConfigOptions {
|
|
18
|
-
timeout?: number;
|
|
19
|
-
maxRetries?: number;
|
|
20
|
-
}
|
|
21
|
-
export interface LspConfigOptions {
|
|
22
|
-
configPath?: string;
|
|
23
|
-
}
|
|
24
|
-
export interface OutputPaginationConfigOptions {
|
|
25
|
-
defaultCharLength?: number;
|
|
26
|
-
}
|
|
27
|
-
export type MinifyMode = 'none' | 'standard' | 'symbols';
|
|
28
|
-
export interface OutputConfigOptions {
|
|
29
|
-
format?: 'yaml' | 'json';
|
|
30
|
-
pagination?: OutputPaginationConfigOptions;
|
|
31
|
-
}
|
|
32
|
-
export interface OctocodeConfig {
|
|
33
|
-
$schema?: string;
|
|
34
|
-
version?: number;
|
|
35
|
-
github?: GitHubConfigOptions;
|
|
36
|
-
local?: LocalConfigOptions;
|
|
37
|
-
tools?: ToolsConfigOptions;
|
|
38
|
-
network?: NetworkConfigOptions;
|
|
39
|
-
lsp?: LspConfigOptions;
|
|
40
|
-
output?: OutputConfigOptions;
|
|
41
|
-
}
|
|
42
|
-
export interface RequiredGitHubConfig {
|
|
43
|
-
apiUrl: string;
|
|
44
|
-
}
|
|
45
|
-
export interface RequiredLocalConfig {
|
|
46
|
-
enabled: boolean;
|
|
47
|
-
enableClone: boolean;
|
|
48
|
-
allowedPaths: string[];
|
|
49
|
-
workspaceRoot: string | undefined;
|
|
50
|
-
}
|
|
51
|
-
export interface RequiredToolsConfig {
|
|
52
|
-
enabled: string[] | null;
|
|
53
|
-
enableAdditional: string[] | null;
|
|
54
|
-
disabled: string[] | null;
|
|
55
|
-
}
|
|
56
|
-
export interface RequiredNetworkConfig {
|
|
57
|
-
timeout: number;
|
|
58
|
-
maxRetries: number;
|
|
59
|
-
}
|
|
60
|
-
export interface RequiredLspConfig {
|
|
61
|
-
configPath: string | undefined;
|
|
62
|
-
}
|
|
63
|
-
export interface RequiredOutputPaginationConfig {
|
|
64
|
-
defaultCharLength: number;
|
|
65
|
-
}
|
|
66
|
-
export interface RequiredOutputConfig {
|
|
67
|
-
format: 'yaml' | 'json';
|
|
68
|
-
pagination: RequiredOutputPaginationConfig;
|
|
69
|
-
}
|
|
70
|
-
export interface ResolvedConfig {
|
|
71
|
-
version: number;
|
|
72
|
-
github: RequiredGitHubConfig;
|
|
73
|
-
local: RequiredLocalConfig;
|
|
74
|
-
tools: RequiredToolsConfig;
|
|
75
|
-
network: RequiredNetworkConfig;
|
|
76
|
-
lsp: RequiredLspConfig;
|
|
77
|
-
output: RequiredOutputConfig;
|
|
78
|
-
source: 'file' | 'defaults' | 'mixed';
|
|
79
|
-
configPath?: string;
|
|
80
|
-
}
|
|
81
|
-
export interface ValidationResult {
|
|
82
|
-
valid: boolean;
|
|
83
|
-
errors: string[];
|
|
84
|
-
warnings: string[];
|
|
85
|
-
config?: OctocodeConfig;
|
|
86
|
-
}
|
|
87
|
-
export interface LoadConfigResult {
|
|
88
|
-
success: boolean;
|
|
89
|
-
config?: OctocodeConfig;
|
|
90
|
-
error?: string;
|
|
91
|
-
path: string;
|
|
92
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { TokenSource } from './types.js';
|
|
2
|
-
export declare const ENV_TOKEN_VARS: readonly ["OCTOCODE_TOKEN", "GH_TOKEN", "GITHUB_TOKEN", "GITHUB_PERSONAL_ACCESS_TOKEN"];
|
|
3
|
-
export declare function getTokenFromEnv(): string | null;
|
|
4
|
-
export declare function getEnvTokenSource(): TokenSource;
|
|
5
|
-
export declare function hasEnvToken(): boolean;
|
|
6
|
-
export declare function resolveEnvToken(): {
|
|
7
|
-
token: string;
|
|
8
|
-
source: NonNullable<TokenSource>;
|
|
9
|
-
} | null;
|