pier-setup 0.1.2 → 0.1.4

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.
Files changed (3) hide show
  1. package/README.md +77 -89
  2. package/package.json +1 -1
  3. package/README.en.md +0 -154
package/README.md CHANGED
@@ -1,143 +1,131 @@
1
1
  <div align="center">
2
2
 
3
- # pier · pi × herdr 工作台融合
3
+ # pier · pi × herdr workspace fusion
4
4
 
5
- **pier** = **pi** × h**erdr** 的融合体(码头/桥,对接、停泊、分发)。
5
+ **English** · [中文](README_ZH.md)
6
6
 
7
- [pi](https://pi.dev/)(`@earendil-works/pi-coding-agent`)是 coding agent 载体,[herdr](https://herdr.dev/) 是终端工作区管理器。pier 补上 pi 刻意不内置的两项能力——**todo list 闭环**与**交互式子代理**——并让它们以 herdr 的 pane/tab 为视觉与交互底座。
7
+ **pier** = **pi** × h**erdr** (a pier/dock — where things moor, dock, and fan out).
8
+
9
+ [pi](https://pi.dev/) (`@earendil-works/pi-coding-agent`) is the coding-agent carrier; [herdr](https://herdr.dev/) is a terminal workspace manager. pier adds the two capabilities pi deliberately leaves out — a **todo list loop** and **interactive subagents** — and gives them the herdr pane/tab layer as their visual and interactive substrate.
8
10
 
9
11
  </div>
10
12
 
11
13
  ---
12
14
 
13
- ## 是什么
15
+ ## What it is
14
16
 
15
- pier 由**两个半区**组成,各装一处:
17
+ pier ships as **two halves**, installed separately:
16
18
 
17
- | 半区 | 包 | 作用 |
19
+ | Half | Package | Role |
18
20
  |---|---|---|
19
- | **pi 扩展** | `packages/pier-ext`(npm: [`pi-pier`](https://www.npmjs.com/package/pi-pier),[pi.dev 市场](https://pi.dev/packages/pi-pier)) | 在 pi 会话里注入 `todo_write` / `subagent` / `list_agents` / `send_message` / `interrupt_agent` 工具 + 经 herdr socket API 上报 pane 状态 |
20
- | **herdr 插件** | `packages/pier-workbench`(`pier.workbench`) | 主 tab 引导、blocked 人类闸门通知、焦点热力布局(聚焦 pane 原地放大) |
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` / `list_agents` / `send_message` / `interrupt_agent` tools into a pi session, and reports pane state over the herdr socket API |
22
+ | **herdr plugin** | `packages/pier-workbench` (`pier.workbench`) | Workspace bootstrap, blocked human-gate notifications, focus heat layout (focused pane grows in place) |
21
23
 
22
- ### 核心能力
24
+ ### Highlights
23
25
 
24
- - **todo 闭环**:`todo_write` 全量替换语义、会话 JSONL 权威、分支正确回滚;窗格标题实时投影 `▶i ○p ■b ✓c (N/M) · 当前任务`;`/todos` 命令(含 unblock)可查看/编辑
25
- - **交互式子代理**:每个子代理 = 独立 pane 的隔离 pi 会话(独立上下文窗口);**人类可随时进入该 pane 直接对话**(修 bug、接管、回答 ask_user_question)
26
- - **软锁防争抢**(写路径按 pane 粒度锁 token,冲突时警告/阻止)
27
- - **角色档案**:`master` / `worker-default` 内置,自定义 role 按 `.pi-herdr/roles/<name>.json` 挂载;工具集按角色收敛(deny 规则不可绕过)
28
- - **人类闸门**:子代理 `ask_user_question` → 侧边栏 blocked 标记 + 通知;用户手动接管(ESC 打断后输入)→ 启发式检测自动暂停/归还 master 管理
29
- - **焦点热力布局**:聚焦 pane 原地放大(0.72 目标),blocked / ask / working / idle 按权重分大小,多余 pane 自动压成 title 条
30
- - **结算通知折叠**:后台子代理结算不再攒到 run 结束洪水回填——turn 间隙注入,最多 3 条逐条展示、其余折叠指路
26
+ - **Todo loop**: `todo_write` with full-replace semantics, session JSONL as source of truth, correct branch rollback; live pane-title projection `▶i ○p ■b ✓c (N/M) · current task`; TUI widget is an activity-anchored window (the in_progress entry and its surrounding context stay visible as work moves down the list); `/todos` command (including unblock)
27
+ - **Todo anti-freeze**: an all-completed list unchanged for ≥6 turns flips the read hook from recitation to a rewrite warning; after ≥1h it archives — first offering one rewrite window with old entries as reference, then (if ignored) a final notice that clears the list (rm persisted to JSONL; the empty guard takes over — multi-step work must re-track); `/todos` still shows history, session JSONL untouched
28
+ - **Interactive subagents**: every subagent = an isolated pi session in its own pane (separate context window); **a human can enter that pane and talk to it directly** (fix bugs, take over, answer ask_user_question)
29
+ - **Soft write-locks**: per-pane lock tokens on write paths; cross-pane conflicts warn or block
30
+ - **Role profiles**: built-in `master` / `worker-default`; custom roles as `.pi-herdr/roles/<name>.json`; toolset converges per role (deny rules are not bypassable)
31
+ - **Human gate**: subagent `ask_user_question` → sidebar blocked marker + notification; manual takeover (ESC-interrupt then typing) is heuristically detected so the master pauses/returns management automatically
32
+ - **Focus heat layout**: focused pane grows in place (0.72 target); blocked / ask / working / idle sized by weight; surplus panes collapse to title strips
33
+ - **Long-task lifecycle (01a03c0d review)**: observation timeout is now an inactivity budget (working slices renew it — healthy >10min tasks are no longer killed); follow_up messages deliver via steer at tool-call gaps (supplementary contracts arrive in seconds, not after the whole run); GC waits for the settlement notice to be delivered before closing panes; takeover detection attributes recent machine injections first; ledger rows carry a `via` tag, closed rows inherit their outcome, zombie running rows are swept on startup; SUBS snapshots are hash-gated. Tunables: `PI_HERDR_SUBAGENT_TIMEOUT_MS` (inactivity seconds), `PI_HERDR_INJECT_GRACE_MS`, `PI_HERDR_OBSERVE_MS`
34
+ - **Settlement notice folding**: subagent settlements no longer flood back when a long main run ends — they inject at turn gaps, up to 3 shown, the rest folded with pointers
31
35
 
32
- ## 安装
36
+ ## Installation
33
37
 
34
- ### 环境要求
38
+ ### Requirements
35
39
 
36
40
  - Node ≥ 22
37
- - pi ≥ 0.84(`@earendil-works/pi-coding-agent`)
38
- - herdr ≥ 0.8.0(macOS / Linux / Windows;Windows 为 preview beta)
41
+ - pi ≥ 0.84 (`@earendil-works/pi-coding-agent`)
42
+ - herdr ≥ 0.8.0 (macOS / Linux / Windows; Windows is preview beta)
39
43
 
40
- ### 一键安装(推荐)
44
+ ### One-shot install (recommended)
41
45
 
42
- 无需克隆仓库,直接用 npm 包运行:
46
+ No clone needed — run the npm package directly:
43
47
 
44
48
  ```sh
45
- npx pier-setup # 用户模式:pi install npm:pi-pier + herdr plugin install + 自动生成引导配置
46
- npm i -g pier-setup # 或全局安装后直接跑 pier-setup
49
+ npx pier-setup # user mode: pi install npm:pi-pier + herdr plugin install + auto-generated bootstrap config
50
+ npm i -g pier-setup # or install globally, then just run pier-setup
47
51
  ```
48
52
 
49
- 开发模式仍需克隆仓库:
53
+ Dev mode still requires cloning the repo:
50
54
 
51
55
  ```sh
52
56
  git clone https://github.com/July24/pier && cd pier
53
- node install.mjs install --dev # 本地路径 pi install + herdr plugin link,改码即生效
57
+ node install.mjs install --dev # local-path pi install + herdr plugin link; code changes are live
54
58
  ```
55
59
 
56
- 脚本自动校验环境(node / pi / herdr 版本)、探测 pi 的 node 与 cli.js 绝对路径、
57
- 生成 boot-config.json(用户模式落 herdr 插件配置目录,重装不丢),并注册两半区。
60
+ The script verifies the environment (node / pi / herdr versions), probes pi's node
61
+ and cli.js absolute paths, generates boot-config.json (user mode stores it in the
62
+ herdr plugin config dir, so reinstalls don't lose it), and registers both halves.
58
63
 
59
- 其他命令:`pier-setup update`(卸载+重装,重探测路径)、`pier-setup uninstall --purge`。
60
- 发行规格可用 `--pi-spec=` / `--herdr-spec=` 覆盖(npm 发布或 fork 场景)。
64
+ Other commands: `pier-setup update` (uninstall + reinstall, re-probes paths),
65
+ `pier-setup uninstall --purge`. Override the distribution specs with
66
+ `--pi-spec=` / `--herdr-spec=` (npm publishing or forks).
61
67
 
62
- ### 手动安装(等价步骤)
68
+ ### Manual install (equivalent steps)
63
69
 
64
70
  ```sh
65
- # pi 侧扩展(任选其一;npm 源 = 用户模式推荐,git 源 = 跟随仓库最新,本地路径 = 开发模式)
66
- pi install npm:pi-pier # 用户模式(npm 发布版,自动出现在 pi.dev/packages 市场)
67
- pi install git:github.com/July24/pier # 用户模式(跟随 main 最新)
68
- pi install ./packages/pier-ext # 开发期
69
-
70
- # herdr 侧插件
71
- herdr plugin install July24/pier/packages/pier-workbench --yes # 用户模式(重装即更新)
72
- herdr plugin link ./packages/pier-workbench # 开发期
71
+ # pi extension (any one; npm source = recommended user mode, git source = latest main, local path = dev mode)
72
+ pi install npm:pi-pier # user mode (npm release, auto-listed on the pi.dev/packages gallery)
73
+ pi install git:github.com/July24/pier # user mode (tracks main)
74
+ pi install ./packages/pier-ext # development
75
+
76
+ # herdr plugin
77
+ herdr plugin install July24/pier/packages/pier-workbench --yes # user mode (reinstall = update)
78
+ herdr plugin link ./packages/pier-workbench # development
73
79
  ```
74
80
 
75
- 扩展在非 herdr 环境下自动降级(详见下节"作用域")。
81
+ The extension degrades gracefully outside a herdr environment (see Scope below).
76
82
 
77
- ### 作用域(只影响 herdr × pi 交叉场景)
83
+ ### Scope (only the herdr × pi intersection is affected)
78
84
 
79
- - **非 herdr 环境用 pi**:扩展自动降级——herdr 上报零成本,`subagent` / 终端族
80
- 工具返回"requires a herdr-managed pane"提示;`todo_write` / `ask_user_question`
81
- 照常可用(以会话 JSONL 为权威,无 herdr 依赖)。
82
- - **herdr 中用其他 agent(claude code / codex 等)**:不含 pi pane 的 tab 不参与
83
- 热力布局;blocked 通知只发给 pi;主 tab 自动引导可用 boot-config 的
84
- `autoBootstrap: false` 关闭。
85
+ - **pi outside herdr**: the extension degrades — reporting is free, workbench tools
86
+ (`subagent`, terminal family) return a clear "requires a herdr-managed pane" error;
87
+ `todo_write` / `ask_user_question` stay available (session JSONL is the authority,
88
+ no herdr dependency).
89
+ - **other agents inside herdr (claude code / codex etc.)**: tabs without a pi pane
90
+ are excluded from heat reflow; blocked notifications are pi-only; master-tab
91
+ auto-bootstrap can be disabled with `autoBootstrap: false` in boot-config.
85
92
 
86
- ### 引导配置(workbench 半区)
93
+ ### Bootstrap config (workbench half)
87
94
 
88
- master 主 tab 引导需要本机 node / pi 路径:`node install.mjs` 自动生成;手动可复制模板
89
- `packages/pier-workbench/scripts/boot-config.example.json`(含 macOS / Windows 双平台占位)。
90
- 用户模式配置在 `herdr plugin config-dir pier.workbench`;开发模式在 `packages/pier-workbench/scripts/boot-config.json`。
95
+ Master-tab bootstrap needs local node / pi paths: `pier-setup` generates
96
+ them automatically; manually, copy `packages/pier-workbench/scripts/boot-config.example.json`
97
+ (placeholders for both macOS and Windows). User mode reads it from
98
+ `herdr plugin config-dir pier.workbench`; dev mode from `packages/pier-workbench/scripts/boot-config.json`.
91
99
 
92
- ### 使用
100
+ ### Usage
93
101
 
94
- 1. 在 herdr workspace 里开 pane 跑 pi(pane 内 `pi`),扩展检测 `HERDR_ENV` 自动开始上报
95
- 2. 模型可调用 `todo_write`(窗格头实时投影)、`subagent`(前台/并行/后台)、`list_agents` / `send_message` / `interrupt_agent`
96
- 3. 每个子代理 = 独立 pane(可观察、可进入交互、blocked 时触发通知)
97
- 4. 重启恢复:herdr session 恢复自动重建 pane(子代理 rpc 会话文件已上报);父 pi 会话用 `/resume` 恢复
102
+ 1. Run pi inside a herdr workspace pane (`pi` in the pane); the extension detects `HERDR_ENV` and starts reporting
103
+ 2. The model can call `todo_write` (live pane-title projection), `subagent` (foreground / parallel / background), `list_agents` / `send_message` / `interrupt_agent`
104
+ 3. Every subagent = its own pane (observable, enterable, blocked notifies)
105
+ 4. Restart recovery: herdr session restore rebuilds panes automatically (subagent rpc session files are reported); resume the parent pi session with `/resume`
98
106
 
99
- ## 仓库结构
107
+ ## Repository layout
100
108
 
101
109
  ```
102
110
  packages/
103
- pier-ext/ # pi 扩展(npm: pi-pier):todo/subagent 工具、herdr 客户端、vocab 权威、skill
104
- pier-workbench/ # herdr 插件(pier.workbench):主 tab 引导 + blocked 通知 + 热力布局
105
- docs/ # 安装手册、role 档案说明、侧边栏 role 配置
111
+ pier-ext/ # pi extension (npm: pi-pier): todo/subagent tools, herdr client, vocab authority, skill
112
+ pier-workbench/ # herdr plugin (pier.workbench): workspace bootstrap + blocked notify + heat layout
113
+ docs/ # install guide, role profile docs, sidebar role config
106
114
  ```
107
115
 
108
- ## 测试
116
+ ## Testing
109
117
 
110
118
  ```sh
111
119
  npm install --ignore-scripts
112
- npm test # node --test,244 项单测(规划器 / todo 重放 / 会话尾 / GC / 生命周期)
113
- ```
114
-
115
- ## 发版流程(tag → npm 自动发布)
116
-
117
- 发版时**三处版本号必须一致**(由 `.githooks/pre-push` 守卫,不一致会拒绝 push tag):
118
-
119
- | 位置 | 对应 npm 包 |
120
- |---|---|
121
- | git tag(兼容 `v0.2.0` / `0.2.0`) | 触发发布 |
122
- | `packages/pier-ext/package.json` 的 `version` | `pi-pier` |
123
- | 根 `package.json` 的 `version` | `pier-setup` |
124
-
125
- ```sh
126
- # 1. 同时修改两处 version → 目标版本(必须大于 npm 已有版本)
127
- # 2. 提交后打同名 tag 并推送:
128
- git commit -am "release: 0.2.0"
129
- git tag 0.2.0
130
- git push && git push --tags # GitHub Actions 自动跑测试并经 Trusted Publishing 发布到 npm
120
+ npm test # node --test, 278 unit tests (planner / todo replay / anti-freeze staleness / session tail / GC / lifecycle)
131
121
  ```
132
122
 
133
- > hook 安装:clone 后执行一次 `git config core.hooksPath .githooks`(`npm install` 会经 prepare 脚本自动配置)。版本号只能递增:npm 同版本不可重发;旧 tag 名不可复用。
134
-
135
- ## 设计原则
123
+ ## Design principles
136
124
 
137
- - **会话 JSONL 是唯一权威**:todo / 委派 / 注册表全部回放自会话分支,重启与分支切换正确
138
- - **事件驱动,不轮询**:状态经 herdr 事件订阅(`pane.agent_status_changed` / `pane.closed`)推送,仅事件触发时拉一次快照
139
- - **零位置迁移**:herdr BSP 布局拓扑创建时定死,pier 只调 split ratio——pane 位置永不动,大小按优先级重算
140
- - **尽力而为的投影层**:上报失败静默,绝不影响 pi 主流程
125
+ - **Session JSONL is the single source of truth**: todos, delegations, and registries replay from session branches — restart and branch switches stay correct
126
+ - **Event-driven, never poll**: state arrives via herdr event subscriptions (`pane.agent_status_changed` / `pane.closed`); one snapshot is taken only when an event fires
127
+ - **Zero position migration**: the herdr BSP layout topology is fixed at creation; pier only adjusts split ratios — panes never move, they size by priority
128
+ - **Best-effort projection layer**: reporting failures are silent and never block the pi main flow
141
129
 
142
130
  ## License
143
131
 
@@ -145,6 +133,6 @@ MIT
145
133
 
146
134
  ---
147
135
 
148
- > 💡 **开发说明**:`.gitignore` 刻意**不提交**到本仓库(本地资产忽略规则属个人环境)。贡献者请基于 `README.md` / `README.en.md` 自行维护忽略规则;`packages/pier-workbench/scripts/boot-config.json` 亦为本机配置(模板见 `.example.json`)。
136
+ > 💡 **For contributors**: `.gitignore` is deliberately **not committed** to this repository (ignore rules are per-environment). Maintain your own rules based on `README.md` / `README_ZH.md`; `packages/pier-workbench/scripts/boot-config.json` is also machine-local (see the `.example.json` template).
149
137
  >
150
- > **命名约定**:品牌名 **pier**(仓库/包/插件),运行时协议标识保留 **`pi-herdr`** 前缀(`.pi-herdr/roles/` 目录、`pi-herdr.subs` 等会话 custom 条目、`~/.pi/agent/herdr-pi/roles/` 用户目录)——它们随用户会话/配置文件持久化,改动会破坏既有数据,属兼容层。
138
+ > **Naming convention**: the brand is **pier** (repo/packages/plugin); runtime protocol identifiers keep the **`pi-herdr`** prefix (`.pi-herdr/roles/` dir, `pi-herdr.subs` session custom entries, `~/.pi/agent/herdr-pi/roles/` user dir) — they persist with user sessions/config files, renaming would break existing data, so they are the compatibility layer.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pier-setup",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "One-shot installer for pier: registers the pi-pier extension with pi and the pier.workbench plugin with herdr (install / uninstall / update)",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/README.en.md DELETED
@@ -1,154 +0,0 @@
1
- <div align="center">
2
-
3
- # pier · pi × herdr workspace fusion
4
-
5
- **pier** = **pi** × h**erdr** (a pier/dock — where things moor, dock, and fan out).
6
-
7
- [pi](https://pi.dev/) (`@earendil-works/pi-coding-agent`) is the coding-agent carrier; [herdr](https://herdr.dev/) is a terminal workspace manager. pier adds the two capabilities pi deliberately leaves out — a **todo list loop** and **interactive subagents** — and gives them the herdr pane/tab layer as their visual and interactive substrate.
8
-
9
- </div>
10
-
11
- ---
12
-
13
- ## What it is
14
-
15
- pier ships as **two halves**, installed separately:
16
-
17
- | Half | Package | Role |
18
- |---|---|---|
19
- | **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` / `list_agents` / `send_message` / `interrupt_agent` tools into a pi session, and reports pane state over the herdr socket API |
20
- | **herdr plugin** | `packages/pier-workbench` (`pier.workbench`) | Workspace bootstrap, blocked human-gate notifications, focus heat layout (focused pane grows in place) |
21
-
22
- ### Highlights
23
-
24
- - **Todo loop**: `todo_write` with full-replace semantics, session JSONL as source of truth, correct branch rollback; live pane-title projection `▶i ○p ■b ✓c (N/M) · current task`; `/todos` command (including unblock)
25
- - **Interactive subagents**: every subagent = an isolated pi session in its own pane (separate context window); **a human can enter that pane and talk to it directly** (fix bugs, take over, answer ask_user_question)
26
- - **Soft write-locks**: per-pane lock tokens on write paths; cross-pane conflicts warn or block
27
- - **Role profiles**: built-in `master` / `worker-default`; custom roles as `.pi-herdr/roles/<name>.json`; toolset converges per role (deny rules are not bypassable)
28
- - **Human gate**: subagent `ask_user_question` → sidebar blocked marker + notification; manual takeover (ESC-interrupt then typing) is heuristically detected so the master pauses/returns management automatically
29
- - **Focus heat layout**: focused pane grows in place (0.72 target); blocked / ask / working / idle sized by weight; surplus panes collapse to title strips
30
- - **Settlement notice folding**: subagent settlements no longer flood back when a long main run ends — they inject at turn gaps, up to 3 shown, the rest folded with pointers
31
-
32
- ## Installation
33
-
34
- ### Requirements
35
-
36
- - Node ≥ 22
37
- - pi ≥ 0.84 (`@earendil-works/pi-coding-agent`)
38
- - herdr ≥ 0.8.0 (macOS / Linux / Windows; Windows is preview beta)
39
-
40
- ### One-shot install (recommended)
41
-
42
- No clone needed — run the npm package directly:
43
-
44
- ```sh
45
- npx pier-setup # user mode: pi install npm:pi-pier + herdr plugin install + auto-generated bootstrap config
46
- npm i -g pier-setup # or install globally, then just run pier-setup
47
- ```
48
-
49
- Dev mode still requires cloning the repo:
50
-
51
- ```sh
52
- git clone https://github.com/July24/pier && cd pier
53
- node install.mjs install --dev # local-path pi install + herdr plugin link; code changes are live
54
- ```
55
-
56
- The script verifies the environment (node / pi / herdr versions), probes pi's node
57
- and cli.js absolute paths, generates boot-config.json (user mode stores it in the
58
- herdr plugin config dir, so reinstalls don't lose it), and registers both halves.
59
-
60
- Other commands: `pier-setup update` (uninstall + reinstall, re-probes paths),
61
- `pier-setup uninstall --purge`. Override the distribution specs with
62
- `--pi-spec=` / `--herdr-spec=` (npm publishing or forks).
63
-
64
- ### Manual install (equivalent steps)
65
-
66
- ```sh
67
- # pi extension (any one; npm source = recommended user mode, git source = latest main, local path = dev mode)
68
- pi install npm:pi-pier # user mode (npm release, auto-listed on the pi.dev/packages gallery)
69
- pi install git:github.com/July24/pier # user mode (tracks main)
70
- pi install ./packages/pier-ext # development
71
-
72
- # herdr plugin
73
- herdr plugin install July24/pier/packages/pier-workbench --yes # user mode (reinstall = update)
74
- herdr plugin link ./packages/pier-workbench # development
75
- ```
76
-
77
- The extension degrades gracefully outside a herdr environment (see Scope below).
78
-
79
- ### Scope (only the herdr × pi intersection is affected)
80
-
81
- - **pi outside herdr**: the extension degrades — reporting is free, workbench tools
82
- (`subagent`, terminal family) return a clear "requires a herdr-managed pane" error;
83
- `todo_write` / `ask_user_question` stay available (session JSONL is the authority,
84
- no herdr dependency).
85
- - **other agents inside herdr (claude code / codex etc.)**: tabs without a pi pane
86
- are excluded from heat reflow; blocked notifications are pi-only; master-tab
87
- auto-bootstrap can be disabled with `autoBootstrap: false` in boot-config.
88
-
89
- ### Bootstrap config (workbench half)
90
-
91
- Master-tab bootstrap needs local node / pi paths: `pier-setup` generates
92
- them automatically; manually, copy `packages/pier-workbench/scripts/boot-config.example.json`
93
- (placeholders for both macOS and Windows). User mode reads it from
94
- `herdr plugin config-dir pier.workbench`; dev mode from `packages/pier-workbench/scripts/boot-config.json`.
95
-
96
- ### Usage
97
-
98
- 1. Run pi inside a herdr workspace pane (`pi` in the pane); the extension detects `HERDR_ENV` and starts reporting
99
- 2. The model can call `todo_write` (live pane-title projection), `subagent` (foreground / parallel / background), `list_agents` / `send_message` / `interrupt_agent`
100
- 3. Every subagent = its own pane (observable, enterable, blocked notifies)
101
- 4. Restart recovery: herdr session restore rebuilds panes automatically (subagent rpc session files are reported); resume the parent pi session with `/resume`
102
-
103
- ## Repository layout
104
-
105
- ```
106
- packages/
107
- pier-ext/ # pi extension (npm: pi-pier): todo/subagent tools, herdr client, vocab authority, skill
108
- pier-workbench/ # herdr plugin (pier.workbench): workspace bootstrap + blocked notify + heat layout
109
- docs/ # install guide, role profile docs, sidebar role config
110
- ```
111
-
112
- ## Testing
113
-
114
- ```sh
115
- npm install --ignore-scripts
116
- npm test # node --test, 244 unit tests (planner / todo replay / session tail / GC / lifecycle)
117
- ```
118
-
119
- ## Release process (tag → auto-publish to npm)
120
-
121
- Three version numbers must stay in sync when releasing (enforced by `.githooks/pre-push`; mismatched pushes are rejected):
122
-
123
- | Location | npm package |
124
- |---|---|
125
- | git tag (`v0.2.0` or `0.2.0`) | release trigger |
126
- | `packages/pier-ext/package.json` `version` | `pi-pier` |
127
- | root `package.json` `version` | `pier-setup` |
128
-
129
- ```sh
130
- # 1. Bump both versions to the target (must be greater than anything already on npm)
131
- # 2. Commit, then tag with the same number and push:
132
- git commit -am "release: 0.2.0"
133
- git tag 0.2.0
134
- git push && git push --tags # GitHub Actions runs tests and publishes via Trusted Publishing
135
- ```
136
-
137
- > Hook setup: run once after cloning — `git config core.hooksPath .githooks` (the npm prepare script does this automatically on `npm install`). Versions only go up: npm rejects re-publishing the same version, and old tag names cannot be reused.
138
-
139
- ## Design principles
140
-
141
- - **Session JSONL is the single source of truth**: todos, delegations, and registries replay from session branches — restart and branch switches stay correct
142
- - **Event-driven, never poll**: state arrives via herdr event subscriptions (`pane.agent_status_changed` / `pane.closed`); one snapshot is taken only when an event fires
143
- - **Zero position migration**: the herdr BSP layout topology is fixed at creation; pier only adjusts split ratios — panes never move, they size by priority
144
- - **Best-effort projection layer**: reporting failures are silent and never block the pi main flow
145
-
146
- ## License
147
-
148
- MIT
149
-
150
- ---
151
-
152
- > 💡 **For contributors**: `.gitignore` is deliberately **not committed** to this repository (ignore rules are per-environment). Maintain your own rules based on `README.md` / `README.en.md`; `packages/pier-workbench/scripts/boot-config.json` is also machine-local (see the `.example.json` template).
153
- >
154
- > **Naming convention**: the brand is **pier** (repo/packages/plugin); runtime protocol identifiers keep the **`pi-herdr`** prefix (`.pi-herdr/roles/` dir, `pi-herdr.subs` session custom entries, `~/.pi/agent/herdr-pi/roles/` user dir) — they persist with user sessions/config files, renaming would break existing data, so they are the compatibility layer.