@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.
- package/CHANGELOG.md +36 -23
- package/README.md +78 -366
- package/docs/command-reference-vietnamese.md +43 -4
- package/docs/distribution-standard.md +9 -9
- package/docs/herdr-workflow.md +22 -1
- package/docs/mcp-and-tools.md +27 -3
- package/docs/operator-manual-vietnamese.md +12 -12
- package/docs/publishing-for-teams.md +1 -0
- package/docs/quickstart-vietnamese.md +32 -232
- package/docs/release-install-policy.md +16 -10
- package/docs/security-threat-model.md +1 -1
- package/docs/task-lifecycle-vietnamese.md +139 -0
- package/docs/team-onboarding.md +8 -7
- package/docs-site/index.html +36 -88
- package/package.json +4 -3
- package/packages/piagent-core/README.md +2 -1
- package/packages/piagent-core/extensions/document-intake.ts +436 -0
- package/packages/piagent-core/extensions/guard-types.ts +1 -0
- package/packages/piagent-core/extensions/piagent-guard.ts +120 -0
- package/packages/piagent-core/package.json +2 -2
- package/schemas/project-profile.schema.json +8 -0
- package/scripts/check-published-site.mjs +189 -0
- package/scripts/configure-mcp.sh +34 -1
- package/scripts/init-project.sh +19 -0
- package/scripts/install-global.sh +26 -8
- package/scripts/team-doctor.sh +1 -1
- package/scripts/uninstall-global.sh +4 -1
- package/scripts/verify-local.sh +113 -69
|
@@ -8,9 +8,9 @@ This file is the canonical install, update, rollback, and release checklist. Oth
|
|
|
8
8
|
|
|
9
9
|
## Supported runtime matrix
|
|
10
10
|
|
|
11
|
-
All supported environments require Node.js `>=22.19.0` and Pi Coding Agent `0.
|
|
11
|
+
All supported environments require Node.js `>=22.19.0` and Pi Coding Agent `0.82.0`. The Pi host is installed as a Node CLI; Pi Agent Platform still defines its own release matrix because the terminal helpers and shell policy rely on Bash/POSIX behavior.
|
|
12
12
|
|
|
13
|
-
| Surface | Status for v1.0
|
|
13
|
+
| Surface | Status for v1.1.0 | Rollout guidance |
|
|
14
14
|
|---|---|---|
|
|
15
15
|
| macOS Apple Silicon (`darwin/arm64`) + Bash | Verified for this release. | Safe default for team rollout after normal project smoke tests. |
|
|
16
16
|
| Linux x64 + Bash | Verified in GitHub Actions. | Safe default for CI/server usage after normal project smoke tests. |
|
|
@@ -33,7 +33,7 @@ These three components are versioned independently. A full install, update, or r
|
|
|
33
33
|
|
|
34
34
|
| Channel | Source shape | Mutability | Use when |
|
|
35
35
|
|---|---|---:|---|
|
|
36
|
-
| `stable` | `git:github.com/Vt-mmm/piagent@<resolved-commit-sha>` from `v1.0
|
|
36
|
+
| `stable` | `git:github.com/Vt-mmm/piagent@<resolved-commit-sha>` from `v1.1.0` | Fixed after resolution | Default for team rollout. |
|
|
37
37
|
| `exact` | Tag, reviewed commit, or a tag resolved with `--resolve-tag` | Fixed when using a commit SHA | Pi-package-only roll forward, rollback, or reproduction. |
|
|
38
38
|
| `dev` | `git:github.com/Vt-mmm/piagent` | Moving | Personal machine or sandbox only. |
|
|
39
39
|
| `local` | `/path/to/piagent` | Local workspace | Platform development and dry-run validation. |
|
|
@@ -52,8 +52,8 @@ Use this flow when the team needs both terminal commands and the Pi package:
|
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
54
|
node --version # >= 22.19.0
|
|
55
|
-
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.
|
|
56
|
-
npm install -g --ignore-scripts @piagent/platform@1.0
|
|
55
|
+
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
|
|
56
|
+
npm install -g --ignore-scripts @piagent/platform@1.1.0
|
|
57
57
|
piagent-install --stable --dry-run
|
|
58
58
|
piagent-install --stable
|
|
59
59
|
```
|
|
@@ -61,8 +61,8 @@ piagent-install --stable
|
|
|
61
61
|
The stable preview and apply output includes:
|
|
62
62
|
|
|
63
63
|
```text
|
|
64
|
-
currentRelease: v1.0
|
|
65
|
-
tag: v1.0
|
|
64
|
+
currentRelease: v1.1.0 (helper package version)
|
|
65
|
+
tag: v1.1.0
|
|
66
66
|
resolvedCommit: <40-char-sha>
|
|
67
67
|
source: git:github.com/Vt-mmm/piagent@<40-char-sha>
|
|
68
68
|
```
|
|
@@ -79,7 +79,7 @@ bash scripts/install-global.sh --stable
|
|
|
79
79
|
Use this only when terminal commands are not needed:
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
-
pi install git:github.com/Vt-mmm/piagent@v1.0
|
|
82
|
+
pi install git:github.com/Vt-mmm/piagent@v1.1.0
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
Direct `pi install` does not create `piagent-*` commands on `PATH`.
|
|
@@ -89,7 +89,7 @@ Direct `pi install` does not create `piagent-*` commands on `PATH`.
|
|
|
89
89
|
Update the exact supported Pi host first, then the npm-global helper, then let that target helper resolve and install its matching stable Pi package:
|
|
90
90
|
|
|
91
91
|
```bash
|
|
92
|
-
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.
|
|
92
|
+
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
|
|
93
93
|
npm install -g --ignore-scripts @piagent/platform@X.Y.Z
|
|
94
94
|
piagent-install --stable --dry-run
|
|
95
95
|
piagent-install --stable
|
|
@@ -264,7 +264,13 @@ Re-running the workflow from a branch instead skips publishing, because the publ
|
|
|
264
264
|
```
|
|
265
265
|
|
|
266
266
|
The open release pull request should then resolve against the same commit history. This bypass exists only to reconcile reviewed PR checks with tag-first Vercel promotion; it must never be used for an unreviewed commit or a force-push. If Vercel auto-deploys `main`, this exact fast-forward is the production promotion. For an explicit CLI deploy instead, check out the exact tag, run `vercel link --cwd docs-site --project pi-agent`, require `npm run vercel:preflight` to pass, then deploy with `vercel --cwd docs-site --prod`.
|
|
267
|
-
8. Verify the live docs
|
|
267
|
+
8. Verify the live docs site at every address it resolves to, then read the page for links and install commands.
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
npm run site:check
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Opening the site in a browser does not answer this. The domain has several address records, so one can be dead or looping while every manual look lands on a healthy one. This resolves both hosts, asks each address directly with the right `Host` header and SNI, and requires each to return the released version. A redirect from an address back to its own host is reported as a loop rather than followed. An address the machine has no route to is reported as unverified, not as a pass.
|
|
268
274
|
9. Publish the already-reviewed draft only after production verification passes:
|
|
269
275
|
|
|
270
276
|
```bash
|
|
@@ -21,7 +21,7 @@ This document covers the packaged guard, project profiles, capability locks, ins
|
|
|
21
21
|
- The operator, operating-system account, Pi host, and explicitly trusted project repository are trusted to execute code.
|
|
22
22
|
- Project-local Pi resources are loaded only after Pi project trust or an explicit operator override.
|
|
23
23
|
- A human remains available to approve destructive and external-provider actions.
|
|
24
|
-
- Supported release verification covers macOS Apple Silicon + Bash, Linux x64 + Bash, Node.js `>=22.19.0`, and the exact Pi host version declared by the release. macOS Intel + Bash and Linux ARM64 + Bash are supported targets that need local smoke verification before broad rollout. Native Windows is not a team-rollout target for v1.0
|
|
24
|
+
- Supported release verification covers macOS Apple Silicon + Bash, Linux x64 + Bash, Node.js `>=22.19.0`, and the exact Pi host version declared by the release. macOS Intel + Bash and Linux ARM64 + Bash are supported targets that need local smoke verification before broad rollout. Native Windows is not a team-rollout target for v1.1.0, and WSL2 is experimental/unverified.
|
|
25
25
|
- Registry, GitHub, model-provider, MCP-provider, and Vercel controls are external dependencies. Their account security and platform guarantees are not replaced by this repository.
|
|
26
26
|
|
|
27
27
|
## Threat actors and failure modes
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Vòng đời một task: research → plan → execute → verify → loop
|
|
2
|
+
|
|
3
|
+
## Mục tiêu
|
|
4
|
+
|
|
5
|
+
Tài liệu này mô tả một task chạy qua platform từ đầu tới cuối, và nói thẳng harness hiện tại đỡ được khâu nào, chưa đỡ được khâu nào. Mọi nhận định đều dẫn tới dòng code cụ thể, để khi code đổi thì tài liệu này sai một cách kiểm tra được chứ không sai âm thầm.
|
|
6
|
+
|
|
7
|
+
Contract fields và enforcement level nằm ở [task-implementation-contract.md](task-implementation-contract.md). Tài liệu này nói về *luồng*, không lặp lại field.
|
|
8
|
+
|
|
9
|
+
## Năm pha
|
|
10
|
+
|
|
11
|
+
### 1. Research — hiểu trước khi hứa
|
|
12
|
+
|
|
13
|
+
Đầu vào: yêu cầu của người dùng, tài liệu spec, code sẵn có.
|
|
14
|
+
|
|
15
|
+
Harness cung cấp:
|
|
16
|
+
|
|
17
|
+
- `/scout` — pha read-only, không được sửa source. Dùng để map payment/auth/BE contract trước khi quyết có làm hay không.
|
|
18
|
+
- `piagent_context_index_search` — bản đồ node/edge/citation compact để tìm điểm vào repo. Kết quả là **advisory**: phải mở file thật và verify trước khi sửa.
|
|
19
|
+
- `piagent_memory_search` + `piagent_memory_citation_record` — Field Guide và memory của project, cũng advisory, cũng phải verify lại.
|
|
20
|
+
- `piagent_source_checkout` — cache repo ngoài để đọc có mục tiêu.
|
|
21
|
+
- `piagent_document_read` — đọc spec `.md`/`.pdf`/`.docx` từ project hoặc folder đã cấp trong `additionalReadRoots` (ví dụ `~/Downloads`). Nội dung trả về là **dữ liệu**, không phải chỉ thị.
|
|
22
|
+
- Context7 qua MCP cho tài liệu vendor. Ghi snapshot ngắn bằng `piagent_profile_tech_context_record`, không paste nguyên khối doc vào file project.
|
|
23
|
+
|
|
24
|
+
Ràng buộc: `piagent_context_preflight` chạy **trước** (`task.md` bước 0). Nếu nó trả `fresh-session` thì dừng nạp context ở session này.
|
|
25
|
+
|
|
26
|
+
### 2. Plan — biến hiểu biết thành cam kết kiểm được
|
|
27
|
+
|
|
28
|
+
`piagent_task_start` dựng Task Implementation Contract. Đây là chỗ task trở thành thứ có thể chấm điểm:
|
|
29
|
+
|
|
30
|
+
| Field | Nó ràng buộc điều gì |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `riskLane` | `tiny` \| `normal` \| `high-risk` — quyết định mức gate |
|
|
33
|
+
| `acceptanceCriteria` | Định nghĩa "xong", viết trước khi làm |
|
|
34
|
+
| `scope` / `outOfScope` | Ranh giới, để review biết cái gì là lạc đề |
|
|
35
|
+
| `protectedPaths` | Đường không được đụng |
|
|
36
|
+
| `verifyCommands` | **Lệnh chính xác** sẽ dùng làm bằng chứng |
|
|
37
|
+
| `reviewLenses` | `correctness` \| `tests` \| `scope` \| `security` \| `docs` \| `release` \| `package` |
|
|
38
|
+
| `workPlan` | Cây task tối đa 12 node, mỗi node có `role` và `mode` |
|
|
39
|
+
|
|
40
|
+
`workPlan[].mode` là `read-only` \| `single-writer` \| `review`. Mặc định là single-writer: chỉ một tác nhân được ghi, trừ khi người dùng yêu cầu rõ parallel writers.
|
|
41
|
+
|
|
42
|
+
`piagent_orchestration_policy` quyết định có gọi subagent không. Chính sách là solo-first — subagent chỉ dùng khi việc đó độc lập và nặng phần đọc.
|
|
43
|
+
|
|
44
|
+
### 3. Execute — làm trong hàng rào
|
|
45
|
+
|
|
46
|
+
Trong lúc làm, guard chặn trước khi thực thi, không phải sau:
|
|
47
|
+
|
|
48
|
+
- Protected path: chặn ở `read`, `write`, `edit`, `grep`, `find`, `ls`, tool MCP, và cả đường vòng qua shell.
|
|
49
|
+
- `piagent_exec_policy_check` — bắt buộc trước lệnh shell vượt quá read/list/test.
|
|
50
|
+
- `piagent_tool_policy_check` — bắt buộc trước tool MCP/app ngoài piagent.
|
|
51
|
+
- `piagent_context_budget` — kiểm trước khi nạp file lớn hoặc lạ.
|
|
52
|
+
- `piagent_context_record` — ghi lại đọc file nào, vì lý do gì.
|
|
53
|
+
|
|
54
|
+
### 4. Verify — chỗ mạnh nhất của harness
|
|
55
|
+
|
|
56
|
+
Đây là phần được thiết kế kỹ nhất, và đáng để hiểu chính xác.
|
|
57
|
+
|
|
58
|
+
Bằng chứng verify **không phải** thứ agent tự khai. Guard nghe `tool_result` của Pi và ghi vào sổ `.pi/piagent-state/observed-bash.jsonl` ([`piagent-guard.ts:1378`](../packages/piagent-core/extensions/piagent-guard.ts)). `piagent_verify_record` chỉ nhận bằng chứng khớp được với một quan sát thật, sau thời điểm task bắt đầu.
|
|
59
|
+
|
|
60
|
+
`evaluateTaskGate` ([`piagent-guard.ts:3125`](../packages/piagent-core/extensions/piagent-guard.ts)) đòi ba điều kiện cộng dồn để một bằng chứng được tính là **pass**:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
evidence.exitCode === 0
|
|
64
|
+
&& evidence.observed === true // đã quan sát được, không phải khai báo
|
|
65
|
+
&& evidence.matchedProfileCommand === true // khớp đúng verifyCommands của task
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Thiếu bất kỳ điều nào thì bằng chứng vẫn được ghi, nhưng chỉ ở mức advisory và gate không tính. Cụ thể:
|
|
69
|
+
|
|
70
|
+
- `observed !== true` → cảnh báo "Unobserved verify evidence is ignored by the passing verify gate."
|
|
71
|
+
- `observed === true` nhưng lệnh không khớp `verifyCommands` → "advisory only".
|
|
72
|
+
|
|
73
|
+
Nghĩa là `true`, `echo ok`, `npm test || true` không mua được chữ "done". Đó là chủ ý: một cổng có thể lách được thì tệ hơn không có cổng, vì nó vẫn hiện màu xanh.
|
|
74
|
+
|
|
75
|
+
`piagent_task_gate_check` trả `pass` hoặc `fail` kèm danh sách `missing`. `task.md` bước 16: gate fail thì outcome là `blocked`/`partial`, **không phải** `done`.
|
|
76
|
+
|
|
77
|
+
### 5. Fail → loop lại
|
|
78
|
+
|
|
79
|
+
Đây là chỗ đứt. Xem mục [Chỗ đứt, nói chính xác](#chỗ-đứt-nói-chính-xác).
|
|
80
|
+
|
|
81
|
+
## Pi hiện tại xử lý tới đâu
|
|
82
|
+
|
|
83
|
+
| Pha | Trạng thái | Căn cứ |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| Research | **Đủ** | `/scout`, context index, memory, Context7, source checkout |
|
|
86
|
+
| Plan | **Đủ** | `piagent_task_start` + 19 field contract + `workPlan` |
|
|
87
|
+
| Execute | **Đủ** | Chặn trước thực thi ở mọi đường: tool, MCP, shell |
|
|
88
|
+
| Verify | **Mạnh** | Bằng chứng phải quan sát được và khớp lệnh, không tự khai được |
|
|
89
|
+
| Fail → loop | **Nửa vời** | Phát hiện được, từ chối nhận done được, nhưng không mang được state qua lần sau |
|
|
90
|
+
|
|
91
|
+
### Chỗ đứt, nói chính xác
|
|
92
|
+
|
|
93
|
+
Harness **phát hiện** thất bại tốt:
|
|
94
|
+
|
|
95
|
+
- `trace.outcome` có `failed`, `blocked`, `partial` bên cạnh `completed`.
|
|
96
|
+
- `task.md` bước 18: verify không chạy được thì dừng và báo blocker chính xác, không được gọi là done.
|
|
97
|
+
- Gate trả `missing` liệt kê đúng thứ còn thiếu.
|
|
98
|
+
|
|
99
|
+
Nhưng nó **không mang được gì sang lần thử sau**:
|
|
100
|
+
|
|
101
|
+
1. **Contract không có bộ đếm lần thử.** Không có `attempt`, không có `previousAttempts`. Lần thử thứ hai bắt đầu như thể chưa từng có lần một.
|
|
102
|
+
2. **`workPlan[].status` không có giá trị `failed`.** Enum chỉ là `pending` \| `in-progress` \| `done` \| `skipped` ([`schemas/task-contract.schema.json`](../schemas/task-contract.schema.json)). Một node đã thử và hỏng chỉ có thể ghi là `skipped` — mất nghĩa.
|
|
103
|
+
3. **Không có chỗ ghi giả thuyết đã loại.** Verify fail vì lý do gì, đã thử cách nào, tại sao không được — không field nào giữ. Lần sau agent rất dễ thử lại đúng cách đã hỏng.
|
|
104
|
+
4. **Không có trần số vòng.** Không có gì chặn loop vô hạn ngoài sự kiên nhẫn của người dùng.
|
|
105
|
+
|
|
106
|
+
`/review-loop` có tồn tại và đúng là loop, nhưng nó đến từ add-on `pi-subagents` chứ không phải platform này, và nó lặp vòng review→fix, không phải vòng research→plan→execute→verify.
|
|
107
|
+
|
|
108
|
+
### Đề xuất để khép vòng
|
|
109
|
+
|
|
110
|
+
Thêm vào contract, không đổi thứ đang có:
|
|
111
|
+
|
|
112
|
+
```jsonc
|
|
113
|
+
{
|
|
114
|
+
"attempt": 2, // lần thử hiện tại
|
|
115
|
+
"maxAttempts": 3, // trần, gate fail cứng khi vượt
|
|
116
|
+
"previousAttempts": [
|
|
117
|
+
{
|
|
118
|
+
"attempt": 1,
|
|
119
|
+
"failedAt": "verify", // research | plan | execute | verify
|
|
120
|
+
"reason": "npm test — 3 test đỏ ở auth/session",
|
|
121
|
+
"ruledOut": "Không phải do token expiry; đã kiểm bằng fixture cố định giờ."
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Và mở `workPlan[].status` thêm giá trị `failed`.
|
|
128
|
+
|
|
129
|
+
Chi phí: một field mảng trong schema, một nhánh trong `evaluateTaskGate`, một bước trong `task.md`. Đổi lại, lần thử thứ hai đọc được lần thứ nhất đã loại trừ gì — đó là toàn bộ giá trị của việc loop thay vì làm lại.
|
|
130
|
+
|
|
131
|
+
Đây là đề xuất, chưa implement. Cần chốt trước khi làm.
|
|
132
|
+
|
|
133
|
+
## Liên quan
|
|
134
|
+
|
|
135
|
+
- [task-implementation-contract.md](task-implementation-contract.md) — field và enforcement level
|
|
136
|
+
- [workflow-recipes.md](workflow-recipes.md) — công thức cho từng loại việc
|
|
137
|
+
- [runtime-policy-design.md](runtime-policy-design.md) — thiết kế lớp policy
|
|
138
|
+
- [security-threat-model.md](security-threat-model.md) — giả định, vector, và rủi ro còn lại
|
|
139
|
+
- [command-reference-vietnamese.md](command-reference-vietnamese.md) — giải thích từng lệnh
|
package/docs/team-onboarding.md
CHANGED
|
@@ -8,8 +8,8 @@ Một thành viên mới không cần biết local path của maintainer. Luồn
|
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
node --version # >= 22.19.0
|
|
11
|
-
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.
|
|
12
|
-
npm install -g --ignore-scripts @piagent/platform@1.0
|
|
11
|
+
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
|
|
12
|
+
npm install -g --ignore-scripts @piagent/platform@1.1.0
|
|
13
13
|
piagent-install --stable
|
|
14
14
|
cd /path/to/project
|
|
15
15
|
pi
|
|
@@ -24,13 +24,14 @@ pi
|
|
|
24
24
|
## Prerequisites
|
|
25
25
|
|
|
26
26
|
- Node.js >=22.19.0.
|
|
27
|
-
- Pi Coding Agent `0.
|
|
27
|
+
- Pi Coding Agent `0.82.0`.
|
|
28
28
|
- Runtime rollout:
|
|
29
29
|
- verified: macOS Apple Silicon + Bash, Linux x64 + Bash;
|
|
30
30
|
- supported target cần smoke trước khi rollout rộng: macOS Intel + Bash, Linux ARM64 + Bash;
|
|
31
31
|
- chưa dùng làm target rollout team: native Windows; WSL2 chỉ experimental.
|
|
32
32
|
- `pi` có trên `PATH`.
|
|
33
33
|
- `herdr` optional nhưng nên có nếu team chạy nhiều agent pane.
|
|
34
|
+
- MCP: `piagent-install` seed preset `core` mặc định (bỏ qua bằng `--no-mcp`). Server connect lazy nên trước lần gọi đầu còn cần Chrome cho `chrome-devtools`, và **Docker đang chạy + `export GITHUB_PERSONAL_ACCESS_TOKEN`** cho `github`. Chi tiết: [MCP và tool policy](mcp-and-tools.md).
|
|
34
35
|
- Git access tới repo platform nếu dùng `git:` package source.
|
|
35
36
|
- OAuth/API access riêng của từng người. Không share token.
|
|
36
37
|
|
|
@@ -40,8 +41,8 @@ Mặc định team dùng stable helper:
|
|
|
40
41
|
|
|
41
42
|
```bash
|
|
42
43
|
node --version # >= 22.19.0
|
|
43
|
-
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.
|
|
44
|
-
npm install -g --ignore-scripts @piagent/platform@1.0
|
|
44
|
+
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
|
|
45
|
+
npm install -g --ignore-scripts @piagent/platform@1.1.0
|
|
45
46
|
piagent-install --stable --dry-run
|
|
46
47
|
piagent-install --stable
|
|
47
48
|
```
|
|
@@ -65,7 +66,7 @@ pi install git:github.com/Vt-mmm/piagent
|
|
|
65
66
|
Full update phải đồng bộ exact Pi host trước, sau đó terminal helper và Pi package matching:
|
|
66
67
|
|
|
67
68
|
```bash
|
|
68
|
-
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.
|
|
69
|
+
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
|
|
69
70
|
npm install -g --ignore-scripts @piagent/platform@X.Y.Z
|
|
70
71
|
piagent-install --stable --dry-run
|
|
71
72
|
piagent-install --stable
|
|
@@ -77,7 +78,7 @@ Full rollback dùng cùng sequence với `vPREVIOUS`, nhưng exact Pi host phả
|
|
|
77
78
|
Nếu team publish npm private:
|
|
78
79
|
|
|
79
80
|
```bash
|
|
80
|
-
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.
|
|
81
|
+
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
|
|
81
82
|
pi install npm:@your-scope/platform@x.y.z
|
|
82
83
|
```
|
|
83
84
|
|
package/docs-site/index.html
CHANGED
|
@@ -798,7 +798,7 @@
|
|
|
798
798
|
<span>Pi Agent Platform</span>
|
|
799
799
|
</a>
|
|
800
800
|
<div class="top-actions">
|
|
801
|
-
<span class="pill"><span class="pill-dot"></span>v1.0
|
|
801
|
+
<span class="pill"><span class="pill-dot"></span>v1.1.0 docs</span>
|
|
802
802
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
803
803
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
804
804
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -927,14 +927,14 @@
|
|
|
927
927
|
<p class="section-kicker">Quickstart</p>
|
|
928
928
|
<h2>Step by step cho thành viên mới</h2>
|
|
929
929
|
<p class="section-lead">
|
|
930
|
-
|
|
930
|
+
Hai lệnh để cài, rồi mở repo, chọn profile, bật quyền phù hợp, chạy task, và verify bằng command thật. Gỡ cũng chỉ hai lệnh khi không dùng nữa.
|
|
931
931
|
</p>
|
|
932
932
|
|
|
933
933
|
<div class="steps">
|
|
934
934
|
<article class="step">
|
|
935
935
|
<div>
|
|
936
|
-
<h3>
|
|
937
|
-
<p>
|
|
936
|
+
<h3>Cài — hai lệnh</h3>
|
|
937
|
+
<p>Cần Node.js 22.19.0 trở lên. Không cần cài Pi Coding Agent trước: <span class="inline-code">piagent-setup</span> tự cài đúng bản <span class="inline-code">0.82.0</span> mà release <span class="inline-code">v1.1.0</span> đang pin. Chạy nó ngay trong thư mục project — nó cài Pi package, khởi tạo <span class="inline-code">.pi/</span>, cài MCP baseline cùng subagents, rồi chạy doctor. Thêm <span class="inline-code">--no-mcp</span>, <span class="inline-code">--no-subagents</span>, <span class="inline-code">--no-herdr</span> hoặc <span class="inline-code">--global-only</span> để bỏ bớt.</p>
|
|
938
938
|
<div class="table-wrap compact-table">
|
|
939
939
|
<table>
|
|
940
940
|
<thead>
|
|
@@ -963,87 +963,20 @@
|
|
|
963
963
|
</tbody>
|
|
964
964
|
</table>
|
|
965
965
|
</div>
|
|
966
|
-
<div class="command-card">
|
|
967
|
-
<header><span>Runtime prerequisites</span><button class="clip-btn" data-clip="node --version npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1 pi --version">Lấy lệnh</button></header>
|
|
968
|
-
<pre><code>node --version # >= 22.19.0
|
|
969
|
-
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1
|
|
970
|
-
pi --version</code></pre>
|
|
971
|
-
</div>
|
|
972
|
-
</div>
|
|
973
|
-
</article>
|
|
974
|
-
<article class="step">
|
|
975
|
-
<div>
|
|
976
|
-
<h3>Cài Pi Agent Platform có pin</h3>
|
|
977
|
-
<p>Đường ngắn nhất là hai lệnh: cài helper từ npm, rồi chạy <span class="inline-code">piagent-setup</span> ngay trong thư mục project. Lệnh đó tự cài đúng Pi host mà release này pin, cài Pi package, khởi tạo <span class="inline-code">.pi/</span> và chạy doctor. Nó cũng cài sẵn MCP baseline và subagents; thêm <span class="inline-code">--no-mcp</span>, <span class="inline-code">--no-subagents</span> nếu không muốn, hoặc <span class="inline-code">--global-only</span> nếu chưa đụng tới project nào.</p>
|
|
978
966
|
<div class="command-card">
|
|
979
967
|
<header><span>Hai lệnh</span><button class="clip-btn" data-clip="npm install -g @piagent/platform piagent-setup">Lấy lệnh</button></header>
|
|
980
968
|
<pre><code>npm install -g @piagent/platform
|
|
981
969
|
piagent-setup</code></pre>
|
|
982
970
|
</div>
|
|
983
|
-
<p>Vì chạy từ package đã cài, source ghi vào <span class="inline-code">.pi/settings.json</span> là <span class="inline-code">npm:@piagent/platform@<version></span> — giá trị này có nghĩa như nhau trên máy đồng đội, nên commit được.</p>
|
|
984
|
-
<p>
|
|
985
|
-
<p>Hai thành phần này lấy từ hai nguồn khác nhau, và đó là chủ ý. Helper là tarball đã publish nên npm verify được provenance attestation gắn với commit build ra nó. Pi package thì dựa vào việc resolve tag thành commit SHA rồi đối chiếu với <span class="inline-code">PIAGENT_EXPECTED_RELEASE_COMMIT</span> — một phép kiểm mà version range của registry không diễn đạt được. Trỏ <span class="inline-code">stable</span> sang npm là bỏ phép kiểm đó chứ không phải thay nó, nên nguồn <span class="inline-code">git:</span> được giữ nguyên. Máy không có quyền Git tới repo này thì dùng channel <span class="inline-code">npm:@piagent/platform@x.y.z</span>.</p>
|
|
986
|
-
<div class="command-card">
|
|
987
|
-
<header><span>Stable helper install</span><button class="clip-btn" data-clip="npm install -g --ignore-scripts @piagent/platform@1.0.2 piagent-install --stable --dry-run piagent-install --stable">Lấy lệnh</button></header>
|
|
988
|
-
<pre><code>npm install -g --ignore-scripts @piagent/platform@1.0.2
|
|
989
|
-
piagent-install --stable --dry-run
|
|
990
|
-
piagent-install --stable</code></pre>
|
|
991
|
-
</div>
|
|
992
|
-
<div class="command-card">
|
|
993
|
-
<header><span>Direct Pi package only</span><button class="clip-btn" data-clip="pi install git:github.com/Vt-mmm/piagent@v1.0.2">Lấy lệnh</button></header>
|
|
994
|
-
<pre><code>pi install git:github.com/Vt-mmm/piagent@v1.0.2</code></pre>
|
|
995
|
-
</div>
|
|
996
|
-
</div>
|
|
997
|
-
</article>
|
|
998
|
-
|
|
999
|
-
<article class="step">
|
|
1000
|
-
<div>
|
|
1001
|
-
<h3>Update hoặc rollback đúng cả ba thành phần</h3>
|
|
1002
|
-
<p>Full update/rollback phải dùng exact Pi host của release target, đổi npm-global helper, rồi apply stable Pi package từ chính helper đó. Lệnh <span class="inline-code">--version ... --resolve-tag</span> chỉ đổi Pi package và giữ host/helper hiện tại.</p>
|
|
1003
|
-
<div class="command-card">
|
|
1004
|
-
<header><span>Full platform target</span><button class="clip-btn" data-clip="npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1 npm install -g --ignore-scripts @piagent/platform@X.Y.Z piagent-install --stable --dry-run piagent-install --stable">Lấy lệnh</button></header>
|
|
1005
|
-
<pre><code>npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1
|
|
1006
|
-
npm install -g --ignore-scripts @piagent/platform@X.Y.Z
|
|
1007
|
-
piagent-install --stable --dry-run
|
|
1008
|
-
piagent-install --stable</code></pre>
|
|
1009
|
-
</div>
|
|
1010
|
-
<div class="command-card">
|
|
1011
|
-
<header><span>Pi package only</span><button class="clip-btn" data-clip="piagent-install --version vX.Y.Z --resolve-tag --dry-run piagent-install --version vX.Y.Z --resolve-tag">Lấy lệnh</button></header>
|
|
1012
|
-
<pre><code>piagent-install --version vX.Y.Z --resolve-tag --dry-run
|
|
1013
|
-
piagent-install --version vX.Y.Z --resolve-tag</code></pre>
|
|
1014
|
-
</div>
|
|
1015
|
-
</div>
|
|
1016
|
-
</article>
|
|
1017
|
-
|
|
1018
|
-
<article class="step">
|
|
1019
|
-
<div>
|
|
1020
|
-
<h3>Latest chỉ cho cá nhân/sandbox</h3>
|
|
1021
|
-
<p>Dùng latest khi muốn nhận thay đổi nhanh trên máy riêng. Khi đưa vào repo/team, đổi sang tag hoặc commit đã review để mọi developer nhận cùng một cấu hình.</p>
|
|
971
|
+
<p>Vì chạy từ package đã cài, source ghi vào <span class="inline-code">.pi/settings.json</span> là <span class="inline-code">npm:@piagent/platform@<version></span> — giá trị này có nghĩa như nhau trên máy đồng đội, nên commit được cho cả team.</p>
|
|
972
|
+
<p>Dùng <a href="https://herdr.dev/docs/install/">Herdr</a> thì cài Herdr <strong>trước</strong>: <span class="inline-code">piagent-setup</span> tự cài luôn Herdr Pi integration khi thấy <span class="inline-code">herdr</span> trên <span class="inline-code">PATH</span>, còn không thì bỏ qua kèm cảnh báo — cài Herdr sau phải chạy lại <span class="inline-code">piagent-setup --global-only</span>.</p>
|
|
1022
973
|
<div class="command-card">
|
|
1023
|
-
<header><span>
|
|
1024
|
-
<pre><code>
|
|
1025
|
-
|
|
1026
|
-
</div>
|
|
1027
|
-
</div>
|
|
1028
|
-
</article>
|
|
1029
|
-
|
|
1030
|
-
<article class="step">
|
|
1031
|
-
<div>
|
|
1032
|
-
<h3>Gỡ cài đặt khi không dùng nữa</h3>
|
|
1033
|
-
<p><span class="inline-code">piagent-uninstall</span> mặc định chỉ in ra sẽ gỡ những gì rồi thoát; phải thêm <span class="inline-code">--apply</span> nó mới thực hiện, vì nó sửa Pi settings mà công cụ khác cũng ghi vào. Mặc định chỉ gỡ Pi package của platform; add-on, Pi host và state trong project đều là opt-in.</p>
|
|
1034
|
-
<div class="command-card">
|
|
1035
|
-
<header><span>Gỡ</span><button class="clip-btn" data-clip="piagent-uninstall piagent-uninstall --apply npm uninstall -g @piagent/platform">Lấy lệnh</button></header>
|
|
1036
|
-
<pre><code>piagent-uninstall # chỉ báo cáo
|
|
1037
|
-
piagent-uninstall --apply # gỡ Pi package của platform
|
|
1038
|
-
piagent-uninstall --apply --with-addons --with-host # + add-on và Pi host
|
|
1039
|
-
piagent-uninstall --apply --project /path/to/project # + state trong project
|
|
1040
|
-
npm uninstall -g @piagent/platform # helper npm-global</code></pre>
|
|
1041
|
-
</div>
|
|
1042
|
-
<p>Nó gỡ theo những gì đang đăng ký trong Pi settings chứ không theo những gì bản hiện tại cài, nên package do release cũ đăng ký vẫn ra được.</p>
|
|
1043
|
-
<div class="callout ok-callout">
|
|
1044
|
-
<strong>Không bao giờ bị xoá</strong>
|
|
1045
|
-
<p>Credential, trust, session, todo và <span class="inline-code">.pi/memory/</span> được giữ nguyên ở mọi tổ hợp cờ — đó là dữ liệu của người dùng, không phải state của platform. Các file sinh từ template rồi sửa tiếp như <span class="inline-code">AGENTS.md</span>, <span class="inline-code">.pi/settings.json</span>, <span class="inline-code">project-context.md</span> chỉ được liệt kê để tự quyết. Với <span class="inline-code">.pi/settings.json</span>, chỉ đúng entry trỏ tới platform bị bỏ khỏi <span class="inline-code">packages</span>.</p>
|
|
974
|
+
<header><span>Herdr (tuỳ chọn, cài trước)</span><button class="clip-btn" data-clip="brew install herdr">Lấy lệnh</button></header>
|
|
975
|
+
<pre><code>brew install herdr # macOS
|
|
976
|
+
curl -fsSL https://herdr.dev/install.sh | sh # macOS hoặc Linux</code></pre>
|
|
1046
977
|
</div>
|
|
978
|
+
<p>Bản <span class="inline-code">curl</span> chạy script tải về lúc cài; muốn kiểm tra được thì dùng <span class="inline-code">brew</span> hoặc tải từ <a href="https://github.com/ogulcancelik/herdr/releases">GitHub releases</a>. Herdr stable hỗ trợ macOS và Linux, Windows mới ở mức preview.</p>
|
|
979
|
+
<p>Rollout pin từng bước, update, rollback, và channel latest cho máy cá nhân nằm trong <a href="https://github.com/Vt-mmm/piagent/blob/main/docs/release-install-policy.md">release & install policy</a>.</p>
|
|
1047
980
|
</div>
|
|
1048
981
|
</article>
|
|
1049
982
|
|
|
@@ -1056,6 +989,7 @@ npm uninstall -g @piagent/platform # helper npm-global</code>
|
|
|
1056
989
|
<pre><code>cd /path/to/project
|
|
1057
990
|
pi</code></pre>
|
|
1058
991
|
</div>
|
|
992
|
+
<p>Cần nhiều agent chạy song song thì gõ <span class="inline-code">herdr</span> thay cho <span class="inline-code">pi</span>, mỗi pane một vai: implement, review read-only, verify, notes. Herdr chỉ điều phối terminal và session — nó không phải security boundary, gate vẫn nằm ở Pi extension và OAuth vẫn login trong Pi. Cách dựng pane: <a href="https://github.com/Vt-mmm/piagent/blob/main/docs/herdr-workflow.md">Herdr workflow</a>.</p>
|
|
1059
993
|
</div>
|
|
1060
994
|
</article>
|
|
1061
995
|
|
|
@@ -1110,18 +1044,32 @@ pi</code></pre>
|
|
|
1110
1044
|
<article class="step">
|
|
1111
1045
|
<div>
|
|
1112
1046
|
<h3>Verify trước khi handoff</h3>
|
|
1113
|
-
<p>Final gate chỉ tin kết quả command đã chạy thật, exit 0, và khớp verify plan.
|
|
1047
|
+
<p>Final gate chỉ tin kết quả command đã chạy thật, exit 0, và khớp verify plan. Sau khi pin hoặc nâng version, chạy doctor trên project:</p>
|
|
1114
1048
|
<div class="command-card">
|
|
1115
|
-
<header><span>Doctor
|
|
1116
|
-
<pre><code>piagent-doctor
|
|
1117
|
-
# in piagent source repo:
|
|
1118
|
-
npm run smoke
|
|
1119
|
-
npm run verify
|
|
1120
|
-
npm test
|
|
1121
|
-
npm run typecheck</code></pre>
|
|
1049
|
+
<header><span>Doctor</span><button class="clip-btn" data-clip="piagent-doctor">Lấy lệnh</button></header>
|
|
1050
|
+
<pre><code>piagent-doctor</code></pre>
|
|
1122
1051
|
</div>
|
|
1052
|
+
<p>Người phát triển chính platform còn có <span class="inline-code">npm run verify</span> trong source repo; chi tiết ở <a href="https://github.com/Vt-mmm/piagent/blob/main/CONTRIBUTING.md">CONTRIBUTING</a>.</p>
|
|
1123
1053
|
</div>
|
|
1124
1054
|
</article>
|
|
1055
|
+
|
|
1056
|
+
<article class="step">
|
|
1057
|
+
<div>
|
|
1058
|
+
<h3>Gỡ cài đặt khi không dùng nữa</h3>
|
|
1059
|
+
<p><span class="inline-code">piagent-uninstall</span> mặc định chỉ in ra sẽ gỡ những gì rồi thoát; phải thêm <span class="inline-code">--apply</span> nó mới thực hiện, vì nó sửa Pi settings mà công cụ khác cũng ghi vào. Mặc định chỉ gỡ Pi package của platform; add-on, Pi host và state trong project đều là opt-in.</p>
|
|
1060
|
+
<div class="command-card">
|
|
1061
|
+
<header><span>Gỡ — hai lệnh</span><button class="clip-btn" data-clip="piagent-uninstall piagent-uninstall --apply">Lấy lệnh</button></header>
|
|
1062
|
+
<pre><code>piagent-uninstall
|
|
1063
|
+
piagent-uninstall --apply</code></pre>
|
|
1064
|
+
</div>
|
|
1065
|
+
<p>Add-on, Pi host, state trong project và helper npm-global đều tách riêng và là opt-in — <span class="inline-code">piagent-uninstall --help</span> liệt kê đủ. Nó gỡ theo những gì đang đăng ký trong Pi settings chứ không theo những gì bản hiện tại cài, nên package do release cũ đăng ký vẫn ra được.</p>
|
|
1066
|
+
<div class="callout ok-callout">
|
|
1067
|
+
<strong>Không bao giờ bị xoá</strong>
|
|
1068
|
+
<p>Credential, trust, session, todo và <span class="inline-code">.pi/memory/</span> được giữ nguyên ở mọi tổ hợp cờ — đó là dữ liệu của người dùng, không phải state của platform. Các file sinh từ template rồi sửa tiếp như <span class="inline-code">AGENTS.md</span>, <span class="inline-code">.pi/settings.json</span>, <span class="inline-code">project-context.md</span> chỉ được liệt kê để tự quyết. Với <span class="inline-code">.pi/settings.json</span>, chỉ đúng entry trỏ tới platform bị bỏ khỏi <span class="inline-code">packages</span>.</p>
|
|
1069
|
+
</div>
|
|
1070
|
+
</div>
|
|
1071
|
+
</article>
|
|
1072
|
+
|
|
1125
1073
|
</div>
|
|
1126
1074
|
</section>
|
|
1127
1075
|
|
|
@@ -1504,8 +1452,8 @@ npm run typecheck</code></pre>
|
|
|
1504
1452
|
<pre><code>piagent-setup --mcp-preset core --subagents-preset safe</code></pre>
|
|
1505
1453
|
</article>
|
|
1506
1454
|
<article class="command-card">
|
|
1507
|
-
<header><span>Full update</span><button class="clip-btn" data-clip="npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.
|
|
1508
|
-
<pre><code>npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.
|
|
1455
|
+
<header><span>Full update</span><button class="clip-btn" data-clip="npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0 npm install -g --ignore-scripts @piagent/platform@X.Y.Z piagent-install --stable --dry-run piagent-install --stable">Lấy lệnh</button></header>
|
|
1456
|
+
<pre><code>npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
|
|
1509
1457
|
npm install -g --ignore-scripts @piagent/platform@X.Y.Z
|
|
1510
1458
|
piagent-install --stable --dry-run
|
|
1511
1459
|
piagent-install --stable</code></pre>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@piagent/platform",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
|
-
"@earendil-works/pi-ai": "0.
|
|
82
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
81
|
+
"@earendil-works/pi-ai": "0.82.0",
|
|
82
|
+
"@earendil-works/pi-coding-agent": "0.82.0",
|
|
83
83
|
"typebox": "1.1.38"
|
|
84
84
|
},
|
|
85
85
|
"peerDependenciesMeta": {
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
"audit:runtime": "bash scripts/audit-runtime-host.sh",
|
|
117
117
|
"release:identity": "node scripts/verify-release-identity.mjs",
|
|
118
118
|
"vercel:preflight": "node scripts/verify-vercel-link.mjs",
|
|
119
|
+
"site:check": "node scripts/check-published-site.mjs",
|
|
119
120
|
"smoke": "bash scripts/runtime-policy-smoke.sh",
|
|
120
121
|
"usage": "bash scripts/pi-session-stats.sh",
|
|
121
122
|
"auto": "bash scripts/pi-auto.sh",
|
|
@@ -64,6 +64,7 @@ Inside Pi, slash commands can switch the current session without writing the pro
|
|
|
64
64
|
- `piagent_project_onboarding_record`
|
|
65
65
|
- `piagent_task_start`
|
|
66
66
|
- `piagent_source_checkout`
|
|
67
|
+
- `piagent_document_read` — reads `.md`/`.txt`/`.csv`/`.json`/`.yaml`/`.pdf`/`.docx` from the project or a granted `additionalReadRoots` directory; read-only, and `protectedPaths` still wins
|
|
67
68
|
- `piagent_context_record`
|
|
68
69
|
- `piagent_verify_record` — records verify evidence only after matching an observed bash tool result after task start
|
|
69
70
|
- `piagent_trace_record`
|
|
@@ -108,7 +109,7 @@ pi install git:github.com/Vt-mmm/piagent
|
|
|
108
109
|
|
|
109
110
|
Use `git:github.com/Vt-mmm/piagent@vX.Y.Z` when pinning a reproducible project package source.
|
|
110
111
|
|
|
111
|
-
Runtime support follows the root release matrix: Node.js `>=22.19.0`, Pi Coding Agent `0.
|
|
112
|
+
Runtime support follows the root release matrix: Node.js `>=22.19.0`, Pi Coding Agent `0.82.0`, verified rollout on macOS Apple Silicon + Bash and Linux x64 + Bash, supported-target smoke verification for macOS Intel/Linux ARM64, no native Windows team rollout target yet, and WSL2 experimental.
|
|
112
113
|
|
|
113
114
|
## Project profile
|
|
114
115
|
|