@piagent/platform 1.14.0 → 1.15.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 (68) hide show
  1. package/CHANGELOG.md +11 -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 +12 -0
  16. package/docs-site/content/index.html +4 -4
  17. package/docs-site/content/whats-new.html +12 -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 +13 -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 +13 -1
  53. package/docs-site/windows.html +1 -1
  54. package/docs-site/workflows.html +1 -1
  55. package/evals/private-holdout-v1/public-exposure.v2.json +2 -2
  56. package/package.json +1 -1
  57. package/packages/piagent-core/managed/broker-client.mjs +7 -1
  58. package/packages/piagent-core/managed/helper-run.mjs +2 -2
  59. package/packages/piagent-core/managed/sandbox-diagnostic.mjs +3 -0
  60. package/packages/piagent-core/managed/session.mjs +2 -2
  61. package/packages/piagent-core/managed/tool-boundary.mjs +5 -1
  62. package/packages/piagent-core/package.json +1 -1
  63. package/packages/piagent-core/runtime/managed-failure.mjs +9 -1
  64. package/packages/piagent-webui/dist/client/assets/{MarkdownMessage-CyT2G1H2.js → MarkdownMessage-PIk4Femi.js} +1 -1
  65. package/packages/piagent-webui/dist/client/assets/{index-BBEa7Ger.js → index-DeCt-FaN.js} +12 -12
  66. package/packages/piagent-webui/dist/client/index.html +1 -1
  67. package/packages/piagent-webui/gateway/pi-host.ts +16 -2
  68. package/scripts/update-global.mjs +7 -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-BBEa7Ger.js"></script>
10
+ <script type="module" crossorigin src="/assets/index-DeCt-FaN.js"></script>
11
11
  <link rel="stylesheet" crossorigin href="/assets/index-Z91z6SlN.css">
12
12
  </head>
13
13
  <body>
@@ -28,9 +28,23 @@ export function installedPiHostRoot(): string {
28
28
  } catch {
29
29
  // The operator installation is normally global.
30
30
  }
31
+ const windows = process.platform === "win32";
32
+ if (windows) {
33
+ // npm's global prefix is configurable (CI commonly uses C:\npm\prefix).
34
+ // Read the package beside each PATH entry directly: where.exe may be
35
+ // unavailable in a restricted launcher, and an earlier stale shim must
36
+ // not hide a valid installation later on PATH. Windows env keys ignore case.
37
+ const environment = Object.fromEntries(Object.entries(process.env).map(([key, value]) => [key.toLowerCase(), value]));
38
+ const prefixes = [...(environment.path ?? "").split(";"), environment.npm_config_prefix];
39
+ for (const value of prefixes) {
40
+ const prefix = value?.trim().replace(/^"(.*)"$/, "$1");
41
+ if (!prefix || !path.isAbsolute(prefix)) continue;
42
+ const found = packageRootFrom(path.join(prefix, "node_modules", "@earendil-works", "pi-coding-agent", "package.json"));
43
+ if (found) return found;
44
+ }
45
+ }
31
46
  try {
32
- const windows = process.platform === "win32";
33
- const executable = execFileSync(windows ? "where" : "which", ["pi"], { encoding: "utf8", timeout: 2_000, stdio: ["ignore", "pipe", "ignore"] }).trim().split(/\r?\n/)[0];
47
+ const executable = execFileSync(windows ? "where.exe" : "which", ["pi"], { encoding: "utf8", timeout: 2_000, stdio: ["ignore", "pipe", "ignore"] }).trim().split(/\r?\n/)[0];
34
48
  // npm on Windows puts the pi.cmd shim in the global prefix and the package
35
49
  // in node_modules beside it.
36
50
  const found = packageRootFrom(fs.realpathSync(executable))
@@ -423,7 +423,8 @@ function main() {
423
423
  fail(`${HELPER_PACKAGE}@${targetHelper} does not pin an exact ${HOST_PACKAGE} version, so the host cannot be updated safely.`);
424
424
  }
425
425
 
426
- const helperNeedsChange = options.force || currentHelper !== targetHelper;
426
+ // npm exec is temporary even when its version already matches the target.
427
+ const helperNeedsChange = options.force || currentHelper !== targetHelper || isNpxCacheRoot(platformRoot);
427
428
  const hostNeedsChange = options.host && (options.force || currentHost !== targetHost);
428
429
 
429
430
  console.log("Pi Agent Platform update");
@@ -475,6 +476,11 @@ function main() {
475
476
  }
476
477
  }
477
478
 
479
+ // Refuse an impossible package installation before replacing either global.
480
+ if (options.package && !options.host && effectiveHost !== targetHost) {
481
+ fail(`--no-host cannot install this Pi package: active Pi is ${effectiveHost ?? "missing"}, but v${targetHelper} requires ${targetHost}. Rerun without --no-host.`);
482
+ }
483
+
478
484
  // Host first: piagent-install refuses to run against a host that does not match
479
485
  // the version its package.json pins, so a helper installed ahead of the host
480
486
  // would fail on its very next step.