@piagent/platform 1.2.5 → 1.2.7

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 (53) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +3 -2
  3. package/catalog/capabilities.json +4 -4
  4. package/docs/command-reference-vietnamese.md +9 -8
  5. package/docs/context-engine.md +177 -0
  6. package/docs/context-window-policy.md +13 -8
  7. package/docs/distribution-standard.md +7 -7
  8. package/docs/operator-manual-vietnamese.md +7 -7
  9. package/docs/publishing-for-teams.md +5 -0
  10. package/docs/quality-benchmark.md +14 -1
  11. package/docs/release-install-policy.md +7 -7
  12. package/docs/runtime-harness-standard.md +16 -7
  13. package/docs/security-threat-model.md +1 -1
  14. package/docs/subagents-and-multiagent.md +1 -1
  15. package/docs/task-lifecycle-vietnamese.md +4 -4
  16. package/docs/team-onboarding.md +2 -2
  17. package/docs/usage-observability.md +6 -0
  18. package/docs-site/architecture.html +4 -3
  19. package/docs-site/commands.html +2 -1
  20. package/docs-site/content/context-engine.html +47 -0
  21. package/docs-site/context-engine.html +171 -0
  22. package/docs-site/index.html +2 -1
  23. package/docs-site/mcp-approval.html +2 -1
  24. package/docs-site/mcp-auth.html +2 -1
  25. package/docs-site/mcp-servers.html +2 -1
  26. package/docs-site/mcp.html +2 -1
  27. package/docs-site/permissions.html +2 -1
  28. package/docs-site/profiles.html +2 -1
  29. package/docs-site/quickstart.html +2 -1
  30. package/docs-site/runtime.html +4 -3
  31. package/docs-site/scope.html +2 -1
  32. package/docs-site/security.html +2 -1
  33. package/docs-site/team.html +2 -1
  34. package/docs-site/workflows.html +2 -1
  35. package/package.json +3 -2
  36. package/packages/piagent-core/README.md +8 -2
  37. package/packages/piagent-core/capabilities/capability-core.js +4 -0
  38. package/packages/piagent-core/extensions/context-engine.js +1175 -0
  39. package/packages/piagent-core/extensions/piagent-guard.ts +785 -17
  40. package/packages/piagent-core/package.json +1 -1
  41. package/packages/piagent-core/policies/base-policy.json +2 -0
  42. package/packages/piagent-core/prompts/scout.md +10 -24
  43. package/packages/piagent-core/prompts/task.md +25 -45
  44. package/scripts/audit-runtime-host.sh +3 -3
  45. package/scripts/build-docs-site.mjs +6 -0
  46. package/scripts/check-runtime-advisories.mjs +4 -3
  47. package/scripts/context-engine.mjs +115 -0
  48. package/scripts/install-global.sh +68 -13
  49. package/scripts/piagent-cli.mjs +2 -1
  50. package/scripts/quality-benchmark.sh +71 -1
  51. package/scripts/setup.sh +5 -3
  52. package/scripts/team-doctor.sh +2 -2
  53. package/scripts/verify-local.sh +12 -4
package/scripts/setup.sh CHANGED
@@ -397,9 +397,9 @@ if [[ "$DO_GLOBAL" == true ]]; then
397
397
  ensure_pi_cli
398
398
  install_args=("$PLATFORM_ROOT/scripts/install-global.sh" "--package-source" "$PACKAGE_SOURCE")
399
399
  # The opt-out has to be passed explicitly. The installer defaults MCP on, so
400
- # saying nothing here would install it against the operator's choice; the
401
- # flags below can stay one-sided only because the installer defaults them off.
402
- #
400
+ # saying nothing here would install it against the operator's choice.
401
+ # Subagents also needs an explicit opt-out because the installer now preserves
402
+ # an existing install during updates.
403
403
  if [[ "$WITH_MCP" == true ]]; then
404
404
  install_args+=("--with-mcp" "--mcp-preset" "$MCP_PRESET")
405
405
  else
@@ -407,6 +407,8 @@ if [[ "$DO_GLOBAL" == true ]]; then
407
407
  fi
408
408
  if [[ "$WITH_SUBAGENTS" == true ]]; then
409
409
  install_args+=("--with-subagents" "--subagents-preset" "$SUBAGENTS_PRESET" "--subagents-model-scope" "$SUBAGENTS_MODEL_SCOPE")
410
+ else
411
+ install_args+=("--no-subagents")
410
412
  fi
411
413
  if [[ "$WITH_WEB_ACCESS" == true ]]; then
412
414
  install_args+=("--with-web-access")
@@ -229,8 +229,8 @@ if (commandExists("pi")) {
229
229
  const combined = `${piList.stdout ?? ""}\n${piList.stderr ?? ""}`;
230
230
  piHasMcpAdapter = combined.includes("pi-mcp-adapter");
231
231
  piHasSubagents = combined.includes("pi-subagents");
232
- if (!piHasMcpAdapter) warnings.push("Pi MCP adapter not found in `pi list`; run setup with --with-mcp or `pi install npm:pi-mcp-adapter@2.11.0`");
233
- if (!piHasSubagents) warnings.push("Pi subagents package not found in `pi list`; run setup with --with-subagents or `pi install npm:pi-subagents@0.35.1`");
232
+ if (!piHasMcpAdapter) warnings.push("Pi MCP adapter not found in `pi list`; run setup with --with-mcp or `pi install npm:pi-mcp-adapter@2.15.0`");
233
+ if (!piHasSubagents) warnings.push("Pi subagents package not found in `pi list`; run setup with --with-subagents or `pi install npm:pi-subagents@0.38.0`");
234
234
  }
235
235
 
236
236
  const mcpFiles = [
@@ -51,6 +51,7 @@ required_files=(
51
51
  "$ROOT/.pi/project-context.md"
52
52
  "$ROOT/packages/piagent-core/package.json"
53
53
  "$ROOT/packages/piagent-core/extensions/piagent-guard.ts"
54
+ "$ROOT/packages/piagent-core/extensions/context-engine.js"
54
55
  "$ROOT/packages/piagent-core/extensions/policy-core.js"
55
56
  "$ROOT/packages/piagent-core/extensions/redaction-core.js"
56
57
  "$ROOT/packages/piagent-core/extensions/runtime-evidence.js"
@@ -115,6 +116,7 @@ required_files=(
115
116
  "$ROOT/docs/publishing-for-teams.md"
116
117
  "$ROOT/docs/herdr-workflow.md"
117
118
  "$ROOT/docs/runtime-harness-standard.md"
119
+ "$ROOT/docs/context-engine.md"
118
120
  "$ROOT/docs/task-implementation-contract.md"
119
121
  "$ROOT/docs/runtime-quality-baseline.md"
120
122
  "$ROOT/docs/quality-benchmark.md"
@@ -128,9 +130,11 @@ required_files=(
128
130
  "$ROOT/docs-site/assets/docs.css"
129
131
  "$ROOT/docs-site/assets/docs.js"
130
132
  "$ROOT/docs-site/content/index.html"
133
+ "$ROOT/docs-site/content/context-engine.html"
131
134
  "$ROOT/docs-site/content/mcp.html"
132
135
  "$ROOT/docs-site/vercel.json"
133
136
  "$ROOT/scripts/build-docs-site.mjs"
137
+ "$ROOT/scripts/context-engine.mjs"
134
138
  "$ROOT/scripts/preview-docs-site.mjs"
135
139
  "$ROOT/schemas/project-profile.schema.json"
136
140
  "$ROOT/schemas/task-contract.schema.json"
@@ -171,6 +175,8 @@ required_files=(
171
175
  "$ROOT/scripts/import-agent-instructions.mjs"
172
176
  "$ROOT/tests/capability-core.test.mjs"
173
177
  "$ROOT/tests/piagent-guard-integration.test.mjs"
178
+ "$ROOT/tests/context-engine.test.mjs"
179
+ "$ROOT/tests/workflow-prompts.test.mjs"
174
180
  "$ROOT/tests/install-global.test.mjs"
175
181
  "$ROOT/tests/package-distribution.test.mjs"
176
182
  "$ROOT/tests/release-identity.test.mjs"
@@ -338,11 +344,11 @@ require_documented "auto-delegation" "$ROOT/README.md" "$ROOT/docs" "$ROOT/packa
338
344
  require_documented "Subagents used/not used" "$ROOT/packages/piagent-core/prompts" "$ROOT/docs/auto-delegation-policy.md"
339
345
  require_documented "Subagent orchestration capabilities" "$ROOT/README.md" "$ROOT/docs/subagent-orchestration-capabilities.md"
340
346
  require_documented "pi-web-access" "$ROOT/README.md" "$ROOT/docs" "$ROOT/scripts/install-global.sh" "$ROOT/scripts/setup.sh"
341
- grep -F 'PI_MCP_ADAPTER_SOURCE="npm:pi-mcp-adapter@2.11.0"' "$ROOT/scripts/install-global.sh" >/dev/null
342
- grep -F 'PI_SUBAGENTS_SOURCE="npm:pi-subagents@0.35.1"' "$ROOT/scripts/install-global.sh" >/dev/null
347
+ grep -F 'PI_MCP_ADAPTER_SOURCE="npm:pi-mcp-adapter@2.15.0"' "$ROOT/scripts/install-global.sh" >/dev/null
348
+ grep -F 'PI_SUBAGENTS_SOURCE="npm:pi-subagents@0.38.0"' "$ROOT/scripts/install-global.sh" >/dev/null
343
349
  grep -F 'PI_WEB_ACCESS_SOURCE="npm:pi-web-access@0.13.0"' "$ROOT/scripts/install-global.sh" >/dev/null
344
- grep -F 'PI_MCP_ADAPTER_VERSION="2.11.0"' "$ROOT/scripts/audit-runtime-host.sh" >/dev/null
345
- grep -F 'PI_SUBAGENTS_VERSION="0.35.1"' "$ROOT/scripts/audit-runtime-host.sh" >/dev/null
350
+ grep -F 'PI_MCP_ADAPTER_VERSION="2.15.0"' "$ROOT/scripts/audit-runtime-host.sh" >/dev/null
351
+ grep -F 'PI_SUBAGENTS_VERSION="0.38.0"' "$ROOT/scripts/audit-runtime-host.sh" >/dev/null
346
352
  grep -F 'PI_WEB_ACCESS_VERSION="0.13.0"' "$ROOT/scripts/audit-runtime-host.sh" >/dev/null
347
353
  node --input-type=module - "$ROOT/scripts/install-global.sh" "$ROOT/scripts/audit-runtime-host.sh" <<'NODE'
348
354
  import fs from "node:fs";
@@ -538,6 +544,7 @@ if grep -R -E -i \
538
544
  fi
539
545
 
540
546
  node --check "$ROOT/packages/piagent-core/extensions/piagent-guard.ts" >/dev/null
547
+ node --check "$ROOT/packages/piagent-core/extensions/context-engine.js" >/dev/null
541
548
  node --check "$ROOT/packages/piagent-core/extensions/policy-core.js" >/dev/null
542
549
  node --check "$ROOT/packages/piagent-core/extensions/redaction-core.js" >/dev/null
543
550
  node --check "$ROOT/packages/piagent-core/extensions/runtime-evidence.js" >/dev/null
@@ -546,6 +553,7 @@ node --check "$ROOT/packages/piagent-core/capabilities/capability-core.js" >/dev
546
553
  node --check "$ROOT/packages/piagent-core/capabilities/capability-sources.js" >/dev/null
547
554
  node --check "$ROOT/scripts/capability-catalog.mjs" >/dev/null
548
555
  node --check "$ROOT/scripts/piagent-cli.mjs" >/dev/null
556
+ node --check "$ROOT/scripts/context-engine.mjs" >/dev/null
549
557
  node --check "$ROOT/scripts/pi-usage-history.mjs" >/dev/null
550
558
  node --check "$ROOT/scripts/migrate-project-state.mjs" >/dev/null
551
559
  node --check "$ROOT/scripts/import-agent-instructions.mjs" >/dev/null