@piagent/platform 1.39.0 → 1.40.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.
Files changed (74) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +1 -1
  3. package/README.vi.md +1 -1
  4. package/docs/command-reference-vietnamese.md +2 -2
  5. package/docs/distribution-standard.md +6 -6
  6. package/docs/languages.json +2 -2
  7. package/docs/operator-manual-vietnamese.md +7 -7
  8. package/docs/publishing-for-teams.md +1 -0
  9. package/docs/release-install-policy.md +2 -2
  10. package/docs/team-onboarding.md +2 -2
  11. package/docs-site/architecture.html +1 -1
  12. package/docs-site/benchmark.html +1 -1
  13. package/docs-site/commands.html +1 -1
  14. package/docs-site/content/en/index.html +4 -4
  15. package/docs-site/content/en/whats-new.html +6 -0
  16. package/docs-site/content/index.html +4 -4
  17. package/docs-site/content/whats-new.html +6 -0
  18. package/docs-site/context-engine.html +1 -1
  19. package/docs-site/ecosystem.html +1 -1
  20. package/docs-site/en/architecture.html +1 -1
  21. package/docs-site/en/benchmark.html +1 -1
  22. package/docs-site/en/commands.html +1 -1
  23. package/docs-site/en/context-engine.html +1 -1
  24. package/docs-site/en/ecosystem.html +1 -1
  25. package/docs-site/en/index.html +5 -5
  26. package/docs-site/en/mcp-approval.html +1 -1
  27. package/docs-site/en/mcp-auth.html +1 -1
  28. package/docs-site/en/mcp-servers.html +1 -1
  29. package/docs-site/en/mcp.html +1 -1
  30. package/docs-site/en/permissions.html +1 -1
  31. package/docs-site/en/profiles.html +1 -1
  32. package/docs-site/en/quickstart.html +1 -1
  33. package/docs-site/en/runtime.html +1 -1
  34. package/docs-site/en/scope.html +1 -1
  35. package/docs-site/en/security.html +1 -1
  36. package/docs-site/en/team.html +1 -1
  37. package/docs-site/en/whats-new.html +7 -1
  38. package/docs-site/en/windows.html +1 -1
  39. package/docs-site/en/workflows.html +1 -1
  40. package/docs-site/index.html +5 -5
  41. package/docs-site/mcp-approval.html +1 -1
  42. package/docs-site/mcp-auth.html +1 -1
  43. package/docs-site/mcp-servers.html +1 -1
  44. package/docs-site/mcp.html +1 -1
  45. package/docs-site/permissions.html +1 -1
  46. package/docs-site/profiles.html +1 -1
  47. package/docs-site/quickstart.html +1 -1
  48. package/docs-site/runtime.html +1 -1
  49. package/docs-site/scope.html +1 -1
  50. package/docs-site/security.html +1 -1
  51. package/docs-site/team.html +1 -1
  52. package/docs-site/whats-new.html +7 -1
  53. package/docs-site/windows.html +1 -1
  54. package/docs-site/workflows.html +1 -1
  55. package/evals/private-holdout-v1/public-exposure.v2.json +2 -2
  56. package/package.json +1 -1
  57. package/packages/piagent-core/managed/request-stream.mjs +2 -2
  58. package/packages/piagent-core/managed/workspace-projects.mjs +61 -0
  59. package/packages/piagent-core/managed/workspace-report.mjs +39 -18
  60. package/packages/piagent-core/package.json +1 -1
  61. package/packages/piagent-webui/dist/client/assets/{MarkdownMessage-CMZESBjK.js → MarkdownMessage-BpoF2k2-.js} +1 -1
  62. package/packages/piagent-webui/dist/client/assets/{TerminalPanel-DlcfsRaR.js → TerminalPanel-Dg3eghy4.js} +2 -2
  63. package/packages/piagent-webui/dist/client/assets/{TerminalView-B83HGKgY.js → TerminalView-Dw9xqakv.js} +1 -1
  64. package/packages/piagent-webui/dist/client/assets/{WorkspaceCodeEditor-Ctf0VMQh.js → WorkspaceCodeEditor-DtwXZAgK.js} +1 -1
  65. package/packages/piagent-webui/dist/client/assets/{WorkspaceExplorer-fO2uXHZg.js → WorkspaceExplorer-WS-yLlnb.js} +3 -3
  66. package/packages/piagent-webui/dist/client/assets/{WorkspaceQuickOpen-ClaXnKl1.js → WorkspaceQuickOpen-CYCY-s44.js} +1 -1
  67. package/packages/piagent-webui/dist/client/assets/{index-BeBiJUDV.js → index-BgJgso6j.js} +18 -18
  68. package/packages/piagent-webui/dist/client/assets/{tab-close-ggR0dHlZ.js → tab-close-CqPDs-w5.js} +1 -1
  69. package/packages/piagent-webui/dist/client/index.html +1 -1
  70. package/packages/piagent-webui/gateway/managed-projection.ts +4 -3
  71. package/packages/piagent-webui/shared/project-warning-copy.ts +15 -10
  72. package/schemas/piagent-webui/session-catalog-v1.schema.json +1 -1
  73. package/scripts/check-runtime-advisories.mjs +28 -3
  74. package/scripts/runtime-advisory-exceptions.json +26 -1
@@ -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.39.0 docs · EN</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.0 docs · EN</span>
34
34
  <nav class="language-switch" aria-label="Language">
35
35
  <a class="language-option" href="/scope" hreflang="vi" lang="vi">VI</a>
36
36
  <a class="language-option current" href="/en/scope" 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.39.0 docs · EN</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.0 docs · EN</span>
34
34
  <nav class="language-switch" aria-label="Language">
35
35
  <a class="language-option" href="/security" hreflang="vi" lang="vi">VI</a>
36
36
  <a class="language-option current" href="/en/security" 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.39.0 docs · EN</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.0 docs · EN</span>
34
34
  <nav class="language-switch" aria-label="Language">
35
35
  <a class="language-option" href="/team" hreflang="vi" lang="vi">VI</a>
36
36
  <a class="language-option current" href="/en/team" 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.39.0 docs · EN</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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,12 @@
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.40.0 · 2026-10-24</p>
109
+ <h2 id="v1-40-0">Local projects are reported to Studio too</h2>
110
+ <p class="section-lead">A folder without a readable remote is now reported to Studio as a local project (Agent Studio 0.40.0, <code>managed.workspace.v2</code>): a git checkout by its root commit (<code>local/git/…</code>, the same on every computer with that history, clones included), any other folder by a hash of the computer's name and path (<code>local/dir/…</code>), with the folder's name; a path never leaves the computer. Every agent run reports, so Studio knows which computers never do. The member reads one line for every kind of warning: another team's project, one outside the list, one not registered to the team, or a folder that could not be read. Nothing is blocked.</p>
111
+ </section>
112
+
107
113
  <section class="section">
108
114
  <p class="section-kicker">v1.39.0 · 2026-10-23</p>
109
115
  <h2 id="v1-39-0">Warnings when a key works in the wrong project</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.39.0 docs · EN</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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.39.0 docs · EN</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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>
@@ -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.39.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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.39.0</p>
97
+ <p class="eyebrow">Piagent 1.40.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.39.0</a>
111
+ <a class="button" href="/whats-new">Có gì mới trong 1.40.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.39.0</span>
187
+ <span class="card-kicker">Bản 1.40.0</span>
188
188
  <h3>Có gì mới</h3>
189
- <p>Cảnh báo key dùng sai project (Studio 0.39.0), dashboard giữ ngôn ngữ và theme sau khi khởi động lại; ở 1.38.2: cây thư mục như VS Code, theme màu (Dracula, Nord…), editor và terminal đứng yên khi cuộn; ở 1.38.1: dashboard thành editor: sửa file, terminal, review hunk, khôi phục lượt; Bypass không hỏi gì, cả cuộc trò chuyện công ty khi Harness bật; ở 1.37.1: run Studio chưa xác nhận đóng không còn bị ghi là đã đóng, helper đóng lỗi vẫn giữ câu trả lời, bài học team memory ghi đúng lệnh; ở 1.37.0: câu trả lời bị cắt giữa chừng không còn làm dừng task dài, có <code>piagent studio --rpc</code>; ở 1.36.1: Agent Watch mất kết nối tới Studio trong chốc lát không còn làm dừng task; ở 1.36.0: team memory học từ chỗ làm sai: Studio chấm những gì memory đã đưa, lệnh lỗi lặp lại thành bài học; ở 1.35: task dài không dừng khi Studio cập nhật hay model báo lỗi tạm thời; ở 1.34: helper báo kết quả, Agent Watch báo khi cần bạn; ở 1.33.0: chạy trên Pi 1.3.0; ở 1.32.1: Bypass được giữ sau khi tải lại, tab đang dùng không còn bị đăng xuất sau 8 giờ; ở 1.32.0: lượt lỗi hoặc bấm Stop được dừng cả ở Studio; ở 1.31.1: <code>memory_ask</code> có ngay sau khi cập nhật; ở 1.31.0: Memory của team đi theo branch và luật của team, có <code>memory_ask</code>; ở 1.30.1: Terminal công ty không còn hiện tên model, mở <code>piagent studio</code> ở thư mục home báo rõ cần vào thư mục dự án; ở 1.30.0: context lớn đi qua mạng chậm, Terminal công ty gọn như dashboard; ở 1.29.0: Terminal công ty có giao diện riêng, dừng lượt không còn làm hỏng cuộc trò chuyện; ở 1.28.3: Agent Watch tự cập nhật không còn làm gián đoạn Terminal công ty; ở 1.28.2: không còn lỗi “binding changed” ngay sau khi cập nhật; ở 1.28.1: Terminal công ty và Pi cá nhân không còn giẫm chân nhau (không nạp Piagent hai lần, dọn cấu hình công ty cũ, cuộc trò chuyện công ty chỉ mở bằng piagent studio); ở 1.28.0: team memory v2; ở 1.27.1: team memory chạy ổn cả khi agent đang gọi model; ở 1.27.0: team memory, agent công ty nhớ quyết định và quy tắc của team trong từng repo; ở 1.26.1: đổi tên cuộc trò chuyện được cả khi lượt đang chạy; ở 1.26.0: lệnh / và phím tắt của Terminal ngay trên dashboard, /undo hoàn tác lượt trước của agent, dev server chạy qua nhiều lượt; ở 1.25.0: thiếu môi trường thì agent xin quyền và chạy được sau khi bạn duyệt (run_on_host ngoài sandbox, start_docker mở Docker ngay trong cuộc trò chuyện); ở 1.24.0: chọn Fast ngay trên trang tạo cuộc trò chuyện công ty, nút Fast đổi màu vàng khi đang bật; ở 1.23.1: câu hỏi của agent luôn nằm cuối cuộc trò chuyện, ngay trên ô nhập, và dễ đọc hơn; ở 1.23.0: nút Fast cho cuộc trò chuyện công ty khi Harness cho phép, tool lỗi được báo về Studio (Logs → Tool lỗi), cuộc trò chuyện mới gửi được tin nhắn đầu sau khi Harness đổi; ở 1.22.1: dashboard không còn quay mãi khi project nằm trên ổ Windows nhìn từ WSL (/mnt/d…) hoặc phiên công ty không trả lời; ở 1.22.0: đính kèm được mọi file code và văn bản (.html, .css, .ts, .py, Dockerfile…); ở 1.21.1: bật Bypass được cả khi lượt đang chạy và được giữ sau khi tải lại; ở 1.21.0: 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>
189
+ <p>Project local không có remote cũng được báo cho Studio, member thấy mọi loại cảnh báo sai project (Studio 0.40.0); ở 1.39.0: cảnh báo key dùng sai project (Studio 0.39.0), dashboard giữ ngôn ngữ và theme sau khi khởi động lại; ở 1.38.2: cây thư mục như VS Code, theme màu (Dracula, Nord…), editor và terminal đứng yên khi cuộn; ở 1.38.1: dashboard thành editor: sửa file, terminal, review hunk, khôi phục lượt; Bypass không hỏi gì, cả cuộc trò chuyện công ty khi Harness bật; ở 1.37.1: run Studio chưa xác nhận đóng không còn bị ghi là đã đóng, helper đóng lỗi vẫn giữ câu trả lời, bài học team memory ghi đúng lệnh; ở 1.37.0: câu trả lời bị cắt giữa chừng không còn làm dừng task dài, có <code>piagent studio --rpc</code>; ở 1.36.1: Agent Watch mất kết nối tới Studio trong chốc lát không còn làm dừng task; ở 1.36.0: team memory học từ chỗ làm sai: Studio chấm những gì memory đã đưa, lệnh lỗi lặp lại thành bài học; ở 1.35: task dài không dừng khi Studio cập nhật hay model báo lỗi tạm thời; ở 1.34: helper báo kết quả, Agent Watch báo khi cần bạn; ở 1.33.0: chạy trên Pi 1.3.0; ở 1.32.1: Bypass được giữ sau khi tải lại, tab đang dùng không còn bị đăng xuất sau 8 giờ; ở 1.32.0: lượt lỗi hoặc bấm Stop được dừng cả ở Studio; ở 1.31.1: <code>memory_ask</code> có ngay sau khi cập nhật; ở 1.31.0: Memory của team đi theo branch và luật của team, có <code>memory_ask</code>; ở 1.30.1: Terminal công ty không còn hiện tên model, mở <code>piagent studio</code> ở thư mục home báo rõ cần vào thư mục dự án; ở 1.30.0: context lớn đi qua mạng chậm, Terminal công ty gọn như dashboard; ở 1.29.0: Terminal công ty có giao diện riêng, dừng lượt không còn làm hỏng cuộc trò chuyện; ở 1.28.3: Agent Watch tự cập nhật không còn làm gián đoạn Terminal công ty; ở 1.28.2: không còn lỗi “binding changed” ngay sau khi cập nhật; ở 1.28.1: Terminal công ty và Pi cá nhân không còn giẫm chân nhau (không nạp Piagent hai lần, dọn cấu hình công ty cũ, cuộc trò chuyện công ty chỉ mở bằng piagent studio); ở 1.28.0: team memory v2; ở 1.27.1: team memory chạy ổn cả khi agent đang gọi model; ở 1.27.0: team memory, agent công ty nhớ quyết định và quy tắc của team trong từng repo; ở 1.26.1: đổi tên cuộc trò chuyện được cả khi lượt đang chạy; ở 1.26.0: lệnh / và phím tắt của Terminal ngay trên dashboard, /undo hoàn tác lượt trước của agent, dev server chạy qua nhiều lượt; ở 1.25.0: thiếu môi trường thì agent xin quyền và chạy được sau khi bạn duyệt (run_on_host ngoài sandbox, start_docker mở Docker ngay trong cuộc trò chuyện); ở 1.24.0: chọn Fast ngay trên trang tạo cuộc trò chuyện công ty, nút Fast đổi màu vàng khi đang bật; ở 1.23.1: câu hỏi của agent luôn nằm cuối cuộc trò chuyện, ngay trên ô nhập, và dễ đọc hơn; ở 1.23.0: nút Fast cho cuộc trò chuyện công ty khi Harness cho phép, tool lỗi được báo về Studio (Logs → Tool lỗi), cuộc trò chuyện mới gửi được tin nhắn đầu sau khi Harness đổi; ở 1.22.1: dashboard không còn quay mãi khi project nằm trên ổ Windows nhìn từ WSL (/mnt/d…) hoặc phiên công ty không trả lời; ở 1.22.0: đính kèm được mọi file code và văn bản (.html, .css, .ts, .py, Dockerfile…); ở 1.21.1: bật Bypass được cả khi lượt đang chạy và được giữ sau khi tải lại; ở 1.21.0: 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.39.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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>
@@ -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.39.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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.39.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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>
@@ -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.39.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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.39.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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>
@@ -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.39.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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.39.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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>
@@ -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.39.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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>
@@ -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.39.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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>
@@ -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.39.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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>
@@ -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.39.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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>
@@ -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.39.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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,12 @@
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.40.0 · 2026-10-24</p>
109
+ <h2 id="v1-40-0">Project local cũng được báo cho Studio</h2>
110
+ <p class="section-lead">Thư mục không có remote đọc được nay cũng được báo cho Studio như một project local (Agent Studio 0.40.0, <code>managed.workspace.v2</code>): repo git theo commit gốc (<code>local/git/…</code>, giống nhau trên mọi máy có cùng lịch sử, kể cả bản clone), thư mục khác theo mã băm của tên máy và đường dẫn (<code>local/dir/…</code>), kèm tên thư mục; đường dẫn không rời khỏi máy. Mỗi lượt agent đều báo, nên Studio biết máy nào chưa báo. Member thấy một dòng cho mọi loại cảnh báo: project của team khác, ngoài danh sách, chưa đăng ký cho team, hoặc thư mục không đọc được. Không chặn gì.</p>
111
+ </section>
112
+
107
113
  <section class="section">
108
114
  <p class="section-kicker">v1.39.0 · 2026-10-23</p>
109
115
  <h2 id="v1-39-0">Cảnh báo key dùng sai project</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.39.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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>
@@ -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.39.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.40.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": 621,
260
- "sha256": "ce5a8cb88f49168ab6b4740038fb30da6fdf7f485f4dd2f3f82cd168cd135abc"
259
+ "fileCount": 622,
260
+ "sha256": "129f4a1168fef5a3b5a0cae16d338d1135ab8579cf71d5777f619a550def2846"
261
261
  }
262
262
  ],
263
263
  "custodianComparisonRules": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@piagent/platform",
3
- "version": "1.39.0",
3
+ "version": "1.40.0",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -82,8 +82,8 @@ export function wrapRoleStreams(owner, runtime, role, { provider, verifyGrant })
82
82
  if (role === 'main') owner.grant = grant;
83
83
  // Tool calls that failed since the last request (tool-failures.mjs).
84
84
  void sendToolFailures(owner, grant.token);
85
- // Which repositories this conversation works in, once (workspace-report.mjs).
86
- if (role === 'main') void reportWorkspace(owner, grant.token);
85
+ // Which projects this conversation works in, once per run (workspace-report.mjs).
86
+ if (role === 'main') void reportWorkspace(owner, grant.token, { run: grant.run_id ?? null });
87
87
  void link?.flush(grant.token);
88
88
  const route = owner.routes.get(runtime);
89
89
  if (!route || grant.provider_model_id !== route.native || grant.provider !== route.provider || grant.model_id !== route.model_id || model.id !== 'agent-watch-auto') throw Error('managed-route-changed');
@@ -0,0 +1,61 @@
1
+ // The projects a company conversation works in, for Studio's project warnings
2
+ // (workspace-report.mjs, managed.workspace.v2). A folder with a readable
3
+ // remote is its repository (memory's repo key). A git checkout without one
4
+ // (no remote, several remotes but no origin, a remote repoKey cannot read)
5
+ // is local/git/<root commit>, the same on every computer holding that
6
+ // history; a checkout without commits and any other folder is
7
+ // local/dir/<hash of the computer's name and the path>, one computer only.
8
+ // Each comes with its folder's name; a path never leaves the computer.
9
+ import fs from 'node:fs';
10
+ import os from 'node:os';
11
+ import path from 'node:path';
12
+ import { createHash } from 'node:crypto';
13
+ import { git, repositoryAt } from './memory-repos.mjs';
14
+
15
+ // As memory: the folder's own project, or at most MAX_PROJECTS one level down.
16
+ const MAX_PROJECTS = 6;
17
+
18
+ // The oldest commit of the history; with several roots (merged histories)
19
+ // the smallest, so every computer picks the same one.
20
+ export async function rootCommit(dir, signal) {
21
+ const out = await git(dir, ['rev-list', '--max-parents=0', 'HEAD'], 5_000, signal);
22
+ return out?.split('\n').map(line => line.trim()).filter(line => /^[0-9a-f]{40}$/.test(line)).sort()[0] ?? null;
23
+ }
24
+
25
+ export function folderKey(dir, host = os.hostname()) {
26
+ let real = path.resolve(dir);
27
+ try { real = fs.realpathSync(dir); } catch { /* a folder that went away keeps its spelling */ }
28
+ return `local/dir/${createHash('sha256').update(`piagent-local-dir\0${host}\0${real}`).digest('hex').slice(0, 24)}`;
29
+ }
30
+
31
+ // The folder's last name as Studio records it (internal/projects CleanName).
32
+ export const folderName = dir => path.basename(path.resolve(dir)).replace(/\s+/g, ' ').replace(/[\u0000-\u001f\u007f-\u009f/\\]/g, '').trim().slice(0, 80) || null;
33
+
34
+ // The project at dir, or null when dir is not inside a git checkout.
35
+ async function projectAt(dir, signal, host) {
36
+ const repository = await repositoryAt(dir, '', signal);
37
+ if (repository.key) return { key: repository.key, name: folderName(repository.dir) };
38
+ if (repository.reason === 'not_a_repository') return null;
39
+ const top = (await git(dir, ['rev-parse', '--show-toplevel'], 3_000, signal))?.trim() || dir;
40
+ const root = await rootCommit(top, signal);
41
+ return { key: root ? `local/git/${root}` : folderKey(top, host), name: folderName(top) };
42
+ }
43
+
44
+ // Every project in cwd: its own, or else the checkouts one level down, or
45
+ // else cwd itself as a local folder. Empty only when cwd cannot be read.
46
+ export async function findProjects(cwd, { signal, host } = {}) {
47
+ const own = await projectAt(cwd, signal, host);
48
+ if (own) return [own];
49
+ let names;
50
+ try {
51
+ names = fs.readdirSync(cwd, { withFileTypes: true }).filter(e => e.isDirectory() && !e.name.startsWith('.') && e.name !== 'node_modules')
52
+ .map(e => e.name).filter(n => fs.existsSync(path.join(cwd, n, '.git'))).sort().slice(0, 40);
53
+ } catch { return []; }
54
+ const projects = [], seen = new Set();
55
+ for (const name of names) {
56
+ if (projects.length >= MAX_PROJECTS) break;
57
+ const project = await projectAt(path.join(cwd, name), signal, host);
58
+ if (project && !seen.has(project.key)) { seen.add(project.key); projects.push(project); }
59
+ }
60
+ return projects.length ? projects : [{ key: folderKey(cwd, host), name: folderName(cwd) }];
61
+ }
@@ -1,36 +1,57 @@
1
1
  import { CLIENT_AGENT } from './client-agent.mjs';
2
2
  import { findRepositories } from './memory-repos.mjs';
3
+ import { findProjects, folderName } from './workspace-projects.mjs';
3
4
  import { hasCapability } from './studio-capabilities.mjs';
4
5
 
5
- // Tells Studio which repositories a company conversation works in, once per
6
- // conversation, with the run's token (POST /studio/v1/managed/workspace).
7
- // Studio warns its administrators when a repository does not belong to the
8
- // key's team (Logs → "Sai project"); the member sees one line in the
9
- // dashboard and in piagent studio (agent-watch-project). Repositories are
10
- // sent as memory already sends them (host/path of the remote, never a local
11
- // path), only to a Studio that serves it (managed.workspace.v1). Nothing
12
- // here can fail a turn.
6
+ // Tells Studio which projects a company conversation works in, once per run
7
+ // (a run is one turn), with the run's token (POST /studio/v1/managed/workspace).
8
+ // Studio warns its administrators when a project does not belong to the key's
9
+ // team (Logs → "Sai project"), and lists a key and computer whose runs never
10
+ // report; the member sees one line in the dashboard and in piagent studio
11
+ // (agent-watch-project). Repositories are sent as memory sends them
12
+ // (host/path of the remote). A Studio with managed.workspace.v2 also gets
13
+ // folders without a readable remote as local projects (workspace-projects.mjs)
14
+ // with their folder names; a path never leaves the computer. Nothing here can
15
+ // fail a turn.
13
16
  export const PROJECT_ENTRY = 'agent-watch-project';
14
- const SHOWN = new Set(['other_team', 'unlisted']), ATTEMPTS = 3;
17
+ const KINDS = new Set(['other_team', 'unlisted', 'unregistered', 'no_repository']), V1_SHOWN = new Set(['other_team', 'unlisted']), ATTEMPTS = 3;
15
18
 
16
- export function reportWorkspace(owner, token, { fetchImpl = fetch, find = findRepositories, now = Date.now } = {}) {
17
- const state = owner.workspaceReport ??= { done: false, sending: null, attempts: 0 };
18
- if (state.done || state.sending || !token || !owner.cwd || !owner.origin || !hasCapability(owner, 'managed.workspace.v1')) return null;
19
+ export function reportWorkspace(owner, token, { run = null, fetchImpl = fetch, find = findRepositories, projects = findProjects, now = Date.now } = {}) {
20
+ if (!token || !owner.cwd || !owner.origin || owner.workspaceUnsupported || !hasCapability(owner, 'managed.workspace.v1')) return null;
21
+ // A new run reports again; a run reports once.
22
+ if (owner.workspaceReport && owner.workspaceReport.run !== run && !owner.workspaceReport.sending) owner.workspaceReport = null;
23
+ const state = owner.workspaceReport ??= { run, done: false, sending: null, attempts: 0 };
24
+ if (state.done || state.sending) return null;
19
25
  const retry = () => { if ((state.attempts += 1) >= ATTEMPTS) state.done = true; };
26
+ const v2 = hasCapability(owner, 'managed.workspace.v2');
20
27
  state.sending = (async () => {
21
28
  try {
22
- const { repos, folder } = await find(owner.cwd);
23
- const body = repos.length ? { repositories: repos.map(repo => repo.key) } : { repositories: [], ...(folder ? { folder } : {}) };
29
+ let body, names = new Map();
30
+ if (v2) {
31
+ const found = await projects(owner.cwd);
32
+ for (const project of found) if (project.name) names.set(project.key, project.name);
33
+ body = found.length ? { repositories: found.map(project => project.key), ...(names.size ? { names: Object.fromEntries(names) } : {}) }
34
+ : { repositories: [], folder: 'not_a_repository' };
35
+ } else {
36
+ const { repos, folder } = await find(owner.cwd);
37
+ body = repos.length ? { repositories: repos.map(repo => repo.key) } : { repositories: [], ...(folder ? { folder } : {}) };
38
+ }
24
39
  const response = await fetchImpl(`${owner.origin}/studio/v1/managed/workspace`, { method: 'POST', signal: AbortSignal.timeout(10_000),
25
40
  headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json', 'User-Agent': CLIENT_AGENT }, body: JSON.stringify(body) });
26
- // A Studio without the route, or one refusing the body, would answer the same again.
27
- if (response.status === 400 || response.status === 404 || response.status === 405) { state.done = true; return; }
41
+ // A Studio without the route, or one refusing the body, would answer the
42
+ // same again, on this run and the next ones.
43
+ if (response.status === 400 || response.status === 404 || response.status === 405) { state.done = true; owner.workspaceUnsupported = true; return; }
28
44
  if (!response.ok) { retry(); return; }
29
45
  state.done = true;
30
46
  const answer = await response.json().catch(() => null);
47
+ const shown = v2 ? KINDS : V1_SHOWN, here = folderName(owner.cwd) ?? owner.cwd;
31
48
  const warnings = (Array.isArray(answer?.warnings) ? answer.warnings : [])
32
- .filter(warning => SHOWN.has(warning?.kind) && typeof warning.repo_key === 'string' && warning.repo_key)
33
- .slice(0, 6).map(warning => ({ repo: warning.repo_key.slice(0, 200), kind: warning.kind }));
49
+ .filter(warning => shown.has(warning?.kind) && (warning.kind === 'no_repository' || (typeof warning.repo_key === 'string' && warning.repo_key)))
50
+ .slice(0, 6).map(warning => {
51
+ const repo = warning.kind === 'no_repository' ? here : warning.repo_key;
52
+ const name = typeof warning.project_name === 'string' && warning.project_name.trim() ? warning.project_name.trim() : names.get(repo);
53
+ return { repo: repo.slice(0, 200), kind: warning.kind, ...(name && name !== repo ? { name: name.slice(0, 80) } : {}) };
54
+ });
34
55
  const team = typeof answer?.team === 'string' ? answer.team.slice(0, 80) : null;
35
56
  recordProjectWarnings(owner.session?.sessionManager, warnings, team, now);
36
57
  if (warnings.length) owner.notify?.({ type: 'managed_project_warning', warnings, team });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@piagent/core",
3
- "version": "1.39.0",
3
+ "version": "1.40.0",
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "license": "MIT",