@mmapp/react 0.1.0-alpha.18 → 0.1.0-alpha.19

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 (52) hide show
  1. package/dist/actions-MFI2V4DX.mjs +116 -0
  2. package/dist/atoms/index.d.mts +2 -2
  3. package/dist/atoms/index.d.ts +2 -2
  4. package/dist/atoms/index.js +1 -1
  5. package/dist/atoms/index.mjs +1 -1
  6. package/dist/builtin-atoms-C-sNyYJl.d.mts +647 -0
  7. package/dist/builtin-atoms-C-sNyYJl.d.ts +647 -0
  8. package/dist/builtin-atoms-DCKrjG7i.d.mts +96 -0
  9. package/dist/builtin-atoms-DCKrjG7i.d.ts +96 -0
  10. package/dist/builtin-atoms-DRD3EwG6.d.mts +648 -0
  11. package/dist/builtin-atoms-DRD3EwG6.d.ts +648 -0
  12. package/dist/builtin-atoms-jt04b7Rw.d.mts +643 -0
  13. package/dist/builtin-atoms-jt04b7Rw.d.ts +643 -0
  14. package/dist/chunk-247T4GDJ.mjs +677 -0
  15. package/dist/chunk-3H6CR7E7.mjs +1924 -0
  16. package/dist/chunk-3PL6FL6I.mjs +96 -0
  17. package/dist/chunk-3SJSW3C4.mjs +2039 -0
  18. package/dist/chunk-5OI2VI57.mjs +1964 -0
  19. package/dist/chunk-CL6FYZ43.mjs +105 -0
  20. package/dist/chunk-ENQOCZI5.mjs +1938 -0
  21. package/dist/chunk-FB3WCZAU.mjs +512 -0
  22. package/dist/chunk-GLJ7VC7Z.mjs +684 -0
  23. package/dist/chunk-HHMWR6NA.mjs +504 -0
  24. package/dist/chunk-HULEMSN2.mjs +120 -0
  25. package/dist/chunk-J5MW6CRU.mjs +1938 -0
  26. package/dist/chunk-PNTTKNYU.mjs +677 -0
  27. package/dist/chunk-TY5OTJP4.mjs +684 -0
  28. package/dist/chunk-WV7DVCP6.mjs +513 -0
  29. package/dist/chunk-YFMPTGUF.mjs +677 -0
  30. package/dist/{chunk-2VJQJM7S.mjs → chunk-ZDWACXZN.mjs} +1 -1
  31. package/dist/composition-BJ6QQTWT.mjs +12 -0
  32. package/dist/composition-XBGKKCI7.mjs +57 -0
  33. package/dist/content-QVPFUG4P.mjs +246 -0
  34. package/dist/control-flow-CBREHWJW.mjs +35 -0
  35. package/dist/control-flow-FWBOI6SM.mjs +35 -0
  36. package/dist/control-flow-ZWUGCDSP.mjs +35 -0
  37. package/dist/data-WCMIZYKD.mjs +97 -0
  38. package/dist/grouping-E6F377VZ.mjs +204 -0
  39. package/dist/grouping-FRPOEXO3.mjs +233 -0
  40. package/dist/index.d.mts +4 -433
  41. package/dist/index.d.ts +4 -433
  42. package/dist/index.js +3648 -581
  43. package/dist/index.mjs +335 -1040
  44. package/dist/input-PUOZDNSI.mjs +222 -0
  45. package/dist/layout-RATDMCLP.mjs +106 -0
  46. package/dist/navigation-VCT7ZBMA.mjs +15 -0
  47. package/dist/navigation-WFV7YWOU.mjs +14 -0
  48. package/dist/player/index.d.mts +37 -11
  49. package/dist/player/index.d.ts +37 -11
  50. package/dist/player/index.js +3280 -174
  51. package/dist/player/index.mjs +55 -5
  52. package/package.json +4 -4
@@ -0,0 +1,647 @@
1
+ import * as React$1 from 'react';
2
+ import React__default from 'react';
3
+
4
+ /**
5
+ * Player Runtime Types
6
+ *
7
+ * Core type system for the player IR interpreter.
8
+ * Covers experience nodes, data sources, resolvers, scopes, and actions.
9
+ *
10
+ * Backward compatible — original ComponentNode/ComponentTree/AtomRegistry still exported.
11
+ */
12
+ interface ComponentNode {
13
+ type?: string;
14
+ component?: string;
15
+ props?: Record<string, unknown>;
16
+ config?: Record<string, unknown>;
17
+ id?: string;
18
+ className?: string;
19
+ children?: ComponentNode[] | string;
20
+ $if?: string;
21
+ $for?: {
22
+ each: string;
23
+ as: string;
24
+ key?: string;
25
+ };
26
+ }
27
+ type ComponentTree = ComponentNode | ComponentNode[];
28
+ type AtomComponent = React.ComponentType<Record<string, unknown>>;
29
+ type AtomRegistry = Record<string, AtomComponent>;
30
+ interface WorkflowInstance {
31
+ id: string;
32
+ definition_id?: string;
33
+ definition_slug?: string;
34
+ current_state: string;
35
+ status?: string;
36
+ state_data: Record<string, unknown>;
37
+ memory?: Record<string, unknown>;
38
+ action_results?: Record<string, unknown>;
39
+ context?: Record<string, unknown>;
40
+ created_at?: string;
41
+ updated_at?: string;
42
+ [key: string]: unknown;
43
+ }
44
+ interface WorkflowDefinition {
45
+ id: string;
46
+ slug: string;
47
+ name?: string;
48
+ description?: string;
49
+ version?: string;
50
+ category?: string;
51
+ fields?: FieldDefinition[];
52
+ states?: StateDefinition[];
53
+ transitions?: TransitionDefinition[];
54
+ roles?: RoleDefinition[];
55
+ experience?: ExperienceNode;
56
+ metadata?: Record<string, unknown>;
57
+ [key: string]: unknown;
58
+ }
59
+ interface FieldDefinition {
60
+ name: string;
61
+ field_type?: string;
62
+ type?: string;
63
+ required?: boolean;
64
+ default?: unknown;
65
+ label?: string;
66
+ description?: string;
67
+ options?: Array<{
68
+ value: string;
69
+ label: string;
70
+ }>;
71
+ visible_when?: string;
72
+ editable_when?: string;
73
+ [key: string]: unknown;
74
+ }
75
+ interface StateDefinition {
76
+ name: string;
77
+ type?: string;
78
+ on_enter?: ActionDefinition[];
79
+ on_exit?: ActionDefinition[];
80
+ metadata?: Record<string, unknown>;
81
+ [key: string]: unknown;
82
+ }
83
+ interface TransitionDefinition {
84
+ name: string;
85
+ from: string | string[];
86
+ to: string;
87
+ condition?: string;
88
+ required_roles?: string[];
89
+ required_fields?: string[];
90
+ actions?: ActionDefinition[];
91
+ metadata?: Record<string, unknown>;
92
+ [key: string]: unknown;
93
+ }
94
+ interface RoleDefinition {
95
+ name: string;
96
+ description?: string;
97
+ assigned_when?: string;
98
+ permissions?: string[];
99
+ [key: string]: unknown;
100
+ }
101
+ interface ActionDefinition {
102
+ id?: string;
103
+ type?: string;
104
+ action_type?: string;
105
+ config?: Record<string, unknown>;
106
+ [key: string]: unknown;
107
+ }
108
+ interface TransitionInfo {
109
+ name: string;
110
+ from: string | string[];
111
+ to: string;
112
+ condition?: string;
113
+ required_roles?: string[];
114
+ metadata?: Record<string, unknown>;
115
+ }
116
+ interface DataSourceBase {
117
+ name: string;
118
+ fields?: FieldDefinition[];
119
+ }
120
+ interface WorkflowDataSource extends DataSourceBase {
121
+ type: 'workflow';
122
+ slug?: string;
123
+ query: 'latest' | 'list' | 'count';
124
+ instanceId?: string;
125
+ entity?: {
126
+ type: string;
127
+ id: string;
128
+ } | null;
129
+ paginated?: boolean;
130
+ pageSize?: number;
131
+ pageKey?: string;
132
+ filters?: Record<string, string | {
133
+ bind: string;
134
+ }>;
135
+ filter?: Record<string, string>;
136
+ filterKey?: string;
137
+ autoStart?: boolean;
138
+ initialData?: Record<string, unknown>;
139
+ includeDefinition?: boolean;
140
+ includeMemory?: boolean;
141
+ facets?: string[];
142
+ sort?: string;
143
+ search?: string;
144
+ searchFields?: string[];
145
+ range?: Record<string, {
146
+ min?: unknown;
147
+ max?: unknown;
148
+ }>;
149
+ aggregate?: string;
150
+ groupBy?: string;
151
+ parentInstanceId?: string;
152
+ }
153
+ interface ApiDataSource extends DataSourceBase {
154
+ type: 'api';
155
+ endpoint: string;
156
+ method?: 'GET' | 'POST';
157
+ body?: Record<string, unknown>;
158
+ headers?: Record<string, string>;
159
+ mapping?: {
160
+ id?: string;
161
+ state?: string;
162
+ data?: string;
163
+ items?: string;
164
+ total?: string;
165
+ };
166
+ staleTime?: number;
167
+ }
168
+ interface StaticDataSource extends DataSourceBase {
169
+ type: 'static';
170
+ data: Record<string, unknown> | Record<string, unknown>[];
171
+ }
172
+ interface RefDataSource extends DataSourceBase {
173
+ type: 'ref';
174
+ expression: string;
175
+ }
176
+ type DataSource = WorkflowDataSource | ApiDataSource | StaticDataSource | RefDataSource;
177
+ interface FacetEntry {
178
+ value: string | null;
179
+ count: number;
180
+ }
181
+ interface DataSourceResult {
182
+ instance?: InstanceData;
183
+ instances?: InstanceData[];
184
+ definition?: WorkflowDefinition;
185
+ pagination?: {
186
+ total: number;
187
+ page: number;
188
+ pageSize: number;
189
+ };
190
+ facets?: Record<string, FacetEntry[]>;
191
+ aggregates?: Record<string, Record<string, number>>;
192
+ grouped?: Array<Record<string, unknown>>;
193
+ loading: boolean;
194
+ error: Error | null;
195
+ }
196
+ /** Normalized instance shape used in scope */
197
+ interface InstanceData {
198
+ id: string;
199
+ state: string;
200
+ fields: Record<string, unknown>;
201
+ slug?: string;
202
+ created_at?: string;
203
+ updated_at?: string;
204
+ [key: string]: unknown;
205
+ }
206
+ interface ExperienceNode {
207
+ id: string;
208
+ displayName?: string;
209
+ experienceId?: string;
210
+ component?: string;
211
+ slot?: string;
212
+ dataSources?: DataSource[];
213
+ dataScope?: string;
214
+ children?: ExperienceNode[];
215
+ config?: Record<string, unknown>;
216
+ layout?: string;
217
+ className?: string;
218
+ style?: Record<string, unknown>;
219
+ overrides?: Record<string, unknown>;
220
+ bindings?: Record<string, string>;
221
+ visible_when?: string;
222
+ type?: string;
223
+ props?: Record<string, unknown>;
224
+ $if?: string;
225
+ $for?: {
226
+ each: string;
227
+ as: string;
228
+ key?: string;
229
+ };
230
+ }
231
+ interface QueryParams {
232
+ state?: string | string[];
233
+ status?: string;
234
+ filter?: Record<string, unknown>;
235
+ search?: string;
236
+ searchFields?: string[];
237
+ sort?: Array<{
238
+ field: string;
239
+ direction: 'asc' | 'desc';
240
+ }> | string;
241
+ limit?: number;
242
+ page?: number;
243
+ offset?: number;
244
+ facets?: string[];
245
+ aggregate?: {
246
+ fn: string;
247
+ field: string;
248
+ groupBy?: string;
249
+ };
250
+ includeDefinition?: boolean;
251
+ entity?: {
252
+ type: string;
253
+ id: string;
254
+ } | null;
255
+ parentInstanceId?: string;
256
+ }
257
+ interface QueryResult {
258
+ data: InstanceData[];
259
+ total: number;
260
+ page: number;
261
+ pageSize: number;
262
+ definition?: WorkflowDefinition;
263
+ facets?: Record<string, FacetEntry[]>;
264
+ aggregates?: Record<string, Record<string, number>>;
265
+ grouped?: Array<Record<string, unknown>>;
266
+ }
267
+ interface TransitionResult {
268
+ success: boolean;
269
+ instance?: WorkflowInstance;
270
+ from_state?: string;
271
+ to_state?: string;
272
+ error?: string;
273
+ }
274
+ interface PlayerResolver {
275
+ query(slug: string, params: QueryParams): Promise<QueryResult>;
276
+ getInstance(id: string): Promise<InstanceData>;
277
+ getDefinition(slug: string): Promise<WorkflowDefinition>;
278
+ create(slug: string, data?: Record<string, unknown>): Promise<string>;
279
+ update(id: string, fields: Record<string, unknown>): Promise<void>;
280
+ transition(id: string, name: string, data?: Record<string, unknown>): Promise<TransitionResult>;
281
+ remove(id: string): Promise<void>;
282
+ availableTransitions(id: string): Promise<TransitionInfo[]>;
283
+ fetch?(endpoint: string, config: {
284
+ method?: string;
285
+ body?: unknown;
286
+ headers?: Record<string, string>;
287
+ }): Promise<unknown>;
288
+ subscribe?(channel: string, callback: (event: unknown) => void): () => void;
289
+ }
290
+ interface PlayerAuth {
291
+ userId?: string;
292
+ roles?: string[];
293
+ token?: string | (() => string | null);
294
+ }
295
+ interface PlayerRouter {
296
+ push(path: string): void;
297
+ replace?(path: string): void;
298
+ back?(): void;
299
+ pathname?: string;
300
+ }
301
+ interface ScopeData {
302
+ $instance?: InstanceData;
303
+ $instances?: InstanceData[];
304
+ $definition?: WorkflowDefinition;
305
+ $pagination?: {
306
+ total: number;
307
+ page: number;
308
+ pageSize: number;
309
+ };
310
+ $entity?: {
311
+ type: string;
312
+ id: string;
313
+ };
314
+ $local: Record<string, unknown>;
315
+ $user: {
316
+ id?: string;
317
+ roles: string[];
318
+ };
319
+ $fn: Record<string, (...args: unknown[]) => unknown>;
320
+ $action: ActionScope;
321
+ $item?: unknown;
322
+ $index?: number;
323
+ state_data?: Record<string, unknown>;
324
+ memory?: Record<string, unknown>;
325
+ context?: Record<string, unknown>;
326
+ [key: string]: unknown;
327
+ }
328
+ interface ActionScope {
329
+ transition(name: string, instanceId?: string, data?: Record<string, unknown>): Promise<void>;
330
+ create(slug: string, data?: Record<string, unknown>): Promise<string>;
331
+ update(instanceId: string, fields: Record<string, unknown>): Promise<void>;
332
+ remove(instanceId: string): Promise<void>;
333
+ setLocal(key: string, value: unknown): void;
334
+ navigate(path: string): void;
335
+ toast(message: string, variant?: 'default' | 'success' | 'error' | 'warning'): void;
336
+ refreshQuery(dataSourceName?: string): void;
337
+ scrollTo(elementId: string): void;
338
+ openModal(modalId: string): void;
339
+ closeModal(modalId: string): void;
340
+ emit(event: string, payload?: unknown): void;
341
+ [key: string]: unknown;
342
+ }
343
+ interface AtomRegistryInterface {
344
+ register(name: string, loader: () => Promise<{
345
+ default: React.ComponentType<Record<string, unknown>>;
346
+ }>): void;
347
+ resolve(name: string): React.LazyExoticComponent<React.ComponentType<Record<string, unknown>>> | null;
348
+ has(name: string): boolean;
349
+ list(): string[];
350
+ merge(other: AtomRegistryInterface): AtomRegistryInterface;
351
+ /** Get as flat record for backward compat with ComponentTreeRenderer */
352
+ toRecord(): AtomRegistry;
353
+ }
354
+ type ExprClass$1 = 'literal' | 'path' | 'function' | 'action' | 'condition';
355
+ interface BindingClass {
356
+ type: ExprClass$1;
357
+ value?: unknown;
358
+ root?: string;
359
+ rest?: string;
360
+ name?: string;
361
+ rawArgs?: string[];
362
+ expression?: string;
363
+ }
364
+ interface ExpressionEvaluator {
365
+ evaluate(expr: string, context: Record<string, unknown>): unknown;
366
+ classify(expr: string): ExprClass$1;
367
+ }
368
+
369
+ /**
370
+ * ExperienceRenderer — Full IR interpreter for compiled experience trees.
371
+ *
372
+ * Per-node pipeline:
373
+ * 1. Check visibility (visible_when expression)
374
+ * 2. Resolve dataSources (fetch via PlayerResolver)
375
+ * 3. Initialize $local state (from config.localDefaults)
376
+ * 4. Build scope chain ($instance, $local, $action, $user, $fn, $entity)
377
+ * 5. Evaluate bindings (classify + resolve each expression)
378
+ * 6. Merge props (config + resolved bindings)
379
+ * 7. Resolve atom (look up component name in registry)
380
+ * 8. Render with ErrorBoundary + Suspense
381
+ * 9. Recurse for children
382
+ */
383
+
384
+ interface ExperienceRendererProps {
385
+ tree: ExperienceNode | ExperienceNode[];
386
+ initialScope?: Partial<ScopeData>;
387
+ entity?: {
388
+ type: string;
389
+ id: string;
390
+ };
391
+ fallback?: React__default.ReactNode;
392
+ className?: string;
393
+ }
394
+ declare const ExperienceRenderer: React__default.FC<ExperienceRendererProps>;
395
+
396
+ /**
397
+ * PlayerProvider — Top-level context provider for the ExperienceRenderer.
398
+ *
399
+ * Bridges the player runtime with:
400
+ * - PlayerResolver (data fetching / mutations)
401
+ * - AtomRegistryInterface (component lookup)
402
+ * - Auth context ($user)
403
+ * - Router integration (navigate)
404
+ * - Toast/notification system
405
+ * - Event bus
406
+ *
407
+ * Also wires into the existing DI hooks (setQueryResolver, setMutationResolver)
408
+ * so that useQuery/useMutation work inside player-rendered components.
409
+ */
410
+
411
+ interface PlayerContextValue {
412
+ resolver: PlayerResolver | null;
413
+ atomRegistry: AtomRegistryInterface;
414
+ auth?: PlayerAuth;
415
+ router?: PlayerRouter;
416
+ toast?: (message: string, variant?: 'default' | 'success' | 'error' | 'warning') => void;
417
+ onEvent?: (event: string, payload?: unknown) => void;
418
+ }
419
+ declare function usePlayerContext(): PlayerContextValue | null;
420
+ /** Returns merged design tokens (user overrides + defaults). */
421
+ declare function useTheme(): Record<string, string>;
422
+ interface PlayerProviderProps {
423
+ /** Backend resolver for data fetching and mutations */
424
+ resolver?: PlayerResolver;
425
+ /** Atom registry (defaults to core atoms) */
426
+ atomRegistry?: AtomRegistryInterface;
427
+ /** Auth context — populates $user in scope */
428
+ auth?: PlayerAuth;
429
+ /** Router integration for $action.navigate */
430
+ router?: PlayerRouter;
431
+ /** Toast handler for $action.toast */
432
+ toast?: (message: string, variant?: 'default' | 'success' | 'error' | 'warning') => void;
433
+ /** Event handler for $action.emit */
434
+ onEvent?: (event: string, payload?: unknown) => void;
435
+ /** Design token overrides — merged with DEFAULT_DESIGN_TOKENS */
436
+ theme?: Record<string, string>;
437
+ /** Children */
438
+ children: React__default.ReactNode;
439
+ }
440
+ declare const PlayerProvider: React__default.FC<PlayerProviderProps>;
441
+
442
+ /**
443
+ * Player Resolvers — Default backend implementations.
444
+ *
445
+ * Factory function for creating PlayerResolver instances:
446
+ * - createApiResolver: HTTP API backend (mm-api)
447
+ */
448
+
449
+ interface ApiResolverConfig {
450
+ baseUrl: string;
451
+ token?: string | (() => string | null);
452
+ fetch?: typeof globalThis.fetch;
453
+ defaults?: {
454
+ limit?: number;
455
+ staleTime?: number;
456
+ };
457
+ }
458
+ declare function createApiResolver(config: ApiResolverConfig): PlayerResolver;
459
+
460
+ /**
461
+ * Expression Engine — Three-tier evaluation strategy.
462
+ *
463
+ * Tier 1: Fast-path for literals and dot-paths (no compilation)
464
+ * Tier 2: WASM mm-compute evaluation (if available)
465
+ * Tier 3: JS Function compilation with LRU cache (fallback)
466
+ *
467
+ * Ported from packages/frontend/src/services/expression.service.ts
468
+ * with all frontend coupling removed.
469
+ */
470
+ interface WasmModule {
471
+ evaluateExpressionSync(expr: string, contextJson: string): string;
472
+ }
473
+ declare function setWasmModule(module: WasmModule | null): void;
474
+ type ExprClass = 'literal' | 'path' | 'function' | 'action' | 'condition';
475
+ declare const builtinFunctions: Record<string, (...args: unknown[]) => unknown>;
476
+ /**
477
+ * Evaluate an expression against a context object.
478
+ * Uses three-tier strategy: WASM → JS compiled → fast-path.
479
+ */
480
+ declare function evaluateExpression(expr: string, context: Record<string, unknown>): unknown;
481
+
482
+ /**
483
+ * Binding Resolver — Resolves $-prefix expression bindings to concrete values.
484
+ *
485
+ * Ported from packages/frontend/src/experiences/binding-resolver.ts
486
+ * with all frontend coupling removed (no @/ imports, no QueryClient, no React Router).
487
+ *
488
+ * Classification delegates to expression-engine (single source of truth).
489
+ * Literal/path bindings are fast-path (no Function compilation).
490
+ */
491
+
492
+ interface BindingClassification {
493
+ type: ExprClass;
494
+ value?: unknown;
495
+ root?: string;
496
+ rest?: string;
497
+ name?: string;
498
+ rawArgs?: string[];
499
+ expression?: string;
500
+ }
501
+ declare function classifyBinding(expr: string): BindingClassification;
502
+ /**
503
+ * Resolve a single binding expression against a scope.
504
+ */
505
+ declare function resolveBinding(expr: string, scope: ScopeData): unknown;
506
+ /**
507
+ * Resolve all bindings for a node, returning a props object.
508
+ */
509
+ declare function resolveAllBindings(bindings: Record<string, string>, scope: ScopeData): Record<string, unknown>;
510
+ /**
511
+ * Build a flat evaluation context from scoped data.
512
+ * Merges all scope namespaces into a single object for expression evaluation.
513
+ */
514
+ declare function buildEvalContext(scope: ScopeData): Record<string, unknown>;
515
+ interface BuildActionScopeOptions {
516
+ resolver: PlayerResolver;
517
+ instanceId?: string;
518
+ slug?: string;
519
+ setLocal: (key: string, value: unknown) => void;
520
+ router?: PlayerRouter;
521
+ toast?: (message: string, variant?: string) => void;
522
+ refreshQuery?: (dataSourceName?: string) => void;
523
+ onEvent?: (event: string, payload?: unknown) => void;
524
+ }
525
+ declare function buildActionScope(opts: BuildActionScopeOptions): ActionScope;
526
+
527
+ declare const ScopeContext: React$1.Context<ScopeData>;
528
+ declare function useScope(): ScopeData;
529
+ interface BuildScopeOptions {
530
+ /** DataSource results keyed by name */
531
+ dataSources?: Record<string, DataSourceResult>;
532
+ /** Local state values */
533
+ localState?: Record<string, unknown>;
534
+ /** Auth context */
535
+ auth?: PlayerAuth;
536
+ /** Entity context */
537
+ entity?: {
538
+ type: string;
539
+ id: string;
540
+ };
541
+ /** Parent scope to inherit from */
542
+ parentScope?: ScopeData;
543
+ /** Action scope */
544
+ actionScope?: ActionScope;
545
+ /** Custom $fn additions */
546
+ functions?: Record<string, (...args: unknown[]) => unknown>;
547
+ }
548
+ declare function buildScope(opts: BuildScopeOptions): ScopeData;
549
+ /**
550
+ * Merge a child scope into a parent scope.
551
+ * Child values override parent values.
552
+ */
553
+ declare function mergeScope(parent: ScopeData, child: Partial<ScopeData>): ScopeData;
554
+ /**
555
+ * Create a loop iteration scope with $item and $index.
556
+ * Also adds the item under the `as` variable name.
557
+ */
558
+ declare function buildLoopScope(parent: ScopeData, item: unknown, index: number, as: string): ScopeData;
559
+
560
+ /**
561
+ * Atom Registry — Lazy-loaded component resolution.
562
+ *
563
+ * Instance-based (not module-singleton) so multiple PlayerProvider
564
+ * instances don't conflict. Each registry maintains its own lazy cache.
565
+ */
566
+
567
+ type ComponentLoader = () => Promise<{
568
+ default: React__default.ComponentType<Record<string, unknown>>;
569
+ }>;
570
+ declare class AtomRegistryImpl implements AtomRegistryInterface {
571
+ private loaders;
572
+ private lazyCache;
573
+ private eagerCache;
574
+ register(name: string, loader: ComponentLoader): void;
575
+ registerEager(name: string, component: React__default.ComponentType<Record<string, unknown>>): void;
576
+ resolve(name: string): React__default.LazyExoticComponent<React__default.ComponentType<Record<string, unknown>>> | null;
577
+ resolveSync(name: string): React__default.ComponentType<Record<string, unknown>> | null;
578
+ has(name: string): boolean;
579
+ list(): string[];
580
+ merge(other: AtomRegistryInterface): AtomRegistryInterface;
581
+ toRecord(): AtomRegistry;
582
+ }
583
+ declare function createCoreAtomRegistry(): AtomRegistryImpl;
584
+ declare function mergeRegistries(...registries: AtomRegistryInterface[]): AtomRegistryInterface;
585
+
586
+ /**
587
+ * Standalone ComponentTreeRenderer for the dev player.
588
+ *
589
+ * Renders a JSON component tree (IR experience nodes) to React elements.
590
+ * Uses the minimal evaluator and accepts an AtomRegistry for component resolution.
591
+ */
592
+
593
+ interface ComponentTreeRendererProps {
594
+ /** The component tree to render */
595
+ tree: ComponentTree;
596
+ /** Data scopes for expression evaluation */
597
+ scopes: Partial<ScopeData>;
598
+ /** Runtime atom registry — maps type names to React components */
599
+ atoms?: AtomRegistry;
600
+ /** Event handlers */
601
+ onEvent?: (eventName: string, payload?: unknown) => void;
602
+ /** Error boundary fallback */
603
+ fallback?: React__default.ReactNode;
604
+ }
605
+ declare const ComponentTreeRenderer: React__default.FC<ComponentTreeRendererProps>;
606
+
607
+ /**
608
+ * DevPlayer — Development shell for previewing workflow component trees.
609
+ *
610
+ * Provides:
611
+ * - ComponentTreeRenderer with built-in atoms
612
+ * - Scope inspector panel (collapsible)
613
+ * - Event log
614
+ * - HMR integration (listens to __mm_dev WebSocket for live reload)
615
+ * - Error boundary with dev-friendly error display
616
+ */
617
+
618
+ interface DevPlayerProps {
619
+ /** The component tree to render */
620
+ tree: ComponentTree;
621
+ /** Data scopes for expression evaluation */
622
+ scopes?: Partial<ScopeData>;
623
+ /** Additional atoms (merged with built-ins; overrides win) */
624
+ atoms?: AtomRegistry;
625
+ /** Title shown in the dev chrome */
626
+ title?: string;
627
+ /** Hide the dev toolbar (render tree only) */
628
+ bare?: boolean;
629
+ /** WebSocket URL for HMR (default: auto-detect from window.location) */
630
+ wsUrl?: string;
631
+ /** Called when the tree is reloaded via HMR */
632
+ onReload?: () => void;
633
+ /** Called on every atom event */
634
+ onEvent?: (eventName: string, payload?: unknown) => void;
635
+ }
636
+ declare const DevPlayer: React__default.FC<DevPlayerProps>;
637
+
638
+ /**
639
+ * Built-in atom components for the standalone player.
640
+ *
641
+ * These are minimal HTML-based implementations of the core layout and
642
+ * display atoms. Projects can override any of these via the AtomRegistry.
643
+ */
644
+
645
+ declare const builtinAtoms: AtomRegistry;
646
+
647
+ export { type FieldDefinition as $, type ApiResolverConfig as A, type PlayerResolver as B, ComponentTreeRenderer as C, DevPlayer as D, ExperienceRenderer as E, type PlayerAuth as F, type PlayerRouter as G, type ScopeData as H, type InstanceData as I, type ActionScope as J, type AtomRegistryInterface as K, type ExprClass$1 as L, type BindingClass as M, useTheme as N, setWasmModule as O, PlayerProvider as P, classifyBinding as Q, type BuildScopeOptions as R, ScopeContext as S, type DataSource as T, type DataSourceResult as U, type ApiDataSource as V, type WorkflowDataSource as W, type StaticDataSource as X, type RefDataSource as Y, type WorkflowDefinition as Z, type WorkflowInstance as _, type ExperienceRendererProps as a, type StateDefinition as a0, type TransitionDefinition as a1, type RoleDefinition as a2, type ActionDefinition as a3, type TransitionInfo as a4, type TransitionResult as a5, type QueryParams as a6, type QueryResult as a7, type ExpressionEvaluator as a8, type FacetEntry as a9, type PlayerProviderProps as b, type PlayerContextValue as c, createApiResolver as d, evaluateExpression as e, builtinFunctions as f, resolveAllBindings as g, buildActionScope as h, buildEvalContext as i, useScope as j, buildScope as k, buildLoopScope as l, mergeScope as m, AtomRegistryImpl as n, createCoreAtomRegistry as o, mergeRegistries as p, type ComponentTreeRendererProps as q, resolveBinding as r, type DevPlayerProps as s, builtinAtoms as t, usePlayerContext as u, type ComponentNode as v, type ComponentTree as w, type AtomComponent as x, type AtomRegistry as y, type ExperienceNode as z };