oira666_pi-watcher 0.0.11 → 0.0.13
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/EVERGREEN.md +18 -2
- package/README.md +1 -1
- package/package.json +5 -5
- package/src/runtime-args.ts +2 -1
package/EVERGREEN.md
CHANGED
|
@@ -39,6 +39,9 @@ Session replacement, reload, startup cancellation, approval, and child exit must
|
|
|
39
39
|
RPC message framing, event names, model persistence, and compaction delivery boundaries matter.
|
|
40
40
|
Inherited extensions can start work/processes; exclusion is essential and permissions remain inherited.
|
|
41
41
|
UI tests simulate terminal components; e2e does not drive an actual interactive PTY or clipboard.
|
|
42
|
+
An existing side session whose stored cwd was deleted cannot resume in RPC mode: Pi rejects it
|
|
43
|
+
without an interactive Continue/Fork choice. Watcher reports the startup error; it does not rewrite
|
|
44
|
+
session headers or silently fork history.
|
|
42
45
|
|
|
43
46
|
## Tests
|
|
44
47
|
`npm run test:evergreen` runs `npm test` (latest Pi dependencies, TypeScript check, unit/integration),
|
|
@@ -46,7 +49,8 @@ then `test/e2e/watcher.test.ts`. No lint script is configured.
|
|
|
46
49
|
Unit tests cover bounded live state, prompt identity/policy, CLI filtering, JSONL transport, and UI.
|
|
47
50
|
`runtime-integration.test.ts` uses real RPC children and an offline provider to protect prompt-free
|
|
48
51
|
startup, inheritance/exclusions, nested Pi launches, isolated models, resume, approval refusal,
|
|
49
|
-
session guards, locks, shutdown, and recovery.
|
|
52
|
+
session guards, locks, shutdown, and recovery. Busy reload is refused; RPC abort cancels
|
|
53
|
+
in-flight bridge calls before an idle reload succeeds. `extension.test.cjs` exercises command → overlay →
|
|
50
54
|
RPC → approval → main delivery, including compaction refusal and shutdown cancellation.
|
|
51
55
|
It also verifies that Watcher registers no keyboard shortcuts and that `/watcher` opens and reopens
|
|
52
56
|
the panel without prompting or losing the side conversation.
|
|
@@ -62,4 +66,16 @@ RPC framing/dialogs/settlement; session JSONL/resume/tools and model persistence
|
|
|
62
66
|
TUI key parsing, overlay focus/disposal, and clipboard support. Pi 1.5.0 removes published pi-ai
|
|
63
67
|
TypeBox exports while retaining loader compatibility. Its package refresh/retry, session-write,
|
|
64
68
|
deferred editor replacement, and compaction OAuth fixes require no Watcher-specific workaround.
|
|
65
|
-
|
|
69
|
+
Pi 1.5.1 refuses reload during responses/compaction and waits for tool abort/results before
|
|
70
|
+
runtime disposal; cancellation tests must not depend on a busy reload reaching session_shutdown.
|
|
71
|
+
Its RPC shutdown/cleanup, overlay disposal/blocked status, async-hook serialization, stable model
|
|
72
|
+
selection, and package-update result progress events require no Watcher runtime workaround:
|
|
73
|
+
Watcher patches resource resolution, not PackageManager.update or its progress events.
|
|
74
|
+
Pi 1.5.2 adds missing-cwd Continue/Fork/Cancel to interactive session selection. Watcher uses the
|
|
75
|
+
active `ctx.cwd`, main ID/file, and `session_start`, not the main header's stored cwd: Continue
|
|
76
|
+
retains the main identity; Fork gets a distinct side ID. Integration coverage checks a missing
|
|
77
|
+
main-header cwd and side restart without changing the main file. The child still uses
|
|
78
|
+
`--session-dir`/`--session-id`; copied `--session <file>` commands follow Pi's interactive choices.
|
|
79
|
+
Watcher does not call `/import` or implement session copying, so Pi's failed-import cleanup and
|
|
80
|
+
duplicate-file fixes need no workaround. Interactive missing-cwd dialogs are not PTY-tested.
|
|
81
|
+
Tested against Pi 1.5.2.
|
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ pi install npm:oira666_pi-watcher
|
|
|
12
12
|
|
|
13
13
|
Then restart Pi or run `/reload`. Requires Node.js **22.19+** and the modular Pi installation. The child launcher uses Pi's package-manager loading interfaces. Standalone compiled Pi binaries are not supported.
|
|
14
14
|
|
|
15
|
-
Tested against Pi 1.5.
|
|
15
|
+
Tested against Pi 1.5.2.
|
|
16
16
|
|
|
17
17
|
For local development:
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oira666_pi-watcher",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "A persistent side-agent conversation for observing and steering your running Pi agent.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"typebox": "^1.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@earendil-works/pi-agent-core": "^1.5.
|
|
53
|
-
"@earendil-works/pi-ai": "^1.5.
|
|
54
|
-
"@earendil-works/pi-coding-agent": "^1.5.
|
|
55
|
-
"@earendil-works/pi-tui": "^1.5.
|
|
52
|
+
"@earendil-works/pi-agent-core": "^1.5.2",
|
|
53
|
+
"@earendil-works/pi-ai": "^1.5.2",
|
|
54
|
+
"@earendil-works/pi-coding-agent": "^1.5.2",
|
|
55
|
+
"@earendil-works/pi-tui": "^1.5.2",
|
|
56
56
|
"@types/node": "^26.6.6",
|
|
57
57
|
"typebox": "^1.4.3",
|
|
58
58
|
"typescript": "^7.0.2"
|
package/src/runtime-args.ts
CHANGED
|
@@ -25,7 +25,8 @@ export function deriveSideSessionId(mainSessionId: string): string {
|
|
|
25
25
|
/**
|
|
26
26
|
* One-line shell command that opens the side session in another terminal: `pi --session <file>`.
|
|
27
27
|
* A file path (not an id) opens that exact session from any directory; pi switches to the
|
|
28
|
-
* session's cwd
|
|
28
|
+
* session's cwd, or offers Continue/Fork/Cancel if that directory is missing (Pi 1.5.2).
|
|
29
|
+
* The home directory is shown as `~` when that stays shell-safe, else single-quoted.
|
|
29
30
|
*/
|
|
30
31
|
export function formatSideSessionCommand(sessionFile: string, home = homedir()): string {
|
|
31
32
|
const safe = /^[A-Za-z0-9_@%+=:,./-]+$/;
|