pi-readseek 0.8.23 → 0.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-readseek",
3
- "version": "0.8.23",
3
+ "version": "0.9.0",
4
4
  "description": "Pi extension for LINE:HASH-anchored file operations and structural code navigation",
5
5
  "type": "module",
6
6
  "exports": {
@@ -40,7 +40,7 @@
40
40
  "node": ">=20.0.0"
41
41
  },
42
42
  "dependencies": {
43
- "@jarkkojs/readseek": "^0.8.23",
43
+ "@jarkkojs/readseek": "^0.9.0",
44
44
  "diff": "^9.0.0",
45
45
  "xxhash-wasm": "^1.1.0"
46
46
  },
package/prompts/def.md CHANGED
@@ -8,4 +8,7 @@ Go to a symbol definition or declaration by name. Accepts qualified or unqualifi
8
8
  - `cached`, `others`, `ignored` — Git file selection; `ignored` requires
9
9
  `others`.
10
10
 
11
- After `readSeek_hover`, use `identifier.text` for the token under the cursor. Use `symbol.qualified_name` only when intentionally navigating to the enclosing declaration.
11
+ After `readSeek_digest` with `select: "identity"`, use
12
+ `identity.identifier.text` for the token under the cursor. Use
13
+ `identity.symbol.qualified_name` only when intentionally navigating to the
14
+ enclosing declaration.
@@ -0,0 +1,37 @@
1
+ Digest source content and images into the native CLI envelope. Returns `metadata` plus requested facets unchanged from `readseek digest`.
2
+
3
+ Use this instead of separate hover/check/map tools: identity at a cursor,
4
+ diagnostics after edits, or a structural map.
5
+
6
+ ## Parameters
7
+
8
+ - `path` — file path.
9
+ - `select` — facets: `metadata`, `content`, `map`, `diagnostics`, `identity`.
10
+ Accepts one facet, an array, or a comma-separated string. Default `content`.
11
+ - `at` — location: `line:N[:COLUMN]`, `hash:HASH[:COLUMN]`, or `symbol:NAME`.
12
+ - `end` — last line to include (with content).
13
+ - `limit` — maximum lines to include (with content).
14
+ - `language` — language override when detection is ambiguous.
15
+ - `visionMode` — standalone image mode: `none`, `all`, `ocr`, `caption`, or
16
+ `objects`.
17
+ - `visionLevel` — vision inference level: `low` (default), `medium`, or `high`;
18
+ requires `visionMode`.
19
+
20
+ ## Facets
21
+
22
+ | select | Purpose |
23
+ | -------------- | ---------------------------------------------------- |
24
+ | `metadata` | File kind, language, and engine |
25
+ | `content` | Anchored text or prepared/analyzed image payload |
26
+ | `map` | Structural symbol outline |
27
+ | `diagnostics` | Parser errors and missing syntax nodes |
28
+ | `identity` | Token and enclosing symbol at `at` |
29
+
30
+ Combine facets with a comma or array, e.g. `map,diagnostics` or
31
+ `["identity"]` with `at: "line:12:4"`.
32
+
33
+ ## Output
34
+
35
+ Text content is the native JSON envelope. `details.readSeekValue.envelope`
36
+ holds the same object. `metadata` is always present; other keys appear only
37
+ when selected.
package/prompts/edit.md CHANGED
@@ -5,13 +5,13 @@ Anchors come from `readSeek_read`, `readSeek_grep`, `readSeek_search`,
5
5
 
6
6
  ## Variants
7
7
 
8
- | Variant | Use | Required anchor |
9
- | --- | --- | --- |
10
- | `set_line` | Replace or delete one line | `anchor` |
11
- | `replace_lines` | Replace or delete one contiguous range | `start_anchor`, `end_anchor` |
12
- | `insert_after` | Insert after one line | `anchor` |
13
- | `replace_symbol` | Replace one mapped symbol | `symbol` instead of an anchor |
14
- | `replace` | Replace exact text; one match unless `all: true` | None |
8
+ | Variant | Use | Required anchor |
9
+ | ---------------- | ------------------------------------------------ | ----------------------------- |
10
+ | `set_line` | Replace or delete one line | `anchor` |
11
+ | `replace_lines` | Replace or delete one contiguous range | `start_anchor`, `end_anchor` |
12
+ | `insert_after` | Insert after one line | `anchor` |
13
+ | `replace_symbol` | Replace one mapped symbol | `symbol` instead of an anchor |
14
+ | `replace` | Replace exact text; one match unless `all: true` | None |
15
15
 
16
16
  Use `new_text: ""` to delete lines and `new_text: "\n"` for a blank line.
17
17
  Prefer anchored variants. Use `replace_symbol` for a whole symbol and `replace`
@@ -37,26 +37,19 @@ plain file content, not a diff or hashline output.
37
37
  }
38
38
  ```
39
39
 
40
- ## Exact, fuzzy, and symbol replacement
40
+ ## Exact and symbol replacement
41
41
 
42
- `replace` is exact by default and fails when its text is absent. `fuzzy: true`
43
- retries only after exact matching fails and normalizes whitespace plus
44
- confusable Unicode. Verify any warned fuzzy match.
42
+ `replace` requires exact text. It fails when the text is absent or appears more
43
+ than once unless `all: true` is set.
45
44
 
46
- `replace_symbol` accepts `Name`, `Class.method`, or `Name@<line>` in a mappable
47
- source file. `new_body` must be non-empty and unindented. Do not overlap a
48
- symbol replacement with anchored edits.
45
+ `replace_symbol` accepts `Name`, a qualified name such as `Class.method`, or
46
+ `Name@<line>` in a mappable source file. `new_body` must be non-empty and
47
+ unindented. Do not overlap a symbol replacement with anchored edits.
49
48
 
50
49
  ## Stale anchors and validation
51
50
 
52
- A `hash-mismatch` response marks nearby current lines with `>>>`, for example:
53
-
54
- ```text
55
- >>> 41:b34| const renamed = 3;
56
- ```
57
-
58
- Retry with those anchors or read/search again. Verify any automatic relocation
59
- warning.
51
+ A stale-anchor response reports the current hash for the requested line. Read or
52
+ search again before retrying.
60
53
 
61
54
  All edits validate before writing; a hard failure writes nothing. Anchored edits
62
55
  run bottom-up. `no-op` means no content changed. For languages with a tree-sitter
package/prompts/read.md CHANGED
@@ -1,9 +1,8 @@
1
- Read anchored text by range, symbol, or map. Standalone images require an explicit mode; PDF text is always returned.
1
+ Read anchored text by range or symbol. Standalone images require an explicit mode. Use `readSeek_view` for documents (PDF first). Use `readSeek_digest` with `select: "map"` for a structural outline.
2
2
 
3
3
  ## Choose a read
4
4
 
5
5
  - Default: read a small file or an `offset` / `limit` range.
6
- - `map: true`: append the file's structural map.
7
6
  - `symbol: "Name"`: read one mapped symbol.
8
7
  - `bundle: "local"`: include directly related symbols from the same file.
9
8
 
@@ -11,32 +10,29 @@ Read anchored text by range, symbol, or map. Standalone images require an explic
11
10
 
12
11
  - `path` — file path.
13
12
  - `offset` / `limit` — positive line numbers; `offset` is one-based.
14
- - `map` — append a full-file map; incompatible with `symbol` and `bundle`.
15
13
  - `symbol` — `Name`, `Class.method`, or `Name@<line>`; incompatible with
16
14
  `offset` and `limit`.
17
- - `bundle` — only `"local"`; requires `symbol` and excludes `map`.
18
- - `image` — standalone-image/PDF embedded-image mode; unavailable when
19
- `imageMode` is `"off"`.
20
- - `page` — one-based PDF page; defaults to 1 and excludes `offset` / `limit`.
15
+ - `bundle` — only `"local"`; requires `symbol`.
16
+ - `image` — standalone-image mode; unavailable when `imageMode` is `"off"`.
21
17
 
22
18
  Text output is capped at {{DEFAULT_MAX_LINES}} lines or {{DEFAULT_MAX_BYTES}}.
23
19
  A truncated full-file read appends a map when available; use its ranges for
24
20
  follow-up reads.
25
21
 
26
22
  Standalone images require `image`. In `"auto"`, `image: "none"` returns a
27
- prepared standalone image without local analysis. PDF text is always read;
28
- without `image`, embedded images are skipped unless an image-capable Pi model is
29
- active in `"auto"` mode. That model receives prepared images directly.
23
+ prepared standalone image without local analysis. Documents (PDF first) are not
24
+ readable through this tool — use `readSeek_view` for structure, content, and
25
+ optional asset vision.
30
26
 
31
27
  ## Symbol lookup
32
28
 
33
- | Query | Result |
34
- | --- | --- |
35
- | `{"symbol":"processEvent"}` | Function or other unqualified symbol |
36
- | `{"symbol":"EventEmitter"}` | Class, interface, type, enum, or similar symbol |
37
- | `{"symbol":"EventEmitter.emit"}` | Qualified child method or member |
38
- | `{"symbol":"Foo.bar@42"}` | Definition or overload near line 42 |
39
- | `{"symbol":"handleRequest","bundle":"local"}` | Symbol plus direct same-file support |
29
+ | Query | Result |
30
+ | --------------------------------------------- | ----------------------------------------------- |
31
+ | `{"symbol":"processEvent"}` | Function or other unqualified symbol |
32
+ | `{"symbol":"EventEmitter"}` | Class, interface, type, enum, or similar symbol |
33
+ | `{"symbol":"EventEmitter.emit"}` | Qualified child method or member |
34
+ | `{"symbol":"Foo.bar@42"}` | Definition or overload near line 42 |
35
+ | `{"symbol":"handleRequest","bundle":"local"}` | Symbol plus direct same-file support |
40
36
 
41
37
  `@<line>` is a trailing disambiguator; `foo@bar` remains an ordinary name.
42
38
  Resolution prefers a containing range, then the nearest symbol at or after the
package/prompts/refs.md CHANGED
@@ -1,4 +1,4 @@
1
- Find references or usages of an identifier by name or cursor binding. Results include enclosing symbols and edit-ready `LINE:HASH` anchors. Without cursor scope, results are identifier-name matches; with scope, they follow one binding and exclude shadows. Use text search for literal occurrences in strings or comments, and use this tool before renaming or deleting a symbol.
1
+ 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 literal occurrences in strings or comments, and use this tool before renaming or deleting a symbol.
2
2
 
3
3
  ## Parameters
4
4
 
@@ -8,13 +8,12 @@ Find references or usages of an identifier by name or cursor binding. Results in
8
8
  - `scope` — restrict results to the binding at `line` / `column` in one file;
9
9
  requires `line`.
10
10
  - `line` — one-based cursor line used with `scope`.
11
- - `column` — optional one-based cursor byte column used with `scope`.
11
+ - `column` — optional one-based cursor byte column for disambiguation; used with
12
+ `scope`.
12
13
  - `cached` — search tracked/indexed files in a Git repository.
13
14
  - `others` — search untracked files in a Git repository.
14
15
  - `ignored` — include ignored untracked files; requires `others`.
15
16
 
16
- Without `scope`, results match by name. With `scope`, results follow the cursor
17
- binding and exclude shadows.
18
17
 
19
18
  In a Git work tree, directory search includes tracked/indexed and untracked
20
19
  non-ignored files by default. Setting `cached` or `others` restricts the set;
package/prompts/rename.md CHANGED
@@ -4,7 +4,7 @@ Rename a symbol at a source location. Resolvable same-named bindings are preserv
4
4
 
5
5
  - `path` — source file containing the cursor.
6
6
  - `line` — one-based cursor line.
7
- - `column` — optional one-based cursor byte column.
7
+ - `column` — optional one-based cursor byte column for disambiguation.
8
8
  - `to` — new plain identifier.
9
9
  - `workspace` — expand across the project. The cursor file remains binding-aware;
10
10
  other files use name matching where binding resolution is unavailable.
package/prompts/search.md CHANGED
@@ -1,4 +1,4 @@
1
- Search code by AST structure using ast-grep-style patterns. Results include edit-ready `LINE:HASH` anchors. Use `readSeek_grep` for identifiers, strings, comments, configuration, documentation, or other plain text and regex.
1
+ Search code by AST structure using ast-grep-style patterns. Results include line hashes usable as `LINE:HASH` anchors. Use `readSeek_grep` for identifiers, strings, comments, configuration, documentation, or other plain text and regex.
2
2
 
3
3
  ## Parameters
4
4
 
package/prompts/view.md CHANGED
@@ -1,14 +1,18 @@
1
- Inspect a PDF's structure or selected content. Start with the overview, then narrow by page, node, kind, or depth instead of reading the whole document.
1
+ Digest a document's structure or selected content. Start with the overview, then narrow by page, node, kind, or depth instead of reading the whole document. PDF is the first supported document format.
2
2
 
3
3
  ## Parameters
4
4
 
5
- - `path` — PDF file.
5
+ - `path` — document file (PDF first).
6
6
  - `node` — node ID to use as the view root.
7
- - `page` — one-based PDF page.
7
+ - `page` — one-based source page.
8
8
  - `kind` — node kind filter.
9
9
  - `depth` — maximum depth below selected roots.
10
10
  - `outline` — return outline nodes only.
11
+ - `visionMode` — analyze selected assets: `all`, `ocr`, `caption`, or `objects`.
12
+ - `visionLevel` — vision inference level: `low` (default), `medium`, or `high`;
13
+ requires `visionMode`.
11
14
 
12
- A `.readseek/` directory must already exist; run `readseek init` if needed. The
13
- first call then creates a reusable structural index. Output is a bounded text
14
- projection with stable node IDs and source-page references.
15
+ The Pi integration creates and reuses its document cache automatically. The
16
+ first call builds a structural index. Output is a bounded text projection with
17
+ stable node IDs and source-page references. Optional vision analysis is appended
18
+ for selected assets.
package/prompts/write.md CHANGED
@@ -7,7 +7,6 @@ rejected before writing.
7
7
 
8
8
  - `path` — file path.
9
9
  - `content` — complete file content.
10
- - `map` — append a best-effort structural map.
11
10
 
12
11
  ## Output
13
12
 
package/prompts/check.md DELETED
@@ -1,10 +0,0 @@
1
- Check a source file for parser errors or missing syntax after edits. Validation requires a supported tree-sitter language; files without a supported parser are not checked. This is not a compiler, type checker, test runner, or linter.
2
-
3
- ## Parameters
4
-
5
- - `path` — source file.
6
-
7
- ## Output
8
-
9
- Returns parser error and missing-node counts with affected line ranges.
10
- Files without a supported parser are not validated.
package/prompts/hover.md DELETED
@@ -1,7 +0,0 @@
1
- Inspect the symbol at a source location. This identifies the token and enclosing symbol; use it before definition lookup or binding-specific references.
2
-
3
- ## Parameters
4
-
5
- - `path` — source file.
6
- - `line` — one-based cursor line.
7
- - `column` — optional one-based cursor byte column.