@cyberart-io/engine 0.0.8 → 0.0.10
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/CHANGELOG.md +53 -0
- package/README.md +305 -1
- package/dist/headless.d.ts +2625 -40
- package/dist/headless.js +1 -1
- package/dist/index.d.ts +2697 -237
- package/dist/index.js +1 -1
- package/docs/asset-resolver.md +1 -1
- package/docs/audio.md +24 -0
- package/docs/browser-harness.md +3 -2
- package/docs/capability-manifest.md +1 -1
- package/docs/content-revision.md +64 -0
- package/docs/events.md +1 -1
- package/docs/headless-harness.md +1 -1
- package/docs/job-orchestration.md +55 -0
- package/docs/portal-lifecycle.md +50 -0
- package/docs/presentation-bindings.md +93 -0
- package/docs/presentation-sequences.md +150 -0
- package/docs/production-scenario.md +167 -0
- package/docs/remote-cart-manifest.md +66 -0
- package/docs/replay-inspector.md +1 -1
- package/docs/runtime-group.md +1 -1
- package/docs/selection-trace.md +60 -0
- package/docs/semantic-layers.md +72 -0
- package/docs/snapshots.md +1 -1
- package/docs/visual-layers.md +1 -1
- package/docs/world-graph.md +39 -0
- package/docs/world-patch.md +61 -0
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -540,9 +540,17 @@ type SnapshotIntegrity = {
|
|
|
540
540
|
alg: string;
|
|
541
541
|
hash: string;
|
|
542
542
|
};
|
|
543
|
+
type SnapshotSignatureRef = {
|
|
544
|
+
id: string;
|
|
545
|
+
alg: string;
|
|
546
|
+
};
|
|
543
547
|
type SnapshotProvenance = {
|
|
544
548
|
source?: string;
|
|
545
549
|
integrity?: SnapshotIntegrity;
|
|
550
|
+
publisher?: string;
|
|
551
|
+
version?: string;
|
|
552
|
+
signature?: SnapshotSignatureRef;
|
|
553
|
+
grants?: string[];
|
|
546
554
|
};
|
|
547
555
|
type SnapshotEnvelope = {
|
|
548
556
|
schemaVersion: typeof SNAPSHOT_SCHEMA_VERSION;
|
|
@@ -634,7 +642,7 @@ declare function engineStateFromEnvelope(snapshot: SnapshotEnvelope): CartStateB
|
|
|
634
642
|
|
|
635
643
|
declare const ASSET_KINDS: readonly ["image", "audio", "font", "spritesheet"];
|
|
636
644
|
type AssetKind = (typeof ASSET_KINDS)[number];
|
|
637
|
-
declare const ASSET_FAILURE_CODES: readonly ["timeout", "cors", "not-found", "invalid", "aborted", "resolver"];
|
|
645
|
+
declare const ASSET_FAILURE_CODES: readonly ["timeout", "cors", "not-found", "invalid", "aborted", "resolver", "undeclared", "hash-mismatch", "unsigned"];
|
|
638
646
|
type AssetFailureCode = (typeof ASSET_FAILURE_CODES)[number];
|
|
639
647
|
type AssetCorsMode = 'anonymous' | 'use-credentials' | 'omit';
|
|
640
648
|
/** Logical silent placeholder. Carts/hosts may treat it as “no media”. */
|
|
@@ -775,6 +783,26 @@ declare function assetStatusEvent(status: 'ready' | 'failed', payload: {
|
|
|
775
783
|
declare function rewriteHostedAssetRef(ref: string, cdnBase: string): string;
|
|
776
784
|
declare function createFixtureAssetResolver(catalog: FixtureAssetCatalog): AssetResolver;
|
|
777
785
|
declare function createHostedAssetResolver(options: HostedAssetResolverOptions): AssetResolver;
|
|
786
|
+
type DeclaredAssetBytes = {
|
|
787
|
+
url: string;
|
|
788
|
+
hash: string;
|
|
789
|
+
alg?: 'sha256';
|
|
790
|
+
};
|
|
791
|
+
type DeclaredAssetResolverOptions = {
|
|
792
|
+
/** Logical refs this cart may load. Unknown refs fail `undeclared`. */
|
|
793
|
+
declared: Readonly<Record<string, DeclaredAssetBytes>>;
|
|
794
|
+
/**
|
|
795
|
+
* Byte source keyed by declared URL. Tests inject a map. Missing bytes
|
|
796
|
+
* fail `unsigned`. The resolver does not call ambient `fetch`.
|
|
797
|
+
*/
|
|
798
|
+
fetchBytes: (url: string) => Promise<Uint8Array | undefined>;
|
|
799
|
+
hashBytes?: (bytes: Uint8Array) => Promise<string>;
|
|
800
|
+
};
|
|
801
|
+
/**
|
|
802
|
+
* Resolve only declared asset refs. Bytes must match the declared hash.
|
|
803
|
+
* Unsigned or mismatched payloads fail closed.
|
|
804
|
+
*/
|
|
805
|
+
declare function createDeclaredAssetResolver(options: DeclaredAssetResolverOptions): AssetResolver;
|
|
778
806
|
declare function createAssetPreloader(options: CreateAssetPreloaderOptions): AssetPreloader;
|
|
779
807
|
|
|
780
808
|
declare const DEFAULT_DUCK_GAIN = 0.25;
|
|
@@ -1469,6 +1497,11 @@ type PresentationTimeline = {
|
|
|
1469
1497
|
reset(): void;
|
|
1470
1498
|
snapshot(): CueTimelineSnapshot;
|
|
1471
1499
|
get(idempotencyKey: string): CueView | undefined;
|
|
1500
|
+
/**
|
|
1501
|
+
* Updates the host flag used by future `play()` calls. In-flight cue
|
|
1502
|
+
* durations stay as compiled. Not a CSS media query.
|
|
1503
|
+
*/
|
|
1504
|
+
setReducedMotion(value: boolean): void;
|
|
1472
1505
|
readonly frame: number;
|
|
1473
1506
|
readonly reducedMotion: boolean;
|
|
1474
1507
|
};
|
|
@@ -1490,6 +1523,7 @@ declare const AUDIO_CUE_STARTED_EVENT: "audio.cue.started";
|
|
|
1490
1523
|
declare const AUDIO_CUE_SKIPPED_EVENT: "audio.cue.skipped";
|
|
1491
1524
|
declare const AUDIO_CUE_FAILED_EVENT: "audio.cue.failed";
|
|
1492
1525
|
declare const AUDIO_CUE_EVENTS: readonly ["audio.cue.scheduled", "audio.cue.started", "audio.cue.skipped", "audio.cue.failed"];
|
|
1526
|
+
declare const AUDIO_CUE_SNAPSHOT_SCHEMA_VERSION: 1;
|
|
1493
1527
|
type AudioCueEventType = (typeof AUDIO_CUE_EVENTS)[number];
|
|
1494
1528
|
type AudioCueSkipReason = 'reduced-sensory' | 'muted' | 'unauthorized';
|
|
1495
1529
|
type AudioCueFailReason = 'asset-failed' | 'torn-down' | 'invalid';
|
|
@@ -1507,6 +1541,8 @@ type AudioCueView = CueView & {
|
|
|
1507
1541
|
participantId?: string;
|
|
1508
1542
|
priority: number;
|
|
1509
1543
|
audioPhase: 'scheduled' | 'started' | 'skipped' | 'failed' | 'completed';
|
|
1544
|
+
/** Original play spec; omitted when the cue was not repeating. */
|
|
1545
|
+
repeat?: CueRepeatPolicy;
|
|
1510
1546
|
};
|
|
1511
1547
|
type AudioCueEvent = {
|
|
1512
1548
|
type: AudioCueEventType;
|
|
@@ -1520,11 +1556,28 @@ type AudioCueEvent = {
|
|
|
1520
1556
|
progress: number;
|
|
1521
1557
|
};
|
|
1522
1558
|
type AudioCueTimelineSnapshot = {
|
|
1559
|
+
schemaVersion: typeof AUDIO_CUE_SNAPSHOT_SCHEMA_VERSION;
|
|
1523
1560
|
frame: number;
|
|
1524
1561
|
reducedSensory: boolean;
|
|
1525
1562
|
cues: AudioCueView[];
|
|
1526
1563
|
events: AudioCueEvent[];
|
|
1527
1564
|
};
|
|
1565
|
+
type HeadlessAudioAdapterSnapshot = AudioCueTimelineSnapshot & {
|
|
1566
|
+
unlock: AudioUnlockStatus;
|
|
1567
|
+
muted: boolean;
|
|
1568
|
+
};
|
|
1569
|
+
type AudioCueDiagnostic = {
|
|
1570
|
+
code: string;
|
|
1571
|
+
detail: string;
|
|
1572
|
+
path?: string;
|
|
1573
|
+
};
|
|
1574
|
+
type RestoreAudioCueResult = {
|
|
1575
|
+
ok: true;
|
|
1576
|
+
snapshot: AudioCueTimelineSnapshot;
|
|
1577
|
+
} | {
|
|
1578
|
+
ok: false;
|
|
1579
|
+
errors: AudioCueDiagnostic[];
|
|
1580
|
+
};
|
|
1528
1581
|
type PlayAudioCueResult = {
|
|
1529
1582
|
ok: true;
|
|
1530
1583
|
cue: AudioCueView;
|
|
@@ -1544,8 +1597,15 @@ type AudioCueTimeline = {
|
|
|
1544
1597
|
cancel(idempotencyKey: string): boolean;
|
|
1545
1598
|
reset(): void;
|
|
1546
1599
|
snapshot(): AudioCueTimelineSnapshot;
|
|
1600
|
+
restore(input: unknown): RestoreAudioCueResult;
|
|
1547
1601
|
get(idempotencyKey: string): AudioCueView | undefined;
|
|
1548
1602
|
dispose(): void;
|
|
1603
|
+
/**
|
|
1604
|
+
* Updates skip-playback for future cue starts. Already-started cues
|
|
1605
|
+
* continue; scheduled cues that have not started yet use the new flag
|
|
1606
|
+
* when they start.
|
|
1607
|
+
*/
|
|
1608
|
+
setReducedSensory(value: boolean): void;
|
|
1549
1609
|
readonly frame: number;
|
|
1550
1610
|
readonly reducedSensory: boolean;
|
|
1551
1611
|
};
|
|
@@ -1556,13 +1616,14 @@ type HeadlessAudioAdapter = {
|
|
|
1556
1616
|
play(spec: AudioCueSpec): PlayAudioCueResult;
|
|
1557
1617
|
step(frames?: number): AudioCueEvent[];
|
|
1558
1618
|
handleHostEvent(event: HostEvent): void;
|
|
1559
|
-
snapshot():
|
|
1560
|
-
|
|
1561
|
-
muted: boolean;
|
|
1562
|
-
};
|
|
1619
|
+
snapshot(): HeadlessAudioAdapterSnapshot;
|
|
1620
|
+
restore(input: unknown): RestoreAudioCueResult;
|
|
1563
1621
|
destroy(): void;
|
|
1622
|
+
setReducedSensory(value: boolean): void;
|
|
1623
|
+
readonly reducedSensory: boolean;
|
|
1564
1624
|
};
|
|
1565
1625
|
declare function isAudioCueEventType(value: unknown): value is AudioCueEventType;
|
|
1626
|
+
declare function parseAudioCueSnapshot(input: unknown): RestoreAudioCueResult;
|
|
1566
1627
|
declare function createAudioCueTimeline(options?: CreateAudioCueTimelineOptions): AudioCueTimeline;
|
|
1567
1628
|
declare function scheduleAudioCue(timeline: AudioCueTimeline, spec: AudioCueSpec): PlayAudioCueResult;
|
|
1568
1629
|
declare function createHeadlessAudioAdapter(options?: {
|
|
@@ -1594,6 +1655,9 @@ declare const CAPABILITY_CLEAR_POLICIES: readonly ["transparent", "opaque"];
|
|
|
1594
1655
|
type CapabilityClearPolicy = (typeof CAPABILITY_CLEAR_POLICIES)[number];
|
|
1595
1656
|
declare const CAPABILITY_CART_KINDS: readonly ["render", "calculation"];
|
|
1596
1657
|
type CapabilityCartKind = (typeof CAPABILITY_CART_KINDS)[number];
|
|
1658
|
+
/** Device/host grants a remote cart may request. Omitted on existing manifests. */
|
|
1659
|
+
declare const CAPABILITY_DEVICE_GRANTS: readonly ["audio", "controller", "network", "persistence", "fullscreen"];
|
|
1660
|
+
type CapabilityDeviceGrant = (typeof CAPABILITY_DEVICE_GRANTS)[number];
|
|
1597
1661
|
type CapabilityDiagnostic = {
|
|
1598
1662
|
code: string;
|
|
1599
1663
|
detail: string;
|
|
@@ -1650,6 +1714,8 @@ type CapabilityManifest = {
|
|
|
1650
1714
|
modules?: CapabilityModuleRequirements;
|
|
1651
1715
|
/** Omitted means `'render'`. `'calculation'` carts have no surface. */
|
|
1652
1716
|
kind?: CapabilityCartKind;
|
|
1717
|
+
/** Optional device grants (CYB-74). Omitted on existing manifests. */
|
|
1718
|
+
grants?: CapabilityDeviceGrant[];
|
|
1653
1719
|
};
|
|
1654
1720
|
type CapabilityManifestInput = {
|
|
1655
1721
|
version?: number;
|
|
@@ -1666,6 +1732,7 @@ type CapabilityManifestInput = {
|
|
|
1666
1732
|
layers?: CapabilityLayerRequirements;
|
|
1667
1733
|
modules?: CapabilityModuleRequirements;
|
|
1668
1734
|
kind?: CapabilityCartKind;
|
|
1735
|
+
grants?: CapabilityDeviceGrant[];
|
|
1669
1736
|
};
|
|
1670
1737
|
type HostCapabilities = {
|
|
1671
1738
|
contractVersion: number;
|
|
@@ -1681,6 +1748,11 @@ type HostCapabilities = {
|
|
|
1681
1748
|
modules?: CapabilityModuleRequirements;
|
|
1682
1749
|
/** Cart kinds this host can run. Omitted: kind is not checked. */
|
|
1683
1750
|
kinds?: CapabilityCartKind[];
|
|
1751
|
+
/**
|
|
1752
|
+
* Device grants this host is willing to give. Omitted is treated as an
|
|
1753
|
+
* empty set (deny-by-default) when the cart listed `grants`.
|
|
1754
|
+
*/
|
|
1755
|
+
grants?: CapabilityDeviceGrant[];
|
|
1684
1756
|
};
|
|
1685
1757
|
type DefineCapabilityManifestResult = {
|
|
1686
1758
|
ok: true;
|
|
@@ -1875,6 +1947,8 @@ declare function validateGeometry(doc: GeometryDocument): GeometryValidation;
|
|
|
1875
1947
|
declare function drawGeometryDebug(ctx: GeometryDebugContext, layout: PresentationLayout, doc: GeometryDocument, diagnostics?: readonly GeometryDiagnostic[]): DebugDrawCall[];
|
|
1876
1948
|
declare function serializeGeometry(doc: GeometryDocument): string;
|
|
1877
1949
|
declare function parseGeometry(json: string): GeometryDocument;
|
|
1950
|
+
/** True when the normalized point is inside the hitbox rect or polygon. */
|
|
1951
|
+
declare function pointInHitbox(region: GeometryHitbox, point: NormalizedPoint): boolean;
|
|
1878
1952
|
|
|
1879
1953
|
/**
|
|
1880
1954
|
* Copyright (c) 2026 Aaron Boyarsky
|
|
@@ -1945,10 +2019,14 @@ type RuntimeGroupParticipantInspect = {
|
|
|
1945
2019
|
emit: string[];
|
|
1946
2020
|
subscribe: string[];
|
|
1947
2021
|
authoritative: boolean;
|
|
2022
|
+
/** True when the group skips this slot on `step` (portal parent suspend). */
|
|
2023
|
+
suspended: boolean;
|
|
1948
2024
|
};
|
|
1949
2025
|
type RuntimeGroupDiagnostics = {
|
|
1950
2026
|
paused: boolean;
|
|
1951
2027
|
participantIds: string[];
|
|
2028
|
+
/** Participants skipped by `step` until `resumeParticipant`. Sorted. */
|
|
2029
|
+
suspendedIds: string[];
|
|
1952
2030
|
clocks: Record<string, ClockSnapshot>;
|
|
1953
2031
|
rejections: unknown[];
|
|
1954
2032
|
};
|
|
@@ -1980,6 +2058,13 @@ type RuntimeGroup = {
|
|
|
1980
2058
|
resize(width: number, height: number): void;
|
|
1981
2059
|
/** Tear down one participant without destroying the group or blanking siblings. */
|
|
1982
2060
|
detach(id: string): void;
|
|
2061
|
+
/**
|
|
2062
|
+
* Pause this cart's live loop and skip it on group `step`. Snapshot-safe
|
|
2063
|
+
* state is retained. Used by portal lifecycle; does not pause siblings.
|
|
2064
|
+
*/
|
|
2065
|
+
suspendParticipant(id: string): void;
|
|
2066
|
+
resumeParticipant(id: string): void;
|
|
2067
|
+
isParticipantSuspended(id: string): boolean;
|
|
1983
2068
|
dispatch(participantId: string, event: HostEvent): void;
|
|
1984
2069
|
publish(event: EventInput, extras?: PublishExtras): EventEnvelope | undefined;
|
|
1985
2070
|
inspectParticipants(): Array<RouterParticipantInspect & {
|
|
@@ -1990,166 +2075,1432 @@ type RuntimeGroup = {
|
|
|
1990
2075
|
};
|
|
1991
2076
|
declare function createRuntimeGroup(options: CreateRuntimeGroupOptions): RuntimeGroup;
|
|
1992
2077
|
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2078
|
+
/**
|
|
2079
|
+
* Copyright (c) 2026 Aaron Boyarsky
|
|
2080
|
+
* SPDX-License-Identifier: LicenseRef-CyberArt-Engine
|
|
2081
|
+
* See packages/engine/LICENSE
|
|
2082
|
+
*
|
|
2083
|
+
* Trusted, versioned executable-module host. Factories are registered by
|
|
2084
|
+
* exact id+version; the host allowlists which refs may load. Untrusted
|
|
2085
|
+
* source strings are not compiled. Per-module failures do not stop siblings.
|
|
2086
|
+
*/
|
|
2087
|
+
declare const EXECUTABLE_MODULE_ERROR_CODES: readonly ["invalid-ref", "unknown-module", "version-mismatch", "not-allowlisted", "load-failed", "invoke-failed", "timeout", "rate-limited", "destroyed"];
|
|
2088
|
+
type ExecutableModuleErrorCode = (typeof EXECUTABLE_MODULE_ERROR_CODES)[number];
|
|
2089
|
+
type ExecutableModuleRef = {
|
|
2090
|
+
id: string;
|
|
2091
|
+
version: string;
|
|
2001
2092
|
};
|
|
2002
|
-
type
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
registry?: Pick<ContractRegistry, 'get'>;
|
|
2093
|
+
type ExecutableModuleError = {
|
|
2094
|
+
code: ExecutableModuleErrorCode;
|
|
2095
|
+
detail: string;
|
|
2096
|
+
ref?: ExecutableModuleRef;
|
|
2007
2097
|
};
|
|
2008
|
-
type
|
|
2009
|
-
|
|
2098
|
+
type ExecutableModuleDiagnostic = ExecutableModuleError;
|
|
2099
|
+
type ExecutableModuleCapabilities = {
|
|
2100
|
+
readonly [key: string]: unknown;
|
|
2101
|
+
};
|
|
2102
|
+
type ExecutableModuleInvokeContext = {
|
|
2103
|
+
signal: AbortSignal;
|
|
2010
2104
|
turn: number;
|
|
2011
|
-
time: number;
|
|
2012
|
-
outcome: RouterDecisionOutcome;
|
|
2013
|
-
reason?: RouterDecisionReason;
|
|
2014
|
-
detail?: string;
|
|
2015
|
-
source: string;
|
|
2016
|
-
target?: string;
|
|
2017
|
-
type: string;
|
|
2018
|
-
kind?: EventKind;
|
|
2019
|
-
envelopeId?: string;
|
|
2020
|
-
priorEnvelopeId?: string;
|
|
2021
|
-
correlationId?: string;
|
|
2022
|
-
causationId?: string;
|
|
2023
|
-
hops?: number;
|
|
2024
|
-
seq?: number;
|
|
2025
|
-
idempotencyKey?: string;
|
|
2026
|
-
schemaVersion?: number;
|
|
2027
|
-
payloadSchemaVersion?: number;
|
|
2028
|
-
deliveredTo: string[];
|
|
2029
|
-
payload?: unknown;
|
|
2030
2105
|
};
|
|
2031
|
-
type
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
source: string;
|
|
2035
|
-
outcome: RouterDecisionOutcome;
|
|
2036
|
-
reason?: RouterDecisionReason;
|
|
2037
|
-
children: CausationTreeNode[];
|
|
2106
|
+
type ExecutableModuleInstance = {
|
|
2107
|
+
invoke(input: unknown, context: ExecutableModuleInvokeContext): unknown | Promise<unknown>;
|
|
2108
|
+
destroy?: () => void;
|
|
2038
2109
|
};
|
|
2039
|
-
type
|
|
2110
|
+
type ExecutableModuleFactory = (capabilities: ExecutableModuleCapabilities) => ExecutableModuleInstance;
|
|
2111
|
+
type ExecutableModuleRegistration = {
|
|
2040
2112
|
id: string;
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
authoritative: boolean;
|
|
2045
|
-
seed?: string;
|
|
2046
|
-
clock?: ClockSnapshot;
|
|
2047
|
-
state?: unknown;
|
|
2048
|
-
errorCount: number;
|
|
2049
|
-
lastError?: string;
|
|
2113
|
+
version: string;
|
|
2114
|
+
create: ExecutableModuleFactory;
|
|
2115
|
+
capabilities?: ExecutableModuleCapabilities;
|
|
2050
2116
|
};
|
|
2051
|
-
type
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
trees: CausationTreeNode[];
|
|
2056
|
-
dropped: number;
|
|
2117
|
+
type ExecutableModuleLimits = {
|
|
2118
|
+
/** Cooperative timeout; the invoke AbortSignal aborts after this many ms. */
|
|
2119
|
+
maxInvokeMs?: number;
|
|
2120
|
+
maxInvokesPerTurn?: number;
|
|
2057
2121
|
};
|
|
2058
|
-
type
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
participantId: string;
|
|
2065
|
-
event: HostEvent;
|
|
2066
|
-
} | {
|
|
2067
|
-
kind: 'step';
|
|
2068
|
-
frames: number;
|
|
2069
|
-
} | {
|
|
2070
|
-
kind: 'asset';
|
|
2071
|
-
participantId: string;
|
|
2072
|
-
event: HostEvent;
|
|
2122
|
+
type CreateExecutableModuleHostOptions = {
|
|
2123
|
+
allowlist: readonly ExecutableModuleRef[];
|
|
2124
|
+
modules: readonly ExecutableModuleRegistration[];
|
|
2125
|
+
limits?: ExecutableModuleLimits;
|
|
2126
|
+
/** Default capability bag. Frozen per module; class instances stay shared handles. */
|
|
2127
|
+
capabilities?: ExecutableModuleCapabilities;
|
|
2073
2128
|
};
|
|
2074
|
-
type
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
records: InspectorRecord[];
|
|
2081
|
-
snapshots: Record<string, unknown>;
|
|
2129
|
+
type ExecutableModuleInvokeResult = {
|
|
2130
|
+
ok: true;
|
|
2131
|
+
value: unknown;
|
|
2132
|
+
} | {
|
|
2133
|
+
ok: false;
|
|
2134
|
+
error: ExecutableModuleError;
|
|
2082
2135
|
};
|
|
2083
|
-
type
|
|
2136
|
+
type ExecutableModuleLoadResult = {
|
|
2084
2137
|
ok: true;
|
|
2138
|
+
ref: ExecutableModuleRef;
|
|
2085
2139
|
} | {
|
|
2086
2140
|
ok: false;
|
|
2087
|
-
|
|
2141
|
+
error: ExecutableModuleError;
|
|
2088
2142
|
};
|
|
2089
|
-
type
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2143
|
+
type ExecutableModuleHostInspect = {
|
|
2144
|
+
allowlist: ExecutableModuleRef[];
|
|
2145
|
+
registered: ExecutableModuleRef[];
|
|
2146
|
+
loaded: ExecutableModuleRef[];
|
|
2147
|
+
turn: number;
|
|
2148
|
+
invokesThisTurn: number;
|
|
2149
|
+
diagnostics: ExecutableModuleDiagnostic[];
|
|
2096
2150
|
};
|
|
2097
|
-
type
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
report(filter?: ReplayTraceFilter): ReplayInspectorReport;
|
|
2103
|
-
causationTree(correlationId?: string): CausationTreeNode[];
|
|
2104
|
-
records(): InspectorRecord[];
|
|
2105
|
-
reset(): void;
|
|
2151
|
+
type ExecutableModuleHost = {
|
|
2152
|
+
load(ref: ExecutableModuleRef): ExecutableModuleLoadResult;
|
|
2153
|
+
invoke(ref: ExecutableModuleRef, input?: unknown): Promise<ExecutableModuleInvokeResult>;
|
|
2154
|
+
beginTurn(): void;
|
|
2155
|
+
inspect(): ExecutableModuleHostInspect;
|
|
2106
2156
|
destroy(): void;
|
|
2107
2157
|
};
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2158
|
+
/**
|
|
2159
|
+
* Deep-freeze JSON-like values so modules cannot rewrite the bag. Class
|
|
2160
|
+
* instances (and other non-plain objects) are passed through as host handles.
|
|
2161
|
+
*/
|
|
2162
|
+
declare function freezeCapabilityBag(value: unknown): unknown;
|
|
2163
|
+
declare function createExecutableModuleHost(options: CreateExecutableModuleHostOptions): ExecutableModuleHost;
|
|
2114
2164
|
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2165
|
+
/**
|
|
2166
|
+
* Copyright (c) 2026 Aaron Boyarsky
|
|
2167
|
+
* SPDX-License-Identifier: LicenseRef-CyberArt-Engine
|
|
2168
|
+
* See packages/engine/LICENSE
|
|
2169
|
+
*
|
|
2170
|
+
* Signed, versioned remote-cart manifests. HMAC signatures, declared-asset
|
|
2171
|
+
* loads, and deny-by-default host grants. Trusted factories only — no eval.
|
|
2172
|
+
*/
|
|
2173
|
+
|
|
2174
|
+
declare const REMOTE_CART_MANIFEST_VERSION: 1;
|
|
2175
|
+
declare const REMOTE_CART_SIGNATURE_ALG: "hmac-sha256";
|
|
2176
|
+
declare const HOST_GRANT_SNAPSHOT_SCHEMA_VERSION: 1;
|
|
2177
|
+
declare const REMOTE_CART_GRANTS: readonly ["audio", "controller", "network", "persistence", "fullscreen"];
|
|
2178
|
+
type RemoteCartGrant = CapabilityDeviceGrant;
|
|
2179
|
+
declare const REMOTE_CART_ERROR_CODES: readonly ["invalid-json", "invalid-manifest", "invalid-version", "invalid-signature", "unknown-publisher", "unknown-key", "undeclared-asset", "hash-mismatch", "unsigned-bytes", "capability-denied", "destroyed", "load-failed"];
|
|
2180
|
+
type RemoteCartErrorCode = (typeof REMOTE_CART_ERROR_CODES)[number];
|
|
2181
|
+
type RemoteCartDiagnostic = {
|
|
2182
|
+
code: RemoteCartErrorCode | string;
|
|
2183
|
+
detail: string;
|
|
2184
|
+
path?: string;
|
|
2124
2185
|
};
|
|
2125
|
-
type
|
|
2126
|
-
|
|
2127
|
-
|
|
2186
|
+
type RemoteCartAsset = {
|
|
2187
|
+
id: string;
|
|
2188
|
+
kind: AssetKind;
|
|
2189
|
+
url: string;
|
|
2190
|
+
hash: string;
|
|
2191
|
+
alg: 'sha256';
|
|
2128
2192
|
};
|
|
2129
|
-
type
|
|
2130
|
-
|
|
2131
|
-
|
|
2193
|
+
type RemoteCartManifestBody = {
|
|
2194
|
+
version: typeof REMOTE_CART_MANIFEST_VERSION;
|
|
2195
|
+
id: string;
|
|
2196
|
+
cartVersion: string;
|
|
2197
|
+
publisher: string;
|
|
2198
|
+
assets: RemoteCartAsset[];
|
|
2199
|
+
requestedGrants: RemoteCartGrant[];
|
|
2200
|
+
module?: ExecutableModuleRef;
|
|
2201
|
+
capabilities?: CapabilityManifest;
|
|
2202
|
+
};
|
|
2203
|
+
type RemoteCartSignature = {
|
|
2204
|
+
alg: typeof REMOTE_CART_SIGNATURE_ALG;
|
|
2205
|
+
keyId: string;
|
|
2206
|
+
mac: string;
|
|
2207
|
+
};
|
|
2208
|
+
type SignedRemoteCartManifest = {
|
|
2209
|
+
body: RemoteCartManifestBody;
|
|
2210
|
+
signature: RemoteCartSignature;
|
|
2211
|
+
};
|
|
2212
|
+
type DefineRemoteCartResult = {
|
|
2213
|
+
ok: true;
|
|
2214
|
+
manifest: SignedRemoteCartManifest;
|
|
2215
|
+
} | {
|
|
2216
|
+
ok: false;
|
|
2217
|
+
errors: RemoteCartDiagnostic[];
|
|
2132
2218
|
};
|
|
2133
|
-
type
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2219
|
+
type VerifyRemoteCartResult = {
|
|
2220
|
+
ok: true;
|
|
2221
|
+
manifest: SignedRemoteCartManifest;
|
|
2222
|
+
} | {
|
|
2223
|
+
ok: false;
|
|
2224
|
+
errors: RemoteCartDiagnostic[];
|
|
2139
2225
|
};
|
|
2140
|
-
type
|
|
2226
|
+
type RemoteCartLoadSource = {
|
|
2227
|
+
kind: 'registry';
|
|
2141
2228
|
id: string;
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2229
|
+
} | {
|
|
2230
|
+
kind: 'url';
|
|
2231
|
+
url: string;
|
|
2232
|
+
};
|
|
2233
|
+
type RemoteCartFetchAdapter = (url: string) => Promise<unknown>;
|
|
2234
|
+
type RemoteCartRegistry = {
|
|
2235
|
+
get(id: string): SignedRemoteCartManifest | undefined;
|
|
2236
|
+
};
|
|
2237
|
+
type HostGrantSnapshot = {
|
|
2238
|
+
schemaVersion: typeof HOST_GRANT_SNAPSHOT_SCHEMA_VERSION;
|
|
2239
|
+
grants: RemoteCartGrant[];
|
|
2240
|
+
};
|
|
2241
|
+
type HostGrantRestoreResult = {
|
|
2242
|
+
ok: true;
|
|
2243
|
+
grants: RemoteCartGrant[];
|
|
2244
|
+
} | {
|
|
2245
|
+
ok: false;
|
|
2246
|
+
errors: RemoteCartDiagnostic[];
|
|
2247
|
+
};
|
|
2248
|
+
type HostGrantSet = {
|
|
2249
|
+
grant(capability: RemoteCartGrant): HostGrantRestoreResult;
|
|
2250
|
+
revoke(capability: RemoteCartGrant): HostGrantRestoreResult;
|
|
2251
|
+
has(capability: RemoteCartGrant): boolean;
|
|
2252
|
+
list(): RemoteCartGrant[];
|
|
2253
|
+
inspect(): HostGrantSnapshot;
|
|
2254
|
+
restore(input: unknown): HostGrantRestoreResult;
|
|
2255
|
+
};
|
|
2256
|
+
declare class RemoteCartCapabilityError extends Error {
|
|
2257
|
+
readonly code: "capability-denied";
|
|
2258
|
+
readonly grant: RemoteCartGrant;
|
|
2259
|
+
constructor(grant: RemoteCartGrant, api: string);
|
|
2260
|
+
}
|
|
2261
|
+
type RemoteCartNetworkApi = {
|
|
2262
|
+
fetch(url: string): Promise<Uint8Array>;
|
|
2263
|
+
};
|
|
2264
|
+
type RemoteCartStorageApi = {
|
|
2265
|
+
getItem(key: string): string | null;
|
|
2266
|
+
setItem(key: string, value: string): void;
|
|
2267
|
+
removeItem(key: string): void;
|
|
2268
|
+
clear(): void;
|
|
2269
|
+
};
|
|
2270
|
+
type RemoteCartDeviceApi = {
|
|
2271
|
+
request(): {
|
|
2272
|
+
ok: true;
|
|
2273
|
+
};
|
|
2274
|
+
};
|
|
2275
|
+
type RemoteCartCapabilityBag = ExecutableModuleCapabilities & {
|
|
2276
|
+
grants: readonly RemoteCartGrant[];
|
|
2277
|
+
network: RemoteCartNetworkApi;
|
|
2278
|
+
storage: RemoteCartStorageApi;
|
|
2279
|
+
audio: RemoteCartDeviceApi;
|
|
2280
|
+
controller: RemoteCartDeviceApi;
|
|
2281
|
+
fullscreen: RemoteCartDeviceApi;
|
|
2282
|
+
};
|
|
2283
|
+
type RemoteCartInspect = {
|
|
2284
|
+
id: string;
|
|
2285
|
+
cartVersion: string;
|
|
2286
|
+
publisher: string;
|
|
2287
|
+
signature: {
|
|
2288
|
+
id: string;
|
|
2289
|
+
alg: string;
|
|
2290
|
+
};
|
|
2291
|
+
requestedGrants: RemoteCartGrant[];
|
|
2292
|
+
grants: RemoteCartGrant[];
|
|
2293
|
+
assets: Array<{
|
|
2294
|
+
id: string;
|
|
2295
|
+
url: string;
|
|
2296
|
+
hash: string;
|
|
2297
|
+
}>;
|
|
2298
|
+
loaded: boolean;
|
|
2299
|
+
destroyed: boolean;
|
|
2300
|
+
diagnostics: RemoteCartDiagnostic[];
|
|
2301
|
+
};
|
|
2302
|
+
type RemoteCartSandbox = {
|
|
2303
|
+
listRequestedGrants(): RemoteCartGrant[];
|
|
2304
|
+
grants: HostGrantSet;
|
|
2305
|
+
loadAssets(): Promise<{
|
|
2306
|
+
ok: true;
|
|
2307
|
+
snapshot: AssetPreloadSnapshot;
|
|
2308
|
+
} | {
|
|
2309
|
+
ok: false;
|
|
2310
|
+
errors: RemoteCartDiagnostic[];
|
|
2311
|
+
}>;
|
|
2312
|
+
capabilities(): RemoteCartCapabilityBag | {
|
|
2313
|
+
ok: false;
|
|
2314
|
+
errors: RemoteCartDiagnostic[];
|
|
2315
|
+
};
|
|
2316
|
+
inspect(): RemoteCartInspect;
|
|
2317
|
+
snapshotProvenance(): SnapshotProvenance;
|
|
2318
|
+
destroy(): void;
|
|
2319
|
+
};
|
|
2320
|
+
type CreateRemoteCartSandboxOptions = {
|
|
2321
|
+
manifest: SignedRemoteCartManifest;
|
|
2322
|
+
/** Host HMAC secrets keyed by `signature.keyId`. Sandbox re-verifies before load. */
|
|
2323
|
+
keys: Readonly<Record<string, string>>;
|
|
2324
|
+
grants?: Iterable<RemoteCartGrant>;
|
|
2325
|
+
bytesByUrl: Readonly<Record<string, Uint8Array>>;
|
|
2326
|
+
modules?: readonly ExecutableModuleRegistration[];
|
|
2327
|
+
};
|
|
2328
|
+
type LoadRemoteCartOptions = {
|
|
2329
|
+
source: RemoteCartLoadSource;
|
|
2330
|
+
keys: Readonly<Record<string, string>>;
|
|
2331
|
+
registry?: RemoteCartRegistry;
|
|
2332
|
+
fetch?: RemoteCartFetchAdapter;
|
|
2333
|
+
expectedVersion?: string;
|
|
2334
|
+
};
|
|
2335
|
+
declare function sha256Hex(data: Uint8Array | string): Promise<string>;
|
|
2336
|
+
declare function hmacSha256Hex(secret: string, message: string): Promise<string>;
|
|
2337
|
+
declare function canonicalizeRemoteCartBody(body: RemoteCartManifestBody): string;
|
|
2338
|
+
declare function defineRemoteCartManifest(input: unknown): DefineRemoteCartResult;
|
|
2339
|
+
declare function parseRemoteCartManifest(json: string | unknown): DefineRemoteCartResult;
|
|
2340
|
+
declare function signRemoteCartManifest(bodyInput: unknown, secret: string, keyId: string): Promise<DefineRemoteCartResult>;
|
|
2341
|
+
declare function verifyRemoteCartSignature(signed: unknown, keys: Readonly<Record<string, string>>, expectedVersion?: string): Promise<VerifyRemoteCartResult>;
|
|
2342
|
+
declare function createRemoteCartRegistry(entries: Readonly<Record<string, SignedRemoteCartManifest | string>>): RemoteCartRegistry;
|
|
2343
|
+
declare function loadRemoteCart(options: LoadRemoteCartOptions): Promise<VerifyRemoteCartResult>;
|
|
2344
|
+
declare function listRequestedRemoteCartGrants(manifest: SignedRemoteCartManifest): RemoteCartGrant[];
|
|
2345
|
+
declare function createHostGrantSet(initial?: Iterable<RemoteCartGrant>): HostGrantSet;
|
|
2346
|
+
declare function remoteCartProvenanceForSnapshot(manifest: SignedRemoteCartManifest, grants: readonly RemoteCartGrant[]): SnapshotProvenance;
|
|
2347
|
+
declare function createRemoteCartSandbox(options: CreateRemoteCartSandboxOptions): RemoteCartSandbox;
|
|
2348
|
+
|
|
2349
|
+
/**
|
|
2350
|
+
* Copyright (c) 2026 Aaron Boyarsky
|
|
2351
|
+
* SPDX-License-Identifier: LicenseRef-CyberArt-Engine
|
|
2352
|
+
* See packages/engine/LICENSE
|
|
2353
|
+
*
|
|
2354
|
+
* Universal portal/experience lifecycle: enter another cart exclusively,
|
|
2355
|
+
* suspend the parent, transfer host grants, return a versioned outcome.
|
|
2356
|
+
* Cabinet, painting, and other host metaphors are the same primitive.
|
|
2357
|
+
*/
|
|
2358
|
+
|
|
2359
|
+
declare const PORTAL_LIFECYCLE_SNAPSHOT_SCHEMA_VERSION: 1;
|
|
2360
|
+
declare const PORTAL_OUTCOME_SCHEMA_VERSION: 1;
|
|
2361
|
+
declare const DEFAULT_PORTAL_MAX_DEPTH = 8;
|
|
2362
|
+
declare const PORTAL_METAPHORS: readonly ["cabinet", "painting", "dream", "wormhole", "book", "nested-world"];
|
|
2363
|
+
type PortalMetaphor = (typeof PORTAL_METAPHORS)[number];
|
|
2364
|
+
declare const PORTAL_OUTCOME_KINDS: readonly ["completed", "aborted"];
|
|
2365
|
+
type PortalOutcomeKind = (typeof PORTAL_OUTCOME_KINDS)[number];
|
|
2366
|
+
/** Exclusive device grants transferred for the child's lifetime. */
|
|
2367
|
+
declare const PORTAL_EXCLUSIVE_GRANTS: readonly ["audio", "controller", "fullscreen"];
|
|
2368
|
+
type PortalExclusiveGrant = (typeof PORTAL_EXCLUSIVE_GRANTS)[number];
|
|
2369
|
+
declare const PORTAL_ENTERED_EVENT = "portal.lifecycle.entered";
|
|
2370
|
+
declare const PORTAL_EXITED_EVENT = "portal.lifecycle.exited";
|
|
2371
|
+
declare const PORTAL_ABORTED_EVENT = "portal.lifecycle.aborted";
|
|
2372
|
+
declare const PORTAL_LIFECYCLE_EVENTS: readonly ["portal.lifecycle.entered", "portal.lifecycle.exited", "portal.lifecycle.aborted"];
|
|
2373
|
+
type PortalLifecycleEventType = (typeof PORTAL_LIFECYCLE_EVENTS)[number];
|
|
2374
|
+
type PortalDiagnostic = {
|
|
2375
|
+
code: string;
|
|
2376
|
+
detail: string;
|
|
2377
|
+
path?: string;
|
|
2378
|
+
};
|
|
2379
|
+
type PortalOutcome = {
|
|
2380
|
+
schemaVersion: typeof PORTAL_OUTCOME_SCHEMA_VERSION;
|
|
2381
|
+
kind: PortalOutcomeKind;
|
|
2382
|
+
payload?: unknown;
|
|
2383
|
+
};
|
|
2384
|
+
type PortalCartDeclaration = {
|
|
2385
|
+
id: string;
|
|
2386
|
+
/** Cart ids this cart may enter. */
|
|
2387
|
+
targets: readonly string[];
|
|
2388
|
+
acceptedOutcomeSchemaVersion?: number;
|
|
2389
|
+
emittedOutcomeSchemaVersion?: number;
|
|
2390
|
+
};
|
|
2391
|
+
type PortalEnterRequest = {
|
|
2392
|
+
from: string;
|
|
2393
|
+
to: string;
|
|
2394
|
+
metaphor?: PortalMetaphor;
|
|
2395
|
+
seed?: string;
|
|
2396
|
+
clock?: number;
|
|
2397
|
+
/** Extra grants to give the child (exclusive ones are transferred from parent). */
|
|
2398
|
+
grants?: readonly CapabilityDeviceGrant[];
|
|
2399
|
+
state?: unknown;
|
|
2400
|
+
persistence?: unknown;
|
|
2401
|
+
};
|
|
2402
|
+
type PortalFrameInspect = {
|
|
2403
|
+
id: string;
|
|
2404
|
+
parentId: string;
|
|
2405
|
+
childId: string;
|
|
2406
|
+
metaphor: PortalMetaphor;
|
|
2407
|
+
seed: string | null;
|
|
2408
|
+
clock: number | null;
|
|
2409
|
+
parentState: unknown;
|
|
2410
|
+
parentGrants: CapabilityDeviceGrant[];
|
|
2411
|
+
/** Live child grants after transfer + extras. */
|
|
2412
|
+
childGrants: CapabilityDeviceGrant[];
|
|
2413
|
+
/** Child grants before enter, used to restore and revert extras. */
|
|
2414
|
+
childGrantsBefore: CapabilityDeviceGrant[];
|
|
2415
|
+
extraChildGrants: CapabilityDeviceGrant[];
|
|
2416
|
+
persistence: unknown;
|
|
2417
|
+
transferred: PortalExclusiveGrant[];
|
|
2418
|
+
enterCue: typeof PORTAL_ENTERED_EVENT;
|
|
2419
|
+
exitCue: typeof PORTAL_EXITED_EVENT | typeof PORTAL_ABORTED_EVENT | null;
|
|
2420
|
+
};
|
|
2421
|
+
type PortalLifecycleSnapshot = {
|
|
2422
|
+
schemaVersion: typeof PORTAL_LIFECYCLE_SNAPSHOT_SCHEMA_VERSION;
|
|
2423
|
+
activeId: string | null;
|
|
2424
|
+
stack: PortalFrameInspect[];
|
|
2425
|
+
lastOutcome: PortalOutcome | null;
|
|
2426
|
+
cues: PortalLifecycleEventType[];
|
|
2427
|
+
};
|
|
2428
|
+
type PortalInspect = {
|
|
2429
|
+
destroyed: boolean;
|
|
2430
|
+
activeId: string | null;
|
|
2431
|
+
stack: PortalFrameInspect[];
|
|
2432
|
+
lastOutcome: PortalOutcome | null;
|
|
2433
|
+
cues: PortalLifecycleEventType[];
|
|
2434
|
+
grants: Record<string, CapabilityDeviceGrant[]>;
|
|
2435
|
+
};
|
|
2436
|
+
type PortalMutationResult = {
|
|
2437
|
+
ok: true;
|
|
2438
|
+
inspect: PortalInspect;
|
|
2439
|
+
outcome?: PortalOutcome;
|
|
2440
|
+
} | {
|
|
2441
|
+
ok: false;
|
|
2442
|
+
errors: PortalDiagnostic[];
|
|
2443
|
+
};
|
|
2444
|
+
type RestorePortalResult = {
|
|
2445
|
+
ok: true;
|
|
2446
|
+
snapshot: PortalLifecycleSnapshot;
|
|
2447
|
+
} | {
|
|
2448
|
+
ok: false;
|
|
2449
|
+
errors: PortalDiagnostic[];
|
|
2450
|
+
};
|
|
2451
|
+
type CreatePortalLifecycleOptions = {
|
|
2452
|
+
group?: RuntimeGroup;
|
|
2453
|
+
/** Per-participant grant sets. Missing ids get an empty HostGrantSet. */
|
|
2454
|
+
grants?: Readonly<Record<string, HostGrantSet>>;
|
|
2455
|
+
audioBroker?: AudioBroker;
|
|
2456
|
+
declarations?: readonly PortalCartDeclaration[];
|
|
2457
|
+
rootId?: string;
|
|
2458
|
+
maxDepth?: number;
|
|
2459
|
+
createId?: () => string;
|
|
2460
|
+
};
|
|
2461
|
+
type PortalLifecycle = {
|
|
2462
|
+
enter(request: PortalEnterRequest): PortalMutationResult;
|
|
2463
|
+
exit(payload?: unknown): PortalMutationResult;
|
|
2464
|
+
abort(payload?: unknown): PortalMutationResult;
|
|
2465
|
+
stack(): PortalFrameInspect[];
|
|
2466
|
+
activeId(): string | null;
|
|
2467
|
+
inspect(): PortalInspect;
|
|
2468
|
+
snapshot(): PortalLifecycleSnapshot;
|
|
2469
|
+
restore(input: unknown): RestorePortalResult;
|
|
2470
|
+
grantsOf(participantId: string): HostGrantSet;
|
|
2471
|
+
destroy(): void;
|
|
2472
|
+
};
|
|
2473
|
+
/**
|
|
2474
|
+
* Same `enter` / `exit` / `abort` as the session. Metaphor is fixed so cabinet
|
|
2475
|
+
* and painting hosts share lifecycle code.
|
|
2476
|
+
*/
|
|
2477
|
+
declare function cabinetPortal(portal: PortalLifecycle): {
|
|
2478
|
+
enter: (request: Omit<PortalEnterRequest, 'metaphor'>) => PortalMutationResult;
|
|
2479
|
+
exit: (payload?: unknown) => PortalMutationResult;
|
|
2480
|
+
abort: (payload?: unknown) => PortalMutationResult;
|
|
2481
|
+
};
|
|
2482
|
+
declare function paintingPortal(portal: PortalLifecycle): {
|
|
2483
|
+
enter: (request: Omit<PortalEnterRequest, 'metaphor'>) => PortalMutationResult;
|
|
2484
|
+
exit: (payload?: unknown) => PortalMutationResult;
|
|
2485
|
+
abort: (payload?: unknown) => PortalMutationResult;
|
|
2486
|
+
};
|
|
2487
|
+
declare function createPortalLifecycle(options?: CreatePortalLifecycleOptions): PortalLifecycle;
|
|
2488
|
+
|
|
2489
|
+
/**
|
|
2490
|
+
* Copyright (c) 2026 Aaron Boyarsky
|
|
2491
|
+
* SPDX-License-Identifier: LicenseRef-CyberArt-Engine
|
|
2492
|
+
* See packages/engine/LICENSE
|
|
2493
|
+
*
|
|
2494
|
+
* Durable asynchronous job orchestration: lifecycle, persistence, worker
|
|
2495
|
+
* boundary, evaluator feedback, and host-owned apply. Wall-clock completion
|
|
2496
|
+
* never mutates authoritative host state.
|
|
2497
|
+
*/
|
|
2498
|
+
|
|
2499
|
+
declare const JOB_ORCHESTRATION_SNAPSHOT_SCHEMA_VERSION: 1;
|
|
2500
|
+
declare const JOB_RESULT_REF_SCHEMA_VERSION: 1;
|
|
2501
|
+
declare const JOB_STATES: readonly ["queued", "claimed", "awaiting-evaluation", "retry-scheduled", "ready", "applied", "failed", "canceled", "superseded"];
|
|
2502
|
+
type JobState = (typeof JOB_STATES)[number];
|
|
2503
|
+
declare const JOB_RETRYABILITY: readonly ["retryable", "permanent", "unknown"];
|
|
2504
|
+
type JobRetryability = (typeof JOB_RETRYABILITY)[number];
|
|
2505
|
+
declare const JOB_EVALUATOR_DECISIONS: readonly ["accept", "reject", "revise"];
|
|
2506
|
+
type JobEvaluatorDecision = (typeof JOB_EVALUATOR_DECISIONS)[number];
|
|
2507
|
+
declare const JOB_SUBMITTED_EVENT = "job.intent.submitted";
|
|
2508
|
+
declare const JOB_QUEUED_EVENT = "job.state.queued";
|
|
2509
|
+
declare const JOB_CLAIMED_EVENT = "job.state.claimed";
|
|
2510
|
+
declare const JOB_PROGRESS_EVENT = "job.state.progress";
|
|
2511
|
+
declare const JOB_AWAITING_EVALUATION_EVENT = "job.state.awaiting-evaluation";
|
|
2512
|
+
declare const JOB_RETRY_SCHEDULED_EVENT = "job.state.retry-scheduled";
|
|
2513
|
+
declare const JOB_READY_EVENT = "job.state.ready";
|
|
2514
|
+
declare const JOB_APPLIED_EVENT = "job.state.applied";
|
|
2515
|
+
declare const JOB_FAILED_EVENT = "job.state.failed";
|
|
2516
|
+
declare const JOB_CANCELED_EVENT = "job.state.canceled";
|
|
2517
|
+
declare const JOB_SUPERSEDED_EVENT = "job.state.superseded";
|
|
2518
|
+
declare const JOB_DIAGNOSTIC_EVENT = "job.diagnostic.lifecycle";
|
|
2519
|
+
declare const JOB_LIFECYCLE_EVENTS: readonly ["job.intent.submitted", "job.state.queued", "job.state.claimed", "job.state.progress", "job.state.awaiting-evaluation", "job.state.retry-scheduled", "job.state.ready", "job.state.applied", "job.state.failed", "job.state.canceled", "job.state.superseded", "job.diagnostic.lifecycle"];
|
|
2520
|
+
type JobLifecycleEventType = (typeof JOB_LIFECYCLE_EVENTS)[number];
|
|
2521
|
+
/** Keys replaced with REDACTED_VALUE in exported traces. */
|
|
2522
|
+
declare const JOB_REDACTED_KEYS: readonly ["prompt", "credentials", "credential", "authorization", "apiKey", "secret"];
|
|
2523
|
+
type JobDiagnostic = {
|
|
2524
|
+
code: string;
|
|
2525
|
+
detail: string;
|
|
2526
|
+
path?: string;
|
|
2527
|
+
};
|
|
2528
|
+
type JobResultRef = {
|
|
2529
|
+
schemaVersion: typeof JOB_RESULT_REF_SCHEMA_VERSION;
|
|
2530
|
+
kind: string;
|
|
2531
|
+
uri: string;
|
|
2532
|
+
contentType?: string;
|
|
2533
|
+
bytes?: number;
|
|
2534
|
+
};
|
|
2535
|
+
type JobRetryPolicy = {
|
|
2536
|
+
maxAttempts: number;
|
|
2537
|
+
backoffMs: readonly number[];
|
|
2538
|
+
retryableCodes: readonly string[];
|
|
2539
|
+
};
|
|
2540
|
+
type JobFallback = {
|
|
2541
|
+
reasonCode: string;
|
|
2542
|
+
resultRef?: JobResultRef;
|
|
2543
|
+
};
|
|
2544
|
+
type JobDefinition = {
|
|
2545
|
+
id: string;
|
|
2546
|
+
version: number;
|
|
2547
|
+
requestSchema: PayloadSchema;
|
|
2548
|
+
resultKind: string;
|
|
2549
|
+
retry: JobRetryPolicy;
|
|
2550
|
+
timeoutMs: number;
|
|
2551
|
+
leaseMs: number;
|
|
2552
|
+
fallback: JobFallback;
|
|
2553
|
+
};
|
|
2554
|
+
type JobProgress = {
|
|
2555
|
+
value: number;
|
|
2556
|
+
stage: string;
|
|
2557
|
+
message?: string;
|
|
2558
|
+
};
|
|
2559
|
+
type JobFailureRecord = {
|
|
2560
|
+
attempt: number;
|
|
2561
|
+
code: string;
|
|
2562
|
+
retryability: JobRetryability;
|
|
2563
|
+
at: number;
|
|
2564
|
+
detail?: string;
|
|
2565
|
+
};
|
|
2566
|
+
type JobEvaluatorRecord = {
|
|
2567
|
+
decision: JobEvaluatorDecision;
|
|
2568
|
+
at: number;
|
|
2569
|
+
correction?: string;
|
|
2570
|
+
};
|
|
2571
|
+
type JobRecord = {
|
|
2572
|
+
jobId: string;
|
|
2573
|
+
definitionId: string;
|
|
2574
|
+
definitionVersion: number;
|
|
2575
|
+
idempotencyKey: string;
|
|
2576
|
+
state: JobState;
|
|
2577
|
+
request: unknown;
|
|
2578
|
+
resultRef: JobResultRef | null;
|
|
2579
|
+
progress: JobProgress;
|
|
2580
|
+
attempt: number;
|
|
2581
|
+
failureHistory: JobFailureRecord[];
|
|
2582
|
+
evaluatorHistory: JobEvaluatorRecord[];
|
|
2583
|
+
correlationId: string;
|
|
2584
|
+
causationId?: string;
|
|
2585
|
+
workerId: string | null;
|
|
2586
|
+
leaseUntil: number | null;
|
|
2587
|
+
createdAt: number;
|
|
2588
|
+
updatedAt: number;
|
|
2589
|
+
timeoutAt: number;
|
|
2590
|
+
nextRetryAt: number | null;
|
|
2591
|
+
supersededBy: string | null;
|
|
2592
|
+
fallbackApplied: boolean;
|
|
2593
|
+
fallback?: JobFallback;
|
|
2594
|
+
};
|
|
2595
|
+
type JobCoordinatorSnapshot = {
|
|
2596
|
+
schemaVersion: typeof JOB_ORCHESTRATION_SNAPSHOT_SCHEMA_VERSION;
|
|
2597
|
+
jobs: JobRecord[];
|
|
2598
|
+
hostAcceptedJobIds: string[];
|
|
2599
|
+
};
|
|
2600
|
+
type JobInspect = {
|
|
2601
|
+
destroyed: boolean;
|
|
2602
|
+
jobs: JobRecord[];
|
|
2603
|
+
events: JobLifecycleEventType[];
|
|
2604
|
+
};
|
|
2605
|
+
type JobMutationResult = {
|
|
2606
|
+
ok: true;
|
|
2607
|
+
job: JobRecord;
|
|
2608
|
+
} | {
|
|
2609
|
+
ok: false;
|
|
2610
|
+
errors: JobDiagnostic[];
|
|
2611
|
+
};
|
|
2612
|
+
type RestoreJobResult = {
|
|
2613
|
+
ok: true;
|
|
2614
|
+
snapshot: JobCoordinatorSnapshot;
|
|
2615
|
+
} | {
|
|
2616
|
+
ok: false;
|
|
2617
|
+
errors: JobDiagnostic[];
|
|
2618
|
+
};
|
|
2619
|
+
type JobSubmitRequest = {
|
|
2620
|
+
definitionId: string;
|
|
2621
|
+
idempotencyKey: string;
|
|
2622
|
+
request: unknown;
|
|
2623
|
+
correlationId: string;
|
|
2624
|
+
causationId?: string;
|
|
2625
|
+
supersedeJobId?: string;
|
|
2626
|
+
};
|
|
2627
|
+
type JobPersistenceAdapter = {
|
|
2628
|
+
save(job: JobRecord): void;
|
|
2629
|
+
get(jobId: string): JobRecord | undefined;
|
|
2630
|
+
getByIdempotencyKey(key: string): JobRecord | undefined;
|
|
2631
|
+
list(): JobRecord[];
|
|
2632
|
+
replaceAll(jobs: JobRecord[]): void;
|
|
2633
|
+
};
|
|
2634
|
+
type JobWorkRequest = {
|
|
2635
|
+
jobId: string;
|
|
2636
|
+
workerId: string;
|
|
2637
|
+
definitionId: string;
|
|
2638
|
+
request: unknown;
|
|
2639
|
+
attempt: number;
|
|
2640
|
+
};
|
|
2641
|
+
type JobWorkerCallbacks = {
|
|
2642
|
+
reportProgress(jobId: string, progress: JobProgress): JobMutationResult;
|
|
2643
|
+
complete(jobId: string, resultRef: JobResultRef): JobMutationResult;
|
|
2644
|
+
fail(jobId: string, failure: {
|
|
2645
|
+
code: string;
|
|
2646
|
+
retryability: JobRetryability;
|
|
2647
|
+
detail?: string;
|
|
2648
|
+
}): JobMutationResult;
|
|
2649
|
+
heartbeat(jobId: string): JobMutationResult;
|
|
2650
|
+
};
|
|
2651
|
+
type JobWorkerAdapter = {
|
|
2652
|
+
bind(callbacks: JobWorkerCallbacks): void;
|
|
2653
|
+
start(work: JobWorkRequest): void;
|
|
2654
|
+
cancel?(jobId: string): void;
|
|
2655
|
+
};
|
|
2656
|
+
type HeadlessJobWorker = JobWorkerAdapter & {
|
|
2657
|
+
complete(jobId: string, resultRef: JobResultRef): JobMutationResult;
|
|
2658
|
+
fail(jobId: string, failure: {
|
|
2659
|
+
code: string;
|
|
2660
|
+
retryability: JobRetryability;
|
|
2661
|
+
detail?: string;
|
|
2662
|
+
}): JobMutationResult;
|
|
2663
|
+
started(): string[];
|
|
2664
|
+
};
|
|
2665
|
+
type CreateJobCoordinatorOptions = {
|
|
2666
|
+
definitions: readonly JobDefinition[];
|
|
2667
|
+
persistence?: JobPersistenceAdapter;
|
|
2668
|
+
worker?: JobWorkerAdapter;
|
|
2669
|
+
router?: Pick<EventRouter, 'publish'>;
|
|
2670
|
+
now?: () => number;
|
|
2671
|
+
createId?: () => string;
|
|
2672
|
+
maxCorrectionChars?: number;
|
|
2673
|
+
maxFailureHistory?: number;
|
|
2674
|
+
};
|
|
2675
|
+
type JobCoordinator = {
|
|
2676
|
+
submit(request: JobSubmitRequest): JobMutationResult;
|
|
2677
|
+
claim(workerId: string): JobMutationResult;
|
|
2678
|
+
reportProgress(jobId: string, progress: JobProgress): JobMutationResult;
|
|
2679
|
+
heartbeat(jobId: string): JobMutationResult;
|
|
2680
|
+
complete(jobId: string, resultRef: JobResultRef): JobMutationResult;
|
|
2681
|
+
fail(jobId: string, failure: {
|
|
2682
|
+
code: string;
|
|
2683
|
+
retryability: JobRetryability;
|
|
2684
|
+
detail?: string;
|
|
2685
|
+
}): JobMutationResult;
|
|
2686
|
+
evaluate(jobId: string, decision: JobEvaluatorDecision, correction?: string): JobMutationResult;
|
|
2687
|
+
cancel(jobId: string): JobMutationResult;
|
|
2688
|
+
recoverStale(): JobRecord[];
|
|
2689
|
+
tick(): JobRecord[];
|
|
2690
|
+
/** Host policy gate. Ready jobs become applied; never called from worker complete. */
|
|
2691
|
+
accept(jobId: string): JobMutationResult;
|
|
2692
|
+
get(jobId: string): JobRecord | undefined;
|
|
2693
|
+
getByIdempotencyKey(key: string): JobRecord | undefined;
|
|
2694
|
+
inspect(): JobInspect;
|
|
2695
|
+
snapshot(): JobCoordinatorSnapshot;
|
|
2696
|
+
restore(input: unknown): RestoreJobResult;
|
|
2697
|
+
exportTrace(): {
|
|
2698
|
+
jobs: unknown[];
|
|
2699
|
+
events: JobLifecycleEventType[];
|
|
2700
|
+
};
|
|
2701
|
+
destroy(): void;
|
|
2702
|
+
};
|
|
2703
|
+
declare function jobEventContracts(): EventContract[];
|
|
2704
|
+
declare function createMemoryJobPersistence(): JobPersistenceAdapter;
|
|
2705
|
+
declare function createHeadlessJobWorker(): HeadlessJobWorker;
|
|
2706
|
+
declare function createJobCoordinator(options: CreateJobCoordinatorOptions): JobCoordinator;
|
|
2707
|
+
|
|
2708
|
+
/**
|
|
2709
|
+
* Copyright (c) 2026 Aaron Boyarsky
|
|
2710
|
+
* SPDX-License-Identifier: LicenseRef-CyberArt-Engine
|
|
2711
|
+
* See packages/engine/LICENSE
|
|
2712
|
+
*
|
|
2713
|
+
* Optional spatial world graph: nodes, edges, discovery projections, entity
|
|
2714
|
+
* transit, and host-owned path policy. Semantic time and story rules stay
|
|
2715
|
+
* with the host. No economy, combat, quest, or narrative.
|
|
2716
|
+
*/
|
|
2717
|
+
|
|
2718
|
+
declare const WORLD_GRAPH_SNAPSHOT_SCHEMA_VERSION: 1;
|
|
2719
|
+
declare const WORLD_NODE_KINDS: readonly ["room", "region", "landmark", "frontier"];
|
|
2720
|
+
type WorldNodeKind = (typeof WORLD_NODE_KINDS)[number];
|
|
2721
|
+
declare const WORLD_MAP_LAYERS: readonly ["local", "regional"];
|
|
2722
|
+
type WorldMapLayer = (typeof WORLD_MAP_LAYERS)[number];
|
|
2723
|
+
declare const WORLD_EDGE_VISIBILITIES: readonly ["canonical", "discoverable", "hidden"];
|
|
2724
|
+
type WorldEdgeVisibility = (typeof WORLD_EDGE_VISIBILITIES)[number];
|
|
2725
|
+
declare const WORLD_EDGE_ACCESS: readonly ["open", "locked", "disabled"];
|
|
2726
|
+
type WorldEdgeAccess = (typeof WORLD_EDGE_ACCESS)[number];
|
|
2727
|
+
declare const WORLD_ENTITY_KINDS: readonly ["character", "party"];
|
|
2728
|
+
type WorldEntityKind = (typeof WORLD_ENTITY_KINDS)[number];
|
|
2729
|
+
declare const WORLD_ENTITY_STATUSES: readonly ["available", "busy", "traveling"];
|
|
2730
|
+
type WorldEntityStatus = (typeof WORLD_ENTITY_STATUSES)[number];
|
|
2731
|
+
declare const WORLD_NODE_ADDED_EVENT = "world.graph.state.node-added";
|
|
2732
|
+
declare const WORLD_EDGE_ADDED_EVENT = "world.graph.state.edge-added";
|
|
2733
|
+
declare const WORLD_DISCOVERED_EVENT = "world.graph.state.discovered";
|
|
2734
|
+
declare const WORLD_TRANSIT_EVENT = "world.graph.state.transit";
|
|
2735
|
+
declare const WORLD_GRAPH_DIAGNOSTIC_EVENT = "world.graph.diagnostic.lifecycle";
|
|
2736
|
+
declare const WORLD_GRAPH_EVENTS: readonly ["world.graph.state.node-added", "world.graph.state.edge-added", "world.graph.state.discovered", "world.graph.state.transit", "world.graph.diagnostic.lifecycle"];
|
|
2737
|
+
type WorldGraphEventType = (typeof WORLD_GRAPH_EVENTS)[number];
|
|
2738
|
+
type WorldGraphDiagnostic = {
|
|
2739
|
+
code: string;
|
|
2740
|
+
detail: string;
|
|
2741
|
+
path?: string;
|
|
2742
|
+
};
|
|
2743
|
+
type WorldNode = {
|
|
2744
|
+
id: string;
|
|
2745
|
+
version: number;
|
|
2746
|
+
kind: WorldNodeKind;
|
|
2747
|
+
mapLayer: WorldMapLayer;
|
|
2748
|
+
frontier?: boolean;
|
|
2749
|
+
metadata?: Record<string, unknown>;
|
|
2750
|
+
};
|
|
2751
|
+
type WorldEdge = {
|
|
2752
|
+
id: string;
|
|
2753
|
+
version: number;
|
|
2754
|
+
from: string;
|
|
2755
|
+
to: string;
|
|
2756
|
+
directed: boolean;
|
|
2757
|
+
kind: string;
|
|
2758
|
+
visibility: WorldEdgeVisibility;
|
|
2759
|
+
access: WorldEdgeAccess;
|
|
2760
|
+
requirements?: Record<string, unknown>;
|
|
2761
|
+
cost?: Record<string, number>;
|
|
2762
|
+
metadata?: Record<string, unknown>;
|
|
2763
|
+
};
|
|
2764
|
+
type WorldTransit = {
|
|
2765
|
+
originNodeId: string;
|
|
2766
|
+
destinationNodeId: string;
|
|
2767
|
+
routeEdgeIds: readonly string[];
|
|
2768
|
+
departedAt: number;
|
|
2769
|
+
expectedArrival: number;
|
|
2770
|
+
};
|
|
2771
|
+
type WorldEntity = {
|
|
2772
|
+
id: string;
|
|
2773
|
+
kind: WorldEntityKind;
|
|
2774
|
+
status: WorldEntityStatus;
|
|
2775
|
+
locationNodeId: string | null;
|
|
2776
|
+
transit: WorldTransit | null;
|
|
2777
|
+
metadata?: Record<string, unknown>;
|
|
2778
|
+
};
|
|
2779
|
+
type WorldObserverDiscovery = {
|
|
2780
|
+
observerId: string;
|
|
2781
|
+
nodeIds: readonly string[];
|
|
2782
|
+
edgeIds: readonly string[];
|
|
2783
|
+
};
|
|
2784
|
+
type WorldGraphSnapshot = {
|
|
2785
|
+
schemaVersion: typeof WORLD_GRAPH_SNAPSHOT_SCHEMA_VERSION;
|
|
2786
|
+
graphId: string;
|
|
2787
|
+
nodes: WorldNode[];
|
|
2788
|
+
edges: WorldEdge[];
|
|
2789
|
+
entities: WorldEntity[];
|
|
2790
|
+
discovery: WorldObserverDiscovery[];
|
|
2791
|
+
};
|
|
2792
|
+
type WorldGraphProjection = {
|
|
2793
|
+
kind: 'canonical' | 'known' | 'local' | 'regional';
|
|
2794
|
+
observerId?: string;
|
|
2795
|
+
focusNodeId?: string;
|
|
2796
|
+
nodes: WorldNode[];
|
|
2797
|
+
edges: WorldEdge[];
|
|
2798
|
+
frontiers: WorldNode[];
|
|
2799
|
+
entities: WorldEntity[];
|
|
2800
|
+
};
|
|
2801
|
+
type WorldPathStep = {
|
|
2802
|
+
edgeId: string;
|
|
2803
|
+
from: string;
|
|
2804
|
+
to: string;
|
|
2805
|
+
cost: number;
|
|
2806
|
+
};
|
|
2807
|
+
type WorldPath = {
|
|
2808
|
+
from: string;
|
|
2809
|
+
to: string;
|
|
2810
|
+
nodeIds: string[];
|
|
2811
|
+
steps: WorldPathStep[];
|
|
2812
|
+
totalCost: number;
|
|
2813
|
+
};
|
|
2814
|
+
type WorldTraversalContext = {
|
|
2815
|
+
semanticTime: number;
|
|
2816
|
+
observerId?: string;
|
|
2817
|
+
hostState?: unknown;
|
|
2818
|
+
};
|
|
2819
|
+
type WorldTraversalPolicy = {
|
|
2820
|
+
canTraverse(edge: WorldEdge, from: string, to: string, ctx: WorldTraversalContext): boolean;
|
|
2821
|
+
cost(edge: WorldEdge, from: string, to: string, ctx: WorldTraversalContext): number;
|
|
2822
|
+
};
|
|
2823
|
+
type WorldQueryBounds = {
|
|
2824
|
+
maxVisits?: number;
|
|
2825
|
+
};
|
|
2826
|
+
type WorldGraphInspect = {
|
|
2827
|
+
destroyed: boolean;
|
|
2828
|
+
graphId: string;
|
|
2829
|
+
nodeCount: number;
|
|
2830
|
+
edgeCount: number;
|
|
2831
|
+
entityCount: number;
|
|
2832
|
+
observerCount: number;
|
|
2833
|
+
events: WorldGraphEventType[];
|
|
2834
|
+
};
|
|
2835
|
+
type WorldMutationResult = {
|
|
2836
|
+
ok: true;
|
|
2837
|
+
} | {
|
|
2838
|
+
ok: false;
|
|
2839
|
+
errors: WorldGraphDiagnostic[];
|
|
2840
|
+
};
|
|
2841
|
+
type RestoreWorldGraphResult = {
|
|
2842
|
+
ok: true;
|
|
2843
|
+
snapshot: WorldGraphSnapshot;
|
|
2844
|
+
} | {
|
|
2845
|
+
ok: false;
|
|
2846
|
+
errors: WorldGraphDiagnostic[];
|
|
2847
|
+
};
|
|
2848
|
+
type WorldPathResult = {
|
|
2849
|
+
ok: true;
|
|
2850
|
+
path: WorldPath;
|
|
2851
|
+
} | {
|
|
2852
|
+
ok: false;
|
|
2853
|
+
errors: WorldGraphDiagnostic[];
|
|
2854
|
+
};
|
|
2855
|
+
type WorldReachabilityResult = {
|
|
2856
|
+
nodeIds: string[];
|
|
2857
|
+
};
|
|
2858
|
+
type WorldGraphPatch = {
|
|
2859
|
+
nodes?: readonly WorldNode[];
|
|
2860
|
+
edges?: readonly WorldEdge[];
|
|
2861
|
+
};
|
|
2862
|
+
type CreateWorldGraphOptions = {
|
|
2863
|
+
graphId?: string;
|
|
2864
|
+
migrations?: readonly SnapshotMigration[];
|
|
2865
|
+
router?: Pick<EventRouter, 'publish'>;
|
|
2866
|
+
source?: string;
|
|
2867
|
+
maxPathVisits?: number;
|
|
2868
|
+
};
|
|
2869
|
+
type WorldGraph = {
|
|
2870
|
+
addNode(node: WorldNode): WorldMutationResult;
|
|
2871
|
+
addEdge(edge: WorldEdge): WorldMutationResult;
|
|
2872
|
+
applyPatch(patch: WorldGraphPatch): WorldMutationResult;
|
|
2873
|
+
removeNode(nodeId: string): WorldMutationResult;
|
|
2874
|
+
removeEdge(edgeId: string): WorldMutationResult;
|
|
2875
|
+
setEdgeAccess(edgeId: string, access: WorldEdgeAccess): WorldMutationResult;
|
|
2876
|
+
discover(observerId: string, known: {
|
|
2877
|
+
nodeIds?: readonly string[];
|
|
2878
|
+
edgeIds?: readonly string[];
|
|
2879
|
+
}): WorldMutationResult;
|
|
2880
|
+
upsertEntity(entity: WorldEntity): WorldMutationResult;
|
|
2881
|
+
startTransit(entityId: string, transit: WorldTransit, status?: Exclude<WorldEntityStatus, 'available'>): WorldMutationResult;
|
|
2882
|
+
completeTransit(entityId: string, semanticTime: number): WorldMutationResult;
|
|
2883
|
+
setEntityStatus(entityId: string, status: WorldEntityStatus): WorldMutationResult;
|
|
2884
|
+
getNode(nodeId: string): WorldNode | undefined;
|
|
2885
|
+
getEdge(edgeId: string): WorldEdge | undefined;
|
|
2886
|
+
getEntity(entityId: string): WorldEntity | undefined;
|
|
2887
|
+
projectCanonical(): WorldGraphProjection;
|
|
2888
|
+
projectKnown(observerId: string): WorldGraphProjection;
|
|
2889
|
+
projectLocal(observerId: string, focusNodeId: string, hops?: number): WorldGraphProjection;
|
|
2890
|
+
projectRegional(observerId: string): WorldGraphProjection;
|
|
2891
|
+
findPath(from: string, to: string, policy: WorldTraversalPolicy, ctx: WorldTraversalContext, bounds?: WorldQueryBounds): WorldPathResult;
|
|
2892
|
+
reachable(from: string, policy: WorldTraversalPolicy, ctx: WorldTraversalContext, bounds?: WorldQueryBounds): WorldReachabilityResult;
|
|
2893
|
+
inspect(): WorldGraphInspect;
|
|
2894
|
+
snapshot(): WorldGraphSnapshot;
|
|
2895
|
+
restore(input: unknown): RestoreWorldGraphResult;
|
|
2896
|
+
events(): readonly EventInput[];
|
|
2897
|
+
destroy(): void;
|
|
2898
|
+
};
|
|
2899
|
+
declare function worldGraphEventContracts(): EventContract[];
|
|
2900
|
+
declare function createWorldGraph(options?: CreateWorldGraphOptions): WorldGraph;
|
|
2901
|
+
|
|
2902
|
+
/**
|
|
2903
|
+
* Copyright (c) 2026 Aaron Boyarsky
|
|
2904
|
+
* SPDX-License-Identifier: LicenseRef-CyberArt-Engine
|
|
2905
|
+
* See packages/engine/LICENSE
|
|
2906
|
+
*
|
|
2907
|
+
* Transactional world-patch validation and atomic application. A generated
|
|
2908
|
+
* result becomes one world revision or none — never a half-installed world.
|
|
2909
|
+
* Cyberart is not the host's database of record.
|
|
2910
|
+
*/
|
|
2911
|
+
|
|
2912
|
+
declare const WORLD_PATCH_SCHEMA_VERSION: 1;
|
|
2913
|
+
declare const WORLD_PATCH_SNAPSHOT_SCHEMA_VERSION: 1;
|
|
2914
|
+
declare const WORLD_PATCH_OPS: readonly ["add", "replace", "revise", "remove", "tombstone", "link", "unlink"];
|
|
2915
|
+
type WorldPatchOp = (typeof WORLD_PATCH_OPS)[number];
|
|
2916
|
+
declare const WORLD_PATCH_PRECONDITION_TYPES: readonly ["base-revision", "entity-revision", "entity-hash", "identity-required", "identity-absent", "capability", "schema"];
|
|
2917
|
+
type WorldPatchPreconditionType = (typeof WORLD_PATCH_PRECONDITION_TYPES)[number];
|
|
2918
|
+
declare const WORLD_PATCH_ACCEPTED_EVENT: "world.patch.state.accepted";
|
|
2919
|
+
declare const WORLD_PATCH_REJECTED_EVENT: "world.patch.state.rejected";
|
|
2920
|
+
declare const WORLD_PATCH_SUPERSEDED_EVENT: "world.patch.state.superseded";
|
|
2921
|
+
declare const WORLD_PATCH_DIAGNOSTIC_EVENT: "world.patch.diagnostic.lifecycle";
|
|
2922
|
+
declare const WORLD_PATCH_EVENTS: readonly ["world.patch.state.accepted", "world.patch.state.rejected", "world.patch.state.superseded", "world.patch.diagnostic.lifecycle"];
|
|
2923
|
+
type WorldPatchEventType = (typeof WORLD_PATCH_EVENTS)[number];
|
|
2924
|
+
declare const WORLD_PATCH_ERROR_CODES: readonly ["invalid-schema", "unknown-field", "unknown-op", "missing-field", "missing-ref", "referential-integrity", "stale-base", "precondition-failed", "asset-unavailable", "content-unavailable", "binding-unavailable", "cycle", "over-limit", "idempotency-conflict", "superseded", "invalid-snapshot", "invalid-version", "destroyed", "domain", "capability-denied", "schema-mismatch", "identity-required", "identity-absent", "entity-revision", "entity-hash", "duplicate-id", "graph-apply-failed", "publish-failed"];
|
|
2925
|
+
type WorldPatchErrorCode = (typeof WORLD_PATCH_ERROR_CODES)[number];
|
|
2926
|
+
/** Keys replaced with REDACTED_VALUE in audit export. */
|
|
2927
|
+
declare const WORLD_PATCH_REDACTED_KEYS: readonly ["prompt", "credentials", "credential", "authorization", "apiKey", "secret"];
|
|
2928
|
+
type WorldPatchDiagnostic = {
|
|
2929
|
+
code: WorldPatchErrorCode | string;
|
|
2930
|
+
detail: string;
|
|
2931
|
+
path?: string;
|
|
2932
|
+
expectedRevision?: number;
|
|
2933
|
+
actualRevision?: number;
|
|
2934
|
+
};
|
|
2935
|
+
type WorldPatchProvenance = {
|
|
2936
|
+
producer: string;
|
|
2937
|
+
jobId?: string;
|
|
2938
|
+
contentRevisions?: string[];
|
|
2939
|
+
};
|
|
2940
|
+
type WorldPatchRefs = {
|
|
2941
|
+
contentId?: string;
|
|
2942
|
+
contentRevision?: string;
|
|
2943
|
+
binding?: string;
|
|
2944
|
+
asset?: string;
|
|
2945
|
+
identity?: string;
|
|
2946
|
+
};
|
|
2947
|
+
type WorldPatchOperation = {
|
|
2948
|
+
op: WorldPatchOp;
|
|
2949
|
+
kind: string;
|
|
2950
|
+
id: string;
|
|
2951
|
+
order?: number;
|
|
2952
|
+
value?: unknown;
|
|
2953
|
+
from?: string;
|
|
2954
|
+
to?: string;
|
|
2955
|
+
refs?: WorldPatchRefs;
|
|
2956
|
+
};
|
|
2957
|
+
type WorldPatchPrecondition = {
|
|
2958
|
+
type: 'base-revision';
|
|
2959
|
+
revision: number;
|
|
2960
|
+
} | {
|
|
2961
|
+
type: 'entity-revision';
|
|
2962
|
+
kind: string;
|
|
2963
|
+
id: string;
|
|
2964
|
+
revision: number;
|
|
2965
|
+
} | {
|
|
2966
|
+
type: 'entity-hash';
|
|
2967
|
+
kind: string;
|
|
2968
|
+
id: string;
|
|
2969
|
+
hash: string;
|
|
2970
|
+
} | {
|
|
2971
|
+
type: 'identity-required';
|
|
2972
|
+
kind: string;
|
|
2973
|
+
id: string;
|
|
2974
|
+
} | {
|
|
2975
|
+
type: 'identity-absent';
|
|
2976
|
+
kind: string;
|
|
2977
|
+
id: string;
|
|
2978
|
+
} | {
|
|
2979
|
+
type: 'capability';
|
|
2980
|
+
name: string;
|
|
2981
|
+
} | {
|
|
2982
|
+
type: 'schema';
|
|
2983
|
+
schemaVersion: number;
|
|
2984
|
+
};
|
|
2985
|
+
type WorldPatch = {
|
|
2986
|
+
patchId: string;
|
|
2987
|
+
schemaVersion: typeof WORLD_PATCH_SCHEMA_VERSION;
|
|
2988
|
+
baseRevision: number;
|
|
2989
|
+
idempotencyKey: string;
|
|
2990
|
+
preconditions?: WorldPatchPrecondition[];
|
|
2991
|
+
operations: WorldPatchOperation[];
|
|
2992
|
+
provenance: WorldPatchProvenance;
|
|
2993
|
+
supersedes?: string;
|
|
2994
|
+
};
|
|
2995
|
+
type WorldEntityRecord = {
|
|
2996
|
+
kind: string;
|
|
2997
|
+
id: string;
|
|
2998
|
+
revision: number;
|
|
2999
|
+
hash: string;
|
|
3000
|
+
value: unknown;
|
|
3001
|
+
tombstoned: boolean;
|
|
3002
|
+
refs?: WorldPatchRefs;
|
|
3003
|
+
};
|
|
3004
|
+
type WorldLinkRecord = {
|
|
3005
|
+
id: string;
|
|
3006
|
+
kind: string;
|
|
3007
|
+
from: string;
|
|
3008
|
+
to: string;
|
|
3009
|
+
value?: unknown;
|
|
3010
|
+
};
|
|
3011
|
+
type WorldAcceptedPatch = {
|
|
3012
|
+
patchId: string;
|
|
3013
|
+
idempotencyKey: string;
|
|
3014
|
+
revision: number;
|
|
3015
|
+
provenance: WorldPatchProvenance;
|
|
3016
|
+
supersededBy?: string;
|
|
3017
|
+
};
|
|
3018
|
+
type WorldRevisionState = {
|
|
3019
|
+
revision: number;
|
|
3020
|
+
entities: WorldEntityRecord[];
|
|
3021
|
+
links: WorldLinkRecord[];
|
|
3022
|
+
accepted: WorldAcceptedPatch[];
|
|
3023
|
+
};
|
|
3024
|
+
type WorldIdentityChange = {
|
|
3025
|
+
op: WorldPatchOp;
|
|
3026
|
+
kind: string;
|
|
3027
|
+
id: string;
|
|
3028
|
+
};
|
|
3029
|
+
type WorldPatchAuditRecord = {
|
|
3030
|
+
outcome: 'accepted' | 'rejected' | 'superseded';
|
|
3031
|
+
patchId: string;
|
|
3032
|
+
idempotencyKey: string;
|
|
3033
|
+
at: number;
|
|
3034
|
+
oldRevision: number;
|
|
3035
|
+
newRevision: number;
|
|
3036
|
+
reasonCodes: string[];
|
|
3037
|
+
changedIdentities: WorldIdentityChange[];
|
|
3038
|
+
provenance: WorldPatchProvenance | Record<string, unknown>;
|
|
3039
|
+
patch: unknown;
|
|
3040
|
+
};
|
|
3041
|
+
type WorldPatchSnapshot = {
|
|
3042
|
+
schemaVersion: typeof WORLD_PATCH_SNAPSHOT_SCHEMA_VERSION;
|
|
3043
|
+
world: WorldRevisionState;
|
|
3044
|
+
audit: WorldPatchAuditRecord[];
|
|
3045
|
+
graph?: WorldGraphSnapshot;
|
|
3046
|
+
};
|
|
3047
|
+
type WorldPatchInspect = {
|
|
3048
|
+
destroyed: boolean;
|
|
3049
|
+
revision: number;
|
|
3050
|
+
entities: WorldEntityRecord[];
|
|
3051
|
+
links: WorldLinkRecord[];
|
|
3052
|
+
acceptedPatchIds: string[];
|
|
3053
|
+
events: WorldPatchEventType[];
|
|
3054
|
+
lastRejection: WorldPatchDiagnostic[] | null;
|
|
3055
|
+
};
|
|
3056
|
+
type WorldPatchDryRunResult = {
|
|
3057
|
+
ok: true;
|
|
3058
|
+
previewRevision: number;
|
|
3059
|
+
changedIdentities: WorldIdentityChange[];
|
|
3060
|
+
diagnostics: WorldPatchDiagnostic[];
|
|
3061
|
+
} | {
|
|
3062
|
+
ok: false;
|
|
3063
|
+
errors: WorldPatchDiagnostic[];
|
|
3064
|
+
};
|
|
3065
|
+
type WorldPatchCommitResult = {
|
|
3066
|
+
ok: true;
|
|
3067
|
+
patchId: string;
|
|
3068
|
+
oldRevision: number;
|
|
3069
|
+
newRevision: number;
|
|
3070
|
+
changedIdentities: WorldIdentityChange[];
|
|
3071
|
+
idempotent?: boolean;
|
|
3072
|
+
inspect: WorldPatchInspect;
|
|
3073
|
+
} | {
|
|
3074
|
+
ok: false;
|
|
3075
|
+
errors: WorldPatchDiagnostic[];
|
|
3076
|
+
inspect: WorldPatchInspect;
|
|
3077
|
+
};
|
|
3078
|
+
type RestoreWorldPatchResult = {
|
|
3079
|
+
ok: true;
|
|
3080
|
+
snapshot: WorldPatchSnapshot;
|
|
3081
|
+
} | {
|
|
3082
|
+
ok: false;
|
|
3083
|
+
errors: WorldPatchDiagnostic[];
|
|
3084
|
+
};
|
|
3085
|
+
type WorldPersistenceTransaction = {
|
|
3086
|
+
applyWorldRevision(next: WorldRevisionState): void;
|
|
3087
|
+
commit(): void;
|
|
3088
|
+
rollback(): void;
|
|
3089
|
+
};
|
|
3090
|
+
type WorldPatchAcceptedPayload = {
|
|
3091
|
+
patchId: string;
|
|
3092
|
+
oldRevision: number;
|
|
3093
|
+
newRevision: number;
|
|
3094
|
+
changedIdentities: WorldIdentityChange[];
|
|
3095
|
+
producer: string;
|
|
3096
|
+
jobId?: string;
|
|
3097
|
+
contentRevisions?: string[];
|
|
3098
|
+
};
|
|
3099
|
+
type WorldPersistenceAdapter = {
|
|
3100
|
+
begin(): WorldPersistenceTransaction;
|
|
3101
|
+
current(): WorldRevisionState;
|
|
3102
|
+
publish?(payload: WorldPatchAcceptedPayload): void;
|
|
3103
|
+
};
|
|
3104
|
+
type WorldPatchLimits = {
|
|
3105
|
+
maxOperations?: number;
|
|
3106
|
+
maxDiagnostics?: number;
|
|
3107
|
+
maxEntities?: number;
|
|
3108
|
+
maxBytes?: number;
|
|
3109
|
+
};
|
|
3110
|
+
type WorldPatchContentAvailability = {
|
|
3111
|
+
hasRevision?(contentId: string, revision: string): boolean;
|
|
3112
|
+
available?: ReadonlyArray<{
|
|
3113
|
+
contentId?: string;
|
|
3114
|
+
revision: string;
|
|
3115
|
+
}>;
|
|
3116
|
+
};
|
|
3117
|
+
type WorldPatchBindingAvailability = {
|
|
3118
|
+
listedIds?: readonly string[];
|
|
3119
|
+
};
|
|
3120
|
+
type WorldPatchAssetAvailability = {
|
|
3121
|
+
availableIds?: readonly string[];
|
|
3122
|
+
};
|
|
3123
|
+
type WorldPatchGraphPolicy = {
|
|
3124
|
+
allowCycles?: boolean;
|
|
3125
|
+
detectCycle?(preview: WorldRevisionState): boolean;
|
|
3126
|
+
};
|
|
3127
|
+
type WorldPatchDomainValidator = (ctx: {
|
|
3128
|
+
patch: WorldPatch;
|
|
3129
|
+
current: WorldRevisionState;
|
|
3130
|
+
preview: WorldRevisionState;
|
|
3131
|
+
}) => WorldPatchDiagnostic[];
|
|
3132
|
+
type CreateWorldPatchApplierOptions = {
|
|
3133
|
+
persistence?: WorldPersistenceAdapter;
|
|
3134
|
+
graph?: WorldGraph;
|
|
3135
|
+
content?: WorldPatchContentAvailability;
|
|
3136
|
+
bindings?: WorldPatchBindingAvailability;
|
|
3137
|
+
assets?: WorldPatchAssetAvailability;
|
|
3138
|
+
now?: () => number;
|
|
3139
|
+
limits?: WorldPatchLimits;
|
|
3140
|
+
redact?: readonly string[];
|
|
3141
|
+
router?: Pick<EventRouter, 'publish'>;
|
|
3142
|
+
onEvent?: (event: EventInput) => void;
|
|
3143
|
+
domainValidators?: readonly WorldPatchDomainValidator[];
|
|
3144
|
+
capabilities?: readonly string[];
|
|
3145
|
+
graphPolicy?: WorldPatchGraphPolicy;
|
|
3146
|
+
source?: string;
|
|
3147
|
+
};
|
|
3148
|
+
type WorldPatchApplier = {
|
|
3149
|
+
dryRun(patch: unknown): WorldPatchDryRunResult;
|
|
3150
|
+
commit(patch: unknown): WorldPatchCommitResult;
|
|
3151
|
+
inspect(): WorldPatchInspect;
|
|
3152
|
+
snapshot(): WorldPatchSnapshot;
|
|
3153
|
+
restore(input: unknown): RestoreWorldPatchResult;
|
|
3154
|
+
audit(options?: {
|
|
3155
|
+
redact?: boolean;
|
|
3156
|
+
}): WorldPatchAuditRecord[];
|
|
3157
|
+
events(): readonly EventInput[];
|
|
3158
|
+
destroy(): void;
|
|
3159
|
+
};
|
|
3160
|
+
declare function worldPatchEventContracts(): EventContract[];
|
|
3161
|
+
declare function isWorldPatchErrorCode(value: unknown): value is WorldPatchErrorCode;
|
|
3162
|
+
declare function createMemoryWorldPersistence(): WorldPersistenceAdapter;
|
|
3163
|
+
declare function createWorldPatchApplier(options?: CreateWorldPatchApplierOptions): WorldPatchApplier;
|
|
3164
|
+
|
|
3165
|
+
declare const REPLAY_INSPECTOR_SCHEMA_VERSION: 1;
|
|
3166
|
+
declare const DEFAULT_MAX_INSPECTOR_RECORDS = 512;
|
|
3167
|
+
declare const REDACTED_VALUE = "[REDACTED]";
|
|
3168
|
+
/** Always redacted in traces (CYB-80 prompts/credentials plus user keys). */
|
|
3169
|
+
declare const DEFAULT_SENSITIVE_KEYS: readonly ["prompt", "credentials", "credential", "authorization", "apiKey", "secret"];
|
|
3170
|
+
type ReplayTraceFilter = {
|
|
3171
|
+
types?: string[];
|
|
3172
|
+
sources?: string[];
|
|
3173
|
+
outcomes?: RouterDecisionOutcome[];
|
|
3174
|
+
correlationId?: string;
|
|
3175
|
+
};
|
|
3176
|
+
type CreateReplayInspectorOptions = {
|
|
3177
|
+
redactedKeys?: string[];
|
|
3178
|
+
maxRecords?: number;
|
|
3179
|
+
/** Optional contracts so records can include payload schema version. */
|
|
3180
|
+
registry?: Pick<ContractRegistry, 'get'>;
|
|
3181
|
+
};
|
|
3182
|
+
type InspectorRecord = {
|
|
3183
|
+
index: number;
|
|
3184
|
+
turn: number;
|
|
3185
|
+
time: number;
|
|
3186
|
+
outcome: RouterDecisionOutcome;
|
|
3187
|
+
reason?: RouterDecisionReason;
|
|
3188
|
+
detail?: string;
|
|
3189
|
+
source: string;
|
|
3190
|
+
target?: string;
|
|
3191
|
+
type: string;
|
|
3192
|
+
kind?: EventKind;
|
|
3193
|
+
envelopeId?: string;
|
|
3194
|
+
priorEnvelopeId?: string;
|
|
3195
|
+
correlationId?: string;
|
|
3196
|
+
causationId?: string;
|
|
3197
|
+
hops?: number;
|
|
3198
|
+
seq?: number;
|
|
3199
|
+
idempotencyKey?: string;
|
|
3200
|
+
schemaVersion?: number;
|
|
3201
|
+
payloadSchemaVersion?: number;
|
|
3202
|
+
deliveredTo: string[];
|
|
3203
|
+
payload?: unknown;
|
|
3204
|
+
};
|
|
3205
|
+
type CausationTreeNode = {
|
|
3206
|
+
envelopeId?: string;
|
|
3207
|
+
type: string;
|
|
3208
|
+
source: string;
|
|
3209
|
+
outcome: RouterDecisionOutcome;
|
|
3210
|
+
reason?: RouterDecisionReason;
|
|
3211
|
+
children: CausationTreeNode[];
|
|
3212
|
+
};
|
|
3213
|
+
type ReplayParticipantSummary = {
|
|
3214
|
+
id: string;
|
|
3215
|
+
kind?: RuntimeGroupKind;
|
|
3216
|
+
emit: string[];
|
|
3217
|
+
subscribe: string[];
|
|
3218
|
+
authoritative: boolean;
|
|
3219
|
+
seed?: string;
|
|
3220
|
+
clock?: ClockSnapshot;
|
|
3221
|
+
state?: unknown;
|
|
3222
|
+
errorCount: number;
|
|
3223
|
+
lastError?: string;
|
|
3224
|
+
};
|
|
3225
|
+
type ReplayInspectorReport = {
|
|
3226
|
+
schemaVersion: typeof REPLAY_INSPECTOR_SCHEMA_VERSION;
|
|
3227
|
+
participants: ReplayParticipantSummary[];
|
|
3228
|
+
records: InspectorRecord[];
|
|
3229
|
+
trees: CausationTreeNode[];
|
|
3230
|
+
dropped: number;
|
|
3231
|
+
};
|
|
3232
|
+
type ReplayTapeAction = {
|
|
3233
|
+
kind: 'publish';
|
|
3234
|
+
event: EventInput;
|
|
3235
|
+
extras?: PublishExtras;
|
|
3236
|
+
} | {
|
|
3237
|
+
kind: 'dispatch';
|
|
3238
|
+
participantId: string;
|
|
3239
|
+
event: HostEvent;
|
|
3240
|
+
} | {
|
|
3241
|
+
kind: 'step';
|
|
3242
|
+
frames: number;
|
|
3243
|
+
} | {
|
|
3244
|
+
kind: 'asset';
|
|
3245
|
+
participantId: string;
|
|
3246
|
+
event: HostEvent;
|
|
3247
|
+
};
|
|
3248
|
+
type ReplayInspectorExport = {
|
|
3249
|
+
schemaVersion: typeof REPLAY_INSPECTOR_SCHEMA_VERSION;
|
|
3250
|
+
origin: number;
|
|
3251
|
+
redactedKeys: string[];
|
|
3252
|
+
participants: ReplayParticipantSummary[];
|
|
3253
|
+
tape: ReplayTapeAction[];
|
|
3254
|
+
records: InspectorRecord[];
|
|
3255
|
+
snapshots: Record<string, unknown>;
|
|
3256
|
+
};
|
|
3257
|
+
type ReplayCompareResult = {
|
|
3258
|
+
ok: true;
|
|
3259
|
+
} | {
|
|
3260
|
+
ok: false;
|
|
3261
|
+
detail: string;
|
|
3262
|
+
};
|
|
3263
|
+
type BoundReplaySession = {
|
|
3264
|
+
publish(event: EventInput, extras?: PublishExtras): EventEnvelope | undefined;
|
|
3265
|
+
dispatch(participantId: string, event: HostEvent): void;
|
|
3266
|
+
step(frames?: number): Promise<void>;
|
|
3267
|
+
report(): Promise<ReplayInspectorReport>;
|
|
3268
|
+
exportTrace(filter?: ReplayTraceFilter): Promise<ReplayInspectorExport>;
|
|
3269
|
+
unbind(): void;
|
|
3270
|
+
};
|
|
3271
|
+
type ReplayInspector = {
|
|
3272
|
+
watchRouter(router: EventRouter): () => void;
|
|
3273
|
+
bind(group: RuntimeGroup): BoundReplaySession;
|
|
3274
|
+
importTrace(exported: ReplayInspectorExport | string): void;
|
|
3275
|
+
exportTrace(filter?: ReplayTraceFilter): ReplayInspectorExport;
|
|
3276
|
+
report(filter?: ReplayTraceFilter): ReplayInspectorReport;
|
|
3277
|
+
causationTree(correlationId?: string): CausationTreeNode[];
|
|
3278
|
+
records(): InspectorRecord[];
|
|
3279
|
+
reset(): void;
|
|
3280
|
+
destroy(): void;
|
|
3281
|
+
};
|
|
3282
|
+
declare function compareReplayTraces(expected: InspectorRecord[], actual: InspectorRecord[]): ReplayCompareResult;
|
|
3283
|
+
declare function createReplayInspector(options?: CreateReplayInspectorOptions): ReplayInspector;
|
|
3284
|
+
declare function replayExportedTrace(exported: ReplayInspectorExport, group: RuntimeGroup, options?: CreateReplayInspectorOptions): Promise<{
|
|
3285
|
+
inspector: ReplayInspector;
|
|
3286
|
+
report: ReplayInspectorReport;
|
|
3287
|
+
}>;
|
|
3288
|
+
|
|
3289
|
+
/**
|
|
3290
|
+
* Copyright (c) 2026 Aaron Boyarsky
|
|
3291
|
+
* SPDX-License-Identifier: LicenseRef-CyberArt-Engine
|
|
3292
|
+
* See packages/engine/LICENSE
|
|
3293
|
+
*
|
|
3294
|
+
* Content-selection and presentation-decision traces. Hosts record why a
|
|
3295
|
+
* binding, revision, asset, sequence, or fallback won. Reuses CYB-65
|
|
3296
|
+
* redaction, bounded retention, and correlation ids. There is no Player UI.
|
|
3297
|
+
*/
|
|
3298
|
+
|
|
3299
|
+
declare const SELECTION_TRACE_SCHEMA_VERSION: 1;
|
|
3300
|
+
declare const DEFAULT_MAX_SELECTION_RECORDS = 512;
|
|
3301
|
+
declare const SELECTION_REASON_CODES: readonly ["binding-conflict", "asset-failure", "revision-rollback", "sequence-interruption", "text-only-fallback"];
|
|
3302
|
+
type SelectionReasonCode = (typeof SELECTION_REASON_CODES)[number];
|
|
3303
|
+
declare const SELECTION_DECISION_KINDS: readonly ["state-projection", "binding", "content-revision", "staging", "asset", "sequence", "presentation", "snapshot"];
|
|
3304
|
+
type SelectionDecisionKind = (typeof SELECTION_DECISION_KINDS)[number];
|
|
3305
|
+
declare const SELECTION_TRACE_SENSITIVE_KEYS: readonly ["prompt", "credentials", "credential", "authorization", "apiKey", "secret", "privatePrompt", "signedUrl", "signedURL", "signed_url", "presignedUrl", "password"];
|
|
3306
|
+
declare function isSelectionReasonCode(value: unknown): value is SelectionReasonCode;
|
|
3307
|
+
declare function isSelectionDecisionKind(value: unknown): value is SelectionDecisionKind;
|
|
3308
|
+
type SelectionBindingEvaluation = {
|
|
3309
|
+
bindingId: string;
|
|
3310
|
+
priority: number;
|
|
3311
|
+
predicateResult: boolean;
|
|
3312
|
+
winner?: boolean;
|
|
3313
|
+
rejectedReason?: string;
|
|
3314
|
+
};
|
|
3315
|
+
type SelectionContentIdentity = {
|
|
3316
|
+
contentId: string;
|
|
3317
|
+
revision: string;
|
|
3318
|
+
manifestVersion?: number;
|
|
3319
|
+
source?: string;
|
|
3320
|
+
publisher?: string;
|
|
3321
|
+
hashes?: Record<string, string>;
|
|
3322
|
+
};
|
|
3323
|
+
type SelectionStagingOutcome = 'validated' | 'rejected' | 'cache-hit' | 'cache-miss' | 'superseded' | 'rollback' | 'retained';
|
|
3324
|
+
type SelectionStagingResult = {
|
|
3325
|
+
outcome: SelectionStagingOutcome;
|
|
3326
|
+
cache?: 'hit' | 'miss';
|
|
3327
|
+
detail?: string;
|
|
3328
|
+
};
|
|
3329
|
+
type SelectionAssetResolution = {
|
|
3330
|
+
logicalRef: string;
|
|
3331
|
+
resolver?: string;
|
|
3332
|
+
adapter?: string;
|
|
3333
|
+
mediaHash?: string;
|
|
3334
|
+
ready: boolean;
|
|
3335
|
+
failure?: string;
|
|
3336
|
+
fallback?: string | null;
|
|
3337
|
+
};
|
|
3338
|
+
type SelectionSequenceDecision = {
|
|
3339
|
+
sequenceId: string;
|
|
3340
|
+
invocationId: string;
|
|
3341
|
+
stepId?: string | null;
|
|
3342
|
+
track?: string | null;
|
|
3343
|
+
decision: 'play' | 'skip' | 'interrupt' | 'replay' | 'complete';
|
|
3344
|
+
capabilityFallback?: string | null;
|
|
3345
|
+
};
|
|
3346
|
+
type SelectionPresentationDecision = {
|
|
3347
|
+
layerId?: string;
|
|
3348
|
+
variant?: string;
|
|
3349
|
+
regionId?: string;
|
|
3350
|
+
maskRevision?: string | number;
|
|
3351
|
+
blend?: string;
|
|
3352
|
+
hitTest?: boolean;
|
|
3353
|
+
caption?: string | null;
|
|
3354
|
+
audioIntent?: string | null;
|
|
3355
|
+
};
|
|
3356
|
+
type SelectionSnapshotProvenance = {
|
|
3357
|
+
revision?: string | number | null;
|
|
3358
|
+
schemaVersion?: number;
|
|
3359
|
+
seed?: string;
|
|
3360
|
+
};
|
|
3361
|
+
type SelectionDecisionInput = {
|
|
3362
|
+
kind: SelectionDecisionKind;
|
|
3363
|
+
reason: SelectionReasonCode | string;
|
|
3364
|
+
summary: string;
|
|
3365
|
+
turn?: number;
|
|
3366
|
+
time?: number;
|
|
3367
|
+
correlationId?: string;
|
|
3368
|
+
causationId?: string;
|
|
3369
|
+
envelopeId?: string;
|
|
3370
|
+
initiatingEventType?: string;
|
|
3371
|
+
projectionRevision?: string | number;
|
|
3372
|
+
projection?: unknown;
|
|
3373
|
+
hostState?: unknown;
|
|
3374
|
+
bindings?: readonly SelectionBindingEvaluation[];
|
|
3375
|
+
winningBindingId?: string | null;
|
|
3376
|
+
rejectedBindingIds?: readonly string[];
|
|
3377
|
+
defaultFallback?: boolean;
|
|
3378
|
+
requestedContent?: SelectionContentIdentity;
|
|
3379
|
+
activatedContent?: SelectionContentIdentity | null;
|
|
3380
|
+
staging?: SelectionStagingResult;
|
|
3381
|
+
lastKnownGood?: SelectionContentIdentity | null;
|
|
3382
|
+
asset?: SelectionAssetResolution;
|
|
3383
|
+
sequence?: SelectionSequenceDecision;
|
|
3384
|
+
presentation?: SelectionPresentationDecision;
|
|
3385
|
+
snapshot?: SelectionSnapshotProvenance;
|
|
3386
|
+
};
|
|
3387
|
+
type SelectionDecisionRecord = {
|
|
3388
|
+
index: number;
|
|
3389
|
+
kind: SelectionDecisionKind;
|
|
3390
|
+
reason: string;
|
|
3391
|
+
summary: string;
|
|
3392
|
+
turn?: number;
|
|
3393
|
+
time?: number;
|
|
3394
|
+
correlationId?: string;
|
|
3395
|
+
causationId?: string;
|
|
3396
|
+
envelopeId?: string;
|
|
3397
|
+
initiatingEventType?: string;
|
|
3398
|
+
projectionRevision?: string | number;
|
|
3399
|
+
projection?: unknown;
|
|
3400
|
+
bindings?: SelectionBindingEvaluation[];
|
|
3401
|
+
winningBindingId?: string | null;
|
|
3402
|
+
rejectedBindingIds?: string[];
|
|
3403
|
+
defaultFallback?: boolean;
|
|
3404
|
+
requestedContent?: SelectionContentIdentity;
|
|
3405
|
+
activatedContent?: SelectionContentIdentity | null;
|
|
3406
|
+
staging?: SelectionStagingResult;
|
|
3407
|
+
lastKnownGood?: SelectionContentIdentity | null;
|
|
3408
|
+
asset?: SelectionAssetResolution;
|
|
3409
|
+
sequence?: SelectionSequenceDecision;
|
|
3410
|
+
presentation?: SelectionPresentationDecision;
|
|
3411
|
+
snapshot?: SelectionSnapshotProvenance;
|
|
3412
|
+
};
|
|
3413
|
+
type SelectionTraceFilter = {
|
|
3414
|
+
kinds?: readonly SelectionDecisionKind[];
|
|
3415
|
+
reasons?: readonly string[];
|
|
3416
|
+
correlationId?: string;
|
|
3417
|
+
causationId?: string;
|
|
3418
|
+
envelopeId?: string;
|
|
3419
|
+
contentId?: string;
|
|
3420
|
+
sequenceId?: string;
|
|
3421
|
+
};
|
|
3422
|
+
type CreateSelectionTraceOptions = {
|
|
3423
|
+
redactedKeys?: readonly string[];
|
|
3424
|
+
maxRecords?: number;
|
|
3425
|
+
sampleRate?: number;
|
|
3426
|
+
/** Safe host-projection field names. All other projection/hostState keys redact. */
|
|
3427
|
+
projectionWhitelist?: readonly string[];
|
|
3428
|
+
inspector?: Pick<ReplayInspector, 'records'>;
|
|
3429
|
+
};
|
|
3430
|
+
type SelectionTraceExport = {
|
|
3431
|
+
schemaVersion: typeof SELECTION_TRACE_SCHEMA_VERSION;
|
|
3432
|
+
redactedKeys: string[];
|
|
3433
|
+
projectionWhitelist: string[];
|
|
3434
|
+
dropped: number;
|
|
3435
|
+
sampledOut: number;
|
|
3436
|
+
records: SelectionDecisionRecord[];
|
|
3437
|
+
inspectorRecords: InspectorRecord[];
|
|
3438
|
+
snapshotRevision?: string | number | null;
|
|
3439
|
+
snapshotSchemaVersion?: number;
|
|
3440
|
+
snapshotSeed?: string;
|
|
3441
|
+
};
|
|
3442
|
+
type SelectionTraceReport = {
|
|
3443
|
+
schemaVersion: typeof SELECTION_TRACE_SCHEMA_VERSION;
|
|
3444
|
+
records: SelectionDecisionRecord[];
|
|
3445
|
+
dropped: number;
|
|
3446
|
+
sampledOut: number;
|
|
3447
|
+
};
|
|
3448
|
+
type SelectionTrace = {
|
|
3449
|
+
recordSelectionDecision(input: SelectionDecisionInput): SelectionDecisionRecord | null;
|
|
3450
|
+
records(filter?: SelectionTraceFilter): SelectionDecisionRecord[];
|
|
3451
|
+
query(filter?: SelectionTraceFilter): SelectionDecisionRecord[];
|
|
3452
|
+
chain(correlationId: string): SelectionDecisionRecord[];
|
|
3453
|
+
exportTrace(filter?: SelectionTraceFilter): SelectionTraceExport;
|
|
3454
|
+
importTrace(exported: SelectionTraceExport | string): void;
|
|
3455
|
+
report(filter?: SelectionTraceFilter): SelectionTraceReport;
|
|
3456
|
+
setSnapshotProvenance(meta: SelectionSnapshotProvenance): void;
|
|
3457
|
+
reset(): void;
|
|
3458
|
+
destroy(): void;
|
|
3459
|
+
};
|
|
3460
|
+
declare function recordSelectionDecision(trace: SelectionTrace, input: SelectionDecisionInput): SelectionDecisionRecord | null;
|
|
3461
|
+
declare function attachSelectionTrace<T extends object>(bundle: T, trace: SelectionTraceExport | null): T & {
|
|
3462
|
+
selectionTrace: SelectionTraceExport | null;
|
|
3463
|
+
};
|
|
3464
|
+
declare function createSelectionTrace(options?: CreateSelectionTraceOptions): SelectionTrace;
|
|
3465
|
+
|
|
3466
|
+
declare const COMPOSITOR_BLEND_MODES: readonly ["source-over", "screen"];
|
|
3467
|
+
type CompositorBlendMode = (typeof COMPOSITOR_BLEND_MODES)[number];
|
|
3468
|
+
declare const COMPOSITOR_CLEAR_POLICIES: readonly ["transparent", "opaque"];
|
|
3469
|
+
type CompositorClearPolicy = (typeof COMPOSITOR_CLEAR_POLICIES)[number];
|
|
3470
|
+
type CompositorPointerEvents = 'auto' | 'none';
|
|
3471
|
+
declare const COMPOSITOR_SOURCE_KINDS: readonly ["participant", "image", "canvas"];
|
|
3472
|
+
type CompositorSourceKind = (typeof COMPOSITOR_SOURCE_KINDS)[number];
|
|
3473
|
+
type CompositorParticipantSource = {
|
|
3474
|
+
kind: 'participant';
|
|
3475
|
+
};
|
|
3476
|
+
type CompositorImageSource = {
|
|
3477
|
+
kind: 'image';
|
|
3478
|
+
image: ImageData;
|
|
3479
|
+
};
|
|
3480
|
+
type CompositorCanvasSource = {
|
|
3481
|
+
kind: 'canvas';
|
|
3482
|
+
canvas: HTMLCanvasElement;
|
|
3483
|
+
};
|
|
3484
|
+
type CompositorLayerSource = CompositorParticipantSource | CompositorImageSource | CompositorCanvasSource;
|
|
3485
|
+
type CompositorClip = {
|
|
3486
|
+
x: number;
|
|
3487
|
+
y: number;
|
|
3488
|
+
width: number;
|
|
3489
|
+
height: number;
|
|
3490
|
+
};
|
|
3491
|
+
type CompositorLayerConfig = {
|
|
3492
|
+
id: string;
|
|
3493
|
+
order: number;
|
|
3494
|
+
visible?: boolean;
|
|
3495
|
+
opacity?: number;
|
|
3496
|
+
blend?: CompositorBlendMode;
|
|
3497
|
+
clip?: CompositorClip;
|
|
3498
|
+
pointerEvents?: CompositorPointerEvents;
|
|
3499
|
+
clearPolicy?: CompositorClearPolicy;
|
|
3500
|
+
/**
|
|
3501
|
+
* Pixel source. Default `participant` reads the runtime-group canvas.
|
|
3502
|
+
* `image` / `canvas` swap atomically via `setLayer` / `addLayer`.
|
|
3503
|
+
*/
|
|
2153
3504
|
source?: CompositorLayerSource;
|
|
2154
3505
|
};
|
|
2155
3506
|
type CompositorLayerInspect = {
|
|
@@ -2350,132 +3701,877 @@ type VisualLayerControllerSnapshot = {
|
|
|
2350
3701
|
events: VisualLayerEvent[];
|
|
2351
3702
|
diagnostics: VisualLayerDiagnostic[];
|
|
2352
3703
|
};
|
|
2353
|
-
type PlayVisualLayerResult = PlayCueResult;
|
|
2354
|
-
type RestoreVisualLayerResult = {
|
|
3704
|
+
type PlayVisualLayerResult = PlayCueResult;
|
|
3705
|
+
type RestoreVisualLayerResult = {
|
|
3706
|
+
ok: true;
|
|
3707
|
+
snapshot: VisualLayerControllerSnapshot;
|
|
3708
|
+
} | {
|
|
3709
|
+
ok: false;
|
|
3710
|
+
errors: VisualLayerDiagnostic[];
|
|
3711
|
+
};
|
|
3712
|
+
type CreateVisualLayerControllerOptions = {
|
|
3713
|
+
compositor: Compositor;
|
|
3714
|
+
layers: readonly VisualLayerDeclaration[];
|
|
3715
|
+
preloader?: AssetPreloader;
|
|
3716
|
+
originFrame?: number;
|
|
3717
|
+
reducedMotion?: boolean;
|
|
3718
|
+
sceneId?: string;
|
|
3719
|
+
fallback?: VisualLayerFallbackPolicy;
|
|
3720
|
+
onAccepted?: readonly VisualLayerAcceptedBinding[];
|
|
3721
|
+
dispatch?: (event: HostEvent) => void;
|
|
3722
|
+
};
|
|
3723
|
+
type VisualLayerController = {
|
|
3724
|
+
registerSource(assetId: string, source: ImageData | HTMLCanvasElement): void;
|
|
3725
|
+
handleHostEvent(event: HostEvent): void;
|
|
3726
|
+
override(layerId: string, version: string | null): void;
|
|
3727
|
+
play(spec: VisualLayerCueSpec): PlayVisualLayerResult;
|
|
3728
|
+
step(frames?: number): VisualLayerEvent[];
|
|
3729
|
+
snapshot(): VisualLayerControllerSnapshot;
|
|
3730
|
+
restore(input: unknown): RestoreVisualLayerResult;
|
|
3731
|
+
inspect(): VisualLayerInspect[];
|
|
3732
|
+
captureComposedFrame(): ComposedFrame;
|
|
3733
|
+
destroy(): void;
|
|
3734
|
+
/**
|
|
3735
|
+
* Updates the host flag used by future `play()` calls. In-flight
|
|
3736
|
+
* transitions keep the durations they were compiled with.
|
|
3737
|
+
*/
|
|
3738
|
+
setReducedMotion(value: boolean): void;
|
|
3739
|
+
readonly frame: number;
|
|
3740
|
+
readonly sceneId: string | null;
|
|
3741
|
+
readonly compositor: Compositor;
|
|
3742
|
+
readonly reducedMotion: boolean;
|
|
3743
|
+
};
|
|
3744
|
+
type VisualLayerCapture = {
|
|
3745
|
+
frame: ComposedFrame;
|
|
3746
|
+
layers: VisualLayerInspect[];
|
|
3747
|
+
};
|
|
3748
|
+
declare function isVisualLayerKind(value: unknown): value is VisualLayerKind;
|
|
3749
|
+
declare function isVisualLayerTransitionKind(value: unknown): value is VisualLayerTransitionKind;
|
|
3750
|
+
declare function isVisualLayerEventType(value: unknown): value is VisualLayerEventType;
|
|
3751
|
+
declare function visualIncomingLayerId(layerId: string): string;
|
|
3752
|
+
declare function captureVisualLayers(controller: VisualLayerController): VisualLayerCapture;
|
|
3753
|
+
declare function createVisualLayerController(options: CreateVisualLayerControllerOptions): VisualLayerController;
|
|
3754
|
+
|
|
3755
|
+
/**
|
|
3756
|
+
* Copyright (c) 2026 Aaron Boyarsky
|
|
3757
|
+
* SPDX-License-Identifier: LicenseRef-CyberArt-Engine
|
|
3758
|
+
* See packages/engine/LICENSE
|
|
3759
|
+
*
|
|
3760
|
+
* Cart-published named semantic regions (mask / polygon / depth) in normalized
|
|
3761
|
+
* space. The host drives hover/focus/selected and supplies a11y names/roles.
|
|
3762
|
+
* Geometry, blend, and hit-test policy stay with the cart. Snapshot JSON is
|
|
3763
|
+
* hostState-safe. Headless inspect does not require a DOM overlay.
|
|
3764
|
+
*/
|
|
3765
|
+
|
|
3766
|
+
declare const SEMANTIC_LAYER_SNAPSHOT_SCHEMA_VERSION: 1;
|
|
3767
|
+
declare const SEMANTIC_GEOMETRY_KINDS: readonly ["mask", "polygon", "rect", "depth"];
|
|
3768
|
+
type SemanticGeometryKind = (typeof SEMANTIC_GEOMETRY_KINDS)[number];
|
|
3769
|
+
declare const SEMANTIC_HIT_TEST_POLICIES: readonly ["pass-through", "absorb", "exclusive", "depth-ordered"];
|
|
3770
|
+
type SemanticHitTestPolicy = (typeof SEMANTIC_HIT_TEST_POLICIES)[number];
|
|
3771
|
+
declare const SEMANTIC_INTERACTION_KEYS: readonly ["hover", "focus", "selected"];
|
|
3772
|
+
type SemanticInteractionKey = (typeof SEMANTIC_INTERACTION_KEYS)[number];
|
|
3773
|
+
declare const SEMANTIC_APPEARANCE_KEYS: readonly ["idle", "hover", "focus", "selected"];
|
|
3774
|
+
type SemanticAppearanceKey = (typeof SEMANTIC_APPEARANCE_KEYS)[number];
|
|
3775
|
+
type SemanticRegionState = {
|
|
3776
|
+
hover: boolean;
|
|
3777
|
+
focus: boolean;
|
|
3778
|
+
selected: boolean;
|
|
3779
|
+
};
|
|
3780
|
+
type SemanticRegionA11y = {
|
|
3781
|
+
name: string;
|
|
3782
|
+
role: string;
|
|
3783
|
+
};
|
|
3784
|
+
type SemanticMaskGrid = {
|
|
3785
|
+
width: number;
|
|
3786
|
+
height: number;
|
|
3787
|
+
/** Row-major coverage in [0, 1]. Length must be width * height. */
|
|
3788
|
+
alpha: readonly number[];
|
|
3789
|
+
/** Where the grid maps in normalized space. Default full content box. */
|
|
3790
|
+
bounds?: NormalizedRect;
|
|
3791
|
+
};
|
|
3792
|
+
type SemanticRegionGeometry = {
|
|
3793
|
+
mask?: SemanticMaskGrid;
|
|
3794
|
+
polygon?: NormalizedPolygon;
|
|
3795
|
+
rect?: NormalizedRect;
|
|
3796
|
+
/** Higher values are closer to the viewer. Default 0. */
|
|
3797
|
+
depth?: number;
|
|
3798
|
+
};
|
|
3799
|
+
type SemanticRegionVisual = {
|
|
3800
|
+
opacity?: number;
|
|
3801
|
+
blend?: CompositorBlendMode;
|
|
3802
|
+
/** Visual-layer version applied when `visualLayerId` is set. */
|
|
3803
|
+
version?: string;
|
|
3804
|
+
};
|
|
3805
|
+
type SemanticRegionVisuals = Partial<Record<SemanticAppearanceKey, SemanticRegionVisual>>;
|
|
3806
|
+
type SemanticRegionDeclaration = {
|
|
3807
|
+
id: string;
|
|
3808
|
+
geometry: SemanticRegionGeometry;
|
|
3809
|
+
hitTest?: SemanticHitTestPolicy;
|
|
3810
|
+
blend?: CompositorBlendMode;
|
|
3811
|
+
order?: number;
|
|
3812
|
+
compositorLayerId?: string;
|
|
3813
|
+
visualLayerId?: string;
|
|
3814
|
+
visuals?: SemanticRegionVisuals;
|
|
3815
|
+
initialState?: Partial<SemanticRegionState>;
|
|
3816
|
+
};
|
|
3817
|
+
type SemanticRegionInspect = {
|
|
3818
|
+
id: string;
|
|
3819
|
+
geometryKinds: SemanticGeometryKind[];
|
|
3820
|
+
hitTest: SemanticHitTestPolicy;
|
|
3821
|
+
blend: CompositorBlendMode;
|
|
3822
|
+
order: number;
|
|
3823
|
+
depth: number;
|
|
3824
|
+
state: SemanticRegionState;
|
|
3825
|
+
appearance: SemanticAppearanceKey;
|
|
3826
|
+
a11y: SemanticRegionA11y | null;
|
|
3827
|
+
visual: SemanticRegionVisual;
|
|
3828
|
+
};
|
|
3829
|
+
type SemanticPublishedRegion = {
|
|
3830
|
+
id: string;
|
|
3831
|
+
geometryKinds: SemanticGeometryKind[];
|
|
3832
|
+
a11y: SemanticRegionA11y | null;
|
|
3833
|
+
};
|
|
3834
|
+
type SemanticRegionSnapshotRow = {
|
|
3835
|
+
id: string;
|
|
3836
|
+
geometry: SemanticRegionGeometry;
|
|
3837
|
+
hitTest: SemanticHitTestPolicy;
|
|
3838
|
+
blend: CompositorBlendMode;
|
|
3839
|
+
order: number;
|
|
3840
|
+
compositorLayerId: string | null;
|
|
3841
|
+
visualLayerId: string | null;
|
|
3842
|
+
visuals: SemanticRegionVisuals;
|
|
3843
|
+
state: SemanticRegionState;
|
|
3844
|
+
a11y: SemanticRegionA11y | null;
|
|
3845
|
+
};
|
|
3846
|
+
type SemanticLayerControllerSnapshot = {
|
|
3847
|
+
schemaVersion: typeof SEMANTIC_LAYER_SNAPSHOT_SCHEMA_VERSION;
|
|
3848
|
+
frame: number;
|
|
3849
|
+
regions: SemanticRegionSnapshotRow[];
|
|
3850
|
+
};
|
|
3851
|
+
type RestoreSemanticLayerResult = {
|
|
3852
|
+
ok: true;
|
|
3853
|
+
snapshot: SemanticLayerControllerSnapshot;
|
|
3854
|
+
} | {
|
|
3855
|
+
ok: false;
|
|
3856
|
+
errors: string[];
|
|
3857
|
+
};
|
|
3858
|
+
type CreateSemanticLayerControllerOptions = {
|
|
3859
|
+
regions: readonly SemanticRegionDeclaration[];
|
|
3860
|
+
compositor?: Compositor;
|
|
3861
|
+
visualLayers?: VisualLayerController;
|
|
3862
|
+
originFrame?: number;
|
|
3863
|
+
};
|
|
3864
|
+
type SemanticLayerController = {
|
|
3865
|
+
list(): SemanticRegionInspect[];
|
|
3866
|
+
inspect(): SemanticRegionInspect[];
|
|
3867
|
+
inspectPublished(): SemanticPublishedRegion[];
|
|
3868
|
+
get(id: string): SemanticRegionInspect | undefined;
|
|
3869
|
+
geometryOf(id: string): SemanticRegionGeometry | undefined;
|
|
3870
|
+
setRegionState(id: string, state: Partial<SemanticRegionState>): void;
|
|
3871
|
+
setRegionA11y(id: string, a11y: SemanticRegionA11y | null): void;
|
|
3872
|
+
hitTest(point: NormalizedPoint): SemanticRegionInspect | undefined;
|
|
3873
|
+
hitTestAll(point: NormalizedPoint): SemanticRegionInspect[];
|
|
3874
|
+
snapshot(): SemanticLayerControllerSnapshot;
|
|
3875
|
+
restore(input: unknown): RestoreSemanticLayerResult;
|
|
3876
|
+
destroy(): void;
|
|
3877
|
+
readonly frame: number;
|
|
3878
|
+
};
|
|
3879
|
+
declare function isSemanticGeometryKind(value: unknown): value is SemanticGeometryKind;
|
|
3880
|
+
declare function isSemanticHitTestPolicy(value: unknown): value is SemanticHitTestPolicy;
|
|
3881
|
+
declare function isSemanticBlendMode(value: unknown): value is CompositorBlendMode;
|
|
3882
|
+
declare function geometryKindsOf(geometry: SemanticRegionGeometry): SemanticGeometryKind[];
|
|
3883
|
+
declare function appearanceForState(state: SemanticRegionState): SemanticAppearanceKey;
|
|
3884
|
+
declare function pointInSemanticGeometry(geometry: SemanticRegionGeometry, point: NormalizedPoint): boolean;
|
|
3885
|
+
declare function createSemanticLayerController(options: CreateSemanticLayerControllerOptions): SemanticLayerController;
|
|
3886
|
+
|
|
3887
|
+
/**
|
|
3888
|
+
* Copyright (c) 2026 Aaron Boyarsky
|
|
3889
|
+
* SPDX-License-Identifier: LicenseRef-CyberArt-Engine
|
|
3890
|
+
* See packages/engine/LICENSE
|
|
3891
|
+
*
|
|
3892
|
+
* Cross-modal presentation sequences. One frame-stepped clock coordinates
|
|
3893
|
+
* audio, captions, semantic-region state, visual layers, and typed cues.
|
|
3894
|
+
* Authored content is JSON-serializable: no callbacks, no ambient host access.
|
|
3895
|
+
* Dialogue graphs and game rules stay with the host.
|
|
3896
|
+
*/
|
|
3897
|
+
|
|
3898
|
+
declare const PRESENTATION_SEQUENCE_SNAPSHOT_SCHEMA_VERSION: 1;
|
|
3899
|
+
declare const PRESENTATION_SEQUENCE_REQUESTED_EVENT: "presentation.sequence.state.requested";
|
|
3900
|
+
declare const PRESENTATION_SEQUENCE_PRELOADING_EVENT: "presentation.sequence.state.preloading";
|
|
3901
|
+
declare const PRESENTATION_SEQUENCE_READY_EVENT: "presentation.sequence.state.ready";
|
|
3902
|
+
declare const PRESENTATION_SEQUENCE_STARTED_EVENT: "presentation.sequence.state.started";
|
|
3903
|
+
declare const PRESENTATION_SEQUENCE_STEP_STARTED_EVENT: "presentation.sequence.state.step-started";
|
|
3904
|
+
declare const PRESENTATION_SEQUENCE_STEP_COMPLETED_EVENT: "presentation.sequence.state.step-completed";
|
|
3905
|
+
declare const PRESENTATION_SEQUENCE_SKIPPED_EVENT: "presentation.sequence.state.skipped";
|
|
3906
|
+
declare const PRESENTATION_SEQUENCE_INTERRUPTED_EVENT: "presentation.sequence.state.interrupted";
|
|
3907
|
+
declare const PRESENTATION_SEQUENCE_FAILED_EVENT: "presentation.sequence.state.failed";
|
|
3908
|
+
declare const PRESENTATION_SEQUENCE_COMPLETED_EVENT: "presentation.sequence.state.completed";
|
|
3909
|
+
declare const PRESENTATION_SEQUENCE_DIAGNOSTIC_EVENT: "presentation.sequence.diagnostic.lifecycle";
|
|
3910
|
+
declare const PRESENTATION_SEQUENCE_EVENTS: readonly ["presentation.sequence.state.requested", "presentation.sequence.state.preloading", "presentation.sequence.state.ready", "presentation.sequence.state.started", "presentation.sequence.state.step-started", "presentation.sequence.state.step-completed", "presentation.sequence.state.skipped", "presentation.sequence.state.interrupted", "presentation.sequence.state.failed", "presentation.sequence.state.completed", "presentation.sequence.diagnostic.lifecycle"];
|
|
3911
|
+
type PresentationSequenceEventType = (typeof PRESENTATION_SEQUENCE_EVENTS)[number];
|
|
3912
|
+
declare const PRESENTATION_TRACK_KINDS: readonly ["audio", "caption", "semantic-region", "visual-layer", "cue"];
|
|
3913
|
+
type PresentationTrackKind = (typeof PRESENTATION_TRACK_KINDS)[number];
|
|
3914
|
+
declare const PRESENTATION_INTERRUPTION_POLICIES: readonly ["replace", "queue", "reject", "ignore"];
|
|
3915
|
+
type PresentationInterruptionPolicy = (typeof PRESENTATION_INTERRUPTION_POLICIES)[number];
|
|
3916
|
+
declare const PRESENTATION_COMPLETION_RULES: readonly ["duration", "immediate"];
|
|
3917
|
+
type PresentationCompletionRule = (typeof PRESENTATION_COMPLETION_RULES)[number];
|
|
3918
|
+
declare const PRESENTATION_AUDIO_CAPABILITY_STATUSES: readonly ["unavailable", "failed", "unauthorized", "muted"];
|
|
3919
|
+
type PresentationAudioCapabilityStatus = (typeof PRESENTATION_AUDIO_CAPABILITY_STATUSES)[number];
|
|
3920
|
+
declare const PRESENTATION_INVOCATION_PHASES: readonly ["requested", "preloading", "ready", "playing", "paused", "skipped", "interrupted", "failed", "completed"];
|
|
3921
|
+
type PresentationInvocationPhase = (typeof PRESENTATION_INVOCATION_PHASES)[number];
|
|
3922
|
+
type PresentationSequenceDiagnostic = {
|
|
3923
|
+
code: string;
|
|
3924
|
+
detail: string;
|
|
3925
|
+
path?: string;
|
|
3926
|
+
};
|
|
3927
|
+
type PresentationStepTiming = {
|
|
3928
|
+
kind: 'absolute';
|
|
3929
|
+
atFrame: number;
|
|
3930
|
+
} | {
|
|
3931
|
+
kind: 'relative';
|
|
3932
|
+
afterStepId?: string;
|
|
3933
|
+
delayFrames?: number;
|
|
3934
|
+
} | {
|
|
3935
|
+
kind: 'simultaneous';
|
|
3936
|
+
withStepId: string;
|
|
3937
|
+
order?: number;
|
|
3938
|
+
delayFrames?: number;
|
|
3939
|
+
};
|
|
3940
|
+
type PresentationStepEffect = {
|
|
3941
|
+
kind: 'audio';
|
|
3942
|
+
assetBinding: string;
|
|
3943
|
+
channelBinding?: string;
|
|
3944
|
+
} | {
|
|
3945
|
+
kind: 'caption';
|
|
3946
|
+
textBinding: string;
|
|
3947
|
+
visible: boolean;
|
|
3948
|
+
} | {
|
|
3949
|
+
kind: 'semantic-region';
|
|
3950
|
+
regionBinding: string;
|
|
3951
|
+
state: Partial<Pick<SemanticRegionState, 'hover' | 'focus' | 'selected'>>;
|
|
3952
|
+
} | {
|
|
3953
|
+
kind: 'visual-layer';
|
|
3954
|
+
layerBinding: string;
|
|
3955
|
+
transition: Extract<VisualLayerTransitionKind, 'show' | 'hide'>;
|
|
3956
|
+
versionBinding?: string;
|
|
3957
|
+
} | {
|
|
3958
|
+
kind: 'cue';
|
|
3959
|
+
name: string;
|
|
3960
|
+
easing?: CueEasing;
|
|
3961
|
+
};
|
|
3962
|
+
type PresentationStepDefinition = {
|
|
3963
|
+
id: string;
|
|
3964
|
+
timing: PresentationStepTiming;
|
|
3965
|
+
durationFrames: number;
|
|
3966
|
+
delayFrames?: number;
|
|
3967
|
+
completion?: PresentationCompletionRule;
|
|
3968
|
+
effect: PresentationStepEffect;
|
|
3969
|
+
restoreOnComplete?: boolean;
|
|
3970
|
+
reducedMotion?: CueReducedMotionPolicy;
|
|
3971
|
+
reducedSensory?: 'keep' | 'skip-audio' | 'complete';
|
|
3972
|
+
};
|
|
3973
|
+
type PresentationTrackDefinition = {
|
|
3974
|
+
id: string;
|
|
3975
|
+
kind: PresentationTrackKind;
|
|
3976
|
+
steps: readonly PresentationStepDefinition[];
|
|
3977
|
+
};
|
|
3978
|
+
type PresentationFallbackWhen = {
|
|
3979
|
+
capability: 'audio';
|
|
3980
|
+
status: PresentationAudioCapabilityStatus;
|
|
3981
|
+
};
|
|
3982
|
+
type PresentationFallbackDefinition = {
|
|
3983
|
+
id: string;
|
|
3984
|
+
when: PresentationFallbackWhen;
|
|
3985
|
+
omitTrackIds?: readonly string[];
|
|
3986
|
+
};
|
|
3987
|
+
type PresentationSequenceDefinition = {
|
|
3988
|
+
id: string;
|
|
3989
|
+
tracks: readonly PresentationTrackDefinition[];
|
|
3990
|
+
interruptionPolicy?: PresentationInterruptionPolicy;
|
|
3991
|
+
fallbacks?: readonly PresentationFallbackDefinition[];
|
|
3992
|
+
};
|
|
3993
|
+
type PresentationSequenceBindings = {
|
|
3994
|
+
assets?: Record<string, string>;
|
|
3995
|
+
captions?: Record<string, string>;
|
|
3996
|
+
regions?: Record<string, string>;
|
|
3997
|
+
layers?: Record<string, string>;
|
|
3998
|
+
versions?: Record<string, string>;
|
|
3999
|
+
channels?: Record<string, string>;
|
|
4000
|
+
};
|
|
4001
|
+
type PlaySequenceOptions = {
|
|
4002
|
+
invocationId: string;
|
|
4003
|
+
idempotencyKey?: string;
|
|
4004
|
+
bindings?: PresentationSequenceBindings;
|
|
4005
|
+
};
|
|
4006
|
+
type DefinePresentationSequenceResult = {
|
|
4007
|
+
ok: true;
|
|
4008
|
+
sequence: PresentationSequenceDefinition;
|
|
4009
|
+
} | {
|
|
4010
|
+
ok: false;
|
|
4011
|
+
errors: PresentationSequenceDiagnostic[];
|
|
4012
|
+
};
|
|
4013
|
+
type PlaySequenceResult = {
|
|
4014
|
+
ok: true;
|
|
4015
|
+
invocation: PresentationInvocationView;
|
|
4016
|
+
} | {
|
|
4017
|
+
ok: false;
|
|
4018
|
+
reason: 'unknown-sequence' | 'invalid' | 'busy' | 'duplicate';
|
|
4019
|
+
detail: string;
|
|
4020
|
+
};
|
|
4021
|
+
type RestorePresentationSequenceResult = {
|
|
4022
|
+
ok: true;
|
|
4023
|
+
snapshot: PresentationSequenceSnapshot;
|
|
4024
|
+
} | {
|
|
4025
|
+
ok: false;
|
|
4026
|
+
errors: PresentationSequenceDiagnostic[];
|
|
4027
|
+
};
|
|
4028
|
+
type PresentationSequenceEvent = {
|
|
4029
|
+
type: PresentationSequenceEventType;
|
|
4030
|
+
atFrame: number;
|
|
4031
|
+
sequenceId: string;
|
|
4032
|
+
invocationId: string;
|
|
4033
|
+
idempotencyKey: string;
|
|
4034
|
+
stepId?: string;
|
|
4035
|
+
fallbackId?: string;
|
|
4036
|
+
reason?: string;
|
|
4037
|
+
};
|
|
4038
|
+
type PresentationCaptionView = {
|
|
4039
|
+
id: string;
|
|
4040
|
+
text: string;
|
|
4041
|
+
visible: boolean;
|
|
4042
|
+
};
|
|
4043
|
+
type PresentationCueIntent = {
|
|
4044
|
+
sequenceId: string;
|
|
4045
|
+
stepId: string;
|
|
4046
|
+
trackId: string;
|
|
4047
|
+
kind: PresentationTrackKind;
|
|
4048
|
+
startFrame: number;
|
|
4049
|
+
durationFrames: number;
|
|
4050
|
+
order: number;
|
|
4051
|
+
effect: PresentationStepEffect;
|
|
4052
|
+
};
|
|
4053
|
+
type PresentationInvocationView = {
|
|
4054
|
+
sequenceId: string;
|
|
4055
|
+
invocationId: string;
|
|
4056
|
+
idempotencyKey: string;
|
|
4057
|
+
phase: PresentationInvocationPhase;
|
|
4058
|
+
playhead: number;
|
|
4059
|
+
startedAtFrame: number;
|
|
4060
|
+
completedStepIds: string[];
|
|
4061
|
+
activeStepIds: string[];
|
|
4062
|
+
selectedFallbackId: string | null;
|
|
4063
|
+
/** Reduced-motion flag used to compile this invocation's step durations. */
|
|
4064
|
+
compiledReducedMotion: boolean;
|
|
4065
|
+
};
|
|
4066
|
+
type PresentationSequenceSnapshot = {
|
|
4067
|
+
schemaVersion: typeof PRESENTATION_SEQUENCE_SNAPSHOT_SCHEMA_VERSION;
|
|
4068
|
+
frame: number;
|
|
4069
|
+
reducedMotion: boolean;
|
|
4070
|
+
reducedSensory: boolean;
|
|
4071
|
+
paused: boolean;
|
|
4072
|
+
active: PresentationInvocationView | null;
|
|
4073
|
+
queue: PresentationSequenceSnapshotQueued[];
|
|
4074
|
+
captions: PresentationCaptionView[];
|
|
4075
|
+
events: PresentationSequenceEvent[];
|
|
4076
|
+
bindings: PresentationSequenceBindings | null;
|
|
4077
|
+
};
|
|
4078
|
+
type PresentationSequenceSnapshotQueued = {
|
|
4079
|
+
sequenceId: string;
|
|
4080
|
+
invocationId: string;
|
|
4081
|
+
idempotencyKey: string;
|
|
4082
|
+
bindings: PresentationSequenceBindings;
|
|
4083
|
+
};
|
|
4084
|
+
type PresentationSequenceInspect = {
|
|
4085
|
+
frame: number;
|
|
4086
|
+
paused: boolean;
|
|
4087
|
+
reducedMotion: boolean;
|
|
4088
|
+
reducedSensory: boolean;
|
|
4089
|
+
active: PresentationInvocationView | null;
|
|
4090
|
+
queue: PresentationInvocationView[];
|
|
4091
|
+
captions: PresentationCaptionView[];
|
|
4092
|
+
cueIntent: PresentationCueIntent[];
|
|
4093
|
+
};
|
|
4094
|
+
type CreatePresentationSequencePlayerOptions = {
|
|
4095
|
+
originFrame?: number;
|
|
4096
|
+
reducedMotion?: boolean;
|
|
4097
|
+
reducedSensory?: boolean;
|
|
4098
|
+
audio?: AudioCueTimeline | HeadlessAudioAdapter;
|
|
4099
|
+
semantic?: SemanticLayerController;
|
|
4100
|
+
visual?: VisualLayerController;
|
|
4101
|
+
sequences?: readonly PresentationSequenceDefinition[];
|
|
4102
|
+
};
|
|
4103
|
+
type PresentationSequencePlayer = {
|
|
4104
|
+
define(input: PresentationSequenceDefinition): DefinePresentationSequenceResult;
|
|
4105
|
+
playSequence(sequenceId: string, options: PlaySequenceOptions): PlaySequenceResult;
|
|
4106
|
+
skip(invocationId?: string): boolean;
|
|
4107
|
+
replay(invocationId?: string): PlaySequenceResult;
|
|
4108
|
+
pause(): boolean;
|
|
4109
|
+
resume(): boolean;
|
|
4110
|
+
cancel(invocationId?: string): boolean;
|
|
4111
|
+
step(frames?: number): PresentationSequenceEvent[];
|
|
4112
|
+
snapshot(): PresentationSequenceSnapshot;
|
|
4113
|
+
restore(input: unknown): RestorePresentationSequenceResult;
|
|
4114
|
+
inspect(): PresentationSequenceInspect;
|
|
4115
|
+
inspectCueIntent(sequenceId: string, options?: {
|
|
4116
|
+
fallbackId?: string;
|
|
4117
|
+
}): PresentationCueIntent[];
|
|
4118
|
+
get(sequenceId: string): PresentationSequenceDefinition | undefined;
|
|
4119
|
+
destroy(): void;
|
|
4120
|
+
/**
|
|
4121
|
+
* Updates the host flag used by future `playSequence` / cue-intent
|
|
4122
|
+
* compilation. The active invocation **continues** with the durations it
|
|
4123
|
+
* was compiled with. Queued plays that have not started yet use the new
|
|
4124
|
+
* policy when they start.
|
|
4125
|
+
*/
|
|
4126
|
+
setReducedMotion(value: boolean): void;
|
|
4127
|
+
readonly frame: number;
|
|
4128
|
+
readonly reducedMotion: boolean;
|
|
4129
|
+
readonly reducedSensory: boolean;
|
|
4130
|
+
};
|
|
4131
|
+
declare function presentationSequenceEventContracts(): EventContract[];
|
|
4132
|
+
declare function isPresentationSequenceEventType(value: unknown): value is PresentationSequenceEventType;
|
|
4133
|
+
declare function definePresentationSequence(input: unknown): DefinePresentationSequenceResult;
|
|
4134
|
+
declare function createPresentationSequencePlayer(options?: CreatePresentationSequencePlayerOptions): PresentationSequencePlayer;
|
|
4135
|
+
|
|
4136
|
+
/**
|
|
4137
|
+
* Copyright (c) 2026 Aaron Boyarsky
|
|
4138
|
+
* SPDX-License-Identifier: LicenseRef-CyberArt-Engine
|
|
4139
|
+
* See packages/engine/LICENSE
|
|
4140
|
+
*
|
|
4141
|
+
* Declarative projection of host-authoritative state into presentation
|
|
4142
|
+
* resources. The host reducer stays the owner; this module evaluates a
|
|
4143
|
+
* bounded, JSON-serializable binding manifest and applies one coherent
|
|
4144
|
+
* presentation revision (or the declared fail-closed defaults).
|
|
4145
|
+
*/
|
|
4146
|
+
|
|
4147
|
+
declare const PRESENTATION_BINDING_SNAPSHOT_SCHEMA_VERSION: 1;
|
|
4148
|
+
declare const PRESENTATION_BINDING_MANIFEST_VERSION: 1;
|
|
4149
|
+
declare const PRESENTATION_BINDING_APPLIED_EVENT: "presentation.binding.state.applied";
|
|
4150
|
+
declare const PRESENTATION_BINDING_REJECTED_EVENT: "presentation.binding.state.rejected";
|
|
4151
|
+
declare const PRESENTATION_BINDING_DIAGNOSTIC_EVENT: "presentation.binding.diagnostic.lifecycle";
|
|
4152
|
+
declare const PRESENTATION_BINDING_EVENTS: readonly ["presentation.binding.state.applied", "presentation.binding.state.rejected", "presentation.binding.diagnostic.lifecycle"];
|
|
4153
|
+
type PresentationBindingEventType = (typeof PRESENTATION_BINDING_EVENTS)[number];
|
|
4154
|
+
declare const PRESENTATION_BINDING_TARGET_KINDS: readonly ["visual-layer", "presence", "prop", "semantic-region", "hotspot", "sequence", "asset"];
|
|
4155
|
+
type PresentationBindingTargetKind = (typeof PRESENTATION_BINDING_TARGET_KINDS)[number];
|
|
4156
|
+
declare const PRESENTATION_BINDING_ERROR_CODES: readonly ["invalid-manifest", "invalid-schema", "invalid-version", "invalid-id", "unknown-field", "unknown-resource", "unknown-selector", "duplicate-id", "duplicate-priority", "uncovered-default", "impossible-target", "callbacks-forbidden", "invalid-predicate", "invalid-projection", "invalid-snapshot", "destroyed"];
|
|
4157
|
+
type PresentationBindingErrorCode = (typeof PRESENTATION_BINDING_ERROR_CODES)[number];
|
|
4158
|
+
type PresentationBindingDiagnostic = {
|
|
4159
|
+
code: PresentationBindingErrorCode | string;
|
|
4160
|
+
detail: string;
|
|
4161
|
+
path?: string;
|
|
4162
|
+
};
|
|
4163
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
4164
|
+
type JsonObject = {
|
|
4165
|
+
[key: string]: JsonValue;
|
|
4166
|
+
};
|
|
4167
|
+
type JsonValue = JsonPrimitive | JsonValue[] | JsonObject;
|
|
4168
|
+
type PresentationPredicate = {
|
|
4169
|
+
path: string;
|
|
4170
|
+
eq: JsonPrimitive;
|
|
4171
|
+
} | {
|
|
4172
|
+
path: string;
|
|
4173
|
+
neq: JsonPrimitive;
|
|
4174
|
+
} | {
|
|
4175
|
+
path: string;
|
|
4176
|
+
present: boolean;
|
|
4177
|
+
} | {
|
|
4178
|
+
selector: string;
|
|
4179
|
+
} | {
|
|
4180
|
+
all: PresentationPredicate[];
|
|
4181
|
+
} | {
|
|
4182
|
+
any: PresentationPredicate[];
|
|
4183
|
+
} | {
|
|
4184
|
+
not: PresentationPredicate;
|
|
4185
|
+
};
|
|
4186
|
+
type PresentationBindingTarget = {
|
|
4187
|
+
kind: 'visual-layer';
|
|
4188
|
+
layerId: string;
|
|
4189
|
+
version: string;
|
|
4190
|
+
transition?: Extract<VisualLayerTransitionKind, 'show' | 'hide' | 'replace'>;
|
|
4191
|
+
} | {
|
|
4192
|
+
kind: 'presence';
|
|
4193
|
+
entityId: string;
|
|
4194
|
+
present: boolean;
|
|
4195
|
+
regionId?: string;
|
|
4196
|
+
} | {
|
|
4197
|
+
kind: 'prop';
|
|
4198
|
+
propId: string;
|
|
4199
|
+
visible: boolean;
|
|
4200
|
+
layerId?: string;
|
|
4201
|
+
} | {
|
|
4202
|
+
kind: 'semantic-region';
|
|
4203
|
+
regionId: string;
|
|
4204
|
+
state?: Partial<Pick<SemanticRegionState, 'hover' | 'focus' | 'selected'>>;
|
|
4205
|
+
hitTestEnabled?: boolean;
|
|
4206
|
+
} | {
|
|
4207
|
+
kind: 'hotspot';
|
|
4208
|
+
hotspotId: string;
|
|
4209
|
+
enabled: boolean;
|
|
4210
|
+
regionId?: string;
|
|
4211
|
+
} | {
|
|
4212
|
+
kind: 'sequence';
|
|
4213
|
+
sequenceId: string;
|
|
4214
|
+
play?: boolean;
|
|
4215
|
+
} | {
|
|
4216
|
+
kind: 'asset';
|
|
4217
|
+
bindingId: string;
|
|
4218
|
+
assetId: string;
|
|
4219
|
+
};
|
|
4220
|
+
type PresentationBinding = {
|
|
4221
|
+
id: string;
|
|
4222
|
+
priority: number;
|
|
4223
|
+
when: PresentationPredicate;
|
|
4224
|
+
targets: readonly PresentationBindingTarget[];
|
|
4225
|
+
};
|
|
4226
|
+
type PresentationBindingResources = {
|
|
4227
|
+
layers?: readonly string[];
|
|
4228
|
+
versions?: Readonly<Record<string, readonly string[]>>;
|
|
4229
|
+
regions?: readonly string[];
|
|
4230
|
+
sequences?: readonly string[];
|
|
4231
|
+
hotspots?: readonly string[];
|
|
4232
|
+
entities?: readonly string[];
|
|
4233
|
+
props?: readonly string[];
|
|
4234
|
+
assets?: readonly string[];
|
|
4235
|
+
};
|
|
4236
|
+
type PresentationBindingManifest = {
|
|
4237
|
+
id: string;
|
|
4238
|
+
schemaVersion: typeof PRESENTATION_BINDING_MANIFEST_VERSION;
|
|
4239
|
+
bindings: readonly PresentationBinding[];
|
|
4240
|
+
defaults: readonly PresentationBindingTarget[];
|
|
4241
|
+
resources?: PresentationBindingResources;
|
|
4242
|
+
};
|
|
4243
|
+
type DefinePresentationBindingsResult = {
|
|
2355
4244
|
ok: true;
|
|
2356
|
-
|
|
4245
|
+
manifest: PresentationBindingManifest;
|
|
2357
4246
|
} | {
|
|
2358
4247
|
ok: false;
|
|
2359
|
-
errors:
|
|
4248
|
+
errors: PresentationBindingDiagnostic[];
|
|
2360
4249
|
};
|
|
2361
|
-
type
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
4250
|
+
type PresentationBindingSelector = (projection: JsonObject) => boolean;
|
|
4251
|
+
type PresentationBindingConsidered = {
|
|
4252
|
+
bindingId: string;
|
|
4253
|
+
predicateResult: boolean;
|
|
4254
|
+
detail?: string;
|
|
4255
|
+
};
|
|
4256
|
+
type PresentationBindingRejected = {
|
|
4257
|
+
bindingId: string;
|
|
4258
|
+
targetKey: string;
|
|
4259
|
+
reason: 'lower-priority' | 'predicate-false';
|
|
4260
|
+
};
|
|
4261
|
+
type PresentationBindingFallback = {
|
|
4262
|
+
targetKey: string;
|
|
4263
|
+
reason: 'uncovered-default' | 'missing-state' | 'invalid-projection';
|
|
4264
|
+
};
|
|
4265
|
+
type PresentationBindingExplanation = {
|
|
4266
|
+
considered: PresentationBindingConsidered[];
|
|
4267
|
+
winners: Record<string, {
|
|
4268
|
+
bindingId: string | null;
|
|
4269
|
+
target: PresentationBindingTarget;
|
|
4270
|
+
}>;
|
|
4271
|
+
rejected: PresentationBindingRejected[];
|
|
4272
|
+
fallbacks: PresentationBindingFallback[];
|
|
4273
|
+
fallbackReason: 'missing-state' | 'invalid-projection' | null;
|
|
4274
|
+
};
|
|
4275
|
+
type PresentationBindingEvaluation = {
|
|
4276
|
+
selectedBindingIds: string[];
|
|
4277
|
+
targets: PresentationBindingTarget[];
|
|
4278
|
+
usedFallback: boolean;
|
|
4279
|
+
fallbackReason: 'missing-state' | 'invalid-projection' | null;
|
|
4280
|
+
explanation: PresentationBindingExplanation;
|
|
4281
|
+
};
|
|
4282
|
+
type HostPresentationOverride = {
|
|
4283
|
+
labels?: Record<string, string | Pick<SemanticRegionA11y, 'name' | 'role'>>;
|
|
4284
|
+
reducedSensory?: boolean;
|
|
2366
4285
|
reducedMotion?: boolean;
|
|
2367
|
-
sceneId?: string;
|
|
2368
|
-
fallback?: VisualLayerFallbackPolicy;
|
|
2369
|
-
onAccepted?: readonly VisualLayerAcceptedBinding[];
|
|
2370
|
-
dispatch?: (event: HostEvent) => void;
|
|
2371
4286
|
};
|
|
2372
|
-
type
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
4287
|
+
type PresentationBindingInspect = {
|
|
4288
|
+
revision: string | number | null;
|
|
4289
|
+
selectedBindingIds: string[];
|
|
4290
|
+
layers: Record<string, string>;
|
|
4291
|
+
presence: Record<string, boolean>;
|
|
4292
|
+
props: Record<string, boolean>;
|
|
4293
|
+
regions: Record<string, Partial<SemanticRegionState> & {
|
|
4294
|
+
hitTestEnabled?: boolean;
|
|
4295
|
+
}>;
|
|
4296
|
+
hotspots: Record<string, boolean>;
|
|
4297
|
+
sequences: Record<string, 'playing' | 'idle'>;
|
|
4298
|
+
assets: Record<string, string>;
|
|
4299
|
+
override: HostPresentationOverride | null;
|
|
4300
|
+
usedFallback: boolean;
|
|
4301
|
+
fallbackReason: 'missing-state' | 'invalid-projection' | null;
|
|
4302
|
+
explanation: PresentationBindingExplanation | null;
|
|
4303
|
+
};
|
|
4304
|
+
type PresentationBindingSnapshot = {
|
|
4305
|
+
schemaVersion: typeof PRESENTATION_BINDING_SNAPSHOT_SCHEMA_VERSION;
|
|
4306
|
+
manifestId: string;
|
|
4307
|
+
projectionRevision: string | number | null;
|
|
4308
|
+
selectedBindingIds: string[];
|
|
4309
|
+
targets: PresentationBindingTarget[];
|
|
4310
|
+
usedFallback: boolean;
|
|
4311
|
+
fallbackReason: 'missing-state' | 'invalid-projection' | null;
|
|
4312
|
+
override: HostPresentationOverride | null;
|
|
4313
|
+
};
|
|
4314
|
+
type PresentationBindingEvent = {
|
|
4315
|
+
type: PresentationBindingEventType;
|
|
4316
|
+
atRevision: string | number | null;
|
|
4317
|
+
manifestId: string;
|
|
4318
|
+
selectedBindingIds: string[];
|
|
4319
|
+
reason?: string;
|
|
2386
4320
|
};
|
|
2387
|
-
type
|
|
2388
|
-
|
|
2389
|
-
|
|
4321
|
+
type ApplyPresentationBindingsResult = {
|
|
4322
|
+
ok: true;
|
|
4323
|
+
revision: string | number;
|
|
4324
|
+
selectedBindingIds: string[];
|
|
4325
|
+
usedFallback: boolean;
|
|
4326
|
+
fallbackReason: 'missing-state' | 'invalid-projection' | null;
|
|
4327
|
+
explanation: PresentationBindingExplanation;
|
|
4328
|
+
inspect: PresentationBindingInspect;
|
|
4329
|
+
} | {
|
|
4330
|
+
ok: false;
|
|
4331
|
+
errors: PresentationBindingDiagnostic[];
|
|
4332
|
+
inspect: PresentationBindingInspect;
|
|
2390
4333
|
};
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
4334
|
+
type RestorePresentationBindingsResult = {
|
|
4335
|
+
ok: true;
|
|
4336
|
+
snapshot: PresentationBindingSnapshot;
|
|
4337
|
+
} | {
|
|
4338
|
+
ok: false;
|
|
4339
|
+
errors: PresentationBindingDiagnostic[];
|
|
4340
|
+
};
|
|
4341
|
+
type CreatePresentationBindingRuntimeOptions = {
|
|
4342
|
+
manifest: PresentationBindingManifest | unknown;
|
|
4343
|
+
visual?: VisualLayerController;
|
|
4344
|
+
semantic?: SemanticLayerController;
|
|
4345
|
+
sequences?: PresentationSequencePlayer;
|
|
4346
|
+
selectors?: Readonly<Record<string, PresentationBindingSelector>>;
|
|
4347
|
+
router?: Pick<EventRouter, 'publish'>;
|
|
4348
|
+
onEvent?: (event: EventInput) => void;
|
|
4349
|
+
};
|
|
4350
|
+
type PresentationBindingRuntime = {
|
|
4351
|
+
apply(projection: unknown, options?: {
|
|
4352
|
+
revision?: string | number;
|
|
4353
|
+
}): ApplyPresentationBindingsResult;
|
|
4354
|
+
setOverride(override: HostPresentationOverride | null): void;
|
|
4355
|
+
evaluate(projection: unknown): PresentationBindingEvaluation;
|
|
4356
|
+
inspect(): PresentationBindingInspect;
|
|
4357
|
+
snapshot(): PresentationBindingSnapshot;
|
|
4358
|
+
restore(input: unknown): RestorePresentationBindingsResult;
|
|
4359
|
+
destroy(): void;
|
|
4360
|
+
readonly manifest: PresentationBindingManifest;
|
|
4361
|
+
};
|
|
4362
|
+
declare function isPresentationBindingEventType(value: unknown): value is PresentationBindingEventType;
|
|
4363
|
+
declare function isPresentationBindingErrorCode(value: unknown): value is PresentationBindingErrorCode;
|
|
4364
|
+
declare function presentationBindingEventContracts(): EventContract[];
|
|
4365
|
+
declare function presentationBindingTargetKey(target: PresentationBindingTarget): string;
|
|
4366
|
+
declare function definePresentationBindings(input: unknown): DefinePresentationBindingsResult;
|
|
4367
|
+
declare function evaluatePresentationBindings(manifest: PresentationBindingManifest, projection: unknown, selectors?: Readonly<Record<string, PresentationBindingSelector>>): PresentationBindingEvaluation;
|
|
4368
|
+
declare function createPresentationBindingRuntime(options: CreatePresentationBindingRuntimeOptions): PresentationBindingRuntime;
|
|
2397
4369
|
|
|
2398
4370
|
/**
|
|
2399
4371
|
* Copyright (c) 2026 Aaron Boyarsky
|
|
2400
4372
|
* SPDX-License-Identifier: LicenseRef-CyberArt-Engine
|
|
2401
4373
|
* See packages/engine/LICENSE
|
|
2402
4374
|
*
|
|
2403
|
-
*
|
|
2404
|
-
*
|
|
2405
|
-
*
|
|
4375
|
+
* Atomic external content-revision activation. Adapters discover and load
|
|
4376
|
+
* revision catalogs; the activator stages every declared asset, then commits
|
|
4377
|
+
* one complete bundle (or keeps the last known good). Consumers never see a
|
|
4378
|
+
* mixed old/new scene.
|
|
2406
4379
|
*/
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
4380
|
+
|
|
4381
|
+
declare const CONTENT_REVISION_SNAPSHOT_SCHEMA_VERSION: 1;
|
|
4382
|
+
declare const CONTENT_REVISION_MANIFEST_VERSION: 1;
|
|
4383
|
+
declare const CONTENT_REVISION_DISCOVERED_EVENT: "content.revision.state.discovered";
|
|
4384
|
+
declare const CONTENT_REVISION_STAGING_EVENT: "content.revision.state.staging";
|
|
4385
|
+
declare const CONTENT_REVISION_VALIDATED_EVENT: "content.revision.state.validated";
|
|
4386
|
+
declare const CONTENT_REVISION_REJECTED_EVENT: "content.revision.state.rejected";
|
|
4387
|
+
declare const CONTENT_REVISION_ACTIVATED_EVENT: "content.revision.state.activated";
|
|
4388
|
+
declare const CONTENT_REVISION_ROLLED_BACK_EVENT: "content.revision.state.rolled-back";
|
|
4389
|
+
declare const CONTENT_REVISION_SUPERSEDED_EVENT: "content.revision.state.superseded";
|
|
4390
|
+
declare const CONTENT_REVISION_DIAGNOSTIC_EVENT: "content.revision.diagnostic.lifecycle";
|
|
4391
|
+
declare const CONTENT_REVISION_EVENTS: readonly ["content.revision.state.discovered", "content.revision.state.staging", "content.revision.state.validated", "content.revision.state.rejected", "content.revision.state.activated", "content.revision.state.rolled-back", "content.revision.state.superseded", "content.revision.diagnostic.lifecycle"];
|
|
4392
|
+
type ContentRevisionEventType = (typeof CONTENT_REVISION_EVENTS)[number];
|
|
4393
|
+
declare const CONTENT_REVISION_ERROR_CODES: readonly ["invalid-manifest", "invalid-schema", "invalid-version", "invalid-snapshot", "unknown-revision", "unknown-adapter", "hash-mismatch", "capability-denied", "pinned", "staging-failed", "activation-failed", "health-check-failed", "stale-health-check", "superseded", "destroyed", "adapter-missing", "asset-failed", "unsigned"];
|
|
4394
|
+
type ContentRevisionErrorCode = (typeof CONTENT_REVISION_ERROR_CODES)[number];
|
|
4395
|
+
type ContentRevisionDiagnostic = {
|
|
4396
|
+
code: ContentRevisionErrorCode | string;
|
|
2415
4397
|
detail: string;
|
|
2416
|
-
|
|
2417
|
-
};
|
|
2418
|
-
type ExecutableModuleDiagnostic = ExecutableModuleError;
|
|
2419
|
-
type ExecutableModuleCapabilities = {
|
|
2420
|
-
readonly [key: string]: unknown;
|
|
2421
|
-
};
|
|
2422
|
-
type ExecutableModuleInvokeContext = {
|
|
2423
|
-
signal: AbortSignal;
|
|
2424
|
-
turn: number;
|
|
2425
|
-
};
|
|
2426
|
-
type ExecutableModuleInstance = {
|
|
2427
|
-
invoke(input: unknown, context: ExecutableModuleInvokeContext): unknown | Promise<unknown>;
|
|
2428
|
-
destroy?: () => void;
|
|
4398
|
+
path?: string;
|
|
2429
4399
|
};
|
|
2430
|
-
type
|
|
2431
|
-
type ExecutableModuleRegistration = {
|
|
4400
|
+
type ContentRevisionAssetDecl = {
|
|
2432
4401
|
id: string;
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
4402
|
+
kind: AssetKind;
|
|
4403
|
+
url: string;
|
|
4404
|
+
hash: string;
|
|
4405
|
+
alg: 'sha256';
|
|
4406
|
+
optional?: boolean;
|
|
4407
|
+
fallback?: {
|
|
4408
|
+
id: string;
|
|
4409
|
+
kind: AssetKind;
|
|
4410
|
+
url: string;
|
|
4411
|
+
hash: string;
|
|
4412
|
+
alg: 'sha256';
|
|
4413
|
+
};
|
|
2436
4414
|
};
|
|
2437
|
-
type
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
4415
|
+
type ContentRevisionCatalog = {
|
|
4416
|
+
contentId: string;
|
|
4417
|
+
revision: string;
|
|
4418
|
+
manifestVersion: typeof CONTENT_REVISION_MANIFEST_VERSION;
|
|
4419
|
+
publisher: string;
|
|
4420
|
+
source: string;
|
|
4421
|
+
adapterId: string;
|
|
4422
|
+
assets: ContentRevisionAssetDecl[];
|
|
4423
|
+
requestedGrants?: RemoteCartGrant[];
|
|
4424
|
+
capabilities?: CapabilityManifest;
|
|
4425
|
+
signature?: {
|
|
4426
|
+
id: string;
|
|
4427
|
+
alg: string;
|
|
4428
|
+
};
|
|
2441
4429
|
};
|
|
2442
|
-
type
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
4430
|
+
type ContentRevisionDescriptor = {
|
|
4431
|
+
contentId: string;
|
|
4432
|
+
revision: string;
|
|
4433
|
+
adapterId: string;
|
|
4434
|
+
publisher: string;
|
|
4435
|
+
source: string;
|
|
2448
4436
|
};
|
|
2449
|
-
type
|
|
4437
|
+
type ContentRevisionResource = {
|
|
4438
|
+
id: string;
|
|
4439
|
+
kind: AssetKind;
|
|
4440
|
+
ref: string;
|
|
4441
|
+
hash: string;
|
|
4442
|
+
url: string;
|
|
4443
|
+
optional: boolean;
|
|
4444
|
+
usedFallback: boolean;
|
|
4445
|
+
};
|
|
4446
|
+
type ContentRevisionBundle = {
|
|
4447
|
+
bundleId: string;
|
|
4448
|
+
contentId: string;
|
|
4449
|
+
revision: string;
|
|
4450
|
+
manifestVersion: typeof CONTENT_REVISION_MANIFEST_VERSION;
|
|
4451
|
+
publisher: string;
|
|
4452
|
+
source: string;
|
|
4453
|
+
adapterId: string;
|
|
4454
|
+
signature?: {
|
|
4455
|
+
id: string;
|
|
4456
|
+
alg: string;
|
|
4457
|
+
};
|
|
4458
|
+
resources: Record<string, ContentRevisionResource>;
|
|
4459
|
+
};
|
|
4460
|
+
type ContentRevisionStagingView = {
|
|
4461
|
+
contentId: string;
|
|
4462
|
+
revision: string;
|
|
4463
|
+
adapterId: string;
|
|
4464
|
+
bundleId: string;
|
|
4465
|
+
};
|
|
4466
|
+
type ContentRevisionInspect = {
|
|
4467
|
+
destroyed: boolean;
|
|
4468
|
+
pinned: boolean;
|
|
4469
|
+
active: ContentRevisionBundle | null;
|
|
4470
|
+
lastKnownGood: ContentRevisionBundle | null;
|
|
4471
|
+
staging: ContentRevisionStagingView | null;
|
|
4472
|
+
events: ContentRevisionEventType[];
|
|
4473
|
+
lastRejection: ContentRevisionDiagnostic[] | null;
|
|
4474
|
+
};
|
|
4475
|
+
type ContentRevisionSnapshot = {
|
|
4476
|
+
schemaVersion: typeof CONTENT_REVISION_SNAPSHOT_SCHEMA_VERSION;
|
|
4477
|
+
pinned: boolean;
|
|
4478
|
+
active: ContentRevisionBundle | null;
|
|
4479
|
+
lastKnownGood: ContentRevisionBundle | null;
|
|
4480
|
+
previous: ContentRevisionBundle | null;
|
|
4481
|
+
};
|
|
4482
|
+
type ContentRevisionMutationResult = {
|
|
2450
4483
|
ok: true;
|
|
2451
|
-
|
|
4484
|
+
bundle: ContentRevisionBundle | null;
|
|
4485
|
+
idempotent?: boolean;
|
|
2452
4486
|
} | {
|
|
2453
4487
|
ok: false;
|
|
2454
|
-
|
|
4488
|
+
errors: ContentRevisionDiagnostic[];
|
|
2455
4489
|
};
|
|
2456
|
-
type
|
|
4490
|
+
type RestoreContentRevisionResult = {
|
|
2457
4491
|
ok: true;
|
|
2458
|
-
|
|
4492
|
+
snapshot: ContentRevisionSnapshot;
|
|
2459
4493
|
} | {
|
|
2460
4494
|
ok: false;
|
|
2461
|
-
|
|
4495
|
+
errors: ContentRevisionDiagnostic[];
|
|
2462
4496
|
};
|
|
2463
|
-
type
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
turn: number;
|
|
2468
|
-
invokesThisTurn: number;
|
|
2469
|
-
diagnostics: ExecutableModuleDiagnostic[];
|
|
4497
|
+
type ActivateContentRevisionRequest = {
|
|
4498
|
+
contentId: string;
|
|
4499
|
+
revision?: string;
|
|
4500
|
+
adapterId?: string;
|
|
2470
4501
|
};
|
|
2471
|
-
type
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
4502
|
+
type ContentRevisionFetchBytes = (url: string, signal?: AbortSignal) => Promise<Uint8Array | undefined>;
|
|
4503
|
+
type ContentRegistryAdapter = {
|
|
4504
|
+
readonly id: string;
|
|
4505
|
+
hasRevision(contentId: string, revision: string): boolean;
|
|
4506
|
+
discover(contentId: string): Promise<ContentRevisionDescriptor | undefined>;
|
|
4507
|
+
loadRevision(contentId: string, revision: string, signal?: AbortSignal): Promise<{
|
|
4508
|
+
ok: true;
|
|
4509
|
+
catalog: ContentRevisionCatalog;
|
|
4510
|
+
} | {
|
|
4511
|
+
ok: false;
|
|
4512
|
+
errors: ContentRevisionDiagnostic[];
|
|
4513
|
+
}>;
|
|
4514
|
+
fetchBytes: ContentRevisionFetchBytes;
|
|
4515
|
+
};
|
|
4516
|
+
type CreateStaticContentAdapterOptions = {
|
|
4517
|
+
id?: string;
|
|
4518
|
+
revisions: readonly ContentRevisionCatalog[];
|
|
4519
|
+
bytesByUrl: Readonly<Record<string, Uint8Array>>;
|
|
4520
|
+
fetchBytes?: ContentRevisionFetchBytes;
|
|
4521
|
+
};
|
|
4522
|
+
type RemoteContentEnvelope = {
|
|
4523
|
+
world: string;
|
|
4524
|
+
revision: string;
|
|
4525
|
+
manifest: SignedRemoteCartManifest;
|
|
4526
|
+
};
|
|
4527
|
+
type CreateRemoteContentAdapterOptions = {
|
|
4528
|
+
id?: string;
|
|
4529
|
+
fetch: (url: string, signal?: AbortSignal) => Promise<unknown>;
|
|
4530
|
+
keys: Readonly<Record<string, string>>;
|
|
4531
|
+
bytesByUrl?: Readonly<Record<string, Uint8Array>>;
|
|
4532
|
+
fetchBytes?: ContentRevisionFetchBytes;
|
|
4533
|
+
catalogUrl?: (contentId: string, revision?: string) => string;
|
|
4534
|
+
known?: ReadonlyArray<{
|
|
4535
|
+
contentId: string;
|
|
4536
|
+
revision: string;
|
|
4537
|
+
}>;
|
|
4538
|
+
};
|
|
4539
|
+
type ContentRevisionHealthCheck = (bundle: ContentRevisionBundle) => boolean | Promise<boolean>;
|
|
4540
|
+
type CreateContentRevisionActivatorOptions = {
|
|
4541
|
+
adapters: readonly ContentRegistryAdapter[];
|
|
4542
|
+
pin?: boolean;
|
|
4543
|
+
grants?: HostGrantSet;
|
|
4544
|
+
hostCapabilities?: HostCapabilities;
|
|
4545
|
+
healthCheck?: ContentRevisionHealthCheck;
|
|
4546
|
+
router?: Pick<EventRouter, 'publish'>;
|
|
4547
|
+
onEvent?: (event: EventInput) => void;
|
|
4548
|
+
};
|
|
4549
|
+
type ContentRevisionActivator = {
|
|
4550
|
+
pin(frozen?: boolean): void;
|
|
4551
|
+
unpin(): void;
|
|
4552
|
+
isPinned(): boolean;
|
|
4553
|
+
discover(contentId: string, adapterId?: string): Promise<ContentRevisionDescriptor | undefined>;
|
|
4554
|
+
activate(request: ActivateContentRevisionRequest): Promise<ContentRevisionMutationResult>;
|
|
4555
|
+
rollback(): ContentRevisionMutationResult;
|
|
4556
|
+
inspect(): ContentRevisionInspect;
|
|
4557
|
+
activeBundle(): ContentRevisionBundle | null;
|
|
4558
|
+
snapshot(): ContentRevisionSnapshot;
|
|
4559
|
+
restore(input: unknown): RestoreContentRevisionResult;
|
|
4560
|
+
provenance(): SnapshotProvenance | undefined;
|
|
2476
4561
|
destroy(): void;
|
|
2477
4562
|
};
|
|
2478
|
-
declare function
|
|
4563
|
+
declare function contentRevisionEventContracts(): EventContract[];
|
|
4564
|
+
declare function parseContentRevisionCatalog(input: unknown): {
|
|
4565
|
+
ok: true;
|
|
4566
|
+
catalog: ContentRevisionCatalog;
|
|
4567
|
+
} | {
|
|
4568
|
+
ok: false;
|
|
4569
|
+
errors: ContentRevisionDiagnostic[];
|
|
4570
|
+
};
|
|
4571
|
+
declare function createStaticContentAdapter(options: CreateStaticContentAdapterOptions): ContentRegistryAdapter;
|
|
4572
|
+
declare function createRemoteContentAdapter(options: CreateRemoteContentAdapterOptions): ContentRegistryAdapter;
|
|
4573
|
+
declare function createContentRevisionActivator(options: CreateContentRevisionActivatorOptions): ContentRevisionActivator;
|
|
4574
|
+
declare function isContentRevisionErrorCode(value: unknown): value is ContentRevisionErrorCode;
|
|
2479
4575
|
|
|
2480
4576
|
/**
|
|
2481
4577
|
* Copyright (c) 2026 Aaron Boyarsky
|
|
@@ -2540,6 +4636,12 @@ type BrowserA11ySnapshot = {
|
|
|
2540
4636
|
};
|
|
2541
4637
|
live: string;
|
|
2542
4638
|
html: string;
|
|
4639
|
+
publishedRegions: Array<{
|
|
4640
|
+
id: string;
|
|
4641
|
+
geometryKinds: string[];
|
|
4642
|
+
name: string | null;
|
|
4643
|
+
role: string | null;
|
|
4644
|
+
}>;
|
|
2543
4645
|
};
|
|
2544
4646
|
type BrowserReproductionMetadata = {
|
|
2545
4647
|
seed: string;
|
|
@@ -2559,6 +4661,11 @@ type BrowserHarnessMountContext = {
|
|
|
2559
4661
|
reducedMotion: boolean;
|
|
2560
4662
|
inputModality: BrowserInputModality;
|
|
2561
4663
|
placeRegion(id: string, element: HTMLElement): PixelRect | undefined;
|
|
4664
|
+
/**
|
|
4665
|
+
* Replace the geometry document used by `placeRegion` and CSS hit-testing.
|
|
4666
|
+
* Does not rebuild host markup; call `relayout` or place regions again.
|
|
4667
|
+
*/
|
|
4668
|
+
setGeometry(next?: GeometryDocument): void;
|
|
2562
4669
|
};
|
|
2563
4670
|
type BrowserHarnessRuntimeContext = BrowserHarnessMountContext & {
|
|
2564
4671
|
group: RuntimeGroup | undefined;
|
|
@@ -2581,6 +4688,7 @@ type CreateBrowserHarnessOptions = {
|
|
|
2581
4688
|
origin?: number;
|
|
2582
4689
|
createId?: () => string;
|
|
2583
4690
|
geometry?: GeometryDocument;
|
|
4691
|
+
semanticLayers?: SemanticLayerController;
|
|
2584
4692
|
contentWidth?: number;
|
|
2585
4693
|
contentHeight?: number;
|
|
2586
4694
|
fit?: PresentationFitMode;
|
|
@@ -2593,6 +4701,7 @@ type BrowserHarnessInspect = {
|
|
|
2593
4701
|
participantEvents: Record<string, HostEvent[]>;
|
|
2594
4702
|
state: Record<string, unknown>;
|
|
2595
4703
|
focus: BrowserA11ySnapshot['focus'];
|
|
4704
|
+
publishedRegions: BrowserA11ySnapshot['publishedRegions'];
|
|
2596
4705
|
scrollTop: number;
|
|
2597
4706
|
clock: {
|
|
2598
4707
|
framesElapsed: number;
|
|
@@ -2604,8 +4713,10 @@ type BrowserHarness = {
|
|
|
2604
4713
|
readonly compositor: Compositor | undefined;
|
|
2605
4714
|
readonly layout: PresentationLayout;
|
|
2606
4715
|
readonly events: readonly EventEnvelope[];
|
|
4716
|
+
readonly geometry: GeometryDocument | undefined;
|
|
2607
4717
|
goto(url?: string): void;
|
|
2608
4718
|
setViewport(width: number, height: number, dpr?: number): void;
|
|
4719
|
+
setGeometry(next?: GeometryDocument): void;
|
|
2609
4720
|
setReducedMotion(value: boolean): void;
|
|
2610
4721
|
setInputModality(value: BrowserInputModality): void;
|
|
2611
4722
|
click(selectorOrX: string | number, y?: number): void;
|
|
@@ -2653,6 +4764,355 @@ type PlaywrightCompatibleAdapter = {
|
|
|
2653
4764
|
};
|
|
2654
4765
|
declare function createPlaywrightCompatibleAdapter(harness: BrowserHarness): PlaywrightCompatibleAdapter;
|
|
2655
4766
|
|
|
4767
|
+
/**
|
|
4768
|
+
* Copyright (c) 2026 Aaron Boyarsky
|
|
4769
|
+
* SPDX-License-Identifier: LicenseRef-CyberArt-Engine
|
|
4770
|
+
* See packages/engine/LICENSE
|
|
4771
|
+
*
|
|
4772
|
+
* End-to-end production composition scenario harness. Composes the real
|
|
4773
|
+
* browser host, runtime group, compositor, visual/semantic layers, bindings,
|
|
4774
|
+
* sequences, headless audio, optional host-owned audio observation, snapshots,
|
|
4775
|
+
* and replay inspector. Does not introduce a second runtime. Authored
|
|
4776
|
+
* scenarios are JSON-serializable.
|
|
4777
|
+
*/
|
|
4778
|
+
|
|
4779
|
+
declare const PRODUCTION_SCENARIO_SCHEMA_VERSION: 1;
|
|
4780
|
+
declare const PRODUCTION_SCENARIO_SNAPSHOT_SCHEMA_VERSION: 1;
|
|
4781
|
+
declare const PRODUCTION_SCENARIO_OBSERVED_EVENT: "production.scenario.state.observed";
|
|
4782
|
+
declare const PRODUCTION_SCENARIO_FAILED_EVENT: "production.scenario.state.failed";
|
|
4783
|
+
declare const PRODUCTION_SCENARIO_DIAGNOSTIC_EVENT: "production.scenario.diagnostic.lifecycle";
|
|
4784
|
+
declare const PRODUCTION_SCENARIO_EVENTS: readonly ["production.scenario.state.observed", "production.scenario.state.failed", "production.scenario.diagnostic.lifecycle"];
|
|
4785
|
+
type ProductionScenarioEventType = (typeof PRODUCTION_SCENARIO_EVENTS)[number];
|
|
4786
|
+
declare const PRODUCTION_SCENARIO_BOUNDARIES: readonly ["input", "reducer", "routing", "binding", "cue", "pixels", "caption", "audio", "save-replay"];
|
|
4787
|
+
type ProductionScenarioBoundary = (typeof PRODUCTION_SCENARIO_BOUNDARIES)[number];
|
|
4788
|
+
declare const PRODUCTION_SCENARIO_ERROR_CODES: readonly ["invalid-scenario", "invalid-schema", "unknown-field", "missing-field", "callbacks-forbidden", "missing-participant", "missing-layer", "destroyed", "assertion-failed", "invalid-host-audio", "invalid-audio-sidecar", "unsupported-preference", "invalid-geometry", "ambiguous-geometry", "stale-geometry"];
|
|
4789
|
+
type ProductionScenarioErrorCode = (typeof PRODUCTION_SCENARIO_ERROR_CODES)[number];
|
|
4790
|
+
declare const HOST_OWNED_AUDIO_EVENT_KINDS: readonly ["invoked", "completed", "failed", "skipped", "fallback"];
|
|
4791
|
+
type HostOwnedAudioEventKind = (typeof HOST_OWNED_AUDIO_EVENT_KINDS)[number];
|
|
4792
|
+
declare const PRODUCTION_SCENARIO_VIEWPORT_PRESETS: readonly ["desktop", "mobile"];
|
|
4793
|
+
type ProductionScenarioViewportPreset = (typeof PRODUCTION_SCENARIO_VIEWPORT_PRESETS)[number];
|
|
4794
|
+
declare const DEFAULT_PRODUCTION_SCENARIO_VIEWPORTS: {
|
|
4795
|
+
readonly desktop: {
|
|
4796
|
+
readonly width: 64;
|
|
4797
|
+
readonly height: 48;
|
|
4798
|
+
readonly deviceScaleFactor: 1;
|
|
4799
|
+
};
|
|
4800
|
+
readonly mobile: {
|
|
4801
|
+
readonly width: 48;
|
|
4802
|
+
readonly height: 64;
|
|
4803
|
+
readonly deviceScaleFactor: 2;
|
|
4804
|
+
};
|
|
4805
|
+
};
|
|
4806
|
+
type ProductionScenarioDiagnostic = {
|
|
4807
|
+
code: ProductionScenarioErrorCode | string;
|
|
4808
|
+
detail: string;
|
|
4809
|
+
path?: string;
|
|
4810
|
+
boundary?: ProductionScenarioBoundary;
|
|
4811
|
+
};
|
|
4812
|
+
type ProductionScenarioRequired = {
|
|
4813
|
+
participants: readonly string[];
|
|
4814
|
+
layers: readonly string[];
|
|
4815
|
+
};
|
|
4816
|
+
type ProductionScenarioMatrix = {
|
|
4817
|
+
viewport?: ProductionScenarioViewportPreset;
|
|
4818
|
+
width?: number;
|
|
4819
|
+
height?: number;
|
|
4820
|
+
dpr?: number;
|
|
4821
|
+
reducedMotion?: boolean;
|
|
4822
|
+
mute?: boolean;
|
|
4823
|
+
failedAssetIds?: readonly string[];
|
|
4824
|
+
fallback?: boolean;
|
|
4825
|
+
inputModality?: BrowserInputModality;
|
|
4826
|
+
};
|
|
4827
|
+
type ProductionScenarioStep = {
|
|
4828
|
+
type: 'click';
|
|
4829
|
+
selector?: string;
|
|
4830
|
+
x?: number;
|
|
4831
|
+
y?: number;
|
|
4832
|
+
} | {
|
|
4833
|
+
type: 'key';
|
|
4834
|
+
key: string;
|
|
4835
|
+
} | {
|
|
4836
|
+
type: 'focus';
|
|
4837
|
+
selector: string;
|
|
4838
|
+
} | {
|
|
4839
|
+
type: 'step';
|
|
4840
|
+
frames: number;
|
|
4841
|
+
} | {
|
|
4842
|
+
type: 'viewport';
|
|
4843
|
+
kind?: ProductionScenarioViewportPreset;
|
|
4844
|
+
width?: number;
|
|
4845
|
+
height?: number;
|
|
4846
|
+
dpr?: number;
|
|
4847
|
+
} | {
|
|
4848
|
+
type: 'reducedMotion';
|
|
4849
|
+
value: boolean;
|
|
4850
|
+
} | {
|
|
4851
|
+
type: 'mute';
|
|
4852
|
+
value: boolean;
|
|
4853
|
+
} | {
|
|
4854
|
+
type: 'failAsset';
|
|
4855
|
+
assetId: string;
|
|
4856
|
+
} | {
|
|
4857
|
+
type: 'save';
|
|
4858
|
+
} | {
|
|
4859
|
+
type: 'reload';
|
|
4860
|
+
} | {
|
|
4861
|
+
type: 'replay';
|
|
4862
|
+
};
|
|
4863
|
+
type ProductionScenarioDefinition = {
|
|
4864
|
+
id: string;
|
|
4865
|
+
schemaVersion: typeof PRODUCTION_SCENARIO_SCHEMA_VERSION;
|
|
4866
|
+
seed: string;
|
|
4867
|
+
required: ProductionScenarioRequired;
|
|
4868
|
+
matrix?: ProductionScenarioMatrix;
|
|
4869
|
+
steps?: readonly ProductionScenarioStep[];
|
|
4870
|
+
};
|
|
4871
|
+
type DefineProductionScenarioResult = {
|
|
4872
|
+
ok: true;
|
|
4873
|
+
scenario: ProductionScenarioDefinition;
|
|
4874
|
+
} | {
|
|
4875
|
+
ok: false;
|
|
4876
|
+
errors: ProductionScenarioDiagnostic[];
|
|
4877
|
+
};
|
|
4878
|
+
type ProductionScenarioReduceResult = {
|
|
4879
|
+
accepted: boolean;
|
|
4880
|
+
state: JsonObject;
|
|
4881
|
+
reason?: string;
|
|
4882
|
+
playSequence?: string;
|
|
4883
|
+
};
|
|
4884
|
+
type ProductionScenarioControl = {
|
|
4885
|
+
id: string;
|
|
4886
|
+
name?: string;
|
|
4887
|
+
role?: string;
|
|
4888
|
+
};
|
|
4889
|
+
type ProductionScenarioInputSurface = {
|
|
4890
|
+
controls: readonly ProductionScenarioControl[];
|
|
4891
|
+
geometry: GeometryDocument;
|
|
4892
|
+
};
|
|
4893
|
+
type ProductionScenarioHost = {
|
|
4894
|
+
initialState: JsonObject;
|
|
4895
|
+
reduce(state: JsonObject, intent: EventInput): ProductionScenarioReduceResult;
|
|
4896
|
+
project?(state: JsonObject): JsonObject;
|
|
4897
|
+
/**
|
|
4898
|
+
* Host-generic projection of the active input surface. After an accepted
|
|
4899
|
+
* reduce (and on reload) the runner rebuilds visible/focusable controls and
|
|
4900
|
+
* the geometry document from this result. Omit to keep construction-time
|
|
4901
|
+
* geometry and controls.
|
|
4902
|
+
*/
|
|
4903
|
+
projectInputSurface?(state: JsonObject): ProductionScenarioInputSurface;
|
|
4904
|
+
};
|
|
4905
|
+
type HostOwnedAudioEvent = {
|
|
4906
|
+
kind: HostOwnedAudioEventKind;
|
|
4907
|
+
atFrame?: number;
|
|
4908
|
+
name?: string;
|
|
4909
|
+
caption?: string;
|
|
4910
|
+
assetId?: string;
|
|
4911
|
+
reason?: string;
|
|
4912
|
+
id?: string;
|
|
4913
|
+
correlationId?: string;
|
|
4914
|
+
causationId?: string;
|
|
4915
|
+
};
|
|
4916
|
+
type HostOwnedAudioSnapshot = {
|
|
4917
|
+
events: readonly HostOwnedAudioEvent[];
|
|
4918
|
+
captions?: readonly string[];
|
|
4919
|
+
muted?: boolean;
|
|
4920
|
+
};
|
|
4921
|
+
/**
|
|
4922
|
+
* Host-owned audio/presentation observer. The host already drives the
|
|
4923
|
+
* controller; the runner only snapshots evidence. Generic: no dialogue
|
|
4924
|
+
* product semantics. At least one of `snapshot` or `collect` is required.
|
|
4925
|
+
*/
|
|
4926
|
+
type HostOwnedAudioObserver = {
|
|
4927
|
+
snapshot?(): HostOwnedAudioSnapshot;
|
|
4928
|
+
collect?(): HostOwnedAudioSnapshot;
|
|
4929
|
+
inspect?(): unknown;
|
|
4930
|
+
};
|
|
4931
|
+
type ProductionScenarioLocalization = {
|
|
4932
|
+
boundary: ProductionScenarioBoundary;
|
|
4933
|
+
code: ProductionScenarioErrorCode;
|
|
4934
|
+
detail: string;
|
|
4935
|
+
};
|
|
4936
|
+
declare const REDUCED_MOTION_ACTIVE_SEQUENCE_POLICY: "continue";
|
|
4937
|
+
type ReducedMotionActiveSequencePolicy = typeof REDUCED_MOTION_ACTIVE_SEQUENCE_POLICY;
|
|
4938
|
+
declare const REDUCED_MOTION_PARTICIPANT_IDS: readonly ["browser", "visual", "sequence", "audio", "semantic"];
|
|
4939
|
+
type ReducedMotionParticipantId = (typeof REDUCED_MOTION_PARTICIPANT_IDS)[number];
|
|
4940
|
+
type ReducedMotionParticipantReport = {
|
|
4941
|
+
id: ReducedMotionParticipantId;
|
|
4942
|
+
applied: boolean;
|
|
4943
|
+
reducedMotion?: boolean;
|
|
4944
|
+
reducedSensory?: boolean;
|
|
4945
|
+
reason?: string;
|
|
4946
|
+
};
|
|
4947
|
+
type ReducedMotionPropagation = {
|
|
4948
|
+
from: boolean;
|
|
4949
|
+
to: boolean;
|
|
4950
|
+
activeSequencePolicy: ReducedMotionActiveSequencePolicy;
|
|
4951
|
+
participants: ReducedMotionParticipantReport[];
|
|
4952
|
+
};
|
|
4953
|
+
type ProductionScenarioObservation = {
|
|
4954
|
+
inputDispatched: boolean;
|
|
4955
|
+
inputTarget?: string;
|
|
4956
|
+
reducerAccepted?: boolean;
|
|
4957
|
+
reducerRejected?: boolean;
|
|
4958
|
+
reducerReason?: string;
|
|
4959
|
+
routedTypes: string[];
|
|
4960
|
+
rejected: boolean;
|
|
4961
|
+
selectedBindingIds: string[];
|
|
4962
|
+
sequenceId?: string | null;
|
|
4963
|
+
sequencePhase?: string | null;
|
|
4964
|
+
captions: string[];
|
|
4965
|
+
declaredOrder: string[];
|
|
4966
|
+
requiredParticipantsPresent: boolean;
|
|
4967
|
+
requiredLayersPresent: boolean;
|
|
4968
|
+
missingParticipants: string[];
|
|
4969
|
+
missingLayers: string[];
|
|
4970
|
+
audioInvoked: boolean;
|
|
4971
|
+
audioFailed: boolean;
|
|
4972
|
+
muted: boolean;
|
|
4973
|
+
replayMatch?: boolean;
|
|
4974
|
+
snapshotOk?: boolean;
|
|
4975
|
+
audioRestoreOk?: boolean;
|
|
4976
|
+
reducedMotion?: boolean;
|
|
4977
|
+
reducedMotionPropagation?: ReducedMotionPropagation | null;
|
|
4978
|
+
activeControlIds: string[];
|
|
4979
|
+
};
|
|
4980
|
+
type ProductionScenarioExpectation = {
|
|
4981
|
+
inputDispatched?: boolean;
|
|
4982
|
+
reducerAccepted?: boolean;
|
|
4983
|
+
reducerRejected?: boolean;
|
|
4984
|
+
routedTypes?: readonly string[];
|
|
4985
|
+
selectedBindingIds?: readonly string[];
|
|
4986
|
+
sequenceId?: string;
|
|
4987
|
+
captions?: readonly string[];
|
|
4988
|
+
requiredParticipantsPresent?: boolean;
|
|
4989
|
+
requiredLayersPresent?: boolean;
|
|
4990
|
+
audioInvoked?: boolean;
|
|
4991
|
+
audioFailed?: boolean;
|
|
4992
|
+
replayMatch?: boolean;
|
|
4993
|
+
snapshotOk?: boolean;
|
|
4994
|
+
audioRestoreOk?: boolean;
|
|
4995
|
+
};
|
|
4996
|
+
type ProductionScenarioEvidenceBundle = {
|
|
4997
|
+
schemaVersion: typeof PRODUCTION_SCENARIO_SNAPSHOT_SCHEMA_VERSION;
|
|
4998
|
+
scenarioId: string;
|
|
4999
|
+
seed: string;
|
|
5000
|
+
matrix: Required<Pick<ProductionScenarioMatrix, 'viewport' | 'width' | 'height' | 'dpr'>> & ProductionScenarioMatrix;
|
|
5001
|
+
hashes: {
|
|
5002
|
+
pixels: string;
|
|
5003
|
+
semantic: string;
|
|
5004
|
+
a11y: string;
|
|
5005
|
+
trace: string;
|
|
5006
|
+
snapshot: string;
|
|
5007
|
+
assets: string;
|
|
5008
|
+
};
|
|
5009
|
+
revisions: {
|
|
5010
|
+
world: string | number | null;
|
|
5011
|
+
bindings: string | number | null;
|
|
5012
|
+
snapshot: number;
|
|
5013
|
+
};
|
|
5014
|
+
traces: {
|
|
5015
|
+
envelopes: EventEnvelope[];
|
|
5016
|
+
inspector: InspectorRecord[];
|
|
5017
|
+
audio: AudioCueEvent[];
|
|
5018
|
+
hostAudio: HostOwnedAudioEvent[];
|
|
5019
|
+
actions: ProductionScenarioStep[];
|
|
5020
|
+
};
|
|
5021
|
+
screenshot: {
|
|
5022
|
+
pngDataUrl: string | null;
|
|
5023
|
+
declaredOrder: string[];
|
|
5024
|
+
width: number;
|
|
5025
|
+
height: number;
|
|
5026
|
+
};
|
|
5027
|
+
semantic: SemanticPublishedRegion[];
|
|
5028
|
+
a11y: BrowserA11ySnapshot;
|
|
5029
|
+
firstBrokenBoundary: ProductionScenarioBoundary | null;
|
|
5030
|
+
localization: ProductionScenarioLocalization | null;
|
|
5031
|
+
participants: string[];
|
|
5032
|
+
layers: string[];
|
|
5033
|
+
observation: ProductionScenarioObservation;
|
|
5034
|
+
selectionTrace?: SelectionTraceExport | null;
|
|
5035
|
+
};
|
|
5036
|
+
type CreateProductionScenarioRunnerOptions = {
|
|
5037
|
+
scenario: ProductionScenarioDefinition | unknown;
|
|
5038
|
+
participants: RuntimeGroupParticipantConfig[];
|
|
5039
|
+
compositorLayers: CompositorLayerConfig[];
|
|
5040
|
+
visualLayers?: readonly VisualLayerDeclaration[];
|
|
5041
|
+
visualSources?: Readonly<Record<string, ImageData>>;
|
|
5042
|
+
semanticRegions?: readonly SemanticRegionDeclaration[];
|
|
5043
|
+
sequences?: readonly PresentationSequenceDefinition[];
|
|
5044
|
+
bindings?: PresentationBindingManifest | unknown;
|
|
5045
|
+
geometry?: GeometryDocument;
|
|
5046
|
+
host: ProductionScenarioHost;
|
|
5047
|
+
/**
|
|
5048
|
+
* Optional host-owned audio observer. When supplied, the runner records
|
|
5049
|
+
* invocation / completion / failure / skip / fallback evidence from this
|
|
5050
|
+
* adapter without requiring a presentation sequence for the same beat.
|
|
5051
|
+
* Invalid adapters fail closed at boundary `audio`.
|
|
5052
|
+
*/
|
|
5053
|
+
hostAudio?: HostOwnedAudioObserver;
|
|
5054
|
+
sequenceBindings?: Readonly<Record<string, PresentationSequenceBindings>>;
|
|
5055
|
+
contentWidth?: number;
|
|
5056
|
+
contentHeight?: number;
|
|
5057
|
+
origin?: number;
|
|
5058
|
+
createId?: () => string;
|
|
5059
|
+
mapClick?: (hotspotId: string) => EventInput;
|
|
5060
|
+
mapKey?: (key: string) => EventInput | undefined;
|
|
5061
|
+
router?: Pick<EventRouter, 'publish'>;
|
|
5062
|
+
};
|
|
5063
|
+
type ProductionScenarioRunner = {
|
|
5064
|
+
readonly scenario: ProductionScenarioDefinition;
|
|
5065
|
+
readonly harness: BrowserHarness;
|
|
5066
|
+
readonly audio: HeadlessAudioAdapter;
|
|
5067
|
+
readonly inspector: ReplayInspector;
|
|
5068
|
+
goto(): void;
|
|
5069
|
+
click(selectorOrX: string | number, y?: number): void;
|
|
5070
|
+
key(key: string): void;
|
|
5071
|
+
focus(selector: string): void;
|
|
5072
|
+
setViewport(width: number, height: number, dpr?: number): void;
|
|
5073
|
+
setReducedMotion(value: boolean): void;
|
|
5074
|
+
mute(value?: boolean): void;
|
|
5075
|
+
failAsset(assetId: string): void;
|
|
5076
|
+
step(frames?: number): Promise<void>;
|
|
5077
|
+
applyHostIntent(intent: EventInput): ProductionScenarioReduceResult;
|
|
5078
|
+
playSequence(sequenceId: string, invocationId?: string): void;
|
|
5079
|
+
publish(event: EventInput): EventEnvelope | undefined;
|
|
5080
|
+
save(): SnapshotEnvelope;
|
|
5081
|
+
reload(snapshot?: SnapshotEnvelope): void;
|
|
5082
|
+
replay(): Promise<ReplayCompareResult>;
|
|
5083
|
+
run(steps?: readonly ProductionScenarioStep[]): Promise<ProductionScenarioEvidenceBundle>;
|
|
5084
|
+
captureEvidence(expected?: ProductionScenarioExpectation): ProductionScenarioEvidenceBundle;
|
|
5085
|
+
inspect(): {
|
|
5086
|
+
host: JsonObject;
|
|
5087
|
+
lastDecision: ProductionScenarioReduceResult | null;
|
|
5088
|
+
bindings: ReturnType<PresentationBindingRuntime['inspect']> | null;
|
|
5089
|
+
sequences: ReturnType<PresentationSequencePlayer['inspect']> | null;
|
|
5090
|
+
visual: ReturnType<VisualLayerController['inspect']> | null;
|
|
5091
|
+
semantic: ReturnType<SemanticLayerController['inspect']> | null;
|
|
5092
|
+
audio: ReturnType<HeadlessAudioAdapter['snapshot']>;
|
|
5093
|
+
hostAudio: HostOwnedAudioSnapshot | null;
|
|
5094
|
+
participants: string[];
|
|
5095
|
+
layers: string[];
|
|
5096
|
+
composition: ProductionScenarioLocalization | null;
|
|
5097
|
+
reducedMotion: boolean;
|
|
5098
|
+
reducedMotionPropagation: ReducedMotionPropagation | null;
|
|
5099
|
+
inputSurface: {
|
|
5100
|
+
controlIds: string[];
|
|
5101
|
+
geometry: GeometryDocument | null;
|
|
5102
|
+
};
|
|
5103
|
+
};
|
|
5104
|
+
destroy(): void;
|
|
5105
|
+
};
|
|
5106
|
+
declare function productionScenarioEventContracts(): EventContract[];
|
|
5107
|
+
declare function isProductionScenarioEventType(value: unknown): value is ProductionScenarioEventType;
|
|
5108
|
+
declare function isProductionScenarioErrorCode(value: unknown): value is ProductionScenarioErrorCode;
|
|
5109
|
+
declare function isProductionScenarioBoundary(value: unknown): value is ProductionScenarioBoundary;
|
|
5110
|
+
declare function isHostOwnedAudioEventKind(value: unknown): value is HostOwnedAudioEventKind;
|
|
5111
|
+
declare function defineProductionScenario(input: unknown): DefineProductionScenarioResult;
|
|
5112
|
+
declare function fnv1aHex(data: string | Uint8Array): string;
|
|
5113
|
+
declare function localizeProductionScenarioFailure(observed: ProductionScenarioObservation, expected?: ProductionScenarioExpectation): ProductionScenarioLocalization | null;
|
|
5114
|
+
declare function createProductionScenarioRunner(options: CreateProductionScenarioRunnerOptions): ProductionScenarioRunner;
|
|
5115
|
+
|
|
2656
5116
|
/**
|
|
2657
5117
|
* Copyright (c) 2026 Aaron Boyarsky
|
|
2658
5118
|
* SPDX-License-Identifier: LicenseRef-CyberArt-Engine
|
|
@@ -2843,4 +5303,4 @@ declare class MidiManager {
|
|
|
2843
5303
|
private detachHardware;
|
|
2844
5304
|
}
|
|
2845
5305
|
|
|
2846
|
-
export { ANCHOR_ORIGINS, ASSET_FAILED_EVENT, ASSET_FAILURE_CODES, ASSET_KINDS, ASSET_READY_EVENT, AUDIO_CUE_EVENTS, AUDIO_CUE_FAILED_EVENT, AUDIO_CUE_SCHEDULED_EVENT, AUDIO_CUE_SKIPPED_EVENT, AUDIO_CUE_STARTED_EVENT, type ActiveAudioCue, type AnchorOrigin, type AnimationCart, type AnimationTiming, type AppliedAction, type ApplySnapshotMigrationsResult, type AssetCorsMode, type AssetDeclaration, type AssetFailure, type AssetFailureCode, type AssetItemStatus, type AssetKind, type AssetPreloadSnapshot, type AssetPreloader, type AssetProvenance, type AssetResolveRequest, type AssetResolver, type AssetRuntimeOptions, type AttachOptions, type AttachPresentationAdapterOptions, type AudioAssetStatus, type AudioBroker, type AudioBrokerInspect, type AudioBrokerListener, type AudioBrokerNotice, type AudioChannelInspect, type AudioCueEvent, type AudioCueEventType, type AudioCueFailReason, type AudioCueReason, type AudioCueSkipReason, type AudioCueSpec, type AudioCueTimeline, type AudioCueTimelineSnapshot, type AudioCueView, type AudioLibraryId, type AudioLibrarySpec, type AudioUnlockState, type AudioUnlockStatus, type BoundReplaySession, type BrowserA11ySnapshot, type BrowserCompositorConfig, type BrowserHarness, type BrowserHarnessAction, type BrowserHarnessInspect, type BrowserHarnessMountContext, type BrowserHarnessRuntimeContext, type BrowserHarnessScreenshot, type BrowserHostSession, type BrowserInputModality, type BrowserReproductionMetadata, type BrowserViewport, CAPABILITY_ASSET_KINDS, CAPABILITY_BLEND_MODES, CAPABILITY_CART_KINDS, CAPABILITY_CLEAR_POLICIES, CAPABILITY_INTEGRATIONS, CAPABILITY_MANAGERS, CAPABILITY_MANIFEST_VERSION, CAPABILITY_PHASES, COMPOSITOR_BLEND_MODES, COMPOSITOR_CLEAR_POLICIES, COMPOSITOR_SOURCE_KINDS, COORDINATE_SPACES, CUE_CANCELLED_EVENT, CUE_COMPLETED_EVENT, CUE_LIFECYCLE_EVENTS, CUE_REPLACED_EVENT, CUE_STARTED_EVENT, CYBERART_CANVAS_ATTR, type CapabilityAssetDeclarationSummary, type CapabilityAssetKind, type CapabilityAssetSummary, type CapabilityBlendMode, type CapabilityCartKind, type CapabilityClearPolicy, type CapabilityDiagnostic, type CapabilityIntegration, type CapabilityLayerRequirements, type CapabilityManager, type CapabilityManifest, type CapabilityManifestInput, type CapabilityModuleRef, type CapabilityModuleRequirements, type CapabilityPermissions, type CapabilityPhase, type CapabilityRuntime, type CapabilitySurfaceRequirements, type CartHandle, type CartKind, type CartSnapshot, type CartStateBundle, type CartStateHotkeyOptions, type CartStateMessageHandler, type CartStatePersister, type CausationTreeNode, type Clock, type ClockSnapshot, type ComposedFrame, type Compositor, type CompositorBlendMode, type CompositorCanvasSource, type CompositorClearPolicy, type CompositorClip, type CompositorHostOptions, type CompositorImageSource, type CompositorInspect, type CompositorLayerConfig, type CompositorLayerInspect, type CompositorLayerSource, type CompositorParticipantSource, type CompositorPointerEvents, type CompositorSourceKind, type ContractDiagnostic, type ContractFieldType, type ContractRegistry, type CoordinateSpace, type CreateAssetPreloaderOptions, type CreateAudioBrokerOptions, type CreateAudioCueTimelineOptions, type CreateBrowserHarnessOptions, type CreateCompositorOptions, type CreateExecutableModuleHostOptions, type CreatePresentationLayoutInput, type CreatePresentationTimelineOptions, type CreateReplayInspectorOptions, type CreateRuntimeGroupOptions, type CreateRuntimeOptions, type CreateVisualLayerControllerOptions, type CueDuplicatePolicy, type CueEasing, type CueLifecycleEvent, type CueLifecycleType, type CuePhase, type CueReducedMotionPolicy, type CueRepeatPolicy, type CueSpec, type CueTimelineSnapshot, type CueView, type CyberArtRuntime, DEFAULT_BROWSER_VIEWPORT, DEFAULT_DUCK_GAIN, DEFAULT_GROUP_HEIGHT, DEFAULT_GROUP_WIDTH, DEFAULT_MAX_HOPS, DEFAULT_MAX_INSPECTOR_RECORDS, type DebugDrawCall, type DefineCapabilityManifestResult, type DefineContractResult, type DefineSnapshotResult, type DeterministicRuntimeOptions, type DimensionContext, ENGINE_SNAPSHOT_RUNTIME, EVENT_ENVELOPE_VERSION, EXECUTABLE_MODULE_ERROR_CODES, type EventContract, type EventContractManifest, type EventEnvelope, type EventInput, type EventKind, type EventRouter, type EventRouterOptions, type ExecutableModuleCapabilities, type ExecutableModuleDiagnostic, type ExecutableModuleError, type ExecutableModuleErrorCode, type ExecutableModuleFactory, type ExecutableModuleHost, type ExecutableModuleHostInspect, type ExecutableModuleInstance, type ExecutableModuleInvokeContext, type ExecutableModuleInvokeResult, type ExecutableModuleLimits, type ExecutableModuleLoadResult, type ExecutableModuleRef, type ExecutableModuleRegistration, type ExportSnapshotOptions, type FixtureAssetCatalog, type FixtureAssetRecord, type FrameErrorInfo, type FrameTimingSample, GEOMETRY_CONTRACT_VERSION, type GeometryAnchor, type GeometryDebugContext, type GeometryDiagnostic, type GeometryDocument, type GeometryHitbox, type GeometryPadding, type GeometrySafeArea, type GeometryValidation, HOST_STATE_ACCEPTED_EVENT, type HeadlessAudioAdapter, type HostCapabilities, HostChannel, type HostEvent, type HostEventListener, type HostedAssetResolverOptions, INVALID_PRESENTATION_MODEL_MESSAGE, type ImportCartStateExtras, IncompatibleCartStateError, type InferredPayload, type InspectorRecord, KeyboardManager, LEGACY_SNAPSHOT_SCHEMA_VERSION, type LandmarkRegisterResult, type LandmarkRegistry, type LegacySnapshot, MIDI_CHANNEL_MAX, MIDI_CHANNEL_MIN, MIDI_CONTROL_CHANGE, MIDI_DATA_MAX, MIDI_NOTE_OFF, MIDI_NOTE_ON, MIDI_PITCH_BEND, MIDI_PITCH_CENTER, MIDI_PITCH_MAX, type MidiAccessFailureReason, type MidiAccessLike, type MidiAccessResult, type MidiCcMessage, type MidiChannel, type MidiInjectInput, type MidiInputLike, MidiManager, type MidiManagerOptions, type MidiMessage, type MidiNoteMessage, type MidiOutputPort, type MidiPitchMessage, type MidiRawMessage, type MidiRequestAccess, type MidiSendFailureReason, type MidiSendResult, type MidiStatusByte, type MidiSubscribeKind, type MidiSubscribeListener, type MidiVoiceInput, type MountOptions, type MountPresentationAdapterOptions, type NormalizeContext, type NormalizeResult, type NormalizedPoint, type NormalizedPolygon, type NormalizedRect, PRESENTATION_ADAPTER_VERSION, PRESENTATION_MODEL_EVENT, PRESENTATION_PHASES, PRESENTATION_SUBSCRIBE_PATTERNS, PRESENTATION_UNSUPPORTED_EVENT, type ParseSnapshotResult, type PayloadFieldSpec, type PayloadSchema, type PayloadValidation, type PixelPoint, type PixelRect, type PlayAudioCueResult, type PlayCueResult, type PlayVisualLayerResult, type PlaywrightCompatibleAdapter, type PlaywrightCompatibleViewport, type PointerClick, PointerManager, type PointerSpace, type PresentationAdapter, type PresentationAdapterTarget, type PresentationCartState, type PresentationFitMode, type PresentationLayout, type PresentationModel, type PresentationPhase, type PresentationRegion, type PresentationTimeline, type PresentationView, type PublishExtras, REDACTED_VALUE, REJECTED_EVENT_TYPE, REPLAY_INSPECTOR_SCHEMA_VERSION, ROUND_TRIP_TOLERANCE, ROUND_TRIP_TOLERANCE_CANVAS_PX, Random, type RandomState, type RejectionPayload, type RejectionReason, type ReplayCompareResult, type ReplayInspector, type ReplayInspectorExport, type ReplayInspectorReport, type ReplayMetadata, type ReplayParticipantSummary, type ReplayTapeAction, type ReplayTraceFilter, type ResolveImportableCartStateResult, type ResolvedAsset, type RestoreVisualLayerResult, type RouterDecision, type RouterDecisionOutcome, type RouterDecisionReason, type RouterParticipantInspect, type RuntimeGroup, type RuntimeGroupCapability, type RuntimeGroupDiagnostics, type RuntimeGroupFrameError, type RuntimeGroupInspect, type RuntimeGroupKind, type RuntimeGroupParticipantConfig, type RuntimeGroupParticipantHandle, type RuntimeGroupParticipantInspect, SILENT_ASSET_FALLBACK_REF, SNAPSHOT_SCHEMA_VERSION, type SchemaCompatibility, type ScriptedAction, type SnapshotAssetRef, type SnapshotCartRef, type SnapshotClock, type SnapshotDiagnostic, type SnapshotEnvelope, type SnapshotEnvelopeInput, type SnapshotIntegrity, type SnapshotMigration, type SnapshotMigrationRegistry, type SnapshotModuleRef, type SnapshotProvenance, type TokenData, UNVERSIONED_CART_VERSION, VISUAL_LAYER_EVENTS, VISUAL_LAYER_FAILED_EVENT, VISUAL_LAYER_FAILURE_CODES, VISUAL_LAYER_HIDDEN_EVENT, VISUAL_LAYER_INCOMING_SUFFIX, VISUAL_LAYER_KINDS, VISUAL_LAYER_REVEALED_EVENT, VISUAL_LAYER_SNAPSHOT_SCHEMA_VERSION, VISUAL_LAYER_TRANSITIONS, VISUAL_LAYER_TRANSITION_COMPLETED_EVENT, VISUAL_LAYER_TRANSITION_STARTED_EVENT, type ValidateCapabilityManifestResult, type ValidateResult, type ValidateSnapshotResult, type VersionedSnapshot, type VirtualClock, type VisualLayerAcceptedBinding, type VisualLayerAssetStatus, type VisualLayerCapture, type VisualLayerController, type VisualLayerControllerSnapshot, type VisualLayerCueSpec, type VisualLayerDeclaration, type VisualLayerDiagnostic, type VisualLayerEvent, type VisualLayerEventType, type VisualLayerFailureCode, type VisualLayerFallbackPolicy, type VisualLayerInspect, type VisualLayerKind, type VisualLayerSnapshotRow, type VisualLayerTransitionInspect, type VisualLayerTransitionKind, type VisualLayerVersionDeclaration, applyCueEasing, applySnapshotMigrations, assetStatusEvent, assetToNormalized, attachCartStatePersistence, attachPresentationAdapter, canonicalizeSeed, canvasToCss, canvasToNormalized, toJSON as capabilityManifestToJSON, captureVisualLayers, cloneSnapshotJson, comparePayloadSchemas, compareReplayTraces, createAssetFailure, createAssetPreloader, createAudioBroker, createAudioCueTimeline, createBrowserHarness, createCompositor, createContractRegistry, createEngineSnapshotMigrations, createEventRouter, createExecutableModuleHost, createFixtureAssetResolver, createHeadlessAudioAdapter, createHostedAssetResolver, createLandmarkRegistry, createPlaywrightCompatibleAdapter, createPresentationLayout, createPresentationModelEvent, createPresentationTimeline, createReferencePresentationCart, createReplayInspector, createRuntime, createRuntimeGroup, createSnapshotMigrationRegistry, createVirtualClock, createVisualLayerController, createWallClock, cssToCanvas, cssToNormalized, defaultSnapshotMigrationRegistry, defineCapabilityManifest, defineDiagnostic, defineIntent, defineSnapshot, defineStateEvent, deriveAttachOptions, describeReplayMismatch, detectSnapshotSchemaVersion, drawGeometryDebug, encodeMidiMessage, engineStateFromEnvelope, familyPatternForType, inferEventKind, isAssetFailure, isAssetFailureCode, isAssetKind, isAudioCueEventType, isCueLifecycleType, isLegacyCartStateBundle, isMidiChannel, isMidiData, isPresentationModel, isPresentationPhase, isSnapshotEnvelope, isVersionedSnapshot, isVisualLayerEventType, isVisualLayerKind, isVisualLayerTransitionKind, kindSegmentInType, matchEventPattern, midiChannelFromStatus, midiStatus, mountPresentationAdapter, normalizeEvent, normalizedToAsset, normalizedToCanvas, normalizedToCss, parseCapabilityManifest, parseGeometry, parseMidiBytes, parseSnapshot, pointFromOrigin, pointerToRegion, rectToCanvas, rectToCss, regionToViewport, registerCartStateHotkeys, replayExportedTrace, resolveImportableCartState, resolveRuntimeSeed, restoreSnapshotFromUnknown, rewriteHostedAssetRef, scheduleAudioCue, serializeGeometry, snapshotErrorsToMessage, snapshotFromCartBundle, validateCapabilityManifest, validateGeometry, validateSnapshot, verifyAttachOptions, visualIncomingLayerId };
|
|
5306
|
+
export { ANCHOR_ORIGINS, ASSET_FAILED_EVENT, ASSET_FAILURE_CODES, ASSET_KINDS, ASSET_READY_EVENT, AUDIO_CUE_EVENTS, AUDIO_CUE_FAILED_EVENT, AUDIO_CUE_SCHEDULED_EVENT, AUDIO_CUE_SKIPPED_EVENT, AUDIO_CUE_SNAPSHOT_SCHEMA_VERSION, AUDIO_CUE_STARTED_EVENT, type ActivateContentRevisionRequest, type ActiveAudioCue, type AnchorOrigin, type AnimationCart, type AnimationTiming, type AppliedAction, type ApplyPresentationBindingsResult, type ApplySnapshotMigrationsResult, type AssetCorsMode, type AssetDeclaration, type AssetFailure, type AssetFailureCode, type AssetItemStatus, type AssetKind, type AssetPreloadSnapshot, type AssetPreloader, type AssetProvenance, type AssetResolveRequest, type AssetResolver, type AssetRuntimeOptions, type AttachOptions, type AttachPresentationAdapterOptions, type AudioAssetStatus, type AudioBroker, type AudioBrokerInspect, type AudioBrokerListener, type AudioBrokerNotice, type AudioChannelInspect, type AudioCueDiagnostic, type AudioCueEvent, type AudioCueEventType, type AudioCueFailReason, type AudioCueReason, type AudioCueSkipReason, type AudioCueSpec, type AudioCueTimeline, type AudioCueTimelineSnapshot, type AudioCueView, type AudioLibraryId, type AudioLibrarySpec, type AudioUnlockState, type AudioUnlockStatus, type BoundReplaySession, type BrowserA11ySnapshot, type BrowserCompositorConfig, type BrowserHarness, type BrowserHarnessAction, type BrowserHarnessInspect, type BrowserHarnessMountContext, type BrowserHarnessRuntimeContext, type BrowserHarnessScreenshot, type BrowserHostSession, type BrowserInputModality, type BrowserReproductionMetadata, type BrowserViewport, CAPABILITY_ASSET_KINDS, CAPABILITY_BLEND_MODES, CAPABILITY_CART_KINDS, CAPABILITY_CLEAR_POLICIES, CAPABILITY_DEVICE_GRANTS, CAPABILITY_INTEGRATIONS, CAPABILITY_MANAGERS, CAPABILITY_MANIFEST_VERSION, CAPABILITY_PHASES, COMPOSITOR_BLEND_MODES, COMPOSITOR_CLEAR_POLICIES, COMPOSITOR_SOURCE_KINDS, CONTENT_REVISION_ACTIVATED_EVENT, CONTENT_REVISION_DIAGNOSTIC_EVENT, CONTENT_REVISION_DISCOVERED_EVENT, CONTENT_REVISION_ERROR_CODES, CONTENT_REVISION_EVENTS, CONTENT_REVISION_MANIFEST_VERSION, CONTENT_REVISION_REJECTED_EVENT, CONTENT_REVISION_ROLLED_BACK_EVENT, CONTENT_REVISION_SNAPSHOT_SCHEMA_VERSION, CONTENT_REVISION_STAGING_EVENT, CONTENT_REVISION_SUPERSEDED_EVENT, CONTENT_REVISION_VALIDATED_EVENT, COORDINATE_SPACES, CUE_CANCELLED_EVENT, CUE_COMPLETED_EVENT, CUE_LIFECYCLE_EVENTS, CUE_REPLACED_EVENT, CUE_STARTED_EVENT, CYBERART_CANVAS_ATTR, type CapabilityAssetDeclarationSummary, type CapabilityAssetKind, type CapabilityAssetSummary, type CapabilityBlendMode, type CapabilityCartKind, type CapabilityClearPolicy, type CapabilityDeviceGrant, type CapabilityDiagnostic, type CapabilityIntegration, type CapabilityLayerRequirements, type CapabilityManager, type CapabilityManifest, type CapabilityManifestInput, type CapabilityModuleRef, type CapabilityModuleRequirements, type CapabilityPermissions, type CapabilityPhase, type CapabilityRuntime, type CapabilitySurfaceRequirements, type CartHandle, type CartKind, type CartSnapshot, type CartStateBundle, type CartStateHotkeyOptions, type CartStateMessageHandler, type CartStatePersister, type CausationTreeNode, type Clock, type ClockSnapshot, type ComposedFrame, type Compositor, type CompositorBlendMode, type CompositorCanvasSource, type CompositorClearPolicy, type CompositorClip, type CompositorHostOptions, type CompositorImageSource, type CompositorInspect, type CompositorLayerConfig, type CompositorLayerInspect, type CompositorLayerSource, type CompositorParticipantSource, type CompositorPointerEvents, type CompositorSourceKind, type ContentRegistryAdapter, type ContentRevisionActivator, type ContentRevisionAssetDecl, type ContentRevisionBundle, type ContentRevisionCatalog, type ContentRevisionDescriptor, type ContentRevisionDiagnostic, type ContentRevisionErrorCode, type ContentRevisionEventType, type ContentRevisionInspect, type ContentRevisionMutationResult, type ContentRevisionResource, type ContentRevisionSnapshot, type ContentRevisionStagingView, type ContractDiagnostic, type ContractFieldType, type ContractRegistry, type CoordinateSpace, type CreateAssetPreloaderOptions, type CreateAudioBrokerOptions, type CreateAudioCueTimelineOptions, type CreateBrowserHarnessOptions, type CreateCompositorOptions, type CreateContentRevisionActivatorOptions, type CreateExecutableModuleHostOptions, type CreateJobCoordinatorOptions, type CreatePortalLifecycleOptions, type CreatePresentationBindingRuntimeOptions, type CreatePresentationLayoutInput, type CreatePresentationSequencePlayerOptions, type CreatePresentationTimelineOptions, type CreateProductionScenarioRunnerOptions, type CreateRemoteCartSandboxOptions, type CreateRemoteContentAdapterOptions, type CreateReplayInspectorOptions, type CreateRuntimeGroupOptions, type CreateRuntimeOptions, type CreateSelectionTraceOptions, type CreateSemanticLayerControllerOptions, type CreateStaticContentAdapterOptions, type CreateVisualLayerControllerOptions, type CreateWorldGraphOptions, type CreateWorldPatchApplierOptions, type CueDuplicatePolicy, type CueEasing, type CueLifecycleEvent, type CueLifecycleType, type CuePhase, type CueReducedMotionPolicy, type CueRepeatPolicy, type CueSpec, type CueTimelineSnapshot, type CueView, type CyberArtRuntime, DEFAULT_BROWSER_VIEWPORT, DEFAULT_DUCK_GAIN, DEFAULT_GROUP_HEIGHT, DEFAULT_GROUP_WIDTH, DEFAULT_MAX_HOPS, DEFAULT_MAX_INSPECTOR_RECORDS, DEFAULT_MAX_SELECTION_RECORDS, DEFAULT_PORTAL_MAX_DEPTH, DEFAULT_PRODUCTION_SCENARIO_VIEWPORTS, DEFAULT_SENSITIVE_KEYS, type DebugDrawCall, type DeclaredAssetBytes, type DeclaredAssetResolverOptions, type DefineCapabilityManifestResult, type DefineContractResult, type DefinePresentationBindingsResult, type DefinePresentationSequenceResult, type DefineProductionScenarioResult, type DefineRemoteCartResult, type DefineSnapshotResult, type DeterministicRuntimeOptions, type DimensionContext, ENGINE_SNAPSHOT_RUNTIME, EVENT_ENVELOPE_VERSION, EXECUTABLE_MODULE_ERROR_CODES, type EventContract, type EventContractManifest, type EventEnvelope, type EventInput, type EventKind, type EventRouter, type EventRouterOptions, type ExecutableModuleCapabilities, type ExecutableModuleDiagnostic, type ExecutableModuleError, type ExecutableModuleErrorCode, type ExecutableModuleFactory, type ExecutableModuleHost, type ExecutableModuleHostInspect, type ExecutableModuleInstance, type ExecutableModuleInvokeContext, type ExecutableModuleInvokeResult, type ExecutableModuleLimits, type ExecutableModuleLoadResult, type ExecutableModuleRef, type ExecutableModuleRegistration, type ExportSnapshotOptions, type FixtureAssetCatalog, type FixtureAssetRecord, type FrameErrorInfo, type FrameTimingSample, GEOMETRY_CONTRACT_VERSION, type GeometryAnchor, type GeometryDebugContext, type GeometryDiagnostic, type GeometryDocument, type GeometryHitbox, type GeometryPadding, type GeometrySafeArea, type GeometryValidation, HOST_GRANT_SNAPSHOT_SCHEMA_VERSION, HOST_OWNED_AUDIO_EVENT_KINDS, HOST_STATE_ACCEPTED_EVENT, type HeadlessAudioAdapter, type HeadlessAudioAdapterSnapshot, type HeadlessJobWorker, type HostCapabilities, HostChannel, type HostEvent, type HostEventListener, type HostGrantRestoreResult, type HostGrantSet, type HostGrantSnapshot, type HostOwnedAudioEvent, type HostOwnedAudioEventKind, type HostOwnedAudioObserver, type HostOwnedAudioSnapshot, type HostPresentationOverride, type HostedAssetResolverOptions, INVALID_PRESENTATION_MODEL_MESSAGE, type ImportCartStateExtras, IncompatibleCartStateError, type InferredPayload, type InspectorRecord, JOB_APPLIED_EVENT, JOB_AWAITING_EVALUATION_EVENT, JOB_CANCELED_EVENT, JOB_CLAIMED_EVENT, JOB_DIAGNOSTIC_EVENT, JOB_EVALUATOR_DECISIONS, JOB_FAILED_EVENT, JOB_LIFECYCLE_EVENTS, JOB_ORCHESTRATION_SNAPSHOT_SCHEMA_VERSION, JOB_PROGRESS_EVENT, JOB_QUEUED_EVENT, JOB_READY_EVENT, JOB_REDACTED_KEYS, JOB_RESULT_REF_SCHEMA_VERSION, JOB_RETRYABILITY, JOB_RETRY_SCHEDULED_EVENT, JOB_STATES, JOB_SUBMITTED_EVENT, JOB_SUPERSEDED_EVENT, type JobCoordinator, type JobCoordinatorSnapshot, type JobDefinition, type JobDiagnostic, type JobEvaluatorDecision, type JobFailureRecord, type JobInspect, type JobLifecycleEventType, type JobMutationResult, type JobPersistenceAdapter, type JobProgress, type JobRecord, type JobResultRef, type JobRetryPolicy, type JobRetryability, type JobState, type JobSubmitRequest, type JobWorkerAdapter, type JsonObject, type JsonPrimitive, type JsonValue, KeyboardManager, LEGACY_SNAPSHOT_SCHEMA_VERSION, type LandmarkRegisterResult, type LandmarkRegistry, type LegacySnapshot, type LoadRemoteCartOptions, MIDI_CHANNEL_MAX, MIDI_CHANNEL_MIN, MIDI_CONTROL_CHANGE, MIDI_DATA_MAX, MIDI_NOTE_OFF, MIDI_NOTE_ON, MIDI_PITCH_BEND, MIDI_PITCH_CENTER, MIDI_PITCH_MAX, type MidiAccessFailureReason, type MidiAccessLike, type MidiAccessResult, type MidiCcMessage, type MidiChannel, type MidiInjectInput, type MidiInputLike, MidiManager, type MidiManagerOptions, type MidiMessage, type MidiNoteMessage, type MidiOutputPort, type MidiPitchMessage, type MidiRawMessage, type MidiRequestAccess, type MidiSendFailureReason, type MidiSendResult, type MidiStatusByte, type MidiSubscribeKind, type MidiSubscribeListener, type MidiVoiceInput, type MountOptions, type MountPresentationAdapterOptions, type NormalizeContext, type NormalizeResult, type NormalizedPoint, type NormalizedPolygon, type NormalizedRect, PORTAL_ABORTED_EVENT, PORTAL_ENTERED_EVENT, PORTAL_EXCLUSIVE_GRANTS, PORTAL_EXITED_EVENT, PORTAL_LIFECYCLE_EVENTS, PORTAL_LIFECYCLE_SNAPSHOT_SCHEMA_VERSION, PORTAL_METAPHORS, PORTAL_OUTCOME_KINDS, PORTAL_OUTCOME_SCHEMA_VERSION, PRESENTATION_ADAPTER_VERSION, PRESENTATION_AUDIO_CAPABILITY_STATUSES, PRESENTATION_BINDING_APPLIED_EVENT, PRESENTATION_BINDING_DIAGNOSTIC_EVENT, PRESENTATION_BINDING_ERROR_CODES, PRESENTATION_BINDING_EVENTS, PRESENTATION_BINDING_MANIFEST_VERSION, PRESENTATION_BINDING_REJECTED_EVENT, PRESENTATION_BINDING_SNAPSHOT_SCHEMA_VERSION, PRESENTATION_BINDING_TARGET_KINDS, PRESENTATION_COMPLETION_RULES, PRESENTATION_INTERRUPTION_POLICIES, PRESENTATION_INVOCATION_PHASES, PRESENTATION_MODEL_EVENT, PRESENTATION_PHASES, PRESENTATION_SEQUENCE_COMPLETED_EVENT, PRESENTATION_SEQUENCE_DIAGNOSTIC_EVENT, PRESENTATION_SEQUENCE_EVENTS, PRESENTATION_SEQUENCE_FAILED_EVENT, PRESENTATION_SEQUENCE_INTERRUPTED_EVENT, PRESENTATION_SEQUENCE_PRELOADING_EVENT, PRESENTATION_SEQUENCE_READY_EVENT, PRESENTATION_SEQUENCE_REQUESTED_EVENT, PRESENTATION_SEQUENCE_SKIPPED_EVENT, PRESENTATION_SEQUENCE_SNAPSHOT_SCHEMA_VERSION, PRESENTATION_SEQUENCE_STARTED_EVENT, PRESENTATION_SEQUENCE_STEP_COMPLETED_EVENT, PRESENTATION_SEQUENCE_STEP_STARTED_EVENT, PRESENTATION_SUBSCRIBE_PATTERNS, PRESENTATION_TRACK_KINDS, PRESENTATION_UNSUPPORTED_EVENT, PRODUCTION_SCENARIO_BOUNDARIES, PRODUCTION_SCENARIO_DIAGNOSTIC_EVENT, PRODUCTION_SCENARIO_ERROR_CODES, PRODUCTION_SCENARIO_EVENTS, PRODUCTION_SCENARIO_FAILED_EVENT, PRODUCTION_SCENARIO_OBSERVED_EVENT, PRODUCTION_SCENARIO_SCHEMA_VERSION, PRODUCTION_SCENARIO_SNAPSHOT_SCHEMA_VERSION, PRODUCTION_SCENARIO_VIEWPORT_PRESETS, type ParseSnapshotResult, type PayloadFieldSpec, type PayloadSchema, type PayloadValidation, type PixelPoint, type PixelRect, type PlayAudioCueResult, type PlayCueResult, type PlaySequenceOptions, type PlaySequenceResult, type PlayVisualLayerResult, type PlaywrightCompatibleAdapter, type PlaywrightCompatibleViewport, type PointerClick, PointerManager, type PointerSpace, type PortalCartDeclaration, type PortalDiagnostic, type PortalEnterRequest, type PortalExclusiveGrant, type PortalFrameInspect, type PortalInspect, type PortalLifecycle, type PortalLifecycleEventType, type PortalLifecycleSnapshot, type PortalMetaphor, type PortalMutationResult, type PortalOutcome, type PortalOutcomeKind, type PresentationAdapter, type PresentationAdapterTarget, type PresentationAudioCapabilityStatus, type PresentationBinding, type PresentationBindingConsidered, type PresentationBindingDiagnostic, type PresentationBindingErrorCode, type PresentationBindingEvaluation, type PresentationBindingEvent, type PresentationBindingEventType, type PresentationBindingExplanation, type PresentationBindingFallback, type PresentationBindingInspect, type PresentationBindingManifest, type PresentationBindingRejected, type PresentationBindingResources, type PresentationBindingRuntime, type PresentationBindingSelector, type PresentationBindingSnapshot, type PresentationBindingTarget, type PresentationBindingTargetKind, type PresentationCaptionView, type PresentationCartState, type PresentationCompletionRule, type PresentationCueIntent, type PresentationFallbackDefinition, type PresentationFallbackWhen, type PresentationFitMode, type PresentationInterruptionPolicy, type PresentationInvocationPhase, type PresentationInvocationView, type PresentationLayout, type PresentationModel, type PresentationPhase, type PresentationPredicate, type PresentationRegion, type PresentationSequenceBindings, type PresentationSequenceDefinition, type PresentationSequenceDiagnostic, type PresentationSequenceEvent, type PresentationSequenceEventType, type PresentationSequenceInspect, type PresentationSequencePlayer, type PresentationSequenceSnapshot, type PresentationSequenceSnapshotQueued, type PresentationStepDefinition, type PresentationStepEffect, type PresentationStepTiming, type PresentationTimeline, type PresentationTrackDefinition, type PresentationTrackKind, type PresentationView, type ProductionScenarioBoundary, type ProductionScenarioControl, type ProductionScenarioDefinition, type ProductionScenarioDiagnostic, type ProductionScenarioErrorCode, type ProductionScenarioEventType, type ProductionScenarioEvidenceBundle, type ProductionScenarioExpectation, type ProductionScenarioHost, type ProductionScenarioInputSurface, type ProductionScenarioLocalization, type ProductionScenarioMatrix, type ProductionScenarioObservation, type ProductionScenarioReduceResult, type ProductionScenarioRequired, type ProductionScenarioRunner, type ProductionScenarioStep, type ProductionScenarioViewportPreset, type PublishExtras, REDACTED_VALUE, REDUCED_MOTION_ACTIVE_SEQUENCE_POLICY, REDUCED_MOTION_PARTICIPANT_IDS, REJECTED_EVENT_TYPE, REMOTE_CART_ERROR_CODES, REMOTE_CART_GRANTS, REMOTE_CART_MANIFEST_VERSION, REMOTE_CART_SIGNATURE_ALG, REPLAY_INSPECTOR_SCHEMA_VERSION, ROUND_TRIP_TOLERANCE, ROUND_TRIP_TOLERANCE_CANVAS_PX, Random, type RandomState, type ReducedMotionActiveSequencePolicy, type ReducedMotionParticipantId, type ReducedMotionParticipantReport, type ReducedMotionPropagation, type RejectionPayload, type RejectionReason, type RemoteCartAsset, type RemoteCartCapabilityBag, RemoteCartCapabilityError, type RemoteCartDiagnostic, type RemoteCartErrorCode, type RemoteCartFetchAdapter, type RemoteCartGrant, type RemoteCartInspect, type RemoteCartLoadSource, type RemoteCartManifestBody, type RemoteCartNetworkApi, type RemoteCartRegistry, type RemoteCartSandbox, type RemoteCartSignature, type RemoteCartStorageApi, type RemoteContentEnvelope, type ReplayCompareResult, type ReplayInspector, type ReplayInspectorExport, type ReplayInspectorReport, type ReplayMetadata, type ReplayParticipantSummary, type ReplayTapeAction, type ReplayTraceFilter, type ResolveImportableCartStateResult, type ResolvedAsset, type RestoreAudioCueResult, type RestoreContentRevisionResult, type RestoreJobResult, type RestorePortalResult, type RestorePresentationBindingsResult, type RestorePresentationSequenceResult, type RestoreSemanticLayerResult, type RestoreVisualLayerResult, type RestoreWorldGraphResult, type RestoreWorldPatchResult, type RouterDecision, type RouterDecisionOutcome, type RouterDecisionReason, type RouterParticipantInspect, type RuntimeGroup, type RuntimeGroupCapability, type RuntimeGroupDiagnostics, type RuntimeGroupFrameError, type RuntimeGroupInspect, type RuntimeGroupKind, type RuntimeGroupParticipantConfig, type RuntimeGroupParticipantHandle, type RuntimeGroupParticipantInspect, SELECTION_DECISION_KINDS, SELECTION_REASON_CODES, SELECTION_TRACE_SCHEMA_VERSION, SELECTION_TRACE_SENSITIVE_KEYS, SEMANTIC_APPEARANCE_KEYS, SEMANTIC_GEOMETRY_KINDS, SEMANTIC_HIT_TEST_POLICIES, SEMANTIC_INTERACTION_KEYS, SEMANTIC_LAYER_SNAPSHOT_SCHEMA_VERSION, SILENT_ASSET_FALLBACK_REF, SNAPSHOT_SCHEMA_VERSION, type SchemaCompatibility, type ScriptedAction, type SelectionAssetResolution, type SelectionBindingEvaluation, type SelectionContentIdentity, type SelectionDecisionInput, type SelectionDecisionKind, type SelectionDecisionRecord, type SelectionPresentationDecision, type SelectionReasonCode, type SelectionSequenceDecision, type SelectionSnapshotProvenance, type SelectionStagingOutcome, type SelectionStagingResult, type SelectionTrace, type SelectionTraceExport, type SelectionTraceFilter, type SelectionTraceReport, type SemanticAppearanceKey, type SemanticGeometryKind, type SemanticHitTestPolicy, type SemanticInteractionKey, type SemanticLayerController, type SemanticLayerControllerSnapshot, type SemanticMaskGrid, type SemanticPublishedRegion, type SemanticRegionA11y, type SemanticRegionDeclaration, type SemanticRegionGeometry, type SemanticRegionInspect, type SemanticRegionSnapshotRow, type SemanticRegionState, type SemanticRegionVisual, type SemanticRegionVisuals, type SignedRemoteCartManifest, type SnapshotAssetRef, type SnapshotCartRef, type SnapshotClock, type SnapshotDiagnostic, type SnapshotEnvelope, type SnapshotEnvelopeInput, type SnapshotIntegrity, type SnapshotMigration, type SnapshotMigrationRegistry, type SnapshotModuleRef, type SnapshotProvenance, type SnapshotSignatureRef, type TokenData, UNVERSIONED_CART_VERSION, VISUAL_LAYER_EVENTS, VISUAL_LAYER_FAILED_EVENT, VISUAL_LAYER_FAILURE_CODES, VISUAL_LAYER_HIDDEN_EVENT, VISUAL_LAYER_INCOMING_SUFFIX, VISUAL_LAYER_KINDS, VISUAL_LAYER_REVEALED_EVENT, VISUAL_LAYER_SNAPSHOT_SCHEMA_VERSION, VISUAL_LAYER_TRANSITIONS, VISUAL_LAYER_TRANSITION_COMPLETED_EVENT, VISUAL_LAYER_TRANSITION_STARTED_EVENT, type ValidateCapabilityManifestResult, type ValidateResult, type ValidateSnapshotResult, type VerifyRemoteCartResult, type VersionedSnapshot, type VirtualClock, type VisualLayerAcceptedBinding, type VisualLayerAssetStatus, type VisualLayerCapture, type VisualLayerController, type VisualLayerControllerSnapshot, type VisualLayerCueSpec, type VisualLayerDeclaration, type VisualLayerDiagnostic, type VisualLayerEvent, type VisualLayerEventType, type VisualLayerFailureCode, type VisualLayerFallbackPolicy, type VisualLayerInspect, type VisualLayerKind, type VisualLayerSnapshotRow, type VisualLayerTransitionInspect, type VisualLayerTransitionKind, type VisualLayerVersionDeclaration, WORLD_DISCOVERED_EVENT, WORLD_EDGE_ACCESS, WORLD_EDGE_ADDED_EVENT, WORLD_EDGE_VISIBILITIES, WORLD_ENTITY_KINDS, WORLD_ENTITY_STATUSES, WORLD_GRAPH_DIAGNOSTIC_EVENT, WORLD_GRAPH_EVENTS, WORLD_GRAPH_SNAPSHOT_SCHEMA_VERSION, WORLD_MAP_LAYERS, WORLD_NODE_ADDED_EVENT, WORLD_NODE_KINDS, WORLD_PATCH_ACCEPTED_EVENT, WORLD_PATCH_DIAGNOSTIC_EVENT, WORLD_PATCH_ERROR_CODES, WORLD_PATCH_EVENTS, WORLD_PATCH_OPS, WORLD_PATCH_PRECONDITION_TYPES, WORLD_PATCH_REDACTED_KEYS, WORLD_PATCH_REJECTED_EVENT, WORLD_PATCH_SCHEMA_VERSION, WORLD_PATCH_SNAPSHOT_SCHEMA_VERSION, WORLD_PATCH_SUPERSEDED_EVENT, WORLD_TRANSIT_EVENT, type WorldAcceptedPatch, type WorldEdge, type WorldEdgeAccess, type WorldEdgeVisibility, type WorldEntity, type WorldEntityKind, type WorldEntityRecord, type WorldEntityStatus, type WorldGraph, type WorldGraphDiagnostic, type WorldGraphEventType, type WorldGraphInspect, type WorldGraphPatch, type WorldGraphProjection, type WorldGraphSnapshot, type WorldIdentityChange, type WorldLinkRecord, type WorldMapLayer, type WorldMutationResult, type WorldNode, type WorldNodeKind, type WorldObserverDiscovery, type WorldPatch, type WorldPatchAcceptedPayload, type WorldPatchApplier, type WorldPatchAssetAvailability, type WorldPatchAuditRecord, type WorldPatchBindingAvailability, type WorldPatchCommitResult, type WorldPatchContentAvailability, type WorldPatchDiagnostic, type WorldPatchDomainValidator, type WorldPatchDryRunResult, type WorldPatchErrorCode, type WorldPatchEventType, type WorldPatchGraphPolicy, type WorldPatchInspect, type WorldPatchLimits, type WorldPatchOp, type WorldPatchOperation, type WorldPatchPrecondition, type WorldPatchPreconditionType, type WorldPatchProvenance, type WorldPatchRefs, type WorldPatchSnapshot, type WorldPath, type WorldPathResult, type WorldPersistenceAdapter, type WorldPersistenceTransaction, type WorldQueryBounds, type WorldReachabilityResult, type WorldRevisionState, type WorldTransit, type WorldTraversalContext, type WorldTraversalPolicy, appearanceForState, applyCueEasing, applySnapshotMigrations, assetStatusEvent, assetToNormalized, attachCartStatePersistence, attachPresentationAdapter, attachSelectionTrace, cabinetPortal, canonicalizeRemoteCartBody, canonicalizeSeed, canvasToCss, canvasToNormalized, toJSON as capabilityManifestToJSON, captureVisualLayers, cloneSnapshotJson, comparePayloadSchemas, compareReplayTraces, contentRevisionEventContracts, createAssetFailure, createAssetPreloader, createAudioBroker, createAudioCueTimeline, createBrowserHarness, createCompositor, createContentRevisionActivator, createContractRegistry, createDeclaredAssetResolver, createEngineSnapshotMigrations, createEventRouter, createExecutableModuleHost, createFixtureAssetResolver, createHeadlessAudioAdapter, createHeadlessJobWorker, createHostGrantSet, createHostedAssetResolver, createJobCoordinator, createLandmarkRegistry, createMemoryJobPersistence, createMemoryWorldPersistence, createPlaywrightCompatibleAdapter, createPortalLifecycle, createPresentationBindingRuntime, createPresentationLayout, createPresentationModelEvent, createPresentationSequencePlayer, createPresentationTimeline, createProductionScenarioRunner, createReferencePresentationCart, createRemoteCartRegistry, createRemoteCartSandbox, createRemoteContentAdapter, createReplayInspector, createRuntime, createRuntimeGroup, createSelectionTrace, createSemanticLayerController, createSnapshotMigrationRegistry, createStaticContentAdapter, createVirtualClock, createVisualLayerController, createWallClock, createWorldGraph, createWorldPatchApplier, cssToCanvas, cssToNormalized, defaultSnapshotMigrationRegistry, defineCapabilityManifest, defineDiagnostic, defineIntent, definePresentationBindings, definePresentationSequence, defineProductionScenario, defineRemoteCartManifest, defineSnapshot, defineStateEvent, deriveAttachOptions, describeReplayMismatch, detectSnapshotSchemaVersion, drawGeometryDebug, encodeMidiMessage, engineStateFromEnvelope, evaluatePresentationBindings, familyPatternForType, fnv1aHex, freezeCapabilityBag, geometryKindsOf, hmacSha256Hex, inferEventKind, isAssetFailure, isAssetFailureCode, isAssetKind, isAudioCueEventType, isContentRevisionErrorCode, isCueLifecycleType, isHostOwnedAudioEventKind, isLegacyCartStateBundle, isMidiChannel, isMidiData, isPresentationBindingErrorCode, isPresentationBindingEventType, isPresentationModel, isPresentationPhase, isPresentationSequenceEventType, isProductionScenarioBoundary, isProductionScenarioErrorCode, isProductionScenarioEventType, isSelectionDecisionKind, isSelectionReasonCode, isSemanticBlendMode, isSemanticGeometryKind, isSemanticHitTestPolicy, isSnapshotEnvelope, isVersionedSnapshot, isVisualLayerEventType, isVisualLayerKind, isVisualLayerTransitionKind, isWorldPatchErrorCode, jobEventContracts, kindSegmentInType, listRequestedRemoteCartGrants, loadRemoteCart, localizeProductionScenarioFailure, matchEventPattern, midiChannelFromStatus, midiStatus, mountPresentationAdapter, normalizeEvent, normalizedToAsset, normalizedToCanvas, normalizedToCss, paintingPortal, parseAudioCueSnapshot, parseCapabilityManifest, parseContentRevisionCatalog, parseGeometry, parseMidiBytes, parseRemoteCartManifest, parseSnapshot, pointFromOrigin, pointInHitbox, pointInSemanticGeometry, pointerToRegion, presentationBindingEventContracts, presentationBindingTargetKey, presentationSequenceEventContracts, productionScenarioEventContracts, recordSelectionDecision, rectToCanvas, rectToCss, regionToViewport, registerCartStateHotkeys, remoteCartProvenanceForSnapshot, replayExportedTrace, resolveImportableCartState, resolveRuntimeSeed, restoreSnapshotFromUnknown, rewriteHostedAssetRef, scheduleAudioCue, serializeGeometry, sha256Hex, signRemoteCartManifest, snapshotErrorsToMessage, snapshotFromCartBundle, validateCapabilityManifest, validateGeometry, validateSnapshot, verifyAttachOptions, verifyRemoteCartSignature, visualIncomingLayerId, worldGraphEventContracts, worldPatchEventContracts };
|