@mengine/medeo-tool 1.4.1-alpha.0 → 1.4.1-alpha.2

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.
@@ -134,6 +134,11 @@ interface DeleteVoiceoverInput {
134
134
  readonly voiceoverClipEntityIds: readonly string[];
135
135
  }
136
136
  type EmptyRelationKind = 'timeline-track' | 'track-clip' | 'clip-marker' | 'marker-content' | 'axvideo-marker' | 'marker-timeline' | 'audio-script-marker';
137
+ /** Immutable resource content resolved by the host for a document Entity. */
138
+ interface EntityAssetContent {
139
+ assetId: string;
140
+ content: JsonValue;
141
+ }
137
142
  type EntityId = string;
138
143
  interface EntityPayloadByKind {
139
144
  axvideo: BoundedDerivedSequencePayload;
@@ -143,10 +148,10 @@ interface EntityPayloadByKind {
143
148
  role?: string;
144
149
  };
145
150
  clip: JsonObject;
146
- video: BoundedNativeSequencePayload;
147
- audio: BoundedNativeSequencePayload;
148
- voice: BoundedNativeSequencePayload;
149
- image: UnboundedConstantSequencePayload;
151
+ video: BoundedNativeSequencePayload & MediaAssetPayload;
152
+ audio: BoundedNativeSequencePayload & MediaAssetPayload;
153
+ voice: BoundedNativeSequencePayload & MediaAssetPayload;
154
+ image: UnboundedConstantSequencePayload & MediaAssetPayload;
150
155
  'sequence-marker': JsonObject & {
151
156
  sourceRange: {
152
157
  start: number;
@@ -184,6 +189,11 @@ interface EntityPayloadByKind {
184
189
  baseEntityIds: string[];
185
190
  selections: CaptionTextSelection[];
186
191
  style?: JsonObject;
192
+ segmentRanges?: {
193
+ segmentId: string;
194
+ startMs: number;
195
+ endMs: number;
196
+ }[];
187
197
  };
188
198
  }
189
199
  interface EntityStoreSnapshot {
@@ -286,6 +296,12 @@ type LinkRelationInput = (LinkRelationBase & {
286
296
  alignment: JsonValue;
287
297
  };
288
298
  });
299
+ type MediaAssetPayload = JsonObject & {
300
+ external: {
301
+ system: 'memota' | 'memota-speech';
302
+ key: string;
303
+ };
304
+ };
289
305
  interface MoveClipInput {
290
306
  readonly clipEntityId: string;
291
307
  readonly trackEntityId: string;
@@ -373,7 +389,7 @@ interface SetClipVolumeInput {
373
389
  readonly volume: number;
374
390
  }
375
391
  /** Stored own fields; a variant may obtain required content fields from its declared bases. */
376
- type StoredEntityPayload<K extends KnownEntityKind> = EntityPayloadByKind[K] | (JsonObject & Partial<EntityPayloadByKind[K]> & {
392
+ type StoredEntityPayload<K extends KnownEntityKind> = EntityPayloadByKind[K] | (K extends 'caption' ? JsonObject & Pick<MediaAssetPayload, 'external'> : never) | (JsonObject & Partial<EntityPayloadByKind[K]> & {
377
393
  baseEntityIds: string[];
378
394
  });
379
395
  interface TrimClipInput {
@@ -445,9 +461,11 @@ declare const edit: EditApi;
445
461
  declare const timeline: TimelineApi;
446
462
  declare const entities: BusinessEntityFacade;
447
463
  declare const relations: BusinessRelationFacade;
464
+ /** Resolve the resource attached to an Entity through the host; await before using a new Caption. */
465
+ declare function rgetAssetFromEntity(entityId: string): Promise<EntityAssetContent>;
448
466
  declare function checkpoint(): SandboxCheckpoint;
449
467
  declare function rollbackTo(cp: SandboxCheckpoint): void;
450
468
  declare const inputs: Readonly<Record<string, unknown>>;
451
469
  //#endregion
452
- export type { BoundedDerivedSequencePayload, BoundedNativeSequencePayload, BusinessEntityFacade, BusinessRelationFacade, CaptionFontDescriptor, CaptionSegmentSelection, CaptionStyleFields, CaptionTextRange, CaptionTextSelection, ClipEntityId, ClipPlacement, ComposedPhoneticContent, ComposedScriptContent, CreateEntityInput, DeleteBgmInput, DeleteClipInput, DeleteClipTreeInput, DeleteEntityInput, DeleteVoiceoverInput, EditApi, EmptyRelationKind, EntityId, EntityPayloadByKind, EntityStoreSnapshot, InsertCaptionClipInput, InsertClipInput, InsertPlacedClipInput, JsonObject, JsonPrimitive, JsonValue, KnownEntityKind, KnownRelationKind, LinearClipSpeed, LinkAudioScriptSourceRelationInput, LinkClipAnchorRelationInput, LinkGeneratedRelationInput, LinkPhoneticScriptRenderRelationInput, LinkRelationInput, MoveClipInput, MoveClipsToStartsInput, MoveSequentialClipsInput, MoveVoiceoverInput, PatchCaptionStyleInput, ReplaceClipContentInput, SandboxCheckpoint, SandboxEntity, SandboxRelation, ScriptTextSegment, SequenceDuration, SequenceRange, SequentialClipAnchor, SetCaptionVisibilityInput, SetClipPlacementInput, SetClipSpeedInput, SetClipVolumeInput, StoredEntityPayload, TimelineApi, TrimClipInput, UnboundedConstantSequencePayload, UnlinkRelationInput, UpdateClipInput, UpdateClipMarkerInput, UpdateEntityInput, checkpoint, edit, entities, inputs, relations, rollbackTo, timeline };
470
+ export type { BoundedDerivedSequencePayload, BoundedNativeSequencePayload, BusinessEntityFacade, BusinessRelationFacade, CaptionFontDescriptor, CaptionSegmentSelection, CaptionStyleFields, CaptionTextRange, CaptionTextSelection, ClipEntityId, ClipPlacement, ComposedPhoneticContent, ComposedScriptContent, CreateEntityInput, DeleteBgmInput, DeleteClipInput, DeleteClipTreeInput, DeleteEntityInput, DeleteVoiceoverInput, EditApi, EmptyRelationKind, EntityAssetContent, EntityId, EntityPayloadByKind, EntityStoreSnapshot, InsertCaptionClipInput, InsertClipInput, InsertPlacedClipInput, JsonObject, JsonPrimitive, JsonValue, KnownEntityKind, KnownRelationKind, LinearClipSpeed, LinkAudioScriptSourceRelationInput, LinkClipAnchorRelationInput, LinkGeneratedRelationInput, LinkPhoneticScriptRenderRelationInput, LinkRelationInput, MediaAssetPayload, MoveClipInput, MoveClipsToStartsInput, MoveSequentialClipsInput, MoveVoiceoverInput, PatchCaptionStyleInput, ReplaceClipContentInput, SandboxCheckpoint, SandboxEntity, SandboxRelation, ScriptTextSegment, SequenceDuration, SequenceRange, SequentialClipAnchor, SetCaptionVisibilityInput, SetClipPlacementInput, SetClipSpeedInput, SetClipVolumeInput, StoredEntityPayload, TimelineApi, TrimClipInput, UnboundedConstantSequencePayload, UnlinkRelationInput, UpdateClipInput, UpdateClipMarkerInput, UpdateEntityInput, checkpoint, edit, entities, inputs, relations, rgetAssetFromEntity, rollbackTo, timeline };
453
471
  //# sourceMappingURL=sandbox-api.d.mts.map
@@ -868,6 +868,8 @@ function validateVoicePayload(value, problems) {
868
868
  if (voice.name !== void 0 && typeof voice.name !== "string") problems.push("voice.name must be a string when present");
869
869
  }
870
870
  function validateCaptionPayload(value, problems) {
871
+ validateExternalLocator(value, problems);
872
+ if (value.segmentRanges !== void 0) validateSegmentRanges(value.segmentRanges, problems);
871
873
  const selections = value.selections;
872
874
  if (!Array.isArray(selections)) problems.push("selections must be a non-empty array of AudioScript segment selections");
873
875
  else {
@@ -1006,7 +1008,7 @@ function isOwnedLocalEntityValuePath(entityKind, path) {
1006
1008
  "axvideo"
1007
1009
  ].includes(entityKind) && /^(?:sampling|coordinateSpace|coordinateSpace\.unit|extent\.kind)$/.test(path)) return true;
1008
1010
  if (entityKind === "sequence-marker" && /^(?:durationPolicy|duration\.mode|timeRemapping\.(?:kind|mode))$/.test(path)) return true;
1009
- if (entityKind === "sequence-marker" && /^segmentRanges\[\d+\]\.segmentId$/.test(path)) return true;
1011
+ if ((entityKind === "sequence-marker" || entityKind === "caption") && /^segmentRanges\[\d+\]\.segmentId$/.test(path)) return true;
1010
1012
  if (entityKind === "asset" && /^(?:external\.(?:system|key)|storageKey)$/.test(path)) return true;
1011
1013
  if (isMediaAssetVariantKind(entityKind) && /^(?:external\.(?:system|key)|storageKey)$/.test(path)) return true;
1012
1014
  if (entityKind === "voice" && /^voice\.(?:system|key|name)$/.test(path)) return true;
@@ -1026,7 +1028,7 @@ function isOwnedLocalIdPath(entityKind, path) {
1026
1028
  "phonetic-script"
1027
1029
  ].includes(entityKind) && /^segments\[\d+\]\.segmentId$/.test(path)) return true;
1028
1030
  if (entityKind === "caption" && /^selections\[\d+\]\.segmentId$/.test(path)) return true;
1029
- if (entityKind === "sequence-marker" && /^segmentRanges\[\d+\]\.segmentId$/.test(path)) return true;
1031
+ if ((entityKind === "sequence-marker" || entityKind === "caption") && /^segmentRanges\[\d+\]\.segmentId$/.test(path)) return true;
1030
1032
  if (entityKind === "asset" && /^(?:tracks\[\d+\]\.trackId|renditions\[\d+\]\.renditionId)$/.test(path)) return true;
1031
1033
  return false;
1032
1034
  }
@@ -1518,8 +1520,8 @@ function errorMessage(error) {
1518
1520
  }
1519
1521
  //#endregion
1520
1522
  //#region src/sandbox/business-facades.ts
1521
- /** Resource locators are host-owned even when stored on a typed media entity. */
1522
- const infrastructureFields = new Set(["external", "storageKey"]);
1523
+ /** Resource IDs are entity data; physical storage paths remain host-owned. */
1524
+ const infrastructureFields = new Set(["storageKey"]);
1523
1525
  function businessEntity(entity) {
1524
1526
  return {
1525
1527
  ...entity,
@@ -2474,4 +2476,4 @@ function replayJournalSync(adapter, journal) {
2474
2476
  //#endregion
2475
2477
  export { createEntityId as a, collectAffectedPartIds as c, businessState as i, renderPreview as l, EntitySandbox as n, createRelationId as o, businessFacades as r, isMediaAssetVariantKind as s, EditSandboxSession as t, renderCompactProjection as u };
2476
2478
 
2477
- //# sourceMappingURL=script-session-DTq_VPEA.mjs.map
2479
+ //# sourceMappingURL=script-session-lXpqmupK.mjs.map