@alexgorbatchev/pi-agentation 3.0.0 → 3.1.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 +48 -26
- package/agentation.ts +704 -80
- package/bin/pi-agentation +45 -2
- package/package.json +9 -7
- package/skills/agentation/SKILL.md +112 -0
- package/skills/agentation-fix-loop/SKILL.md +0 -199
package/README.md
CHANGED
|
@@ -1,38 +1,60 @@
|
|
|
1
|
-
# pi
|
|
1
|
+
# pi-agentation
|
|
2
2
|
|
|
3
|
-
A pi extension
|
|
3
|
+
A pi extension launcher for Agentation Fork.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
It resolves the repository's Agentation Fork `projectId`, starts an
|
|
6
|
+
extension-managed watch loop, and dispatches a **one-shot** Agentation Fork
|
|
7
|
+
batch-processing skill when real annotations arrive.
|
|
8
8
|
|
|
9
9
|
See:
|
|
10
10
|
|
|
11
|
+
- [agentation-fork.vercel.app](https://agentation-fork.vercel.app)
|
|
11
12
|
- [Agentation Fork](https://github.com/alexgorbatchev/agentation)
|
|
12
|
-
- [CLI](https://github.com/alexgorbatchev/agentation-cli)
|
|
13
|
+
- [Agentation Fork CLI](https://github.com/alexgorbatchev/agentation-cli)
|
|
13
14
|
- [Agentation Skills](https://github.com/alexgorbatchev/agentation-skills)
|
|
14
15
|
|
|
15
16
|
> [!IMPORTANT]
|
|
16
|
-
>
|
|
17
|
+
> When idle, this keeps an Agentation Fork watch loop running but does not
|
|
18
|
+
> spend model tokens. Tokens are only used when a real annotation batch is
|
|
19
|
+
> dispatched for autonomous code-fix work.
|
|
20
|
+
|
|
21
|
+
## Architecture
|
|
22
|
+
|
|
23
|
+
`pi-agentation` now splits responsibilities cleanly:
|
|
24
|
+
|
|
25
|
+
- **Extension**
|
|
26
|
+
- resolves the project for the current repo
|
|
27
|
+
- runs `agentation pending` once on startup
|
|
28
|
+
- then keeps a live `agentation watch <project-id> --timeout 300 --batch-window 10 --json` loop running
|
|
29
|
+
- dispatches exactly one skill run per fetched batch
|
|
30
|
+
- pauses queue polling while the current batch is still in progress
|
|
31
|
+
|
|
32
|
+
- **Skill**
|
|
33
|
+
- processes exactly one already-fetched batch
|
|
34
|
+
- acknowledges each annotation
|
|
35
|
+
- edits code
|
|
36
|
+
- resolves, replies, or dismisses annotations
|
|
37
|
+
- exits when that batch is done
|
|
38
|
+
|
|
39
|
+
This avoids the old brittle design where the extension kept re-queuing the same
|
|
40
|
+
skill prompt after every agent turn.
|
|
17
41
|
|
|
18
42
|
## Behavior
|
|
19
43
|
|
|
20
|
-
- The launcher (`pi-agentation`) injects the
|
|
21
|
-
-
|
|
44
|
+
- The launcher (`pi-agentation`) injects the bundled `agentation` skill via `--skill`
|
|
45
|
+
- The extension checks that `/skill:agentation` is available before starting
|
|
22
46
|
- On session start/switch/fork, the extension:
|
|
23
47
|
- runs `agentation projects --json`
|
|
24
48
|
- runs `rg` to discover literal `projectId="..."` or `projectId='...'` values in the repo
|
|
25
49
|
- intersects both lists
|
|
26
50
|
- auto-starts if exactly one project matches, otherwise prompts you to choose in the TUI
|
|
27
51
|
- The resolved project ID is stored in the current Pi session so reloads/resume do not re-prompt that same session
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- `/agentation-loop-start` — resume/start looping
|
|
35
|
-
- `/agentation-loop-stop` — pause looping
|
|
52
|
+
- The extension manages the polling loop itself; it does one startup `agentation pending` check and then relies on a live `agentation watch` loop as the primary mechanism
|
|
53
|
+
- When a batch arrives, the extension injects batch context and dispatches `/skill:agentation <project-id>`
|
|
54
|
+
- The UI widget is intentionally conservative: after startup it reports live-watch status, not an authoritative queue-empty claim
|
|
55
|
+
- If a batch is left incomplete, restart `pi-agentation` to retry from a clean watch loop
|
|
56
|
+
- On `session_shutdown`, the extension stops its internal watch loop automatically
|
|
57
|
+
- If the skill is missing, no repo project IDs are found, or no discovered repo IDs are known to Agentation Fork yet: the plugin requests shutdown and exits with code `1`
|
|
36
58
|
|
|
37
59
|
## Installation
|
|
38
60
|
|
|
@@ -42,19 +64,19 @@ Install both project packages:
|
|
|
42
64
|
npm install -D @alexgorbatchev/agentation @alexgorbatchev/pi-agentation
|
|
43
65
|
```
|
|
44
66
|
|
|
45
|
-
`@alexgorbatchev/pi-agentation` ships
|
|
67
|
+
`@alexgorbatchev/pi-agentation` ships a bundled `agentation` skill, so you do not need to install a separate skill package for local use.
|
|
46
68
|
|
|
47
|
-
|
|
69
|
+
Executable resolution order:
|
|
48
70
|
|
|
49
|
-
- `pi`
|
|
50
|
-
- `agentation`
|
|
51
|
-
- `rg`
|
|
71
|
+
- `pi-agentation` resolves `pi` from the nearest `node_modules/.bin/pi` first, then falls back to `PATH`
|
|
72
|
+
- the extension resolves `agentation` from the nearest `node_modules/.bin/agentation` first, then falls back to `PATH`
|
|
73
|
+
- `rg` is still expected on `PATH`
|
|
52
74
|
|
|
53
|
-
|
|
75
|
+
This makes the package work cleanly when `pi-agentation`, `pi`, and the Agentation Fork CLI are installed into the same Node project, while still supporting global installations.
|
|
54
76
|
|
|
55
77
|
## Usage
|
|
56
78
|
|
|
57
|
-
Before running
|
|
79
|
+
Before running pi, start the [Agentation Fork CLI](https://github.com/alexgorbatchev/agentation-cli) and connect from the front end which uses `<Agentation projectId="..." />` at least once in the last 24h. Then run the launcher from your project:
|
|
58
80
|
|
|
59
81
|
```bash
|
|
60
82
|
npx pi-agentation
|
|
@@ -68,5 +90,5 @@ pi-agentation
|
|
|
68
90
|
|
|
69
91
|
## Notes
|
|
70
92
|
|
|
71
|
-
-
|
|
72
|
-
-
|
|
93
|
+
- The extension now owns polling; the skill is intentionally one-shot.
|
|
94
|
+
- If you leave a batch partially handled, restart `pi-agentation` to retry from a clean watch loop.
|