@piagent/platform 1.2.13 → 1.2.14
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.
- package/CHANGELOG.md +26 -0
- package/README.md +11 -3
- package/README.vi.md +90 -0
- package/architecture/layers.json +117 -0
- package/docs/README.md +23 -0
- package/docs/architecture.md +7 -61
- package/docs/command-reference-vietnamese.md +6 -6
- package/docs/distribution-standard.md +7 -7
- package/docs/en/README.md +13 -0
- package/docs/en/architecture.md +81 -0
- package/docs/en/maintainer-guide.md +121 -0
- package/docs/languages.json +40 -0
- package/docs/operator-manual-vietnamese.md +7 -7
- package/docs/package-architecture-notes.md +9 -0
- package/docs/release-install-policy.md +6 -6
- package/docs/security-threat-model.md +1 -1
- package/docs/team-onboarding.md +2 -2
- package/docs/vi/README.md +13 -0
- package/docs/vi/architecture.md +81 -0
- package/docs/vi/maintainer-guide.md +121 -0
- package/docs-site/architecture.html +38 -14
- package/docs-site/benchmark.html +3 -1
- package/docs-site/commands.html +3 -1
- package/docs-site/content/architecture.html +35 -13
- package/docs-site/context-engine.html +3 -1
- package/docs-site/index.html +3 -1
- package/docs-site/mcp-approval.html +3 -1
- package/docs-site/mcp-auth.html +3 -1
- package/docs-site/mcp-servers.html +3 -1
- package/docs-site/mcp.html +3 -1
- package/docs-site/permissions.html +3 -1
- package/docs-site/profiles.html +3 -1
- package/docs-site/quickstart.html +3 -1
- package/docs-site/runtime.html +3 -1
- package/docs-site/scope.html +3 -1
- package/docs-site/security.html +3 -1
- package/docs-site/team.html +3 -1
- package/docs-site/workflows.html +3 -1
- package/package.json +5 -1
- package/packages/piagent-core/README.md +6 -2
- package/packages/piagent-core/capabilities/capability-core.js +3 -0
- package/packages/piagent-core/capabilities/runtime-integrity.js +18 -0
- package/packages/piagent-core/extensions/guard-types.ts +0 -37
- package/packages/piagent-core/extensions/piagent-guard.ts +170 -2099
- package/packages/piagent-core/extensions/task-state.js +22 -3
- package/packages/piagent-core/package.json +1 -1
- package/packages/piagent-core/runtime/hooks/agent-start-hook.ts +213 -0
- package/packages/piagent-core/runtime/hooks/completion-hook.ts +203 -0
- package/packages/piagent-core/runtime/hooks/input-hook.ts +122 -0
- package/packages/piagent-core/runtime/hooks/session-hooks.ts +104 -0
- package/packages/piagent-core/runtime/hooks/session-start-hook.ts +140 -0
- package/packages/piagent-core/runtime/hooks/tool-result-hook.ts +316 -0
- package/packages/piagent-core/runtime/input/chat-images.ts +299 -0
- package/packages/piagent-core/runtime/runtime-limits.ts +21 -0
- package/packages/piagent-core/runtime/session/message-signals.ts +64 -0
- package/packages/piagent-core/runtime/session/runtime-state.ts +175 -0
- package/packages/piagent-core/runtime/session/system-prompt.ts +52 -0
- package/packages/piagent-core/runtime/session/tool-result-compaction.ts +352 -0
- package/packages/piagent-core/runtime/session/usage.ts +178 -0
- package/packages/piagent-core/runtime/tools/tool-groups.ts +86 -0
- package/packages/piagent-core/runtime/workflows/input-routing.ts +113 -0
- package/packages/piagent-core/runtime/workflows/task-intake.ts +73 -0
- package/scripts/build-docs-site.mjs +4 -1
- package/scripts/check-architecture.mjs +132 -0
- package/scripts/check-doc-languages.mjs +67 -0
- package/scripts/verify-local.sh +31 -0
package/docs-site/commands.html
CHANGED
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.14 docs · VI</span>
|
|
31
|
+
<a class="button" href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
31
32
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
33
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
34
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -194,6 +195,7 @@
|
|
|
194
195
|
<div class="footer-links" aria-label="External links">
|
|
195
196
|
<a href="https://piagent.io.vn" target="_blank" rel="noopener noreferrer">piagent.io.vn</a>
|
|
196
197
|
<a href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer">GitHub repository</a>
|
|
198
|
+
<a href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
197
199
|
<a href="https://www.facebook.com/vinhtam0544/" target="_blank" rel="noopener noreferrer">Facebook profile</a>
|
|
198
200
|
</div>
|
|
199
201
|
</footer>
|
|
@@ -1,29 +1,51 @@
|
|
|
1
1
|
<section class="section">
|
|
2
|
-
|
|
2
|
+
<div class="callout">
|
|
3
|
+
<strong>Chiều dependency được enforce bằng code.</strong>
|
|
4
|
+
<p><span class="inline-code">architecture/layers.json</span> là rule máy đọc; <span class="inline-code">npm run architecture:check</span> chặn dependency ngược và file vượt budget.</p>
|
|
5
|
+
</div>
|
|
3
6
|
<div class="grid cols-3">
|
|
4
7
|
<article class="card">
|
|
5
|
-
<h3 id="
|
|
6
|
-
<p><span class="inline-code">
|
|
8
|
+
<h3 id="composition">Composition</h3>
|
|
9
|
+
<p><span class="inline-code">piagent-guard.ts</span> chỉ giữ wiring, registration order và shared runtime state. File này không được tiếp tục chứa feature algorithm.</p>
|
|
7
10
|
</article>
|
|
8
11
|
<article class="card">
|
|
9
|
-
<h3 id="adapters">
|
|
10
|
-
<p><span class="inline-code">
|
|
12
|
+
<h3 id="runtime-adapters">Runtime adapters</h3>
|
|
13
|
+
<p><span class="inline-code">packages/piagent-core/runtime</span> quản lý Pi hook, command, tool, session UI, usage, log compaction và workflow input routing.</p>
|
|
11
14
|
</article>
|
|
12
15
|
<article class="card">
|
|
13
|
-
<h3 id="
|
|
14
|
-
<p
|
|
16
|
+
<h3 id="core-services">Core services</h3>
|
|
17
|
+
<p>Policy, task, context và state trả về structured decision. Core service không import runtime adapter hay Pi composition root.</p>
|
|
15
18
|
</article>
|
|
16
19
|
<article class="card">
|
|
17
|
-
<h3 id="
|
|
18
|
-
<p>
|
|
20
|
+
<h3 id="integrations">Integrations</h3>
|
|
21
|
+
<p><span class="inline-code">mcp/</span>, <span class="inline-code">capabilities/</span> và <span class="inline-code">security/</span> có ownership riêng; không nhúng task workflow vào integration.</p>
|
|
19
22
|
</article>
|
|
20
23
|
<article class="card">
|
|
21
|
-
<h3 id="
|
|
22
|
-
<p>
|
|
24
|
+
<h3 id="entrypoints">Entrypoints</h3>
|
|
25
|
+
<p><span class="inline-code">scripts/</span> parse CLI argument rồi gọi use case. Metric, policy và state transition không được duplicate trong CLI.</p>
|
|
23
26
|
</article>
|
|
24
27
|
<article class="card">
|
|
25
|
-
<h3 id="
|
|
26
|
-
<p><span class="inline-code">
|
|
28
|
+
<h3 id="product-assets">Product assets</h3>
|
|
29
|
+
<p><span class="inline-code">prompts/</span>, <span class="inline-code">skills/</span>, <span class="inline-code">subagents/</span>, <span class="inline-code">adapters/</span>, <span class="inline-code">packs/</span> và <span class="inline-code">schemas/</span> là declarative assets.</p>
|
|
27
30
|
</article>
|
|
28
31
|
</div>
|
|
29
32
|
</section>
|
|
33
|
+
|
|
34
|
+
<section class="section">
|
|
35
|
+
<div class="section-head">
|
|
36
|
+
<p class="eyebrow">Ownership</p>
|
|
37
|
+
<h2 id="state-ownership">Một state chỉ có một source of truth</h2>
|
|
38
|
+
<p>Project profile và lock có thể commit. Task evidence, telemetry, trace, capture và session history là local state. Derived index phải có policy digest và rebuild được.</p>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="table-wrap">
|
|
41
|
+
<table>
|
|
42
|
+
<thead><tr><th>State</th><th>Owner</th><th>Vị trí</th><th>Commit</th></tr></thead>
|
|
43
|
+
<tbody>
|
|
44
|
+
<tr><td>Project profile + lock</td><td>Project</td><td><span class="inline-code">.pi/piagent-profile*.json</span></td><td>Có</td></tr>
|
|
45
|
+
<tr><td>Task, trace, telemetry, capture</td><td>Runtime</td><td><span class="inline-code">.pi/piagent-state/</span></td><td>Không</td></tr>
|
|
46
|
+
<tr><td>Session history</td><td>Pi</td><td>Pi session store</td><td>Không</td></tr>
|
|
47
|
+
<tr><td>Shared instructions</td><td>Project</td><td><span class="inline-code">AGENTS.md</span>, project docs</td><td>Có</td></tr>
|
|
48
|
+
</tbody>
|
|
49
|
+
</table>
|
|
50
|
+
</div>
|
|
51
|
+
</section>
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.14 docs · VI</span>
|
|
31
|
+
<a class="button" href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
31
32
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
33
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
34
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -164,6 +165,7 @@ piagent-context efficiency</code></pre>
|
|
|
164
165
|
<div class="footer-links" aria-label="External links">
|
|
165
166
|
<a href="https://piagent.io.vn" target="_blank" rel="noopener noreferrer">piagent.io.vn</a>
|
|
166
167
|
<a href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer">GitHub repository</a>
|
|
168
|
+
<a href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
167
169
|
<a href="https://www.facebook.com/vinhtam0544/" target="_blank" rel="noopener noreferrer">Facebook profile</a>
|
|
168
170
|
</div>
|
|
169
171
|
</footer>
|
package/docs-site/index.html
CHANGED
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.14 docs · VI</span>
|
|
31
|
+
<a class="button" href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
31
32
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
33
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
34
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -180,6 +181,7 @@ piagent-setup</code></pre>
|
|
|
180
181
|
<div class="footer-links" aria-label="External links">
|
|
181
182
|
<a href="https://piagent.io.vn" target="_blank" rel="noopener noreferrer">piagent.io.vn</a>
|
|
182
183
|
<a href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer">GitHub repository</a>
|
|
184
|
+
<a href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
183
185
|
<a href="https://www.facebook.com/vinhtam0544/" target="_blank" rel="noopener noreferrer">Facebook profile</a>
|
|
184
186
|
</div>
|
|
185
187
|
</footer>
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.14 docs · VI</span>
|
|
31
|
+
<a class="button" href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
31
32
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
33
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
34
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -243,6 +244,7 @@
|
|
|
243
244
|
<div class="footer-links" aria-label="External links">
|
|
244
245
|
<a href="https://piagent.io.vn" target="_blank" rel="noopener noreferrer">piagent.io.vn</a>
|
|
245
246
|
<a href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer">GitHub repository</a>
|
|
247
|
+
<a href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
246
248
|
<a href="https://www.facebook.com/vinhtam0544/" target="_blank" rel="noopener noreferrer">Facebook profile</a>
|
|
247
249
|
</div>
|
|
248
250
|
</footer>
|
package/docs-site/mcp-auth.html
CHANGED
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.14 docs · VI</span>
|
|
31
|
+
<a class="button" href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
31
32
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
33
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
34
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -186,6 +187,7 @@ NEED docker: installed but the daemon is not responding
|
|
|
186
187
|
<div class="footer-links" aria-label="External links">
|
|
187
188
|
<a href="https://piagent.io.vn" target="_blank" rel="noopener noreferrer">piagent.io.vn</a>
|
|
188
189
|
<a href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer">GitHub repository</a>
|
|
190
|
+
<a href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
189
191
|
<a href="https://www.facebook.com/vinhtam0544/" target="_blank" rel="noopener noreferrer">Facebook profile</a>
|
|
190
192
|
</div>
|
|
191
193
|
</footer>
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.14 docs · VI</span>
|
|
31
|
+
<a class="button" href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
31
32
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
33
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
34
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -221,6 +222,7 @@ internal project stdio npx -y @acme/internal-mcp pen
|
|
|
221
222
|
<div class="footer-links" aria-label="External links">
|
|
222
223
|
<a href="https://piagent.io.vn" target="_blank" rel="noopener noreferrer">piagent.io.vn</a>
|
|
223
224
|
<a href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer">GitHub repository</a>
|
|
225
|
+
<a href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
224
226
|
<a href="https://www.facebook.com/vinhtam0544/" target="_blank" rel="noopener noreferrer">Facebook profile</a>
|
|
225
227
|
</div>
|
|
226
228
|
</footer>
|
package/docs-site/mcp.html
CHANGED
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.14 docs · VI</span>
|
|
31
|
+
<a class="button" href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
31
32
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
33
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
34
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -230,6 +231,7 @@
|
|
|
230
231
|
<div class="footer-links" aria-label="External links">
|
|
231
232
|
<a href="https://piagent.io.vn" target="_blank" rel="noopener noreferrer">piagent.io.vn</a>
|
|
232
233
|
<a href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer">GitHub repository</a>
|
|
234
|
+
<a href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
233
235
|
<a href="https://www.facebook.com/vinhtam0544/" target="_blank" rel="noopener noreferrer">Facebook profile</a>
|
|
234
236
|
</div>
|
|
235
237
|
</footer>
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.14 docs · VI</span>
|
|
31
|
+
<a class="button" href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
31
32
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
33
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
34
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -164,6 +165,7 @@
|
|
|
164
165
|
<div class="footer-links" aria-label="External links">
|
|
165
166
|
<a href="https://piagent.io.vn" target="_blank" rel="noopener noreferrer">piagent.io.vn</a>
|
|
166
167
|
<a href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer">GitHub repository</a>
|
|
168
|
+
<a href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
167
169
|
<a href="https://www.facebook.com/vinhtam0544/" target="_blank" rel="noopener noreferrer">Facebook profile</a>
|
|
168
170
|
</div>
|
|
169
171
|
</footer>
|
package/docs-site/profiles.html
CHANGED
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.14 docs · VI</span>
|
|
31
|
+
<a class="button" href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
31
32
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
33
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
34
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -178,6 +179,7 @@
|
|
|
178
179
|
<div class="footer-links" aria-label="External links">
|
|
179
180
|
<a href="https://piagent.io.vn" target="_blank" rel="noopener noreferrer">piagent.io.vn</a>
|
|
180
181
|
<a href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer">GitHub repository</a>
|
|
182
|
+
<a href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
181
183
|
<a href="https://www.facebook.com/vinhtam0544/" target="_blank" rel="noopener noreferrer">Facebook profile</a>
|
|
182
184
|
</div>
|
|
183
185
|
</footer>
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.14 docs · VI</span>
|
|
31
|
+
<a class="button" href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
31
32
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
33
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
34
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -255,6 +256,7 @@ piagent-uninstall --apply</code></pre>
|
|
|
255
256
|
<div class="footer-links" aria-label="External links">
|
|
256
257
|
<a href="https://piagent.io.vn" target="_blank" rel="noopener noreferrer">piagent.io.vn</a>
|
|
257
258
|
<a href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer">GitHub repository</a>
|
|
259
|
+
<a href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
258
260
|
<a href="https://www.facebook.com/vinhtam0544/" target="_blank" rel="noopener noreferrer">Facebook profile</a>
|
|
259
261
|
</div>
|
|
260
262
|
</footer>
|
package/docs-site/runtime.html
CHANGED
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.14 docs · VI</span>
|
|
31
|
+
<a class="button" href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
31
32
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
33
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
34
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -171,6 +172,7 @@ npm run typecheck</code></pre>
|
|
|
171
172
|
<div class="footer-links" aria-label="External links">
|
|
172
173
|
<a href="https://piagent.io.vn" target="_blank" rel="noopener noreferrer">piagent.io.vn</a>
|
|
173
174
|
<a href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer">GitHub repository</a>
|
|
175
|
+
<a href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
174
176
|
<a href="https://www.facebook.com/vinhtam0544/" target="_blank" rel="noopener noreferrer">Facebook profile</a>
|
|
175
177
|
</div>
|
|
176
178
|
</footer>
|
package/docs-site/scope.html
CHANGED
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.14 docs · VI</span>
|
|
31
|
+
<a class="button" href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
31
32
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
33
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
34
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -181,6 +182,7 @@
|
|
|
181
182
|
<div class="footer-links" aria-label="External links">
|
|
182
183
|
<a href="https://piagent.io.vn" target="_blank" rel="noopener noreferrer">piagent.io.vn</a>
|
|
183
184
|
<a href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer">GitHub repository</a>
|
|
185
|
+
<a href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
184
186
|
<a href="https://www.facebook.com/vinhtam0544/" target="_blank" rel="noopener noreferrer">Facebook profile</a>
|
|
185
187
|
</div>
|
|
186
188
|
</footer>
|
package/docs-site/security.html
CHANGED
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.14 docs · VI</span>
|
|
31
|
+
<a class="button" href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
31
32
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
33
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
34
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -162,6 +163,7 @@
|
|
|
162
163
|
<div class="footer-links" aria-label="External links">
|
|
163
164
|
<a href="https://piagent.io.vn" target="_blank" rel="noopener noreferrer">piagent.io.vn</a>
|
|
164
165
|
<a href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer">GitHub repository</a>
|
|
166
|
+
<a href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
165
167
|
<a href="https://www.facebook.com/vinhtam0544/" target="_blank" rel="noopener noreferrer">Facebook profile</a>
|
|
166
168
|
</div>
|
|
167
169
|
</footer>
|
package/docs-site/team.html
CHANGED
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.14 docs · VI</span>
|
|
31
|
+
<a class="button" href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
31
32
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
33
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
34
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -129,6 +130,7 @@
|
|
|
129
130
|
<div class="footer-links" aria-label="External links">
|
|
130
131
|
<a href="https://piagent.io.vn" target="_blank" rel="noopener noreferrer">piagent.io.vn</a>
|
|
131
132
|
<a href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer">GitHub repository</a>
|
|
133
|
+
<a href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
132
134
|
<a href="https://www.facebook.com/vinhtam0544/" target="_blank" rel="noopener noreferrer">Facebook profile</a>
|
|
133
135
|
</div>
|
|
134
136
|
</footer>
|
package/docs-site/workflows.html
CHANGED
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
<span>Pi Agent Platform</span>
|
|
28
28
|
</a>
|
|
29
29
|
<div class="top-actions">
|
|
30
|
-
<span class="pill"><span class="pill-dot"></span>v1.2.
|
|
30
|
+
<span class="pill"><span class="pill-dot"></span>v1.2.14 docs · VI</span>
|
|
31
|
+
<a class="button" href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
31
32
|
<a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
|
|
32
33
|
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
33
34
|
<path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -157,6 +158,7 @@
|
|
|
157
158
|
<div class="footer-links" aria-label="External links">
|
|
158
159
|
<a href="https://piagent.io.vn" target="_blank" rel="noopener noreferrer">piagent.io.vn</a>
|
|
159
160
|
<a href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer">GitHub repository</a>
|
|
161
|
+
<a href="https://github.com/Vt-mmm/piagent/blob/main/docs/en/README.md" lang="en" target="_blank" rel="noopener noreferrer">English docs</a>
|
|
160
162
|
<a href="https://www.facebook.com/vinhtam0544/" target="_blank" rel="noopener noreferrer">Facebook profile</a>
|
|
161
163
|
</div>
|
|
162
164
|
</footer>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@piagent/platform",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.14",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
"CONTRIBUTING.md",
|
|
28
28
|
"LICENSE",
|
|
29
29
|
"README.md",
|
|
30
|
+
"README.vi.md",
|
|
30
31
|
"SECURITY.md",
|
|
32
|
+
"architecture/",
|
|
31
33
|
".gitattributes",
|
|
32
34
|
"adapters/",
|
|
33
35
|
"benchmarks/",
|
|
@@ -122,6 +124,8 @@
|
|
|
122
124
|
"site:build": "node scripts/build-docs-site.mjs",
|
|
123
125
|
"site:preview": "node scripts/preview-docs-site.mjs",
|
|
124
126
|
"site:check": "node scripts/check-published-site.mjs",
|
|
127
|
+
"architecture:check": "node scripts/check-architecture.mjs",
|
|
128
|
+
"docs:check": "node scripts/check-doc-languages.mjs",
|
|
125
129
|
"smoke": "bash scripts/runtime-policy-smoke.sh",
|
|
126
130
|
"usage": "bash scripts/pi-session-stats.sh",
|
|
127
131
|
"auto": "bash scripts/pi-auto.sh",
|
|
@@ -4,7 +4,9 @@ Shared Pi package for reusable project workflows.
|
|
|
4
4
|
|
|
5
5
|
## Contents
|
|
6
6
|
|
|
7
|
-
- `extensions/piagent-guard.ts`:
|
|
7
|
+
- `extensions/piagent-guard.ts`: Pi extension composition root and registration order.
|
|
8
|
+
- `runtime/`: Pi-facing session, usage, log-compaction, and workflow input adapters. New command/tool/hook modules belong here.
|
|
9
|
+
- `extensions/*.js|ts`: legacy-location core services for policy, context, task lifecycle, state, and document intake; only `piagent-guard.ts` is loaded as an extension.
|
|
8
10
|
- `prompts/*.md`: workflow aliases that intentionally launch an agent turn.
|
|
9
11
|
- `skills/piagent-ops/SKILL.md`: operator-invoked reference for manual intake, recovery, and high-risk controls; routine runtime-managed tasks do not advertise or load it.
|
|
10
12
|
- `skills/piagent-source-cache/`: local cache for user-provided external source repositories.
|
|
@@ -15,6 +17,8 @@ Shared Pi package for reusable project workflows.
|
|
|
15
17
|
- compact tool-result rendering: oversized redacted output is previewed in Pi and captured under `.pi/piagent-state/tool-results/` for offline audit/reporting.
|
|
16
18
|
- local Context Engine v2: incremental FTS5/symbol/import index, hybrid retrieval, token-budgeted packs, bounded current-turn source/test snapshots, test-impact mapping, dynamic Piagent tools, and Agent Watch compatible telemetry.
|
|
17
19
|
|
|
20
|
+
Architecture boundaries and non-growth file budgets are enforced by `npm run architecture:check`. See [English architecture](../../docs/en/architecture.md), [kiến trúc tiếng Việt](../../docs/vi/architecture.md), and the paired maintainer guides before adding a new runtime surface.
|
|
21
|
+
|
|
18
22
|
The root package exposes `piagent-benchmark` for an automatic paired Piagent
|
|
19
23
|
steady-state benchmark against Raw Pi or the `codex-cli` surface. Treatment
|
|
20
24
|
onboarding/context preparation happens before measured model usage;
|
|
@@ -99,7 +103,7 @@ groups load only when requested.
|
|
|
99
103
|
- `/commands`: runtime menu/help for terminal, Pi, MCP, model, memory, session, context, permission, and subagent commands.
|
|
100
104
|
- `/workflow`: one launcher for task, scout, BE-to-FE, discuss, plan, review, commit, PR, platform-improve, and onboarding workflows.
|
|
101
105
|
- `/usage`: runtime usage namespace for live snapshot, history hint, preflight, compact, compact-log captures, and context efficiency.
|
|
102
|
-
- `/name`: set the current session name for Agent Watch/report mapping.
|
|
106
|
+
- Pi native `/name`: set the current session name for Agent Watch/report mapping; Piagent observes the native rename event and keeps `/setname` as a compatibility alias.
|
|
103
107
|
- `/fresh`: open a fresh governed session for `task`, `scout`, or `be-to-fe`.
|
|
104
108
|
- `/context`: runtime context namespace for index/rebuild/search/pack/test-impact/efficiency, task preflight, and semantic compact.
|
|
105
109
|
- `/permission`: runtime permission namespace for status/read-only/workspace-write/full-access.
|
|
@@ -3,6 +3,7 @@ import fs from "node:fs";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { containsSensitiveText } from "../security/sensitive-data.js";
|
|
5
5
|
import { resolveProjectProfileDocument } from "./project-profile.js";
|
|
6
|
+
import { CORE_RUNTIME_INTEGRITY_FILES } from "./runtime-integrity.js";
|
|
6
7
|
|
|
7
8
|
const API_VERSION = "piagent/v1";
|
|
8
9
|
const CORE_API_VERSION = 1;
|
|
@@ -788,6 +789,7 @@ function buildCoreIntegrity(root) {
|
|
|
788
789
|
"packages/piagent-core/package.json",
|
|
789
790
|
"packages/piagent-core/policies/base-policy.json",
|
|
790
791
|
"packages/piagent-core/capabilities/capability-core.js",
|
|
792
|
+
"packages/piagent-core/capabilities/runtime-integrity.js",
|
|
791
793
|
// capability-sources.js decides which external trees become readable packs,
|
|
792
794
|
// so tampering with it changes which code the profile can grant.
|
|
793
795
|
"packages/piagent-core/capabilities/capability-sources.js",
|
|
@@ -796,6 +798,7 @@ function buildCoreIntegrity(root) {
|
|
|
796
798
|
"packages/piagent-core/capabilities/project-profile.js",
|
|
797
799
|
"packages/piagent-core/security/sensitive-data.js",
|
|
798
800
|
"packages/piagent-core/extensions/piagent-guard.ts",
|
|
801
|
+
...CORE_RUNTIME_INTEGRITY_FILES,
|
|
799
802
|
// context-engine.js decides which repository content enters the model
|
|
800
803
|
// context and records the resulting telemetry, so it is part of the
|
|
801
804
|
// runtime trust boundary enforced by the profile lock.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const CORE_RUNTIME_INTEGRITY_FILES = Object.freeze([
|
|
2
|
+
"packages/piagent-core/runtime/hooks/agent-start-hook.ts",
|
|
3
|
+
"packages/piagent-core/runtime/hooks/completion-hook.ts",
|
|
4
|
+
"packages/piagent-core/runtime/hooks/input-hook.ts",
|
|
5
|
+
"packages/piagent-core/runtime/hooks/session-hooks.ts",
|
|
6
|
+
"packages/piagent-core/runtime/hooks/session-start-hook.ts",
|
|
7
|
+
"packages/piagent-core/runtime/hooks/tool-result-hook.ts",
|
|
8
|
+
"packages/piagent-core/runtime/input/chat-images.ts",
|
|
9
|
+
"packages/piagent-core/runtime/runtime-limits.ts",
|
|
10
|
+
"packages/piagent-core/runtime/session/message-signals.ts",
|
|
11
|
+
"packages/piagent-core/runtime/session/runtime-state.ts",
|
|
12
|
+
"packages/piagent-core/runtime/session/system-prompt.ts",
|
|
13
|
+
"packages/piagent-core/runtime/session/tool-result-compaction.ts",
|
|
14
|
+
"packages/piagent-core/runtime/session/usage.ts",
|
|
15
|
+
"packages/piagent-core/runtime/tools/tool-groups.ts",
|
|
16
|
+
"packages/piagent-core/runtime/workflows/input-routing.ts",
|
|
17
|
+
"packages/piagent-core/runtime/workflows/task-intake.ts"
|
|
18
|
+
]);
|
|
@@ -391,43 +391,6 @@ export type EffectiveProtectedPaths = {
|
|
|
391
391
|
readOnlyPaths: string[];
|
|
392
392
|
};
|
|
393
393
|
|
|
394
|
-
export type UsageSnapshot = {
|
|
395
|
-
sessionFile?: string;
|
|
396
|
-
sessionId?: string;
|
|
397
|
-
sessionName?: string;
|
|
398
|
-
cwd: string;
|
|
399
|
-
mode: string;
|
|
400
|
-
model: string;
|
|
401
|
-
thinkingLevel: string;
|
|
402
|
-
entries: {
|
|
403
|
-
total: number;
|
|
404
|
-
branch: number;
|
|
405
|
-
};
|
|
406
|
-
contextUsage?: {
|
|
407
|
-
tokens: number | null;
|
|
408
|
-
contextWindow: number;
|
|
409
|
-
percent: number | null;
|
|
410
|
-
};
|
|
411
|
-
exactTotals: {
|
|
412
|
-
availableInCommand: false;
|
|
413
|
-
howToRead: string[];
|
|
414
|
-
};
|
|
415
|
-
};
|
|
416
|
-
|
|
417
|
-
export type ContextPreflight = {
|
|
418
|
-
workflow: string;
|
|
419
|
-
inputChars: number;
|
|
420
|
-
inputTokenEstimate: number;
|
|
421
|
-
liveContext?: UsageSnapshot["contextUsage"];
|
|
422
|
-
projectedContext?: {
|
|
423
|
-
tokens: number;
|
|
424
|
-
percent: number;
|
|
425
|
-
};
|
|
426
|
-
recommendation: "ok" | "watch" | "compact" | "fresh-session" | "unknown";
|
|
427
|
-
reason: string;
|
|
428
|
-
commands: string[];
|
|
429
|
-
};
|
|
430
|
-
|
|
431
394
|
export type ReferenceRepo = {
|
|
432
395
|
host: string;
|
|
433
396
|
owner: string;
|