@reqvire-org/ads 0.3.12 → 0.3.13

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 (41) hide show
  1. package/README.md +20 -1
  2. package/dist/capture/worker.mjs +38 -0
  3. package/dist/capture-store.mjs +123 -0
  4. package/dist/capture.mjs +117 -0
  5. package/dist/config.mjs +6 -1
  6. package/dist/mcp/context.mjs +1 -1
  7. package/dist/mcp/mutations.mjs +25 -5
  8. package/dist/mcp/server.mjs +62 -15
  9. package/dist/scenarios.mjs +9 -3
  10. package/dist/showcase/client.bundle.js +18 -18
  11. package/dist/showcase/style.css +2 -0
  12. package/dist/skills/ads-break-ui/SKILL.md +6 -1
  13. package/dist/skills/ads-break-ui/references/captures.md +147 -0
  14. package/dist/skills/ads-break-ui/references/guarded-editing.md +58 -0
  15. package/dist/skills/ads-break-ui/references/scenarios.md +5 -0
  16. package/dist/skills/ads-designer/SKILL.md +6 -1
  17. package/dist/skills/ads-designer/references/captures.md +147 -0
  18. package/dist/skills/ads-designer/references/guarded-editing.md +58 -0
  19. package/dist/skills/ads-designer/references/scenarios.md +5 -0
  20. package/dist/skills/ads-import/SKILL.md +6 -1
  21. package/dist/skills/ads-import/references/captures.md +147 -0
  22. package/dist/skills/ads-import/references/guarded-editing.md +58 -0
  23. package/dist/skills/ads-import/references/scenarios.md +5 -0
  24. package/dist/skills/ads-migrate/SKILL.md +6 -1
  25. package/dist/skills/ads-migrate/references/captures.md +147 -0
  26. package/dist/skills/ads-migrate/references/guarded-editing.md +58 -0
  27. package/dist/skills/ads-migrate/references/scenarios.md +5 -0
  28. package/dist/skills/ads-motion/SKILL.md +6 -1
  29. package/dist/skills/ads-motion/references/captures.md +147 -0
  30. package/dist/skills/ads-motion/references/guarded-editing.md +58 -0
  31. package/dist/skills/ads-motion/references/scenarios.md +5 -0
  32. package/dist/verification/browser.mjs +8 -3
  33. package/dist/verification/playwright-reporter.cjs +23 -8
  34. package/dist/verification.mjs +137 -33
  35. package/docs/ADS.md +5 -0
  36. package/docs/ARCHITECTURE.md +39 -2
  37. package/docs/BEHAVIORS.md +57 -3
  38. package/docs/CHANGELOG.md +17 -0
  39. package/docs/GUIDE.md +48 -1
  40. package/docs/MCP.md +49 -1
  41. package/package.json +1 -1
package/docs/GUIDE.md CHANGED
@@ -5,7 +5,54 @@ contains a Node CLI, shared token contract, static checks, an Oxlint plugin, and
5
5
  empty foundation scaffolding. It includes no component or pattern catalogue,
6
6
  fonts, mock screens, or UI runtime dependency.
7
7
 
8
-
8
+ ## Use ADS through MCP
9
+
10
+ Connect your coding agent using the [MCP client setup](MCP.md#connect-codex-or-claude).
11
+ The client launches `ads mcp` in your project; add `--mutations` to enable guarded
12
+ source editing. Initialization also supplies `ads-mcp` and `ads-read-mcp` launch
13
+ scripts. The server starts its showcase and configured preview compiler, so use
14
+ the returned showcase URL rather than starting a separate preview application.
15
+
16
+ An agent uses the MCP tools to inspect, edit and review the project:
17
+
18
+ 1. Call `ads_status` to identify the connected project, available commands,
19
+ mutation mode, showcase URL and build freshness.
20
+ 2. Find public UI/behavior APIs with `ads_catalog`, inspect relevant definitions
21
+ with `ads_tokens`, and discover preview IDs with `ads_scenarios`. Read one
22
+ relevant workflow through `ads_skills` and `ads_read_skill` before editing.
23
+ 3. Open a discovered preview with `ads_show_scenario` or `ads_show_tokens`. These
24
+ render the project's actual scenario, fixtures and adapter through MCP Apps.
25
+ Use the returned showcase link when the client cannot render Apps.
26
+ 4. When editing is enabled, discover ownership with `ads_units`, read relevant
27
+ source through `ads_read_file`, and submit an owner Git patch through
28
+ `ads_apply_patch`. Use `ads_apply_transaction` for genuinely coupled owners.
29
+ Prepare/diff a local draft with `ads_prepare_patch` when useful. Dry-run first;
30
+ ADS checks an isolated candidate before any live source is written.
31
+ 5. Review diagnostics, registered behavior evidence and the rendered result.
32
+ `ads_behaviors` discovers guarantees; `ads_verify` executes selected registered
33
+ checks. Recheck `ads_status.build` after changes; notifications alone do not
34
+ establish current output.
35
+
36
+ For an on-demand screenshot, call `ads_capture` with a discovered scenario ID and
37
+ optionally a named `captureTargets` element, theme and viewport. To compare a
38
+ proposed change before applying it, add `screenshot:true` and an explicit
39
+ `captures:[{scenario:"<discovered ID>"}]` selection to the patch/transaction dry run.
40
+ Normal patches and dry runs create no screenshots. Capture uses project-installed
41
+ Playwright and its browser; ADS installs neither.
42
+
43
+ Read `ads://project/captures` and the returned PNG image URIs through MCP
44
+ `resources/read`. Each target keeps only current and candidate: a successful
45
+ standalone screenshot replaces current and clears candidate; a screenshot-enabled
46
+ dry run replaces the pair; applying matching source promotes candidate. Source
47
+ changes mark images stale. There is no previous slot, history or TTL.
48
+ `ads_capture_clear` discards candidate or clears both images. Subscribe to resource
49
+ updates when supported, and explicitly reread otherwise. Screenshots provide visual
50
+ evidence for one state; they do not replace behavior checks.
51
+
52
+ The [MCP guide](MCP.md) details tool/resource schemas, prompts, skills and
53
+ notifications. The portable [capture guide](../skills/ads-designer/references/captures.md)
54
+ explains screenshot setup, named targets, limits and comparison usage; MCP serves
55
+ the same guide at `ads://guides/captures`.
9
56
 
10
57
  ## Implementation support
11
58
 
package/docs/MCP.md CHANGED
@@ -177,6 +177,8 @@ The server supplies agent guidance through its instructions, tool descriptions,
177
177
  | `ads_show_scenario` | Render an exact discovered scenario with its own fixtures |
178
178
  | `ads_behaviors` | Bounded guarantee/evidence discovery; pass an exact unit for contract details |
179
179
  | `ads_verify` | Execute an owner's registered checks and record revision-bound evidence |
180
+ | `ads_capture` | On-demand PNG of a discovered scenario or named element; replace current and clear candidate |
181
+ | `ads_capture_clear` | Remove generated captures or discard only the candidate |
180
182
  | `ads_show_<id>` | Optional explicitly configured grouped App |
181
183
  | `ads_units` | Discover edit owners and the files belonging to one unit |
182
184
  | `ads_prepare_patch` | Prepare a local draft of one owner, then generate its Git patch |
@@ -212,6 +214,36 @@ informational limit nor a traced target proves a rendered failure or success.
212
214
  Bounded check results put warnings before informational limits; the checks
213
215
  resource retains complete results.
214
216
 
217
+ ### Screenshots and candidate comparison
218
+
219
+ `ads_capture({scenario:"<discovered ID>",target?,theme?,viewport?})` renders current
220
+ source in the real sandboxed App using project-local Playwright/browser. It returns
221
+ PNG resource URIs and revision/settings metadata. The default is the full widget
222
+ viewport; optional `captureTargets` metadata names an element within the scenario.
223
+ Token/component/pattern/composition scenarios share this path. The tool adds no
224
+ project-specific renderer or fixture assumptions.
225
+
226
+ Patch and transaction dry runs accept `screenshot:true` plus an explicit 1–8-entry
227
+ `captures:[{scenario,target?,theme?,viewport?}]` selection. Existing gates run first;
228
+ current and candidate use matching capture settings. Source/conflict checks remain
229
+ mandatory. No screenshots are created by ordinary patches/dry runs. A newly added
230
+ scenario has a candidate with an explicit absent current baseline.
231
+
232
+ `ads://project/captures` lists current/candidate slots, metadata and freshness.
233
+ Read returned `ads://captures/{key}/{slot}` resources as `image/png` binary content;
234
+ the resource template is advertised without per-revision catalogue growth.
235
+ Subscriptions receive `resources/updated` for replacement/removal. Successful
236
+ standalone capture replaces current and clears any prior candidate. Applying
237
+ matching proposed source promotes candidate; explicit `ads_capture_clear` can
238
+ discard the candidate or both slots. There is no previous/history/TTL. Source
239
+ changes mark stale images; deleted targets are collected. Capture data is bounded
240
+ generated output under `.ds/captures/`, not a source mutation or behavior pass.
241
+
242
+ Optional `mcp.capture` selects browser, Chromium channel and runner timeout.
243
+ ADS installs no browser dependencies. See `ads://guides/captures` or the portable
244
+ [capture reference](../skills/ads-designer/references/captures.md) for setup, precise
245
+ limits, target declarations and the guarded review workflow.
246
+
215
247
  ### Behavioral verification
216
248
 
217
249
  Read `ads://guides/behaviors` or the [behavior guide](BEHAVIORS.md) for the contract
@@ -229,6 +261,15 @@ Missing/skipped cases, unavailable runners and changed inputs cannot pass.
229
261
  Results and subscribed resource notifications are available through
230
262
  `ads://project/behaviors`; explicitly re-read evidence when notifications are absent.
231
263
 
264
+ During a run, `ads_status.behaviors.progress` exposes completed/active/pending
265
+ checks, timings and the profile's whole-run timeout. Candidate mutation checks use
266
+ `ads_status.mutations.progress`. Requested MCP progress notifications also report
267
+ runner activity. Playwright uses the project's workers and filters selected case
268
+ tags; ADS does not silently change timeout or parallelism policy. Timeout results
269
+ retain partial outcomes and reports under `.ds/verification/`, but incomplete
270
+ runs still block application and cannot establish passing guarantees. See the
271
+ [runner and evidence details](BEHAVIORS.md#register-execution-profiles).
272
+
232
273
  Browser profiles start an isolated showcase and verify its sandboxed App using
233
274
  the selected candidate's sources. StrictMode profiles need a project React
234
275
  development harness. Profiles describe the execution environment, not a proof
@@ -361,7 +402,14 @@ directory containing only the owner and declared companions. Edit that directory
361
402
  using the client's local file tools, then call
362
403
  `ads_prepare_patch({unit, action:"diff", draft})`. It checks source/baseline
363
404
  freshness and owner paths and returns a `patchFile`; it changes no live source.
364
- Apply the result through `ads_apply_patch`, which runs the normal candidate gates.
405
+ Pass that `patchFile` to `ads_apply_patch` with `dryRun:true` to validate before
406
+ applying. This runs the normal candidate gates, including affected registered
407
+ behavior checks against an isolated candidate and its configured browser preview.
408
+ It writes no live source and does not persist passing evidence for live inputs.
409
+ Read returned `behavior` failures or behavior-check results in `checks`; update the
410
+ draft, diff again and repeat as needed. Apply with `dryRun:false` after validation;
411
+ the gates run again. `ads_verify({unit,checks?})` checks current source and accepts
412
+ no draft argument; a selected-check draft runner is not currently exposed.
365
413
  Use `action:"discard"` to remove the draft. Remote clients can continue sending
366
414
  inline Git diffs. Drafts are local conveniences, not an alternative mutation API.
367
415
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reqvire-org/ads",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "type": "module",
5
5
  "description": "A design system your agent can see and shape. Your components. Your look. Your code.",
6
6
  "repository": {