pi-fovea 0.31.0 → 0.31.2
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 +16 -0
- package/docs/cli.md +12 -0
- package/package.json +4 -4
- package/skills/fovea/SKILL.md +115 -0
- package/skills/pi-fovea/SKILL.md +4 -5
package/README.md
CHANGED
|
@@ -108,6 +108,8 @@ Runtime slash controls:
|
|
|
108
108
|
|
|
109
109
|
## Install
|
|
110
110
|
|
|
111
|
+
**0.31.2 compatibility:** tested against Pi 0.99.0 (Node 22.19+ for the extension). Pi APIs and TypeBox are host-provided wildcard peers, never bundled; development pins Pi 0.99.0 and TypeBox 1.3.27. Native codemode-only and Fabric declaration hiding leave Fovea tools callable, including nested grep middleware. The standalone CLI remains Node 20+ and host-free.
|
|
112
|
+
|
|
111
113
|
Requires Node.js 20+. The install provisions [ast-grep](https://ast-grep.github.io/) automatically through the `@ast-grep/cli` npm optional dependency; an `ast-grep` found on PATH takes precedence over the packaged copy, and `FOVEA_AST_GREP=/path/to/sg` overrides both. Bend-only and config/protocol-only roots work without ast-grep; it is required when discovery or refresh includes a language that uses its parser.
|
|
112
114
|
|
|
113
115
|
```sh
|
|
@@ -156,6 +158,20 @@ From a checkout, `bun run fovea` runs the live source via `tsx`, and `bun run bu
|
|
|
156
158
|
`bun run pack:cli` produces the scoped CLI tarball at `dist/fovea-cli.tgz` using the
|
|
157
159
|
root package version. See [CLI usage](docs/cli.md) and [release checks and publishing](docs/releasing.md).
|
|
158
160
|
|
|
161
|
+
## Agent skills
|
|
162
|
+
|
|
163
|
+
Choose the skill for the interface your agent uses:
|
|
164
|
+
|
|
165
|
+
| Skill | Use it for |
|
|
166
|
+
| --- | --- |
|
|
167
|
+
| [pi-fovea](skills/pi-fovea/SKILL.md) | Pi extension tools, persistent focus/dwell, turn sync, and Fabric integration. |
|
|
168
|
+
| [fovea](skills/fovea/SKILL.md) | Standalone shell/CI commands, explicit repository roots, and stateless navigation. |
|
|
169
|
+
|
|
170
|
+
The Pi package exposes both skills. The standalone `@monotykamary/fovea` package
|
|
171
|
+
ships only `skills/fovea/SKILL.md`; register that directory with your agent's skill
|
|
172
|
+
loader, or copy it into its skills directory. Installing the CLI alone does not
|
|
173
|
+
register a skill with an agent.
|
|
174
|
+
|
|
159
175
|
## Many projects, one conversation
|
|
160
176
|
|
|
161
177
|
Your Pi cwd can be a parent folder, a launcher, or unrelated to the work.
|
package/docs/cli.md
CHANGED
|
@@ -35,6 +35,18 @@ The trailing number is the output token budget. Each CLI invocation is
|
|
|
35
35
|
stateless; use the Pi extension for focus and dwell across an interactive
|
|
36
36
|
session.
|
|
37
37
|
|
|
38
|
+
## Agent skill
|
|
39
|
+
|
|
40
|
+
The standalone package includes `skills/fovea/SKILL.md`, a portable **fovea**
|
|
41
|
+
skill with navigation, impact, coverage, and stateless CLI workflows. Register
|
|
42
|
+
that directory with your agent's skill loader, or copy it into the agent's skills
|
|
43
|
+
directory. Installing the executable alone does not register the skill.
|
|
44
|
+
|
|
45
|
+
For a global npm install, the skill directory is
|
|
46
|
+
`$(npm root -g)/@monotykamary/fovea/skills/fovea`. It is also available in the
|
|
47
|
+
[source repository](https://github.com/monotykamary/pi-fovea/tree/main/skills/fovea).
|
|
48
|
+
The separate **pi-fovea** skill covers Pi extension tools and session behavior.
|
|
49
|
+
|
|
38
50
|
## Pi extension
|
|
39
51
|
|
|
40
52
|
Install the separate `pi-fovea` package in Pi:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-fovea",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.2",
|
|
4
4
|
"description": "Token-budgeted repo mapping for agent sessions: foveated heat diffusion over a cross-language code graph, with progressive disclosure.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -87,13 +87,13 @@
|
|
|
87
87
|
"test:smoke": "vitest run tests/verified-kernels.test.ts tests/startup.test.ts tests/config.test.ts tests/settings.test.ts tests/substrate.test.ts tests/scan.test.ts tests/extract.test.ts tests/join.test.ts tests/heat.test.ts tests/nuclei.test.ts tests/render.test.ts"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
91
|
-
"@earendil-works/pi-tui": "0.
|
|
90
|
+
"@earendil-works/pi-coding-agent": "0.99.0",
|
|
91
|
+
"@earendil-works/pi-tui": "0.99.0",
|
|
92
92
|
"@types/node": "^22.0.0",
|
|
93
93
|
"esbuild": "^0.28.1",
|
|
94
94
|
"knip": "^6.32.0",
|
|
95
95
|
"tsx": "^4.19.0",
|
|
96
|
-
"typebox": "
|
|
96
|
+
"typebox": "1.3.27",
|
|
97
97
|
"typescript": "^5.6.0",
|
|
98
98
|
"vitest": "^3.0.0"
|
|
99
99
|
},
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fovea
|
|
3
|
+
description: Token-efficient repository navigation with the standalone fovea CLI, independent of Pi. Use from an agent shell or CI to survey an unfamiliar repository, locate symbols and routes, trace dependencies, assess change impact, or refresh context after edits. Use the pi-fovea skill instead when working through Pi's session-aware extension tools.
|
|
4
|
+
compatibility: Requires the fovea executable and Node.js 20+. Most source languages also need ast-grep, supplied by the CLI's optional dependency or available on PATH.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Fovea
|
|
8
|
+
|
|
9
|
+
Fovea builds a cross-language code graph of routes, symbols, imports, calls, and
|
|
10
|
+
string/env literals. Start with a cheap silhouette, focus on a question, then
|
|
11
|
+
read the indicated source ranges. This skill uses only the standalone `fovea`
|
|
12
|
+
command; no Pi installation or extension tools are required.
|
|
13
|
+
|
|
14
|
+
## Setup
|
|
15
|
+
|
|
16
|
+
If `fovea` is missing, install the standalone package with the user's permission:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm install -g @monotykamary/fovea
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The executable is `fovea`. The legacy global `pi-fovea` package also supplies it;
|
|
23
|
+
choose one global package, not both. No TypeScript loader or Bend compiler is
|
|
24
|
+
needed for the installed CLI. In a Fovea source checkout with development
|
|
25
|
+
dependencies installed, `bun run fovea <command> ...` runs the live source.
|
|
26
|
+
|
|
27
|
+
Most source languages require ast-grep. The optional `@ast-grep/cli` dependency
|
|
28
|
+
supplies it; an `ast-grep` on PATH takes precedence, and `FOVEA_AST_GREP` can select
|
|
29
|
+
an explicit executable. If optional dependencies were omitted, arrange for
|
|
30
|
+
ast-grep before treating missing source results as meaningful.
|
|
31
|
+
|
|
32
|
+
## Navigation loop
|
|
33
|
+
|
|
34
|
+
Always pass an explicit root (`.` or a repository path), then quote the query.
|
|
35
|
+
This avoids ambiguity between a query containing `/` and a root path. File
|
|
36
|
+
selectors in impact are relative to that root, not the shell's working directory.
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
fovea sketch /path/to/repo 900
|
|
40
|
+
fovea focus /path/to/repo "CreateUserHandler" 1200
|
|
41
|
+
fovea focus /path/to/repo "/api/users" 1200
|
|
42
|
+
fovea focus /path/to/repo "src/api.ts" 1200
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
1. **Sketch** once to find production entry points and source regions. Test and
|
|
46
|
+
fixture architecture is collapsed; start around 512–1024 tokens.
|
|
47
|
+
2. **Focus** on a symbol, route, env key, or file. Read relevant source windows
|
|
48
|
+
before making claims or edits. Close symbol spellings can resolve too.
|
|
49
|
+
3. **Impact** before a risky edit to find likely dependents and review order.
|
|
50
|
+
4. **Refresh** by rerunning focus or impact after edits, then run the project's
|
|
51
|
+
targeted checks. Graph output is navigation evidence, not verification.
|
|
52
|
+
|
|
53
|
+
The trailing positive number is an approximate output token budget (about four
|
|
54
|
+
characters per token). Sketch, focus, and impact default to 512 and clamp to
|
|
55
|
+
256–16000. If the output is too narrow, rerun with a larger budget or a more
|
|
56
|
+
specific query. When an overflow footer names a text artifact, read or search
|
|
57
|
+
that exact path for the remaining eligible candidates; do not assume an artifact
|
|
58
|
+
exists when no path is returned.
|
|
59
|
+
|
|
60
|
+
## Change impact
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
# Current uncommitted changes (default).
|
|
64
|
+
fovea impact /path/to/repo 1200
|
|
65
|
+
|
|
66
|
+
# What-if analysis, without mixing in uncommitted changes.
|
|
67
|
+
fovea impact /path/to/repo --files src/api.ts,src/types.ts --no-uncommitted 1200
|
|
68
|
+
fovea impact /path/to/repo --symbols CreateUserHandler --no-uncommitted 1200
|
|
69
|
+
|
|
70
|
+
# PR-style changes: git diff main...HEAD, not the working tree.
|
|
71
|
+
fovea impact /path/to/repo --base main 1200
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`--files` and `--symbols` take comma-separated values. Without `--no-uncommitted`,
|
|
75
|
+
explicit seeds also include uncommitted changes; `--base` replaces that automatic
|
|
76
|
+
working-tree selection with the three-dot diff. Use a base ref available locally.
|
|
77
|
+
In a non-Git directory, use explicit file or symbol seeds rather than relying on
|
|
78
|
+
a diff. Heat and co-change companions suggest where to inspect, not which files
|
|
79
|
+
must change or which checks have passed.
|
|
80
|
+
|
|
81
|
+
## Coverage and discovery
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
fovea status /path/to/repo
|
|
85
|
+
fovea anchors /path/to/repo "/api/users"
|
|
86
|
+
fovea anchors /path/to/repo --discovered
|
|
87
|
+
fovea rules /path/to/repo
|
|
88
|
+
fovea rules /path/to/repo --sigs
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
- **Status** summarizes index coverage and extraction problems. Missing parser
|
|
92
|
+
support, excluded files, and unresolved imports limit what the graph can say.
|
|
93
|
+
- **Anchors** lists sorted, tab-separated anchor rows; the optional filter is a
|
|
94
|
+
substring match. `--discovered` keeps inferred anchors only. This listing is
|
|
95
|
+
not token-budgeted, so filter it instead of dumping a large repository.
|
|
96
|
+
- **Rules** shows discovered shape hypotheses as JSON lines, or a plain-text
|
|
97
|
+
message if none qualify. `--sigs` shows supporting signature statistics.
|
|
98
|
+
`fovea rules /path/to/repo --adopt` **writes** promoted rules to
|
|
99
|
+
`.fovea/rules.json`; use it only when intentionally adopting reviewed rules.
|
|
100
|
+
|
|
101
|
+
## CLI boundaries
|
|
102
|
+
|
|
103
|
+
- Each invocation starts fresh. Disk caches speed extraction, but there is no
|
|
104
|
+
persistent focus, seen-result suppression, workspace attention, or turn sync.
|
|
105
|
+
A separate `fovea dwell` invocation cannot widen an earlier CLI focus; rerun
|
|
106
|
+
`focus` with a larger budget instead.
|
|
107
|
+
- Output is rendered text on stdout, errors on stderr. There are no general
|
|
108
|
+
`--json` or `--tsv` output modes; anchors and rules have the formats noted above.
|
|
109
|
+
Pi tool arguments such as `fresh`, `path`, `language`, and `kind` are not CLI
|
|
110
|
+
flags. Do not assume unknown flags are validated.
|
|
111
|
+
- Prefer graph navigation to bulk reading, but use native text search for exact
|
|
112
|
+
literals, regexes, or missing graph results. Small repositories may not need a
|
|
113
|
+
graph at all. Import coverage is not universal, and a possible import is not
|
|
114
|
+
proof of an exact dependency. Always inspect source and keep acceptance tests
|
|
115
|
+
in the host workflow.
|
package/skills/pi-fovea/SKILL.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pi-fovea
|
|
3
|
-
description: Token-efficient repo navigation
|
|
3
|
+
description: Token-efficient repo navigation through the pi-fovea extension tools in Pi. Use when fovea_sketch, fovea_focus, fovea_dwell, and fovea_impact are available to survey repositories, trace symbols and routes, assess change impact, or re-orient after edits with session-aware sync. Includes pi-fabric integration; use the fovea skill instead for standalone shell/CLI workflows.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# pi-fovea
|
|
7
7
|
|
|
8
|
+
Use this skill for the **Pi extension** and its in-session tools. For standalone
|
|
9
|
+
shell commands, scripting, or CI, use the **fovea** skill instead.
|
|
10
|
+
|
|
8
11
|
pi-fovea maintains a cross-language code graph of the working repository — routes, symbols, imports, calls, string/env literals — and exposes it through progressive disclosure: cheap silhouettes first, detail only where you point it. It costs almost nothing until you ask, and it re-syncs automatically whenever file content drifts, no matter which tool made the edit.
|
|
9
12
|
|
|
10
13
|
## The loop
|
|
@@ -63,10 +66,6 @@ When writing or editing code **inside a `fabric_exec` program**, the fovea tools
|
|
|
63
66
|
- Any file mutation performed by the program (including `pi.edit`/`pi.write` calls inside the sandbox) is picked up by turn sync automatically, so post-edit verification does not need a re-sketch.
|
|
64
67
|
- Sketch `details` carries coverage counts; its compact text names the highest-value entry points. On an unfamiliar repo, fetch it once and reuse it instead of rediscovering entry points per call.
|
|
65
68
|
|
|
66
|
-
## CLI
|
|
67
|
-
|
|
68
|
-
The same engine runs headlessly as the `fovea` binary (repo root scan, plus JSON and TSV modes). Prefer the in-session tools unless you need scripting or a second opinion outside the extension's session state.
|
|
69
|
-
|
|
70
69
|
## Settings
|
|
71
70
|
|
|
72
71
|
Use `/fovea status` for loaded version and index coverage, `/fovea reset` for fresh state, `/fovea reload` after updates, and `/fovea settings` for configuration. Files live under `~/.pi/agent/fovea.json` or trusted `.pi/fovea.json`; the external-editor key (`Ctrl+G` by default) switches the displayed and saved layer between global defaults and project overrides. `tools.grepMode` controls the grep integration: `"augment"` (default) keeps native grep semantics and appends a Fovea graph section to symbol-query results — including `pi.grep` calls inside fabric_exec — `"replace"` keeps the legacy bare-query takeover, `"off"` is native only.
|