@reqvire-org/ads 0.4.3 → 0.4.5
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 +12 -9
- package/dist/bun-compiler.mjs +6 -5
- package/dist/check.mjs +3 -43
- package/dist/cli.mjs +1 -1
- package/dist/contrast-composition.mjs +6 -60
- package/dist/contrast-styles.mjs +88 -0
- package/dist/mcp/apps.mjs +7 -1
- package/dist/mcp/build-status.mjs +8 -3
- package/dist/mcp/drafts.mjs +13 -1
- package/dist/mcp/preview-http.bundle.js +7 -0
- package/dist/mcp/preview-http.mjs +148 -0
- package/dist/mcp/preview-widget.bundle.js +47 -47
- package/dist/mcp/resource-loader.js +1 -201
- package/dist/mcp/sandbox-host.mjs +6 -1
- package/dist/mcp/server.mjs +35 -4
- package/dist/mcp/showcase-host.mjs +55 -5
- package/dist/mcp/showcase-http.mjs +66 -0
- package/dist/preview-bun.mjs +75 -60
- package/dist/preview-incremental.mjs +358 -0
- package/dist/preview-manifest-update.mjs +70 -0
- package/dist/preview-resources.mjs +33 -1
- package/dist/render-composition.mjs +27 -5
- package/dist/scenarios-compiler.mjs +19 -1
- package/dist/showcase/client.bundle.js +54 -54
- package/dist/showcase/comparison.js +15 -12
- package/dist/showcase/connection.js +10 -0
- package/dist/showcase/http-client.bundle.js +9 -0
- package/dist/showcase/http-connection.js +86 -0
- package/dist/showcase/http-preview.js +81 -0
- package/dist/showcase-http-routes.mjs +31 -0
- package/dist/skills/README.md +3 -3
- package/dist/skills/ads-designer/SKILL.md +5 -1
- package/dist/skills/ads-designer/references/accessibility.md +6 -2
- package/dist/skills/ads-designer/references/captures.md +1 -1
- package/dist/skills/ads-designer/references/runtimes.md +31 -0
- package/dist/skills/ads-designer/references/workflows.md +16 -0
- package/dist/skills/ads-import/references/captures.md +1 -1
- package/dist/skills/ads-import/references/runtimes.md +31 -0
- package/dist/skills/ads-import/references/workflows.md +16 -0
- package/dist/skills/ads-migrate/SKILL.md +3 -1
- package/dist/skills/ads-migrate/references/0.4.1-to-0.4.2.md +2 -3
- package/dist/skills/ads-migrate/references/0.4.3-to-0.4.4.md +89 -0
- package/dist/skills/ads-migrate/references/0.4.4-to-0.4.5.md +72 -0
- package/dist/skills/ads-port/references/captures.md +1 -1
- package/dist/skills/ads-port/references/runtimes.md +31 -0
- package/dist/skills/ads-port/references/workflows.md +16 -0
- package/dist/style-token-rules.mjs +51 -0
- package/dist/verification/browser.mjs +2 -2
- package/docs/ADS.md +9 -7
- package/docs/ARCHITECTURE.md +109 -48
- package/docs/CACHING.md +40 -1
- package/docs/CHANGELOG.md +100 -22
- package/docs/GUIDE.md +37 -10
- package/docs/HTTP-SHOWCASE-POC.md +397 -0
- package/docs/MCP.md +104 -25
- package/docs/benchmarks/README.md +1 -1
- package/docs/benchmarks/http-showcase-optimized.json +1879 -0
- package/docs/benchmarks/http-showcase-profile.json +308 -0
- package/docs/benchmarks/http-showcase.json +3069 -0
- package/package.json +6 -4
|
@@ -25,7 +25,7 @@ ads_capture({
|
|
|
25
25
|
|
|
26
26
|
The ID above is illustrative; use one returned by discovery. `theme` names one of the
|
|
27
27
|
project's declared themes (`ads_status.themes`); the default is the first declared theme at
|
|
28
|
-
1280 × 800 CSS pixels. Capture uses the real
|
|
28
|
+
1280 × 800 CSS pixels. Capture uses the real isolated preview through the local HTTP showcase with the
|
|
29
29
|
requested viewport and excludes showcase navigation. The default image records
|
|
30
30
|
the complete widget viewport, including its current scroll/state; it does not
|
|
31
31
|
automatically stitch every scroll position into one image.
|
|
@@ -152,6 +152,21 @@ ADS resolves the public alias, extracts Linaria using the shared atomic tag
|
|
|
152
152
|
resolver, and registers compiled modules, CSS, fonts, images and workers as
|
|
153
153
|
immutable MCP resources. The selected ADS framework controls JSX compilation.
|
|
154
154
|
|
|
155
|
+
In ADS 0.4.4, watched previews use a private incremental module graph; complete
|
|
156
|
+
Bun builds remain the path for `ads compile` and production-mode verification.
|
|
157
|
+
This is internal tooling. Do not add a project Vite server, preview plugin or
|
|
158
|
+
new compiler process to enable it. Compatible React/Preact edits update the
|
|
159
|
+
existing isolated iframe and can preserve state, focus and selection. Incompatible
|
|
160
|
+
updates, changed hook signatures or rejected-revision recovery can reset state.
|
|
161
|
+
Preview-local state is not a persistence contract or verification evidence.
|
|
162
|
+
|
|
163
|
+
The preview UI reuses bounded, scope-specific manifest revisions and asks for
|
|
164
|
+
changed records internally. Tool results remain graph references. Full-resource
|
|
165
|
+
reads and older-server fallback remain supported. Restart the project's ADS
|
|
166
|
+
runtime and reconnect after upgrading; changing an installed package does not
|
|
167
|
+
replace the running compiler. ADS 0.4.5 also makes HTTP delivery the default for
|
|
168
|
+
the local browser; MCP agents and embedded Apps retain their interfaces.
|
|
169
|
+
|
|
155
170
|
`ads compile .` builds all production previews for project builds or CI.
|
|
156
171
|
`ads compile . --watch` runs the same source scheduler continuously.
|
|
157
172
|
Programmatic project setup can call `compilePreviews` from
|
|
@@ -204,3 +219,19 @@ Unchanged worker output reuses dependency hashes; changes to transitive inputs
|
|
|
204
219
|
rebuild it. Temporary worker compiler processes run sequentially and exit after
|
|
205
220
|
producing output. Their build lifetime is separate from runtime worker cleanup,
|
|
206
221
|
which remains owned by the component/controller.
|
|
222
|
+
|
|
223
|
+
### HTTP showcase delivery (0.4.5)
|
|
224
|
+
|
|
225
|
+
The local browser uses HTTP JSON, checked asset URLs and SSE build reports;
|
|
226
|
+
agents use MCP against the same engine. Use the runtime's normal showcase URL.
|
|
227
|
+
No proof switch, project Vite server or authored-source migration is needed.
|
|
228
|
+
Preview iframes remain isolated and persistent. Workers and referring modules
|
|
229
|
+
use verified Blob URLs where browser sandbox restrictions require them.
|
|
230
|
+
|
|
231
|
+
A broken event stream marks the retained preview potentially stale. ADS reconnects
|
|
232
|
+
and rereads current discovery/build state without periodic status polling; it
|
|
233
|
+
also reconciles when the tab becomes visible. Wait for a current verified preview
|
|
234
|
+
before using it as evidence. Screenshots, audits and behavior checks use the
|
|
235
|
+
local HTTP host with their existing readiness and revision gates. External MCP
|
|
236
|
+
Apps continue to use MCP resources. See the target version's migration guide for
|
|
237
|
+
upgrade/restart instructions; a guide alone does not prove publication.
|
|
@@ -63,3 +63,19 @@ proposal. Do not silently leave requested work only in drafts. This completion
|
|
|
63
63
|
rule also applies to MCP-only drafts; it does not impose draft acceptance on
|
|
64
64
|
ordinary direct source edits. Never import marked `.ads` draft source into
|
|
65
65
|
application or accepted ADS runtime code.
|
|
66
|
+
|
|
67
|
+
## Shipping product MCP widgets
|
|
68
|
+
|
|
69
|
+
Use the application's own MCP server and mounting/action adapter. Import needed
|
|
70
|
+
UI by name from the generated public design-system entry and build from the
|
|
71
|
+
widget entry with the application's production framework/Linaria pipeline.
|
|
72
|
+
Do not embed a complete design-system library, an ADS preview graph, or review
|
|
73
|
+
code. Preserve intentional CSS/JavaScript side effects; inspect the actual
|
|
74
|
+
emitted code, CSS, fonts and artwork for unrelated owners. Shared foundation
|
|
75
|
+
token/theme CSS may remain; JavaScript tree shaking alone does not prove that
|
|
76
|
+
unused component CSS or assets were removed.
|
|
77
|
+
|
|
78
|
+
Verify the served HTML with a real MCP client and Apps host: read the resource,
|
|
79
|
+
render it, exercise an action back to the product server, and check themes,
|
|
80
|
+
fonts and assets without an ADS server running. An ADS showcase or MCP Explorer
|
|
81
|
+
pass establishes development-preview behavior, not the product integration.
|
|
@@ -25,7 +25,7 @@ ads_capture({
|
|
|
25
25
|
|
|
26
26
|
The ID above is illustrative; use one returned by discovery. `theme` names one of the
|
|
27
27
|
project's declared themes (`ads_status.themes`); the default is the first declared theme at
|
|
28
|
-
1280 × 800 CSS pixels. Capture uses the real
|
|
28
|
+
1280 × 800 CSS pixels. Capture uses the real isolated preview through the local HTTP showcase with the
|
|
29
29
|
requested viewport and excludes showcase navigation. The default image records
|
|
30
30
|
the complete widget viewport, including its current scroll/state; it does not
|
|
31
31
|
automatically stitch every scroll position into one image.
|
|
@@ -152,6 +152,21 @@ ADS resolves the public alias, extracts Linaria using the shared atomic tag
|
|
|
152
152
|
resolver, and registers compiled modules, CSS, fonts, images and workers as
|
|
153
153
|
immutable MCP resources. The selected ADS framework controls JSX compilation.
|
|
154
154
|
|
|
155
|
+
In ADS 0.4.4, watched previews use a private incremental module graph; complete
|
|
156
|
+
Bun builds remain the path for `ads compile` and production-mode verification.
|
|
157
|
+
This is internal tooling. Do not add a project Vite server, preview plugin or
|
|
158
|
+
new compiler process to enable it. Compatible React/Preact edits update the
|
|
159
|
+
existing isolated iframe and can preserve state, focus and selection. Incompatible
|
|
160
|
+
updates, changed hook signatures or rejected-revision recovery can reset state.
|
|
161
|
+
Preview-local state is not a persistence contract or verification evidence.
|
|
162
|
+
|
|
163
|
+
The preview UI reuses bounded, scope-specific manifest revisions and asks for
|
|
164
|
+
changed records internally. Tool results remain graph references. Full-resource
|
|
165
|
+
reads and older-server fallback remain supported. Restart the project's ADS
|
|
166
|
+
runtime and reconnect after upgrading; changing an installed package does not
|
|
167
|
+
replace the running compiler. ADS 0.4.5 also makes HTTP delivery the default for
|
|
168
|
+
the local browser; MCP agents and embedded Apps retain their interfaces.
|
|
169
|
+
|
|
155
170
|
`ads compile .` builds all production previews for project builds or CI.
|
|
156
171
|
`ads compile . --watch` runs the same source scheduler continuously.
|
|
157
172
|
Programmatic project setup can call `compilePreviews` from
|
|
@@ -204,3 +219,19 @@ Unchanged worker output reuses dependency hashes; changes to transitive inputs
|
|
|
204
219
|
rebuild it. Temporary worker compiler processes run sequentially and exit after
|
|
205
220
|
producing output. Their build lifetime is separate from runtime worker cleanup,
|
|
206
221
|
which remains owned by the component/controller.
|
|
222
|
+
|
|
223
|
+
### HTTP showcase delivery (0.4.5)
|
|
224
|
+
|
|
225
|
+
The local browser uses HTTP JSON, checked asset URLs and SSE build reports;
|
|
226
|
+
agents use MCP against the same engine. Use the runtime's normal showcase URL.
|
|
227
|
+
No proof switch, project Vite server or authored-source migration is needed.
|
|
228
|
+
Preview iframes remain isolated and persistent. Workers and referring modules
|
|
229
|
+
use verified Blob URLs where browser sandbox restrictions require them.
|
|
230
|
+
|
|
231
|
+
A broken event stream marks the retained preview potentially stale. ADS reconnects
|
|
232
|
+
and rereads current discovery/build state without periodic status polling; it
|
|
233
|
+
also reconciles when the tab becomes visible. Wait for a current verified preview
|
|
234
|
+
before using it as evidence. Screenshots, audits and behavior checks use the
|
|
235
|
+
local HTTP host with their existing readiness and revision gates. External MCP
|
|
236
|
+
Apps continue to use MCP resources. See the target version's migration guide for
|
|
237
|
+
upgrade/restart instructions; a guide alone does not prove publication.
|
|
@@ -63,3 +63,19 @@ proposal. Do not silently leave requested work only in drafts. This completion
|
|
|
63
63
|
rule also applies to MCP-only drafts; it does not impose draft acceptance on
|
|
64
64
|
ordinary direct source edits. Never import marked `.ads` draft source into
|
|
65
65
|
application or accepted ADS runtime code.
|
|
66
|
+
|
|
67
|
+
## Shipping product MCP widgets
|
|
68
|
+
|
|
69
|
+
Use the application's own MCP server and mounting/action adapter. Import needed
|
|
70
|
+
UI by name from the generated public design-system entry and build from the
|
|
71
|
+
widget entry with the application's production framework/Linaria pipeline.
|
|
72
|
+
Do not embed a complete design-system library, an ADS preview graph, or review
|
|
73
|
+
code. Preserve intentional CSS/JavaScript side effects; inspect the actual
|
|
74
|
+
emitted code, CSS, fonts and artwork for unrelated owners. Shared foundation
|
|
75
|
+
token/theme CSS may remain; JavaScript tree shaking alone does not prove that
|
|
76
|
+
unused component CSS or assets were removed.
|
|
77
|
+
|
|
78
|
+
Verify the served HTML with a real MCP client and Apps host: read the resource,
|
|
79
|
+
render it, exercise an action back to the product server, and check themes,
|
|
80
|
+
fonts and assets without an ADS server running. An ADS showcase or MCP Explorer
|
|
81
|
+
pass establishes development-preview behavior, not the product integration.
|
|
@@ -53,4 +53,6 @@ Load only the guide(s) for the requested transition.
|
|
|
53
53
|
|
|
54
54
|
| From | To | Guide |
|
|
55
55
|
|------|----|-------|
|
|
56
|
-
| 0.4.1 | 0.4.2
|
|
56
|
+
| 0.4.1 | 0.4.2 | [Showcase, review boundaries and preview migration](references/0.4.1-to-0.4.2.md) |
|
|
57
|
+
| 0.4.3 | 0.4.4 | [Incremental previews and manifest reuse](references/0.4.3-to-0.4.4.md) |
|
|
58
|
+
| 0.4.4 | 0.4.5 | [HTTP showcase delivery and reconnect behavior](references/0.4.4-to-0.4.5.md) |
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# ADS 0.4.1 → 0.4.2
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
build contains them before applying it; the guide does not publish 0.4.2.
|
|
3
|
+
This guide describes the 0.4.1-to-0.4.2 transition. Confirm the installed target
|
|
4
|
+
version before applying it; later transitions have their own guides.
|
|
6
5
|
|
|
7
6
|
This upgrade includes source/configuration incompatibilities despite the patch
|
|
8
7
|
number. Apply the relevant sections to an existing design system; a fresh starter
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# ADS 0.4.3 → 0.4.4
|
|
2
|
+
|
|
3
|
+
Use the target package's changelog and installed version to confirm availability;
|
|
4
|
+
this guide also accompanies a local 0.4.4 release candidate.
|
|
5
|
+
|
|
6
|
+
This transition changes ADS's managed preview engine. It requires no project
|
|
7
|
+
source rename, token migration, configuration field or replacement mount adapter.
|
|
8
|
+
Keep the application's framework, build tools, TypeScript and runtime. ADS still
|
|
9
|
+
runs on Bun ≥1.4.1. Its internal Vite graph is private; do not add an application
|
|
10
|
+
Vite server or install preview plugins into the consuming project.
|
|
11
|
+
|
|
12
|
+
## Upgrade and reconnect
|
|
13
|
+
|
|
14
|
+
1. Record the installed ADS version and existing dependency/lockfile changes.
|
|
15
|
+
Upgrade with the project's package manager and retain its dependency placement,
|
|
16
|
+
for example `npm install --save-dev @reqvire-org/ads@0.4.4` when ADS is already
|
|
17
|
+
a dev dependency. Use the supplied tarball instead when testing a release candidate.
|
|
18
|
+
2. Stop and restart only this project's ADS runtime using the upgraded installation;
|
|
19
|
+
reconnect the MCP client and reopen the showcase URL it reports. A running old
|
|
20
|
+
server does not acquire the new compiler by updating the package on disk.
|
|
21
|
+
3. Keep drafts and project source. Compiler fingerprints invalidate incompatible
|
|
22
|
+
preview artifacts automatically. Do not delete `.ds/` to force a rebuild: it
|
|
23
|
+
can contain active drafts and evidence. Never edit generated preview files.
|
|
24
|
+
|
|
25
|
+
## Expected preview behavior
|
|
26
|
+
|
|
27
|
+
Watched React/Preact previews now update changed modules inside the existing
|
|
28
|
+
isolated iframe. Compatible edits preserve ordinary component state, input text,
|
|
29
|
+
focus and selection. Hook-signature changes follow framework reset semantics;
|
|
30
|
+
incompatible exports, configuration changes, interrupted updates and rollback to
|
|
31
|
+
an already evaluated old revision can reopen the frame. State preservation is
|
|
32
|
+
conditional, not a durable application-state guarantee.
|
|
33
|
+
|
|
34
|
+
The preview can display compiled feedback before checks finish. For evidence,
|
|
35
|
+
wait for current verified output (`ads_show_scenario` defaults to
|
|
36
|
+
`waitFor:"verified"`). Visible changes, retained state and a running server do not
|
|
37
|
+
establish acceptance. Captures, audits, registered behaviors and exact-revision
|
|
38
|
+
draft acceptance retain their existing gates.
|
|
39
|
+
|
|
40
|
+
The UI reuses known manifests and requests internal resource deltas. Agent-facing
|
|
41
|
+
tool results still provide graph references. Clients reading the existing full
|
|
42
|
+
manifest resource need no change; older servers receive the full-resource fallback.
|
|
43
|
+
Do not persist graph metadata across projects or draft scopes in a custom host.
|
|
44
|
+
|
|
45
|
+
HTTP asset delivery, iframe removal, source-emission/V3 and experimental capture
|
|
46
|
+
repaint changes are outside 0.4.4. Remove proof-only flags from a production launcher
|
|
47
|
+
if an experiment added them; they are not required to enable incremental previews.
|
|
48
|
+
|
|
49
|
+
## Verify the receiving project
|
|
50
|
+
|
|
51
|
+
Run the upgraded local CLI from the project root:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
bun node_modules/@reqvire-org/ads/dist/cli.mjs check .
|
|
55
|
+
bun node_modules/@reqvire-org/ads/dist/cli.mjs compile .
|
|
56
|
+
bun node_modules/@reqvire-org/ads/dist/cli.mjs validate .
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Run the project's typecheck, production build and relevant tests, reusing those
|
|
60
|
+
already registered with validation. In the real showcase, inspect a stateful
|
|
61
|
+
scenario before and after a compatible edit, a style/token edit, lazy content,
|
|
62
|
+
and scenario navigation. Review an existing draft when the project has one;
|
|
63
|
+
do not create or accept unrelated drafts just for migration. Check relevant
|
|
64
|
+
themes, viewport sizes and console/build diagnostics. Full Bun compilation and
|
|
65
|
+
production imports must remain valid alongside watched previews.
|
|
66
|
+
|
|
67
|
+
Ancestor-background contrast checks now cover string/number text props and
|
|
68
|
+
source-resolvable inert/optional layout classes. Investigate actual contrast or
|
|
69
|
+
unresolved-paint findings rather than suppressing them to complete the upgrade.
|
|
70
|
+
|
|
71
|
+
If preview loading fails, confirm the connected project/version, read its build
|
|
72
|
+
diagnostics, repair the named source and retry. For a migration regression,
|
|
73
|
+
preserve the failing fixture and diagnostics; restore only this upgrade's package
|
|
74
|
+
and lockfile changes if rollback is needed, then restart that runtime. Do not
|
|
75
|
+
revert unrelated edits, weaken validation or erase drafts.
|
|
76
|
+
|
|
77
|
+
Report the from/to installed versions, commands and rendered states actually
|
|
78
|
+
verified, unresolved findings, and the running showcase URL. Editing performance
|
|
79
|
+
depends on the project: the integration benchmark showed faster compatible edits
|
|
80
|
+
and lower transfer volume, but slower cold verification and no memory improvement.
|
|
81
|
+
|
|
82
|
+
## HTTP experiment is not a 0.4.4 migration
|
|
83
|
+
|
|
84
|
+
The separate HTTP branch removes MCP from the showcase browser while retaining
|
|
85
|
+
MCP for agents and the same compiler/check/draft services. Its preview iframe
|
|
86
|
+
remains. This requires no changes to project components, scenarios or tokens.
|
|
87
|
+
Do not enable proof environment switches in a release migration or claim that
|
|
88
|
+
0.4.4 includes this transport. Compare the experimental branch against the exact
|
|
89
|
+
release before recommending a later migration.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# ADS 0.4.4 → 0.4.5
|
|
2
|
+
|
|
3
|
+
Confirm the target version in the installed package or registry. This guide also
|
|
4
|
+
accompanies a local release candidate and does not establish publication.
|
|
5
|
+
|
|
6
|
+
This upgrade makes HTTP the default delivery path for the local showcase.
|
|
7
|
+
Components, tokens, scenarios, mount adapters, behavior checks and configuration
|
|
8
|
+
need no migration. Keep the application's framework, package manager, runtime
|
|
9
|
+
and TypeScript. ADS tooling still requires Bun ≥1.4.1.
|
|
10
|
+
|
|
11
|
+
## Upgrade and restart
|
|
12
|
+
|
|
13
|
+
1. Upgrade ADS with the project's existing package manager and dependency
|
|
14
|
+
placement; for an existing npm dev dependency, use
|
|
15
|
+
`npm install --save-dev @reqvire-org/ads@0.4.5`. Use the supplied tarball for
|
|
16
|
+
a candidate. Preserve unrelated dependency and lockfile edits.
|
|
17
|
+
2. Stop and restart only that project's ADS runtime with the upgraded package.
|
|
18
|
+
Reconnect MCP clients and open the normal showcase URL from `ads_status`.
|
|
19
|
+
Remove `ADS_PROOF_HTTP_PREVIEW` from experimental launchers and remove the
|
|
20
|
+
`delivery` query parameter from saved experiment links. Neither is needed.
|
|
21
|
+
3. Keep project source, tracked drafts and `.ds` evidence. ADS invalidates compiler
|
|
22
|
+
artifacts by fingerprint. Do not replace the design system with a starter,
|
|
23
|
+
erase caches wholesale, add a separate preview server or edit generated files.
|
|
24
|
+
|
|
25
|
+
## What changes
|
|
26
|
+
|
|
27
|
+
The local browser gets discovery, checked assets and preview actions over HTTP;
|
|
28
|
+
build reports arrive through SSE. It contains no MCP client. Agents and external
|
|
29
|
+
MCP Apps keep their tools, resources and transports against the same engine.
|
|
30
|
+
One persistent opaque iframe isolates each local preview. Worker scripts and
|
|
31
|
+
referring modules still use verified Blob URLs where the browser requires them.
|
|
32
|
+
|
|
33
|
+
Compatible edits retain state as in 0.4.4; this remains conditional, not durable
|
|
34
|
+
application state. A lost event stream marks the retained preview potentially
|
|
35
|
+
stale. Reconnection and returning to a visible tab reconcile current state
|
|
36
|
+
without periodic browser status polling. A visible update is not proof that
|
|
37
|
+
checks passed. Captures, audits and registered behaviors use verified output;
|
|
38
|
+
exact-revision acceptance and publication gates are unchanged.
|
|
39
|
+
|
|
40
|
+
Custom automation should use the exported `openPreviewScenario` helper and
|
|
41
|
+
locators within the returned frame. The local showcase now has one preview
|
|
42
|
+
iframe instead of an MCP proxy containing another App iframe. Do not depend on
|
|
43
|
+
the old nested-frame selectors. External MCP Apps retain their host's framing.
|
|
44
|
+
Internal `/api/` and asset-capability URLs are not new public integration APIs;
|
|
45
|
+
use CLI/MCP for agent integrations.
|
|
46
|
+
|
|
47
|
+
## Verify the receiving project
|
|
48
|
+
|
|
49
|
+
Run the upgraded local CLI's `check`, `compile` and `validate` commands, plus
|
|
50
|
+
the project's typecheck, production build and relevant tests. Reuse checks
|
|
51
|
+
already registered with validation. Inspect real scenarios in relevant themes
|
|
52
|
+
and viewports, a compatible stateful edit, a token/style edit, and any existing
|
|
53
|
+
draft comparison. Use `ads_capture` for clean and requested guide captures;
|
|
54
|
+
verify selected targets and viewport dimensions when those workflows are used.
|
|
55
|
+
|
|
56
|
+
If the application serves product MCP widgets, keep its own server and build
|
|
57
|
+
integration. Check its served widget in a real MCP client, including an action
|
|
58
|
+
round trip, themes and assets. Confirm that unrelated component code, CSS and
|
|
59
|
+
artwork are absent from that widget's bundle. ADS's development preview tests
|
|
60
|
+
do not replace this product integration check; the HTTP showcase is not a
|
|
61
|
+
new production runtime dependency.
|
|
62
|
+
|
|
63
|
+
If a preview fails, inspect build diagnostics and confirm the connected project
|
|
64
|
+
and installed version. Restart the upgraded runtime rather than adding a
|
|
65
|
+
polling workaround or bypassing checks. Preserve diagnostics and the failing
|
|
66
|
+
fixture for a regression. A rollback restores only this upgrade's package and
|
|
67
|
+
lockfile changes, followed by a runtime restart; keep unrelated work and drafts.
|
|
68
|
+
|
|
69
|
+
Report installed versions, changes, checks actually run and unresolved failures.
|
|
70
|
+
The matched local benchmark improved median edit visibility and response bytes,
|
|
71
|
+
but did not demonstrate a meaningful memory reduction. Do not promise the same
|
|
72
|
+
latency for every project or network.
|
|
@@ -25,7 +25,7 @@ ads_capture({
|
|
|
25
25
|
|
|
26
26
|
The ID above is illustrative; use one returned by discovery. `theme` names one of the
|
|
27
27
|
project's declared themes (`ads_status.themes`); the default is the first declared theme at
|
|
28
|
-
1280 × 800 CSS pixels. Capture uses the real
|
|
28
|
+
1280 × 800 CSS pixels. Capture uses the real isolated preview through the local HTTP showcase with the
|
|
29
29
|
requested viewport and excludes showcase navigation. The default image records
|
|
30
30
|
the complete widget viewport, including its current scroll/state; it does not
|
|
31
31
|
automatically stitch every scroll position into one image.
|
|
@@ -152,6 +152,21 @@ ADS resolves the public alias, extracts Linaria using the shared atomic tag
|
|
|
152
152
|
resolver, and registers compiled modules, CSS, fonts, images and workers as
|
|
153
153
|
immutable MCP resources. The selected ADS framework controls JSX compilation.
|
|
154
154
|
|
|
155
|
+
In ADS 0.4.4, watched previews use a private incremental module graph; complete
|
|
156
|
+
Bun builds remain the path for `ads compile` and production-mode verification.
|
|
157
|
+
This is internal tooling. Do not add a project Vite server, preview plugin or
|
|
158
|
+
new compiler process to enable it. Compatible React/Preact edits update the
|
|
159
|
+
existing isolated iframe and can preserve state, focus and selection. Incompatible
|
|
160
|
+
updates, changed hook signatures or rejected-revision recovery can reset state.
|
|
161
|
+
Preview-local state is not a persistence contract or verification evidence.
|
|
162
|
+
|
|
163
|
+
The preview UI reuses bounded, scope-specific manifest revisions and asks for
|
|
164
|
+
changed records internally. Tool results remain graph references. Full-resource
|
|
165
|
+
reads and older-server fallback remain supported. Restart the project's ADS
|
|
166
|
+
runtime and reconnect after upgrading; changing an installed package does not
|
|
167
|
+
replace the running compiler. ADS 0.4.5 also makes HTTP delivery the default for
|
|
168
|
+
the local browser; MCP agents and embedded Apps retain their interfaces.
|
|
169
|
+
|
|
155
170
|
`ads compile .` builds all production previews for project builds or CI.
|
|
156
171
|
`ads compile . --watch` runs the same source scheduler continuously.
|
|
157
172
|
Programmatic project setup can call `compilePreviews` from
|
|
@@ -204,3 +219,19 @@ Unchanged worker output reuses dependency hashes; changes to transitive inputs
|
|
|
204
219
|
rebuild it. Temporary worker compiler processes run sequentially and exit after
|
|
205
220
|
producing output. Their build lifetime is separate from runtime worker cleanup,
|
|
206
221
|
which remains owned by the component/controller.
|
|
222
|
+
|
|
223
|
+
### HTTP showcase delivery (0.4.5)
|
|
224
|
+
|
|
225
|
+
The local browser uses HTTP JSON, checked asset URLs and SSE build reports;
|
|
226
|
+
agents use MCP against the same engine. Use the runtime's normal showcase URL.
|
|
227
|
+
No proof switch, project Vite server or authored-source migration is needed.
|
|
228
|
+
Preview iframes remain isolated and persistent. Workers and referring modules
|
|
229
|
+
use verified Blob URLs where browser sandbox restrictions require them.
|
|
230
|
+
|
|
231
|
+
A broken event stream marks the retained preview potentially stale. ADS reconnects
|
|
232
|
+
and rereads current discovery/build state without periodic status polling; it
|
|
233
|
+
also reconciles when the tab becomes visible. Wait for a current verified preview
|
|
234
|
+
before using it as evidence. Screenshots, audits and behavior checks use the
|
|
235
|
+
local HTTP host with their existing readiness and revision gates. External MCP
|
|
236
|
+
Apps continue to use MCP resources. See the target version's migration guide for
|
|
237
|
+
upgrade/restart instructions; a guide alone does not prove publication.
|
|
@@ -63,3 +63,19 @@ proposal. Do not silently leave requested work only in drafts. This completion
|
|
|
63
63
|
rule also applies to MCP-only drafts; it does not impose draft acceptance on
|
|
64
64
|
ordinary direct source edits. Never import marked `.ads` draft source into
|
|
65
65
|
application or accepted ADS runtime code.
|
|
66
|
+
|
|
67
|
+
## Shipping product MCP widgets
|
|
68
|
+
|
|
69
|
+
Use the application's own MCP server and mounting/action adapter. Import needed
|
|
70
|
+
UI by name from the generated public design-system entry and build from the
|
|
71
|
+
widget entry with the application's production framework/Linaria pipeline.
|
|
72
|
+
Do not embed a complete design-system library, an ADS preview graph, or review
|
|
73
|
+
code. Preserve intentional CSS/JavaScript side effects; inspect the actual
|
|
74
|
+
emitted code, CSS, fonts and artwork for unrelated owners. Shared foundation
|
|
75
|
+
token/theme CSS may remain; JavaScript tree shaking alone does not prove that
|
|
76
|
+
unused component CSS or assets were removed.
|
|
77
|
+
|
|
78
|
+
Verify the served HTML with a real MCP client and Apps host: read the resource,
|
|
79
|
+
render it, exercise an action back to the product server, and check themes,
|
|
80
|
+
fonts and assets without an ADS server running. An ADS showcase or MCP Explorer
|
|
81
|
+
pass establishes development-preview behavior, not the product integration.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// The style-token rule: a CSS declaration's design values must come from tokens. Shared by
|
|
2
|
+
// `ads check` (owner, review and foundation CSS) and the consumer guard (application CSS).
|
|
3
|
+
import valueParser from "postcss-value-parser";
|
|
4
|
+
import { numericCssUnit, tokenLengthLiteral } from "./css-values.mjs";
|
|
5
|
+
import { isColorKeyword } from "./design-values.mjs";
|
|
6
|
+
|
|
7
|
+
/** Messages for one declaration. `review`: a development review file; `foundation`: a token sheet. */
|
|
8
|
+
export function styleTokenViolations(decl, { review = false, foundation = false } = {}) {
|
|
9
|
+
const violations = new Set();
|
|
10
|
+
if (decl.value.includes("__ds_expression__"))
|
|
11
|
+
violations.add(
|
|
12
|
+
"Cannot establish this interpolated design value from source. Use a source-resolvable shared token/mapping; unknown interpolation does not grant permission for private design values.",
|
|
13
|
+
);
|
|
14
|
+
valueParser(decl.value).walk((node) => {
|
|
15
|
+
if (node.type === "function" && node.value === "url") return false;
|
|
16
|
+
if (node.type === "word" && decl.prop.startsWith("--") && isColorKeyword(node.value))
|
|
17
|
+
violations.add("Component variables map shared Data; named colors also require shared tokens.");
|
|
18
|
+
if (
|
|
19
|
+
node.type === "word" &&
|
|
20
|
+
(/^#[\da-f]{3,8}$/i.test(node.value) ||
|
|
21
|
+
(tokenLengthLiteral(node.value) &&
|
|
22
|
+
!(
|
|
23
|
+
review &&
|
|
24
|
+
/^(?:(?:min-|max-)?(?:width|height|inline-size|block-size)|flex-basis|grid-template-columns|grid-template-rows)$/.test(decl.prop)
|
|
25
|
+
)) ||
|
|
26
|
+
["s", "ms"].includes(numericCssUnit(node.value)))
|
|
27
|
+
)
|
|
28
|
+
violations.add(
|
|
29
|
+
"Use a token for colors, absolute/font-relative lengths (including ch), and durations. Unitless geometry and structural angle/viewport/container relationships remain valid.",
|
|
30
|
+
);
|
|
31
|
+
if (node.type === "function" && /^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|cubic-bezier)$/.test(node.value))
|
|
32
|
+
violations.add("Define color formulas and easing in tokens.");
|
|
33
|
+
if (node.type === "function" && /^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|saturate|sepia)$/.test(node.value))
|
|
34
|
+
violations.add("Define visual filter effects in tokens.");
|
|
35
|
+
if (node.type === "word" && /^ease(?:-in|-out|-in-out)?$/.test(node.value)) violations.add("Use a motion token for easing.");
|
|
36
|
+
if (
|
|
37
|
+
node.type === "word" &&
|
|
38
|
+
/^(?:color|background-color|(?:border|outline|caret|text-decoration|column-rule)(?:-[a-z]+)?-color|fill|stroke)$/.test(decl.prop) &&
|
|
39
|
+
/^[a-z]+$/i.test(node.value) &&
|
|
40
|
+
!/^(?:inherit|initial|unset|revert|currentcolor|transparent|none)$/i.test(node.value)
|
|
41
|
+
)
|
|
42
|
+
violations.add("Use a semantic color token.");
|
|
43
|
+
});
|
|
44
|
+
if (
|
|
45
|
+
/^(?:font-family|font-weight|z-index)$/.test(decl.prop) &&
|
|
46
|
+
!/^(?:var\(|inherit$|initial$|unset$|revert(?:-layer)?$|auto$)/.test(decl.value) &&
|
|
47
|
+
!(foundation && decl.prop === "font-weight" && /^(?:bolder|lighter)$/.test(decl.value))
|
|
48
|
+
)
|
|
49
|
+
violations.add("Use a semantic typography or layering token.");
|
|
50
|
+
return violations;
|
|
51
|
+
}
|
|
@@ -238,7 +238,7 @@ async function openPreviewScenario(page, url, scenario, { timeout = 30000 } = {}
|
|
|
238
238
|
code: state.code ?? "ADS_PREVIEW_STARTUP",
|
|
239
239
|
...state.resourceUri ? { resourceUri: state.resourceUri } : {}
|
|
240
240
|
};
|
|
241
|
-
throw new Error(state.message || "The
|
|
241
|
+
throw new Error(state.message || "The preview failed before verification.");
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
const error = await page.evaluate(() => {
|
|
@@ -255,7 +255,7 @@ async function openPreviewScenario(page, url, scenario, { timeout = 30000 } = {}
|
|
|
255
255
|
}
|
|
256
256
|
await page.waitForTimeout(50);
|
|
257
257
|
}
|
|
258
|
-
throw new Error("Timed out waiting for the selected
|
|
258
|
+
throw new Error("Timed out waiting for the selected preview scenario to become current and ready. Inspect ads_status and ads://project/build.");
|
|
259
259
|
} catch (error) {
|
|
260
260
|
boundary ??= {
|
|
261
261
|
category: requests.length ? "transport" : "runner",
|
package/docs/ADS.md
CHANGED
|
@@ -50,7 +50,7 @@ Websites and MCP Apps consume the same public components, patterns, controllers,
|
|
|
50
50
|
tokens and styles. Application adapters own routing, stores, MCP communication,
|
|
51
51
|
tool-result mapping, mounting and serving. ADS's own MCP server supplies
|
|
52
52
|
design-system development, inspection and review. Its showcase exercises the
|
|
53
|
-
real UI inside an
|
|
53
|
+
real UI inside an isolated preview; normal application checks verify website integration.
|
|
54
54
|
Verification claims remain scoped to the states and environments actually tested.
|
|
55
55
|
|
|
56
56
|
Framework choice belongs to the receiving project. Linaria is required for the
|
|
@@ -60,10 +60,10 @@ for checked formats and gaps.
|
|
|
60
60
|
|
|
61
61
|
## Showcase contract
|
|
62
62
|
|
|
63
|
-
The showcase is a minimal shell
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
The local showcase is a minimal HTTP shell shipped with ADS tooling. It
|
|
64
|
+
discovers brand/token/component/pattern/composition scenarios, invokes scoped
|
|
65
|
+
preview actions and receives build reports through SSE from the shared ADS
|
|
66
|
+
engine. Agents and external MCP Apps retain their MCP interfaces. The project does not author a second catalogue or browser app.
|
|
67
67
|
|
|
68
68
|
`ads mcp` starts the loopback website alongside stdio. Open the URL returned by
|
|
69
69
|
`ads_status`. Without an agent connection, `ads showcase` starts the same runtime
|
|
@@ -74,8 +74,10 @@ and the App slot. The layout inspector draws selected bounds, grid tracks, gaps,
|
|
|
74
74
|
padding, margins and mini-unit squares from actual rendered geometry inside the
|
|
75
75
|
App, following size and scroll position. It draws tracks only where grid tracks
|
|
76
76
|
exist. `ads_capture` can select the same layers through its optional `guides`
|
|
77
|
-
argument; omitted guides leave screenshots clean. The browser
|
|
78
|
-
|
|
77
|
+
argument; omitted guides leave screenshots clean. The local browser uses one
|
|
78
|
+
persistent opaque preview iframe on a separate origin; external MCP Apps use
|
|
79
|
+
their host sandbox. Project runtimes, styles, fonts and UI remain inside the
|
|
80
|
+
preview frame. Components, patterns,
|
|
79
81
|
token values, scenarios, fixtures and their Linaria styles remain project-owned.
|
|
80
82
|
App presentation comes from the selected compiled scenario; reusable review layouts live in development-only `review/` through its separate public entry. Do not recreate
|
|
81
83
|
production widgets inside the client or scenario.
|