@reqvire-org/ads 0.3.35 → 0.3.37
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 +10 -8
- package/dist/bootstrap-ds/README.md +8 -9
- package/dist/bootstrap-ds/ds.config.json +1 -8
- package/dist/bootstrap-ds/package.json +4 -3
- package/dist/bootstrap-ds/scripts/build-mcp-previews.mjs +2 -32
- package/dist/bun-compiler.mjs +13 -0
- package/dist/bun-worker.mjs +9 -0
- package/dist/check.mjs +7 -4
- package/dist/cli.mjs +11 -7
- package/dist/config.mjs +22 -4
- package/dist/development-runtime.mjs +3 -1
- package/dist/init.mjs +16 -18
- package/dist/mcp/build-status.mjs +6 -4
- package/dist/mcp/context.mjs +9 -4
- package/dist/mcp/drafts.mjs +9 -4
- package/dist/mcp/mutation-limits.mjs +2 -0
- package/dist/mcp/mutations.mjs +8 -17
- package/dist/mcp/patch.mjs +5 -3
- package/dist/mcp/preview-watch.mjs +21 -9
- package/dist/mcp/preview-widget.bundle.js +58 -63
- package/dist/mcp/preview-work.mjs +1 -15
- package/dist/mcp/project-widget.bundle.js +57 -62
- package/dist/mcp/prompts.mjs +2 -2
- package/dist/mcp/resource-loader.js +32 -10
- package/dist/mcp/server.mjs +90 -35
- package/dist/mcp/widget.bundle.js +59 -64
- package/dist/preview-builder.mjs +17 -5
- package/dist/preview-bun.mjs +266 -0
- package/dist/preview-imports.mjs +73 -0
- package/dist/preview-resources.mjs +26 -14
- package/dist/scenario-inspector.mjs +11 -4
- package/dist/scenarios-compiler.mjs +47 -6
- package/dist/showcase/client.bundle.js +68 -72
- package/dist/showcase/index.html +2 -2
- package/dist/showcase/sandbox.bundle.js +1 -1
- package/dist/showcase/style.css +4 -0
- package/dist/skills/ads-break-ui/SKILL.md +39 -40
- package/dist/skills/ads-break-ui/references/drafts.md +12 -3
- package/dist/skills/ads-break-ui/references/guarded-editing.md +6 -5
- package/dist/skills/ads-break-ui/references/runtimes.md +91 -140
- package/dist/skills/ads-break-ui/references/validation.md +13 -3
- package/dist/skills/ads-break-ui/references/workflows.md +82 -0
- package/dist/skills/ads-designer/SKILL.md +38 -39
- package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +8 -9
- package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +1 -8
- package/dist/skills/ads-designer/assets/bootstrap-ds/package.json +4 -3
- package/dist/skills/ads-designer/assets/bootstrap-ds/scripts/build-mcp-previews.mjs +2 -32
- package/dist/skills/ads-designer/references/cli.md +24 -20
- package/dist/skills/ads-designer/references/drafts.md +12 -3
- package/dist/skills/ads-designer/references/guarded-editing.md +6 -5
- package/dist/skills/ads-designer/references/runtimes.md +91 -140
- package/dist/skills/ads-designer/references/validation.md +13 -3
- package/dist/skills/ads-designer/references/workflows.md +82 -0
- package/dist/skills/ads-import/SKILL.md +40 -42
- package/dist/skills/ads-import/references/cli.md +24 -20
- package/dist/skills/ads-import/references/drafts.md +12 -3
- package/dist/skills/ads-import/references/guarded-editing.md +6 -5
- package/dist/skills/ads-import/references/runtimes.md +91 -140
- package/dist/skills/ads-import/references/validation.md +13 -3
- package/dist/skills/ads-import/references/workflows.md +82 -0
- package/dist/skills/ads-motion/SKILL.md +37 -38
- package/dist/skills/ads-motion/references/drafts.md +12 -3
- package/dist/skills/ads-motion/references/guarded-editing.md +6 -5
- package/dist/skills/ads-motion/references/runtimes.md +91 -140
- package/dist/skills/ads-motion/references/validation.md +13 -3
- package/dist/skills/ads-motion/references/workflows.md +82 -0
- package/dist/skills/ads-port/SKILL.md +37 -38
- package/dist/skills/ads-port/references/cli.md +24 -20
- package/dist/skills/ads-port/references/drafts.md +12 -3
- package/dist/skills/ads-port/references/guarded-editing.md +6 -5
- package/dist/skills/ads-port/references/runtimes.md +91 -140
- package/dist/skills/ads-port/references/validation.md +13 -3
- package/dist/skills/ads-port/references/workflows.md +82 -0
- package/dist/usage.mjs +84 -0
- package/dist/validation.mjs +0 -12
- package/dist/verification/browser.mjs +77 -48
- package/docs/ADS.md +17 -11
- package/docs/ARCHITECTURE.md +43 -29
- package/docs/BEHAVIORS.md +3 -3
- package/docs/CHANGELOG.md +67 -12
- package/docs/GUIDE.md +96 -53
- package/docs/MCP.md +97 -123
- package/docs/benchmarks/bun-previews.md +91 -0
- package/docs/benchmarks/gidi-preview-memory.md +4 -0
- package/package.json +15 -13
|
@@ -4,21 +4,25 @@ import { readFileSync } from "node:fs";
|
|
|
4
4
|
// preview-client/paint-audit.mjs
|
|
5
5
|
function auditPaintBindings({ container = document.getElementById("root"), bindings = [], auditResources = false } = {}) {
|
|
6
6
|
const diagnostics = [], verified = [], limits = [];
|
|
7
|
-
if (!container || !Array.isArray(bindings) || bindings.length > 100)
|
|
7
|
+
if (!container || !Array.isArray(bindings) || bindings.length > 100)
|
|
8
|
+
return { ok: false, diagnostics: ["Invalid bounded paint-audit descriptor."], verified };
|
|
8
9
|
const document2 = container.ownerDocument, view = document2.defaultView;
|
|
9
10
|
const properties = ["color", "fill", "stroke", "stop-color", "background-color", "border-top-color", "border-right-color", "border-bottom-color", "border-left-color"];
|
|
10
|
-
function reference(value, node, descriptor, seen =
|
|
11
|
+
function reference(value, node, descriptor, seen = new Set) {
|
|
11
12
|
value = value.trim();
|
|
12
|
-
if (["none", "currentColor"].includes(value))
|
|
13
|
+
if (["none", "currentColor"].includes(value))
|
|
14
|
+
return true;
|
|
13
15
|
const variable = /^var\(\s*(--[\w-]+)\s*\)$/.exec(value);
|
|
14
16
|
if (variable) {
|
|
15
17
|
const name = variable[1];
|
|
16
|
-
if (!descriptor.tokens.includes(name) || seen.has(name))
|
|
18
|
+
if (!descriptor.tokens.includes(name) || seen.has(name))
|
|
19
|
+
return false;
|
|
17
20
|
const resolved = view.getComputedStyle(node).getPropertyValue(name).trim();
|
|
18
21
|
return !!resolved && view.CSS.supports("color", resolved);
|
|
19
22
|
}
|
|
20
23
|
const themed = /^light-dark\(\s*(var\(\s*--[\w-]+\s*\)|currentColor)\s*,\s*(var\(\s*--[\w-]+\s*\)|currentColor)\s*\)$/.exec(value);
|
|
21
|
-
if (themed)
|
|
24
|
+
if (themed)
|
|
25
|
+
return view.CSS.supports("color", value) && reference(themed[1], node, descriptor, seen) && reference(themed[2], node, descriptor, seen);
|
|
22
26
|
const resource = /^url\(\s*(["']?)#([^\s"'()#\\\p{Cc}]+)\1\s*\)$/u.exec(value);
|
|
23
27
|
if (resource && view.CSS.supports("fill", value)) {
|
|
24
28
|
const candidates = [...document2.querySelectorAll("[id]")].filter((item) => item.id === resource[2]);
|
|
@@ -38,17 +42,19 @@ function auditPaintBindings({ container = document.getElementById("root"), bindi
|
|
|
38
42
|
diagnostics.push(`${descriptor.owner}: invalid binding scope.`);
|
|
39
43
|
continue;
|
|
40
44
|
}
|
|
41
|
-
if (roots.length > 20)
|
|
45
|
+
if (roots.length > 20)
|
|
46
|
+
limits.push(`${descriptor.owner}: only the first 20 instances were audited; use a focused scenario for complete evidence.`);
|
|
42
47
|
for (const root of roots.slice(0, 20)) {
|
|
43
48
|
const nodes = [root, ...root.querySelectorAll("*")];
|
|
44
|
-
if (nodes.length >
|
|
49
|
+
if (nodes.length > 1000) {
|
|
45
50
|
limits.push(`${descriptor.owner}: instance exceeds 1000 elements; paint effects are not established.`);
|
|
46
51
|
continue;
|
|
47
52
|
}
|
|
48
53
|
const names = [...root.style].filter((name) => name.startsWith(descriptor.prefix) && name.endsWith(descriptor.suffix));
|
|
49
|
-
if (names.length > 100)
|
|
54
|
+
if (names.length > 100)
|
|
55
|
+
limits.push(`${descriptor.owner}: only the first 100 binding keys were audited.`);
|
|
50
56
|
for (const name of names.slice(0, 100)) {
|
|
51
|
-
const value = root.style.getPropertyValue(name).trim(), key = name.slice(descriptor.prefix.length, descriptor.suffix ? -descriptor.suffix.length :
|
|
57
|
+
const value = root.style.getPropertyValue(name).trim(), key = name.slice(descriptor.prefix.length, descriptor.suffix ? -descriptor.suffix.length : undefined);
|
|
52
58
|
if (!/^[A-Za-z0-9_-]+$/.test(key) || !reference(value, root, descriptor)) {
|
|
53
59
|
diagnostics.push(`${descriptor.owner}: invalid or inaccessible paint ${name}: ${value}. Use an accessible token, instance-local SVG paint server, none or currentColor.`);
|
|
54
60
|
continue;
|
|
@@ -56,7 +62,8 @@ function auditPaintBindings({ container = document.getElementById("root"), bindi
|
|
|
56
62
|
const previous = root.getAttribute("style");
|
|
57
63
|
const nodeStyles = nodes.map((node) => node.getAttribute("style"));
|
|
58
64
|
try {
|
|
59
|
-
for (const node of nodes)
|
|
65
|
+
for (const node of nodes)
|
|
66
|
+
node.style.setProperty("transition", "none", "important");
|
|
60
67
|
const before = nodes.map((node) => properties.map((property) => view.getComputedStyle(node).getPropertyValue(property)));
|
|
61
68
|
root.style.setProperty(name, "rgb(17, 103, 211)", "important");
|
|
62
69
|
let changed = nodes.some((node, index) => properties.some((property, i) => view.getComputedStyle(node).getPropertyValue(property) !== before[index][i]));
|
|
@@ -64,36 +71,50 @@ function auditPaintBindings({ container = document.getElementById("root"), bindi
|
|
|
64
71
|
root.style.setProperty(name, "rgb(211, 67, 23)", "important");
|
|
65
72
|
changed = nodes.some((node, index) => properties.some((property, i) => view.getComputedStyle(node).getPropertyValue(property) !== before[index][i]));
|
|
66
73
|
}
|
|
67
|
-
if (!changed)
|
|
68
|
-
|
|
74
|
+
if (!changed)
|
|
75
|
+
limits.push(`${descriptor.owner}: ${name} has no observed paint effect in its current instance. A written variable alone is not rendering evidence; check the relevant selected/visible consumer.`);
|
|
76
|
+
else
|
|
77
|
+
verified.push({ owner: descriptor.owner, binding: descriptor.name, variable: name });
|
|
69
78
|
} finally {
|
|
70
79
|
nodes.forEach((node, index) => {
|
|
71
|
-
if (nodeStyles[index] === null)
|
|
72
|
-
|
|
80
|
+
if (nodeStyles[index] === null)
|
|
81
|
+
node.removeAttribute("style");
|
|
82
|
+
else
|
|
83
|
+
node.setAttribute("style", nodeStyles[index]);
|
|
73
84
|
});
|
|
74
|
-
if (previous === null)
|
|
75
|
-
|
|
85
|
+
if (previous === null)
|
|
86
|
+
root.removeAttribute("style");
|
|
87
|
+
else
|
|
88
|
+
root.setAttribute("style", previous);
|
|
76
89
|
}
|
|
77
90
|
}
|
|
78
|
-
for (const node of nodes)
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
for (const node of nodes)
|
|
92
|
+
for (const property of ["fill", "stroke", "stop-color"]) {
|
|
93
|
+
const value = node.getAttribute(property);
|
|
94
|
+
if (!value)
|
|
95
|
+
continue;
|
|
96
|
+
const variable = /^var\(\s*(--[\w-]+)\s*\)$/.exec(value);
|
|
97
|
+
if (variable && variable[1].startsWith(descriptor.prefix) && variable[1].endsWith(descriptor.suffix) && !names.includes(variable[1]))
|
|
98
|
+
diagnostics.push(`${descriptor.owner}: ${variable[1]} is consumed without a value in this instance.`);
|
|
99
|
+
if (value.startsWith("url(") && !reference(value, root, descriptor))
|
|
100
|
+
diagnostics.push(`${descriptor.owner}: missing, duplicated or out-of-instance local paint resource ${value}.`);
|
|
101
|
+
}
|
|
85
102
|
}
|
|
86
103
|
}
|
|
87
104
|
const resourceNodes = auditResources ? [...container.querySelectorAll("[fill], [stroke], [style]")] : [];
|
|
88
|
-
if (resourceNodes.length >
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
105
|
+
if (resourceNodes.length > 1000)
|
|
106
|
+
limits.push("Only the first 1000 potential SVG paint consumers were audited.");
|
|
107
|
+
for (const node of resourceNodes.slice(0, 1000))
|
|
108
|
+
for (const property of ["fill", "stroke"]) {
|
|
109
|
+
const value = node.getAttribute(property) ?? node.style.getPropertyValue(property);
|
|
110
|
+
if (!value?.startsWith("url("))
|
|
111
|
+
continue;
|
|
112
|
+
const id = /^url\(\s*(["']?)#([^\s"'()#\\\p{Cc}]+)\1\s*\)$/u.exec(value)?.[2];
|
|
113
|
+
const resources = id ? [...document2.querySelectorAll("[id]")].filter((item) => item.id === id) : [];
|
|
114
|
+
const svg = node.ownerSVGElement ?? (node.localName === "svg" ? node : null);
|
|
115
|
+
if (resources.length !== 1 || !svg?.contains(resources[0]) || !["linearGradient", "radialGradient", "pattern"].includes(resources[0]?.localName))
|
|
116
|
+
diagnostics.push(`Invalid, missing, duplicated or nonlocal SVG paint resource ${value}. Keep IDs isolated per rendered instance.`);
|
|
117
|
+
}
|
|
97
118
|
return { ok: !diagnostics.length, complete: !limits.length, verified, diagnostics: diagnostics.slice(0, 40), limits: limits.slice(0, 20), scope: "observed App instances and current input; repeat after updates" };
|
|
98
119
|
}
|
|
99
120
|
|
|
@@ -104,38 +125,44 @@ async function auditBehaviorPaints(frame) {
|
|
|
104
125
|
return frame.evaluate(auditPaintBindings, { bindings: JSON.parse(bindings ?? "[]"), auditResources: auditResources === "true" });
|
|
105
126
|
}
|
|
106
127
|
function verificationRequest() {
|
|
107
|
-
if (!process.env.ADS_VERIFY_REQUEST)
|
|
128
|
+
if (!process.env.ADS_VERIFY_REQUEST)
|
|
129
|
+
throw new Error("Run this check through ads_verify so the request and selected profile are explicit.");
|
|
108
130
|
return JSON.parse(readFileSync(process.env.ADS_VERIFY_REQUEST, "utf8"));
|
|
109
131
|
}
|
|
110
|
-
async function openBehaviorScenario(page, checkId, { timeout =
|
|
132
|
+
async function openBehaviorScenario(page, checkId, { timeout = 30000 } = {}) {
|
|
111
133
|
const request = verificationRequest();
|
|
112
134
|
const check = request.checks.find((check2) => check2.id === checkId);
|
|
113
135
|
const url = check && request.scenarios[check.scenario];
|
|
114
|
-
if (!url)
|
|
136
|
+
if (!url)
|
|
137
|
+
throw new Error("This check has no managed browser scenario. StrictMode profiles must supply a project development harness; production preview bundles do not replay React development effects.");
|
|
115
138
|
return openPreviewScenario(page, url, check.scenario, { timeout });
|
|
116
139
|
}
|
|
117
|
-
async function openPreviewScenario(page, url, scenario, { timeout =
|
|
140
|
+
async function openPreviewScenario(page, url, scenario, { timeout = 30000 } = {}) {
|
|
118
141
|
const failures = [], requests = [], errors = [];
|
|
119
142
|
let boundary;
|
|
120
143
|
const record = (request, detail) => {
|
|
121
|
-
if (requests.length >= 8)
|
|
144
|
+
if (requests.length >= 8)
|
|
145
|
+
return;
|
|
122
146
|
let resourceUri;
|
|
123
147
|
try {
|
|
124
148
|
const payload = request.postDataJSON();
|
|
125
|
-
if (payload?.method === "resources/read" && typeof payload.params?.uri === "string" && payload.params.uri.startsWith("ads://"))
|
|
126
|
-
|
|
127
|
-
}
|
|
149
|
+
if (payload?.method === "resources/read" && typeof payload.params?.uri === "string" && payload.params.uri.startsWith("ads://"))
|
|
150
|
+
resourceUri = payload.params.uri.slice(0, 500);
|
|
151
|
+
} catch {}
|
|
128
152
|
requests.push({ method: request.method(), url: request.url().slice(0, 300), ...detail, ...resourceUri ? { resourceUri } : {} });
|
|
129
153
|
};
|
|
130
154
|
const failed = (request) => {
|
|
131
|
-
if (failures.length < 5)
|
|
155
|
+
if (failures.length < 5)
|
|
156
|
+
failures.push(`${request.method()} ${request.url().slice(0, 300)}: ${request.failure()?.errorText ?? "request failed"}`);
|
|
132
157
|
record(request, { error: request.failure()?.errorText ?? "request failed" });
|
|
133
158
|
};
|
|
134
159
|
const response = (response2) => {
|
|
135
|
-
if (response2.status() >= 400)
|
|
160
|
+
if (response2.status() >= 400)
|
|
161
|
+
record(response2.request(), { status: response2.status() });
|
|
136
162
|
};
|
|
137
163
|
const pageError = (error) => {
|
|
138
|
-
if (errors.length < 3)
|
|
164
|
+
if (errors.length < 3)
|
|
165
|
+
errors.push(error.message.slice(0, 500));
|
|
139
166
|
};
|
|
140
167
|
const diagnostic = (outcome, detail = {}) => console.warn(JSON.stringify({ adsPreviewDiagnostic: { kind: "preview-startup", scenario, outcome, viewport: page.viewportSize(), requests, errors, ...detail } }));
|
|
141
168
|
page.on("requestfailed", failed);
|
|
@@ -154,7 +181,8 @@ async function openPreviewScenario(page, url, scenario, { timeout = 3e4 } = {})
|
|
|
154
181
|
}).catch(() => ({}));
|
|
155
182
|
if (state.id === scenario && state.state === "ready") {
|
|
156
183
|
const retries = await page.evaluate(() => Number(document.documentElement.dataset.adsResourceRetries ?? 0)).catch(() => 0);
|
|
157
|
-
if (retries > 0)
|
|
184
|
+
if (retries > 0)
|
|
185
|
+
console.warn(JSON.stringify({ adsPreviewDiagnostic: { kind: "resource-read-recovery", scenario, retries, failedRequests: failures } }));
|
|
158
186
|
diagnostic("ready", { previewRevision: state.revision ?? null });
|
|
159
187
|
return frame;
|
|
160
188
|
}
|
|
@@ -179,7 +207,8 @@ async function openPreviewScenario(page, url, scenario, { timeout = 3e4 } = {})
|
|
|
179
207
|
diagnostic("failed", { failure: boundary });
|
|
180
208
|
throw Object.assign(new Error(`Scenario ${scenario}: ${error.message}${failures.length ? `
|
|
181
209
|
Failed browser requests:
|
|
182
|
-
${failures.join(
|
|
210
|
+
${failures.join(`
|
|
211
|
+
`)}` : ""}`, { cause: error }), { failure: boundary });
|
|
183
212
|
} finally {
|
|
184
213
|
page.off("requestfailed", failed);
|
|
185
214
|
page.off("response", response);
|
|
@@ -187,8 +216,8 @@ ${failures.join("\n")}` : ""}`, { cause: error }), { failure: boundary });
|
|
|
187
216
|
}
|
|
188
217
|
}
|
|
189
218
|
export {
|
|
190
|
-
|
|
191
|
-
openBehaviorScenario,
|
|
219
|
+
verificationRequest,
|
|
192
220
|
openPreviewScenario,
|
|
193
|
-
|
|
221
|
+
openBehaviorScenario,
|
|
222
|
+
auditBehaviorPaints
|
|
194
223
|
};
|
package/docs/ADS.md
CHANGED
|
@@ -6,7 +6,11 @@ UX, and Skin pillars. [GUIDE.md](GUIDE.md) gives setup and configuration steps.
|
|
|
6
6
|
|
|
7
7
|
## Ownership boundary
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Choose [direct editing or MCP-only editing](../skills/ads-designer/references/workflows.md)
|
|
10
|
+
from the actual source access and user instructions. Direct editors modify owned
|
|
11
|
+
files normally and use MCP for previews/checks; ordinary edits do not require
|
|
12
|
+
tracked drafts or acceptance. MCP-only iterative editing, and direct editors
|
|
13
|
+
choosing isolated proposals, use the [tracked draft contract](../skills/ads-designer/references/drafts.md).
|
|
10
14
|
Drafts are Git-committable proposals under `ads-drafts/` using `.ads`
|
|
11
15
|
source and a target/baseline manifest. They are excluded from normal discovery
|
|
12
16
|
and may not be imported, re-exported or resolved into application builds. Use
|
|
@@ -22,7 +26,7 @@ complete, unless the user explicitly requested a retained proposal.
|
|
|
22
26
|
MCP source editing is opt-in through `ads mcp --mutations`. Its write operation
|
|
23
27
|
accepts a Git unified diff for one ADS unit (or bounded owner patches for coupled
|
|
24
28
|
transactions) and validates its source, scenario and
|
|
25
|
-
fixture changes against
|
|
29
|
+
fixture changes against native ADS gates and configured project checks
|
|
26
30
|
before application. This includes
|
|
27
31
|
foundation, documentation, original assets and an explicit configuration unit for
|
|
28
32
|
project settings, registered guard code and compiler integration. Configuration
|
|
@@ -392,12 +396,12 @@ describes source locations, public entry points, asset sources, and explicit
|
|
|
392
396
|
boundaries. Initialized builds use the local CLI in this order:
|
|
393
397
|
|
|
394
398
|
```text
|
|
395
|
-
ads
|
|
399
|
+
ads check → ads assets → existing prebuild → existing build
|
|
396
400
|
```
|
|
397
401
|
|
|
398
|
-
`
|
|
399
|
-
|
|
400
|
-
|
|
402
|
+
`ads check` validates architecture and declared native usage policies directly
|
|
403
|
+
before asset generation. Additional project linters run only through explicit scripts.
|
|
404
|
+
`lint-config` is an optional adapter for projects that choose Oxlint. `ads assets`
|
|
401
405
|
generates configured browser icons from the source SVG into ignored `.ds/assets/`.
|
|
402
406
|
A failed check or generation stops the build. Keep the project's CSS lint,
|
|
403
407
|
type checks, behavior tests, and framework compilation in its build/test flow.
|
|
@@ -461,11 +465,13 @@ Opaque/computed dependencies and ambiguous/generated style hooks require review.
|
|
|
461
465
|
See the skill-local [layer guide](../skills/ads-designer/references/layers.md), also
|
|
462
466
|
available through MCP at `ads://guides/layers`.
|
|
463
467
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
468
|
+
Use ADS-managed policies when they cover a concrete component misuse. The
|
|
469
|
+
optional `usage.notifications` registration names a project's public notification
|
|
470
|
+
API, host and exact allowed root files; `usage.restrictedImports` blocks runtime
|
|
471
|
+
package imports that bypass the owned API. Both run in the native gate without
|
|
472
|
+
another linter. The tooling does not assume Toast, Button, or any shell is installed.
|
|
473
|
+
Document the registration with its component. Only custom policies not covered
|
|
474
|
+
by ADS need component-owned tooling and an explicit project command.
|
|
469
475
|
|
|
470
476
|
Register project plugins and rules in `ds.config.json` under `oxlint`. Use scoped
|
|
471
477
|
`oxlint.overrides` for file-specific rule settings. These settings configure
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -30,11 +30,11 @@ their own reviewed lifecycle.
|
|
|
30
30
|
|
|
31
31
|
ADS is opinionated about tooling and ownership. Linaria is required for the
|
|
32
32
|
component and pattern styling pipeline. Visual choices belong to the project.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
and behavior profiles
|
|
36
|
-
|
|
37
|
-
no Node/Bun dependency to deployed components.
|
|
33
|
+
ADS bundles its tooling and compiles MCP previews with Bun 1.3.13+, independently
|
|
34
|
+
of the application's build tools. Checking APIs also run on Node. Project scripts
|
|
35
|
+
and behavior profiles retain their explicit interpreter commands; `command:
|
|
36
|
+
"runtime"` inherits the launcher's interpreter. This tooling choice is separate
|
|
37
|
+
from the UI framework and adds no Node/Bun dependency to deployed components.
|
|
38
38
|
The project declares React or native Preact in `ds.config.json` and uses the
|
|
39
39
|
matching compiler and mount adapter. Both integrate with the required styling
|
|
40
40
|
and validation pipeline; additional frameworks need explicit tooling support.
|
|
@@ -174,6 +174,16 @@ Linaria's [colocation and extraction model](https://github.com/callstack/linaria
|
|
|
174
174
|
and [atomic composition model](https://github.com/callstack/linaria/blob/master/docs/ATOMIC_CSS.md)
|
|
175
175
|
support this combination of local ownership and compiled styling.
|
|
176
176
|
|
|
177
|
+
CSS file count is an output detail, not an ownership boundary. The native preview
|
|
178
|
+
compiler attaches extracted styles after JavaScript tree shaking, retaining only
|
|
179
|
+
owners whose generated classes survive in that chunk. Foundation CSS loads first
|
|
180
|
+
to preserve cascade-layer declarations. Owner styles and fonts have separate,
|
|
181
|
+
immutable resource identities, so unchanged CSS survives JavaScript edits and can
|
|
182
|
+
be reused by multiple views. A shared JavaScript chunk can carry styles for its
|
|
183
|
+
shared owners; this is not selector-level pruning of every unused variant. The
|
|
184
|
+
compiler does not inject one whole-system stylesheet into every preview. Product
|
|
185
|
+
builds keep their own bundler's splitting and caching policy.
|
|
186
|
+
|
|
177
187
|
Atomic merging matches property/selector/condition keys; it does not resolve
|
|
178
188
|
every shorthand/logical-property overlap. ADS reports detectable composition
|
|
179
189
|
risks as nonblocking warnings with guidance, while registered rendered checks
|
|
@@ -461,16 +471,17 @@ no API visibility, render coverage, styling permission or runtime behavior.
|
|
|
461
471
|
### Incremental compilation and refresh
|
|
462
472
|
|
|
463
473
|
`runScenarioCompiler` owns scheduling, validation, freshness and publication.
|
|
464
|
-
|
|
465
|
-
framework and Linaria
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
474
|
+
ADS owns preview compilation with Bun, using the project's declared React or
|
|
475
|
+
Preact framework and shared Linaria extraction. The application keeps its own
|
|
476
|
+
production bundler. A single scheduler warms views sequentially with foreground
|
|
477
|
+
priority, retains compiled output, and reuses per-file transforms and worker
|
|
478
|
+
bundles. Native ADS gates run directly; project lint/build/test commands remain
|
|
479
|
+
explicit integration checks. Explorer navigation and metadata are served
|
|
480
|
+
independently of compilation and validation.
|
|
470
481
|
|
|
471
482
|
```mermaid
|
|
472
483
|
flowchart LR
|
|
473
|
-
Edit[Source edit] --> Compile[
|
|
484
|
+
Edit[Source edit] --> Compile[Compile changes with Bun]
|
|
474
485
|
Compile --> Validate[Validate project and inspect registry in background]
|
|
475
486
|
Compile --> Live[Unverified live resources]
|
|
476
487
|
Live --> App[Compare selected dependency closure]
|
|
@@ -545,14 +556,14 @@ Live resources are fenced to the current source digest and managed session.
|
|
|
545
556
|
They never update accepted artifacts, the successful graph cache or `current`.
|
|
546
557
|
Only validation and compilation passing against unchanged source can publish the
|
|
547
558
|
verified graph. Failure restores the last verified view; compilation errors are
|
|
548
|
-
reported without waiting for a slow validation command. Files outside
|
|
559
|
+
reported without waiting for a slow validation command. Files outside the compiled
|
|
549
560
|
module graph still cause validation and build reconciliation. Normal compiler
|
|
550
|
-
shutdown
|
|
561
|
+
shutdown clears its current transform/worker caches and removes its scratch directory.
|
|
551
562
|
|
|
552
|
-
The shared builder
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
563
|
+
The shared Bun builder reuses unchanged worker bundles using source, transitive
|
|
564
|
+
dependency and configuration hashes. Workers compile sequentially in temporary
|
|
565
|
+
Bun processes, which release their heaps before the next worker runs. This build
|
|
566
|
+
cache is separate from source-validation evidence.
|
|
556
567
|
|
|
557
568
|
Accepted MCP edits prepare previews even when no viewer has opened them. A
|
|
558
569
|
matching checked candidate graph and scenario registry carry into the project's existing cache;
|
|
@@ -571,17 +582,16 @@ reuse operation. No file hash is retained across operations. Configuration input
|
|
|
571
582
|
ordering is canonical across Node and Bun; complete caches stay within the
|
|
572
583
|
existing 8 MiB budget rather than silently writing an unreadable large file.
|
|
573
584
|
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
compiler budget; cancellation removes the waiter. Resumption starts a compiler
|
|
579
|
-
only when requested, reusing checked artifacts for unchanged inputs.
|
|
585
|
+
Background acceptance, validation and architecture checks serialize independently
|
|
586
|
+
of the accepted/draft preview lane. They never suspend Explorer's compiler or
|
|
587
|
+
make a cold selection wait for a browser verification suite. Existing publications
|
|
588
|
+
remain readable while interactive source changes compile.
|
|
580
589
|
|
|
581
590
|
For managed resource previews, ADS requests all scenarios in production mode
|
|
582
591
|
through that candidate's compiler. It closes an incremental Rollup graph before
|
|
583
|
-
starting production compilation. The
|
|
584
|
-
|
|
592
|
+
starting production compilation. The candidate compiler is parked after production publication, while its host
|
|
593
|
+
continues serving that immutable graph to registered browser verification.
|
|
594
|
+
Warming an already-current selection does not restart or wait for that compiler.
|
|
585
595
|
Production reuse requires a successful production build of the exact inputs,
|
|
586
596
|
not merely a previously compiled development graph. Project-owned additional
|
|
587
597
|
commands still run as configured. Remove the standalone preview-build command
|
|
@@ -852,9 +862,13 @@ inspector remains available for token source/alias diagnostics, even if project
|
|
|
852
862
|
previews cannot compile; it does not substitute for token scenario coverage.
|
|
853
863
|
The server serves those artifacts; it does not interpret arbitrary component
|
|
854
864
|
code or introduce production UI dependencies. File-change notifications let
|
|
855
|
-
hosts refresh their views.
|
|
856
|
-
|
|
857
|
-
|
|
865
|
+
hosts refresh their views. ADS normally manages its native Bun preview compiler with one launch command.
|
|
866
|
+
Editing access is independent: direct editors can use MCP only for preview/checks,
|
|
867
|
+
while MCP-only editors use enabled mutation tools. Direct editors can instead
|
|
868
|
+
manage compilation externally with `mcp.previewWatch: false`; the external builder
|
|
869
|
+
must publish the ADS resource graph and build evidence. MCP still serves previews,
|
|
870
|
+
but source changes stale their evidence until verified updated output is published.
|
|
871
|
+
See the [editing workflows](../skills/ads-designer/references/workflows.md). Structured build reports distinguish running compilers
|
|
858
872
|
from successful, current previews; diagnostics remain readable even when a host
|
|
859
873
|
does not forward notifications. Older clients retain tools/resources/prompts;
|
|
860
874
|
native skill discovery and Apps presentation depend on the host's capabilities.
|
package/docs/BEHAVIORS.md
CHANGED
|
@@ -371,11 +371,11 @@ Test selection is at owner-contract granularity: when a registered check's input
|
|
|
371
371
|
dependencies intersect changed files, that owner is selected and its registered
|
|
372
372
|
checks run. A shared token/foundation edit can affect every owner. Project check
|
|
373
373
|
scripts still run as configured; ordinary live preview does not automatically run
|
|
374
|
-
browser checks and release validation runs the full suite. Persistent
|
|
374
|
+
browser checks and release validation runs the full suite. Persistent Bun
|
|
375
375
|
compilation and retained preview state do not imply per-test-case execution caches.
|
|
376
376
|
|
|
377
|
-
Guarded mutations execute affected registered behavior contracts after
|
|
378
|
-
|
|
377
|
+
Guarded mutations execute affected registered behavior contracts after native ADS gates
|
|
378
|
+
and configured project checks, before writing source. Imported shared
|
|
379
379
|
controller changes also select dependent contracts conservatively. Rejected and
|
|
380
380
|
dry-run patches publish no source changes. Verification output stays under `.ds/`.
|
|
381
381
|
To check a prepared draft, request its diff and pass the returned `patchFile` to
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,34 +1,89 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.3.
|
|
3
|
+
## 0.3.37
|
|
4
4
|
|
|
5
5
|
<!-- ads-local-tests:start -->
|
|
6
|
-
Local verification: **
|
|
7
|
-
Tested commit: `
|
|
8
|
-
Completed 2026-10-
|
|
6
|
+
Local verification: **574/574 passed** with `ADS_TEST_BUN=1 npm test`.
|
|
7
|
+
Tested commit: `e0e0d53da1b29fdaa1b20735e0726937d5a19dcf`; Node v24.13.0, Bun 1.3.13.
|
|
8
|
+
Completed 2026-10-23T18:18:16.960Z (808 seconds).
|
|
9
9
|
|
|
10
10
|
<!-- ads-local-test-proof
|
|
11
11
|
{
|
|
12
12
|
"schema": 1,
|
|
13
|
-
"version": "0.3.
|
|
14
|
-
"commit": "
|
|
15
|
-
"sourceSha256": "
|
|
13
|
+
"version": "0.3.37",
|
|
14
|
+
"commit": "e0e0d53da1b29fdaa1b20735e0726937d5a19dcf",
|
|
15
|
+
"sourceSha256": "c71441655e5c8a14242842dbbec17b92608f367396f4645f73dcbaa2eb475cb4",
|
|
16
16
|
"command": "ADS_TEST_BUN=1 npm test",
|
|
17
17
|
"result": "pass",
|
|
18
|
-
"tests":
|
|
19
|
-
"pass":
|
|
18
|
+
"tests": 574,
|
|
19
|
+
"pass": 574,
|
|
20
20
|
"fail": 0,
|
|
21
21
|
"cancelled": 0,
|
|
22
22
|
"skipped": 0,
|
|
23
23
|
"node": "v24.13.0",
|
|
24
24
|
"bun": "1.3.13",
|
|
25
|
-
"completedAt": "2026-10-
|
|
26
|
-
"durationMs":
|
|
27
|
-
"logSha256": "
|
|
25
|
+
"completedAt": "2026-10-23T18:18:16.960Z",
|
|
26
|
+
"durationMs": 807676,
|
|
27
|
+
"logSha256": "ef20374b0910acea995128abc9ec590f5e73afafe9d529c43dba8d41f51ba907"
|
|
28
28
|
}
|
|
29
29
|
-->
|
|
30
30
|
<!-- ads-local-tests:end -->
|
|
31
31
|
|
|
32
|
+
- Compile ADS tooling/browser bundles and MCP previews with Bun, independently of
|
|
33
|
+
the application bundler. Native React/Preact JSX, Linaria, static assets and
|
|
34
|
+
self-contained workers share the existing immutable MCP resource boundary.
|
|
35
|
+
- Separate direct source editing from MCP-only draft editing in all five skills,
|
|
36
|
+
shared references, MCP instructions/prompts and project guidance. Ordinary direct
|
|
37
|
+
edits use MCP for previews/checks without compulsory drafts or acceptance.
|
|
38
|
+
- Let direct editors with an external builder disable MCP-started compilation
|
|
39
|
+
with `mcp.previewWatch: false`. The builder publishes resource graphs/evidence;
|
|
40
|
+
retained views stay stale after source changes until a verified update arrives.
|
|
41
|
+
- Attach Linaria CSS after JavaScript tree shaking. Cache foundation, owner
|
|
42
|
+
styles and fonts separately, preserve cascade-layer order, and reuse unchanged
|
|
43
|
+
CSS across views and JavaScript-only changes.
|
|
44
|
+
- Split provably pure public-barrel imports at their owners before bundling,
|
|
45
|
+
respecting the design system package's sideEffects policy. Unrelated public
|
|
46
|
+
exports no longer share unnecessary CSS in a fully warmed graph.
|
|
47
|
+
- Warm the prioritized view then remaining views in one background graph build
|
|
48
|
+
after MCP startup, with one compiler job at a time. Give foreground selections
|
|
49
|
+
priority, retain exact compiled view closures, and reuse unchanged transforms
|
|
50
|
+
and worker bundles. Expose warming progress through Explorer and MCP resources.
|
|
51
|
+
- Run ADS gates directly; remove mandatory Oxlint passes and dependency setup.
|
|
52
|
+
Configuration import guards now run in the native checker. Project checks and
|
|
53
|
+
tests remain explicitly configurable, with CLI/API entry points for setup/CI.
|
|
54
|
+
- Preserve explicit interpreters and memory flags in Bun project scripts instead
|
|
55
|
+
of forcing every child tool onto Bun. ADS's own compiler remains Bun-native.
|
|
56
|
+
- Enforce declared notification lifecycle/root policies and restricted package
|
|
57
|
+
imports in the native ADS gate. No component-specific project linter is needed.
|
|
58
|
+
- Keep unopened lazy modules and their styles off the MCP App resource path.
|
|
59
|
+
Refresh styles of already opened lazy branches while retaining mounted state;
|
|
60
|
+
include an on-demand page composition in ADS's own development example.
|
|
61
|
+
- Reuse compiled graphs after unchanged process restarts, excluding temporary
|
|
62
|
+
generated entry files from source fingerprints. Only loaded module changes
|
|
63
|
+
count toward the App's bounded module-revision reset.
|
|
64
|
+
- Keep informational source-review limitations in JSON/MCP evidence; ordinary CLI
|
|
65
|
+
checks print actionable warnings and errors without advisory-only noise.
|
|
66
|
+
- Move catalogue/status semantic analysis into an idle-retiring worker so the
|
|
67
|
+
running MCP process does not retain repeated TypeScript analysis heaps.
|
|
68
|
+
|
|
69
|
+
- Keep cold and existing Explorer previews independent of background acceptance,
|
|
70
|
+
validation and verification. Park only the candidate compiler after its production
|
|
71
|
+
build; serve its immutable output throughout browser checks.
|
|
72
|
+
- Bootstrap Explorer navigation in one compact resource, removing repeated semantic
|
|
73
|
+
catalog/token discovery and paginated startup calls. Publish index updates through
|
|
74
|
+
MCP resource subscriptions.
|
|
75
|
+
- Cancel superseded preview requests, align their timeout with the compiler budget,
|
|
76
|
+
and expose build failures with an in-place Retry action.
|
|
77
|
+
|
|
78
|
+
## 0.3.36
|
|
79
|
+
|
|
80
|
+
- Allow up to 64 owners in one tracked draft or guarded transaction, with up to
|
|
81
|
+
256 changed files. Related changes share the draft compiler and one final
|
|
82
|
+
acceptance validation; source/patch byte budgets and publication checks remain
|
|
83
|
+
enforced. Share these limits across draft manifests, MCP schemas and patch parsing.
|
|
84
|
+
|
|
85
|
+
## 0.3.35
|
|
86
|
+
|
|
32
87
|
- Bound acceptance memory by parking accepted/draft compilers while retaining
|
|
33
88
|
published views, running candidate architecture checks in a short-lived
|
|
34
89
|
process, and retiring idle semantic workers and temporary program caches.
|