@piagent/platform 1.45.0 → 1.46.1
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 +39 -0
- package/README.md +5 -3
- package/README.vi.md +5 -3
- package/docs/command-reference-vietnamese.md +2 -2
- package/docs/distribution-standard.md +6 -6
- package/docs/en/architecture.md +1 -1
- package/docs/harness-conformance.md +22 -5
- package/docs/languages.json +4 -4
- package/docs/operator-manual-vietnamese.md +7 -7
- package/docs/publishing-for-teams.md +2 -0
- package/docs/release-install-policy.md +2 -2
- package/docs/team-onboarding.md +2 -2
- package/docs/vi/architecture.md +1 -1
- package/docs-site/architecture.html +1 -1
- package/docs-site/assets/search-en.json +1 -1
- package/docs-site/assets/search-vi.json +1 -1
- package/docs-site/benchmark.html +1 -1
- package/docs-site/commands.html +1 -1
- package/docs-site/context-engine.html +1 -1
- package/docs-site/ecosystem.html +1 -1
- package/docs-site/en/architecture.html +1 -1
- package/docs-site/en/benchmark.html +1 -1
- package/docs-site/en/commands.html +1 -1
- package/docs-site/en/context-engine.html +1 -1
- package/docs-site/en/ecosystem.html +1 -1
- package/docs-site/en/index.html +15 -15
- package/docs-site/en/mcp-approval.html +1 -1
- package/docs-site/en/mcp-auth.html +1 -1
- package/docs-site/en/mcp-servers.html +1 -1
- package/docs-site/en/mcp.html +1 -1
- package/docs-site/en/permissions.html +1 -1
- package/docs-site/en/profiles.html +1 -1
- package/docs-site/en/quickstart.html +1 -1
- package/docs-site/en/runtime.html +1 -1
- package/docs-site/en/scope.html +1 -1
- package/docs-site/en/security.html +1 -1
- package/docs-site/en/team.html +1 -1
- package/docs-site/en/update.html +3 -3
- package/docs-site/en/whats-new.html +55 -29
- package/docs-site/en/windows.html +1 -1
- package/docs-site/en/workflows.html +1 -1
- package/docs-site/index.html +15 -15
- package/docs-site/mcp-approval.html +1 -1
- package/docs-site/mcp-auth.html +1 -1
- package/docs-site/mcp-servers.html +1 -1
- package/docs-site/mcp.html +1 -1
- package/docs-site/permissions.html +1 -1
- package/docs-site/profiles.html +1 -1
- package/docs-site/quickstart.html +1 -1
- package/docs-site/releases.json +83 -0
- package/docs-site/runtime.html +1 -1
- package/docs-site/scope.html +1 -1
- package/docs-site/security.html +1 -1
- package/docs-site/team.html +1 -1
- package/docs-site/update.html +3 -3
- package/docs-site/whats-new.html +55 -29
- package/docs-site/windows.html +1 -1
- package/docs-site/workflows.html +1 -1
- package/evals/private-holdout-v1/public-exposure.v2.json +2 -2
- package/package.json +1 -1
- package/packages/piagent-core/benchmark/benchmark-bootstrap.js +3 -1
- package/packages/piagent-core/extensions/agent-home.d.ts +4 -0
- package/packages/piagent-core/extensions/agent-home.js +52 -0
- package/packages/piagent-core/extensions/piagent-guard.ts +5 -1
- package/packages/piagent-core/managed/copies.mjs +61 -0
- package/packages/piagent-core/managed/grant-share.mjs +9 -1
- package/packages/piagent-core/managed/helper-roles.mjs +5 -3
- package/packages/piagent-core/managed/helper-run.mjs +120 -52
- package/packages/piagent-core/managed/helper-settlement.mjs +5 -1
- package/packages/piagent-core/managed/ledger.mjs +187 -0
- package/packages/piagent-core/managed/objections.mjs +49 -27
- package/packages/piagent-core/managed/patch-snapshot.mjs +9 -0
- package/packages/piagent-core/managed/session.mjs +14 -14
- package/packages/piagent-core/managed/toolchain.mjs +7 -3
- package/packages/piagent-core/managed/workflow.mjs +32 -26
- package/packages/piagent-core/mcp/mcp-config-layers.js +4 -1
- package/packages/piagent-core/package.json +1 -1
- package/packages/piagent-core/runtime/managed-failure.mjs +8 -0
- package/packages/piagent-webui/extension/piagent-webui.ts +2 -0
- package/packages/piagent-webui/gateway/gateway-service.ts +4 -1
- package/packages/piagent-webui/gateway/pi-host.ts +2 -2
- package/packages/piagent-webui/ownership/profile-state.ts +10 -1
- package/packages/piagent-webui/server/benchmark-release-monitor.ts +2 -1
- package/scripts/benchmark-runner-support.mjs +2 -1
- package/scripts/company-terminal.mjs +19 -1
- package/scripts/dashboard-update-job.mjs +4 -2
- package/scripts/install-global.sh +113 -5
- package/scripts/model-scope-prune.mjs +2 -1
- package/scripts/personal-pi-config.mjs +2 -1
- package/scripts/personal-pi-restore.mjs +184 -0
- package/scripts/pi-usage-history.mjs +2 -1
- package/scripts/piagent-cli.mjs +49 -9
- package/scripts/piagent-dashboard.mjs +5 -3
- package/scripts/setup.sh +2 -6
- package/scripts/team-doctor.sh +11 -5
- package/scripts/uninstall-global.sh +17 -2
- package/scripts/update-global.mjs +5 -2
package/docs-site/mcp.html
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<span class="brand-mark"><img src="/assets/piagent-logo.svg" alt="" width="28" height="28" /></span>
|
|
38
38
|
<span class="brand-name"><b>Piagent</b> <span>Platform</span></span>
|
|
39
39
|
</a>
|
|
40
|
-
<a class="version-badge" href="/whats-new" data-docs-version="v1.
|
|
40
|
+
<a class="version-badge" href="/whats-new" data-docs-version="v1.46.1" title="v1.46.1 docs · VI"><span class="dot"></span>v1.46.1</a>
|
|
41
41
|
<nav class="top-nav" aria-label="Tài liệu">
|
|
42
42
|
<a href="/quickstart">Tài liệu</a>
|
|
43
43
|
<a href="/whats-new">Changelog</a>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<span class="brand-mark"><img src="/assets/piagent-logo.svg" alt="" width="28" height="28" /></span>
|
|
38
38
|
<span class="brand-name"><b>Piagent</b> <span>Platform</span></span>
|
|
39
39
|
</a>
|
|
40
|
-
<a class="version-badge" href="/whats-new" data-docs-version="v1.
|
|
40
|
+
<a class="version-badge" href="/whats-new" data-docs-version="v1.46.1" title="v1.46.1 docs · VI"><span class="dot"></span>v1.46.1</a>
|
|
41
41
|
<nav class="top-nav" aria-label="Tài liệu">
|
|
42
42
|
<a href="/quickstart">Tài liệu</a>
|
|
43
43
|
<a href="/whats-new">Changelog</a>
|
package/docs-site/profiles.html
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<span class="brand-mark"><img src="/assets/piagent-logo.svg" alt="" width="28" height="28" /></span>
|
|
38
38
|
<span class="brand-name"><b>Piagent</b> <span>Platform</span></span>
|
|
39
39
|
</a>
|
|
40
|
-
<a class="version-badge" href="/whats-new" data-docs-version="v1.
|
|
40
|
+
<a class="version-badge" href="/whats-new" data-docs-version="v1.46.1" title="v1.46.1 docs · VI"><span class="dot"></span>v1.46.1</a>
|
|
41
41
|
<nav class="top-nav" aria-label="Tài liệu">
|
|
42
42
|
<a href="/quickstart">Tài liệu</a>
|
|
43
43
|
<a href="/whats-new">Changelog</a>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<span class="brand-mark"><img src="/assets/piagent-logo.svg" alt="" width="28" height="28" /></span>
|
|
38
38
|
<span class="brand-name"><b>Piagent</b> <span>Platform</span></span>
|
|
39
39
|
</a>
|
|
40
|
-
<a class="version-badge" href="/whats-new" data-docs-version="v1.
|
|
40
|
+
<a class="version-badge" href="/whats-new" data-docs-version="v1.46.1" title="v1.46.1 docs · VI"><span class="dot"></span>v1.46.1</a>
|
|
41
41
|
<nav class="top-nav" aria-label="Tài liệu">
|
|
42
42
|
<a href="/quickstart" aria-current="page">Tài liệu</a>
|
|
43
43
|
<a href="/whats-new">Changelog</a>
|
package/docs-site/releases.json
CHANGED
|
@@ -1,4 +1,87 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "1.46.1",
|
|
4
|
+
"date": "2026-10-28",
|
|
5
|
+
"status": "stable",
|
|
6
|
+
"title": {
|
|
7
|
+
"en": "Objections on the record, one review per turn, parallel subagents on request",
|
|
8
|
+
"vi": "Phản biện có sổ ghi, review một nhịp, subagent song song khi được yêu cầu"
|
|
9
|
+
},
|
|
10
|
+
"summary": {
|
|
11
|
+
"en": "The company harness keeps one ledger of helper objections and the main agent's decisions, reviews once per turn, and runs 2–3 helpers of one role in parallel only when the member asks.",
|
|
12
|
+
"vi": "Harness công ty ghi một sổ phản biện cùng quyết định của main, review một nhịp mỗi lượt, và chỉ chạy 2–3 helper cùng role song song khi member yêu cầu."
|
|
13
|
+
},
|
|
14
|
+
"items": [
|
|
15
|
+
{
|
|
16
|
+
"kind": "new",
|
|
17
|
+
"en": "Objections to a brief, review findings and failed claims share one ledger; the main agent records each decision with resolve_objection, and a wrong-premise objection blocks edits until decided.",
|
|
18
|
+
"vi": "Phản biện brief, finding review và claim fail chung một sổ; main ghi quyết định bằng resolve_objection, phản biện sai tiền đề chặn sửa file đến khi được quyết."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"kind": "improved",
|
|
22
|
+
"en": "Review runs once per turn: a required review is the harness's own, a re-review after a fix reads only the files changed, minor findings are only listed.",
|
|
23
|
+
"vi": "Review một nhịp mỗi lượt: review bắt buộc do harness làm, review lại sau khi sửa chỉ đọc file đã đổi, finding minor chỉ liệt kê."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"kind": "new",
|
|
27
|
+
"en": "One helper per role by default; when the member asks for 2–3 of one role, they run in parallel, each on its own grant with Agent Studio 0.50.0 and Agent Watch 0.15.17.",
|
|
28
|
+
"vi": "Mặc định mỗi role một helper; khi member yêu cầu 2–3 helper cùng role, chúng chạy song song, mỗi helper một grant với Agent Studio 0.50.0 và Agent Watch 0.15.17."
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"kind": "improved",
|
|
32
|
+
"en": "The company terminal shows the checklist and what each running subagent is doing above the input.",
|
|
33
|
+
"vi": "Terminal công ty hiện checklist và việc từng subagent đang làm ngay trên ô nhập."
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"kind": "fixed",
|
|
37
|
+
"en": "piagent studio installs fd on first start, so @ completion lists files and folders; it was never downloaded, even with fd under /opt/homebrew/bin.",
|
|
38
|
+
"vi": "piagent studio cài fd ở lần mở đầu tiên nên gợi ý @ hiện file và thư mục; trước đây fd không bao giờ được tải, kể cả khi đã có ở /opt/homebrew/bin."
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"requires": {
|
|
42
|
+
"en": "Agent Studio 0.50.0 and Agent Watch 0.15.17 (Windows 0.1.18) for parallel subagents",
|
|
43
|
+
"vi": "Agent Studio 0.50.0 và Agent Watch 0.15.17 (Windows 0.1.18) để subagent chạy song song"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"version": "1.46.0",
|
|
48
|
+
"date": "2026-10-28",
|
|
49
|
+
"status": "stable",
|
|
50
|
+
"title": {
|
|
51
|
+
"en": "Piagent runs from its own Pi home and your own pi stays stock",
|
|
52
|
+
"vi": "Piagent chạy trong Pi home riêng, pi của bạn giữ nguyên bản gốc"
|
|
53
|
+
},
|
|
54
|
+
"summary": {
|
|
55
|
+
"en": "Piagent installs into ~/.piagent/agent and opens with `piagent`. Plain `pi` no longer loads Piagent, its add-ons, model list or footer panel.",
|
|
56
|
+
"vi": "Piagent cài vào ~/.piagent/agent và mở bằng `piagent`. `pi` thường không còn nạp Piagent, add-on, danh sách model hay panel footer."
|
|
57
|
+
},
|
|
58
|
+
"items": [
|
|
59
|
+
{
|
|
60
|
+
"kind": "breaking",
|
|
61
|
+
"en": "Piagent installs into its own Pi home, ~/.piagent/agent, and opens with `piagent`. Plain `pi` in ~/.pi/agent stays stock.",
|
|
62
|
+
"vi": "Piagent cài vào Pi home riêng ~/.piagent/agent và mở bằng `piagent`. `pi` thường trong ~/.pi/agent giữ nguyên bản gốc."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"kind": "new",
|
|
66
|
+
"en": "A first install in a terminal asks which add-ons to install and whether to reuse your pi login; flags answer up front.",
|
|
67
|
+
"vi": "Lần cài đầu trong terminal hỏi cài add-on nào và có dùng lại login của pi không; cờ dòng lệnh trả lời trước được."
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"kind": "new",
|
|
71
|
+
"en": "`piagent restore-pi --apply` moves an older install out of ~/.pi/agent with backups; the installer does it on update.",
|
|
72
|
+
"vi": "`piagent restore-pi --apply` dời bản cài cũ khỏi ~/.pi/agent, có sao lưu; installer tự làm khi cập nhật."
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"kind": "fixed",
|
|
76
|
+
"en": "Pi's built-in mcp is turned off in Piagent's home when pi-mcp-adapter is installed, so /mcp no longer clashes.",
|
|
77
|
+
"vi": "Khi cài pi-mcp-adapter, Piagent tắt mcp có sẵn của Pi trong home của mình nên /mcp không còn xung đột."
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"requires": {
|
|
81
|
+
"en": "Agent Watch 0.15.16 to list Piagent's personal sessions",
|
|
82
|
+
"vi": "Agent Watch 0.15.16 để thấy session cá nhân của Piagent"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
2
85
|
{
|
|
3
86
|
"version": "1.45.0",
|
|
4
87
|
"date": "2026-10-28",
|
package/docs-site/runtime.html
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<span class="brand-mark"><img src="/assets/piagent-logo.svg" alt="" width="28" height="28" /></span>
|
|
38
38
|
<span class="brand-name"><b>Piagent</b> <span>Platform</span></span>
|
|
39
39
|
</a>
|
|
40
|
-
<a class="version-badge" href="/whats-new" data-docs-version="v1.
|
|
40
|
+
<a class="version-badge" href="/whats-new" data-docs-version="v1.46.1" title="v1.46.1 docs · VI"><span class="dot"></span>v1.46.1</a>
|
|
41
41
|
<nav class="top-nav" aria-label="Tài liệu">
|
|
42
42
|
<a href="/quickstart">Tài liệu</a>
|
|
43
43
|
<a href="/whats-new">Changelog</a>
|
package/docs-site/scope.html
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<span class="brand-mark"><img src="/assets/piagent-logo.svg" alt="" width="28" height="28" /></span>
|
|
38
38
|
<span class="brand-name"><b>Piagent</b> <span>Platform</span></span>
|
|
39
39
|
</a>
|
|
40
|
-
<a class="version-badge" href="/whats-new" data-docs-version="v1.
|
|
40
|
+
<a class="version-badge" href="/whats-new" data-docs-version="v1.46.1" title="v1.46.1 docs · VI"><span class="dot"></span>v1.46.1</a>
|
|
41
41
|
<nav class="top-nav" aria-label="Tài liệu">
|
|
42
42
|
<a href="/quickstart">Tài liệu</a>
|
|
43
43
|
<a href="/whats-new">Changelog</a>
|
package/docs-site/security.html
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<span class="brand-mark"><img src="/assets/piagent-logo.svg" alt="" width="28" height="28" /></span>
|
|
38
38
|
<span class="brand-name"><b>Piagent</b> <span>Platform</span></span>
|
|
39
39
|
</a>
|
|
40
|
-
<a class="version-badge" href="/whats-new" data-docs-version="v1.
|
|
40
|
+
<a class="version-badge" href="/whats-new" data-docs-version="v1.46.1" title="v1.46.1 docs · VI"><span class="dot"></span>v1.46.1</a>
|
|
41
41
|
<nav class="top-nav" aria-label="Tài liệu">
|
|
42
42
|
<a href="/quickstart">Tài liệu</a>
|
|
43
43
|
<a href="/whats-new">Changelog</a>
|
package/docs-site/team.html
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<span class="brand-mark"><img src="/assets/piagent-logo.svg" alt="" width="28" height="28" /></span>
|
|
38
38
|
<span class="brand-name"><b>Piagent</b> <span>Platform</span></span>
|
|
39
39
|
</a>
|
|
40
|
-
<a class="version-badge" href="/whats-new" data-docs-version="v1.
|
|
40
|
+
<a class="version-badge" href="/whats-new" data-docs-version="v1.46.1" title="v1.46.1 docs · VI"><span class="dot"></span>v1.46.1</a>
|
|
41
41
|
<nav class="top-nav" aria-label="Tài liệu">
|
|
42
42
|
<a href="/quickstart">Tài liệu</a>
|
|
43
43
|
<a href="/whats-new">Changelog</a>
|
package/docs-site/update.html
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<span class="brand-mark"><img src="/assets/piagent-logo.svg" alt="" width="28" height="28" /></span>
|
|
38
38
|
<span class="brand-name"><b>Piagent</b> <span>Platform</span></span>
|
|
39
39
|
</a>
|
|
40
|
-
<a class="version-badge" href="/whats-new" data-docs-version="v1.
|
|
40
|
+
<a class="version-badge" href="/whats-new" data-docs-version="v1.46.1" title="v1.46.1 docs · VI"><span class="dot"></span>v1.46.1</a>
|
|
41
41
|
<nav class="top-nav" aria-label="Tài liệu">
|
|
42
42
|
<a href="/quickstart">Tài liệu</a>
|
|
43
43
|
<a href="/whats-new">Changelog</a>
|
|
@@ -145,9 +145,9 @@
|
|
|
145
145
|
<h2 id="pin-cho-team">Pin một bản cho cả team</h2>
|
|
146
146
|
<p>Khi rollout cho team, cài đúng bản Pi host và đúng bản platform, rồi chạy installer ở chế độ stable. Bước <code>--dry-run</code> in ra những gì sẽ đổi.</p>
|
|
147
147
|
<div class="command-card">
|
|
148
|
-
<header><span>Cài pin theo bản</span><button class="clip-btn" data-clip="npm install -g --ignore-scripts @earendil-works/pi-coding-agent@1.3.0 npm install -g --ignore-scripts @piagent/platform@1.
|
|
148
|
+
<header><span>Cài pin theo bản</span><button class="clip-btn" data-clip="npm install -g --ignore-scripts @earendil-works/pi-coding-agent@1.3.0 npm install -g --ignore-scripts @piagent/platform@1.46.1 piagent-install --stable --dry-run piagent-install --stable">Lấy lệnh</button></header>
|
|
149
149
|
<pre><code>npm install -g --ignore-scripts @earendil-works/pi-coding-agent@1.3.0
|
|
150
|
-
npm install -g --ignore-scripts @piagent/platform@1.
|
|
150
|
+
npm install -g --ignore-scripts @piagent/platform@1.46.1
|
|
151
151
|
piagent-install --stable --dry-run
|
|
152
152
|
piagent-install --stable</code></pre>
|
|
153
153
|
</div>
|
package/docs-site/whats-new.html
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<span class="brand-mark"><img src="/assets/piagent-logo.svg" alt="" width="28" height="28" /></span>
|
|
38
38
|
<span class="brand-name"><b>Piagent</b> <span>Platform</span></span>
|
|
39
39
|
</a>
|
|
40
|
-
<a class="version-badge" href="/whats-new" data-docs-version="v1.
|
|
40
|
+
<a class="version-badge" href="/whats-new" data-docs-version="v1.46.1" title="v1.46.1 docs · VI"><span class="dot"></span>v1.46.1</a>
|
|
41
41
|
<nav class="top-nav" aria-label="Tài liệu">
|
|
42
42
|
<a href="/quickstart">Tài liệu</a>
|
|
43
43
|
<a href="/whats-new" aria-current="page">Changelog</a>
|
|
@@ -108,7 +108,36 @@
|
|
|
108
108
|
<div class="release-filter" role="toolbar" aria-label="Lọc theo loại thay đổi"><button type="button" data-filter-kind="all" aria-pressed="true">Tất cả</button><button type="button" data-filter-kind="new" aria-pressed="false">Mới</button><button type="button" data-filter-kind="improved" aria-pressed="false">Cải thiện</button><button type="button" data-filter-kind="fixed" aria-pressed="false">Sửa lỗi</button><button type="button" data-filter-kind="security" aria-pressed="false">Bảo mật</button></div>
|
|
109
109
|
<section class="section releases" data-releases>
|
|
110
110
|
<h2 id="latest" class="sr-only">Mới nhất</h2>
|
|
111
|
-
<article class="release latest" id="v1-
|
|
111
|
+
<article class="release latest" id="v1-46-1" data-release>
|
|
112
|
+
<div class="release-meta"><a class="release-version" href="#v1-46-1">v1.46.1</a><time class="release-date" datetime="2026-10-28">28/10/2026</time></div>
|
|
113
|
+
<div class="release-body">
|
|
114
|
+
<h3 data-toc-skip id="v1-46-1-title">Phản biện có sổ ghi, review một nhịp, subagent song song khi được yêu cầu</h3>
|
|
115
|
+
<p>Harness công ty ghi một sổ phản biện cùng quyết định của main, review một nhịp mỗi lượt, và chỉ chạy 2–3 helper cùng role song song khi member yêu cầu.</p>
|
|
116
|
+
<ul class="release-items">
|
|
117
|
+
<li data-kind="new"><span class="kind kind-new">Mới</span><span>Phản biện brief, finding review và claim fail chung một sổ; main ghi quyết định bằng resolve_objection, phản biện sai tiền đề chặn sửa file đến khi được quyết.</span></li>
|
|
118
|
+
<li data-kind="new"><span class="kind kind-new">Mới</span><span>Mặc định mỗi role một helper; khi member yêu cầu 2–3 helper cùng role, chúng chạy song song, mỗi helper một grant với Agent Studio 0.50.0 và Agent Watch 0.15.17.</span></li>
|
|
119
|
+
<li data-kind="improved"><span class="kind kind-improved">Cải thiện</span><span>Review một nhịp mỗi lượt: review bắt buộc do harness làm, review lại sau khi sửa chỉ đọc file đã đổi, finding minor chỉ liệt kê.</span></li>
|
|
120
|
+
<li data-kind="improved"><span class="kind kind-improved">Cải thiện</span><span>Terminal công ty hiện checklist và việc từng subagent đang làm ngay trên ô nhập.</span></li>
|
|
121
|
+
<li data-kind="fixed"><span class="kind kind-fixed">Sửa lỗi</span><span>piagent studio cài fd ở lần mở đầu tiên nên gợi ý @ hiện file và thư mục; trước đây fd không bao giờ được tải, kể cả khi đã có ở /opt/homebrew/bin.</span></li>
|
|
122
|
+
</ul>
|
|
123
|
+
<p class="release-requires"><strong>Cần:</strong> Agent Studio 0.50.0 và Agent Watch 0.15.17 (Windows 0.1.18) để subagent chạy song song</p>
|
|
124
|
+
</div>
|
|
125
|
+
</article>
|
|
126
|
+
<article class="release" id="v1-46-0" data-release>
|
|
127
|
+
<div class="release-meta"><a class="release-version" href="#v1-46-0">v1.46.0</a><time class="release-date" datetime="2026-10-28">28/10/2026</time></div>
|
|
128
|
+
<div class="release-body">
|
|
129
|
+
<h3 data-toc-skip id="v1-46-0-title">Piagent chạy trong Pi home riêng, pi của bạn giữ nguyên bản gốc</h3>
|
|
130
|
+
<p>Piagent cài vào ~/.piagent/agent và mở bằng <code>piagent</code>. <code>pi</code> thường không còn nạp Piagent, add-on, danh sách model hay panel footer.</p>
|
|
131
|
+
<ul class="release-items">
|
|
132
|
+
<li data-kind="breaking"><span class="kind kind-breaking">Thay đổi lớn</span><span>Piagent cài vào Pi home riêng ~/.piagent/agent và mở bằng <code>piagent</code>. <code>pi</code> thường trong ~/.pi/agent giữ nguyên bản gốc.</span></li>
|
|
133
|
+
<li data-kind="new"><span class="kind kind-new">Mới</span><span>Lần cài đầu trong terminal hỏi cài add-on nào và có dùng lại login của pi không; cờ dòng lệnh trả lời trước được.</span></li>
|
|
134
|
+
<li data-kind="new"><span class="kind kind-new">Mới</span><span><code>piagent restore-pi --apply</code> dời bản cài cũ khỏi ~/.pi/agent, có sao lưu; installer tự làm khi cập nhật.</span></li>
|
|
135
|
+
<li data-kind="fixed"><span class="kind kind-fixed">Sửa lỗi</span><span>Khi cài pi-mcp-adapter, Piagent tắt mcp có sẵn của Pi trong home của mình nên /mcp không còn xung đột.</span></li>
|
|
136
|
+
</ul>
|
|
137
|
+
<p class="release-requires"><strong>Cần:</strong> Agent Watch 0.15.16 để thấy session cá nhân của Piagent</p>
|
|
138
|
+
</div>
|
|
139
|
+
</article>
|
|
140
|
+
<article class="release" id="v1-45-0" data-release>
|
|
112
141
|
<div class="release-meta"><a class="release-version" href="#v1-45-0">v1.45.0</a><time class="release-date" datetime="2026-10-28">28/10/2026</time></div>
|
|
113
142
|
<div class="release-body">
|
|
114
143
|
<h3 data-toc-skip id="v1-45-0-title">File và ảnh trong prompt theo đúng quyền đọc, terminal không còn đứng hình</h3>
|
|
@@ -397,38 +426,35 @@
|
|
|
397
426
|
</ul>
|
|
398
427
|
</div>
|
|
399
428
|
</article>
|
|
400
|
-
<article class="release" id="v1-38-1" data-release>
|
|
401
|
-
<div class="release-meta"><a class="release-version" href="#v1-38-1">v1.38.1</a><time class="release-date" datetime="2026-10-23">23/10/2026</time></div>
|
|
402
|
-
<div class="release-body">
|
|
403
|
-
<h3 data-toc-skip id="v1-38-1-title">Bản phát hành chính thức của v1.38.0</h3>
|
|
404
|
-
<p>v1.38.0 không qua release check vì hai test nên chưa từng được phát hành; v1.38.1 là cùng bản đó với hai test đã được sửa.</p>
|
|
405
|
-
<ul class="release-items">
|
|
406
|
-
<li data-kind="improved"><span class="kind kind-improved">Cải thiện</span><span>Hai test phát hành nay pass trên Linux và máy chạy chậm, nên editor, terminal, review, checkpoint và Bypass của v1.38.0 có trong bản này.</span></li>
|
|
407
|
-
</ul>
|
|
408
|
-
</div>
|
|
409
|
-
</article>
|
|
410
|
-
<article class="release" id="v1-38-0" data-release>
|
|
411
|
-
<div class="release-meta"><a class="release-version" href="#v1-38-0">v1.38.0</a><time class="release-date" datetime="2026-10-23">23/10/2026</time></div>
|
|
412
|
-
<div class="release-body">
|
|
413
|
-
<h3 data-toc-skip id="v1-38-0-title">Piagent thành editor, Bypass không hỏi gì <span class="tag">không phát hành</span></h3>
|
|
414
|
-
<p>Dashboard có file, terminal, review inline và checkpoint, cùng chế độ Bypass không hỏi gì, cả trong cuộc trò chuyện công ty khi Harness cho phép.</p>
|
|
415
|
-
<ul class="release-items">
|
|
416
|
-
<li data-kind="breaking"><span class="kind kind-breaking">Thay đổi lớn</span><span>Cuộc trò chuyện công ty có Hỏi trước, Toàn quyền (trước đây gọi là Bypass) và Bypass, chỉ có khi Harness cho phép.</span></li>
|
|
417
|
-
<li data-kind="new"><span class="kind kind-new">Mới</span><span>Chế độ <code>bypass</code> (<code>/permission bypass</code>, <code>piagent-auto --bypass</code>) tắt mọi bước chặn; output vẫn được che secret và <code>/undo</code> vẫn hoàn tác được.</span></li>
|
|
418
|
-
<li data-kind="new"><span class="kind kind-new">Mới</span><span>Dashboard mở, sửa, lưu, đổi tên và xóa file của project, có Cmd/Ctrl+P, tìm kiếm và báo xung đột khi file đã đổi trên đĩa.</span></li>
|
|
419
|
-
<li data-kind="new"><span class="kind kind-new">Mới</span><span>Terminal của project ngay trên dashboard; terminal của cuộc trò chuyện công ty chạy trong sandbox, cả trên macOS, không bao giờ chạy trên host.</span></li>
|
|
420
|
-
<li data-kind="new"><span class="kind kind-new">Mới</span><span>Review inline từng hunk agent sửa với Giữ và Hoàn tác, và khôi phục trong Timeline có xem trước, dùng chung checkpoint với <code>/undo</code>.</span></li>
|
|
421
|
-
<li data-kind="fixed"><span class="kind kind-fixed">Sửa lỗi</span><span>Checkpoint không tạo được từng chặn mọi lần sửa; giờ thì không, và snapshot mất khoảng 0,5 s thay vì 35 s trên repo 4.000 file.</span></li>
|
|
422
|
-
</ul>
|
|
423
|
-
<p class="release-requires"><strong>Cần:</strong> Agent Studio 0.38.0 và Agent Watch 0.15.14 (Windows 0.1.17) cho mức Bypass ở chế độ công ty</p>
|
|
424
|
-
</div>
|
|
425
|
-
</article>
|
|
426
429
|
</section>
|
|
427
430
|
<section class="section archive">
|
|
428
431
|
<h2 id="archive">Các bản trước</h2>
|
|
429
432
|
<p class="section-lead">Bản cũ hơn, gom theo tháng. Mở một tháng để xem từng thay đổi.</p>
|
|
430
433
|
<details class="release-archive">
|
|
431
|
-
<summary><span>Tháng 10/2026</span><span class="archive-count">
|
|
434
|
+
<summary><span>Tháng 10/2026</span><span class="archive-count">58</span></summary>
|
|
435
|
+
<div class="archive-row" id="v1-38-1">
|
|
436
|
+
<div class="archive-head"><a class="release-version" href="#v1-38-1">v1.38.1</a> <span class="release-date">23/10/2026</span></div>
|
|
437
|
+
<div class="archive-body">
|
|
438
|
+
<p><strong>Bản phát hành chính thức của v1.38.0</strong> — v1.38.0 không qua release check vì hai test nên chưa từng được phát hành; v1.38.1 là cùng bản đó với hai test đã được sửa.</p>
|
|
439
|
+
<ul class="release-items">
|
|
440
|
+
<li data-kind="improved"><span class="kind kind-improved">Cải thiện</span><span>Hai test phát hành nay pass trên Linux và máy chạy chậm, nên editor, terminal, review, checkpoint và Bypass của v1.38.0 có trong bản này.</span></li>
|
|
441
|
+
</ul>
|
|
442
|
+
</div>
|
|
443
|
+
</div>
|
|
444
|
+
<div class="archive-row" id="v1-38-0">
|
|
445
|
+
<div class="archive-head"><a class="release-version" href="#v1-38-0">v1.38.0</a> <span class="release-date">23/10/2026</span></div>
|
|
446
|
+
<div class="archive-body">
|
|
447
|
+
<p><strong>Piagent thành editor, Bypass không hỏi gì</strong> <span class="tag">không phát hành</span> — Dashboard có file, terminal, review inline và checkpoint, cùng chế độ Bypass không hỏi gì, cả trong cuộc trò chuyện công ty khi Harness cho phép.</p>
|
|
448
|
+
<ul class="release-items">
|
|
449
|
+
<li data-kind="breaking"><span class="kind kind-breaking">Thay đổi lớn</span><span>Cuộc trò chuyện công ty có Hỏi trước, Toàn quyền (trước đây gọi là Bypass) và Bypass, chỉ có khi Harness cho phép.</span></li>
|
|
450
|
+
<li data-kind="new"><span class="kind kind-new">Mới</span><span>Chế độ <code>bypass</code> (<code>/permission bypass</code>, <code>piagent-auto --bypass</code>) tắt mọi bước chặn; output vẫn được che secret và <code>/undo</code> vẫn hoàn tác được.</span></li>
|
|
451
|
+
<li data-kind="new"><span class="kind kind-new">Mới</span><span>Dashboard mở, sửa, lưu, đổi tên và xóa file của project, có Cmd/Ctrl+P, tìm kiếm và báo xung đột khi file đã đổi trên đĩa.</span></li>
|
|
452
|
+
<li data-kind="new"><span class="kind kind-new">Mới</span><span>Terminal của project ngay trên dashboard; terminal của cuộc trò chuyện công ty chạy trong sandbox, cả trên macOS, không bao giờ chạy trên host.</span></li>
|
|
453
|
+
<li data-kind="new"><span class="kind kind-new">Mới</span><span>Review inline từng hunk agent sửa với Giữ và Hoàn tác, và khôi phục trong Timeline có xem trước, dùng chung checkpoint với <code>/undo</code>.</span></li>
|
|
454
|
+
<li data-kind="fixed"><span class="kind kind-fixed">Sửa lỗi</span><span>Checkpoint không tạo được từng chặn mọi lần sửa; giờ thì không, và snapshot mất khoảng 0,5 s thay vì 35 s trên repo 4.000 file.</span></li>
|
|
455
|
+
</ul>
|
|
456
|
+
</div>
|
|
457
|
+
</div>
|
|
432
458
|
<div class="archive-row" id="v1-37-1">
|
|
433
459
|
<div class="archive-head"><a class="release-version" href="#v1-37-1">v1.37.1</a> <span class="release-date">22/10/2026</span></div>
|
|
434
460
|
<div class="archive-body">
|
package/docs-site/windows.html
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<span class="brand-mark"><img src="/assets/piagent-logo.svg" alt="" width="28" height="28" /></span>
|
|
38
38
|
<span class="brand-name"><b>Piagent</b> <span>Platform</span></span>
|
|
39
39
|
</a>
|
|
40
|
-
<a class="version-badge" href="/whats-new" data-docs-version="v1.
|
|
40
|
+
<a class="version-badge" href="/whats-new" data-docs-version="v1.46.1" title="v1.46.1 docs · VI"><span class="dot"></span>v1.46.1</a>
|
|
41
41
|
<nav class="top-nav" aria-label="Tài liệu">
|
|
42
42
|
<a href="/quickstart">Tài liệu</a>
|
|
43
43
|
<a href="/whats-new">Changelog</a>
|
package/docs-site/workflows.html
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<span class="brand-mark"><img src="/assets/piagent-logo.svg" alt="" width="28" height="28" /></span>
|
|
38
38
|
<span class="brand-name"><b>Piagent</b> <span>Platform</span></span>
|
|
39
39
|
</a>
|
|
40
|
-
<a class="version-badge" href="/whats-new" data-docs-version="v1.
|
|
40
|
+
<a class="version-badge" href="/whats-new" data-docs-version="v1.46.1" title="v1.46.1 docs · VI"><span class="dot"></span>v1.46.1</a>
|
|
41
41
|
<nav class="top-nav" aria-label="Tài liệu">
|
|
42
42
|
<a href="/quickstart">Tài liệu</a>
|
|
43
43
|
<a href="/whats-new">Changelog</a>
|
|
@@ -256,8 +256,8 @@
|
|
|
256
256
|
},
|
|
257
257
|
{
|
|
258
258
|
"path": "tests",
|
|
259
|
-
"fileCount":
|
|
260
|
-
"sha256": "
|
|
259
|
+
"fileCount": 636,
|
|
260
|
+
"sha256": "143847ccd4abfed97f9fc6bc5f7e5d654eb1cf83507ed473f5d2344327b14d8e"
|
|
261
261
|
}
|
|
262
262
|
],
|
|
263
263
|
"custodianComparisonRules": {
|
package/package.json
CHANGED
|
@@ -494,7 +494,9 @@ function requestedPiProvider(model, configRoot, credentials) {
|
|
|
494
494
|
}
|
|
495
495
|
|
|
496
496
|
function snapshotPiAgentHome(temporaryRoot, runtimeParent, argv, cwd, replay, { providerFreeFinalization = false } = {}) {
|
|
497
|
-
|
|
497
|
+
// Piagent's own Pi home holds the login benchmarks borrow (see extensions/agent-home.js).
|
|
498
|
+
const personal = path.resolve(os.homedir(), ".pi", "agent"), configured = process.env.PI_CODING_AGENT_DIR;
|
|
499
|
+
const sourceRoot = path.resolve(process.env.PIAGENT_AGENT_DIR || (configured && path.resolve(configured) !== personal ? configured : path.join(os.homedir(), ".piagent", "agent")));
|
|
498
500
|
const configRoot = path.join(temporaryRoot, "pi-agent-config");
|
|
499
501
|
fs.mkdirSync(configRoot, { recursive: true, mode: 0o700 });
|
|
500
502
|
const copied = [];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export function personalPiAgentDir(home?: string): string;
|
|
2
|
+
export function piagentAgentDir(env?: NodeJS.ProcessEnv, home?: string): string;
|
|
3
|
+
export function agentWatchControlDir(home?: string): string;
|
|
4
|
+
export function dormantInPersonalPi(env?: NodeJS.ProcessEnv, home?: string, argv?: string[]): boolean;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
// Piagent runs Pi from its own home (~/.piagent/agent) so the member's
|
|
6
|
+
// personal `pi` stays the stock host: no Piagent package, add-ons, model scope
|
|
7
|
+
// or footer panel lands in ~/.pi/agent. Agent Watch still reads its control
|
|
8
|
+
// files (runtime record, managed binding, status) from ~/.pi/agent, so those
|
|
9
|
+
// stay where Watch looks; Pi itself ignores them.
|
|
10
|
+
|
|
11
|
+
/** The stock Pi home, the member's personal `pi`. */
|
|
12
|
+
export function personalPiAgentDir(home = os.homedir()) {
|
|
13
|
+
return path.resolve(home, ".pi", "agent");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Where Piagent's Pi keeps settings, packages, login and sessions. An explicit
|
|
18
|
+
* PIAGENT_AGENT_DIR wins; a PI_CODING_AGENT_DIR that points anywhere but the
|
|
19
|
+
* personal home is honoured (tests, benchmarks, custom setups); otherwise
|
|
20
|
+
* ~/.piagent/agent.
|
|
21
|
+
*/
|
|
22
|
+
export function piagentAgentDir(env = process.env, home = os.homedir()) {
|
|
23
|
+
const own = env.PIAGENT_AGENT_DIR?.trim();
|
|
24
|
+
if (own) return path.resolve(own);
|
|
25
|
+
const configured = env.PI_CODING_AGENT_DIR?.trim();
|
|
26
|
+
if (configured && path.resolve(configured) !== personalPiAgentDir(home)) return path.resolve(configured);
|
|
27
|
+
return path.resolve(home, ".piagent", "agent");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Agent Watch's files: the runtime record, the managed binding and status. */
|
|
31
|
+
export function agentWatchControlDir(home = os.homedir()) {
|
|
32
|
+
return personalPiAgentDir(home);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function realpath(file) {
|
|
36
|
+
try { return fs.realpathSync(file); } catch { return path.resolve(file); }
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* True when this process is the stock `pi` command running from the personal
|
|
41
|
+
* home: Piagent was registered there by an older release or a project's
|
|
42
|
+
* .pi/settings.json, and it stays out of the member's way. Hosts that embed Pi
|
|
43
|
+
* (studio, dashboard gateway, benchmarks) and `piagent` itself are never
|
|
44
|
+
* dormant; PIAGENT_ACTIVE=1 opts a personal `pi` back in.
|
|
45
|
+
*/
|
|
46
|
+
export function dormantInPersonalPi(env = process.env, home = os.homedir(), argv = process.argv) {
|
|
47
|
+
if (env.PIAGENT_ACTIVE === "1") return false;
|
|
48
|
+
const configured = env.PI_CODING_AGENT_DIR?.trim();
|
|
49
|
+
if (configured && path.resolve(configured) !== personalPiAgentDir(home)) return false;
|
|
50
|
+
const entry = argv[1] ? realpath(argv[1]) : "";
|
|
51
|
+
return /[\\/]@earendil-works[\\/]pi-coding-agent[\\/]/.test(entry);
|
|
52
|
+
}
|
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
} from "./redaction-core.js";
|
|
38
38
|
import { detectProfileName } from "./project-shape.js";
|
|
39
39
|
import { evaluateUpdateCheck, isInstalledPlatform, readUpdateCache, startUpdateProbe } from "./update-check.js";
|
|
40
|
+
import { dormantInPersonalPi, personalPiAgentDir } from "./agent-home.js";
|
|
40
41
|
import {
|
|
41
42
|
REPOSITORY_SCOPES,
|
|
42
43
|
collectServers,
|
|
@@ -366,7 +367,7 @@ const PLATFORM_ROOT = findPlatformRoot(path.dirname(fileURLToPath(import.meta.ur
|
|
|
366
367
|
// package's and the user's (also those kept for other coding agents, such as
|
|
367
368
|
// ~/.claude/skills). Reading them is allowed; writes stay in the project.
|
|
368
369
|
const SKILL_READ_ROOTS = [path.join(PLATFORM_ROOT, "packages", "piagent-core", "skills"),
|
|
369
|
-
path.join(process.env.PI_CODING_AGENT_DIR ||
|
|
370
|
+
path.join(process.env.PI_CODING_AGENT_DIR || personalPiAgentDir(), "skills"), path.join(personalPiAgentDir(), "skills"), ...userSkillFolders()]
|
|
370
371
|
.flatMap((root) => { try { return [fs.realpathSync.native(root)]; } catch { return []; } });
|
|
371
372
|
const UPDATE_CHECK_MODULE = fileURLToPath(new URL("./update-check.js", import.meta.url));
|
|
372
373
|
// The installed version, read from the package this file ships in. A maintainer
|
|
@@ -3452,6 +3453,9 @@ function activeSessionTask(_cwd: string, _sessionId: string): TaskContract | und
|
|
|
3452
3453
|
const noTask = (..._args: unknown[]): undefined => undefined;
|
|
3453
3454
|
|
|
3454
3455
|
export default function piagentGuard(pi: ExtensionAPI) {
|
|
3456
|
+
// The member's own `pi` stays stock even when an older install or a project
|
|
3457
|
+
// still registers this package there; Piagent runs through `piagent`.
|
|
3458
|
+
if (dormantInPersonalPi()) return;
|
|
3455
3459
|
const extensionDir = path.dirname(fileURLToPath(import.meta.url));
|
|
3456
3460
|
const policy = loadPolicy(extensionDir);
|
|
3457
3461
|
const bashResults = createBashResultLedger({ maxEntries: 300 });
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { memberMessages, memberRequest } from './objections.mjs';
|
|
2
|
+
|
|
3
|
+
// Several helpers of one role, at the member's request only ("use 3
|
|
4
|
+
// reviewers", "cho 3 scout"): one delegate call runs 2 to MAX_COPIES helper
|
|
5
|
+
// sessions of the role side by side, each with its own context, and their
|
|
6
|
+
// answers merge into one. The main agent never adds helpers on its own, and
|
|
7
|
+
// the harness never does: the call quotes the member's words that ask for
|
|
8
|
+
// them, and those words must be the member's own and name the number. The
|
|
9
|
+
// copies share the role's grant, so Studio counts the role once while each
|
|
10
|
+
// copy counts against the role's calls for the message.
|
|
11
|
+
export const MAX_COPIES = 3;
|
|
12
|
+
const COUNTS = { two: 2, three: 3, hai: 2, ba: 3 };
|
|
13
|
+
// Words that say the number is of helpers, not of files or steps.
|
|
14
|
+
const HELPER_WORDS = /agent|helper|review|scout|research|verif|nghiên cứu|kiểm|xác minh|trinh sát/;
|
|
15
|
+
const normal = text => String(text ?? '').toLowerCase().normalize('NFC').replace(/\s+/g, ' ').trim();
|
|
16
|
+
// The largest helper count the words name (a digit, or two/three in English or Vietnamese).
|
|
17
|
+
export function namedCount(words) {
|
|
18
|
+
const found = [...normal(words).matchAll(/(?<![\p{L}\d])(\d+|two|three|hai|ba)(?![\p{L}\d])/gu)].map(m => COUNTS[m[1]] ?? Number(m[1]));
|
|
19
|
+
return found.length ? Math.max(...found) : 0;
|
|
20
|
+
}
|
|
21
|
+
// The copies a delegate call asks for, checked against the member's words;
|
|
22
|
+
// null for a plain call. `split`: one line per copy naming its share of the work.
|
|
23
|
+
export function fanOut(manager, role, args, harness) {
|
|
24
|
+
const split = Array.isArray(args?.split) ? args.split.map(s => typeof s === 'string' ? s.trim().slice(0, 500) : '').filter(Boolean) : [];
|
|
25
|
+
const n = split.length || (Number.isInteger(args?.copies) ? args.copies : 1);
|
|
26
|
+
if (n <= 1 && !args?.member_words) return null;
|
|
27
|
+
if (harness) throw Error('managed-copies-invalid: the harness runs one helper per call.');
|
|
28
|
+
if (n < 2 || n > MAX_COPIES) throw Error(`managed-copies-invalid: ask for 2 to ${MAX_COPIES} ${role} helpers (copies, or one split line per helper).`);
|
|
29
|
+
const words = normal(args?.member_words);
|
|
30
|
+
if (words.length < 3 || !memberRequest(memberMessages(manager)).some(text => normal(text).includes(words)) || namedCount(words) < n || !HELPER_WORDS.test(words))
|
|
31
|
+
throw Error(`managed-copies-not-asked: more than one ${role} helper runs only when the member asks for it. Quote in member_words the member's own words that ask for ${n} (verbatim, with the number); otherwise use one helper.`);
|
|
32
|
+
return { n, split: split.length ? split : null };
|
|
33
|
+
}
|
|
34
|
+
// What one copy reads under its brief.
|
|
35
|
+
export function copyNote(role, i, fan) {
|
|
36
|
+
return `\n\nThe member asked for ${fan.n} ${role} helpers; you are ${role} helper ${i + 1} of ${fan.n}. ${fan.split ? `Your share of the work: ${fan.split[i]}. The others cover the rest.` : 'The others have the same brief: answer on your own judgement.'}`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const jsonOf = reply => {
|
|
40
|
+
for (const raw of [...String(reply).matchAll(/```json\s*([\s\S]*?)```/g)].map(m => m[1]).reverse()) { try { const v = JSON.parse(raw); if (v && typeof v === 'object') return v; } catch { /* next */ } }
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
43
|
+
const unique = (list, key) => { const seen = new Set(); return list.filter(x => { const k = key(x); if (seen.has(k)) return false; seen.add(k); return true; }); };
|
|
44
|
+
const SEVERITY = { blocking: 0, major: 1, minor: 2 };
|
|
45
|
+
// One answer from the copies: each helper's prose (its JSON left out), then
|
|
46
|
+
// one JSON block joining their findings, verdicts and objections, so the
|
|
47
|
+
// review, verify and objection readers see every copy. `parsed`: every copy
|
|
48
|
+
// gave its JSON. A finding or a failed claim any copy reports stands.
|
|
49
|
+
export function mergeCopies(role, label, answers, { findingsOf, issuesOf, verdictsOf }) {
|
|
50
|
+
const n = answers.length, room = Math.floor(12000 / n);
|
|
51
|
+
const findings = role === 'review' ? unique(answers.flatMap(a => findingsOf(a.reply) ?? []), f => `${f.severity}|${f.file}|${f.line}|${f.issue}`).sort((a, b) => SEVERITY[a.severity] - SEVERITY[b.severity]) : null;
|
|
52
|
+
const verdicts = role === 'verify' ? unique(answers.flatMap(a => verdictsOf(a.reply) ?? []), v => `${v.status}|${v.claim}`) : null;
|
|
53
|
+
const issues = unique(answers.flatMap(a => issuesOf(a.reply) ?? []), i => `${i.kind}|${i.detail}`).slice(0, 5);
|
|
54
|
+
const parsed = answers.every(a => jsonOf(a.reply));
|
|
55
|
+
const summaries = answers.map(a => jsonOf(a.reply)?.summary).filter(s => typeof s === 'string').map(s => s.slice(0, 200));
|
|
56
|
+
const json = { ...(findings ? { findings: findings.slice(0, 40) } : {}), ...(verdicts ? { verdicts: verdicts.slice(0, 40) } : {}), brief_issues: issues,
|
|
57
|
+
summary: `${n} ${role} helpers${summaries.length ? ': ' + summaries.join(' | ') : ''}`.slice(0, 900) };
|
|
58
|
+
const body = answers.map((a, i) => `### ${label} helper ${i + 1} of ${n}\n${String(a.reply).replace(/```json\s*[\s\S]*?```/g, '').trim().slice(0, room)}`).join('\n\n');
|
|
59
|
+
return { reply: `${body}\n\n\`\`\`json\n${JSON.stringify(json)}\n\`\`\``, usage: answers.reduce((total, a) => total + a.usage, 0),
|
|
60
|
+
...(findings ? { findings, parsed, blocking: findings.filter(f => f.severity === 'blocking').length } : {}) };
|
|
61
|
+
}
|
|
@@ -7,7 +7,7 @@ export function shareGrant(owner, role) {
|
|
|
7
7
|
owner.sharedGrants ??= new Map();
|
|
8
8
|
const shared = owner.sharedGrants.get(role);
|
|
9
9
|
if (shared && Date.now() - shared.at < 60_000) { shared.users++; return shared; }
|
|
10
|
-
const entry = { at: Date.now(), users: 1, grant: owner.broker.request('renew',
|
|
10
|
+
const entry = { at: Date.now(), users: 1, grant: owner.broker.request('renew', slotArgs(role)) };
|
|
11
11
|
entry.grant.catch(() => { if (owner.sharedGrants.get(role) === entry) owner.sharedGrants.delete(role); });
|
|
12
12
|
owner.sharedGrants.set(role, entry);
|
|
13
13
|
return entry;
|
|
@@ -16,3 +16,11 @@ export function shareGrant(owner, role) {
|
|
|
16
16
|
export function releaseGrant(owner, role, entry) {
|
|
17
17
|
if (--entry.users <= 0 && owner.sharedGrants?.get(role) === entry) owner.sharedGrants.delete(role);
|
|
18
18
|
}
|
|
19
|
+
|
|
20
|
+
// A helper the member asked for beside another of its role holds a grant of
|
|
21
|
+
// its own: its key is role#slot (slot 2 or 3), the broker's {role, slot}.
|
|
22
|
+
export const baseRole = key => String(key).split('#')[0];
|
|
23
|
+
export function slotArgs(key) {
|
|
24
|
+
const [role, slot] = String(key).split('#');
|
|
25
|
+
return slot ? { role, slot: Number(slot) } : { role };
|
|
26
|
+
}
|
|
@@ -44,7 +44,9 @@ export function helperPrompt(roles) {
|
|
|
44
44
|
: `Use the research helper (delegate role "research") for anything on the web (current information, news, documentation) and ${WIDE_READING}; work from its findings and do small code lookups yourself.`);
|
|
45
45
|
if (roles.includes('verify')) lines.push('Before you report a non-trivial result as done, you may have the verify helper (delegate role "verify") confirm it independently: it runs the repository checks on the current code and checks claims against the code and primary sources, answering pass, fail or unverifiable with evidence.');
|
|
46
46
|
// Helpers read the member's request beside the brief and may object to it.
|
|
47
|
-
if (lines.length) lines.push('A helper sees the member\'s request next to your brief and may object to the brief with evidence (brief_issues). You decide, but
|
|
47
|
+
if (lines.length) lines.push('A helper sees the member\'s request next to your brief and may object to the brief with evidence (brief_issues); each objection gets an id. You decide, but check each one at the place its evidence names and record your decision with resolve_objection: accepted with what you changed (a corrected brief, the plan, the code), or rejected with what you checked and why. An objection that the brief rests on a wrong premise or conflicts with the request refuses file changes until you decide it; a rejected one goes back to the helper, and a disagreement that remains goes to the member, as does a second objection from the same helper for one message.');
|
|
48
|
+
// More than one helper of a role, only at the member's word (copies.mjs).
|
|
49
|
+
if (lines.length) lines.push('One helper per role works on a brief. Only when the member asks for several of one role ("use 3 subagents", "dùng 2 helper"), run up to 3 in one delegate call: copies for independent answers on the same brief, or split for shares of the work, with member_words quoting the member\'s request. Never add helpers on your own.');
|
|
48
50
|
return lines.length ? ' ' + lines.join(' ') : '';
|
|
49
51
|
}
|
|
50
52
|
const HELPER_USES = {
|
|
@@ -52,10 +54,10 @@ const HELPER_USES = {
|
|
|
52
54
|
research: roles => roles.includes('scout') ? 'research: anything on the web (current information, news, library or API documentation, releases, error messages), with the code when needed. It searches and reads the pages; you get its summary with sources.'
|
|
53
55
|
: 'research: anything on the web (current information, news, documentation; it searches and reads the pages, you get its summary with sources), and before changing an area you do not know that spans more files than you can read in a few batches (where something is computed and every caller, how a flow crosses modules); your own context stays free for the change.',
|
|
54
56
|
verify: () => 'verify: an independent check of a result: it runs the repository checks on the current code (offline, and the project is read-only for its commands) and confirms claims, yours or a helper\'s, against the code and primary sources. It answers pass, fail or unverifiable per claim, with evidence.',
|
|
55
|
-
review: () => 'review: an independent review of the current patch (this turn\'s changes, commits made in the turn included). To review work committed in earlier turns, pass since: the commit, branch or HEAD~N it started from; when this turn changed nothing, it reviews the branch\'s commits since it left the default branch.',
|
|
57
|
+
review: () => 'review: an independent review of the current patch (this turn\'s changes, commits made in the turn included). To review work committed in earlier turns, pass since: the commit, branch or HEAD~N it started from; when this turn changed nothing, it reviews the branch\'s commits since it left the default branch. Ask once, when your change is finished, and again only after fixing blocking findings; under a required review the harness reviews the final patch and refuses your own call.',
|
|
56
58
|
};
|
|
57
59
|
export function delegateDescription(roles) {
|
|
58
|
-
return `Hand work to a helper with its own context. Helpers read the project but cannot change files or call helpers. ${roles.map(role => HELPER_USES[role](roles)).join(' ')} A lookup that one grep or read answers stays with you. Write the task as a brief the helper can act on alone: the goal, what to find or check, where to start and what you already know or ruled out, and the answer you need (file:line facts). One call per helper runs at a time; each can be called again, up to ${HELPER_CALLS} times per user message, for example a second
|
|
60
|
+
return `Hand work to a helper with its own context. Helpers read the project but cannot change files or call helpers. ${roles.map(role => HELPER_USES[role](roles)).join(' ')} A lookup that one grep or read answers stays with you. Write the task as a brief the helper can act on alone: the goal, what to find or check, where to start and what you already know or ruled out, and the answer you need (file:line facts). One call per helper runs at a time; each can be called again, up to ${HELPER_CALLS} times per user message, for example a second scout question on what the first answer opened.`;
|
|
59
61
|
}
|
|
60
62
|
// Scout and research end with their objections to the brief, if any.
|
|
61
63
|
const OBJECTIONS = `${BRIEF_CHECK} End your answer with one JSON object in a \`\`\`json block: {${BRIEF_ISSUES_JSON}}, with an empty list when the brief is sound. You cannot change files or delegate.`;
|