@reqvire-org/ads 0.3.24 → 0.3.26
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 +7 -5
- package/dist/behaviors.mjs +6 -4
- package/dist/bootstrap-ds/ADS.md +28 -30
- package/dist/bootstrap-ds/README.md +6 -6
- package/dist/bootstrap-ds/design-system/assets/brand/README.md +3 -2
- package/dist/boundaries.mjs +0 -3
- package/dist/check.mjs +15 -22
- package/dist/config.mjs +3 -7
- package/dist/contract-migration.mjs +3 -3
- package/dist/contracts.d.mts +2 -3
- package/dist/declarative-flow.mjs +144 -0
- package/dist/design-values.mjs +81 -0
- package/dist/evidence.mjs +1 -1
- package/dist/mcp/catalog.mjs +4 -2
- package/dist/mcp/context.mjs +3 -3
- package/dist/mcp/prompts.mjs +4 -4
- package/dist/mcp/reports.mjs +101 -0
- package/dist/mcp/server.mjs +38 -3
- package/dist/paint-contracts.mjs +4 -5
- package/dist/preview-resources.mjs +1 -2
- package/dist/runtime-contracts.mjs +26 -37
- package/dist/scenario-trace.mjs +47 -18
- package/dist/scenarios.mjs +15 -15
- package/dist/skills/README.md +7 -3
- package/dist/skills/ads-break-ui/SKILL.md +24 -13
- package/dist/skills/ads-break-ui/references/atomic-styles.md +9 -2
- package/dist/skills/ads-break-ui/references/behaviors.md +393 -0
- package/dist/skills/ads-break-ui/references/captures.md +1 -1
- package/dist/skills/ads-break-ui/references/contracts.md +61 -40
- package/dist/skills/ads-break-ui/references/design-data.md +91 -0
- package/dist/skills/ads-break-ui/references/evidence.md +4 -0
- package/dist/skills/ads-break-ui/references/guarded-editing.md +7 -11
- package/dist/skills/ads-break-ui/references/reporting.md +101 -0
- package/dist/skills/ads-break-ui/references/scenarios.md +9 -15
- package/dist/skills/ads-designer/SKILL.md +26 -15
- package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +28 -30
- package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +6 -6
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/README.md +3 -2
- package/dist/skills/ads-designer/references/atomic-styles.md +9 -2
- package/dist/skills/ads-designer/references/behaviors.md +393 -0
- package/dist/skills/ads-designer/references/captures.md +1 -1
- package/dist/skills/ads-designer/references/contracts.md +61 -40
- package/dist/skills/ads-designer/references/design-craft.md +1 -1
- package/dist/skills/ads-designer/references/design-data.md +91 -0
- package/dist/skills/ads-designer/references/evidence.md +4 -0
- package/dist/skills/ads-designer/references/guarded-editing.md +7 -11
- package/dist/skills/ads-designer/references/mobile.md +1 -1
- package/dist/skills/ads-designer/references/reporting.md +101 -0
- package/dist/skills/ads-designer/references/scenarios.md +9 -15
- package/dist/skills/ads-import/SKILL.md +29 -17
- package/dist/skills/ads-import/references/atomic-styles.md +9 -2
- package/dist/skills/ads-import/references/behaviors.md +393 -0
- package/dist/skills/ads-import/references/branding.md +1 -1
- package/dist/skills/ads-import/references/captures.md +1 -1
- package/dist/skills/ads-import/references/contracts.md +61 -40
- package/dist/skills/ads-import/references/design-data.md +91 -0
- package/dist/skills/ads-import/references/evidence.md +4 -0
- package/dist/skills/ads-import/references/guarded-editing.md +7 -11
- package/dist/skills/ads-import/references/implementation.md +3 -2
- package/dist/skills/ads-import/references/reporting.md +101 -0
- package/dist/skills/ads-import/references/scenarios.md +9 -15
- package/dist/skills/ads-import/references/tokens.md +11 -9
- package/dist/skills/ads-motion/SKILL.md +23 -12
- package/dist/skills/ads-motion/references/atomic-styles.md +9 -2
- package/dist/skills/ads-motion/references/behaviors.md +393 -0
- package/dist/skills/ads-motion/references/captures.md +1 -1
- package/dist/skills/ads-motion/references/contracts.md +61 -40
- package/dist/skills/ads-motion/references/design-data.md +91 -0
- package/dist/skills/ads-motion/references/evidence.md +4 -0
- package/dist/skills/ads-motion/references/guarded-editing.md +7 -11
- package/dist/skills/ads-motion/references/reporting.md +101 -0
- package/dist/skills/ads-motion/references/scenarios.md +9 -15
- package/dist/skills/{ads-migrate → ads-port}/SKILL.md +59 -31
- package/dist/skills/ads-port/agents/openai.yaml +4 -0
- package/dist/skills/{ads-migrate → ads-port}/references/atomic-styles.md +9 -2
- package/dist/skills/ads-port/references/behaviors.md +393 -0
- package/dist/skills/{ads-migrate → ads-port}/references/captures.md +1 -1
- package/dist/skills/{ads-migrate → ads-port}/references/contracts.md +61 -40
- package/dist/skills/ads-port/references/design-data.md +91 -0
- package/dist/skills/{ads-migrate → ads-port}/references/evidence.md +4 -0
- package/dist/skills/{ads-migrate → ads-port}/references/guarded-editing.md +7 -11
- package/dist/skills/{ads-migrate → ads-port}/references/lint-and-docs.md +5 -0
- package/dist/skills/{ads-migrate → ads-port}/references/native-implementation.md +49 -15
- package/dist/skills/ads-port/references/reporting.md +101 -0
- package/dist/skills/{ads-migrate → ads-port}/references/scenarios.md +9 -15
- package/dist/skills/{ads-migrate → ads-port}/references/testing.md +11 -1
- package/dist/source-values.mjs +3 -3
- package/dist/tokens.mjs +5 -8
- package/dist/unit-contracts.mjs +24 -12
- package/docs/ADS.md +42 -73
- package/docs/ARCHITECTURE.md +54 -20
- package/docs/BEHAVIORS.md +46 -36
- package/docs/CHANGELOG.md +34 -0
- package/docs/CONTRACTS.md +67 -39
- package/docs/GUIDE.md +21 -13
- package/docs/MCP.md +67 -11
- package/package.json +1 -1
- package/dist/scoped-tokens.mjs +0 -68
- package/dist/skills/ads-migrate/agents/openai.yaml +0 -4
- /package/dist/skills/{ads-migrate → ads-port}/references/cli.md +0 -0
- /package/dist/skills/{ads-migrate → ads-port}/references/layers.md +0 -0
- /package/dist/skills/{ads-migrate → ads-port}/references/review.md +0 -0
package/docs/CONTRACTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Static owner contracts and development files
|
|
2
2
|
|
|
3
|
-
Use one optional `<Owner>.ads.contract.ts` for
|
|
3
|
+
Use one optional `<Owner>.ads.contract.ts` for constrained
|
|
4
4
|
paint inputs, scoped runtime bindings, declarative parts and behavioral checks.
|
|
5
5
|
The import `import type { UnitContract } from "@reqvire-org/ads/contracts"` supplies
|
|
6
6
|
development typing. ADS reads its AST and resolves real symbols without importing
|
|
@@ -15,12 +15,9 @@ components/Plot/
|
|
|
15
15
|
renderer.tsx production consumer
|
|
16
16
|
paints.ts production binding producer
|
|
17
17
|
types.ts production prop types
|
|
18
|
-
tokens.css optional production token definitions
|
|
19
18
|
Plot.ads.contract.ts static tool declaration
|
|
20
19
|
Plot.ads.scenario.tsx demonstration
|
|
21
20
|
Plot.ads.fixture.ts demonstration data
|
|
22
|
-
Tokens.ads.scenario.tsx real owner-token samples
|
|
23
|
-
Tokens.ads.fixture.ts sample bindings/probes
|
|
24
21
|
Plot.ads.behavior.spec.ts registered browser checks
|
|
25
22
|
Plot.ads.test.tsx optional unit tests
|
|
26
23
|
Plot.ads.helpers.ts development-only adapters
|
|
@@ -56,7 +53,6 @@ import { paints } from "./paints";
|
|
|
56
53
|
|
|
57
54
|
export default {
|
|
58
55
|
schemaVersion: 1,
|
|
59
|
-
tokens: { namespace: "--plot-", stylesheet: "./tokens.css" },
|
|
60
56
|
paintInputs: [
|
|
61
57
|
{ api: Plot, property: "config.*.paint", kind: "paint-reference" },
|
|
62
58
|
{ api: Series, property: "fill", kind: "paint-reference", bindings: ["items"] },
|
|
@@ -75,7 +71,7 @@ export default {
|
|
|
75
71
|
{ api: Series, parent: Plot, consumer: Renderer, checks: ["isolation"] },
|
|
76
72
|
],
|
|
77
73
|
behavior: {
|
|
78
|
-
subjects: { plot: { api: Plot }, renderer: { implementation: Renderer } },
|
|
74
|
+
subjects: { plot: { api: Plot }, renderer: { implementation: Renderer, role: "implementation" } },
|
|
79
75
|
guarantees: [{
|
|
80
76
|
id: "scoped-output",
|
|
81
77
|
description: "Changing either instance updates only its own output.",
|
|
@@ -97,7 +93,13 @@ Symbol references resolve through normal imports, aliases and re-exports.
|
|
|
97
93
|
Calls, getters, methods, computed metadata and environment-dependent expressions
|
|
98
94
|
are rejected. Function references are opaque identities, never executed.
|
|
99
95
|
Private implementation subjects may be internal module exports without becoming
|
|
100
|
-
public barrel exports.
|
|
96
|
+
public barrel exports. Private subjects default to the existing headless controller
|
|
97
|
+
contract. Use `role: "controller"` explicitly for behavior-only code, or
|
|
98
|
+
`role: "implementation"` for a private visual renderer or binding producer whose
|
|
99
|
+
guarantees should be tracked without classifying it as a controller. Shared
|
|
100
|
+
`controllers/` source always remains headless. An implementation role retains
|
|
101
|
+
normal ownership, dependency, styling and development boundaries; it is not a
|
|
102
|
+
style exception. Producers/consumers must belong to the same owner. Required
|
|
101
103
|
checks must exist, back named guarantees and use a browser profile with the
|
|
102
104
|
corresponding scenario. A relationship is registration, not a passing guarantee.
|
|
103
105
|
|
|
@@ -145,13 +147,33 @@ it does not authorize arbitrary inline styling, CSSProperties APIs or bulk write
|
|
|
145
147
|
Unsupported dynamic producers/attachment paths fail with an analysis diagnostic.
|
|
146
148
|
Keep the implementation project-owned; there is no required ADS binding helper.
|
|
147
149
|
|
|
148
|
-
|
|
150
|
+
A producer with alternative/derived sources declares each entry path, for example:
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
valueFrom: ["paint", "scheme.day", "scheme.night"],
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Register each matching `config.*.<path>` in `paintInputs`. The producer may write
|
|
157
|
+
one declared field, or an exact `light-dark(${entry.scheme.day}, ${entry.scheme.night})`
|
|
158
|
+
template over two declared fields. The normal key/map/root proof still applies.
|
|
159
|
+
Raw constants, undeclared fields, extra writes and unknown transforms are rejected.
|
|
160
|
+
The browser audit checks actual accessible color references in both branches;
|
|
161
|
+
a local SVG URL or `none` is not a CSS color inside `light-dark()`.
|
|
162
|
+
|
|
163
|
+
Families cannot overlap shared tokens, private runtime
|
|
149
164
|
prefixes or other bindings. A broad family such as `--color-${key}` grants no
|
|
150
165
|
shared-token exception. Use a distinct private family where collision freedom
|
|
151
166
|
cannot be established. Registered paint consumers list their allowed binding IDs;
|
|
152
|
-
borrowing a peer's family or private
|
|
167
|
+
borrowing a peer's binding family or private runtime variable remains invalid. Bindings are scoped
|
|
153
168
|
to their actual root; portals outside it need deliberate project integration.
|
|
154
169
|
|
|
170
|
+
A registered binding producer may combine two accessible color references as
|
|
171
|
+
`light-dark(var(--light-token), var(--dark-token))`. The App paint audit checks
|
|
172
|
+
both branches and their observed effect in the active color scheme. Raw colors,
|
|
173
|
+
undefined tokens and SVG URLs inside this color function remain invalid.
|
|
174
|
+
This derived binding form does not widen public paint-input types; use constrained
|
|
175
|
+
references for each theme input and verify both color schemes in browser checks.
|
|
176
|
+
|
|
155
177
|
The App audit checks current mounted instances, accessible values, local SVG
|
|
156
178
|
resources and computed paint-property responses. Visibility and complete rendered
|
|
157
179
|
output still need assertions in the registered browser checks. It rejects missing/duplicate IDs and reports unobserved written values separately. It is bounded to 100 families, 20 instances per family, 100 keys
|
|
@@ -177,9 +199,30 @@ export const scenario = {
|
|
|
177
199
|
};
|
|
178
200
|
```
|
|
179
201
|
|
|
180
|
-
|
|
202
|
+
A part may register several distinct parents; each API/parent pair has one
|
|
203
|
+
consumer/check declaration. A parent may itself be a registered declarative part.
|
|
204
|
+
The graph must be acyclic and every parent chain must reach a public rendering
|
|
205
|
+
root. Duplicate pairs, cycles and detached part graphs fail.
|
|
206
|
+
|
|
207
|
+
For example, `Entry` can belong to `FirstView` and `SecondView`, while `Detail`
|
|
208
|
+
belongs to `Entry`. The scenario covers the rendering roots and exercises both
|
|
209
|
+
`Entry` and `Detail`. A nested `Detail` outside its registered parent does not count.
|
|
210
|
+
|
|
211
|
+
The real part must reach its registered consumer through a rendering parent.
|
|
181
212
|
ADS resolves source identity comparisons (`child.type === Series`, including a
|
|
182
213
|
traceable comparison helper) and reads of that same child’s props traced from the consumer’s children input.
|
|
214
|
+
Traceable paths include local recursive fragment flattening, `find`/`filter`,
|
|
215
|
+
callback aliases and props carried through local records. Reusing a review layout
|
|
216
|
+
inside another instance of itself is ordinary component composition, not a
|
|
217
|
+
recursive helper call. Source sites/work limits still bound analysis.
|
|
218
|
+
|
|
219
|
+
`exercises` establishes reachable behavioral use, including a conditional state
|
|
220
|
+
and mapped literal fixture data; it does not promise unconditional initial DOM.
|
|
221
|
+
Always-false branches, unused adapters, empty/unknown fixture maps and broken
|
|
222
|
+
parent chains grant no credit. `covers` retains its rendering contract. Required
|
|
223
|
+
browser checks cover a rendering root and exercise the relevant parent/child
|
|
224
|
+
chain, then verify adding/removing/updating the part changes actual output.
|
|
225
|
+
|
|
183
226
|
A comparison against a decoy object gives no evidence. An import, unrelated parent, unused
|
|
184
227
|
child or metadata claim gives no consumption credit. Unknown render branches are
|
|
185
228
|
conservative. Browser checks must verify that adding/removing/changing the part
|
|
@@ -192,38 +235,23 @@ retained. Unreadable prerequisites report coverage as not established. Inspect
|
|
|
192
235
|
the exact source diagnostic and bounded results; do not assume every subsequent
|
|
193
236
|
missing preview means its runtime API is invalid.
|
|
194
237
|
|
|
195
|
-
##
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
Ownership does not establish a project's visual scale:
|
|
209
|
-
|
|
210
|
-
- A component redefining shared `--space-4` fails.
|
|
211
|
-
- Its private `--plot-gap: 7px` can be valid component geometry.
|
|
212
|
-
- `--plot-gap: var(--space-4)` preserves a shared scale with local meaning.
|
|
213
|
-
|
|
214
|
-
Choose project policy explicitly. A registered project check can use tooling-only
|
|
215
|
-
`inspectTokens(root)` and `inspectTokenOrigins(inventory, name, { stopAt: names })`
|
|
216
|
-
from `@reqvire-org/ads`. `aliasOnly` verifies every theme definition follows only
|
|
217
|
-
aliases to the explicitly selected origins; `literals` and `diagnostics` explain
|
|
218
|
-
violations/limits. Select the exact targets and permitted shared origins. Keep
|
|
219
|
-
intentional geometry exceptions exact with documented reasons. ADS neither
|
|
220
|
-
infers spacing meaning from names nor prescribes a global spacing palette.
|
|
238
|
+
## Shared Data and project consistency
|
|
239
|
+
|
|
240
|
+
Data has one shared design vocabulary in the configured token foundation. There
|
|
241
|
+
is no owner-contract token namespace or private value stylesheet. Components map
|
|
242
|
+
shared values into `--ds-*`; patterns use `--ux-*`. Static literals cannot bypass
|
|
243
|
+
this boundary through aliases, fallbacks, themes or helper/import interpolation.
|
|
244
|
+
Shared token samples belong under the token directory. See
|
|
245
|
+
[shared Data and component mappings](ADS.md#shared-data-and-component-mappings).
|
|
246
|
+
|
|
247
|
+
`inspectTokenOrigins(inventory, name, {stopAt: names})` remains available for
|
|
248
|
+
project-specific audits of shared alias relationships. It supplements mandatory
|
|
249
|
+
core source checks and does not enable independent local values.
|
|
221
250
|
|
|
222
251
|
## Migration and MCP editing
|
|
223
252
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
normalize into the same discovery, ownership, source revisions, affected-check
|
|
253
|
+
Use the static owner contract for new registrations. Competing declarations fail.
|
|
254
|
+
Contracts participate in discovery, ownership, source revisions, affected-check
|
|
227
255
|
selection and candidate gates. `ads_units` exposes `contractFile`; `ads_catalog`
|
|
228
256
|
reports constrained paint paths and declarative parent/consumer/check references.
|
|
229
257
|
Use bounded file reads and paged detailed results, not repeated whole-project dumps.
|
package/docs/GUIDE.md
CHANGED
|
@@ -33,6 +33,12 @@ An agent uses the MCP tools to inspect, edit and review the project:
|
|
|
33
33
|
checks. Recheck `ads_status.build` after changes; notifications alone do not
|
|
34
34
|
establish current output.
|
|
35
35
|
|
|
36
|
+
After targeted diagnosis, record a suspected ADS defect with `ads_report_bug`, or
|
|
37
|
+
a missing capability with `ads_request_feature`. Supply a minimal reproduction or
|
|
38
|
+
workflow and reference exact execution/check evidence when available. Reports stay
|
|
39
|
+
local, are untriaged, and do not bypass guards. Read `ads://guides/reporting` or the
|
|
40
|
+
[portable reporting guide](../skills/ads-designer/references/reporting.md).
|
|
41
|
+
|
|
36
42
|
For an on-demand screenshot, call `ads_capture` with a discovered scenario ID and
|
|
37
43
|
optionally a named `captureTargets` element, theme and viewport. To compare a
|
|
38
44
|
proposed change before applying it, add `screenshot:true` and an explicit
|
|
@@ -83,7 +89,7 @@ Keep private controllers with their consumer; share reusable behavior through
|
|
|
83
89
|
project dependencies. Controllers own lifecycle/measurements while components and
|
|
84
90
|
patterns own presentation. A shared context provider is a behavioral API too.
|
|
85
91
|
|
|
86
|
-
Optional
|
|
92
|
+
Optional `<Owner>.ads.contract.ts` registers guarantees and maintained checks using actual implementation references.
|
|
87
93
|
Scenario `exercises` records demonstrations separately from rendered `covers`.
|
|
88
94
|
Use `ads behaviors --json` for discovery and `ads verify --unit <discovered-id>`
|
|
89
95
|
to run registered cases; MCP exposes `ads_behaviors` and `ads_verify`. Tests and
|
|
@@ -414,10 +420,10 @@ categories, undefined aliases, alias cycles, and individual theme/media
|
|
|
414
420
|
overrides. Project-specific values and additional definitions within ADS's fixed
|
|
415
421
|
naming contract are allowed. The contract's `naming` section lists the fixed
|
|
416
422
|
shared families and names; projects cannot rename those shared semantics.
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
See [
|
|
420
|
-
remain rejected.
|
|
423
|
+
All design values belong in the shared foundation. Components and patterns map
|
|
424
|
+
shared roles into their runtime variables instead of defining independent values.
|
|
425
|
+
See [shared Data and component mappings](ADS.md#shared-data-and-component-mappings).
|
|
426
|
+
Foreign token namespaces remain rejected.
|
|
421
427
|
`--ds-*`, `--ux-*`, and `--showcase-*` variables remain owned by their layers,
|
|
422
428
|
including when a file is inside `tokens/`. Shared token assignments outside
|
|
423
429
|
`tokens/` fail. Source styles also check shared references for undeclared names.
|
|
@@ -482,14 +488,14 @@ changes may require restarting the runtime; ordinary owner/fixture/style/asset e
|
|
|
482
488
|
See [the compiler contract](MCP.md#configure-the-project-compiler) for revisions,
|
|
483
489
|
diagnostics, invalidation and the shared resource graph.
|
|
484
490
|
|
|
485
|
-
Colocate
|
|
486
|
-
|
|
491
|
+
Colocate `<Owner>.ads.scenario.tsx` and `<Owner>.ads.fixture.ts` beside tokens and
|
|
492
|
+
each component/pattern. Larger entries
|
|
487
493
|
live under `composition/<Name>/`. A default zero-input mountable view imports the
|
|
488
494
|
real public UI and a local fixture, and exports literal metadata:
|
|
489
495
|
|
|
490
496
|
```tsx
|
|
491
497
|
import { Button } from "@ds";
|
|
492
|
-
import { fixture } from "./fixture";
|
|
498
|
+
import { fixture } from "./Button.ads.fixture";
|
|
493
499
|
export const scenario = { title: "Button states", covers: ["Button"] };
|
|
494
500
|
export default function Scenario() { return <Button>{fixture.label}</Button>; }
|
|
495
501
|
```
|
|
@@ -497,11 +503,11 @@ export default function Scenario() { return <Button>{fixture.label}</Button>; }
|
|
|
497
503
|
IDs derive from filenames; do not maintain another registry or hand-assigned IDs.
|
|
498
504
|
Token scenarios live beside foundation CSS under the configured token directory.
|
|
499
505
|
The starter includes `tokens/Foundation.ads.scenario.tsx` and its local fixture for
|
|
500
|
-
a project-owned token review renderer. Keep its presentation in
|
|
506
|
+
a project-owned token review renderer. Keep its presentation in development-only `review/`:
|
|
501
507
|
|
|
502
508
|
```tsx
|
|
503
509
|
import { TokenSamples } from "@ds/review";
|
|
504
|
-
import { fixture } from "./Typography.fixture";
|
|
510
|
+
import { fixture } from "./Typography.ads.fixture";
|
|
505
511
|
export const scenario = { title: fixture.title, covers: ["TokenSamples"], samples: fixture.samples };
|
|
506
512
|
export default function Scenario() { return <TokenSamples {...fixture} />; }
|
|
507
513
|
```
|
|
@@ -552,8 +558,7 @@ in owned component/pattern styles, with tokens supplying visual values.
|
|
|
552
558
|
ADS has fixed token names and ownership namespaces. Change values in the existing
|
|
553
559
|
token files; `--accent`, `--font-sans`, `--radius-md`, and the other shared roles
|
|
554
560
|
keep their meanings across projects. Foreign shared prefixes such as `--nuv-*` or
|
|
555
|
-
`--brand-*` fail
|
|
556
|
-
the shared branding vocabulary. Components own `--ds-*`, patterns own `--ux-*`, and the showcase
|
|
561
|
+
`--brand-*` fail. There are no independent owner-local token namespaces. Components own `--ds-*`, patterns own `--ux-*`, and the showcase
|
|
557
562
|
reserves `--showcase-*` for showcase boundaries. Fixture files still define no
|
|
558
563
|
custom styling; the frame pattern uses `--ux-*`. Branding never assigns
|
|
559
564
|
component state variables.
|
|
@@ -787,9 +792,12 @@ Retain unrelated lint, type checking, and framework build commands.
|
|
|
787
792
|
## External content
|
|
788
793
|
|
|
789
794
|
Use the repository's `ads-import` skill for selected external ADS source or theme
|
|
790
|
-
values, and `ads-
|
|
795
|
+
values, and `ads-port` for a native implementation inspired by an upstream
|
|
791
796
|
library. These agent workflows handle dependency closure, token mapping, motion
|
|
792
797
|
comparisons, source credits, applicable notices, and local documentation.
|
|
798
|
+
Ports reuse the project's visual language and consolidate equivalent design roles
|
|
799
|
+
introduced by upstream dependencies. Verify required behavior and project
|
|
800
|
+
consistency; exact visual replication is an explicit requirement, not the default.
|
|
793
801
|
They are agent workflows, rather than CLI import/design subcommands. Install
|
|
794
802
|
them through `npx skills`, or read the packaged skills through the
|
|
795
803
|
[stdio MCP server](MCP.md#skills). MCP serving does not install or automatically
|
package/docs/MCP.md
CHANGED
|
@@ -21,8 +21,8 @@ The agent keeps its stdio connection; the browser connects to `/mcp` on the same
|
|
|
21
21
|
runtime using HTTP and the current modern protocol. Both share the configured
|
|
22
22
|
preview watcher and artifacts. Stdout remains exclusively JSON-RPC.
|
|
23
23
|
|
|
24
|
-
Every registered preview uses `?scenario=<discovered-id>`, including token
|
|
25
|
-
previews
|
|
24
|
+
Every registered preview uses `?scenario=<discovered-id>`, including shared token
|
|
25
|
+
previews under the configured token directory. The client selects its section
|
|
26
26
|
from the scenario's discovered `kind`, never from the ID's path prefix. Existing
|
|
27
27
|
`?category=<id>` links remain accepted and normalize to `?scenario=`; an explicit
|
|
28
28
|
`scenario` parameter takes precedence when both are present. `ads_show_tokens`
|
|
@@ -160,6 +160,11 @@ protocol. The diagnostic explorer defaults to compatible mode; select
|
|
|
160
160
|
|
|
161
161
|
## Tools and resources
|
|
162
162
|
|
|
163
|
+
For suspected ADS defects after targeted investigation, use `ads_report_bug`;
|
|
164
|
+
for missing capabilities, use `ads_request_feature`. They collect project-local
|
|
165
|
+
untriaged reports with compact context/evidence and no upstream posting. See
|
|
166
|
+
[bug reports and feature requests](#bug-reports-and-feature-requests).
|
|
167
|
+
|
|
163
168
|
### Inspect the design system
|
|
164
169
|
|
|
165
170
|
Call `ads_status` to identify the connected project and preview build state.
|
|
@@ -375,8 +380,9 @@ composition owns its scenario and mock inputs. Imported components and patterns
|
|
|
375
380
|
remain separate owners. `tokens` is one foundation unit covering token definitions,
|
|
376
381
|
themes and token scenarios/fixtures, whose coverage spans shared source files.
|
|
377
382
|
Preview IDs remain separate: several token previews belong to `tokens`.
|
|
378
|
-
|
|
379
|
-
|
|
383
|
+
Design tokens and token previews belong to the shared Data foundation. Component
|
|
384
|
+
contracts do not register token namespaces or independent value sheets. Read
|
|
385
|
+
`ads://guides/tokens` for state mappings, source checks and overlap advisories.
|
|
380
386
|
|
|
381
387
|
The `tokens` manifest also returns `companionFiles` with the configured foundation
|
|
382
388
|
entry path. When creating or deleting a canonical token foundation file, include
|
|
@@ -724,10 +730,9 @@ framework compilation and Linaria extraction. The starter's
|
|
|
724
730
|
- Its `buildGraph(entries, options, track)` adapter runs one multi-entry Vite build
|
|
725
731
|
with `previewEntriesPlugin()` and `createPreviewResources()` from
|
|
726
732
|
`@reqvire-org/ads/scenarios/vite`.
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
must preserve these dependencies without importing unrelated owners.
|
|
733
|
+
Each mount imports the project's shared foundation entry. Keep that import in
|
|
734
|
+
the preview module graph so independently built token scenarios receive the
|
|
735
|
+
same shared Data as production UI.
|
|
731
736
|
- Keep `preserveEntrySignatures: "strict"`, `cssCodeSplit: true`,
|
|
732
737
|
`assetsInlineLimit: 0`, `modulePreload: false`, and `write: false`. Include the
|
|
733
738
|
supplied dependency-tracking plugin and the project's Linaria/framework plugins.
|
|
@@ -981,7 +986,7 @@ See the [MCP Apps specification](https://github.com/modelcontextprotocol/ext-app
|
|
|
981
986
|
| Each of the five ADS skill names | `request` | Select that workflow and its skill resource |
|
|
982
987
|
|
|
983
988
|
Example: get `ads-inspect` with `element="Button states in both themes"`, or
|
|
984
|
-
`ads-
|
|
989
|
+
`ads-port` with `request` containing the upstream component-library URL.
|
|
985
990
|
Prompts explain Data/UX/Skin ownership, public API reuse, fixture boundaries,
|
|
986
991
|
which tools select widgets, progressive skill reads and validation. They guide
|
|
987
992
|
reasoning rather than inventing another component implementation.
|
|
@@ -1077,7 +1082,9 @@ Tool updates do not overwrite existing project-owned scenarios or renderers.
|
|
|
1077
1082
|
|
|
1078
1083
|
`ads_units` includes `contractFile` for a single `<Owner>.ads.contract.ts`.
|
|
1079
1084
|
`ads_catalog` identifies declarative APIs and their parent/consumer/check links,
|
|
1080
|
-
and registered constrained paint-input paths.
|
|
1085
|
+
and registered constrained paint-input paths. Declarative summaries include
|
|
1086
|
+
`consumerCount` and up to four `consumers`, with their rendering roots; read the
|
|
1087
|
+
contract source for additional relationships. Read the relevant source range;
|
|
1081
1088
|
these summaries establish registration, not completed verification. Detailed
|
|
1082
1089
|
results remain bounded and paged.
|
|
1083
1090
|
|
|
@@ -1091,6 +1098,55 @@ The same guide is available at `ads://guides/contracts`.
|
|
|
1091
1098
|
A registered binding producer may combine two accessible color references as
|
|
1092
1099
|
`light-dark(var(--light-token), var(--dark-token))`. The App paint audit checks
|
|
1093
1100
|
both branches and their observed effect in the active color scheme. Raw colors,
|
|
1094
|
-
|
|
1101
|
+
undefined tokens and SVG URLs inside this color function remain invalid.
|
|
1095
1102
|
This derived binding form does not widen public paint-input types; use constrained
|
|
1096
1103
|
references for each theme input and verify both color schemes in browser checks.
|
|
1104
|
+
|
|
1105
|
+
Binding `valueFrom` accepts one path or an explicit array of registered entry
|
|
1106
|
+
paths for alternative/theme paints. Parts can have multiple distinct parents and
|
|
1107
|
+
registered nested parents, anchored at rendering roots. `exercises` records
|
|
1108
|
+
reachable use; registered browser checks establish the effects. Private visual
|
|
1109
|
+
behavior subjects use explicit `role: "implementation"`; headless defaults and
|
|
1110
|
+
shared-controller gates remain enabled. See [CONTRACTS.md](CONTRACTS.md).
|
|
1111
|
+
|
|
1112
|
+
## Bug reports and feature requests
|
|
1113
|
+
|
|
1114
|
+
`ads_report_bug` records suspected broken existing ADS behavior after targeted
|
|
1115
|
+
investigation. Required fields are `title`, `expected`, `observed`, `steps` and
|
|
1116
|
+
`frequency` (`always`, `intermittent`, `once`, `unknown`); `suspectedCause` is optional.
|
|
1117
|
+
`ads_request_feature` records a legitimate workflow requiring a missing capability:
|
|
1118
|
+
`title`, `workflow`, `capability` and `impact` are required; `proposal` is optional.
|
|
1119
|
+
Both accept optional `unit`, `scenario`, agent-supplied `reporter`, and up to three
|
|
1120
|
+
`evidence` selectors: `{resultId}` or the exact `{unit, check, runId}`.
|
|
1121
|
+
|
|
1122
|
+
The server verifies evidence references and snapshots compact completion-time
|
|
1123
|
+
metadata before the underlying execution/check slot can be replaced. Superseded
|
|
1124
|
+
references fail explicitly. Current-project context separately captures ADS
|
|
1125
|
+
version, configured framework, Node/platform, source/configuration revisions,
|
|
1126
|
+
available build metadata and capture time. Missing metadata stays unobserved;
|
|
1127
|
+
context and candidate evidence do not become current passing source evidence.
|
|
1128
|
+
No source files, full logs, screenshots or trace bytes are automatically attached.
|
|
1129
|
+
|
|
1130
|
+
The tools save ordinary JSON at `<projectRoot>/.ds/reports/<reportId>.json`.
|
|
1131
|
+
They are available without `--mutations`, like other development-evidence tools,
|
|
1132
|
+
and write generated metadata rather than project-owned ADS source. Tool annotations
|
|
1133
|
+
mark them as writes. Each saved record is limited to 32 KiB. Neither tool posts to
|
|
1134
|
+
GitHub, sends telemetry nor changes validation policy. Reports remain `untriaged`;
|
|
1135
|
+
`classification: "agent-supplied"` distinguishes a claim from an established cause.
|
|
1136
|
+
|
|
1137
|
+
Equivalent submissions for the same ADS version/framework reuse the report ID,
|
|
1138
|
+
keep its creation time, increment `submissionCount` and replace its latest
|
|
1139
|
+
submission/context/evidence. This is a submission count, not independent
|
|
1140
|
+
reproductions. There is no automatic age/count pruning; report retention differs
|
|
1141
|
+
from replaceable execution evidence and screenshot slots. Archive or removal is
|
|
1142
|
+
an explicit maintenance action.
|
|
1143
|
+
|
|
1144
|
+
Each submission returns a compact receipt (at most 4096 JSON bytes) with
|
|
1145
|
+
`reportId`, `revision`, `storagePath`, `submissionCount` and deduplication status.
|
|
1146
|
+
The local path is relative to the connected project root. MCP intake is
|
|
1147
|
+
submission-only: saved reports have no listing/read tool, resource, URI template,
|
|
1148
|
+
subscription or notification. Inspect or share local JSON through normal project
|
|
1149
|
+
maintenance when needed. `ads_status.reports` identifies the two intake tools,
|
|
1150
|
+
storage directory and `ads://guides/reporting`, without listing report contents.
|
|
1151
|
+
All five skills include the same portable
|
|
1152
|
+
[reporting reference](../skills/ads-designer/references/reporting.md).
|
package/package.json
CHANGED
package/dist/scoped-tokens.mjs
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import postcss from "postcss";
|
|
4
|
-
import ts from "typescript";
|
|
5
|
-
import { inspectUnits } from "./units.mjs";
|
|
6
|
-
import { isDevelopmentFile } from "./config.mjs";
|
|
7
|
-
import { foundationSelector } from "./foundation.mjs";
|
|
8
|
-
import { isSharedToken, tokenContract } from "./token-policy.mjs";
|
|
9
|
-
import { propertyRegistration } from "./property-registrations.mjs";
|
|
10
|
-
import { inspectUnitContracts } from "./unit-contracts.mjs";
|
|
11
|
-
|
|
12
|
-
/** An explicit owner contract, never a heuristic based on a token's name. */
|
|
13
|
-
export function scopedTokens(options) {
|
|
14
|
-
if (options.scopedTokens) return options.scopedTokens;
|
|
15
|
-
const inventory = inspectUnits(options), definitions = [], declarations = inspectUnitContracts(options), diagnostics = [...declarations.diagnostics];
|
|
16
|
-
const report = (file, message, line = 1) => diagnostics.push({rule:"scoped-token", file, message, line, column:1});
|
|
17
|
-
for (const unit of inventory.units.filter(unit => ["components", "patterns"].includes(unit.kind))) {
|
|
18
|
-
const inputs = [
|
|
19
|
-
...unit.files.filter(file => /(?:^|\/)tokens\.json$|\.tokens\.json$/.test(file)).map(manifest => ({manifest})),
|
|
20
|
-
...declarations.contracts.filter(entry => entry.unit === unit.id && entry.tokens).map(entry => ({manifest:entry.file, contract:entry.tokens})),
|
|
21
|
-
];
|
|
22
|
-
for (const {manifest, contract} of inputs) {
|
|
23
|
-
const absolute = path.join(options.root, manifest);
|
|
24
|
-
try {
|
|
25
|
-
if (statSync(absolute).size > 65536 || realpathSync(absolute) !== absolute) throw new Error("Token manifests must be ordinary files no larger than 64 KiB.");
|
|
26
|
-
const data = contract ? {schemaVersion:1, namespace:contract.namespace} : JSON.parse(readFileSync(absolute, "utf8"));
|
|
27
|
-
const stylesheet = contract ? contract.file : manifest.replace(/\.json$/, ".css");
|
|
28
|
-
if (!data || data.schemaVersion !== 1 || Object.keys(data).some(key => !["schemaVersion", "namespace"].includes(key))
|
|
29
|
-
|| typeof data.namespace !== "string" || !/^--[a-z][a-z0-9-]*-$/.test(data.namespace)
|
|
30
|
-
|| /^(?:--ds-|--ux-|--showcase-)/.test(data.namespace) || isSharedToken(data.namespace + "value")
|
|
31
|
-
|| tokenContract.naming.prefixes.some(prefix => prefix.startsWith(data.namespace))
|
|
32
|
-
|| [...tokenContract.naming.names,...Object.keys(tokenContract.tokens)].some(name => name.startsWith(data.namespace))) throw new Error("Use {schemaVersion:1, namespace:\"--<owner>-\"}; shared and runtime-variable prefixes are reserved.");
|
|
33
|
-
if (definitions.some(entry => entry.unit === unit.id || entry.namespace.startsWith(data.namespace) || data.namespace.startsWith(entry.namespace))) throw new Error("Each unit has one token namespace; namespaces must not overlap other owners.");
|
|
34
|
-
if (!unit.files.includes(stylesheet) || !existsSync(path.join(options.root, stylesheet))) throw new Error(`Colocate the definition-only stylesheet ${stylesheet}.`);
|
|
35
|
-
const file = path.join(options.root, stylesheet);
|
|
36
|
-
if (realpathSync(file) !== file) throw new Error("Scoped token stylesheets cannot resolve through symlinks.");
|
|
37
|
-
const css = postcss.parse(readFileSync(file, "utf8"), {from:file});
|
|
38
|
-
let count = 0;
|
|
39
|
-
css.walkAtRules(/^property$/i,rule=>{
|
|
40
|
-
try {const {name}=propertyRegistration(rule);let defined=false;css.walkDecls(name,()=>{defined=true;});if(!name.startsWith(data.namespace)||!defined)throw new Error("Register only a real token defined in this owner's namespace and sheet.");}
|
|
41
|
-
catch(error){report(stylesheet,error.message,rule.source?.start.line);}
|
|
42
|
-
});
|
|
43
|
-
css.walk(node => {
|
|
44
|
-
if (node.type === "comment" || node.type === "root") return;
|
|
45
|
-
if(node.type==="atrule"&&node.name.toLowerCase()==="property"||node.type==="decl"&&node.parent.type==="atrule"&&node.parent.name.toLowerCase()==="property")return; // Separately validated registration metadata.
|
|
46
|
-
if (node.type === "atrule" && ["media", "supports", "layer"].includes(node.name) && node.nodes) return;
|
|
47
|
-
if (node.type === "rule" && node.parent.type !== "rule" && !foundationSelector(node.selector, {definitions:true})) return;
|
|
48
|
-
if (node.type === "decl" && node.parent.type === "rule" && node.prop.startsWith(data.namespace) && node.prop.length > data.namespace.length && !node.important) { count++; return; }
|
|
49
|
-
report(stylesheet, "Owner token sheets contain only namespaced custom-property definitions under root/theme conditions. UI selectors, imports, font faces, animations and ordinary declarations belong in their runtime owners.", node.source?.start.line);
|
|
50
|
-
});
|
|
51
|
-
if (!count) report(stylesheet, "Define at least one real namespaced token.");
|
|
52
|
-
const imported = unit.files.filter(file => /\.[cm]?[jt]sx?$/.test(file) && !isDevelopmentFile(path.join(options.root, file), options)).some(source => {
|
|
53
|
-
const ast = ts.createSourceFile(source, readFileSync(path.join(options.root, source), "utf8"), ts.ScriptTarget.Latest, true);
|
|
54
|
-
return ast.statements.some(node => ts.isImportDeclaration(node) && !node.importClause && ts.isStringLiteralLike(node.moduleSpecifier) && path.resolve(options.root, path.dirname(source), node.moduleSpecifier.text) === file);
|
|
55
|
-
});
|
|
56
|
-
if (!imported) report(manifest, `Import ./${path.basename(stylesheet)} from this owner's runtime source so its real preview and product consume the same definitions.`);
|
|
57
|
-
definitions.push({unit:unit.id, namespace:data.namespace, manifest, file:stylesheet});
|
|
58
|
-
} catch (error) { report(manifest, error.reason ?? error.message, error.line); }
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
const result = {definitions, diagnostics, inventory};
|
|
62
|
-
options.scopedTokens = result;
|
|
63
|
-
return result;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export function scopedTokenOwner(options, name) {
|
|
67
|
-
return scopedTokens(options).definitions.find(entry => name.startsWith(entry.namespace));
|
|
68
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|