@mengine/medeo-tool 1.3.1-alpha.11 → 1.3.1-alpha.12
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 +21 -1
- package/dist/index.mjs +135 -49
- package/dist/index.mjs.map +1 -1
- package/dist/sandbox-api.d.mts +34 -44
- package/dist/{script-session-DLBhoA1R.mjs → script-session-IqAIVBCM.mjs} +3 -9
- package/dist/script-session-IqAIVBCM.mjs.map +1 -0
- package/dist/worker-entry.mjs +64 -5
- package/dist/worker-entry.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/script-session-DLBhoA1R.mjs.map +0 -1
package/dist/worker-entry.mjs
CHANGED
|
@@ -1,8 +1,66 @@
|
|
|
1
|
-
import { i as createRelationId, n as EntitySandbox, r as createEntityId, t as EditSandboxSession } from "./script-session-
|
|
1
|
+
import { i as createRelationId, n as EntitySandbox, r as createEntityId, t as EditSandboxSession } from "./script-session-IqAIVBCM.mjs";
|
|
2
2
|
import { EntityTimelineEditor, assertCanonicalEditorResources, assertMediaAssetWritePolicy, base64ToBytes, bytesToBase64, compileEntityRows, projectEntityTimeline } from "@mengine/medeo-client";
|
|
3
3
|
import { parentPort, workerData } from "node:worker_threads";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import vm from "node:vm";
|
|
6
|
+
//#region src/sandbox/business-facades.ts
|
|
7
|
+
/** Keep infrastructure rows available to assembly without exposing their management to scripts. */
|
|
8
|
+
function businessFacades(entities, relations) {
|
|
9
|
+
const isAsset = (id) => entities.get(id)?.entity_kind === "asset";
|
|
10
|
+
const assertBusiness = (id) => {
|
|
11
|
+
if (isAsset(id)) throw new Error("Asset entities are managed by host assembly");
|
|
12
|
+
};
|
|
13
|
+
const visibleRelation = (relation) => relation.relation_kind !== "physical-asset" && !isAsset(relation.endpoint_0_entity_id) && !isAsset(relation.endpoint_1_entity_id);
|
|
14
|
+
return {
|
|
15
|
+
entities: {
|
|
16
|
+
list: () => entities.list().filter((entity) => entity.entity_kind !== "asset"),
|
|
17
|
+
get: (id) => isAsset(id) ? null : entities.get(id),
|
|
18
|
+
create: (input) => {
|
|
19
|
+
if (input.entity_kind === "asset") throw new Error("Asset entities are managed by host assembly");
|
|
20
|
+
return entities.create(input);
|
|
21
|
+
},
|
|
22
|
+
update: (input) => {
|
|
23
|
+
assertBusiness(input.entity_id);
|
|
24
|
+
entities.update(input);
|
|
25
|
+
},
|
|
26
|
+
declareFields: (input) => {
|
|
27
|
+
assertBusiness(input.entity_id);
|
|
28
|
+
entities.declareFields(input);
|
|
29
|
+
},
|
|
30
|
+
delete: (input) => {
|
|
31
|
+
assertBusiness(input.entity_id);
|
|
32
|
+
entities.delete(input);
|
|
33
|
+
},
|
|
34
|
+
readCaptionContent: (input) => entities.readCaptionContent(input),
|
|
35
|
+
readPhoneticScriptContent: (input) => entities.readPhoneticScriptContent(input),
|
|
36
|
+
ensureMedia: (input) => entities.ensureMedia(input)
|
|
37
|
+
},
|
|
38
|
+
relations: {
|
|
39
|
+
list: () => relations.list().filter(visibleRelation),
|
|
40
|
+
of: (id, kind) => relations.of(id, kind).filter(visibleRelation),
|
|
41
|
+
link: (input) => {
|
|
42
|
+
if (input.relation_kind === "physical-asset") throw new Error("Asset bindings are managed by host assembly");
|
|
43
|
+
assertBusiness(input.endpoint_0_entity_id);
|
|
44
|
+
assertBusiness(input.endpoint_1_entity_id);
|
|
45
|
+
return relations.link(input);
|
|
46
|
+
},
|
|
47
|
+
unlink: (input) => {
|
|
48
|
+
const relation = relations.list().find((row) => row.relation_id === input.relation_id);
|
|
49
|
+
if (relation && !visibleRelation(relation)) throw new Error("Asset bindings are managed by host assembly");
|
|
50
|
+
relations.unlink(input);
|
|
51
|
+
},
|
|
52
|
+
linkGenerated: (input) => {
|
|
53
|
+
assertBusiness(input.output_entity_id);
|
|
54
|
+
assertBusiness(input.input_entity_id);
|
|
55
|
+
return relations.linkGenerated(input);
|
|
56
|
+
},
|
|
57
|
+
linkClipAnchor: (input) => relations.linkClipAnchor(input),
|
|
58
|
+
linkPhoneticScriptRender: (input) => relations.linkPhoneticScriptRender(input),
|
|
59
|
+
linkAudioScriptSource: (input) => relations.linkAudioScriptSource(input)
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
6
64
|
//#region src/sandbox/entity-script-session.ts
|
|
7
65
|
const LOG_LINE_MAX = 2e3;
|
|
8
66
|
const LOG_LINE_CAP = 1e3;
|
|
@@ -55,8 +113,9 @@ var EntityEditSandboxSession = class {
|
|
|
55
113
|
});
|
|
56
114
|
this.edit = this.buildEditFacade();
|
|
57
115
|
this.timeline = { snapshot: () => this.snapshot() };
|
|
58
|
-
this.entities
|
|
59
|
-
this.
|
|
116
|
+
const business = businessFacades(this.entitySandbox.entities, this.entitySandbox.relations);
|
|
117
|
+
this.entities = business.entities;
|
|
118
|
+
this.relations = business.relations;
|
|
60
119
|
this.console = this.buildConsoleShim();
|
|
61
120
|
this.checkpoint = () => ({ index: this.entitySandbox.commandCount });
|
|
62
121
|
this.rollbackTo = (cp) => this.entitySandbox.rollbackTo(cp.index);
|
|
@@ -136,8 +195,8 @@ var EntityEditSandboxSession = class {
|
|
|
136
195
|
return {
|
|
137
196
|
revision: this.entityRevision,
|
|
138
197
|
audioScriptEntityId,
|
|
139
|
-
entities: this.
|
|
140
|
-
relations: this.
|
|
198
|
+
entities: this.entities.list(),
|
|
199
|
+
relations: this.relations.list()
|
|
141
200
|
};
|
|
142
201
|
}
|
|
143
202
|
appendLog(line) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-entry.mjs","names":[],"sources":["../src/sandbox/entity-script-session.ts","../src/sandbox/worker-entry.ts"],"sourcesContent":["import {\n EntityTimelineEditor,\n compileEntityRows,\n projectEntityTimeline,\n base64ToBytes,\n bytesToBase64,\n assertCanonicalEditorResources,\n assertMediaAssetWritePolicy,\n type ClipEntityId,\n type DeleteBgmInput,\n type DeleteClipInput,\n type DeleteClipTreeInput,\n type DeleteVoiceoverInput,\n type InsertCaptionClipInput,\n type InsertClipInput,\n type InsertMediaClipInput,\n type InsertMediaClipsInput,\n type InsertPlacedClipInput,\n type MoveClipInput,\n type MoveClipsToStartsInput,\n type MoveSequentialClipsInput,\n type MoveVoiceoverInput,\n type PatchCaptionStyleInput,\n type ReplaceMediaClipInput,\n type ReplaceSequentialClipsInput,\n type ReplaceClipContentInput,\n type SetBgmInput,\n type SetCaptionVisibilityInput,\n type SetClipPlacementInput,\n type SetClipSpeedInput,\n type SetClipVolumeInput,\n type TrimClipInput,\n type UpdateClipInput,\n type UpdateClipMarkerInput,\n type VideoDocument,\n type VoiceoverTakeInput,\n type VoiceoverTakeResult,\n} from '@mengine/medeo-client';\nimport {\n createEntityId,\n createRelationId,\n type EntityRelationRows,\n type EntityRow,\n type RelationRow,\n} from '@mengine/medeo-dsl';\n\nimport type {\n CreateEntityInput,\n EntityFacade,\n EntityStoreSnapshot,\n LinkRelationInput,\n RelationFacade,\n SandboxEntity,\n SandboxRelation,\n} from '../entity/entity-contract.ts';\nimport { EntitySandbox, type DomainIdFactory } from '../entity/entity-sandbox.ts';\nimport type { ChangePlan, ConsoleShim, EditSandboxSessionOptions, SandboxCheckpoint } from './script-session.ts';\n\nconst LOG_LINE_MAX = 2000;\nconst LOG_LINE_CAP = 1000;\nconst LOG_BYTE_CAP = 64 * 1024;\nconst TRUNCATE_MARK = '[truncated]';\nconst LOG_TRUNCATED = '[log truncated]';\n\n/** Model-facing timeline mutations whose source of truth is the Medeo Entity graph. */\nexport interface EntityEditFacade {\n insertClip(input: InsertClipInput): ClipEntityId;\n insertPlacedClip(input: InsertPlacedClipInput): ClipEntityId;\n updateClipMarker(input: UpdateClipMarkerInput): void;\n setClipPlacement(input: SetClipPlacementInput): void;\n moveSequentialClips(input: MoveSequentialClipsInput): void;\n moveClip(input: MoveClipInput): void;\n replaceClipContent(input: ReplaceClipContentInput): void;\n insertMediaClip(input: InsertMediaClipInput): ClipEntityId;\n insertMediaClips(input: InsertMediaClipsInput): readonly ClipEntityId[];\n replaceMediaClip(input: ReplaceMediaClipInput): void;\n setClipVolume(input: SetClipVolumeInput): void;\n setClipSpeed(input: SetClipSpeedInput): void;\n trimClip(input: TrimClipInput): void;\n replaceSequentialClips(input: ReplaceSequentialClipsInput): readonly ClipEntityId[];\n deleteClip(input: DeleteClipInput): void;\n deleteClipTree(input: DeleteClipTreeInput): void;\n updateClip(input: UpdateClipInput): void;\n upsertVoiceoverTake(input: VoiceoverTakeInput): VoiceoverTakeResult;\n moveVoiceover(input: MoveVoiceoverInput): void;\n moveClipsToStarts(input: MoveClipsToStartsInput): void;\n deleteVoiceover(input: DeleteVoiceoverInput): void;\n setBgm(input: SetBgmInput): ClipEntityId;\n deleteBgm(input: DeleteBgmInput): void;\n setCaptionVisibility(input: SetCaptionVisibilityInput): void;\n patchCaptionStyle(input: PatchCaptionStyleInput): void;\n insertCaptionClip(input: InsertCaptionClipInput): ClipEntityId;\n}\n\nexport interface EntityTimelineFacade {\n /** Return the current graph draft, including uncommitted commands. */\n snapshot(): EntityStoreSnapshot & { audioScriptEntityId: string };\n}\n\n/**\n * Entity-only sandbox session used by the production model path.\n *\n * Native timeline operations execute against a detached graph editor and are\n * then journaled as ordinary EntitySandbox commands. VideoDocument is retained\n * only for the request's document identity; it is never edited or projected\n * back into the graph.\n */\nexport class EntityEditSandboxSession {\n private readonly document: VideoDocument;\n private readonly entitySandbox: EntitySandbox;\n private readonly entityRevision: number;\n private readonly baseRows: EntityRelationRows;\n private readonly domainIdFactory: DomainIdFactory;\n private readonly logs: string[] = [];\n private readonly onLog: ((line: string) => void) | undefined;\n private logBytes = 0;\n private logCapped = false;\n\n readonly edit: EntityEditFacade;\n readonly timeline: EntityTimelineFacade;\n readonly entities: EntityFacade;\n readonly relations: RelationFacade;\n readonly console: ConsoleShim;\n readonly checkpoint: () => SandboxCheckpoint;\n readonly rollbackTo: (cp: SandboxCheckpoint) => void;\n\n constructor(document: VideoDocument, options?: EditSandboxSessionOptions) {\n this.document = structuredClone(document);\n this.entityRevision = options?.entityState?.revision ?? 0;\n this.baseRows = toDslRows(\n options?.entityState ?? { revision: 0, audioScriptEntityId: null, entities: [], relations: [] },\n );\n this.domainIdFactory =\n options?.domainIdFactory ??\n (() => {\n throw new Error('Entity id factory is unavailable in this sandbox host');\n });\n this.onLog = options?.onLog;\n this.entitySandbox = new EntitySandbox({\n state: options?.entityState,\n idFactory: this.domainIdFactory,\n onCommand: options?.onEntityCommand,\n onTruncate: options?.onEntityTruncate,\n });\n\n this.edit = this.buildEditFacade();\n this.timeline = { snapshot: () => this.snapshot() };\n this.entities = this.entitySandbox.entities;\n this.relations = this.entitySandbox.relations;\n this.console = this.buildConsoleShim();\n this.checkpoint = () => ({ index: this.entitySandbox.commandCount });\n this.rollbackTo = (cp) => this.entitySandbox.rollbackTo(cp.index);\n }\n\n buildPlan(baseVersion: string): ChangePlan {\n const entityPlan = this.entitySandbox.buildPlan();\n assertCanonicalEditorResources(toDslRows(entityPlan.rows));\n assertMediaAssetWritePolicy(this.baseRows, toDslRows(entityPlan.rows));\n if (entityPlan.rows.loroSnapshot) projectEntityTimeline(toDslRows(entityPlan.rows), this.document.meta);\n return {\n ...(entityPlan.rows.loroSnapshot\n ? {\n loro_update: bytesToBase64(\n compileEntityRows(base64ToBytes(entityPlan.rows.loroSnapshot), toDslRows(entityPlan.rows)).update,\n ),\n }\n : {}),\n plan_kind: 'entities',\n doc_id: this.document.meta.draft_id ?? '',\n base_version: baseVersion,\n ops: [],\n entity_base_revision: entityPlan.base_revision,\n entity_commands: entityPlan.commands,\n entity_rows: entityPlan.rows,\n deleted_entity_ids: entityPlan.deleted_entity_ids,\n deleted_relation_ids: entityPlan.deleted_relation_ids,\n preview: this.entitySandbox.renderPreview(),\n logs: this.logs.slice(),\n };\n }\n\n getLogs(): readonly string[] {\n return this.logs;\n }\n\n private buildEditFacade(): EntityEditFacade {\n return {\n insertClip: (input) => this.runNativeEdit((editor) => editor.insertClip(input)),\n insertPlacedClip: (input) => this.runNativeEdit((editor) => editor.insertPlacedClip(input)),\n updateClipMarker: (input) => this.runNativeEdit((editor) => editor.updateClipMarker(input)),\n setClipPlacement: (input) => this.runNativeEdit((editor) => editor.setClipPlacement(input)),\n moveSequentialClips: (input) => this.runNativeEdit((editor) => editor.moveSequentialClips(input)),\n moveClip: (input) => this.runNativeEdit((editor) => editor.moveClip(input)),\n replaceClipContent: (input) => this.runNativeEdit((editor) => editor.replaceClipContent(input)),\n insertMediaClip: (input) => this.runNativeEdit((editor) => editor.insertMediaClip(input)),\n insertMediaClips: (input) => this.runNativeEdit((editor) => editor.insertMediaClips(input)),\n replaceMediaClip: (input) => this.runNativeEdit((editor) => editor.replaceMediaClip(input)),\n setClipVolume: (input) => this.runNativeEdit((editor) => editor.setClipVolume(input)),\n setClipSpeed: (input) => this.runNativeEdit((editor) => editor.setClipSpeed(input)),\n trimClip: (input) => this.runNativeEdit((editor) => editor.trimClip(input)),\n replaceSequentialClips: (input) => this.runNativeEdit((editor) => editor.replaceSequentialClips(input)),\n deleteClip: (input) => this.runNativeEdit((editor) => editor.deleteClip(input)),\n deleteClipTree: (input) => this.runNativeEdit((editor) => editor.deleteClipTree(input)),\n updateClip: (input) => this.runNativeEdit((editor) => editor.updateClip(input)),\n upsertVoiceoverTake: (input) => this.runNativeEdit((editor) => editor.upsertVoiceoverTake(input)),\n moveVoiceover: (input) => this.runNativeEdit((editor) => editor.moveVoiceover(input)),\n moveClipsToStarts: (input) => this.runNativeEdit((editor) => editor.moveClipsToStarts(input)),\n deleteVoiceover: (input) => this.runNativeEdit((editor) => editor.deleteVoiceover(input)),\n setBgm: (input) => this.runNativeEdit((editor) => editor.setBgm(input)),\n deleteBgm: (input) => this.runNativeEdit((editor) => editor.deleteBgm(input)),\n setCaptionVisibility: (input) => this.runNativeEdit((editor) => editor.setCaptionVisibility(input)),\n patchCaptionStyle: (input) => this.runNativeEdit((editor) => editor.patchCaptionStyle(input)),\n insertCaptionClip: (input) => this.runNativeEdit((editor) => editor.insertCaptionClip(input)),\n };\n }\n\n private runNativeEdit<T>(mutate: (editor: EntityTimelineEditor) => T): T {\n const checkpoint = this.entitySandbox.commandCount;\n try {\n const before = this.entitySandbox.buildPlan().rows;\n const editor = new EntityTimelineEditor(toDslRows(before), this.domainIdFactory);\n const result = mutate(editor);\n const expected = fromDslRows(editor.rows(), before.revision, before.audioScriptEntityId);\n applyGraphDiff(this.entitySandbox, before, expected);\n const applied = this.entitySandbox.buildPlan().rows;\n if (!graphRowsEqual(applied, expected)) {\n throw new Error('Entity timeline command diff did not reproduce the editor result');\n }\n return result;\n } catch (error) {\n this.entitySandbox.rollbackTo(checkpoint);\n throw error;\n }\n }\n\n private snapshot(): EntityStoreSnapshot & { audioScriptEntityId: string } {\n const audioScriptEntityId = this.entitySandbox.audioScriptEntityId;\n if (audioScriptEntityId === null) throw new Error('Document AudioScript is not initialized');\n return {\n revision: this.entityRevision,\n audioScriptEntityId,\n entities: this.entitySandbox.entities.list(),\n relations: this.entitySandbox.relations.list(),\n };\n }\n\n private appendLog(line: string): void {\n if (this.logCapped) return;\n if (this.logs.length >= LOG_LINE_CAP || this.logBytes >= LOG_BYTE_CAP) {\n this.logs.push(LOG_TRUNCATED);\n this.logCapped = true;\n this.onLog?.(LOG_TRUNCATED);\n return;\n }\n const out =\n line.length > LOG_LINE_MAX ? `${line.slice(0, LOG_LINE_MAX - TRUNCATE_MARK.length)}${TRUNCATE_MARK}` : line;\n this.logs.push(out);\n this.logBytes += out.length;\n this.onLog?.(out);\n }\n\n private buildConsoleShim(): ConsoleShim {\n const write = (...args: unknown[]) => this.appendLog(args.map(formatLogArg).join(' '));\n return { log: write, info: write, warn: write, error: write };\n }\n}\n\nfunction applyGraphDiff(sandbox: EntitySandbox, before: EntityStoreSnapshot, after: EntityStoreSnapshot): void {\n const beforeEntities = new Map(before.entities.map((entity) => [entity.entity_id, entity]));\n const afterEntities = new Map(after.entities.map((entity) => [entity.entity_id, entity]));\n const beforeRelations = new Map(before.relations.map((relation) => [relation.relation_id, relation]));\n const afterRelations = new Map(after.relations.map((relation) => [relation.relation_id, relation]));\n\n for (const [entityId, previous] of beforeEntities) {\n const next = afterEntities.get(entityId);\n if (next != null && next.entity_kind !== previous.entity_kind) {\n throw new Error(\n `Entity id \"${entityId}\" cannot change kind from \"${previous.entity_kind}\" to \"${next.entity_kind}\"`,\n );\n }\n }\n for (const [relationId, previous] of beforeRelations) {\n const next = afterRelations.get(relationId);\n if (\n next != null &&\n (next.relation_kind !== previous.relation_kind ||\n next.endpoint_0_entity_id !== previous.endpoint_0_entity_id ||\n next.endpoint_1_entity_id !== previous.endpoint_1_entity_id)\n ) {\n throw new Error(`Relation id \"${relationId}\" cannot change kind or persisted endpoint positions`);\n }\n }\n\n const relationIdsToReplace = new Set(\n [...beforeRelations]\n .filter(([relationId, previous]) => {\n const next = afterRelations.get(relationId);\n return next != null && (!jsonEqual(previous.metadata, next.metadata) || !jsonEqual(previous.trace, next.trace));\n })\n .map(([relationId]) => relationId),\n );\n const relationIdsToUnlink = [...beforeRelations.keys()]\n .filter((relationId) => !afterRelations.has(relationId) || relationIdsToReplace.has(relationId))\n .sort();\n for (const relationId of relationIdsToUnlink) sandbox.relations.unlink({ relation_id: relationId });\n\n const entityIdsToDelete = [...beforeEntities.keys()].filter((entityId) => !afterEntities.has(entityId)).sort();\n for (const entityId of entityIdsToDelete) sandbox.entities.delete({ entity_id: entityId });\n\n const entitiesToCreate = [...afterEntities.values()]\n .filter((entity) => !beforeEntities.has(entity.entity_id))\n .sort((left, right) => left.entity_id.localeCompare(right.entity_id));\n for (const entity of entitiesToCreate) sandbox.entities.create(entity as CreateEntityInput);\n\n const entitiesToUpdate = [...afterEntities.values()]\n .filter((entity) => {\n const previous = beforeEntities.get(entity.entity_id);\n return previous != null && !jsonEqual(previous.payload, entity.payload);\n })\n .sort((left, right) => left.entity_id.localeCompare(right.entity_id));\n for (const entity of entitiesToUpdate) {\n sandbox.replaceOwnedPayload({ entity_id: entity.entity_id, payload: entity.payload });\n }\n\n const relationsToLink = [...afterRelations.values()]\n .filter((relation) => !beforeRelations.has(relation.relation_id) || relationIdsToReplace.has(relation.relation_id))\n .sort((left, right) => left.relation_id.localeCompare(right.relation_id));\n for (const relation of relationsToLink) linkRelation(sandbox, relation);\n}\n\nfunction linkRelation(sandbox: EntitySandbox, relation: SandboxRelation): void {\n if (relation.relation_kind === 'generated') {\n sandbox.relations.linkGenerated({\n relation_id: relation.relation_id,\n output_entity_id: relation.endpoint_0_entity_id,\n input_entity_id: relation.endpoint_1_entity_id,\n trace: relation.trace,\n });\n return;\n }\n if (relation.relation_kind === 'clip-anchor') {\n sandbox.relations.linkClipAnchor({\n relation_id: relation.relation_id,\n child_clip_entity_id: relation.endpoint_0_entity_id,\n host_clip_entity_id: relation.endpoint_1_entity_id,\n trace: relation.trace,\n });\n return;\n }\n if (relation.relation_kind === 'phonetic-script-render') {\n const firstIsVoice = sandbox.entities.get(relation.endpoint_0_entity_id)?.entity_kind === 'voice';\n sandbox.relations.linkPhoneticScriptRender({\n relation_id: relation.relation_id,\n output_entity_id: firstIsVoice ? relation.endpoint_0_entity_id : relation.endpoint_1_entity_id,\n phonetic_script_entity_id: firstIsVoice ? relation.endpoint_1_entity_id : relation.endpoint_0_entity_id,\n trace: relation.trace,\n });\n return;\n }\n if (relation.relation_kind === 'audio-script-source') {\n const firstIsScript = sandbox.entities.get(relation.endpoint_0_entity_id)?.entity_kind === 'audio-script';\n sandbox.relations.linkAudioScriptSource({\n relation_id: relation.relation_id,\n script_entity_id: firstIsScript ? relation.endpoint_0_entity_id : relation.endpoint_1_entity_id,\n source_entity_id: firstIsScript ? relation.endpoint_1_entity_id : relation.endpoint_0_entity_id,\n trace: relation.trace,\n });\n return;\n }\n sandbox.relations.link({\n relation_id: relation.relation_id,\n relation_kind: relation.relation_kind,\n endpoint_0_entity_id: relation.endpoint_0_entity_id,\n endpoint_1_entity_id: relation.endpoint_1_entity_id,\n metadata: relation.metadata,\n trace: relation.trace,\n } as LinkRelationInput);\n}\n\nfunction toDslRows(snapshot: EntityStoreSnapshot): EntityRelationRows {\n return {\n entities: snapshot.entities.map((entity) => ({\n entityId: createEntityId(entity.entity_id),\n entityKind: entity.entity_kind,\n payload: structuredClone(entity.payload),\n })) as EntityRow[],\n relations: snapshot.relations.map((relation) => ({\n relationId: createRelationId(relation.relation_id),\n relationKind: relation.relation_kind,\n endpoint0EntityId: createEntityId(relation.endpoint_0_entity_id),\n endpoint1EntityId: createEntityId(relation.endpoint_1_entity_id),\n metadata: structuredClone(relation.metadata),\n trace: structuredClone(relation.trace),\n })) as RelationRow[],\n };\n}\n\nfunction fromDslRows(\n rows: EntityRelationRows,\n revision: number,\n audioScriptEntityId: string | null,\n): EntityStoreSnapshot {\n return {\n revision,\n audioScriptEntityId,\n entities: rows.entities.map(\n (entity) =>\n ({\n entity_id: entity.entityId,\n entity_kind: entity.entityKind,\n payload: structuredClone(entity.payload),\n }) as SandboxEntity,\n ),\n relations: rows.relations.map(\n (relation) =>\n ({\n relation_id: relation.relationId,\n relation_kind: relation.relationKind,\n endpoint_0_entity_id: relation.endpoint0EntityId,\n endpoint_1_entity_id: relation.endpoint1EntityId,\n metadata: structuredClone(relation.metadata),\n trace: structuredClone(relation.trace),\n }) as SandboxRelation,\n ),\n };\n}\n\nfunction jsonEqual(left: unknown, right: unknown): boolean {\n if (Object.is(left, right)) return true;\n if (Array.isArray(left) || Array.isArray(right)) {\n return (\n Array.isArray(left) &&\n Array.isArray(right) &&\n left.length === right.length &&\n left.every((value, index) => jsonEqual(value, right[index]))\n );\n }\n if (!isRecord(left) || !isRecord(right)) return false;\n const leftKeys = Object.keys(left).sort();\n const rightKeys = Object.keys(right).sort();\n return (\n leftKeys.length === rightKeys.length &&\n leftKeys.every((key, index) => key === rightKeys[index] && jsonEqual(left[key], right[key]))\n );\n}\n\nfunction graphRowsEqual(left: EntityStoreSnapshot, right: EntityStoreSnapshot): boolean {\n if (\n left.revision !== right.revision ||\n left.audioScriptEntityId !== right.audioScriptEntityId ||\n left.entities.length !== right.entities.length ||\n left.relations.length !== right.relations.length\n ) {\n return false;\n }\n const rightEntities = new Map(right.entities.map((entity) => [entity.entity_id, entity]));\n const rightRelations = new Map(right.relations.map((relation) => [relation.relation_id, relation]));\n return (\n left.entities.every((entity) => jsonEqual(entity, rightEntities.get(entity.entity_id))) &&\n left.relations.every((relation) => jsonEqual(relation, rightRelations.get(relation.relation_id)))\n );\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\nfunction formatLogArg(value: unknown): string {\n if (typeof value === 'string') return value;\n if (typeof value === 'number' || typeof value === 'boolean' || value === null || value === undefined) {\n return String(value);\n }\n try {\n return JSON.stringify(value);\n } catch {\n return '[unstringifiable]';\n }\n}\n","/// <reference types=\"node\" />\n\nimport { randomUUID } from 'node:crypto';\nimport vm from 'node:vm';\nimport { parentPort, workerData } from 'node:worker_threads';\n\nimport type { JournalEntry, PartIdFactory, VideoDocument } from '@mengine/medeo-client';\n\nimport type { EntityCommand, EntityStoreSnapshot } from '../entity/entity-contract.ts';\nimport type { DomainIdFactory } from '../entity/entity-sandbox.ts';\nimport { EntityEditSandboxSession } from './entity-script-session.ts';\nimport { EditSandboxSession, type EditSandboxSessionOptions } from './script-session.ts';\n\n/**\n * Node worker entry for trusted edit scripts.\n *\n * Spawns the requested sandbox session, runs the agent script in a bare `vm`\n * context (no fetch/process/setTimeout), and streams journals + logs to the\n * host so hard timeout / OOM termination still preserves partial products.\n */\n\nexport interface WorkerData {\n document: VideoDocument;\n script: string;\n inputs?: Record<string, unknown>;\n entityState?: EntityStoreSnapshot;\n idLabel?: string;\n entityOnly?: boolean;\n}\n\ntype HostMessage =\n | { t: 'ready' }\n | { t: 'entry'; entry: JournalEntry }\n | { t: 'entity-entry'; command: EntityCommand }\n | { t: 'log'; line: string }\n | { t: 'truncate'; index: number }\n | { t: 'entity-truncate'; index: number }\n | {\n t: 'done';\n preview: string;\n opsCount: number;\n entityCommandsCount: number;\n loroUpdate?: string;\n entityBaseRevision: number;\n entityRows?: EntityStoreSnapshot;\n deletedEntityIds: readonly string[];\n deletedRelationIds: readonly string[];\n planKind: 'timeline' | 'entities';\n }\n | {\n t: 'fail';\n phase: 'parse' | 'runtime';\n error: { message: string; line?: number; column?: number; stack?: string };\n };\n\nconst data = workerData as WorkerData;\nif (parentPort == null) {\n throw new Error('worker-entry must run inside a worker_threads Worker');\n}\nconst port = parentPort;\n\nfunction post(message: HostMessage): void {\n port.postMessage(message);\n}\n\nfunction countingFactory(label: string): PartIdFactory {\n let n = 0;\n return (prefix) => `${prefix}_${label}${++n}`;\n}\n\nfunction domainIdFactory(label?: string): DomainIdFactory {\n let n = 0;\n return (prefix) => `${prefix}_${label == null ? randomUUID() : `${label}${++n}`}`;\n}\n\n/** Extract script line/column from the first `agent-script.js` stack frame. */\nfunction positionFromError(\n error: unknown,\n script?: string,\n phase?: 'parse' | 'runtime',\n): { line?: number; column?: number; stack?: string; message: string } {\n // Duck-type: vm SyntaxError in a worker may fail `instanceof Error` across realms.\n const obj = error != null && typeof error === 'object' ? (error as Record<string, unknown>) : null;\n const message =\n obj != null && typeof obj.message === 'string'\n ? obj.message\n : error instanceof Error\n ? error.message\n : String(error);\n const stack = obj != null && typeof obj.stack === 'string' ? obj.stack : undefined;\n\n let line = typeof obj?.lineNumber === 'number' ? obj.lineNumber : undefined;\n let column = typeof obj?.columnNumber === 'number' ? obj.columnNumber : undefined;\n\n if (stack != null) {\n // Prefer the header form `agent-script.js:N` (SyntaxError) or `agent-script.js:N:M`.\n const match = /agent-script\\.js:(\\d+)(?::(\\d+))?/.exec(stack);\n if (match != null) {\n line = Number(match[1]);\n if (match[2] != null) column = Number(match[2]);\n }\n }\n\n // Parse-phase refinement: V8 often points at the token after an unclosed\n // `{`/`(`/`[`; walk back one line when the previous line ends that way so\n // the reported line matches the agent-authored incomplete construct.\n if (phase === 'parse' && script != null && line != null && line >= 2) {\n const lines = script.split('\\n');\n const prev = lines[line - 2];\n if (prev != null && /[{([]\\s*$/.test(prev)) {\n line = line - 1;\n column = prev.length;\n }\n }\n\n return { message, line, column, stack };\n}\n\nasync function main(): Promise<void> {\n const idFactory = data.idLabel != null ? countingFactory(data.idLabel) : undefined;\n const options: EditSandboxSessionOptions = {\n idFactory,\n entityState: data.entityState,\n domainIdFactory: domainIdFactory(data.idLabel),\n onEntry: (entry) => post({ t: 'entry', entry }),\n onEntityCommand: (command) => post({ t: 'entity-entry', command }),\n onLog: (line) => post({ t: 'log', line }),\n onTruncate: (index) => post({ t: 'truncate', index }),\n onEntityTruncate: (index) => post({ t: 'entity-truncate', index }),\n };\n const session = data.entityOnly\n ? new EntityEditSandboxSession(data.document, options)\n : new EditSandboxSession(data.document, options);\n\n // Prelude stays on the same physical line as script line 1 so stack line\n // numbers map 1:1 onto the agent script (no leading newline).\n const wrapped = `(async (edit, timeline, entities, relations, checkpoint, rollbackTo, inputs, console) => {${data.script}\\n})`;\n\n const ctx = vm.createContext(Object.create(null) as Record<string, unknown>);\n\n let run: unknown;\n try {\n run = vm.runInContext(wrapped, ctx, { filename: 'agent-script.js' });\n } catch (error) {\n const pos = positionFromError(error, data.script, 'parse');\n post({ t: 'fail', phase: 'parse', error: pos });\n return;\n }\n\n if (typeof run !== 'function') {\n post({\n t: 'fail',\n phase: 'runtime',\n error: { message: 'agent script wrapper did not evaluate to a function' },\n });\n return;\n }\n\n try {\n const invoke = run as (\n edit: typeof session.edit,\n timeline: typeof session.timeline,\n entities: typeof session.entities,\n relations: typeof session.relations,\n checkpoint: typeof session.checkpoint,\n rollbackTo: typeof session.rollbackTo,\n inputs: Record<string, unknown>,\n console: typeof session.console,\n ) => Promise<unknown>;\n // Signal host that cold start is done; timeout wall-clock starts here.\n post({ t: 'ready' });\n await invoke(\n session.edit,\n session.timeline,\n session.entities,\n session.relations,\n session.checkpoint,\n session.rollbackTo,\n data.inputs ?? {},\n session.console,\n );\n } catch (error) {\n const pos = positionFromError(error, data.script, 'runtime');\n post({ t: 'fail', phase: 'runtime', error: pos });\n return;\n }\n\n const plan = session.buildPlan('');\n post({\n t: 'done',\n ...(plan.loro_update ? { loroUpdate: plan.loro_update } : {}),\n preview: plan.preview,\n opsCount: plan.ops.length,\n entityCommandsCount: plan.entity_commands.length,\n entityBaseRevision: plan.entity_base_revision,\n ...(plan.entity_rows !== undefined ? { entityRows: plan.entity_rows } : {}),\n deletedEntityIds: plan.deleted_entity_ids ?? [],\n deletedRelationIds: plan.deleted_relation_ids ?? [],\n planKind: plan.plan_kind,\n });\n}\n\nmain().catch((error: unknown) => {\n const pos = positionFromError(error);\n post({ t: 'fail', phase: 'runtime', error: pos });\n});\n"],"mappings":";;;;;;AA0DA,MAAM,eAAe;AACrB,MAAM,eAAe;AACrB,MAAM,eAAe,KAAK;AAC1B,MAAM,gBAAgB;AACtB,MAAM,gBAAgB;;;;;;;;;AA6CtB,IAAa,2BAAb,MAAsC;CACpC;CACA;CACA;CACA;CACA;CACA,OAAkC,CAAC;CACnC;CACA,WAAmB;CACnB,YAAoB;CAEpB;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,YAAY,UAAyB,SAAqC;EACxE,KAAK,WAAW,gBAAgB,QAAQ;EACxC,KAAK,iBAAiB,SAAS,aAAa,YAAY;EACxD,KAAK,WAAW,UACd,SAAS,eAAe;GAAE,UAAU;GAAG,qBAAqB;GAAM,UAAU,CAAC;GAAG,WAAW,CAAC;EAAE,CAChG;EACA,KAAK,kBACH,SAAS,0BACF;GACL,MAAM,IAAI,MAAM,uDAAuD;EACzE;EACF,KAAK,QAAQ,SAAS;EACtB,KAAK,gBAAgB,IAAI,cAAc;GACrC,OAAO,SAAS;GAChB,WAAW,KAAK;GAChB,WAAW,SAAS;GACpB,YAAY,SAAS;EACvB,CAAC;EAED,KAAK,OAAO,KAAK,gBAAgB;EACjC,KAAK,WAAW,EAAE,gBAAgB,KAAK,SAAS,EAAE;EAClD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,wBAAwB,CAAC;EAClD,UAAU,KAAK;CACjB,CAAC;AACH;AAEA,KAAK,EAAE,OAAO,UAAmB;CAE/B,KAAK;EAAE,GAAG;EAAQ,OAAO;EAAW,OADxB,kBAAkB,KACe;CAAE,CAAC;AAClD,CAAC"}
|
|
1
|
+
{"version":3,"file":"worker-entry.mjs","names":[],"sources":["../src/sandbox/business-facades.ts","../src/sandbox/entity-script-session.ts","../src/sandbox/worker-entry.ts"],"sourcesContent":["import type {\n BusinessEntityFacade,\n BusinessRelationFacade,\n EntityFacade,\n RelationFacade,\n} from '../entity/entity-contract.ts';\n\n/** Keep infrastructure rows available to assembly without exposing their management to scripts. */\nexport function businessFacades(\n entities: EntityFacade,\n relations: RelationFacade,\n): {\n entities: BusinessEntityFacade;\n relations: BusinessRelationFacade;\n} {\n const isAsset = (id: string) => entities.get(id)?.entity_kind === 'asset';\n const assertBusiness = (id: string) => {\n if (isAsset(id)) throw new Error('Asset entities are managed by host assembly');\n };\n const visibleRelation = (relation: ReturnType<RelationFacade['list']>[number]) =>\n relation.relation_kind !== 'physical-asset' &&\n !isAsset(relation.endpoint_0_entity_id) &&\n !isAsset(relation.endpoint_1_entity_id);\n return {\n entities: {\n list: () => entities.list().filter((entity) => entity.entity_kind !== 'asset'),\n get: (id) => (isAsset(id) ? null : entities.get(id)),\n create: (input) => {\n if ((input.entity_kind as string) === 'asset') throw new Error('Asset entities are managed by host assembly');\n return entities.create(input);\n },\n update: (input) => {\n assertBusiness(input.entity_id);\n entities.update(input);\n },\n declareFields: (input) => {\n assertBusiness(input.entity_id);\n entities.declareFields(input);\n },\n delete: (input) => {\n assertBusiness(input.entity_id);\n entities.delete(input);\n },\n readCaptionContent: (input) => entities.readCaptionContent(input),\n readPhoneticScriptContent: (input) => entities.readPhoneticScriptContent(input),\n ensureMedia: (input) => entities.ensureMedia(input),\n },\n relations: {\n list: () => relations.list().filter(visibleRelation),\n of: (id, kind) => relations.of(id, kind).filter(visibleRelation),\n link: (input) => {\n if ((input.relation_kind as string) === 'physical-asset')\n throw new Error('Asset bindings are managed by host assembly');\n assertBusiness(input.endpoint_0_entity_id);\n assertBusiness(input.endpoint_1_entity_id);\n return relations.link(input);\n },\n unlink: (input) => {\n const relation = relations.list().find((row) => row.relation_id === input.relation_id);\n if (relation && !visibleRelation(relation)) throw new Error('Asset bindings are managed by host assembly');\n relations.unlink(input);\n },\n linkGenerated: (input) => {\n assertBusiness(input.output_entity_id);\n assertBusiness(input.input_entity_id);\n return relations.linkGenerated(input);\n },\n linkClipAnchor: (input) => relations.linkClipAnchor(input),\n linkPhoneticScriptRender: (input) => relations.linkPhoneticScriptRender(input),\n linkAudioScriptSource: (input) => relations.linkAudioScriptSource(input),\n },\n };\n}\n","import {\n EntityTimelineEditor,\n compileEntityRows,\n projectEntityTimeline,\n base64ToBytes,\n bytesToBase64,\n assertCanonicalEditorResources,\n assertMediaAssetWritePolicy,\n type ClipEntityId,\n type DeleteBgmInput,\n type DeleteClipInput,\n type DeleteClipTreeInput,\n type DeleteVoiceoverInput,\n type InsertCaptionClipInput,\n type InsertClipInput,\n type InsertMediaClipInput,\n type InsertMediaClipsInput,\n type InsertPlacedClipInput,\n type MoveClipInput,\n type MoveClipsToStartsInput,\n type MoveSequentialClipsInput,\n type MoveVoiceoverInput,\n type PatchCaptionStyleInput,\n type ReplaceMediaClipInput,\n type ReplaceSequentialClipsInput,\n type ReplaceClipContentInput,\n type SetBgmInput,\n type SetCaptionVisibilityInput,\n type SetClipPlacementInput,\n type SetClipSpeedInput,\n type SetClipVolumeInput,\n type TrimClipInput,\n type UpdateClipInput,\n type UpdateClipMarkerInput,\n type VideoDocument,\n type VoiceoverTakeInput,\n type VoiceoverTakeResult,\n} from '@mengine/medeo-client';\nimport {\n createEntityId,\n createRelationId,\n type EntityRelationRows,\n type EntityRow,\n type RelationRow,\n} from '@mengine/medeo-dsl';\n\nimport type {\n CreateEntityInput,\n BusinessEntityFacade,\n EntityStoreSnapshot,\n LinkRelationInput,\n BusinessRelationFacade,\n SandboxEntity,\n SandboxRelation,\n} from '../entity/entity-contract.ts';\nimport { EntitySandbox, type DomainIdFactory } from '../entity/entity-sandbox.ts';\nimport { businessFacades } from './business-facades.ts';\nimport type { ChangePlan, ConsoleShim, EditSandboxSessionOptions, SandboxCheckpoint } from './script-session.ts';\n\nconst LOG_LINE_MAX = 2000;\nconst LOG_LINE_CAP = 1000;\nconst LOG_BYTE_CAP = 64 * 1024;\nconst TRUNCATE_MARK = '[truncated]';\nconst LOG_TRUNCATED = '[log truncated]';\n\n/** Model-facing timeline mutations whose source of truth is the Medeo Entity graph. */\nexport interface EntityEditFacade {\n insertClip(input: InsertClipInput): ClipEntityId;\n insertPlacedClip(input: InsertPlacedClipInput): ClipEntityId;\n updateClipMarker(input: UpdateClipMarkerInput): void;\n setClipPlacement(input: SetClipPlacementInput): void;\n moveSequentialClips(input: MoveSequentialClipsInput): void;\n moveClip(input: MoveClipInput): void;\n replaceClipContent(input: ReplaceClipContentInput): void;\n insertMediaClip(input: InsertMediaClipInput): ClipEntityId;\n insertMediaClips(input: InsertMediaClipsInput): readonly ClipEntityId[];\n replaceMediaClip(input: ReplaceMediaClipInput): void;\n setClipVolume(input: SetClipVolumeInput): void;\n setClipSpeed(input: SetClipSpeedInput): void;\n trimClip(input: TrimClipInput): void;\n replaceSequentialClips(input: ReplaceSequentialClipsInput): readonly ClipEntityId[];\n deleteClip(input: DeleteClipInput): void;\n deleteClipTree(input: DeleteClipTreeInput): void;\n updateClip(input: UpdateClipInput): void;\n upsertVoiceoverTake(input: VoiceoverTakeInput): VoiceoverTakeResult;\n moveVoiceover(input: MoveVoiceoverInput): void;\n moveClipsToStarts(input: MoveClipsToStartsInput): void;\n deleteVoiceover(input: DeleteVoiceoverInput): void;\n setBgm(input: SetBgmInput): ClipEntityId;\n deleteBgm(input: DeleteBgmInput): void;\n setCaptionVisibility(input: SetCaptionVisibilityInput): void;\n patchCaptionStyle(input: PatchCaptionStyleInput): void;\n insertCaptionClip(input: InsertCaptionClipInput): ClipEntityId;\n}\n\nexport interface EntityTimelineFacade {\n /** Return the current graph draft, including uncommitted commands. */\n snapshot(): EntityStoreSnapshot & { audioScriptEntityId: string };\n}\n\n/**\n * Entity-only sandbox session used by the production model path.\n *\n * Native timeline operations execute against a detached graph editor and are\n * then journaled as ordinary EntitySandbox commands. VideoDocument is retained\n * only for the request's document identity; it is never edited or projected\n * back into the graph.\n */\nexport class EntityEditSandboxSession {\n private readonly document: VideoDocument;\n private readonly entitySandbox: EntitySandbox;\n private readonly entityRevision: number;\n private readonly baseRows: EntityRelationRows;\n private readonly domainIdFactory: DomainIdFactory;\n private readonly logs: string[] = [];\n private readonly onLog: ((line: string) => void) | undefined;\n private logBytes = 0;\n private logCapped = false;\n\n readonly edit: EntityEditFacade;\n readonly timeline: EntityTimelineFacade;\n readonly entities: BusinessEntityFacade;\n readonly relations: BusinessRelationFacade;\n readonly console: ConsoleShim;\n readonly checkpoint: () => SandboxCheckpoint;\n readonly rollbackTo: (cp: SandboxCheckpoint) => void;\n\n constructor(document: VideoDocument, options?: EditSandboxSessionOptions) {\n this.document = structuredClone(document);\n this.entityRevision = options?.entityState?.revision ?? 0;\n this.baseRows = toDslRows(\n options?.entityState ?? { revision: 0, audioScriptEntityId: null, entities: [], relations: [] },\n );\n this.domainIdFactory =\n options?.domainIdFactory ??\n (() => {\n throw new Error('Entity id factory is unavailable in this sandbox host');\n });\n this.onLog = options?.onLog;\n this.entitySandbox = new EntitySandbox({\n state: options?.entityState,\n idFactory: this.domainIdFactory,\n onCommand: options?.onEntityCommand,\n onTruncate: options?.onEntityTruncate,\n });\n\n this.edit = this.buildEditFacade();\n this.timeline = { snapshot: () => this.snapshot() };\n const business = businessFacades(this.entitySandbox.entities, this.entitySandbox.relations);\n this.entities = business.entities;\n this.relations = business.relations;\n this.console = this.buildConsoleShim();\n this.checkpoint = () => ({ index: this.entitySandbox.commandCount });\n this.rollbackTo = (cp) => this.entitySandbox.rollbackTo(cp.index);\n }\n\n buildPlan(baseVersion: string): ChangePlan {\n const entityPlan = this.entitySandbox.buildPlan();\n assertCanonicalEditorResources(toDslRows(entityPlan.rows));\n assertMediaAssetWritePolicy(this.baseRows, toDslRows(entityPlan.rows));\n if (entityPlan.rows.loroSnapshot) projectEntityTimeline(toDslRows(entityPlan.rows), this.document.meta);\n return {\n ...(entityPlan.rows.loroSnapshot\n ? {\n loro_update: bytesToBase64(\n compileEntityRows(base64ToBytes(entityPlan.rows.loroSnapshot), toDslRows(entityPlan.rows)).update,\n ),\n }\n : {}),\n plan_kind: 'entities',\n doc_id: this.document.meta.draft_id ?? '',\n base_version: baseVersion,\n ops: [],\n entity_base_revision: entityPlan.base_revision,\n entity_commands: entityPlan.commands,\n entity_rows: entityPlan.rows,\n deleted_entity_ids: entityPlan.deleted_entity_ids,\n deleted_relation_ids: entityPlan.deleted_relation_ids,\n preview: this.entitySandbox.renderPreview(),\n logs: this.logs.slice(),\n };\n }\n\n getLogs(): readonly string[] {\n return this.logs;\n }\n\n private buildEditFacade(): EntityEditFacade {\n return {\n insertClip: (input) => this.runNativeEdit((editor) => editor.insertClip(input)),\n insertPlacedClip: (input) => this.runNativeEdit((editor) => editor.insertPlacedClip(input)),\n updateClipMarker: (input) => this.runNativeEdit((editor) => editor.updateClipMarker(input)),\n setClipPlacement: (input) => this.runNativeEdit((editor) => editor.setClipPlacement(input)),\n moveSequentialClips: (input) => this.runNativeEdit((editor) => editor.moveSequentialClips(input)),\n moveClip: (input) => this.runNativeEdit((editor) => editor.moveClip(input)),\n replaceClipContent: (input) => this.runNativeEdit((editor) => editor.replaceClipContent(input)),\n insertMediaClip: (input) => this.runNativeEdit((editor) => editor.insertMediaClip(input)),\n insertMediaClips: (input) => this.runNativeEdit((editor) => editor.insertMediaClips(input)),\n replaceMediaClip: (input) => this.runNativeEdit((editor) => editor.replaceMediaClip(input)),\n setClipVolume: (input) => this.runNativeEdit((editor) => editor.setClipVolume(input)),\n setClipSpeed: (input) => this.runNativeEdit((editor) => editor.setClipSpeed(input)),\n trimClip: (input) => this.runNativeEdit((editor) => editor.trimClip(input)),\n replaceSequentialClips: (input) => this.runNativeEdit((editor) => editor.replaceSequentialClips(input)),\n deleteClip: (input) => this.runNativeEdit((editor) => editor.deleteClip(input)),\n deleteClipTree: (input) => this.runNativeEdit((editor) => editor.deleteClipTree(input)),\n updateClip: (input) => this.runNativeEdit((editor) => editor.updateClip(input)),\n upsertVoiceoverTake: (input) => this.runNativeEdit((editor) => editor.upsertVoiceoverTake(input)),\n moveVoiceover: (input) => this.runNativeEdit((editor) => editor.moveVoiceover(input)),\n moveClipsToStarts: (input) => this.runNativeEdit((editor) => editor.moveClipsToStarts(input)),\n deleteVoiceover: (input) => this.runNativeEdit((editor) => editor.deleteVoiceover(input)),\n setBgm: (input) => this.runNativeEdit((editor) => editor.setBgm(input)),\n deleteBgm: (input) => this.runNativeEdit((editor) => editor.deleteBgm(input)),\n setCaptionVisibility: (input) => this.runNativeEdit((editor) => editor.setCaptionVisibility(input)),\n patchCaptionStyle: (input) => this.runNativeEdit((editor) => editor.patchCaptionStyle(input)),\n insertCaptionClip: (input) => this.runNativeEdit((editor) => editor.insertCaptionClip(input)),\n };\n }\n\n private runNativeEdit<T>(mutate: (editor: EntityTimelineEditor) => T): T {\n const checkpoint = this.entitySandbox.commandCount;\n try {\n const before = this.entitySandbox.buildPlan().rows;\n const editor = new EntityTimelineEditor(toDslRows(before), this.domainIdFactory);\n const result = mutate(editor);\n const expected = fromDslRows(editor.rows(), before.revision, before.audioScriptEntityId);\n applyGraphDiff(this.entitySandbox, before, expected);\n const applied = this.entitySandbox.buildPlan().rows;\n if (!graphRowsEqual(applied, expected)) {\n throw new Error('Entity timeline command diff did not reproduce the editor result');\n }\n return result;\n } catch (error) {\n this.entitySandbox.rollbackTo(checkpoint);\n throw error;\n }\n }\n\n private snapshot(): EntityStoreSnapshot & { audioScriptEntityId: string } {\n const audioScriptEntityId = this.entitySandbox.audioScriptEntityId;\n if (audioScriptEntityId === null) throw new Error('Document AudioScript is not initialized');\n return {\n revision: this.entityRevision,\n audioScriptEntityId,\n entities: this.entities.list(),\n relations: this.relations.list(),\n };\n }\n\n private appendLog(line: string): void {\n if (this.logCapped) return;\n if (this.logs.length >= LOG_LINE_CAP || this.logBytes >= LOG_BYTE_CAP) {\n this.logs.push(LOG_TRUNCATED);\n this.logCapped = true;\n this.onLog?.(LOG_TRUNCATED);\n return;\n }\n const out =\n line.length > LOG_LINE_MAX ? `${line.slice(0, LOG_LINE_MAX - TRUNCATE_MARK.length)}${TRUNCATE_MARK}` : line;\n this.logs.push(out);\n this.logBytes += out.length;\n this.onLog?.(out);\n }\n\n private buildConsoleShim(): ConsoleShim {\n const write = (...args: unknown[]) => this.appendLog(args.map(formatLogArg).join(' '));\n return { log: write, info: write, warn: write, error: write };\n }\n}\n\nfunction applyGraphDiff(sandbox: EntitySandbox, before: EntityStoreSnapshot, after: EntityStoreSnapshot): void {\n const beforeEntities = new Map(before.entities.map((entity) => [entity.entity_id, entity]));\n const afterEntities = new Map(after.entities.map((entity) => [entity.entity_id, entity]));\n const beforeRelations = new Map(before.relations.map((relation) => [relation.relation_id, relation]));\n const afterRelations = new Map(after.relations.map((relation) => [relation.relation_id, relation]));\n\n for (const [entityId, previous] of beforeEntities) {\n const next = afterEntities.get(entityId);\n if (next != null && next.entity_kind !== previous.entity_kind) {\n throw new Error(\n `Entity id \"${entityId}\" cannot change kind from \"${previous.entity_kind}\" to \"${next.entity_kind}\"`,\n );\n }\n }\n for (const [relationId, previous] of beforeRelations) {\n const next = afterRelations.get(relationId);\n if (\n next != null &&\n (next.relation_kind !== previous.relation_kind ||\n next.endpoint_0_entity_id !== previous.endpoint_0_entity_id ||\n next.endpoint_1_entity_id !== previous.endpoint_1_entity_id)\n ) {\n throw new Error(`Relation id \"${relationId}\" cannot change kind or persisted endpoint positions`);\n }\n }\n\n const relationIdsToReplace = new Set(\n [...beforeRelations]\n .filter(([relationId, previous]) => {\n const next = afterRelations.get(relationId);\n return next != null && (!jsonEqual(previous.metadata, next.metadata) || !jsonEqual(previous.trace, next.trace));\n })\n .map(([relationId]) => relationId),\n );\n const relationIdsToUnlink = [...beforeRelations.keys()]\n .filter((relationId) => !afterRelations.has(relationId) || relationIdsToReplace.has(relationId))\n .sort();\n for (const relationId of relationIdsToUnlink) sandbox.relations.unlink({ relation_id: relationId });\n\n const entityIdsToDelete = [...beforeEntities.keys()].filter((entityId) => !afterEntities.has(entityId)).sort();\n for (const entityId of entityIdsToDelete) sandbox.entities.delete({ entity_id: entityId });\n\n const entitiesToCreate = [...afterEntities.values()]\n .filter((entity) => !beforeEntities.has(entity.entity_id))\n .sort((left, right) => left.entity_id.localeCompare(right.entity_id));\n for (const entity of entitiesToCreate) sandbox.entities.create(entity as CreateEntityInput);\n\n const entitiesToUpdate = [...afterEntities.values()]\n .filter((entity) => {\n const previous = beforeEntities.get(entity.entity_id);\n return previous != null && !jsonEqual(previous.payload, entity.payload);\n })\n .sort((left, right) => left.entity_id.localeCompare(right.entity_id));\n for (const entity of entitiesToUpdate) {\n sandbox.replaceOwnedPayload({ entity_id: entity.entity_id, payload: entity.payload });\n }\n\n const relationsToLink = [...afterRelations.values()]\n .filter((relation) => !beforeRelations.has(relation.relation_id) || relationIdsToReplace.has(relation.relation_id))\n .sort((left, right) => left.relation_id.localeCompare(right.relation_id));\n for (const relation of relationsToLink) linkRelation(sandbox, relation);\n}\n\nfunction linkRelation(sandbox: EntitySandbox, relation: SandboxRelation): void {\n if (relation.relation_kind === 'generated') {\n sandbox.relations.linkGenerated({\n relation_id: relation.relation_id,\n output_entity_id: relation.endpoint_0_entity_id,\n input_entity_id: relation.endpoint_1_entity_id,\n trace: relation.trace,\n });\n return;\n }\n if (relation.relation_kind === 'clip-anchor') {\n sandbox.relations.linkClipAnchor({\n relation_id: relation.relation_id,\n child_clip_entity_id: relation.endpoint_0_entity_id,\n host_clip_entity_id: relation.endpoint_1_entity_id,\n trace: relation.trace,\n });\n return;\n }\n if (relation.relation_kind === 'phonetic-script-render') {\n const firstIsVoice = sandbox.entities.get(relation.endpoint_0_entity_id)?.entity_kind === 'voice';\n sandbox.relations.linkPhoneticScriptRender({\n relation_id: relation.relation_id,\n output_entity_id: firstIsVoice ? relation.endpoint_0_entity_id : relation.endpoint_1_entity_id,\n phonetic_script_entity_id: firstIsVoice ? relation.endpoint_1_entity_id : relation.endpoint_0_entity_id,\n trace: relation.trace,\n });\n return;\n }\n if (relation.relation_kind === 'audio-script-source') {\n const firstIsScript = sandbox.entities.get(relation.endpoint_0_entity_id)?.entity_kind === 'audio-script';\n sandbox.relations.linkAudioScriptSource({\n relation_id: relation.relation_id,\n script_entity_id: firstIsScript ? relation.endpoint_0_entity_id : relation.endpoint_1_entity_id,\n source_entity_id: firstIsScript ? relation.endpoint_1_entity_id : relation.endpoint_0_entity_id,\n trace: relation.trace,\n });\n return;\n }\n sandbox.relations.link({\n relation_id: relation.relation_id,\n relation_kind: relation.relation_kind,\n endpoint_0_entity_id: relation.endpoint_0_entity_id,\n endpoint_1_entity_id: relation.endpoint_1_entity_id,\n metadata: relation.metadata,\n trace: relation.trace,\n } as LinkRelationInput);\n}\n\nfunction toDslRows(snapshot: EntityStoreSnapshot): EntityRelationRows {\n return {\n entities: snapshot.entities.map((entity) => ({\n entityId: createEntityId(entity.entity_id),\n entityKind: entity.entity_kind,\n payload: structuredClone(entity.payload),\n })) as EntityRow[],\n relations: snapshot.relations.map((relation) => ({\n relationId: createRelationId(relation.relation_id),\n relationKind: relation.relation_kind,\n endpoint0EntityId: createEntityId(relation.endpoint_0_entity_id),\n endpoint1EntityId: createEntityId(relation.endpoint_1_entity_id),\n metadata: structuredClone(relation.metadata),\n trace: structuredClone(relation.trace),\n })) as RelationRow[],\n };\n}\n\nfunction fromDslRows(\n rows: EntityRelationRows,\n revision: number,\n audioScriptEntityId: string | null,\n): EntityStoreSnapshot {\n return {\n revision,\n audioScriptEntityId,\n entities: rows.entities.map(\n (entity) =>\n ({\n entity_id: entity.entityId,\n entity_kind: entity.entityKind,\n payload: structuredClone(entity.payload),\n }) as SandboxEntity,\n ),\n relations: rows.relations.map(\n (relation) =>\n ({\n relation_id: relation.relationId,\n relation_kind: relation.relationKind,\n endpoint_0_entity_id: relation.endpoint0EntityId,\n endpoint_1_entity_id: relation.endpoint1EntityId,\n metadata: structuredClone(relation.metadata),\n trace: structuredClone(relation.trace),\n }) as SandboxRelation,\n ),\n };\n}\n\nfunction jsonEqual(left: unknown, right: unknown): boolean {\n if (Object.is(left, right)) return true;\n if (Array.isArray(left) || Array.isArray(right)) {\n return (\n Array.isArray(left) &&\n Array.isArray(right) &&\n left.length === right.length &&\n left.every((value, index) => jsonEqual(value, right[index]))\n );\n }\n if (!isRecord(left) || !isRecord(right)) return false;\n const leftKeys = Object.keys(left).sort();\n const rightKeys = Object.keys(right).sort();\n return (\n leftKeys.length === rightKeys.length &&\n leftKeys.every((key, index) => key === rightKeys[index] && jsonEqual(left[key], right[key]))\n );\n}\n\nfunction graphRowsEqual(left: EntityStoreSnapshot, right: EntityStoreSnapshot): boolean {\n if (\n left.revision !== right.revision ||\n left.audioScriptEntityId !== right.audioScriptEntityId ||\n left.entities.length !== right.entities.length ||\n left.relations.length !== right.relations.length\n ) {\n return false;\n }\n const rightEntities = new Map(right.entities.map((entity) => [entity.entity_id, entity]));\n const rightRelations = new Map(right.relations.map((relation) => [relation.relation_id, relation]));\n return (\n left.entities.every((entity) => jsonEqual(entity, rightEntities.get(entity.entity_id))) &&\n left.relations.every((relation) => jsonEqual(relation, rightRelations.get(relation.relation_id)))\n );\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\nfunction formatLogArg(value: unknown): string {\n if (typeof value === 'string') return value;\n if (typeof value === 'number' || typeof value === 'boolean' || value === null || value === undefined) {\n return String(value);\n }\n try {\n return JSON.stringify(value);\n } catch {\n return '[unstringifiable]';\n }\n}\n","/// <reference types=\"node\" />\n\nimport { randomUUID } from 'node:crypto';\nimport vm from 'node:vm';\nimport { parentPort, workerData } from 'node:worker_threads';\n\nimport type { JournalEntry, PartIdFactory, VideoDocument } from '@mengine/medeo-client';\n\nimport type { EntityCommand, EntityStoreSnapshot } from '../entity/entity-contract.ts';\nimport type { DomainIdFactory } from '../entity/entity-sandbox.ts';\nimport { EntityEditSandboxSession } from './entity-script-session.ts';\nimport { EditSandboxSession, type EditSandboxSessionOptions } from './script-session.ts';\n\n/**\n * Node worker entry for trusted edit scripts.\n *\n * Spawns the requested sandbox session, runs the agent script in a bare `vm`\n * context (no fetch/process/setTimeout), and streams journals + logs to the\n * host so hard timeout / OOM termination still preserves partial products.\n */\n\nexport interface WorkerData {\n document: VideoDocument;\n script: string;\n inputs?: Record<string, unknown>;\n entityState?: EntityStoreSnapshot;\n idLabel?: string;\n entityOnly?: boolean;\n}\n\ntype HostMessage =\n | { t: 'ready' }\n | { t: 'entry'; entry: JournalEntry }\n | { t: 'entity-entry'; command: EntityCommand }\n | { t: 'log'; line: string }\n | { t: 'truncate'; index: number }\n | { t: 'entity-truncate'; index: number }\n | {\n t: 'done';\n preview: string;\n opsCount: number;\n entityCommandsCount: number;\n loroUpdate?: string;\n entityBaseRevision: number;\n entityRows?: EntityStoreSnapshot;\n deletedEntityIds: readonly string[];\n deletedRelationIds: readonly string[];\n planKind: 'timeline' | 'entities';\n }\n | {\n t: 'fail';\n phase: 'parse' | 'runtime';\n error: { message: string; line?: number; column?: number; stack?: string };\n };\n\nconst data = workerData as WorkerData;\nif (parentPort == null) {\n throw new Error('worker-entry must run inside a worker_threads Worker');\n}\nconst port = parentPort;\n\nfunction post(message: HostMessage): void {\n port.postMessage(message);\n}\n\nfunction countingFactory(label: string): PartIdFactory {\n let n = 0;\n return (prefix) => `${prefix}_${label}${++n}`;\n}\n\nfunction domainIdFactory(label?: string): DomainIdFactory {\n let n = 0;\n return (prefix) => `${prefix}_${label == null ? randomUUID() : `${label}${++n}`}`;\n}\n\n/** Extract script line/column from the first `agent-script.js` stack frame. */\nfunction positionFromError(\n error: unknown,\n script?: string,\n phase?: 'parse' | 'runtime',\n): { line?: number; column?: number; stack?: string; message: string } {\n // Duck-type: vm SyntaxError in a worker may fail `instanceof Error` across realms.\n const obj = error != null && typeof error === 'object' ? (error as Record<string, unknown>) : null;\n const message =\n obj != null && typeof obj.message === 'string'\n ? obj.message\n : error instanceof Error\n ? error.message\n : String(error);\n const stack = obj != null && typeof obj.stack === 'string' ? obj.stack : undefined;\n\n let line = typeof obj?.lineNumber === 'number' ? obj.lineNumber : undefined;\n let column = typeof obj?.columnNumber === 'number' ? obj.columnNumber : undefined;\n\n if (stack != null) {\n // Prefer the header form `agent-script.js:N` (SyntaxError) or `agent-script.js:N:M`.\n const match = /agent-script\\.js:(\\d+)(?::(\\d+))?/.exec(stack);\n if (match != null) {\n line = Number(match[1]);\n if (match[2] != null) column = Number(match[2]);\n }\n }\n\n // Parse-phase refinement: V8 often points at the token after an unclosed\n // `{`/`(`/`[`; walk back one line when the previous line ends that way so\n // the reported line matches the agent-authored incomplete construct.\n if (phase === 'parse' && script != null && line != null && line >= 2) {\n const lines = script.split('\\n');\n const prev = lines[line - 2];\n if (prev != null && /[{([]\\s*$/.test(prev)) {\n line = line - 1;\n column = prev.length;\n }\n }\n\n return { message, line, column, stack };\n}\n\nasync function main(): Promise<void> {\n const idFactory = data.idLabel != null ? countingFactory(data.idLabel) : undefined;\n const options: EditSandboxSessionOptions = {\n idFactory,\n entityState: data.entityState,\n domainIdFactory: domainIdFactory(data.idLabel),\n onEntry: (entry) => post({ t: 'entry', entry }),\n onEntityCommand: (command) => post({ t: 'entity-entry', command }),\n onLog: (line) => post({ t: 'log', line }),\n onTruncate: (index) => post({ t: 'truncate', index }),\n onEntityTruncate: (index) => post({ t: 'entity-truncate', index }),\n };\n const session = data.entityOnly\n ? new EntityEditSandboxSession(data.document, options)\n : new EditSandboxSession(data.document, options);\n\n // Prelude stays on the same physical line as script line 1 so stack line\n // numbers map 1:1 onto the agent script (no leading newline).\n const wrapped = `(async (edit, timeline, entities, relations, checkpoint, rollbackTo, inputs, console) => {${data.script}\\n})`;\n\n const ctx = vm.createContext(Object.create(null) as Record<string, unknown>);\n\n let run: unknown;\n try {\n run = vm.runInContext(wrapped, ctx, { filename: 'agent-script.js' });\n } catch (error) {\n const pos = positionFromError(error, data.script, 'parse');\n post({ t: 'fail', phase: 'parse', error: pos });\n return;\n }\n\n if (typeof run !== 'function') {\n post({\n t: 'fail',\n phase: 'runtime',\n error: { message: 'agent script wrapper did not evaluate to a function' },\n });\n return;\n }\n\n try {\n const invoke = run as (\n edit: typeof session.edit,\n timeline: typeof session.timeline,\n entities: typeof session.entities,\n relations: typeof session.relations,\n checkpoint: typeof session.checkpoint,\n rollbackTo: typeof session.rollbackTo,\n inputs: Record<string, unknown>,\n console: typeof session.console,\n ) => Promise<unknown>;\n // Signal host that cold start is done; timeout wall-clock starts here.\n post({ t: 'ready' });\n await invoke(\n session.edit,\n session.timeline,\n session.entities,\n session.relations,\n session.checkpoint,\n session.rollbackTo,\n data.inputs ?? {},\n session.console,\n );\n } catch (error) {\n const pos = positionFromError(error, data.script, 'runtime');\n post({ t: 'fail', phase: 'runtime', error: pos });\n return;\n }\n\n const plan = session.buildPlan('');\n post({\n t: 'done',\n ...(plan.loro_update ? { loroUpdate: plan.loro_update } : {}),\n preview: plan.preview,\n opsCount: plan.ops.length,\n entityCommandsCount: plan.entity_commands.length,\n entityBaseRevision: plan.entity_base_revision,\n ...(plan.entity_rows !== undefined ? { entityRows: plan.entity_rows } : {}),\n deletedEntityIds: plan.deleted_entity_ids ?? [],\n deletedRelationIds: plan.deleted_relation_ids ?? [],\n planKind: plan.plan_kind,\n });\n}\n\nmain().catch((error: unknown) => {\n const pos = positionFromError(error);\n post({ t: 'fail', phase: 'runtime', error: pos });\n});\n"],"mappings":";;;;;;;AAQA,SAAgB,gBACd,UACA,WAIA;CACA,MAAM,WAAW,OAAe,SAAS,IAAI,EAAE,GAAG,gBAAgB;CAClE,MAAM,kBAAkB,OAA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ClD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mengine/medeo-tool",
|
|
3
|
-
"version": "1.3.1-alpha.
|
|
3
|
+
"version": "1.3.1-alpha.12",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"registry": "https://registry.npmjs.org/"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@mengine/medeo-client": "1.3.1-alpha.
|
|
27
|
+
"@mengine/medeo-client": "1.3.1-alpha.12"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "^25.9.1",
|