@reqvire-org/ads 0.3.32 → 0.3.33

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 (56) hide show
  1. package/README.md +9 -0
  2. package/dist/bootstrap-ds/vite.config.ts +2 -1
  3. package/dist/boundaries.mjs +2 -0
  4. package/dist/capture.mjs +5 -3
  5. package/dist/config.mjs +5 -2
  6. package/dist/draft-boundary.mjs +27 -0
  7. package/dist/draft-workspace.mjs +10 -0
  8. package/dist/lint-config.mjs +1 -0
  9. package/dist/mcp/context.mjs +2 -2
  10. package/dist/mcp/draft-exports.mjs +40 -0
  11. package/dist/mcp/drafts.mjs +341 -0
  12. package/dist/mcp/edit-preparation.mjs +8 -7
  13. package/dist/mcp/execution-results.mjs +2 -0
  14. package/dist/mcp/mutations.mjs +6 -2
  15. package/dist/mcp/preview-watch.mjs +11 -3
  16. package/dist/mcp/preview-widget.bundle.js +13 -13
  17. package/dist/mcp/prompts.mjs +3 -2
  18. package/dist/mcp/server.mjs +75 -18
  19. package/dist/mcp/widget.bundle.js +1 -1
  20. package/dist/preview-files.mjs +2 -0
  21. package/dist/scenarios-compiler.mjs +2 -0
  22. package/dist/scenarios-vite.d.mts +1 -0
  23. package/dist/scenarios-vite.mjs +1 -0
  24. package/dist/showcase/client.bundle.js +43 -43
  25. package/dist/showcase/comparison.js +21 -0
  26. package/dist/showcase/index.html +2 -1
  27. package/dist/showcase/style.css +5 -0
  28. package/dist/skills/README.md +5 -0
  29. package/dist/skills/ads-break-ui/SKILL.md +26 -0
  30. package/dist/skills/ads-break-ui/references/captures.md +7 -0
  31. package/dist/skills/ads-break-ui/references/drafts.md +107 -0
  32. package/dist/skills/ads-break-ui/references/guarded-editing.md +6 -0
  33. package/dist/skills/ads-designer/SKILL.md +26 -0
  34. package/dist/skills/ads-designer/assets/bootstrap-ds/vite.config.ts +2 -1
  35. package/dist/skills/ads-designer/references/captures.md +7 -0
  36. package/dist/skills/ads-designer/references/drafts.md +107 -0
  37. package/dist/skills/ads-designer/references/guarded-editing.md +6 -0
  38. package/dist/skills/ads-import/SKILL.md +26 -0
  39. package/dist/skills/ads-import/references/captures.md +7 -0
  40. package/dist/skills/ads-import/references/drafts.md +107 -0
  41. package/dist/skills/ads-import/references/guarded-editing.md +6 -0
  42. package/dist/skills/ads-motion/SKILL.md +26 -0
  43. package/dist/skills/ads-motion/references/captures.md +7 -0
  44. package/dist/skills/ads-motion/references/drafts.md +107 -0
  45. package/dist/skills/ads-motion/references/guarded-editing.md +6 -0
  46. package/dist/skills/ads-port/SKILL.md +26 -0
  47. package/dist/skills/ads-port/references/captures.md +7 -0
  48. package/dist/skills/ads-port/references/drafts.md +107 -0
  49. package/dist/skills/ads-port/references/guarded-editing.md +6 -0
  50. package/docs/ADS.md +13 -0
  51. package/docs/ARCHITECTURE.md +12 -0
  52. package/docs/CHANGELOG.md +19 -0
  53. package/docs/CONTRACTS.md +8 -0
  54. package/docs/GUIDE.md +17 -5
  55. package/docs/MCP.md +50 -0
  56. package/package.json +1 -1
@@ -0,0 +1,107 @@
1
+ # Tracked drafts and auto-mode acceptance
2
+
3
+ Use this workflow for iterative design changes. Auto mode means the agent reviews
4
+ the rendered result and accepts it; it does not introduce a human approval gate.
5
+ Human acceptance controls are not part of this version.
6
+
7
+ ## Complete a coherent design change
8
+
9
+ A unit of design work can span several components, a pattern or an entire view.
10
+ Do not finish that work with its intended changes left only in drafts. Review,
11
+ validate and accept all required drafts before reporting the change complete.
12
+ Accept dependency drafts first, then review their dependents again. If checks or
13
+ baseline conflicts block acceptance, fix them and continue. If progress requires
14
+ missing user input or an external change, report the work as unfinished, with the
15
+ exact draft and blocker. Never silently drop requested work or accept a failing
16
+ draft to meet this completion rule. Leave a draft intentionally only when the
17
+ user asks to retain a proposal for later review.
18
+
19
+ ## Source and lifecycle
20
+
21
+ `ads_create_draft({units:["components/Button"], title:"Button spacing"})` creates
22
+ `ads-drafts/<id>/proposal.ads.draft.json` and `.ads` draft sources.
23
+ For example, `Button.tsx.ads` maps to the normal `Button.tsx` target. The final
24
+ `.ads` extension keeps proposed code out of default TypeScript/lint discovery,
25
+ without editing project tsconfig files. The manifest remains
26
+ `proposal.ads.draft.json`. These are ordinary tracked project files: commit them and review them in a PR.
27
+ Git is not required to create or recover a draft. Restarting ADS or cloning the
28
+ project discovers the same source. Generated compiler workspaces and execution
29
+ events remain under ignored `.ds/`; an interrupted check is never a pass.
30
+
31
+ The manifest maps each proposed file to its normal project target and records
32
+ its baseline fingerprint and owner. Edit returned source files with local file
33
+ tools. `ads_read_file` reads mapped draft source in bounded ranges.
34
+ `ads_update_draft` registers additions/deletions or edits source for remote
35
+ clients; pass the current revision from `ads_drafts`. `content:null` proposes a
36
+ deletion. Binary content uses `encoding:"base64"`; acceptance uses Git's existing
37
+ binary patch support. Do not edit accepted source to iterate a proposal.
38
+
39
+ `ads_drafts` lists only drafts. Filter by unit/query, page with offset/limit, or
40
+ pass id to inspect file mappings. Catalogue and scenario entries expose their
41
+ draft references. `ads_tokens` also lists tokenGroups derived from token CSS
42
+ files. For a group draft, create `{units:["tokens"],tokenGroups:["colors"]}` using
43
+ the actual returned IDs. Shared tokens remain owned by `tokens`; groups do not
44
+ create component-local value catalogues.
45
+
46
+ ## Preview and dependencies
47
+
48
+ Call `ads_show_draft({id,scenario?})`, then inspect its actual `showcaseUrl` in a
49
+ browser. The preview reuses an isolated compiler workspace across edits and does
50
+ not run acceptance checks. Up to four draft compiler sessions stay warm; opening
51
+ more reclaims an older generated workspace without deleting its tracked proposal.
52
+ Reopen after edits to obtain the current revision.
53
+ Compilation is feedback, not passing behavior/visual evidence.
54
+
55
+ For model-visible images, use `ads_capture({scenario,draft:id,revision,...settings})`
56
+ and read the returned PNG resource URIs. This captures Accepted/current and
57
+ Draft/candidate without acceptance checks; new scenarios have only a candidate.
58
+ The candidate records the exact proposal revision. Edits during capture prevent
59
+ publication of its image slots. Captures establish appearance at those settings,
60
+ not passing acceptance or behavioral checks.
61
+
62
+ A pattern draft may use a component draft; a composition may use component,
63
+ pattern and token drafts. Declare their IDs in `dependencies` when creating or
64
+ updating the dependent draft. Keep normal `@ds` imports in all implementations
65
+ and scenarios. The preview overlays the proposed files at canonical paths; no
66
+ project code imports `.ads` draft source. Cycles, missing dependencies and
67
+ overlapping non-barrel edits are errors. Use one coupled draft for overlapping
68
+ changes. A coupled draft may declare up to eight existing/new owners.
69
+
70
+ Accept dependencies first. ADS removes resolved dependency IDs from dependent
71
+ manifests and their previews use the final accepted implementation automatically.
72
+ Independent shared-barrel exports are merged; overlapping source changes remain
73
+ explicit conflicts. Review the dependent's new revision before accepting it.
74
+ If a dependency is dropped, correct the remaining draft's dependency list.
75
+
76
+ DS Explorer has a Drafts section and draft badges. Its header Split view toggle
77
+ compares Accepted and Draft in the right pane, preserving navigation. Both use
78
+ the same scenario/theme and available or phone viewport width. New scenarios
79
+ without an accepted counterpart show only the draft and disable comparison.
80
+
81
+ ## Accept or drop
82
+
83
+ After rendered review, call `ads_accept({id,revision})` once. It checks that exact
84
+ revision, runs mandatory ADS/registered Oxlint/project checks and affected
85
+ behavior checks against an isolated candidate, and applies passing changes at
86
+ their normal paths. Changes during checking or baseline conflicts prevent
87
+ application. Successful acceptance removes the proposal and records an event.
88
+ There is no separate Apply or Iterate action. A failed attempt retains the draft;
89
+ inspect its returned resultId with `ads_results` and fix the reported boundary.
90
+
91
+ `ads_drop_draft({id,revision})` deletes a proposal and its generated preview,
92
+ without changing accepted source. Drop replaces a separate refusal action.
93
+ Read `ads_status.drafts`, `ads_drafts.events` or `ads://project/drafts` to observe
94
+ decisions. Resource notifications are available, but the host may not wake an
95
+ agent; always use the returned outcome or persisted status as the fallback.
96
+
97
+ ## Build isolation
98
+
99
+ Draft presence alone must not fail an application build. Drafts are excluded from
100
+ normal ADS discovery and validation inputs. ADS import guards reject direct,
101
+ aliased, re-exported, dynamic and symlink imports of marked files or ads-drafts/,
102
+ including attempts from scenarios/tests outside the isolated preview overlay.
103
+ Install `draftImportGuard()` from `@reqvire-org/ads/scenarios/vite` in application
104
+ Vite/Rollup builds as well as keeping the mandatory ADS check/build pipeline.
105
+ It rejects resolved draft modules and glob-expanded module loads. Merely adding a
106
+ TypeScript exclude pattern is not an import boundary. Do not export drafts, add
107
+ production aliases to them, or copy draft storage into published assets.
@@ -1,5 +1,11 @@
1
1
  # Advanced guarded editing
2
2
 
3
+ For iterative design, prefer the [tracked auto-mode draft workflow](drafts.md):
4
+ ordinary edits and fast previews, then exact-revision acceptance. Complete a
5
+ coherent change by accepting its required drafts, or report it as unfinished.
6
+ The disposable `.ds/patch-drafts/` copies described below are low-level patch
7
+ staging for focused repairs and migrations, not tracked review proposals.
8
+
3
9
  Use `ads_apply_patch` for independent owner edits. `ads_prepare_patch` can create a
4
10
  local draft of one owner and its companions; edit that directory with local file
5
11
  tools, request `action:"diff"`, then apply the returned patchFile. Discard the
@@ -3,6 +3,32 @@ name: ads-port
3
3
  description: "Port existing library components into a coherent project-owned ADS, reusing shared tokens and primitives while preserving required behavior. Use for native adaptation from a library URL, with reference comparison and provenance; not dependency installation or wrapping."
4
4
  ---
5
5
 
6
+ ## Auto-mode tracked drafts
7
+
8
+ For iterative design work, read [tracked drafts](references/drafts.md) and use
9
+ `ads_create_draft` → ordinary edits → `ads_show_draft` → rendered review →
10
+ `ads_accept({id,revision})`. Use `ads_drafts` to find pending proposals and their
11
+ current revisions; catalogue entries mark owners with drafts. Enable mutations
12
+ for acceptance. The low-level guarded patch workflow below remains available for
13
+ focused repairs/migrations; it does not replace the draft preview loop.
14
+
15
+ A coherent design change may span multiple components, patterns or an entire
16
+ view. **Do not report that change complete while its intended work exists only
17
+ in drafts.** Validate and accept its required drafts, accepting dependencies
18
+ first and reviewing dependents again after promotion. If acceptance is blocked,
19
+ continue fixing it or report the exact unfinished draft/blocker. Retain a
20
+ proposal for later only when the user requests that outcome; never silently drop
21
+ requested work or bypass failed checks. Auto mode requires agent review, not a
22
+ new human confirmation step.
23
+
24
+ Drafts live in tracked `ads-drafts/` with `.ads` source. Pattern and
25
+ composition previews may depend on component/pattern/token drafts through normal
26
+ `@ds` imports in an isolated overlay. Accepting a dependency automatically switches
27
+ dependent drafts to its final implementation. Never import `.ads` draft files
28
+ into application or accepted ADS code. Shared token drafts support discovered
29
+ groups from `ads_tokens.tokenGroups`; they remain owned by `tokens`.
30
+
31
+
6
32
  For validation scope, full audits, and CLI/MCP parity, read
7
33
  [validation.md](references/validation.md).
8
34
 
@@ -1,5 +1,12 @@
1
1
  # On-demand visual captures
2
2
 
3
+ For a [tracked draft](drafts.md), pass `draft` and its exact `revision` to
4
+ `ads_capture`. Accepted/current and Draft/candidate images use warm preview hosts
5
+ without running draft acceptance checks. The candidate records the proposal
6
+ revision; changed inputs prevent publication. Read the returned PNG resources
7
+ for model-visible review before `ads_accept`. Compilation/screenshots alone do
8
+ not establish behavioral or acceptance evidence.
9
+
3
10
  Use captures when reviewing appearance or a proposed visual change. Discover exact
4
11
  scenario IDs with `ads_scenarios`; these are project-owned independently mountable
5
12
  token, component, pattern and composition views. A component export alone is not
@@ -0,0 +1,107 @@
1
+ # Tracked drafts and auto-mode acceptance
2
+
3
+ Use this workflow for iterative design changes. Auto mode means the agent reviews
4
+ the rendered result and accepts it; it does not introduce a human approval gate.
5
+ Human acceptance controls are not part of this version.
6
+
7
+ ## Complete a coherent design change
8
+
9
+ A unit of design work can span several components, a pattern or an entire view.
10
+ Do not finish that work with its intended changes left only in drafts. Review,
11
+ validate and accept all required drafts before reporting the change complete.
12
+ Accept dependency drafts first, then review their dependents again. If checks or
13
+ baseline conflicts block acceptance, fix them and continue. If progress requires
14
+ missing user input or an external change, report the work as unfinished, with the
15
+ exact draft and blocker. Never silently drop requested work or accept a failing
16
+ draft to meet this completion rule. Leave a draft intentionally only when the
17
+ user asks to retain a proposal for later review.
18
+
19
+ ## Source and lifecycle
20
+
21
+ `ads_create_draft({units:["components/Button"], title:"Button spacing"})` creates
22
+ `ads-drafts/<id>/proposal.ads.draft.json` and `.ads` draft sources.
23
+ For example, `Button.tsx.ads` maps to the normal `Button.tsx` target. The final
24
+ `.ads` extension keeps proposed code out of default TypeScript/lint discovery,
25
+ without editing project tsconfig files. The manifest remains
26
+ `proposal.ads.draft.json`. These are ordinary tracked project files: commit them and review them in a PR.
27
+ Git is not required to create or recover a draft. Restarting ADS or cloning the
28
+ project discovers the same source. Generated compiler workspaces and execution
29
+ events remain under ignored `.ds/`; an interrupted check is never a pass.
30
+
31
+ The manifest maps each proposed file to its normal project target and records
32
+ its baseline fingerprint and owner. Edit returned source files with local file
33
+ tools. `ads_read_file` reads mapped draft source in bounded ranges.
34
+ `ads_update_draft` registers additions/deletions or edits source for remote
35
+ clients; pass the current revision from `ads_drafts`. `content:null` proposes a
36
+ deletion. Binary content uses `encoding:"base64"`; acceptance uses Git's existing
37
+ binary patch support. Do not edit accepted source to iterate a proposal.
38
+
39
+ `ads_drafts` lists only drafts. Filter by unit/query, page with offset/limit, or
40
+ pass id to inspect file mappings. Catalogue and scenario entries expose their
41
+ draft references. `ads_tokens` also lists tokenGroups derived from token CSS
42
+ files. For a group draft, create `{units:["tokens"],tokenGroups:["colors"]}` using
43
+ the actual returned IDs. Shared tokens remain owned by `tokens`; groups do not
44
+ create component-local value catalogues.
45
+
46
+ ## Preview and dependencies
47
+
48
+ Call `ads_show_draft({id,scenario?})`, then inspect its actual `showcaseUrl` in a
49
+ browser. The preview reuses an isolated compiler workspace across edits and does
50
+ not run acceptance checks. Up to four draft compiler sessions stay warm; opening
51
+ more reclaims an older generated workspace without deleting its tracked proposal.
52
+ Reopen after edits to obtain the current revision.
53
+ Compilation is feedback, not passing behavior/visual evidence.
54
+
55
+ For model-visible images, use `ads_capture({scenario,draft:id,revision,...settings})`
56
+ and read the returned PNG resource URIs. This captures Accepted/current and
57
+ Draft/candidate without acceptance checks; new scenarios have only a candidate.
58
+ The candidate records the exact proposal revision. Edits during capture prevent
59
+ publication of its image slots. Captures establish appearance at those settings,
60
+ not passing acceptance or behavioral checks.
61
+
62
+ A pattern draft may use a component draft; a composition may use component,
63
+ pattern and token drafts. Declare their IDs in `dependencies` when creating or
64
+ updating the dependent draft. Keep normal `@ds` imports in all implementations
65
+ and scenarios. The preview overlays the proposed files at canonical paths; no
66
+ project code imports `.ads` draft source. Cycles, missing dependencies and
67
+ overlapping non-barrel edits are errors. Use one coupled draft for overlapping
68
+ changes. A coupled draft may declare up to eight existing/new owners.
69
+
70
+ Accept dependencies first. ADS removes resolved dependency IDs from dependent
71
+ manifests and their previews use the final accepted implementation automatically.
72
+ Independent shared-barrel exports are merged; overlapping source changes remain
73
+ explicit conflicts. Review the dependent's new revision before accepting it.
74
+ If a dependency is dropped, correct the remaining draft's dependency list.
75
+
76
+ DS Explorer has a Drafts section and draft badges. Its header Split view toggle
77
+ compares Accepted and Draft in the right pane, preserving navigation. Both use
78
+ the same scenario/theme and available or phone viewport width. New scenarios
79
+ without an accepted counterpart show only the draft and disable comparison.
80
+
81
+ ## Accept or drop
82
+
83
+ After rendered review, call `ads_accept({id,revision})` once. It checks that exact
84
+ revision, runs mandatory ADS/registered Oxlint/project checks and affected
85
+ behavior checks against an isolated candidate, and applies passing changes at
86
+ their normal paths. Changes during checking or baseline conflicts prevent
87
+ application. Successful acceptance removes the proposal and records an event.
88
+ There is no separate Apply or Iterate action. A failed attempt retains the draft;
89
+ inspect its returned resultId with `ads_results` and fix the reported boundary.
90
+
91
+ `ads_drop_draft({id,revision})` deletes a proposal and its generated preview,
92
+ without changing accepted source. Drop replaces a separate refusal action.
93
+ Read `ads_status.drafts`, `ads_drafts.events` or `ads://project/drafts` to observe
94
+ decisions. Resource notifications are available, but the host may not wake an
95
+ agent; always use the returned outcome or persisted status as the fallback.
96
+
97
+ ## Build isolation
98
+
99
+ Draft presence alone must not fail an application build. Drafts are excluded from
100
+ normal ADS discovery and validation inputs. ADS import guards reject direct,
101
+ aliased, re-exported, dynamic and symlink imports of marked files or ads-drafts/,
102
+ including attempts from scenarios/tests outside the isolated preview overlay.
103
+ Install `draftImportGuard()` from `@reqvire-org/ads/scenarios/vite` in application
104
+ Vite/Rollup builds as well as keeping the mandatory ADS check/build pipeline.
105
+ It rejects resolved draft modules and glob-expanded module loads. Merely adding a
106
+ TypeScript exclude pattern is not an import boundary. Do not export drafts, add
107
+ production aliases to them, or copy draft storage into published assets.
@@ -1,5 +1,11 @@
1
1
  # Advanced guarded editing
2
2
 
3
+ For iterative design, prefer the [tracked auto-mode draft workflow](drafts.md):
4
+ ordinary edits and fast previews, then exact-revision acceptance. Complete a
5
+ coherent change by accepting its required drafts, or report it as unfinished.
6
+ The disposable `.ds/patch-drafts/` copies described below are low-level patch
7
+ staging for focused repairs and migrations, not tracked review proposals.
8
+
3
9
  Use `ads_apply_patch` for independent owner edits. `ads_prepare_patch` can create a
4
10
  local draft of one owner and its companions; edit that directory with local file
5
11
  tools, request `action:"diff"`, then apply the returned patchFile. Discard the
package/docs/ADS.md CHANGED
@@ -6,6 +6,19 @@ UX, and Skin pillars. [GUIDE.md](GUIDE.md) gives setup and configuration steps.
6
6
 
7
7
  ## Ownership boundary
8
8
 
9
+ Iterative design uses the [tracked draft contract](../skills/ads-designer/references/drafts.md).
10
+ Drafts are Git-committable proposals under `ads-drafts/` using `.ads`
11
+ source and a target/baseline manifest. They are excluded from normal discovery
12
+ and may not be imported, re-exported or resolved into application builds. Use
13
+ mandatory ADS checks and `draftImportGuard()` in application Vite/Rollup builds.
14
+ Only an isolated draft preview overlays them onto canonical project paths.
15
+ Components, patterns, compositions and shared token groups can participate;
16
+ dependency drafts must be accepted before their dependents. Acceptance applies
17
+ the exact reviewed revision through the existing ownership/validation gates.
18
+ Draft edits, stale inputs, conflicts and failed checks cannot publish source.
19
+ Agents must accept the required drafts before reporting a coherent design change
20
+ complete, unless the user explicitly requested a retained proposal.
21
+
9
22
  MCP source editing is opt-in through `ads mcp --mutations`. Its write operation
10
23
  accepts a Git unified diff for one ADS unit (or bounded owner patches for coupled
11
24
  transactions) and validates its source, scenario and
@@ -260,6 +260,18 @@ side effects, rather than the controller directory name.
260
260
 
261
261
  ## The showcase is the shared design workspace
262
262
 
263
+ Iterative proposals use tracked `ads-drafts/` source and explicit `.ads`
264
+ source, with canonical target mappings and baseline fingerprints. Production
265
+ discovery/imports exclude drafts. Generated preview mirrors retain the normal
266
+ project layout and public imports while overlaying proposed owner files and
267
+ declared draft dependencies; their compiler stays alive across edits. Only these
268
+ isolated mirrors skip acceptance validation for fast feedback. Acceptance uses
269
+ the ordinary guarded candidate pipeline, fences the exact reviewed revision and
270
+ rechecks live inputs before transactional publication. Pattern/composition and
271
+ token-group draft dependencies resolve to normal accepted source after promotion.
272
+ The [draft guide](../skills/ads-designer/references/drafts.md) defines lifecycle,
273
+ completion requirements, build integration and recovery.
274
+
263
275
  Humans and coding agents inspect the same project through MCP. The showcase is
264
276
  **a minimal shell plus an MCP client and Apps host**, shipped as development
265
277
  tooling. Its header, section tabs, collapsible left menu, theme switch and preview
package/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.33
4
+
5
+ - Add auto-mode tracked drafts with persistent manifests and terminal `.ads`
6
+ source, draft-only MCP discovery, catalogue indicators, exact-revision guarded
7
+ acceptance, Drop and persisted decision events.
8
+ - Reuse isolated preview compilers across ordinary edits without rerunning full
9
+ acceptance checks. Support shared token groups and component → pattern →
10
+ composition draft dependencies that switch automatically to accepted source.
11
+ - Add Explorer's Drafts section and header Split view comparison, using separate
12
+ sandboxed MCP Apps with shared scenario/theme/viewport settings. New scenarios
13
+ without accepted counterparts disable comparison.
14
+ - Capture exact draft revisions through MCP PNG resources, borrowing warm preview
15
+ hosts and keeping draft edits out of accepted catalogue/compiler invalidation.
16
+ Keep shared diagnostic sinks free of per-compiler pipe listeners.
17
+ - Reject production imports of unaccepted drafts, including aliases/symlinks;
18
+ export `draftImportGuard()` and install it in the empty starter's Vite build.
19
+ - Update all distributed design skills to require acceptance before finishing a
20
+ coherent design change, while reporting blocked work as unfinished.
21
+
3
22
  ## 0.3.32
4
23
 
5
24
  - Add a phone-width showcase toggle for components, patterns and compositions.
package/docs/CONTRACTS.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Static owner contracts and development files
2
2
 
3
+ Tracked proposals add the reserved `.ads` source role and `ads-drafts/` directory.
4
+ They are not runtime owners or ordinary scenario/fixture modules. Normal
5
+ discovery excludes them, and import/build guards reject dependencies on them.
6
+ The isolated preview maps proposed source to normal owner paths before analysis
7
+ and compilation. Acceptance uses the same owner contracts and project checks as
8
+ the resulting normal source. See the [draft contract](../skills/ads-designer/references/drafts.md)
9
+ for tracked manifests, token groups, dependency promotion and exact-revision acceptance.
10
+
3
11
  Use one optional `<Owner>.ads.contract.ts` for constrained
4
12
  paint inputs, scoped runtime bindings, declarative parts and behavioral checks.
5
13
  The import `import type { UnitContract } from "@reqvire-org/ads/contracts"` supplies
package/docs/GUIDE.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # ADS tool guide
2
2
 
3
+ For iterative design changes, use the [tracked auto-mode draft workflow](../skills/ads-designer/references/drafts.md):
4
+ create a proposal, edit and preview it, review the actual result, then accept the
5
+ exact revision. Drafts support coupled owners, shared token groups and component
6
+ → pattern → composition dependencies. Explorer provides draft discovery and
7
+ Accepted/Draft split comparison. Drafts are tracked source; `.ds/` preview caches
8
+ are disposable. Required checks run at acceptance, and failed or unaccepted work
9
+ must not be reported as a completed design change.
10
+
3
11
  ADS is development tooling for a project's local design system. This package
4
12
  contains a Node/Bun CLI, shared token contract, static checks, an Oxlint plugin, and
5
13
  empty foundation scaffolding. It includes no component or pattern catalogue,
@@ -23,11 +31,15 @@ An agent uses the MCP tools to inspect, edit and review the project:
23
31
  3. Open a discovered preview with `ads_show_scenario` or `ads_show_tokens`. These
24
32
  render the project's actual scenario, fixtures and adapter through MCP Apps.
25
33
  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.
34
+ 4. For iterative changes with editing enabled, discover owners with `ads_units`,
35
+ create a tracked proposal with `ads_create_draft`, and edit its marked source.
36
+ `ads_read_file` reads both normal and registered draft source; use
37
+ `ads_update_draft` to register additions/deletions. Preview with
38
+ `ads_show_draft`, inspect the actual view or capture its exact revision with
39
+ `ads_capture({scenario,draft,revision})`, then call `ads_accept`.
40
+ Accept dependencies first and review dependent drafts again. Low-level
41
+ `ads_apply_patch`/transactions and disposable `ads_prepare_patch` staging
42
+ remain available for focused repairs/migrations.
31
43
  5. Review diagnostics, registered behavior evidence and the rendered result.
32
44
  `ads_behaviors` discovers guarantees; `ads_verify` executes selected registered
33
45
  checks. Recheck `ads_status.build` after changes; notifications alone do not
package/docs/MCP.md CHANGED
@@ -21,6 +21,56 @@ exercised conditions alongside normal application integration checks.
21
21
 
22
22
  ## Built-in showcase client
23
23
 
24
+ ### Auto-mode tracked drafts
25
+
26
+ Use the [draft workflow](../skills/ads-designer/references/drafts.md) for iterative
27
+ design. With `--mutations`, `ads_create_draft` creates a tracked proposal for 1–8
28
+ owners; ordinary file edits or `ads_update_draft` continue it. `ads_show_draft`
29
+ reuses an isolated compiler workspace and returns both an MCP App preview and
30
+ browser URLs without running acceptance checks. `ads_drafts` lists only pending
31
+ drafts, supports owner/query filtering and paged file mappings, and returns recent
32
+ acceptance/drop events. `ads_catalog` and `ads_scenarios` annotate existing owners
33
+ with draft references. `ads_tokens.tokenGroups` discovers groups for
34
+ `ads_create_draft({units:["tokens"],tokenGroups:["colors"]})`.
35
+
36
+ For model-visible visual evidence, pass `draft` and its exact `revision` to
37
+ `ads_capture` alongside the normal scenario/target/theme/viewport selection. It
38
+ captures Accepted/current and Draft/candidate PNG resources while borrowing warm
39
+ preview hosts; it neither closes them nor runs draft acceptance checks. A new
40
+ scenario has no current image. Source changes during capture prevent replacing
41
+ the slots. Read the returned PNG resources before visual acceptance; the result
42
+ is explicitly `previewOnly`, not behavioral or acceptance evidence.
43
+
44
+ `ads_accept({id,revision})` validates and applies the exact reviewed revision in
45
+ one operation. Architecture, registered Oxlint/project commands and affected
46
+ behavior checks remain mandatory. Edits during checking and baseline conflicts
47
+ prevent application; failures retain the draft and return execution evidence.
48
+ Successful acceptance removes draft source, records an event and resolves draft
49
+ dependencies in remaining proposals. Accept dependencies first and review their
50
+ dependents again. `ads_drop_draft` deletes a draft, replacing a separate refusal.
51
+ There is no Iterate action or extra human approval step in auto mode.
52
+
53
+ Tracked source lives in `ads-drafts/<id>/` with a `proposal.ads.draft.json`
54
+ manifest and `.ads` source files. Generated mirrors, compilers and events
55
+ live under ignored `.ds/`. A draft can be committed and reviewed in a PR without
56
+ being imported into application source. Normal imports of marked draft source,
57
+ including aliases/symlinks, fail guards; use the isolated preview overlay instead.
58
+ Install the exported `draftImportGuard()` in application Vite/Rollup builds too.
59
+
60
+ Explorer's Drafts section and per-owner badges open proposals. Its upper-header
61
+ Split view toggle compares Accepted and Draft in the right pane using separate
62
+ opaque MCP Apps, the same scenario/theme and matched available/phone viewport
63
+ widths. It is disabled when the scenario has no accepted counterpart. Project
64
+ code remains inside the existing sandbox; no additional iframe origin is allowed.
65
+ Draft resource reads are explicitly scoped through `ads://drafts/<id>/resource`.
66
+ `ads://project/drafts` supports resource subscriptions; tool outcomes and persisted
67
+ events/status are the fallback when a host does not deliver notifications.
68
+
69
+ Agents must finish coherent design changes by accepting required drafts. A
70
+ preview-only proposal is unfinished unless the user asked to retain it. Failed
71
+ checks require repair or an explicit unfinished-blocker report, never bypassing
72
+ the acceptance gates.
73
+
24
74
  Starting `ads mcp` automatically serves a loopback showcase. Its URL is printed
25
75
  on stderr and returned by `ads_status.showcaseUrl`/`project.showcase.url`.
26
76
  The agent keeps its stdio connection; the browser connects to `/mcp` on the same
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reqvire-org/ads",
3
- "version": "0.3.32",
3
+ "version": "0.3.33",
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": {