@piagent/platform 1.3.1 → 1.4.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 (329) hide show
  1. package/CHANGELOG.md +132 -0
  2. package/README.md +10 -4
  3. package/README.vi.md +27 -0
  4. package/architecture/layers.json +96 -1
  5. package/docs/README.md +1 -0
  6. package/docs/architecture.md +1 -0
  7. package/docs/authority-manifest.md +1 -0
  8. package/docs/auto-delegation-policy.md +1 -0
  9. package/docs/capability-packs.md +1 -0
  10. package/docs/command-reference-vietnamese.md +5 -4
  11. package/docs/context-engine.md +1 -0
  12. package/docs/context-window-policy.md +1 -0
  13. package/docs/distribution-standard.md +8 -7
  14. package/docs/en/architecture.md +13 -0
  15. package/docs/herdr-workflow.md +1 -0
  16. package/docs/languages.json +20 -4
  17. package/docs/mcp-and-tools.md +125 -9
  18. package/docs/memory-policy.md +1 -0
  19. package/docs/model-options.md +1 -0
  20. package/docs/oauth-providers.md +1 -0
  21. package/docs/operator-manual-vietnamese.md +15 -12
  22. package/docs/package-architecture-notes.md +1 -0
  23. package/docs/project-adapters.md +1 -0
  24. package/docs/project-onboarding.md +1 -0
  25. package/docs/publishing-for-teams.md +37 -0
  26. package/docs/quality-benchmark.md +1 -0
  27. package/docs/quickstart-vietnamese.md +3 -2
  28. package/docs/release-install-policy.md +22 -8
  29. package/docs/runtime-harness-standard.md +2 -1
  30. package/docs/runtime-policy-design.md +1 -0
  31. package/docs/runtime-quality-baseline.md +1 -0
  32. package/docs/security-redaction-benchmark.md +1 -0
  33. package/docs/security-threat-model.md +2 -1
  34. package/docs/subagent-orchestration-capabilities.md +1 -0
  35. package/docs/subagents-and-multiagent.md +1 -0
  36. package/docs/task-implementation-contract.md +12 -4
  37. package/docs/task-lifecycle-vietnamese.md +1 -0
  38. package/docs/team-onboarding.md +3 -2
  39. package/docs/third-party-neutrality.md +26 -0
  40. package/docs/usage-observability.md +71 -0
  41. package/docs/vercel-docs-site.md +1 -0
  42. package/docs/vi/architecture.md +13 -0
  43. package/docs/workflow-recipes.md +1 -0
  44. package/docs-site/architecture.html +5 -1
  45. package/docs-site/benchmark.html +5 -1
  46. package/docs-site/commands.html +5 -1
  47. package/docs-site/content/en/index.html +49 -0
  48. package/docs-site/content/en/runtime.html +13 -0
  49. package/docs-site/content/index.html +49 -0
  50. package/docs-site/content/runtime.html +28 -0
  51. package/docs-site/context-engine.html +5 -1
  52. package/docs-site/en/architecture.html +5 -1
  53. package/docs-site/en/benchmark.html +5 -1
  54. package/docs-site/en/commands.html +5 -1
  55. package/docs-site/en/context-engine.html +5 -1
  56. package/docs-site/en/index.html +54 -1
  57. package/docs-site/en/mcp-approval.html +5 -1
  58. package/docs-site/en/mcp-auth.html +5 -1
  59. package/docs-site/en/mcp-servers.html +5 -1
  60. package/docs-site/en/mcp.html +5 -1
  61. package/docs-site/en/permissions.html +5 -1
  62. package/docs-site/en/profiles.html +5 -1
  63. package/docs-site/en/quickstart.html +5 -1
  64. package/docs-site/en/runtime.html +18 -1
  65. package/docs-site/en/scope.html +5 -1
  66. package/docs-site/en/security.html +5 -1
  67. package/docs-site/en/team.html +5 -1
  68. package/docs-site/en/whats-new.html +5 -1
  69. package/docs-site/en/workflows.html +5 -1
  70. package/docs-site/index.html +54 -1
  71. package/docs-site/mcp-approval.html +5 -1
  72. package/docs-site/mcp-auth.html +5 -1
  73. package/docs-site/mcp-servers.html +5 -1
  74. package/docs-site/mcp.html +5 -1
  75. package/docs-site/permissions.html +5 -1
  76. package/docs-site/profiles.html +5 -1
  77. package/docs-site/quickstart.html +5 -1
  78. package/docs-site/runtime.html +33 -1
  79. package/docs-site/scope.html +5 -1
  80. package/docs-site/security.html +5 -1
  81. package/docs-site/team.html +5 -1
  82. package/docs-site/whats-new.html +5 -1
  83. package/docs-site/workflows.html +5 -1
  84. package/evals/fixtures/mutation-provenance-record.invalid.json +17 -0
  85. package/evals/fixtures/mutation-provenance-record.valid.json +27 -0
  86. package/evals/fixtures/piagent-webui/approval-v1.invalid.json +54 -0
  87. package/evals/fixtures/piagent-webui/approval-v1.valid.json +58 -0
  88. package/evals/fixtures/piagent-webui/attachment-v1.invalid.json +25 -0
  89. package/evals/fixtures/piagent-webui/attachment-v1.valid.json +25 -0
  90. package/evals/fixtures/piagent-webui/capabilities-v1.invalid.json +51 -0
  91. package/evals/fixtures/piagent-webui/capabilities-v1.valid.json +122 -0
  92. package/evals/fixtures/piagent-webui/commit-summary-v1.invalid.json +10 -0
  93. package/evals/fixtures/piagent-webui/commit-summary-v1.valid.json +25 -0
  94. package/evals/fixtures/piagent-webui/control-command-v1.invalid.json +37 -0
  95. package/evals/fixtures/piagent-webui/control-command-v1.valid.json +35 -0
  96. package/evals/fixtures/piagent-webui/diff-v1.invalid.json +13 -0
  97. package/evals/fixtures/piagent-webui/diff-v1.valid.json +141 -0
  98. package/evals/fixtures/piagent-webui/gateway-capabilities-v1.invalid.json +35 -0
  99. package/evals/fixtures/piagent-webui/gateway-capabilities-v1.valid.json +35 -0
  100. package/evals/fixtures/piagent-webui/gateway-protocol-v1.invalid.json +14 -0
  101. package/evals/fixtures/piagent-webui/gateway-protocol-v1.valid.json +14 -0
  102. package/evals/fixtures/piagent-webui/handoff-history-v1.invalid.json +16 -0
  103. package/evals/fixtures/piagent-webui/handoff-history-v1.valid.json +16 -0
  104. package/evals/fixtures/piagent-webui/model-catalog-v1.invalid.json +31 -0
  105. package/evals/fixtures/piagent-webui/model-catalog-v1.valid.json +43 -0
  106. package/evals/fixtures/piagent-webui/queue-v1.invalid.json +29 -0
  107. package/evals/fixtures/piagent-webui/queue-v1.valid.json +44 -0
  108. package/evals/fixtures/piagent-webui/recovery-history-v1.invalid.json +17 -0
  109. package/evals/fixtures/piagent-webui/recovery-history-v1.valid.json +20 -0
  110. package/evals/fixtures/piagent-webui/release-monitor-v1.invalid.json +12 -0
  111. package/evals/fixtures/piagent-webui/release-monitor-v1.valid.json +29 -0
  112. package/evals/fixtures/piagent-webui/review-state-v1.invalid.json +25 -0
  113. package/evals/fixtures/piagent-webui/review-state-v1.valid.json +38 -0
  114. package/evals/fixtures/piagent-webui/runtime-event-v2.invalid.json +49 -0
  115. package/evals/fixtures/piagent-webui/runtime-event-v2.valid.json +49 -0
  116. package/evals/fixtures/piagent-webui/session-catalog-v1.invalid.json +17 -0
  117. package/evals/fixtures/piagent-webui/session-catalog-v1.valid.json +58 -0
  118. package/evals/fixtures/piagent-webui/session-command-v1.invalid.json +19 -0
  119. package/evals/fixtures/piagent-webui/session-command-v1.valid.json +19 -0
  120. package/evals/fixtures/piagent-webui/snapshot-v1.invalid.json +5 -0
  121. package/evals/fixtures/piagent-webui/snapshot-v1.valid.json +191 -0
  122. package/evals/fixtures/piagent-webui/source-change-v1.invalid.json +57 -0
  123. package/evals/fixtures/piagent-webui/source-change-v1.valid.json +98 -0
  124. package/evals/fixtures/piagent-webui/source-mutation-v1.invalid.json +19 -0
  125. package/evals/fixtures/piagent-webui/source-mutation-v1.valid.json +38 -0
  126. package/evals/fixtures/piagent-webui/source-revert-v1.invalid.json +20 -0
  127. package/evals/fixtures/piagent-webui/source-revert-v1.valid.json +62 -0
  128. package/evals/fixtures/piagent-webui/subagent-tree-v1.invalid.json +26 -0
  129. package/evals/fixtures/piagent-webui/subagent-tree-v1.valid.json +39 -0
  130. package/evals/fixtures/piagent-webui/task-index-v1.invalid.json +15 -0
  131. package/evals/fixtures/piagent-webui/task-index-v1.valid.json +15 -0
  132. package/evals/fixtures/piagent-webui/task-timeline-v1.invalid.json +14 -0
  133. package/evals/fixtures/piagent-webui/task-timeline-v1.valid.json +16 -0
  134. package/evals/fixtures/piagent-webui/transcript-v1.invalid.json +35 -0
  135. package/evals/fixtures/piagent-webui/transcript-v1.valid.json +55 -0
  136. package/evals/fixtures/task-baseline-manifest.invalid.json +16 -0
  137. package/evals/fixtures/task-baseline-manifest.valid.json +41 -0
  138. package/evals/fixtures/verifier-file-snapshot.invalid.json +21 -0
  139. package/evals/fixtures/verifier-file-snapshot.valid.json +21 -0
  140. package/package.json +43 -4
  141. package/packages/piagent-core/README.md +3 -2
  142. package/packages/piagent-core/benchmark/benchmark-candidate.d.ts +1 -0
  143. package/packages/piagent-core/benchmark/benchmark-forensics.d.ts +1 -0
  144. package/packages/piagent-core/benchmark/benchmark-ledger.d.ts +4 -0
  145. package/packages/piagent-core/benchmark/benchmark-record-validation.d.ts +1 -0
  146. package/packages/piagent-core/benchmark/benchmark-runtime.d.ts +1 -0
  147. package/packages/piagent-core/capabilities/capability-core.js +2 -2
  148. package/packages/piagent-core/capabilities/capability-verification-cache.js +17 -7
  149. package/packages/piagent-core/capabilities/runtime-integrity.js +190 -0
  150. package/packages/piagent-core/extensions/piagent-guard.ts +80 -272
  151. package/packages/piagent-core/extensions/redaction-core.d.ts +2 -0
  152. package/packages/piagent-core/extensions/runtime-evidence.js +12 -1
  153. package/packages/piagent-core/extensions/shell-reach.ts +250 -0
  154. package/packages/piagent-core/extensions/task-journal.js +30 -1
  155. package/packages/piagent-core/extensions/task-state.js +33 -36
  156. package/packages/piagent-core/mcp/mcp-command-actions.js +1 -1
  157. package/packages/piagent-core/mcp/mcp-server-catalog.js +139 -9
  158. package/packages/piagent-core/package.json +1 -1
  159. package/packages/piagent-core/runtime/hooks/session-start-hook.ts +2 -2
  160. package/packages/piagent-core/runtime/hooks/tool-call-hook.ts +12 -2
  161. package/packages/piagent-core/runtime/hooks/tool-result-hook.ts +20 -19
  162. package/packages/piagent-core/runtime/hooks/tool-result-metadata.ts +13 -0
  163. package/packages/piagent-core/runtime/input/chat-images.ts +2 -2
  164. package/packages/piagent-core/runtime/inspection/activity-event-adapter.ts +94 -0
  165. package/packages/piagent-core/runtime/inspection/approval-broker.ts +318 -0
  166. package/packages/piagent-core/runtime/inspection/commit-summary-projection.ts +59 -0
  167. package/packages/piagent-core/runtime/inspection/context-telemetry-inspection.ts +37 -0
  168. package/packages/piagent-core/runtime/inspection/criteria-links.ts +295 -0
  169. package/packages/piagent-core/runtime/inspection/diff-projection.ts +499 -0
  170. package/packages/piagent-core/runtime/inspection/git-filter-safety.ts +38 -0
  171. package/packages/piagent-core/runtime/inspection/git-numstat-adapter.ts +71 -0
  172. package/packages/piagent-core/runtime/inspection/git-status-adapter.ts +493 -0
  173. package/packages/piagent-core/runtime/inspection/git-tree-adapter.ts +108 -0
  174. package/packages/piagent-core/runtime/inspection/mcp-control.ts +10 -0
  175. package/packages/piagent-core/runtime/inspection/mutation-provenance-contract.ts +131 -0
  176. package/packages/piagent-core/runtime/inspection/mutation-provenance-recorder.ts +48 -0
  177. package/packages/piagent-core/runtime/inspection/mutation-provenance-store.ts +161 -0
  178. package/packages/piagent-core/runtime/inspection/project-runtime-inspection.ts +36 -0
  179. package/packages/piagent-core/runtime/inspection/review-state-contract.ts +108 -0
  180. package/packages/piagent-core/runtime/inspection/review-state-projection.ts +93 -0
  181. package/packages/piagent-core/runtime/inspection/review-state-store.ts +112 -0
  182. package/packages/piagent-core/runtime/inspection/runtime-event-store.ts +262 -0
  183. package/packages/piagent-core/runtime/inspection/same-process-bridge-proof.ts +103 -0
  184. package/packages/piagent-core/runtime/inspection/source-change-projection.ts +471 -0
  185. package/packages/piagent-core/runtime/inspection/source-evidence-contract.ts +139 -0
  186. package/packages/piagent-core/runtime/inspection/source-evidence-store.ts +315 -0
  187. package/packages/piagent-core/runtime/inspection/source-handoff-store.ts +70 -0
  188. package/packages/piagent-core/runtime/inspection/source-inspection-plan.ts +34 -0
  189. package/packages/piagent-core/runtime/inspection/source-mutation-projection.ts +164 -0
  190. package/packages/piagent-core/runtime/inspection/source-mutation-store.ts +168 -0
  191. package/packages/piagent-core/runtime/inspection/source-open-target.ts +38 -0
  192. package/packages/piagent-core/runtime/inspection/source-revert-projection.ts +147 -0
  193. package/packages/piagent-core/runtime/inspection/task-baseline-start-capture.ts +22 -0
  194. package/packages/piagent-core/runtime/inspection/task-compaction-history.ts +160 -0
  195. package/packages/piagent-core/runtime/inspection/task-control-journal.ts +131 -0
  196. package/packages/piagent-core/runtime/inspection/task-handoff-history.ts +95 -0
  197. package/packages/piagent-core/runtime/inspection/task-provenance-projection.ts +60 -0
  198. package/packages/piagent-core/runtime/inspection/task-recovery-timeline.ts +88 -0
  199. package/packages/piagent-core/runtime/inspection/task-run-index.ts +87 -0
  200. package/packages/piagent-core/runtime/inspection/task-source-projection.ts +401 -0
  201. package/packages/piagent-core/runtime/inspection/task-subagent-tree.ts +101 -0
  202. package/packages/piagent-core/runtime/inspection/text-diff.ts +60 -0
  203. package/packages/piagent-core/runtime/inspection/verifier-snapshot-contract.ts +114 -0
  204. package/packages/piagent-core/runtime/inspection/verifier-snapshot-store.ts +189 -0
  205. package/packages/piagent-core/runtime/inspection/webui-snapshot.ts +320 -0
  206. package/packages/piagent-core/runtime/inspection/workspace-file-reader.ts +132 -0
  207. package/packages/piagent-core/runtime/inspection/workspace-source-projection.ts +96 -0
  208. package/packages/piagent-core/runtime/inspection/zero-turn-conformance.ts +175 -0
  209. package/packages/piagent-core/runtime/orchestration/owned-work-budget.ts +93 -6
  210. package/packages/piagent-core/runtime/policy/block-remedy.ts +139 -0
  211. package/packages/piagent-core/runtime/policy/source-index-transaction.ts +173 -0
  212. package/packages/piagent-core/runtime/policy/source-mutation-guard-binding.ts +42 -0
  213. package/packages/piagent-core/runtime/policy/source-mutation-guard.ts +184 -0
  214. package/packages/piagent-core/runtime/policy/source-worktree-transaction.ts +105 -0
  215. package/packages/piagent-core/runtime/product/activity-inspector-footer.ts +5 -3
  216. package/packages/piagent-core/runtime/product/activity-inspector.ts +85 -343
  217. package/packages/piagent-core/runtime/recovery/resume-state.ts +38 -1
  218. package/packages/piagent-core/runtime/registration/activity-inspector-command.ts +68 -14
  219. package/packages/piagent-core/runtime/registration/task-start-tool.ts +22 -27
  220. package/packages/piagent-core/runtime/session/model-authorship-state.ts +31 -3
  221. package/packages/piagent-core/runtime/session/runtime-state.ts +11 -1
  222. package/packages/piagent-core/runtime/session/token-economics.js +34 -0
  223. package/packages/piagent-core/runtime/tools/phase-tool-runtime.ts +2 -1
  224. package/packages/piagent-core/runtime/workflows/task-intake.ts +5 -0
  225. package/packages/piagent-core/security/sensitive-data.js +7 -0
  226. package/packages/piagent-webui/dist/client/assets/index-DwKCWbwd.css +1 -0
  227. package/packages/piagent-webui/dist/client/assets/index-bu7XpD9Q.js +172 -0
  228. package/packages/piagent-webui/dist/client/index.html +16 -0
  229. package/packages/piagent-webui/extension/attachment-store.ts +323 -0
  230. package/packages/piagent-webui/extension/held-message-queue.ts +311 -0
  231. package/packages/piagent-webui/extension/lifecycle-controller.ts +423 -0
  232. package/packages/piagent-webui/extension/lifecycle-event-adapter.ts +23 -0
  233. package/packages/piagent-webui/extension/piagent-webui.ts +470 -0
  234. package/packages/piagent-webui/extension/review-controller.ts +160 -0
  235. package/packages/piagent-webui/extension/same-session-bridge.ts +500 -0
  236. package/packages/piagent-webui/extension/session-options-controller.ts +281 -0
  237. package/packages/piagent-webui/extension/session-stream-adapter.ts +249 -0
  238. package/packages/piagent-webui/extension/source-mutation-controller.ts +215 -0
  239. package/packages/piagent-webui/extension/source-open-controller.ts +136 -0
  240. package/packages/piagent-webui/extension/source-revert-controller.ts +189 -0
  241. package/packages/piagent-webui/extension/terminal-session-adapter.ts +73 -0
  242. package/packages/piagent-webui/extension/vscode-handoff.ts +51 -0
  243. package/packages/piagent-webui/gateway/control-socket.ts +92 -0
  244. package/packages/piagent-webui/gateway/extension-authority.ts +47 -0
  245. package/packages/piagent-webui/gateway/gateway-events.ts +60 -0
  246. package/packages/piagent-webui/gateway/gateway-protocol-service.ts +64 -0
  247. package/packages/piagent-webui/gateway/gateway-service.ts +215 -0
  248. package/packages/piagent-webui/gateway/gateway-session-stream.ts +110 -0
  249. package/packages/piagent-webui/gateway/mcp-auth-broker.ts +158 -0
  250. package/packages/piagent-webui/gateway/native-project-picker.ts +29 -0
  251. package/packages/piagent-webui/gateway/pi-host.ts +41 -0
  252. package/packages/piagent-webui/gateway/profile-state.ts +1 -0
  253. package/packages/piagent-webui/gateway/project-registry.ts +108 -0
  254. package/packages/piagent-webui/gateway/provider-auth-broker.ts +172 -0
  255. package/packages/piagent-webui/gateway/session-catalog.ts +128 -0
  256. package/packages/piagent-webui/gateway/session-command-controller.ts +237 -0
  257. package/packages/piagent-webui/gateway/session-command-store.ts +224 -0
  258. package/packages/piagent-webui/gateway/session-inspection-registry.ts +239 -0
  259. package/packages/piagent-webui/gateway/session-lease-store.ts +1 -0
  260. package/packages/piagent-webui/gateway/session-metadata-store.ts +152 -0
  261. package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +489 -0
  262. package/packages/piagent-webui/ownership/gateway-runtime-context.ts +8 -0
  263. package/packages/piagent-webui/ownership/profile-state.ts +117 -0
  264. package/packages/piagent-webui/ownership/session-lease-store.ts +329 -0
  265. package/packages/piagent-webui/ownership/session-refs.ts +8 -0
  266. package/packages/piagent-webui/package.json +33 -0
  267. package/packages/piagent-webui/server/README.md +4 -0
  268. package/packages/piagent-webui/server/benchmark-release-monitor.ts +230 -0
  269. package/packages/piagent-webui/server/core-inspection-provider.ts +403 -0
  270. package/packages/piagent-webui/server/gateway-websocket.ts +143 -0
  271. package/packages/piagent-webui/server/http-security.ts +27 -0
  272. package/packages/piagent-webui/server/ipc-read-model-client.ts +89 -0
  273. package/packages/piagent-webui/server/loopback-server.ts +368 -0
  274. package/packages/piagent-webui/server/read-model-provider.ts +37 -0
  275. package/packages/piagent-webui/server/read-only-router.ts +105 -0
  276. package/packages/piagent-webui/server/session-auth.ts +88 -0
  277. package/packages/piagent-webui/server/sidecar-main.ts +86 -0
  278. package/packages/piagent-webui/server/sse-hub.ts +76 -0
  279. package/packages/piagent-webui/server/static-bundle.ts +40 -0
  280. package/packages/piagent-webui/server/transcript-projection.ts +125 -0
  281. package/schemas/mutation-provenance-record.schema.json +100 -0
  282. package/schemas/piagent-webui/approval-v1.schema.json +654 -0
  283. package/schemas/piagent-webui/attachment-v1.schema.json +267 -0
  284. package/schemas/piagent-webui/capabilities-v1.schema.json +729 -0
  285. package/schemas/piagent-webui/catalog-v1.json +240 -0
  286. package/schemas/piagent-webui/commit-summary-v1.schema.json +63 -0
  287. package/schemas/piagent-webui/common-v1.schema.json +479 -0
  288. package/schemas/piagent-webui/control-command-v1.schema.json +1780 -0
  289. package/schemas/piagent-webui/diff-v1.schema.json +826 -0
  290. package/schemas/piagent-webui/gateway-capabilities-v1.schema.json +136 -0
  291. package/schemas/piagent-webui/gateway-protocol-v1.schema.json +456 -0
  292. package/schemas/piagent-webui/handoff-history-v1.schema.json +92 -0
  293. package/schemas/piagent-webui/model-catalog-v1.schema.json +95 -0
  294. package/schemas/piagent-webui/queue-v1.schema.json +99 -0
  295. package/schemas/piagent-webui/recovery-history-v1.schema.json +144 -0
  296. package/schemas/piagent-webui/release-monitor-v1.schema.json +173 -0
  297. package/schemas/piagent-webui/review-state-v1.schema.json +206 -0
  298. package/schemas/piagent-webui/runtime-event-v2.schema.json +5206 -0
  299. package/schemas/piagent-webui/session-catalog-v1.schema.json +222 -0
  300. package/schemas/piagent-webui/session-command-v1.schema.json +390 -0
  301. package/schemas/piagent-webui/snapshot-v1.schema.json +2622 -0
  302. package/schemas/piagent-webui/source-change-v1.schema.json +763 -0
  303. package/schemas/piagent-webui/source-mutation-v1.schema.json +96 -0
  304. package/schemas/piagent-webui/source-revert-v1.schema.json +130 -0
  305. package/schemas/piagent-webui/subagent-tree-v1.schema.json +88 -0
  306. package/schemas/piagent-webui/task-index-v1.schema.json +74 -0
  307. package/schemas/piagent-webui/task-timeline-v1.schema.json +49 -0
  308. package/schemas/piagent-webui/transcript-v1.schema.json +243 -0
  309. package/schemas/task-baseline-manifest.schema.json +122 -0
  310. package/schemas/verifier-file-snapshot.schema.json +81 -0
  311. package/scripts/build-docs-site.mjs +21 -1
  312. package/scripts/check-architecture.mjs +1 -0
  313. package/scripts/check-doc-languages.mjs +19 -2
  314. package/scripts/check-third-party-neutrality.mjs +43 -0
  315. package/scripts/explain-command.mjs +240 -0
  316. package/scripts/install-global.sh +105 -4
  317. package/scripts/mcp-manage.mjs +17 -4
  318. package/scripts/pi-session-stats.sh +10 -2
  319. package/scripts/piagent-cli.mjs +30 -3
  320. package/scripts/piagent-dashboard.mjs +261 -0
  321. package/scripts/piagent-webui-launcher.mjs +121 -0
  322. package/scripts/setup.sh +69 -33
  323. package/scripts/traffic-snapshot.mjs +214 -0
  324. package/scripts/typescript-loader.mjs +42 -1
  325. package/scripts/uninstall-global.sh +53 -2
  326. package/scripts/update-global.mjs +33 -1
  327. package/scripts/verify-local.sh +257 -0
  328. package/scripts/verify-release-identity.mjs +4 -1
  329. package/scripts/verify-translation-pairing.mjs +121 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,138 @@
2
2
 
3
3
  This file records release-facing changes for Pi Agent Platform. Copy the relevant version block into GitHub Releases when publishing a tag.
4
4
 
5
+ ## Unreleased
6
+
7
+ ## v1.4.1 - 2026-08-17
8
+
9
+ - Local installs now synchronize the terminal helper and WebUI Gateway from the same checkout before registering the Pi package, preventing a stale global Gateway from enforcing older session/task lifecycle rules.
10
+
11
+ ### Integrity boundary
12
+
13
+ - The runtime integrity graph skipped shell entrypoints entirely, so a pinned command could execute an unpinned program: `piagent-usage` ran a 567-line reader of `~/.pi/agent/sessions/**` that the lock had never seen, because the path was built from `$SCRIPT_DIR` and the repository-relative literal never appeared in the source. Shell sources are now scanned, and a sibling reached through a computed directory is followed.
14
+
15
+ - The published package ships the built browser bundle and not the sources it came from, so on an installed platform that 725 KB of JavaScript could not be regenerated or checked against anything — while it runs inside the origin that holds the session cookie and the CSRF token, with the authority to drive session commands, source mutation and provider auth. The server that serves it was pinned; what it served was not. The served bundle is now pinned, document included, because the document names which script runs.
16
+
17
+ - A TypeScript module imported by its emitted name — `./x.js` for `x.ts`, the ordinary TypeScript convention — resolved to nothing and was dropped in silence. No module was outside the lock because of it, but a module that decides what the guard enforces could have been, while the graph still claimed to be complete.
18
+
19
+ ### Agent control
20
+
21
+ - Command-only test/build/typecheck/package requests now enter an execution-capable governed task even when the operator forbids source edits; read-only remains a strict inspection mode instead of failing halfway through the first verifier command.
22
+
23
+ - A terminal Task Contract used to terminate the conversation with it: WebUI swallowed the next operator message before Pi persisted it, the Gateway could only report `session-command-effect-unknown`, and `piagent_task_start` then demanded a fresh Pi session. Conversations may now bind sequential Task Contracts. The closed task remains immutable, paused/stopping tasks remain closed, and the terminal boundary admits only new conversation input plus the exact successor-task start transition.
24
+
25
+ - `OwnedWorkCeilings` advertised eight limits and six of them were never read: the per-role ceilings were real but fixed at one apiece, so raising `maxScoutPasses` in a profile did nothing while `maxTotalHelpers` beside it took effect. Half-honoured configuration reads as working configuration. The ceilings are now read from the object the caller passes; every default is one, so no shipped behaviour changes, and automatic mode is pinned against widening.
26
+
27
+ - A blocked tool call is the only conversation most operators have with this policy, and it was one-sided: of 43 distinct refusals, three said what to do next. Remedies are now attached at the single point every decision leaves through, so a refusal added later is answered without anyone remembering to. The refusal that stops the whole session says which command explains it.
28
+
29
+ - `piagent explain '<command>'` reports conclusive static refusals and the guard readers that found them. A static pass is now explicitly `indeterminate` until the live Pi runtime evaluates Task Contract, scope, permission, lifecycle, approval and budget state; the standalone CLI can no longer issue an "exact allow" that the real guard later blocks. `--scope` lists the static boundary in effect.
30
+
31
+ ### Redaction and evidence
32
+
33
+ - An npm token was recognised only where something named it, so `//registry.npmjs.org/:_authToken=npm_…` — the whole of an `.npmrc`, and what a failing publish prints — went through unredacted. Every other provider here is matched by the shape of its token.
34
+
35
+ - Redaction runs before tool-result compaction, and that order was the only thing keeping a credential out of the capture written to project state. Nothing pinned it; reversing the two calls would have written credentials to disk and passed every test.
36
+
37
+ - An observation that states neither an exit code nor an error flag no longer satisfies a claim of success. It is unreachable through the recorded shapes, but a reader of the function that guards forged verification should not have to prove that.
38
+
39
+ ### Cost and clarity
40
+
41
+ - `piagent-usage` reports fresh tokens and the cache hit rate, using the benchmark's own definition of a fresh token so the terminal and the published measurement cannot mean two different things. The rate is reported beside the count and never instead of it: in the published benchmark the baseline surface held the higher hit rate while spending more than twice the fresh tokens.
42
+
43
+ - Capability verification derived the ancestor set on every cache hit, which at 296 pinned files cost more than every `lstat` it performed put together. Deriving it once per snapshot took a hit from 4.28 ms to 1.61 ms with no loss of tamper detection.
44
+
45
+ - The WebUI opens in the language the browser asked for instead of always starting in Vietnamese; the confirmation for full access focuses the safe choice, so a reflex Enter dismisses it rather than granting it; and the file a diff shows is derived from the list that is loaded, so no later clear can leave the pane asking for a file beside a list holding one.
46
+
47
+ ### Install and uninstall
48
+
49
+ - Running the documented two-command install downgraded the machine-wide Pi package to whatever pin the project being initialised happened to carry, including a project the operator only meant to open once. One resolved value served both scopes and read the project pin first, so a pin that is authority over its own project quietly became authority over the machine. The two scopes now resolve separately: the global install takes the running helper, the project keeps its pin, an explicit `--package-source` still beats both, and a divergence between them is printed instead of silently resolved.
50
+
51
+ - Uninstall removed nothing on any machine whose helper sits under a non-default npm prefix — the fallback the installer takes when the configured global root is not writable, and whatever `piagent-update --npm-prefix` was given. `npm uninstall -g` resolves against the configured prefix, so the run exited `0` and reported completion over an install that was still there. The prefix is now derived from where the running helper actually is, the same way the updater derives it, and the follow-up command printed for the operator to copy carries that prefix too. An npx cache root is still never claimed, because it owns no bin on anyone's PATH.
52
+
53
+ ### Agent control coverage
54
+
55
+ - A stop request only counts as pending if its `commandId` is truthy, so an empty one records the stop and then reports nothing pending — the single outcome an operator pressing stop must never get. The journal writers never check the shape, and the only thing preventing it was a regex in the browser command validator that no test named. Malformed identifiers are now pinned as rejected at that boundary, together with the proof that a well-formed one still passes, so the guard cannot be loosened or widened into blanket refusal without a test failing.
56
+
57
+ ### The dashboard starts without the MCP adapter
58
+
59
+ - `piagent dashboard` could not start on any machine where `pi-mcp-adapter` was not installed under the agent directory — an install run with `--no-mcp`, or anyone trying the package through `npx` before setting anything up. The gateway is spawned with `PIAGENT_PINNED_TS_TRANSFORM_ROOT` pointing at that adapter, and the TypeScript loader called `realpath` on it before deciding anything. That function answers one question — is the file being loaded inside the pinned adapter — and it threw instead of answering "no", so the throw escaped the loader on the first `.ts` file of any kind and killed the process. It now answers "no", which falls back to `strip`: the stricter of the two modes, so this can only ever refuse a transform, never grant one. The exception for the reviewed adapter, its exact version, and containment within its root are all unchanged.
60
+
61
+ - The failure was also unreadable. The gateway child was spawned with its stderr discarded, so a process that died on its first line looked exactly like a slow one: twelve seconds of waiting, then `gateway-start-timeout` and nothing else. The child's stderr is now kept, bounded, and reported, an early exit stops the wait instead of running out the clock, and the two cases are named differently — a process that died and a process that never answered are different problems.
62
+
63
+ ### Bilingual documentation
64
+
65
+ - The language gate proved a Vietnamese peer existed, which is not the same as saying the same thing: editing the English side and forgetting the other passed every check in this repository, and left a reader with a document describing a design that had changed. Each pair now records the content digest of both sides as of the last time somebody confirmed them consistent, and a side that moves alone fails the gate naming the file that has to follow. A two-sided edit is reported separately, because it is probably a paired edit and calling it drift would teach people to skip the gate. What it cannot do is read the two documents and decide they agree; it records that a human looked.
66
+
67
+ ### Google Workspace and document conversion
68
+
69
+ - Added Google's own remote MCP servers for Drive, Gmail, Docs and Sheets, one per product rather than a single server holding every scope, because that separation is the point: reading a spreadsheet should not cost a grant over Drive and every document in it, let alone the mailbox. Each has its own preset, so the narrowest useful grant is always available.
70
+ - Google Workspace MCP is Developer Preview and has no credentialed Pi OAuth E2E proof in this release. The four entries are marked experimental, print that status through catalog/preset output, and stay out of the generic `documents` preset as well as every default preset. Official endpoints and readonly scopes remain available through explicitly named Google presets for controlled testing.
71
+
72
+ - None of them appear in `core` or `popular`. `core` is what an install writes when nobody names a preset and `popular` is what people pick without reading the list, so an entry in either would hand an operator mail and file access they never chose. A test fails if one leaks in, if a catalog server exposes direct tools instead of going through the approval gate, or if a server that needs credentials ships without saying so.
73
+
74
+ - Connecting Gmail changes the threat model rather than extending it: until now the untrusted input reaching an agent was source code, and it becomes any mail anyone can send. The approval gate still stands between a message and an action, but the documentation now states plainly what the product cannot prevent, and recommends read-only scopes and the narrowest preset.
75
+
76
+ - Added MarkItDown for converting local `.docx`, `.xlsx`, `.pptx`, `.pdf` and `.html` to Markdown. It runs offline for `file:` URIs, which is the reason to prefer it: a document worth converting is usually one worth not uploading. It is pinned at its published alpha, and needs `uv`.
77
+
78
+ ### Adoption measurement
79
+
80
+ - GitHub serves repository traffic as a rolling 14-day window and discards everything older, with no endpoint that returns it. `traffic-snapshot` archives clones, views, referrers and paths daily into growing CSV files on a separate `traffic-data` branch, so the history survives and the product branch is not buried under a row a day. A day still filling when the run happens is overwritten by the next run rather than frozen partial, and a gap under 14 days loses nothing. The traffic endpoints need push access, so a 403 names the exact fix — a fine-grained token with `Administration: read` stored as `TRAFFIC_TOKEN` — instead of leaving a nightly job red.
81
+
82
+ - The documentation site now carries Vercel Web Analytics, which is cookieless and stores no browser identifier, so the site still owes no consent banner. The snippet is emitted from the site shell rather than any page, so both locales and every future page inherit it, and a test fails if a generated page ships without it or if a script from another origin appears. The runtime remains free of any network call: `telemetry()` writes locally and the package has no install hook.
83
+
84
+ ### Documentation parity
85
+
86
+ Four documents restated something the code already knew, and each had drifted. They are now checked against their source, so the next drift fails a test instead of reaching a reader.
87
+
88
+ - `install-global.sh --help` omitted `--default-model` and `--subagents-model-scope`, which had been accepted for four releases. The help text now carries every flag with its valid values, and the parity check reads the flag list out of the parser.
89
+
90
+ - The `piagent-usage --json` documentation described two of the six top-level keys. `scope`, `projects`, `tools` and `generatedAt` were undocumented, including the record of which filters produced the report — without which a saved report cannot explain itself. All six are documented with their fields, and compared against the emitted object in both directions.
91
+
92
+ - The architecture documents listed nine physical layers while `architecture/layers.json` enforced fifteen: every WebUI layer was enforced and undocumented, in both languages. The seven are now described with what they own and may not own, alongside why they form a second dependency spine rather than a branch of the first.
93
+
94
+ - The team release history stopped at `1.2.11` while releases continued to `1.4.0`, and `1.1.1` had been skipped earlier. Twelve entries were added, and the list is now checked against the changelog from its own oldest entry forward, so a gap anywhere in it fails.
95
+
96
+ - The repository layout in the README showed one package where there are two, leaving `piagent-webui` — the dashboard, its client, server, gateway and ownership layers — invisible to anyone reading the map before the tree.
97
+
98
+ ## v1.4.0 - 2026-08-15
99
+
100
+ ### Local Session Hub and WebUI
101
+
102
+ - Added a local, one-per-profile Gateway and `piagent dashboard` experience for
103
+ creating, reopening, resuming, renaming, pinning, archiving, unarchiving, and
104
+ forking durable Pi sessions without starting an extra model turn for views.
105
+ - Rebuilt the browser client as a conversation-first MUI application with a
106
+ compact composer, project and model controls, light/dark themes, Vietnamese
107
+ and English UI, responsive layouts, and an Agent Inspector for tasks, source
108
+ changes, activity, verification, usage, and handoff evidence.
109
+ - Added exact Gateway-owned chat streaming, held-message queues, bounded
110
+ attachments, model/thinking controls, lifecycle controls, and Pi-owned
111
+ approval cards while preserving one authoritative writer per session.
112
+
113
+ ### Source review, recovery, and security
114
+
115
+ - Added Task Changes, Working Tree, and Staged projections with bounded diffs,
116
+ provenance, criterion/verifier links, protected-path enforcement, and guarded
117
+ stage, unstage, revert, and editor handoff actions.
118
+ - Added durable session leases, terminal compatibility ownership, restart and
119
+ stale-owner recovery, idempotent command receipts, replay/resync, doctor with
120
+ explicit repair, and corrupt-state fail-closed behavior.
121
+ - Hardened the TypeScript loader, local control socket creation, runtime
122
+ integrity inventory, browser authentication, redaction, event bounds, and
123
+ provider/MCP credential handling.
124
+
125
+ ### Documentation and release gates
126
+
127
+ - Classified every root operating document by language, retained canonical
128
+ English/Vietnamese entry points, and added a gate that rejects unclassified
129
+ or unindexed Vietnamese documentation.
130
+ - Added a provider-neutral product-language gate while retaining third-party
131
+ names only where they describe real integrations, dependencies, or operator
132
+ commands.
133
+ - Added the executable WUI5-18 release matrix covering durable sessions,
134
+ ownership, recovery, approvals, protected data, transport validation,
135
+ accessibility, themes, and zero-model-turn navigation.
136
+
5
137
  ## v1.3.1 - 2026-08-13
6
138
 
7
139
  ### Security and reliability hardening
package/README.md CHANGED
@@ -248,8 +248,8 @@ Handled by Pi's native UI: `/model` or `Ctrl+L` to pick, `Ctrl+P` to cycle the s
248
248
  | Preset | Includes |
249
249
  |---|---|
250
250
  | `core` | Context7, Chrome DevTools, GitHub |
251
- | `popular` | core + Playwright + Figma remote |
252
- | `all` | popular + Figma desktop/local |
251
+ | `popular` | core + Playwright + Figma desktop/local |
252
+ | `all` | popular + Figma remote (requires an approved Figma MCP client) |
253
253
 
254
254
  Seeding writes server definitions; it does not start or authenticate anything. Servers connect lazily, so each one needs its own prerequisite before its first call: Chrome DevTools needs a local Chrome, and GitHub needs Docker running plus `GITHUB_PERSONAL_ACCESS_TOKEN` exported. `piagent-mcp --list` prints what each server requires. Project-scope `.mcp.json` files ship empty on purpose — the shared baseline is the global config, not the project one.
255
255
 
@@ -272,12 +272,18 @@ piagent/
272
272
  ├─ evals/ governed evaluation scenarios
273
273
  ├─ packs/ versioned capability manifests and recipes
274
274
  ├─ packages/
275
- │ └─ piagent-core/ Pi package: extensions, prompts, skills
275
+ │ ├─ piagent-core/ Pi package: extensions, runtime, prompts, skills
276
+ │ └─ piagent-webui/ dashboard: contracts, client, server, gateway, ownership
276
277
  ├─ schemas/ JSON schemas
277
278
  ├─ scripts/ setup, doctor, verification helpers
278
279
  └─ templates/ project/global templates
279
280
  ```
280
281
 
282
+ `piagent-core` is the Pi extension and runs headless on its own. `piagent-webui` is the
283
+ `piagent dashboard` surface — a separate dependency spine that reads the platform but is
284
+ never read by it, so the runtime keeps working with the dashboard absent. Both layer maps
285
+ are enforced by `npm run architecture:check`; see [Architecture](docs/en/architecture.md).
286
+
281
287
  ## Verification
282
288
 
283
289
  One command runs the full local gate — typecheck, tests, capability catalog, doctor, and the scaffold check:
@@ -343,7 +349,7 @@ This repository intentionally excludes:
343
349
 
344
350
  ## Maturity
345
351
 
346
- The current package version is read from package metadata and release tags. Personal machines may follow the unpinned package source when accepting ongoing updates; production/team quickstarts and committed project settings should pin an explicit tag such as `v1.3.1` or a reviewed commit.
352
+ The current package version is read from package metadata and release tags. Personal machines may follow the unpinned package source when accepting ongoing updates; production/team quickstarts and committed project settings should pin an explicit tag such as `v1.4.1` or a reviewed commit.
347
353
 
348
354
  Ready for:
349
355
 
package/README.vi.md CHANGED
@@ -84,6 +84,30 @@ npm run architecture:check
84
84
  - [Operator manual tiếng Việt](docs/operator-manual-vietnamese.md)
85
85
  - [Command reference tiếng Việt](docs/command-reference-vietnamese.md)
86
86
 
87
+ ## Cấu trúc repository
88
+
89
+ ```text
90
+ piagent/
91
+ ├─ architecture/ quy tắc layer và giới hạn file cho máy kiểm tra
92
+ ├─ adapters/ profile project tái sử dụng
93
+ ├─ catalog/ capability index xác định
94
+ ├─ docs/ tài liệu chuẩn EN/VI và hướng dẫn vận hành ổn định
95
+ ├─ evals/ kịch bản đánh giá có governance
96
+ ├─ packs/ capability manifest và recipe có version
97
+ ├─ packages/
98
+ │ ├─ piagent-core/ Pi package: extension, runtime, prompt, skill
99
+ │ └─ piagent-webui/ dashboard: contract, client, server, gateway, ownership
100
+ ├─ schemas/ JSON schema
101
+ ├─ scripts/ setup, doctor và helper kiểm tra
102
+ └─ templates/ template project/global
103
+ ```
104
+
105
+ `piagent-core` là Pi extension và có thể chạy headless độc lập. `piagent-webui`
106
+ là giao diện `piagent dashboard`, nằm trên một dependency spine riêng: WebUI đọc
107
+ platform nhưng platform không phụ thuộc ngược vào WebUI, nên runtime vẫn hoạt động
108
+ khi không mở dashboard. Cả hai sơ đồ layer đều được kiểm tra bằng
109
+ `npm run architecture:check`; xem [Architecture](docs/vi/architecture.md).
110
+
87
111
  ## Adaptive model routing
88
112
 
89
113
  Adaptive model routing cho fresh task dùng `piagent-route --prompt "<task>" --json`.
@@ -98,6 +122,9 @@ npm run verify
98
122
 
99
123
  Gate này chạy architecture check, test, typecheck, capability validation, runtime smoke và docs consistency trước khi release.
100
124
 
125
+ Bản phát hành hiện tại là `v1.4.1`. Với team hoặc production, hãy pin tag này
126
+ hoặc một commit đã review thay vì dựa vào nguồn package không cố định.
127
+
101
128
  ## Security
102
129
 
103
130
  Pi Agent Platform là application-level policy layer, không phải OS sandbox. Với untrusted code hoặc adversarial workload, vẫn cần container hoặc VM có filesystem, process, network và credential boundary riêng.
@@ -43,6 +43,48 @@
43
43
  "packages/piagent-core/benchmark"
44
44
  ]
45
45
  },
46
+ {
47
+ "name": "webui-contracts",
48
+ "roots": [
49
+ "packages/piagent-webui/contracts"
50
+ ]
51
+ },
52
+ {
53
+ "name": "webui-client",
54
+ "roots": [
55
+ "packages/piagent-webui/client"
56
+ ]
57
+ },
58
+ {
59
+ "name": "webui-server",
60
+ "roots": [
61
+ "packages/piagent-webui/server"
62
+ ]
63
+ },
64
+ {
65
+ "name": "webui-extension",
66
+ "roots": [
67
+ "packages/piagent-webui/extension"
68
+ ]
69
+ },
70
+ {
71
+ "name": "webui-gateway",
72
+ "roots": [
73
+ "packages/piagent-webui/gateway"
74
+ ]
75
+ },
76
+ {
77
+ "name": "webui-ownership",
78
+ "roots": [
79
+ "packages/piagent-webui/ownership"
80
+ ]
81
+ },
82
+ {
83
+ "name": "webui-build",
84
+ "roots": [
85
+ "packages/piagent-webui"
86
+ ]
87
+ },
46
88
  {
47
89
  "name": "entrypoints",
48
90
  "roots": [
@@ -86,6 +128,49 @@
86
128
  "benchmark": [
87
129
  "benchmark"
88
130
  ],
131
+ "webui-contracts": [
132
+ "webui-contracts"
133
+ ],
134
+ "webui-client": [
135
+ "webui-client",
136
+ "webui-contracts"
137
+ ],
138
+ "webui-server": [
139
+ "webui-server",
140
+ "webui-contracts",
141
+ "runtime",
142
+ "core",
143
+ "security",
144
+ "benchmark"
145
+ ],
146
+ "webui-extension": [
147
+ "webui-extension",
148
+ "webui-server",
149
+ "webui-ownership",
150
+ "runtime",
151
+ "core",
152
+ "security"
153
+ ],
154
+ "webui-gateway": [
155
+ "webui-gateway",
156
+ "webui-ownership",
157
+ "webui-server",
158
+ "webui-contracts",
159
+ "runtime",
160
+ "core",
161
+ "security"
162
+ ],
163
+ "webui-ownership": [
164
+ "webui-ownership"
165
+ ],
166
+ "webui-build": [
167
+ "webui-build",
168
+ "webui-contracts",
169
+ "webui-client",
170
+ "webui-server",
171
+ "webui-gateway",
172
+ "webui-ownership"
173
+ ],
89
174
  "entrypoints": [
90
175
  "entrypoints",
91
176
  "runtime",
@@ -93,7 +178,10 @@
93
178
  "mcp",
94
179
  "capabilities",
95
180
  "security",
96
- "benchmark"
181
+ "benchmark",
182
+ "webui-gateway",
183
+ "webui-ownership",
184
+ "webui-server"
97
185
  ]
98
186
  },
99
187
  "lineBudgets": {
@@ -105,6 +193,13 @@
105
193
  "capabilities": 1200,
106
194
  "security": 400,
107
195
  "benchmark": 1000,
196
+ "webui-contracts": 2000,
197
+ "webui-client": 500,
198
+ "webui-server": 500,
199
+ "webui-extension": 500,
200
+ "webui-gateway": 500,
201
+ "webui-ownership": 500,
202
+ "webui-build": 500,
108
203
  "entrypoints": 800
109
204
  },
110
205
  "files": {
package/docs/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Documentation languages
2
+ <!-- language: en+vi -->
2
3
 
3
4
  [English](en/README.md) | [Tiếng Việt](vi/README.md)
4
5
 
@@ -1,4 +1,5 @@
1
1
  # Architecture documentation
2
+ <!-- language: en+vi -->
2
3
 
3
4
  - [English architecture](en/architecture.md)
4
5
  - [Architecture tiếng Việt](vi/architecture.md)
@@ -1,4 +1,5 @@
1
1
  # Capability authority manifest
2
+ <!-- language: en -->
2
3
 
3
4
  The capability authority manifest is the versioned policy source for Piagent
4
5
  1.3 tasks. It includes every shipped capability without granting every
@@ -1,4 +1,5 @@
1
1
  # Solo-first orchestration policy
2
+ <!-- language: vi; english-index: docs-site/content/en/workflows.html -->
2
3
 
3
4
  Mục tiêu: user không phải nhớ `/run`, `/parallel`, `/chain` cho workflow hằng ngày, nhưng platform cũng không tự biến mọi task thành swarm tốn token. Khi anh gõ `/workflow task`, `/workflow be-to-fe`, `/workflow platform-improve`, `/workflow plan`, hoặc `/workflow review`, parent agent đọc `piagent_orchestration_policy`, giữ mặc định **solo-first**, rồi chỉ dùng subagents nếu việc đó giúp giảm nhiễu context, tăng tốc read-heavy work, hoặc tăng chất lượng review. Alias cũ như `/task` vẫn giữ cùng policy.
4
5
 
@@ -1,4 +1,5 @@
1
1
  # Capability packs
2
+ <!-- language: vi; english-index: docs-site/content/en/scope.html -->
2
3
 
3
4
  ## Tổng quan
4
5
 
@@ -1,4 +1,5 @@
1
1
  # Command reference tiếng Việt
2
+ <!-- language: vi; english-index: docs-site/content/en/commands.html -->
2
3
 
3
4
  > Nếu cần flow đầy đủ theo thứ tự dùng thật, đọc `docs/operator-manual-vietnamese.md`. File này chỉ là bảng tra cứu command.
4
5
 
@@ -309,7 +310,7 @@ Các command này thuộc Pi core hoặc package Pi chính. Tên/availability c
309
310
  | `/mcp setup` | Setup/refresh MCP | Khi MCP chưa nhận config. | Tùy adapter/version. |
310
311
  | `/mcp tools` | List MCP tools | Muốn biết server expose tool nào. | Dùng trước khi bảo agent gọi tool ngoài. |
311
312
  | `/mcp reconnect` | Kết nối lại MCP | Khi server lỗi, token mới, hoặc config đổi. | Không thay thế việc export secret env. |
312
- | `/mcp-auth figma` | OAuth Figma MCP | Khi dùng Figma remote MCP. | Có thể khác theo Figma/Pi MCP package version. |
313
+ | `/mcp-auth figma` | OAuth Figma remote MCP | Chỉ dùng khi Piagent đã được duyệt trong Figma MCP Catalog. | Nếu bị từ chối client, dùng `figma-desktop`. |
313
314
  | `/piagent-mcp` | Menu MCP | Không nhớ subcommand, hoặc muốn xem có việc gì cần làm. | Menu dựng theo project; không có select UI thì in thẳng bảng trạng thái. |
314
315
  | `/piagent-mcp status` | Danh sách MCP server + state | Muốn biết server nào đang có, ở scope nào, sẵn sàng chưa. | Đọc config, không kiểm tra kết nối live — cái đó là `/mcp`. |
315
316
  | `/piagent-mcp get <name>` | Chi tiết một server | Trước khi duyệt, hoặc khi không rõ scope nào đang có hiệu lực. | Giá trị credential bị mask; `${VAR}` in nguyên vì là tên biến. |
@@ -501,8 +502,8 @@ Các lệnh này chạy ngoài Pi.
501
502
  | Command | Dùng khi nào |
502
503
  |---|---|
503
504
  | `npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.84.1` | Cài Pi CLI tương thích với release hiện tại. |
504
- | `npm install -g --ignore-scripts @piagent/platform@1.3.1` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
505
- | `pi install git:github.com/Vt-mmm/piagent@v1.3.1` | Cài pinned release khi cần reproducible team setup. |
505
+ | `npm install -g --ignore-scripts @piagent/platform@1.4.1` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
506
+ | `pi install git:github.com/Vt-mmm/piagent@v1.4.1` | Cài pinned release khi cần reproducible team setup. |
506
507
  | `pi install git:github.com/Vt-mmm/piagent` | Cài latest package platform cho máy cá nhân/sandbox. |
507
508
  | `piagent-update --check` | Báo version hiện tại vs version sẽ lên cho cả ba thành phần; không cài gì. |
508
509
  | `piagent-update` | Full update global một lệnh cho cả máy: Pi host → npm-global helper → Pi package, đúng thứ tự release yêu cầu. |
@@ -533,7 +534,7 @@ Các lệnh này chạy ngoài Pi.
533
534
  | `piagent-route --prompt-file <file> --execute --yes -- --approve` | Explicit prelaunch adaptive task; giữ hard pin và fail closed nếu preflight/catalog không đủ. |
534
535
  | `piagent-model-scope --preset full` | Re-apply full provider model scope. |
535
536
  | `piagent-mcp --preset core --scope global --replace` | Apply the governed MCP core baseline: Context7, Chrome DevTools, GitHub. |
536
- | `piagent-mcp --preset popular --scope global --replace` | Apply the governed MCP popular baseline: core + Playwright + Figma remote. |
537
+ | `piagent-mcp --preset popular --scope global --replace` | Apply the governed MCP popular baseline: core + Playwright + Figma desktop. |
537
538
  | `piagent-mcp --list` | List MCP presets. |
538
539
  | `piagent-subagents --preset safe` | Re-apply subagent safe config. |
539
540
  | `pi install npm:pi-web-access@0.17.0` | Cấp web/search/fetch tools cho builtin `researcher`; platform setup/update cài mặc định từ `v1.2.8`. |
@@ -1,4 +1,5 @@
1
1
  # Pi Context Engine
2
+ <!-- language: vi; english-index: docs-site/content/en/context-engine.html -->
2
3
 
3
4
  ## Mục tiêu
4
5
 
@@ -1,4 +1,5 @@
1
1
  # Context-window policy
2
+ <!-- language: vi; english-index: docs-site/content/en/runtime.html -->
2
3
 
3
4
  ## Mục tiêu
4
5
 
@@ -1,4 +1,5 @@
1
1
  # Distribution standard
2
+ <!-- language: vi; english-index: docs-site/content/en/team.html -->
2
3
 
3
4
  ## Nguyên tắc
4
5
 
@@ -14,9 +15,9 @@ Repo này phải chạy được cho nhiều project/domain khác nhau. Vì vậ
14
15
 
15
16
  | Use case | Package source |
16
17
  |---|---|
17
- | Team pinned release | `git:github.com/Vt-mmm/piagent@v1.3.1` |
18
+ | Team pinned release | `git:github.com/Vt-mmm/piagent@v1.4.1` |
18
19
  | Personal/sandbox dev | `git:github.com/Vt-mmm/piagent` |
19
- | Registry distribution | `npm:@piagent/platform@1.3.1` |
20
+ | Registry distribution | `npm:@piagent/platform@1.4.1` |
20
21
  | Enterprise npm (fork under another scope) | `npm:@your-scope/platform@x.y.z` |
21
22
  | Local platform dev | `/path/to/piagent` |
22
23
 
@@ -26,7 +27,7 @@ Latest tiện cho máy cá nhân muốn nhận cập nhật nhanh. Pin tag/commi
26
27
 
27
28
  | Channel | Command | Target | Policy |
28
29
  |---|---|---|---|
29
- | `stable` | `bash scripts/install-global.sh --stable` | Helper release tag resolved to commit SHA, currently `v1.3.1` | Install the Pi package matching the helper. |
30
+ | `stable` | `bash scripts/install-global.sh --stable` | Helper release tag resolved to commit SHA, currently `v1.4.1` | Install the Pi package matching the helper. |
30
31
  | `exact` | `bash scripts/install-global.sh --version vX.Y.Z --resolve-tag` | Requested tag resolved to commit SHA | Pi-package-only rollout, rollback, and incident recovery. |
31
32
  | `dev` | `bash scripts/install-global.sh --dev` | Moving Git source | Personal/sandbox only; do not commit into project settings. |
32
33
  | `local` | `bash scripts/install-global.sh --local` | Current checkout path | Platform development only. |
@@ -53,7 +54,7 @@ Root `package.json` có `pi` manifest trỏ tới:
53
54
  Do đó team có thể:
54
55
 
55
56
  ```bash
56
- pi install git:github.com/Vt-mmm/piagent@v1.3.1
57
+ pi install git:github.com/Vt-mmm/piagent@v1.4.1
57
58
  ```
58
59
 
59
60
  Không cần biết internal folder `packages/piagent-core`. Source không pin chỉ dành cho personal/sandbox như bảng channel ở trên.
@@ -65,12 +66,12 @@ Team nên install global package một lần:
65
66
  ```bash
66
67
  node --version # >= 22.19.0
67
68
  npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.84.1
68
- npm install -g --ignore-scripts @piagent/platform@1.3.1
69
+ npm install -g --ignore-scripts @piagent/platform@1.4.1
69
70
  piagent-install --stable --dry-run
70
71
  piagent-install --stable
71
72
  ```
72
73
 
73
- `pi install git:github.com/Vt-mmm/piagent@v1.3.1` vẫn hợp lệ nếu chỉ cần cài Pi package. Lệnh đó không tự tạo các binary terminal `piagent-*`; muốn có helper global thì dùng `npm install -g --ignore-scripts @piagent/platform@1.3.1`.
74
+ `pi install git:github.com/Vt-mmm/piagent@v1.4.1` vẫn hợp lệ nếu chỉ cần cài Pi package. Lệnh đó không tự tạo các binary terminal `piagent-*`; muốn có helper global thì dùng `npm install -g --ignore-scripts @piagent/platform@1.4.1`.
74
75
 
75
76
  Support matrix hiện tại: macOS Apple Silicon + Bash và Linux x64 + Bash đã được verify; macOS Intel + Bash và Linux ARM64 + Bash là supported target cần chạy smoke trước rollout; native Windows chưa phải target rollout team; WSL2 experimental. Chi tiết và version runtime nằm trong [release/install policy](release-install-policy.md).
76
77
 
@@ -120,7 +121,7 @@ Nếu muốn commit sẵn `.pi/piagent-profile.json` vào repo hoặc bootstrap
120
121
  ```bash
121
122
  bash scripts/setup.sh /path/to/project \
122
123
  --profile be-readonly-fe \
123
- --package-source git:github.com/Vt-mmm/piagent@v1.3.1 \
124
+ --package-source git:github.com/Vt-mmm/piagent@v1.4.1 \
124
125
  --mcp-preset core \
125
126
  --subagents-preset safe
126
127
  ```
@@ -43,9 +43,22 @@ The machine-readable rule is `architecture/layers.json`; `npm run architecture:c
43
43
  | Capabilities | `packages/piagent-core/capabilities/` | Profile resolution, pack validation, locks, source roots | Pi session lifecycle |
44
44
  | Security foundation | `packages/piagent-core/security/` | Sensitive-data primitives | Workflow behavior |
45
45
  | Benchmark | `packages/piagent-core/benchmark/`, `benchmarks/` | Suite validation, scoring, evidence | Runtime enforcement |
46
+ | WebUI contracts | `packages/piagent-webui/contracts/` | Wire types shared by browser and server | Any runtime behavior; it depends on nothing |
47
+ | WebUI client | `packages/piagent-webui/client/` | Browser views, view models, UI preferences | Server state, filesystem, Pi APIs |
48
+ | WebUI server | `packages/piagent-webui/server/` | HTTP/WS endpoints, session reads, diff assembly | Browser rendering; it may not import the client |
49
+ | WebUI extension | `packages/piagent-webui/extension/` | The in-Pi `/piagent-webui` command surface | Wire types the client also needs |
50
+ | WebUI gateway | `packages/piagent-webui/gateway/` | Standalone `piagent dashboard` process, port and lifecycle | Feature logic that belongs to the server |
51
+ | WebUI ownership | `packages/piagent-webui/ownership/` | Single-owner claims over a session directory | Transport and rendering; it depends on nothing |
52
+ | WebUI build | `packages/piagent-webui/` (package root) | Bundling the client and packaging the served assets | Source of any one WebUI layer |
46
53
  | Entrypoints | `scripts/` | CLI arguments and use-case invocation | Duplicate domain logic |
47
54
  | Product assets | `prompts/`, `skills/`, `subagents/`, `adapters/`, `packs/`, `schemas/` | Declarative behavior and contracts | Hidden runtime state |
48
55
 
56
+ The WebUI layers are a second dependency spine, not a branch of the first. `contracts` and
57
+ `ownership` sit at the bottom and import nothing; `client` may only reach `contracts`, so the
58
+ browser bundle can never pull in server or Pi code. `server`, `extension`, and `gateway` reach
59
+ down into `runtime`/`core`/`security` — never the reverse, so the platform runs headless with
60
+ the WebUI absent. `npm run architecture:check` enforces every edge above.
61
+
49
62
  `extensions/` still contains several historical service modules. The name is legacy; only `piagent-guard.ts` is loaded as a Pi extension. Services move by cohesive feature, with compatibility preserved until the migration is complete.
50
63
 
51
64
  ## Runtime flow
@@ -1,4 +1,5 @@
1
1
  # Herdr workflow
2
+ <!-- language: vi; english-index: docs-site/content/en/workflows.html -->
2
3
 
3
4
  ## Mục tiêu
4
5
 
@@ -19,22 +19,38 @@
19
19
  {
20
20
  "topic": "repository-readme",
21
21
  "en": "README.md",
22
- "vi": "README.vi.md"
22
+ "vi": "README.vi.md",
23
+ "consistentAt": {
24
+ "en": "03bcb10e6bb051fe2ccf9feeb6bf9bb9eec99bc0",
25
+ "vi": "a7eba50acf4215883d704af10c9df0cd69f06599"
26
+ }
23
27
  },
24
28
  {
25
29
  "topic": "documentation-index",
26
30
  "en": "docs/en/README.md",
27
- "vi": "docs/vi/README.md"
31
+ "vi": "docs/vi/README.md",
32
+ "consistentAt": {
33
+ "en": "659e68ecd362bbef6cbce5a4b3fa86d4bd52f2a4",
34
+ "vi": "d8686c9e11aa79faecae658d7275ca14c628de18"
35
+ }
28
36
  },
29
37
  {
30
38
  "topic": "architecture",
31
39
  "en": "docs/en/architecture.md",
32
- "vi": "docs/vi/architecture.md"
40
+ "vi": "docs/vi/architecture.md",
41
+ "consistentAt": {
42
+ "en": "5bcb0aa311b360408ca73425744baee71e740a9b",
43
+ "vi": "b613cec25fa1737636121c11cb2c5aecb2e00375"
44
+ }
33
45
  },
34
46
  {
35
47
  "topic": "maintainer-guide",
36
48
  "en": "docs/en/maintainer-guide.md",
37
- "vi": "docs/vi/maintainer-guide.md"
49
+ "vi": "docs/vi/maintainer-guide.md",
50
+ "consistentAt": {
51
+ "en": "e04ab2a64da66c59fbc2f52b472db481815c6ea5",
52
+ "vi": "8ce84e7221156cfa3882e29d50045be989d1ea7d"
53
+ }
38
54
  }
39
55
  ]
40
56
  }