@jarkkojs/readseek-api 0.9.16 → 0.10.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/README.md +14 -4
- package/bin/readseek.cjs +8 -2
- package/dist/argv.d.ts +30 -24
- package/dist/client-output.d.ts +425 -0
- package/dist/client.d.ts +30 -256
- package/dist/contract.d.ts +15 -21
- package/dist/edit-plan.d.ts +1 -0
- package/dist/{json.d.ts → error.d.ts} +0 -1
- package/dist/index.d.ts +10 -8
- package/dist/index.js +1054 -767
- package/dist/kdl.d.ts +7 -0
- package/dist/output-kdl.d.ts +1 -0
- package/dist/process-bun.d.ts +1 -1
- package/dist/process-node.d.ts +1 -1
- package/dist/process.d.ts +3 -1
- package/dist/validation.d.ts +0 -7
- package/package.json +10 -5
package/dist/client.d.ts
CHANGED
|
@@ -1,226 +1,11 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
hash: string;
|
|
5
|
-
text: string;
|
|
6
|
-
}
|
|
7
|
-
export interface ReadSeekReadOutput {
|
|
8
|
-
file: string;
|
|
9
|
-
language: string;
|
|
10
|
-
line_count: number;
|
|
11
|
-
file_hash: string;
|
|
12
|
-
start_line: number;
|
|
13
|
-
end_line: number;
|
|
14
|
-
hashlines: ReadSeekHashline[];
|
|
15
|
-
}
|
|
16
|
-
export interface ReadSeekSymbol {
|
|
17
|
-
kind: string;
|
|
18
|
-
name: string;
|
|
19
|
-
qualified_name?: string;
|
|
20
|
-
start_line: number;
|
|
21
|
-
end_line: number;
|
|
22
|
-
start_hash?: string;
|
|
23
|
-
end_hash?: string;
|
|
24
|
-
start_anchor?: string;
|
|
25
|
-
end_anchor?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface ReadSeekMapNode {
|
|
28
|
-
kind: string;
|
|
29
|
-
name: string;
|
|
30
|
-
start_line: number;
|
|
31
|
-
end_line: number;
|
|
32
|
-
start_anchor: string;
|
|
33
|
-
end_anchor: string;
|
|
34
|
-
children: ReadSeekMapNode[];
|
|
35
|
-
}
|
|
36
|
-
export interface ReadSeekMapOutput {
|
|
37
|
-
file: string;
|
|
38
|
-
language: string;
|
|
39
|
-
line_count: number;
|
|
40
|
-
file_hash: string;
|
|
41
|
-
root: ReadSeekMapNode;
|
|
42
|
-
symbols: ReadSeekSymbol[];
|
|
43
|
-
}
|
|
44
|
-
export interface ReadSeekSearchCapture {
|
|
45
|
-
name: string;
|
|
46
|
-
start_line: number;
|
|
47
|
-
end_line: number;
|
|
48
|
-
start_hash: string;
|
|
49
|
-
end_hash: string;
|
|
50
|
-
hashlines: ReadSeekHashline[];
|
|
51
|
-
}
|
|
52
|
-
export interface ReadSeekSearchMatch {
|
|
53
|
-
pattern_index: number;
|
|
54
|
-
start_line: number;
|
|
55
|
-
end_line: number;
|
|
56
|
-
start_hash: string;
|
|
57
|
-
end_hash: string;
|
|
58
|
-
hashlines: ReadSeekHashline[];
|
|
59
|
-
captures: ReadSeekSearchCapture[];
|
|
60
|
-
}
|
|
61
|
-
export interface ReadSeekSearchFileOutput {
|
|
62
|
-
file: string;
|
|
63
|
-
language: string;
|
|
64
|
-
file_hash: string;
|
|
65
|
-
matches: ReadSeekSearchMatch[];
|
|
66
|
-
}
|
|
67
|
-
export interface ReadSeekReference {
|
|
68
|
-
file: string;
|
|
69
|
-
line: number;
|
|
70
|
-
column: number;
|
|
71
|
-
line_hash: string;
|
|
72
|
-
text: string;
|
|
73
|
-
enclosingSymbol?: string;
|
|
74
|
-
}
|
|
75
|
-
export interface ReadSeekDiagnostic {
|
|
76
|
-
kind: "error" | "missing";
|
|
77
|
-
start_line: number;
|
|
78
|
-
end_line: number;
|
|
79
|
-
}
|
|
80
|
-
export interface ReadSeekCheckOutput {
|
|
81
|
-
file_hash?: string;
|
|
82
|
-
errorCount: number;
|
|
83
|
-
missingCount: number;
|
|
84
|
-
diagnostics: ReadSeekDiagnostic[];
|
|
85
|
-
}
|
|
86
|
-
export type ReadSeekOcrText = string;
|
|
87
|
-
export interface ReadSeekDetectedObject {
|
|
88
|
-
label: string;
|
|
89
|
-
bbox: [number, number, number, number];
|
|
90
|
-
}
|
|
1
|
+
import { type DefLocation, type EditOutput, type IdentifyOutput, type ReadSeekCheckOutput, type ReadSeekDetection, type ReadSeekDocumentCache, type ReadSeekImageDetection, type ReadSeekMapOutput, type ReadSeekPreparedImage, type ReadSeekReadOutput, type ReadSeekReference, type ReadSeekSearchOutput, type RenameOutput } from "./client-output.ts";
|
|
2
|
+
import type { GitScope, InspectFacet, VisionAnalysisMode, VisionLevel, VisionMode } from "./contract.ts";
|
|
3
|
+
export type { DefLocation, EditOutput, IdentifierOutput, IdentifyOutput, ReadSeekCheckOutput, ReadSeekDetectedObject, ReadSeekDetection, ReadSeekDiagnostic, ReadSeekDocumentCache, ReadSeekHashline, ReadSeekImageDetection, ReadSeekMapNode, ReadSeekMapOutput, ReadSeekOcrText, ReadSeekPreparedImage, ReadSeekReadOutput, ReadSeekReference, ReadSeekSearchCapture, ReadSeekSearchFileOutput, ReadSeekSearchMatch, ReadSeekSearchOutput, ReadSeekSymbol, RenameConflict, RenameEdit, RenameFileOutput, RenameOutput, } from "./client-output.ts";
|
|
91
4
|
export type ReadSeekImageMode = VisionAnalysisMode;
|
|
92
|
-
export interface
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
export interface ReadSeekDocumentCache {
|
|
98
|
-
content_hash: string;
|
|
99
|
-
state: "built" | "reused";
|
|
100
|
-
}
|
|
101
|
-
export type ReadSeekDetection = {
|
|
102
|
-
kind: "source";
|
|
103
|
-
type: string;
|
|
104
|
-
file: string;
|
|
105
|
-
language: string;
|
|
106
|
-
engine?: string;
|
|
107
|
-
supported: boolean;
|
|
108
|
-
mime?: string;
|
|
109
|
-
syntax?: string;
|
|
110
|
-
} | {
|
|
111
|
-
kind: "image";
|
|
112
|
-
type: string;
|
|
113
|
-
file: string;
|
|
114
|
-
mime?: string;
|
|
115
|
-
format: string;
|
|
116
|
-
width: number;
|
|
117
|
-
height: number;
|
|
118
|
-
animated: boolean;
|
|
119
|
-
encoding?: "base64";
|
|
120
|
-
data?: string;
|
|
121
|
-
ocr?: ReadSeekOcrText;
|
|
122
|
-
caption?: string;
|
|
123
|
-
objects?: ReadSeekDetectedObject[];
|
|
124
|
-
} | {
|
|
125
|
-
kind: "text";
|
|
126
|
-
type: string;
|
|
127
|
-
file: string;
|
|
128
|
-
mime?: string;
|
|
129
|
-
} | {
|
|
130
|
-
kind: "pdf";
|
|
131
|
-
type: "application/pdf";
|
|
132
|
-
file: string;
|
|
133
|
-
mime?: string;
|
|
134
|
-
format: "pdf";
|
|
135
|
-
pages: number;
|
|
136
|
-
};
|
|
137
|
-
export type ReadSeekImageDetection = Extract<ReadSeekDetection, {
|
|
138
|
-
kind: "image";
|
|
139
|
-
}>;
|
|
140
|
-
export interface IdentifierOutput {
|
|
141
|
-
text: string;
|
|
142
|
-
start_column: number;
|
|
143
|
-
end_column: number;
|
|
144
|
-
start_byte: number;
|
|
145
|
-
end_byte: number;
|
|
146
|
-
}
|
|
147
|
-
export interface IdentifyOutput {
|
|
148
|
-
file: string;
|
|
149
|
-
language: string;
|
|
150
|
-
engine?: string;
|
|
151
|
-
line_count: number;
|
|
152
|
-
file_hash: string;
|
|
153
|
-
line: number;
|
|
154
|
-
column: number;
|
|
155
|
-
line_hash: string;
|
|
156
|
-
identifier?: IdentifierOutput;
|
|
157
|
-
symbol?: {
|
|
158
|
-
name: string;
|
|
159
|
-
kind: string;
|
|
160
|
-
qualified_name: string;
|
|
161
|
-
start_line: number;
|
|
162
|
-
end_line: number;
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
export interface EditOutput {
|
|
166
|
-
file: string;
|
|
167
|
-
before_hash: string;
|
|
168
|
-
file_hash: string;
|
|
169
|
-
plan_hash: string;
|
|
170
|
-
applied: boolean;
|
|
171
|
-
changed: boolean;
|
|
172
|
-
edit_count: number;
|
|
173
|
-
before_content?: string;
|
|
174
|
-
content?: string;
|
|
175
|
-
}
|
|
176
|
-
export interface RenameConflict {
|
|
177
|
-
line: number;
|
|
178
|
-
column: number;
|
|
179
|
-
reason: string;
|
|
180
|
-
}
|
|
181
|
-
export interface RenameEdit {
|
|
182
|
-
line: number;
|
|
183
|
-
start_column: number;
|
|
184
|
-
end_column: number;
|
|
185
|
-
start_byte: number;
|
|
186
|
-
end_byte: number;
|
|
187
|
-
occurrence: string;
|
|
188
|
-
line_hash: string;
|
|
189
|
-
text: string;
|
|
190
|
-
}
|
|
191
|
-
export interface RenameFileOutput {
|
|
192
|
-
file: string;
|
|
193
|
-
language: string;
|
|
194
|
-
engine?: string;
|
|
195
|
-
file_hash: string;
|
|
196
|
-
conflicts: RenameConflict[];
|
|
197
|
-
edits: RenameEdit[];
|
|
198
|
-
}
|
|
199
|
-
export interface RenameOutput {
|
|
200
|
-
file: string;
|
|
201
|
-
language: string;
|
|
202
|
-
engine?: string;
|
|
203
|
-
file_hash: string;
|
|
204
|
-
old_name: string;
|
|
205
|
-
new_name: string;
|
|
206
|
-
applied: boolean;
|
|
207
|
-
conflicts: RenameConflict[];
|
|
208
|
-
edits: RenameEdit[];
|
|
209
|
-
others: RenameFileOutput[];
|
|
210
|
-
}
|
|
211
|
-
export interface DefLocation {
|
|
212
|
-
file: string;
|
|
213
|
-
line: number;
|
|
214
|
-
column: number;
|
|
215
|
-
line_hash: string;
|
|
216
|
-
text: string;
|
|
217
|
-
kind?: string;
|
|
218
|
-
name?: string;
|
|
219
|
-
qualified_name?: string;
|
|
220
|
-
}
|
|
221
|
-
export interface ReadSeekDigestOptions {
|
|
222
|
-
select?: DigestFacet | DigestFacet[];
|
|
223
|
-
at?: string;
|
|
5
|
+
export interface ReadSeekInspectOptions {
|
|
6
|
+
select?: InspectFacet | InspectFacet[];
|
|
7
|
+
selector?: string;
|
|
8
|
+
query?: string;
|
|
224
9
|
end?: number;
|
|
225
10
|
limit?: number;
|
|
226
11
|
depth?: number;
|
|
@@ -234,14 +19,21 @@ export interface ReadSeekDigestOptions {
|
|
|
234
19
|
/** Route through the runner's vision path (serialized, long timeout). */
|
|
235
20
|
vision?: boolean;
|
|
236
21
|
}
|
|
237
|
-
export interface
|
|
238
|
-
metadata
|
|
22
|
+
export interface ReadSeekInspectOutput {
|
|
23
|
+
metadata?: ReadSeekDetection;
|
|
239
24
|
cache?: ReadSeekDocumentCache;
|
|
240
25
|
content?: unknown;
|
|
241
26
|
map?: ReadSeekMapOutput;
|
|
242
27
|
diagnostics?: ReadSeekCheckOutput;
|
|
243
28
|
identity?: IdentifyOutput;
|
|
244
29
|
}
|
|
30
|
+
export interface ReadSeekExtractOptions {
|
|
31
|
+
stdin?: string;
|
|
32
|
+
stdinName?: string;
|
|
33
|
+
signal?: AbortSignal;
|
|
34
|
+
timeoutMs?: number;
|
|
35
|
+
cancelable?: boolean;
|
|
36
|
+
}
|
|
245
37
|
export interface ReadSeekFailure {
|
|
246
38
|
code: "readseek-not-installed" | "readseek-execution-error";
|
|
247
39
|
message: string;
|
|
@@ -263,20 +55,18 @@ export interface ReadSeekRunOptions {
|
|
|
263
55
|
}
|
|
264
56
|
/**
|
|
265
57
|
* Host-supplied spawn seam: resolve the binary and run it, returning stdout as
|
|
266
|
-
* text or
|
|
58
|
+
* text or decoded KDL. The plugin owns binary resolution, cache-dir decoration,
|
|
267
59
|
* cwd, timeout settings, and any vision serialization queue; the client owns
|
|
268
60
|
* argv construction and output parsing.
|
|
269
61
|
*/
|
|
270
62
|
export interface ReadSeekRunner {
|
|
271
63
|
text(args: readonly string[], options?: ReadSeekRunOptions): Promise<string>;
|
|
272
|
-
|
|
64
|
+
kdl(args: readonly string[], options?: ReadSeekRunOptions): Promise<unknown>;
|
|
273
65
|
}
|
|
274
66
|
interface ReadSeekSearchOptions {
|
|
275
67
|
language?: string;
|
|
276
68
|
limit?: number;
|
|
277
|
-
|
|
278
|
-
others?: boolean;
|
|
279
|
-
ignored?: boolean;
|
|
69
|
+
gitScope?: GitScope;
|
|
280
70
|
signal?: AbortSignal;
|
|
281
71
|
}
|
|
282
72
|
interface ReadSeekRefsOptions {
|
|
@@ -285,17 +75,13 @@ interface ReadSeekRefsOptions {
|
|
|
285
75
|
line?: number;
|
|
286
76
|
column?: number;
|
|
287
77
|
language?: string;
|
|
288
|
-
|
|
289
|
-
others?: boolean;
|
|
290
|
-
ignored?: boolean;
|
|
78
|
+
gitScope?: GitScope;
|
|
291
79
|
signal?: AbortSignal;
|
|
292
80
|
}
|
|
293
81
|
interface DefOptions {
|
|
294
82
|
name: string;
|
|
295
83
|
language?: string;
|
|
296
|
-
|
|
297
|
-
others?: boolean;
|
|
298
|
-
ignored?: boolean;
|
|
84
|
+
gitScope?: GitScope;
|
|
299
85
|
signal?: AbortSignal;
|
|
300
86
|
}
|
|
301
87
|
interface EditOptions {
|
|
@@ -312,33 +98,21 @@ interface RenameOptions {
|
|
|
312
98
|
column?: number;
|
|
313
99
|
workspace?: string;
|
|
314
100
|
apply?: boolean;
|
|
101
|
+
planHash?: string;
|
|
315
102
|
language?: string;
|
|
316
|
-
|
|
317
|
-
others?: boolean;
|
|
318
|
-
ignored?: boolean;
|
|
103
|
+
gitScope?: GitScope;
|
|
319
104
|
signal?: AbortSignal;
|
|
320
105
|
}
|
|
321
106
|
interface IdentifyOptions {
|
|
322
|
-
line
|
|
107
|
+
line: number;
|
|
323
108
|
column?: number;
|
|
324
109
|
language?: string;
|
|
325
110
|
signal?: AbortSignal;
|
|
326
111
|
}
|
|
327
|
-
export interface ReadSeekViewOptions {
|
|
328
|
-
node?: string;
|
|
329
|
-
page?: number;
|
|
330
|
-
kind?: string;
|
|
331
|
-
depth?: number;
|
|
332
|
-
outline?: boolean;
|
|
333
|
-
visionMode?: ReadSeekImageMode;
|
|
334
|
-
visionLevel?: VisionLevel;
|
|
335
|
-
signal?: AbortSignal;
|
|
336
|
-
}
|
|
337
112
|
export interface ReadSeekClient {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
digestContent(filePath: string, options?: {
|
|
113
|
+
inspect(target: string, options?: ReadSeekInspectOptions): Promise<unknown>;
|
|
114
|
+
inspectText(target: string, options?: ReadSeekInspectOptions): Promise<string>;
|
|
115
|
+
inspectContent(filePath: string, options?: {
|
|
342
116
|
startLine?: number;
|
|
343
117
|
endLine?: number;
|
|
344
118
|
visionMode?: "none" | ReadSeekImageMode;
|
|
@@ -350,19 +124,20 @@ export interface ReadSeekClient {
|
|
|
350
124
|
text?: ReadSeekReadOutput;
|
|
351
125
|
image?: ReadSeekImageDetection;
|
|
352
126
|
}>;
|
|
127
|
+
extract(target: string, selector: string, output: string, options?: ReadSeekExtractOptions): Promise<void>;
|
|
353
128
|
image(filePath: string, modes: ReadSeekImageMode[], options?: {
|
|
354
129
|
signal?: AbortSignal;
|
|
355
130
|
}): Promise<ReadSeekDetection>;
|
|
356
131
|
preparedImage(filePath: string, options?: {
|
|
357
132
|
signal?: AbortSignal;
|
|
358
133
|
}): Promise<ReadSeekPreparedImage>;
|
|
359
|
-
search(target: string, pattern: string, options?: ReadSeekSearchOptions): Promise<
|
|
134
|
+
search(target: string, pattern: string, options?: ReadSeekSearchOptions): Promise<ReadSeekSearchOutput>;
|
|
360
135
|
refs(target: string, options?: ReadSeekRefsOptions): Promise<ReadSeekReference[]>;
|
|
361
136
|
def(target: string, options: DefOptions): Promise<DefLocation[]>;
|
|
362
137
|
check(filePath: string, content: string, options?: {
|
|
363
138
|
signal?: AbortSignal;
|
|
364
139
|
}): Promise<ReadSeekCheckOutput>;
|
|
365
|
-
identify(filePath: string, content: string, options
|
|
140
|
+
identify(filePath: string, content: string, options: IdentifyOptions): Promise<IdentifyOutput>;
|
|
366
141
|
detect(filePath: string, options?: {
|
|
367
142
|
signal?: AbortSignal;
|
|
368
143
|
}): Promise<ReadSeekDetection>;
|
|
@@ -370,4 +145,3 @@ export interface ReadSeekClient {
|
|
|
370
145
|
rename(filePath: string, options: RenameOptions): Promise<RenameOutput>;
|
|
371
146
|
}
|
|
372
147
|
export declare function createReadSeekClient(runner: ReadSeekRunner): ReadSeekClient;
|
|
373
|
-
export {};
|
package/dist/contract.d.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export type
|
|
1
|
+
export declare const INSPECT_FACETS: readonly ["metadata", "content", "map", "diagnostics", "identity"];
|
|
2
|
+
export type InspectFacet = (typeof INSPECT_FACETS)[number];
|
|
3
3
|
export declare const VISION_MODES: readonly ["none", "all", "ocr", "caption", "objects"];
|
|
4
4
|
export type VisionMode = (typeof VISION_MODES)[number];
|
|
5
5
|
export declare const VISION_ANALYSIS_MODES: readonly ["all", "ocr", "caption", "objects"];
|
|
6
6
|
export type VisionAnalysisMode = (typeof VISION_ANALYSIS_MODES)[number];
|
|
7
7
|
export declare const VISION_LEVELS: readonly ["low", "medium", "high"];
|
|
8
8
|
export type VisionLevel = (typeof VISION_LEVELS)[number];
|
|
9
|
-
export declare const DOCUMENT_NODE_KINDS: readonly ["artifact", "footer", "header", "heading", "marginal_label", "page", "page_number", "paragraph", "section", "structural_section"];
|
|
10
|
-
export type DocumentNodeKind = (typeof DOCUMENT_NODE_KINDS)[number];
|
|
11
9
|
export declare const EDIT_VARIANTS: readonly ["set_line", "replace_lines", "insert_after", "replace", "replace_symbol"];
|
|
12
10
|
export type EditVariant = (typeof EDIT_VARIANTS)[number];
|
|
13
|
-
export declare const
|
|
14
|
-
export type
|
|
15
|
-
export declare const TOOL_NAMES: readonly ["
|
|
11
|
+
export declare const GIT_SCOPES: readonly ["tracked", "untracked", "ignored", "all"];
|
|
12
|
+
export type GitScope = (typeof GIT_SCOPES)[number];
|
|
13
|
+
export declare const TOOL_NAMES: readonly ["inspect", "edit", "write", "grep", "extract", "search", "def", "refs", "rename"];
|
|
16
14
|
export type ToolName = (typeof TOOL_NAMES)[number];
|
|
17
15
|
export declare const PARAM_DESCRIPTIONS: {
|
|
18
16
|
readonly path: "Absolute or relative file path";
|
|
@@ -30,28 +28,24 @@ export declare const PARAM_DESCRIPTIONS: {
|
|
|
30
28
|
readonly line: "One-based cursor line; required with scope";
|
|
31
29
|
readonly renameLine: "One-based cursor line of the symbol to rename";
|
|
32
30
|
readonly column: "One-based cursor byte column for disambiguation";
|
|
33
|
-
readonly
|
|
34
|
-
readonly others: "In a Git repository, search untracked files";
|
|
35
|
-
readonly ignored: "With others=true, include ignored untracked files";
|
|
31
|
+
readonly gitScope: "In a Git repository, which files to search: tracked, untracked, ignored (untracked plus ignored), or all. Defaults to tracked plus untracked.";
|
|
36
32
|
readonly select: "Facets: metadata, content, map, diagnostics, identity (default content)";
|
|
37
33
|
readonly selectComma: "Comma-separated facets: metadata, content, map, diagnostics, identity";
|
|
38
|
-
readonly
|
|
34
|
+
readonly selector: "Positional selector: line:N[:COLUMN], hash:H[:COLUMN], symbol:NAME, page:N, node:ID, or asset:ID. Columns require the identity facet, which in turn rejects symbol selectors";
|
|
35
|
+
readonly assetSelector: "Document asset selector in the form asset:ID";
|
|
36
|
+
readonly query: "KDL selection query, @path, or '-' for standard input";
|
|
37
|
+
readonly stdinName: "File name hint when the target is '-'";
|
|
39
38
|
readonly end: "Last line to include";
|
|
40
39
|
readonly limit: "Maximum number of lines to include";
|
|
41
|
-
readonly
|
|
40
|
+
readonly inspectDepth: "Maximum structural depth for map output; defaults to 1 in agent tools";
|
|
42
41
|
readonly offset: "One-based starting line";
|
|
43
42
|
readonly readLimit: "Maximum lines to return";
|
|
44
43
|
readonly symbolRead: "Symbol name to read";
|
|
45
44
|
readonly bundle: "Include related symbols from the same file; requires symbol";
|
|
46
45
|
readonly image: "Standalone image mode: none, all, ocr, caption, objects. Required for standalone images.";
|
|
47
|
-
readonly
|
|
48
|
-
readonly visionModeView: "Analyze selected assets: all, ocr, caption, or objects";
|
|
46
|
+
readonly visionModeInspect: "Standalone image mode: none, all, caption, objects, or ocr";
|
|
49
47
|
readonly visionLevel: "Vision inference level: low (default), medium, or high";
|
|
50
|
-
readonly
|
|
51
|
-
readonly page: "One-based source page";
|
|
52
|
-
readonly kind: "Node kind filter";
|
|
53
|
-
readonly depth: "Maximum depth below selected roots";
|
|
54
|
-
readonly outline: "Return outline nodes only";
|
|
48
|
+
readonly output: "Destination file for extracted binary data; stdout is not supported";
|
|
55
49
|
readonly edits: "Use set_line, replace_lines, insert_after, replace_symbol, or replace";
|
|
56
50
|
readonly editVariant: "Exactly one nested edit variant";
|
|
57
51
|
readonly setLine: "Replace one line: {\"set_line\":{\"anchor\":\"LINE:HASH\",\"new_text\":\"...\"}}";
|
|
@@ -88,11 +82,11 @@ export declare const PARAM_DESCRIPTIONS: {
|
|
|
88
82
|
readonly scopeContext: "Context lines within each symbol";
|
|
89
83
|
};
|
|
90
84
|
export declare const TOOL_DESCRIPTIONS: {
|
|
91
|
-
readonly
|
|
85
|
+
readonly inspect: "Inspect source content, images, and documents through the native CLI envelope. Use it before edits to obtain fresh `LINE:HASH` anchors; use shallow maps for structural overviews, diagnostics for syntax checks, and identity for cursor context.";
|
|
92
86
|
readonly edit: "Edit existing text files with fresh `LINE:HASH` anchors. Read or search first when no fresh anchors are available. Each `edits[]` item must use exactly one nested object: `{\"set_line\":{\"anchor\":\"LINE:HASH\",\"new_text\":\"...\"}}`, `{\"replace_lines\":{\"start_anchor\":\"LINE:HASH\",\"end_anchor\":\"LINE:HASH\",\"new_text\":\"...\"}}`, `{\"insert_after\":{\"anchor\":\"LINE:HASH\",\"new_text\":\"...\"}}`, `{\"replace_symbol\":{\"symbol\":\"name\",\"new_body\":\"...\"}}`, or `{\"replace\":{\"old_text\":\"...\",\"new_text\":\"...\"}}`.";
|
|
93
87
|
readonly write: "Create or replace a complete text file and return `LINE:HASH` anchors. Use `edit` for small changes to an existing file.";
|
|
94
88
|
readonly grep: "Search text or regex in files and return edit-ready `LINE:HASH` anchors. Use for identifiers, strings, configuration, errors, comments, and documentation.";
|
|
95
|
-
readonly
|
|
89
|
+
readonly extract: "Extract a selected document asset into a destination file. Use an `asset:ID` selector discovered through `inspect`; extracted binary data is never returned on stdout.";
|
|
96
90
|
readonly search: "Search code by AST structure using ast-grep-style patterns. Results include line hashes usable as `LINE:HASH` anchors. Use `grep` for identifiers, strings, comments, configuration, documentation, or other plain text and regex.";
|
|
97
91
|
readonly def: "Go to a symbol definition or declaration by name. Accepts qualified or unqualified names; use this instead of text search for functions, methods, classes, types, and other declarations.";
|
|
98
92
|
readonly refs: "Find references or usages of an identifier by name or cursor binding. Results include enclosing symbols and line hashes usable as `LINE:HASH` anchors. Without cursor scope, results are identifier-name matches; with scope, they follow one binding and exclude shadows. Use text search for literals, and use this before renaming or deleting a symbol.";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function serializeEditPlan(edits: unknown): string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { INSPECT_FACETS, EDIT_VARIANTS, GIT_SCOPES, PARAM_DESCRIPTIONS, TOOL_CONTRACTS, getToolContract, TOOL_DESCRIPTIONS, TOOL_NAMES, renderToolDescription, VISION_ANALYSIS_MODES, VISION_LEVELS, VISION_MODES, type InspectFacet, type EditVariant, type GitScope, type JsonSchema, type ToolContract, type ToolName, type VisionAnalysisMode, type VisionLevel, type VisionMode, } from "./contract.ts";
|
|
2
2
|
export { BUILTIN_FALLBACKS, REPLACEABLE_TOOLS, TOOL_COMPACT_GUIDELINES, fallbackToolDescriptionMap, preferredToolDescriptionMap, renderCompactGuidelines, renderFallbackToolDescription, renderPreferredToolDescription, renderToolRoutingPolicy, resolveToolName, rewriteBacktickedToolNames, type ReplaceableTool, type ToolAliasMap, type ToolRoutingPolicyOptions, } from "./policy.ts";
|
|
3
|
-
export { coerceBoolean, coerceNonNegativeInt, coerceObviousBase10Int, coerceOptionalString, coercePositiveInt, validateExactlyOneEditVariant,
|
|
3
|
+
export { coerceBoolean, coerceNonNegativeInt, coerceObviousBase10Int, coerceOptionalString, coercePositiveInt, validateExactlyOneEditVariant, validateRefsNameVsScope, validateVisionLevelVsMode, type CoercedIntResult, type EditItem, type EditObject, type InsertAfterEdit, type RefsScopeInput, type ReplaceEdit, type ReplaceLinesEdit, type ReplaceSymbolEdit, type SetLineEdit, type ValidationResult, type VisionInput, } from "./validation.ts";
|
|
4
|
+
export { serializeEditPlan } from "./edit-plan.ts";
|
|
4
5
|
export { HASH_LEN, parseLineAnchor, tryParseLineAnchor, type LineAnchor, } from "./hashline.ts";
|
|
5
|
-
export { appendApplyAndPlanHash,
|
|
6
|
+
export { appendApplyAndPlanHash, appendGitScopeArgs, type GitScopeInput, buildDefArgs, buildExtractArgs, buildInspectArgs, DEFAULT_INSPECT_MAP_DEPTH, buildEditArgs, buildLineLocation, buildRefsArgs, buildRenameArgs, buildSearchArgs, type ApplyPlanHashInput, type ApplyPlanHashOrder, type DefArgsInput, type ExtractArgsInput, type InspectArgsInput, type EditArgsInput, type RefsArgsInput, type RenameArgsInput, type SearchArgsInput, } from "./argv.ts";
|
|
6
7
|
export { READSEEK_BINARY_ENV, READSEEK_PLATFORM_PACKAGES, readSeekBinaryName, readSeekPlatformKey, resolveReadSeekBinaryFromPackages, resolveReadSeekBinaryOverride, resolveReadSeekCacheDir, type ModuleResolver, type ReadSeekCacheOptions, } from "./platform.ts";
|
|
7
8
|
export { canonicalPathKey, expandUserPath, isSubPath, resolveScopedPath, resolveToCwd, } from "./path.ts";
|
|
8
|
-
export { cleanReadSeekErrorText
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
9
|
+
export { cleanReadSeekErrorText } from "./error.ts";
|
|
10
|
+
export { parseReadSeekKdl } from "./output-kdl.ts";
|
|
11
|
+
export { DEFAULT_MAX_OUTPUT_BYTES, DEFAULT_READSEEK_TIMEOUT_MS, ensureSuccessfulStdout, failureFromProcessResult, parseSuccessfulKdl, readSeekProcessEnvironment, resolveProcessLimits, type ProcessRunOptions, type ProcessRunResult, } from "./process.ts";
|
|
12
|
+
export { runReadSeekNode, runReadSeekNodeKdl, runReadSeekNodeText, } from "./process-node.ts";
|
|
13
|
+
export { runReadSeekBun, runReadSeekBunKdl, runReadSeekBunText, } from "./process-bun.ts";
|
|
14
|
+
export { classifyReadSeekFailure, createReadSeekClient, type DefLocation, type EditOutput, type IdentifierOutput, type IdentifyOutput, type ReadSeekCheckOutput, type ReadSeekClient, type ReadSeekDetection, type ReadSeekDetectedObject, type ReadSeekDiagnostic, type ReadSeekExtractOptions, type ReadSeekInspectOptions, type ReadSeekInspectOutput, type ReadSeekDocumentCache, type ReadSeekFailure, type ReadSeekHashline, type ReadSeekImageDetection, type ReadSeekImageMode, type ReadSeekMapOutput, type ReadSeekMapNode, type ReadSeekOcrText, type ReadSeekPreparedImage, type ReadSeekReadOutput, type ReadSeekReference, type ReadSeekRunOptions, type ReadSeekRunner, type RenameConflict, type RenameEdit, type RenameFileOutput, type RenameOutput, type ReadSeekSearchCapture, type ReadSeekSearchFileOutput, type ReadSeekSearchMatch, type ReadSeekSymbol, } from "./client.ts";
|