@piagent/platform 1.46.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.
Files changed (72) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/docs/command-reference-vietnamese.md +2 -2
  3. package/docs/distribution-standard.md +6 -6
  4. package/docs/en/architecture.md +1 -1
  5. package/docs/harness-conformance.md +22 -5
  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/vi/architecture.md +1 -1
  12. package/docs-site/architecture.html +1 -1
  13. package/docs-site/assets/search-en.json +1 -1
  14. package/docs-site/assets/search-vi.json +1 -1
  15. package/docs-site/benchmark.html +1 -1
  16. package/docs-site/commands.html +1 -1
  17. package/docs-site/context-engine.html +1 -1
  18. package/docs-site/ecosystem.html +1 -1
  19. package/docs-site/en/architecture.html +1 -1
  20. package/docs-site/en/benchmark.html +1 -1
  21. package/docs-site/en/commands.html +1 -1
  22. package/docs-site/en/context-engine.html +1 -1
  23. package/docs-site/en/ecosystem.html +1 -1
  24. package/docs-site/en/index.html +9 -9
  25. package/docs-site/en/mcp-approval.html +1 -1
  26. package/docs-site/en/mcp-auth.html +1 -1
  27. package/docs-site/en/mcp-servers.html +1 -1
  28. package/docs-site/en/mcp.html +1 -1
  29. package/docs-site/en/permissions.html +1 -1
  30. package/docs-site/en/profiles.html +1 -1
  31. package/docs-site/en/quickstart.html +1 -1
  32. package/docs-site/en/runtime.html +1 -1
  33. package/docs-site/en/scope.html +1 -1
  34. package/docs-site/en/security.html +1 -1
  35. package/docs-site/en/team.html +1 -1
  36. package/docs-site/en/update.html +3 -3
  37. package/docs-site/en/whats-new.html +27 -13
  38. package/docs-site/en/windows.html +1 -1
  39. package/docs-site/en/workflows.html +1 -1
  40. package/docs-site/index.html +9 -9
  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/releases.json +44 -0
  49. package/docs-site/runtime.html +1 -1
  50. package/docs-site/scope.html +1 -1
  51. package/docs-site/security.html +1 -1
  52. package/docs-site/team.html +1 -1
  53. package/docs-site/update.html +3 -3
  54. package/docs-site/whats-new.html +27 -13
  55. package/docs-site/windows.html +1 -1
  56. package/docs-site/workflows.html +1 -1
  57. package/evals/private-holdout-v1/public-exposure.v2.json +2 -2
  58. package/package.json +1 -1
  59. package/packages/piagent-core/managed/copies.mjs +61 -0
  60. package/packages/piagent-core/managed/grant-share.mjs +9 -1
  61. package/packages/piagent-core/managed/helper-roles.mjs +5 -3
  62. package/packages/piagent-core/managed/helper-run.mjs +120 -52
  63. package/packages/piagent-core/managed/helper-settlement.mjs +5 -1
  64. package/packages/piagent-core/managed/ledger.mjs +187 -0
  65. package/packages/piagent-core/managed/objections.mjs +49 -27
  66. package/packages/piagent-core/managed/patch-snapshot.mjs +9 -0
  67. package/packages/piagent-core/managed/session.mjs +14 -14
  68. package/packages/piagent-core/managed/toolchain.mjs +7 -3
  69. package/packages/piagent-core/managed/workflow.mjs +32 -26
  70. package/packages/piagent-core/package.json +1 -1
  71. package/packages/piagent-core/runtime/managed-failure.mjs +8 -0
  72. package/scripts/company-terminal.mjs +19 -1
@@ -89,6 +89,14 @@ const CODES = {
89
89
  'managed-helper-not-configured': ['tool', 'the company Harness does not enable this subagent'],
90
90
  'managed-helper-limit': ['tool', 'this subagent already ran 8 times for this message'],
91
91
  'managed-helper-disputed': ['tool', 'this subagent objected to the brief twice for this message; the member decides'],
92
+ 'managed-objection-open': ['tool', 'a helper objected that the brief rests on a wrong premise; decide it with resolve_objection first'],
93
+ 'managed-objection-unknown': ['tool', 'no such objection in this message'],
94
+ 'managed-objection-settled': ['tool', 'this objection is already decided'],
95
+ 'managed-objection-invalid': ['tool', 'a decision names what changed (accepted) or why the objection does not hold (rejected)'],
96
+ 'managed-review-by-harness': ['tool', 'the harness reviews the final patch; the agent does not ask for one'],
97
+ 'managed-review-once': ['tool', 'this change was reviewed already; ask again only after fixing blocking findings'],
98
+ 'managed-copies-invalid': ['tool', 'several helpers of a role run 2 or 3 at a time, at the member\'s request'],
99
+ 'managed-copies-not-asked': ['tool', 'more than one helper of a role runs only when the member asks for it'],
92
100
  helper_run_limit_reached: ['tool', 'this subagent already ran 8 times for this message'],
93
101
  'managed-helper-cancelled': ['tool', 'the subagent was stopped'],
94
102
  'managed-helper-failed': ['failed', 'the subagent ended without an answer'],
@@ -14,6 +14,7 @@ import { parseFailure } from '../packages/piagent-core/runtime/managed-failure.m
14
14
  import { checkpointsOf } from '../packages/piagent-core/managed/checkpoints.mjs';
15
15
  import { bypassAllowed, effectivePermission } from '../packages/piagent-core/managed/permission.mjs';
16
16
  import { memoryOn } from '../packages/piagent-core/managed/memory.mjs';
17
+ import { currentPlan, unfinished } from '../packages/piagent-core/managed/workflow.mjs';
17
18
  import { companyFailureText } from '../packages/piagent-webui/shared/company-copy.ts';
18
19
  import { headlineText, outcomeText, processItems } from '../packages/piagent-webui/shared/process-copy.ts';
19
20
  import { turnEndCopy, turnEndOf } from '../packages/piagent-webui/shared/turn-end.ts';
@@ -146,6 +147,18 @@ export function planLines(plan) {
146
147
  ...steps.map((p) => ` ${mark[p.status] ?? '☐'} ${p.step}${p.status === 'in_progress' ? ' ← đang làm' : p.status === 'deferred' ? ' (để sau)' : ''}`)];
147
148
  }
148
149
 
150
+ // The panel above the input while a turn works: the checklist while a step
151
+ // is open, and each subagent running now with its job and latest step.
152
+ export function planWidget(plan) {
153
+ return unfinished(plan) ? planLines(plan.plan) : undefined;
154
+ }
155
+ export function helperLines(helpers) {
156
+ const list = Array.isArray(helpers) ? helpers.filter((h) => typeof h?.role === 'string') : [];
157
+ if (!list.length) return undefined;
158
+ const many = (role) => list.filter((h) => h.role === role).length > 1;
159
+ return [`Subagent đang chạy · ${list.length}`, ...list.map((h) => ` ⟳ ${h.role}${many(h.role) ? ` ${h.slot ?? 1}` : ''}${h.job ? ` · ${String(h.job).slice(0, 60)}` : ''}${h.step ? ` — ${String(h.step).slice(0, 70)}` : ''}`)];
160
+ }
161
+
149
162
  // A harness note's details, in the shape the shared copy reads.
150
163
  export function processInput(details) {
151
164
  if (!details || typeof details !== 'object' || typeof details.phase !== 'string') return null;
@@ -402,7 +415,12 @@ export function companyTerminalExtension({ managed, packageRoot, sdkRoot, bindin
402
415
  const showBranch = async () => { try { const branch = await branchOf(managed()?.cwd ?? ctx.cwd); ctx.ui?.setStatus?.('agent-watch-branch', branch ? `⎇ ${branch}` : undefined); } catch { /* closed meanwhile */ } };
403
416
  ctx.ui?.setWorkingMessage?.(WORKING);
404
417
  void showBranch();
418
+ // The checklist and the subagents working now stay above the input (setWidget).
419
+ const showPlan = () => ctx.ui?.setWidget?.('agent-watch-plan', planWidget(currentPlan(session.sessionManager)));
420
+ showPlan();
405
421
  session.subscribe((event) => {
422
+ if (event?.type === 'tool_execution_end' && event.toolName === 'update_plan' || event?.type === 'agent_end') showPlan();
423
+ if (event?.type === 'managed_helper_state') ctx.ui?.setWidget?.('agent-watch-helpers', helperLines(event.helpers));
406
424
  if (event?.type === 'managed_helpers') ctx.ui?.setStatus?.('agent-watch-helpers', event.active ? `Subagent ${event.active}/${event.maximum}` : undefined);
407
425
  if (event?.type === 'managed_project_warning') ctx.ui?.notify?.(projectWarningText(event.warnings, event.team, LOCALE), 'warning');
408
426
  const end = event?.type === 'managed_turn_end' ? turnEndOf(event.end) : null;
@@ -413,7 +431,7 @@ export function companyTerminalExtension({ managed, packageRoot, sdkRoot, bindin
413
431
  });
414
432
  });
415
433
  pi.registerMessageRenderer('agent-watch-review-status', (_message, _options, theme) =>
416
- box('Review đã cũ: code đổi sau khi review. Cần review lại cho thay đổi hiện tại.', theme, 'warning'));
434
+ box('Review đã cũ: code đổi sau khi review. Chỉ cần review lại khi đã sửa lỗi blocking.', theme, 'warning'));
417
435
  pi.registerMessageRenderer('agent-watch-helper-receipt', (message, _options, theme) =>
418
436
  box(String(message.content ?? '').replace(/(\d[\d,]*) tokens/, '$1 token').replace('review is stale', 'review đã cũ'), theme, 'dim'));
419
437