@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/MCP.md
CHANGED
|
@@ -13,6 +13,14 @@ preview watcher and serves the built-in browser showcase, so the client needs
|
|
|
13
13
|
only one launch command. Source editing is disabled by default; `--mutations`
|
|
14
14
|
enables guarded ADS edits. MCP does not install skills or add a production runtime.
|
|
15
15
|
|
|
16
|
+
The browser starts from `ads://project/explorer`, a compact snapshot of navigation,
|
|
17
|
+
preview-tool capabilities, draft references and build state. It subscribes to index,
|
|
18
|
+
token and build changes rather than repeatedly fetching full semantic catalogues.
|
|
19
|
+
Interactive previews compile independently of background checks. A preview request
|
|
20
|
+
uses the compiler's advertised build budget plus transport overhead; changing the
|
|
21
|
+
selection cancels its pending request. Build failures remain visible with a Retry
|
|
22
|
+
action and do not require restarting MCP.
|
|
23
|
+
|
|
16
24
|
`ads_status.behaviorLibraries` reports each explicitly allowed project package,
|
|
17
25
|
its installed version and the ADS units that use it. Catalog entries expose their
|
|
18
26
|
`behaviorLibraries`, following local helpers and controllers. This allowlist
|
|
@@ -26,12 +34,50 @@ The ADS MCP server supports development, inspection and review of that UI. Its
|
|
|
26
34
|
showcase renders real implementations as MCP Apps, providing evidence for the
|
|
27
35
|
exercised conditions alongside normal application integration checks.
|
|
28
36
|
|
|
37
|
+
## Editing access and compiler ownership
|
|
38
|
+
|
|
39
|
+
Use [the direct editing and MCP-only workflows](../skills/ads-designer/references/workflows.md),
|
|
40
|
+
also served as `ads://guides/workflows` and linked by `ads_status.workflow.editing`.
|
|
41
|
+
With direct source access, an agent or human edits owned files in their normal
|
|
42
|
+
editor and uses MCP for previews, inspection and checks. A read-only connection
|
|
43
|
+
is sufficient; ordinary direct edits do not require drafts or `ads_accept`.
|
|
44
|
+
With MCP-only access, enabled mutation tools provide source/draft edits and
|
|
45
|
+
exact-revision acceptance. Without them or a separate editor, source editing is
|
|
46
|
+
unavailable. `mutations.enabled` reports server capability, not the chosen route.
|
|
47
|
+
|
|
48
|
+
Direct editing normally uses the ADS-managed compiler. Setting
|
|
49
|
+
`mcp.previewWatch: false` selects an external builder: the editor/builder publishes
|
|
50
|
+
the ADS resource graph and build evidence, and MCP serves previews without
|
|
51
|
+
starting a compiler. Existing views may remain visible during compilation, but
|
|
52
|
+
changed-source evidence is stale until verified updated artifacts are published.
|
|
53
|
+
Both editing routes require current ADS/project checks and rendered review.
|
|
54
|
+
|
|
55
|
+
## Command memory budgets (ADS 0.3.38+)
|
|
56
|
+
|
|
57
|
+
ADS 0.3.38 adds `resources.memoryLimitMb` in `ds.config.json`. Missing/null
|
|
58
|
+
selects an automatic process-tree budget of at most 6 GiB and one quarter of
|
|
59
|
+
physical RAM, with 1 GiB of available-memory headroom and inherited Linux limits
|
|
60
|
+
respected. A positive MiB value sets the project budget explicitly. Changing it
|
|
61
|
+
requires restarting ADS. This field is unavailable in published 0.3.37.
|
|
62
|
+
|
|
63
|
+
CLI MCP/Explorer, compile and check/verification commands share the envelope with
|
|
64
|
+
their descendants. Linux uses a user systemd memory scope where available,
|
|
65
|
+
without additional swap, or keeps a finite parent envelope. A separate watchdog
|
|
66
|
+
is the fallback; its sampling is not a hard kernel bound. `ads_status.resourceLimits`
|
|
67
|
+
reports `memoryLimitMb`, `enforcement`, `scope` and `hardLimit`. Embedded APIs
|
|
68
|
+
report `host-managed`, and standalone project scripts need their own limits.
|
|
69
|
+
See [project budgets and runtime selection](../skills/ads-designer/references/runtimes.md).
|
|
70
|
+
|
|
71
|
+
An exceeded command fails with `ADS_MEMORY_LIMIT` on stderr without contaminating
|
|
72
|
+
MCP stdout. Retained source/results must be inspected before retrying. No passing
|
|
73
|
+
result is implied by a timeout, killed worker or disconnected MCP transport.
|
|
74
|
+
|
|
29
75
|
## Built-in showcase client
|
|
30
76
|
|
|
31
77
|
### Auto-mode tracked drafts
|
|
32
78
|
|
|
33
|
-
Use the [draft workflow](../skills/ads-designer/references/drafts.md) for
|
|
34
|
-
design. With `--mutations`, `ads_create_draft` creates a tracked proposal for 1–64
|
|
79
|
+
Use the [draft workflow](../skills/ads-designer/references/drafts.md) for MCP-only
|
|
80
|
+
iterative design, or when direct editors choose isolated tracked proposals. With `--mutations`, `ads_create_draft` creates a tracked proposal for 1–64
|
|
35
81
|
owners; ordinary file edits or `ads_update_draft` continue it. `ads_show_draft`
|
|
36
82
|
reuses an isolated compiler workspace and returns both an MCP App preview and
|
|
37
83
|
browser URLs without running acceptance checks. `ads_drafts` lists only pending
|
|
@@ -49,7 +95,7 @@ the slots. Read the returned PNG resources before visual acceptance; the result
|
|
|
49
95
|
is explicitly `previewOnly`, not behavioral or acceptance evidence.
|
|
50
96
|
|
|
51
97
|
`ads_accept({id,revision})` validates and applies the exact reviewed revision in
|
|
52
|
-
one operation. Architecture,
|
|
98
|
+
one operation. Architecture, configured project commands and affected
|
|
53
99
|
behavior checks remain mandatory. Edits during checking and baseline conflicts
|
|
54
100
|
prevent application; failures retain the draft and return execution evidence.
|
|
55
101
|
Successful acceptance removes draft source, records an event and resolves draft
|
|
@@ -208,11 +254,11 @@ published package when absent. `-y` prevents an install prompt from blocking
|
|
|
208
254
|
MCP startup. For this `npx` setup, Node and npm must be available to the client.
|
|
209
255
|
|
|
210
256
|
For **Bun**, use `command = "bunx"` and
|
|
211
|
-
`args = ["
|
|
212
|
-
`command`/`args` values in Claude's JSON. Bun 1.
|
|
213
|
-
are unnecessary
|
|
214
|
-
|
|
215
|
-
|
|
257
|
+
`args = ["@reqvire-org/ads", "mcp"]` in Codex, or these equivalent
|
|
258
|
+
`command`/`args` values in Claude's JSON. Bun 1.4.1+ is sufficient; Node and npm
|
|
259
|
+
are unnecessary for ADS itself. The CLI has a Bun shebang. Generated local
|
|
260
|
+
launchers use the installed CLI while preserving interpreters selected by
|
|
261
|
+
application check/build scripts.
|
|
216
262
|
Runtime setup and diagnostics are also available in `ads://guides/runtimes`.
|
|
217
263
|
|
|
218
264
|
For **Claude Desktop**, use the same JSON in its MCP configuration and append
|
|
@@ -295,7 +341,7 @@ The server supplies agent guidance through its instructions, tool descriptions,
|
|
|
295
341
|
| `ads_status` | Project paths, watcher/build states, preview revisions and diagnostics, skills |
|
|
296
342
|
| `ads_catalog` | Bounded search for public UI, controllers and hooks, with source/guide URIs |
|
|
297
343
|
| `ads_tokens` | Bounded token-definition and theme inspection |
|
|
298
|
-
| `ads_check` | Current core architectural diagnostics;
|
|
344
|
+
| `ads_check` | Current core architectural diagnostics; configured project build tests remain separate |
|
|
299
345
|
| `ads_skills` | Workflow names/descriptions without loading instructions |
|
|
300
346
|
| `ads_read_skill` | Explicit text instruction/support-file reads in bounded chunks |
|
|
301
347
|
| `ads_show_tokens` | Render a discovered token scenario; legacy compilers retain the definition inspector |
|
|
@@ -641,7 +687,7 @@ For a coupled rename or upgrade, call `ads_apply_transaction`:
|
|
|
641
687
|
It accepts 2–64 distinct owners, at most 256 distinct files and 16 MiB of combined
|
|
642
688
|
Git diff text. Each patch obeys its own ownership/companion rules. Patches apply
|
|
643
689
|
in order inside one candidate; shared-entry hunks in a later patch must match
|
|
644
|
-
the earlier candidate's content. Core checks,
|
|
690
|
+
the earlier candidate's content. Core checks, configured project commands
|
|
645
691
|
and all affected behavior checks run against the final candidate. No intermediate
|
|
646
692
|
candidate is published. Dry runs, failures, conflicts and cancellation write no
|
|
647
693
|
source; a publication failure rolls back prior writes. This coordinates owned
|
|
@@ -669,9 +715,8 @@ placeholder. For coupled owners use the bounded transaction; a rejection still
|
|
|
669
715
|
requires correcting its owner/policy, never a direct-write bypass.
|
|
670
716
|
|
|
671
717
|
Set `dryRun` to `false` to apply. ADS reconstructs complete candidate files locally
|
|
672
|
-
and validates a temporary project copy with
|
|
673
|
-
|
|
674
|
-
(or `lint`) and `typecheck` scripts. For resource projects with `mcp.previewWatch`,
|
|
718
|
+
and validates a temporary project copy with native ADS guards, including warnings. By default it also runs available `lint:project`
|
|
719
|
+
(or `lint`) and `typecheck` scripts. For managed resource previews,
|
|
675
720
|
ADS also requests a full production preview build from the managed compiler and
|
|
676
721
|
uses that same host and checked graph for registered browser verification. Keep
|
|
677
722
|
`build:mcp-previews` for standalone builds; remove it from `mutationChecks` to
|
|
@@ -683,12 +728,11 @@ Override the additional script list through project-owned configuration:
|
|
|
683
728
|
{ "mcp": { "mutationChecks": ["lint", "typecheck"], "mutationCheckTimeoutMs": 120000 } }
|
|
684
729
|
```
|
|
685
730
|
|
|
686
|
-
Every listed script must exist. An empty list still runs mandatory ADS
|
|
687
|
-
and configured managed preview checks. Scripts use the project's npm/Bun runner; installed dependencies are
|
|
731
|
+
Every listed script must exist. An empty list still runs mandatory ADS and configured managed preview checks. Scripts use the project's npm/Bun runner; installed dependencies are
|
|
688
732
|
shared with the validation copy. These are trusted project commands, not an OS
|
|
689
733
|
sandbox. An explicit `configuration` patch can change project commands, registered
|
|
690
734
|
rules and reviewed exceptions; validation runs the proposed configuration and
|
|
691
|
-
scripts. Mandatory
|
|
735
|
+
scripts. Mandatory native ADS checks still run on every write.
|
|
692
736
|
Configuration changes cannot bundle unrelated component edits. Checks that
|
|
693
737
|
rewrite source are rejected. Each registered project script defaults to a
|
|
694
738
|
60-second limit. `mcp.mutationCheckTimeoutMs` sets its explicit budget
|
|
@@ -781,7 +825,7 @@ The loader runs **inside the App iframe**. It reads through the host's resource
|
|
|
781
825
|
bridge, verifies bytes, materializes Blob URLs and native ESM import maps, loads
|
|
782
826
|
CSS/fonts, then invokes the selected module's `mount(container)`. It caches
|
|
783
827
|
unchanged resources and shared runtime modules within that App. Dynamic imports
|
|
784
|
-
load their own dependency closure when invoked.
|
|
828
|
+
load their own dependency closure when invoked. Bun's self-contained worker
|
|
785
829
|
output remains a separate asset; workers must be stopped by their owner.
|
|
786
830
|
The preview adapter uses `worker.format: "iife"`: Chrome rejects module Blob
|
|
787
831
|
worker fetches in opaque origins, so the resource compiler adapts those
|
|
@@ -842,100 +886,41 @@ showcase puts these states in a small monochrome header indicator with tooltip
|
|
|
842
886
|
and expandable details; it keeps status and loading overlays out of the widget
|
|
843
887
|
area. Other Apps hosts retain the in-App status fallback.
|
|
844
888
|
|
|
845
|
-
###
|
|
846
|
-
|
|
847
|
-
```json
|
|
848
|
-
{
|
|
849
|
-
"framework": "react",
|
|
850
|
-
"mcp": {
|
|
851
|
-
"previewManifest": ".ds/preview/manifest.json",
|
|
852
|
-
"previewWatch": {
|
|
853
|
-
"command": "runtime",
|
|
854
|
-
"args": ["scripts/build-mcp-previews.mjs", "--watch"]
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
```
|
|
889
|
+
### ADS-owned Bun compiler
|
|
859
890
|
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
`command: "runtime"` uses the interpreter that launched ADS. Explicit `node`
|
|
864
|
-
or `bun` commands retain their meaning; a Node-specific project command still
|
|
865
|
-
requires Node. The same portable command is supported in behavior profiles.
|
|
866
|
-
|
|
867
|
-
Use `preact` for native Preact and a matching JSX/mount adapter. The project owns
|
|
868
|
-
framework compilation and Linaria extraction. The starter's
|
|
869
|
-
`scripts/build-mcp-previews.mjs` demonstrates the complete integration:
|
|
870
|
-
|
|
871
|
-
- `runScenarioCompiler()` from `@reqvire-org/ads/scenarios/compiler` handles
|
|
872
|
-
scheduling, validation, source freshness, successful caches and build reporting.
|
|
873
|
-
- `createVitePreviewBuilder({ build, configure })` from
|
|
874
|
-
`@reqvire-org/ads/scenarios/vite` supplies `buildGraph`. `build` is the project's
|
|
875
|
-
Vite build function; `configure(entries, options)` returns its Vite configuration
|
|
876
|
-
with `previewEntriesPlugin()` and the project's framework/Linaria plugins.
|
|
877
|
-
It keeps one Rollup watch graph in managed development, retaining unaffected
|
|
878
|
-
module transforms. A changed entry list or project configuration resets the graph.
|
|
879
|
-
Normal non-watch builds remain one-shot and in memory.
|
|
880
|
-
Each mount imports the project's shared foundation entry. Keep that import in
|
|
881
|
-
the preview module graph so independently built token scenarios receive the
|
|
882
|
-
same shared Data as production UI.
|
|
883
|
-
- Keep `preserveEntrySignatures: "strict"`, `cssCodeSplit: true`,
|
|
884
|
-
`assetsInlineLimit: 0`, `modulePreload: false`, and `write: false` in the returned
|
|
885
|
-
configuration. The helper captures watched output in private `.ds/incremental/`
|
|
886
|
-
scratch files; this is not the published graph. It removes its scratch directory
|
|
887
|
-
and closes its watcher when the compiler stops.
|
|
888
|
-
Watched builds use one module output (no output array or `output.file`). Under
|
|
889
|
-
Bun, dependency watches use polling to recover rapid native watch reattachments;
|
|
890
|
-
project `build.watch.chokidar` options can override this choice.
|
|
891
|
-
- Existing custom `buildGraph(entries, options, track)` adapters still work. The
|
|
892
|
-
optional fourth argument supplies `{ watched }`; custom adapters must include
|
|
893
|
-
the supplied dependency-tracking plugin and may expose an async `.close()`.
|
|
894
|
-
Adopt the helper explicitly to gain persistent Vite compilation.
|
|
895
|
-
- Use `linariaTagResolver` from `@reqvire-org/ads/linaria` in WyW's `tagResolver`
|
|
896
|
-
option in both the product build and preview builder. It preserves opaque
|
|
897
|
-
custom-property values through atomic extraction, including whitespace needed
|
|
898
|
-
by arithmetic later substituted into `calc()`. Existing custom builders need
|
|
899
|
-
this integration explicitly; disabling minification does not fix extraction.
|
|
900
|
-
See the skill-local [atomic styling guide](../skills/ads-designer/references/atomic-styles.md#preserve-custom-property-arithmetic-during-extraction).
|
|
901
|
-
- `showcase/mcp/main.tsx` exports `mountScenario(Scenario, container)` and returns
|
|
902
|
-
an unmount callback. It imports the same project foundation used in production.
|
|
903
|
-
It creates no App bridge; ADS supplies that bridge once.
|
|
904
|
-
|
|
905
|
-
To migrate an existing adapter, keep its current Vite configuration and plugins,
|
|
906
|
-
return that configuration from `configure`, and replace its fresh-build wrapper:
|
|
891
|
+
Bun 1.4.1+ compiles ADS browser bundles and MCP previews independently of the
|
|
892
|
+
application's bundler. Configure `framework` and `mcp.previewManifest`; ADS
|
|
893
|
+
supplies its compiler when no explicit project watcher is configured:
|
|
907
894
|
|
|
908
|
-
```
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
await runScenarioCompiler(root, {
|
|
912
|
-
watched: process.argv.includes("--watch"),
|
|
913
|
-
validate, // retain the project's validation callback
|
|
914
|
-
compilerFiles: [import.meta.filename],
|
|
915
|
-
buildGraph: createVitePreviewBuilder({
|
|
916
|
-
build, // the project's Vite build function
|
|
917
|
-
configure(entries, options) {
|
|
918
|
-
return previewConfig(entries, options); // existing aliases, entries and plugins
|
|
919
|
-
},
|
|
920
|
-
}),
|
|
921
|
-
});
|
|
895
|
+
```json
|
|
896
|
+
{"framework":"react","mcp":{"previewManifest":".ds/preview/manifest.json"}}
|
|
922
897
|
```
|
|
923
898
|
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
899
|
+
Use `preact` for native Preact. Remove the old project `mcp.previewWatch` command
|
|
900
|
+
to adopt this compiler. The project retains its framework mount in
|
|
901
|
+
`showcase/mcp/main.tsx` under the ADS root. It exports
|
|
902
|
+
`mountScenario(Scenario,container)` and returns cleanup. Bun selects the ADS JSX
|
|
903
|
+
runtime, resolves the public alias and extracts Linaria through the shared tag
|
|
904
|
+
resolver. Project application build settings stay under project control.
|
|
905
|
+
|
|
906
|
+
Run `ads compile .` for production previews or `ads compile . --watch` for a
|
|
907
|
+
continuous compiler. Project setup can call `compilePreviews` from
|
|
908
|
+
`@reqvire-org/ads/scenarios/compile`. Projects can integrate `ads check`,
|
|
909
|
+
`ads verify` and `ads validate` into their own build/test/CI scripts. ADS acceptance
|
|
910
|
+
always runs native gates and selected registered behavior checks; configured
|
|
911
|
+
project checks run explicitly. Oxlint is not an ADS gate dependency.
|
|
912
|
+
|
|
913
|
+
MCP warms the prioritized view first, then compiles the remaining graph in
|
|
914
|
+
one background build, without delaying service startup. One compiler job runs
|
|
915
|
+
at a time; foreground selections take priority over queued warming. Compiled views stay cached; unchanged warmed navigation
|
|
916
|
+
needs no compilation. Linaria transforms and worker bundles reuse source and
|
|
917
|
+
transitive dependency hashes. Worker compilation also uses Bun and temporary
|
|
918
|
+
worker compiler processes release their heaps after output is captured.
|
|
919
|
+
|
|
920
|
+
The build resource includes `warmup: {state,completed,total,failed}`. Build changes
|
|
921
|
+
notify supported MCP subscribers and Explorer updates automatically. Warming and
|
|
922
|
+
acceptance never suspend the interactive compiler. Cached output remains visible
|
|
923
|
+
while changed source compiles and validates.
|
|
939
924
|
|
|
940
925
|
On first demand or accepted-edit preparation, the adapter builds a shared graph for all registered scenarios.
|
|
941
926
|
A selection loads only its static dependency closure. Both validation and compilation
|
|
@@ -992,9 +977,20 @@ and alias diagnostics; `ads_tokens` works even when project previews cannot buil
|
|
|
992
977
|
|
|
993
978
|
### One client command, managed preview builds
|
|
994
979
|
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
above stays the same; no second terminal
|
|
980
|
+
With a declared framework and preview manifest, `ads mcp` starts ADS's Bun
|
|
981
|
+
compiler and warms the prioritized view followed by the remaining graph in
|
|
982
|
+
the background. Jobs run sequentially; foreground selections have priority. The client configuration above stays the same; no second terminal
|
|
983
|
+
or separately managed server is needed. An explicit `mcp.previewWatch` is reserved
|
|
984
|
+
for a custom compiler integration; remove former project Vite build commands to
|
|
985
|
+
adopt native compilation.
|
|
986
|
+
For direct editing with external compilation, set `mcp.previewWatch: false`.
|
|
987
|
+
An agent or human edits code and runs `ads compile .` or an external watch/builder
|
|
988
|
+
that publishes the ADS resource graph and build evidence. MCP serves that output
|
|
989
|
+
without starting a compiler. Existing views can remain visible while building;
|
|
990
|
+
source changes make their evidence stale until a verified update is published.
|
|
991
|
+
Missing or null uses the native compiler when the framework and preview manifest
|
|
992
|
+
are configured. This compiler choice does not force direct editors to use MCP
|
|
993
|
+
mutation tools.
|
|
998
994
|
Standard output trees (`dist`, `build`, `target`, `out`, `.next`, `.nuxt`,
|
|
999
995
|
`.svelte-kit`, `.turbo`) are excluded from preview watches and freshness inputs
|
|
1000
996
|
outside the configured source roots. Nested outputs are pruned before OS watches
|
|
@@ -1005,16 +1001,14 @@ For this checkout, build the tool once and let the client launch:
|
|
|
1005
1001
|
|
|
1006
1002
|
```sh
|
|
1007
1003
|
npm run build
|
|
1008
|
-
|
|
1004
|
+
bun dist/cli.mjs mcp
|
|
1009
1005
|
```
|
|
1010
1006
|
|
|
1011
|
-
The resource adapter
|
|
1012
|
-
|
|
1013
|
-
Preact projects supply
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
component library and does not auto-generate lookalikes. Unconfigured projects
|
|
1017
|
-
still get the token widget.
|
|
1007
|
+
The resource adapter retains compiled views and rebuilds them after source
|
|
1008
|
+
changes using one compiler process. Apps load their selected dependency closure.
|
|
1009
|
+
React and native Preact projects supply a mount adapter; ADS supplies compilation,
|
|
1010
|
+
Linaria extraction and publication. The application keeps its own build tools.
|
|
1011
|
+
Unconfigured projects still get the token widget.
|
|
1018
1012
|
|
|
1019
1013
|
Compiled Apps may fetch their bundled `blob:` assets, including Wasm, without
|
|
1020
1014
|
external network access. The ADS showcase/explorer permits WebAssembly compilation
|
|
@@ -1063,15 +1057,15 @@ second user command and applies to custom builders too.
|
|
|
1063
1057
|
The project must keep its watcher in the foreground,
|
|
1064
1058
|
rather than launching detached background processes. The configuration is
|
|
1065
1059
|
trusted project setup; MCP tools accept no executable or command arguments.
|
|
1066
|
-
|
|
1067
|
-
|
|
1060
|
+
For resource previews, missing or null `previewWatch` selects the native compiler.
|
|
1061
|
+
Custom standalone HTML integrations must declare their own publication contract.
|
|
1068
1062
|
|
|
1069
1063
|
### When a component changes
|
|
1070
1064
|
|
|
1071
1065
|
Edit the owned component/pattern and its fixture. The managed watcher rebuilds
|
|
1072
1066
|
the artifacts when their source changes. It is a child process supervised by
|
|
1073
|
-
MCP; the client launches only `ads mcp`.
|
|
1074
|
-
|
|
1067
|
+
MCP; the client launches only `ads mcp`. ADS's compiler owns extraction and rebuilding, while MCP watches the resulting
|
|
1068
|
+
artifacts and serves them.
|
|
1075
1069
|
|
|
1076
1070
|
The MCP server detects the new artifact and sends resource-change notifications.
|
|
1077
1071
|
The built-in host forwards the current selection after a successful build;
|
|
@@ -1188,7 +1182,7 @@ well as its compiler. Call `begin` when source is invalidated, and capture a
|
|
|
1188
1182
|
separate revision for each actual build; a completion from an older revision
|
|
1189
1183
|
cannot clear a newer invalidation or error.
|
|
1190
1184
|
|
|
1191
|
-
This checkout's [
|
|
1185
|
+
This checkout's [native compiler entry](../scripts/build-mcp-previews.mjs) reports initial and
|
|
1192
1186
|
incremental builds, compiler/output errors and immediate invalidation. Another
|
|
1193
1187
|
project wires the reporter into its existing build hooks; ADS does not infer
|
|
1194
1188
|
success from free-form console output or install another compiler.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Native Bun previews: compilation, resources and restart reuse
|
|
2
|
+
|
|
3
|
+
Local measurements on 23 October 2026, using the same frozen 865-file Gidi
|
|
4
|
+
snapshot (4,389,282 authored bytes, 151 scenarios) as the earlier memory work.
|
|
5
|
+
The live Gidi checkout and its installed ADS package were not patched. Real
|
|
6
|
+
MCP Apps ran in headless Chrome. These are local observations, not service limits.
|
|
7
|
+
|
|
8
|
+
## Startup and warming
|
|
9
|
+
|
|
10
|
+
| Measurement | Native Bun result |
|
|
11
|
+
| --- | ---: |
|
|
12
|
+
| MCP serving URL | 0.98–1.12 s |
|
|
13
|
+
| First requested Slack settings preview compiled, including startup | 6.1–6.4 s |
|
|
14
|
+
| All 151 views compiled, including startup | 7.7–7.9 s |
|
|
15
|
+
| All 151 views current after native gates | 16.9–20.4 s |
|
|
16
|
+
| Selecting an already warmed Popover, no compilation | 0.29–0.56 s |
|
|
17
|
+
| Peak process-tree PSS, including browser verification | 2.17 GiB |
|
|
18
|
+
| Main process RSS after semantic worker retirement | 409–413 MiB |
|
|
19
|
+
|
|
20
|
+
Each run used a 4 GiB process-tree memory limit, disabled swap within that
|
|
21
|
+
scope, and a 1,000 MiB Node heap limit. It loaded Slack settings and exercised
|
|
22
|
+
the real Popover control after warming. Two warm-cache restarts then recovered
|
|
23
|
+
all 151 current views in 3.8 and 4.1 seconds, with **zero Bun compiler
|
|
24
|
+
invocations**, identical graph identity, and 313–315 MiB main-process RSS.
|
|
25
|
+
Cached bytes are still integrity-checked and republished into each managed session.
|
|
26
|
+
|
|
27
|
+
The initial sequential scheduler repeatedly bundled growing prefixes of the
|
|
28
|
+
catalogue. An earlier run of that implementation took 206 seconds to make all
|
|
29
|
+
151 views current. The current scheduler compiles the prioritized view first,
|
|
30
|
+
then the remaining graph in one background job. Jobs remain sequential in one
|
|
31
|
+
compiler, with foreground requests ahead of queued warming. That earlier run
|
|
32
|
+
used a 3 GiB scope and a different Node heap limit, so it is not an exact
|
|
33
|
+
controlled timing ratio.
|
|
34
|
+
|
|
35
|
+
Two restart defects were found with these checks: removed generated entry files
|
|
36
|
+
were accidentally treated as source dependencies, and graphs followed navigation
|
|
37
|
+
order rather than canonical discovery order. Both are covered by restart tests,
|
|
38
|
+
including a remembered view that is not first in the catalogue.
|
|
39
|
+
|
|
40
|
+
## CSS ownership and deferred resources
|
|
41
|
+
|
|
42
|
+
With all 151 scenarios compiled together, the frozen snapshot's development
|
|
43
|
+
dependency closures contain approximately:
|
|
44
|
+
|
|
45
|
+
| Preview | Owner CSS | Complete CSS dependency closure |
|
|
46
|
+
| --- | ---: | ---: |
|
|
47
|
+
| Popover | 5.5 kB | 18.6 kB |
|
|
48
|
+
| MessageScroller | 1.1 kB | 43.2 kB |
|
|
49
|
+
| Conversation pattern | 4.3 kB | 90.7 kB |
|
|
50
|
+
| Native AppShell | 15.1 kB | 48.6 kB |
|
|
51
|
+
| Full chat composition | — | 175.0 kB |
|
|
52
|
+
|
|
53
|
+
Closures include the 6.6 kB foundation. The 53.3 kB font is a separate asset,
|
|
54
|
+
not embedded in CSS. Development comments include source paths, so byte counts
|
|
55
|
+
vary slightly with the isolated working directory. These are preview resources,
|
|
56
|
+
not measurements of the consuming application's minified production output.
|
|
57
|
+
|
|
58
|
+
The full chat demonstration eagerly imports every route plus voice, terminal
|
|
59
|
+
and workflow demonstrations. Its larger closure reflects that composition;
|
|
60
|
+
ADS cannot defer an application's ordinary static imports automatically.
|
|
61
|
+
Pure public barrels are narrowed only when their owning package explicitly
|
|
62
|
+
declares an applicable `sideEffects` policy. Executable/unknown barrels retain
|
|
63
|
+
normal bundler semantics.
|
|
64
|
+
|
|
65
|
+
ADS's own `composition/OnDemand` example demonstrates the supported alternative
|
|
66
|
+
using its real shell and components. Browser tests observe actual MCP resource
|
|
67
|
+
reads: the Details module and SummaryList CSS remain unread until Details opens,
|
|
68
|
+
load once, and retain both page notes and left-pane state on revisit. Warming
|
|
69
|
+
all 44 example views neither fetches unopened peers nor remounts the shell.
|
|
70
|
+
A separate browser regression updates an opened lazy branch's CSS without
|
|
71
|
+
changing its JavaScript bytes; the visible styles update and form state remains.
|
|
72
|
+
|
|
73
|
+
## Reproduction
|
|
74
|
+
|
|
75
|
+
Use a frozen source snapshot and idle consumers; do not benchmark by editing a
|
|
76
|
+
live developer's files. `scripts/benchmarks/gidi-preview-memory/prepare.mjs`
|
|
77
|
+
creates isolated inputs. Set `ADS_BENCH_NATIVE=1` for the native compiler and
|
|
78
|
+
`ADS_BENCH_OUTPUT` for the owned output directory. The monitor samples all child
|
|
79
|
+
processes' PSS/RSS from `/proc`; run it in a bounded memory scope:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
ADS_BENCH_NATIVE=1 ADS_BENCH_OUTPUT=output/bun-proof \
|
|
83
|
+
node scripts/benchmarks/gidi-preview-memory/prepare.mjs /path/to/gidi candidate 1
|
|
84
|
+
ADS_BENCH_WARM=1 ADS_BENCH_BROWSER=1 ADS_BENCH_DRIVER=./preview.mjs \
|
|
85
|
+
bun scripts/benchmarks/gidi-preview-memory/monitor.mjs output/bun-proof/candidate-1
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`tests/bun-preview.test.mjs` verifies React/Preact rendering, workers/assets,
|
|
89
|
+
source updates and unchanged restarts. `tests/example-lazy-browser.test.mjs`
|
|
90
|
+
checks the real example; `tests/lazy-styles-browser.test.mjs` covers CSS-only lazy
|
|
91
|
+
updates. These focused checks supplement the complete release test suite.
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Gidi draft acceptance: memory and compiler reuse
|
|
2
2
|
|
|
3
|
+
Historical ADS 0.3.35 measurement. The compiler parking and project Vite adapter
|
|
4
|
+
described here have been superseded by independent interactive compilation and
|
|
5
|
+
ADS-owned Bun previews; see [native preview measurements](bun-previews.md).
|
|
6
|
+
|
|
3
7
|
Measured on 23 October 2026 using a frozen Gidi source snapshot and real MCP
|
|
4
8
|
Apps in headless Chrome. The installed Gidi package and working source were not
|
|
5
9
|
patched. The baseline distribution matched published ADS 0.3.34 byte for byte.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reqvire-org/ads",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.38",
|
|
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": {
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
],
|
|
22
22
|
"scripts": {
|
|
23
23
|
"dev": "npm run dev:showcase",
|
|
24
|
-
"ads-mcp": "node scripts/build-ads-tool.mjs 1>&2 &&
|
|
25
|
-
"ads-read-mcp": "node scripts/build-ads-tool.mjs 1>&2 &&
|
|
26
|
-
"dev:showcase": "node scripts/build-ads-tool.mjs &&
|
|
24
|
+
"ads-mcp": "node scripts/build-ads-tool.mjs 1>&2 && bun dist/cli.mjs mcp --mutations",
|
|
25
|
+
"ads-read-mcp": "node scripts/build-ads-tool.mjs 1>&2 && bun dist/cli.mjs mcp",
|
|
26
|
+
"dev:showcase": "node scripts/build-ads-tool.mjs && bun dist/cli.mjs showcase",
|
|
27
27
|
"dev:mcp-explorer": "node scripts/build-ads-tool.mjs && node mcp-explorer/server.mjs",
|
|
28
28
|
"build": "npm run lint:tool && npm run build:tool",
|
|
29
29
|
"build:tool": "node scripts/build-ads-tool.mjs",
|
|
30
30
|
"build:project": "npm run build:tool && npm run lint:project && npm run generate:icons && npm run typecheck && vite build && node scripts/build-mcp-previews.mjs",
|
|
31
31
|
"build:lib": "npm run generate:icons && vite build",
|
|
32
|
-
"build:showcase": "npm run build:tool &&
|
|
33
|
-
"build:mcp-previews": "
|
|
32
|
+
"build:showcase": "npm run build:tool && bun dist/cli.mjs compile .",
|
|
33
|
+
"build:mcp-previews": "bun dist/cli.mjs compile .",
|
|
34
34
|
"generate:icons": "node scripts/generate-icons.mjs",
|
|
35
35
|
"sync:skill-starter": "node scripts/sync-skill-starter.mjs",
|
|
36
36
|
"check:skill-starter": "node scripts/sync-skill-starter.mjs --check",
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
"lint": "npm run lint:tool",
|
|
40
40
|
"lint:tool": "npm run check:skill-starter && npm run check:skill-references && oxlint --deny-warnings src preview-client showcase-client mcp-explorer tests/*.test.mjs tests/helpers scripts/build-ads-tool.mjs scripts/pack-ads-tool.mjs scripts/sync-skill-references.mjs scripts/local-test-proof.mjs",
|
|
41
41
|
"lint:project": "npm run lint:ds && npm run lint:style && npm run check:skill-starter",
|
|
42
|
-
"lint:ds": "
|
|
42
|
+
"lint:ds": "bun dist/cli.mjs check",
|
|
43
43
|
"lint:style": "biome lint --config-path=biome.css.json .",
|
|
44
|
-
"preview": "
|
|
45
|
-
"preview:showcase": "
|
|
44
|
+
"preview": "bun dist/cli.mjs showcase",
|
|
45
|
+
"preview:showcase": "bun dist/cli.mjs showcase",
|
|
46
46
|
"typecheck": "tsc --noEmit",
|
|
47
47
|
"test": "npm run build && node --test --test-reporter=tap --test-concurrency=1 tests/*.test.mjs",
|
|
48
48
|
"test:tool": "npm test",
|
|
49
49
|
"pack:tool": "node scripts/pack-ads-tool.mjs",
|
|
50
|
-
"ads": "
|
|
50
|
+
"ads": "bun dist/cli.mjs",
|
|
51
51
|
"prepack": "npm run build",
|
|
52
52
|
"release:verify": "node scripts/local-test-proof.mjs",
|
|
53
53
|
"release:proof": "node scripts/local-test-proof.mjs --check"
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
"sharp": "^0.35.5",
|
|
62
62
|
"typescript": "^5.9.3",
|
|
63
63
|
"yaml": "2.9.1",
|
|
64
|
-
"zod": "4.4.3"
|
|
64
|
+
"zod": "4.4.3",
|
|
65
|
+
"@wyw-in-js/transform": "2.1.3"
|
|
65
66
|
},
|
|
66
67
|
"devDependencies": {
|
|
67
68
|
"@babel/core": "^7.29.7",
|
|
@@ -82,7 +83,6 @@
|
|
|
82
83
|
"@vitejs/plugin-react": "^4.3.4",
|
|
83
84
|
"@wyw-in-js/babel-preset": "^2.0.1",
|
|
84
85
|
"@wyw-in-js/vite": "^2.0.1",
|
|
85
|
-
"esbuild": "0.25.12",
|
|
86
86
|
"oxlint": "^1.69.0",
|
|
87
87
|
"preact": "11.0.1",
|
|
88
88
|
"react": "^19.2.7",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
},
|
|
101
101
|
"engines": {
|
|
102
102
|
"node": ">=22.12.0",
|
|
103
|
-
"bun": ">=1.
|
|
103
|
+
"bun": ">=1.4.1"
|
|
104
104
|
},
|
|
105
105
|
"bin": {
|
|
106
106
|
"ads": "./dist/cli.mjs"
|
|
@@ -118,7 +118,9 @@
|
|
|
118
118
|
"./scenarios": "./dist/scenarios.mjs",
|
|
119
119
|
"./scenarios/vite": "./dist/scenarios-vite.mjs",
|
|
120
120
|
"./scenarios/compiler": "./dist/scenarios-compiler.mjs",
|
|
121
|
-
"./verification": "./dist/verification/browser.mjs"
|
|
121
|
+
"./verification": "./dist/verification/browser.mjs",
|
|
122
|
+
"./scenarios/bun": "./dist/preview-bun.mjs",
|
|
123
|
+
"./scenarios/compile": "./dist/bun-compiler.mjs"
|
|
122
124
|
},
|
|
123
125
|
"files": [
|
|
124
126
|
"dist",
|