@almadar/ui 2.13.3 → 2.14.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 (34) hide show
  1. package/dist/chunk-4N3BAPDB.js +1667 -0
  2. package/dist/{chunk-PERGHHON.js → chunk-IRIGCHP4.js} +2 -12
  3. package/dist/{chunk-UNDQO6DL.js → chunk-M7MOIE46.js} +3 -3
  4. package/dist/{chunk-Y7IHEYYE.js → chunk-QU2X55WH.js} +11 -1
  5. package/dist/{chunk-MSLMORZK.js → chunk-SKWPSQHQ.js} +13418 -2256
  6. package/dist/{chunk-4ZBSL37D.js → chunk-XL7WB2O5.js} +415 -58
  7. package/dist/components/index.css +508 -0
  8. package/dist/components/index.js +769 -11187
  9. package/dist/components/organisms/game/three/index.js +49 -1709
  10. package/dist/hooks/index.js +2 -2
  11. package/dist/lib/index.js +1 -3
  12. package/dist/providers/index.css +599 -0
  13. package/dist/providers/index.js +5 -4
  14. package/dist/runtime/index.css +599 -0
  15. package/dist/runtime/index.js +6 -6
  16. package/package.json +5 -4
  17. package/dist/ThemeContext-D9xUORq5.d.ts +0 -105
  18. package/dist/chunk-42YQ6JVR.js +0 -48
  19. package/dist/chunk-WCTZ7WZX.js +0 -311
  20. package/dist/cn-C_ATNPvi.d.ts +0 -332
  21. package/dist/components/index.d.ts +0 -9788
  22. package/dist/components/organisms/game/three/index.d.ts +0 -1233
  23. package/dist/context/index.d.ts +0 -208
  24. package/dist/event-bus-types-CjJduURa.d.ts +0 -73
  25. package/dist/hooks/index.d.ts +0 -1221
  26. package/dist/isometric-ynNHVPZx.d.ts +0 -111
  27. package/dist/lib/index.d.ts +0 -320
  28. package/dist/locales/index.d.ts +0 -22
  29. package/dist/offline-executor-CHr4uAhf.d.ts +0 -401
  30. package/dist/providers/index.d.ts +0 -465
  31. package/dist/renderer/index.d.ts +0 -525
  32. package/dist/runtime/index.d.ts +0 -280
  33. package/dist/stores/index.d.ts +0 -151
  34. package/dist/useUISlots-BBjNvQtb.d.ts +0 -85
@@ -1,332 +0,0 @@
1
- import { ClassValue } from 'clsx';
2
-
3
- /**
4
- * Orbital State Machine Visualizer
5
- *
6
- * Renders SVG diagrams from Orbital schemas and Trait definitions.
7
- * Can be used in documentation, IDE previews, and other tools.
8
- */
9
- interface VisualizerConfig {
10
- nodeRadius: number;
11
- nodeSpacing: number;
12
- initialIndicatorOffset: number;
13
- arrowSize: number;
14
- colors: {
15
- background: string;
16
- node: string;
17
- nodeBorder: string;
18
- nodeText: string;
19
- initialNode: string;
20
- finalNode: string;
21
- arrow: string;
22
- arrowText: string;
23
- effectText: string;
24
- guardText: string;
25
- initial: string;
26
- };
27
- fonts: {
28
- node: string;
29
- event: string;
30
- effect: string;
31
- };
32
- }
33
- interface StateDefinition {
34
- name: string;
35
- isInitial?: boolean;
36
- isFinal?: boolean;
37
- description?: string;
38
- }
39
- interface TransitionDefinition {
40
- from: string;
41
- to: string;
42
- event: string;
43
- guard?: unknown;
44
- effects?: unknown[];
45
- }
46
- interface StateMachineDefinition {
47
- states: StateDefinition[];
48
- transitions: TransitionDefinition[];
49
- }
50
- interface EntityDefinition {
51
- name: string;
52
- fields?: (string | {
53
- name: string;
54
- })[];
55
- }
56
- interface RenderOptions {
57
- title?: string;
58
- entity?: EntityDefinition;
59
- }
60
- /** Position data for a state node in DOM layout */
61
- interface DomStateNode {
62
- id: string;
63
- name: string;
64
- x: number;
65
- y: number;
66
- radius: number;
67
- isInitial: boolean;
68
- isFinal: boolean;
69
- description?: string;
70
- }
71
- /** Position data for a transition arrow */
72
- interface DomTransitionPath {
73
- id: string;
74
- from: string;
75
- to: string;
76
- /** SVG path data for the curved arrow */
77
- pathData: string;
78
- /** Midpoint for label positioning */
79
- labelX: number;
80
- labelY: number;
81
- }
82
- /** Position data for a transition label with guard/effect details */
83
- interface DomTransitionLabel {
84
- id: string;
85
- from: string;
86
- to: string;
87
- event: string;
88
- x: number;
89
- y: number;
90
- /** Human-readable guard text (e.g., "if amount > 100") */
91
- guardText?: string;
92
- /** Human-readable effect texts */
93
- effectTexts: string[];
94
- /** Whether this transition has details to show in tooltip */
95
- hasDetails: boolean;
96
- }
97
- /** Entity input box data */
98
- interface DomEntityBox {
99
- name: string;
100
- fields: string[];
101
- x: number;
102
- y: number;
103
- width: number;
104
- height: number;
105
- }
106
- /** Output effects box data */
107
- interface DomOutputsBox {
108
- outputs: string[];
109
- x: number;
110
- y: number;
111
- width: number;
112
- height: number;
113
- }
114
- /** Complete DOM layout data for rendering */
115
- interface DomLayoutData {
116
- width: number;
117
- height: number;
118
- title?: string;
119
- states: DomStateNode[];
120
- paths: DomTransitionPath[];
121
- labels: DomTransitionLabel[];
122
- entity?: DomEntityBox;
123
- outputs?: DomOutputsBox;
124
- config: VisualizerConfig;
125
- }
126
- declare const DEFAULT_CONFIG: VisualizerConfig;
127
- declare function formatGuard(guard: unknown): string;
128
- declare function getEffectSummary(effects: unknown[]): string;
129
- declare function extractOutputsFromTransitions(transitions: TransitionDefinition[]): string[];
130
- /**
131
- * Render a state machine to an SVG string.
132
- * Works in both browser and Node.js environments.
133
- */
134
- declare function renderStateMachineToSvg(stateMachine: StateMachineDefinition, options?: RenderOptions, config?: VisualizerConfig): string;
135
- /**
136
- * Extract state machine from various data formats (Trait, Orbital, or raw)
137
- */
138
- declare function extractStateMachine(data: unknown): StateMachineDefinition | null;
139
- /**
140
- * Render a state machine to DOM layout data.
141
- * This is used by the DOM-based visualizer component for hybrid SVG/DOM rendering.
142
- * Unlike renderStateMachineToSvg, this returns structured data instead of an SVG string.
143
- */
144
- declare function renderStateMachineToDomData(stateMachine: StateMachineDefinition, options?: RenderOptions, config?: VisualizerConfig): DomLayoutData;
145
-
146
- /**
147
- * Content Segment Parsing Utilities
148
- *
149
- * Parses rich content with code blocks and quiz tags into structured
150
- * segments for rendering. Detects orbital schemas in JSON code blocks
151
- * and marks them for JazariStateMachine rendering.
152
- */
153
- /** Segment types for content rendering */
154
- type ContentSegment = {
155
- type: 'markdown';
156
- content: string;
157
- } | {
158
- type: 'code';
159
- language: string;
160
- content: string;
161
- } | {
162
- type: 'orbital';
163
- language: string;
164
- content: string;
165
- schema: unknown;
166
- } | {
167
- type: 'quiz';
168
- question: string;
169
- answer: string;
170
- };
171
- /**
172
- * Parse markdown content to extract code blocks.
173
- *
174
- * Splits markdown into segments of plain markdown and fenced code blocks.
175
- * JSON/orb code blocks containing orbital schemas are tagged as 'orbital'.
176
- */
177
- declare function parseMarkdownWithCodeBlocks(content: string | undefined | null): ContentSegment[];
178
- /**
179
- * Parse content to extract all segments including quiz tags and code blocks.
180
- *
181
- * Supported tags:
182
- * - <question>q</question><answer>a</answer> — Quiz Q&A
183
- *
184
- * Also handles fenced code blocks (```language...```) with orbital detection.
185
- */
186
- declare function parseContentSegments(content: string | undefined | null): ContentSegment[];
187
-
188
- /**
189
- * Verification Registry - Tracks runtime verification checks and transition traces
190
- *
191
- * Provides:
192
- * 1. A checklist of pass/fail checks (INIT has fetch, bridge connected, etc.)
193
- * 2. A full transition timeline with effect execution results
194
- * 3. ServerBridge health snapshot
195
- * 4. window.__orbitalVerification for Playwright/automation
196
- *
197
- * @packageDocumentation
198
- */
199
- type CheckStatus = "pass" | "fail" | "pending" | "warn";
200
- interface VerificationCheck {
201
- id: string;
202
- label: string;
203
- status: CheckStatus;
204
- details?: string;
205
- /** Timestamp when status last changed */
206
- updatedAt: number;
207
- }
208
- interface EffectTrace {
209
- type: string;
210
- args: unknown[];
211
- status: "executed" | "failed" | "skipped";
212
- error?: string;
213
- durationMs?: number;
214
- }
215
- interface TransitionTrace {
216
- id: string;
217
- traitName: string;
218
- from: string;
219
- to: string;
220
- event: string;
221
- guardExpression?: string;
222
- guardResult?: boolean;
223
- effects: EffectTrace[];
224
- timestamp: number;
225
- }
226
- interface BridgeHealth {
227
- connected: boolean;
228
- eventsForwarded: number;
229
- eventsReceived: number;
230
- lastError?: string;
231
- lastHeartbeat: number;
232
- }
233
- interface VerificationSummary {
234
- totalChecks: number;
235
- passed: number;
236
- failed: number;
237
- warnings: number;
238
- pending: number;
239
- }
240
- interface VerificationSnapshot {
241
- checks: VerificationCheck[];
242
- transitions: TransitionTrace[];
243
- bridge: BridgeHealth | null;
244
- summary: VerificationSummary;
245
- }
246
- type ChangeListener = () => void;
247
- declare function registerCheck(id: string, label: string, status?: CheckStatus, details?: string): void;
248
- declare function updateCheck(id: string, status: CheckStatus, details?: string): void;
249
- declare function getAllChecks(): VerificationCheck[];
250
- declare function recordTransition(trace: Omit<TransitionTrace, "id">): void;
251
- declare function getTransitions(): TransitionTrace[];
252
- declare function getTransitionsForTrait(traitName: string): TransitionTrace[];
253
- declare function updateBridgeHealth(health: BridgeHealth): void;
254
- declare function getBridgeHealth(): BridgeHealth | null;
255
- declare function getSummary(): VerificationSummary;
256
- declare function getSnapshot(): VerificationSnapshot;
257
- declare function subscribeToVerification(listener: ChangeListener): () => void;
258
- /** Asset load status for canvas verification */
259
- type AssetLoadStatus = "loaded" | "failed" | "pending";
260
- /** Event bus log entry for verification */
261
- interface EventLogEntry {
262
- type: string;
263
- payload?: Record<string, unknown>;
264
- timestamp: number;
265
- }
266
- /** Exposed on window for Playwright to query */
267
- interface OrbitalVerificationAPI {
268
- getSnapshot: () => VerificationSnapshot;
269
- getChecks: () => VerificationCheck[];
270
- getTransitions: () => TransitionTrace[];
271
- getBridge: () => BridgeHealth | null;
272
- getSummary: () => VerificationSummary;
273
- /** Wait for a specific event to be processed */
274
- waitForTransition: (event: string, timeoutMs?: number) => Promise<TransitionTrace | null>;
275
- /** Send an event into the runtime (requires eventBus binding) */
276
- sendEvent?: (event: string, payload?: Record<string, unknown>) => void;
277
- /** Get current trait state */
278
- getTraitState?: (traitName: string) => string | undefined;
279
- /** Capture a canvas frame as PNG data URL. Registered by game organisms. */
280
- captureFrame?: () => string | null;
281
- /** Asset load status map. Registered by game organisms. */
282
- assetStatus?: Record<string, AssetLoadStatus>;
283
- /** Event bus log. Records all emit() calls for verification. */
284
- eventLog?: EventLogEntry[];
285
- /** Clear the event log. */
286
- clearEventLog?: () => void;
287
- }
288
- declare global {
289
- interface Window {
290
- __orbitalVerification?: OrbitalVerificationAPI;
291
- }
292
- }
293
- /**
294
- * Wait for a transition matching the given event to appear.
295
- * Returns the trace or null on timeout.
296
- */
297
- declare function waitForTransition(event: string, timeoutMs?: number): Promise<TransitionTrace | null>;
298
- /**
299
- * Bind the EventBus so automation can send events and log emissions.
300
- * Call this during app initialization.
301
- */
302
- declare function bindEventBus(eventBus: {
303
- emit: (type: string, payload?: Record<string, unknown>) => void;
304
- onAny?: (listener: (event: {
305
- type: string;
306
- payload?: Record<string, unknown>;
307
- }) => void) => () => void;
308
- }): void;
309
- /**
310
- * Bind a trait state getter so automation can query current states.
311
- */
312
- declare function bindTraitStateGetter(getter: (traitName: string) => string | undefined): void;
313
- /**
314
- * Register a canvas frame capture function.
315
- * Called by game organisms (IsometricCanvas, PlatformerCanvas, SimulationCanvas)
316
- * so the verifier can snapshot canvas content at checkpoints.
317
- */
318
- declare function bindCanvasCapture(captureFn: () => string | null): void;
319
- /**
320
- * Update asset load status for canvas verification.
321
- * Game organisms call this when images load or fail.
322
- */
323
- declare function updateAssetStatus(url: string, status: AssetLoadStatus): void;
324
- declare function clearVerification(): void;
325
-
326
- /**
327
- * Utility function to merge Tailwind CSS classes
328
- * Combines clsx for conditional classes with tailwind-merge to handle conflicts
329
- */
330
- declare function cn(...inputs: ClassValue[]): string;
331
-
332
- export { type AssetLoadStatus as A, type BridgeHealth as B, type CheckStatus as C, DEFAULT_CONFIG as D, type EffectTrace as E, getSummary as F, getTransitions as G, getTransitionsForTrait as H, parseContentSegments as I, parseMarkdownWithCodeBlocks as J, recordTransition as K, registerCheck as L, renderStateMachineToDomData as M, renderStateMachineToSvg as N, subscribeToVerification as O, updateAssetStatus as P, updateBridgeHealth as Q, type RenderOptions as R, type StateDefinition as S, type TransitionDefinition as T, updateCheck as U, type VerificationCheck as V, waitForTransition as W, type ContentSegment as a, type DomEntityBox as b, type DomLayoutData as c, type DomOutputsBox as d, type DomStateNode as e, type DomTransitionLabel as f, type DomTransitionPath as g, type EntityDefinition as h, type EventLogEntry as i, type StateMachineDefinition as j, type TransitionTrace as k, type VerificationSnapshot as l, type VerificationSummary as m, type VisualizerConfig as n, bindCanvasCapture as o, bindEventBus as p, bindTraitStateGetter as q, clearVerification as r, cn as s, extractOutputsFromTransitions as t, extractStateMachine as u, formatGuard as v, getAllChecks as w, getBridgeHealth as x, getEffectSummary as y, getSnapshot as z };