@jarkkojs/readseek-api 0.11.3 → 0.12.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 CHANGED
@@ -21,7 +21,7 @@ platform binary; plugins declare both packages directly.
21
21
 
22
22
  ```ts
23
23
  import {
24
- buildShowStructureArgs,
24
+ buildTreeArgs,
25
25
  resolveReadSeekBinaryFromPackages,
26
26
  resolveReadSeekBinaryOverride,
27
27
  runReadSeekNodeKdl,
@@ -29,14 +29,13 @@ import {
29
29
 
30
30
  const binary =
31
31
  resolveReadSeekBinaryOverride() ?? resolveReadSeekBinaryFromPackages();
32
- const args = buildShowStructureArgs({ path: "src/index.ts", depth: 2 });
32
+ const args = buildTreeArgs({ path: "src/index.ts", depth: 2 });
33
33
  const result = await runReadSeekNodeKdl(binary, args);
34
34
  ```
35
35
 
36
- The API follows the CLI's verb–object grammar: `showContent`, `showStructure`,
37
- `showMetadata`, `showAssets`, `findNodes`, `findText`, `findDefinitions`,
38
- `findReferences`, `checkSyntax`, `checkRules`, `generateCaption`, `detectObjects`,
39
- `recognizeText`, `editText`, and `renameSymbol`. Selection uses `at`.
36
+ The API follows the CLI's single-word command grammar: `show`, `tree`,
37
+ `meta`, `assets`, `search`, `grep`, `def`, `refs`, `syntax`, `check`,
38
+ `caption`, `objects`, `ocr`, `edit`, and `rename`. Selection uses `at`.
40
39
 
41
40
  Document content and asset results include usable cached image paths. There is no
42
41
  separate extraction step or destination argument. Cache population is an internal
@@ -44,14 +43,13 @@ write; reading never invokes inference. Syntax checks return diagnostics even
44
43
  when the native process exits 1 (findings); exit 2 is a failure.
45
44
 
46
45
  `presentShowResult()` and `formatShowResult()` provide shared readable output for
47
- `show_content`, `show_structure`, `show_metadata`, and `show_assets`. Summaries
46
+ `show`, `tree`, `meta`, and `assets`. Summaries
48
47
  identify selections and counts; bodies contain anchored lines, document sections,
49
48
  structure trees, fields, or asset paths. Notices identify omitted source ranges
50
49
  and how to continue. Formatting never mutates the decoded result.
51
50
 
52
- This is a breaking contract: legacy `inspect`/`extract` methods, selectable facets,
53
- and old command names are removed, not aliased.
54
-
51
+ This is a breaking contract: two-word verb-object methods, legacy `inspect`/`extract`
52
+ methods, and old command names are removed, not aliased.
55
53
  ## Licensing
56
54
 
57
55
  `@jarkkojs/readseek-api` is licensed under the Apache 2.0 license. See
package/dist/argv.d.ts CHANGED
@@ -18,6 +18,8 @@ type ParsedSelector = {
18
18
  kind: SelectorKind;
19
19
  value: string;
20
20
  column?: number;
21
+ endLine?: number;
22
+ explicitKind: boolean;
21
23
  };
22
24
  /** Mirrors core::ParseSelector so wrappers reject the same selectors natively. */
23
25
  export declare function parseSelector(text: string): ParsedSelector;
@@ -26,39 +28,39 @@ export type AccessArgsInput = {
26
28
  stdinName?: string;
27
29
  readseekDir?: string;
28
30
  };
29
- export type ShowContentArgsInput = AccessArgsInput & {
31
+ export type ShowArgsInput = AccessArgsInput & {
30
32
  at?: string;
31
33
  end?: number;
32
34
  limit?: number;
33
35
  language?: string;
34
36
  noAnchors?: boolean;
35
37
  };
36
- export type ShowStructureArgsInput = AccessArgsInput & {
38
+ export type TreeArgsInput = AccessArgsInput & {
37
39
  at?: string;
38
40
  depth?: number;
39
41
  kind?: string;
40
42
  outline?: boolean;
41
43
  language?: string;
42
44
  };
43
- export type ShowMetadataArgsInput = AccessArgsInput & {
45
+ export type MetaArgsInput = AccessArgsInput & {
44
46
  language?: string;
45
47
  };
46
- export type ShowAssetsArgsInput = AccessArgsInput & {
48
+ export type AssetsArgsInput = AccessArgsInput & {
47
49
  at?: string;
48
50
  };
49
- export type CheckSyntaxArgsInput = AccessArgsInput & {
51
+ export type SyntaxArgsInput = AccessArgsInput & {
50
52
  language?: string;
51
53
  };
52
54
  export type VisionArgsInput = AccessArgsInput & {
53
55
  at?: string;
54
56
  level?: VisionLevel;
55
57
  };
56
- export type GenerateCaptionArgsInput = VisionArgsInput & {
58
+ export type CaptionArgsInput = VisionArgsInput & {
57
59
  include?: ("text" | "objects")[];
58
60
  };
59
- export type DetectObjectsArgsInput = VisionArgsInput;
60
- export type RecognizeTextArgsInput = VisionArgsInput;
61
- export type FindNodesArgsInput = AccessArgsInput & GitScopeInput & {
61
+ export type ObjectsArgsInput = VisionArgsInput;
62
+ export type OcrArgsInput = VisionArgsInput;
63
+ export type SearchArgsInput = AccessArgsInput & GitScopeInput & {
62
64
  pattern?: string;
63
65
  context?: string;
64
66
  selector?: string;
@@ -67,29 +69,29 @@ export type FindNodesArgsInput = AccessArgsInput & GitScopeInput & {
67
69
  limit?: number;
68
70
  noAnchors?: boolean;
69
71
  };
70
- export type FindTextArgsInput = {
72
+ export type GrepArgsInput = {
71
73
  path: string;
72
74
  text: string;
73
75
  limit?: number;
74
76
  } & GitScopeInput;
75
- export type FindDefinitionsArgsInput = {
77
+ export type DefArgsInput = {
76
78
  path: string;
77
79
  name: string;
78
80
  language?: string;
79
81
  noAnchors?: boolean;
80
82
  } & GitScopeInput;
81
- export type FindReferencesArgsInput = {
83
+ export type RefsArgsInput = {
82
84
  path: string;
83
85
  name?: string;
84
86
  at?: string;
85
87
  language?: string;
86
88
  noAnchors?: boolean;
87
89
  } & GitScopeInput;
88
- export type CheckRulesArgsInput = {
90
+ export type CheckArgsInput = {
89
91
  path: string;
90
92
  rules: string;
91
93
  } & GitScopeInput;
92
- export type EditTextArgsInput = {
94
+ export type EditArgsInput = {
93
95
  path: string;
94
96
  apply?: boolean;
95
97
  planHash?: string;
@@ -97,7 +99,7 @@ export type EditTextArgsInput = {
97
99
  requestFromStdin?: boolean;
98
100
  flagOrder?: ApplyPlanHashOrder;
99
101
  } & GitScopeInput;
100
- export type RenameSymbolArgsInput = {
102
+ export type RenameArgsInput = {
101
103
  path: string;
102
104
  to: string;
103
105
  at: string;
@@ -107,19 +109,19 @@ export type RenameSymbolArgsInput = {
107
109
  language?: string;
108
110
  flagOrder?: ApplyPlanHashOrder;
109
111
  } & GitScopeInput;
110
- export declare function buildShowContentArgs(input: ShowContentArgsInput): string[];
111
- export declare function buildShowStructureArgs(input: ShowStructureArgsInput): string[];
112
- export declare function buildShowMetadataArgs(input: ShowMetadataArgsInput): string[];
113
- export declare function buildShowAssetsArgs(input: ShowAssetsArgsInput): string[];
114
- export declare function buildCheckSyntaxArgs(input: CheckSyntaxArgsInput): string[];
115
- export declare function buildGenerateCaptionArgs(input: GenerateCaptionArgsInput): string[];
116
- export declare function buildDetectObjectsArgs(input: DetectObjectsArgsInput): string[];
117
- export declare function buildRecognizeTextArgs(input: RecognizeTextArgsInput): string[];
118
- export declare function buildFindNodesArgs(input: FindNodesArgsInput): string[];
119
- export declare function buildFindTextArgs(input: FindTextArgsInput): string[];
120
- export declare function buildFindDefinitionsArgs(input: FindDefinitionsArgsInput): string[];
121
- export declare function buildFindReferencesArgs(input: FindReferencesArgsInput): string[];
122
- export declare function buildCheckRulesArgs(input: CheckRulesArgsInput): string[];
123
- export declare function buildEditTextArgs(input: EditTextArgsInput): string[];
124
- export declare function buildRenameSymbolArgs(input: RenameSymbolArgsInput): string[];
112
+ export declare function buildShowArgs(input: ShowArgsInput): string[];
113
+ export declare function buildTreeArgs(input: TreeArgsInput): string[];
114
+ export declare function buildMetaArgs(input: MetaArgsInput): string[];
115
+ export declare function buildAssetsArgs(input: AssetsArgsInput): string[];
116
+ export declare function buildSyntaxArgs(input: SyntaxArgsInput): string[];
117
+ export declare function buildCaptionArgs(input: CaptionArgsInput): string[];
118
+ export declare function buildObjectsArgs(input: ObjectsArgsInput): string[];
119
+ export declare function buildOcrArgs(input: OcrArgsInput): string[];
120
+ export declare function buildSearchArgs(input: SearchArgsInput): string[];
121
+ export declare function buildGrepArgs(input: GrepArgsInput): string[];
122
+ export declare function buildDefArgs(input: DefArgsInput): string[];
123
+ export declare function buildRefsArgs(input: RefsArgsInput): string[];
124
+ export declare function buildCheckArgs(input: CheckArgsInput): string[];
125
+ export declare function buildEditArgs(input: EditArgsInput): string[];
126
+ export declare function buildRenameArgs(input: RenameArgsInput): string[];
125
127
  export {};
package/dist/client.d.ts CHANGED
@@ -13,20 +13,20 @@ export interface ReadSeekRunner {
13
13
  kdl(args: readonly string[], options?: ReadSeekRunOptions): Promise<unknown>;
14
14
  }
15
15
  type Options<T> = Omit<T, "path" | "requestFromStdin" | "flagOrder"> & Omit<ReadSeekRunOptions, "vision">;
16
- export type ReadSeekContentOptions = Options<argv.ShowContentArgsInput>;
17
- export type ReadSeekStructureOptions = Options<argv.ShowStructureArgsInput>;
18
- export type ReadSeekMetadataOptions = Options<argv.ShowMetadataArgsInput>;
19
- export type ReadSeekAssetsOptions = Options<argv.ShowAssetsArgsInput>;
20
- export type ReadSeekSyntaxOptions = Options<argv.CheckSyntaxArgsInput>;
21
- export type ReadSeekRulesOptions = Options<argv.CheckRulesArgsInput>;
22
- export type ReadSeekCaptionOptions = Options<argv.GenerateCaptionArgsInput>;
23
- export type ReadSeekVisionOptions = Options<argv.DetectObjectsArgsInput>;
24
- export type ReadSeekNodesOptions = Options<argv.FindNodesArgsInput>;
25
- export type ReadSeekTextOptions = Options<argv.FindTextArgsInput>;
26
- export type ReadSeekDefinitionsOptions = Options<argv.FindDefinitionsArgsInput>;
27
- export type ReadSeekReferencesOptions = Options<argv.FindReferencesArgsInput>;
28
- export type ReadSeekEditOptions = Options<argv.EditTextArgsInput>;
29
- export type ReadSeekRenameOptions = Options<argv.RenameSymbolArgsInput>;
16
+ export type ReadSeekShowOptions = Options<argv.ShowArgsInput>;
17
+ export type ReadSeekTreeOptions = Options<argv.TreeArgsInput>;
18
+ export type ReadSeekMetaOptions = Options<argv.MetaArgsInput>;
19
+ export type ReadSeekAssetsOptions = Options<argv.AssetsArgsInput>;
20
+ export type ReadSeekSyntaxOptions = Options<argv.SyntaxArgsInput>;
21
+ export type ReadSeekCheckOptions = Options<argv.CheckArgsInput>;
22
+ export type ReadSeekCaptionOptions = Options<argv.CaptionArgsInput>;
23
+ export type ReadSeekVisionOptions = Options<argv.ObjectsArgsInput>;
24
+ export type ReadSeekSearchOptions = Options<argv.SearchArgsInput>;
25
+ export type ReadSeekGrepOptions = Options<argv.GrepArgsInput>;
26
+ export type ReadSeekDefOptions = Options<argv.DefArgsInput>;
27
+ export type ReadSeekRefsOptions = Options<argv.RefsArgsInput>;
28
+ export type ReadSeekEditOptions = Options<argv.EditArgsInput>;
29
+ export type ReadSeekRenameOptions = Options<argv.RenameArgsInput>;
30
30
  export interface ReadSeekFailure {
31
31
  code: "readseek-not-installed" | "readseek-execution-error";
32
32
  message: string;
@@ -39,20 +39,20 @@ export interface ReadSeekFailure {
39
39
  */
40
40
  export declare function classifyReadSeekFailure(err: unknown): ReadSeekFailure;
41
41
  export interface ReadSeekClient {
42
- showContent(path: string, options?: ReadSeekContentOptions): Promise<output.ReadSeekContentOutput>;
43
- showStructure(path: string, options?: ReadSeekStructureOptions): Promise<output.ReadSeekStructureOutputEnvelope>;
44
- showMetadata(path: string, options?: ReadSeekMetadataOptions): Promise<output.ReadSeekDetection>;
45
- showAssets(path: string, options?: ReadSeekAssetsOptions): Promise<output.ReadSeekAssetsOutput>;
46
- checkSyntax(path: string, options?: ReadSeekSyntaxOptions): Promise<output.ReadSeekCheckOutput>;
47
- checkRules(path: string, options: ReadSeekRulesOptions): Promise<output.ReadSeekRulesOutput>;
48
- generateCaption(path: string, options?: ReadSeekCaptionOptions): Promise<output.ReadSeekContentOutput>;
49
- detectObjects(path: string, options?: ReadSeekVisionOptions): Promise<output.ReadSeekContentOutput>;
50
- recognizeText(path: string, options?: ReadSeekVisionOptions): Promise<output.ReadSeekContentOutput>;
51
- findNodes(path: string, options: ReadSeekNodesOptions): Promise<output.ReadSeekSearchOutput>;
52
- findText(path: string, options: ReadSeekTextOptions): Promise<output.ReadSeekTextSearchOutput>;
53
- findDefinitions(path: string, options: ReadSeekDefinitionsOptions): Promise<output.DefLocation[]>;
54
- findReferences(path: string, options: ReadSeekReferencesOptions): Promise<output.ReadSeekReference[]>;
55
- editText(path: string, edits: unknown[], options?: ReadSeekEditOptions): Promise<output.EditOutput>;
56
- renameSymbol(path: string, options: ReadSeekRenameOptions): Promise<output.RenameOutput>;
42
+ show(path: string, options?: ReadSeekShowOptions): Promise<output.ReadSeekContentOutput>;
43
+ tree(path: string, options?: ReadSeekTreeOptions): Promise<output.ReadSeekStructureOutputEnvelope>;
44
+ meta(path: string, options?: ReadSeekMetaOptions): Promise<output.ReadSeekDetection>;
45
+ assets(path: string, options?: ReadSeekAssetsOptions): Promise<output.ReadSeekAssetsOutput>;
46
+ syntax(path: string, options?: ReadSeekSyntaxOptions): Promise<output.ReadSeekCheckOutput>;
47
+ check(path: string, options: ReadSeekCheckOptions): Promise<output.ReadSeekRulesOutput>;
48
+ caption(path: string, options?: ReadSeekCaptionOptions): Promise<output.ReadSeekContentOutput>;
49
+ objects(path: string, options?: ReadSeekVisionOptions): Promise<output.ReadSeekContentOutput>;
50
+ ocr(path: string, options?: ReadSeekVisionOptions): Promise<output.ReadSeekContentOutput>;
51
+ search(path: string, options: ReadSeekSearchOptions): Promise<output.ReadSeekSearchOutput>;
52
+ grep(path: string, options: ReadSeekGrepOptions): Promise<output.ReadSeekTextSearchOutput>;
53
+ def(path: string, options: ReadSeekDefOptions): Promise<output.DefLocation[]>;
54
+ refs(path: string, options: ReadSeekRefsOptions): Promise<output.ReadSeekReference[]>;
55
+ edit(path: string, edits: unknown[], options?: ReadSeekEditOptions): Promise<output.EditOutput>;
56
+ rename(path: string, options: ReadSeekRenameOptions): Promise<output.RenameOutput>;
57
57
  }
58
58
  export declare function createReadSeekClient(runner: ReadSeekRunner): ReadSeekClient;
@@ -4,7 +4,7 @@ export declare const EDIT_VARIANTS: readonly ["set_line", "replace_lines", "inse
4
4
  export type EditVariant = (typeof EDIT_VARIANTS)[number];
5
5
  export declare const GIT_SCOPES: readonly ["tracked", "untracked", "ignored", "all"];
6
6
  export type GitScope = (typeof GIT_SCOPES)[number];
7
- export declare const TOOL_NAMES: readonly ["show_content", "show_structure", "show_metadata", "show_assets", "check_syntax", "check_rules", "generate_caption", "detect_objects", "recognize_text", "find_nodes", "find_text", "find_definitions", "find_references", "edit_text", "rename_symbol", "write_file"];
7
+ export declare const TOOL_NAMES: readonly ["show", "tree", "meta", "assets", "syntax", "check", "caption", "objects", "ocr", "search", "grep", "def", "refs", "edit", "rename", "write"];
8
8
  export type ToolName = (typeof TOOL_NAMES)[number];
9
9
  export declare const PARAM_DESCRIPTIONS: {
10
10
  readonly path: "Absolute or relative file path";
@@ -20,8 +20,8 @@ export declare const PARAM_DESCRIPTIONS: {
20
20
  readonly name: "Qualified or unqualified symbol name";
21
21
  readonly refsName: "Identifier to find references for";
22
22
  readonly gitScope: "In a Git repository, which files to search: tracked, untracked, ignored (untracked plus ignored), or all. Defaults to tracked plus untracked.";
23
- readonly at: "Location selector: line:N[:COLUMN], hash:H[:COLUMN], symbol:NAME, page:N, node:ID, or asset:ID";
24
- readonly assetAt: "Document selector: page:N, node:ID, or asset:ID";
23
+ readonly at: "Location selector: N[:COLUMN], START-END, H[:COLUMN], NAME, line:N[:COLUMN], hash:H[:COLUMN], symbol:NAME, page:N, node:ID, or asset:ID";
24
+ readonly assetAt: "Document selector: N, page:N, node:ID, or asset:ID";
25
25
  readonly rule: "KDL node selection rule, @path, or '-' for standard input";
26
26
  readonly rules: "KDL structural checks, @path, or '-' for standard input";
27
27
  readonly stdinName: "File name hint when the target is '-'";
@@ -33,7 +33,7 @@ export declare const PARAM_DESCRIPTIONS: {
33
33
  readonly kind: "Restrict structure to this node kind";
34
34
  readonly outline: "Show outline of document hierarchy or source symbols";
35
35
  readonly noAnchors: "Omit source line anchors";
36
- readonly text: "Literal native text query; adapter find_text also supports regex via pattern";
36
+ readonly text: "Literal native text query; adapter grep also supports regex via pattern";
37
37
  readonly edits: "Use set_line, replace_lines, insert_after, replace_symbol, or replace";
38
38
  readonly editVariant: "Exactly one nested edit variant";
39
39
  readonly setLine: "Replace one line: {\"set_line\":{\"anchor\":\"LINE:HASH\",\"new_text\":\"...\"}}";
@@ -70,22 +70,22 @@ export declare const PARAM_DESCRIPTIONS: {
70
70
  readonly scopeContext: "Context lines within each symbol";
71
71
  };
72
72
  export declare const TOOL_DESCRIPTIONS: {
73
- readonly show_content: "Read source, document content, or image descriptors without inference. Obtain fresh `LINE:HASH` anchors before edits; use at with a column for cursor context. Document results include typed nodes and cached asset paths.";
74
- readonly show_structure: "Show parsed source or document hierarchy. Use shallow depth for file overviews.";
75
- readonly show_metadata: "Show format, source identity, language, dimensions, or page count without decoding image content or inference.";
76
- readonly show_assets: "Return selected document asset descriptors with usable cached paths. Adapters attach images from those paths.";
77
- readonly check_syntax: "Check parser syntax diagnostics. Exit 0 is clean, 1 has findings, 2 is failure; this is not type checking.";
78
- readonly check_rules: "Evaluate KDL structural assertions. Exit 0 is clean, 1 has findings, 2 is failure.";
79
- readonly generate_caption: "Explicitly infer a caption using an installed model. Include text and objects to request OCR and detection too; never downloads models automatically.";
80
- readonly detect_objects: "Explicitly infer object labels and bounding boxes using an installed model.";
81
- readonly recognize_text: "Explicitly recognize text from pixels using an installed model; reading never silently invokes OCR.";
82
- readonly find_nodes: "Find AST nodes by pattern or KDL selection rule. Returns edit-ready anchors. Use `find_text` for text and regex.";
83
- readonly find_text: "Search text or regex and return edit-ready `LINE:HASH` anchors. Native CLI text is literal; adapters preserve regex, glob, context, summary, and symbol grouping.";
84
- readonly find_definitions: "Find a symbol definition or declaration by qualified or unqualified name.";
85
- readonly find_references: "Find identifier-name matches with name, or binding-scoped references with at. Use before renaming or deleting a symbol.";
86
- readonly edit_text: "Edit existing files with fresh `LINE:HASH` anchors. Each edits item contains exactly one set_line, replace_lines, insert_after, replace_symbol, or replace object. Preview before applying a verified plan.";
87
- readonly rename_symbol: "Rename a symbol at a line or hash cursor with binding-aware edits and stale-plan protection.";
88
- readonly write_file: "Create or replace a complete text file and return `LINE:HASH` anchors. Use `edit_text` for small changes.";
73
+ readonly show: "Read source, document content, or image descriptors without inference. Obtain fresh `LINE:HASH` anchors before edits; use at with a column for cursor context. Document results include typed nodes and cached asset paths.";
74
+ readonly tree: "Show parsed source or document hierarchy. Use shallow depth for file overviews.";
75
+ readonly meta: "Show format, source identity, language, dimensions, or page count without decoding image content or inference.";
76
+ readonly assets: "Return selected document asset descriptors with usable cached paths. Adapters attach images from those paths.";
77
+ readonly syntax: "Check parser syntax diagnostics. Exit 0 is clean, 1 has findings, 2 is failure; this is not type checking.";
78
+ readonly check: "Evaluate KDL structural assertions. Exit 0 is clean, 1 has findings, 2 is failure.";
79
+ readonly caption: "Explicitly infer a caption using an installed model. Include text and objects to request OCR and detection too; never downloads models automatically.";
80
+ readonly objects: "Explicitly infer object labels and bounding boxes using an installed model.";
81
+ readonly ocr: "Explicitly recognize text from pixels using an installed model; reading never silently invokes OCR.";
82
+ readonly search: "Find AST nodes by pattern or KDL selection rule. Returns edit-ready anchors. Use `grep` for text and regex.";
83
+ readonly grep: "Search text or regex and return edit-ready `LINE:HASH` anchors. Native CLI text is literal; adapters preserve regex, glob, context, summary, and symbol grouping.";
84
+ readonly def: "Find a symbol definition or declaration by qualified or unqualified name.";
85
+ readonly refs: "Find identifier-name matches with name, or binding-scoped references with at. Use before renaming or deleting a symbol.";
86
+ readonly edit: "Edit existing files with fresh `LINE:HASH` anchors. Each edits item contains exactly one set_line, replace_lines, insert_after, replace_symbol, or replace object. Preview before applying a verified plan.";
87
+ readonly rename: "Rename a symbol at a line or hash cursor with binding-aware edits and stale-plan protection.";
88
+ readonly write: "Create or replace a complete text file and return `LINE:HASH` anchors. Use `edit` for small changes.";
89
89
  };
90
90
  export declare function rewriteBacktickedToolNames(text: string, aliases?: Readonly<Partial<Record<ToolName, string>>>): string;
91
91
  export declare function renderToolDescription(name: ToolName, aliases?: Readonly<Partial<Record<ToolName, string>>>): string;
package/dist/index.js CHANGED
@@ -9,22 +9,22 @@ var EDIT_VARIANTS = [
9
9
  ];
10
10
  var GIT_SCOPES = ["tracked", "untracked", "ignored", "all"];
11
11
  var TOOL_NAMES = [
12
- "show_content",
13
- "show_structure",
14
- "show_metadata",
15
- "show_assets",
16
- "check_syntax",
17
- "check_rules",
18
- "generate_caption",
19
- "detect_objects",
20
- "recognize_text",
21
- "find_nodes",
22
- "find_text",
23
- "find_definitions",
24
- "find_references",
25
- "edit_text",
26
- "rename_symbol",
27
- "write_file"
12
+ "show",
13
+ "tree",
14
+ "meta",
15
+ "assets",
16
+ "syntax",
17
+ "check",
18
+ "caption",
19
+ "objects",
20
+ "ocr",
21
+ "search",
22
+ "grep",
23
+ "def",
24
+ "refs",
25
+ "edit",
26
+ "rename",
27
+ "write"
28
28
  ];
29
29
  var PARAM_DESCRIPTIONS = {
30
30
  path: "Absolute or relative file path",
@@ -40,8 +40,8 @@ var PARAM_DESCRIPTIONS = {
40
40
  name: "Qualified or unqualified symbol name",
41
41
  refsName: "Identifier to find references for",
42
42
  gitScope: "In a Git repository, which files to search: tracked, untracked, ignored (untracked plus ignored), or all. Defaults to tracked plus untracked.",
43
- at: "Location selector: line:N[:COLUMN], hash:H[:COLUMN], symbol:NAME, page:N, node:ID, or asset:ID",
44
- assetAt: "Document selector: page:N, node:ID, or asset:ID",
43
+ at: "Location selector: N[:COLUMN], START-END, H[:COLUMN], NAME, line:N[:COLUMN], hash:H[:COLUMN], symbol:NAME, page:N, node:ID, or asset:ID",
44
+ assetAt: "Document selector: N, page:N, node:ID, or asset:ID",
45
45
  rule: "KDL node selection rule, @path, or '-' for standard input",
46
46
  rules: "KDL structural checks, @path, or '-' for standard input",
47
47
  stdinName: "File name hint when the target is '-'",
@@ -53,7 +53,7 @@ var PARAM_DESCRIPTIONS = {
53
53
  kind: "Restrict structure to this node kind",
54
54
  outline: "Show outline of document hierarchy or source symbols",
55
55
  noAnchors: "Omit source line anchors",
56
- text: "Literal native text query; adapter find_text also supports regex via pattern",
56
+ text: "Literal native text query; adapter grep also supports regex via pattern",
57
57
  edits: "Use set_line, replace_lines, insert_after, replace_symbol, or replace",
58
58
  editVariant: "Exactly one nested edit variant",
59
59
  setLine: 'Replace one line: {"set_line":{"anchor":"LINE:HASH","new_text":"..."}}',
@@ -90,22 +90,22 @@ var PARAM_DESCRIPTIONS = {
90
90
  scopeContext: "Context lines within each symbol"
91
91
  };
92
92
  var TOOL_DESCRIPTIONS = {
93
- show_content: "Read source, document content, or image descriptors without inference. Obtain fresh `LINE:HASH` anchors before edits; use at with a column for cursor context. Document results include typed nodes and cached asset paths.",
94
- show_structure: "Show parsed source or document hierarchy. Use shallow depth for file overviews.",
95
- show_metadata: "Show format, source identity, language, dimensions, or page count without decoding image content or inference.",
96
- show_assets: "Return selected document asset descriptors with usable cached paths. Adapters attach images from those paths.",
97
- check_syntax: "Check parser syntax diagnostics. Exit 0 is clean, 1 has findings, 2 is failure; this is not type checking.",
98
- check_rules: "Evaluate KDL structural assertions. Exit 0 is clean, 1 has findings, 2 is failure.",
99
- generate_caption: "Explicitly infer a caption using an installed model. Include text and objects to request OCR and detection too; never downloads models automatically.",
100
- detect_objects: "Explicitly infer object labels and bounding boxes using an installed model.",
101
- recognize_text: "Explicitly recognize text from pixels using an installed model; reading never silently invokes OCR.",
102
- find_nodes: "Find AST nodes by pattern or KDL selection rule. Returns edit-ready anchors. Use `find_text` for text and regex.",
103
- find_text: "Search text or regex and return edit-ready `LINE:HASH` anchors. Native CLI text is literal; adapters preserve regex, glob, context, summary, and symbol grouping.",
104
- find_definitions: "Find a symbol definition or declaration by qualified or unqualified name.",
105
- find_references: "Find identifier-name matches with name, or binding-scoped references with at. Use before renaming or deleting a symbol.",
106
- edit_text: "Edit existing files with fresh `LINE:HASH` anchors. Each edits item contains exactly one set_line, replace_lines, insert_after, replace_symbol, or replace object. Preview before applying a verified plan.",
107
- rename_symbol: "Rename a symbol at a line or hash cursor with binding-aware edits and stale-plan protection.",
108
- write_file: "Create or replace a complete text file and return `LINE:HASH` anchors. Use `edit_text` for small changes."
93
+ show: "Read source, document content, or image descriptors without inference. Obtain fresh `LINE:HASH` anchors before edits; use at with a column for cursor context. Document results include typed nodes and cached asset paths.",
94
+ tree: "Show parsed source or document hierarchy. Use shallow depth for file overviews.",
95
+ meta: "Show format, source identity, language, dimensions, or page count without decoding image content or inference.",
96
+ assets: "Return selected document asset descriptors with usable cached paths. Adapters attach images from those paths.",
97
+ syntax: "Check parser syntax diagnostics. Exit 0 is clean, 1 has findings, 2 is failure; this is not type checking.",
98
+ check: "Evaluate KDL structural assertions. Exit 0 is clean, 1 has findings, 2 is failure.",
99
+ caption: "Explicitly infer a caption using an installed model. Include text and objects to request OCR and detection too; never downloads models automatically.",
100
+ objects: "Explicitly infer object labels and bounding boxes using an installed model.",
101
+ ocr: "Explicitly recognize text from pixels using an installed model; reading never silently invokes OCR.",
102
+ search: "Find AST nodes by pattern or KDL selection rule. Returns edit-ready anchors. Use `grep` for text and regex.",
103
+ grep: "Search text or regex and return edit-ready `LINE:HASH` anchors. Native CLI text is literal; adapters preserve regex, glob, context, summary, and symbol grouping.",
104
+ def: "Find a symbol definition or declaration by qualified or unqualified name.",
105
+ refs: "Find identifier-name matches with name, or binding-scoped references with at. Use before renaming or deleting a symbol.",
106
+ edit: "Edit existing files with fresh `LINE:HASH` anchors. Each edits item contains exactly one set_line, replace_lines, insert_after, replace_symbol, or replace object. Preview before applying a verified plan.",
107
+ rename: "Rename a symbol at a line or hash cursor with binding-aware edits and stale-plan protection.",
108
+ write: "Create or replace a complete text file and return `LINE:HASH` anchors. Use `edit` for small changes."
109
109
  };
110
110
  function rewriteBacktickedToolNames(text, aliases = {}) {
111
111
  return TOOL_NAMES.reduce((rewritten, toolName) => rewritten.replaceAll(`\`${toolName}\``, `\`${aliases[toolName] ?? toolName}\``), text);
@@ -198,22 +198,22 @@ function tool(name, title, properties, required) {
198
198
  return { name, title, description: TOOL_DESCRIPTIONS[name], inputSchema: { type: "object", properties, required, additionalProperties: false } };
199
199
  }
200
200
  var TOOL_CONTRACTS = [
201
- tool("show_content", "Show content", { ...path, ...at, ...lang, ...stdin, ...noAnchors, end: integer(PARAM_DESCRIPTIONS.end), limit: integer(PARAM_DESCRIPTIONS.limit) }, ["path"]),
202
- tool("show_structure", "Show structure", { ...path, ...at, ...lang, ...stdin, depth: integer(PARAM_DESCRIPTIONS.depth, 0), kind: string(PARAM_DESCRIPTIONS.kind), outline: { type: "boolean", description: PARAM_DESCRIPTIONS.outline } }, ["path"]),
203
- tool("show_metadata", "Show metadata", { ...path, ...lang, ...stdin }, ["path"]),
204
- tool("show_assets", "Show assets", { ...path, at: string(PARAM_DESCRIPTIONS.assetAt), ...stdin }, ["path"]),
205
- tool("check_syntax", "Check syntax", { ...path, ...lang, ...stdin }, ["path"]),
206
- tool("check_rules", "Check rules", { path: string(PARAM_DESCRIPTIONS.searchPath), ...gitScopeSchema, rules: string(PARAM_DESCRIPTIONS.rules) }, ["rules"]),
207
- tool("generate_caption", "Generate caption", { ...path, ...at, ...stdin, ...level, include: { type: "array", items: { type: "string", enum: ["text", "objects"] }, minItems: 1, uniqueItems: true, description: PARAM_DESCRIPTIONS.include } }, ["path"]),
208
- tool("detect_objects", "Detect objects", { ...path, ...at, ...stdin, ...level }, ["path"]),
209
- tool("recognize_text", "Recognize text", { ...path, ...at, ...stdin, ...level }, ["path"]),
210
- tool("find_nodes", "Find nodes", { ...path, ...lang, ...stdin, ...limit, ...gitScopeSchema, ...noAnchors, pattern: string(PARAM_DESCRIPTIONS.pattern), context: string(PARAM_DESCRIPTIONS.patternContext), selector: string(PARAM_DESCRIPTIONS.selector), rule: string(PARAM_DESCRIPTIONS.rule) }, []),
211
- tool("find_text", "Find text", { ...path, ...limit, ...gitScopeSchema, text: string(PARAM_DESCRIPTIONS.text), pattern: string(PARAM_DESCRIPTIONS.grepPattern), glob: string(PARAM_DESCRIPTIONS.glob), ignoreCase: { type: "boolean", description: PARAM_DESCRIPTIONS.ignoreCase }, literal: { type: "boolean", description: PARAM_DESCRIPTIONS.literal }, context: integer(PARAM_DESCRIPTIONS.context, 0), summary: { type: "boolean", description: PARAM_DESCRIPTIONS.summary }, scope: { type: "string", enum: ["symbol"], description: PARAM_DESCRIPTIONS.grepScope }, scopeContext: integer(PARAM_DESCRIPTIONS.scopeContext, 0) }, []),
212
- tool("find_definitions", "Find definitions", { ...path, ...lang, ...gitScopeSchema, ...noAnchors, name: string(PARAM_DESCRIPTIONS.name) }, ["name"]),
213
- tool("find_references", "Find references", { ...path, ...at, ...lang, ...gitScopeSchema, ...noAnchors, name: string(PARAM_DESCRIPTIONS.refsName) }, []),
214
- tool("edit_text", "Hash-verified edit", { ...path, ...lang, ...gitScopeSchema, ...apply, edits: { type: "array", minItems: 1, items: editItemSchema, description: PARAM_DESCRIPTIONS.edits }, postEditVerify: { type: "boolean", description: PARAM_DESCRIPTIONS.postEditVerify } }, ["path", "edits"]),
215
- tool("rename_symbol", "Rename symbol", { ...path, ...at, ...lang, ...gitScopeSchema, ...apply, to: string(PARAM_DESCRIPTIONS.to), workspace: { type: "boolean", description: PARAM_DESCRIPTIONS.workspace } }, ["path", "at", "to"]),
216
- tool("write_file", "Write file", { ...path, content: string(PARAM_DESCRIPTIONS.content) }, ["path", "content"])
201
+ tool("show", "Show content", { ...path, ...at, ...lang, ...stdin, ...noAnchors, end: integer(PARAM_DESCRIPTIONS.end), limit: integer(PARAM_DESCRIPTIONS.limit) }, ["path"]),
202
+ tool("tree", "Show structure", { ...path, ...at, ...lang, ...stdin, depth: integer(PARAM_DESCRIPTIONS.depth, 0), kind: string(PARAM_DESCRIPTIONS.kind), outline: { type: "boolean", description: PARAM_DESCRIPTIONS.outline } }, ["path"]),
203
+ tool("meta", "Show metadata", { ...path, ...lang, ...stdin }, ["path"]),
204
+ tool("assets", "Show assets", { ...path, at: string(PARAM_DESCRIPTIONS.assetAt), ...stdin }, ["path"]),
205
+ tool("syntax", "Check syntax", { ...path, ...lang, ...stdin }, ["path"]),
206
+ tool("check", "Check rules", { path: string(PARAM_DESCRIPTIONS.searchPath), ...gitScopeSchema, rules: string(PARAM_DESCRIPTIONS.rules) }, ["rules"]),
207
+ tool("caption", "Generate caption", { ...path, ...at, ...stdin, ...level, include: { type: "array", items: { type: "string", enum: ["text", "objects"] }, minItems: 1, uniqueItems: true, description: PARAM_DESCRIPTIONS.include } }, ["path"]),
208
+ tool("objects", "Detect objects", { ...path, ...at, ...stdin, ...level }, ["path"]),
209
+ tool("ocr", "Recognize text", { ...path, ...at, ...stdin, ...level }, ["path"]),
210
+ tool("search", "Search AST nodes", { ...path, ...lang, ...stdin, ...limit, ...gitScopeSchema, ...noAnchors, pattern: string(PARAM_DESCRIPTIONS.pattern), context: string(PARAM_DESCRIPTIONS.patternContext), selector: string(PARAM_DESCRIPTIONS.selector), rule: string(PARAM_DESCRIPTIONS.rule) }, []),
211
+ tool("grep", "Search text", { ...path, ...limit, ...gitScopeSchema, text: string(PARAM_DESCRIPTIONS.text), pattern: string(PARAM_DESCRIPTIONS.grepPattern), glob: string(PARAM_DESCRIPTIONS.glob), ignoreCase: { type: "boolean", description: PARAM_DESCRIPTIONS.ignoreCase }, literal: { type: "boolean", description: PARAM_DESCRIPTIONS.literal }, context: integer(PARAM_DESCRIPTIONS.context, 0), summary: { type: "boolean", description: PARAM_DESCRIPTIONS.summary }, scope: { type: "string", enum: ["symbol"], description: PARAM_DESCRIPTIONS.grepScope }, scopeContext: integer(PARAM_DESCRIPTIONS.scopeContext, 0) }, []),
212
+ tool("def", "Find definitions", { ...path, ...lang, ...gitScopeSchema, ...noAnchors, name: string(PARAM_DESCRIPTIONS.name) }, ["name"]),
213
+ tool("refs", "Find references", { ...path, ...at, ...lang, ...gitScopeSchema, ...noAnchors, name: string(PARAM_DESCRIPTIONS.refsName) }, []),
214
+ tool("edit", "Hash-verified edit", { ...path, ...lang, ...gitScopeSchema, ...apply, edits: { type: "array", minItems: 1, items: editItemSchema, description: PARAM_DESCRIPTIONS.edits }, postEditVerify: { type: "boolean", description: PARAM_DESCRIPTIONS.postEditVerify } }, ["path", "edits"]),
215
+ tool("rename", "Rename symbol", { ...path, ...at, ...lang, ...gitScopeSchema, ...apply, to: string(PARAM_DESCRIPTIONS.to), workspace: { type: "boolean", description: PARAM_DESCRIPTIONS.workspace } }, ["path", "at", "to"]),
216
+ tool("write", "Write file", { ...path, content: string(PARAM_DESCRIPTIONS.content) }, ["path", "content"])
217
217
  ];
218
218
  function getToolContract(name) {
219
219
  const contract = TOOL_CONTRACTS.find((entry) => entry.name === name);
@@ -224,70 +224,70 @@ function getToolContract(name) {
224
224
  // src/policy.ts
225
225
  var REPLACEABLE_TOOLS = [
226
226
  {
227
- tool: "show_content",
227
+ tool: "show",
228
228
  builtIn: "read",
229
229
  benefit: "it returns LINE:HASH anchors for safe edits."
230
230
  },
231
231
  {
232
- tool: "edit_text",
232
+ tool: "edit",
233
233
  builtIn: "edit",
234
234
  benefit: "it verifies fresh LINE:HASH anchors."
235
235
  },
236
236
  {
237
- tool: "find_text",
237
+ tool: "grep",
238
238
  builtIn: "grep",
239
239
  benefit: "it returns LINE:HASH anchors."
240
240
  },
241
241
  {
242
- tool: "write_file",
242
+ tool: "write",
243
243
  builtIn: "write",
244
244
  benefit: "it returns LINE:HASH anchors."
245
245
  }
246
246
  ];
247
247
  var TOOL_COMPACT_GUIDELINES = {
248
- show_content: [
249
- "Use `show_structure` for shallow overviews and `check_syntax` for diagnostics; use `find_definitions`, `find_references`, or `find_nodes` for targeted symbol questions."
248
+ show: [
249
+ "Use `tree` for shallow overviews and `syntax` for diagnostics; use `def`, `refs`, or `search` for targeted symbol questions."
250
250
  ],
251
- edit_text: [
251
+ edit: [
252
252
  "Prefer set_line, replace_lines, and insert_after; use replace only when anchors are impractical."
253
253
  ],
254
- find_text: [
255
- "Use `find_text` with summary first for broad searches, then narrow by path, glob, or pattern."
254
+ grep: [
255
+ "Use `grep` with summary first for broad searches, then narrow by path, glob, or pattern."
256
256
  ],
257
- write_file: [
258
- "Use anchored edits rather than `write_file` for small changes or appends."
257
+ write: [
258
+ "Use anchored edits rather than `write` for small changes or appends."
259
259
  ],
260
- find_nodes: [
261
- "Use `find_nodes` for AST patterns; use `find_text` for plain text."
260
+ search: [
261
+ "Use `search` for AST patterns; use `grep` for plain text."
262
262
  ],
263
- find_references: [
264
- "Use `find_references` before changing a symbol; use at with line:N:C to follow one binding."
263
+ refs: [
264
+ "Use `refs` before changing a symbol; use at with line:N:C to follow one binding."
265
265
  ]
266
266
  };
267
267
  var BUILTIN_FALLBACKS = {
268
- read: "show_content",
269
- edit: "edit_text",
270
- write: "write_file",
271
- grep: "find_text",
272
- apply_patch: "edit_text"
268
+ read: "show",
269
+ edit: "edit",
270
+ write: "write",
271
+ grep: "grep",
272
+ apply_patch: "edit"
273
273
  };
274
274
  var PREFERENCE_LEADS = {
275
- show_content: "Preferred for reading source with anchors.",
276
- edit_text: "Preferred for editing existing text files with fresh LINE:HASH anchors.",
277
- write_file: "Preferred for creating or replacing a complete text file; returns LINE:HASH anchors.",
278
- find_text: "Preferred text/regex search; returns edit-ready LINE:HASH anchors.",
279
- find_nodes: "Preferred for AST or structural code search with ast-grep-style patterns.",
280
- find_definitions: "Preferred for go-to-definition or declaration lookup by name.",
281
- find_references: "Preferred for finding identifier-name matches or binding-specific references before rename_symbol or delete.",
282
- rename_symbol: "Preferred for renaming a symbol with binding-aware, verified edits.",
283
- show_assets: "Preferred for materializing selected document assets with usable cached paths."
275
+ show: "Preferred for reading source with anchors.",
276
+ edit: "Preferred for editing existing text files with fresh LINE:HASH anchors.",
277
+ write: "Preferred for creating or replacing a complete text file; returns LINE:HASH anchors.",
278
+ grep: "Preferred text/regex search; returns edit-ready LINE:HASH anchors.",
279
+ search: "Preferred for AST or structural code search with ast-grep-style patterns.",
280
+ def: "Preferred for go-to-definition or declaration lookup by name.",
281
+ refs: "Preferred for finding identifier-name matches or binding-specific references before `rename` or delete.",
282
+ rename: "Preferred for renaming a symbol with binding-aware, verified edits.",
283
+ assets: "Preferred for materializing selected document assets with usable cached paths."
284
284
  };
285
285
  var FALLBACK_TEMPLATES = {
286
- read: "Prefer `show_content` with fresh LINE:HASH anchors.",
287
- edit: "Prefer `edit_text` with fresh LINE:HASH anchors.",
288
- write: "Prefer `write_file` so the result returns LINE:HASH anchors.",
289
- grep: "Prefer `find_text` for text/regex search with edit-ready anchors.",
290
- apply_patch: "Prefer `edit_text` for existing text files."
286
+ read: "Prefer `show` with fresh LINE:HASH anchors.",
287
+ edit: "Prefer `edit` with fresh LINE:HASH anchors.",
288
+ write: "Prefer `write` so the result returns LINE:HASH anchors.",
289
+ grep: "Prefer `grep` for text/regex search with edit-ready anchors.",
290
+ apply_patch: "Prefer `edit` for existing text files."
291
291
  };
292
292
  function resolveToolName(name, aliases = {}) {
293
293
  return aliases[name] ?? name;
@@ -306,21 +306,21 @@ function renderFallbackToolDescription(builtIn, aliases = {}) {
306
306
  }
307
307
  function renderToolRoutingPolicy(options = {}) {
308
308
  const aliases = options.aliases ?? {};
309
- const show_content = resolveToolName("show_content", aliases);
310
- const edit_text = resolveToolName("edit_text", aliases);
311
- const write_file = resolveToolName("write_file", aliases);
312
- const find_text = resolveToolName("find_text", aliases);
313
- const find_nodes = resolveToolName("find_nodes", aliases);
314
- const find_definitions = resolveToolName("find_definitions", aliases);
315
- const find_references = resolveToolName("find_references", aliases);
316
- const rename_symbol = resolveToolName("rename_symbol", aliases);
317
- const show_assets = resolveToolName("show_assets", aliases);
309
+ const show = resolveToolName("show", aliases);
310
+ const edit = resolveToolName("edit", aliases);
311
+ const write = resolveToolName("write", aliases);
312
+ const grep = resolveToolName("grep", aliases);
313
+ const search = resolveToolName("search", aliases);
314
+ const def = resolveToolName("def", aliases);
315
+ const refs = resolveToolName("refs", aliases);
316
+ const rename = resolveToolName("rename", aliases);
317
+ const assets = resolveToolName("assets", aliases);
318
318
  const title = options.title ?? "ReadSeek tool policy:";
319
319
  const bullets = [];
320
320
  if (options.preferOverBuiltIns) {
321
321
  bullets.push("- Prefer ReadSeek tools over built-ins when they can do the job.");
322
322
  }
323
- bullets.push(`- Read with ${show_content} first; ${edit_text} needs fresh LINE:HASH anchors.`, `- Use ${find_text} for text/regex, ${find_nodes} for AST patterns, ${find_definitions}/${find_references} for targeted symbols, and shallow ${resolveToolName("show_structure", aliases)} structures only for file overviews.`, `- Use ${edit_text} for existing files, ${write_file} for whole-file creation or replacement, and ${rename_symbol} for symbol renames.`, `- Use ${resolveToolName("show_structure", aliases)} for document structure; run ${resolveToolName("check_syntax", aliases)} after source edits for a quick syntax check.`, `- Use ${show_assets} to materialize selected document assets and read their returned paths.`);
323
+ bullets.push(`- Read with ${show} first; ${edit} needs fresh LINE:HASH anchors.`, `- Use ${grep} for text/regex, ${search} for AST patterns, ${def}/${refs} for targeted symbols, and shallow ${resolveToolName("tree", aliases)} structures only for file overviews.`, `- Use ${edit} for existing files, ${write} for whole-file creation or replacement, and ${rename} for symbol renames.`, `- Use ${resolveToolName("tree", aliases)} for document structure; run ${resolveToolName("syntax", aliases)} after source edits for a quick syntax check.`, `- Use ${assets} to materialize selected document assets and read their returned paths.`);
324
324
  if (options.demoteBuiltIns && options.demoteBuiltIns.length > 0) {
325
325
  bullets.push(`- Do not use built-in ${options.demoteBuiltIns.join(", ")} when a ReadSeek tool can do the job.`);
326
326
  }
@@ -530,50 +530,111 @@ var SELECTOR_KINDS = ["line", "hash", "symbol", "page", "node", "asset"];
530
530
  function isSelectorKind(value) {
531
531
  return SELECTOR_KINDS.includes(value);
532
532
  }
533
+ function parsePositiveSelectorInt(raw, name) {
534
+ if (!/^-?\d+$/.test(raw))
535
+ throw new Error(`invalid ${name} \`${raw}\``);
536
+ const parsed = Number(raw);
537
+ if (!Number.isSafeInteger(parsed))
538
+ throw new Error(`invalid ${name} \`${raw}\``);
539
+ if (parsed < 1)
540
+ throw new Error(`${name} must be greater than zero`);
541
+ return parsed;
542
+ }
543
+ function parseLineSelector(value, explicitKind) {
544
+ const parts = value.split(":");
545
+ if (parts.length > 2)
546
+ throw new Error("selector has too many components");
547
+ const head = parts[0];
548
+ if (parts.length === 2) {
549
+ if (head.slice(1).includes("-"))
550
+ throw new Error("line range cannot include a column");
551
+ const line = parsePositiveSelectorInt(head, "line");
552
+ const column = parsePositiveSelectorInt(parts[1], "column");
553
+ return { kind: "line", value: String(line), column, explicitKind };
554
+ }
555
+ const dash = head.indexOf("-", 1);
556
+ if (dash > 0) {
557
+ const start = parsePositiveSelectorInt(head.slice(0, dash), "line");
558
+ const endLine = parsePositiveSelectorInt(head.slice(dash + 1), "end line");
559
+ if (endLine < start)
560
+ throw new Error(`end line ${endLine} precedes start line ${start}`);
561
+ return { kind: "line", value: String(start), endLine, explicitKind };
562
+ }
563
+ const line = parsePositiveSelectorInt(head, "line");
564
+ return { kind: "line", value: String(line), explicitKind };
565
+ }
566
+ function parseHashSelector(value, explicitKind) {
567
+ const parts = value.split(":");
568
+ if (parts.length > 2)
569
+ throw new Error("selector has too many components");
570
+ const head = parts[0];
571
+ if (!/^[0-9a-fA-F]{6}$/.test(head))
572
+ throw new Error(`invalid line hash \`${head}\``);
573
+ if (parts.length === 2) {
574
+ const column = parsePositiveSelectorInt(parts[1], "column");
575
+ return { kind: "hash", value: head, column, explicitKind };
576
+ }
577
+ return { kind: "hash", value: head, explicitKind };
578
+ }
579
+ function isDocumentSelector(parsed) {
580
+ return ["page", "node", "asset"].includes(parsed.kind) || parsed.kind === "line" && !parsed.explicitKind && parsed.column === undefined && parsed.endLine === undefined;
581
+ }
582
+ function isBindingSelector(parsed) {
583
+ if (parsed.endLine !== undefined)
584
+ return false;
585
+ if (parsed.kind === "line" || parsed.kind === "hash")
586
+ return true;
587
+ return parsed.kind === "symbol" && !parsed.explicitKind && /^[0-9a-fA-F]{6}$/.test(parsed.value);
588
+ }
533
589
  function parseSelector(text) {
590
+ if (text.length === 0)
591
+ throw new Error("selector must not be empty");
534
592
  const separator = text.indexOf(":");
535
- if (separator < 0) {
536
- throw new Error("selector must start with line:, hash:, symbol:, page:, node:, or asset:");
537
- }
538
- const kind = text.slice(0, separator);
539
- const value = text.slice(separator + 1);
540
- if (value.length === 0)
541
- throw new Error(`${kind} selector must not be empty`);
542
- if (!isSelectorKind(kind)) {
593
+ const hasSingleColon = separator >= 0 && text[separator + 1] !== ":";
594
+ if (hasSingleColon) {
595
+ const kind = text.slice(0, separator);
596
+ const value = text.slice(separator + 1);
597
+ if (isSelectorKind(kind)) {
598
+ if (value.length === 0)
599
+ throw new Error(`${kind} selector must not be empty`);
600
+ if (kind === "line")
601
+ return parseLineSelector(value, true);
602
+ if (kind === "hash")
603
+ return parseHashSelector(value, true);
604
+ if (kind === "page") {
605
+ if (value.includes(":"))
606
+ throw new Error("page selector has too many components");
607
+ parsePositiveSelectorInt(value, "page");
608
+ }
609
+ return { kind, value, explicitKind: true };
610
+ }
611
+ if (/^\d+$/.test(kind))
612
+ return parseLineSelector(text, false);
613
+ if (/^[0-9a-fA-F]{6}$/.test(kind) && /^\d+$/.test(value))
614
+ return parseHashSelector(text, false);
543
615
  throw new Error(`unknown selector kind \`${kind}\`; expected line, hash, symbol, page, node, or asset`);
544
616
  }
545
- if (kind === "line" || kind === "hash") {
546
- const parts = value.split(":");
547
- if (parts.length > 2)
548
- throw new Error("selector has too many components");
549
- if (parts.length === 2) {
550
- const column = Number(parts[1]);
551
- if (!Number.isSafeInteger(column))
552
- throw new Error(`invalid column \`${parts[1]}\``);
553
- if (column < 1)
554
- throw new Error("column must be greater than zero");
555
- return { kind, value: parts[0], column };
617
+ if (/^[0-9-]/.test(text)) {
618
+ if (/^[0-9a-fA-F]{6}$/.test(text) && /[a-fA-F]/.test(text)) {
619
+ return parseHashSelector(text, false);
556
620
  }
621
+ return parseLineSelector(text, false);
557
622
  }
558
- if (kind === "page") {
559
- if (value.includes(":"))
560
- throw new Error("page selector has too many components");
561
- const page = Number(value);
562
- if (!Number.isSafeInteger(page))
563
- throw new Error(`invalid page \`${value}\``);
564
- if (page < 1)
565
- throw new Error("page must be greater than zero");
623
+ if (/^[0-9a-fA-F]{6}$/.test(text) && /\d/.test(text)) {
624
+ return parseHashSelector(text, false);
566
625
  }
567
- return { kind, value };
626
+ if (/\s/.test(text))
627
+ throw new Error(`invalid selector \`${text}\``);
628
+ return { kind: "symbol", value: text, explicitKind: false };
568
629
  }
569
- function start(verb, object, input) {
630
+ function start(command, input) {
570
631
  if (!input.path)
571
- throw new Error(`${verb} ${object} requires a path`);
632
+ throw new Error(`${command} requires a path`);
572
633
  if (input.stdinName !== undefined && input.path !== "-")
573
634
  throw new Error("stdinName requires '-' as the target");
574
635
  const args = [];
575
636
  pushOptionalString(args, "--readseek-dir", input.readseekDir);
576
- args.push(verb, object, input.path);
637
+ args.push(command, input.path);
577
638
  pushOptionalString(args, "--stdin-name", input.stdinName);
578
639
  return args;
579
640
  }
@@ -599,12 +660,12 @@ function anchors(args, input) {
599
660
  if (input.noAnchors)
600
661
  args.push("--no-anchors");
601
662
  }
602
- function buildShowContentArgs(input) {
663
+ function buildShowArgs(input) {
603
664
  if (input.end !== undefined)
604
665
  validatePositiveInteger(input.end, "end");
605
666
  if (input.end !== undefined && input.limit !== undefined)
606
667
  throw new Error("cannot combine end with limit");
607
- const args = start("show", "content", input);
668
+ const args = start("show", input);
608
669
  at2(args, input.at);
609
670
  pushOptionalNumber(args, "--end", input.end);
610
671
  limit2(args, input.limit);
@@ -612,10 +673,10 @@ function buildShowContentArgs(input) {
612
673
  anchors(args, input);
613
674
  return finish(args);
614
675
  }
615
- function buildShowStructureArgs(input) {
676
+ function buildTreeArgs(input) {
616
677
  if (input.depth !== undefined && (!Number.isSafeInteger(input.depth) || input.depth < 0))
617
678
  throw new Error("depth must be a non-negative integer");
618
- const args = start("show", "structure", input);
679
+ const args = start("tree", input);
619
680
  at2(args, input.at);
620
681
  pushOptionalNumber(args, "--depth", input.depth);
621
682
  pushOptionalString(args, "--kind", input.kind);
@@ -624,35 +685,35 @@ function buildShowStructureArgs(input) {
624
685
  args.push("--outline");
625
686
  return finish(args);
626
687
  }
627
- function buildShowMetadataArgs(input) {
628
- const args = start("show", "metadata", input);
688
+ function buildMetaArgs(input) {
689
+ const args = start("meta", input);
629
690
  language(args, input);
630
691
  return finish(args);
631
692
  }
632
- function buildShowAssetsArgs(input) {
633
- if (input.at !== undefined && !["page", "node", "asset"].includes(parseSelector(input.at).kind))
693
+ function buildAssetsArgs(input) {
694
+ if (input.at !== undefined && !isDocumentSelector(parseSelector(input.at)))
634
695
  throw new Error("assets requires a page, node, or asset selector");
635
- const args = start("show", "assets", input);
696
+ const args = start("assets", input);
636
697
  at2(args, input.at);
637
698
  return finish(args);
638
699
  }
639
- function buildCheckSyntaxArgs(input) {
640
- const args = start("check", "syntax", input);
700
+ function buildSyntaxArgs(input) {
701
+ const args = start("syntax", input);
641
702
  language(args, input);
642
703
  return finish(args);
643
704
  }
644
- function visionArgs(verb, object, input) {
705
+ function visionArgs(command, input) {
645
706
  if (input.level !== undefined && !VISION_LEVELS.includes(input.level))
646
707
  throw new Error("invalid vision level");
647
- if (input.at !== undefined && !["page", "node", "asset"].includes(parseSelector(input.at).kind))
708
+ if (input.at !== undefined && !isDocumentSelector(parseSelector(input.at)))
648
709
  throw new Error("vision requires a document selector");
649
- const args = start(verb, object, input);
710
+ const args = start(command, input);
650
711
  at2(args, input.at);
651
712
  pushOptionalString(args, "--level", input.level);
652
713
  return args;
653
714
  }
654
- function buildGenerateCaptionArgs(input) {
655
- const args = visionArgs("generate", "caption", input);
715
+ function buildCaptionArgs(input) {
716
+ const args = visionArgs("caption", input);
656
717
  if (input.include !== undefined) {
657
718
  if (input.include.length === 0 || input.include.some((task) => task !== "text" && task !== "objects"))
658
719
  throw new Error("include requires text or objects");
@@ -660,13 +721,13 @@ function buildGenerateCaptionArgs(input) {
660
721
  }
661
722
  return finish(args);
662
723
  }
663
- function buildDetectObjectsArgs(input) {
664
- return finish(visionArgs("detect", "objects", input));
724
+ function buildObjectsArgs(input) {
725
+ return finish(visionArgs("objects", input));
665
726
  }
666
- function buildRecognizeTextArgs(input) {
667
- return finish(visionArgs("recognize", "text", input));
727
+ function buildOcrArgs(input) {
728
+ return finish(visionArgs("ocr", input));
668
729
  }
669
- function buildFindNodesArgs(input) {
730
+ function buildSearchArgs(input) {
670
731
  const hasPattern = Boolean(input.pattern);
671
732
  const hasRule = Boolean(input.rule);
672
733
  const hasContext = Boolean(input.context);
@@ -674,7 +735,7 @@ function buildFindNodesArgs(input) {
674
735
  if (hasPattern || hasContext || input.selector)
675
736
  throw new Error("rule cannot be combined with pattern, context, or selector");
676
737
  } else if (!hasPattern && !hasContext) {
677
- throw new Error("find nodes requires pattern, context, or rule");
738
+ throw new Error("search requires pattern, context, or rule");
678
739
  }
679
740
  if (hasContext && !input.selector) {
680
741
  throw new Error("context requires selector");
@@ -682,7 +743,7 @@ function buildFindNodesArgs(input) {
682
743
  if (hasPattern && hasContext) {
683
744
  throw new Error("pattern and context cannot be combined");
684
745
  }
685
- const args = start("find", "nodes", input);
746
+ const args = start("search", input);
686
747
  pushOptionalString(args, "--pattern", input.pattern);
687
748
  pushOptionalString(args, "--context", input.context);
688
749
  pushOptionalString(args, "--selector", input.selector);
@@ -693,28 +754,28 @@ function buildFindNodesArgs(input) {
693
754
  anchors(args, input);
694
755
  return finish(args);
695
756
  }
696
- function buildFindTextArgs(input) {
697
- const args = start("find", "text", input);
757
+ function buildGrepArgs(input) {
758
+ const args = start("grep", input);
698
759
  args.push("--text", input.text);
699
760
  limit2(args, input.limit);
700
761
  appendGitScopeArgs(args, input);
701
762
  return finish(args);
702
763
  }
703
- function buildFindDefinitionsArgs(input) {
704
- const args = start("find", "definitions", input);
764
+ function buildDefArgs(input) {
765
+ const args = start("def", input);
705
766
  args.push("--name", input.name);
706
767
  language(args, input);
707
768
  appendGitScopeArgs(args, input);
708
769
  anchors(args, input);
709
770
  return finish(args);
710
771
  }
711
- function buildFindReferencesArgs(input) {
772
+ function buildRefsArgs(input) {
712
773
  const validated = validateReferencesSelection(input);
713
774
  if (!validated.ok)
714
775
  throw new Error(validated.error);
715
- if (input.at !== undefined && !["line", "hash"].includes(parseSelector(input.at).kind))
776
+ if (input.at !== undefined && !isBindingSelector(parseSelector(input.at)))
716
777
  throw new Error("references requires a line or hash selector");
717
- const args = start("find", "references", input);
778
+ const args = start("refs", input);
718
779
  pushOptionalString(args, "--name", input.name);
719
780
  at2(args, input.at);
720
781
  language(args, input);
@@ -722,14 +783,14 @@ function buildFindReferencesArgs(input) {
722
783
  anchors(args, input);
723
784
  return finish(args);
724
785
  }
725
- function buildCheckRulesArgs(input) {
726
- const args = start("check", "rules", input);
786
+ function buildCheckArgs(input) {
787
+ const args = start("check", input);
727
788
  args.push("--rules", input.rules);
728
789
  appendGitScopeArgs(args, input);
729
790
  return finish(args);
730
791
  }
731
- function buildEditTextArgs(input) {
732
- const args = start("edit", "text", input);
792
+ function buildEditArgs(input) {
793
+ const args = start("edit", input);
733
794
  appendApplyAndPlanHash(args, input);
734
795
  language(args, input);
735
796
  appendGitScopeArgs(args, input);
@@ -737,10 +798,10 @@ function buildEditTextArgs(input) {
737
798
  args.push("--edits", "-");
738
799
  return finish(args);
739
800
  }
740
- function buildRenameSymbolArgs(input) {
741
- if (!["line", "hash"].includes(parseSelector(input.at).kind))
801
+ function buildRenameArgs(input) {
802
+ if (!isBindingSelector(parseSelector(input.at)))
742
803
  throw new Error("rename requires a line or hash selector");
743
- const args = start("rename", "symbol", input);
804
+ const args = start("rename", input);
744
805
  at2(args, input.at);
745
806
  args.push("--to", input.to);
746
807
  if (input.workspace !== undefined)
@@ -1271,71 +1332,71 @@ function runOptions(options, vision = false) {
1271
1332
  }
1272
1333
  function createReadSeekClient(runner) {
1273
1334
  return {
1274
- async showContent(path, options = {}) {
1275
- const value = await runner.kdl(buildShowContentArgs({ ...options, path }), runOptions(options));
1335
+ async show(path, options = {}) {
1336
+ const value = await runner.kdl(buildShowArgs({ ...options, path }), runOptions(options));
1276
1337
  return parseContentOutput(value);
1277
1338
  },
1278
- async showStructure(path, options = {}) {
1279
- const value = await runner.kdl(buildShowStructureArgs({ ...options, path }), runOptions(options));
1339
+ async tree(path, options = {}) {
1340
+ const value = await runner.kdl(buildTreeArgs({ ...options, path }), runOptions(options));
1280
1341
  return parseStructureEnvelope(value);
1281
1342
  },
1282
- async showMetadata(path, options = {}) {
1283
- const value = await runner.kdl(buildShowMetadataArgs({ ...options, path }), runOptions(options));
1343
+ async meta(path, options = {}) {
1344
+ const value = await runner.kdl(buildMetaArgs({ ...options, path }), runOptions(options));
1284
1345
  return parsePdfMetadata(value) ?? parseDetectOutput(value?.metadata);
1285
1346
  },
1286
- async showAssets(path, options = {}) {
1287
- const value = await runner.kdl(buildShowAssetsArgs({ ...options, path }), runOptions(options));
1347
+ async assets(path, options = {}) {
1348
+ const value = await runner.kdl(buildAssetsArgs({ ...options, path }), runOptions(options));
1288
1349
  return parseAssetsOutput(value);
1289
1350
  },
1290
- async checkSyntax(path, options = {}) {
1291
- const value = await runner.kdl(buildCheckSyntaxArgs({ ...options, path }), runOptions(options));
1351
+ async syntax(path, options = {}) {
1352
+ const value = await runner.kdl(buildSyntaxArgs({ ...options, path }), runOptions(options));
1292
1353
  return parseCheckOutput(value?.diagnostics ?? value);
1293
1354
  },
1294
- async checkRules(path, options) {
1295
- const value = await runner.kdl(buildCheckRulesArgs({ ...options, path }), runOptions(options));
1355
+ async check(path, options) {
1356
+ const value = await runner.kdl(buildCheckArgs({ ...options, path }), runOptions(options));
1296
1357
  return parseRulesOutput(value);
1297
1358
  },
1298
- async generateCaption(path, options = {}) {
1299
- const value = await runner.kdl(buildGenerateCaptionArgs({ ...options, path }), runOptions(options, true));
1359
+ async caption(path, options = {}) {
1360
+ const value = await runner.kdl(buildCaptionArgs({ ...options, path }), runOptions(options, true));
1300
1361
  return parseContentOutput(value);
1301
1362
  },
1302
- async detectObjects(path, options = {}) {
1303
- const value = await runner.kdl(buildDetectObjectsArgs({ ...options, path }), runOptions(options, true));
1363
+ async objects(path, options = {}) {
1364
+ const value = await runner.kdl(buildObjectsArgs({ ...options, path }), runOptions(options, true));
1304
1365
  return parseContentOutput(value);
1305
1366
  },
1306
- async recognizeText(path, options = {}) {
1307
- const value = await runner.kdl(buildRecognizeTextArgs({ ...options, path }), runOptions(options, true));
1367
+ async ocr(path, options = {}) {
1368
+ const value = await runner.kdl(buildOcrArgs({ ...options, path }), runOptions(options, true));
1308
1369
  return parseContentOutput(value);
1309
1370
  },
1310
- async findNodes(path, options) {
1311
- const value = await runner.kdl(buildFindNodesArgs({ ...options, path }), runOptions(options));
1371
+ async search(path, options) {
1372
+ const value = await runner.kdl(buildSearchArgs({ ...options, path }), runOptions(options));
1312
1373
  return parseSearchOutput(value);
1313
1374
  },
1314
- async findText(path, options) {
1315
- const value = await runner.kdl(buildFindTextArgs({ ...options, path }), runOptions(options));
1375
+ async grep(path, options) {
1376
+ const value = await runner.kdl(buildGrepArgs({ ...options, path }), runOptions(options));
1316
1377
  return parseTextSearchOutput(value);
1317
1378
  },
1318
- async findDefinitions(path, options) {
1319
- const value = await runner.kdl(buildFindDefinitionsArgs({ ...options, path }), runOptions(options));
1379
+ async def(path, options) {
1380
+ const value = await runner.kdl(buildDefArgs({ ...options, path }), runOptions(options));
1320
1381
  return parseDefOutput(value);
1321
1382
  },
1322
- async findReferences(path, options) {
1323
- const value = await runner.kdl(buildFindReferencesArgs({ ...options, path }), runOptions(options));
1383
+ async refs(path, options) {
1384
+ const value = await runner.kdl(buildRefsArgs({ ...options, path }), runOptions(options));
1324
1385
  return parseRefsOutput(value);
1325
1386
  },
1326
- async editText(path, edits, options = {}) {
1387
+ async edit(path, edits, options = {}) {
1327
1388
  const stdin = serializeEditPlan(edits);
1328
- return parseEditOutput(await runner.kdl(buildEditTextArgs({ ...options, path, requestFromStdin: true }), runOptions({ ...options, stdin })));
1389
+ return parseEditOutput(await runner.kdl(buildEditArgs({ ...options, path, requestFromStdin: true }), runOptions({ ...options, stdin })));
1329
1390
  },
1330
- async renameSymbol(path, options) {
1331
- const value = await runner.kdl(buildRenameSymbolArgs({ ...options, path }), runOptions(options));
1391
+ async rename(path, options) {
1392
+ const value = await runner.kdl(buildRenameArgs({ ...options, path }), runOptions(options));
1332
1393
  return parseRenameOutput(value);
1333
1394
  }
1334
1395
  };
1335
1396
  }
1336
1397
  // src/show-presentation.ts
1337
1398
  function isShowTool(name) {
1338
- return name === "show_content" || name === "show_structure" || name === "show_metadata" || name === "show_assets";
1399
+ return name === "show" || name === "tree" || name === "meta" || name === "assets";
1339
1400
  }
1340
1401
  function record(value) {
1341
1402
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
@@ -1450,7 +1511,7 @@ function presentShowResult(tool, value, options = {}) {
1450
1511
  const path = inline(options.path || output.source || output.file || content.file || structure.file || metadata.file || cursor.file) || "(unknown path)";
1451
1512
  const summary = [];
1452
1513
  const result = { summary: "", body: "", notices: [], metadata: {} };
1453
- if (tool === "show_metadata") {
1514
+ if (tool === "meta") {
1454
1515
  const data = Object.keys(metadata).length > 0 ? metadata : output;
1455
1516
  if (text(data.format || data.language || data.type))
1456
1517
  summary.push(inline(data.format || data.language || data.type));
@@ -1459,7 +1520,7 @@ function presentShowResult(tool, value, options = {}) {
1459
1520
  summary.push(plural(result.metadata.pages, "page"));
1460
1521
  }
1461
1522
  result.body = fields(data) || "No metadata available.";
1462
- } else if (tool === "show_assets") {
1523
+ } else if (tool === "assets") {
1463
1524
  const assets = records(output.assets);
1464
1525
  result.metadata.assets = assets.length;
1465
1526
  summary.push(plural(assets.length, "asset"));
@@ -1473,7 +1534,7 @@ function presentShowResult(tool, value, options = {}) {
1473
1534
  summary.push(plural(nodes.length, "node"));
1474
1535
  if (result.metadata.pages !== undefined)
1475
1536
  summary.push(plural(result.metadata.pages, "page"));
1476
- const sections = [text(output.title) ? safe(text(output.title)) : "", documentNodes(nodes, tool === "show_content")];
1537
+ const sections = [text(output.title) ? safe(text(output.title)) : "", documentNodes(nodes, tool === "show")];
1477
1538
  if (assets.length > 0) {
1478
1539
  result.metadata.assets = assets.length;
1479
1540
  sections.push(`Assets
@@ -1482,7 +1543,7 @@ ${assetList(assets)}`);
1482
1543
  result.body = sections.filter(Boolean).join(`
1483
1544
 
1484
1545
  `) || "No content in this selection.";
1485
- } else if (tool === "show_structure") {
1546
+ } else if (tool === "tree") {
1486
1547
  const symbols = records(structure.symbols);
1487
1548
  result.metadata.symbols = symbols.length;
1488
1549
  summary.push(plural(symbols.length, "symbol"));
@@ -1536,7 +1597,7 @@ ${assetList(assets)}`);
1536
1597
  const description = Object.keys(content).length > 0 ? content : output;
1537
1598
  result.body = fields(description) || "No content in this selection.";
1538
1599
  }
1539
- if (tool === "show_structure")
1600
+ if (tool === "tree")
1540
1601
  result.notices.push("Structure is limited to the requested depth, kind, and outline. Use a deeper depth or focus with at to inspect further.");
1541
1602
  if (text(output.warning))
1542
1603
  result.notices.push(safe(text(output.warning)));
@@ -2049,7 +2110,7 @@ function acceptsReadSeekExitCode(args, exitCode) {
2049
2110
  index++;
2050
2111
  continue;
2051
2112
  }
2052
- return arg === "find" || arg === "check";
2113
+ return arg === "grep" || arg === "search" || arg === "def" || arg === "refs" || arg === "syntax" || arg === "check";
2053
2114
  }
2054
2115
  return false;
2055
2116
  }
@@ -2285,22 +2346,22 @@ export {
2285
2346
  acceptsReadSeekExitCode,
2286
2347
  appendApplyAndPlanHash,
2287
2348
  appendGitScopeArgs,
2288
- buildCheckRulesArgs,
2289
- buildCheckSyntaxArgs,
2290
- buildDetectObjectsArgs,
2291
- buildEditTextArgs,
2292
- buildFindDefinitionsArgs,
2293
- buildFindNodesArgs,
2294
- buildFindReferencesArgs,
2295
- buildFindTextArgs,
2296
- buildGenerateCaptionArgs,
2349
+ buildAssetsArgs,
2350
+ buildCaptionArgs,
2351
+ buildCheckArgs,
2352
+ buildDefArgs,
2353
+ buildEditArgs,
2354
+ buildGrepArgs,
2297
2355
  buildLineLocation,
2298
- buildRecognizeTextArgs,
2299
- buildRenameSymbolArgs,
2300
- buildShowAssetsArgs,
2301
- buildShowContentArgs,
2302
- buildShowMetadataArgs,
2303
- buildShowStructureArgs,
2356
+ buildMetaArgs,
2357
+ buildObjectsArgs,
2358
+ buildOcrArgs,
2359
+ buildRefsArgs,
2360
+ buildRenameArgs,
2361
+ buildSearchArgs,
2362
+ buildShowArgs,
2363
+ buildSyntaxArgs,
2364
+ buildTreeArgs,
2304
2365
  canonicalPathKey,
2305
2366
  classifyReadSeekFailure,
2306
2367
  cleanReadSeekErrorText,
@@ -1,4 +1,4 @@
1
- export type ShowTool = "show_content" | "show_structure" | "show_metadata" | "show_assets";
1
+ export type ShowTool = "show" | "tree" | "meta" | "assets";
2
2
  export interface ShowPresentation {
3
3
  summary: string;
4
4
  body: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jarkkojs/readseek-api",
3
- "version": "0.11.3",
3
+ "version": "0.12.0",
4
4
  "description": "Shared ReadSeek CLI contract, validation, argv builders, and bounded process runners",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -51,7 +51,7 @@
51
51
  "vitest": "^4.1.0"
52
52
  },
53
53
  "dependencies": {
54
- "@jarkkojs/readseek": "^0.11.3",
54
+ "@jarkkojs/readseek": "^0.12.0",
55
55
  "@bgotink/kdl": "0.4.0",
56
56
  "@sinclair/typebox": "0.34.52"
57
57
  }