@reqvire-org/ads 0.3.3 → 0.3.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.
Files changed (52) hide show
  1. package/README.md +12 -4
  2. package/dist/behaviors.mjs +157 -0
  3. package/dist/bootstrap-ds/ADS.md +7 -0
  4. package/dist/bootstrap-ds/design-system/controllers/.gitkeep +0 -0
  5. package/dist/check.mjs +7 -2
  6. package/dist/cli.mjs +17 -0
  7. package/dist/config.mjs +19 -3
  8. package/dist/css-values.mjs +26 -0
  9. package/dist/index.mjs +2 -0
  10. package/dist/init.mjs +1 -1
  11. package/dist/mcp/build-status.mjs +10 -3
  12. package/dist/mcp/catalog.mjs +11 -8
  13. package/dist/mcp/context.mjs +2 -2
  14. package/dist/mcp/mutations.mjs +10 -0
  15. package/dist/mcp/preview-owner-guard.mjs +29 -0
  16. package/dist/mcp/preview-watch.mjs +28 -4
  17. package/dist/mcp/preview-widget.bundle.js +2 -2
  18. package/dist/mcp/prompts.mjs +2 -2
  19. package/dist/mcp/server.mjs +56 -19
  20. package/dist/mcp/showcase-host.mjs +9 -5
  21. package/dist/public-api.mjs +39 -0
  22. package/dist/scenarios-compiler.mjs +17 -2
  23. package/dist/scenarios.mjs +27 -39
  24. package/dist/skills/README.md +3 -3
  25. package/dist/skills/ads-break-ui/SKILL.md +22 -0
  26. package/dist/skills/ads-designer/SKILL.md +23 -1
  27. package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +7 -0
  28. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/controllers/.gitkeep +0 -0
  29. package/dist/skills/ads-designer/references/cli.md +1 -1
  30. package/dist/skills/ads-designer/references/design-craft.md +1 -1
  31. package/dist/skills/ads-import/SKILL.md +22 -0
  32. package/dist/skills/ads-import/references/cli.md +1 -1
  33. package/dist/skills/{ads-assimilate → ads-migrate}/SKILL.md +28 -6
  34. package/dist/skills/ads-migrate/agents/openai.yaml +4 -0
  35. package/dist/skills/{ads-assimilate → ads-migrate}/references/cli.md +1 -1
  36. package/dist/skills/{ads-assimilate → ads-migrate}/references/native-implementation.md +11 -0
  37. package/dist/skills/ads-motion/SKILL.md +22 -0
  38. package/dist/tokens.mjs +3 -2
  39. package/dist/units.mjs +20 -9
  40. package/dist/verification/browser.mjs +27 -0
  41. package/dist/verification/playwright-reporter.cjs +20 -0
  42. package/dist/verification.mjs +214 -0
  43. package/docs/ADS.md +27 -2
  44. package/docs/ARCHITECTURE.md +39 -1
  45. package/docs/BEHAVIORS.md +230 -0
  46. package/docs/CHANGELOG.md +36 -0
  47. package/docs/GUIDE.md +16 -1
  48. package/docs/MCP.md +46 -7
  49. package/package.json +4 -2
  50. package/dist/skills/ads-assimilate/agents/openai.yaml +0 -4
  51. /package/dist/skills/{ads-assimilate → ads-migrate}/references/lint-and-docs.md +0 -0
  52. /package/dist/skills/{ads-assimilate → ads-migrate}/references/testing.md +0 -0
package/docs/GUIDE.md CHANGED
@@ -29,6 +29,20 @@ template strings and Shadow DOM style constructs lack equivalent coverage.
29
29
  Retain framework-specific checks; a clean ADS check does not validate those
30
30
  unchecked surfaces.
31
31
 
32
+ ### Controllers and behavior checks
33
+
34
+ Keep private controllers with their consumer; share reusable behavior through
35
+ `design-system/controllers/<Name>/`. Use the configured framework and declared
36
+ project dependencies. Controllers own lifecycle/measurements while components and
37
+ patterns own presentation. A shared context provider is a behavioral API too.
38
+
39
+ Optional owner-local `behavior.json` registers guarantees and maintained checks.
40
+ Scenario `exercises` records demonstrations separately from rendered `covers`.
41
+ Use `ads behaviors --json` for discovery and `ads verify --unit <discovered-id>`
42
+ to run registered cases; MCP exposes `ads_behaviors` and `ads_verify`. Tests and
43
+ contracts stay outside production exports. See the [complete schema and runner
44
+ integration](BEHAVIORS.md), including browser and React development StrictMode profiles.
45
+
32
46
  ### Linaria integration
33
47
 
34
48
  Before authoring components or patterns, integrate Linaria extraction with the
@@ -558,6 +572,7 @@ Application manifest metadata and other platform exports remain project-owned.
558
572
  | Asset ownership | ADS/public mount collisions, configured generated assets in source, and tracked generated output |
559
573
  | Product patterns | CSS/JSX namespace ownership; ADS implementations and showcase cannot import app source |
560
574
  | Primitive state | State-variable overrides outside components; undocumented non-state component variables |
575
+ | Literal visual values | Absolute/font-relative lengths (including `ch` and root font units), durations and color/effect formulas require tokens; geometry angles and responsive viewport/container relationships remain available |
561
576
  | Fixed token ownership | Foreign token names, shared token overrides, misplaced component/pattern/showcase variables, and noncanonical foundation imports |
562
577
  | Showcase ownership | Fixture CSS/Linaria definitions, custom JSX classes, native controls/widget roles, state styling, private CSS/aliased imports, legacy catalogue dependencies and source ownership, and runtime imports of fixtures/test helpers |
563
578
  | Scenario coverage | All public renderable UI has path-discovered entries, colocated fixtures, literal metadata and reachable public render references; runtime imports of scenarios/fixtures are rejected |
@@ -717,7 +732,7 @@ Retain unrelated lint, type checking, and framework build commands.
717
732
  ## External content
718
733
 
719
734
  Use the repository's `ads-import` skill for selected external ADS source or theme
720
- values, and `ads-assimilate` for a native implementation inspired by an upstream
735
+ values, and `ads-migrate` for a native implementation inspired by an upstream
721
736
  library. These agent workflows handle dependency closure, token mapping, motion
722
737
  comparisons, source credits, applicable notices, and local documentation.
723
738
  They are agent workflows, rather than CLI import/design subcommands. Install
package/docs/MCP.md CHANGED
@@ -17,7 +17,11 @@ preview watcher and artifacts. Stdout remains exclusively JSON-RPC.
17
17
 
18
18
  For browser-only work, run `ads showcase` inside the project. It starts the same
19
19
  runtime without stdio. `--port 4185` selects a port; otherwise the OS chooses an
20
- available one. `ads mcp --no-showcase` disables the website for headless clients.
20
+ available one. For a stable address, add `"--port", "4191"` to the server's `args`
21
+ in `.mcp.json` (or the corresponding client configuration). An occupied explicit
22
+ port fails startup; ADS does not silently switch ports or terminate another live
23
+ client. Reuse the connected server's showcase instead of launching another one.
24
+ `ads mcp --no-showcase` disables the website for headless clients.
21
25
  The website binds to 127.0.0.1 and accepts its own origin only. It serves packaged
22
26
  client assets and MCP, with no arbitrary file reader or command launcher.
23
27
  Shutdown closes both transports, subscriptions and the managed compiler.
@@ -155,7 +159,7 @@ The server supplies agent guidance through its instructions, tool descriptions,
155
159
  | Tool | Purpose |
156
160
  |------|---------|
157
161
  | `ads_status` | Project paths, watcher/build states, preview revisions and diagnostics, skills |
158
- | `ads_catalog` | Bounded search for real public components/patterns and source/guide URIs |
162
+ | `ads_catalog` | Bounded search for public UI, controllers and hooks, with source/guide URIs |
159
163
  | `ads_tokens` | Bounded token-definition and theme inspection |
160
164
  | `ads_check` | Current core architectural diagnostics; registered Oxlint/build tests remain separate |
161
165
  | `ads_skills` | Workflow names/descriptions without loading instructions |
@@ -163,22 +167,50 @@ The server supplies agent guidance through its instructions, tool descriptions,
163
167
  | `ads_show_tokens` | Render a discovered token scenario; legacy compilers retain the definition inspector |
164
168
  | `ads_scenarios` | Bounded token/component/pattern/composition scenario discovery |
165
169
  | `ads_show_scenario` | Render an exact discovered scenario with its own fixtures |
170
+ | `ads_behaviors` | Bounded guarantee/evidence discovery; pass an exact unit for contract details |
171
+ | `ads_verify` | Execute an owner's registered checks and record revision-bound evidence |
166
172
  | `ads_show_<id>` | Optional explicitly configured grouped App |
167
173
  | `ads_units` | Discover edit owners and the files belonging to one unit |
168
174
  | `ads_read_file` | Read bounded source ranges, with owning unit and full-file digest |
169
175
  | `ads_apply_patch` | Opt-in Git unified diff for one ADS unit, with dry-run validation |
170
176
 
171
177
  Listings have bounded pages and opaque cursors. The source catalogue exposes
172
- public exports from `components/` and `patterns/`; it does not execute TSX to
178
+ public exports from `components/`, `patterns/` and `controllers/`; it does not execute TSX to
173
179
  guess component props. Read the exported API and owning guide. An export name
174
180
  alone does not prove that a preview renders that particular element.
175
181
 
176
- `ads://project/status`, `/build`, `/tokens`, `/catalog`, `/scenarios`, and `/checks` carry complete JSON
182
+ `ads://project/status`, `/build`, `/tokens`, `/catalog`, `/scenarios`, `/behaviors`, and `/checks` carry complete JSON
177
183
  detail. Allowed project documentation/source and skill files are separate
178
184
  resources. No arbitrary filesystem reader is exposed. Prefer bounded tools for
179
185
  large catalogues; explicit resource reads can enter model context and a client
180
186
  may truncate large payloads.
181
187
 
188
+ ### Behavioral verification
189
+
190
+ Read `ads://guides/behaviors` or the [behavior guide](BEHAVIORS.md) for the contract
191
+ and runner schema. `ads_behaviors({ "unit": "components/MessageScroller" })`
192
+ returns subjects, guarantees, demonstration links and check IDs for a discovered
193
+ owner. `ads_verify({ "unit": "components/MessageScroller", "checks": ["prepend-anchor"] })`
194
+ runs those registered cases. The names here are examples, never built-in cases.
195
+
196
+ `covers` describes rendered UI; optional `exercises` describes public behavioral
197
+ APIs used through reachable scenario code. Neither metadata nor README prose is
198
+ passing evidence. Verification runs trusted project commands from configured
199
+ profiles, without installing dependencies. It is available in read-only source
200
+ mode too and is annotated as executing commands/writing generated evidence.
201
+ Missing/skipped cases, unavailable runners and changed inputs cannot pass.
202
+ Results and subscribed resource notifications are available through
203
+ `ads://project/behaviors`; explicitly re-read evidence when notifications are absent.
204
+
205
+ Browser profiles start an isolated showcase and verify its sandboxed App using
206
+ the selected candidate's sources. StrictMode profiles need a project React
207
+ development harness. Profiles describe the execution environment, not a proof
208
+ that every possible interaction or lifecycle has been tested.
209
+
210
+ Guarded mutations also run affected registered behavior checks, including contracts
211
+ that depend on changed shared controllers. Failures reject the candidate before
212
+ writing real source. Projects without contracts retain their existing checks.
213
+
182
214
  ## Guarded editing
183
215
 
184
216
  Enable editing in the MCP launch arguments and reconnect:
@@ -540,8 +572,15 @@ Managed configuration changes replace the compiler through the same supervisor.
540
572
  Updating ADS server code itself still requires reconnecting the MCP client to load
541
573
  the new package. Normal component, fixture and style edits remain automatic.
542
574
 
543
- ADS stops the managed watcher and its compiler subprocesses when stdin closes or
544
- it receives SIGINT/SIGTERM. The project must keep its watcher in the foreground,
575
+ ADS closes both network hosts and stops the managed watcher and its compiler
576
+ subprocesses when the stdio wire closes, including EOF or broken output, or it
577
+ receives SIGINT/SIGTERM. Active browser subscriptions do not retain the runtime.
578
+ A small independent ownership guard watches a pipe from MCP; owner death closes
579
+ that pipe even after SIGKILL. The guard terminates the owned compiler process
580
+ group, escalates for stubborn descendants, then exits. It is disarmed on ordinary
581
+ shutdown; `previewWatch.guardPid` identifies it while running. This requires no
582
+ second user command and applies to custom builders too.
583
+ The project must keep its watcher in the foreground,
545
584
  rather than launching detached background processes. The configuration is
546
585
  trusted project setup; MCP tools accept no executable or command arguments.
547
586
  To manage builds yourself, omit `previewWatch` or set it to `null`, then run the
@@ -680,7 +719,7 @@ See the [MCP Apps specification](https://github.com/modelcontextprotocol/ext-app
680
719
  | Each of the five ADS skill names | `request` | Select that workflow and its skill resource |
681
720
 
682
721
  Example: get `ads-inspect` with `element="Button states in both themes"`, or
683
- `ads-assimilate` with `request` containing the upstream component-library URL.
722
+ `ads-migrate` with `request` containing the upstream component-library URL.
684
723
  Prompts explain Data/UX/Skin ownership, public API reuse, fixture boundaries,
685
724
  which tools select widgets, progressive skill reads and validation. They guide
686
725
  reasoning rather than inventing another component implementation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reqvire-org/ads",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "type": "module",
5
5
  "description": "A design system your agent can see and shape. Your components. Your look. Your code.",
6
6
  "repository": {
@@ -69,6 +69,7 @@
69
69
  "@modelcontextprotocol/client": "2.3.1",
70
70
  "@modelcontextprotocol/ext-apps": "2.0.3",
71
71
  "@modelcontextprotocol/sdk": "1.32.1",
72
+ "@playwright/test": "1.64.1",
72
73
  "@preact/signals": "2.11.3",
73
74
  "@types/node": "^25.9.2",
74
75
  "@types/react": "^19.2.17",
@@ -98,7 +99,8 @@
98
99
  "./mcp/build": "./dist/mcp/build-status.mjs",
99
100
  "./scenarios": "./dist/scenarios.mjs",
100
101
  "./scenarios/vite": "./dist/scenarios-vite.mjs",
101
- "./scenarios/compiler": "./dist/scenarios-compiler.mjs"
102
+ "./scenarios/compiler": "./dist/scenarios-compiler.mjs",
103
+ "./verification": "./dist/verification/browser.mjs"
102
104
  },
103
105
  "files": [
104
106
  "dist",
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "ADS Assimilate"
3
- short_description: "Adapt reference components into a native design system"
4
- default_prompt: "Use $ads-assimilate with a component-library URL to implement and verify a native design-system component."