@piagent/platform 1.40.0 → 1.41.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 (86) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +1 -1
  3. package/README.vi.md +1 -1
  4. package/architecture/layers.json +10 -0
  5. package/docs/command-reference-vietnamese.md +2 -2
  6. package/docs/distribution-standard.md +6 -6
  7. package/docs/en/architecture.md +1 -0
  8. package/docs/languages.json +4 -4
  9. package/docs/operator-manual-vietnamese.md +7 -7
  10. package/docs/publishing-for-teams.md +1 -0
  11. package/docs/release-install-policy.md +2 -2
  12. package/docs/team-onboarding.md +2 -2
  13. package/docs/vi/architecture.md +1 -0
  14. package/docs-site/architecture.html +1 -1
  15. package/docs-site/benchmark.html +1 -1
  16. package/docs-site/commands.html +1 -1
  17. package/docs-site/content/en/index.html +4 -4
  18. package/docs-site/content/en/whats-new.html +6 -0
  19. package/docs-site/content/index.html +4 -4
  20. package/docs-site/content/whats-new.html +6 -0
  21. package/docs-site/context-engine.html +1 -1
  22. package/docs-site/ecosystem.html +1 -1
  23. package/docs-site/en/architecture.html +1 -1
  24. package/docs-site/en/benchmark.html +1 -1
  25. package/docs-site/en/commands.html +1 -1
  26. package/docs-site/en/context-engine.html +1 -1
  27. package/docs-site/en/ecosystem.html +1 -1
  28. package/docs-site/en/index.html +5 -5
  29. package/docs-site/en/mcp-approval.html +1 -1
  30. package/docs-site/en/mcp-auth.html +1 -1
  31. package/docs-site/en/mcp-servers.html +1 -1
  32. package/docs-site/en/mcp.html +1 -1
  33. package/docs-site/en/permissions.html +1 -1
  34. package/docs-site/en/profiles.html +1 -1
  35. package/docs-site/en/quickstart.html +1 -1
  36. package/docs-site/en/runtime.html +1 -1
  37. package/docs-site/en/scope.html +1 -1
  38. package/docs-site/en/security.html +1 -1
  39. package/docs-site/en/team.html +1 -1
  40. package/docs-site/en/whats-new.html +7 -1
  41. package/docs-site/en/windows.html +1 -1
  42. package/docs-site/en/workflows.html +1 -1
  43. package/docs-site/index.html +5 -5
  44. package/docs-site/mcp-approval.html +1 -1
  45. package/docs-site/mcp-auth.html +1 -1
  46. package/docs-site/mcp-servers.html +1 -1
  47. package/docs-site/mcp.html +1 -1
  48. package/docs-site/permissions.html +1 -1
  49. package/docs-site/profiles.html +1 -1
  50. package/docs-site/quickstart.html +1 -1
  51. package/docs-site/runtime.html +1 -1
  52. package/docs-site/scope.html +1 -1
  53. package/docs-site/security.html +1 -1
  54. package/docs-site/team.html +1 -1
  55. package/docs-site/whats-new.html +7 -1
  56. package/docs-site/windows.html +1 -1
  57. package/docs-site/workflows.html +1 -1
  58. package/evals/fixtures/piagent-webui/document-asset-v1.invalid.json +12 -0
  59. package/evals/fixtures/piagent-webui/document-asset-v1.valid.json +12 -0
  60. package/evals/private-holdout-v1/public-exposure.v2.json +2 -2
  61. package/package.json +1 -1
  62. package/packages/piagent-core/package.json +1 -1
  63. package/packages/piagent-core/runtime/inspection/document-workspace-projection.ts +78 -15
  64. package/packages/piagent-core/skills/fe-change-report/SKILL.md +175 -0
  65. package/packages/piagent-core/skills/fe-change-report/scripts/build-report.mjs +183 -0
  66. package/packages/piagent-core/skills/fe-change-report/scripts/capture.mjs +150 -0
  67. package/packages/piagent-core/skills/fe-change-report/scripts/diff-regions.mjs +110 -0
  68. package/packages/piagent-webui/dist/client/assets/{MarkdownMessage-BpoF2k2-.js → MarkdownMessage-DeLo-xiz.js} +1 -1
  69. package/packages/piagent-webui/dist/client/assets/{TerminalPanel-Dg3eghy4.js → TerminalPanel-BG-DP_qm.js} +2 -2
  70. package/packages/piagent-webui/dist/client/assets/{TerminalView-Dw9xqakv.js → TerminalView-r9rG24IO.js} +1 -1
  71. package/packages/piagent-webui/dist/client/assets/{WorkspaceCodeEditor-DtwXZAgK.js → WorkspaceCodeEditor-BnqaR3pK.js} +1 -1
  72. package/packages/piagent-webui/dist/client/assets/{WorkspaceExplorer-WS-yLlnb.js → WorkspaceExplorer-BIxwiGtl.js} +3 -3
  73. package/packages/piagent-webui/dist/client/assets/{WorkspaceQuickOpen-CYCY-s44.js → WorkspaceQuickOpen-CK3dILhQ.js} +1 -1
  74. package/packages/piagent-webui/dist/client/assets/index-DBUTrEXi.css +1 -0
  75. package/packages/piagent-webui/dist/client/assets/index-rlyRccut.js +102 -0
  76. package/packages/piagent-webui/dist/client/assets/{tab-close-CqPDs-w5.js → tab-close-BoJRyBO_.js} +1 -1
  77. package/packages/piagent-webui/dist/client/index.html +2 -2
  78. package/packages/piagent-webui/extension/piagent-webui.ts +1 -0
  79. package/packages/piagent-webui/server/core-inspection-provider.ts +5 -0
  80. package/packages/piagent-webui/server/ipc-read-model-client.ts +1 -0
  81. package/packages/piagent-webui/server/read-model-provider.ts +1 -0
  82. package/packages/piagent-webui/server/read-only-router.ts +6 -0
  83. package/schemas/piagent-webui/catalog-v1.json +9 -0
  84. package/schemas/piagent-webui/document-asset-v1.schema.json +57 -0
  85. package/packages/piagent-webui/dist/client/assets/index-BgJgso6j.js +0 -102
  86. package/packages/piagent-webui/dist/client/assets/index-Brs_HjIo.css +0 -1
@@ -1 +1 @@
1
- import{D as e}from"./ui-preferences-BO3AV7QE.js";import{m as t}from"./Alert-DGWhP2MM.js";import{E as n}from"./index-BgJgso6j.js";var r=e(),i=t((0,r.jsx)(`path`,{d:`M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`}),`Close`);function a(e,t,a){let o=e=>{e.stopPropagation(),e.preventDefault(),a()};return(0,r.jsxs)(n,{component:`span`,sx:{display:`inline-flex`,alignItems:`center`,gap:.75},children:[(0,r.jsx)(`span`,{children:e}),(0,r.jsx)(n,{component:`span`,role:`button`,tabIndex:0,"aria-label":t,title:t,onClick:o,onMouseDown:e=>e.stopPropagation(),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&o(e)},sx:{display:`inline-grid`,placeItems:`center`,width:18,height:18,borderRadius:`2px`,opacity:.7,"&:hover":{opacity:1,bgcolor:`action.hover`}},children:(0,r.jsx)(i,{sx:{fontSize:14}})})]})}export{i as n,a as t};
1
+ import{D as e}from"./ui-preferences-BO3AV7QE.js";import{m as t}from"./Alert-DGWhP2MM.js";import{E as n}from"./index-rlyRccut.js";var r=e(),i=t((0,r.jsx)(`path`,{d:`M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`}),`Close`);function a(e,t,a){let o=e=>{e.stopPropagation(),e.preventDefault(),a()};return(0,r.jsxs)(n,{component:`span`,sx:{display:`inline-flex`,alignItems:`center`,gap:.75},children:[(0,r.jsx)(`span`,{children:e}),(0,r.jsx)(n,{component:`span`,role:`button`,tabIndex:0,"aria-label":t,title:t,onClick:o,onMouseDown:e=>e.stopPropagation(),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&o(e)},sx:{display:`inline-grid`,placeItems:`center`,width:18,height:18,borderRadius:`2px`,opacity:.7,"&:hover":{opacity:1,bgcolor:`action.hover`}},children:(0,r.jsx)(i,{sx:{fontSize:14}})})]})}export{i as n,a as t};
@@ -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-BgJgso6j.js"></script>
10
+ <script type="module" crossorigin src="/assets/index-rlyRccut.js"></script>
11
11
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
12
12
  <link rel="modulepreload" crossorigin href="/assets/ui-preferences-BO3AV7QE.js">
13
13
  <link rel="modulepreload" crossorigin href="/assets/useId-DEefKUAT.js">
@@ -16,7 +16,7 @@
16
16
  <link rel="modulepreload" crossorigin href="/assets/DialogTitle-CyaFPaiW.js">
17
17
  <link rel="modulepreload" crossorigin href="/assets/Button-QItfZUNj.js">
18
18
  <link rel="modulepreload" crossorigin href="/assets/bootstrap-CedkNtRG.js">
19
- <link rel="stylesheet" crossorigin href="/assets/index-Brs_HjIo.css">
19
+ <link rel="stylesheet" crossorigin href="/assets/index-DBUTrEXi.css">
20
20
  </head>
21
21
  <body>
22
22
  <div id="root"></div>
@@ -155,6 +155,7 @@ function readMethod(provider: CoreInspectionProvider, queue: HeldMessageQueue, s
155
155
  if (method === "releaseMonitor" && args.length === 0) return provider.releaseMonitor();
156
156
  if (method === "documents" && args.length === 0) return provider.documents();
157
157
  if (method === "document" && args.length === 1 && typeof args[0] === "string" && REF.test(args[0])) return provider.document(args[0]);
158
+ if (method === "documentAsset" && args.length === 2 && typeof args[0] === "string" && REF.test(args[0]) && typeof args[1] === "string" && REF.test(args[1])) return provider.documentAsset(args[0], args[1]);
158
159
  if (method === "logPreview" && args.length === 1 && typeof args[0] === "string" && REF.test(args[0])) return provider.logPreview(args[0]);
159
160
  if (method === "transcript" && args.length === 2 && (args[0] === null || typeof args[0] === "string" && REF.test(args[0]))
160
161
  && Number.isInteger(args[1]) && Number(args[1]) >= 1 && Number(args[1]) <= 200) return provider.transcript(args[0] as string | null, Number(args[1]));
@@ -246,6 +246,11 @@ export class CoreInspectionProvider implements WebUiReadModelProvider {
246
246
  return core.projectDocumentWorkspaceDocument({ ...this.#documentWorkspaceInput(core.matchesProtectedPath), documentRef });
247
247
  }
248
248
 
249
+ async documentAsset(documentRef: string, name: string): Promise<unknown> {
250
+ const core = await loadCoreInspection();
251
+ return core.projectDocumentWorkspaceAsset({ ...this.#documentWorkspaceInput(core.matchesProtectedPath), documentRef, name });
252
+ }
253
+
249
254
  #documentWorkspaceInput(matchesProtectedPath: (candidate: string, patterns: string[]) => unknown) {
250
255
  const protectedPaths = this.#input.protectedPaths?.() ?? [];
251
256
  return { cwd: this.#input.cwd, profileRoots: this.#input.documentReadRoots?.(),
@@ -64,6 +64,7 @@ export class IpcReadModelClient implements WebUiReadModelProvider {
64
64
  releaseMonitor(): Promise<unknown> { return this.#request("releaseMonitor"); }
65
65
  documents(): Promise<unknown> { return this.#request("documents"); }
66
66
  document(documentRef: string): Promise<unknown> { return this.#request("document", [documentRef]); }
67
+ documentAsset(documentRef: string, name: string): Promise<unknown> { return this.#request("documentAsset", [documentRef, name]); }
67
68
  activity(): Promise<unknown> { return this.#request("activity"); }
68
69
  logPreview(activityRef: string): Promise<unknown> { return this.#request("logPreview", [activityRef]); }
69
70
  transcript(beforeCursor: string | null, limit: number): Promise<unknown> { return this.#request("transcript", [beforeCursor, limit]); }
@@ -27,6 +27,7 @@ export type WebUiReadModelProvider = {
27
27
  releaseMonitor(): unknown | Promise<unknown>;
28
28
  documents(): unknown | Promise<unknown>;
29
29
  document(documentRef: string): unknown | Promise<unknown>;
30
+ documentAsset?(documentRef: string, name: string): unknown | Promise<unknown>;
30
31
  activity(): unknown | Promise<unknown>;
31
32
  logPreview(activityRef: string): unknown | Promise<unknown>;
32
33
  transcript(beforeCursor: string | null, limit: number): unknown | Promise<unknown>;
@@ -33,6 +33,12 @@ export async function routeReadOnlyRequest(url: URL, provider: WebUiReadModelPro
33
33
  return { handled: true, status: 200, value: await provider.subagentTree(ref) };
34
34
  }
35
35
  if (url.pathname === "/api/v1/documents" && !url.search) return { handled: true, status: 200, value: await provider.documents() };
36
+ const asset = /^\/api\/v1\/documents\/([^/]+)\/assets\/([^/]+)$/.exec(url.pathname);
37
+ if (asset) {
38
+ if (url.search || !OPAQUE_REF.test(asset[1]) || !OPAQUE_REF.test(asset[2])) return { handled: true, status: 400, value: { error: { code: "invalid-document-asset-ref" } } };
39
+ if (!provider.documentAsset) return { handled: true, status: 503, value: { error: { code: "document-asset-unavailable" } } };
40
+ return { handled: true, status: 200, value: await provider.documentAsset(asset[1], asset[2]) };
41
+ }
36
42
  if (url.pathname.startsWith("/api/v1/documents/")) {
37
43
  const ref = url.pathname.slice("/api/v1/documents/".length);
38
44
  if (url.search || !OPAQUE_REF.test(ref) || ref.includes("/")) return { handled: true, status: 400, value: { error: { code: "invalid-document-ref" } } };
@@ -182,6 +182,15 @@
182
182
  "supported": true,
183
183
  "current": true
184
184
  },
185
+ {
186
+ "name": "document-asset-v1",
187
+ "file": "document-asset-v1.schema.json",
188
+ "id": "https://piagent.io.vn/schemas/piagent-webui/document-asset-v1.schema.json",
189
+ "documentVersion": 1,
190
+ "role": "read-model",
191
+ "supported": true,
192
+ "current": true
193
+ },
185
194
  {
186
195
  "name": "control-command-v1",
187
196
  "file": "control-command-v1.schema.json",
@@ -0,0 +1,57 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://piagent.io.vn/schemas/piagent-webui/document-asset-v1.schema.json",
4
+ "title": "Piagent WebUI change report screenshot v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "version", "generatedAt", "documentRef", "name", "state", "mediaType", "sizeBytes", "base64", "reasonCode"],
8
+ "properties": {
9
+ "schemaVersion": { "const": 1 },
10
+ "version": { "const": "piagent-webui-document-asset-v1" },
11
+ "generatedAt": { "$ref": "common-v1.schema.json#/$defs/timestamp" },
12
+ "documentRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
13
+ "name": {
14
+ "anyOf": [
15
+ { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^(before|after|diff)-[a-z0-9][a-z0-9-]{0,100}\\.png$" },
16
+ { "type": "null" }
17
+ ]
18
+ },
19
+ "state": { "enum": ["ready", "unavailable"] },
20
+ "mediaType": { "enum": ["image/png", null] },
21
+ "sizeBytes": {
22
+ "anyOf": [
23
+ { "type": "integer", "minimum": 8, "maximum": 8388608 },
24
+ { "type": "null" }
25
+ ]
26
+ },
27
+ "base64": {
28
+ "anyOf": [
29
+ { "type": "string", "minLength": 12, "maxLength": 11184812, "pattern": "^[A-Za-z0-9+/]+={0,2}$" },
30
+ { "type": "null" }
31
+ ]
32
+ },
33
+ "reasonCode": { "$ref": "common-v1.schema.json#/$defs/nullableReasonCode" }
34
+ },
35
+ "allOf": [
36
+ {
37
+ "if": { "properties": { "state": { "const": "ready" } }, "required": ["state"] },
38
+ "then": {
39
+ "properties": {
40
+ "name": { "type": "string" },
41
+ "mediaType": { "const": "image/png" },
42
+ "sizeBytes": { "type": "integer" },
43
+ "base64": { "type": "string" },
44
+ "reasonCode": { "type": "null" }
45
+ }
46
+ },
47
+ "else": {
48
+ "properties": {
49
+ "mediaType": { "type": "null" },
50
+ "sizeBytes": { "type": "null" },
51
+ "base64": { "type": "null" },
52
+ "reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" }
53
+ }
54
+ }
55
+ }
56
+ ]
57
+ }