@piagent/platform 1.1.6 → 1.1.8
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 +22 -0
- package/README.md +1 -1
- package/docs/capability-packs.md +22 -1
- package/docs/command-reference-vietnamese.md +3 -2
- package/docs/distribution-standard.md +7 -7
- package/docs/operator-manual-vietnamese.md +7 -7
- package/docs/project-adapters.md +23 -0
- package/docs/publishing-for-teams.md +2 -0
- package/docs/release-install-policy.md +6 -6
- package/docs/security-threat-model.md +11 -1
- package/docs/team-onboarding.md +11 -3
- package/docs-site/index.html +2 -2
- package/package.json +2 -2
- package/packages/piagent-core/capabilities/capability-core.js +110 -8
- package/packages/piagent-core/capabilities/project-profile.js +83 -0
- package/packages/piagent-core/extensions/piagent-guard.ts +119 -26
- package/packages/piagent-core/extensions/update-check.js +170 -0
- package/packages/piagent-core/package.json +1 -1
- package/schemas/project-profile.schema.json +25 -7
- package/scripts/capability-catalog.mjs +28 -7
- package/scripts/init-project.sh +7 -0
- package/scripts/install-global.sh +3 -3
- package/scripts/profile-doctor.sh +13 -3
- package/scripts/runtime-policy-smoke.sh +12 -3
- package/scripts/team-doctor.sh +12 -3
|
@@ -15,7 +15,7 @@ Package source examples:
|
|
|
15
15
|
# Installs the stable tag after resolving it to a commit SHA.
|
|
16
16
|
|
|
17
17
|
# Pin a specific release:
|
|
18
|
-
scripts/install-global.sh --version v1.1.
|
|
18
|
+
scripts/install-global.sh --version v1.1.8 --resolve-tag
|
|
19
19
|
|
|
20
20
|
# Preview the planned install/update without changing user config:
|
|
21
21
|
scripts/install-global.sh --stable --dry-run
|
|
@@ -127,7 +127,7 @@ detect_runtime_surface() {
|
|
|
127
127
|
printf 'native-windows/%s (not release-gated; terminal helpers require Bash semantics)' "$arch_name"
|
|
128
128
|
;;
|
|
129
129
|
*)
|
|
130
|
-
printf '%s/%s (outside v1.1.
|
|
130
|
+
printf '%s/%s (outside v1.1.8 release matrix)' "$os_name" "$arch_name"
|
|
131
131
|
;;
|
|
132
132
|
esac
|
|
133
133
|
}
|
|
@@ -135,7 +135,7 @@ detect_runtime_surface() {
|
|
|
135
135
|
warn_runtime_surface_if_needed() {
|
|
136
136
|
local surface="$1"
|
|
137
137
|
case "$surface" in
|
|
138
|
-
*"supported target"*|*"experimental"*|*"not release-gated"*|*"outside v1.1.
|
|
138
|
+
*"supported target"*|*"experimental"*|*"not release-gated"*|*"outside v1.1.8 release matrix"*)
|
|
139
139
|
echo "WARN: runtime surface is $surface." >&2
|
|
140
140
|
echo "WARN: For team rollout, run piagent-doctor plus the project smoke/verify suite on this machine before relying on it." >&2
|
|
141
141
|
;;
|
|
@@ -19,12 +19,22 @@ if [[ ! -f "$PROFILE_PATH" ]]; then
|
|
|
19
19
|
exit 1
|
|
20
20
|
fi
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
PLATFORM_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
23
|
+
|
|
24
|
+
node --input-type=module - "$PROJECT_PATH" "$PROFILE_PATH" "$PLATFORM_ROOT" <<'NODE'
|
|
23
25
|
import fs from "node:fs";
|
|
24
26
|
import path from "node:path";
|
|
27
|
+
import { pathToFileURL } from "node:url";
|
|
28
|
+
|
|
29
|
+
const [projectPath, profilePath, platformRoot] = process.argv.slice(2);
|
|
30
|
+
const stored = JSON.parse(fs.readFileSync(profilePath, "utf8"));
|
|
25
31
|
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
// A profile that names an adapter is checked as the document that will actually
|
|
33
|
+
// be enforced, not as the few lines the project happens to store.
|
|
34
|
+
const { resolveProjectProfileDocument } = await import(
|
|
35
|
+
pathToFileURL(path.join(platformRoot, "packages", "piagent-core", "capabilities", "project-profile.js")).href
|
|
36
|
+
);
|
|
37
|
+
const profile = resolveProjectProfileDocument(platformRoot, stored).profile;
|
|
28
38
|
|
|
29
39
|
const errors = [];
|
|
30
40
|
const warnings = [];
|
|
@@ -25,11 +25,20 @@ bash "$ROOT/scripts/profile-doctor.sh" "$PROJECT" >/dev/null
|
|
|
25
25
|
bash "$ROOT/scripts/quality-benchmark.sh" "$PROJECT" --init >/dev/null
|
|
26
26
|
bash "$ROOT/scripts/quality-benchmark.sh" "$PROJECT" --record --scenario smoke --surface pi --result pass --tokens 1 --verify "test -s README.md" >/dev/null
|
|
27
27
|
|
|
28
|
-
node --input-type=module - "$PROJECT/.pi/piagent-profile.json" "$PROJECT/.pi/benchmarks/quality-runs.jsonl" <<'NODE'
|
|
28
|
+
node --input-type=module - "$PROJECT/.pi/piagent-profile.json" "$PROJECT/.pi/benchmarks/quality-runs.jsonl" "$ROOT" <<'NODE'
|
|
29
29
|
import fs from "node:fs";
|
|
30
|
+
import path from "node:path";
|
|
31
|
+
import { pathToFileURL } from "node:url";
|
|
30
32
|
|
|
31
|
-
const [profilePath, benchmarkPath] = process.argv.slice(2);
|
|
32
|
-
const
|
|
33
|
+
const [profilePath, benchmarkPath, platformRoot] = process.argv.slice(2);
|
|
34
|
+
const stored = JSON.parse(fs.readFileSync(profilePath, "utf8"));
|
|
35
|
+
|
|
36
|
+
// A project that names an adapter stores identity and overrides only. The policy
|
|
37
|
+
// the runtime enforces is the resolved document, so that is what gets checked.
|
|
38
|
+
const { resolveProjectProfileDocument } = await import(
|
|
39
|
+
pathToFileURL(path.join(platformRoot, "packages", "piagent-core", "capabilities", "project-profile.js")).href
|
|
40
|
+
);
|
|
41
|
+
const profile = resolveProjectProfileDocument(platformRoot, stored).profile;
|
|
33
42
|
for (const capability of ["filesystem-readonly", "filesystem-write", "shell", "memory"]) {
|
|
34
43
|
if (!profile.mcpCapabilities.includes(capability)) {
|
|
35
44
|
throw new Error(`missing capability ${capability}`);
|
package/scripts/team-doctor.sh
CHANGED
|
@@ -137,7 +137,7 @@ function runtimeMatrixStatus() {
|
|
|
137
137
|
surface: `${platform}/${arch}`,
|
|
138
138
|
status: "outside-release-matrix",
|
|
139
139
|
teamRolloutReady: false,
|
|
140
|
-
note: "This runtime is outside the documented v1.1.
|
|
140
|
+
note: "This runtime is outside the documented v1.1.8 support matrix."
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -313,7 +313,12 @@ if (foreignAgentConfig.length > 0) {
|
|
|
313
313
|
const projectProfilePath = path.join(projectPath, ".pi", "piagent-profile.json");
|
|
314
314
|
let projectProfile = null;
|
|
315
315
|
if (fs.existsSync(projectProfilePath)) {
|
|
316
|
-
|
|
316
|
+
// Check the document that will be enforced. A profile that names an adapter
|
|
317
|
+
// stores only its own identity and overrides.
|
|
318
|
+
const { resolveProjectProfileDocument } = await import(
|
|
319
|
+
pathToFileURL(path.join(platformRoot, "packages", "piagent-core", "capabilities", "project-profile.js")).href
|
|
320
|
+
);
|
|
321
|
+
const profile = resolveProjectProfileDocument(platformRoot, readJson(projectProfilePath)).profile;
|
|
317
322
|
projectProfile = profile;
|
|
318
323
|
for (const field of ["schemaVersion", "projectId", "displayName", "mode"]) {
|
|
319
324
|
if (profile[field] === undefined || profile[field] === "") errors.push(`project profile missing ${field}`);
|
|
@@ -333,7 +338,11 @@ if (fs.existsSync(projectProfilePath)) {
|
|
|
333
338
|
try {
|
|
334
339
|
const lock = readJson(projectLockPath);
|
|
335
340
|
const verification = verifyCapabilityLock(platformRoot, projectProfilePath, lock, { packageSource: projectPackageSource });
|
|
336
|
-
if (
|
|
341
|
+
if (verification.status === "blocked") {
|
|
342
|
+
errors.push(`project capability lock no longer matches what the project agreed to: ${verification.reasons.join("; ")}`);
|
|
343
|
+
} else if (verification.status === "repin") {
|
|
344
|
+
warnings.push(`project capability lock is behind the installed platform and will be re-pinned on the next Pi session (${verification.reasons.join("; ")})`);
|
|
345
|
+
}
|
|
337
346
|
} catch (error) {
|
|
338
347
|
errors.push(`project capability lock validation failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
339
348
|
}
|