@reqvire-org/ads 0.3.26 → 0.3.28
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/README.md +21 -10
- package/dist/bootstrap-ds/README.md +7 -5
- package/dist/bootstrap-ds/ds.config.json +1 -1
- package/dist/bootstrap-ds/scripts/build-mcp-previews.mjs +7 -8
- package/dist/capture.mjs +1 -1
- package/dist/development-runtime.mjs +17 -0
- package/dist/index.mjs +1 -1
- package/dist/init.mjs +14 -12
- package/dist/mcp/apps.mjs +1 -1
- package/dist/mcp/context.mjs +5 -4
- package/dist/mcp/mutations.mjs +3 -2
- package/dist/mcp/preview-watch.mjs +2 -1
- package/dist/mcp/preview-widget.bundle.js +6 -6
- package/dist/mcp/project-widget.bundle.js +13 -13
- package/dist/mcp/resource-loader.js +10 -1
- package/dist/mcp/server.mjs +11 -4
- package/dist/mcp/widget.bundle.js +1 -1
- package/dist/preview-builder.mjs +108 -0
- package/dist/preview-files.mjs +33 -0
- package/dist/preview-inputs.mjs +14 -6
- package/dist/scenario-groups.mjs +47 -0
- package/dist/scenarios-compiler.mjs +10 -9
- package/dist/scenarios-vite.mjs +13 -5
- package/dist/scenarios.mjs +4 -1
- package/dist/showcase/client.bundle.js +21 -21
- package/dist/showcase/navigation.js +13 -0
- package/dist/showcase/sandbox.bundle.js +1 -1
- package/dist/showcase/style.css +1 -0
- package/dist/skills/README.md +7 -1
- package/dist/skills/ads-break-ui/SKILL.md +7 -3
- package/dist/skills/ads-break-ui/references/behaviors.md +6 -3
- package/dist/skills/ads-break-ui/references/layers.md +16 -0
- package/dist/skills/ads-break-ui/references/runtimes.md +127 -0
- package/dist/skills/ads-break-ui/references/scenarios.md +19 -0
- package/dist/skills/ads-designer/README.md +6 -0
- package/dist/skills/ads-designer/SKILL.md +11 -6
- package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +7 -5
- package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +1 -1
- package/dist/skills/ads-designer/assets/bootstrap-ds/scripts/build-mcp-previews.mjs +7 -8
- package/dist/skills/ads-designer/references/behaviors.md +6 -3
- package/dist/skills/ads-designer/references/cli.md +10 -7
- package/dist/skills/ads-designer/references/design-craft.md +31 -0
- package/dist/skills/ads-designer/references/layers.md +16 -0
- package/dist/skills/ads-designer/references/runtimes.md +127 -0
- package/dist/skills/ads-designer/references/scenarios.md +19 -0
- package/dist/skills/ads-import/SKILL.md +24 -4
- package/dist/skills/ads-import/agents/openai.yaml +2 -2
- package/dist/skills/ads-import/references/behaviors.md +6 -3
- package/dist/skills/ads-import/references/cli.md +10 -7
- package/dist/skills/ads-import/references/compatibility.md +113 -0
- package/dist/skills/ads-import/references/implementation.md +6 -0
- package/dist/skills/ads-import/references/layers.md +16 -0
- package/dist/skills/ads-import/references/runtimes.md +127 -0
- package/dist/skills/ads-import/references/scenarios.md +19 -0
- package/dist/skills/ads-motion/SKILL.md +7 -3
- package/dist/skills/ads-motion/references/behaviors.md +6 -3
- package/dist/skills/ads-motion/references/layers.md +16 -0
- package/dist/skills/ads-motion/references/runtimes.md +127 -0
- package/dist/skills/ads-motion/references/scenarios.md +19 -0
- package/dist/skills/ads-port/SKILL.md +7 -3
- package/dist/skills/ads-port/references/behaviors.md +6 -3
- package/dist/skills/ads-port/references/cli.md +10 -7
- package/dist/skills/ads-port/references/layers.md +16 -0
- package/dist/skills/ads-port/references/runtimes.md +127 -0
- package/dist/skills/ads-port/references/scenarios.md +19 -0
- package/dist/verification.mjs +4 -3
- package/docs/ADS.md +29 -2
- package/docs/ARCHITECTURE.md +85 -3
- package/docs/BEHAVIORS.md +13 -3
- package/docs/CHANGELOG.md +38 -1
- package/docs/COMPARISON.md +63 -0
- package/docs/GUIDE.md +51 -10
- package/docs/MCP.md +104 -14
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -3,14 +3,22 @@
|
|
|
3
3
|
**A design system your agent can see and shape. Your components. Your look. Your code.**
|
|
4
4
|
|
|
5
5
|
ADS gives coding agents MCP tools and skills to build and maintain a design system
|
|
6
|
-
inside your project.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
inside your project.
|
|
7
|
+
|
|
8
|
+
- **One UI for websites and MCP Apps.** Reuse the same project-owned components,
|
|
9
|
+
behavior, tokens and styles across both.
|
|
10
|
+
- **Real UI. Guarded changes.** Humans and agents review the actual implementation;
|
|
11
|
+
agent patches pass architecture and configured project checks before they land.
|
|
12
|
+
- **Colocated code, clearer ownership.** Related implementation, styles, scenarios
|
|
13
|
+
and checks stay near their owner, reducing the search for change context.
|
|
14
|
+
- **Compiled styles, efficient delivery.** Linaria extracts CSS ahead of time.
|
|
15
|
+
Modular source and extracted styles support tree shaking, code splitting and
|
|
16
|
+
independent asset caching.
|
|
11
17
|
|
|
12
18
|
**Inspired by any library. Bound to none. Owned by your project.**
|
|
13
19
|
|
|
20
|
+
[Compare ADS with traditional component libraries and shadcn/ui](docs/COMPARISON.md).
|
|
21
|
+
|
|
14
22
|
ADS requires Linaria for component and pattern styling; your project chooses its
|
|
15
23
|
UI framework and visual design. The [architecture](docs/ARCHITECTURE.md) explains
|
|
16
24
|
Data, UX, Skin, and the performance reasons behind that choice.
|
|
@@ -44,7 +52,7 @@ setup and comparison.
|
|
|
44
52
|
|
|
45
53
|
## Set up your project
|
|
46
54
|
|
|
47
|
-
Run **inside your project**, where `package.json` lives.
|
|
55
|
+
Run **inside your project**, where `package.json` lives. Use Node 22.12+ or Bun 1.3.13+.
|
|
48
56
|
|
|
49
57
|
```sh
|
|
50
58
|
npx @reqvire-org/ads init --framework react
|
|
@@ -56,13 +64,15 @@ Use `--framework preact` for native Preact. Init saves the choice in
|
|
|
56
64
|
`ds.config.json`; later runs can use plain `ads init`. A copied starter that
|
|
57
65
|
already declares its framework can also omit the flag.
|
|
58
66
|
|
|
59
|
-
For a Bun project,
|
|
67
|
+
For a Bun project, Node is unnecessary:
|
|
60
68
|
|
|
61
69
|
```sh
|
|
70
|
+
bunx --bun @reqvire-org/ads init --framework react
|
|
62
71
|
bun install
|
|
63
|
-
bun run build
|
|
72
|
+
bun --bun run build
|
|
64
73
|
```
|
|
65
74
|
|
|
75
|
+
`--bun` keeps package executables on Bun even when they have a Node shebang.
|
|
66
76
|
`init` detects npm or Bun from your project. It adds ADS and Oxlint as development
|
|
67
77
|
dependencies, sets up an empty local ADS if needed, and adds ADS checks before your
|
|
68
78
|
existing build. The default layout is root `design-system/`, alongside `src/`.
|
|
@@ -298,8 +308,9 @@ npm test # Tool guards and packed npm install/build tests
|
|
|
298
308
|
npm run build:project # ADS guards, type checking, example build and showcase
|
|
299
309
|
```
|
|
300
310
|
|
|
301
|
-
Set `ADS_TEST_BUN=1` when running `npm test` to
|
|
302
|
-
|
|
311
|
+
Set `ADS_TEST_BUN=1` when running `npm test` to test the installed package with
|
|
312
|
+
Node/npm/npx unavailable, including Bun builds, MCP previews and guarded checks.
|
|
313
|
+
Browser behavior/capture checks also run when a supported browser is installed.
|
|
303
314
|
|
|
304
315
|
Tool source lives in `src/`; tests and the dummy project live in `tests/`.
|
|
305
316
|
|
|
@@ -12,8 +12,8 @@ Read the local [contract](ADS.md) and the
|
|
|
12
12
|
|
|
13
13
|
Copy the contents of `bootstrap-ds/`, including dotfiles, into a new project.
|
|
14
14
|
The installed `ads-designer` skill contains the same files in
|
|
15
|
-
`assets/bootstrap-ds/`. Set the project name in `package.json`. Use Node 22.12
|
|
16
|
-
|
|
15
|
+
`assets/bootstrap-ds/`. Set the project name in `package.json`. Use Node 22.12+
|
|
16
|
+
or Bun 1.3.13+ with a current ADS release.
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
19
|
npx @reqvire-org/ads init --framework react
|
|
@@ -32,10 +32,12 @@ npm run build
|
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
For a new Bun workspace, declare Bun in `packageManager`, omit the copied npm
|
|
35
|
-
lockfile and translate nested npm scripts to `bun run`.
|
|
35
|
+
lockfile and translate nested npm scripts to `bun --bun run`. Initialize with
|
|
36
|
+
`bunx --bun @reqvire-org/ads init`. Init detects existing
|
|
36
37
|
Bun projects and preserves their scripts/lockfiles. Use `bun install` and
|
|
37
|
-
`bun run build`/`bun run dev:showcase`.
|
|
38
|
-
|
|
38
|
+
`bun --bun run build`/`bun --bun run dev:showcase`. Node is unnecessary with Bun
|
|
39
|
+
1.3.13+. The supplied preview watcher's `command: "runtime"` inherits the
|
|
40
|
+
interpreter that launched ADS and runs the project's installed checks.
|
|
39
41
|
|
|
40
42
|
For an existing application, merge only the ADS source and required extraction,
|
|
41
43
|
aliases and preview adapter. Preserve its framework, entry points and build.
|
|
@@ -7,7 +7,7 @@ import wyw from "@wyw-in-js/vite";
|
|
|
7
7
|
import { linariaTagResolver } from "@reqvire-org/ads/linaria";
|
|
8
8
|
import react from "@vitejs/plugin-react";
|
|
9
9
|
import { runScenarioCompiler } from "@reqvire-org/ads/scenarios/compiler";
|
|
10
|
-
import {
|
|
10
|
+
import { createVitePreviewBuilder, previewEntriesPlugin } from "@reqvire-org/ads/scenarios/vite";
|
|
11
11
|
|
|
12
12
|
const root = path.resolve(import.meta.dirname, "..");
|
|
13
13
|
const runScript = promisify(execFile);
|
|
@@ -17,18 +17,17 @@ await runScenarioCompiler(root, {
|
|
|
17
17
|
watched: process.argv.includes("--watch"),
|
|
18
18
|
compilerFiles: [import.meta.filename],
|
|
19
19
|
async validate() {
|
|
20
|
-
try { await runScript(manager, ["run", "lint"], { cwd: root }); }
|
|
20
|
+
try { await runScript(manager, [...(manager === "bun" ? ["--bun"] : []), "run", "lint"], { cwd: root }); }
|
|
21
21
|
catch (error) { throw new Error([error.stdout, error.stderr].map(value => value?.toString() ?? "").join("\n") || error.message); }
|
|
22
22
|
},
|
|
23
|
-
|
|
23
|
+
buildGraph: createVitePreviewBuilder({ build, configure(entries, options) {
|
|
24
24
|
const mount = path.join(options.dsRoot, "showcase/mcp/main.tsx");
|
|
25
|
-
|
|
26
|
-
plugins: [previewEntriesPlugin(entries.map(entry => ({ ...entry, root })), mount), wyw({ tagResolver: linariaTagResolver, include: ["**/*.{ts,tsx}"], exclude: ["**/node_modules/**"] }), react()
|
|
25
|
+
return { configFile: false, root, base: "./", publicDir: false,
|
|
26
|
+
plugins: [previewEntriesPlugin(entries.map(entry => ({ ...entry, root })), mount), wyw({ tagResolver: linariaTagResolver, include: ["**/*.{ts,tsx}"], exclude: ["**/node_modules/**"] }), react()],
|
|
27
27
|
resolve: { alias: { "@ds": path.join(options.dsRoot, options.config.publicEntry) } },
|
|
28
28
|
worker: { format: "iife" },
|
|
29
29
|
build: { write: false, cssCodeSplit: true, assetsInlineLimit: 0, modulePreload: false,
|
|
30
30
|
rollupOptions: { preserveEntrySignatures: "strict", input: Object.fromEntries(entries.map((_entry, index) => [`scenario-${index}`, `ads-preview-entry:${index}`])) } },
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
},
|
|
31
|
+
};
|
|
32
|
+
} }),
|
|
34
33
|
});
|
package/dist/capture.mjs
CHANGED
|
@@ -87,7 +87,7 @@ export function createCaptureController(root) {
|
|
|
87
87
|
const settings = { browser: "chromium", timeoutMs: 60000, ...options.config.mcp.capture };
|
|
88
88
|
writeFileSync(request, JSON.stringify({ schemaVersion: 1, runId, playwright, settings, apps, output: temporary }));
|
|
89
89
|
update("rendering", 0, apps.length);
|
|
90
|
-
const run = await executeDevelopmentCommand({ command: "
|
|
90
|
+
const run = await executeDevelopmentCommand({ command: "runtime", timeoutMs: settings.timeoutMs, label: "Screenshot capture" }, [fileURLToPath(new URL("./capture/worker.mjs", import.meta.url)), request], root, {}, signal);
|
|
91
91
|
if (run.code !== 0) throw new Error(`Screenshot browser failed (${run.code}): ${run.output.slice(-3000)}`);
|
|
92
92
|
if (!existsSync(report) || realpathSync(report) !== report || lstatSync(report).size > 128 * 1024) throw new Error("Screenshot runner produced no bounded report.");
|
|
93
93
|
const value = JSON.parse(readFileSync(report, "utf8"));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
|
|
3
|
+
/** The launcher selects the runtime; Node-compatible imports work on both. */
|
|
4
|
+
export function developmentRuntime() {
|
|
5
|
+
return { name: process.versions.bun ? "bun" : "node", version: process.versions.bun ?? process.versions.node,
|
|
6
|
+
executable: process.execPath, binDir: path.dirname(process.execPath) };
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** `runtime` is portable. Explicit interpreter names keep their meaning. */
|
|
10
|
+
export function developmentExecutable(command) {
|
|
11
|
+
const runtime = developmentRuntime();
|
|
12
|
+
return command === "runtime" || command === runtime.name ? runtime.executable : command;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function packageScriptCommand(manager, script) {
|
|
16
|
+
return { command: manager, args: [...(manager === "bun" ? ["--bun"] : []), "run", script] };
|
|
17
|
+
}
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ export { inspectTokens, tokenContract } from "./tokens.mjs";
|
|
|
4
4
|
export { inspectTokenOrigins } from "./token-origins.mjs";
|
|
5
5
|
export { generateLintConfig } from "./lint-config.mjs";
|
|
6
6
|
export { generateBrandAssets } from "./brand-assets.mjs";
|
|
7
|
-
//
|
|
7
|
+
// Development-only helpers for registered project lint extensions. They reuse the
|
|
8
8
|
// same validated configuration and property boundary as the core checker.
|
|
9
9
|
export { loadConfig } from "./config.mjs";
|
|
10
10
|
export { importResolver, styleWriteViolation } from "./boundaries.mjs";
|
package/dist/init.mjs
CHANGED
|
@@ -32,7 +32,7 @@ function detectManager(root, pkg, requested) {
|
|
|
32
32
|
if (bun) return "bun";
|
|
33
33
|
if (npm) return "npm";
|
|
34
34
|
if (["pnpm-lock.yaml", "yarn.lock"].some((name) => existsSync(path.join(root, name)))) throw new Error("This version supports npm and Bun projects.");
|
|
35
|
-
return process.env.npm_config_user_agent?.startsWith("bun/") ? "bun" : "npm";
|
|
35
|
+
return process.versions.bun || process.env.npm_config_user_agent?.startsWith("bun/") ? "bun" : "npm";
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
function assertLocalFile(root, file) {
|
|
@@ -105,7 +105,9 @@ export function initProject(directory = process.cwd(), { toolPackage, packageMan
|
|
|
105
105
|
}
|
|
106
106
|
const manager = detectManager(root, pkg, packageManager);
|
|
107
107
|
if (!["npm", "bun"].includes(manager)) throw new Error("packageManager must be npm or bun.");
|
|
108
|
-
const run =
|
|
108
|
+
const run = manager === "bun" ? "bun --bun run" : "npm run";
|
|
109
|
+
const ads = manager === "bun" ? "bun --bun run ads" : "ads";
|
|
110
|
+
const oxlint = manager === "bun" ? "bun --bun run oxlint" : "oxlint";
|
|
109
111
|
const spec = dependencySpec(toolPackage ?? pkg.devDependencies?.[tool.name] ?? pkg.dependencies?.[tool.name] ?? tool.version);
|
|
110
112
|
const { config, dsRoot } = loadConfig(root);
|
|
111
113
|
if (framework !== undefined && !supportedFrameworks.includes(framework)) throw new Error("framework must be react or preact.");
|
|
@@ -117,24 +119,24 @@ export function initProject(directory = process.cwd(), { toolPackage, packageMan
|
|
|
117
119
|
const lintRoots = [config.sourceDir];
|
|
118
120
|
if (!isInside(path.resolve(root, config.sourceDir), dsRoot)) lintRoots.push(config.dsDir);
|
|
119
121
|
const sourceArguments = lintRoots.map((directory) => `'${directory.replaceAll("'", "'\"'\"'")}'`).join(" ");
|
|
120
|
-
const lint =
|
|
122
|
+
const lint = `${ads} lint-config . && ${ads} check . && ${oxlint} --deny-warnings --config .ds/oxlintrc.json ${sourceArguments}`;
|
|
121
123
|
const scripts = { ...pkg.scripts };
|
|
122
|
-
if (scripts["lint:ds"] && scripts["lint:ds"] !== lint && !["ads lint-config . && ads check .", "ds lint-config . && ds check ."].some(prefix => scripts["lint:ds"].startsWith(prefix))) throw new Error("An existing custom lint:ds script would conflict. Rename it or integrate ADS checks before running init.");
|
|
124
|
+
if (scripts["lint:ds"] && scripts["lint:ds"] !== lint && !["ads lint-config . && ads check .", "ds lint-config . && ds check .", "bun --bun run ads lint-config . && bun --bun run ads check ."].some(prefix => scripts["lint:ds"].startsWith(prefix))) throw new Error("An existing custom lint:ds script would conflict. Rename it or integrate ADS checks before running init.");
|
|
123
125
|
scripts["lint:ds"] = lint;
|
|
124
|
-
if (scripts["assets:ds"] && !["ads assets", "ds assets"].includes(scripts["assets:ds"])) throw new Error("An existing custom assets:ds script would conflict. Rename it or integrate ADS asset generation before running init.");
|
|
125
|
-
scripts["assets:ds"] =
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const managedBuild =
|
|
126
|
+
if (scripts["assets:ds"] && !["ads assets", "ds assets", "bun --bun run ads assets"].includes(scripts["assets:ds"])) throw new Error("An existing custom assets:ds script would conflict. Rename it or integrate ADS asset generation before running init.");
|
|
127
|
+
scripts["assets:ds"] = `${ads} assets`;
|
|
128
|
+
for (const [name, command] of [["dev:showcase", "showcase"], ["ads-mcp", "mcp --mutations"], ["ads-read-mcp", "mcp"]]) {
|
|
129
|
+
if (!scripts[name] || [`ds ${command}`, `ads ${command}`, `bun --bun run ads ${command}`].includes(scripts[name])) scripts[name] = `${ads} ${command}`;
|
|
130
|
+
}
|
|
131
|
+
const managedBuild = /^(?:npm|bun(?: --bun)?) run lint:ds(?: && (?:npm|bun(?: --bun)?) run assets:ds)?$/.test(scripts.build ?? "");
|
|
130
132
|
if (scripts.build && !managedBuild) {
|
|
131
133
|
const previous = scripts.prebuild ?? "";
|
|
132
|
-
const remaining = previous.replace(/^(?:npm|bun) run lint:ds(?:\s*&&\s*(?:npm|bun) run assets:ds)?(?:\s*&&\s*|$)/, "");
|
|
134
|
+
const remaining = previous.replace(/^(?:npm|bun(?: --bun)?) run lint:ds(?:\s*&&\s*(?:npm|bun(?: --bun)?) run assets:ds)?(?:\s*&&\s*|$)/, "");
|
|
133
135
|
scripts.prebuild = `${run} lint:ds && ${run} assets:ds${remaining ? ` && ${remaining}` : ""}`;
|
|
134
136
|
} else scripts.build = `${run} lint:ds && ${run} assets:ds`;
|
|
135
137
|
if (scripts["build:showcase"]) {
|
|
136
138
|
const previous = scripts["prebuild:showcase"] ?? "";
|
|
137
|
-
const remaining = previous.replace(/^(?:npm|bun) run lint:ds(?:\s*&&\s*(?:npm|bun) run assets:ds)?(?:\s*&&\s*|$)/, "");
|
|
139
|
+
const remaining = previous.replace(/^(?:npm|bun(?: --bun)?) run lint:ds(?:\s*&&\s*(?:npm|bun(?: --bun)?) run assets:ds)?(?:\s*&&\s*|$)/, "");
|
|
138
140
|
scripts["prebuild:showcase"] = `${run} lint:ds && ${run} assets:ds${remaining ? ` && ${remaining}` : ""}`;
|
|
139
141
|
}
|
|
140
142
|
pkg.scripts = scripts;
|
package/dist/mcp/apps.mjs
CHANGED
|
@@ -49,5 +49,5 @@ export function projectApp(options, app, build) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export function appMetadata({ nested = false } = {}) {
|
|
52
|
-
return { ui: { csp: { connectDomains: [], resourceDomains: ["data:", "blob:"], ...(nested ? { frameDomains: ["about:"] } : {}) } } };
|
|
52
|
+
return { ui: { csp: { connectDomains: ["blob:"], resourceDomains: ["data:", "blob:"], ...(nested ? { frameDomains: ["about:"] } : {}) } } };
|
|
53
53
|
}
|
package/dist/mcp/context.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { sourceUri } from "./catalog.mjs";
|
|
4
4
|
import { projectGuideFiles } from "../project-documents.mjs";
|
|
5
|
+
import { developmentRuntime, packageScriptCommand } from "../development-runtime.mjs";
|
|
5
6
|
|
|
6
7
|
export const GUIDE_URI = "ads://project/guide";
|
|
7
8
|
// Put the task triggers and entry path first: some hosts shorten server guidance.
|
|
@@ -20,15 +21,15 @@ export function projectContext(options) {
|
|
|
20
21
|
try { pkg = JSON.parse(readFileSync(path.join(root, "package.json"), "utf8")); } catch { /* A partial ADS can still be inspected. */ }
|
|
21
22
|
const packageManager = manager(root, pkg);
|
|
22
23
|
const scripts = pkg.scripts ?? {};
|
|
23
|
-
const commands = ["ads-mcp", "ads-read-mcp", "dev:showcase", "build:showcase", "build:mcp-previews", "lint:ds", "lint", "lint:style", "typecheck", "test", "build"].filter((name) => typeof scripts[name] === "string").map((script) => ({ script, cwd: root, args:
|
|
24
|
+
const commands = ["ads-mcp", "ads-read-mcp", "dev:showcase", "build:showcase", "build:mcp-previews", "lint:ds", "lint", "lint:style", "typecheck", "test", "build"].filter((name) => typeof scripts[name] === "string").map((script) => { const launch = packageManager && packageScriptCommand(packageManager, script); return { script, cwd: root, args: launch ? [launch.command, ...launch.args] : null }; });
|
|
24
25
|
const guides = [...projectGuideFiles(root), path.join(config.dsDir, "README.md"), path.join(config.dsDir, "readme.md"), path.join(config.dsDir, "SKILL.md")].filter((file) => existsSync(path.join(root, file))).map((file) => ({ file: file.replaceAll("\\", "/"), uri: sourceUri(file.replaceAll("\\", "/")) }));
|
|
25
26
|
return { name: pkg.name ?? path.basename(root), projectRoot: root, dsRoot, sourceRoot, framework: config.framework,
|
|
26
27
|
publicEntry: path.join(dsRoot, config.publicEntry), publicEntryUri: existsSync(path.join(dsRoot, config.publicEntry)) ? sourceUri(path.relative(root, path.join(dsRoot, config.publicEntry)).replaceAll("\\", "/")) : null,
|
|
27
28
|
review: { importFrom: `${config.publicAlias}/review`, entry: path.join(dsRoot, config.reviewEntry), sourceUri: existsSync(path.join(dsRoot, config.reviewEntry)) ? sourceUri(path.relative(root, path.join(dsRoot, config.reviewEntry)).replaceAll("\\", "/")) : null, developmentOnly: true },
|
|
28
29
|
stylesEntry: path.join(dsRoot, config.stylesEntry), packageManager, commands, guides,
|
|
29
30
|
showcase: { client: "tool-owned-mcp", url: config.mcp.showcaseUrl, title: config.mcp.showcaseTitle ?? `${pkg.name ?? path.basename(root)} · Design System` },
|
|
30
|
-
runtime: {
|
|
31
|
-
shellHint: "The agent shell may have a different PATH from MCP.
|
|
31
|
+
runtime: { ...developmentRuntime(),
|
|
32
|
+
shellHint: "The agent shell may have a different PATH from MCP. Use this runtime executable/bin directory and the returned project commands; do not search the whole machine or assume another runtime must be installed." } };
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
export function workflow(previews) {
|
|
@@ -65,7 +66,7 @@ Execution replies from ads_verify and guarded edits contain counts, acceptance a
|
|
|
65
66
|
|
|
66
67
|
Project guide resources: ${context.guides.map((guide) => `${guide.file}: ${guide.uri}`).join("; ") || "none discovered"}.
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
Development runtime: ${context.runtime.name} ${context.runtime.version}. Executable: ${context.runtime.executable}. Bin directory: ${context.runtime.binDir}. ${context.runtime.shellHint}
|
|
69
70
|
|
|
70
71
|
If the client exposes resources but no ADS tools, this guide and the project status/public-barrel/guide resources provide the entry path. Use the returned local paths for scoped source inspection and project commands. Do not claim a resource-only connection offers ADS tool calls, native Skills activation or a rendered App. Configure/enable the tools in the client when required; project edits still use local editor/filesystem tools.
|
|
71
72
|
`;
|
package/dist/mcp/mutations.mjs
CHANGED
|
@@ -16,6 +16,7 @@ import { previewSourceRevision } from "../preview-inputs.mjs";
|
|
|
16
16
|
import { inspectScenarios } from "../scenarios.mjs";
|
|
17
17
|
import { checkUnitCandidate, checkUnitFiles, inspectUnits, validateUnitId } from "../units.mjs";
|
|
18
18
|
import { acceptance, failure as evidenceFailure } from "../evidence.mjs";
|
|
19
|
+
import { packageScriptCommand } from "../development-runtime.mjs";
|
|
19
20
|
|
|
20
21
|
export const mutationLimits = { units: 8, files: 32, patchBytes: 256 * 1024, patchFileBytes: 16 * 1024 * 1024, fileBytes: 16 * 1024 * 1024, readChars: 12000, snapshotFiles: 20000, snapshotBytes: 128 * 1024 * 1024 };
|
|
21
22
|
const digest = bytes => `sha256:${createHash("sha256").update(bytes).digest("hex")}`;
|
|
@@ -155,7 +156,7 @@ function checks(options) {
|
|
|
155
156
|
const scripts = options.config.mcp.mutationChecks ?? [pkg.scripts?.["lint:project"] ? "lint:project" : "lint", "typecheck", "build:mcp-previews"].filter(name => typeof pkg.scripts?.[name] === "string");
|
|
156
157
|
if (scripts.some(name => typeof pkg.scripts?.[name] !== "string")) throw fail("mutation-check", "Every configured mcp.mutationChecks script must exist in package.json.");
|
|
157
158
|
if (scripts.length && !["npm", "bun"].includes(context.packageManager)) throw fail("mutation-check", "Declare packageManager as npm or bun to run mutation checks.");
|
|
158
|
-
return scripts.map(script => (
|
|
159
|
+
return scripts.map(script => packageScriptCommand(context.packageManager, script));
|
|
159
160
|
}
|
|
160
161
|
|
|
161
162
|
export function createMutationController(directory, { captures = createCaptureController(directory) } = {}) {
|
|
@@ -297,7 +298,7 @@ export function createMutationController(directory, { captures = createCaptureCo
|
|
|
297
298
|
const brand = await generateBrandAssets(candidate);
|
|
298
299
|
verified.push({ name: "brand assets", passed: true, skipped: !!brand.skipped });
|
|
299
300
|
}
|
|
300
|
-
for (const check of extraChecks) verified.push(await checkCommand(check.command, check.args, candidate, signal, undefined, {category:"build",phase:`project-check:${check.args
|
|
301
|
+
for (const check of extraChecks) verified.push(await checkCommand(check.command, check.args, candidate, signal, undefined, {category:"build",phase:`project-check:${check.args.at(-1)}`}, candidateOptions.config.mcp.mutationCheckTimeoutMs));
|
|
301
302
|
boundary=evidenceFailure("runner","behavior-verification","ADS_BEHAVIOR_SETUP");
|
|
302
303
|
const behaviorUnits = affectedBehaviorUnits(candidateOptions, changes.map(change => change.path));
|
|
303
304
|
if (behaviorUnits.length) {
|
|
@@ -5,6 +5,7 @@ import path from "node:path";
|
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { buildFailure, inspectBuildStatus } from "./build-status.mjs";
|
|
7
7
|
import { previewSessionDirectories, withPreviewSession } from "../preview-scope.mjs";
|
|
8
|
+
import { developmentExecutable } from "../development-runtime.mjs";
|
|
8
9
|
|
|
9
10
|
function stamp(file) {
|
|
10
11
|
try { const stat = statSync(file); return `${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`; }
|
|
@@ -64,7 +65,7 @@ export function createPreviewWatch(root, config, { log = process.stderr, buildTi
|
|
|
64
65
|
state = "running";
|
|
65
66
|
// No shell: configured arguments remain literal. Child stdin cannot consume
|
|
66
67
|
// the MCP channel, and both output streams go exclusively to diagnostics.
|
|
67
|
-
const executable = command.command
|
|
68
|
+
const executable = developmentExecutable(command.command);
|
|
68
69
|
const env = { ...process.env, ADS_MCP_BUILD_SESSION: session, ADS_MCP_BUILD_STATUS: reportFile, ADS_MCP_REQUEST_FILE: requestFile, PATH: [path.join(root, "node_modules/.bin"), path.dirname(process.execPath), process.env.PATH ?? ""].join(path.delimiter) };
|
|
69
70
|
try {
|
|
70
71
|
child = spawn(executable, command.args, { cwd: root, env, shell: false, detached: process.platform !== "win32", stdio: ["ignore", "pipe", "pipe"], windowsHide: true });
|