oira666_pi-watcher 0.0.12 → 0.0.14

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 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),
@@ -68,4 +71,18 @@ runtime disposal; cancellation tests must not depend on a busy reload reaching s
68
71
  Its RPC shutdown/cleanup, overlay disposal/blocked status, async-hook serialization, stable model
69
72
  selection, and package-update result progress events require no Watcher runtime workaround:
70
73
  Watcher patches resource resolution, not PackageManager.update or its progress events.
71
- Tested against Pi 1.5.1.
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
+ Pi 1.6.0 emits startup extension events over RPC and avoids duplicate session_start/resource
82
+ handlers; Watcher already handles extension_error and keeps stderr separate from JSON framing.
83
+ Reload session_start refreshes the bridge context. Last-assistant text now ignores aborted/error-only
84
+ messages; Watcher uses the RPC result without reconstructing it. TUI render arrays are read-only:
85
+ Watcher iterates/slices child output and builds its own frame without mutating cached arrays.
86
+ Resource resolution and model selection need no workaround; Watcher preserves explicit side models
87
+ rather than depending on Pi's OpenAI/Azure/Codex default.
88
+ Tested against Pi 1.6.0.
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.1.
15
+ Tested against Pi 1.6.0.
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.12",
3
+ "version": "0.0.14",
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.1",
53
- "@earendil-works/pi-ai": "^1.5.1",
54
- "@earendil-works/pi-coding-agent": "^1.5.1",
55
- "@earendil-works/pi-tui": "^1.5.1",
52
+ "@earendil-works/pi-agent-core": "^1.6.0",
53
+ "@earendil-works/pi-ai": "^1.6.0",
54
+ "@earendil-works/pi-coding-agent": "^1.6.0",
55
+ "@earendil-works/pi-tui": "^1.6.0",
56
56
  "@types/node": "^26.6.6",
57
57
  "typebox": "^1.4.3",
58
58
  "typescript": "^7.0.2"
@@ -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. The home directory is shown as `~` when that stays shell-safe, else single-quoted.
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_@%+=:,./-]+$/;