@mengine/medeo-tool 1.4.1-alpha.1 → 1.4.1-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,6 +1,5 @@
1
- import { _ as SandboxEntity, a as EntityFacade, b as UpdateEntityInput, c as JsonObject, d as KnownEntityKind, f as KnownRelationKind, g as ResourceEntityKind, h as RelationFacade, i as EntityCommand, l as JsonPrimitive, m as LinkRelationInput, n as CreateEntityInput, o as EntityPlanState, p as LinkGeneratedRelationInput, r as DeleteEntityInput, s as EntityStoreSnapshot, t as AuthorableRelationKind, u as JsonValue, v as SandboxRelation, y as UnlinkRelationInput } from "./entity-contract-DHasvrhq.mjs";
2
- import { JournalEntry, ManualSyncDoc, MediaAssetFact, PartIdFactory, SemanticOpName, VideoDocument, VideoDraft, fromVideoDocument } from "@mengine/medeo-client";
3
- import { AddSpeechesInput, AddVideoClipsInput, AdjustBgmVolumeInput, AdjustSpeechVolumeInput, AdjustVideoClipDurationInput, AdjustVideoClipVolumeInput, ChangeSpeechScriptInput, ChangeSpeechVoiceInput, DeleteBgmInput, DeleteSpeechesInput, DeleteVideoClipsInput, MoveSpeechesInput, MoveVideoClipsByAnchorInput, MoveVideoClipsInput, ReplaceVideoClipContentInput, ReplaceVideoClipSequenceInput, SetBgmInput, SetCaptionStyleInput, SetCaptionVisibilityInput, SetVideoClipSpeedShiftInput } from "@mengine/medeo-client/schemas";
1
+ import { C as UpdateEntityInput, S as UnlinkRelationInput, _ as LinkRelationInput, a as DeleteEntityInput, b as SandboxEntity, c as EntitySandboxCheckpoint, d as JsonObject, f as JsonPrimitive, g as LinkGeneratedRelationInput, h as KnownRelationKind, i as CreateEntityInput, l as EntityStoreSnapshot, m as KnownEntityKind, n as BusinessEntityFacade, o as EntityCommand, p as JsonValue, r as BusinessRelationFacade, s as EntityPlanState, t as AuthorableRelationKind, u as EntityUpdateInput, v as RelationUpdateInput, x as SandboxRelation, y as ResourceEntityKind } from "./entity-contract-DQ56Ihrh.mjs";
2
+ import { JournalEntry, ManualSyncDoc, MediaAssetFact, PartIdFactory, SemanticOpName, VideoDocument, VideoDraft } from "@mengine/medeo-client";
4
3
 
5
4
  //#region src/document/compact-projection.d.ts
6
5
  /**
@@ -33,21 +32,19 @@ declare function collectAffectedPartIds(journal: readonly JournalEntry[]): Set<s
33
32
  */
34
33
  declare function renderPreview(document: VideoDocument, journal: readonly JournalEntry[]): string;
35
34
  //#endregion
35
+ //#region src/entity/entity-asset.d.ts
36
+ /** Immutable resource content resolved by the host for a document Entity. */
37
+ interface EntityAssetContent {
38
+ assetId: string;
39
+ content: JsonValue;
40
+ }
41
+ /** Host-only I/O. The sandbox supplies an Entity, never an arbitrary Asset query. */
42
+ type EntityAssetLoader = (docId: string, entity: SandboxEntity) => Promise<EntityAssetContent>;
43
+ //#endregion
36
44
  //#region src/entity/entity-sandbox.d.ts
37
45
  type DomainIdFactory = (prefix: 'entity' | 'relation') => string;
38
46
  //#endregion
39
47
  //#region src/sandbox/script-session.d.ts
40
- /**
41
- * Runtime-neutral edit-sandbox session: `edit.*` / `timeline.*` / checkpoint
42
- * facade over a forked `VideoDocument`, self-maintained journal, and console
43
- * log buffer. No `node:*` imports — host/worker layers inject this into vm.
44
- *
45
- * Known gap (not solved here): `Math.random` / `Date.now` remain reachable in
46
- * the vm; purity is by convention.
47
- */
48
- interface SandboxCheckpoint {
49
- readonly index: number;
50
- }
51
48
  interface ChangePlan {
52
49
  /** Native operations compiled against the causal sandbox baseline. */
53
50
  loro_update?: string;
@@ -74,88 +71,6 @@ interface EditSandboxSessionOptions {
74
71
  onEntityCommand?: (command: EntityCommand) => void;
75
72
  onEntityTruncate?: (index: number) => void;
76
73
  }
77
- interface TimelineClipDescriptor {
78
- id: string;
79
- start_ms: number;
80
- end_ms: number;
81
- duration_ms: number;
82
- speed_shift: unknown;
83
- volume: number | undefined;
84
- media_id: string | undefined;
85
- }
86
- interface TimelinePartDescriptor {
87
- id: string;
88
- kind: string;
89
- lane: string;
90
- start_ms: number;
91
- end_ms: number;
92
- duration_ms: number;
93
- part: unknown;
94
- }
95
- /** Session core for one forked document; globals stay identity-stable across rollback. */
96
- declare class EditSandboxSession {
97
- private readonly original;
98
- private readonly idFactory;
99
- private readonly onEntry;
100
- private readonly onLog;
101
- private readonly onTruncate;
102
- private readonly entitySandbox;
103
- private current;
104
- /** Adapter journal length already accounted for — new slices are real commits. */
105
- private adapterJournalSeen;
106
- private readonly entries;
107
- private readonly logs;
108
- private logBytes;
109
- private logCapped;
110
- readonly edit: EditFacade;
111
- readonly timeline: TimelineFacade;
112
- readonly entities: EntityFacade;
113
- readonly relations: RelationFacade;
114
- readonly console: ConsoleShim;
115
- readonly checkpoint: () => SandboxCheckpoint;
116
- readonly rollbackTo: (cp: SandboxCheckpoint) => void;
117
- constructor(document: VideoDocument, options?: EditSandboxSessionOptions);
118
- /** Assemble a ChangePlan from the self-maintained journal + current preview. */
119
- buildPlan(baseVersion: string): ChangePlan;
120
- getEntries(): readonly JournalEntry[];
121
- getLogs(): readonly string[];
122
- private boot;
123
- private doRollbackTo;
124
- private captureNewEntries;
125
- private appendLog;
126
- private buildConsoleShim;
127
- private buildEditFacade;
128
- private buildTimelineFacade;
129
- private clipsInRange;
130
- private part;
131
- }
132
- interface EditFacade {
133
- addSpeeches: (input: AddSpeechesInput) => Promise<void>;
134
- addVideoClips: (input: AddVideoClipsInput) => Promise<void>;
135
- adjustBgmVolume: (input: AdjustBgmVolumeInput) => Promise<void>;
136
- adjustSpeechVolume: (input: AdjustSpeechVolumeInput) => Promise<void>;
137
- adjustVideoClipDuration: (input: AdjustVideoClipDurationInput) => Promise<void>;
138
- adjustVideoClipVolume: (input: AdjustVideoClipVolumeInput) => Promise<void>;
139
- changeSpeechScript: (input: ChangeSpeechScriptInput) => Promise<void>;
140
- changeSpeechVoice: (input: ChangeSpeechVoiceInput) => Promise<void>;
141
- deleteBgm: (input: DeleteBgmInput) => Promise<void>;
142
- deleteSpeeches: (input: DeleteSpeechesInput) => Promise<void>;
143
- deleteVideoClips: (input: DeleteVideoClipsInput) => Promise<void>;
144
- moveSpeeches: (input: MoveSpeechesInput) => Promise<void>;
145
- moveVideoClips: (input: MoveVideoClipsInput) => Promise<void>;
146
- moveVideoClipsByAnchor: (input: MoveVideoClipsByAnchorInput) => Promise<void>;
147
- replaceVideoClipContent: (input: ReplaceVideoClipContentInput) => Promise<void>;
148
- replaceVideoClipSequence: (input: ReplaceVideoClipSequenceInput) => Promise<void>;
149
- setBgm: (input: SetBgmInput) => Promise<void>;
150
- setCaptionStyle: (input: SetCaptionStyleInput) => Promise<void>;
151
- setCaptionVisibility: (input: SetCaptionVisibilityInput) => Promise<void>;
152
- setVideoClipSpeedShift: (input: SetVideoClipSpeedShiftInput) => Promise<void>;
153
- }
154
- interface TimelineFacade {
155
- snapshot: () => ReturnType<typeof fromVideoDocument>;
156
- clipsInRange: (startMs: number, endMs: number) => TimelineClipDescriptor[];
157
- part: (id: string) => TimelinePartDescriptor | null;
158
- }
159
74
  interface ConsoleShim {
160
75
  log: (...args: unknown[]) => void;
161
76
  info: (...args: unknown[]) => void;
@@ -172,6 +87,7 @@ interface ConsoleShim {
172
87
  * injects loaders that break worker boot.
173
88
  */
174
89
  interface RunEditScriptOptions {
90
+ loadEntityAsset?: (entity: SandboxEntity) => Promise<EntityAssetContent>;
175
91
  document: VideoDocument;
176
92
  baseVersion: string;
177
93
  script: string;
@@ -180,8 +96,6 @@ interface RunEditScriptOptions {
180
96
  entityState?: EntityStoreSnapshot;
181
97
  /** Deterministic id mint label for tests; omit to use the default ULID factory. */
182
98
  idLabel?: string;
183
- /** @internal Select the graph-native Entity session used by the production host. */
184
- entityOnly?: boolean;
185
99
  /** Hard wall-clock timeout; default 2000 ms. */
186
100
  timeoutMs?: number;
187
101
  /** V8 old-generation ceiling for the worker; default 256 MB. */
@@ -480,6 +394,7 @@ interface CreateMedeoToolOptions {
480
394
  loadGenerationFacts?: GenerationFactsLoader;
481
395
  /** Assemble optional Caption artifacts by immutable entity ID; never exposed to scripts. */
482
396
  loadCaptionAssets?: CaptionAssetsLoader;
397
+ loadEntityAsset?: EntityAssetLoader;
483
398
  fetchImpl?: typeof fetch;
484
399
  /** @deprecated ManualSyncDoc has no SSE or reconnect loop. */
485
400
  sseReconnectDelayMs?: number;
@@ -652,5 +567,5 @@ declare function materializeResources(options: EntityHttpClientOptions & {
652
567
  loadGenerationFacts?: GenerationFactsLoader;
653
568
  }, resources: readonly GeneratedResource[]): Promise<readonly string[]>;
654
569
  //#endregion
655
- export { type AssetGenerationFact, type AuthorableRelationKind, type CaptionAssetAssemblyOutcome, type CaptionAssetFact, type CaptionAssetsLoader, type ChangePlan, type CommitPlan, type CommitPlanOptions, type CommitPlanResult, type CompactProjectionOptions, type ConsoleShim, type CreateEntityInput, type CreateMedeoToolOptions, type DeleteEntityInput, type EditFacade, EditSandboxSession, type EditSandboxSessionOptions, type EditScriptResult, type EntityCommand, type EntityCommitResult, type EntityFacade, type EntityPlanState, type EntityStoreSnapshot, type GeneratedResource, type GenerationFactsLoader, type GenerationSyncOutcome, type JsonObject, type JsonPrimitive, type JsonValue, type KnownEntityKind, type KnownRelationKind, type LinkGeneratedRelationInput, type LinkRelationInput, MEDEO_TOOL_DESCRIPTION, MEDEO_TOOL_NAME, MEDEO_TOOL_PARAMETERS, type MedeoCommitResult, type MedeoInitialDraft, type MedeoModelContext, type MedeoModelContextInput, type MedeoTool, type MedeoToolInput, type MedeoToolOp, type MedeoToolResult, type RelationFacade, type ResourceEntityKind, type RunEditScriptOptions, type SandboxCheckpoint, type SandboxEntity, type SandboxRelation, type TimelineClipDescriptor, type TimelineFacade, type TimelinePartDescriptor, type UnlinkRelationInput, type UpdateEntityInput, collectAffectedPartIds, commitPlan, createMedeoTool, materializeResources, renderCompactProjection, renderPreview, runEditScript };
570
+ export { type AssetGenerationFact, type AuthorableRelationKind, type BusinessEntityFacade, type BusinessRelationFacade, type CaptionAssetAssemblyOutcome, type CaptionAssetFact, type CaptionAssetsLoader, type ChangePlan, type CommitPlan, type CommitPlanOptions, type CommitPlanResult, type CompactProjectionOptions, type ConsoleShim, type CreateEntityInput, type CreateMedeoToolOptions, type DeleteEntityInput, type EditSandboxSessionOptions, type EditScriptResult, type EntityAssetContent, type EntityAssetLoader, type EntityCommand, type EntityCommitResult, type EntityPlanState, type EntitySandboxCheckpoint, type EntityStoreSnapshot, type EntityUpdateInput, type GeneratedResource, type GenerationFactsLoader, type GenerationSyncOutcome, type JsonObject, type JsonPrimitive, type JsonValue, type KnownEntityKind, type KnownRelationKind, type LinkGeneratedRelationInput, type LinkRelationInput, MEDEO_TOOL_DESCRIPTION, MEDEO_TOOL_NAME, MEDEO_TOOL_PARAMETERS, type MedeoCommitResult, type MedeoInitialDraft, type MedeoModelContext, type MedeoModelContextInput, type MedeoTool, type MedeoToolInput, type MedeoToolOp, type MedeoToolResult, type RelationUpdateInput, type ResourceEntityKind, type RunEditScriptOptions, type SandboxEntity, type SandboxRelation, type UnlinkRelationInput, type UpdateEntityInput, collectAffectedPartIds, commitPlan, createMedeoTool, materializeResources, renderCompactProjection, renderPreview, runEditScript };
656
571
  //# sourceMappingURL=index.d.mts.map