@reqvire-org/ads 0.3.32 → 0.3.34

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 (84) hide show
  1. package/README.md +9 -0
  2. package/dist/behavior-libraries.mjs +93 -0
  3. package/dist/behaviors.mjs +0 -6
  4. package/dist/bootstrap-ds/ds.config.json +1 -0
  5. package/dist/bootstrap-ds/vite.config.ts +2 -1
  6. package/dist/boundaries.mjs +2 -0
  7. package/dist/capture.mjs +8 -6
  8. package/dist/check.mjs +2 -0
  9. package/dist/config.mjs +9 -2
  10. package/dist/draft-boundary.mjs +27 -0
  11. package/dist/draft-workspace.mjs +10 -0
  12. package/dist/lint-config.mjs +8 -0
  13. package/dist/mcp/build-status.mjs +1 -1
  14. package/dist/mcp/catalog.mjs +4 -2
  15. package/dist/mcp/context.mjs +2 -2
  16. package/dist/mcp/draft-discovery.mjs +55 -0
  17. package/dist/mcp/draft-exports.mjs +40 -0
  18. package/dist/mcp/drafts.mjs +460 -0
  19. package/dist/mcp/edit-preparation.mjs +8 -7
  20. package/dist/mcp/execution-results.mjs +2 -0
  21. package/dist/mcp/mutations.mjs +6 -2
  22. package/dist/mcp/preview-watch.mjs +24 -5
  23. package/dist/mcp/preview-widget.bundle.js +14 -14
  24. package/dist/mcp/prompts.mjs +3 -2
  25. package/dist/mcp/server.mjs +178 -39
  26. package/dist/mcp/widget.bundle.js +1 -1
  27. package/dist/preview-files.mjs +2 -0
  28. package/dist/scenario-inspector.mjs +5 -5
  29. package/dist/scenario-program.mjs +36 -0
  30. package/dist/scenario-registry.mjs +90 -0
  31. package/dist/scenarios-compiler.mjs +68 -22
  32. package/dist/scenarios-vite.d.mts +1 -0
  33. package/dist/scenarios-vite.mjs +1 -0
  34. package/dist/scenarios.mjs +2 -1
  35. package/dist/showcase/client.bundle.js +28 -28
  36. package/dist/showcase/comparison.js +45 -0
  37. package/dist/showcase/draft-navigation.js +41 -0
  38. package/dist/showcase/preview-state.js +19 -0
  39. package/dist/showcase/style.css +5 -0
  40. package/dist/skills/README.md +5 -0
  41. package/dist/skills/ads-break-ui/SKILL.md +26 -0
  42. package/dist/skills/ads-break-ui/references/behaviors.md +10 -0
  43. package/dist/skills/ads-break-ui/references/captures.md +7 -0
  44. package/dist/skills/ads-break-ui/references/drafts.md +146 -0
  45. package/dist/skills/ads-break-ui/references/guarded-editing.md +6 -0
  46. package/dist/skills/ads-break-ui/references/validation.md +6 -0
  47. package/dist/skills/ads-designer/SKILL.md +33 -0
  48. package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +1 -0
  49. package/dist/skills/ads-designer/assets/bootstrap-ds/vite.config.ts +2 -1
  50. package/dist/skills/ads-designer/references/behaviors.md +10 -0
  51. package/dist/skills/ads-designer/references/captures.md +7 -0
  52. package/dist/skills/ads-designer/references/drafts.md +146 -0
  53. package/dist/skills/ads-designer/references/guarded-editing.md +6 -0
  54. package/dist/skills/ads-designer/references/validation.md +6 -0
  55. package/dist/skills/ads-import/SKILL.md +30 -0
  56. package/dist/skills/ads-import/references/behaviors.md +10 -0
  57. package/dist/skills/ads-import/references/captures.md +7 -0
  58. package/dist/skills/ads-import/references/drafts.md +146 -0
  59. package/dist/skills/ads-import/references/guarded-editing.md +6 -0
  60. package/dist/skills/ads-import/references/validation.md +6 -0
  61. package/dist/skills/ads-motion/SKILL.md +26 -0
  62. package/dist/skills/ads-motion/references/behaviors.md +10 -0
  63. package/dist/skills/ads-motion/references/captures.md +7 -0
  64. package/dist/skills/ads-motion/references/drafts.md +146 -0
  65. package/dist/skills/ads-motion/references/guarded-editing.md +6 -0
  66. package/dist/skills/ads-motion/references/validation.md +6 -0
  67. package/dist/skills/ads-port/SKILL.md +34 -1
  68. package/dist/skills/ads-port/references/behaviors.md +10 -0
  69. package/dist/skills/ads-port/references/captures.md +7 -0
  70. package/dist/skills/ads-port/references/drafts.md +146 -0
  71. package/dist/skills/ads-port/references/guarded-editing.md +6 -0
  72. package/dist/skills/ads-port/references/native-implementation.md +14 -1
  73. package/dist/skills/ads-port/references/validation.md +6 -0
  74. package/dist/unit-contracts.mjs +2 -2
  75. package/dist/units.mjs +6 -0
  76. package/dist/verification/browser.d.mts +27 -0
  77. package/dist/verification.mjs +3 -0
  78. package/docs/ADS.md +13 -0
  79. package/docs/ARCHITECTURE.md +94 -0
  80. package/docs/CHANGELOG.md +111 -0
  81. package/docs/CONTRACTS.md +8 -0
  82. package/docs/GUIDE.md +46 -9
  83. package/docs/MCP.md +90 -0
  84. package/package.json +6 -4
package/docs/MCP.md CHANGED
@@ -13,6 +13,13 @@ preview watcher and serves the built-in browser showcase, so the client needs
13
13
  only one launch command. Source editing is disabled by default; `--mutations`
14
14
  enables guarded ADS edits. MCP does not install skills or add a production runtime.
15
15
 
16
+ `ads_status.behaviorLibraries` reports each explicitly allowed project package,
17
+ its installed version and the ADS units that use it. Catalog entries expose their
18
+ `behaviorLibraries`, following local helpers and controllers. This allowlist
19
+ permits imports; it does not load packages or audit third-party dependencies.
20
+ Used code is bundled by the project's normal preview compiler into the resources
21
+ read by the sandboxed MCP App. Existing style and geometry boundaries still apply.
22
+
16
23
  Websites and product MCP Apps reuse the project's public design-system UI. The
17
24
  consuming application owns data, actions, mounting, MCP communication and serving.
18
25
  The ADS MCP server supports development, inspection and review of that UI. Its
@@ -21,6 +28,89 @@ exercised conditions alongside normal application integration checks.
21
28
 
22
29
  ## Built-in showcase client
23
30
 
31
+ ### Auto-mode tracked drafts
32
+
33
+ Use the [draft workflow](../skills/ads-designer/references/drafts.md) for iterative
34
+ design. With `--mutations`, `ads_create_draft` creates a tracked proposal for 1–8
35
+ owners; ordinary file edits or `ads_update_draft` continue it. `ads_show_draft`
36
+ reuses an isolated compiler workspace and returns both an MCP App preview and
37
+ browser URLs without running acceptance checks. `ads_drafts` lists only pending
38
+ drafts, supports owner/query filtering and paged file mappings, and returns recent
39
+ acceptance/drop events. `ads_catalog` and `ads_scenarios` annotate existing owners
40
+ with draft references. `ads_tokens.tokenGroups` discovers groups for
41
+ `ads_create_draft({units:["tokens"],tokenGroups:["colors"]})`.
42
+
43
+ For model-visible visual evidence, pass `draft` and its exact `revision` to
44
+ `ads_capture` alongside the normal scenario/target/theme/viewport selection. It
45
+ captures Accepted/current and Draft/candidate PNG resources while borrowing warm
46
+ preview hosts; it neither closes them nor runs draft acceptance checks. A new
47
+ scenario has no current image. Source changes during capture prevent replacing
48
+ the slots. Read the returned PNG resources before visual acceptance; the result
49
+ is explicitly `previewOnly`, not behavioral or acceptance evidence.
50
+
51
+ `ads_accept({id,revision})` validates and applies the exact reviewed revision in
52
+ one operation. Architecture, registered Oxlint/project commands and affected
53
+ behavior checks remain mandatory. Edits during checking and baseline conflicts
54
+ prevent application; failures retain the draft and return execution evidence.
55
+ Successful acceptance removes draft source, records an event and resolves draft
56
+ dependencies in remaining proposals. Accept dependencies first and review their
57
+ dependents again. `ads_drop_draft` deletes a draft, replacing a separate refusal.
58
+ There is no Iterate action or extra human approval step in auto mode.
59
+
60
+ Tracked source lives in `ads-drafts/<id>/` with a `proposal.ads.draft.json`
61
+ manifest and `.ads` source files. Generated mirrors, compilers and events
62
+ live under ignored `.ds/`. A draft can be committed and reviewed in a PR without
63
+ being imported into application source. Normal imports of marked draft source,
64
+ including aliases/symlinks, fail guards; use the isolated preview overlay instead.
65
+ Install the exported `draftImportGuard()` in application Vite/Rollup builds too.
66
+
67
+ Explorer keeps pending proposals in the ordinary catalogue, with Draft badges
68
+ on their owners, including new owners without an accepted version. Selecting an
69
+ entry with a draft enables the upper-header Split view toggle to compare Accepted
70
+ and Draft in the right pane using separate opaque MCP Apps, the same scenario/theme
71
+ and matched available/phone viewport widths. New-only entries show their draft
72
+ and disable comparison. Unchanged scenarios available as explicit overlay review
73
+ contexts do not acquire owner badges. There is no separate Drafts tab or scenario
74
+ picker; `ads_drafts` provides draft-only MCP listing. Project
75
+ code remains inside the existing sandbox; no additional iframe origin is allowed.
76
+ Draft resource reads are explicitly scoped through `ads://drafts/<id>/resource`.
77
+ `ads://project/drafts` supports resource subscriptions; tool outcomes and persisted
78
+ events/status are the fallback when a host does not deliver notifications.
79
+
80
+ For an existing preview, `ads_show_draft` reuses known scenario metadata while a
81
+ worker refreshes discovery. Its `discovery.state` is `current`, `pending` or
82
+ `error`; `discovery.revision` identifies the metadata snapshot, separately from
83
+ the returned exact proposal `revision`. New/missing identities await discovery.
84
+ The previous view may remain visible until the new compilation is available.
85
+ Acceptance always runs its fresh checks against the exact reviewed revision.
86
+ After 20 retained module revisions, Explorer automatically restarts the affected
87
+ App to release its module cache. Draft comparison preserves the other version's
88
+ mounted state and the selected scenario/theme/viewport.
89
+
90
+ Build state is separate from the Draft badge. Explorer entry glyphs show not
91
+ built, building, compiled/checking, ready, stale and failed using monochrome
92
+ shapes with accessible descriptions. Relevant MCP results expose `build` or
93
+ `preview` with `state`, `building`, `current`, `stale`, scenario/revision data and
94
+ a build-resource address. `ads://project/build` includes active `drafts`; each
95
+ draft's `preview.resourceUri` addresses its complete isolated build report.
96
+ Subscribe to `ads://project/build`, `ads://project/drafts`, or an active draft's
97
+ `preview.resourceUri` (also listed by `resources/list`): standard
98
+ `notifications/resources/updated` signals progress, completion, failure and
99
+ metadata refresh without another edit. Re-read the resource after a notification;
100
+ hosts without notifications can poll it. A scoped subscription receives only that
101
+ draft's build changes, including a final invalidation when its session is removed.
102
+ Unsubscribe when leaving the view; subscribe again and read current status after
103
+ reconnecting. Modern clients use `subscriptions/listen` resource filters; older
104
+ clients use `resources/subscribe` and `resources/unsubscribe`. Notifications
105
+ invalidate data; they do not carry the build report. Ready means compilation and
106
+ its checks completed; the mounted App separately reports when rendering is ready.
107
+ A ready draft remains unaccepted.
108
+
109
+ Agents must finish coherent design changes by accepting required drafts. A
110
+ preview-only proposal is unfinished unless the user asked to retain it. Failed
111
+ checks require repair or an explicit unfinished-blocker report, never bypassing
112
+ the acceptance gates.
113
+
24
114
  Starting `ads mcp` automatically serves a loopback showcase. Its URL is printed
25
115
  on stderr and returned by `ads_status.showcaseUrl`/`project.showcase.url`.
26
116
  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.34",
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": {
@@ -37,18 +37,20 @@
37
37
  "sync:skill-references": "node scripts/sync-skill-references.mjs",
38
38
  "check:skill-references": "node scripts/sync-skill-references.mjs --check",
39
39
  "lint": "npm run lint:tool",
40
- "lint:tool": "npm run check:skill-starter && npm run check:skill-references && oxlint --deny-warnings src preview-client showcase-client mcp-explorer tests/*.test.mjs tests/helpers scripts/build-ads-tool.mjs scripts/pack-ads-tool.mjs scripts/sync-skill-references.mjs",
40
+ "lint:tool": "npm run check:skill-starter && npm run check:skill-references && oxlint --deny-warnings src preview-client showcase-client mcp-explorer tests/*.test.mjs tests/helpers scripts/build-ads-tool.mjs scripts/pack-ads-tool.mjs scripts/sync-skill-references.mjs scripts/local-test-proof.mjs",
41
41
  "lint:project": "npm run lint:ds && npm run lint:style && npm run check:skill-starter",
42
42
  "lint:ds": "node dist/cli.mjs lint-config && node dist/cli.mjs check && oxlint --deny-warnings --config .ds/oxlintrc.json src design-system",
43
43
  "lint:style": "biome lint --config-path=biome.css.json .",
44
44
  "preview": "node dist/cli.mjs showcase",
45
45
  "preview:showcase": "node dist/cli.mjs showcase",
46
46
  "typecheck": "tsc --noEmit",
47
- "test": "npm run build && node --test --test-concurrency=2 tests/*.test.mjs",
47
+ "test": "npm run build && node --test --test-reporter=tap --test-concurrency=1 tests/*.test.mjs",
48
48
  "test:tool": "npm test",
49
49
  "pack:tool": "node scripts/pack-ads-tool.mjs",
50
50
  "ads": "node dist/cli.mjs",
51
- "prepack": "npm run build"
51
+ "prepack": "npm run build",
52
+ "release:verify": "node scripts/local-test-proof.mjs",
53
+ "release:proof": "node scripts/local-test-proof.mjs --check"
52
54
  },
53
55
  "dependencies": {
54
56
  "@modelcontextprotocol/server": "2.3.1",