@almadar/runtime 6.71.0 → 6.73.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.
- package/dist/{OrbitalServerRuntime-DnDJhpLS.d.ts → OrbitalServerRuntime-BiEntWd-.d.ts} +258 -86
- package/dist/OrbitalServerRuntime.d.ts +2 -2
- package/dist/OrbitalServerRuntime.js +171 -16
- package/dist/ServerBridge.d.ts +1 -1
- package/dist/{chunk-PAEMYGKV.js → chunk-H7HQQVQJ.js} +3071 -299
- package/dist/{chunk-ZJ62H3ES.js → chunk-ZWAOJT6R.js} +5 -29
- package/dist/createOsHandlers.d.ts +1 -1
- package/dist/entityAccess.js +1 -1
- package/dist/{external-loader-YUUADLAP.js → external-loader-CISUEINQ.js} +1 -0
- package/dist/index.d.ts +14 -132
- package/dist/index.js +28 -10
- package/dist/{types-BaD_ox7e.d.ts → types-CWaIuEQn.d.ts} +34 -4
- package/package.json +7 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Router } from 'express';
|
|
2
|
-
import { I as IEventBus, R as RuntimeEvent, a as EventListener, U as Unsubscribe, T as TraitDefinition, b as RuntimeConfig, c as TransitionObserver, d as TraitState, C as ConfigContext, e as TransitionResult, f as EvaluationContextExtensions, E as EffectHandlers } from './types-
|
|
3
|
-
import { EventPayload, EventId, EntityRow, UserContext, Orbital, ServiceCallResult, TraitConfig, DeclaredTraitConfig, Entity, OrbitalSchema, Trait, PatternConfig, ResolvedPatternProps, SExpr, BusEventSource, RawUserClaims, OrbitalDefinition, TraitTick } from '@almadar/core';
|
|
2
|
+
import { I as IEventBus, R as RuntimeEvent, a as EventListener, U as Unsubscribe, T as TraitDefinition, b as RuntimeConfig, c as TransitionObserver, d as TraitState, C as ConfigContext, e as TransitionResult, f as EvaluationContextExtensions, B as BindingContext, g as EffectContext, S as ServiceCallContext, E as EffectHandlers } from './types-CWaIuEQn.js';
|
|
3
|
+
import { EventPayload, EventId, EntityRow, UserContext, ServiceParams, EntityAccessPolicies, Orbital, ServiceCallResult, TraitConfig, DeclaredTraitConfig, Entity, OrbitalSchema, Trait, PatternConfig, ResolvedPatternProps, SExpr, BusEventSource, RawUserClaims, OrbitalDefinition, TraitTick } from '@almadar/core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* EventBus - Platform-Agnostic Pub/Sub Implementation
|
|
@@ -85,6 +85,15 @@ declare class EventBus implements IEventBus {
|
|
|
85
85
|
* @packageDocumentation
|
|
86
86
|
*/
|
|
87
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Mount-time lifecycle event kinds, in the order a trait is checked for
|
|
90
|
+
* support (`canHandleEvent`) — shared by the client hook's mount effect
|
|
91
|
+
* (`useTraitStateMachine`) and the server's capture-child re-render
|
|
92
|
+
* (`OrbitalServerRuntime.rerenderCallsiteCaptureChildren`), which both need
|
|
93
|
+
* to find "the lifecycle transition" for a trait that never advances past
|
|
94
|
+
* its own INIT/LOAD/$MOUNT self-loop.
|
|
95
|
+
*/
|
|
96
|
+
declare const LIFECYCLE_EVENTS: readonly ["INIT", "LOAD", "$MOUNT"];
|
|
88
97
|
/**
|
|
89
98
|
* Find the initial state for a trait definition.
|
|
90
99
|
*/
|
|
@@ -355,6 +364,191 @@ declare class StateMachineManager {
|
|
|
355
364
|
resetAll(): void;
|
|
356
365
|
}
|
|
357
366
|
|
|
367
|
+
/**
|
|
368
|
+
* PersistenceAdapter — the storage contract for runtime effect handlers.
|
|
369
|
+
*
|
|
370
|
+
* The server-side runtime and the in-browser mock runtime both invoke
|
|
371
|
+
* `fetch` / `persist` / `ref` / `deref` / `swap!` effects against an
|
|
372
|
+
* implementation of this interface. Extracted from
|
|
373
|
+
* `OrbitalServerRuntime.ts` so it can be imported by browser code that
|
|
374
|
+
* cannot depend on the server module (which pulls in express).
|
|
375
|
+
*
|
|
376
|
+
* @packageDocumentation
|
|
377
|
+
*/
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Storage contract for CRUD operations on runtime entity rows.
|
|
381
|
+
*
|
|
382
|
+
* Implementations:
|
|
383
|
+
* - `InMemoryPersistence` (this file) — simple Map-backed store, used by
|
|
384
|
+
* the browser mock runtime and as the default when an adapter is not
|
|
385
|
+
* supplied to `OrbitalServerRuntime`.
|
|
386
|
+
* - `MockPersistenceAdapter` — in-memory with faker-generated seed data
|
|
387
|
+
* for realistic preview content.
|
|
388
|
+
* - Consumer-provided (e.g. Firestore, Postgres) for production servers.
|
|
389
|
+
*/
|
|
390
|
+
interface PersistenceAdapter {
|
|
391
|
+
create(entityType: string, data: EntityRow): Promise<{
|
|
392
|
+
id: string;
|
|
393
|
+
}>;
|
|
394
|
+
update(entityType: string, id: string, data: EntityRow): Promise<void>;
|
|
395
|
+
delete(entityType: string, id: string): Promise<void>;
|
|
396
|
+
getById(entityType: string, id: string): Promise<EntityRow | null>;
|
|
397
|
+
list(entityType: string): Promise<EntityRow[]>;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Simple in-memory persistence for dev/testing and offline previews.
|
|
401
|
+
* Keys each entity collection by type, rows by generated string id.
|
|
402
|
+
*/
|
|
403
|
+
declare class InMemoryPersistence implements PersistenceAdapter {
|
|
404
|
+
private data;
|
|
405
|
+
private idCounter;
|
|
406
|
+
/**
|
|
407
|
+
* Seed the store with pre-existing rows.
|
|
408
|
+
*
|
|
409
|
+
* Accepts either a plain `Record<entityType, EntityRow[]>` or an iterable
|
|
410
|
+
* of `[entityType, EntityRow[]]` entries. Rows without an `id` get one
|
|
411
|
+
* generated at insert time; rows with an `id` keep it (so re-seeding
|
|
412
|
+
* after a schema rebuild preserves identities used in render bindings).
|
|
413
|
+
*/
|
|
414
|
+
seed(seedData: Record<string, EntityRow[]> | Iterable<[string, EntityRow[]]>): void;
|
|
415
|
+
create(entityType: string, data: EntityRow): Promise<{
|
|
416
|
+
id: string;
|
|
417
|
+
}>;
|
|
418
|
+
update(entityType: string, id: string, data: EntityRow): Promise<void>;
|
|
419
|
+
delete(entityType: string, id: string): Promise<void>;
|
|
420
|
+
getById(entityType: string, id: string): Promise<EntityRow | null>;
|
|
421
|
+
list(entityType: string): Promise<EntityRow[]>;
|
|
422
|
+
/**
|
|
423
|
+
* Snapshot the entire store as a plain object (entityType → rows).
|
|
424
|
+
* Useful for feeding a fresh render-time binding layer with the
|
|
425
|
+
* current persistence view.
|
|
426
|
+
*/
|
|
427
|
+
snapshot(): Record<string, EntityRow[]>;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* ServerEffectHandlers — reusable factory for the server-side effect layer.
|
|
432
|
+
*
|
|
433
|
+
* Mirrors the handlers built inline in
|
|
434
|
+
* `OrbitalServerRuntime.executeEffects` so both the real server runtime
|
|
435
|
+
* AND the in-browser mock runtime (`@almadar/ui` OrbPreview autoMock) can
|
|
436
|
+
* share the same `fetch` / `persist` / `set` / `ref` / `deref` / `swap!` /
|
|
437
|
+
* `atomic` / `callService` semantics against a `PersistenceAdapter`.
|
|
438
|
+
*
|
|
439
|
+
* Browser-safe: only imports core + this package's browser-safe modules.
|
|
440
|
+
* Does NOT import express/Node, so it is reachable from `@almadar/ui`.
|
|
441
|
+
*
|
|
442
|
+
* @packageDocumentation
|
|
443
|
+
*/
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Minimal event-bus contract the server handlers need. Narrower than the
|
|
447
|
+
* full `IEventBus` so clients with a React-context bus (only `emit` is
|
|
448
|
+
* relevant for effect dispatch) can hand it in without adapter code.
|
|
449
|
+
*/
|
|
450
|
+
interface ServerEffectEventBus {
|
|
451
|
+
emit(event: string, payload?: EventPayload, source?: {
|
|
452
|
+
orbital?: string;
|
|
453
|
+
trait?: string;
|
|
454
|
+
}): void;
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Result entry recorded for each effect invocation. Mirrors the server
|
|
458
|
+
* runtime's `EffectResult`. Callers who want telemetry pass an array that
|
|
459
|
+
* the factory appends to; otherwise it's unused.
|
|
460
|
+
*/
|
|
461
|
+
interface ServerBatchSummary {
|
|
462
|
+
operations: EntityRow[];
|
|
463
|
+
completedCount: number;
|
|
464
|
+
totalCount: number;
|
|
465
|
+
}
|
|
466
|
+
interface ServerEffectResult {
|
|
467
|
+
effect: "set" | "persist" | "call-service" | "fetch" | "ref" | "deref" | "swap" | "atomic";
|
|
468
|
+
action?: string;
|
|
469
|
+
entityType?: string;
|
|
470
|
+
/** Entity row for CRUD/set/swap, the batch summary for `persist batch`, the raw service result for `call-service`. */
|
|
471
|
+
data?: EntityRow | ServerBatchSummary | EventPayload | null;
|
|
472
|
+
success: boolean;
|
|
473
|
+
/**
|
|
474
|
+
* Set when a persist failed because an access policy rejected it or the
|
|
475
|
+
* write resolved no row key — mirrors `OrbitalServerRuntime.EffectResult`
|
|
476
|
+
* so the offline-preview and real-server persist paths report the same
|
|
477
|
+
* denial discriminator to the verification trace.
|
|
478
|
+
*/
|
|
479
|
+
denied?: true;
|
|
480
|
+
error?: string;
|
|
481
|
+
}
|
|
482
|
+
interface CreateServerEffectHandlersOptions {
|
|
483
|
+
/** Persistent store backing `fetch` / `persist` / `ref` / `deref` / `swap`. */
|
|
484
|
+
persistence: PersistenceAdapter;
|
|
485
|
+
/** Event bus that `emit` delegates to. Only `.emit()` is required. */
|
|
486
|
+
eventBus: ServerEffectEventBus;
|
|
487
|
+
/** The trait's linked entity type (used as the default for persist/set). */
|
|
488
|
+
entityType: string;
|
|
489
|
+
/** Current entity row id (used by `set`, `persist update/delete` fallback). */
|
|
490
|
+
entityId?: string;
|
|
491
|
+
/**
|
|
492
|
+
* Binding object passed to inner `atomic` evaluator. When absent, atomic
|
|
493
|
+
* effects still run but have no access to `@entity` / `@payload` bindings.
|
|
494
|
+
*/
|
|
495
|
+
bindings?: BindingContext;
|
|
496
|
+
/** Effect context passed to the inner `atomic` executor. */
|
|
497
|
+
context?: EffectContext;
|
|
498
|
+
/** Per-event result sink. Optional — telemetry only. */
|
|
499
|
+
effectResults?: ServerEffectResult[];
|
|
500
|
+
/**
|
|
501
|
+
* Per-event fetched-data cache. `fetch` writes here so downstream UI
|
|
502
|
+
* renderers can resolve `@entity` bindings from the latest load without
|
|
503
|
+
* a separate round-trip.
|
|
504
|
+
*/
|
|
505
|
+
fetchedData?: Record<string, EntityRow[]>;
|
|
506
|
+
/** Per-event emit log. Optional — telemetry only. */
|
|
507
|
+
emittedEvents?: Array<{
|
|
508
|
+
event: string;
|
|
509
|
+
payload?: EventPayload;
|
|
510
|
+
}>;
|
|
511
|
+
/** Source stamp applied to all emits. */
|
|
512
|
+
source?: {
|
|
513
|
+
orbital?: string;
|
|
514
|
+
trait?: string;
|
|
515
|
+
};
|
|
516
|
+
/** Consumer-supplied `call-service` handler. When absent, calls warn and return null. */
|
|
517
|
+
callService?: (service: string, action: string, params?: ServiceParams, context?: ServiceCallContext) => Promise<EventPayload | null>;
|
|
518
|
+
/**
|
|
519
|
+
* The declared `@read`/`@create`/`@update`/`@delete` directives, keyed by
|
|
520
|
+
* entity name. Build it with `entityAccessTable(schema)` from `@almadar/core`.
|
|
521
|
+
*
|
|
522
|
+
* Optional: a caller that holds no schema (the client offline-preview path)
|
|
523
|
+
* passes nothing and gets today's unrestricted behavior. A preview is not a
|
|
524
|
+
* security boundary — the generated server is, and that one always has the
|
|
525
|
+
* policies compiled in.
|
|
526
|
+
*/
|
|
527
|
+
entityAccess?: ReadonlyMap<string, EntityAccessPolicies>;
|
|
528
|
+
/** Verbose logging. */
|
|
529
|
+
debug?: boolean;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Build the full server-side effect handler set bound to a persistence
|
|
533
|
+
* adapter. The returned object satisfies `EffectHandlers` and can be
|
|
534
|
+
* handed directly to `EffectExecutor`.
|
|
535
|
+
*
|
|
536
|
+
* Scope: one handler object per transition — capture `entityId`,
|
|
537
|
+
* `bindings`, `context`, and the sink arrays at build time. For a new
|
|
538
|
+
* transition, call this factory again.
|
|
539
|
+
*
|
|
540
|
+
* Intentionally does NOT implement:
|
|
541
|
+
* - `renderUI` / `notify` / `navigate` — these are client-side, provided
|
|
542
|
+
* by `createClientEffectHandlers`. A mock runtime merges both handler
|
|
543
|
+
* sets.
|
|
544
|
+
* - `os/watch-*` observers — these are a no-op outside the server.
|
|
545
|
+
* - Schema-aware relation cardinality / on-delete cascades — those live
|
|
546
|
+
* in `OrbitalServerRuntime` and depend on the full registered schema.
|
|
547
|
+
* Clients that need them can wrap the persist handler with their own
|
|
548
|
+
* validation.
|
|
549
|
+
*/
|
|
550
|
+
declare function createServerEffectHandlers(opts: CreateServerEffectHandlersOptions): EffectHandlers;
|
|
551
|
+
|
|
358
552
|
/**
|
|
359
553
|
* Agent Substrate Handlers — Server-Side Only
|
|
360
554
|
*
|
|
@@ -487,6 +681,12 @@ interface LoadedOrbital {
|
|
|
487
681
|
* outside it. Mirrors the compiled path's `AliasEntry.orbitals`.
|
|
488
682
|
*/
|
|
489
683
|
orbitals?: Orbital[];
|
|
684
|
+
/**
|
|
685
|
+
* The loaded schema's own app-level `config`, when it declares one.
|
|
686
|
+
* Traits from this orbital must resolve against THIS config, not the
|
|
687
|
+
* consumer's — omitted (never `undefined`) when the schema declares none.
|
|
688
|
+
*/
|
|
689
|
+
schemaConfig?: DeclaredTraitConfig;
|
|
490
690
|
/** Source path/URL (resolved) */
|
|
491
691
|
sourcePath: string;
|
|
492
692
|
/** Original import path */
|
|
@@ -654,6 +854,8 @@ interface ResolveOptions extends LoaderOptions {
|
|
|
654
854
|
skipExternalLoading?: boolean;
|
|
655
855
|
/** Custom schema loader instance (optional, defaults to ExternalOrbitalLoader) */
|
|
656
856
|
loader?: SchemaLoader;
|
|
857
|
+
/** The schema's declared `config {}` — the outermost rung of the forwarded-config chain (§4.5). */
|
|
858
|
+
schemaConfig?: DeclaredTraitConfig;
|
|
657
859
|
}
|
|
658
860
|
|
|
659
861
|
/**
|
|
@@ -791,69 +993,6 @@ declare function parseNamespacedEvent(eventName: string): {
|
|
|
791
993
|
event: string;
|
|
792
994
|
};
|
|
793
995
|
|
|
794
|
-
/**
|
|
795
|
-
* PersistenceAdapter — the storage contract for runtime effect handlers.
|
|
796
|
-
*
|
|
797
|
-
* The server-side runtime and the in-browser mock runtime both invoke
|
|
798
|
-
* `fetch` / `persist` / `ref` / `deref` / `swap!` effects against an
|
|
799
|
-
* implementation of this interface. Extracted from
|
|
800
|
-
* `OrbitalServerRuntime.ts` so it can be imported by browser code that
|
|
801
|
-
* cannot depend on the server module (which pulls in express).
|
|
802
|
-
*
|
|
803
|
-
* @packageDocumentation
|
|
804
|
-
*/
|
|
805
|
-
|
|
806
|
-
/**
|
|
807
|
-
* Storage contract for CRUD operations on runtime entity rows.
|
|
808
|
-
*
|
|
809
|
-
* Implementations:
|
|
810
|
-
* - `InMemoryPersistence` (this file) — simple Map-backed store, used by
|
|
811
|
-
* the browser mock runtime and as the default when an adapter is not
|
|
812
|
-
* supplied to `OrbitalServerRuntime`.
|
|
813
|
-
* - `MockPersistenceAdapter` — in-memory with faker-generated seed data
|
|
814
|
-
* for realistic preview content.
|
|
815
|
-
* - Consumer-provided (e.g. Firestore, Postgres) for production servers.
|
|
816
|
-
*/
|
|
817
|
-
interface PersistenceAdapter {
|
|
818
|
-
create(entityType: string, data: EntityRow): Promise<{
|
|
819
|
-
id: string;
|
|
820
|
-
}>;
|
|
821
|
-
update(entityType: string, id: string, data: EntityRow): Promise<void>;
|
|
822
|
-
delete(entityType: string, id: string): Promise<void>;
|
|
823
|
-
getById(entityType: string, id: string): Promise<EntityRow | null>;
|
|
824
|
-
list(entityType: string): Promise<EntityRow[]>;
|
|
825
|
-
}
|
|
826
|
-
/**
|
|
827
|
-
* Simple in-memory persistence for dev/testing and offline previews.
|
|
828
|
-
* Keys each entity collection by type, rows by generated string id.
|
|
829
|
-
*/
|
|
830
|
-
declare class InMemoryPersistence implements PersistenceAdapter {
|
|
831
|
-
private data;
|
|
832
|
-
private idCounter;
|
|
833
|
-
/**
|
|
834
|
-
* Seed the store with pre-existing rows.
|
|
835
|
-
*
|
|
836
|
-
* Accepts either a plain `Record<entityType, EntityRow[]>` or an iterable
|
|
837
|
-
* of `[entityType, EntityRow[]]` entries. Rows without an `id` get one
|
|
838
|
-
* generated at insert time; rows with an `id` keep it (so re-seeding
|
|
839
|
-
* after a schema rebuild preserves identities used in render bindings).
|
|
840
|
-
*/
|
|
841
|
-
seed(seedData: Record<string, EntityRow[]> | Iterable<[string, EntityRow[]]>): void;
|
|
842
|
-
create(entityType: string, data: EntityRow): Promise<{
|
|
843
|
-
id: string;
|
|
844
|
-
}>;
|
|
845
|
-
update(entityType: string, id: string, data: EntityRow): Promise<void>;
|
|
846
|
-
delete(entityType: string, id: string): Promise<void>;
|
|
847
|
-
getById(entityType: string, id: string): Promise<EntityRow | null>;
|
|
848
|
-
list(entityType: string): Promise<EntityRow[]>;
|
|
849
|
-
/**
|
|
850
|
-
* Snapshot the entire store as a plain object (entityType → rows).
|
|
851
|
-
* Useful for feeding a fresh render-time binding layer with the
|
|
852
|
-
* current persistence view.
|
|
853
|
-
*/
|
|
854
|
-
snapshot(): Record<string, EntityRow[]>;
|
|
855
|
-
}
|
|
856
|
-
|
|
857
996
|
/**
|
|
858
997
|
* OrbitalServerRuntime - Dynamic Server-Side Orbital Execution
|
|
859
998
|
*
|
|
@@ -1050,31 +1189,13 @@ interface OrbitalEventResponse {
|
|
|
1050
1189
|
effect: ClientEffectTuple;
|
|
1051
1190
|
}>;
|
|
1052
1191
|
/** Results from server-side effects (persist, call-service, set) */
|
|
1053
|
-
effectResults?:
|
|
1192
|
+
effectResults?: ServerEffectResult[];
|
|
1054
1193
|
error?: string;
|
|
1055
1194
|
}
|
|
1056
1195
|
/**
|
|
1057
1196
|
* Result of a server-side effect execution.
|
|
1058
1197
|
* Closes the circuit by returning effect outcomes to the client.
|
|
1059
1198
|
*/
|
|
1060
|
-
interface EffectResult {
|
|
1061
|
-
/** Effect type that was executed */
|
|
1062
|
-
effect: 'persist' | 'call-service' | 'set' | 'ref' | 'deref' | 'swap' | 'atomic';
|
|
1063
|
-
/** Action performed (e.g., 'create', 'update', 'delete' for persist) */
|
|
1064
|
-
action?: string;
|
|
1065
|
-
/** Entity type affected (for persist/set/ref/deref/swap) */
|
|
1066
|
-
entityType?: string;
|
|
1067
|
-
/** Result data from the effect (entity row for CRUD, summary for batch) */
|
|
1068
|
-
data?: EntityRow | {
|
|
1069
|
-
operations: EntityRow[];
|
|
1070
|
-
completedCount: number;
|
|
1071
|
-
totalCount: number;
|
|
1072
|
-
};
|
|
1073
|
-
/** Whether the effect succeeded */
|
|
1074
|
-
success: boolean;
|
|
1075
|
-
/** Error message if failed */
|
|
1076
|
-
error?: string;
|
|
1077
|
-
}
|
|
1078
1199
|
/**
|
|
1079
1200
|
* Loader configuration for resolving `uses` imports
|
|
1080
1201
|
*/
|
|
@@ -1170,7 +1291,11 @@ declare class OrbitalServerRuntime {
|
|
|
1170
1291
|
protected orbitals: Map<string, RegisteredOrbital>;
|
|
1171
1292
|
private eventBus;
|
|
1172
1293
|
private config;
|
|
1173
|
-
|
|
1294
|
+
/** The bound persistence adapter (mock/in-memory/consumer-supplied). Public
|
|
1295
|
+
* so a test can inspect committed rows honestly — `(runtime as any)
|
|
1296
|
+
* .persistence` was the alternative, and that cast is what this field
|
|
1297
|
+
* visibility replaces. */
|
|
1298
|
+
readonly persistence: PersistenceAdapter;
|
|
1174
1299
|
private listenerCleanups;
|
|
1175
1300
|
private tickBindings;
|
|
1176
1301
|
private readonly tickScheduler;
|
|
@@ -1208,6 +1333,15 @@ declare class OrbitalServerRuntime {
|
|
|
1208
1333
|
* `declaredDefaults` and ahead of `callSiteOverride`.
|
|
1209
1334
|
*/
|
|
1210
1335
|
private resolvedTraitConfigs;
|
|
1336
|
+
/**
|
|
1337
|
+
* Referrer trait name → the DIRECT children (via `@trait.X`) that need
|
|
1338
|
+
* their lifecycle transition re-run under the referrer's `callsitePayload`
|
|
1339
|
+
* whenever the referrer's own transition fires — computed once per
|
|
1340
|
+
* `register()` via `@almadar/core`'s `collectCallsiteCaptureChildren`
|
|
1341
|
+
* (merged across every orbital in the schema, same flattening
|
|
1342
|
+
* `resolvedTraitConfigs` uses). See `rerenderCallsiteCaptureChildren`.
|
|
1343
|
+
*/
|
|
1344
|
+
private callsiteCaptureChildrenByTrait;
|
|
1211
1345
|
constructor(config?: OrbitalServerRuntimeConfig);
|
|
1212
1346
|
/**
|
|
1213
1347
|
* Lazily wire the OS-level effect handlers (fs/net/child_process), merging
|
|
@@ -1258,6 +1392,14 @@ declare class OrbitalServerRuntime {
|
|
|
1258
1392
|
* that lives on only one execution path is not a feature.
|
|
1259
1393
|
*/
|
|
1260
1394
|
private applyIdentityOwnerFields;
|
|
1395
|
+
/**
|
|
1396
|
+
* Merge `collectCallsiteCaptureChildren` across every orbital in the
|
|
1397
|
+
* schema into ONE flat referrer-trait-name → children map — same
|
|
1398
|
+
* flattening `resolvedTraitConfigs` uses, safe because trait names are
|
|
1399
|
+
* unique within one running schema (the compose/resolve pipeline already
|
|
1400
|
+
* relies on that for `configByTrait` and `resolvedTraitConfigs`).
|
|
1401
|
+
*/
|
|
1402
|
+
private buildCallsiteCaptureChildrenByTrait;
|
|
1261
1403
|
/**
|
|
1262
1404
|
* Register an OrbitalSchema synchronously (for backward compatibility).
|
|
1263
1405
|
* Note: This version doesn't wait for instance seeding to complete.
|
|
@@ -1519,6 +1661,35 @@ declare class OrbitalServerRuntime {
|
|
|
1519
1661
|
* Execute effects from a transition
|
|
1520
1662
|
*/
|
|
1521
1663
|
private executeEffects;
|
|
1664
|
+
/**
|
|
1665
|
+
* Re-run a JSX-hoisted inline child trait's (`@trait.X`) lifecycle
|
|
1666
|
+
* transition under `callsitePayload` — the payload of the transition that
|
|
1667
|
+
* just composed it — so its `@callsitePayload.<field>` captures reflect
|
|
1668
|
+
* the composing event instead of staying frozen at whatever the child
|
|
1669
|
+
* captured at its own mount-time INIT (a child renders once at mount and
|
|
1670
|
+
* never again on its own).
|
|
1671
|
+
*
|
|
1672
|
+
* `this.callsiteCaptureChildrenByTrait` (built at `register()` via
|
|
1673
|
+
* `@almadar/core`'s `collectCallsiteCaptureChildren`) gives `traitName`'s
|
|
1674
|
+
* DIRECT children that need this — either because the child itself
|
|
1675
|
+
* captures, or because it is a pass-through to a capturing descendant.
|
|
1676
|
+
* The child's lifecycle event (INIT/LOAD/$MOUNT) is re-dispatched
|
|
1677
|
+
* TARGETED at just that trait, from its CURRENT state (the same
|
|
1678
|
+
* guard-aware `sendEvent`/`canHandleEvent` lookup a mount-time INIT
|
|
1679
|
+
* uses), then its effects run through the SAME `executeEffects` used
|
|
1680
|
+
* everywhere else, with `payload: {}` (a lifecycle event carries none)
|
|
1681
|
+
* and `callsitePayload` set so `@callsitePayload.*` resolves — pushing
|
|
1682
|
+
* into the SAME `clientEffects`/`clientEffectsByTrait`/`effectResults`
|
|
1683
|
+
* so the child's refreshed frame reaches the sidecar under its own trait
|
|
1684
|
+
* name. Recurses into the child's own entry in the same map (still under
|
|
1685
|
+
* the SAME `callsitePayload` — the capture resolves up the embed chain to
|
|
1686
|
+
* the nearest transition that actually has one) for grandchildren;
|
|
1687
|
+
* `visited` guards against a malformed embed graph cycling on itself.
|
|
1688
|
+
* Never goes through `processOrbitalEvent` (that would be re-entrant) —
|
|
1689
|
+
* calls this internal executor directly, exactly like every other
|
|
1690
|
+
* transition's effects.
|
|
1691
|
+
*/
|
|
1692
|
+
private rerenderCallsiteCaptureChildren;
|
|
1522
1693
|
/**
|
|
1523
1694
|
* Populate relation fields on entities
|
|
1524
1695
|
*
|
|
@@ -1550,6 +1721,7 @@ declare class OrbitalServerRuntime {
|
|
|
1550
1721
|
* Routes:
|
|
1551
1722
|
* - GET / - List registered orbitals
|
|
1552
1723
|
* - GET /:orbital - Get orbital info and current states
|
|
1724
|
+
* - GET /:orbital/entities/:entityType - Full mock-store row set (verification/tooling only)
|
|
1553
1725
|
* - POST /:orbital/events - Send event to orbital (includes data from `fetch` effects)
|
|
1554
1726
|
*/
|
|
1555
1727
|
router(): Router;
|
|
@@ -1591,4 +1763,4 @@ declare class OrbitalServerRuntime {
|
|
|
1591
1763
|
*/
|
|
1592
1764
|
declare function createOrbitalServerRuntime(config?: OrbitalServerRuntimeConfig): OrbitalServerRuntime;
|
|
1593
1765
|
|
|
1594
|
-
export {
|
|
1766
|
+
export { isElectron as A, isNamespacedEvent as B, type CreateServerEffectHandlersOptions as C, isNode as D, type EntitySharingMap as E, normalizeEventKey as F, parseNamespacedEvent as G, preprocessSchema as H, type ImportChainLike as I, processEvent as J, type ClientEffectTuple as K, type LoadResult as L, type ClientNavigateBackTuple as M, type ClientNavigateTuple as N, type OrbitalEventRequest as O, type PersistenceAdapter as P, type ClientNotifyTuple as Q, type RegisteredOrbital as R, type SchemaLoader as S, type ClientRenderUITuple as T, type UnifiedLoaderOptions as U, type LiveBroadcastItem as V, type LoaderConfig as W, OrbitalServerRuntime as X, type RuntimeTraitTick as Y, createOrbitalServerRuntime as Z, type LoadedSchema as a, type LoadedOrbital as b, EventBus as c, type EventNamespaceMap as d, InMemoryPersistence as e, LIFECYCLE_EVENTS as f, type OrbitalEventResponse as g, type OrbitalServerRuntimeConfig as h, type PreprocessOptions as i, type PreprocessResult as j, type PreprocessedSchema as k, type ProcessEventOptions as l, type RuntimeOrbital as m, type RuntimeOrbitalSchema as n, type RuntimeTrait as o, type ServerEffectResult as p, StateMachineManager as q, collectDeclaredConfigDefaults as r, collectDeclaredEntityDefaults as s, createInitialTraitState as t, createServerEffectHandlers as u, findInitialState as v, findTransition as w, getIsolatedCollectionName as x, getNamespacedEvent as y, isBrowser as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'express';
|
|
2
|
-
export {
|
|
3
|
-
import './types-
|
|
2
|
+
export { K as ClientEffectTuple, M as ClientNavigateBackTuple, N as ClientNavigateTuple, Q as ClientNotifyTuple, T as ClientRenderUITuple, e as InMemoryPersistence, V as LiveBroadcastItem, W as LoaderConfig, O as OrbitalEventRequest, g as OrbitalEventResponse, X as OrbitalServerRuntime, h as OrbitalServerRuntimeConfig, P as PersistenceAdapter, R as RegisteredOrbital, m as RuntimeOrbital, n as RuntimeOrbitalSchema, o as RuntimeTrait, Y as RuntimeTraitTick, r as collectDeclaredConfigDefaults, Z as createOrbitalServerRuntime } from './OrbitalServerRuntime-BiEntWd-.js';
|
|
3
|
+
import './types-CWaIuEQn.js';
|
|
4
4
|
import '@almadar/core';
|