uidex 0.6.0 → 0.8.0

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 (57) hide show
  1. package/README.md +3 -3
  2. package/dist/cli/cli.cjs +2502 -2253
  3. package/dist/cli/cli.cjs.map +1 -1
  4. package/dist/headless/index.cjs +86 -703
  5. package/dist/headless/index.cjs.map +1 -1
  6. package/dist/headless/index.d.cts +46 -22
  7. package/dist/headless/index.d.ts +46 -22
  8. package/dist/headless/index.js +86 -707
  9. package/dist/headless/index.js.map +1 -1
  10. package/dist/index.cjs +712 -4149
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +82 -366
  13. package/dist/index.d.ts +82 -366
  14. package/dist/index.js +708 -4156
  15. package/dist/index.js.map +1 -1
  16. package/dist/playwright/index.cjs +175 -0
  17. package/dist/playwright/index.cjs.map +1 -1
  18. package/dist/playwright/index.d.cts +2 -0
  19. package/dist/playwright/index.d.ts +2 -0
  20. package/dist/playwright/index.js +167 -0
  21. package/dist/playwright/index.js.map +1 -1
  22. package/dist/playwright/states-reporter.cjs +123 -0
  23. package/dist/playwright/states-reporter.cjs.map +1 -0
  24. package/dist/playwright/states-reporter.d.cts +46 -0
  25. package/dist/playwright/states-reporter.d.ts +46 -0
  26. package/dist/playwright/states-reporter.js +88 -0
  27. package/dist/playwright/states-reporter.js.map +1 -0
  28. package/dist/playwright/states.cjs +118 -0
  29. package/dist/playwright/states.cjs.map +1 -0
  30. package/dist/playwright/states.d.cts +120 -0
  31. package/dist/playwright/states.d.ts +120 -0
  32. package/dist/playwright/states.js +88 -0
  33. package/dist/playwright/states.js.map +1 -0
  34. package/dist/react/index.cjs +750 -4113
  35. package/dist/react/index.cjs.map +1 -1
  36. package/dist/react/index.d.cts +78 -278
  37. package/dist/react/index.d.ts +78 -278
  38. package/dist/react/index.js +748 -4135
  39. package/dist/react/index.js.map +1 -1
  40. package/dist/scan/index.cjs +2694 -1541
  41. package/dist/scan/index.cjs.map +1 -1
  42. package/dist/scan/index.d.cts +482 -19
  43. package/dist/scan/index.d.ts +482 -19
  44. package/dist/scan/index.js +2682 -1540
  45. package/dist/scan/index.js.map +1 -1
  46. package/package.json +14 -17
  47. package/templates/claude/SKILL.md +71 -0
  48. package/templates/claude/references/audit.md +43 -0
  49. package/templates/claude/{rules.md → references/conventions.md} +25 -28
  50. package/dist/cloud/index.cjs +0 -472
  51. package/dist/cloud/index.cjs.map +0 -1
  52. package/dist/cloud/index.d.cts +0 -82
  53. package/dist/cloud/index.d.ts +0 -82
  54. package/dist/cloud/index.js +0 -445
  55. package/dist/cloud/index.js.map +0 -1
  56. package/templates/claude/audit.md +0 -43
  57. /package/templates/claude/{api.md → references/api.md} +0 -0
@@ -12,6 +12,32 @@ interface EntityRef {
12
12
  kind: EntityKind;
13
13
  id: string;
14
14
  }
15
+ /**
16
+ * The four kinds every captured route is expected to render — the state-matrix
17
+ * axis. A capture that only shoots the happy path leaves most of the value on
18
+ * the table, so a missing core kind must be captured, waived (the page CANNOT
19
+ * render it), or acknowledged in the MISSING_KINDS baseline.
20
+ */
21
+ declare const CORE_STATE_KINDS: readonly ["loading", "empty", "populated", "error"];
22
+ type CoreStateKind = (typeof CORE_STATE_KINDS)[number];
23
+ /** `variant` is any state outside the matrix (a dialog, wizard step, multi-currency…). */
24
+ type StateKind = CoreStateKind | "variant";
25
+ /**
26
+ * A declared render state of an entity — the "story"-like unit: a named
27
+ * condition the page/feature/widget can render in (loading / empty / error /
28
+ * multi-currency / …). Enumerated on the entity (not derived from syntax), it
29
+ * is the contract the visual-states capture must satisfy and the anchor for
30
+ * per-state acceptance criteria. Fixtures + capture mechanics stay in the spec;
31
+ * the registry holds only the name (+ optional kind / per-state acceptance).
32
+ */
33
+ interface StateDecl {
34
+ name: string;
35
+ /** Canonical kind for the state-matrix axis (defaults to `variant`). */
36
+ kind?: StateKind;
37
+ /** Acceptance criteria that only this state can evidence. */
38
+ acceptance?: string[];
39
+ description?: string;
40
+ }
15
41
  interface Metadata {
16
42
  name?: string;
17
43
  description?: string;
@@ -21,6 +47,21 @@ interface Metadata {
21
47
  flows?: readonly string[];
22
48
  features?: string[];
23
49
  widgets?: string[];
50
+ /** Declared render states (see StateDecl); the capture-completeness gate. */
51
+ states?: StateDecl[];
52
+ /**
53
+ * `false` opts this page/feature/widget out of visual-states capture forever
54
+ * (a redirect, a static notice, an internal target). The page-coverage gate
55
+ * treats an opted-out route as accounted-for. Reason belongs in `description`.
56
+ */
57
+ capture?: boolean;
58
+ /**
59
+ * Per-core-kind waivers: a core kind this page's route legitimately CANNOT
60
+ * render (a create form has no `empty`), mapped to a substantive reason. The
61
+ * state-matrix gate treats a waived kind as accounted-for. A waiver is a
62
+ * permanent design statement — unlike MISSING_KINDS backlog, which is debt.
63
+ */
64
+ waivers?: Partial<Record<CoreStateKind, string>>;
24
65
  }
25
66
  interface EntityWithMetaBase {
26
67
  id: string;
@@ -98,16 +139,10 @@ interface Registry {
98
139
  setReports(kind: EntityKind, id: string, reports: readonly ReportRecord[]): void;
99
140
  getReports(kind: EntityKind, id: string): readonly ReportRecord[];
100
141
  listReportKeys(): readonly string[];
101
- archiveReport?: (reportId: string, reason?: string) => void | Promise<void>;
142
+ closeReport?: (reportId: string, status?: string) => void | Promise<void>;
102
143
  onReportsChange(cb: () => void): () => void;
103
144
  }
104
145
 
105
- interface UserIdentity {
106
- id: string;
107
- name?: string;
108
- avatar?: string;
109
- }
110
-
111
146
  type ThemePreference = "light" | "dark" | "auto";
112
147
  type ResolvedTheme = "light" | "dark";
113
148
  interface ViewStackEntry {
@@ -115,20 +150,13 @@ interface ViewStackEntry {
115
150
  ref: EntityRef | null;
116
151
  }
117
152
  interface SessionSnapshot {
118
- hover: EntityRef | null;
119
- selection: EntityRef | null;
120
153
  stack: ViewStackEntry[];
121
154
  /** Sticky overlay highlight. Set by "Highlight Element" actions; cleared on Esc. */
122
155
  pinnedHighlight: EntityRef | null;
123
- inspectorActive: boolean;
156
+ /** Mirrored from the mode store; the surface mode the session is currently in. */
157
+ mode: SurfaceMode;
124
158
  theme: ThemePreference;
125
159
  resolvedTheme: ResolvedTheme;
126
- ingestActive: boolean;
127
- /**
128
- * Identity for the local user. Set once at session creation; gates realtime
129
- * features (cursor labels, presence) and auto-populates report attribution.
130
- */
131
- user: UserIdentity | null;
132
160
  }
133
161
  type SessionState = SessionSnapshot;
134
162
 
@@ -138,7 +166,6 @@ interface NavigationState {
138
166
  interface NavigationActions {
139
167
  push(entry: ViewStackEntry): void;
140
168
  pop(): void;
141
- replace(entry: ViewStackEntry): void;
142
169
  clear(): void;
143
170
  reset(stack: ViewStackEntry[]): void;
144
171
  }
@@ -149,7 +176,6 @@ type NavigationStore = StoreApi<NavigationState> & {
149
176
  type SurfaceMode = "idle" | "inspecting" | "palette" | "viewing";
150
177
  interface ModeSnapshot {
151
178
  mode: SurfaceMode;
152
- inspectorActive: boolean;
153
179
  }
154
180
  interface ModeTransitions {
155
181
  openPalette(): void;
@@ -175,11 +201,11 @@ type SessionStore = StoreApi<SessionState> & {
175
201
  readonly nav: NavigationStore;
176
202
  readonly mode: ModeStore;
177
203
  readonly highlight: HighlightActions;
178
- select(ref: EntityRef | null): void;
179
204
  setTheme(theme: ThemePreference, resolved?: ResolvedTheme): void;
180
- setIngest(active: boolean): void;
181
205
  };
182
206
 
207
+ type Corner = "top-left" | "top-right" | "bottom-left" | "bottom-right";
208
+
183
209
  interface OverlayShowOptions {
184
210
  label?: string;
185
211
  color?: string;
@@ -190,8 +216,6 @@ interface OverlayShowOptions {
190
216
  backdrop?: boolean;
191
217
  }
192
218
 
193
- type Corner = "top-left" | "top-right" | "bottom-left" | "bottom-right";
194
-
195
219
  interface CreateHeadlessOptions {
196
220
  theme?: ThemePreference;
197
221
  resolvedTheme?: ResolvedTheme;
@@ -12,6 +12,32 @@ interface EntityRef {
12
12
  kind: EntityKind;
13
13
  id: string;
14
14
  }
15
+ /**
16
+ * The four kinds every captured route is expected to render — the state-matrix
17
+ * axis. A capture that only shoots the happy path leaves most of the value on
18
+ * the table, so a missing core kind must be captured, waived (the page CANNOT
19
+ * render it), or acknowledged in the MISSING_KINDS baseline.
20
+ */
21
+ declare const CORE_STATE_KINDS: readonly ["loading", "empty", "populated", "error"];
22
+ type CoreStateKind = (typeof CORE_STATE_KINDS)[number];
23
+ /** `variant` is any state outside the matrix (a dialog, wizard step, multi-currency…). */
24
+ type StateKind = CoreStateKind | "variant";
25
+ /**
26
+ * A declared render state of an entity — the "story"-like unit: a named
27
+ * condition the page/feature/widget can render in (loading / empty / error /
28
+ * multi-currency / …). Enumerated on the entity (not derived from syntax), it
29
+ * is the contract the visual-states capture must satisfy and the anchor for
30
+ * per-state acceptance criteria. Fixtures + capture mechanics stay in the spec;
31
+ * the registry holds only the name (+ optional kind / per-state acceptance).
32
+ */
33
+ interface StateDecl {
34
+ name: string;
35
+ /** Canonical kind for the state-matrix axis (defaults to `variant`). */
36
+ kind?: StateKind;
37
+ /** Acceptance criteria that only this state can evidence. */
38
+ acceptance?: string[];
39
+ description?: string;
40
+ }
15
41
  interface Metadata {
16
42
  name?: string;
17
43
  description?: string;
@@ -21,6 +47,21 @@ interface Metadata {
21
47
  flows?: readonly string[];
22
48
  features?: string[];
23
49
  widgets?: string[];
50
+ /** Declared render states (see StateDecl); the capture-completeness gate. */
51
+ states?: StateDecl[];
52
+ /**
53
+ * `false` opts this page/feature/widget out of visual-states capture forever
54
+ * (a redirect, a static notice, an internal target). The page-coverage gate
55
+ * treats an opted-out route as accounted-for. Reason belongs in `description`.
56
+ */
57
+ capture?: boolean;
58
+ /**
59
+ * Per-core-kind waivers: a core kind this page's route legitimately CANNOT
60
+ * render (a create form has no `empty`), mapped to a substantive reason. The
61
+ * state-matrix gate treats a waived kind as accounted-for. A waiver is a
62
+ * permanent design statement — unlike MISSING_KINDS backlog, which is debt.
63
+ */
64
+ waivers?: Partial<Record<CoreStateKind, string>>;
24
65
  }
25
66
  interface EntityWithMetaBase {
26
67
  id: string;
@@ -98,16 +139,10 @@ interface Registry {
98
139
  setReports(kind: EntityKind, id: string, reports: readonly ReportRecord[]): void;
99
140
  getReports(kind: EntityKind, id: string): readonly ReportRecord[];
100
141
  listReportKeys(): readonly string[];
101
- archiveReport?: (reportId: string, reason?: string) => void | Promise<void>;
142
+ closeReport?: (reportId: string, status?: string) => void | Promise<void>;
102
143
  onReportsChange(cb: () => void): () => void;
103
144
  }
104
145
 
105
- interface UserIdentity {
106
- id: string;
107
- name?: string;
108
- avatar?: string;
109
- }
110
-
111
146
  type ThemePreference = "light" | "dark" | "auto";
112
147
  type ResolvedTheme = "light" | "dark";
113
148
  interface ViewStackEntry {
@@ -115,20 +150,13 @@ interface ViewStackEntry {
115
150
  ref: EntityRef | null;
116
151
  }
117
152
  interface SessionSnapshot {
118
- hover: EntityRef | null;
119
- selection: EntityRef | null;
120
153
  stack: ViewStackEntry[];
121
154
  /** Sticky overlay highlight. Set by "Highlight Element" actions; cleared on Esc. */
122
155
  pinnedHighlight: EntityRef | null;
123
- inspectorActive: boolean;
156
+ /** Mirrored from the mode store; the surface mode the session is currently in. */
157
+ mode: SurfaceMode;
124
158
  theme: ThemePreference;
125
159
  resolvedTheme: ResolvedTheme;
126
- ingestActive: boolean;
127
- /**
128
- * Identity for the local user. Set once at session creation; gates realtime
129
- * features (cursor labels, presence) and auto-populates report attribution.
130
- */
131
- user: UserIdentity | null;
132
160
  }
133
161
  type SessionState = SessionSnapshot;
134
162
 
@@ -138,7 +166,6 @@ interface NavigationState {
138
166
  interface NavigationActions {
139
167
  push(entry: ViewStackEntry): void;
140
168
  pop(): void;
141
- replace(entry: ViewStackEntry): void;
142
169
  clear(): void;
143
170
  reset(stack: ViewStackEntry[]): void;
144
171
  }
@@ -149,7 +176,6 @@ type NavigationStore = StoreApi<NavigationState> & {
149
176
  type SurfaceMode = "idle" | "inspecting" | "palette" | "viewing";
150
177
  interface ModeSnapshot {
151
178
  mode: SurfaceMode;
152
- inspectorActive: boolean;
153
179
  }
154
180
  interface ModeTransitions {
155
181
  openPalette(): void;
@@ -175,11 +201,11 @@ type SessionStore = StoreApi<SessionState> & {
175
201
  readonly nav: NavigationStore;
176
202
  readonly mode: ModeStore;
177
203
  readonly highlight: HighlightActions;
178
- select(ref: EntityRef | null): void;
179
204
  setTheme(theme: ThemePreference, resolved?: ResolvedTheme): void;
180
- setIngest(active: boolean): void;
181
205
  };
182
206
 
207
+ type Corner = "top-left" | "top-right" | "bottom-left" | "bottom-right";
208
+
183
209
  interface OverlayShowOptions {
184
210
  label?: string;
185
211
  color?: string;
@@ -190,8 +216,6 @@ interface OverlayShowOptions {
190
216
  backdrop?: boolean;
191
217
  }
192
218
 
193
- type Corner = "top-left" | "top-right" | "bottom-left" | "bottom-right";
194
-
195
219
  interface CreateHeadlessOptions {
196
220
  theme?: ThemePreference;
197
221
  resolvedTheme?: ResolvedTheme;