@reqvire-org/ads 0.3.41 → 0.3.43
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 -4
- package/dist/bootstrap-ds/ADS.md +2 -1
- package/dist/bootstrap-ds/README.md +23 -14
- package/dist/bootstrap-ds/design-system/components/Actions/Button/Button.ads.fixture.ts +1 -0
- package/dist/bootstrap-ds/design-system/components/Actions/Button/Button.ads.scenario.tsx +13 -0
- package/dist/bootstrap-ds/design-system/components/Actions/Button/Button.tsx +49 -0
- package/dist/bootstrap-ds/design-system/components/Actions/Button/README.md +12 -0
- package/dist/bootstrap-ds/design-system/components/Forms/TextField/README.md +14 -0
- package/dist/bootstrap-ds/design-system/components/Forms/TextField/TextField.ads.fixture.ts +6 -0
- package/dist/bootstrap-ds/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +13 -0
- package/dist/bootstrap-ds/design-system/components/Forms/TextField/TextField.tsx +57 -0
- package/dist/bootstrap-ds/design-system/composition/Search/SearchPage/README.md +4 -0
- package/dist/bootstrap-ds/design-system/composition/Search/SearchPage/SearchPage.ads.fixture.ts +7 -0
- package/dist/bootstrap-ds/design-system/composition/Search/SearchPage/SearchPage.ads.scenario.tsx +16 -0
- package/dist/bootstrap-ds/design-system/index.ts +4 -1
- package/dist/bootstrap-ds/design-system/patterns/Search/SearchBar/README.md +12 -0
- package/dist/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.ads.fixture.ts +1 -0
- package/dist/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.ads.scenario.tsx +11 -0
- package/dist/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.tsx +41 -0
- package/dist/bootstrap-ds/design-system/review/demo-frame/DemoFrame.tsx +29 -0
- package/dist/bootstrap-ds/design-system/review/index.ts +2 -0
- package/dist/bootstrap-ds/design-system/review/screen-frame/ScreenFrame.tsx +34 -0
- package/dist/bootstrap-ds/design-system/review/token-preview/TokenPreview.tsx +107 -19
- package/dist/bootstrap-ds/design-system/tokens/Color.ads.fixture.ts +18 -0
- package/dist/bootstrap-ds/design-system/tokens/{Foundation.ads.scenario.tsx → Color.ads.scenario.tsx} +1 -1
- package/dist/{skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Foundation.ads.fixture.ts → bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.fixture.ts} +1 -13
- package/dist/bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.scenario.tsx +4 -0
- package/dist/bootstrap-ds-preact/design-system/review/demo-frame/DemoFrame.tsx +29 -0
- package/dist/bootstrap-ds-preact/design-system/review/screen-frame/ScreenFrame.tsx +34 -0
- package/dist/bootstrap-ds-preact/design-system/review/token-preview/TokenPreview.tsx +119 -0
- package/dist/bootstrap-ds-preact/design-system/showcase/mcp/main.tsx +6 -0
- package/dist/bootstrap-ds-preact/ds.config.json +19 -0
- package/dist/bootstrap-ds-preact/package.json +38 -0
- package/dist/bootstrap-ds-preact/src/vite-env.d.ts +7 -0
- package/dist/bootstrap-ds-preact/tsconfig.json +36 -0
- package/dist/bootstrap-ds-preact/vite.config.ts +23 -0
- package/dist/bun-compiler.mjs +8 -4
- package/dist/cli.mjs +7 -4
- package/dist/init.mjs +15 -7
- package/dist/mcp/execution-results.mjs +1 -0
- package/dist/mcp/mutations.mjs +1 -1
- package/dist/mcp/server.mjs +10 -8
- package/dist/mcp/showcase-host.mjs +5 -1
- package/dist/preview-builder.mjs +8 -2
- package/dist/scenarios-compiler.mjs +28 -1
- package/dist/skills/ads-break-ui/SKILL.md +2 -2
- package/dist/skills/ads-break-ui/references/validation.md +13 -0
- package/dist/skills/ads-designer/SKILL.md +33 -19
- package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +2 -1
- package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +23 -14
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/Button.ads.fixture.ts +1 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/Button.ads.scenario.tsx +13 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/Button.tsx +49 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/README.md +12 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/README.md +14 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/TextField.ads.fixture.ts +6 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +13 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/TextField.tsx +57 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/Search/SearchPage/README.md +4 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/Search/SearchPage/SearchPage.ads.fixture.ts +7 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/Search/SearchPage/SearchPage.ads.scenario.tsx +16 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/index.ts +4 -1
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/README.md +12 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.ads.fixture.ts +1 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.ads.scenario.tsx +11 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.tsx +41 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/demo-frame/DemoFrame.tsx +29 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/index.ts +2 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/screen-frame/ScreenFrame.tsx +34 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/token-preview/TokenPreview.tsx +107 -19
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Color.ads.fixture.ts +18 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/{Foundation.ads.scenario.tsx → Color.ads.scenario.tsx} +1 -1
- package/dist/{bootstrap-ds/design-system/tokens/Foundation.ads.fixture.ts → skills/ads-designer/assets/bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.fixture.ts} +1 -13
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.scenario.tsx +4 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/review/demo-frame/DemoFrame.tsx +29 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/review/screen-frame/ScreenFrame.tsx +34 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/review/token-preview/TokenPreview.tsx +119 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/showcase/mcp/main.tsx +6 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/ds.config.json +19 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/package.json +38 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/src/vite-env.d.ts +7 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/tsconfig.json +36 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/vite.config.ts +23 -0
- package/dist/skills/ads-designer/references/cli.md +7 -2
- package/dist/skills/ads-designer/references/design-craft.md +1 -1
- package/dist/skills/ads-designer/references/validation.md +13 -0
- package/dist/skills/ads-import/SKILL.md +2 -2
- package/dist/skills/ads-import/references/cli.md +7 -2
- package/dist/skills/ads-import/references/validation.md +13 -0
- package/dist/skills/ads-motion/SKILL.md +2 -2
- package/dist/skills/ads-motion/references/validation.md +13 -0
- package/dist/skills/ads-port/SKILL.md +3 -3
- package/dist/skills/ads-port/references/cli.md +7 -2
- package/dist/skills/ads-port/references/validation.md +13 -0
- package/dist/task-cache.mjs +122 -0
- package/dist/task-worker.mjs +19 -0
- package/dist/validation-checks.mjs +7 -9
- package/dist/validation.mjs +3 -3
- package/docs/ADS.md +7 -7
- package/docs/ARCHITECTURE.md +12 -2
- package/docs/CACHING.md +99 -0
- package/docs/CHANGELOG.md +46 -12
- package/docs/GUIDE.md +16 -14
- package/docs/benchmarks/turbo-poc.md +266 -0
- package/package.json +4 -3
- package/dist/bootstrap-ds/design-system/components/.gitkeep +0 -0
- package/dist/bootstrap-ds/design-system/composition/.gitkeep +0 -0
- package/dist/bootstrap-ds/design-system/patterns/.gitkeep +0 -0
- package/dist/check-runner.mjs +0 -7
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/.gitkeep +0 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/.gitkeep +0 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/.gitkeep +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TokenPreview } from "@ds/review";
|
|
2
|
-
import { fixture } from "./
|
|
2
|
+
import { fixture } from "./Color.ads.fixture";
|
|
3
3
|
export const scenario = { title: fixture.title, covers: ["TokenPreview"], samples: fixture.samples };
|
|
4
4
|
export default function Scenario() { return <TokenPreview {...fixture} />; }
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
export const fixture = {
|
|
2
|
-
"title": "
|
|
2
|
+
"title": "Space, type & motion",
|
|
3
3
|
"text": "Aa",
|
|
4
4
|
samples: [
|
|
5
|
-
{"token": "--accent", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
6
|
-
{"token": "--accent-fg", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
7
|
-
{"token": "--accent-hover", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
8
|
-
{"token": "--bg-canvas", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
9
|
-
{"token": "--bg-hover", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
10
|
-
{"token": "--bg-surface", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
11
|
-
{"token": "--border-default", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
12
|
-
{"token": "--border-focus", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
13
5
|
{"token": "--border-w", "property": "width", "probe": "13.375px"},
|
|
14
6
|
{"token": "--dur-fast", "property": "animation-duration", "probe": "0.375s"},
|
|
15
7
|
{"token": "--dur-normal", "property": "animation-duration", "probe": "0.375s"},
|
|
@@ -33,12 +25,8 @@ export const fixture = {
|
|
|
33
25
|
{"token": "--space-6", "property": "width", "probe": "13.375px"},
|
|
34
26
|
{"token": "--space-8", "property": "width", "probe": "13.375px"},
|
|
35
27
|
{"token": "--text-base", "property": "font-size", "probe": "41.375px"},
|
|
36
|
-
{"token": "--text-body", "property": "color", "probe": "rgb(31, 97, 163)"},
|
|
37
|
-
{"token": "--text-inverse", "property": "color", "probe": "rgb(31, 97, 163)"},
|
|
38
28
|
{"token": "--text-lg", "property": "font-size", "probe": "41.375px"},
|
|
39
|
-
{"token": "--text-muted", "property": "color", "probe": "rgb(31, 97, 163)"},
|
|
40
29
|
{"token": "--text-sm", "property": "font-size", "probe": "41.375px"},
|
|
41
|
-
{"token": "--text-strong", "property": "color", "probe": "rgb(31, 97, 163)"},
|
|
42
30
|
{"token": "--text-xl", "property": "font-size", "probe": "41.375px"},
|
|
43
31
|
{"token": "--weight-medium", "property": "font-weight", "probe": "327"},
|
|
44
32
|
{"token": "--weight-normal", "property": "font-weight", "probe": "327"},
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TokenPreview } from "@ds/review";
|
|
2
|
+
import { fixture } from "./SpaceTypeMotion.ads.fixture";
|
|
3
|
+
export const scenario = { title: fixture.title, covers: ["TokenPreview"], samples: fixture.samples };
|
|
4
|
+
export default function Scenario() { return <TokenPreview {...fixture} />; }
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ComponentChildren } from "preact";
|
|
2
|
+
import { css, cx } from "@linaria/atomic";
|
|
3
|
+
|
|
4
|
+
export interface DemoFrameProps {
|
|
5
|
+
/** `row` lays examples side by side; `column` stacks them at a readable width. */
|
|
6
|
+
layout?: "row" | "column";
|
|
7
|
+
children?: ComponentChildren;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const frame = css`
|
|
11
|
+
display: flex;
|
|
12
|
+
gap: var(--space-8);
|
|
13
|
+
padding: var(--space-12);
|
|
14
|
+
`;
|
|
15
|
+
const layouts = {
|
|
16
|
+
row: css`
|
|
17
|
+
flex-wrap: wrap;
|
|
18
|
+
align-items: flex-start;
|
|
19
|
+
`,
|
|
20
|
+
column: css`
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
max-width: calc(var(--space-16) * 12);
|
|
23
|
+
`,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** Development-only framing for component and pattern scenarios: spacing between examples. */
|
|
27
|
+
export function DemoFrame({ layout = "row", children }: DemoFrameProps) {
|
|
28
|
+
return <div className={cx(frame, layouts[layout])}>{children}</div>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ComponentChildren } from "preact";
|
|
2
|
+
import { css } from "@linaria/atomic";
|
|
3
|
+
|
|
4
|
+
export interface ScreenFrameProps { title: string; description?: string; children?: ComponentChildren; }
|
|
5
|
+
|
|
6
|
+
const frame = css`
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: var(--space-8);
|
|
10
|
+
max-width: calc(var(--space-16) * 20);
|
|
11
|
+
padding: var(--space-12);
|
|
12
|
+
`;
|
|
13
|
+
const heading = css`
|
|
14
|
+
margin: 0;
|
|
15
|
+
font-size: var(--text-xl);
|
|
16
|
+
font-weight: var(--weight-semibold);
|
|
17
|
+
line-height: var(--leading-tight);
|
|
18
|
+
color: var(--text-strong);
|
|
19
|
+
`;
|
|
20
|
+
const lead = css`
|
|
21
|
+
margin: 0;
|
|
22
|
+
color: var(--text-muted);
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
/** Development-only page framing for composition scenarios: a heading and the page width. */
|
|
26
|
+
export function ScreenFrame({ title, description, children }: ScreenFrameProps) {
|
|
27
|
+
return (
|
|
28
|
+
<main className={frame}>
|
|
29
|
+
<h1 className={heading}>{title}</h1>
|
|
30
|
+
{description ? <p className={lead}>{description}</p> : null}
|
|
31
|
+
{children}
|
|
32
|
+
</main>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { useLayoutEffect, useRef, useState } from "preact/hooks";
|
|
2
|
+
import { css, cx } from "@linaria/atomic";
|
|
3
|
+
|
|
4
|
+
export interface TokenSample { token: `--${string}`; property: string; }
|
|
5
|
+
export interface TokenPreviewProps { title: string; samples: readonly TokenSample[]; text: string; }
|
|
6
|
+
|
|
7
|
+
const grid = css`
|
|
8
|
+
display: grid;
|
|
9
|
+
grid-template-columns: repeat(auto-fill, minmax(calc(var(--space-8) * 10), 1fr));
|
|
10
|
+
gap: var(--space-8);
|
|
11
|
+
padding: var(--space-8);
|
|
12
|
+
`;
|
|
13
|
+
const heading = css`
|
|
14
|
+
grid-column: 1 / -1;
|
|
15
|
+
margin: 0;
|
|
16
|
+
font-size: var(--text-base);
|
|
17
|
+
font-weight: var(--weight-semibold);
|
|
18
|
+
color: var(--text-body);
|
|
19
|
+
`;
|
|
20
|
+
const tile = css`
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
gap: var(--space-4);
|
|
24
|
+
padding: var(--space-8);
|
|
25
|
+
border: var(--border-w) solid var(--border-default);
|
|
26
|
+
border-radius: var(--radius-md);
|
|
27
|
+
background: var(--bg-surface);
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
`;
|
|
30
|
+
const label = css`
|
|
31
|
+
font-size: var(--text-sm);
|
|
32
|
+
color: var(--text-muted);
|
|
33
|
+
overflow-wrap: anywhere;
|
|
34
|
+
`;
|
|
35
|
+
// Each sample shows its token through the property it styles: colors as swatches, lengths as
|
|
36
|
+
// bars, radius as a shape, type as text.
|
|
37
|
+
const sampleStyle = css`
|
|
38
|
+
display: block;
|
|
39
|
+
min-height: calc(var(--space-8) * 2);
|
|
40
|
+
color: var(--text-body);
|
|
41
|
+
font-size: var(--text-base);
|
|
42
|
+
&[data-ads-property="background-color"] {
|
|
43
|
+
border: var(--border-w) solid var(--border-default);
|
|
44
|
+
border-radius: var(--radius-md);
|
|
45
|
+
background-color: var(--ux-token-preview-value);
|
|
46
|
+
}
|
|
47
|
+
&[data-ads-property="color"] { color: var(--ux-token-preview-value); font-size: calc(var(--text-base) * 2); line-height: 1; }
|
|
48
|
+
&[data-ads-property="width"] {
|
|
49
|
+
width: var(--ux-token-preview-value);
|
|
50
|
+
min-height: var(--space-8);
|
|
51
|
+
background: var(--accent);
|
|
52
|
+
}
|
|
53
|
+
&[data-ads-property="border-radius"] {
|
|
54
|
+
width: calc(var(--space-8) * 3);
|
|
55
|
+
border: var(--focus-w) solid var(--accent);
|
|
56
|
+
border-radius: var(--ux-token-preview-value);
|
|
57
|
+
}
|
|
58
|
+
&[data-ads-property="font-family"] { font-family: var(--ux-token-preview-value); font-size: calc(var(--text-base) * 2); line-height: 1; }
|
|
59
|
+
&[data-ads-property="font-size"] { font-size: var(--ux-token-preview-value); }
|
|
60
|
+
&[data-ads-property="font-weight"] { font-weight: var(--ux-token-preview-value); font-size: calc(var(--text-base) * 2); line-height: 1; }
|
|
61
|
+
&[data-ads-property="line-height"] { line-height: var(--ux-token-preview-value); }
|
|
62
|
+
&[data-ads-property="box-shadow"] {
|
|
63
|
+
border-radius: var(--radius-md);
|
|
64
|
+
background: var(--bg-surface);
|
|
65
|
+
box-shadow: var(--ux-token-preview-value);
|
|
66
|
+
}
|
|
67
|
+
/* Durations and easing move a dot across the tile. */
|
|
68
|
+
&[data-ads-property="animation-duration"], &[data-ads-property="animation-timing-function"] {
|
|
69
|
+
width: var(--space-8);
|
|
70
|
+
border-radius: 50%;
|
|
71
|
+
background: var(--accent);
|
|
72
|
+
animation-name: ux-token-preview-travel;
|
|
73
|
+
animation-iteration-count: infinite;
|
|
74
|
+
animation-direction: alternate;
|
|
75
|
+
}
|
|
76
|
+
&[data-ads-property="animation-duration"] {
|
|
77
|
+
animation-duration: calc(var(--ux-token-preview-value) * 8);
|
|
78
|
+
animation-timing-function: var(--ease-standard);
|
|
79
|
+
}
|
|
80
|
+
&[data-ads-property="animation-timing-function"] {
|
|
81
|
+
animation-duration: calc(var(--dur-normal) * 6);
|
|
82
|
+
animation-timing-function: var(--ux-token-preview-value);
|
|
83
|
+
}
|
|
84
|
+
&[data-ads-property="z-index"] { z-index: var(--ux-token-preview-value); position: relative; }
|
|
85
|
+
@keyframes ux-token-preview-travel { to { transform: translateX(calc(var(--space-8) * 6)); } }
|
|
86
|
+
`;
|
|
87
|
+
|
|
88
|
+
function TokenTile({ sample, text }: { sample: TokenSample; text: string }) {
|
|
89
|
+
const ref = useRef<HTMLSpanElement>(null);
|
|
90
|
+
const [value, setValue] = useState("");
|
|
91
|
+
useLayoutEffect(() => {
|
|
92
|
+
ref.current?.style.setProperty("--ux-token-preview-value", `var(${sample.token})`);
|
|
93
|
+
// The value as the page computes it now, again when the theme changes.
|
|
94
|
+
const read = () => setValue(getComputedStyle(document.documentElement).getPropertyValue(sample.token).trim());
|
|
95
|
+
read();
|
|
96
|
+
const observer = new MutationObserver(read);
|
|
97
|
+
observer.observe(document.documentElement, { attributes: true, attributeFilter: ["data-theme"] });
|
|
98
|
+
return () => observer.disconnect();
|
|
99
|
+
}, [sample.token]);
|
|
100
|
+
return (
|
|
101
|
+
<article className={cx("ux-token-preview__item", tile)}>
|
|
102
|
+
<span ref={ref} className={cx("ux-token-preview__sample", sampleStyle)} data-ads-token={sample.token} data-ads-property={sample.property}>
|
|
103
|
+
{["background-color", "width", "border-radius", "box-shadow", "animation-duration", "animation-timing-function"].includes(sample.property) ? "" : text}
|
|
104
|
+
</span>
|
|
105
|
+
<code className={cx("ux-token-preview__name", label)}>{sample.token}</code>
|
|
106
|
+
<small className={label}>{value}</small>
|
|
107
|
+
</article>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Project-owned review UI: one tile per token. Values always come from the real foundation CSS. */
|
|
112
|
+
export function TokenPreview({ title, samples, text }: TokenPreviewProps) {
|
|
113
|
+
return (
|
|
114
|
+
<section aria-label={title} className={cx("ux-token-preview", grid)}>
|
|
115
|
+
<h1 className={heading}>{title}</h1>
|
|
116
|
+
{samples.map(sample => <TokenTile key={`${sample.token}:${sample.property}`} sample={sample} text={text} />)}
|
|
117
|
+
</section>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"framework": "preact",
|
|
3
|
+
"behaviorLibraries": [],
|
|
4
|
+
"acceptance": { "checks": [], "behaviorChecks": false },
|
|
5
|
+
"validation": { "checks": [], "behaviorChecks": true, "inputs": [] },
|
|
6
|
+
"mcp": {
|
|
7
|
+
"previewManifest": ".ds/preview/manifest.json"
|
|
8
|
+
},
|
|
9
|
+
"boundaries": {
|
|
10
|
+
"styleWrites": [
|
|
11
|
+
{
|
|
12
|
+
"file": "design-system/review/token-preview/TokenPreview.tsx",
|
|
13
|
+
"properties": [
|
|
14
|
+
"--ux-token-preview-value"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "native-design-system",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Private starter workspace for a project's local Preact design system.",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22.12.0",
|
|
9
|
+
"bun": ">=1.4.1"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": [
|
|
12
|
+
"**/*.css"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"dev": "ads showcase",
|
|
16
|
+
"dev:showcase": "ads showcase",
|
|
17
|
+
"lint": "oxlint --deny-warnings src design-system && biome lint --config-path=biome.css.json .",
|
|
18
|
+
"typecheck": "tsc --noEmit",
|
|
19
|
+
"build": "npm run lint && npm run typecheck && npm run build:lib",
|
|
20
|
+
"build:lib": "vite build && tsc --project tsconfig.build.json",
|
|
21
|
+
"build:showcase": "ads compile .",
|
|
22
|
+
"preview": "ads showcase",
|
|
23
|
+
"preview:showcase": "ads showcase",
|
|
24
|
+
"build:mcp-previews": "ads compile ."
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@babel/preset-react": "7.29.7",
|
|
28
|
+
"@babel/preset-typescript": "7.29.7",
|
|
29
|
+
"@biomejs/biome": "2.5.15",
|
|
30
|
+
"@linaria/atomic": "8.0.0",
|
|
31
|
+
"@types/node": "25.9.4",
|
|
32
|
+
"@wyw-in-js/vite": "2.1.3",
|
|
33
|
+
"oxlint": "1.72.0",
|
|
34
|
+
"preact": "11.0.1",
|
|
35
|
+
"typescript": "5.9.3",
|
|
36
|
+
"vite": "6.4.3"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": [
|
|
5
|
+
"ES2022",
|
|
6
|
+
"DOM",
|
|
7
|
+
"DOM.Iterable"
|
|
8
|
+
],
|
|
9
|
+
"module": "ESNext",
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"moduleDetection": "force",
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
|
+
"jsxImportSource": "preact",
|
|
17
|
+
"strict": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"baseUrl": ".",
|
|
22
|
+
"paths": {
|
|
23
|
+
"@ds/review": [
|
|
24
|
+
"design-system/review/index.ts"
|
|
25
|
+
],
|
|
26
|
+
"@ds": [
|
|
27
|
+
"design-system/index.ts"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"include": [
|
|
32
|
+
"src",
|
|
33
|
+
"design-system",
|
|
34
|
+
"vite.config.ts"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { defineConfig } from "vite";
|
|
3
|
+
import wyw from "@wyw-in-js/vite";
|
|
4
|
+
import { linariaTagResolver } from "@reqvire-org/ads/linaria";
|
|
5
|
+
import { draftImportGuard } from "@reqvire-org/ads/scenarios/vite";
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
esbuild: { jsx: "automatic", jsxImportSource: "preact" },
|
|
9
|
+
plugins: [draftImportGuard(), wyw({ tagResolver: linariaTagResolver })],
|
|
10
|
+
resolve: {
|
|
11
|
+
alias: { "@ds/review": path.resolve(import.meta.dirname, "design-system/review/index.ts"), "@ds": path.resolve(import.meta.dirname, "design-system/index.ts") },
|
|
12
|
+
},
|
|
13
|
+
build: {
|
|
14
|
+
outDir: "dist",
|
|
15
|
+
lib: {
|
|
16
|
+
entry: path.resolve(import.meta.dirname, "design-system/index.ts"),
|
|
17
|
+
formats: ["es"],
|
|
18
|
+
fileName: () => "index.js",
|
|
19
|
+
cssFileName: "styles",
|
|
20
|
+
},
|
|
21
|
+
rollupOptions: { external: [/^preact(?:\/.*)?$/] },
|
|
22
|
+
},
|
|
23
|
+
});
|
package/dist/bun-compiler.mjs
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { runScenarioCompiler } from "./scenarios-compiler.mjs";
|
|
3
|
+
import { restoreCompiledPreviews, runScenarioCompiler } from "./scenarios-compiler.mjs";
|
|
4
|
+
import { loadConfig } from "./config.mjs";
|
|
5
|
+
import { withPreviewSession } from "./preview-scope.mjs";
|
|
4
6
|
import { createBunPreviewBuilder } from "./preview-bun.mjs";
|
|
5
7
|
import { checkCandidate } from "./validation-checks.mjs";
|
|
6
8
|
|
|
7
9
|
/** The same ADS-owned Bun compiler serves MCP, standalone builds and CI. */
|
|
8
|
-
export function compilePreviews(directory=process.cwd(),{watched=false}={}) {
|
|
10
|
+
export async function compilePreviews(directory=process.cwd(),{watched=false}={}) {
|
|
9
11
|
const root=path.resolve(directory);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
const compilerFiles=[import.meta.filename,...["preview-bun.mjs","preview-imports.mjs","bun-worker.mjs"].map(file=>fileURLToPath(new URL(file,import.meta.url)))];
|
|
13
|
+
async function validate(){const result=await checkCandidate(root);if(!result.ok)throw Object.assign(new Error("ADS project validation failed."),{diagnostics:result.diagnostics});}
|
|
14
|
+
if(!watched){const restored=await restoreCompiledPreviews(withPreviewSession(loadConfig(root),process.env.ADS_MCP_BUILD_SESSION),compilerFiles);if(restored)return restored;}
|
|
15
|
+
return runScenarioCompiler(root,{watched,compilerFiles,validate,buildGraph:createBunPreviewBuilder()});
|
|
12
16
|
}
|
|
13
17
|
if(process.argv[1]&&path.resolve(process.argv[1])===fileURLToPath(import.meta.url))await compilePreviews(process.cwd(),{watched:process.argv.includes("--watch")});
|
package/dist/cli.mjs
CHANGED
|
@@ -35,6 +35,7 @@ Usage: ads init [options] Run inside your project
|
|
|
35
35
|
--unit id Verify only: select one discovered behavior contract owner
|
|
36
36
|
--check id Verify only: select a registered check (repeatable)
|
|
37
37
|
--changed Validate only: select affected checks since the last full audit
|
|
38
|
+
--fresh Check/validate: execute batch checks without task-cache reads
|
|
38
39
|
|
|
39
40
|
External components and examples are imported using the ADS skills.
|
|
40
41
|
No component library or example catalogue is bundled.
|
|
@@ -53,13 +54,14 @@ async function main(args) {
|
|
|
53
54
|
const selectedChecks = [];
|
|
54
55
|
let showcase = true;
|
|
55
56
|
let mutations = false;
|
|
56
|
-
let changed = false, watched = false, policy;
|
|
57
|
+
let changed = false, watched = false, policy, fresh = false;
|
|
57
58
|
const positional = [];
|
|
58
59
|
for (let index = 0; index < args.length; index++) {
|
|
59
60
|
const argument = args[index];
|
|
60
61
|
if (argument === "--json") json = true;
|
|
61
62
|
else if(argument === "--watch") watched = true;
|
|
62
63
|
else if (argument === "--changed") changed = true;
|
|
64
|
+
else if (argument === "--fresh") fresh = true;
|
|
63
65
|
else if (argument === "--policy") {if(policy!==undefined || !["acceptance","validation"].includes(args[index+1]))throw new Error("--policy requires acceptance or validation.");policy=args[++index];}
|
|
64
66
|
else if (argument === "--no-showcase") showcase = false;
|
|
65
67
|
else if (argument === "--mutations") mutations = true;
|
|
@@ -92,8 +94,9 @@ async function main(args) {
|
|
|
92
94
|
const exitCode=await enterMemoryBudget(loadConfig(path.resolve(directory??process.cwd())).config,args);
|
|
93
95
|
if(exitCode!==null){process.exitCode=exitCode;return;}
|
|
94
96
|
}
|
|
95
|
-
const {
|
|
97
|
+
const { generateBrandAssets, generateLintConfig, initProject, inspectTokens } = await import("./index.mjs");
|
|
96
98
|
if(watched&&command!=="compile")throw new Error("--watch is supported only by compile.");
|
|
99
|
+
if(fresh && !["check","validate"].includes(command))throw new Error("--fresh is supported only by check/validate.");
|
|
97
100
|
if(command==="compile"){const {compilePreviews}=await import("./bun-compiler.mjs");await compilePreviews(path.resolve(directory??process.cwd()),{watched});return;}
|
|
98
101
|
if (policy!==undefined && command!=="validate")throw new Error("--policy is supported only by validate.");
|
|
99
102
|
if (changed && command !== "validate") throw new Error("--changed is supported only by validate.");
|
|
@@ -114,12 +117,12 @@ async function main(args) {
|
|
|
114
117
|
}
|
|
115
118
|
let result;
|
|
116
119
|
if (command === "init") result = initProject(target, { toolPackage, packageManager, framework });
|
|
117
|
-
else if (command === "check")
|
|
120
|
+
else if (command === "check") {const {checkCandidate}=await import("./validation-checks.mjs");result=await checkCandidate(target,undefined,target,{fresh});}
|
|
118
121
|
else if (command === "validate") {
|
|
119
122
|
const {createValidationController}=await import("./validation.mjs");
|
|
120
123
|
const validation=createValidationController(target);
|
|
121
124
|
const abort=()=>{void validation.close();};process.once("SIGINT",abort);process.once("SIGTERM",abort);
|
|
122
|
-
try {result=await validation.run({scope:changed?"changed":"all",policy});}
|
|
125
|
+
try {result=await validation.run({scope:changed?"changed":"all",policy,fresh});}
|
|
123
126
|
finally {process.removeListener("SIGINT",abort);process.removeListener("SIGTERM",abort);await validation.close();}
|
|
124
127
|
}
|
|
125
128
|
else if (command === "behaviors") { const {behaviorStatus}=await import("./verification.mjs"); const {loadConfig}=await import("./config.mjs"); result=behaviorStatus(loadConfig(target)); }
|
package/dist/init.mjs
CHANGED
|
@@ -8,6 +8,11 @@ import { assertFrameworkCompiler } from "./ui-framework.mjs";
|
|
|
8
8
|
|
|
9
9
|
const tool = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
10
10
|
const starter = fileURLToPath(new URL("./bootstrap-ds/", import.meta.url));
|
|
11
|
+
/** A framework's starter file: Preact's overlay replaces the React starter's where they differ. */
|
|
12
|
+
const starterFile = (framework, relative) => {
|
|
13
|
+
const overlay = fileURLToPath(new URL(`./bootstrap-ds-${framework}/${relative}`, import.meta.url));
|
|
14
|
+
return framework !== "react" && existsSync(overlay) ? overlay : path.join(starter, relative);
|
|
15
|
+
};
|
|
11
16
|
|
|
12
17
|
function dependencySpec(value) {
|
|
13
18
|
if (typeof value !== "string" || !value.trim()) throw new Error("toolPackage must be a version or local tool tarball path.");
|
|
@@ -151,13 +156,13 @@ export function initProject(directory = process.cwd(), { toolPackage, packageMan
|
|
|
151
156
|
return file;
|
|
152
157
|
});
|
|
153
158
|
if (!existingTokens.length) {
|
|
154
|
-
|
|
159
|
+
// The starter's token groups, each a scenario with its fixture.
|
|
160
|
+
for (const name of readdirSync(path.join(starter, "design-system/tokens")).filter(name => /\.ads\.(?:scenario\.tsx|fixture\.ts)$/.test(name)).sort()) {
|
|
155
161
|
const content = readFileSync(path.join(starter, "design-system/tokens", name), "utf8").replaceAll('"@ds/review"', JSON.stringify(`${config.publicAlias}/review`)).replaceAll('"@ds"', JSON.stringify(config.publicAlias));
|
|
156
162
|
addMissing(path.join(tokenRoot, name), content);
|
|
157
163
|
}
|
|
158
164
|
for (const name of ["TokenPreview.tsx"]) {
|
|
159
|
-
|
|
160
|
-
if (selectedFramework === "preact") content = content.replace('from "react"', 'from "preact/hooks"');
|
|
165
|
+
const content = readFileSync(starterFile(selectedFramework, `design-system/review/token-preview/${name}`), "utf8");
|
|
161
166
|
addMissing(path.join(dsRoot, "review/token-preview", name), content.replaceAll('"@ds"', JSON.stringify(config.publicAlias)));
|
|
162
167
|
}
|
|
163
168
|
const reviewFile = path.relative(root, path.join(dsRoot, "review/token-preview/TokenPreview.tsx")).replaceAll("\\", "/");
|
|
@@ -185,7 +190,11 @@ export function initProject(directory = process.cwd(), { toolPackage, packageMan
|
|
|
185
190
|
if (current !== readFileSync(entryFile, "utf8")) updates.set(entryFile, current);
|
|
186
191
|
}
|
|
187
192
|
}
|
|
188
|
-
|
|
193
|
+
// Keeps a section folder that has nothing in it yet.
|
|
194
|
+
for (const section of ["components", "patterns", "controllers", "composition"]) {
|
|
195
|
+
const directory = path.join(dsRoot, section);
|
|
196
|
+
if (!existsSync(directory) || !readdirSync(directory).length) addMissing(path.join(directory, ".gitkeep"), "");
|
|
197
|
+
}
|
|
189
198
|
addMissing(path.join(dsRoot, "assets/brand/README.md"), readFileSync(path.join(starter, "design-system/assets/brand/README.md")));
|
|
190
199
|
addMissing(path.join(dsRoot, "assets/fonts/.gitkeep"), "");
|
|
191
200
|
const configFile = path.join(root, "ds.config.json");
|
|
@@ -199,9 +208,8 @@ export function initProject(directory = process.cwd(), { toolPackage, packageMan
|
|
|
199
208
|
updates.set(configFile, `${JSON.stringify({ ...saved, framework: selectedFramework, ...(nativePreviewMissing?{mcp:{...saved.mcp,previewManifest:config.mcp.previewManifest}}:{}), ...(!existingTokens.length ? { boundaries: config.boundaries } : {}) }, null, indent)}\n`);
|
|
200
209
|
}
|
|
201
210
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
addMissing(path.join(dsRoot,"showcase/mcp/main.tsx"),`import ${JSON.stringify(config.publicAlias)};\n${mount}\nexport function mountScenario(Scenario,container){${render}}\n`);
|
|
211
|
+
// The framework's scenario mount, as the starter has it.
|
|
212
|
+
addMissing(path.join(dsRoot, "showcase/mcp/main.tsx"), readFileSync(starterFile(selectedFramework, "design-system/showcase/mcp/main.tsx"), "utf8").replaceAll('"@ds"', JSON.stringify(config.publicAlias)));
|
|
205
213
|
const ignoreFile = path.join(root, ".gitignore");
|
|
206
214
|
assertLocalFile(root, ignoreFile);
|
|
207
215
|
const ignore = existsSync(ignoreFile) ? readFileSync(ignoreFile, "utf8") : "";
|
|
@@ -51,6 +51,7 @@ function summary(value, storageWarning) {
|
|
|
51
51
|
...(units ? { units } : {}), ...(transaction ? { transaction } : {}), createdAt, counts, freshness:"recorded-at-completion",
|
|
52
52
|
...(value.draft?{draft:value.draft,draftRevision:value.draftRevision,draftEvent:value.draftEvent,updatedDependentCount:value.updatedDependents.length}:{}),
|
|
53
53
|
acceptance: compactAcceptance(value.acceptance), failures: value.failurePreview ?? failureRows.slice(0, 3).map(item => compactRow({recordIndex:item.recordIndex,unit:item.unit,check:item.check,status:item.status,rule:item.rule,file:item.file,failure:item.failure,message:item.message},640)),
|
|
54
|
+
...(value.sections.checks.some(item=>item.cache)?{taskCache:value.sections.checks.filter(item=>item.cache).map(item=>({task:item.cache.task,status:item.cache.status}))}:{}),
|
|
54
55
|
failureCount: value.failureCount ?? failureRows.length, resourceUri,
|
|
55
56
|
...(value.execution?{execution:compactRow(value.execution,1100)}:{}),
|
|
56
57
|
next: value.detailsUnavailable ? null : { tool: "ads_results", arguments: { resultId, section, ...(section === "outcomes" && failedOutcomes.length ? { status: "not_passed" } : {}) } },
|
package/dist/mcp/mutations.mjs
CHANGED
|
@@ -281,8 +281,8 @@ export function createMutationController(directory, { captures = createCaptureCo
|
|
|
281
281
|
candidateRevision=digest(Buffer.from(expected));
|
|
282
282
|
if (previewWork) releasePreview = await previewWork.acquire(signal);
|
|
283
283
|
const result = await checkCandidate(candidate, signal, root);
|
|
284
|
+
verified.push({name:"ads check",passed:result.ok,cache:result.cache});
|
|
284
285
|
if (!result.ok) return lastResult = mutationEvidence({ ok: false, applied: false, diagnostics: result.diagnostics, total: result.diagnostics.length, checks: verified },candidateRevision);
|
|
285
|
-
verified.push({ name: "ads check", passed: true });
|
|
286
286
|
if (assets || configuration) {
|
|
287
287
|
boundary=evidenceFailure("build","brand-assets","ADS_ASSET_BUILD");
|
|
288
288
|
const brand = await generateBrandAssets(candidate);
|
package/dist/mcp/server.mjs
CHANGED
|
@@ -7,6 +7,7 @@ import { Server, ProtocolError, INVALID_PARAMS, ResourceNotFoundError } from "@m
|
|
|
7
7
|
import { serveStdio, StdioServerTransport } from "@modelcontextprotocol/server/stdio";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { checkCandidate } from "../validation-checks.mjs";
|
|
10
|
+
import { taskCacheSettings } from "../task-cache.mjs";
|
|
10
11
|
import { createValidationController } from "../validation.mjs";
|
|
11
12
|
import { loadConfig, sourceFiles } from "../config.mjs";
|
|
12
13
|
import { createVerificationController, BEHAVIOR_URI } from "../verification.mjs";
|
|
@@ -98,11 +99,11 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
|
|
|
98
99
|
cache.registry = cache.catalog = cache.documents = undefined;
|
|
99
100
|
}
|
|
100
101
|
const getShowcaseUrl = () => showcaseUrl?.() ?? options.config.mcp.showcaseUrl;
|
|
101
|
-
async function architecture(signal) {
|
|
102
|
+
async function architecture(signal, fresh=false) {
|
|
102
103
|
let release;
|
|
103
104
|
try {
|
|
104
105
|
if (cache.previewWork) release = await cache.previewWork.acquire(signal);
|
|
105
|
-
return await checkCandidate(root, signal);
|
|
106
|
+
return await checkCandidate(root, signal, root, {fresh});
|
|
106
107
|
} finally { release?.(); }
|
|
107
108
|
}
|
|
108
109
|
function scenarioUrl(id) {
|
|
@@ -290,7 +291,7 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
|
|
|
290
291
|
async function status() {
|
|
291
292
|
const context = project(), mutationState = mutations ? edits.status() : null, behaviorState = verification.status();
|
|
292
293
|
const catalog = await getCatalog(), registry = cache.registry;
|
|
293
|
-
return { projectRoot: root, workflow: workflow([...previews(), ...scenarioApps(true)]), project: context,
|
|
294
|
+
return { projectRoot: root, taskCache:taskCacheSettings(root), workflow: workflow([...previews(), ...scenarioApps(true)]), project: context,
|
|
294
295
|
package: pkg.name, version: pkg.version, dsDir: options.config.dsDir, publicAlias: options.config.publicAlias, behaviorLibraries: getBehaviorLibraries().libraries,
|
|
295
296
|
components: catalog.filter((item) => item.kind === "components" && item.apiKind === "ui").length,
|
|
296
297
|
patterns: catalog.filter((item) => item.kind === "patterns" && item.apiKind === "ui").length,
|
|
@@ -432,7 +433,7 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
|
|
|
432
433
|
{ name:"ads_create_draft", description:"Create a Git-committable proposal under ads-drafts/ for 1–64 coupled ADS owners, copying only their source/companions into non-importable .ads files. New owners are allowed. Optional dependencies name separate unaccepted drafts used by pattern/composition previews. Creation does not change accepted source. Edit the returned files normally; use ads_update_draft to register additions/deletions.", schema:z.object({units:z.array(z.string().min(1).max(256)).min(1).max(mutationLimits.units),title:z.string().min(1).max(160).optional(),id:draftIdSchema.optional(),dependencies:z.array(draftIdSchema).max(8).default([]),tokenGroups:z.array(z.string().min(1).max(160)).max(32).default([])}).strict(),_meta:{ui:{visibility:["model"]}},annotations:{...annotations,readOnlyHint:false,idempotentHint:false},call:async args=>{const result=drafts.create(args);if(observeChanges)await refresh();return json(result);} },
|
|
433
434
|
{ name:"ads_update_draft", description:"Update marked draft source or register new/deleted canonical target paths. Pass the current revision from ads_drafts. Source is UTF-8 unless encoding:base64; content:null proposes deletion. refresh:true rebases onto current accepted source using stored baselines; non-overlapping edits merge and overlapping edits leave the draft unchanged with diagnostics. Use changes with refresh only for explicit resolved contents of existing draft files; refresh separately from dependency changes. Optional dependencies replaces the draft dependency list. Normal local file edits need no iteration tool. Accepted source remains unchanged; ownership and all required checks run at acceptance.",schema:z.object({id:draftIdSchema,revision:draftRevisionSchema,refresh:z.boolean().default(false),dependencies:z.array(draftIdSchema).max(8).optional(),changes:z.array(z.object({unit:z.string().max(256),path:z.string().min(1).max(500),content:z.string().max(256*1024).nullable(),encoding:z.enum(["utf8","base64"]).optional()}).strict()).max(32).default([])}).strict(),_meta:{ui:{visibility:["model"]}},annotations:{...annotations,readOnlyHint:false,idempotentHint:false},call:async args=>{const result=drafts.update(args);if(observeChanges)await refresh();return json(result);} },
|
|
434
435
|
{ name:"ads_drop_draft",description:"Delete an exact tracked draft and its generated preview. This is Drop, not a separate refusal workflow. Accepted source is unchanged. Dependents report a missing dependency until corrected.",schema:z.object({id:draftIdSchema,revision:draftRevisionSchema}).strict(),_meta:{ui:{visibility:["model"]}},annotations:{...annotations,readOnlyHint:false,destructiveHint:true,idempotentHint:false},call:async args=>{const result=await drafts.drop(args);if(observeChanges)await refresh();return json(result);} },
|
|
435
|
-
{ name:"ads_accept",title:"Accept a reviewed draft",description:"Auto-mode acceptance: validate and apply the exact rendered/reviewed draft revision in one operation. Accept dependency drafts first; dependent drafts automatically switch to their final @ds implementations. Mandatory ADS guards and acceptance.checks run once on the candidate; affected registered tests gate acceptance when acceptance.behaviorChecks is true. Draft/source changes invalidate acceptance. On failure retain the draft and inspect ads_results; on success apply normal source, remove the draft and publish an event. No additional human approval or manual Apply step.",schema:z.object({id:draftIdSchema,revision:draftRevisionSchema}).strict(),_meta:{ui:{visibility:["model"]}},annotations:{...annotations,readOnlyHint:false,destructiveHint:true,idempotentHint:false},call:async(args,signal,progress)=>{
|
|
436
|
+
{ name:"ads_accept",title:"Accept a reviewed draft",description:"Auto-mode acceptance: validate and apply the exact rendered/reviewed draft revision in one operation. Accept dependency drafts first; dependent drafts automatically switch to their final @ds implementations. Mandatory ADS guards and acceptance.checks run once on the candidate; affected registered tests gate acceptance when acceptance.behaviorChecks is true. Draft/source changes invalidate acceptance. On failure retain the draft and inspect ads_results; on success apply normal source, remove the draft and publish an event. No additional human approval or manual Apply step.",schema:z.object({fresh:z.boolean().default(false),id:draftIdSchema,revision:draftRevisionSchema}).strict(),_meta:{ui:{visibility:["model"]}},annotations:{...annotations,readOnlyHint:false,destructiveHint:true,idempotentHint:false},call:async(args,signal,progress)=>{
|
|
436
437
|
const result=await drafts.accept(args,signal,progress);
|
|
437
438
|
if(result.applied){await previewWatch?.invalidate?.();await refresh(true);}else await refresh();
|
|
438
439
|
return finishExecution("mutation",result);
|
|
@@ -480,9 +481,9 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
|
|
|
480
481
|
const matches = inventory.tokens.filter((token) => token.name.toLowerCase().includes(search.toLowerCase()));
|
|
481
482
|
return json({ total: matches.length, tokens: matches.slice(0, limit), categories: tokenScenarios(), tokenGroups:drafts.tokenGroups(), diagnosticCount: inventory.diagnostics.length, resourceUri: `${PROJECT_URI}/tokens` });
|
|
482
483
|
} },
|
|
483
|
-
{ name: "ads_check", description: "Run read-only core ADS architecture checks; returns blocking diagnostics separately from nonblocking advisories, with warnings before informational limits. Atomic warnings include helper/forwarded-class paths and ads://guides/atomic-styles guidance; unresolved paths do not establish safe composition. Project Oxlint, typecheck, build and browser tests remain separate.", schema: z.object({ limit: z.number().int().min(1).max(50).default(20) }).strict(), call: async ({ limit }, signal) => {
|
|
484
|
-
const result = await architecture(signal);
|
|
485
|
-
return json({ ok: result.ok, acceptance:result.acceptance, total: result.diagnostics.length, diagnostics: result.diagnostics.slice(0, limit), advisoryCount: result.advisories?.length ?? 0, advisories: (result.advisories ?? []).slice(0, limit), resourceUri: `${PROJECT_URI}/checks` });
|
|
484
|
+
{ name: "ads_check", description: "Run read-only core ADS architecture checks; returns blocking diagnostics separately from nonblocking advisories, with warnings before informational limits. Atomic warnings include helper/forwarded-class paths and ads://guides/atomic-styles guidance; unresolved paths do not establish safe composition. Project Oxlint, typecheck, build and browser tests remain separate.", schema: z.object({ limit: z.number().int().min(1).max(50).default(20), fresh:z.boolean().default(false) }).strict(), call: async ({ limit, fresh }, signal) => {
|
|
485
|
+
const result = await architecture(signal,fresh);
|
|
486
|
+
return json({ ok: result.ok, acceptance:result.acceptance, cache:result.cache, total: result.diagnostics.length, diagnostics: result.diagnostics.slice(0, limit), advisoryCount: result.advisories?.length ?? 0, advisories: (result.advisories ?? []).slice(0, limit), resourceUri: `${PROJECT_URI}/checks` });
|
|
486
487
|
} },
|
|
487
488
|
{ name: "ads_skills", description: "Select one ADS workflow after ads_status: ads-designer for building/refining/debugging UI; ads-port for a library reference; ads-import for another project's ADS; ads-motion for animation; ads-break-ui for stress testing. Then read that workflow with ads_read_skill. Listing does not activate a native skill.", schema: empty, call: () => json({ skills: skills.skills.map(({ uri, frontmatter }) => ({ uri, ...frontmatter })) }) },
|
|
488
489
|
{ name: "ads_read_skill", description: "Read a selected skill or relative supporting text file in bounded chunks. This is explicit instruction access, not automatic native skill activation/install.", schema: z.object({ name: z.string().max(64), file: z.string().max(300).default("SKILL.md"), offset: z.number().int().min(0).default(0), limit: z.number().int().min(1).max(8000).default(6000) }).strict(), call: ({ name, file, offset, limit }) => {
|
|
@@ -516,7 +517,7 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
|
|
|
516
517
|
{ name:"ads_report_bug",title:"Report a suspected ADS defect",description:"Record an unexpected ADS guard, preview, build, transport or runner behavior after targeted investigation. Provide expected/observed behavior, minimal steps and frequency; keep suspectedCause separate. Evidence optionally selects a returned resultId or exact unit/check/runId. ADS snapshots compact evidence, version, configured framework and revisions. A report is an untriaged agent claim, not proof of an ADS cause. Returns a small receipt with the report ID and local file path; submitted reports cannot be read through MCP. Stored locally under .ds/reports/ with deduplication, no automatic expiry and no upload. Read ads://guides/reporting; ordinary valid guard rejections should be fixed in their owner.",schema:bugReportSchema,annotations:{readOnlyHint:false,destructiveHint:false,idempotentHint:false,openWorldHint:false},call:args=>submitReport("bug",args) },
|
|
517
518
|
{ name:"ads_request_feature",title:"Request an ADS capability",description:"Record a legitimate workflow that needs a missing ADS capability. Provide workflow, capability and impact; proposal is optional. Preserve valid design/API rather than weakening guards or inventing workaround props. Optional evidence references an existing execution/check, not pasted files/logs. ADS attaches compact context and returns a receipt with the report ID and local file path. Intake is submission-only; no report-reading tools or resources. Shared local report store: deduplicated, untriaged, no automatic expiry or upload. Read ads://guides/reporting; use ads_report_bug for suspected broken existing behavior.",schema:featureRequestSchema,annotations:{readOnlyHint:false,destructiveHint:false,idempotentHint:false,openWorldHint:false},call:args=>submitReport("feature",args) },
|
|
518
519
|
{ name: "ads_investigate", title: "Inspect check evidence", description: "Read a summary for an exact unit/check, or list latest investigations when no check is selected. Pass the outcome's runId to reject superseded evidence. Summary is at most 4 KiB JSON; details, requests, browserErrors and artifacts are separate paged sections (default 10/max 20 entries, 8 KiB). Read truncated rows with recordIndex/offset/chars and the exact runId. Artifact URIs are read separately. Does not rerun checks or infer root cause. Lists latest checks; an exact runId reads retained historical evidence, including candidate runs.", schema: z.object({unit:z.string().min(1).max(256).optional(),check:z.string().min(1).max(100).optional(),runId:z.string().min(1).max(100).optional(),section:z.enum(investigationSections).optional(),...paged,...recordRange}).strict(), call: args => json(investigationPage(root,args)) },
|
|
519
|
-
{ name: "ads_validate", description: "Run mandatory ADS architecture/freshness guards and the selected project policy. policy defaults to validation: its configured scripts, preview freshness and optional registered behavior checks. policy acceptance runs acceptance.checks and acceptance.behaviorChecks without applying source, for direct editing. No script names are inferred. scope changed selects affected registered checks from this policy's own successful full baseline; broad changes expand to all. Project scripts keep full scope. Draft edit/show never triggers policies. Reports skipped stages honestly and a bounded resultId; use ads_results for details. Read ads://guides/validation. Trusted configured commands run; nothing is installed.", schema: z.object({scope:z.enum(["all","changed"]).default("all"),policy:z.enum(["acceptance","validation"]).default("validation")}).strict(), annotations: {readOnlyHint:false,destructiveHint:false,idempotentHint:false,openWorldHint:false}, call: async (args,signal,progress) => {
|
|
520
|
+
{ name: "ads_validate", description: "Run mandatory ADS architecture/freshness guards and the selected project policy. policy defaults to validation: its configured scripts, preview freshness and optional registered behavior checks. policy acceptance runs acceptance.checks and acceptance.behaviorChecks without applying source, for direct editing. No script names are inferred. scope changed selects affected registered checks from this policy's own successful full baseline; broad changes expand to all. Project scripts keep full scope. Draft edit/show never triggers policies. Reports skipped stages honestly and a bounded resultId; use ads_results for details. Read ads://guides/validation. Trusted configured commands run; nothing is installed.", schema: z.object({scope:z.enum(["all","changed"]).default("all"),policy:z.enum(["acceptance","validation"]).default("validation"),fresh:z.boolean().default(false)}).strict(), annotations: {readOnlyHint:false,destructiveHint:false,idempotentHint:false,openWorldHint:false}, call: async (args,signal,progress) => {
|
|
520
521
|
return finishExecution("validation",await validation.run(args,signal,progress));
|
|
521
522
|
} },
|
|
522
523
|
{ name: "ads_verify", description: "Run one owner's registered development behavior checks using its configured runner/profile. Executes trusted project commands with bounded output, cancellation and process-tree cleanup; installs nothing. Progress and per-check timings are available through ads_status; a profile timeout bounds the whole run. Browser profiles use an isolated managed showcase/MCP App. React StrictMode requires a project development harness, not a production widget. Missing/skipped cases, stale inputs and process exit alone cannot produce passing evidence. Replies contain counts, acceptance, at most three failure summaries and a resultId (4 KiB JSON maximum). Page outcomes with ads_results; inspect one exact unit/check/runId with ads_investigate. Discover exact unit/check IDs with ads_behaviors first.", schema: z.object({ unit: z.string().min(1).max(256), checks: z.array(z.string().min(1).max(100)).min(1).max(100).optional() }).strict(), annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false }, call: async (args, signal, progress) => {
|
|
@@ -573,6 +574,7 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
|
|
|
573
574
|
const args=input.data;
|
|
574
575
|
const selection={...(args.policy?{policy:args.policy}:{}),...(args.scope?{requestedScope:args.scope,scope:args.scope}:{}),units:args.units??args.patches?.map(row=>row.unit)??(args.unit?[args.unit]:[]),...(args.id?{draft:args.id}:{}),...(args.checks?{checks:args.checks}:{})};
|
|
575
576
|
const summary=await coordinator.execute({operation:name,kind,owner,selection,watchSource:kind!=="mutation"},context.mcpReq.signal,notify,(signal,progress)=>{
|
|
577
|
+
executionContext.getStore().fresh=args.fresh??false;
|
|
576
578
|
if(name==="ads_accept")progress({stage:"selection",policy:"acceptance",scope:"changed",units:drafts.inspect(args.id).manifest.units});
|
|
577
579
|
return tool.call(args,signal,progress);
|
|
578
580
|
});
|
|
@@ -49,7 +49,11 @@ export async function startShowcaseHost(factory, { port = 0, observe } = {}) {
|
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
try {
|
|
52
|
-
await new Promise((resolve, reject) => { web.once("error", reject); web.listen(port, "127.0.0.1", resolve); })
|
|
52
|
+
await new Promise((resolve, reject) => { web.once("error", reject); web.listen(port, "127.0.0.1", resolve); }).catch(error => {
|
|
53
|
+
// Commonly the project's ADS MCP (\`ads mcp --port\`), which serves its own showcase there.
|
|
54
|
+
if (error?.code === "EADDRINUSE" || /in use/i.test(error?.message ?? "")) throw Object.assign(new Error(`Port ${port} is already in use, often by another ADS showcase or the project's ADS MCP (it serves the showcase on its own --port). Open that showcase, or give this one another --port.`), { code: "EADDRINUSE" });
|
|
55
|
+
throw error;
|
|
56
|
+
});
|
|
53
57
|
sandbox = await startSandboxHost(`http://127.0.0.1:${web.address().port}`);
|
|
54
58
|
}
|
|
55
59
|
catch (error) { web.close(); await observer?.close(); await handler.close(); throw error; }
|