import type { CameraPathRecord, EntityRecord, FlowGraphRecord, MaterialBindingRecord, MaterialOverride, TextureAnimationRecord, SceneDocumentData, TransformValue, SceneAnimationTrackV1, SceneAnimationClipV1 } from "@skenora/contracts"; import type { ScenePlanDiagnostic } from "../diagnostics/diagnostics.js"; import type { JsonValue } from "../model/json.js"; import type { SceneBlueprintResource, ScenePlanContext, ScenePatch } from "../model/types.js"; export declare const SCENE_FRAGMENT_SCHEMA: "skenora.scene.fragment"; export declare const SCENE_FRAGMENT_VERSION: 1; export interface SceneFragmentV1 { readonly schema: typeof SCENE_FRAGMENT_SCHEMA; readonly version: typeof SCENE_FRAGMENT_VERSION; readonly name: string; readonly coordinateSpace: "source-parent-local"; readonly rootEntityIds: readonly string[]; readonly entities: readonly EntityRecord[]; readonly resources: readonly SceneBlueprintResource[]; readonly materials: readonly MaterialOverride[]; readonly materialBindings: readonly MaterialBindingRecord[]; readonly textureAnimations: readonly TextureAnimationRecord[]; readonly cameraPaths: readonly CameraPathRecord[]; readonly flows: readonly FlowGraphRecord[]; readonly initialVariables: Readonly>; readonly animationTracks?: never; readonly animationClips?: never; readonly extensions?: never; } export declare const SCENE_FRAGMENT_V2_VERSION: 2; export interface SceneFragmentV2 extends Omit { readonly version: 2; readonly animationTracks: readonly SceneAnimationTrackV1[]; readonly animationClips: readonly SceneAnimationClipV1[]; readonly extensions: Readonly; } export type SceneFragmentData = SceneFragmentV1 | SceneFragmentV2; export declare const DEFAULT_SCENE_FRAGMENT_BUDGET: Readonly<{ maxBytes: number; maxDepth: 64; maxSourceBytes: number; entities: 1000; resources: 256; materials: 256; materialBindings: 2000; textureAnimations: 256; cameraPaths: 64; flows: 64; flowNodes: 2000; flowEdges: 4000; variablesAndEvents: 512; operations: 5000; animationTracks: 1024; animationClips: 128; }>; export type SceneFragmentBudget = { readonly [K in keyof typeof DEFAULT_SCENE_FRAGMENT_BUDGET]: number; }; export interface SceneFragmentContext extends ScenePlanContext { /** Host ceilings can only tighten the fixed V1 bounds. */ readonly fragmentBudget?: Partial; readonly fragmentExtensions?: readonly SceneFragmentExtensionAdapter[]; } export interface SceneFragmentExtensionAdapter { readonly namespace: string; /** Return only data owned by selected entities; reject partial/unknown closure. */ extract(value: unknown, entityIds: ReadonlySet): unknown | undefined; remap(value: unknown, map: (kind: SceneFragmentIdentityKind, id: string) => string, namespace: string): unknown; /** Merge disjoint extension records, rejecting identity conflicts. */ merge(existing: unknown | undefined, incoming: unknown): unknown; } export interface ExtractSceneFragmentOptions { readonly rootEntityIds: readonly string[]; readonly flowIds?: readonly string[]; readonly name: string; /** V1 remains the default. V2 is an explicit authoring choice. */ readonly version?: 1 | 2; readonly animationTrackIds?: readonly string[]; readonly animationClipIds?: readonly string[]; readonly cameraPathIds?: readonly string[]; } export interface PlanSceneFragmentInsertionOptions { readonly namespace: string; /** Explicit existing source mapping for adoption/upgrade; collisions still reject. */ readonly idMappings?: readonly SceneFragmentIdentityMapping[]; readonly wrapperEntityId?: string; readonly parentId?: string; readonly placement?: TransformValue; readonly resourceBindings: Readonly>; readonly reuseMaterials?: Readonly>; readonly viewportEffects?: "reject" | "preserve-world"; } export interface SceneFragmentInsertionContext extends SceneFragmentContext { readonly document: Readonly; readonly documentRevision: number; /** Captured with the document by the host; the executor checks it at commit. */ readonly documentHash: string; } export type SceneFragmentIdentityKind = "entity" | "resource" | "material" | "materialBinding" | "animationTrack" | "animationClip" | "textureAnimation" | "cameraPath" | "flow" | "variable" | "event"; export interface SceneFragmentIdentityMapping { readonly kind: SceneFragmentIdentityKind; readonly sourceId: string; readonly targetId: string; } export interface SceneFragmentSharedMaterialImpact { readonly materialId: string; readonly existingEntityIds: readonly string[]; } export type SceneFragmentInsertionResult = { readonly ok: false; readonly diagnostics: readonly ScenePlanDiagnostic[]; } | { readonly ok: true; readonly patch: ScenePatch; readonly wrapperEntityId: string; readonly idMap: readonly SceneFragmentIdentityMapping[]; readonly requiredAssetIds: readonly string[]; readonly sharedMaterialImpacts: readonly SceneFragmentSharedMaterialImpact[]; readonly diagnostics: readonly ScenePlanDiagnostic[]; }; export interface SceneFragmentExclusionSummary { readonly entityIds: readonly string[]; readonly flowIds: readonly string[]; readonly animationTrackCount: number; readonly animationClipCount: number; readonly globalDomains: readonly string[]; } export type SceneFragmentValidationResult = { readonly ok: false; readonly diagnostics: readonly ScenePlanDiagnostic[]; } | { readonly ok: true; readonly fragment: SceneFragmentData; readonly diagnostics: readonly ScenePlanDiagnostic[]; }; export type SceneFragmentExtractionResult = { readonly ok: false; readonly diagnostics: readonly ScenePlanDiagnostic[]; } | { readonly ok: true; readonly fragment: T; readonly excluded: SceneFragmentExclusionSummary; readonly diagnostics: readonly ScenePlanDiagnostic[]; }; //# sourceMappingURL=types.d.ts.map