@reqvire-org/ads 0.3.27 → 0.3.29

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 (69) hide show
  1. package/dist/atomic-composition.mjs +2 -1
  2. package/dist/behaviors.mjs +2 -2
  3. package/dist/bootstrap-ds/scripts/build-mcp-previews.mjs +6 -7
  4. package/dist/boundaries.mjs +6 -3
  5. package/dist/check.mjs +3 -0
  6. package/dist/cli.mjs +13 -0
  7. package/dist/config.mjs +5 -3
  8. package/dist/mcp/build-status.mjs +17 -4
  9. package/dist/mcp/context.mjs +2 -1
  10. package/dist/mcp/execution-results.mjs +4 -3
  11. package/dist/mcp/mutations.mjs +5 -43
  12. package/dist/mcp/preview-watch.mjs +23 -3
  13. package/dist/mcp/preview-widget.bundle.js +16 -15
  14. package/dist/mcp/project-widget.bundle.js +13 -13
  15. package/dist/mcp/resource-loader.js +50 -13
  16. package/dist/mcp/server.mjs +81 -39
  17. package/dist/oxlint.mjs +6 -1
  18. package/dist/preview-builder.mjs +114 -0
  19. package/dist/preview-inputs.mjs +8 -1
  20. package/dist/preview-resources.mjs +11 -4
  21. package/dist/preview-scope.mjs +6 -0
  22. package/dist/preview-workers.mjs +184 -0
  23. package/dist/scenario-groups.mjs +47 -0
  24. package/dist/scenario-inspector.mjs +34 -0
  25. package/dist/scenario-trace.mjs +3 -2
  26. package/dist/scenarios-compiler.mjs +203 -27
  27. package/dist/scenarios-vite.mjs +13 -5
  28. package/dist/scenarios.mjs +4 -1
  29. package/dist/showcase/client.bundle.js +23 -22
  30. package/dist/showcase/index.html +2 -2
  31. package/dist/showcase/navigation.js +13 -0
  32. package/dist/showcase/style.css +3 -1
  33. package/dist/skills/ads-break-ui/SKILL.md +4 -1
  34. package/dist/skills/ads-break-ui/references/runtimes.md +48 -0
  35. package/dist/skills/ads-break-ui/references/scenarios.md +19 -0
  36. package/dist/skills/ads-break-ui/references/validation.md +53 -0
  37. package/dist/skills/ads-designer/SKILL.md +4 -1
  38. package/dist/skills/ads-designer/assets/bootstrap-ds/scripts/build-mcp-previews.mjs +6 -7
  39. package/dist/skills/ads-designer/references/runtimes.md +48 -0
  40. package/dist/skills/ads-designer/references/scenarios.md +19 -0
  41. package/dist/skills/ads-designer/references/validation.md +53 -0
  42. package/dist/skills/ads-import/SKILL.md +4 -1
  43. package/dist/skills/ads-import/references/runtimes.md +48 -0
  44. package/dist/skills/ads-import/references/scenarios.md +19 -0
  45. package/dist/skills/ads-import/references/validation.md +53 -0
  46. package/dist/skills/ads-motion/SKILL.md +4 -1
  47. package/dist/skills/ads-motion/references/runtimes.md +48 -0
  48. package/dist/skills/ads-motion/references/scenarios.md +19 -0
  49. package/dist/skills/ads-motion/references/validation.md +53 -0
  50. package/dist/skills/ads-port/SKILL.md +4 -1
  51. package/dist/skills/ads-port/references/runtimes.md +48 -0
  52. package/dist/skills/ads-port/references/scenarios.md +19 -0
  53. package/dist/skills/ads-port/references/validation.md +53 -0
  54. package/dist/source-symbols.mjs +11 -0
  55. package/dist/source-values.mjs +10 -3
  56. package/dist/test-boundaries.mjs +95 -0
  57. package/dist/ui-framework.mjs +2 -1
  58. package/dist/units.mjs +12 -1
  59. package/dist/validation-checks.mjs +50 -0
  60. package/dist/validation.mjs +172 -0
  61. package/dist/verification/browser.mjs +3 -1
  62. package/dist/verification.mjs +1 -0
  63. package/docs/ADS.md +12 -2
  64. package/docs/ARCHITECTURE.md +125 -7
  65. package/docs/BEHAVIORS.md +7 -0
  66. package/docs/CHANGELOG.md +54 -0
  67. package/docs/GUIDE.md +31 -0
  68. package/docs/MCP.md +127 -16
  69. package/package.json +1 -1
package/docs/MCP.md CHANGED
@@ -63,9 +63,10 @@ policy. A disconnected subscription marks retained output stale and tears down
63
63
  App watchers; refresh the page after restarting ADS. Compilation remains necessary for project TSX/Linaria, performed by the
64
64
  managed project compiler on demand and after relevant source changes.
65
65
 
66
- Switching entries overlays a centered loading spinner, then reveals the new
67
- scenario inside the existing App. Loading and diagnostic overlays do not move the
68
- preview. Token presentation comes from project-owned scenarios, fixtures and
66
+ Switching entries updates the scenario inside the existing App. A quiet monochrome
67
+ indicator in the upper-right header reports compilation, checking, readiness or
68
+ failure; hover or click reveals details. The preview remains interactive during
69
+ background checks. Token presentation comes from project-owned scenarios, fixtures and
69
70
  development-only review helpers, using the project's real foundation CSS and extracted
70
71
  styles. The App runtime contains no token sample templates or named token ordering.
71
72
  The generic definition inspector remains available without a scenario build.
@@ -204,10 +205,11 @@ The server supplies agent guidance through its instructions, tool descriptions,
204
205
  | `ads_skills` | Workflow names/descriptions without loading instructions |
205
206
  | `ads_read_skill` | Explicit text instruction/support-file reads in bounded chunks |
206
207
  | `ads_show_tokens` | Render a discovered token scenario; legacy compilers retain the definition inspector |
207
- | `ads_scenarios` | Bounded token/component/pattern/composition scenario discovery |
208
+ | `ads_scenarios` | Bounded scenario discovery, including folder-derived groups searchable with `query` |
208
209
  | `ads_show_scenario` | Render an exact discovered scenario with its own fixtures |
209
210
  | `ads_behaviors` | Paged owner discovery; select a unit and detail section |
210
211
  | `ads_verify` | Execute an owner's registered checks and record revision-bound evidence |
212
+ | `ads_validate` | Run the complete project audit, or affected checks since a successful full baseline |
211
213
  | `ads_results` | Page saved execution outcomes, diagnostics, logs and captures without rerunning |
212
214
  | `ads_investigate` | Read one check's summary, then paged requests/errors/artifacts |
213
215
  | `ads_capture` | On-demand PNG of a discovered scenario or named element; replace current and clear candidate |
@@ -220,6 +222,15 @@ The server supplies agent guidance through its instructions, tool descriptions,
220
222
  | `ads_read_file` | Read bounded source ranges, with owning unit and full-file digest |
221
223
  | `ads_apply_patch` | Opt-in Git unified diff for one ADS unit, with dry-run validation |
222
224
 
225
+ Scenario results include `group` only when folder structure supplies one. It is
226
+ computed output, never scenario metadata. `ads_scenarios({query: "Forms"})` searches
227
+ the derived group label; `kind`, `offset` and `limit` continue to work. The full
228
+ `ads://project/scenarios` resource carries the same registry. Pass exact returned
229
+ IDs to `ads_show_scenario`; `ads_catalog.previews`, `ads_units` and source resources
230
+ retain the actual nested paths. A folder group is navigation, not an edit owner.
231
+ See [folder rules](GUIDE.md) and the
232
+ [architecture](ARCHITECTURE.md#folder-derived-navigation).
233
+
223
234
  Listings have bounded pages and opaque cursors. The source catalogue exposes
224
235
  public exports from `components/`, `patterns/` and `controllers/`; it does not execute TSX to
225
236
  guess component props. Read the exported API and owning guide. An export name
@@ -621,6 +632,14 @@ fixtures. `ads_show_tokens({category})` selects a discovered token scenario;
621
632
  omitting category selects the first token entry. The tool contains no project
622
633
  token templates or copied values.
623
634
 
635
+ Both tools default to `waitFor: "verified"`. The showcase requests
636
+ `waitFor: "compiled"` to browse live feedback or the last verified graph while
637
+ checks run. That mode can return `build.current: false`; it is visual feedback,
638
+ not successful verification evidence. It does not alter capture, behavior or
639
+ guarded-edit acceptance. Legacy HTML compilers retain their existing wait path.
640
+ Registered browser verification URLs and `openPreviewScenario` explicitly select
641
+ `waitFor=verified`; captures also retain verified readiness.
642
+
624
643
  ### One App, shared resources
625
644
 
626
645
  With the resource compiler enabled, both tools link **`ui://ads/preview`**. Their
@@ -643,6 +662,7 @@ the tool result. `resources/read` supplies these registered resources:
643
662
  |-----|-------------------|
644
663
  | `ui://ads/preview` | Tool-owned App bootstrap, official App SDK and resource loader |
645
664
  | `ads://preview/manifest` | Project compiler's versioned scenario/dependency graph |
665
+ | `ads://preview/live` | Current-source compiled feedback while checks are pending; explicitly unverified |
646
666
  | `ads://assets/<hash>.js` | Compiled shared runtime or scenario module |
647
667
  | `ads://assets/<hash>.css` | Extracted foundation or scenario styles |
648
668
  | `ads://assets/<hash>.woff2` (and other asset types) | Binary font/image/worker assets |
@@ -713,8 +733,12 @@ and native-client evidence is recorded in [compatibility notes](#protocols-notif
713
733
  Host context selects the project's light/dark theme and conveys available space.
714
734
  It does not silently replace project tokens/fonts with a host palette.
715
735
  Compositions retain the complete project skin. App readiness uses standard Apps
716
- initialization plus optional structured `ads-preview` logging (`loading`, `ready`,
717
- `error`); no custom parent-window readiness message is required.
736
+ initialization plus optional structured `ads-preview` logging (`loading`,
737
+ `checking`, `reverting`, `ready`, `error`); no custom parent-window readiness
738
+ message is required. `checking` never establishes verified App readiness. The
739
+ showcase puts these states in a small monochrome header indicator with tooltip
740
+ and expandable details; it keeps status and loading overlays out of the widget
741
+ area. Other Apps hosts retain the in-App status fallback.
718
742
 
719
743
  ### Configure the project compiler
720
744
 
@@ -744,15 +768,28 @@ framework compilation and Linaria extraction. The starter's
744
768
 
745
769
  - `runScenarioCompiler()` from `@reqvire-org/ads/scenarios/compiler` handles
746
770
  scheduling, validation, source freshness, successful caches and build reporting.
747
- - Its `buildGraph(entries, options, track)` adapter runs one multi-entry Vite build
748
- with `previewEntriesPlugin()` and `createPreviewResources()` from
749
- `@reqvire-org/ads/scenarios/vite`.
771
+ - `createVitePreviewBuilder({ build, configure })` from
772
+ `@reqvire-org/ads/scenarios/vite` supplies `buildGraph`. `build` is the project's
773
+ Vite build function; `configure(entries, options)` returns its Vite configuration
774
+ with `previewEntriesPlugin()` and the project's framework/Linaria plugins.
775
+ It keeps one Rollup watch graph in managed development, retaining unaffected
776
+ module transforms. A changed entry list or project configuration resets the graph.
777
+ Normal non-watch builds remain one-shot and in memory.
750
778
  Each mount imports the project's shared foundation entry. Keep that import in
751
779
  the preview module graph so independently built token scenarios receive the
752
780
  same shared Data as production UI.
753
781
  - Keep `preserveEntrySignatures: "strict"`, `cssCodeSplit: true`,
754
- `assetsInlineLimit: 0`, `modulePreload: false`, and `write: false`. Include the
755
- supplied dependency-tracking plugin and the project's Linaria/framework plugins.
782
+ `assetsInlineLimit: 0`, `modulePreload: false`, and `write: false` in the returned
783
+ configuration. The helper captures watched output in private `.ds/incremental/`
784
+ scratch files; this is not the published graph. It removes its scratch directory
785
+ and closes its watcher when the compiler stops.
786
+ Watched builds use one module output (no output array or `output.file`). Under
787
+ Bun, dependency watches use polling to recover rapid native watch reattachments;
788
+ project `build.watch.chokidar` options can override this choice.
789
+ - Existing custom `buildGraph(entries, options, track)` adapters still work. The
790
+ optional fourth argument supplies `{ watched }`; custom adapters must include
791
+ the supplied dependency-tracking plugin and may expose an async `.close()`.
792
+ Adopt the helper explicitly to gain persistent Vite compilation.
756
793
  - Use `linariaTagResolver` from `@reqvire-org/ads/linaria` in WyW's `tagResolver`
757
794
  option in both the product build and preview builder. It preserves opaque
758
795
  custom-property values through atomic extraction, including whitespace needed
@@ -763,13 +800,69 @@ framework compilation and Linaria extraction. The starter's
763
800
  an unmount callback. It imports the same project foundation used in production.
764
801
  It creates no App bridge; ADS supplies that bridge once.
765
802
 
766
- On first demand, the adapter builds a shared graph for all registered scenarios.
767
- A selection loads only its static dependency closure. Validation and compilation
768
- run together; both must succeed before publication. `.ds/preview-cache.json`
803
+ To migrate an existing adapter, keep its current Vite configuration and plugins,
804
+ return that configuration from `configure`, and replace its fresh-build wrapper:
805
+
806
+ ```js
807
+ import { createVitePreviewBuilder } from "@reqvire-org/ads/scenarios/vite";
808
+
809
+ await runScenarioCompiler(root, {
810
+ watched: process.argv.includes("--watch"),
811
+ validate, // retain the project's validation callback
812
+ compilerFiles: [import.meta.filename],
813
+ buildGraph: createVitePreviewBuilder({
814
+ build, // the project's Vite build function
815
+ configure(entries, options) {
816
+ return previewConfig(entries, options); // existing aliases, entries and plugins
817
+ },
818
+ }),
819
+ });
820
+ ```
821
+
822
+ The helper adds dependency tracking and resource conversion; remove the old
823
+ `await build(...)` / `createPreviewResources(...)` wrapper, not its framework,
824
+ Linaria, shared foundation or validation configuration. Upgrade the project ADS
825
+ dependency and restart its managed compiler to load the helper. Merely upgrading
826
+ the server does not convert a custom project adapter to incremental compilation.
827
+
828
+ Watched resource builds reuse self-contained IIFE worker bundles through the same
829
+ helper. `new Worker(new URL("./worker.ts", import.meta.url))`, `?worker` and
830
+ `?worker&url` imports use Vite's configured worker compiler on first demand, then
831
+ reuse its output while tracked source/configuration/dependency contents and
832
+ resolution directories match. Requests for one worker share the same pending
833
+ build. Every preview still receives its worker assets. Changed transitive inputs
834
+ rebuild the affected bundle; topology changes may invalidate more. Nested,
835
+ inline and split workers keep the normal Vite compilation path. No project names
836
+ or manually maintained worker dependency lists are needed.
837
+
838
+ On first demand or accepted-edit preparation, the adapter builds a shared graph for all registered scenarios.
839
+ A selection loads only its static dependency closure. Both validation and compilation
840
+ must succeed before verified publication. Watched compilation
841
+ can publish a separate live graph first, with `build.live.validated: false` and
842
+ `build.current: false`. Live reads require the current source digest and session;
843
+ they write no accepted scenario artifact or successful graph cache. The App
844
+ renders that feedback while checks run and restores the last verified graph on
845
+ failure. Validation and semantic registry inspection run off the visual update
846
+ path; new checks start after compilation, and rapid edits coalesce behind one
847
+ verification run. Compiled syntax errors
848
+ surface immediately. `.ds/preview-cache.json`
769
849
  reuses successful validation/output only when inputs, compiler/tool code,
770
850
  lockfile, recorded dependencies and content digests match. A source edit
771
- revalidates and recompiles the graph; Vite shares common modules across entries.
772
- Normal application builds retain their own chunking and optimization.
851
+ revalidates the project and incrementally updates the watched module graph. Both
852
+ must succeed against unchanged source before verified atomic publication; a failed or
853
+ superseded build cannot become current. Files outside Rollup's graph still trigger
854
+ validation and a reconciled build. Preview refresh retains the selected view's
855
+ state when its complete static module/style/asset closure is unchanged, while
856
+ rerunning its token/paint audits against the new manifest. Actual selected-view
857
+ changes remount it. Normal application builds retain their own chunking and optimization.
858
+
859
+ Accepted MCP edits enqueue preparation even without an open preview. Matching
860
+ validated candidate graphs seed the same project cache; location-dependent,
861
+ missing or incompatible output falls back to the normal compiler. A connected
862
+ showcase opportunistically prefetches changed peers' static resources after the
863
+ selected view paints, using its existing integrity-checked byte cache. This does
864
+ not import modules, attach styles or mount hidden examples; dynamic imports stay
865
+ lazy. Preparation is bounded and never establishes passing evidence by itself.
773
866
 
774
867
  The graph lives beside the configured manifest, under `assets/`. Tiny
775
868
  `.ds/scenarios/<id>/index.html` descriptors retain the reporter/registry contract;
@@ -1188,3 +1281,21 @@ maintenance when needed. `ads_status.reports` identifies the two intake tools,
1188
1281
  storage directory and `ads://guides/reporting`, without listing report contents.
1189
1282
  All five skills include the same portable
1190
1283
  [reporting reference](../skills/ads-designer/references/reporting.md).
1284
+
1285
+ ## Complete and affected validation
1286
+
1287
+ `ads_validate({})` and `ads validate` share the full validation engine.
1288
+ `ads_validate({scope:"changed"})` matches `ads validate --changed`. The MCP tool
1289
+ runs trusted configured project commands with cancellation and bounded output; it
1290
+ is available with source mutations disabled and writes only build/evidence output
1291
+ when project commands honor their checking contract. Summaries include scope,
1292
+ requestedScope, fallback reason, sourceRevision, current, elapsedMs and resultId.
1293
+ Read diagnostics/checks/outcomes with `ads_results`; progress and the latest
1294
+ validation summary are in `ads_status.validation`. Retention is latest per kind:
1295
+ validation, verification and mutation are independent.
1296
+
1297
+ Read `ads://guides/validation` for trigger guidance, baseline expansion, test
1298
+ boundaries, script selection and limits. Full audits include configured scripts
1299
+ and registered guarantees; changed mode narrows behavior owners while core and
1300
+ opaque project scripts remain complete. Neither mode rewrites npm test commands
1301
+ or treats compiled live previews as verification evidence.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reqvire-org/ads",
3
- "version": "0.3.27",
3
+ "version": "0.3.29",
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": {