@almadar/ui 6.10.0 → 6.11.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 (35) hide show
  1. package/dist/{EntityBindingContext-Y4zXyNJZ.d.cts → EntityBindingContext-D5lRu6p1.d.cts} +11 -0
  2. package/dist/{EntityBindingContext-Y4zXyNJZ.d.ts → EntityBindingContext-D5lRu6p1.d.ts} +11 -0
  3. package/dist/{GameAudioProvider-Dk_Y3LN3.d.cts → GameAudioProvider-D8GynTNq.d.cts} +1 -1
  4. package/dist/{GameAudioProvider-Ctceau1s.d.ts → GameAudioProvider-Dozqx4sL.d.ts} +1 -1
  5. package/dist/avl/index.cjs +250 -106
  6. package/dist/avl/index.js +209 -65
  7. package/dist/{avl-schema-parser-DncJLEn9.d.ts → avl-schema-parser-DX-aVCCm.d.ts} +1 -1
  8. package/dist/{avl-schema-parser-FQ1474v8.d.cts → avl-schema-parser-PVu8rgsy.d.cts} +1 -1
  9. package/dist/{cn-C7fvp9gH.d.ts → cn-Do5gsPBm.d.cts} +2 -100
  10. package/dist/{cn-DnLYahyL.d.cts → cn-Do5gsPBm.d.ts} +2 -100
  11. package/dist/components/index.cjs +103 -68
  12. package/dist/components/index.d.cts +44 -20
  13. package/dist/components/index.d.ts +44 -20
  14. package/dist/components/index.js +64 -29
  15. package/dist/lib/drawable/three/index.d.cts +3 -4
  16. package/dist/lib/drawable/three/index.d.ts +3 -4
  17. package/dist/lib/index.cjs +7 -23
  18. package/dist/lib/index.d.cts +6 -28
  19. package/dist/lib/index.d.ts +6 -28
  20. package/dist/lib/index.js +5 -23
  21. package/dist/{paintDispatch-B5ObLnUv.d.ts → paintDispatch-CK5uwYEq.d.cts} +50 -3
  22. package/dist/{paintDispatch-D3R8NNmV.d.cts → paintDispatch-CK5uwYEq.d.ts} +50 -3
  23. package/dist/providers/index.cjs +129 -78
  24. package/dist/providers/index.d.cts +5 -3
  25. package/dist/providers/index.d.ts +5 -3
  26. package/dist/providers/index.js +90 -39
  27. package/dist/runtime/index.cjs +249 -105
  28. package/dist/runtime/index.d.cts +27 -5
  29. package/dist/runtime/index.d.ts +27 -5
  30. package/dist/runtime/index.js +208 -64
  31. package/dist/verificationRegistry-BLsjb1oU.d.cts +110 -0
  32. package/dist/verificationRegistry-D8bHWD8Q.d.ts +110 -0
  33. package/package.json +7 -7
  34. package/dist/types-B3nHgnMG.d.cts +0 -51
  35. package/dist/types-B3nHgnMG.d.ts +0 -51
@@ -0,0 +1,110 @@
1
+ import { D as DrawableNode } from './paintDispatch-CK5uwYEq.cjs';
2
+ import { OrbitalVerificationAPI, TraitStateSnapshot, EventPayload, BusEvent, VerificationCheck, BridgeHealth, VerificationSnapshot, VerificationSummary, TransitionTrace, ServerResponseTrace, EffectTrace, CheckStatus, AssetLoadStatus } from '@almadar/core';
3
+
4
+ /**
5
+ * Verification Registry - Tracks runtime verification checks and transition traces
6
+ *
7
+ * Provides:
8
+ * 1. A checklist of pass/fail checks (INIT has fetch, bridge connected, etc.)
9
+ * 2. A full transition timeline with effect execution results
10
+ * 3. ServerBridge health snapshot
11
+ * 4. window.__orbitalVerification for Playwright/automation
12
+ *
13
+ * @packageDocumentation
14
+ */
15
+
16
+ type ChangeListener = () => void;
17
+ /**
18
+ * Per-trait snapshot getter. Each generated trait logic hook (or
19
+ * `useTraitStateMachine` trait binding) registers one on mount so the
20
+ * verifier can read the live reducer state for that trait.
21
+ */
22
+ type TraitSnapshotGetter = () => TraitStateSnapshot;
23
+ declare function registerCheck(id: string, label: string, status?: CheckStatus, details?: string): void;
24
+ declare function updateCheck(id: string, status: CheckStatus, details?: string): void;
25
+ declare function getAllChecks(): VerificationCheck[];
26
+ declare function recordTransition(trace: Omit<TransitionTrace, "id">): void;
27
+ declare function getTransitions(): TransitionTrace[];
28
+ declare function getTransitionsForTrait(traitName: string): TransitionTrace[];
29
+ /**
30
+ * Record a server response as a timeline entry.
31
+ * Creates a synthetic transition entry with type "server-response" to show
32
+ * what the server returned (clientEffects, data counts, emitted events).
33
+ *
34
+ * `effectResults` — the server's persist/set/call-service outcomes, already
35
+ * mapped to `EffectTrace` by the caller — populate `entry.effects` so a
36
+ * denied or failed persist is visible on this synthetic entry too. Before
37
+ * this it was always `[]`: the ONLY entry the driver's per-event
38
+ * `server:<orbital>` lookup (`default-snapshot.ts`'s `lastEffectResultsFor`)
39
+ * can find carried nothing.
40
+ */
41
+ declare function recordServerResponse(orbitalName: string, event: string, response: Omit<ServerResponseTrace, "orbitalName" | "timestamp"> & {
42
+ effectResults?: EffectTrace[];
43
+ }): void;
44
+ declare function updateBridgeHealth(health: BridgeHealth): void;
45
+ declare function getBridgeHealth(): BridgeHealth | null;
46
+ declare function getSummary(): VerificationSummary;
47
+ declare function getSnapshot(): VerificationSnapshot;
48
+ /**
49
+ * Per-trait snapshot for the verifier.
50
+ *
51
+ * Iterates every registered trait getter and collects the live reducer
52
+ * state. Empty until at least one trait hook calls `registerTraitSnapshot`.
53
+ * A getter that throws is logged and skipped — one broken trait must not
54
+ * poison the rest of the snapshot.
55
+ */
56
+ declare function getTraitSnapshots(): TraitStateSnapshot[];
57
+ declare function subscribeToVerification(listener: ChangeListener): () => void;
58
+ declare global {
59
+ interface Window {
60
+ __orbitalVerification?: OrbitalVerificationAPI;
61
+ }
62
+ }
63
+ /**
64
+ * Wait for a transition matching the given event to appear.
65
+ * Returns the trace or null on timeout.
66
+ */
67
+ declare function waitForTransition(event: string, timeoutMs?: number): Promise<TransitionTrace | null>;
68
+ /**
69
+ * Bind the EventBus so automation can send events and log emissions.
70
+ * Call this during app initialization.
71
+ */
72
+ declare function bindEventBus(eventBus: {
73
+ emit: (type: string, payload?: EventPayload) => void;
74
+ onAny?: (listener: (event: BusEvent) => void) => () => void;
75
+ }): void;
76
+ /**
77
+ * Bind a trait state getter so automation can query current states.
78
+ */
79
+ declare function bindTraitStateGetter(getter: (traitName: string) => string | undefined): void;
80
+ /**
81
+ * Register a per-trait snapshot provider. The generated trait logic hook
82
+ * (or `useTraitStateMachine`) calls this once on mount, passing a getter
83
+ * that reads the current reducer state via a ref. Returns an unregister
84
+ * function for cleanup on unmount.
85
+ *
86
+ * Calling this twice for the same `traitName` replaces the previous
87
+ * getter (e.g. page navigation remounts the trait; the new registration
88
+ * wins).
89
+ */
90
+ declare function registerTraitSnapshot(traitName: string, getter: TraitSnapshotGetter): () => void;
91
+ /**
92
+ * Register a canvas frame capture function.
93
+ * Called by game organisms (IsometricCanvas, PlatformerCanvas)
94
+ * so the verifier can snapshot canvas content at checkpoints.
95
+ */
96
+ declare function bindCanvasCapture(captureFn: () => string | null): void;
97
+ /**
98
+ * Bind a reader for the last drawables list received by a canvas host.
99
+ * Lets verification scripts inspect exactly which neutral descriptors reached
100
+ * the painter without re-deriving them from state.
101
+ */
102
+ declare function bindLastDrawables(getDrawables: () => DrawableNode[] | null): void;
103
+ /**
104
+ * Update asset load status for canvas verification.
105
+ * Game organisms call this when images load or fail.
106
+ */
107
+ declare function updateAssetStatus(url: string, status: AssetLoadStatus): void;
108
+ declare function clearVerification(): void;
109
+
110
+ export { type TraitSnapshotGetter as T, bindEventBus as a, bindCanvasCapture as b, bindLastDrawables as c, bindTraitStateGetter as d, clearVerification as e, getBridgeHealth as f, getAllChecks as g, getSnapshot as h, getSummary as i, getTraitSnapshots as j, getTransitions as k, getTransitionsForTrait as l, recordTransition as m, registerCheck as n, registerTraitSnapshot as o, updateBridgeHealth as p, updateCheck as q, recordServerResponse as r, subscribeToVerification as s, updateAssetStatus as u, waitForTransition as w };
@@ -0,0 +1,110 @@
1
+ import { D as DrawableNode } from './paintDispatch-CK5uwYEq.js';
2
+ import { OrbitalVerificationAPI, TraitStateSnapshot, EventPayload, BusEvent, VerificationCheck, BridgeHealth, VerificationSnapshot, VerificationSummary, TransitionTrace, ServerResponseTrace, EffectTrace, CheckStatus, AssetLoadStatus } from '@almadar/core';
3
+
4
+ /**
5
+ * Verification Registry - Tracks runtime verification checks and transition traces
6
+ *
7
+ * Provides:
8
+ * 1. A checklist of pass/fail checks (INIT has fetch, bridge connected, etc.)
9
+ * 2. A full transition timeline with effect execution results
10
+ * 3. ServerBridge health snapshot
11
+ * 4. window.__orbitalVerification for Playwright/automation
12
+ *
13
+ * @packageDocumentation
14
+ */
15
+
16
+ type ChangeListener = () => void;
17
+ /**
18
+ * Per-trait snapshot getter. Each generated trait logic hook (or
19
+ * `useTraitStateMachine` trait binding) registers one on mount so the
20
+ * verifier can read the live reducer state for that trait.
21
+ */
22
+ type TraitSnapshotGetter = () => TraitStateSnapshot;
23
+ declare function registerCheck(id: string, label: string, status?: CheckStatus, details?: string): void;
24
+ declare function updateCheck(id: string, status: CheckStatus, details?: string): void;
25
+ declare function getAllChecks(): VerificationCheck[];
26
+ declare function recordTransition(trace: Omit<TransitionTrace, "id">): void;
27
+ declare function getTransitions(): TransitionTrace[];
28
+ declare function getTransitionsForTrait(traitName: string): TransitionTrace[];
29
+ /**
30
+ * Record a server response as a timeline entry.
31
+ * Creates a synthetic transition entry with type "server-response" to show
32
+ * what the server returned (clientEffects, data counts, emitted events).
33
+ *
34
+ * `effectResults` — the server's persist/set/call-service outcomes, already
35
+ * mapped to `EffectTrace` by the caller — populate `entry.effects` so a
36
+ * denied or failed persist is visible on this synthetic entry too. Before
37
+ * this it was always `[]`: the ONLY entry the driver's per-event
38
+ * `server:<orbital>` lookup (`default-snapshot.ts`'s `lastEffectResultsFor`)
39
+ * can find carried nothing.
40
+ */
41
+ declare function recordServerResponse(orbitalName: string, event: string, response: Omit<ServerResponseTrace, "orbitalName" | "timestamp"> & {
42
+ effectResults?: EffectTrace[];
43
+ }): void;
44
+ declare function updateBridgeHealth(health: BridgeHealth): void;
45
+ declare function getBridgeHealth(): BridgeHealth | null;
46
+ declare function getSummary(): VerificationSummary;
47
+ declare function getSnapshot(): VerificationSnapshot;
48
+ /**
49
+ * Per-trait snapshot for the verifier.
50
+ *
51
+ * Iterates every registered trait getter and collects the live reducer
52
+ * state. Empty until at least one trait hook calls `registerTraitSnapshot`.
53
+ * A getter that throws is logged and skipped — one broken trait must not
54
+ * poison the rest of the snapshot.
55
+ */
56
+ declare function getTraitSnapshots(): TraitStateSnapshot[];
57
+ declare function subscribeToVerification(listener: ChangeListener): () => void;
58
+ declare global {
59
+ interface Window {
60
+ __orbitalVerification?: OrbitalVerificationAPI;
61
+ }
62
+ }
63
+ /**
64
+ * Wait for a transition matching the given event to appear.
65
+ * Returns the trace or null on timeout.
66
+ */
67
+ declare function waitForTransition(event: string, timeoutMs?: number): Promise<TransitionTrace | null>;
68
+ /**
69
+ * Bind the EventBus so automation can send events and log emissions.
70
+ * Call this during app initialization.
71
+ */
72
+ declare function bindEventBus(eventBus: {
73
+ emit: (type: string, payload?: EventPayload) => void;
74
+ onAny?: (listener: (event: BusEvent) => void) => () => void;
75
+ }): void;
76
+ /**
77
+ * Bind a trait state getter so automation can query current states.
78
+ */
79
+ declare function bindTraitStateGetter(getter: (traitName: string) => string | undefined): void;
80
+ /**
81
+ * Register a per-trait snapshot provider. The generated trait logic hook
82
+ * (or `useTraitStateMachine`) calls this once on mount, passing a getter
83
+ * that reads the current reducer state via a ref. Returns an unregister
84
+ * function for cleanup on unmount.
85
+ *
86
+ * Calling this twice for the same `traitName` replaces the previous
87
+ * getter (e.g. page navigation remounts the trait; the new registration
88
+ * wins).
89
+ */
90
+ declare function registerTraitSnapshot(traitName: string, getter: TraitSnapshotGetter): () => void;
91
+ /**
92
+ * Register a canvas frame capture function.
93
+ * Called by game organisms (IsometricCanvas, PlatformerCanvas)
94
+ * so the verifier can snapshot canvas content at checkpoints.
95
+ */
96
+ declare function bindCanvasCapture(captureFn: () => string | null): void;
97
+ /**
98
+ * Bind a reader for the last drawables list received by a canvas host.
99
+ * Lets verification scripts inspect exactly which neutral descriptors reached
100
+ * the painter without re-deriving them from state.
101
+ */
102
+ declare function bindLastDrawables(getDrawables: () => DrawableNode[] | null): void;
103
+ /**
104
+ * Update asset load status for canvas verification.
105
+ * Game organisms call this when images load or fail.
106
+ */
107
+ declare function updateAssetStatus(url: string, status: AssetLoadStatus): void;
108
+ declare function clearVerification(): void;
109
+
110
+ export { type TraitSnapshotGetter as T, bindEventBus as a, bindCanvasCapture as b, bindLastDrawables as c, bindTraitStateGetter as d, clearVerification as e, getBridgeHealth as f, getAllChecks as g, getSnapshot as h, getSummary as i, getTraitSnapshots as j, getTransitions as k, getTransitionsForTrait as l, recordTransition as m, registerCheck as n, registerTraitSnapshot as o, updateBridgeHealth as p, updateCheck as q, recordServerResponse as r, subscribeToVerification as s, updateAssetStatus as u, waitForTransition as w };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "6.10.0",
3
+ "version": "6.11.0",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -118,12 +118,12 @@
118
118
  "access": "public"
119
119
  },
120
120
  "dependencies": {
121
- "@almadar/core": "^10.86.0",
122
- "@almadar/evaluator": "^2.44.0",
121
+ "@almadar/core": "^10.87.0",
122
+ "@almadar/evaluator": "^2.45.0",
123
123
  "@almadar/logger": "^1.12.0",
124
- "@almadar/runtime": "^6.71.0",
125
- "@almadar/std": "^16.207.0",
126
- "@almadar/syntax": "^1.16.0",
124
+ "@almadar/runtime": "^6.72.0",
125
+ "@almadar/std": "^16.208.0",
126
+ "@almadar/syntax": "^1.17.0",
127
127
  "@dnd-kit/core": "^6.3.1",
128
128
  "@dnd-kit/sortable": "^10.0.0",
129
129
  "@dnd-kit/utilities": "^3.2.2",
@@ -174,7 +174,7 @@
174
174
  }
175
175
  },
176
176
  "devDependencies": {
177
- "@almadar/eslint-plugin": "^2.17.0",
177
+ "@almadar/eslint-plugin": "^2.18.0",
178
178
  "@react-three/drei": "^10.7.7",
179
179
  "@react-three/fiber": "^9.6.0",
180
180
  "@react-three/postprocessing": "3.0.4",
@@ -1,51 +0,0 @@
1
- import { AssetUrl } from '@almadar/core';
2
-
3
- /**
4
- * Cross-cutting atom-level prop shapes shared across the design system.
5
- */
6
-
7
- /**
8
- * Canonical semantic color palette. Values are the Tailwind / CSS-var token
9
- * names that every component in the design system understands. Prefer this
10
- * over a bare `string` for any `color` or `variant` prop.
11
- */
12
- type ColorToken = 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'muted';
13
- /**
14
- * Concrete error-state shape read by display components (`error.message`,
15
- * occasionally `error.stack`). Structurally assignable from the global `Error`,
16
- * so existing call sites passing an `Error` keep working — this just gives the
17
- * pattern extractor a readable field schema instead of the opaque `Error` global.
18
- */
19
- type UiError = {
20
- message: string;
21
- name?: string;
22
- code?: string;
23
- stack?: string;
24
- };
25
- /**
26
- * A labelled link/CTA used by marketing molecules (HeroSection, CTABanner,
27
- * PricingCard) for their primary/secondary call-to-action props.
28
- */
29
- type LinkAction = {
30
- label: string;
31
- href: string;
32
- };
33
- /** An image with its required alt text. */
34
- type ImageSource = {
35
- src: AssetUrl;
36
- alt: string;
37
- };
38
- /** A 2D point in canvas/layout coordinates. */
39
- type Point = {
40
- x: number;
41
- y: number;
42
- };
43
- /** A 2D rectangle in canvas coordinates (`w`/`h` = width/height). */
44
- type Rect = {
45
- x: number;
46
- y: number;
47
- w: number;
48
- h: number;
49
- };
50
-
51
- export type { ColorToken as C, ImageSource as I, LinkAction as L, Point as P, Rect as R, UiError as U };
@@ -1,51 +0,0 @@
1
- import { AssetUrl } from '@almadar/core';
2
-
3
- /**
4
- * Cross-cutting atom-level prop shapes shared across the design system.
5
- */
6
-
7
- /**
8
- * Canonical semantic color palette. Values are the Tailwind / CSS-var token
9
- * names that every component in the design system understands. Prefer this
10
- * over a bare `string` for any `color` or `variant` prop.
11
- */
12
- type ColorToken = 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'muted';
13
- /**
14
- * Concrete error-state shape read by display components (`error.message`,
15
- * occasionally `error.stack`). Structurally assignable from the global `Error`,
16
- * so existing call sites passing an `Error` keep working — this just gives the
17
- * pattern extractor a readable field schema instead of the opaque `Error` global.
18
- */
19
- type UiError = {
20
- message: string;
21
- name?: string;
22
- code?: string;
23
- stack?: string;
24
- };
25
- /**
26
- * A labelled link/CTA used by marketing molecules (HeroSection, CTABanner,
27
- * PricingCard) for their primary/secondary call-to-action props.
28
- */
29
- type LinkAction = {
30
- label: string;
31
- href: string;
32
- };
33
- /** An image with its required alt text. */
34
- type ImageSource = {
35
- src: AssetUrl;
36
- alt: string;
37
- };
38
- /** A 2D point in canvas/layout coordinates. */
39
- type Point = {
40
- x: number;
41
- y: number;
42
- };
43
- /** A 2D rectangle in canvas coordinates (`w`/`h` = width/height). */
44
- type Rect = {
45
- x: number;
46
- y: number;
47
- w: number;
48
- h: number;
49
- };
50
-
51
- export type { ColorToken as C, ImageSource as I, LinkAction as L, Point as P, Rect as R, UiError as U };