@webpresso/agent-kit 0.27.0 → 0.28.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.
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Webpresso agent-kit Claude Code plugin: blueprints, skills, hooks, MCP server",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.28.0"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
]
|
|
24
24
|
}
|
|
25
25
|
],
|
|
26
|
-
"version": "0.
|
|
26
|
+
"version": "0.28.0"
|
|
27
27
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import { readConfig } from '#cli/commands/init/config';
|
|
3
4
|
const FORBIDDEN_DEPENDENCY_PATTERNS = [
|
|
4
5
|
/^typescript$/u,
|
|
5
6
|
/^vite$/u,
|
|
@@ -19,6 +20,11 @@ const ALLOWED_SCRIPT_PREFIXES = ['wp ', 'vp run ', 'vp run -r '];
|
|
|
19
20
|
export function auditToolchainIsolation(root) {
|
|
20
21
|
const packagePaths = findPackageJsonFiles(root);
|
|
21
22
|
const violations = [];
|
|
23
|
+
// Per-repo runtime exemptions: dependency names the repo declares as
|
|
24
|
+
// legitimate app-specific runtimes (e.g. `tsx` for a Pulumi program's TS
|
|
25
|
+
// loader, `@playwright/test` imported by e2e specs) rather than generic
|
|
26
|
+
// toolchain. Mechanism here; data lives in the consumer's `.webpressorc.json`.
|
|
27
|
+
const allowDependencies = new Set(readConfig(root)?.audit?.toolchainIsolation?.allowDependencies ?? []);
|
|
22
28
|
for (const packagePath of packagePaths) {
|
|
23
29
|
const pkg = readPackageJson(packagePath);
|
|
24
30
|
if (!pkg) {
|
|
@@ -36,6 +42,8 @@ export function auditToolchainIsolation(root) {
|
|
|
36
42
|
for (const depName of Object.keys(pkg[field] ?? {})) {
|
|
37
43
|
if (!isForbiddenDependency(depName))
|
|
38
44
|
continue;
|
|
45
|
+
if (allowDependencies.has(depName))
|
|
46
|
+
continue;
|
|
39
47
|
violations.push({
|
|
40
48
|
file: packagePath,
|
|
41
49
|
message: `${field}.${depName} is toolchain-owned; route it through @webpresso/agent-kit/wp instead of declaring it directly`,
|
|
@@ -24,6 +24,16 @@ export interface AgentkitConfig {
|
|
|
24
24
|
packageManager?: 'vp-only';
|
|
25
25
|
scriptRoutes?: Record<string, string>;
|
|
26
26
|
};
|
|
27
|
+
/** Audit policy overrides. `mechanism` lives in agent-kit; this is per-repo
|
|
28
|
+
* `data`. `toolchainIsolation.allowDependencies` lists dependency names that
|
|
29
|
+
* are exempt from the toolchain-isolation audit because they are legitimate
|
|
30
|
+
* app-specific runtimes (e.g. `tsx` for a Pulumi program's TS loader,
|
|
31
|
+
* `@playwright/test` imported by e2e specs), not generic toolchain. */
|
|
32
|
+
audit?: {
|
|
33
|
+
toolchainIsolation?: {
|
|
34
|
+
allowDependencies?: string[];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
27
37
|
rules: {
|
|
28
38
|
overrides: string[];
|
|
29
39
|
};
|
|
@@ -60,6 +60,12 @@ export function readConfig(repoRoot) {
|
|
|
60
60
|
...(scriptRoutes ? { scriptRoutes } : {}),
|
|
61
61
|
}
|
|
62
62
|
: undefined;
|
|
63
|
+
const auditConfig = parsed.audit;
|
|
64
|
+
const rawAllowDeps = auditConfig?.toolchainIsolation?.allowDependencies;
|
|
65
|
+
const allowDependencies = Array.isArray(rawAllowDeps)
|
|
66
|
+
? rawAllowDeps.filter((s) => typeof s === 'string' && s.length > 0)
|
|
67
|
+
: [];
|
|
68
|
+
const normalizedAudit = allowDependencies.length > 0 ? { toolchainIsolation: { allowDependencies } } : undefined;
|
|
63
69
|
const selectedHosts = Array.isArray(hosts?.selected)
|
|
64
70
|
? hosts.selected.filter((s) => ['codex', 'claude', 'opencode'].includes(String(s)))
|
|
65
71
|
: [];
|
|
@@ -79,6 +85,7 @@ export function readConfig(repoRoot) {
|
|
|
79
85
|
},
|
|
80
86
|
...(normalizedMcp ? { mcp: normalizedMcp } : {}),
|
|
81
87
|
...(normalizedGuard ? { guard: normalizedGuard } : {}),
|
|
88
|
+
...(normalizedAudit ? { audit: normalizedAudit } : {}),
|
|
82
89
|
rules: { overrides: overrides.filter((s) => typeof s === 'string') },
|
|
83
90
|
scripts: {
|
|
84
91
|
'setup-agent': readOptionalString(scripts?.['setup-agent']),
|
|
@@ -116,12 +123,21 @@ export function mergeConfig(existing, incoming) {
|
|
|
116
123
|
...(mergedScriptRoutes ? { scriptRoutes: mergedScriptRoutes } : {}),
|
|
117
124
|
}
|
|
118
125
|
: undefined;
|
|
126
|
+
const existingAllowDeps = existing.audit?.toolchainIsolation?.allowDependencies;
|
|
127
|
+
const incomingAllowDeps = incoming.audit?.toolchainIsolation?.allowDependencies;
|
|
128
|
+
const mergedAllowDeps = existingAllowDeps || incomingAllowDeps
|
|
129
|
+
? Array.from(new Set([...(existingAllowDeps ?? []), ...(incomingAllowDeps ?? [])])).toSorted()
|
|
130
|
+
: undefined;
|
|
131
|
+
const mergedAudit = mergedAllowDeps
|
|
132
|
+
? { toolchainIsolation: { allowDependencies: mergedAllowDeps } }
|
|
133
|
+
: undefined;
|
|
119
134
|
return {
|
|
120
135
|
version: incoming.version,
|
|
121
136
|
installed: { tier3Skills: tier3 },
|
|
122
137
|
hosts: incoming.hosts ?? existing.hosts,
|
|
123
138
|
...(mergedMcp ? { mcp: mergedMcp } : {}),
|
|
124
139
|
...(mergedGuard ? { guard: mergedGuard } : {}),
|
|
140
|
+
...(mergedAudit ? { audit: mergedAudit } : {}),
|
|
125
141
|
rules: { overrides },
|
|
126
142
|
scripts: {
|
|
127
143
|
'setup-agent': incoming.scripts['setup-agent'] ?? existing.scripts['setup-agent'],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpresso/agent-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -710,10 +710,10 @@
|
|
|
710
710
|
"@stryker-mutator/typescript-checker": "^9.6.1",
|
|
711
711
|
"@playwright/test": "^1.55.0",
|
|
712
712
|
"wrangler": "^4.50.0",
|
|
713
|
-
"@webpresso/agent-kit-runtime-darwin-arm64": "0.
|
|
714
|
-
"@webpresso/agent-kit-runtime-darwin-x64": "0.
|
|
715
|
-
"@webpresso/agent-kit-runtime-linux-x64": "0.
|
|
716
|
-
"@webpresso/agent-kit-runtime-linux-arm64": "0.
|
|
717
|
-
"@webpresso/agent-kit-runtime-windows-x64": "0.
|
|
713
|
+
"@webpresso/agent-kit-runtime-darwin-arm64": "0.28.0",
|
|
714
|
+
"@webpresso/agent-kit-runtime-darwin-x64": "0.28.0",
|
|
715
|
+
"@webpresso/agent-kit-runtime-linux-x64": "0.28.0",
|
|
716
|
+
"@webpresso/agent-kit-runtime-linux-arm64": "0.28.0",
|
|
717
|
+
"@webpresso/agent-kit-runtime-windows-x64": "0.28.0"
|
|
718
718
|
}
|
|
719
719
|
}
|