@piagent/platform 1.0.2 → 1.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.
@@ -177,6 +177,45 @@ Tech stack option theo profile:
177
177
 
178
178
  Sau khi chọn tech, platform tạo `.pi/tech-stack.json` và các file `.pi/tech-context/<tech>.json`. `/onboard-project` sẽ đưa các pointer này vào `.pi/context-index.json`. File context chỉ nên chứa tóm tắt ngắn/citation từ Context7, không lưu nguyên văn docs dài, token, session, hoặc secret.
179
179
 
180
+ ## Đọc tài liệu ngoài project
181
+
182
+ Tài liệu tải về `~/Downloads` rồi kéo vào CLI thường không đọc được, vì mặc định agent chỉ làm việc trong project. Tool `piagent_document_read` mở đúng một khe: đọc **tài liệu**, **chỉ đọc**, trong các folder đã cấp trước.
183
+
184
+ | Thành phần | Giá trị |
185
+ |---|---|
186
+ | Tool | `piagent_document_read` |
187
+ | Input | `path` — absolute, `~/...`, hoặc relative theo project |
188
+ | Định dạng | `.md`, `.markdown`, `.txt`, `.text`, `.csv`, `.tsv`, `.json`, `.yaml`, `.yml`, `.pdf`, `.docx` |
189
+ | Giới hạn | 12 MB/file; 400.000 ký tự sau khi trích, dài hơn thì cắt và báo `truncated` |
190
+ | Cấp quyền | `additionalReadRoots` trong `.pi/piagent-profile.json`, hoặc biến môi trường `PIAGENT_ADDITIONAL_READ_ROOTS` |
191
+
192
+ Cấp folder cố định trong profile:
193
+
194
+ ```json
195
+ {
196
+ "additionalReadRoots": ["~/Downloads", "~/Documents/specs"]
197
+ }
198
+ ```
199
+
200
+ Cấp tạm cho một session, ngăn cách bằng `:` giống `PATH`:
201
+
202
+ ```bash
203
+ PIAGENT_ADDITIONAL_READ_ROOTS="$HOME/Downloads:$HOME/Documents/specs" pi
204
+ ```
205
+
206
+ Sau đó nói thẳng path là được: `Đọc ~/Downloads/spec-v2.docx rồi tóm tắt yêu cầu`.
207
+
208
+ Bốn ràng buộc không đổi khi cấp thêm root:
209
+
210
+ - **Chỉ đọc.** Root được cấp không mở quyền ghi, xoá, hay chạy lệnh trong đó.
211
+ - **Chỉ tài liệu.** File nằm trong root được cấp nhưng sai đuôi — `.pem`, `.sh`, `.env` — vẫn bị từ chối.
212
+ - **`protectedPaths` luôn thắng.** Root được cấp không mở được path mà project đang bảo vệ.
213
+ - **Nội dung là dữ liệu, không phải lệnh.** Text trả về đã qua redaction và có header nói rõ đây là dữ liệu người dùng; câu lệnh viết trong tài liệu không được thi hành.
214
+
215
+ Cả hai kiểm tra — nằm trong root và đúng đuôi — đều chạy trên path đã canonical hoá. Nên symlink trong root mà trỏ ra ngoài bị chặn, và symlink tên `notes.md` trỏ vào `id_rsa` cũng bị chặn.
216
+
217
+ `.docx` đọc trực tiếp, không cần cài gì; text bị xoá bởi tracked change chưa accept sẽ không lẫn vào nội dung. `.pdf` cần `pdftotext` (macOS `brew install poppler`, Debian/Ubuntu `apt install poppler-utils`); thiếu binary thì tool báo thiếu chứ không trả tài liệu rỗng.
218
+
180
219
  ## Command native của Pi
181
220
 
182
221
  Các command này thuộc Pi core hoặc package Pi chính. Tên/availability có thể phụ thuộc version Pi.
@@ -379,11 +418,11 @@ Các lệnh này chạy ngoài Pi.
379
418
 
380
419
  | Command | Dùng khi nào |
381
420
  |---|---|
382
- | `npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1` | Cài Pi CLI tương thích với release hiện tại. |
383
- | `npm install -g --ignore-scripts @piagent/platform@1.0.2` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
384
- | `pi install git:github.com/Vt-mmm/piagent@v1.0.2` | Cài pinned release khi cần reproducible team setup. |
421
+ | `npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0` | Cài Pi CLI tương thích với release hiện tại. |
422
+ | `npm install -g --ignore-scripts @piagent/platform@1.1.0` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
423
+ | `pi install git:github.com/Vt-mmm/piagent@v1.1.0` | Cài pinned release khi cần reproducible team setup. |
385
424
  | `pi install git:github.com/Vt-mmm/piagent` | Cài latest package platform cho máy cá nhân/sandbox. |
386
- | Cài exact Pi host của release, rồi `npm install -g --ignore-scripts @piagent/platform@X.Y.Z` và `piagent-install --stable` | Full update: đồng bộ host, npm-global helper và Pi package. v1.0.2 yêu cầu Pi `0.81.1`. |
425
+ | Cài exact Pi host của release, rồi `npm install -g --ignore-scripts @piagent/platform@X.Y.Z` và `piagent-install --stable` | Full update: đồng bộ host, npm-global helper và Pi package. Mỗi release pin một Pi host chính xác; lấy đúng version của release đang cài trong [release/install policy](release-install-policy.md). |
387
426
  | Cài exact Pi host ghi trong release cũ, rồi helper `vPREVIOUS` và `piagent-install --stable` | Full rollback; đánh giá dependency risk của host cũ trước khi hạ version. |
388
427
  | `piagent-install --stable --dry-run` | Preview Pi package matching với helper hiện tại; stable resolve tag → commit SHA. |
389
428
  | `piagent-install --stable` | Cài Pi package matching với helper hiện tại bằng resolved commit SHA. |
@@ -14,9 +14,9 @@ Repo này phải chạy được cho nhiều project/domain khác nhau. Vì vậ
14
14
 
15
15
  | Use case | Package source |
16
16
  |---|---|
17
- | Team pinned release | `git:github.com/Vt-mmm/piagent@v1.0.2` |
17
+ | Team pinned release | `git:github.com/Vt-mmm/piagent@v1.1.0` |
18
18
  | Personal/sandbox dev | `git:github.com/Vt-mmm/piagent` |
19
- | Registry distribution | `npm:@piagent/platform@1.0.2` |
19
+ | Registry distribution | `npm:@piagent/platform@1.1.0` |
20
20
  | Enterprise npm (fork under another scope) | `npm:@your-scope/platform@x.y.z` |
21
21
  | Local platform dev | `/path/to/piagent` |
22
22
 
@@ -26,7 +26,7 @@ Latest tiện cho máy cá nhân muốn nhận cập nhật nhanh. Pin tag/commi
26
26
 
27
27
  | Channel | Command | Target | Policy |
28
28
  |---|---|---|---|
29
- | `stable` | `bash scripts/install-global.sh --stable` | Helper release tag resolved to commit SHA, currently `v1.0.2` | Install the Pi package matching the helper. |
29
+ | `stable` | `bash scripts/install-global.sh --stable` | Helper release tag resolved to commit SHA, currently `v1.1.0` | Install the Pi package matching the helper. |
30
30
  | `exact` | `bash scripts/install-global.sh --version vX.Y.Z --resolve-tag` | Requested tag resolved to commit SHA | Pi-package-only rollout, rollback, and incident recovery. |
31
31
  | `dev` | `bash scripts/install-global.sh --dev` | Moving Git source | Personal/sandbox only; do not commit into project settings. |
32
32
  | `local` | `bash scripts/install-global.sh --local` | Current checkout path | Platform development only. |
@@ -53,7 +53,7 @@ Root `package.json` có `pi` manifest trỏ tới:
53
53
  Do đó team có thể:
54
54
 
55
55
  ```bash
56
- pi install git:github.com/Vt-mmm/piagent@v1.0.2
56
+ pi install git:github.com/Vt-mmm/piagent@v1.1.0
57
57
  ```
58
58
 
59
59
  Không cần biết internal folder `packages/piagent-core`. Source không pin chỉ dành cho personal/sandbox như bảng channel ở trên.
@@ -64,13 +64,13 @@ Team nên install global package một lần:
64
64
 
65
65
  ```bash
66
66
  node --version # >= 22.19.0
67
- npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1
68
- npm install -g --ignore-scripts @piagent/platform@1.0.2
67
+ npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
68
+ npm install -g --ignore-scripts @piagent/platform@1.1.0
69
69
  piagent-install --stable --dry-run
70
70
  piagent-install --stable
71
71
  ```
72
72
 
73
- `pi install git:github.com/Vt-mmm/piagent@v1.0.2` vẫn hợp lệ nếu chỉ cần cài Pi package. Lệnh đó không tự tạo các binary terminal `piagent-*`; muốn có helper global thì dùng `npm install -g --ignore-scripts @piagent/platform@1.0.2`.
73
+ `pi install git:github.com/Vt-mmm/piagent@v1.1.0` vẫn hợp lệ nếu chỉ cần cài Pi package. Lệnh đó không tự tạo các binary terminal `piagent-*`; muốn có helper global thì dùng `npm install -g --ignore-scripts @piagent/platform@1.1.0`.
74
74
 
75
75
  Support matrix hiện tại: macOS Apple Silicon + Bash và Linux x64 + Bash đã được verify; macOS Intel + Bash và Linux ARM64 + Bash là supported target cần chạy smoke trước rollout; native Windows chưa phải target rollout team; WSL2 experimental. Chi tiết và version runtime nằm trong [release/install policy](release-install-policy.md).
76
76
 
@@ -103,7 +103,7 @@ Nếu muốn commit sẵn `.pi/piagent-profile.json` vào repo hoặc bootstrap
103
103
  ```bash
104
104
  bash scripts/setup.sh /path/to/project \
105
105
  --profile be-readonly-fe \
106
- --package-source git:github.com/Vt-mmm/piagent@v1.0.2 \
106
+ --package-source git:github.com/Vt-mmm/piagent@v1.1.0 \
107
107
  --mcp-preset core \
108
108
  --subagents-preset safe
109
109
  ```
@@ -175,7 +175,7 @@ Files không commit:
175
175
  Full platform update phải đồng bộ Pi host, npm-global helper và Pi package:
176
176
 
177
177
  ```bash
178
- npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1
178
+ npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
179
179
  npm install -g --ignore-scripts @piagent/platform@X.Y.Z
180
180
  piagent-install --stable --dry-run
181
181
  piagent-install --stable
@@ -4,11 +4,32 @@
4
4
 
5
5
  Herdr dùng để quản lý nhiều session/pane agent. Pi core không cần tự làm subagent ngay từ đầu.
6
6
 
7
+ ## Cài Herdr
8
+
9
+ ```bash
10
+ brew install herdr # macOS
11
+ curl -fsSL https://herdr.dev/install.sh | sh # macOS hoặc Linux
12
+ ```
13
+
14
+ Bản `curl` là cách herdr.dev đặt làm mặc định, nhưng nó chạy script tải về ngay lúc cài. Muốn xem được thứ mình chạy thì dùng `brew`, hoặc tải binary từ [GitHub releases](https://github.com/ogulcancelik/herdr/releases) rồi `chmod +x` và đưa vào `PATH`.
15
+
16
+ Stable chỉ hỗ trợ macOS và Linux. Windows mới có bản preview, và cũng nằm ngoài runtime matrix của platform này.
17
+
7
18
  ## Setup integration
8
19
 
20
+ `piagent-setup` đã chạy `herdr integration install pi` giùm, với điều kiện `herdr` có sẵn trên `PATH` lúc đó. Không có thì nó bỏ qua kèm cảnh báo ra stderr — nên thứ tự đúng là cài Herdr trước, rồi mới `piagent-setup`.
21
+
22
+ Cài Herdr sau khi đã setup thì chạy lại:
23
+
24
+ ```bash
25
+ piagent-setup --global-only
26
+ ```
27
+
28
+ Kiểm tra hoặc cài tay:
29
+
9
30
  ```bash
10
- herdr integration install pi
11
31
  herdr integration status
32
+ herdr integration install pi
12
33
  ```
13
34
 
14
35
  Nếu dùng custom Pi agent dir:
@@ -2,7 +2,19 @@
2
2
 
3
3
  ## Kết luận hiện tại
4
4
 
5
- Pi core không hard-code MCP. Platform của mình cài `pi-mcp-adapter` để Pi dùng MCP theo kiểu token-efficient: một proxy tool `mcp(...)`, server lazy-connect, metadata cache, output guard. Project profile chỉ khai báo capability được phép; MCP config mới khai báo server thật.
5
+ Pi core không hard-code MCP. Platform của mình cài `pi-mcp-adapter` để Pi dùng MCP theo kiểu token-efficient: một proxy tool tên `mcp`, server lazy-connect, metadata cache, output guard. Project profile chỉ khai báo capability được phép; MCP config mới khai báo server thật.
6
+
7
+ **Ba thứ tên giống nhau nhưng không liên quan nhau** — chỗ này gây nhầm nhiều nhất:
8
+
9
+ | Thứ | Ở đâu | Là gì |
10
+ |---|---|---|
11
+ | `mcpCapabilities: ["github", ...]` | `.pi/piagent-profile.json` | Nhãn capability dùng cho tool registry |
12
+ | `toolCapabilities: { "github": ["github"] }` | `base-policy.json` | Map một tool **tên là `github`** sang capability |
13
+ | server `github` | `~/.config/mcp/mcp.json` | Server MCP thật, chạy qua Docker |
14
+
15
+ Không có dòng code nào map capability name sang MCP server id. Khai `"github"` trong `mcpCapabilities` **không** bật server MCP `github`, và ngược lại.
16
+
17
+ `toolPrefix` trong MCP config (`"server" | "none" | "short"`) chỉ đặt tên cho **direct tools** khi bật `directTools: true`. Nó không đổi tên proxy tool — proxy luôn là `mcp`.
6
18
 
7
19
  Từ `v0.3.7`, repo có thêm:
8
20
 
@@ -13,7 +25,17 @@ Từ `v0.3.7`, repo có thêm:
13
25
 
14
26
  ## Cấu hình một lần cho máy cá nhân/team
15
27
 
16
- Global install mặc định sẽ cài adapter và seed preset `core` nếu dùng `scripts/setup.sh` hoặc `scripts/install-global.sh --with-mcp`:
28
+ Cả `piagent-setup` và `piagent-install` đều cài adapter và seed preset `core` **mặc định**. Muốn bỏ qua thì thêm `--no-mcp`.
29
+
30
+ Ghi config **không** bằng dùng được ngay. Server connect lazy, nên mỗi server còn cần thứ của nó trước lần gọi đầu:
31
+
32
+ | Server (preset `core`) | Còn cần gì |
33
+ |---|---|
34
+ | `context7` | Không bắt buộc. `CONTEXT7_API_KEY` chỉ để tăng quota |
35
+ | `chrome-devtools` | Chrome cài sẵn trên máy |
36
+ | `github` | **Docker đang chạy** + `export GITHUB_PERSONAL_ACCESS_TOKEN` |
37
+
38
+ `piagent-mcp --list` in ra yêu cầu của từng server; lệnh apply cũng in danh sách này ra stderr ngay sau khi ghi config.
17
39
 
18
40
  ```bash
19
41
  bash /path/to/piagent/scripts/setup.sh . \
@@ -237,7 +259,9 @@ Tool:
237
259
  piagent_tool_policy_check
238
260
  ```
239
261
 
240
- Default `toolRegistry=advisory`: agent nhận warning khi tool chưa map capability. Project ổn định có thể bật `toolRegistry=enforce` trong `.pi/piagent-profile.json`.
262
+ Default `toolRegistry=advisory`: tool chưa map capability vẫn chạy, nhưng guard phát một notice mức `warning` — **một lần cho mỗi tool trong mỗi session**, không phải mỗi lần gọi.
263
+
264
+ `toolRegistry=enforce` thì đổi notice đó thành block. Cân nhắc trước khi bật: proxy tool của MCP tên là `mcp`, không nằm trong `alwaysAllowedTools` cũng không có trong `toolCapabilities`, nên **enforce sẽ chặn toàn bộ MCP**. Khai thêm `mcpCapabilities` không gỡ được, vì không có mapping nào từ capability name sang MCP server. Ngoại lệ duy nhất là permission profile `trusted-full-access`.
241
265
 
242
266
  Protected-path gate độc lập với registry mode. Dù tool registry đang `advisory`, mọi raw tool call có path-like string trỏ vào protected path sẽ bị block trước khi tool chạy. Cơ chế này áp dụng cho Pi built-ins (`read`, `write`, `edit`, `grep`, `find`, `ls`) và custom/MCP tools nếu tool call đi qua Pi `tool_call` hook.
243
267
 
@@ -13,17 +13,17 @@ Từ đó Pi có thể login provider, chọn model, onboard project, chạy tas
13
13
 
14
14
  Runtime team nên pin release tag hoặc commit đã review. Latest chỉ dùng cho máy cá nhân/sandbox khi chấp nhận cập nhật nhanh.
15
15
 
16
- Support matrix release hiện tại: macOS Apple Silicon + Bash và Linux x64 + Bash đã được verify; macOS Intel + Bash và Linux ARM64 + Bash là supported target cần chạy `piagent-doctor` + smoke test trước khi rollout rộng; native Windows chưa phải target rollout team; WSL2 experimental/chưa release-gate. Node.js tối thiểu là `22.19.0`, Pi Coding Agent là `0.81.1`.
16
+ Support matrix release hiện tại: macOS Apple Silicon + Bash và Linux x64 + Bash đã được verify; macOS Intel + Bash và Linux ARM64 + Bash là supported target cần chạy `piagent-doctor` + smoke test trước khi rollout rộng; native Windows chưa phải target rollout team; WSL2 experimental/chưa release-gate. Node.js tối thiểu là `22.19.0`, Pi Coding Agent là `0.82.0`.
17
17
 
18
18
  ```bash
19
19
  node --version # >= 22.19.0
20
- npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1
21
- npm install -g --ignore-scripts @piagent/platform@1.0.2
20
+ npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
21
+ npm install -g --ignore-scripts @piagent/platform@1.1.0
22
22
  piagent-install --stable --dry-run
23
23
  piagent-install --stable
24
24
  ```
25
25
 
26
- Khi seed `.pi/settings.json` cho team/repo cần audit lặp lại, giữ package source dạng pinned tag như `git:github.com/Vt-mmm/piagent@v1.0.2`. Máy cá nhân có thể dùng `git:github.com/Vt-mmm/piagent` để theo latest.
26
+ Khi seed `.pi/settings.json` cho team/repo cần audit lặp lại, giữ package source dạng pinned tag như `git:github.com/Vt-mmm/piagent@v1.1.0`. Máy cá nhân có thể dùng `git:github.com/Vt-mmm/piagent` để theo latest.
27
27
 
28
28
  Nếu đang ở source checkout của platform, dùng helper theo channel để preview trước khi đổi:
29
29
 
@@ -37,7 +37,7 @@ bash scripts/install-global.sh --stable
37
37
  Full update phải đồng bộ exact Pi host trước, rồi npm-global helper và Pi package matching:
38
38
 
39
39
  ```bash
40
- npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1
40
+ npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
41
41
  npm install -g --ignore-scripts @piagent/platform@X.Y.Z
42
42
  piagent-install --stable --dry-run
43
43
  piagent-install --stable
@@ -98,8 +98,8 @@ install package once
98
98
  ### Cài Pi và package platform
99
99
 
100
100
  ```bash
101
- npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1
102
- npm install -g --ignore-scripts @piagent/platform@1.0.2
101
+ npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
102
+ npm install -g --ignore-scripts @piagent/platform@1.1.0
103
103
  piagent-install --stable --dry-run
104
104
  piagent-install --stable
105
105
  ```
@@ -269,7 +269,7 @@ Không phải daily default. Dùng khi muốn tạo sẵn `.pi` files cho projec
269
269
  bash /path/to/piagent/scripts/setup.sh /path/to/project \
270
270
  --project-only \
271
271
  --profile auto \
272
- --package-source git:github.com/Vt-mmm/piagent@v1.0.2 \
272
+ --package-source git:github.com/Vt-mmm/piagent@v1.1.0 \
273
273
  --mcp-preset core \
274
274
  --subagents-preset safe
275
275
  ```
@@ -842,10 +842,10 @@ Watchdog là optional adversarial reviewer ở cuối turn, không bật mặc
842
842
 
843
843
  | Command | Dùng để |
844
844
  |---|---|
845
- | `npm install -g --ignore-scripts @piagent/platform@1.0.2` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
846
- | `pi install git:github.com/Vt-mmm/piagent@v1.0.2` | Install pinned release cho reproducible team setup. |
845
+ | `npm install -g --ignore-scripts @piagent/platform@1.1.0` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
846
+ | `pi install git:github.com/Vt-mmm/piagent@v1.1.0` | Install pinned release cho reproducible team setup. |
847
847
  | `pi install git:github.com/Vt-mmm/piagent` | Install latest platform package cho máy cá nhân/sandbox. |
848
- | Cài exact Pi host của release, rồi `npm install -g --ignore-scripts @piagent/platform@X.Y.Z` và `piagent-install --stable` | Full update: đồng bộ host, terminal helper và Pi package. v1.0.2 yêu cầu Pi `0.81.1`. |
848
+ | Cài exact Pi host của release, rồi `npm install -g --ignore-scripts @piagent/platform@X.Y.Z` và `piagent-install --stable` | Full update: đồng bộ host, terminal helper và Pi package. Mỗi release pin một Pi host chính xác; lấy đúng version của release đang cài trong [release/install policy](release-install-policy.md). |
849
849
  | Cài exact Pi host ghi trong release cũ, rồi helper `vPREVIOUS` và `piagent-install --stable` | Full rollback; đánh giá lại dependency findings của host cũ trước khi hạ version. |
850
850
  | `piagent-uninstall` | Báo cáo sẽ gỡ những gì. Dry run, không đụng gì. |
851
851
  | `piagent-uninstall --apply` | Gỡ Pi package của platform khỏi Pi settings global. |
@@ -940,7 +940,7 @@ Mở lại Pi session sau khi install.
940
940
  Cài lại terminal helper đúng release rồi kiểm tra `PATH`:
941
941
 
942
942
  ```bash
943
- npm install -g --ignore-scripts @piagent/platform@1.0.2
943
+ npm install -g --ignore-scripts @piagent/platform@1.1.0
944
944
  command -v piagent-install
945
945
  ```
946
946
 
@@ -43,6 +43,7 @@ pi install /path/to/piagent
43
43
  - `0.1.x`: local/internal pilot.
44
44
  - `0.2.x`: có guard ổn định và docs team.
45
45
  - `1.0.2`: đủ security review, MCP registry, adapter schema versioned.
46
+ - `1.1.0`: đọc document ngoài project qua `additionalReadRoots`, MCP baseline bật mặc định ở cả hai lệnh install, pin Pi host `0.82.0`.
46
47
 
47
48
  ## Không publish
48
49
 
@@ -33,105 +33,22 @@ npm install -g @piagent/platform
33
33
  piagent-setup
34
34
  ```
35
35
 
36
- Chạy `piagent-setup` ngay trong thư mục project. Nó tự cài đúng Pi Coding Agent `0.81.1` mà release này pin, cài Pi package, khởi tạo `.pi/`, rồi chạy doctor. Nó cũng cài MCP baseline và subagents; thêm `--no-mcp`, `--no-subagents` nếu không cần, hoặc `--global-only` nếu chưa muốn đụng project nào.
36
+ Chạy `piagent-setup` ngay trong thư mục project. Nó tự cài đúng Pi Coding Agent `0.82.0` mà release này pin, cài Pi package, khởi tạo `.pi/`, rồi chạy doctor. Nó cũng cài MCP baseline, subagents, và Herdr Pi integration nếu `herdr` đã có sẵn trên `PATH`; thêm `--no-mcp`, `--no-subagents`, `--no-herdr` nếu không cần, hoặc `--global-only` nếu chưa muốn đụng project nào.
37
37
 
38
- Vì chạy từ package đã cài, source ghi vào `.pi/settings.json` là `npm:@piagent/platform@<version>` — portable, commit được.
39
-
40
- Muốn cài tay từng lớp để kiểm soát chặt hơn:
41
-
42
- ```bash
43
- node --version # >= 22.19.0
44
- npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1
45
- npm install -g --ignore-scripts @piagent/platform@1.0.2
46
- piagent-install --stable --dry-run
47
- piagent-install --stable
48
- ```
49
-
50
- Lệnh trên cài Pi CLI, cài terminal command `piagent-*`, rồi install Pi Agent Platform bằng stable release đã resolve tag thành commit SHA. Trong output installer, `currentRelease` là version của terminal helper đang chạy. `v1.0.2` là release hiện tại của docs này.
51
-
52
- Nếu chỉ cần cài package vào Pi và không cần terminal command helper:
53
-
54
- ```bash
55
- pi install git:github.com/Vt-mmm/piagent@v1.0.2
56
- ```
57
-
58
- Nếu đang ở source checkout của platform, có thể preview và áp stable bằng helper:
59
-
60
- ```bash
61
- bash scripts/install-global.sh --stable --dry-run
62
- bash scripts/install-global.sh --stable
63
- ```
64
-
65
- Helper stable sẽ resolve tag release hiện tại thành commit SHA trước khi install, nên user vẫn dùng lệnh ngắn nhưng team nhận source bất biến hơn.
66
-
67
- Khi update toàn bộ platform, cập nhật exact Pi host trước rồi dùng helper target để cài Pi package tương ứng:
68
-
69
- ```bash
70
- npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1
71
- npm install -g --ignore-scripts @piagent/platform@X.Y.Z
72
- piagent-install --stable --dry-run
73
- piagent-install --stable
74
- ```
75
-
76
- Rollback toàn bộ dùng cùng flow với `vPREVIOUS`, nhưng phải lấy exact host version từ release policy của target và đánh giá lại dependency risk trước khi hạ host. Nếu chủ ý chỉ đổi Pi package và giữ host/helper hiện tại:
38
+ Nếu dùng [Herdr](https://herdr.dev/docs/install/) thì cài Herdr **trước** `piagent-setup`:
77
39
 
78
40
  ```bash
79
- piagent-install --version vX.Y.Z --resolve-tag --dry-run
80
- piagent-install --version vX.Y.Z --resolve-tag
41
+ brew install herdr # macOS
42
+ curl -fsSL https://herdr.dev/install.sh | sh # macOS hoặc Linux
81
43
  ```
82
44
 
83
- Checklist release canonical nằm tại [release-install-policy.md](release-install-policy.md).
84
-
85
- Máy cá nhân hoặc sandbox có thể dùng latest nếu chấp nhận cập nhật nhanh:
86
-
87
- ```bash
88
- bash scripts/install-global.sh --dev --dry-run
89
- bash scripts/install-global.sh --dev
90
- ```
91
-
92
- Sau bước này, project mới không cần chạy bash init profile. Chỉ cần:
93
-
94
- ```bash
95
- cd /path/to/project
96
- pi
97
- ```
45
+ Không có `herdr` trên `PATH` thì bước integration bị bỏ qua kèm cảnh báo, cài Herdr sau phải chạy lại `piagent-setup --global-only`. Bản `curl` chạy script tải về lúc cài; muốn kiểm tra được thì dùng `brew` hoặc tải từ [GitHub releases](https://github.com/ogulcancelik/herdr/releases). Herdr bản stable hỗ trợ macOS và Linux; Windows mới ở mức preview, mà cũng nằm ngoài runtime matrix của platform này.
98
46
 
99
- Với project đã tin cậy, có thể dùng wrapper để Pi tự approve project-local resources cho lần chạy đó:
100
-
101
- ```bash
102
- piagent-auto
103
- ```
104
-
105
- Read-only auto-run:
106
-
107
- ```bash
108
- piagent-auto --read-only -p "Scout payment mapping. Do not edit source."
109
- ```
110
-
111
- Trusted full-access style run cho repo đã kiểm soát:
112
-
113
- ```bash
114
- piagent-auto --full-access -p "Run the trusted local benchmark suite."
115
- ```
116
-
117
- Wrapper này không bypass piagent guard; nó wrap `pi --approve` và set permission profile cho lần chạy. Dù dùng `--full-access`, protected paths, redaction, destructive shell checks, task gate, và verify evidence vẫn chạy.
118
-
119
- Nếu đã ở trong Pi session, dùng slash command cho nhanh:
120
-
121
- ```text
122
- /permission-status
123
- /full-access Implement/refactor task trong repo trusted này.
124
- ```
47
+ Vì chạy từ package đã cài, source ghi vào `.pi/settings.json` là `npm:@piagent/platform@<version>` — portable, commit được.
125
48
 
126
- `/full-access <task>` chỉ bật full-access cho session hiện tại, không tự ghi `.pi/piagent-profile.json`.
49
+ Xong. Từ đây project nào cũng chỉ cần `cd` vào rồi gõ `pi`.
127
50
 
128
- Nếu chat box/ảnh chụp trả về local path thay vì attachment ảnh, dán path đó trực tiếp vào prompt:
129
-
130
- ```text
131
- /scout Check UI issue from screenshot /var/folders/.../screenshot.png
132
- ```
133
-
134
- Platform sẽ tự attach ảnh và rewrite prompt thành `[image1]` trước khi model xử lý. Hỗ trợ `.png/.jpg/.jpeg/.gif/.webp/.bmp`, tối đa 4 ảnh, 8 MB mỗi ảnh.
51
+ Rollout team pin từng bước, update, rollback, và channel `--dev` cho máy cá nhân: [release-install-policy.md](release-install-policy.md).
135
52
 
136
53
  ## Bước 2 — login OAuth OpenAI Codex/ChatGPT hoặc Claude/Anthropic
137
54
 
@@ -157,47 +74,9 @@ Sau khi login và chọn model intended cho project understanding:
157
74
  /memory-policy
158
75
  ```
159
76
 
160
- Global setup đã config sẵn `enabledModels` cho các provider model families. Anh đổi model bằng selector/hotkey:
161
-
162
- ```text
163
- Ctrl+L # model selector
164
- Ctrl+P # đổi model trong scope
165
- Shift+Tab # đổi thinking
166
- ```
167
-
168
- Nếu muốn xem/re-apply model scope từ terminal: `piagent-models` và `piagent-model-scope --preset full`.
169
-
170
- Nếu muốn xem/re-apply MCP baseline từ terminal:
171
-
172
- ```bash
173
- piagent-mcp --preset core --scope global --replace
174
- piagent-mcp --preset popular --scope global --replace
175
- piagent-mcp --list
176
- ```
177
-
178
- Nếu clone repo GitHub và chưa link npm bin, dùng fallback:
179
-
180
- ```bash
181
- bash /path/to/piagent/scripts/configure-mcp.sh --preset core --scope global --replace
182
- ```
183
-
184
- Nếu muốn xem/re-apply subagents baseline từ terminal:
185
-
186
- ```bash
187
- piagent-subagents --preset safe
188
- # fallback:
189
- bash /path/to/piagent/scripts/configure-subagents.sh --preset safe
190
- ```
77
+ `Ctrl+L` mở model selector, `Ctrl+P` đổi model trong scope, `Shift+Tab` đổi mức thinking. `piagent-setup` đã config sẵn `enabledModels`, MCP baseline preset `core`, và subagents preset `safe` — muốn xem hoặc đổi thì có [model-options.md](model-options.md), [mcp-and-tools.md](mcp-and-tools.md), [subagents-and-multiagent.md](subagents-and-multiagent.md).
191
78
 
192
- Nếu muốn dùng builtin `researcher` cho web/docs research trong Pi:
193
-
194
- ```bash
195
- pi install npm:pi-web-access@0.13.0
196
- # hoặc setup từ đầu:
197
- bash /path/to/piagent/scripts/setup.sh . --with-web-access
198
- ```
199
-
200
- Lệnh này yêu cầu model đọc qua project theo phạm vi có kiểm soát, rồi ghi:
79
+ `/onboard-project` yêu cầu model đọc qua project theo phạm vi có kiểm soát, rồi ghi:
201
80
 
202
81
  ```text
203
82
  .pi/piagent-profile.json
@@ -225,120 +104,41 @@ Nếu chưa có profile/tech stack, dùng select-style flow để tránh agent t
225
104
 
226
105
  ## Bước 4 — init thêm project khác
227
106
 
228
- ```bash
229
- bash /path/to/piagent/scripts/setup.sh /path/to/project \
230
- --project-only \
231
- --profile auto \
232
- --package-source git:github.com/Vt-mmm/piagent@v1.0.2 \
233
- --mcp-preset core \
234
- --subagents-preset safe
235
- ```
236
-
237
- Đổi profile sau này trong Pi:
107
+ Global đã cài rồi nên project sau chỉ cần init:
238
108
 
239
- ```text
240
- /profile list
241
- /profile setup
242
- /profile tech setup
243
- /profile be-readonly-fe
109
+ ```bash
110
+ cd /path/to/project
111
+ piagent-setup --project-only
244
112
  ```
245
113
 
246
- Profile built-in: `generic`, `web-frontend`, `backend-api`, `be-readonly-fe`, `fullstack`, `node-typescript`, `python`, `data`, `devops`, `mobile`, `docs`.
114
+ Nó ghi `npm:@piagent/platform@<version>` vào `.pi/settings.json` — portable, commit được cho cả team.
247
115
 
248
- ## Bước 5 — setup split/preseed nếu cần
249
-
250
- Script bash chỉ dùng khi muốn preseed config vào repo:
251
-
252
- ```bash
253
- bash /path/to/piagent/scripts/setup.sh /path/to/project \
254
- --profile be-readonly-fe \
255
- --package-source git:github.com/Vt-mmm/piagent@v1.0.2 \
256
- --mcp-preset core \
257
- --subagents-preset safe
258
- ```
116
+ Đổi profile sau này thì gõ `/profile setup` trong Pi. Profile built-in: `generic`, `web-frontend`, `backend-api`, `be-readonly-fe`, `fullstack`, `node-typescript`, `python`, `data`, `devops`, `mobile`, `docs`.
259
117
 
260
- ## Bước 6 — chạy hằng ngày
118
+ ## Bước 5 — chạy hằng ngày
261
119
 
262
120
  ```bash
263
- herdr
264
121
  cd <project>
265
122
  pi
266
123
  ```
267
124
 
268
- Prompt mẫu khi requirement chưa rõ:
269
-
270
- ```text
271
- /discuss Cải tiến workflow onboarding cho team mới. Chưa implement, chỉ hỏi lại phần còn thiếu và đề xuất plan.
272
- ```
273
-
274
- Prompt mẫu khi đã rõ task:
275
-
276
- ```text
277
- /task Implement this request. Use piagent_context, piagent_task_start, piagent_context_budget, piagent_exec_policy_check when shell is needed, piagent_verify_record, piagent_trace_record, and piagent_task_gate_check before done.
278
- ```
125
+ Rồi mô tả việc cần làm bằng tiếng Việt hoặc tiếng Anh. Không cần paste checklist — input guard tự collapse boilerplate, và `/task` tự cân nhắc gọi scout/planner/reviewer khi task đủ lớn.
279
126
 
280
- Prompt mẫu khi chỉ cần scout/read-only:
127
+ Muốn chạy nhiều agent song song thì gõ `herdr` thay vì `pi`, rồi mở mỗi pane một vai: implement, review read-only, verify, notes. Herdr chỉ điều phối terminal/session, không phải security boundary — gate vẫn nằm ở Pi extension và OAuth vẫn `/login` trong Pi. Chi tiết: [herdr-workflow.md](herdr-workflow.md).
281
128
 
282
- ```text
283
- /scout Scout payment FE mapping vs BE contract. Backend read-only. Do not edit source.
284
- ```
285
-
286
- Nếu session đang nặng hoặc gặp context overflow:
287
-
288
- ```text
289
- /fresh-scout Scout payment FE mapping vs BE contract. Backend read-only. Do not edit source.
290
- /fresh-task Implement <bounded task>.
291
- /fresh-be-to-fe Implement FE support from <BE contract>. Backend read-only.
292
- ```
293
-
294
- Không paste full mandatory flow hằng ngày. Từ `v0.3.21`, input guard tự collapse mandatory-flow boilerplate và fresh workflow tự mở session mới khi cần.
295
-
296
- Từ `v0.3.21`, `/task` có auto-delegation policy. Với task đủ lớn, parent agent phải tự cân nhắc dùng `piagent-scout`, `piagent-planner`, hoặc `piagent-reviewer`; anh không cần tự gọi `/run` nếu không muốn ép orchestration.
297
-
298
- Các workflow package đáng dùng khi muốn ép rõ shape:
299
-
300
- ```text
301
- /parallel-review current diff
302
- /review-loop current diff max 3 rounds
303
- /parallel-research <question cần external evidence + local code context>
304
- /parallel-context-build <task lớn cần context handoff>
305
- ```
306
-
307
- Prompt mẫu cho 2 recipe hay gặp:
308
-
309
- ```text
310
- /piagent-commands subagents
311
- /platform-improve Improve model selection, MCP setup, and onboarding docs for a public team package.
312
- /be-to-fe Implement FE from BE spec <endpoint/spec>. Backend read-only.
313
- /context-index search auth
314
- /memory-policy Show project memory policy and safe remember workflow.
315
- /run piagent-scout "Map target area read-only before planning."
316
- /run piagent-reviewer "Review current diff before final handoff."
317
- ```
318
-
319
- Cache external source repo để đọc targeted trong Pi:
320
-
321
- ```text
322
- Use piagent_source_checkout for github.com/org/repo, inspect only relevant files, then summarize applicable patterns.
323
- ```
324
-
325
- Runtime gate tools có sẵn:
326
-
327
- ```text
328
- piagent_exec_policy_check # check shell command
329
- piagent_context_budget # check context size/hard cap
330
- piagent_tool_policy_check # check tool capability
331
- piagent_task_gate_check # check before final DONE
332
- ```
333
-
334
- Fallback bằng shell nếu cần:
335
-
336
- ```bash
337
- PIAGENT_PLATFORM_HOME=/path/to/piagent
338
- bash "$PIAGENT_PLATFORM_HOME/packages/piagent-core/skills/piagent-source-cache/checkout-source-repo.sh" \
339
- github.com/org/repo \
340
- --path-only
341
- ```
129
+ | Gõ | Khi nào |
130
+ |---|---|
131
+ | `/discuss <ý tưởng>` | Requirement chưa rõ, muốn hỏi lại trước. |
132
+ | `/task <việc>` | Đã rõ, làm luôn. |
133
+ | `/scout <việc>` | Chỉ đọc, không sửa — map payment/auth/BE contract. |
134
+ | `/plan <mục tiêu>` | Muốn có plan trước khi đụng code. |
135
+ | `/review current diff` | Review việc vừa làm. |
136
+ | `/be-to-fe <việc>` | Backend read-only, làm FE. |
137
+ | `/commit <message>` | Commit local có kiểm soát, không push. |
138
+ | `/pr <title>` | Tạo PR, hỏi xác nhận trước khi push. |
139
+ | `/fresh-task`, `/fresh-scout`, `/fresh-be-to-fe` | Session đang nặng hoặc tràn context. |
140
+
141
+ `/piagent-commands` liệt kê hết. Giải thích từng lệnh: [command-reference-vietnamese.md](command-reference-vietnamese.md). Các workflow ép shape rõ (`/parallel-review`, `/review-loop`, `/parallel-research`, `/parallel-context-build`): [subagents-and-multiagent.md](subagents-and-multiagent.md). Runtime gate tools và cách agent tự dùng chúng: [operator-manual-vietnamese.md](operator-manual-vietnamese.md).
342
142
 
343
143
  ## Việc user vẫn phải làm thủ công
344
144