@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
package/dist/showcase/index.html
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
<button data-section="patterns"><svg viewBox="0 0 16 16"><rect x="2" y="2" width="5" height="5"/><rect x="10" y="2" width="4" height="5"/><rect x="2" y="10" width="5" height="4"/><rect x="10" y="10" width="4" height="4"/></svg>Patterns</button>
|
|
11
11
|
<button data-section="composition"><svg viewBox="0 0 16 16"><path d="M2 2h4v4H2zM10 2h4v4h-4zM2 10h4v4H2zM10 10h4v4h-4z"/></svg>Composition</button>
|
|
12
12
|
</nav>
|
|
13
|
-
<div class="actions"><button id="preview-status" data-phase="opening" aria-label="Preview status: Connecting to ADS MCP…" title="Connecting to ADS MCP…" popovertarget="status-details"><span class="status-dot" aria-hidden="true"></span></button><div id="status-details" popover><p id="status" role="status">Connecting to ADS MCP…</p></div><button id="viewport" aria-label="Phone viewport" aria-pressed="false" aria-controls="frame-slot" title="Preview at phone width (390 px)"><svg viewBox="0 0 16 16" aria-hidden="true"><rect x="4" y="1" width="8" height="14" rx="1.5"/><path d="M7 12.5h2"/></svg></button><button id="theme" aria-label="Use dark theme" title="Use dark theme"><svg viewBox="0 0 16 16"><path d="M13.5 9a5.5 5.5 0 0 1-6.5-6.5A5.5 5.5 0 1 0 13.5 9Z"/></svg></button><button id="minimize" aria-label="Minimize showcase menu" title="Minimize showcase menu (refresh to restore)"><svg viewBox="0 0 16 16"><path d="m4 10 4-4 4 4"/></svg></button></div>
|
|
13
|
+
<div class="actions"><button id="preview-status" data-phase="opening" aria-label="Preview status: Connecting to ADS MCP…" title="Connecting to ADS MCP…" popovertarget="status-details"><span class="status-dot" aria-hidden="true"></span></button><div id="status-details" popover><p id="status" role="status">Connecting to ADS MCP…</p><p id="warmup-status" hidden></p></div><button id="viewport" aria-label="Phone viewport" aria-pressed="false" aria-controls="frame-slot" title="Preview at phone width (390 px)"><svg viewBox="0 0 16 16" aria-hidden="true"><rect x="4" y="1" width="8" height="14" rx="1.5"/><path d="M7 12.5h2"/></svg></button><button id="theme" aria-label="Use dark theme" title="Use dark theme"><svg viewBox="0 0 16 16"><path d="M13.5 9a5.5 5.5 0 0 1-6.5-6.5A5.5 5.5 0 1 0 13.5 9Z"/></svg></button><button id="minimize" aria-label="Minimize showcase menu" title="Minimize showcase menu (refresh to restore)"><svg viewBox="0 0 16 16"><path d="m4 10 4-4 4 4"/></svg></button></div>
|
|
14
14
|
</header>
|
|
15
|
-
<main><aside id="sidebar"><nav id="entries" aria-label="Tokens"></nav></aside><section id="preview" aria-label="Preview"><div id="loader" role="status" aria-label="Loading preview" hidden><span class="spinner" aria-hidden="true"></span></div><div id="frame-slot"></div></section></main>
|
|
15
|
+
<main><aside id="sidebar"><nav id="entries" aria-label="Tokens"></nav></aside><section id="preview" aria-label="Preview"><div id="loader" role="status" aria-label="Loading preview" hidden><span class="spinner" aria-hidden="true"></span></div><div id="preview-error" role="alert" hidden><p id="preview-error-message"></p><button id="retry-preview" type="button">Retry preview</button></div><div id="frame-slot"></div></section></main>
|
|
16
16
|
<script type="module" src="/client.js"></script>
|
|
17
17
|
</body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function S(t,o){let h=new DOMParser().parseFromString(t,"text/html"),f=h.createElement("meta");if(f.httpEquiv="Content-Security-Policy",f.content=o,h.head.prepend(f),!h.querySelector("base[href]")){let E=h.querySelector("base")??h.createElement("base");E.setAttribute("href","about:srcdoc"),f.after(E)}return"<!doctype html>"+h.documentElement.outerHTML}var y=new URL(location.href).searchParams.get("parent"),b;function r(t=[]){return t.filter((o)=>/^(?:https?:\/\/[a-z0-9.*:[\]-]+(?::\d+)?|data:|blob:|about:)$/i.test(o)).join(" ")}function l(t={}){let o=r(t.resourceDomains);return`default-src 'none';script-src 'unsafe-inline' 'wasm-unsafe-eval' ${o};style-src 'unsafe-inline' ${o};img-src data: ${o};font-src ${o||"'none'"};media-src ${o||"'none'"};worker-src ${o||"'none'"};connect-src ${r(t.connectDomains)||"'none'"};frame-src ${r(t.frameDomains)||"'none'"};base-uri about: ${r(t.baseUriDomains)};object-src 'none';form-action 'none'`}window.addEventListener("message",(t)=>{if(t.source===parent&&t.origin===y){let o=t.data;if(o?.method==="ui/notifications/sandbox-resource-ready"){let{html:h,csp:f}=o.params??{};if(typeof h!=="string")return;b?.remove(),b=window.document.createElement("iframe"),b.title="Design-system App",b.setAttribute("sandbox","allow-scripts allow-forms"),window.document.body.append(b),b.srcdoc=S(h,l(f))}else if(o?.jsonrpc==="2.0"&&!o.method?.startsWith("ui/notifications/sandbox-"))b?.contentWindow.postMessage(o,"*")}else if(t.source===b?.contentWindow&&t.data?.jsonrpc==="2.0"&&!t.data.method?.startsWith("ui/notifications/sandbox-"))parent.postMessage(t.data,y)});parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-ready",params:{}},y);
|
package/dist/showcase/style.css
CHANGED
|
@@ -21,3 +21,7 @@ main{flex:1;min-height:0;display:flex}#sidebar{width:var(--pane-width);flex:none
|
|
|
21
21
|
.draft-badge{display:inline-block;font-size:11px;font-weight:400;white-space:nowrap;padding:1px 5px;margin-inline-start:8px;border:1px solid var(--frame-line);border-radius:4px}.draft-comparison{height:100%;display:grid;grid-template-columns:minmax(0,1fr);min-width:0}.draft-comparison[data-split="true"]{grid-template-columns:repeat(2,minmax(0,1fr))}.draft-version{display:flex;flex-direction:column;min-width:0;min-height:0}.draft-version+ .draft-version{border-inline-start:1px solid var(--frame-line)}.draft-version h2{font-size:12px;font-weight:600;padding:6px 12px;margin:0;border-bottom:1px solid var(--frame-line)}.draft-stage{flex:1;min-height:0;display:flex;justify-content:center}.draft-stage iframe{min-width:0}
|
|
22
22
|
:root[data-viewport="phone"] #frame-slot:has(.draft-comparison){width:100%}:root[data-viewport="phone"] .draft-stage iframe{width:min(390px,100%)}
|
|
23
23
|
@media(max-width:760px){.draft-comparison[data-split="true"]{grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(2,minmax(0,1fr))}.draft-version+ .draft-version{border-inline-start:0;border-top:1px solid var(--frame-line)}}
|
|
24
|
+
|
|
25
|
+
#preview-error{flex-shrink:0;margin:16px;max-height:40vh;overflow:auto;padding:16px;border:1px solid var(--frame-line);border-radius:6px;background:var(--frame-bg);color:var(--frame-ink)}#preview-error-message{margin:0 0 12px;white-space:pre-wrap;overflow-wrap:anywhere}
|
|
26
|
+
|
|
27
|
+
#preview-status[data-warmup="warming"][data-phase="ready"] .status-dot{background:transparent;border:1.5px solid currentColor;animation:status-pulse 1.6s ease-in-out infinite}#warmup-status{margin:8px 0 0;opacity:.7}
|
|
@@ -3,30 +3,27 @@ name: ads-break-ui
|
|
|
3
3
|
description: Stress-test a project's local design-system components or patterns with extreme realistic content, empty and failure states, narrow containers, and accessibility settings. Build development fixtures, report layout failures, and fix them when requested.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
##
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
dependent drafts to its final implementation. Never import `.ads` draft files
|
|
28
|
-
into application or accepted ADS code. Shared token drafts support discovered
|
|
29
|
-
groups from `ads_tokens.tokenGroups`; they remain owned by `tokens`.
|
|
6
|
+
## Choose the editing workflow
|
|
7
|
+
|
|
8
|
+
Read [direct editing and MCP-only editing](references/workflows.md) and use the
|
|
9
|
+
route matching the user's instructions and your actual source access:
|
|
10
|
+
|
|
11
|
+
- **Direct code access:** edit owned files with the normal editor; use MCP for
|
|
12
|
+
discovery, preview, captures and validation. Ordinary source edits do not
|
|
13
|
+
require a tracked draft or `ads_accept`, even when MCP mutations are enabled.
|
|
14
|
+
- **MCP-only access:** use source/draft mutation tools, rendered review and
|
|
15
|
+
exact-revision acceptance. Follow [tracked drafts](references/drafts.md).
|
|
16
|
+
Without mutation tools or another source channel, editing is unavailable.
|
|
17
|
+
|
|
18
|
+
Direct editors can also choose tracked drafts for isolation and comparison.
|
|
19
|
+
When using drafts, do not report coherent design work complete before reviewing
|
|
20
|
+
and accepting its required proposals. If blocked, report the exact unfinished
|
|
21
|
+
draft/blocker; retain a proposal intentionally only when the user requests it.
|
|
22
|
+
Auto mode means agent review, without an extra human approval step.
|
|
23
|
+
|
|
24
|
+
Compiler ownership is independent: direct edits normally use ADS's managed
|
|
25
|
+
compiler. `mcp.previewWatch: false` is the externally managed builder variant;
|
|
26
|
+
MCP serves published previews and evidence without starting a compiler.
|
|
30
27
|
|
|
31
28
|
|
|
32
29
|
For validation scope, full audits, and CLI/MCP parity, read
|
|
@@ -52,7 +49,8 @@ inside a different or nested repository. Inspect the selected public API, owning
|
|
|
52
49
|
source/available guides and relevant tokens, then mount its discovered scenario.
|
|
53
50
|
Metadata and source reads do not prove rendered behavior.
|
|
54
51
|
|
|
55
|
-
|
|
52
|
+
For MCP-only guarded editing with `ads_status.mutations.enabled`, discover the
|
|
53
|
+
owner with `ads_units`, read
|
|
56
54
|
relevant ranges with `ads_read_file` and send only a Git unified diff through
|
|
57
55
|
`ads_apply_patch({ unit, patch, dryRun })`. A unit includes its own implementation,
|
|
58
56
|
scenarios and fixtures; imported peers remain separate. `tokens` is the token
|
|
@@ -78,8 +76,9 @@ Intentional configuration, rule exceptions, registered guard code and compiler
|
|
|
78
76
|
changes use `configuration`; validate the proposed settings and keep mandatory
|
|
79
77
|
ADS gates. For binary/large assets, generate `git diff --binary --full-index` into
|
|
80
78
|
`.ds/patches/<name>.patch` and send `patchFile` instead of inline `patch`, so bytes
|
|
81
|
-
stay out of model context. Binary changes require Git.
|
|
82
|
-
use the
|
|
79
|
+
stay out of model context. Binary changes require Git. These tool instructions
|
|
80
|
+
apply to the MCP editing route; direct editors use the workflow above and run
|
|
81
|
+
the same required gates/checks.
|
|
83
82
|
For owner drafts, token-sample reconciliation, coupled transactions and local
|
|
84
83
|
shared Data ownership, read [guarded-editing.md](references/guarded-editing.md).
|
|
85
84
|
For on-demand current/candidate screenshots and visual dry-run review, read
|
|
@@ -234,13 +233,13 @@ initialize the entry. Several contextual public parts may share one scenario.
|
|
|
234
233
|
IDs derive from ADS-relative filenames: both `components/core/Button/Button.ads.scenario.tsx`
|
|
235
234
|
and `components/core/Button.ads.scenario.tsx` identify `components/core/Button`.
|
|
236
235
|
Use one form, no duplicate IDs or hand-maintained registry. Renames change IDs.
|
|
237
|
-
The showcase and external hosts mount the same discovered entry.
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
236
|
+
The showcase and external hosts mount the same discovered entry. ADS owns Bun
|
|
237
|
+
preview compilation and Linaria extraction independently of the application's
|
|
238
|
+
bundler. Configure the ADS framework and preview manifest; keep the project-owned
|
|
239
|
+
framework mount adapter and its cleanup. Use `ads compile` for standalone/CI
|
|
240
|
+
preview builds. MCP discovers metadata without importing executable TSX. Read
|
|
241
|
+
[Runtime and compiler setup](references/runtimes.md) when setting up or migrating
|
|
242
|
+
the compiler.
|
|
244
243
|
Use `ads_scenarios` (query/kind/limit) and `ads_show_scenario({id})` to open an exact
|
|
245
244
|
entry. Check its build freshness; HTML delivery is not browser verification.
|
|
246
245
|
If Apps or resource forwarding are unavailable, open that scenario in the real
|
|
@@ -338,10 +337,10 @@ the ADS server package itself. Persistent SSE/notification streams make
|
|
|
338
337
|
|
|
339
338
|
|
|
340
339
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
340
|
+
Run ADS's own gates directly with `ads check`; acceptance and validation do not
|
|
341
|
+
require Oxlint. Register project-specific checks as explicit package scripts in
|
|
342
|
+
`mcp.mutationChecks` / `validation.checks`, and behavior tests through ADS contracts.
|
|
343
|
+
A project can use its own linter in those scripts when desired. Measured renderer properties and documented
|
|
345
344
|
non-state hooks use explicit `boundaries`; shared token writes and primitive
|
|
346
345
|
state overrides cannot be allowlisted. When migrating JSX inline geometry to
|
|
347
346
|
imperative writes, port the source and replace its own boundary entries together
|
|
@@ -382,8 +381,8 @@ For example, a visually truncated identifier may need a way to retrieve its full
|
|
|
382
381
|
value. Preserve documented states, accessibility, and source credits.
|
|
383
382
|
|
|
384
383
|
Keep useful regression fixtures. Add tests for demonstrated behavior defects
|
|
385
|
-
where they give lasting coverage. A
|
|
386
|
-
|
|
384
|
+
where they give lasting coverage. A project-specific static guard is appropriate only when it can establish a
|
|
385
|
+
concrete public-API misuse; register it as an explicit project check and document
|
|
387
386
|
accepted/rejected examples and false-positive limits. Layout quality remains a
|
|
388
387
|
rendered check.
|
|
389
388
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
# Tracked drafts and auto-mode acceptance
|
|
2
2
|
|
|
3
|
-
Use this workflow for iterative design
|
|
4
|
-
|
|
3
|
+
Use this workflow for MCP-only iterative design, or when a direct editor chooses
|
|
4
|
+
tracked proposals for isolation and comparison. Ordinary direct source edits use
|
|
5
|
+
the separate [direct editing workflow](workflows.md#direct-design-system-code-access)
|
|
6
|
+
and do not require draft acceptance. Auto mode means the agent reviews the
|
|
7
|
+
rendered result and accepts it; it does not introduce a human approval gate.
|
|
5
8
|
Human acceptance controls are not part of this version.
|
|
6
9
|
|
|
7
10
|
## Complete a coherent design change
|
|
@@ -24,6 +27,12 @@ For example, `Button.tsx.ads` maps to the normal `Button.tsx` target. The final
|
|
|
24
27
|
`.ads` extension keeps proposed code out of default TypeScript/lint discovery,
|
|
25
28
|
without editing project tsconfig files. The manifest remains
|
|
26
29
|
`proposal.ads.draft.json`. These are ordinary tracked project files: commit them and review them in a PR.
|
|
30
|
+
|
|
31
|
+
A draft may group up to 64 owners and 256 tracked files. For related changes,
|
|
32
|
+
use one multi-owner draft: its previews share a compiler workspace and acceptance
|
|
33
|
+
validates the combined candidate once, then applies all changes together. The
|
|
34
|
+
existing source and patch byte budgets still apply.
|
|
35
|
+
|
|
27
36
|
Git is not required to create or recover a draft. Restarting ADS or cloning the
|
|
28
37
|
project discovers the same source. Generated compiler workspaces and execution
|
|
29
38
|
events remain under ignored `.ds/`; an interrupted check is never a pass.
|
|
@@ -120,7 +129,7 @@ current rendered revision and complete acceptance before finishing the change.
|
|
|
120
129
|
## Accept or drop
|
|
121
130
|
|
|
122
131
|
After rendered review, call `ads_accept({id,revision})` once. It checks that exact
|
|
123
|
-
revision, runs mandatory ADS/
|
|
132
|
+
revision, runs mandatory ADS/configured project checks and affected
|
|
124
133
|
behavior checks against an isolated candidate, and applies passing changes at
|
|
125
134
|
their normal paths. Changes during checking or baseline conflicts prevent
|
|
126
135
|
application. Successful acceptance removes the proposal and records an event.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# Advanced guarded editing
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Choose [direct editing or MCP-only editing](workflows.md) first. This reference
|
|
4
|
+
covers MCP's guarded patch tools, not a requirement to route direct source edits
|
|
5
|
+
through MCP. For MCP-only iterative design, prefer [tracked drafts](drafts.md):
|
|
6
|
+
edit and preview the proposal, then review and accept its exact revision.
|
|
6
7
|
The disposable `.ds/patch-drafts/` copies described below are low-level patch
|
|
7
8
|
staging for focused repairs and migrations, not tracked review proposals.
|
|
8
9
|
|
|
@@ -104,8 +105,8 @@ of duplicating them across units. Do not create an asset group or bypass a guard
|
|
|
104
105
|
to add these documents. Code/configuration and hidden/generated paths remain
|
|
105
106
|
outside documentation ownership.
|
|
106
107
|
|
|
107
|
-
For genuinely coupled changes, `ads_apply_transaction` accepts 2–
|
|
108
|
-
patches (
|
|
108
|
+
For genuinely coupled changes, `ads_apply_transaction` accepts 2–64 distinct owner
|
|
109
|
+
patches (256 distinct files and 16 MiB combined). Each patch keeps its ownership and
|
|
109
110
|
companion restrictions. Patches apply in order; later shared-entry hunks match the
|
|
110
111
|
earlier candidate. All guards, registered checks and affected behavior checks run
|
|
111
112
|
on the final candidate before live source is written. Dry-run first. Rejection,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ADS compilation and project runtimes
|
|
2
2
|
|
|
3
|
-
ADS
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
ADS tooling and MCP previews use Bun 1.3.13+ for bundling. Install Bun before
|
|
4
|
+
using the ADS CLI. The consuming application keeps its own package manager,
|
|
5
|
+
bundler, framework and production build. Node-compatible ADS checking APIs remain
|
|
6
|
+
available to projects that run their own checks under Node.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
Use the installed/pinned ADS version. For npm projects:
|
|
8
9
|
|
|
9
10
|
```sh
|
|
10
11
|
npx @reqvire-org/ads init --framework react
|
|
@@ -12,156 +13,106 @@ npm install
|
|
|
12
13
|
npm run build
|
|
13
14
|
```
|
|
14
15
|
|
|
15
|
-
For Bun:
|
|
16
|
+
For Bun projects:
|
|
16
17
|
|
|
17
18
|
```sh
|
|
18
|
-
bunx
|
|
19
|
+
bunx @reqvire-org/ads init --framework react
|
|
19
20
|
bun install
|
|
20
|
-
bun
|
|
21
|
+
bun run build
|
|
21
22
|
```
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
`--bun` is essential to an explicit Bun runtime choice: many JavaScript tools
|
|
30
|
-
have a `#!/usr/bin/env node` shebang. Bun can otherwise launch Node when it is
|
|
31
|
-
available. Generated ADS scripts force Bun, including Oxlint and its JavaScript
|
|
32
|
-
plugins. Existing application scripts and lockfiles are preserved; translate
|
|
33
|
-
nested `npm` commands when intentionally converting an application to Bun.
|
|
34
|
-
Dependency packages and custom build commands must support the chosen runtime.
|
|
35
|
-
|
|
36
|
-
For ordinary `bun run build` commands to always select Bun, the project may
|
|
37
|
-
set its own `bunfig.toml`:
|
|
38
|
-
|
|
39
|
-
```toml
|
|
40
|
-
[run]
|
|
41
|
-
bun = true
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
This is equivalent to passing `--bun` for script execution. ADS does not replace
|
|
45
|
-
an existing Bun configuration. Keep the explicit flag in MCP launch settings.
|
|
24
|
+
Select `preact` for native Preact. Preserve project metadata and lockfiles.
|
|
25
|
+
ADS's `lint:ds` setup runs `ads check .` directly. ADS gates do not require
|
|
26
|
+
Oxlint. Projects can run their chosen linter through their own explicitly
|
|
27
|
+
configured check scripts. Init preserves application scripts and adds the ADS
|
|
28
|
+
check/assets step to its existing build hook.
|
|
46
29
|
|
|
47
30
|
## MCP connection
|
|
48
31
|
|
|
49
|
-
|
|
32
|
+
Choose [direct code editing or MCP-only editing](workflows.md) independently of
|
|
33
|
+
compiler ownership. Read-only MCP supports direct editors using preview/check
|
|
34
|
+
tools. `--mutations` exposes MCP source editing; it does not force that workflow.
|
|
50
35
|
|
|
51
36
|
```json
|
|
52
|
-
{
|
|
53
|
-
"command": "bunx",
|
|
54
|
-
"args": ["--bun", "@reqvire-org/ads", "mcp"]
|
|
55
|
-
}
|
|
37
|
+
{"command":"bunx","args":["--bun","@reqvire-org/ads","mcp"]}
|
|
56
38
|
```
|
|
57
39
|
|
|
58
|
-
Add `--mutations`
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
40
|
+
Add `--mutations` for guarded edits and `--port` if a fixed Explorer port is
|
|
41
|
+
needed. Use the generated `ads-mcp` / `ads-read-mcp` package scripts for a local
|
|
42
|
+
installation. Keep stdout for JSON-RPC. Explicit project behavior-profile
|
|
43
|
+
commands retain their own runtime requirements; `runtime` selects ADS's launcher.
|
|
44
|
+
ADS dispatches Bun project checks with `bun run`, preserving explicitly selected
|
|
45
|
+
Node/Bun commands and their flags. Use `bun` in a script when that individual tool
|
|
46
|
+
must run on Bun; ADS does not force the application's tools onto its own runtime.
|
|
62
47
|
|
|
63
|
-
##
|
|
48
|
+
## Native preview compilation
|
|
64
49
|
|
|
65
|
-
|
|
50
|
+
Configure the framework and generated manifest:
|
|
66
51
|
|
|
67
52
|
```json
|
|
68
|
-
{
|
|
69
|
-
"mcp": {
|
|
70
|
-
"previewWatch": {
|
|
71
|
-
"command": "runtime",
|
|
72
|
-
"args": ["scripts/build-mcp-previews.mjs", "--watch"]
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
53
|
+
{"framework":"react","mcp":{"previewManifest":".ds/preview/manifest.json"}}
|
|
76
54
|
```
|
|
77
55
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
ADS
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
`
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
checks and
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
incompatible output falls back to background compilation. The connected showcase
|
|
142
|
-
can prefetch changed peers' static bytes without evaluating or mounting them.
|
|
143
|
-
Reuse depends on content and dependencies, with no time-based expiry. Preparation
|
|
144
|
-
does not establish additional behavior or visual evidence.
|
|
145
|
-
|
|
146
|
-
The App preserves selected form/scroll state across accepted unrelated graph
|
|
147
|
-
updates, reruns audits and remounts when its own module/style/asset closure changes.
|
|
148
|
-
Do not promise component-level HMR. Guarded edits select affected behavior owners
|
|
149
|
-
from their input dependencies and run their registered checks; project scripts
|
|
150
|
-
remain as configured and releases run the complete suite. Incremental compilation
|
|
151
|
-
alone does not make arbitrary lint/typecheck/test scripts incremental.
|
|
152
|
-
|
|
153
|
-
Preview watching excludes standard output trees by default, including nested
|
|
154
|
-
Cargo `target/` directories, without allocating watches inside them. Explicit
|
|
155
|
-
`sourceDir` and `dsDir` take priority over those default output names. Register
|
|
156
|
-
custom outputs in `assets.generatedPaths`; do not copy the default list into a
|
|
157
|
-
new project's config. `ENOSPC` from `fs.watch` can mean the OS watch limit rather
|
|
158
|
-
than disk space: inspect the failing path and generated-tree traversal before
|
|
159
|
-
raising system limits or deleting files. Generated churn must not mark previews
|
|
160
|
-
stale; actual source changes must still rebuild.
|
|
161
|
-
|
|
162
|
-
Bundled binary renderers may load their forwarded `blob:` resources. ADS's
|
|
163
|
-
showcase/explorer permits WebAssembly compilation while keeping JavaScript eval
|
|
164
|
-
and undeclared network requests blocked. External MCP hosts control their CSP.
|
|
165
|
-
Test the actual renderer inside the App; a successful website build does not
|
|
166
|
-
establish binary-resource or WebAssembly support. Keep transport and resource
|
|
167
|
-
loading in explicit injected adapters or declared renderer dependencies.
|
|
56
|
+
ADS supplies its Bun compiler automatically. Remove the project's former
|
|
57
|
+
`mcp.previewWatch` command when adopting native compilation. No Vite/Rollup
|
|
58
|
+
preview adapter or application compiler configuration is needed. Keep the
|
|
59
|
+
framework mount in `design-system/showcase/mcp/main.tsx` (relative to the actual
|
|
60
|
+
ADS root); it exports `mountScenario(Scenario,container)` and returns cleanup.
|
|
61
|
+
ADS resolves the public alias, extracts Linaria using the shared atomic tag
|
|
62
|
+
resolver, and registers compiled modules, CSS, fonts, images and workers as
|
|
63
|
+
immutable MCP resources. The selected ADS framework controls JSX compilation.
|
|
64
|
+
|
|
65
|
+
`ads compile .` builds all production previews for project builds or CI.
|
|
66
|
+
`ads compile . --watch` runs the same source scheduler continuously.
|
|
67
|
+
Programmatic project setup can call `compilePreviews` from
|
|
68
|
+
`@reqvire-org/ads/scenarios/compile`. A project may run `ads check`, `ads verify`
|
|
69
|
+
or `ads validate` explicitly in its own scripts/CI; these commands use the same
|
|
70
|
+
ADS gates and registered behavior tests as MCP. Keep application production
|
|
71
|
+
builds and project tests as registered checks where integration needs them.
|
|
72
|
+
|
|
73
|
+
## Responsive Explorer
|
|
74
|
+
|
|
75
|
+
MCP starts serving before warming finishes. One shared compiler warms the last selected view first, then the remaining
|
|
76
|
+
graph in one background build. Compiler jobs run sequentially; a foreground
|
|
77
|
+
selection takes priority over queued background work. Reuse retained output and the current per-file
|
|
78
|
+
Linaria/worker cache; do not introduce one compiler per view or retain revision
|
|
79
|
+
histories in memory. Completed unchanged views require no compilation to open.
|
|
80
|
+
For direct editing with an external builder, set `mcp.previewWatch: false`.
|
|
81
|
+
An agent or human edits code and runs `ads compile .` (or manages its watch mode
|
|
82
|
+
externally); MCP only serves/inspects the published previews and starts no
|
|
83
|
+
compiler. A compatible builder must publish the ADS resource graph and build
|
|
84
|
+
evidence, not just an application bundle. Existing views can remain visible while
|
|
85
|
+
building, but changed source makes their evidence stale until a verified update
|
|
86
|
+
is published. Direct editing normally uses the managed compiler; omit the setting
|
|
87
|
+
or use null for that default. See [the two editing workflows](workflows.md).
|
|
88
|
+
|
|
89
|
+
`ads://project/build` exposes `warmup` progress (`state`, `completed`, `total`,
|
|
90
|
+
`failed`) alongside each view's freshness and diagnostics. Supported clients
|
|
91
|
+
subscribe to build/resource updates; Explorer follows them automatically.
|
|
92
|
+
Navigation bootstraps through the compact `ads://project/explorer` resource.
|
|
93
|
+
Semantic discovery runs in a worker, outside the interactive request loop.
|
|
94
|
+
|
|
95
|
+
Watched builds publish explicitly unverified feedback while ADS validation and
|
|
96
|
+
semantic checks continue. Keep the previous preview visible until the replacement
|
|
97
|
+
is available. A preview request has a bounded compiler budget and Retry action;
|
|
98
|
+
changing the selection cancels the superseded request. Do not use network idle
|
|
99
|
+
as readiness: persistent MCP streams remain active.
|
|
100
|
+
|
|
101
|
+
`ads_show_scenario` and `ads_show_tokens` default to `waitFor:"verified"`.
|
|
102
|
+
Interactive browsing may use `waitFor:"compiled"`; `build.current:false` or
|
|
103
|
+
`build.live.validated:false` cannot establish passing evidence. Captures,
|
|
104
|
+
behavior checks and publication still require verified current output.
|
|
105
|
+
|
|
106
|
+
Acceptance builds the complete candidate in production mode, then releases its
|
|
107
|
+
compiler while browser checks use the hosted immutable graph. Interactive
|
|
108
|
+
accepted/draft previews stay available throughout. Background checks serialize
|
|
109
|
+
without borrowing the interactive compiler. Keep configured project checks;
|
|
110
|
+
remove a duplicate standalone preview build from `mcp.mutationChecks` because
|
|
111
|
+
ADS already performs that build once. Keep `ads compile` in ordinary builds if
|
|
112
|
+
that project needs preview artifacts there.
|
|
113
|
+
|
|
114
|
+
Workers compile to self-contained scripts for the opaque-origin MCP App sandbox.
|
|
115
|
+
Unchanged worker output reuses dependency hashes; changes to transitive inputs
|
|
116
|
+
rebuild it. Temporary worker compiler processes run sequentially and exit after
|
|
117
|
+
producing output. Their build lifetime is separate from runtime worker cleanup,
|
|
118
|
+
which remains owned by the component/controller.
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Validation scope
|
|
2
2
|
|
|
3
|
+
These checks apply to both [direct editing and MCP-only editing](workflows.md).
|
|
4
|
+
Direct source edits need current checks and rendered review; ordinary edits do
|
|
5
|
+
not require a draft or acceptance call. Tracked proposals validate on acceptance.
|
|
6
|
+
|
|
3
7
|
Use `ads_validate({})` for the complete project audit, equivalent to `ads validate`.
|
|
4
8
|
Use `ads_validate({scope:"changed"})`, equivalent to `ads validate --changed`, during
|
|
5
9
|
editing when a successful full baseline exists. Both interfaces call the same
|
|
@@ -19,16 +23,22 @@ engine. Full is the default.
|
|
|
19
23
|
checks and configured scripts, not arbitrary assertions, visual parity or every
|
|
20
24
|
application state.
|
|
21
25
|
|
|
22
|
-
Full validation runs core architecture/test-boundary guards, registered
|
|
23
|
-
project scripts and every registered behavior contract. Defaults use the existing
|
|
26
|
+
Full validation runs core architecture/test-boundary guards, configured project scripts and every registered behavior contract. Defaults use the existing
|
|
24
27
|
mutation-check scripts plus a project's `test` and build scripts when present.
|
|
25
28
|
Build selection prefers `build:lib`, then `build:app`, then `build`.
|
|
26
29
|
Projects can declare `validation.checks` as a list of package
|
|
27
|
-
script names for the complete audit; core
|
|
30
|
+
script names for the complete audit; core ADS and registered behaviors remain
|
|
28
31
|
mandatory. Commands are trusted project configuration, never MCP arguments.
|
|
29
32
|
Use scripts that check/build without changing source. Avoid calling `ads validate`
|
|
30
33
|
from a script selected by validation.
|
|
31
34
|
|
|
35
|
+
Prefer native ADS usage policies over project lint plugins. Notification APIs
|
|
36
|
+
and hosts can be registered as `usage.notifications: [{api, host, rootFiles}]`;
|
|
37
|
+
`usage.restrictedImports` blocks packages that bypass the project-owned API.
|
|
38
|
+
`ads check`, acceptance and validation enforce these in the existing AST pass.
|
|
39
|
+
Do not keep an additional toast lint runner after migrating its policy. Preserve
|
|
40
|
+
ordinary project tests and independent linters for checks ADS does not own.
|
|
41
|
+
|
|
32
42
|
Freshness tracks ADS and consuming UI roots, public assets, their local dependency
|
|
33
43
|
chains, registered configuration/command entrypoints, package files, and supported
|
|
34
44
|
project tests plus helpers. Unrelated native/backend/docs edits can continue during
|