@reqvire-org/ads 0.3.36 → 0.3.38
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 -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 +20 -8
- package/dist/config.mjs +24 -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 +4 -2
- package/dist/mcp/mutations.mjs +4 -14
- package/dist/mcp/preview-owner-guard.mjs +7 -4
- package/dist/mcp/preview-watch.mjs +21 -9
- package/dist/mcp/preview-widget.bundle.js +57 -63
- package/dist/mcp/preview-work.mjs +1 -15
- package/dist/mcp/project-widget.bundle.js +55 -61
- package/dist/mcp/prompts.mjs +2 -2
- package/dist/mcp/resource-loader.js +32 -10
- package/dist/mcp/server.mjs +94 -34
- package/dist/mcp/widget.bundle.js +58 -64
- package/dist/preview-builder.mjs +17 -5
- package/dist/preview-bun.mjs +269 -0
- package/dist/preview-imports.mjs +73 -0
- package/dist/preview-resources.mjs +26 -14
- package/dist/resource-limits.mjs +146 -0
- package/dist/runtime-requirements.mjs +21 -0
- package/dist/scenario-inspector.mjs +11 -4
- package/dist/scenarios-compiler.mjs +51 -9
- package/dist/showcase/client.bundle.js +66 -71
- 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 +42 -42
- package/dist/skills/ads-break-ui/references/drafts.md +6 -3
- package/dist/skills/ads-break-ui/references/guarded-editing.md +4 -3
- package/dist/skills/ads-break-ui/references/runtimes.md +175 -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 +41 -41
- 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 +25 -21
- package/dist/skills/ads-designer/references/drafts.md +6 -3
- package/dist/skills/ads-designer/references/guarded-editing.md +4 -3
- package/dist/skills/ads-designer/references/runtimes.md +175 -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 +43 -44
- package/dist/skills/ads-import/references/cli.md +25 -21
- package/dist/skills/ads-import/references/drafts.md +6 -3
- package/dist/skills/ads-import/references/guarded-editing.md +4 -3
- package/dist/skills/ads-import/references/runtimes.md +175 -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 +40 -40
- package/dist/skills/ads-motion/references/drafts.md +6 -3
- package/dist/skills/ads-motion/references/guarded-editing.md +4 -3
- package/dist/skills/ads-motion/references/runtimes.md +175 -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 +40 -40
- package/dist/skills/ads-port/references/cli.md +25 -21
- package/dist/skills/ads-port/references/drafts.md +6 -3
- package/dist/skills/ads-port/references/guarded-editing.md +4 -3
- package/dist/skills/ads-port/references/runtimes.md +175 -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 +81 -13
- package/docs/GUIDE.md +96 -53
- package/docs/MCP.md +117 -123
- package/docs/benchmarks/bun-previews.md +91 -0
- package/docs/benchmarks/gidi-preview-memory.md +4 -0
- package/package.json +16 -14
package/docs/GUIDE.md
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
# ADS tool guide
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
Choose [direct code editing or MCP-only editing](../skills/ads-designer/references/workflows.md).
|
|
4
|
+
Direct editors change owned files normally and use MCP for preview and validation;
|
|
5
|
+
ordinary edits do not require drafts or acceptance. MCP-only iterative editing
|
|
6
|
+
uses [tracked drafts](../skills/ads-designer/references/drafts.md), rendered review
|
|
7
|
+
and exact-revision acceptance. Direct editors may choose drafts for isolation and
|
|
8
|
+
Accepted/Draft comparison too. Complete any required tracked proposals before
|
|
9
|
+
reporting the design change finished. Compiler ownership is a separate choice:
|
|
10
|
+
the managed ADS compiler is the default for both editing routes; external
|
|
11
|
+
builders can publish resources/evidence with `mcp.previewWatch: false`.
|
|
10
12
|
|
|
11
13
|
ADS is development tooling for a project's local design system. This package
|
|
12
|
-
contains a
|
|
14
|
+
contains a Bun CLI, shared token contract, native static checks, an optional linter adapter, and
|
|
13
15
|
empty foundation scaffolding. It includes no component or pattern catalogue,
|
|
14
16
|
fonts, mock screens, or UI runtime dependency.
|
|
15
17
|
|
|
@@ -31,15 +33,15 @@ An agent uses the MCP tools to inspect, edit and review the project:
|
|
|
31
33
|
3. Open a discovered preview with `ads_show_scenario` or `ads_show_tokens`. These
|
|
32
34
|
render the project's actual scenario, fixtures and adapter through MCP Apps.
|
|
33
35
|
Use the returned showcase link when the client cannot render Apps.
|
|
34
|
-
4.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
`
|
|
39
|
-
`
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
4. Select the editing route, independently of `mutations.enabled`. With direct
|
|
37
|
+
source access, edit owned files and use the existing compiler/preview; run
|
|
38
|
+
current gates and relevant project/behavior checks before finishing. With
|
|
39
|
+
MCP-only access and mutation tools enabled, discover owners with `ads_units`,
|
|
40
|
+
use `ads_create_draft`, `ads_read_file`/`ads_update_draft`, rendered
|
|
41
|
+
`ads_show_draft` review and exact-revision `ads_accept`. Accept dependencies
|
|
42
|
+
first and review dependents again. Guarded patches/transactions remain
|
|
43
|
+
available for MCP-only focused repairs/migrations. A read-only MCP connection
|
|
44
|
+
supports direct editors; it cannot edit for an MCP-only client.
|
|
43
45
|
5. Review diagnostics, registered behavior evidence and the rendered result.
|
|
44
46
|
`ads_behaviors` discovers guarantees; `ads_verify` executes selected registered
|
|
45
47
|
checks. Recheck `ads_status.build` after changes; notifications alone do not
|
|
@@ -172,16 +174,17 @@ hooks. Init preserves the application's compiler, dependencies and mount adapter
|
|
|
172
174
|
The example and empty starter use Biome only for CSS, configured in
|
|
173
175
|
`biome.css.json`. Parsing rejects malformed CSS and invalid hex colors, including
|
|
174
176
|
token values. Explicit lint rules reject duplicate font names and selectors;
|
|
175
|
-
the starter also rejects duplicate properties. Formatting is disabled.
|
|
176
|
-
|
|
177
|
-
|
|
177
|
+
the starter also rejects duplicate properties. Formatting is disabled. ADS directly checks architecture, token usage and
|
|
178
|
+
ownership in JavaScript/TypeScript. The tool repository uses Oxlint for its own
|
|
179
|
+
ordinary JavaScript linting; consumers do not need that extra pass. `ads init` preserves an existing project's lint tools.
|
|
178
180
|
|
|
179
181
|
CSS regression tests cover rejected input, valid theme/nesting
|
|
180
182
|
contexts, and exclusion of JavaScript and generated outputs.
|
|
181
183
|
|
|
182
184
|
## Set up an existing project
|
|
183
185
|
|
|
184
|
-
|
|
186
|
+
Install Bun 1.4.1+ for ADS tooling and previews. The application keeps its own
|
|
187
|
+
Node/npm or Bun pipeline. Run inside the project containing `package.json`:
|
|
185
188
|
|
|
186
189
|
```sh
|
|
187
190
|
npx @reqvire-org/ads init --framework react
|
|
@@ -190,7 +193,7 @@ npm run build
|
|
|
190
193
|
```
|
|
191
194
|
|
|
192
195
|
For a Bun-managed project, use
|
|
193
|
-
`bunx
|
|
196
|
+
`bunx @reqvire-org/ads init --framework react`, followed by `bun install`
|
|
194
197
|
and `bun --bun run build`. Node is unnecessary. No archive or directory argument is needed for a published
|
|
195
198
|
release. `init` requires an existing project; it does not create an application.
|
|
196
199
|
For starting from zero, the `ads-designer` skill carries a standalone empty
|
|
@@ -218,15 +221,14 @@ Initialization:
|
|
|
218
221
|
|
|
219
222
|
- Adds the tool to `devDependencies`, with the executing version pinned by
|
|
220
223
|
default. Keeps an existing tool version unless `--tool-package` overrides it.
|
|
221
|
-
Adds Oxlint if the project does not already depend on it.
|
|
222
224
|
- Creates missing `ds.config.json`, foundation CSS, a public entry, and empty
|
|
223
225
|
component/pattern directories, brand guidance, and an empty font directory.
|
|
224
226
|
Seeds token defaults only when the configured
|
|
225
227
|
token folder contains no CSS. New foundation scenarios use the selected
|
|
226
228
|
framework's hooks. Existing ADS source and token values remain unchanged;
|
|
227
229
|
incomplete existing token contracts need an explicit migration.
|
|
228
|
-
- Adds `lint:ds`, which
|
|
229
|
-
|
|
230
|
+
- Adds `lint:ds`, which runs native `ads check` directly. Project linter and test
|
|
231
|
+
commands remain explicitly owned by the project.
|
|
230
232
|
- Adds `assets:ds` (`ads assets`) after those checks and before the existing
|
|
231
233
|
`prebuild` hook, preserving the actual
|
|
232
234
|
`build` command. If the project has no build script, adds a validation/generation
|
|
@@ -237,7 +239,8 @@ Initialization:
|
|
|
237
239
|
preserved; deliberately switch it when migrating to the built-in MCP client.
|
|
238
240
|
- Adds `ads-mcp` with guarded editing enabled and `ads-read-mcp` with editing
|
|
239
241
|
disabled, preserving existing scripts with those names. Both start the showcase.
|
|
240
|
-
-
|
|
242
|
+
- Appends `.ds/` to the project's ignore file and supplies a framework mount
|
|
243
|
+
adapter for ADS's native preview compiler when one is missing.
|
|
241
244
|
|
|
242
245
|
Application files, framework configuration, unrelated scripts/dependencies,
|
|
243
246
|
and lockfiles are preserved. `init` does not install dependencies or configure
|
|
@@ -270,7 +273,7 @@ An existing Bun lockfile takes precedence over the npm runner used by `npx`.
|
|
|
270
273
|
For a Bun project with no lockfile or package-manager metadata yet:
|
|
271
274
|
|
|
272
275
|
```sh
|
|
273
|
-
bunx
|
|
276
|
+
bunx @reqvire-org/ads init --framework react
|
|
274
277
|
bun install
|
|
275
278
|
bun --bun run build
|
|
276
279
|
```
|
|
@@ -278,8 +281,8 @@ bun --bun run build
|
|
|
278
281
|
Bun is inferred from the launcher when the project has no saved manager or lockfile.
|
|
279
282
|
Use `--package-manager bun` only to override an existing project choice. Init
|
|
280
283
|
does not translate the app's existing scripts. Bun hooks explicitly use `bun --bun run` so package executables,
|
|
281
|
-
including ADS
|
|
282
|
-
Launch the MCP server with `bunx
|
|
284
|
+
including ADS, run on Bun despite Node shebangs.
|
|
285
|
+
Launch the MCP server with `bunx @reqvire-org/ads mcp`, or its generated
|
|
283
286
|
`ads-mcp` script. Managed workers and screenshot capture inherit the interpreter.
|
|
284
287
|
Use `command: "runtime"` for portable preview compiler/behavior profiles;
|
|
285
288
|
explicit `node`, `bun` or other commands are respected. Project-specific tools
|
|
@@ -465,8 +468,9 @@ These are static checks, not framework type checking or browser CSS evaluation.
|
|
|
465
468
|
Arbitrary computed expressions, combined conditional cascade behavior, computed
|
|
466
469
|
module specifiers, JSX spreads, other styling engines, and renderer-specific APIs
|
|
467
470
|
need the project's existing checks and review. Continue to run its type checking,
|
|
468
|
-
component tests, and browser comparisons.
|
|
469
|
-
|
|
471
|
+
component tests, and browser comparisons. Register component-specific guards as
|
|
472
|
+
explicit project scripts; include them in builds and `mcp.mutationChecks` when
|
|
473
|
+
required. `ads check` does not invoke project linter plugins.
|
|
470
474
|
|
|
471
475
|
## Showcase
|
|
472
476
|
|
|
@@ -485,23 +489,27 @@ stale retained output. Its neutral header and left pane align and collapse
|
|
|
485
489
|
together. Themes flow through the Apps host context. No project catalogue pages
|
|
486
490
|
or direct component imports are used by this client.
|
|
487
491
|
|
|
488
|
-
The project
|
|
489
|
-
and
|
|
490
|
-
empty
|
|
491
|
-
|
|
492
|
-
compiler. For an existing app, adapt the starter's build script and mount entry,
|
|
493
|
-
add its `build:mcp-previews` package script, and configure it explicitly:
|
|
492
|
+
The project owns implementations, colocated scenarios/fixtures, foundation
|
|
493
|
+
CSS and a framework mount adapter. ADS supplies its native Bun preview compiler.
|
|
494
|
+
The empty starter and init provide the mount under `design-system/showcase/mcp/`.
|
|
495
|
+
Configure the framework and preview manifest; no Vite preview script is required:
|
|
494
496
|
|
|
495
497
|
```json
|
|
496
498
|
{
|
|
499
|
+
"framework": "react",
|
|
497
500
|
"mcp": {
|
|
498
501
|
"showcaseTitle": "My Project Design System",
|
|
499
|
-
"previewManifest": ".ds/preview/manifest.json"
|
|
500
|
-
"previewWatch": { "command": "node", "args": ["scripts/build-mcp-previews.mjs", "--watch"] }
|
|
502
|
+
"previewManifest": ".ds/preview/manifest.json"
|
|
501
503
|
}
|
|
502
504
|
}
|
|
503
505
|
```
|
|
504
506
|
|
|
507
|
+
For direct editing with an externally managed builder, add `previewWatch: false`
|
|
508
|
+
and run `ads compile .` or manage `ads compile . --watch` outside MCP. MCP then
|
|
509
|
+
serves published resources/evidence without starting a compiler. Existing views
|
|
510
|
+
can stay visible, but changed-source evidence stays stale until a verified update
|
|
511
|
+
is published. See [editing workflows](../skills/ads-designer/references/workflows.md).
|
|
512
|
+
|
|
505
513
|
Keep the saved `framework` (`react` or `preact`), JSX transform and mount adapter
|
|
506
514
|
consistent. The optional title defaults to the project package name followed by
|
|
507
515
|
` · Design System`. The browser shell stays the same for both frameworks. There is
|
|
@@ -664,10 +672,10 @@ intact. Sources, duplicate output mounts, and symlinked write paths are checked.
|
|
|
664
672
|
Initialized builds run:
|
|
665
673
|
|
|
666
674
|
```text
|
|
667
|
-
|
|
675
|
+
ads check → ads assets → existing prebuild → existing build
|
|
668
676
|
```
|
|
669
677
|
|
|
670
|
-
`lint:ds`
|
|
678
|
+
`lint:ds` runs the native, read-only ADS gates. `assets:ds`
|
|
671
679
|
runs `ads assets`; checks do not require outputs on a clean checkout. A failed
|
|
672
680
|
check or generation stops the build. Re-running init preserves token values,
|
|
673
681
|
artwork, existing configuration, and unrelated scripts.
|
|
@@ -703,7 +711,10 @@ queries. ADS implementations and showcase fixtures cannot import app code.
|
|
|
703
711
|
Private imports within ADS implementations remain allowed, including when the ADS
|
|
704
712
|
is nested inside `src/`. Application integration harnesses belong in test support.
|
|
705
713
|
|
|
706
|
-
|
|
714
|
+
Projects that explicitly choose Oxlint may use the optional adapter below.
|
|
715
|
+
Declare it as a project dependency and run `ads lint-config` followed by Oxlint
|
|
716
|
+
in an explicit project script; ADS acceptance and validation do not run it
|
|
717
|
+
automatically:
|
|
707
718
|
|
|
708
719
|
```json
|
|
709
720
|
{
|
|
@@ -723,6 +734,38 @@ can import development-only `loadConfig`, `importResolver`, and `styleWriteViola
|
|
|
723
734
|
from `@reqvire-org/ads` when it needs the same validated boundaries as core.
|
|
724
735
|
Unknown configuration fields fail rather than silently weakening checks.
|
|
725
736
|
|
|
737
|
+
Notification usage can be enforced directly by ADS, without a project lint
|
|
738
|
+
plugin or another parse/lint pass:
|
|
739
|
+
|
|
740
|
+
```json
|
|
741
|
+
{
|
|
742
|
+
"usage": {
|
|
743
|
+
"notifications": [{
|
|
744
|
+
"api": "toast",
|
|
745
|
+
"host": "Toaster",
|
|
746
|
+
"rootFiles": ["src/App.tsx", "design-system/components/Toast.ads.scenario.tsx"]
|
|
747
|
+
}],
|
|
748
|
+
"restrictedImports": ["sonner"]
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
```
|
|
752
|
+
|
|
753
|
+
`api` and `host` name exports imported from the configured public alias. ADS
|
|
754
|
+
recognizes named aliases and namespace imports, respecting shadowed bindings.
|
|
755
|
+
It rejects direct module/render calls and calls in `use server` modules, requires
|
|
756
|
+
a stable `id` for directly effect-created notifications with inspectable options,
|
|
757
|
+
and restricts the host to the exact declared roots. Direct conditional hosts and
|
|
758
|
+
duplicate static host IDs in one file fail. `restrictedImports` rejects runtime
|
|
759
|
+
package and subpath imports, re-exports, literal dynamic imports and unshadowed
|
|
760
|
+
`require` calls; type-only imports are exempt. Both policies are empty by default.
|
|
761
|
+
|
|
762
|
+
These native guards run in `ads check`, acceptance and validation. They inspect
|
|
763
|
+
source and ADS runtime/scenario files, excluding tests and declaration contracts.
|
|
764
|
+
They do not prove cross-module host uniqueness or trace helper calls, dynamic
|
|
765
|
+
IDs/options, aliases assigned to local variables or framework render callbacks.
|
|
766
|
+
Keep route persistence and lifecycle browser tests. ADS does not assume a toast
|
|
767
|
+
implementation exists or install one.
|
|
768
|
+
|
|
726
769
|
Component interaction variables such as `--ds-button-hover-bg` cannot be
|
|
727
770
|
assigned by app code, patterns, or showcase code. This includes static JSX style
|
|
728
771
|
objects in files with inline-style exceptions. Reading a variable is allowed;
|
|
@@ -732,8 +775,8 @@ are registered explicitly. State variables cannot be allowlisted.
|
|
|
732
775
|
Keep renderer-, framework-, and component-specific project guards too. The
|
|
733
776
|
shared tool does not validate a third-party graph renderer's own APIs, arbitrary
|
|
734
777
|
runtime spreads, or the semantic meaning of a
|
|
735
|
-
measured value. Register
|
|
736
|
-
and
|
|
778
|
+
measured value. Register project-specific guard scripts in the existing build
|
|
779
|
+
and required MCP checks. The optional linter adapter is one project choice.
|
|
737
780
|
|
|
738
781
|
### Project boundaries and assets
|
|
739
782
|
|
|
@@ -802,8 +845,9 @@ the required init-time framework choice. Run `ads init --framework react` (or
|
|
|
802
845
|
`preact`) to save it. To use another layout, write this configuration before init. Configure TypeScript and the app bundler to resolve
|
|
803
846
|
the same alias; this file does not rewrite their configuration.
|
|
804
847
|
|
|
805
|
-
Colocate component-specific
|
|
806
|
-
project
|
|
848
|
+
Colocate component-specific guards with their owner and register their command
|
|
849
|
+
in the project build. If that project chooses Oxlint, its optional adapter can
|
|
850
|
+
be configured explicitly:
|
|
807
851
|
|
|
808
852
|
```json
|
|
809
853
|
{
|
|
@@ -816,11 +860,12 @@ project-owned Oxlint plugin adapter explicitly:
|
|
|
816
860
|
}
|
|
817
861
|
```
|
|
818
862
|
|
|
819
|
-
Merge that section into the project configuration
|
|
863
|
+
Merge that section into the project configuration and explicitly run
|
|
864
|
+
`ads lint-config` followed by the project linter.
|
|
820
865
|
Generated configuration registers `ads/public-import`, `ads/no-inline-style`, `ads/no-app-import`, and
|
|
821
866
|
explicit project plugins. Core tooling imports no particular component.
|
|
822
867
|
Registered project configuration and build helpers may import one another;
|
|
823
|
-
|
|
868
|
+
native ADS import guards enforce this boundary. It does not
|
|
824
869
|
allow application code to import private ADS modules or build helpers to import
|
|
825
870
|
private UI implementation.
|
|
826
871
|
|
|
@@ -836,14 +881,12 @@ but the complete checked candidate must contain the matching use.
|
|
|
836
881
|
not broad styling exceptions. Ignore `.ds/`; generated paths refer to the project
|
|
837
882
|
and its locally installed tool.
|
|
838
883
|
|
|
839
|
-
`lint-config`
|
|
840
|
-
|
|
841
|
-
sequence before compilation, from the project root with local binaries available:
|
|
884
|
+
`lint-config` is optional linter integration. For native ADS gates outside
|
|
885
|
+
package-manager hooks, run the installed tool directly:
|
|
842
886
|
|
|
843
887
|
```sh
|
|
844
|
-
ads lint-config .
|
|
845
888
|
ads check .
|
|
846
|
-
|
|
889
|
+
ads compile .
|
|
847
890
|
```
|
|
848
891
|
|
|
849
892
|
Retain unrelated lint, type checking, and framework build commands.
|