@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@piagent/platform",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -60,7 +60,8 @@
60
60
  "piagent-capabilities": "scripts/piagent-cli.mjs",
61
61
  "piagent-migrate": "scripts/piagent-cli.mjs",
62
62
  "piagent-import-instructions": "scripts/piagent-cli.mjs",
63
- "piagent-auto": "scripts/piagent-cli.mjs"
63
+ "piagent-auto": "scripts/piagent-cli.mjs",
64
+ "piagent-context": "scripts/piagent-cli.mjs"
64
65
  },
65
66
  "pi": {
66
67
  "extensions": [
@@ -12,6 +12,7 @@ Shared Pi package for reusable project workflows.
12
12
  - `policies/base-policy.json`: default runtime policy, including protected path and shell protected path defaults.
13
13
  - input hook support for local screenshot/image paths pasted into chat; supported images are attached as `[image1]`, `[image2]`, ...
14
14
  - compact tool-result rendering: oversized redacted output is previewed in Pi and captured under `.pi/piagent-state/tool-results/` for offline audit/reporting.
15
+ - local Context Engine v2: incremental FTS5/symbol/import index, hybrid retrieval, token-budgeted packs, test-impact mapping, dynamic Piagent tools, and Agent Watch compatible telemetry.
15
16
 
16
17
  ## Trusted run wrapper
17
18
 
@@ -46,6 +47,8 @@ Legacy aliases still work: `/permission-status`, `/read-only`, `/workspace-write
46
47
 
47
48
  ## Runtime quality tools
48
49
 
50
+ - `piagent_tools`
51
+ - `piagent_context_engine`
49
52
  - `piagent_permission_status`
50
53
  - `piagent_exec_policy_check`
51
54
  - `piagent_context_budget`
@@ -77,10 +80,10 @@ Legacy aliases still work: `/permission-status`, `/read-only`, `/workspace-write
77
80
 
78
81
  - `/commands`: runtime menu/help for terminal, Pi, MCP, model, memory, session, context, permission, and subagent commands.
79
82
  - `/workflow`: one launcher for task, scout, BE-to-FE, discuss, plan, review, commit, PR, platform-improve, and onboarding workflows.
80
- - `/usage`: runtime usage namespace for live snapshot, history hint, preflight, compact, and compact-log captures.
83
+ - `/usage`: runtime usage namespace for live snapshot, history hint, preflight, compact, compact-log captures, and context efficiency.
81
84
  - `/name`: set the current session name for Agent Watch/report mapping.
82
85
  - `/fresh`: open a fresh governed session for `task`, `scout`, or `be-to-fe`.
83
- - `/context`: runtime context namespace for context index status/search, task preflight, and compact.
86
+ - `/context`: runtime context namespace for index/rebuild/search/pack/test-impact/efficiency, task preflight, and semantic compact.
84
87
  - `/permission`: runtime permission namespace for status/read-only/workspace-write/full-access.
85
88
  - `/onboard`: runtime onboarding namespace; `run` launches the first-read onboarding workflow.
86
89
  - `/context-index`: legacy alias for `/context index/search`.
@@ -136,6 +139,9 @@ Runtime task tools write local state to:
136
139
  - `.pi/memory/MEMORY.md` when the user explicitly asks Pi to remember durable information; generated projects ignore this file by default
137
140
  - `.pi/piagent-state/observed-bash.jsonl`
138
141
  - `.pi/piagent-state/traces.jsonl`
142
+ - `.pi/piagent-state/context-engine/context-v2.sqlite`
143
+ - `.pi/piagent-state/context-engine/events.jsonl`
144
+ - `.pi/piagent-state/context-engine/efficiency-report.json`
139
145
  - `.pi/task-inbox/*.md` for oversized local task intake; generated projects ignore this directory by default
140
146
  - Pi custom session entry `piagent-task-trace`
141
147
 
@@ -796,6 +796,10 @@ function buildCoreIntegrity(root) {
796
796
  "packages/piagent-core/capabilities/project-profile.js",
797
797
  "packages/piagent-core/security/sensitive-data.js",
798
798
  "packages/piagent-core/extensions/piagent-guard.ts",
799
+ // context-engine.js decides which repository content enters the model
800
+ // context and records the resulting telemetry, so it is part of the
801
+ // runtime trust boundary enforced by the profile lock.
802
+ "packages/piagent-core/extensions/context-engine.js",
799
803
  // guard-io.js loads the project profile and guard-shell-analysis.ts decides
800
804
  // what a command is about to reach, so tampering with either changes what
801
805
  // the guard enforces. guard-types.ts is deliberately absent: it is erased