@whzxc/agent-design-gallery 0.9.0 → 0.13.1

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 (61) hide show
  1. package/README.md +19 -3
  2. package/package.json +4 -1
  3. package/public/annotations.js +816 -0
  4. package/public/app.js +245 -12
  5. package/public/assets.js +4 -13
  6. package/public/frame-identity.js +223 -0
  7. package/public/icons.js +1 -0
  8. package/public/index.html +3 -0
  9. package/public/selection.js +1 -1
  10. package/public/style.css +72 -2
  11. package/src/annotations.mjs +238 -0
  12. package/src/cli-output.mjs +49 -2
  13. package/src/cli.mjs +83 -12
  14. package/src/http.mjs +2 -1
  15. package/src/hub/instances.mjs +1 -1
  16. package/src/hub/registry.mjs +1 -1
  17. package/src/hub.mjs +2 -2
  18. package/src/server.mjs +59 -11
  19. package/src/service.mjs +1 -1
  20. package/src/toolkit/arch-git.mjs +19 -0
  21. package/src/toolkit/arch-overlay.mjs +1 -1
  22. package/src/toolkit/asset-rules.mjs +42 -3
  23. package/src/toolkit/build-store.mjs +5 -3
  24. package/src/toolkit/build-worker.mjs +5 -2
  25. package/src/toolkit/build.mjs +36 -14
  26. package/src/toolkit/commands.mjs +85 -22
  27. package/src/toolkit/config.mjs +8 -6
  28. package/src/toolkit/diff-inputs.mjs +5 -5
  29. package/src/toolkit/diff.mjs +18 -11
  30. package/src/toolkit/document.mjs +6 -6
  31. package/src/toolkit/frame-document.mjs +6 -0
  32. package/src/toolkit/frame-facets.mjs +167 -0
  33. package/src/toolkit/frame-identity.mjs +100 -0
  34. package/src/toolkit/frame-observation.mjs +147 -0
  35. package/src/toolkit/frame-primitives.mjs +85 -0
  36. package/src/toolkit/html.mjs +1 -0
  37. package/src/toolkit/impact-eligibility.mjs +136 -0
  38. package/src/toolkit/impact-inputs.mjs +52 -0
  39. package/src/toolkit/impact-output.mjs +46 -0
  40. package/src/toolkit/impact-proof.mjs +67 -0
  41. package/src/toolkit/impact-selection.mjs +96 -0
  42. package/src/toolkit/impact.mjs +382 -0
  43. package/src/toolkit/implementation-query.mjs +53 -0
  44. package/src/toolkit/input-generation.mjs +51 -0
  45. package/src/toolkit/inspect-encoding.mjs +459 -0
  46. package/src/toolkit/inspect-observation.mjs +56 -0
  47. package/src/toolkit/inspect-output.mjs +169 -0
  48. package/src/toolkit/inspect-styles.mjs +34 -0
  49. package/src/toolkit/inspect.d.ts +118 -0
  50. package/src/toolkit/inspect.mjs +125 -0
  51. package/src/toolkit/owner-observation.mjs +23 -189
  52. package/src/toolkit/owner-search.mjs +2 -2
  53. package/src/toolkit/owner.mjs +37 -45
  54. package/src/toolkit/part-diff.mjs +2 -0
  55. package/src/toolkit/part-snapshot.mjs +15 -23
  56. package/src/toolkit/project-index.mjs +100 -22
  57. package/src/toolkit/project.mjs +52 -6
  58. package/src/toolkit/results.mjs +2 -2
  59. package/src/toolkit/runtime.d.ts +7 -5
  60. package/src/toolkit/runtime.mjs +20 -7
  61. package/src/toolkit/token-reachability.mjs +71 -0
package/README.md CHANGED
@@ -31,7 +31,7 @@ On macOS, `adg service migrate` stops `org.svg-design-gallery.hub`, moves its en
31
31
  `svg-design-gallery` to `agent-design-gallery`, and replaces the LaunchAgent with `org.agent-design-gallery.hub`
32
32
  using the current Node and CLI paths and the previous port. It resolves the source from the old LaunchAgent's
33
33
  `--state-dir`, or `$XDG_STATE_HOME/svg-design-gallery` (default `~/.local/state/svg-design-gallery`). The destination
34
- is `$XDG_STATE_HOME/agent-design-gallery` by default; `--state-dir` selects a different destination. It refuses an
34
+ is `~/.agent-design-gallery` by default; `--state-dir` selects a different destination. It refuses an
35
35
  existing target directory or new LaunchAgent. It prints steps and then lists other LaunchAgents still referencing
36
36
  the old state path without editing them or printing keys. Registry, preferences, caches and logs move together.
37
37
  The stored key prefix changes to `adg_`; update browser access with the new key through `adg serve --print-key`.
@@ -73,7 +73,7 @@ Design sources are TSX files directly in `design/components/`, `design/modules/`
73
73
 
74
74
  Choose the **Tokens** tab to inspect the current project's `design/tokens.css`. Filter by category in Contents or search the table by name or value from the toolbar, compare light and dark declarations side by side, and click a token name to copy it. Colors show swatches, and pixel values for spacing, sizes, and radii show a visual sample. Share `?scope=tokens` to open the catalog directly.
75
75
 
76
- Follow the [design asset rules](docs/asset-rules.md) for placement, ownership, states, frame names, fidelity, lifecycle and studies. The [adoption guide](docs/asset-rules.md#adopting-an-existing-project) covers inventory, a read-only audit with `file / problem / suggested fix` findings, review batches, and the mappings/governance each consumer keeps locally. `sources` orders production layers from lower to higher; `check` reports upward imports. Set `check: { importDirection: false }` to opt out of that lint while keeping frame checks.
76
+ Follow the [design asset rules](docs/asset-rules.md) for placement, ownership, states, frame names, fidelity, lifecycle and studies. The [adoption guide](docs/asset-rules.md#adopting-an-existing-project) covers inventory, a read-only audit with `file / problem / suggested fix` findings, check-decided governance steps, the implementation checks a consumer adds, and the mappings/governance each consumer keeps locally. `sources` orders production layers from lower to higher; `check` reports upward imports. Set `check: { importDirection: false }` to opt out of that lint while keeping frame checks.
77
77
 
78
78
  A component source is one set: frames run in source order with 32px gaps, wrap before 1600px, and have 48px between rows. Sets pad forms by 24px at the sides and bottom and 36px at the top. A surface source is one flow: each frame receives 16px padding and follows the flow layout. Frame notes appear in the inspector, outside the drawing. Full sheet has been removed; choose a declared form or frame.
79
79
 
@@ -92,7 +92,7 @@ Files group by directory unless `gallery.json` supplies project groups. Entries
92
92
  }
93
93
  ```
94
94
 
95
- Unlisted assets remain in directory groups. Projects own their TSX sources, artwork, tokens, configuration, and Git history. Theme, sidebar, inspector, and per-directory camera and selection preferences stay in `$XDG_STATE_HOME/agent-design-gallery/state.json`, defaulting to `~/.local/state/agent-design-gallery/state.json`. Refreshing or reopening a directory restores its zoom, position, selected component and form. Canvas asset headings show the source's last modification time in local time; hover for the complete timestamp. `--state-dir` isolates preferences.
95
+ Unlisted assets remain in directory groups. Projects own their TSX sources, artwork, tokens, configuration, and Git history. Theme, sidebar, inspector, and per-directory camera and selection preferences stay in `~/.agent-design-gallery/state.json`, defaulting to `~/.agent-design-gallery/state.json`. Refreshing or reopening a directory restores its zoom, position, selected component and form. Canvas asset headings show the source's last modification time in local time; hover for the complete timestamp. `--state-dir` isolates preferences.
96
96
 
97
97
  ## Design toolkit
98
98
 
@@ -106,6 +106,12 @@ adg check --read-only
106
106
  adg diff --base=HEAD --json
107
107
  adg owner --file=ui/controls.tsx --symbol=Button --json
108
108
  adg owner --text="Save changes" --locale=en --json
109
+ adg impact --source=design/components/badge.tsx --part=Badge --json
110
+ adg impact --token=--accent --json
111
+ adg impact --base=HEAD --json
112
+ adg render --impacted --base=HEAD --json
113
+ adg check --impacted --base=HEAD --read-only --json
114
+ adg diff --base=HEAD --impacted --json
109
115
  ```
110
116
 
111
117
  `init` creates tokens, components/modules/surfaces, fixtures/art, editor configuration and ignore entries. A fresh library gets one `example.tsx` per production layer, composed downward with shared fixture data; existing libraries receive no demo sources. Existing authored files are preserved, declarations are refreshed, and missing ignore entries are appended. Starter configuration requires ADG 0.5.0 or newer. `check --read-only` skips declarations and build files for an audit. Projects do not install ADG as a dependency.
@@ -128,6 +134,16 @@ separate from computed paint. Both themes are searched by default. Broad color/t
128
134
  answers can be around 100 KB; read `owners` first and narrow with `--theme`. See the
129
135
  [owner JSON contract](docs/agent-interface.md#owner) for ranks, evidence and diagnostics.
130
136
 
137
+ `adg impact` lists conservative direct/transitive frame candidates from sources, parts, tokens,
138
+ implementation mappings or exact Git endpoints. It uses emitted provenance and lexical token
139
+ reachability, with compact optional `--explain` witnesses. Equal theme records and same-source frame records are grouped; noncandidates are counted.
140
+ Git queries freshly materialize both endpoints and prove equivalent closed rendering inputs for
141
+ this operation. Hypothetical queries remain candidate lookups. `render`, `check` and `diff` accept `--impacted --base=<rev>`;
142
+ check reports skipped evaluations as `not_checked` with partial coverage, while unqualified both-theme
143
+ diff counts fresh proofs. Query stdout cannot authorize a later skip. Architecture `render --base`
144
+ produces proposal overlays; `render --impacted --base` captures plain current frames. Zero-job runs
145
+ report zero work. See the [impact contract](docs/agent-interface.md#impact).
146
+
131
147
  See the [toolkit contract](docs/design-toolkit.md) for source format and compare adapters, and the [changelog](CHANGELOG.md) for version changes. Node.js executes design modules at build time; open sources you trust.
132
148
 
133
149
  ## Architecture sources
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whzxc/agent-design-gallery",
3
- "version": "0.9.0",
3
+ "version": "0.13.1",
4
4
  "description": "Local TSX design toolkit and SVG viewer",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -32,8 +32,11 @@
32
32
  "prepack": "node tooling/package.mjs"
33
33
  },
34
34
  "dependencies": {
35
+ "css-tree": "3.1.0",
36
+ "entities": "9.0.0",
35
37
  "esbuild": "0.28.2",
36
38
  "lucide": "1.70.0",
39
+ "parse5": "8.1.1",
37
40
  "pele": "1.12.0",
38
41
  "playwright": "1.64.1",
39
42
  "tailwindcss": "4.3.4"