@reqvire-org/ads 0.3.25 → 0.3.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/README.md +28 -15
  2. package/dist/bootstrap-ds/ADS.md +28 -30
  3. package/dist/bootstrap-ds/README.md +13 -11
  4. package/dist/bootstrap-ds/design-system/assets/brand/README.md +3 -2
  5. package/dist/bootstrap-ds/ds.config.json +1 -1
  6. package/dist/bootstrap-ds/scripts/build-mcp-previews.mjs +1 -1
  7. package/dist/boundaries.mjs +0 -3
  8. package/dist/capture.mjs +1 -1
  9. package/dist/check.mjs +15 -22
  10. package/dist/config.mjs +3 -7
  11. package/dist/contract-migration.mjs +2 -2
  12. package/dist/contracts.d.mts +0 -1
  13. package/dist/design-values.mjs +81 -0
  14. package/dist/development-runtime.mjs +17 -0
  15. package/dist/evidence.mjs +1 -1
  16. package/dist/index.mjs +1 -1
  17. package/dist/init.mjs +14 -12
  18. package/dist/mcp/apps.mjs +1 -1
  19. package/dist/mcp/context.mjs +8 -7
  20. package/dist/mcp/mutations.mjs +3 -2
  21. package/dist/mcp/preview-watch.mjs +2 -1
  22. package/dist/mcp/prompts.mjs +4 -4
  23. package/dist/mcp/reports.mjs +101 -0
  24. package/dist/mcp/server.mjs +41 -3
  25. package/dist/mcp/widget.bundle.js +1 -1
  26. package/dist/paint-contracts.mjs +4 -5
  27. package/dist/preview-files.mjs +33 -0
  28. package/dist/preview-inputs.mjs +6 -5
  29. package/dist/preview-resources.mjs +1 -2
  30. package/dist/scenarios-compiler.mjs +7 -7
  31. package/dist/scenarios.mjs +14 -14
  32. package/dist/showcase/sandbox.bundle.js +1 -1
  33. package/dist/skills/README.md +14 -4
  34. package/dist/skills/ads-break-ui/SKILL.md +29 -15
  35. package/dist/skills/ads-break-ui/references/atomic-styles.md +9 -2
  36. package/dist/skills/ads-break-ui/references/behaviors.md +396 -0
  37. package/dist/skills/ads-break-ui/references/captures.md +1 -1
  38. package/dist/skills/ads-break-ui/references/contracts.md +18 -37
  39. package/dist/skills/ads-break-ui/references/design-data.md +91 -0
  40. package/dist/skills/ads-break-ui/references/evidence.md +4 -0
  41. package/dist/skills/ads-break-ui/references/guarded-editing.md +7 -11
  42. package/dist/skills/ads-break-ui/references/layers.md +16 -0
  43. package/dist/skills/ads-break-ui/references/reporting.md +101 -0
  44. package/dist/skills/ads-break-ui/references/runtimes.md +110 -0
  45. package/dist/skills/ads-break-ui/references/scenarios.md +9 -15
  46. package/dist/skills/ads-designer/README.md +6 -0
  47. package/dist/skills/ads-designer/SKILL.md +35 -20
  48. package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +28 -30
  49. package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +13 -11
  50. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/README.md +3 -2
  51. package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +1 -1
  52. package/dist/skills/ads-designer/assets/bootstrap-ds/scripts/build-mcp-previews.mjs +1 -1
  53. package/dist/skills/ads-designer/references/atomic-styles.md +9 -2
  54. package/dist/skills/ads-designer/references/behaviors.md +396 -0
  55. package/dist/skills/ads-designer/references/captures.md +1 -1
  56. package/dist/skills/ads-designer/references/cli.md +10 -7
  57. package/dist/skills/ads-designer/references/contracts.md +18 -37
  58. package/dist/skills/ads-designer/references/design-craft.md +32 -1
  59. package/dist/skills/ads-designer/references/design-data.md +91 -0
  60. package/dist/skills/ads-designer/references/evidence.md +4 -0
  61. package/dist/skills/ads-designer/references/guarded-editing.md +7 -11
  62. package/dist/skills/ads-designer/references/layers.md +16 -0
  63. package/dist/skills/ads-designer/references/mobile.md +1 -1
  64. package/dist/skills/ads-designer/references/reporting.md +101 -0
  65. package/dist/skills/ads-designer/references/runtimes.md +110 -0
  66. package/dist/skills/ads-designer/references/scenarios.md +9 -15
  67. package/dist/skills/ads-import/SKILL.md +51 -20
  68. package/dist/skills/ads-import/agents/openai.yaml +2 -2
  69. package/dist/skills/ads-import/references/atomic-styles.md +9 -2
  70. package/dist/skills/ads-import/references/behaviors.md +396 -0
  71. package/dist/skills/ads-import/references/branding.md +1 -1
  72. package/dist/skills/ads-import/references/captures.md +1 -1
  73. package/dist/skills/ads-import/references/cli.md +10 -7
  74. package/dist/skills/ads-import/references/compatibility.md +113 -0
  75. package/dist/skills/ads-import/references/contracts.md +18 -37
  76. package/dist/skills/ads-import/references/design-data.md +91 -0
  77. package/dist/skills/ads-import/references/evidence.md +4 -0
  78. package/dist/skills/ads-import/references/guarded-editing.md +7 -11
  79. package/dist/skills/ads-import/references/implementation.md +9 -2
  80. package/dist/skills/ads-import/references/layers.md +16 -0
  81. package/dist/skills/ads-import/references/reporting.md +101 -0
  82. package/dist/skills/ads-import/references/runtimes.md +110 -0
  83. package/dist/skills/ads-import/references/scenarios.md +9 -15
  84. package/dist/skills/ads-import/references/tokens.md +11 -9
  85. package/dist/skills/ads-motion/SKILL.md +28 -14
  86. package/dist/skills/ads-motion/references/atomic-styles.md +9 -2
  87. package/dist/skills/ads-motion/references/behaviors.md +396 -0
  88. package/dist/skills/ads-motion/references/captures.md +1 -1
  89. package/dist/skills/ads-motion/references/contracts.md +18 -37
  90. package/dist/skills/ads-motion/references/design-data.md +91 -0
  91. package/dist/skills/ads-motion/references/evidence.md +4 -0
  92. package/dist/skills/ads-motion/references/guarded-editing.md +7 -11
  93. package/dist/skills/ads-motion/references/layers.md +16 -0
  94. package/dist/skills/ads-motion/references/reporting.md +101 -0
  95. package/dist/skills/ads-motion/references/runtimes.md +110 -0
  96. package/dist/skills/ads-motion/references/scenarios.md +9 -15
  97. package/dist/skills/{ads-migrate → ads-port}/SKILL.md +64 -33
  98. package/dist/skills/ads-port/agents/openai.yaml +4 -0
  99. package/dist/skills/{ads-migrate → ads-port}/references/atomic-styles.md +9 -2
  100. package/dist/skills/ads-port/references/behaviors.md +396 -0
  101. package/dist/skills/{ads-migrate → ads-port}/references/captures.md +1 -1
  102. package/dist/skills/{ads-migrate → ads-port}/references/cli.md +10 -7
  103. package/dist/skills/{ads-migrate → ads-port}/references/contracts.md +18 -37
  104. package/dist/skills/ads-port/references/design-data.md +91 -0
  105. package/dist/skills/{ads-migrate → ads-port}/references/evidence.md +4 -0
  106. package/dist/skills/{ads-migrate → ads-port}/references/guarded-editing.md +7 -11
  107. package/dist/skills/{ads-migrate → ads-port}/references/layers.md +16 -0
  108. package/dist/skills/{ads-migrate → ads-port}/references/lint-and-docs.md +5 -0
  109. package/dist/skills/{ads-migrate → ads-port}/references/native-implementation.md +49 -15
  110. package/dist/skills/ads-port/references/reporting.md +101 -0
  111. package/dist/skills/ads-port/references/runtimes.md +110 -0
  112. package/dist/skills/{ads-migrate → ads-port}/references/scenarios.md +9 -15
  113. package/dist/skills/{ads-migrate → ads-port}/references/testing.md +11 -1
  114. package/dist/tokens.mjs +5 -8
  115. package/dist/unit-contracts.mjs +1 -8
  116. package/dist/verification.mjs +4 -3
  117. package/docs/ADS.md +59 -73
  118. package/docs/ARCHITECTURE.md +68 -20
  119. package/docs/BEHAVIORS.md +46 -41
  120. package/docs/CHANGELOG.md +44 -1
  121. package/docs/COMPARISON.md +63 -0
  122. package/docs/CONTRACTS.md +18 -37
  123. package/docs/GUIDE.md +41 -23
  124. package/docs/MCP.md +100 -15
  125. package/package.json +5 -4
  126. package/dist/scoped-tokens.mjs +0 -68
  127. package/dist/skills/ads-migrate/agents/openai.yaml +0 -4
  128. /package/dist/skills/{ads-migrate → ads-port}/references/review.md +0 -0
@@ -0,0 +1,81 @@
1
+ import path from "node:path";
2
+ import { lexer, parse, generate } from "css-tree";
3
+ import valueParser from "postcss-value-parser";
4
+ import { isInside } from "./config.mjs";
5
+ import { createSourceValues, reference } from "./source-values.mjs";
6
+
7
+ const colorCache = new Map();
8
+ export function isColorKeyword(value) {
9
+ if (!/^[a-z]+$/i.test(value) || /^(?:currentcolor|transparent|none|inherit|initial|unset|revert)$/i.test(value)) return false;
10
+ const key=value.toLowerCase();
11
+ if(!colorCache.has(key))colorCache.set(key,!!lexer.matchType("color",key).matched);
12
+ return colorCache.get(key);
13
+ }
14
+ const refs = value => {
15
+ const names=[];
16
+ valueParser(value).walk(node=>{if(node.type==="function"&&node.value==="var"){const name=node.nodes.find(child=>child.type==="word")?.value;if(name?.startsWith("--"))names.push(name);}});
17
+ return names;
18
+ };
19
+
20
+ /** Resolve static interpolations through imports/local helpers; never execute project code. */
21
+ export function createDesignValues(program, options) {
22
+ const values=createSourceValues(program,options);
23
+ function strings(input, context=values.state()) {
24
+ const value=values.resolve(input,context);
25
+ if(value.kind==="literal")return ["string","number"].includes(typeof value.value)?[String(value.value)]:[];
26
+ if(value.kind==="union")return value.values.slice(0,16).flatMap(item=>strings(item,values.next(context)));
27
+ return [];
28
+ }
29
+ return expression => [...new Set(strings(reference(expression)))];
30
+ }
31
+
32
+ /** Variable names cannot conceal the typography/layering role of their consumer. */
33
+ export function inspectDesignAliases(styles, options, report) {
34
+ const declarations=[], roles=new Map(), protectedProperties=new Set(["font-family","font-weight","z-index"]);
35
+ const add=(name,role)=>{if(!roles.has(name))roles.set(name,new Set());const before=roles.get(name).size;roles.get(name).add(role);return roles.get(name).size!==before;};
36
+ for(const entry of styles) {
37
+ if(isInside(path.join(options.dsRoot,options.config.tokenDir),entry.file))continue;
38
+ entry.css.walkDecls(decl=>{
39
+ if(decl.parent.type==="atrule"&&decl.parent.name.toLowerCase()==="property")return;
40
+ declarations.push({...entry,decl});
41
+ if(protectedProperties.has(decl.prop))for(const name of refs(decl.value))add(name,decl.prop);
42
+ });
43
+ }
44
+ // A finite fixed point includes all alias/fallback branches and imported helper styles.
45
+ let changed=true;
46
+ while(changed){changed=false;for(const {decl} of declarations)for(const role of roles.get(decl.prop)??[])for(const name of refs(decl.value))changed=add(name,role)||changed;}
47
+ for(const {file,offset,decl} of declarations) {
48
+ const selected=protectedProperties.has(decl.prop)?new Set([decl.prop]):roles.get(decl.prop);
49
+ if(!selected)continue;
50
+ const nodes=valueParser(decl.value).nodes.filter(node=>!["space","comment"].includes(node.type));
51
+ function allowed(nodes){
52
+ nodes=nodes.filter(node=>!["space","comment"].includes(node.type));
53
+ if(nodes.length!==1)return false;
54
+ const [node]=nodes;
55
+ if(node.type==="word")return /^(?:inherit|initial|unset|revert(?:-layer)?|auto)$/.test(node.value);
56
+ if(node.type!=="function"||node.value!=="var"||node.unclosed)return false;
57
+ const parts=node.nodes.filter(node=>!["space","comment"].includes(node.type));
58
+ return parts[0]?.type==="word"&&/^--[\w-]+$/.test(parts[0].value)&&(parts.length===1||parts[1]?.type==="div"&&parts[1].value===","&&allowed(parts.slice(2)));
59
+ }
60
+ const valid=allowed(nodes);
61
+ if(!valid)report(file,"design-value-source",`${decl.prop} reaches ${[...selected].sort().join("/")}. Map it to shared Data with a token reference; a private variable or raw fallback cannot introduce independent typography/layering values.`,offset.line+decl.source.start.line-1,decl.source.start.column,{guidanceUri:"ads://guides/tokens"});
62
+ }
63
+ }
64
+
65
+ const canonical=value=>{try{return generate(parse(value,{context:"value"}));}catch{return value.trim();}};
66
+ /** Equal definitions invite review, not an automatic merge of different semantic roles. */
67
+ export function tokenOverlapAdvisories(tokens) {
68
+ const groups=new Map();
69
+ for(const token of tokens) {
70
+ if(token.owner!=="tokens"||!token.definitions.length)continue;
71
+ const definitions=token.definitions.map(({scope,value})=>[scope,canonical(value)]).sort(([a],[b])=>a.localeCompare(b));
72
+ if(definitions.every(([,value])=>/^var\(--[\w-]+\)$/.test(value))||definitions.every(([,value])=>/^(?:0|1|none|auto|inherit|initial|unset|transparent)$/.test(value)))continue;
73
+ const signature=JSON.stringify(definitions);
74
+ if(!groups.has(signature))groups.set(signature,[]);
75
+ groups.get(signature).push(token);
76
+ }
77
+ return [...groups.values()].filter(group=>group.length>1).map(group=>{
78
+ const [first]=group, {file,line,column}=first.definitions[0],names=group.map(token=>token.name);
79
+ return {rule:"token-overlap-review",severity:"warning",file,line,column,tokens:names,guidanceUri:"ads://guides/tokens",message:`Shared Data tokens have identical definitions across their declared theme/condition scopes: ${names.slice(0,6).join(", ")}${names.length>6?` and ${names.length-6} more`:""}. Review semantic roles and consumers before consolidating. Equal values do not prove equivalent purpose; preserve distinct roles or use an explicit shared alias when appropriate.`};
80
+ });
81
+ }
@@ -0,0 +1,17 @@
1
+ import path from "node:path";
2
+
3
+ /** The launcher selects the runtime; Node-compatible imports work on both. */
4
+ export function developmentRuntime() {
5
+ return { name: process.versions.bun ? "bun" : "node", version: process.versions.bun ?? process.versions.node,
6
+ executable: process.execPath, binDir: path.dirname(process.execPath) };
7
+ }
8
+
9
+ /** `runtime` is portable. Explicit interpreter names keep their meaning. */
10
+ export function developmentExecutable(command) {
11
+ const runtime = developmentRuntime();
12
+ return command === "runtime" || command === runtime.name ? runtime.executable : command;
13
+ }
14
+
15
+ export function packageScriptCommand(manager, script) {
16
+ return { command: manager, args: [...(manager === "bun" ? ["--bun"] : []), "run", script] };
17
+ }
package/dist/evidence.mjs CHANGED
@@ -12,7 +12,7 @@ export function acceptance(scope, passed, established, unverified) {
12
12
 
13
13
  export function architectureEvidence(result) {
14
14
  return { ...result,
15
- diagnostics: result.diagnostics.map(diagnostic => ({ ...diagnostic, ...(/^(?:unit-contract|paint-.+|binding-.+|declarative-.+|development-role)$/.test(diagnostic.rule)&&!diagnostic.guidanceUri?{guidanceUri:"ads://guides/contracts"}:{}), failure: diagnostic.failure ?? failure("architecture", "source-analysis", diagnostic.rule) })),
15
+ diagnostics: result.diagnostics.map(diagnostic => ({ ...diagnostic, ...(["style-token","design-value-source","token-name","token-ownership"].includes(diagnostic.rule)&&!diagnostic.guidanceUri?{guidanceUri:"ads://guides/tokens"}:{}), ...(/^(?:unit-contract|paint-.+|binding-.+|declarative-.+|development-role)$/.test(diagnostic.rule)&&!diagnostic.guidanceUri?{guidanceUri:"ads://guides/contracts"}:{}), ...(["declarative-consumer","binding-producer","scenario-render","scenario-exercise","showcase-control"].includes(diagnostic.rule)?{reportingGuidanceUri:"ads://guides/reporting"}:{}), failure: diagnostic.failure ?? failure("architecture", "source-analysis", diagnostic.rule) })),
16
16
  acceptance: acceptance("core-architecture", result.ok, result.ok ? ["core-source-guards"] : [], ["project-checks", "compiled-preview", "browser-behavior", "visual-parity", "accessibility-audit"]),
17
17
  };
18
18
  }
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ export { inspectTokens, tokenContract } from "./tokens.mjs";
4
4
  export { inspectTokenOrigins } from "./token-origins.mjs";
5
5
  export { generateLintConfig } from "./lint-config.mjs";
6
6
  export { generateBrandAssets } from "./brand-assets.mjs";
7
- // Node-only helpers for registered project lint extensions. They reuse the
7
+ // Development-only helpers for registered project lint extensions. They reuse the
8
8
  // same validated configuration and property boundary as the core checker.
9
9
  export { loadConfig } from "./config.mjs";
10
10
  export { importResolver, styleWriteViolation } from "./boundaries.mjs";
package/dist/init.mjs CHANGED
@@ -32,7 +32,7 @@ function detectManager(root, pkg, requested) {
32
32
  if (bun) return "bun";
33
33
  if (npm) return "npm";
34
34
  if (["pnpm-lock.yaml", "yarn.lock"].some((name) => existsSync(path.join(root, name)))) throw new Error("This version supports npm and Bun projects.");
35
- return process.env.npm_config_user_agent?.startsWith("bun/") ? "bun" : "npm";
35
+ return process.versions.bun || process.env.npm_config_user_agent?.startsWith("bun/") ? "bun" : "npm";
36
36
  }
37
37
 
38
38
  function assertLocalFile(root, file) {
@@ -105,7 +105,9 @@ export function initProject(directory = process.cwd(), { toolPackage, packageMan
105
105
  }
106
106
  const manager = detectManager(root, pkg, packageManager);
107
107
  if (!["npm", "bun"].includes(manager)) throw new Error("packageManager must be npm or bun.");
108
- const run = `${manager} run`;
108
+ const run = manager === "bun" ? "bun --bun run" : "npm run";
109
+ const ads = manager === "bun" ? "bun --bun run ads" : "ads";
110
+ const oxlint = manager === "bun" ? "bun --bun run oxlint" : "oxlint";
109
111
  const spec = dependencySpec(toolPackage ?? pkg.devDependencies?.[tool.name] ?? pkg.dependencies?.[tool.name] ?? tool.version);
110
112
  const { config, dsRoot } = loadConfig(root);
111
113
  if (framework !== undefined && !supportedFrameworks.includes(framework)) throw new Error("framework must be react or preact.");
@@ -117,24 +119,24 @@ export function initProject(directory = process.cwd(), { toolPackage, packageMan
117
119
  const lintRoots = [config.sourceDir];
118
120
  if (!isInside(path.resolve(root, config.sourceDir), dsRoot)) lintRoots.push(config.dsDir);
119
121
  const sourceArguments = lintRoots.map((directory) => `'${directory.replaceAll("'", "'\"'\"'")}'`).join(" ");
120
- const lint = `ads lint-config . && ads check . && oxlint --deny-warnings --config .ds/oxlintrc.json ${sourceArguments}`;
122
+ const lint = `${ads} lint-config . && ${ads} check . && ${oxlint} --deny-warnings --config .ds/oxlintrc.json ${sourceArguments}`;
121
123
  const scripts = { ...pkg.scripts };
122
- if (scripts["lint:ds"] && scripts["lint:ds"] !== lint && !["ads lint-config . && ads check .", "ds lint-config . && ds check ."].some(prefix => scripts["lint:ds"].startsWith(prefix))) throw new Error("An existing custom lint:ds script would conflict. Rename it or integrate ADS checks before running init.");
124
+ if (scripts["lint:ds"] && scripts["lint:ds"] !== lint && !["ads lint-config . && ads check .", "ds lint-config . && ds check .", "bun --bun run ads lint-config . && bun --bun run ads check ."].some(prefix => scripts["lint:ds"].startsWith(prefix))) throw new Error("An existing custom lint:ds script would conflict. Rename it or integrate ADS checks before running init.");
123
125
  scripts["lint:ds"] = lint;
124
- if (scripts["assets:ds"] && !["ads assets", "ds assets"].includes(scripts["assets:ds"])) throw new Error("An existing custom assets:ds script would conflict. Rename it or integrate ADS asset generation before running init.");
125
- scripts["assets:ds"] = "ads assets";
126
- if (!scripts["dev:showcase"] || scripts["dev:showcase"] === "ds showcase") scripts["dev:showcase"] = "ads showcase";
127
- scripts["ads-mcp"] ??= "ads mcp --mutations";
128
- scripts["ads-read-mcp"] ??= "ads mcp";
129
- const managedBuild = [`${run} lint:ds`, `${run} lint:ds && ${run} assets:ds`].includes(scripts.build);
126
+ if (scripts["assets:ds"] && !["ads assets", "ds assets", "bun --bun run ads assets"].includes(scripts["assets:ds"])) throw new Error("An existing custom assets:ds script would conflict. Rename it or integrate ADS asset generation before running init.");
127
+ scripts["assets:ds"] = `${ads} assets`;
128
+ for (const [name, command] of [["dev:showcase", "showcase"], ["ads-mcp", "mcp --mutations"], ["ads-read-mcp", "mcp"]]) {
129
+ if (!scripts[name] || [`ds ${command}`, `ads ${command}`, `bun --bun run ads ${command}`].includes(scripts[name])) scripts[name] = `${ads} ${command}`;
130
+ }
131
+ const managedBuild = /^(?:npm|bun(?: --bun)?) run lint:ds(?: && (?:npm|bun(?: --bun)?) run assets:ds)?$/.test(scripts.build ?? "");
130
132
  if (scripts.build && !managedBuild) {
131
133
  const previous = scripts.prebuild ?? "";
132
- const remaining = previous.replace(/^(?:npm|bun) run lint:ds(?:\s*&&\s*(?:npm|bun) run assets:ds)?(?:\s*&&\s*|$)/, "");
134
+ const remaining = previous.replace(/^(?:npm|bun(?: --bun)?) run lint:ds(?:\s*&&\s*(?:npm|bun(?: --bun)?) run assets:ds)?(?:\s*&&\s*|$)/, "");
133
135
  scripts.prebuild = `${run} lint:ds && ${run} assets:ds${remaining ? ` && ${remaining}` : ""}`;
134
136
  } else scripts.build = `${run} lint:ds && ${run} assets:ds`;
135
137
  if (scripts["build:showcase"]) {
136
138
  const previous = scripts["prebuild:showcase"] ?? "";
137
- const remaining = previous.replace(/^(?:npm|bun) run lint:ds(?:\s*&&\s*(?:npm|bun) run assets:ds)?(?:\s*&&\s*|$)/, "");
139
+ const remaining = previous.replace(/^(?:npm|bun(?: --bun)?) run lint:ds(?:\s*&&\s*(?:npm|bun(?: --bun)?) run assets:ds)?(?:\s*&&\s*|$)/, "");
138
140
  scripts["prebuild:showcase"] = `${run} lint:ds && ${run} assets:ds${remaining ? ` && ${remaining}` : ""}`;
139
141
  }
140
142
  pkg.scripts = scripts;
package/dist/mcp/apps.mjs CHANGED
@@ -49,5 +49,5 @@ export function projectApp(options, app, build) {
49
49
  }
50
50
 
51
51
  export function appMetadata({ nested = false } = {}) {
52
- return { ui: { csp: { connectDomains: [], resourceDomains: ["data:", "blob:"], ...(nested ? { frameDomains: ["about:"] } : {}) } } };
52
+ return { ui: { csp: { connectDomains: ["blob:"], resourceDomains: ["data:", "blob:"], ...(nested ? { frameDomains: ["about:"] } : {}) } } };
53
53
  }
@@ -2,10 +2,11 @@ import { existsSync, readFileSync } from "node:fs";
2
2
  import path from "node:path";
3
3
  import { sourceUri } from "./catalog.mjs";
4
4
  import { projectGuideFiles } from "../project-documents.mjs";
5
+ import { developmentRuntime, packageScriptCommand } from "../development-runtime.mjs";
5
6
 
6
7
  export const GUIDE_URI = "ads://project/guide";
7
8
  // Put the task triggers and entry path first: some hosts shorten server guidance.
8
- export const serverInstructions = "Use ADS for UI work: components, patterns, controllers, hooks, tokens, themes, branding, layout, interaction, accessibility, motion and showcase review. Start with ads_status; if tools are not exposed, read ads://project/guide then ads://project/status. Use the returned projectRoot and commands. When ads_status.mutations.enabled, use ads_units and guarded ads_apply_patch for one owner; use ads_apply_transaction only for coupled owner patches. Find existing public UI with ads_catalog; discover its previews with ads_scenarios and open ads_show_scenario. Starting ADS also serves its built-in showcase: use ads_status.showcaseUrl for browser review instead of starting another runtime/compiler or project browser app. Read one relevant ADS skill before editing. Inspect the real preview, edit its owned source, check the build and review again. Scope source/guides to the project, its instruction ancestry and user-selected import/reference sources; broad searches of /mnt or home are not ADS discovery. Domain-model/requirements work is a separate project workflow. For requested visual evidence, use ads_capture or screenshot-enabled patch dry runs; read ads://guides/captures for named targets, image resources and the current/candidate lifecycle. For behavior work, read ads://guides/behaviors and use ads_behaviors/ads_verify: scenario exercises are demonstrations, and registered guarantees need current passing execution evidence. Execution replies are bounded summaries. Read only needed sections with ads_results(resultId, section, status, cursor); follow nextCursor without rerunning. For a failure, inspect its boundary and acceptance, then ads_investigate with the outcome's exact unit/check/runId; detail sections and artifacts load separately (ads://guides/evidence). Preserve valid APIs when source tracing is inconclusive. Use the configured project framework and declared dependencies; MCP hosts supply no ad hoc APIs. MCP source checks do not replace browser tests; direct edits still need project checks. Reading HTML is not rendering, and reading a skill is not native activation. A running watcher is not proof of current source: inspect ads_status.build or ads://project/build after edits. Notifications may not reach the agent. Only explicitly enabled mutation tools edit project-owned ADS units after validation. Checks and compiler commands come from validated project configuration, never an ad hoc command argument.";
9
+ export const serverInstructions = "Use ADS for UI work: components, patterns, controllers, hooks, tokens, themes, branding, layout, interaction, accessibility, motion and showcase review. Start with ads_status; if tools are not exposed, read ads://project/guide then ads://project/status. Use the returned projectRoot and commands. When ads_status.mutations.enabled, use ads_units and guarded ads_apply_patch for one owner; use ads_apply_transaction only for coupled owner patches. Find existing public UI with ads_catalog; discover its previews with ads_scenarios and open ads_show_scenario. Starting ADS also serves its built-in showcase: use ads_status.showcaseUrl for browser review instead of starting another runtime/compiler or project browser app. Read one relevant ADS skill before editing. Inspect the real preview, edit its owned source, check the build and review again. Scope source/guides to the project, its instruction ancestry and user-selected import/reference sources; broad searches of /mnt or home are not ADS discovery. Domain-model/requirements work is a separate project workflow. For requested visual evidence, use ads_capture or screenshot-enabled patch dry runs; read ads://guides/captures for named targets, image resources and the current/candidate lifecycle. For behavior work, read ads://guides/behaviors and use ads_behaviors/ads_verify: scenario exercises are demonstrations, and registered guarantees need current passing execution evidence. Execution replies are bounded summaries. Read only needed sections with ads_results(resultId, section, status, cursor); follow nextCursor without rerunning. For a failure, inspect its boundary and acceptance, then ads_investigate with the outcome's exact unit/check/runId; detail sections and artifacts load separately (ads://guides/evidence). Preserve valid APIs when source tracing is inconclusive. After targeted investigation, record suspected ADS defects with ads_report_bug or missing capabilities with ads_request_feature; read ads://guides/reporting. These are local untriaged reports, not established causes or upstream issues. Use the configured project framework and declared dependencies; MCP hosts supply no ad hoc APIs. MCP source checks do not replace browser tests; direct edits still need project checks. Reading HTML is not rendering, and reading a skill is not native activation. A running watcher is not proof of current source: inspect ads_status.build or ads://project/build after edits. Notifications may not reach the agent. Only explicitly enabled mutation tools edit project-owned ADS units after validation. Checks and compiler commands come from validated project configuration, never an ad hoc command argument.";
9
10
 
10
11
  function manager(root, pkg) {
11
12
  if (typeof pkg.packageManager === "string") return pkg.packageManager.split("@")[0];
@@ -20,15 +21,15 @@ export function projectContext(options) {
20
21
  try { pkg = JSON.parse(readFileSync(path.join(root, "package.json"), "utf8")); } catch { /* A partial ADS can still be inspected. */ }
21
22
  const packageManager = manager(root, pkg);
22
23
  const scripts = pkg.scripts ?? {};
23
- const commands = ["ads-mcp", "ads-read-mcp", "dev:showcase", "build:showcase", "build:mcp-previews", "lint:ds", "lint", "lint:style", "typecheck", "test", "build"].filter((name) => typeof scripts[name] === "string").map((script) => ({ script, cwd: root, args: packageManager ? [packageManager, "run", script] : null }));
24
+ const commands = ["ads-mcp", "ads-read-mcp", "dev:showcase", "build:showcase", "build:mcp-previews", "lint:ds", "lint", "lint:style", "typecheck", "test", "build"].filter((name) => typeof scripts[name] === "string").map((script) => { const launch = packageManager && packageScriptCommand(packageManager, script); return { script, cwd: root, args: launch ? [launch.command, ...launch.args] : null }; });
24
25
  const guides = [...projectGuideFiles(root), path.join(config.dsDir, "README.md"), path.join(config.dsDir, "readme.md"), path.join(config.dsDir, "SKILL.md")].filter((file) => existsSync(path.join(root, file))).map((file) => ({ file: file.replaceAll("\\", "/"), uri: sourceUri(file.replaceAll("\\", "/")) }));
25
26
  return { name: pkg.name ?? path.basename(root), projectRoot: root, dsRoot, sourceRoot, framework: config.framework,
26
27
  publicEntry: path.join(dsRoot, config.publicEntry), publicEntryUri: existsSync(path.join(dsRoot, config.publicEntry)) ? sourceUri(path.relative(root, path.join(dsRoot, config.publicEntry)).replaceAll("\\", "/")) : null,
27
28
  review: { importFrom: `${config.publicAlias}/review`, entry: path.join(dsRoot, config.reviewEntry), sourceUri: existsSync(path.join(dsRoot, config.reviewEntry)) ? sourceUri(path.relative(root, path.join(dsRoot, config.reviewEntry)).replaceAll("\\", "/")) : null, developmentOnly: true },
28
29
  stylesEntry: path.join(dsRoot, config.stylesEntry), packageManager, commands, guides,
29
30
  showcase: { client: "tool-owned-mcp", url: config.mcp.showcaseUrl, title: config.mcp.showcaseTitle ?? `${pkg.name ?? path.basename(root)} · Design System` },
30
- runtime: { node: process.execPath, nodeBinDir: path.dirname(process.execPath), nodeVersion: process.version,
31
- shellHint: "The agent shell may have a different PATH from MCP. If npm is missing, check this Node bin directory and prepend it to the shell PATH when npm is installed there; do not search the whole machine or assume a reinstall is needed." } };
31
+ runtime: { ...developmentRuntime(),
32
+ shellHint: "The agent shell may have a different PATH from MCP. Use this runtime executable/bin directory and the returned project commands; do not search the whole machine or assume another runtime must be installed." } };
32
33
  }
33
34
 
34
35
  export function workflow(previews) {
@@ -36,7 +37,7 @@ export function workflow(previews) {
36
37
  next: "Find the requested public UI with ads_catalog (query + kind + small limit), then read its source/guide and one selected ADS skill. For a broad UI request, inspect the public barrel and targeted application entry files in sourceRoot.",
37
38
  skills: [
38
39
  { task: "Build, refine or debug UI using the project ADS", name: "ads-designer" },
39
- { task: "Adapt a component-library reference", name: "ads-migrate" },
40
+ { task: "Adapt a component-library reference", name: "ads-port" },
40
41
  { task: "Import from another project's design-system", name: "ads-import" },
41
42
  { task: "Implement or review motion", name: "ads-motion" },
42
43
  { task: "Stress-test layout, states and interactions", name: "ads-break-ui" },
@@ -57,7 +58,7 @@ Use this server for UI components/patterns, tokens/themes/branding, layout, inte
57
58
  3. Select one workflow with ads_skills, then ads_read_skill. ${route.skills.map((skill) => `${skill.task}: ${skill.name}`).join("; ")}. Native skill activation is host-controlled. Relative skill references resolve from its SKILL.md URI. Read support files only when relevant.
58
59
  4. ${route.preview} Token samples: ads_scenarios(kind: tokens), then ads_show_scenario or ads_show_tokens(category: id). Token source inspection: ads_tokens with a focused query. Registered previews: ${previews.map((preview) => `${preview.id}: ${preview.tool ?? "ads_show_scenario"}`).join(", ") || "none"}. Showcase URL: ${context.showcase.url ?? "not configured; use the project's showcase command"}.
59
60
  Inspection connects a public export to its owning source, available guides, token values and discovered preview IDs. Bounded tools keep discovery focused; explicit resource reads supply detail. Source metadata does not prove layout, interaction or motion. A scenario renders the real public implementation and its fixture context in either review surface.
60
- 5. Check ads_status.mutations. When enabled, discover one owner with ads_units, read relevant source ranges with ads_read_file and submit only a Git unified diff through ads_apply_patch({unit, patch, dryRun}). Include that owner's scenarios, fixtures and required public re-exports, never peer units. tokens is the foundation unit; its manifest lists companionFiles for required canonical foundation imports when token files are created/deleted in the same patch. Preserve unrelated imports/comments and public-entry statements; a real selected-owner re-export can remove its redundant export {};. Dry-run to inspect validation; apply only a passing patch. Fix rejected patches in the owning unit; use ads_apply_transaction for coupled owners instead of bypassing rejection with direct writes. ads_prepare_patch creates a local owner draft/diff; ads_prepare_token_samples reconciles explicit project bindings without guessing visual meaning. Intentional project setup, registered guard/compiler code and exceptions use configuration; shared globals use foundation, guides documentation and assets their discovered assets/* unit. Keep mandatory ADS gates. Binary/large Git diffs may use patchFile under .ds/patches/ to avoid model-context bytes. In read-only mode, source edits use the client editor/filesystem tools. Reuse the local public API (${context.publicEntry}). Edit presentation in its ADS owner; keep application data/services/routing in application code and development fixtures beside their scenario; larger scenarios live in composition/. Demo framing and token renderers live in development-only review/, imported through ${context.review.importFrom}; never export them from the production barrel or import them into application runtime. Read ads://guides/review for review owners/aliases and ads://guides/contracts when editing static owner declarations, .ads. development roles, constrained paints/bindings or declarative APIs. Contract registration, source evidence and browser verification remain separate. Use ads_prepare_patch action: migrate for a reviewable owner draft, then normal diff and guarded application. Linaria extracts owned styling. Inspect relevant tokens with ads_tokens and source/owning guides before edits.
61
+ 5. Check ads_status.mutations. When enabled, discover one owner with ads_units, read relevant source ranges with ads_read_file and submit only a Git unified diff through ads_apply_patch({unit, patch, dryRun}). Include that owner's scenarios, fixtures and required public re-exports, never peer units. tokens is the foundation unit; its manifest lists companionFiles for required canonical foundation imports when token files are created/deleted in the same patch. Preserve unrelated imports/comments and public-entry statements; a real selected-owner re-export can remove its redundant export {};. Dry-run to inspect validation; apply only a passing patch. Fix rejected patches in the owning unit; use ads_apply_transaction for coupled owners instead of bypassing rejection with direct writes. ads_prepare_patch creates a local owner draft/diff; ads_prepare_token_samples reconciles explicit project bindings without guessing visual meaning. Intentional project setup, registered guard/compiler code and exceptions use configuration; shared globals use foundation, guides documentation and assets their discovered assets/* unit. Keep mandatory ADS gates. Binary/large Git diffs may use patchFile under .ds/patches/ to avoid model-context bytes. In read-only mode, source edits use the client editor/filesystem tools. Reuse the local public API (${context.publicEntry}). Edit presentation in its ADS owner; keep application data/services/routing in application code and development fixtures beside their scenario; larger scenarios live in composition/. Demo framing and token renderers live in development-only review/, imported through ${context.review.importFrom}; never export them from the production barrel or import them into application runtime. Read ads://guides/review for review owners/aliases and ads://guides/contracts when editing static owner declarations, .ads. development roles, constrained paints/bindings or declarative APIs. Contract registration, source evidence and browser verification remain separate. Use ads_prepare_patch action: migrate for a reviewable owner draft, then normal diff and guarded application. Shared foundation Data is the only design-value catalogue. Components/patterns map shared roles; independent owner token namespaces and value sheets are rejected. Existing project font, text and spacing roles take precedence over divergent upstream constants. Read ads://guides/tokens for the source contract and overlap review. Linaria extracts owned styling. Inspect relevant tokens with ads_tokens and source/owning guides before edits.
61
62
  6. ${route.validation} Registered commands: ${context.commands.map((command) => command.args?.join(" ") ?? `choose the project package manager for ${command.script}`).join("; ") || "none discovered; inspect the project's build setup"}. Run them from ${context.projectRoot}.
62
63
  Execution replies from ads_verify and guarded edits contain counts, acceptance and resultId, not full reports. Read only needed outcomes/diagnostics/captures with ads_results, following nextCursor with identical filters. A truncated row has recordIndex for bounded text ranges. For one failure, use ads_investigate with its unit/check/runId; read request/error/artifact sections only when needed. Only the latest verification and mutation results, and latest investigation per check, are available. Notifications do not establish freshness.
63
64
 
@@ -65,7 +66,7 @@ Execution replies from ads_verify and guarded edits contain counts, acceptance a
65
66
 
66
67
  Project guide resources: ${context.guides.map((guide) => `${guide.file}: ${guide.uri}`).join("; ") || "none discovered"}.
67
68
 
68
- Node executable: ${context.runtime.node}. Node bin directory: ${context.runtime.nodeBinDir}. ${context.runtime.shellHint}
69
+ Development runtime: ${context.runtime.name} ${context.runtime.version}. Executable: ${context.runtime.executable}. Bin directory: ${context.runtime.binDir}. ${context.runtime.shellHint}
69
70
 
70
71
  If the client exposes resources but no ADS tools, this guide and the project status/public-barrel/guide resources provide the entry path. Use the returned local paths for scoped source inspection and project commands. Do not claim a resource-only connection offers ADS tool calls, native Skills activation or a rendered App. Configure/enable the tools in the client when required; project edits still use local editor/filesystem tools.
71
72
  `;
@@ -16,6 +16,7 @@ import { previewSourceRevision } from "../preview-inputs.mjs";
16
16
  import { inspectScenarios } from "../scenarios.mjs";
17
17
  import { checkUnitCandidate, checkUnitFiles, inspectUnits, validateUnitId } from "../units.mjs";
18
18
  import { acceptance, failure as evidenceFailure } from "../evidence.mjs";
19
+ import { packageScriptCommand } from "../development-runtime.mjs";
19
20
 
20
21
  export const mutationLimits = { units: 8, files: 32, patchBytes: 256 * 1024, patchFileBytes: 16 * 1024 * 1024, fileBytes: 16 * 1024 * 1024, readChars: 12000, snapshotFiles: 20000, snapshotBytes: 128 * 1024 * 1024 };
21
22
  const digest = bytes => `sha256:${createHash("sha256").update(bytes).digest("hex")}`;
@@ -155,7 +156,7 @@ function checks(options) {
155
156
  const scripts = options.config.mcp.mutationChecks ?? [pkg.scripts?.["lint:project"] ? "lint:project" : "lint", "typecheck", "build:mcp-previews"].filter(name => typeof pkg.scripts?.[name] === "string");
156
157
  if (scripts.some(name => typeof pkg.scripts?.[name] !== "string")) throw fail("mutation-check", "Every configured mcp.mutationChecks script must exist in package.json.");
157
158
  if (scripts.length && !["npm", "bun"].includes(context.packageManager)) throw fail("mutation-check", "Declare packageManager as npm or bun to run mutation checks.");
158
- return scripts.map(script => ({ command: context.packageManager, args: ["run", script] }));
159
+ return scripts.map(script => packageScriptCommand(context.packageManager, script));
159
160
  }
160
161
 
161
162
  export function createMutationController(directory, { captures = createCaptureController(directory) } = {}) {
@@ -297,7 +298,7 @@ export function createMutationController(directory, { captures = createCaptureCo
297
298
  const brand = await generateBrandAssets(candidate);
298
299
  verified.push({ name: "brand assets", passed: true, skipped: !!brand.skipped });
299
300
  }
300
- for (const check of extraChecks) verified.push(await checkCommand(check.command, check.args, candidate, signal, undefined, {category:"build",phase:`project-check:${check.args[1]}`}, candidateOptions.config.mcp.mutationCheckTimeoutMs));
301
+ for (const check of extraChecks) verified.push(await checkCommand(check.command, check.args, candidate, signal, undefined, {category:"build",phase:`project-check:${check.args.at(-1)}`}, candidateOptions.config.mcp.mutationCheckTimeoutMs));
301
302
  boundary=evidenceFailure("runner","behavior-verification","ADS_BEHAVIOR_SETUP");
302
303
  const behaviorUnits = affectedBehaviorUnits(candidateOptions, changes.map(change => change.path));
303
304
  if (behaviorUnits.length) {
@@ -5,6 +5,7 @@ import path from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { buildFailure, inspectBuildStatus } from "./build-status.mjs";
7
7
  import { previewSessionDirectories, withPreviewSession } from "../preview-scope.mjs";
8
+ import { developmentExecutable } from "../development-runtime.mjs";
8
9
 
9
10
  function stamp(file) {
10
11
  try { const stat = statSync(file); return `${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`; }
@@ -64,7 +65,7 @@ export function createPreviewWatch(root, config, { log = process.stderr, buildTi
64
65
  state = "running";
65
66
  // No shell: configured arguments remain literal. Child stdin cannot consume
66
67
  // the MCP channel, and both output streams go exclusively to diagnostics.
67
- const executable = command.command === "node" ? process.execPath : command.command;
68
+ const executable = developmentExecutable(command.command);
68
69
  const env = { ...process.env, ADS_MCP_BUILD_SESSION: session, ADS_MCP_BUILD_STATUS: reportFile, ADS_MCP_REQUEST_FILE: requestFile, PATH: [path.join(root, "node_modules/.bin"), path.dirname(process.execPath), process.env.PATH ?? ""].join(path.delimiter) };
69
70
  try {
70
71
  child = spawn(executable, command.args, { cwd: root, env, shell: false, detached: process.platform !== "win32", stdio: ["ignore", "pipe", "pipe"], windowsHide: true });
@@ -1,12 +1,12 @@
1
1
  export const reasoning = `ADS is development tooling. The project owns its components, patterns, token values and branding.
2
- Start with ads_status and use its projectRoot, workflow and project commands; the MCP workspace may be nested inside the client repository. If ADS tools are not exposed, read ads://project/guide then ads://project/status. Find existing public UI with ads_catalog and load one relevant ADS workflow via ads_skills/ads_read_skill. UI implementation/refinement uses ads-designer; library adaptation ads-migrate; ADS transfer ads-import; motion ads-motion; stress testing ads-break-ui. Domain-model workflows are separate. Inspect the relevant public API, local guide, token definitions and real showcase fixture before proposing changes. Keep source/instruction discovery scoped to the target project, ancestry and selected external sources; broad scans of /mnt or home are not needed to discover this ADS.
3
- When ads_status.mutations.enabled, discover one owner with ads_units, read relevant ranges with ads_read_file and send only a Git unified diff through ads_apply_patch({unit,patch,dryRun}). A unit includes its own scenarios/fixtures; imported peers remain separate. tokens is the token foundation unit. Only that owner's public re-exports may change in the shared entry; preserve unrelated statements including export {};. Token manifests list companionFiles: include required foundation import changes only for canonical token files created/deleted in the same patch, preserving other imports/comments and canonical order. Use dryRun to review validation. Rejected patches leave source unchanged; fix diagnostics rather than bypassing checks with direct writes. Shared globals use foundation; guides use documentation; assets use discovered assets/* units. Intentional configuration, registered project guards/builders and rule exceptions use configuration, which validates the proposed settings and refreshes its compiler. Keep mandatory ADS gates. For large/binary diffs, pass patchFile pointing to .ds/patches/<name>.patch rather than loading bytes into context; Git binary patches require installed Git. When editing is disabled, use local editing tools.
4
- Reason through Data (design-token values, semantic roles and relationships), UX (structure, behavior, accessibility, states and layout), and Skin (token-backed identity and visual states). Business data is a separate application-owned input, supplied through typed props or injected callbacks/services. The project uses Linaria extraction for owned styles; MCP adds no production runtime.
2
+ Start with ads_status and use its projectRoot, workflow and project commands; the MCP workspace may be nested inside the client repository. If ADS tools are not exposed, read ads://project/guide then ads://project/status. Find existing public UI with ads_catalog and load one relevant ADS workflow via ads_skills/ads_read_skill. UI implementation/refinement uses ads-designer; library adaptation ads-port; ADS transfer ads-import; motion ads-motion; stress testing ads-break-ui. Domain-model workflows are separate. Inspect the relevant public API, local guide, token definitions and real showcase fixture before proposing changes. Keep source/instruction discovery scoped to the target project, ancestry and selected external sources; broad scans of /mnt or home are not needed to discover this ADS.
3
+ When ads_status.mutations.enabled, discover one owner with ads_units, read relevant ranges with ads_read_file and send only a Git unified diff through ads_apply_patch({unit,patch,dryRun}). A unit includes its own scenarios/fixtures; imported peers remain separate. tokens is the token foundation unit. Only that owner's public re-exports may change in the shared entry; preserve unrelated statements. A real re-export may replace a redundant export {}; placeholder; do not add empty exports. Token manifests list companionFiles: include required foundation import changes only for canonical token files created/deleted in the same patch, preserving other imports/comments and canonical order. Use dryRun to review validation. Rejected patches leave source unchanged; fix diagnostics rather than bypassing checks with direct writes. Shared globals use foundation; guides use documentation; assets use discovered assets/* units. Intentional configuration, registered project guards/builders and rule exceptions use configuration, which validates the proposed settings and refreshes its compiler. Keep mandatory ADS gates. For large/binary diffs, pass patchFile pointing to .ds/patches/<name>.patch rather than loading bytes into context; Git binary patches require installed Git. When editing is disabled, use local editing tools.
4
+ Reason through Data (design-token values, semantic roles and relationships), UX (structure, behavior, accessibility, states and layout), and Skin (token-backed identity and visual states). Business data is a separate application-owned input, supplied through typed props or injected callbacks/services. Shared foundation Data is the only design-value catalogue. Components map it with --ds-* and patterns/review with --ux-*; there are no independent owner token namespaces or value sheets. Reuse project font, text and spacing roles when upstream constants differ. Read ads://guides/tokens for source boundaries and duplication review. The project uses Linaria extraction for owned styles; MCP adds no production runtime.
5
5
  Choose an existing public component or pattern first. Keep application data/routing/effects in the application and fixture data/state beside its scenario. Change presentation in its owning ADS implementation, then demonstrate the same public API in the showcase. Put demo-only sizing and framing in a development-only review/ helper, exported through the separate review entry rather than the production barrel; add component props for deliberate runtime API needs and preserve required behavior. Do not create a widget-only replica or override component internals.
6
6
  For token source inspection, call ads_tokens with a focused query. For token samples, components, patterns and composition, use ads_scenarios to select a path-derived id and invoke ads_show_scenario. Showcase and MCP mount that exact entry and its colocated fixture; no page initialization is required. The showcase is a minimal tool-owned shell plus an MCP client and Apps host. Its menus come from tools; it invokes the same entry tools and refreshes the active scenario through notifications. The reusable App loads framework runtime, foundation CSS, fonts and selected modules via MCP resources inside its sandbox. Keep project execution and styles out of the outer host; preserve mount/unmount cleanup and lazy dependencies. Use the existing ads_status showcase URL, or ads showcase when no MCP runtime is connected. Projects supply scenarios/fixtures and the compiler, not browser page files or another shell. Tool metadata selects an MCP App; a resources/read of HTML alone is not proof of rendered UI. If the host has no Apps view, give the configured showcase URL and use text/resources.
7
7
  Check ads_status.previewWatch before launching a separate preview builder. A configured watcher is managed by ads mcp. Check ads_status.build or ads://project/build after changes: running does not mean ready, and unreported freshness is not evidence of current source. Reported preview failures include structured diagnostics; fix the owning source and wait for a successful rebuild, then invoke the preview tool again. Notifications may not reach the agent, so read status explicitly. Build revisions identify reported compilation attempts, not proof of runtime/visual correctness. Do not invent replacement UI to bypass a failed preview.
8
8
  Skills: use ads_skills to select a workflow and read its SKILL.md with ads_read_skill. Resolve relative supporting files from that skill URI. Reading instructions does not prove native skill activation or authorize unrelated actions.
9
- Ask for missing intent only when it changes the outcome. State the proposed behavior, states and difficult content. Preserve lazy loading, workers, caches, cancellation, reduced motion, focus and keyboard behavior. For controllers and hooks, read ads://guides/behaviors. Discover guarantees/checks with ads_behaviors and run ads_verify; read current execution evidence. Keep behavior.json and checks development-only. Use the configured framework and declared dependencies, not MCP host globals. Preserve covers for rendered UI; exercises links behavioral APIs to demonstrations, not passing guarantees. Run ads_check plus the project's registered lint, typecheck, build and relevant tests; inspect the actual browser/rendered app at narrow and wide sizes in both themes. Static success does not establish visual or interaction parity.`;
9
+ Ask for missing intent only when it changes the outcome. State the proposed behavior, states and difficult content. Preserve lazy loading, workers, caches, cancellation, reduced motion, focus and keyboard behavior. For controllers and hooks, read ads://guides/behaviors. Discover guarantees/checks with ads_behaviors and run ads_verify; read current execution evidence. Keep <Owner>.ads.contract.ts, marked scenarios/fixtures and checks development-only. Use the configured framework and declared dependencies, not MCP host globals. Preserve covers for rendered UI; exercises links behavioral APIs to demonstrations, not passing guarantees. Run ads_check plus the project's registered lint, typecheck, build and relevant tests; inspect the actual browser/rendered app at narrow and wide sizes in both themes. Static success does not establish visual or interaction parity.`;
10
10
 
11
11
  export function promptDefinitions(skills) {
12
12
  const prompts = [
@@ -0,0 +1,101 @@
1
+ import { createHash, randomUUID } from "node:crypto";
2
+ import { closeSync, existsSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
3
+ import path from "node:path";
4
+ import { z } from "zod";
5
+ import { compactRow, jsonBytes } from "./result-pages.mjs";
6
+
7
+ export const reportLimits = Object.freeze({ recordBytes: 32768 });
8
+ const text = max => z.string().trim().min(1).max(max);
9
+ const identifier = text(256).refine(value => !["\r","\n","\0"].some(character=>value.includes(character)), "Use a single project discovery ID.");
10
+ const evidence = z.union([
11
+ z.object({ resultId: z.string().uuid() }).strict(),
12
+ z.object({ unit: identifier, check: text(100), runId: text(100) }).strict(),
13
+ ]);
14
+ const common = { title: text(160), unit: identifier.optional(), scenario: identifier.optional(), reporter: text(100).optional(), evidence: z.array(evidence).max(3).default([]) };
15
+ export const bugReportSchema = z.object({ ...common, expected: text(2000), observed: text(2000), steps: z.array(text(500)).min(1).max(12), frequency: z.enum(["always", "intermittent", "once", "unknown"]), suspectedCause: text(1000).optional() }).strict();
16
+ export const featureRequestSchema = z.object({ ...common, workflow: text(2000), capability: text(2000), impact: text(1000), proposal: text(1500).optional() }).strict();
17
+ const schemas = { bug: bugReportSchema, feature: featureRequestSchema };
18
+ const uuid = value => typeof value === "string" && /^[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$/.test(value);
19
+ const digest = value => createHash("sha256").update(JSON.stringify(value)).digest("hex");
20
+ function receipt(record) {
21
+ return { reportId: record.id, revision: record.revision, kind: record.kind, status: "untriaged", classification: "agent-supplied",
22
+ createdAt: record.createdAt, updatedAt: record.updatedAt, submissionCount: record.submissionCount,
23
+ storagePath: `.ds/reports/${record.id}.json`, delivery: "local-only" };
24
+ }
25
+
26
+ /** Durable project-local intake with bounded records and delivery. */
27
+ export function createReportStore(root, { context = () => ({}), resolveEvidence = () => { throw new Error("Evidence is unavailable."); } } = {}) {
28
+ root = path.resolve(root);
29
+ const folder = path.join(root, ".ds/reports"), lock = path.join(folder, "write.lock"), cached = new Map();
30
+ function directory(target, create = false) {
31
+ if (create && !existsSync(target)) { try { mkdirSync(target); } catch(error) { if(error.code!=="EEXIST")throw error; } }
32
+ if (realpathSync(target) !== target || !lstatSync(target).isDirectory()) throw new Error("Report storage must use ordinary project directories.");
33
+ }
34
+ function parents(create = false) { directory(root); directory(path.join(root, ".ds"), create); directory(folder, create); }
35
+ function regular(target, max) {
36
+ const stat = lstatSync(target);
37
+ if (realpathSync(target) !== target || !stat.isFile() || stat.nlink !== 1 || stat.size > max) throw new Error("Invalid or oversized report storage file.");
38
+ }
39
+ function files() {
40
+ if (!existsSync(path.join(root, ".ds"))) return [];
41
+ directory(path.join(root, ".ds"));
42
+ if (!existsSync(folder)) return [];
43
+ parents();
44
+ return readdirSync(folder).filter(name => name.endsWith(".json") && uuid(name.slice(0,-5))).sort().map(name => {
45
+ const file=path.join(folder,name),stat=lstatSync(file);
46
+ return {file,id:name.slice(0,-5),stamp:`${stat.ino}:${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`};
47
+ });
48
+ }
49
+ function readFile(file,id) {
50
+ regular(file,reportLimits.recordBytes);
51
+ const record=JSON.parse(readFileSync(file,"utf8"));
52
+ if(record.schemaVersion!==1||record.id!==id||!uuid(record.revision)||!/^[a-f0-9]{64}$/.test(record.fingerprint)||!Object.hasOwn(schemas,record.kind)||!schemas[record.kind].safeParse(record.submission).success||!Number.isSafeInteger(record.submissionCount)||record.submissionCount<1||!Array.isArray(record.evidence)||!record.context||typeof record.context!=="object"||typeof record.createdAt!=="string"||typeof record.updatedAt!=="string")throw new Error("Invalid saved report; preserve it for recovery rather than overwriting it.");
53
+ return record;
54
+ }
55
+ function headers() {
56
+ const entries=files(),live=new Set(entries.map(entry=>entry.id));
57
+ for(const id of cached.keys())if(!live.has(id))cached.delete(id);
58
+ return entries.map(({file,id,stamp})=>{
59
+ if(cached.get(id)?.stamp!==stamp){const record=readFile(file,id);cached.set(id,{stamp,value:{id,fingerprint:record.fingerprint,createdAt:record.createdAt,submissionCount:record.submissionCount}});}
60
+ return cached.get(id).value;
61
+ });
62
+ }
63
+ function acquire() {
64
+ parents(true);
65
+ if (existsSync(lock)) try {
66
+ regular(lock, 512);
67
+ const previous = readFileSync(lock, "utf8"), owner = JSON.parse(previous);
68
+ if (!Number.isSafeInteger(owner.pid) || owner.pid <= 0 || !uuid(owner.nonce)) throw new Error("Invalid report lock; inspect the local store.");
69
+ let gone = false;
70
+ try { process.kill(owner.pid, 0); } catch (error) { if (error.code === "ESRCH") gone = true; }
71
+ if (gone && readFileSync(lock, "utf8") === previous) rmSync(lock);
72
+ }catch(error){if(error instanceof SyntaxError)throw new Error("Report storage is busy or its lock is incomplete. Retry the same submission; inspect a persistent lock.");if(error.code!=="ENOENT")throw error;}
73
+ const token = JSON.stringify({ pid: process.pid, nonce: randomUUID() });
74
+ let fd;
75
+ try { fd = openSync(lock, "wx", 0o600); writeFileSync(fd, token); }
76
+ catch (error) { if(fd!==undefined)rmSync(lock,{force:true}); if (error.code === "EEXIST") throw new Error("Report storage is busy. Retry the same submission; duplicates reuse their report ID."); throw error; }
77
+ finally { if (fd !== undefined) closeSync(fd); }
78
+ return () => { if (readFileSync(lock, "utf8") === token) rmSync(lock); };
79
+ }
80
+ return {
81
+ submit(kind, args) {
82
+ if (!Object.hasOwn(schemas,kind)) throw new Error("Unknown report kind.");
83
+ const submission = schemas[kind].parse(args);
84
+ // Resolve exact evidence before writing. Superseded or fabricated IDs fail.
85
+ const evidence = submission.evidence.map(reference => ({ reference, snapshot: compactRow(resolveEvidence(reference), 4096) }));
86
+ const captured = compactRow(context(submission), 4096);
87
+ const { title, unit, scenario, expected, observed, steps, workflow, capability } = submission;
88
+ const normalized = value => typeof value === "string" ? value.replace(/\s+/g, " ").trim() : value;
89
+ const identity = JSON.parse(JSON.stringify({ kind, version: captured.ads?.version, framework: captured.framework, title, unit, scenario, expected, observed, steps, workflow, capability }), (_key, value) => normalized(value));
90
+ const fingerprint = digest(identity), release = acquire();
91
+ try {
92
+ const prior = headers().find(record => record.fingerprint === fingerprint), now = new Date().toISOString();
93
+ const record = { schemaVersion:1,id: prior?.id ?? randomUUID(), revision: randomUUID(), fingerprint, kind, createdAt: prior?.createdAt ?? now, updatedAt: now, submissionCount: (prior?.submissionCount ?? 0) + 1, submission, context: captured, evidence };
94
+ if (jsonBytes(record) > reportLimits.recordBytes) throw new Error("Report exceeds 32 KiB. Shorten the narrative/reproduction; reference existing evidence instead of pasting logs or files.");
95
+ const file=path.join(folder,`${record.id}.json`),bytes = JSON.stringify(record), temporary = path.join(folder, `${randomUUID()}.tmp`);
96
+ try { writeFileSync(temporary, bytes, { flag: "wx", mode: 0o600 }); renameSync(temporary, file); } finally { rmSync(temporary, { force: true }); }
97
+ return { ok: true, ...receipt(record), deduplicated: !!prior, retention:"until-explicit-removal", guidanceUri: "ads://guides/reporting" };
98
+ } finally { release(); }
99
+ },
100
+ };
101
+ }
@@ -6,7 +6,7 @@ import { z } from "zod";
6
6
  import { checkProject } from "../check.mjs";
7
7
  import { loadConfig, sourceFiles } from "../config.mjs";
8
8
  import { createVerificationController, BEHAVIOR_URI } from "../verification.mjs";
9
- import { INVESTIGATIONS_URI, investigationIndex, investigationPage, investigationSections, readInvestigationResource } from "../investigations.mjs";
9
+ import { INVESTIGATIONS_URI, investigationIndex, investigationPage, investigationSections, readInvestigation, readInvestigationResource } from "../investigations.mjs";
10
10
  import { failure } from "../evidence.mjs";
11
11
  import { inspectTokens } from "../tokens.mjs";
12
12
  import { inspectScenarios } from "../scenarios.mjs";
@@ -29,6 +29,9 @@ import { previewSourceRevision } from "../preview-inputs.mjs";
29
29
  import { createExecutionResults, RESULTS_URI, resultSections } from "./execution-results.mjs";
30
30
  import { behaviorPage, behaviorSections } from "./behavior-pages.mjs";
31
31
  import { compactProgress, resultBudgets } from "./result-pages.mjs";
32
+ import { createReportStore, bugReportSchema, featureRequestSchema } from "./reports.mjs";
33
+ import { createHash } from "node:crypto";
34
+ import { developmentRuntime } from "../development-runtime.mjs";
32
35
 
33
36
  const pkg = JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf8"));
34
37
  class InvalidParamsError extends ProtocolError {
@@ -63,6 +66,7 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
63
66
  const edits = cache.edits ??= createMutationController(root, { captures });
64
67
  const verification = cache.verification ??= createVerificationController(root);
65
68
  const executionResults = cache.executionResults ??= createExecutionResults(root);
69
+ const reports = cache.reports ??= createReportStore(root, { context: reportContext, resolveEvidence: reportEvidence });
66
70
  let options = loadConfig(root);
67
71
  const signature = `${root}:${JSON.stringify(options.config)}`;
68
72
  if (cache.signature !== signature) {
@@ -114,6 +118,31 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
114
118
  };
115
119
  const previews = () => options.config.mcp.apps.map((app) => ({ id: app.id, title: app.title, kind: app.kind, tool: `ads_show_${app.id.replaceAll("-", "_")}`, resourceUri: appUri(app.id), available: existsSync(path.resolve(root, app.file)), file: app.file }));
116
120
 
121
+ function reportContext(submission) {
122
+ const captured = { ads: { package: pkg.name, version: pkg.version }, capturedAt: new Date().toISOString(), framework: null,
123
+ runtime: { ...developmentRuntime(), platform: process.platform, arch: process.arch }, warnings: [] };
124
+ try { const current=loadConfig(root);captured.framework=current.config.framework;captured.configurationRevision=createHash("sha256").update(JSON.stringify(current.config)).digest("hex");captured.sourceRevision=previewSourceRevision(current); }
125
+ catch { captured.warnings.push("Current configuration/source revision could not be captured."); }
126
+ try{const projectPackage=JSON.parse(readFileSync(path.join(root,"package.json"),"utf8"));if(typeof projectPackage.name==="string")captured.project={name:projectPackage.name.slice(0,160)};}catch{captured.warnings.push("Project package name could not be captured.");}
127
+ try { const build=builds(),preview=build.previews?.find(item=>item.id===submission.scenario);captured.build={state:build.state,updatedAt:build.updatedAt,session:build.session,sequence:build.sequence,...(preview?{preview:{id:preview.id,state:preview.state,revision:preview.revision,current:preview.current,stale:preview.stale}}:{})}; }
128
+ catch { captured.warnings.push("Current build metadata could not be captured."); }
129
+ // Target names can describe an unaccepted draft; they are agent claims, not registrations.
130
+ if(submission.scenario)try{captured.scenarioRegistered=getRegistry().scenarios.some(item=>item.id===submission.scenario);}catch{captured.scenarioRegistered=null;}
131
+ if(submission.unit)try{captured.unitRegistered=edits.units().some(item=>item.id===submission.unit);}catch{captured.unitRegistered=null;}
132
+ return captured;
133
+ }
134
+ function reportEvidence(reference) {
135
+ if(reference.resultId)return JSON.parse(executionResults.readResource(`ads://results/${reference.resultId}`).text);
136
+ const bundle=readInvestigation(root,reference);
137
+ if(bundle.runId!==reference.runId)throw new Error("Investigation was superseded. Reference the exact current unit/check/runId or describe earlier observations without attaching unrelated evidence.");
138
+ const {unit,check,runId,status,target,inputRevision,observedPreviewRevision,framework,profile,completedAt,failure,source,failingStep,viewport,acceptance}=bundle;
139
+ return {unit,check,runId,status,target,inputRevision,observedPreviewRevision,framework,profile,completedAt,failure,source,failingStep,viewport,acceptance,
140
+ artifacts:(bundle.artifacts??[]).slice(0,3).map(({resourceUri,digest,mimeType,available})=>({resourceUri,digest,mimeType,available})),artifactsAreReferences:true};
141
+ }
142
+ function submitReport(kind,args) {
143
+ return json(reports.submit(kind,args));
144
+ }
145
+
117
146
  function resources() {
118
147
  const context = project();
119
148
  const documents = getDocuments();
@@ -122,6 +151,7 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
122
151
  return [
123
152
  { uri: GUIDE_URI, name: "Start here: design-system workflow", description: "Read first for UI/ADS tasks, especially when only resource access is exposed. Explains the exact workspace, tool sequence, skill selection, previews, project commands and fallback.", mimeType: "text/markdown" },
124
153
  { uri: "ads://guides/behaviors", name: "Controller and behavioral verification guide", mimeType: "text/markdown" },
154
+ { uri: "ads://guides/runtimes", name: "Node and Bun setup, compiler and verification runtime", mimeType: "text/markdown" },
125
155
  { uri: "ads://guides/evidence", name: "Failure boundaries and compact investigations", mimeType: "text/markdown" },
126
156
  { uri: "ads://guides/atomic-styles", name: "Atomic styles: composition conflicts and custom-property extraction", mimeType: "text/markdown" },
127
157
  { uri: "ads://guides/scenarios", name: "Scenario coverage and public class-helper contracts", mimeType: "text/markdown" },
@@ -142,6 +172,8 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
142
172
  // Keep fallback workflow metadata discoverable in the bounded first page.
143
173
  ...skills.skills.map(({ uri, frontmatter }) => ({ uri, name: frontmatter.name, description: frontmatter.description, mimeType: "text/markdown" })),
144
174
  ...documents.filter(document => promoted.has(document.uri)).sort((a, b) => Number(b.uri === context.publicEntryUri) - Number(a.uri === context.publicEntryUri)).map(({ file: _file, ...document }) => document),
175
+ { uri: "ads://guides/tokens", name: "Shared Data and component variable boundaries", mimeType: "text/markdown" },
176
+ { uri: "ads://guides/reporting", name: "Report suspected ADS bugs and feature requests", mimeType: "text/markdown" },
145
177
  { uri: TOKENS_APP_URI, name: "Experimental token widget", mimeType: APP_MIME },
146
178
  { uri: SCENARIO_APP_URI, name: "Experimental scenario widget", mimeType: APP_MIME },
147
179
  ...(options.config.mcp.previewManifest ? [{ uri: PREVIEW_APP_URI, name: "Shared-resource preview App", mimeType: APP_MIME }, { uri: PREVIEW_MANIFEST_URI, name: "Preview dependency graph", mimeType: "application/json" }] : []),
@@ -165,12 +197,16 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
165
197
  scenarios: { count: getRegistry().scenarios.length, diagnostics: getRegistry().diagnostics, resourceUri: `${PROJECT_URI}/scenarios`, tool: "ads_show_scenario" },
166
198
  behaviors: { resourceUri: BEHAVIOR_URI, discoveryTool: "ads_behaviors", verificationTool: "ads_verify", investigationTool: "ads_investigate", investigationResourceUri: INVESTIGATIONS_URI, ...behaviorState, progress: compactProgress(behaviorState.progress), lastResult: executionResults.latest("verification"), resultsTool: "ads_results", resultsResourceUri: RESULTS_URI },
167
199
  captures: { resourceUri: CAPTURES_URI, tool: "ads_capture", clearTool: "ads_capture_clear", ...captures.status() },
200
+ reports: { access:"submission-only", storageDirectory:".ds/reports", bugTool:"ads_report_bug", featureTool:"ads_request_feature", guidanceUri:"ads://guides/reporting", delivery:"local-only", retention:"until-explicit-removal" },
168
201
  experimental: { apps: true, nativeSkills: era === "modern", nativeSkillActivation: "host-controlled" } };
169
202
  }
170
203
  async function read(uri, signal) {
171
204
  if (uri === GUIDE_URI) return { contents: [{ uri, mimeType: "text/markdown", text: projectGuide(project(), [...previews(), ...scenarioApps()]) }] };
172
- if (uri === "ads://guides/behaviors") return { contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL("../../docs/BEHAVIORS.md", import.meta.url), "utf8") }] };
205
+ if (uri === "ads://guides/behaviors") return { contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL("../skills/ads-designer/references/behaviors.md", import.meta.url), "utf8") }] };
206
+ if (uri === "ads://guides/runtimes") return { contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL("../skills/ads-designer/references/runtimes.md", import.meta.url), "utf8") }] };
173
207
  if (uri === "ads://guides/evidence") return { contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL("../skills/ads-designer/references/evidence.md", import.meta.url), "utf8") }] };
208
+ if (uri === "ads://guides/tokens") return { contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL("../skills/ads-designer/references/design-data.md", import.meta.url), "utf8") }] };
209
+ if (uri === "ads://guides/reporting") return { contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL("../skills/ads-designer/references/reporting.md", import.meta.url), "utf8") }] };
174
210
  if (uri === "ads://guides/atomic-styles") return { contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL("../skills/ads-designer/references/atomic-styles.md", import.meta.url), "utf8") }] };
175
211
  if (uri === "ads://guides/scenarios") return { contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL("../skills/ads-designer/references/scenarios.md", import.meta.url), "utf8") }] };
176
212
  if (uri === "ads://guides/layers") return { contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL("../skills/ads-designer/references/layers.md", import.meta.url), "utf8") }] };
@@ -282,7 +318,7 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
282
318
  const result = checkProject(root);
283
319
  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` });
284
320
  } },
285
- { name: "ads_skills", description: "Select one ADS workflow after ads_status: ads-designer for building/refining/debugging UI; ads-migrate 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 })) }) },
321
+ { 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 })) }) },
286
322
  { 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 }) => {
287
323
  const skill = skills.skills.find((entry) => entry.frontmatter.name === name);
288
324
  if (!skill) throw new Error("Unknown ADS skill name.");
@@ -310,6 +346,8 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
310
346
  } },
311
347
  { name: "ads_behaviors", description: "Discover behavior owners, then page an exact unit's checks, guarantees, subjects, demonstrations or profiles. Summary listings never embed runner logs. Default 10/max 20 entries and 8 KiB JSON per page; continue with nextCursor and identical filters. Cursors expire when discovery/evidence changes. Read sourceFile with ads_read_file for a complete contract. Metadata and reachable calls do not prove execution; use ads_verify for registered checks.", schema: z.object({ query: z.string().max(200).optional(), unit: z.string().min(1).max(256).optional(), api: z.string().max(200).optional(), section: z.enum(behaviorSections).optional(), ...paged }).strict(), call: args => json(behaviorPage(options,args)) },
312
348
  { name: "ads_results", title: "Read execution outcomes", description: "Read saved ads_verify/ads_apply_patch/ads_apply_transaction outcomes without rerunning anything. Pass the returned resultId; select outcomes, checks, diagnostics, advisories, warnings, changes, captures, acceptance, investigation or selection. Default 10/max 20 rows, at most 8 KiB JSON per page. Follow nextCursor with identical section/status. Rows marked detailTruncated can be read in full using recordIndex and offset/chars (max 2000); follow nextOffset. Only the latest verification and mutation snapshots are retained; replaced IDs fail explicitly. For one outcome's browser evidence use ads_investigate with its exact unit/check/runId.", schema: z.object({ resultId: z.string().uuid(), section: z.enum(resultSections).optional(), status: z.enum(["all","passed","not_passed"]).optional(), ...paged, ...recordRange }).strict(), call: args => json(executionResults.page(args)) },
349
+ { 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) },
350
+ { 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) },
313
351
  { 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. Only the latest bundle per check is retained, 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)) },
314
352
  { 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) => {
315
353
  const result = await verification.run(args, signal, progress);