@piagent/platform 1.30.0 → 1.30.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +13 -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 +7 -0
  16. package/docs-site/content/index.html +4 -4
  17. package/docs-site/content/whats-new.html +7 -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 +8 -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 +8 -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 +1 -1
  56. package/package.json +1 -1
  57. package/packages/piagent-core/package.json +1 -1
  58. package/packages/piagent-webui/dist/client/assets/{MarkdownMessage-3vQTaeOO.js → MarkdownMessage-ZFXG_br8.js} +1 -1
  59. package/packages/piagent-webui/dist/client/assets/{index-Dve4GNQ7.js → index-B3ODBFGj.js} +3 -3
  60. package/packages/piagent-webui/dist/client/index.html +1 -1
  61. package/packages/piagent-webui/shared/company-copy.ts +1 -0
  62. package/scripts/company-terminal.mjs +21 -10
  63. package/scripts/piagent-studio.mjs +3 -1
@@ -7,7 +7,7 @@
7
7
  <meta name="csp-nonce" content="__PIAGENT_CSP_NONCE__" />
8
8
  <meta name="piagent-webui-mode" content="__PIAGENT_WEBUI_MODE__" />
9
9
  <title>Piagent WebUI</title>
10
- <script type="module" crossorigin src="/assets/index-Dve4GNQ7.js"></script>
10
+ <script type="module" crossorigin src="/assets/index-B3ODBFGj.js"></script>
11
11
  <link rel="stylesheet" crossorigin href="/assets/index-B5XOKQy-.css">
12
12
  </head>
13
13
  <body>
@@ -12,6 +12,7 @@ export const LAUNCH_REASONS: Record<string, [string, string]> = {
12
12
  "managed-key-unavailable": ["Agent Watch không đọc được key công ty trên máy này. Mở Agent Watch, dán lại mã kết nối, bấm Kết nối Piagent trong WSL rồi kết nối lại.", "Agent Watch cannot read the company key on this computer. Open Agent Watch, paste the connection code again, choose Connect Piagent in WSL, then connect again."],
13
13
  "managed-profile-disconnected": ["Cấu hình Piagent đang thuộc key công ty đã ngắt kết nối. Nhập lại cấu hình cho Piagent trong Agent Watch (trên Windows: Kết nối Piagent trong WSL).", "The Piagent configuration belongs to a disconnected company key. Import it again in Agent Watch (on Windows: Connect Piagent in WSL)."],
14
14
  "managed-launch-binding-changed": ["Agent Watch hoặc Piagent vừa cập nhật. Nhập lại cấu hình cho Piagent trong Agent Watch (trên Windows: Kết nối Piagent trong WSL).", "Agent Watch or Piagent changed. Import the Piagent configuration again in Agent Watch (on Windows: Connect Piagent in WSL)."],
15
+ "managed-project-contains-config": ["Không mở Piagent công ty ở thư mục này (thường là thư mục home ~) vì nó chứa cấu hình công ty. Vào thư mục dự án rồi chạy lại: cd ~/đường-dẫn-dự-án && piagent studio, hoặc piagent studio --project ~/đường-dẫn-dự-án.", "The company Piagent cannot open this folder (usually your home folder ~) because it holds the company configuration. Go to a project folder and run it again: cd ~/your-project && piagent studio, or piagent studio --project ~/your-project."],
15
16
  "managed-binding-update-pending": ["Agent Watch đang chạy nhưng chưa cập nhật cấu hình sau bản Piagent hoặc Agent Watch mới. Mở Agent Watch → Studio, bấm Áp dụng cho Piagent rồi mở lại.", "Agent Watch is running but has not updated the configuration after the Piagent or Agent Watch update yet. Open Agent Watch → Studio, apply for Piagent, then open it again."],
16
17
  "managed-binding-watch-not-running": ["Piagent hoặc Agent Watch vừa cập nhật nhưng Agent Watch không chạy nên chưa cập nhật cấu hình. Mở Agent Watch, chờ vài giây rồi mở lại.", "Piagent or Agent Watch was updated but Agent Watch is not running, so the configuration was not updated. Open Agent Watch, wait a few seconds, then open it again."],
17
18
  "managed-launch-version-mismatch": ["Agent Watch đang dùng một bản Piagent khác với dashboard này. Mở Agent Watch → Studio, bấm Áp dụng cho Piagent rồi kết nối lại.", "Agent Watch points at another Piagent install than this dashboard. Open Agent Watch → Studio, apply for Piagent, then connect again."],
@@ -73,15 +73,15 @@ const EFFORT = { off: 'Tắt', minimal: 'Tối thiểu', low: 'Thấp', medium:
73
73
  export const effortText = (level) => EFFORT[level] ?? level ?? '';
74
74
 
75
75
  // What the team's Harness decides for this conversation, as the header and
76
- // footer say it. `last` is the main agent's latest run (its model and
77
- // effort); before the first run, the Harness's first main model and its effort.
76
+ // footer say it: roles and effort only. A member never sees which model a
77
+ // role runs on, so no model id leaves this function. `last` is the main
78
+ // agent's latest run (its effort); before the first run, the Harness's effort.
78
79
  export function harnessSummary(managed, { last = null, version = null } = {}) {
79
80
  const manifest = managed?.manifest, config = manifest?.harness?.configuration ?? {};
80
- const review = config.workflow?.review !== 'off' && config.review?.model_ids?.[0] || null;
81
+ const review = config.workflow?.review !== 'off' && Boolean(config.review?.model_ids?.length);
81
82
  const fast = managed?.session?.managedFastState?.() ?? null;
82
83
  return {
83
84
  team: manifest?.user?.team_name || null,
84
- model: last?.model_id || config.main?.model_ids?.[0] || null,
85
85
  effort: last?.effort || config.main?.effort || managed?.session?.state?.thinkingLevel || null,
86
86
  review, permission: managed?.permission === 'trusted-full-access' ? 'Bypass' : 'Hỏi trước',
87
87
  fast: fast === null ? null : fast === 'on', memory: managed ? memoryOn(managed) : false, version,
@@ -89,8 +89,8 @@ export function harnessSummary(managed, { last = null, version = null } = {}) {
89
89
  }
90
90
  export function headerText(summary) {
91
91
  return ['Piagent công ty', summary.team && `team ${summary.team}`,
92
- summary.model && `main ${summary.model}${summary.effort ? ` (${effortText(summary.effort)})` : ''}`,
93
- summary.review && `review ${summary.review}`, summary.permission,
92
+ `Main agent${summary.effort ? ` (${effortText(summary.effort)})` : ''}`,
93
+ summary.review && 'Subagent review bật', summary.permission,
94
94
  summary.fast !== null && `Fast ${summary.fast ? 'bật' : 'tắt'}`, `memory ${summary.memory ? 'bật' : 'tắt'}`, summary.version].filter(Boolean).join(' · ');
95
95
  }
96
96
  export const HEADER_KEYS = 'Esc dừng lượt · Ctrl+C xoá ô nhập, hai lần để thoát · / lệnh · ! shell · Ctrl+O xem thêm · /help';
@@ -101,7 +101,7 @@ export const HEADER_KEYS = 'Esc dừng lượt · Ctrl+C xoá ô nhập, hai l
101
101
  // Ctrl+P, Shift+Tab) answer the same.
102
102
  const ADMIN = 'Admin đổi trong Agent Studio → Harness.';
103
103
  export function companyCommandText(name, summary = {}) {
104
- const main = summary.model ? ` (main ${summary.model}${summary.effort ? `, ${effortText(summary.effort)}` : ''})` : '';
104
+ const main = summary.effort ? ` (Main agent: ${effortText(summary.effort)})` : '';
105
105
  switch (name) {
106
106
  case 'share': return '/share bị tắt trong cuộc trò chuyện công ty: lệnh này đăng toàn bộ hội thoại lên GitHub Gist, ra ngoài công ty. Cần lưu lại thì dùng /export (file trên máy này).';
107
107
  case 'bug': return '/bug bị tắt trong cuộc trò chuyện công ty: báo cáo gửi hội thoại và code cho nhà phát triển Pi, ra ngoài công ty. Gặp lỗi, gửi admin của team mã lỗi trong [ ] và giờ xảy ra.';
@@ -168,7 +168,7 @@ export function failureLines(errorMessage) {
168
168
 
169
169
  const tokens = (n) => n < 1000 ? String(n) : n < 10000 ? `${(n / 1000).toFixed(1)}k` : n < 1e6 ? `${Math.round(n / 1000)}k` : `${(n / 1e6).toFixed(1)}M`;
170
170
  // Pi's footer without the USD cost (company accounts are not billed per
171
- // conversation) and with the Harness's main model and effort on the right.
171
+ // conversation) and with the main agent's effort on the right (never its model).
172
172
  export function footerLines({ session, summary, footerData, theme, width, truncateToWidth, visibleWidth }) {
173
173
  const dim = (text) => theme.fg('dim', text);
174
174
  if (!session) return [truncateToWidth(dim(headerText(summary)), width, dim('...'))];
@@ -188,7 +188,7 @@ export function footerLines({ session, summary, footerData, theme, width, trunca
188
188
  const parts = [sum.input && `↑${tokens(sum.input)}`, sum.output && `↓${tokens(sum.output)}`, sum.cacheRead && `R${tokens(sum.cacheRead)}`, sum.cacheWrite && `W${tokens(sum.cacheWrite)}`].filter(Boolean);
189
189
  const ctxText = `${shown === '?' ? '?' : shown + '%'}/${tokens(window)} (auto)`;
190
190
  let left = [...parts, ctxText].join(' ');
191
- const right = summary.model ? `main ${summary.model}${summary.effort ? ` • ${effortText(summary.effort)}` : ''}` : '';
191
+ const right = `Main agent${summary.effort ? ` • ${effortText(summary.effort)}` : ''}`;
192
192
  if (visibleWidth(left) > width) left = truncateToWidth(left, width, '...');
193
193
  const room = width - visibleWidth(left) - 2;
194
194
  const tail = room > 0 && right ? truncateToWidth(right, room, '') : '';
@@ -227,6 +227,15 @@ export async function companyInteractiveMode(api, { sdkRoot, packageRoot, summar
227
227
  const changelog = () => { try { return fs.readFileSync(path.join(packageRoot, 'CHANGELOG.md'), 'utf8'); } catch { return ''; } };
228
228
  return companyMode(api.InteractiveMode, { summary, whatsNew: () => whatsNewMarkdown(changelog()), components: { Markdown, Spacer, DynamicBorder: api.DynamicBorder } });
229
229
  }
230
+ // Pi's own warnings, as the company Terminal says them: the crash notice
231
+ // without /bug, and no model id ("Could not restore model p/id").
232
+ export function companyWarning(message) {
233
+ const text = String(message ?? '');
234
+ const crash = /^\S+ crashed on (.+?) \((.*)\)\. Run \/bug/s.exec(text);
235
+ if (crash) return `Lần trước Piagent công ty dừng bất thường (${crash[1]}, ${crash[2]}). Cuộc trò chuyện vẫn còn: /resume để mở lại. Nếu lặp lại, gửi admin của team giờ xảy ra.`;
236
+ if (/^Could not restore model /.test(text)) return 'Cuộc trò chuyện này chạy theo Harness hiện tại của team.';
237
+ return text;
238
+ }
230
239
  export function companyMode(Base, { summary, whatsNew, components }) {
231
240
  const say = (mode, name, tone = 'warning') => mode.showExtensionNotify(companyCommandText(name, summary()), tone);
232
241
  return class CompanyInteractiveMode extends Base {
@@ -234,6 +243,8 @@ export function companyMode(Base, { summary, whatsNew, components }) {
234
243
  async handleBugCommand() { say(this, 'bug'); }
235
244
  suggestBugReport() {}
236
245
  crashReportInstructions() { return 'Lần sau mở lại: piagent studio, rồi /resume. Gửi admin của team giờ xảy ra lỗi.'; }
246
+ // Pi's start-up warnings point at /bug (off here) or name a model.
247
+ showWarning(message) { super.showWarning(companyWarning(message)); }
237
248
  async handleLoginCommand() { say(this, 'login', 'info'); }
238
249
  async showOAuthSelector() { say(this, 'logout', 'info'); }
239
250
  async handleModelCommand() { say(this, 'model', 'info'); }
@@ -337,7 +348,7 @@ export function companyTerminalExtension({ managed, packageRoot, sdkRoot, bindin
337
348
  let last = null;
338
349
  const summary = () => {
339
350
  const grant = managed()?.grant;
340
- if (grant?.model_id) last = { model_id: grant.model_id, effort: grant.effort };
351
+ if (grant?.effort) last = { effort: grant.effort };
341
352
  return harnessSummary(managed(), { last, version: installed });
342
353
  };
343
354
  pi.on('session_start', async (_event, ctx) => {
@@ -83,7 +83,9 @@ try {
83
83
  }
84
84
  const agentDir = path.join(root, store);
85
85
  const cwd = serve ? path.join(agentDir, 'probe') : fs.realpathSync(flags.get('--project') || process.cwd());
86
- if (configPath.startsWith(cwd + path.sep)) throw Error('managed-launch-binding-changed');
86
+ // A project folder that holds the company configuration (the home folder,
87
+ // ~/.pi) would put it in reach of the project's tools: refuse, and say so.
88
+ if (configPath.startsWith(cwd + path.sep)) throw Error('managed-project-contains-config');
87
89
  fs.mkdirSync(agentDir, { recursive: true, mode: 0o700 }); fs.chmodSync(agentDir, 0o700);
88
90
  if (serve) { fs.mkdirSync(cwd, { recursive: true, mode: 0o700 }); fs.chmodSync(cwd, 0o700); }
89
91
  await import('./register-typescript-loader.mjs');