@piagent/platform 1.20.0 → 1.21.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 +10 -0
- package/README.md +1 -1
- package/README.vi.md +1 -1
- package/docs/command-reference-vietnamese.md +2 -2
- package/docs/distribution-standard.md +6 -6
- package/docs/languages.json +2 -2
- package/docs/operator-manual-vietnamese.md +7 -7
- package/docs/publishing-for-teams.md +1 -0
- package/docs/release-install-policy.md +2 -2
- package/docs/team-onboarding.md +2 -2
- package/docs-site/architecture.html +1 -1
- package/docs-site/benchmark.html +1 -1
- package/docs-site/commands.html +1 -1
- package/docs-site/content/en/index.html +4 -4
- package/docs-site/content/en/whats-new.html +8 -0
- package/docs-site/content/index.html +4 -4
- package/docs-site/content/whats-new.html +8 -0
- 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 +5 -5
- 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/whats-new.html +9 -1
- package/docs-site/en/windows.html +1 -1
- package/docs-site/en/workflows.html +1 -1
- package/docs-site/index.html +5 -5
- 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/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/whats-new.html +9 -1
- 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/managed/call-purpose.mjs +20 -1
- package/packages/piagent-core/managed/compaction.mjs +23 -0
- package/packages/piagent-core/managed/member-questions.d.mts +2 -2
- package/packages/piagent-core/managed/member-questions.mjs +5 -3
- package/packages/piagent-core/managed/session.mjs +2 -2
- package/packages/piagent-core/package.json +1 -1
- package/packages/piagent-webui/dist/client/assets/{MarkdownMessage-nggiOt0N.js → MarkdownMessage-gIQf0oYL.js} +1 -1
- package/packages/piagent-webui/dist/client/assets/index-C86-7gi8.js +231 -0
- package/packages/piagent-webui/dist/client/assets/{index-Z91z6SlN.css → index-ZLemRWyJ.css} +1 -1
- package/packages/piagent-webui/dist/client/index.html +2 -2
- package/packages/piagent-webui/gateway/session-questions.ts +8 -3
- package/packages/piagent-webui/gateway/session-runtime-ownership.ts +2 -1
- package/packages/piagent-webui/gateway/session-runtime-state.ts +2 -0
- package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +9 -9
- package/packages/piagent-webui/dist/client/assets/index-CM9cs-gP.js +0 -230
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · EN</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Language">
|
|
35
35
|
<a class="language-option" href="/whats-new" hreflang="vi" lang="vi">VI</a>
|
|
36
36
|
<a class="language-option current" href="/en/whats-new" hreflang="en" lang="en" aria-current="true">EN</a>
|
|
@@ -104,6 +104,14 @@
|
|
|
104
104
|
<h1>1.9.0: ask in plain language, the team's Harness checks</h1>
|
|
105
105
|
<p>The task contract and workflow commands are gone. Company mode asks for checks and a review on its own; Stop, network commands on approval and clearer approval cards.</p>
|
|
106
106
|
</div>
|
|
107
|
+
<section class="section">
|
|
108
|
+
<p class="section-kicker">v1.21.0 · 2026-10-09</p>
|
|
109
|
+
<h2 id="v1-21-0">Decisions come one at a time, and you see at once which conversation finished or waits for you</h2>
|
|
110
|
+
<p class="section-lead">The agent's questions and approval requests no longer stack down the page: one card shows at a time, with steps above it (“Needs your decision · 1/3”) that say who asks (the main agent or which subagent), what kind (Ask / Approve) and let you jump to another. The main agent's come first, since your answer shapes its subagents' work; then subagents in work order (scout, research, verify, review); within one agent, what was asked first. Answering one brings up the next.</p>
|
|
111
|
+
<p class="section-lead">Several conversations at once: a notification at the top right says when another conversation finishes a turn, fails, stops, or starts waiting for your answer or approval; “Open” takes you there. “Done” fades after a few seconds; a waiting decision stays until you answer or open it. In the sidebar, a conversation waiting for you glows amber and reads “Needs your answer” or “Needs approval”, one that finished while you were elsewhere reads “Done · not seen” until you open it, and both move to the top of “Running · needs attention”. The tab title counts what waits, e.g. “(2) Piagent”.</p>
|
|
112
|
+
<p class="section-lead">Studio logs each compaction of a company conversation: why, the size before and after, and the outcome, in Logs → Lượt agent (needs Agent Studio 0.25.0).</p>
|
|
113
|
+
</section>
|
|
114
|
+
|
|
107
115
|
<section class="section">
|
|
108
116
|
<p class="section-kicker">v1.20.0 · 2026-10-09</p>
|
|
109
117
|
<h2 id="v1-20-0">Package installs in the company sandbox no longer ask</h2>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · EN</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Language">
|
|
35
35
|
<a class="language-option" href="/windows" hreflang="vi" lang="vi">VI</a>
|
|
36
36
|
<a class="language-option current" href="/en/windows" hreflang="en" lang="en" aria-current="true">EN</a>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · EN</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Language">
|
|
35
35
|
<a class="language-option" href="/workflows" hreflang="vi" lang="vi">VI</a>
|
|
36
36
|
<a class="language-option current" href="/en/workflows" hreflang="en" lang="en" aria-current="true">EN</a>
|
package/docs-site/index.html
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · VI</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Ngôn ngữ">
|
|
35
35
|
<a class="language-option current" href="/" hreflang="vi" lang="vi" aria-current="true">VI</a>
|
|
36
36
|
<a class="language-option" href="/en/" hreflang="en" lang="en">EN</a>
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
<main>
|
|
95
95
|
<div class="content-shell" data-article>
|
|
96
96
|
<section class="hero">
|
|
97
|
-
<p class="eyebrow">Piagent 1.
|
|
97
|
+
<p class="eyebrow">Piagent 1.21.0</p>
|
|
98
98
|
<h1>Coding agent cho cả team, kiểm tra từng bước.</h1>
|
|
99
99
|
<p>
|
|
100
100
|
Một dashboard cho Terminal và trình duyệt. Dùng model bằng tài khoản của bạn, hoặc model của công ty qua Agent Watch và Agent Studio. Guard kiểm tra từng tool call; ở chế độ công ty, Harness của team tự yêu cầu chạy check, cho subagent review và báo kết quả ngay dưới câu trả lời.
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
<div class="hero-actions">
|
|
109
109
|
<a class="button primary" href="/quickstart">Bắt đầu</a>
|
|
110
110
|
<a class="button" href="/ecosystem">Hệ sinh thái</a>
|
|
111
|
-
<a class="button" href="/whats-new">Có gì mới trong 1.
|
|
111
|
+
<a class="button" href="/whats-new">Có gì mới trong 1.21.0</a>
|
|
112
112
|
<a class="button" href="/commands">Xem command</a>
|
|
113
113
|
</div>
|
|
114
114
|
</section>
|
|
@@ -184,9 +184,9 @@ piagent-setup</code></pre>
|
|
|
184
184
|
<h2 id="bat-dau-tu-dau">Bắt đầu từ đâu</h2>
|
|
185
185
|
<div class="card-grid">
|
|
186
186
|
<a class="doc-card" href="/whats-new">
|
|
187
|
-
<span class="card-kicker">Bản 1.
|
|
187
|
+
<span class="card-kicker">Bản 1.21.0</span>
|
|
188
188
|
<h3>Có gì mới</h3>
|
|
189
|
-
<p>
|
|
189
|
+
<p>Câu hỏi và yêu cầu duyệt hiện từng cái một (main agent trước), thông báo góc phải khi cuộc trò chuyện khác xong hay đang chờ bạn, Studio ghi lại mỗi lần compact; ở 1.20.0: cài package trong sandbox công ty không phải duyệt (npm, PyPI, Go, Maven, Gradle… qua proxy chỉ cho registry); ở 1.19.0: task công ty có checklist được làm đến hết, cuối mỗi lượt báo rõ xong, dừng giữa chừng hay lỗi, Docker trong sandbox công ty, folder chứa nhiều repo; ở 1.18.0: đổi nhánh Git trên dashboard, tự thử lại khi lỗi tạm thời, Claude Haiku 5.5; ở 1.17.0: dashboard hiện nhánh Git của project; ở 1.16.3: dashboard cập nhật xong vẫn tự kiểm tra bản mới; ở 1.16.2: Terminal nói giống dashboard: hỏi cập nhật, /bypass, lỗi và ghi chú Harness bằng tiếng Việt; ở 1.16.1: bản mới được báo bằng dialog và kiểm tra mỗi giờ, tab dashboard không còn mất đăng nhập; ở 1.16.0: Bypass cho cuộc trò chuyện công ty, đổi Harness không làm gián đoạn; ở 1.15.2: cuộc trò chuyện dài tự thu gọn trở lại; ở 1.15.1: Studio thấy mỗi call của model dùng để làm gì, nhiều cuộc trò chuyện trong một folder không nhận nhầm thay đổi của nhau; ở 1.15.0: subagent bị từ chối nói đúng lý do; ở 1.14: cập nhật giữ model bạn đã chọn; ở 1.13: cuộc trò chuyện giữ chỗ đang đọc, chữ của agent có định dạng, Piagent trên Windows qua WSL2: sandbox công ty bằng bubblewrap và Agent Watch cho Windows; ở 1.12: @ chọn file và folder trên máy, skill và command dùng bằng /, nhánh cuộc trò chuyện công ty gửi được tin nhắn.</p>
|
|
190
190
|
</a>
|
|
191
191
|
<a class="doc-card" href="/ecosystem">
|
|
192
192
|
<span class="card-kicker">Get started</span>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · VI</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Ngôn ngữ">
|
|
35
35
|
<a class="language-option current" href="/mcp-approval" hreflang="vi" lang="vi" aria-current="true">VI</a>
|
|
36
36
|
<a class="language-option" href="/en/mcp-approval" hreflang="en" lang="en">EN</a>
|
package/docs-site/mcp-auth.html
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · VI</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Ngôn ngữ">
|
|
35
35
|
<a class="language-option current" href="/mcp-auth" hreflang="vi" lang="vi" aria-current="true">VI</a>
|
|
36
36
|
<a class="language-option" href="/en/mcp-auth" hreflang="en" lang="en">EN</a>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · VI</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Ngôn ngữ">
|
|
35
35
|
<a class="language-option current" href="/mcp-servers" hreflang="vi" lang="vi" aria-current="true">VI</a>
|
|
36
36
|
<a class="language-option" href="/en/mcp-servers" hreflang="en" lang="en">EN</a>
|
package/docs-site/mcp.html
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · VI</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Ngôn ngữ">
|
|
35
35
|
<a class="language-option current" href="/mcp" hreflang="vi" lang="vi" aria-current="true">VI</a>
|
|
36
36
|
<a class="language-option" href="/en/mcp" hreflang="en" lang="en">EN</a>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · VI</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Ngôn ngữ">
|
|
35
35
|
<a class="language-option current" href="/permissions" hreflang="vi" lang="vi" aria-current="true">VI</a>
|
|
36
36
|
<a class="language-option" href="/en/permissions" hreflang="en" lang="en">EN</a>
|
package/docs-site/profiles.html
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · VI</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Ngôn ngữ">
|
|
35
35
|
<a class="language-option current" href="/profiles" hreflang="vi" lang="vi" aria-current="true">VI</a>
|
|
36
36
|
<a class="language-option" href="/en/profiles" hreflang="en" lang="en">EN</a>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · VI</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Ngôn ngữ">
|
|
35
35
|
<a class="language-option current" href="/quickstart" hreflang="vi" lang="vi" aria-current="true">VI</a>
|
|
36
36
|
<a class="language-option" href="/en/quickstart" hreflang="en" lang="en">EN</a>
|
package/docs-site/runtime.html
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · VI</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Ngôn ngữ">
|
|
35
35
|
<a class="language-option current" href="/runtime" hreflang="vi" lang="vi" aria-current="true">VI</a>
|
|
36
36
|
<a class="language-option" href="/en/runtime" hreflang="en" lang="en">EN</a>
|
package/docs-site/scope.html
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · VI</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Ngôn ngữ">
|
|
35
35
|
<a class="language-option current" href="/scope" hreflang="vi" lang="vi" aria-current="true">VI</a>
|
|
36
36
|
<a class="language-option" href="/en/scope" hreflang="en" lang="en">EN</a>
|
package/docs-site/security.html
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · VI</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Ngôn ngữ">
|
|
35
35
|
<a class="language-option current" href="/security" hreflang="vi" lang="vi" aria-current="true">VI</a>
|
|
36
36
|
<a class="language-option" href="/en/security" hreflang="en" lang="en">EN</a>
|
package/docs-site/team.html
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · VI</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Ngôn ngữ">
|
|
35
35
|
<a class="language-option current" href="/team" hreflang="vi" lang="vi" aria-current="true">VI</a>
|
|
36
36
|
<a class="language-option" href="/en/team" hreflang="en" lang="en">EN</a>
|
package/docs-site/whats-new.html
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · VI</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Ngôn ngữ">
|
|
35
35
|
<a class="language-option current" href="/whats-new" hreflang="vi" lang="vi" aria-current="true">VI</a>
|
|
36
36
|
<a class="language-option" href="/en/whats-new" hreflang="en" lang="en">EN</a>
|
|
@@ -104,6 +104,14 @@
|
|
|
104
104
|
<h1>Bản 1.9.0: nói việc bằng lời, Harness của team kiểm tra</h1>
|
|
105
105
|
<p>Bỏ task contract và lệnh workflow. Chế độ công ty tự yêu cầu check và review; nút Dừng, lệnh có mạng theo lần duyệt và thẻ duyệt dễ đọc hơn.</p>
|
|
106
106
|
</div>
|
|
107
|
+
<section class="section">
|
|
108
|
+
<p class="section-kicker">v1.21.0 · 2026-10-09</p>
|
|
109
|
+
<h2 id="v1-21-0">Việc cần bạn quyết hiện từng cái một, và biết ngay cuộc trò chuyện nào xong hay đang chờ bạn</h2>
|
|
110
|
+
<p class="section-lead">Câu hỏi và yêu cầu duyệt của agent không còn xếp chồng dài xuống trang: mỗi lần chỉ hiện một thẻ, phía trên có thanh “Việc cần bạn quyết · 1/3” ghi rõ ai hỏi (main agent hay subagent nào), loại việc (Hỏi / Duyệt) và cho bấm chuyển sang việc khác. Việc của main agent hiện trước vì câu trả lời của bạn định hướng việc của subagent; sau đó tới subagent theo thứ tự làm việc (scout, research, verify, review); trong cùng một agent, việc hỏi trước hiện trước. Trả lời xong thẻ này thì thẻ kế tiếp hiện lên.</p>
|
|
111
|
+
<p class="section-lead">Làm nhiều cuộc trò chuyện cùng lúc: góc phải trên màn hình hiện thông báo khi một cuộc trò chuyện khác xong lượt, bị lỗi, bị dừng, hoặc đang chờ bạn trả lời hay duyệt; bấm “Mở” để vào đúng cuộc trò chuyện đó. Thông báo “Xong” tự ẩn sau vài giây, việc đang chờ bạn thì giữ đến khi bạn trả lời hoặc mở. Ở cột trái, cuộc trò chuyện đang chờ bạn sáng viền cam và ghi “Cần bạn trả lời” hoặc “Cần duyệt”, cuộc trò chuyện xong khi bạn đang ở chỗ khác ghi “Xong · chưa xem” cho đến khi bạn mở, và cả hai được đưa lên đầu mục “Đang chạy · cần chú ý”. Tiêu đề tab đếm số việc đang chờ, ví dụ “(2) Piagent”.</p>
|
|
112
|
+
<p class="section-lead">Studio ghi lại mỗi lần cuộc trò chuyện công ty được thu gọn (compact): lý do, kích thước trước và sau, kết quả, hiện trong Logs → Lượt agent (cần Agent Studio 0.25.0).</p>
|
|
113
|
+
</section>
|
|
114
|
+
|
|
107
115
|
<section class="section">
|
|
108
116
|
<p class="section-kicker">v1.20.0 · 2026-10-09</p>
|
|
109
117
|
<h2 id="v1-20-0">Cài package trong sandbox công ty không phải duyệt nữa</h2>
|
package/docs-site/windows.html
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · VI</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Ngôn ngữ">
|
|
35
35
|
<a class="language-option current" href="/windows" hreflang="vi" lang="vi" aria-current="true">VI</a>
|
|
36
36
|
<a class="language-option" href="/en/windows" hreflang="en" lang="en">EN</a>
|
package/docs-site/workflows.html
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<span>Pi Agent Platform</span>
|
|
31
31
|
</a>
|
|
32
32
|
<div class="top-actions">
|
|
33
|
-
<span class="pill"><span class="pill-dot"></span>v1.
|
|
33
|
+
<span class="pill"><span class="pill-dot"></span>v1.21.0 docs · VI</span>
|
|
34
34
|
<nav class="language-switch" aria-label="Ngôn ngữ">
|
|
35
35
|
<a class="language-option current" href="/workflows" hreflang="vi" lang="vi" aria-current="true">VI</a>
|
|
36
36
|
<a class="language-option" href="/en/workflows" hreflang="en" lang="en">EN</a>
|
|
@@ -256,8 +256,8 @@
|
|
|
256
256
|
},
|
|
257
257
|
{
|
|
258
258
|
"path": "tests",
|
|
259
|
-
"fileCount":
|
|
260
|
-
"sha256": "
|
|
259
|
+
"fileCount": 532,
|
|
260
|
+
"sha256": "426273d76d2f8103f71fa35bc0ff18c77ca82f5b9bccf1e4ddd27fa9cd18e197"
|
|
261
261
|
}
|
|
262
262
|
],
|
|
263
263
|
"custodianComparisonRules": {
|
package/package.json
CHANGED
|
@@ -36,7 +36,26 @@ export function purposeHeaders(owner, runtime, role, context) {
|
|
|
36
36
|
else if (['harness', 'continue'].includes(owner.nextPurpose)) { purpose = owner.nextPurpose; owner.nextPurpose = null; }
|
|
37
37
|
else purpose = 'answer';
|
|
38
38
|
const title = purpose === 'brief' ? owner.jobTitles?.get(runtime) : '';
|
|
39
|
-
return { 'X-Agent-Purpose': purpose, ...(after ? { 'X-Agent-After': after } : {}), ...(title ? { 'X-Agent-Task': encodeURIComponent(title) } : {})
|
|
39
|
+
return { 'X-Agent-Purpose': purpose, ...(after ? { 'X-Agent-After': after } : {}), ...(title ? { 'X-Agent-Task': encodeURIComponent(title) } : {}),
|
|
40
|
+
...(role === 'main' ? compactionHeaders(owner, purpose) : {}) };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// The main agent's compaction (trackCompaction in compaction.mjs): each
|
|
44
|
+
// summary call names it, why it ran and which part it is ("<id>;threshold;2");
|
|
45
|
+
// the next other call says how it ended, with Pi's token counts before and
|
|
46
|
+
// after and how long it took ("<id>;threshold;done;244039;34237;81000"), once.
|
|
47
|
+
const count = n => Number.isFinite(n) && n >= 0 ? String(Math.round(n)) : '';
|
|
48
|
+
export function compactionHeaders(owner, purpose) {
|
|
49
|
+
const out = {}, now = owner.compaction, ended = owner.compacted;
|
|
50
|
+
if (purpose === 'summary' && now) {
|
|
51
|
+
now.part = Math.min(now.part + 1, 999);
|
|
52
|
+
out['X-Agent-Compaction'] = `${now.id};${now.reason};${now.part}`;
|
|
53
|
+
}
|
|
54
|
+
if (purpose !== 'summary' && ended) {
|
|
55
|
+
owner.compacted = null;
|
|
56
|
+
out['X-Agent-Compacted'] = [ended.id, ended.reason, ended.outcome, count(ended.before), count(ended.after), count(ended.ms)].join(';');
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
40
59
|
}
|
|
41
60
|
|
|
42
61
|
// Pi folds the system prompt into a leading system message before a call
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
2
3
|
import { pathToFileURL } from 'node:url';
|
|
3
4
|
import { failureCode } from '../runtime/managed-failure.mjs';
|
|
4
5
|
import { currentPlan, unfinished, planText } from './workflow.mjs';
|
|
@@ -107,3 +108,25 @@ export async function stageCompaction(session, api, sdk) {
|
|
|
107
108
|
tokensBefore: preparation.tokensBefore, usage, details: { readFiles, modifiedFiles } });
|
|
108
109
|
};
|
|
109
110
|
}
|
|
111
|
+
|
|
112
|
+
// What a compaction did, for Studio's logs (Logs → "Lượt agent"): its summary
|
|
113
|
+
// calls name it (X-Agent-Compaction) and the main agent's next call says how
|
|
114
|
+
// it ended (X-Agent-Compacted, see compactionHeaders). Pi's own token counts
|
|
115
|
+
// only; no summary text leaves.
|
|
116
|
+
export function trackCompaction(owner, session, now = Date.now) {
|
|
117
|
+
const run = session._runDefaultCompaction?.bind(session);
|
|
118
|
+
if (!run) throw Error('managed-sdk-version-unqualified');
|
|
119
|
+
session._runDefaultCompaction = (preparation, ...rest) => {
|
|
120
|
+
if (owner.compaction) owner.compaction.before ??= preparation?.tokensBefore;
|
|
121
|
+
return run(preparation, ...rest);
|
|
122
|
+
};
|
|
123
|
+
session.subscribe(event => {
|
|
124
|
+
if (event?.type === 'compaction_start') owner.compaction = { id: randomUUID(), reason: event.reason, part: 0, at: now() };
|
|
125
|
+
else if (event?.type === 'compaction_end' && owner.compaction) {
|
|
126
|
+
const c = owner.compaction;
|
|
127
|
+
owner.compaction = null;
|
|
128
|
+
owner.compacted = { id: c.id, reason: c.reason, outcome: event.result ? 'done' : event.aborted ? 'aborted' : 'failed',
|
|
129
|
+
before: event.result?.tokensBefore ?? c.before, after: event.result?.estimatedTokensAfter, ms: now() - c.at };
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
@@ -8,8 +8,8 @@ export const memberQuestions: {
|
|
|
8
8
|
pulseMs: number;
|
|
9
9
|
bindSurface(sessionId: string, onEvent: (event: MemberQuestionEvent) => void): () => void;
|
|
10
10
|
hasSurface(sessionId: string): boolean;
|
|
11
|
-
ask(input: { sessionId: string; toolCallId: string; questions: MemberQuestion[]; signal?: AbortSignal }): Promise<MemberAnswer>;
|
|
12
|
-
pending(sessionId: string): Array<{ questionRef: string; askedAt: string; questions: MemberQuestion[] }>;
|
|
11
|
+
ask(input: { sessionId: string; toolCallId: string; questions: MemberQuestion[]; signal?: AbortSignal; role?: string }): Promise<MemberAnswer>;
|
|
12
|
+
pending(sessionId: string): Array<{ questionRef: string; askedAt: string; role: string; questions: MemberQuestion[] }>;
|
|
13
13
|
answer(sessionId: string, questionRef: string, raw: unknown): { questionRef: string; state: "answered" };
|
|
14
14
|
};
|
|
15
15
|
export function askTool(managed: unknown): unknown;
|
|
@@ -85,11 +85,13 @@ class MemberQuestions {
|
|
|
85
85
|
|
|
86
86
|
// Resolves with the normalized answer; rejects 'managed-question-cancelled'
|
|
87
87
|
// when the member stops the turn or the screen goes away.
|
|
88
|
-
|
|
88
|
+
// `role` is who asks: the main agent, or a subagent role (scout, research,
|
|
89
|
+
// verify, review); the screen answers the main agent's first.
|
|
90
|
+
ask({ sessionId, toolCallId, questions, signal, role = 'main' }) {
|
|
89
91
|
const key = String(sessionId), ref = `question.${crypto.randomUUID()}`;
|
|
90
92
|
return new Promise((resolve, reject) => {
|
|
91
93
|
if (signal?.aborted) return reject(Error('managed-question-cancelled'));
|
|
92
|
-
const entry = { ref, sessionId: key, toolCallId: String(toolCallId ?? ''), questions, askedAt: new Date().toISOString(), resolve, reject, signal };
|
|
94
|
+
const entry = { ref, sessionId: key, toolCallId: String(toolCallId ?? ''), role: String(role), questions, askedAt: new Date().toISOString(), resolve, reject, signal };
|
|
93
95
|
entry.onAbort = () => this.#settle(entry, null, 'stopped');
|
|
94
96
|
signal?.addEventListener('abort', entry.onAbort, { once: true });
|
|
95
97
|
entry.pulse = setInterval(() => this.#emit(key, { type: 'waiting', ref }), this.pulseMs);
|
|
@@ -108,7 +110,7 @@ class MemberQuestions {
|
|
|
108
110
|
pending(sessionId) {
|
|
109
111
|
const key = String(sessionId);
|
|
110
112
|
return [...this.#pending.values()].filter(e => e.sessionId === key)
|
|
111
|
-
.map(e => ({ questionRef: e.ref, askedAt: e.askedAt, questions: structuredClone(e.questions) }));
|
|
113
|
+
.map(e => ({ questionRef: e.ref, askedAt: e.askedAt, role: e.role, questions: structuredClone(e.questions) }));
|
|
112
114
|
}
|
|
113
115
|
answer(sessionId, questionRef, raw) {
|
|
114
116
|
const entry = REF.test(String(questionRef)) ? this.#pending.get(questionRef) : null;
|
|
@@ -17,7 +17,7 @@ import { enableCompanyTurnRetry, wrapRoleStreams } from './request-stream.mjs';
|
|
|
17
17
|
import { runHelper } from './helper-run.mjs';
|
|
18
18
|
import { askTool } from './member-questions.mjs';
|
|
19
19
|
import { setTimeout as sleep } from 'node:timers/promises';
|
|
20
|
-
import { stageCompaction, compactEarly, backOffFailedCompaction } from './compaction.mjs';
|
|
20
|
+
import { stageCompaction, compactEarly, backOffFailedCompaction, trackCompaction } from './compaction.mjs';
|
|
21
21
|
import { readPatchDigest, readPatchSnapshot, readChangedFiles, readHead } from './patch-snapshot.mjs';
|
|
22
22
|
import { memberTurn } from './continuation.mjs';
|
|
23
23
|
import { workflowPolicy, repositoryChecks, planTool, currentPlan, PLAN_ENTRY, workflowPrompt, RunProcess, completionGate, pendingBaseline, pendingPaths, pendingHead, processEditTools } from './workflow.mjs';
|
|
@@ -180,7 +180,7 @@ export class ManagedSession {
|
|
|
180
180
|
if (event?.type === 'tool_execution_end' && event.isError && textContent(event.result ?? {}) === `Tool ${event.toolName} not found`) self.run && (self.run.unknownTools += 1);
|
|
181
181
|
});
|
|
182
182
|
await stageCompaction(self.session, self.api, self.sdk);
|
|
183
|
-
compactEarly(settings); backOffFailedCompaction(self.session);
|
|
183
|
+
compactEarly(settings); backOffFailedCompaction(self.session); trackCompaction(self, self.session);
|
|
184
184
|
self.publishHelpers();
|
|
185
185
|
const setThinking=self.session.setThinkingLevel.bind(self.session);
|
|
186
186
|
self.runThinking = setThinking;
|