pier-setup 0.2.4 → 0.2.6
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 +34 -7
- package/install.mjs +12 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ pier ships as **two halves**, installed separately:
|
|
|
18
18
|
|
|
19
19
|
| Half | Package | Role |
|
|
20
20
|
|---|---|---|
|
|
21
|
-
| **pi extension** | `packages/pier-ext` (npm: [`pi-pier`](https://www.npmjs.com/package/pi-pier), [pi.dev gallery](https://pi.dev/packages/pi-pier)) | Injects `todo_write` / `subagent` / `
|
|
21
|
+
| **pi extension** | `packages/pier-ext` (npm: [`pi-pier`](https://www.npmjs.com/package/pi-pier), [pi.dev gallery](https://pi.dev/packages/pi-pier)) | Injects `todo_write` / `subagent` / `terminal` / `ask_user_question` tools into a pi session, and reports pane state over the herdr socket API |
|
|
22
22
|
| **herdr plugin** | `packages/pier-workbench` (`pier.workbench`) | Workspace bootstrap, blocked human-gate notifications, focus heat layout (focused pane grows in place) |
|
|
23
23
|
|
|
24
24
|
### Highlights
|
|
@@ -90,12 +90,39 @@ herdr plugin link ./packages/pier-workbench # development
|
|
|
90
90
|
|
|
91
91
|
The extension degrades gracefully outside a herdr environment (see Scope below).
|
|
92
92
|
|
|
93
|
-
### Scope (
|
|
93
|
+
### Scope (what the pi extension mutates)
|
|
94
|
+
|
|
95
|
+
`pi-pier` is not dormant outside herdr. After install it is live in every pi session:
|
|
96
|
+
|
|
97
|
+
| Surface | Bare `pi` | Inside herdr |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| `todo_write`, `/todos`, widget, anti-freeze, stop reminder | live | live |
|
|
100
|
+
| `ask_user_question` | live | live + blocked marker |
|
|
101
|
+
| Hidden inject (`before_agent_start` todo-read; settle reminder) | live | live |
|
|
102
|
+
| `subagent`, `terminal` | **not registered** | live |
|
|
103
|
+
| `/locks`, write-lock, slim-frame, pane title, pipe | off | live |
|
|
104
|
+
| `setActiveTools` role visible layer | off | on (herdr master) |
|
|
105
|
+
|
|
106
|
+
Session JSONL custom types (`pi-herdr.todo-edit`, `.subs`, `.terminals`, `.todo-read`, `.todo-reminder`, …) persist across `/resume` even without herdr.
|
|
107
|
+
|
|
108
|
+
### Plugin conflicts
|
|
109
|
+
|
|
110
|
+
pi overwrites tools/commands by name; event listeners stack. Two todo or subagent plugins will silently replace each other.
|
|
111
|
+
|
|
112
|
+
**Do not install alongside** (same-name overwrite → wrong handler, split JSONL):
|
|
113
|
+
|
|
114
|
+
- [`@nguyenquangthai/pi-todo`](https://pi.dev/packages/@nguyenquangthai/pi-todo) — `todo_write` + overlay
|
|
115
|
+
- [`@josephyoung/pi-ask-user-question`](https://pi.dev/packages/@josephyoung/pi-ask-user-question) — `ask_user_question`
|
|
116
|
+
- [`pi-herdr-subagents`](https://pi.dev/packages/pi-herdr-subagents) — `subagent` + herdr panes
|
|
117
|
+
|
|
118
|
+
**Soft conflict** (two orchestrators / two injectors — the agent “talks to itself”):
|
|
119
|
+
|
|
120
|
+
- [`@tintinweb/pi-subagents`](https://pi.dev/packages/@tintinweb/pi-subagents) (`Agent`)
|
|
121
|
+
- [`@minhduydev/pi-subagents`](https://pi.dev/packages/@minhduydev/pi-subagents) (`task`)
|
|
122
|
+
- any other extension that calls `setActiveTools`, `ui.custom` overlay, `before_agent_start`, or `sendUserMessage`/`sendMessage` followUp
|
|
123
|
+
|
|
124
|
+
**Designed coexistence:** herdr’s official `herdr:pi` reporter. Keep it. pier emits `herdr:blocked` so that plugin remains lifecycle authority.
|
|
94
125
|
|
|
95
|
-
- **pi outside herdr**: the extension degrades — reporting is free, workbench tools
|
|
96
|
-
(`subagent`, terminal family) return a clear "requires a herdr-managed pane" error;
|
|
97
|
-
`todo_write` / `ask_user_question` stay available (session JSONL is the authority,
|
|
98
|
-
no herdr dependency).
|
|
99
126
|
- **other agents inside herdr (claude code / codex etc.)**: tabs without a pi pane
|
|
100
127
|
are excluded from heat reflow; blocked notifications are pi-only; master-tab
|
|
101
128
|
auto-bootstrap can be disabled with `autoBootstrap: false` in boot-config.
|
|
@@ -110,7 +137,7 @@ them automatically; manually, copy `packages/pier-workbench/scripts/boot-config.
|
|
|
110
137
|
### Usage
|
|
111
138
|
|
|
112
139
|
1. Run pi inside a herdr workspace pane (`pi` in the pane); the extension detects `HERDR_ENV` and starts reporting
|
|
113
|
-
2. The model can call `todo_write` (live pane-title projection), `subagent` (
|
|
140
|
+
2. The model can call `todo_write` (live pane-title projection), `subagent` (spawn / list / send / interrupt / resume), `terminal` (open / send / read / signal / close / list)
|
|
114
141
|
3. Every subagent = its own pane (observable, enterable, blocked notifies)
|
|
115
142
|
4. Restart recovery: herdr session restore rebuilds panes automatically (subagent rpc session files are reported); resume the parent pi session with `/resume`
|
|
116
143
|
|
package/install.mjs
CHANGED
|
@@ -86,8 +86,17 @@ function which(bin) {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
function run(cmd, args) {
|
|
90
|
-
|
|
89
|
+
function run(cmd, args, opts = {}) {
|
|
90
|
+
// win32: npm 全局 bin 是 .cmd shim,无 shell 直接 spawn 会 ENOENT/EINVAL,须走 cmd.exe;
|
|
91
|
+
// 且 shell:true 时 Node 把 args 按空格裸拼接(不加引号),含空格的路径参数会被拆碎,故预拼接并加引号。
|
|
92
|
+
// POSIX 走原生分支,保持 execFileSync(cmd, args) 原语义。
|
|
93
|
+
if (IS_WIN) {
|
|
94
|
+
const cmdline = [cmd, ...args]
|
|
95
|
+
.map((a) => (/[\s"]/.test(a) ? `"${a.replace(/"/g, '\\"')}"` : a))
|
|
96
|
+
.join(' ');
|
|
97
|
+
return execFileSync(cmdline, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], shell: true, ...opts }).trim();
|
|
98
|
+
}
|
|
99
|
+
return execFileSync(cmd, args, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], ...opts }).trim();
|
|
91
100
|
}
|
|
92
101
|
|
|
93
102
|
function tryRun(cmd, args) {
|
|
@@ -126,9 +135,7 @@ function readPkgVersion(dir) {
|
|
|
126
135
|
|
|
127
136
|
function npmLatest(name) {
|
|
128
137
|
try {
|
|
129
|
-
return
|
|
130
|
-
encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], timeout: 15000,
|
|
131
|
-
}).trim();
|
|
138
|
+
return run('npm', ['view', name, 'version'], { timeout: 15000 });
|
|
132
139
|
} catch {
|
|
133
140
|
return null;
|
|
134
141
|
}
|